Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.83/designer/js/definition-builder/diagram-builder/components/transitions/utils",["module","exports","require","portal-workflow-kaleo-designer-web$react-flow-renderer"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.getEdgeParams=function(e,t){const r=s(e,t),o=s(t,e),n=c(e,r),i=c(t,o);return{sourcePos:n,sx:r.x,sy:r.y,targetPos:i,tx:o.x,ty:o.y}},t.createElements=function(){const e=[],t={x:window.innerWidth/2,y:window.innerHeight/2};e.push({data:{label:"Target"},id:"target",position:t});for(let r=0;r<8;r++){const n=45*r*(Math.PI/180),i=250*Math.cos(n)+t.x,a=250*Math.sin(n)+t.y;e.push({data:{label:"Source"},id:"".concat(r),position:{x:i,y:a}}),e.push({arrowHeadType:o.ArrowHeadType.Arrow,id:"edge-".concat(r),source:"".concat(r),target:"target",type:"floating"})}return e};var o=r("portal-workflow-kaleo-designer-web$react-flow-renderer");function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){const{height:r,position:o,width:n}=e.__rf,i=t.__rf.position,a=n/2,s=r/2,c=o.x+a,u=o.y+s,d=i.x+a,f=i.y+s,l=(d-c)/(2*a)-(f-u)/(2*s),p=(d-c)/(2*a)+(f-u)/(2*s),y=1/(Math.abs(l)+Math.abs(p)),w=y*l,b=y*p;return{x:a*(w+b)+c,y:s*(-w+b)+u}}function c(e,t){const r=i(i({},e.__rf.position),e.__rf),n=Math.round(r.x),a=Math.round(r.y),s=Math.round(t.x),c=Math.round(t.y);return s<=n+1?o.Position.Left:s>=n+r.width-1?o.Position.Right:c<=a+1?o.Position.Top:c>=r.y+r.height-1?o.Position.Bottom:o.Position.Top}}}));
//# sourceMappingURL=utils.js.map