MCPcopy Index your code
hub / github.com/google/adk-python / _

Function _

src/google/adk/cli/browser/chunk-3YZ77ADE.js:1–1  ·  view source on GitHub ↗
(W)

Source from the content-addressed store, hash-verified

1import{a as Ke}from"./chunk-DMWOYWYQ.js";import{a as je}from"./chunk-T3Q3QCCV.js";import"./chunk-NQKWI5EB.js";import"./chunk-WR6HISGZ.js";import"./chunk-I4UDKKN5.js";import"./chunk-2DLZXFEQ.js";import"./chunk-JNY2YWG7.js";import"./chunk-XULIXUQL.js";import{a as Ne}from"./chunk-YVVLWU7S.js";import"./chunk-3NJNOY56.js";import"./chunk-NALL4A3P.js";import{a as ke}from"./chunk-TPDTRWWV.js";import{b as Qe,c as Je,d as ce,f as ge}from"./chunk-WXI2IBAH.js";import{l as Ze,p as qe}from"./chunk-WBLSVR3V.js";import"./chunk-GP6TCC26.js";import{A as Ge,G as Ue,O as Ye,R as Xe,S as He,T as We,U as Ve,V as ze,W as Be,X as $e,Y as fe,r as Pe}from"./chunk-QFMJV7VH.js";import{a as be,g as ct,i as Te}from"./chunk-JRNAXTJ7.js";import"./chunk-ASJUXEUE.js";import"./chunk-EGBSMT36.js";import{a as ee,b as le,e as me,h as pr,j as Zt}from"./chunk-RMXJBC7V.js";var Ce=me((ne,Le)=>{"use strict";(function(w,N){typeof ne=="object"&&typeof Le=="object"?Le.exports=N():typeof define=="function"&&define.amd?define([],N):typeof ne=="object"?ne.layoutBase=N():w.layoutBase=N()})(ne,function(){return(function(E){var w={};function N(u){if(w[u])return w[u].exports;var o=w[u]={i:u,l:!1,exports:{}};return E[u].call(o.exports,o,o.exports,N),o.l=!0,o.exports}return N.m=E,N.c=w,N.i=function(u){return u},N.d=function(u,o,a){N.o(u,o)||Object.defineProperty(u,o,{configurable:!1,enumerable:!0,get:a})},N.n=function(u){var o=u&&u.__esModule?function(){return u.default}:function(){return u};return N.d(o,"a",o),o},N.o=function(u,o){return Object.prototype.hasOwnProperty.call(u,o)},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),o=N(8),a=N(9);function e(c,t,g){u.call(this,g),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=g,this.bendpoints=[],this.source=c,this.target=t}e.prototype=Object.create(u.prototype);for(var n in u)e[n]=u[n];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;if(this.target===c)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(c,t){for(var g=this.getOtherEnd(c),i=t.getGraphManager().getRoot();;){if(g.getOwner()==t)return g;if(g.getOwner()==i)break;g=g.getOwner().getParent()}return null},e.prototype.updateLength=function(){var c=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),c),this.isOverlapingSourceAndTarget||(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[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))},e.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=e}),(function(E,w,N){"use strict";function u(o){this.vGraphObject=o}E.exports=u}),(function(E,w,N){"use strict";var u=N(2),o=N(10),a=N(13),e=N(0),n=N(16),c=N(5);function t(i,r,h,f){h==null&&f==null&&(f=r),u.call(this,f),i.graphManager!=null&&(i=i.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=i,h!=null&&r!=null?this.rect=new a(r.x,r.y,h.width,h.height):this.rect=new a}t.prototype=Object.create(u.prototype);for(var g in u)t[g]=u[g];t.prototype.getEdges=function(){return this.edges},t.prototype.getChild=function(){return this.child},t.prototype.getOwner=function(){return this.owner},t.prototype.getWidth=function(){return this.rect.width},t.prototype.setWidth=function(i){this.rect.width=i},t.prototype.getHeight=function(){return this.rect.height},t.prototype.setHeight=function(i){this.rect.height=i},t.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},t.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},t.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},t.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},t.prototype.getRect=function(){return this.rect},t.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},t.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},t.prototype.setRect=function(i,r){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=r.width,this.rect.height=r.height},t.prototype.setCenter=function(i,r){this.rect.x=i-this.rect.width/2,this.rect.y=r-this.rect.height/2},t.prototype.setLocation=function(i,r){this.rect.x=i,this.rect.y=r},t.prototype.moveBy=function(i,r){this.rect.x+=i,this.rect.y+=r},t.prototype.getEdgeListToNode=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(l.target==i){if(l.source!=f)throw"Incorrect edge source!";r.push(l)}}),r},t.prototype.getEdgesBetween=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(!(l.source==f||l.target==f))throw"Incorrect edge source and/or target";(l.target==i||l.source==i)&&r.push(l)}),r},t.prototype.getNeighborsList=function(){var i=new Set,r=this;return r.edges.forEach(function(h){if(h.source==r)i.add(h.target);else{if(h.target!=r)throw"Incorrect incidency!";i.add(h.source)}}),i},t.prototype.withChildren=function(){var i=new Set,r,h;if(i.add(this),this.child!=null)for(var f=this.child.getNodes(),l=0;l<f.length;l++)r=f[l],h=r.withChildren(),h.forEach(function(L){i.add(L)});return i},t.prototype.getNoOfChildren=function(){var i=0,r;if(this.child==null)i=1;else for(var h=this.child.getNodes(),f=0;f<h.length;f++)r=h[f],i+=r.getNoOfChildren();return i==0&&(i=1),i},t.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},t.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)},t.prototype.scatter=function(){var i,r,h=-e.INITIAL_WORLD_BOUNDARY,f=e.INITIAL_WORLD_BOUNDARY;i=e.WORLD_CENTER_X+n.nextDouble()*(f-h)+h;var l=-e.INITIAL_WORLD_BOUNDARY,L=e.INITIAL_WORLD_BOUNDARY;r=e.WORLD_CENTER_Y+n.nextDouble()*(L-l)+l,this.rect.x=i,this.rect.y=r},t.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),e.NODE_DIMENSIONS_INCLUDE_LABELS){var r=i.getRight()-i.getLeft(),h=i.getBottom()-i.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(r+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>r?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(h+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>h?(this.rect.y-=(this.labelHeight-h)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(h+this.labelHeight))}}},t.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},t.prototype.transform=function(i){var r=this.rect.x;r>e.WORLD_BOUNDARY?r=e.WORLD_BOUNDARY:r<-e.WORLD_BOUNDARY&&(r=-e.WORLD_BOUNDARY);var h=this.rect.y;h>e.WORLD_BOUNDARY?h=e.WORLD_BOUNDARY:h<-e.WORLD_BOUNDARY&&(h=-e.WORLD_BOUNDARY);var f=new c(r,h),l=i.inverseTransformPoint(f);this.setLocation(l.x,l.y)},t.prototype.getLeft=function(){return this.rect.x},t.prototype.getRight=function(){return this.rect.x+this.rect.width},t.prototype.getTop=function(){return this.rect.y},t.prototype.getBottom=function(){return this.rect.y+this.rect.height},t.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},E.exports=t}),(function(E,w,N){"use strict";var u=N(0);function o(){}for(var a in u)o[a]=u[a];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,o.MAX_NODE_DISPLACEMENT=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,E.exports=o}),(function(E,w,N){"use strict";function u(o,a){o==null&&a==null?(this.x=0,this.y=0):(this.x=o,this.y=a)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(o){this.x=o},u.prototype.setY=function(o){this.y=o},u.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},E.exports=u}),(function(E,w,N){"use strict";var u=N(2),o=N(10),a=N(0),e=N(7),n=N(3),c=N(1),t=N(13),g=N(12),i=N(11);function r(f,l,L){u.call(this,L),this.estimatedSize=o.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}r.prototype=Object.create(u.prototype);for(var h in u)r[h]=u[h];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(f,l,L){if(l==null&&L==null){var y=f;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=f;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(L)>-1))throw"Source or target not in graph!";if(!(l.owner==L.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=L.owner?null:(p.source=l,p.target=L,p.isInterGraph=!1,this.getEdges().push(p),l.edges.push(p),L!=l&&L.edges.push(p),p)}},r.prototype.remove=function(f){var l=f;if(f instanceof n){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var L=l.edges.slice(),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(l);if(R==-1)throw"Node not in owner node list!";this.nodes.splice(R,1)}else if(f instanceof c){var y=f;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),S=y.target.edges.indexOf(y);if(!(A>-1&&S>-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(S,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)}},r.prototype.updateLeftTop=function(){for(var f=o.MAX_VALUE,l=o.MAX_VALUE,L,y,p,C=this.getNodes(),R=C.length,A=0;A<R;A++){var S=C[A];L=S.getTop(),y=S.getLeft(),f>L&&(f=L),l>y&&(l=y)}return f==o.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?p=C[0].getParent().paddingLeft:p=this.margin,this.left=l-p,this.top=f-p,new g(this.left,this.top))},r.prototype.updateBounds=function(f){for(var l=o.MAX_VALUE,L=-o.MAX_VALUE,y=o.MAX_VALUE,p=-o.MAX_VALUE,C,R,A,S,B,Y=this.nodes,tt=Y.length,x=0;x<tt;x++){var Z=Y[x];f&&Z.child!=null&&Z.updateBounds(),C=Z.getLeft(),R=Z.getRight(),A=Z.getTop(),S=Z.getBottom(),l>C&&(l=C),L<R&&(L=R),y>A&&(y=A),p<S&&(p=S)}var s=new t(l,y,L-l,p-y);l==o.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),Y[0].getParent().paddingLeft!=null?B=Y[0].getParent().paddingLeft:B=this.margin,this.left=s.x-B,this.right=s.x+s.width+B,this.top=s.y-B,this.bottom=s.y+s.height+B},r.calculateBounds=function(f){for(var l=o.MAX_VALUE,L=-o.MAX_VALUE,y=o.MAX_VALUE,p=-o.MAX_VALUE,C,R,A,S,B=f.length,Y=0;Y<B;Y++){var tt=f[Y];C=tt.getLeft(),R=tt.getRight(),A=tt.getTop(),S=tt.getBottom(),l>C&&(l=C),L<R&&(L=R),y>A&&(y=A),p<S&&(p=S)}var x=new t(l,y,L-l,p-y);return x},r.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){for(var f=0,l=this.nodes,L=l.length,y=0;y<L;y++){var p=l[y];f+=p.calcEstimatedSize()}return f==0?this.estimatedSize=a.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=f/Math.sqrt(this.nodes.length),this.estimatedSize},r.prototype.updateConnected=function(){var f=this;if(this.nodes.length==0){this.isConnected=!0;return}var l=new i,L=new Set,y=this.nodes[0],p,C,R=y.withChildren();for(R.forEach(function(x){l.push(x),L.add(x)});l.length!==0;){y=l.shift(),p=y.getEdges();for(var A=p.length,S=0;S<A;S++){var B=p[S];if(C=B.getOtherEndInGraph(y,this),C!=null&&!L.has(C)){var Y=C.withChildren();Y.forEach(function(x){l.push(x),L.add(x)})}}}if(this.isConnected=!1,L.size>=this.nodes.length){var tt=0;L.forEach(function(x){x.owner==f&&tt++}),tt==this.nodes.length&&(this.isConnected=!0)}},E.exports=r}),(function(E,w,N){"use strict";var u,o=N(1);function a(e){u=N(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),n=this.layout.newNode(null),c=this.add(e,n);return this.setRootGraph(c),this.rootGraph},a.prototype.add=function(e,n,c,t,g){if(c==null&&t==null&&g==null){if(e==null)throw"Graph is null!";if(n==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(n.child!=null)throw"Already has a child!";return e.parent=n,n.child=e,e}else{g=c,t=n,c=e;var i=t.getOwner(),r=g.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(r!=null&&r.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==r)return c.isInterGraph=!1,i.add(c,t,g);if(c.isInterGraph=!0,c.source=t,c.target=g,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}},a.prototype.remove=function(e){if(e instanceof u){var n=e;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 c=[];c=c.concat(n.getEdges());for(var t,g=c.length,i=0;i<g;i++)t=c[i],n.remove(t);var r=[];r=r.concat(n.getNodes());var h;g=r.length;for(var i=0;i<g;i++)h=r[i],n.remove(h);n==this.rootGraph&&this.setRootGraph(null);var f=this.graphs.indexOf(n);this.graphs.splice(f,1),n.parent=null}else if(e instanceof o){if(t=e,t==null)throw"Edge is null!";if(!t.isInterGraph)throw"Not an inter-graph edge!";if(!(t.source!=null&&t.target!=null))throw"Source and/or target is null!";if(!(t.source.edges.indexOf(t)!=-1&&t.target.edges.indexOf(t)!=-1))throw"Source and/or target doesn't know this edge!";var f=t.source.edges.indexOf(t);if(t.source.edges.splice(f,1),f=t.target.edges.indexOf(t),t.target.edges.splice(f,1),!(t.source.owner!=null&&t.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(t.source.owner.getGraphManager().edges.indexOf(t)==-1)throw"Not in owner graph manager's edge list!";var f=t.source.owner.getGraphManager().edges.indexOf(t);t.source.owner.getGraphManager().edges.splice(f,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 e=[],n=this.getGraphs(),c=n.length,t=0;t<c;t++)e=e.concat(n[t].getNodes());this.allNodes=e}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 e=[],n=this.getGraphs(),c=n.length,t=0;t<n.length;t++)e=e.concat(n[t].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=e},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=e,e.parent==null&&(e.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(e,n){if(!(e!=null&&n!=null))throw"assert failed";if(e==n)return!0;var c=e.getOwner(),t;do{if(t=c.getParent(),t==null)break;if(t==n)return!0;if(c=t.getOwner(),c==null)break}while(!0);c=n.getOwner();do{if(t=c.getParent(),t==null)break;if(t==e)return!0;if(c=t.getOwner(),c==null)break}while(!0);return!1},a.prototype.calcLowestCommonAncestors=function(){for(var e,n,c,t,g,i=this.getAllEdges(),r=i.length,h=0;h<r;h++){if(e=i[h],n=e.source,c=e.target,e.lca=null,e.sourceInLca=n,e.targetInLca=c,n==c){e.lca=n.getOwner();continue}for(t=n.getOwner();e.lca==null;){for(e.targetInLca=c,g=c.getOwner();e.lca==null;){if(g==t){e.lca=g;break}if(g==this.rootGraph)break;if(e.lca!=null)throw"assert failed";e.targetInLca=g.getParent(),g=e.targetInLca.getOwner()}if(t==this.rootGraph)break;e.lca==null&&(e.sourceInLca=t.getParent(),t=e.sourceInLca.getOwner())}if(e.lca==null)throw"assert failed"}},a.prototype.calcLowestCommonAncestor=function(e,n){if(e==n)return e.getOwner();var c=e.getOwner();do{if(c==null)break;var t=n.getOwner();do{if(t==null)break;if(t==c)return t;t=t.getParent().getOwner()}while(!0);c=c.getParent().getOwner()}while(!0);return c},a.prototype.calcInclusionTreeDepths=function(e,n){e==null&&n==null&&(e=this.rootGraph,n=1);for(var c,t=e.getNodes(),g=t.length,i=0;i<g;i++)c=t[i],c.inclusionTreeDepth=n,c.child!=null&&this.calcInclusionTreeDepths(c.child,n+1)},a.prototype.includesInvalidEdge=function(){for(var e,n=[],c=this.edges.length,t=0;t<c;t++)e=this.edges[t],this.isOneAncestorOfOther(e.source,e.target)&&n.push(e);for(var t=0;t<n.length;t++)this.remove(n[t]);return!1},E.exports=a}),(function(E,w,N){"use strict";var u=N(12);function o(){}o.calcSeparationAmount=function(a,e,n,c){if(!a.intersects(e))throw"assert failed";var t=new Array(2);this.decideDirectionsForOverlappingNodes(a,e,t),n[0]=Math.min(a.getRight(),e.getRight())-Math.max(a.x,e.x),n[1]=Math.min(a.getBottom(),e.getBottom())-Math.max(a.y,e.y),a.getX()<=e.getX()&&a.getRight()>=e.getRight()?n[0]+=Math.min(e.getX()-a.getX(),a.getRight()-e.getRight()):e.getX()<=a.getX()&&e.getRight()>=a.getRight()&&(n[0]+=Math.min(a.getX()-e.getX(),e.getRight()-a.getRight())),a.getY()<=e.getY()&&a.getBottom()>=e.getBottom()?n[1]+=Math.min(e.getY()-a.getY(),a.getBottom()-e.getBottom()):e.getY()<=a.getY()&&e.getBottom()>=a.getBottom()&&(n[1]+=Math.min(a.getY()-e.getY(),e.getBottom()-a.getBottom()));var g=Math.abs((e.getCenterY()-a.getCenterY())/(e.getCenterX()-a.getCenterX()));e.getCenterY()===a.getCenterY()&&e.getCenterX()===a.getCenterX()&&(g=1);var i=g*n[0],r=n[1]/g;n[0]<r?r=n[0]:i=n[1],n[0]=-1*t[0]*(r/2+c),n[1]=-1*t[1]*(i/2+c)},o.decideDirectionsForOverlappingNodes=function(a,e,n){a.getCenterX()<e.getCenterX()?n[0]=-1:n[0]=1,a.getCenterY()<e.getCenterY()?n[1]=-1:n[1]=1},o.getIntersection2=function(a,e,n){var c=a.getCenterX(),t=a.getCenterY(),g=e.getCenterX(),i=e.getCenterY();if(a.intersects(e))return n[0]=c,n[1]=t,n[2]=g,n[3]=i,!0;var r=a.getX(),h=a.getY(),f=a.getRight(),l=a.getX(),L=a.getBottom(),y=a.getRight(),p=a.getWidthHalf(),C=a.getHeightHalf(),R=e.getX(),A=e.getY(),S=e.getRight(),B=e.getX(),Y=e.getBottom(),tt=e.getRight(),x=e.getWidthHalf(),Z=e.getHeightHalf(),s=!1,m=!1;if(c===g){if(t>i)return n[0]=c,n[1]=h,n[2]=g,n[3]=Y,!1;if(t<i)return n[0]=c,n[1]=L,n[2]=g,n[3]=A,!1}else if(t===i){if(c>g)return n[0]=r,n[1]=t,n[2]=S,n[3]=i,!1;if(c<g)return n[0]=f,n[1]=t,n[2]=R,n[3]=i,!1}else{var v=a.height/a.width,T=e.height/e.width,d=(i-t)/(g-c),D=void 0,O=void 0,P=void 0,F=void 0,I=void 0,k=void 0;if(-v===d?c>g?(n[0]=l,n[1]=L,s=!0):(n[0]=f,n[1]=h,s=!0):v===d&&(c>g?(n[0]=r,n[1]=h,s=!0):(n[0]=y,n[1]=L,s=!0)),-T===d?g>c?(n[2]=B,n[3]=Y,m=!0):(n[2]=S,n[3]=A,m=!0):T===d&&(g>c?(n[2]=R,n[3]=A,m=!0):(n[2]=tt,n[3]=Y,m=!0)),s&&m)return!1;if(c>g?t>i?(D=this.getCardinalDirection(v,d,4),O=this.getCardinalDirection(T,d,2)):(D=this.getCardinalDirection(-v,d,3),O=this.getCardinalDirection(-T,d,1)):t>i?(D=this.getCardinalDirection(-v,d,1),O=this.getCardinalDirection(-T,d,3)):(D=this.getCardinalDirection(v,d,2),O=this.getCardinalDirection(T,d,4)),!s)switch(D){case 1:F=h,P=c+-C/d,n[0]=P,n[1]=F;break;case 2:P=y,F=t+p*d,n[0]=P,n[1]=F;break;case 3:F=L,P=c+C/d,n[0]=P,n[1]=F;break;case 4:P=l,F=t+-p*d,n[0]=P,n[1]=F;break}if(!m)switch(O){case 1:k=A,I=g+-Z/d,n[2]=I,n[3]=k;break;case 2:I=tt,k=i+x*d,n[2]=I,n[3]=k;break;case 3:k=Y,I=g+Z/d,n[2]=I,n[3]=k;break;case 4:I=B,k=i+-x*d,n[2]=I,n[3]=k;break}}return!1},o.getCardinalDirection=function(a,e,n){return a>e?n:1+n%4},o.getIntersection=function(a,e,n,c){if(c==null)return this.getIntersection2(a,e,n);var t=a.x,g=a.y,i=e.x,r=e.y,h=n.x,f=n.y,l=c.x,L=c.y,y=void 0,p=void 0,C=void 0,R=void 0,A=void 0,S=void 0,B=void 0,Y=void 0,tt=void 0;return C=r-g,A=t-i,B=i*g-t*r,R=L-f,S=h-l,Y=l*f-h*L,tt=C*S-R*A,tt===0?null:(y=(A*Y-S*B)/tt,p=(R*B-C*Y)/tt,new u(y,p))},o.angleOfVector=function(a,e,n,c){var t=void 0;return a!==n?(t=Math.atan((c-e)/(n-a)),n<a?t+=Math.PI:c<e&&(t+=this.TWO_PI)):c<e?t=this.ONE_AND_HALF_PI:t=this.HALF_PI,t},o.doIntersect=function(a,e,n,c){var t=a.x,g=a.y,i=e.x,r=e.y,h=n.x,f=n.y,l=c.x,L=c.y,y=(i-t)*(L-f)-(l-h)*(r-g);if(y===0)return!1;var p=((L-f)*(l-t)+(h-l)*(L-g))/y,C=((g-r)*(l-t)+(i-t)*(L-g))/y;return 0<p&&p<1&&0<C&&C<1},o.findCircleLineIntersections=function(a,e,n,c,t,g,i){var r=(n-a)*(n-a)+(c-e)*(c-e),h=2*((a-t)*(n-a)+(e-g)*(c-e)),f=(a-t)*(a-t)+(e-g)*(e-g)-i*i,l=h*h-4*r*f;if(l>=0){var L=(-h+Math.sqrt(h*h-4*r*f))/(2*r),y=(-h-Math.sqrt(h*h-4*r*f))/(2*r),p=null;return L>=0&&L<=1?[L]:y>=0&&y<=1?[y]:p}else return null},o.HALF_PI=.5*Math.PI,o.ONE_AND_HALF_PI=1.5*Math.PI,o.TWO_PI=2*Math.PI,o.THREE_PI=3*Math.PI,E.exports=o}),(function(E,w,N){"use strict";function u(){}u.sign=function(o){return o>0?1:o<0?-1:0},u.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},u.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},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 t(g,i){for(var r=0;r<i.length;r++){var h=i[r];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(g,h.key,h)}}return function(g,i,r){return i&&t(g.prototype,i),r&&t(g,r),g}})();function o(t,g){if(!(t instanceof g))throw new TypeError("Cannot call a class as a function")}var a=function(g){return{value:g,next:null,prev:null}},e=function(g,i,r,h){return g!==null?g.next=i:h.head=i,r!==null?r.prev=i:h.tail=i,i.prev=g,i.next=r,h.length++,i},n=function(g,i){var r=g.prev,h=g.next;return r!==null?r.next=h:i.head=h,h!==null?h.prev=r:i.tail=r,g.prev=g.next=null,i.length--,g},c=(function(){function t(g){var i=this;o(this,t),this.length=0,this.head=null,this.tail=null,g?.forEach(function(r){return i.push(r)})}return u(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,r){return e(r.prev,a(i),r,this)}},{key:"insertAfter",value:function(i,r){return e(r,a(i),r.next,this)}},{key:"insertNodeBefore",value:function(i,r){return e(r.prev,i,r,this)}},{key:"insertNodeAfter",value:function(i,r){return e(r,i,r.next,this)}},{key:"push",value:function(i){return e(this.tail,a(i),null,this)}},{key:"unshift",value:function(i){return e(null,a(i),this.head,this)}},{key:"remove",value:function(i){return n(i,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(i){if(i<=this.length()){for(var r=1,h=this.head;r<i;)h=h.next,r++;return h.value}}},{key:"set_object_at",value:function(i,r){if(i<=this.length()){for(var h=1,f=this.head;h<i;)f=f.next,h++;f.value=r}}}]),t})();E.exports=c}),(function(E,w,N){"use strict";function u(o,a,e){this.x=null,this.y=null,o==null&&a==null&&e==null?(this.x=0,this.y=0):typeof o=="number"&&typeof a=="number"&&e==null?(this.x=o,this.y=a):o.constructor.name=="Point"&&a==null&&e==null&&(e=o,this.x=e.x,this.y=e.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(o,a,e){o.constructor.name=="Point"&&a==null&&e==null?(e=o,this.setLocation(e.x,e.y)):typeof o=="number"&&typeof a=="number"&&e==null&&(parseInt(o)==o&&parseInt(a)==a?this.move(o,a):(this.x=Math.floor(o+.5),this.y=Math.floor(a+.5)))},u.prototype.move=function(o,a){this.x=o,this.y=a},u.prototype.translate=function(o,a){this.x+=o,this.y+=a},u.prototype.equals=function(o){if(o.constructor.name=="Point"){var a=o;return this.x==a.x&&this.y==a.y}return this==o},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(o,a,e,n){this.x=0,this.y=0,this.width=0,this.height=0,o!=null&&a!=null&&e!=null&&n!=null&&(this.x=o,this.y=a,this.width=e,this.height=n)}u.prototype.getX=function(){return this.x},u.prototype.setX=function(o){this.x=o},u.prototype.getY=function(){return this.y},u.prototype.setY=function(o){this.y=o},u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(o){this.width=o},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(o){this.height=o},u.prototype.getRight=function(){return this.x+this.width},u.prototype.getBottom=function(){return this.y+this.height},u.prototype.intersects=function(o){return!(this.getRight()<o.x||this.getBottom()<o.y||o.getRight()<this.x||o.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 o(){}o.lastID=0,o.createID=function(a){return o.isPrimitive(a)?a:(a.uniqueID!=null||(a.uniqueID=o.getString(),o.lastID++),a.uniqueID)},o.getString=function(a){return a==null&&(a=o.lastID),"Object#"+a},o.isPrimitive=function(a){var e=typeof a>"u"?"undefined":u(a);return a==null||e!="object"&&e!="function"},E.exports=o}),(function(E,w,N){"use strict";function u(h){if(Array.isArray(h)){for(var f=0,l=Array(h.length);f<h.length;f++)l[f]=h[f];return l}else return Array.from(h)}var o=N(0),a=N(7),e=N(3),n=N(1),c=N(6),t=N(5),g=N(17),i=N(29);function r(h){i.call(this),this.layoutQuality=o.QUALITY,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=o.DEFAULT_INCREMENTAL,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=o.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)}r.RANDOM_SEED=1,r.prototype=Object.create(i.prototype),r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},r.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},r.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},r.prototype.newGraphManager=function(){var h=new a(this);return this.graphManager=h,h},r.prototype.newGraph=function(h){return new c(null,this.graphManager,h)},r.prototype.newNode=function(h){return new e(this.graphManager,h)},r.prototype.newEdge=function(h){return new n(null,null,h)},r.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},r.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var h;return this.checkLayoutSuccess()?h=!1:h=this.layout(),o.ANIMATE==="during"?!1:(h&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,h)},r.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},r.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var h,f=this.graphManager.getAllEdges(),l=0;l<f.length;l++)h=f[l];for(var L,y=this.graphManager.getRoot().getNodes(),l=0;l<y.length;l++)L=y[l];this.update(this.graphManager.getRoot())}},r.prototype.update=function(h){if(h==null)this.update2();else if(h instanceof e){var f=h;if(f.getChild()!=null)for(var l=f.getChild().getNodes(),L=0;L<l.length;L++)update(l[L]);if(f.vGraphObject!=null){var y=f.vGraphObject;y.update(f)}}else if(h instanceof n){var p=h;if(p.vGraphObject!=null){var C=p.vGraphObject;C.update(p)}}else if(h instanceof c){var R=h;if(R.vGraphObject!=null){var A=R.vGraphObject;A.update(R)}}},r.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=o.QUALITY,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=o.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},r.prototype.transform=function(h){if(h==null)this.transform(new t(0,0));else{var f=new g,l=this.graphManager.getRoot().updateLeftTop();if(l!=null){f.setWorldOrgX(h.x),f.setWorldOrgY(h.y),f.setDeviceOrgX(l.x),f.setDeviceOrgY(l.y);for(var L=this.getAllNodes(),y,p=0;p<L.length;p++)y=L[p],y.transform(f)}}},r.prototype.positionNodesRandomly=function(h){if(h==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var f,l,L=h.getNodes(),y=0;y<L.length;y++)f=L[y],l=f.getChild(),l==null||l.getNodes().length==0?f.scatter():(this.positionNodesRandomly(l),f.updateBounds())},r.prototype.getFlatForest=function(){for(var h=[],f=!0,l=this.graphManager.getRoot().getNodes(),L=!0,y=0;y<l.length;y++)l[y].getChild()!=null&&(L=!1);if(!L)return h;var p=new Set,C=[],R=new Map,A=[];for(A=A.concat(l);A.length>0&&f;){for(C.push(A[0]);C.length>0&&f;){var S=C[0];C.splice(0,1),p.add(S);for(var B=S.getEdges(),y=0;y<B.length;y++){var Y=B[y].getOtherEnd(S);if(R.get(S)!=Y)if(!p.has(Y))C.push(Y),R.set(Y,S);else{f=!1;break}}}if(!f)h=[];else{var tt=[].concat(u(p));h.push(tt);for(var y=0;y<tt.length;y++){var x=tt[y],Z=A.indexOf(x);Z>-1&&A.splice(Z,1)}p=new Set,R=new Map}}return h},r.prototype.createDummyNodesForBendpoints=function(h){for(var f=[],l=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,l,p),f.add(p),l=p}var C=this.newEdge(null);return this.graphManager.add(C,l,h.target),this.edgeToDummyNodes.set(h,f),h.isInterGraph()?this.graphManager.remove(h):L.remove(h),f},r.prototype.createBendpointsFromDummyNodes=function(){var h=[];h=h.concat(this.graphManager.getAllEdges()),h=[].concat(u(this.edgeToDummyNodes.keys())).concat(h);for(var f=0;f<h.length;f++){var l=h[f];if(l.bendpoints.length>0){for(var L=this.edgeToDummyNodes.get(l),y=0;y<L.length;y++){var p=L[y],C=new t(p.getCenterX(),p.getCenterY()),R=l.bendpoints.get(y);R.x=C.x,R.y=C.y,p.getOwner().remove(p)}this.graphManager.add(l,l.source,l.target)}}},r.transform=function(h,f,l,L){if(l!=null&&L!=null){var y=f;if(h<=50){var p=f/l;y-=(f-p)/50*(50-h)}else{var C=f*L;y+=(C-f)/50*(h-50)}return y}else{var R,A;return h<=50?(R=9*f/500,A=f/10):(R=9*f/50,A=-8*f),R*h+A}},r.findCenterOfTree=function(h){var f=[];f=f.concat(h);var l=[],L=new Map,y=!1,p=null;(f.length==1||f.length==2)&&(y=!0,p=f[0]);for(var C=0;C<f.length;C++){var R=f[C],A=R.getNeighborsList().size;L.set(R,R.getNeighborsList().size),A==1&&l.push(R)}var S=[];for(S=S.concat(l);!y;){var B=[];B=B.concat(S),S=[];for(var C=0;C<f.length;C++){var R=f[C],Y=f.indexOf(R);Y>=0&&f.splice(Y,1);var tt=R.getNeighborsList();tt.forEach(function(s){if(l.indexOf(s)<0){var m=L.get(s),v=m-1;v==1&&S.push(s),L.set(s,v)}})}l=l.concat(S),(f.length==1||f.length==2)&&(y=!0,p=f[0])}return p},r.prototype.setGraphManager=function(h){this.graphManager=h},E.exports=r}),(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 o(a,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(a){this.lworldExtX=a},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(a){this.lworldExtY=a},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},o.prototype.transformX=function(a){var e=0,n=this.lworldExtX;return n!=0&&(e=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/n),e},o.prototype.transformY=function(a){var e=0,n=this.lworldExtY;return n!=0&&(e=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/n),e},o.prototype.inverseTransformX=function(a){var e=0,n=this.ldeviceExtX;return n!=0&&(e=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/n),e},o.prototype.inverseTransformY=function(a){var e=0,n=this.ldeviceExtY;return n!=0&&(e=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/n),e},o.prototype.inverseTransformPoint=function(a){var e=new u(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return e},E.exports=o}),(function(E,w,N){"use strict";function u(i){if(Array.isArray(i)){for(var r=0,h=Array(i.length);r<i.length;r++)h[r]=i[r];return h}else return Array.from(i)}var o=N(15),a=N(4),e=N(0),n=N(8),c=N(9);function t(){o.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}t.prototype=Object.create(o.prototype);for(var g in o)t[g]=o[g];t.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},t.prototype.calcIdealEdgeLengths=function(){for(var i,r,h,f,l,L,y,p=this.getGraphManager().getAllEdges(),C=0;C<p.length;C++)i=p[C],r=i.idealLength,i.isInterGraph&&(f=i.getSource(),l=i.getTarget(),L=i.getSourceInLca().getEstimatedSize(),y=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(i.idealLength+=L+y-2*e.SIMPLE_NODE_SIZE),h=i.getLca().getInclusionTreeDepth(),i.idealLength+=r*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(f.getInclusionTreeDepth()+l.getInclusionTreeDepth()-2*h))},t.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;this.incremental?(i>a.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-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):(i>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(i-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()},t.prototype.calcSpringForces=function(){for(var i=this.getAllEdges(),r,h=0;h<i.length;h++)r=i[h],this.calcSpringForce(r,r.idealLength)},t.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h,f,l,L,y=this.getAllNodes(),p;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&i&&this.updateGrid(),p=new Set,h=0;h<y.length;h++)l=y[h],this.calculateRepulsionForceOfANode(l,p,i,r),p.add(l);else for(h=0;h<y.length;h++)for(l=y[h],f=h+1;f<y.length;f++)L=y[f],l.getOwner()==L.getOwner()&&this.calcRepulsionForce(l,L)},t.prototype.calcGravitationalForces=function(){for(var i,r=this.getAllNodesToApplyGravitation(),h=0;h<r.length;h++)i=r[h],this.calcGravitationalForce(i)},t.prototype.moveNodes=function(){for(var i=this.getAllNodes(),r,h=0;h<i.length;h++)r=i[h],r.move()},t.prototype.calcSpringForce=function(i,r){var h=i.getSource(),f=i.getTarget(),l,L,y,p;if(this.uniformLeafNodeSizes&&h.getChild()==null&&f.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;l=i.getLength(),l!=0&&(L=i.edgeElasticity*(l-r),y=L*(i.lengthX/l),p=L*(i.lengthY/l),h.springForceX+=y,h.springForceY+=p,f.springForceX-=y,f.springForceY-=p)},t.prototype.calcRepulsionForce=function(i,r){var h=i.getRect(),f=r.getRect(),l=new Array(2),L=new Array(4),y,p,C,R,A,S,B;if(h.intersects(f)){n.calcSeparationAmount(h,f,l,a.DEFAULT_EDGE_LENGTH/2),S=2*l[0],B=2*l[1];var Y=i.noOfChildren*r.noOfChildren/(i.noOfChildren+r.noOfChildren);i.repulsionForceX-=Y*S,i.repulsionForceY-=Y*B,r.repulsionForceX+=Y*S,r.repulsionForceY+=Y*B}else this.uniformLeafNodeSizes&&i.getChild()==null&&r.getChild()==null?(y=f.getCenterX()-h.getCenterX(),p=f.getCenterY()-h.getCenterY()):(n.getIntersection(h,f,L),y=L[2]-L[0],p=L[3]-L[1]),Math.abs(y)<a.MIN_REPULSION_DIST&&(y=c.sign(y)*a.MIN_REPULSION_DIST),Math.abs(p)<a.MIN_REPULSION_DIST&&(p=c.sign(p)*a.MIN_REPULSION_DIST),C=y*y+p*p,R=Math.sqrt(C),A=(i.nodeRepulsion/2+r.nodeRepulsion/2)*i.noOfChildren*r.noOfChildren/C,S=A*y/R,B=A*p/R,i.repulsionForceX-=S,i.repulsionForceY-=B,r.repulsionForceX+=S,r.repulsionForceY+=B},t.prototype.calcGravitationalForce=function(i){var r,h,f,l,L,y,p,C;r=i.getOwner(),h=(r.getRight()+r.getLeft())/2,f=(r.getTop()+r.getBottom())/2,l=i.getCenterX()-h,L=i.getCenterY()-f,y=Math.abs(l)+i.getWidth()/2,p=Math.abs(L)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()?(C=r.getEstimatedSize()*this.gravityRangeFactor,(y>C||p>C)&&(i.gravitationForceX=-this.gravityConstant*l,i.gravitationForceY=-this.gravityConstant*L)):(C=r.getEstimatedSize()*this.compoundGravityRangeFactor,(y>C||p>C)&&(i.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*L*this.compoundGravityConstant))},t.prototype.isConverged=function(){var i,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||r},t.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},t.prototype.calcNoOfChildrenForAllNodes=function(){for(var i,r=this.graphManager.getAllNodes(),h=0;h<r.length;h++)i=r[h],i.noOfChildren=i.getNoOfChildren()},t.prototype.calcGrid=function(i){var r=0,h=0;r=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),h=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));for(var f=new Array(r),l=0;l<r;l++)f[l]=new Array(h);for(var l=0;l<r;l++)for(var L=0;L<h;L++)f[l][L]=new Array;return f},t.prototype.addNodeToGrid=function(i,r,h){var f=0,l=0,L=0,y=0;f=parseInt(Math.floor((i.getRect().x-r)/this.repulsionRange)),l=parseInt(Math.floor((i.getRect().width+i.getRect().x-r)/this.repulsionRange)),L=parseInt(Math.floor((i.getRect().y-h)/this.repulsionRange)),y=parseInt(Math.floor((i.getRect().height+i.getRect().y-h)/this.repulsionRange));for(var p=f;p<=l;p++)for(var C=L;C<=y;C++)this.grid[p][C].push(i),i.setGridCoordinates(f,l,L,y)},t.prototype.updateGrid=function(){var i,r,h=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),i=0;i<h.length;i++)r=h[i],this.addNodeToGrid(r,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},t.prototype.calculateRepulsionForceOfANode=function(i,r,h,f){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&h||f){var l=new Set;i.surrounding=new Array;for(var L,y=this.grid,p=i.startX-1;p<i.finishX+2;p++)for(var C=i.startY-1;C<i.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],!(i.getOwner()!=L.getOwner()||i==L)&&!r.has(L)&&!l.has(L)){var A=Math.abs(i.getCenterX()-L.getCenterX())-(i.getWidth()/2+L.getWidth()/2),S=Math.abs(i.getCenterY()-L.getCenterY())-(i.getHeight()/2+L.getHeight()/2);A<=this.repulsionRange&&S<=this.repulsionRange&&l.add(L)}}i.surrounding=[].concat(u(l))}for(p=0;p<i.surrounding.length;p++)this.calcRepulsionForce(i,i.surrounding[p])},t.prototype.calcRepulsionRange=function(){return 0},E.exports=t}),(function(E,w,N){"use strict";var u=N(1),o=N(4);function a(n,c,t){u.call(this,n,c,t),this.idealLength=o.DEFAULT_EDGE_LENGTH,this.edgeElasticity=o.DEFAULT_SPRING_STRENGTH}a.prototype=Object.create(u.prototype);for(var e in u)a[e]=u[e];E.exports=a}),(function(E,w,N){"use strict";var u=N(3),o=N(4);function a(n,c,t,g){u.call(this,n,c,t,g),this.nodeRepulsion=o.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 e in u)a[e]=u[e];a.prototype.setGridCoordinates=function(n,c,t,g){this.startX=n,this.finishX=c,this.startY=t,this.finishY=g},E.exports=a}),(function(E,w,N){"use strict";function u(o,a){this.width=0,this.height=0,o!==null&&a!==null&&(this.height=a,this.width=o)}u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(o){this.width=o},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(o){this.height=o},E.exports=u}),(function(E,w,N){"use strict";var u=N(14);function o(){this.map={},this.keys=[]}o.prototype.put=function(a,e){var n=u.createID(a);this.contains(n)||(this.map[n]=e,this.keys.push(a))},o.prototype.contains=function(a){var e=u.createID(a);return this.map[a]!=null},o.prototype.get=function(a){var e=u.createID(a);return this.map[e]},o.prototype.keySet=function(){return this.keys},E.exports=o}),(function(E,w,N){"use strict";var u=N(14);function o(){this.set={}}o.prototype.add=function(a){var e=u.createID(a);this.contains(e)||(this.set[e]=a)},o.prototype.remove=function(a){delete this.set[u.createID(a)]},o.prototype.clear=function(){this.set={}},o.prototype.contains=function(a){return this.set[u.createID(a)]==a},o.prototype.isEmpty=function(){return this.size()===0},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAllTo=function(a){for(var e=Object.keys(this.set),n=e.length,c=0;c<n;c++)a.push(this.set[e[c]])},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAll=function(a){for(var e=a.length,n=0;n<e;n++){var c=a[n];this.add(c)}},E.exports=o}),(function(E,w,N){"use strict";function u(){}u.multMat=function(o,a){for(var e=[],n=0;n<o.length;n++){e[n]=[];for(var c=0;c<a[0].length;c++){e[n][c]=0;for(var t=0;t<o[0].length;t++)e[n][c]+=o[n][t]*a[t][c]}}return e},u.transpose=function(o){for(var a=[],e=0;e<o[0].length;e++){a[e]=[];for(var n=0;n<o.length;n++)a[e][n]=o[n][e]}return a},u.multCons=function(o,a){for(var e=[],n=0;n<o.length;n++)e[n]=o[n]*a;return e},u.minusOp=function(o,a){for(var e=[],n=0;n<o.length;n++)e[n]=o[n]-a[n];return e},u.dotProduct=function(o,a){for(var e=0,n=0;n<o.length;n++)e+=o[n]*a[n];return e},u.mag=function(o){return Math.sqrt(this.dotProduct(o,o))},u.normalize=function(o){for(var a=[],e=this.mag(o),n=0;n<o.length;n++)a[n]=o[n]/e;return a},u.multGamma=function(o){for(var a=[],e=0,n=0;n<o.length;n++)e+=o[n];e*=-1/o.length;for(var c=0;c<o.length;c++)a[c]=e+o[c];return a},u.multL=function(o,a,e){for(var n=[],c=[],t=[],g=0;g<a[0].length;g++){for(var i=0,r=0;r<a.length;r++)i+=-.5*a[r][g]*o[r];c[g]=i}for(var h=0;h<e.length;h++){for(var f=0,l=0;l<e.length;l++)f+=e[h][l]*c[l];t[h]=f}for(var L=0;L<a.length;L++){for(var y=0,p=0;p<a[0].length;p++)y+=a[L][p]*t[p];n[L]=y}return n},E.exports=u}),(function(E,w,N){"use strict";var u=(function(){function n(c,t){for(var g=0;g<t.length;g++){var i=t[g];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}return function(c,t,g){return t&&n(c.prototype,t),g&&n(c,g),c}})();function o(n,c){if(!(n instanceof c))throw new TypeError("Cannot call a class as a function")}var a=N(11),e=(function(){function n(c,t){o(this,n),(t!==null||t!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var g=void 0;c instanceof a?g=c.size():g=c.length,this._quicksort(c,0,g-1)}return u(n,[{key:"_quicksort",value:function(t,g,i){if(g<i){var r=this._partition(t,g,i);this._quicksort(t,g,r),this._quicksort(t,r+1,i)}}},{key:"_partition",value:function(t,g,i){for(var r=this._get(t,g),h=g,f=i;;){for(;this.compareFunction(r,this._get(t,f));)f--;for(;this.compareFunction(this._get(t,h),r);)h++;if(h<f)this._swap(t,h,f),h++,f--;else return f}}},{key:"_get",value:function(t,g){return t instanceof a?t.get_object_at(g):t[g]}},{key:"_set",value:function(t,g,i){t instanceof a?t.set_object_at(g,i):t[g]=i}},{key:"_swap",value:function(t,g,i){var r=this._get(t,g);this._set(t,g,this._get(t,i)),this._set(t,i,r)}},{key:"_defaultCompareFunction",value:function(t,g){return g>t}}]),n})();E.exports=e}),(function(E,w,N){"use strict";function u(){}u.svd=function(o){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=o.length,this.n=o[0].length;var 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 e=(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),c=!0,t=!0,g=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m)),r=0;r<Math.max(g,i);r++){if(r<g){this.s[r]=0;for(var h=r;h<this.m;h++)this.s[r]=u.hypot(this.s[r],o[h][r]);if(this.s[r]!==0){o[r][r]<0&&(this.s[r]=-this.s[r]);for(var f=r;f<this.m;f++)o[f][r]/=this.s[r];o[r][r]+=1}this.s[r]=-this.s[r]}for(var l=r+1;l<this.n;l++){if((function(Dt,Nt){return Dt&&Nt})(r<g,this.s[r]!==0)){for(var L=0,y=r;y<this.m;y++)L+=o[y][r]*o[y][l];L=-L/o[r][r];for(var p=r;p<this.m;p++)o[p][l]+=L*o[p][r]}e[l]=o[r][l]}if((function(Dt,Nt){return Dt&&Nt})(c,r<g))for(var C=r;C<this.m;C++)this.U[C][r]=o[C][r];if(r<i){e[r]=0;for(var R=r+1;R<this.n;R++)e[r]=u.hypot(e[r],e[R]);if(e[r]!==0){e[r+1]<0&&(e[r]=-e[r]);for(var A=r+1;A<this.n;A++)e[A]/=e[r];e[r+1]+=1}if(e[r]=-e[r],(function(Dt,Nt){return Dt&&Nt})(r+1<this.m,e[r]!==0)){for(var S=r+1;S<this.m;S++)n[S]=0;for(var B=r+1;B<this.n;B++)for(var Y=r+1;Y<this.m;Y++)n[Y]+=e[B]*o[Y][B];for(var tt=r+1;tt<this.n;tt++)for(var x=-e[tt]/e[r+1],Z=r+1;Z<this.m;Z++)o[Z][tt]+=x*n[Z]}if(t)for(var s=r+1;s<this.n;s++)this.V[s][r]=e[s]}}var m=Math.min(this.n,this.m+1);if(g<this.n&&(this.s[g]=o[g][g]),this.m<m&&(this.s[m-1]=0),i+1<m&&(e[i]=o[i][m-1]),e[m-1]=0,c){for(var v=g;v<a;v++){for(var T=0;T<this.m;T++)this.U[T][v]=0;this.U[v][v]=1}for(var d=g-1;d>=0;d--)if(this.s[d]!==0){for(var D=d+1;D<a;D++){for(var O=0,P=d;P<this.m;P++)O+=this.U[P][d]*this.U[P][D];O=-O/this.U[d][d];for(var F=d;F<this.m;F++)this.U[F][D]+=O*this.U[F][d]}for(var I=d;I<this.m;I++)this.U[I][d]=-this.U[I][d];this.U[d][d]=1+this.U[d][d];for(var k=0;k<d-1;k++)this.U[k][d]=0}else{for(var _=0;_<this.m;_++)this.U[_][d]=0;this.U[d][d]=1}}if(t)for(var b=this.n-1;b>=0;b--){if((function(Dt,Nt){return Dt&&Nt})(b<i,e[b]!==0))for(var j=b+1;j<a;j++){for(var V=0,M=b+1;M<this.n;M++)V+=this.V[M][b]*this.V[M][j];V=-V/this.V[b+1][b];for(var U=b+1;U<this.n;U++)this.V[U][j]+=V*this.V[U][b]}for(var X=0;X<this.n;X++)this.V[X][b]=0;this.V[b][b]=1}for(var J=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(e[Q])<=St+Lt*(Math.abs(this.s[Q])+Math.abs(this.s[Q+1]))){e[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(e[Mt]):0)+(Mt!==Q+1?Math.abs(e[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=e[m-2];e[m-2]=0;for(var pt=m-2;pt>=Q;pt--){var Et=u.hypot(this.s[pt],et),Ct=this.s[pt]/Et,mt=et/Et;if(this.s[pt]=Et,pt!==Q&&(et=-mt*e[pt-1],e[pt-1]=Ct*e[pt-1]),t)for(var Tt=0;Tt<this.n;Tt++)Et=Ct*this.V[Tt][pt]+mt*this.V[Tt][m-1],this.V[Tt][m-1]=-mt*this.V[Tt][pt]+Ct*this.V[Tt][m-1],this.V[Tt][pt]=Et}}break;case 2:{var Ot=e[Q-1];e[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*e[It],e[It]=Pt*e[It],c)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 G=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[m-1]),Math.abs(this.s[m-2])),Math.abs(e[m-2])),Math.abs(this.s[Q])),Math.abs(e[Q])),H=this.s[m-1]/G,W=this.s[m-2]/G,z=e[m-2]/G,$=this.s[Q]/G,K=e[Q]/G,ut=((W+H)*(W-H)+z*z)/2,ft=H*z*(H*z),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=($+H)*($-H)+q,gt=$*K,rt=Q;rt<m-1;rt++){var vt=u.hypot(ht,gt),At=ht/vt,ot=gt/vt;if(rt!==Q&&(e[rt-1]=vt),ht=At*this.s[rt]+ot*e[rt],e[rt]=At*e[rt]-ot*this.s[rt],gt=ot*this.s[rt+1],this.s[rt+1]=At*this.s[rt+1],t)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*e[rt]+ot*this.s[rt+1],this.s[rt+1]=-ot*e[rt]+At*this.s[rt+1],gt=ot*e[rt+1],e[rt+1]=At*e[rt+1],c&&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}e[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,t))for(var nt=0;nt<=J;nt++)this.V[nt][Q]=-this.V[nt][Q];for(;Q<J&&!(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,t&&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(c&&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(o,a){var e=void 0;return Math.abs(o)>Math.abs(a)?(e=a/o,e=Math.abs(o)*Math.sqrt(1+e*e)):a!=0?(e=o/a,e=Math.abs(a)*Math.sqrt(1+e*e)):e=0,e},E.exports=u}),(function(E,w,N){"use strict";var u=(function(){function e(n,c){for(var t=0;t<c.length;t++){var g=c[t];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(n,g.key,g)}}return function(n,c,t){return c&&e(n.prototype,c),t&&e(n,t),n}})();function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}var a=(function(){function e(n,c){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;o(this,e),this.sequence1=n,this.sequence2=c,this.match_score=t,this.mismatch_penalty=g,this.gap_penalty=i,this.iMax=n.length+1,this.jMax=c.length+1,this.grid=new Array(this.iMax);for(var r=0;r<this.iMax;r++){this.grid[r]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[r][h]=0}this.tracebackGrid=new Array(this.iMax);for(var f=0;f<this.iMax;f++){this.tracebackGrid[f]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[f][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return u(e,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var c=1;c<this.jMax;c++)this.grid[0][c]=this.grid[0][c-1]+this.gap_penalty,this.tracebackGrid[0][c]=[!1,!1,!0];for(var t=1;t<this.iMax;t++)this.grid[t][0]=this.grid[t-1][0]+this.gap_penalty,this.tracebackGrid[t][0]=[!1,!0,!1];for(var g=1;g<this.iMax;g++)for(var i=1;i<this.jMax;i++){var r=void 0;this.sequence1[g-1]===this.sequence2[i-1]?r=this.grid[g-1][i-1]+this.match_score:r=this.grid[g-1][i-1]+this.mismatch_penalty;var h=this.grid[g-1][i]+this.gap_penalty,f=this.grid[g][i-1]+this.gap_penalty,l=[r,h,f],L=this.arrayAllMaxIndexes(l);this.grid[g][i]=l[L[0]],this.tracebackGrid[g][i]=[L.includes(0),L.includes(1),L.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var c=[];for(c.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});c[0];){var t=c[0],g=this.tracebackGrid[t.pos[0]][t.pos[1]];g[0]&&c.push({pos:[t.pos[0]-1,t.pos[1]-1],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),g[1]&&c.push({pos:[t.pos[0]-1,t.pos[1]],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:"-"+t.seq2}),g[2]&&c.push({pos:[t.pos[0],t.pos[1]-1],seq1:"-"+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),t.pos[0]===0&&t.pos[1]===0&&this.alignments.push({sequence1:t.seq1,sequence2:t.seq2}),c.shift()}return this.alignments}},{key:"getAllIndexes",value:function(c,t){for(var g=[],i=-1;(i=c.indexOf(t,i+1))!==-1;)g.push(i);return g}},{key:"arrayAllMaxIndexes",value:function(c){return this.getAllIndexes(c,Math.max.apply(null,c))}}]),e})();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 o=u.prototype;o.addListener=function(a,e){this.listeners.push({event:a,callback:e})},o.removeListener=function(a,e){for(var n=this.listeners.length;n>=0;n--){var c=this.listeners[n];c.event===a&&c.callback===e&&this.listeners.splice(n,1)}},o.emit=function(a,e){for(var n=0;n<this.listeners.length;n++){var c=this.listeners[n];a===c.event&&c.callback(e)}},E.exports=u})])})});var we=me((ae,Ae)=>{"use strict";(function(w,N){typeof ae=="object"&&typeof Ae=="object"?Ae.exports=N(Ce()):typeof define=="function"&&define.amd?define(["layout-base"],N):typeof ae=="object"?ae.coseBase=N(Ce()):w.coseBase=N(w.layoutBase)})(ae,function(E){return(()=>{"use strict";var w={45:((a,e,n)=>{var c={};c.layoutBase=n(551),c.CoSEConstants=n(806),c.CoSEEdge=n(767),c.CoSEGraph=n(880),c.CoSEGraphManager=n(578),c.CoSELayout=n(765),c.CoSENode=n(991),c.ConstraintHandler=n(902),a.exports=c}),806:((a,e,n)=>{var c=n(551).FDLayoutConstants;function t(){}for(var g in c)t[g]=c[g];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,t.ENFORCE_CONSTRAINTS=!0,t.APPLY_LAYOUT=!0,t.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,t.TREE_REDUCTION_ON_INCREMENTAL=!0,t.PURE_INCREMENTAL=t.DEFAULT_INCREMENTAL,a.exports=t}),767:((a,e,n)=>{var c=n(551).FDLayoutEdge;function t(i,r,h){c.call(this,i,r,h)}t.prototype=Object.create(c.prototype);for(var g in c)t[g]=c[g];a.exports=t}),880:((a,e,n)=>{var c=n(551).LGraph;function t(i,r,h){c.call(this,i,r,h)}t.prototype=Object.create(c.prototype);for(var g in c)t[g]=c[g];a.exports=t}),578:((a,e,n)=>{var c=n(551).LGraphManager;function t(i){c.call(this,i)}t.prototype=Object.create(c.prototype);for(var g in c)t[g]=c[g];a.exports=t}),765:((a,e,n)=>{var c=n(551).FDLayout,t=n(578),g=n(880),i=n(991),r=n(767),h=n(806),f=n(902),l=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,S=n(551).IGeometry,B=n(551).LGraph,Y=n(551).Transform,tt=n(551).LinkedList;function x(){c.call(this),this.toBeTiled={},this.constraints={}}x.prototype=Object.create(c.prototype);for(var Z in c)x[Z]=c[Z];x.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},x.prototype.newGraph=function(s){return new g(null,this.graphManager,s)},x.prototype.newNode=function(s){return new i(this.graphManager,s)},x.prototype.newEdge=function(s){return new r(null,null,s)},x.prototype.initParameters=function(){c.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){c.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){var s=L.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(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()),v=this.nodesWithGravity.filter(function(D){return m.has(D)});this.graphManager.setAllNodesToApplyGravitation(v)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(T){return m.has(T)});this.graphManager.setAllNodesToApplyGravitation(v),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(f.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%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(d){return s.has(d)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),h.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var v=!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(v,T),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),m={},v=0;v<s.length;v++){var T=s[v].rect,d=s[v].id;m[d]={id:d,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 s=!1;if(l.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},x.prototype.moveNodes=function(){for(var s=this.getAllNodes(),m,v=0;v<s.length;v++)m=s[v],m.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var v=0;v<s.length;v++)m=s[v],m.move()},x.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var m=this.graphManager.getAllNodes(),v=0;v<m.length;v++){var T=m[v];this.idToNodeMap.set(T.id,T)}var d=function M(U){for(var X=U.getChild().getNodes(),J,st=0,Lt=0;Lt<X.length;Lt++)J=X[Lt],J.getChild()==null?s.fixedNodeSet.has(J.id)&&(st+=100):st+=M(J);return st};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(X){s.fixedNodeSet.add(X.nodeId)});for(var m=this.graphManager.getAllNodes(),T,v=0;v<m.length;v++)if(T=m[v],T.getChild()!=null){var D=d(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){s.fixedNodesOnHorizontal.add(M),s.fixedNodesOnVertical.add(M)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var F=this.constraints.alignmentConstraint.vertical,v=0;v<F.length;v++)this.dummyToNodeForVerticalAlignment.set("dummy"+v,[]),F[v].forEach(function(U){O.set(U,"dummy"+v),s.dummyToNodeForVerticalAlignment.get("dummy"+v).push(U),s.fixedNodeSet.has(U)&&s.fixedNodesOnHorizontal.add("dummy"+v)});if(this.constraints.alignmentConstraint.horizontal)for(var I=this.constraints.alignmentConstraint.horizontal,v=0;v<I.length;v++)this.dummyToNodeForHorizontalAlignment.set("dummy"+v,[]),I[v].forEach(function(U){P.set(U,"dummy"+v),s.dummyToNodeForHorizontalAlignment.get("dummy"+v).push(U),s.fixedNodeSet.has(U)&&s.fixedNodesOnVertical.add("dummy"+v)})}if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(M){var U,X,J;for(J=M.length-1;J>=2*M.length/3;J--)U=Math.floor(Math.random()*(J+1)),X=M[J],M[J]=M[U],M[U]=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 U=O.has(M.left)?O.get(M.left):M.left,X=O.has(M.right)?O.get(M.right):M.right;s.nodesInRelativeHorizontal.includes(U)||(s.nodesInRelativeHorizontal.push(U),s.nodeToRelativeConstraintMapHorizontal.set(U,[]),s.dummyToNodeForVerticalAlignment.has(U)?s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(U)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(U).getCenterX())),s.nodesInRelativeHorizontal.includes(X)||(s.nodesInRelativeHorizontal.push(X),s.nodeToRelativeConstraintMapHorizontal.set(X,[]),s.dummyToNodeForVerticalAlignment.has(X)?s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(X).getCenterX())),s.nodeToRelativeConstraintMapHorizontal.get(U).push({right:X,gap:M.gap}),s.nodeToRelativeConstraintMapHorizontal.get(X).push({left:U,gap:M.gap})}else{var J=P.has(M.top)?P.get(M.top):M.top,st=P.has(M.bottom)?P.get(M.bottom):M.bottom;s.nodesInRelativeVertical.includes(J)||(s.nodesInRelativeVertical.push(J),s.nodeToRelativeConstraintMapVertical.set(J,[]),s.dummyToNodeForHorizontalAlignment.has(J)?s.nodeToTempPositionMapVertical.set(J,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(J)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(J,s.idToNodeMap.get(J).getCenterY())),s.nodesInRelativeVertical.includes(st)||(s.nodesInRelativeVertical.push(st),s.nodeToRelativeConstraintMapVertical.set(st,[]),s.dummyToNodeForHorizontalAlignment.has(st)?s.nodeToTempPositionMapVertical.set(st,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(st)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(st,s.idToNodeMap.get(st).getCenterY())),s.nodeToRelativeConstraintMapVertical.get(J).push({bottom:st,gap:M.gap}),s.nodeToRelativeConstraintMapVertical.get(st).push({top:J,gap:M.gap})}});else{var k=new Map,_=new Map;this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var U=O.has(M.left)?O.get(M.left):M.left,X=O.has(M.right)?O.get(M.right):M.right;k.has(U)?k.get(U).push(X):k.set(U,[X]),k.has(X)?k.get(X).push(U):k.set(X,[U])}else{var J=P.has(M.top)?P.get(M.top):M.top,st=P.has(M.bottom)?P.get(M.bottom):M.bottom;_.has(J)?_.get(J).push(st):_.set(J,[st]),_.has(st)?_.get(st).push(J):_.set(st,[J])}});var b=function(U,X){var J=[],st=[],Lt=new tt,St=new Set,Q=0;return U.forEach(function(Ut,Mt){if(!St.has(Mt)){J[Q]=[],st[Q]=!1;var at=Mt;for(Lt.push(at),St.add(at),J[Q].push(at);Lt.length!=0;){at=Lt.shift(),X.has(at)&&(st[Q]=!0);var et=U.get(at);et.forEach(function(pt){St.has(pt)||(Lt.push(pt),St.add(pt),J[Q].push(pt))})}Q++}}),{components:J,isFixed:st}},j=b(k,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=j.components,this.fixedComponentsOnHorizontal=j.isFixed;var V=b(_,s.fixedNodesOnVertical);this.componentsOnVertical=V.components,this.fixedComponentsOnVertical=V.isFixed}}},x.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(V){var M=s.idToNodeMap.get(V.nodeId);M.displacementX=0,M.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,v=0;v<m.length;v++){for(var T=0,d=0;d<m[v].length;d++){if(this.fixedNodeSet.has(m[v][d])){T=0;break}T+=this.idToNodeMap.get(m[v][d]).displacementX}for(var D=T/m[v].length,d=0;d<m[v].length;d++)this.idToNodeMap.get(m[v][d]).displacementX=D}if(this.constraints.alignmentConstraint.horizontal)for(var O=this.constraints.alignmentConstraint.horizontal,v=0;v<O.length;v++){for(var P=0,d=0;d<O[v].length;d++){if(this.fixedNodeSet.has(O[v][d])){P=0;break}P+=this.idToNodeMap.get(O[v][d]).displacementY}for(var F=P/O[v].length,d=0;d<O[v].length;d++)this.idToNodeMap.get(O[v][d]).displacementY=F}}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(V){if(!s.fixedNodesOnHorizontal.has(V)){var M=0;s.dummyToNodeForVerticalAlignment.has(V)?M=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(V)[0]).displacementX:M=s.idToNodeMap.get(V).displacementX,s.nodeToRelativeConstraintMapHorizontal.get(V).forEach(function(U){if(U.right){var X=s.nodeToTempPositionMapHorizontal.get(U.right)-s.nodeToTempPositionMapHorizontal.get(V)-M;X<U.gap&&(M-=U.gap-X)}else{var X=s.nodeToTempPositionMapHorizontal.get(V)-s.nodeToTempPositionMapHorizontal.get(U.left)+M;X<U.gap&&(M+=U.gap-X)}}),s.nodeToTempPositionMapHorizontal.set(V,s.nodeToTempPositionMapHorizontal.get(V)+M),s.dummyToNodeForVerticalAlignment.has(V)?s.dummyToNodeForVerticalAlignment.get(V).forEach(function(U){s.idToNodeMap.get(U).displacementX=M}):s.idToNodeMap.get(V).displacementX=M}}),this.nodesInRelativeVertical.forEach(function(V){if(!s.fixedNodesOnHorizontal.has(V)){var M=0;s.dummyToNodeForHorizontalAlignment.has(V)?M=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(V)[0]).displacementY:M=s.idToNodeMap.get(V).displacementY,s.nodeToRelativeConstraintMapVertical.get(V).forEach(function(U){if(U.bottom){var X=s.nodeToTempPositionMapVertical.get(U.bottom)-s.nodeToTempPositionMapVertical.get(V)-M;X<U.gap&&(M-=U.gap-X)}else{var X=s.nodeToTempPositionMapVertical.get(V)-s.nodeToTempPositionMapVertical.get(U.top)+M;X<U.gap&&(M+=U.gap-X)}}),s.nodeToTempPositionMapVertical.set(V,s.nodeToTempPositionMapVertical.get(V)+M),s.dummyToNodeForHorizontalAlignment.has(V)?s.dummyToNodeForHorizontalAlignment.get(V).forEach(function(U){s.idToNodeMap.get(U).displacementY=M}):s.idToNodeMap.get(V).displacementY=M}});else{for(var v=0;v<this.componentsOnHorizontal.length;v++){var I=this.componentsOnHorizontal[v];if(this.fixedComponentsOnHorizontal[v])for(var d=0;d<I.length;d++)this.dummyToNodeForVerticalAlignment.has(I[d])?this.dummyToNodeForVerticalAlignment.get(I[d]).forEach(function(U){s.idToNodeMap.get(U).displacementX=0}):this.idToNodeMap.get(I[d]).displacementX=0;else{for(var k=0,_=0,d=0;d<I.length;d++)if(this.dummyToNodeForVerticalAlignment.has(I[d])){var b=this.dummyToNodeForVerticalAlignment.get(I[d]);k+=b.length*this.idToNodeMap.get(b[0]).displacementX,_+=b.length}else k+=this.idToNodeMap.get(I[d]).displacementX,_++;for(var j=k/_,d=0;d<I.length;d++)this.dummyToNodeForVerticalAlignment.has(I[d])?this.dummyToNodeForVerticalAlignment.get(I[d]).forEach(function(U){s.idToNodeMap.get(U).displacementX=j}):this.idToNodeMap.get(I[d]).displacementX=j}}for(var v=0;v<this.componentsOnVertical.length;v++){var I=this.componentsOnVertical[v];if(this.fixedComponentsOnVertical[v])for(var d=0;d<I.length;d++)this.dummyToNodeForHorizontalAlignment.has(I[d])?this.dummyToNodeForHorizontalAlignment.get(I[d]).forEach(function(X){s.idToNodeMap.get(X).displacementY=0}):this.idToNodeMap.get(I[d]).displacementY=0;else{for(var k=0,_=0,d=0;d<I.length;d++)if(this.dummyToNodeForHorizontalAlignment.has(I[d])){var b=this.dummyToNodeForHorizontalAlignment.get(I[d]);k+=b.length*this.idToNodeMap.get(b[0]).displacementY,_+=b.length}else k+=this.idToNodeMap.get(I[d]).displacementY,_++;for(var j=k/_,d=0;d<I.length;d++)this.dummyToNodeForHorizontalAlignment.has(I[d])?this.dummyToNodeForHorizontalAlignment.get(I[d]).forEach(function(Lt){s.idToNodeMap.get(Lt).displacementY=j}):this.idToNodeMap.get(I[d]).displacementY=j}}}},x.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],m,v=this.graphManager.getGraphs(),T=v.length,d;for(d=0;d<T;d++)m=v[d],m.updateConnected(),m.isConnected||(s=s.concat(m.getNodes()));return s},x.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var m=new Set,v;for(v=0;v<s.length;v++){var T=s[v];if(!m.has(T)){var d=T.getSource(),D=T.getTarget();if(d==D)T.getBendpoints().push(new p),T.getBendpoints().push(new p),this.createDummyNodesForBendpoints(T),m.add(T);else{var O=[];if(O=O.concat(d.getEdgeListToNode(D)),O=O.concat(D.getEdgeListToNode(d)),!m.has(O[0])){if(O.length>1){var P;for(P=0;P<O.length;P++){var F=O[P];F.getBendpoints().push(new p),this.createDummyNodesForBendpoints(F)}}O.forEach(function(I){m.add(I)})}}}if(m.size==s.length)break}},x.prototype.positionNodesRadially=function(s){for(var m=new y(0,0),v=Math.ceil(Math.sqrt(s.length)),T=0,d=0,D=0,O=new p(0,0),P=0;P<s.length;P++){P%v==0&&(D=0,d=T,P!=0&&(d+=h.DEFAULT_COMPONENT_SEPERATION),T=0);var F=s[P],I=R.findCenterOfTree(F);m.x=D,m.y=d,O=x.radialLayout(F,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(s,m,v){var T=Math.max(this.maxDiagonalInTree(s),h.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(m,null,0,359,0,T);var d=B.calculateBounds(s),D=new Y;D.setDeviceOrgX(d.getMinX()),D.setDeviceOrgY(d.getMinY()),D.setWorldOrgX(v.x),D.setWorldOrgY(v.y);for(var O=0;O<s.length;O++){var P=s[O];P.transform(D)}var F=new p(d.getMaxX(),d.getMaxY());return D.inverseTransformPoint(F)},x.branchRadialLayout=function(s,m,v,T,d,D){var O=(T-v+1)/2;O<0&&(O+=180);var P=(O+v)%360,F=P*S.TWO_PI/360,I=Math.cos(F),k=d*Math.cos(F),_=d*Math.sin(F);s.setCenter(k,_);var b=[];b=b.concat(s.getEdges());var j=b.length;m!=null&&j--;for(var V=0,M=b.length,U,X=s.getEdgesBetween(m);X.length>1;){var J=X[0];X.splice(0,1);var st=b.indexOf(J);st>=0&&b.splice(st,1),M--,j--}m!=null?U=(b.indexOf(X[0])+1)%M:U=0;for(var Lt=Math.abs(T-v)/j,St=U;V!=j;St=++St%M){var Q=b[St].getOtherEnd(s);if(Q!=m){var Ut=(v+V*Lt)%360,Mt=(Ut+Lt)%360;x.branchRadialLayout(Q,s,Ut,Mt,d+D,D),V++}}},x.maxDiagonalInTree=function(s){for(var m=A.MIN_VALUE,v=0;v<s.length;v++){var T=s[v],d=T.getDiagonal();d>m&&(m=d)}return m},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var s=this,m={};this.memberGroups={},this.idToDummyNode={};for(var v=[],T=this.graphManager.getAllNodes(),d=0;d<T.length;d++){var D=T[d],O=D.getParent();this.getNodeDegreeWithChildren(D)===0&&(O.id==null||!this.getToBeTiled(O))&&v.push(D)}for(var d=0;d<v.length;d++){var D=v[d],P=D.getParent().id;typeof m[P]>"u"&&(m[P]=[]),m[P]=m[P].concat(D)}Object.keys(m).forEach(function(F){if(m[F].length>1){var I="DummyCompound_"+F;s.memberGroups[I]=m[F];var k=m[F][0].getParent(),_=new i(s.graphManager);_.id=I,_.paddingLeft=k.paddingLeft||0,_.paddingRight=k.paddingRight||0,_.paddingBottom=k.paddingBottom||0,_.paddingTop=k.paddingTop||0,s.idToDummyNode[I]=_;var b=s.getGraphManager().add(s.newGraph(),_),j=k.getChild();j.add(_);for(var V=0;V<m[F].length;V++){var M=m[F][V];j.remove(M),b.add(M)}}})},x.prototype.clearCompounds=function(){var s={},m={};this.performDFSOnCompounds();for(var v=0;v<this.compoundOrder.length;v++)m[this.compoundOrder[v].id]=this.compoundOrder[v],s[this.compoundOrder[v].id]=[].concat(this.compoundOrder[v].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[v].getChild()),this.compoundOrder[v].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,m)},x.prototype.clearZeroDegreeMembers=function(){var s=this,m=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(v){var T=s.idToDummyNode[v];if(m[v]=s.tileNodes(s.memberGroups[v],T.paddingLeft+T.paddingRight),T.rect.width=m[v].width,T.rect.height=m[v].height,T.setCenter(m[v].centerX,m[v].centerY),T.labelMarginLeft=0,T.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var d=T.rect.width,D=T.rect.height;T.labelWidth&&(T.labelPosHorizontal=="left"?(T.rect.x-=T.labelWidth,T.setWidth(d+T.labelWidth),T.labelMarginLeft=T.labelWidth):T.labelPosHorizontal=="center"&&T.labelWidth>d?(T.rect.x-=(T.labelWidth-d)/2,T.setWidth(T.labelWidth),T.labelMarginLeft=(T.labelWidth-d)/2):T.labelPosHorizontal=="right"&&T.setWidth(d+T.labelWidth)),T.labelHeight&&(T.labelPosVertical=="top"?(T.rect.y-=T.labelHeight,T.setHeight(D+T.labelHeight),T.labelMarginTop=T.labelHeight):T.labelPosVertical=="center"&&T.labelHeight>D?(T.rect.y-=(T.labelHeight-D)/2,T.setHeight(T.labelHeight),T.labelMarginTop=(T.labelHeight-D)/2):T.labelPosVertical=="bottom"&&T.setHeight(D+T.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var m=this.compoundOrder[s],v=m.id,T=m.paddingLeft,d=m.paddingTop,D=m.labelMarginLeft,O=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[v],m.rect.x,m.rect.y,T,d,D,O)}},x.prototype.repopulateZeroDegreeMembers=function(){var s=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(v){var T=s.idToDummyNode[v],d=T.paddingLeft,D=T.paddingTop,O=T.labelMarginLeft,P=T.labelMarginTop;s.adjustLocations(m[v],T.rect.x,T.rect.y,d,D,O,P)})},x.prototype.getToBeTiled=function(s){var m=s.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var v=s.getChild();if(v==null)return this.toBeTiled[m]=!1,!1;for(var T=v.getNodes(),d=0;d<T.length;d++){var D=T[d];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(s){for(var m=s.id,v=s.getEdges(),T=0,d=0;d<v.length;d++){var D=v[d];D.getSource().id!==D.getTarget().id&&(T=T+1)}return T},x.prototype.getNodeDegreeWithChildren=function(s){var m=this.getNodeDegree(s);if(s.getChild()==null)return m;for(var v=s.getChild().getNodes(),T=0;T<v.length;T++){var d=v[T];m+=this.getNodeDegreeWithChildren(d)}return m},x.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},x.prototype.fillCompexOrderByDFS=function(s){for(var m=0;m<s.length;m++){var v=s[m];v.getChild()!=null&&this.fillCompexOrderByDFS(v.getChild().getNodes()),this.getToBeTiled(v)&&this.compoundOrder.push(v)}},x.prototype.adjustLocations=function(s,m,v,T,d,D,O){m+=T+D,v+=d+O;for(var P=m,F=0;F<s.rows.length;F++){var I=s.rows[F];m=P;for(var k=0,_=0;_<I.length;_++){var b=I[_];b.rect.x=m,b.rect.y=v,m+=b.rect.width+s.horizontalPadding,b.rect.height>k&&(k=b.rect.height)}v+=k+s.verticalPadding}},x.prototype.tileCompoundMembers=function(s,m){var v=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(T){var d=m[T];if(v.tiledMemberPack[T]=v.tileNodes(s[T],d.paddingLeft+d.paddingRight),d.rect.width=v.tiledMemberPack[T].width,d.rect.height=v.tiledMemberPack[T].height,d.setCenter(v.tiledMemberPack[T].centerX,v.tiledMemberPack[T].centerY),d.labelMarginLeft=0,d.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var D=d.rect.width,O=d.rect.height;d.labelWidth&&(d.labelPosHorizontal=="left"?(d.rect.x-=d.labelWidth,d.setWidth(D+d.labelWidth),d.labelMarginLeft=d.labelWidth):d.labelPosHorizontal=="center"&&d.labelWidth>D?(d.rect.x-=(d.labelWidth-D)/2,d.setWidth(d.labelWidth),d.labelMarginLeft=(d.labelWidth-D)/2):d.labelPosHorizontal=="right"&&d.setWidth(D+d.labelWidth)),d.labelHeight&&(d.labelPosVertical=="top"?(d.rect.y-=d.labelHeight,d.setHeight(O+d.labelHeight),d.labelMarginTop=d.labelHeight):d.labelPosVertical=="center"&&d.labelHeight>O?(d.rect.y-=(d.labelHeight-O)/2,d.setHeight(d.labelHeight),d.labelMarginTop=(d.labelHeight-O)/2):d.labelPosVertical=="bottom"&&d.setHeight(O+d.labelHeight))}})},x.prototype.tileNodes=function(s,m){var v=this.tileNodesByFavoringDim(s,m,!0),T=this.tileNodesByFavoringDim(s,m,!1),d=this.getOrgRatio(v),D=this.getOrgRatio(T),O;return D<d?O=T:O=v,O},x.prototype.getOrgRatio=function(s){var m=s.width,v=s.height,T=m/v;return T<1&&(T=1/T),T},x.prototype.calcIdealRowWidth=function(s,m){var v=h.TILING_PADDING_VERTICAL,T=h.TILING_PADDING_HORIZONTAL,d=s.length,D=0,O=0,P=0;s.forEach(function(V){D+=V.getWidth(),O+=V.getHeight(),V.getWidth()>P&&(P=V.getWidth())});var F=D/d,I=O/d,k=Math.pow(v-T,2)+4*(F+T)*(I+v)*d,_=(T-v+Math.sqrt(k))/(2*(F+T)),b;m?(b=Math.ceil(_),b==_&&b++):b=Math.floor(_);var j=b*(F+T)-T;return P>j&&(j=P),j+=T*2,j},x.prototype.tileNodesByFavoringDim=function(s,m,v){var T=h.TILING_PADDING_VERTICAL,d=h.TILING_PADDING_HORIZONTAL,D=h.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:T,horizontalPadding:d,centerX:0,centerY:0};D&&(O.idealRowWidth=this.calcIdealRowWidth(s,v));var P=function(M){return M.rect.width*M.rect.height},F=function(M,U){return P(U)-P(M)};s.sort(function(V,M){var U=F;return O.idealRowWidth?(U=D,U(V.id,M.id)):U(V,M)});for(var I=0,k=0,_=0;_<s.length;_++){var b=s[_];I+=b.getCenterX(),k+=b.getCenterY()}O.centerX=I/s.length,O.centerY=k/s.length;for(var _=0;_<s.length;_++){var b=s[_];if(O.rows.length==0)this.insertNodeToRow(O,b,0,m);else if(this.canAddHorizontal(O,b.rect.width,b.rect.height)){var j=O.rows.length-1;O.idealRowWidth||(j=this.getShortestRowIndex(O)),this.insertNodeToRow(O,b,j,m)}else this.insertNodeToRow(O,b,O.rows.length,m);this.shiftToLastRow(O)}return O},x.prototype.insertNodeToRow=function(s,m,v,T){var d=T;if(v==s.rows.length){var D=[];s.rows.push(D),s.rowWidth.push(d),s.rowHeight.push(0)}var O=s.rowWidth[v]+m.rect.width;s.rows[v].length>0&&(O+=s.horizontalPadding),s.rowWidth[v]=O,s.width<O&&(s.width=O);var P=m.rect.height;v>0&&(P+=s.verticalPadding);var F=0;P>s.rowHeight[v]&&(F=s.rowHeight[v],s.rowHeight[v]=P,F=s.rowHeight[v]-F),s.height+=F,s.rows[v].push(m)},x.prototype.getShortestRowIndex=function(s){for(var m=-1,v=Number.MAX_VALUE,T=0;T<s.rows.length;T++)s.rowWidth[T]<v&&(m=T,v=s.rowWidth[T]);return m},x.prototype.getLongestRowIndex=function(s){for(var m=-1,v=Number.MIN_VALUE,T=0;T<s.rows.length;T++)s.rowWidth[T]>v&&(m=T,v=s.rowWidth[T]);return m},x.prototype.canAddHorizontal=function(s,m,v){if(s.idealRowWidth){var T=s.rows.length-1,d=s.rowWidth[T];return d+m+s.horizontalPadding<=s.idealRowWidth}var D=this.getShortestRowIndex(s);if(D<0)return!0;var O=s.rowWidth[D];if(O+s.horizontalPadding+m<=s.width)return!0;var P=0;s.rowHeight[D]<v&&D>0&&(P=v+s.verticalPadding-s.rowHeight[D]);var F;s.width-O>=m+s.horizontalPadding?F=(s.height+P)/(O+m+s.horizontalPadding):F=(s.height+P)/s.width,P=v+s.verticalPadding;var I;return s.width<m?I=(s.height+P)/m:I=(s.height+P)/s.width,I<1&&(I=1/I),F<1&&(F=1/F),F<I},x.prototype.shiftToLastRow=function(s){var m=this.getLongestRowIndex(s),v=s.rowWidth.length-1,T=s.rows[m],d=T[T.length-1],D=d.width+s.horizontalPadding;if(s.width-s.rowWidth[v]>D&&m!=v){T.splice(-1,1),s.rows[v].push(d),s.rowWidth[m]=s.rowWidth[m]-D,s.rowWidth[v]=s.rowWidth[v]+D,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var O=Number.MIN_VALUE,P=0;P<T.length;P++)T[P].height>O&&(O=T[P].height);m>0&&(O+=s.verticalPadding);var F=s.rowHeight[m]+s.rowHeight[v];s.rowHeight[m]=O,s.rowHeight[v]<d.height+s.verticalPadding&&(s.rowHeight[v]=d.height+s.verticalPadding);var I=s.rowHeight[m]+s.rowHeight[v];s.height+=I-F,this.shiftToLastRow(s)}},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 s=[],m=!0,v;m;){var T=this.graphManager.getAllNodes(),d=[];m=!1;for(var D=0;D<T.length;D++)if(v=T[D],v.getEdges().length==1&&!v.getEdges()[0].isInterGraph&&v.getChild()==null){if(h.PURE_INCREMENTAL){var O=v.getEdges()[0].getOtherEnd(v),P=new C(v.getCenterX()-O.getCenterX(),v.getCenterY()-O.getCenterY());d.push([v,v.getEdges()[0],v.getOwner(),P])}else d.push([v,v.getEdges()[0],v.getOwner()]);m=!0}if(m==!0){for(var F=[],I=0;I<d.length;I++)d[I][0].getEdges().length==1&&(F.push(d[I]),d[I][0].getOwner().remove(d[I][0]));s.push(F),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},x.prototype.growTree=function(s){for(var m=s.length,v=s[m-1],T,d=0;d<v.length;d++)T=v[d],this.findPlaceforPrunedNode(T),T[2].add(T[0]),T[2].add(T[1],T[1].source,T[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},x.prototype.findPlaceforPrunedNode=function(s){var m,v,T=s[0];if(T==s[1].source?v=s[1].target:v=s[1].source,h.PURE_INCREMENTAL)T.setCenter(v.getCenterX()+s[3].getWidth(),v.getCenterY()+s[3].getHeight());else{var d=v.startX,D=v.finishX,O=v.startY,P=v.finishY,F=0,I=0,k=0,_=0,b=[F,k,I,_];if(O>0)for(var j=d;j<=D;j++)b[0]+=this.grid[j][O-1].length+this.grid[j][O].length-1;if(D<this.grid.length-1)for(var j=O;j<=P;j++)b[1]+=this.grid[D+1][j].length+this.grid[D][j].length-1;if(P<this.grid[0].length-1)for(var j=d;j<=D;j++)b[2]+=this.grid[j][P+1].length+this.grid[j][P].length-1;if(d>0)for(var j=O;j<=P;j++)b[3]+=this.grid[d-1][j].length+this.grid[d][j].length-1;for(var V=A.MAX_VALUE,M,U,X=0;X<b.length;X++)b[X]<V?(V=b[X],M=1,U=X):b[X]==V&&M++;if(M==3&&V==0)b[0]==0&&b[1]==0&&b[2]==0?m=1:b[0]==0&&b[1]==0&&b[3]==0?m=0:b[0]==0&&b[2]==0&&b[3]==0?m=3:b[1]==0&&b[2]==0&&b[3]==0&&(m=2);else if(M==2&&V==0){var J=Math.floor(Math.random()*2);b[0]==0&&b[1]==0?J==0?m=0:m=1:b[0]==0&&b[2]==0?J==0?m=0:m=2:b[0]==0&&b[3]==0?J==0?m=0:m=3:b[1]==0&&b[2]==0?J==0?m=1:m=2:b[1]==0&&b[3]==0?J==0?m=1:m=3:J==0?m=2:m=3}else if(M==4&&V==0){var J=Math.floor(Math.random()*4);m=J}else m=U;m==0?T.setCenter(v.getCenterX(),v.getCenterY()-v.getHeight()/2-l.DEFAULT_EDGE_LENGTH-T.getHeight()/2):m==1?T.setCenter(v.getCenterX()+v.getWidth()/2+l.DEFAULT_EDGE_LENGTH+T.getWidth()/2,v.getCenterY()):m==2?T.setCenter(v.getCenterX(),v.getCenterY()+v.getHeight()/2+l.DEFAULT_EDGE_LENGTH+T.getHeight()/2):T.setCenter(v.getCenterX()-v.getWidth()/2-l.DEFAULT_EDGE_LENGTH-T.getWidth()/2,v.getCenterY())}},a.exports=x}),991:((a,e,n)=>{var c=n(551).FDLayoutNode,t=n(551).IMath;function g(r,h,f,l){c.call(this,r,h,f,l)}g.prototype=Object.create(c.prototype);for(var i in c)g[i]=c[i];g.prototype.calculateDisplacement=function(){var r=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementX=r.coolingFactor*r.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementY=r.coolingFactor*r.maxNodeDisplacement*t.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(r,h){for(var f=this.getChild().getNodes(),l,L=0;L<f.length;L++)l=f[L],l.getChild()==null?(l.displacementX+=r,l.displacementY+=h):l.propogateDisplacementToChildren(r,h)},g.prototype.move=function(){var r=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),r.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},g.prototype.setPred1=function(r){this.pred1=r},g.prototype.getPred1=function(){return pred1},g.prototype.getPred2=function(){return pred2},g.prototype.setNext=function(r){this.next=r},g.prototype.getNext=function(){return next},g.prototype.setProcessed=function(r){this.processed=r},g.prototype.isProcessed=function(){return processed},a.exports=g}),902:((a,e,n)=>{function c(f){if(Array.isArray(f)){for(var l=0,L=Array(f.length);l<f.length;l++)L[l]=f[l];return L}else return Array.from(f)}var t=n(806),g=n(551).LinkedList,i=n(551).Matrix,r=n(551).SVD;function h(){}h.handleConstraints=function(f){var l={};l.fixedNodeConstraint=f.constraints.fixedNodeConstraint,l.alignmentConstraint=f.constraints.alignmentConstraint,l.relativePlacementConstraint=f.constraints.relativePlacementConstraint;for(var L=new Map,y=new Map,p=[],C=[],R=f.getAllNodes(),A=0,S=0;S<R.length;S++){var B=R[S];B.getChild()==null&&(y.set(B.id,A++),p.push(B.getCenterX()),C.push(B.getCenterY()),L.set(B.id,B))}l.relativePlacementConstraint&&l.relativePlacementConstraint.forEach(function(G){!G.gap&&G.gap!=0&&(G.left?G.gap=t.DEFAULT_EDGE_LENGTH+L.get(G.left).getWidth()/2+L.get(G.right).getWidth()/2:G.gap=t.DEFAULT_EDGE_LENGTH+L.get(G.top).getHeight()/2+L.get(G.bottom).getHeight()/2)});var Y=function(H,W){return{x:H.x-W.x,y:H.y-W.y}},tt=function(H){var W=0,z=0;return H.forEach(function($){W+=p[y.get($)],z+=C[y.get($)]}),{x:W/H.size,y:z/H.size}},x=function(H,W,z,$,K){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 g;ft.forEach(function(ot,it){ot==0?(gt.push(it),z||(W=="horizontal"?q.set(it,y.has(it)?p[y.get(it)]:$.get(it)):q.set(it,y.has(it)?C[y.get(it)]:$.get(it)))):q.set(it,Number.NEGATIVE_INFINITY),z&&ht.set(it,new Set([it]))}),z&&K.forEach(function(ot){var it=[];if(ot.forEach(function(lt){z.has(lt)&&it.push(lt)}),it.length>0){var dt=0;it.forEach(function(lt){W=="horizontal"?(q.set(lt,y.has(lt)?p[y.get(lt)]:$.get(lt)),dt+=q.get(lt)):(q.set(lt,y.has(lt)?C[y.get(lt)]:$.get(lt)),dt+=q.get(lt))}),dt=dt/it.length,ot.forEach(function(lt){z.has(lt)||q.set(lt,dt)})}else{var nt=0;ot.forEach(function(lt){W=="horizontal"?nt+=y.has(lt)?p[y.get(lt)]:$.get(lt):nt+=y.has(lt)?C[y.get(lt)]:$.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(z&&z.has(nt.id)){var lt=void 0;if(W=="horizontal"?lt=y.has(nt.id)?p[y.get(nt.id)]:$.get(nt.id):lt=y.has(nt.id)?C[y.get(nt.id)]:$.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&&gt.push(nt.id),z&&ht.set(nt.id,ut(ht.get(it),ht.get(nt.id)))})};gt.length!=0;)rt();if(z){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;z.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(c(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;W=="horizontal"?Xt=y.has(Rt)?p[y.get(Rt)]:$.get(Rt):Xt=y.has(Rt)?C[y.get(Rt)]:$.get(Rt);var zt=q.get(Rt);Xt<dt&&(dt=Xt),Xt>lt&&(lt=Xt),zt<nt&&(nt=zt),zt>Ft&&(Ft=zt)}}catch(te){Vt=!0,Dt=te}finally{try{!xt&&Nt.return&&Nt.return()}finally{if(Vt)throw Dt}}var de=(dt+lt)/2-(nt+Ft)/2,Qt=!0,Kt=!1,jt=void 0;try{for(var Jt=ot[Symbol.iterator](),he;!(Qt=(he=Jt.next()).done);Qt=!0){var _t=he.value;q.set(_t,q.get(_t)+de)}}catch(te){Kt=!0,jt=te}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(Kt)throw jt}}})}return q},Z=function(H){var W=0,z=0,$=0,K=0;if(H.forEach(function(ht){ht.left?p[y.get(ht.left)]-p[y.get(ht.right)]>=0?W++:z++:C[y.get(ht.top)]-C[y.get(ht.bottom)]>=0?$++:K++}),W>z&&$>K)for(var ut=0;ut<y.size;ut++)p[ut]=-1*p[ut],C[ut]=-1*C[ut];else if(W>z)for(var ft=0;ft<y.size;ft++)p[ft]=-1*p[ft];else if($>K)for(var q=0;q<y.size;q++)C[q]=-1*C[q]},s=function(H){var W=[],z=new g,$=new Set,K=0;return H.forEach(function(ut,ft){if(!$.has(ft)){W[K]=[];var q=ft;for(z.push(q),$.add(q),W[K].push(q);z.length!=0;){q=z.shift();var ht=H.get(q);ht.forEach(function(gt){$.has(gt.id)||(z.push(gt.id),$.add(gt.id),W[K].push(gt.id))})}K++}}),W},m=function(H){var W=new Map;return H.forEach(function(z,$){W.set($,[])}),H.forEach(function(z,$){z.forEach(function(K){W.get($).push(K),W.get(K.id).push({id:$,gap:K.gap,direction:K.direction})})}),W},v=function(H){var W=new Map;return H.forEach(function(z,$){W.set($,[])}),H.forEach(function(z,$){z.forEach(function(K){W.get(K.id).push({id:$,gap:K.gap,direction:K.direction})})}),W},T=[],d=[],D=!1,O=!1,P=new Set,F=new Map,I=new Map,k=[];if(l.fixedNodeConstraint&&l.fixedNodeConstraint.forEach(function(G){P.add(G.nodeId)}),l.relativePlacementConstraint&&(l.relativePlacementConstraint.forEach(function(G){G.left?(F.has(G.left)?F.get(G.left).push({id:G.right,gap:G.gap,direction:"horizontal"}):F.set(G.left,[{id:G.right,gap:G.gap,direction:"horizontal"}]),F.has(G.right)||F.set(G.right,[])):(F.has(G.top)?F.get(G.top).push({id:G.bottom,gap:G.gap,direction:"vertical"}):F.set(G.top,[{id:G.bottom,gap:G.gap,direction:"vertical"}]),F.has(G.bottom)||F.set(G.bottom,[]))}),I=m(F),k=s(I)),t.TRANSFORM_ON_CONSTRAINT_HANDLING){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>1)l.fixedNodeConstraint.forEach(function(G,H){T[H]=[G.position.x,G.position.y],d[H]=[p[y.get(G.nodeId)],C[y.get(G.nodeId)]]}),D=!0;else if(l.alignmentConstraint)(function(){var G=0;if(l.alignmentConstraint.vertical){for(var H=l.alignmentConstraint.vertical,W=function(q){var ht=new Set;H[q].forEach(function(vt){ht.add(vt)});var gt=new Set([].concat(c(ht)).filter(function(vt){return P.has(vt)})),rt=void 0;gt.size>0?rt=p[y.get(gt.values().next().value)]:rt=tt(ht).x,H[q].forEach(function(vt){T[G]=[rt,C[y.get(vt)]],d[G]=[p[y.get(vt)],C[y.get(vt)]],G++})},z=0;z<H.length;z++)W(z);D=!0}if(l.alignmentConstraint.horizontal){for(var $=l.alignmentConstraint.horizontal,K=function(q){var ht=new Set;$[q].forEach(function(vt){ht.add(vt)});var gt=new Set([].concat(c(ht)).filter(function(vt){return P.has(vt)})),rt=void 0;gt.size>0?rt=p[y.get(gt.values().next().value)]:rt=tt(ht).y,$[q].forEach(function(vt){T[G]=[p[y.get(vt)],rt],d[G]=[p[y.get(vt)],C[y.get(vt)]],G++})},ut=0;ut<$.length;ut++)K(ut);D=!0}l.relativePlacementConstraint&&(O=!0)})();else if(l.relativePlacementConstraint){for(var _=0,b=0,j=0;j<k.length;j++)k[j].length>_&&(_=k[j].length,b=j);if(_<I.size/2)Z(l.relativePlacementConstraint),D=!1,O=!1;else{var V=new Map,M=new Map,U=[];k[b].forEach(function(G){F.get(G).forEach(function(H){H.direction=="horizontal"?(V.has(G)?V.get(G).push(H):V.set(G,[H]),V.has(H.id)||V.set(H.id,[]),U.push({left:G,right:H.id})):(M.has(G)?M.get(G).push(H):M.set(G,[H]),M.has(H.id)||M.set(H.id,[]),U.push({top:G,bottom:H.id}))})}),Z(U),O=!1;var X=x(V,"horizontal"),J=x(M,"vertical");k[b].forEach(function(G,H){d[H]=[p[y.get(G)],C[y.get(G)]],T[H]=[],X.has(G)?T[H][0]=X.get(G):T[H][0]=p[y.get(G)],J.has(G)?T[H][1]=J.get(G):T[H][1]=C[y.get(G)]}),D=!0}}if(D){for(var st=void 0,Lt=i.transpose(T),St=i.transpose(d),Q=0;Q<Lt.length;Q++)Lt[Q]=i.multGamma(Lt[Q]),St[Q]=i.multGamma(St[Q]);var Ut=i.multMat(Lt,i.transpose(St)),Mt=r.svd(Ut);st=i.multMat(Mt.V,i.transpose(Mt.U));for(var at=0;at<y.size;at++){var et=[p[at],C[at]],pt=[st[0][0],st[1][0]],Et=[st[0][1],st[1][1]];p[at]=i.dotProduct(et,pt),C[at]=i.dotProduct(et,Et)}O&&Z(l.relativePlacementConstraint)}}if(t.ENFORCE_CONSTRAINTS){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>0){var Ct={x:0,y:0};l.fixedNodeConstraint.forEach(function(G,H){var W={x:p[y.get(G.nodeId)],y:C[y.get(G.nodeId)]},z=G.position,$=Y(z,W);Ct.x+=$.x,Ct.y+=$.y}),Ct.x/=l.fixedNodeConstraint.length,Ct.y/=l.fixedNodeConstraint.length,p.forEach(function(G,H){p[H]+=Ct.x}),C.forEach(function(G,H){C[H]+=Ct.y}),l.fixedNodeConstraint.forEach(function(G){p[y.get(G.nodeId)]=G.position.x,C[y.get(G.nodeId)]=G.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var mt=l.alignmentConstraint.vertical,Tt=function(H){var W=new Set;mt[H].forEach(function(K){W.add(K)});var z=new Set([].concat(c(W)).filter(function(K){return P.has(K)})),$=void 0;z.size>0?$=p[y.get(z.values().next().value)]:$=tt(W).x,W.forEach(function(K){P.has(K)||(p[y.get(K)]=$)})},Ot=0;Ot<mt.length;Ot++)Tt(Ot);if(l.alignmentConstraint.horizontal)for(var It=l.alignmentConstraint.horizontal,Wt=function(H){var W=new Set;It[H].forEach(function(K){W.add(K)});var z=new Set([].concat(c(W)).filter(function(K){return P.has(K)})),$=void 0;z.size>0?$=C[y.get(z.values().next().value)]:$=tt(W).y,W.forEach(function(K){P.has(K)||(C[y.get(K)]=$)})},Pt=0;Pt<It.length;Pt++)Wt(Pt)}l.relativePlacementConstraint&&(function(){var G=new Map,H=new Map,W=new Map,z=new Map,$=new Map,K=new Map,ut=new Set,ft=new Set;if(P.forEach(function(Gt){ut.add(Gt),ft.add(Gt)}),l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var q=l.alignmentConstraint.vertical,ht=function(yt){W.set("dummy"+yt,[]),q[yt].forEach(function(wt){G.set(wt,"dummy"+yt),W.get("dummy"+yt).push(wt),P.has(wt)&&ut.add("dummy"+yt)}),$.set("dummy"+yt,p[y.get(q[yt][0])])},gt=0;gt<q.length;gt++)ht(gt);if(l.alignmentConstraint.horizontal)for(var rt=l.alignmentConstraint.horizontal,vt=function(yt){z.set("dummy"+yt,[]),rt[yt].forEach(function(wt){H.set(wt,"dummy"+yt),z.get("dummy"+yt).push(wt),P.has(wt)&&ft.add("dummy"+yt)}),K.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){F.get(yt).forEach(function(wt){var kt=void 0,Bt=void 0;wt.direction=="horizontal"?(kt=G.get(yt)?G.get(yt):yt,G.get(wt.id)?Bt={id:G.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=F.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=s(Nt),Xt=s($t),zt=v(ot),de=v(it),Qt=[],Kt=[];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){Kt[yt]=[],Gt.forEach(function(wt){de.get(wt).length==0&&Kt[yt].push(wt)})});var jt=x(ot,"horizontal",ut,$,Qt),Jt=x(it,"vertical",ft,K,Kt),he=function(yt){W.get(yt)?W.get(yt).forEach(function(wt){p[y.get(wt)]=jt.get(yt)}):p[y.get(yt)]=jt.get(yt)},_t=!0,te=!1,xe=void 0;try{for(var ve=jt.keys()[Symbol.iterator](),Ie;!(_t=(Ie=ve.next()).done);_t=!0){var pe=Ie.value;he(pe)}}catch(Gt){te=!0,xe=Gt}finally{try{!_t&&ve.return&&ve.return()}finally{if(te)throw xe}}var vr=function(yt){z.get(yt)?z.get(yt).forEach(function(wt){C[y.get(wt)]=Jt.get(yt)}):C[y.get(yt)]=Jt.get(yt)},ye=!0,Re=!1,Se=void 0;try{for(var Ee=Jt.keys()[Symbol.iterator](),Fe;!(ye=(Fe=Ee.next()).done);ye=!0){var pe=Fe.value;vr(pe)}}catch(Gt){Re=!0,Se=Gt}finally{try{!ye&&Ee.return&&Ee.return()}finally{if(Re)throw Se}}})()}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 e=N[a];if(e!==void 0)return e.exports;var n=N[a]={exports:{}};return w[a](n,n.exports,u),n.exports}var o=u(45);return o})()})});var _e=me((oe,Me)=>{"use strict";(function(w,N){typeof oe=="object"&&typeof Me=="object"?Me.exports=N(we()):typeof define=="function"&&define.amd?define(["cose-base"],N):typeof oe=="object"?oe.cytoscapeFcose=N(we()):w.cytoscapeFcose=N(w.coseBase)})(oe,function(E){return(()=>{"use strict";var w={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var n=arguments.length,c=Array(n>1?n-1:0),t=1;t<n;t++)c[t-1]=arguments[t];return c.forEach(function(g){Object.keys(g).forEach(function(i){return e[i]=g[i]})}),e}}),548:((a,e,n)=>{var c=(function(){function i(r,h){var f=[],l=!0,L=!1,y=void 0;try{for(var p=r[Symbol.iterator](),C;!(l=(C=p.next()).done)&&(f.push(C.value),!(h&&f.length===h));l=!0);}catch(R){L=!0,y=R}finally{try{!l&&p.return&&p.return()}finally{if(L)throw y}}return f}return function(r,h){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return i(r,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),t=n(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(i){for(var r={},h=0;h<i.length;h++)r[i[h].id()]=!0;var f=i.filter(function(l,L){typeof l=="number"&&(l=L);for(var y=l.parent()[0];y!=null;){if(r[y.id()])return!1;y=y.parent()[0]}return!0});return f},g.connectComponents=function(i,r,h,f){var l=new t,L=new Set,y=[],p=void 0,C=void 0,R=void 0,A=!1,S=1,B=[],Y=[],tt=function(){var Z=i.collection();Y.push(Z);var s=h[0],m=i.collection();m.merge(s).merge(s.descendants().intersection(r)),y.push(s),m.forEach(function(d){l.push(d),L.add(d),Z.merge(d)});for(var v=function(){s=l.shift();var D=i.collection();s.neighborhood().nodes().forEach(function(I){r.intersection(s.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 F=p.union(p.descendants());F.forEach(function(I){l.push(I),L.add(I),Z.merge(I),h.has(I)&&y.push(I)})}}};l.length!=0;)v();if(Z.forEach(function(d){r.intersection(d.connectedEdges()).forEach(function(D){Z.has(D.source())&&Z.has(D.target())&&Z.merge(D)})}),y.length==h.length&&(A=!0),!A||A&&S>1){C=y[0],R=C.connectedEdges().length,y.forEach(function(d){d.connectedEdges().length<R&&(R=d.connectedEdges().length,C=d)}),B.push(C.id());var T=i.collection();T.merge(y[0]),y.forEach(function(d){T.merge(d)}),y=[],h=h.difference(T),S++}};do tt();while(!A);return f&&B.length>0&&f.set("dummy"+(f.size+1),B),Y},g.relocateComponent=function(i,r,h){if(!h.fixedNodeConstraint){var f=Number.POSITIVE_INFINITY,l=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=r.nodeIndexes[Symbol.iterator](),S;!(p=(S=A.next()).done);p=!0){var B=S.value,Y=c(B,2),tt=Y[0],x=Y[1],Z=h.cy.getElementById(tt);if(Z){var s=Z.boundingBox(),m=r.xCoords[x]-s.w/2,v=r.xCoords[x]+s.w/2,T=r.yCoords[x]-s.h/2,d=r.yCoords[x]+s.h/2;m<f&&(f=m),v>l&&(l=v),T<L&&(L=T),d>y&&(y=d)}}}catch(I){C=!0,R=I}finally{try{!p&&A.return&&A.return()}finally{if(C)throw R}}var D=i.x-(l+f)/2,O=i.y-(y+L)/2;r.xCoords=r.xCoords.map(function(I){return I+D}),r.yCoords=r.yCoords.map(function(I){return I+O})}else{Object.keys(r).forEach(function(I){var k=r[I],_=k.getRect().x,b=k.getRect().x+k.getRect().width,j=k.getRect().y,V=k.getRect().y+k.getRect().height;_<f&&(f=_),b>l&&(l=b),j<L&&(L=j),V>y&&(y=V)});var P=i.x-(l+f)/2,F=i.y-(y+L)/2;Object.keys(r).forEach(function(I){var k=r[I];k.setCenter(k.getCenterX()+P,k.getCenterY()+F)})}}},g.calcBoundingBox=function(i,r,h,f){for(var l=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,S=void 0,B=i.descendants().not(":parent"),Y=B.length,tt=0;tt<Y;tt++){var x=B[tt];C=r[f.get(x.id())]-x.width()/2,R=r[f.get(x.id())]+x.width()/2,A=h[f.get(x.id())]-x.height()/2,S=h[f.get(x.id())]+x.height()/2,l>C&&(l=C),L<R&&(L=R),y>A&&(y=A),p<S&&(p=S)}var Z={};return Z.topLeftX=l,Z.topLeftY=y,Z.width=L-l,Z.height=p-y,Z},g.calcParentsWithoutChildren=function(i,r){var h=i.collection();return r.nodes(":parent").forEach(function(f){var l=!1;f.children().forEach(function(L){L.css("display")!="none"&&(l=!0)}),l||h.merge(f)}),h},a.exports=g}),816:((a,e,n)=>{var c=n(548),t=n(140).CoSELayout,g=n(140).CoSENode,i=n(140).layoutBase.PointD,r=n(140).layoutBase.DimensionD,h=n(140).layoutBase.LayoutConstants,f=n(140).layoutBase.FDLayoutConstants,l=n(140).CoSEConstants,L=function(p,C){var R=p.cy,A=p.eles,S=A.nodes(),B=A.edges(),Y=void 0,tt=void 0,x=void 0,Z={};p.randomize&&(Y=C.nodeIndexes,tt=C.xCoords,x=C.yCoords);var s=function(I){return typeof I=="function"},m=function(I,k){return s(I)?I(k):I},v=c.calcParentsWithoutChildren(R,A),T=function F(I,k,_,b){for(var j=k.length,V=0;V<j;V++){var M=k[V],U=null;M.intersection(v).length==0&&(U=M.children());var X=void 0,J=M.layoutDimensions({nodeDimensionsIncludeLabels:b.nodeDimensionsIncludeLabels});if(M.outerWidth()!=null&&M.outerHeight()!=null)if(b.randomize)if(!M.isParent())X=I.add(new g(_.graphManager,new i(tt[Y.get(M.id())]-J.w/2,x[Y.get(M.id())]-J.h/2),new r(parseFloat(J.w),parseFloat(J.h))));else{var st=c.calcBoundingBox(M,tt,x,Y);M.intersection(v).length==0?X=I.add(new g(_.graphManager,new i(st.topLeftX,st.topLeftY),new r(st.width,st.height))):X=I.add(new g(_.graphManager,new i(st.topLeftX,st.topLeftY),new r(parseFloat(J.w),parseFloat(J.h))))}else X=I.add(new g(_.graphManager,new i(M.position("x")-J.w/2,M.position("y")-J.h/2),new r(parseFloat(J.w),parseFloat(J.h))));else X=I.add(new g(this.graphManager));if(X.id=M.data("id"),X.nodeRepulsion=m(b.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")),b.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),U!=null&&U.length>0){var Lt=void 0;Lt=_.getGraphManager().add(_.newGraph(),X),F(Lt,U,_,b)}}},d=function(I,k,_){for(var b=0,j=0,V=0;V<_.length;V++){var M=_[V],U=Z[M.data("source")],X=Z[M.data("target")];if(U&&X&&U!==X&&U.getEdgesBetween(X).length==0){var J=k.add(I.newEdge(),U,X);J.id=M.id(),J.idealLength=m(p.idealEdgeLength,M),J.edgeElasticity=m(p.edgeElasticity,M),b+=J.idealLength,j++}}p.idealEdgeLength!=null&&(j>0?l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=b/j:s(p.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=p.idealEdgeLength,l.MIN_REPULSION_DIST=f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH)},D=function(I,k){k.fixedNodeConstraint&&(I.constraints.fixedNodeConstraint=k.fixedNodeConstraint),k.alignmentConstraint&&(I.constraints.alignmentConstraint=k.alignmentConstraint),k.relativePlacementConstraint&&(I.constraints.relativePlacementConstraint=k.relativePlacementConstraint)};p.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=p.nestingFactor),p.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=f.DEFAULT_GRAVITY_STRENGTH=p.gravity),p.numIter!=null&&(l.MAX_ITERATIONS=f.MAX_ITERATIONS=p.numIter),p.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=f.DEFAULT_GRAVITY_RANGE_FACTOR=p.gravityRange),p.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=p.gravityCompound),p.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=p.gravityRangeCompound),p.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=f.DEFAULT_COOLING_FACTOR_INCREMENTAL=p.initialEnergyOnIncremental),p.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=p.tilingCompareBy),p.quality=="proof"?h.QUALITY=2:h.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=f.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=p.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!p.randomize,l.ANIMATE=f.ANIMATE=h.ANIMATE=p.animate,l.TILE=p.tile,l.TILING_PADDING_VERTICAL=typeof p.tilingPaddingVertical=="function"?p.tilingPaddingVertical.call():p.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof p.tilingPaddingHorizontal=="function"?p.tilingPaddingHorizontal.call():p.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!p.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=p.uniformNodeDimensions,p.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),p.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),p.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),p.step=="all"&&(p.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),p.fixedNodeConstraint||p.alignmentConstraint||p.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new t,P=O.newGraphManager();return T(P.addRoot(),c.getTopMostNodes(S),O,p),d(O,P,B),D(O,p),O.runLayout(),Z};a.exports={coseLayout:L}}),212:((a,e,n)=>{var c=(function(){function p(C,R){for(var A=0;A<R.length;A++){var S=R[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(C,S.key,S)}}return function(C,R,A){return R&&p(C.prototype,R),A&&p(C,A),C}})();function t(p,C){if(!(p instanceof C))throw new TypeError("Cannot call a class as a function")}var g=n(658),i=n(548),r=n(657),h=r.spectralLayout,f=n(816),l=f.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){t(this,p),this.options=g({},L,C)}return c(p,[{key:"run",value:function(){var R=this,A=this.options,S=A.cy,B=A.eles,Y=[],tt=void 0,x=void 0,Z=[],s=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 v=A.fixedNodeConstraint||A.alignmentConstraint||A.relativePlacementConstraint;v&&(A.tile=!1,A.packComponents=!1);var T=void 0,d=!1;if(S.layoutUtilities&&A.packComponents&&(T=S.layoutUtilities("get"),T||(T=S.layoutUtilities()),d=!0),B.nodes().length>0)if(d){var P=i.getTopMostNodes(A.eles.nodes());if(s=i.connectComponents(S,A.eles,P),s.forEach(function(at){var et=at.boundingBox();m.push({x:et.x1+et.w/2,y:et.y1+et.h/2})}),A.randomize&&s.forEach(function(at){A.eles=at,Y.push(h(A))}),A.quality=="default"||A.quality=="proof"){var F=S.collection();if(A.tile){var I=new Map,k=[],_=[],b=0,j={nodeIndexes:I,xCoords:k,yCoords:_},V=[];if(s.forEach(function(at,et){at.edges().length==0&&(at.nodes().forEach(function(pt,Et){F.merge(at.nodes()[Et]),pt.isParent()||(j.nodeIndexes.set(at.nodes()[Et].id(),b++),j.xCoords.push(at.nodes()[0].position().x),j.yCoords.push(at.nodes()[0].position().y))}),V.push(et))}),F.length>1){var M=F.boundingBox();m.push({x:M.x1+M.w/2,y:M.y1+M.h/2}),s.push(F),Y.push(j);for(var U=V.length-1;U>=0;U--)s.splice(V[U],1),Y.splice(V[U],1),m.splice(V[U],1)}}s.forEach(function(at,et){A.eles=at,Z.push(l(A,Y[et])),i.relocateComponent(m[et],Z[et],A)})}else s.forEach(function(at,et){i.relocateComponent(m[et],Y[et],A)});var X=new Set;if(s.length>1){var J=[],st=B.filter(function(at){return at.css("display")=="none"});s.forEach(function(at,et){var pt=void 0;if(A.quality=="draft"&&(pt=Y[et].nodeIndexes),at.nodes().not(st).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;at.nodes().not(st).forEach(function(mt){if(A.quality=="draft")if(!mt.isParent())Ct=pt.get(mt.id()),Et.nodes.push({x:Y[et].xCoords[Ct]-mt.boundingbox().w/2,y:Y[et].yCoords[Ct]-mt.boundingbox().h/2,width:mt.boundingbox().w,height:mt.boundingbox().h});else{var Tt=i.calcBoundingBox(mt,Y[et].xCoords,Y[et].yCoords,pt);Et.nodes.push({x:Tt.topLeftX,y:Tt.topLeftY,width:Tt.width,height:Tt.height})}else Z[et][mt.id()]&&Et.nodes.push({x:Z[et][mt.id()].getLeft(),y:Z[et][mt.id()].getTop(),width:Z[et][mt.id()].getWidth(),height:Z[et][mt.id()].getHeight()})}),at.edges().forEach(function(mt){var Tt=mt.source(),Ot=mt.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=i.calcBoundingBox(Tt,Y[et].xCoords,Y[et].yCoords,pt);Pt.push(bt.topLeftX+bt.width/2),Pt.push(bt.topLeftY+bt.height/2)}else Pt.push(Y[et].xCoords[It]),Pt.push(Y[et].yCoords[It]);if(Ot.isParent()){var G=i.calcBoundingBox(Ot,Y[et].xCoords,Y[et].yCoords,pt);Yt.push(G.topLeftX+G.width/2),Yt.push(G.topLeftY+G.height/2)}else Yt.push(Y[et].xCoords[Wt]),Yt.push(Y[et].yCoords[Wt]);Et.edges.push({startX:Pt[0],startY:Pt[1],endX:Yt[0],endY:Yt[1]})}else Z[et][Tt.id()]&&Z[et][Ot.id()]&&Et.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()})}),Et.nodes.length>0&&(J.push(Et),X.add(et))}});var Lt=T.packComponents(J,A.randomize).shifts;if(A.quality=="draft")Y.forEach(function(at,et){var pt=at.xCoords.map(function(Ct){return Ct+Lt[et].dx}),Et=at.yCoords.map(function(Ct){return Ct+Lt[et].dy});at.xCoords=pt,at.yCoords=Et});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);Y.push(O)}A.quality=="default"||A.quality=="proof"?(Z.push(l(A,Y[0])),i.relocateComponent(m[0],Z[0],A)):i.relocateComponent(m[0],Y[0],A)}var Q=function(et,pt){if(A.quality=="default"||A.quality=="proof"){typeof et=="number"&&(et=pt);var Et=void 0,Ct=void 0,mt=et.data("id");return Z.forEach(function(Ot){mt in Ot&&(Et={x:Ot[mt].getRect().getCenterX(),y:Ot[mt].getRect().getCenterY()},Ct=Ot[mt])}),A.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:et.position("x"),y:et.position("y")}),{x:Et.x,y:Et.y}}else{var Tt=void 0;return Y.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=i.calcParentsWithoutChildren(S,B),Mt=B.filter(function(at){return at.css("display")=="none"});A.eles=B.not(Mt),B.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,e,n)=>{var c=n(548),t=n(140).layoutBase.Matrix,g=n(140).layoutBase.SVD,i=function(h){var f=h.cy,l=h.eles,L=l.nodes(),y=l.nodes(":parent"),p=new Map,C=new Map,R=new Map,A=[],S=[],B=[],Y=[],tt=[],x=[],Z=[],s=[],m=void 0,v=void 0,T=1e8,d=1e-9,D=h.piTol,O=h.samplingType,P=h.nodeSeparation,F=void 0,I=function(){for(var W=0,z=0,$=!1;z<F;){W=Math.floor(Math.random()*v),$=!1;for(var K=0;K<z;K++)if(Y[K]==W){$=!0;break}if(!$)Y[z]=W,z++;else continue}},k=function(W,z,$){for(var K=[],ut=0,ft=0,q=0,ht=void 0,gt=[],rt=0,vt=1,At=0;At<v;At++)gt[At]=T;for(K[ft]=W,gt[W]=0;ft>=ut;){q=K[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,K[++ft]=ht);x[q][z]=gt[q]*P}if($){for(var dt=0;dt<v;dt++)x[dt][z]<tt[dt]&&(tt[dt]=x[dt][z]);for(var nt=0;nt<v;nt++)tt[nt]>rt&&(rt=tt[nt],vt=nt)}return vt},_=function(W){var z=void 0;if(W){z=Math.floor(Math.random()*v),m=z;for(var K=0;K<v;K++)tt[K]=T;for(var ut=0;ut<F;ut++)Y[ut]=z,z=k(z,ut,W)}else{I();for(var $=0;$<F;$++)k(Y[$],$,W,!1)}for(var ft=0;ft<v;ft++)for(var q=0;q<F;q++)x[ft][q]*=x[ft][q];for(var ht=0;ht<F;ht++)Z[ht]=[];for(var gt=0;gt<F;gt++)for(var rt=0;rt<F;rt++)Z[gt][rt]=x[Y[rt]][gt]},b=function(){for(var W=g.svd(Z),z=W.S,$=W.U,K=W.V,ut=z[0]*z[0]*z[0],ft=[],q=0;q<F;q++){ft[q]=[];for(var ht=0;ht<F;ht++)ft[q][ht]=0,q==ht&&(ft[q][ht]=z[q]/(z[q]*z[q]+ut/(z[q]*z[q])))}s=t.multMat(t.multMat(K,ft),t.transpose($))},j=function(){for(var W=void 0,z=void 0,$=[],K=[],ut=[],ft=[],q=0;q<v;q++)$[q]=Math.random(),K[q]=Math.random();$=t.normalize($),K=t.normalize(K);for(var ht=0,gt=d,rt=d,vt=void 0;;){ht++;for(var At=0;At<v;At++)ut[At]=$[At];if($=t.multGamma(t.multL(t.multGamma(ut),x,s)),W=t.dotProduct(ut,$),$=t.normalize($),gt=t.dotProduct(ut,$),vt=Math.abs(gt/rt),vt<=1+D&&vt>=1)break;rt=gt}for(var ot=0;ot<v;ot++)ut[ot]=$[ot];for(ht=0,rt=d;;){ht++;for(var it=0;it<v;it++)ft[it]=K[it];if(ft=t.minusOp(ft,t.multCons(ut,t.dotProduct(ut,ft))),K=t.multGamma(t.multL(t.multGamma(ft),x,s)),z=t.dotProduct(ft,K),K=t.normalize(K),gt=t.dotProduct(ft,K),vt=Math.abs(gt/rt),vt<=1+D&&vt>=1)break;rt=gt}for(var dt=0;dt<v;dt++)ft[dt]=K[dt];S=t.multCons(ut,Math.sqrt(Math.abs(W))),B=t.multCons(ft,Math.sqrt(Math.abs(z)))};c.connectComponents(f,l,c.getTopMostNodes(L),p),y.forEach(function(H){c.connectComponents(f,l,c.getTopMostNodes(H.descendants().intersection(l)),p)});for(var V=0,M=0;M<L.length;M++)L[M].isParent()||C.set(L[M].id(),V++);var U=!0,X=!1,J=void 0;try{for(var st=p.keys()[Symbol.iterator](),Lt;!(U=(Lt=st.next()).done);U=!0){var St=Lt.value;C.set(St,V++)}}catch(H){X=!0,J=H}finally{try{!U&&st.return&&st.return()}finally{if(X)throw J}}for(var Q=0;Q<C.size;Q++)A[Q]=[];y.forEach(function(H){for(var W=H.children().intersection(l);W.nodes(":childless").length==0;)W=W.nodes()[0].children().intersection(l);var z=0,$=W.nodes(":childless")[0].connectedEdges().length;W.nodes(":childless").forEach(function(K,ut){K.connectedEdges().length<$&&($=K.connectedEdges().length,z=ut)}),R.set(H.id(),W.nodes(":childless")[z].id())}),L.forEach(function(H){var W=void 0;H.isParent()?W=C.get(R.get(H.id())):W=C.get(H.id()),H.neighborhood().nodes().forEach(function(z){l.intersection(H.edgesWith(z)).length>0&&(z.isParent()?A[W].push(R.get(z.id())):A[W].push(z.id()))})});var Ut=function(W){var z=C.get(W),$=void 0;p.get(W).forEach(function(K){f.getElementById(K).isParent()?$=R.get(K):$=K,A[z].push($),A[C.get($)].push(W)})},Mt=!0,at=!1,et=void 0;try{for(var pt=p.keys()[Symbol.iterator](),Et;!(Mt=(Et=pt.next()).done);Mt=!0){var Ct=Et.value;Ut(Ct)}}catch(H){at=!0,et=H}finally{try{!Mt&&pt.return&&pt.return()}finally{if(at)throw et}}v=C.size;var mt=void 0;if(v>2){F=v<h.sampleSize?v:h.sampleSize;for(var Tt=0;Tt<v;Tt++)x[Tt]=[];for(var Ot=0;Ot<F;Ot++)s[Ot]=[];return h.quality=="draft"||h.step=="all"?(_(O),b(),j(),mt={nodeIndexes:C,xCoords:S,yCoords:B}):(C.forEach(function(H,W){S.push(f.getElementById(W).position("x")),B.push(f.getElementById(W).position("y"))}),mt={nodeIndexes:C,xCoords:S,yCoords:B}),mt}else{var It=C.keys(),Wt=f.getElementById(It.next().value),Pt=Wt.position(),Yt=Wt.outerWidth();if(S.push(Pt.x),B.push(Pt.y),v==2){var bt=f.getElementById(It.next().value),G=bt.outerWidth();S.push(Pt.x+Yt/2+G/2+h.idealEdgeLength),B.push(Pt.y)}return mt={nodeIndexes:C,xCoords:S,yCoords:B},mt}};a.exports={spectralLayout:i}}),579:((a,e,n)=>{var c=n(212),t=function(i){i&&i("layout","fcose",c)};typeof cytoscape<"u"&&t(cytoscape),a.exports=t}),140:(a=>{a.exports=E})},N={};function u(a){var e=N[a];if(e!==void 0)return e.exports;var n=N[a]={exports:{}};return w[a](n,n.exports,u),n.exports}var o=u(579);return o})()})});var or=pr(_e(),1);var tr={L:"left",R:"right",T:"top",B:"bottom"},er={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")},ue={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")},yr=ct(function(E){return Ht(E)?E==="L"?"R":"L":E==="T"?"B":"T"},"getOppositeArchitectureDirection"),rr=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"),qt=ct(function(E){let w=E;return w==="T"||w==="B"},"isArchitectureDirectionY"),De=ct(function(E,w){let N=Ht(E)&&qt(w),u=qt(E)&&Ht(w);return N||u},"isArchitectureDirectionXY"),Er=ct(function(E){let w=E[0],N=E[1],u=Ht(w)&&qt(N),o=qt(w)&&Ht(N);return u||o},"isArchitecturePairXY"),mr=ct(function(E){return E!=="LL"&&E!=="RR"&&E!=="TT"&&E!=="BB"},"isValidArchitectureDirectionPair"),Oe=ct(function(E,w){let N=`${E}${w}`;return mr(N)?N:void 0},"getArchitectureDirectionPair"),Tr=ct(function([E,w],N){let u=N[0],o=N[1];return Ht(u)?qt(o)?[E+(u==="L"?-1:1),w+(o==="T"?1:-1)]:[E+(u==="L"?-1:1),w]:Ht(o)?[E+(o==="L"?1:-1),w+(u==="T"?1:-1)]:[E,w+(u==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Nr=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"),Lr=ct(function(E,w){return De(E,w)?"bend":Ht(E)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Cr=ct(function(E){return E.type==="service"},"isArchitectureService"),Ar=ct(function(E){return E.type==="junction"},"isArchitectureJunction"),ir=ct(E=>E.data(),"edgeData"),ie=ct(E=>E.data(),"nodeData"),wr=Pe.architecture,nr=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=He,this.getAccTitle=We,this.setDiagramTitle=Be,this.getDiagramTitle=$e,this.getAccDescription=ze,this.setAccDescription=Ve,this.clear()}static{ct(this,"ArchitectureDB")}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},Xe()}addService({id:E,icon:w,in:N,title:u,iconText:o}){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:o,title:u,edges:[],in:N}}getServices(){return Object.values(this.nodes).filter(Cr)}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(Ar)}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:o,rhsInto:a,lhsGroup:e,rhsGroup:n,title:c}){if(!rr(N))throw new Error(`Invalid direction given for left hand side of edge ${E}--${w}. Expected (L,R,T,B) got ${String(N)}`);if(!rr(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 t=this.nodes[E].in,g=this.nodes[w].in;if(e&&t&&g&&t==g)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&&t&&g&&t==g)throw new Error(`The right-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:E,lhsDir:N,lhsInto:o,lhsGroup:e,rhsId:w,rhsDir:u,rhsInto:a,rhsGroup:n,title:c};this.edges.push(i),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,[c,t])=>(n[c]=t.edges.reduce((g,i)=>{let r=this.getNode(i.lhsId)?.in,h=this.getNode(i.rhsId)?.in;if(r&&h&&r!==h){let f=Lr(i.lhsDir,i.rhsDir);f!=="bend"&&(E[r]??={},E[r][h]=f,E[h]??={},E[h][r]=f)}if(i.lhsId===c){let f=Oe(i.lhsDir,i.rhsDir);f&&(g[f]=i.rhsId)}else{let f=Oe(i.rhsDir,i.lhsDir);f&&(g[f]=i.lhsId)}return g},{}),n),{}),N=Object.keys(w)[0],u={[N]:1},o=Object.keys(w).reduce((n,c)=>c===N?n:le(ee({},n),{[c]:1}),{}),a=ct(n=>{let c={[n]:[0,0]},t=[n];for(;t.length>0;){let g=t.shift();if(g){u[g]=1,delete o[g];let i=w[g],[r,h]=c[g];Object.entries(i).forEach(([f,l])=>{u[l]||(c[l]=Tr([r,h],f),t.push(l))})}}return c},"BFS"),e=[a(N)];for(;Object.keys(o).length>0;)e.push(a(Object.keys(o)[0]));this.dataStructures={adjList:w,spatialMaps:e,groupAlignments:E}}return this.dataStructures}setElementForId(E,w){this.elements[E]=w}getElementById(E){return this.elements[E]}getConfig(){return Ze(ee(ee({},wr),Ge().architecture))}getConfigField(E){return this.getConfig()[E]}},Mr=ct((E,w)=>{Ke(E,w),E.groups.map(N=>w.addGroup(N)),E.services.map(N=>w.addService(le(ee({},N),{type:"service"}))),E.junctions.map(N=>w.addJunction(le(ee({},N),{type:"junction"}))),E.edges.map(N=>w.addEdge(N))},"populateDb"),ar={parser:{yy:void 0},parse:ct(E=>Zt(null,null,function*(){let w=yield je("architecture",E);Te.debug(w);let N=ar.parser?.yy;if(!(N instanceof nr))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.");Mr(w,N)}),"parse")},Or=ct(E=>`
2 .edge {
3 stroke-width: ${E.archEdgeWidth};
4 stroke: ${E.archEdgeColor};

Callers 1

iFunction · 0.70

Calls 2

kFunction · 0.70
IFunction · 0.70

Tested by

no test coverage detected