UNPKG

@eventcatalogtest/studio

Version:

A drag and drop UI for distributed systems that keeps your diagrams where they belong – in your repo

1 lines 145 kB
exports.id=5862,exports.ids=[5862],exports.modules={51734:(a,b,c)=>{"use strict";c.d(b,{m:()=>e});var d=c(32892),e=class{constructor(a){this.init=a,this.records=this.init()}static{(0,d.K2)(this,"ImperativeState")}reset(){this.records=this.init()}}},68362:function(a){a.exports=function(){var a=[function(a,b,c){"use strict";function d(){}d.QUALITY=1,d.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,d.DEFAULT_INCREMENTAL=!1,d.DEFAULT_ANIMATION_ON_LAYOUT=!0,d.DEFAULT_ANIMATION_DURING_LAYOUT=!1,d.DEFAULT_ANIMATION_PERIOD=50,d.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,d.DEFAULT_GRAPH_MARGIN=15,d.NODE_DIMENSIONS_INCLUDE_LABELS=!1,d.SIMPLE_NODE_SIZE=40,d.SIMPLE_NODE_HALF_SIZE=d.SIMPLE_NODE_SIZE/2,d.EMPTY_COMPOUND_NODE_SIZE=40,d.MIN_EDGE_LENGTH=1,d.WORLD_BOUNDARY=1e6,d.INITIAL_WORLD_BOUNDARY=d.WORLD_BOUNDARY/1e3,d.WORLD_CENTER_X=1200,d.WORLD_CENTER_Y=900,a.exports=d},function(a,b,c){"use strict";var d=c(2),e=c(8),f=c(9);function g(a,b,c){d.call(this,c),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=c,this.bendpoints=[],this.source=a,this.target=b}for(var h in g.prototype=Object.create(d.prototype),d)g[h]=d[h];g.prototype.getSource=function(){return this.source},g.prototype.getTarget=function(){return this.target},g.prototype.isInterGraph=function(){return this.isInterGraph},g.prototype.getLength=function(){return this.length},g.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},g.prototype.getBendpoints=function(){return this.bendpoints},g.prototype.getLca=function(){return this.lca},g.prototype.getSourceInLca=function(){return this.sourceInLca},g.prototype.getTargetInLca=function(){return this.targetInLca},g.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},g.prototype.getOtherEndInGraph=function(a,b){for(var c=this.getOtherEnd(a),d=b.getGraphManager().getRoot();;){if(c.getOwner()==b)return c;if(c.getOwner()==d)break;c=c.getOwner().getParent()}return null},g.prototype.updateLength=function(){var a=[,,,,];this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],1>Math.abs(this.lengthX)&&(this.lengthX=f.sign(this.lengthX)),1>Math.abs(this.lengthY)&&(this.lengthY=f.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},g.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),1>Math.abs(this.lengthX)&&(this.lengthX=f.sign(this.lengthX)),1>Math.abs(this.lengthY)&&(this.lengthY=f.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},a.exports=g},function(a,b,c){"use strict";a.exports=function(a){this.vGraphObject=a}},function(a,b,c){"use strict";var d=c(2),e=c(10),f=c(13),g=c(0),h=c(16),i=c(5);function j(a,b,c,g){null==c&&null==g&&(g=b),d.call(this,g),null!=a.graphManager&&(a=a.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=a,null!=c&&null!=b?this.rect=new f(b.x,b.y,c.width,c.height):this.rect=new f}for(var k in j.prototype=Object.create(d.prototype),d)j[k]=d[k];j.prototype.getEdges=function(){return this.edges},j.prototype.getChild=function(){return this.child},j.prototype.getOwner=function(){return this.owner},j.prototype.getWidth=function(){return this.rect.width},j.prototype.setWidth=function(a){this.rect.width=a},j.prototype.getHeight=function(){return this.rect.height},j.prototype.setHeight=function(a){this.rect.height=a},j.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},j.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},j.prototype.getCenter=function(){return new i(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},j.prototype.getLocation=function(){return new i(this.rect.x,this.rect.y)},j.prototype.getRect=function(){return this.rect},j.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},j.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},j.prototype.setRect=function(a,b){this.rect.x=a.x,this.rect.y=a.y,this.rect.width=b.width,this.rect.height=b.height},j.prototype.setCenter=function(a,b){this.rect.x=a-this.rect.width/2,this.rect.y=b-this.rect.height/2},j.prototype.setLocation=function(a,b){this.rect.x=a,this.rect.y=b},j.prototype.moveBy=function(a,b){this.rect.x+=a,this.rect.y+=b},j.prototype.getEdgeListToNode=function(a){var b=[],c=this;return c.edges.forEach(function(d){if(d.target==a){if(d.source!=c)throw"Incorrect edge source!";b.push(d)}}),b},j.prototype.getEdgesBetween=function(a){var b=[],c=this;return c.edges.forEach(function(d){if(d.source!=c&&d.target!=c)throw"Incorrect edge source and/or target";(d.target==a||d.source==a)&&b.push(d)}),b},j.prototype.getNeighborsList=function(){var a=new Set,b=this;return b.edges.forEach(function(c){if(c.source==b)a.add(c.target);else{if(c.target!=b)throw"Incorrect incidency!";a.add(c.source)}}),a},j.prototype.withChildren=function(){var a=new Set;if(a.add(this),null!=this.child)for(var b=this.child.getNodes(),c=0;c<b.length;c++)b[c].withChildren().forEach(function(b){a.add(b)});return a},j.prototype.getNoOfChildren=function(){var a=0;if(null==this.child)a=1;else for(var b=this.child.getNodes(),c=0;c<b.length;c++)a+=b[c].getNoOfChildren();return 0==a&&(a=1),a},j.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},j.prototype.calcEstimatedSize=function(){return null==this.child?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)},j.prototype.scatter=function(){var a,b,c=-g.INITIAL_WORLD_BOUNDARY,d=g.INITIAL_WORLD_BOUNDARY;a=g.WORLD_CENTER_X+h.nextDouble()*(d-c)+c;var e=-g.INITIAL_WORLD_BOUNDARY,f=g.INITIAL_WORLD_BOUNDARY;b=g.WORLD_CENTER_Y+h.nextDouble()*(f-e)+e,this.rect.x=a,this.rect.y=b},j.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var a=this.getChild();if(a.updateBounds(!0),this.rect.x=a.getLeft(),this.rect.y=a.getTop(),this.setWidth(a.getRight()-a.getLeft()),this.setHeight(a.getBottom()-a.getTop()),g.NODE_DIMENSIONS_INCLUDE_LABELS){var b=a.getRight()-a.getLeft(),c=a.getBottom()-a.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(b+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>b?(this.rect.x-=(this.labelWidth-b)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(b+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(c+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>c?(this.rect.y-=(this.labelHeight-c)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(c+this.labelHeight))}}},j.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},j.prototype.transform=function(a){var b=this.rect.x;b>g.WORLD_BOUNDARY?b=g.WORLD_BOUNDARY:b<-g.WORLD_BOUNDARY&&(b=-g.WORLD_BOUNDARY);var c=this.rect.y;c>g.WORLD_BOUNDARY?c=g.WORLD_BOUNDARY:c<-g.WORLD_BOUNDARY&&(c=-g.WORLD_BOUNDARY);var d=new i(b,c),e=a.inverseTransformPoint(d);this.setLocation(e.x,e.y)},j.prototype.getLeft=function(){return this.rect.x},j.prototype.getRight=function(){return this.rect.x+this.rect.width},j.prototype.getTop=function(){return this.rect.y},j.prototype.getBottom=function(){return this.rect.y+this.rect.height},j.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},a.exports=j},function(a,b,c){"use strict";var d=c(0);function e(){}for(var f in d)e[f]=d[f];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=3*e.MAX_NODE_DISPLACEMENT_INCREMENTAL,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,a.exports=e},function(a,b,c){"use strict";function d(a,b){null==a&&null==b?(this.x=0,this.y=0):(this.x=a,this.y=b)}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.setX=function(a){this.x=a},d.prototype.setY=function(a){this.y=a},d.prototype.getDifference=function(a){return new DimensionD(this.x-a.x,this.y-a.y)},d.prototype.getCopy=function(){return new d(this.x,this.y)},d.prototype.translate=function(a){return this.x+=a.width,this.y+=a.height,this},a.exports=d},function(a,b,c){"use strict";var d=c(2),e=c(10),f=c(0),g=c(7),h=c(3),i=c(1),j=c(13),k=c(12),l=c(11);function m(a,b,c){d.call(this,c),this.estimatedSize=e.MIN_VALUE,this.margin=f.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=a,null!=b&&b instanceof g?this.graphManager=b:null!=b&&b instanceof Layout&&(this.graphManager=b.graphManager)}for(var n in m.prototype=Object.create(d.prototype),d)m[n]=d[n];m.prototype.getNodes=function(){return this.nodes},m.prototype.getEdges=function(){return this.edges},m.prototype.getGraphManager=function(){return this.graphManager},m.prototype.getParent=function(){return this.parent},m.prototype.getLeft=function(){return this.left},m.prototype.getRight=function(){return this.right},m.prototype.getTop=function(){return this.top},m.prototype.getBottom=function(){return this.bottom},m.prototype.isConnected=function(){return this.isConnected},m.prototype.add=function(a,b,c){if(null==b&&null==c){if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(a)>-1)throw"Node already in graph!";return a.owner=this,this.getNodes().push(a),a}if(!(this.getNodes().indexOf(b)>-1&&this.getNodes().indexOf(c)>-1))throw"Source or target not in graph!";if(b.owner!=c.owner||b.owner!=this)throw"Both owners must be this graph!";return b.owner!=c.owner?null:(a.source=b,a.target=c,a.isInterGraph=!1,this.getEdges().push(a),b.edges.push(a),c!=b&&c.edges.push(a),a)},m.prototype.remove=function(a){if(a instanceof h){if(null==a)throw"Node is null!";if(null==a.owner||a.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var b,c=a.edges.slice(),d=c.length,e=0;e<d;e++)(b=c[e]).isInterGraph?this.graphManager.remove(b):b.source.owner.remove(b);var f=this.nodes.indexOf(a);if(-1==f)throw"Node not in owner node list!";this.nodes.splice(f,1)}else if(a instanceof i){var b=a;if(null==b)throw"Edge is null!";if(null==b.source||null==b.target)throw"Source and/or target is null!";if(null==b.source.owner||null==b.target.owner||b.source.owner!=this||b.target.owner!=this)throw"Source and/or target owner is invalid!";var g=b.source.edges.indexOf(b),j=b.target.edges.indexOf(b);if(!(g>-1&&j>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(g,1),b.target!=b.source&&b.target.edges.splice(j,1);var f=b.source.owner.getEdges().indexOf(b);if(-1==f)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(f,1)}},m.prototype.updateLeftTop=function(){for(var a,b,c,d=e.MAX_VALUE,f=e.MAX_VALUE,g=this.getNodes(),h=g.length,i=0;i<h;i++){var j=g[i];a=j.getTop(),b=j.getLeft(),d>a&&(d=a),f>b&&(f=b)}return d==e.MAX_VALUE?null:(c=void 0!=g[0].getParent().paddingLeft?g[0].getParent().paddingLeft:this.margin,this.left=f-c,this.top=d-c,new k(this.left,this.top))},m.prototype.updateBounds=function(a){for(var b,c,d,f,g,h=e.MAX_VALUE,i=-e.MAX_VALUE,k=e.MAX_VALUE,l=-e.MAX_VALUE,m=this.nodes,n=m.length,o=0;o<n;o++){var p=m[o];a&&null!=p.child&&p.updateBounds(),b=p.getLeft(),c=p.getRight(),d=p.getTop(),f=p.getBottom(),h>b&&(h=b),i<c&&(i=c),k>d&&(k=d),l<f&&(l=f)}var q=new j(h,k,i-h,l-k);h==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),g=void 0!=m[0].getParent().paddingLeft?m[0].getParent().paddingLeft:this.margin,this.left=q.x-g,this.right=q.x+q.width+g,this.top=q.y-g,this.bottom=q.y+q.height+g},m.calculateBounds=function(a){for(var b,c,d,f,g=e.MAX_VALUE,h=-e.MAX_VALUE,i=e.MAX_VALUE,k=-e.MAX_VALUE,l=a.length,m=0;m<l;m++){var n=a[m];b=n.getLeft(),c=n.getRight(),d=n.getTop(),f=n.getBottom(),g>b&&(g=b),h<c&&(h=c),i>d&&(i=d),k<f&&(k=f)}return new j(g,i,h-g,k-i)},m.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},m.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},m.prototype.calcEstimatedSize=function(){for(var a=0,b=this.nodes,c=b.length,d=0;d<c;d++)a+=b[d].calcEstimatedSize();return 0==a?this.estimatedSize=f.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=a/Math.sqrt(this.nodes.length),this.estimatedSize},m.prototype.updateConnected=function(){var a,b,c=this;if(0==this.nodes.length){this.isConnected=!0;return}var d=new l,e=new Set,f=this.nodes[0];for(f.withChildren().forEach(function(a){d.push(a),e.add(a)});0!==d.length;)for(var g=(a=(f=d.shift()).getEdges()).length,h=0;h<g;h++)null==(b=a[h].getOtherEndInGraph(f,this))||e.has(b)||b.withChildren().forEach(function(a){d.push(a),e.add(a)});if(this.isConnected=!1,e.size>=this.nodes.length){var i=0;e.forEach(function(a){a.owner==c&&i++}),i==this.nodes.length&&(this.isConnected=!0)}},a.exports=m},function(a,b,c){"use strict";var d,e=c(1);function f(a){d=c(6),this.layout=a,this.graphs=[],this.edges=[]}f.prototype.addRoot=function(){var a=this.layout.newGraph(),b=this.layout.newNode(null),c=this.add(a,b);return this.setRootGraph(c),this.rootGraph},f.prototype.add=function(a,b,c,d,e){if(null==c&&null==d&&null==e){if(null==a)throw"Graph is null!";if(null==b)throw"Parent node is null!";if(this.graphs.indexOf(a)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(a),null!=a.parent)throw"Already has a parent!";if(null!=b.child)throw"Already has a child!";return a.parent=b,b.child=a,a}e=c,d=b,c=a;var f=d.getOwner(),g=e.getOwner();if(null==f||f.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==g||g.getGraphManager()!=this)throw"Target not in this graph mgr!";if(f==g)return c.isInterGraph=!1,f.add(c,d,e);if(c.isInterGraph=!0,c.source=d,c.target=e,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),null==c.source||null==c.target)throw"Edge source and/or target is null!";if(-1!=c.source.edges.indexOf(c)||-1!=c.target.edges.indexOf(c))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c},f.prototype.remove=function(a){if(a instanceof d){if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(a!=this.rootGraph&&(null==a.parent||a.parent.graphManager!=this))throw"Invalid parent node!";for(var b,c,f=[],g=(f=f.concat(a.getEdges())).length,h=0;h<g;h++)b=f[h],a.remove(b);var i=[];g=(i=i.concat(a.getNodes())).length;for(var h=0;h<g;h++)c=i[h],a.remove(c);a==this.rootGraph&&this.setRootGraph(null);var j=this.graphs.indexOf(a);this.graphs.splice(j,1),a.parent=null}else if(a instanceof e){if(null==(b=a))throw"Edge is null!";if(!b.isInterGraph)throw"Not an inter-graph edge!";if(null==b.source||null==b.target)throw"Source and/or target is null!";if(-1==b.source.edges.indexOf(b)||-1==b.target.edges.indexOf(b))throw"Source and/or target doesn't know this edge!";var j=b.source.edges.indexOf(b);if(b.source.edges.splice(j,1),j=b.target.edges.indexOf(b),b.target.edges.splice(j,1),null==b.source.owner||null==b.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==b.source.owner.getGraphManager().edges.indexOf(b))throw"Not in owner graph manager's edge list!";var j=b.source.owner.getGraphManager().edges.indexOf(b);b.source.owner.getGraphManager().edges.splice(j,1)}},f.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},f.prototype.getGraphs=function(){return this.graphs},f.prototype.getAllNodes=function(){if(null==this.allNodes){for(var a=[],b=this.getGraphs(),c=b.length,d=0;d<c;d++)a=a.concat(b[d].getNodes());this.allNodes=a}return this.allNodes},f.prototype.resetAllNodes=function(){this.allNodes=null},f.prototype.resetAllEdges=function(){this.allEdges=null},f.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},f.prototype.getAllEdges=function(){if(null==this.allEdges){var a=[],b=this.getGraphs();b.length;for(var c=0;c<b.length;c++)a=a.concat(b[c].getEdges());a=a.concat(this.edges),this.allEdges=a}return this.allEdges},f.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},f.prototype.setAllNodesToApplyGravitation=function(a){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=a},f.prototype.getRoot=function(){return this.rootGraph},f.prototype.setRootGraph=function(a){if(a.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=a,null==a.parent&&(a.parent=this.layout.newNode("Root node"))},f.prototype.getLayout=function(){return this.layout},f.prototype.isOneAncestorOfOther=function(a,b){if(null==a||null==b)throw"assert failed";if(a==b)return!0;for(var c,d=a.getOwner();null!=(c=d.getParent());){if(c==b)return!0;if(null==(d=c.getOwner()))break}for(d=b.getOwner();null!=(c=d.getParent());){if(c==a)return!0;if(null==(d=c.getOwner()))break}return!1},f.prototype.calcLowestCommonAncestors=function(){for(var a,b,c,d,e,f=this.getAllEdges(),g=f.length,h=0;h<g;h++){if(b=(a=f[h]).source,c=a.target,a.lca=null,a.sourceInLca=b,a.targetInLca=c,b==c){a.lca=b.getOwner();continue}for(d=b.getOwner();null==a.lca;){for(a.targetInLca=c,e=c.getOwner();null==a.lca;){if(e==d){a.lca=e;break}if(e==this.rootGraph)break;if(null!=a.lca)throw"assert failed";a.targetInLca=e.getParent(),e=a.targetInLca.getOwner()}if(d==this.rootGraph)break;null==a.lca&&(a.sourceInLca=d.getParent(),d=a.sourceInLca.getOwner())}if(null==a.lca)throw"assert failed"}},f.prototype.calcLowestCommonAncestor=function(a,b){if(a==b)return a.getOwner();for(var c=a.getOwner();null!=c;){for(var d=b.getOwner();null!=d;){if(d==c)return d;d=d.getParent().getOwner()}c=c.getParent().getOwner()}return c},f.prototype.calcInclusionTreeDepths=function(a,b){null==a&&null==b&&(a=this.rootGraph,b=1);for(var c,d=a.getNodes(),e=d.length,f=0;f<e;f++)(c=d[f]).inclusionTreeDepth=b,null!=c.child&&this.calcInclusionTreeDepths(c.child,b+1)},f.prototype.includesInvalidEdge=function(){for(var a,b=[],c=this.edges.length,d=0;d<c;d++)a=this.edges[d],this.isOneAncestorOfOther(a.source,a.target)&&b.push(a);for(var d=0;d<b.length;d++)this.remove(b[d]);return!1},a.exports=f},function(a,b,c){"use strict";var d=c(12);function e(){}e.calcSeparationAmount=function(a,b,c,d){if(!a.intersects(b))throw"assert failed";var e=[,,];this.decideDirectionsForOverlappingNodes(a,b,e),c[0]=Math.min(a.getRight(),b.getRight())-Math.max(a.x,b.x),c[1]=Math.min(a.getBottom(),b.getBottom())-Math.max(a.y,b.y),a.getX()<=b.getX()&&a.getRight()>=b.getRight()?c[0]+=Math.min(b.getX()-a.getX(),a.getRight()-b.getRight()):b.getX()<=a.getX()&&b.getRight()>=a.getRight()&&(c[0]+=Math.min(a.getX()-b.getX(),b.getRight()-a.getRight())),a.getY()<=b.getY()&&a.getBottom()>=b.getBottom()?c[1]+=Math.min(b.getY()-a.getY(),a.getBottom()-b.getBottom()):b.getY()<=a.getY()&&b.getBottom()>=a.getBottom()&&(c[1]+=Math.min(a.getY()-b.getY(),b.getBottom()-a.getBottom()));var f=Math.abs((b.getCenterY()-a.getCenterY())/(b.getCenterX()-a.getCenterX()));b.getCenterY()===a.getCenterY()&&b.getCenterX()===a.getCenterX()&&(f=1);var g=f*c[0],h=c[1]/f;c[0]<h?h=c[0]:g=c[1],c[0]=-1*e[0]*(h/2+d),c[1]=-1*e[1]*(g/2+d)},e.decideDirectionsForOverlappingNodes=function(a,b,c){a.getCenterX()<b.getCenterX()?c[0]=-1:c[0]=1,a.getCenterY()<b.getCenterY()?c[1]=-1:c[1]=1},e.getIntersection2=function(a,b,c){var d=a.getCenterX(),e=a.getCenterY(),f=b.getCenterX(),g=b.getCenterY();if(a.intersects(b))return c[0]=d,c[1]=e,c[2]=f,c[3]=g,!0;var h=a.getX(),i=a.getY(),j=a.getRight(),k=a.getX(),l=a.getBottom(),m=a.getRight(),n=a.getWidthHalf(),o=a.getHeightHalf(),p=b.getX(),q=b.getY(),r=b.getRight(),s=b.getX(),t=b.getBottom(),u=b.getRight(),v=b.getWidthHalf(),w=b.getHeightHalf(),x=!1,y=!1;if(d===f)e>g?(c[0]=d,c[1]=i,c[2]=f,c[3]=t):e<g&&(c[0]=d,c[1]=l,c[2]=f,c[3]=q);else if(e===g)d>f?(c[0]=h,c[1]=e,c[2]=r,c[3]=g):d<f&&(c[0]=j,c[1]=e,c[2]=p,c[3]=g);else{var z=a.height/a.width,A=b.height/b.width,B=(g-e)/(f-d),C=void 0,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0;if(-z===B?(d>f?(c[0]=k,c[1]=l):(c[0]=j,c[1]=i),x=!0):z===B&&(d>f?(c[0]=h,c[1]=i):(c[0]=m,c[1]=l),x=!0),-A===B?(f>d?(c[2]=s,c[3]=t):(c[2]=r,c[3]=q),y=!0):A===B&&(f>d?(c[2]=p,c[3]=q):(c[2]=u,c[3]=t),y=!0),x&&y)return!1;if(d>f?e>g?(C=this.getCardinalDirection(z,B,4),D=this.getCardinalDirection(A,B,2)):(C=this.getCardinalDirection(-z,B,3),D=this.getCardinalDirection(-A,B,1)):e>g?(C=this.getCardinalDirection(-z,B,1),D=this.getCardinalDirection(-A,B,3)):(C=this.getCardinalDirection(z,B,2),D=this.getCardinalDirection(A,B,4)),!x)switch(C){case 1:F=i,E=d+-o/B,c[0]=E,c[1]=F;break;case 2:E=m,F=e+n*B,c[0]=E,c[1]=F;break;case 3:F=l,E=d+o/B,c[0]=E,c[1]=F;break;case 4:E=k,F=e+-n*B,c[0]=E,c[1]=F}if(!y)switch(D){case 1:H=q,G=f+-w/B,c[2]=G,c[3]=H;break;case 2:G=u,H=g+v*B,c[2]=G,c[3]=H;break;case 3:H=t,G=f+w/B,c[2]=G,c[3]=H;break;case 4:G=s,H=g+-v*B,c[2]=G,c[3]=H}}return!1},e.getCardinalDirection=function(a,b,c){return a>b?c:1+c%4},e.getIntersection=function(a,b,c,e){if(null==e)return this.getIntersection2(a,b,c);var f=a.x,g=a.y,h=b.x,i=b.y,j=c.x,k=c.y,l=e.x,m=e.y,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0,t=void 0;return(n=i-g,p=f-h,r=h*g-f*i,o=m-k,q=j-l,s=l*k-j*m,0==(t=n*q-o*p))?null:new d((p*s-q*r)/t,(o*r-n*s)/t)},e.angleOfVector=function(a,b,c,d){var e=void 0;return a!==c?(e=Math.atan((d-b)/(c-a)),c<a?e+=Math.PI:d<b&&(e+=this.TWO_PI)):e=d<b?this.ONE_AND_HALF_PI:this.HALF_PI,e},e.doIntersect=function(a,b,c,d){var e=a.x,f=a.y,g=b.x,h=b.y,i=c.x,j=c.y,k=d.x,l=d.y,m=(g-e)*(l-j)-(k-i)*(h-f);if(0===m)return!1;var n=((l-j)*(k-e)+(i-k)*(l-f))/m,o=((f-h)*(k-e)+(g-e)*(l-f))/m;return 0<n&&n<1&&0<o&&o<1},e.findCircleLineIntersections=function(a,b,c,d,e,f,g){var h=(c-a)*(c-a)+(d-b)*(d-b),i=2*((a-e)*(c-a)+(b-f)*(d-b)),j=(a-e)*(a-e)+(b-f)*(b-f)-g*g;if(!(i*i-4*h*j>=0))return null;var k=(-i+Math.sqrt(i*i-4*h*j))/(2*h),l=(-i-Math.sqrt(i*i-4*h*j))/(2*h);return k>=0&&k<=1?[k]:l>=0&&l<=1?[l]:null},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,a.exports=e},function(a,b,c){"use strict";function d(){}d.sign=function(a){return a>0?1:a<0?-1:0},d.floor=function(a){return a<0?Math.ceil(a):Math.floor(a)},d.ceil=function(a){return a<0?Math.floor(a):Math.ceil(a)},a.exports=d},function(a,b,c){"use strict";function d(){}d.MAX_VALUE=0x7fffffff,d.MIN_VALUE=-0x80000000,a.exports=d},function(a,b,c){"use strict";var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=function(a){return{value:a,next:null,prev:null}},f=function(a,b,c,d){return null!==a?a.next=b:d.head=b,null!==c?c.prev=b:d.tail=b,b.prev=a,b.next=c,d.length++,b},g=function(a,b){var c=a.prev,d=a.next;return null!==c?c.next=d:b.head=d,null!==d?d.prev=c:b.tail=c,a.prev=a.next=null,b.length--,a};a.exports=function(){function a(b){var c=this;if(!(this instanceof a))throw TypeError("Cannot call a class as a function");this.length=0,this.head=null,this.tail=null,null!=b&&b.forEach(function(a){return c.push(a)})}return d(a,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(a,b){return f(b.prev,e(a),b,this)}},{key:"insertAfter",value:function(a,b){return f(b,e(a),b.next,this)}},{key:"insertNodeBefore",value:function(a,b){return f(b.prev,a,b,this)}},{key:"insertNodeAfter",value:function(a,b){return f(b,a,b.next,this)}},{key:"push",value:function(a){return f(this.tail,e(a),null,this)}},{key:"unshift",value:function(a){return f(null,e(a),this.head,this)}},{key:"remove",value:function(a){return g(a,this)}},{key:"pop",value:function(){return g(this.tail,this).value}},{key:"popNode",value:function(){return g(this.tail,this)}},{key:"shift",value:function(){return g(this.head,this).value}},{key:"shiftNode",value:function(){return g(this.head,this)}},{key:"get_object_at",value:function(a){if(a<=this.length()){for(var b=1,c=this.head;b<a;)c=c.next,b++;return c.value}}},{key:"set_object_at",value:function(a,b){if(a<=this.length()){for(var c=1,d=this.head;c<a;)d=d.next,c++;d.value=b}}}]),a}()},function(a,b,c){"use strict";function d(a,b,c){this.x=null,this.y=null,null==a&&null==b&&null==c?(this.x=0,this.y=0):"number"==typeof a&&"number"==typeof b&&null==c?(this.x=a,this.y=b):"Point"==a.constructor.name&&null==b&&null==c&&(c=a,this.x=c.x,this.y=c.y)}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.getLocation=function(){return new d(this.x,this.y)},d.prototype.setLocation=function(a,b,c){"Point"==a.constructor.name&&null==b&&null==c?(c=a,this.setLocation(c.x,c.y)):"number"==typeof a&&"number"==typeof b&&null==c&&(parseInt(a)==a&&parseInt(b)==b?this.move(a,b):(this.x=Math.floor(a+.5),this.y=Math.floor(b+.5)))},d.prototype.move=function(a,b){this.x=a,this.y=b},d.prototype.translate=function(a,b){this.x+=a,this.y+=b},d.prototype.equals=function(a){return"Point"==a.constructor.name?this.x==a.x&&this.y==a.y:this==a},d.prototype.toString=function(){return new d().constructor.name+"[x="+this.x+",y="+this.y+"]"},a.exports=d},function(a,b,c){"use strict";function d(a,b,c,d){this.x=0,this.y=0,this.width=0,this.height=0,null!=a&&null!=b&&null!=c&&null!=d&&(this.x=a,this.y=b,this.width=c,this.height=d)}d.prototype.getX=function(){return this.x},d.prototype.setX=function(a){this.x=a},d.prototype.getY=function(){return this.y},d.prototype.setY=function(a){this.y=a},d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(a){this.width=a},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(a){this.height=a},d.prototype.getRight=function(){return this.x+this.width},d.prototype.getBottom=function(){return this.y+this.height},d.prototype.intersects=function(a){return!(this.getRight()<a.x||this.getBottom()<a.y||a.getRight()<this.x||a.getBottom()<this.y)},d.prototype.getCenterX=function(){return this.x+this.width/2},d.prototype.getMinX=function(){return this.getX()},d.prototype.getMaxX=function(){return this.getX()+this.width},d.prototype.getCenterY=function(){return this.y+this.height/2},d.prototype.getMinY=function(){return this.getY()},d.prototype.getMaxY=function(){return this.getY()+this.height},d.prototype.getWidthHalf=function(){return this.width/2},d.prototype.getHeightHalf=function(){return this.height/2},a.exports=d},function(a,b,c){"use strict";var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function e(){}e.lastID=0,e.createID=function(a){return e.isPrimitive(a)?a:(null!=a.uniqueID||(a.uniqueID=e.getString(),e.lastID++),a.uniqueID)},e.getString=function(a){return null==a&&(a=e.lastID),"Object#"+a},e.isPrimitive=function(a){var b=void 0===a?"undefined":d(a);return null==a||"object"!=b&&"function"!=b},a.exports=e},function(a,b,c){"use strict";function d(a){if(!Array.isArray(a))return Array.from(a);for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}var e=c(0),f=c(7),g=c(3),h=c(1),i=c(6),j=c(5),k=c(17),l=c(29);function m(a){l.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new f(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=a&&(this.isRemoteUse=a)}m.RANDOM_SEED=1,m.prototype=Object.create(l.prototype),m.prototype.getGraphManager=function(){return this.graphManager},m.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},m.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},m.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},m.prototype.newGraphManager=function(){var a=new f(this);return this.graphManager=a,a},m.prototype.newGraph=function(a){return new i(null,this.graphManager,a)},m.prototype.newNode=function(a){return new g(this.graphManager,a)},m.prototype.newEdge=function(a){return new h(null,null,a)},m.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},m.prototype.runLayout=function(){var a;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),a=!this.checkLayoutSuccess()&&this.layout(),"during"!==e.ANIMATE&&(a&&!this.isSubLayout&&this.doPostLayout(),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,a)},m.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},m.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var a=this.graphManager.getAllEdges(),b=0;b<a.length;b++)a[b];for(var c=this.graphManager.getRoot().getNodes(),b=0;b<c.length;b++)c[b];this.update(this.graphManager.getRoot())}},m.prototype.update=function(a){if(null==a)this.update2();else if(a instanceof g){if(null!=a.getChild())for(var b=a.getChild().getNodes(),c=0;c<b.length;c++)update(b[c]);null!=a.vGraphObject&&a.vGraphObject.update(a)}else a instanceof h?null!=a.vGraphObject&&a.vGraphObject.update(a):a instanceof i&&null!=a.vGraphObject&&a.vGraphObject.update(a)},m.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},m.prototype.transform=function(a){if(void 0==a)this.transform(new j(0,0));else{var b=new k,c=this.graphManager.getRoot().updateLeftTop();if(null!=c){b.setWorldOrgX(a.x),b.setWorldOrgY(a.y),b.setDeviceOrgX(c.x),b.setDeviceOrgY(c.y);for(var d=this.getAllNodes(),e=0;e<d.length;e++)d[e].transform(b)}}},m.prototype.positionNodesRandomly=function(a){if(void 0==a)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var b,c,d=a.getNodes(),e=0;e<d.length;e++)null==(c=(b=d[e]).getChild())||0==c.getNodes().length?b.scatter():(this.positionNodesRandomly(c),b.updateBounds())},m.prototype.getFlatForest=function(){for(var a=[],b=!0,c=this.graphManager.getRoot().getNodes(),e=!0,f=0;f<c.length;f++)null!=c[f].getChild()&&(e=!1);if(!e)return a;var g=new Set,h=[],i=new Map,j=[];for(j=j.concat(c);j.length>0&&b;){for(h.push(j[0]);h.length>0&&b;){var k=h[0];h.splice(0,1),g.add(k);for(var l=k.getEdges(),f=0;f<l.length;f++){var m=l[f].getOtherEnd(k);if(i.get(k)!=m)if(g.has(m)){b=!1;break}else h.push(m),i.set(m,k)}}if(b){var n=[].concat(d(g));a.push(n);for(var f=0;f<n.length;f++){var o=n[f],p=j.indexOf(o);p>-1&&j.splice(p,1)}g=new Set,i=new Map}else a=[]}return a},m.prototype.createDummyNodesForBendpoints=function(a){for(var b=[],c=a.source,d=this.graphManager.calcLowestCommonAncestor(a.source,a.target),e=0;e<a.bendpoints.length;e++){var f=this.newNode(null);f.setRect(new Point(0,0),new Dimension(1,1)),d.add(f);var g=this.newEdge(null);this.graphManager.add(g,c,f),b.add(f),c=f}var g=this.newEdge(null);return this.graphManager.add(g,c,a.target),this.edgeToDummyNodes.set(a,b),a.isInterGraph()?this.graphManager.remove(a):d.remove(a),b},m.prototype.createBendpointsFromDummyNodes=function(){var a=[];a=a.concat(this.graphManager.getAllEdges()),a=[].concat(d(this.edgeToDummyNodes.keys())).concat(a);for(var b=0;b<a.length;b++){var c=a[b];if(c.bendpoints.length>0){for(var e=this.edgeToDummyNodes.get(c),f=0;f<e.length;f++){var g=e[f],h=new j(g.getCenterX(),g.getCenterY()),i=c.bendpoints.get(f);i.x=h.x,i.y=h.y,g.getOwner().remove(g)}this.graphManager.add(c,c.source,c.target)}}},m.transform=function(a,b,c,d){if(void 0==c||void 0==d)return a<=50?(e=9*b/500,f=b/10):(e=9*b/50,f=-8*b),e*a+f;var e,f,g=b;return a<=50?g-=(b-b/c)/50*(50-a):g+=(b*d-b)/50*(a-50),g},m.findCenterOfTree=function(a){var b=[];b=b.concat(a);var c=[],d=new Map,e=!1,f=null;(1==b.length||2==b.length)&&(e=!0,f=b[0]);for(var g=0;g<b.length;g++){var h=b[g],i=h.getNeighborsList().size;d.set(h,h.getNeighborsList().size),1==i&&c.push(h)}var j=[];for(j=j.concat(c);!e;){var k=[];k=k.concat(j),j=[];for(var g=0;g<b.length;g++){var h=b[g],l=b.indexOf(h);l>=0&&b.splice(l,1),h.getNeighborsList().forEach(function(a){if(0>c.indexOf(a)){var b=d.get(a)-1;1==b&&j.push(a),d.set(a,b)}})}c=c.concat(j),(1==b.length||2==b.length)&&(e=!0,f=b[0])}return f},m.prototype.setGraphManager=function(a){this.graphManager=a},a.exports=m},function(a,b,c){"use strict";function d(){}d.seed=1,d.x=0,d.nextDouble=function(){return d.x=1e4*Math.sin(d.seed++),d.x-Math.floor(d.x)},a.exports=d},function(a,b,c){"use strict";var d=c(5);function e(a,b){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(a){this.lworldExtX=a},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(a){this.lworldExtY=a},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},e.prototype.transformX=function(a){var b=0,c=this.lworldExtX;return 0!=c&&(b=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/c),b},e.prototype.transformY=function(a){var b=0,c=this.lworldExtY;return 0!=c&&(b=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/c),b},e.prototype.inverseTransformX=function(a){var b=0,c=this.ldeviceExtX;return 0!=c&&(b=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/c),b},e.prototype.inverseTransformY=function(a){var b=0,c=this.ldeviceExtY;return 0!=c&&(b=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/c),b},e.prototype.inverseTransformPoint=function(a){return new d(this.inverseTransformX(a.x),this.inverseTransformY(a.y))},a.exports=e},function(a,b,c){"use strict";var d=c(15),e=c(4),f=c(0),g=c(8),h=c(9);function i(){d.call(this),this.useSmartIdealEdgeLengthCalculation=e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=e.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=e.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=e.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*e.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=e.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=e.MAX_ITERATIONS}for(var j in i.prototype=Object.create(d.prototype),d)i[j]=d[j];i.prototype.initParameters=function(){d.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},i.prototype.calcIdealEdgeLengths=function(){for(var a,b,c,d,g,h,i,j=this.getGraphManager().getAllEdges(),k=0;k<j.length;k++)b=(a=j[k]).idealLength,a.isInterGraph&&(d=a.getSource(),g=a.getTarget(),h=a.getSourceInLca().getEstimatedSize(),i=a.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(a.idealLength+=h+i-2*f.SIMPLE_NODE_SIZE),c=a.getLca().getInclusionTreeDepth(),a.idealLength+=b*e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+g.getInclusionTreeDepth()-2*c))},i.prototype.initSpringEmbedder=function(){var a=this.getAllNodes().length;this.incremental?(a>e.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*e.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(a-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-e.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT_INCREMENTAL):(a>e.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(e.COOLING_ADAPTATION_FACTOR,1-(a-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*(1-e.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*e.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},i.prototype.calcSpringForces=function(){for(var a,b=this.getAllEdges(),c=0;c<b.length;c++)a=b[c],this.calcSpringForce(a,a.idealLength)},i.prototype.calcRepulsionForces=function(){var a,b,c,d,f,g=!(arguments.length>0)||void 0===arguments[0]||arguments[0],h=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&g&&this.updateGrid(),f=new Set,a=0;a<i.length;a++)c=i[a],this.calculateRepulsionForceOfANode(c,f,g,h),f.add(c);else for(a=0;a<i.length;a++)for(c=i[a],b=a+1;b<i.length;b++)d=i[b],c.getOwner()==d.getOwner()&&this.calcRepulsionForce(c,d)},i.prototype.calcGravitationalForces=function(){for(var a,b=this.getAllNodesToApplyGravitation(),c=0;c<b.length;c++)a=b[c],this.calcGravitationalForce(a)},i.prototype.moveNodes=function(){for(var a=this.getAllNodes(),b=0;b<a.length;b++)a[b].move()},i.prototype.calcSpringForce=function(a,b){var c,d,e,f,g=a.getSource(),h=a.getTarget();if(this.uniformLeafNodeSizes&&null==g.getChild()&&null==h.getChild())a.updateLengthSimple();else if(a.updateLength(),a.isOverlapingSourceAndTarget)return;0!=(c=a.getLength())&&(e=(d=a.edgeElasticity*(c-b))*(a.lengthX/c),f=d*(a.lengthY/c),g.springForceX+=e,g.springForceY+=f,h.springForceX-=e,h.springForceY-=f)},i.prototype.calcRepulsionForce=function(a,b){var c,d,f,i,j,k,l,m=a.getRect(),n=b.getRect(),o=[,,],p=[,,,,];if(m.intersects(n)){g.calcSeparationAmount(m,n,o,e.DEFAULT_EDGE_LENGTH/2),k=2*o[0],l=2*o[1];var q=a.noOfChildren*b.noOfChildren/(a.noOfChildren+b.noOfChildren);a.repulsionForceX-=q*k,a.repulsionForceY-=q*l,b.repulsionForceX+=q*k,b.repulsionForceY+=q*l}else this.uniformLeafNodeSizes&&null==a.getChild()&&null==b.getChild()?(c=n.getCenterX()-m.getCenterX(),d=n.getCenterY()-m.getCenterY()):(g.getIntersection(m,n,p),c=p[2]-p[0],d=p[3]-p[1]),Math.abs(c)<e.MIN_REPULSION_DIST&&(c=h.sign(c)*e.MIN_REPULSION_DIST),Math.abs(d)<e.MIN_REPULSION_DIST&&(d=h.sign(d)*e.MIN_REPULSION_DIST),i=Math.sqrt(f=c*c+d*d),k=(j=(a.nodeRepulsion/2+b.nodeRepulsion/2)*a.noOfChildren*b.noOfChildren/f)*c/i,l=j*d/i,a.repulsionForceX-=k,a.repulsionForceY-=l,b.repulsionForceX+=k,b.repulsionForceY+=l},i.prototype.calcGravitationalForce=function(a){var b,c,d,e,f,g,h,i;c=((b=a.getOwner()).getRight()+b.getLeft())/2,d=(b.getTop()+b.getBottom())/2,e=a.getCenterX()-c,f=a.getCenterY()-d,g=Math.abs(e)+a.getWidth()/2,h=Math.abs(f)+a.getHeight()/2,a.getOwner()==this.graphManager.getRoot()?(g>(i=b.getEstimatedSize()*this.gravityRangeFactor)||h>i)&&(a.gravitationForceX=-this.gravityConstant*e,a.gravitationForceY=-this.gravityConstant*f):(g>(i=b.getEstimatedSize()*this.compoundGravityRangeFactor)||h>i)&&(a.gravitationForceX=-this.gravityConstant*e*this.compoundGravityConstant,a.gravitationForceY=-this.gravityConstant*f*this.compoundGravityConstant)},i.prototype.isConverged=function(){var a,b=!1;return this.totalIterations>this.maxIterations/3&&(b=2>Math.abs(this.totalDisplacement-this.oldTotalDisplacement)),a=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,a||b},i.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},i.prototype.calcNoOfChildrenForAllNodes=function(){for(var a,b=this.graphManager.getAllNodes(),c=0;c<b.length;c++)(a=b[c]).noOfChildren=a.getNoOfChildren()},i.prototype.calcGrid=function(a){var b=0,c=0;b=parseInt(Math.ceil((a.getRight()-a.getLeft())/this.repulsionRange)),c=parseInt(Math.ceil((a.getBottom()-a.getTop())/this.repulsionRange));for(var d=Array(b),e=0;e<b;e++)d[e]=Array(c);for(var e=0;e<b;e++)for(var f=0;f<c;f++)d[e][f]=[];return d},i.prototype.addNodeToGrid=function(a,b,c){var d=0,e=0,f=0,g=0;d=parseInt(Math.floor((a.getRect().x-b)/this.repulsionRange)),e=parseInt(Math.floor((a.getRect().width+a.getRect().x-b)/this.repulsionRange)),f=parseInt(Math.floor((a.getRect().y-c)/this.repulsionRange)),g=parseInt(Math.floor((a.getRect().height+a.getRect().y-c)/this.repulsionRange));for(var h=d;h<=e;h++)for(var i=f;i<=g;i++)this.grid[h][i].push(a),a.setGridCoordinates(d,e,f,g)},i.prototype.updateGrid=function(){var a,b,c=this.getAllNodes();for(a=0,this.grid=this.calcGrid(this.graphManager.getRoot());a<c.length;a++)b=c[a],this.addNodeToGrid(b,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},i.prototype.calculateRepulsionForceOfANode=function(a,b,c,d){if(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&c||d){var f,g=new Set;a.surrounding=[];for(var h=this.grid,i=a.startX-1;i<a.finishX+2;i++)for(var j=a.startY-1;j<a.finishY+2;j++)if(!(i<0||j<0||i>=h.length||j>=h[0].length)){for(var k=0;k<h[i][j].length;k++)if(f=h[i][j][k],a.getOwner()==f.getOwner()&&a!=f&&!b.has(f)&&!g.has(f)){var l=Math.abs(a.getCenterX()-f.getCenterX())-(a.getWidth()/2+f.getWidth()/2),m=Math.abs(a.getCenterY()-f.getCenterY())-(a.getHeight()/2+f.getHeight()/2);l<=this.repulsionRange&&m<=this.repulsionRange&&g.add(f)}}a.surrounding=[].concat(function(a){if(!Array.isArray(a))return Array.from(a);for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}(g))}for(i=0;i<a.surrounding.length;i++)this.calcRepulsionForce(a,a.surrounding[i])},i.prototype.calcRepulsionRange=function(){return 0},a.exports=i},function(a,b,c){"use strict";var d=c(1),e=c(4);function f(a,b,c){d.call(this,a,b,c),this.idealLength=e.DEFAULT_EDGE_LENGTH,this.edgeElasticity=e.DEFAULT_SPRING_STRENGTH}for(var g in f.prototype=Object.create(d.prototype),d)f[g]=d[g];a.exports=f},function(a,b,c){"use strict";var d=c(3),e=c(4);function f(a,b,c,f){d.call(this,a,b,c,f),this.nodeRepulsion=e.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=[]}for(var g in f.prototype=Object.create(d.prototype),d)f[g]=d[g];f.prototype.setGridCoordinates=function(a,b,c,d){this.startX=a,this.finishX=b,this.startY=c,this.finishY=d},a.exports=f},function(a,b,c){"use strict";function d(a,b){this.width=0,this.height=0,null!==a&&null!==b&&(this.height=b,this.width=a)}d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(a){this.width=a},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(a){this.height=a},a.exports=d},function(a,b,c){"use strict";var d=c(14);function e(){this.map={},this.keys=[]}e.prototype.put=function(a,b){var c=d.createID(a);this.contains(c)||(this.map[c]=b,this.keys.push(a))},e.prototype.contains=function(a){return d.createID(a),null!=this.map[a]},e.prototype.get=function(a){var b=d.createID(a);return this.map[b]},e.prototype.keySet=function(){return this.keys},a.exports=e},function(a,b,c){"use strict";var d=c(14);function e(){this.set={}}e.prototype.add=function(a){var b=d.createID(a);this.contains(b)||(this.set[b]=a)},e.prototype.remove=function(a){delete this.set[d.createID(a)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(a){return this.set[d.createID(a)]==a},e.prototype.isEmpty=function(){return 0===this.size()},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(a){for(var b=Object.keys(this.set),c=b.length,d=0;d<c;d++)a.push(this.set[b[d]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(a){for(var b=a.length,c=0;c<b;c++){var d=a[c];this.add(d)}},a.exports=e},function(a,b,c){"use strict";function d(){}d.multMat=function(a,b){for(var c=[],d=0;d<a.length;d++){c[d]=[];for(var e=0;e<b[0].length;e++){c[d][e]=0;for(var f=0;f<a[0].length;f++)c[d][e]+=a[d][f]*b[f][e]}}return c},d.transpose=function(a){for(var b=[],c=0;c<a[0].length;c++){b[c]=[];for(var d=0;d<a.length;d++)b[c][d]=a[d][c]}return b},d.multCons=function(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=a[d]*b;return c},d.minusOp=function(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=a[d]-b[d];return c},d.dotProduct=function(a,b){for(var c=0,d=0;d<a.length;d++)c+=a[d]*b[d];return c},d.mag=function(a){return Math.sqrt(this.dotProduct(a,a))},d.normalize=function(a){for(var b=[],c=this.mag(a),d=0;d<a.length;d++)b[d]=a[d]/c;return b},d.multGamma=function(a){for(var b=[],c=0,d=0;d<a.length;d++)c+=a[d];c*=-1/a.length;for(var e=0;e<a.length;e++)b[e]=c+a[e];return b},d.multL=function(a,b,c){for(var d=[],e=[],f=[],g=0;g<b[0].length;g++){for(var h=0,i=0;i<b.length;i++)h+=-.5*b[i][g]*a[i];e[g]=h}for(var j=0;j<c.length;j++){for(var k=0,l=0;l<c.length;l++)k+=c[j][l]*e[l];f[j]=k}for(var m=0;m<b.length;m++){for(var n=0,o=0;o<b[0].length;o++)n+=b[m][o]*f[o];d[m]=n}return d},a.exports=d},function(a,b,c){"use strict";var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=c(11);a.exports=function(){function a(b,c){if(!(this instanceof a))throw TypeError("Cannot call a class as a function");(null!==c||void 0!==c)&&(this.compareFunction=this._defaultCompareFunction);var d=void 0;d=b instanceof e?b.size():b.length,this._quicksort(b,0,d-1)}return d(a,[{key:"_quicksort",value:function(a,b,c){if(b<c){var d=this._partition(a,b,c);this._quicksort(a,b,d),this._quicksort(a,d+1,c)}}},{key:"_partition",value:function(a,b,c){for(var d=this._get(a,b),e=b,f=c;;){for(;this.compareFunction(d,this._get(a,f));)f--;for(;this.compareFunction(this._get(a,e),d);)e++;if(!(e<f))return f;this._swap(a,e,f),e++,f--}}},{key:"_get",value:function(a,b){return a instanceof e?a.get_object_at(b):a[b]}},{key:"_set",value:function(a,b,c){a instanceof e?a.set_object_at(b,c):a[b]=c}},{key:"_swap",value:function(a,b,c){var d=this._get(a,b);this._set(a,b,this._get(a,c)),this._set(a,c,d)}},{key:"_defaultCompareFunction",value:function(a,b){return b>a}}]),a}()},function(a,b,c){"use strict";function d(){}d.svd=function(a){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=a.length,this.n=a[0].length;var b=Math.min(this.m,this.n);this.s=function(a){for(var b=[];a-- >0;)b.push(0);return b}(Math.min(this.m+1,this.n)),this.U=function a(b){if(0==b.length)return 0;for(var c=[],d=0;d<b[0];d++)c.push(a(b.slice(1)));return c}([this.m,b]),this.V=function a(b){if(0==b.length)return 0;for(var c=[],d=0;d<b[0];d++)c.push(a(b.slice(1)));return c}([this.n,this.n]);for(var c=function(a){for(var b=[];a-- >0;)b.push(0);return b}(this.n),e=function(a){for(var b=[];a-- >0;)b.push(0);return b}(this.m),f=Math.min(this.m-1,this.n),g=Math.max(0,Math.min(this.n-2,this.m)),h=0;h<Math.max(f,g);h++){if(h<f){this.s[h]=0;for(var i=h;i<this.m;i++)this.s[h]=d.hypot(this.s[h],a[i][h]);if(0!==this.s[h]){a[h][h]<0&&(this.s[h]=-this.s[h]);for(var j=h;j<this.m;j++)a[j][h]/=this.s[h];a[h][h]+=1}this.s[h]=-this.s[h]}for(var k=h+1;k<this.n;k++){if(p=h<f,q=0!==this.s[h],p&&q){for(var l=0,m=h;m<this.m;m++)l+=a[m][h]*a[m][k];l=-l/a[h][h];for(var n=h;