import{n as e}from"./rolldown-runtime-BG2f4sTM.js";import{n as t,r as n}from"./chunk-AGHRB4JF-COxpu2PX.js";function r(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=s(e),t=s(t);let[n,r]=[e.x,e.y],[i,a]=[t.x,t.y],o=i-n,c=a-r;return{angle:Math.atan(c/o),deltaX:o,deltaY:c}}var i,a,o,s,c,l=e((()=>{n(),i=t((e,t)=>{if(t)return`translate(`+-e.width/2+`, `+-e.height/2+`)`;let n=e.x??0,r=e.y??0;return`translate(`+-(n+e.width/2)+`, `+-(r+e.height/2)+`)`},`computeLabelTransform`),a={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},o={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5},t(r,`calculateDeltaAndAngle`),s=t(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,`pointTransformer`),c=t(e=>({x:t(function(t,n,i){let o=0,c=s(i[0]).x<s(i[i.length-1]).x?`left`:`right`;if(n===0&&Object.hasOwn(a,e.arrowTypeStart)){let{angle:t,deltaX:n}=r(i[0],i[1]);o=a[e.arrowTypeStart]*Math.cos(t)*(n>=0?1:-1)}else if(n===i.length-1&&Object.hasOwn(a,e.arrowTypeEnd)){let{angle:t,deltaX:n}=r(i[i.length-1],i[i.length-2]);o=a[e.arrowTypeEnd]*Math.cos(t)*(n>=0?1:-1)}let l=Math.abs(s(t).x-s(i[i.length-1]).x),u=Math.abs(s(t).y-s(i[i.length-1]).y),d=Math.abs(s(t).x-s(i[0]).x),f=Math.abs(s(t).y-s(i[0]).y),p=a[e.arrowTypeStart],m=a[e.arrowTypeEnd];if(l<m&&l>0&&u<m){let e=m+1-l;e*=c===`right`?-1:1,o-=e}if(d<p&&d>0&&f<p){let e=p+1-d;e*=c===`right`?-1:1,o+=e}return s(t).x+o},`x`),y:t(function(t,n,i){let o=0,c=s(i[0]).y<s(i[i.length-1]).y?`down`:`up`;if(n===0&&Object.hasOwn(a,e.arrowTypeStart)){let{angle:t,deltaY:n}=r(i[0],i[1]);o=a[e.arrowTypeStart]*Math.abs(Math.sin(t))*(n>=0?1:-1)}else if(n===i.length-1&&Object.hasOwn(a,e.arrowTypeEnd)){let{angle:t,deltaY:n}=r(i[i.length-1],i[i.length-2]);o=a[e.arrowTypeEnd]*Math.abs(Math.sin(t))*(n>=0?1:-1)}let l=Math.abs(s(t).y-s(i[i.length-1]).y),u=Math.abs(s(t).x-s(i[i.length-1]).x),d=Math.abs(s(t).y-s(i[0]).y),f=Math.abs(s(t).x-s(i[0]).x),p=a[e.arrowTypeStart],m=a[e.arrowTypeEnd];if(l<m&&l>0&&u<m){let e=m+1-l;e*=c===`up`?-1:1,o-=e}if(d<p&&d>0&&f<p){let e=p+1-d;e*=c===`up`?-1:1,o+=e}return s(t).y+o},`y`)}),`getLineFunctionsWithOffset`)}));export{o as a,a as i,c as n,l as r,i as t};
//# sourceMappingURL=chunk-BSJP7CBP-DFvoyeko.js.map