cc-viewer 1.6.199 → 1.6.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/App-B0Cfe4hA.js +1 -0
- package/dist/assets/{App-fG2r3jFq.css → App-DOYmReD4.css} +1 -1
- package/dist/assets/{AppHeader-pu5K74SB.css → AppHeader-auOOOaQm.css} +2 -2
- package/dist/assets/AppHeader.module-CDgQaFoO.js +2 -0
- package/dist/assets/{Mobile-DnvC6H2O.js → Mobile-CsKFJYE2.js} +1 -1
- package/dist/assets/{_baseUniq-Cnd-_Qe2.js → _baseUniq-C73FOqig.js} +1 -1
- package/dist/assets/{arc-CPVCmYmr.js → arc-DAWkd4Du.js} +1 -1
- package/dist/assets/{architectureDiagram-Q4EWVU46-CTmPWolC.js → architectureDiagram-Q4EWVU46-CXA8GRiC.js} +1 -1
- package/dist/assets/{blockDiagram-DXYQGD6D-BYUa2ljj.js → blockDiagram-DXYQGD6D-BH7SCCtR.js} +1 -1
- package/dist/assets/{c4Diagram-AHTNJAMY-BBfrYhDN.js → c4Diagram-AHTNJAMY-DjidAThD.js} +1 -1
- package/dist/assets/{channel-D1pwh2Yq.js → channel-fMMU54GK.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-DYCV-6PI.js → chunk-4BX2VUAB-C7VtouVc.js} +1 -1
- package/dist/assets/{chunk-4TB4RGXK-DZWVouv1.js → chunk-4TB4RGXK-E8ZyU2MN.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-BnetqbRo.js → chunk-55IACEB6-kKpXz88M.js} +1 -1
- package/dist/assets/{chunk-EDXVE4YY-CL4WCxSM.js → chunk-EDXVE4YY-DGxEwZ4m.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-DLmQmJbs.js → chunk-FMBD7UC4-CD8bIwZQ.js} +1 -1
- package/dist/assets/{chunk-OYMX7WX6-B7jkMtrd.js → chunk-OYMX7WX6-gYD4Acaz.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-tscrjv7L.js → chunk-QZHKN3VN-BjwG7rZm.js} +1 -1
- package/dist/assets/{chunk-YZCP3GAM-BreqZYYH.js → chunk-YZCP3GAM-QsYUvoBQ.js} +1 -1
- package/dist/assets/classDiagram-6PBFFD2Q-BIdWZE2B.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-BIdWZE2B.js +1 -0
- package/dist/assets/clone-DUPgDT2x.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-BqETFkWe.js → cose-bilkent-S5V4N54A-9ctKMOYC.js} +1 -1
- package/dist/assets/{dagre-KV5264BT-C1fQhqsm.js → dagre-KV5264BT-By2HwLaW.js} +1 -1
- package/dist/assets/{diagram-5BDNPKRD-BQ_AArZ4.js → diagram-5BDNPKRD-BpgOHENA.js} +1 -1
- package/dist/assets/{diagram-G4DWMVQ6-ETR1atoi.js → diagram-G4DWMVQ6-B2x2muJb.js} +1 -1
- package/dist/assets/{diagram-MMDJMWI5-BS5YlnF7.js → diagram-MMDJMWI5-un9PMQTJ.js} +1 -1
- package/dist/assets/{diagram-TYMM5635-DgEDTcSl.js → diagram-TYMM5635-CoSUmrbF.js} +1 -1
- package/dist/assets/{erDiagram-SMLLAGMA-BfJzSJyz.js → erDiagram-SMLLAGMA-D9ycUUrR.js} +1 -1
- package/dist/assets/{flowDiagram-DWJPFMVM-CmZyhVxI.js → flowDiagram-DWJPFMVM-CMwSrS0j.js} +1 -1
- package/dist/assets/{ganttDiagram-T4ZO3ILL-CyCgF8EH.js → ganttDiagram-T4ZO3ILL-dNzPWJ2v.js} +1 -1
- package/dist/assets/{gitGraphDiagram-UUTBAWPF-Ch_lyUYI.js → gitGraphDiagram-UUTBAWPF-5jScxIeV.js} +1 -1
- package/dist/assets/{graph-DONA5GRX.js → graph-CSAV79cR.js} +1 -1
- package/dist/assets/{index-CP_dJQHF.js → index-BnE1kmli.js} +2 -2
- package/dist/assets/{infoDiagram-42DDH7IO-sWbLdJMA.js → infoDiagram-42DDH7IO-BBwe5zCb.js} +1 -1
- package/dist/assets/{ishikawaDiagram-UXIWVN3A-B1-Sul49.js → ishikawaDiagram-UXIWVN3A-DxpzhU4G.js} +1 -1
- package/dist/assets/{journeyDiagram-VCZTEJTY-B2GzVR2v.js → journeyDiagram-VCZTEJTY-BiLOryhx.js} +1 -1
- package/dist/assets/{kanban-definition-6JOO6SKY-BQ369gG9.js → kanban-definition-6JOO6SKY-BwMtkCnE.js} +1 -1
- package/dist/assets/{layout-Dg4txuWO.js → layout-DEZivYZo.js} +1 -1
- package/dist/assets/{linear-CB6_fADN.js → linear-8H25OaNu.js} +1 -1
- package/dist/assets/{mermaid.core-fx56L749.js → mermaid.core-O3WUNQR6.js} +2 -2
- package/dist/assets/{min-Cfm_qmEy.js → min-BDNYdllt.js} +1 -1
- package/dist/assets/{mindmap-definition-QFDTVHPH-CucfYr3R.js → mindmap-definition-QFDTVHPH-DLa1a2PT.js} +1 -1
- package/dist/assets/{pieDiagram-DEJITSTG-B1JuDmET.js → pieDiagram-DEJITSTG-C7a0wkId.js} +1 -1
- package/dist/assets/{quadrantDiagram-34T5L4WZ-D45nu4Jo.js → quadrantDiagram-34T5L4WZ-qaO4n-DR.js} +1 -1
- package/dist/assets/{requirementDiagram-MS252O5E-C4MR71jH.js → requirementDiagram-MS252O5E-B5elAix1.js} +1 -1
- package/dist/assets/{sankeyDiagram-XADWPNL6-BjN93eui.js → sankeyDiagram-XADWPNL6-BxAAO2OT.js} +1 -1
- package/dist/assets/{sequenceDiagram-FGHM5R23-DfNydjTE.js → sequenceDiagram-FGHM5R23-D4epWe89.js} +1 -1
- package/dist/assets/{stateDiagram-FHFEXIEX-Cth1bRU5.js → stateDiagram-FHFEXIEX-DgLET5fE.js} +1 -1
- package/dist/assets/{stateDiagram-v2-QKLJ7IA2-DRKS8TSe.js → stateDiagram-v2-QKLJ7IA2-Ci28Wp9J.js} +1 -1
- package/dist/assets/{timeline-definition-GMOUNBTQ-CGI0k2Go.js → timeline-definition-GMOUNBTQ-8JmSnBLT.js} +1 -1
- package/dist/assets/{vennDiagram-DHZGUBPP-C1-dVDob.js → vennDiagram-DHZGUBPP-DYVoEvAU.js} +1 -1
- package/dist/assets/{wardley-RL74JXVD-Cw6grnZ8.js → wardley-RL74JXVD-DS_huD5U.js} +1 -1
- package/dist/assets/{wardleyDiagram-NUSXRM2D-Dz6uGDTV.js → wardleyDiagram-NUSXRM2D-BldFmHzV.js} +1 -1
- package/dist/assets/{xychartDiagram-5P7HB3ND-B_Pl_Y8E.js → xychartDiagram-5P7HB3ND-DS97a-id.js} +1 -1
- package/dist/index.html +1 -1
- package/interceptor.js +141 -10
- package/package.json +1 -1
- package/proxy.js +8 -0
- package/server.js +20 -7
- package/dist/assets/App-P57OfZoY.js +0 -1
- package/dist/assets/AppHeader.module-BaWqwKOb.js +0 -2
- package/dist/assets/classDiagram-6PBFFD2Q-DNn_1CVl.js +0 -1
- package/dist/assets/classDiagram-v2-HSJHXN6E-DNn_1CVl.js +0 -1
- package/dist/assets/clone-6rNpdByw.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var _a;import{_ as __name,H as selectSvgElement,X as setupGraphViewbox,l as log,b as setAccTitle,a as getAccTitle,p as setDiagramTitle,q as getDiagramTitle,g as getAccDescription,s as setAccDescription,y as clear,E as cleanAndMerge,F as defaultConfig_default,C as getConfig,c as getConfig2,aj as createText,aI as getIconSVG,i as sanitizeText,d as select,x as getEdgeId,aJ as registerIconPacks,aK as unknownIcon}from"./mermaid.core-fx56L749.js";import{p as populateCommonDb}from"./chunk-4BX2VUAB-DYCV-6PI.js";import{p as parse}from"./wardley-RL74JXVD-Cw6grnZ8.js";import{c as cytoscape$1}from"./cytoscape.esm-CT1mZavR.js";import{g as getDefaultExportFromCjs}from"./vendor-antd-CAmbzFZk.js";import"./index-CP_dJQHF.js";import"./vendor-codemirror-BiCbU51m.js";import"./vendor-markdown-Bpu4AByL.js";import"./min-Cfm_qmEy.js";import"./_baseUniq-Cnd-_Qe2.js";var hasRequiredLayoutBase,cytoscapeFcose$1={exports:{}},coseBase$1={exports:{}},layoutBase$1={exports:{}};function requireLayoutBase(){return hasRequiredLayoutBase?layoutBase$1.exports:(hasRequiredLayoutBase=1,factory=function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module2=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module2.exports,module2,module2.exports,__webpack_require__),module2.l=!0,module2.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports$12,name,getter){__webpack_require__.o(exports$12,name)||Object.defineProperty(exports$12,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module2){var getter=module2&&module2.__esModule?function(){return module2.default}:function(){return module2};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=28)}([function(module2,exports$12,__webpack_require__){function LayoutConstants(){}LayoutConstants.QUALITY=1,LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,LayoutConstants.DEFAULT_INCREMENTAL=!1,LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT=!0,LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT=!1,LayoutConstants.DEFAULT_ANIMATION_PERIOD=50,LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,LayoutConstants.DEFAULT_GRAPH_MARGIN=15,LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS=!1,LayoutConstants.SIMPLE_NODE_SIZE=40,LayoutConstants.SIMPLE_NODE_HALF_SIZE=LayoutConstants.SIMPLE_NODE_SIZE/2,LayoutConstants.EMPTY_COMPOUND_NODE_SIZE=40,LayoutConstants.MIN_EDGE_LENGTH=1,LayoutConstants.WORLD_BOUNDARY=1e6,LayoutConstants.INITIAL_WORLD_BOUNDARY=LayoutConstants.WORLD_BOUNDARY/1e3,LayoutConstants.WORLD_CENTER_X=1200,LayoutConstants.WORLD_CENTER_Y=900,module2.exports=LayoutConstants},function(module2,exports$12,__webpack_require__){var LGraphObject=__webpack_require__(2),IGeometry=__webpack_require__(8),IMath=__webpack_require__(9);function LEdge(source,target,vEdge){LGraphObject.call(this,vEdge),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=vEdge,this.bendpoints=[],this.source=source,this.target=target}for(var prop in LEdge.prototype=Object.create(LGraphObject.prototype),LGraphObject)LEdge[prop]=LGraphObject[prop];LEdge.prototype.getSource=function(){return this.source},LEdge.prototype.getTarget=function(){return this.target},LEdge.prototype.isInterGraph=function(){return this.isInterGraph},LEdge.prototype.getLength=function(){return this.length},LEdge.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},LEdge.prototype.getBendpoints=function(){return this.bendpoints},LEdge.prototype.getLca=function(){return this.lca},LEdge.prototype.getSourceInLca=function(){return this.sourceInLca},LEdge.prototype.getTargetInLca=function(){return this.targetInLca},LEdge.prototype.getOtherEnd=function(node){if(this.source===node)return this.target;if(this.target===node)return this.source;throw"Node is not incident with this edge"},LEdge.prototype.getOtherEndInGraph=function(node,graph){for(var otherEnd=this.getOtherEnd(node),root=graph.getGraphManager().getRoot();;){if(otherEnd.getOwner()==graph)return otherEnd;if(otherEnd.getOwner()==root)break;otherEnd=otherEnd.getOwner().getParent()}return null},LEdge.prototype.updateLength=function(){var clipPointCoordinates=new Array(4);this.isOverlapingSourceAndTarget=IGeometry.getIntersection(this.target.getRect(),this.source.getRect(),clipPointCoordinates),this.isOverlapingSourceAndTarget||(this.lengthX=clipPointCoordinates[0]-clipPointCoordinates[2],this.lengthY=clipPointCoordinates[1]-clipPointCoordinates[3],Math.abs(this.lengthX)<1&&(this.lengthX=IMath.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=IMath.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},LEdge.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=IMath.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=IMath.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},module2.exports=LEdge},function(module2,exports$12,__webpack_require__){module2.exports=function(vGraphObject){this.vGraphObject=vGraphObject}},function(module2,exports$12,__webpack_require__){var LGraphObject=__webpack_require__(2),Integer=__webpack_require__(10),RectangleD=__webpack_require__(13),LayoutConstants=__webpack_require__(0),RandomSeed=__webpack_require__(16),PointD=__webpack_require__(5);function LNode(gm,loc,size,vNode){null==size&&null==vNode&&(vNode=loc),LGraphObject.call(this,vNode),null!=gm.graphManager&&(gm=gm.graphManager),this.estimatedSize=Integer.MIN_VALUE,this.inclusionTreeDepth=Integer.MAX_VALUE,this.vGraphObject=vNode,this.edges=[],this.graphManager=gm,this.rect=null!=size&&null!=loc?new RectangleD(loc.x,loc.y,size.width,size.height):new RectangleD}for(var prop in LNode.prototype=Object.create(LGraphObject.prototype),LGraphObject)LNode[prop]=LGraphObject[prop];LNode.prototype.getEdges=function(){return this.edges},LNode.prototype.getChild=function(){return this.child},LNode.prototype.getOwner=function(){return this.owner},LNode.prototype.getWidth=function(){return this.rect.width},LNode.prototype.setWidth=function(width){this.rect.width=width},LNode.prototype.getHeight=function(){return this.rect.height},LNode.prototype.setHeight=function(height){this.rect.height=height},LNode.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},LNode.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},LNode.prototype.getCenter=function(){return new PointD(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},LNode.prototype.getLocation=function(){return new PointD(this.rect.x,this.rect.y)},LNode.prototype.getRect=function(){return this.rect},LNode.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},LNode.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},LNode.prototype.setRect=function(upperLeft,dimension){this.rect.x=upperLeft.x,this.rect.y=upperLeft.y,this.rect.width=dimension.width,this.rect.height=dimension.height},LNode.prototype.setCenter=function(cx,cy){this.rect.x=cx-this.rect.width/2,this.rect.y=cy-this.rect.height/2},LNode.prototype.setLocation=function(x,y){this.rect.x=x,this.rect.y=y},LNode.prototype.moveBy=function(dx,dy){this.rect.x+=dx,this.rect.y+=dy},LNode.prototype.getEdgeListToNode=function(to){var edgeList=[],self=this;return self.edges.forEach(function(edge){if(edge.target==to){if(edge.source!=self)throw"Incorrect edge source!";edgeList.push(edge)}}),edgeList},LNode.prototype.getEdgesBetween=function(other){var edgeList=[],self=this;return self.edges.forEach(function(edge){if(edge.source!=self&&edge.target!=self)throw"Incorrect edge source and/or target";edge.target!=other&&edge.source!=other||edgeList.push(edge)}),edgeList},LNode.prototype.getNeighborsList=function(){var neighbors=new Set,self=this;return self.edges.forEach(function(edge){if(edge.source==self)neighbors.add(edge.target);else{if(edge.target!=self)throw"Incorrect incidency!";neighbors.add(edge.source)}}),neighbors},LNode.prototype.withChildren=function(){var withNeighborsList=new Set;if(withNeighborsList.add(this),null!=this.child)for(var nodes=this.child.getNodes(),i=0;i<nodes.length;i++)nodes[i].withChildren().forEach(function(node){withNeighborsList.add(node)});return withNeighborsList},LNode.prototype.getNoOfChildren=function(){var noOfChildren=0;if(null==this.child)noOfChildren=1;else for(var nodes=this.child.getNodes(),i=0;i<nodes.length;i++)noOfChildren+=nodes[i].getNoOfChildren();return 0==noOfChildren&&(noOfChildren=1),noOfChildren},LNode.prototype.getEstimatedSize=function(){if(this.estimatedSize==Integer.MIN_VALUE)throw"assert failed";return this.estimatedSize},LNode.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)},LNode.prototype.scatter=function(){var randomCenterX,randomCenterY,minX=-LayoutConstants.INITIAL_WORLD_BOUNDARY,maxX=LayoutConstants.INITIAL_WORLD_BOUNDARY;randomCenterX=LayoutConstants.WORLD_CENTER_X+RandomSeed.nextDouble()*(maxX-minX)+minX;var minY=-LayoutConstants.INITIAL_WORLD_BOUNDARY,maxY=LayoutConstants.INITIAL_WORLD_BOUNDARY;randomCenterY=LayoutConstants.WORLD_CENTER_Y+RandomSeed.nextDouble()*(maxY-minY)+minY,this.rect.x=randomCenterX,this.rect.y=randomCenterY},LNode.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var childGraph=this.getChild();if(childGraph.updateBounds(!0),this.rect.x=childGraph.getLeft(),this.rect.y=childGraph.getTop(),this.setWidth(childGraph.getRight()-childGraph.getLeft()),this.setHeight(childGraph.getBottom()-childGraph.getTop()),LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS){var width=childGraph.getRight()-childGraph.getLeft(),height=childGraph.getBottom()-childGraph.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(width+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>width?(this.rect.x-=(this.labelWidth-width)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(width+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(height+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>height?(this.rect.y-=(this.labelHeight-height)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(height+this.labelHeight))}}},LNode.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==Integer.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},LNode.prototype.transform=function(trans){var left=this.rect.x;left>LayoutConstants.WORLD_BOUNDARY?left=LayoutConstants.WORLD_BOUNDARY:left<-LayoutConstants.WORLD_BOUNDARY&&(left=-LayoutConstants.WORLD_BOUNDARY);var top=this.rect.y;top>LayoutConstants.WORLD_BOUNDARY?top=LayoutConstants.WORLD_BOUNDARY:top<-LayoutConstants.WORLD_BOUNDARY&&(top=-LayoutConstants.WORLD_BOUNDARY);var leftTop=new PointD(left,top),vLeftTop=trans.inverseTransformPoint(leftTop);this.setLocation(vLeftTop.x,vLeftTop.y)},LNode.prototype.getLeft=function(){return this.rect.x},LNode.prototype.getRight=function(){return this.rect.x+this.rect.width},LNode.prototype.getTop=function(){return this.rect.y},LNode.prototype.getBottom=function(){return this.rect.y+this.rect.height},LNode.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},module2.exports=LNode},function(module2,exports$12,__webpack_require__){var LayoutConstants=__webpack_require__(0);function FDLayoutConstants(){}for(var prop in LayoutConstants)FDLayoutConstants[prop]=LayoutConstants[prop];FDLayoutConstants.MAX_ITERATIONS=2500,FDLayoutConstants.DEFAULT_EDGE_LENGTH=50,FDLayoutConstants.DEFAULT_SPRING_STRENGTH=.45,FDLayoutConstants.DEFAULT_REPULSION_STRENGTH=4500,FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH=.4,FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,FDLayoutConstants.COOLING_ADAPTATION_FACTOR=.33,FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT=1e3,FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT=5e3,FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,FDLayoutConstants.MAX_NODE_DISPLACEMENT=3*FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL,FDLayoutConstants.MIN_REPULSION_DIST=FDLayoutConstants.DEFAULT_EDGE_LENGTH/10,FDLayoutConstants.CONVERGENCE_CHECK_PERIOD=100,FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,FDLayoutConstants.MIN_EDGE_LENGTH=1,FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD=10,module2.exports=FDLayoutConstants},function(module2,exports$12,__webpack_require__){function PointD(x,y){null==x&&null==y?(this.x=0,this.y=0):(this.x=x,this.y=y)}PointD.prototype.getX=function(){return this.x},PointD.prototype.getY=function(){return this.y},PointD.prototype.setX=function(x){this.x=x},PointD.prototype.setY=function(y){this.y=y},PointD.prototype.getDifference=function(pt){return new DimensionD(this.x-pt.x,this.y-pt.y)},PointD.prototype.getCopy=function(){return new PointD(this.x,this.y)},PointD.prototype.translate=function(dim){return this.x+=dim.width,this.y+=dim.height,this},module2.exports=PointD},function(module2,exports$12,__webpack_require__){var LGraphObject=__webpack_require__(2),Integer=__webpack_require__(10),LayoutConstants=__webpack_require__(0),LGraphManager=__webpack_require__(7),LNode=__webpack_require__(3),LEdge=__webpack_require__(1),RectangleD=__webpack_require__(13),Point2=__webpack_require__(12),LinkedList=__webpack_require__(11);function LGraph(parent,obj2,vGraph){LGraphObject.call(this,vGraph),this.estimatedSize=Integer.MIN_VALUE,this.margin=LayoutConstants.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=parent,null!=obj2&&obj2 instanceof LGraphManager?this.graphManager=obj2:null!=obj2&&obj2 instanceof Layout&&(this.graphManager=obj2.graphManager)}for(var prop in LGraph.prototype=Object.create(LGraphObject.prototype),LGraphObject)LGraph[prop]=LGraphObject[prop];LGraph.prototype.getNodes=function(){return this.nodes},LGraph.prototype.getEdges=function(){return this.edges},LGraph.prototype.getGraphManager=function(){return this.graphManager},LGraph.prototype.getParent=function(){return this.parent},LGraph.prototype.getLeft=function(){return this.left},LGraph.prototype.getRight=function(){return this.right},LGraph.prototype.getTop=function(){return this.top},LGraph.prototype.getBottom=function(){return this.bottom},LGraph.prototype.isConnected=function(){return this.isConnected},LGraph.prototype.add=function(obj1,sourceNode,targetNode){if(null==sourceNode&&null==targetNode){var newNode=obj1;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(newNode)>-1)throw"Node already in graph!";return newNode.owner=this,this.getNodes().push(newNode),newNode}var newEdge=obj1;if(!(this.getNodes().indexOf(sourceNode)>-1&&this.getNodes().indexOf(targetNode)>-1))throw"Source or target not in graph!";if(sourceNode.owner!=targetNode.owner||sourceNode.owner!=this)throw"Both owners must be this graph!";return sourceNode.owner!=targetNode.owner?null:(newEdge.source=sourceNode,newEdge.target=targetNode,newEdge.isInterGraph=!1,this.getEdges().push(newEdge),sourceNode.edges.push(newEdge),targetNode!=sourceNode&&targetNode.edges.push(newEdge),newEdge)},LGraph.prototype.remove=function(obj){var node=obj;if(obj instanceof LNode){if(null==node)throw"Node is null!";if(null==node.owner||node.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var edgesToBeRemoved=node.edges.slice(),s=edgesToBeRemoved.length,i=0;i<s;i++)(edge=edgesToBeRemoved[i]).isInterGraph?this.graphManager.remove(edge):edge.source.owner.remove(edge);if(-1==(index=this.nodes.indexOf(node)))throw"Node not in owner node list!";this.nodes.splice(index,1)}else if(obj instanceof LEdge){var edge;if(null==(edge=obj))throw"Edge is null!";if(null==edge.source||null==edge.target)throw"Source and/or target is null!";if(null==edge.source.owner||null==edge.target.owner||edge.source.owner!=this||edge.target.owner!=this)throw"Source and/or target owner is invalid!";var index,sourceIndex=edge.source.edges.indexOf(edge),targetIndex=edge.target.edges.indexOf(edge);if(!(sourceIndex>-1&&targetIndex>-1))throw"Source and/or target doesn't know this edge!";if(edge.source.edges.splice(sourceIndex,1),edge.target!=edge.source&&edge.target.edges.splice(targetIndex,1),-1==(index=edge.source.owner.getEdges().indexOf(edge)))throw"Not in owner's edge list!";edge.source.owner.getEdges().splice(index,1)}},LGraph.prototype.updateLeftTop=function(){for(var nodeTop,nodeLeft,margin,top=Integer.MAX_VALUE,left=Integer.MAX_VALUE,nodes=this.getNodes(),s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];top>(nodeTop=lNode.getTop())&&(top=nodeTop),left>(nodeLeft=lNode.getLeft())&&(left=nodeLeft)}return top==Integer.MAX_VALUE?null:(margin=null!=nodes[0].getParent().paddingLeft?nodes[0].getParent().paddingLeft:this.margin,this.left=left-margin,this.top=top-margin,new Point2(this.left,this.top))},LGraph.prototype.updateBounds=function(recursive){for(var nodeLeft,nodeRight,nodeTop,nodeBottom,margin,left=Integer.MAX_VALUE,right=-Integer.MAX_VALUE,top=Integer.MAX_VALUE,bottom=-Integer.MAX_VALUE,nodes=this.nodes,s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];recursive&&null!=lNode.child&&lNode.updateBounds(),left>(nodeLeft=lNode.getLeft())&&(left=nodeLeft),right<(nodeRight=lNode.getRight())&&(right=nodeRight),top>(nodeTop=lNode.getTop())&&(top=nodeTop),bottom<(nodeBottom=lNode.getBottom())&&(bottom=nodeBottom)}var boundingRect=new RectangleD(left,top,right-left,bottom-top);left==Integer.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),margin=null!=nodes[0].getParent().paddingLeft?nodes[0].getParent().paddingLeft:this.margin,this.left=boundingRect.x-margin,this.right=boundingRect.x+boundingRect.width+margin,this.top=boundingRect.y-margin,this.bottom=boundingRect.y+boundingRect.height+margin},LGraph.calculateBounds=function(nodes){for(var nodeLeft,nodeRight,nodeTop,nodeBottom,left=Integer.MAX_VALUE,right=-Integer.MAX_VALUE,top=Integer.MAX_VALUE,bottom=-Integer.MAX_VALUE,s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];left>(nodeLeft=lNode.getLeft())&&(left=nodeLeft),right<(nodeRight=lNode.getRight())&&(right=nodeRight),top>(nodeTop=lNode.getTop())&&(top=nodeTop),bottom<(nodeBottom=lNode.getBottom())&&(bottom=nodeBottom)}return new RectangleD(left,top,right-left,bottom-top)},LGraph.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},LGraph.prototype.getEstimatedSize=function(){if(this.estimatedSize==Integer.MIN_VALUE)throw"assert failed";return this.estimatedSize},LGraph.prototype.calcEstimatedSize=function(){for(var size=0,nodes=this.nodes,s=nodes.length,i=0;i<s;i++)size+=nodes[i].calcEstimatedSize();return this.estimatedSize=0==size?LayoutConstants.EMPTY_COMPOUND_NODE_SIZE:size/Math.sqrt(this.nodes.length),this.estimatedSize},LGraph.prototype.updateConnected=function(){var self=this;if(0!=this.nodes.length){var neighborEdges,currentNeighbor,queue=new LinkedList,visited=new Set,currentNode=this.nodes[0];for(currentNode.withChildren().forEach(function(node){queue.push(node),visited.add(node)});0!==queue.length;)for(var size=(neighborEdges=(currentNode=queue.shift()).getEdges()).length,i=0;i<size;i++)null==(currentNeighbor=neighborEdges[i].getOtherEndInGraph(currentNode,this))||visited.has(currentNeighbor)||currentNeighbor.withChildren().forEach(function(node){queue.push(node),visited.add(node)});if(this.isConnected=!1,visited.size>=this.nodes.length){var noOfVisitedInThisGraph=0;visited.forEach(function(visitedNode){visitedNode.owner==self&&noOfVisitedInThisGraph++}),noOfVisitedInThisGraph==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},module2.exports=LGraph},function(module2,exports$12,__webpack_require__){var LGraph,LEdge=__webpack_require__(1);function LGraphManager(layout){LGraph=__webpack_require__(6),this.layout=layout,this.graphs=[],this.edges=[]}LGraphManager.prototype.addRoot=function(){var ngraph=this.layout.newGraph(),nnode=this.layout.newNode(null),root=this.add(ngraph,nnode);return this.setRootGraph(root),this.rootGraph},LGraphManager.prototype.add=function(newGraph,parentNode,newEdge,sourceNode,targetNode){if(null==newEdge&&null==sourceNode&&null==targetNode){if(null==newGraph)throw"Graph is null!";if(null==parentNode)throw"Parent node is null!";if(this.graphs.indexOf(newGraph)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(newGraph),null!=newGraph.parent)throw"Already has a parent!";if(null!=parentNode.child)throw"Already has a child!";return newGraph.parent=parentNode,parentNode.child=newGraph,newGraph}targetNode=newEdge,newEdge=newGraph;var sourceGraph=(sourceNode=parentNode).getOwner(),targetGraph=targetNode.getOwner();if(null==sourceGraph||sourceGraph.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==targetGraph||targetGraph.getGraphManager()!=this)throw"Target not in this graph mgr!";if(sourceGraph==targetGraph)return newEdge.isInterGraph=!1,sourceGraph.add(newEdge,sourceNode,targetNode);if(newEdge.isInterGraph=!0,newEdge.source=sourceNode,newEdge.target=targetNode,this.edges.indexOf(newEdge)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(newEdge),null==newEdge.source||null==newEdge.target)throw"Edge source and/or target is null!";if(-1!=newEdge.source.edges.indexOf(newEdge)||-1!=newEdge.target.edges.indexOf(newEdge))throw"Edge already in source and/or target incidency list!";return newEdge.source.edges.push(newEdge),newEdge.target.edges.push(newEdge),newEdge},LGraphManager.prototype.remove=function(lObj){if(lObj instanceof LGraph){var graph=lObj;if(graph.getGraphManager()!=this)throw"Graph not in this graph mgr";if(graph!=this.rootGraph&&(null==graph.parent||graph.parent.graphManager!=this))throw"Invalid parent node!";for(var edge,edgesToBeRemoved=[],s=(edgesToBeRemoved=edgesToBeRemoved.concat(graph.getEdges())).length,i=0;i<s;i++)edge=edgesToBeRemoved[i],graph.remove(edge);var node,nodesToBeRemoved=[];for(s=(nodesToBeRemoved=nodesToBeRemoved.concat(graph.getNodes())).length,i=0;i<s;i++)node=nodesToBeRemoved[i],graph.remove(node);graph==this.rootGraph&&this.setRootGraph(null);var index=this.graphs.indexOf(graph);this.graphs.splice(index,1),graph.parent=null}else if(lObj instanceof LEdge){if(null==(edge=lObj))throw"Edge is null!";if(!edge.isInterGraph)throw"Not an inter-graph edge!";if(null==edge.source||null==edge.target)throw"Source and/or target is null!";if(-1==edge.source.edges.indexOf(edge)||-1==edge.target.edges.indexOf(edge))throw"Source and/or target doesn't know this edge!";if(index=edge.source.edges.indexOf(edge),edge.source.edges.splice(index,1),index=edge.target.edges.indexOf(edge),edge.target.edges.splice(index,1),null==edge.source.owner||null==edge.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==edge.source.owner.getGraphManager().edges.indexOf(edge))throw"Not in owner graph manager's edge list!";index=edge.source.owner.getGraphManager().edges.indexOf(edge),edge.source.owner.getGraphManager().edges.splice(index,1)}},LGraphManager.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},LGraphManager.prototype.getGraphs=function(){return this.graphs},LGraphManager.prototype.getAllNodes=function(){if(null==this.allNodes){for(var nodeList=[],graphs=this.getGraphs(),s=graphs.length,i=0;i<s;i++)nodeList=nodeList.concat(graphs[i].getNodes());this.allNodes=nodeList}return this.allNodes},LGraphManager.prototype.resetAllNodes=function(){this.allNodes=null},LGraphManager.prototype.resetAllEdges=function(){this.allEdges=null},LGraphManager.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},LGraphManager.prototype.getAllEdges=function(){if(null==this.allEdges){var edgeList=[],graphs=this.getGraphs();graphs.length;for(var i=0;i<graphs.length;i++)edgeList=edgeList.concat(graphs[i].getEdges());edgeList=edgeList.concat(this.edges),this.allEdges=edgeList}return this.allEdges},LGraphManager.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},LGraphManager.prototype.setAllNodesToApplyGravitation=function(nodeList){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=nodeList},LGraphManager.prototype.getRoot=function(){return this.rootGraph},LGraphManager.prototype.setRootGraph=function(graph){if(graph.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=graph,null==graph.parent&&(graph.parent=this.layout.newNode("Root node"))},LGraphManager.prototype.getLayout=function(){return this.layout},LGraphManager.prototype.isOneAncestorOfOther=function(firstNode,secondNode){if(null==firstNode||null==secondNode)throw"assert failed";if(firstNode==secondNode)return!0;for(var parentNode,ownerGraph=firstNode.getOwner();null!=(parentNode=ownerGraph.getParent());){if(parentNode==secondNode)return!0;if(null==(ownerGraph=parentNode.getOwner()))break}for(ownerGraph=secondNode.getOwner();null!=(parentNode=ownerGraph.getParent());){if(parentNode==firstNode)return!0;if(null==(ownerGraph=parentNode.getOwner()))break}return!1},LGraphManager.prototype.calcLowestCommonAncestors=function(){for(var edge,sourceNode,targetNode,sourceAncestorGraph,targetAncestorGraph,edges=this.getAllEdges(),s=edges.length,i=0;i<s;i++)if(sourceNode=(edge=edges[i]).source,targetNode=edge.target,edge.lca=null,edge.sourceInLca=sourceNode,edge.targetInLca=targetNode,sourceNode!=targetNode){for(sourceAncestorGraph=sourceNode.getOwner();null==edge.lca;){for(edge.targetInLca=targetNode,targetAncestorGraph=targetNode.getOwner();null==edge.lca;){if(targetAncestorGraph==sourceAncestorGraph){edge.lca=targetAncestorGraph;break}if(targetAncestorGraph==this.rootGraph)break;if(null!=edge.lca)throw"assert failed";edge.targetInLca=targetAncestorGraph.getParent(),targetAncestorGraph=edge.targetInLca.getOwner()}if(sourceAncestorGraph==this.rootGraph)break;null==edge.lca&&(edge.sourceInLca=sourceAncestorGraph.getParent(),sourceAncestorGraph=edge.sourceInLca.getOwner())}if(null==edge.lca)throw"assert failed"}else edge.lca=sourceNode.getOwner()},LGraphManager.prototype.calcLowestCommonAncestor=function(firstNode,secondNode){if(firstNode==secondNode)return firstNode.getOwner();for(var firstOwnerGraph=firstNode.getOwner();null!=firstOwnerGraph;){for(var secondOwnerGraph=secondNode.getOwner();null!=secondOwnerGraph;){if(secondOwnerGraph==firstOwnerGraph)return secondOwnerGraph;secondOwnerGraph=secondOwnerGraph.getParent().getOwner()}firstOwnerGraph=firstOwnerGraph.getParent().getOwner()}return firstOwnerGraph},LGraphManager.prototype.calcInclusionTreeDepths=function(graph,depth){var node;null==graph&&null==depth&&(graph=this.rootGraph,depth=1);for(var nodes=graph.getNodes(),s=nodes.length,i=0;i<s;i++)(node=nodes[i]).inclusionTreeDepth=depth,null!=node.child&&this.calcInclusionTreeDepths(node.child,depth+1)},LGraphManager.prototype.includesInvalidEdge=function(){for(var edge,edgesToRemove=[],s=this.edges.length,i=0;i<s;i++)edge=this.edges[i],this.isOneAncestorOfOther(edge.source,edge.target)&&edgesToRemove.push(edge);for(i=0;i<edgesToRemove.length;i++)this.remove(edgesToRemove[i]);return!1},module2.exports=LGraphManager},function(module2,exports$12,__webpack_require__){var Point2=__webpack_require__(12);function IGeometry(){}IGeometry.calcSeparationAmount=function(rectA,rectB,overlapAmount,separationBuffer){if(!rectA.intersects(rectB))throw"assert failed";var directions=new Array(2);this.decideDirectionsForOverlappingNodes(rectA,rectB,directions),overlapAmount[0]=Math.min(rectA.getRight(),rectB.getRight())-Math.max(rectA.x,rectB.x),overlapAmount[1]=Math.min(rectA.getBottom(),rectB.getBottom())-Math.max(rectA.y,rectB.y),rectA.getX()<=rectB.getX()&&rectA.getRight()>=rectB.getRight()?overlapAmount[0]+=Math.min(rectB.getX()-rectA.getX(),rectA.getRight()-rectB.getRight()):rectB.getX()<=rectA.getX()&&rectB.getRight()>=rectA.getRight()&&(overlapAmount[0]+=Math.min(rectA.getX()-rectB.getX(),rectB.getRight()-rectA.getRight())),rectA.getY()<=rectB.getY()&&rectA.getBottom()>=rectB.getBottom()?overlapAmount[1]+=Math.min(rectB.getY()-rectA.getY(),rectA.getBottom()-rectB.getBottom()):rectB.getY()<=rectA.getY()&&rectB.getBottom()>=rectA.getBottom()&&(overlapAmount[1]+=Math.min(rectA.getY()-rectB.getY(),rectB.getBottom()-rectA.getBottom()));var slope=Math.abs((rectB.getCenterY()-rectA.getCenterY())/(rectB.getCenterX()-rectA.getCenterX()));rectB.getCenterY()===rectA.getCenterY()&&rectB.getCenterX()===rectA.getCenterX()&&(slope=1);var moveByY=slope*overlapAmount[0],moveByX=overlapAmount[1]/slope;overlapAmount[0]<moveByX?moveByX=overlapAmount[0]:moveByY=overlapAmount[1],overlapAmount[0]=-1*directions[0]*(moveByX/2+separationBuffer),overlapAmount[1]=-1*directions[1]*(moveByY/2+separationBuffer)},IGeometry.decideDirectionsForOverlappingNodes=function(rectA,rectB,directions){rectA.getCenterX()<rectB.getCenterX()?directions[0]=-1:directions[0]=1,rectA.getCenterY()<rectB.getCenterY()?directions[1]=-1:directions[1]=1},IGeometry.getIntersection2=function(rectA,rectB,result){var p1x=rectA.getCenterX(),p1y=rectA.getCenterY(),p2x=rectB.getCenterX(),p2y=rectB.getCenterY();if(rectA.intersects(rectB))return result[0]=p1x,result[1]=p1y,result[2]=p2x,result[3]=p2y,!0;var topLeftAx=rectA.getX(),topLeftAy=rectA.getY(),topRightAx=rectA.getRight(),bottomLeftAx=rectA.getX(),bottomLeftAy=rectA.getBottom(),bottomRightAx=rectA.getRight(),halfWidthA=rectA.getWidthHalf(),halfHeightA=rectA.getHeightHalf(),topLeftBx=rectB.getX(),topLeftBy=rectB.getY(),topRightBx=rectB.getRight(),bottomLeftBx=rectB.getX(),bottomLeftBy=rectB.getBottom(),bottomRightBx=rectB.getRight(),halfWidthB=rectB.getWidthHalf(),halfHeightB=rectB.getHeightHalf(),clipPointAFound=!1,clipPointBFound=!1;if(p1x===p2x){if(p1y>p2y)return result[0]=p1x,result[1]=topLeftAy,result[2]=p2x,result[3]=bottomLeftBy,!1;if(p1y<p2y)return result[0]=p1x,result[1]=bottomLeftAy,result[2]=p2x,result[3]=topLeftBy,!1}else if(p1y===p2y){if(p1x>p2x)return result[0]=topLeftAx,result[1]=p1y,result[2]=topRightBx,result[3]=p2y,!1;if(p1x<p2x)return result[0]=topRightAx,result[1]=p1y,result[2]=topLeftBx,result[3]=p2y,!1}else{var slopeA=rectA.height/rectA.width,slopeB=rectB.height/rectB.width,slopePrime=(p2y-p1y)/(p2x-p1x),cardinalDirectionA=void 0,cardinalDirectionB=void 0,tempPointAx=void 0,tempPointAy=void 0,tempPointBx=void 0,tempPointBy=void 0;if(-slopeA===slopePrime?p1x>p2x?(result[0]=bottomLeftAx,result[1]=bottomLeftAy,clipPointAFound=!0):(result[0]=topRightAx,result[1]=topLeftAy,clipPointAFound=!0):slopeA===slopePrime&&(p1x>p2x?(result[0]=topLeftAx,result[1]=topLeftAy,clipPointAFound=!0):(result[0]=bottomRightAx,result[1]=bottomLeftAy,clipPointAFound=!0)),-slopeB===slopePrime?p2x>p1x?(result[2]=bottomLeftBx,result[3]=bottomLeftBy,clipPointBFound=!0):(result[2]=topRightBx,result[3]=topLeftBy,clipPointBFound=!0):slopeB===slopePrime&&(p2x>p1x?(result[2]=topLeftBx,result[3]=topLeftBy,clipPointBFound=!0):(result[2]=bottomRightBx,result[3]=bottomLeftBy,clipPointBFound=!0)),clipPointAFound&&clipPointBFound)return!1;if(p1x>p2x?p1y>p2y?(cardinalDirectionA=this.getCardinalDirection(slopeA,slopePrime,4),cardinalDirectionB=this.getCardinalDirection(slopeB,slopePrime,2)):(cardinalDirectionA=this.getCardinalDirection(-slopeA,slopePrime,3),cardinalDirectionB=this.getCardinalDirection(-slopeB,slopePrime,1)):p1y>p2y?(cardinalDirectionA=this.getCardinalDirection(-slopeA,slopePrime,1),cardinalDirectionB=this.getCardinalDirection(-slopeB,slopePrime,3)):(cardinalDirectionA=this.getCardinalDirection(slopeA,slopePrime,2),cardinalDirectionB=this.getCardinalDirection(slopeB,slopePrime,4)),!clipPointAFound)switch(cardinalDirectionA){case 1:tempPointAy=topLeftAy,tempPointAx=p1x+-halfHeightA/slopePrime,result[0]=tempPointAx,result[1]=tempPointAy;break;case 2:tempPointAx=bottomRightAx,tempPointAy=p1y+halfWidthA*slopePrime,result[0]=tempPointAx,result[1]=tempPointAy;break;case 3:tempPointAy=bottomLeftAy,tempPointAx=p1x+halfHeightA/slopePrime,result[0]=tempPointAx,result[1]=tempPointAy;break;case 4:tempPointAx=bottomLeftAx,tempPointAy=p1y+-halfWidthA*slopePrime,result[0]=tempPointAx,result[1]=tempPointAy}if(!clipPointBFound)switch(cardinalDirectionB){case 1:tempPointBy=topLeftBy,tempPointBx=p2x+-halfHeightB/slopePrime,result[2]=tempPointBx,result[3]=tempPointBy;break;case 2:tempPointBx=bottomRightBx,tempPointBy=p2y+halfWidthB*slopePrime,result[2]=tempPointBx,result[3]=tempPointBy;break;case 3:tempPointBy=bottomLeftBy,tempPointBx=p2x+halfHeightB/slopePrime,result[2]=tempPointBx,result[3]=tempPointBy;break;case 4:tempPointBx=bottomLeftBx,tempPointBy=p2y+-halfWidthB*slopePrime,result[2]=tempPointBx,result[3]=tempPointBy}}return!1},IGeometry.getCardinalDirection=function(slope,slopePrime,line){return slope>slopePrime?line:1+line%4},IGeometry.getIntersection=function(s1,s2,f1,f2){if(null==f2)return this.getIntersection2(s1,s2,f1);var a1,a2,b1,b2,c1,c2,denom,x1=s1.x,y1=s1.y,x2=s2.x,y2=s2.y,x3=f1.x,y3=f1.y,x4=f2.x,y4=f2.y;return 0===(denom=(a1=y2-y1)*(b2=x3-x4)-(a2=y4-y3)*(b1=x1-x2))?null:new Point2((b1*(c2=x4*y3-x3*y4)-b2*(c1=x2*y1-x1*y2))/denom,(a2*c1-a1*c2)/denom)},IGeometry.angleOfVector=function(Cx,Cy,Nx,Ny){var C_angle=void 0;return Cx!==Nx?(C_angle=Math.atan((Ny-Cy)/(Nx-Cx)),Nx<Cx?C_angle+=Math.PI:Ny<Cy&&(C_angle+=this.TWO_PI)):C_angle=Ny<Cy?this.ONE_AND_HALF_PI:this.HALF_PI,C_angle},IGeometry.doIntersect=function(p1,p2,p3,p4){var a=p1.x,b=p1.y,c=p2.x,d=p2.y,p=p3.x,q=p3.y,r=p4.x,s=p4.y,det=(c-a)*(s-q)-(r-p)*(d-b);if(0===det)return!1;var lambda=((s-q)*(r-a)+(p-r)*(s-b))/det,gamma=((b-d)*(r-a)+(c-a)*(s-b))/det;return 0<lambda&&lambda<1&&0<gamma&&gamma<1},IGeometry.findCircleLineIntersections=function(Ex,Ey,Lx,Ly,Cx,Cy,r){var a=(Lx-Ex)*(Lx-Ex)+(Ly-Ey)*(Ly-Ey),b=2*((Ex-Cx)*(Lx-Ex)+(Ey-Cy)*(Ly-Ey)),c=(Ex-Cx)*(Ex-Cx)+(Ey-Cy)*(Ey-Cy)-r*r;if(b*b-4*a*c>=0){var t1=(-b+Math.sqrt(b*b-4*a*c))/(2*a),t2=(-b-Math.sqrt(b*b-4*a*c))/(2*a);return t1>=0&&t1<=1?[t1]:t2>=0&&t2<=1?[t2]:null}return null},IGeometry.HALF_PI=.5*Math.PI,IGeometry.ONE_AND_HALF_PI=1.5*Math.PI,IGeometry.TWO_PI=2*Math.PI,IGeometry.THREE_PI=3*Math.PI,module2.exports=IGeometry},function(module2,exports$12,__webpack_require__){function IMath(){}IMath.sign=function(value){return value>0?1:value<0?-1:0},IMath.floor=function(value){return value<0?Math.ceil(value):Math.floor(value)},IMath.ceil=function(value){return value<0?Math.floor(value):Math.ceil(value)},module2.exports=IMath},function(module2,exports$12,__webpack_require__){function Integer(){}Integer.MAX_VALUE=2147483647,Integer.MIN_VALUE=-2147483648,module2.exports=Integer},function(module2,exports$12,__webpack_require__){var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),nodeFrom=function(value){return{value:value,next:null,prev:null}},add=function(prev,node,next2,list){return null!==prev?prev.next=node:list.head=node,null!==next2?next2.prev=node:list.tail=node,node.prev=prev,node.next=next2,list.length++,node},_remove=function(node,list){var prev=node.prev,next2=node.next;return null!==prev?prev.next=next2:list.head=next2,null!==next2?next2.prev=prev:list.tail=prev,node.prev=node.next=null,list.length--,node},LinkedList=function(){function LinkedList2(vals){var _this=this;!function(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,LinkedList2),this.length=0,this.head=null,this.tail=null,null!=vals&&vals.forEach(function(v){return _this.push(v)})}return _createClass(LinkedList2,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(val,otherNode){return add(otherNode.prev,nodeFrom(val),otherNode,this)}},{key:"insertAfter",value:function(val,otherNode){return add(otherNode,nodeFrom(val),otherNode.next,this)}},{key:"insertNodeBefore",value:function(newNode,otherNode){return add(otherNode.prev,newNode,otherNode,this)}},{key:"insertNodeAfter",value:function(newNode,otherNode){return add(otherNode,newNode,otherNode.next,this)}},{key:"push",value:function(val){return add(this.tail,nodeFrom(val),null,this)}},{key:"unshift",value:function(val){return add(null,nodeFrom(val),this.head,this)}},{key:"remove",value:function(node){return _remove(node,this)}},{key:"pop",value:function(){return _remove(this.tail,this).value}},{key:"popNode",value:function(){return _remove(this.tail,this)}},{key:"shift",value:function(){return _remove(this.head,this).value}},{key:"shiftNode",value:function(){return _remove(this.head,this)}},{key:"get_object_at",value:function(index){if(index<=this.length()){for(var i=1,current=this.head;i<index;)current=current.next,i++;return current.value}}},{key:"set_object_at",value:function(index,value){if(index<=this.length()){for(var i=1,current=this.head;i<index;)current=current.next,i++;current.value=value}}}]),LinkedList2}();module2.exports=LinkedList},function(module2,exports$12,__webpack_require__){function Point2(x,y,p){this.x=null,this.y=null,null==x&&null==y&&null==p?(this.x=0,this.y=0):"number"==typeof x&&"number"==typeof y&&null==p?(this.x=x,this.y=y):"Point"==x.constructor.name&&null==y&&null==p&&(p=x,this.x=p.x,this.y=p.y)}Point2.prototype.getX=function(){return this.x},Point2.prototype.getY=function(){return this.y},Point2.prototype.getLocation=function(){return new Point2(this.x,this.y)},Point2.prototype.setLocation=function(x,y,p){"Point"==x.constructor.name&&null==y&&null==p?(p=x,this.setLocation(p.x,p.y)):"number"==typeof x&&"number"==typeof y&&null==p&&(parseInt(x)==x&&parseInt(y)==y?this.move(x,y):(this.x=Math.floor(x+.5),this.y=Math.floor(y+.5)))},Point2.prototype.move=function(x,y){this.x=x,this.y=y},Point2.prototype.translate=function(dx,dy){this.x+=dx,this.y+=dy},Point2.prototype.equals=function(obj){if("Point"==obj.constructor.name){var pt=obj;return this.x==pt.x&&this.y==pt.y}return this==obj},Point2.prototype.toString=function(){return(new Point2).constructor.name+"[x="+this.x+",y="+this.y+"]"},module2.exports=Point2},function(module2,exports$12,__webpack_require__){function RectangleD(x,y,width,height){this.x=0,this.y=0,this.width=0,this.height=0,null!=x&&null!=y&&null!=width&&null!=height&&(this.x=x,this.y=y,this.width=width,this.height=height)}RectangleD.prototype.getX=function(){return this.x},RectangleD.prototype.setX=function(x){this.x=x},RectangleD.prototype.getY=function(){return this.y},RectangleD.prototype.setY=function(y){this.y=y},RectangleD.prototype.getWidth=function(){return this.width},RectangleD.prototype.setWidth=function(width){this.width=width},RectangleD.prototype.getHeight=function(){return this.height},RectangleD.prototype.setHeight=function(height){this.height=height},RectangleD.prototype.getRight=function(){return this.x+this.width},RectangleD.prototype.getBottom=function(){return this.y+this.height},RectangleD.prototype.intersects=function(a){return!(this.getRight()<a.x||this.getBottom()<a.y||a.getRight()<this.x||a.getBottom()<this.y)},RectangleD.prototype.getCenterX=function(){return this.x+this.width/2},RectangleD.prototype.getMinX=function(){return this.getX()},RectangleD.prototype.getMaxX=function(){return this.getX()+this.width},RectangleD.prototype.getCenterY=function(){return this.y+this.height/2},RectangleD.prototype.getMinY=function(){return this.getY()},RectangleD.prototype.getMaxY=function(){return this.getY()+this.height},RectangleD.prototype.getWidthHalf=function(){return this.width/2},RectangleD.prototype.getHeightHalf=function(){return this.height/2},module2.exports=RectangleD},function(module2,exports$12,__webpack_require__){var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};function UniqueIDGeneretor(){}UniqueIDGeneretor.lastID=0,UniqueIDGeneretor.createID=function(obj){return UniqueIDGeneretor.isPrimitive(obj)?obj:(null!=obj.uniqueID||(obj.uniqueID=UniqueIDGeneretor.getString(),UniqueIDGeneretor.lastID++),obj.uniqueID)},UniqueIDGeneretor.getString=function(id){return null==id&&(id=UniqueIDGeneretor.lastID),"Object#"+id},UniqueIDGeneretor.isPrimitive=function(arg){var type=void 0===arg?"undefined":_typeof(arg);return null==arg||"object"!=type&&"function"!=type},module2.exports=UniqueIDGeneretor},function(module2,exports$12,__webpack_require__){function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}var LayoutConstants=__webpack_require__(0),LGraphManager=__webpack_require__(7),LNode=__webpack_require__(3),LEdge=__webpack_require__(1),LGraph=__webpack_require__(6),PointD=__webpack_require__(5),Transform=__webpack_require__(17),Emitter=__webpack_require__(29);function Layout2(isRemoteUse){Emitter.call(this),this.layoutQuality=LayoutConstants.QUALITY,this.createBendsAsNeeded=LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=LayoutConstants.DEFAULT_INCREMENTAL,this.animationOnLayout=LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=LayoutConstants.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new LGraphManager(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=isRemoteUse&&(this.isRemoteUse=isRemoteUse)}Layout2.RANDOM_SEED=1,Layout2.prototype=Object.create(Emitter.prototype),Layout2.prototype.getGraphManager=function(){return this.graphManager},Layout2.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},Layout2.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},Layout2.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},Layout2.prototype.newGraphManager=function(){var gm=new LGraphManager(this);return this.graphManager=gm,gm},Layout2.prototype.newGraph=function(vGraph){return new LGraph(null,this.graphManager,vGraph)},Layout2.prototype.newNode=function(vNode){return new LNode(this.graphManager,vNode)},Layout2.prototype.newEdge=function(vEdge){return new LEdge(null,null,vEdge)},Layout2.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},Layout2.prototype.runLayout=function(){var isLayoutSuccessfull;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),isLayoutSuccessfull=!this.checkLayoutSuccess()&&this.layout(),"during"!==LayoutConstants.ANIMATE&&(isLayoutSuccessfull&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,isLayoutSuccessfull)},Layout2.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},Layout2.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var allEdges=this.graphManager.getAllEdges(),i=0;i<allEdges.length;i++)allEdges[i];var nodes=this.graphManager.getRoot().getNodes();for(i=0;i<nodes.length;i++)nodes[i];this.update(this.graphManager.getRoot())}},Layout2.prototype.update=function(obj){if(null==obj)this.update2();else if(obj instanceof LNode){var node=obj;if(null!=node.getChild())for(var nodes=node.getChild().getNodes(),i=0;i<nodes.length;i++)update(nodes[i]);null!=node.vGraphObject&&node.vGraphObject.update(node)}else if(obj instanceof LEdge){var edge=obj;null!=edge.vGraphObject&&edge.vGraphObject.update(edge)}else if(obj instanceof LGraph){var graph=obj;null!=graph.vGraphObject&&graph.vGraphObject.update(graph)}},Layout2.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=LayoutConstants.QUALITY,this.animationDuringLayout=LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=LayoutConstants.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=LayoutConstants.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},Layout2.prototype.transform=function(newLeftTop){if(null==newLeftTop)this.transform(new PointD(0,0));else{var trans=new Transform,leftTop=this.graphManager.getRoot().updateLeftTop();if(null!=leftTop){trans.setWorldOrgX(newLeftTop.x),trans.setWorldOrgY(newLeftTop.y),trans.setDeviceOrgX(leftTop.x),trans.setDeviceOrgY(leftTop.y);for(var nodes=this.getAllNodes(),i=0;i<nodes.length;i++)nodes[i].transform(trans)}}},Layout2.prototype.positionNodesRandomly=function(graph){if(null==graph)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var lNode,childGraph,nodes=graph.getNodes(),i=0;i<nodes.length;i++)null==(childGraph=(lNode=nodes[i]).getChild())||0==childGraph.getNodes().length?lNode.scatter():(this.positionNodesRandomly(childGraph),lNode.updateBounds())},Layout2.prototype.getFlatForest=function(){for(var flatForest=[],isForest=!0,allNodes=this.graphManager.getRoot().getNodes(),isFlat=!0,i=0;i<allNodes.length;i++)null!=allNodes[i].getChild()&&(isFlat=!1);if(!isFlat)return flatForest;var visited=new Set,toBeVisited=[],parents=new Map,unProcessedNodes=[];for(unProcessedNodes=unProcessedNodes.concat(allNodes);unProcessedNodes.length>0&&isForest;){for(toBeVisited.push(unProcessedNodes[0]);toBeVisited.length>0&&isForest;){var currentNode=toBeVisited[0];toBeVisited.splice(0,1),visited.add(currentNode);var neighborEdges=currentNode.getEdges();for(i=0;i<neighborEdges.length;i++){var currentNeighbor=neighborEdges[i].getOtherEnd(currentNode);if(parents.get(currentNode)!=currentNeighbor){if(visited.has(currentNeighbor)){isForest=!1;break}toBeVisited.push(currentNeighbor),parents.set(currentNeighbor,currentNode)}}}if(isForest){var temp=[].concat(_toConsumableArray(visited));for(flatForest.push(temp),i=0;i<temp.length;i++){var value=temp[i],index=unProcessedNodes.indexOf(value);index>-1&&unProcessedNodes.splice(index,1)}visited=new Set,parents=new Map}else flatForest=[]}return flatForest},Layout2.prototype.createDummyNodesForBendpoints=function(edge){for(var dummyNodes=[],prev=edge.source,graph=this.graphManager.calcLowestCommonAncestor(edge.source,edge.target),i=0;i<edge.bendpoints.length;i++){var dummyNode=this.newNode(null);dummyNode.setRect(new Point(0,0),new Dimension(1,1)),graph.add(dummyNode);var dummyEdge=this.newEdge(null);this.graphManager.add(dummyEdge,prev,dummyNode),dummyNodes.add(dummyNode),prev=dummyNode}return dummyEdge=this.newEdge(null),this.graphManager.add(dummyEdge,prev,edge.target),this.edgeToDummyNodes.set(edge,dummyNodes),edge.isInterGraph()?this.graphManager.remove(edge):graph.remove(edge),dummyNodes},Layout2.prototype.createBendpointsFromDummyNodes=function(){var edges=[];edges=edges.concat(this.graphManager.getAllEdges()),edges=[].concat(_toConsumableArray(this.edgeToDummyNodes.keys())).concat(edges);for(var k=0;k<edges.length;k++){var lEdge=edges[k];if(lEdge.bendpoints.length>0){for(var path=this.edgeToDummyNodes.get(lEdge),i=0;i<path.length;i++){var dummyNode=path[i],p=new PointD(dummyNode.getCenterX(),dummyNode.getCenterY()),ebp=lEdge.bendpoints.get(i);ebp.x=p.x,ebp.y=p.y,dummyNode.getOwner().remove(dummyNode)}this.graphManager.add(lEdge,lEdge.source,lEdge.target)}}},Layout2.transform=function(sliderValue,defaultValue,minDiv,maxMul){if(null!=minDiv&&null!=maxMul){var value=defaultValue;return sliderValue<=50?value-=(defaultValue-defaultValue/minDiv)/50*(50-sliderValue):value+=(defaultValue*maxMul-defaultValue)/50*(sliderValue-50),value}var a,b;return sliderValue<=50?(a=9*defaultValue/500,b=defaultValue/10):(a=9*defaultValue/50,b=-8*defaultValue),a*sliderValue+b},Layout2.findCenterOfTree=function(nodes){var list=[];list=list.concat(nodes);var removedNodes=[],remainingDegrees=new Map,foundCenter=!1,centerNode=null;1!=list.length&&2!=list.length||(foundCenter=!0,centerNode=list[0]);for(var i=0;i<list.length;i++){var degree=(node=list[i]).getNeighborsList().size;remainingDegrees.set(node,node.getNeighborsList().size),1==degree&&removedNodes.push(node)}var tempList=[];for(tempList=tempList.concat(removedNodes);!foundCenter;){var tempList2=[];for(tempList2=tempList2.concat(tempList),tempList=[],i=0;i<list.length;i++){var node=list[i],index=list.indexOf(node);index>=0&&list.splice(index,1),node.getNeighborsList().forEach(function(neighbour){if(removedNodes.indexOf(neighbour)<0){var newDegree=remainingDegrees.get(neighbour)-1;1==newDegree&&tempList.push(neighbour),remainingDegrees.set(neighbour,newDegree)}})}removedNodes=removedNodes.concat(tempList),1!=list.length&&2!=list.length||(foundCenter=!0,centerNode=list[0])}return centerNode},Layout2.prototype.setGraphManager=function(gm){this.graphManager=gm},module2.exports=Layout2},function(module2,exports$12,__webpack_require__){function RandomSeed(){}RandomSeed.seed=1,RandomSeed.x=0,RandomSeed.nextDouble=function(){return RandomSeed.x=1e4*Math.sin(RandomSeed.seed++),RandomSeed.x-Math.floor(RandomSeed.x)},module2.exports=RandomSeed},function(module2,exports$12,__webpack_require__){var PointD=__webpack_require__(5);function Transform(x,y){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}Transform.prototype.getWorldOrgX=function(){return this.lworldOrgX},Transform.prototype.setWorldOrgX=function(wox){this.lworldOrgX=wox},Transform.prototype.getWorldOrgY=function(){return this.lworldOrgY},Transform.prototype.setWorldOrgY=function(woy){this.lworldOrgY=woy},Transform.prototype.getWorldExtX=function(){return this.lworldExtX},Transform.prototype.setWorldExtX=function(wex){this.lworldExtX=wex},Transform.prototype.getWorldExtY=function(){return this.lworldExtY},Transform.prototype.setWorldExtY=function(wey){this.lworldExtY=wey},Transform.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},Transform.prototype.setDeviceOrgX=function(dox){this.ldeviceOrgX=dox},Transform.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},Transform.prototype.setDeviceOrgY=function(doy){this.ldeviceOrgY=doy},Transform.prototype.getDeviceExtX=function(){return this.ldeviceExtX},Transform.prototype.setDeviceExtX=function(dex){this.ldeviceExtX=dex},Transform.prototype.getDeviceExtY=function(){return this.ldeviceExtY},Transform.prototype.setDeviceExtY=function(dey){this.ldeviceExtY=dey},Transform.prototype.transformX=function(x){var xDevice=0,worldExtX=this.lworldExtX;return 0!=worldExtX&&(xDevice=this.ldeviceOrgX+(x-this.lworldOrgX)*this.ldeviceExtX/worldExtX),xDevice},Transform.prototype.transformY=function(y){var yDevice=0,worldExtY=this.lworldExtY;return 0!=worldExtY&&(yDevice=this.ldeviceOrgY+(y-this.lworldOrgY)*this.ldeviceExtY/worldExtY),yDevice},Transform.prototype.inverseTransformX=function(x){var xWorld=0,deviceExtX=this.ldeviceExtX;return 0!=deviceExtX&&(xWorld=this.lworldOrgX+(x-this.ldeviceOrgX)*this.lworldExtX/deviceExtX),xWorld},Transform.prototype.inverseTransformY=function(y){var yWorld=0,deviceExtY=this.ldeviceExtY;return 0!=deviceExtY&&(yWorld=this.lworldOrgY+(y-this.ldeviceOrgY)*this.lworldExtY/deviceExtY),yWorld},Transform.prototype.inverseTransformPoint=function(inPoint){return new PointD(this.inverseTransformX(inPoint.x),this.inverseTransformY(inPoint.y))},module2.exports=Transform},function(module2,exports$12,__webpack_require__){var Layout2=__webpack_require__(15),FDLayoutConstants=__webpack_require__(4),LayoutConstants=__webpack_require__(0),IGeometry=__webpack_require__(8),IMath=__webpack_require__(9);function FDLayout(){Layout2.call(this),this.useSmartIdealEdgeLengthCalculation=FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*FDLayoutConstants.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=FDLayoutConstants.MAX_ITERATIONS}for(var prop in FDLayout.prototype=Object.create(Layout2.prototype),Layout2)FDLayout[prop]=Layout2[prop];FDLayout.prototype.initParameters=function(){Layout2.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},FDLayout.prototype.calcIdealEdgeLengths=function(){for(var edge,originalIdealLength,lcaDepth,source,target,sizeOfSourceInLca,sizeOfTargetInLca,allEdges=this.getGraphManager().getAllEdges(),i=0;i<allEdges.length;i++)originalIdealLength=(edge=allEdges[i]).idealLength,edge.isInterGraph&&(source=edge.getSource(),target=edge.getTarget(),sizeOfSourceInLca=edge.getSourceInLca().getEstimatedSize(),sizeOfTargetInLca=edge.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(edge.idealLength+=sizeOfSourceInLca+sizeOfTargetInLca-2*LayoutConstants.SIMPLE_NODE_SIZE),lcaDepth=edge.getLca().getInclusionTreeDepth(),edge.idealLength+=originalIdealLength*FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(source.getInclusionTreeDepth()+target.getInclusionTreeDepth()-2*lcaDepth))},FDLayout.prototype.initSpringEmbedder=function(){var s=this.getAllNodes().length;this.incremental?(s>FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*FDLayoutConstants.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(s-FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT)/(FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT-FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-FDLayoutConstants.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL):(s>FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(FDLayoutConstants.COOLING_ADAPTATION_FACTOR,1-(s-FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT)/(FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT-FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT)*(1-FDLayoutConstants.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=FDLayoutConstants.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*FDLayoutConstants.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},FDLayout.prototype.calcSpringForces=function(){for(var edge,lEdges=this.getAllEdges(),i=0;i<lEdges.length;i++)edge=lEdges[i],this.calcSpringForce(edge,edge.idealLength)},FDLayout.prototype.calcRepulsionForces=function(){var i,j,nodeA,nodeB,processedNodeSet,gridUpdateAllowed=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],forceToNodeSurroundingUpdate=arguments.length>1&&void 0!==arguments[1]&&arguments[1],lNodes=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD==1&&gridUpdateAllowed&&this.updateGrid(),processedNodeSet=new Set,i=0;i<lNodes.length;i++)nodeA=lNodes[i],this.calculateRepulsionForceOfANode(nodeA,processedNodeSet,gridUpdateAllowed,forceToNodeSurroundingUpdate),processedNodeSet.add(nodeA);else for(i=0;i<lNodes.length;i++)for(nodeA=lNodes[i],j=i+1;j<lNodes.length;j++)nodeB=lNodes[j],nodeA.getOwner()==nodeB.getOwner()&&this.calcRepulsionForce(nodeA,nodeB)},FDLayout.prototype.calcGravitationalForces=function(){for(var node,lNodes=this.getAllNodesToApplyGravitation(),i=0;i<lNodes.length;i++)node=lNodes[i],this.calcGravitationalForce(node)},FDLayout.prototype.moveNodes=function(){for(var lNodes=this.getAllNodes(),i=0;i<lNodes.length;i++)lNodes[i].move()},FDLayout.prototype.calcSpringForce=function(edge,idealLength){var length,springForce,springForceX,springForceY,sourceNode=edge.getSource(),targetNode=edge.getTarget();if(this.uniformLeafNodeSizes&&null==sourceNode.getChild()&&null==targetNode.getChild())edge.updateLengthSimple();else if(edge.updateLength(),edge.isOverlapingSourceAndTarget)return;0!=(length=edge.getLength())&&(springForceX=(springForce=edge.edgeElasticity*(length-idealLength))*(edge.lengthX/length),springForceY=springForce*(edge.lengthY/length),sourceNode.springForceX+=springForceX,sourceNode.springForceY+=springForceY,targetNode.springForceX-=springForceX,targetNode.springForceY-=springForceY)},FDLayout.prototype.calcRepulsionForce=function(nodeA,nodeB){var distanceX,distanceY,distanceSquared,distance,repulsionForce,repulsionForceX,repulsionForceY,rectA=nodeA.getRect(),rectB=nodeB.getRect(),overlapAmount=new Array(2),clipPoints=new Array(4);if(rectA.intersects(rectB)){IGeometry.calcSeparationAmount(rectA,rectB,overlapAmount,FDLayoutConstants.DEFAULT_EDGE_LENGTH/2),repulsionForceX=2*overlapAmount[0],repulsionForceY=2*overlapAmount[1];var childrenConstant=nodeA.noOfChildren*nodeB.noOfChildren/(nodeA.noOfChildren+nodeB.noOfChildren);nodeA.repulsionForceX-=childrenConstant*repulsionForceX,nodeA.repulsionForceY-=childrenConstant*repulsionForceY,nodeB.repulsionForceX+=childrenConstant*repulsionForceX,nodeB.repulsionForceY+=childrenConstant*repulsionForceY}else this.uniformLeafNodeSizes&&null==nodeA.getChild()&&null==nodeB.getChild()?(distanceX=rectB.getCenterX()-rectA.getCenterX(),distanceY=rectB.getCenterY()-rectA.getCenterY()):(IGeometry.getIntersection(rectA,rectB,clipPoints),distanceX=clipPoints[2]-clipPoints[0],distanceY=clipPoints[3]-clipPoints[1]),Math.abs(distanceX)<FDLayoutConstants.MIN_REPULSION_DIST&&(distanceX=IMath.sign(distanceX)*FDLayoutConstants.MIN_REPULSION_DIST),Math.abs(distanceY)<FDLayoutConstants.MIN_REPULSION_DIST&&(distanceY=IMath.sign(distanceY)*FDLayoutConstants.MIN_REPULSION_DIST),distanceSquared=distanceX*distanceX+distanceY*distanceY,distance=Math.sqrt(distanceSquared),repulsionForceX=(repulsionForce=(nodeA.nodeRepulsion/2+nodeB.nodeRepulsion/2)*nodeA.noOfChildren*nodeB.noOfChildren/distanceSquared)*distanceX/distance,repulsionForceY=repulsionForce*distanceY/distance,nodeA.repulsionForceX-=repulsionForceX,nodeA.repulsionForceY-=repulsionForceY,nodeB.repulsionForceX+=repulsionForceX,nodeB.repulsionForceY+=repulsionForceY},FDLayout.prototype.calcGravitationalForce=function(node){var ownerGraph,ownerCenterX,ownerCenterY,distanceX,distanceY,absDistanceX,absDistanceY,estimatedSize;ownerCenterX=((ownerGraph=node.getOwner()).getRight()+ownerGraph.getLeft())/2,ownerCenterY=(ownerGraph.getTop()+ownerGraph.getBottom())/2,distanceX=node.getCenterX()-ownerCenterX,distanceY=node.getCenterY()-ownerCenterY,absDistanceX=Math.abs(distanceX)+node.getWidth()/2,absDistanceY=Math.abs(distanceY)+node.getHeight()/2,node.getOwner()==this.graphManager.getRoot()?(absDistanceX>(estimatedSize=ownerGraph.getEstimatedSize()*this.gravityRangeFactor)||absDistanceY>estimatedSize)&&(node.gravitationForceX=-this.gravityConstant*distanceX,node.gravitationForceY=-this.gravityConstant*distanceY):(absDistanceX>(estimatedSize=ownerGraph.getEstimatedSize()*this.compoundGravityRangeFactor)||absDistanceY>estimatedSize)&&(node.gravitationForceX=-this.gravityConstant*distanceX*this.compoundGravityConstant,node.gravitationForceY=-this.gravityConstant*distanceY*this.compoundGravityConstant)},FDLayout.prototype.isConverged=function(){var converged,oscilating=!1;return this.totalIterations>this.maxIterations/3&&(oscilating=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),converged=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,converged||oscilating},FDLayout.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},FDLayout.prototype.calcNoOfChildrenForAllNodes=function(){for(var node,allNodes=this.graphManager.getAllNodes(),i=0;i<allNodes.length;i++)(node=allNodes[i]).noOfChildren=node.getNoOfChildren()},FDLayout.prototype.calcGrid=function(graph){var sizeX,sizeY;sizeX=parseInt(Math.ceil((graph.getRight()-graph.getLeft())/this.repulsionRange)),sizeY=parseInt(Math.ceil((graph.getBottom()-graph.getTop())/this.repulsionRange));for(var grid=new Array(sizeX),i=0;i<sizeX;i++)grid[i]=new Array(sizeY);for(i=0;i<sizeX;i++)for(var j=0;j<sizeY;j++)grid[i][j]=new Array;return grid},FDLayout.prototype.addNodeToGrid=function(v,left,top){var startX,finishX,startY,finishY;startX=parseInt(Math.floor((v.getRect().x-left)/this.repulsionRange)),finishX=parseInt(Math.floor((v.getRect().width+v.getRect().x-left)/this.repulsionRange)),startY=parseInt(Math.floor((v.getRect().y-top)/this.repulsionRange)),finishY=parseInt(Math.floor((v.getRect().height+v.getRect().y-top)/this.repulsionRange));for(var i=startX;i<=finishX;i++)for(var j=startY;j<=finishY;j++)this.grid[i][j].push(v),v.setGridCoordinates(startX,finishX,startY,finishY)},FDLayout.prototype.updateGrid=function(){var i,nodeA,lNodes=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),i=0;i<lNodes.length;i++)nodeA=lNodes[i],this.addNodeToGrid(nodeA,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},FDLayout.prototype.calculateRepulsionForceOfANode=function(nodeA,processedNodeSet,gridUpdateAllowed,forceToNodeSurroundingUpdate){if(this.totalIterations%FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD==1&&gridUpdateAllowed||forceToNodeSurroundingUpdate){var nodeB,surrounding=new Set;nodeA.surrounding=new Array;for(var grid=this.grid,i=nodeA.startX-1;i<nodeA.finishX+2;i++)for(var j=nodeA.startY-1;j<nodeA.finishY+2;j++)if(!(i<0||j<0||i>=grid.length||j>=grid[0].length))for(var k=0;k<grid[i][j].length;k++)if(nodeB=grid[i][j][k],nodeA.getOwner()==nodeB.getOwner()&&nodeA!=nodeB&&!processedNodeSet.has(nodeB)&&!surrounding.has(nodeB)){var distanceX=Math.abs(nodeA.getCenterX()-nodeB.getCenterX())-(nodeA.getWidth()/2+nodeB.getWidth()/2),distanceY=Math.abs(nodeA.getCenterY()-nodeB.getCenterY())-(nodeA.getHeight()/2+nodeB.getHeight()/2);distanceX<=this.repulsionRange&&distanceY<=this.repulsionRange&&surrounding.add(nodeB)}nodeA.surrounding=[].concat(function(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}(surrounding))}for(i=0;i<nodeA.surrounding.length;i++)this.calcRepulsionForce(nodeA,nodeA.surrounding[i])},FDLayout.prototype.calcRepulsionRange=function(){return 0},module2.exports=FDLayout},function(module2,exports$12,__webpack_require__){var LEdge=__webpack_require__(1),FDLayoutConstants=__webpack_require__(4);function FDLayoutEdge(source,target,vEdge){LEdge.call(this,source,target,vEdge),this.idealLength=FDLayoutConstants.DEFAULT_EDGE_LENGTH,this.edgeElasticity=FDLayoutConstants.DEFAULT_SPRING_STRENGTH}for(var prop in FDLayoutEdge.prototype=Object.create(LEdge.prototype),LEdge)FDLayoutEdge[prop]=LEdge[prop];module2.exports=FDLayoutEdge},function(module2,exports$12,__webpack_require__){var LNode=__webpack_require__(3),FDLayoutConstants=__webpack_require__(4);function FDLayoutNode(gm,loc,size,vNode){LNode.call(this,gm,loc,size,vNode),this.nodeRepulsion=FDLayoutConstants.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 prop in FDLayoutNode.prototype=Object.create(LNode.prototype),LNode)FDLayoutNode[prop]=LNode[prop];FDLayoutNode.prototype.setGridCoordinates=function(_startX,_finishX,_startY,_finishY){this.startX=_startX,this.finishX=_finishX,this.startY=_startY,this.finishY=_finishY},module2.exports=FDLayoutNode},function(module2,exports$12,__webpack_require__){function DimensionD2(width,height){this.width=0,this.height=0,null!==width&&null!==height&&(this.height=height,this.width=width)}DimensionD2.prototype.getWidth=function(){return this.width},DimensionD2.prototype.setWidth=function(width){this.width=width},DimensionD2.prototype.getHeight=function(){return this.height},DimensionD2.prototype.setHeight=function(height){this.height=height},module2.exports=DimensionD2},function(module2,exports$12,__webpack_require__){var UniqueIDGeneretor=__webpack_require__(14);function HashMap(){this.map={},this.keys=[]}HashMap.prototype.put=function(key,value){var theId=UniqueIDGeneretor.createID(key);this.contains(theId)||(this.map[theId]=value,this.keys.push(key))},HashMap.prototype.contains=function(key){return UniqueIDGeneretor.createID(key),null!=this.map[key]},HashMap.prototype.get=function(key){var theId=UniqueIDGeneretor.createID(key);return this.map[theId]},HashMap.prototype.keySet=function(){return this.keys},module2.exports=HashMap},function(module2,exports$12,__webpack_require__){var UniqueIDGeneretor=__webpack_require__(14);function HashSet(){this.set={}}HashSet.prototype.add=function(obj){var theId=UniqueIDGeneretor.createID(obj);this.contains(theId)||(this.set[theId]=obj)},HashSet.prototype.remove=function(obj){delete this.set[UniqueIDGeneretor.createID(obj)]},HashSet.prototype.clear=function(){this.set={}},HashSet.prototype.contains=function(obj){return this.set[UniqueIDGeneretor.createID(obj)]==obj},HashSet.prototype.isEmpty=function(){return 0===this.size()},HashSet.prototype.size=function(){return Object.keys(this.set).length},HashSet.prototype.addAllTo=function(list){for(var keys=Object.keys(this.set),length=keys.length,i=0;i<length;i++)list.push(this.set[keys[i]])},HashSet.prototype.size=function(){return Object.keys(this.set).length},HashSet.prototype.addAll=function(list){for(var s=list.length,i=0;i<s;i++){var v=list[i];this.add(v)}},module2.exports=HashSet},function(module2,exports$12,__webpack_require__){function Matrix(){}Matrix.multMat=function(array1,array2){for(var result=[],i=0;i<array1.length;i++){result[i]=[];for(var j=0;j<array2[0].length;j++){result[i][j]=0;for(var k=0;k<array1[0].length;k++)result[i][j]+=array1[i][k]*array2[k][j]}}return result},Matrix.transpose=function(array){for(var result=[],i=0;i<array[0].length;i++){result[i]=[];for(var j=0;j<array.length;j++)result[i][j]=array[j][i]}return result},Matrix.multCons=function(array,constant){for(var result=[],i=0;i<array.length;i++)result[i]=array[i]*constant;return result},Matrix.minusOp=function(array1,array2){for(var result=[],i=0;i<array1.length;i++)result[i]=array1[i]-array2[i];return result},Matrix.dotProduct=function(array1,array2){for(var product=0,i=0;i<array1.length;i++)product+=array1[i]*array2[i];return product},Matrix.mag=function(array){return Math.sqrt(this.dotProduct(array,array))},Matrix.normalize=function(array){for(var result=[],magnitude=this.mag(array),i=0;i<array.length;i++)result[i]=array[i]/magnitude;return result},Matrix.multGamma=function(array){for(var result=[],sum=0,i=0;i<array.length;i++)sum+=array[i];sum*=-1/array.length;for(var _i=0;_i<array.length;_i++)result[_i]=sum+array[_i];return result},Matrix.multL=function(array,C,INV){for(var result=[],temp1=[],temp2=[],i=0;i<C[0].length;i++){for(var sum=0,j=0;j<C.length;j++)sum+=-.5*C[j][i]*array[j];temp1[i]=sum}for(var _i2=0;_i2<INV.length;_i2++){for(var _sum=0,_j=0;_j<INV.length;_j++)_sum+=INV[_i2][_j]*temp1[_j];temp2[_i2]=_sum}for(var _i3=0;_i3<C.length;_i3++){for(var _sum2=0,_j2=0;_j2<C[0].length;_j2++)_sum2+=C[_i3][_j2]*temp2[_j2];result[_i3]=_sum2}return result},module2.exports=Matrix},function(module2,exports$12,__webpack_require__){var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),LinkedList=__webpack_require__(11),Quicksort=function(){function Quicksort2(A,compareFunction){!function(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Quicksort2),null===compareFunction&&void 0===compareFunction||(this.compareFunction=this._defaultCompareFunction);var length=void 0;length=A instanceof LinkedList?A.size():A.length,this._quicksort(A,0,length-1)}return _createClass(Quicksort2,[{key:"_quicksort",value:function(A,p,r){if(p<r){var q=this._partition(A,p,r);this._quicksort(A,p,q),this._quicksort(A,q+1,r)}}},{key:"_partition",value:function(A,p,r){for(var x=this._get(A,p),i=p,j=r;;){for(;this.compareFunction(x,this._get(A,j));)j--;for(;this.compareFunction(this._get(A,i),x);)i++;if(!(i<j))return j;this._swap(A,i,j),i++,j--}}},{key:"_get",value:function(object,index){return object instanceof LinkedList?object.get_object_at(index):object[index]}},{key:"_set",value:function(object,index,value){object instanceof LinkedList?object.set_object_at(index,value):object[index]=value}},{key:"_swap",value:function(A,i,j){var temp=this._get(A,i);this._set(A,i,this._get(A,j)),this._set(A,j,temp)}},{key:"_defaultCompareFunction",value:function(a,b){return b>a}}]),Quicksort2}();module2.exports=Quicksort},function(module2,exports$12,__webpack_require__){function SVD(){}SVD.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 nu=Math.min(this.m,this.n);this.s=function(s){for(var a=[];s-- >0;)a.push(0);return a}(Math.min(this.m+1,this.n)),this.U=function allocate2(dims2){if(0==dims2.length)return 0;for(var array=[],i2=0;i2<dims2[0];i2++)array.push(allocate2(dims2.slice(1)));return array}([this.m,nu]),this.V=function(dims){return function allocate2(dims2){if(0==dims2.length)return 0;for(var array=[],i2=0;i2<dims2[0];i2++)array.push(allocate2(dims2.slice(1)));return array}(dims)}([this.n,this.n]);for(var e=function(s){for(var a=[];s-- >0;)a.push(0);return a}(this.n),work=function(s){for(var a=[];s-- >0;)a.push(0);return a}(this.m),nct=Math.min(this.m-1,this.n),nrt=Math.max(0,Math.min(this.n-2,this.m)),k=0;k<Math.max(nct,nrt);k++){if(k<nct){this.s[k]=0;for(var i=k;i<this.m;i++)this.s[k]=SVD.hypot(this.s[k],A[i][k]);if(0!==this.s[k]){A[k][k]<0&&(this.s[k]=-this.s[k]);for(var _i=k;_i<this.m;_i++)A[_i][k]/=this.s[k];A[k][k]+=1}this.s[k]=-this.s[k]}for(var j=k+1;j<this.n;j++){if(function(lhs,rhs){return lhs&&rhs}(k<nct,0!==this.s[k])){for(var t=0,_i2=k;_i2<this.m;_i2++)t+=A[_i2][k]*A[_i2][j];t=-t/A[k][k];for(var _i3=k;_i3<this.m;_i3++)A[_i3][j]+=t*A[_i3][k]}e[j]=A[k][j]}if(function(lhs,rhs){return rhs}(0,k<nct))for(var _i4=k;_i4<this.m;_i4++)this.U[_i4][k]=A[_i4][k];if(k<nrt){e[k]=0;for(var _i5=k+1;_i5<this.n;_i5++)e[k]=SVD.hypot(e[k],e[_i5]);if(0!==e[k]){e[k+1]<0&&(e[k]=-e[k]);for(var _i6=k+1;_i6<this.n;_i6++)e[_i6]/=e[k];e[k+1]+=1}if(e[k]=-e[k],function(lhs,rhs){return lhs&&rhs}(k+1<this.m,0!==e[k])){for(var _i7=k+1;_i7<this.m;_i7++)work[_i7]=0;for(var _j=k+1;_j<this.n;_j++)for(var _i8=k+1;_i8<this.m;_i8++)work[_i8]+=e[_j]*A[_i8][_j];for(var _j2=k+1;_j2<this.n;_j2++)for(var _t=-e[_j2]/e[k+1],_i9=k+1;_i9<this.m;_i9++)A[_i9][_j2]+=_t*work[_i9]}for(var _i10=k+1;_i10<this.n;_i10++)this.V[_i10][k]=e[_i10]}}var p=Math.min(this.n,this.m+1);nct<this.n&&(this.s[nct]=A[nct][nct]),this.m<p&&(this.s[p-1]=0),nrt+1<p&&(e[nrt]=A[nrt][p-1]),e[p-1]=0;for(var _j3=nct;_j3<nu;_j3++){for(var _i11=0;_i11<this.m;_i11++)this.U[_i11][_j3]=0;this.U[_j3][_j3]=1}for(var _k=nct-1;_k>=0;_k--)if(0!==this.s[_k]){for(var _j4=_k+1;_j4<nu;_j4++){for(var _t2=0,_i12=_k;_i12<this.m;_i12++)_t2+=this.U[_i12][_k]*this.U[_i12][_j4];_t2=-_t2/this.U[_k][_k];for(var _i13=_k;_i13<this.m;_i13++)this.U[_i13][_j4]+=_t2*this.U[_i13][_k]}for(var _i14=_k;_i14<this.m;_i14++)this.U[_i14][_k]=-this.U[_i14][_k];this.U[_k][_k]=1+this.U[_k][_k];for(var _i15=0;_i15<_k-1;_i15++)this.U[_i15][_k]=0}else{for(var _i16=0;_i16<this.m;_i16++)this.U[_i16][_k]=0;this.U[_k][_k]=1}for(var _k2=this.n-1;_k2>=0;_k2--){if(function(lhs,rhs){return lhs&&rhs}(_k2<nrt,0!==e[_k2]))for(var _j5=_k2+1;_j5<nu;_j5++){for(var _t3=0,_i17=_k2+1;_i17<this.n;_i17++)_t3+=this.V[_i17][_k2]*this.V[_i17][_j5];_t3=-_t3/this.V[_k2+1][_k2];for(var _i18=_k2+1;_i18<this.n;_i18++)this.V[_i18][_j5]+=_t3*this.V[_i18][_k2]}for(var _i19=0;_i19<this.n;_i19++)this.V[_i19][_k2]=0;this.V[_k2][_k2]=1}for(var pp=p-1,eps=Math.pow(2,-52),tiny=Math.pow(2,-966);p>0;){var _k3=void 0,kase=void 0;for(_k3=p-2;_k3>=-1&&-1!==_k3;_k3--)if(Math.abs(e[_k3])<=tiny+eps*(Math.abs(this.s[_k3])+Math.abs(this.s[_k3+1]))){e[_k3]=0;break}if(_k3===p-2)kase=4;else{var ks=void 0;for(ks=p-1;ks>=_k3&&ks!==_k3;ks--){var _t4=(ks!==p?Math.abs(e[ks]):0)+(ks!==_k3+1?Math.abs(e[ks-1]):0);if(Math.abs(this.s[ks])<=tiny+eps*_t4){this.s[ks]=0;break}}ks===_k3?kase=3:ks===p-1?kase=1:(kase=2,_k3=ks)}switch(_k3++,kase){case 1:var f=e[p-2];e[p-2]=0;for(var _j6=p-2;_j6>=_k3;_j6--){var _t5=SVD.hypot(this.s[_j6],f),cs=this.s[_j6]/_t5,sn=f/_t5;this.s[_j6]=_t5,_j6!==_k3&&(f=-sn*e[_j6-1],e[_j6-1]=cs*e[_j6-1]);for(var _i20=0;_i20<this.n;_i20++)_t5=cs*this.V[_i20][_j6]+sn*this.V[_i20][p-1],this.V[_i20][p-1]=-sn*this.V[_i20][_j6]+cs*this.V[_i20][p-1],this.V[_i20][_j6]=_t5}break;case 2:var _f=e[_k3-1];e[_k3-1]=0;for(var _j7=_k3;_j7<p;_j7++){var _t6=SVD.hypot(this.s[_j7],_f),_cs=this.s[_j7]/_t6,_sn=_f/_t6;this.s[_j7]=_t6,_f=-_sn*e[_j7],e[_j7]=_cs*e[_j7];for(var _i21=0;_i21<this.m;_i21++)_t6=_cs*this.U[_i21][_j7]+_sn*this.U[_i21][_k3-1],this.U[_i21][_k3-1]=-_sn*this.U[_i21][_j7]+_cs*this.U[_i21][_k3-1],this.U[_i21][_j7]=_t6}break;case 3:var scale=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[p-1]),Math.abs(this.s[p-2])),Math.abs(e[p-2])),Math.abs(this.s[_k3])),Math.abs(e[_k3])),sp=this.s[p-1]/scale,spm1=this.s[p-2]/scale,epm1=e[p-2]/scale,sk=this.s[_k3]/scale,ek=e[_k3]/scale,b=((spm1+sp)*(spm1-sp)+epm1*epm1)/2,c=sp*epm1*(sp*epm1),shift=0;(function(lhs,rhs){return lhs||rhs})(0!==b,0!==c)&&(shift=Math.sqrt(b*b+c),b<0&&(shift=-shift),shift=c/(b+shift));for(var _f2=(sk+sp)*(sk-sp)+shift,g=sk*ek,_j8=_k3;_j8<p-1;_j8++){var _t7=SVD.hypot(_f2,g),_cs2=_f2/_t7,_sn2=g/_t7;_j8!==_k3&&(e[_j8-1]=_t7),_f2=_cs2*this.s[_j8]+_sn2*e[_j8],e[_j8]=_cs2*e[_j8]-_sn2*this.s[_j8],g=_sn2*this.s[_j8+1],this.s[_j8+1]=_cs2*this.s[_j8+1];for(var _i22=0;_i22<this.n;_i22++)_t7=_cs2*this.V[_i22][_j8]+_sn2*this.V[_i22][_j8+1],this.V[_i22][_j8+1]=-_sn2*this.V[_i22][_j8]+_cs2*this.V[_i22][_j8+1],this.V[_i22][_j8]=_t7;if(_cs2=_f2/(_t7=SVD.hypot(_f2,g)),_sn2=g/_t7,this.s[_j8]=_t7,_f2=_cs2*e[_j8]+_sn2*this.s[_j8+1],this.s[_j8+1]=-_sn2*e[_j8]+_cs2*this.s[_j8+1],g=_sn2*e[_j8+1],e[_j8+1]=_cs2*e[_j8+1],_j8<this.m-1)for(var _i23=0;_i23<this.m;_i23++)_t7=_cs2*this.U[_i23][_j8]+_sn2*this.U[_i23][_j8+1],this.U[_i23][_j8+1]=-_sn2*this.U[_i23][_j8]+_cs2*this.U[_i23][_j8+1],this.U[_i23][_j8]=_t7}e[p-2]=_f2;break;case 4:if(this.s[_k3]<=0){this.s[_k3]=this.s[_k3]<0?-this.s[_k3]:0;for(var _i24=0;_i24<=pp;_i24++)this.V[_i24][_k3]=-this.V[_i24][_k3]}for(;_k3<pp&&!(this.s[_k3]>=this.s[_k3+1]);){var _t8=this.s[_k3];if(this.s[_k3]=this.s[_k3+1],this.s[_k3+1]=_t8,_k3<this.n-1)for(var _i25=0;_i25<this.n;_i25++)_t8=this.V[_i25][_k3+1],this.V[_i25][_k3+1]=this.V[_i25][_k3],this.V[_i25][_k3]=_t8;if(_k3<this.m-1)for(var _i26=0;_i26<this.m;_i26++)_t8=this.U[_i26][_k3+1],this.U[_i26][_k3+1]=this.U[_i26][_k3],this.U[_i26][_k3]=_t8;_k3++}p--}}return{U:this.U,V:this.V,S:this.s}},SVD.hypot=function(a,b){var r=void 0;return Math.abs(a)>Math.abs(b)?(r=b/a,r=Math.abs(a)*Math.sqrt(1+r*r)):0!=b?(r=a/b,r=Math.abs(b)*Math.sqrt(1+r*r)):r=0,r},module2.exports=SVD},function(module2,exports$12,__webpack_require__){var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),NeedlemanWunsch=function(){function NeedlemanWunsch2(sequence1,sequence2){var match_score=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,mismatch_penalty=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,gap_penalty=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,NeedlemanWunsch2),this.sequence1=sequence1,this.sequence2=sequence2,this.match_score=match_score,this.mismatch_penalty=mismatch_penalty,this.gap_penalty=gap_penalty,this.iMax=sequence1.length+1,this.jMax=sequence2.length+1,this.grid=new Array(this.iMax);for(var i=0;i<this.iMax;i++){this.grid[i]=new Array(this.jMax);for(var j=0;j<this.jMax;j++)this.grid[i][j]=0}this.tracebackGrid=new Array(this.iMax);for(var _i=0;_i<this.iMax;_i++){this.tracebackGrid[_i]=new Array(this.jMax);for(var _j=0;_j<this.jMax;_j++)this.tracebackGrid[_i][_j]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return _createClass(NeedlemanWunsch2,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var j=1;j<this.jMax;j++)this.grid[0][j]=this.grid[0][j-1]+this.gap_penalty,this.tracebackGrid[0][j]=[!1,!1,!0];for(var i=1;i<this.iMax;i++)this.grid[i][0]=this.grid[i-1][0]+this.gap_penalty,this.tracebackGrid[i][0]=[!1,!0,!1];for(var _i2=1;_i2<this.iMax;_i2++)for(var _j2=1;_j2<this.jMax;_j2++){var maxOf=[this.sequence1[_i2-1]===this.sequence2[_j2-1]?this.grid[_i2-1][_j2-1]+this.match_score:this.grid[_i2-1][_j2-1]+this.mismatch_penalty,this.grid[_i2-1][_j2]+this.gap_penalty,this.grid[_i2][_j2-1]+this.gap_penalty],indices=this.arrayAllMaxIndexes(maxOf);this.grid[_i2][_j2]=maxOf[indices[0]],this.tracebackGrid[_i2][_j2]=[indices.includes(0),indices.includes(1),indices.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var inProcessAlignments=[];for(inProcessAlignments.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});inProcessAlignments[0];){var current=inProcessAlignments[0],directions=this.tracebackGrid[current.pos[0]][current.pos[1]];directions[0]&&inProcessAlignments.push({pos:[current.pos[0]-1,current.pos[1]-1],seq1:this.sequence1[current.pos[0]-1]+current.seq1,seq2:this.sequence2[current.pos[1]-1]+current.seq2}),directions[1]&&inProcessAlignments.push({pos:[current.pos[0]-1,current.pos[1]],seq1:this.sequence1[current.pos[0]-1]+current.seq1,seq2:"-"+current.seq2}),directions[2]&&inProcessAlignments.push({pos:[current.pos[0],current.pos[1]-1],seq1:"-"+current.seq1,seq2:this.sequence2[current.pos[1]-1]+current.seq2}),0===current.pos[0]&&0===current.pos[1]&&this.alignments.push({sequence1:current.seq1,sequence2:current.seq2}),inProcessAlignments.shift()}return this.alignments}},{key:"getAllIndexes",value:function(arr,val){for(var indexes=[],i=-1;-1!==(i=arr.indexOf(val,i+1));)indexes.push(i);return indexes}},{key:"arrayAllMaxIndexes",value:function(array){return this.getAllIndexes(array,Math.max.apply(null,array))}}]),NeedlemanWunsch2}();module2.exports=NeedlemanWunsch},function(module2,exports$12,__webpack_require__){var layoutBase2=function(){};layoutBase2.FDLayout=__webpack_require__(18),layoutBase2.FDLayoutConstants=__webpack_require__(4),layoutBase2.FDLayoutEdge=__webpack_require__(19),layoutBase2.FDLayoutNode=__webpack_require__(20),layoutBase2.DimensionD=__webpack_require__(21),layoutBase2.HashMap=__webpack_require__(22),layoutBase2.HashSet=__webpack_require__(23),layoutBase2.IGeometry=__webpack_require__(8),layoutBase2.IMath=__webpack_require__(9),layoutBase2.Integer=__webpack_require__(10),layoutBase2.Point=__webpack_require__(12),layoutBase2.PointD=__webpack_require__(5),layoutBase2.RandomSeed=__webpack_require__(16),layoutBase2.RectangleD=__webpack_require__(13),layoutBase2.Transform=__webpack_require__(17),layoutBase2.UniqueIDGeneretor=__webpack_require__(14),layoutBase2.Quicksort=__webpack_require__(25),layoutBase2.LinkedList=__webpack_require__(11),layoutBase2.LGraphObject=__webpack_require__(2),layoutBase2.LGraph=__webpack_require__(6),layoutBase2.LEdge=__webpack_require__(1),layoutBase2.LGraphManager=__webpack_require__(7),layoutBase2.LNode=__webpack_require__(3),layoutBase2.Layout=__webpack_require__(15),layoutBase2.LayoutConstants=__webpack_require__(0),layoutBase2.NeedlemanWunsch=__webpack_require__(27),layoutBase2.Matrix=__webpack_require__(24),layoutBase2.SVD=__webpack_require__(26),module2.exports=layoutBase2},function(module2,exports$12,__webpack_require__){function Emitter(){this.listeners=[]}var p=Emitter.prototype;p.addListener=function(event,callback){this.listeners.push({event:event,callback:callback})},p.removeListener=function(event,callback){for(var i=this.listeners.length;i>=0;i--){var l=this.listeners[i];l.event===event&&l.callback===callback&&this.listeners.splice(i,1)}},p.emit=function(event,data){for(var i=0;i<this.listeners.length;i++){var l=this.listeners[i];event===l.event&&l.callback(data)}},module2.exports=Emitter}])},layoutBase$1.exports=factory());var factory}var hasRequiredCoseBase;function requireCoseBase(){return hasRequiredCoseBase?coseBase$1.exports:(hasRequiredCoseBase=1,factory=function(__WEBPACK_EXTERNAL_MODULE__551__){return __webpack_modules__={45:(module2,__unused_webpack_exports,__webpack_require__2)=>{var coseBase2={};coseBase2.layoutBase=__webpack_require__2(551),coseBase2.CoSEConstants=__webpack_require__2(806),coseBase2.CoSEEdge=__webpack_require__2(767),coseBase2.CoSEGraph=__webpack_require__2(880),coseBase2.CoSEGraphManager=__webpack_require__2(578),coseBase2.CoSELayout=__webpack_require__2(765),coseBase2.CoSENode=__webpack_require__2(991),coseBase2.ConstraintHandler=__webpack_require__2(902),module2.exports=coseBase2},806:(module2,__unused_webpack_exports,__webpack_require__2)=>{var FDLayoutConstants=__webpack_require__2(551).FDLayoutConstants;function CoSEConstants(){}for(var prop in FDLayoutConstants)CoSEConstants[prop]=FDLayoutConstants[prop];CoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,CoSEConstants.DEFAULT_RADIAL_SEPARATION=FDLayoutConstants.DEFAULT_EDGE_LENGTH,CoSEConstants.DEFAULT_COMPONENT_SEPERATION=60,CoSEConstants.TILE=!0,CoSEConstants.TILING_PADDING_VERTICAL=10,CoSEConstants.TILING_PADDING_HORIZONTAL=10,CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,CoSEConstants.ENFORCE_CONSTRAINTS=!0,CoSEConstants.APPLY_LAYOUT=!0,CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL=!0,CoSEConstants.PURE_INCREMENTAL=CoSEConstants.DEFAULT_INCREMENTAL,module2.exports=CoSEConstants},767:(module2,__unused_webpack_exports,__webpack_require__2)=>{var FDLayoutEdge=__webpack_require__2(551).FDLayoutEdge;function CoSEEdge(source,target,vEdge){FDLayoutEdge.call(this,source,target,vEdge)}for(var prop in CoSEEdge.prototype=Object.create(FDLayoutEdge.prototype),FDLayoutEdge)CoSEEdge[prop]=FDLayoutEdge[prop];module2.exports=CoSEEdge},880:(module2,__unused_webpack_exports,__webpack_require__2)=>{var LGraph=__webpack_require__2(551).LGraph;function CoSEGraph(parent,graphMgr,vGraph){LGraph.call(this,parent,graphMgr,vGraph)}for(var prop in CoSEGraph.prototype=Object.create(LGraph.prototype),LGraph)CoSEGraph[prop]=LGraph[prop];module2.exports=CoSEGraph},578:(module2,__unused_webpack_exports,__webpack_require__2)=>{var LGraphManager=__webpack_require__2(551).LGraphManager;function CoSEGraphManager(layout){LGraphManager.call(this,layout)}for(var prop in CoSEGraphManager.prototype=Object.create(LGraphManager.prototype),LGraphManager)CoSEGraphManager[prop]=LGraphManager[prop];module2.exports=CoSEGraphManager},765:(module2,__unused_webpack_exports,__webpack_require__2)=>{var FDLayout=__webpack_require__2(551).FDLayout,CoSEGraphManager=__webpack_require__2(578),CoSEGraph=__webpack_require__2(880),CoSENode=__webpack_require__2(991),CoSEEdge=__webpack_require__2(767),CoSEConstants=__webpack_require__2(806),ConstraintHandler=__webpack_require__2(902),FDLayoutConstants=__webpack_require__2(551).FDLayoutConstants,LayoutConstants=__webpack_require__2(551).LayoutConstants,Point2=__webpack_require__2(551).Point,PointD=__webpack_require__2(551).PointD,DimensionD2=__webpack_require__2(551).DimensionD,Layout2=__webpack_require__2(551).Layout,Integer=__webpack_require__2(551).Integer,IGeometry=__webpack_require__2(551).IGeometry,LGraph=__webpack_require__2(551).LGraph,Transform=__webpack_require__2(551).Transform,LinkedList=__webpack_require__2(551).LinkedList;function CoSELayout(){FDLayout.call(this),this.toBeTiled={},this.constraints={}}for(var prop in CoSELayout.prototype=Object.create(FDLayout.prototype),FDLayout)CoSELayout[prop]=FDLayout[prop];CoSELayout.prototype.newGraphManager=function(){var gm=new CoSEGraphManager(this);return this.graphManager=gm,gm},CoSELayout.prototype.newGraph=function(vGraph){return new CoSEGraph(null,this.graphManager,vGraph)},CoSELayout.prototype.newNode=function(vNode){return new CoSENode(this.graphManager,vNode)},CoSELayout.prototype.newEdge=function(vEdge){return new CoSEEdge(null,null,vEdge)},CoSELayout.prototype.initParameters=function(){FDLayout.prototype.initParameters.call(this,arguments),this.isSubLayout||(CoSEConstants.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=CoSEConstants.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},CoSELayout.prototype.initSpringEmbedder=function(){FDLayout.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/FDLayoutConstants.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},CoSELayout.prototype.layout=function(){return LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},CoSELayout.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)CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),allNodes=new Set(this.getAllNodes()),intersection=this.nodesWithGravity.filter(function(x){return allNodes.has(x)}),this.graphManager.setAllNodesToApplyGravitation(intersection));else{var forest=this.getFlatForest();if(forest.length>0)this.positionNodesRadially(forest);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var allNodes=new Set(this.getAllNodes()),intersection=this.nodesWithGravity.filter(function(x){return allNodes.has(x)});this.graphManager.setAllNodesToApplyGravitation(intersection),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(ConstraintHandler.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),CoSEConstants.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},CoSELayout.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%FDLayoutConstants.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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 allNodes=new Set(this.getAllNodes()),intersection=this.nodesWithGravity.filter(function(x){return allNodes.has(x)});this.graphManager.setAllNodesToApplyGravitation(intersection),this.graphManager.updateBounds(),this.updateGrid(),CoSEConstants.PURE_INCREMENTAL?this.coolingFactor=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=FDLayoutConstants.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()),CoSEConstants.PURE_INCREMENTAL?this.coolingFactor=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var gridUpdateAllowed=!this.isTreeGrowing&&!this.isGrowthFinished,forceToNodeSurroundingUpdate=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(gridUpdateAllowed,forceToNodeSurroundingUpdate),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},CoSELayout.prototype.getPositionsData=function(){for(var allNodes=this.graphManager.getAllNodes(),pData={},i=0;i<allNodes.length;i++){var rect=allNodes[i].rect,id=allNodes[i].id;pData[id]={id:id,x:rect.getCenterX(),y:rect.getCenterY(),w:rect.width,h:rect.height}}return pData},CoSELayout.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var layoutEnded=!1;if("during"===FDLayoutConstants.ANIMATE)this.emit("layoutstarted");else{for(;!layoutEnded;)layoutEnded=this.tick();this.graphManager.updateBounds()}},CoSELayout.prototype.moveNodes=function(){for(var lNodes=this.getAllNodes(),i=0;i<lNodes.length;i++)lNodes[i].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),i=0;i<lNodes.length;i++)lNodes[i].move()},CoSELayout.prototype.initConstraintVariables=function(){var self=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var allNodes=this.graphManager.getAllNodes(),i=0;i<allNodes.length;i++){var node=allNodes[i];this.idToNodeMap.set(node.id,node)}var calculateCompoundWeight=function calculateCompoundWeight2(compoundNode){for(var node2,nodes=compoundNode.getChild().getNodes(),fixedNodeWeight2=0,i2=0;i2<nodes.length;i2++)null==(node2=nodes[i2]).getChild()?self.fixedNodeSet.has(node2.id)&&(fixedNodeWeight2+=100):fixedNodeWeight2+=calculateCompoundWeight2(node2);return fixedNodeWeight2};if(this.constraints.fixedNodeConstraint)for(this.constraints.fixedNodeConstraint.forEach(function(nodeData2){self.fixedNodeSet.add(nodeData2.nodeId)}),allNodes=this.graphManager.getAllNodes(),i=0;i<allNodes.length;i++)if(null!=(node=allNodes[i]).getChild()){var fixedNodeWeight=calculateCompoundWeight(node);fixedNodeWeight>0&&(node.fixedNodeWeight=fixedNodeWeight)}if(this.constraints.relativePlacementConstraint){var nodeToDummyForVerticalAlignment=new Map,nodeToDummyForHorizontalAlignment=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(nodeId){self.fixedNodesOnHorizontal.add(nodeId),self.fixedNodesOnVertical.add(nodeId)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var verticalAlignment=this.constraints.alignmentConstraint.vertical;for(i=0;i<verticalAlignment.length;i++)this.dummyToNodeForVerticalAlignment.set("dummy"+i,[]),verticalAlignment[i].forEach(function(nodeId){nodeToDummyForVerticalAlignment.set(nodeId,"dummy"+i),self.dummyToNodeForVerticalAlignment.get("dummy"+i).push(nodeId),self.fixedNodeSet.has(nodeId)&&self.fixedNodesOnHorizontal.add("dummy"+i)})}if(this.constraints.alignmentConstraint.horizontal){var horizontalAlignment=this.constraints.alignmentConstraint.horizontal;for(i=0;i<horizontalAlignment.length;i++)this.dummyToNodeForHorizontalAlignment.set("dummy"+i,[]),horizontalAlignment[i].forEach(function(nodeId){nodeToDummyForHorizontalAlignment.set(nodeId,"dummy"+i),self.dummyToNodeForHorizontalAlignment.get("dummy"+i).push(nodeId),self.fixedNodeSet.has(nodeId)&&self.fixedNodesOnVertical.add("dummy"+i)})}}if(CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(array){var j,x,i2;for(i2=array.length-1;i2>=2*array.length/3;i2--)j=Math.floor(Math.random()*(i2+1)),x=array[i2],array[i2]=array[j],array[j]=x;return array},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(constraint){if(constraint.left){var nodeIdLeft=nodeToDummyForVerticalAlignment.has(constraint.left)?nodeToDummyForVerticalAlignment.get(constraint.left):constraint.left,nodeIdRight=nodeToDummyForVerticalAlignment.has(constraint.right)?nodeToDummyForVerticalAlignment.get(constraint.right):constraint.right;self.nodesInRelativeHorizontal.includes(nodeIdLeft)||(self.nodesInRelativeHorizontal.push(nodeIdLeft),self.nodeToRelativeConstraintMapHorizontal.set(nodeIdLeft,[]),self.dummyToNodeForVerticalAlignment.has(nodeIdLeft)?self.nodeToTempPositionMapHorizontal.set(nodeIdLeft,self.idToNodeMap.get(self.dummyToNodeForVerticalAlignment.get(nodeIdLeft)[0]).getCenterX()):self.nodeToTempPositionMapHorizontal.set(nodeIdLeft,self.idToNodeMap.get(nodeIdLeft).getCenterX())),self.nodesInRelativeHorizontal.includes(nodeIdRight)||(self.nodesInRelativeHorizontal.push(nodeIdRight),self.nodeToRelativeConstraintMapHorizontal.set(nodeIdRight,[]),self.dummyToNodeForVerticalAlignment.has(nodeIdRight)?self.nodeToTempPositionMapHorizontal.set(nodeIdRight,self.idToNodeMap.get(self.dummyToNodeForVerticalAlignment.get(nodeIdRight)[0]).getCenterX()):self.nodeToTempPositionMapHorizontal.set(nodeIdRight,self.idToNodeMap.get(nodeIdRight).getCenterX())),self.nodeToRelativeConstraintMapHorizontal.get(nodeIdLeft).push({right:nodeIdRight,gap:constraint.gap}),self.nodeToRelativeConstraintMapHorizontal.get(nodeIdRight).push({left:nodeIdLeft,gap:constraint.gap})}else{var nodeIdTop=nodeToDummyForHorizontalAlignment.has(constraint.top)?nodeToDummyForHorizontalAlignment.get(constraint.top):constraint.top,nodeIdBottom=nodeToDummyForHorizontalAlignment.has(constraint.bottom)?nodeToDummyForHorizontalAlignment.get(constraint.bottom):constraint.bottom;self.nodesInRelativeVertical.includes(nodeIdTop)||(self.nodesInRelativeVertical.push(nodeIdTop),self.nodeToRelativeConstraintMapVertical.set(nodeIdTop,[]),self.dummyToNodeForHorizontalAlignment.has(nodeIdTop)?self.nodeToTempPositionMapVertical.set(nodeIdTop,self.idToNodeMap.get(self.dummyToNodeForHorizontalAlignment.get(nodeIdTop)[0]).getCenterY()):self.nodeToTempPositionMapVertical.set(nodeIdTop,self.idToNodeMap.get(nodeIdTop).getCenterY())),self.nodesInRelativeVertical.includes(nodeIdBottom)||(self.nodesInRelativeVertical.push(nodeIdBottom),self.nodeToRelativeConstraintMapVertical.set(nodeIdBottom,[]),self.dummyToNodeForHorizontalAlignment.has(nodeIdBottom)?self.nodeToTempPositionMapVertical.set(nodeIdBottom,self.idToNodeMap.get(self.dummyToNodeForHorizontalAlignment.get(nodeIdBottom)[0]).getCenterY()):self.nodeToTempPositionMapVertical.set(nodeIdBottom,self.idToNodeMap.get(nodeIdBottom).getCenterY())),self.nodeToRelativeConstraintMapVertical.get(nodeIdTop).push({bottom:nodeIdBottom,gap:constraint.gap}),self.nodeToRelativeConstraintMapVertical.get(nodeIdBottom).push({top:nodeIdTop,gap:constraint.gap})}});else{var subGraphOnHorizontal=new Map,subGraphOnVertical=new Map;this.constraints.relativePlacementConstraint.forEach(function(constraint){if(constraint.left){var left=nodeToDummyForVerticalAlignment.has(constraint.left)?nodeToDummyForVerticalAlignment.get(constraint.left):constraint.left,right=nodeToDummyForVerticalAlignment.has(constraint.right)?nodeToDummyForVerticalAlignment.get(constraint.right):constraint.right;subGraphOnHorizontal.has(left)?subGraphOnHorizontal.get(left).push(right):subGraphOnHorizontal.set(left,[right]),subGraphOnHorizontal.has(right)?subGraphOnHorizontal.get(right).push(left):subGraphOnHorizontal.set(right,[left])}else{var top=nodeToDummyForHorizontalAlignment.has(constraint.top)?nodeToDummyForHorizontalAlignment.get(constraint.top):constraint.top,bottom=nodeToDummyForHorizontalAlignment.has(constraint.bottom)?nodeToDummyForHorizontalAlignment.get(constraint.bottom):constraint.bottom;subGraphOnVertical.has(top)?subGraphOnVertical.get(top).push(bottom):subGraphOnVertical.set(top,[bottom]),subGraphOnVertical.has(bottom)?subGraphOnVertical.get(bottom).push(top):subGraphOnVertical.set(bottom,[top])}});var constructComponents=function(graph,fixedNodes){var components=[],isFixed=[],queue=new LinkedList,visited=new Set,count=0;return graph.forEach(function(value,key){if(!visited.has(key)){components[count]=[],isFixed[count]=!1;var currentNode=key;for(queue.push(currentNode),visited.add(currentNode),components[count].push(currentNode);0!=queue.length;)currentNode=queue.shift(),fixedNodes.has(currentNode)&&(isFixed[count]=!0),graph.get(currentNode).forEach(function(neighbor){visited.has(neighbor)||(queue.push(neighbor),visited.add(neighbor),components[count].push(neighbor))});count++}}),{components:components,isFixed:isFixed}},resultOnHorizontal=constructComponents(subGraphOnHorizontal,self.fixedNodesOnHorizontal);this.componentsOnHorizontal=resultOnHorizontal.components,this.fixedComponentsOnHorizontal=resultOnHorizontal.isFixed;var resultOnVertical=constructComponents(subGraphOnVertical,self.fixedNodesOnVertical);this.componentsOnVertical=resultOnVertical.components,this.fixedComponentsOnVertical=resultOnVertical.isFixed}}},CoSELayout.prototype.updateDisplacements=function(){var self=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(nodeData2){var fixedNode=self.idToNodeMap.get(nodeData2.nodeId);fixedNode.displacementX=0,fixedNode.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var allVerticalAlignments=this.constraints.alignmentConstraint.vertical,i=0;i<allVerticalAlignments.length;i++){for(var totalDisplacementX=0,j=0;j<allVerticalAlignments[i].length;j++){if(this.fixedNodeSet.has(allVerticalAlignments[i][j])){totalDisplacementX=0;break}totalDisplacementX+=this.idToNodeMap.get(allVerticalAlignments[i][j]).displacementX}var averageDisplacementX=totalDisplacementX/allVerticalAlignments[i].length;for(j=0;j<allVerticalAlignments[i].length;j++)this.idToNodeMap.get(allVerticalAlignments[i][j]).displacementX=averageDisplacementX}if(this.constraints.alignmentConstraint.horizontal){var allHorizontalAlignments=this.constraints.alignmentConstraint.horizontal;for(i=0;i<allHorizontalAlignments.length;i++){var totalDisplacementY=0;for(j=0;j<allHorizontalAlignments[i].length;j++){if(this.fixedNodeSet.has(allHorizontalAlignments[i][j])){totalDisplacementY=0;break}totalDisplacementY+=this.idToNodeMap.get(allHorizontalAlignments[i][j]).displacementY}var averageDisplacementY=totalDisplacementY/allHorizontalAlignments[i].length;for(j=0;j<allHorizontalAlignments[i].length;j++)this.idToNodeMap.get(allHorizontalAlignments[i][j]).displacementY=averageDisplacementY}}}if(this.constraints.relativePlacementConstraint)if(CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(nodeId){if(!self.fixedNodesOnHorizontal.has(nodeId)){var displacement=0;displacement=self.dummyToNodeForVerticalAlignment.has(nodeId)?self.idToNodeMap.get(self.dummyToNodeForVerticalAlignment.get(nodeId)[0]).displacementX:self.idToNodeMap.get(nodeId).displacementX,self.nodeToRelativeConstraintMapHorizontal.get(nodeId).forEach(function(constraint){var diff;constraint.right?(diff=self.nodeToTempPositionMapHorizontal.get(constraint.right)-self.nodeToTempPositionMapHorizontal.get(nodeId)-displacement)<constraint.gap&&(displacement-=constraint.gap-diff):(diff=self.nodeToTempPositionMapHorizontal.get(nodeId)-self.nodeToTempPositionMapHorizontal.get(constraint.left)+displacement)<constraint.gap&&(displacement+=constraint.gap-diff)}),self.nodeToTempPositionMapHorizontal.set(nodeId,self.nodeToTempPositionMapHorizontal.get(nodeId)+displacement),self.dummyToNodeForVerticalAlignment.has(nodeId)?self.dummyToNodeForVerticalAlignment.get(nodeId).forEach(function(nodeId2){self.idToNodeMap.get(nodeId2).displacementX=displacement}):self.idToNodeMap.get(nodeId).displacementX=displacement}}),this.nodesInRelativeVertical.forEach(function(nodeId){if(!self.fixedNodesOnHorizontal.has(nodeId)){var displacement=0;displacement=self.dummyToNodeForHorizontalAlignment.has(nodeId)?self.idToNodeMap.get(self.dummyToNodeForHorizontalAlignment.get(nodeId)[0]).displacementY:self.idToNodeMap.get(nodeId).displacementY,self.nodeToRelativeConstraintMapVertical.get(nodeId).forEach(function(constraint){var diff;constraint.bottom?(diff=self.nodeToTempPositionMapVertical.get(constraint.bottom)-self.nodeToTempPositionMapVertical.get(nodeId)-displacement)<constraint.gap&&(displacement-=constraint.gap-diff):(diff=self.nodeToTempPositionMapVertical.get(nodeId)-self.nodeToTempPositionMapVertical.get(constraint.top)+displacement)<constraint.gap&&(displacement+=constraint.gap-diff)}),self.nodeToTempPositionMapVertical.set(nodeId,self.nodeToTempPositionMapVertical.get(nodeId)+displacement),self.dummyToNodeForHorizontalAlignment.has(nodeId)?self.dummyToNodeForHorizontalAlignment.get(nodeId).forEach(function(nodeId2){self.idToNodeMap.get(nodeId2).displacementY=displacement}):self.idToNodeMap.get(nodeId).displacementY=displacement}});else{for(i=0;i<this.componentsOnHorizontal.length;i++){var component=this.componentsOnHorizontal[i];if(this.fixedComponentsOnHorizontal[i])for(j=0;j<component.length;j++)this.dummyToNodeForVerticalAlignment.has(component[j])?this.dummyToNodeForVerticalAlignment.get(component[j]).forEach(function(nodeId){self.idToNodeMap.get(nodeId).displacementX=0}):this.idToNodeMap.get(component[j]).displacementX=0;else{var sum=0,count=0;for(j=0;j<component.length;j++)this.dummyToNodeForVerticalAlignment.has(component[j])?(sum+=(actualNodes=this.dummyToNodeForVerticalAlignment.get(component[j])).length*this.idToNodeMap.get(actualNodes[0]).displacementX,count+=actualNodes.length):(sum+=this.idToNodeMap.get(component[j]).displacementX,count++);var averageDisplacement=sum/count;for(j=0;j<component.length;j++)this.dummyToNodeForVerticalAlignment.has(component[j])?this.dummyToNodeForVerticalAlignment.get(component[j]).forEach(function(nodeId){self.idToNodeMap.get(nodeId).displacementX=averageDisplacement}):this.idToNodeMap.get(component[j]).displacementX=averageDisplacement}}for(i=0;i<this.componentsOnVertical.length;i++)if(component=this.componentsOnVertical[i],this.fixedComponentsOnVertical[i])for(j=0;j<component.length;j++)this.dummyToNodeForHorizontalAlignment.has(component[j])?this.dummyToNodeForHorizontalAlignment.get(component[j]).forEach(function(nodeId){self.idToNodeMap.get(nodeId).displacementY=0}):this.idToNodeMap.get(component[j]).displacementY=0;else{for(sum=0,count=0,j=0;j<component.length;j++){var actualNodes;this.dummyToNodeForHorizontalAlignment.has(component[j])?(sum+=(actualNodes=this.dummyToNodeForHorizontalAlignment.get(component[j])).length*this.idToNodeMap.get(actualNodes[0]).displacementY,count+=actualNodes.length):(sum+=this.idToNodeMap.get(component[j]).displacementY,count++)}for(averageDisplacement=sum/count,j=0;j<component.length;j++)this.dummyToNodeForHorizontalAlignment.has(component[j])?this.dummyToNodeForHorizontalAlignment.get(component[j]).forEach(function(nodeId){self.idToNodeMap.get(nodeId).displacementY=averageDisplacement}):this.idToNodeMap.get(component[j]).displacementY=averageDisplacement}}},CoSELayout.prototype.calculateNodesToApplyGravitationTo=function(){var graph,i,nodeList=[],graphs=this.graphManager.getGraphs(),size=graphs.length;for(i=0;i<size;i++)(graph=graphs[i]).updateConnected(),graph.isConnected||(nodeList=nodeList.concat(graph.getNodes()));return nodeList},CoSELayout.prototype.createBendpoints=function(){var edges=[];edges=edges.concat(this.graphManager.getAllEdges());var i,visited=new Set;for(i=0;i<edges.length;i++){var edge=edges[i];if(!visited.has(edge)){var source=edge.getSource(),target=edge.getTarget();if(source==target)edge.getBendpoints().push(new PointD),edge.getBendpoints().push(new PointD),this.createDummyNodesForBendpoints(edge),visited.add(edge);else{var edgeList=[];if(edgeList=(edgeList=edgeList.concat(source.getEdgeListToNode(target))).concat(target.getEdgeListToNode(source)),!visited.has(edgeList[0])){var k;if(edgeList.length>1)for(k=0;k<edgeList.length;k++){var multiEdge=edgeList[k];multiEdge.getBendpoints().push(new PointD),this.createDummyNodesForBendpoints(multiEdge)}edgeList.forEach(function(edge2){visited.add(edge2)})}}}if(visited.size==edges.length)break}},CoSELayout.prototype.positionNodesRadially=function(forest){for(var currentStartingPoint=new Point2(0,0),numberOfColumns=Math.ceil(Math.sqrt(forest.length)),height=0,currentY=0,currentX=0,point=new PointD(0,0),i=0;i<forest.length;i++){i%numberOfColumns==0&&(currentX=0,currentY=height,0!=i&&(currentY+=CoSEConstants.DEFAULT_COMPONENT_SEPERATION),height=0);var tree=forest[i],centerNode=Layout2.findCenterOfTree(tree);currentStartingPoint.x=currentX,currentStartingPoint.y=currentY,(point=CoSELayout.radialLayout(tree,centerNode,currentStartingPoint)).y>height&&(height=Math.floor(point.y)),currentX=Math.floor(point.x+CoSEConstants.DEFAULT_COMPONENT_SEPERATION)}this.transform(new PointD(LayoutConstants.WORLD_CENTER_X-point.x/2,LayoutConstants.WORLD_CENTER_Y-point.y/2))},CoSELayout.radialLayout=function(tree,centerNode,startingPoint){var radialSep=Math.max(this.maxDiagonalInTree(tree),CoSEConstants.DEFAULT_RADIAL_SEPARATION);CoSELayout.branchRadialLayout(centerNode,null,0,359,0,radialSep);var bounds=LGraph.calculateBounds(tree),transform=new Transform;transform.setDeviceOrgX(bounds.getMinX()),transform.setDeviceOrgY(bounds.getMinY()),transform.setWorldOrgX(startingPoint.x),transform.setWorldOrgY(startingPoint.y);for(var i=0;i<tree.length;i++)tree[i].transform(transform);var bottomRight=new PointD(bounds.getMaxX(),bounds.getMaxY());return transform.inverseTransformPoint(bottomRight)},CoSELayout.branchRadialLayout=function(node,parentOfNode,startAngle,endAngle,distance,radialSeparation){var halfInterval=(endAngle-startAngle+1)/2;halfInterval<0&&(halfInterval+=180);var teta=(halfInterval+startAngle)%360*IGeometry.TWO_PI/360,x_=distance*Math.cos(teta),y_=distance*Math.sin(teta);node.setCenter(x_,y_);var neighborEdges=[],childCount=(neighborEdges=neighborEdges.concat(node.getEdges())).length;null!=parentOfNode&&childCount--;for(var startIndex,branchCount=0,incEdgesCount=neighborEdges.length,edges=node.getEdgesBetween(parentOfNode);edges.length>1;){var temp=edges[0];edges.splice(0,1);var index=neighborEdges.indexOf(temp);index>=0&&neighborEdges.splice(index,1),incEdgesCount--,childCount--}startIndex=null!=parentOfNode?(neighborEdges.indexOf(edges[0])+1)%incEdgesCount:0;for(var stepAngle=Math.abs(endAngle-startAngle)/childCount,i=startIndex;branchCount!=childCount;i=++i%incEdgesCount){var currentNeighbor=neighborEdges[i].getOtherEnd(node);if(currentNeighbor!=parentOfNode){var childStartAngle=(startAngle+branchCount*stepAngle)%360,childEndAngle=(childStartAngle+stepAngle)%360;CoSELayout.branchRadialLayout(currentNeighbor,node,childStartAngle,childEndAngle,distance+radialSeparation,radialSeparation),branchCount++}}},CoSELayout.maxDiagonalInTree=function(tree){for(var maxDiagonal=Integer.MIN_VALUE,i=0;i<tree.length;i++){var diagonal=tree[i].getDiagonal();diagonal>maxDiagonal&&(maxDiagonal=diagonal)}return maxDiagonal},CoSELayout.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},CoSELayout.prototype.groupZeroDegreeMembers=function(){var self=this,tempMemberGroups={};this.memberGroups={},this.idToDummyNode={};for(var zeroDegree=[],allNodes=this.graphManager.getAllNodes(),i=0;i<allNodes.length;i++){var parent=(node=allNodes[i]).getParent();0!==this.getNodeDegreeWithChildren(node)||null!=parent.id&&this.getToBeTiled(parent)||zeroDegree.push(node)}for(i=0;i<zeroDegree.length;i++){var node,p_id=(node=zeroDegree[i]).getParent().id;void 0===tempMemberGroups[p_id]&&(tempMemberGroups[p_id]=[]),tempMemberGroups[p_id]=tempMemberGroups[p_id].concat(node)}Object.keys(tempMemberGroups).forEach(function(p_id2){if(tempMemberGroups[p_id2].length>1){var dummyCompoundId="DummyCompound_"+p_id2;self.memberGroups[dummyCompoundId]=tempMemberGroups[p_id2];var parent2=tempMemberGroups[p_id2][0].getParent(),dummyCompound=new CoSENode(self.graphManager);dummyCompound.id=dummyCompoundId,dummyCompound.paddingLeft=parent2.paddingLeft||0,dummyCompound.paddingRight=parent2.paddingRight||0,dummyCompound.paddingBottom=parent2.paddingBottom||0,dummyCompound.paddingTop=parent2.paddingTop||0,self.idToDummyNode[dummyCompoundId]=dummyCompound;var dummyParentGraph=self.getGraphManager().add(self.newGraph(),dummyCompound),parentGraph=parent2.getChild();parentGraph.add(dummyCompound);for(var i2=0;i2<tempMemberGroups[p_id2].length;i2++){var node2=tempMemberGroups[p_id2][i2];parentGraph.remove(node2),dummyParentGraph.add(node2)}}})},CoSELayout.prototype.clearCompounds=function(){var childGraphMap={},idToNode={};this.performDFSOnCompounds();for(var i=0;i<this.compoundOrder.length;i++)idToNode[this.compoundOrder[i].id]=this.compoundOrder[i],childGraphMap[this.compoundOrder[i].id]=[].concat(this.compoundOrder[i].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[i].getChild()),this.compoundOrder[i].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(childGraphMap,idToNode)},CoSELayout.prototype.clearZeroDegreeMembers=function(){var self=this,tiledZeroDegreePack=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(id){var compoundNode=self.idToDummyNode[id];if(tiledZeroDegreePack[id]=self.tileNodes(self.memberGroups[id],compoundNode.paddingLeft+compoundNode.paddingRight),compoundNode.rect.width=tiledZeroDegreePack[id].width,compoundNode.rect.height=tiledZeroDegreePack[id].height,compoundNode.setCenter(tiledZeroDegreePack[id].centerX,tiledZeroDegreePack[id].centerY),compoundNode.labelMarginLeft=0,compoundNode.labelMarginTop=0,CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS){var width=compoundNode.rect.width,height=compoundNode.rect.height;compoundNode.labelWidth&&("left"==compoundNode.labelPosHorizontal?(compoundNode.rect.x-=compoundNode.labelWidth,compoundNode.setWidth(width+compoundNode.labelWidth),compoundNode.labelMarginLeft=compoundNode.labelWidth):"center"==compoundNode.labelPosHorizontal&&compoundNode.labelWidth>width?(compoundNode.rect.x-=(compoundNode.labelWidth-width)/2,compoundNode.setWidth(compoundNode.labelWidth),compoundNode.labelMarginLeft=(compoundNode.labelWidth-width)/2):"right"==compoundNode.labelPosHorizontal&&compoundNode.setWidth(width+compoundNode.labelWidth)),compoundNode.labelHeight&&("top"==compoundNode.labelPosVertical?(compoundNode.rect.y-=compoundNode.labelHeight,compoundNode.setHeight(height+compoundNode.labelHeight),compoundNode.labelMarginTop=compoundNode.labelHeight):"center"==compoundNode.labelPosVertical&&compoundNode.labelHeight>height?(compoundNode.rect.y-=(compoundNode.labelHeight-height)/2,compoundNode.setHeight(compoundNode.labelHeight),compoundNode.labelMarginTop=(compoundNode.labelHeight-height)/2):"bottom"==compoundNode.labelPosVertical&&compoundNode.setHeight(height+compoundNode.labelHeight))}})},CoSELayout.prototype.repopulateCompounds=function(){for(var i=this.compoundOrder.length-1;i>=0;i--){var lCompoundNode=this.compoundOrder[i],id=lCompoundNode.id,horizontalMargin=lCompoundNode.paddingLeft,verticalMargin=lCompoundNode.paddingTop,labelMarginLeft=lCompoundNode.labelMarginLeft,labelMarginTop=lCompoundNode.labelMarginTop;this.adjustLocations(this.tiledMemberPack[id],lCompoundNode.rect.x,lCompoundNode.rect.y,horizontalMargin,verticalMargin,labelMarginLeft,labelMarginTop)}},CoSELayout.prototype.repopulateZeroDegreeMembers=function(){var self=this,tiledPack=this.tiledZeroDegreePack;Object.keys(tiledPack).forEach(function(id){var compoundNode=self.idToDummyNode[id],horizontalMargin=compoundNode.paddingLeft,verticalMargin=compoundNode.paddingTop,labelMarginLeft=compoundNode.labelMarginLeft,labelMarginTop=compoundNode.labelMarginTop;self.adjustLocations(tiledPack[id],compoundNode.rect.x,compoundNode.rect.y,horizontalMargin,verticalMargin,labelMarginLeft,labelMarginTop)})},CoSELayout.prototype.getToBeTiled=function(node){var id=node.id;if(null!=this.toBeTiled[id])return this.toBeTiled[id];var childGraph=node.getChild();if(null==childGraph)return this.toBeTiled[id]=!1,!1;for(var children=childGraph.getNodes(),i=0;i<children.length;i++){var theChild=children[i];if(this.getNodeDegree(theChild)>0)return this.toBeTiled[id]=!1,!1;if(null!=theChild.getChild()){if(!this.getToBeTiled(theChild))return this.toBeTiled[id]=!1,!1}else this.toBeTiled[theChild.id]=!1}return this.toBeTiled[id]=!0,!0},CoSELayout.prototype.getNodeDegree=function(node){node.id;for(var edges=node.getEdges(),degree=0,i=0;i<edges.length;i++){var edge=edges[i];edge.getSource().id!==edge.getTarget().id&&(degree+=1)}return degree},CoSELayout.prototype.getNodeDegreeWithChildren=function(node){var degree=this.getNodeDegree(node);if(null==node.getChild())return degree;for(var children=node.getChild().getNodes(),i=0;i<children.length;i++){var child=children[i];degree+=this.getNodeDegreeWithChildren(child)}return degree},CoSELayout.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},CoSELayout.prototype.fillCompexOrderByDFS=function(children){for(var i=0;i<children.length;i++){var child=children[i];null!=child.getChild()&&this.fillCompexOrderByDFS(child.getChild().getNodes()),this.getToBeTiled(child)&&this.compoundOrder.push(child)}},CoSELayout.prototype.adjustLocations=function(organization,x,y,compoundHorizontalMargin,compoundVerticalMargin,compoundLabelMarginLeft,compoundLabelMarginTop){y+=compoundVerticalMargin+compoundLabelMarginTop;for(var left=x+=compoundHorizontalMargin+compoundLabelMarginLeft,i=0;i<organization.rows.length;i++){var row=organization.rows[i];x=left;for(var maxHeight=0,j=0;j<row.length;j++){var lnode=row[j];lnode.rect.x=x,lnode.rect.y=y,x+=lnode.rect.width+organization.horizontalPadding,lnode.rect.height>maxHeight&&(maxHeight=lnode.rect.height)}y+=maxHeight+organization.verticalPadding}},CoSELayout.prototype.tileCompoundMembers=function(childGraphMap,idToNode){var self=this;this.tiledMemberPack=[],Object.keys(childGraphMap).forEach(function(id){var compoundNode=idToNode[id];if(self.tiledMemberPack[id]=self.tileNodes(childGraphMap[id],compoundNode.paddingLeft+compoundNode.paddingRight),compoundNode.rect.width=self.tiledMemberPack[id].width,compoundNode.rect.height=self.tiledMemberPack[id].height,compoundNode.setCenter(self.tiledMemberPack[id].centerX,self.tiledMemberPack[id].centerY),compoundNode.labelMarginLeft=0,compoundNode.labelMarginTop=0,CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS){var width=compoundNode.rect.width,height=compoundNode.rect.height;compoundNode.labelWidth&&("left"==compoundNode.labelPosHorizontal?(compoundNode.rect.x-=compoundNode.labelWidth,compoundNode.setWidth(width+compoundNode.labelWidth),compoundNode.labelMarginLeft=compoundNode.labelWidth):"center"==compoundNode.labelPosHorizontal&&compoundNode.labelWidth>width?(compoundNode.rect.x-=(compoundNode.labelWidth-width)/2,compoundNode.setWidth(compoundNode.labelWidth),compoundNode.labelMarginLeft=(compoundNode.labelWidth-width)/2):"right"==compoundNode.labelPosHorizontal&&compoundNode.setWidth(width+compoundNode.labelWidth)),compoundNode.labelHeight&&("top"==compoundNode.labelPosVertical?(compoundNode.rect.y-=compoundNode.labelHeight,compoundNode.setHeight(height+compoundNode.labelHeight),compoundNode.labelMarginTop=compoundNode.labelHeight):"center"==compoundNode.labelPosVertical&&compoundNode.labelHeight>height?(compoundNode.rect.y-=(compoundNode.labelHeight-height)/2,compoundNode.setHeight(compoundNode.labelHeight),compoundNode.labelMarginTop=(compoundNode.labelHeight-height)/2):"bottom"==compoundNode.labelPosVertical&&compoundNode.setHeight(height+compoundNode.labelHeight))}})},CoSELayout.prototype.tileNodes=function(nodes,minWidth){var horizontalOrg=this.tileNodesByFavoringDim(nodes,minWidth,!0),verticalOrg=this.tileNodesByFavoringDim(nodes,minWidth,!1),horizontalRatio=this.getOrgRatio(horizontalOrg);return this.getOrgRatio(verticalOrg)<horizontalRatio?verticalOrg:horizontalOrg},CoSELayout.prototype.getOrgRatio=function(organization){var ratio=organization.width/organization.height;return ratio<1&&(ratio=1/ratio),ratio},CoSELayout.prototype.calcIdealRowWidth=function(members,favorHorizontalDim){var verticalPadding=CoSEConstants.TILING_PADDING_VERTICAL,horizontalPadding=CoSEConstants.TILING_PADDING_HORIZONTAL,membersSize=members.length,totalWidth=0,totalHeight=0,maxWidth=0;members.forEach(function(node){totalWidth+=node.getWidth(),totalHeight+=node.getHeight(),node.getWidth()>maxWidth&&(maxWidth=node.getWidth())});var horizontalCount,averageWidth=totalWidth/membersSize,averageHeight=totalHeight/membersSize,delta=Math.pow(verticalPadding-horizontalPadding,2)+4*(averageWidth+horizontalPadding)*(averageHeight+verticalPadding)*membersSize,horizontalCountDouble=(horizontalPadding-verticalPadding+Math.sqrt(delta))/(2*(averageWidth+horizontalPadding));favorHorizontalDim?(horizontalCount=Math.ceil(horizontalCountDouble))==horizontalCountDouble&&horizontalCount++:horizontalCount=Math.floor(horizontalCountDouble);var idealWidth=horizontalCount*(averageWidth+horizontalPadding)-horizontalPadding;return maxWidth>idealWidth&&(idealWidth=maxWidth),idealWidth+=2*horizontalPadding},CoSELayout.prototype.tileNodesByFavoringDim=function(nodes,minWidth,favorHorizontalDim){var verticalPadding=CoSEConstants.TILING_PADDING_VERTICAL,horizontalPadding=CoSEConstants.TILING_PADDING_HORIZONTAL,tilingCompareBy=CoSEConstants.TILING_COMPARE_BY,organization={rows:[],rowWidth:[],rowHeight:[],width:0,height:minWidth,verticalPadding:verticalPadding,horizontalPadding:horizontalPadding,centerX:0,centerY:0};tilingCompareBy&&(organization.idealRowWidth=this.calcIdealRowWidth(nodes,favorHorizontalDim));var getNodeArea=function(n){return n.rect.width*n.rect.height},areaCompareFcn=function(n1,n2){return getNodeArea(n2)-getNodeArea(n1)};nodes.sort(function(n1,n2){var cmpBy=areaCompareFcn;return organization.idealRowWidth?(cmpBy=tilingCompareBy)(n1.id,n2.id):cmpBy(n1,n2)});for(var sumCenterX=0,sumCenterY=0,i=0;i<nodes.length;i++)sumCenterX+=(lNode=nodes[i]).getCenterX(),sumCenterY+=lNode.getCenterY();for(organization.centerX=sumCenterX/nodes.length,organization.centerY=sumCenterY/nodes.length,i=0;i<nodes.length;i++){var lNode=nodes[i];if(0==organization.rows.length)this.insertNodeToRow(organization,lNode,0,minWidth);else if(this.canAddHorizontal(organization,lNode.rect.width,lNode.rect.height)){var rowIndex=organization.rows.length-1;organization.idealRowWidth||(rowIndex=this.getShortestRowIndex(organization)),this.insertNodeToRow(organization,lNode,rowIndex,minWidth)}else this.insertNodeToRow(organization,lNode,organization.rows.length,minWidth);this.shiftToLastRow(organization)}return organization},CoSELayout.prototype.insertNodeToRow=function(organization,node,rowIndex,minWidth){var minCompoundSize=minWidth;rowIndex==organization.rows.length&&(organization.rows.push([]),organization.rowWidth.push(minCompoundSize),organization.rowHeight.push(0));var w=organization.rowWidth[rowIndex]+node.rect.width;organization.rows[rowIndex].length>0&&(w+=organization.horizontalPadding),organization.rowWidth[rowIndex]=w,organization.width<w&&(organization.width=w);var h=node.rect.height;rowIndex>0&&(h+=organization.verticalPadding);var extraHeight=0;h>organization.rowHeight[rowIndex]&&(extraHeight=organization.rowHeight[rowIndex],organization.rowHeight[rowIndex]=h,extraHeight=organization.rowHeight[rowIndex]-extraHeight),organization.height+=extraHeight,organization.rows[rowIndex].push(node)},CoSELayout.prototype.getShortestRowIndex=function(organization){for(var r=-1,min=Number.MAX_VALUE,i=0;i<organization.rows.length;i++)organization.rowWidth[i]<min&&(r=i,min=organization.rowWidth[i]);return r},CoSELayout.prototype.getLongestRowIndex=function(organization){for(var r=-1,max=Number.MIN_VALUE,i=0;i<organization.rows.length;i++)organization.rowWidth[i]>max&&(r=i,max=organization.rowWidth[i]);return r},CoSELayout.prototype.canAddHorizontal=function(organization,extraWidth,extraHeight){if(organization.idealRowWidth){var lastRowIndex=organization.rows.length-1;return organization.rowWidth[lastRowIndex]+extraWidth+organization.horizontalPadding<=organization.idealRowWidth}var sri=this.getShortestRowIndex(organization);if(sri<0)return!0;var min=organization.rowWidth[sri];if(min+organization.horizontalPadding+extraWidth<=organization.width)return!0;var add_to_row_ratio,add_new_row_ratio,hDiff=0;return organization.rowHeight[sri]<extraHeight&&sri>0&&(hDiff=extraHeight+organization.verticalPadding-organization.rowHeight[sri]),add_to_row_ratio=organization.width-min>=extraWidth+organization.horizontalPadding?(organization.height+hDiff)/(min+extraWidth+organization.horizontalPadding):(organization.height+hDiff)/organization.width,hDiff=extraHeight+organization.verticalPadding,(add_new_row_ratio=organization.width<extraWidth?(organization.height+hDiff)/extraWidth:(organization.height+hDiff)/organization.width)<1&&(add_new_row_ratio=1/add_new_row_ratio),add_to_row_ratio<1&&(add_to_row_ratio=1/add_to_row_ratio),add_to_row_ratio<add_new_row_ratio},CoSELayout.prototype.shiftToLastRow=function(organization){var longest=this.getLongestRowIndex(organization),last=organization.rowWidth.length-1,row=organization.rows[longest],node=row[row.length-1],diff=node.width+organization.horizontalPadding;if(organization.width-organization.rowWidth[last]>diff&&longest!=last){row.splice(-1,1),organization.rows[last].push(node),organization.rowWidth[longest]=organization.rowWidth[longest]-diff,organization.rowWidth[last]=organization.rowWidth[last]+diff,organization.width=organization.rowWidth[instance.getLongestRowIndex(organization)];for(var maxHeight=Number.MIN_VALUE,i=0;i<row.length;i++)row[i].height>maxHeight&&(maxHeight=row[i].height);longest>0&&(maxHeight+=organization.verticalPadding);var prevTotal=organization.rowHeight[longest]+organization.rowHeight[last];organization.rowHeight[longest]=maxHeight,organization.rowHeight[last]<node.height+organization.verticalPadding&&(organization.rowHeight[last]=node.height+organization.verticalPadding);var finalTotal=organization.rowHeight[longest]+organization.rowHeight[last];organization.height+=finalTotal-prevTotal,this.shiftToLastRow(organization)}},CoSELayout.prototype.tilingPreLayout=function(){CoSEConstants.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},CoSELayout.prototype.tilingPostLayout=function(){CoSEConstants.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},CoSELayout.prototype.reduceTrees=function(){for(var node,prunedNodesAll=[],containsLeaf=!0;containsLeaf;){var allNodes=this.graphManager.getAllNodes(),prunedNodesInStepTemp=[];containsLeaf=!1;for(var i=0;i<allNodes.length;i++)if(1==(node=allNodes[i]).getEdges().length&&!node.getEdges()[0].isInterGraph&&null==node.getChild()){if(CoSEConstants.PURE_INCREMENTAL){var otherEnd=node.getEdges()[0].getOtherEnd(node),relativePosition=new DimensionD2(node.getCenterX()-otherEnd.getCenterX(),node.getCenterY()-otherEnd.getCenterY());prunedNodesInStepTemp.push([node,node.getEdges()[0],node.getOwner(),relativePosition])}else prunedNodesInStepTemp.push([node,node.getEdges()[0],node.getOwner()]);containsLeaf=!0}if(1==containsLeaf){for(var prunedNodesInStep=[],j=0;j<prunedNodesInStepTemp.length;j++)1==prunedNodesInStepTemp[j][0].getEdges().length&&(prunedNodesInStep.push(prunedNodesInStepTemp[j]),prunedNodesInStepTemp[j][0].getOwner().remove(prunedNodesInStepTemp[j][0]));prunedNodesAll.push(prunedNodesInStep),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=prunedNodesAll},CoSELayout.prototype.growTree=function(prunedNodesAll){for(var nodeData2,prunedNodesInStep=prunedNodesAll[prunedNodesAll.length-1],i=0;i<prunedNodesInStep.length;i++)nodeData2=prunedNodesInStep[i],this.findPlaceforPrunedNode(nodeData2),nodeData2[2].add(nodeData2[0]),nodeData2[2].add(nodeData2[1],nodeData2[1].source,nodeData2[1].target);prunedNodesAll.splice(prunedNodesAll.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},CoSELayout.prototype.findPlaceforPrunedNode=function(nodeData2){var gridForPrunedNode,nodeToConnect,prunedNode=nodeData2[0];if(nodeToConnect=prunedNode==nodeData2[1].source?nodeData2[1].target:nodeData2[1].source,CoSEConstants.PURE_INCREMENTAL)prunedNode.setCenter(nodeToConnect.getCenterX()+nodeData2[3].getWidth(),nodeToConnect.getCenterY()+nodeData2[3].getHeight());else{var startGridX=nodeToConnect.startX,finishGridX=nodeToConnect.finishX,startGridY=nodeToConnect.startY,finishGridY=nodeToConnect.finishY,controlRegions=[0,0,0,0];if(startGridY>0)for(var i=startGridX;i<=finishGridX;i++)controlRegions[0]+=this.grid[i][startGridY-1].length+this.grid[i][startGridY].length-1;if(finishGridX<this.grid.length-1)for(i=startGridY;i<=finishGridY;i++)controlRegions[1]+=this.grid[finishGridX+1][i].length+this.grid[finishGridX][i].length-1;if(finishGridY<this.grid[0].length-1)for(i=startGridX;i<=finishGridX;i++)controlRegions[2]+=this.grid[i][finishGridY+1].length+this.grid[i][finishGridY].length-1;if(startGridX>0)for(i=startGridY;i<=finishGridY;i++)controlRegions[3]+=this.grid[startGridX-1][i].length+this.grid[startGridX][i].length-1;for(var minCount,minIndex,min=Integer.MAX_VALUE,j=0;j<controlRegions.length;j++)controlRegions[j]<min?(min=controlRegions[j],minCount=1,minIndex=j):controlRegions[j]==min&&minCount++;if(3==minCount&&0==min)0==controlRegions[0]&&0==controlRegions[1]&&0==controlRegions[2]?gridForPrunedNode=1:0==controlRegions[0]&&0==controlRegions[1]&&0==controlRegions[3]?gridForPrunedNode=0:0==controlRegions[0]&&0==controlRegions[2]&&0==controlRegions[3]?gridForPrunedNode=3:0==controlRegions[1]&&0==controlRegions[2]&&0==controlRegions[3]&&(gridForPrunedNode=2);else if(2==minCount&&0==min){var random=Math.floor(2*Math.random());gridForPrunedNode=0==controlRegions[0]&&0==controlRegions[1]?0==random?0:1:0==controlRegions[0]&&0==controlRegions[2]?0==random?0:2:0==controlRegions[0]&&0==controlRegions[3]?0==random?0:3:0==controlRegions[1]&&0==controlRegions[2]?0==random?1:2:0==controlRegions[1]&&0==controlRegions[3]?0==random?1:3:0==random?2:3}else gridForPrunedNode=4==minCount&&0==min?random=Math.floor(4*Math.random()):minIndex;0==gridForPrunedNode?prunedNode.setCenter(nodeToConnect.getCenterX(),nodeToConnect.getCenterY()-nodeToConnect.getHeight()/2-FDLayoutConstants.DEFAULT_EDGE_LENGTH-prunedNode.getHeight()/2):1==gridForPrunedNode?prunedNode.setCenter(nodeToConnect.getCenterX()+nodeToConnect.getWidth()/2+FDLayoutConstants.DEFAULT_EDGE_LENGTH+prunedNode.getWidth()/2,nodeToConnect.getCenterY()):2==gridForPrunedNode?prunedNode.setCenter(nodeToConnect.getCenterX(),nodeToConnect.getCenterY()+nodeToConnect.getHeight()/2+FDLayoutConstants.DEFAULT_EDGE_LENGTH+prunedNode.getHeight()/2):prunedNode.setCenter(nodeToConnect.getCenterX()-nodeToConnect.getWidth()/2-FDLayoutConstants.DEFAULT_EDGE_LENGTH-prunedNode.getWidth()/2,nodeToConnect.getCenterY())}},module2.exports=CoSELayout},991:(module2,__unused_webpack_exports,__webpack_require__2)=>{var FDLayoutNode=__webpack_require__2(551).FDLayoutNode,IMath=__webpack_require__2(551).IMath;function CoSENode(gm,loc,size,vNode){FDLayoutNode.call(this,gm,loc,size,vNode)}for(var prop in CoSENode.prototype=Object.create(FDLayoutNode.prototype),FDLayoutNode)CoSENode[prop]=FDLayoutNode[prop];CoSENode.prototype.calculateDisplacement=function(){var layout=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=layout.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=layout.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=layout.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=layout.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>layout.coolingFactor*layout.maxNodeDisplacement&&(this.displacementX=layout.coolingFactor*layout.maxNodeDisplacement*IMath.sign(this.displacementX)),Math.abs(this.displacementY)>layout.coolingFactor*layout.maxNodeDisplacement&&(this.displacementY=layout.coolingFactor*layout.maxNodeDisplacement*IMath.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},CoSENode.prototype.propogateDisplacementToChildren=function(dX,dY){for(var node,nodes=this.getChild().getNodes(),i=0;i<nodes.length;i++)null==(node=nodes[i]).getChild()?(node.displacementX+=dX,node.displacementY+=dY):node.propogateDisplacementToChildren(dX,dY)},CoSENode.prototype.move=function(){var layout=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(this.displacementX,this.displacementY),layout.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},CoSENode.prototype.setPred1=function(pred12){this.pred1=pred12},CoSENode.prototype.getPred1=function(){return pred1},CoSENode.prototype.getPred2=function(){return pred2},CoSENode.prototype.setNext=function(next2){this.next=next2},CoSENode.prototype.getNext=function(){return next},CoSENode.prototype.setProcessed=function(processed2){this.processed=processed2},CoSENode.prototype.isProcessed=function(){return processed},module2.exports=CoSENode},902:(module2,__unused_webpack_exports,__webpack_require__2)=>{function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}var CoSEConstants=__webpack_require__2(806),LinkedList=__webpack_require__2(551).LinkedList,Matrix=__webpack_require__2(551).Matrix,SVD=__webpack_require__2(551).SVD;function ConstraintHandler(){}ConstraintHandler.handleConstraints=function(layout){var constraints={};constraints.fixedNodeConstraint=layout.constraints.fixedNodeConstraint,constraints.alignmentConstraint=layout.constraints.alignmentConstraint,constraints.relativePlacementConstraint=layout.constraints.relativePlacementConstraint;for(var idToNodeMap=new Map,nodeIndexes=new Map,xCoords=[],yCoords=[],allNodes=layout.getAllNodes(),index=0,i=0;i<allNodes.length;i++){var node=allNodes[i];null==node.getChild()&&(nodeIndexes.set(node.id,index++),xCoords.push(node.getCenterX()),yCoords.push(node.getCenterY()),idToNodeMap.set(node.id,node))}constraints.relativePlacementConstraint&&constraints.relativePlacementConstraint.forEach(function(constraint){constraint.gap||0==constraint.gap||(constraint.left?constraint.gap=CoSEConstants.DEFAULT_EDGE_LENGTH+idToNodeMap.get(constraint.left).getWidth()/2+idToNodeMap.get(constraint.right).getWidth()/2:constraint.gap=CoSEConstants.DEFAULT_EDGE_LENGTH+idToNodeMap.get(constraint.top).getHeight()/2+idToNodeMap.get(constraint.bottom).getHeight()/2)});var calculateAvgPosition=function(nodeIdSet){var xPosSum=0,yPosSum=0;return nodeIdSet.forEach(function(nodeId){xPosSum+=xCoords[nodeIndexes.get(nodeId)],yPosSum+=yCoords[nodeIndexes.get(nodeId)]}),{x:xPosSum/nodeIdSet.size,y:yPosSum/nodeIdSet.size}},findAppropriatePositionForRelativePlacement=function(graph,direction,fixedNodes2,dummyPositions,componentSources){var inDegrees=new Map;graph.forEach(function(value,key){inDegrees.set(key,0)}),graph.forEach(function(value,key){value.forEach(function(adjacent){inDegrees.set(adjacent.id,inDegrees.get(adjacent.id)+1)})});var positionMap=new Map,pastMap=new Map,queue=new LinkedList;inDegrees.forEach(function(value,key){0==value?(queue.push(key),fixedNodes2||("horizontal"==direction?positionMap.set(key,nodeIndexes.has(key)?xCoords[nodeIndexes.get(key)]:dummyPositions.get(key)):positionMap.set(key,nodeIndexes.has(key)?yCoords[nodeIndexes.get(key)]:dummyPositions.get(key)))):positionMap.set(key,Number.NEGATIVE_INFINITY),fixedNodes2&&pastMap.set(key,new Set([key]))}),fixedNodes2&&componentSources.forEach(function(component){var fixedIds=[];if(component.forEach(function(nodeId){fixedNodes2.has(nodeId)&&fixedIds.push(nodeId)}),fixedIds.length>0){var position=0;fixedIds.forEach(function(fixedId){"horizontal"==direction?(positionMap.set(fixedId,nodeIndexes.has(fixedId)?xCoords[nodeIndexes.get(fixedId)]:dummyPositions.get(fixedId)),position+=positionMap.get(fixedId)):(positionMap.set(fixedId,nodeIndexes.has(fixedId)?yCoords[nodeIndexes.get(fixedId)]:dummyPositions.get(fixedId)),position+=positionMap.get(fixedId))}),position/=fixedIds.length,component.forEach(function(nodeId){fixedNodes2.has(nodeId)||positionMap.set(nodeId,position)})}else{var _position=0;component.forEach(function(nodeId){_position+="horizontal"==direction?nodeIndexes.has(nodeId)?xCoords[nodeIndexes.get(nodeId)]:dummyPositions.get(nodeId):nodeIndexes.has(nodeId)?yCoords[nodeIndexes.get(nodeId)]:dummyPositions.get(nodeId)}),_position/=component.length,component.forEach(function(nodeId){positionMap.set(nodeId,_position)})}});for(var _loop=function(){var currentNode=queue.shift();graph.get(currentNode).forEach(function(neighbor){if(positionMap.get(neighbor.id)<positionMap.get(currentNode)+neighbor.gap)if(fixedNodes2&&fixedNodes2.has(neighbor.id)){var fixedPosition=void 0;if(fixedPosition="horizontal"==direction?nodeIndexes.has(neighbor.id)?xCoords[nodeIndexes.get(neighbor.id)]:dummyPositions.get(neighbor.id):nodeIndexes.has(neighbor.id)?yCoords[nodeIndexes.get(neighbor.id)]:dummyPositions.get(neighbor.id),positionMap.set(neighbor.id,fixedPosition),fixedPosition<positionMap.get(currentNode)+neighbor.gap){var diff=positionMap.get(currentNode)+neighbor.gap-fixedPosition;pastMap.get(currentNode).forEach(function(nodeId){positionMap.set(nodeId,positionMap.get(nodeId)-diff)})}}else positionMap.set(neighbor.id,positionMap.get(currentNode)+neighbor.gap);inDegrees.set(neighbor.id,inDegrees.get(neighbor.id)-1),0==inDegrees.get(neighbor.id)&&queue.push(neighbor.id),fixedNodes2&&pastMap.set(neighbor.id,function(setA,setB){var union=new Set(setA),_iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=setB[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var elem=_step.value;union.add(elem)}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{!_iteratorNormalCompletion&&_iterator.return&&_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}return union}(pastMap.get(currentNode),pastMap.get(neighbor.id)))})};0!=queue.length;)_loop();if(fixedNodes2){var sinkNodes=new Set;graph.forEach(function(value,key){0==value.length&&sinkNodes.add(key)});var _components=[];pastMap.forEach(function(value,key){if(sinkNodes.has(key)){var isFixedComponent=!1,_iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_iterator2=value[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0){var nodeId=_step2.value;fixedNodes2.has(nodeId)&&(isFixedComponent=!0)}}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{!_iteratorNormalCompletion2&&_iterator2.return&&_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}if(!isFixedComponent){var isExist=!1,existAt=void 0;_components.forEach(function(component,index2){component.has([].concat(_toConsumableArray(value))[0])&&(isExist=!0,existAt=index2)}),isExist?value.forEach(function(ele){_components[existAt].add(ele)}):_components.push(new Set(value))}}}),_components.forEach(function(component,index2){var minBefore=Number.POSITIVE_INFINITY,minAfter=Number.POSITIVE_INFINITY,maxBefore=Number.NEGATIVE_INFINITY,maxAfter=Number.NEGATIVE_INFINITY,_iteratorNormalCompletion3=!0,_didIteratorError3=!1,_iteratorError3=void 0;try{for(var _step3,_iterator3=component[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=!0){var nodeId=_step3.value,posBefore=void 0;posBefore="horizontal"==direction?nodeIndexes.has(nodeId)?xCoords[nodeIndexes.get(nodeId)]:dummyPositions.get(nodeId):nodeIndexes.has(nodeId)?yCoords[nodeIndexes.get(nodeId)]:dummyPositions.get(nodeId);var posAfter=positionMap.get(nodeId);posBefore<minBefore&&(minBefore=posBefore),posBefore>maxBefore&&(maxBefore=posBefore),posAfter<minAfter&&(minAfter=posAfter),posAfter>maxAfter&&(maxAfter=posAfter)}}catch(err){_didIteratorError3=!0,_iteratorError3=err}finally{try{!_iteratorNormalCompletion3&&_iterator3.return&&_iterator3.return()}finally{if(_didIteratorError3)throw _iteratorError3}}var diff=(minBefore+maxBefore)/2-(minAfter+maxAfter)/2,_iteratorNormalCompletion4=!0,_didIteratorError4=!1,_iteratorError4=void 0;try{for(var _step4,_iterator4=component[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=!0){var _nodeId=_step4.value;positionMap.set(_nodeId,positionMap.get(_nodeId)+diff)}}catch(err){_didIteratorError4=!0,_iteratorError4=err}finally{try{!_iteratorNormalCompletion4&&_iterator4.return&&_iterator4.return()}finally{if(_didIteratorError4)throw _iteratorError4}}})}return positionMap},applyReflectionForRelativePlacement=function(relativePlacementConstraints){var reflectOnY=0,notReflectOnY=0,reflectOnX=0,notReflectOnX=0;if(relativePlacementConstraints.forEach(function(constraint){constraint.left?xCoords[nodeIndexes.get(constraint.left)]-xCoords[nodeIndexes.get(constraint.right)]>=0?reflectOnY++:notReflectOnY++:yCoords[nodeIndexes.get(constraint.top)]-yCoords[nodeIndexes.get(constraint.bottom)]>=0?reflectOnX++:notReflectOnX++}),reflectOnY>notReflectOnY&&reflectOnX>notReflectOnX)for(var _i=0;_i<nodeIndexes.size;_i++)xCoords[_i]=-1*xCoords[_i],yCoords[_i]=-1*yCoords[_i];else if(reflectOnY>notReflectOnY)for(var _i2=0;_i2<nodeIndexes.size;_i2++)xCoords[_i2]=-1*xCoords[_i2];else if(reflectOnX>notReflectOnX)for(var _i3=0;_i3<nodeIndexes.size;_i3++)yCoords[_i3]=-1*yCoords[_i3]},findComponents=function(graph){var components2=[],queue=new LinkedList,visited=new Set,count=0;return graph.forEach(function(value,key){if(!visited.has(key)){components2[count]=[];var _currentNode=key;for(queue.push(_currentNode),visited.add(_currentNode),components2[count].push(_currentNode);0!=queue.length;)_currentNode=queue.shift(),graph.get(_currentNode).forEach(function(neighbor){visited.has(neighbor.id)||(queue.push(neighbor.id),visited.add(neighbor.id),components2[count].push(neighbor.id))});count++}}),components2},dagToUndirected=function(dag2){var undirected=new Map;return dag2.forEach(function(value,key){undirected.set(key,[])}),dag2.forEach(function(value,key){value.forEach(function(adjacent){undirected.get(key).push(adjacent),undirected.get(adjacent.id).push({id:key,gap:adjacent.gap,direction:adjacent.direction})})}),undirected},dagToReversed=function(dag2){var reversed=new Map;return dag2.forEach(function(value,key){reversed.set(key,[])}),dag2.forEach(function(value,key){value.forEach(function(adjacent){reversed.get(adjacent.id).push({id:key,gap:adjacent.gap,direction:adjacent.direction})})}),reversed},targetMatrix=[],sourceMatrix=[],standardTransformation=!1,reflectionType=!1,fixedNodes=new Set,dag=new Map,dagUndirected=new Map,components=[];if(constraints.fixedNodeConstraint&&constraints.fixedNodeConstraint.forEach(function(nodeData2){fixedNodes.add(nodeData2.nodeId)}),constraints.relativePlacementConstraint&&(constraints.relativePlacementConstraint.forEach(function(constraint){constraint.left?(dag.has(constraint.left)?dag.get(constraint.left).push({id:constraint.right,gap:constraint.gap,direction:"horizontal"}):dag.set(constraint.left,[{id:constraint.right,gap:constraint.gap,direction:"horizontal"}]),dag.has(constraint.right)||dag.set(constraint.right,[])):(dag.has(constraint.top)?dag.get(constraint.top).push({id:constraint.bottom,gap:constraint.gap,direction:"vertical"}):dag.set(constraint.top,[{id:constraint.bottom,gap:constraint.gap,direction:"vertical"}]),dag.has(constraint.bottom)||dag.set(constraint.bottom,[]))}),dagUndirected=dagToUndirected(dag),components=findComponents(dagUndirected)),CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING){if(constraints.fixedNodeConstraint&&constraints.fixedNodeConstraint.length>1)constraints.fixedNodeConstraint.forEach(function(nodeData2,i2){targetMatrix[i2]=[nodeData2.position.x,nodeData2.position.y],sourceMatrix[i2]=[xCoords[nodeIndexes.get(nodeData2.nodeId)],yCoords[nodeIndexes.get(nodeData2.nodeId)]]}),standardTransformation=!0;else if(constraints.alignmentConstraint)!function(){var count=0;if(constraints.alignmentConstraint.vertical){for(var verticalAlign=constraints.alignmentConstraint.vertical,_loop2=function(_i42){var alignmentSet=new Set;verticalAlign[_i42].forEach(function(nodeId){alignmentSet.add(nodeId)});var intersection=new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x){return fixedNodes.has(x)})),xPos=void 0;xPos=intersection.size>0?xCoords[nodeIndexes.get(intersection.values().next().value)]:calculateAvgPosition(alignmentSet).x,verticalAlign[_i42].forEach(function(nodeId){targetMatrix[count]=[xPos,yCoords[nodeIndexes.get(nodeId)]],sourceMatrix[count]=[xCoords[nodeIndexes.get(nodeId)],yCoords[nodeIndexes.get(nodeId)]],count++})},_i4=0;_i4<verticalAlign.length;_i4++)_loop2(_i4);standardTransformation=!0}if(constraints.alignmentConstraint.horizontal){for(var horizontalAlign=constraints.alignmentConstraint.horizontal,_loop3=function(_i52){var alignmentSet=new Set;horizontalAlign[_i52].forEach(function(nodeId){alignmentSet.add(nodeId)});var intersection=new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x){return fixedNodes.has(x)})),yPos=void 0;yPos=intersection.size>0?xCoords[nodeIndexes.get(intersection.values().next().value)]:calculateAvgPosition(alignmentSet).y,horizontalAlign[_i52].forEach(function(nodeId){targetMatrix[count]=[xCoords[nodeIndexes.get(nodeId)],yPos],sourceMatrix[count]=[xCoords[nodeIndexes.get(nodeId)],yCoords[nodeIndexes.get(nodeId)]],count++})},_i5=0;_i5<horizontalAlign.length;_i5++)_loop3(_i5);standardTransformation=!0}constraints.relativePlacementConstraint&&(reflectionType=!0)}();else if(constraints.relativePlacementConstraint){for(var largestComponentSize=0,largestComponentIndex=0,_i6=0;_i6<components.length;_i6++)components[_i6].length>largestComponentSize&&(largestComponentSize=components[_i6].length,largestComponentIndex=_i6);if(largestComponentSize<dagUndirected.size/2)applyReflectionForRelativePlacement(constraints.relativePlacementConstraint),standardTransformation=!1,reflectionType=!1;else{var subGraphOnHorizontal=new Map,subGraphOnVertical=new Map,constraintsInlargestComponent=[];components[largestComponentIndex].forEach(function(nodeId){dag.get(nodeId).forEach(function(adjacent){"horizontal"==adjacent.direction?(subGraphOnHorizontal.has(nodeId)?subGraphOnHorizontal.get(nodeId).push(adjacent):subGraphOnHorizontal.set(nodeId,[adjacent]),subGraphOnHorizontal.has(adjacent.id)||subGraphOnHorizontal.set(adjacent.id,[]),constraintsInlargestComponent.push({left:nodeId,right:adjacent.id})):(subGraphOnVertical.has(nodeId)?subGraphOnVertical.get(nodeId).push(adjacent):subGraphOnVertical.set(nodeId,[adjacent]),subGraphOnVertical.has(adjacent.id)||subGraphOnVertical.set(adjacent.id,[]),constraintsInlargestComponent.push({top:nodeId,bottom:adjacent.id}))})}),applyReflectionForRelativePlacement(constraintsInlargestComponent),reflectionType=!1;var positionMapHorizontal=findAppropriatePositionForRelativePlacement(subGraphOnHorizontal,"horizontal"),positionMapVertical=findAppropriatePositionForRelativePlacement(subGraphOnVertical,"vertical");components[largestComponentIndex].forEach(function(nodeId,i2){sourceMatrix[i2]=[xCoords[nodeIndexes.get(nodeId)],yCoords[nodeIndexes.get(nodeId)]],targetMatrix[i2]=[],positionMapHorizontal.has(nodeId)?targetMatrix[i2][0]=positionMapHorizontal.get(nodeId):targetMatrix[i2][0]=xCoords[nodeIndexes.get(nodeId)],positionMapVertical.has(nodeId)?targetMatrix[i2][1]=positionMapVertical.get(nodeId):targetMatrix[i2][1]=yCoords[nodeIndexes.get(nodeId)]}),standardTransformation=!0}}if(standardTransformation){for(var transformationMatrix,targetMatrixTranspose=Matrix.transpose(targetMatrix),sourceMatrixTranspose=Matrix.transpose(sourceMatrix),_i7=0;_i7<targetMatrixTranspose.length;_i7++)targetMatrixTranspose[_i7]=Matrix.multGamma(targetMatrixTranspose[_i7]),sourceMatrixTranspose[_i7]=Matrix.multGamma(sourceMatrixTranspose[_i7]);var tempMatrix=Matrix.multMat(targetMatrixTranspose,Matrix.transpose(sourceMatrixTranspose)),SVDResult=SVD.svd(tempMatrix);transformationMatrix=Matrix.multMat(SVDResult.V,Matrix.transpose(SVDResult.U));for(var _i8=0;_i8<nodeIndexes.size;_i8++){var temp1=[xCoords[_i8],yCoords[_i8]],temp2=[transformationMatrix[0][0],transformationMatrix[1][0]],temp3=[transformationMatrix[0][1],transformationMatrix[1][1]];xCoords[_i8]=Matrix.dotProduct(temp1,temp2),yCoords[_i8]=Matrix.dotProduct(temp1,temp3)}reflectionType&&applyReflectionForRelativePlacement(constraints.relativePlacementConstraint)}}if(CoSEConstants.ENFORCE_CONSTRAINTS){if(constraints.fixedNodeConstraint&&constraints.fixedNodeConstraint.length>0){var translationAmount={x:0,y:0};constraints.fixedNodeConstraint.forEach(function(nodeData2,i2){var pos1,pos2,posInTheory={x:xCoords[nodeIndexes.get(nodeData2.nodeId)],y:yCoords[nodeIndexes.get(nodeData2.nodeId)]},posDesired=nodeData2.position,posDiff=(pos2=posInTheory,{x:(pos1=posDesired).x-pos2.x,y:pos1.y-pos2.y});translationAmount.x+=posDiff.x,translationAmount.y+=posDiff.y}),translationAmount.x/=constraints.fixedNodeConstraint.length,translationAmount.y/=constraints.fixedNodeConstraint.length,xCoords.forEach(function(value,i2){xCoords[i2]+=translationAmount.x}),yCoords.forEach(function(value,i2){yCoords[i2]+=translationAmount.y}),constraints.fixedNodeConstraint.forEach(function(nodeData2){xCoords[nodeIndexes.get(nodeData2.nodeId)]=nodeData2.position.x,yCoords[nodeIndexes.get(nodeData2.nodeId)]=nodeData2.position.y})}if(constraints.alignmentConstraint){if(constraints.alignmentConstraint.vertical)for(var xAlign=constraints.alignmentConstraint.vertical,_loop4=function(_i92){var alignmentSet=new Set;xAlign[_i92].forEach(function(nodeId){alignmentSet.add(nodeId)});var intersection=new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x){return fixedNodes.has(x)})),xPos=void 0;xPos=intersection.size>0?xCoords[nodeIndexes.get(intersection.values().next().value)]:calculateAvgPosition(alignmentSet).x,alignmentSet.forEach(function(nodeId){fixedNodes.has(nodeId)||(xCoords[nodeIndexes.get(nodeId)]=xPos)})},_i9=0;_i9<xAlign.length;_i9++)_loop4(_i9);if(constraints.alignmentConstraint.horizontal)for(var yAlign=constraints.alignmentConstraint.horizontal,_loop5=function(_i102){var alignmentSet=new Set;yAlign[_i102].forEach(function(nodeId){alignmentSet.add(nodeId)});var intersection=new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x){return fixedNodes.has(x)})),yPos=void 0;yPos=intersection.size>0?yCoords[nodeIndexes.get(intersection.values().next().value)]:calculateAvgPosition(alignmentSet).y,alignmentSet.forEach(function(nodeId){fixedNodes.has(nodeId)||(yCoords[nodeIndexes.get(nodeId)]=yPos)})},_i10=0;_i10<yAlign.length;_i10++)_loop5(_i10)}constraints.relativePlacementConstraint&&function(){var nodeToDummyForVerticalAlignment=new Map,nodeToDummyForHorizontalAlignment=new Map,dummyToNodeForVerticalAlignment=new Map,dummyToNodeForHorizontalAlignment=new Map,dummyPositionsForVerticalAlignment=new Map,dummyPositionsForHorizontalAlignment=new Map,fixedNodesOnHorizontal=new Set,fixedNodesOnVertical=new Set;if(fixedNodes.forEach(function(nodeId2){fixedNodesOnHorizontal.add(nodeId2),fixedNodesOnVertical.add(nodeId2)}),constraints.alignmentConstraint){if(constraints.alignmentConstraint.vertical)for(var verticalAlignment=constraints.alignmentConstraint.vertical,_loop6=function(_i112){dummyToNodeForVerticalAlignment.set("dummy"+_i112,[]),verticalAlignment[_i112].forEach(function(nodeId2){nodeToDummyForVerticalAlignment.set(nodeId2,"dummy"+_i112),dummyToNodeForVerticalAlignment.get("dummy"+_i112).push(nodeId2),fixedNodes.has(nodeId2)&&fixedNodesOnHorizontal.add("dummy"+_i112)}),dummyPositionsForVerticalAlignment.set("dummy"+_i112,xCoords[nodeIndexes.get(verticalAlignment[_i112][0])])},_i11=0;_i11<verticalAlignment.length;_i11++)_loop6(_i11);if(constraints.alignmentConstraint.horizontal)for(var horizontalAlignment=constraints.alignmentConstraint.horizontal,_loop7=function(_i122){dummyToNodeForHorizontalAlignment.set("dummy"+_i122,[]),horizontalAlignment[_i122].forEach(function(nodeId2){nodeToDummyForHorizontalAlignment.set(nodeId2,"dummy"+_i122),dummyToNodeForHorizontalAlignment.get("dummy"+_i122).push(nodeId2),fixedNodes.has(nodeId2)&&fixedNodesOnVertical.add("dummy"+_i122)}),dummyPositionsForHorizontalAlignment.set("dummy"+_i122,yCoords[nodeIndexes.get(horizontalAlignment[_i122][0])])},_i12=0;_i12<horizontalAlignment.length;_i12++)_loop7(_i12)}var dagOnHorizontal=new Map,dagOnVertical=new Map,_loop8=function(nodeId2){dag.get(nodeId2).forEach(function(adjacent){var sourceId=void 0,targetNode=void 0;"horizontal"==adjacent.direction?(sourceId=nodeToDummyForVerticalAlignment.get(nodeId2)?nodeToDummyForVerticalAlignment.get(nodeId2):nodeId2,targetNode=nodeToDummyForVerticalAlignment.get(adjacent.id)?{id:nodeToDummyForVerticalAlignment.get(adjacent.id),gap:adjacent.gap,direction:adjacent.direction}:adjacent,dagOnHorizontal.has(sourceId)?dagOnHorizontal.get(sourceId).push(targetNode):dagOnHorizontal.set(sourceId,[targetNode]),dagOnHorizontal.has(targetNode.id)||dagOnHorizontal.set(targetNode.id,[])):(sourceId=nodeToDummyForHorizontalAlignment.get(nodeId2)?nodeToDummyForHorizontalAlignment.get(nodeId2):nodeId2,targetNode=nodeToDummyForHorizontalAlignment.get(adjacent.id)?{id:nodeToDummyForHorizontalAlignment.get(adjacent.id),gap:adjacent.gap,direction:adjacent.direction}:adjacent,dagOnVertical.has(sourceId)?dagOnVertical.get(sourceId).push(targetNode):dagOnVertical.set(sourceId,[targetNode]),dagOnVertical.has(targetNode.id)||dagOnVertical.set(targetNode.id,[]))})},_iteratorNormalCompletion5=!0,_didIteratorError5=!1,_iteratorError5=void 0;try{for(var _step5,_iterator5=dag.keys()[Symbol.iterator]();!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=!0)_loop8(_step5.value)}catch(err){_didIteratorError5=!0,_iteratorError5=err}finally{try{!_iteratorNormalCompletion5&&_iterator5.return&&_iterator5.return()}finally{if(_didIteratorError5)throw _iteratorError5}}var undirectedOnHorizontal=dagToUndirected(dagOnHorizontal),undirectedOnVertical=dagToUndirected(dagOnVertical),componentsOnHorizontal=findComponents(undirectedOnHorizontal),componentsOnVertical=findComponents(undirectedOnVertical),reversedDagOnHorizontal=dagToReversed(dagOnHorizontal),reversedDagOnVertical=dagToReversed(dagOnVertical),componentSourcesOnHorizontal=[],componentSourcesOnVertical=[];componentsOnHorizontal.forEach(function(component,index2){componentSourcesOnHorizontal[index2]=[],component.forEach(function(nodeId2){0==reversedDagOnHorizontal.get(nodeId2).length&&componentSourcesOnHorizontal[index2].push(nodeId2)})}),componentsOnVertical.forEach(function(component,index2){componentSourcesOnVertical[index2]=[],component.forEach(function(nodeId2){0==reversedDagOnVertical.get(nodeId2).length&&componentSourcesOnVertical[index2].push(nodeId2)})});var positionMapHorizontal2=findAppropriatePositionForRelativePlacement(dagOnHorizontal,"horizontal",fixedNodesOnHorizontal,dummyPositionsForVerticalAlignment,componentSourcesOnHorizontal),positionMapVertical2=findAppropriatePositionForRelativePlacement(dagOnVertical,"vertical",fixedNodesOnVertical,dummyPositionsForHorizontalAlignment,componentSourcesOnVertical),_loop9=function(key2){dummyToNodeForVerticalAlignment.get(key2)?dummyToNodeForVerticalAlignment.get(key2).forEach(function(nodeId2){xCoords[nodeIndexes.get(nodeId2)]=positionMapHorizontal2.get(key2)}):xCoords[nodeIndexes.get(key2)]=positionMapHorizontal2.get(key2)},_iteratorNormalCompletion6=!0,_didIteratorError6=!1,_iteratorError6=void 0;try{for(var _step6,_iterator6=positionMapHorizontal2.keys()[Symbol.iterator]();!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=!0)_loop9(_step6.value)}catch(err){_didIteratorError6=!0,_iteratorError6=err}finally{try{!_iteratorNormalCompletion6&&_iterator6.return&&_iterator6.return()}finally{if(_didIteratorError6)throw _iteratorError6}}var _loop10=function(key2){dummyToNodeForHorizontalAlignment.get(key2)?dummyToNodeForHorizontalAlignment.get(key2).forEach(function(nodeId2){yCoords[nodeIndexes.get(nodeId2)]=positionMapVertical2.get(key2)}):yCoords[nodeIndexes.get(key2)]=positionMapVertical2.get(key2)},_iteratorNormalCompletion7=!0,_didIteratorError7=!1,_iteratorError7=void 0;try{for(var _step7,_iterator7=positionMapVertical2.keys()[Symbol.iterator]();!(_iteratorNormalCompletion7=(_step7=_iterator7.next()).done);_iteratorNormalCompletion7=!0)_loop10(_step7.value)}catch(err){_didIteratorError7=!0,_iteratorError7=err}finally{try{!_iteratorNormalCompletion7&&_iterator7.return&&_iterator7.return()}finally{if(_didIteratorError7)throw _iteratorError7}}}()}for(var _i13=0;_i13<allNodes.length;_i13++){var _node=allNodes[_i13];null==_node.getChild()&&_node.setCenter(xCoords[nodeIndexes.get(_node.id)],yCoords[nodeIndexes.get(_node.id)])}},module2.exports=ConstraintHandler},551:module2=>{module2.exports=__WEBPACK_EXTERNAL_MODULE__551__}},__webpack_module_cache__={},function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module2,module2.exports,__webpack_require__),module2.exports}(45);var __webpack_modules__,__webpack_module_cache__},coseBase$1.exports=factory(requireLayoutBase()));var factory}var hasRequiredCytoscapeFcose,__WEBPACK_EXTERNAL_MODULE__140__,__webpack_modules__,__webpack_module_cache__;const fcose=getDefaultExportFromCjs(hasRequiredCytoscapeFcose?cytoscapeFcose$1.exports:(hasRequiredCytoscapeFcose=1,cytoscapeFcose$1.exports=(__WEBPACK_EXTERNAL_MODULE__140__=requireCoseBase(),__webpack_modules__={658:module2=>{module2.exports=null!=Object.assign?Object.assign.bind(Object):function(tgt){for(var _len=arguments.length,srcs=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)srcs[_key-1]=arguments[_key];return srcs.forEach(function(src){Object.keys(src).forEach(function(k){return tgt[k]=src[k]})}),tgt}},548:(module2,__unused_webpack_exports,__webpack_require__2)=>{var _slicedToArray=function(){return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return function(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),LinkedList=__webpack_require__2(140).layoutBase.LinkedList,auxiliary={getTopMostNodes:function(nodes){for(var nodesMap={},i=0;i<nodes.length;i++)nodesMap[nodes[i].id()]=!0;return nodes.filter(function(ele,i2){"number"==typeof ele&&(ele=i2);for(var parent=ele.parent()[0];null!=parent;){if(nodesMap[parent.id()])return!1;parent=parent.parent()[0]}return!0})},connectComponents:function(cy,eles,topMostNodes,dummyNodes){var queue=new LinkedList,visited=new Set,visitedTopMostNodes=[],currentNeighbor=void 0,minDegreeNode=void 0,minDegree=void 0,isConnected=!1,count=1,nodesConnectedToDummy=[],components=[],_loop=function(){var cmpt=cy.collection();components.push(cmpt);var currentNode=topMostNodes[0],childrenOfCurrentNode=cy.collection();childrenOfCurrentNode.merge(currentNode).merge(currentNode.descendants().intersection(eles)),visitedTopMostNodes.push(currentNode),childrenOfCurrentNode.forEach(function(node){queue.push(node),visited.add(node),cmpt.merge(node)});for(var _loop22=function(){currentNode=queue.shift();var neighborNodes=cy.collection();currentNode.neighborhood().nodes().forEach(function(node){eles.intersection(currentNode.edgesWith(node)).length>0&&neighborNodes.merge(node)});for(var i=0;i<neighborNodes.length;i++){var neighborNode=neighborNodes[i];null==(currentNeighbor=topMostNodes.intersection(neighborNode.union(neighborNode.ancestors())))||visited.has(currentNeighbor[0])||currentNeighbor.union(currentNeighbor.descendants()).forEach(function(node){queue.push(node),visited.add(node),cmpt.merge(node),topMostNodes.has(node)&&visitedTopMostNodes.push(node)})}};0!=queue.length;)_loop22();if(cmpt.forEach(function(node){eles.intersection(node.connectedEdges()).forEach(function(e){cmpt.has(e.source())&&cmpt.has(e.target())&&cmpt.merge(e)})}),visitedTopMostNodes.length==topMostNodes.length&&(isConnected=!0),!isConnected||isConnected&&count>1){minDegreeNode=visitedTopMostNodes[0],minDegree=minDegreeNode.connectedEdges().length,visitedTopMostNodes.forEach(function(node){node.connectedEdges().length<minDegree&&(minDegree=node.connectedEdges().length,minDegreeNode=node)}),nodesConnectedToDummy.push(minDegreeNode.id());var temp=cy.collection();temp.merge(visitedTopMostNodes[0]),visitedTopMostNodes.forEach(function(node){temp.merge(node)}),visitedTopMostNodes=[],topMostNodes=topMostNodes.difference(temp),count++}};do{_loop()}while(!isConnected);return dummyNodes&&nodesConnectedToDummy.length>0&&dummyNodes.set("dummy"+(dummyNodes.size+1),nodesConnectedToDummy),components},relocateComponent:function(originalCenter,componentResult,options){if(!options.fixedNodeConstraint){var minXCoord=Number.POSITIVE_INFINITY,maxXCoord=Number.NEGATIVE_INFINITY,minYCoord=Number.POSITIVE_INFINITY,maxYCoord=Number.NEGATIVE_INFINITY;if("draft"==options.quality){var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=componentResult.nodeIndexes[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var _ref=_step.value,_ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1],cyNode=options.cy.getElementById(key);if(cyNode){var nodeBB=cyNode.boundingBox(),leftX=componentResult.xCoords[value]-nodeBB.w/2,rightX=componentResult.xCoords[value]+nodeBB.w/2,topY=componentResult.yCoords[value]-nodeBB.h/2,bottomY=componentResult.yCoords[value]+nodeBB.h/2;leftX<minXCoord&&(minXCoord=leftX),rightX>maxXCoord&&(maxXCoord=rightX),topY<minYCoord&&(minYCoord=topY),bottomY>maxYCoord&&(maxYCoord=bottomY)}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{!_iteratorNormalCompletion&&_iterator.return&&_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}var diffOnX=originalCenter.x-(maxXCoord+minXCoord)/2,diffOnY=originalCenter.y-(maxYCoord+minYCoord)/2;componentResult.xCoords=componentResult.xCoords.map(function(x){return x+diffOnX}),componentResult.yCoords=componentResult.yCoords.map(function(y){return y+diffOnY})}else{Object.keys(componentResult).forEach(function(item){var node=componentResult[item],leftX2=node.getRect().x,rightX2=node.getRect().x+node.getRect().width,topY2=node.getRect().y,bottomY2=node.getRect().y+node.getRect().height;leftX2<minXCoord&&(minXCoord=leftX2),rightX2>maxXCoord&&(maxXCoord=rightX2),topY2<minYCoord&&(minYCoord=topY2),bottomY2>maxYCoord&&(maxYCoord=bottomY2)});var _diffOnX=originalCenter.x-(maxXCoord+minXCoord)/2,_diffOnY=originalCenter.y-(maxYCoord+minYCoord)/2;Object.keys(componentResult).forEach(function(item){var node=componentResult[item];node.setCenter(node.getCenterX()+_diffOnX,node.getCenterY()+_diffOnY)})}}},calcBoundingBox:function(parentNode,xCoords,yCoords,nodeIndexes){for(var left=Number.MAX_SAFE_INTEGER,right=Number.MIN_SAFE_INTEGER,top=Number.MAX_SAFE_INTEGER,bottom=Number.MIN_SAFE_INTEGER,nodeLeft=void 0,nodeRight=void 0,nodeTop=void 0,nodeBottom=void 0,nodes=parentNode.descendants().not(":parent"),s=nodes.length,i=0;i<s;i++){var node=nodes[i];left>(nodeLeft=xCoords[nodeIndexes.get(node.id())]-node.width()/2)&&(left=nodeLeft),right<(nodeRight=xCoords[nodeIndexes.get(node.id())]+node.width()/2)&&(right=nodeRight),top>(nodeTop=yCoords[nodeIndexes.get(node.id())]-node.height()/2)&&(top=nodeTop),bottom<(nodeBottom=yCoords[nodeIndexes.get(node.id())]+node.height()/2)&&(bottom=nodeBottom)}var boundingBox={};return boundingBox.topLeftX=left,boundingBox.topLeftY=top,boundingBox.width=right-left,boundingBox.height=bottom-top,boundingBox},calcParentsWithoutChildren:function(cy,eles){var parentsWithoutChildren=cy.collection();return eles.nodes(":parent").forEach(function(parent){var check=!1;parent.children().forEach(function(child){"none"!=child.css("display")&&(check=!0)}),check||parentsWithoutChildren.merge(parent)}),parentsWithoutChildren}};module2.exports=auxiliary},816:(module2,__unused_webpack_exports,__webpack_require__2)=>{var aux=__webpack_require__2(548),CoSELayout=__webpack_require__2(140).CoSELayout,CoSENode=__webpack_require__2(140).CoSENode,PointD=__webpack_require__2(140).layoutBase.PointD,DimensionD2=__webpack_require__2(140).layoutBase.DimensionD,LayoutConstants=__webpack_require__2(140).layoutBase.LayoutConstants,FDLayoutConstants=__webpack_require__2(140).layoutBase.FDLayoutConstants,CoSEConstants=__webpack_require__2(140).CoSEConstants;module2.exports={coseLayout:function(options,spectralResult){var cy=options.cy,eles=options.eles,nodes=eles.nodes(),edges=eles.edges(),nodeIndexes=void 0,xCoords=void 0,yCoords=void 0,idToLNode={};options.randomize&&(nodeIndexes=spectralResult.nodeIndexes,xCoords=spectralResult.xCoords,yCoords=spectralResult.yCoords);var isFn=function(fn){return"function"==typeof fn},optFn=function(opt,ele){return isFn(opt)?opt(ele):opt},parentsWithoutChildren=aux.calcParentsWithoutChildren(cy,eles);null!=options.nestingFactor&&(CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=options.nestingFactor),null!=options.gravity&&(CoSEConstants.DEFAULT_GRAVITY_STRENGTH=FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH=options.gravity),null!=options.numIter&&(CoSEConstants.MAX_ITERATIONS=FDLayoutConstants.MAX_ITERATIONS=options.numIter),null!=options.gravityRange&&(CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR=FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR=options.gravityRange),null!=options.gravityCompound&&(CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH=options.gravityCompound),null!=options.gravityRangeCompound&&(CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=options.gravityRangeCompound),null!=options.initialEnergyOnIncremental&&(CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL=options.initialEnergyOnIncremental),null!=options.tilingCompareBy&&(CoSEConstants.TILING_COMPARE_BY=options.tilingCompareBy),"proof"==options.quality?LayoutConstants.QUALITY=2:LayoutConstants.QUALITY=0,CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS=FDLayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS=LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS=options.nodeDimensionsIncludeLabels,CoSEConstants.DEFAULT_INCREMENTAL=FDLayoutConstants.DEFAULT_INCREMENTAL=LayoutConstants.DEFAULT_INCREMENTAL=!options.randomize,CoSEConstants.ANIMATE=FDLayoutConstants.ANIMATE=LayoutConstants.ANIMATE=options.animate,CoSEConstants.TILE=options.tile,CoSEConstants.TILING_PADDING_VERTICAL="function"==typeof options.tilingPaddingVertical?options.tilingPaddingVertical.call():options.tilingPaddingVertical,CoSEConstants.TILING_PADDING_HORIZONTAL="function"==typeof options.tilingPaddingHorizontal?options.tilingPaddingHorizontal.call():options.tilingPaddingHorizontal,CoSEConstants.DEFAULT_INCREMENTAL=FDLayoutConstants.DEFAULT_INCREMENTAL=LayoutConstants.DEFAULT_INCREMENTAL=!0,CoSEConstants.PURE_INCREMENTAL=!options.randomize,LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES=options.uniformNodeDimensions,"transformed"==options.step&&(CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,CoSEConstants.ENFORCE_CONSTRAINTS=!1,CoSEConstants.APPLY_LAYOUT=!1),"enforced"==options.step&&(CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,CoSEConstants.ENFORCE_CONSTRAINTS=!0,CoSEConstants.APPLY_LAYOUT=!1),"cose"==options.step&&(CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,CoSEConstants.ENFORCE_CONSTRAINTS=!1,CoSEConstants.APPLY_LAYOUT=!0),"all"==options.step&&(options.randomize?CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,CoSEConstants.ENFORCE_CONSTRAINTS=!0,CoSEConstants.APPLY_LAYOUT=!0),options.fixedNodeConstraint||options.alignmentConstraint||options.relativePlacementConstraint?CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL=!1:CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL=!0;var layout,options2,coseLayout3=new CoSELayout,gm=coseLayout3.newGraphManager();return function processChildrenList2(parent,children,layout,options2){for(var size=children.length,i=0;i<size;i++){var theChild=children[i],children_of_children=null;0==theChild.intersection(parentsWithoutChildren).length&&(children_of_children=theChild.children());var theNode=void 0,dimensions=theChild.layoutDimensions({nodeDimensionsIncludeLabels:options2.nodeDimensionsIncludeLabels});if(null!=theChild.outerWidth()&&null!=theChild.outerHeight())if(options2.randomize)if(theChild.isParent()){var parentInfo=aux.calcBoundingBox(theChild,xCoords,yCoords,nodeIndexes);theNode=0==theChild.intersection(parentsWithoutChildren).length?parent.add(new CoSENode(layout.graphManager,new PointD(parentInfo.topLeftX,parentInfo.topLeftY),new DimensionD2(parentInfo.width,parentInfo.height))):parent.add(new CoSENode(layout.graphManager,new PointD(parentInfo.topLeftX,parentInfo.topLeftY),new DimensionD2(parseFloat(dimensions.w),parseFloat(dimensions.h))))}else theNode=parent.add(new CoSENode(layout.graphManager,new PointD(xCoords[nodeIndexes.get(theChild.id())]-dimensions.w/2,yCoords[nodeIndexes.get(theChild.id())]-dimensions.h/2),new DimensionD2(parseFloat(dimensions.w),parseFloat(dimensions.h))));else theNode=parent.add(new CoSENode(layout.graphManager,new PointD(theChild.position("x")-dimensions.w/2,theChild.position("y")-dimensions.h/2),new DimensionD2(parseFloat(dimensions.w),parseFloat(dimensions.h))));else theNode=parent.add(new CoSENode(this.graphManager));theNode.id=theChild.data("id"),theNode.nodeRepulsion=optFn(options2.nodeRepulsion,theChild),theNode.paddingLeft=parseInt(theChild.css("padding")),theNode.paddingTop=parseInt(theChild.css("padding")),theNode.paddingRight=parseInt(theChild.css("padding")),theNode.paddingBottom=parseInt(theChild.css("padding")),options2.nodeDimensionsIncludeLabels&&(theNode.labelWidth=theChild.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,theNode.labelHeight=theChild.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,theNode.labelPosVertical=theChild.css("text-valign"),theNode.labelPosHorizontal=theChild.css("text-halign")),idToLNode[theChild.data("id")]=theNode,isNaN(theNode.rect.x)&&(theNode.rect.x=0),isNaN(theNode.rect.y)&&(theNode.rect.y=0),null!=children_of_children&&children_of_children.length>0&&processChildrenList2(layout.getGraphManager().add(layout.newGraph(),theNode),children_of_children,layout,options2)}}(gm.addRoot(),aux.getTopMostNodes(nodes),coseLayout3,options),function(layout,gm2,edges2){for(var idealLengthTotal=0,edgeCount=0,i=0;i<edges2.length;i++){var edge=edges2[i],sourceNode=idToLNode[edge.data("source")],targetNode=idToLNode[edge.data("target")];if(sourceNode&&targetNode&&sourceNode!==targetNode&&0==sourceNode.getEdgesBetween(targetNode).length){var e1=gm2.add(layout.newEdge(),sourceNode,targetNode);e1.id=edge.id(),e1.idealLength=optFn(options.idealEdgeLength,edge),e1.edgeElasticity=optFn(options.edgeElasticity,edge),idealLengthTotal+=e1.idealLength,edgeCount++}}null!=options.idealEdgeLength&&(edgeCount>0?CoSEConstants.DEFAULT_EDGE_LENGTH=FDLayoutConstants.DEFAULT_EDGE_LENGTH=idealLengthTotal/edgeCount:isFn(options.idealEdgeLength)?CoSEConstants.DEFAULT_EDGE_LENGTH=FDLayoutConstants.DEFAULT_EDGE_LENGTH=50:CoSEConstants.DEFAULT_EDGE_LENGTH=FDLayoutConstants.DEFAULT_EDGE_LENGTH=options.idealEdgeLength,CoSEConstants.MIN_REPULSION_DIST=FDLayoutConstants.MIN_REPULSION_DIST=FDLayoutConstants.DEFAULT_EDGE_LENGTH/10,CoSEConstants.DEFAULT_RADIAL_SEPARATION=FDLayoutConstants.DEFAULT_EDGE_LENGTH)}(coseLayout3,gm,edges),layout=coseLayout3,(options2=options).fixedNodeConstraint&&(layout.constraints.fixedNodeConstraint=options2.fixedNodeConstraint),options2.alignmentConstraint&&(layout.constraints.alignmentConstraint=options2.alignmentConstraint),options2.relativePlacementConstraint&&(layout.constraints.relativePlacementConstraint=options2.relativePlacementConstraint),coseLayout3.runLayout(),idToLNode}}},212:(module2,__unused_webpack_exports,__webpack_require__2)=>{var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),assign=__webpack_require__2(658),aux=__webpack_require__2(548),spectralLayout=__webpack_require__2(657).spectralLayout,coseLayout=__webpack_require__2(816).coseLayout,defaults=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(node){return 4500},idealEdgeLength:function(edge){return 50},edgeElasticity:function(edge){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(){}}),Layout2=function(){function Layout3(options){!function(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Layout3),this.options=assign({},defaults,options)}return _createClass(Layout3,[{key:"run",value:function(){var options=this.options,cy=options.cy,eles=options.eles,spectralResult=[],coseResult=[],components=void 0,componentCenters=[];!options.fixedNodeConstraint||Array.isArray(options.fixedNodeConstraint)&&0!=options.fixedNodeConstraint.length||(options.fixedNodeConstraint=void 0),options.alignmentConstraint&&(!options.alignmentConstraint.vertical||Array.isArray(options.alignmentConstraint.vertical)&&0!=options.alignmentConstraint.vertical.length||(options.alignmentConstraint.vertical=void 0),!options.alignmentConstraint.horizontal||Array.isArray(options.alignmentConstraint.horizontal)&&0!=options.alignmentConstraint.horizontal.length||(options.alignmentConstraint.horizontal=void 0)),!options.relativePlacementConstraint||Array.isArray(options.relativePlacementConstraint)&&0!=options.relativePlacementConstraint.length||(options.relativePlacementConstraint=void 0),(options.fixedNodeConstraint||options.alignmentConstraint||options.relativePlacementConstraint)&&(options.tile=!1,options.packComponents=!1);var layUtil=void 0,packingEnabled=!1;if(cy.layoutUtilities&&options.packComponents&&((layUtil=cy.layoutUtilities("get"))||(layUtil=cy.layoutUtilities()),packingEnabled=!0),eles.nodes().length>0)if(packingEnabled){var topMostNodes=aux.getTopMostNodes(options.eles.nodes());if((components=aux.connectComponents(cy,options.eles,topMostNodes)).forEach(function(component){var boundingBox2=component.boundingBox();componentCenters.push({x:boundingBox2.x1+boundingBox2.w/2,y:boundingBox2.y1+boundingBox2.h/2})}),options.randomize&&components.forEach(function(component){options.eles=component,spectralResult.push(spectralLayout(options))}),"default"==options.quality||"proof"==options.quality){var toBeTiledNodes=cy.collection();if(options.tile){var count=0,tempSpectralResult={nodeIndexes:new Map,xCoords:[],yCoords:[]},indexesToBeDeleted=[];if(components.forEach(function(component,index){0==component.edges().length&&(component.nodes().forEach(function(node,i2){toBeTiledNodes.merge(component.nodes()[i2]),node.isParent()||(tempSpectralResult.nodeIndexes.set(component.nodes()[i2].id(),count++),tempSpectralResult.xCoords.push(component.nodes()[0].position().x),tempSpectralResult.yCoords.push(component.nodes()[0].position().y))}),indexesToBeDeleted.push(index))}),toBeTiledNodes.length>1){var _boundingBox=toBeTiledNodes.boundingBox();componentCenters.push({x:_boundingBox.x1+_boundingBox.w/2,y:_boundingBox.y1+_boundingBox.h/2}),components.push(toBeTiledNodes),spectralResult.push(tempSpectralResult);for(var i=indexesToBeDeleted.length-1;i>=0;i--)components.splice(indexesToBeDeleted[i],1),spectralResult.splice(indexesToBeDeleted[i],1),componentCenters.splice(indexesToBeDeleted[i],1)}}components.forEach(function(component,index){options.eles=component,coseResult.push(coseLayout(options,spectralResult[index])),aux.relocateComponent(componentCenters[index],coseResult[index],options)})}else components.forEach(function(component,index){aux.relocateComponent(componentCenters[index],spectralResult[index],options)});var componentsEvaluated=new Set;if(components.length>1){var subgraphs=[],hiddenEles=eles.filter(function(ele){return"none"==ele.css("display")});components.forEach(function(component,index){var nodeIndexes2=void 0;if("draft"==options.quality&&(nodeIndexes2=spectralResult[index].nodeIndexes),component.nodes().not(hiddenEles).length>0){var subgraph={edges:[],nodes:[]},nodeIndex=void 0;component.nodes().not(hiddenEles).forEach(function(node){if("draft"==options.quality)if(node.isParent()){var parentInfo=aux.calcBoundingBox(node,spectralResult[index].xCoords,spectralResult[index].yCoords,nodeIndexes2);subgraph.nodes.push({x:parentInfo.topLeftX,y:parentInfo.topLeftY,width:parentInfo.width,height:parentInfo.height})}else nodeIndex=nodeIndexes2.get(node.id()),subgraph.nodes.push({x:spectralResult[index].xCoords[nodeIndex]-node.boundingbox().w/2,y:spectralResult[index].yCoords[nodeIndex]-node.boundingbox().h/2,width:node.boundingbox().w,height:node.boundingbox().h});else coseResult[index][node.id()]&&subgraph.nodes.push({x:coseResult[index][node.id()].getLeft(),y:coseResult[index][node.id()].getTop(),width:coseResult[index][node.id()].getWidth(),height:coseResult[index][node.id()].getHeight()})}),component.edges().forEach(function(edge){var source=edge.source(),target=edge.target();if("none"!=source.css("display")&&"none"!=target.css("display"))if("draft"==options.quality){var sourceNodeIndex=nodeIndexes2.get(source.id()),targetNodeIndex=nodeIndexes2.get(target.id()),sourceCenter=[],targetCenter=[];if(source.isParent()){var parentInfo=aux.calcBoundingBox(source,spectralResult[index].xCoords,spectralResult[index].yCoords,nodeIndexes2);sourceCenter.push(parentInfo.topLeftX+parentInfo.width/2),sourceCenter.push(parentInfo.topLeftY+parentInfo.height/2)}else sourceCenter.push(spectralResult[index].xCoords[sourceNodeIndex]),sourceCenter.push(spectralResult[index].yCoords[sourceNodeIndex]);if(target.isParent()){var _parentInfo=aux.calcBoundingBox(target,spectralResult[index].xCoords,spectralResult[index].yCoords,nodeIndexes2);targetCenter.push(_parentInfo.topLeftX+_parentInfo.width/2),targetCenter.push(_parentInfo.topLeftY+_parentInfo.height/2)}else targetCenter.push(spectralResult[index].xCoords[targetNodeIndex]),targetCenter.push(spectralResult[index].yCoords[targetNodeIndex]);subgraph.edges.push({startX:sourceCenter[0],startY:sourceCenter[1],endX:targetCenter[0],endY:targetCenter[1]})}else coseResult[index][source.id()]&&coseResult[index][target.id()]&&subgraph.edges.push({startX:coseResult[index][source.id()].getCenterX(),startY:coseResult[index][source.id()].getCenterY(),endX:coseResult[index][target.id()].getCenterX(),endY:coseResult[index][target.id()].getCenterY()})}),subgraph.nodes.length>0&&(subgraphs.push(subgraph),componentsEvaluated.add(index))}});var shiftResult=layUtil.packComponents(subgraphs,options.randomize).shifts;if("draft"==options.quality)spectralResult.forEach(function(result2,index){var newXCoords=result2.xCoords.map(function(x){return x+shiftResult[index].dx}),newYCoords=result2.yCoords.map(function(y){return y+shiftResult[index].dy});result2.xCoords=newXCoords,result2.yCoords=newYCoords});else{var _count=0;componentsEvaluated.forEach(function(index){Object.keys(coseResult[index]).forEach(function(item){var nodeRectangle=coseResult[index][item];nodeRectangle.setCenter(nodeRectangle.getCenterX()+shiftResult[_count].dx,nodeRectangle.getCenterY()+shiftResult[_count].dy)}),_count++})}}}else{var boundingBox=options.eles.boundingBox();if(componentCenters.push({x:boundingBox.x1+boundingBox.w/2,y:boundingBox.y1+boundingBox.h/2}),options.randomize){var result=spectralLayout(options);spectralResult.push(result)}"default"==options.quality||"proof"==options.quality?(coseResult.push(coseLayout(options,spectralResult[0])),aux.relocateComponent(componentCenters[0],coseResult[0],options)):aux.relocateComponent(componentCenters[0],spectralResult[0],options)}var getPositions=function(ele,i2){if("default"==options.quality||"proof"==options.quality){"number"==typeof ele&&(ele=i2);var pos=void 0,node=void 0,theId=ele.data("id");return coseResult.forEach(function(result2){theId in result2&&(pos={x:result2[theId].getRect().getCenterX(),y:result2[theId].getRect().getCenterY()},node=result2[theId])}),options.nodeDimensionsIncludeLabels&&(node.labelWidth&&("left"==node.labelPosHorizontal?pos.x+=node.labelWidth/2:"right"==node.labelPosHorizontal&&(pos.x-=node.labelWidth/2)),node.labelHeight&&("top"==node.labelPosVertical?pos.y+=node.labelHeight/2:"bottom"==node.labelPosVertical&&(pos.y-=node.labelHeight/2))),null==pos&&(pos={x:ele.position("x"),y:ele.position("y")}),{x:pos.x,y:pos.y}}var _pos=void 0;return spectralResult.forEach(function(result2){var index=result2.nodeIndexes.get(ele.id());null!=index&&(_pos={x:result2.xCoords[index],y:result2.yCoords[index]})}),null==_pos&&(_pos={x:ele.position("x"),y:ele.position("y")}),{x:_pos.x,y:_pos.y}};if("default"==options.quality||"proof"==options.quality||options.randomize){var parentsWithoutChildren=aux.calcParentsWithoutChildren(cy,eles),_hiddenEles=eles.filter(function(ele){return"none"==ele.css("display")});options.eles=eles.not(_hiddenEles),eles.nodes().not(":parent").not(_hiddenEles).layoutPositions(this,options,getPositions),parentsWithoutChildren.length>0&&parentsWithoutChildren.forEach(function(ele){ele.position(getPositions(ele))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),Layout3}();module2.exports=Layout2},657:(module2,__unused_webpack_exports,__webpack_require__2)=>{var aux=__webpack_require__2(548),Matrix=__webpack_require__2(140).layoutBase.Matrix,SVD=__webpack_require__2(140).layoutBase.SVD;module2.exports={spectralLayout:function(options){var cy=options.cy,eles=options.eles,nodes=eles.nodes(),parentNodes=eles.nodes(":parent"),dummyNodes=new Map,nodeIndexes=new Map,parentChildMap=new Map,allNodesNeighborhood=[],xCoords=[],yCoords=[],samplesColumn=[],minDistancesColumn=[],C=[],PHI=[],INV=[],nodeSize=void 0,piTol=options.piTol,samplingType=options.samplingType,nodeSeparation=options.nodeSeparation,sampleSize=void 0,BFS=function(pivot,index2,samplingMethod){for(var path=[],front=0,back=0,current=0,temp=void 0,distance=[],max_dist=0,max_ind=1,i2=0;i2<nodeSize;i2++)distance[i2]=1e8;for(path[back]=pivot,distance[pivot]=0;back>=front;){current=path[front++];for(var neighbors=allNodesNeighborhood[current],_i=0;_i<neighbors.length;_i++)1e8==distance[temp=nodeIndexes.get(neighbors[_i])]&&(distance[temp]=distance[current]+1,path[++back]=temp);C[current][index2]=distance[current]*nodeSeparation}if(samplingMethod){for(var _i2=0;_i2<nodeSize;_i2++)C[_i2][index2]<minDistancesColumn[_i2]&&(minDistancesColumn[_i2]=C[_i2][index2]);for(var _i3=0;_i3<nodeSize;_i3++)minDistancesColumn[_i3]>max_dist&&(max_dist=minDistancesColumn[_i3],max_ind=_i3)}return max_ind};aux.connectComponents(cy,eles,aux.getTopMostNodes(nodes),dummyNodes),parentNodes.forEach(function(ele){aux.connectComponents(cy,eles,aux.getTopMostNodes(ele.descendants().intersection(eles)),dummyNodes)});for(var index=0,i=0;i<nodes.length;i++)nodes[i].isParent()||nodeIndexes.set(nodes[i].id(),index++);var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=dummyNodes.keys()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var key=_step.value;nodeIndexes.set(key,index++)}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{!_iteratorNormalCompletion&&_iterator.return&&_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}for(var _i13=0;_i13<nodeIndexes.size;_i13++)allNodesNeighborhood[_i13]=[];parentNodes.forEach(function(ele){for(var children=ele.children().intersection(eles);0==children.nodes(":childless").length;)children=children.nodes()[0].children().intersection(eles);var index2=0,min=children.nodes(":childless")[0].connectedEdges().length;children.nodes(":childless").forEach(function(ele2,i2){ele2.connectedEdges().length<min&&(min=ele2.connectedEdges().length,index2=i2)}),parentChildMap.set(ele.id(),children.nodes(":childless")[index2].id())}),nodes.forEach(function(ele){var eleIndex=void 0;eleIndex=ele.isParent()?nodeIndexes.get(parentChildMap.get(ele.id())):nodeIndexes.get(ele.id()),ele.neighborhood().nodes().forEach(function(node){eles.intersection(ele.edgesWith(node)).length>0&&(node.isParent()?allNodesNeighborhood[eleIndex].push(parentChildMap.get(node.id())):allNodesNeighborhood[eleIndex].push(node.id()))})});var _loop=function(_key2){var eleIndex=nodeIndexes.get(_key2),disconnectedId=void 0;dummyNodes.get(_key2).forEach(function(id){disconnectedId=cy.getElementById(id).isParent()?parentChildMap.get(id):id,allNodesNeighborhood[eleIndex].push(disconnectedId),allNodesNeighborhood[nodeIndexes.get(disconnectedId)].push(_key2)})},_iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_iterator2=dummyNodes.keys()[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0)_loop(_step2.value)}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{!_iteratorNormalCompletion2&&_iterator2.return&&_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}var spectralResult=void 0;if((nodeSize=nodeIndexes.size)>2){sampleSize=nodeSize<options.sampleSize?nodeSize:options.sampleSize;for(var _i14=0;_i14<nodeSize;_i14++)C[_i14]=[];for(var _i15=0;_i15<sampleSize;_i15++)INV[_i15]=[];return"draft"==options.quality||"all"==options.step?(function(samplingMethod){var sample2=void 0;if(samplingMethod){sample2=Math.floor(Math.random()*nodeSize);for(var _i4=0;_i4<nodeSize;_i4++)minDistancesColumn[_i4]=1e8;for(var _i5=0;_i5<sampleSize;_i5++)samplesColumn[_i5]=sample2,sample2=BFS(sample2,_i5,samplingMethod)}else{!function(){for(var sample2=0,count=0,flag=!1;count<sampleSize;){sample2=Math.floor(Math.random()*nodeSize),flag=!1;for(var i2=0;i2<count;i2++)if(samplesColumn[i2]==sample2){flag=!0;break}flag||(samplesColumn[count]=sample2,count++)}}();for(var i2=0;i2<sampleSize;i2++)BFS(samplesColumn[i2],i2,samplingMethod)}for(var _i6=0;_i6<nodeSize;_i6++)for(var j=0;j<sampleSize;j++)C[_i6][j]*=C[_i6][j];for(var _i7=0;_i7<sampleSize;_i7++)PHI[_i7]=[];for(var _i8=0;_i8<sampleSize;_i8++)for(var _j=0;_j<sampleSize;_j++)PHI[_i8][_j]=C[samplesColumn[_j]][_i8]}(samplingType),function(){for(var SVDResult=SVD.svd(PHI),a_q=SVDResult.S,a_u=SVDResult.U,a_v=SVDResult.V,max_s=a_q[0]*a_q[0]*a_q[0],a_Sig=[],i2=0;i2<sampleSize;i2++){a_Sig[i2]=[];for(var j=0;j<sampleSize;j++)a_Sig[i2][j]=0,i2==j&&(a_Sig[i2][j]=a_q[i2]/(a_q[i2]*a_q[i2]+max_s/(a_q[i2]*a_q[i2])))}INV=Matrix.multMat(Matrix.multMat(a_v,a_Sig),Matrix.transpose(a_u))}(),function(){for(var theta1=void 0,theta2=void 0,Y1=[],Y2=[],V1=[],V2=[],i2=0;i2<nodeSize;i2++)Y1[i2]=Math.random(),Y2[i2]=Math.random();Y1=Matrix.normalize(Y1),Y2=Matrix.normalize(Y2);for(var current=1e-9,previous=1e-9,temp=void 0;;){for(var _i9=0;_i9<nodeSize;_i9++)V1[_i9]=Y1[_i9];if(Y1=Matrix.multGamma(Matrix.multL(Matrix.multGamma(V1),C,INV)),theta1=Matrix.dotProduct(V1,Y1),Y1=Matrix.normalize(Y1),current=Matrix.dotProduct(V1,Y1),(temp=Math.abs(current/previous))<=1+piTol&&temp>=1)break;previous=current}for(var _i10=0;_i10<nodeSize;_i10++)V1[_i10]=Y1[_i10];for(previous=1e-9;;){for(var _i11=0;_i11<nodeSize;_i11++)V2[_i11]=Y2[_i11];if(V2=Matrix.minusOp(V2,Matrix.multCons(V1,Matrix.dotProduct(V1,V2))),Y2=Matrix.multGamma(Matrix.multL(Matrix.multGamma(V2),C,INV)),theta2=Matrix.dotProduct(V2,Y2),Y2=Matrix.normalize(Y2),current=Matrix.dotProduct(V2,Y2),(temp=Math.abs(current/previous))<=1+piTol&&temp>=1)break;previous=current}for(var _i12=0;_i12<nodeSize;_i12++)V2[_i12]=Y2[_i12];xCoords=Matrix.multCons(V1,Math.sqrt(Math.abs(theta1))),yCoords=Matrix.multCons(V2,Math.sqrt(Math.abs(theta2)))}(),spectralResult={nodeIndexes:nodeIndexes,xCoords:xCoords,yCoords:yCoords}):(nodeIndexes.forEach(function(value,key2){xCoords.push(cy.getElementById(key2).position("x")),yCoords.push(cy.getElementById(key2).position("y"))}),spectralResult={nodeIndexes:nodeIndexes,xCoords:xCoords,yCoords:yCoords}),spectralResult}var iterator=nodeIndexes.keys(),firstNode=cy.getElementById(iterator.next().value),firstNodePos=firstNode.position(),firstNodeWidth=firstNode.outerWidth();if(xCoords.push(firstNodePos.x),yCoords.push(firstNodePos.y),2==nodeSize){var secondNodeWidth=cy.getElementById(iterator.next().value).outerWidth();xCoords.push(firstNodePos.x+firstNodeWidth/2+secondNodeWidth/2+options.idealEdgeLength),yCoords.push(firstNodePos.y)}return spectralResult={nodeIndexes:nodeIndexes,xCoords:xCoords,yCoords:yCoords}}}},579:(module2,__unused_webpack_exports,__webpack_require__2)=>{var impl=__webpack_require__2(212),register=function(cytoscape2){cytoscape2&&cytoscape2("layout","fcose",impl)};"undefined"!=typeof cytoscape&®ister(cytoscape),module2.exports=register},140:module2=>{module2.exports=__WEBPACK_EXTERNAL_MODULE__140__}},__webpack_module_cache__={},function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module2,module2.exports,__webpack_require__),module2.exports}(579))));var ArchitectureDirectionName={L:"left",R:"right",T:"top",B:"bottom"},ArchitectureDirectionArrow={L:__name(scale=>`${scale},${scale/2} 0,${scale} 0,0`,"L"),R:__name(scale=>`0,${scale/2} ${scale},0 ${scale},${scale}`,"R"),T:__name(scale=>`0,0 ${scale},0 ${scale/2},${scale}`,"T"),B:__name(scale=>`${scale/2},0 ${scale},${scale} 0,${scale}`,"B")},ArchitectureDirectionArrowShift={L:__name((orig,arrowSize)=>orig-arrowSize+2,"L"),R:__name((orig,_arrowSize)=>orig-2,"R"),T:__name((orig,arrowSize)=>orig-arrowSize+2,"T"),B:__name((orig,_arrowSize)=>orig-2,"B")},getOppositeArchitectureDirection=__name(function(x){return isArchitectureDirectionX(x)?"L"===x?"R":"L":"T"===x?"B":"T"},"getOppositeArchitectureDirection"),isArchitectureDirection=__name(function(x){return"L"===x||"R"===x||"T"===x||"B"===x},"isArchitectureDirection"),isArchitectureDirectionX=__name(function(x){return"L"===x||"R"===x},"isArchitectureDirectionX"),isArchitectureDirectionY=__name(function(x){return"T"===x||"B"===x},"isArchitectureDirectionY"),isArchitectureDirectionXY=__name(function(a,b){const aX_bY=isArchitectureDirectionX(a)&&isArchitectureDirectionY(b),aY_bX=isArchitectureDirectionY(a)&&isArchitectureDirectionX(b);return aX_bY||aY_bX},"isArchitectureDirectionXY"),isArchitecturePairXY=__name(function(pair){const lhs=pair[0],rhs=pair[1],aX_bY=isArchitectureDirectionX(lhs)&&isArchitectureDirectionY(rhs),aY_bX=isArchitectureDirectionY(lhs)&&isArchitectureDirectionX(rhs);return aX_bY||aY_bX},"isArchitecturePairXY"),isValidArchitectureDirectionPair=__name(function(x){return"LL"!==x&&"RR"!==x&&"TT"!==x&&"BB"!==x},"isValidArchitectureDirectionPair"),getArchitectureDirectionPair=__name(function(sourceDir,targetDir){const pair=`${sourceDir}${targetDir}`;return isValidArchitectureDirectionPair(pair)?pair:void 0},"getArchitectureDirectionPair"),shiftPositionByArchitectureDirectionPair=__name(function([x,y],pair){const lhs=pair[0],rhs=pair[1];return isArchitectureDirectionX(lhs)?isArchitectureDirectionY(rhs)?[x+("L"===lhs?-1:1),y+("T"===rhs?1:-1)]:[x+("L"===lhs?-1:1),y]:isArchitectureDirectionX(rhs)?[x+("L"===rhs?1:-1),y+("T"===lhs?1:-1)]:[x,y+("T"===lhs?1:-1)]},"shiftPositionByArchitectureDirectionPair"),getArchitectureDirectionXYFactors=__name(function(pair){return"LT"===pair||"TL"===pair?[1,1]:"BL"===pair||"LB"===pair?[1,-1]:"BR"===pair||"RB"===pair?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),getArchitectureDirectionAlignment=__name(function(a,b){return isArchitectureDirectionXY(a,b)?"bend":isArchitectureDirectionX(a)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),isArchitectureService=__name(function(x){return"service"===x.type},"isArchitectureService"),isArchitectureJunction=__name(function(x){return"junction"===x.type},"isArchitectureJunction"),edgeData=__name(edge=>edge.data(),"edgeData"),nodeData=__name(node=>node.data(),"nodeData"),DEFAULT_ARCHITECTURE_CONFIG=defaultConfig_default.architecture,ArchitectureDB=(__name(_a=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=setAccTitle,this.getAccTitle=getAccTitle,this.setDiagramTitle=setDiagramTitle,this.getDiagramTitle=getDiagramTitle,this.getAccDescription=getAccDescription,this.setAccDescription=setAccDescription,this.clear()}setDiagramId(id){this.diagramId=id}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",clear()}addService({id:id,icon:icon,in:parent,title:title,iconText:iconText}){if(void 0!==this.registeredIds[id])throw new Error(`The service id [${id}] is already in use by another ${this.registeredIds[id]}`);if(void 0!==parent){if(id===parent)throw new Error(`The service [${id}] cannot be placed within itself`);if(void 0===this.registeredIds[parent])throw new Error(`The service [${id}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===this.registeredIds[parent])throw new Error(`The service [${id}]'s parent is not a group`)}this.registeredIds[id]="node",this.nodes[id]={id:id,type:"service",icon:icon,iconText:iconText,title:title,edges:[],in:parent}}getServices(){return Object.values(this.nodes).filter(isArchitectureService)}addJunction({id:id,in:parent}){if(void 0!==this.registeredIds[id])throw new Error(`The junction id [${id}] is already in use by another ${this.registeredIds[id]}`);if(void 0!==parent){if(id===parent)throw new Error(`The junction [${id}] cannot be placed within itself`);if(void 0===this.registeredIds[parent])throw new Error(`The junction [${id}]'s parent does not exist. Please make sure the parent is created before this junction`);if("node"===this.registeredIds[parent])throw new Error(`The junction [${id}]'s parent is not a group`)}this.registeredIds[id]="node",this.nodes[id]={id:id,type:"junction",edges:[],in:parent}}getJunctions(){return Object.values(this.nodes).filter(isArchitectureJunction)}getNodes(){return Object.values(this.nodes)}getNode(id){return this.nodes[id]??null}addGroup({id:id,icon:icon,in:parent,title:title}){var _a2,_b,_c;if(void 0!==(null==(_a2=this.registeredIds)?void 0:_a2[id]))throw new Error(`The group id [${id}] is already in use by another ${this.registeredIds[id]}`);if(void 0!==parent){if(id===parent)throw new Error(`The group [${id}] cannot be placed within itself`);if(void 0===(null==(_b=this.registeredIds)?void 0:_b[parent]))throw new Error(`The group [${id}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===(null==(_c=this.registeredIds)?void 0:_c[parent]))throw new Error(`The group [${id}]'s parent is not a group`)}this.registeredIds[id]="group",this.groups[id]={id:id,icon:icon,title:title,in:parent}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:lhsId,rhsId:rhsId,lhsDir:lhsDir,rhsDir:rhsDir,lhsInto:lhsInto,rhsInto:rhsInto,lhsGroup:lhsGroup,rhsGroup:rhsGroup,title:title}){if(!isArchitectureDirection(lhsDir))throw new Error(`Invalid direction given for left hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${String(lhsDir)}`);if(!isArchitectureDirection(rhsDir))throw new Error(`Invalid direction given for right hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${String(rhsDir)}`);if(void 0===this.nodes[lhsId]&&void 0===this.groups[lhsId])throw new Error(`The left-hand id [${lhsId}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===this.nodes[rhsId]&&void 0===this.groups[rhsId])throw new Error(`The right-hand id [${rhsId}] does not yet exist. Please create the service/group before declaring an edge to it.`);const lhsGroupId=this.nodes[lhsId].in,rhsGroupId=this.nodes[rhsId].in;if(lhsGroup&&lhsGroupId&&rhsGroupId&&lhsGroupId==rhsGroupId)throw new Error(`The left-hand id [${lhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(rhsGroup&&lhsGroupId&&rhsGroupId&&lhsGroupId==rhsGroupId)throw new Error(`The right-hand id [${rhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const edge={lhsId:lhsId,lhsDir:lhsDir,lhsInto:lhsInto,lhsGroup:lhsGroup,rhsId:rhsId,rhsDir:rhsDir,rhsInto:rhsInto,rhsGroup:rhsGroup,title:title};this.edges.push(edge),this.nodes[lhsId]&&this.nodes[rhsId]&&(this.nodes[lhsId].edges.push(this.edges[this.edges.length-1]),this.nodes[rhsId].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(void 0===this.dataStructures){const groupAlignments={},adjList=Object.entries(this.nodes).reduce((prevOuter,[id,service])=>(prevOuter[id]=service.edges.reduce((prevInner,edge)=>{var _a2,_b;const lhsGroupId=null==(_a2=this.getNode(edge.lhsId))?void 0:_a2.in,rhsGroupId=null==(_b=this.getNode(edge.rhsId))?void 0:_b.in;if(lhsGroupId&&rhsGroupId&&lhsGroupId!==rhsGroupId){const alignment=getArchitectureDirectionAlignment(edge.lhsDir,edge.rhsDir);"bend"!==alignment&&(groupAlignments[lhsGroupId]??(groupAlignments[lhsGroupId]={}),groupAlignments[lhsGroupId][rhsGroupId]=alignment,groupAlignments[rhsGroupId]??(groupAlignments[rhsGroupId]={}),groupAlignments[rhsGroupId][lhsGroupId]=alignment)}if(edge.lhsId===id){const pair=getArchitectureDirectionPair(edge.lhsDir,edge.rhsDir);pair&&(prevInner[pair]=edge.rhsId)}else{const pair=getArchitectureDirectionPair(edge.rhsDir,edge.lhsDir);pair&&(prevInner[pair]=edge.lhsId)}return prevInner},{}),prevOuter),{}),firstId=Object.keys(adjList)[0],visited={[firstId]:1},notVisited=Object.keys(adjList).reduce((prev,id)=>id===firstId?prev:{...prev,[id]:1},{}),BFS=__name(startingId=>{const spatialMap={[startingId]:[0,0]},queue=[startingId];for(;queue.length>0;){const id=queue.shift();if(id){visited[id]=1,delete notVisited[id];const adj=adjList[id],[posX,posY]=spatialMap[id];Object.entries(adj).forEach(([dir,rhsId])=>{visited[rhsId]||(spatialMap[rhsId]=shiftPositionByArchitectureDirectionPair([posX,posY],dir),queue.push(rhsId))})}}return spatialMap},"BFS"),spatialMaps=[BFS(firstId)];for(;Object.keys(notVisited).length>0;)spatialMaps.push(BFS(Object.keys(notVisited)[0]));this.dataStructures={adjList:adjList,spatialMaps:spatialMaps,groupAlignments:groupAlignments}}return this.dataStructures}setElementForId(id,element){this.elements[id]=element}getElementById(id){return this.elements[id]}getConfig(){return cleanAndMerge({...DEFAULT_ARCHITECTURE_CONFIG,...getConfig().architecture})}getConfigField(field){return this.getConfig()[field]}},"ArchitectureDB"),_a),populateDb=__name((ast,db)=>{populateCommonDb(ast,db),ast.groups.map(group=>db.addGroup(group)),ast.services.map(service=>db.addService({...service,type:"service"})),ast.junctions.map(service=>db.addJunction({...service,type:"junction"})),ast.edges.map(edge=>db.addEdge(edge))},"populateDb"),parser={parser:{yy:void 0},parse:__name(async input=>{var _a2;const ast=await parse("architecture",input);log.debug(ast);const db=null==(_a2=parser.parser)?void 0:_a2.yy;if(!(db instanceof ArchitectureDB))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.");populateDb(ast,db)},"parse")},architectureStyles_default=__name(options=>`\n .edge {\n stroke-width: ${options.archEdgeWidth};\n stroke: ${options.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${options.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${options.archGroupBorderColor};\n stroke-width: ${options.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`,"getStyles"),wrapIcon=__name(icon=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${icon}</g>`,"wrapIcon"),architectureIcons={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:wrapIcon('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:wrapIcon('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:wrapIcon('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:wrapIcon('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:wrapIcon('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:unknownIcon,blank:{body:wrapIcon("")}}},drawEdges=__name(async function(edgesEl,cy,db,diagramId){const padding=db.getConfigField("padding"),iconSize=db.getConfigField("iconSize"),halfIconSize=iconSize/2,arrowSize=iconSize/6,halfArrowSize=arrowSize/2;await Promise.all(cy.edges().map(async edge=>{var _a2,_b;const{source:source,sourceDir:sourceDir,sourceArrow:sourceArrow,sourceGroup:sourceGroup,target:target,targetDir:targetDir,targetArrow:targetArrow,targetGroup:targetGroup,label:label}=edgeData(edge);let{x:startX,y:startY}=edge[0].sourceEndpoint();const{x:midX,y:midY}=edge[0].midpoint();let{x:endX,y:endY}=edge[0].targetEndpoint();const groupEdgeShift=padding+4;if(sourceGroup&&(isArchitectureDirectionX(sourceDir)?startX+="L"===sourceDir?-groupEdgeShift:groupEdgeShift:startY+="T"===sourceDir?-groupEdgeShift:groupEdgeShift+18),targetGroup&&(isArchitectureDirectionX(targetDir)?endX+="L"===targetDir?-groupEdgeShift:groupEdgeShift:endY+="T"===targetDir?-groupEdgeShift:groupEdgeShift+18),sourceGroup||"junction"!==(null==(_a2=db.getNode(source))?void 0:_a2.type)||(isArchitectureDirectionX(sourceDir)?startX+="L"===sourceDir?halfIconSize:-halfIconSize:startY+="T"===sourceDir?halfIconSize:-halfIconSize),targetGroup||"junction"!==(null==(_b=db.getNode(target))?void 0:_b.type)||(isArchitectureDirectionX(targetDir)?endX+="L"===targetDir?halfIconSize:-halfIconSize:endY+="T"===targetDir?halfIconSize:-halfIconSize),edge[0]._private.rscratch){const g=edgesEl.insert("g");if(g.insert("path").attr("d",`M ${startX},${startY} L ${midX},${midY} L${endX},${endY} `).attr("class","edge").attr("id",`${diagramId}-${getEdgeId(source,target,{prefix:"L"})}`),sourceArrow){const xShift=isArchitectureDirectionX(sourceDir)?ArchitectureDirectionArrowShift[sourceDir](startX,arrowSize):startX-halfArrowSize,yShift=isArchitectureDirectionY(sourceDir)?ArchitectureDirectionArrowShift[sourceDir](startY,arrowSize):startY-halfArrowSize;g.insert("polygon").attr("points",ArchitectureDirectionArrow[sourceDir](arrowSize)).attr("transform",`translate(${xShift},${yShift})`).attr("class","arrow")}if(targetArrow){const xShift=isArchitectureDirectionX(targetDir)?ArchitectureDirectionArrowShift[targetDir](endX,arrowSize):endX-halfArrowSize,yShift=isArchitectureDirectionY(targetDir)?ArchitectureDirectionArrowShift[targetDir](endY,arrowSize):endY-halfArrowSize;g.insert("polygon").attr("points",ArchitectureDirectionArrow[targetDir](arrowSize)).attr("transform",`translate(${xShift},${yShift})`).attr("class","arrow")}if(label){const axis=isArchitectureDirectionXY(sourceDir,targetDir)?"XY":isArchitectureDirectionX(sourceDir)?"X":"Y";let width=0;width="X"===axis?Math.abs(startX-endX):"Y"===axis?Math.abs(startY-endY)/1.5:Math.abs(startX-endX)/2;const textElem=g.append("g");if(await createText(textElem,label,{useHtmlLabels:!1,width:width,classes:"architecture-service-label"},getConfig2()),textElem.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===axis)textElem.attr("transform","translate("+midX+", "+midY+")");else if("Y"===axis)textElem.attr("transform","translate("+midX+", "+midY+") rotate(-90)");else if("XY"===axis){const pair=getArchitectureDirectionPair(sourceDir,targetDir);if(pair&&isArchitecturePairXY(pair)){const bboxOrig=textElem.node().getBoundingClientRect(),[x,y]=getArchitectureDirectionXYFactors(pair);textElem.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*x*y*45})`);const bboxNew=textElem.node().getBoundingClientRect();textElem.attr("transform",`\n translate(${midX}, ${midY-bboxOrig.height/2})\n translate(${x*bboxNew.width/2}, ${y*bboxNew.height/2})\n rotate(${-1*x*y*45}, 0, ${bboxOrig.height/2})\n `)}}}}}))},"drawEdges"),drawGroups=__name(async function(groupsEl,cy,db,diagramId){const groupIconSize=.75*db.getConfigField("padding"),fontSize=db.getConfigField("fontSize"),halfIconSize=db.getConfigField("iconSize")/2;await Promise.all(cy.nodes().map(async node=>{const data=nodeData(node);if("group"===data.type){const{h:h,w:w,x1:x1,y1:y1}=node.boundingBox(),groupsNode=groupsEl.append("rect");groupsNode.attr("id",`${diagramId}-group-${data.id}`).attr("x",x1+halfIconSize).attr("y",y1+halfIconSize).attr("width",w).attr("height",h).attr("class","node-bkg");const groupLabelContainer=groupsEl.append("g");let shiftedX1=x1,shiftedY1=y1;if(data.icon){const bkgElem=groupLabelContainer.append("g");bkgElem.html(`<g>${await getIconSVG(data.icon,{height:groupIconSize,width:groupIconSize,fallbackPrefix:architectureIcons.prefix})}</g>`),bkgElem.attr("transform","translate("+(shiftedX1+halfIconSize+1)+", "+(shiftedY1+halfIconSize+1)+")"),shiftedX1+=groupIconSize,shiftedY1+=fontSize/2-1-2}if(data.label){const textElem=groupLabelContainer.append("g");await createText(textElem,data.label,{useHtmlLabels:!1,width:w,classes:"architecture-service-label"},getConfig2()),textElem.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),textElem.attr("transform","translate("+(shiftedX1+halfIconSize+4)+", "+(shiftedY1+halfIconSize+2)+")")}db.setElementForId(data.id,groupsNode)}}))},"drawGroups"),drawServices=__name(async function(db,elem,services,diagramId){const config=getConfig2();for(const service of services){const serviceElem=elem.append("g"),iconSize=db.getConfigField("iconSize");if(service.title){const textElem=serviceElem.append("g");await createText(textElem,service.title,{useHtmlLabels:!1,width:1.5*iconSize,classes:"architecture-service-label"},config),textElem.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),textElem.attr("transform","translate("+iconSize/2+", "+iconSize+")")}const bkgElem=serviceElem.append("g");if(service.icon)bkgElem.html(`<g>${await getIconSVG(service.icon,{height:iconSize,width:iconSize,fallbackPrefix:architectureIcons.prefix})}</g>`);else if(service.iconText){bkgElem.html(`<g>${await getIconSVG("blank",{height:iconSize,width:iconSize,fallbackPrefix:architectureIcons.prefix})}</g>`);const divElem=bkgElem.append("g").append("foreignObject").attr("width",iconSize).attr("height",iconSize).append("div").attr("class","node-icon-text").attr("style",`height: ${iconSize}px;`).append("div").html(sanitizeText(service.iconText,config)),fontSize=parseInt(window.getComputedStyle(divElem.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;divElem.attr("style",`-webkit-line-clamp: ${Math.floor((iconSize-2)/fontSize)};`)}else bkgElem.append("path").attr("class","node-bkg").attr("id",`${diagramId}-node-${service.id}`).attr("d",`M0,${iconSize} V5 Q0,0 5,0 H${iconSize-5} Q${iconSize},0 ${iconSize},5 V${iconSize} Z`);serviceElem.attr("id",`${diagramId}-service-${service.id}`).attr("class","architecture-service");const{width:width,height:height}=serviceElem.node().getBBox();service.width=width,service.height=height,db.setElementForId(service.id,serviceElem)}return 0},"drawServices"),drawJunctions=__name(function(db,elem,junctions,diagramId){junctions.forEach(junction=>{const junctionElem=elem.append("g"),iconSize=db.getConfigField("iconSize");junctionElem.append("g").append("rect").attr("id",`${diagramId}-node-${junction.id}`).attr("fill-opacity","0").attr("width",iconSize).attr("height",iconSize),junctionElem.attr("class","architecture-junction");const{width:width,height:height}=junctionElem._groups[0][0].getBBox();junctionElem.width=width,junctionElem.height=height,db.setElementForId(junction.id,junctionElem)})},"drawJunctions");function addServices(services,cy,db){services.forEach(service=>{cy.add({group:"nodes",data:{type:"service",id:service.id,icon:service.icon,label:service.title,parent:service.in,width:db.getConfigField("iconSize"),height:db.getConfigField("iconSize")},classes:"node-service"})})}function addJunctions(junctions,cy,db){junctions.forEach(junction=>{cy.add({group:"nodes",data:{type:"junction",id:junction.id,parent:junction.in,width:db.getConfigField("iconSize"),height:db.getConfigField("iconSize")},classes:"node-junction"})})}function positionNodes(db,cy){cy.nodes().map(node=>{const data=nodeData(node);if("group"===data.type)return;data.x=node.position().x,data.y=node.position().y;db.getElementById(data.id).attr("transform","translate("+(data.x||0)+","+(data.y||0)+")")})}function addGroups(groups,cy){groups.forEach(group=>{cy.add({group:"nodes",data:{type:"group",id:group.id,icon:group.icon,label:group.title,parent:group.in},classes:"node-group"})})}function addEdges(edges,cy){edges.forEach(parsedEdge=>{const{lhsId:lhsId,rhsId:rhsId,lhsInto:lhsInto,lhsGroup:lhsGroup,rhsInto:rhsInto,lhsDir:lhsDir,rhsDir:rhsDir,rhsGroup:rhsGroup,title:title}=parsedEdge,edgeType=isArchitectureDirectionXY(parsedEdge.lhsDir,parsedEdge.rhsDir)?"segments":"straight",edge={id:`${lhsId}-${rhsId}`,label:title,source:lhsId,sourceDir:lhsDir,sourceArrow:lhsInto,sourceGroup:lhsGroup,sourceEndpoint:"L"===lhsDir?"0 50%":"R"===lhsDir?"100% 50%":"T"===lhsDir?"50% 0":"50% 100%",target:rhsId,targetDir:rhsDir,targetArrow:rhsInto,targetGroup:rhsGroup,targetEndpoint:"L"===rhsDir?"0 50%":"R"===rhsDir?"100% 50%":"T"===rhsDir?"50% 0":"50% 100%"};cy.add({group:"edges",data:edge,classes:edgeType})})}function getAlignments(db,spatialMaps,groupAlignments){const flattenAlignments=__name((alignmentObj,alignmentDir)=>Object.entries(alignmentObj).reduce((prev,[dir,alignments2])=>{var _a2;let cnt=0;const arr=Object.entries(alignments2);if(1===arr.length)return prev[dir]=arr[0][1],prev;for(let i=0;i<arr.length-1;i++)for(let j=i+1;j<arr.length;j++){const[aGroupId,aNodeIds]=arr[i],[bGroupId,bNodeIds]=arr[j];if((null==(_a2=groupAlignments[aGroupId])?void 0:_a2[bGroupId])===alignmentDir)prev[dir]??(prev[dir]=[]),prev[dir]=[...prev[dir],...aNodeIds,...bNodeIds];else if("default"===aGroupId||"default"===bGroupId)prev[dir]??(prev[dir]=[]),prev[dir]=[...prev[dir],...aNodeIds,...bNodeIds];else{prev[`${dir}-${cnt++}`]=aNodeIds;prev[`${dir}-${cnt++}`]=bNodeIds}}return prev},{}),"flattenAlignments"),alignments=spatialMaps.map(spatialMap=>{const horizontalAlignments={},verticalAlignments={};return Object.entries(spatialMap).forEach(([id,[x,y]])=>{var _a2,_b,_c;const nodeGroup=(null==(_a2=db.getNode(id))?void 0:_a2.in)??"default";horizontalAlignments[y]??(horizontalAlignments[y]={}),(_b=horizontalAlignments[y])[nodeGroup]??(_b[nodeGroup]=[]),horizontalAlignments[y][nodeGroup].push(id),verticalAlignments[x]??(verticalAlignments[x]={}),(_c=verticalAlignments[x])[nodeGroup]??(_c[nodeGroup]=[]),verticalAlignments[x][nodeGroup].push(id)}),{horiz:Object.values(flattenAlignments(horizontalAlignments,"horizontal")).filter(arr=>arr.length>1),vert:Object.values(flattenAlignments(verticalAlignments,"vertical")).filter(arr=>arr.length>1)}}),[horizontal,vertical]=alignments.reduce(([prevHoriz,prevVert],{horiz:horiz,vert:vert})=>[[...prevHoriz,...horiz],[...prevVert,...vert]],[[],[]]);return{horizontal:horizontal,vertical:vertical}}function getRelativeConstraints(spatialMaps,db){const relativeConstraints=[],posToStr=__name(pos=>`${pos[0]},${pos[1]}`,"posToStr"),strToPos=__name(pos=>pos.split(",").map(p=>parseInt(p)),"strToPos");return spatialMaps.forEach(spatialMap=>{const invSpatialMap=Object.fromEntries(Object.entries(spatialMap).map(([id,pos])=>[posToStr(pos),id])),queue=[posToStr([0,0])],visited={},directions={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;queue.length>0;){const curr=queue.shift();if(curr){visited[curr]=1;const currId=invSpatialMap[curr];if(currId){const currPos=strToPos(curr);Object.entries(directions).forEach(([dir,shift])=>{const newPos=posToStr([currPos[0]+shift[0],currPos[1]+shift[1]]),newId=invSpatialMap[newPos];newId&&!visited[newPos]&&(queue.push(newPos),relativeConstraints.push({[ArchitectureDirectionName[dir]]:newId,[ArchitectureDirectionName[getOppositeArchitectureDirection(dir)]]:currId,gap:1.5*db.getConfigField("iconSize")}))})}}}}),relativeConstraints}function layoutArchitecture(services,junctions,groups,edges,db,{spatialMaps:spatialMaps,groupAlignments:groupAlignments}){return new Promise(resolve=>{const renderEl=select("body").append("div").attr("id","cy").attr("style","display:none"),cy=cytoscape$1({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${db.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${db.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});renderEl.remove(),addGroups(groups,cy),addServices(services,cy,db),addJunctions(junctions,cy,db),addEdges(edges,cy);const alignmentConstraint=getAlignments(db,spatialMaps,groupAlignments),relativePlacementConstraint=getRelativeConstraints(spatialMaps,db),layout=cy.layout({name:"fcose",quality:"proof",randomize:db.getConfigField("randomize"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(edge){const[nodeA,nodeB]=edge.connectedNodes(),{parent:parentA}=nodeData(nodeA),{parent:parentB}=nodeData(nodeB);return parentA===parentB?1.5*db.getConfigField("iconSize"):.5*db.getConfigField("iconSize")},edgeElasticity(edge){const[nodeA,nodeB]=edge.connectedNodes(),{parent:parentA}=nodeData(nodeA),{parent:parentB}=nodeData(nodeB);return parentA===parentB?.45:.001},alignmentConstraint:alignmentConstraint,relativePlacementConstraint:relativePlacementConstraint});layout.one("layoutstop",()=>{var _a2;function getSegmentWeights(source,target,pointX,pointY){let W,D;const{x:sX,y:sY}=source,{x:tX,y:tY}=target;D=(pointY-sY+(sX-pointX)*(sY-tY)/(sX-tX))/Math.sqrt(1+Math.pow((sY-tY)/(sX-tX),2)),W=Math.sqrt(Math.pow(pointY-sY,2)+Math.pow(pointX-sX,2)-Math.pow(D,2));W/=Math.sqrt(Math.pow(tX-sX,2)+Math.pow(tY-sY,2));let delta1=(tX-sX)*(pointY-sY)-(tY-sY)*(pointX-sX);switch(!0){case delta1>=0:delta1=1;break;case delta1<0:delta1=-1}let delta2=(tX-sX)*(pointX-sX)+(tY-sY)*(pointY-sY);switch(!0){case delta2>=0:delta2=1;break;case delta2<0:delta2=-1}return D=Math.abs(D)*delta1,W*=delta2,{distances:D,weights:W}}__name(getSegmentWeights,"getSegmentWeights"),cy.startBatch();for(const edge of Object.values(cy.edges()))if(null==(_a2=edge.data)?void 0:_a2.call(edge)){const{x:sX,y:sY}=edge.source().position(),{x:tX,y:tY}=edge.target().position();if(sX!==tX&&sY!==tY){const sEP=edge.sourceEndpoint(),tEP=edge.targetEndpoint(),{sourceDir:sourceDir}=edgeData(edge),[pointX,pointY]=isArchitectureDirectionY(sourceDir)?[sEP.x,tEP.y]:[tEP.x,sEP.y],{weights:weights,distances:distances}=getSegmentWeights(sEP,tEP,pointX,pointY);edge.style("segment-distances",distances),edge.style("segment-weights",weights)}}cy.endBatch(),layout.run()}),layout.run(),cy.ready(e=>{log.info("Ready",e),resolve(cy)})})}registerIconPacks([{name:architectureIcons.prefix,icons:architectureIcons}]),cytoscape$1.use(fcose),__name(addServices,"addServices"),__name(addJunctions,"addJunctions"),__name(positionNodes,"positionNodes"),__name(addGroups,"addGroups"),__name(addEdges,"addEdges"),__name(getAlignments,"getAlignments"),__name(getRelativeConstraints,"getRelativeConstraints"),__name(layoutArchitecture,"layoutArchitecture");var renderer={draw:__name(async(text,id,_version,diagObj)=>{const db=diagObj.db;db.setDiagramId(id);const services=db.getServices(),junctions=db.getJunctions(),groups=db.getGroups(),edges=db.getEdges(),ds=db.getDataStructures(),svg=selectSvgElement(id),edgesElem=svg.append("g");edgesElem.attr("class","architecture-edges");const servicesElem=svg.append("g");servicesElem.attr("class","architecture-services");const groupElem=svg.append("g");groupElem.attr("class","architecture-groups"),await drawServices(db,servicesElem,services,id),drawJunctions(db,servicesElem,junctions,id);const cy=await layoutArchitecture(services,junctions,groups,edges,db,ds);await drawEdges(edgesElem,cy,db,id),await drawGroups(groupElem,cy,db,id),positionNodes(db,cy),setupGraphViewbox(void 0,svg,db.getConfigField("padding"),db.getConfigField("useMaxWidth"))},"draw")},diagram={parser:parser,get db(){return new ArchitectureDB},renderer:renderer,styles:architectureStyles_default};export{diagram};
|
|
1
|
+
var _a;import{_ as __name,H as selectSvgElement,X as setupGraphViewbox,l as log,b as setAccTitle,a as getAccTitle,p as setDiagramTitle,q as getDiagramTitle,g as getAccDescription,s as setAccDescription,y as clear,E as cleanAndMerge,F as defaultConfig_default,C as getConfig,c as getConfig2,aj as createText,aI as getIconSVG,i as sanitizeText,d as select,x as getEdgeId,aJ as registerIconPacks,aK as unknownIcon}from"./mermaid.core-O3WUNQR6.js";import{p as populateCommonDb}from"./chunk-4BX2VUAB-C7VtouVc.js";import{p as parse}from"./wardley-RL74JXVD-DS_huD5U.js";import{c as cytoscape$1}from"./cytoscape.esm-CT1mZavR.js";import{g as getDefaultExportFromCjs}from"./vendor-antd-CAmbzFZk.js";import"./index-BnE1kmli.js";import"./vendor-codemirror-BiCbU51m.js";import"./vendor-markdown-Bpu4AByL.js";import"./min-BDNYdllt.js";import"./_baseUniq-C73FOqig.js";var hasRequiredLayoutBase,cytoscapeFcose$1={exports:{}},coseBase$1={exports:{}},layoutBase$1={exports:{}};function requireLayoutBase(){return hasRequiredLayoutBase?layoutBase$1.exports:(hasRequiredLayoutBase=1,factory=function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module2=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module2.exports,module2,module2.exports,__webpack_require__),module2.l=!0,module2.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports$12,name,getter){__webpack_require__.o(exports$12,name)||Object.defineProperty(exports$12,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module2){var getter=module2&&module2.__esModule?function(){return module2.default}:function(){return module2};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=28)}([function(module2,exports$12,__webpack_require__){function LayoutConstants(){}LayoutConstants.QUALITY=1,LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,LayoutConstants.DEFAULT_INCREMENTAL=!1,LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT=!0,LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT=!1,LayoutConstants.DEFAULT_ANIMATION_PERIOD=50,LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,LayoutConstants.DEFAULT_GRAPH_MARGIN=15,LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS=!1,LayoutConstants.SIMPLE_NODE_SIZE=40,LayoutConstants.SIMPLE_NODE_HALF_SIZE=LayoutConstants.SIMPLE_NODE_SIZE/2,LayoutConstants.EMPTY_COMPOUND_NODE_SIZE=40,LayoutConstants.MIN_EDGE_LENGTH=1,LayoutConstants.WORLD_BOUNDARY=1e6,LayoutConstants.INITIAL_WORLD_BOUNDARY=LayoutConstants.WORLD_BOUNDARY/1e3,LayoutConstants.WORLD_CENTER_X=1200,LayoutConstants.WORLD_CENTER_Y=900,module2.exports=LayoutConstants},function(module2,exports$12,__webpack_require__){var LGraphObject=__webpack_require__(2),IGeometry=__webpack_require__(8),IMath=__webpack_require__(9);function LEdge(source,target,vEdge){LGraphObject.call(this,vEdge),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=vEdge,this.bendpoints=[],this.source=source,this.target=target}for(var prop in LEdge.prototype=Object.create(LGraphObject.prototype),LGraphObject)LEdge[prop]=LGraphObject[prop];LEdge.prototype.getSource=function(){return this.source},LEdge.prototype.getTarget=function(){return this.target},LEdge.prototype.isInterGraph=function(){return this.isInterGraph},LEdge.prototype.getLength=function(){return this.length},LEdge.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},LEdge.prototype.getBendpoints=function(){return this.bendpoints},LEdge.prototype.getLca=function(){return this.lca},LEdge.prototype.getSourceInLca=function(){return this.sourceInLca},LEdge.prototype.getTargetInLca=function(){return this.targetInLca},LEdge.prototype.getOtherEnd=function(node){if(this.source===node)return this.target;if(this.target===node)return this.source;throw"Node is not incident with this edge"},LEdge.prototype.getOtherEndInGraph=function(node,graph){for(var otherEnd=this.getOtherEnd(node),root=graph.getGraphManager().getRoot();;){if(otherEnd.getOwner()==graph)return otherEnd;if(otherEnd.getOwner()==root)break;otherEnd=otherEnd.getOwner().getParent()}return null},LEdge.prototype.updateLength=function(){var clipPointCoordinates=new Array(4);this.isOverlapingSourceAndTarget=IGeometry.getIntersection(this.target.getRect(),this.source.getRect(),clipPointCoordinates),this.isOverlapingSourceAndTarget||(this.lengthX=clipPointCoordinates[0]-clipPointCoordinates[2],this.lengthY=clipPointCoordinates[1]-clipPointCoordinates[3],Math.abs(this.lengthX)<1&&(this.lengthX=IMath.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=IMath.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},LEdge.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=IMath.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=IMath.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},module2.exports=LEdge},function(module2,exports$12,__webpack_require__){module2.exports=function(vGraphObject){this.vGraphObject=vGraphObject}},function(module2,exports$12,__webpack_require__){var LGraphObject=__webpack_require__(2),Integer=__webpack_require__(10),RectangleD=__webpack_require__(13),LayoutConstants=__webpack_require__(0),RandomSeed=__webpack_require__(16),PointD=__webpack_require__(5);function LNode(gm,loc,size,vNode){null==size&&null==vNode&&(vNode=loc),LGraphObject.call(this,vNode),null!=gm.graphManager&&(gm=gm.graphManager),this.estimatedSize=Integer.MIN_VALUE,this.inclusionTreeDepth=Integer.MAX_VALUE,this.vGraphObject=vNode,this.edges=[],this.graphManager=gm,this.rect=null!=size&&null!=loc?new RectangleD(loc.x,loc.y,size.width,size.height):new RectangleD}for(var prop in LNode.prototype=Object.create(LGraphObject.prototype),LGraphObject)LNode[prop]=LGraphObject[prop];LNode.prototype.getEdges=function(){return this.edges},LNode.prototype.getChild=function(){return this.child},LNode.prototype.getOwner=function(){return this.owner},LNode.prototype.getWidth=function(){return this.rect.width},LNode.prototype.setWidth=function(width){this.rect.width=width},LNode.prototype.getHeight=function(){return this.rect.height},LNode.prototype.setHeight=function(height){this.rect.height=height},LNode.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},LNode.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},LNode.prototype.getCenter=function(){return new PointD(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},LNode.prototype.getLocation=function(){return new PointD(this.rect.x,this.rect.y)},LNode.prototype.getRect=function(){return this.rect},LNode.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},LNode.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},LNode.prototype.setRect=function(upperLeft,dimension){this.rect.x=upperLeft.x,this.rect.y=upperLeft.y,this.rect.width=dimension.width,this.rect.height=dimension.height},LNode.prototype.setCenter=function(cx,cy){this.rect.x=cx-this.rect.width/2,this.rect.y=cy-this.rect.height/2},LNode.prototype.setLocation=function(x,y){this.rect.x=x,this.rect.y=y},LNode.prototype.moveBy=function(dx,dy){this.rect.x+=dx,this.rect.y+=dy},LNode.prototype.getEdgeListToNode=function(to){var edgeList=[],self=this;return self.edges.forEach(function(edge){if(edge.target==to){if(edge.source!=self)throw"Incorrect edge source!";edgeList.push(edge)}}),edgeList},LNode.prototype.getEdgesBetween=function(other){var edgeList=[],self=this;return self.edges.forEach(function(edge){if(edge.source!=self&&edge.target!=self)throw"Incorrect edge source and/or target";edge.target!=other&&edge.source!=other||edgeList.push(edge)}),edgeList},LNode.prototype.getNeighborsList=function(){var neighbors=new Set,self=this;return self.edges.forEach(function(edge){if(edge.source==self)neighbors.add(edge.target);else{if(edge.target!=self)throw"Incorrect incidency!";neighbors.add(edge.source)}}),neighbors},LNode.prototype.withChildren=function(){var withNeighborsList=new Set;if(withNeighborsList.add(this),null!=this.child)for(var nodes=this.child.getNodes(),i=0;i<nodes.length;i++)nodes[i].withChildren().forEach(function(node){withNeighborsList.add(node)});return withNeighborsList},LNode.prototype.getNoOfChildren=function(){var noOfChildren=0;if(null==this.child)noOfChildren=1;else for(var nodes=this.child.getNodes(),i=0;i<nodes.length;i++)noOfChildren+=nodes[i].getNoOfChildren();return 0==noOfChildren&&(noOfChildren=1),noOfChildren},LNode.prototype.getEstimatedSize=function(){if(this.estimatedSize==Integer.MIN_VALUE)throw"assert failed";return this.estimatedSize},LNode.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)},LNode.prototype.scatter=function(){var randomCenterX,randomCenterY,minX=-LayoutConstants.INITIAL_WORLD_BOUNDARY,maxX=LayoutConstants.INITIAL_WORLD_BOUNDARY;randomCenterX=LayoutConstants.WORLD_CENTER_X+RandomSeed.nextDouble()*(maxX-minX)+minX;var minY=-LayoutConstants.INITIAL_WORLD_BOUNDARY,maxY=LayoutConstants.INITIAL_WORLD_BOUNDARY;randomCenterY=LayoutConstants.WORLD_CENTER_Y+RandomSeed.nextDouble()*(maxY-minY)+minY,this.rect.x=randomCenterX,this.rect.y=randomCenterY},LNode.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var childGraph=this.getChild();if(childGraph.updateBounds(!0),this.rect.x=childGraph.getLeft(),this.rect.y=childGraph.getTop(),this.setWidth(childGraph.getRight()-childGraph.getLeft()),this.setHeight(childGraph.getBottom()-childGraph.getTop()),LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS){var width=childGraph.getRight()-childGraph.getLeft(),height=childGraph.getBottom()-childGraph.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(width+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>width?(this.rect.x-=(this.labelWidth-width)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(width+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(height+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>height?(this.rect.y-=(this.labelHeight-height)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(height+this.labelHeight))}}},LNode.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==Integer.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},LNode.prototype.transform=function(trans){var left=this.rect.x;left>LayoutConstants.WORLD_BOUNDARY?left=LayoutConstants.WORLD_BOUNDARY:left<-LayoutConstants.WORLD_BOUNDARY&&(left=-LayoutConstants.WORLD_BOUNDARY);var top=this.rect.y;top>LayoutConstants.WORLD_BOUNDARY?top=LayoutConstants.WORLD_BOUNDARY:top<-LayoutConstants.WORLD_BOUNDARY&&(top=-LayoutConstants.WORLD_BOUNDARY);var leftTop=new PointD(left,top),vLeftTop=trans.inverseTransformPoint(leftTop);this.setLocation(vLeftTop.x,vLeftTop.y)},LNode.prototype.getLeft=function(){return this.rect.x},LNode.prototype.getRight=function(){return this.rect.x+this.rect.width},LNode.prototype.getTop=function(){return this.rect.y},LNode.prototype.getBottom=function(){return this.rect.y+this.rect.height},LNode.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},module2.exports=LNode},function(module2,exports$12,__webpack_require__){var LayoutConstants=__webpack_require__(0);function FDLayoutConstants(){}for(var prop in LayoutConstants)FDLayoutConstants[prop]=LayoutConstants[prop];FDLayoutConstants.MAX_ITERATIONS=2500,FDLayoutConstants.DEFAULT_EDGE_LENGTH=50,FDLayoutConstants.DEFAULT_SPRING_STRENGTH=.45,FDLayoutConstants.DEFAULT_REPULSION_STRENGTH=4500,FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH=.4,FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,FDLayoutConstants.COOLING_ADAPTATION_FACTOR=.33,FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT=1e3,FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT=5e3,FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,FDLayoutConstants.MAX_NODE_DISPLACEMENT=3*FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL,FDLayoutConstants.MIN_REPULSION_DIST=FDLayoutConstants.DEFAULT_EDGE_LENGTH/10,FDLayoutConstants.CONVERGENCE_CHECK_PERIOD=100,FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,FDLayoutConstants.MIN_EDGE_LENGTH=1,FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD=10,module2.exports=FDLayoutConstants},function(module2,exports$12,__webpack_require__){function PointD(x,y){null==x&&null==y?(this.x=0,this.y=0):(this.x=x,this.y=y)}PointD.prototype.getX=function(){return this.x},PointD.prototype.getY=function(){return this.y},PointD.prototype.setX=function(x){this.x=x},PointD.prototype.setY=function(y){this.y=y},PointD.prototype.getDifference=function(pt){return new DimensionD(this.x-pt.x,this.y-pt.y)},PointD.prototype.getCopy=function(){return new PointD(this.x,this.y)},PointD.prototype.translate=function(dim){return this.x+=dim.width,this.y+=dim.height,this},module2.exports=PointD},function(module2,exports$12,__webpack_require__){var LGraphObject=__webpack_require__(2),Integer=__webpack_require__(10),LayoutConstants=__webpack_require__(0),LGraphManager=__webpack_require__(7),LNode=__webpack_require__(3),LEdge=__webpack_require__(1),RectangleD=__webpack_require__(13),Point2=__webpack_require__(12),LinkedList=__webpack_require__(11);function LGraph(parent,obj2,vGraph){LGraphObject.call(this,vGraph),this.estimatedSize=Integer.MIN_VALUE,this.margin=LayoutConstants.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=parent,null!=obj2&&obj2 instanceof LGraphManager?this.graphManager=obj2:null!=obj2&&obj2 instanceof Layout&&(this.graphManager=obj2.graphManager)}for(var prop in LGraph.prototype=Object.create(LGraphObject.prototype),LGraphObject)LGraph[prop]=LGraphObject[prop];LGraph.prototype.getNodes=function(){return this.nodes},LGraph.prototype.getEdges=function(){return this.edges},LGraph.prototype.getGraphManager=function(){return this.graphManager},LGraph.prototype.getParent=function(){return this.parent},LGraph.prototype.getLeft=function(){return this.left},LGraph.prototype.getRight=function(){return this.right},LGraph.prototype.getTop=function(){return this.top},LGraph.prototype.getBottom=function(){return this.bottom},LGraph.prototype.isConnected=function(){return this.isConnected},LGraph.prototype.add=function(obj1,sourceNode,targetNode){if(null==sourceNode&&null==targetNode){var newNode=obj1;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(newNode)>-1)throw"Node already in graph!";return newNode.owner=this,this.getNodes().push(newNode),newNode}var newEdge=obj1;if(!(this.getNodes().indexOf(sourceNode)>-1&&this.getNodes().indexOf(targetNode)>-1))throw"Source or target not in graph!";if(sourceNode.owner!=targetNode.owner||sourceNode.owner!=this)throw"Both owners must be this graph!";return sourceNode.owner!=targetNode.owner?null:(newEdge.source=sourceNode,newEdge.target=targetNode,newEdge.isInterGraph=!1,this.getEdges().push(newEdge),sourceNode.edges.push(newEdge),targetNode!=sourceNode&&targetNode.edges.push(newEdge),newEdge)},LGraph.prototype.remove=function(obj){var node=obj;if(obj instanceof LNode){if(null==node)throw"Node is null!";if(null==node.owner||node.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var edgesToBeRemoved=node.edges.slice(),s=edgesToBeRemoved.length,i=0;i<s;i++)(edge=edgesToBeRemoved[i]).isInterGraph?this.graphManager.remove(edge):edge.source.owner.remove(edge);if(-1==(index=this.nodes.indexOf(node)))throw"Node not in owner node list!";this.nodes.splice(index,1)}else if(obj instanceof LEdge){var edge;if(null==(edge=obj))throw"Edge is null!";if(null==edge.source||null==edge.target)throw"Source and/or target is null!";if(null==edge.source.owner||null==edge.target.owner||edge.source.owner!=this||edge.target.owner!=this)throw"Source and/or target owner is invalid!";var index,sourceIndex=edge.source.edges.indexOf(edge),targetIndex=edge.target.edges.indexOf(edge);if(!(sourceIndex>-1&&targetIndex>-1))throw"Source and/or target doesn't know this edge!";if(edge.source.edges.splice(sourceIndex,1),edge.target!=edge.source&&edge.target.edges.splice(targetIndex,1),-1==(index=edge.source.owner.getEdges().indexOf(edge)))throw"Not in owner's edge list!";edge.source.owner.getEdges().splice(index,1)}},LGraph.prototype.updateLeftTop=function(){for(var nodeTop,nodeLeft,margin,top=Integer.MAX_VALUE,left=Integer.MAX_VALUE,nodes=this.getNodes(),s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];top>(nodeTop=lNode.getTop())&&(top=nodeTop),left>(nodeLeft=lNode.getLeft())&&(left=nodeLeft)}return top==Integer.MAX_VALUE?null:(margin=null!=nodes[0].getParent().paddingLeft?nodes[0].getParent().paddingLeft:this.margin,this.left=left-margin,this.top=top-margin,new Point2(this.left,this.top))},LGraph.prototype.updateBounds=function(recursive){for(var nodeLeft,nodeRight,nodeTop,nodeBottom,margin,left=Integer.MAX_VALUE,right=-Integer.MAX_VALUE,top=Integer.MAX_VALUE,bottom=-Integer.MAX_VALUE,nodes=this.nodes,s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];recursive&&null!=lNode.child&&lNode.updateBounds(),left>(nodeLeft=lNode.getLeft())&&(left=nodeLeft),right<(nodeRight=lNode.getRight())&&(right=nodeRight),top>(nodeTop=lNode.getTop())&&(top=nodeTop),bottom<(nodeBottom=lNode.getBottom())&&(bottom=nodeBottom)}var boundingRect=new RectangleD(left,top,right-left,bottom-top);left==Integer.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),margin=null!=nodes[0].getParent().paddingLeft?nodes[0].getParent().paddingLeft:this.margin,this.left=boundingRect.x-margin,this.right=boundingRect.x+boundingRect.width+margin,this.top=boundingRect.y-margin,this.bottom=boundingRect.y+boundingRect.height+margin},LGraph.calculateBounds=function(nodes){for(var nodeLeft,nodeRight,nodeTop,nodeBottom,left=Integer.MAX_VALUE,right=-Integer.MAX_VALUE,top=Integer.MAX_VALUE,bottom=-Integer.MAX_VALUE,s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];left>(nodeLeft=lNode.getLeft())&&(left=nodeLeft),right<(nodeRight=lNode.getRight())&&(right=nodeRight),top>(nodeTop=lNode.getTop())&&(top=nodeTop),bottom<(nodeBottom=lNode.getBottom())&&(bottom=nodeBottom)}return new RectangleD(left,top,right-left,bottom-top)},LGraph.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},LGraph.prototype.getEstimatedSize=function(){if(this.estimatedSize==Integer.MIN_VALUE)throw"assert failed";return this.estimatedSize},LGraph.prototype.calcEstimatedSize=function(){for(var size=0,nodes=this.nodes,s=nodes.length,i=0;i<s;i++)size+=nodes[i].calcEstimatedSize();return this.estimatedSize=0==size?LayoutConstants.EMPTY_COMPOUND_NODE_SIZE:size/Math.sqrt(this.nodes.length),this.estimatedSize},LGraph.prototype.updateConnected=function(){var self=this;if(0!=this.nodes.length){var neighborEdges,currentNeighbor,queue=new LinkedList,visited=new Set,currentNode=this.nodes[0];for(currentNode.withChildren().forEach(function(node){queue.push(node),visited.add(node)});0!==queue.length;)for(var size=(neighborEdges=(currentNode=queue.shift()).getEdges()).length,i=0;i<size;i++)null==(currentNeighbor=neighborEdges[i].getOtherEndInGraph(currentNode,this))||visited.has(currentNeighbor)||currentNeighbor.withChildren().forEach(function(node){queue.push(node),visited.add(node)});if(this.isConnected=!1,visited.size>=this.nodes.length){var noOfVisitedInThisGraph=0;visited.forEach(function(visitedNode){visitedNode.owner==self&&noOfVisitedInThisGraph++}),noOfVisitedInThisGraph==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},module2.exports=LGraph},function(module2,exports$12,__webpack_require__){var LGraph,LEdge=__webpack_require__(1);function LGraphManager(layout){LGraph=__webpack_require__(6),this.layout=layout,this.graphs=[],this.edges=[]}LGraphManager.prototype.addRoot=function(){var ngraph=this.layout.newGraph(),nnode=this.layout.newNode(null),root=this.add(ngraph,nnode);return this.setRootGraph(root),this.rootGraph},LGraphManager.prototype.add=function(newGraph,parentNode,newEdge,sourceNode,targetNode){if(null==newEdge&&null==sourceNode&&null==targetNode){if(null==newGraph)throw"Graph is null!";if(null==parentNode)throw"Parent node is null!";if(this.graphs.indexOf(newGraph)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(newGraph),null!=newGraph.parent)throw"Already has a parent!";if(null!=parentNode.child)throw"Already has a child!";return newGraph.parent=parentNode,parentNode.child=newGraph,newGraph}targetNode=newEdge,newEdge=newGraph;var sourceGraph=(sourceNode=parentNode).getOwner(),targetGraph=targetNode.getOwner();if(null==sourceGraph||sourceGraph.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==targetGraph||targetGraph.getGraphManager()!=this)throw"Target not in this graph mgr!";if(sourceGraph==targetGraph)return newEdge.isInterGraph=!1,sourceGraph.add(newEdge,sourceNode,targetNode);if(newEdge.isInterGraph=!0,newEdge.source=sourceNode,newEdge.target=targetNode,this.edges.indexOf(newEdge)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(newEdge),null==newEdge.source||null==newEdge.target)throw"Edge source and/or target is null!";if(-1!=newEdge.source.edges.indexOf(newEdge)||-1!=newEdge.target.edges.indexOf(newEdge))throw"Edge already in source and/or target incidency list!";return newEdge.source.edges.push(newEdge),newEdge.target.edges.push(newEdge),newEdge},LGraphManager.prototype.remove=function(lObj){if(lObj instanceof LGraph){var graph=lObj;if(graph.getGraphManager()!=this)throw"Graph not in this graph mgr";if(graph!=this.rootGraph&&(null==graph.parent||graph.parent.graphManager!=this))throw"Invalid parent node!";for(var edge,edgesToBeRemoved=[],s=(edgesToBeRemoved=edgesToBeRemoved.concat(graph.getEdges())).length,i=0;i<s;i++)edge=edgesToBeRemoved[i],graph.remove(edge);var node,nodesToBeRemoved=[];for(s=(nodesToBeRemoved=nodesToBeRemoved.concat(graph.getNodes())).length,i=0;i<s;i++)node=nodesToBeRemoved[i],graph.remove(node);graph==this.rootGraph&&this.setRootGraph(null);var index=this.graphs.indexOf(graph);this.graphs.splice(index,1),graph.parent=null}else if(lObj instanceof LEdge){if(null==(edge=lObj))throw"Edge is null!";if(!edge.isInterGraph)throw"Not an inter-graph edge!";if(null==edge.source||null==edge.target)throw"Source and/or target is null!";if(-1==edge.source.edges.indexOf(edge)||-1==edge.target.edges.indexOf(edge))throw"Source and/or target doesn't know this edge!";if(index=edge.source.edges.indexOf(edge),edge.source.edges.splice(index,1),index=edge.target.edges.indexOf(edge),edge.target.edges.splice(index,1),null==edge.source.owner||null==edge.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==edge.source.owner.getGraphManager().edges.indexOf(edge))throw"Not in owner graph manager's edge list!";index=edge.source.owner.getGraphManager().edges.indexOf(edge),edge.source.owner.getGraphManager().edges.splice(index,1)}},LGraphManager.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},LGraphManager.prototype.getGraphs=function(){return this.graphs},LGraphManager.prototype.getAllNodes=function(){if(null==this.allNodes){for(var nodeList=[],graphs=this.getGraphs(),s=graphs.length,i=0;i<s;i++)nodeList=nodeList.concat(graphs[i].getNodes());this.allNodes=nodeList}return this.allNodes},LGraphManager.prototype.resetAllNodes=function(){this.allNodes=null},LGraphManager.prototype.resetAllEdges=function(){this.allEdges=null},LGraphManager.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},LGraphManager.prototype.getAllEdges=function(){if(null==this.allEdges){var edgeList=[],graphs=this.getGraphs();graphs.length;for(var i=0;i<graphs.length;i++)edgeList=edgeList.concat(graphs[i].getEdges());edgeList=edgeList.concat(this.edges),this.allEdges=edgeList}return this.allEdges},LGraphManager.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},LGraphManager.prototype.setAllNodesToApplyGravitation=function(nodeList){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=nodeList},LGraphManager.prototype.getRoot=function(){return this.rootGraph},LGraphManager.prototype.setRootGraph=function(graph){if(graph.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=graph,null==graph.parent&&(graph.parent=this.layout.newNode("Root node"))},LGraphManager.prototype.getLayout=function(){return this.layout},LGraphManager.prototype.isOneAncestorOfOther=function(firstNode,secondNode){if(null==firstNode||null==secondNode)throw"assert failed";if(firstNode==secondNode)return!0;for(var parentNode,ownerGraph=firstNode.getOwner();null!=(parentNode=ownerGraph.getParent());){if(parentNode==secondNode)return!0;if(null==(ownerGraph=parentNode.getOwner()))break}for(ownerGraph=secondNode.getOwner();null!=(parentNode=ownerGraph.getParent());){if(parentNode==firstNode)return!0;if(null==(ownerGraph=parentNode.getOwner()))break}return!1},LGraphManager.prototype.calcLowestCommonAncestors=function(){for(var edge,sourceNode,targetNode,sourceAncestorGraph,targetAncestorGraph,edges=this.getAllEdges(),s=edges.length,i=0;i<s;i++)if(sourceNode=(edge=edges[i]).source,targetNode=edge.target,edge.lca=null,edge.sourceInLca=sourceNode,edge.targetInLca=targetNode,sourceNode!=targetNode){for(sourceAncestorGraph=sourceNode.getOwner();null==edge.lca;){for(edge.targetInLca=targetNode,targetAncestorGraph=targetNode.getOwner();null==edge.lca;){if(targetAncestorGraph==sourceAncestorGraph){edge.lca=targetAncestorGraph;break}if(targetAncestorGraph==this.rootGraph)break;if(null!=edge.lca)throw"assert failed";edge.targetInLca=targetAncestorGraph.getParent(),targetAncestorGraph=edge.targetInLca.getOwner()}if(sourceAncestorGraph==this.rootGraph)break;null==edge.lca&&(edge.sourceInLca=sourceAncestorGraph.getParent(),sourceAncestorGraph=edge.sourceInLca.getOwner())}if(null==edge.lca)throw"assert failed"}else edge.lca=sourceNode.getOwner()},LGraphManager.prototype.calcLowestCommonAncestor=function(firstNode,secondNode){if(firstNode==secondNode)return firstNode.getOwner();for(var firstOwnerGraph=firstNode.getOwner();null!=firstOwnerGraph;){for(var secondOwnerGraph=secondNode.getOwner();null!=secondOwnerGraph;){if(secondOwnerGraph==firstOwnerGraph)return secondOwnerGraph;secondOwnerGraph=secondOwnerGraph.getParent().getOwner()}firstOwnerGraph=firstOwnerGraph.getParent().getOwner()}return firstOwnerGraph},LGraphManager.prototype.calcInclusionTreeDepths=function(graph,depth){var node;null==graph&&null==depth&&(graph=this.rootGraph,depth=1);for(var nodes=graph.getNodes(),s=nodes.length,i=0;i<s;i++)(node=nodes[i]).inclusionTreeDepth=depth,null!=node.child&&this.calcInclusionTreeDepths(node.child,depth+1)},LGraphManager.prototype.includesInvalidEdge=function(){for(var edge,edgesToRemove=[],s=this.edges.length,i=0;i<s;i++)edge=this.edges[i],this.isOneAncestorOfOther(edge.source,edge.target)&&edgesToRemove.push(edge);for(i=0;i<edgesToRemove.length;i++)this.remove(edgesToRemove[i]);return!1},module2.exports=LGraphManager},function(module2,exports$12,__webpack_require__){var Point2=__webpack_require__(12);function IGeometry(){}IGeometry.calcSeparationAmount=function(rectA,rectB,overlapAmount,separationBuffer){if(!rectA.intersects(rectB))throw"assert failed";var directions=new Array(2);this.decideDirectionsForOverlappingNodes(rectA,rectB,directions),overlapAmount[0]=Math.min(rectA.getRight(),rectB.getRight())-Math.max(rectA.x,rectB.x),overlapAmount[1]=Math.min(rectA.getBottom(),rectB.getBottom())-Math.max(rectA.y,rectB.y),rectA.getX()<=rectB.getX()&&rectA.getRight()>=rectB.getRight()?overlapAmount[0]+=Math.min(rectB.getX()-rectA.getX(),rectA.getRight()-rectB.getRight()):rectB.getX()<=rectA.getX()&&rectB.getRight()>=rectA.getRight()&&(overlapAmount[0]+=Math.min(rectA.getX()-rectB.getX(),rectB.getRight()-rectA.getRight())),rectA.getY()<=rectB.getY()&&rectA.getBottom()>=rectB.getBottom()?overlapAmount[1]+=Math.min(rectB.getY()-rectA.getY(),rectA.getBottom()-rectB.getBottom()):rectB.getY()<=rectA.getY()&&rectB.getBottom()>=rectA.getBottom()&&(overlapAmount[1]+=Math.min(rectA.getY()-rectB.getY(),rectB.getBottom()-rectA.getBottom()));var slope=Math.abs((rectB.getCenterY()-rectA.getCenterY())/(rectB.getCenterX()-rectA.getCenterX()));rectB.getCenterY()===rectA.getCenterY()&&rectB.getCenterX()===rectA.getCenterX()&&(slope=1);var moveByY=slope*overlapAmount[0],moveByX=overlapAmount[1]/slope;overlapAmount[0]<moveByX?moveByX=overlapAmount[0]:moveByY=overlapAmount[1],overlapAmount[0]=-1*directions[0]*(moveByX/2+separationBuffer),overlapAmount[1]=-1*directions[1]*(moveByY/2+separationBuffer)},IGeometry.decideDirectionsForOverlappingNodes=function(rectA,rectB,directions){rectA.getCenterX()<rectB.getCenterX()?directions[0]=-1:directions[0]=1,rectA.getCenterY()<rectB.getCenterY()?directions[1]=-1:directions[1]=1},IGeometry.getIntersection2=function(rectA,rectB,result){var p1x=rectA.getCenterX(),p1y=rectA.getCenterY(),p2x=rectB.getCenterX(),p2y=rectB.getCenterY();if(rectA.intersects(rectB))return result[0]=p1x,result[1]=p1y,result[2]=p2x,result[3]=p2y,!0;var topLeftAx=rectA.getX(),topLeftAy=rectA.getY(),topRightAx=rectA.getRight(),bottomLeftAx=rectA.getX(),bottomLeftAy=rectA.getBottom(),bottomRightAx=rectA.getRight(),halfWidthA=rectA.getWidthHalf(),halfHeightA=rectA.getHeightHalf(),topLeftBx=rectB.getX(),topLeftBy=rectB.getY(),topRightBx=rectB.getRight(),bottomLeftBx=rectB.getX(),bottomLeftBy=rectB.getBottom(),bottomRightBx=rectB.getRight(),halfWidthB=rectB.getWidthHalf(),halfHeightB=rectB.getHeightHalf(),clipPointAFound=!1,clipPointBFound=!1;if(p1x===p2x){if(p1y>p2y)return result[0]=p1x,result[1]=topLeftAy,result[2]=p2x,result[3]=bottomLeftBy,!1;if(p1y<p2y)return result[0]=p1x,result[1]=bottomLeftAy,result[2]=p2x,result[3]=topLeftBy,!1}else if(p1y===p2y){if(p1x>p2x)return result[0]=topLeftAx,result[1]=p1y,result[2]=topRightBx,result[3]=p2y,!1;if(p1x<p2x)return result[0]=topRightAx,result[1]=p1y,result[2]=topLeftBx,result[3]=p2y,!1}else{var slopeA=rectA.height/rectA.width,slopeB=rectB.height/rectB.width,slopePrime=(p2y-p1y)/(p2x-p1x),cardinalDirectionA=void 0,cardinalDirectionB=void 0,tempPointAx=void 0,tempPointAy=void 0,tempPointBx=void 0,tempPointBy=void 0;if(-slopeA===slopePrime?p1x>p2x?(result[0]=bottomLeftAx,result[1]=bottomLeftAy,clipPointAFound=!0):(result[0]=topRightAx,result[1]=topLeftAy,clipPointAFound=!0):slopeA===slopePrime&&(p1x>p2x?(result[0]=topLeftAx,result[1]=topLeftAy,clipPointAFound=!0):(result[0]=bottomRightAx,result[1]=bottomLeftAy,clipPointAFound=!0)),-slopeB===slopePrime?p2x>p1x?(result[2]=bottomLeftBx,result[3]=bottomLeftBy,clipPointBFound=!0):(result[2]=topRightBx,result[3]=topLeftBy,clipPointBFound=!0):slopeB===slopePrime&&(p2x>p1x?(result[2]=topLeftBx,result[3]=topLeftBy,clipPointBFound=!0):(result[2]=bottomRightBx,result[3]=bottomLeftBy,clipPointBFound=!0)),clipPointAFound&&clipPointBFound)return!1;if(p1x>p2x?p1y>p2y?(cardinalDirectionA=this.getCardinalDirection(slopeA,slopePrime,4),cardinalDirectionB=this.getCardinalDirection(slopeB,slopePrime,2)):(cardinalDirectionA=this.getCardinalDirection(-slopeA,slopePrime,3),cardinalDirectionB=this.getCardinalDirection(-slopeB,slopePrime,1)):p1y>p2y?(cardinalDirectionA=this.getCardinalDirection(-slopeA,slopePrime,1),cardinalDirectionB=this.getCardinalDirection(-slopeB,slopePrime,3)):(cardinalDirectionA=this.getCardinalDirection(slopeA,slopePrime,2),cardinalDirectionB=this.getCardinalDirection(slopeB,slopePrime,4)),!clipPointAFound)switch(cardinalDirectionA){case 1:tempPointAy=topLeftAy,tempPointAx=p1x+-halfHeightA/slopePrime,result[0]=tempPointAx,result[1]=tempPointAy;break;case 2:tempPointAx=bottomRightAx,tempPointAy=p1y+halfWidthA*slopePrime,result[0]=tempPointAx,result[1]=tempPointAy;break;case 3:tempPointAy=bottomLeftAy,tempPointAx=p1x+halfHeightA/slopePrime,result[0]=tempPointAx,result[1]=tempPointAy;break;case 4:tempPointAx=bottomLeftAx,tempPointAy=p1y+-halfWidthA*slopePrime,result[0]=tempPointAx,result[1]=tempPointAy}if(!clipPointBFound)switch(cardinalDirectionB){case 1:tempPointBy=topLeftBy,tempPointBx=p2x+-halfHeightB/slopePrime,result[2]=tempPointBx,result[3]=tempPointBy;break;case 2:tempPointBx=bottomRightBx,tempPointBy=p2y+halfWidthB*slopePrime,result[2]=tempPointBx,result[3]=tempPointBy;break;case 3:tempPointBy=bottomLeftBy,tempPointBx=p2x+halfHeightB/slopePrime,result[2]=tempPointBx,result[3]=tempPointBy;break;case 4:tempPointBx=bottomLeftBx,tempPointBy=p2y+-halfWidthB*slopePrime,result[2]=tempPointBx,result[3]=tempPointBy}}return!1},IGeometry.getCardinalDirection=function(slope,slopePrime,line){return slope>slopePrime?line:1+line%4},IGeometry.getIntersection=function(s1,s2,f1,f2){if(null==f2)return this.getIntersection2(s1,s2,f1);var a1,a2,b1,b2,c1,c2,denom,x1=s1.x,y1=s1.y,x2=s2.x,y2=s2.y,x3=f1.x,y3=f1.y,x4=f2.x,y4=f2.y;return 0===(denom=(a1=y2-y1)*(b2=x3-x4)-(a2=y4-y3)*(b1=x1-x2))?null:new Point2((b1*(c2=x4*y3-x3*y4)-b2*(c1=x2*y1-x1*y2))/denom,(a2*c1-a1*c2)/denom)},IGeometry.angleOfVector=function(Cx,Cy,Nx,Ny){var C_angle=void 0;return Cx!==Nx?(C_angle=Math.atan((Ny-Cy)/(Nx-Cx)),Nx<Cx?C_angle+=Math.PI:Ny<Cy&&(C_angle+=this.TWO_PI)):C_angle=Ny<Cy?this.ONE_AND_HALF_PI:this.HALF_PI,C_angle},IGeometry.doIntersect=function(p1,p2,p3,p4){var a=p1.x,b=p1.y,c=p2.x,d=p2.y,p=p3.x,q=p3.y,r=p4.x,s=p4.y,det=(c-a)*(s-q)-(r-p)*(d-b);if(0===det)return!1;var lambda=((s-q)*(r-a)+(p-r)*(s-b))/det,gamma=((b-d)*(r-a)+(c-a)*(s-b))/det;return 0<lambda&&lambda<1&&0<gamma&&gamma<1},IGeometry.findCircleLineIntersections=function(Ex,Ey,Lx,Ly,Cx,Cy,r){var a=(Lx-Ex)*(Lx-Ex)+(Ly-Ey)*(Ly-Ey),b=2*((Ex-Cx)*(Lx-Ex)+(Ey-Cy)*(Ly-Ey)),c=(Ex-Cx)*(Ex-Cx)+(Ey-Cy)*(Ey-Cy)-r*r;if(b*b-4*a*c>=0){var t1=(-b+Math.sqrt(b*b-4*a*c))/(2*a),t2=(-b-Math.sqrt(b*b-4*a*c))/(2*a);return t1>=0&&t1<=1?[t1]:t2>=0&&t2<=1?[t2]:null}return null},IGeometry.HALF_PI=.5*Math.PI,IGeometry.ONE_AND_HALF_PI=1.5*Math.PI,IGeometry.TWO_PI=2*Math.PI,IGeometry.THREE_PI=3*Math.PI,module2.exports=IGeometry},function(module2,exports$12,__webpack_require__){function IMath(){}IMath.sign=function(value){return value>0?1:value<0?-1:0},IMath.floor=function(value){return value<0?Math.ceil(value):Math.floor(value)},IMath.ceil=function(value){return value<0?Math.floor(value):Math.ceil(value)},module2.exports=IMath},function(module2,exports$12,__webpack_require__){function Integer(){}Integer.MAX_VALUE=2147483647,Integer.MIN_VALUE=-2147483648,module2.exports=Integer},function(module2,exports$12,__webpack_require__){var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),nodeFrom=function(value){return{value:value,next:null,prev:null}},add=function(prev,node,next2,list){return null!==prev?prev.next=node:list.head=node,null!==next2?next2.prev=node:list.tail=node,node.prev=prev,node.next=next2,list.length++,node},_remove=function(node,list){var prev=node.prev,next2=node.next;return null!==prev?prev.next=next2:list.head=next2,null!==next2?next2.prev=prev:list.tail=prev,node.prev=node.next=null,list.length--,node},LinkedList=function(){function LinkedList2(vals){var _this=this;!function(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,LinkedList2),this.length=0,this.head=null,this.tail=null,null!=vals&&vals.forEach(function(v){return _this.push(v)})}return _createClass(LinkedList2,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(val,otherNode){return add(otherNode.prev,nodeFrom(val),otherNode,this)}},{key:"insertAfter",value:function(val,otherNode){return add(otherNode,nodeFrom(val),otherNode.next,this)}},{key:"insertNodeBefore",value:function(newNode,otherNode){return add(otherNode.prev,newNode,otherNode,this)}},{key:"insertNodeAfter",value:function(newNode,otherNode){return add(otherNode,newNode,otherNode.next,this)}},{key:"push",value:function(val){return add(this.tail,nodeFrom(val),null,this)}},{key:"unshift",value:function(val){return add(null,nodeFrom(val),this.head,this)}},{key:"remove",value:function(node){return _remove(node,this)}},{key:"pop",value:function(){return _remove(this.tail,this).value}},{key:"popNode",value:function(){return _remove(this.tail,this)}},{key:"shift",value:function(){return _remove(this.head,this).value}},{key:"shiftNode",value:function(){return _remove(this.head,this)}},{key:"get_object_at",value:function(index){if(index<=this.length()){for(var i=1,current=this.head;i<index;)current=current.next,i++;return current.value}}},{key:"set_object_at",value:function(index,value){if(index<=this.length()){for(var i=1,current=this.head;i<index;)current=current.next,i++;current.value=value}}}]),LinkedList2}();module2.exports=LinkedList},function(module2,exports$12,__webpack_require__){function Point2(x,y,p){this.x=null,this.y=null,null==x&&null==y&&null==p?(this.x=0,this.y=0):"number"==typeof x&&"number"==typeof y&&null==p?(this.x=x,this.y=y):"Point"==x.constructor.name&&null==y&&null==p&&(p=x,this.x=p.x,this.y=p.y)}Point2.prototype.getX=function(){return this.x},Point2.prototype.getY=function(){return this.y},Point2.prototype.getLocation=function(){return new Point2(this.x,this.y)},Point2.prototype.setLocation=function(x,y,p){"Point"==x.constructor.name&&null==y&&null==p?(p=x,this.setLocation(p.x,p.y)):"number"==typeof x&&"number"==typeof y&&null==p&&(parseInt(x)==x&&parseInt(y)==y?this.move(x,y):(this.x=Math.floor(x+.5),this.y=Math.floor(y+.5)))},Point2.prototype.move=function(x,y){this.x=x,this.y=y},Point2.prototype.translate=function(dx,dy){this.x+=dx,this.y+=dy},Point2.prototype.equals=function(obj){if("Point"==obj.constructor.name){var pt=obj;return this.x==pt.x&&this.y==pt.y}return this==obj},Point2.prototype.toString=function(){return(new Point2).constructor.name+"[x="+this.x+",y="+this.y+"]"},module2.exports=Point2},function(module2,exports$12,__webpack_require__){function RectangleD(x,y,width,height){this.x=0,this.y=0,this.width=0,this.height=0,null!=x&&null!=y&&null!=width&&null!=height&&(this.x=x,this.y=y,this.width=width,this.height=height)}RectangleD.prototype.getX=function(){return this.x},RectangleD.prototype.setX=function(x){this.x=x},RectangleD.prototype.getY=function(){return this.y},RectangleD.prototype.setY=function(y){this.y=y},RectangleD.prototype.getWidth=function(){return this.width},RectangleD.prototype.setWidth=function(width){this.width=width},RectangleD.prototype.getHeight=function(){return this.height},RectangleD.prototype.setHeight=function(height){this.height=height},RectangleD.prototype.getRight=function(){return this.x+this.width},RectangleD.prototype.getBottom=function(){return this.y+this.height},RectangleD.prototype.intersects=function(a){return!(this.getRight()<a.x||this.getBottom()<a.y||a.getRight()<this.x||a.getBottom()<this.y)},RectangleD.prototype.getCenterX=function(){return this.x+this.width/2},RectangleD.prototype.getMinX=function(){return this.getX()},RectangleD.prototype.getMaxX=function(){return this.getX()+this.width},RectangleD.prototype.getCenterY=function(){return this.y+this.height/2},RectangleD.prototype.getMinY=function(){return this.getY()},RectangleD.prototype.getMaxY=function(){return this.getY()+this.height},RectangleD.prototype.getWidthHalf=function(){return this.width/2},RectangleD.prototype.getHeightHalf=function(){return this.height/2},module2.exports=RectangleD},function(module2,exports$12,__webpack_require__){var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};function UniqueIDGeneretor(){}UniqueIDGeneretor.lastID=0,UniqueIDGeneretor.createID=function(obj){return UniqueIDGeneretor.isPrimitive(obj)?obj:(null!=obj.uniqueID||(obj.uniqueID=UniqueIDGeneretor.getString(),UniqueIDGeneretor.lastID++),obj.uniqueID)},UniqueIDGeneretor.getString=function(id){return null==id&&(id=UniqueIDGeneretor.lastID),"Object#"+id},UniqueIDGeneretor.isPrimitive=function(arg){var type=void 0===arg?"undefined":_typeof(arg);return null==arg||"object"!=type&&"function"!=type},module2.exports=UniqueIDGeneretor},function(module2,exports$12,__webpack_require__){function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}var LayoutConstants=__webpack_require__(0),LGraphManager=__webpack_require__(7),LNode=__webpack_require__(3),LEdge=__webpack_require__(1),LGraph=__webpack_require__(6),PointD=__webpack_require__(5),Transform=__webpack_require__(17),Emitter=__webpack_require__(29);function Layout2(isRemoteUse){Emitter.call(this),this.layoutQuality=LayoutConstants.QUALITY,this.createBendsAsNeeded=LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=LayoutConstants.DEFAULT_INCREMENTAL,this.animationOnLayout=LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=LayoutConstants.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new LGraphManager(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=isRemoteUse&&(this.isRemoteUse=isRemoteUse)}Layout2.RANDOM_SEED=1,Layout2.prototype=Object.create(Emitter.prototype),Layout2.prototype.getGraphManager=function(){return this.graphManager},Layout2.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},Layout2.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},Layout2.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},Layout2.prototype.newGraphManager=function(){var gm=new LGraphManager(this);return this.graphManager=gm,gm},Layout2.prototype.newGraph=function(vGraph){return new LGraph(null,this.graphManager,vGraph)},Layout2.prototype.newNode=function(vNode){return new LNode(this.graphManager,vNode)},Layout2.prototype.newEdge=function(vEdge){return new LEdge(null,null,vEdge)},Layout2.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},Layout2.prototype.runLayout=function(){var isLayoutSuccessfull;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),isLayoutSuccessfull=!this.checkLayoutSuccess()&&this.layout(),"during"!==LayoutConstants.ANIMATE&&(isLayoutSuccessfull&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,isLayoutSuccessfull)},Layout2.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},Layout2.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var allEdges=this.graphManager.getAllEdges(),i=0;i<allEdges.length;i++)allEdges[i];var nodes=this.graphManager.getRoot().getNodes();for(i=0;i<nodes.length;i++)nodes[i];this.update(this.graphManager.getRoot())}},Layout2.prototype.update=function(obj){if(null==obj)this.update2();else if(obj instanceof LNode){var node=obj;if(null!=node.getChild())for(var nodes=node.getChild().getNodes(),i=0;i<nodes.length;i++)update(nodes[i]);null!=node.vGraphObject&&node.vGraphObject.update(node)}else if(obj instanceof LEdge){var edge=obj;null!=edge.vGraphObject&&edge.vGraphObject.update(edge)}else if(obj instanceof LGraph){var graph=obj;null!=graph.vGraphObject&&graph.vGraphObject.update(graph)}},Layout2.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=LayoutConstants.QUALITY,this.animationDuringLayout=LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=LayoutConstants.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=LayoutConstants.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},Layout2.prototype.transform=function(newLeftTop){if(null==newLeftTop)this.transform(new PointD(0,0));else{var trans=new Transform,leftTop=this.graphManager.getRoot().updateLeftTop();if(null!=leftTop){trans.setWorldOrgX(newLeftTop.x),trans.setWorldOrgY(newLeftTop.y),trans.setDeviceOrgX(leftTop.x),trans.setDeviceOrgY(leftTop.y);for(var nodes=this.getAllNodes(),i=0;i<nodes.length;i++)nodes[i].transform(trans)}}},Layout2.prototype.positionNodesRandomly=function(graph){if(null==graph)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var lNode,childGraph,nodes=graph.getNodes(),i=0;i<nodes.length;i++)null==(childGraph=(lNode=nodes[i]).getChild())||0==childGraph.getNodes().length?lNode.scatter():(this.positionNodesRandomly(childGraph),lNode.updateBounds())},Layout2.prototype.getFlatForest=function(){for(var flatForest=[],isForest=!0,allNodes=this.graphManager.getRoot().getNodes(),isFlat=!0,i=0;i<allNodes.length;i++)null!=allNodes[i].getChild()&&(isFlat=!1);if(!isFlat)return flatForest;var visited=new Set,toBeVisited=[],parents=new Map,unProcessedNodes=[];for(unProcessedNodes=unProcessedNodes.concat(allNodes);unProcessedNodes.length>0&&isForest;){for(toBeVisited.push(unProcessedNodes[0]);toBeVisited.length>0&&isForest;){var currentNode=toBeVisited[0];toBeVisited.splice(0,1),visited.add(currentNode);var neighborEdges=currentNode.getEdges();for(i=0;i<neighborEdges.length;i++){var currentNeighbor=neighborEdges[i].getOtherEnd(currentNode);if(parents.get(currentNode)!=currentNeighbor){if(visited.has(currentNeighbor)){isForest=!1;break}toBeVisited.push(currentNeighbor),parents.set(currentNeighbor,currentNode)}}}if(isForest){var temp=[].concat(_toConsumableArray(visited));for(flatForest.push(temp),i=0;i<temp.length;i++){var value=temp[i],index=unProcessedNodes.indexOf(value);index>-1&&unProcessedNodes.splice(index,1)}visited=new Set,parents=new Map}else flatForest=[]}return flatForest},Layout2.prototype.createDummyNodesForBendpoints=function(edge){for(var dummyNodes=[],prev=edge.source,graph=this.graphManager.calcLowestCommonAncestor(edge.source,edge.target),i=0;i<edge.bendpoints.length;i++){var dummyNode=this.newNode(null);dummyNode.setRect(new Point(0,0),new Dimension(1,1)),graph.add(dummyNode);var dummyEdge=this.newEdge(null);this.graphManager.add(dummyEdge,prev,dummyNode),dummyNodes.add(dummyNode),prev=dummyNode}return dummyEdge=this.newEdge(null),this.graphManager.add(dummyEdge,prev,edge.target),this.edgeToDummyNodes.set(edge,dummyNodes),edge.isInterGraph()?this.graphManager.remove(edge):graph.remove(edge),dummyNodes},Layout2.prototype.createBendpointsFromDummyNodes=function(){var edges=[];edges=edges.concat(this.graphManager.getAllEdges()),edges=[].concat(_toConsumableArray(this.edgeToDummyNodes.keys())).concat(edges);for(var k=0;k<edges.length;k++){var lEdge=edges[k];if(lEdge.bendpoints.length>0){for(var path=this.edgeToDummyNodes.get(lEdge),i=0;i<path.length;i++){var dummyNode=path[i],p=new PointD(dummyNode.getCenterX(),dummyNode.getCenterY()),ebp=lEdge.bendpoints.get(i);ebp.x=p.x,ebp.y=p.y,dummyNode.getOwner().remove(dummyNode)}this.graphManager.add(lEdge,lEdge.source,lEdge.target)}}},Layout2.transform=function(sliderValue,defaultValue,minDiv,maxMul){if(null!=minDiv&&null!=maxMul){var value=defaultValue;return sliderValue<=50?value-=(defaultValue-defaultValue/minDiv)/50*(50-sliderValue):value+=(defaultValue*maxMul-defaultValue)/50*(sliderValue-50),value}var a,b;return sliderValue<=50?(a=9*defaultValue/500,b=defaultValue/10):(a=9*defaultValue/50,b=-8*defaultValue),a*sliderValue+b},Layout2.findCenterOfTree=function(nodes){var list=[];list=list.concat(nodes);var removedNodes=[],remainingDegrees=new Map,foundCenter=!1,centerNode=null;1!=list.length&&2!=list.length||(foundCenter=!0,centerNode=list[0]);for(var i=0;i<list.length;i++){var degree=(node=list[i]).getNeighborsList().size;remainingDegrees.set(node,node.getNeighborsList().size),1==degree&&removedNodes.push(node)}var tempList=[];for(tempList=tempList.concat(removedNodes);!foundCenter;){var tempList2=[];for(tempList2=tempList2.concat(tempList),tempList=[],i=0;i<list.length;i++){var node=list[i],index=list.indexOf(node);index>=0&&list.splice(index,1),node.getNeighborsList().forEach(function(neighbour){if(removedNodes.indexOf(neighbour)<0){var newDegree=remainingDegrees.get(neighbour)-1;1==newDegree&&tempList.push(neighbour),remainingDegrees.set(neighbour,newDegree)}})}removedNodes=removedNodes.concat(tempList),1!=list.length&&2!=list.length||(foundCenter=!0,centerNode=list[0])}return centerNode},Layout2.prototype.setGraphManager=function(gm){this.graphManager=gm},module2.exports=Layout2},function(module2,exports$12,__webpack_require__){function RandomSeed(){}RandomSeed.seed=1,RandomSeed.x=0,RandomSeed.nextDouble=function(){return RandomSeed.x=1e4*Math.sin(RandomSeed.seed++),RandomSeed.x-Math.floor(RandomSeed.x)},module2.exports=RandomSeed},function(module2,exports$12,__webpack_require__){var PointD=__webpack_require__(5);function Transform(x,y){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}Transform.prototype.getWorldOrgX=function(){return this.lworldOrgX},Transform.prototype.setWorldOrgX=function(wox){this.lworldOrgX=wox},Transform.prototype.getWorldOrgY=function(){return this.lworldOrgY},Transform.prototype.setWorldOrgY=function(woy){this.lworldOrgY=woy},Transform.prototype.getWorldExtX=function(){return this.lworldExtX},Transform.prototype.setWorldExtX=function(wex){this.lworldExtX=wex},Transform.prototype.getWorldExtY=function(){return this.lworldExtY},Transform.prototype.setWorldExtY=function(wey){this.lworldExtY=wey},Transform.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},Transform.prototype.setDeviceOrgX=function(dox){this.ldeviceOrgX=dox},Transform.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},Transform.prototype.setDeviceOrgY=function(doy){this.ldeviceOrgY=doy},Transform.prototype.getDeviceExtX=function(){return this.ldeviceExtX},Transform.prototype.setDeviceExtX=function(dex){this.ldeviceExtX=dex},Transform.prototype.getDeviceExtY=function(){return this.ldeviceExtY},Transform.prototype.setDeviceExtY=function(dey){this.ldeviceExtY=dey},Transform.prototype.transformX=function(x){var xDevice=0,worldExtX=this.lworldExtX;return 0!=worldExtX&&(xDevice=this.ldeviceOrgX+(x-this.lworldOrgX)*this.ldeviceExtX/worldExtX),xDevice},Transform.prototype.transformY=function(y){var yDevice=0,worldExtY=this.lworldExtY;return 0!=worldExtY&&(yDevice=this.ldeviceOrgY+(y-this.lworldOrgY)*this.ldeviceExtY/worldExtY),yDevice},Transform.prototype.inverseTransformX=function(x){var xWorld=0,deviceExtX=this.ldeviceExtX;return 0!=deviceExtX&&(xWorld=this.lworldOrgX+(x-this.ldeviceOrgX)*this.lworldExtX/deviceExtX),xWorld},Transform.prototype.inverseTransformY=function(y){var yWorld=0,deviceExtY=this.ldeviceExtY;return 0!=deviceExtY&&(yWorld=this.lworldOrgY+(y-this.ldeviceOrgY)*this.lworldExtY/deviceExtY),yWorld},Transform.prototype.inverseTransformPoint=function(inPoint){return new PointD(this.inverseTransformX(inPoint.x),this.inverseTransformY(inPoint.y))},module2.exports=Transform},function(module2,exports$12,__webpack_require__){var Layout2=__webpack_require__(15),FDLayoutConstants=__webpack_require__(4),LayoutConstants=__webpack_require__(0),IGeometry=__webpack_require__(8),IMath=__webpack_require__(9);function FDLayout(){Layout2.call(this),this.useSmartIdealEdgeLengthCalculation=FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*FDLayoutConstants.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=FDLayoutConstants.MAX_ITERATIONS}for(var prop in FDLayout.prototype=Object.create(Layout2.prototype),Layout2)FDLayout[prop]=Layout2[prop];FDLayout.prototype.initParameters=function(){Layout2.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},FDLayout.prototype.calcIdealEdgeLengths=function(){for(var edge,originalIdealLength,lcaDepth,source,target,sizeOfSourceInLca,sizeOfTargetInLca,allEdges=this.getGraphManager().getAllEdges(),i=0;i<allEdges.length;i++)originalIdealLength=(edge=allEdges[i]).idealLength,edge.isInterGraph&&(source=edge.getSource(),target=edge.getTarget(),sizeOfSourceInLca=edge.getSourceInLca().getEstimatedSize(),sizeOfTargetInLca=edge.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(edge.idealLength+=sizeOfSourceInLca+sizeOfTargetInLca-2*LayoutConstants.SIMPLE_NODE_SIZE),lcaDepth=edge.getLca().getInclusionTreeDepth(),edge.idealLength+=originalIdealLength*FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(source.getInclusionTreeDepth()+target.getInclusionTreeDepth()-2*lcaDepth))},FDLayout.prototype.initSpringEmbedder=function(){var s=this.getAllNodes().length;this.incremental?(s>FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*FDLayoutConstants.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(s-FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT)/(FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT-FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-FDLayoutConstants.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL):(s>FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(FDLayoutConstants.COOLING_ADAPTATION_FACTOR,1-(s-FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT)/(FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT-FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT)*(1-FDLayoutConstants.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=FDLayoutConstants.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*FDLayoutConstants.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},FDLayout.prototype.calcSpringForces=function(){for(var edge,lEdges=this.getAllEdges(),i=0;i<lEdges.length;i++)edge=lEdges[i],this.calcSpringForce(edge,edge.idealLength)},FDLayout.prototype.calcRepulsionForces=function(){var i,j,nodeA,nodeB,processedNodeSet,gridUpdateAllowed=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],forceToNodeSurroundingUpdate=arguments.length>1&&void 0!==arguments[1]&&arguments[1],lNodes=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD==1&&gridUpdateAllowed&&this.updateGrid(),processedNodeSet=new Set,i=0;i<lNodes.length;i++)nodeA=lNodes[i],this.calculateRepulsionForceOfANode(nodeA,processedNodeSet,gridUpdateAllowed,forceToNodeSurroundingUpdate),processedNodeSet.add(nodeA);else for(i=0;i<lNodes.length;i++)for(nodeA=lNodes[i],j=i+1;j<lNodes.length;j++)nodeB=lNodes[j],nodeA.getOwner()==nodeB.getOwner()&&this.calcRepulsionForce(nodeA,nodeB)},FDLayout.prototype.calcGravitationalForces=function(){for(var node,lNodes=this.getAllNodesToApplyGravitation(),i=0;i<lNodes.length;i++)node=lNodes[i],this.calcGravitationalForce(node)},FDLayout.prototype.moveNodes=function(){for(var lNodes=this.getAllNodes(),i=0;i<lNodes.length;i++)lNodes[i].move()},FDLayout.prototype.calcSpringForce=function(edge,idealLength){var length,springForce,springForceX,springForceY,sourceNode=edge.getSource(),targetNode=edge.getTarget();if(this.uniformLeafNodeSizes&&null==sourceNode.getChild()&&null==targetNode.getChild())edge.updateLengthSimple();else if(edge.updateLength(),edge.isOverlapingSourceAndTarget)return;0!=(length=edge.getLength())&&(springForceX=(springForce=edge.edgeElasticity*(length-idealLength))*(edge.lengthX/length),springForceY=springForce*(edge.lengthY/length),sourceNode.springForceX+=springForceX,sourceNode.springForceY+=springForceY,targetNode.springForceX-=springForceX,targetNode.springForceY-=springForceY)},FDLayout.prototype.calcRepulsionForce=function(nodeA,nodeB){var distanceX,distanceY,distanceSquared,distance,repulsionForce,repulsionForceX,repulsionForceY,rectA=nodeA.getRect(),rectB=nodeB.getRect(),overlapAmount=new Array(2),clipPoints=new Array(4);if(rectA.intersects(rectB)){IGeometry.calcSeparationAmount(rectA,rectB,overlapAmount,FDLayoutConstants.DEFAULT_EDGE_LENGTH/2),repulsionForceX=2*overlapAmount[0],repulsionForceY=2*overlapAmount[1];var childrenConstant=nodeA.noOfChildren*nodeB.noOfChildren/(nodeA.noOfChildren+nodeB.noOfChildren);nodeA.repulsionForceX-=childrenConstant*repulsionForceX,nodeA.repulsionForceY-=childrenConstant*repulsionForceY,nodeB.repulsionForceX+=childrenConstant*repulsionForceX,nodeB.repulsionForceY+=childrenConstant*repulsionForceY}else this.uniformLeafNodeSizes&&null==nodeA.getChild()&&null==nodeB.getChild()?(distanceX=rectB.getCenterX()-rectA.getCenterX(),distanceY=rectB.getCenterY()-rectA.getCenterY()):(IGeometry.getIntersection(rectA,rectB,clipPoints),distanceX=clipPoints[2]-clipPoints[0],distanceY=clipPoints[3]-clipPoints[1]),Math.abs(distanceX)<FDLayoutConstants.MIN_REPULSION_DIST&&(distanceX=IMath.sign(distanceX)*FDLayoutConstants.MIN_REPULSION_DIST),Math.abs(distanceY)<FDLayoutConstants.MIN_REPULSION_DIST&&(distanceY=IMath.sign(distanceY)*FDLayoutConstants.MIN_REPULSION_DIST),distanceSquared=distanceX*distanceX+distanceY*distanceY,distance=Math.sqrt(distanceSquared),repulsionForceX=(repulsionForce=(nodeA.nodeRepulsion/2+nodeB.nodeRepulsion/2)*nodeA.noOfChildren*nodeB.noOfChildren/distanceSquared)*distanceX/distance,repulsionForceY=repulsionForce*distanceY/distance,nodeA.repulsionForceX-=repulsionForceX,nodeA.repulsionForceY-=repulsionForceY,nodeB.repulsionForceX+=repulsionForceX,nodeB.repulsionForceY+=repulsionForceY},FDLayout.prototype.calcGravitationalForce=function(node){var ownerGraph,ownerCenterX,ownerCenterY,distanceX,distanceY,absDistanceX,absDistanceY,estimatedSize;ownerCenterX=((ownerGraph=node.getOwner()).getRight()+ownerGraph.getLeft())/2,ownerCenterY=(ownerGraph.getTop()+ownerGraph.getBottom())/2,distanceX=node.getCenterX()-ownerCenterX,distanceY=node.getCenterY()-ownerCenterY,absDistanceX=Math.abs(distanceX)+node.getWidth()/2,absDistanceY=Math.abs(distanceY)+node.getHeight()/2,node.getOwner()==this.graphManager.getRoot()?(absDistanceX>(estimatedSize=ownerGraph.getEstimatedSize()*this.gravityRangeFactor)||absDistanceY>estimatedSize)&&(node.gravitationForceX=-this.gravityConstant*distanceX,node.gravitationForceY=-this.gravityConstant*distanceY):(absDistanceX>(estimatedSize=ownerGraph.getEstimatedSize()*this.compoundGravityRangeFactor)||absDistanceY>estimatedSize)&&(node.gravitationForceX=-this.gravityConstant*distanceX*this.compoundGravityConstant,node.gravitationForceY=-this.gravityConstant*distanceY*this.compoundGravityConstant)},FDLayout.prototype.isConverged=function(){var converged,oscilating=!1;return this.totalIterations>this.maxIterations/3&&(oscilating=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),converged=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,converged||oscilating},FDLayout.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},FDLayout.prototype.calcNoOfChildrenForAllNodes=function(){for(var node,allNodes=this.graphManager.getAllNodes(),i=0;i<allNodes.length;i++)(node=allNodes[i]).noOfChildren=node.getNoOfChildren()},FDLayout.prototype.calcGrid=function(graph){var sizeX,sizeY;sizeX=parseInt(Math.ceil((graph.getRight()-graph.getLeft())/this.repulsionRange)),sizeY=parseInt(Math.ceil((graph.getBottom()-graph.getTop())/this.repulsionRange));for(var grid=new Array(sizeX),i=0;i<sizeX;i++)grid[i]=new Array(sizeY);for(i=0;i<sizeX;i++)for(var j=0;j<sizeY;j++)grid[i][j]=new Array;return grid},FDLayout.prototype.addNodeToGrid=function(v,left,top){var startX,finishX,startY,finishY;startX=parseInt(Math.floor((v.getRect().x-left)/this.repulsionRange)),finishX=parseInt(Math.floor((v.getRect().width+v.getRect().x-left)/this.repulsionRange)),startY=parseInt(Math.floor((v.getRect().y-top)/this.repulsionRange)),finishY=parseInt(Math.floor((v.getRect().height+v.getRect().y-top)/this.repulsionRange));for(var i=startX;i<=finishX;i++)for(var j=startY;j<=finishY;j++)this.grid[i][j].push(v),v.setGridCoordinates(startX,finishX,startY,finishY)},FDLayout.prototype.updateGrid=function(){var i,nodeA,lNodes=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),i=0;i<lNodes.length;i++)nodeA=lNodes[i],this.addNodeToGrid(nodeA,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},FDLayout.prototype.calculateRepulsionForceOfANode=function(nodeA,processedNodeSet,gridUpdateAllowed,forceToNodeSurroundingUpdate){if(this.totalIterations%FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD==1&&gridUpdateAllowed||forceToNodeSurroundingUpdate){var nodeB,surrounding=new Set;nodeA.surrounding=new Array;for(var grid=this.grid,i=nodeA.startX-1;i<nodeA.finishX+2;i++)for(var j=nodeA.startY-1;j<nodeA.finishY+2;j++)if(!(i<0||j<0||i>=grid.length||j>=grid[0].length))for(var k=0;k<grid[i][j].length;k++)if(nodeB=grid[i][j][k],nodeA.getOwner()==nodeB.getOwner()&&nodeA!=nodeB&&!processedNodeSet.has(nodeB)&&!surrounding.has(nodeB)){var distanceX=Math.abs(nodeA.getCenterX()-nodeB.getCenterX())-(nodeA.getWidth()/2+nodeB.getWidth()/2),distanceY=Math.abs(nodeA.getCenterY()-nodeB.getCenterY())-(nodeA.getHeight()/2+nodeB.getHeight()/2);distanceX<=this.repulsionRange&&distanceY<=this.repulsionRange&&surrounding.add(nodeB)}nodeA.surrounding=[].concat(function(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}(surrounding))}for(i=0;i<nodeA.surrounding.length;i++)this.calcRepulsionForce(nodeA,nodeA.surrounding[i])},FDLayout.prototype.calcRepulsionRange=function(){return 0},module2.exports=FDLayout},function(module2,exports$12,__webpack_require__){var LEdge=__webpack_require__(1),FDLayoutConstants=__webpack_require__(4);function FDLayoutEdge(source,target,vEdge){LEdge.call(this,source,target,vEdge),this.idealLength=FDLayoutConstants.DEFAULT_EDGE_LENGTH,this.edgeElasticity=FDLayoutConstants.DEFAULT_SPRING_STRENGTH}for(var prop in FDLayoutEdge.prototype=Object.create(LEdge.prototype),LEdge)FDLayoutEdge[prop]=LEdge[prop];module2.exports=FDLayoutEdge},function(module2,exports$12,__webpack_require__){var LNode=__webpack_require__(3),FDLayoutConstants=__webpack_require__(4);function FDLayoutNode(gm,loc,size,vNode){LNode.call(this,gm,loc,size,vNode),this.nodeRepulsion=FDLayoutConstants.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 prop in FDLayoutNode.prototype=Object.create(LNode.prototype),LNode)FDLayoutNode[prop]=LNode[prop];FDLayoutNode.prototype.setGridCoordinates=function(_startX,_finishX,_startY,_finishY){this.startX=_startX,this.finishX=_finishX,this.startY=_startY,this.finishY=_finishY},module2.exports=FDLayoutNode},function(module2,exports$12,__webpack_require__){function DimensionD2(width,height){this.width=0,this.height=0,null!==width&&null!==height&&(this.height=height,this.width=width)}DimensionD2.prototype.getWidth=function(){return this.width},DimensionD2.prototype.setWidth=function(width){this.width=width},DimensionD2.prototype.getHeight=function(){return this.height},DimensionD2.prototype.setHeight=function(height){this.height=height},module2.exports=DimensionD2},function(module2,exports$12,__webpack_require__){var UniqueIDGeneretor=__webpack_require__(14);function HashMap(){this.map={},this.keys=[]}HashMap.prototype.put=function(key,value){var theId=UniqueIDGeneretor.createID(key);this.contains(theId)||(this.map[theId]=value,this.keys.push(key))},HashMap.prototype.contains=function(key){return UniqueIDGeneretor.createID(key),null!=this.map[key]},HashMap.prototype.get=function(key){var theId=UniqueIDGeneretor.createID(key);return this.map[theId]},HashMap.prototype.keySet=function(){return this.keys},module2.exports=HashMap},function(module2,exports$12,__webpack_require__){var UniqueIDGeneretor=__webpack_require__(14);function HashSet(){this.set={}}HashSet.prototype.add=function(obj){var theId=UniqueIDGeneretor.createID(obj);this.contains(theId)||(this.set[theId]=obj)},HashSet.prototype.remove=function(obj){delete this.set[UniqueIDGeneretor.createID(obj)]},HashSet.prototype.clear=function(){this.set={}},HashSet.prototype.contains=function(obj){return this.set[UniqueIDGeneretor.createID(obj)]==obj},HashSet.prototype.isEmpty=function(){return 0===this.size()},HashSet.prototype.size=function(){return Object.keys(this.set).length},HashSet.prototype.addAllTo=function(list){for(var keys=Object.keys(this.set),length=keys.length,i=0;i<length;i++)list.push(this.set[keys[i]])},HashSet.prototype.size=function(){return Object.keys(this.set).length},HashSet.prototype.addAll=function(list){for(var s=list.length,i=0;i<s;i++){var v=list[i];this.add(v)}},module2.exports=HashSet},function(module2,exports$12,__webpack_require__){function Matrix(){}Matrix.multMat=function(array1,array2){for(var result=[],i=0;i<array1.length;i++){result[i]=[];for(var j=0;j<array2[0].length;j++){result[i][j]=0;for(var k=0;k<array1[0].length;k++)result[i][j]+=array1[i][k]*array2[k][j]}}return result},Matrix.transpose=function(array){for(var result=[],i=0;i<array[0].length;i++){result[i]=[];for(var j=0;j<array.length;j++)result[i][j]=array[j][i]}return result},Matrix.multCons=function(array,constant){for(var result=[],i=0;i<array.length;i++)result[i]=array[i]*constant;return result},Matrix.minusOp=function(array1,array2){for(var result=[],i=0;i<array1.length;i++)result[i]=array1[i]-array2[i];return result},Matrix.dotProduct=function(array1,array2){for(var product=0,i=0;i<array1.length;i++)product+=array1[i]*array2[i];return product},Matrix.mag=function(array){return Math.sqrt(this.dotProduct(array,array))},Matrix.normalize=function(array){for(var result=[],magnitude=this.mag(array),i=0;i<array.length;i++)result[i]=array[i]/magnitude;return result},Matrix.multGamma=function(array){for(var result=[],sum=0,i=0;i<array.length;i++)sum+=array[i];sum*=-1/array.length;for(var _i=0;_i<array.length;_i++)result[_i]=sum+array[_i];return result},Matrix.multL=function(array,C,INV){for(var result=[],temp1=[],temp2=[],i=0;i<C[0].length;i++){for(var sum=0,j=0;j<C.length;j++)sum+=-.5*C[j][i]*array[j];temp1[i]=sum}for(var _i2=0;_i2<INV.length;_i2++){for(var _sum=0,_j=0;_j<INV.length;_j++)_sum+=INV[_i2][_j]*temp1[_j];temp2[_i2]=_sum}for(var _i3=0;_i3<C.length;_i3++){for(var _sum2=0,_j2=0;_j2<C[0].length;_j2++)_sum2+=C[_i3][_j2]*temp2[_j2];result[_i3]=_sum2}return result},module2.exports=Matrix},function(module2,exports$12,__webpack_require__){var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),LinkedList=__webpack_require__(11),Quicksort=function(){function Quicksort2(A,compareFunction){!function(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Quicksort2),null===compareFunction&&void 0===compareFunction||(this.compareFunction=this._defaultCompareFunction);var length=void 0;length=A instanceof LinkedList?A.size():A.length,this._quicksort(A,0,length-1)}return _createClass(Quicksort2,[{key:"_quicksort",value:function(A,p,r){if(p<r){var q=this._partition(A,p,r);this._quicksort(A,p,q),this._quicksort(A,q+1,r)}}},{key:"_partition",value:function(A,p,r){for(var x=this._get(A,p),i=p,j=r;;){for(;this.compareFunction(x,this._get(A,j));)j--;for(;this.compareFunction(this._get(A,i),x);)i++;if(!(i<j))return j;this._swap(A,i,j),i++,j--}}},{key:"_get",value:function(object,index){return object instanceof LinkedList?object.get_object_at(index):object[index]}},{key:"_set",value:function(object,index,value){object instanceof LinkedList?object.set_object_at(index,value):object[index]=value}},{key:"_swap",value:function(A,i,j){var temp=this._get(A,i);this._set(A,i,this._get(A,j)),this._set(A,j,temp)}},{key:"_defaultCompareFunction",value:function(a,b){return b>a}}]),Quicksort2}();module2.exports=Quicksort},function(module2,exports$12,__webpack_require__){function SVD(){}SVD.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 nu=Math.min(this.m,this.n);this.s=function(s){for(var a=[];s-- >0;)a.push(0);return a}(Math.min(this.m+1,this.n)),this.U=function allocate2(dims2){if(0==dims2.length)return 0;for(var array=[],i2=0;i2<dims2[0];i2++)array.push(allocate2(dims2.slice(1)));return array}([this.m,nu]),this.V=function(dims){return function allocate2(dims2){if(0==dims2.length)return 0;for(var array=[],i2=0;i2<dims2[0];i2++)array.push(allocate2(dims2.slice(1)));return array}(dims)}([this.n,this.n]);for(var e=function(s){for(var a=[];s-- >0;)a.push(0);return a}(this.n),work=function(s){for(var a=[];s-- >0;)a.push(0);return a}(this.m),nct=Math.min(this.m-1,this.n),nrt=Math.max(0,Math.min(this.n-2,this.m)),k=0;k<Math.max(nct,nrt);k++){if(k<nct){this.s[k]=0;for(var i=k;i<this.m;i++)this.s[k]=SVD.hypot(this.s[k],A[i][k]);if(0!==this.s[k]){A[k][k]<0&&(this.s[k]=-this.s[k]);for(var _i=k;_i<this.m;_i++)A[_i][k]/=this.s[k];A[k][k]+=1}this.s[k]=-this.s[k]}for(var j=k+1;j<this.n;j++){if(function(lhs,rhs){return lhs&&rhs}(k<nct,0!==this.s[k])){for(var t=0,_i2=k;_i2<this.m;_i2++)t+=A[_i2][k]*A[_i2][j];t=-t/A[k][k];for(var _i3=k;_i3<this.m;_i3++)A[_i3][j]+=t*A[_i3][k]}e[j]=A[k][j]}if(function(lhs,rhs){return rhs}(0,k<nct))for(var _i4=k;_i4<this.m;_i4++)this.U[_i4][k]=A[_i4][k];if(k<nrt){e[k]=0;for(var _i5=k+1;_i5<this.n;_i5++)e[k]=SVD.hypot(e[k],e[_i5]);if(0!==e[k]){e[k+1]<0&&(e[k]=-e[k]);for(var _i6=k+1;_i6<this.n;_i6++)e[_i6]/=e[k];e[k+1]+=1}if(e[k]=-e[k],function(lhs,rhs){return lhs&&rhs}(k+1<this.m,0!==e[k])){for(var _i7=k+1;_i7<this.m;_i7++)work[_i7]=0;for(var _j=k+1;_j<this.n;_j++)for(var _i8=k+1;_i8<this.m;_i8++)work[_i8]+=e[_j]*A[_i8][_j];for(var _j2=k+1;_j2<this.n;_j2++)for(var _t=-e[_j2]/e[k+1],_i9=k+1;_i9<this.m;_i9++)A[_i9][_j2]+=_t*work[_i9]}for(var _i10=k+1;_i10<this.n;_i10++)this.V[_i10][k]=e[_i10]}}var p=Math.min(this.n,this.m+1);nct<this.n&&(this.s[nct]=A[nct][nct]),this.m<p&&(this.s[p-1]=0),nrt+1<p&&(e[nrt]=A[nrt][p-1]),e[p-1]=0;for(var _j3=nct;_j3<nu;_j3++){for(var _i11=0;_i11<this.m;_i11++)this.U[_i11][_j3]=0;this.U[_j3][_j3]=1}for(var _k=nct-1;_k>=0;_k--)if(0!==this.s[_k]){for(var _j4=_k+1;_j4<nu;_j4++){for(var _t2=0,_i12=_k;_i12<this.m;_i12++)_t2+=this.U[_i12][_k]*this.U[_i12][_j4];_t2=-_t2/this.U[_k][_k];for(var _i13=_k;_i13<this.m;_i13++)this.U[_i13][_j4]+=_t2*this.U[_i13][_k]}for(var _i14=_k;_i14<this.m;_i14++)this.U[_i14][_k]=-this.U[_i14][_k];this.U[_k][_k]=1+this.U[_k][_k];for(var _i15=0;_i15<_k-1;_i15++)this.U[_i15][_k]=0}else{for(var _i16=0;_i16<this.m;_i16++)this.U[_i16][_k]=0;this.U[_k][_k]=1}for(var _k2=this.n-1;_k2>=0;_k2--){if(function(lhs,rhs){return lhs&&rhs}(_k2<nrt,0!==e[_k2]))for(var _j5=_k2+1;_j5<nu;_j5++){for(var _t3=0,_i17=_k2+1;_i17<this.n;_i17++)_t3+=this.V[_i17][_k2]*this.V[_i17][_j5];_t3=-_t3/this.V[_k2+1][_k2];for(var _i18=_k2+1;_i18<this.n;_i18++)this.V[_i18][_j5]+=_t3*this.V[_i18][_k2]}for(var _i19=0;_i19<this.n;_i19++)this.V[_i19][_k2]=0;this.V[_k2][_k2]=1}for(var pp=p-1,eps=Math.pow(2,-52),tiny=Math.pow(2,-966);p>0;){var _k3=void 0,kase=void 0;for(_k3=p-2;_k3>=-1&&-1!==_k3;_k3--)if(Math.abs(e[_k3])<=tiny+eps*(Math.abs(this.s[_k3])+Math.abs(this.s[_k3+1]))){e[_k3]=0;break}if(_k3===p-2)kase=4;else{var ks=void 0;for(ks=p-1;ks>=_k3&&ks!==_k3;ks--){var _t4=(ks!==p?Math.abs(e[ks]):0)+(ks!==_k3+1?Math.abs(e[ks-1]):0);if(Math.abs(this.s[ks])<=tiny+eps*_t4){this.s[ks]=0;break}}ks===_k3?kase=3:ks===p-1?kase=1:(kase=2,_k3=ks)}switch(_k3++,kase){case 1:var f=e[p-2];e[p-2]=0;for(var _j6=p-2;_j6>=_k3;_j6--){var _t5=SVD.hypot(this.s[_j6],f),cs=this.s[_j6]/_t5,sn=f/_t5;this.s[_j6]=_t5,_j6!==_k3&&(f=-sn*e[_j6-1],e[_j6-1]=cs*e[_j6-1]);for(var _i20=0;_i20<this.n;_i20++)_t5=cs*this.V[_i20][_j6]+sn*this.V[_i20][p-1],this.V[_i20][p-1]=-sn*this.V[_i20][_j6]+cs*this.V[_i20][p-1],this.V[_i20][_j6]=_t5}break;case 2:var _f=e[_k3-1];e[_k3-1]=0;for(var _j7=_k3;_j7<p;_j7++){var _t6=SVD.hypot(this.s[_j7],_f),_cs=this.s[_j7]/_t6,_sn=_f/_t6;this.s[_j7]=_t6,_f=-_sn*e[_j7],e[_j7]=_cs*e[_j7];for(var _i21=0;_i21<this.m;_i21++)_t6=_cs*this.U[_i21][_j7]+_sn*this.U[_i21][_k3-1],this.U[_i21][_k3-1]=-_sn*this.U[_i21][_j7]+_cs*this.U[_i21][_k3-1],this.U[_i21][_j7]=_t6}break;case 3:var scale=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[p-1]),Math.abs(this.s[p-2])),Math.abs(e[p-2])),Math.abs(this.s[_k3])),Math.abs(e[_k3])),sp=this.s[p-1]/scale,spm1=this.s[p-2]/scale,epm1=e[p-2]/scale,sk=this.s[_k3]/scale,ek=e[_k3]/scale,b=((spm1+sp)*(spm1-sp)+epm1*epm1)/2,c=sp*epm1*(sp*epm1),shift=0;(function(lhs,rhs){return lhs||rhs})(0!==b,0!==c)&&(shift=Math.sqrt(b*b+c),b<0&&(shift=-shift),shift=c/(b+shift));for(var _f2=(sk+sp)*(sk-sp)+shift,g=sk*ek,_j8=_k3;_j8<p-1;_j8++){var _t7=SVD.hypot(_f2,g),_cs2=_f2/_t7,_sn2=g/_t7;_j8!==_k3&&(e[_j8-1]=_t7),_f2=_cs2*this.s[_j8]+_sn2*e[_j8],e[_j8]=_cs2*e[_j8]-_sn2*this.s[_j8],g=_sn2*this.s[_j8+1],this.s[_j8+1]=_cs2*this.s[_j8+1];for(var _i22=0;_i22<this.n;_i22++)_t7=_cs2*this.V[_i22][_j8]+_sn2*this.V[_i22][_j8+1],this.V[_i22][_j8+1]=-_sn2*this.V[_i22][_j8]+_cs2*this.V[_i22][_j8+1],this.V[_i22][_j8]=_t7;if(_cs2=_f2/(_t7=SVD.hypot(_f2,g)),_sn2=g/_t7,this.s[_j8]=_t7,_f2=_cs2*e[_j8]+_sn2*this.s[_j8+1],this.s[_j8+1]=-_sn2*e[_j8]+_cs2*this.s[_j8+1],g=_sn2*e[_j8+1],e[_j8+1]=_cs2*e[_j8+1],_j8<this.m-1)for(var _i23=0;_i23<this.m;_i23++)_t7=_cs2*this.U[_i23][_j8]+_sn2*this.U[_i23][_j8+1],this.U[_i23][_j8+1]=-_sn2*this.U[_i23][_j8]+_cs2*this.U[_i23][_j8+1],this.U[_i23][_j8]=_t7}e[p-2]=_f2;break;case 4:if(this.s[_k3]<=0){this.s[_k3]=this.s[_k3]<0?-this.s[_k3]:0;for(var _i24=0;_i24<=pp;_i24++)this.V[_i24][_k3]=-this.V[_i24][_k3]}for(;_k3<pp&&!(this.s[_k3]>=this.s[_k3+1]);){var _t8=this.s[_k3];if(this.s[_k3]=this.s[_k3+1],this.s[_k3+1]=_t8,_k3<this.n-1)for(var _i25=0;_i25<this.n;_i25++)_t8=this.V[_i25][_k3+1],this.V[_i25][_k3+1]=this.V[_i25][_k3],this.V[_i25][_k3]=_t8;if(_k3<this.m-1)for(var _i26=0;_i26<this.m;_i26++)_t8=this.U[_i26][_k3+1],this.U[_i26][_k3+1]=this.U[_i26][_k3],this.U[_i26][_k3]=_t8;_k3++}p--}}return{U:this.U,V:this.V,S:this.s}},SVD.hypot=function(a,b){var r=void 0;return Math.abs(a)>Math.abs(b)?(r=b/a,r=Math.abs(a)*Math.sqrt(1+r*r)):0!=b?(r=a/b,r=Math.abs(b)*Math.sqrt(1+r*r)):r=0,r},module2.exports=SVD},function(module2,exports$12,__webpack_require__){var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),NeedlemanWunsch=function(){function NeedlemanWunsch2(sequence1,sequence2){var match_score=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,mismatch_penalty=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,gap_penalty=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,NeedlemanWunsch2),this.sequence1=sequence1,this.sequence2=sequence2,this.match_score=match_score,this.mismatch_penalty=mismatch_penalty,this.gap_penalty=gap_penalty,this.iMax=sequence1.length+1,this.jMax=sequence2.length+1,this.grid=new Array(this.iMax);for(var i=0;i<this.iMax;i++){this.grid[i]=new Array(this.jMax);for(var j=0;j<this.jMax;j++)this.grid[i][j]=0}this.tracebackGrid=new Array(this.iMax);for(var _i=0;_i<this.iMax;_i++){this.tracebackGrid[_i]=new Array(this.jMax);for(var _j=0;_j<this.jMax;_j++)this.tracebackGrid[_i][_j]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return _createClass(NeedlemanWunsch2,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var j=1;j<this.jMax;j++)this.grid[0][j]=this.grid[0][j-1]+this.gap_penalty,this.tracebackGrid[0][j]=[!1,!1,!0];for(var i=1;i<this.iMax;i++)this.grid[i][0]=this.grid[i-1][0]+this.gap_penalty,this.tracebackGrid[i][0]=[!1,!0,!1];for(var _i2=1;_i2<this.iMax;_i2++)for(var _j2=1;_j2<this.jMax;_j2++){var maxOf=[this.sequence1[_i2-1]===this.sequence2[_j2-1]?this.grid[_i2-1][_j2-1]+this.match_score:this.grid[_i2-1][_j2-1]+this.mismatch_penalty,this.grid[_i2-1][_j2]+this.gap_penalty,this.grid[_i2][_j2-1]+this.gap_penalty],indices=this.arrayAllMaxIndexes(maxOf);this.grid[_i2][_j2]=maxOf[indices[0]],this.tracebackGrid[_i2][_j2]=[indices.includes(0),indices.includes(1),indices.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var inProcessAlignments=[];for(inProcessAlignments.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});inProcessAlignments[0];){var current=inProcessAlignments[0],directions=this.tracebackGrid[current.pos[0]][current.pos[1]];directions[0]&&inProcessAlignments.push({pos:[current.pos[0]-1,current.pos[1]-1],seq1:this.sequence1[current.pos[0]-1]+current.seq1,seq2:this.sequence2[current.pos[1]-1]+current.seq2}),directions[1]&&inProcessAlignments.push({pos:[current.pos[0]-1,current.pos[1]],seq1:this.sequence1[current.pos[0]-1]+current.seq1,seq2:"-"+current.seq2}),directions[2]&&inProcessAlignments.push({pos:[current.pos[0],current.pos[1]-1],seq1:"-"+current.seq1,seq2:this.sequence2[current.pos[1]-1]+current.seq2}),0===current.pos[0]&&0===current.pos[1]&&this.alignments.push({sequence1:current.seq1,sequence2:current.seq2}),inProcessAlignments.shift()}return this.alignments}},{key:"getAllIndexes",value:function(arr,val){for(var indexes=[],i=-1;-1!==(i=arr.indexOf(val,i+1));)indexes.push(i);return indexes}},{key:"arrayAllMaxIndexes",value:function(array){return this.getAllIndexes(array,Math.max.apply(null,array))}}]),NeedlemanWunsch2}();module2.exports=NeedlemanWunsch},function(module2,exports$12,__webpack_require__){var layoutBase2=function(){};layoutBase2.FDLayout=__webpack_require__(18),layoutBase2.FDLayoutConstants=__webpack_require__(4),layoutBase2.FDLayoutEdge=__webpack_require__(19),layoutBase2.FDLayoutNode=__webpack_require__(20),layoutBase2.DimensionD=__webpack_require__(21),layoutBase2.HashMap=__webpack_require__(22),layoutBase2.HashSet=__webpack_require__(23),layoutBase2.IGeometry=__webpack_require__(8),layoutBase2.IMath=__webpack_require__(9),layoutBase2.Integer=__webpack_require__(10),layoutBase2.Point=__webpack_require__(12),layoutBase2.PointD=__webpack_require__(5),layoutBase2.RandomSeed=__webpack_require__(16),layoutBase2.RectangleD=__webpack_require__(13),layoutBase2.Transform=__webpack_require__(17),layoutBase2.UniqueIDGeneretor=__webpack_require__(14),layoutBase2.Quicksort=__webpack_require__(25),layoutBase2.LinkedList=__webpack_require__(11),layoutBase2.LGraphObject=__webpack_require__(2),layoutBase2.LGraph=__webpack_require__(6),layoutBase2.LEdge=__webpack_require__(1),layoutBase2.LGraphManager=__webpack_require__(7),layoutBase2.LNode=__webpack_require__(3),layoutBase2.Layout=__webpack_require__(15),layoutBase2.LayoutConstants=__webpack_require__(0),layoutBase2.NeedlemanWunsch=__webpack_require__(27),layoutBase2.Matrix=__webpack_require__(24),layoutBase2.SVD=__webpack_require__(26),module2.exports=layoutBase2},function(module2,exports$12,__webpack_require__){function Emitter(){this.listeners=[]}var p=Emitter.prototype;p.addListener=function(event,callback){this.listeners.push({event:event,callback:callback})},p.removeListener=function(event,callback){for(var i=this.listeners.length;i>=0;i--){var l=this.listeners[i];l.event===event&&l.callback===callback&&this.listeners.splice(i,1)}},p.emit=function(event,data){for(var i=0;i<this.listeners.length;i++){var l=this.listeners[i];event===l.event&&l.callback(data)}},module2.exports=Emitter}])},layoutBase$1.exports=factory());var factory}var hasRequiredCoseBase;function requireCoseBase(){return hasRequiredCoseBase?coseBase$1.exports:(hasRequiredCoseBase=1,factory=function(__WEBPACK_EXTERNAL_MODULE__551__){return __webpack_modules__={45:(module2,__unused_webpack_exports,__webpack_require__2)=>{var coseBase2={};coseBase2.layoutBase=__webpack_require__2(551),coseBase2.CoSEConstants=__webpack_require__2(806),coseBase2.CoSEEdge=__webpack_require__2(767),coseBase2.CoSEGraph=__webpack_require__2(880),coseBase2.CoSEGraphManager=__webpack_require__2(578),coseBase2.CoSELayout=__webpack_require__2(765),coseBase2.CoSENode=__webpack_require__2(991),coseBase2.ConstraintHandler=__webpack_require__2(902),module2.exports=coseBase2},806:(module2,__unused_webpack_exports,__webpack_require__2)=>{var FDLayoutConstants=__webpack_require__2(551).FDLayoutConstants;function CoSEConstants(){}for(var prop in FDLayoutConstants)CoSEConstants[prop]=FDLayoutConstants[prop];CoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,CoSEConstants.DEFAULT_RADIAL_SEPARATION=FDLayoutConstants.DEFAULT_EDGE_LENGTH,CoSEConstants.DEFAULT_COMPONENT_SEPERATION=60,CoSEConstants.TILE=!0,CoSEConstants.TILING_PADDING_VERTICAL=10,CoSEConstants.TILING_PADDING_HORIZONTAL=10,CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,CoSEConstants.ENFORCE_CONSTRAINTS=!0,CoSEConstants.APPLY_LAYOUT=!0,CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL=!0,CoSEConstants.PURE_INCREMENTAL=CoSEConstants.DEFAULT_INCREMENTAL,module2.exports=CoSEConstants},767:(module2,__unused_webpack_exports,__webpack_require__2)=>{var FDLayoutEdge=__webpack_require__2(551).FDLayoutEdge;function CoSEEdge(source,target,vEdge){FDLayoutEdge.call(this,source,target,vEdge)}for(var prop in CoSEEdge.prototype=Object.create(FDLayoutEdge.prototype),FDLayoutEdge)CoSEEdge[prop]=FDLayoutEdge[prop];module2.exports=CoSEEdge},880:(module2,__unused_webpack_exports,__webpack_require__2)=>{var LGraph=__webpack_require__2(551).LGraph;function CoSEGraph(parent,graphMgr,vGraph){LGraph.call(this,parent,graphMgr,vGraph)}for(var prop in CoSEGraph.prototype=Object.create(LGraph.prototype),LGraph)CoSEGraph[prop]=LGraph[prop];module2.exports=CoSEGraph},578:(module2,__unused_webpack_exports,__webpack_require__2)=>{var LGraphManager=__webpack_require__2(551).LGraphManager;function CoSEGraphManager(layout){LGraphManager.call(this,layout)}for(var prop in CoSEGraphManager.prototype=Object.create(LGraphManager.prototype),LGraphManager)CoSEGraphManager[prop]=LGraphManager[prop];module2.exports=CoSEGraphManager},765:(module2,__unused_webpack_exports,__webpack_require__2)=>{var FDLayout=__webpack_require__2(551).FDLayout,CoSEGraphManager=__webpack_require__2(578),CoSEGraph=__webpack_require__2(880),CoSENode=__webpack_require__2(991),CoSEEdge=__webpack_require__2(767),CoSEConstants=__webpack_require__2(806),ConstraintHandler=__webpack_require__2(902),FDLayoutConstants=__webpack_require__2(551).FDLayoutConstants,LayoutConstants=__webpack_require__2(551).LayoutConstants,Point2=__webpack_require__2(551).Point,PointD=__webpack_require__2(551).PointD,DimensionD2=__webpack_require__2(551).DimensionD,Layout2=__webpack_require__2(551).Layout,Integer=__webpack_require__2(551).Integer,IGeometry=__webpack_require__2(551).IGeometry,LGraph=__webpack_require__2(551).LGraph,Transform=__webpack_require__2(551).Transform,LinkedList=__webpack_require__2(551).LinkedList;function CoSELayout(){FDLayout.call(this),this.toBeTiled={},this.constraints={}}for(var prop in CoSELayout.prototype=Object.create(FDLayout.prototype),FDLayout)CoSELayout[prop]=FDLayout[prop];CoSELayout.prototype.newGraphManager=function(){var gm=new CoSEGraphManager(this);return this.graphManager=gm,gm},CoSELayout.prototype.newGraph=function(vGraph){return new CoSEGraph(null,this.graphManager,vGraph)},CoSELayout.prototype.newNode=function(vNode){return new CoSENode(this.graphManager,vNode)},CoSELayout.prototype.newEdge=function(vEdge){return new CoSEEdge(null,null,vEdge)},CoSELayout.prototype.initParameters=function(){FDLayout.prototype.initParameters.call(this,arguments),this.isSubLayout||(CoSEConstants.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=CoSEConstants.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},CoSELayout.prototype.initSpringEmbedder=function(){FDLayout.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/FDLayoutConstants.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},CoSELayout.prototype.layout=function(){return LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},CoSELayout.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)CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),allNodes=new Set(this.getAllNodes()),intersection=this.nodesWithGravity.filter(function(x){return allNodes.has(x)}),this.graphManager.setAllNodesToApplyGravitation(intersection));else{var forest=this.getFlatForest();if(forest.length>0)this.positionNodesRadially(forest);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var allNodes=new Set(this.getAllNodes()),intersection=this.nodesWithGravity.filter(function(x){return allNodes.has(x)});this.graphManager.setAllNodesToApplyGravitation(intersection),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(ConstraintHandler.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),CoSEConstants.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},CoSELayout.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%FDLayoutConstants.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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 allNodes=new Set(this.getAllNodes()),intersection=this.nodesWithGravity.filter(function(x){return allNodes.has(x)});this.graphManager.setAllNodesToApplyGravitation(intersection),this.graphManager.updateBounds(),this.updateGrid(),CoSEConstants.PURE_INCREMENTAL?this.coolingFactor=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=FDLayoutConstants.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()),CoSEConstants.PURE_INCREMENTAL?this.coolingFactor=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var gridUpdateAllowed=!this.isTreeGrowing&&!this.isGrowthFinished,forceToNodeSurroundingUpdate=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(gridUpdateAllowed,forceToNodeSurroundingUpdate),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},CoSELayout.prototype.getPositionsData=function(){for(var allNodes=this.graphManager.getAllNodes(),pData={},i=0;i<allNodes.length;i++){var rect=allNodes[i].rect,id=allNodes[i].id;pData[id]={id:id,x:rect.getCenterX(),y:rect.getCenterY(),w:rect.width,h:rect.height}}return pData},CoSELayout.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var layoutEnded=!1;if("during"===FDLayoutConstants.ANIMATE)this.emit("layoutstarted");else{for(;!layoutEnded;)layoutEnded=this.tick();this.graphManager.updateBounds()}},CoSELayout.prototype.moveNodes=function(){for(var lNodes=this.getAllNodes(),i=0;i<lNodes.length;i++)lNodes[i].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),i=0;i<lNodes.length;i++)lNodes[i].move()},CoSELayout.prototype.initConstraintVariables=function(){var self=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var allNodes=this.graphManager.getAllNodes(),i=0;i<allNodes.length;i++){var node=allNodes[i];this.idToNodeMap.set(node.id,node)}var calculateCompoundWeight=function calculateCompoundWeight2(compoundNode){for(var node2,nodes=compoundNode.getChild().getNodes(),fixedNodeWeight2=0,i2=0;i2<nodes.length;i2++)null==(node2=nodes[i2]).getChild()?self.fixedNodeSet.has(node2.id)&&(fixedNodeWeight2+=100):fixedNodeWeight2+=calculateCompoundWeight2(node2);return fixedNodeWeight2};if(this.constraints.fixedNodeConstraint)for(this.constraints.fixedNodeConstraint.forEach(function(nodeData2){self.fixedNodeSet.add(nodeData2.nodeId)}),allNodes=this.graphManager.getAllNodes(),i=0;i<allNodes.length;i++)if(null!=(node=allNodes[i]).getChild()){var fixedNodeWeight=calculateCompoundWeight(node);fixedNodeWeight>0&&(node.fixedNodeWeight=fixedNodeWeight)}if(this.constraints.relativePlacementConstraint){var nodeToDummyForVerticalAlignment=new Map,nodeToDummyForHorizontalAlignment=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(nodeId){self.fixedNodesOnHorizontal.add(nodeId),self.fixedNodesOnVertical.add(nodeId)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var verticalAlignment=this.constraints.alignmentConstraint.vertical;for(i=0;i<verticalAlignment.length;i++)this.dummyToNodeForVerticalAlignment.set("dummy"+i,[]),verticalAlignment[i].forEach(function(nodeId){nodeToDummyForVerticalAlignment.set(nodeId,"dummy"+i),self.dummyToNodeForVerticalAlignment.get("dummy"+i).push(nodeId),self.fixedNodeSet.has(nodeId)&&self.fixedNodesOnHorizontal.add("dummy"+i)})}if(this.constraints.alignmentConstraint.horizontal){var horizontalAlignment=this.constraints.alignmentConstraint.horizontal;for(i=0;i<horizontalAlignment.length;i++)this.dummyToNodeForHorizontalAlignment.set("dummy"+i,[]),horizontalAlignment[i].forEach(function(nodeId){nodeToDummyForHorizontalAlignment.set(nodeId,"dummy"+i),self.dummyToNodeForHorizontalAlignment.get("dummy"+i).push(nodeId),self.fixedNodeSet.has(nodeId)&&self.fixedNodesOnVertical.add("dummy"+i)})}}if(CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(array){var j,x,i2;for(i2=array.length-1;i2>=2*array.length/3;i2--)j=Math.floor(Math.random()*(i2+1)),x=array[i2],array[i2]=array[j],array[j]=x;return array},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(constraint){if(constraint.left){var nodeIdLeft=nodeToDummyForVerticalAlignment.has(constraint.left)?nodeToDummyForVerticalAlignment.get(constraint.left):constraint.left,nodeIdRight=nodeToDummyForVerticalAlignment.has(constraint.right)?nodeToDummyForVerticalAlignment.get(constraint.right):constraint.right;self.nodesInRelativeHorizontal.includes(nodeIdLeft)||(self.nodesInRelativeHorizontal.push(nodeIdLeft),self.nodeToRelativeConstraintMapHorizontal.set(nodeIdLeft,[]),self.dummyToNodeForVerticalAlignment.has(nodeIdLeft)?self.nodeToTempPositionMapHorizontal.set(nodeIdLeft,self.idToNodeMap.get(self.dummyToNodeForVerticalAlignment.get(nodeIdLeft)[0]).getCenterX()):self.nodeToTempPositionMapHorizontal.set(nodeIdLeft,self.idToNodeMap.get(nodeIdLeft).getCenterX())),self.nodesInRelativeHorizontal.includes(nodeIdRight)||(self.nodesInRelativeHorizontal.push(nodeIdRight),self.nodeToRelativeConstraintMapHorizontal.set(nodeIdRight,[]),self.dummyToNodeForVerticalAlignment.has(nodeIdRight)?self.nodeToTempPositionMapHorizontal.set(nodeIdRight,self.idToNodeMap.get(self.dummyToNodeForVerticalAlignment.get(nodeIdRight)[0]).getCenterX()):self.nodeToTempPositionMapHorizontal.set(nodeIdRight,self.idToNodeMap.get(nodeIdRight).getCenterX())),self.nodeToRelativeConstraintMapHorizontal.get(nodeIdLeft).push({right:nodeIdRight,gap:constraint.gap}),self.nodeToRelativeConstraintMapHorizontal.get(nodeIdRight).push({left:nodeIdLeft,gap:constraint.gap})}else{var nodeIdTop=nodeToDummyForHorizontalAlignment.has(constraint.top)?nodeToDummyForHorizontalAlignment.get(constraint.top):constraint.top,nodeIdBottom=nodeToDummyForHorizontalAlignment.has(constraint.bottom)?nodeToDummyForHorizontalAlignment.get(constraint.bottom):constraint.bottom;self.nodesInRelativeVertical.includes(nodeIdTop)||(self.nodesInRelativeVertical.push(nodeIdTop),self.nodeToRelativeConstraintMapVertical.set(nodeIdTop,[]),self.dummyToNodeForHorizontalAlignment.has(nodeIdTop)?self.nodeToTempPositionMapVertical.set(nodeIdTop,self.idToNodeMap.get(self.dummyToNodeForHorizontalAlignment.get(nodeIdTop)[0]).getCenterY()):self.nodeToTempPositionMapVertical.set(nodeIdTop,self.idToNodeMap.get(nodeIdTop).getCenterY())),self.nodesInRelativeVertical.includes(nodeIdBottom)||(self.nodesInRelativeVertical.push(nodeIdBottom),self.nodeToRelativeConstraintMapVertical.set(nodeIdBottom,[]),self.dummyToNodeForHorizontalAlignment.has(nodeIdBottom)?self.nodeToTempPositionMapVertical.set(nodeIdBottom,self.idToNodeMap.get(self.dummyToNodeForHorizontalAlignment.get(nodeIdBottom)[0]).getCenterY()):self.nodeToTempPositionMapVertical.set(nodeIdBottom,self.idToNodeMap.get(nodeIdBottom).getCenterY())),self.nodeToRelativeConstraintMapVertical.get(nodeIdTop).push({bottom:nodeIdBottom,gap:constraint.gap}),self.nodeToRelativeConstraintMapVertical.get(nodeIdBottom).push({top:nodeIdTop,gap:constraint.gap})}});else{var subGraphOnHorizontal=new Map,subGraphOnVertical=new Map;this.constraints.relativePlacementConstraint.forEach(function(constraint){if(constraint.left){var left=nodeToDummyForVerticalAlignment.has(constraint.left)?nodeToDummyForVerticalAlignment.get(constraint.left):constraint.left,right=nodeToDummyForVerticalAlignment.has(constraint.right)?nodeToDummyForVerticalAlignment.get(constraint.right):constraint.right;subGraphOnHorizontal.has(left)?subGraphOnHorizontal.get(left).push(right):subGraphOnHorizontal.set(left,[right]),subGraphOnHorizontal.has(right)?subGraphOnHorizontal.get(right).push(left):subGraphOnHorizontal.set(right,[left])}else{var top=nodeToDummyForHorizontalAlignment.has(constraint.top)?nodeToDummyForHorizontalAlignment.get(constraint.top):constraint.top,bottom=nodeToDummyForHorizontalAlignment.has(constraint.bottom)?nodeToDummyForHorizontalAlignment.get(constraint.bottom):constraint.bottom;subGraphOnVertical.has(top)?subGraphOnVertical.get(top).push(bottom):subGraphOnVertical.set(top,[bottom]),subGraphOnVertical.has(bottom)?subGraphOnVertical.get(bottom).push(top):subGraphOnVertical.set(bottom,[top])}});var constructComponents=function(graph,fixedNodes){var components=[],isFixed=[],queue=new LinkedList,visited=new Set,count=0;return graph.forEach(function(value,key){if(!visited.has(key)){components[count]=[],isFixed[count]=!1;var currentNode=key;for(queue.push(currentNode),visited.add(currentNode),components[count].push(currentNode);0!=queue.length;)currentNode=queue.shift(),fixedNodes.has(currentNode)&&(isFixed[count]=!0),graph.get(currentNode).forEach(function(neighbor){visited.has(neighbor)||(queue.push(neighbor),visited.add(neighbor),components[count].push(neighbor))});count++}}),{components:components,isFixed:isFixed}},resultOnHorizontal=constructComponents(subGraphOnHorizontal,self.fixedNodesOnHorizontal);this.componentsOnHorizontal=resultOnHorizontal.components,this.fixedComponentsOnHorizontal=resultOnHorizontal.isFixed;var resultOnVertical=constructComponents(subGraphOnVertical,self.fixedNodesOnVertical);this.componentsOnVertical=resultOnVertical.components,this.fixedComponentsOnVertical=resultOnVertical.isFixed}}},CoSELayout.prototype.updateDisplacements=function(){var self=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(nodeData2){var fixedNode=self.idToNodeMap.get(nodeData2.nodeId);fixedNode.displacementX=0,fixedNode.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var allVerticalAlignments=this.constraints.alignmentConstraint.vertical,i=0;i<allVerticalAlignments.length;i++){for(var totalDisplacementX=0,j=0;j<allVerticalAlignments[i].length;j++){if(this.fixedNodeSet.has(allVerticalAlignments[i][j])){totalDisplacementX=0;break}totalDisplacementX+=this.idToNodeMap.get(allVerticalAlignments[i][j]).displacementX}var averageDisplacementX=totalDisplacementX/allVerticalAlignments[i].length;for(j=0;j<allVerticalAlignments[i].length;j++)this.idToNodeMap.get(allVerticalAlignments[i][j]).displacementX=averageDisplacementX}if(this.constraints.alignmentConstraint.horizontal){var allHorizontalAlignments=this.constraints.alignmentConstraint.horizontal;for(i=0;i<allHorizontalAlignments.length;i++){var totalDisplacementY=0;for(j=0;j<allHorizontalAlignments[i].length;j++){if(this.fixedNodeSet.has(allHorizontalAlignments[i][j])){totalDisplacementY=0;break}totalDisplacementY+=this.idToNodeMap.get(allHorizontalAlignments[i][j]).displacementY}var averageDisplacementY=totalDisplacementY/allHorizontalAlignments[i].length;for(j=0;j<allHorizontalAlignments[i].length;j++)this.idToNodeMap.get(allHorizontalAlignments[i][j]).displacementY=averageDisplacementY}}}if(this.constraints.relativePlacementConstraint)if(CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(nodeId){if(!self.fixedNodesOnHorizontal.has(nodeId)){var displacement=0;displacement=self.dummyToNodeForVerticalAlignment.has(nodeId)?self.idToNodeMap.get(self.dummyToNodeForVerticalAlignment.get(nodeId)[0]).displacementX:self.idToNodeMap.get(nodeId).displacementX,self.nodeToRelativeConstraintMapHorizontal.get(nodeId).forEach(function(constraint){var diff;constraint.right?(diff=self.nodeToTempPositionMapHorizontal.get(constraint.right)-self.nodeToTempPositionMapHorizontal.get(nodeId)-displacement)<constraint.gap&&(displacement-=constraint.gap-diff):(diff=self.nodeToTempPositionMapHorizontal.get(nodeId)-self.nodeToTempPositionMapHorizontal.get(constraint.left)+displacement)<constraint.gap&&(displacement+=constraint.gap-diff)}),self.nodeToTempPositionMapHorizontal.set(nodeId,self.nodeToTempPositionMapHorizontal.get(nodeId)+displacement),self.dummyToNodeForVerticalAlignment.has(nodeId)?self.dummyToNodeForVerticalAlignment.get(nodeId).forEach(function(nodeId2){self.idToNodeMap.get(nodeId2).displacementX=displacement}):self.idToNodeMap.get(nodeId).displacementX=displacement}}),this.nodesInRelativeVertical.forEach(function(nodeId){if(!self.fixedNodesOnHorizontal.has(nodeId)){var displacement=0;displacement=self.dummyToNodeForHorizontalAlignment.has(nodeId)?self.idToNodeMap.get(self.dummyToNodeForHorizontalAlignment.get(nodeId)[0]).displacementY:self.idToNodeMap.get(nodeId).displacementY,self.nodeToRelativeConstraintMapVertical.get(nodeId).forEach(function(constraint){var diff;constraint.bottom?(diff=self.nodeToTempPositionMapVertical.get(constraint.bottom)-self.nodeToTempPositionMapVertical.get(nodeId)-displacement)<constraint.gap&&(displacement-=constraint.gap-diff):(diff=self.nodeToTempPositionMapVertical.get(nodeId)-self.nodeToTempPositionMapVertical.get(constraint.top)+displacement)<constraint.gap&&(displacement+=constraint.gap-diff)}),self.nodeToTempPositionMapVertical.set(nodeId,self.nodeToTempPositionMapVertical.get(nodeId)+displacement),self.dummyToNodeForHorizontalAlignment.has(nodeId)?self.dummyToNodeForHorizontalAlignment.get(nodeId).forEach(function(nodeId2){self.idToNodeMap.get(nodeId2).displacementY=displacement}):self.idToNodeMap.get(nodeId).displacementY=displacement}});else{for(i=0;i<this.componentsOnHorizontal.length;i++){var component=this.componentsOnHorizontal[i];if(this.fixedComponentsOnHorizontal[i])for(j=0;j<component.length;j++)this.dummyToNodeForVerticalAlignment.has(component[j])?this.dummyToNodeForVerticalAlignment.get(component[j]).forEach(function(nodeId){self.idToNodeMap.get(nodeId).displacementX=0}):this.idToNodeMap.get(component[j]).displacementX=0;else{var sum=0,count=0;for(j=0;j<component.length;j++)this.dummyToNodeForVerticalAlignment.has(component[j])?(sum+=(actualNodes=this.dummyToNodeForVerticalAlignment.get(component[j])).length*this.idToNodeMap.get(actualNodes[0]).displacementX,count+=actualNodes.length):(sum+=this.idToNodeMap.get(component[j]).displacementX,count++);var averageDisplacement=sum/count;for(j=0;j<component.length;j++)this.dummyToNodeForVerticalAlignment.has(component[j])?this.dummyToNodeForVerticalAlignment.get(component[j]).forEach(function(nodeId){self.idToNodeMap.get(nodeId).displacementX=averageDisplacement}):this.idToNodeMap.get(component[j]).displacementX=averageDisplacement}}for(i=0;i<this.componentsOnVertical.length;i++)if(component=this.componentsOnVertical[i],this.fixedComponentsOnVertical[i])for(j=0;j<component.length;j++)this.dummyToNodeForHorizontalAlignment.has(component[j])?this.dummyToNodeForHorizontalAlignment.get(component[j]).forEach(function(nodeId){self.idToNodeMap.get(nodeId).displacementY=0}):this.idToNodeMap.get(component[j]).displacementY=0;else{for(sum=0,count=0,j=0;j<component.length;j++){var actualNodes;this.dummyToNodeForHorizontalAlignment.has(component[j])?(sum+=(actualNodes=this.dummyToNodeForHorizontalAlignment.get(component[j])).length*this.idToNodeMap.get(actualNodes[0]).displacementY,count+=actualNodes.length):(sum+=this.idToNodeMap.get(component[j]).displacementY,count++)}for(averageDisplacement=sum/count,j=0;j<component.length;j++)this.dummyToNodeForHorizontalAlignment.has(component[j])?this.dummyToNodeForHorizontalAlignment.get(component[j]).forEach(function(nodeId){self.idToNodeMap.get(nodeId).displacementY=averageDisplacement}):this.idToNodeMap.get(component[j]).displacementY=averageDisplacement}}},CoSELayout.prototype.calculateNodesToApplyGravitationTo=function(){var graph,i,nodeList=[],graphs=this.graphManager.getGraphs(),size=graphs.length;for(i=0;i<size;i++)(graph=graphs[i]).updateConnected(),graph.isConnected||(nodeList=nodeList.concat(graph.getNodes()));return nodeList},CoSELayout.prototype.createBendpoints=function(){var edges=[];edges=edges.concat(this.graphManager.getAllEdges());var i,visited=new Set;for(i=0;i<edges.length;i++){var edge=edges[i];if(!visited.has(edge)){var source=edge.getSource(),target=edge.getTarget();if(source==target)edge.getBendpoints().push(new PointD),edge.getBendpoints().push(new PointD),this.createDummyNodesForBendpoints(edge),visited.add(edge);else{var edgeList=[];if(edgeList=(edgeList=edgeList.concat(source.getEdgeListToNode(target))).concat(target.getEdgeListToNode(source)),!visited.has(edgeList[0])){var k;if(edgeList.length>1)for(k=0;k<edgeList.length;k++){var multiEdge=edgeList[k];multiEdge.getBendpoints().push(new PointD),this.createDummyNodesForBendpoints(multiEdge)}edgeList.forEach(function(edge2){visited.add(edge2)})}}}if(visited.size==edges.length)break}},CoSELayout.prototype.positionNodesRadially=function(forest){for(var currentStartingPoint=new Point2(0,0),numberOfColumns=Math.ceil(Math.sqrt(forest.length)),height=0,currentY=0,currentX=0,point=new PointD(0,0),i=0;i<forest.length;i++){i%numberOfColumns==0&&(currentX=0,currentY=height,0!=i&&(currentY+=CoSEConstants.DEFAULT_COMPONENT_SEPERATION),height=0);var tree=forest[i],centerNode=Layout2.findCenterOfTree(tree);currentStartingPoint.x=currentX,currentStartingPoint.y=currentY,(point=CoSELayout.radialLayout(tree,centerNode,currentStartingPoint)).y>height&&(height=Math.floor(point.y)),currentX=Math.floor(point.x+CoSEConstants.DEFAULT_COMPONENT_SEPERATION)}this.transform(new PointD(LayoutConstants.WORLD_CENTER_X-point.x/2,LayoutConstants.WORLD_CENTER_Y-point.y/2))},CoSELayout.radialLayout=function(tree,centerNode,startingPoint){var radialSep=Math.max(this.maxDiagonalInTree(tree),CoSEConstants.DEFAULT_RADIAL_SEPARATION);CoSELayout.branchRadialLayout(centerNode,null,0,359,0,radialSep);var bounds=LGraph.calculateBounds(tree),transform=new Transform;transform.setDeviceOrgX(bounds.getMinX()),transform.setDeviceOrgY(bounds.getMinY()),transform.setWorldOrgX(startingPoint.x),transform.setWorldOrgY(startingPoint.y);for(var i=0;i<tree.length;i++)tree[i].transform(transform);var bottomRight=new PointD(bounds.getMaxX(),bounds.getMaxY());return transform.inverseTransformPoint(bottomRight)},CoSELayout.branchRadialLayout=function(node,parentOfNode,startAngle,endAngle,distance,radialSeparation){var halfInterval=(endAngle-startAngle+1)/2;halfInterval<0&&(halfInterval+=180);var teta=(halfInterval+startAngle)%360*IGeometry.TWO_PI/360,x_=distance*Math.cos(teta),y_=distance*Math.sin(teta);node.setCenter(x_,y_);var neighborEdges=[],childCount=(neighborEdges=neighborEdges.concat(node.getEdges())).length;null!=parentOfNode&&childCount--;for(var startIndex,branchCount=0,incEdgesCount=neighborEdges.length,edges=node.getEdgesBetween(parentOfNode);edges.length>1;){var temp=edges[0];edges.splice(0,1);var index=neighborEdges.indexOf(temp);index>=0&&neighborEdges.splice(index,1),incEdgesCount--,childCount--}startIndex=null!=parentOfNode?(neighborEdges.indexOf(edges[0])+1)%incEdgesCount:0;for(var stepAngle=Math.abs(endAngle-startAngle)/childCount,i=startIndex;branchCount!=childCount;i=++i%incEdgesCount){var currentNeighbor=neighborEdges[i].getOtherEnd(node);if(currentNeighbor!=parentOfNode){var childStartAngle=(startAngle+branchCount*stepAngle)%360,childEndAngle=(childStartAngle+stepAngle)%360;CoSELayout.branchRadialLayout(currentNeighbor,node,childStartAngle,childEndAngle,distance+radialSeparation,radialSeparation),branchCount++}}},CoSELayout.maxDiagonalInTree=function(tree){for(var maxDiagonal=Integer.MIN_VALUE,i=0;i<tree.length;i++){var diagonal=tree[i].getDiagonal();diagonal>maxDiagonal&&(maxDiagonal=diagonal)}return maxDiagonal},CoSELayout.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},CoSELayout.prototype.groupZeroDegreeMembers=function(){var self=this,tempMemberGroups={};this.memberGroups={},this.idToDummyNode={};for(var zeroDegree=[],allNodes=this.graphManager.getAllNodes(),i=0;i<allNodes.length;i++){var parent=(node=allNodes[i]).getParent();0!==this.getNodeDegreeWithChildren(node)||null!=parent.id&&this.getToBeTiled(parent)||zeroDegree.push(node)}for(i=0;i<zeroDegree.length;i++){var node,p_id=(node=zeroDegree[i]).getParent().id;void 0===tempMemberGroups[p_id]&&(tempMemberGroups[p_id]=[]),tempMemberGroups[p_id]=tempMemberGroups[p_id].concat(node)}Object.keys(tempMemberGroups).forEach(function(p_id2){if(tempMemberGroups[p_id2].length>1){var dummyCompoundId="DummyCompound_"+p_id2;self.memberGroups[dummyCompoundId]=tempMemberGroups[p_id2];var parent2=tempMemberGroups[p_id2][0].getParent(),dummyCompound=new CoSENode(self.graphManager);dummyCompound.id=dummyCompoundId,dummyCompound.paddingLeft=parent2.paddingLeft||0,dummyCompound.paddingRight=parent2.paddingRight||0,dummyCompound.paddingBottom=parent2.paddingBottom||0,dummyCompound.paddingTop=parent2.paddingTop||0,self.idToDummyNode[dummyCompoundId]=dummyCompound;var dummyParentGraph=self.getGraphManager().add(self.newGraph(),dummyCompound),parentGraph=parent2.getChild();parentGraph.add(dummyCompound);for(var i2=0;i2<tempMemberGroups[p_id2].length;i2++){var node2=tempMemberGroups[p_id2][i2];parentGraph.remove(node2),dummyParentGraph.add(node2)}}})},CoSELayout.prototype.clearCompounds=function(){var childGraphMap={},idToNode={};this.performDFSOnCompounds();for(var i=0;i<this.compoundOrder.length;i++)idToNode[this.compoundOrder[i].id]=this.compoundOrder[i],childGraphMap[this.compoundOrder[i].id]=[].concat(this.compoundOrder[i].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[i].getChild()),this.compoundOrder[i].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(childGraphMap,idToNode)},CoSELayout.prototype.clearZeroDegreeMembers=function(){var self=this,tiledZeroDegreePack=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(id){var compoundNode=self.idToDummyNode[id];if(tiledZeroDegreePack[id]=self.tileNodes(self.memberGroups[id],compoundNode.paddingLeft+compoundNode.paddingRight),compoundNode.rect.width=tiledZeroDegreePack[id].width,compoundNode.rect.height=tiledZeroDegreePack[id].height,compoundNode.setCenter(tiledZeroDegreePack[id].centerX,tiledZeroDegreePack[id].centerY),compoundNode.labelMarginLeft=0,compoundNode.labelMarginTop=0,CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS){var width=compoundNode.rect.width,height=compoundNode.rect.height;compoundNode.labelWidth&&("left"==compoundNode.labelPosHorizontal?(compoundNode.rect.x-=compoundNode.labelWidth,compoundNode.setWidth(width+compoundNode.labelWidth),compoundNode.labelMarginLeft=compoundNode.labelWidth):"center"==compoundNode.labelPosHorizontal&&compoundNode.labelWidth>width?(compoundNode.rect.x-=(compoundNode.labelWidth-width)/2,compoundNode.setWidth(compoundNode.labelWidth),compoundNode.labelMarginLeft=(compoundNode.labelWidth-width)/2):"right"==compoundNode.labelPosHorizontal&&compoundNode.setWidth(width+compoundNode.labelWidth)),compoundNode.labelHeight&&("top"==compoundNode.labelPosVertical?(compoundNode.rect.y-=compoundNode.labelHeight,compoundNode.setHeight(height+compoundNode.labelHeight),compoundNode.labelMarginTop=compoundNode.labelHeight):"center"==compoundNode.labelPosVertical&&compoundNode.labelHeight>height?(compoundNode.rect.y-=(compoundNode.labelHeight-height)/2,compoundNode.setHeight(compoundNode.labelHeight),compoundNode.labelMarginTop=(compoundNode.labelHeight-height)/2):"bottom"==compoundNode.labelPosVertical&&compoundNode.setHeight(height+compoundNode.labelHeight))}})},CoSELayout.prototype.repopulateCompounds=function(){for(var i=this.compoundOrder.length-1;i>=0;i--){var lCompoundNode=this.compoundOrder[i],id=lCompoundNode.id,horizontalMargin=lCompoundNode.paddingLeft,verticalMargin=lCompoundNode.paddingTop,labelMarginLeft=lCompoundNode.labelMarginLeft,labelMarginTop=lCompoundNode.labelMarginTop;this.adjustLocations(this.tiledMemberPack[id],lCompoundNode.rect.x,lCompoundNode.rect.y,horizontalMargin,verticalMargin,labelMarginLeft,labelMarginTop)}},CoSELayout.prototype.repopulateZeroDegreeMembers=function(){var self=this,tiledPack=this.tiledZeroDegreePack;Object.keys(tiledPack).forEach(function(id){var compoundNode=self.idToDummyNode[id],horizontalMargin=compoundNode.paddingLeft,verticalMargin=compoundNode.paddingTop,labelMarginLeft=compoundNode.labelMarginLeft,labelMarginTop=compoundNode.labelMarginTop;self.adjustLocations(tiledPack[id],compoundNode.rect.x,compoundNode.rect.y,horizontalMargin,verticalMargin,labelMarginLeft,labelMarginTop)})},CoSELayout.prototype.getToBeTiled=function(node){var id=node.id;if(null!=this.toBeTiled[id])return this.toBeTiled[id];var childGraph=node.getChild();if(null==childGraph)return this.toBeTiled[id]=!1,!1;for(var children=childGraph.getNodes(),i=0;i<children.length;i++){var theChild=children[i];if(this.getNodeDegree(theChild)>0)return this.toBeTiled[id]=!1,!1;if(null!=theChild.getChild()){if(!this.getToBeTiled(theChild))return this.toBeTiled[id]=!1,!1}else this.toBeTiled[theChild.id]=!1}return this.toBeTiled[id]=!0,!0},CoSELayout.prototype.getNodeDegree=function(node){node.id;for(var edges=node.getEdges(),degree=0,i=0;i<edges.length;i++){var edge=edges[i];edge.getSource().id!==edge.getTarget().id&&(degree+=1)}return degree},CoSELayout.prototype.getNodeDegreeWithChildren=function(node){var degree=this.getNodeDegree(node);if(null==node.getChild())return degree;for(var children=node.getChild().getNodes(),i=0;i<children.length;i++){var child=children[i];degree+=this.getNodeDegreeWithChildren(child)}return degree},CoSELayout.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},CoSELayout.prototype.fillCompexOrderByDFS=function(children){for(var i=0;i<children.length;i++){var child=children[i];null!=child.getChild()&&this.fillCompexOrderByDFS(child.getChild().getNodes()),this.getToBeTiled(child)&&this.compoundOrder.push(child)}},CoSELayout.prototype.adjustLocations=function(organization,x,y,compoundHorizontalMargin,compoundVerticalMargin,compoundLabelMarginLeft,compoundLabelMarginTop){y+=compoundVerticalMargin+compoundLabelMarginTop;for(var left=x+=compoundHorizontalMargin+compoundLabelMarginLeft,i=0;i<organization.rows.length;i++){var row=organization.rows[i];x=left;for(var maxHeight=0,j=0;j<row.length;j++){var lnode=row[j];lnode.rect.x=x,lnode.rect.y=y,x+=lnode.rect.width+organization.horizontalPadding,lnode.rect.height>maxHeight&&(maxHeight=lnode.rect.height)}y+=maxHeight+organization.verticalPadding}},CoSELayout.prototype.tileCompoundMembers=function(childGraphMap,idToNode){var self=this;this.tiledMemberPack=[],Object.keys(childGraphMap).forEach(function(id){var compoundNode=idToNode[id];if(self.tiledMemberPack[id]=self.tileNodes(childGraphMap[id],compoundNode.paddingLeft+compoundNode.paddingRight),compoundNode.rect.width=self.tiledMemberPack[id].width,compoundNode.rect.height=self.tiledMemberPack[id].height,compoundNode.setCenter(self.tiledMemberPack[id].centerX,self.tiledMemberPack[id].centerY),compoundNode.labelMarginLeft=0,compoundNode.labelMarginTop=0,CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS){var width=compoundNode.rect.width,height=compoundNode.rect.height;compoundNode.labelWidth&&("left"==compoundNode.labelPosHorizontal?(compoundNode.rect.x-=compoundNode.labelWidth,compoundNode.setWidth(width+compoundNode.labelWidth),compoundNode.labelMarginLeft=compoundNode.labelWidth):"center"==compoundNode.labelPosHorizontal&&compoundNode.labelWidth>width?(compoundNode.rect.x-=(compoundNode.labelWidth-width)/2,compoundNode.setWidth(compoundNode.labelWidth),compoundNode.labelMarginLeft=(compoundNode.labelWidth-width)/2):"right"==compoundNode.labelPosHorizontal&&compoundNode.setWidth(width+compoundNode.labelWidth)),compoundNode.labelHeight&&("top"==compoundNode.labelPosVertical?(compoundNode.rect.y-=compoundNode.labelHeight,compoundNode.setHeight(height+compoundNode.labelHeight),compoundNode.labelMarginTop=compoundNode.labelHeight):"center"==compoundNode.labelPosVertical&&compoundNode.labelHeight>height?(compoundNode.rect.y-=(compoundNode.labelHeight-height)/2,compoundNode.setHeight(compoundNode.labelHeight),compoundNode.labelMarginTop=(compoundNode.labelHeight-height)/2):"bottom"==compoundNode.labelPosVertical&&compoundNode.setHeight(height+compoundNode.labelHeight))}})},CoSELayout.prototype.tileNodes=function(nodes,minWidth){var horizontalOrg=this.tileNodesByFavoringDim(nodes,minWidth,!0),verticalOrg=this.tileNodesByFavoringDim(nodes,minWidth,!1),horizontalRatio=this.getOrgRatio(horizontalOrg);return this.getOrgRatio(verticalOrg)<horizontalRatio?verticalOrg:horizontalOrg},CoSELayout.prototype.getOrgRatio=function(organization){var ratio=organization.width/organization.height;return ratio<1&&(ratio=1/ratio),ratio},CoSELayout.prototype.calcIdealRowWidth=function(members,favorHorizontalDim){var verticalPadding=CoSEConstants.TILING_PADDING_VERTICAL,horizontalPadding=CoSEConstants.TILING_PADDING_HORIZONTAL,membersSize=members.length,totalWidth=0,totalHeight=0,maxWidth=0;members.forEach(function(node){totalWidth+=node.getWidth(),totalHeight+=node.getHeight(),node.getWidth()>maxWidth&&(maxWidth=node.getWidth())});var horizontalCount,averageWidth=totalWidth/membersSize,averageHeight=totalHeight/membersSize,delta=Math.pow(verticalPadding-horizontalPadding,2)+4*(averageWidth+horizontalPadding)*(averageHeight+verticalPadding)*membersSize,horizontalCountDouble=(horizontalPadding-verticalPadding+Math.sqrt(delta))/(2*(averageWidth+horizontalPadding));favorHorizontalDim?(horizontalCount=Math.ceil(horizontalCountDouble))==horizontalCountDouble&&horizontalCount++:horizontalCount=Math.floor(horizontalCountDouble);var idealWidth=horizontalCount*(averageWidth+horizontalPadding)-horizontalPadding;return maxWidth>idealWidth&&(idealWidth=maxWidth),idealWidth+=2*horizontalPadding},CoSELayout.prototype.tileNodesByFavoringDim=function(nodes,minWidth,favorHorizontalDim){var verticalPadding=CoSEConstants.TILING_PADDING_VERTICAL,horizontalPadding=CoSEConstants.TILING_PADDING_HORIZONTAL,tilingCompareBy=CoSEConstants.TILING_COMPARE_BY,organization={rows:[],rowWidth:[],rowHeight:[],width:0,height:minWidth,verticalPadding:verticalPadding,horizontalPadding:horizontalPadding,centerX:0,centerY:0};tilingCompareBy&&(organization.idealRowWidth=this.calcIdealRowWidth(nodes,favorHorizontalDim));var getNodeArea=function(n){return n.rect.width*n.rect.height},areaCompareFcn=function(n1,n2){return getNodeArea(n2)-getNodeArea(n1)};nodes.sort(function(n1,n2){var cmpBy=areaCompareFcn;return organization.idealRowWidth?(cmpBy=tilingCompareBy)(n1.id,n2.id):cmpBy(n1,n2)});for(var sumCenterX=0,sumCenterY=0,i=0;i<nodes.length;i++)sumCenterX+=(lNode=nodes[i]).getCenterX(),sumCenterY+=lNode.getCenterY();for(organization.centerX=sumCenterX/nodes.length,organization.centerY=sumCenterY/nodes.length,i=0;i<nodes.length;i++){var lNode=nodes[i];if(0==organization.rows.length)this.insertNodeToRow(organization,lNode,0,minWidth);else if(this.canAddHorizontal(organization,lNode.rect.width,lNode.rect.height)){var rowIndex=organization.rows.length-1;organization.idealRowWidth||(rowIndex=this.getShortestRowIndex(organization)),this.insertNodeToRow(organization,lNode,rowIndex,minWidth)}else this.insertNodeToRow(organization,lNode,organization.rows.length,minWidth);this.shiftToLastRow(organization)}return organization},CoSELayout.prototype.insertNodeToRow=function(organization,node,rowIndex,minWidth){var minCompoundSize=minWidth;rowIndex==organization.rows.length&&(organization.rows.push([]),organization.rowWidth.push(minCompoundSize),organization.rowHeight.push(0));var w=organization.rowWidth[rowIndex]+node.rect.width;organization.rows[rowIndex].length>0&&(w+=organization.horizontalPadding),organization.rowWidth[rowIndex]=w,organization.width<w&&(organization.width=w);var h=node.rect.height;rowIndex>0&&(h+=organization.verticalPadding);var extraHeight=0;h>organization.rowHeight[rowIndex]&&(extraHeight=organization.rowHeight[rowIndex],organization.rowHeight[rowIndex]=h,extraHeight=organization.rowHeight[rowIndex]-extraHeight),organization.height+=extraHeight,organization.rows[rowIndex].push(node)},CoSELayout.prototype.getShortestRowIndex=function(organization){for(var r=-1,min=Number.MAX_VALUE,i=0;i<organization.rows.length;i++)organization.rowWidth[i]<min&&(r=i,min=organization.rowWidth[i]);return r},CoSELayout.prototype.getLongestRowIndex=function(organization){for(var r=-1,max=Number.MIN_VALUE,i=0;i<organization.rows.length;i++)organization.rowWidth[i]>max&&(r=i,max=organization.rowWidth[i]);return r},CoSELayout.prototype.canAddHorizontal=function(organization,extraWidth,extraHeight){if(organization.idealRowWidth){var lastRowIndex=organization.rows.length-1;return organization.rowWidth[lastRowIndex]+extraWidth+organization.horizontalPadding<=organization.idealRowWidth}var sri=this.getShortestRowIndex(organization);if(sri<0)return!0;var min=organization.rowWidth[sri];if(min+organization.horizontalPadding+extraWidth<=organization.width)return!0;var add_to_row_ratio,add_new_row_ratio,hDiff=0;return organization.rowHeight[sri]<extraHeight&&sri>0&&(hDiff=extraHeight+organization.verticalPadding-organization.rowHeight[sri]),add_to_row_ratio=organization.width-min>=extraWidth+organization.horizontalPadding?(organization.height+hDiff)/(min+extraWidth+organization.horizontalPadding):(organization.height+hDiff)/organization.width,hDiff=extraHeight+organization.verticalPadding,(add_new_row_ratio=organization.width<extraWidth?(organization.height+hDiff)/extraWidth:(organization.height+hDiff)/organization.width)<1&&(add_new_row_ratio=1/add_new_row_ratio),add_to_row_ratio<1&&(add_to_row_ratio=1/add_to_row_ratio),add_to_row_ratio<add_new_row_ratio},CoSELayout.prototype.shiftToLastRow=function(organization){var longest=this.getLongestRowIndex(organization),last=organization.rowWidth.length-1,row=organization.rows[longest],node=row[row.length-1],diff=node.width+organization.horizontalPadding;if(organization.width-organization.rowWidth[last]>diff&&longest!=last){row.splice(-1,1),organization.rows[last].push(node),organization.rowWidth[longest]=organization.rowWidth[longest]-diff,organization.rowWidth[last]=organization.rowWidth[last]+diff,organization.width=organization.rowWidth[instance.getLongestRowIndex(organization)];for(var maxHeight=Number.MIN_VALUE,i=0;i<row.length;i++)row[i].height>maxHeight&&(maxHeight=row[i].height);longest>0&&(maxHeight+=organization.verticalPadding);var prevTotal=organization.rowHeight[longest]+organization.rowHeight[last];organization.rowHeight[longest]=maxHeight,organization.rowHeight[last]<node.height+organization.verticalPadding&&(organization.rowHeight[last]=node.height+organization.verticalPadding);var finalTotal=organization.rowHeight[longest]+organization.rowHeight[last];organization.height+=finalTotal-prevTotal,this.shiftToLastRow(organization)}},CoSELayout.prototype.tilingPreLayout=function(){CoSEConstants.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},CoSELayout.prototype.tilingPostLayout=function(){CoSEConstants.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},CoSELayout.prototype.reduceTrees=function(){for(var node,prunedNodesAll=[],containsLeaf=!0;containsLeaf;){var allNodes=this.graphManager.getAllNodes(),prunedNodesInStepTemp=[];containsLeaf=!1;for(var i=0;i<allNodes.length;i++)if(1==(node=allNodes[i]).getEdges().length&&!node.getEdges()[0].isInterGraph&&null==node.getChild()){if(CoSEConstants.PURE_INCREMENTAL){var otherEnd=node.getEdges()[0].getOtherEnd(node),relativePosition=new DimensionD2(node.getCenterX()-otherEnd.getCenterX(),node.getCenterY()-otherEnd.getCenterY());prunedNodesInStepTemp.push([node,node.getEdges()[0],node.getOwner(),relativePosition])}else prunedNodesInStepTemp.push([node,node.getEdges()[0],node.getOwner()]);containsLeaf=!0}if(1==containsLeaf){for(var prunedNodesInStep=[],j=0;j<prunedNodesInStepTemp.length;j++)1==prunedNodesInStepTemp[j][0].getEdges().length&&(prunedNodesInStep.push(prunedNodesInStepTemp[j]),prunedNodesInStepTemp[j][0].getOwner().remove(prunedNodesInStepTemp[j][0]));prunedNodesAll.push(prunedNodesInStep),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=prunedNodesAll},CoSELayout.prototype.growTree=function(prunedNodesAll){for(var nodeData2,prunedNodesInStep=prunedNodesAll[prunedNodesAll.length-1],i=0;i<prunedNodesInStep.length;i++)nodeData2=prunedNodesInStep[i],this.findPlaceforPrunedNode(nodeData2),nodeData2[2].add(nodeData2[0]),nodeData2[2].add(nodeData2[1],nodeData2[1].source,nodeData2[1].target);prunedNodesAll.splice(prunedNodesAll.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},CoSELayout.prototype.findPlaceforPrunedNode=function(nodeData2){var gridForPrunedNode,nodeToConnect,prunedNode=nodeData2[0];if(nodeToConnect=prunedNode==nodeData2[1].source?nodeData2[1].target:nodeData2[1].source,CoSEConstants.PURE_INCREMENTAL)prunedNode.setCenter(nodeToConnect.getCenterX()+nodeData2[3].getWidth(),nodeToConnect.getCenterY()+nodeData2[3].getHeight());else{var startGridX=nodeToConnect.startX,finishGridX=nodeToConnect.finishX,startGridY=nodeToConnect.startY,finishGridY=nodeToConnect.finishY,controlRegions=[0,0,0,0];if(startGridY>0)for(var i=startGridX;i<=finishGridX;i++)controlRegions[0]+=this.grid[i][startGridY-1].length+this.grid[i][startGridY].length-1;if(finishGridX<this.grid.length-1)for(i=startGridY;i<=finishGridY;i++)controlRegions[1]+=this.grid[finishGridX+1][i].length+this.grid[finishGridX][i].length-1;if(finishGridY<this.grid[0].length-1)for(i=startGridX;i<=finishGridX;i++)controlRegions[2]+=this.grid[i][finishGridY+1].length+this.grid[i][finishGridY].length-1;if(startGridX>0)for(i=startGridY;i<=finishGridY;i++)controlRegions[3]+=this.grid[startGridX-1][i].length+this.grid[startGridX][i].length-1;for(var minCount,minIndex,min=Integer.MAX_VALUE,j=0;j<controlRegions.length;j++)controlRegions[j]<min?(min=controlRegions[j],minCount=1,minIndex=j):controlRegions[j]==min&&minCount++;if(3==minCount&&0==min)0==controlRegions[0]&&0==controlRegions[1]&&0==controlRegions[2]?gridForPrunedNode=1:0==controlRegions[0]&&0==controlRegions[1]&&0==controlRegions[3]?gridForPrunedNode=0:0==controlRegions[0]&&0==controlRegions[2]&&0==controlRegions[3]?gridForPrunedNode=3:0==controlRegions[1]&&0==controlRegions[2]&&0==controlRegions[3]&&(gridForPrunedNode=2);else if(2==minCount&&0==min){var random=Math.floor(2*Math.random());gridForPrunedNode=0==controlRegions[0]&&0==controlRegions[1]?0==random?0:1:0==controlRegions[0]&&0==controlRegions[2]?0==random?0:2:0==controlRegions[0]&&0==controlRegions[3]?0==random?0:3:0==controlRegions[1]&&0==controlRegions[2]?0==random?1:2:0==controlRegions[1]&&0==controlRegions[3]?0==random?1:3:0==random?2:3}else gridForPrunedNode=4==minCount&&0==min?random=Math.floor(4*Math.random()):minIndex;0==gridForPrunedNode?prunedNode.setCenter(nodeToConnect.getCenterX(),nodeToConnect.getCenterY()-nodeToConnect.getHeight()/2-FDLayoutConstants.DEFAULT_EDGE_LENGTH-prunedNode.getHeight()/2):1==gridForPrunedNode?prunedNode.setCenter(nodeToConnect.getCenterX()+nodeToConnect.getWidth()/2+FDLayoutConstants.DEFAULT_EDGE_LENGTH+prunedNode.getWidth()/2,nodeToConnect.getCenterY()):2==gridForPrunedNode?prunedNode.setCenter(nodeToConnect.getCenterX(),nodeToConnect.getCenterY()+nodeToConnect.getHeight()/2+FDLayoutConstants.DEFAULT_EDGE_LENGTH+prunedNode.getHeight()/2):prunedNode.setCenter(nodeToConnect.getCenterX()-nodeToConnect.getWidth()/2-FDLayoutConstants.DEFAULT_EDGE_LENGTH-prunedNode.getWidth()/2,nodeToConnect.getCenterY())}},module2.exports=CoSELayout},991:(module2,__unused_webpack_exports,__webpack_require__2)=>{var FDLayoutNode=__webpack_require__2(551).FDLayoutNode,IMath=__webpack_require__2(551).IMath;function CoSENode(gm,loc,size,vNode){FDLayoutNode.call(this,gm,loc,size,vNode)}for(var prop in CoSENode.prototype=Object.create(FDLayoutNode.prototype),FDLayoutNode)CoSENode[prop]=FDLayoutNode[prop];CoSENode.prototype.calculateDisplacement=function(){var layout=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=layout.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=layout.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=layout.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=layout.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>layout.coolingFactor*layout.maxNodeDisplacement&&(this.displacementX=layout.coolingFactor*layout.maxNodeDisplacement*IMath.sign(this.displacementX)),Math.abs(this.displacementY)>layout.coolingFactor*layout.maxNodeDisplacement&&(this.displacementY=layout.coolingFactor*layout.maxNodeDisplacement*IMath.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},CoSENode.prototype.propogateDisplacementToChildren=function(dX,dY){for(var node,nodes=this.getChild().getNodes(),i=0;i<nodes.length;i++)null==(node=nodes[i]).getChild()?(node.displacementX+=dX,node.displacementY+=dY):node.propogateDisplacementToChildren(dX,dY)},CoSENode.prototype.move=function(){var layout=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(this.displacementX,this.displacementY),layout.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},CoSENode.prototype.setPred1=function(pred12){this.pred1=pred12},CoSENode.prototype.getPred1=function(){return pred1},CoSENode.prototype.getPred2=function(){return pred2},CoSENode.prototype.setNext=function(next2){this.next=next2},CoSENode.prototype.getNext=function(){return next},CoSENode.prototype.setProcessed=function(processed2){this.processed=processed2},CoSENode.prototype.isProcessed=function(){return processed},module2.exports=CoSENode},902:(module2,__unused_webpack_exports,__webpack_require__2)=>{function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}var CoSEConstants=__webpack_require__2(806),LinkedList=__webpack_require__2(551).LinkedList,Matrix=__webpack_require__2(551).Matrix,SVD=__webpack_require__2(551).SVD;function ConstraintHandler(){}ConstraintHandler.handleConstraints=function(layout){var constraints={};constraints.fixedNodeConstraint=layout.constraints.fixedNodeConstraint,constraints.alignmentConstraint=layout.constraints.alignmentConstraint,constraints.relativePlacementConstraint=layout.constraints.relativePlacementConstraint;for(var idToNodeMap=new Map,nodeIndexes=new Map,xCoords=[],yCoords=[],allNodes=layout.getAllNodes(),index=0,i=0;i<allNodes.length;i++){var node=allNodes[i];null==node.getChild()&&(nodeIndexes.set(node.id,index++),xCoords.push(node.getCenterX()),yCoords.push(node.getCenterY()),idToNodeMap.set(node.id,node))}constraints.relativePlacementConstraint&&constraints.relativePlacementConstraint.forEach(function(constraint){constraint.gap||0==constraint.gap||(constraint.left?constraint.gap=CoSEConstants.DEFAULT_EDGE_LENGTH+idToNodeMap.get(constraint.left).getWidth()/2+idToNodeMap.get(constraint.right).getWidth()/2:constraint.gap=CoSEConstants.DEFAULT_EDGE_LENGTH+idToNodeMap.get(constraint.top).getHeight()/2+idToNodeMap.get(constraint.bottom).getHeight()/2)});var calculateAvgPosition=function(nodeIdSet){var xPosSum=0,yPosSum=0;return nodeIdSet.forEach(function(nodeId){xPosSum+=xCoords[nodeIndexes.get(nodeId)],yPosSum+=yCoords[nodeIndexes.get(nodeId)]}),{x:xPosSum/nodeIdSet.size,y:yPosSum/nodeIdSet.size}},findAppropriatePositionForRelativePlacement=function(graph,direction,fixedNodes2,dummyPositions,componentSources){var inDegrees=new Map;graph.forEach(function(value,key){inDegrees.set(key,0)}),graph.forEach(function(value,key){value.forEach(function(adjacent){inDegrees.set(adjacent.id,inDegrees.get(adjacent.id)+1)})});var positionMap=new Map,pastMap=new Map,queue=new LinkedList;inDegrees.forEach(function(value,key){0==value?(queue.push(key),fixedNodes2||("horizontal"==direction?positionMap.set(key,nodeIndexes.has(key)?xCoords[nodeIndexes.get(key)]:dummyPositions.get(key)):positionMap.set(key,nodeIndexes.has(key)?yCoords[nodeIndexes.get(key)]:dummyPositions.get(key)))):positionMap.set(key,Number.NEGATIVE_INFINITY),fixedNodes2&&pastMap.set(key,new Set([key]))}),fixedNodes2&&componentSources.forEach(function(component){var fixedIds=[];if(component.forEach(function(nodeId){fixedNodes2.has(nodeId)&&fixedIds.push(nodeId)}),fixedIds.length>0){var position=0;fixedIds.forEach(function(fixedId){"horizontal"==direction?(positionMap.set(fixedId,nodeIndexes.has(fixedId)?xCoords[nodeIndexes.get(fixedId)]:dummyPositions.get(fixedId)),position+=positionMap.get(fixedId)):(positionMap.set(fixedId,nodeIndexes.has(fixedId)?yCoords[nodeIndexes.get(fixedId)]:dummyPositions.get(fixedId)),position+=positionMap.get(fixedId))}),position/=fixedIds.length,component.forEach(function(nodeId){fixedNodes2.has(nodeId)||positionMap.set(nodeId,position)})}else{var _position=0;component.forEach(function(nodeId){_position+="horizontal"==direction?nodeIndexes.has(nodeId)?xCoords[nodeIndexes.get(nodeId)]:dummyPositions.get(nodeId):nodeIndexes.has(nodeId)?yCoords[nodeIndexes.get(nodeId)]:dummyPositions.get(nodeId)}),_position/=component.length,component.forEach(function(nodeId){positionMap.set(nodeId,_position)})}});for(var _loop=function(){var currentNode=queue.shift();graph.get(currentNode).forEach(function(neighbor){if(positionMap.get(neighbor.id)<positionMap.get(currentNode)+neighbor.gap)if(fixedNodes2&&fixedNodes2.has(neighbor.id)){var fixedPosition=void 0;if(fixedPosition="horizontal"==direction?nodeIndexes.has(neighbor.id)?xCoords[nodeIndexes.get(neighbor.id)]:dummyPositions.get(neighbor.id):nodeIndexes.has(neighbor.id)?yCoords[nodeIndexes.get(neighbor.id)]:dummyPositions.get(neighbor.id),positionMap.set(neighbor.id,fixedPosition),fixedPosition<positionMap.get(currentNode)+neighbor.gap){var diff=positionMap.get(currentNode)+neighbor.gap-fixedPosition;pastMap.get(currentNode).forEach(function(nodeId){positionMap.set(nodeId,positionMap.get(nodeId)-diff)})}}else positionMap.set(neighbor.id,positionMap.get(currentNode)+neighbor.gap);inDegrees.set(neighbor.id,inDegrees.get(neighbor.id)-1),0==inDegrees.get(neighbor.id)&&queue.push(neighbor.id),fixedNodes2&&pastMap.set(neighbor.id,function(setA,setB){var union=new Set(setA),_iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=setB[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var elem=_step.value;union.add(elem)}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{!_iteratorNormalCompletion&&_iterator.return&&_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}return union}(pastMap.get(currentNode),pastMap.get(neighbor.id)))})};0!=queue.length;)_loop();if(fixedNodes2){var sinkNodes=new Set;graph.forEach(function(value,key){0==value.length&&sinkNodes.add(key)});var _components=[];pastMap.forEach(function(value,key){if(sinkNodes.has(key)){var isFixedComponent=!1,_iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_iterator2=value[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0){var nodeId=_step2.value;fixedNodes2.has(nodeId)&&(isFixedComponent=!0)}}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{!_iteratorNormalCompletion2&&_iterator2.return&&_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}if(!isFixedComponent){var isExist=!1,existAt=void 0;_components.forEach(function(component,index2){component.has([].concat(_toConsumableArray(value))[0])&&(isExist=!0,existAt=index2)}),isExist?value.forEach(function(ele){_components[existAt].add(ele)}):_components.push(new Set(value))}}}),_components.forEach(function(component,index2){var minBefore=Number.POSITIVE_INFINITY,minAfter=Number.POSITIVE_INFINITY,maxBefore=Number.NEGATIVE_INFINITY,maxAfter=Number.NEGATIVE_INFINITY,_iteratorNormalCompletion3=!0,_didIteratorError3=!1,_iteratorError3=void 0;try{for(var _step3,_iterator3=component[Symbol.iterator]();!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=!0){var nodeId=_step3.value,posBefore=void 0;posBefore="horizontal"==direction?nodeIndexes.has(nodeId)?xCoords[nodeIndexes.get(nodeId)]:dummyPositions.get(nodeId):nodeIndexes.has(nodeId)?yCoords[nodeIndexes.get(nodeId)]:dummyPositions.get(nodeId);var posAfter=positionMap.get(nodeId);posBefore<minBefore&&(minBefore=posBefore),posBefore>maxBefore&&(maxBefore=posBefore),posAfter<minAfter&&(minAfter=posAfter),posAfter>maxAfter&&(maxAfter=posAfter)}}catch(err){_didIteratorError3=!0,_iteratorError3=err}finally{try{!_iteratorNormalCompletion3&&_iterator3.return&&_iterator3.return()}finally{if(_didIteratorError3)throw _iteratorError3}}var diff=(minBefore+maxBefore)/2-(minAfter+maxAfter)/2,_iteratorNormalCompletion4=!0,_didIteratorError4=!1,_iteratorError4=void 0;try{for(var _step4,_iterator4=component[Symbol.iterator]();!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=!0){var _nodeId=_step4.value;positionMap.set(_nodeId,positionMap.get(_nodeId)+diff)}}catch(err){_didIteratorError4=!0,_iteratorError4=err}finally{try{!_iteratorNormalCompletion4&&_iterator4.return&&_iterator4.return()}finally{if(_didIteratorError4)throw _iteratorError4}}})}return positionMap},applyReflectionForRelativePlacement=function(relativePlacementConstraints){var reflectOnY=0,notReflectOnY=0,reflectOnX=0,notReflectOnX=0;if(relativePlacementConstraints.forEach(function(constraint){constraint.left?xCoords[nodeIndexes.get(constraint.left)]-xCoords[nodeIndexes.get(constraint.right)]>=0?reflectOnY++:notReflectOnY++:yCoords[nodeIndexes.get(constraint.top)]-yCoords[nodeIndexes.get(constraint.bottom)]>=0?reflectOnX++:notReflectOnX++}),reflectOnY>notReflectOnY&&reflectOnX>notReflectOnX)for(var _i=0;_i<nodeIndexes.size;_i++)xCoords[_i]=-1*xCoords[_i],yCoords[_i]=-1*yCoords[_i];else if(reflectOnY>notReflectOnY)for(var _i2=0;_i2<nodeIndexes.size;_i2++)xCoords[_i2]=-1*xCoords[_i2];else if(reflectOnX>notReflectOnX)for(var _i3=0;_i3<nodeIndexes.size;_i3++)yCoords[_i3]=-1*yCoords[_i3]},findComponents=function(graph){var components2=[],queue=new LinkedList,visited=new Set,count=0;return graph.forEach(function(value,key){if(!visited.has(key)){components2[count]=[];var _currentNode=key;for(queue.push(_currentNode),visited.add(_currentNode),components2[count].push(_currentNode);0!=queue.length;)_currentNode=queue.shift(),graph.get(_currentNode).forEach(function(neighbor){visited.has(neighbor.id)||(queue.push(neighbor.id),visited.add(neighbor.id),components2[count].push(neighbor.id))});count++}}),components2},dagToUndirected=function(dag2){var undirected=new Map;return dag2.forEach(function(value,key){undirected.set(key,[])}),dag2.forEach(function(value,key){value.forEach(function(adjacent){undirected.get(key).push(adjacent),undirected.get(adjacent.id).push({id:key,gap:adjacent.gap,direction:adjacent.direction})})}),undirected},dagToReversed=function(dag2){var reversed=new Map;return dag2.forEach(function(value,key){reversed.set(key,[])}),dag2.forEach(function(value,key){value.forEach(function(adjacent){reversed.get(adjacent.id).push({id:key,gap:adjacent.gap,direction:adjacent.direction})})}),reversed},targetMatrix=[],sourceMatrix=[],standardTransformation=!1,reflectionType=!1,fixedNodes=new Set,dag=new Map,dagUndirected=new Map,components=[];if(constraints.fixedNodeConstraint&&constraints.fixedNodeConstraint.forEach(function(nodeData2){fixedNodes.add(nodeData2.nodeId)}),constraints.relativePlacementConstraint&&(constraints.relativePlacementConstraint.forEach(function(constraint){constraint.left?(dag.has(constraint.left)?dag.get(constraint.left).push({id:constraint.right,gap:constraint.gap,direction:"horizontal"}):dag.set(constraint.left,[{id:constraint.right,gap:constraint.gap,direction:"horizontal"}]),dag.has(constraint.right)||dag.set(constraint.right,[])):(dag.has(constraint.top)?dag.get(constraint.top).push({id:constraint.bottom,gap:constraint.gap,direction:"vertical"}):dag.set(constraint.top,[{id:constraint.bottom,gap:constraint.gap,direction:"vertical"}]),dag.has(constraint.bottom)||dag.set(constraint.bottom,[]))}),dagUndirected=dagToUndirected(dag),components=findComponents(dagUndirected)),CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING){if(constraints.fixedNodeConstraint&&constraints.fixedNodeConstraint.length>1)constraints.fixedNodeConstraint.forEach(function(nodeData2,i2){targetMatrix[i2]=[nodeData2.position.x,nodeData2.position.y],sourceMatrix[i2]=[xCoords[nodeIndexes.get(nodeData2.nodeId)],yCoords[nodeIndexes.get(nodeData2.nodeId)]]}),standardTransformation=!0;else if(constraints.alignmentConstraint)!function(){var count=0;if(constraints.alignmentConstraint.vertical){for(var verticalAlign=constraints.alignmentConstraint.vertical,_loop2=function(_i42){var alignmentSet=new Set;verticalAlign[_i42].forEach(function(nodeId){alignmentSet.add(nodeId)});var intersection=new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x){return fixedNodes.has(x)})),xPos=void 0;xPos=intersection.size>0?xCoords[nodeIndexes.get(intersection.values().next().value)]:calculateAvgPosition(alignmentSet).x,verticalAlign[_i42].forEach(function(nodeId){targetMatrix[count]=[xPos,yCoords[nodeIndexes.get(nodeId)]],sourceMatrix[count]=[xCoords[nodeIndexes.get(nodeId)],yCoords[nodeIndexes.get(nodeId)]],count++})},_i4=0;_i4<verticalAlign.length;_i4++)_loop2(_i4);standardTransformation=!0}if(constraints.alignmentConstraint.horizontal){for(var horizontalAlign=constraints.alignmentConstraint.horizontal,_loop3=function(_i52){var alignmentSet=new Set;horizontalAlign[_i52].forEach(function(nodeId){alignmentSet.add(nodeId)});var intersection=new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x){return fixedNodes.has(x)})),yPos=void 0;yPos=intersection.size>0?xCoords[nodeIndexes.get(intersection.values().next().value)]:calculateAvgPosition(alignmentSet).y,horizontalAlign[_i52].forEach(function(nodeId){targetMatrix[count]=[xCoords[nodeIndexes.get(nodeId)],yPos],sourceMatrix[count]=[xCoords[nodeIndexes.get(nodeId)],yCoords[nodeIndexes.get(nodeId)]],count++})},_i5=0;_i5<horizontalAlign.length;_i5++)_loop3(_i5);standardTransformation=!0}constraints.relativePlacementConstraint&&(reflectionType=!0)}();else if(constraints.relativePlacementConstraint){for(var largestComponentSize=0,largestComponentIndex=0,_i6=0;_i6<components.length;_i6++)components[_i6].length>largestComponentSize&&(largestComponentSize=components[_i6].length,largestComponentIndex=_i6);if(largestComponentSize<dagUndirected.size/2)applyReflectionForRelativePlacement(constraints.relativePlacementConstraint),standardTransformation=!1,reflectionType=!1;else{var subGraphOnHorizontal=new Map,subGraphOnVertical=new Map,constraintsInlargestComponent=[];components[largestComponentIndex].forEach(function(nodeId){dag.get(nodeId).forEach(function(adjacent){"horizontal"==adjacent.direction?(subGraphOnHorizontal.has(nodeId)?subGraphOnHorizontal.get(nodeId).push(adjacent):subGraphOnHorizontal.set(nodeId,[adjacent]),subGraphOnHorizontal.has(adjacent.id)||subGraphOnHorizontal.set(adjacent.id,[]),constraintsInlargestComponent.push({left:nodeId,right:adjacent.id})):(subGraphOnVertical.has(nodeId)?subGraphOnVertical.get(nodeId).push(adjacent):subGraphOnVertical.set(nodeId,[adjacent]),subGraphOnVertical.has(adjacent.id)||subGraphOnVertical.set(adjacent.id,[]),constraintsInlargestComponent.push({top:nodeId,bottom:adjacent.id}))})}),applyReflectionForRelativePlacement(constraintsInlargestComponent),reflectionType=!1;var positionMapHorizontal=findAppropriatePositionForRelativePlacement(subGraphOnHorizontal,"horizontal"),positionMapVertical=findAppropriatePositionForRelativePlacement(subGraphOnVertical,"vertical");components[largestComponentIndex].forEach(function(nodeId,i2){sourceMatrix[i2]=[xCoords[nodeIndexes.get(nodeId)],yCoords[nodeIndexes.get(nodeId)]],targetMatrix[i2]=[],positionMapHorizontal.has(nodeId)?targetMatrix[i2][0]=positionMapHorizontal.get(nodeId):targetMatrix[i2][0]=xCoords[nodeIndexes.get(nodeId)],positionMapVertical.has(nodeId)?targetMatrix[i2][1]=positionMapVertical.get(nodeId):targetMatrix[i2][1]=yCoords[nodeIndexes.get(nodeId)]}),standardTransformation=!0}}if(standardTransformation){for(var transformationMatrix,targetMatrixTranspose=Matrix.transpose(targetMatrix),sourceMatrixTranspose=Matrix.transpose(sourceMatrix),_i7=0;_i7<targetMatrixTranspose.length;_i7++)targetMatrixTranspose[_i7]=Matrix.multGamma(targetMatrixTranspose[_i7]),sourceMatrixTranspose[_i7]=Matrix.multGamma(sourceMatrixTranspose[_i7]);var tempMatrix=Matrix.multMat(targetMatrixTranspose,Matrix.transpose(sourceMatrixTranspose)),SVDResult=SVD.svd(tempMatrix);transformationMatrix=Matrix.multMat(SVDResult.V,Matrix.transpose(SVDResult.U));for(var _i8=0;_i8<nodeIndexes.size;_i8++){var temp1=[xCoords[_i8],yCoords[_i8]],temp2=[transformationMatrix[0][0],transformationMatrix[1][0]],temp3=[transformationMatrix[0][1],transformationMatrix[1][1]];xCoords[_i8]=Matrix.dotProduct(temp1,temp2),yCoords[_i8]=Matrix.dotProduct(temp1,temp3)}reflectionType&&applyReflectionForRelativePlacement(constraints.relativePlacementConstraint)}}if(CoSEConstants.ENFORCE_CONSTRAINTS){if(constraints.fixedNodeConstraint&&constraints.fixedNodeConstraint.length>0){var translationAmount={x:0,y:0};constraints.fixedNodeConstraint.forEach(function(nodeData2,i2){var pos1,pos2,posInTheory={x:xCoords[nodeIndexes.get(nodeData2.nodeId)],y:yCoords[nodeIndexes.get(nodeData2.nodeId)]},posDesired=nodeData2.position,posDiff=(pos2=posInTheory,{x:(pos1=posDesired).x-pos2.x,y:pos1.y-pos2.y});translationAmount.x+=posDiff.x,translationAmount.y+=posDiff.y}),translationAmount.x/=constraints.fixedNodeConstraint.length,translationAmount.y/=constraints.fixedNodeConstraint.length,xCoords.forEach(function(value,i2){xCoords[i2]+=translationAmount.x}),yCoords.forEach(function(value,i2){yCoords[i2]+=translationAmount.y}),constraints.fixedNodeConstraint.forEach(function(nodeData2){xCoords[nodeIndexes.get(nodeData2.nodeId)]=nodeData2.position.x,yCoords[nodeIndexes.get(nodeData2.nodeId)]=nodeData2.position.y})}if(constraints.alignmentConstraint){if(constraints.alignmentConstraint.vertical)for(var xAlign=constraints.alignmentConstraint.vertical,_loop4=function(_i92){var alignmentSet=new Set;xAlign[_i92].forEach(function(nodeId){alignmentSet.add(nodeId)});var intersection=new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x){return fixedNodes.has(x)})),xPos=void 0;xPos=intersection.size>0?xCoords[nodeIndexes.get(intersection.values().next().value)]:calculateAvgPosition(alignmentSet).x,alignmentSet.forEach(function(nodeId){fixedNodes.has(nodeId)||(xCoords[nodeIndexes.get(nodeId)]=xPos)})},_i9=0;_i9<xAlign.length;_i9++)_loop4(_i9);if(constraints.alignmentConstraint.horizontal)for(var yAlign=constraints.alignmentConstraint.horizontal,_loop5=function(_i102){var alignmentSet=new Set;yAlign[_i102].forEach(function(nodeId){alignmentSet.add(nodeId)});var intersection=new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x){return fixedNodes.has(x)})),yPos=void 0;yPos=intersection.size>0?yCoords[nodeIndexes.get(intersection.values().next().value)]:calculateAvgPosition(alignmentSet).y,alignmentSet.forEach(function(nodeId){fixedNodes.has(nodeId)||(yCoords[nodeIndexes.get(nodeId)]=yPos)})},_i10=0;_i10<yAlign.length;_i10++)_loop5(_i10)}constraints.relativePlacementConstraint&&function(){var nodeToDummyForVerticalAlignment=new Map,nodeToDummyForHorizontalAlignment=new Map,dummyToNodeForVerticalAlignment=new Map,dummyToNodeForHorizontalAlignment=new Map,dummyPositionsForVerticalAlignment=new Map,dummyPositionsForHorizontalAlignment=new Map,fixedNodesOnHorizontal=new Set,fixedNodesOnVertical=new Set;if(fixedNodes.forEach(function(nodeId2){fixedNodesOnHorizontal.add(nodeId2),fixedNodesOnVertical.add(nodeId2)}),constraints.alignmentConstraint){if(constraints.alignmentConstraint.vertical)for(var verticalAlignment=constraints.alignmentConstraint.vertical,_loop6=function(_i112){dummyToNodeForVerticalAlignment.set("dummy"+_i112,[]),verticalAlignment[_i112].forEach(function(nodeId2){nodeToDummyForVerticalAlignment.set(nodeId2,"dummy"+_i112),dummyToNodeForVerticalAlignment.get("dummy"+_i112).push(nodeId2),fixedNodes.has(nodeId2)&&fixedNodesOnHorizontal.add("dummy"+_i112)}),dummyPositionsForVerticalAlignment.set("dummy"+_i112,xCoords[nodeIndexes.get(verticalAlignment[_i112][0])])},_i11=0;_i11<verticalAlignment.length;_i11++)_loop6(_i11);if(constraints.alignmentConstraint.horizontal)for(var horizontalAlignment=constraints.alignmentConstraint.horizontal,_loop7=function(_i122){dummyToNodeForHorizontalAlignment.set("dummy"+_i122,[]),horizontalAlignment[_i122].forEach(function(nodeId2){nodeToDummyForHorizontalAlignment.set(nodeId2,"dummy"+_i122),dummyToNodeForHorizontalAlignment.get("dummy"+_i122).push(nodeId2),fixedNodes.has(nodeId2)&&fixedNodesOnVertical.add("dummy"+_i122)}),dummyPositionsForHorizontalAlignment.set("dummy"+_i122,yCoords[nodeIndexes.get(horizontalAlignment[_i122][0])])},_i12=0;_i12<horizontalAlignment.length;_i12++)_loop7(_i12)}var dagOnHorizontal=new Map,dagOnVertical=new Map,_loop8=function(nodeId2){dag.get(nodeId2).forEach(function(adjacent){var sourceId=void 0,targetNode=void 0;"horizontal"==adjacent.direction?(sourceId=nodeToDummyForVerticalAlignment.get(nodeId2)?nodeToDummyForVerticalAlignment.get(nodeId2):nodeId2,targetNode=nodeToDummyForVerticalAlignment.get(adjacent.id)?{id:nodeToDummyForVerticalAlignment.get(adjacent.id),gap:adjacent.gap,direction:adjacent.direction}:adjacent,dagOnHorizontal.has(sourceId)?dagOnHorizontal.get(sourceId).push(targetNode):dagOnHorizontal.set(sourceId,[targetNode]),dagOnHorizontal.has(targetNode.id)||dagOnHorizontal.set(targetNode.id,[])):(sourceId=nodeToDummyForHorizontalAlignment.get(nodeId2)?nodeToDummyForHorizontalAlignment.get(nodeId2):nodeId2,targetNode=nodeToDummyForHorizontalAlignment.get(adjacent.id)?{id:nodeToDummyForHorizontalAlignment.get(adjacent.id),gap:adjacent.gap,direction:adjacent.direction}:adjacent,dagOnVertical.has(sourceId)?dagOnVertical.get(sourceId).push(targetNode):dagOnVertical.set(sourceId,[targetNode]),dagOnVertical.has(targetNode.id)||dagOnVertical.set(targetNode.id,[]))})},_iteratorNormalCompletion5=!0,_didIteratorError5=!1,_iteratorError5=void 0;try{for(var _step5,_iterator5=dag.keys()[Symbol.iterator]();!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=!0)_loop8(_step5.value)}catch(err){_didIteratorError5=!0,_iteratorError5=err}finally{try{!_iteratorNormalCompletion5&&_iterator5.return&&_iterator5.return()}finally{if(_didIteratorError5)throw _iteratorError5}}var undirectedOnHorizontal=dagToUndirected(dagOnHorizontal),undirectedOnVertical=dagToUndirected(dagOnVertical),componentsOnHorizontal=findComponents(undirectedOnHorizontal),componentsOnVertical=findComponents(undirectedOnVertical),reversedDagOnHorizontal=dagToReversed(dagOnHorizontal),reversedDagOnVertical=dagToReversed(dagOnVertical),componentSourcesOnHorizontal=[],componentSourcesOnVertical=[];componentsOnHorizontal.forEach(function(component,index2){componentSourcesOnHorizontal[index2]=[],component.forEach(function(nodeId2){0==reversedDagOnHorizontal.get(nodeId2).length&&componentSourcesOnHorizontal[index2].push(nodeId2)})}),componentsOnVertical.forEach(function(component,index2){componentSourcesOnVertical[index2]=[],component.forEach(function(nodeId2){0==reversedDagOnVertical.get(nodeId2).length&&componentSourcesOnVertical[index2].push(nodeId2)})});var positionMapHorizontal2=findAppropriatePositionForRelativePlacement(dagOnHorizontal,"horizontal",fixedNodesOnHorizontal,dummyPositionsForVerticalAlignment,componentSourcesOnHorizontal),positionMapVertical2=findAppropriatePositionForRelativePlacement(dagOnVertical,"vertical",fixedNodesOnVertical,dummyPositionsForHorizontalAlignment,componentSourcesOnVertical),_loop9=function(key2){dummyToNodeForVerticalAlignment.get(key2)?dummyToNodeForVerticalAlignment.get(key2).forEach(function(nodeId2){xCoords[nodeIndexes.get(nodeId2)]=positionMapHorizontal2.get(key2)}):xCoords[nodeIndexes.get(key2)]=positionMapHorizontal2.get(key2)},_iteratorNormalCompletion6=!0,_didIteratorError6=!1,_iteratorError6=void 0;try{for(var _step6,_iterator6=positionMapHorizontal2.keys()[Symbol.iterator]();!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=!0)_loop9(_step6.value)}catch(err){_didIteratorError6=!0,_iteratorError6=err}finally{try{!_iteratorNormalCompletion6&&_iterator6.return&&_iterator6.return()}finally{if(_didIteratorError6)throw _iteratorError6}}var _loop10=function(key2){dummyToNodeForHorizontalAlignment.get(key2)?dummyToNodeForHorizontalAlignment.get(key2).forEach(function(nodeId2){yCoords[nodeIndexes.get(nodeId2)]=positionMapVertical2.get(key2)}):yCoords[nodeIndexes.get(key2)]=positionMapVertical2.get(key2)},_iteratorNormalCompletion7=!0,_didIteratorError7=!1,_iteratorError7=void 0;try{for(var _step7,_iterator7=positionMapVertical2.keys()[Symbol.iterator]();!(_iteratorNormalCompletion7=(_step7=_iterator7.next()).done);_iteratorNormalCompletion7=!0)_loop10(_step7.value)}catch(err){_didIteratorError7=!0,_iteratorError7=err}finally{try{!_iteratorNormalCompletion7&&_iterator7.return&&_iterator7.return()}finally{if(_didIteratorError7)throw _iteratorError7}}}()}for(var _i13=0;_i13<allNodes.length;_i13++){var _node=allNodes[_i13];null==_node.getChild()&&_node.setCenter(xCoords[nodeIndexes.get(_node.id)],yCoords[nodeIndexes.get(_node.id)])}},module2.exports=ConstraintHandler},551:module2=>{module2.exports=__WEBPACK_EXTERNAL_MODULE__551__}},__webpack_module_cache__={},function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module2,module2.exports,__webpack_require__),module2.exports}(45);var __webpack_modules__,__webpack_module_cache__},coseBase$1.exports=factory(requireLayoutBase()));var factory}var hasRequiredCytoscapeFcose,__WEBPACK_EXTERNAL_MODULE__140__,__webpack_modules__,__webpack_module_cache__;const fcose=getDefaultExportFromCjs(hasRequiredCytoscapeFcose?cytoscapeFcose$1.exports:(hasRequiredCytoscapeFcose=1,cytoscapeFcose$1.exports=(__WEBPACK_EXTERNAL_MODULE__140__=requireCoseBase(),__webpack_modules__={658:module2=>{module2.exports=null!=Object.assign?Object.assign.bind(Object):function(tgt){for(var _len=arguments.length,srcs=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)srcs[_key-1]=arguments[_key];return srcs.forEach(function(src){Object.keys(src).forEach(function(k){return tgt[k]=src[k]})}),tgt}},548:(module2,__unused_webpack_exports,__webpack_require__2)=>{var _slicedToArray=function(){return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return function(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),LinkedList=__webpack_require__2(140).layoutBase.LinkedList,auxiliary={getTopMostNodes:function(nodes){for(var nodesMap={},i=0;i<nodes.length;i++)nodesMap[nodes[i].id()]=!0;return nodes.filter(function(ele,i2){"number"==typeof ele&&(ele=i2);for(var parent=ele.parent()[0];null!=parent;){if(nodesMap[parent.id()])return!1;parent=parent.parent()[0]}return!0})},connectComponents:function(cy,eles,topMostNodes,dummyNodes){var queue=new LinkedList,visited=new Set,visitedTopMostNodes=[],currentNeighbor=void 0,minDegreeNode=void 0,minDegree=void 0,isConnected=!1,count=1,nodesConnectedToDummy=[],components=[],_loop=function(){var cmpt=cy.collection();components.push(cmpt);var currentNode=topMostNodes[0],childrenOfCurrentNode=cy.collection();childrenOfCurrentNode.merge(currentNode).merge(currentNode.descendants().intersection(eles)),visitedTopMostNodes.push(currentNode),childrenOfCurrentNode.forEach(function(node){queue.push(node),visited.add(node),cmpt.merge(node)});for(var _loop22=function(){currentNode=queue.shift();var neighborNodes=cy.collection();currentNode.neighborhood().nodes().forEach(function(node){eles.intersection(currentNode.edgesWith(node)).length>0&&neighborNodes.merge(node)});for(var i=0;i<neighborNodes.length;i++){var neighborNode=neighborNodes[i];null==(currentNeighbor=topMostNodes.intersection(neighborNode.union(neighborNode.ancestors())))||visited.has(currentNeighbor[0])||currentNeighbor.union(currentNeighbor.descendants()).forEach(function(node){queue.push(node),visited.add(node),cmpt.merge(node),topMostNodes.has(node)&&visitedTopMostNodes.push(node)})}};0!=queue.length;)_loop22();if(cmpt.forEach(function(node){eles.intersection(node.connectedEdges()).forEach(function(e){cmpt.has(e.source())&&cmpt.has(e.target())&&cmpt.merge(e)})}),visitedTopMostNodes.length==topMostNodes.length&&(isConnected=!0),!isConnected||isConnected&&count>1){minDegreeNode=visitedTopMostNodes[0],minDegree=minDegreeNode.connectedEdges().length,visitedTopMostNodes.forEach(function(node){node.connectedEdges().length<minDegree&&(minDegree=node.connectedEdges().length,minDegreeNode=node)}),nodesConnectedToDummy.push(minDegreeNode.id());var temp=cy.collection();temp.merge(visitedTopMostNodes[0]),visitedTopMostNodes.forEach(function(node){temp.merge(node)}),visitedTopMostNodes=[],topMostNodes=topMostNodes.difference(temp),count++}};do{_loop()}while(!isConnected);return dummyNodes&&nodesConnectedToDummy.length>0&&dummyNodes.set("dummy"+(dummyNodes.size+1),nodesConnectedToDummy),components},relocateComponent:function(originalCenter,componentResult,options){if(!options.fixedNodeConstraint){var minXCoord=Number.POSITIVE_INFINITY,maxXCoord=Number.NEGATIVE_INFINITY,minYCoord=Number.POSITIVE_INFINITY,maxYCoord=Number.NEGATIVE_INFINITY;if("draft"==options.quality){var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=componentResult.nodeIndexes[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var _ref=_step.value,_ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1],cyNode=options.cy.getElementById(key);if(cyNode){var nodeBB=cyNode.boundingBox(),leftX=componentResult.xCoords[value]-nodeBB.w/2,rightX=componentResult.xCoords[value]+nodeBB.w/2,topY=componentResult.yCoords[value]-nodeBB.h/2,bottomY=componentResult.yCoords[value]+nodeBB.h/2;leftX<minXCoord&&(minXCoord=leftX),rightX>maxXCoord&&(maxXCoord=rightX),topY<minYCoord&&(minYCoord=topY),bottomY>maxYCoord&&(maxYCoord=bottomY)}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{!_iteratorNormalCompletion&&_iterator.return&&_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}var diffOnX=originalCenter.x-(maxXCoord+minXCoord)/2,diffOnY=originalCenter.y-(maxYCoord+minYCoord)/2;componentResult.xCoords=componentResult.xCoords.map(function(x){return x+diffOnX}),componentResult.yCoords=componentResult.yCoords.map(function(y){return y+diffOnY})}else{Object.keys(componentResult).forEach(function(item){var node=componentResult[item],leftX2=node.getRect().x,rightX2=node.getRect().x+node.getRect().width,topY2=node.getRect().y,bottomY2=node.getRect().y+node.getRect().height;leftX2<minXCoord&&(minXCoord=leftX2),rightX2>maxXCoord&&(maxXCoord=rightX2),topY2<minYCoord&&(minYCoord=topY2),bottomY2>maxYCoord&&(maxYCoord=bottomY2)});var _diffOnX=originalCenter.x-(maxXCoord+minXCoord)/2,_diffOnY=originalCenter.y-(maxYCoord+minYCoord)/2;Object.keys(componentResult).forEach(function(item){var node=componentResult[item];node.setCenter(node.getCenterX()+_diffOnX,node.getCenterY()+_diffOnY)})}}},calcBoundingBox:function(parentNode,xCoords,yCoords,nodeIndexes){for(var left=Number.MAX_SAFE_INTEGER,right=Number.MIN_SAFE_INTEGER,top=Number.MAX_SAFE_INTEGER,bottom=Number.MIN_SAFE_INTEGER,nodeLeft=void 0,nodeRight=void 0,nodeTop=void 0,nodeBottom=void 0,nodes=parentNode.descendants().not(":parent"),s=nodes.length,i=0;i<s;i++){var node=nodes[i];left>(nodeLeft=xCoords[nodeIndexes.get(node.id())]-node.width()/2)&&(left=nodeLeft),right<(nodeRight=xCoords[nodeIndexes.get(node.id())]+node.width()/2)&&(right=nodeRight),top>(nodeTop=yCoords[nodeIndexes.get(node.id())]-node.height()/2)&&(top=nodeTop),bottom<(nodeBottom=yCoords[nodeIndexes.get(node.id())]+node.height()/2)&&(bottom=nodeBottom)}var boundingBox={};return boundingBox.topLeftX=left,boundingBox.topLeftY=top,boundingBox.width=right-left,boundingBox.height=bottom-top,boundingBox},calcParentsWithoutChildren:function(cy,eles){var parentsWithoutChildren=cy.collection();return eles.nodes(":parent").forEach(function(parent){var check=!1;parent.children().forEach(function(child){"none"!=child.css("display")&&(check=!0)}),check||parentsWithoutChildren.merge(parent)}),parentsWithoutChildren}};module2.exports=auxiliary},816:(module2,__unused_webpack_exports,__webpack_require__2)=>{var aux=__webpack_require__2(548),CoSELayout=__webpack_require__2(140).CoSELayout,CoSENode=__webpack_require__2(140).CoSENode,PointD=__webpack_require__2(140).layoutBase.PointD,DimensionD2=__webpack_require__2(140).layoutBase.DimensionD,LayoutConstants=__webpack_require__2(140).layoutBase.LayoutConstants,FDLayoutConstants=__webpack_require__2(140).layoutBase.FDLayoutConstants,CoSEConstants=__webpack_require__2(140).CoSEConstants;module2.exports={coseLayout:function(options,spectralResult){var cy=options.cy,eles=options.eles,nodes=eles.nodes(),edges=eles.edges(),nodeIndexes=void 0,xCoords=void 0,yCoords=void 0,idToLNode={};options.randomize&&(nodeIndexes=spectralResult.nodeIndexes,xCoords=spectralResult.xCoords,yCoords=spectralResult.yCoords);var isFn=function(fn){return"function"==typeof fn},optFn=function(opt,ele){return isFn(opt)?opt(ele):opt},parentsWithoutChildren=aux.calcParentsWithoutChildren(cy,eles);null!=options.nestingFactor&&(CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=options.nestingFactor),null!=options.gravity&&(CoSEConstants.DEFAULT_GRAVITY_STRENGTH=FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH=options.gravity),null!=options.numIter&&(CoSEConstants.MAX_ITERATIONS=FDLayoutConstants.MAX_ITERATIONS=options.numIter),null!=options.gravityRange&&(CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR=FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR=options.gravityRange),null!=options.gravityCompound&&(CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH=options.gravityCompound),null!=options.gravityRangeCompound&&(CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=options.gravityRangeCompound),null!=options.initialEnergyOnIncremental&&(CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL=options.initialEnergyOnIncremental),null!=options.tilingCompareBy&&(CoSEConstants.TILING_COMPARE_BY=options.tilingCompareBy),"proof"==options.quality?LayoutConstants.QUALITY=2:LayoutConstants.QUALITY=0,CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS=FDLayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS=LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS=options.nodeDimensionsIncludeLabels,CoSEConstants.DEFAULT_INCREMENTAL=FDLayoutConstants.DEFAULT_INCREMENTAL=LayoutConstants.DEFAULT_INCREMENTAL=!options.randomize,CoSEConstants.ANIMATE=FDLayoutConstants.ANIMATE=LayoutConstants.ANIMATE=options.animate,CoSEConstants.TILE=options.tile,CoSEConstants.TILING_PADDING_VERTICAL="function"==typeof options.tilingPaddingVertical?options.tilingPaddingVertical.call():options.tilingPaddingVertical,CoSEConstants.TILING_PADDING_HORIZONTAL="function"==typeof options.tilingPaddingHorizontal?options.tilingPaddingHorizontal.call():options.tilingPaddingHorizontal,CoSEConstants.DEFAULT_INCREMENTAL=FDLayoutConstants.DEFAULT_INCREMENTAL=LayoutConstants.DEFAULT_INCREMENTAL=!0,CoSEConstants.PURE_INCREMENTAL=!options.randomize,LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES=options.uniformNodeDimensions,"transformed"==options.step&&(CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,CoSEConstants.ENFORCE_CONSTRAINTS=!1,CoSEConstants.APPLY_LAYOUT=!1),"enforced"==options.step&&(CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,CoSEConstants.ENFORCE_CONSTRAINTS=!0,CoSEConstants.APPLY_LAYOUT=!1),"cose"==options.step&&(CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,CoSEConstants.ENFORCE_CONSTRAINTS=!1,CoSEConstants.APPLY_LAYOUT=!0),"all"==options.step&&(options.randomize?CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,CoSEConstants.ENFORCE_CONSTRAINTS=!0,CoSEConstants.APPLY_LAYOUT=!0),options.fixedNodeConstraint||options.alignmentConstraint||options.relativePlacementConstraint?CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL=!1:CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL=!0;var layout,options2,coseLayout3=new CoSELayout,gm=coseLayout3.newGraphManager();return function processChildrenList2(parent,children,layout,options2){for(var size=children.length,i=0;i<size;i++){var theChild=children[i],children_of_children=null;0==theChild.intersection(parentsWithoutChildren).length&&(children_of_children=theChild.children());var theNode=void 0,dimensions=theChild.layoutDimensions({nodeDimensionsIncludeLabels:options2.nodeDimensionsIncludeLabels});if(null!=theChild.outerWidth()&&null!=theChild.outerHeight())if(options2.randomize)if(theChild.isParent()){var parentInfo=aux.calcBoundingBox(theChild,xCoords,yCoords,nodeIndexes);theNode=0==theChild.intersection(parentsWithoutChildren).length?parent.add(new CoSENode(layout.graphManager,new PointD(parentInfo.topLeftX,parentInfo.topLeftY),new DimensionD2(parentInfo.width,parentInfo.height))):parent.add(new CoSENode(layout.graphManager,new PointD(parentInfo.topLeftX,parentInfo.topLeftY),new DimensionD2(parseFloat(dimensions.w),parseFloat(dimensions.h))))}else theNode=parent.add(new CoSENode(layout.graphManager,new PointD(xCoords[nodeIndexes.get(theChild.id())]-dimensions.w/2,yCoords[nodeIndexes.get(theChild.id())]-dimensions.h/2),new DimensionD2(parseFloat(dimensions.w),parseFloat(dimensions.h))));else theNode=parent.add(new CoSENode(layout.graphManager,new PointD(theChild.position("x")-dimensions.w/2,theChild.position("y")-dimensions.h/2),new DimensionD2(parseFloat(dimensions.w),parseFloat(dimensions.h))));else theNode=parent.add(new CoSENode(this.graphManager));theNode.id=theChild.data("id"),theNode.nodeRepulsion=optFn(options2.nodeRepulsion,theChild),theNode.paddingLeft=parseInt(theChild.css("padding")),theNode.paddingTop=parseInt(theChild.css("padding")),theNode.paddingRight=parseInt(theChild.css("padding")),theNode.paddingBottom=parseInt(theChild.css("padding")),options2.nodeDimensionsIncludeLabels&&(theNode.labelWidth=theChild.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,theNode.labelHeight=theChild.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,theNode.labelPosVertical=theChild.css("text-valign"),theNode.labelPosHorizontal=theChild.css("text-halign")),idToLNode[theChild.data("id")]=theNode,isNaN(theNode.rect.x)&&(theNode.rect.x=0),isNaN(theNode.rect.y)&&(theNode.rect.y=0),null!=children_of_children&&children_of_children.length>0&&processChildrenList2(layout.getGraphManager().add(layout.newGraph(),theNode),children_of_children,layout,options2)}}(gm.addRoot(),aux.getTopMostNodes(nodes),coseLayout3,options),function(layout,gm2,edges2){for(var idealLengthTotal=0,edgeCount=0,i=0;i<edges2.length;i++){var edge=edges2[i],sourceNode=idToLNode[edge.data("source")],targetNode=idToLNode[edge.data("target")];if(sourceNode&&targetNode&&sourceNode!==targetNode&&0==sourceNode.getEdgesBetween(targetNode).length){var e1=gm2.add(layout.newEdge(),sourceNode,targetNode);e1.id=edge.id(),e1.idealLength=optFn(options.idealEdgeLength,edge),e1.edgeElasticity=optFn(options.edgeElasticity,edge),idealLengthTotal+=e1.idealLength,edgeCount++}}null!=options.idealEdgeLength&&(edgeCount>0?CoSEConstants.DEFAULT_EDGE_LENGTH=FDLayoutConstants.DEFAULT_EDGE_LENGTH=idealLengthTotal/edgeCount:isFn(options.idealEdgeLength)?CoSEConstants.DEFAULT_EDGE_LENGTH=FDLayoutConstants.DEFAULT_EDGE_LENGTH=50:CoSEConstants.DEFAULT_EDGE_LENGTH=FDLayoutConstants.DEFAULT_EDGE_LENGTH=options.idealEdgeLength,CoSEConstants.MIN_REPULSION_DIST=FDLayoutConstants.MIN_REPULSION_DIST=FDLayoutConstants.DEFAULT_EDGE_LENGTH/10,CoSEConstants.DEFAULT_RADIAL_SEPARATION=FDLayoutConstants.DEFAULT_EDGE_LENGTH)}(coseLayout3,gm,edges),layout=coseLayout3,(options2=options).fixedNodeConstraint&&(layout.constraints.fixedNodeConstraint=options2.fixedNodeConstraint),options2.alignmentConstraint&&(layout.constraints.alignmentConstraint=options2.alignmentConstraint),options2.relativePlacementConstraint&&(layout.constraints.relativePlacementConstraint=options2.relativePlacementConstraint),coseLayout3.runLayout(),idToLNode}}},212:(module2,__unused_webpack_exports,__webpack_require__2)=>{var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),assign=__webpack_require__2(658),aux=__webpack_require__2(548),spectralLayout=__webpack_require__2(657).spectralLayout,coseLayout=__webpack_require__2(816).coseLayout,defaults=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(node){return 4500},idealEdgeLength:function(edge){return 50},edgeElasticity:function(edge){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(){}}),Layout2=function(){function Layout3(options){!function(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Layout3),this.options=assign({},defaults,options)}return _createClass(Layout3,[{key:"run",value:function(){var options=this.options,cy=options.cy,eles=options.eles,spectralResult=[],coseResult=[],components=void 0,componentCenters=[];!options.fixedNodeConstraint||Array.isArray(options.fixedNodeConstraint)&&0!=options.fixedNodeConstraint.length||(options.fixedNodeConstraint=void 0),options.alignmentConstraint&&(!options.alignmentConstraint.vertical||Array.isArray(options.alignmentConstraint.vertical)&&0!=options.alignmentConstraint.vertical.length||(options.alignmentConstraint.vertical=void 0),!options.alignmentConstraint.horizontal||Array.isArray(options.alignmentConstraint.horizontal)&&0!=options.alignmentConstraint.horizontal.length||(options.alignmentConstraint.horizontal=void 0)),!options.relativePlacementConstraint||Array.isArray(options.relativePlacementConstraint)&&0!=options.relativePlacementConstraint.length||(options.relativePlacementConstraint=void 0),(options.fixedNodeConstraint||options.alignmentConstraint||options.relativePlacementConstraint)&&(options.tile=!1,options.packComponents=!1);var layUtil=void 0,packingEnabled=!1;if(cy.layoutUtilities&&options.packComponents&&((layUtil=cy.layoutUtilities("get"))||(layUtil=cy.layoutUtilities()),packingEnabled=!0),eles.nodes().length>0)if(packingEnabled){var topMostNodes=aux.getTopMostNodes(options.eles.nodes());if((components=aux.connectComponents(cy,options.eles,topMostNodes)).forEach(function(component){var boundingBox2=component.boundingBox();componentCenters.push({x:boundingBox2.x1+boundingBox2.w/2,y:boundingBox2.y1+boundingBox2.h/2})}),options.randomize&&components.forEach(function(component){options.eles=component,spectralResult.push(spectralLayout(options))}),"default"==options.quality||"proof"==options.quality){var toBeTiledNodes=cy.collection();if(options.tile){var count=0,tempSpectralResult={nodeIndexes:new Map,xCoords:[],yCoords:[]},indexesToBeDeleted=[];if(components.forEach(function(component,index){0==component.edges().length&&(component.nodes().forEach(function(node,i2){toBeTiledNodes.merge(component.nodes()[i2]),node.isParent()||(tempSpectralResult.nodeIndexes.set(component.nodes()[i2].id(),count++),tempSpectralResult.xCoords.push(component.nodes()[0].position().x),tempSpectralResult.yCoords.push(component.nodes()[0].position().y))}),indexesToBeDeleted.push(index))}),toBeTiledNodes.length>1){var _boundingBox=toBeTiledNodes.boundingBox();componentCenters.push({x:_boundingBox.x1+_boundingBox.w/2,y:_boundingBox.y1+_boundingBox.h/2}),components.push(toBeTiledNodes),spectralResult.push(tempSpectralResult);for(var i=indexesToBeDeleted.length-1;i>=0;i--)components.splice(indexesToBeDeleted[i],1),spectralResult.splice(indexesToBeDeleted[i],1),componentCenters.splice(indexesToBeDeleted[i],1)}}components.forEach(function(component,index){options.eles=component,coseResult.push(coseLayout(options,spectralResult[index])),aux.relocateComponent(componentCenters[index],coseResult[index],options)})}else components.forEach(function(component,index){aux.relocateComponent(componentCenters[index],spectralResult[index],options)});var componentsEvaluated=new Set;if(components.length>1){var subgraphs=[],hiddenEles=eles.filter(function(ele){return"none"==ele.css("display")});components.forEach(function(component,index){var nodeIndexes2=void 0;if("draft"==options.quality&&(nodeIndexes2=spectralResult[index].nodeIndexes),component.nodes().not(hiddenEles).length>0){var subgraph={edges:[],nodes:[]},nodeIndex=void 0;component.nodes().not(hiddenEles).forEach(function(node){if("draft"==options.quality)if(node.isParent()){var parentInfo=aux.calcBoundingBox(node,spectralResult[index].xCoords,spectralResult[index].yCoords,nodeIndexes2);subgraph.nodes.push({x:parentInfo.topLeftX,y:parentInfo.topLeftY,width:parentInfo.width,height:parentInfo.height})}else nodeIndex=nodeIndexes2.get(node.id()),subgraph.nodes.push({x:spectralResult[index].xCoords[nodeIndex]-node.boundingbox().w/2,y:spectralResult[index].yCoords[nodeIndex]-node.boundingbox().h/2,width:node.boundingbox().w,height:node.boundingbox().h});else coseResult[index][node.id()]&&subgraph.nodes.push({x:coseResult[index][node.id()].getLeft(),y:coseResult[index][node.id()].getTop(),width:coseResult[index][node.id()].getWidth(),height:coseResult[index][node.id()].getHeight()})}),component.edges().forEach(function(edge){var source=edge.source(),target=edge.target();if("none"!=source.css("display")&&"none"!=target.css("display"))if("draft"==options.quality){var sourceNodeIndex=nodeIndexes2.get(source.id()),targetNodeIndex=nodeIndexes2.get(target.id()),sourceCenter=[],targetCenter=[];if(source.isParent()){var parentInfo=aux.calcBoundingBox(source,spectralResult[index].xCoords,spectralResult[index].yCoords,nodeIndexes2);sourceCenter.push(parentInfo.topLeftX+parentInfo.width/2),sourceCenter.push(parentInfo.topLeftY+parentInfo.height/2)}else sourceCenter.push(spectralResult[index].xCoords[sourceNodeIndex]),sourceCenter.push(spectralResult[index].yCoords[sourceNodeIndex]);if(target.isParent()){var _parentInfo=aux.calcBoundingBox(target,spectralResult[index].xCoords,spectralResult[index].yCoords,nodeIndexes2);targetCenter.push(_parentInfo.topLeftX+_parentInfo.width/2),targetCenter.push(_parentInfo.topLeftY+_parentInfo.height/2)}else targetCenter.push(spectralResult[index].xCoords[targetNodeIndex]),targetCenter.push(spectralResult[index].yCoords[targetNodeIndex]);subgraph.edges.push({startX:sourceCenter[0],startY:sourceCenter[1],endX:targetCenter[0],endY:targetCenter[1]})}else coseResult[index][source.id()]&&coseResult[index][target.id()]&&subgraph.edges.push({startX:coseResult[index][source.id()].getCenterX(),startY:coseResult[index][source.id()].getCenterY(),endX:coseResult[index][target.id()].getCenterX(),endY:coseResult[index][target.id()].getCenterY()})}),subgraph.nodes.length>0&&(subgraphs.push(subgraph),componentsEvaluated.add(index))}});var shiftResult=layUtil.packComponents(subgraphs,options.randomize).shifts;if("draft"==options.quality)spectralResult.forEach(function(result2,index){var newXCoords=result2.xCoords.map(function(x){return x+shiftResult[index].dx}),newYCoords=result2.yCoords.map(function(y){return y+shiftResult[index].dy});result2.xCoords=newXCoords,result2.yCoords=newYCoords});else{var _count=0;componentsEvaluated.forEach(function(index){Object.keys(coseResult[index]).forEach(function(item){var nodeRectangle=coseResult[index][item];nodeRectangle.setCenter(nodeRectangle.getCenterX()+shiftResult[_count].dx,nodeRectangle.getCenterY()+shiftResult[_count].dy)}),_count++})}}}else{var boundingBox=options.eles.boundingBox();if(componentCenters.push({x:boundingBox.x1+boundingBox.w/2,y:boundingBox.y1+boundingBox.h/2}),options.randomize){var result=spectralLayout(options);spectralResult.push(result)}"default"==options.quality||"proof"==options.quality?(coseResult.push(coseLayout(options,spectralResult[0])),aux.relocateComponent(componentCenters[0],coseResult[0],options)):aux.relocateComponent(componentCenters[0],spectralResult[0],options)}var getPositions=function(ele,i2){if("default"==options.quality||"proof"==options.quality){"number"==typeof ele&&(ele=i2);var pos=void 0,node=void 0,theId=ele.data("id");return coseResult.forEach(function(result2){theId in result2&&(pos={x:result2[theId].getRect().getCenterX(),y:result2[theId].getRect().getCenterY()},node=result2[theId])}),options.nodeDimensionsIncludeLabels&&(node.labelWidth&&("left"==node.labelPosHorizontal?pos.x+=node.labelWidth/2:"right"==node.labelPosHorizontal&&(pos.x-=node.labelWidth/2)),node.labelHeight&&("top"==node.labelPosVertical?pos.y+=node.labelHeight/2:"bottom"==node.labelPosVertical&&(pos.y-=node.labelHeight/2))),null==pos&&(pos={x:ele.position("x"),y:ele.position("y")}),{x:pos.x,y:pos.y}}var _pos=void 0;return spectralResult.forEach(function(result2){var index=result2.nodeIndexes.get(ele.id());null!=index&&(_pos={x:result2.xCoords[index],y:result2.yCoords[index]})}),null==_pos&&(_pos={x:ele.position("x"),y:ele.position("y")}),{x:_pos.x,y:_pos.y}};if("default"==options.quality||"proof"==options.quality||options.randomize){var parentsWithoutChildren=aux.calcParentsWithoutChildren(cy,eles),_hiddenEles=eles.filter(function(ele){return"none"==ele.css("display")});options.eles=eles.not(_hiddenEles),eles.nodes().not(":parent").not(_hiddenEles).layoutPositions(this,options,getPositions),parentsWithoutChildren.length>0&&parentsWithoutChildren.forEach(function(ele){ele.position(getPositions(ele))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),Layout3}();module2.exports=Layout2},657:(module2,__unused_webpack_exports,__webpack_require__2)=>{var aux=__webpack_require__2(548),Matrix=__webpack_require__2(140).layoutBase.Matrix,SVD=__webpack_require__2(140).layoutBase.SVD;module2.exports={spectralLayout:function(options){var cy=options.cy,eles=options.eles,nodes=eles.nodes(),parentNodes=eles.nodes(":parent"),dummyNodes=new Map,nodeIndexes=new Map,parentChildMap=new Map,allNodesNeighborhood=[],xCoords=[],yCoords=[],samplesColumn=[],minDistancesColumn=[],C=[],PHI=[],INV=[],nodeSize=void 0,piTol=options.piTol,samplingType=options.samplingType,nodeSeparation=options.nodeSeparation,sampleSize=void 0,BFS=function(pivot,index2,samplingMethod){for(var path=[],front=0,back=0,current=0,temp=void 0,distance=[],max_dist=0,max_ind=1,i2=0;i2<nodeSize;i2++)distance[i2]=1e8;for(path[back]=pivot,distance[pivot]=0;back>=front;){current=path[front++];for(var neighbors=allNodesNeighborhood[current],_i=0;_i<neighbors.length;_i++)1e8==distance[temp=nodeIndexes.get(neighbors[_i])]&&(distance[temp]=distance[current]+1,path[++back]=temp);C[current][index2]=distance[current]*nodeSeparation}if(samplingMethod){for(var _i2=0;_i2<nodeSize;_i2++)C[_i2][index2]<minDistancesColumn[_i2]&&(minDistancesColumn[_i2]=C[_i2][index2]);for(var _i3=0;_i3<nodeSize;_i3++)minDistancesColumn[_i3]>max_dist&&(max_dist=minDistancesColumn[_i3],max_ind=_i3)}return max_ind};aux.connectComponents(cy,eles,aux.getTopMostNodes(nodes),dummyNodes),parentNodes.forEach(function(ele){aux.connectComponents(cy,eles,aux.getTopMostNodes(ele.descendants().intersection(eles)),dummyNodes)});for(var index=0,i=0;i<nodes.length;i++)nodes[i].isParent()||nodeIndexes.set(nodes[i].id(),index++);var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=dummyNodes.keys()[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var key=_step.value;nodeIndexes.set(key,index++)}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{!_iteratorNormalCompletion&&_iterator.return&&_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}for(var _i13=0;_i13<nodeIndexes.size;_i13++)allNodesNeighborhood[_i13]=[];parentNodes.forEach(function(ele){for(var children=ele.children().intersection(eles);0==children.nodes(":childless").length;)children=children.nodes()[0].children().intersection(eles);var index2=0,min=children.nodes(":childless")[0].connectedEdges().length;children.nodes(":childless").forEach(function(ele2,i2){ele2.connectedEdges().length<min&&(min=ele2.connectedEdges().length,index2=i2)}),parentChildMap.set(ele.id(),children.nodes(":childless")[index2].id())}),nodes.forEach(function(ele){var eleIndex=void 0;eleIndex=ele.isParent()?nodeIndexes.get(parentChildMap.get(ele.id())):nodeIndexes.get(ele.id()),ele.neighborhood().nodes().forEach(function(node){eles.intersection(ele.edgesWith(node)).length>0&&(node.isParent()?allNodesNeighborhood[eleIndex].push(parentChildMap.get(node.id())):allNodesNeighborhood[eleIndex].push(node.id()))})});var _loop=function(_key2){var eleIndex=nodeIndexes.get(_key2),disconnectedId=void 0;dummyNodes.get(_key2).forEach(function(id){disconnectedId=cy.getElementById(id).isParent()?parentChildMap.get(id):id,allNodesNeighborhood[eleIndex].push(disconnectedId),allNodesNeighborhood[nodeIndexes.get(disconnectedId)].push(_key2)})},_iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_iterator2=dummyNodes.keys()[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0)_loop(_step2.value)}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{!_iteratorNormalCompletion2&&_iterator2.return&&_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}var spectralResult=void 0;if((nodeSize=nodeIndexes.size)>2){sampleSize=nodeSize<options.sampleSize?nodeSize:options.sampleSize;for(var _i14=0;_i14<nodeSize;_i14++)C[_i14]=[];for(var _i15=0;_i15<sampleSize;_i15++)INV[_i15]=[];return"draft"==options.quality||"all"==options.step?(function(samplingMethod){var sample2=void 0;if(samplingMethod){sample2=Math.floor(Math.random()*nodeSize);for(var _i4=0;_i4<nodeSize;_i4++)minDistancesColumn[_i4]=1e8;for(var _i5=0;_i5<sampleSize;_i5++)samplesColumn[_i5]=sample2,sample2=BFS(sample2,_i5,samplingMethod)}else{!function(){for(var sample2=0,count=0,flag=!1;count<sampleSize;){sample2=Math.floor(Math.random()*nodeSize),flag=!1;for(var i2=0;i2<count;i2++)if(samplesColumn[i2]==sample2){flag=!0;break}flag||(samplesColumn[count]=sample2,count++)}}();for(var i2=0;i2<sampleSize;i2++)BFS(samplesColumn[i2],i2,samplingMethod)}for(var _i6=0;_i6<nodeSize;_i6++)for(var j=0;j<sampleSize;j++)C[_i6][j]*=C[_i6][j];for(var _i7=0;_i7<sampleSize;_i7++)PHI[_i7]=[];for(var _i8=0;_i8<sampleSize;_i8++)for(var _j=0;_j<sampleSize;_j++)PHI[_i8][_j]=C[samplesColumn[_j]][_i8]}(samplingType),function(){for(var SVDResult=SVD.svd(PHI),a_q=SVDResult.S,a_u=SVDResult.U,a_v=SVDResult.V,max_s=a_q[0]*a_q[0]*a_q[0],a_Sig=[],i2=0;i2<sampleSize;i2++){a_Sig[i2]=[];for(var j=0;j<sampleSize;j++)a_Sig[i2][j]=0,i2==j&&(a_Sig[i2][j]=a_q[i2]/(a_q[i2]*a_q[i2]+max_s/(a_q[i2]*a_q[i2])))}INV=Matrix.multMat(Matrix.multMat(a_v,a_Sig),Matrix.transpose(a_u))}(),function(){for(var theta1=void 0,theta2=void 0,Y1=[],Y2=[],V1=[],V2=[],i2=0;i2<nodeSize;i2++)Y1[i2]=Math.random(),Y2[i2]=Math.random();Y1=Matrix.normalize(Y1),Y2=Matrix.normalize(Y2);for(var current=1e-9,previous=1e-9,temp=void 0;;){for(var _i9=0;_i9<nodeSize;_i9++)V1[_i9]=Y1[_i9];if(Y1=Matrix.multGamma(Matrix.multL(Matrix.multGamma(V1),C,INV)),theta1=Matrix.dotProduct(V1,Y1),Y1=Matrix.normalize(Y1),current=Matrix.dotProduct(V1,Y1),(temp=Math.abs(current/previous))<=1+piTol&&temp>=1)break;previous=current}for(var _i10=0;_i10<nodeSize;_i10++)V1[_i10]=Y1[_i10];for(previous=1e-9;;){for(var _i11=0;_i11<nodeSize;_i11++)V2[_i11]=Y2[_i11];if(V2=Matrix.minusOp(V2,Matrix.multCons(V1,Matrix.dotProduct(V1,V2))),Y2=Matrix.multGamma(Matrix.multL(Matrix.multGamma(V2),C,INV)),theta2=Matrix.dotProduct(V2,Y2),Y2=Matrix.normalize(Y2),current=Matrix.dotProduct(V2,Y2),(temp=Math.abs(current/previous))<=1+piTol&&temp>=1)break;previous=current}for(var _i12=0;_i12<nodeSize;_i12++)V2[_i12]=Y2[_i12];xCoords=Matrix.multCons(V1,Math.sqrt(Math.abs(theta1))),yCoords=Matrix.multCons(V2,Math.sqrt(Math.abs(theta2)))}(),spectralResult={nodeIndexes:nodeIndexes,xCoords:xCoords,yCoords:yCoords}):(nodeIndexes.forEach(function(value,key2){xCoords.push(cy.getElementById(key2).position("x")),yCoords.push(cy.getElementById(key2).position("y"))}),spectralResult={nodeIndexes:nodeIndexes,xCoords:xCoords,yCoords:yCoords}),spectralResult}var iterator=nodeIndexes.keys(),firstNode=cy.getElementById(iterator.next().value),firstNodePos=firstNode.position(),firstNodeWidth=firstNode.outerWidth();if(xCoords.push(firstNodePos.x),yCoords.push(firstNodePos.y),2==nodeSize){var secondNodeWidth=cy.getElementById(iterator.next().value).outerWidth();xCoords.push(firstNodePos.x+firstNodeWidth/2+secondNodeWidth/2+options.idealEdgeLength),yCoords.push(firstNodePos.y)}return spectralResult={nodeIndexes:nodeIndexes,xCoords:xCoords,yCoords:yCoords}}}},579:(module2,__unused_webpack_exports,__webpack_require__2)=>{var impl=__webpack_require__2(212),register=function(cytoscape2){cytoscape2&&cytoscape2("layout","fcose",impl)};"undefined"!=typeof cytoscape&®ister(cytoscape),module2.exports=register},140:module2=>{module2.exports=__WEBPACK_EXTERNAL_MODULE__140__}},__webpack_module_cache__={},function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module2,module2.exports,__webpack_require__),module2.exports}(579))));var ArchitectureDirectionName={L:"left",R:"right",T:"top",B:"bottom"},ArchitectureDirectionArrow={L:__name(scale=>`${scale},${scale/2} 0,${scale} 0,0`,"L"),R:__name(scale=>`0,${scale/2} ${scale},0 ${scale},${scale}`,"R"),T:__name(scale=>`0,0 ${scale},0 ${scale/2},${scale}`,"T"),B:__name(scale=>`${scale/2},0 ${scale},${scale} 0,${scale}`,"B")},ArchitectureDirectionArrowShift={L:__name((orig,arrowSize)=>orig-arrowSize+2,"L"),R:__name((orig,_arrowSize)=>orig-2,"R"),T:__name((orig,arrowSize)=>orig-arrowSize+2,"T"),B:__name((orig,_arrowSize)=>orig-2,"B")},getOppositeArchitectureDirection=__name(function(x){return isArchitectureDirectionX(x)?"L"===x?"R":"L":"T"===x?"B":"T"},"getOppositeArchitectureDirection"),isArchitectureDirection=__name(function(x){return"L"===x||"R"===x||"T"===x||"B"===x},"isArchitectureDirection"),isArchitectureDirectionX=__name(function(x){return"L"===x||"R"===x},"isArchitectureDirectionX"),isArchitectureDirectionY=__name(function(x){return"T"===x||"B"===x},"isArchitectureDirectionY"),isArchitectureDirectionXY=__name(function(a,b){const aX_bY=isArchitectureDirectionX(a)&&isArchitectureDirectionY(b),aY_bX=isArchitectureDirectionY(a)&&isArchitectureDirectionX(b);return aX_bY||aY_bX},"isArchitectureDirectionXY"),isArchitecturePairXY=__name(function(pair){const lhs=pair[0],rhs=pair[1],aX_bY=isArchitectureDirectionX(lhs)&&isArchitectureDirectionY(rhs),aY_bX=isArchitectureDirectionY(lhs)&&isArchitectureDirectionX(rhs);return aX_bY||aY_bX},"isArchitecturePairXY"),isValidArchitectureDirectionPair=__name(function(x){return"LL"!==x&&"RR"!==x&&"TT"!==x&&"BB"!==x},"isValidArchitectureDirectionPair"),getArchitectureDirectionPair=__name(function(sourceDir,targetDir){const pair=`${sourceDir}${targetDir}`;return isValidArchitectureDirectionPair(pair)?pair:void 0},"getArchitectureDirectionPair"),shiftPositionByArchitectureDirectionPair=__name(function([x,y],pair){const lhs=pair[0],rhs=pair[1];return isArchitectureDirectionX(lhs)?isArchitectureDirectionY(rhs)?[x+("L"===lhs?-1:1),y+("T"===rhs?1:-1)]:[x+("L"===lhs?-1:1),y]:isArchitectureDirectionX(rhs)?[x+("L"===rhs?1:-1),y+("T"===lhs?1:-1)]:[x,y+("T"===lhs?1:-1)]},"shiftPositionByArchitectureDirectionPair"),getArchitectureDirectionXYFactors=__name(function(pair){return"LT"===pair||"TL"===pair?[1,1]:"BL"===pair||"LB"===pair?[1,-1]:"BR"===pair||"RB"===pair?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),getArchitectureDirectionAlignment=__name(function(a,b){return isArchitectureDirectionXY(a,b)?"bend":isArchitectureDirectionX(a)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),isArchitectureService=__name(function(x){return"service"===x.type},"isArchitectureService"),isArchitectureJunction=__name(function(x){return"junction"===x.type},"isArchitectureJunction"),edgeData=__name(edge=>edge.data(),"edgeData"),nodeData=__name(node=>node.data(),"nodeData"),DEFAULT_ARCHITECTURE_CONFIG=defaultConfig_default.architecture,ArchitectureDB=(__name(_a=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=setAccTitle,this.getAccTitle=getAccTitle,this.setDiagramTitle=setDiagramTitle,this.getDiagramTitle=getDiagramTitle,this.getAccDescription=getAccDescription,this.setAccDescription=setAccDescription,this.clear()}setDiagramId(id){this.diagramId=id}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",clear()}addService({id:id,icon:icon,in:parent,title:title,iconText:iconText}){if(void 0!==this.registeredIds[id])throw new Error(`The service id [${id}] is already in use by another ${this.registeredIds[id]}`);if(void 0!==parent){if(id===parent)throw new Error(`The service [${id}] cannot be placed within itself`);if(void 0===this.registeredIds[parent])throw new Error(`The service [${id}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===this.registeredIds[parent])throw new Error(`The service [${id}]'s parent is not a group`)}this.registeredIds[id]="node",this.nodes[id]={id:id,type:"service",icon:icon,iconText:iconText,title:title,edges:[],in:parent}}getServices(){return Object.values(this.nodes).filter(isArchitectureService)}addJunction({id:id,in:parent}){if(void 0!==this.registeredIds[id])throw new Error(`The junction id [${id}] is already in use by another ${this.registeredIds[id]}`);if(void 0!==parent){if(id===parent)throw new Error(`The junction [${id}] cannot be placed within itself`);if(void 0===this.registeredIds[parent])throw new Error(`The junction [${id}]'s parent does not exist. Please make sure the parent is created before this junction`);if("node"===this.registeredIds[parent])throw new Error(`The junction [${id}]'s parent is not a group`)}this.registeredIds[id]="node",this.nodes[id]={id:id,type:"junction",edges:[],in:parent}}getJunctions(){return Object.values(this.nodes).filter(isArchitectureJunction)}getNodes(){return Object.values(this.nodes)}getNode(id){return this.nodes[id]??null}addGroup({id:id,icon:icon,in:parent,title:title}){var _a2,_b,_c;if(void 0!==(null==(_a2=this.registeredIds)?void 0:_a2[id]))throw new Error(`The group id [${id}] is already in use by another ${this.registeredIds[id]}`);if(void 0!==parent){if(id===parent)throw new Error(`The group [${id}] cannot be placed within itself`);if(void 0===(null==(_b=this.registeredIds)?void 0:_b[parent]))throw new Error(`The group [${id}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===(null==(_c=this.registeredIds)?void 0:_c[parent]))throw new Error(`The group [${id}]'s parent is not a group`)}this.registeredIds[id]="group",this.groups[id]={id:id,icon:icon,title:title,in:parent}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:lhsId,rhsId:rhsId,lhsDir:lhsDir,rhsDir:rhsDir,lhsInto:lhsInto,rhsInto:rhsInto,lhsGroup:lhsGroup,rhsGroup:rhsGroup,title:title}){if(!isArchitectureDirection(lhsDir))throw new Error(`Invalid direction given for left hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${String(lhsDir)}`);if(!isArchitectureDirection(rhsDir))throw new Error(`Invalid direction given for right hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${String(rhsDir)}`);if(void 0===this.nodes[lhsId]&&void 0===this.groups[lhsId])throw new Error(`The left-hand id [${lhsId}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===this.nodes[rhsId]&&void 0===this.groups[rhsId])throw new Error(`The right-hand id [${rhsId}] does not yet exist. Please create the service/group before declaring an edge to it.`);const lhsGroupId=this.nodes[lhsId].in,rhsGroupId=this.nodes[rhsId].in;if(lhsGroup&&lhsGroupId&&rhsGroupId&&lhsGroupId==rhsGroupId)throw new Error(`The left-hand id [${lhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(rhsGroup&&lhsGroupId&&rhsGroupId&&lhsGroupId==rhsGroupId)throw new Error(`The right-hand id [${rhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const edge={lhsId:lhsId,lhsDir:lhsDir,lhsInto:lhsInto,lhsGroup:lhsGroup,rhsId:rhsId,rhsDir:rhsDir,rhsInto:rhsInto,rhsGroup:rhsGroup,title:title};this.edges.push(edge),this.nodes[lhsId]&&this.nodes[rhsId]&&(this.nodes[lhsId].edges.push(this.edges[this.edges.length-1]),this.nodes[rhsId].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(void 0===this.dataStructures){const groupAlignments={},adjList=Object.entries(this.nodes).reduce((prevOuter,[id,service])=>(prevOuter[id]=service.edges.reduce((prevInner,edge)=>{var _a2,_b;const lhsGroupId=null==(_a2=this.getNode(edge.lhsId))?void 0:_a2.in,rhsGroupId=null==(_b=this.getNode(edge.rhsId))?void 0:_b.in;if(lhsGroupId&&rhsGroupId&&lhsGroupId!==rhsGroupId){const alignment=getArchitectureDirectionAlignment(edge.lhsDir,edge.rhsDir);"bend"!==alignment&&(groupAlignments[lhsGroupId]??(groupAlignments[lhsGroupId]={}),groupAlignments[lhsGroupId][rhsGroupId]=alignment,groupAlignments[rhsGroupId]??(groupAlignments[rhsGroupId]={}),groupAlignments[rhsGroupId][lhsGroupId]=alignment)}if(edge.lhsId===id){const pair=getArchitectureDirectionPair(edge.lhsDir,edge.rhsDir);pair&&(prevInner[pair]=edge.rhsId)}else{const pair=getArchitectureDirectionPair(edge.rhsDir,edge.lhsDir);pair&&(prevInner[pair]=edge.lhsId)}return prevInner},{}),prevOuter),{}),firstId=Object.keys(adjList)[0],visited={[firstId]:1},notVisited=Object.keys(adjList).reduce((prev,id)=>id===firstId?prev:{...prev,[id]:1},{}),BFS=__name(startingId=>{const spatialMap={[startingId]:[0,0]},queue=[startingId];for(;queue.length>0;){const id=queue.shift();if(id){visited[id]=1,delete notVisited[id];const adj=adjList[id],[posX,posY]=spatialMap[id];Object.entries(adj).forEach(([dir,rhsId])=>{visited[rhsId]||(spatialMap[rhsId]=shiftPositionByArchitectureDirectionPair([posX,posY],dir),queue.push(rhsId))})}}return spatialMap},"BFS"),spatialMaps=[BFS(firstId)];for(;Object.keys(notVisited).length>0;)spatialMaps.push(BFS(Object.keys(notVisited)[0]));this.dataStructures={adjList:adjList,spatialMaps:spatialMaps,groupAlignments:groupAlignments}}return this.dataStructures}setElementForId(id,element){this.elements[id]=element}getElementById(id){return this.elements[id]}getConfig(){return cleanAndMerge({...DEFAULT_ARCHITECTURE_CONFIG,...getConfig().architecture})}getConfigField(field){return this.getConfig()[field]}},"ArchitectureDB"),_a),populateDb=__name((ast,db)=>{populateCommonDb(ast,db),ast.groups.map(group=>db.addGroup(group)),ast.services.map(service=>db.addService({...service,type:"service"})),ast.junctions.map(service=>db.addJunction({...service,type:"junction"})),ast.edges.map(edge=>db.addEdge(edge))},"populateDb"),parser={parser:{yy:void 0},parse:__name(async input=>{var _a2;const ast=await parse("architecture",input);log.debug(ast);const db=null==(_a2=parser.parser)?void 0:_a2.yy;if(!(db instanceof ArchitectureDB))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.");populateDb(ast,db)},"parse")},architectureStyles_default=__name(options=>`\n .edge {\n stroke-width: ${options.archEdgeWidth};\n stroke: ${options.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${options.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${options.archGroupBorderColor};\n stroke-width: ${options.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`,"getStyles"),wrapIcon=__name(icon=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${icon}</g>`,"wrapIcon"),architectureIcons={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:wrapIcon('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:wrapIcon('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:wrapIcon('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:wrapIcon('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:wrapIcon('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:unknownIcon,blank:{body:wrapIcon("")}}},drawEdges=__name(async function(edgesEl,cy,db,diagramId){const padding=db.getConfigField("padding"),iconSize=db.getConfigField("iconSize"),halfIconSize=iconSize/2,arrowSize=iconSize/6,halfArrowSize=arrowSize/2;await Promise.all(cy.edges().map(async edge=>{var _a2,_b;const{source:source,sourceDir:sourceDir,sourceArrow:sourceArrow,sourceGroup:sourceGroup,target:target,targetDir:targetDir,targetArrow:targetArrow,targetGroup:targetGroup,label:label}=edgeData(edge);let{x:startX,y:startY}=edge[0].sourceEndpoint();const{x:midX,y:midY}=edge[0].midpoint();let{x:endX,y:endY}=edge[0].targetEndpoint();const groupEdgeShift=padding+4;if(sourceGroup&&(isArchitectureDirectionX(sourceDir)?startX+="L"===sourceDir?-groupEdgeShift:groupEdgeShift:startY+="T"===sourceDir?-groupEdgeShift:groupEdgeShift+18),targetGroup&&(isArchitectureDirectionX(targetDir)?endX+="L"===targetDir?-groupEdgeShift:groupEdgeShift:endY+="T"===targetDir?-groupEdgeShift:groupEdgeShift+18),sourceGroup||"junction"!==(null==(_a2=db.getNode(source))?void 0:_a2.type)||(isArchitectureDirectionX(sourceDir)?startX+="L"===sourceDir?halfIconSize:-halfIconSize:startY+="T"===sourceDir?halfIconSize:-halfIconSize),targetGroup||"junction"!==(null==(_b=db.getNode(target))?void 0:_b.type)||(isArchitectureDirectionX(targetDir)?endX+="L"===targetDir?halfIconSize:-halfIconSize:endY+="T"===targetDir?halfIconSize:-halfIconSize),edge[0]._private.rscratch){const g=edgesEl.insert("g");if(g.insert("path").attr("d",`M ${startX},${startY} L ${midX},${midY} L${endX},${endY} `).attr("class","edge").attr("id",`${diagramId}-${getEdgeId(source,target,{prefix:"L"})}`),sourceArrow){const xShift=isArchitectureDirectionX(sourceDir)?ArchitectureDirectionArrowShift[sourceDir](startX,arrowSize):startX-halfArrowSize,yShift=isArchitectureDirectionY(sourceDir)?ArchitectureDirectionArrowShift[sourceDir](startY,arrowSize):startY-halfArrowSize;g.insert("polygon").attr("points",ArchitectureDirectionArrow[sourceDir](arrowSize)).attr("transform",`translate(${xShift},${yShift})`).attr("class","arrow")}if(targetArrow){const xShift=isArchitectureDirectionX(targetDir)?ArchitectureDirectionArrowShift[targetDir](endX,arrowSize):endX-halfArrowSize,yShift=isArchitectureDirectionY(targetDir)?ArchitectureDirectionArrowShift[targetDir](endY,arrowSize):endY-halfArrowSize;g.insert("polygon").attr("points",ArchitectureDirectionArrow[targetDir](arrowSize)).attr("transform",`translate(${xShift},${yShift})`).attr("class","arrow")}if(label){const axis=isArchitectureDirectionXY(sourceDir,targetDir)?"XY":isArchitectureDirectionX(sourceDir)?"X":"Y";let width=0;width="X"===axis?Math.abs(startX-endX):"Y"===axis?Math.abs(startY-endY)/1.5:Math.abs(startX-endX)/2;const textElem=g.append("g");if(await createText(textElem,label,{useHtmlLabels:!1,width:width,classes:"architecture-service-label"},getConfig2()),textElem.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===axis)textElem.attr("transform","translate("+midX+", "+midY+")");else if("Y"===axis)textElem.attr("transform","translate("+midX+", "+midY+") rotate(-90)");else if("XY"===axis){const pair=getArchitectureDirectionPair(sourceDir,targetDir);if(pair&&isArchitecturePairXY(pair)){const bboxOrig=textElem.node().getBoundingClientRect(),[x,y]=getArchitectureDirectionXYFactors(pair);textElem.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*x*y*45})`);const bboxNew=textElem.node().getBoundingClientRect();textElem.attr("transform",`\n translate(${midX}, ${midY-bboxOrig.height/2})\n translate(${x*bboxNew.width/2}, ${y*bboxNew.height/2})\n rotate(${-1*x*y*45}, 0, ${bboxOrig.height/2})\n `)}}}}}))},"drawEdges"),drawGroups=__name(async function(groupsEl,cy,db,diagramId){const groupIconSize=.75*db.getConfigField("padding"),fontSize=db.getConfigField("fontSize"),halfIconSize=db.getConfigField("iconSize")/2;await Promise.all(cy.nodes().map(async node=>{const data=nodeData(node);if("group"===data.type){const{h:h,w:w,x1:x1,y1:y1}=node.boundingBox(),groupsNode=groupsEl.append("rect");groupsNode.attr("id",`${diagramId}-group-${data.id}`).attr("x",x1+halfIconSize).attr("y",y1+halfIconSize).attr("width",w).attr("height",h).attr("class","node-bkg");const groupLabelContainer=groupsEl.append("g");let shiftedX1=x1,shiftedY1=y1;if(data.icon){const bkgElem=groupLabelContainer.append("g");bkgElem.html(`<g>${await getIconSVG(data.icon,{height:groupIconSize,width:groupIconSize,fallbackPrefix:architectureIcons.prefix})}</g>`),bkgElem.attr("transform","translate("+(shiftedX1+halfIconSize+1)+", "+(shiftedY1+halfIconSize+1)+")"),shiftedX1+=groupIconSize,shiftedY1+=fontSize/2-1-2}if(data.label){const textElem=groupLabelContainer.append("g");await createText(textElem,data.label,{useHtmlLabels:!1,width:w,classes:"architecture-service-label"},getConfig2()),textElem.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),textElem.attr("transform","translate("+(shiftedX1+halfIconSize+4)+", "+(shiftedY1+halfIconSize+2)+")")}db.setElementForId(data.id,groupsNode)}}))},"drawGroups"),drawServices=__name(async function(db,elem,services,diagramId){const config=getConfig2();for(const service of services){const serviceElem=elem.append("g"),iconSize=db.getConfigField("iconSize");if(service.title){const textElem=serviceElem.append("g");await createText(textElem,service.title,{useHtmlLabels:!1,width:1.5*iconSize,classes:"architecture-service-label"},config),textElem.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),textElem.attr("transform","translate("+iconSize/2+", "+iconSize+")")}const bkgElem=serviceElem.append("g");if(service.icon)bkgElem.html(`<g>${await getIconSVG(service.icon,{height:iconSize,width:iconSize,fallbackPrefix:architectureIcons.prefix})}</g>`);else if(service.iconText){bkgElem.html(`<g>${await getIconSVG("blank",{height:iconSize,width:iconSize,fallbackPrefix:architectureIcons.prefix})}</g>`);const divElem=bkgElem.append("g").append("foreignObject").attr("width",iconSize).attr("height",iconSize).append("div").attr("class","node-icon-text").attr("style",`height: ${iconSize}px;`).append("div").html(sanitizeText(service.iconText,config)),fontSize=parseInt(window.getComputedStyle(divElem.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;divElem.attr("style",`-webkit-line-clamp: ${Math.floor((iconSize-2)/fontSize)};`)}else bkgElem.append("path").attr("class","node-bkg").attr("id",`${diagramId}-node-${service.id}`).attr("d",`M0,${iconSize} V5 Q0,0 5,0 H${iconSize-5} Q${iconSize},0 ${iconSize},5 V${iconSize} Z`);serviceElem.attr("id",`${diagramId}-service-${service.id}`).attr("class","architecture-service");const{width:width,height:height}=serviceElem.node().getBBox();service.width=width,service.height=height,db.setElementForId(service.id,serviceElem)}return 0},"drawServices"),drawJunctions=__name(function(db,elem,junctions,diagramId){junctions.forEach(junction=>{const junctionElem=elem.append("g"),iconSize=db.getConfigField("iconSize");junctionElem.append("g").append("rect").attr("id",`${diagramId}-node-${junction.id}`).attr("fill-opacity","0").attr("width",iconSize).attr("height",iconSize),junctionElem.attr("class","architecture-junction");const{width:width,height:height}=junctionElem._groups[0][0].getBBox();junctionElem.width=width,junctionElem.height=height,db.setElementForId(junction.id,junctionElem)})},"drawJunctions");function addServices(services,cy,db){services.forEach(service=>{cy.add({group:"nodes",data:{type:"service",id:service.id,icon:service.icon,label:service.title,parent:service.in,width:db.getConfigField("iconSize"),height:db.getConfigField("iconSize")},classes:"node-service"})})}function addJunctions(junctions,cy,db){junctions.forEach(junction=>{cy.add({group:"nodes",data:{type:"junction",id:junction.id,parent:junction.in,width:db.getConfigField("iconSize"),height:db.getConfigField("iconSize")},classes:"node-junction"})})}function positionNodes(db,cy){cy.nodes().map(node=>{const data=nodeData(node);if("group"===data.type)return;data.x=node.position().x,data.y=node.position().y;db.getElementById(data.id).attr("transform","translate("+(data.x||0)+","+(data.y||0)+")")})}function addGroups(groups,cy){groups.forEach(group=>{cy.add({group:"nodes",data:{type:"group",id:group.id,icon:group.icon,label:group.title,parent:group.in},classes:"node-group"})})}function addEdges(edges,cy){edges.forEach(parsedEdge=>{const{lhsId:lhsId,rhsId:rhsId,lhsInto:lhsInto,lhsGroup:lhsGroup,rhsInto:rhsInto,lhsDir:lhsDir,rhsDir:rhsDir,rhsGroup:rhsGroup,title:title}=parsedEdge,edgeType=isArchitectureDirectionXY(parsedEdge.lhsDir,parsedEdge.rhsDir)?"segments":"straight",edge={id:`${lhsId}-${rhsId}`,label:title,source:lhsId,sourceDir:lhsDir,sourceArrow:lhsInto,sourceGroup:lhsGroup,sourceEndpoint:"L"===lhsDir?"0 50%":"R"===lhsDir?"100% 50%":"T"===lhsDir?"50% 0":"50% 100%",target:rhsId,targetDir:rhsDir,targetArrow:rhsInto,targetGroup:rhsGroup,targetEndpoint:"L"===rhsDir?"0 50%":"R"===rhsDir?"100% 50%":"T"===rhsDir?"50% 0":"50% 100%"};cy.add({group:"edges",data:edge,classes:edgeType})})}function getAlignments(db,spatialMaps,groupAlignments){const flattenAlignments=__name((alignmentObj,alignmentDir)=>Object.entries(alignmentObj).reduce((prev,[dir,alignments2])=>{var _a2;let cnt=0;const arr=Object.entries(alignments2);if(1===arr.length)return prev[dir]=arr[0][1],prev;for(let i=0;i<arr.length-1;i++)for(let j=i+1;j<arr.length;j++){const[aGroupId,aNodeIds]=arr[i],[bGroupId,bNodeIds]=arr[j];if((null==(_a2=groupAlignments[aGroupId])?void 0:_a2[bGroupId])===alignmentDir)prev[dir]??(prev[dir]=[]),prev[dir]=[...prev[dir],...aNodeIds,...bNodeIds];else if("default"===aGroupId||"default"===bGroupId)prev[dir]??(prev[dir]=[]),prev[dir]=[...prev[dir],...aNodeIds,...bNodeIds];else{prev[`${dir}-${cnt++}`]=aNodeIds;prev[`${dir}-${cnt++}`]=bNodeIds}}return prev},{}),"flattenAlignments"),alignments=spatialMaps.map(spatialMap=>{const horizontalAlignments={},verticalAlignments={};return Object.entries(spatialMap).forEach(([id,[x,y]])=>{var _a2,_b,_c;const nodeGroup=(null==(_a2=db.getNode(id))?void 0:_a2.in)??"default";horizontalAlignments[y]??(horizontalAlignments[y]={}),(_b=horizontalAlignments[y])[nodeGroup]??(_b[nodeGroup]=[]),horizontalAlignments[y][nodeGroup].push(id),verticalAlignments[x]??(verticalAlignments[x]={}),(_c=verticalAlignments[x])[nodeGroup]??(_c[nodeGroup]=[]),verticalAlignments[x][nodeGroup].push(id)}),{horiz:Object.values(flattenAlignments(horizontalAlignments,"horizontal")).filter(arr=>arr.length>1),vert:Object.values(flattenAlignments(verticalAlignments,"vertical")).filter(arr=>arr.length>1)}}),[horizontal,vertical]=alignments.reduce(([prevHoriz,prevVert],{horiz:horiz,vert:vert})=>[[...prevHoriz,...horiz],[...prevVert,...vert]],[[],[]]);return{horizontal:horizontal,vertical:vertical}}function getRelativeConstraints(spatialMaps,db){const relativeConstraints=[],posToStr=__name(pos=>`${pos[0]},${pos[1]}`,"posToStr"),strToPos=__name(pos=>pos.split(",").map(p=>parseInt(p)),"strToPos");return spatialMaps.forEach(spatialMap=>{const invSpatialMap=Object.fromEntries(Object.entries(spatialMap).map(([id,pos])=>[posToStr(pos),id])),queue=[posToStr([0,0])],visited={},directions={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;queue.length>0;){const curr=queue.shift();if(curr){visited[curr]=1;const currId=invSpatialMap[curr];if(currId){const currPos=strToPos(curr);Object.entries(directions).forEach(([dir,shift])=>{const newPos=posToStr([currPos[0]+shift[0],currPos[1]+shift[1]]),newId=invSpatialMap[newPos];newId&&!visited[newPos]&&(queue.push(newPos),relativeConstraints.push({[ArchitectureDirectionName[dir]]:newId,[ArchitectureDirectionName[getOppositeArchitectureDirection(dir)]]:currId,gap:1.5*db.getConfigField("iconSize")}))})}}}}),relativeConstraints}function layoutArchitecture(services,junctions,groups,edges,db,{spatialMaps:spatialMaps,groupAlignments:groupAlignments}){return new Promise(resolve=>{const renderEl=select("body").append("div").attr("id","cy").attr("style","display:none"),cy=cytoscape$1({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${db.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${db.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});renderEl.remove(),addGroups(groups,cy),addServices(services,cy,db),addJunctions(junctions,cy,db),addEdges(edges,cy);const alignmentConstraint=getAlignments(db,spatialMaps,groupAlignments),relativePlacementConstraint=getRelativeConstraints(spatialMaps,db),layout=cy.layout({name:"fcose",quality:"proof",randomize:db.getConfigField("randomize"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(edge){const[nodeA,nodeB]=edge.connectedNodes(),{parent:parentA}=nodeData(nodeA),{parent:parentB}=nodeData(nodeB);return parentA===parentB?1.5*db.getConfigField("iconSize"):.5*db.getConfigField("iconSize")},edgeElasticity(edge){const[nodeA,nodeB]=edge.connectedNodes(),{parent:parentA}=nodeData(nodeA),{parent:parentB}=nodeData(nodeB);return parentA===parentB?.45:.001},alignmentConstraint:alignmentConstraint,relativePlacementConstraint:relativePlacementConstraint});layout.one("layoutstop",()=>{var _a2;function getSegmentWeights(source,target,pointX,pointY){let W,D;const{x:sX,y:sY}=source,{x:tX,y:tY}=target;D=(pointY-sY+(sX-pointX)*(sY-tY)/(sX-tX))/Math.sqrt(1+Math.pow((sY-tY)/(sX-tX),2)),W=Math.sqrt(Math.pow(pointY-sY,2)+Math.pow(pointX-sX,2)-Math.pow(D,2));W/=Math.sqrt(Math.pow(tX-sX,2)+Math.pow(tY-sY,2));let delta1=(tX-sX)*(pointY-sY)-(tY-sY)*(pointX-sX);switch(!0){case delta1>=0:delta1=1;break;case delta1<0:delta1=-1}let delta2=(tX-sX)*(pointX-sX)+(tY-sY)*(pointY-sY);switch(!0){case delta2>=0:delta2=1;break;case delta2<0:delta2=-1}return D=Math.abs(D)*delta1,W*=delta2,{distances:D,weights:W}}__name(getSegmentWeights,"getSegmentWeights"),cy.startBatch();for(const edge of Object.values(cy.edges()))if(null==(_a2=edge.data)?void 0:_a2.call(edge)){const{x:sX,y:sY}=edge.source().position(),{x:tX,y:tY}=edge.target().position();if(sX!==tX&&sY!==tY){const sEP=edge.sourceEndpoint(),tEP=edge.targetEndpoint(),{sourceDir:sourceDir}=edgeData(edge),[pointX,pointY]=isArchitectureDirectionY(sourceDir)?[sEP.x,tEP.y]:[tEP.x,sEP.y],{weights:weights,distances:distances}=getSegmentWeights(sEP,tEP,pointX,pointY);edge.style("segment-distances",distances),edge.style("segment-weights",weights)}}cy.endBatch(),layout.run()}),layout.run(),cy.ready(e=>{log.info("Ready",e),resolve(cy)})})}registerIconPacks([{name:architectureIcons.prefix,icons:architectureIcons}]),cytoscape$1.use(fcose),__name(addServices,"addServices"),__name(addJunctions,"addJunctions"),__name(positionNodes,"positionNodes"),__name(addGroups,"addGroups"),__name(addEdges,"addEdges"),__name(getAlignments,"getAlignments"),__name(getRelativeConstraints,"getRelativeConstraints"),__name(layoutArchitecture,"layoutArchitecture");var renderer={draw:__name(async(text,id,_version,diagObj)=>{const db=diagObj.db;db.setDiagramId(id);const services=db.getServices(),junctions=db.getJunctions(),groups=db.getGroups(),edges=db.getEdges(),ds=db.getDataStructures(),svg=selectSvgElement(id),edgesElem=svg.append("g");edgesElem.attr("class","architecture-edges");const servicesElem=svg.append("g");servicesElem.attr("class","architecture-services");const groupElem=svg.append("g");groupElem.attr("class","architecture-groups"),await drawServices(db,servicesElem,services,id),drawJunctions(db,servicesElem,junctions,id);const cy=await layoutArchitecture(services,junctions,groups,edges,db,ds);await drawEdges(edgesElem,cy,db,id),await drawGroups(groupElem,cy,db,id),positionNodes(db,cy),setupGraphViewbox(void 0,svg,db.getConfigField("padding"),db.getConfigField("useMaxWidth"))},"draw")},diagram={parser:parser,get db(){return new ArchitectureDB},renderer:renderer,styles:architectureStyles_default};export{diagram};
|