cc-viewer 1.6.183 → 1.6.192

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.
Files changed (135) hide show
  1. package/dist/assets/App-DuGHwadX.js +31 -0
  2. package/dist/assets/{AppHeader-Dc7WvorH.css → AppHeader-D8MCV07q.css} +3 -3
  3. package/dist/assets/AppHeader.module-CozRDKfP.js +573 -0
  4. package/dist/assets/Mobile-Bab634xx.js +10 -0
  5. package/dist/assets/_baseUniq-DJPPdHyT.js +1 -0
  6. package/dist/assets/arc-DZ3Bjq-l.js +1 -0
  7. package/dist/assets/architectureDiagram-Q4EWVU46-xy0J2lr0.js +36 -0
  8. package/dist/assets/blockDiagram-DXYQGD6D-CoUm8UC5.js +132 -0
  9. package/dist/assets/c4Diagram-AHTNJAMY-CFHX4Dfx.js +10 -0
  10. package/dist/assets/channel-G3S1FOvm.js +1 -0
  11. package/dist/assets/chunk-4BX2VUAB-CiktxOyY.js +1 -0
  12. package/dist/assets/chunk-4TB4RGXK-DHl7ZlQV.js +206 -0
  13. package/dist/assets/chunk-55IACEB6-DcgWxDD5.js +1 -0
  14. package/dist/assets/chunk-EDXVE4YY-DeUzWpQx.js +1 -0
  15. package/dist/assets/{chunk-FMBD7UC4-Bb0LARSp.js → chunk-FMBD7UC4-BCaKpugk.js} +2 -2
  16. package/dist/assets/chunk-OYMX7WX6-DKMEMbG9.js +231 -0
  17. package/dist/assets/chunk-QZHKN3VN-BREApeQ-.js +1 -0
  18. package/dist/assets/chunk-YZCP3GAM-BYW1PNda.js +1 -0
  19. package/dist/assets/classDiagram-6PBFFD2Q-B0-7EUsz.js +1 -0
  20. package/dist/assets/classDiagram-v2-HSJHXN6E-B0-7EUsz.js +1 -0
  21. package/dist/assets/clone-CX_D5SrR.js +1 -0
  22. package/dist/assets/cose-bilkent-S5V4N54A-DpwiMCiq.js +1 -0
  23. package/dist/assets/cytoscape.esm-BMgRe88L.js +331 -0
  24. package/dist/assets/dagre-KV5264BT-Dc7qbya2.js +4 -0
  25. package/dist/assets/defaultLocale-CcTwRAjA.js +1 -0
  26. package/dist/assets/diagram-5BDNPKRD-v7FsHeLQ.js +10 -0
  27. package/dist/assets/diagram-G4DWMVQ6-BhKNBlcE.js +24 -0
  28. package/dist/assets/diagram-MMDJMWI5-C-3cRdzG.js +43 -0
  29. package/dist/assets/diagram-TYMM5635-HfNcJIfT.js +24 -0
  30. package/dist/assets/erDiagram-SMLLAGMA-Ckj0dkk7.js +85 -0
  31. package/dist/assets/flowDiagram-DWJPFMVM-yf315tJr.js +162 -0
  32. package/dist/assets/ganttDiagram-T4ZO3ILL-Ch2bINVC.js +292 -0
  33. package/dist/assets/gitGraphDiagram-UUTBAWPF-CesdgsJi.js +106 -0
  34. package/dist/assets/graph-CRpmapJV.js +1 -0
  35. package/dist/assets/html2canvas.esm-B8c0f9Wq.js +22 -0
  36. package/dist/assets/index-DJ0iGKLy.js +2 -0
  37. package/dist/assets/infoDiagram-42DDH7IO-CuD16P9Y.js +2 -0
  38. package/dist/assets/init-C7FSzFHJ.js +1 -0
  39. package/dist/assets/ishikawaDiagram-UXIWVN3A-4y8aG54G.js +70 -0
  40. package/dist/assets/journeyDiagram-VCZTEJTY-B6TtR2Zk.js +139 -0
  41. package/dist/assets/kanban-definition-6JOO6SKY-DTcNHYUS.js +89 -0
  42. package/dist/assets/katex-CJRKSY_b.js +257 -0
  43. package/dist/assets/layout-CX5hpkD2.js +1 -0
  44. package/dist/assets/linear-tWlC-NXc.js +1 -0
  45. package/dist/assets/mermaid.core-DNvsWVDx.js +308 -0
  46. package/dist/assets/min-CDExe3RN.js +1 -0
  47. package/dist/assets/mindmap-definition-QFDTVHPH-CW0yNQcb.js +96 -0
  48. package/dist/assets/ordinal-aRyHI6gl.js +1 -0
  49. package/dist/assets/pieDiagram-DEJITSTG-DNrnOqmz.js +30 -0
  50. package/dist/assets/quadrantDiagram-34T5L4WZ-Cl176vnh.js +7 -0
  51. package/dist/assets/requirementDiagram-MS252O5E-DKp3A5f_.js +84 -0
  52. package/dist/assets/sankeyDiagram-XADWPNL6-BMV0lAz8.js +10 -0
  53. package/dist/assets/sequenceDiagram-FGHM5R23-CQ4preep.js +157 -0
  54. package/dist/assets/stateDiagram-FHFEXIEX-BKqYYN8H.js +1 -0
  55. package/dist/assets/stateDiagram-v2-QKLJ7IA2-C1W1ECmZ.js +1 -0
  56. package/dist/assets/timeline-definition-GMOUNBTQ-4kgeuumv.js +120 -0
  57. package/dist/assets/vendor-antd-Dk5s46Ag.js +406 -0
  58. package/dist/assets/vendor-codemirror-DxvDOrio.js +46 -0
  59. package/dist/assets/vendor-highlight-DVwgAdJY.js +3 -0
  60. package/dist/assets/vendor-markdown-DO-Ppp4f.js +60 -0
  61. package/dist/assets/vendor-qrcode-hI5wlAgK.js +9 -0
  62. package/dist/assets/vendor-virtuoso-HW77kTCh.js +1 -0
  63. package/dist/assets/vendor-xterm-D2cUrYEx.js +140 -0
  64. package/dist/assets/vennDiagram-DHZGUBPP-CqBcUIdK.js +34 -0
  65. package/dist/assets/wardley-RL74JXVD-CbEnkKx8.js +162 -0
  66. package/dist/assets/wardleyDiagram-NUSXRM2D-BJrjkZMg.js +20 -0
  67. package/dist/assets/xychartDiagram-5P7HB3ND-D8aBEz8e.js +7 -0
  68. package/dist/index.html +3 -3
  69. package/package.json +1 -1
  70. package/server.js +13 -4
  71. package/dist/assets/App-BHfyP8-J.js +0 -31
  72. package/dist/assets/AppHeader.module-W_78JZt9.js +0 -573
  73. package/dist/assets/Mobile-ca5EOMpN.js +0 -10
  74. package/dist/assets/_baseUniq-DYSZB4Xx.js +0 -1
  75. package/dist/assets/arc-BChSP8hM.js +0 -1
  76. package/dist/assets/architectureDiagram-Q4EWVU46-vlr5Q6DQ.js +0 -36
  77. package/dist/assets/blockDiagram-DXYQGD6D-4C3Amh2i.js +0 -132
  78. package/dist/assets/c4Diagram-AHTNJAMY-wI0efLSs.js +0 -10
  79. package/dist/assets/channel-d8DITadq.js +0 -1
  80. package/dist/assets/chunk-4BX2VUAB-BX9brpDB.js +0 -1
  81. package/dist/assets/chunk-4TB4RGXK-DvFQ-X9V.js +0 -206
  82. package/dist/assets/chunk-55IACEB6-BNmYjPNf.js +0 -1
  83. package/dist/assets/chunk-EDXVE4YY-BNvDPqBE.js +0 -1
  84. package/dist/assets/chunk-OYMX7WX6-BwlvIpeD.js +0 -231
  85. package/dist/assets/chunk-QZHKN3VN-BS6RK8_X.js +0 -1
  86. package/dist/assets/chunk-YZCP3GAM-oOqmydQz.js +0 -1
  87. package/dist/assets/classDiagram-6PBFFD2Q-B1oRrMCc.js +0 -1
  88. package/dist/assets/classDiagram-v2-HSJHXN6E-B1oRrMCc.js +0 -1
  89. package/dist/assets/clone-BrNOd7Lq.js +0 -1
  90. package/dist/assets/cose-bilkent-S5V4N54A-CamsIqkY.js +0 -1
  91. package/dist/assets/cytoscape.esm-DxGcaOPV.js +0 -331
  92. package/dist/assets/dagre-KV5264BT-CPAWWiBh.js +0 -4
  93. package/dist/assets/defaultLocale-DX6XiGOO.js +0 -1
  94. package/dist/assets/diagram-5BDNPKRD-D6TmzGhl.js +0 -10
  95. package/dist/assets/diagram-G4DWMVQ6-DDuJnMCL.js +0 -24
  96. package/dist/assets/diagram-MMDJMWI5-CQWhvrpz.js +0 -43
  97. package/dist/assets/diagram-TYMM5635-CEDj3w_h.js +0 -24
  98. package/dist/assets/erDiagram-SMLLAGMA-B_eQqha6.js +0 -85
  99. package/dist/assets/flowDiagram-DWJPFMVM-B985i3uQ.js +0 -162
  100. package/dist/assets/ganttDiagram-T4ZO3ILL-DKp62vr3.js +0 -292
  101. package/dist/assets/gitGraphDiagram-UUTBAWPF-Cc1gyz1Q.js +0 -106
  102. package/dist/assets/graph-C-1-3bsA.js +0 -1
  103. package/dist/assets/html2canvas.esm-QH1iLAAe.js +0 -22
  104. package/dist/assets/index-LH2WLu05.js +0 -2
  105. package/dist/assets/infoDiagram-42DDH7IO-DqXaAHZz.js +0 -2
  106. package/dist/assets/init-Gi6I4Gst.js +0 -1
  107. package/dist/assets/ishikawaDiagram-UXIWVN3A-zdUdDJX2.js +0 -70
  108. package/dist/assets/journeyDiagram-VCZTEJTY-ip5SzODy.js +0 -139
  109. package/dist/assets/kanban-definition-6JOO6SKY-D5EYh6AP.js +0 -89
  110. package/dist/assets/katex-DkKDou_j.js +0 -257
  111. package/dist/assets/layout-Cjq8AL8G.js +0 -1
  112. package/dist/assets/linear-U0KsEJ2u.js +0 -1
  113. package/dist/assets/mermaid.core-CT-5crLN.js +0 -308
  114. package/dist/assets/min-C7G6pq26.js +0 -1
  115. package/dist/assets/mindmap-definition-QFDTVHPH-CIzhFOw1.js +0 -96
  116. package/dist/assets/ordinal-Cboi1Yqb.js +0 -1
  117. package/dist/assets/pieDiagram-DEJITSTG-Cp1Zd1MQ.js +0 -30
  118. package/dist/assets/quadrantDiagram-34T5L4WZ-Cp31xM90.js +0 -7
  119. package/dist/assets/requirementDiagram-MS252O5E-Dbg_eQqB.js +0 -84
  120. package/dist/assets/sankeyDiagram-XADWPNL6-CMrzwpwC.js +0 -10
  121. package/dist/assets/sequenceDiagram-FGHM5R23-KJegoBnN.js +0 -157
  122. package/dist/assets/stateDiagram-FHFEXIEX-BDWprYzE.js +0 -1
  123. package/dist/assets/stateDiagram-v2-QKLJ7IA2-CCUmB0qI.js +0 -1
  124. package/dist/assets/timeline-definition-GMOUNBTQ-BOWeG5LY.js +0 -120
  125. package/dist/assets/vendor-antd-CtdKd5xs.js +0 -406
  126. package/dist/assets/vendor-codemirror-CdXaVX4e.js +0 -46
  127. package/dist/assets/vendor-highlight-D4ATuRwX.js +0 -3
  128. package/dist/assets/vendor-markdown-CO-jRjTB.js +0 -60
  129. package/dist/assets/vendor-qrcode-D05RfzwB.js +0 -9
  130. package/dist/assets/vendor-virtuoso-BhnFrbmh.js +0 -1
  131. package/dist/assets/vendor-xterm-DWMOrwSy.js +0 -140
  132. package/dist/assets/vennDiagram-DHZGUBPP-B6mLodPk.js +0 -34
  133. package/dist/assets/wardley-RL74JXVD-CovHs24Z.js +0 -162
  134. package/dist/assets/wardleyDiagram-NUSXRM2D-CBg_VXF7.js +0 -20
  135. package/dist/assets/xychartDiagram-5P7HB3ND-BRxgk_oX.js +0 -7
