cc-viewer 1.8.11 → 1.8.13

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 (118) hide show
  1. package/dist/assets/{App-vpm6omRY.js → App-R6odqLoE.js} +2 -2
  2. package/dist/assets/MdxEditorPanel-CTqsETwc.js +1 -0
  3. package/dist/assets/{Mobile-BHIBdqHs.js → Mobile-o_QrQ_eI.js} +1 -1
  4. package/dist/assets/{ProxyStatsModal-DdV7wN2V.js → ProxyStatsModal-CM2H8JYh.js} +1 -1
  5. package/dist/assets/{_baseUniq-C2FCldN4.js → _baseUniq-B3e4JaL0.js} +1 -1
  6. package/dist/assets/{arc-CSzd_bdT.js → arc-DnoPn_qY.js} +1 -1
  7. package/dist/assets/architectureDiagram-Q4EWVU46-DrPKTbxH.js +1 -0
  8. package/dist/assets/blockDiagram-DXYQGD6D-CEaO0Vcw.js +1 -0
  9. package/dist/assets/c4Diagram-AHTNJAMY-BLaawFeg.js +1 -0
  10. package/dist/assets/{channel-xMmQtLq9.js → channel-DnYR1fF4.js} +1 -1
  11. package/dist/assets/{chunk-4BX2VUAB-DnFoMzQG.js → chunk-4BX2VUAB-Bfd4edKZ.js} +1 -1
  12. package/dist/assets/{chunk-4TB4RGXK-Dc5reuwv.js → chunk-4TB4RGXK-t2nMQmY7.js} +1 -1
  13. package/dist/assets/{chunk-55IACEB6-DTKTLKcJ.js → chunk-55IACEB6-C6tLOjGX.js} +1 -1
  14. package/dist/assets/{chunk-EDXVE4YY-BNqgeN9r.js → chunk-EDXVE4YY-dWCvxbCb.js} +1 -1
  15. package/dist/assets/{chunk-FMBD7UC4-DzJVZ11t.js → chunk-FMBD7UC4-BHELZLPK.js} +1 -1
  16. package/dist/assets/{chunk-OYMX7WX6-CjYwzMor.js → chunk-OYMX7WX6-C8XTkH1S.js} +1 -1
  17. package/dist/assets/{chunk-QZHKN3VN-C0KVKecr.js → chunk-QZHKN3VN-CD0j6SAs.js} +1 -1
  18. package/dist/assets/{chunk-YZCP3GAM-3VhNeNVm.js → chunk-YZCP3GAM-D4dKfXJJ.js} +1 -1
  19. package/dist/assets/classDiagram-6PBFFD2Q-BecPAAuk.js +1 -0
  20. package/dist/assets/classDiagram-v2-HSJHXN6E-BecPAAuk.js +1 -0
  21. package/dist/assets/clone-B0_ghF3F.js +1 -0
  22. package/dist/assets/cose-bilkent-S5V4N54A-BF2HsiSD.js +1 -0
  23. package/dist/assets/dagre-KV5264BT-f3h967yx.js +1 -0
  24. package/dist/assets/diagram-5BDNPKRD-B9PzHQfh.js +1 -0
  25. package/dist/assets/diagram-G4DWMVQ6-kR953Bqm.js +1 -0
  26. package/dist/assets/diagram-MMDJMWI5-DAewa2eg.js +1 -0
  27. package/dist/assets/diagram-TYMM5635-C8HNTH6I.js +1 -0
  28. package/dist/assets/erDiagram-SMLLAGMA-BQ5P8wWK.js +1 -0
  29. package/dist/assets/flowDiagram-DWJPFMVM-BIpEkrMR.js +1 -0
  30. package/dist/assets/ganttDiagram-T4ZO3ILL-CWqSfB5v.js +1 -0
  31. package/dist/assets/gitGraphDiagram-UUTBAWPF-Ba-9yEbQ.js +1 -0
  32. package/dist/assets/{graph-CwiXMdRR.js → graph-D3zXKQ6P.js} +1 -1
  33. package/dist/assets/index--yjDHxJD.js +2 -0
  34. package/dist/assets/index-Bm3A5VLb.js +1 -0
  35. package/dist/assets/index-C9N0rZ7Z.js +1 -0
  36. package/dist/assets/index-DClD_EkN.js +1 -0
  37. package/dist/assets/index-DSd5P3WQ.js +1 -0
  38. package/dist/assets/index-G3xd-gLo.js +1 -0
  39. package/dist/assets/index-HLrnYsI1.js +1 -0
  40. package/dist/assets/index-Q8wp4Nof.js +1 -0
  41. package/dist/assets/infoDiagram-42DDH7IO-Cxm79ZJR.js +1 -0
  42. package/dist/assets/ishikawaDiagram-UXIWVN3A-Cd0vZP1B.js +1 -0
  43. package/dist/assets/journeyDiagram-VCZTEJTY-B2b57HXk.js +1 -0
  44. package/dist/assets/{jszip.min-Bq1JxqcN.js → jszip.min-Bj5uiEb2.js} +1 -1
  45. package/dist/assets/kanban-definition-6JOO6SKY-YCERiUCO.js +1 -0
  46. package/dist/assets/{layout-BQFiWq71.js → layout-Do5TlO2U.js} +1 -1
  47. package/dist/assets/{linear-BNV4po81.js → linear-BiJNTDgN.js} +1 -1
  48. package/dist/assets/{mermaid.core-DvwEdatr.js → mermaid.core-Dg0McRZt.js} +2 -2
  49. package/dist/assets/{min-DFik8k4L.js → min-T51iefht.js} +1 -1
  50. package/dist/assets/mindmap-definition-QFDTVHPH-Cu_GJxY3.js +1 -0
  51. package/dist/assets/pieDiagram-DEJITSTG-DldHHZXi.js +1 -0
  52. package/dist/assets/quadrantDiagram-34T5L4WZ-BzyTPNAJ.js +1 -0
  53. package/dist/assets/requirementDiagram-MS252O5E-C5xxFkvG.js +1 -0
  54. package/dist/assets/sankeyDiagram-XADWPNL6-OxdjoaE1.js +1 -0
  55. package/dist/assets/seqResourceLoaders-BgeRQt8C.js +2 -0
  56. package/dist/assets/{seqResourceLoaders-1EWxJwEP.css → seqResourceLoaders-Xx6a8E03.css} +2 -2
  57. package/dist/assets/sequenceDiagram-FGHM5R23-C7c89uIS.js +1 -0
  58. package/dist/assets/stateDiagram-FHFEXIEX-ssdJnDrO.js +1 -0
  59. package/dist/assets/stateDiagram-v2-QKLJ7IA2-BP-0WClK.js +1 -0
  60. package/dist/assets/timeline-definition-GMOUNBTQ-sWScEpSM.js +1 -0
  61. package/dist/assets/{vendor-antd-BTBRwbax.js → vendor-antd-DKIytXho.js} +1 -1
  62. package/dist/assets/vendor-codemirror-4qgXq03k.js +1 -0
  63. package/dist/assets/vendor-mdxeditor-D5Z5D9fq.js +2 -0
  64. package/dist/assets/{vendor-qrcode-E9ld0lSz.js → vendor-qrcode-B7lb5qk1.js} +1 -1
  65. package/dist/assets/vendor-virtuoso-BqoXlbhH.js +1 -0
  66. package/dist/assets/vennDiagram-DHZGUBPP-DNfXR0ge.js +1 -0
  67. package/dist/assets/{wardley-RL74JXVD-BFcIn2-Q.js → wardley-RL74JXVD-JXd--CRD.js} +1 -1
  68. package/dist/assets/wardleyDiagram-NUSXRM2D-DHmNyVPM.js +1 -0
  69. package/dist/assets/xychartDiagram-5P7HB3ND-CTb0gltZ.js +1 -0
  70. package/dist/index.html +4 -5
  71. package/package.json +1 -1
  72. package/server/routes/files-content.js +2 -1
  73. package/server/routes/files-fs.js +3 -1
  74. package/dist/assets/MdxEditorPanel-CpknU7SR.js +0 -1
  75. package/dist/assets/architectureDiagram-Q4EWVU46-CjEbBe2R.js +0 -1
  76. package/dist/assets/blockDiagram-DXYQGD6D-BYzl2ukW.js +0 -1
  77. package/dist/assets/c4Diagram-AHTNJAMY-0x0_8O_X.js +0 -1
  78. package/dist/assets/classDiagram-6PBFFD2Q-DdUtH789.js +0 -1
  79. package/dist/assets/classDiagram-v2-HSJHXN6E-DdUtH789.js +0 -1
  80. package/dist/assets/clone-C6d2XDvR.js +0 -1
  81. package/dist/assets/cose-bilkent-S5V4N54A-DGE02sJS.js +0 -1
  82. package/dist/assets/dagre-KV5264BT-CY4eCcwS.js +0 -1
  83. package/dist/assets/diagram-5BDNPKRD-DHq2THYn.js +0 -1
  84. package/dist/assets/diagram-G4DWMVQ6-DD_76oJg.js +0 -1
  85. package/dist/assets/diagram-MMDJMWI5-BvQxk1jl.js +0 -1
  86. package/dist/assets/diagram-TYMM5635-B_tMXPJl.js +0 -1
  87. package/dist/assets/erDiagram-SMLLAGMA-DpuGbN9e.js +0 -1
  88. package/dist/assets/flowDiagram-DWJPFMVM-BW0xGFBf.js +0 -1
  89. package/dist/assets/ganttDiagram-T4ZO3ILL-BSzTiT93.js +0 -1
  90. package/dist/assets/gitGraphDiagram-UUTBAWPF-1tsgBlcn.js +0 -1
  91. package/dist/assets/index-9e6BGquk.js +0 -1
  92. package/dist/assets/index-BmpXfVQ8.js +0 -1
  93. package/dist/assets/index-CZWNaOo8.js +0 -1
  94. package/dist/assets/index-Cixs7aRD.js +0 -1
  95. package/dist/assets/index-Ct6Fi103.js +0 -1
  96. package/dist/assets/index-DIAMN9QO.js +0 -1
  97. package/dist/assets/index-DhjwHRxk.js +0 -1
  98. package/dist/assets/index-tnWldUm3.js +0 -2
  99. package/dist/assets/infoDiagram-42DDH7IO-Dk1ESZFk.js +0 -1
  100. package/dist/assets/ishikawaDiagram-UXIWVN3A-DcPyNwkI.js +0 -1
  101. package/dist/assets/journeyDiagram-VCZTEJTY-CZWieu1U.js +0 -1
  102. package/dist/assets/kanban-definition-6JOO6SKY-S1sSSTKx.js +0 -1
  103. package/dist/assets/mindmap-definition-QFDTVHPH-CebeX76u.js +0 -1
  104. package/dist/assets/pieDiagram-DEJITSTG-DMB5JbMP.js +0 -1
  105. package/dist/assets/quadrantDiagram-34T5L4WZ-BAYzoLVo.js +0 -1
  106. package/dist/assets/requirementDiagram-MS252O5E-CUQoAuOc.js +0 -1
  107. package/dist/assets/sankeyDiagram-XADWPNL6-Dt0AQuLW.js +0 -1
  108. package/dist/assets/seqResourceLoaders-C-QHRkUq.js +0 -2
  109. package/dist/assets/sequenceDiagram-FGHM5R23-HyZFUlMU.js +0 -1
  110. package/dist/assets/stateDiagram-FHFEXIEX-B8x24fuD.js +0 -1
  111. package/dist/assets/stateDiagram-v2-QKLJ7IA2-2qtHlnwO.js +0 -1
  112. package/dist/assets/timeline-definition-GMOUNBTQ-TnbjDVtB.js +0 -1
  113. package/dist/assets/vendor-codemirror-CPWlhuQ1.js +0 -1
  114. package/dist/assets/vendor-mdxeditor-Cy5Xg_90.js +0 -2
  115. package/dist/assets/vendor-virtuoso-Bq6QMhgG.js +0 -1
  116. package/dist/assets/vennDiagram-DHZGUBPP-BqgIjkBO.js +0 -1
  117. package/dist/assets/wardleyDiagram-NUSXRM2D-CYDWQLb6.js +0 -1
  118. package/dist/assets/xychartDiagram-5P7HB3ND-zfusE3BC.js +0 -1
