/*! third party licenses: js/vendor.LICENSE.txt */ import{_ as pt,G as Be,S as Ve,l as be,b as $e,a as je,p as qe,q as Ke,g as Ze,s as Je,y as Qe,C as ti,D as ei,E as ii,c as me,$ as ve,ae as ce,h as ni,x as ri,af as oi,ag as ai}from"./NcSelect-DXLJbwym.chunk.mjs";import{p as si}from"./chunk-4BX2VUAB-CRQkbnhe.chunk.mjs";import{p as hi}from"./treemap-KMMF4GRG-BMzvQTWV.chunk.mjs";import{c as Oe}from"./cytoscape.esm-3961YR65.chunk.mjs";import{g as li}from"./vendor-BeFBwUwf.chunk.mjs";import{s as di}from"./isEmpty-nTVdZyYD.chunk.mjs";import"./whiteboard-main.mjs";import"./index-Anv74-sp.chunk.mjs";import"./index-C0mkXnFg.chunk.mjs";import"./index-Bn0s6V7w.chunk.mjs";import"./index-vg7q3Iku.chunk.mjs";import"./translation-DoG5ZELJ-DKBzIEvm.chunk.mjs";import"./percentages-BXMCSKIN-Cw9SI0WV.chunk.mjs";import"./useJwtStore-B1DPLYgs.chunk.mjs";import"./_plugin-vue2_normalizer-CBCAj2XU.chunk.mjs";import"./line-2ECJkxIB.chunk.mjs";import"./array-Cg_lHFoG.chunk.mjs";import"./path-i7Zvihw6.chunk.mjs";import"./_baseUniq-CE6homwJ.chunk.mjs";import"./_basePickBy-0DU--7tw.chunk.mjs";import"./has-DJswI7NS.chunk.mjs";import"./clone-Dt8ItUbV.chunk.mjs";var ge={exports:{}},ue={exports:{}},fe={exports:{}},ci=fe.exports,Le;function gi(){return Le||(Le=1,function(D,C){(function(I,G){D.exports=G()})(ci,function(){return function(I){var G={};function T(u){if(G[u])return G[u].exports;var l=G[u]={i:u,l:!1,exports:{}};return I[u].call(l.exports,l,l.exports,T),l.l=!0,l.exports}return T.m=I,T.c=G,T.i=function(u){return u},T.d=function(u,l,o){T.o(u,l)||Object.defineProperty(u,l,{configurable:!1,enumerable:!0,get:o})},T.n=function(u){var l=u&&u.__esModule?function(){return u.default}:function(){return u};return T.d(l,"a",l),l},T.o=function(u,l){return Object.prototype.hasOwnProperty.call(u,l)},T.p="",T(T.s=28)}([function(I,G,T){function u(){}u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,I.exports=u},function(I,G,T){var u=T(2),l=T(8),o=T(9);function i(a,r,f){u.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=a,this.target=r}i.prototype=Object.create(u.prototype);for(var e in u)i[e]=u[e];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(a,r){for(var f=this.getOtherEnd(a),t=r.getGraphManager().getRoot();;){if(f.getOwner()==r)return f;if(f.getOwner()==t)break;f=f.getOwner().getParent()}return null},i.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},I.exports=i},function(I,G,T){function u(l){this.vGraphObject=l}I.exports=u},function(I,G,T){var u=T(2),l=T(10),o=T(13),i=T(0),e=T(16),a=T(5);function r(t,s,h,g){h==null&&g==null&&(g=s),u.call(this,g),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=t,h!=null&&s!=null?this.rect=new o(s.x,s.y,h.width,h.height):this.rect=new o}r.prototype=Object.create(u.prototype);for(var f in u)r[f]=u[f];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(t){this.rect.width=t},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(t){this.rect.height=t},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},r.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},r.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},r.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},r.prototype.getEdgeListToNode=function(t){var s=[],h=this;return h.edges.forEach(function(g){if(g.target==t){if(g.source!=h)throw"Incorrect edge source!";s.push(g)}}),s},r.prototype.getEdgesBetween=function(t){var s=[],h=this;return h.edges.forEach(function(g){if(!(g.source==h||g.target==h))throw"Incorrect edge source and/or target";(g.target==t||g.source==t)&&s.push(g)}),s},r.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(h){if(h.source==s)t.add(h.target);else{if(h.target!=s)throw"Incorrect incidency!";t.add(h.source)}}),t},r.prototype.withChildren=function(){var t=new Set,s,h;if(t.add(this),this.child!=null)for(var g=this.child.getNodes(),d=0;ds?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(h+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>h?(this.rect.y-=(this.labelHeight-h)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(h+this.labelHeight))}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(t){var s=this.rect.x;s>i.WORLD_BOUNDARY?s=i.WORLD_BOUNDARY:s<-i.WORLD_BOUNDARY&&(s=-i.WORLD_BOUNDARY);var h=this.rect.y;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var g=new a(s,h),d=t.inverseTransformPoint(g);this.setLocation(d.x,d.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},I.exports=r},function(I,G,T){var u=T(0);function l(){}for(var o in u)l[o]=u[o];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,I.exports=l},function(I,G,T){function u(l,o){l==null&&o==null?(this.x=0,this.y=0):(this.x=l,this.y=o)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(l){this.x=l},u.prototype.setY=function(l){this.y=l},u.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},I.exports=u},function(I,G,T){var u=T(2),l=T(10),o=T(0),i=T(7),e=T(3),a=T(1),r=T(13),f=T(12),t=T(11);function s(g,d,N){u.call(this,N),this.estimatedSize=l.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,d!=null&&d instanceof i?this.graphManager=d:d!=null&&d instanceof Layout&&(this.graphManager=d.graphManager)}s.prototype=Object.create(u.prototype);for(var h in u)s[h]=u[h];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(g,d,N){if(d==null&&N==null){var c=g;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(c)>-1)throw"Node already in graph!";return c.owner=this,this.getNodes().push(c),c}else{var y=g;if(!(this.getNodes().indexOf(d)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(d.owner==N.owner&&d.owner==this))throw"Both owners must be this graph!";return d.owner!=N.owner?null:(y.source=d,y.target=N,y.isInterGraph=!1,this.getEdges().push(y),d.edges.push(y),N!=d&&N.edges.push(y),y)}},s.prototype.remove=function(g){var d=g;if(g instanceof e){if(d==null)throw"Node is null!";if(!(d.owner!=null&&d.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var N=d.edges.slice(),c,y=N.length,A=0;A-1&&k>-1))throw"Source and/or target doesn't know this edge!";c.source.edges.splice(P,1),c.target!=c.source&&c.target.edges.splice(k,1);var w=c.source.owner.getEdges().indexOf(c);if(w==-1)throw"Not in owner's edge list!";c.source.owner.getEdges().splice(w,1)}},s.prototype.updateLeftTop=function(){for(var g=l.MAX_VALUE,d=l.MAX_VALUE,N,c,y,A=this.getNodes(),w=A.length,P=0;PN&&(g=N),d>c&&(d=c)}return g==l.MAX_VALUE?null:(A[0].getParent().paddingLeft!=null?y=A[0].getParent().paddingLeft:y=this.margin,this.left=d-y,this.top=g-y,new f(this.left,this.top))},s.prototype.updateBounds=function(g){for(var d=l.MAX_VALUE,N=-l.MAX_VALUE,c=l.MAX_VALUE,y=-l.MAX_VALUE,A,w,P,k,Y,H=this.nodes,Z=H.length,M=0;MA&&(d=A),NP&&(c=P),yA&&(d=A),NP&&(c=P),y=this.nodes.length){var Z=0;N.forEach(function(M){M.owner==g&&Z++}),Z==this.nodes.length&&(this.isConnected=!0)}},I.exports=s},function(I,G,T){var u,l=T(1);function o(i){u=T(6),this.layout=i,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var i=this.layout.newGraph(),e=this.layout.newNode(null),a=this.add(i,e);return this.setRootGraph(a),this.rootGraph},o.prototype.add=function(i,e,a,r,f){if(a==null&&r==null&&f==null){if(i==null)throw"Graph is null!";if(e==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(e.child!=null)throw"Already has a child!";return i.parent=e,e.child=i,i}else{f=a,r=e,a=i;var t=r.getOwner(),s=f.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return a.isInterGraph=!1,t.add(a,r,f);if(a.isInterGraph=!0,a.source=r,a.target=f,this.edges.indexOf(a)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(a),!(a.source!=null&&a.target!=null))throw"Edge source and/or target is null!";if(!(a.source.edges.indexOf(a)==-1&&a.target.edges.indexOf(a)==-1))throw"Edge already in source and/or target incidency list!";return a.source.edges.push(a),a.target.edges.push(a),a}},o.prototype.remove=function(i){if(i instanceof u){var e=i;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(e==this.rootGraph||e.parent!=null&&e.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(e.getEdges());for(var r,f=a.length,t=0;t=i.getRight()?e[0]+=Math.min(i.getX()-o.getX(),o.getRight()-i.getRight()):i.getX()<=o.getX()&&i.getRight()>=o.getRight()&&(e[0]+=Math.min(o.getX()-i.getX(),i.getRight()-o.getRight())),o.getY()<=i.getY()&&o.getBottom()>=i.getBottom()?e[1]+=Math.min(i.getY()-o.getY(),o.getBottom()-i.getBottom()):i.getY()<=o.getY()&&i.getBottom()>=o.getBottom()&&(e[1]+=Math.min(o.getY()-i.getY(),i.getBottom()-o.getBottom()));var f=Math.abs((i.getCenterY()-o.getCenterY())/(i.getCenterX()-o.getCenterX()));i.getCenterY()===o.getCenterY()&&i.getCenterX()===o.getCenterX()&&(f=1);var t=f*e[0],s=e[1]/f;e[0]t)return e[0]=a,e[1]=h,e[2]=f,e[3]=H,!1;if(rf)return e[0]=s,e[1]=r,e[2]=k,e[3]=t,!1;if(af?(e[0]=d,e[1]=N,n=!0):(e[0]=g,e[1]=h,n=!0):p===v&&(a>f?(e[0]=s,e[1]=h,n=!0):(e[0]=c,e[1]=N,n=!0)),-m===v?f>a?(e[2]=Y,e[3]=H,E=!0):(e[2]=k,e[3]=P,E=!0):m===v&&(f>a?(e[2]=w,e[3]=P,E=!0):(e[2]=Z,e[3]=H,E=!0)),n&&E)return!1;if(a>f?r>t?(O=this.getCardinalDirection(p,v,4),_=this.getCardinalDirection(m,v,2)):(O=this.getCardinalDirection(-p,v,3),_=this.getCardinalDirection(-m,v,1)):r>t?(O=this.getCardinalDirection(-p,v,1),_=this.getCardinalDirection(-m,v,3)):(O=this.getCardinalDirection(p,v,2),_=this.getCardinalDirection(m,v,4)),!n)switch(O){case 1:U=h,x=a+-A/v,e[0]=x,e[1]=U;break;case 2:x=c,U=r+y*v,e[0]=x,e[1]=U;break;case 3:U=N,x=a+A/v,e[0]=x,e[1]=U;break;case 4:x=d,U=r+-y*v,e[0]=x,e[1]=U;break}if(!E)switch(_){case 1:B=P,X=f+-rt/v,e[2]=X,e[3]=B;break;case 2:X=Z,B=t+M*v,e[2]=X,e[3]=B;break;case 3:B=H,X=f+rt/v,e[2]=X,e[3]=B;break;case 4:X=Y,B=t+-M*v,e[2]=X,e[3]=B;break}}return!1},l.getCardinalDirection=function(o,i,e){return o>i?e:1+e%4},l.getIntersection=function(o,i,e,a){if(a==null)return this.getIntersection2(o,i,e);var r=o.x,f=o.y,t=i.x,s=i.y,h=e.x,g=e.y,d=a.x,N=a.y,c=void 0,y=void 0,A=void 0,w=void 0,P=void 0,k=void 0,Y=void 0,H=void 0,Z=void 0;return A=s-f,P=r-t,Y=t*f-r*s,w=N-g,k=h-d,H=d*g-h*N,Z=A*k-w*P,Z===0?null:(c=(P*H-k*Y)/Z,y=(w*Y-A*H)/Z,new u(c,y))},l.angleOfVector=function(o,i,e,a){var r=void 0;return o!==e?(r=Math.atan((a-i)/(e-o)),e=0){var N=(-h+Math.sqrt(h*h-4*s*g))/(2*s),c=(-h-Math.sqrt(h*h-4*s*g))/(2*s),y=null;return N>=0&&N<=1?[N]:c>=0&&c<=1?[c]:y}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,I.exports=l},function(I,G,T){function u(){}u.sign=function(l){return l>0?1:l<0?-1:0},u.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},u.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},I.exports=u},function(I,G,T){function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,I.exports=u},function(I,G,T){var u=function(){function r(f,t){for(var s=0;s"u"?"undefined":u(o);return o==null||i!="object"&&i!="function"},I.exports=l},function(I,G,T){function u(h){if(Array.isArray(h)){for(var g=0,d=Array(h.length);g0&&g;){for(A.push(P[0]);A.length>0&&g;){var k=A[0];A.splice(0,1),y.add(k);for(var Y=k.getEdges(),c=0;c-1&&P.splice(rt,1)}y=new Set,w=new Map}}return h},s.prototype.createDummyNodesForBendpoints=function(h){for(var g=[],d=h.source,N=this.graphManager.calcLowestCommonAncestor(h.source,h.target),c=0;c0){for(var N=this.edgeToDummyNodes.get(d),c=0;c=0&&g.splice(H,1);var Z=w.getNeighborsList();Z.forEach(function(n){if(d.indexOf(n)<0){var E=N.get(n),p=E-1;p==1&&k.push(n),N.set(n,p)}})}d=d.concat(k),(g.length==1||g.length==2)&&(c=!0,y=g[0])}return y},s.prototype.setGraphManager=function(h){this.graphManager=h},I.exports=s},function(I,G,T){function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},I.exports=u},function(I,G,T){var u=T(5);function l(o,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(o){this.lworldExtX=o},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(o){this.lworldExtY=o},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},l.prototype.transformX=function(o){var i=0,e=this.lworldExtX;return e!=0&&(i=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/e),i},l.prototype.transformY=function(o){var i=0,e=this.lworldExtY;return e!=0&&(i=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/e),i},l.prototype.inverseTransformX=function(o){var i=0,e=this.ldeviceExtX;return e!=0&&(i=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/e),i},l.prototype.inverseTransformY=function(o){var i=0,e=this.ldeviceExtY;return e!=0&&(i=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/e),i},l.prototype.inverseTransformPoint=function(o){var i=new u(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return i},I.exports=l},function(I,G,T){function u(t){if(Array.isArray(t)){for(var s=0,h=Array(t.length);so.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,h=0;h0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h,g,d,N,c=this.getAllNodes(),y;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),y=new Set,h=0;hA||y>A)&&(t.gravitationForceX=-this.gravityConstant*d,t.gravitationForceY=-this.gravityConstant*N)):(A=s.getEstimatedSize()*this.compoundGravityRangeFactor,(c>A||y>A)&&(t.gravitationForceX=-this.gravityConstant*d*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant))},r.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=c.length||A>=c[0].length)){for(var w=0;wa}}]),e}();I.exports=i},function(I,G,T){function u(){}u.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var o=Math.min(this.m,this.n);this.s=function(It){for(var Tt=[];It-- >0;)Tt.push(0);return Tt}(Math.min(this.m+1,this.n)),this.U=function(It){var Tt=function Xt(Ut){if(Ut.length==0)return 0;for(var bt=[],Pt=0;Pt0;)Tt.push(0);return Tt}(this.n),e=function(It){for(var Tt=[];It-- >0;)Tt.push(0);return Tt}(this.m),a=!0,r=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var v=m+1;v=0;z--){if(function(It,Tt){return It&&Tt}(z0;){var $=void 0,xt=void 0;for($=n-2;$>=-1&&$!==-1;$--)if(Math.abs(i[$])<=mt+et*(Math.abs(this.s[$])+Math.abs(this.s[$+1]))){i[$]=0;break}if($===n-2)xt=4;else{var Q=void 0;for(Q=n-1;Q>=$&&Q!==$;Q--){var nt=(Q!==n?Math.abs(i[Q]):0)+(Q!==$+1?Math.abs(i[Q-1]):0);if(Math.abs(this.s[Q])<=mt+et*nt){this.s[Q]=0;break}}Q===$?xt=3:Q===n-1?xt=1:(xt=2,$=Q)}switch($++,xt){case 1:{var vt=i[n-2];i[n-2]=0;for(var st=n-2;st>=$;st--){var Lt=u.hypot(this.s[st],vt),_t=this.s[st]/Lt,Nt=vt/Lt;this.s[st]=Lt,st!==$&&(vt=-Nt*i[st-1],i[st-1]=_t*i[st-1]);for(var At=0;At=this.s[$+1]);){var wt=this.s[$];if(this.s[$]=this.s[$+1],this.s[$+1]=wt,$Math.abs(o)?(i=o/l,i=Math.abs(l)*Math.sqrt(1+i*i)):o!=0?(i=l/o,i=Math.abs(o)*Math.sqrt(1+i*i)):i=0,i},I.exports=u},function(I,G,T){var u=function(){function i(e,a){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,i),this.sequence1=e,this.sequence2=a,this.match_score=r,this.mismatch_penalty=f,this.gap_penalty=t,this.iMax=e.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;e--){var a=this.listeners[e];a.event===o&&a.callback===i&&this.listeners.splice(e,1)}},l.emit=function(o,i){for(var e=0;e{var G={45:(o,i,e)=>{var a={};a.layoutBase=e(551),a.CoSEConstants=e(806),a.CoSEEdge=e(767),a.CoSEGraph=e(880),a.CoSEGraphManager=e(578),a.CoSELayout=e(765),a.CoSENode=e(991),a.ConstraintHandler=e(902),o.exports=a},806:(o,i,e)=>{var a=e(551).FDLayoutConstants;function r(){}for(var f in a)r[f]=a[f];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=a.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r},767:(o,i,e)=>{var a=e(551).FDLayoutEdge;function r(t,s,h){a.call(this,t,s,h)}r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r},880:(o,i,e)=>{var a=e(551).LGraph;function r(t,s,h){a.call(this,t,s,h)}r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r},578:(o,i,e)=>{var a=e(551).LGraphManager;function r(t){a.call(this,t)}r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r},765:(o,i,e)=>{var a=e(551).FDLayout,r=e(578),f=e(880),t=e(991),s=e(767),h=e(806),g=e(902),d=e(551).FDLayoutConstants,N=e(551).LayoutConstants,c=e(551).Point,y=e(551).PointD,A=e(551).DimensionD,w=e(551).Layout,P=e(551).Integer,k=e(551).IGeometry,Y=e(551).LGraph,H=e(551).Transform,Z=e(551).LinkedList;function M(){a.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(a.prototype);for(var rt in a)M[rt]=a[rt];M.prototype.newGraphManager=function(){var n=new r(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new f(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){a.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){a.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(m){return n.has(m)});this.graphManager.setAllNodesToApplyGravitation(E)}}else{var p=this.getFlatForest();if(p.length>0)this.positionNodesRadially(p);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(O){return n.has(O)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(g.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(v){return n.has(v)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=O)}}if(this.constraints.relativePlacementConstraint){var _=new Map,x=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(b){n.fixedNodesOnHorizontal.add(b),n.fixedNodesOnVertical.add(b)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var U=this.constraints.alignmentConstraint.vertical,p=0;p=2*b.length/3;et--)F=Math.floor(Math.random()*(et+1)),j=b[et],b[et]=b[F],b[F]=j;return b},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(b){if(b.left){var F=_.has(b.left)?_.get(b.left):b.left,j=_.has(b.right)?_.get(b.right):b.right;n.nodesInRelativeHorizontal.includes(F)||(n.nodesInRelativeHorizontal.push(F),n.nodeToRelativeConstraintMapHorizontal.set(F,[]),n.dummyToNodeForVerticalAlignment.has(F)?n.nodeToTempPositionMapHorizontal.set(F,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(F)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(F,n.idToNodeMap.get(F).getCenterX())),n.nodesInRelativeHorizontal.includes(j)||(n.nodesInRelativeHorizontal.push(j),n.nodeToRelativeConstraintMapHorizontal.set(j,[]),n.dummyToNodeForVerticalAlignment.has(j)?n.nodeToTempPositionMapHorizontal.set(j,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(j)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(j,n.idToNodeMap.get(j).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(F).push({right:j,gap:b.gap}),n.nodeToRelativeConstraintMapHorizontal.get(j).push({left:F,gap:b.gap})}else{var et=x.has(b.top)?x.get(b.top):b.top,mt=x.has(b.bottom)?x.get(b.bottom):b.bottom;n.nodesInRelativeVertical.includes(et)||(n.nodesInRelativeVertical.push(et),n.nodeToRelativeConstraintMapVertical.set(et,[]),n.dummyToNodeForHorizontalAlignment.has(et)?n.nodeToTempPositionMapVertical.set(et,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(et)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(et,n.idToNodeMap.get(et).getCenterY())),n.nodesInRelativeVertical.includes(mt)||(n.nodesInRelativeVertical.push(mt),n.nodeToRelativeConstraintMapVertical.set(mt,[]),n.dummyToNodeForHorizontalAlignment.has(mt)?n.nodeToTempPositionMapVertical.set(mt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(mt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(mt,n.idToNodeMap.get(mt).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(et).push({bottom:mt,gap:b.gap}),n.nodeToRelativeConstraintMapVertical.get(mt).push({top:et,gap:b.gap})}});else{var B=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(b){if(b.left){var F=_.has(b.left)?_.get(b.left):b.left,j=_.has(b.right)?_.get(b.right):b.right;B.has(F)?B.get(F).push(j):B.set(F,[j]),B.has(j)?B.get(j).push(F):B.set(j,[F])}else{var et=x.has(b.top)?x.get(b.top):b.top,mt=x.has(b.bottom)?x.get(b.bottom):b.bottom;z.has(et)?z.get(et).push(mt):z.set(et,[mt]),z.has(mt)?z.get(mt).push(et):z.set(mt,[et])}});var W=function(b,F){var j=[],et=[],mt=new Z,$=new Set,xt=0;return b.forEach(function(Q,nt){if(!$.has(nt)){j[xt]=[],et[xt]=!1;var vt=nt;for(mt.push(vt),$.add(vt),j[xt].push(vt);mt.length!=0;){vt=mt.shift(),F.has(vt)&&(et[xt]=!0);var st=b.get(vt);st.forEach(function(Lt){$.has(Lt)||(mt.push(Lt),$.add(Lt),j[xt].push(Lt))})}xt++}}),{components:j,isFixed:et}},q=W(B,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=q.components,this.fixedComponentsOnHorizontal=q.isFixed;var S=W(z,n.fixedNodesOnVertical);this.componentsOnVertical=S.components,this.fixedComponentsOnVertical=S.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(S){var b=n.idToNodeMap.get(S.nodeId);b.displacementX=0,b.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var x;for(x=0;x<_.length;x++){var U=_[x];U.getBendpoints().push(new y),this.createDummyNodesForBendpoints(U)}}_.forEach(function(X){E.add(X)})}}}if(E.size==n.length)break}},M.prototype.positionNodesRadially=function(n){for(var E=new c(0,0),p=Math.ceil(Math.sqrt(n.length)),m=0,v=0,O=0,_=new y(0,0),x=0;xm&&(m=Math.floor(_.y)),O=Math.floor(_.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new y(N.WORLD_CENTER_X-_.x/2,N.WORLD_CENTER_Y-_.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),h.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var v=Y.calculateBounds(n),O=new H;O.setDeviceOrgX(v.getMinX()),O.setDeviceOrgY(v.getMinY()),O.setWorldOrgX(p.x),O.setWorldOrgY(p.y);for(var _=0;_1;){var j=F[0];F.splice(0,1);var et=z.indexOf(j);et>=0&&z.splice(et,1),S--,W--}E!=null?b=(z.indexOf(F[0])+1)%S:b=0;for(var mt=Math.abs(m-p)/W,$=b;q!=W;$=++$%S){var xt=z[$].getOtherEnd(n);if(xt!=E){var Q=(p+q*mt)%360,nt=(Q+mt)%360;M.branchRadialLayout(xt,n,Q,nt,v+O,O),q++}}},M.maxDiagonalInTree=function(n){for(var E=P.MIN_VALUE,p=0;pE&&(E=v)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),v=0;v"u"&&(E[x]=[]),E[x]=E[x].concat(O)}Object.keys(E).forEach(function(U){if(E[U].length>1){var X="DummyCompound_"+U;n.memberGroups[X]=E[U];var B=E[U][0].getParent(),z=new t(n.graphManager);z.id=X,z.paddingLeft=B.paddingLeft||0,z.paddingRight=B.paddingRight||0,z.paddingBottom=B.paddingBottom||0,z.paddingTop=B.paddingTop||0,n.idToDummyNode[X]=z;var W=n.getGraphManager().add(n.newGraph(),z),q=B.getChild();q.add(z);for(var S=0;Sv?(m.rect.x-=(m.labelWidth-v)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-v)/2):m.labelPosHorizontal=="right"&&m.setWidth(v+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(O+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>O?(m.rect.y-=(m.labelHeight-O)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-O)/2):m.labelPosVertical=="bottom"&&m.setHeight(O+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,v=E.paddingTop,O=E.labelMarginLeft,_=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,v,O,_)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],v=m.paddingLeft,O=m.paddingTop,_=m.labelMarginLeft,x=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,v,O,_,x)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),v=0;v0)return this.toBeTiled[E]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mB&&(B=W.rect.height)}p+=B+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var v=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],v.paddingLeft+v.paddingRight),v.rect.width=p.tiledMemberPack[m].width,v.rect.height=p.tiledMemberPack[m].height,v.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),v.labelMarginLeft=0,v.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var O=v.rect.width,_=v.rect.height;v.labelWidth&&(v.labelPosHorizontal=="left"?(v.rect.x-=v.labelWidth,v.setWidth(O+v.labelWidth),v.labelMarginLeft=v.labelWidth):v.labelPosHorizontal=="center"&&v.labelWidth>O?(v.rect.x-=(v.labelWidth-O)/2,v.setWidth(v.labelWidth),v.labelMarginLeft=(v.labelWidth-O)/2):v.labelPosHorizontal=="right"&&v.setWidth(O+v.labelWidth)),v.labelHeight&&(v.labelPosVertical=="top"?(v.rect.y-=v.labelHeight,v.setHeight(_+v.labelHeight),v.labelMarginTop=v.labelHeight):v.labelPosVertical=="center"&&v.labelHeight>_?(v.rect.y-=(v.labelHeight-_)/2,v.setHeight(v.labelHeight),v.labelMarginTop=(v.labelHeight-_)/2):v.labelPosVertical=="bottom"&&v.setHeight(_+v.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),v=this.getOrgRatio(p),O=this.getOrgRatio(m),_;return Ox&&(x=S.getWidth())});var U=O/v,X=_/v,B=Math.pow(p-m,2)+4*(U+m)*(X+p)*v,z=(m-p+Math.sqrt(B))/(2*(U+m)),W;E?(W=Math.ceil(z),W==z&&W++):W=Math.floor(z);var q=W*(U+m)-m;return x>q&&(q=x),q+=m*2,q},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=h.TILING_PADDING_VERTICAL,v=h.TILING_PADDING_HORIZONTAL,O=h.TILING_COMPARE_BY,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:v,centerX:0,centerY:0};O&&(_.idealRowWidth=this.calcIdealRowWidth(n,p));var x=function(S){return S.rect.width*S.rect.height},U=function(S,b){return x(b)-x(S)};n.sort(function(S,b){var F=U;return _.idealRowWidth?(F=O,F(S.id,b.id)):F(S,b)});for(var X=0,B=0,z=0;z0&&(_+=n.horizontalPadding),n.rowWidth[p]=_,n.width<_&&(n.width=_);var x=E.rect.height;p>0&&(x+=n.verticalPadding);var U=0;x>n.rowHeight[p]&&(U=n.rowHeight[p],n.rowHeight[p]=x,U=n.rowHeight[p]-U),n.height+=U,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,v=n.rowWidth[m];return v+E+n.horizontalPadding<=n.idealRowWidth}var O=this.getShortestRowIndex(n);if(O<0)return!0;var _=n.rowWidth[O];if(_+n.horizontalPadding+E<=n.width)return!0;var x=0;n.rowHeight[O]0&&(x=p+n.verticalPadding-n.rowHeight[O]);var U;n.width-_>=E+n.horizontalPadding?U=(n.height+x)/(_+E+n.horizontalPadding):U=(n.height+x)/n.width,x=p+n.verticalPadding;var X;return n.widthO&&E!=p){m.splice(-1,1),n.rows[p].push(v),n.rowWidth[E]=n.rowWidth[E]-O,n.rowWidth[p]=n.rowWidth[p]+O,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var _=Number.MIN_VALUE,x=0;x_&&(_=m[x].height);E>0&&(_+=n.verticalPadding);var U=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=_,n.rowHeight[p]0)for(var q=v;q<=O;q++)W[0]+=this.grid[q][_-1].length+this.grid[q][_].length-1;if(O0)for(var q=_;q<=x;q++)W[3]+=this.grid[v-1][q].length+this.grid[v][q].length-1;for(var S=P.MAX_VALUE,b,F,j=0;j{var a=e(551).FDLayoutNode,r=e(551).IMath;function f(s,h,g,d){a.call(this,s,h,g,d)}f.prototype=Object.create(a.prototype);for(var t in a)f[t]=a[t];f.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(s,h){for(var g=this.getChild().getNodes(),d,N=0;N{function a(g){if(Array.isArray(g)){for(var d=0,N=Array(g.length);d0){var at=0;ot.forEach(function(gt){R=="horizontal"?(tt.set(gt,c.has(gt)?y[c.get(gt)]:J.get(gt)),at+=tt.get(gt)):(tt.set(gt,c.has(gt)?A[c.get(gt)]:J.get(gt)),at+=tt.get(gt))}),at=at/ot.length,lt.forEach(function(gt){V.has(gt)||tt.set(gt,at)})}else{var wt=0;lt.forEach(function(gt){R=="horizontal"?wt+=c.has(gt)?y[c.get(gt)]:J.get(gt):wt+=c.has(gt)?A[c.get(gt)]:J.get(gt)}),wt=wt/lt.length,lt.forEach(function(gt){tt.set(gt,wt)})}});for(var Et=function(){var lt=it.shift(),ot=L.get(lt);ot.forEach(function(at){if(tt.get(at.id)gt&&(gt=Pt),qtDt&&(Dt=qt)}}catch(jt){It=!0,Tt=jt}finally{try{!St&&Xt.return&&Xt.return()}finally{if(It)throw Tt}}var ae=(at+gt)/2-(wt+Dt)/2,ie=!0,Kt=!1,Zt=void 0;try{for(var $t=lt[Symbol.iterator](),Jt;!(ie=(Jt=$t.next()).done);ie=!0){var re=Jt.value;tt.set(re,tt.get(re)+ae)}}catch(jt){Kt=!0,Zt=jt}finally{try{!ie&&$t.return&&$t.return()}finally{if(Kt)throw Zt}}})}return tt},rt=function(L){var R=0,V=0,J=0,K=0;if(L.forEach(function(ct){ct.left?y[c.get(ct.left)]-y[c.get(ct.right)]>=0?R++:V++:A[c.get(ct.top)]-A[c.get(ct.bottom)]>=0?J++:K++}),R>V&&J>K)for(var ft=0;ftV)for(var ht=0;htK)for(var tt=0;tt1)d.fixedNodeConstraint.forEach(function(L,R){m[R]=[L.position.x,L.position.y],v[R]=[y[c.get(L.nodeId)],A[c.get(L.nodeId)]]}),O=!0;else if(d.alignmentConstraint)(function(){var L=0;if(d.alignmentConstraint.vertical){for(var R=d.alignmentConstraint.vertical,V=function(tt){var ct=new Set;R[tt].forEach(function(yt){ct.add(yt)});var it=new Set([].concat(a(ct)).filter(function(yt){return x.has(yt)})),Et=void 0;it.size>0?Et=y[c.get(it.values().next().value)]:Et=Z(ct).x,R[tt].forEach(function(yt){m[L]=[Et,A[c.get(yt)]],v[L]=[y[c.get(yt)],A[c.get(yt)]],L++})},J=0;J0?Et=y[c.get(it.values().next().value)]:Et=Z(ct).y,K[tt].forEach(function(yt){m[L]=[y[c.get(yt)],Et],v[L]=[y[c.get(yt)],A[c.get(yt)]],L++})},ht=0;htz&&(z=B[q].length,W=q);if(z0){var At={x:0,y:0};d.fixedNodeConstraint.forEach(function(L,R){var V={x:y[c.get(L.nodeId)],y:A[c.get(L.nodeId)]},J=L.position,K=H(J,V);At.x+=K.x,At.y+=K.y}),At.x/=d.fixedNodeConstraint.length,At.y/=d.fixedNodeConstraint.length,y.forEach(function(L,R){y[R]+=At.x}),A.forEach(function(L,R){A[R]+=At.y}),d.fixedNodeConstraint.forEach(function(L){y[c.get(L.nodeId)]=L.position.x,A[c.get(L.nodeId)]=L.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var Ht=d.alignmentConstraint.vertical,Ot=function(L){var R=new Set;Ht[L].forEach(function(K){R.add(K)});var V=new Set([].concat(a(R)).filter(function(K){return x.has(K)})),J=void 0;V.size>0?J=y[c.get(V.values().next().value)]:J=Z(R).x,R.forEach(function(K){x.has(K)||(y[c.get(K)]=J)})},Rt=0;Rt0?J=A[c.get(V.values().next().value)]:J=Z(R).y,R.forEach(function(K){x.has(K)||(A[c.get(K)]=J)})},Gt=0;Gt{o.exports=I}},T={};function u(o){var i=T[o];if(i!==void 0)return i.exports;var e=T[o]={exports:{}};return G[o](e,e.exports,u),e.exports}var l=u(45);return l})()})}(ue)),ue.exports}var pi=ge.exports,Me;function mi(){return Me||(Me=1,function(D,C){(function(I,G){D.exports=G(fi())})(pi,function(I){return(()=>{var G={658:o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var e=arguments.length,a=Array(e>1?e-1:0),r=1;r{var a=function(){function t(s,h){var g=[],d=!0,N=!1,c=void 0;try{for(var y=s[Symbol.iterator](),A;!(d=(A=y.next()).done)&&(g.push(A.value),!(h&&g.length===h));d=!0);}catch(w){N=!0,c=w}finally{try{!d&&y.return&&y.return()}finally{if(N)throw c}}return g}return function(s,h){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=e(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(t){for(var s={},h=0;h0&&m.merge(x)});for(var v=0;v1){A=c[0],w=A.connectedEdges().length,c.forEach(function(m){m.connectedEdges().length0&&g.set("dummy"+(g.size+1),Y),H},f.relocateComponent=function(t,s,h){if(!h.fixedNodeConstraint){var g=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;if(h.quality=="draft"){var y=!0,A=!1,w=void 0;try{for(var P=s.nodeIndexes[Symbol.iterator](),k;!(y=(k=P.next()).done);y=!0){var Y=k.value,H=a(Y,2),Z=H[0],M=H[1],rt=h.cy.getElementById(Z);if(rt){var n=rt.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,v=s.yCoords[M]+n.h/2;Ed&&(d=p),mc&&(c=v)}}}catch(X){A=!0,w=X}finally{try{!y&&P.return&&P.return()}finally{if(A)throw w}}var O=t.x-(d+g)/2,_=t.y-(c+N)/2;s.xCoords=s.xCoords.map(function(X){return X+O}),s.yCoords=s.yCoords.map(function(X){return X+_})}else{Object.keys(s).forEach(function(X){var B=s[X],z=B.getRect().x,W=B.getRect().x+B.getRect().width,q=B.getRect().y,S=B.getRect().y+B.getRect().height;zd&&(d=W),qc&&(c=S)});var x=t.x-(d+g)/2,U=t.y-(c+N)/2;Object.keys(s).forEach(function(X){var B=s[X];B.setCenter(B.getCenterX()+x,B.getCenterY()+U)})}}},f.calcBoundingBox=function(t,s,h,g){for(var d=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,y=Number.MIN_SAFE_INTEGER,A=void 0,w=void 0,P=void 0,k=void 0,Y=t.descendants().not(":parent"),H=Y.length,Z=0;ZA&&(d=A),NP&&(c=P),y{var a=e(548),r=e(140).CoSELayout,f=e(140).CoSENode,t=e(140).layoutBase.PointD,s=e(140).layoutBase.DimensionD,h=e(140).layoutBase.LayoutConstants,g=e(140).layoutBase.FDLayoutConstants,d=e(140).CoSEConstants,N=function(c,y){var A=c.cy,w=c.eles,P=w.nodes(),k=w.edges(),Y=void 0,H=void 0,Z=void 0,M={};c.randomize&&(Y=y.nodeIndexes,H=y.xCoords,Z=y.yCoords);var rt=function(x){return typeof x=="function"},n=function(x,U){return rt(x)?x(U):x},E=a.calcParentsWithoutChildren(A,w),p=function x(U,X,B,z){for(var W=X.length,q=0;q0){var mt=void 0;mt=B.getGraphManager().add(B.newGraph(),F),x(mt,b,B,z)}}},m=function(x,U,X){for(var B=0,z=0,W=0;W0?d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=B/z:rt(c.idealEdgeLength)?d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50:d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=c.idealEdgeLength,d.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,d.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH)},v=function(x,U){U.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=U.fixedNodeConstraint),U.alignmentConstraint&&(x.constraints.alignmentConstraint=U.alignmentConstraint),U.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=U.relativePlacementConstraint)};c.nestingFactor!=null&&(d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.nestingFactor),c.gravity!=null&&(d.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=c.gravity),c.numIter!=null&&(d.MAX_ITERATIONS=g.MAX_ITERATIONS=c.numIter),c.gravityRange!=null&&(d.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=c.gravityRange),c.gravityCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.gravityCompound),c.gravityRangeCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.gravityRangeCompound),c.initialEnergyOnIncremental!=null&&(d.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.initialEnergyOnIncremental),c.tilingCompareBy!=null&&(d.TILING_COMPARE_BY=c.tilingCompareBy),c.quality=="proof"?h.QUALITY=2:h.QUALITY=0,d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=c.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!c.randomize,d.ANIMATE=g.ANIMATE=h.ANIMATE=c.animate,d.TILE=c.tile,d.TILING_PADDING_VERTICAL=typeof c.tilingPaddingVertical=="function"?c.tilingPaddingVertical.call():c.tilingPaddingVertical,d.TILING_PADDING_HORIZONTAL=typeof c.tilingPaddingHorizontal=="function"?c.tilingPaddingHorizontal.call():c.tilingPaddingHorizontal,d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!c.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=c.uniformNodeDimensions,c.step=="transformed"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!1),c.step=="enforced"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!1),c.step=="cose"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!0),c.step=="all"&&(c.randomize?d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0),c.fixedNodeConstraint||c.alignmentConstraint||c.relativePlacementConstraint?d.TREE_REDUCTION_ON_INCREMENTAL=!1:d.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new r,_=O.newGraphManager();return p(_.addRoot(),a.getTopMostNodes(P),O,c),m(O,_,k),v(O,c),O.runLayout(),M};o.exports={coseLayout:N}},212:(o,i,e)=>{var a=function(){function y(A,w){for(var P=0;P0)if(E){var p=t.getTopMostNodes(w.eles.nodes());if(Z=t.connectComponents(P,w.eles,p),Z.forEach(function(Q){var nt=Q.boundingBox();M.push({x:nt.x1+nt.w/2,y:nt.y1+nt.h/2})}),w.randomize&&Z.forEach(function(Q){w.eles=Q,Y.push(h(w))}),w.quality=="default"||w.quality=="proof"){var m=P.collection();if(w.tile){var v=new Map,O=[],_=[],x=0,U={nodeIndexes:v,xCoords:O,yCoords:_},X=[];if(Z.forEach(function(Q,nt){Q.edges().length==0&&(Q.nodes().forEach(function(vt,st){m.merge(Q.nodes()[st]),vt.isParent()||(U.nodeIndexes.set(Q.nodes()[st].id(),x++),U.xCoords.push(Q.nodes()[0].position().x),U.yCoords.push(Q.nodes()[0].position().y))}),X.push(nt))}),m.length>1){var B=m.boundingBox();M.push({x:B.x1+B.w/2,y:B.y1+B.h/2}),Z.push(m),Y.push(U);for(var z=X.length-1;z>=0;z--)Z.splice(X[z],1),Y.splice(X[z],1),M.splice(X[z],1)}}Z.forEach(function(Q,nt){w.eles=Q,H.push(d(w,Y[nt])),t.relocateComponent(M[nt],H[nt],w)})}else Z.forEach(function(Q,nt){t.relocateComponent(M[nt],Y[nt],w)});var W=new Set;if(Z.length>1){var q=[],S=k.filter(function(Q){return Q.css("display")=="none"});Z.forEach(function(Q,nt){var vt=void 0;if(w.quality=="draft"&&(vt=Y[nt].nodeIndexes),Q.nodes().not(S).length>0){var st={};st.edges=[],st.nodes=[];var Lt=void 0;Q.nodes().not(S).forEach(function(_t){if(w.quality=="draft")if(!_t.isParent())Lt=vt.get(_t.id()),st.nodes.push({x:Y[nt].xCoords[Lt]-_t.boundingbox().w/2,y:Y[nt].yCoords[Lt]-_t.boundingbox().h/2,width:_t.boundingbox().w,height:_t.boundingbox().h});else{var Nt=t.calcBoundingBox(_t,Y[nt].xCoords,Y[nt].yCoords,vt);st.nodes.push({x:Nt.topLeftX,y:Nt.topLeftY,width:Nt.width,height:Nt.height})}else H[nt][_t.id()]&&st.nodes.push({x:H[nt][_t.id()].getLeft(),y:H[nt][_t.id()].getTop(),width:H[nt][_t.id()].getWidth(),height:H[nt][_t.id()].getHeight()})}),Q.edges().forEach(function(_t){var Nt=_t.source(),At=_t.target();if(Nt.css("display")!="none"&&At.css("display")!="none")if(w.quality=="draft"){var Ht=vt.get(Nt.id()),Ot=vt.get(At.id()),Rt=[],Ft=[];if(Nt.isParent()){var Wt=t.calcBoundingBox(Nt,Y[nt].xCoords,Y[nt].yCoords,vt);Rt.push(Wt.topLeftX+Wt.width/2),Rt.push(Wt.topLeftY+Wt.height/2)}else Rt.push(Y[nt].xCoords[Ht]),Rt.push(Y[nt].yCoords[Ht]);if(At.isParent()){var Gt=t.calcBoundingBox(At,Y[nt].xCoords,Y[nt].yCoords,vt);Ft.push(Gt.topLeftX+Gt.width/2),Ft.push(Gt.topLeftY+Gt.height/2)}else Ft.push(Y[nt].xCoords[Ot]),Ft.push(Y[nt].yCoords[Ot]);st.edges.push({startX:Rt[0],startY:Rt[1],endX:Ft[0],endY:Ft[1]})}else H[nt][Nt.id()]&&H[nt][At.id()]&&st.edges.push({startX:H[nt][Nt.id()].getCenterX(),startY:H[nt][Nt.id()].getCenterY(),endX:H[nt][At.id()].getCenterX(),endY:H[nt][At.id()].getCenterY()})}),st.nodes.length>0&&(q.push(st),W.add(nt))}});var b=n.packComponents(q,w.randomize).shifts;if(w.quality=="draft")Y.forEach(function(Q,nt){var vt=Q.xCoords.map(function(Lt){return Lt+b[nt].dx}),st=Q.yCoords.map(function(Lt){return Lt+b[nt].dy});Q.xCoords=vt,Q.yCoords=st});else{var F=0;W.forEach(function(Q){Object.keys(H[Q]).forEach(function(nt){var vt=H[Q][nt];vt.setCenter(vt.getCenterX()+b[F].dx,vt.getCenterY()+b[F].dy)}),F++})}}}else{var j=w.eles.boundingBox();if(M.push({x:j.x1+j.w/2,y:j.y1+j.h/2}),w.randomize){var et=h(w);Y.push(et)}w.quality=="default"||w.quality=="proof"?(H.push(d(w,Y[0])),t.relocateComponent(M[0],H[0],w)):t.relocateComponent(M[0],Y[0],w)}var mt=function(Q,nt){if(w.quality=="default"||w.quality=="proof"){typeof Q=="number"&&(Q=nt);var vt=void 0,st=void 0,Lt=Q.data("id");return H.forEach(function(Nt){Lt in Nt&&(vt={x:Nt[Lt].getRect().getCenterX(),y:Nt[Lt].getRect().getCenterY()},st=Nt[Lt])}),w.nodeDimensionsIncludeLabels&&(st.labelWidth&&(st.labelPosHorizontal=="left"?vt.x+=st.labelWidth/2:st.labelPosHorizontal=="right"&&(vt.x-=st.labelWidth/2)),st.labelHeight&&(st.labelPosVertical=="top"?vt.y+=st.labelHeight/2:st.labelPosVertical=="bottom"&&(vt.y-=st.labelHeight/2))),vt==null&&(vt={x:Q.position("x"),y:Q.position("y")}),{x:vt.x,y:vt.y}}else{var _t=void 0;return Y.forEach(function(Nt){var At=Nt.nodeIndexes.get(Q.id());At!=null&&(_t={x:Nt.xCoords[At],y:Nt.yCoords[At]})}),_t==null&&(_t={x:Q.position("x"),y:Q.position("y")}),{x:_t.x,y:_t.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var $=t.calcParentsWithoutChildren(P,k),xt=k.filter(function(Q){return Q.css("display")=="none"});w.eles=k.not(xt),k.nodes().not(":parent").not(xt).layoutPositions(A,w,mt),$.length>0&&$.forEach(function(Q){Q.position(mt(Q))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),y}();o.exports=c},657:(o,i,e)=>{var a=e(548),r=e(140).layoutBase.Matrix,f=e(140).layoutBase.SVD,t=function(s){var h=s.cy,g=s.eles,d=g.nodes(),N=g.nodes(":parent"),c=new Map,y=new Map,A=new Map,w=[],P=[],k=[],Y=[],H=[],Z=[],M=[],rt=[],n=void 0,E=1e8,p=1e-9,m=s.piTol,v=s.samplingType,O=s.nodeSeparation,_=void 0,x=function(){for(var dt=0,L=0,R=!1;L<_;){dt=Math.floor(Math.random()*n),R=!1;for(var V=0;V=J;){ft=V[J++];for(var yt=w[ft],Ct=0;Ctct&&(ct=H[ot],it=ot)}return it},X=function(dt){var L=void 0;if(dt){L=Math.floor(Math.random()*n);for(var R=0;R=1)break;tt=ht}for(var Et=0;Et=1)break;tt=ht}for(var Ct=0;Ct0&&(R.isParent()?w[L].push(A.get(R.id())):w[L].push(R.id()))})});var xt=function(dt){var L=y.get(dt),R=void 0;c.get(dt).forEach(function(V){h.getElementById(V).isParent()?R=A.get(V):R=V,w[L].push(R),w[y.get(R)].push(dt)})},Q=!0,nt=!1,vt=void 0;try{for(var st=c.keys()[Symbol.iterator](),Lt;!(Q=(Lt=st.next()).done);Q=!0){var _t=Lt.value;xt(_t)}}catch(dt){nt=!0,vt=dt}finally{try{!Q&&st.return&&st.return()}finally{if(nt)throw vt}}n=y.size;var Nt=void 0;if(n>2){_=n{var a=e(212),r=function(f){f&&f("layout","fcose",a)};typeof cytoscape<"u"&&r(cytoscape),o.exports=r},140:o=>{o.exports=I}},T={};function u(o){var i=T[o];if(i!==void 0)return i.exports;var e=T[o]={exports:{}};return G[o](e,e.exports,u),e.exports}var l=u(579);return l})()})}(ge)),ge.exports}var vi=mi();const yi=li(vi);var Ce={L:"left",R:"right",T:"top",B:"bottom"},xe={L:pt(D=>`${D},${D/2} 0,${D} 0,0`,"L"),R:pt(D=>`0,${D/2} ${D},0 ${D},${D}`,"R"),T:pt(D=>`0,0 ${D},0 ${D/2},${D}`,"T"),B:pt(D=>`${D/2},0 ${D},${D} 0,${D}`,"B")},oe={L:pt((D,C)=>D-C+2,"L"),R:pt((D,C)=>D-2,"R"),T:pt((D,C)=>D-C+2,"T"),B:pt((D,C)=>D-2,"B")},Ei=pt(function(D){return kt(D)?D==="L"?"R":"L":D==="T"?"B":"T"},"getOppositeArchitectureDirection"),De=pt(function(D){const C=D;return C==="L"||C==="R"||C==="T"||C==="B"},"isArchitectureDirection"),kt=pt(function(D){const C=D;return C==="L"||C==="R"},"isArchitectureDirectionX"),Vt=pt(function(D){const C=D;return C==="T"||C==="B"},"isArchitectureDirectionY"),ye=pt(function(D,C){const I=kt(D)&&Vt(C),G=Vt(D)&&kt(C);return I||G},"isArchitectureDirectionXY"),Ni=pt(function(D){const C=D[0],I=D[1],G=kt(C)&&Vt(I),T=Vt(C)&&kt(I);return G||T},"isArchitecturePairXY"),Ti=pt(function(D){return D!=="LL"&&D!=="RR"&&D!=="TT"&&D!=="BB"},"isValidArchitectureDirectionPair"),pe=pt(function(D,C){const I=`${D}${C}`;return Ti(I)?I:void 0},"getArchitectureDirectionPair"),Ai=pt(function([D,C],I){const G=I[0],T=I[1];return kt(G)?Vt(T)?[D+(G==="L"?-1:1),C+(T==="T"?1:-1)]:[D+(G==="L"?-1:1),C]:kt(T)?[D+(T==="L"?1:-1),C+(G==="T"?1:-1)]:[D,C+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wi=pt(function(D){return D==="LT"||D==="TL"?[1,1]:D==="BL"||D==="LB"?[1,-1]:D==="BR"||D==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ii=pt(function(D,C){return ye(D,C)?"bend":kt(D)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Li=pt(function(D){return D.type==="service"},"isArchitectureService"),_i=pt(function(D){return D.type==="junction"},"isArchitectureJunction"),Re=pt(D=>D.data(),"edgeData"),te=pt(D=>D.data(),"nodeData"),Mi=ii.architecture,ee,Ge=(ee=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=$e,this.getAccTitle=je,this.setDiagramTitle=qe,this.getDiagramTitle=Ke,this.getAccDescription=Ze,this.setAccDescription=Je,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},Qe()}addService({id:C,icon:I,in:G,title:T,iconText:u}){if(this.registeredIds[C]!==void 0)throw new Error(`The service id [${C}] is already in use by another ${this.registeredIds[C]}`);if(G!==void 0){if(C===G)throw new Error(`The service [${C}] cannot be placed within itself`);if(this.registeredIds[G]===void 0)throw new Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[G]==="node")throw new Error(`The service [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"service",icon:I,iconText:u,title:T,edges:[],in:G}}getServices(){return Object.values(this.nodes).filter(Li)}addJunction({id:C,in:I}){this.registeredIds[C]="node",this.nodes[C]={id:C,type:"junction",edges:[],in:I}}getJunctions(){return Object.values(this.nodes).filter(_i)}getNodes(){return Object.values(this.nodes)}getNode(C){return this.nodes[C]??null}addGroup({id:C,icon:I,in:G,title:T}){if(this.registeredIds?.[C]!==void 0)throw new Error(`The group id [${C}] is already in use by another ${this.registeredIds[C]}`);if(G!==void 0){if(C===G)throw new Error(`The group [${C}] cannot be placed within itself`);if(this.registeredIds?.[G]===void 0)throw new Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[G]==="node")throw new Error(`The group [${C}]'s parent is not a group`)}this.registeredIds[C]="group",this.groups[C]={id:C,icon:I,title:T,in:G}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:C,rhsId:I,lhsDir:G,rhsDir:T,lhsInto:u,rhsInto:l,lhsGroup:o,rhsGroup:i,title:e}){if(!De(G))throw new Error(`Invalid direction given for left hand side of edge ${C}--${I}. Expected (L,R,T,B) got ${String(G)}`);if(!De(T))throw new Error(`Invalid direction given for right hand side of edge ${C}--${I}. Expected (L,R,T,B) got ${String(T)}`);if(this.nodes[C]===void 0&&this.groups[C]===void 0)throw new Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[I]===void 0&&this.groups[I]===void 0)throw new Error(`The right-hand id [${I}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[C].in,r=this.nodes[I].in;if(o&&a&&r&&a==r)throw new Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&r&&a==r)throw new Error(`The right-hand id [${I}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:C,lhsDir:G,lhsInto:u,lhsGroup:o,rhsId:I,rhsDir:T,rhsInto:l,rhsGroup:i,title:e};this.edges.push(f),this.nodes[C]&&this.nodes[I]&&(this.nodes[C].edges.push(this.edges[this.edges.length-1]),this.nodes[I].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const C={},I=Object.entries(this.nodes).reduce((i,[e,a])=>(i[e]=a.edges.reduce((r,f)=>{const t=this.getNode(f.lhsId)?.in,s=this.getNode(f.rhsId)?.in;if(t&&s&&t!==s){const h=Ii(f.lhsDir,f.rhsDir);h!=="bend"&&(C[t]??(C[t]={}),C[t][s]=h,C[s]??(C[s]={}),C[s][t]=h)}if(f.lhsId===e){const h=pe(f.lhsDir,f.rhsDir);h&&(r[h]=f.rhsId)}else{const h=pe(f.rhsDir,f.lhsDir);h&&(r[h]=f.lhsId)}return r},{}),i),{}),G=Object.keys(I)[0],T={[G]:1},u=Object.keys(I).reduce((i,e)=>e===G?i:{...i,[e]:1},{}),l=pt(i=>{const e={[i]:[0,0]},a=[i];for(;a.length>0;){const r=a.shift();if(r){T[r]=1,delete u[r];const f=I[r],[t,s]=e[r];Object.entries(f).forEach(([h,g])=>{T[g]||(e[g]=Ai([t,s],h),a.push(g))})}}return e},"BFS"),o=[l(G)];for(;Object.keys(u).length>0;)o.push(l(Object.keys(u)[0]));this.dataStructures={adjList:I,spatialMaps:o,groupAlignments:C}}return this.dataStructures}setElementForId(C,I){this.elements[C]=I}getElementById(C){return this.elements[C]}getConfig(){return ti({...Mi,...ei().architecture})}getConfigField(C){return this.getConfig()[C]}},pt(ee,"ArchitectureDB"),ee),Ci=pt((D,C)=>{si(D,C),D.groups.map(I=>C.addGroup(I)),D.services.map(I=>C.addService({...I,type:"service"})),D.junctions.map(I=>C.addJunction({...I,type:"junction"})),D.edges.map(I=>C.addEdge(I))},"populateDb"),Fe={parser:{yy:void 0},parse:pt(async D=>{const C=await hi("architecture",D);be.debug(C);const I=Fe.parser?.yy;if(!(I instanceof Ge))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ci(C,I)},"parse")},xi=pt(D=>` .edge { stroke-width: ${D.archEdgeWidth}; stroke: ${D.archEdgeColor}; fill: none; } .arrow { fill: ${D.archEdgeArrowColor}; } .node-bkg { fill: none; stroke: ${D.archGroupBorderColor}; stroke-width: ${D.archGroupBorderWidth}; stroke-dasharray: 8; } .node-icon-text { display: flex; align-items: center; } .node-icon-text > div { color: #fff; margin: 1px; height: fit-content; text-align: center; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; } `,"getStyles"),Di=xi,Qt=pt(D=>`${D}`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Qt('')},server:{body:Qt('')},disk:{body:Qt('')},internet:{body:Qt('')},cloud:{body:Qt('')},unknown:ai,blank:{body:Qt("")}}},bi=pt(async function(D,C,I){const G=I.getConfigField("padding"),T=I.getConfigField("iconSize"),u=T/2,l=T/6,o=l/2;await Promise.all(C.edges().map(async i=>{const{source:e,sourceDir:a,sourceArrow:r,sourceGroup:f,target:t,targetDir:s,targetArrow:h,targetGroup:g,label:d}=Re(i);let{x:N,y:c}=i[0].sourceEndpoint();const{x:y,y:A}=i[0].midpoint();let{x:w,y:P}=i[0].targetEndpoint();const k=G+4;if(f&&(kt(a)?N+=a==="L"?-k:k:c+=a==="T"?-k:k+18),g&&(kt(s)?w+=s==="L"?-k:k:P+=s==="T"?-k:k+18),!f&&I.getNode(e)?.type==="junction"&&(kt(a)?N+=a==="L"?u:-u:c+=a==="T"?u:-u),!g&&I.getNode(t)?.type==="junction"&&(kt(s)?w+=s==="L"?u:-u:P+=s==="T"?u:-u),i[0]._private.rscratch){const Y=D.insert("g");if(Y.insert("path").attr("d",`M ${N},${c} L ${y},${A} L${w},${P} `).attr("class","edge").attr("id",ri(e,t,{prefix:"L"})),r){const H=kt(a)?oe[a](N,l):N-o,Z=Vt(a)?oe[a](c,l):c-o;Y.insert("polygon").attr("points",xe[a](l)).attr("transform",`translate(${H},${Z})`).attr("class","arrow")}if(h){const H=kt(s)?oe[s](w,l):w-o,Z=Vt(s)?oe[s](P,l):P-o;Y.insert("polygon").attr("points",xe[s](l)).attr("transform",`translate(${H},${Z})`).attr("class","arrow")}if(d){const H=ye(a,s)?"XY":kt(a)?"X":"Y";let Z=0;H==="X"?Z=Math.abs(N-w):H==="Y"?Z=Math.abs(c-P)/1.5:Z=Math.abs(N-w)/2;const M=Y.append("g");if(await ve(M,d,{useHtmlLabels:!1,width:Z,classes:"architecture-service-label"},me()),M.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),H==="X")M.attr("transform","translate("+y+", "+A+")");else if(H==="Y")M.attr("transform","translate("+y+", "+A+") rotate(-90)");else if(H==="XY"){const rt=pe(a,s);if(rt&&Ni(rt)){const n=M.node().getBoundingClientRect(),[E,p]=wi(rt);M.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*E*p*45})`);const m=M.node().getBoundingClientRect();M.attr("transform",` translate(${y}, ${A-n.height/2}) translate(${E*m.width/2}, ${p*m.height/2}) rotate(${-1*E*p*45}, 0, ${n.height/2}) `)}}}}}))},"drawEdges"),Oi=pt(async function(D,C,I){const G=I.getConfigField("padding")*.75,T=I.getConfigField("fontSize"),u=I.getConfigField("iconSize")/2;await Promise.all(C.nodes().map(async l=>{const o=te(l);if(o.type==="group"){const{h:i,w:e,x1:a,y1:r}=l.boundingBox(),f=D.append("rect");f.attr("id",`group-${o.id}`).attr("x",a+u).attr("y",r+u).attr("width",e).attr("height",i).attr("class","node-bkg");const t=D.append("g");let s=a,h=r;if(o.icon){const g=t.append("g");g.html(`${await ce(o.icon,{height:G,width:G,fallbackPrefix:ne.prefix})}`),g.attr("transform","translate("+(s+u+1)+", "+(h+u+1)+")"),s+=G,h+=T/2-1-2}if(o.label){const g=t.append("g");await ve(g,o.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},me()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(s+u+4)+", "+(h+u+2)+")")}I.setElementForId(o.id,f)}}))},"drawGroups"),Ri=pt(async function(D,C,I){const G=me();for(const T of I){const u=C.append("g"),l=D.getConfigField("iconSize");if(T.title){const a=u.append("g");await ve(a,T.title,{useHtmlLabels:!1,width:l*1.5,classes:"architecture-service-label"},G),a.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),a.attr("transform","translate("+l/2+", "+l+")")}const o=u.append("g");if(T.icon)o.html(`${await ce(T.icon,{height:l,width:l,fallbackPrefix:ne.prefix})}`);else if(T.iconText){o.html(`${await ce("blank",{height:l,width:l,fallbackPrefix:ne.prefix})}`);const a=o.append("g").append("foreignObject").attr("width",l).attr("height",l).append("div").attr("class","node-icon-text").attr("style",`height: ${l}px;`).append("div").html(ni(T.iconText,G)),r=parseInt(window.getComputedStyle(a.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;a.attr("style",`-webkit-line-clamp: ${Math.floor((l-2)/r)};`)}else o.append("path").attr("class","node-bkg").attr("id","node-"+T.id).attr("d",`M0 ${l} v${-l} q0,-5 5,-5 h${l} q5,0 5,5 v${l} H0 Z`);u.attr("id",`service-${T.id}`).attr("class","architecture-service");const{width:i,height:e}=u.node().getBBox();T.width=i,T.height=e,D.setElementForId(T.id,u)}return 0},"drawServices"),Gi=pt(function(D,C,I){I.forEach(G=>{const T=C.append("g"),u=D.getConfigField("iconSize");T.append("g").append("rect").attr("id","node-"+G.id).attr("fill-opacity","0").attr("width",u).attr("height",u),T.attr("class","architecture-junction");const{width:l,height:o}=T._groups[0][0].getBBox();T.width=l,T.height=o,D.setElementForId(G.id,T)})},"drawJunctions");oi([{name:ne.prefix,icons:ne}]),Oe.use(yi);function Se(D,C,I){D.forEach(G=>{C.add({group:"nodes",data:{type:"service",id:G.id,icon:G.icon,label:G.title,parent:G.in,width:I.getConfigField("iconSize"),height:I.getConfigField("iconSize")},classes:"node-service"})})}pt(Se,"addServices");function Pe(D,C,I){D.forEach(G=>{C.add({group:"nodes",data:{type:"junction",id:G.id,parent:G.in,width:I.getConfigField("iconSize"),height:I.getConfigField("iconSize")},classes:"node-junction"})})}pt(Pe,"addJunctions");function Ue(D,C){C.nodes().map(I=>{const G=te(I);G.type!=="group"&&(G.x=I.position().x,G.y=I.position().y,D.getElementById(G.id).attr("transform","translate("+(G.x||0)+","+(G.y||0)+")"))})}pt(Ue,"positionNodes");function ke(D,C){D.forEach(I=>{C.add({group:"nodes",data:{type:"group",id:I.id,icon:I.icon,label:I.title,parent:I.in},classes:"node-group"})})}pt(ke,"addGroups");function Xe(D,C){D.forEach(I=>{const{lhsId:G,rhsId:T,lhsInto:u,lhsGroup:l,rhsInto:o,lhsDir:i,rhsDir:e,rhsGroup:a,title:r}=I,f=ye(I.lhsDir,I.rhsDir)?"segments":"straight",t={id:`${G}-${T}`,label:r,source:G,sourceDir:i,sourceArrow:u,sourceGroup:l,sourceEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%",target:T,targetDir:e,targetArrow:o,targetGroup:a,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};C.add({group:"edges",data:t,classes:f})})}pt(Xe,"addEdges");function Ye(D,C,I){const G=pt((o,i)=>Object.entries(o).reduce((e,[a,r])=>{let f=0;const t=Object.entries(r);if(t.length===1)return e[a]=t[0][1],e;for(let s=0;s{const i={},e={};return Object.entries(o).forEach(([a,[r,f]])=>{var s,h;const t=D.getNode(a)?.in??"default";i[f]??(i[f]={}),(s=i[f])[t]??(s[t]=[]),i[f][t].push(a),e[r]??(e[r]={}),(h=e[r])[t]??(h[t]=[]),e[r][t].push(a)}),{horiz:Object.values(G(i,"horizontal")).filter(a=>a.length>1),vert:Object.values(G(e,"vertical")).filter(a=>a.length>1)}}),[u,l]=T.reduce(([o,i],{horiz:e,vert:a})=>[[...o,...e],[...i,...a]],[[],[]]);return{horizontal:u,vertical:l}}pt(Ye,"getAlignments");function He(D,C){const I=[],G=pt(u=>`${u[0]},${u[1]}`,"posToStr"),T=pt(u=>u.split(",").map(l=>parseInt(l)),"strToPos");return D.forEach(u=>{const l=Object.fromEntries(Object.entries(u).map(([a,r])=>[G(r),a])),o=[G([0,0])],i={},e={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const a=o.shift();if(a){i[a]=1;const r=l[a];if(r){const f=T(a);Object.entries(e).forEach(([t,s])=>{const h=G([f[0]+s[0],f[1]+s[1]]),g=l[h];g&&!i[h]&&(o.push(h),I.push({[Ce[t]]:g,[Ce[Ei(t)]]:r,gap:1.5*C.getConfigField("iconSize")}))})}}}}),I}pt(He,"getRelativeConstraints");function We(D,C,I,G,T,{spatialMaps:u,groupAlignments:l}){return new Promise(o=>{const i=di("body").append("div").attr("id","cy").attr("style","display:none"),e=Oe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${T.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${T.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});i.remove(),ke(I,e),Se(D,e,T),Pe(C,e,T),Xe(G,e);const a=Ye(T,u,l),r=He(u,T),f=e.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[s,h]=t.connectedNodes(),{parent:g}=te(s),{parent:d}=te(h);return g===d?1.5*T.getConfigField("iconSize"):.5*T.getConfigField("iconSize")},edgeElasticity(t){const[s,h]=t.connectedNodes(),{parent:g}=te(s),{parent:d}=te(h);return g===d?.45:.001},alignmentConstraint:a,relativePlacementConstraint:r});f.one("layoutstop",()=>{function t(s,h,g,d){let N,c;const{x:y,y:A}=s,{x:w,y:P}=h;c=(d-A+(y-g)*(A-P)/(y-w))/Math.sqrt(1+Math.pow((A-P)/(y-w),2)),N=Math.sqrt(Math.pow(d-A,2)+Math.pow(g-y,2)-Math.pow(c,2));const k=Math.sqrt(Math.pow(w-y,2)+Math.pow(P-A,2));N=N/k;let Y=(w-y)*(d-A)-(P-A)*(g-y);switch(!0){case Y>=0:Y=1;break;case Y<0:Y=-1;break}let H=(w-y)*(g-y)+(P-A)*(d-A);switch(!0){case H>=0:H=1;break;case H<0:H=-1;break}return c=Math.abs(c)*Y,N=N*H,{distances:c,weights:N}}pt(t,"getSegmentWeights"),e.startBatch();for(const s of Object.values(e.edges()))if(s.data?.()){const{x:h,y:g}=s.source().position(),{x:d,y:N}=s.target().position();if(h!==d&&g!==N){const c=s.sourceEndpoint(),y=s.targetEndpoint(),{sourceDir:A}=Re(s),[w,P]=Vt(A)?[c.x,y.y]:[y.x,c.y],{weights:k,distances:Y}=t(c,y,w,P);s.style("segment-distances",Y),s.style("segment-weights",k)}}e.endBatch(),f.run()}),f.run(),e.ready(t=>{be.info("Ready",t),o(e)})})}pt(We,"layoutArchitecture");var Fi=pt(async(D,C,I,G)=>{const T=G.db,u=T.getServices(),l=T.getJunctions(),o=T.getGroups(),i=T.getEdges(),e=T.getDataStructures(),a=Be(C),r=a.append("g");r.attr("class","architecture-edges");const f=a.append("g");f.attr("class","architecture-services");const t=a.append("g");t.attr("class","architecture-groups"),await Ri(T,f,u),Gi(T,f,l);const s=await We(u,l,o,i,T,e);await bi(r,s,T),await Oi(t,s,T),Ue(T,s),Ve(void 0,a,T.getConfigField("padding"),T.getConfigField("useMaxWidth"))},"draw"),Si={draw:Fi},an={parser:Fe,get db(){return new Ge},renderer:Si,styles:Di};export{an as diagram}; //# sourceMappingURL=architectureDiagram-VXUJARFQ-DiqBgp7x.chunk.mjs.map