import{a as Ce}from"./chunk-LGVNNTMI.js";import{a as Je}from"./chunk-HTMW6R2V.js";import{a as qe}from"./chunk-MF5TUIBL.js";import{a as ke}from"./chunk-5XJO6U7A.js";import{a as Qe}from"./chunk-E4RBDSW5.js";import"./chunk-NKCQAART.js";import"./chunk-WNVR7S66.js";import"./chunk-ZP5QXAVO.js";import{a as Be,b as $e,c as ue}from"./chunk-NCYNIMJ4.js";import{d as ge}from"./chunk-ZPWCXWQI.js";import"./chunk-47P5NBBB.js";import"./chunk-XHGORZV2.js";import{P as Ge,S as Ue,T as Ye,U as Xe,V as He,W as We,X as Ve,Y as ze,Z as ae,h as at,ia as Ze,j as Le,v as Pe}from"./chunk-KRX7QNR4.js";import"./chunk-UY4K4Z6W.js";import"./chunk-TZMIYTTY.js";import"./chunk-SA2EGKJT.js";import"./chunk-WYMAA4MH.js";import"./chunk-SISR4MA5.js";import"./chunk-24JW6VB3.js";import{a as fe,b as ce,f as Ne,i as dr}from"./chunk-MGYUK2XN.js";var Ae=Ne((ne,Me)=>{(function(A,N){typeof ne=="object"&&typeof Me=="object"?Me.exports=N():typeof define=="function"&&define.amd?define([],N):typeof ne=="object"?ne.layoutBase=N():A.layoutBase=N()})(ne,function(){return function(m){var A={};function N(g){if(A[g])return A[g].exports;var o=A[g]={i:g,l:!1,exports:{}};return m[g].call(o.exports,o,o.exports,N),o.l=!0,o.exports}return N.m=m,N.c=A,N.i=function(g){return g},N.d=function(g,o,n){N.o(g,o)||Object.defineProperty(g,o,{configurable:!1,enumerable:!0,get:n})},N.n=function(g){var o=g&&g.__esModule?function(){return g.default}:function(){return g};return N.d(o,"a",o),o},N.o=function(g,o){return Object.prototype.hasOwnProperty.call(g,o)},N.p="",N(N.s=28)}([function(m,A,N){"use strict";function g(){}g.QUALITY=1,g.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,g.DEFAULT_INCREMENTAL=!1,g.DEFAULT_ANIMATION_ON_LAYOUT=!0,g.DEFAULT_ANIMATION_DURING_LAYOUT=!1,g.DEFAULT_ANIMATION_PERIOD=50,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,g.DEFAULT_GRAPH_MARGIN=15,g.NODE_DIMENSIONS_INCLUDE_LABELS=!1,g.SIMPLE_NODE_SIZE=40,g.SIMPLE_NODE_HALF_SIZE=g.SIMPLE_NODE_SIZE/2,g.EMPTY_COMPOUND_NODE_SIZE=40,g.MIN_EDGE_LENGTH=1,g.WORLD_BOUNDARY=1e6,g.INITIAL_WORLD_BOUNDARY=g.WORLD_BOUNDARY/1e3,g.WORLD_CENTER_X=1200,g.WORLD_CENTER_Y=900,m.exports=g},function(m,A,N){"use strict";var g=N(2),o=N(8),n=N(9);function t(f,e,v){g.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=f,this.target=e}t.prototype=Object.create(g.prototype);for(var r in g)t[r]=g[r];t.prototype.getSource=function(){return this.source},t.prototype.getTarget=function(){return this.target},t.prototype.isInterGraph=function(){return this.isInterGraph},t.prototype.getLength=function(){return this.length},t.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},t.prototype.getBendpoints=function(){return this.bendpoints},t.prototype.getLca=function(){return this.lca},t.prototype.getSourceInLca=function(){return this.sourceInLca},t.prototype.getTargetInLca=function(){return this.targetInLca},t.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},t.prototype.getOtherEndInGraph=function(f,e){for(var v=this.getOtherEnd(f),i=e.getGraphManager().getRoot();;){if(v.getOwner()==e)return v;if(v.getOwner()==i)break;v=v.getOwner().getParent()}return null},t.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},t.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=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=t},function(m,A,N){"use strict";function g(o){this.vGraphObject=o}m.exports=g},function(m,A,N){"use strict";var g=N(2),o=N(10),n=N(13),t=N(0),r=N(16),f=N(5);function e(i,a,s,c){s==null&&c==null&&(c=a),g.call(this,c),i.graphManager!=null&&(i=i.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=i,s!=null&&a!=null?this.rect=new n(a.x,a.y,s.width,s.height):this.rect=new n}e.prototype=Object.create(g.prototype);for(var v in g)e[v]=g[v];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(i){this.rect.width=i},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(i){this.rect.height=i},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(i,a){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=a.width,this.rect.height=a.height},e.prototype.setCenter=function(i,a){this.rect.x=i-this.rect.width/2,this.rect.y=a-this.rect.height/2},e.prototype.setLocation=function(i,a){this.rect.x=i,this.rect.y=a},e.prototype.moveBy=function(i,a){this.rect.x+=i,this.rect.y+=a},e.prototype.getEdgeListToNode=function(i){var a=[],s,c=this;return c.edges.forEach(function(l){if(l.target==i){if(l.source!=c)throw"Incorrect edge source!";a.push(l)}}),a},e.prototype.getEdgesBetween=function(i){var a=[],s,c=this;return c.edges.forEach(function(l){if(!(l.source==c||l.target==c))throw"Incorrect edge source and/or target";(l.target==i||l.source==i)&&a.push(l)}),a},e.prototype.getNeighborsList=function(){var i=new Set,a=this;return a.edges.forEach(function(s){if(s.source==a)i.add(s.target);else{if(s.target!=a)throw"Incorrect incidency!";i.add(s.source)}}),i},e.prototype.withChildren=function(){var i=new Set,a,s;if(i.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;la?(this.rect.x-=(this.labelWidth-a)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(a+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(s+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>s?(this.rect.y-=(this.labelHeight-s)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(s+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(i){var a=this.rect.x;a>t.WORLD_BOUNDARY?a=t.WORLD_BOUNDARY:a<-t.WORLD_BOUNDARY&&(a=-t.WORLD_BOUNDARY);var s=this.rect.y;s>t.WORLD_BOUNDARY?s=t.WORLD_BOUNDARY:s<-t.WORLD_BOUNDARY&&(s=-t.WORLD_BOUNDARY);var c=new f(a,s),l=i.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},m.exports=e},function(m,A,N){"use strict";var g=N(0);function o(){}for(var n in g)o[n]=g[n];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,o.MAX_NODE_DISPLACEMENT=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=o},function(m,A,N){"use strict";function g(o,n){o==null&&n==null?(this.x=0,this.y=0):(this.x=o,this.y=n)}g.prototype.getX=function(){return this.x},g.prototype.getY=function(){return this.y},g.prototype.setX=function(o){this.x=o},g.prototype.setY=function(o){this.y=o},g.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},g.prototype.getCopy=function(){return new g(this.x,this.y)},g.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},m.exports=g},function(m,A,N){"use strict";var g=N(2),o=N(10),n=N(0),t=N(7),r=N(3),f=N(1),e=N(13),v=N(12),i=N(11);function a(c,l,L){g.call(this,L),this.estimatedSize=o.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof t?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}a.prototype=Object.create(g.prototype);for(var s in g)a[s]=g[s];a.prototype.getNodes=function(){return this.nodes},a.prototype.getEdges=function(){return this.edges},a.prototype.getGraphManager=function(){return this.graphManager},a.prototype.getParent=function(){return this.parent},a.prototype.getLeft=function(){return this.left},a.prototype.getRight=function(){return this.right},a.prototype.getTop=function(){return this.top},a.prototype.getBottom=function(){return this.bottom},a.prototype.isConnected=function(){return this.isConnected},a.prototype.add=function(c,l,L){if(l==null&&L==null){var p=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(p)>-1)throw"Node already in graph!";return p.owner=this,this.getNodes().push(p),p}else{var y=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(L)>-1))throw"Source or target not in graph!";if(!(l.owner==L.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=L.owner?null:(y.source=l,y.target=L,y.isInterGraph=!1,this.getEdges().push(y),l.edges.push(y),L!=l&&L.edges.push(y),y)}},a.prototype.remove=function(c){var l=c;if(c instanceof r){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var L=l.edges.slice(),p,y=L.length,C=0;C-1&&b>-1))throw"Source and/or target doesn't know this edge!";p.source.edges.splice(M,1),p.target!=p.source&&p.target.edges.splice(b,1);var R=p.source.owner.getEdges().indexOf(p);if(R==-1)throw"Not in owner's edge list!";p.source.owner.getEdges().splice(R,1)}},a.prototype.updateLeftTop=function(){for(var c=o.MAX_VALUE,l=o.MAX_VALUE,L,p,y,C=this.getNodes(),R=C.length,M=0;ML&&(c=L),l>p&&(l=p)}return c==o.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?y=C[0].getParent().paddingLeft:y=this.margin,this.left=l-y,this.top=c-y,new v(this.left,this.top))},a.prototype.updateBounds=function(c){for(var l=o.MAX_VALUE,L=-o.MAX_VALUE,p=o.MAX_VALUE,y=-o.MAX_VALUE,C,R,M,b,Z,Y=this.nodes,et=Y.length,I=0;IC&&(l=C),LM&&(p=M),yC&&(l=C),LM&&(p=M),y=this.nodes.length){var et=0;L.forEach(function(I){I.owner==c&&et++}),et==this.nodes.length&&(this.isConnected=!0)}},m.exports=a},function(m,A,N){"use strict";var g,o=N(1);function n(t){g=N(6),this.layout=t,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var t=this.layout.newGraph(),r=this.layout.newNode(null),f=this.add(t,r);return this.setRootGraph(f),this.rootGraph},n.prototype.add=function(t,r,f,e,v){if(f==null&&e==null&&v==null){if(t==null)throw"Graph is null!";if(r==null)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),t.parent!=null)throw"Already has a parent!";if(r.child!=null)throw"Already has a child!";return t.parent=r,r.child=t,t}else{v=f,e=r,f=t;var i=e.getOwner(),a=v.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(a!=null&&a.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==a)return f.isInterGraph=!1,i.add(f,e,v);if(f.isInterGraph=!0,f.source=e,f.target=v,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},n.prototype.remove=function(t){if(t instanceof g){var r=t;if(r.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(r==this.rootGraph||r.parent!=null&&r.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(r.getEdges());for(var e,v=f.length,i=0;i=t.getRight()?r[0]+=Math.min(t.getX()-n.getX(),n.getRight()-t.getRight()):t.getX()<=n.getX()&&t.getRight()>=n.getRight()&&(r[0]+=Math.min(n.getX()-t.getX(),t.getRight()-n.getRight())),n.getY()<=t.getY()&&n.getBottom()>=t.getBottom()?r[1]+=Math.min(t.getY()-n.getY(),n.getBottom()-t.getBottom()):t.getY()<=n.getY()&&t.getBottom()>=n.getBottom()&&(r[1]+=Math.min(n.getY()-t.getY(),t.getBottom()-n.getBottom()));var v=Math.abs((t.getCenterY()-n.getCenterY())/(t.getCenterX()-n.getCenterX()));t.getCenterY()===n.getCenterY()&&t.getCenterX()===n.getCenterX()&&(v=1);var i=v*r[0],a=r[1]/v;r[0]i)return r[0]=f,r[1]=s,r[2]=v,r[3]=Y,!1;if(ev)return r[0]=a,r[1]=e,r[2]=b,r[3]=i,!1;if(fv?(r[0]=l,r[1]=L,h=!0):(r[0]=c,r[1]=s,h=!0):d===u&&(f>v?(r[0]=a,r[1]=s,h=!0):(r[0]=p,r[1]=L,h=!0)),-T===u?v>f?(r[2]=Z,r[3]=Y,E=!0):(r[2]=b,r[3]=M,E=!0):T===u&&(v>f?(r[2]=R,r[3]=M,E=!0):(r[2]=et,r[3]=Y,E=!0)),h&&E)return!1;if(f>v?e>i?(D=this.getCardinalDirection(d,u,4),O=this.getCardinalDirection(T,u,2)):(D=this.getCardinalDirection(-d,u,3),O=this.getCardinalDirection(-T,u,1)):e>i?(D=this.getCardinalDirection(-d,u,1),O=this.getCardinalDirection(-T,u,3)):(D=this.getCardinalDirection(d,u,2),O=this.getCardinalDirection(T,u,4)),!h)switch(D){case 1:S=s,P=f+-C/u,r[0]=P,r[1]=S;break;case 2:P=p,S=e+y*u,r[0]=P,r[1]=S;break;case 3:S=L,P=f+C/u,r[0]=P,r[1]=S;break;case 4:P=l,S=e+-y*u,r[0]=P,r[1]=S;break}if(!E)switch(O){case 1:$=M,x=v+-k/u,r[2]=x,r[3]=$;break;case 2:x=et,$=i+I*u,r[2]=x,r[3]=$;break;case 3:$=Y,x=v+k/u,r[2]=x,r[3]=$;break;case 4:x=Z,$=i+-I*u,r[2]=x,r[3]=$;break}}return!1},o.getCardinalDirection=function(n,t,r){return n>t?r:1+r%4},o.getIntersection=function(n,t,r,f){if(f==null)return this.getIntersection2(n,t,r);var e=n.x,v=n.y,i=t.x,a=t.y,s=r.x,c=r.y,l=f.x,L=f.y,p=void 0,y=void 0,C=void 0,R=void 0,M=void 0,b=void 0,Z=void 0,Y=void 0,et=void 0;return C=a-v,M=e-i,Z=i*v-e*a,R=L-c,b=s-l,Y=l*c-s*L,et=C*b-R*M,et===0?null:(p=(M*Y-b*Z)/et,y=(R*Z-C*Y)/et,new g(p,y))},o.angleOfVector=function(n,t,r,f){var e=void 0;return n!==r?(e=Math.atan((f-t)/(r-n)),r=0){var L=(-s+Math.sqrt(s*s-4*a*c))/(2*a),p=(-s-Math.sqrt(s*s-4*a*c))/(2*a),y=null;return L>=0&&L<=1?[L]:p>=0&&p<=1?[p]:y}else return null},o.HALF_PI=.5*Math.PI,o.ONE_AND_HALF_PI=1.5*Math.PI,o.TWO_PI=2*Math.PI,o.THREE_PI=3*Math.PI,m.exports=o},function(m,A,N){"use strict";function g(){}g.sign=function(o){return o>0?1:o<0?-1:0},g.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},g.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},m.exports=g},function(m,A,N){"use strict";function g(){}g.MAX_VALUE=2147483647,g.MIN_VALUE=-2147483648,m.exports=g},function(m,A,N){"use strict";var g=function(){function e(v,i){for(var a=0;a0&&c;){for(C.push(M[0]);C.length>0&&c;){var b=C[0];C.splice(0,1),y.add(b);for(var Z=b.getEdges(),p=0;p-1&&M.splice(k,1)}y=new Set,R=new Map}}return s},a.prototype.createDummyNodesForBendpoints=function(s){for(var c=[],l=s.source,L=this.graphManager.calcLowestCommonAncestor(s.source,s.target),p=0;p0){for(var L=this.edgeToDummyNodes.get(l),p=0;p=0&&c.splice(Y,1);var et=R.getNeighborsList();et.forEach(function(h){if(l.indexOf(h)<0){var E=L.get(h),d=E-1;d==1&&b.push(h),L.set(h,d)}})}l=l.concat(b),(c.length==1||c.length==2)&&(p=!0,y=c[0])}return y},a.prototype.setGraphManager=function(s){this.graphManager=s},m.exports=a},function(m,A,N){"use strict";function g(){}g.seed=1,g.x=0,g.nextDouble=function(){return g.x=Math.sin(g.seed++)*1e4,g.x-Math.floor(g.x)},m.exports=g},function(m,A,N){"use strict";var g=N(5);function o(n,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(n){this.lworldExtX=n},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(n){this.lworldExtY=n},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},o.prototype.transformX=function(n){var t=0,r=this.lworldExtX;return r!=0&&(t=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/r),t},o.prototype.transformY=function(n){var t=0,r=this.lworldExtY;return r!=0&&(t=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/r),t},o.prototype.inverseTransformX=function(n){var t=0,r=this.ldeviceExtX;return r!=0&&(t=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/r),t},o.prototype.inverseTransformY=function(n){var t=0,r=this.ldeviceExtY;return r!=0&&(t=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/r),t},o.prototype.inverseTransformPoint=function(n){var t=new g(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return t},m.exports=o},function(m,A,N){"use strict";function g(i){if(Array.isArray(i)){for(var a=0,s=Array(i.length);an.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(i>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(i-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var i=this.getAllEdges(),a,s=0;s0&&arguments[0]!==void 0?arguments[0]:!0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s,c,l,L,p=this.getAllNodes(),y;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&i&&this.updateGrid(),y=new Set,s=0;sC||y>C)&&(i.gravitationForceX=-this.gravityConstant*l,i.gravitationForceY=-this.gravityConstant*L)):(C=a.getEstimatedSize()*this.compoundGravityRangeFactor,(p>C||y>C)&&(i.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*L*this.compoundGravityConstant))},e.prototype.isConverged=function(){var i,a=!1;return this.totalIterations>this.maxIterations/3&&(a=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),i=this.totalDisplacement=p.length||C>=p[0].length)){for(var R=0;Re}}]),r}();m.exports=t},function(m,A,N){"use strict";function g(){}g.svd=function(o){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=o.length,this.n=o[0].length;var n=Math.min(this.m,this.n);this.s=function(xt){for(var Lt=[];xt-- >0;)Lt.push(0);return Lt}(Math.min(this.m+1,this.n)),this.U=function(xt){var Lt=function kt(St){if(St.length==0)return 0;for(var Wt=[],$t=0;$t0;)Lt.push(0);return Lt}(this.n),r=function(xt){for(var Lt=[];xt-- >0;)Lt.push(0);return Lt}(this.m),f=!0,e=!0,v=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m)),a=0;a=0;u--)if(this.s[u]!==0){for(var D=u+1;D=0;F--){if(function(xt,Lt){return xt&&Lt}(F0;){var J=void 0,Xt=void 0;for(J=E-2;J>=-1&&J!==-1;J--)if(Math.abs(t[J])<=Ft+Ct*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){t[J]=0;break}if(J===E-2)Xt=4;else{var Ot=void 0;for(Ot=E-1;Ot>=J&&Ot!==J;Ot--){var ot=(Ot!==E?Math.abs(t[Ot]):0)+(Ot!==J+1?Math.abs(t[Ot-1]):0);if(Math.abs(this.s[Ot])<=Ft+Ct*ot){this.s[Ot]=0;break}}Ot===J?Xt=3:Ot===E-1?Xt=1:(Xt=2,J=Ot)}switch(J++,Xt){case 1:{var tt=t[E-2];t[E-2]=0;for(var yt=E-2;yt>=J;yt--){var mt=g.hypot(this.s[yt],tt),Mt=this.s[yt]/mt,Tt=tt/mt;if(this.s[yt]=mt,yt!==J&&(tt=-Tt*t[yt-1],t[yt-1]=Mt*t[yt-1]),e)for(var Nt=0;Nt=this.s[J+1]);){var ft=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=ft,e&&JMath.abs(n)?(t=n/o,t=Math.abs(o)*Math.sqrt(1+t*t)):n!=0?(t=o/n,t=Math.abs(n)*Math.sqrt(1+t*t)):t=0,t},m.exports=g},function(m,A,N){"use strict";var g=function(){function t(r,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;o(this,t),this.sequence1=r,this.sequence2=f,this.match_score=e,this.mismatch_penalty=v,this.gap_penalty=i,this.iMax=r.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var a=0;a=0;r--){var f=this.listeners[r];f.event===n&&f.callback===t&&this.listeners.splice(r,1)}},o.emit=function(n,t){for(var r=0;r{(function(A,N){typeof oe=="object"&&typeof we=="object"?we.exports=N(Ae()):typeof define=="function"&&define.amd?define(["layout-base"],N):typeof oe=="object"?oe.coseBase=N(Ae()):A.coseBase=N(A.layoutBase)})(oe,function(m){return(()=>{"use strict";var A={45:(n,t,r)=>{var f={};f.layoutBase=r(551),f.CoSEConstants=r(806),f.CoSEEdge=r(767),f.CoSEGraph=r(880),f.CoSEGraphManager=r(578),f.CoSELayout=r(765),f.CoSENode=r(991),f.ConstraintHandler=r(902),n.exports=f},806:(n,t,r)=>{var f=r(551).FDLayoutConstants;function e(){}for(var v in f)e[v]=f[v];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,n.exports=e},767:(n,t,r)=>{var f=r(551).FDLayoutEdge;function e(i,a,s){f.call(this,i,a,s)}e.prototype=Object.create(f.prototype);for(var v in f)e[v]=f[v];n.exports=e},880:(n,t,r)=>{var f=r(551).LGraph;function e(i,a,s){f.call(this,i,a,s)}e.prototype=Object.create(f.prototype);for(var v in f)e[v]=f[v];n.exports=e},578:(n,t,r)=>{var f=r(551).LGraphManager;function e(i){f.call(this,i)}e.prototype=Object.create(f.prototype);for(var v in f)e[v]=f[v];n.exports=e},765:(n,t,r)=>{var f=r(551).FDLayout,e=r(578),v=r(880),i=r(991),a=r(767),s=r(806),c=r(902),l=r(551).FDLayoutConstants,L=r(551).LayoutConstants,p=r(551).Point,y=r(551).PointD,C=r(551).DimensionD,R=r(551).Layout,M=r(551).Integer,b=r(551).IGeometry,Z=r(551).LGraph,Y=r(551).Transform,et=r(551).LinkedList;function I(){f.call(this),this.toBeTiled={},this.constraints={}}I.prototype=Object.create(f.prototype);for(var k in f)I[k]=f[k];I.prototype.newGraphManager=function(){var h=new e(this);return this.graphManager=h,h},I.prototype.newGraph=function(h){return new v(null,this.graphManager,h)},I.prototype.newNode=function(h){return new i(this.graphManager,h)},I.prototype.newEdge=function(h){return new a(null,null,h)},I.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(s.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=s.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},I.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},I.prototype.layout=function(){var h=L.DEFAULT_CREATE_BENDS_AS_NEEDED;return h&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},I.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(s.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(D){return E.has(D)});this.graphManager.setAllNodesToApplyGravitation(d)}}else{var h=this.getFlatForest();if(h.length>0)this.positionNodesRadially(h);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(T){return E.has(T)});this.graphManager.setAllNodesToApplyGravitation(d),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),s.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},I.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%l.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 h=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(u){return h.has(u)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),s.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.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()),s.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var d=!this.isTreeGrowing&&!this.isGrowthFinished,T=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(d,T),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},I.prototype.getPositionsData=function(){for(var h=this.graphManager.getAllNodes(),E={},d=0;d0&&this.updateDisplacements();for(var d=0;d0&&(T.fixedNodeWeight=D)}}if(this.constraints.relativePlacementConstraint){var O=new Map,P=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(w){h.fixedNodesOnHorizontal.add(w),h.fixedNodesOnVertical.add(w)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var S=this.constraints.alignmentConstraint.vertical,d=0;d=2*w.length/3;Q--)U=Math.floor(Math.random()*(Q+1)),X=w[Q],w[Q]=w[U],w[U]=X;return w},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(w){if(w.left){var U=O.has(w.left)?O.get(w.left):w.left,X=O.has(w.right)?O.get(w.right):w.right;h.nodesInRelativeHorizontal.includes(U)||(h.nodesInRelativeHorizontal.push(U),h.nodeToRelativeConstraintMapHorizontal.set(U,[]),h.dummyToNodeForVerticalAlignment.has(U)?h.nodeToTempPositionMapHorizontal.set(U,h.idToNodeMap.get(h.dummyToNodeForVerticalAlignment.get(U)[0]).getCenterX()):h.nodeToTempPositionMapHorizontal.set(U,h.idToNodeMap.get(U).getCenterX())),h.nodesInRelativeHorizontal.includes(X)||(h.nodesInRelativeHorizontal.push(X),h.nodeToRelativeConstraintMapHorizontal.set(X,[]),h.dummyToNodeForVerticalAlignment.has(X)?h.nodeToTempPositionMapHorizontal.set(X,h.idToNodeMap.get(h.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):h.nodeToTempPositionMapHorizontal.set(X,h.idToNodeMap.get(X).getCenterX())),h.nodeToRelativeConstraintMapHorizontal.get(U).push({right:X,gap:w.gap}),h.nodeToRelativeConstraintMapHorizontal.get(X).push({left:U,gap:w.gap})}else{var Q=P.has(w.top)?P.get(w.top):w.top,ht=P.has(w.bottom)?P.get(w.bottom):w.bottom;h.nodesInRelativeVertical.includes(Q)||(h.nodesInRelativeVertical.push(Q),h.nodeToRelativeConstraintMapVertical.set(Q,[]),h.dummyToNodeForHorizontalAlignment.has(Q)?h.nodeToTempPositionMapVertical.set(Q,h.idToNodeMap.get(h.dummyToNodeForHorizontalAlignment.get(Q)[0]).getCenterY()):h.nodeToTempPositionMapVertical.set(Q,h.idToNodeMap.get(Q).getCenterY())),h.nodesInRelativeVertical.includes(ht)||(h.nodesInRelativeVertical.push(ht),h.nodeToRelativeConstraintMapVertical.set(ht,[]),h.dummyToNodeForHorizontalAlignment.has(ht)?h.nodeToTempPositionMapVertical.set(ht,h.idToNodeMap.get(h.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):h.nodeToTempPositionMapVertical.set(ht,h.idToNodeMap.get(ht).getCenterY())),h.nodeToRelativeConstraintMapVertical.get(Q).push({bottom:ht,gap:w.gap}),h.nodeToRelativeConstraintMapVertical.get(ht).push({top:Q,gap:w.gap})}});else{var $=new Map,_=new Map;this.constraints.relativePlacementConstraint.forEach(function(w){if(w.left){var U=O.has(w.left)?O.get(w.left):w.left,X=O.has(w.right)?O.get(w.right):w.right;$.has(U)?$.get(U).push(X):$.set(U,[X]),$.has(X)?$.get(X).push(U):$.set(X,[U])}else{var Q=P.has(w.top)?P.get(w.top):w.top,ht=P.has(w.bottom)?P.get(w.bottom):w.bottom;_.has(Q)?_.get(Q).push(ht):_.set(Q,[ht]),_.has(ht)?_.get(ht).push(Q):_.set(ht,[Q])}});var F=function(U,X){var Q=[],ht=[],Ct=new et,Ft=new Set,J=0;return U.forEach(function(Xt,Ot){if(!Ft.has(Ot)){Q[J]=[],ht[J]=!1;var ot=Ot;for(Ct.push(ot),Ft.add(ot),Q[J].push(ot);Ct.length!=0;){ot=Ct.shift(),X.has(ot)&&(ht[J]=!0);var tt=U.get(ot);tt.forEach(function(yt){Ft.has(yt)||(Ct.push(yt),Ft.add(yt),Q[J].push(yt))})}J++}}),{components:Q,isFixed:ht}},j=F($,h.fixedNodesOnHorizontal);this.componentsOnHorizontal=j.components,this.fixedComponentsOnHorizontal=j.isFixed;var V=F(_,h.fixedNodesOnVertical);this.componentsOnVertical=V.components,this.fixedComponentsOnVertical=V.isFixed}}},I.prototype.updateDisplacements=function(){var h=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(V){var w=h.idToNodeMap.get(V.nodeId);w.displacementX=0,w.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,d=0;d1){var P;for(P=0;PT&&(T=Math.floor(O.y)),D=Math.floor(O.x+s.DEFAULT_COMPONENT_SEPERATION)}this.transform(new y(L.WORLD_CENTER_X-O.x/2,L.WORLD_CENTER_Y-O.y/2))},I.radialLayout=function(h,E,d){var T=Math.max(this.maxDiagonalInTree(h),s.DEFAULT_RADIAL_SEPARATION);I.branchRadialLayout(E,null,0,359,0,T);var u=Z.calculateBounds(h),D=new Y;D.setDeviceOrgX(u.getMinX()),D.setDeviceOrgY(u.getMinY()),D.setWorldOrgX(d.x),D.setWorldOrgY(d.y);for(var O=0;O1;){var Q=X[0];X.splice(0,1);var ht=F.indexOf(Q);ht>=0&&F.splice(ht,1),w--,j--}E!=null?U=(F.indexOf(X[0])+1)%w:U=0;for(var Ct=Math.abs(T-d)/j,Ft=U;V!=j;Ft=++Ft%w){var J=F[Ft].getOtherEnd(h);if(J!=E){var Xt=(d+V*Ct)%360,Ot=(Xt+Ct)%360;I.branchRadialLayout(J,h,Xt,Ot,u+D,D),V++}}},I.maxDiagonalInTree=function(h){for(var E=M.MIN_VALUE,d=0;dE&&(E=u)}return E},I.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},I.prototype.groupZeroDegreeMembers=function(){var h=this,E={};this.memberGroups={},this.idToDummyNode={};for(var d=[],T=this.graphManager.getAllNodes(),u=0;u1){var x="DummyCompound_"+S;h.memberGroups[x]=E[S];var $=E[S][0].getParent(),_=new i(h.graphManager);_.id=x,_.paddingLeft=$.paddingLeft||0,_.paddingRight=$.paddingRight||0,_.paddingBottom=$.paddingBottom||0,_.paddingTop=$.paddingTop||0,h.idToDummyNode[x]=_;var F=h.getGraphManager().add(h.newGraph(),_),j=$.getChild();j.add(_);for(var V=0;Vu?(T.rect.x-=(T.labelWidth-u)/2,T.setWidth(T.labelWidth),T.labelMarginLeft=(T.labelWidth-u)/2):T.labelPosHorizontal=="right"&&T.setWidth(u+T.labelWidth)),T.labelHeight&&(T.labelPosVertical=="top"?(T.rect.y-=T.labelHeight,T.setHeight(D+T.labelHeight),T.labelMarginTop=T.labelHeight):T.labelPosVertical=="center"&&T.labelHeight>D?(T.rect.y-=(T.labelHeight-D)/2,T.setHeight(T.labelHeight),T.labelMarginTop=(T.labelHeight-D)/2):T.labelPosVertical=="bottom"&&T.setHeight(D+T.labelHeight))}})},I.prototype.repopulateCompounds=function(){for(var h=this.compoundOrder.length-1;h>=0;h--){var E=this.compoundOrder[h],d=E.id,T=E.paddingLeft,u=E.paddingTop,D=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[d],E.rect.x,E.rect.y,T,u,D,O)}},I.prototype.repopulateZeroDegreeMembers=function(){var h=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(d){var T=h.idToDummyNode[d],u=T.paddingLeft,D=T.paddingTop,O=T.labelMarginLeft,P=T.labelMarginTop;h.adjustLocations(E[d],T.rect.x,T.rect.y,u,D,O,P)})},I.prototype.getToBeTiled=function(h){var E=h.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var d=h.getChild();if(d==null)return this.toBeTiled[E]=!1,!1;for(var T=d.getNodes(),u=0;u0)return this.toBeTiled[E]=!1,!1;if(D.getChild()==null){this.toBeTiled[D.id]=!1;continue}if(!this.getToBeTiled(D))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},I.prototype.getNodeDegree=function(h){for(var E=h.id,d=h.getEdges(),T=0,u=0;u$&&($=F.rect.height)}d+=$+h.verticalPadding}},I.prototype.tileCompoundMembers=function(h,E){var d=this;this.tiledMemberPack=[],Object.keys(h).forEach(function(T){var u=E[T];if(d.tiledMemberPack[T]=d.tileNodes(h[T],u.paddingLeft+u.paddingRight),u.rect.width=d.tiledMemberPack[T].width,u.rect.height=d.tiledMemberPack[T].height,u.setCenter(d.tiledMemberPack[T].centerX,d.tiledMemberPack[T].centerY),u.labelMarginLeft=0,u.labelMarginTop=0,s.NODE_DIMENSIONS_INCLUDE_LABELS){var D=u.rect.width,O=u.rect.height;u.labelWidth&&(u.labelPosHorizontal=="left"?(u.rect.x-=u.labelWidth,u.setWidth(D+u.labelWidth),u.labelMarginLeft=u.labelWidth):u.labelPosHorizontal=="center"&&u.labelWidth>D?(u.rect.x-=(u.labelWidth-D)/2,u.setWidth(u.labelWidth),u.labelMarginLeft=(u.labelWidth-D)/2):u.labelPosHorizontal=="right"&&u.setWidth(D+u.labelWidth)),u.labelHeight&&(u.labelPosVertical=="top"?(u.rect.y-=u.labelHeight,u.setHeight(O+u.labelHeight),u.labelMarginTop=u.labelHeight):u.labelPosVertical=="center"&&u.labelHeight>O?(u.rect.y-=(u.labelHeight-O)/2,u.setHeight(u.labelHeight),u.labelMarginTop=(u.labelHeight-O)/2):u.labelPosVertical=="bottom"&&u.setHeight(O+u.labelHeight))}})},I.prototype.tileNodes=function(h,E){var d=this.tileNodesByFavoringDim(h,E,!0),T=this.tileNodesByFavoringDim(h,E,!1),u=this.getOrgRatio(d),D=this.getOrgRatio(T),O;return DP&&(P=V.getWidth())});var S=D/u,x=O/u,$=Math.pow(d-T,2)+4*(S+T)*(x+d)*u,_=(T-d+Math.sqrt($))/(2*(S+T)),F;E?(F=Math.ceil(_),F==_&&F++):F=Math.floor(_);var j=F*(S+T)-T;return P>j&&(j=P),j+=T*2,j},I.prototype.tileNodesByFavoringDim=function(h,E,d){var T=s.TILING_PADDING_VERTICAL,u=s.TILING_PADDING_HORIZONTAL,D=s.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:T,horizontalPadding:u,centerX:0,centerY:0};D&&(O.idealRowWidth=this.calcIdealRowWidth(h,d));var P=function(w){return w.rect.width*w.rect.height},S=function(w,U){return P(U)-P(w)};h.sort(function(V,w){var U=S;return O.idealRowWidth?(U=D,U(V.id,w.id)):U(V,w)});for(var x=0,$=0,_=0;_0&&(O+=h.horizontalPadding),h.rowWidth[d]=O,h.width0&&(P+=h.verticalPadding);var S=0;P>h.rowHeight[d]&&(S=h.rowHeight[d],h.rowHeight[d]=P,S=h.rowHeight[d]-S),h.height+=S,h.rows[d].push(E)},I.prototype.getShortestRowIndex=function(h){for(var E=-1,d=Number.MAX_VALUE,T=0;Td&&(E=T,d=h.rowWidth[T]);return E},I.prototype.canAddHorizontal=function(h,E,d){if(h.idealRowWidth){var T=h.rows.length-1,u=h.rowWidth[T];return u+E+h.horizontalPadding<=h.idealRowWidth}var D=this.getShortestRowIndex(h);if(D<0)return!0;var O=h.rowWidth[D];if(O+h.horizontalPadding+E<=h.width)return!0;var P=0;h.rowHeight[D]0&&(P=d+h.verticalPadding-h.rowHeight[D]);var S;h.width-O>=E+h.horizontalPadding?S=(h.height+P)/(O+E+h.horizontalPadding):S=(h.height+P)/h.width,P=d+h.verticalPadding;var x;return h.widthD&&E!=d){T.splice(-1,1),h.rows[d].push(u),h.rowWidth[E]=h.rowWidth[E]-D,h.rowWidth[d]=h.rowWidth[d]+D,h.width=h.rowWidth[instance.getLongestRowIndex(h)];for(var O=Number.MIN_VALUE,P=0;PO&&(O=T[P].height);E>0&&(O+=h.verticalPadding);var S=h.rowHeight[E]+h.rowHeight[d];h.rowHeight[E]=O,h.rowHeight[d]0)for(var j=u;j<=D;j++)F[0]+=this.grid[j][O-1].length+this.grid[j][O].length-1;if(D0)for(var j=O;j<=P;j++)F[3]+=this.grid[u-1][j].length+this.grid[u][j].length-1;for(var V=M.MAX_VALUE,w,U,X=0;X{var f=r(551).FDLayoutNode,e=r(551).IMath;function v(a,s,c,l){f.call(this,a,s,c,l)}v.prototype=Object.create(f.prototype);for(var i in f)v[i]=f[i];v.prototype.calculateDisplacement=function(){var a=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},v.prototype.propogateDisplacementToChildren=function(a,s){for(var c=this.getChild().getNodes(),l,L=0;L{function f(c){if(Array.isArray(c)){for(var l=0,L=Array(c.length);l0){var dt=0;it.forEach(function(ft){W=="horizontal"?(q.set(ft,p.has(ft)?y[p.get(ft)]:B.get(ft)),dt+=q.get(ft)):(q.set(ft,p.has(ft)?C[p.get(ft)]:B.get(ft)),dt+=q.get(ft))}),dt=dt/it.length,st.forEach(function(ft){z.has(ft)||q.set(ft,dt)})}else{var nt=0;st.forEach(function(ft){W=="horizontal"?nt+=p.has(ft)?y[p.get(ft)]:B.get(ft):nt+=p.has(ft)?C[p.get(ft)]:B.get(ft)}),nt=nt/st.length,st.forEach(function(ft){q.set(ft,nt)})}});for(var rt=function(){var it=ut.shift(),dt=H.get(it);dt.forEach(function(nt){if(q.get(nt.id)ft&&(ft=Wt),$tbt&&(bt=$t)}}catch(ee){Bt=!0,xt=ee}finally{try{!It&&Lt.return&&Lt.return()}finally{if(Bt)throw xt}}var pe=(dt+ft)/2-(nt+bt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Kt=st[Symbol.iterator](),le;!(Qt=(le=Kt.next()).done);Qt=!0){var te=le.value;q.set(te,q.get(te)+pe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Kt.return&&Kt.return()}finally{if(jt)throw _t}}})}return q},k=function(H){var W=0,z=0,B=0,K=0;if(H.forEach(function(lt){lt.left?y[p.get(lt.left)]-y[p.get(lt.right)]>=0?W++:z++:C[p.get(lt.top)]-C[p.get(lt.bottom)]>=0?B++:K++}),W>z&&B>K)for(var gt=0;gtz)for(var ct=0;ctK)for(var q=0;q1)l.fixedNodeConstraint.forEach(function(G,H){T[H]=[G.position.x,G.position.y],u[H]=[y[p.get(G.nodeId)],C[p.get(G.nodeId)]]}),D=!0;else if(l.alignmentConstraint)(function(){var G=0;if(l.alignmentConstraint.vertical){for(var H=l.alignmentConstraint.vertical,W=function(q){var lt=new Set;H[q].forEach(function(vt){lt.add(vt)});var ut=new Set([].concat(f(lt)).filter(function(vt){return P.has(vt)})),rt=void 0;ut.size>0?rt=y[p.get(ut.values().next().value)]:rt=et(lt).x,H[q].forEach(function(vt){T[G]=[rt,C[p.get(vt)]],u[G]=[y[p.get(vt)],C[p.get(vt)]],G++})},z=0;z0?rt=y[p.get(ut.values().next().value)]:rt=et(lt).y,B[q].forEach(function(vt){T[G]=[y[p.get(vt)],rt],u[G]=[y[p.get(vt)],C[p.get(vt)]],G++})},gt=0;gt_&&(_=$[j].length,F=j);if(_0){var Mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(G,H){var W={x:y[p.get(G.nodeId)],y:C[p.get(G.nodeId)]},z=G.position,B=Y(z,W);Mt.x+=B.x,Mt.y+=B.y}),Mt.x/=l.fixedNodeConstraint.length,Mt.y/=l.fixedNodeConstraint.length,y.forEach(function(G,H){y[H]+=Mt.x}),C.forEach(function(G,H){C[H]+=Mt.y}),l.fixedNodeConstraint.forEach(function(G){y[p.get(G.nodeId)]=G.position.x,C[p.get(G.nodeId)]=G.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Tt=l.alignmentConstraint.vertical,Nt=function(H){var W=new Set;Tt[H].forEach(function(K){W.add(K)});var z=new Set([].concat(f(W)).filter(function(K){return P.has(K)})),B=void 0;z.size>0?B=y[p.get(z.values().next().value)]:B=et(W).x,W.forEach(function(K){P.has(K)||(y[p.get(K)]=B)})},Dt=0;Dt0?B=C[p.get(z.values().next().value)]:B=et(W).y,W.forEach(function(K){P.has(K)||(C[p.get(K)]=B)})},Gt=0;Gt{n.exports=m}},N={};function g(n){var t=N[n];if(t!==void 0)return t.exports;var r=N[n]={exports:{}};return A[n](r,r.exports,g),r.exports}var o=g(45);return o})()})});var Ke=Ne((se,De)=>{(function(A,N){typeof se=="object"&&typeof De=="object"?De.exports=N(Oe()):typeof define=="function"&&define.amd?define(["cose-base"],N):typeof se=="object"?se.cytoscapeFcose=N(Oe()):A.cytoscapeFcose=N(A.coseBase)})(se,function(m){return(()=>{"use strict";var A={658:n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(t){for(var r=arguments.length,f=Array(r>1?r-1:0),e=1;e{var f=function(){function i(a,s){var c=[],l=!0,L=!1,p=void 0;try{for(var y=a[Symbol.iterator](),C;!(l=(C=y.next()).done)&&(c.push(C.value),!(s&&c.length===s));l=!0);}catch(R){L=!0,p=R}finally{try{!l&&y.return&&y.return()}finally{if(L)throw p}}return c}return function(a,s){if(Array.isArray(a))return a;if(Symbol.iterator in Object(a))return i(a,s);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=r(140).layoutBase.LinkedList,v={};v.getTopMostNodes=function(i){for(var a={},s=0;s0&&D.merge(x)});for(var O=0;O1){C=p[0],R=C.connectedEdges().length,p.forEach(function(u){u.connectedEdges().length0&&c.set("dummy"+(c.size+1),Z),Y},v.relocateComponent=function(i,a,s){if(!s.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;if(s.quality=="draft"){var y=!0,C=!1,R=void 0;try{for(var M=a.nodeIndexes[Symbol.iterator](),b;!(y=(b=M.next()).done);y=!0){var Z=b.value,Y=f(Z,2),et=Y[0],I=Y[1],k=s.cy.getElementById(et);if(k){var h=k.boundingBox(),E=a.xCoords[I]-h.w/2,d=a.xCoords[I]+h.w/2,T=a.yCoords[I]-h.h/2,u=a.yCoords[I]+h.h/2;El&&(l=d),Tp&&(p=u)}}}catch(x){C=!0,R=x}finally{try{!y&&M.return&&M.return()}finally{if(C)throw R}}var D=i.x-(l+c)/2,O=i.y-(p+L)/2;a.xCoords=a.xCoords.map(function(x){return x+D}),a.yCoords=a.yCoords.map(function(x){return x+O})}else{Object.keys(a).forEach(function(x){var $=a[x],_=$.getRect().x,F=$.getRect().x+$.getRect().width,j=$.getRect().y,V=$.getRect().y+$.getRect().height;_l&&(l=F),jp&&(p=V)});var P=i.x-(l+c)/2,S=i.y-(p+L)/2;Object.keys(a).forEach(function(x){var $=a[x];$.setCenter($.getCenterX()+P,$.getCenterY()+S)})}}},v.calcBoundingBox=function(i,a,s,c){for(var l=Number.MAX_SAFE_INTEGER,L=Number.MIN_SAFE_INTEGER,p=Number.MAX_SAFE_INTEGER,y=Number.MIN_SAFE_INTEGER,C=void 0,R=void 0,M=void 0,b=void 0,Z=i.descendants().not(":parent"),Y=Z.length,et=0;etC&&(l=C),LM&&(p=M),y{var f=r(548),e=r(140).CoSELayout,v=r(140).CoSENode,i=r(140).layoutBase.PointD,a=r(140).layoutBase.DimensionD,s=r(140).layoutBase.LayoutConstants,c=r(140).layoutBase.FDLayoutConstants,l=r(140).CoSEConstants,L=function(y,C){var R=y.cy,M=y.eles,b=M.nodes(),Z=M.edges(),Y=void 0,et=void 0,I=void 0,k={};y.randomize&&(Y=C.nodeIndexes,et=C.xCoords,I=C.yCoords);var h=function(x){return typeof x=="function"},E=function(x,$){return h(x)?x($):x},d=f.calcParentsWithoutChildren(R,M),T=function S(x,$,_,F){for(var j=$.length,V=0;V0){var Ct=void 0;Ct=_.getGraphManager().add(_.newGraph(),X),S(Ct,U,_,F)}}},u=function(x,$,_){for(var F=0,j=0,V=0;V<_.length;V++){var w=_[V],U=k[w.data("source")],X=k[w.data("target")];if(U&&X&&U!==X&&U.getEdgesBetween(X).length==0){var Q=$.add(x.newEdge(),U,X);Q.id=w.id(),Q.idealLength=E(y.idealEdgeLength,w),Q.edgeElasticity=E(y.edgeElasticity,w),F+=Q.idealLength,j++}}y.idealEdgeLength!=null&&(j>0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=F/j:h(y.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=y.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},D=function(x,$){$.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=$.fixedNodeConstraint),$.alignmentConstraint&&(x.constraints.alignmentConstraint=$.alignmentConstraint),$.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=$.relativePlacementConstraint)};y.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.nestingFactor),y.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=y.gravity),y.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=y.numIter),y.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=y.gravityRange),y.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.gravityCompound),y.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.gravityRangeCompound),y.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.initialEnergyOnIncremental),y.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=y.tilingCompareBy),y.quality=="proof"?s.QUALITY=2:s.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=s.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!y.randomize,l.ANIMATE=c.ANIMATE=s.ANIMATE=y.animate,l.TILE=y.tile,l.TILING_PADDING_VERTICAL=typeof y.tilingPaddingVertical=="function"?y.tilingPaddingVertical.call():y.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof y.tilingPaddingHorizontal=="function"?y.tilingPaddingHorizontal.call():y.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!y.randomize,s.DEFAULT_UNIFORM_LEAF_NODE_SIZES=y.uniformNodeDimensions,y.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),y.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),y.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),y.step=="all"&&(y.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),y.fixedNodeConstraint||y.alignmentConstraint||y.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,P=O.newGraphManager();return T(P.addRoot(),f.getTopMostNodes(b),O,y),u(O,P,Z),D(O,y),O.runLayout(),k};n.exports={coseLayout:L}},212:(n,t,r)=>{var f=function(){function y(C,R){for(var M=0;M0)if(u){var P=i.getTopMostNodes(M.eles.nodes());if(h=i.connectComponents(b,M.eles,P),h.forEach(function(ot){var tt=ot.boundingBox();E.push({x:tt.x1+tt.w/2,y:tt.y1+tt.h/2})}),M.randomize&&h.forEach(function(ot){M.eles=ot,Y.push(s(M))}),M.quality=="default"||M.quality=="proof"){var S=b.collection();if(M.tile){var x=new Map,$=[],_=[],F=0,j={nodeIndexes:x,xCoords:$,yCoords:_},V=[];if(h.forEach(function(ot,tt){ot.edges().length==0&&(ot.nodes().forEach(function(yt,mt){S.merge(ot.nodes()[mt]),yt.isParent()||(j.nodeIndexes.set(ot.nodes()[mt].id(),F++),j.xCoords.push(ot.nodes()[0].position().x),j.yCoords.push(ot.nodes()[0].position().y))}),V.push(tt))}),S.length>1){var w=S.boundingBox();E.push({x:w.x1+w.w/2,y:w.y1+w.h/2}),h.push(S),Y.push(j);for(var U=V.length-1;U>=0;U--)h.splice(V[U],1),Y.splice(V[U],1),E.splice(V[U],1)}}h.forEach(function(ot,tt){M.eles=ot,k.push(l(M,Y[tt])),i.relocateComponent(E[tt],k[tt],M)})}else h.forEach(function(ot,tt){i.relocateComponent(E[tt],Y[tt],M)});var X=new Set;if(h.length>1){var Q=[],ht=Z.filter(function(ot){return ot.css("display")=="none"});h.forEach(function(ot,tt){var yt=void 0;if(M.quality=="draft"&&(yt=Y[tt].nodeIndexes),ot.nodes().not(ht).length>0){var mt={};mt.edges=[],mt.nodes=[];var Mt=void 0;ot.nodes().not(ht).forEach(function(Tt){if(M.quality=="draft")if(!Tt.isParent())Mt=yt.get(Tt.id()),mt.nodes.push({x:Y[tt].xCoords[Mt]-Tt.boundingbox().w/2,y:Y[tt].yCoords[Mt]-Tt.boundingbox().h/2,width:Tt.boundingbox().w,height:Tt.boundingbox().h});else{var Nt=i.calcBoundingBox(Tt,Y[tt].xCoords,Y[tt].yCoords,yt);mt.nodes.push({x:Nt.topLeftX,y:Nt.topLeftY,width:Nt.width,height:Nt.height})}else k[tt][Tt.id()]&&mt.nodes.push({x:k[tt][Tt.id()].getLeft(),y:k[tt][Tt.id()].getTop(),width:k[tt][Tt.id()].getWidth(),height:k[tt][Tt.id()].getHeight()})}),ot.edges().forEach(function(Tt){var Nt=Tt.source(),Dt=Tt.target();if(Nt.css("display")!="none"&&Dt.css("display")!="none")if(M.quality=="draft"){var Rt=yt.get(Nt.id()),zt=yt.get(Dt.id()),Gt=[],Ht=[];if(Nt.isParent()){var Pt=i.calcBoundingBox(Nt,Y[tt].xCoords,Y[tt].yCoords,yt);Gt.push(Pt.topLeftX+Pt.width/2),Gt.push(Pt.topLeftY+Pt.height/2)}else Gt.push(Y[tt].xCoords[Rt]),Gt.push(Y[tt].yCoords[Rt]);if(Dt.isParent()){var G=i.calcBoundingBox(Dt,Y[tt].xCoords,Y[tt].yCoords,yt);Ht.push(G.topLeftX+G.width/2),Ht.push(G.topLeftY+G.height/2)}else Ht.push(Y[tt].xCoords[zt]),Ht.push(Y[tt].yCoords[zt]);mt.edges.push({startX:Gt[0],startY:Gt[1],endX:Ht[0],endY:Ht[1]})}else k[tt][Nt.id()]&&k[tt][Dt.id()]&&mt.edges.push({startX:k[tt][Nt.id()].getCenterX(),startY:k[tt][Nt.id()].getCenterY(),endX:k[tt][Dt.id()].getCenterX(),endY:k[tt][Dt.id()].getCenterY()})}),mt.nodes.length>0&&(Q.push(mt),X.add(tt))}});var Ct=T.packComponents(Q,M.randomize).shifts;if(M.quality=="draft")Y.forEach(function(ot,tt){var yt=ot.xCoords.map(function(Mt){return Mt+Ct[tt].dx}),mt=ot.yCoords.map(function(Mt){return Mt+Ct[tt].dy});ot.xCoords=yt,ot.yCoords=mt});else{var Ft=0;X.forEach(function(ot){Object.keys(k[ot]).forEach(function(tt){var yt=k[ot][tt];yt.setCenter(yt.getCenterX()+Ct[Ft].dx,yt.getCenterY()+Ct[Ft].dy)}),Ft++})}}}else{var D=M.eles.boundingBox();if(E.push({x:D.x1+D.w/2,y:D.y1+D.h/2}),M.randomize){var O=s(M);Y.push(O)}M.quality=="default"||M.quality=="proof"?(k.push(l(M,Y[0])),i.relocateComponent(E[0],k[0],M)):i.relocateComponent(E[0],Y[0],M)}var J=function(tt,yt){if(M.quality=="default"||M.quality=="proof"){typeof tt=="number"&&(tt=yt);var mt=void 0,Mt=void 0,Tt=tt.data("id");return k.forEach(function(Dt){Tt in Dt&&(mt={x:Dt[Tt].getRect().getCenterX(),y:Dt[Tt].getRect().getCenterY()},Mt=Dt[Tt])}),M.nodeDimensionsIncludeLabels&&(Mt.labelWidth&&(Mt.labelPosHorizontal=="left"?mt.x+=Mt.labelWidth/2:Mt.labelPosHorizontal=="right"&&(mt.x-=Mt.labelWidth/2)),Mt.labelHeight&&(Mt.labelPosVertical=="top"?mt.y+=Mt.labelHeight/2:Mt.labelPosVertical=="bottom"&&(mt.y-=Mt.labelHeight/2))),mt==null&&(mt={x:tt.position("x"),y:tt.position("y")}),{x:mt.x,y:mt.y}}else{var Nt=void 0;return Y.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(tt.id());Rt!=null&&(Nt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),Nt==null&&(Nt={x:tt.position("x"),y:tt.position("y")}),{x:Nt.x,y:Nt.y}}};if(M.quality=="default"||M.quality=="proof"||M.randomize){var Xt=i.calcParentsWithoutChildren(b,Z),Ot=Z.filter(function(ot){return ot.css("display")=="none"});M.eles=Z.not(Ot),Z.nodes().not(":parent").not(Ot).layoutPositions(R,M,J),Xt.length>0&&Xt.forEach(function(ot){ot.position(J(ot))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),y}();n.exports=p},657:(n,t,r)=>{var f=r(548),e=r(140).layoutBase.Matrix,v=r(140).layoutBase.SVD,i=function(s){var c=s.cy,l=s.eles,L=l.nodes(),p=l.nodes(":parent"),y=new Map,C=new Map,R=new Map,M=[],b=[],Z=[],Y=[],et=[],I=[],k=[],h=[],E=void 0,d=void 0,T=1e8,u=1e-9,D=s.piTol,O=s.samplingType,P=s.nodeSeparation,S=void 0,x=function(){for(var W=0,z=0,B=!1;z=gt;){q=K[gt++];for(var st=M[q],it=0;itrt&&(rt=et[nt],vt=nt)}return vt},_=function(W){var z=void 0;if(W){z=Math.floor(Math.random()*d),E=z;for(var K=0;K=1)break;rt=ut}for(var st=0;st=1)break;rt=ut}for(var dt=0;dt0&&(z.isParent()?M[W].push(R.get(z.id())):M[W].push(z.id()))})});var Xt=function(W){var z=C.get(W),B=void 0;y.get(W).forEach(function(K){c.getElementById(K).isParent()?B=R.get(K):B=K,M[z].push(B),M[C.get(B)].push(W)})},Ot=!0,ot=!1,tt=void 0;try{for(var yt=y.keys()[Symbol.iterator](),mt;!(Ot=(mt=yt.next()).done);Ot=!0){var Mt=mt.value;Xt(Mt)}}catch(H){ot=!0,tt=H}finally{try{!Ot&&yt.return&&yt.return()}finally{if(ot)throw tt}}d=C.size;var Tt=void 0;if(d>2){S=d{var f=r(212),e=function(i){i&&i("layout","fcose",f)};typeof cytoscape!="undefined"&&e(cytoscape),n.exports=e},140:n=>{n.exports=m}},N={};function g(n){var t=N[n];if(t!==void 0)return t.exports;var r=N[n]={exports:{}};return A[n](r,r.exports,g),r.exports}var o=g(579);return o})()})});var ar=dr(Ke(),1);var je={L:"left",R:"right",T:"top",B:"bottom"},_e={L:at(m=>`${m},${m/2} 0,${m} 0,0`,"L"),R:at(m=>`0,${m/2} ${m},0 ${m},${m}`,"R"),T:at(m=>`0,0 ${m},0 ${m/2},${m}`,"T"),B:at(m=>`${m/2},0 ${m},${m} 0,${m}`,"B")},de={L:at((m,A)=>m-A+2,"L"),R:at((m,A)=>m-2,"R"),T:at((m,A)=>m-A+2,"T"),B:at((m,A)=>m-2,"B")},vr=at(function(m){return Vt(m)?m==="L"?"R":"L":m==="T"?"B":"T"},"getOppositeArchitectureDirection"),tr=at(function(m){let A=m;return A==="L"||A==="R"||A==="T"||A==="B"},"isArchitectureDirection"),Vt=at(function(m){let A=m;return A==="L"||A==="R"},"isArchitectureDirectionX"),Jt=at(function(m){let A=m;return A==="T"||A==="B"},"isArchitectureDirectionY"),er=at(function(m,A){let N=Vt(m)&&Jt(A),g=Jt(m)&&Vt(A);return N||g},"isArchitectureDirectionXY"),pr=at(function(m){let A=m[0],N=m[1],g=Vt(A)&&Jt(N),o=Jt(A)&&Vt(N);return g||o},"isArchitecturePairXY"),yr=at(function(m){return m!=="LL"&&m!=="RR"&&m!=="TT"&&m!=="BB"},"isValidArchitectureDirectionPair"),xe=at(function(m,A){let N=`${m}${A}`;return yr(N)?N:void 0},"getArchitectureDirectionPair"),Er=at(function([m,A],N){let g=N[0],o=N[1];return Vt(g)?Jt(o)?[m+(g==="L"?-1:1),A+(o==="T"?1:-1)]:[m+(g==="L"?-1:1),A]:Vt(o)?[m+(o==="L"?1:-1),A+(g==="T"?1:-1)]:[m,A+(g==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),mr=at(function(m){return m==="LT"||m==="TL"?[1,1]:m==="BL"||m==="LB"?[1,-1]:m==="BR"||m==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Tr=at(function(m){return m.type==="service"},"isArchitectureService"),Nr=at(function(m){return m.type==="junction"},"isArchitectureJunction"),rr=at(m=>m.data(),"edgeData"),ie=at(m=>m.data(),"nodeData"),ir=Pe.architecture,pt=new Je(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:ir,dataStructures:void 0,elements:{}})),Lr=at(()=>{pt.reset(),Ue()},"clear"),Cr=at(function({id:m,icon:A,in:N,title:g,iconText:o}){if(pt.records.registeredIds[m]!==void 0)throw new Error(`The service id [${m}] is already in use by another ${pt.records.registeredIds[m]}`);if(N!==void 0){if(m===N)throw new Error(`The service [${m}] cannot be placed within itself`);if(pt.records.registeredIds[N]===void 0)throw new Error(`The service [${m}]'s parent does not exist. Please make sure the parent is created before this service`);if(pt.records.registeredIds[N]==="node")throw new Error(`The service [${m}]'s parent is not a group`)}pt.records.registeredIds[m]="node",pt.records.nodes[m]={id:m,type:"service",icon:A,iconText:o,title:g,edges:[],in:N}},"addService"),Mr=at(()=>Object.values(pt.records.nodes).filter(Tr),"getServices"),Ar=at(function({id:m,in:A}){pt.records.registeredIds[m]="node",pt.records.nodes[m]={id:m,type:"junction",edges:[],in:A}},"addJunction"),wr=at(()=>Object.values(pt.records.nodes).filter(Nr),"getJunctions"),Or=at(()=>Object.values(pt.records.nodes),"getNodes"),Dr=at(m=>pt.records.nodes[m],"getNode"),xr=at(function({id:m,icon:A,in:N,title:g}){if(pt.records.registeredIds[m]!==void 0)throw new Error(`The group id [${m}] is already in use by another ${pt.records.registeredIds[m]}`);if(N!==void 0){if(m===N)throw new Error(`The group [${m}] cannot be placed within itself`);if(pt.records.registeredIds[N]===void 0)throw new Error(`The group [${m}]'s parent does not exist. Please make sure the parent is created before this group`);if(pt.records.registeredIds[N]==="node")throw new Error(`The group [${m}]'s parent is not a group`)}pt.records.registeredIds[m]="group",pt.records.groups[m]={id:m,icon:A,title:g,in:N}},"addGroup"),Ir=at(()=>Object.values(pt.records.groups),"getGroups"),Rr=at(function({lhsId:m,rhsId:A,lhsDir:N,rhsDir:g,lhsInto:o,rhsInto:n,lhsGroup:t,rhsGroup:r,title:f}){if(!tr(N))throw new Error(`Invalid direction given for left hand side of edge ${m}--${A}. Expected (L,R,T,B) got ${N}`);if(!tr(g))throw new Error(`Invalid direction given for right hand side of edge ${m}--${A}. Expected (L,R,T,B) got ${g}`);if(pt.records.nodes[m]===void 0&&pt.records.groups[m]===void 0)throw new Error(`The left-hand id [${m}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(pt.records.nodes[A]===void 0&&pt.records.groups[m]===void 0)throw new Error(`The right-hand id [${A}] does not yet exist. Please create the service/group before declaring an edge to it.`);let e=pt.records.nodes[m].in,v=pt.records.nodes[A].in;if(t&&e&&v&&e==v)throw new Error(`The left-hand id [${m}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&e&&v&&e==v)throw new Error(`The right-hand id [${A}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:m,lhsDir:N,lhsInto:o,lhsGroup:t,rhsId:A,rhsDir:g,rhsInto:n,rhsGroup:r,title:f};pt.records.edges.push(i),pt.records.nodes[m]&&pt.records.nodes[A]&&(pt.records.nodes[m].edges.push(pt.records.edges[pt.records.edges.length-1]),pt.records.nodes[A].edges.push(pt.records.edges[pt.records.edges.length-1]))},"addEdge"),Sr=at(()=>pt.records.edges,"getEdges"),Fr=at(()=>{if(pt.records.dataStructures===void 0){let m=Object.entries(pt.records.nodes).reduce((t,[r,f])=>(t[r]=f.edges.reduce((e,v)=>{if(v.lhsId===r){let i=xe(v.lhsDir,v.rhsDir);i&&(e[i]=v.rhsId)}else{let i=xe(v.rhsDir,v.lhsDir);i&&(e[i]=v.lhsId)}return e},{}),t),{}),A=Object.keys(m)[0],N={[A]:1},g=Object.keys(m).reduce((t,r)=>r===A?t:ce(fe({},t),{[r]:1}),{}),o=at(t=>{let r={[t]:[0,0]},f=[t];for(;f.length>0;){let e=f.shift();if(e){N[e]=1,delete g[e];let v=m[e],[i,a]=r[e];Object.entries(v).forEach(([s,c])=>{N[c]||(r[c]=Er([i,a],s),f.push(c))})}}return r},"BFS"),n=[o(A)];for(;Object.keys(g).length>0;)n.push(o(Object.keys(g)[0]));pt.records.dataStructures={adjList:m,spatialMaps:n}}return pt.records.dataStructures},"getDataStructures"),br=at((m,A)=>{pt.records.elements[m]=A},"setElementForId"),Pr=at(m=>pt.records.elements[m],"getElementById"),ve={clear:Lr,setDiagramTitle:Ve,getDiagramTitle:ze,setAccTitle:Ye,getAccTitle:Xe,setAccDescription:He,getAccDescription:We,addService:Cr,getServices:Mr,addJunction:Ar,getJunctions:wr,getNodes:Or,getNode:Dr,addGroup:xr,getGroups:Ir,addEdge:Rr,getEdges:Sr,setElementForId:br,getElementById:Pr,getDataStructures:Fr};function Ut(m){let A=ae().architecture;return A!=null&&A[m]?A[m]:ir[m]}at(Ut,"getConfigField");var Gr=at((m,A)=>{qe(m,A),m.groups.map(A.addGroup),m.services.map(N=>A.addService(ce(fe({},N),{type:"service"}))),m.junctions.map(N=>A.addJunction(ce(fe({},N),{type:"junction"}))),m.edges.map(A.addEdge)},"populateDb"),Ur={parse:at(async m=>{let A=await Qe("architecture",m);Le.debug(A),Gr(A,ve)},"parse")},Yr=at(m=>` .edge { stroke-width: ${m.archEdgeWidth}; stroke: ${m.archEdgeColor}; fill: none; } .arrow { fill: ${m.archEdgeArrowColor}; } .node-bkg { fill: none; stroke: ${m.archGroupBorderColor}; stroke-width: ${m.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"),Xr=Yr,re=at(m=>`${m}`,"wrapIcon"),he={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('')},server:{body:re('')},disk:{body:re('')},internet:{body:re('')},cloud:{body:re('')},unknown:Be,blank:{body:re("")}}},Hr=at(async function(m,A){let N=Ut("padding"),g=Ut("iconSize"),o=g/2,n=g/6,t=n/2;await Promise.all(A.edges().map(async r=>{var Y,et;let{source:f,sourceDir:e,sourceArrow:v,sourceGroup:i,target:a,targetDir:s,targetArrow:c,targetGroup:l,label:L}=rr(r),{x:p,y}=r[0].sourceEndpoint(),{x:C,y:R}=r[0].midpoint(),{x:M,y:b}=r[0].targetEndpoint(),Z=N+4;if(i&&(Vt(e)?p+=e==="L"?-Z:Z:y+=e==="T"?-Z:Z+18),l&&(Vt(s)?M+=s==="L"?-Z:Z:b+=s==="T"?-Z:Z+18),!i&&((Y=ve.getNode(f))==null?void 0:Y.type)==="junction"&&(Vt(e)?p+=e==="L"?o:-o:y+=e==="T"?o:-o),!l&&((et=ve.getNode(a))==null?void 0:et.type)==="junction"&&(Vt(s)?M+=s==="L"?o:-o:b+=s==="T"?o:-o),r[0]._private.rscratch){let I=m.insert("g");if(I.insert("path").attr("d",`M ${p},${y} L ${C},${R} L${M},${b} `).attr("class","edge"),v){let k=Vt(e)?de[e](p,n):p-t,h=Jt(e)?de[e](y,n):y-t;I.insert("polygon").attr("points",_e[e](n)).attr("transform",`translate(${k},${h})`).attr("class","arrow")}if(c){let k=Vt(s)?de[s](M,n):M-t,h=Jt(s)?de[s](b,n):b-t;I.insert("polygon").attr("points",_e[s](n)).attr("transform",`translate(${k},${h})`).attr("class","arrow")}if(L){let k=er(e,s)?"XY":Vt(e)?"X":"Y",h=0;k==="X"?h=Math.abs(p-M):k==="Y"?h=Math.abs(y-b)/1.5:h=Math.abs(p-M)/2;let E=I.append("g");if(await ge(E,L,{useHtmlLabels:!1,width:h,classes:"architecture-service-label"},ae()),E.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),k==="X")E.attr("transform","translate("+C+", "+R+")");else if(k==="Y")E.attr("transform","translate("+C+", "+R+") rotate(-90)");else if(k==="XY"){let d=xe(e,s);if(d&&pr(d)){let T=E.node().getBoundingClientRect(),[u,D]=mr(d);E.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*u*D*45})`);let O=E.node().getBoundingClientRect();E.attr("transform",` translate(${C}, ${R-T.height/2}) translate(${u*O.width/2}, ${D*O.height/2}) rotate(${-1*u*D*45}, 0, ${T.height/2}) `)}}}}}))},"drawEdges"),Wr=at(async function(m,A){let g=Ut("padding")*.75,o=Ut("fontSize"),t=Ut("iconSize")/2;await Promise.all(A.nodes().map(async r=>{let f=ie(r);if(f.type==="group"){let{h:e,w:v,x1:i,y1:a}=r.boundingBox();m.append("rect").attr("x",i+t).attr("y",a+t).attr("width",v).attr("height",e).attr("class","node-bkg");let s=m.append("g"),c=i,l=a;if(f.icon){let L=s.append("g");L.html(`${await ue(f.icon,{height:g,width:g,fallbackPrefix:he.prefix})}`),L.attr("transform","translate("+(c+t+1)+", "+(l+t+1)+")"),c+=g,l+=o/2-1-2}if(f.label){let L=s.append("g");await ge(L,f.label,{useHtmlLabels:!1,width:v,classes:"architecture-service-label"},ae()),L.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),L.attr("transform","translate("+(c+t+4)+", "+(l+t+2)+")")}}}))},"drawGroups"),Vr=at(async function(m,A,N){var g;for(let o of N){let n=A.append("g"),t=Ut("iconSize");if(o.title){let v=n.append("g");await ge(v,o.title,{useHtmlLabels:!1,width:t*1.5,classes:"architecture-service-label"},ae()),v.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),v.attr("transform","translate("+t/2+", "+t+")")}let r=n.append("g");if(o.icon)r.html(`${await ue(o.icon,{height:t,width:t,fallbackPrefix:he.prefix})}`);else if(o.iconText){r.html(`${await ue("blank",{height:t,width:t,fallbackPrefix:he.prefix})}`);let a=r.append("g").append("foreignObject").attr("width",t).attr("height",t).append("div").attr("class","node-icon-text").attr("style",`height: ${t}px;`).append("div").html(o.iconText),s=(g=parseInt(window.getComputedStyle(a.node(),null).getPropertyValue("font-size").replace(/\D/g,"")))!=null?g:16;a.attr("style",`-webkit-line-clamp: ${Math.floor((t-2)/s)};`)}else r.append("path").attr("class","node-bkg").attr("id","node-"+o.id).attr("d",`M0 ${t} v${-t} q0,-5 5,-5 h${t} q5,0 5,5 v${t} H0 Z`);n.attr("class","architecture-service");let{width:f,height:e}=n._groups[0][0].getBBox();o.width=f,o.height=e,m.setElementForId(o.id,n)}return 0},"drawServices"),zr=at(function(m,A,N){N.forEach(g=>{let o=A.append("g"),n=Ut("iconSize");o.append("g").append("rect").attr("id","node-"+g.id).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:r,height:f}=o._groups[0][0].getBBox();o.width=r,o.height=f,m.setElementForId(g.id,o)})},"drawJunctions");$e([{name:he.prefix,icons:he}]);Ce.use(ar.default);function nr(m,A){m.forEach(N=>{A.add({group:"nodes",data:{type:"service",id:N.id,icon:N.icon,label:N.title,parent:N.in,width:Ut("iconSize"),height:Ut("iconSize")},classes:"node-service"})})}at(nr,"addServices");function or(m,A){m.forEach(N=>{A.add({group:"nodes",data:{type:"junction",id:N.id,parent:N.in,width:Ut("iconSize"),height:Ut("iconSize")},classes:"node-junction"})})}at(or,"addJunctions");function sr(m,A){A.nodes().map(N=>{let g=ie(N);if(g.type==="group")return;g.x=N.position().x,g.y=N.position().y,m.getElementById(g.id).attr("transform","translate("+(g.x||0)+","+(g.y||0)+")")})}at(sr,"positionNodes");function hr(m,A){m.forEach(N=>{A.add({group:"nodes",data:{type:"group",id:N.id,icon:N.icon,label:N.title,parent:N.in},classes:"node-group"})})}at(hr,"addGroups");function lr(m,A){m.forEach(N=>{let{lhsId:g,rhsId:o,lhsInto:n,lhsGroup:t,rhsInto:r,lhsDir:f,rhsDir:e,rhsGroup:v,title:i}=N,a=er(N.lhsDir,N.rhsDir)?"segments":"straight",s={id:`${g}-${o}`,label:i,source:g,sourceDir:f,sourceArrow:n,sourceGroup:t,sourceEndpoint:f==="L"?"0 50%":f==="R"?"100% 50%":f==="T"?"50% 0":"50% 100%",target:o,targetDir:e,targetArrow:r,targetGroup:v,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};A.add({group:"edges",data:s,classes:a})})}at(lr,"addEdges");function fr(m){let A=m.map(o=>{let n={},t={};return Object.entries(o).forEach(([r,[f,e]])=>{n[e]||(n[e]=[]),t[f]||(t[f]=[]),n[e].push(r),t[f].push(r)}),{horiz:Object.values(n).filter(r=>r.length>1),vert:Object.values(t).filter(r=>r.length>1)}}),[N,g]=A.reduce(([o,n],{horiz:t,vert:r})=>[[...o,...t],[...n,...r]],[[],[]]);return{horizontal:N,vertical:g}}at(fr,"getAlignments");function cr(m){let A=[],N=at(o=>`${o[0]},${o[1]}`,"posToStr"),g=at(o=>o.split(",").map(n=>parseInt(n)),"strToPos");return m.forEach(o=>{let n=Object.fromEntries(Object.entries(o).map(([e,v])=>[N(v),e])),t=[N([0,0])],r={},f={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;t.length>0;){let e=t.shift();if(e){r[e]=1;let v=n[e];if(v){let i=g(e);Object.entries(f).forEach(([a,s])=>{let c=N([i[0]+s[0],i[1]+s[1]]),l=n[c];l&&!r[c]&&(t.push(c),A.push({[je[a]]:l,[je[vr(a)]]:v,gap:1.5*Ut("iconSize")}))})}}}}),A}at(cr,"getRelativeConstraints");function ur(m,A,N,g,{spatialMaps:o}){return new Promise(n=>{let t=Ze("body").append("div").attr("id","cy").attr("style","display:none"),r=Ce({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":`${Ut("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:`${Ut("padding")}px`}}]});t.remove(),hr(N,r),nr(m,r),or(A,r),lr(g,r);let f=fr(o),e=cr(o),v=r.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(i){let[a,s]=i.connectedNodes(),{parent:c}=ie(a),{parent:l}=ie(s);return c===l?1.5*Ut("iconSize"):.5*Ut("iconSize")},edgeElasticity(i){let[a,s]=i.connectedNodes(),{parent:c}=ie(a),{parent:l}=ie(s);return c===l?.45:.001},alignmentConstraint:f,relativePlacementConstraint:e});v.one("layoutstop",()=>{var a;function i(s,c,l,L){let p,y,{x:C,y:R}=s,{x:M,y:b}=c;y=(L-R+(C-l)*(R-b)/(C-M))/Math.sqrt(1+Math.pow((R-b)/(C-M),2)),p=Math.sqrt(Math.pow(L-R,2)+Math.pow(l-C,2)-Math.pow(y,2));let Z=Math.sqrt(Math.pow(M-C,2)+Math.pow(b-R,2));p=p/Z;let Y=(M-C)*(L-R)-(b-R)*(l-C);switch(!0){case Y>=0:Y=1;break;case Y<0:Y=-1;break}let et=(M-C)*(l-C)+(b-R)*(L-R);switch(!0){case et>=0:et=1;break;case et<0:et=-1;break}return y=Math.abs(y)*Y,p=p*et,{distances:y,weights:p}}at(i,"getSegmentWeights"),r.startBatch();for(let s of Object.values(r.edges()))if((a=s.data)!=null&&a.call(s)){let{x:c,y:l}=s.source().position(),{x:L,y:p}=s.target().position();if(c!==L&&l!==p){let y=s.sourceEndpoint(),C=s.targetEndpoint(),{sourceDir:R}=rr(s),[M,b]=Jt(R)?[y.x,C.y]:[C.x,y.y],{weights:Z,distances:Y}=i(y,C,M,b);s.style("segment-distances",Y),s.style("segment-weights",Z)}}r.endBatch(),v.run()}),v.run(),r.ready(i=>{Le.info("Ready",i),n(r)})})}at(ur,"layoutArchitecture");var Br=at(async(m,A,N,g)=>{let o=g.db,n=o.getServices(),t=o.getJunctions(),r=o.getGroups(),f=o.getEdges(),e=o.getDataStructures(),v=ke(A),i=v.append("g");i.attr("class","architecture-edges");let a=v.append("g");a.attr("class","architecture-services");let s=v.append("g");s.attr("class","architecture-groups"),await Vr(o,a,n),zr(o,a,t);let c=await ur(n,t,r,f,e);await Hr(i,c),await Wr(s,c),sr(o,c),Ge(void 0,v,Ut("padding"),Ut("useMaxWidth"))},"draw"),$r={draw:Br},ri={parser:Ur,db:ve,renderer:$r,styles:Xr};export{ri as diagram};