import{r as t}from"./src-DK-XqvI0.js";var a={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},e={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function n(t,a){if(void 0===t||void 0===a)return{angle:0,deltaX:0,deltaY:0};t=r(t),a=r(a);const[e,n]=[t.x,t.y],[o,l]=[a.x,a.y],s=o-e,h=l-n;return{angle:Math.atan(h/s),deltaX:s,deltaY:h}}t(n,"calculateDeltaAndAngle");var r=t(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),o=t(e=>({x:t(function(t,o,l){let s=0;const h=r(l[0]).x<r(l[l.length-1]).x?"left":"right";if(0===o&&Object.hasOwn(a,e.arrowTypeStart)){const{angle:t,deltaX:r}=n(l[0],l[1]);s=a[e.arrowTypeStart]*Math.cos(t)*(r>=0?1:-1)}else if(o===l.length-1&&Object.hasOwn(a,e.arrowTypeEnd)){const{angle:t,deltaX:r}=n(l[l.length-1],l[l.length-2]);s=a[e.arrowTypeEnd]*Math.cos(t)*(r>=0?1:-1)}const i=Math.abs(r(t).x-r(l[l.length-1]).x),y=Math.abs(r(t).y-r(l[l.length-1]).y),c=Math.abs(r(t).x-r(l[0]).x),g=Math.abs(r(t).y-r(l[0]).y),p=a[e.arrowTypeStart],w=a[e.arrowTypeEnd];if(i<w&&i>0&&y<w){let t=w+1-i;t*="right"===h?-1:1,s-=t}if(c<p&&c>0&&g<p){let t=p+1-c;t*="right"===h?-1:1,s+=t}return r(t).x+s},"x"),y:t(function(t,o,l){let s=0;const h=r(l[0]).y<r(l[l.length-1]).y?"down":"up";if(0===o&&Object.hasOwn(a,e.arrowTypeStart)){const{angle:t,deltaY:r}=n(l[0],l[1]);s=a[e.arrowTypeStart]*Math.abs(Math.sin(t))*(r>=0?1:-1)}else if(o===l.length-1&&Object.hasOwn(a,e.arrowTypeEnd)){const{angle:t,deltaY:r}=n(l[l.length-1],l[l.length-2]);s=a[e.arrowTypeEnd]*Math.abs(Math.sin(t))*(r>=0?1:-1)}const i=Math.abs(r(t).y-r(l[l.length-1]).y),y=Math.abs(r(t).x-r(l[l.length-1]).x),c=Math.abs(r(t).y-r(l[0]).y),g=Math.abs(r(t).x-r(l[0]).x),p=a[e.arrowTypeStart],w=a[e.arrowTypeEnd];if(i<w&&i>0&&y<w){let t=w+1-i;t*="up"===h?-1:1,s-=t}if(c<p&&c>0&&g<p){let t=p+1-c;t*="up"===h?-1:1,s+=t}return r(t).y+s},"y")}),"getLineFunctionsWithOffset");export{a as n,e as r,o as t};