@@ -1 +0,0 @@
1
- import{_ as __name,l as log,d as select}from"./mermaid.core-DvwEdatr.js";import{c as cytoscape$1}from"./cytoscape.esm-CT1mZavR.js";import{g as getDefaultExportFromCjs}from"./vendor-antd-BTBRwbax.js";import"./vendor-mdxeditor-Cy5Xg_90.js";import"./vendor-virtuoso-Bq6QMhgG.js";import"./vendor-codemirror-CPWlhuQ1.js";import"./vendor-markdown-DOJHsAxX.js";var hasRequiredLayoutBase,cytoscapeCoseBilkent$1={exports:{}},coseBase$1={exports:{}},layoutBase$1={exports:{}};function requireLayoutBase(){return hasRequiredLayoutBase?layoutBase$1.exports:(hasRequiredLayoutBase=1,factory=function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module2=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module2.exports,module2,module2.exports,__webpack_require__),module2.l=!0,module2.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports$12,name,getter){__webpack_require__.o(exports$12,name)||Object.defineProperty(exports$12,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module2){var getter=module2&&module2.__esModule?function(){return module2.default}:function(){return module2};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=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}for(var prop in LEdge.prototype=Object.create(LGraphObject.prototype),LGraphObject)LEdge[prop]=LGraphObject[prop];LEdge.prototype.getSource=function(){return this.source},LEdge.prototype.getTarget=function(){return this.target},LEdge.prototype.isInterGraph=function(){return this.isInterGraph},LEdge.prototype.getLength=function(){return this.length},LEdge.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},LEdge.prototype.getBendpoints=function(){return this.bendpoints},LEdge.prototype.getLca=function(){return this.lca},LEdge.prototype.getSourceInLca=function(){return this.sourceInLca},LEdge.prototype.getTargetInLca=function(){return this.targetInLca},LEdge.prototype.getOtherEnd=function(node){if(this.source===node)return this.target;if(this.target===node)return this.source;throw"Node is not incident with this edge"},LEdge.prototype.getOtherEndInGraph=function(node,graph){for(var otherEnd=this.getOtherEnd(node),root=graph.getGraphManager().getRoot();;){if(otherEnd.getOwner()==graph)return otherEnd;if(otherEnd.getOwner()==root)break;otherEnd=otherEnd.getOwner().getParent()}return null},LEdge.prototype.updateLength=function(){var clipPointCoordinates=new Array(4);this.isOverlapingSourceAndTarget=IGeometry.getIntersection(this.target.getRect(),this.source.getRect(),clipPointCoordinates),this.isOverlapingSourceAndTarget||(this.lengthX=clipPointCoordinates[0]-clipPointCoordinates[2],this.lengthY=clipPointCoordinates[1]-clipPointCoordinates[3],Math.abs(this.lengthX)<1&&(this.lengthX=IMath.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=IMath.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},LEdge.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=IMath.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=IMath.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},module2.exports=LEdge},function(module2,exports$12,__webpack_require__){module2.exports=function(vGraphObject){this.vGraphObject=vGraphObject}},function(module2,exports$12,__webpack_require__){var LGraphObject=__webpack_require__(2),Integer=__webpack_require__(10),RectangleD=__webpack_require__(13),LayoutConstants=__webpack_require__(0),RandomSeed=__webpack_require__(16),PointD=__webpack_require__(4);function LNode(gm,loc,size,vNode){null==size&&null==vNode&&(vNode=loc),LGraphObject.call(this,vNode),null!=gm.graphManager&&(gm=gm.graphManager),this.estimatedSize=Integer.MIN_VALUE,this.inclusionTreeDepth=Integer.MAX_VALUE,this.vGraphObject=vNode,this.edges=[],this.graphManager=gm,this.rect=null!=size&&null!=loc?new RectangleD(loc.x,loc.y,size.width,size.height):new RectangleD}for(var prop in LNode.prototype=Object.create(LGraphObject.prototype),LGraphObject)LNode[prop]=LGraphObject[prop];LNode.prototype.getEdges=function(){return this.edges},LNode.prototype.getChild=function(){return this.child},LNode.prototype.getOwner=function(){return this.owner},LNode.prototype.getWidth=function(){return this.rect.width},LNode.prototype.setWidth=function(width){this.rect.width=width},LNode.prototype.getHeight=function(){return this.rect.height},LNode.prototype.setHeight=function(height){this.rect.height=height},LNode.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},LNode.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},LNode.prototype.getCenter=function(){return new PointD(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},LNode.prototype.getLocation=function(){return new PointD(this.rect.x,this.rect.y)},LNode.prototype.getRect=function(){return this.rect},LNode.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},LNode.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},LNode.prototype.setRect=function(upperLeft,dimension){this.rect.x=upperLeft.x,this.rect.y=upperLeft.y,this.rect.width=dimension.width,this.rect.height=dimension.height},LNode.prototype.setCenter=function(cx,cy){this.rect.x=cx-this.rect.width/2,this.rect.y=cy-this.rect.height/2},LNode.prototype.setLocation=function(x,y){this.rect.x=x,this.rect.y=y},LNode.prototype.moveBy=function(dx,dy){this.rect.x+=dx,this.rect.y+=dy},LNode.prototype.getEdgeListToNode=function(to){var edgeList=[],self=this;return self.edges.forEach(function(edge){if(edge.target==to){if(edge.source!=self)throw"Incorrect edge source!";edgeList.push(edge)}}),edgeList},LNode.prototype.getEdgesBetween=function(other){var edgeList=[],self=this;return self.edges.forEach(function(edge){if(edge.source!=self&&edge.target!=self)throw"Incorrect edge source and/or target";edge.target!=other&&edge.source!=other||edgeList.push(edge)}),edgeList},LNode.prototype.getNeighborsList=function(){var neighbors=new Set,self=this;return self.edges.forEach(function(edge){if(edge.source==self)neighbors.add(edge.target);else{if(edge.target!=self)throw"Incorrect incidency!";neighbors.add(edge.source)}}),neighbors},LNode.prototype.withChildren=function(){var withNeighborsList=new Set;if(withNeighborsList.add(this),null!=this.child)for(var nodes=this.child.getNodes(),i=0;i<nodes.length;i++)nodes[i].withChildren().forEach(function(node){withNeighborsList.add(node)});return withNeighborsList},LNode.prototype.getNoOfChildren=function(){var noOfChildren=0;if(null==this.child)noOfChildren=1;else for(var nodes=this.child.getNodes(),i=0;i<nodes.length;i++)noOfChildren+=nodes[i].getNoOfChildren();return 0==noOfChildren&&(noOfChildren=1),noOfChildren},LNode.prototype.getEstimatedSize=function(){if(this.estimatedSize==Integer.MIN_VALUE)throw"assert failed";return this.estimatedSize},LNode.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},LNode.prototype.scatter=function(){var randomCenterX,randomCenterY,minX=-LayoutConstants.INITIAL_WORLD_BOUNDARY,maxX=LayoutConstants.INITIAL_WORLD_BOUNDARY;randomCenterX=LayoutConstants.WORLD_CENTER_X+RandomSeed.nextDouble()*(maxX-minX)+minX;var minY=-LayoutConstants.INITIAL_WORLD_BOUNDARY,maxY=LayoutConstants.INITIAL_WORLD_BOUNDARY;randomCenterY=LayoutConstants.WORLD_CENTER_Y+RandomSeed.nextDouble()*(maxY-minY)+minY,this.rect.x=randomCenterX,this.rect.y=randomCenterY},LNode.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var childGraph=this.getChild();if(childGraph.updateBounds(!0),this.rect.x=childGraph.getLeft(),this.rect.y=childGraph.getTop(),this.setWidth(childGraph.getRight()-childGraph.getLeft()),this.setHeight(childGraph.getBottom()-childGraph.getTop()),LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS){var width=childGraph.getRight()-childGraph.getLeft(),height=childGraph.getBottom()-childGraph.getTop();this.labelWidth>width&&(this.rect.x-=(this.labelWidth-width)/2,this.setWidth(this.labelWidth)),this.labelHeight>height&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-height)/2:"top"==this.labelPos&&(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 null==this.owner?null:this.owner.getParent()},module2.exports=LNode},function(module2,exports$12,__webpack_require__){function PointD(x,y){null==x&&null==y?(this.x=0,this.y=0):(this.x=x,this.y=y)}PointD.prototype.getX=function(){return this.x},PointD.prototype.getY=function(){return this.y},PointD.prototype.setX=function(x){this.x=x},PointD.prototype.setY=function(y){this.y=y},PointD.prototype.getDifference=function(pt){return new DimensionD(this.x-pt.x,this.y-pt.y)},PointD.prototype.getCopy=function(){return new PointD(this.x,this.y)},PointD.prototype.translate=function(dim){return this.x+=dim.width,this.y+=dim.height,this},module2.exports=PointD},function(module2,exports$12,__webpack_require__){var LGraphObject=__webpack_require__(2),Integer=__webpack_require__(10),LayoutConstants=__webpack_require__(0),LGraphManager=__webpack_require__(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,null!=obj2&&obj2 instanceof LGraphManager?this.graphManager=obj2:null!=obj2&&obj2 instanceof Layout&&(this.graphManager=obj2.graphManager)}for(var prop in LGraph.prototype=Object.create(LGraphObject.prototype),LGraphObject)LGraph[prop]=LGraphObject[prop];LGraph.prototype.getNodes=function(){return this.nodes},LGraph.prototype.getEdges=function(){return this.edges},LGraph.prototype.getGraphManager=function(){return this.graphManager},LGraph.prototype.getParent=function(){return this.parent},LGraph.prototype.getLeft=function(){return this.left},LGraph.prototype.getRight=function(){return this.right},LGraph.prototype.getTop=function(){return this.top},LGraph.prototype.getBottom=function(){return this.bottom},LGraph.prototype.isConnected=function(){return this.isConnected},LGraph.prototype.add=function(obj1,sourceNode,targetNode){if(null==sourceNode&&null==targetNode){var newNode=obj1;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(newNode)>-1)throw"Node already in graph!";return newNode.owner=this,this.getNodes().push(newNode),newNode}var newEdge=obj1;if(!(this.getNodes().indexOf(sourceNode)>-1&&this.getNodes().indexOf(targetNode)>-1))throw"Source or target not in graph!";if(sourceNode.owner!=targetNode.owner||sourceNode.owner!=this)throw"Both owners must be this graph!";return sourceNode.owner!=targetNode.owner?null:(newEdge.source=sourceNode,newEdge.target=targetNode,newEdge.isInterGraph=!1,this.getEdges().push(newEdge),sourceNode.edges.push(newEdge),targetNode!=sourceNode&&targetNode.edges.push(newEdge),newEdge)},LGraph.prototype.remove=function(obj){var node=obj;if(obj instanceof LNode){if(null==node)throw"Node is null!";if(null==node.owner||node.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var edgesToBeRemoved=node.edges.slice(),s=edgesToBeRemoved.length,i=0;i<s;i++)(edge=edgesToBeRemoved[i]).isInterGraph?this.graphManager.remove(edge):edge.source.owner.remove(edge);if(-1==(index=this.nodes.indexOf(node)))throw"Node not in owner node list!";this.nodes.splice(index,1)}else if(obj instanceof LEdge){var edge;if(null==(edge=obj))throw"Edge is null!";if(null==edge.source||null==edge.target)throw"Source and/or target is null!";if(null==edge.source.owner||null==edge.target.owner||edge.source.owner!=this||edge.target.owner!=this)throw"Source and/or target owner is invalid!";var index,sourceIndex=edge.source.edges.indexOf(edge),targetIndex=edge.target.edges.indexOf(edge);if(!(sourceIndex>-1&&targetIndex>-1))throw"Source and/or target doesn't know this edge!";if(edge.source.edges.splice(sourceIndex,1),edge.target!=edge.source&&edge.target.edges.splice(targetIndex,1),-1==(index=edge.source.owner.getEdges().indexOf(edge)))throw"Not in owner's edge list!";edge.source.owner.getEdges().splice(index,1)}},LGraph.prototype.updateLeftTop=function(){for(var nodeTop,nodeLeft,margin,top=Integer.MAX_VALUE,left=Integer.MAX_VALUE,nodes=this.getNodes(),s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];top>(nodeTop=lNode.getTop())&&(top=nodeTop),left>(nodeLeft=lNode.getLeft())&&(left=nodeLeft)}return top==Integer.MAX_VALUE?null:(margin=null!=nodes[0].getParent().paddingLeft?nodes[0].getParent().paddingLeft:this.margin,this.left=left-margin,this.top=top-margin,new Point2(this.left,this.top))},LGraph.prototype.updateBounds=function(recursive){for(var nodeLeft,nodeRight,nodeTop,nodeBottom,margin,left=Integer.MAX_VALUE,right=-Integer.MAX_VALUE,top=Integer.MAX_VALUE,bottom=-Integer.MAX_VALUE,nodes=this.nodes,s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];recursive&&null!=lNode.child&&lNode.updateBounds(),left>(nodeLeft=lNode.getLeft())&&(left=nodeLeft),right<(nodeRight=lNode.getRight())&&(right=nodeRight),top>(nodeTop=lNode.getTop())&&(top=nodeTop),bottom<(nodeBottom=lNode.getBottom())&&(bottom=nodeBottom)}var boundingRect=new RectangleD(left,top,right-left,bottom-top);left==Integer.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),margin=null!=nodes[0].getParent().paddingLeft?nodes[0].getParent().paddingLeft:this.margin,this.left=boundingRect.x-margin,this.right=boundingRect.x+boundingRect.width+margin,this.top=boundingRect.y-margin,this.bottom=boundingRect.y+boundingRect.height+margin},LGraph.calculateBounds=function(nodes){for(var nodeLeft,nodeRight,nodeTop,nodeBottom,left=Integer.MAX_VALUE,right=-Integer.MAX_VALUE,top=Integer.MAX_VALUE,bottom=-Integer.MAX_VALUE,s=nodes.length,i=0;i<s;i++){var lNode=nodes[i];left>(nodeLeft=lNode.getLeft())&&(left=nodeLeft),right<(nodeRight=lNode.getRight())&&(right=nodeRight),top>(nodeTop=lNode.getTop())&&(top=nodeTop),bottom<(nodeBottom=lNode.getBottom())&&(bottom=nodeBottom)}return new RectangleD(left,top,right-left,bottom-top)},LGraph.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},LGraph.prototype.getEstimatedSize=function(){if(this.estimatedSize==Integer.MIN_VALUE)throw"assert failed";return this.estimatedSize},LGraph.prototype.calcEstimatedSize=function(){for(var size=0,nodes=this.nodes,s=nodes.length,i=0;i<s;i++)size+=nodes[i].calcEstimatedSize();return this.estimatedSize=0==size?LayoutConstants.EMPTY_COMPOUND_NODE_SIZE:size/Math.sqrt(this.nodes.length),this.estimatedSize},LGraph.prototype.updateConnected=function(){var self=this;if(0!=this.nodes.length){var neighborEdges,currentNeighbor,queue=new LinkedList,visited=new Set,currentNode=this.nodes[0];for(currentNode.withChildren().forEach(function(node){queue.push(node),visited.add(node)});0!==queue.length;)for(var size=(neighborEdges=(currentNode=queue.shift()).getEdges()).length,i=0;i<size;i++)null==(currentNeighbor=neighborEdges[i].getOtherEndInGraph(currentNode,this))||visited.has(currentNeighbor)||currentNeighbor.withChildren().forEach(function(node){queue.push(node),visited.add(node)});if(this.isConnected=!1,visited.size>=this.nodes.length){var noOfVisitedInThisGraph=0;visited.forEach(function(visitedNode){visitedNode.owner==self&&noOfVisitedInThisGraph++}),noOfVisitedInThisGraph==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},module2.exports=LGraph},function(module2,exports$12,__webpack_require__){var LGraph,LEdge=__webpack_require__(1);function LGraphManager(layout){LGraph=__webpack_require__(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(null==newEdge&&null==sourceNode&&null==targetNode){if(null==newGraph)throw"Graph is null!";if(null==parentNode)throw"Parent node is null!";if(this.graphs.indexOf(newGraph)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(newGraph),null!=newGraph.parent)throw"Already has a parent!";if(null!=parentNode.child)throw"Already has a child!";return newGraph.parent=parentNode,parentNode.child=newGraph,newGraph}targetNode=newEdge,newEdge=newGraph;var sourceGraph=(sourceNode=parentNode).getOwner(),targetGraph=targetNode.getOwner();if(null==sourceGraph||sourceGraph.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==targetGraph||targetGraph.getGraphManager()!=this)throw"Target not in this graph mgr!";if(sourceGraph==targetGraph)return newEdge.isInterGraph=!1,sourceGraph.add(newEdge,sourceNode,targetNode);if(newEdge.isInterGraph=!0,newEdge.source=sourceNode,newEdge.target=targetNode,this.edges.indexOf(newEdge)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(newEdge),null==newEdge.source||null==newEdge.target)throw"Edge source and/or target is null!";if(-1!=newEdge.source.edges.indexOf(newEdge)||-1!=newEdge.target.edges.indexOf(newEdge))throw"Edge already in source and/or target incidency list!";return newEdge.source.edges.push(newEdge),newEdge.target.edges.push(newEdge),newEdge},LGraphManager.prototype.remove=function(lObj){if(lObj instanceof LGraph){var graph=lObj;if(graph.getGraphManager()!=this)throw"Graph not in this graph mgr";if(graph!=this.rootGraph&&(null==graph.parent||graph.parent.graphManager!=this))throw"Invalid parent node!";for(var edge,edgesToBeRemoved=[],s=(edgesToBeRemoved=edgesToBeRemoved.concat(graph.getEdges())).length,i=0;i<s;i++)edge=edgesToBeRemoved[i],graph.remove(edge);var node,nodesToBeRemoved=[];for(s=(nodesToBeRemoved=nodesToBeRemoved.concat(graph.getNodes())).length,i=0;i<s;i++)node=nodesToBeRemoved[i],graph.remove(node);graph==this.rootGraph&&this.setRootGraph(null);var index=this.graphs.indexOf(graph);this.graphs.splice(index,1),graph.parent=null}else if(lObj instanceof LEdge){if(null==(edge=lObj))throw"Edge is null!";if(!edge.isInterGraph)throw"Not an inter-graph edge!";if(null==edge.source||null==edge.target)throw"Source and/or target is null!";if(-1==edge.source.edges.indexOf(edge)||-1==edge.target.edges.indexOf(edge))throw"Source and/or target doesn't know this edge!";if(index=edge.source.edges.indexOf(edge),edge.source.edges.splice(index,1),index=edge.target.edges.indexOf(edge),edge.target.edges.splice(index,1),null==edge.source.owner||null==edge.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==edge.source.owner.getGraphManager().edges.indexOf(edge))throw"Not in owner graph manager's edge list!";index=edge.source.owner.getGraphManager().edges.indexOf(edge),edge.source.owner.getGraphManager().edges.splice(index,1)}},LGraphManager.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},LGraphManager.prototype.getGraphs=function(){return this.graphs},LGraphManager.prototype.getAllNodes=function(){if(null==this.allNodes){for(var nodeList=[],graphs=this.getGraphs(),s=graphs.length,i=0;i<s;i++)nodeList=nodeList.concat(graphs[i].getNodes());this.allNodes=nodeList}return this.allNodes},LGraphManager.prototype.resetAllNodes=function(){this.allNodes=null},LGraphManager.prototype.resetAllEdges=function(){this.allEdges=null},LGraphManager.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},LGraphManager.prototype.getAllEdges=function(){if(null==this.allEdges){var edgeList=[],graphs=this.getGraphs();graphs.length;for(var i=0;i<graphs.length;i++)edgeList=edgeList.concat(graphs[i].getEdges());edgeList=edgeList.concat(this.edges),this.allEdges=edgeList}return this.allEdges},LGraphManager.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},LGraphManager.prototype.setAllNodesToApplyGravitation=function(nodeList){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=nodeList},LGraphManager.prototype.getRoot=function(){return this.rootGraph},LGraphManager.prototype.setRootGraph=function(graph){if(graph.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=graph,null==graph.parent&&(graph.parent=this.layout.newNode("Root node"))},LGraphManager.prototype.getLayout=function(){return this.layout},LGraphManager.prototype.isOneAncestorOfOther=function(firstNode,secondNode){if(null==firstNode||null==secondNode)throw"assert failed";if(firstNode==secondNode)return!0;for(var parentNode,ownerGraph=firstNode.getOwner();null!=(parentNode=ownerGraph.getParent());){if(parentNode==secondNode)return!0;if(null==(ownerGraph=parentNode.getOwner()))break}for(ownerGraph=secondNode.getOwner();null!=(parentNode=ownerGraph.getParent());){if(parentNode==firstNode)return!0;if(null==(ownerGraph=parentNode.getOwner()))break}return!1},LGraphManager.prototype.calcLowestCommonAncestors=function(){for(var edge,sourceNode,targetNode,sourceAncestorGraph,targetAncestorGraph,edges=this.getAllEdges(),s=edges.length,i=0;i<s;i++)if(sourceNode=(edge=edges[i]).source,targetNode=edge.target,edge.lca=null,edge.sourceInLca=sourceNode,edge.targetInLca=targetNode,sourceNode!=targetNode){for(sourceAncestorGraph=sourceNode.getOwner();null==edge.lca;){for(edge.targetInLca=targetNode,targetAncestorGraph=targetNode.getOwner();null==edge.lca;){if(targetAncestorGraph==sourceAncestorGraph){edge.lca=targetAncestorGraph;break}if(targetAncestorGraph==this.rootGraph)break;if(null!=edge.lca)throw"assert failed";edge.targetInLca=targetAncestorGraph.getParent(),targetAncestorGraph=edge.targetInLca.getOwner()}if(sourceAncestorGraph==this.rootGraph)break;null==edge.lca&&(edge.sourceInLca=sourceAncestorGraph.getParent(),sourceAncestorGraph=edge.sourceInLca.getOwner())}if(null==edge.lca)throw"assert failed"}else edge.lca=sourceNode.getOwner()},LGraphManager.prototype.calcLowestCommonAncestor=function(firstNode,secondNode){if(firstNode==secondNode)return firstNode.getOwner();for(var firstOwnerGraph=firstNode.getOwner();null!=firstOwnerGraph;){for(var secondOwnerGraph=secondNode.getOwner();null!=secondOwnerGraph;){if(secondOwnerGraph==firstOwnerGraph)return secondOwnerGraph;secondOwnerGraph=secondOwnerGraph.getParent().getOwner()}firstOwnerGraph=firstOwnerGraph.getParent().getOwner()}return firstOwnerGraph},LGraphManager.prototype.calcInclusionTreeDepths=function(graph,depth){var node;null==graph&&null==depth&&(graph=this.rootGraph,depth=1);for(var nodes=graph.getNodes(),s=nodes.length,i=0;i<s;i++)(node=nodes[i]).inclusionTreeDepth=depth,null!=node.child&&this.calcInclusionTreeDepths(node.child,depth+1)},LGraphManager.prototype.includesInvalidEdge=function(){for(var edge,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=3*FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL,FDLayoutConstants.MIN_REPULSION_DIST=FDLayoutConstants.DEFAULT_EDGE_LENGTH/10,FDLayoutConstants.CONVERGENCE_CHECK_PERIOD=100,FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,FDLayoutConstants.MIN_EDGE_LENGTH=1,FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD=10,module2.exports=FDLayoutConstants},function(module2,exports$12,__webpack_require__){var Point2=__webpack_require__(12);function IGeometry(){}IGeometry.calcSeparationAmount=function(rectA,rectB,overlapAmount,separationBuffer){if(!rectA.intersects(rectB))throw"assert failed";var directions=new Array(2);this.decideDirectionsForOverlappingNodes(rectA,rectB,directions),overlapAmount[0]=Math.min(rectA.getRight(),rectB.getRight())-Math.max(rectA.x,rectB.x),overlapAmount[1]=Math.min(rectA.getBottom(),rectB.getBottom())-Math.max(rectA.y,rectB.y),rectA.getX()<=rectB.getX()&&rectA.getRight()>=rectB.getRight()?overlapAmount[0]+=Math.min(rectB.getX()-rectA.getX(),rectA.getRight()-rectB.getRight()):rectB.getX()<=rectA.getX()&&rectB.getRight()>=rectA.getRight()&&(overlapAmount[0]+=Math.min(rectA.getX()-rectB.getX(),rectB.getRight()-rectA.getRight())),rectA.getY()<=rectB.getY()&&rectA.getBottom()>=rectB.getBottom()?overlapAmount[1]+=Math.min(rectB.getY()-rectA.getY(),rectA.getBottom()-rectB.getBottom()):rectB.getY()<=rectA.getY()&&rectB.getBottom()>=rectA.getBottom()&&(overlapAmount[1]+=Math.min(rectA.getY()-rectB.getY(),rectB.getBottom()-rectA.getBottom()));var slope=Math.abs((rectB.getCenterY()-rectA.getCenterY())/(rectB.getCenterX()-rectA.getCenterX()));rectB.getCenterY()===rectA.getCenterY()&&rectB.getCenterX()===rectA.getCenterX()&&(slope=1);var moveByY=slope*overlapAmount[0],moveByX=overlapAmount[1]/slope;overlapAmount[0]<moveByX?moveByX=overlapAmount[0]:moveByY=overlapAmount[1],overlapAmount[0]=-1*directions[0]*(moveByX/2+separationBuffer),overlapAmount[1]=-1*directions[1]*(moveByY/2+separationBuffer)},IGeometry.decideDirectionsForOverlappingNodes=function(rectA,rectB,directions){rectA.getCenterX()<rectB.getCenterX()?directions[0]=-1:directions[0]=1,rectA.getCenterY()<rectB.getCenterY()?directions[1]=-1:directions[1]=1},IGeometry.getIntersection2=function(rectA,rectB,result){var p1x=rectA.getCenterX(),p1y=rectA.getCenterY(),p2x=rectB.getCenterX(),p2y=rectB.getCenterY();if(rectA.intersects(rectB))return result[0]=p1x,result[1]=p1y,result[2]=p2x,result[3]=p2y,!0;var topLeftAx=rectA.getX(),topLeftAy=rectA.getY(),topRightAx=rectA.getRight(),bottomLeftAx=rectA.getX(),bottomLeftAy=rectA.getBottom(),bottomRightAx=rectA.getRight(),halfWidthA=rectA.getWidthHalf(),halfHeightA=rectA.getHeightHalf(),topLeftBx=rectB.getX(),topLeftBy=rectB.getY(),topRightBx=rectB.getRight(),bottomLeftBx=rectB.getX(),bottomLeftBy=rectB.getBottom(),bottomRightBx=rectB.getRight(),halfWidthB=rectB.getWidthHalf(),halfHeightB=rectB.getHeightHalf(),clipPointAFound=!1,clipPointBFound=!1;if(p1x===p2x){if(p1y>p2y)return result[0]=p1x,result[1]=topLeftAy,result[2]=p2x,result[3]=bottomLeftBy,!1;if(p1y<p2y)return result[0]=p1x,result[1]=bottomLeftAy,result[2]=p2x,result[3]=topLeftBy,!1}else if(p1y===p2y){if(p1x>p2x)return result[0]=topLeftAx,result[1]=p1y,result[2]=topRightBx,result[3]=p2y,!1;if(p1x<p2x)return result[0]=topRightAx,result[1]=p1y,result[2]=topLeftBx,result[3]=p2y,!1}else{var slopeA=rectA.height/rectA.width,slopeB=rectB.height/rectB.width,slopePrime=(p2y-p1y)/(p2x-p1x),cardinalDirectionA=void 0,cardinalDirectionB=void 0,tempPointAx=void 0,tempPointAy=void 0,tempPointBx=void 0,tempPointBy=void 0;if(-slopeA===slopePrime?p1x>p2x?(result[0]=bottomLeftAx,result[1]=bottomLeftAy,clipPointAFound=!0):(result[0]=topRightAx,result[1]=topLeftAy,clipPointAFound=!0):slopeA===slopePrime&&(p1x>p2x?(result[0]=topLeftAx,result[1]=topLeftAy,clipPointAFound=!0):(result[0]=bottomRightAx,result[1]=bottomLeftAy,clipPointAFound=!0)),-slopeB===slopePrime?p2x>p1x?(result[2]=bottomLeftBx,result[3]=bottomLeftBy,clipPointBFound=!0):(result[2]=topRightBx,result[3]=topLeftBy,clipPointBFound=!0):slopeB===slopePrime&&(p2x>p1x?(result[2]=topLeftBx,result[3]=topLeftBy,clipPointBFound=!0):(result[2]=bottomRightBx,result[3]=bottomLeftBy,clipPointBFound=!0)),clipPointAFound&&clipPointBFound)return!1;if(p1x>p2x?p1y>p2y?(cardinalDirectionA=this.getCardinalDirection(slopeA,slopePrime,4),cardinalDirectionB=this.getCardinalDirection(slopeB,slopePrime,2)):(cardinalDirectionA=this.getCardinalDirection(-slopeA,slopePrime,3),cardinalDirectionB=this.getCardinalDirection(-slopeB,slopePrime,1)):p1y>p2y?(cardinalDirectionA=this.getCardinalDirection(-slopeA,slopePrime,1),cardinalDirectionB=this.getCardinalDirection(-slopeB,slopePrime,3)):(cardinalDirectionA=this.getCardinalDirection(slopeA,slopePrime,2),cardinalDirectionB=this.getCardinalDirection(slopeB,slopePrime,4)),!clipPointAFound)switch(cardinalDirectionA){case 1:tempPointAy=topLeftAy,tempPointAx=p1x+-halfHeightA/slopePrime,result[0]=tempPointAx,result[1]=tempPointAy;break;case 2:tempPointAx=bottomRightAx,tempPointAy=p1y+halfWidthA*slopePrime,result[0]=tempPointAx,result[1]=tempPointAy;break;case 3:tempPointAy=bottomLeftAy,tempPointAx=p1x+halfHeightA/slopePrime,result[0]=tempPointAx,result[1]=tempPointAy;break;case 4:tempPointAx=bottomLeftAx,tempPointAy=p1y+-halfWidthA*slopePrime,result[0]=tempPointAx,result[1]=tempPointAy}if(!clipPointBFound)switch(cardinalDirectionB){case 1:tempPointBy=topLeftBy,tempPointBx=p2x+-halfHeightB/slopePrime,result[2]=tempPointBx,result[3]=tempPointBy;break;case 2:tempPointBx=bottomRightBx,tempPointBy=p2y+halfWidthB*slopePrime,result[2]=tempPointBx,result[3]=tempPointBy;break;case 3:tempPointBy=bottomLeftBy,tempPointBx=p2x+halfHeightB/slopePrime,result[2]=tempPointBx,result[3]=tempPointBy;break;case 4:tempPointBx=bottomLeftBx,tempPointBy=p2y+-halfWidthB*slopePrime,result[2]=tempPointBx,result[3]=tempPointBy}}return!1},IGeometry.getCardinalDirection=function(slope,slopePrime,line){return slope>slopePrime?line:1+line%4},IGeometry.getIntersection=function(s1,s2,f1,f2){if(null==f2)return this.getIntersection2(s1,s2,f1);var a1,a2,b1,b2,c1,c2,denom,x1=s1.x,y1=s1.y,x2=s2.x,y2=s2.y,x3=f1.x,y3=f1.y,x4=f2.x,y4=f2.y;return 0===(denom=(a1=y2-y1)*(b2=x3-x4)-(a2=y4-y3)*(b1=x1-x2))?null:new Point2((b1*(c2=x4*y3-x3*y4)-b2*(c1=x2*y1-x1*y2))/denom,(a2*c1-a1*c2)/denom)},IGeometry.angleOfVector=function(Cx,Cy,Nx,Ny){var C_angle=void 0;return Cx!==Nx?(C_angle=Math.atan((Ny-Cy)/(Nx-Cx)),Nx<Cx?C_angle+=Math.PI:Ny<Cy&&(C_angle+=this.TWO_PI)):C_angle=Ny<Cy?this.ONE_AND_HALF_PI:this.HALF_PI,C_angle},IGeometry.doIntersect=function(p1,p2,p3,p4){var a=p1.x,b=p1.y,c=p2.x,d=p2.y,p=p3.x,q=p3.y,r=p4.x,s=p4.y,det=(c-a)*(s-q)-(r-p)*(d-b);if(0===det)return!1;var lambda=((s-q)*(r-a)+(p-r)*(s-b))/det,gamma=((b-d)*(r-a)+(c-a)*(s-b))/det;return 0<lambda&&lambda<1&&0<gamma&&gamma<1},IGeometry.HALF_PI=.5*Math.PI,IGeometry.ONE_AND_HALF_PI=1.5*Math.PI,IGeometry.TWO_PI=2*Math.PI,IGeometry.THREE_PI=3*Math.PI,module2.exports=IGeometry},function(module2,exports$12,__webpack_require__){function IMath(){}IMath.sign=function(value){return value>0?1:value<0?-1:0},IMath.floor=function(value){return value<0?Math.ceil(value):Math.floor(value)},IMath.ceil=function(value){return value<0?Math.floor(value):Math.ceil(value)},module2.exports=IMath},function(module2,exports$12,__webpack_require__){function Integer(){}Integer.MAX_VALUE=2147483647,Integer.MIN_VALUE=-2147483648,module2.exports=Integer},function(module2,exports$12,__webpack_require__){var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),nodeFrom=function(value){return{value:value,next:null,prev:null}},add=function(prev,node,next2,list){return null!==prev?prev.next=node:list.head=node,null!==next2?next2.prev=node:list.tail=node,node.prev=prev,node.next=next2,list.length++,node},_remove=function(node,list){var prev=node.prev,next2=node.next;return null!==prev?prev.next=next2:list.head=next2,null!==next2?next2.prev=prev:list.tail=prev,node.prev=node.next=null,list.length--,node},LinkedList=function(){function LinkedList2(vals){var _this=this;!function(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,LinkedList2),this.length=0,this.head=null,this.tail=null,null!=vals&&vals.forEach(function(v){return _this.push(v)})}return _createClass(LinkedList2,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(val,otherNode){return add(otherNode.prev,nodeFrom(val),otherNode,this)}},{key:"insertAfter",value:function(val,otherNode){return add(otherNode,nodeFrom(val),otherNode.next,this)}},{key:"insertNodeBefore",value:function(newNode,otherNode){return add(otherNode.prev,newNode,otherNode,this)}},{key:"insertNodeAfter",value:function(newNode,otherNode){return add(otherNode,newNode,otherNode.next,this)}},{key:"push",value:function(val){return add(this.tail,nodeFrom(val),null,this)}},{key:"unshift",value:function(val){return add(null,nodeFrom(val),this.head,this)}},{key:"remove",value:function(node){return _remove(node,this)}},{key:"pop",value:function(){return _remove(this.tail,this).value}},{key:"popNode",value:function(){return _remove(this.tail,this)}},{key:"shift",value:function(){return _remove(this.head,this).value}},{key:"shiftNode",value:function(){return _remove(this.head,this)}},{key:"get_object_at",value:function(index){if(index<=this.length()){for(var i=1,current=this.head;i<index;)current=current.next,i++;return current.value}}},{key:"set_object_at",value:function(index,value){if(index<=this.length()){for(var i=1,current=this.head;i<index;)current=current.next,i++;current.value=value}}}]),LinkedList2}();module2.exports=LinkedList},function(module2,exports$12,__webpack_require__){function Point2(x,y,p){this.x=null,this.y=null,null==x&&null==y&&null==p?(this.x=0,this.y=0):"number"==typeof x&&"number"==typeof y&&null==p?(this.x=x,this.y=y):"Point"==x.constructor.name&&null==y&&null==p&&(p=x,this.x=p.x,this.y=p.y)}Point2.prototype.getX=function(){return this.x},Point2.prototype.getY=function(){return this.y},Point2.prototype.getLocation=function(){return new Point2(this.x,this.y)},Point2.prototype.setLocation=function(x,y,p){"Point"==x.constructor.name&&null==y&&null==p?(p=x,this.setLocation(p.x,p.y)):"number"==typeof x&&"number"==typeof y&&null==p&&(parseInt(x)==x&&parseInt(y)==y?this.move(x,y):(this.x=Math.floor(x+.5),this.y=Math.floor(y+.5)))},Point2.prototype.move=function(x,y){this.x=x,this.y=y},Point2.prototype.translate=function(dx,dy){this.x+=dx,this.y+=dy},Point2.prototype.equals=function(obj){if("Point"==obj.constructor.name){var pt=obj;return this.x==pt.x&&this.y==pt.y}return this==obj},Point2.prototype.toString=function(){return(new Point2).constructor.name+"[x="+this.x+",y="+this.y+"]"},module2.exports=Point2},function(module2,exports$12,__webpack_require__){function RectangleD(x,y,width,height){this.x=0,this.y=0,this.width=0,this.height=0,null!=x&&null!=y&&null!=width&&null!=height&&(this.x=x,this.y=y,this.width=width,this.height=height)}RectangleD.prototype.getX=function(){return this.x},RectangleD.prototype.setX=function(x){this.x=x},RectangleD.prototype.getY=function(){return this.y},RectangleD.prototype.setY=function(y){this.y=y},RectangleD.prototype.getWidth=function(){return this.width},RectangleD.prototype.setWidth=function(width){this.width=width},RectangleD.prototype.getHeight=function(){return this.height},RectangleD.prototype.setHeight=function(height){this.height=height},RectangleD.prototype.getRight=function(){return this.x+this.width},RectangleD.prototype.getBottom=function(){return this.y+this.height},RectangleD.prototype.intersects=function(a){return!(this.getRight()<a.x||this.getBottom()<a.y||a.getRight()<this.x||a.getBottom()<this.y)},RectangleD.prototype.getCenterX=function(){return this.x+this.width/2},RectangleD.prototype.getMinX=function(){return this.getX()},RectangleD.prototype.getMaxX=function(){return this.getX()+this.width},RectangleD.prototype.getCenterY=function(){return this.y+this.height/2},RectangleD.prototype.getMinY=function(){return this.getY()},RectangleD.prototype.getMaxY=function(){return this.getY()+this.height},RectangleD.prototype.getWidthHalf=function(){return this.width/2},RectangleD.prototype.getHeightHalf=function(){return this.height/2},module2.exports=RectangleD},function(module2,exports$12,__webpack_require__){var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};function UniqueIDGeneretor(){}UniqueIDGeneretor.lastID=0,UniqueIDGeneretor.createID=function(obj){return UniqueIDGeneretor.isPrimitive(obj)?obj:(null!=obj.uniqueID||(obj.uniqueID=UniqueIDGeneretor.getString(),UniqueIDGeneretor.lastID++),obj.uniqueID)},UniqueIDGeneretor.getString=function(id){return null==id&&(id=UniqueIDGeneretor.lastID),"Object#"+id},UniqueIDGeneretor.isPrimitive=function(arg){var type=void 0===arg?"undefined":_typeof(arg);return null==arg||"object"!=type&&"function"!=type},module2.exports=UniqueIDGeneretor},function(module2,exports$12,__webpack_require__){function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}var LayoutConstants=__webpack_require__(0),LGraphManager=__webpack_require__(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,null!=isRemoteUse&&(this.isRemoteUse=isRemoteUse)}Layout2.RANDOM_SEED=1,Layout2.prototype=Object.create(Emitter.prototype),Layout2.prototype.getGraphManager=function(){return this.graphManager},Layout2.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},Layout2.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},Layout2.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},Layout2.prototype.newGraphManager=function(){var gm=new LGraphManager(this);return this.graphManager=gm,gm},Layout2.prototype.newGraph=function(vGraph){return new LGraph(null,this.graphManager,vGraph)},Layout2.prototype.newNode=function(vNode){return new LNode(this.graphManager,vNode)},Layout2.prototype.newEdge=function(vEdge){return new LEdge(null,null,vEdge)},Layout2.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},Layout2.prototype.runLayout=function(){var isLayoutSuccessfull;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),isLayoutSuccessfull=!this.checkLayoutSuccess()&&this.layout(),"during"!==LayoutConstants.ANIMATE&&(isLayoutSuccessfull&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,isLayoutSuccessfull)},Layout2.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},Layout2.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var allEdges=this.graphManager.getAllEdges(),i=0;i<allEdges.length;i++)allEdges[i];var nodes=this.graphManager.getRoot().getNodes();for(i=0;i<nodes.length;i++)nodes[i];this.update(this.graphManager.getRoot())}},Layout2.prototype.update=function(obj){if(null==obj)this.update2();else if(obj instanceof LNode){var node=obj;if(null!=node.getChild())for(var nodes=node.getChild().getNodes(),i=0;i<nodes.length;i++)update(nodes[i]);null!=node.vGraphObject&&node.vGraphObject.update(node)}else if(obj instanceof LEdge){var edge=obj;null!=edge.vGraphObject&&edge.vGraphObject.update(edge)}else if(obj instanceof LGraph){var graph=obj;null!=graph.vGraphObject&&graph.vGraphObject.update(graph)}},Layout2.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=LayoutConstants.QUALITY,this.animationDuringLayout=LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=LayoutConstants.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=LayoutConstants.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},Layout2.prototype.transform=function(newLeftTop){if(null==newLeftTop)this.transform(new PointD(0,0));else{var trans=new Transform,leftTop=this.graphManager.getRoot().updateLeftTop();if(null!=leftTop){trans.setWorldOrgX(newLeftTop.x),trans.setWorldOrgY(newLeftTop.y),trans.setDeviceOrgX(leftTop.x),trans.setDeviceOrgY(leftTop.y);for(var nodes=this.getAllNodes(),i=0;i<nodes.length;i++)nodes[i].transform(trans)}}},Layout2.prototype.positionNodesRandomly=function(graph){if(null==graph)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var lNode,childGraph,nodes=graph.getNodes(),i=0;i<nodes.length;i++)null==(childGraph=(lNode=nodes[i]).getChild())||0==childGraph.getNodes().length?lNode.scatter():(this.positionNodesRandomly(childGraph),lNode.updateBounds())},Layout2.prototype.getFlatForest=function(){for(var flatForest=[],isForest=!0,allNodes=this.graphManager.getRoot().getNodes(),isFlat=!0,i=0;i<allNodes.length;i++)null!=allNodes[i].getChild()&&(isFlat=!1);if(!isFlat)return flatForest;var visited=new Set,toBeVisited=[],parents=new Map,unProcessedNodes=[];for(unProcessedNodes=unProcessedNodes.concat(allNodes);unProcessedNodes.length>0&&isForest;){for(toBeVisited.push(unProcessedNodes[0]);toBeVisited.length>0&&isForest;){var currentNode=toBeVisited[0];toBeVisited.splice(0,1),visited.add(currentNode);var neighborEdges=currentNode.getEdges();for(i=0;i<neighborEdges.length;i++){var currentNeighbor=neighborEdges[i].getOtherEnd(currentNode);if(parents.get(currentNode)!=currentNeighbor){if(visited.has(currentNeighbor)){isForest=!1;break}toBeVisited.push(currentNeighbor),parents.set(currentNeighbor,currentNode)}}}if(isForest){var temp=[].concat(_toConsumableArray(visited));for(flatForest.push(temp),i=0;i<temp.length;i++){var value=temp[i],index=unProcessedNodes.indexOf(value);index>-1&&unProcessedNodes.splice(index,1)}visited=new Set,parents=new Map}else flatForest=[]}return flatForest},Layout2.prototype.createDummyNodesForBendpoints=function(edge){for(var dummyNodes=[],prev=edge.source,graph=this.graphManager.calcLowestCommonAncestor(edge.source,edge.target),i=0;i<edge.bendpoints.length;i++){var dummyNode=this.newNode(null);dummyNode.setRect(new Point(0,0),new Dimension(1,1)),graph.add(dummyNode);var dummyEdge=this.newEdge(null);this.graphManager.add(dummyEdge,prev,dummyNode),dummyNodes.add(dummyNode),prev=dummyNode}return dummyEdge=this.newEdge(null),this.graphManager.add(dummyEdge,prev,edge.target),this.edgeToDummyNodes.set(edge,dummyNodes),edge.isInterGraph()?this.graphManager.remove(edge):graph.remove(edge),dummyNodes},Layout2.prototype.createBendpointsFromDummyNodes=function(){var edges=[];edges=edges.concat(this.graphManager.getAllEdges()),edges=[].concat(_toConsumableArray(this.edgeToDummyNodes.keys())).concat(edges);for(var k=0;k<edges.length;k++){var lEdge=edges[k];if(lEdge.bendpoints.length>0){for(var path=this.edgeToDummyNodes.get(lEdge),i=0;i<path.length;i++){var dummyNode=path[i],p=new PointD(dummyNode.getCenterX(),dummyNode.getCenterY()),ebp=lEdge.bendpoints.get(i);ebp.x=p.x,ebp.y=p.y,dummyNode.getOwner().remove(dummyNode)}this.graphManager.add(lEdge,lEdge.source,lEdge.target)}}},Layout2.transform=function(sliderValue,defaultValue,minDiv,maxMul){if(null!=minDiv&&null!=maxMul){var value=defaultValue;return sliderValue<=50?value-=(defaultValue-defaultValue/minDiv)/50*(50-sliderValue):value+=(defaultValue*maxMul-defaultValue)/50*(sliderValue-50),value}var a,b;return sliderValue<=50?(a=9*defaultValue/500,b=defaultValue/10):(a=9*defaultValue/50,b=-8*defaultValue),a*sliderValue+b},Layout2.findCenterOfTree=function(nodes){var list=[];list=list.concat(nodes);var removedNodes=[],remainingDegrees=new Map,foundCenter=!1,centerNode=null;1!=list.length&&2!=list.length||(foundCenter=!0,centerNode=list[0]);for(var i=0;i<list.length;i++){var degree=(node=list[i]).getNeighborsList().size;remainingDegrees.set(node,node.getNeighborsList().size),1==degree&&removedNodes.push(node)}var tempList=[];for(tempList=tempList.concat(removedNodes);!foundCenter;){var tempList2=[];for(tempList2=tempList2.concat(tempList),tempList=[],i=0;i<list.length;i++){var node=list[i],index=list.indexOf(node);index>=0&&list.splice(index,1),node.getNeighborsList().forEach(function(neighbour){if(removedNodes.indexOf(neighbour)<0){var newDegree=remainingDegrees.get(neighbour)-1;1==newDegree&&tempList.push(neighbour),remainingDegrees.set(neighbour,newDegree)}})}removedNodes=removedNodes.concat(tempList),1!=list.length&&2!=list.length||(foundCenter=!0,centerNode=list[0])}return centerNode},Layout2.prototype.setGraphManager=function(gm){this.graphManager=gm},module2.exports=Layout2},function(module2,exports$12,__webpack_require__){function RandomSeed(){}RandomSeed.seed=1,RandomSeed.x=0,RandomSeed.nextDouble=function(){return RandomSeed.x=1e4*Math.sin(RandomSeed.seed++),RandomSeed.x-Math.floor(RandomSeed.x)},module2.exports=RandomSeed},function(module2,exports$12,__webpack_require__){var PointD=__webpack_require__(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 0!=worldExtX&&(xDevice=this.ldeviceOrgX+(x-this.lworldOrgX)*this.ldeviceExtX/worldExtX),xDevice},Transform.prototype.transformY=function(y){var yDevice=0,worldExtY=this.lworldExtY;return 0!=worldExtY&&(yDevice=this.ldeviceOrgY+(y-this.lworldOrgY)*this.ldeviceExtY/worldExtY),yDevice},Transform.prototype.inverseTransformX=function(x){var xWorld=0,deviceExtX=this.ldeviceExtX;return 0!=deviceExtX&&(xWorld=this.lworldOrgX+(x-this.ldeviceOrgX)*this.lworldExtX/deviceExtX),xWorld},Transform.prototype.inverseTransformY=function(y){var yWorld=0,deviceExtY=this.ldeviceExtY;return 0!=deviceExtY&&(yWorld=this.lworldOrgY+(y-this.ldeviceOrgY)*this.lworldExtY/deviceExtY),yWorld},Transform.prototype.inverseTransformPoint=function(inPoint){return new PointD(this.inverseTransformX(inPoint.x),this.inverseTransformY(inPoint.y))},module2.exports=Transform},function(module2,exports$12,__webpack_require__){var Layout2=__webpack_require__(15),FDLayoutConstants=__webpack_require__(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}for(var prop in FDLayout.prototype=Object.create(Layout2.prototype),Layout2)FDLayout[prop]=Layout2[prop];FDLayout.prototype.initParameters=function(){Layout2.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},FDLayout.prototype.calcIdealEdgeLengths=function(){for(var edge,lcaDepth,source,target,sizeOfSourceInLca,sizeOfTargetInLca,allEdges=this.getGraphManager().getAllEdges(),i=0;i<allEdges.length;i++)(edge=allEdges[i]).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(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},FDLayout.prototype.calcSpringForces=function(){for(var edge,lEdges=this.getAllEdges(),i=0;i<lEdges.length;i++)edge=lEdges[i],this.calcSpringForce(edge,edge.idealLength)},FDLayout.prototype.calcRepulsionForces=function(){var i,j,nodeA,nodeB,processedNodeSet,gridUpdateAllowed=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],forceToNodeSurroundingUpdate=arguments.length>1&&void 0!==arguments[1]&&arguments[1],lNodes=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD==1&&gridUpdateAllowed&&this.updateGrid(),processedNodeSet=new Set,i=0;i<lNodes.length;i++)nodeA=lNodes[i],this.calculateRepulsionForceOfANode(nodeA,processedNodeSet,gridUpdateAllowed,forceToNodeSurroundingUpdate),processedNodeSet.add(nodeA);else for(i=0;i<lNodes.length;i++)for(nodeA=lNodes[i],j=i+1;j<lNodes.length;j++)nodeB=lNodes[j],nodeA.getOwner()==nodeB.getOwner()&&this.calcRepulsionForce(nodeA,nodeB)},FDLayout.prototype.calcGravitationalForces=function(){for(var node,lNodes=this.getAllNodesToApplyGravitation(),i=0;i<lNodes.length;i++)node=lNodes[i],this.calcGravitationalForce(node)},FDLayout.prototype.moveNodes=function(){for(var lNodes=this.getAllNodes(),i=0;i<lNodes.length;i++)lNodes[i].move()},FDLayout.prototype.calcSpringForce=function(edge,idealLength){var length,springForce,springForceX,springForceY,sourceNode=edge.getSource(),targetNode=edge.getTarget();if(this.uniformLeafNodeSizes&&null==sourceNode.getChild()&&null==targetNode.getChild())edge.updateLengthSimple();else if(edge.updateLength(),edge.isOverlapingSourceAndTarget)return;0!=(length=edge.getLength())&&(springForceX=(springForce=this.springConstant*(length-idealLength))*(edge.lengthX/length),springForceY=springForce*(edge.lengthY/length),sourceNode.springForceX+=springForceX,sourceNode.springForceY+=springForceY,targetNode.springForceX-=springForceX,targetNode.springForceY-=springForceY)},FDLayout.prototype.calcRepulsionForce=function(nodeA,nodeB){var distanceX,distanceY,distanceSquared,distance,repulsionForce,repulsionForceX,repulsionForceY,rectA=nodeA.getRect(),rectB=nodeB.getRect(),overlapAmount=new Array(2),clipPoints=new Array(4);if(rectA.intersects(rectB)){IGeometry.calcSeparationAmount(rectA,rectB,overlapAmount,FDLayoutConstants.DEFAULT_EDGE_LENGTH/2),repulsionForceX=2*overlapAmount[0],repulsionForceY=2*overlapAmount[1];var childrenConstant=nodeA.noOfChildren*nodeB.noOfChildren/(nodeA.noOfChildren+nodeB.noOfChildren);nodeA.repulsionForceX-=childrenConstant*repulsionForceX,nodeA.repulsionForceY-=childrenConstant*repulsionForceY,nodeB.repulsionForceX+=childrenConstant*repulsionForceX,nodeB.repulsionForceY+=childrenConstant*repulsionForceY}else this.uniformLeafNodeSizes&&null==nodeA.getChild()&&null==nodeB.getChild()?(distanceX=rectB.getCenterX()-rectA.getCenterX(),distanceY=rectB.getCenterY()-rectA.getCenterY()):(IGeometry.getIntersection(rectA,rectB,clipPoints),distanceX=clipPoints[2]-clipPoints[0],distanceY=clipPoints[3]-clipPoints[1]),Math.abs(distanceX)<FDLayoutConstants.MIN_REPULSION_DIST&&(distanceX=IMath.sign(distanceX)*FDLayoutConstants.MIN_REPULSION_DIST),Math.abs(distanceY)<FDLayoutConstants.MIN_REPULSION_DIST&&(distanceY=IMath.sign(distanceY)*FDLayoutConstants.MIN_REPULSION_DIST),distanceSquared=distanceX*distanceX+distanceY*distanceY,distance=Math.sqrt(distanceSquared),repulsionForceX=(repulsionForce=this.repulsionConstant*nodeA.noOfChildren*nodeB.noOfChildren/distanceSquared)*distanceX/distance,repulsionForceY=repulsionForce*distanceY/distance,nodeA.repulsionForceX-=repulsionForceX,nodeA.repulsionForceY-=repulsionForceY,nodeB.repulsionForceX+=repulsionForceX,nodeB.repulsionForceY+=repulsionForceY},FDLayout.prototype.calcGravitationalForce=function(node){var ownerGraph,ownerCenterX,ownerCenterY,distanceX,distanceY,absDistanceX,absDistanceY,estimatedSize;ownerCenterX=((ownerGraph=node.getOwner()).getRight()+ownerGraph.getLeft())/2,ownerCenterY=(ownerGraph.getTop()+ownerGraph.getBottom())/2,distanceX=node.getCenterX()-ownerCenterX,distanceY=node.getCenterY()-ownerCenterY,absDistanceX=Math.abs(distanceX)+node.getWidth()/2,absDistanceY=Math.abs(distanceY)+node.getHeight()/2,node.getOwner()==this.graphManager.getRoot()?(absDistanceX>(estimatedSize=ownerGraph.getEstimatedSize()*this.gravityRangeFactor)||absDistanceY>estimatedSize)&&(node.gravitationForceX=-this.gravityConstant*distanceX,node.gravitationForceY=-this.gravityConstant*distanceY):(absDistanceX>(estimatedSize=ownerGraph.getEstimatedSize()*this.compoundGravityRangeFactor)||absDistanceY>estimatedSize)&&(node.gravitationForceX=-this.gravityConstant*distanceX*this.compoundGravityConstant,node.gravitationForceY=-this.gravityConstant*distanceY*this.compoundGravityConstant)},FDLayout.prototype.isConverged=function(){var converged,oscilating=!1;return this.totalIterations>this.maxIterations/3&&(oscilating=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),converged=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,converged||oscilating},FDLayout.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},FDLayout.prototype.calcNoOfChildrenForAllNodes=function(){for(var node,allNodes=this.graphManager.getAllNodes(),i=0;i<allNodes.length;i++)(node=allNodes[i]).noOfChildren=node.getNoOfChildren()},FDLayout.prototype.calcGrid=function(graph){var sizeX,sizeY;sizeX=parseInt(Math.ceil((graph.getRight()-graph.getLeft())/this.repulsionRange)),sizeY=parseInt(Math.ceil((graph.getBottom()-graph.getTop())/this.repulsionRange));for(var grid=new Array(sizeX),i=0;i<sizeX;i++)grid[i]=new Array(sizeY);for(i=0;i<sizeX;i++)for(var j=0;j<sizeY;j++)grid[i][j]=new Array;return grid},FDLayout.prototype.addNodeToGrid=function(v,left,top){var startX,finishX,startY,finishY;startX=parseInt(Math.floor((v.getRect().x-left)/this.repulsionRange)),finishX=parseInt(Math.floor((v.getRect().width+v.getRect().x-left)/this.repulsionRange)),startY=parseInt(Math.floor((v.getRect().y-top)/this.repulsionRange)),finishY=parseInt(Math.floor((v.getRect().height+v.getRect().y-top)/this.repulsionRange));for(var i=startX;i<=finishX;i++)for(var j=startY;j<=finishY;j++)this.grid[i][j].push(v),v.setGridCoordinates(startX,finishX,startY,finishY)},FDLayout.prototype.updateGrid=function(){var i,nodeA,lNodes=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),i=0;i<lNodes.length;i++)nodeA=lNodes[i],this.addNodeToGrid(nodeA,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},FDLayout.prototype.calculateRepulsionForceOfANode=function(nodeA,processedNodeSet,gridUpdateAllowed,forceToNodeSurroundingUpdate){if(this.totalIterations%FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD==1&&gridUpdateAllowed||forceToNodeSurroundingUpdate){var nodeB,surrounding=new Set;nodeA.surrounding=new Array;for(var grid=this.grid,i=nodeA.startX-1;i<nodeA.finishX+2;i++)for(var j=nodeA.startY-1;j<nodeA.finishY+2;j++)if(!(i<0||j<0||i>=grid.length||j>=grid[0].length))for(var k=0;k<grid[i][j].length;k++)if(nodeB=grid[i][j][k],nodeA.getOwner()==nodeB.getOwner()&&nodeA!=nodeB&&!processedNodeSet.has(nodeB)&&!surrounding.has(nodeB)){var distanceX=Math.abs(nodeA.getCenterX()-nodeB.getCenterX())-(nodeA.getWidth()/2+nodeB.getWidth()/2),distanceY=Math.abs(nodeA.getCenterY()-nodeB.getCenterY())-(nodeA.getHeight()/2+nodeB.getHeight()/2);distanceX<=this.repulsionRange&&distanceY<=this.repulsionRange&&surrounding.add(nodeB)}nodeA.surrounding=[].concat(function(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}(surrounding))}for(i=0;i<nodeA.surrounding.length;i++)this.calcRepulsionForce(nodeA,nodeA.surrounding[i])},FDLayout.prototype.calcRepulsionRange=function(){return 0},module2.exports=FDLayout},function(module2,exports$12,__webpack_require__){var LEdge=__webpack_require__(1),FDLayoutConstants=__webpack_require__(7);function FDLayoutEdge(source,target,vEdge){LEdge.call(this,source,target,vEdge),this.idealLength=FDLayoutConstants.DEFAULT_EDGE_LENGTH}for(var prop in FDLayoutEdge.prototype=Object.create(LEdge.prototype),LEdge)FDLayoutEdge[prop]=LEdge[prop];module2.exports=FDLayoutEdge},function(module2,exports$12,__webpack_require__){var LNode=__webpack_require__(3);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=[]}for(var prop in FDLayoutNode.prototype=Object.create(LNode.prototype),LNode)FDLayoutNode[prop]=LNode[prop];FDLayoutNode.prototype.setGridCoordinates=function(_startX,_finishX,_startY,_finishY){this.startX=_startX,this.finishX=_finishX,this.startY=_startY,this.finishY=_finishY},module2.exports=FDLayoutNode},function(module2,exports$12,__webpack_require__){function DimensionD2(width,height){this.width=0,this.height=0,null!==width&&null!==height&&(this.height=height,this.width=width)}DimensionD2.prototype.getWidth=function(){return this.width},DimensionD2.prototype.setWidth=function(width){this.width=width},DimensionD2.prototype.getHeight=function(){return this.height},DimensionD2.prototype.setHeight=function(height){this.height=height},module2.exports=DimensionD2},function(module2,exports$12,__webpack_require__){var UniqueIDGeneretor=__webpack_require__(14);function HashMap(){this.map={},this.keys=[]}HashMap.prototype.put=function(key,value){var theId=UniqueIDGeneretor.createID(key);this.contains(theId)||(this.map[theId]=value,this.keys.push(key))},HashMap.prototype.contains=function(key){return UniqueIDGeneretor.createID(key),null!=this.map[key]},HashMap.prototype.get=function(key){var theId=UniqueIDGeneretor.createID(key);return this.map[theId]},HashMap.prototype.keySet=function(){return this.keys},module2.exports=HashMap},function(module2,exports$12,__webpack_require__){var UniqueIDGeneretor=__webpack_require__(14);function HashSet(){this.set={}}HashSet.prototype.add=function(obj){var theId=UniqueIDGeneretor.createID(obj);this.contains(theId)||(this.set[theId]=obj)},HashSet.prototype.remove=function(obj){delete this.set[UniqueIDGeneretor.createID(obj)]},HashSet.prototype.clear=function(){this.set={}},HashSet.prototype.contains=function(obj){return this.set[UniqueIDGeneretor.createID(obj)]==obj},HashSet.prototype.isEmpty=function(){return 0===this.size()},HashSet.prototype.size=function(){return Object.keys(this.set).length},HashSet.prototype.addAllTo=function(list){for(var keys=Object.keys(this.set),length=keys.length,i=0;i<length;i++)list.push(this.set[keys[i]])},HashSet.prototype.size=function(){return Object.keys(this.set).length},HashSet.prototype.addAll=function(list){for(var s=list.length,i=0;i<s;i++){var v=list[i];this.add(v)}},module2.exports=HashSet},function(module2,exports$12,__webpack_require__){var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),LinkedList=__webpack_require__(11),Quicksort=function(){function Quicksort2(A,compareFunction){!function(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Quicksort2),null===compareFunction&&void 0===compareFunction||(this.compareFunction=this._defaultCompareFunction);var length=void 0;length=A instanceof LinkedList?A.size():A.length,this._quicksort(A,0,length-1)}return _createClass(Quicksort2,[{key:"_quicksort",value:function(A,p,r){if(p<r){var q=this._partition(A,p,r);this._quicksort(A,p,q),this._quicksort(A,q+1,r)}}},{key:"_partition",value:function(A,p,r){for(var x=this._get(A,p),i=p,j=r;;){for(;this.compareFunction(x,this._get(A,j));)j--;for(;this.compareFunction(this._get(A,i),x);)i++;if(!(i<j))return j;this._swap(A,i,j),i++,j--}}},{key:"_get",value:function(object,index){return object instanceof LinkedList?object.get_object_at(index):object[index]}},{key:"_set",value:function(object,index,value){object instanceof LinkedList?object.set_object_at(index,value):object[index]=value}},{key:"_swap",value:function(A,i,j){var temp=this._get(A,i);this._set(A,i,this._get(A,j)),this._set(A,j,temp)}},{key:"_defaultCompareFunction",value:function(a,b){return b>a}}]),Quicksort2}();module2.exports=Quicksort},function(module2,exports$12,__webpack_require__){var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),NeedlemanWunsch=function(){function NeedlemanWunsch2(sequence1,sequence2){var match_score=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,mismatch_penalty=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,gap_penalty=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(instance2,Constructor){if(!(instance2 instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,NeedlemanWunsch2),this.sequence1=sequence1,this.sequence2=sequence2,this.match_score=match_score,this.mismatch_penalty=mismatch_penalty,this.gap_penalty=gap_penalty,this.iMax=sequence1.length+1,this.jMax=sequence2.length+1,this.grid=new Array(this.iMax);for(var i=0;i<this.iMax;i++){this.grid[i]=new Array(this.jMax);for(var j=0;j<this.jMax;j++)this.grid[i][j]=0}this.tracebackGrid=new Array(this.iMax);for(var _i=0;_i<this.iMax;_i++){this.tracebackGrid[_i]=new Array(this.jMax);for(var _j=0;_j<this.jMax;_j++)this.tracebackGrid[_i][_j]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return _createClass(NeedlemanWunsch2,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var j=1;j<this.jMax;j++)this.grid[0][j]=this.grid[0][j-1]+this.gap_penalty,this.tracebackGrid[0][j]=[!1,!1,!0];for(var i=1;i<this.iMax;i++)this.grid[i][0]=this.grid[i-1][0]+this.gap_penalty,this.tracebackGrid[i][0]=[!1,!0,!1];for(var _i2=1;_i2<this.iMax;_i2++)for(var _j2=1;_j2<this.jMax;_j2++){var maxOf=[this.sequence1[_i2-1]===this.sequence2[_j2-1]?this.grid[_i2-1][_j2-1]+this.match_score:this.grid[_i2-1][_j2-1]+this.mismatch_penalty,this.grid[_i2-1][_j2]+this.gap_penalty,this.grid[_i2][_j2-1]+this.gap_penalty],indices=this.arrayAllMaxIndexes(maxOf);this.grid[_i2][_j2]=maxOf[indices[0]],this.tracebackGrid[_i2][_j2]=[indices.includes(0),indices.includes(1),indices.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var inProcessAlignments=[];for(inProcessAlignments.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});inProcessAlignments[0];){var current=inProcessAlignments[0],directions=this.tracebackGrid[current.pos[0]][current.pos[1]];directions[0]&&inProcessAlignments.push({pos:[current.pos[0]-1,current.pos[1]-1],seq1:this.sequence1[current.pos[0]-1]+current.seq1,seq2:this.sequence2[current.pos[1]-1]+current.seq2}),directions[1]&&inProcessAlignments.push({pos:[current.pos[0]-1,current.pos[1]],seq1:this.sequence1[current.pos[0]-1]+current.seq1,seq2:"-"+current.seq2}),directions[2]&&inProcessAlignments.push({pos:[current.pos[0],current.pos[1]-1],seq1:"-"+current.seq1,seq2:this.sequence2[current.pos[1]-1]+current.seq2}),0===current.pos[0]&&0===current.pos[1]&&this.alignments.push({sequence1:current.seq1,sequence2:current.seq2}),inProcessAlignments.shift()}return this.alignments}},{key:"getAllIndexes",value:function(arr,val){for(var indexes=[],i=-1;-1!==(i=arr.indexOf(val,i+1));)indexes.push(i);return indexes}},{key:"arrayAllMaxIndexes",value:function(array){return this.getAllIndexes(array,Math.max.apply(null,array))}}]),NeedlemanWunsch2}();module2.exports=NeedlemanWunsch},function(module2,exports$12,__webpack_require__){var layoutBase2=function(){};layoutBase2.FDLayout=__webpack_require__(18),layoutBase2.FDLayoutConstants=__webpack_require__(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:event,callback:callback})},p.removeListener=function(event,callback){for(var i=this.listeners.length;i>=0;i--){var l=this.listeners[i];l.event===event&&l.callback===callback&&this.listeners.splice(i,1)}},p.emit=function(event,data){for(var i=0;i<this.listeners.length;i++){var l=this.listeners[i];event===l.event&&l.callback(data)}},module2.exports=Emitter}])},layoutBase$1.exports=factory());var factory}var hasRequiredCoseBase;var hasRequiredCytoscapeCoseBilkent,__WEBPACK_EXTERNAL_MODULE_0__;const coseBilkent=getDefaultExportFromCjs((hasRequiredCytoscapeCoseBilkent||(hasRequiredCytoscapeCoseBilkent=1,cytoscapeCoseBilkent$1.exports=(__WEBPACK_EXTERNAL_MODULE_0__=hasRequiredCoseBase?coseBase$1.exports:(hasRequiredCoseBase=1,coseBase$1.exports=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)}for(var prop in CoSEEdge.prototype=Object.create(FDLayoutEdge.prototype),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)}for(var prop in CoSEGraph.prototype=Object.create(LGraph.prototype),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)}for(var prop in CoSEGraphManager.prototype=Object.create(LGraphManager.prototype),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)}for(var prop in CoSENode.prototype=Object.create(FDLayoutNode.prototype),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)),null==this.child||0==this.child.getNodes().length?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 node,nodes=this.getChild().getNodes(),i=0;i<nodes.length;i++)null==(node=nodes[i]).getChild()?(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={}}for(var prop in CoSELayout.prototype=Object.create(FDLayout.prototype),FDLayout)CoSELayout[prop]=FDLayout[prop];CoSELayout.prototype.newGraphManager=function(){var gm=new CoSEGraphManager(this);return this.graphManager=gm,gm},CoSELayout.prototype.newGraph=function(vGraph){return new CoSEGraph(null,this.graphManager,vGraph)},CoSELayout.prototype.newNode=function(vNode){return new CoSENode(this.graphManager,vNode)},CoSELayout.prototype.newEdge=function(vEdge){return new CoSEEdge(null,null,vEdge)},CoSELayout.prototype.initParameters=function(){FDLayout.prototype.initParameters.call(this,arguments),this.isSubLayout||(CoSEConstants.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=CoSEConstants.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.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(){return LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},CoSELayout.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),allNodes=new Set(this.getAllNodes()),intersection=this.nodesWithGravity.filter(function(x){return allNodes.has(x)}),this.graphManager.setAllNodesToApplyGravitation(intersection));else{var forest=this.getFlatForest();if(forest.length>0)this.positionNodesRadially(forest);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var allNodes=new Set(this.getAllNodes()),intersection=this.nodesWithGravity.filter(function(x){return allNodes.has(x)});this.graphManager.setAllNodesToApplyGravitation(intersection),this.positionNodesRandomly()}}return 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))return!0;this.isTreeGrowing=!0}if(this.totalIterations%FDLayoutConstants.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var allNodes=new Set(this.getAllNodes()),intersection=this.nodesWithGravity.filter(function(x){return allNodes.has(x)});this.graphManager.setAllNodesToApplyGravitation(intersection),this.graphManager.updateBounds(),this.updateGrid(),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:id,x:rect.getCenterX(),y:rect.getCenterY(),w:rect.width,h:rect.height}}return pData},CoSELayout.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var layoutEnded=!1;if("during"===FDLayoutConstants.ANIMATE)this.emit("layoutstarted");else{for(;!layoutEnded;)layoutEnded=this.tick();this.graphManager.updateBounds()}},CoSELayout.prototype.calculateNodesToApplyGravitationTo=function(){var graph,i,nodeList=[],graphs=this.graphManager.getGraphs(),size=graphs.length;for(i=0;i<size;i++)(graph=graphs[i]).updateConnected(),graph.isConnected||(nodeList=nodeList.concat(graph.getNodes()));return nodeList},CoSELayout.prototype.createBendpoints=function(){var edges=[];edges=edges.concat(this.graphManager.getAllEdges());var i,visited=new Set;for(i=0;i<edges.length;i++){var edge=edges[i];if(!visited.has(edge)){var source=edge.getSource(),target=edge.getTarget();if(source==target)edge.getBendpoints().push(new PointD),edge.getBendpoints().push(new PointD),this.createDummyNodesForBendpoints(edge),visited.add(edge);else{var edgeList=[];if(edgeList=(edgeList=edgeList.concat(source.getEdgeListToNode(target))).concat(target.getEdgeListToNode(source)),!visited.has(edgeList[0])){var k;if(edgeList.length>1)for(k=0;k<edgeList.length;k++){var multiEdge=edgeList[k];multiEdge.getBendpoints().push(new PointD),this.createDummyNodesForBendpoints(multiEdge)}edgeList.forEach(function(edge2){visited.add(edge2)})}}}if(visited.size==edges.length)break}},CoSELayout.prototype.positionNodesRadially=function(forest){for(var currentStartingPoint=new Point2(0,0),numberOfColumns=Math.ceil(Math.sqrt(forest.length)),height=0,currentY=0,currentX=0,point=new PointD(0,0),i=0;i<forest.length;i++){i%numberOfColumns==0&&(currentX=0,currentY=height,0!=i&&(currentY+=CoSEConstants.DEFAULT_COMPONENT_SEPERATION),height=0);var tree=forest[i],centerNode=Layout2.findCenterOfTree(tree);currentStartingPoint.x=currentX,currentStartingPoint.y=currentY,(point=CoSELayout.radialLayout(tree,centerNode,currentStartingPoint)).y>height&&(height=Math.floor(point.y)),currentX=Math.floor(point.x+CoSEConstants.DEFAULT_COMPONENT_SEPERATION)}this.transform(new PointD(LayoutConstants.WORLD_CENTER_X-point.x/2,LayoutConstants.WORLD_CENTER_Y-point.y/2))},CoSELayout.radialLayout=function(tree,centerNode,startingPoint){var radialSep=Math.max(this.maxDiagonalInTree(tree),CoSEConstants.DEFAULT_RADIAL_SEPARATION);CoSELayout.branchRadialLayout(centerNode,null,0,359,0,radialSep);var bounds=LGraph.calculateBounds(tree),transform=new Transform;transform.setDeviceOrgX(bounds.getMinX()),transform.setDeviceOrgY(bounds.getMinY()),transform.setWorldOrgX(startingPoint.x),transform.setWorldOrgY(startingPoint.y);for(var i=0;i<tree.length;i++)tree[i].transform(transform);var bottomRight=new PointD(bounds.getMaxX(),bounds.getMaxY());return transform.inverseTransformPoint(bottomRight)},CoSELayout.branchRadialLayout=function(node,parentOfNode,startAngle,endAngle,distance,radialSeparation){var halfInterval=(endAngle-startAngle+1)/2;halfInterval<0&&(halfInterval+=180);var teta=(halfInterval+startAngle)%360*IGeometry.TWO_PI/360,x_=distance*Math.cos(teta),y_=distance*Math.sin(teta);node.setCenter(x_,y_);var neighborEdges=[],childCount=(neighborEdges=neighborEdges.concat(node.getEdges())).length;null!=parentOfNode&&childCount--;for(var startIndex,branchCount=0,incEdgesCount=neighborEdges.length,edges=node.getEdgesBetween(parentOfNode);edges.length>1;){var temp=edges[0];edges.splice(0,1);var index=neighborEdges.indexOf(temp);index>=0&&neighborEdges.splice(index,1),incEdgesCount--,childCount--}startIndex=null!=parentOfNode?(neighborEdges.indexOf(edges[0])+1)%incEdgesCount:0;for(var stepAngle=Math.abs(endAngle-startAngle)/childCount,i=startIndex;branchCount!=childCount;i=++i%incEdgesCount){var currentNeighbor=neighborEdges[i].getOtherEnd(node);if(currentNeighbor!=parentOfNode){var childStartAngle=(startAngle+branchCount*stepAngle)%360,childEndAngle=(childStartAngle+stepAngle)%360;CoSELayout.branchRadialLayout(currentNeighbor,node,childStartAngle,childEndAngle,distance+radialSeparation,radialSeparation),branchCount++}}},CoSELayout.maxDiagonalInTree=function(tree){for(var maxDiagonal=Integer.MIN_VALUE,i=0;i<tree.length;i++){var diagonal=tree[i].getDiagonal();diagonal>maxDiagonal&&(maxDiagonal=diagonal)}return maxDiagonal},CoSELayout.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},CoSELayout.prototype.groupZeroDegreeMembers=function(){var self=this,tempMemberGroups={};this.memberGroups={},this.idToDummyNode={};for(var zeroDegree=[],allNodes=this.graphManager.getAllNodes(),i=0;i<allNodes.length;i++){var parent=(node=allNodes[i]).getParent();0!==this.getNodeDegreeWithChildren(node)||null!=parent.id&&this.getToBeTiled(parent)||zeroDegree.push(node)}for(i=0;i<zeroDegree.length;i++){var node,p_id=(node=zeroDegree[i]).getParent().id;void 0===tempMemberGroups[p_id]&&(tempMemberGroups[p_id]=[]),tempMemberGroups[p_id]=tempMemberGroups[p_id].concat(node)}Object.keys(tempMemberGroups).forEach(function(p_id2){if(tempMemberGroups[p_id2].length>1){var dummyCompoundId="DummyCompound_"+p_id2;self.memberGroups[dummyCompoundId]=tempMemberGroups[p_id2];var parent2=tempMemberGroups[p_id2][0].getParent(),dummyCompound=new CoSENode(self.graphManager);dummyCompound.id=dummyCompoundId,dummyCompound.paddingLeft=parent2.paddingLeft||0,dummyCompound.paddingRight=parent2.paddingRight||0,dummyCompound.paddingBottom=parent2.paddingBottom||0,dummyCompound.paddingTop=parent2.paddingTop||0,self.idToDummyNode[dummyCompoundId]=dummyCompound;var dummyParentGraph=self.getGraphManager().add(self.newGraph(),dummyCompound),parentGraph=parent2.getChild();parentGraph.add(dummyCompound);for(var i2=0;i2<tempMemberGroups[p_id2].length;i2++){var node2=tempMemberGroups[p_id2][i2];parentGraph.remove(node2),dummyParentGraph.add(node2)}}})},CoSELayout.prototype.clearCompounds=function(){var childGraphMap={},idToNode={};this.performDFSOnCompounds();for(var i=0;i<this.compoundOrder.length;i++)idToNode[this.compoundOrder[i].id]=this.compoundOrder[i],childGraphMap[this.compoundOrder[i].id]=[].concat(this.compoundOrder[i].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[i].getChild()),this.compoundOrder[i].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(childGraphMap,idToNode)},CoSELayout.prototype.clearZeroDegreeMembers=function(){var self=this,tiledZeroDegreePack=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(id){var compoundNode=self.idToDummyNode[id];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(null!=this.toBeTiled[id])return this.toBeTiled[id];var childGraph=node.getChild();if(null==childGraph)return this.toBeTiled[id]=!1,!1;for(var children=childGraph.getNodes(),i=0;i<children.length;i++){var theChild=children[i];if(this.getNodeDegree(theChild)>0)return this.toBeTiled[id]=!1,!1;if(null!=theChild.getChild()){if(!this.getToBeTiled(theChild))return this.toBeTiled[id]=!1,!1}else this.toBeTiled[theChild.id]=!1}return this.toBeTiled[id]=!0,!0},CoSELayout.prototype.getNodeDegree=function(node){node.id;for(var edges=node.getEdges(),degree=0,i=0;i<edges.length;i++){var edge=edges[i];edge.getSource().id!==edge.getTarget().id&&(degree+=1)}return degree},CoSELayout.prototype.getNodeDegreeWithChildren=function(node){var degree=this.getNodeDegree(node);if(null==node.getChild())return degree;for(var children=node.getChild().getNodes(),i=0;i<children.length;i++){var child=children[i];degree+=this.getNodeDegreeWithChildren(child)}return degree},CoSELayout.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},CoSELayout.prototype.fillCompexOrderByDFS=function(children){for(var i=0;i<children.length;i++){var child=children[i];null!=child.getChild()&&this.fillCompexOrderByDFS(child.getChild().getNodes()),this.getToBeTiled(child)&&this.compoundOrder.push(child)}},CoSELayout.prototype.adjustLocations=function(organization,x,y,compoundHorizontalMargin,compoundVerticalMargin){y+=compoundVerticalMargin;for(var left=x+=compoundHorizontalMargin,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 organization={rows:[],rowWidth:[],rowHeight:[],width:0,height:minWidth,verticalPadding:CoSEConstants.TILING_PADDING_VERTICAL,horizontalPadding:CoSEConstants.TILING_PADDING_HORIZONTAL};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];0==organization.rows.length?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;rowIndex==organization.rows.length&&(organization.rows.push([]),organization.rowWidth.push(minCompoundSize),organization.rowHeight.push(0));var w=organization.rowWidth[rowIndex]+node.rect.width;organization.rows[rowIndex].length>0&&(w+=organization.horizontalPadding),organization.rowWidth[rowIndex]=w,organization.width<w&&(organization.width=w);var h=node.rect.height;rowIndex>0&&(h+=organization.verticalPadding);var extraHeight=0;h>organization.rowHeight[rowIndex]&&(extraHeight=organization.rowHeight[rowIndex],organization.rowHeight[rowIndex]=h,extraHeight=organization.rowHeight[rowIndex]-extraHeight),organization.height+=extraHeight,organization.rows[rowIndex].push(node)},CoSELayout.prototype.getShortestRowIndex=function(organization){for(var r=-1,min=Number.MAX_VALUE,i=0;i<organization.rows.length;i++)organization.rowWidth[i]<min&&(r=i,min=organization.rowWidth[i]);return r},CoSELayout.prototype.getLongestRowIndex=function(organization){for(var r=-1,max=Number.MIN_VALUE,i=0;i<organization.rows.length;i++)organization.rowWidth[i]>max&&(r=i,max=organization.rowWidth[i]);return r},CoSELayout.prototype.canAddHorizontal=function(organization,extraWidth,extraHeight){var sri=this.getShortestRowIndex(organization);if(sri<0)return!0;var min=organization.rowWidth[sri];if(min+organization.horizontalPadding+extraWidth<=organization.width)return!0;var add_to_row_ratio,add_new_row_ratio,hDiff=0;return organization.rowHeight[sri]<extraHeight&&sri>0&&(hDiff=extraHeight+organization.verticalPadding-organization.rowHeight[sri]),add_to_row_ratio=organization.width-min>=extraWidth+organization.horizontalPadding?(organization.height+hDiff)/(min+extraWidth+organization.horizontalPadding):(organization.height+hDiff)/organization.width,hDiff=extraHeight+organization.verticalPadding,(add_new_row_ratio=organization.width<extraWidth?(organization.height+hDiff)/extraWidth:(organization.height+hDiff)/organization.width)<1&&(add_new_row_ratio=1/add_new_row_ratio),add_to_row_ratio<1&&(add_to_row_ratio=1/add_to_row_ratio),add_to_row_ratio<add_new_row_ratio},CoSELayout.prototype.shiftToLastRow=function(organization){var longest=this.getLongestRowIndex(organization),last=organization.rowWidth.length-1,row=organization.rows[longest],node=row[row.length-1],diff=node.width+organization.horizontalPadding;if(organization.width-organization.rowWidth[last]>diff&&longest!=last){row.splice(-1,1),organization.rows[last].push(node),organization.rowWidth[longest]=organization.rowWidth[longest]-diff,organization.rowWidth[last]=organization.rowWidth[last]+diff,organization.width=organization.rowWidth[instance.getLongestRowIndex(organization)];for(var maxHeight=Number.MIN_VALUE,i=0;i<row.length;i++)row[i].height>maxHeight&&(maxHeight=row[i].height);longest>0&&(maxHeight+=organization.verticalPadding);var prevTotal=organization.rowHeight[longest]+organization.rowHeight[last];organization.rowHeight[longest]=maxHeight,organization.rowHeight[last]<node.height+organization.verticalPadding&&(organization.rowHeight[last]=node.height+organization.verticalPadding);var finalTotal=organization.rowHeight[longest]+organization.rowHeight[last];organization.height+=finalTotal-prevTotal,this.shiftToLastRow(organization)}},CoSELayout.prototype.tilingPreLayout=function(){CoSEConstants.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},CoSELayout.prototype.tilingPostLayout=function(){CoSEConstants.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},CoSELayout.prototype.reduceTrees=function(){for(var node,prunedNodesAll=[],containsLeaf=!0;containsLeaf;){var allNodes=this.graphManager.getAllNodes(),prunedNodesInStepTemp=[];containsLeaf=!1;for(var i=0;i<allNodes.length;i++)1!=(node=allNodes[i]).getEdges().length||node.getEdges()[0].isInterGraph||null!=node.getChild()||(prunedNodesInStepTemp.push([node,node.getEdges()[0],node.getOwner()]),containsLeaf=!0);if(1==containsLeaf){for(var prunedNodesInStep=[],j=0;j<prunedNodesInStepTemp.length;j++)1==prunedNodesInStepTemp[j][0].getEdges().length&&(prunedNodesInStep.push(prunedNodesInStepTemp[j]),prunedNodesInStepTemp[j][0].getOwner().remove(prunedNodesInStepTemp[j][0]));prunedNodesAll.push(prunedNodesInStep),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=prunedNodesAll},CoSELayout.prototype.growTree=function(prunedNodesAll){for(var nodeData,prunedNodesInStep=prunedNodesAll[prunedNodesAll.length-1],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],startGridX=(nodeToConnect=prunedNode==nodeData[1].source?nodeData[1].target:nodeData[1].source).startX,finishGridX=nodeToConnect.finishX,startGridY=nodeToConnect.startY,finishGridY=nodeToConnect.finishY,controlRegions=[0,0,0,0];if(startGridY>0)for(var i=startGridX;i<=finishGridX;i++)controlRegions[0]+=this.grid[i][startGridY-1].length+this.grid[i][startGridY].length-1;if(finishGridX<this.grid.length-1)for(i=startGridY;i<=finishGridY;i++)controlRegions[1]+=this.grid[finishGridX+1][i].length+this.grid[finishGridX][i].length-1;if(finishGridY<this.grid[0].length-1)for(i=startGridX;i<=finishGridX;i++)controlRegions[2]+=this.grid[i][finishGridY+1].length+this.grid[i][finishGridY].length-1;if(startGridX>0)for(i=startGridY;i<=finishGridY;i++)controlRegions[3]+=this.grid[startGridX-1][i].length+this.grid[startGridX][i].length-1;for(var minCount,minIndex,min=Integer.MAX_VALUE,j=0;j<controlRegions.length;j++)controlRegions[j]<min?(min=controlRegions[j],minCount=1,minIndex=j):controlRegions[j]==min&&minCount++;if(3==minCount&&0==min)0==controlRegions[0]&&0==controlRegions[1]&&0==controlRegions[2]?gridForPrunedNode=1:0==controlRegions[0]&&0==controlRegions[1]&&0==controlRegions[3]?gridForPrunedNode=0:0==controlRegions[0]&&0==controlRegions[2]&&0==controlRegions[3]?gridForPrunedNode=3:0==controlRegions[1]&&0==controlRegions[2]&&0==controlRegions[3]&&(gridForPrunedNode=2);else if(2==minCount&&0==min){var random=Math.floor(2*Math.random());gridForPrunedNode=0==controlRegions[0]&&0==controlRegions[1]?0==random?0:1:0==controlRegions[0]&&0==controlRegions[2]?0==random?0:2:0==controlRegions[0]&&0==controlRegions[3]?0==random?0:3:0==controlRegions[1]&&0==controlRegions[2]?0==random?1:2:0==controlRegions[1]&&0==controlRegions[3]?0==random?1:3:0==random?2:3}else gridForPrunedNode=4==minCount&&0==min?random=Math.floor(4*Math.random()):minIndex;0==gridForPrunedNode?prunedNode.setCenter(nodeToConnect.getCenterX(),nodeToConnect.getCenterY()-nodeToConnect.getHeight()/2-FDLayoutConstants.DEFAULT_EDGE_LENGTH-prunedNode.getHeight()/2):1==gridForPrunedNode?prunedNode.setCenter(nodeToConnect.getCenterX()+nodeToConnect.getWidth()/2+FDLayoutConstants.DEFAULT_EDGE_LENGTH+prunedNode.getWidth()/2,nodeToConnect.getCenterY()):2==gridForPrunedNode?prunedNode.setCenter(nodeToConnect.getCenterX(),nodeToConnect.getCenterY()+nodeToConnect.getHeight()/2+FDLayoutConstants.DEFAULT_EDGE_LENGTH+prunedNode.getHeight()/2):prunedNode.setCenter(nodeToConnect.getCenterX()-nodeToConnect.getWidth()/2-FDLayoutConstants.DEFAULT_EDGE_LENGTH-prunedNode.getWidth()/2,nodeToConnect.getCenterY())},module2.exports=CoSELayout},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}])}(requireLayoutBase())),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 _CoSELayout(_options){this.options=function(defaults2,options){var obj={};for(var i in defaults2)obj[i]=defaults2[i];for(var i in options)obj[i]=options[i];return obj}(defaults,_options),getUserOptions(this.options)}var getUserOptions=function(options){null!=options.nodeRepulsion&&(CoSEConstants.DEFAULT_REPULSION_STRENGTH=FDLayoutConstants.DEFAULT_REPULSION_STRENGTH=options.nodeRepulsion),null!=options.idealEdgeLength&&(CoSEConstants.DEFAULT_EDGE_LENGTH=FDLayoutConstants.DEFAULT_EDGE_LENGTH=options.idealEdgeLength),null!=options.edgeElasticity&&(CoSEConstants.DEFAULT_SPRING_STRENGTH=FDLayoutConstants.DEFAULT_SPRING_STRENGTH=options.edgeElasticity),null!=options.nestingFactor&&(CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=options.nestingFactor),null!=options.gravity&&(CoSEConstants.DEFAULT_GRAVITY_STRENGTH=FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH=options.gravity),null!=options.numIter&&(CoSEConstants.MAX_ITERATIONS=FDLayoutConstants.MAX_ITERATIONS=options.numIter),null!=options.gravityRange&&(CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR=FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR=options.gravityRange),null!=options.gravityCompound&&(CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH=options.gravityCompound),null!=options.gravityRangeCompound&&(CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=options.gravityRangeCompound),null!=options.initialEnergyOnIncremental&&(CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL=FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL=options.initialEnergyOnIncremental),"draft"==options.quality?LayoutConstants.QUALITY=0:"proof"==options.quality?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="function"==typeof options.tilingPaddingVertical?options.tilingPaddingVertical.call():options.tilingPaddingVertical,CoSEConstants.TILING_PADDING_HORIZONTAL="function"==typeof options.tilingPaddingHorizontal?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")];sourceNode!==targetNode&&0==sourceNode.getEdgesBetween(targetNode).length&&(gm.add(layout.newEdge(),sourceNode,targetNode).id=edge.id())}var getPositions=function(ele,i2){"number"==typeof ele&&(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 isDone,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,i2=0;i2<ticksPerFrame&&!isDone;i2++)isDone=self.stopped||self.layout.tick();if(isDone)return 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),void(ready=!1);var animationData=self.layout.getPositionsData();options.eles.nodes().positions(function(ele,i3){if("number"==typeof ele&&(ele=i3),!ele.isParent()){for(var theId=ele.id(),pNode=animationData[theId],temp=ele;null==pNode&&(pNode=animationData[temp.data("parent")]||animationData["DummyCompound_"+temp.data("parent")],animationData[theId]=pNode,null!=(temp=temp.parent()[0])););return null!=pNode?{x:pNode.x,y:pNode.y}:{x:ele.position("x"),y:ele.position("y")}}}),afterReposition(),frameId=requestAnimationFrame(iterateAnimated2)};return layout.addListener("layoutstarted",function(){"during"===self.options.animate&&(frameId=requestAnimationFrame(iterateAnimated))}),layout.runLayout(),"during"!==this.options.animate&&(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;return nodes.filter(function(ele,i2){"number"==typeof ele&&(ele=i2);for(var parent=ele.parent()[0];null!=parent;){if(nodesMap[parent.id()])return!1;parent=parent.parent()[0]}return!0})},_CoSELayout.prototype.processChildrenList=function(parent,children,layout){for(var size=children.length,i=0;i<size;i++){var theNode,theNewGraph,theChild=children[i],children_of_children=theChild.children(),dimensions=theChild.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((theNode=null!=theChild.outerWidth()&&null!=theChild.outerHeight()?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)))):parent.add(new CoSENode(this.graphManager))).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}this.idToLNode[theChild.data("id")]=theNode,isNaN(theNode.rect.x)&&(theNode.rect.x=0),isNaN(theNode.rect.y)&&(theNode.rect.y=0),null!=children_of_children&&children_of_children.length>0&&(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)};"undefined"!=typeof cytoscape&&register(cytoscape),module2.exports=register}]))),cytoscapeCoseBilkent$1.exports));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}})})}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})})}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}}});cy.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),cy.ready(e=>{log.info("Cytoscape ready",e),resolve(cy)})})}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=>{"id"!==key&&(positionedNode[key]=data[key])}),positionedNode})}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})}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}}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}cytoscape$1.use(coseBilkent),__name(addNodes,"addNodes"),__name(addEdges,"addEdges"),__name(createCytoscapeInstance,"createCytoscapeInstance"),__name(extractPositionedNodes,"extractPositionedNodes"),__name(extractPositionedEdges,"extractPositionedEdges"),__name(executeCoseBilkentLayout,"executeCoseBilkentLayout"),__name(validateLayoutData,"validateLayoutData");var render2=__name(async(data4Layout,svg,{insertCluster:insertCluster,insertEdge:insertEdge,insertEdgeLabel:insertEdgeLabel,insertMarkers:insertMarkers,insertNode:insertNode,log:log2,positionEdgeLabel: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];(null==node?void 0: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");export{render2 as render};
@@ -1 +0,0 @@
1
- import{_ as __name,as as markers_default,at as clear2,au as clear,av as clear$1,l as log,c as getConfig2,aw as updateNodeBounds,ax as setNodeElem,af as insertNode,al as getSubGraphTitleMargins,ag as positionNode,ae as insertCluster,ay as insertEdge,az as positionEdgeLabel,aA as insertEdgeLabel}from"./mermaid.core-DvwEdatr.js";import{i as isUndefined,G as Graph}from"./graph-CwiXMdRR.js";import{l as layout}from"./layout-BQFiWq71.js";import{c as clone}from"./clone-C6d2XDvR.js";import{m as map}from"./min-DFik8k4L.js";import"./vendor-mdxeditor-Cy5Xg_90.js";import"./vendor-antd-BTBRwbax.js";import"./vendor-virtuoso-Bq6QMhgG.js";import"./vendor-codemirror-CPWlhuQ1.js";import"./vendor-markdown-DOJHsAxX.js";import"./_baseUniq-C2FCldN4.js";function write(g){var json={options:{directed:g.isDirected(),multigraph:g.isMultigraph(),compound:g.isCompound()},nodes:writeNodes(g),edges:writeEdges(g)};return isUndefined(g.graph())||(json.value=clone(g.graph())),json}function writeNodes(g){return map(g.nodes(),function(v){var nodeValue=g.node(v),parent=g.parent(v),node={v:v};return isUndefined(nodeValue)||(node.value=nodeValue),isUndefined(parent)||(node.parent=parent),node})}function writeEdges(g){return map(g.edges(),function(e){var edgeValue=g.edge(e),edge={v:e.v,w:e.w};return isUndefined(e.name)||(edge.name=e.name),isUndefined(edgeValue)||(edge.value=edgeValue),edge})}var clusterDb=new Map,descendants=new Map,parents=new Map,clear4=__name(()=>{descendants.clear(),parents.clear(),clusterDb.clear()},"clear"),isDescendant=__name((id,ancestorId)=>{const ancestorDescendants=descendants.get(ancestorId)||[];return log.trace("In isDescendant",ancestorId," ",id," = ",ancestorDescendants.includes(id)),ancestorDescendants.includes(id)},"isDescendant"),edgeInCluster=__name((edge,clusterId)=>{const clusterDescendants=descendants.get(clusterId)||[];return log.info("Descendants of ",clusterId," is ",clusterDescendants),log.info("Edge is ",edge),edge.v!==clusterId&&edge.w!==clusterId&&(clusterDescendants?clusterDescendants.includes(edge.v)||isDescendant(edge.v,clusterId)||isDescendant(edge.w,clusterId)||clusterDescendants.includes(edge.w):(log.debug("Tilt, ",clusterId,",not in descendants"),!1))},"edgeInCluster"),copy=__name((clusterId,graph,newGraph,rootId)=>{log.warn("Copying children of ",clusterId,"root",rootId,"data",graph.node(clusterId),rootId);const nodes=graph.children(clusterId)||[];clusterId!==rootId&&nodes.push(clusterId),log.warn("Copying (nodes) clusterId",clusterId,"nodes",nodes),nodes.forEach(node=>{if(graph.children(node).length>0)copy(node,graph,newGraph,rootId);else{const data=graph.node(node);log.info("cp ",node," to ",rootId," with parent ",clusterId),newGraph.setNode(node,data),rootId!==graph.parent(node)&&(log.warn("Setting parent",node,graph.parent(node)),newGraph.setParent(node,graph.parent(node))),clusterId!==rootId&&node!==clusterId?(log.debug("Setting parent",node,clusterId),newGraph.setParent(node,clusterId)):(log.info("In copy ",clusterId,"root",rootId,"data",graph.node(clusterId),rootId),log.debug("Not Setting parent for node=",node,"cluster!==rootId",clusterId!==rootId,"node!==clusterId",node!==clusterId));const edges=graph.edges(node);log.debug("Copying Edges",edges),edges.forEach(edge=>{log.info("Edge",edge);const data2=graph.edge(edge.v,edge.w,edge.name);log.info("Edge data",data2,rootId);try{edgeInCluster(edge,rootId)?(log.info("Copying as ",edge.v,edge.w,data2,edge.name),newGraph.setEdge(edge.v,edge.w,data2,edge.name),log.info("newGraph edges ",newGraph.edges(),newGraph.edge(newGraph.edges()[0]))):log.info("Skipping copy of edge ",edge.v,"--\x3e",edge.w," rootId: ",rootId," clusterId:",clusterId)}catch(e){log.error(e)}})}log.debug("Removing node",node),graph.removeNode(node)})},"copy"),extractDescendants=__name((id,graph)=>{const children=graph.children(id);let res=[...children];for(const child of children)parents.set(child,id),res=[...res,...extractDescendants(child,graph)];return res},"extractDescendants"),findCommonEdges=__name((graph,id1,id2)=>{const edges1=graph.edges().filter(edge=>edge.v===id1||edge.w===id1),edges2=graph.edges().filter(edge=>edge.v===id2||edge.w===id2),edges1Prim=edges1.map(edge=>({v:edge.v===id1?id2:edge.v,w:edge.w===id1?id1:edge.w})),edges2Prim=edges2.map(edge=>({v:edge.v,w:edge.w}));return edges1Prim.filter(edgeIn1=>edges2Prim.some(edge=>edgeIn1.v===edge.v&&edgeIn1.w===edge.w))},"findCommonEdges"),findNonClusterChild=__name((id,graph,clusterId)=>{const children=graph.children(id);if(log.trace("Searching children of id ",id,children),children.length<1)return id;let reserve;for(const child of children){const _id=findNonClusterChild(child,graph,clusterId),commonEdges=findCommonEdges(graph,clusterId,_id);if(_id){if(!(commonEdges.length>0))return _id;reserve=_id}}return reserve},"findNonClusterChild"),getAnchorId=__name(id=>clusterDb.has(id)&&clusterDb.get(id).externalConnections&&clusterDb.has(id)?clusterDb.get(id).id:id,"getAnchorId"),adjustClustersAndEdges=__name((graph,depth)=>{if(!graph||depth>10)log.debug("Opting out, no graph ");else{log.debug("Opting in, graph "),graph.nodes().forEach(function(id){graph.children(id).length>0&&(log.warn("Cluster identified",id," Replacement id in edges: ",findNonClusterChild(id,graph,id)),descendants.set(id,extractDescendants(id,graph)),clusterDb.set(id,{id:findNonClusterChild(id,graph,id),clusterData:graph.node(id)}))}),graph.nodes().forEach(function(id){const children=graph.children(id),edges=graph.edges();children.length>0?(log.debug("Cluster identified",id,descendants),edges.forEach(edge=>{isDescendant(edge.v,id)^isDescendant(edge.w,id)&&(log.warn("Edge: ",edge," leaves cluster ",id),log.warn("Descendants of XXX ",id,": ",descendants.get(id)),clusterDb.get(id).externalConnections=!0)})):log.debug("Not a cluster ",id,descendants)});for(let id of clusterDb.keys()){const nonClusterChild=clusterDb.get(id).id,parent=graph.parent(nonClusterChild);parent!==id&&clusterDb.has(parent)&&!clusterDb.get(parent).externalConnections&&(clusterDb.get(id).id=parent)}graph.edges().forEach(function(e){const edge=graph.edge(e);log.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),log.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(graph.edge(e)));let v=e.v,w=e.w;if(log.warn("Fix XXX",clusterDb,"ids:",e.v,e.w,"Translating: ",clusterDb.get(e.v)," --- ",clusterDb.get(e.w)),clusterDb.get(e.v)||clusterDb.get(e.w)){if(log.warn("Fixing and trying - removing XXX",e.v,e.w,e.name),v=getAnchorId(e.v),w=getAnchorId(e.w),graph.removeEdge(e.v,e.w,e.name),v!==e.v){const parent=graph.parent(v);clusterDb.get(parent).externalConnections=!0,edge.fromCluster=e.v}if(w!==e.w){const parent=graph.parent(w);clusterDb.get(parent).externalConnections=!0,edge.toCluster=e.w}log.warn("Fix Replacing with XXX",v,w,e.name),graph.setEdge(v,w,edge,e.name)}}),log.warn("Adjusted Graph",write(graph)),extractor(graph,0),log.trace(clusterDb)}},"adjustClustersAndEdges"),extractor=__name((graph,depth)=>{var _a,_b;if(log.warn("extractor - ",depth,write(graph),graph.children("D")),depth>10)return void log.error("Bailing out");let nodes=graph.nodes(),hasChildren=!1;for(const node of nodes){const children=graph.children(node);hasChildren=hasChildren||children.length>0}if(hasChildren){log.debug("Nodes = ",nodes,depth);for(const node of nodes)if(log.debug("Extracting node",node,clusterDb,clusterDb.has(node)&&!clusterDb.get(node).externalConnections,!graph.parent(node),graph.node(node),graph.children("D")," Depth ",depth),clusterDb.has(node))if(!clusterDb.get(node).externalConnections&&graph.children(node)&&graph.children(node).length>0){log.warn("Cluster without external connections, without a parent and with children",node,depth);let dir="TB"===graph.graph().rankdir?"LR":"TB";(null==(_b=null==(_a=clusterDb.get(node))?void 0:_a.clusterData)?void 0:_b.dir)&&(dir=clusterDb.get(node).clusterData.dir,log.warn("Fixing dir",clusterDb.get(node).clusterData.dir,dir));const clusterGraph=new Graph({multigraph:!0,compound:!0}).setGraph({rankdir:dir,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});log.warn("Old graph before copy",write(graph)),copy(node,graph,clusterGraph,node),graph.setNode(node,{clusterNode:!0,id:node,clusterData:clusterDb.get(node).clusterData,label:clusterDb.get(node).label,graph:clusterGraph}),log.warn("New graph after copy node: (",node,")",write(clusterGraph)),log.debug("Old graph after copy",write(graph))}else log.warn("Cluster ** ",node," **not meeting the criteria !externalConnections:",!clusterDb.get(node).externalConnections," no parent: ",!graph.parent(node)," children ",graph.children(node)&&graph.children(node).length>0,graph.children("D"),depth),log.debug(clusterDb);else log.debug("Not a cluster",node,depth);nodes=graph.nodes(),log.warn("New list of nodes",nodes);for(const node of nodes){const data=graph.node(node);log.warn(" Now next level",node,data),(null==data?void 0:data.clusterNode)&&extractor(data.graph,depth+1)}}else log.debug("Done, no node has children",graph.nodes())},"extractor"),sorter=__name((graph,nodes)=>{if(0===nodes.length)return[];let result=Object.assign([],nodes);return nodes.forEach(node=>{const children=graph.children(node),sorted=sorter(graph,children);result=[...result,...sorted]}),result},"sorter"),sortNodesByHierarchy=__name(graph=>sorter(graph,graph.children()),"sortNodesByHierarchy"),recursiveRender=__name(async(_elem,graph,diagramType,id,parentCluster,siteConfig)=>{log.warn("Graph in recursive render:XAX",write(graph),parentCluster);const dir=graph.graph().rankdir;log.trace("Dir in recursive render - dir:",dir);const elem=_elem.insert("g").attr("class","root");graph.nodes()?log.info("Recursive render XXX",graph.nodes()):log.info("No nodes found for",graph),graph.edges().length>0&&log.info("Recursive edges",graph.edge(graph.edges()[0]));const clusters=elem.insert("g").attr("class","clusters"),edgePaths=elem.insert("g").attr("class","edgePaths"),edgeLabels=elem.insert("g").attr("class","edgeLabels"),nodes=elem.insert("g").attr("class","nodes");await Promise.all(graph.nodes().map(async function(v){const node=graph.node(v);if(void 0!==parentCluster){const data=JSON.parse(JSON.stringify(parentCluster.clusterData));log.trace("Setting data for parent cluster XXX\n Node.id = ",v,"\n data=",data.height,"\nParent cluster",parentCluster.height),graph.setNode(parentCluster.id,data),graph.parent(v)||(log.trace("Setting parent",v,parentCluster.id),graph.setParent(v,parentCluster.id,data))}if(log.info("(Insert) Node XXX"+v+": "+JSON.stringify(graph.node(v))),null==node?void 0:node.clusterNode){log.info("Cluster identified XBX",v,node.width,graph.node(v));const{ranksep:ranksep,nodesep:nodesep}=graph.graph();node.graph.setGraph({...node.graph.graph(),ranksep:ranksep+25,nodesep:nodesep});const o=await recursiveRender(nodes,node.graph,diagramType,id,graph.node(v),siteConfig),newEl=o.elem;updateNodeBounds(node,newEl),node.diff=o.diff||0,log.info("New compound node after recursive render XAX",v,"width",node.width,"height",node.height),setNodeElem(newEl,node)}else graph.children(v).length>0?(log.trace("Cluster - the non recursive path XBX",v,node.id,node,node.width,"Graph:",graph),log.trace(findNonClusterChild(node.id,graph)),clusterDb.set(node.id,{id:findNonClusterChild(node.id,graph),node:node})):(log.trace("Node - the non recursive path XAX",v,nodes,graph.node(v),dir),await insertNode(nodes,graph.node(v),{config:siteConfig,dir:dir}))}));const processEdges=__name(async()=>{const edgePromises=graph.edges().map(async function(e){const edge=graph.edge(e.v,e.w,e.name);log.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),log.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(graph.edge(e))),log.info("Fix",clusterDb,"ids:",e.v,e.w,"Translating: ",clusterDb.get(e.v),clusterDb.get(e.w)),await insertEdgeLabel(edgeLabels,edge)});await Promise.all(edgePromises)},"processEdges");await processEdges(),log.info("Graph before layout:",JSON.stringify(write(graph))),log.info("############################################# XXX"),log.info("### Layout ### XXX"),log.info("############################################# XXX"),layout(graph),log.info("Graph after layout:",JSON.stringify(write(graph)));let diff=0,{subGraphTitleTotalMargin:subGraphTitleTotalMargin}=getSubGraphTitleMargins(siteConfig);return await Promise.all(sortNodesByHierarchy(graph).map(async function(v){var _a;const node=graph.node(v);if(log.info("Position XBX => "+v+": ("+node.x,","+node.y,") width: ",node.width," height: ",node.height),null==node?void 0:node.clusterNode)node.y+=subGraphTitleTotalMargin,log.info("A tainted cluster node XBX1",v,node.id,node.width,node.height,node.x,node.y,graph.parent(v)),clusterDb.get(node.id).node=node,positionNode(node);else if(graph.children(v).length>0){log.info("A pure cluster node XBX1",v,node.id,node.x,node.y,node.width,node.height,graph.parent(v)),node.height+=subGraphTitleTotalMargin,graph.node(node.parentId);const halfPadding=(null==node?void 0:node.padding)/2||0,labelHeight=(null==(_a=null==node?void 0:node.labelBBox)?void 0:_a.height)||0,offsetY=labelHeight-halfPadding||0;log.debug("OffsetY",offsetY,"labelHeight",labelHeight,"halfPadding",halfPadding),await insertCluster(clusters,node),clusterDb.get(node.id).node=node}else{const parent=graph.node(node.parentId);node.y+=subGraphTitleTotalMargin/2,log.info("A regular node XBX1 - using the padding",node.id,"parent",node.parentId,node.width,node.height,node.x,node.y,"offsetY",node.offsetY,"parent",parent,null==parent?void 0:parent.offsetY,node),positionNode(node)}})),graph.edges().forEach(function(e){const edge=graph.edge(e);log.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(edge),edge),edge.points.forEach(point=>point.y+=subGraphTitleTotalMargin/2);const startNode=graph.node(e.v);var endNode=graph.node(e.w);const paths=insertEdge(edgePaths,edge,clusterDb,diagramType,startNode,endNode,id);positionEdgeLabel(edge,paths)}),graph.nodes().forEach(function(v){const n=graph.node(v);log.info(v,n.type,n.diff),n.isGroup&&(diff=n.diff)}),log.warn("Returning from recursive render XAX",elem,diff),{elem:elem,diff:diff}},"recursiveRender"),render=__name(async(data4Layout,svg)=>{var _a,_b,_c,_d,_e,_f;const graph=new Graph({multigraph:!0,compound:!0}).setGraph({rankdir:data4Layout.direction,nodesep:(null==(_a=data4Layout.config)?void 0:_a.nodeSpacing)||(null==(_c=null==(_b=data4Layout.config)?void 0:_b.flowchart)?void 0:_c.nodeSpacing)||data4Layout.nodeSpacing,ranksep:(null==(_d=data4Layout.config)?void 0:_d.rankSpacing)||(null==(_f=null==(_e=data4Layout.config)?void 0:_e.flowchart)?void 0:_f.rankSpacing)||data4Layout.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),element=svg.select("g");markers_default(element,data4Layout.markers,data4Layout.type,data4Layout.diagramId),clear2(),clear(),clear$1(),clear4(),data4Layout.nodes.forEach(node=>{graph.setNode(node.id,{...node}),node.parentId&&graph.setParent(node.id,node.parentId)}),log.debug("Edges:",data4Layout.edges),data4Layout.edges.forEach(edge=>{if(edge.start===edge.end){const nodeId=edge.start,specialId1=nodeId+"---"+nodeId+"---1",specialId2=nodeId+"---"+nodeId+"---2",node=graph.node(nodeId);graph.setNode(specialId1,{domId:specialId1,id:specialId1,parentId:node.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),graph.setParent(specialId1,node.parentId),graph.setNode(specialId2,{domId:specialId2,id:specialId2,parentId:node.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),graph.setParent(specialId2,node.parentId);const edge1=structuredClone(edge),edgeMid=structuredClone(edge),edge2=structuredClone(edge);edge1.label="",edge1.arrowTypeEnd="none",edge1.id=nodeId+"-cyclic-special-1",edgeMid.arrowTypeStart="none",edgeMid.arrowTypeEnd="none",edgeMid.id=nodeId+"-cyclic-special-mid",edge2.label="",node.isGroup&&(edge1.fromCluster=nodeId,edge2.toCluster=nodeId),edge2.id=nodeId+"-cyclic-special-2",edge2.arrowTypeStart="none",graph.setEdge(nodeId,specialId1,edge1,nodeId+"-cyclic-special-0"),graph.setEdge(specialId1,specialId2,edgeMid,nodeId+"-cyclic-special-1"),graph.setEdge(specialId2,nodeId,edge2,nodeId+"-cyc<lic-special-2")}else graph.setEdge(edge.start,edge.end,{...edge},edge.id)}),log.warn("Graph at first:",JSON.stringify(write(graph))),adjustClustersAndEdges(graph),log.warn("Graph after XAX:",JSON.stringify(write(graph)));const siteConfig=getConfig2();await recursiveRender(element,graph,data4Layout.type,data4Layout.diagramId,void 0,siteConfig)},"render");export{render};
@@ -1 +0,0 @@
1
- import{p as setDiagramTitle,b as setAccTitle,s as setAccDescription,q as getDiagramTitle,g as getAccDescription,a as getAccTitle,_ as __name,E as cleanAndMerge,l as log,H as selectSvgElement,e as configureSvgSize,C as getConfig,F as defaultConfig_default,y as clear}from"./mermaid.core-DvwEdatr.js";import{p as populateCommonDb}from"./chunk-4BX2VUAB-DnFoMzQG.js";import{I as ImperativeState}from"./chunk-QZHKN3VN-C0KVKecr.js";import{p as parse}from"./wardley-RL74JXVD-BFcIn2-Q.js";import"./vendor-mdxeditor-Cy5Xg_90.js";import"./vendor-antd-BTBRwbax.js";import"./vendor-virtuoso-Bq6QMhgG.js";import"./vendor-codemirror-CPWlhuQ1.js";import"./vendor-markdown-DOJHsAxX.js";import"./min-DFik8k4L.js";import"./_baseUniq-C2FCldN4.js";var state=new ImperativeState(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),clear2=__name(()=>{state.reset(),clear()},"clear"),getRoot=__name(()=>state.records.stack[0],"getRoot"),getCount=__name(()=>state.records.cnt,"getCount"),defaultConfig=defaultConfig_default.treeView,getConfig2=__name(()=>cleanAndMerge(defaultConfig,getConfig().treeView),"getConfig"),db_default={clear:clear2,addNode:__name((level,name)=>{for(;level<=state.records.stack[state.records.stack.length-1].level;)state.records.stack.pop();const node={id:state.records.cnt++,level:level,name:name,children:[]};state.records.stack[state.records.stack.length-1].children.push(node),state.records.stack.push(node)},"addNode"),getRoot:getRoot,getCount:getCount,getConfig:getConfig2,getAccTitle:getAccTitle,getAccDescription:getAccDescription,getDiagramTitle:getDiagramTitle,setAccDescription:setAccDescription,setAccTitle:setAccTitle,setDiagramTitle:setDiagramTitle},populate=__name(ast=>{populateCommonDb(ast,db_default),ast.nodes.map(node=>db_default.addNode(node.indent?parseInt(node.indent):0,node.name))},"populate"),parser={parse:__name(async input=>{const ast=await parse("treeView",input);log.debug(ast),populate(ast)},"parse")},positionLabel=__name((x,y,node,domElem,config)=>{const label=domElem.append("text").text(node.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:labelHeight,width:labelWidth}=label.node().getBBox(),height=labelHeight+2*config.paddingY,width=labelWidth+2*config.paddingX;label.attr("x",x+config.paddingX),label.attr("y",y+height/2),node.BBox={x:x,y:y,width:width,height:height}},"positionLabel"),positionLine=__name((domElem,x1,y1,x2,y2,lineThickness)=>domElem.append("line").attr("x1",x1).attr("y1",y1).attr("x2",x2).attr("y2",y2).attr("stroke-width",lineThickness).attr("class","treeView-node-line"),"positionLine"),drawTree=__name((elem,root,config)=>{let totalHeight=0,totalWidth=0;const drawNode=__name((elem2,node,config2,depth)=>{const indent=depth*(config2.rowIndent+config2.paddingX);positionLabel(indent,totalHeight,node,elem2,config2);const{height:height,width:width}=node.BBox;positionLine(elem2,indent-config2.rowIndent,totalHeight+height/2,indent,totalHeight+height/2,config2.lineThickness),totalWidth=Math.max(totalWidth,indent+width),totalHeight+=height},"drawNode"),processNode=__name((node,depth=0)=>{drawNode(elem,node,config,depth),node.children.forEach(child=>{processNode(child,depth+1)});const{x:x,y:y,height:height}=node.BBox;if(node.children.length){const{y:endY,height:endHeight}=node.children[node.children.length-1].BBox;positionLine(elem,x+config.paddingX,y+height,x+config.paddingX,endY+endHeight/2+config.lineThickness/2,config.lineThickness)}},"processNode");return processNode(root),{totalHeight:totalHeight,totalWidth:totalWidth}},"drawTree"),defaultTreeViewDiagramStyles={labelFontSize:"16px",labelColor:"black",lineColor:"black"},diagram={db:db_default,renderer:{draw:__name((text,id,_ver,diagObj)=>{log.debug("Rendering treeView diagram\n"+text);const db2=diagObj.db,root=db2.getRoot(),config=db2.getConfig(),svg=selectSvgElement(id),treeElem=svg.append("g");treeElem.attr("class","tree-view");const{totalHeight:totalHeight,totalWidth:totalWidth}=drawTree(treeElem,root,config);svg.attr("viewBox",`-${config.lineThickness/2} 0 ${totalWidth} ${totalHeight}`),configureSvgSize(svg,totalHeight,totalWidth,config.useMaxWidth)},"draw")},parser:parser,styles:__name(({treeView:treeView})=>{const{labelFontSize:labelFontSize,labelColor:labelColor,lineColor:lineColor}=cleanAndMerge(defaultTreeViewDiagramStyles,treeView);return`\n .treeView-node-label {\n font-size: ${labelFontSize};\n fill: ${labelColor};\n }\n .treeView-node-line {\n stroke: ${lineColor};\n }\n `},"styles")};export{diagram};
@@ -1 +0,0 @@
1
- var _a;import{_ as __name,I as getThemeVariables3,C as getConfig,E as cleanAndMerge,H as selectSvgElement,e as configureSvgSize,l as log,ba as styles2String,d as select,b as setAccTitle,a as getAccTitle,p as setDiagramTitle,q as getDiagramTitle,g as getAccDescription,s as setAccDescription,F as defaultConfig_default,bb as isLabelStyle,y as clear}from"./mermaid.core-DvwEdatr.js";import{s as setupViewPortForSVG}from"./chunk-EDXVE4YY-BNqgeN9r.js";import{p as populateCommonDb}from"./chunk-4BX2VUAB-DnFoMzQG.js";import{p as parse}from"./wardley-RL74JXVD-BFcIn2-Q.js";import{b as format}from"./defaultLocale-DZ7E7S9R.js";import{o as ordinal}from"./ordinal-DA-_8pMy.js";import"./vendor-mdxeditor-Cy5Xg_90.js";import"./vendor-antd-BTBRwbax.js";import"./vendor-virtuoso-Bq6QMhgG.js";import"./vendor-codemirror-CPWlhuQ1.js";import"./vendor-markdown-DOJHsAxX.js";import"./min-DFik8k4L.js";import"./_baseUniq-C2FCldN4.js";import"./init-DMZMl1PR.js";function count(node){var sum=0,children=node.children,i=children&&children.length;if(i)for(;--i>=0;)sum+=children[i].value;else sum=1;node.value=sum}function hierarchy(data,children){data instanceof Map?(data=[void 0,data],void 0===children&&(children=mapChildren)):void 0===children&&(children=objectChildren);for(var node,child,childs,i,n,root=new Node(data),nodes=[root];node=nodes.pop();)if((childs=children(node.data))&&(n=(childs=Array.from(childs)).length))for(node.children=childs,i=n-1;i>=0;--i)nodes.push(child=childs[i]=new Node(childs[i])),child.parent=node,child.depth=node.depth+1;return root.eachBefore(computeHeight)}function objectChildren(d){return d.children}function mapChildren(d){return Array.isArray(d)?d[1]:null}function copyData(node){void 0!==node.data.value&&(node.value=node.data.value),node.data=node.data.data}function computeHeight(node){var height=0;do{node.height=height}while((node=node.parent)&&node.height<++height)}function Node(data){this.data=data,this.depth=this.height=0,this.parent=null}function constantZero(){return 0}function constant(x){return function(){return x}}function roundNode(node){node.x0=Math.round(node.x0),node.y0=Math.round(node.y0),node.x1=Math.round(node.x1),node.y1=Math.round(node.y1)}function treemapDice(parent,x0,y0,x1,y1){for(var node,nodes=parent.children,i=-1,n=nodes.length,k=parent.value&&(x1-x0)/parent.value;++i<n;)(node=nodes[i]).y0=y0,node.y1=y1,node.x0=x0,node.x1=x0+=node.value*k}function treemapSlice(parent,x0,y0,x1,y1){for(var node,nodes=parent.children,i=-1,n=nodes.length,k=parent.value&&(y1-y0)/parent.value;++i<n;)(node=nodes[i]).x0=x0,node.x1=x1,node.y0=y0,node.y1=y0+=node.value*k}Node.prototype=hierarchy.prototype={constructor:Node,count:function(){return this.eachAfter(count)},each:function(callback,that){let index=-1;for(const node of this)callback.call(that,node,++index,this);return this},eachAfter:function(callback,that){for(var children,i,n,node=this,nodes=[node],next=[],index=-1;node=nodes.pop();)if(next.push(node),children=node.children)for(i=0,n=children.length;i<n;++i)nodes.push(children[i]);for(;node=next.pop();)callback.call(that,node,++index,this);return this},eachBefore:function(callback,that){for(var children,i,node=this,nodes=[node],index=-1;node=nodes.pop();)if(callback.call(that,node,++index,this),children=node.children)for(i=children.length-1;i>=0;--i)nodes.push(children[i]);return this},find:function(callback,that){let index=-1;for(const node of this)if(callback.call(that,node,++index,this))return node},sum:function(value){return this.eachAfter(function(node){for(var sum=+value(node.data)||0,children=node.children,i=children&&children.length;--i>=0;)sum+=children[i].value;node.value=sum})},sort:function(compare){return this.eachBefore(function(node){node.children&&node.children.sort(compare)})},path:function(end){for(var start=this,ancestor=function(a,b){if(a===b)return a;var aNodes=a.ancestors(),bNodes=b.ancestors(),c=null;a=aNodes.pop(),b=bNodes.pop();for(;a===b;)c=a,a=aNodes.pop(),b=bNodes.pop();return c}(start,end),nodes=[start];start!==ancestor;)start=start.parent,nodes.push(start);for(var k=nodes.length;end!==ancestor;)nodes.splice(k,0,end),end=end.parent;return nodes},ancestors:function(){for(var node=this,nodes=[node];node=node.parent;)nodes.push(node);return nodes},descendants:function(){return Array.from(this)},leaves:function(){var leaves=[];return this.eachBefore(function(node){node.children||leaves.push(node)}),leaves},links:function(){var root=this,links=[];return root.each(function(node){node!==root&&links.push({source:node.parent,target:node})}),links},copy:function(){return hierarchy(this).eachBefore(copyData)},[Symbol.iterator]:function*(){var current,children,i,n,node=this,next=[node];do{for(current=next.reverse(),next=[];node=current.pop();)if(yield node,children=node.children)for(i=0,n=children.length;i<n;++i)next.push(children[i])}while(next.length)}};const squarify=function custom(ratio){function squarify2(parent,x0,y0,x1,y1){!function(ratio,parent,x0,y0,x1,y1){for(var row,nodeValue,dx,dy,sumValue,minValue,maxValue,newRatio,minRatio,alpha,beta,rows=[],nodes=parent.children,i0=0,i1=0,n=nodes.length,value=parent.value;i0<n;){dx=x1-x0,dy=y1-y0;do{sumValue=nodes[i1++].value}while(!sumValue&&i1<n);for(minValue=maxValue=sumValue,beta=sumValue*sumValue*(alpha=Math.max(dy/dx,dx/dy)/(value*ratio)),minRatio=Math.max(maxValue/beta,beta/minValue);i1<n;++i1){if(sumValue+=nodeValue=nodes[i1].value,nodeValue<minValue&&(minValue=nodeValue),nodeValue>maxValue&&(maxValue=nodeValue),beta=sumValue*sumValue*alpha,(newRatio=Math.max(maxValue/beta,beta/minValue))>minRatio){sumValue-=nodeValue;break}minRatio=newRatio}rows.push(row={value:sumValue,dice:dx<dy,children:nodes.slice(i0,i1)}),row.dice?treemapDice(row,x0,y0,x1,value?y0+=dy*sumValue/value:y1):treemapSlice(row,x0,y0,value?x0+=dx*sumValue/value:x1,y1),value-=sumValue,i0=i1}}(ratio,parent,x0,y0,x1,y1)}return squarify2.ratio=function(x){return custom((x=+x)>1?x:1)},squarify2}((1+Math.sqrt(5))/2);function treemap(){var tile=squarify,round=!1,dx=1,dy=1,paddingStack=[0],paddingInner=constantZero,paddingTop=constantZero,paddingRight=constantZero,paddingBottom=constantZero,paddingLeft=constantZero;function treemap2(root){return root.x0=root.y0=0,root.x1=dx,root.y1=dy,root.eachBefore(positionNode),paddingStack=[0],round&&root.eachBefore(roundNode),root}function positionNode(node){var p=paddingStack[node.depth],x0=node.x0+p,y0=node.y0+p,x1=node.x1-p,y1=node.y1-p;x1<x0&&(x0=x1=(x0+x1)/2),y1<y0&&(y0=y1=(y0+y1)/2),node.x0=x0,node.y0=y0,node.x1=x1,node.y1=y1,node.children&&(p=paddingStack[node.depth+1]=paddingInner(node)/2,x0+=paddingLeft(node)-p,y0+=paddingTop(node)-p,(x1-=paddingRight(node)-p)<x0&&(x0=x1=(x0+x1)/2),(y1-=paddingBottom(node)-p)<y0&&(y0=y1=(y0+y1)/2),tile(node,x0,y0,x1,y1))}return treemap2.round=function(x){return arguments.length?(round=!!x,treemap2):round},treemap2.size=function(x){return arguments.length?(dx=+x[0],dy=+x[1],treemap2):[dx,dy]},treemap2.tile=function(x){return arguments.length?(tile=function(f){if("function"!=typeof f)throw new Error;return f}(x),treemap2):tile},treemap2.padding=function(x){return arguments.length?treemap2.paddingInner(x).paddingOuter(x):treemap2.paddingInner()},treemap2.paddingInner=function(x){return arguments.length?(paddingInner="function"==typeof x?x:constant(+x),treemap2):paddingInner},treemap2.paddingOuter=function(x){return arguments.length?treemap2.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x):treemap2.paddingTop()},treemap2.paddingTop=function(x){return arguments.length?(paddingTop="function"==typeof x?x:constant(+x),treemap2):paddingTop},treemap2.paddingRight=function(x){return arguments.length?(paddingRight="function"==typeof x?x:constant(+x),treemap2):paddingRight},treemap2.paddingBottom=function(x){return arguments.length?(paddingBottom="function"==typeof x?x:constant(+x),treemap2):paddingBottom},treemap2.paddingLeft=function(x){return arguments.length?(paddingLeft="function"==typeof x?x:constant(+x),treemap2):paddingLeft},treemap2}var TreeMapDB=(__name(_a=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=setAccTitle,this.getAccTitle=getAccTitle,this.setDiagramTitle=setDiagramTitle,this.getDiagramTitle=getDiagramTitle,this.getAccDescription=getAccDescription,this.setAccDescription=setAccDescription}getNodes(){return this.nodes}getConfig(){const defaultConfig=defaultConfig_default,userConfig=getConfig();return cleanAndMerge({...defaultConfig.treemap,...userConfig.treemap??{}})}addNode(node,level){this.nodes.push(node),this.levels.set(node,level),0===level&&(this.outerNodes.push(node),this.root??(this.root=node))}getRoot(){return{name:"",children:this.outerNodes}}addClass(id,_style){const styleClass=this.classes.get(id)??{id:id,styles:[],textStyles:[]},styles=_style.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");styles&&styles.forEach(s=>{isLabelStyle(s)&&((null==styleClass?void 0:styleClass.textStyles)?styleClass.textStyles.push(s):styleClass.textStyles=[s]),(null==styleClass?void 0:styleClass.styles)?styleClass.styles.push(s):styleClass.styles=[s]}),this.classes.set(id,styleClass)}getClasses(){return this.classes}getStylesForClass(classSelector){var _a2;return(null==(_a2=this.classes.get(classSelector))?void 0:_a2.styles)??[]}clear(){clear(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},"TreeMapDB"),_a);function buildHierarchy(items){if(!items.length)return[];const root=[],stack=[];return items.forEach(item=>{const node={name:item.name,children:"Leaf"===item.type?void 0:[]};for(node.classSelector=null==item?void 0:item.classSelector,(null==item?void 0:item.cssCompiledStyles)&&(node.cssCompiledStyles=item.cssCompiledStyles),"Leaf"===item.type&&void 0!==item.value&&(node.value=item.value);stack.length>0&&stack[stack.length-1].level>=item.level;)stack.pop();if(0===stack.length)root.push(node);else{const parent=stack[stack.length-1].node;parent.children?parent.children.push(node):parent.children=[node]}"Leaf"!==item.type&&stack.push({node:node,level:item.level})}),root}__name(buildHierarchy,"buildHierarchy");var populate=__name((ast,db)=>{populateCommonDb(ast,db);const items=[];for(const row of ast.TreemapRows??[])"ClassDefStatement"===row.$type&&db.addClass(row.className??"",row.styleText??"");for(const row of ast.TreemapRows??[]){const item=row.item;if(!item)continue;const level=row.indent?parseInt(row.indent):0,name=getItemName(item),styles=item.classSelector?db.getStylesForClass(item.classSelector):[],cssCompiledStyles=styles.length>0?styles:void 0,itemData={level:level,name:name,type:item.$type,value:item.value,classSelector:item.classSelector,cssCompiledStyles:cssCompiledStyles};items.push(itemData)}const hierarchyNodes=buildHierarchy(items),addNodesRecursively=__name((nodes,level)=>{for(const node of nodes)db.addNode(node,level),node.children&&node.children.length>0&&addNodesRecursively(node.children,level+1)},"addNodesRecursively");addNodesRecursively(hierarchyNodes,0)},"populate"),getItemName=__name(item=>item.name?String(item.name):"","getItemName"),parser={parser:{yy:void 0},parse:__name(async text=>{var _a2;try{const parseFunc=parse,ast=await parseFunc("treemap",text);log.debug("Treemap AST:",ast);const db=null==(_a2=parser.parser)?void 0:_a2.yy;if(!(db instanceof TreeMapDB))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");populate(ast,db)}catch(error){throw log.error("Error parsing treemap:",error),error}},"parse")},renderer={draw:__name((_text,id,_version,diagram2)=>{const treemapDb=diagram2.db,config=treemapDb.getConfig(),treemapInnerPadding=config.padding??10,title=treemapDb.getDiagramTitle(),root=treemapDb.getRoot(),{themeVariables:themeVariables}=getConfig();if(!root)return;const titleHeight=title?30:0,svg=selectSvgElement(id),width=config.nodeWidth?10*config.nodeWidth:960,height=config.nodeHeight?10*config.nodeHeight:500,svgWidth=width,svgHeight=height+titleHeight;let valueFormat;svg.attr("viewBox",`0 0 ${svgWidth} ${svgHeight}`),configureSvgSize(svg,svgHeight,svgWidth,config.useMaxWidth);try{const formatStr=config.valueFormat||",";if("$0,0"===formatStr)valueFormat=__name(value=>"$"+format(",")(value),"valueFormat");else if(formatStr.startsWith("$")&&formatStr.includes(",")){const precision=/\.\d+/.exec(formatStr),precisionStr=precision?precision[0]:"";valueFormat=__name(value=>"$"+format(","+precisionStr)(value),"valueFormat")}else if(formatStr.startsWith("$")){const restOfFormat=formatStr.substring(1);valueFormat=__name(value=>"$"+format(restOfFormat||"")(value),"valueFormat")}else valueFormat=format(formatStr)}catch(error){log.error("Error creating format function:",error),valueFormat=format(",")}const colorScale=ordinal().range(["transparent",themeVariables.cScale0,themeVariables.cScale1,themeVariables.cScale2,themeVariables.cScale3,themeVariables.cScale4,themeVariables.cScale5,themeVariables.cScale6,themeVariables.cScale7,themeVariables.cScale8,themeVariables.cScale9,themeVariables.cScale10,themeVariables.cScale11]),colorScalePeer=ordinal().range(["transparent",themeVariables.cScalePeer0,themeVariables.cScalePeer1,themeVariables.cScalePeer2,themeVariables.cScalePeer3,themeVariables.cScalePeer4,themeVariables.cScalePeer5,themeVariables.cScalePeer6,themeVariables.cScalePeer7,themeVariables.cScalePeer8,themeVariables.cScalePeer9,themeVariables.cScalePeer10,themeVariables.cScalePeer11]),colorScaleLabel=ordinal().range([themeVariables.cScaleLabel0,themeVariables.cScaleLabel1,themeVariables.cScaleLabel2,themeVariables.cScaleLabel3,themeVariables.cScaleLabel4,themeVariables.cScaleLabel5,themeVariables.cScaleLabel6,themeVariables.cScaleLabel7,themeVariables.cScaleLabel8,themeVariables.cScaleLabel9,themeVariables.cScaleLabel10,themeVariables.cScaleLabel11]);title&&svg.append("text").attr("x",svgWidth/2).attr("y",titleHeight/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(title);const g=svg.append("g").attr("transform",`translate(0, ${titleHeight})`).attr("class","treemapContainer"),hierarchyRoot=hierarchy(root).sum(d=>d.value??0).sort((a,b)=>(b.value??0)-(a.value??0)),treemapData=treemap().size([width,height]).paddingTop(d=>d.children&&d.children.length>0?35:0).paddingInner(treemapInnerPadding).paddingLeft(d=>d.children&&d.children.length>0?10:0).paddingRight(d=>d.children&&d.children.length>0?10:0).paddingBottom(d=>d.children&&d.children.length>0?10:0).round(!0)(hierarchyRoot),branchNodes=treemapData.descendants().filter(d=>d.children&&d.children.length>0),sections=g.selectAll(".treemapSection").data(branchNodes).enter().append("g").attr("class","treemapSection").attr("transform",d=>`translate(${d.x0},${d.y0})`);sections.append("rect").attr("width",d=>d.x1-d.x0).attr("height",25).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",d=>0===d.depth?"display: none;":""),sections.append("clipPath").attr("id",(_d,i)=>`clip-section-${id}-${i}`).append("rect").attr("width",d=>Math.max(0,d.x1-d.x0-12)).attr("height",25),sections.append("rect").attr("width",d=>d.x1-d.x0).attr("height",d=>d.y1-d.y0).attr("class",(_d,i)=>`treemapSection section${i}`).attr("fill",d=>colorScale(d.data.name)).attr("fill-opacity",.6).attr("stroke",d=>colorScalePeer(d.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",d=>{if(0===d.depth)return"display: none;";const styles=styles2String({cssCompiledStyles:d.data.cssCompiledStyles});return styles.nodeStyles+";"+styles.borderStyles.join(";")}),sections.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",12.5).attr("dominant-baseline","middle").text(d=>0===d.depth?"":d.data.name).attr("font-weight","bold").attr("style",d=>{if(0===d.depth)return"display: none;";return"dominant-baseline: middle; font-size: 12px; fill:"+colorScaleLabel(d.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+styles2String({cssCompiledStyles:d.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")}).each(function(d){if(0===d.depth)return;const self=select(this),originalText=d.data.name;self.text(originalText);const totalHeaderWidth=d.x1-d.x0;let spaceForTextContent;if(!1!==config.showValues&&d.value){spaceForTextContent=totalHeaderWidth-10-30-10-6}else{spaceForTextContent=totalHeaderWidth-6-6}const actualAvailableWidth=Math.max(15,spaceForTextContent),textNode=self.node();if(textNode.getComputedTextLength()>actualAvailableWidth){const ellipsis="...";let currentTruncatedText=originalText;for(;currentTruncatedText.length>0;){if(currentTruncatedText=originalText.substring(0,currentTruncatedText.length-1),0===currentTruncatedText.length){self.text(ellipsis),textNode.getComputedTextLength()>actualAvailableWidth&&self.text("");break}if(self.text(currentTruncatedText+ellipsis),textNode.getComputedTextLength()<=actualAvailableWidth)break}}}),!1!==config.showValues&&sections.append("text").attr("class","treemapSectionValue").attr("x",d=>d.x1-d.x0-10).attr("y",12.5).attr("text-anchor","end").attr("dominant-baseline","middle").text(d=>d.value?valueFormat(d.value):"").attr("font-style","italic").attr("style",d=>{if(0===d.depth)return"display: none;";return"text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+colorScaleLabel(d.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+styles2String({cssCompiledStyles:d.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")});const leafNodes=treemapData.leaves(),cell=g.selectAll(".treemapLeafGroup").data(leafNodes).enter().append("g").attr("class",(d,i)=>`treemapNode treemapLeafGroup leaf${i}${d.data.classSelector?` ${d.data.classSelector}`:""}x`).attr("transform",d=>`translate(${d.x0},${d.y0})`);cell.append("rect").attr("width",d=>d.x1-d.x0).attr("height",d=>d.y1-d.y0).attr("class","treemapLeaf").attr("fill",d=>d.parent?colorScale(d.parent.data.name):colorScale(d.data.name)).attr("style",d=>styles2String({cssCompiledStyles:d.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",d=>d.parent?colorScale(d.parent.data.name):colorScale(d.data.name)).attr("stroke-width",3),cell.append("clipPath").attr("id",(_d,i)=>`clip-${id}-${i}`).append("rect").attr("width",d=>Math.max(0,d.x1-d.x0-4)).attr("height",d=>Math.max(0,d.y1-d.y0-4));if(cell.append("text").attr("class","treemapLabel").attr("x",d=>(d.x1-d.x0)/2).attr("y",d=>(d.y1-d.y0)/2).attr("style",d=>"text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+colorScaleLabel(d.data.name)+";"+styles2String({cssCompiledStyles:d.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(_d,i)=>`url(#clip-${id}-${i})`).text(d=>d.data.name).each(function(d){const self=select(this),nodeWidth=d.x1-d.x0,nodeHeight=d.y1-d.y0,textNode=self.node(),availableWidth=nodeWidth-8,availableHeight=nodeHeight-8;if(availableWidth<10||availableHeight<10)return void self.style("display","none");let currentLabelFontSize=parseInt(self.style("font-size"),10);for(;textNode.getComputedTextLength()>availableWidth&&currentLabelFontSize>8;)currentLabelFontSize--,self.style("font-size",`${currentLabelFontSize}px`);let prospectiveValueFontSize=Math.max(6,Math.min(28,Math.round(.6*currentLabelFontSize))),combinedHeight=currentLabelFontSize+2+prospectiveValueFontSize;for(;combinedHeight>availableHeight&&currentLabelFontSize>8&&(currentLabelFontSize--,prospectiveValueFontSize=Math.max(6,Math.min(28,Math.round(.6*currentLabelFontSize))),!(prospectiveValueFontSize<6&&8===currentLabelFontSize));)self.style("font-size",`${currentLabelFontSize}px`),combinedHeight=currentLabelFontSize+2+prospectiveValueFontSize;self.style("font-size",`${currentLabelFontSize}px`),(textNode.getComputedTextLength()>availableWidth||currentLabelFontSize<8||availableHeight<currentLabelFontSize)&&self.style("display","none")}),!1!==config.showValues){cell.append("text").attr("class","treemapValue").attr("x",d=>(d.x1-d.x0)/2).attr("y",function(d){return(d.y1-d.y0)/2}).attr("style",d=>"text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+colorScaleLabel(d.data.name)+";"+styles2String({cssCompiledStyles:d.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(_d,i)=>`url(#clip-${id}-${i})`).text(d=>d.value?valueFormat(d.value):"").each(function(d){const valueTextElement=select(this),parentCellNode=this.parentNode;if(!parentCellNode)return void valueTextElement.style("display","none");const labelElement=select(parentCellNode).select(".treemapLabel");if(labelElement.empty()||"none"===labelElement.style("display"))return void valueTextElement.style("display","none");const finalLabelFontSize=parseFloat(labelElement.style("font-size")),actualValueFontSize=Math.max(6,Math.min(28,Math.round(.6*finalLabelFontSize)));valueTextElement.style("font-size",`${actualValueFontSize}px`);const valueTopActualY=(d.y1-d.y0)/2+finalLabelFontSize/2+2;valueTextElement.attr("y",valueTopActualY);const nodeWidth=d.x1-d.x0,maxValueBottomY=d.y1-d.y0-4,availableWidthForValue=nodeWidth-8;valueTextElement.node().getComputedTextLength()>availableWidthForValue||valueTopActualY+actualValueFontSize>maxValueBottomY||actualValueFontSize<6?valueTextElement.style("display","none"):valueTextElement.style("display",null)})}const diagramPadding=config.diagramPadding??8;setupViewPortForSVG(svg,diagramPadding,"flowchart",(null==config?void 0:config.useMaxWidth)||!1)},"draw"),getClasses:__name(function(_text,diagramObj){return diagramObj.db.getClasses()},"getClasses")},defaultTreemapStyleOptions={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},styles_default=__name(({treemap:treemap2}={})=>{const defaultThemeVariables=getThemeVariables3(),currentConfig=getConfig(),themeVariables=cleanAndMerge(defaultThemeVariables,currentConfig.themeVariables),options=cleanAndMerge(defaultTreemapStyleOptions,treemap2),titleColor=options.titleColor??themeVariables.titleColor,labelColor=options.labelColor??themeVariables.textColor,valueColor=options.valueColor??themeVariables.textColor;return`\n .treemapNode.section {\n stroke: ${options.sectionStrokeColor};\n stroke-width: ${options.sectionStrokeWidth};\n fill: ${options.sectionFillColor};\n }\n .treemapNode.leaf {\n stroke: ${options.leafStrokeColor};\n stroke-width: ${options.leafStrokeWidth};\n fill: ${options.leafFillColor};\n }\n .treemapLabel {\n fill: ${labelColor};\n font-size: ${options.labelFontSize};\n }\n .treemapValue {\n fill: ${valueColor};\n font-size: ${options.valueFontSize};\n }\n .treemapTitle {\n fill: ${titleColor};\n font-size: ${options.titleFontSize};\n }\n `},"getStyles"),diagram={parser:parser,get db(){return new TreeMapDB},renderer:renderer,styles:styles_default};export{diagram};
@@ -1 +0,0 @@
1
- import{s as setAccDescription,g as getAccDescription,q as getDiagramTitle,p as setDiagramTitle,a as getAccTitle,b as setAccTitle,_ as __name,H as selectSvgElement,y as clear,E as cleanAndMerge,F as defaultConfig_default,C as getConfig,l as log,I as getThemeVariables3,e as configureSvgSize}from"./mermaid.core-DvwEdatr.js";import{p as populateCommonDb}from"./chunk-4BX2VUAB-DnFoMzQG.js";import{p as parse}from"./wardley-RL74JXVD-BFcIn2-Q.js";import"./vendor-mdxeditor-Cy5Xg_90.js";import"./vendor-antd-BTBRwbax.js";import"./vendor-virtuoso-Bq6QMhgG.js";import"./vendor-codemirror-CPWlhuQ1.js";import"./vendor-markdown-DOJHsAxX.js";import"./min-DFik8k4L.js";import"./_baseUniq-C2FCldN4.js";var defaultOptions={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},defaultRadarData={axes:[],curves:[],options:defaultOptions},data=structuredClone(defaultRadarData),DEFAULT_RADAR_CONFIG=defaultConfig_default.radar,getConfig2=__name(()=>cleanAndMerge({...DEFAULT_RADAR_CONFIG,...getConfig().radar}),"getConfig"),getAxes=__name(()=>data.axes,"getAxes"),getCurves=__name(()=>data.curves,"getCurves"),getOptions=__name(()=>data.options,"getOptions"),setAxes=__name(axes=>{data.axes=axes.map(axis=>({name:axis.name,label:axis.label??axis.name}))},"setAxes"),setCurves=__name(curves=>{data.curves=curves.map(curve=>({name:curve.name,label:curve.label??curve.name,entries:computeCurveEntries(curve.entries)}))},"setCurves"),computeCurveEntries=__name(entries=>{if(null==entries[0].axis)return entries.map(entry=>entry.value);const axes=getAxes();if(0===axes.length)throw new Error("Axes must be populated before curves for reference entries");return axes.map(axis=>{const entry=entries.find(entry2=>{var _a;return(null==(_a=entry2.axis)?void 0:_a.$refText)===axis.name});if(void 0===entry)throw new Error("Missing entry for axis "+axis.label);return entry.value})},"computeCurveEntries"),db={getAxes:getAxes,getCurves:getCurves,getOptions:getOptions,setAxes:setAxes,setCurves:setCurves,setOptions:__name(options=>{var _a,_b,_c,_d,_e;const optionMap=options.reduce((acc,option)=>(acc[option.name]=option,acc),{});data.options={showLegend:(null==(_a=optionMap.showLegend)?void 0:_a.value)??defaultOptions.showLegend,ticks:(null==(_b=optionMap.ticks)?void 0:_b.value)??defaultOptions.ticks,max:(null==(_c=optionMap.max)?void 0:_c.value)??defaultOptions.max,min:(null==(_d=optionMap.min)?void 0:_d.value)??defaultOptions.min,graticule:(null==(_e=optionMap.graticule)?void 0:_e.value)??defaultOptions.graticule}},"setOptions"),getConfig:getConfig2,clear:__name(()=>{clear(),data=structuredClone(defaultRadarData)},"clear"),setAccTitle:setAccTitle,getAccTitle:getAccTitle,setDiagramTitle:setDiagramTitle,getDiagramTitle:getDiagramTitle,getAccDescription:getAccDescription,setAccDescription:setAccDescription},populate=__name(ast=>{populateCommonDb(ast,db);const{axes:axes,curves:curves,options:options}=ast;db.setAxes(axes),db.setCurves(curves),db.setOptions(options)},"populate"),parser={parse:__name(async input=>{const ast=await parse("radar",input);log.debug(ast),populate(ast)},"parse")},draw=__name((_text,id,_version,diagram2)=>{const db2=diagram2.db,axes=db2.getAxes(),curves=db2.getCurves(),options=db2.getOptions(),config=db2.getConfig(),title=db2.getDiagramTitle(),svg=selectSvgElement(id),g=drawFrame(svg,config),maxValue=options.max??Math.max(...curves.map(curve=>Math.max(...curve.entries))),minValue=options.min,radius=Math.min(config.width,config.height)/2;drawGraticule(g,axes,radius,options.ticks,options.graticule),drawAxes(g,axes,radius,config),drawCurves(g,axes,curves,minValue,maxValue,options.graticule,config),drawLegend(g,curves,options.showLegend,config),g.append("text").attr("class","radarTitle").text(title).attr("x",0).attr("y",-config.height/2-config.marginTop)},"draw"),drawFrame=__name((svg,config)=>{const totalWidth=config.width+config.marginLeft+config.marginRight,totalHeight=config.height+config.marginTop+config.marginBottom,center_x=config.marginLeft+config.width/2,center_y=config.marginTop+config.height/2;return configureSvgSize(svg,totalHeight,totalWidth,config.useMaxWidth??!0),svg.attr("viewBox",`0 0 ${totalWidth} ${totalHeight}`),svg.append("g").attr("transform",`translate(${center_x}, ${center_y})`)},"drawFrame"),drawGraticule=__name((g,axes,radius,ticks,graticule)=>{if("circle"===graticule)for(let i=0;i<ticks;i++){const r=radius*(i+1)/ticks;g.append("circle").attr("r",r).attr("class","radarGraticule")}else if("polygon"===graticule){const numAxes=axes.length;for(let i=0;i<ticks;i++){const r=radius*(i+1)/ticks,points=axes.map((_,j)=>{const angle=2*j*Math.PI/numAxes-Math.PI/2;return`${r*Math.cos(angle)},${r*Math.sin(angle)}`}).join(" ");g.append("polygon").attr("points",points).attr("class","radarGraticule")}}},"drawGraticule"),drawAxes=__name((g,axes,radius,config)=>{const numAxes=axes.length;for(let i=0;i<numAxes;i++){const label=axes[i].label,angle=2*i*Math.PI/numAxes-Math.PI/2;g.append("line").attr("x1",0).attr("y1",0).attr("x2",radius*config.axisScaleFactor*Math.cos(angle)).attr("y2",radius*config.axisScaleFactor*Math.sin(angle)).attr("class","radarAxisLine"),g.append("text").text(label).attr("x",radius*config.axisLabelFactor*Math.cos(angle)).attr("y",radius*config.axisLabelFactor*Math.sin(angle)).attr("class","radarAxisLabel")}},"drawAxes");function drawCurves(g,axes,curves,minValue,maxValue,graticule,config){const numAxes=axes.length,radius=Math.min(config.width,config.height)/2;curves.forEach((curve,index)=>{if(curve.entries.length!==numAxes)return;const points=curve.entries.map((entry,i)=>{const angle=2*Math.PI*i/numAxes-Math.PI/2,r=relativeRadius(entry,minValue,maxValue,radius);return{x:r*Math.cos(angle),y:r*Math.sin(angle)}});"circle"===graticule?g.append("path").attr("d",closedRoundCurve(points,config.curveTension)).attr("class",`radarCurve-${index}`):"polygon"===graticule&&g.append("polygon").attr("points",points.map(p=>`${p.x},${p.y}`).join(" ")).attr("class",`radarCurve-${index}`)})}function relativeRadius(value,minValue,maxValue,radius){return radius*(Math.min(Math.max(value,minValue),maxValue)-minValue)/(maxValue-minValue)}function closedRoundCurve(points,tension){const numPoints=points.length;let d=`M${points[0].x},${points[0].y}`;for(let i=0;i<numPoints;i++){const p0=points[(i-1+numPoints)%numPoints],p1=points[i],p2=points[(i+1)%numPoints],p3=points[(i+2)%numPoints],cp1={x:p1.x+(p2.x-p0.x)*tension,y:p1.y+(p2.y-p0.y)*tension},cp2={x:p2.x-(p3.x-p1.x)*tension,y:p2.y-(p3.y-p1.y)*tension};d+=` C${cp1.x},${cp1.y} ${cp2.x},${cp2.y} ${p2.x},${p2.y}`}return`${d} Z`}function drawLegend(g,curves,showLegend,config){if(!showLegend)return;const legendX=3*(config.width/2+config.marginRight)/4,legendY=3*-(config.height/2+config.marginTop)/4;curves.forEach((curve,index)=>{const itemGroup=g.append("g").attr("transform",`translate(${legendX}, ${legendY+20*index})`);itemGroup.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${index}`),itemGroup.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(curve.label)})}__name(drawCurves,"drawCurves"),__name(relativeRadius,"relativeRadius"),__name(closedRoundCurve,"closedRoundCurve"),__name(drawLegend,"drawLegend");var renderer={draw:draw},genIndexStyles=__name((themeVariables,radarOptions)=>{let sections="";for(let i=0;i<themeVariables.THEME_COLOR_LIMIT;i++){const indexColor=themeVariables[`cScale${i}`];sections+=`\n\t\t.radarCurve-${i} {\n\t\t\tcolor: ${indexColor};\n\t\t\tfill: ${indexColor};\n\t\t\tfill-opacity: ${radarOptions.curveOpacity};\n\t\t\tstroke: ${indexColor};\n\t\t\tstroke-width: ${radarOptions.curveStrokeWidth};\n\t\t}\n\t\t.radarLegendBox-${i} {\n\t\t\tfill: ${indexColor};\n\t\t\tfill-opacity: ${radarOptions.curveOpacity};\n\t\t\tstroke: ${indexColor};\n\t\t}\n\t\t`}return sections},"genIndexStyles"),buildRadarStyleOptions=__name(radar=>{const defaultThemeVariables=getThemeVariables3(),currentConfig=getConfig(),themeVariables=cleanAndMerge(defaultThemeVariables,currentConfig.themeVariables);return{themeVariables:themeVariables,radarOptions:cleanAndMerge(themeVariables.radar,radar)}},"buildRadarStyleOptions"),diagram={parser:parser,db:db,renderer:renderer,styles:__name(({radar:radar}={})=>{const{themeVariables:themeVariables,radarOptions:radarOptions}=buildRadarStyleOptions(radar);return`\n\t.radarTitle {\n\t\tfont-size: ${themeVariables.fontSize};\n\t\tcolor: ${themeVariables.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${radarOptions.axisColor};\n\t\tstroke-width: ${radarOptions.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tdominant-baseline: middle;\n\t\ttext-anchor: middle;\n\t\tfont-size: ${radarOptions.axisLabelFontSize}px;\n\t\tcolor: ${radarOptions.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${radarOptions.graticuleColor};\n\t\tfill-opacity: ${radarOptions.graticuleOpacity};\n\t\tstroke: ${radarOptions.graticuleColor};\n\t\tstroke-width: ${radarOptions.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${radarOptions.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${genIndexStyles(themeVariables,radarOptions)}\n\t`},"styles")};export{diagram};
@@ -1 +0,0 @@
1
- var _a;import{_ as __name,E as cleanAndMerge,H as selectSvgElement,e as configureSvgSize,l as log,b as setAccTitle,a as getAccTitle,p as setDiagramTitle,q as getDiagramTitle,g as getAccDescription,s as setAccDescription,F as defaultConfig_default,C as getConfig,y as clear}from"./mermaid.core-DvwEdatr.js";import{p as populateCommonDb}from"./chunk-4BX2VUAB-DnFoMzQG.js";import{p as parse}from"./wardley-RL74JXVD-BFcIn2-Q.js";import"./vendor-mdxeditor-Cy5Xg_90.js";import"./vendor-antd-BTBRwbax.js";import"./vendor-virtuoso-Bq6QMhgG.js";import"./vendor-codemirror-CPWlhuQ1.js";import"./vendor-markdown-DOJHsAxX.js";import"./min-DFik8k4L.js";import"./_baseUniq-C2FCldN4.js";var DEFAULT_PACKET_CONFIG=defaultConfig_default.packet,PacketDB=(__name(_a=class{constructor(){this.packet=[],this.setAccTitle=setAccTitle,this.getAccTitle=getAccTitle,this.setDiagramTitle=setDiagramTitle,this.getDiagramTitle=getDiagramTitle,this.getAccDescription=getAccDescription,this.setAccDescription=setAccDescription}getConfig(){const config=cleanAndMerge({...DEFAULT_PACKET_CONFIG,...getConfig().packet});return config.showBits&&(config.paddingY+=10),config}getPacket(){return this.packet}pushWord(word){word.length>0&&this.packet.push(word)}clear(){clear(),this.packet=[]}},"PacketDB"),_a),populate=__name((ast,db)=>{populateCommonDb(ast,db);let lastBit=-1,word=[],row=1;const{bitsPerRow:bitsPerRow}=db.getConfig();for(let{start:start,end:end,bits:bits,label:label}of ast.blocks){if(void 0!==start&&void 0!==end&&end<start)throw new Error(`Packet block ${start} - ${end} is invalid. End must be greater than start.`);if(start??(start=lastBit+1),start!==lastBit+1)throw new Error(`Packet block ${start} - ${end??start} is not contiguous. It should start from ${lastBit+1}.`);if(0===bits)throw new Error(`Packet block ${start} is invalid. Cannot have a zero bit field.`);for(end??(end=start+(bits??1)-1),bits??(bits=end-start+1),lastBit=end,log.debug(`Packet block ${start} - ${lastBit} with label ${label}`);word.length<=bitsPerRow+1&&db.getPacket().length<1e4;){const[block,nextBlock]=getNextFittingBlock({start:start,end:end,bits:bits,label:label},row,bitsPerRow);if(word.push(block),block.end+1===row*bitsPerRow&&(db.pushWord(word),word=[],row++),!nextBlock)break;({start:start,end:end,bits:bits,label:label}=nextBlock)}}db.pushWord(word)},"populate"),getNextFittingBlock=__name((block,row,bitsPerRow)=>{if(void 0===block.start)throw new Error("start should have been set during first phase");if(void 0===block.end)throw new Error("end should have been set during first phase");if(block.start>block.end)throw new Error(`Block start ${block.start} is greater than block end ${block.end}.`);if(block.end+1<=row*bitsPerRow)return[block,void 0];const rowEnd=row*bitsPerRow-1,rowStart=row*bitsPerRow;return[{start:block.start,end:rowEnd,label:block.label,bits:rowEnd-block.start},{start:rowStart,end:block.end,label:block.label,bits:block.end-rowStart}]},"getNextFittingBlock"),parser={parser:{yy:void 0},parse:__name(async input=>{var _a2;const ast=await parse("packet",input),db=null==(_a2=parser.parser)?void 0:_a2.yy;if(!(db instanceof PacketDB))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");log.debug(ast),populate(ast,db)},"parse")},draw=__name((_text,id,_version,diagram2)=>{const db=diagram2.db,config=db.getConfig(),{rowHeight:rowHeight,paddingY:paddingY,bitWidth:bitWidth,bitsPerRow:bitsPerRow}=config,words=db.getPacket(),title=db.getDiagramTitle(),totalRowHeight=rowHeight+paddingY,svgHeight=totalRowHeight*(words.length+1)-(title?0:rowHeight),svgWidth=bitWidth*bitsPerRow+2,svg=selectSvgElement(id);svg.attr("viewBox",`0 0 ${svgWidth} ${svgHeight}`),configureSvgSize(svg,svgHeight,svgWidth,config.useMaxWidth);for(const[word,packet]of words.entries())drawWord(svg,packet,word,config);svg.append("text").text(title).attr("x",svgWidth/2).attr("y",svgHeight-totalRowHeight/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),drawWord=__name((svg,word,rowNumber,{rowHeight:rowHeight,paddingX:paddingX,paddingY:paddingY,bitWidth:bitWidth,bitsPerRow:bitsPerRow,showBits:showBits})=>{const group=svg.append("g"),wordY=rowNumber*(rowHeight+paddingY)+paddingY;for(const block of word){const blockX=block.start%bitsPerRow*bitWidth+1,width=(block.end-block.start+1)*bitWidth-paddingX;if(group.append("rect").attr("x",blockX).attr("y",wordY).attr("width",width).attr("height",rowHeight).attr("class","packetBlock"),group.append("text").attr("x",blockX+width/2).attr("y",wordY+rowHeight/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(block.label),!showBits)continue;const isSingleBlock=block.end===block.start,bitNumberY=wordY-2;group.append("text").attr("x",blockX+(isSingleBlock?width/2:0)).attr("y",bitNumberY).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",isSingleBlock?"middle":"start").text(block.start),isSingleBlock||group.append("text").attr("x",blockX+width).attr("y",bitNumberY).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(block.end)}},"drawWord"),renderer={draw:draw},defaultPacketStyleOptions={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},styles=__name(({packet:packet}={})=>{const options=cleanAndMerge(defaultPacketStyleOptions,packet);return`\n\t.packetByte {\n\t\tfont-size: ${options.byteFontSize};\n\t}\n\t.packetByte.start {\n\t\tfill: ${options.startByteColor};\n\t}\n\t.packetByte.end {\n\t\tfill: ${options.endByteColor};\n\t}\n\t.packetLabel {\n\t\tfill: ${options.labelColor};\n\t\tfont-size: ${options.labelFontSize};\n\t}\n\t.packetTitle {\n\t\tfill: ${options.titleColor};\n\t\tfont-size: ${options.titleFontSize};\n\t}\n\t.packetBlock {\n\t\tstroke: ${options.blockStrokeColor};\n\t\tstroke-width: ${options.blockStrokeWidth};\n\t\tfill: ${options.blockFillColor};\n\t}\n\t`},"styles"),diagram={parser:parser,get db(){return new PacketDB},renderer:renderer,styles:styles};export{diagram};
@@ -1 +0,0 @@
1
- var _a;import{g as getDiagramElement}from"./chunk-55IACEB6-DTKTLKcJ.js";import{s as setupViewPortForSVG}from"./chunk-EDXVE4YY-BNqgeN9r.js";import{_ as __name,b as setAccTitle,a as getAccTitle,s as setAccDescription,g as getAccDescription,p as setDiagramTitle,q as getDiagramTitle,c as getConfig2,l as log,y as clear,x as getEdgeId,A as rgba,B as __export,o as getRegisteredLayoutAlgorithm,r as render,d as select,u as utils_default}from"./mermaid.core-DvwEdatr.js";import{c as channel}from"./channel-xMmQtLq9.js";import"./vendor-mdxeditor-Cy5Xg_90.js";import"./vendor-antd-BTBRwbax.js";import"./vendor-virtuoso-Bq6QMhgG.js";import"./vendor-codemirror-CPWlhuQ1.js";import"./vendor-markdown-DOJHsAxX.js";var parser=function(){var o=__name(function(k,v,o2,l){for(o2=o2||{},l=k.length;l--;o2[k[l]]=v);return o2},"o"),$V0=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],$V1=[1,10],$V2=[1,11],$V3=[1,12],$V4=[1,13],$V5=[1,23],$V6=[1,24],$V7=[1,25],$V8=[1,26],$V9=[1,27],$Va=[1,19],$Vb=[1,28],$Vc=[1,29],$Vd=[1,20],$Ve=[1,18],$Vf=[1,21],$Vg=[1,22],$Vh=[1,36],$Vi=[1,37],$Vj=[1,38],$Vk=[1,39],$Vl=[1,40],$Vm=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],$Vn=[1,45],$Vo=[1,46],$Vp=[1,55],$Vq=[40,48,50,51,52,70,71],$Vr=[1,66],$Vs=[1,64],$Vt=[1,61],$Vu=[1,65],$Vv=[1,67],$Vw=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],$Vx=[65,66,67,68,69],$Vy=[1,84],$Vz=[1,83],$VA=[1,81],$VB=[1,82],$VC=[6,10,42,47],$VD=[6,10,13,41,42,47,48,49],$VE=[1,92],$VF=[1,91],$VG=[1,90],$VH=[19,58],$VI=[1,101],$VJ=[1,100],$VK=[19,58,60,62],parser2={trace:__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:__name(function(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:break;case 2:case 6:case 7:this.$=[];break;case 3:$$[$0-1].push($$[$0]),this.$=$$[$0-1];break;case 4:case 5:case 55:case 56:case 57:case 58:case 81:case 65:case 66:case 69:this.$=$$[$0];break;case 8:yy.addEntity($$[$0-4]),yy.addEntity($$[$0-2]),yy.addRelationship($$[$0-4],$$[$0],$$[$0-2],$$[$0-3]);break;case 9:yy.addEntity($$[$0-8]),yy.addEntity($$[$0-4]),yy.addRelationship($$[$0-8],$$[$0],$$[$0-4],$$[$0-5]),yy.setClass([$$[$0-8]],$$[$0-6]),yy.setClass([$$[$0-4]],$$[$0-2]);break;case 10:yy.addEntity($$[$0-6]),yy.addEntity($$[$0-2]),yy.addRelationship($$[$0-6],$$[$0],$$[$0-2],$$[$0-3]),yy.setClass([$$[$0-6]],$$[$0-4]);break;case 11:yy.addEntity($$[$0-6]),yy.addEntity($$[$0-4]),yy.addRelationship($$[$0-6],$$[$0],$$[$0-4],$$[$0-5]),yy.setClass([$$[$0-4]],$$[$0-2]);break;case 12:yy.addEntity($$[$0-3]),yy.addAttributes($$[$0-3],$$[$0-1]);break;case 13:yy.addEntity($$[$0-5]),yy.addAttributes($$[$0-5],$$[$0-1]),yy.setClass([$$[$0-5]],$$[$0-3]);break;case 14:yy.addEntity($$[$0-2]);break;case 15:yy.addEntity($$[$0-4]),yy.setClass([$$[$0-4]],$$[$0-2]);break;case 16:yy.addEntity($$[$0]);break;case 17:yy.addEntity($$[$0-2]),yy.setClass([$$[$0-2]],$$[$0]);break;case 18:yy.addEntity($$[$0-6],$$[$0-4]),yy.addAttributes($$[$0-6],$$[$0-1]);break;case 19:yy.addEntity($$[$0-8],$$[$0-6]),yy.addAttributes($$[$0-8],$$[$0-1]),yy.setClass([$$[$0-8]],$$[$0-3]);break;case 20:yy.addEntity($$[$0-5],$$[$0-3]);break;case 21:yy.addEntity($$[$0-7],$$[$0-5]),yy.setClass([$$[$0-7]],$$[$0-2]);break;case 22:yy.addEntity($$[$0-3],$$[$0-1]);break;case 23:yy.addEntity($$[$0-5],$$[$0-3]),yy.setClass([$$[$0-5]],$$[$0]);break;case 24:case 25:this.$=$$[$0].trim(),yy.setAccTitle(this.$);break;case 26:case 27:this.$=$$[$0].trim(),yy.setAccDescription(this.$);break;case 32:yy.setDirection("TB");break;case 33:yy.setDirection("BT");break;case 34:yy.setDirection("RL");break;case 35:yy.setDirection("LR");break;case 36:this.$=$$[$0-3],yy.addClass($$[$0-2],$$[$0-1]);break;case 37:case 38:case 59:case 67:case 43:this.$=[$$[$0]];break;case 39:case 40:this.$=$$[$0-2].concat([$$[$0]]);break;case 41:this.$=$$[$0-2],yy.setClass($$[$0-1],$$[$0]);break;case 42:this.$=$$[$0-3],yy.addCssStyles($$[$0-2],$$[$0-1]);break;case 44:case 68:$$[$0-2].push($$[$0]),this.$=$$[$0-2];break;case 46:this.$=$$[$0-1]+$$[$0];break;case 54:case 79:case 80:case 70:this.$=$$[$0].replace(/"/g,"");break;case 60:$$[$0].push($$[$0-1]),this.$=$$[$0];break;case 61:this.$={type:$$[$0-1],name:$$[$0]};break;case 62:this.$={type:$$[$0-2],name:$$[$0-1],keys:$$[$0]};break;case 63:this.$={type:$$[$0-2],name:$$[$0-1],comment:$$[$0]};break;case 64:this.$={type:$$[$0-3],name:$$[$0-2],keys:$$[$0-1],comment:$$[$0]};break;case 71:this.$={cardA:$$[$0],relType:$$[$0-1],cardB:$$[$0-2]};break;case 72:this.$=yy.Cardinality.ZERO_OR_ONE;break;case 73:this.$=yy.Cardinality.ZERO_OR_MORE;break;case 74:this.$=yy.Cardinality.ONE_OR_MORE;break;case 75:this.$=yy.Cardinality.ONLY_ONE;break;case 76:this.$=yy.Cardinality.MD_PARENT;break;case 77:this.$=yy.Identification.NON_IDENTIFYING;break;case 78:this.$=yy.Identification.IDENTIFYING}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:$V1,24:$V2,26:$V3,28:$V4,29:14,30:15,31:16,32:17,33:$V5,34:$V6,35:$V7,36:$V8,37:$V9,40:$Va,43:$Vb,44:$Vc,48:$Vd,50:$Ve,51:$Vf,52:$Vg},o($V0,[2,7],{1:[2,1]}),o($V0,[2,3]),{9:30,11:9,22:$V1,24:$V2,26:$V3,28:$V4,29:14,30:15,31:16,32:17,33:$V5,34:$V6,35:$V7,36:$V8,37:$V9,40:$Va,43:$Vb,44:$Vc,48:$Vd,50:$Ve,51:$Vf,52:$Vg},o($V0,[2,5]),o($V0,[2,6]),o($V0,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:$Vh,66:$Vi,67:$Vj,68:$Vk,69:$Vl}),{23:[1,41]},{25:[1,42]},{27:[1,43]},o($V0,[2,27]),o($V0,[2,28]),o($V0,[2,29]),o($V0,[2,30]),o($V0,[2,31]),o($Vm,[2,54]),o($Vm,[2,55]),o($Vm,[2,56]),o($Vm,[2,57]),o($Vm,[2,58]),o($V0,[2,32]),o($V0,[2,33]),o($V0,[2,34]),o($V0,[2,35]),{16:44,40:$Vn,41:$Vo},{16:47,40:$Vn,41:$Vo},{16:48,40:$Vn,41:$Vo},o($V0,[2,4]),{11:49,40:$Va,48:$Vd,50:$Ve,51:$Vf,52:$Vg},{16:50,40:$Vn,41:$Vo},{18:51,19:[1,52],53:53,54:54,58:$Vp},{11:56,40:$Va,48:$Vd,50:$Ve,51:$Vf,52:$Vg},{64:57,70:[1,58],71:[1,59]},o($Vq,[2,72]),o($Vq,[2,73]),o($Vq,[2,74]),o($Vq,[2,75]),o($Vq,[2,76]),o($V0,[2,24]),o($V0,[2,25]),o($V0,[2,26]),{13:$Vr,38:60,41:$Vs,42:$Vt,45:62,46:63,48:$Vu,49:$Vv},o($Vw,[2,37]),o($Vw,[2,38]),{16:68,40:$Vn,41:$Vo,42:$Vt},{13:$Vr,38:69,41:$Vs,42:$Vt,45:62,46:63,48:$Vu,49:$Vv},{13:[1,70],15:[1,71]},o($V0,[2,17],{63:35,12:72,17:[1,73],42:$Vt,65:$Vh,66:$Vi,67:$Vj,68:$Vk,69:$Vl}),{19:[1,74]},o($V0,[2,14]),{18:75,19:[2,59],53:53,54:54,58:$Vp},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:$Vh,66:$Vi,67:$Vj,68:$Vk,69:$Vl},o($Vx,[2,77]),o($Vx,[2,78]),{6:$Vy,10:$Vz,39:80,42:$VA,47:$VB},{40:[1,85],41:[1,86]},o($VC,[2,43],{46:87,13:$Vr,41:$Vs,48:$Vu,49:$Vv}),o($VD,[2,45]),o($VD,[2,50]),o($VD,[2,51]),o($VD,[2,52]),o($VD,[2,53]),o($V0,[2,41],{42:$Vt}),{6:$Vy,10:$Vz,39:88,42:$VA,47:$VB},{14:89,40:$VE,50:$VF,72:$VG},{16:93,40:$Vn,41:$Vo},{11:94,40:$Va,48:$Vd,50:$Ve,51:$Vf,52:$Vg},{18:95,19:[1,96],53:53,54:54,58:$Vp},o($V0,[2,12]),{19:[2,60]},o($VH,[2,61],{56:97,57:98,59:99,61:$VI,62:$VJ}),o([19,58,61,62],[2,66]),o($V0,[2,22],{15:[1,103],17:[1,102]}),o([40,48,50,51,52],[2,71]),o($V0,[2,36]),{13:$Vr,41:$Vs,45:104,46:63,48:$Vu,49:$Vv},o($V0,[2,47]),o($V0,[2,48]),o($V0,[2,49]),o($Vw,[2,39]),o($Vw,[2,40]),o($VD,[2,46]),o($V0,[2,42]),o($V0,[2,8]),o($V0,[2,79]),o($V0,[2,80]),o($V0,[2,81]),{13:[1,105],42:$Vt},{13:[1,107],15:[1,106]},{19:[1,108]},o($V0,[2,15]),o($VH,[2,62],{57:109,60:[1,110],62:$VJ}),o($VH,[2,63]),o($VK,[2,67]),o($VH,[2,70]),o($VK,[2,69]),{18:111,19:[1,112],53:53,54:54,58:$Vp},{16:113,40:$Vn,41:$Vo},o($VC,[2,44],{46:87,13:$Vr,41:$Vs,48:$Vu,49:$Vv}),{14:114,40:$VE,50:$VF,72:$VG},{16:115,40:$Vn,41:$Vo},{14:116,40:$VE,50:$VF,72:$VG},o($V0,[2,13]),o($VH,[2,64]),{59:117,61:$VI},{19:[1,118]},o($V0,[2,20]),o($V0,[2,23],{17:[1,119],42:$Vt}),o($V0,[2,11]),{13:[1,120],42:$Vt},o($V0,[2,10]),o($VK,[2,68]),o($V0,[2,18]),{18:121,19:[1,122],53:53,54:54,58:$Vp},{14:123,40:$VE,50:$VF,72:$VG},{19:[1,124]},o($V0,[2,21]),o($V0,[2,9]),o($V0,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:__name(function(str,hash){if(!hash.recoverable){var error=new Error(str);throw error.hash=hash,error}this.trace(str)},"parseError"),parse:__name(function(input){var self=this,stack=[0],tstack=[],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,args=lstack.slice.call(arguments,1),lexer2=Object.create(this.lexer),sharedState={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(sharedState.yy[k]=this.yy[k]);lexer2.setInput(input,sharedState.yy),sharedState.yy.lexer=lexer2,sharedState.yy.parser=this,void 0===lexer2.yylloc&&(lexer2.yylloc={});var yyloc=lexer2.yylloc;lstack.push(yyloc);var ranges=lexer2.options&&lexer2.options.ranges;function lex(){var token;return"number"!=typeof(token=tstack.pop()||lexer2.lex()||1)&&(token instanceof Array&&(token=(tstack=token).pop()),token=self.symbols_[token]||token),token}"function"==typeof sharedState.yy.parseError?this.parseError=sharedState.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,__name(function(n){stack.length=stack.length-2*n,vstack.length=vstack.length-n,lstack.length=lstack.length-n},"popStack"),__name(lex,"lex");for(var symbol,state,action,r,p,len,newState,expected,yyval={};;){if(state=stack[stack.length-1],this.defaultActions[state]?action=this.defaultActions[state]:(null==symbol&&(symbol=lex()),action=table[state]&&table[state][symbol]),void 0===action||!action.length||!action[0]){var errStr="";for(p in expected=[],table[state])this.terminals_[p]&&p>2&&expected.push("'"+this.terminals_[p]+"'");errStr=lexer2.showPosition?"Parse error on line "+(yylineno+1)+":\n"+lexer2.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'":"Parse error on line "+(yylineno+1)+": Unexpected "+(1==symbol?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'"),this.parseError(errStr,{text:lexer2.match,token:this.terminals_[symbol]||symbol,line:lexer2.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol),vstack.push(lexer2.yytext),lstack.push(lexer2.yylloc),stack.push(action[1]),symbol=null,yyleng=lexer2.yyleng,yytext=lexer2.yytext,yylineno=lexer2.yylineno,yyloc=lexer2.yylloc;break;case 2:if(len=this.productions_[action[1]][1],yyval.$=vstack[vstack.length-len],yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column},ranges&&(yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]),void 0!==(r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args))))return r;len&&(stack=stack.slice(0,-1*len*2),vstack=vstack.slice(0,-1*len),lstack=lstack.slice(0,-1*len)),stack.push(this.productions_[action[1]][0]),vstack.push(yyval.$),lstack.push(yyval._$),newState=table[stack[stack.length-2]][stack[stack.length-1]],stack.push(newState);break;case 3:return!0}}return!0},"parse")},lexer=function(){return{EOF:1,parseError:__name(function(str,hash){if(!this.yy.parser)throw new Error(str);this.yy.parser.parseError(str,hash)},"parseError"),setInput:__name(function(input,yy){return this.yy=yy||this.yy||{},this._input=input,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:__name(function(){var ch=this._input[0];return this.yytext+=ch,this.yyleng++,this.offset++,this.match+=ch,this.matched+=ch,ch.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ch},"input"),unput:__name(function(ch){var len=ch.length,lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-len),this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),lines.length-1&&(this.yylineno-=lines.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-len]),this.yyleng=this.yytext.length,this},"unput"),more:__name(function(){return this._more=!0,this},"more"),reject:__name(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:__name(function(n){this.unput(this.match.slice(n))},"less"),pastInput:__name(function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:__name(function(){var next=this.match;return next.length<20&&(next+=this._input.substr(0,20-next.length)),(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:__name(function(){var pre=this.pastInput(),c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},"showPosition"),test_match:__name(function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer&&(backup={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(backup.yylloc.range=this.yylloc.range.slice(0))),(lines=match[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=lines.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length},this.yytext+=match[0],this.match+=match[0],this.matches=match,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(match[0].length),this.matched+=match[0],token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),token)return token;if(this._backtrack){for(var k in backup)this[k]=backup[k];return!1}return!1},"test_match"),next:__name(function(){if(this.done)return this.EOF;var token,match,tempMatch,index;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var rules=this._currentRules(),i=0;i<rules.length;i++)if((tempMatch=this._input.match(this.rules[rules[i]]))&&(!match||tempMatch[0].length>match[0].length)){if(match=tempMatch,index=i,this.options.backtrack_lexer){if(!1!==(token=this.test_match(tempMatch,rules[i])))return token;if(this._backtrack){match=!1;continue}return!1}if(!this.options.flex)break}return match?!1!==(token=this.test_match(match,rules[index]))&&token:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:__name(function(){var r=this.next();return r||this.lex()},"lex"),begin:__name(function(condition){this.conditionStack.push(condition)},"begin"),popState:__name(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:__name(function(n){return(n=this.conditionStack.length-1-Math.abs(n||0))>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:__name(function(condition){this.begin(condition)},"pushState"),stateStackSize:__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:__name(function(yy,yy_,$avoiding_name_collisions,YY_START){switch($avoiding_name_collisions){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:case 23:case 28:case 35:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;case 18:case 19:case 38:return 49;case 20:case 37:return 42;case 21:return 15;case 22:case 36:return 13;case 24:return 61;case 25:case 26:return 58;case 27:return 62;case 29:return this.popState(),19;case 30:case 77:return yy_.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 39:return this.begin("style"),37;case 40:return 43;case 41:case 45:case 46:case 64:return 65;case 42:case 43:case 44:case 52:case 54:case 66:return 67;case 47:case 48:case 49:case 50:case 51:case 53:case 65:return 66;case 55:case 56:case 58:case 59:case 60:case 63:return 68;case 57:return 51;case 61:return 52;case 62:return 48;case 67:return 69;case 68:case 71:case 72:case 73:return 70;case 69:case 70:return 71;case 74:return 41;case 75:return 47;case 76:return 40;case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,76,77,78],inclusive:!0}}}}();function Parser(){this.yy={}}return parser2.lexer=lexer,__name(Parser,"Parser"),Parser.prototype=parser2,parser2.Parser=Parser,new Parser}();parser.parser=parser;var erDiagram_default=parser,ErDB=(__name(_a=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=setAccTitle,this.getAccTitle=getAccTitle,this.setAccDescription=setAccDescription,this.getAccDescription=getAccDescription,this.setDiagramTitle=setDiagramTitle,this.getDiagramTitle=getDiagramTitle,this.getConfig=__name(()=>getConfig2().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(name,alias=""){var _a2;return this.entities.has(name)?!(null==(_a2=this.entities.get(name))?void 0:_a2.alias)&&alias&&(this.entities.get(name).alias=alias,log.info(`Add alias '${alias}' to entity '${name}'`)):(this.entities.set(name,{id:`entity-${name}-${this.entities.size}`,label:name,attributes:[],alias:alias,shape:"erBox",look:getConfig2().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),log.info("Added new entity :",name)),this.entities.get(name)}getEntity(name){return this.entities.get(name)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(entityName,attribs){const entity=this.addEntity(entityName);let i;for(i=attribs.length-1;i>=0;i--)attribs[i].keys||(attribs[i].keys=[]),attribs[i].comment||(attribs[i].comment=""),entity.attributes.push(attribs[i]),log.debug("Added attribute ",attribs[i].name)}addRelationship(entA,rolA,entB,rSpec){const entityA=this.entities.get(entA),entityB=this.entities.get(entB);if(!entityA||!entityB)return;const rel={entityA:entityA.id,roleA:rolA,entityB:entityB.id,relSpec:rSpec};this.relationships.push(rel),log.debug("Added new relationship :",rel)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(dir){this.direction=dir}getCompiledStyles(classDefs){let compiledStyles=[];for(const customClass of classDefs){const cssClass=this.classes.get(customClass);(null==cssClass?void 0:cssClass.styles)&&(compiledStyles=[...compiledStyles,...cssClass.styles??[]].map(s=>s.trim())),(null==cssClass?void 0:cssClass.textStyles)&&(compiledStyles=[...compiledStyles,...cssClass.textStyles??[]].map(s=>s.trim()))}return compiledStyles}addCssStyles(ids,styles){for(const id of ids){const entity=this.entities.get(id);if(!styles||!entity)return;for(const style of styles)entity.cssStyles.push(style)}}addClass(ids,style){ids.forEach(id=>{let classNode=this.classes.get(id);void 0===classNode&&(classNode={id:id,styles:[],textStyles:[]},this.classes.set(id,classNode)),style&&style.forEach(function(s){if(/color/.exec(s)){const newStyle=s.replace("fill","bgFill");classNode.textStyles.push(newStyle)}classNode.styles.push(s)})})}setClass(ids,classNames){for(const id of ids){const entity=this.entities.get(id);if(entity)for(const className of classNames)entity.cssClasses+=" "+className}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],clear()}getData(){const nodes=[],edges=[],config=getConfig2();let colorIndex=0;for(const entityKey of this.entities.keys()){const entityNode=this.entities.get(entityKey);entityNode&&(entityNode.cssCompiledStyles=this.getCompiledStyles(entityNode.cssClasses.split(" ")),entityNode.colorIndex=colorIndex++,nodes.push(entityNode))}let count=0;for(const relationship of this.relationships){const edge={id:getEdgeId(relationship.entityA,relationship.entityB,{prefix:"id",counter:count++}),type:"normal",curve:"basis",start:relationship.entityA,end:relationship.entityB,label:relationship.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:relationship.relSpec.cardB.toLowerCase(),arrowTypeEnd:relationship.relSpec.cardA.toLowerCase(),pattern:"IDENTIFYING"==relationship.relSpec.relType?"solid":"dashed",look:config.look,labelType:"markdown"};edges.push(edge)}return{nodes:nodes,edges:edges,other:{},config:config,direction:"TB"}}},"ErDB"),_a),erRenderer_unified_exports={};__export(erRenderer_unified_exports,{draw:()=>draw});var draw=__name(async function(text,id,_version,diag){log.info("REF0:"),log.info("Drawing er diagram (unified)",id);const{securityLevel:securityLevel,er:conf,layout:layout}=getConfig2(),data4Layout=diag.db.getData(),svg=getDiagramElement(id,securityLevel);data4Layout.type=diag.type,data4Layout.layoutAlgorithm=getRegisteredLayoutAlgorithm(layout),data4Layout.config.flowchart.nodeSpacing=(null==conf?void 0:conf.nodeSpacing)||140,data4Layout.config.flowchart.rankSpacing=(null==conf?void 0:conf.rankSpacing)||80,data4Layout.direction=diag.db.getDirection();const{config:config}=data4Layout,{look:look}=config;data4Layout.markers="neo"===look?["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:["only_one","zero_or_one","one_or_more","zero_or_more"],data4Layout.diagramId=id,await render(data4Layout,svg),"elk"===data4Layout.layoutAlgorithm&&svg.select(".edges").lower();const backgroundNodes=svg.selectAll('[id*="-background"]');Array.from(backgroundNodes).length>0&&backgroundNodes.each(function(){const backgroundNode=select(this),nonBackgroundId=backgroundNode.attr("id").replace("-background",""),nonBackgroundNode=svg.select(`#${CSS.escape(nonBackgroundId)}`);if(!nonBackgroundNode.empty()){const transform=nonBackgroundNode.attr("transform");backgroundNode.attr("transform",transform)}});utils_default.insertTitle(svg,"erDiagramTitleText",(null==conf?void 0:conf.titleTopMargin)??25,diag.db.getDiagramTitle()),setupViewPortForSVG(svg,8,"erDiagram",(null==conf?void 0:conf.useMaxWidth)??!0)},"draw"),fade=__name((color,opacity)=>{const channel2=channel,r=channel2(color,"r"),g=channel2(color,"g"),b=channel2(color,"b");return rgba(r,g,b,opacity)},"fade"),COLOR_THEMES=new Set(["redux-color","redux-dark-color"]),genColor=__name(options=>{const{theme:theme,look:look,bkgColorArray:bkgColorArray,borderColorArray:borderColorArray}=options;if(!COLOR_THEMES.has(theme))return"";const hasBkgColors=(null==bkgColorArray?void 0:bkgColorArray.length)>0;let sections="";for(let i=0;i<options.THEME_COLOR_LIMIT;i++)sections+=`\n\n [data-look="${look}"][data-color-id="color-${i}"].node path {\n stroke: ${borderColorArray[i]};\n ${hasBkgColors?`fill: ${bkgColorArray[i]};`:""}\n }\n\n [data-look="${look}"][data-color-id="color-${i}"].node rect {\n stroke: ${borderColorArray[i]};\n ${hasBkgColors?`fill: ${bkgColorArray[i]};`:""}\n }\n `;return sections},"genColor"),styles_default=__name(options=>{const{look:look,theme:theme,erEdgeLabelBackground:erEdgeLabelBackground,strokeWidth:strokeWidth}=options;return`\n ${genColor(options)}\n .entityBox {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${options.tertiaryColor};\n opacity: 0.7;\n background-color: ${options.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .labelBkg {\n background-color: ${COLOR_THEMES.has(theme)&&erEdgeLabelBackground?erEdgeLabelBackground:fade(options.tertiaryColor,.5)};\n }\n\n .edgeLabel {\n background-color: ${COLOR_THEMES.has(theme)&&erEdgeLabelBackground?erEdgeLabelBackground:options.edgeLabelBackground};\n }\n .edgeLabel .label rect {\n fill: ${COLOR_THEMES.has(theme)&&erEdgeLabelBackground?erEdgeLabelBackground:options.edgeLabelBackground};\n }\n .edgeLabel .label text {\n fill: ${options.textColor};\n }\n\n .edgeLabel .label {\n fill: ${options.nodeBorder};\n font-size: 14px;\n }\n\n .label {\n font-family: ${options.fontFamily};\n color: ${options.nodeTextColor||options.textColor};\n }\n\n .edge-pattern-dashed {\n stroke-dasharray: 8,8;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon\n {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n stroke-width: ${"neo"===look?strokeWidth:"1px"};\n }\n\n .relationshipLine {\n stroke: ${options.lineColor};\n stroke-width: ${"neo"===look?strokeWidth:"1px"};\n fill: none;\n }\n\n .marker {\n fill: none !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n }\n [data-look=neo].labelBkg {\n background-color: ${fade(options.tertiaryColor,.5)};\n }\n`},"getStyles"),diagram={parser:erDiagram_default,get db(){return new ErDB},renderer:erRenderer_unified_exports,styles:styles_default};export{diagram};