@@ -0,0 +1 @@
1
+ import{_ as __name,l as log,d as select}from"./mermaid.core-DNvsWVDx.js";import{c as cytoscape$1}from"./cytoscape.esm-BMgRe88L.js";import{g as getDefaultExportFromCjs}from"./vendor-antd-Dk5s46Ag.js";import"./index-DJ0iGKLy.js";import"./vendor-codemirror-DxvDOrio.js";import"./vendor-markdown-DO-Ppp4f.js";var cytoscapeCoseBilkent$1={exports:{}},coseBase$1={exports:{}},layoutBase$1={exports:{}},layoutBase=layoutBase$1.exports,hasRequiredLayoutBase;function requireLayoutBase(){return hasRequiredLayoutBase||(hasRequiredLayoutBase=1,(function(module,exports$1){(function(root,factory){module.exports=factory()})(layoutBase,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=26)})([(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}LEdge.prototype=Object.create(LGraphObject.prototype);for(var prop in 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__){function LGraphObject(vGraphObject){this.vGraphObject=vGraphObject}module2.exports=LGraphObject}),(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__(4);function LNode(gm,loc,size,vNode){size==null&&vNode==null&&(vNode=loc),LGraphObject.call(this,vNode),gm.graphManager!=null&&(gm=gm.graphManager),this.estimatedSize=Integer.MIN_VALUE,this.inclusionTreeDepth=Integer.MAX_VALUE,this.vGraphObject=vNode,this.edges=[],this.graphManager=gm,size!=null&&loc!=null?this.rect=new RectangleD(loc.x,loc.y,size.width,size.height):this.rect=new RectangleD}LNode.prototype=Object.create(LGraphObject.prototype);for(var prop in 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,childNode,children;if(withNeighborsList.add(this),this.child!=null)for(var nodes=this.child.getNodes(),i=0;i<nodes.length;i++)childNode=nodes[i],children=childNode.withChildren(),children.forEach(function(node){withNeighborsList.add(node)});return withNeighborsList},LNode.prototype.getNoOfChildren=function(){var noOfChildren=0,childNode;if(this.child==null)noOfChildren=1;else for(var nodes=this.child.getNodes(),i=0;i<nodes.length;i++)childNode=nodes[i],noOfChildren+=childNode.getNoOfChildren();return noOfChildren==0&&(noOfChildren=1),noOfChildren},LNode.prototype.getEstimatedSize=function(){if(this.estimatedSize==Integer.MIN_VALUE)throw"assert failed";return this.estimatedSize},LNode.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},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(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){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>width&&(this.rect.x-=(this.labelWidth-width)/2,this.setWidth(this.labelWidth)),this.labelHeight>height&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-height)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-height),this.setHeight(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 this.owner==null?null:this.owner.getParent()},module2.exports=LNode}),(function(module2,exports$12,__webpack_require__){function PointD(x,y){x==null&&y==null?(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__(6),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,obj2!=null&&obj2 instanceof LGraphManager?this.graphManager=obj2:obj2!=null&&obj2 instanceof Layout&&(this.graphManager=obj2.graphManager)}LGraph.prototype=Object.create(LGraphObject.prototype);for(var prop in 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(sourceNode==null&&targetNode==null){var newNode=obj1;if(this.graphManager==null)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}else{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(node==null)throw"Node is null!";if(!(node.owner!=null&&node.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var edgesToBeRemoved=node.edges.slice(),edge,s=edgesToBeRemoved.length,i=0;i<s;i++)edge=edgesToBeRemoved[i],edge.isInterGraph?this.graphManager.remove(edge):edge.source.owner.remove(edge);var index=this.nodes.indexOf(node);if(index==-1)throw"Node not in owner node list!";this.nodes.splice(index,1)}else if(obj instanceof LEdge){var edge=obj;if(edge==null)throw"Edge is null!";if(!(edge.source!=null&&edge.target!=null))throw"Source and/or target is null!";if(!(edge.source.owner!=null&&edge.target.owner!=null&&edge.source.owner==this&&edge.target.owner==this))throw"Source and/or target owner is invalid!";var 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!";edge.source.edges.splice(sourceIndex,1),edge.target!=edge.source&&edge.target.edges.splice(targetIndex,1);var index=edge.source.owner.getEdges().indexOf(edge);if(index==-1)throw"Not in owner's edge list!";edge.source.owner.getEdges().splice(index,1)}},LGraph.prototype.updateLeftTop=function(){for(var top=Integer.MAX_VALUE,left=Integer.MAX_VALUE,nodeTop,nodeLeft,margin,nodes=this.getNodes(),s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];nodeTop=lNode.getTop(),nodeLeft=lNode.getLeft(),top>nodeTop&&(top=nodeTop),left>nodeLeft&&(left=nodeLeft)}return top==Integer.MAX_VALUE?null:(nodes[0].getParent().paddingLeft!=null?margin=nodes[0].getParent().paddingLeft:margin=this.margin,this.left=left-margin,this.top=top-margin,new Point2(this.left,this.top))},LGraph.prototype.updateBounds=function(recursive){for(var left=Integer.MAX_VALUE,right=-Integer.MAX_VALUE,top=Integer.MAX_VALUE,bottom=-Integer.MAX_VALUE,nodeLeft,nodeRight,nodeTop,nodeBottom,margin,nodes=this.nodes,s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];recursive&&lNode.child!=null&&lNode.updateBounds(),nodeLeft=lNode.getLeft(),nodeRight=lNode.getRight(),nodeTop=lNode.getTop(),nodeBottom=lNode.getBottom(),left>nodeLeft&&(left=nodeLeft),right<nodeRight&&(right=nodeRight),top>nodeTop&&(top=nodeTop),bottom<nodeBottom&&(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()),nodes[0].getParent().paddingLeft!=null?margin=nodes[0].getParent().paddingLeft:margin=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 left=Integer.MAX_VALUE,right=-Integer.MAX_VALUE,top=Integer.MAX_VALUE,bottom=-Integer.MAX_VALUE,nodeLeft,nodeRight,nodeTop,nodeBottom,s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];nodeLeft=lNode.getLeft(),nodeRight=lNode.getRight(),nodeTop=lNode.getTop(),nodeBottom=lNode.getBottom(),left>nodeLeft&&(left=nodeLeft),right<nodeRight&&(right=nodeRight),top>nodeTop&&(top=nodeTop),bottom<nodeBottom&&(bottom=nodeBottom)}var boundingRect=new RectangleD(left,top,right-left,bottom-top);return boundingRect},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++){var lNode=nodes[i];size+=lNode.calcEstimatedSize()}return size==0?this.estimatedSize=LayoutConstants.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=size/Math.sqrt(this.nodes.length),this.estimatedSize},LGraph.prototype.updateConnected=function(){var self=this;if(this.nodes.length==0){this.isConnected=!0;return}var queue=new LinkedList,visited=new Set,currentNode=this.nodes[0],neighborEdges,currentNeighbor,childrenOfNode=currentNode.withChildren();for(childrenOfNode.forEach(function(node){queue.push(node),visited.add(node)});queue.length!==0;){currentNode=queue.shift(),neighborEdges=currentNode.getEdges();for(var size=neighborEdges.length,i=0;i<size;i++){var neighborEdge=neighborEdges[i];if(currentNeighbor=neighborEdge.getOtherEndInGraph(currentNode,this),currentNeighbor!=null&&!visited.has(currentNeighbor)){var childrenOfNeighbor=currentNeighbor.withChildren();childrenOfNeighbor.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)}},module2.exports=LGraph}),(function(module2,exports$12,__webpack_require__){var LGraph,LEdge=__webpack_require__(1);function LGraphManager(layout){LGraph=__webpack_require__(5),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(newEdge==null&&sourceNode==null&&targetNode==null){if(newGraph==null)throw"Graph is null!";if(parentNode==null)throw"Parent node is null!";if(this.graphs.indexOf(newGraph)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(newGraph),newGraph.parent!=null)throw"Already has a parent!";if(parentNode.child!=null)throw"Already has a child!";return newGraph.parent=parentNode,parentNode.child=newGraph,newGraph}else{targetNode=newEdge,sourceNode=parentNode,newEdge=newGraph;var sourceGraph=sourceNode.getOwner(),targetGraph=targetNode.getOwner();if(!(sourceGraph!=null&&sourceGraph.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(targetGraph!=null&&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),!(newEdge.source!=null&&newEdge.target!=null))throw"Edge source and/or target is null!";if(!(newEdge.source.edges.indexOf(newEdge)==-1&&newEdge.target.edges.indexOf(newEdge)==-1))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||graph.parent!=null&&graph.parent.graphManager==this))throw"Invalid parent node!";var edgesToBeRemoved=[];edgesToBeRemoved=edgesToBeRemoved.concat(graph.getEdges());for(var edge,s=edgesToBeRemoved.length,i=0;i<s;i++)edge=edgesToBeRemoved[i],graph.remove(edge);var nodesToBeRemoved=[];nodesToBeRemoved=nodesToBeRemoved.concat(graph.getNodes());var node;s=nodesToBeRemoved.length;for(var 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(edge=lObj,edge==null)throw"Edge is null!";if(!edge.isInterGraph)throw"Not an inter-graph edge!";if(!(edge.source!=null&&edge.target!=null))throw"Source and/or target is null!";if(!(edge.source.edges.indexOf(edge)!=-1&&edge.target.edges.indexOf(edge)!=-1))throw"Source and/or target doesn't know this edge!";var index=edge.source.edges.indexOf(edge);if(edge.source.edges.splice(index,1),index=edge.target.edges.indexOf(edge),edge.target.edges.splice(index,1),!(edge.source.owner!=null&&edge.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(edge.source.owner.getGraphManager().edges.indexOf(edge)==-1)throw"Not in owner graph manager's edge list!";var 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(this.allNodes==null){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(this.allEdges==null){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(this.allNodesToApplyGravitation!=null)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,graph.parent==null&&(graph.parent=this.layout.newNode("Root node"))},LGraphManager.prototype.getLayout=function(){return this.layout},LGraphManager.prototype.isOneAncestorOfOther=function(firstNode,secondNode){if(!(firstNode!=null&&secondNode!=null))throw"assert failed";if(firstNode==secondNode)return!0;var ownerGraph=firstNode.getOwner(),parentNode;do{if(parentNode=ownerGraph.getParent(),parentNode==null)break;if(parentNode==secondNode)return!0;if(ownerGraph=parentNode.getOwner(),ownerGraph==null)break}while(!0);ownerGraph=secondNode.getOwner();do{if(parentNode=ownerGraph.getParent(),parentNode==null)break;if(parentNode==firstNode)return!0;if(ownerGraph=parentNode.getOwner(),ownerGraph==null)break}while(!0);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(edge=edges[i],sourceNode=edge.source,targetNode=edge.target,edge.lca=null,edge.sourceInLca=sourceNode,edge.targetInLca=targetNode,sourceNode==targetNode){edge.lca=sourceNode.getOwner();continue}for(sourceAncestorGraph=sourceNode.getOwner();edge.lca==null;){for(edge.targetInLca=targetNode,targetAncestorGraph=targetNode.getOwner();edge.lca==null;){if(targetAncestorGraph==sourceAncestorGraph){edge.lca=targetAncestorGraph;break}if(targetAncestorGraph==this.rootGraph)break;if(edge.lca!=null)throw"assert failed";edge.targetInLca=targetAncestorGraph.getParent(),targetAncestorGraph=edge.targetInLca.getOwner()}if(sourceAncestorGraph==this.rootGraph)break;edge.lca==null&&(edge.sourceInLca=sourceAncestorGraph.getParent(),sourceAncestorGraph=edge.sourceInLca.getOwner())}if(edge.lca==null)throw"assert failed"}},LGraphManager.prototype.calcLowestCommonAncestor=function(firstNode,secondNode){if(firstNode==secondNode)return firstNode.getOwner();var firstOwnerGraph=firstNode.getOwner();do{if(firstOwnerGraph==null)break;var secondOwnerGraph=secondNode.getOwner();do{if(secondOwnerGraph==null)break;if(secondOwnerGraph==firstOwnerGraph)return secondOwnerGraph;secondOwnerGraph=secondOwnerGraph.getParent().getOwner()}while(!0);firstOwnerGraph=firstOwnerGraph.getParent().getOwner()}while(!0);return firstOwnerGraph},LGraphManager.prototype.calcInclusionTreeDepths=function(graph,depth){graph==null&&depth==null&&(graph=this.rootGraph,depth=1);for(var node,nodes=graph.getNodes(),s=nodes.length,i=0;i<s;i++)node=nodes[i],node.inclusionTreeDepth=depth,node.child!=null&&this.calcInclusionTreeDepths(node.child,depth+1)},LGraphManager.prototype.includesInvalidEdge=function(){for(var edge,s=this.edges.length,i=0;i<s;i++)if(edge=this.edges[i],this.isOneAncestorOfOther(edge.source,edge.target))return!0;return!1},module2.exports=LGraphManager}),(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=FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,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__){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;break}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;break}}return!1},IGeometry.getCardinalDirection=function(slope,slopePrime,line){return slope>slopePrime?line:1+line%4},IGeometry.getIntersection=function(s1,s2,f1,f2){if(f2==null)return this.getIntersection2(s1,s2,f1);var x1=s1.x,y1=s1.y,x2=s2.x,y2=s2.y,x3=f1.x,y3=f1.y,x4=f2.x,y4=f2.y,x=void 0,y=void 0,a1=void 0,a2=void 0,b1=void 0,b2=void 0,c1=void 0,c2=void 0,denom=void 0;return a1=y2-y1,b1=x1-x2,c1=x2*y1-x1*y2,a2=y4-y3,b2=x3-x4,c2=x4*y3-x3*y4,denom=a1*b2-a2*b1,denom===0?null:(x=(b1*c2-b2*c1)/denom,y=(a2*c1-a1*c2)/denom,new Point2(x,y))},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)):Ny<Cy?C_angle=this.ONE_AND_HALF_PI:C_angle=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(det===0)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.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}})();function _classCallCheck(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var nodeFrom=function(value){return{value,next:null,prev:null}},add=function(prev,node,next2,list){return prev!==null?prev.next=node:list.head=node,next2!==null?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 prev!==null?prev.next=next2:list.head=next2,next2!==null?next2.prev=prev:list.tail=prev,node.prev=node.next=null,list.length--,node},LinkedList=(function(){function LinkedList2(vals){var _this=this;_classCallCheck(this,LinkedList2),this.length=0,this.head=null,this.tail=null,vals!=null&&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,x==null&&y==null&&p==null?(this.x=0,this.y=0):typeof x=="number"&&typeof y=="number"&&p==null?(this.x=x,this.y=y):x.constructor.name=="Point"&&y==null&&p==null&&(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){x.constructor.name=="Point"&&y==null&&p==null?(p=x,this.setLocation(p.x,p.y)):typeof x=="number"&&typeof y=="number"&&p==null&&(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(obj.constructor.name=="Point"){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,x!=null&&y!=null&&width!=null&&height!=null&&(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=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol=="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};function UniqueIDGeneretor(){}UniqueIDGeneretor.lastID=0,UniqueIDGeneretor.createID=function(obj){return UniqueIDGeneretor.isPrimitive(obj)?obj:(obj.uniqueID!=null||(obj.uniqueID=UniqueIDGeneretor.getString(),UniqueIDGeneretor.lastID++),obj.uniqueID)},UniqueIDGeneretor.getString=function(id){return id==null&&(id=UniqueIDGeneretor.lastID),"Object#"+id},UniqueIDGeneretor.isPrimitive=function(arg){var type=typeof arg>"u"?"undefined":_typeof(arg);return arg==null||type!="object"&&type!="function"},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}else return Array.from(arr)}var LayoutConstants=__webpack_require__(0),LGraphManager=__webpack_require__(6),LNode=__webpack_require__(3),LEdge=__webpack_require__(1),LGraph=__webpack_require__(5),PointD=__webpack_require__(4),Transform=__webpack_require__(17),Emitter=__webpack_require__(27);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,isRemoteUse!=null&&(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 this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},Layout2.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var isLayoutSuccessfull;return this.checkLayoutSuccess()?isLayoutSuccessfull=!1:isLayoutSuccessfull=this.layout(),LayoutConstants.ANIMATE==="during"?!1:(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];for(var nodes=this.graphManager.getRoot().getNodes(),i=0;i<nodes.length;i++)nodes[i];this.update(this.graphManager.getRoot())}},Layout2.prototype.update=function(obj){if(obj==null)this.update2();else if(obj instanceof LNode){var node=obj;if(node.getChild()!=null)for(var nodes=node.getChild().getNodes(),i=0;i<nodes.length;i++)update(nodes[i]);if(node.vGraphObject!=null){var vNode=node.vGraphObject;vNode.update(node)}}else if(obj instanceof LEdge){var edge=obj;if(edge.vGraphObject!=null){var vEdge=edge.vGraphObject;vEdge.update(edge)}}else if(obj instanceof LGraph){var graph=obj;if(graph.vGraphObject!=null){var vGraph=graph.vGraphObject;vGraph.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(newLeftTop==null)this.transform(new PointD(0,0));else{var trans=new Transform,leftTop=this.graphManager.getRoot().updateLeftTop();if(leftTop!=null){trans.setWorldOrgX(newLeftTop.x),trans.setWorldOrgY(newLeftTop.y),trans.setDeviceOrgX(leftTop.x),trans.setDeviceOrgY(leftTop.y);for(var nodes=this.getAllNodes(),node,i=0;i<nodes.length;i++)node=nodes[i],node.transform(trans)}}},Layout2.prototype.positionNodesRandomly=function(graph){if(graph==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var lNode,childGraph,nodes=graph.getNodes(),i=0;i<nodes.length;i++)lNode=nodes[i],childGraph=lNode.getChild(),childGraph==null||childGraph.getNodes().length==0?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++)allNodes[i].getChild()!=null&&(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);for(var neighborEdges=currentNode.getEdges(),i=0;i<neighborEdges.length;i++){var currentNeighbor=neighborEdges[i].getOtherEnd(currentNode);if(parents.get(currentNode)!=currentNeighbor)if(!visited.has(currentNeighbor))toBeVisited.push(currentNeighbor),parents.set(currentNeighbor,currentNode);else{isForest=!1;break}}}if(!isForest)flatForest=[];else{var temp=[].concat(_toConsumableArray(visited));flatForest.push(temp);for(var 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}}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}var dummyEdge=this.newEdge(null);return 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(minDiv!=null&&maxMul!=null){var value=defaultValue;if(sliderValue<=50){var minValue=defaultValue/minDiv;value-=(defaultValue-minValue)/50*(50-sliderValue)}else{var maxValue=defaultValue*maxMul;value+=(maxValue-defaultValue)/50*(sliderValue-50)}return value}else{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;(list.length==1||list.length==2)&&(foundCenter=!0,centerNode=list[0]);for(var i=0;i<list.length;i++){var node=list[i],degree=node.getNeighborsList().size;remainingDegrees.set(node,node.getNeighborsList().size),degree==1&&removedNodes.push(node)}var tempList=[];for(tempList=tempList.concat(removedNodes);!foundCenter;){var tempList2=[];tempList2=tempList2.concat(tempList),tempList=[];for(var i=0;i<list.length;i++){var node=list[i],index=list.indexOf(node);index>=0&&list.splice(index,1);var neighbours=node.getNeighborsList();neighbours.forEach(function(neighbour){if(removedNodes.indexOf(neighbour)<0){var otherDegree=remainingDegrees.get(neighbour),newDegree=otherDegree-1;newDegree==1&&tempList.push(neighbour),remainingDegrees.set(neighbour,newDegree)}})}removedNodes=removedNodes.concat(tempList),(list.length==1||list.length==2)&&(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=Math.sin(RandomSeed.seed++)*1e4,RandomSeed.x-Math.floor(RandomSeed.x)},module2.exports=RandomSeed}),(function(module2,exports$12,__webpack_require__){var PointD=__webpack_require__(4);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 worldExtX!=0&&(xDevice=this.ldeviceOrgX+(x-this.lworldOrgX)*this.ldeviceExtX/worldExtX),xDevice},Transform.prototype.transformY=function(y){var yDevice=0,worldExtY=this.lworldExtY;return worldExtY!=0&&(yDevice=this.ldeviceOrgY+(y-this.lworldOrgY)*this.ldeviceExtY/worldExtY),yDevice},Transform.prototype.inverseTransformX=function(x){var xWorld=0,deviceExtX=this.ldeviceExtX;return deviceExtX!=0&&(xWorld=this.lworldOrgX+(x-this.ldeviceOrgX)*this.lworldExtX/deviceExtX),xWorld},Transform.prototype.inverseTransformY=function(y){var yWorld=0,deviceExtY=this.ldeviceExtY;return deviceExtY!=0&&(yWorld=this.lworldOrgY+(y-this.ldeviceOrgY)*this.lworldExtY/deviceExtY),yWorld},Transform.prototype.inverseTransformPoint=function(inPoint){var outPoint=new PointD(this.inverseTransformX(inPoint.x),this.inverseTransformY(inPoint.y));return outPoint},module2.exports=Transform}),(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}else return Array.from(arr)}var Layout2=__webpack_require__(15),FDLayoutConstants=__webpack_require__(7),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.idealEdgeLength=FDLayoutConstants.DEFAULT_EDGE_LENGTH,this.springConstant=FDLayoutConstants.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=FDLayoutConstants.DEFAULT_REPULSION_STRENGTH,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}FDLayout.prototype=Object.create(Layout2.prototype);for(var prop in 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,lcaDepth,source,target,sizeOfSourceInLca,sizeOfTargetInLca,allEdges=this.getGraphManager().getAllEdges(),i=0;i<allEdges.length;i++)edge=allEdges[i],edge.idealLength=this.idealEdgeLength,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+=FDLayoutConstants.DEFAULT_EDGE_LENGTH*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(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},FDLayout.prototype.calcSpringForces=function(){for(var lEdges=this.getAllEdges(),edge,i=0;i<lEdges.length;i++)edge=lEdges[i],this.calcSpringForce(edge,edge.idealLength)},FDLayout.prototype.calcRepulsionForces=function(){var gridUpdateAllowed=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,forceToNodeSurroundingUpdate=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i,j,nodeA,nodeB,lNodes=this.getAllNodes(),processedNodeSet;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(),node,i=0;i<lNodes.length;i++)node=lNodes[i],node.move()},FDLayout.prototype.calcSpringForce=function(edge,idealLength){var sourceNode=edge.getSource(),targetNode=edge.getTarget(),length,springForce,springForceX,springForceY;if(this.uniformLeafNodeSizes&&sourceNode.getChild()==null&&targetNode.getChild()==null)edge.updateLengthSimple();else if(edge.updateLength(),edge.isOverlapingSourceAndTarget)return;length=edge.getLength(),length!=0&&(springForce=this.springConstant*(length-idealLength),springForceX=springForce*(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 rectA=nodeA.getRect(),rectB=nodeB.getRect(),overlapAmount=new Array(2),clipPoints=new Array(4),distanceX,distanceY,distanceSquared,distance,repulsionForce,repulsionForceX,repulsionForceY;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&&nodeA.getChild()==null&&nodeB.getChild()==null?(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),repulsionForce=this.repulsionConstant*nodeA.noOfChildren*nodeB.noOfChildren/distanceSquared,repulsionForceX=repulsionForce*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;ownerGraph=node.getOwner(),ownerCenterX=(ownerGraph.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()?(estimatedSize=ownerGraph.getEstimatedSize()*this.gravityRangeFactor,(absDistanceX>estimatedSize||absDistanceY>estimatedSize)&&(node.gravitationForceX=-this.gravityConstant*distanceX,node.gravitationForceY=-this.gravityConstant*distanceY)):(estimatedSize=ownerGraph.getEstimatedSize()*this.compoundGravityRangeFactor,(absDistanceX>estimatedSize||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],node.noOfChildren=node.getNoOfChildren()},FDLayout.prototype.calcGrid=function(graph){var sizeX=0,sizeY=0;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(var 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=0,finishX=0,startY=0,finishY=0;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 surrounding=new Set;nodeA.surrounding=new Array;for(var nodeB,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(_toConsumableArray(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__(7);function FDLayoutEdge(source,target,vEdge){LEdge.call(this,source,target,vEdge),this.idealLength=FDLayoutConstants.DEFAULT_EDGE_LENGTH}FDLayoutEdge.prototype=Object.create(LEdge.prototype);for(var prop in LEdge)FDLayoutEdge[prop]=LEdge[prop];module2.exports=FDLayoutEdge}),(function(module2,exports$12,__webpack_require__){var LNode=__webpack_require__(3);function FDLayoutNode(gm,loc,size,vNode){LNode.call(this,gm,loc,size,vNode),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=[]}FDLayoutNode.prototype=Object.create(LNode.prototype);for(var prop in 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,width!==null&&height!==null&&(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),this.map[key]!=null},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 this.size()===0},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__){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}})();function _classCallCheck(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var LinkedList=__webpack_require__(11),Quicksort=(function(){function Quicksort2(A,compareFunction){_classCallCheck(this,Quicksort2),(compareFunction!==null||compareFunction!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var length=void 0;A instanceof LinkedList?length=A.size():length=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)this._swap(A,i,j),i++,j--;else return 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__){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}})();function _classCallCheck(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var NeedlemanWunsch=(function(){function NeedlemanWunsch2(sequence1,sequence2){var match_score=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,mismatch_penalty=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,gap_penalty=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;_classCallCheck(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 diag=void 0;this.sequence1[_i2-1]===this.sequence2[_j2-1]?diag=this.grid[_i2-1][_j2-1]+this.match_score:diag=this.grid[_i2-1][_j2-1]+this.mismatch_penalty;var up=this.grid[_i2-1][_j2]+this.gap_penalty,left=this.grid[_i2][_j2-1]+this.gap_penalty,maxOf=[diag,up,left],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}),current.pos[0]===0&&current.pos[1]===0&&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;(i=arr.indexOf(val,i+1))!==-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__(7),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__(4),layoutBase2.RandomSeed=__webpack_require__(16),layoutBase2.RectangleD=__webpack_require__(13),layoutBase2.Transform=__webpack_require__(17),layoutBase2.UniqueIDGeneretor=__webpack_require__(14),layoutBase2.Quicksort=__webpack_require__(24),layoutBase2.LinkedList=__webpack_require__(11),layoutBase2.LGraphObject=__webpack_require__(2),layoutBase2.LGraph=__webpack_require__(5),layoutBase2.LEdge=__webpack_require__(1),layoutBase2.LGraphManager=__webpack_require__(6),layoutBase2.LNode=__webpack_require__(3),layoutBase2.Layout=__webpack_require__(15),layoutBase2.LayoutConstants=__webpack_require__(0),layoutBase2.NeedlemanWunsch=__webpack_require__(25),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,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)),layoutBase$1.exports}var coseBase=coseBase$1.exports,hasRequiredCoseBase;function requireCoseBase(){return hasRequiredCoseBase||(hasRequiredCoseBase=1,(function(module,exports$1){(function(root,factory){module.exports=factory(requireLayoutBase())})(coseBase,function(__WEBPACK_EXTERNAL_MODULE_0__){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=7)})([(function(module2,exports$12){module2.exports=__WEBPACK_EXTERNAL_MODULE_0__}),(function(module2,exports$12,__webpack_require__){var FDLayoutConstants=__webpack_require__(0).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.TREE_REDUCTION_ON_INCREMENTAL=!1,module2.exports=CoSEConstants}),(function(module2,exports$12,__webpack_require__){var FDLayoutEdge=__webpack_require__(0).FDLayoutEdge;function CoSEEdge(source,target,vEdge){FDLayoutEdge.call(this,source,target,vEdge)}CoSEEdge.prototype=Object.create(FDLayoutEdge.prototype);for(var prop in FDLayoutEdge)CoSEEdge[prop]=FDLayoutEdge[prop];module2.exports=CoSEEdge}),(function(module2,exports$12,__webpack_require__){var LGraph=__webpack_require__(0).LGraph;function CoSEGraph(parent,graphMgr,vGraph){LGraph.call(this,parent,graphMgr,vGraph)}CoSEGraph.prototype=Object.create(LGraph.prototype);for(var prop in LGraph)CoSEGraph[prop]=LGraph[prop];module2.exports=CoSEGraph}),(function(module2,exports$12,__webpack_require__){var LGraphManager=__webpack_require__(0).LGraphManager;function CoSEGraphManager(layout){LGraphManager.call(this,layout)}CoSEGraphManager.prototype=Object.create(LGraphManager.prototype);for(var prop in LGraphManager)CoSEGraphManager[prop]=LGraphManager[prop];module2.exports=CoSEGraphManager}),(function(module2,exports$12,__webpack_require__){var FDLayoutNode=__webpack_require__(0).FDLayoutNode,IMath=__webpack_require__(0).IMath;function CoSENode(gm,loc,size,vNode){FDLayoutNode.call(this,gm,loc,size,vNode)}CoSENode.prototype=Object.create(FDLayoutNode.prototype);for(var prop in FDLayoutNode)CoSENode[prop]=FDLayoutNode[prop];CoSENode.prototype.move=function(){var layout=this.graphManager.getLayout();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==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(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.propogateDisplacementToChildren=function(dX,dY){for(var nodes=this.getChild().getNodes(),node,i=0;i<nodes.length;i++)node=nodes[i],node.getChild()==null?(node.moveBy(dX,dY),node.displacementX+=dX,node.displacementY+=dY):node.propogateDisplacementToChildren(dX,dY)},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}),(function(module2,exports$12,__webpack_require__){var FDLayout=__webpack_require__(0).FDLayout,CoSEGraphManager=__webpack_require__(4),CoSEGraph=__webpack_require__(3),CoSENode=__webpack_require__(5),CoSEEdge=__webpack_require__(2),CoSEConstants=__webpack_require__(1),FDLayoutConstants=__webpack_require__(0).FDLayoutConstants,LayoutConstants=__webpack_require__(0).LayoutConstants,Point2=__webpack_require__(0).Point,PointD=__webpack_require__(0).PointD,Layout2=__webpack_require__(0).Layout,Integer=__webpack_require__(0).Integer,IGeometry=__webpack_require__(0).IGeometry,LGraph=__webpack_require__(0).LGraph,Transform=__webpack_require__(0).Transform;function CoSELayout(){FDLayout.call(this),this.toBeTiled={}}CoSELayout.prototype=Object.create(FDLayout.prototype);for(var prop in 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.springConstant=FDLayoutConstants.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=FDLayoutConstants.DEFAULT_REPULSION_STRENGTH,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,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/FDLayoutConstants.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=FDLayoutConstants.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},CoSELayout.prototype.layout=function(){var createBendsAsNeeded=LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;return createBendsAsNeeded&&(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){if(CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL){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)}}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 this.initSpringEmbedder(),this.runSpringEmbedder(),!0},CoSELayout.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%FDLayoutConstants.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var allNodes=new Set(this.getAllNodes()),intersection=this.nodesWithGravity.filter(function(x){return allNodes.has(x)});this.graphManager.setAllNodesToApplyGravitation(intersection),this.graphManager.updateBounds(),this.updateGrid(),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()),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,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(FDLayoutConstants.ANIMATE==="during")this.emit("layoutstarted");else{for(;!layoutEnded;)layoutEnded=this.tick();this.graphManager.updateBounds()}},CoSELayout.prototype.calculateNodesToApplyGravitationTo=function(){var nodeList=[],graph,graphs=this.graphManager.getGraphs(),size=graphs.length,i;for(i=0;i<size;i++)graph=graphs[i],graph.updateConnected(),graph.isConnected||(nodeList=nodeList.concat(graph.getNodes()));return nodeList},CoSELayout.prototype.createBendpoints=function(){var edges=[];edges=edges.concat(this.graphManager.getAllEdges());var visited=new Set,i;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.concat(source.getEdgeListToNode(target)),edgeList=edgeList.concat(target.getEdgeListToNode(source)),!visited.has(edgeList[0])){if(edgeList.length>1){var k;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,i!=0&&(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),point.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++){var node=tree[i];node.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 nodeAngle=(halfInterval+startAngle)%360,teta=nodeAngle*IGeometry.TWO_PI/360,x_=distance*Math.cos(teta),y_=distance*Math.sin(teta);node.setCenter(x_,y_);var neighborEdges=[];neighborEdges=neighborEdges.concat(node.getEdges());var childCount=neighborEdges.length;parentOfNode!=null&&childCount--;for(var branchCount=0,incEdgesCount=neighborEdges.length,startIndex,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--}parentOfNode!=null?startIndex=(neighborEdges.indexOf(edges[0])+1)%incEdgesCount:startIndex=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 node=tree[i],diagonal=node.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 node=allNodes[i],parent=node.getParent();this.getNodeDegreeWithChildren(node)===0&&(parent.id==null||!this.getToBeTiled(parent))&&zeroDegree.push(node)}for(var i=0;i<zeroDegree.length;i++){var node=zeroDegree[i],p_id=node.getParent().id;typeof tempMemberGroups[p_id]>"u"&&(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];tiledZeroDegreePack[id]=self.tileNodes(self.memberGroups[id],compoundNode.paddingLeft+compoundNode.paddingRight),compoundNode.rect.width=tiledZeroDegreePack[id].width,compoundNode.rect.height=tiledZeroDegreePack[id].height})},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;this.adjustLocations(this.tiledMemberPack[id],lCompoundNode.rect.x,lCompoundNode.rect.y,horizontalMargin,verticalMargin)}},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;self.adjustLocations(tiledPack[id],compoundNode.rect.x,compoundNode.rect.y,horizontalMargin,verticalMargin)})},CoSELayout.prototype.getToBeTiled=function(node){var id=node.id;if(this.toBeTiled[id]!=null)return this.toBeTiled[id];var childGraph=node.getChild();if(childGraph==null)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(theChild.getChild()==null){this.toBeTiled[theChild.id]=!1;continue}if(!this.getToBeTiled(theChild))return this.toBeTiled[id]=!1,!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=degree+1)}return degree},CoSELayout.prototype.getNodeDegreeWithChildren=function(node){var degree=this.getNodeDegree(node);if(node.getChild()==null)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];child.getChild()!=null&&this.fillCompexOrderByDFS(child.getChild().getNodes()),this.getToBeTiled(child)&&this.compoundOrder.push(child)}},CoSELayout.prototype.adjustLocations=function(organization,x,y,compoundHorizontalMargin,compoundVerticalMargin){x+=compoundHorizontalMargin,y+=compoundVerticalMargin;for(var left=x,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];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})},CoSELayout.prototype.tileNodes=function(nodes,minWidth){var verticalPadding=CoSEConstants.TILING_PADDING_VERTICAL,horizontalPadding=CoSEConstants.TILING_PADDING_HORIZONTAL,organization={rows:[],rowWidth:[],rowHeight:[],width:0,height:minWidth,verticalPadding,horizontalPadding};nodes.sort(function(n1,n2){return n1.rect.width*n1.rect.height>n2.rect.width*n2.rect.height?-1:n1.rect.width*n1.rect.height<n2.rect.width*n2.rect.height?1:0});for(var i=0;i<nodes.length;i++){var lNode=nodes[i];organization.rows.length==0?this.insertNodeToRow(organization,lNode,0,minWidth):this.canAddHorizontal(organization,lNode.rect.width,lNode.rect.height)?this.insertNodeToRow(organization,lNode,this.getShortestRowIndex(organization),minWidth):this.insertNodeToRow(organization,lNode,organization.rows.length,minWidth),this.shiftToLastRow(organization)}return organization},CoSELayout.prototype.insertNodeToRow=function(organization,node,rowIndex,minWidth){var minCompoundSize=minWidth;if(rowIndex==organization.rows.length){var secondDimension=[];organization.rows.push(secondDimension),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){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 hDiff=0;organization.rowHeight[sri]<extraHeight&&sri>0&&(hDiff=extraHeight+organization.verticalPadding-organization.rowHeight[sri]);var add_to_row_ratio;organization.width-min>=extraWidth+organization.horizontalPadding?add_to_row_ratio=(organization.height+hDiff)/(min+extraWidth+organization.horizontalPadding):add_to_row_ratio=(organization.height+hDiff)/organization.width,hDiff=extraHeight+organization.verticalPadding;var add_new_row_ratio;return organization.width<extraWidth?add_new_row_ratio=(organization.height+hDiff)/extraWidth:add_new_row_ratio=(organization.height+hDiff)/organization.width,add_new_row_ratio<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 prunedNodesAll=[],containsLeaf=!0,node;containsLeaf;){var allNodes=this.graphManager.getAllNodes(),prunedNodesInStepTemp=[];containsLeaf=!1;for(var i=0;i<allNodes.length;i++)node=allNodes[i],node.getEdges().length==1&&!node.getEdges()[0].isInterGraph&&node.getChild()==null&&(prunedNodesInStepTemp.push([node,node.getEdges()[0],node.getOwner()]),containsLeaf=!0);if(containsLeaf==!0){for(var prunedNodesInStep=[],j=0;j<prunedNodesInStepTemp.length;j++)prunedNodesInStepTemp[j][0].getEdges().length==1&&(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 lengthOfPrunedNodesInStep=prunedNodesAll.length,prunedNodesInStep=prunedNodesAll[lengthOfPrunedNodesInStep-1],nodeData,i=0;i<prunedNodesInStep.length;i++)nodeData=prunedNodesInStep[i],this.findPlaceforPrunedNode(nodeData),nodeData[2].add(nodeData[0]),nodeData[2].add(nodeData[1],nodeData[1].source,nodeData[1].target);prunedNodesAll.splice(prunedNodesAll.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},CoSELayout.prototype.findPlaceforPrunedNode=function(nodeData){var gridForPrunedNode,nodeToConnect,prunedNode=nodeData[0];prunedNode==nodeData[1].source?nodeToConnect=nodeData[1].target:nodeToConnect=nodeData[1].source;var startGridX=nodeToConnect.startX,finishGridX=nodeToConnect.finishX,startGridY=nodeToConnect.startY,finishGridY=nodeToConnect.finishY,upNodeCount=0,downNodeCount=0,rightNodeCount=0,leftNodeCount=0,controlRegions=[upNodeCount,rightNodeCount,downNodeCount,leftNodeCount];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(var 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(var i=startGridX;i<=finishGridX;i++)controlRegions[2]+=this.grid[i][finishGridY+1].length+this.grid[i][finishGridY].length-1;if(startGridX>0)for(var i=startGridY;i<=finishGridY;i++)controlRegions[3]+=this.grid[startGridX-1][i].length+this.grid[startGridX][i].length-1;for(var min=Integer.MAX_VALUE,minCount,minIndex,j=0;j<controlRegions.length;j++)controlRegions[j]<min?(min=controlRegions[j],minCount=1,minIndex=j):controlRegions[j]==min&&minCount++;if(minCount==3&&min==0)controlRegions[0]==0&&controlRegions[1]==0&&controlRegions[2]==0?gridForPrunedNode=1:controlRegions[0]==0&&controlRegions[1]==0&&controlRegions[3]==0?gridForPrunedNode=0:controlRegions[0]==0&&controlRegions[2]==0&&controlRegions[3]==0?gridForPrunedNode=3:controlRegions[1]==0&&controlRegions[2]==0&&controlRegions[3]==0&&(gridForPrunedNode=2);else if(minCount==2&&min==0){var random=Math.floor(Math.random()*2);controlRegions[0]==0&&controlRegions[1]==0?random==0?gridForPrunedNode=0:gridForPrunedNode=1:controlRegions[0]==0&&controlRegions[2]==0?random==0?gridForPrunedNode=0:gridForPrunedNode=2:controlRegions[0]==0&&controlRegions[3]==0?random==0?gridForPrunedNode=0:gridForPrunedNode=3:controlRegions[1]==0&&controlRegions[2]==0?random==0?gridForPrunedNode=1:gridForPrunedNode=2:controlRegions[1]==0&&controlRegions[3]==0?random==0?gridForPrunedNode=1:gridForPrunedNode=3:random==0?gridForPrunedNode=2:gridForPrunedNode=3}else if(minCount==4&&min==0){var random=Math.floor(Math.random()*4);gridForPrunedNode=random}else gridForPrunedNode=minIndex;gridForPrunedNode==0?prunedNode.setCenter(nodeToConnect.getCenterX(),nodeToConnect.getCenterY()-nodeToConnect.getHeight()/2-FDLayoutConstants.DEFAULT_EDGE_LENGTH-prunedNode.getHeight()/2):gridForPrunedNode==1?prunedNode.setCenter(nodeToConnect.getCenterX()+nodeToConnect.getWidth()/2+FDLayoutConstants.DEFAULT_EDGE_LENGTH+prunedNode.getWidth()/2,nodeToConnect.getCenterY()):gridForPrunedNode==2?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}),(function(module2,exports$12,__webpack_require__){var coseBase2={};coseBase2.layoutBase=__webpack_require__(0),coseBase2.CoSEConstants=__webpack_require__(1),coseBase2.CoSEEdge=__webpack_require__(2),coseBase2.CoSEGraph=__webpack_require__(3),coseBase2.CoSEGraphManager=__webpack_require__(4),coseBase2.CoSELayout=__webpack_require__(6),coseBase2.CoSENode=__webpack_require__(5),module2.exports=coseBase2})])})})(coseBase$1)),coseBase$1.exports}var cytoscapeCoseBilkent=cytoscapeCoseBilkent$1.exports,hasRequiredCytoscapeCoseBilkent;function requireCytoscapeCoseBilkent(){return hasRequiredCytoscapeCoseBilkent||(hasRequiredCytoscapeCoseBilkent=1,(function(module,exports$1){(function(root,factory){module.exports=factory(requireCoseBase())})(cytoscapeCoseBilkent,function(__WEBPACK_EXTERNAL_MODULE_0__){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=1)})([(function(module2,exports$12){module2.exports=__WEBPACK_EXTERNAL_MODULE_0__}),(function(module2,exports$12,__webpack_require__){var LayoutConstants=__webpack_require__(0).layoutBase.LayoutConstants,FDLayoutConstants=__webpack_require__(0).layoutBase.FDLayoutConstants,CoSEConstants=__webpack_require__(0).CoSEConstants,CoSELayout=__webpack_require__(0).CoSELayout,CoSENode=__webpack_require__(0).CoSENode,PointD=__webpack_require__(0).layoutBase.PointD,DimensionD2=__webpack_require__(0).layoutBase.DimensionD,defaults={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function extend(defaults2,options){var obj={};for(var i in defaults2)obj[i]=defaults2[i];for(var i in options)obj[i]=options[i];return obj}function _CoSELayout(_options){this.options=extend(defaults,_options),getUserOptions(this.options)}var getUserOptions=function(options){options.nodeRepulsion!=null&&(CoSEConstants.DEFAULT_REPULSION_STRENGTH=FDLayoutConstants.DEFAULT_REPULSION_STRENGTH=options.nodeRepulsion),options.idealEdgeLength!=null&&(CoSEConstants.DEFAULT_EDGE_LENGTH=FDLayoutConstants.DEFAULT_EDGE_LENGTH=options.idealEdgeLength),options.edgeElasticity!=null&&(CoSEConstants.DEFAULT_SPRING_STRENGTH=FDLayoutConstants.DEFAULT_SPRING_STRENGTH=options.edgeElasticity),options.nestingFactor!=null&&(CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=options.nestingFactor),options.gravity!=null&&(CoSEConstants.DEFAULT_GRAVITY_STRENGTH=FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH=options.gravity),options.numIter!=null&&(CoSEConstants.MAX_ITERATIONS=FDLayoutConstants.MAX_ITERATIONS=options.numIter),options.gravityRange!=null&&(CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR=FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR=options.gravityRange),options.gravityCompound!=null&&(CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH=options.gravityCompound),options.gravityRangeCompound!=null&&(CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=options.gravityRangeCompound),options.initialEnergyOnIncremental!=null&&(CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL=options.initialEnergyOnIncremental),options.quality=="draft"?LayoutConstants.QUALITY=0:options.quality=="proof"?LayoutConstants.QUALITY=2:LayoutConstants.QUALITY=1,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=typeof options.tilingPaddingVertical=="function"?options.tilingPaddingVertical.call():options.tilingPaddingVertical,CoSEConstants.TILING_PADDING_HORIZONTAL=typeof options.tilingPaddingHorizontal=="function"?options.tilingPaddingHorizontal.call():options.tilingPaddingHorizontal};_CoSELayout.prototype.run=function(){var ready,frameId,options=this.options;this.idToLNode={};var layout=this.layout=new CoSELayout,self=this;self.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var gm=layout.newGraphManager();this.gm=gm;var nodes=this.options.eles.nodes(),edges=this.options.eles.edges();this.root=gm.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(nodes),layout);for(var i=0;i<edges.length;i++){var edge=edges[i],sourceNode=this.idToLNode[edge.data("source")],targetNode=this.idToLNode[edge.data("target")];if(sourceNode!==targetNode&&sourceNode.getEdgesBetween(targetNode).length==0){var e1=gm.add(layout.newEdge(),sourceNode,targetNode);e1.id=edge.id()}}var getPositions=function(ele,i2){typeof ele=="number"&&(ele=i2);var theId=ele.data("id"),lNode=self.idToLNode[theId];return{x:lNode.getRect().getCenterX(),y:lNode.getRect().getCenterY()}},iterateAnimated=function iterateAnimated2(){for(var afterReposition=function(){options.fit&&options.cy.fit(options.eles,options.padding),ready||(ready=!0,self.cy.one("layoutready",options.ready),self.cy.trigger({type:"layoutready",layout:self}))},ticksPerFrame=self.options.refresh,isDone,i2=0;i2<ticksPerFrame&&!isDone;i2++)isDone=self.stopped||self.layout.tick();if(isDone){layout.checkLayoutSuccess()&&!layout.isSubLayout&&layout.doPostLayout(),layout.tilingPostLayout&&layout.tilingPostLayout(),layout.isLayoutFinished=!0,self.options.eles.nodes().positions(getPositions),afterReposition(),self.cy.one("layoutstop",self.options.stop),self.cy.trigger({type:"layoutstop",layout:self}),frameId&&cancelAnimationFrame(frameId),ready=!1;return}var animationData=self.layout.getPositionsData();options.eles.nodes().positions(function(ele,i3){if(typeof ele=="number"&&(ele=i3),!ele.isParent()){for(var theId=ele.id(),pNode=animationData[theId],temp=ele;pNode==null&&(pNode=animationData[temp.data("parent")]||animationData["DummyCompound_"+temp.data("parent")],animationData[theId]=pNode,temp=temp.parent()[0],temp!=null););return pNode!=null?{x:pNode.x,y:pNode.y}:{x:ele.position("x"),y:ele.position("y")}}}),afterReposition(),frameId=requestAnimationFrame(iterateAnimated2)};return layout.addListener("layoutstarted",function(){self.options.animate==="during"&&(frameId=requestAnimationFrame(iterateAnimated))}),layout.runLayout(),this.options.animate!=="during"&&(self.options.eles.nodes().not(":parent").layoutPositions(self,self.options,getPositions),ready=!1),this},_CoSELayout.prototype.getTopMostNodes=function(nodes){for(var nodesMap={},i=0;i<nodes.length;i++)nodesMap[nodes[i].id()]=!0;var roots=nodes.filter(function(ele,i2){typeof ele=="number"&&(ele=i2);for(var parent=ele.parent()[0];parent!=null;){if(nodesMap[parent.id()])return!1;parent=parent.parent()[0]}return!0});return roots},_CoSELayout.prototype.processChildrenList=function(parent,children,layout){for(var size=children.length,i=0;i<size;i++){var theChild=children[i],children_of_children=theChild.children(),theNode,dimensions=theChild.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(theChild.outerWidth()!=null&&theChild.outerHeight()!=null?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)))):theNode=parent.add(new CoSENode(this.graphManager)),theNode.id=theChild.data("id"),theNode.paddingLeft=parseInt(theChild.css("padding")),theNode.paddingTop=parseInt(theChild.css("padding")),theNode.paddingRight=parseInt(theChild.css("padding")),theNode.paddingBottom=parseInt(theChild.css("padding")),this.options.nodeDimensionsIncludeLabels&&theChild.isParent()){var labelWidth=theChild.boundingBox({includeLabels:!0,includeNodes:!1}).w,labelHeight=theChild.boundingBox({includeLabels:!0,includeNodes:!1}).h,labelPos=theChild.css("text-halign");theNode.labelWidth=labelWidth,theNode.labelHeight=labelHeight,theNode.labelPos=labelPos}if(this.idToLNode[theChild.data("id")]=theNode,isNaN(theNode.rect.x)&&(theNode.rect.x=0),isNaN(theNode.rect.y)&&(theNode.rect.y=0),children_of_children!=null&&children_of_children.length>0){var theNewGraph;theNewGraph=layout.getGraphManager().add(layout.newGraph(),theNode),this.processChildrenList(theNewGraph,children_of_children,layout)}}},_CoSELayout.prototype.stop=function(){return this.stopped=!0,this};var register=function(cytoscape2){cytoscape2("layout","cose-bilkent",_CoSELayout)};typeof cytoscape<"u"&&register(cytoscape),module2.exports=register})])})})(cytoscapeCoseBilkent$1)),cytoscapeCoseBilkent$1.exports}var cytoscapeCoseBilkentExports=requireCytoscapeCoseBilkent();const coseBilkent=getDefaultExportFromCjs(cytoscapeCoseBilkentExports);cytoscape$1.use(coseBilkent);function addNodes(nodes,cy){nodes.forEach(node=>{const nodeData={id:node.id,labelText:node.label,height:node.height,width:node.width,padding:node.padding??0};Object.keys(node).forEach(key=>{["id","label","height","width","padding","x","y"].includes(key)||(nodeData[key]=node[key])}),cy.add({group:"nodes",data:nodeData,position:{x:node.x??0,y:node.y??0}})})}__name(addNodes,"addNodes");function addEdges(edges,cy){edges.forEach(edge=>{const edgeData={id:edge.id,source:edge.start,target:edge.end};Object.keys(edge).forEach(key=>{["id","start","end"].includes(key)||(edgeData[key]=edge[key])}),cy.add({group:"edges",data:edgeData})})}__name(addEdges,"addEdges");function createCytoscapeInstance(data){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":"bezier"}}]});renderEl.remove(),addNodes(data.nodes,cy),addEdges(data.edges,cy),cy.nodes().forEach(function(n){n.layoutDimensions=()=>{const nodeData=n.data();return{w:nodeData.width,h:nodeData.height}}});const layoutConfig={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};cy.layout(layoutConfig).run(),cy.ready(e=>{log.info("Cytoscape ready",e),resolve(cy)})})}__name(createCytoscapeInstance,"createCytoscapeInstance");function extractPositionedNodes(cy){return cy.nodes().map(node=>{const data=node.data(),position=node.position(),positionedNode={id:data.id,x:position.x,y:position.y};return Object.keys(data).forEach(key=>{key!=="id"&&(positionedNode[key]=data[key])}),positionedNode})}__name(extractPositionedNodes,"extractPositionedNodes");function extractPositionedEdges(cy){return cy.edges().map(edge=>{const data=edge.data(),rscratch=edge._private.rscratch,positionedEdge={id:data.id,source:data.source,target:data.target,startX:rscratch.startX,startY:rscratch.startY,midX:rscratch.midX,midY:rscratch.midY,endX:rscratch.endX,endY:rscratch.endY};return Object.keys(data).forEach(key=>{["id","source","target"].includes(key)||(positionedEdge[key]=data[key])}),positionedEdge})}__name(extractPositionedEdges,"extractPositionedEdges");async function executeCoseBilkentLayout(data,_config){log.debug("Starting cose-bilkent layout algorithm");try{validateLayoutData(data);const cy=await createCytoscapeInstance(data),positionedNodes=extractPositionedNodes(cy),positionedEdges=extractPositionedEdges(cy);return log.debug(`Layout completed: ${positionedNodes.length} nodes, ${positionedEdges.length} edges`),{nodes:positionedNodes,edges:positionedEdges}}catch(error){throw log.error("Error in cose-bilkent layout algorithm:",error),error}}__name(executeCoseBilkentLayout,"executeCoseBilkentLayout");function validateLayoutData(data){if(!data)throw new Error("Layout data is required");if(!data.config)throw new Error("Configuration is required in layout data");if(!data.rootNode)throw new Error("Root node is required");if(!data.nodes||!Array.isArray(data.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(data.edges))throw new Error("Edges array is required in layout data");return!0}__name(validateLayoutData,"validateLayoutData");var render=__name(async(data4Layout,svg,{insertCluster,insertEdge,insertEdgeLabel,insertMarkers,insertNode,log:log2,positionEdgeLabel},{algorithm:_algorithm})=>{const nodeDb={},clusterDb={},element=svg.select("g");insertMarkers(element,data4Layout.markers,data4Layout.type,data4Layout.diagramId);const subGraphsEl=element.insert("g").attr("class","subgraphs"),edgePaths=element.insert("g").attr("class","edgePaths"),edgeLabels=element.insert("g").attr("class","edgeLabels"),nodes=element.insert("g").attr("class","nodes");log2.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(data4Layout.nodes.map(async node=>{if(node.isGroup){const clusterNode={...node};clusterDb[node.id]=clusterNode,nodeDb[node.id]=clusterNode,await insertCluster(subGraphsEl,node)}else{const nodeWithPosition={...node};nodeDb[node.id]=nodeWithPosition;const nodeEl=await insertNode(nodes,node,{config:data4Layout.config,dir:data4Layout.direction||"TB"}),boundingBox=nodeEl.node().getBBox();nodeWithPosition.width=boundingBox.width,nodeWithPosition.height=boundingBox.height,nodeWithPosition.domId=nodeEl,log2.debug(`Node ${node.id} dimensions: ${boundingBox.width}x${boundingBox.height}`)}})),log2.debug("Running cose-bilkent layout algorithm");const updatedLayoutData={...data4Layout,nodes:data4Layout.nodes.map(node=>{const nodeWithDimensions=nodeDb[node.id];return{...node,width:nodeWithDimensions.width,height:nodeWithDimensions.height}})},layoutResult=await executeCoseBilkentLayout(updatedLayoutData,data4Layout.config);log2.debug("Positioning nodes based on layout results"),layoutResult.nodes.forEach(positionedNode=>{const node=nodeDb[positionedNode.id];node!=null&&node.domId&&(node.domId.attr("transform",`translate(${positionedNode.x}, ${positionedNode.y})`),node.x=positionedNode.x,node.y=positionedNode.y,log2.debug(`Positioned node ${node.id} at center (${positionedNode.x}, ${positionedNode.y})`))}),layoutResult.edges.forEach(positionedEdge=>{const edge=data4Layout.edges.find(e=>e.id===positionedEdge.id);edge&&(edge.points=[{x:positionedEdge.startX,y:positionedEdge.startY},{x:positionedEdge.midX,y:positionedEdge.midY},{x:positionedEdge.endX,y:positionedEdge.endY}])}),log2.debug("Inserting and positioning edges"),await Promise.all(data4Layout.edges.map(async edge=>{await insertEdgeLabel(edgeLabels,edge);const startNode=nodeDb[edge.start??""],endNode=nodeDb[edge.end??""];if(startNode&&endNode){const positionedEdge=layoutResult.edges.find(e=>e.id===edge.id);if(positionedEdge){log2.debug("APA01 positionedEdge",positionedEdge);const edgeWithPath={...edge},paths=insertEdge(edgePaths,edgeWithPath,clusterDb,data4Layout.type,startNode,endNode,data4Layout.diagramId);positionEdgeLabel(edgeWithPath,paths)}else{const edgeWithPath={...edge,points:[{x:startNode.x||0,y:startNode.y||0},{x:endNode.x||0,y:endNode.y||0}]},paths=insertEdge(edgePaths,edgeWithPath,clusterDb,data4Layout.type,startNode,endNode,data4Layout.diagramId);positionEdgeLabel(edgeWithPath,paths)}}})),log2.debug("Cose-bilkent rendering completed")},"render"),render2=render;export{render2 as render};