import{M as ln,R as an,S as y,T as tn,O as X,P as O,W as _,X as un,Q as N,N as rn,V as j,Y as o,Z as sn,$ as on,a0 as fn}from"./mermaid.core-CS_oxXme-B5MUZ5G5.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,S,v,R,Q,a){var D=q-l,i=S-h,n=Q-v,d=a-R,u=d*D-n*i;if(!(u*u<y))return u=(n*(h-R)-d*(l-v))/u,[l+u*D,h+u*i]}function H(l,h,q,S,v,R,Q){var a=l-q,D=h-S,i=(Q?R:-R)/j(a*a+D*D),n=i*D,d=-i*a,u=l+n,s=h+d,f=q+n,c=S+d,V=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,A=m*m+g*g,T=v-R,P=u*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),I=(P*g-m*E)/A,M=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=I-V,e=M-t,r=w-V,W=p-t;return x*x+e*e>r*r+W*W&&(I=w,M=p),{cx:I,cy:M,x01:-n,y01:-d,x11:I*(v/T-1),y11:M*(v/T-1)}}function hn(){var l=cn,h=yn,q=N(0),S=null,v=gn,R=dn,Q=mn,a=null,D=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,V=un(c-f),t=c>f;if(a||(a=n=D()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(V>tn-y)a.moveTo(s*X(f),s*O(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*X(c),u*O(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=V,E=V,I=Q.apply(this,arguments)/2,M=I>y&&(S?+S.apply(this,arguments):j(u*u+s*s)),w=_(un(s-u)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(M>y){var W=sn(M/u*O(I)),z=sn(M/s*O(I));(P-=W*2)>y?(W*=t?1:-1,A+=W,T-=W):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var Y=s*X(m),Z=s*O(m),B=u*X(T),C=u*O(T);if(w>y){var F=s*X(g),G=s*O(g),J=u*X(A),K=u*O(A),$;if(V<rn)if($=pn(Y,Z,J,K,F,G,B,C)){var L=Y-$[0],U=Z-$[1],k=F-$[0],b=G-$[1],nn=1/O(fn((L*k+U*b)/(j(L*L+U*U)*j(k*k+b*b)))/2),en=j($[0]*$[0]+$[1]*$[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=H(J,K,Y,Z,s,x,t),r=H(F,G,B,C,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(Y,Z),a.arc(0,0,s,m,g,!t)):a.moveTo(Y,Z),!(u>y)||!(P>y)?a.lineTo(B,C):p>y?(e=H(B,C,F,G,u,-p,t),r=H(Y,Z,J,K,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,A,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-rn/2;return[X(d)*n,O(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:N(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:N(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:N(+n),i):q},i.padRadius=function(n){return arguments.length?(S=n==null?null:typeof n=="function"?n:N(+n),i):S},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:N(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:N(+n),i):R},i.padAngle=function(n){return arguments.length?(Q=typeof n=="function"?n:N(+n),i):Q},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
