import{a as Ne}from"./chunk-WMZJ2DJX.min.js";import{a as $e}from"./chunk-5IIW54K6.min.js";import{a as Ze}from"./chunk-EKP7MBOP.min.js";import{a as qe}from"./chunk-WXIN66R4.min.js";import{a as ke}from"./chunk-I4ZXTPQC.min.js";import"./chunk-33FU46FA.min.js";import"./chunk-OZ2RCKQJ.min.js";import"./chunk-PDS7545E.min.js";import"./chunk-IJ4BRSPX.min.js";import"./chunk-UEFJDIUO.min.js";import"./chunk-BIJFJY5F.min.js";import"./chunk-U4DUTLYF.min.js";import"./chunk-IQQ46AC6.min.js";import{a as Ve,b as ze,c as fe}from"./chunk-BD4P4Z7J.min.js";import{d as ce}from"./chunk-AUO2PXKS.min.js";import"./chunk-PYPO7LRM.min.js";import"./chunk-CM5D5KZN.min.js";import{P as be,S as Pe,T as Ge,U as Ue,V as Ye,W as Xe,X as He,Y as We,Z as ae,h as at,ia as Be,j as Te,v as Fe}from"./chunk-U3SD26FK.min.js";import"./chunk-CXRPJJJE.min.js";import{a as me,d as ur}from"./chunk-OSRY5VT3.min.js";var Ce=me((ne,Le)=>{(function(w,L){typeof ne=="object"&&typeof Le=="object"?Le.exports=L():typeof define=="function"&&define.amd?define([],L):typeof ne=="object"?ne.layoutBase=L():w.layoutBase=L()})(ne,function(){return function(m){var w={};function L(u){if(w[u])return w[u].exports;var o=w[u]={i:u,l:!1,exports:{}};return m[u].call(o.exports,o,o.exports,L),o.l=!0,o.exports}return L.m=m,L.c=w,L.i=function(u){return u},L.d=function(u,o,n){L.o(u,o)||Object.defineProperty(u,o,{configurable:!1,enumerable:!0,get:n})},L.n=function(u){var o=u&&u.__esModule?function(){return u.default}:function(){return u};return L.d(o,"a",o),o},L.o=function(u,o){return Object.prototype.hasOwnProperty.call(u,o)},L.p="",L(L.s=28)}([function(m,w,L){"use strict";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,m.exports=u},function(m,w,L){"use strict";var u=L(2),o=L(8),n=L(9);function t(f,e,v){u.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=f,this.target=e}t.prototype=Object.create(u.prototype);for(var a in u)t[a]=u[a];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,w,L){"use strict";function u(o){this.vGraphObject=o}m.exports=u},function(m,w,L){"use strict";var u=L(2),o=L(10),n=L(13),t=L(0),a=L(16),f=L(5);function e(i,r,h,c){h==null&&c==null&&(c=r),u.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,h!=null&&r!=null?this.rect=new n(r.x,r.y,h.width,h.height):this.rect=new n}e.prototype=Object.create(u.prototype);for(var v in u)e[v]=u[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,r){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=r.width,this.rect.height=r.height},e.prototype.setCenter=function(i,r){this.rect.x=i-this.rect.width/2,this.rect.y=r-this.rect.height/2},e.prototype.setLocation=function(i,r){this.rect.x=i,this.rect.y=r},e.prototype.moveBy=function(i,r){this.rect.x+=i,this.rect.y+=r},e.prototype.getEdgeListToNode=function(i){var r=[],h,c=this;return c.edges.forEach(function(l){if(l.target==i){if(l.source!=c)throw"Incorrect edge source!";r.push(l)}}),r},e.prototype.getEdgesBetween=function(i){var r=[],h,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)&&r.push(l)}),r},e.prototype.getNeighborsList=function(){var i=new Set,r=this;return r.edges.forEach(function(h){if(h.source==r)i.add(h.target);else{if(h.target!=r)throw"Incorrect incidency!";i.add(h.source)}}),i},e.prototype.withChildren=function(){var i=new Set,r,h;if(i.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;lr?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+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))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(i){var r=this.rect.x;r>t.WORLD_BOUNDARY?r=t.WORLD_BOUNDARY:r<-t.WORLD_BOUNDARY&&(r=-t.WORLD_BOUNDARY);var h=this.rect.y;h>t.WORLD_BOUNDARY?h=t.WORLD_BOUNDARY:h<-t.WORLD_BOUNDARY&&(h=-t.WORLD_BOUNDARY);var c=new f(r,h),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,w,L){"use strict";var u=L(0);function o(){}for(var n in u)o[n]=u[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,w,L){"use strict";function u(o,n){o==null&&n==null?(this.x=0,this.y=0):(this.x=o,this.y=n)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(o){this.x=o},u.prototype.setY=function(o){this.y=o},u.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},m.exports=u},function(m,w,L){"use strict";var u=L(2),o=L(10),n=L(0),t=L(7),a=L(3),f=L(1),e=L(13),v=L(12),i=L(11);function r(c,l,N){u.call(this,N),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)}r.prototype=Object.create(u.prototype);for(var h in u)r[h]=u[h];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(c,l,N){if(l==null&&N==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(N)>-1))throw"Source or target not in graph!";if(!(l.owner==N.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=N.owner?null:(y.source=l,y.target=N,y.isInterGraph=!1,this.getEdges().push(y),l.edges.push(y),N!=l&&N.edges.push(y),y)}},r.prototype.remove=function(c){var l=c;if(c instanceof a){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 N=l.edges.slice(),p,y=N.length,C=0;C-1&&P>-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(P,1);var F=p.source.owner.getEdges().indexOf(p);if(F==-1)throw"Not in owner's edge list!";p.source.owner.getEdges().splice(F,1)}},r.prototype.updateLeftTop=function(){for(var c=o.MAX_VALUE,l=o.MAX_VALUE,N,p,y,C=this.getNodes(),F=C.length,M=0;MN&&(c=N),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))},r.prototype.updateBounds=function(c){for(var l=o.MAX_VALUE,N=-o.MAX_VALUE,p=o.MAX_VALUE,y=-o.MAX_VALUE,C,F,M,P,V,Y=this.nodes,et=Y.length,I=0;IC&&(l=C),NM&&(p=M),yC&&(l=C),NM&&(p=M),y=this.nodes.length){var et=0;N.forEach(function(I){I.owner==c&&et++}),et==this.nodes.length&&(this.isConnected=!0)}},m.exports=r},function(m,w,L){"use strict";var u,o=L(1);function n(t){u=L(6),this.layout=t,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var t=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(t,a);return this.setRootGraph(f),this.rootGraph},n.prototype.add=function(t,a,f,e,v){if(f==null&&e==null&&v==null){if(t==null)throw"Graph is null!";if(a==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(a.child!=null)throw"Already has a child!";return t.parent=a,a.child=t,t}else{v=f,e=a,f=t;var i=e.getOwner(),r=v.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(r!=null&&r.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==r)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 u){var a=t;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,v=f.length,i=0;i=t.getRight()?a[0]+=Math.min(t.getX()-n.getX(),n.getRight()-t.getRight()):t.getX()<=n.getX()&&t.getRight()>=n.getRight()&&(a[0]+=Math.min(n.getX()-t.getX(),t.getRight()-n.getRight())),n.getY()<=t.getY()&&n.getBottom()>=t.getBottom()?a[1]+=Math.min(t.getY()-n.getY(),n.getBottom()-t.getBottom()):t.getY()<=n.getY()&&t.getBottom()>=n.getBottom()&&(a[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*a[0],r=a[1]/v;a[0]i)return a[0]=f,a[1]=h,a[2]=v,a[3]=Y,!1;if(ev)return a[0]=r,a[1]=e,a[2]=P,a[3]=i,!1;if(fv?(a[0]=l,a[1]=N,s=!0):(a[0]=c,a[1]=h,s=!0):g===d&&(f>v?(a[0]=r,a[1]=h,s=!0):(a[0]=p,a[1]=N,s=!0)),-T===d?v>f?(a[2]=V,a[3]=Y,E=!0):(a[2]=P,a[3]=M,E=!0):T===d&&(v>f?(a[2]=F,a[3]=M,E=!0):(a[2]=et,a[3]=Y,E=!0)),s&&E)return!1;if(f>v?e>i?(D=this.getCardinalDirection(g,d,4),O=this.getCardinalDirection(T,d,2)):(D=this.getCardinalDirection(-g,d,3),O=this.getCardinalDirection(-T,d,1)):e>i?(D=this.getCardinalDirection(-g,d,1),O=this.getCardinalDirection(-T,d,3)):(D=this.getCardinalDirection(g,d,2),O=this.getCardinalDirection(T,d,4)),!s)switch(D){case 1:R=h,b=f+-C/d,a[0]=b,a[1]=R;break;case 2:b=p,R=e+y*d,a[0]=b,a[1]=R;break;case 3:R=N,b=f+C/d,a[0]=b,a[1]=R;break;case 4:b=l,R=e+-y*d,a[0]=b,a[1]=R;break}if(!E)switch(O){case 1:Z=M,x=v+-k/d,a[2]=x,a[3]=Z;break;case 2:x=et,Z=i+I*d,a[2]=x,a[3]=Z;break;case 3:Z=Y,x=v+k/d,a[2]=x,a[3]=Z;break;case 4:x=V,Z=i+-I*d,a[2]=x,a[3]=Z;break}}return!1},o.getCardinalDirection=function(n,t,a){return n>t?a:1+a%4},o.getIntersection=function(n,t,a,f){if(f==null)return this.getIntersection2(n,t,a);var e=n.x,v=n.y,i=t.x,r=t.y,h=a.x,c=a.y,l=f.x,N=f.y,p=void 0,y=void 0,C=void 0,F=void 0,M=void 0,P=void 0,V=void 0,Y=void 0,et=void 0;return C=r-v,M=e-i,V=i*v-e*r,F=N-c,P=h-l,Y=l*c-h*N,et=C*P-F*M,et===0?null:(p=(M*Y-P*V)/et,y=(F*V-C*Y)/et,new u(p,y))},o.angleOfVector=function(n,t,a,f){var e=void 0;return n!==a?(e=Math.atan((f-t)/(a-n)),a=0){var N=(-h+Math.sqrt(h*h-4*r*c))/(2*r),p=(-h-Math.sqrt(h*h-4*r*c))/(2*r),y=null;return N>=0&&N<=1?[N]: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,w,L){"use strict";function u(){}u.sign=function(o){return o>0?1:o<0?-1:0},u.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},u.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},m.exports=u},function(m,w,L){"use strict";function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,m.exports=u},function(m,w,L){"use strict";var u=function(){function e(v,i){for(var r=0;r"u"?"undefined":u(n);return n==null||t!="object"&&t!="function"},m.exports=o},function(m,w,L){"use strict";function u(h){if(Array.isArray(h)){for(var c=0,l=Array(h.length);c0&&c;){for(C.push(M[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),y.add(P);for(var V=P.getEdges(),p=0;p-1&&M.splice(k,1)}y=new Set,F=new Map}}return h},r.prototype.createDummyNodesForBendpoints=function(h){for(var c=[],l=h.source,N=this.graphManager.calcLowestCommonAncestor(h.source,h.target),p=0;p0){for(var N=this.edgeToDummyNodes.get(l),p=0;p=0&&c.splice(Y,1);var et=F.getNeighborsList();et.forEach(function(s){if(l.indexOf(s)<0){var E=N.get(s),g=E-1;g==1&&P.push(s),N.set(s,g)}})}l=l.concat(P),(c.length==1||c.length==2)&&(p=!0,y=c[0])}return y},r.prototype.setGraphManager=function(h){this.graphManager=h},m.exports=r},function(m,w,L){"use strict";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)},m.exports=u},function(m,w,L){"use strict";var u=L(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,a=this.lworldExtX;return a!=0&&(t=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/a),t},o.prototype.transformY=function(n){var t=0,a=this.lworldExtY;return a!=0&&(t=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/a),t},o.prototype.inverseTransformX=function(n){var t=0,a=this.ldeviceExtX;return a!=0&&(t=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/a),t},o.prototype.inverseTransformY=function(n){var t=0,a=this.ldeviceExtY;return a!=0&&(t=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/a),t},o.prototype.inverseTransformPoint=function(n){var t=new u(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return t},m.exports=o},function(m,w,L){"use strict";function u(i){if(Array.isArray(i)){for(var r=0,h=Array(i.length);rn.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(),r,h=0;h0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h,c,l,N,p=this.getAllNodes(),y;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&i&&this.updateGrid(),y=new Set,h=0;hC||y>C)&&(i.gravitationForceX=-this.gravityConstant*l,i.gravitationForceY=-this.gravityConstant*N)):(C=r.getEstimatedSize()*this.compoundGravityRangeFactor,(p>C||y>C)&&(i.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant))},e.prototype.isConverged=function(){var i,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),i=this.totalDisplacement=p.length||C>=p[0].length)){for(var F=0;Fe}}]),a}();m.exports=t},function(m,w,L){"use strict";function u(){}u.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),a=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)),r=0;r=0;d--)if(this.s[d]!==0){for(var D=d+1;D=0;S--){if(function(xt,Lt){return xt&&Lt}(S0;){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=u.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=u},function(m,w,L){"use strict";var u=function(){function t(a,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=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=v,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var r=0;r=0;a--){var f=this.listeners[a];f.event===n&&f.callback===t&&this.listeners.splice(a,1)}},o.emit=function(n,t){for(var a=0;a{(function(w,L){typeof oe=="object"&&typeof Me=="object"?Me.exports=L(Ce()):typeof define=="function"&&define.amd?define(["layout-base"],L):typeof oe=="object"?oe.coseBase=L(Ce()):w.coseBase=L(w.layoutBase)})(oe,function(m){return(()=>{"use strict";var w={45:(n,t,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),n.exports=f},806:(n,t,a)=>{var f=a(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,a)=>{var f=a(551).FDLayoutEdge;function e(i,r,h){f.call(this,i,r,h)}e.prototype=Object.create(f.prototype);for(var v in f)e[v]=f[v];n.exports=e},880:(n,t,a)=>{var f=a(551).LGraph;function e(i,r,h){f.call(this,i,r,h)}e.prototype=Object.create(f.prototype);for(var v in f)e[v]=f[v];n.exports=e},578:(n,t,a)=>{var f=a(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,a)=>{var f=a(551).FDLayout,e=a(578),v=a(880),i=a(991),r=a(767),h=a(806),c=a(902),l=a(551).FDLayoutConstants,N=a(551).LayoutConstants,p=a(551).Point,y=a(551).PointD,C=a(551).DimensionD,F=a(551).Layout,M=a(551).Integer,P=a(551).IGeometry,V=a(551).LGraph,Y=a(551).Transform,et=a(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 s=new e(this);return this.graphManager=s,s},I.prototype.newGraph=function(s){return new v(null,this.graphManager,s)},I.prototype.newNode=function(s){return new i(this.graphManager,s)},I.prototype.newEdge=function(s){return new r(null,null,s)},I.prototype.initParameters=function(){f.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=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 s=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(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(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),g=this.nodesWithGravity.filter(function(D){return E.has(D)});this.graphManager.setAllNodesToApplyGravitation(g)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),g=this.nodesWithGravity.filter(function(T){return E.has(T)});this.graphManager.setAllNodesToApplyGravitation(g),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.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 s=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(d){return s.has(d)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),h.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()),h.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 g=!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(g,T),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},I.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),E={},g=0;g0&&this.updateDisplacements();for(var g=0;g0&&(T.fixedNodeWeight=D)}}if(this.constraints.relativePlacementConstraint){var O=new Map,b=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(A){s.fixedNodesOnHorizontal.add(A),s.fixedNodesOnVertical.add(A)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var R=this.constraints.alignmentConstraint.vertical,g=0;g=2*A.length/3;Q--)U=Math.floor(Math.random()*(Q+1)),X=A[Q],A[Q]=A[U],A[U]=X;return A},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(A){if(A.left){var U=O.has(A.left)?O.get(A.left):A.left,X=O.has(A.right)?O.get(A.right):A.right;s.nodesInRelativeHorizontal.includes(U)||(s.nodesInRelativeHorizontal.push(U),s.nodeToRelativeConstraintMapHorizontal.set(U,[]),s.dummyToNodeForVerticalAlignment.has(U)?s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(U)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(U).getCenterX())),s.nodesInRelativeHorizontal.includes(X)||(s.nodesInRelativeHorizontal.push(X),s.nodeToRelativeConstraintMapHorizontal.set(X,[]),s.dummyToNodeForVerticalAlignment.has(X)?s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(X).getCenterX())),s.nodeToRelativeConstraintMapHorizontal.get(U).push({right:X,gap:A.gap}),s.nodeToRelativeConstraintMapHorizontal.get(X).push({left:U,gap:A.gap})}else{var Q=b.has(A.top)?b.get(A.top):A.top,ht=b.has(A.bottom)?b.get(A.bottom):A.bottom;s.nodesInRelativeVertical.includes(Q)||(s.nodesInRelativeVertical.push(Q),s.nodeToRelativeConstraintMapVertical.set(Q,[]),s.dummyToNodeForHorizontalAlignment.has(Q)?s.nodeToTempPositionMapVertical.set(Q,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(Q)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(Q,s.idToNodeMap.get(Q).getCenterY())),s.nodesInRelativeVertical.includes(ht)||(s.nodesInRelativeVertical.push(ht),s.nodeToRelativeConstraintMapVertical.set(ht,[]),s.dummyToNodeForHorizontalAlignment.has(ht)?s.nodeToTempPositionMapVertical.set(ht,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(ht,s.idToNodeMap.get(ht).getCenterY())),s.nodeToRelativeConstraintMapVertical.get(Q).push({bottom:ht,gap:A.gap}),s.nodeToRelativeConstraintMapVertical.get(ht).push({top:Q,gap:A.gap})}});else{var Z=new Map,_=new Map;this.constraints.relativePlacementConstraint.forEach(function(A){if(A.left){var U=O.has(A.left)?O.get(A.left):A.left,X=O.has(A.right)?O.get(A.right):A.right;Z.has(U)?Z.get(U).push(X):Z.set(U,[X]),Z.has(X)?Z.get(X).push(U):Z.set(X,[U])}else{var Q=b.has(A.top)?b.get(A.top):A.top,ht=b.has(A.bottom)?b.get(A.bottom):A.bottom;_.has(Q)?_.get(Q).push(ht):_.set(Q,[ht]),_.has(ht)?_.get(ht).push(Q):_.set(ht,[Q])}});var S=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=S(Z,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=j.components,this.fixedComponentsOnHorizontal=j.isFixed;var z=S(_,s.fixedNodesOnVertical);this.componentsOnVertical=z.components,this.fixedComponentsOnVertical=z.isFixed}}},I.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(z){var A=s.idToNodeMap.get(z.nodeId);A.displacementX=0,A.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,g=0;g1){var b;for(b=0;bT&&(T=Math.floor(O.y)),D=Math.floor(O.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new y(N.WORLD_CENTER_X-O.x/2,N.WORLD_CENTER_Y-O.y/2))},I.radialLayout=function(s,E,g){var T=Math.max(this.maxDiagonalInTree(s),h.DEFAULT_RADIAL_SEPARATION);I.branchRadialLayout(E,null,0,359,0,T);var d=V.calculateBounds(s),D=new Y;D.setDeviceOrgX(d.getMinX()),D.setDeviceOrgY(d.getMinY()),D.setWorldOrgX(g.x),D.setWorldOrgY(g.y);for(var O=0;O1;){var Q=X[0];X.splice(0,1);var ht=S.indexOf(Q);ht>=0&&S.splice(ht,1),A--,j--}E!=null?U=(S.indexOf(X[0])+1)%A:U=0;for(var Ct=Math.abs(T-g)/j,Ft=U;z!=j;Ft=++Ft%A){var J=S[Ft].getOtherEnd(s);if(J!=E){var Xt=(g+z*Ct)%360,Ot=(Xt+Ct)%360;I.branchRadialLayout(J,s,Xt,Ot,d+D,D),z++}}},I.maxDiagonalInTree=function(s){for(var E=M.MIN_VALUE,g=0;gE&&(E=d)}return E},I.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},I.prototype.groupZeroDegreeMembers=function(){var s=this,E={};this.memberGroups={},this.idToDummyNode={};for(var g=[],T=this.graphManager.getAllNodes(),d=0;d"u"&&(E[b]=[]),E[b]=E[b].concat(D)}Object.keys(E).forEach(function(R){if(E[R].length>1){var x="DummyCompound_"+R;s.memberGroups[x]=E[R];var Z=E[R][0].getParent(),_=new i(s.graphManager);_.id=x,_.paddingLeft=Z.paddingLeft||0,_.paddingRight=Z.paddingRight||0,_.paddingBottom=Z.paddingBottom||0,_.paddingTop=Z.paddingTop||0,s.idToDummyNode[x]=_;var S=s.getGraphManager().add(s.newGraph(),_),j=Z.getChild();j.add(_);for(var z=0;zd?(T.rect.x-=(T.labelWidth-d)/2,T.setWidth(T.labelWidth),T.labelMarginLeft=(T.labelWidth-d)/2):T.labelPosHorizontal=="right"&&T.setWidth(d+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 s=this.compoundOrder.length-1;s>=0;s--){var E=this.compoundOrder[s],g=E.id,T=E.paddingLeft,d=E.paddingTop,D=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[g],E.rect.x,E.rect.y,T,d,D,O)}},I.prototype.repopulateZeroDegreeMembers=function(){var s=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(g){var T=s.idToDummyNode[g],d=T.paddingLeft,D=T.paddingTop,O=T.labelMarginLeft,b=T.labelMarginTop;s.adjustLocations(E[g],T.rect.x,T.rect.y,d,D,O,b)})},I.prototype.getToBeTiled=function(s){var E=s.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var g=s.getChild();if(g==null)return this.toBeTiled[E]=!1,!1;for(var T=g.getNodes(),d=0;d0)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(s){for(var E=s.id,g=s.getEdges(),T=0,d=0;dZ&&(Z=S.rect.height)}g+=Z+s.verticalPadding}},I.prototype.tileCompoundMembers=function(s,E){var g=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(T){var d=E[T];if(g.tiledMemberPack[T]=g.tileNodes(s[T],d.paddingLeft+d.paddingRight),d.rect.width=g.tiledMemberPack[T].width,d.rect.height=g.tiledMemberPack[T].height,d.setCenter(g.tiledMemberPack[T].centerX,g.tiledMemberPack[T].centerY),d.labelMarginLeft=0,d.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var D=d.rect.width,O=d.rect.height;d.labelWidth&&(d.labelPosHorizontal=="left"?(d.rect.x-=d.labelWidth,d.setWidth(D+d.labelWidth),d.labelMarginLeft=d.labelWidth):d.labelPosHorizontal=="center"&&d.labelWidth>D?(d.rect.x-=(d.labelWidth-D)/2,d.setWidth(d.labelWidth),d.labelMarginLeft=(d.labelWidth-D)/2):d.labelPosHorizontal=="right"&&d.setWidth(D+d.labelWidth)),d.labelHeight&&(d.labelPosVertical=="top"?(d.rect.y-=d.labelHeight,d.setHeight(O+d.labelHeight),d.labelMarginTop=d.labelHeight):d.labelPosVertical=="center"&&d.labelHeight>O?(d.rect.y-=(d.labelHeight-O)/2,d.setHeight(d.labelHeight),d.labelMarginTop=(d.labelHeight-O)/2):d.labelPosVertical=="bottom"&&d.setHeight(O+d.labelHeight))}})},I.prototype.tileNodes=function(s,E){var g=this.tileNodesByFavoringDim(s,E,!0),T=this.tileNodesByFavoringDim(s,E,!1),d=this.getOrgRatio(g),D=this.getOrgRatio(T),O;return Db&&(b=z.getWidth())});var R=D/d,x=O/d,Z=Math.pow(g-T,2)+4*(R+T)*(x+g)*d,_=(T-g+Math.sqrt(Z))/(2*(R+T)),S;E?(S=Math.ceil(_),S==_&&S++):S=Math.floor(_);var j=S*(R+T)-T;return b>j&&(j=b),j+=T*2,j},I.prototype.tileNodesByFavoringDim=function(s,E,g){var T=h.TILING_PADDING_VERTICAL,d=h.TILING_PADDING_HORIZONTAL,D=h.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:T,horizontalPadding:d,centerX:0,centerY:0};D&&(O.idealRowWidth=this.calcIdealRowWidth(s,g));var b=function(A){return A.rect.width*A.rect.height},R=function(A,U){return b(U)-b(A)};s.sort(function(z,A){var U=R;return O.idealRowWidth?(U=D,U(z.id,A.id)):U(z,A)});for(var x=0,Z=0,_=0;_0&&(O+=s.horizontalPadding),s.rowWidth[g]=O,s.width0&&(b+=s.verticalPadding);var R=0;b>s.rowHeight[g]&&(R=s.rowHeight[g],s.rowHeight[g]=b,R=s.rowHeight[g]-R),s.height+=R,s.rows[g].push(E)},I.prototype.getShortestRowIndex=function(s){for(var E=-1,g=Number.MAX_VALUE,T=0;Tg&&(E=T,g=s.rowWidth[T]);return E},I.prototype.canAddHorizontal=function(s,E,g){if(s.idealRowWidth){var T=s.rows.length-1,d=s.rowWidth[T];return d+E+s.horizontalPadding<=s.idealRowWidth}var D=this.getShortestRowIndex(s);if(D<0)return!0;var O=s.rowWidth[D];if(O+s.horizontalPadding+E<=s.width)return!0;var b=0;s.rowHeight[D]0&&(b=g+s.verticalPadding-s.rowHeight[D]);var R;s.width-O>=E+s.horizontalPadding?R=(s.height+b)/(O+E+s.horizontalPadding):R=(s.height+b)/s.width,b=g+s.verticalPadding;var x;return s.widthD&&E!=g){T.splice(-1,1),s.rows[g].push(d),s.rowWidth[E]=s.rowWidth[E]-D,s.rowWidth[g]=s.rowWidth[g]+D,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var O=Number.MIN_VALUE,b=0;bO&&(O=T[b].height);E>0&&(O+=s.verticalPadding);var R=s.rowHeight[E]+s.rowHeight[g];s.rowHeight[E]=O,s.rowHeight[g]0)for(var j=d;j<=D;j++)S[0]+=this.grid[j][O-1].length+this.grid[j][O].length-1;if(D0)for(var j=O;j<=b;j++)S[3]+=this.grid[d-1][j].length+this.grid[d][j].length-1;for(var z=M.MAX_VALUE,A,U,X=0;X{var f=a(551).FDLayoutNode,e=a(551).IMath;function v(r,h,c,l){f.call(this,r,h,c,l)}v.prototype=Object.create(f.prototype);for(var i in f)v[i]=f[i];v.prototype.calculateDisplacement=function(){var r=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementX=r.coolingFactor*r.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementY=r.coolingFactor*r.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},v.prototype.propogateDisplacementToChildren=function(r,h){for(var c=this.getChild().getNodes(),l,N=0;N{function f(c){if(Array.isArray(c)){for(var l=0,N=Array(c.length);l0){var dt=0;it.forEach(function(ft){W=="horizontal"?(q.set(ft,p.has(ft)?y[p.get(ft)]:$.get(ft)),dt+=q.get(ft)):(q.set(ft,p.has(ft)?C[p.get(ft)]:$.get(ft)),dt+=q.get(ft))}),dt=dt/it.length,st.forEach(function(ft){B.has(ft)||q.set(ft,dt)})}else{var nt=0;st.forEach(function(ft){W=="horizontal"?nt+=p.has(ft)?y[p.get(ft)]:$.get(ft):nt+=p.has(ft)?C[p.get(ft)]:$.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 de=(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)+de)}}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,B=0,$=0,K=0;if(H.forEach(function(lt){lt.left?y[p.get(lt.left)]-y[p.get(lt.right)]>=0?W++:B++:C[p.get(lt.top)]-C[p.get(lt.bottom)]>=0?$++:K++}),W>B&&$>K)for(var gt=0;gtB)for(var ct=0;ctK)for(var q=0;q1)l.fixedNodeConstraint.forEach(function(G,H){T[H]=[G.position.x,G.position.y],d[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 b.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)]],d[G]=[y[p.get(vt)],C[p.get(vt)]],G++})},B=0;B0?rt=y[p.get(ut.values().next().value)]:rt=et(lt).y,$[q].forEach(function(vt){T[G]=[y[p.get(vt)],rt],d[G]=[y[p.get(vt)],C[p.get(vt)]],G++})},gt=0;gt<$.length;gt++)K(gt);D=!0}l.relativePlacementConstraint&&(O=!0)})();else if(l.relativePlacementConstraint){for(var _=0,S=0,j=0;j_&&(_=Z[j].length,S=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)]},B=G.position,$=Y(B,W);Mt.x+=$.x,Mt.y+=$.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 B=new Set([].concat(f(W)).filter(function(K){return b.has(K)})),$=void 0;B.size>0?$=y[p.get(B.values().next().value)]:$=et(W).x,W.forEach(function(K){b.has(K)||(y[p.get(K)]=$)})},Dt=0;Dt0?$=C[p.get(B.values().next().value)]:$=et(W).y,W.forEach(function(K){b.has(K)||(C[p.get(K)]=$)})},Gt=0;Gt{n.exports=m}},L={};function u(n){var t=L[n];if(t!==void 0)return t.exports;var a=L[n]={exports:{}};return w[n](a,a.exports,u),a.exports}var o=u(45);return o})()})});var Je=me((se,we)=>{(function(w,L){typeof se=="object"&&typeof we=="object"?we.exports=L(Ae()):typeof define=="function"&&define.amd?define(["cose-base"],L):typeof se=="object"?se.cytoscapeFcose=L(Ae()):w.cytoscapeFcose=L(w.coseBase)})(se,function(m){return(()=>{"use strict";var w={658:n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(t){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=function(){function i(r,h){var c=[],l=!0,N=!1,p=void 0;try{for(var y=r[Symbol.iterator](),C;!(l=(C=y.next()).done)&&(c.push(C.value),!(h&&c.length===h));l=!0);}catch(F){N=!0,p=F}finally{try{!l&&y.return&&y.return()}finally{if(N)throw p}}return c}return function(r,h){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return i(r,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=a(140).layoutBase.LinkedList,v={};v.getTopMostNodes=function(i){for(var r={},h=0;h0&&D.merge(x)});for(var O=0;O1){C=p[0],F=C.connectedEdges().length,p.forEach(function(d){d.connectedEdges().length0&&c.set("dummy"+(c.size+1),V),Y},v.relocateComponent=function(i,r,h){if(!h.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;if(h.quality=="draft"){var y=!0,C=!1,F=void 0;try{for(var M=r.nodeIndexes[Symbol.iterator](),P;!(y=(P=M.next()).done);y=!0){var V=P.value,Y=f(V,2),et=Y[0],I=Y[1],k=h.cy.getElementById(et);if(k){var s=k.boundingBox(),E=r.xCoords[I]-s.w/2,g=r.xCoords[I]+s.w/2,T=r.yCoords[I]-s.h/2,d=r.yCoords[I]+s.h/2;El&&(l=g),Tp&&(p=d)}}}catch(x){C=!0,F=x}finally{try{!y&&M.return&&M.return()}finally{if(C)throw F}}var D=i.x-(l+c)/2,O=i.y-(p+N)/2;r.xCoords=r.xCoords.map(function(x){return x+D}),r.yCoords=r.yCoords.map(function(x){return x+O})}else{Object.keys(r).forEach(function(x){var Z=r[x],_=Z.getRect().x,S=Z.getRect().x+Z.getRect().width,j=Z.getRect().y,z=Z.getRect().y+Z.getRect().height;_l&&(l=S),jp&&(p=z)});var b=i.x-(l+c)/2,R=i.y-(p+N)/2;Object.keys(r).forEach(function(x){var Z=r[x];Z.setCenter(Z.getCenterX()+b,Z.getCenterY()+R)})}}},v.calcBoundingBox=function(i,r,h,c){for(var l=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,p=Number.MAX_SAFE_INTEGER,y=Number.MIN_SAFE_INTEGER,C=void 0,F=void 0,M=void 0,P=void 0,V=i.descendants().not(":parent"),Y=V.length,et=0;etC&&(l=C),NM&&(p=M),y{var f=a(548),e=a(140).CoSELayout,v=a(140).CoSENode,i=a(140).layoutBase.PointD,r=a(140).layoutBase.DimensionD,h=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,N=function(y,C){var F=y.cy,M=y.eles,P=M.nodes(),V=M.edges(),Y=void 0,et=void 0,I=void 0,k={};y.randomize&&(Y=C.nodeIndexes,et=C.xCoords,I=C.yCoords);var s=function(x){return typeof x=="function"},E=function(x,Z){return s(x)?x(Z):x},g=f.calcParentsWithoutChildren(F,M),T=function R(x,Z,_,S){for(var j=Z.length,z=0;z0){var Ct=void 0;Ct=_.getGraphManager().add(_.newGraph(),X),R(Ct,U,_,S)}}},d=function(x,Z,_){for(var S=0,j=0,z=0;z<_.length;z++){var A=_[z],U=k[A.data("source")],X=k[A.data("target")];if(U&&X&&U!==X&&U.getEdgesBetween(X).length==0){var Q=Z.add(x.newEdge(),U,X);Q.id=A.id(),Q.idealLength=E(y.idealEdgeLength,A),Q.edgeElasticity=E(y.edgeElasticity,A),S+=Q.idealLength,j++}}y.idealEdgeLength!=null&&(j>0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=S/j:s(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,Z){Z.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Z.fixedNodeConstraint),Z.alignmentConstraint&&(x.constraints.alignmentConstraint=Z.alignmentConstraint),Z.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Z.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"?h.QUALITY=2:h.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!y.randomize,l.ANIMATE=c.ANIMATE=h.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=h.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!y.randomize,h.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,b=O.newGraphManager();return T(b.addRoot(),f.getTopMostNodes(P),O,y),d(O,b,V),D(O,y),O.runLayout(),k};n.exports={coseLayout:N}},212:(n,t,a)=>{var f=function(){function y(C,F){for(var M=0;M0)if(d){var b=i.getTopMostNodes(M.eles.nodes());if(s=i.connectComponents(P,M.eles,b),s.forEach(function(ot){var tt=ot.boundingBox();E.push({x:tt.x1+tt.w/2,y:tt.y1+tt.h/2})}),M.randomize&&s.forEach(function(ot){M.eles=ot,Y.push(h(M))}),M.quality=="default"||M.quality=="proof"){var R=P.collection();if(M.tile){var x=new Map,Z=[],_=[],S=0,j={nodeIndexes:x,xCoords:Z,yCoords:_},z=[];if(s.forEach(function(ot,tt){ot.edges().length==0&&(ot.nodes().forEach(function(yt,mt){R.merge(ot.nodes()[mt]),yt.isParent()||(j.nodeIndexes.set(ot.nodes()[mt].id(),S++),j.xCoords.push(ot.nodes()[0].position().x),j.yCoords.push(ot.nodes()[0].position().y))}),z.push(tt))}),R.length>1){var A=R.boundingBox();E.push({x:A.x1+A.w/2,y:A.y1+A.h/2}),s.push(R),Y.push(j);for(var U=z.length-1;U>=0;U--)s.splice(z[U],1),Y.splice(z[U],1),E.splice(z[U],1)}}s.forEach(function(ot,tt){M.eles=ot,k.push(l(M,Y[tt])),i.relocateComponent(E[tt],k[tt],M)})}else s.forEach(function(ot,tt){i.relocateComponent(E[tt],Y[tt],M)});var X=new Set;if(s.length>1){var Q=[],ht=V.filter(function(ot){return ot.css("display")=="none"});s.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=h(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(P,V),Ot=V.filter(function(ot){return ot.css("display")=="none"});M.eles=V.not(Ot),V.nodes().not(":parent").not(Ot).layoutPositions(F,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,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,v=a(140).layoutBase.SVD,i=function(h){var c=h.cy,l=h.eles,N=l.nodes(),p=l.nodes(":parent"),y=new Map,C=new Map,F=new Map,M=[],P=[],V=[],Y=[],et=[],I=[],k=[],s=[],E=void 0,g=void 0,T=1e8,d=1e-9,D=h.piTol,O=h.samplingType,b=h.nodeSeparation,R=void 0,x=function(){for(var W=0,B=0,$=!1;B=gt;){q=K[gt++];for(var st=M[q],it=0;itrt&&(rt=et[nt],vt=nt)}return vt},_=function(W){var B=void 0;if(W){B=Math.floor(Math.random()*g),E=B;for(var K=0;K=1)break;rt=ut}for(var st=0;st=1)break;rt=ut}for(var dt=0;dt0&&(B.isParent()?M[W].push(F.get(B.id())):M[W].push(B.id()))})});var Xt=function(W){var B=C.get(W),$=void 0;y.get(W).forEach(function(K){c.getElementById(K).isParent()?$=F.get(K):$=K,M[B].push($),M[C.get($)].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}}g=C.size;var Tt=void 0;if(g>2){R=g{var f=a(212),e=function(i){i&&i("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),n.exports=e},140:n=>{n.exports=m}},L={};function u(n){var t=L[n];if(t!==void 0)return t.exports;var a=L[n]={exports:{}};return w[n](a,a.exports,u),a.exports}var o=u(579);return o})()})});var rr=ur(Je(),1);var Qe={L:"left",R:"right",T:"top",B:"bottom"},Ke={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")},ue={L:at((m,w)=>m-w+2,"L"),R:at((m,w)=>m-2,"R"),T:at((m,w)=>m-w+2,"T"),B:at((m,w)=>m-2,"B")},gr=at(function(m){return Vt(m)?m==="L"?"R":"L":m==="T"?"B":"T"},"getOppositeArchitectureDirection"),je=at(function(m){let w=m;return w==="L"||w==="R"||w==="T"||w==="B"},"isArchitectureDirection"),Vt=at(function(m){let w=m;return w==="L"||w==="R"},"isArchitectureDirectionX"),Jt=at(function(m){let w=m;return w==="T"||w==="B"},"isArchitectureDirectionY"),_e=at(function(m,w){let L=Vt(m)&&Jt(w),u=Jt(m)&&Vt(w);return L||u},"isArchitectureDirectionXY"),dr=at(function(m){let w=m[0],L=m[1],u=Vt(w)&&Jt(L),o=Jt(w)&&Vt(L);return u||o},"isArchitecturePairXY"),vr=at(function(m){return m!=="LL"&&m!=="RR"&&m!=="TT"&&m!=="BB"},"isValidArchitectureDirectionPair"),Oe=at(function(m,w){let L=`${m}${w}`;return vr(L)?L:void 0},"getArchitectureDirectionPair"),pr=at(function([m,w],L){let u=L[0],o=L[1];return Vt(u)?Jt(o)?[m+(u==="L"?-1:1),w+(o==="T"?1:-1)]:[m+(u==="L"?-1:1),w]:Vt(o)?[m+(o==="L"?1:-1),w+(u==="T"?1:-1)]:[m,w+(u==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),yr=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"),Er=at(function(m){return m.type==="service"},"isArchitectureService"),mr=at(function(m){return m.type==="junction"},"isArchitectureJunction"),tr=at(m=>m.data(),"edgeData"),ie=at(m=>m.data(),"nodeData"),er=Fe.architecture,pt=new ke(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:er,dataStructures:void 0,elements:{}})),Tr=at(()=>{pt.reset(),Pe()},"clear"),Nr=at(function({id:m,icon:w,in:L,title:u,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(L!==void 0){if(m===L)throw new Error(`The service [${m}] cannot be placed within itself`);if(pt.records.registeredIds[L]===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[L]==="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:w,iconText:o,title:u,edges:[],in:L}},"addService"),Lr=at(()=>Object.values(pt.records.nodes).filter(Er),"getServices"),Cr=at(function({id:m,in:w}){pt.records.registeredIds[m]="node",pt.records.nodes[m]={id:m,type:"junction",edges:[],in:w}},"addJunction"),Mr=at(()=>Object.values(pt.records.nodes).filter(mr),"getJunctions"),Ar=at(()=>Object.values(pt.records.nodes),"getNodes"),wr=at(m=>pt.records.nodes[m],"getNode"),Or=at(function({id:m,icon:w,in:L,title:u}){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(L!==void 0){if(m===L)throw new Error(`The group [${m}] cannot be placed within itself`);if(pt.records.registeredIds[L]===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[L]==="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:w,title:u,in:L}},"addGroup"),Dr=at(()=>Object.values(pt.records.groups),"getGroups"),xr=at(function({lhsId:m,rhsId:w,lhsDir:L,rhsDir:u,lhsInto:o,rhsInto:n,lhsGroup:t,rhsGroup:a,title:f}){if(!je(L))throw new Error(`Invalid direction given for left hand side of edge ${m}--${w}. Expected (L,R,T,B) got ${L}`);if(!je(u))throw new Error(`Invalid direction given for right hand side of edge ${m}--${w}. Expected (L,R,T,B) got ${u}`);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[w]===void 0&&pt.records.groups[m]===void 0)throw new Error(`The right-hand id [${w}] 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[w].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(a&&e&&v&&e==v)throw new Error(`The right-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:m,lhsDir:L,lhsInto:o,lhsGroup:t,rhsId:w,rhsDir:u,rhsInto:n,rhsGroup:a,title:f};pt.records.edges.push(i),pt.records.nodes[m]&&pt.records.nodes[w]&&(pt.records.nodes[m].edges.push(pt.records.edges[pt.records.edges.length-1]),pt.records.nodes[w].edges.push(pt.records.edges[pt.records.edges.length-1]))},"addEdge"),Ir=at(()=>pt.records.edges,"getEdges"),Rr=at(()=>{if(pt.records.dataStructures===void 0){let m=Object.entries(pt.records.nodes).reduce((t,[a,f])=>(t[a]=f.edges.reduce((e,v)=>{if(v.lhsId===a){let i=Oe(v.lhsDir,v.rhsDir);i&&(e[i]=v.rhsId)}else{let i=Oe(v.rhsDir,v.lhsDir);i&&(e[i]=v.lhsId)}return e},{}),t),{}),w=Object.keys(m)[0],L={[w]:1},u=Object.keys(m).reduce((t,a)=>a===w?t:{...t,[a]:1},{}),o=at(t=>{let a={[t]:[0,0]},f=[t];for(;f.length>0;){let e=f.shift();if(e){L[e]=1,delete u[e];let v=m[e],[i,r]=a[e];Object.entries(v).forEach(([h,c])=>{L[c]||(a[c]=pr([i,r],h),f.push(c))})}}return a},"BFS"),n=[o(w)];for(;Object.keys(u).length>0;)n.push(o(Object.keys(u)[0]));pt.records.dataStructures={adjList:m,spatialMaps:n}}return pt.records.dataStructures},"getDataStructures"),Sr=at((m,w)=>{pt.records.elements[m]=w},"setElementForId"),Fr=at(m=>pt.records.elements[m],"getElementById"),ge={clear:Tr,setDiagramTitle:He,getDiagramTitle:We,setAccTitle:Ge,getAccTitle:Ue,setAccDescription:Ye,getAccDescription:Xe,addService:Nr,getServices:Lr,addJunction:Cr,getJunctions:Mr,getNodes:Ar,getNode:wr,addGroup:Or,getGroups:Dr,addEdge:xr,getEdges:Ir,setElementForId:Sr,getElementById:Fr,getDataStructures:Rr};function Ut(m){let w=ae().architecture;return w?.[m]?w[m]:er[m]}at(Ut,"getConfigField");var br=at((m,w)=>{Ze(m,w),m.groups.map(w.addGroup),m.services.map(L=>w.addService({...L,type:"service"})),m.junctions.map(L=>w.addJunction({...L,type:"junction"})),m.edges.map(w.addEdge)},"populateDb"),Pr={parse:at(async m=>{let w=await qe("architecture",m);Te.debug(w),br(w,ge)},"parse")},Gr=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"),Ur=Gr,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:Ve,blank:{body:re("")}}},Yr=at(async function(m,w){let L=Ut("padding"),u=Ut("iconSize"),o=u/2,n=u/6,t=n/2;await Promise.all(w.edges().map(async a=>{let{source:f,sourceDir:e,sourceArrow:v,sourceGroup:i,target:r,targetDir:h,targetArrow:c,targetGroup:l,label:N}=tr(a),{x:p,y}=a[0].sourceEndpoint(),{x:C,y:F}=a[0].midpoint(),{x:M,y:P}=a[0].targetEndpoint(),V=L+4;if(i&&(Vt(e)?p+=e==="L"?-V:V:y+=e==="T"?-V:V+18),l&&(Vt(h)?M+=h==="L"?-V:V:P+=h==="T"?-V:V+18),!i&&ge.getNode(f)?.type==="junction"&&(Vt(e)?p+=e==="L"?o:-o:y+=e==="T"?o:-o),!l&&ge.getNode(r)?.type==="junction"&&(Vt(h)?M+=h==="L"?o:-o:P+=h==="T"?o:-o),a[0]._private.rscratch){let Y=m.insert("g");if(Y.insert("path").attr("d",`M ${p},${y} L ${C},${F} L${M},${P} `).attr("class","edge"),v){let et=Vt(e)?ue[e](p,n):p-t,I=Jt(e)?ue[e](y,n):y-t;Y.insert("polygon").attr("points",Ke[e](n)).attr("transform",`translate(${et},${I})`).attr("class","arrow")}if(c){let et=Vt(h)?ue[h](M,n):M-t,I=Jt(h)?ue[h](P,n):P-t;Y.insert("polygon").attr("points",Ke[h](n)).attr("transform",`translate(${et},${I})`).attr("class","arrow")}if(N){let et=_e(e,h)?"XY":Vt(e)?"X":"Y",I=0;et==="X"?I=Math.abs(p-M):et==="Y"?I=Math.abs(y-P)/1.5:I=Math.abs(p-M)/2;let k=Y.append("g");if(await ce(k,N,{useHtmlLabels:!1,width:I,classes:"architecture-service-label"},ae()),k.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),et==="X")k.attr("transform","translate("+C+", "+F+")");else if(et==="Y")k.attr("transform","translate("+C+", "+F+") rotate(-90)");else if(et==="XY"){let s=Oe(e,h);if(s&&dr(s)){let E=k.node().getBoundingClientRect(),[g,T]=yr(s);k.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*g*T*45})`);let d=k.node().getBoundingClientRect();k.attr("transform",` translate(${C}, ${F-E.height/2}) translate(${g*d.width/2}, ${T*d.height/2}) rotate(${-1*g*T*45}, 0, ${E.height/2}) `)}}}}}))},"drawEdges"),Xr=at(async function(m,w){let u=Ut("padding")*.75,o=Ut("fontSize"),t=Ut("iconSize")/2;await Promise.all(w.nodes().map(async a=>{let f=ie(a);if(f.type==="group"){let{h:e,w:v,x1:i,y1:r}=a.boundingBox();m.append("rect").attr("x",i+t).attr("y",r+t).attr("width",v).attr("height",e).attr("class","node-bkg");let h=m.append("g"),c=i,l=r;if(f.icon){let N=h.append("g");N.html(`${await fe(f.icon,{height:u,width:u,fallbackPrefix:he.prefix})}`),N.attr("transform","translate("+(c+t+1)+", "+(l+t+1)+")"),c+=u,l+=o/2-1-2}if(f.label){let N=h.append("g");await ce(N,f.label,{useHtmlLabels:!1,width:v,classes:"architecture-service-label"},ae()),N.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),N.attr("transform","translate("+(c+t+4)+", "+(l+t+2)+")")}}}))},"drawGroups"),Hr=at(async function(m,w,L){for(let u of L){let o=w.append("g"),n=Ut("iconSize");if(u.title){let e=o.append("g");await ce(e,u.title,{useHtmlLabels:!1,width:n*1.5,classes:"architecture-service-label"},ae()),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+n/2+", "+n+")")}let t=o.append("g");if(u.icon)t.html(`${await fe(u.icon,{height:n,width:n,fallbackPrefix:he.prefix})}`);else if(u.iconText){t.html(`${await fe("blank",{height:n,width:n,fallbackPrefix:he.prefix})}`);let i=t.append("g").append("foreignObject").attr("width",n).attr("height",n).append("div").attr("class","node-icon-text").attr("style",`height: ${n}px;`).append("div").html(u.iconText),r=parseInt(window.getComputedStyle(i.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;i.attr("style",`-webkit-line-clamp: ${Math.floor((n-2)/r)};`)}else t.append("path").attr("class","node-bkg").attr("id","node-"+u.id).attr("d",`M0 ${n} v${-n} q0,-5 5,-5 h${n} q5,0 5,5 v${n} H0 Z`);o.attr("class","architecture-service");let{width:a,height:f}=o._groups[0][0].getBBox();u.width=a,u.height=f,m.setElementForId(u.id,o)}return 0},"drawServices"),Wr=at(function(m,w,L){L.forEach(u=>{let o=w.append("g"),n=Ut("iconSize");o.append("g").append("rect").attr("id","node-"+u.id).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:a,height:f}=o._groups[0][0].getBBox();o.width=a,o.height=f,m.setElementForId(u.id,o)})},"drawJunctions");ze([{name:he.prefix,icons:he}]);Ne.use(rr.default);function ir(m,w){m.forEach(L=>{w.add({group:"nodes",data:{type:"service",id:L.id,icon:L.icon,label:L.title,parent:L.in,width:Ut("iconSize"),height:Ut("iconSize")},classes:"node-service"})})}at(ir,"addServices");function ar(m,w){m.forEach(L=>{w.add({group:"nodes",data:{type:"junction",id:L.id,parent:L.in,width:Ut("iconSize"),height:Ut("iconSize")},classes:"node-junction"})})}at(ar,"addJunctions");function nr(m,w){w.nodes().map(L=>{let u=ie(L);if(u.type==="group")return;u.x=L.position().x,u.y=L.position().y,m.getElementById(u.id).attr("transform","translate("+(u.x||0)+","+(u.y||0)+")")})}at(nr,"positionNodes");function or(m,w){m.forEach(L=>{w.add({group:"nodes",data:{type:"group",id:L.id,icon:L.icon,label:L.title,parent:L.in},classes:"node-group"})})}at(or,"addGroups");function sr(m,w){m.forEach(L=>{let{lhsId:u,rhsId:o,lhsInto:n,lhsGroup:t,rhsInto:a,lhsDir:f,rhsDir:e,rhsGroup:v,title:i}=L,r=_e(L.lhsDir,L.rhsDir)?"segments":"straight",h={id:`${u}-${o}`,label:i,source:u,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:a,targetGroup:v,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};w.add({group:"edges",data:h,classes:r})})}at(sr,"addEdges");function hr(m){let w=m.map(o=>{let n={},t={};return Object.entries(o).forEach(([a,[f,e]])=>{n[e]||(n[e]=[]),t[f]||(t[f]=[]),n[e].push(a),t[f].push(a)}),{horiz:Object.values(n).filter(a=>a.length>1),vert:Object.values(t).filter(a=>a.length>1)}}),[L,u]=w.reduce(([o,n],{horiz:t,vert:a})=>[[...o,...t],[...n,...a]],[[],[]]);return{horizontal:L,vertical:u}}at(hr,"getAlignments");function lr(m){let w=[],L=at(o=>`${o[0]},${o[1]}`,"posToStr"),u=at(o=>o.split(",").map(n=>parseInt(n)),"strToPos");return m.forEach(o=>{let n=Object.fromEntries(Object.entries(o).map(([e,v])=>[L(v),e])),t=[L([0,0])],a={},f={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;t.length>0;){let e=t.shift();if(e){a[e]=1;let v=n[e];if(v){let i=u(e);Object.entries(f).forEach(([r,h])=>{let c=L([i[0]+h[0],i[1]+h[1]]),l=n[c];l&&!a[c]&&(t.push(c),w.push({[Qe[r]]:l,[Qe[gr(r)]]:v,gap:1.5*Ut("iconSize")}))})}}}}),w}at(lr,"getRelativeConstraints");function fr(m,w,L,u,{spatialMaps:o}){return new Promise(n=>{let t=Be("body").append("div").attr("id","cy").attr("style","display:none"),a=Ne({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(),or(L,a),ir(m,a),ar(w,a),sr(u,a);let f=hr(o),e=lr(o),v=a.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(i){let[r,h]=i.connectedNodes(),{parent:c}=ie(r),{parent:l}=ie(h);return c===l?1.5*Ut("iconSize"):.5*Ut("iconSize")},edgeElasticity(i){let[r,h]=i.connectedNodes(),{parent:c}=ie(r),{parent:l}=ie(h);return c===l?.45:.001},alignmentConstraint:f,relativePlacementConstraint:e});v.one("layoutstop",()=>{function i(r,h,c,l){let N,p,{x:y,y:C}=r,{x:F,y:M}=h;p=(l-C+(y-c)*(C-M)/(y-F))/Math.sqrt(1+Math.pow((C-M)/(y-F),2)),N=Math.sqrt(Math.pow(l-C,2)+Math.pow(c-y,2)-Math.pow(p,2));let P=Math.sqrt(Math.pow(F-y,2)+Math.pow(M-C,2));N=N/P;let V=(F-y)*(l-C)-(M-C)*(c-y);switch(!0){case V>=0:V=1;break;case V<0:V=-1;break}let Y=(F-y)*(c-y)+(M-C)*(l-C);switch(!0){case Y>=0:Y=1;break;case Y<0:Y=-1;break}return p=Math.abs(p)*V,N=N*Y,{distances:p,weights:N}}at(i,"getSegmentWeights"),a.startBatch();for(let r of Object.values(a.edges()))if(r.data?.()){let{x:h,y:c}=r.source().position(),{x:l,y:N}=r.target().position();if(h!==l&&c!==N){let p=r.sourceEndpoint(),y=r.targetEndpoint(),{sourceDir:C}=tr(r),[F,M]=Jt(C)?[p.x,y.y]:[y.x,p.y],{weights:P,distances:V}=i(p,y,F,M);r.style("segment-distances",V),r.style("segment-weights",P)}}a.endBatch(),v.run()}),v.run(),a.ready(i=>{Te.info("Ready",i),n(a)})})}at(fr,"layoutArchitecture");var Vr=at(async(m,w,L,u)=>{let o=u.db,n=o.getServices(),t=o.getJunctions(),a=o.getGroups(),f=o.getEdges(),e=o.getDataStructures(),v=$e(w),i=v.append("g");i.attr("class","architecture-edges");let r=v.append("g");r.attr("class","architecture-services");let h=v.append("g");h.attr("class","architecture-groups"),await Hr(o,r,n),Wr(o,r,t);let c=await fr(n,t,a,f,e);await Yr(i,c),await Xr(h,c),nr(o,c),be(void 0,v,Ut("padding"),Ut("useMaxWidth"))},"draw"),zr={draw:Vr},ti={parser:Pr,db:ge,renderer:zr,styles:Ur};export{ti as diagram}; //# sourceMappingURL=architectureDiagram-UYN6MBPD-WBU2OYNU.min.js.map