code-server
Version:
Run VS Code on a remote server.
37 lines • 150 kB
JavaScript
import{a as qe}from"./chunk-TCSUPM5X.js";import{a as Qe}from"./chunk-KU3KRRIP.js";import"./chunk-EVYRJEN4.js";import{a as ze}from"./chunk-CKZWEBBA.js";import"./chunk-UJGYKXFV.js";import"./chunk-SVS6VOAY.js";import"./chunk-7PMLKA6X.js";import"./chunk-OX3BH5OR.js";import"./chunk-EQI6FYDH.js";import"./chunk-KCFSBXDE.js";import"./chunk-OQIZJQUY.js";import"./chunk-WIPFUQZE.js";import{a as me}from"./chunk-IEMKBRIG.js";import{b as ke,c as Ze,d as he,f as le}from"./chunk-623C5XAY.js";import{o as Be,s as $e}from"./chunk-PKRYIESI.js";import"./chunk-JBQZ5UCE.js";import{B as Se,H as Fe,P as be,T as Pe,U as Ge,V as Ue,W as Ye,X as Xe,Y as He,Z as We,_ as se,r as Re}from"./chunk-VBOJ6TJX.js";import{b as ct,d as ye,j as Ve}from"./chunk-XDY7PRES.js";import"./chunk-YKM3JX66.js";import"./chunk-ZIJQPUA2.js";import{a as pe,c as ur}from"./chunk-OOJM4CTU.js";var Te=pe((re,Ee)=>{(function(w,N){typeof re=="object"&&typeof Ee=="object"?Ee.exports=N():typeof define=="function"&&define.amd?define([],N):typeof re=="object"?re.layoutBase=N():w.layoutBase=N()})(re,function(){return(function(E){var w={};function N(u){if(w[u])return w[u].exports;var l=w[u]={i:u,l:!1,exports:{}};return E[u].call(l.exports,l,l.exports,N),l.l=!0,l.exports}return N.m=E,N.c=w,N.i=function(u){return u},N.d=function(u,l,a){N.o(u,l)||Object.defineProperty(u,l,{configurable:!1,enumerable:!0,get:a})},N.n=function(u){var l=u&&u.__esModule?function(){return u.default}:function(){return u};return N.d(l,"a",l),l},N.o=function(u,l){return Object.prototype.hasOwnProperty.call(u,l)},N.p="",N(N.s=28)})([(function(E,w,N){"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,E.exports=u}),(function(E,w,N){"use strict";var u=N(2),l=N(8),a=N(9);function r(f,e,c){u.call(this,c),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=c,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(u.prototype);for(var n in u)r[n]=u[n];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.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"},r.prototype.getOtherEndInGraph=function(f,e){for(var c=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(c.getOwner()==e)return c;if(c.getOwner()==t)break;c=c.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.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=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.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=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},E.exports=r}),(function(E,w,N){"use strict";function u(l){this.vGraphObject=l}E.exports=u}),(function(E,w,N){"use strict";var u=N(2),l=N(10),a=N(13),r=N(0),n=N(16),f=N(5);function e(t,i,h,g){h==null&&g==null&&(g=i),u.call(this,g),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=t,h!=null&&i!=null?this.rect=new a(i.x,i.y,h.width,h.height):this.rect=new a}e.prototype=Object.create(u.prototype);for(var c in u)e[c]=u[c];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(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},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(t,i){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=i.width,this.rect.height=i.height},e.prototype.setCenter=function(t,i){this.rect.x=t-this.rect.width/2,this.rect.y=i-this.rect.height/2},e.prototype.setLocation=function(t,i){this.rect.x=t,this.rect.y=i},e.prototype.moveBy=function(t,i){this.rect.x+=t,this.rect.y+=i},e.prototype.getEdgeListToNode=function(t){var i=[],h,g=this;return g.edges.forEach(function(s){if(s.target==t){if(s.source!=g)throw"Incorrect edge source!";i.push(s)}}),i},e.prototype.getEdgesBetween=function(t){var i=[],h,g=this;return g.edges.forEach(function(s){if(!(s.source==g||s.target==g))throw"Incorrect edge source and/or target";(s.target==t||s.source==t)&&i.push(s)}),i},e.prototype.getNeighborsList=function(){var t=new Set,i=this;return i.edges.forEach(function(h){if(h.source==i)t.add(h.target);else{if(h.target!=i)throw"Incorrect incidency!";t.add(h.source)}}),t},e.prototype.withChildren=function(){var t=new Set,i,h;if(t.add(this),this.child!=null)for(var g=this.child.getNodes(),s=0;s<g.length;s++)i=g[s],h=i.withChildren(),h.forEach(function(L){t.add(L)});return t},e.prototype.getNoOfChildren=function(){var t=0,i;if(this.child==null)t=1;else for(var h=this.child.getNodes(),g=0;g<h.length;g++)i=h[g],t+=i.getNoOfChildren();return t==0&&(t=1),t},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},e.prototype.scatter=function(){var t,i,h=-r.INITIAL_WORLD_BOUNDARY,g=r.INITIAL_WORLD_BOUNDARY;t=r.WORLD_CENTER_X+n.nextDouble()*(g-h)+h;var s=-r.INITIAL_WORLD_BOUNDARY,L=r.INITIAL_WORLD_BOUNDARY;i=r.WORLD_CENTER_Y+n.nextDouble()*(L-s)+s,this.rect.x=t,this.rect.y=i},e.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var i=t.getRight()-t.getLeft(),h=t.getBottom()-t.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(i+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>i?(this.rect.x-=(this.labelWidth-i)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(i+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==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var i=this.rect.x;i>r.WORLD_BOUNDARY?i=r.WORLD_BOUNDARY:i<-r.WORLD_BOUNDARY&&(i=-r.WORLD_BOUNDARY);var h=this.rect.y;h>r.WORLD_BOUNDARY?h=r.WORLD_BOUNDARY:h<-r.WORLD_BOUNDARY&&(h=-r.WORLD_BOUNDARY);var g=new f(i,h),s=t.inverseTransformPoint(g);this.setLocation(s.x,s.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()},E.exports=e}),(function(E,w,N){"use strict";var u=N(0);function l(){}for(var a in u)l[a]=u[a];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,E.exports=l}),(function(E,w,N){"use strict";function u(l,a){l==null&&a==null?(this.x=0,this.y=0):(this.x=l,this.y=a)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(l){this.x=l},u.prototype.setY=function(l){this.y=l},u.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},E.exports=u}),(function(E,w,N){"use strict";var u=N(2),l=N(10),a=N(0),r=N(7),n=N(3),f=N(1),e=N(13),c=N(12),t=N(11);function i(g,s,L){u.call(this,L),this.estimatedSize=l.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,s!=null&&s instanceof r?this.graphManager=s:s!=null&&s instanceof Layout&&(this.graphManager=s.graphManager)}i.prototype=Object.create(u.prototype);for(var h in u)i[h]=u[h];i.prototype.getNodes=function(){return this.nodes},i.prototype.getEdges=function(){return this.edges},i.prototype.getGraphManager=function(){return this.graphManager},i.prototype.getParent=function(){return this.parent},i.prototype.getLeft=function(){return this.left},i.prototype.getRight=function(){return this.right},i.prototype.getTop=function(){return this.top},i.prototype.getBottom=function(){return this.bottom},i.prototype.isConnected=function(){return this.isConnected},i.prototype.add=function(g,s,L){if(s==null&&L==null){var y=g;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(y)>-1)throw"Node already in graph!";return y.owner=this,this.getNodes().push(y),y}else{var p=g;if(!(this.getNodes().indexOf(s)>-1&&this.getNodes().indexOf(L)>-1))throw"Source or target not in graph!";if(!(s.owner==L.owner&&s.owner==this))throw"Both owners must be this graph!";return s.owner!=L.owner?null:(p.source=s,p.target=L,p.isInterGraph=!1,this.getEdges().push(p),s.edges.push(p),L!=s&&L.edges.push(p),p)}},i.prototype.remove=function(g){var s=g;if(g instanceof n){if(s==null)throw"Node is null!";if(!(s.owner!=null&&s.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var L=s.edges.slice(),y,p=L.length,C=0;C<p;C++)y=L[C],y.isInterGraph?this.graphManager.remove(y):y.source.owner.remove(y);var R=this.nodes.indexOf(s);if(R==-1)throw"Node not in owner node list!";this.nodes.splice(R,1)}else if(g instanceof f){var y=g;if(y==null)throw"Edge is null!";if(!(y.source!=null&&y.target!=null))throw"Source and/or target is null!";if(!(y.source.owner!=null&&y.target.owner!=null&&y.source.owner==this&&y.target.owner==this))throw"Source and/or target owner is invalid!";var A=y.source.edges.indexOf(y),b=y.target.edges.indexOf(y);if(!(A>-1&&b>-1))throw"Source and/or target doesn't know this edge!";y.source.edges.splice(A,1),y.target!=y.source&&y.target.edges.splice(b,1);var R=y.source.owner.getEdges().indexOf(y);if(R==-1)throw"Not in owner's edge list!";y.source.owner.getEdges().splice(R,1)}},i.prototype.updateLeftTop=function(){for(var g=l.MAX_VALUE,s=l.MAX_VALUE,L,y,p,C=this.getNodes(),R=C.length,A=0;A<R;A++){var b=C[A];L=b.getTop(),y=b.getLeft(),g>L&&(g=L),s>y&&(s=y)}return g==l.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?p=C[0].getParent().paddingLeft:p=this.margin,this.left=s-p,this.top=g-p,new c(this.left,this.top))},i.prototype.updateBounds=function(g){for(var s=l.MAX_VALUE,L=-l.MAX_VALUE,y=l.MAX_VALUE,p=-l.MAX_VALUE,C,R,A,b,W,G=this.nodes,J=G.length,x=0;x<J;x++){var z=G[x];g&&z.child!=null&&z.updateBounds(),C=z.getLeft(),R=z.getRight(),A=z.getTop(),b=z.getBottom(),s>C&&(s=C),L<R&&(L=R),y>A&&(y=A),p<b&&(p=b)}var o=new e(s,y,L-s,p-y);s==l.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),G[0].getParent().paddingLeft!=null?W=G[0].getParent().paddingLeft:W=this.margin,this.left=o.x-W,this.right=o.x+o.width+W,this.top=o.y-W,this.bottom=o.y+o.height+W},i.calculateBounds=function(g){for(var s=l.MAX_VALUE,L=-l.MAX_VALUE,y=l.MAX_VALUE,p=-l.MAX_VALUE,C,R,A,b,W=g.length,G=0;G<W;G++){var J=g[G];C=J.getLeft(),R=J.getRight(),A=J.getTop(),b=J.getBottom(),s>C&&(s=C),L<R&&(L=R),y>A&&(y=A),p<b&&(p=b)}var x=new e(s,y,L-s,p-y);return x},i.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},i.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},i.prototype.calcEstimatedSize=function(){for(var g=0,s=this.nodes,L=s.length,y=0;y<L;y++){var p=s[y];g+=p.calcEstimatedSize()}return g==0?this.estimatedSize=a.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=g/Math.sqrt(this.nodes.length),this.estimatedSize},i.prototype.updateConnected=function(){var g=this;if(this.nodes.length==0){this.isConnected=!0;return}var s=new t,L=new Set,y=this.nodes[0],p,C,R=y.withChildren();for(R.forEach(function(x){s.push(x),L.add(x)});s.length!==0;){y=s.shift(),p=y.getEdges();for(var A=p.length,b=0;b<A;b++){var W=p[b];if(C=W.getOtherEndInGraph(y,this),C!=null&&!L.has(C)){var G=C.withChildren();G.forEach(function(x){s.push(x),L.add(x)})}}}if(this.isConnected=!1,L.size>=this.nodes.length){var J=0;L.forEach(function(x){x.owner==g&&J++}),J==this.nodes.length&&(this.isConnected=!0)}},E.exports=i}),(function(E,w,N){"use strict";var u,l=N(1);function a(r){u=N(6),this.layout=r,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var r=this.layout.newGraph(),n=this.layout.newNode(null),f=this.add(r,n);return this.setRootGraph(f),this.rootGraph},a.prototype.add=function(r,n,f,e,c){if(f==null&&e==null&&c==null){if(r==null)throw"Graph is null!";if(n==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(n.child!=null)throw"Already has a child!";return r.parent=n,n.child=r,r}else{c=f,e=n,f=r;var t=e.getOwner(),i=c.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(i!=null&&i.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==i)return f.isInterGraph=!1,t.add(f,e,c);if(f.isInterGraph=!0,f.source=e,f.target=c,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}},a.prototype.remove=function(r){if(r instanceof u){var n=r;if(n.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(n==this.rootGraph||n.parent!=null&&n.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(n.getEdges());for(var e,c=f.length,t=0;t<c;t++)e=f[t],n.remove(e);var i=[];i=i.concat(n.getNodes());var h;c=i.length;for(var t=0;t<c;t++)h=i[t],n.remove(h);n==this.rootGraph&&this.setRootGraph(null);var g=this.graphs.indexOf(n);this.graphs.splice(g,1),n.parent=null}else if(r instanceof l){if(e=r,e==null)throw"Edge is null!";if(!e.isInterGraph)throw"Not an inter-graph edge!";if(!(e.source!=null&&e.target!=null))throw"Source and/or target is null!";if(!(e.source.edges.indexOf(e)!=-1&&e.target.edges.indexOf(e)!=-1))throw"Source and/or target doesn't know this edge!";var g=e.source.edges.indexOf(e);if(e.source.edges.splice(g,1),g=e.target.edges.indexOf(e),e.target.edges.splice(g,1),!(e.source.owner!=null&&e.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(e.source.owner.getGraphManager().edges.indexOf(e)==-1)throw"Not in owner graph manager's edge list!";var g=e.source.owner.getGraphManager().edges.indexOf(e);e.source.owner.getGraphManager().edges.splice(g,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],n=this.getGraphs(),f=n.length,e=0;e<f;e++)r=r.concat(n[e].getNodes());this.allNodes=r}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(this.allEdges==null){for(var r=[],n=this.getGraphs(),f=n.length,e=0;e<n.length;e++)r=r.concat(n[e].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(r,n){if(!(r!=null&&n!=null))throw"assert failed";if(r==n)return!0;var f=r.getOwner(),e;do{if(e=f.getParent(),e==null)break;if(e==n)return!0;if(f=e.getOwner(),f==null)break}while(!0);f=n.getOwner();do{if(e=f.getParent(),e==null)break;if(e==r)return!0;if(f=e.getOwner(),f==null)break}while(!0);return!1},a.prototype.calcLowestCommonAncestors=function(){for(var r,n,f,e,c,t=this.getAllEdges(),i=t.length,h=0;h<i;h++){if(r=t[h],n=r.source,f=r.target,r.lca=null,r.sourceInLca=n,r.targetInLca=f,n==f){r.lca=n.getOwner();continue}for(e=n.getOwner();r.lca==null;){for(r.targetInLca=f,c=f.getOwner();r.lca==null;){if(c==e){r.lca=c;break}if(c==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=c.getParent(),c=r.targetInLca.getOwner()}if(e==this.rootGraph)break;r.lca==null&&(r.sourceInLca=e.getParent(),e=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},a.prototype.calcLowestCommonAncestor=function(r,n){if(r==n)return r.getOwner();var f=r.getOwner();do{if(f==null)break;var e=n.getOwner();do{if(e==null)break;if(e==f)return e;e=e.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},a.prototype.calcInclusionTreeDepths=function(r,n){r==null&&n==null&&(r=this.rootGraph,n=1);for(var f,e=r.getNodes(),c=e.length,t=0;t<c;t++)f=e[t],f.inclusionTreeDepth=n,f.child!=null&&this.calcInclusionTreeDepths(f.child,n+1)},a.prototype.includesInvalidEdge=function(){for(var r,n=[],f=this.edges.length,e=0;e<f;e++)r=this.edges[e],this.isOneAncestorOfOther(r.source,r.target)&&n.push(r);for(var e=0;e<n.length;e++)this.remove(n[e]);return!1},E.exports=a}),(function(E,w,N){"use strict";var u=N(12);function l(){}l.calcSeparationAmount=function(a,r,n,f){if(!a.intersects(r))throw"assert failed";var e=new Array(2);this.decideDirectionsForOverlappingNodes(a,r,e),n[0]=Math.min(a.getRight(),r.getRight())-Math.max(a.x,r.x),n[1]=Math.min(a.getBottom(),r.getBottom())-Math.max(a.y,r.y),a.getX()<=r.getX()&&a.getRight()>=r.getRight()?n[0]+=Math.min(r.getX()-a.getX(),a.getRight()-r.getRight()):r.getX()<=a.getX()&&r.getRight()>=a.getRight()&&(n[0]+=Math.min(a.getX()-r.getX(),r.getRight()-a.getRight())),a.getY()<=r.getY()&&a.getBottom()>=r.getBottom()?n[1]+=Math.min(r.getY()-a.getY(),a.getBottom()-r.getBottom()):r.getY()<=a.getY()&&r.getBottom()>=a.getBottom()&&(n[1]+=Math.min(a.getY()-r.getY(),r.getBottom()-a.getBottom()));var c=Math.abs((r.getCenterY()-a.getCenterY())/(r.getCenterX()-a.getCenterX()));r.getCenterY()===a.getCenterY()&&r.getCenterX()===a.getCenterX()&&(c=1);var t=c*n[0],i=n[1]/c;n[0]<i?i=n[0]:t=n[1],n[0]=-1*e[0]*(i/2+f),n[1]=-1*e[1]*(t/2+f)},l.decideDirectionsForOverlappingNodes=function(a,r,n){a.getCenterX()<r.getCenterX()?n[0]=-1:n[0]=1,a.getCenterY()<r.getCenterY()?n[1]=-1:n[1]=1},l.getIntersection2=function(a,r,n){var f=a.getCenterX(),e=a.getCenterY(),c=r.getCenterX(),t=r.getCenterY();if(a.intersects(r))return n[0]=f,n[1]=e,n[2]=c,n[3]=t,!0;var i=a.getX(),h=a.getY(),g=a.getRight(),s=a.getX(),L=a.getBottom(),y=a.getRight(),p=a.getWidthHalf(),C=a.getHeightHalf(),R=r.getX(),A=r.getY(),b=r.getRight(),W=r.getX(),G=r.getBottom(),J=r.getRight(),x=r.getWidthHalf(),z=r.getHeightHalf(),o=!1,m=!1;if(f===c){if(e>t)return n[0]=f,n[1]=h,n[2]=c,n[3]=G,!1;if(e<t)return n[0]=f,n[1]=L,n[2]=c,n[3]=A,!1}else if(e===t){if(f>c)return n[0]=i,n[1]=e,n[2]=b,n[3]=t,!1;if(f<c)return n[0]=g,n[1]=e,n[2]=R,n[3]=t,!1}else{var d=a.height/a.width,T=r.height/r.width,v=(t-e)/(c-f),D=void 0,O=void 0,P=void 0,S=void 0,I=void 0,Z=void 0;if(-d===v?f>c?(n[0]=s,n[1]=L,o=!0):(n[0]=g,n[1]=h,o=!0):d===v&&(f>c?(n[0]=i,n[1]=h,o=!0):(n[0]=y,n[1]=L,o=!0)),-T===v?c>f?(n[2]=W,n[3]=G,m=!0):(n[2]=b,n[3]=A,m=!0):T===v&&(c>f?(n[2]=R,n[3]=A,m=!0):(n[2]=J,n[3]=G,m=!0)),o&&m)return!1;if(f>c?e>t?(D=this.getCardinalDirection(d,v,4),O=this.getCardinalDirection(T,v,2)):(D=this.getCardinalDirection(-d,v,3),O=this.getCardinalDirection(-T,v,1)):e>t?(D=this.getCardinalDirection(-d,v,1),O=this.getCardinalDirection(-T,v,3)):(D=this.getCardinalDirection(d,v,2),O=this.getCardinalDirection(T,v,4)),!o)switch(D){case 1:S=h,P=f+-C/v,n[0]=P,n[1]=S;break;case 2:P=y,S=e+p*v,n[0]=P,n[1]=S;break;case 3:S=L,P=f+C/v,n[0]=P,n[1]=S;break;case 4:P=s,S=e+-p*v,n[0]=P,n[1]=S;break}if(!m)switch(O){case 1:Z=A,I=c+-z/v,n[2]=I,n[3]=Z;break;case 2:I=J,Z=t+x*v,n[2]=I,n[3]=Z;break;case 3:Z=G,I=c+z/v,n[2]=I,n[3]=Z;break;case 4:I=W,Z=t+-x*v,n[2]=I,n[3]=Z;break}}return!1},l.getCardinalDirection=function(a,r,n){return a>r?n:1+n%4},l.getIntersection=function(a,r,n,f){if(f==null)return this.getIntersection2(a,r,n);var e=a.x,c=a.y,t=r.x,i=r.y,h=n.x,g=n.y,s=f.x,L=f.y,y=void 0,p=void 0,C=void 0,R=void 0,A=void 0,b=void 0,W=void 0,G=void 0,J=void 0;return C=i-c,A=e-t,W=t*c-e*i,R=L-g,b=h-s,G=s*g-h*L,J=C*b-R*A,J===0?null:(y=(A*G-b*W)/J,p=(R*W-C*G)/J,new u(y,p))},l.angleOfVector=function(a,r,n,f){var e=void 0;return a!==n?(e=Math.atan((f-r)/(n-a)),n<a?e+=Math.PI:f<r&&(e+=this.TWO_PI)):f<r?e=this.ONE_AND_HALF_PI:e=this.HALF_PI,e},l.doIntersect=function(a,r,n,f){var e=a.x,c=a.y,t=r.x,i=r.y,h=n.x,g=n.y,s=f.x,L=f.y,y=(t-e)*(L-g)-(s-h)*(i-c);if(y===0)return!1;var p=((L-g)*(s-e)+(h-s)*(L-c))/y,C=((c-i)*(s-e)+(t-e)*(L-c))/y;return 0<p&&p<1&&0<C&&C<1},l.findCircleLineIntersections=function(a,r,n,f,e,c,t){var i=(n-a)*(n-a)+(f-r)*(f-r),h=2*((a-e)*(n-a)+(r-c)*(f-r)),g=(a-e)*(a-e)+(r-c)*(r-c)-t*t,s=h*h-4*i*g;if(s>=0){var L=(-h+Math.sqrt(h*h-4*i*g))/(2*i),y=(-h-Math.sqrt(h*h-4*i*g))/(2*i),p=null;return L>=0&&L<=1?[L]:y>=0&&y<=1?[y]:p}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,E.exports=l}),(function(E,w,N){"use strict";function u(){}u.sign=function(l){return l>0?1:l<0?-1:0},u.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},u.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},E.exports=u}),(function(E,w,N){"use strict";function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,E.exports=u}),(function(E,w,N){"use strict";var u=(function(){function e(c,t){for(var i=0;i<t.length;i++){var h=t[i];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(c,h.key,h)}}return function(c,t,i){return t&&e(c.prototype,t),i&&e(c,i),c}})();function l(e,c){if(!(e instanceof c))throw new TypeError("Cannot call a class as a function")}var a=function(c){return{value:c,next:null,prev:null}},r=function(c,t,i,h){return c!==null?c.next=t:h.head=t,i!==null?i.prev=t:h.tail=t,t.prev=c,t.next=i,h.length++,t},n=function(c,t){var i=c.prev,h=c.next;return i!==null?i.next=h:t.head=h,h!==null?h.prev=i:t.tail=i,c.prev=c.next=null,t.length--,c},f=(function(){function e(c){var t=this;l(this,e),this.length=0,this.head=null,this.tail=null,c?.forEach(function(i){return t.push(i)})}return u(e,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,i){return r(i.prev,a(t),i,this)}},{key:"insertAfter",value:function(t,i){return r(i,a(t),i.next,this)}},{key:"insertNodeBefore",value:function(t,i){return r(i.prev,t,i,this)}},{key:"insertNodeAfter",value:function(t,i){return r(i,t,i.next,this)}},{key:"push",value:function(t){return r(this.tail,a(t),null,this)}},{key:"unshift",value:function(t){return r(null,a(t),this.head,this)}},{key:"remove",value:function(t){return n(t,this)}},{key:"pop",value:function(){return n(this.tail,this).value}},{key:"popNode",value:function(){return n(this.tail,this)}},{key:"shift",value:function(){return n(this.head,this).value}},{key:"shiftNode",value:function(){return n(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var i=1,h=this.head;i<t;)h=h.next,i++;return h.value}}},{key:"set_object_at",value:function(t,i){if(t<=this.length()){for(var h=1,g=this.head;h<t;)g=g.next,h++;g.value=i}}}]),e})();E.exports=f}),(function(E,w,N){"use strict";function u(l,a,r){this.x=null,this.y=null,l==null&&a==null&&r==null?(this.x=0,this.y=0):typeof l=="number"&&typeof a=="number"&&r==null?(this.x=l,this.y=a):l.constructor.name=="Point"&&a==null&&r==null&&(r=l,this.x=r.x,this.y=r.y)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.getLocation=function(){return new u(this.x,this.y)},u.prototype.setLocation=function(l,a,r){l.constructor.name=="Point"&&a==null&&r==null?(r=l,this.setLocation(r.x,r.y)):typeof l=="number"&&typeof a=="number"&&r==null&&(parseInt(l)==l&&parseInt(a)==a?this.move(l,a):(this.x=Math.floor(l+.5),this.y=Math.floor(a+.5)))},u.prototype.move=function(l,a){this.x=l,this.y=a},u.prototype.translate=function(l,a){this.x+=l,this.y+=a},u.prototype.equals=function(l){if(l.constructor.name=="Point"){var a=l;return this.x==a.x&&this.y==a.y}return this==l},u.prototype.toString=function(){return new u().constructor.name+"[x="+this.x+",y="+this.y+"]"},E.exports=u}),(function(E,w,N){"use strict";function u(l,a,r,n){this.x=0,this.y=0,this.width=0,this.height=0,l!=null&&a!=null&&r!=null&&n!=null&&(this.x=l,this.y=a,this.width=r,this.height=n)}u.prototype.getX=function(){return this.x},u.prototype.setX=function(l){this.x=l},u.prototype.getY=function(){return this.y},u.prototype.setY=function(l){this.y=l},u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(l){this.width=l},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(l){this.height=l},u.prototype.getRight=function(){return this.x+this.width},u.prototype.getBottom=function(){return this.y+this.height},u.prototype.intersects=function(l){return!(this.getRight()<l.x||this.getBottom()<l.y||l.getRight()<this.x||l.getBottom()<this.y)},u.prototype.getCenterX=function(){return this.x+this.width/2},u.prototype.getMinX=function(){return this.getX()},u.prototype.getMaxX=function(){return this.getX()+this.width},u.prototype.getCenterY=function(){return this.y+this.height/2},u.prototype.getMinY=function(){return this.getY()},u.prototype.getMaxY=function(){return this.getY()+this.height},u.prototype.getWidthHalf=function(){return this.width/2},u.prototype.getHeightHalf=function(){return this.height/2},E.exports=u}),(function(E,w,N){"use strict";var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function l(){}l.lastID=0,l.createID=function(a){return l.isPrimitive(a)?a:(a.uniqueID!=null||(a.uniqueID=l.getString(),l.lastID++),a.uniqueID)},l.getString=function(a){return a==null&&(a=l.lastID),"Object#"+a},l.isPrimitive=function(a){var r=typeof a>"u"?"undefined":u(a);return a==null||r!="object"&&r!="function"},E.exports=l}),(function(E,w,N){"use strict";function u(h){if(Array.isArray(h)){for(var g=0,s=Array(h.length);g<h.length;g++)s[g]=h[g];return s}else return Array.from(h)}var l=N(0),a=N(7),r=N(3),n=N(1),f=N(6),e=N(5),c=N(17),t=N(29);function i(h){t.call(this),this.layoutQuality=l.QUALITY,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=l.DEFAULT_INCREMENTAL,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,h!=null&&(this.isRemoteUse=h)}i.RANDOM_SEED=1,i.prototype=Object.create(t.prototype),i.prototype.getGraphManager=function(){return this.graphManager},i.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},i.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},i.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},i.prototype.newGraphManager=function(){var h=new a(this);return this.graphManager=h,h},i.prototype.newGraph=function(h){return new f(null,this.graphManager,h)},i.prototype.newNode=function(h){return new r(this.graphManager,h)},i.prototype.newEdge=function(h){return new n(null,null,h)},i.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},i.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var h;return this.checkLayoutSuccess()?h=!1:h=this.layout(),l.ANIMATE==="during"?!1:(h&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,h)},i.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},i.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var h,g=this.graphManager.getAllEdges(),s=0;s<g.length;s++)h=g[s];for(var L,y=this.graphManager.getRoot().getNodes(),s=0;s<y.length;s++)L=y[s];this.update(this.graphManager.getRoot())}},i.prototype.update=function(h){if(h==null)this.update2();else if(h instanceof r){var g=h;if(g.getChild()!=null)for(var s=g.getChild().getNodes(),L=0;L<s.length;L++)update(s[L]);if(g.vGraphObject!=null){var y=g.vGraphObject;y.update(g)}}else if(h instanceof n){var p=h;if(p.vGraphObject!=null){var C=p.vGraphObject;C.update(p)}}else if(h instanceof f){var R=h;if(R.vGraphObject!=null){var A=R.vGraphObject;A.update(R)}}},i.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=l.QUALITY,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=l.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},i.prototype.transform=function(h){if(h==null)this.transform(new e(0,0));else{var g=new c,s=this.graphManager.getRoot().updateLeftTop();if(s!=null){g.setWorldOrgX(h.x),g.setWorldOrgY(h.y),g.setDeviceOrgX(s.x),g.setDeviceOrgY(s.y);for(var L=this.getAllNodes(),y,p=0;p<L.length;p++)y=L[p],y.transform(g)}}},i.prototype.positionNodesRandomly=function(h){if(h==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var g,s,L=h.getNodes(),y=0;y<L.length;y++)g=L[y],s=g.getChild(),s==null||s.getNodes().length==0?g.scatter():(this.positionNodesRandomly(s),g.updateBounds())},i.prototype.getFlatForest=function(){for(var h=[],g=!0,s=this.graphManager.getRoot().getNodes(),L=!0,y=0;y<s.length;y++)s[y].getChild()!=null&&(L=!1);if(!L)return h;var p=new Set,C=[],R=new Map,A=[];for(A=A.concat(s);A.length>0&&g;){for(C.push(A[0]);C.length>0&&g;){var b=C[0];C.splice(0,1),p.add(b);for(var W=b.getEdges(),y=0;y<W.length;y++){var G=W[y].getOtherEnd(b);if(R.get(b)!=G)if(!p.has(G))C.push(G),R.set(G,b);else{g=!1;break}}}if(!g)h=[];else{var J=[].concat(u(p));h.push(J);for(var y=0;y<J.length;y++){var x=J[y],z=A.indexOf(x);z>-1&&A.splice(z,1)}p=new Set,R=new Map}}return h},i.prototype.createDummyNodesForBendpoints=function(h){for(var g=[],s=h.source,L=this.graphManager.calcLowestCommonAncestor(h.source,h.target),y=0;y<h.bendpoints.length;y++){var p=this.newNode(null);p.setRect(new Point(0,0),new Dimension(1,1)),L.add(p);var C=this.newEdge(null);this.graphManager.add(C,s,p),g.add(p),s=p}var C=this.newEdge(null);return this.graphManager.add(C,s,h.target),this.edgeToDummyNodes.set(h,g),h.isInterGraph()?this.graphManager.remove(h):L.remove(h),g},i.prototype.createBendpointsFromDummyNodes=function(){var h=[];h=h.concat(this.graphManager.getAllEdges()),h=[].concat(u(this.edgeToDummyNodes.keys())).concat(h);for(var g=0;g<h.length;g++){var s=h[g];if(s.bendpoints.length>0){for(var L=this.edgeToDummyNodes.get(s),y=0;y<L.length;y++){var p=L[y],C=new e(p.getCenterX(),p.getCenterY()),R=s.bendpoints.get(y);R.x=C.x,R.y=C.y,p.getOwner().remove(p)}this.graphManager.add(s,s.source,s.target)}}},i.transform=function(h,g,s,L){if(s!=null&&L!=null){var y=g;if(h<=50){var p=g/s;y-=(g-p)/50*(50-h)}else{var C=g*L;y+=(C-g)/50*(h-50)}return y}else{var R,A;return h<=50?(R=9*g/500,A=g/10):(R=9*g/50,A=-8*g),R*h+A}},i.findCenterOfTree=function(h){var g=[];g=g.concat(h);var s=[],L=new Map,y=!1,p=null;(g.length==1||g.length==2)&&(y=!0,p=g[0]);for(var C=0;C<g.length;C++){var R=g[C],A=R.getNeighborsList().size;L.set(R,R.getNeighborsList().size),A==1&&s.push(R)}var b=[];for(b=b.concat(s);!y;){var W=[];W=W.concat(b),b=[];for(var C=0;C<g.length;C++){var R=g[C],G=g.indexOf(R);G>=0&&g.splice(G,1);var J=R.getNeighborsList();J.forEach(function(o){if(s.indexOf(o)<0){var m=L.get(o),d=m-1;d==1&&b.push(o),L.set(o,d)}})}s=s.concat(b),(g.length==1||g.length==2)&&(y=!0,p=g[0])}return p},i.prototype.setGraphManager=function(h){this.graphManager=h},E.exports=i}),(function(E,w,N){"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)},E.exports=u}),(function(E,w,N){"use strict";var u=N(5);function l(a,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(a){this.lworldExtX=a},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(a){this.lworldExtY=a},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},l.prototype.transformX=function(a){var r=0,n=this.lworldExtX;return n!=0&&(r=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/n),r},l.prototype.transformY=function(a){var r=0,n=this.lworldExtY;return n!=0&&(r=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/n),r},l.prototype.inverseTransformX=function(a){var r=0,n=this.ldeviceExtX;return n!=0&&(r=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/n),r},l.prototype.inverseTransformY=function(a){var r=0,n=this.ldeviceExtY;return n!=0&&(r=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/n),r},l.prototype.inverseTransformPoint=function(a){var r=new u(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return r},E.exports=l}),(function(E,w,N){"use strict";function u(t){if(Array.isArray(t)){for(var i=0,h=Array(t.length);i<t.length;i++)h[i]=t[i];return h}else return Array.from(t)}var l=N(15),a=N(4),r=N(0),n=N(8),f=N(9);function e(){l.call(this),this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=a.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=a.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=a.MAX_ITERATIONS}e.prototype=Object.create(l.prototype);for(var c in l)e[c]=l[c];e.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},e.prototype.calcIdealEdgeLengths=function(){for(var t,i,h,g,s,L,y,p=this.getGraphManager().getAllEdges(),C=0;C<p.length;C++)t=p[C],i=t.idealLength,t.isInterGraph&&(g=t.getSource(),s=t.getTarget(),L=t.getSourceInLca().getEstimatedSize(),y=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=L+y-2*r.SIMPLE_NODE_SIZE),h=t.getLca().getInclusionTreeDepth(),t.idealLength+=i*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(g.getInclusionTreeDepth()+s.getInclusionTreeDepth()-2*h))},e.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>a.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(t-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),i,h=0;h<t.length;h++)i=t[h],this.calcSpringForce(i,i.idealLength)},e.prototype.calcRepulsionForces=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h,g,s,L,y=this.getAllNodes(),p;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),p=new Set,h=0;h<y.length;h++)s=y[h],this.calculateRepulsionForceOfANode(s,p,t,i),p.add(s);else for(h=0;h<y.length;h++)for(s=y[h],g=h+1;g<y.length;g++)L=y[g],s.getOwner()==L.getOwner()&&this.calcRepulsionForce(s,L)},e.prototype.calcGravitationalForces=function(){for(var t,i=this.getAllNodesToApplyGravitation(),h=0;h<i.length;h++)t=i[h],this.calcGravitationalForce(t)},e.prototype.moveNodes=function(){for(var t=this.getAllNodes(),i,h=0;h<t.length;h++)i=t[h],i.move()},e.prototype.calcSpringForce=function(t,i){var h=t.getSource(),g=t.getTarget(),s,L,y,p;if(this.uniformLeafNodeSizes&&h.getChild()==null&&g.getChild()==null)t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;s=t.getLength(),s!=0&&(L=t.edgeElasticity*(s-i),y=L*(t.lengthX/s),p=L*(t.lengthY/s),h.springForceX+=y,h.springForceY+=p,g.springForceX-=y,g.springForceY-=p)},e.prototype.calcRepulsionForce=function(t,i){var h=t.getRect(),g=i.getRect(),s=new Array(2),L=new Array(4),y,p,C,R,A,b,W;if(h.intersects(g)){n.calcSeparationAmount(h,g,s,a.DEFAULT_EDGE_LENGTH/2),b=2*s[0],W=2*s[1];var G=t.noOfChildren*i.noOfChildren/(t.noOfChildren+i.noOfChildren);t.repulsionForceX-=G*b,t.repulsionForceY-=G*W,i.repulsionForceX+=G*b,i.repulsionForceY+=G*W}else this.uniformLeafNodeSizes&&t.getChild()==null&&i.getChild()==null?(y=g.getCenterX()-h.getCenterX(),p=g.getCenterY()-h.getCenterY()):(n.getIntersection(h,g,L),y=L[2]-L[0],p=L[3]-L[1]),Math.abs(y)<a.MIN_REPULSION_DIST&&(y=f.sign(y)*a.MIN_REPULSION_DIST),Math.abs(p)<a.MIN_REPULSION_DIST&&(p=f.sign(p)*a.MIN_REPULSION_DIST),C=y*y+p*p,R=Math.sqrt(C),A=(t.nodeRepulsion/2+i.nodeRepulsion/2)*t.noOfChildren*i.noOfChildren/C,b=A*y/R,W=A*p/R,t.repulsionForceX-=b,t.repulsionForceY-=W,i.repulsionForceX+=b,i.repulsionForceY+=W},e.prototype.calcGravitationalForce=function(t){var i,h,g,s,L,y,p,C;i=t.getOwner(),h=(i.getRight()+i.getLeft())/2,g=(i.getTop()+i.getBottom())/2,s=t.getCenterX()-h,L=t.getCenterY()-g,y=Math.abs(s)+t.getWidth()/2,p=Math.abs(L)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(C=i.getEstimatedSize()*this.gravityRangeFactor,(y>C||p>C)&&(t.gravitationForceX=-this.gravityConstant*s,t.gravitationForceY=-this.gravityConstant*L)):(C=i.getEstimatedSize()*this.compoundGravityRangeFactor,(y>C||p>C)&&(t.gravitationForceX=-this.gravityConstant*s*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*L*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,i=!1;return this.totalIterations>this.maxIterations/3&&(i=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||i},e.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},e.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,i=this.graphManager.getAllNodes(),h=0;h<i.length;h++)t=i[h],t.noOfChildren=t.getNoOfChildren()},e.prototype.calcGrid=function(t){var i=0,h=0;i=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),h=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var g=new Array(i),s=0;s<i;s++)g[s]=new Array(h);for(var s=0;s<i;s++)for(var L=0;L<h;L++)g[s][L]=new Array;return g},e.prototype.addNodeToGrid=function(t,i,h){var g=0,s=0,L=0,y=0;g=parseInt(Math.floor((t.getRect().x-i)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().width+t.getRect().x-i)/this.repulsionRange)),L=parseInt(Math.floor((t.getRect().y-h)/this.repulsionRange)),y=parseInt(Math.floor((t.getRect().height+t.getRect().y-h)/this.repulsionRange));for(var p=g;p<=s;p++)for(var C=L;C<=y;C++)this.grid[p][C].push(t),t.setGridCoordinates(g,s,L,y)},e.prototype.updateGrid=function(){var t,i,h=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<h.length;t++)i=h[t],this.addNodeToGrid(i,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},e.prototype.calculateRepulsionForceOfANode=function(t,i,h,g){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&h||g){var s=new Set;t.surrounding=new Array;for(var L,y=this.grid,p=t.startX-1;p<t.finishX+2;p++)for(var C=t.startY-1;C<t.finishY+2;C++)if(!(p<0||C<0||p>=y.length||C>=y[0].length)){for(var R=0;R<y[p][C].length;R++)if(L=y[p][C][R],!(t.getOwner()!=L.getOwner()||t==L)&&!i.has(L)&&!s.has(L)){var A=Math.abs(t.getCenterX()-L.getCenterX())-(t.getWidth()/2+L.getWidth()/2),b=Math.abs(t.getCenterY()-L.getCenterY())-(t.getHeight()/2+L.getHeight()/2);A<=this.repulsionRange&&b<=this.repulsionRange&&s.add(L)}}t.surrounding=[].concat(u(s))}for(p=0;p<t.surrounding.length;p++)this.calcRepulsionForce(t,t.surrounding[p])},e.prototype.calcRepulsionRange=function(){return 0},E.exports=e}),(function(E,w,N){"use strict";var u=N(1),l=N(4);function a(n,f,e){u.call(this,n,f,e),this.idealLength=l.DEFAULT_EDGE_LENGTH,this.edgeElasticity=l.DEFAULT_SPRING_STRENGTH}a.prototype=Object.create(u.prototype);for(var r in u)a[r]=u[r];E.exports=a}),(function(E,w,N){"use strict";var u=N(3),l=N(4);function a(n,f,e,c){u.call(this,n,f,e,c),this.nodeRepulsion=l.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}a.prototype=Object.create(u.prototype);for(var r in u)a[r]=u[r];a.prototype.setGridCoordinates=function(n,f,e,c){this.startX=n,this.finishX=f,this.startY=e,this.finishY=c},E.exports=a}),(function(E,w,N){"use strict";function u(l,a){this.width=0,this.height=0,l!==null&&a!==null&&(this.height=a,this.width=l)}u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(l){this.width=l},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(l){this.height=l},E.exports=u}),(function(E,w,N){"use strict";var u=N(14);function l(){this.map={},this.keys=[]}l.prototype.put=function(a,r){var n=u.createID(a);this.contains(n)||(this.map[n]=r,this.keys.push(a))},l.prototype.contains=function(a){var r=u.createID(a);return this.map[a]!=null},l.prototype.get=function(a){var r=u.createID(a);return this.map[r]},l.prototype.keySet=function(){return this.keys},E.exports=l}),(function(E,w,N){"use strict";var u=N(14);function l(){this.set={}}l.prototype.add=function(a){var r=u.createID(a);this.contains(r)||(this.set[r]=a)},l.prototype.remove=function(a){delete this.set[u.createID(a)]},l.prototype.clear=function(){this.set={}},l.prototype.contains=function(a){return this.set[u.createID(a)]==a},l.prototype.isEmpty=function(){return this.size()===0},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAllTo=function(a){for(var r=Object.keys(this.set),n=r.length,f=0;f<n;f++)a.push(this.set[r[f]])},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAll=function(a){for(var r=a.length,n=0;n<r;n++){var f=a[n];this.add(f)}},E.exports=l}),(function(E,w,N){"use strict";function u(){}u.multMat=function(l,a){for(var r=[],n=0;n<l.length;n++){r[n]=[];for(var f=0;f<a[0].length;f++){r[n][f]=0;for(var e=0;e<l[0].length;e++)r[n][f]+=l[n][e]*a[e][f]}}return r},u.transpose=function(l){for(var a=[],r=0;r<l[0].length;r++){a[r]=[];for(var n=0;n<l.length;n++)a[r][n]=l[n][r]}return a},u.multCons=function(l,a){for(var r=[],n=0;n<l.length;n++)r[n]=l[n]*a;return r},u.minusOp=function(l,a){for(var r=[],n=0;n<l.length;n++)r[n]=l[n]-a[n];return r},u.dotProduct=function(l,a){for(var r=0,n=0;n<l.length;n++)r+=l[n]*a[n];return r},u.mag=function(l){return Math.sqrt(this.dotProduct(l,l))},u.normalize=function(l){for(var a=[],r=this.mag(l),n=0;n<l.length;n++)a[n]=l[n]/r;return a},u.multGamma=function(l){for(var a=[],r=0,n=0;n<l.length;n++)r+=l[n];r*=-1/l.length;for(var f=0;f<l.length;f++)a[f]=r+l[f];return a},u.multL=function(l,a,r){for(var n=[],f=[],e=[],c=0;c<a[0].length;c++){for(var t=0,i=0;i<a.length;i++)t+=-.5*a[i][c]*l[i];f[c]=t}for(var h=0;h<r.length;h++){for(var g=0,s=0;s<r.length;s++)g+=r[h][s]*f[s];e[h]=g}for(var L=0;L<a.length;L++){for(var y=0,p=0;p<a[0].length;p++)y+=a[L][p]*e[p];n[L]=y}return n},E.exports=u}),(function(E,w,N){"use strict";var u=(function(){function n(f,e){for(var c=0;c<e.length;c++){var t=e[c];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(f,t.key,t)}}return function(f,e,c){return e&&n(f.prototype,e),c&&n(f,c),f}})();function l(n,f){if(!(n instanceof f))throw new TypeError("Cannot call a class as a function")}var a=N(11),r=(function(){function n(f,e){l(this,n),(e!==null||e!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var c=void 0;f instanceof a?c=f.size():c=f.length,this._quicksort(f,0,c-1)}return u(n,[{key:"_quicksort",value:function(e,c,t){if(c<t){var i=this._partition(e,c,t);this._quicksort(e,c,i),this._quicksort(e,i+1,t)}}},{key:"_partition",value:function(e,c,t){for(var i=this._get(e,c),h=c,g=t;;){for(;this.compareFunction(i,this._get(e,g));)g--;for(;this.compareFunction(this._get(e,h),i);)h++;if(h<g)this._swap(e,h,g),h++,g--;else return g}}},{key:"_get",value:function(e,c){return e instanceof a?e.get_object_at(c):e[c]}},{key:"_set",value:function(e,c,t){e instanceof a?e.set_object_at(c,t):e[c]=t}},{key:"_swap",value:function(e,c,t){var i=this._get(e,c);this._set(e,c,this._get(e,t)),this._set(e,t,i)}},{key:"_defaultCompareFunction",value:function(e,c){return c>e}}]),n})();E.exports=r}),(function(E,w,N){"use strict";function u(){}u.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var a=Math.min(this.m,this.n);this.s=(function(Dt){for(var Nt=[];Dt-- >0;)Nt.push(0);return Nt})(Math.min(this.m+1,this.n)),this.U=(function(Dt){var Nt=function $t(Rt){if(Rt.length==0)return 0;for(var Xt=[],zt=0;zt<Rt[0];zt++)Xt.push($t(Rt.slice(1)));return Xt};return Nt(Dt)})([this.m,a]),this.V=(function(Dt){var Nt=function $t(Rt){if(Rt.length==0)return 0;for(var Xt=[],zt=0;zt<Rt[0];zt++)Xt.push($t(Rt.slice(1)));return Xt};return Nt(Dt)})([this.n,this.n]);for(var r=(function(Dt){for(var Nt=[];Dt-- >0;)Nt.push(0);return Nt})(this.n),n=(function(Dt){for(var Nt=[];Dt-- >0;)Nt.push(0);return Nt})(this.m),f=!0,e=!0,c=Math.min(this.m-1,this.n),t=Math.max(0,Math.min(this.n-2,this.m)),i=0;i<Math.max(c,t);i++){if(i<c){this.s[i]=0;for(var h=i;h<this.m;h++)this.s[i]=u.hypot(this.s[i],l[h][i]);if(this.s[i]!==0){l[i][i]<0&&(this.s[i]=-this.s[i]);for(var g=i;g<this.m;g++)l[g][i]/=this.s[i];l[i][i]+=1}this.s[i]=-this.s[i]}for(var s=i+1;s<this.n;s++){if((function(Dt,Nt){return Dt&&Nt})(i<c,this.s[i]!==0)){for(var L=0,y=i;y<this.m;y++)L+=l[y][i]*l[y][s];L=-L/l[i][i];for(var p=i;p<this.m;p++)l[p][s]+=L*l[p][i]}r[s]=l[i][s]}if((function(Dt,Nt){return Dt&&Nt})(f,i<c))for(var C=i;C<this.m;C++)this.U[C][i]=l[C][i];if(i<t){r[i]=0;for(var R=i+1;R<this.n;R++)r[i]=u.hypot(r[i],r[R]);if(r[i]!==0){r[i+1]<0&&(r[i]=-r[i]);for(var A=i+1;A<this.n;A++)r[A]/=r[i];r[i+1]+=1}if(r[i]=-r[i],(function(Dt,Nt){return Dt&&Nt})(i+1<this.m,r[i]!==0)){for(var b=i+1;b<this.m;b++)n[b]=0;for(var W=i+1;W<this.n;W++)for(var G=i+1;G<this.m;G++)n[G]+=r[W]*l[G][W];for(var J=i+1;J<this.n;J++)for(var x=-r[J]/r[i+1],z=i+1;z<this.m;z++)l[z][J]+=x*n[z]}if(e)for(var o=i+1;o<this.n;o++)this.V[o][i]=r[o]}}var m=Math.min(this.n,this.m+1);if(c<this.n&&(this.s[c]=l[c][c]),this.m<m&&(this.s[m-1]=0),t+1<m&&(r[t]=l[t][m-1]),r[m-1]=0,f){for(var d=c;d<a;d++){for(var T=0;T<this.m;T++)this.U[T][d]=0;this.U[d][d]=1}for(var v=c-1;v>=0;v--)if(this.s[v]!==0){for(var D=v+1;D<a;D++){for(var O=0,P=v;P<this.m;P++)O+=this.U[P][v]*this.U[P][D];O=-O/this.U[v][v];for(var S=v;S<this.m;S++)this.U[S][D]+=O*this.U[S][v]}for(var I=v;I<this.m;I++)this.U[I][v]=-this.U[I][v];this.U[v][v]=1+this.U[v][v];for(var Z=0;Z<v-1;Z++)this.U[Z][v]=0}else{for(var tt=0;tt<this.m;tt++)this.U[tt][v]=0;this.U[v][v]=1}}if(e)for(var F=this.n-1;F>=0;F--){if((function(Dt,Nt){return Dt&&Nt})(F<t,r[F]!==0))for(var _=F+1;_<a;_++){for(var B=0,M=F+1;M<this.n;M++)B+=this.V[M][F]*this.V[M][_];B=-B/this.V[F+1][F];for(var Y=F+1;Y<this.n;Y++)this.V[Y][_]+=B*this.V[Y][F]}for(var X=0;X<this.n;X++)this.V[X][F]=0;this.V[F][F]=1}for(var K=m-1,st=0,Lt=Math.pow(2,-52),St=Math.pow(2,-966);m>0;){var Q=void 0,Ut=void 0;for(Q=m-2;Q>=-1&&Q!==-1;Q--)if(Math.abs(r[Q])<=St+Lt*(Math.abs(this.s[Q])+Math.abs(this.s[Q+1]))){r[Q]=0;break}if(Q===m-2)Ut=4;else{var Mt=void 0;for(Mt=m-1;Mt>=Q&&Mt!==Q;Mt--){var at=(Mt!==m?Math.abs(r[Mt]):0)+(Mt!==Q+1?Math.abs(r[Mt-1]):0);if(Math.abs(this.s[Mt])<=St+Lt*at){this.s[Mt]=0;break}}Mt===Q?Ut=3:Mt===m-1?Ut=1:(Ut=2,Q=Mt)}switch(Q++,Ut){case 1:{var et=r[m-2];r[m-2]=0;for(var pt=m-2;pt>=Q;pt--){var mt=u.hypot(this.s[pt],et),Ct=this.s[pt]/mt,Et=et/mt;if(this.s[pt]=mt,pt!==Q&&(et=-Et*r[pt-1],r[pt-1]=Ct*r[pt-1]),e)for(var Tt=0;Tt<this.n;Tt++)mt=Ct*this.V[Tt][pt]+Et*this.V[Tt][m-1],this.V[Tt][m-1]=-Et*this.V[Tt][pt]+Ct*this.V[Tt][m-1],this.V[Tt][pt]=mt}}break;case 2:{var Ot=r[Q-1];r[Q-1]=0;for(var It=Q;It<m;It++){var Wt=u.hypot(this.s[It],Ot),Pt=this.s[It]/Wt,Yt=Ot/Wt;if(this.s[It]=Wt,Ot=-Yt*r[It],r[It]=Pt*r[It],f)for(var bt=0;bt<this.m;bt++)Wt=Pt*this.U[bt][It]+Yt*this.U[bt][Q-1],this.U[bt][Q-1]=-Yt*this.U[bt][It]+Pt*this.U[bt][Q-1],this.U[bt][It]=Wt}}break;case 3:{var U=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[m-1]),Math.abs(this.s[m-2])),Math.abs(r[m-2])),Math.abs(this.s[Q])),Math.abs(r[Q])),H=this.s[m-1]/U,V=this.s[m-2]/U,$=r[m-2]/U,k=this.s[Q]/U,j=r[Q]/U,ut=((V+H)*(V-H)+$*$)/2,ft=H*$*(H*$),q=0;(function(Dt,Nt){return Dt||Nt})(ut!==0,ft!==0)&&(q=Math.sqrt(ut*ut+ft),ut<0&&(q=-q),q=ft/(ut+q));for(var ht=(k+H)*(k-H)+q,gt=k*j,rt=Q;rt<m-1;rt++){var vt=u.hypot(ht,gt),At=ht/vt,ot=gt/vt;if(rt!==Q&&(r[rt-1]=vt),ht=At*this.s[rt]+ot*r[rt],r[rt]=At*r[rt]-ot*this.s[rt],gt=ot*this.s[rt+1],this.s[rt+1]=At*this.s[rt+1],e)for(var it=0;it<this.n;it++)vt=At*this.V[it][rt]+ot*this.V[it][rt+1],this.V[it][rt+1]=-ot*this.V[it][rt]+At*this.V[it][rt+1],this.V[it][rt]=vt;if(vt=u.hypot(ht,gt),At=ht/vt,ot=gt/vt,this.s[rt]=vt,ht=At*r[rt]+ot*this.s[rt+1],this.s[rt+1]=-ot*r[rt]+At*this.s[rt+1],gt=ot*r[rt+1],r[rt+1]=At*r[rt+1],f&&rt<this.m-1)for(var dt=0;dt<this.m;dt++)vt=At*this.U[dt][rt]+ot*this.U[dt][rt+1],this.U[dt][rt+1]=-ot*this.U[dt][rt]+At*this.U[dt][rt+1],this.U[dt][rt]=vt}r[m-2]=ht,st=st+1}break;case 4:{if(this.s[Q]<=0&&(this.s[Q]=this.s[Q]<0?-this.s[Q]:0,e))for(var nt=0;nt<=K;nt++)this.V[nt][Q]=-this.V[nt][Q];for(;Q<K&&!(this.s[Q]>=this.s[Q+1]);){var lt=this.s[Q];if(this.s[Q]=this.s[Q+1],this.s[Q+1]=lt,e&&Q<this.n-1)for(var Ft=0;Ft<this.n;Ft++)lt=this.V[Ft][Q+1],this.V[Ft][Q+1]=this.V[Ft][Q],this.V[Ft][Q]=lt;if(f&&Q<this.m-1)for(var xt=0;xt<this.m;xt++)lt=this.U[xt][Q+1],this.U[xt][Q+1]=this.U[xt][Q],this.U[xt][Q]=lt;Q++}st=0,m--}break}}var Vt={U:this.U,V:this.V,S:this.s};return Vt},u.hypot=function(l,a){var r=void 0;return Math.abs(l)>Math.abs(a)?(r=a/l,r=Math.abs(l)*Math.sqrt(1+r*r)):a!=0?(r=l/a,r=Math.abs(a)*Math.sqrt(1+r*r)):r=0,r},E.exports=u}),(function(E,w,N){"use strict";var u=(function(){function r(n,f){for(var e=0;e<f.length;e++){var c=f[e];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(n,c.key,c)}}return function(n,f,e){return f&&r(n.prototype,f),e&&r(n,e),n}})();function l(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var a=(function(){function r(n,f){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,r),this.sequence1=n,this.sequence2=f,this.match_score=e,this.mismatch_penalty=c,this.gap_penalty=t,this.iMax=n.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var i=0;i<this.iMax;i++){this.grid[i]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[i][h]=0}this.tracebackGrid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.tracebackGrid[g]=new Array(this.jMax);for(var s=0;s<this.jMax;s++)this.tracebackGrid[g][s]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return u(r,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var c=1;c<this.iMax;c++)for(var t=1;t<this.jMax;t++){var i=void 0;this.sequence1[c-1]===this.sequence2[t-1]?i=this.grid[c-1][t-1]+this.match_score:i=this.grid[c-1][t-1]+this.mismatch_penalty;var h=this.grid[c-1][t]+this.gap_penalty,g=this.grid[c][t-1]+this.gap_penalty,s=[i,h,g],L=this.arrayAllMaxIndexes(s);this.grid[c][t]=s[L[0]],this.tracebackGrid[c][t]=[L.includes(0),L.includes(1),L.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var e=f[0],c=this.tracebackGrid[e.pos[0]][e.pos[1]];c[0]&&f.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),c[1]&&f.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),c[2]&&f.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),e.pos[0]===0&&e.pos[1]===0&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,e){for(var c=[],t=-1;(t=f.indexOf(e,t+1))!==-1;)c.push(t);return c}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),r})();E.exports=a}),(function(E,w,N){"use strict";var u=function(){};u.FDLayout=N(18),u.FDLayoutConstants=N(4),u.FDLayoutEdge=N(19),u.FDLayoutNode=N(20),u.DimensionD=N(21),u.HashMap=N(22),u.HashSet=N(23),u.IGeometry=N(8),u.IMath=N(9),u.Integer=N(10),u.Point=N(12),u.PointD=N(5),u.RandomSeed=N(16),u.RectangleD=N(13),u.Transform=N(17),u.UniqueIDGeneretor=N(14),u.Quicksort=N(25),u.LinkedList=N(11),u.LGraphObject=N(2),u.LGraph=N(6),u.LEdge=N(1),u.LGraphManager=N(7),u.LNode=N(3),u.Layout=N(15),u.LayoutConstants=N(0),u.NeedlemanWunsch=N(27),u.Matrix=N(24),u.SVD=N(26),E.exports=u}),(function(E,w,N){"use strict";function u(){this.listeners=[]}var l=u.prototype;l.addListener=function(a,r){this.listeners.push({event:a,callback:r})},l.removeListener=function(a,r){for(var n=this.listeners.length;n>=0;n--){var f=this.listeners[n];f.event===a&&f.callback===r&&this.listeners.splice(n,1)}},l.emit=function(a,r){for(var n=0;n<this.listeners.length;n++){var f=this.listeners[n];a===f.event&&f.callback(r)}},E.exports=u})])})});var Le=pe((ie,Ne)=>{(function(w,N){typeof ie=="object"&&typeof Ne=="object"?Ne.exports=N(Te()):typeof define=="function"&&define.amd?define(["layout-base"],N):typeof ie=="object"?ie.coseBase=N(Te()):w.coseBase=N(w.layoutBase)})(ie,function(E){return(()=>{"use strict";var w={45:((a,r,n)=>{var f={};f.layoutBase=n(551),f.CoSEConstants=n(806),f.CoSEEdge=n(767),f.CoSEGraph=n(880),f.CoSEGraphManager=n(578),f.CoSELayout=n(765),f.CoSENode=n(991),f.ConstraintHandler=n(902),a.exports=f}),806:((a,r,n)=>{var f=n(551).FDLayoutConstants;function e(){}for(var c in f)e[c]=f[c];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,a.exports=e}),767:((a,r,n)=>{var f=n(551).FDLayoutEdge;function e(t,i,h){f.call(this,t,i,h)}e.prototype=Object.create(f.prototype);for(var c in f)e[c]=f[c];a.exports=e}),880:((a,r,n)=>{var f=n(551).LGraph;function e(t,i,h){f.call(this,t,i,h)}e.prototype=Object.create(f.prototype);for(var c in f)e[c]=f[c];a.exports=e}),578:((a,r,n)=>{var f=n(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var c in f)e[c]=f[c];a.exports=e}),765:((a,r,n)=>{var f=n(551).FDLayout,e=n(578),c=n(880),t=n(991),i=n(767),h=n(806),g=n(902),s=n(551).FDLayoutConstants,L=n(551).LayoutConstants,y=n(551).Point,p=n(551).PointD,C=n(551).DimensionD,R=n(551).Layout,A=n(551).Integer,b=n(551).IGeometry,W=n(551).LGraph,G=n(551).Transform,J=n(551).LinkedList;function x(){f.call(this),this.toBeTiled={},this.constraints={}}x.prototype=Object.create(f.prototype);for(var z in f)x[z]=f[z];x.prototype.newGraphManager=function(){var o=new e(this);return this.graphManager=o,o},x.prototype.newGraph=function(o){return new c(null,this.graphManager,o)},x.prototype.newNode=function(o){return new t(this.graphManager,o)},x.prototype.newEdge=function(o){return new i(null,null,o)},x.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=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/s.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){var o=L.DEFAULT_CREATE_BENDS_AS_NEEDED;return o&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.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 m=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(D){return m.has(D)});this.graphManager.setAllNodesToApplyGravitation(d)}}else{var o=this.getFlatForest();if(o.length>0)this.positionNodesRadially(o);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(T){return m.has(T)});this.graphManager.setAllNodesToApplyGravitation(d),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(g.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},x.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%s.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 o=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(v){return o.has(v)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=s.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=s.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=s.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},x.prototype.getPositionsData=function(){for(var o=this.graphManager.getAllNodes(),m={},d=0;d<o.length;d++){var T=o[d].rect,v=o[d].id;m[v]={id:v,x:T.getCenterX(),y:T.getCenterY(),w:T.width,h:T.height}}return m},x.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var o=!1;if(s.ANIMATE==="during")this.emit("layoutstarted");else{for(;!o;)o=this.tick();this.graphManager.updateBounds()}},x.prototype.moveNodes=function(){for(var o=this.getAllNodes(),m,d=0;d<o.length;d++)m=o[d],m.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var d=0;d<o.length;d++)m=o[d],m.move()},x.prototype.initConstraintVariables=function(){var o=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var m=this.graphManager.getAllNodes(),d=0;d<m.length;d++){var T=m[d];this.idToNodeMap.set(T.id,T)}var v=function M(Y){for(var X=Y.getChild().getNodes(),K,st=0,Lt=0;Lt<X.length;Lt++)K=X[Lt],K.getChild()==null?o.fixedNodeSet.has(K.id)&&(st+=100):st+=M(K);return st};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(X){o.fixedNodeSet.add(X.nodeId)});for(var m=this.graphManager.getAllNodes(),T,d=0;d<m.length;d++)if(T=m[d],T.getChild()!=null){var D=v(T);D>0&&(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(M){o.fixedNodesOnHorizontal.add(M),o.fixedNodesOnVertical.add(M)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var S=this.constraints.alignmentConstraint.vertical,d=0;d<S.length;d++)this.dummyToNodeForVerticalAlignment.set("dummy"+d,[]),S[d].forEach(function(Y){O.set(Y,"dummy"+d),o.dummyToNodeForVerticalAlignment.get("dummy"+d).push(Y),o.fixedNodeSet.has(Y)&&o.fixedNodesOnHorizontal.add("dummy"+d)});if(this.constraints.alignmentConstraint.horizontal)for(var I=this.constraints.alignmentConstraint.horizontal,d=0;d<I.length;d++)this.dummyToNodeForHorizontalAlignment.set("dummy"+d,[]),I[d].forEach(function(Y){P.set(Y,"dummy"+d),o.dummyToNodeForHorizontalAlignment.get("dummy"+d).push(Y),o.fixedNodeSet.has(Y)&&o.fixedNodesOnVertical.add("dummy"+d)})}if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(M){var Y,X,K;for(K=M.length-1;K>=2*M.length/3;K--)Y=Math.floor(Math.random()*(K+1)),X=M[K],M[K]=M[Y],M[Y]=X;return M},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(M){if(M.left){var Y=O.has(M.left)?O.get(M.left):M.left,X=O.has(M.right)?O.get(M.right):M.right;o.nodesInRelativeHorizontal.includes(Y)||(o.nodesInRelativeHorizontal.push(Y),o.nodeToRelativeConstraintMapHorizontal.set(Y,[]),o.dummyToNodeForVerticalAlignment.has(Y)?o.nodeToTempPositionMapHorizontal.set(Y,o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(Y)[0]).getCenterX()):o.nodeToTempPositionMapHorizontal.set(Y,o.idToNodeMap.get(Y).getCenterX())),o.nodesInRelativeHorizontal.includes(X)||(o.nodesInRelativeHorizontal.push(X),o.nodeToRelativeConstraintMapHorizontal.set(X,[]),o.dummyToNodeForVerticalAlignment.has(X)?o.nodeToTempPositionMapHorizontal.set(X,o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):o.nodeToTempPositionMapHorizontal.set(X,o.idToNodeMap.get(X).getCenterX())),o.nodeToRelativeConstraintMapHorizontal.get(Y).push({right:X,gap:M.gap}),o.nodeToRelativeConstraintMapHorizontal.get(X).push({left:Y,gap:M.gap})}else{var K=P.has(M.top)?P.get(M.top):M.top,st=P.has(M.bottom)?P.get(M.bottom):M.bottom;o.nodesInRelativeVertical.includes(K)||(o.nodesInRelativeVertical.push(K),o.nodeToRelativeConstraintMapVertical.set(K,[]),o.dummyToNodeForHorizontalAlignment.has(K)?o.nodeToTempPositionMapVertical.set(K,o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(K)[0]).getCenterY()):o.nodeToTempPositionMapVertical.set(K,o.idToNodeMap.get(K).getCenterY())),o.nodesInRelativeVertical.includes(st)||(o.nodesInRelativeVertical.push(st),o.nodeToRelativeConstraintMapVertical.set(st,[]),o.dummyToNodeForHorizontalAlignment.has(st)?o.nodeToTempPositionMapVertical.set(st,o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(st)[0]).getCenterY()):o.nodeToTempPositionMapVertical.set(st,o.idToNodeMap.get(st).getCenterY())),o.nodeToRelativeConstraintMapVertical.get(K).push({bottom:st,gap:M.gap}),o.nodeToRelativeConstraintMapVertical.get(st).push({top:K,gap:M.gap})}});else{var Z=new Map,tt=new Map;this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var Y=O.has(M.left)?O.get(M.left):M.left,X=O.has(M.right)?O.get(M.right):M.right;Z.has(Y)?Z.get(Y).push(X):Z.set(Y,[X]),Z.has(X)?Z.get(X).push(Y):Z.set(X,[Y])}else{var K=P.has(M.top)?P.get(M.top):M.top,st=P.has(M.bottom)?P.get(M.bottom):M.bottom;tt.has(K)?tt.get(K).push(st):tt.set(K,[st]),tt.has(st)?tt.get(st).push(K):tt.set(st,[K])}});var F=function(Y,X){var K=[],st=[],Lt=new J,St=new Set,Q=0;return Y.forEach(function(Ut,Mt){if(!St.has(Mt)){K[Q]=[],st[Q]=!1;var at=Mt;for(Lt.push(at),St.add(at),K[Q].push(at);Lt.length!=0;){at=Lt.shift(),X.has(at)&&(st[Q]=!0);var et=Y.get(at);et.forEach(function(pt){St.has(pt)||(Lt.push(pt),St.add(pt),K[Q].push(pt))})}Q++}}),{components:K,isFixed:st}},_=F(Z,o.fixedNodesOnHorizontal);this.componentsOnHorizontal=_.components,this.fixedComponentsOnHorizontal=_.isFixed;var B=F(tt,o.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},x.prototype.updateDisplacements=function(){var o=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var M=o.idToNodeMap.get(B.nodeId);M.displacementX=0,M.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,d=0;d<m.length;d++){for(var T=0,v=0;v<m[d].length;v++){if(this.fixedNodeSet.has(m[d][v])){T=0;break}T+=this.idToNodeMap.get(m[d][v]).displacementX}for(var D=T/m[d].length,v=0;v<m[d].length;v++)this.idToNodeMap.get(m[d][v]).displacementX=D}if(this.constraints.alignmentConstraint.horizontal)for(var O=this.constraints.alignmentConstraint.horizontal,d=0;d<O.length;d++){for(var P=0,v=0;v<O[d].length;v++){if(this.fixedNodeSet.has(O[d][v])){P=0;break}P+=this.idToNodeMap.get(O[d][v]).displacementY}for(var S=P/O[d].length,v=0;v<O[d].length;v++)this.idToNodeMap.get(O[d][v]).displacementY=S}}if(this.constraints.relativePlacementConstraint)if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(B){if(!o.fixedNodesOnHorizontal.has(B)){var M=0;o.dummyToNodeForVerticalAlignment.has(B)?M=o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(B)[0]).displacementX:M=o.idToNodeMap.get(B).displacementX,o.nodeToRelativeConstraintMapHorizontal.get(B).forEach(function(Y){if(Y.right){var X=o.nodeToTempPositionMapHorizontal.get(Y.right)-o.nodeToTempPositionMapHorizontal.get(B)-M;X<Y.gap&&(M-=Y.gap-X)}else{var X=o.nodeToTempPositionMapHorizontal.get(B)-o.nodeToTempPositionMapHorizontal.get(Y.left)+M;X<Y.gap&&(M+=Y.gap-X)}}),o.nodeToTempPositionMapHorizontal.set(B,o.nodeToTempPositionMapHorizontal.get(B)+M),o.dummyToNodeForVerticalAlignment.has(B)?o.dummyToNodeForVerticalAlignment.get(B).forEach(function(Y){o.idToNodeMap.get(Y).displacementX=M}):o.idToNodeMap.get(B).displacementX=M}}),this.nodesInRelativeVertical.forEach(function(B){if(!o.fixedNodesOnHorizontal.has(B)){var M=0;o.dummyToNodeForHorizontalAlignment.has(B)?M=o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(B)[0]).displacementY:M=o.idToNodeMap.get(B).displacementY,o.nodeToRelativeConstraintMapVertical.get(B).forEach(function(Y){if(Y.bottom){var X=o.nodeToTempPositionMapVertical.get(Y.bottom)-o.nodeToTempPositionMapVertical.get(B)-M;X<Y.gap&&(M-=Y.gap-X)}else{var X=o.nodeToTempPositionMapVertical.get(B)-o.nodeToTempPositionMapVertical.get(Y.top)+M;X<Y.gap&&(M+=Y.gap-X)}}),o.nodeToTempPositionMapVertical.set(B,o.nodeToTempPositionMapVertical.get(B)+M),o.dummyToNodeForHorizontalAlignment.has(B)?o.dummyToNodeForHorizontalAlignment.get(B).forEach(function(Y){o.idToNodeMap.get(Y).displacementY=M}):o.idToNodeMap.get(B).displacementY=M}});else{for(var d=0;d<this.componentsOnHorizontal.length;d++){var I=this.componentsOnHorizontal[d];if(this.fixedComponentsOnHorizontal[d])for(var v=0;v<I.length;v++)this.dummyToNodeForVerticalAlignment.has(I[v])?this.dummyToNodeForVerticalAlignment.get(I[v]).forEach(function(Y){o.idToNodeMap.get(Y).displacementX=0}):this.idToNodeMap.get(I[v]).displacementX=0;else{for(var Z=0,tt=0,v=0;v<I.length;v++)if(this.dummyToNodeForVerticalAlignment.has(I[v])){var F=this.dummyToNodeForVerticalAlignment.get(I[v]);Z+=F.length*this.idToNodeMap.get(F[0]).displacementX,tt+=F.length}else Z+=this.idToNodeMap.get(I[v]).displacementX,tt++;for(var _=Z/tt,v=0;v<I.length;v++)this.dummyToNodeForVerticalAlignment.has(I[v])?this.dummyToNodeForVerticalAlignment.get(I[v]).forEach(function(Y){o.idToNodeMap.get(Y).displacementX=_}):this.idToNodeMap.get(I[v]).displacementX=_}}for(var d=0;d<this.componentsOnVertical.length;d++){var I=this.componentsOnVertical[d];if(this.fixedComponentsOnVertical[d])for(var v=0;v<I.length;v++)this.dummyToNodeForHorizontalAlignment.has(I[v])?this.dummyToNodeForHorizontalAlignment.get(I[v]).forEach(function(X){o.idToNodeMap.get(X).displacementY=0}):this.idToNodeMap.get(I[v]).displacementY=0;else{for(var Z=0,tt=0,v=0;v<I.length;v++)if(this.dummyToNodeForHorizontalAlignment.has(I[v])){var F=this.dummyToNodeForHorizontalAlignment.get(I[v]);Z+=F.length*this.idToNodeMap.get(F[0]).displacementY,tt+=F.length}else Z+=this.idToNodeMap.get(I[v]).displacementY,tt++;for(var _=Z/tt,v=0;v<I.length;v++)this.dummyToNodeForHorizontalAlignment.has(I[v])?this.dummyToNodeForHorizontalAlignment.get(I[v]).forEach(function(Lt){o.idToNodeMap.get(Lt).displacementY=_}):this.idToNodeMap.get(I[v]).displacementY=_}}}},x.prototype.calculateNodesToApplyGravitationTo=function(){var o=[],m,d=this.graphManager.getGraphs(),T=d.length,v;for(v=0;v<T;v++)m=d[v],m.updateConnected(),m.isConnected||(o=o.concat(m.getNodes()));return o},x.prototype.createBendpoints=function(){var o=[];o=o.concat(this.graphManager.getAllEdges());var m=new Set,d;for(d=0;d<o.length;d++){var T=o[d];if(!m.has(T)){var v=T.getSource(),D=T.getTarget();if(v==D)T.getBendpoints().push(new p),T.getBendpoints().push(new p),this.createDummyNodesForBendpoints(T),m.add(T);else{var O=[];if(O=O.concat(v.getEdgeListToNode(D)),O=O.concat(D.getEdgeListToNode(v)),!m.has(O[0])){if(O.length>1){var P;for(P=0;P<O.length;P++){var S=O[P];S.getBendpoints().push(new p),this.createDummyNodesForBendpoints(S)}}O.forEach(function(I){m.add(I)})}}}if(m.size==o.length)break}},x.prototype.positionNodesRadially=function(o){for(var m=new y(0,0),d=Math.ceil(Math.sqrt(o.length)),T=0,v=0,D=0,O=new p(0,0),P=0;P<o.length;P++){P%d==0&&(D=0,v=T,P!=0&&(v+=h.DEFAULT_COMPONENT_SEPERATION),T=0);var S=o[P],I=R.findCenterOfTree(S);m.x=D,m.y=v,O=x.radialLayout(S,I,m),O.y>T&&(T=Math.floor(O.y)),D=Math.floor(O.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(L.WORLD_CENTER_X-O.x/2,L.WORLD_CENTER_Y-O.y/2))},x.radialLayout=function(o,m,d){var T=Math.max(this.maxDiagonalInTree(o),h.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(m,null,0,359,0,T);var v=W.calculateBounds(o),D=new G;D.setDeviceOrgX(v.getMinX()),D.setDeviceOrgY(v.getMinY()),D.setWorldOrgX(d.x),D.setWorldOrgY(d.y);for(var O=0;O<o.length;O++){var P=o[O];P.transform(D)}var S=new p(v.getMaxX(),v.getMaxY());return D.inverseTransformPoint(S)},x.branchRadialLayout=function(o,m,d,T,v,D){var O=(T-d+1)/2;O<0&&(O+=180);var P=(O+d)%360,S=P*b.TWO_PI/360,I=Math.cos(S),Z=v*Math.cos(S),tt=v*Math.sin(S);o.setCenter(Z,tt);var F=[];F=F.concat(o.getEdges());var _=F.length;m!=null&&_--;for(var B=0,M=F.length,Y,X=o.getEdgesBetween(m);X.length>1;){var K=X[0];X.splice(0,1);var st=F.indexOf(K);st>=0&&F.splice(st,1),M--,_--}m!=null?Y=(F.indexOf(X[0])+1)%M:Y=0;for(var Lt=Math.abs(T-d)/_,St=Y;B!=_;St=++St%M){var Q=F[St].getOtherEnd(o);if(Q!=m){var Ut=(d+B*Lt)%360,Mt=(Ut+Lt)%360;x.branchRadialLayout(Q,o,Ut,Mt,v+D,D),B++}}},x.maxDiagonalInTree=function(o){for(var m=A.MIN_VALUE,d=0;d<o.length;d++){var T=o[d],v=T.getDiagonal();v>m&&(m=v)}return m},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var o=this,m={};this.memberGroups={},this.idToDummyNode={};for(var d=[],T=this.graphManager.getAllNodes(),v=0;v<T.length;v++){var D=T[v],O=D.getParent();this.getNodeDegreeWithChildren(D)===0&&(O.id==null||!this.getToBeTiled(O))&&d.push(D)}for(var v=0;v<d.length;v++){var D=d[v],P=D.getParent().id;typeof m[P]>"u"&&(m[P]=[]),m[P]=m[P].concat(D)}Object.keys(m).forEach(function(S){if(m[S].length>1){var I="DummyCompound_"+S;o.memberGroups[I]=m[S];var Z=m[S][0].getParent(),tt=new t(o.graphManager);tt.id=I,tt.paddingLeft=Z.paddingLeft||0,tt.paddingRight=Z.paddingRight||0,tt.paddingBottom=Z.paddingBottom||0,tt.paddingTop=Z.paddingTop||0,o.idToDummyNode[I]=tt;var F=o.getGraphManager().add(o.newGraph(),tt),_=Z.getChild();_.add(tt);for(var B=0;B<m[S].length;B++){var M=m[S][B];_.remove(M),F.add(M)}}})},x.prototype.clearCompounds=function(){var o={},m={};this.performDFSOnCompounds();for(var d=0;d<this.compoundOrder.length;d++)m[this.compoundOrder[d].id]=this.compoundOrder[d],o[this.compoundOrder[d].id]=[].concat(this.compoundOrder[d].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[d].getChild()),this.compoundOrder[d].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(o,m)},x.prototype.clearZeroDegreeMembers=function(){var o=this,m=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(d){var T=o.idToDummyNode[d];if(m[d]=o.tileNodes(o.memberGroups[d],T.paddingLeft+T.paddingRight),T.rect.width=m[d].width,T.rect.height=m[d].height,T.setCenter(m[d].centerX,m[d].centerY),T.labelMarginLeft=0,T.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var v=T.rect.width,D=T.rect.height;T.labelWidth&&(T.labelPosHorizontal=="left"?(T.rect.x-=T.labelWidth,T.setWidth(v+T.labelWidth),T.labelMarginLeft=T.labelWidth):T.labelPosHorizontal=="center"&&T.labelWidth>v?(T.rect.x-=(T.labelWidth-v)/2,T.setWidth(T.labelWidth),T.labelMarginLeft=(T.labelWidth-v)/2):T.labelPosHorizontal=="right"&&T.setWidth(v+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))}})},x.prototype.repopulateCompounds=function(){for(var o=this.compoundOrder.length-1;o>=0;o--){var m=this.compoundOrder[o],d=m.id,T=m.paddingLeft,v=m.paddingTop,D=m.labelMarginLeft,O=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[d],m.rect.x,m.rect.y,T,v,D,O)}},x.prototype.repopulateZeroDegreeMembers=function(){var o=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(d){var T=o.idToDummyNode[d],v=T.paddingLeft,D=T.paddingTop,O=T.labelMarginLeft,P=T.labelMarginTop;o.adjustLocations(m[d],T.rect.x,T.rect.y,v,D,O,P)})},x.prototype.getToBeTiled=function(o){var m=o.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var d=o.getChild();if(d==null)return this.toBeTiled[m]=!1,!1;for(var T=d.getNodes(),v=0;v<T.length;v++){var D=T[v];if(this.getNodeDegree(D)>0)return this.toBeTiled[m]=!1,!1;if(D.getChild()==null){this.toBeTiled[D.id]=!1;continue}if(!this.getToBeTiled(D))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},x.prototype.getNodeDegree=function(o){for(var m=o.id,d=o.getEdges(),T=0,v=0;v<d.length;v++){var D=d[v];D.getSource().id!==D.getTarget().id&&(T=T+1)}return T},x.prototype.getNodeDegreeWithChildren=function(o){var m=this.getNodeDegree(o);if(o.getChild()==null)return m;for(var d=o.getChild().getNodes(),T=0;T<d.length;T++){var v=d[T];m+=this.getNodeDegreeWithChildren(v)}return m},x.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},x.prototype.fillCompexOrderByDFS=function(o){for(var m=0;m<o.length;m++){var d=o[m];d.getChild()!=null&&this.fillCompexOrderByDFS(d.getChild().getNodes()),this.getToBeTiled(d)&&this.compoundOrder.push(d)}},x.prototype.adjustLocations=function(o,m,d,T,v,D,O){m+=T+D,d+=v+O;for(var P=m,S=0;S<o.rows.length;S++){var I=o.rows[S];m=P;for(var Z=0,tt=0;tt<I.length;tt++){var F=I[tt];F.rect.x=m,F.rect.y=d,m+=F.rect.width+o.horizontalPadding,F.rect.height>Z&&(Z=F.rect.height)}d+=Z+o.verticalPadding}},x.prototype.tileCompoundMembers=function(o,m){var d=this;this.tiledMemberPack=[],Object.keys(o).forEach(function(T){var v=m[T];if(d.tiledMemberPack[T]=d.tileNodes(o[T],v.paddingLeft+v.paddingRight),v.rect.width=d.tiledMemberPack[T].width,v.rect.height=d.tiledMemberPack[T].height,v.setCenter(d.tiledMemberPack[T].centerX,d.tiledMemberPack[T].centerY),v.labelMarginLeft=0,v.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var D=v.rect.width,O=v.rect.height;v.labelWidth&&(v.labelPosHorizontal=="left"?(v.rect.x-=v.labelWidth,v.setWidth(D+v.labelWidth),v.labelMarginLeft=v.labelWidth):v.labelPosHorizontal=="center"&&v.labelWidth>D?(v.rect.x-=(v.labelWidth-D)/2,v.setWidth(v.labelWidth),v.labelMarginLeft=(v.labelWidth-D)/2):v.labelPosHorizontal=="right"&&v.setWidth(D+v.labelWidth)),v.labelHeight&&(v.labelPosVertical=="top"?(v.rect.y-=v.labelHeight,v.setHeight(O+v.labelHeight),v.labelMarginTop=v.labelHeight):v.labelPosVertical=="center"&&v.labelHeight>O?(v.rect.y-=(v.labelHeight-O)/2,v.setHeight(v.labelHeight),v.labelMarginTop=(v.labelHeight-O)/2):v.labelPosVertical=="bottom"&&v.setHeight(O+v.labelHeight))}})},x.prototype.tileNodes=function(o,m){var d=this.tileNodesByFavoringDim(o,m,!0),T=this.tileNodesByFavoringDim(o,m,!1),v=this.getOrgRatio(d),D=this.getOrgRatio(T),O;return D<v?O=T:O=d,O},x.prototype.getOrgRatio=function(o){var m=o.width,d=o.height,T=m/d;return T<1&&(T=1/T),T},x.prototype.calcIdealRowWidth=function(o,m){var d=h.TILING_PADDING_VERTICAL,T=h.TILING_PADDING_HORIZONTAL,v=o.length,D=0,O=0,P=0;o.forEach(function(B){D+=B.getWidth(),O+=B.getHeight(),B.getWidth()>P&&(P=B.getWidth())});var S=D/v,I=O/v,Z=Math.pow(d-T,2)+4*(S+T)*(I+d)*v,tt=(T-d+Math.sqrt(Z))/(2*(S+T)),F;m?(F=Math.ceil(tt),F==tt&&F++):F=Math.floor(tt);var _=F*(S+T)-T;return P>_&&(_=P),_+=T*2,_},x.prototype.tileNodesByFavoringDim=function(o,m,d){var T=h.TILING_PADDING_VERTICAL,v=h.TILING_PADDING_HORIZONTAL,D=h.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:T,horizontalPadding:v,centerX:0,centerY:0};D&&(O.idealRowWidth=this.calcIdealRowWidth(o,d));var P=function(M){return M.rect.width*M.rect.height},S=function(M,Y){return P(Y)-P(M)};o.sort(function(B,M){var Y=S;return O.idealRowWidth?(Y=D,Y(B.id,M.id)):Y(B,M)});for(var I=0,Z=0,tt=0;tt<o.length;tt++){var F=o[tt];I+=F.getCenterX(),Z+=F.getCenterY()}O.centerX=I/o.length,O.centerY=Z/o.length;for(var tt=0;tt<o.length;tt++){var F=o[tt];if(O.rows.length==0)this.insertNodeToRow(O,F,0,m);else if(this.canAddHorizontal(O,F.rect.width,F.rect.height)){var _=O.rows.length-1;O.idealRowWidth||(_=this.getShortestRowIndex(O)),this.insertNodeToRow(O,F,_,m)}else this.insertNodeToRow(O,F,O.rows.length,m);this.shiftToLastRow(O)}return O},x.prototype.insertNodeToRow=function(o,m,d,T){var v=T;if(d==o.rows.length){var D=[];o.rows.push(D),o.rowWidth.push(v),o.rowHeight.push(0)}var O=o.rowWidth[d]+m.rect.width;o.rows[d].length>0&&(O+=o.horizontalPadding),o.rowWidth[d]=O,o.width<O&&(o.width=O);var P=m.rect.height;d>0&&(P+=o.verticalPadding);var S=0;P>o.rowHeight[d]&&(S=o.rowHeight[d],o.rowHeight[d]=P,S=o.rowHeight[d]-S),o.height+=S,o.rows[d].push(m)},x.prototype.getShortestRowIndex=function(o){for(var m=-1,d=Number.MAX_VALUE,T=0;T<o.rows.length;T++)o.rowWidth[T]<d&&(m=T,d=o.rowWidth[T]);return m},x.prototype.getLongestRowIndex=function(o){for(var m=-1,d=Number.MIN_VALUE,T=0;T<o.rows.length;T++)o.rowWidth[T]>d&&(m=T,d=o.rowWidth[T]);return m},x.prototype.canAddHorizontal=function(o,m,d){if(o.idealRowWidth){var T=o.rows.length-1,v=o.rowWidth[T];return v+m+o.horizontalPadding<=o.idealRowWidth}var D=this.getShortestRowIndex(o);if(D<0)return!0;var O=o.rowWidth[D];if(O+o.horizontalPadding+m<=o.width)return!0;var P=0;o.rowHeight[D]<d&&D>0&&(P=d+o.verticalPadding-o.rowHeight[D]);var S;o.width-O>=m+o.horizontalPadding?S=(o.height+P)/(O+m+o.horizontalPadding):S=(o.height+P)/o.width,P=d+o.verticalPadding;var I;return o.width<m?I=(o.height+P)/m:I=(o.height+P)/o.width,I<1&&(I=1/I),S<1&&(S=1/S),S<I},x.prototype.shiftToLastRow=function(o){var m=this.getLongestRowIndex(o),d=o.rowWidth.length-1,T=o.rows[m],v=T[T.length-1],D=v.width+o.horizontalPadding;if(o.width-o.rowWidth[d]>D&&m!=d){T.splice(-1,1),o.rows[d].push(v),o.rowWidth[m]=o.rowWidth[m]-D,o.rowWidth[d]=o.rowWidth[d]+D,o.width=o.rowWidth[instance.getLongestRowIndex(o)];for(var O=Number.MIN_VALUE,P=0;P<T.length;P++)T[P].height>O&&(O=T[P].height);m>0&&(O+=o.verticalPadding);var S=o.rowHeight[m]+o.rowHeight[d];o.rowHeight[m]=O,o.rowHeight[d]<v.height+o.verticalPadding&&(o.rowHeight[d]=v.height+o.verticalPadding);var I=o.rowHeight[m]+o.rowHeight[d];o.height+=I-S,this.shiftToLastRow(o)}},x.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},x.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},x.prototype.reduceTrees=function(){for(var o=[],m=!0,d;m;){var T=this.graphManager.getAllNodes(),v=[];m=!1;for(var D=0;D<T.length;D++)if(d=T[D],d.getEdges().length==1&&!d.getEdges()[0].isInterGraph&&d.getChild()==null){if(h.PURE_INCREMENTAL){var O=d.getEdges()[0].getOtherEnd(d),P=new C(d.getCenterX()-O.getCenterX(),d.getCenterY()-O.getCenterY());v.push([d,d.getEdges()[0],d.getOwner(),P])}else v.push([d,d.getEdges()[0],d.getOwner()]);m=!0}if(m==!0){for(var S=[],I=0;I<v.length;I++)v[I][0].getEdges().length==1&&(S.push(v[I]),v[I][0].getOwner().remove(v[I][0]));o.push(S),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=o},x.prototype.growTree=function(o){for(var m=o.length,d=o[m-1],T,v=0;v<d.length;v++)T=d[v],this.findPlaceforPrunedNode(T),T[2].add(T[0]),T[2].add(T[1],T[1].source,T[1].target);o.splice(o.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},x.prototype.findPlaceforPrunedNode=function(o){var m,d,T=o[0];if(T==o[1].source?d=o[1].target:d=o[1].source,h.PURE_INCREMENTAL)T.setCenter(d.getCenterX()+o[3].getWidth(),d.getCenterY()+o[3].getHeight());else{var v=d.startX,D=d.finishX,O=d.startY,P=d.finishY,S=0,I=0,Z=0,tt=0,F=[S,Z,I,tt];if(O>0)for(var _=v;_<=D;_++)F[0]+=this.grid[_][O-1].length+this.grid[_][O].length-1;if(D<this.grid.length-1)for(var _=O;_<=P;_++)F[1]+=this.grid[D+1][_].length+this.grid[D][_].length-1;if(P<this.grid[0].length-1)for(var _=v;_<=D;_++)F[2]+=this.grid[_][P+1].length+this.grid[_][P].length-1;if(v>0)for(var _=O;_<=P;_++)F[3]+=this.grid[v-1][_].length+this.grid[v][_].length-1;for(var B=A.MAX_VALUE,M,Y,X=0;X<F.length;X++)F[X]<B?(B=F[X],M=1,Y=X):F[X]==B&&M++;if(M==3&&B==0)F[0]==0&&F[1]==0&&F[2]==0?m=1:F[0]==0&&F[1]==0&&F[3]==0?m=0:F[0]==0&&F[2]==0&&F[3]==0?m=3:F[1]==0&&F[2]==0&&F[3]==0&&(m=2);else if(M==2&&B==0){var K=Math.floor(Math.random()*2);F[0]==0&&F[1]==0?K==0?m=0:m=1:F[0]==0&&F[2]==0?K==0?m=0:m=2:F[0]==0&&F[3]==0?K==0?m=0:m=3:F[1]==0&&F[2]==0?K==0?m=1:m=2:F[1]==0&&F[3]==0?K==0?m=1:m=3:K==0?m=2:m=3}else if(M==4&&B==0){var K=Math.floor(Math.random()*4);m=K}else m=Y;m==0?T.setCenter(d.getCenterX(),d.getCenterY()-d.getHeight()/2-s.DEFAULT_EDGE_LENGTH-T.getHeight()/2):m==1?T.setCenter(d.getCenterX()+d.getWidth()/2+s.DEFAULT_EDGE_LENGTH+T.getWidth()/2,d.getCenterY()):m==2?T.setCenter(d.getCenterX(),d.getCenterY()+d.getHeight()/2+s.DEFAULT_EDGE_LENGTH+T.getHeight()/2):T.setCenter(d.getCenterX()-d.getWidth()/2-s.DEFAULT_EDGE_LENGTH-T.getWidth()/2,d.getCenterY())}},a.exports=x}),991:((a,r,n)=>{var f=n(551).FDLayoutNode,e=n(551).IMath;function c(i,h,g,s){f.call(this,i,h,g,s)}c.prototype=Object.create(f.prototype);for(var t in f)c[t]=f[t];c.prototype.calculateDisplacement=function(){var i=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=i.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=i.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=i.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=i.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>i.coolingFactor*i.maxNodeDisplacement&&(this.displacementX=i.coolingFactor*i.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>i.coolingFactor*i.maxNodeDisplacement&&(this.displacementY=i.coolingFactor*i.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},c.prototype.propogateDisplacementToChildren=function(i,h){for(var g=this.getChild().getNodes(),s,L=0;L<g.length;L++)s=g[L],s.getChild()==null?(s.displacementX+=i,s.displacementY+=h):s.propogateDisplacementToChildren(i,h)},c.prototype.move=function(){var i=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),i.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},c.prototype.setPred1=function(i){this.pred1=i},c.prototype.getPred1=function(){return pred1},c.prototype.getPred2=function(){return pred2},c.prototype.setNext=function(i){this.next=i},c.prototype.getNext=function(){return next},c.prototype.setProcessed=function(i){this.processed=i},c.prototype.isProcessed=function(){return processed},a.exports=c}),902:((a,r,n)=>{function f(g){if(Array.isArray(g)){for(var s=0,L=Array(g.length);s<g.length;s++)L[s]=g[s];return L}else return Array.from(g)}var e=n(806),c=n(551).LinkedList,t=n(551).Matrix,i=n(551).SVD;function h(){}h.handleConstraints=function(g){var s={};s.fixedNodeConstraint=g.constraints.fixedNodeConstraint,s.alignmentConstraint=g.constraints.alignmentConstraint,s.relativePlacementConstraint=g.constraints.relativePlacementConstraint;for(var L=new Map,y=new Map,p=[],C=[],R=g.getAllNodes(),A=0,b=0;b<R.length;b++){var W=R[b];W.getChild()==null&&(y.set(W.id,A++),p.push(W.getCenterX()),C.push(W.getCenterY()),L.set(W.id,W))}s.relativePlacementConstraint&&s.relativePlacementConstraint.forEach(function(U){!U.gap&&U.gap!=0&&(U.left?U.gap=e.DEFAULT_EDGE_LENGTH+L.get(U.left).getWidth()/2+L.get(U.right).getWidth()/2:U.gap=e.DEFAULT_EDGE_LENGTH+L.get(U.top).getHeight()/2+L.get(U.bottom).getHeight()/2)});var G=function(H,V){return{x:H.x-V.x,y:H.y-V.y}},J=function(H){var V=0,$=0;return H.forEach(function(k){V+=p[y.get(k)],$+=C[y.get(k)]}),{x:V/H.size,y:$/H.size}},x=function(H,V,$,k,j){function ut(ot,it){var dt=new Set(ot),nt=!0,lt=!1,Ft=void 0;try{for(var xt=it[Symbol.iterator](),Vt;!(nt=(Vt=xt.next()).done);nt=!0){var Dt=Vt.value;dt.add(Dt)}}catch(Nt){lt=!0,Ft=Nt}finally{try{!nt&&xt.return&&xt.return()}finally{if(lt)throw Ft}}return dt}var ft=new Map;H.forEach(function(ot,it){ft.set(it,0)}),H.forEach(function(ot,it){ot.forEach(function(dt){ft.set(dt.id,ft.get(dt.id)+1)})});var q=new Map,ht=new Map,gt=new c;ft.forEach(function(ot,it){ot==0?(gt.push(it),$||(V=="horizontal"?q.set(it,y.has(it)?p[y.get(it)]:k.get(it)):q.set(it,y.has(it)?C[y.get(it)]:k.get(it)))):q.set(it,Number.NEGATIVE_INFINITY),$&&ht.set(it,new Set([it]))}),$&&j.forEach(function(ot){var it=[];if(ot.forEach(function(lt){$.has(lt)&&it.push(lt)}),it.length>0){var dt=0;it.forEach(function(lt){V=="horizontal"?(q.set(lt,y.has(lt)?p[y.get(lt)]:k.get(lt)),dt+=q.get(lt)):(q.set(lt,y.has(lt)?C[y.get(lt)]:k.get(lt)),dt+=q.get(lt))}),dt=dt/it.length,ot.forEach(function(lt){$.has(lt)||q.set(lt,dt)})}else{var nt=0;ot.forEach(function(lt){V=="horizontal"?nt+=y.has(lt)?p[y.get(lt)]:k.get(lt):nt+=y.has(lt)?C[y.get(lt)]:k.get(lt)}),nt=nt/ot.length,ot.forEach(function(lt){q.set(lt,nt)})}});for(var rt=function(){var it=gt.shift(),dt=H.get(it);dt.forEach(function(nt){if(q.get(nt.id)<q.get(it)+nt.gap)if($&&$.has(nt.id)){var lt=void 0;if(V=="horizontal"?lt=y.has(nt.id)?p[y.get(nt.id)]:k.get(nt.id):lt=y.has(nt.id)?C[y.get(nt.id)]:k.get(nt.id),q.set(nt.id,lt),lt<q.get(it)+nt.gap){var Ft=q.get(it)+nt.gap-lt;ht.get(it).forEach(function(xt){q.set(xt,q.get(xt)-Ft)})}}else q.set(nt.id,q.get(it)+nt.gap);ft.set(nt.id,ft.get(nt.id)-1),ft.get(nt.id)==0&>.push(nt.id),$&&ht.set(nt.id,ut(ht.get(it),ht.get(nt.id)))})};gt.length!=0;)rt();if($){var vt=new Set;H.forEach(function(ot,it){ot.length==0&&vt.add(it)});var At=[];ht.forEach(function(ot,it){if(vt.has(it)){var dt=!1,nt=!0,lt=!1,Ft=void 0;try{for(var xt=ot[Symbol.iterator](),Vt;!(nt=(Vt=xt.next()).done);nt=!0){var Dt=Vt.value;$.has(Dt)&&(dt=!0)}}catch(Rt){lt=!0,Ft=Rt}finally{try{!nt&&xt.return&&xt.return()}finally{if(lt)throw Ft}}if(!dt){var Nt=!1,$t=void 0;At.forEach(function(Rt,Xt){Rt.has([].concat(f(ot))[0])&&(Nt=!0,$t=Xt)}),Nt?ot.forEach(function(Rt){At[$t].add(Rt)}):At.push(new Set(ot))}}}),At.forEach(function(ot,it){var dt=Number.POSITIVE_INFINITY,nt=Number.POSITIVE_INFINITY,lt=Number.NEGATIVE_INFINITY,Ft=Number.NEGATIVE_INFINITY,xt=!0,Vt=!1,Dt=void 0;try{for(var Nt=ot[Symbol.iterator](),$t;!(xt=($t=Nt.next()).done);xt=!0){var Rt=$t.value,Xt=void 0;V=="horizontal"?Xt=y.has(Rt)?p[y.get(Rt)]:k.get(Rt):Xt=y.has(Rt)?C[y.get(Rt)]:k.get(Rt);var zt=q.get(Rt);Xt<dt&&(dt=Xt),Xt>lt&&(lt=Xt),zt<nt&&(nt=zt),zt>Ft&&(Ft=zt)}}catch(_t){Vt=!0,Dt=_t}finally{try{!xt&&Nt.return&&Nt.return()}finally{if(Vt)throw Dt}}var ce=(dt+lt)/2-(nt+Ft)/2,qt=!0,Jt=!1,Kt=void 0;try{for(var Qt=ot[Symbol.iterator](),oe;!(qt=(oe=Qt.next()).done);qt=!0){var jt=oe.value;q.set(jt,q.get(jt)+ce)}}catch(_t){Jt=!0,Kt=_t}finally{try{!qt&&Qt.return&&Qt.return()}finally{if(Jt)throw Kt}}})}return q},z=function(H){var V=0,$=0,k=0,j=0;if(H.forEach(function(ht){ht.left?p[y.get(ht.left)]-p[y.get(ht.right)]>=0?V++:$++:C[y.get(ht.top)]-C[y.get(ht.bottom)]>=0?k++:j++}),V>$&&k>j)for(var ut=0;ut<y.size;ut++)p[ut]=-1*p[ut],C[ut]=-1*C[ut];else if(V>$)for(var ft=0;ft<y.size;ft++)p[ft]=-1*p[ft];else if(k>j)for(var q=0;q<y.size;q++)C[q]=-1*C[q]},o=function(H){var V=[],$=new c,k=new Set,j=0;return H.forEach(function(ut,ft){if(!k.has(ft)){V[j]=[];var q=ft;for($.push(q),k.add(q),V[j].push(q);$.length!=0;){q=$.shift();var ht=H.get(q);ht.forEach(function(gt){k.has(gt.id)||($.push(gt.id),k.add(gt.id),V[j].push(gt.id))})}j++}}),V},m=function(H){var V=new Map;return H.forEach(function($,k){V.set(k,[])}),H.forEach(function($,k){$.forEach(function(j){V.get(k).push(j),V.get(j.id).push({id:k,gap:j.gap,direction:j.direction})})}),V},d=function(H){var V=new Map;return H.forEach(function($,k){V.set(k,[])}),H.forEach(function($,k){$.forEach(function(j){V.get(j.id).push({id:k,gap:j.gap,direction:j.direction})})}),V},T=[],v=[],D=!1,O=!1,P=new Set,S=new Map,I=new Map,Z=[];if(s.fixedNodeConstraint&&s.fixedNodeConstraint.forEach(function(U){P.add(U.nodeId)}),s.relativePlacementConstraint&&(s.relativePlacementConstraint.forEach(function(U){U.left?(S.has(U.left)?S.get(U.left).push({id:U.right,gap:U.gap,direction:"horizontal"}):S.set(U.left,[{id:U.right,gap:U.gap,direction:"horizontal"}]),S.has(U.right)||S.set(U.right,[])):(S.has(U.top)?S.get(U.top).push({id:U.bottom,gap:U.gap,direction:"vertical"}):S.set(U.top,[{id:U.bottom,gap:U.gap,direction:"vertical"}]),S.has(U.bottom)||S.set(U.bottom,[]))}),I=m(S),Z=o(I)),e.TRANSFORM_ON_CONSTRAINT_HANDLING){if(s.fixedNodeConstraint&&s.fixedNodeConstraint.length>1)s.fixedNodeConstraint.forEach(function(U,H){T[H]=[U.position.x,U.position.y],v[H]=[p[y.get(U.nodeId)],C[y.get(U.nodeId)]]}),D=!0;else if(s.alignmentConstraint)(function(){var U=0;if(s.alignmentConstraint.vertical){for(var H=s.alignmentConstraint.vertical,V=function(q){var ht=new Set;H[q].forEach(function(vt){ht.add(vt)});var gt=new Set([].concat(f(ht)).filter(function(vt){return P.has(vt)})),rt=void 0;gt.size>0?rt=p[y.get(gt.values().next().value)]:rt=J(ht).x,H[q].forEach(function(vt){T[U]=[rt,C[y.get(vt)]],v[U]=[p[y.get(vt)],C[y.get(vt)]],U++})},$=0;$<H.length;$++)V($);D=!0}if(s.alignmentConstraint.horizontal){for(var k=s.alignmentConstraint.horizontal,j=function(q){var ht=new Set;k[q].forEach(function(vt){ht.add(vt)});var gt=new Set([].concat(f(ht)).filter(function(vt){return P.has(vt)})),rt=void 0;gt.size>0?rt=p[y.get(gt.values().next().value)]:rt=J(ht).y,k[q].forEach(function(vt){T[U]=[p[y.get(vt)],rt],v[U]=[p[y.get(vt)],C[y.get(vt)]],U++})},ut=0;ut<k.length;ut++)j(ut);D=!0}s.relativePlacementConstraint&&(O=!0)})();else if(s.relativePlacementConstraint){for(var tt=0,F=0,_=0;_<Z.length;_++)Z[_].length>tt&&(tt=Z[_].length,F=_);if(tt<I.size/2)z(s.relativePlacementConstraint),D=!1,O=!1;else{var B=new Map,M=new Map,Y=[];Z[F].forEach(function(U){S.get(U).forEach(function(H){H.direction=="horizontal"?(B.has(U)?B.get(U).push(H):B.set(U,[H]),B.has(H.id)||B.set(H.id,[]),Y.push({left:U,right:H.id})):(M.has(U)?M.get(U).push(H):M.set(U,[H]),M.has(H.id)||M.set(H.id,[]),Y.push({top:U,bottom:H.id}))})}),z(Y),O=!1;var X=x(B,"horizontal"),K=x(M,"vertical");Z[F].forEach(function(U,H){v[H]=[p[y.get(U)],C[y.get(U)]],T[H]=[],X.has(U)?T[H][0]=X.get(U):T[H][0]=p[y.get(U)],K.has(U)?T[H][1]=K.get(U):T[H][1]=C[y.get(U)]}),D=!0}}if(D){for(var st=void 0,Lt=t.transpose(T),St=t.transpose(v),Q=0;Q<Lt.length;Q++)Lt[Q]=t.multGamma(Lt[Q]),St[Q]=t.multGamma(St[Q]);var Ut=t.multMat(Lt,t.transpose(St)),Mt=i.svd(Ut);st=t.multMat(Mt.V,t.transpose(Mt.U));for(var at=0;at<y.size;at++){var et=[p[at],C[at]],pt=[st[0][0],st[1][0]],mt=[st[0][1],st[1][1]];p[at]=t.dotProduct(et,pt),C[at]=t.dotProduct(et,mt)}O&&z(s.relativePlacementConstraint)}}if(e.ENFORCE_CONSTRAINTS){if(s.fixedNodeConstraint&&s.fixedNodeConstraint.length>0){var Ct={x:0,y:0};s.fixedNodeConstraint.forEach(function(U,H){var V={x:p[y.get(U.nodeId)],y:C[y.get(U.nodeId)]},$=U.position,k=G($,V);Ct.x+=k.x,Ct.y+=k.y}),Ct.x/=s.fixedNodeConstraint.length,Ct.y/=s.fixedNodeConstraint.length,p.forEach(function(U,H){p[H]+=Ct.x}),C.forEach(function(U,H){C[H]+=Ct.y}),s.fixedNodeConstraint.forEach(function(U){p[y.get(U.nodeId)]=U.position.x,C[y.get(U.nodeId)]=U.position.y})}if(s.alignmentConstraint){if(s.alignmentConstraint.vertical)for(var Et=s.alignmentConstraint.vertical,Tt=function(H){var V=new Set;Et[H].forEach(function(j){V.add(j)});var $=new Set([].concat(f(V)).filter(function(j){return P.has(j)})),k=void 0;$.size>0?k=p[y.get($.values().next().value)]:k=J(V).x,V.forEach(function(j){P.has(j)||(p[y.get(j)]=k)})},Ot=0;Ot<Et.length;Ot++)Tt(Ot);if(s.alignmentConstraint.horizontal)for(var It=s.alignmentConstraint.horizontal,Wt=function(H){var V=new Set;It[H].forEach(function(j){V.add(j)});var $=new Set([].concat(f(V)).filter(function(j){return P.has(j)})),k=void 0;$.size>0?k=C[y.get($.values().next().value)]:k=J(V).y,V.forEach(function(j){P.has(j)||(C[y.get(j)]=k)})},Pt=0;Pt<It.length;Pt++)Wt(Pt)}s.relativePlacementConstraint&&(function(){var U=new Map,H=new Map,V=new Map,$=new Map,k=new Map,j=new Map,ut=new Set,ft=new Set;if(P.forEach(function(Gt){ut.add(Gt),ft.add(Gt)}),s.alignmentConstraint){if(s.alignmentConstraint.vertical)for(var q=s.alignmentConstraint.vertical,ht=function(yt){V.set("dummy"+yt,[]),q[yt].forEach(function(wt){U.set(wt,"dummy"+yt),V.get("dummy"+yt).push(wt),P.has(wt)&&ut.add("dummy"+yt)}),k.set("dummy"+yt,p[y.get(q[yt][0])])},gt=0;gt<q.length;gt++)ht(gt);if(s.alignmentConstraint.horizontal)for(var rt=s.alignmentConstraint.horizontal,vt=function(yt){$.set("dummy"+yt,[]),rt[yt].forEach(function(wt){H.set(wt,"dummy"+yt),$.get("dummy"+yt).push(wt),P.has(wt)&&ft.add("dummy"+yt)}),j.set("dummy"+yt,C[y.get(rt[yt][0])])},At=0;At<rt.length;At++)vt(At)}var ot=new Map,it=new Map,dt=function(yt){S.get(yt).forEach(function(wt){var kt=void 0,Bt=void 0;wt.direction=="horizontal"?(kt=U.get(yt)?U.get(yt):yt,U.get(wt.id)?Bt={id:U.get(wt.id),gap:wt.gap,direction:wt.direction}:Bt=wt,ot.has(kt)?ot.get(kt).push(Bt):ot.set(kt,[Bt]),ot.has(Bt.id)||ot.set(Bt.id,[])):(kt=H.get(yt)?H.get(yt):yt,H.get(wt.id)?Bt={id:H.get(wt.id),gap:wt.gap,direction:wt.direction}:Bt=wt,it.has(kt)?it.get(kt).push(Bt):it.set(kt,[Bt]),it.has(Bt.id)||it.set(Bt.id,[]))})},nt=!0,lt=!1,Ft=void 0;try{for(var xt=S.keys()[Symbol.iterator](),Vt;!(nt=(Vt=xt.next()).done);nt=!0){var Dt=Vt.value;dt(Dt)}}catch(Gt){lt=!0,Ft=Gt}finally{try{!nt&&xt.return&&xt.return()}finally{if(lt)throw Ft}}var Nt=m(ot),$t=m(it),Rt=o(Nt),Xt=o($t),zt=d(ot),ce=d(it),qt=[],Jt=[];Rt.forEach(function(Gt,yt){qt[yt]=[],Gt.forEach(function(wt){zt.get(wt).length==0&&qt[yt].push(wt)})}),Xt.forEach(function(Gt,yt){Jt[yt]=[],Gt.forEach(function(wt){ce.get(wt).length==0&&Jt[yt].push(wt)})});var Kt=x(ot,"horizontal",ut,k,qt),Qt=x(it,"vertical",ft,j,Jt),oe=function(yt){V.get(yt)?V.get(yt).forEach(function(wt){p[y.get(wt)]=Kt.get(yt)}):p[y.get(yt)]=Kt.get(yt)},jt=!0,_t=!1,Me=void 0;try{for(var ge=Kt.keys()[Symbol.iterator](),Oe;!(jt=(Oe=ge.next()).done);jt=!0){var ue=Oe.value;oe(ue)}}catch(Gt){_t=!0,Me=Gt}finally{try{!jt&&ge.return&&ge.return()}finally{if(_t)throw Me}}var gr=function(yt){$.get(yt)?$.get(yt).forEach(function(wt){C[y.get(wt)]=Qt.get(yt)}):C[y.get(yt)]=Qt.get(yt)},de=!0,De=!1,xe=void 0;try{for(var ve=Qt.keys()[Symbol.iterator](),Ie;!(de=(Ie=ve.next()).done);de=!0){var ue=Ie.value;gr(ue)}}catch(Gt){De=!0,xe=Gt}finally{try{!de&&ve.return&&ve.return()}finally{if(De)throw xe}}})()}for(var Yt=0;Yt<R.length;Yt++){var bt=R[Yt];bt.getChild()==null&&bt.setCenter(p[y.get(bt.id)],C[y.get(bt.id)])}},a.exports=h}),551:(a=>{a.exports=E})},N={};function u(a){var r=N[a];if(r!==void 0)return r.exports;var n=N[a]={exports:{}};return w[a](n,n.exports,u),n.exports}var l=u(45);return l})()})});var Je=pe((ne,Ce)=>{(function(w,N){typeof ne=="object"&&typeof Ce=="object"?Ce.exports=N(Le()):typeof define=="function"&&define.amd?define(["cose-base"],N):typeof ne=="object"?ne.cytoscapeFcose=N(Le()):w.cytoscapeFcose=N(w.coseBase)})(ne,function(E){return(()=>{"use strict";var w={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var n=arguments.length,f=Array(n>1?n-1:0),e=1;e<n;e++)f[e-1]=arguments[e];return f.forEach(function(c){Object.keys(c).forEach(function(t){return r[t]=c[t]})}),r}}),548:((a,r,n)=>{var f=(function(){function t(i,h){var g=[],s=!0,L=!1,y=void 0;try{for(var p=i[Symbol.iterator](),C;!(s=(C=p.next()).done)&&(g.push(C.value),!(h&&g.length===h));s=!0);}catch(R){L=!0,y=R}finally{try{!s&&p.return&&p.return()}finally{if(L)throw y}}return g}return function(i,h){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return t(i,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=n(140).layoutBase.LinkedList,c={};c.getTopMostNodes=function(t){for(var i={},h=0;h<t.length;h++)i[t[h].id()]=!0;var g=t.filter(function(s,L){typeof s=="number"&&(s=L);for(var y=s.parent()[0];y!=null;){if(i[y.id()])return!1;y=y.parent()[0]}return!0});return g},c.connectComponents=function(t,i,h,g){var s=new e,L=new Set,y=[],p=void 0,C=void 0,R=void 0,A=!1,b=1,W=[],G=[],J=function(){var z=t.collection();G.push(z);var o=h[0],m=t.collection();m.merge(o).merge(o.descendants().intersection(i)),y.push(o),m.forEach(function(v){s.push(v),L.add(v),z.merge(v)});for(var d=function(){o=s.shift();var D=t.collection();o.neighborhood().nodes().forEach(function(I){i.intersection(o.edgesWith(I)).length>0&&D.merge(I)});for(var O=0;O<D.length;O++){var P=D[O];if(p=h.intersection(P.union(P.ancestors())),p!=null&&!L.has(p[0])){var S=p.union(p.descendants());S.forEach(function(I){s.push(I),L.add(I),z.merge(I),h.has(I)&&y.push(I)})}}};s.length!=0;)d();if(z.forEach(function(v){i.intersection(v.connectedEdges()).forEach(function(D){z.has(D.source())&&z.has(D.target())&&z.merge(D)})}),y.length==h.length&&(A=!0),!A||A&&b>1){C=y[0],R=C.connectedEdges().length,y.forEach(function(v){v.connectedEdges().length<R&&(R=v.connectedEdges().length,C=v)}),W.push(C.id());var T=t.collection();T.merge(y[0]),y.forEach(function(v){T.merge(v)}),y=[],h=h.difference(T),b++}};do J();while(!A);return g&&W.length>0&&g.set("dummy"+(g.size+1),W),G},c.relocateComponent=function(t,i,h){if(!h.fixedNodeConstraint){var g=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY;if(h.quality=="draft"){var p=!0,C=!1,R=void 0;try{for(var A=i.nodeIndexes[Symbol.iterator](),b;!(p=(b=A.next()).done);p=!0){var W=b.value,G=f(W,2),J=G[0],x=G[1],z=h.cy.getElementById(J);if(z){var o=z.boundingBox(),m=i.xCoords[x]-o.w/2,d=i.xCoords[x]+o.w/2,T=i.yCoords[x]-o.h/2,v=i.yCoords[x]+o.h/2;m<g&&(g=m),d>s&&(s=d),T<L&&(L=T),v>y&&(y=v)}}}catch(I){C=!0,R=I}finally{try{!p&&A.return&&A.return()}finally{if(C)throw R}}var D=t.x-(s+g)/2,O=t.y-(y+L)/2;i.xCoords=i.xCoords.map(function(I){return I+D}),i.yCoords=i.yCoords.map(function(I){return I+O})}else{Object.keys(i).forEach(function(I){var Z=i[I],tt=Z.getRect().x,F=Z.getRect().x+Z.getRect().width,_=Z.getRect().y,B=Z.getRect().y+Z.getRect().height;tt<g&&(g=tt),F>s&&(s=F),_<L&&(L=_),B>y&&(y=B)});var P=t.x-(s+g)/2,S=t.y-(y+L)/2;Object.keys(i).forEach(function(I){var Z=i[I];Z.setCenter(Z.getCenterX()+P,Z.getCenterY()+S)})}}},c.calcBoundingBox=function(t,i,h,g){for(var s=Number.MAX_SAFE_INTEGER,L=Number.MIN_SAFE_INTEGER,y=Number.MAX_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER,C=void 0,R=void 0,A=void 0,b=void 0,W=t.descendants().not(":parent"),G=W.length,J=0;J<G;J++){var x=W[J];C=i[g.get(x.id())]-x.width()/2,R=i[g.get(x.id())]+x.width()/2,A=h[g.get(x.id())]-x.height()/2,b=h[g.get(x.id())]+x.height()/2,s>C&&(s=C),L<R&&(L=R),y>A&&(y=A),p<b&&(p=b)}var z={};return z.topLeftX=s,z.topLeftY=y,z.width=L-s,z.height=p-y,z},c.calcParentsWithoutChildren=function(t,i){var h=t.collection();return i.nodes(":parent").forEach(function(g){var s=!1;g.children().forEach(function(L){L.css("display")!="none"&&(s=!0)}),s||h.merge(g)}),h},a.exports=c}),816:((a,r,n)=>{var f=n(548),e=n(140).CoSELayout,c=n(140).CoSENode,t=n(140).layoutBase.PointD,i=n(140).layoutBase.DimensionD,h=n(140).layoutBase.LayoutConstants,g=n(140).layoutBase.FDLayoutConstants,s=n(140).CoSEConstants,L=function(p,C){var R=p.cy,A=p.eles,b=A.nodes(),W=A.edges(),G=void 0,J=void 0,x=void 0,z={};p.randomize&&(G=C.nodeIndexes,J=C.xCoords,x=C.yCoords);var o=function(I){return typeof I=="function"},m=function(I,Z){return o(I)?I(Z):I},d=f.calcParentsWithoutChildren(R,A),T=function S(I,Z,tt,F){for(var _=Z.length,B=0;B<_;B++){var M=Z[B],Y=null;M.intersection(d).length==0&&(Y=M.children());var X=void 0,K=M.layoutDimensions({nodeDimensionsIncludeLabels:F.nodeDimensionsIncludeLabels});if(M.outerWidth()!=null&&M.outerHeight()!=null)if(F.randomize)if(!M.isParent())X=I.add(new c(tt.graphManager,new t(J[G.get(M.id())]-K.w/2,x[G.get(M.id())]-K.h/2),new i(parseFloat(K.w),parseFloat(K.h))));else{var st=f.calcBoundingBox(M,J,x,G);M.intersection(d).length==0?X=I.add(new c(tt.graphManager,new t(st.topLeftX,st.topLeftY),new i(st.width,st.height))):X=I.add(new c(tt.graphManager,new t(st.topLeftX,st.topLeftY),new i(parseFloat(K.w),parseFloat(K.h))))}else X=I.add(new c(tt.graphManager,new t(M.position("x")-K.w/2,M.position("y")-K.h/2),new i(parseFloat(K.w),parseFloat(K.h))));else X=I.add(new c(this.graphManager));if(X.id=M.data("id"),X.nodeRepulsion=m(F.nodeRepulsion,M),X.paddingLeft=parseInt(M.css("padding")),X.paddingTop=parseInt(M.css("padding")),X.paddingRight=parseInt(M.css("padding")),X.paddingBottom=parseInt(M.css("padding")),F.nodeDimensionsIncludeLabels&&(X.labelWidth=M.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,X.labelHeight=M.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,X.labelPosVertical=M.css("text-valign"),X.labelPosHorizontal=M.css("text-halign")),z[M.data("id")]=X,isNaN(X.rect.x)&&(X.rect.x=0),isNaN(X.rect.y)&&(X.rect.y=0),Y!=null&&Y.length>0){var Lt=void 0;Lt=tt.getGraphManager().add(tt.newGraph(),X),S(Lt,Y,tt,F)}}},v=function(I,Z,tt){for(var F=0,_=0,B=0;B<tt.length;B++){var M=tt[B],Y=z[M.data("source")],X=z[M.data("target")];if(Y&&X&&Y!==X&&Y.getEdgesBetween(X).length==0){var K=Z.add(I.newEdge(),Y,X);K.id=M.id(),K.idealLength=m(p.idealEdgeLength,M),K.edgeElasticity=m(p.edgeElasticity,M),F+=K.idealLength,_++}}p.idealEdgeLength!=null&&(_>0?s.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=F/_:o(p.idealEdgeLength)?s.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50:s.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=p.idealEdgeLength,s.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,s.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH)},D=function(I,Z){Z.fixedNodeConstraint&&(I.constraints.fixedNodeConstraint=Z.fixedNodeConstraint),Z.alignmentConstraint&&(I.constraints.alignmentConstraint=Z.alignmentConstraint),Z.relativePlacementConstraint&&(I.constraints.relativePlacementConstraint=Z.relativePlacementConstraint)};p.nestingFactor!=null&&(s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=p.nestingFactor),p.gravity!=null&&(s.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=p.gravity),p.numIter!=null&&(s.MAX_ITERATIONS=g.MAX_ITERATIONS=p.numIter),p.gravityRange!=null&&(s.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=p.gravityRange),p.gravityCompound!=null&&(s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=p.gravityCompound),p.gravityRangeCompound!=null&&(s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=p.gravityRangeCompound),p.initialEnergyOnIncremental!=null&&(s.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=p.initialEnergyOnIncremental),p.tilingCompareBy!=null&&(s.TILING_COMPARE_BY=p.tilingCompareBy),p.quality=="proof"?h.QUALITY=2:h.QUALITY=0,s.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=p.nodeDimensionsIncludeLabels,s.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!p.randomize,s.ANIMATE=g.ANIMATE=h.ANIMATE=p.animate,s.TILE=p.tile,s.TILING_PADDING_VERTICAL=typeof p.tilingPaddingVertical=="function"?p.tilingPaddingVertical.call():p.tilingPaddingVertical,s.TILING_PADDING_HORIZONTAL=typeof p.tilingPaddingHorizontal=="function"?p.tilingPaddingHorizontal.call():p.tilingPaddingHorizontal,s.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,s.PURE_INCREMENTAL=!p.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=p.uniformNodeDimensions,p.step=="transformed"&&(s.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,s.ENFORCE_CONSTRAINTS=!1,s.APPLY_LAYOUT=!1),p.step=="enforced"&&(s.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,s.ENFORCE_CONSTRAINTS=!0,s.APPLY_LAYOUT=!1),p.step=="cose"&&(s.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,s.ENFORCE_CONSTRAINTS=!1,s.APPLY_LAYOUT=!0),p.step=="all"&&(p.randomize?s.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:s.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,s.ENFORCE_CONSTRAINTS=!0,s.APPLY_LAYOUT=!0),p.fixedNodeConstraint||p.alignmentConstraint||p.relativePlacementConstraint?s.TREE_REDUCTION_ON_INCREMENTAL=!1:s.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,P=O.newGraphManager();return T(P.addRoot(),f.getTopMostNodes(b),O,p),v(O,P,W),D(O,p),O.runLayout(),z};a.exports={coseLayout:L}}),212:((a,r,n)=>{var f=(function(){function p(C,R){for(var A=0;A<R.length;A++){var b=R[A];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(C,b.key,b)}}return function(C,R,A){return R&&p(C.prototype,R),A&&p(C,A),C}})();function e(p,C){if(!(p instanceof C))throw new TypeError("Cannot call a class as a function")}var c=n(658),t=n(548),i=n(657),h=i.spectralLayout,g=n(816),s=g.coseLayout,L=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(C){return 4500},idealEdgeLength:function(C){return 50},edgeElasticity:function(C){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),y=(function(){function p(C){e(this,p),this.options=c({},L,C)}return f(p,[{key:"run",value:function(){var R=this,A=this.options,b=A.cy,W=A.eles,G=[],J=void 0,x=void 0,z=[],o=void 0,m=[];A.fixedNodeConstraint&&(!Array.isArray(A.fixedNodeConstraint)||A.fixedNodeConstraint.length==0)&&(A.fixedNodeConstraint=void 0),A.alignmentConstraint&&(A.alignmentConstraint.vertical&&(!Array.isArray(A.alignmentConstraint.vertical)||A.alignmentConstraint.vertical.length==0)&&(A.alignmentConstraint.vertical=void 0),A.alignmentConstraint.horizontal&&(!Array.isArray(A.alignmentConstraint.horizontal)||A.alignmentConstraint.horizontal.length==0)&&(A.alignmentConstraint.horizontal=void 0)),A.relativePlacementConstraint&&(!Array.isArray(A.relativePlacementConstraint)||A.relativePlacementConstraint.length==0)&&(A.relativePlacementConstraint=void 0);var d=A.fixedNodeConstraint||A.alignmentConstraint||A.relativePlacementConstraint;d&&(A.tile=!1,A.packComponents=!1);var T=void 0,v=!1;if(b.layoutUtilities&&A.packComponents&&(T=b.layoutUtilities("get"),T||(T=b.layoutUtilities()),v=!0),W.nodes().length>0)if(v){var P=t.getTopMostNodes(A.eles.nodes());if(o=t.connectComponents(b,A.eles,P),o.forEach(function(at){var et=at.boundingBox();m.push({x:et.x1+et.w/2,y:et.y1+et.h/2})}),A.randomize&&o.forEach(function(at){A.eles=at,G.push(h(A))}),A.quality=="default"||A.quality=="proof"){var S=b.collection();if(A.tile){var I=new Map,Z=[],tt=[],F=0,_={nodeIndexes:I,xCoords:Z,yCoords:tt},B=[];if(o.forEach(function(at,et){at.edges().length==0&&(at.nodes().forEach(function(pt,mt){S.merge(at.nodes()[mt]),pt.isParent()||(_.nodeIndexes.set(at.nodes()[mt].id(),F++),_.xCoords.push(at.nodes()[0].position().x),_.yCoords.push(at.nodes()[0].position().y))}),B.push(et))}),S.length>1){var M=S.boundingBox();m.push({x:M.x1+M.w/2,y:M.y1+M.h/2}),o.push(S),G.push(_);for(var Y=B.length-1;Y>=0;Y--)o.splice(B[Y],1),G.splice(B[Y],1),m.splice(B[Y],1)}}o.forEach(function(at,et){A.eles=at,z.push(s(A,G[et])),t.relocateComponent(m[et],z[et],A)})}else o.forEach(function(at,et){t.relocateComponent(m[et],G[et],A)});var X=new Set;if(o.length>1){var K=[],st=W.filter(function(at){return at.css("display")=="none"});o.forEach(function(at,et){var pt=void 0;if(A.quality=="draft"&&(pt=G[et].nodeIndexes),at.nodes().not(st).length>0){var mt={};mt.edges=[],mt.nodes=[];var Ct=void 0;at.nodes().not(st).forEach(function(Et){if(A.quality=="draft")if(!Et.isParent())Ct=pt.get(Et.id()),mt.nodes.push({x:G[et].xCoords[Ct]-Et.boundingbox().w/2,y:G[et].yCoords[Ct]-Et.boundingbox().h/2,width:Et.boundingbox().w,height:Et.boundingbox().h});else{var Tt=t.calcBoundingBox(Et,G[et].xCoords,G[et].yCoords,pt);mt.nodes.push({x:Tt.topLeftX,y:Tt.topLeftY,width:Tt.width,height:Tt.height})}else z[et][Et.id()]&&mt.nodes.push({x:z[et][Et.id()].getLeft(),y:z[et][Et.id()].getTop(),width:z[et][Et.id()].getWidth(),height:z[et][Et.id()].getHeight()})}),at.edges().forEach(function(Et){var Tt=Et.source(),Ot=Et.target();if(Tt.css("display")!="none"&&Ot.css("display")!="none")if(A.quality=="draft"){var It=pt.get(Tt.id()),Wt=pt.get(Ot.id()),Pt=[],Yt=[];if(Tt.isParent()){var bt=t.calcBoundingBox(Tt,G[et].xCoords,G[et].yCoords,pt);Pt.push(bt.topLeftX+bt.width/2),Pt.push(bt.topLeftY+bt.height/2)}else Pt.push(G[et].xCoords[It]),Pt.push(G[et].yCoords[It]);if(Ot.isParent()){var U=t.calcBoundingBox(Ot,G[et].xCoords,G[et].yCoords,pt);Yt.push(U.topLeftX+U.width/2),Yt.push(U.topLeftY+U.height/2)}else Yt.push(G[et].xCoords[Wt]),Yt.push(G[et].yCoords[Wt]);mt.edges.push({startX:Pt[0],startY:Pt[1],endX:Yt[0],endY:Yt[1]})}else z[et][Tt.id()]&&z[et][Ot.id()]&&mt.edges.push({startX:z[et][Tt.id()].getCenterX(),startY:z[et][Tt.id()].getCenterY(),endX:z[et][Ot.id()].getCenterX(),endY:z[et][Ot.id()].getCenterY()})}),mt.nodes.length>0&&(K.push(mt),X.add(et))}});var Lt=T.packComponents(K,A.randomize).shifts;if(A.quality=="draft")G.forEach(function(at,et){var pt=at.xCoords.map(function(Ct){return Ct+Lt[et].dx}),mt=at.yCoords.map(function(Ct){return Ct+Lt[et].dy});at.xCoords=pt,at.yCoords=mt});else{var St=0;X.forEach(function(at){Object.keys(z[at]).forEach(function(et){var pt=z[at][et];pt.setCenter(pt.getCenterX()+Lt[St].dx,pt.getCenterY()+Lt[St].dy)}),St++})}}}else{var D=A.eles.boundingBox();if(m.push({x:D.x1+D.w/2,y:D.y1+D.h/2}),A.randomize){var O=h(A);G.push(O)}A.quality=="default"||A.quality=="proof"?(z.push(s(A,G[0])),t.relocateComponent(m[0],z[0],A)):t.relocateComponent(m[0],G[0],A)}var Q=function(et,pt){if(A.quality=="default"||A.quality=="proof"){typeof et=="number"&&(et=pt);var mt=void 0,Ct=void 0,Et=et.data("id");return z.forEach(function(Ot){Et in Ot&&(mt={x:Ot[Et].getRect().getCenterX(),y:Ot[Et].getRect().getCenterY()},Ct=Ot[Et])}),A.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?mt.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(mt.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?mt.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(mt.y-=Ct.labelHeight/2))),mt==null&&(mt={x:et.position("x"),y:et.position("y")}),{x:mt.x,y:mt.y}}else{var Tt=void 0;return G.forEach(function(Ot){var It=Ot.nodeIndexes.get(et.id());It!=null&&(Tt={x:Ot.xCoords[It],y:Ot.yCoords[It]})}),Tt==null&&(Tt={x:et.position("x"),y:et.position("y")}),{x:Tt.x,y:Tt.y}}};if(A.quality=="default"||A.quality=="proof"||A.randomize){var Ut=t.calcParentsWithoutChildren(b,W),Mt=W.filter(function(at){return at.css("display")=="none"});A.eles=W.not(Mt),W.nodes().not(":parent").not(Mt).layoutPositions(R,A,Q),Ut.length>0&&Ut.forEach(function(at){at.position(Q(at))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),p})();a.exports=y}),657:((a,r,n)=>{var f=n(548),e=n(140).layoutBase.Matrix,c=n(140).layoutBase.SVD,t=function(h){var g=h.cy,s=h.eles,L=s.nodes(),y=s.nodes(":parent"),p=new Map,C=new Map,R=new Map,A=[],b=[],W=[],G=[],J=[],x=[],z=[],o=[],m=void 0,d=void 0,T=1e8,v=1e-9,D=h.piTol,O=h.samplingType,P=h.nodeSeparation,S=void 0,I=function(){for(var V=0,$=0,k=!1;$<S;){V=Math.floor(Math.random()*d),k=!1;for(var j=0;j<$;j++)if(G[j]==V){k=!0;break}if(!k)G[$]=V,$++;else continue}},Z=function(V,$,k){for(var j=[],ut=0,ft=0,q=0,ht=void 0,gt=[],rt=0,vt=1,At=0;At<d;At++)gt[At]=T;for(j[ft]=V,gt[V]=0;ft>=ut;){q=j[ut++];for(var ot=A[q],it=0;it<ot.length;it++)ht=C.get(ot[it]),gt[ht]==T&&(gt[ht]=gt[q]+1,j[++ft]=ht);x[q][$]=gt[q]*P}if(k){for(var dt=0;dt<d;dt++)x[dt][$]<J[dt]&&(J[dt]=x[dt][$]);for(var nt=0;nt<d;nt++)J[nt]>rt&&(rt=J[nt],vt=nt)}return vt},tt=function(V){var $=void 0;if(V){$=Math.floor(Math.random()*d),m=$;for(var j=0;j<d;j++)J[j]=T;for(var ut=0;ut<S;ut++)G[ut]=$,$=Z($,ut,V)}else{I();for(var k=0;k<S;k++)Z(G[k],k,V,!1)}for(var ft=0;ft<d;ft++)for(var q=0;q<S;q++)x[ft][q]*=x[ft][q];for(var ht=0;ht<S;ht++)z[ht]=[];for(var gt=0;gt<S;gt++)for(var rt=0;rt<S;rt++)z[gt][rt]=x[G[rt]][gt]},F=function(){for(var V=c.svd(z),$=V.S,k=V.U,j=V.V,ut=$[0]*$[0]*$[0],ft=[],q=0;q<S;q++){ft[q]=[];for(var ht=0;ht<S;ht++)ft[q][ht]=0,q==ht&&(ft[q][ht]=$[q]/($[q]*$[q]+ut/($[q]*$[q])))}o=e.multMat(e.multMat(j,ft),e.transpose(k))},_=function(){for(var V=void 0,$=void 0,k=[],j=[],ut=[],ft=[],q=0;q<d;q++)k[q]=Math.random(),j[q]=Math.random();k=e.normalize(k),j=e.normalize(j);for(var ht=0,gt=v,rt=v,vt=void 0;;){ht++;for(var At=0;At<d;At++)ut[At]=k[At];if(k=e.multGamma(e.multL(e.multGamma(ut),x,o)),V=e.dotProduct(ut,k),k=e.normalize(k),gt=e.dotProduct(ut,k),vt=Math.abs(gt/rt),vt<=1+D&&vt>=1)break;rt=gt}for(var ot=0;ot<d;ot++)ut[ot]=k[ot];for(ht=0,rt=v;;){ht++;for(var it=0;it<d;it++)ft[it]=j[it];if(ft=e.minusOp(ft,e.multCons(ut,e.dotProduct(ut,ft))),j=e.multGamma(e.multL(e.multGamma(ft),x,o)),$=e.dotProduct(ft,j),j=e.normalize(j),gt=e.dotProduct(ft,j),vt=Math.abs(gt/rt),vt<=1+D&&vt>=1)break;rt=gt}for(var dt=0;dt<d;dt++)ft[dt]=j[dt];b=e.multCons(ut,Math.sqrt(Math.abs(V))),W=e.multCons(ft,Math.sqrt(Math.abs($)))};f.connectComponents(g,s,f.getTopMostNodes(L),p),y.forEach(function(H){f.connectComponents(g,s,f.getTopMostNodes(H.descendants().intersection(s)),p)});for(var B=0,M=0;M<L.length;M++)L[M].isParent()||C.set(L[M].id(),B++);var Y=!0,X=!1,K=void 0;try{for(var st=p.keys()[Symbol.iterator](),Lt;!(Y=(Lt=st.next()).done);Y=!0){var St=Lt.value;C.set(St,B++)}}catch(H){X=!0,K=H}finally{try{!Y&&st.return&&st.return()}finally{if(X)throw K}}for(var Q=0;Q<C.size;Q++)A[Q]=[];y.forEach(function(H){for(var V=H.children().intersection(s);V.nodes(":childless").length==0;)V=V.nodes()[0].children().intersection(s);var $=0,k=V.nodes(":childless")[0].connectedEdges().length;V.nodes(":childless").forEach(function(j,ut){j.connectedEdges().length<k&&(k=j.connectedEdges().length,$=ut)}),R.set(H.id(),V.nodes(":childless")[$].id())}),L.forEach(function(H){var V=void 0;H.isParent()?V=C.get(R.get(H.id())):V=C.get(H.id()),H.neighborhood().nodes().forEach(function($){s.intersection(H.edgesWith($)).length>0&&($.isParent()?A[V].push(R.get($.id())):A[V].push($.id()))})});var Ut=function(V){var $=C.get(V),k=void 0;p.get(V).forEach(function(j){g.getElementById(j).isParent()?k=R.get(j):k=j,A[$].push(k),A[C.get(k)].push(V)})},Mt=!0,at=!1,et=void 0;try{for(var pt=p.keys()[Symbol.iterator](),mt;!(Mt=(mt=pt.next()).done);Mt=!0){var Ct=mt.value;Ut(Ct)}}catch(H){at=!0,et=H}finally{try{!Mt&&pt.return&&pt.return()}finally{if(at)throw et}}d=C.size;var Et=void 0;if(d>2){S=d<h.sampleSize?d:h.sampleSize;for(var Tt=0;Tt<d;Tt++)x[Tt]=[];for(var Ot=0;Ot<S;Ot++)o[Ot]=[];return h.quality=="draft"||h.step=="all"?(tt(O),F(),_(),Et={nodeIndexes:C,xCoords:b,yCoords:W}):(C.forEach(function(H,V){b.push(g.getElementById(V).position("x")),W.push(g.getElementById(V).position("y"))}),Et={nodeIndexes:C,xCoords:b,yCoords:W}),Et}else{var It=C.keys(),Wt=g.getElementById(It.next().value),Pt=Wt.position(),Yt=Wt.outerWidth();if(b.push(Pt.x),W.push(Pt.y),d==2){var bt=g.getElementById(It.next().value),U=bt.outerWidth();b.push(Pt.x+Yt/2+U/2+h.idealEdgeLength),W.push(Pt.y)}return Et={nodeIndexes:C,xCoords:b,yCoords:W},Et}};a.exports={spectralLayout:t}}),579:((a,r,n)=>{var f=n(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),a.exports=e}),140:(a=>{a.exports=E})},N={};function u(a){var r=N[a];if(r!==void 0)return r.exports;var n=N[a]={exports:{}};return w[a](n,n.exports,u),n.exports}var l=u(579);return l})()})});var ir=ur(Je(),1);var Ke={L:"left",R:"right",T:"top",B:"bottom"},je={L:ct(E=>`${E},${E/2} 0,${E} 0,0`,"L"),R:ct(E=>`0,${E/2} ${E},0 ${E},${E}`,"R"),T:ct(E=>`0,0 ${E},0 ${E/2},${E}`,"T"),B:ct(E=>`${E/2},0 ${E},${E} 0,${E}`,"B")},fe={L:ct((E,w)=>E-w+2,"L"),R:ct((E,w)=>E-2,"R"),T:ct((E,w)=>E-w+2,"T"),B:ct((E,w)=>E-2,"B")},dr=ct(function(E){return Ht(E)?E==="L"?"R":"L":E==="T"?"B":"T"},"getOppositeArchitectureDirection"),_e=ct(function(E){let w=E;return w==="L"||w==="R"||w==="T"||w==="B"},"isArchitectureDirection"),Ht=ct(function(E){let w=E;return w==="L"||w==="R"},"isArchitectureDirectionX"),Zt=ct(function(E){let w=E;return w==="T"||w==="B"},"isArchitectureDirectionY"),we=ct(function(E,w){let N=Ht(E)&&Zt(w),u=Zt(E)&&Ht(w);return N||u},"isArchitectureDirectionXY"),vr=ct(function(E){let w=E[0],N=E[1],u=Ht(w)&&Zt(N),l=Zt(w)&&Ht(N);return u||l},"isArchitecturePairXY"),pr=ct(function(E){return E!=="LL"&&E!=="RR"&&E!=="TT"&&E!=="BB"},"isValidArchitectureDirectionPair"),Ae=ct(function(E,w){let N=`${E}${w}`;return pr(N)?N:void 0},"getArchitectureDirectionPair"),yr=ct(function([E,w],N){let u=N[0],l=N[1];return Ht(u)?Zt(l)?[E+(u==="L"?-1:1),w+(l==="T"?1:-1)]:[E+(u==="L"?-1:1),w]:Ht(l)?[E+(l==="L"?1:-1),w+(u==="T"?1:-1)]:[E,w+(u==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),mr=ct(function(E){return E==="LT"||E==="TL"?[1,1]:E==="BL"||E==="LB"?[1,-1]:E==="BR"||E==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Er=ct(function(E,w){return we(E,w)?"bend":Ht(E)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Tr=ct(function(E){return E.type==="service"},"isArchitectureService"),Nr=ct(function(E){return E.type==="junction"},"isArchitectureJunction"),tr=ct(E=>E.data(),"edgeData"),ee=ct(E=>E.data(),"nodeData"),Lr=Re.architecture,er=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Ge,this.getAccTitle=Ue,this.setDiagramTitle=He,this.getDiagramTitle=We,this.getAccDescription=Xe,this.setAccDescription=Ye,this.clear()}static{ct(this,"ArchitectureDB")}setDiagramId(E){this.diagramId=E}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",Pe()}addService({id:E,icon:w,in:N,title:u,iconText:l}){if(this.registeredIds[E]!==void 0)throw new Error(`The service id [${E}] is already in use by another ${this.registeredIds[E]}`);if(N!==void 0){if(E===N)throw new Error(`The service [${E}] cannot be placed within itself`);if(this.registeredIds[N]===void 0)throw new Error(`The service [${E}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[N]==="node")throw new Error(`The service [${E}]'s parent is not a group`)}this.registeredIds[E]="node",this.nodes[E]={id:E,type:"service",icon:w,iconText:l,title:u,edges:[],in:N}}getServices(){return Object.values(this.nodes).filter(Tr)}addJunction({id:E,in:w}){if(this.registeredIds[E]!==void 0)throw new Error(`The junction id [${E}] is already in use by another ${this.registeredIds[E]}`);if(w!==void 0){if(E===w)throw new Error(`The junction [${E}] cannot be placed within itself`);if(this.registeredIds[w]===void 0)throw new Error(`The junction [${E}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[w]==="node")throw new Error(`The junction [${E}]'s parent is not a group`)}this.registeredIds[E]="node",this.nodes[E]={id:E,type:"junction",edges:[],in:w}}getJunctions(){return Object.values(this.nodes).filter(Nr)}getNodes(){return Object.values(this.nodes)}getNode(E){return this.nodes[E]??null}addGroup({id:E,icon:w,in:N,title:u}){if(this.registeredIds?.[E]!==void 0)throw new Error(`The group id [${E}] is already in use by another ${this.registeredIds[E]}`);if(N!==void 0){if(E===N)throw new Error(`The group [${E}] cannot be placed within itself`);if(this.registeredIds?.[N]===void 0)throw new Error(`The group [${E}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[N]==="node")throw new Error(`The group [${E}]'s parent is not a group`)}this.registeredIds[E]="group",this.groups[E]={id:E,icon:w,title:u,in:N}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:E,rhsId:w,lhsDir:N,rhsDir:u,lhsInto:l,rhsInto:a,lhsGroup:r,rhsGroup:n,title:f}){if(!_e(N))throw new Error(`Invalid direction given for left hand side of edge ${E}--${w}. Expected (L,R,T,B) got ${String(N)}`);if(!_e(u))throw new Error(`Invalid direction given for right hand side of edge ${E}--${w}. Expected (L,R,T,B) got ${String(u)}`);if(this.nodes[E]===void 0&&this.groups[E]===void 0)throw new Error(`The left-hand id [${E}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[w]===void 0&&this.groups[w]===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=this.nodes[E].in,c=this.nodes[w].in;if(r&&e&&c&&e==c)throw new Error(`The left-hand id [${E}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(n&&e&&c&&e==c)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 t={lhsId:E,lhsDir:N,lhsInto:l,lhsGroup:r,rhsId:w,rhsDir:u,rhsInto:a,rhsGroup:n,title:f};this.edges.push(t),this.nodes[E]&&this.nodes[w]&&(this.nodes[E].edges.push(this.edges[this.edges.length-1]),this.nodes[w].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){let E={},w=Object.entries(this.nodes).reduce((n,[f,e])=>(n[f]=e.edges.reduce((c,t)=>{let i=this.getNode(t.lhsId)?.in,h=this.getNode(t.rhsId)?.in;if(i&&h&&i!==h){let g=Er(t.lhsDir,t.rhsDir);g!=="bend"&&(E[i]??={},E[i][h]=g,E[h]??={},E[h][i]=g)}if(t.lhsId===f){let g=Ae(t.lhsDir,t.rhsDir);g&&(c[g]=t.rhsId)}else{let g=Ae(t.rhsDir,t.lhsDir);g&&(c[g]=t.lhsId)}return c},{}),n),{}),N=Object.keys(w)[0],u={[N]:1},l=Object.keys(w).reduce((n,f)=>f===N?n:{...n,[f]:1},{}),a=ct(n=>{let f={[n]:[0,0]},e=[n];for(;e.length>0;){let c=e.shift();if(c){u[c]=1,delete l[c];let t=w[c],[i,h]=f[c];Object.entries(t).forEach(([g,s])=>{u[s]||(f[s]=yr([i,h],g),e.push(s))})}}return f},"BFS"),r=[a(N)];for(;Object.keys(l).length>0;)r.push(a(Object.keys(l)[0]));this.dataStructures={adjList:w,spatialMaps:r,groupAlignments:E}}return this.dataStructures}setElementForId(E,w){this.elements[E]=w}getElementById(E){return this.elements[E]}getConfig(){return Be({...Lr,...Se().architecture})}getConfigField(E){return this.getConfig()[E]}},Cr=ct((E,w)=>{qe(E,w),E.groups.map(N=>w.addGroup(N)),E.services.map(N=>w.addService({...N,type:"service"})),E.junctions.map(N=>w.addJunction({...N,type:"junction"})),E.edges.map(N=>w.addEdge(N))},"populateDb"),rr={parser:{yy:void 0},parse:ct(async E=>{let w=await Qe("architecture",E);ye.debug(w);let N=rr.parser?.yy;if(!(N instanceof er))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Cr(w,N)},"parse")},Ar=ct(E=>`
.edge {
stroke-width: ${E.archEdgeWidth};
stroke: ${E.archEdgeColor};
fill: none;
}
.arrow {
fill: ${E.archEdgeArrowColor};
}
.node-bkg {
fill: none;
stroke: ${E.archGroupBorderColor};
stroke-width: ${E.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"),wr=Ar,te=ct(E=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${E}</g>`,"wrapIcon"),ae={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:te('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:te('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:te('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:te('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:te('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:ke,blank:{body:te("")}}},Mr=ct(async function(E,w,N,u){let l=N.getConfigField("padding"),a=N.getConfigField("iconSize"),r=a/2,n=a/6,f=n/2;await Promise.all(w.edges().map(async e=>{let{source:c,sourceDir:t,sourceArrow:i,sourceGroup:h,target:g,targetDir:s,targetArrow:L,targetGroup:y,label:p}=tr(e),{x:C,y:R}=e[0].sourceEndpoint(),{x:A,y:b}=e[0].midpoint(),{x:W,y:G}=e[0].targetEndpoint(),J=l+4;if(h&&(Ht(t)?C+=t==="L"?-J:J:R+=t==="T"?-J:J+18),y&&(Ht(s)?W+=s==="L"?-J:J:G+=s==="T"?-J:J+18),!h&&N.getNode(c)?.type==="junction"&&(Ht(t)?C+=t==="L"?r:-r:R+=t==="T"?r:-r),!y&&N.getNode(g)?.type==="junction"&&(Ht(s)?W+=s==="L"?r:-r:G+=s==="T"?r:-r),e[0]._private.rscratch){let x=E.insert("g");if(x.insert("path").attr("d",`M ${C},${R} L ${A},${b} L${W},${G} `).attr("class","edge").attr("id",`${u}-${$e(c,g,{prefix:"L"})}`),i){let z=Ht(t)?fe[t](C,n):C-f,o=Zt(t)?fe[t](R,n):R-f;x.insert("polygon").attr("points",je[t](n)).attr("transform",`translate(${z},${o})`).attr("class","arrow")}if(L){let z=Ht(s)?fe[s](W,n):W-f,o=Zt(s)?fe[s](G,n):G-f;x.insert("polygon").attr("points",je[s](n)).attr("transform",`translate(${z},${o})`).attr("class","arrow")}if(p){let z=we(t,s)?"XY":Ht(t)?"X":"Y",o=0;z==="X"?o=Math.abs(C-W):z==="Y"?o=Math.abs(R-G)/1.5:o=Math.abs(C-W)/2;let m=x.append("g");if(await le(m,p,{useHtmlLabels:!1,width:o,classes:"architecture-service-label"},se()),m.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),z==="X")m.attr("transform","translate("+A+", "+b+")");else if(z==="Y")m.attr("transform","translate("+A+", "+b+") rotate(-90)");else if(z==="XY"){let d=Ae(t,s);if(d&&vr(d)){let T=m.node().getBoundingClientRect(),[v,D]=mr(d);m.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*v*D*45})`);let O=m.node().getBoundingClientRect();m.attr("transform",`
translate(${A}, ${b-T.height/2})
translate(${v*O.width/2}, ${D*O.height/2})
rotate(${-1*v*D*45}, 0, ${T.height/2})
`)}}}}}))},"drawEdges"),Or=ct(async function(E,w,N,u){let a=N.getConfigField("padding")*.75,r=N.getConfigField("fontSize"),f=N.getConfigField("iconSize")/2;await Promise.all(w.nodes().map(async e=>{let c=ee(e);if(c.type==="group"){let{h:t,w:i,x1:h,y1:g}=e.boundingBox(),s=E.append("rect");s.attr("id",`${u}-group-${c.id}`).attr("x",h+f).attr("y",g+f).attr("width",i).attr("height",t).attr("class","node-bkg");let L=E.append("g"),y=h,p=g;if(c.icon){let C=L.append("g");C.html(`<g>${await he(c.icon,{height:a,width:a,fallbackPrefix:ae.prefix})}</g>`),C.attr("transform","translate("+(y+f+1)+", "+(p+f+1)+")"),y+=a,p+=r/2-1-2}if(c.label){let C=L.append("g");await le(C,c.label,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},se()),C.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),C.attr("transform","translate("+(y+f+4)+", "+(p+f+2)+")")}N.setElementForId(c.id,s)}}))},"drawGroups"),Dr=ct(async function(E,w,N,u){let l=se();for(let a of N){let r=w.append("g"),n=E.getConfigField("iconSize");if(a.title){let t=r.append("g");await le(t,a.title,{useHtmlLabels:!1,width:n*1.5,classes:"architecture-service-label"},l),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+n/2+", "+n+")")}let f=r.append("g");if(a.icon)f.html(`<g>${await he(a.icon,{height:n,width:n,fallbackPrefix:ae.prefix})}</g>`);else if(a.iconText){f.html(`<g>${await he("blank",{height:n,width:n,fallbackPrefix:ae.prefix})}</g>`);let h=f.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(Fe(a.iconText,l)),g=parseInt(window.getComputedStyle(h.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;h.attr("style",`-webkit-line-clamp: ${Math.floor((n-2)/g)};`)}else f.append("path").attr("class","node-bkg").attr("id",`${u}-node-${a.id}`).attr("d",`M0,${n} V5 Q0,0 5,0 H${n-5} Q${n},0 ${n},5 V${n} Z`);r.attr("id",`${u}-service-${a.id}`).attr("class","architecture-service");let{width:e,height:c}=r.node().getBBox();a.width=e,a.height=c,E.setElementForId(a.id,r)}return 0},"drawServices"),xr=ct(function(E,w,N,u){N.forEach(l=>{let a=w.append("g"),r=E.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${u}-node-${l.id}`).attr("fill-opacity","0").attr("width",r).attr("height",r),a.attr("class","architecture-junction");let{width:f,height:e}=a._groups[0][0].getBBox();a.width=f,a.height=e,E.setElementForId(l.id,a)})},"drawJunctions");Ze([{name:ae.prefix,icons:ae}]);me.use(ir.default);function nr(E,w,N){E.forEach(u=>{w.add({group:"nodes",data:{type:"service",id:u.id,icon:u.icon,label:u.title,parent:u.in,width:N.getConfigField("iconSize"),height:N.getConfigField("iconSize")},classes:"node-service"})})}ct(nr,"addServices");function ar(E,w,N){E.forEach(u=>{w.add({group:"nodes",data:{type:"junction",id:u.id,parent:u.in,width:N.getConfigField("iconSize"),height:N.getConfigField("iconSize")},classes:"node-junction"})})}ct(ar,"addJunctions");function or(E,w){w.nodes().map(N=>{let u=ee(N);if(u.type==="group")return;u.x=N.position().x,u.y=N.position().y,E.getElementById(u.id).attr("transform","translate("+(u.x||0)+","+(u.y||0)+")")})}ct(or,"positionNodes");function sr(E,w){E.forEach(N=>{w.add({group:"nodes",data:{type:"group",id:N.id,icon:N.icon,label:N.title,parent:N.in},classes:"node-group"})})}ct(sr,"addGroups");function hr(E,w){E.forEach(N=>{let{lhsId:u,rhsId:l,lhsInto:a,lhsGroup:r,rhsInto:n,lhsDir:f,rhsDir:e,rhsGroup:c,title:t}=N,i=we(N.lhsDir,N.rhsDir)?"segments":"straight",h={id:`${u}-${l}`,label:t,source:u,sourceDir:f,sourceArrow:a,sourceGroup:r,sourceEndpoint:f==="L"?"0 50%":f==="R"?"100% 50%":f==="T"?"50% 0":"50% 100%",target:l,targetDir:e,targetArrow:n,targetGroup:c,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};w.add({group:"edges",data:h,classes:i})})}ct(hr,"addEdges");function lr(E,w,N){let u=ct((n,f)=>Object.entries(n).reduce((e,[c,t])=>{let i=0,h=Object.entries(t);if(h.length===1)return e[c]=h[0][1],e;for(let g=0;g<h.length-1;g++)for(let s=g+1;s<h.length;s++){let[L,y]=h[g],[p,C]=h[s];if(N[L]?.[p]===f)e[c]??=[],e[c]=[...e[c],...y,...C];else if(L==="default"||p==="default")e[c]??=[],e[c]=[...e[c],...y,...C];else{let A=`${c}-${i++}`;e[A]=y;let b=`${c}-${i++}`;e[b]=C}}return e},{}),"flattenAlignments"),l=w.map(n=>{let f={},e={};return Object.entries(n).forEach(([c,[t,i]])=>{let h=E.getNode(c)?.in??"default";f[i]??={},f[i][h]??=[],f[i][h].push(c),e[t]??={},e[t][h]??=[],e[t][h].push(c)}),{horiz:Object.values(u(f,"horizontal")).filter(c=>c.length>1),vert:Object.values(u(e,"vertical")).filter(c=>c.length>1)}}),[a,r]=l.reduce(([n,f],{horiz:e,vert:c})=>[[...n,...e],[...f,...c]],[[],[]]);return{horizontal:a,vertical:r}}ct(lr,"getAlignments");function fr(E,w){let N=[],u=ct(a=>`${a[0]},${a[1]}`,"posToStr"),l=ct(a=>a.split(",").map(r=>parseInt(r)),"strToPos");return E.forEach(a=>{let r=Object.fromEntries(Object.entries(a).map(([c,t])=>[u(t),c])),n=[u([0,0])],f={},e={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;n.length>0;){let c=n.shift();if(c){f[c]=1;let t=r[c];if(t){let i=l(c);Object.entries(e).forEach(([h,g])=>{let s=u([i[0]+g[0],i[1]+g[1]]),L=r[s];L&&!f[s]&&(n.push(s),N.push({[Ke[h]]:L,[Ke[dr(h)]]:t,gap:1.5*w.getConfigField("iconSize")}))})}}}}),N}ct(fr,"getRelativeConstraints");function cr(E,w,N,u,l,{spatialMaps:a,groupAlignments:r}){return new Promise(n=>{let f=Ve("body").append("div").attr("id","cy").attr("style","display:none"),e=me({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{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":`${l.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${l.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});f.remove(),sr(N,e),nr(E,e,l),ar(w,e,l),hr(u,e);let c=lr(l,a,r),t=fr(a,l),i=l.getConfigField("iconSize"),h=l.getConfigField("idealEdgeLengthMultiplier")*i,g=.5*i,s=l.getConfigField("edgeElasticity"),L=e.layout({name:"fcose",quality:"proof",randomize:l.getConfigField("randomize"),nodeSeparation:l.getConfigField("nodeSeparation"),numIter:l.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(y){let[p,C]=y.connectedNodes(),{parent:R}=ee(p),{parent:A}=ee(C);return R===A?h:g},edgeElasticity(y){let[p,C]=y.connectedNodes(),{parent:R}=ee(p),{parent:A}=ee(C);return R===A?s:.001},alignmentConstraint:c,relativePlacementConstraint:t});L.one("layoutstop",()=>{function y(p,C,R,A){let b,W,{x:G,y:J}=p,{x,y:z}=C;W=(A-J+(G-R)*(J-z)/(G-x))/Math.sqrt(1+Math.pow((J-z)/(G-x),2)),b=Math.sqrt(Math.pow(A-J,2)+Math.pow(R-G,2)-Math.pow(W,2));let o=Math.sqrt(Math.pow(x-G,2)+Math.pow(z-J,2));b=b/o;let m=(x-G)*(A-J)-(z-J)*(R-G);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}let d=(x-G)*(R-G)+(z-J)*(A-J);switch(!0){case d>=0:d=1;break;case d<0:d=-1;break}return W=Math.abs(W)*m,b=b*d,{distances:W,weights:b}}ct(y,"getSegmentWeights"),e.startBatch();for(let p of Object.values(e.edges()))if(p.data?.()){let{x:C,y:R}=p.source().position(),{x:A,y:b}=p.target().position();if(C!==A&&R!==b){let W=p.sourceEndpoint(),G=p.targetEndpoint(),{sourceDir:J}=tr(p),[x,z]=Zt(J)?[W.x,G.y]:[G.x,W.y],{weights:o,distances:m}=y(W,G,x,z);p.style("segment-distances",m),p.style("segment-weights",o)}}e.endBatch(),L.run()}),L.run(),e.ready(y=>{ye.info("Ready",y),n(e)})})}ct(cr,"layoutArchitecture");var Ir=ct(async(E,w,N,u)=>{let l=u.db;l.setDiagramId(w);let a=l.getServices(),r=l.getJunctions(),n=l.getGroups(),f=l.getEdges(),e=l.getDataStructures(),c=ze(w),t=c.append("g");t.attr("class","architecture-edges");let i=c.append("g");i.attr("class","architecture-services");let h=c.append("g");h.attr("class","architecture-groups"),await Dr(l,i,a,w),xr(l,i,r,w);let g=await cr(a,r,n,f,l,e);await Mr(t,g,l,w),await Or(h,g,l,w),or(l,g),be(void 0,c,l.getConfigField("padding"),l.getConfigField("useMaxWidth"))},"draw"),Rr={draw:Ir},Wr={parser:rr,get db(){return new er},renderer:Rr,styles:wr};export{Wr as diagram};