@xiaobuyu/nodesign 0.0.5 → 0.0.7

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 (137) hide show
  1. package/README.md +1 -1
  2. package/README.zh-CN.md +1 -1
  3. package/package.json +1 -1
  4. package/server/api/assets/helpers.js +18 -0
  5. package/server/api/assets/notes.js +50 -0
  6. package/server/api/assets.js +11 -6
  7. package/server/api/instruction.js +3 -3
  8. package/server/engine/agent/events.js +11 -1
  9. package/server/engine/agent/hooks/failure.js +11 -1
  10. package/server/engine/agent/hooks/lifecycle.js +10 -39
  11. package/server/engine/agent/hooks/post-guidance.js +4 -38
  12. package/server/engine/agent/hooks/user-prompt-submit.js +11 -40
  13. package/server/engine/agent/hooks.js +4 -8
  14. package/server/engine/agent/memory-config.js +61 -0
  15. package/server/engine/agent/prompts/nodesign-prelude.md +14 -12
  16. package/server/engine/agent/prompts/tools/generate-image-cookbook.md +24 -7
  17. package/server/engine/agent/prompts/tools/site-reference.md +13 -3
  18. package/server/engine/agent/session-loop.js +29 -18
  19. package/server/engine/agents/explorer.md +1 -1
  20. package/server/engine/agents/index.js +1 -1
  21. package/server/engine/mcp/index.js +4 -11
  22. package/server/engine/mcp/tools/arrange-on-board.js +3 -1
  23. package/server/engine/mcp/tools/browse-computer.js +2 -1
  24. package/server/engine/mcp/tools/browse-find-batch.js +20 -3
  25. package/server/engine/mcp/tools/browse.js +24 -2
  26. package/server/engine/mcp/tools/crystallize-skill.js +1 -1
  27. package/server/engine/mcp/tools/generate-image.js +50 -70
  28. package/server/engine/mcp/tools/helpers/codex-imagegen.js +139 -0
  29. package/server/engine/mcp/tools/helpers/rembg.js +7 -2
  30. package/server/engine/mcp/tools/helpers/shot-pipeline.js +109 -0
  31. package/server/engine/mcp/tools/list-pages.js +11 -5
  32. package/server/engine/mcp/tools/organize-board.js +26 -1
  33. package/server/engine/mcp/tools/pin-to-board.js +26 -17
  34. package/server/engine/mcp/tools/read-board.js +19 -5
  35. package/server/engine/mcp/tools/relate-on-board.js +42 -4
  36. package/server/engine/mcp/tools/report-issue.js +14 -7
  37. package/server/engine/mcp/tools/screenshot.js +17 -7
  38. package/server/engine/mcp/tools/sketch-on-board.js +13 -5
  39. package/server/engine/mcp/tools/web-search.js +11 -15
  40. package/server/engine/mcp/tools/write-on-board.js +15 -6
  41. package/server/engine/plugins/nodesign/skills/deskskill-engine-mini/SKILL.md +3 -4
  42. package/server/engine/plugins/nodesign/skills/docx-craft/SKILL.md +10 -1
  43. package/server/engine/plugins/nodesign/skills/docx-craft/references/token-schema.md +16 -0
  44. package/server/engine/plugins/nodesign/skills/site-craft/SKILL.md +4 -4
  45. package/server/index.js +0 -2
  46. package/server/lib/artifact-target.js +31 -14
  47. package/server/lib/board-kind-sizes.js +2 -3
  48. package/server/lib/canvas-id.js +29 -4
  49. package/server/lib/export-collect.js +3 -1
  50. package/server/lib/issues-store.js +3 -1
  51. package/server/lib/kinds/docx.js +11 -4
  52. package/server/lib/kinds/index.js +6 -16
  53. package/server/lib/kinds/site.js +40 -7
  54. package/server/lib/rewrite-refs.js +110 -0
  55. package/server/lib/ssrf-guard.js +9 -0
  56. package/server/lib/task-scan.js +18 -0
  57. package/server/projects/board-store.js +42 -1
  58. package/server/projects/memory-migration.js +85 -0
  59. package/server/projects/move-entry.js +11 -1
  60. package/server/projects/ui-config.js +2 -1
  61. package/server/projects/workspace-templates.js +13 -10
  62. package/server/projects/workspace.js +15 -15
  63. package/server/services/rembg-launcher.js +5 -2
  64. package/web/dist/assets/{BrowserWindow-P_vIdh-G.js → BrowserWindow-BoOBaIyz.js} +1 -1
  65. package/web/dist/assets/DeckWindow-Bg3rgkvi.js +11 -0
  66. package/web/dist/assets/{DocxWindow-DSAU1-tD.js → DocxWindow-B_u6aX9o.js} +1 -1
  67. package/web/dist/assets/{MermaidBlock-DR1GikCv.js → MermaidBlock-BO-46Du5.js} +6 -6
  68. package/web/dist/assets/{SiteWindow-92uBuRRR.js → SiteWindow-ConPmzdM.js} +1 -1
  69. package/web/dist/assets/{abnfDiagram-VCTEODGH-uA8Esix4.js → abnfDiagram-VCTEODGH-FCO9yf-n.js} +1 -1
  70. package/web/dist/assets/{arc-D_khH_xN.js → arc-BLcEOSRX.js} +1 -1
  71. package/web/dist/assets/{architectureDiagram-5GKGNRK7-DydJHqOt.js → architectureDiagram-5GKGNRK7-kxiX4TeN.js} +1 -1
  72. package/web/dist/assets/{blockDiagram-NRAW4CY4-B7wBbKiW.js → blockDiagram-NRAW4CY4-CptFksix.js} +1 -1
  73. package/web/dist/assets/{c4Diagram-UCG6FXSJ-6mrH0x7Y.js → c4Diagram-UCG6FXSJ-Dxmxj34F.js} +1 -1
  74. package/web/dist/assets/channel-DFyiuGL0.js +1 -0
  75. package/web/dist/assets/{chunk-2Q5K7J3B-Cuikho5Q.js → chunk-2Q5K7J3B-D9inx5oo.js} +1 -1
  76. package/web/dist/assets/{chunk-5VM5RSS4-3-KZ5AUz.js → chunk-5VM5RSS4-DydfHlEc.js} +1 -1
  77. package/web/dist/assets/{chunk-F27PBJKO-Bkwq2gGU.js → chunk-F27PBJKO-BO7GxhSv.js} +1 -1
  78. package/web/dist/assets/{chunk-G27WJ6UU-BLyQzdGE.js → chunk-G27WJ6UU-BzP6YiQ_.js} +1 -1
  79. package/web/dist/assets/{chunk-JWPE2WC7-B7HxxQds.js → chunk-JWPE2WC7-CHcgcd0s.js} +1 -1
  80. package/web/dist/assets/{chunk-LCL6LL3I-CtXrnUwF.js → chunk-LCL6LL3I-D2Wg5JtX.js} +1 -1
  81. package/web/dist/assets/{chunk-POPQ4Y6H-dxddZlXt.js → chunk-POPQ4Y6H-B2fCRfpM.js} +1 -1
  82. package/web/dist/assets/{chunk-SVP7TREG-DpkmrgHn.js → chunk-SVP7TREG-JSLcsRlZ.js} +1 -1
  83. package/web/dist/assets/{chunk-XXDRQBXY-BwZ7RbpQ.js → chunk-XXDRQBXY-BCjvaeHm.js} +1 -1
  84. package/web/dist/assets/classDiagram-DTDB5LWJ-Aw1f8z-b.js +1 -0
  85. package/web/dist/assets/classDiagram-v2-JRS7N3AN-Aw1f8z-b.js +1 -0
  86. package/web/dist/assets/{cose-bilkent-JH36ORCC-DGFOsMUt.js → cose-bilkent-JH36ORCC-0uKv6oJ7.js} +1 -1
  87. package/web/dist/assets/{cynefin-OW5HDTMX-DUwn3ehS.js → cynefin-OW5HDTMX-Bvt-gEmA.js} +1 -1
  88. package/web/dist/assets/{cynefinDiagram-5FMLGOSQ-DlLAOZ9x.js → cynefinDiagram-5FMLGOSQ-C9Ht02qC.js} +1 -1
  89. package/web/dist/assets/{dagre-3AP2YEHR-CyourLfz.js → dagre-3AP2YEHR-BfxZny4s.js} +1 -1
  90. package/web/dist/assets/{diagram-S7CK7UJ4-BTMbx2np.js → diagram-S7CK7UJ4-CrE0ZETE.js} +1 -1
  91. package/web/dist/assets/{diagram-UQ7AKVKN-UK94_1-P.js → diagram-UQ7AKVKN-BO8VQ4Fx.js} +1 -1
  92. package/web/dist/assets/{diagram-VSXAHHWV-C7zS-v9v.js → diagram-VSXAHHWV-CHUZnR9F.js} +1 -1
  93. package/web/dist/assets/{diagram-VX7I27RA-DKJRa6CK.js → diagram-VX7I27RA-DYQAz1Vu.js} +1 -1
  94. package/web/dist/assets/{diagram-Z3DM3KII-kUbAfGAp.js → diagram-Z3DM3KII-BDjivgLr.js} +1 -1
  95. package/web/dist/assets/{ebnfDiagram-PWID7BFC-CVW16_vb.js → ebnfDiagram-PWID7BFC-Bpe_QVbH.js} +1 -1
  96. package/web/dist/assets/{erDiagram-SSCWMZ5O-BRQMFQ5y.js → erDiagram-SSCWMZ5O-BxhwuAu1.js} +1 -1
  97. package/web/dist/assets/{flowDiagram-A5DVABFB-S34LpLtK.js → flowDiagram-A5DVABFB-CCw2H08-.js} +1 -1
  98. package/web/dist/assets/{ganttDiagram-EL5Y4UJY-BFiqk1-G.js → ganttDiagram-EL5Y4UJY-DtTc7MyI.js} +1 -1
  99. package/web/dist/assets/{gitGraphDiagram-WWUBYQGX-LZsrdyyv.js → gitGraphDiagram-WWUBYQGX-BvORxMd2.js} +1 -1
  100. package/web/dist/assets/index-DGG5wIZs.js +2118 -0
  101. package/web/dist/assets/{infoDiagram-RXCK75RN-0DvN6KIp.js → infoDiagram-RXCK75RN-DMcrkypD.js} +1 -1
  102. package/web/dist/assets/{ishikawaDiagram-5VMMS53U-CaY3A-Bx.js → ishikawaDiagram-5VMMS53U-CZkTIbe-.js} +1 -1
  103. package/web/dist/assets/{journeyDiagram-EYS64GPL-BBeiaCrj.js → journeyDiagram-EYS64GPL-DR0XazdE.js} +1 -1
  104. package/web/dist/assets/{kanban-definition-3QL26DDD-ux42DRXQ.js → kanban-definition-3QL26DDD-DN8VbwVu.js} +1 -1
  105. package/web/dist/assets/{layout-CnXiF_NB.js → layout-9_paCbyt.js} +1 -1
  106. package/web/dist/assets/{linear-BMW0u6G6.js → linear-g6Ct012e.js} +1 -1
  107. package/web/dist/assets/{mindmap-definition-FBJOCRG2-hUxSpdKn.js → mindmap-definition-FBJOCRG2-BGt4omYC.js} +1 -1
  108. package/web/dist/assets/{pegDiagram-XKGWAZYB-aCaQPH0w.js → pegDiagram-XKGWAZYB-uSfS-PBE.js} +1 -1
  109. package/web/dist/assets/{pending-edit-apply-AcdOQ9Ij.js → pending-edit-apply-uP4uvrOD.js} +1 -1
  110. package/web/dist/assets/{pieDiagram-E7YTZNPT-CmOEZ8zg.js → pieDiagram-E7YTZNPT-DpeI935H.js} +1 -1
  111. package/web/dist/assets/{quadrantDiagram-AXDQQJYC-VW6fAhsV.js → quadrantDiagram-AXDQQJYC-B7IuNvWa.js} +1 -1
  112. package/web/dist/assets/{railroadDiagram-O6MQD6OU-CKJ7Ba5K.js → railroadDiagram-O6MQD6OU-ARzYpPQI.js} +1 -1
  113. package/web/dist/assets/{requirementDiagram-EFPCY7ZU-pNGkq9Vw.js → requirementDiagram-EFPCY7ZU-Cj4upkAo.js} +1 -1
  114. package/web/dist/assets/{rotate-cw-KAfChbGV.js → rotate-cw-CXJcyHWk.js} +1 -1
  115. package/web/dist/assets/{sankeyDiagram-P5KCCOFB-BIMmDTfZ.js → sankeyDiagram-P5KCCOFB-OaVwSnLP.js} +1 -1
  116. package/web/dist/assets/{sequenceDiagram-WJ2MYXX4-BBW7wzKY.js → sequenceDiagram-WJ2MYXX4-1yrUbq4t.js} +1 -1
  117. package/web/dist/assets/{sizeCapture-X5ZJPWSS-DdkXmLYR.js → sizeCapture-X5ZJPWSS-nYH5p9D6.js} +1 -1
  118. package/web/dist/assets/{square-dashed-mouse-pointer-CDUlhUP7.js → square-dashed-mouse-pointer-CTtTVKoH.js} +1 -1
  119. package/web/dist/assets/{stateDiagram-HBIQ2CUA-W313Uz16.js → stateDiagram-HBIQ2CUA-Dj5HvyNq.js} +1 -1
  120. package/web/dist/assets/stateDiagram-v2-4QOOHH4V-kJ1m_zJT.js +1 -0
  121. package/web/dist/assets/{swimlanes-XN3QIQJK-C29TL26K.js → swimlanes-XN3QIQJK-umeT0HpB.js} +1 -1
  122. package/web/dist/assets/swimlanesDiagram-VK2B7HYN-DPSkMbbl.js +8 -0
  123. package/web/dist/assets/{timeline-definition-24CTP7MA-CF0JMObX.js → timeline-definition-24CTP7MA-MqnQfHKB.js} +1 -1
  124. package/web/dist/assets/{vennDiagram-4TSXK5OY-DrDFsaH3.js → vennDiagram-4TSXK5OY-b2liyZra.js} +1 -1
  125. package/web/dist/assets/{wardleyDiagram-VM6X3IG4-CVrnRIS_.js → wardleyDiagram-VM6X3IG4-QMK-zNh1.js} +1 -1
  126. package/web/dist/assets/{xychartDiagram-S5SC5T6Z-BvkN1zsT.js → xychartDiagram-S5SC5T6Z-D5Mc6tfA.js} +1 -1
  127. package/web/dist/index.html +1 -1
  128. package/server/api/memory.js +0 -185
  129. package/server/engine/agent/prompts/tools/generate-image-cookbook.gemini-gateway.md +0 -583
  130. package/server/engine/mcp/tools/record-decision.js +0 -140
  131. package/web/dist/assets/DeckWindow-BpLv5082.js +0 -16
  132. package/web/dist/assets/channel-DGkccMO1.js +0 -1
  133. package/web/dist/assets/classDiagram-DTDB5LWJ-BGscw3OD.js +0 -1
  134. package/web/dist/assets/classDiagram-v2-JRS7N3AN-BGscw3OD.js +0 -1
  135. package/web/dist/assets/index-GAamh1p4.js +0 -2152
  136. package/web/dist/assets/stateDiagram-v2-4QOOHH4V-DDhJBZzf.js +0 -1
  137. package/web/dist/assets/swimlanesDiagram-VK2B7HYN-BfN-Xdmu.js +0 -8
@@ -1,4 +1,4 @@
1
- import{p as qe}from"./chunk-JWPE2WC7-B7HxxQds.js";import{_ as ct,D as Qe,Y as Je,l as Fe,b as Ke,a as je,n as _e,o as tr,g as er,s as rr,p as ir,A as ar,y as nr,B as or,c as Ee,b5 as Te,ak as pe,i as sr,j as hr,q as lr,al as fr,b6 as cr}from"./MermaidBlock-DR1GikCv.js";import{p as gr}from"./cynefin-OW5HDTMX-DUwn3ehS.js";import{c as be}from"./cytoscape.esm-BjAbmLdb.js";import{Z as ur}from"./index-GAamh1p4.js";var he={exports:{}},le={exports:{}},fe={exports:{}},dr=fe.exports,De;function vr(){return De||(De=1,(function(I,M){(function(x,N){I.exports=N()})(dr,function(){return(function(C){var x={};function N(v){if(x[v])return x[v].exports;var l=x[v]={i:v,l:!1,exports:{}};return C[v].call(l.exports,l,l.exports,N),l.l=!0,l.exports}return N.m=C,N.c=x,N.i=function(v){return v},N.d=function(v,l,n){N.o(v,l)||Object.defineProperty(v,l,{configurable:!1,enumerable:!0,get:n})},N.n=function(v){var l=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(l,"a",l),l},N.o=function(v,l){return Object.prototype.hasOwnProperty.call(v,l)},N.p="",N(N.s=28)})([(function(C,x,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,C.exports=v}),(function(C,x,N){var v=N(2),l=N(8),n=N(9);function r(f,e,g){v.call(this,g),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=g,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var i in v)r[i]=v[i];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var g=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(g.getOwner()==e)return g;if(g.getOwner()==t)break;g=g.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.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=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=r}),(function(C,x,N){function v(l){this.vGraphObject=l}C.exports=v}),(function(C,x,N){var v=N(2),l=N(10),n=N(13),r=N(0),i=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new n(s.x,s.y,o.width,o.height):this.rect=new n}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),h=0;h<c.length;h++)s=c[h],o=s.withChildren(),o.forEach(function(T){t.add(T)});return t},e.prototype.getNoOfChildren=function(){var t=0,s;if(this.child==null)t=1;else for(var o=this.child.getNodes(),c=0;c<o.length;c++)s=o[c],t+=s.getNoOfChildren();return t==0&&(t=1),t},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},e.prototype.scatter=function(){var t,s,o=-r.INITIAL_WORLD_BOUNDARY,c=r.INITIAL_WORLD_BOUNDARY;t=r.WORLD_CENTER_X+i.nextDouble()*(c-o)+o;var h=-r.INITIAL_WORLD_BOUNDARY,T=r.INITIAL_WORLD_BOUNDARY;s=r.WORLD_CENTER_Y+i.nextDouble()*(T-h)+h,this.rect.x=t,this.rect.y=s},e.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var s=t.getRight()-t.getLeft(),o=t.getBottom()-t.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(s+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>s?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),h=t.inverseTransformPoint(c);this.setLocation(h.x,h.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},C.exports=e}),(function(C,x,N){var v=N(0);function l(){}for(var n in v)l[n]=v[n];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,C.exports=l}),(function(C,x,N){function v(l,n){l==null&&n==null?(this.x=0,this.y=0):(this.x=l,this.y=n)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(l){this.x=l},v.prototype.setY=function(l){this.y=l},v.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},C.exports=v}),(function(C,x,N){var v=N(2),l=N(10),n=N(0),r=N(7),i=N(3),f=N(1),e=N(13),g=N(12),t=N(11);function s(c,h,T){v.call(this,T),this.estimatedSize=l.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,h!=null&&h instanceof r?this.graphManager=h:h!=null&&h instanceof Layout&&(this.graphManager=h.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,h,T){if(h==null&&T==null){var u=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var d=c;if(!(this.getNodes().indexOf(h)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(h.owner==T.owner&&h.owner==this))throw"Both owners must be this graph!";return h.owner!=T.owner?null:(d.source=h,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),h.edges.push(d),T!=h&&T.edges.push(d),d)}},s.prototype.remove=function(c){var h=c;if(c instanceof i){if(h==null)throw"Node is null!";if(!(h.owner!=null&&h.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=h.edges.slice(),u,d=T.length,L=0;L<d;L++)u=T[L],u.isInterGraph?this.graphManager.remove(u):u.source.owner.remove(u);var b=this.nodes.indexOf(h);if(b==-1)throw"Node not in owner node list!";this.nodes.splice(b,1)}else if(c instanceof f){var u=c;if(u==null)throw"Edge is null!";if(!(u.source!=null&&u.target!=null))throw"Source and/or target is null!";if(!(u.source.owner!=null&&u.target.owner!=null&&u.source.owner==this&&u.target.owner==this))throw"Source and/or target owner is invalid!";var w=u.source.edges.indexOf(u),G=u.target.edges.indexOf(u);if(!(w>-1&&G>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(w,1),u.target!=u.source&&u.target.edges.splice(G,1);var b=u.source.owner.getEdges().indexOf(u);if(b==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(b,1)}},s.prototype.updateLeftTop=function(){for(var c=l.MAX_VALUE,h=l.MAX_VALUE,T,u,d,L=this.getNodes(),b=L.length,w=0;w<b;w++){var G=L[w];T=G.getTop(),u=G.getLeft(),c>T&&(c=T),h>u&&(h=u)}return c==l.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?d=L[0].getParent().paddingLeft:d=this.margin,this.left=h-d,this.top=c-d,new g(this.left,this.top))},s.prototype.updateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,u=l.MAX_VALUE,d=-l.MAX_VALUE,L,b,w,G,V,Y=this.nodes,B=Y.length,A=0;A<B;A++){var j=Y[A];c&&j.child!=null&&j.updateBounds(),L=j.getLeft(),b=j.getRight(),w=j.getTop(),G=j.getBottom(),h>L&&(h=L),T<b&&(T=b),u>w&&(u=w),d<G&&(d=G)}var a=new e(h,u,T-h,d-u);h==l.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),Y[0].getParent().paddingLeft!=null?V=Y[0].getParent().paddingLeft:V=this.margin,this.left=a.x-V,this.right=a.x+a.width+V,this.top=a.y-V,this.bottom=a.y+a.height+V},s.calculateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,u=l.MAX_VALUE,d=-l.MAX_VALUE,L,b,w,G,V=c.length,Y=0;Y<V;Y++){var B=c[Y];L=B.getLeft(),b=B.getRight(),w=B.getTop(),G=B.getBottom(),h>L&&(h=L),T<b&&(T=b),u>w&&(u=w),d<G&&(d=G)}var A=new e(h,u,T-h,d-u);return A},s.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},s.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},s.prototype.calcEstimatedSize=function(){for(var c=0,h=this.nodes,T=h.length,u=0;u<T;u++){var d=h[u];c+=d.calcEstimatedSize()}return c==0?this.estimatedSize=n.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=c/Math.sqrt(this.nodes.length),this.estimatedSize},s.prototype.updateConnected=function(){var c=this;if(this.nodes.length==0){this.isConnected=!0;return}var h=new t,T=new Set,u=this.nodes[0],d,L,b=u.withChildren();for(b.forEach(function(A){h.push(A),T.add(A)});h.length!==0;){u=h.shift(),d=u.getEdges();for(var w=d.length,G=0;G<w;G++){var V=d[G];if(L=V.getOtherEndInGraph(u,this),L!=null&&!T.has(L)){var Y=L.withChildren();Y.forEach(function(A){h.push(A),T.add(A)})}}}if(this.isConnected=!1,T.size>=this.nodes.length){var B=0;T.forEach(function(A){A.owner==c&&B++}),B==this.nodes.length&&(this.isConnected=!0)}},C.exports=s}),(function(C,x,N){var v,l=N(1);function n(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var r=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(r,i);return this.setRootGraph(f),this.rootGraph},n.prototype.add=function(r,i,f,e,g){if(f==null&&e==null&&g==null){if(r==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return r.parent=i,i.child=r,r}else{g=f,e=i,f=r;var t=e.getOwner(),s=g.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,g);if(f.isInterGraph=!0,f.source=e,f.target=g,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},n.prototype.remove=function(r){if(r instanceof v){var i=r;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var e,g=f.length,t=0;t<g;t++)e=f[t],i.remove(e);var s=[];s=s.concat(i.getNodes());var o;g=s.length;for(var t=0;t<g;t++)o=s[t],i.remove(o);i==this.rootGraph&&this.setRootGraph(null);var c=this.graphs.indexOf(i);this.graphs.splice(c,1),i.parent=null}else if(r instanceof l){if(e=r,e==null)throw"Edge is null!";if(!e.isInterGraph)throw"Not an inter-graph edge!";if(!(e.source!=null&&e.target!=null))throw"Source and/or target is null!";if(!(e.source.edges.indexOf(e)!=-1&&e.target.edges.indexOf(e)!=-1))throw"Source and/or target doesn't know this edge!";var c=e.source.edges.indexOf(e);if(e.source.edges.splice(c,1),c=e.target.edges.indexOf(e),e.target.edges.splice(c,1),!(e.source.owner!=null&&e.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(e.source.owner.getGraphManager().edges.indexOf(e)==-1)throw"Not in owner graph manager's edge list!";var c=e.source.owner.getGraphManager().edges.indexOf(e);e.source.owner.getGraphManager().edges.splice(c,1)}},n.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},n.prototype.getGraphs=function(){return this.graphs},n.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],i=this.getGraphs(),f=i.length,e=0;e<f;e++)r=r.concat(i[e].getNodes());this.allNodes=r}return this.allNodes},n.prototype.resetAllNodes=function(){this.allNodes=null},n.prototype.resetAllEdges=function(){this.allEdges=null},n.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},n.prototype.getAllEdges=function(){if(this.allEdges==null){var r=[],i=this.getGraphs();i.length;for(var f=0;f<i.length;f++)r=r.concat(i[f].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},n.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},n.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},n.prototype.getRoot=function(){return this.rootGraph},n.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},n.prototype.getLayout=function(){return this.layout},n.prototype.isOneAncestorOfOther=function(r,i){if(!(r!=null&&i!=null))throw"assert failed";if(r==i)return!0;var f=r.getOwner(),e;do{if(e=f.getParent(),e==null)break;if(e==i)return!0;if(f=e.getOwner(),f==null)break}while(!0);f=i.getOwner();do{if(e=f.getParent(),e==null)break;if(e==r)return!0;if(f=e.getOwner(),f==null)break}while(!0);return!1},n.prototype.calcLowestCommonAncestors=function(){for(var r,i,f,e,g,t=this.getAllEdges(),s=t.length,o=0;o<s;o++){if(r=t[o],i=r.source,f=r.target,r.lca=null,r.sourceInLca=i,r.targetInLca=f,i==f){r.lca=i.getOwner();continue}for(e=i.getOwner();r.lca==null;){for(r.targetInLca=f,g=f.getOwner();r.lca==null;){if(g==e){r.lca=g;break}if(g==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=g.getParent(),g=r.targetInLca.getOwner()}if(e==this.rootGraph)break;r.lca==null&&(r.sourceInLca=e.getParent(),e=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},n.prototype.calcLowestCommonAncestor=function(r,i){if(r==i)return r.getOwner();var f=r.getOwner();do{if(f==null)break;var e=i.getOwner();do{if(e==null)break;if(e==f)return e;e=e.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},n.prototype.calcInclusionTreeDepths=function(r,i){r==null&&i==null&&(r=this.rootGraph,i=1);for(var f,e=r.getNodes(),g=e.length,t=0;t<g;t++)f=e[t],f.inclusionTreeDepth=i,f.child!=null&&this.calcInclusionTreeDepths(f.child,i+1)},n.prototype.includesInvalidEdge=function(){for(var r,i=[],f=this.edges.length,e=0;e<f;e++)r=this.edges[e],this.isOneAncestorOfOther(r.source,r.target)&&i.push(r);for(var e=0;e<i.length;e++)this.remove(i[e]);return!1},C.exports=n}),(function(C,x,N){var v=N(12);function l(){}l.calcSeparationAmount=function(n,r,i,f){if(!n.intersects(r))throw"assert failed";var e=new Array(2);this.decideDirectionsForOverlappingNodes(n,r,e),i[0]=Math.min(n.getRight(),r.getRight())-Math.max(n.x,r.x),i[1]=Math.min(n.getBottom(),r.getBottom())-Math.max(n.y,r.y),n.getX()<=r.getX()&&n.getRight()>=r.getRight()?i[0]+=Math.min(r.getX()-n.getX(),n.getRight()-r.getRight()):r.getX()<=n.getX()&&r.getRight()>=n.getRight()&&(i[0]+=Math.min(n.getX()-r.getX(),r.getRight()-n.getRight())),n.getY()<=r.getY()&&n.getBottom()>=r.getBottom()?i[1]+=Math.min(r.getY()-n.getY(),n.getBottom()-r.getBottom()):r.getY()<=n.getY()&&r.getBottom()>=n.getBottom()&&(i[1]+=Math.min(n.getY()-r.getY(),r.getBottom()-n.getBottom()));var g=Math.abs((r.getCenterY()-n.getCenterY())/(r.getCenterX()-n.getCenterX()));r.getCenterY()===n.getCenterY()&&r.getCenterX()===n.getCenterX()&&(g=1);var t=g*i[0],s=i[1]/g;i[0]<s?s=i[0]:t=i[1],i[0]=-1*e[0]*(s/2+f),i[1]=-1*e[1]*(t/2+f)},l.decideDirectionsForOverlappingNodes=function(n,r,i){n.getCenterX()<r.getCenterX()?i[0]=-1:i[0]=1,n.getCenterY()<r.getCenterY()?i[1]=-1:i[1]=1},l.getIntersection2=function(n,r,i){var f=n.getCenterX(),e=n.getCenterY(),g=r.getCenterX(),t=r.getCenterY();if(n.intersects(r))return i[0]=f,i[1]=e,i[2]=g,i[3]=t,!0;var s=n.getX(),o=n.getY(),c=n.getRight(),h=n.getX(),T=n.getBottom(),u=n.getRight(),d=n.getWidthHalf(),L=n.getHeightHalf(),b=r.getX(),w=r.getY(),G=r.getRight(),V=r.getX(),Y=r.getBottom(),B=r.getRight(),A=r.getWidthHalf(),j=r.getHeightHalf(),a=!1,E=!1;if(f===g){if(e>t)return i[0]=f,i[1]=o,i[2]=g,i[3]=Y,!1;if(e<t)return i[0]=f,i[1]=T,i[2]=g,i[3]=w,!1}else if(e===t){if(f>g)return i[0]=s,i[1]=e,i[2]=G,i[3]=t,!1;if(f<g)return i[0]=c,i[1]=e,i[2]=b,i[3]=t,!1}else{var p=n.height/n.width,m=r.height/r.width,y=(t-e)/(g-f),S=void 0,D=void 0,F=void 0,W=void 0,R=void 0,Q=void 0;if(-p===y?f>g?(i[0]=h,i[1]=T,a=!0):(i[0]=c,i[1]=o,a=!0):p===y&&(f>g?(i[0]=s,i[1]=o,a=!0):(i[0]=u,i[1]=T,a=!0)),-m===y?g>f?(i[2]=V,i[3]=Y,E=!0):(i[2]=G,i[3]=w,E=!0):m===y&&(g>f?(i[2]=b,i[3]=w,E=!0):(i[2]=B,i[3]=Y,E=!0)),a&&E)return!1;if(f>g?e>t?(S=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(S=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):e>t?(S=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(S=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!a)switch(S){case 1:W=o,F=f+-L/y,i[0]=F,i[1]=W;break;case 2:F=u,W=e+d*y,i[0]=F,i[1]=W;break;case 3:W=T,F=f+L/y,i[0]=F,i[1]=W;break;case 4:F=h,W=e+-d*y,i[0]=F,i[1]=W;break}if(!E)switch(D){case 1:Q=w,R=g+-j/y,i[2]=R,i[3]=Q;break;case 2:R=B,Q=t+A*y,i[2]=R,i[3]=Q;break;case 3:Q=Y,R=g+j/y,i[2]=R,i[3]=Q;break;case 4:R=V,Q=t+-A*y,i[2]=R,i[3]=Q;break}}return!1},l.getCardinalDirection=function(n,r,i){return n>r?i:1+i%4},l.getIntersection=function(n,r,i,f){if(f==null)return this.getIntersection2(n,r,i);var e=n.x,g=n.y,t=r.x,s=r.y,o=i.x,c=i.y,h=f.x,T=f.y,u=void 0,d=void 0,L=void 0,b=void 0,w=void 0,G=void 0,V=void 0,Y=void 0,B=void 0;return L=s-g,w=e-t,V=t*g-e*s,b=T-c,G=o-h,Y=h*c-o*T,B=L*G-b*w,B===0?null:(u=(w*Y-G*V)/B,d=(b*V-L*Y)/B,new v(u,d))},l.angleOfVector=function(n,r,i,f){var e=void 0;return n!==i?(e=Math.atan((f-r)/(i-n)),i<n?e+=Math.PI:f<r&&(e+=this.TWO_PI)):f<r?e=this.ONE_AND_HALF_PI:e=this.HALF_PI,e},l.doIntersect=function(n,r,i,f){var e=n.x,g=n.y,t=r.x,s=r.y,o=i.x,c=i.y,h=f.x,T=f.y,u=(t-e)*(T-c)-(h-o)*(s-g);if(u===0)return!1;var d=((T-c)*(h-e)+(o-h)*(T-g))/u,L=((g-s)*(h-e)+(t-e)*(T-g))/u;return 0<d&&d<1&&0<L&&L<1},l.findCircleLineIntersections=function(n,r,i,f,e,g,t){var s=(i-n)*(i-n)+(f-r)*(f-r),o=2*((n-e)*(i-n)+(r-g)*(f-r)),c=(n-e)*(n-e)+(r-g)*(r-g)-t*t,h=o*o-4*s*c;if(h>=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),u=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:u>=0&&u<=1?[u]:d}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,C.exports=l}),(function(C,x,N){function v(){}v.sign=function(l){return l>0?1:l<0?-1:0},v.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},v.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},C.exports=v}),(function(C,x,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,C.exports=v}),(function(C,x,N){var v=(function(){function e(g,t){for(var s=0;s<t.length;s++){var o=t[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(g,o.key,o)}}return function(g,t,s){return t&&e(g.prototype,t),s&&e(g,s),g}})();function l(e,g){if(!(e instanceof g))throw new TypeError("Cannot call a class as a function")}var n=function(g){return{value:g,next:null,prev:null}},r=function(g,t,s,o){return g!==null?g.next=t:o.head=t,s!==null?s.prev=t:o.tail=t,t.prev=g,t.next=s,o.length++,t},i=function(g,t){var s=g.prev,o=g.next;return s!==null?s.next=o:t.head=o,o!==null?o.prev=s:t.tail=s,g.prev=g.next=null,t.length--,g},f=(function(){function e(g){var t=this;l(this,e),this.length=0,this.head=null,this.tail=null,g!=null&&g.forEach(function(s){return t.push(s)})}return v(e,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,s){return r(s.prev,n(t),s,this)}},{key:"insertAfter",value:function(t,s){return r(s,n(t),s.next,this)}},{key:"insertNodeBefore",value:function(t,s){return r(s.prev,t,s,this)}},{key:"insertNodeAfter",value:function(t,s){return r(s,t,s.next,this)}},{key:"push",value:function(t){return r(this.tail,n(t),null,this)}},{key:"unshift",value:function(t){return r(null,n(t),this.head,this)}},{key:"remove",value:function(t){return i(t,this)}},{key:"pop",value:function(){return i(this.tail,this).value}},{key:"popNode",value:function(){return i(this.tail,this)}},{key:"shift",value:function(){return i(this.head,this).value}},{key:"shiftNode",value:function(){return i(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var s=1,o=this.head;s<t;)o=o.next,s++;return o.value}}},{key:"set_object_at",value:function(t,s){if(t<=this.length()){for(var o=1,c=this.head;o<t;)c=c.next,o++;c.value=s}}}]),e})();C.exports=f}),(function(C,x,N){function v(l,n,r){this.x=null,this.y=null,l==null&&n==null&&r==null?(this.x=0,this.y=0):typeof l=="number"&&typeof n=="number"&&r==null?(this.x=l,this.y=n):l.constructor.name=="Point"&&n==null&&r==null&&(r=l,this.x=r.x,this.y=r.y)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(l,n,r){l.constructor.name=="Point"&&n==null&&r==null?(r=l,this.setLocation(r.x,r.y)):typeof l=="number"&&typeof n=="number"&&r==null&&(parseInt(l)==l&&parseInt(n)==n?this.move(l,n):(this.x=Math.floor(l+.5),this.y=Math.floor(n+.5)))},v.prototype.move=function(l,n){this.x=l,this.y=n},v.prototype.translate=function(l,n){this.x+=l,this.y+=n},v.prototype.equals=function(l){if(l.constructor.name=="Point"){var n=l;return this.x==n.x&&this.y==n.y}return this==l},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},C.exports=v}),(function(C,x,N){function v(l,n,r,i){this.x=0,this.y=0,this.width=0,this.height=0,l!=null&&n!=null&&r!=null&&i!=null&&(this.x=l,this.y=n,this.width=r,this.height=i)}v.prototype.getX=function(){return this.x},v.prototype.setX=function(l){this.x=l},v.prototype.getY=function(){return this.y},v.prototype.setY=function(l){this.y=l},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(l){this.width=l},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(l){this.height=l},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(l){return!(this.getRight()<l.x||this.getBottom()<l.y||l.getRight()<this.x||l.getBottom()<this.y)},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},C.exports=v}),(function(C,x,N){var v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function l(){}l.lastID=0,l.createID=function(n){return l.isPrimitive(n)?n:(n.uniqueID!=null||(n.uniqueID=l.getString(),l.lastID++),n.uniqueID)},l.getString=function(n){return n==null&&(n=l.lastID),"Object#"+n},l.isPrimitive=function(n){var r=typeof n>"u"?"undefined":v(n);return n==null||r!="object"&&r!="function"},C.exports=l}),(function(C,x,N){function v(o){if(Array.isArray(o)){for(var c=0,h=Array(o.length);c<o.length;c++)h[c]=o[c];return h}else return Array.from(o)}var l=N(0),n=N(7),r=N(3),i=N(1),f=N(6),e=N(5),g=N(17),t=N(29);function s(o){t.call(this),this.layoutQuality=l.QUALITY,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=l.DEFAULT_INCREMENTAL,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new n(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,o!=null&&(this.isRemoteUse=o)}s.RANDOM_SEED=1,s.prototype=Object.create(t.prototype),s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},s.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},s.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},s.prototype.newGraphManager=function(){var o=new n(this);return this.graphManager=o,o},s.prototype.newGraph=function(o){return new f(null,this.graphManager,o)},s.prototype.newNode=function(o){return new r(this.graphManager,o)},s.prototype.newEdge=function(o){return new i(null,null,o)},s.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},s.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var o;return this.checkLayoutSuccess()?o=!1:o=this.layout(),l.ANIMATE==="during"?!1:(o&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,o)},s.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},s.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var o=this.graphManager.getAllEdges(),c=0;c<o.length;c++)o[c];for(var h=this.graphManager.getRoot().getNodes(),c=0;c<h.length;c++)h[c];this.update(this.graphManager.getRoot())}},s.prototype.update=function(o){if(o==null)this.update2();else if(o instanceof r){var c=o;if(c.getChild()!=null)for(var h=c.getChild().getNodes(),T=0;T<h.length;T++)update(h[T]);if(c.vGraphObject!=null){var u=c.vGraphObject;u.update(c)}}else if(o instanceof i){var d=o;if(d.vGraphObject!=null){var L=d.vGraphObject;L.update(d)}}else if(o instanceof f){var b=o;if(b.vGraphObject!=null){var w=b.vGraphObject;w.update(b)}}},s.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=l.QUALITY,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=l.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},s.prototype.transform=function(o){if(o==null)this.transform(new e(0,0));else{var c=new g,h=this.graphManager.getRoot().updateLeftTop();if(h!=null){c.setWorldOrgX(o.x),c.setWorldOrgY(o.y),c.setDeviceOrgX(h.x),c.setDeviceOrgY(h.y);for(var T=this.getAllNodes(),u,d=0;d<T.length;d++)u=T[d],u.transform(c)}}},s.prototype.positionNodesRandomly=function(o){if(o==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var c,h,T=o.getNodes(),u=0;u<T.length;u++)c=T[u],h=c.getChild(),h==null||h.getNodes().length==0?c.scatter():(this.positionNodesRandomly(h),c.updateBounds())},s.prototype.getFlatForest=function(){for(var o=[],c=!0,h=this.graphManager.getRoot().getNodes(),T=!0,u=0;u<h.length;u++)h[u].getChild()!=null&&(T=!1);if(!T)return o;var d=new Set,L=[],b=new Map,w=[];for(w=w.concat(h);w.length>0&&c;){for(L.push(w[0]);L.length>0&&c;){var G=L[0];L.splice(0,1),d.add(G);for(var V=G.getEdges(),u=0;u<V.length;u++){var Y=V[u].getOtherEnd(G);if(b.get(G)!=Y)if(!d.has(Y))L.push(Y),b.set(Y,G);else{c=!1;break}}}if(!c)o=[];else{var B=[].concat(v(d));o.push(B);for(var u=0;u<B.length;u++){var A=B[u],j=w.indexOf(A);j>-1&&w.splice(j,1)}d=new Set,b=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],h=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),u=0;u<o.bendpoints.length;u++){var d=this.newNode(null);d.setRect(new Point(0,0),new Dimension(1,1)),T.add(d);var L=this.newEdge(null);this.graphManager.add(L,h,d),c.add(d),h=d}var L=this.newEdge(null);return this.graphManager.add(L,h,o.target),this.edgeToDummyNodes.set(o,c),o.isInterGraph()?this.graphManager.remove(o):T.remove(o),c},s.prototype.createBendpointsFromDummyNodes=function(){var o=[];o=o.concat(this.graphManager.getAllEdges()),o=[].concat(v(this.edgeToDummyNodes.keys())).concat(o);for(var c=0;c<o.length;c++){var h=o[c];if(h.bendpoints.length>0){for(var T=this.edgeToDummyNodes.get(h),u=0;u<T.length;u++){var d=T[u],L=new e(d.getCenterX(),d.getCenterY()),b=h.bendpoints.get(u);b.x=L.x,b.y=L.y,d.getOwner().remove(d)}this.graphManager.add(h,h.source,h.target)}}},s.transform=function(o,c,h,T){if(h!=null&&T!=null){var u=c;if(o<=50){var d=c/h;u-=(c-d)/50*(50-o)}else{var L=c*T;u+=(L-c)/50*(o-50)}return u}else{var b,w;return o<=50?(b=9*c/500,w=c/10):(b=9*c/50,w=-8*c),b*o+w}},s.findCenterOfTree=function(o){var c=[];c=c.concat(o);var h=[],T=new Map,u=!1,d=null;(c.length==1||c.length==2)&&(u=!0,d=c[0]);for(var L=0;L<c.length;L++){var b=c[L],w=b.getNeighborsList().size;T.set(b,b.getNeighborsList().size),w==1&&h.push(b)}var G=[];for(G=G.concat(h);!u;){var V=[];V=V.concat(G),G=[];for(var L=0;L<c.length;L++){var b=c[L],Y=c.indexOf(b);Y>=0&&c.splice(Y,1);var B=b.getNeighborsList();B.forEach(function(a){if(h.indexOf(a)<0){var E=T.get(a),p=E-1;p==1&&G.push(a),T.set(a,p)}})}h=h.concat(G),(c.length==1||c.length==2)&&(u=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},C.exports=s}),(function(C,x,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},C.exports=v}),(function(C,x,N){var v=N(5);function l(n,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(n){this.lworldExtX=n},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(n){this.lworldExtY=n},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},l.prototype.transformX=function(n){var r=0,i=this.lworldExtX;return i!=0&&(r=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/i),r},l.prototype.transformY=function(n){var r=0,i=this.lworldExtY;return i!=0&&(r=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/i),r},l.prototype.inverseTransformX=function(n){var r=0,i=this.ldeviceExtX;return i!=0&&(r=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/i),r},l.prototype.inverseTransformY=function(n){var r=0,i=this.ldeviceExtY;return i!=0&&(r=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/i),r},l.prototype.inverseTransformPoint=function(n){var r=new v(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return r},C.exports=l}),(function(C,x,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);s<t.length;s++)o[s]=t[s];return o}else return Array.from(t)}var l=N(15),n=N(4),r=N(0),i=N(8),f=N(9);function e(){l.call(this),this.useSmartIdealEdgeLengthCalculation=n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=n.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=n.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=n.MAX_ITERATIONS}e.prototype=Object.create(l.prototype);for(var g in l)e[g]=l[g];e.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},e.prototype.calcIdealEdgeLengths=function(){for(var t,s,o,c,h,T,u,d=this.getGraphManager().getAllEdges(),L=0;L<d.length;L++)t=d[L],s=t.idealLength,t.isInterGraph&&(c=t.getSource(),h=t.getTarget(),T=t.getSourceInLca().getEstimatedSize(),u=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=T+u-2*r.SIMPLE_NODE_SIZE),o=t.getLca().getInclusionTreeDepth(),t.idealLength+=s*n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(c.getInclusionTreeDepth()+h.getInclusionTreeDepth()-2*o))},e.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>n.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o<t.length;o++)s=t[o],this.calcSpringForce(s,s.idealLength)},e.prototype.calcRepulsionForces=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,h,T,u=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;o<u.length;o++)h=u[o],this.calculateRepulsionForceOfANode(h,d,t,s),d.add(h);else for(o=0;o<u.length;o++)for(h=u[o],c=o+1;c<u.length;c++)T=u[c],h.getOwner()==T.getOwner()&&this.calcRepulsionForce(h,T)},e.prototype.calcGravitationalForces=function(){for(var t,s=this.getAllNodesToApplyGravitation(),o=0;o<s.length;o++)t=s[o],this.calcGravitationalForce(t)},e.prototype.moveNodes=function(){for(var t=this.getAllNodes(),s,o=0;o<t.length;o++)s=t[o],s.move()},e.prototype.calcSpringForce=function(t,s){var o=t.getSource(),c=t.getTarget(),h,T,u,d;if(this.uniformLeafNodeSizes&&o.getChild()==null&&c.getChild()==null)t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;h=t.getLength(),h!=0&&(T=t.edgeElasticity*(h-s),u=T*(t.lengthX/h),d=T*(t.lengthY/h),o.springForceX+=u,o.springForceY+=d,c.springForceX-=u,c.springForceY-=d)},e.prototype.calcRepulsionForce=function(t,s){var o=t.getRect(),c=s.getRect(),h=new Array(2),T=new Array(4),u,d,L,b,w,G,V;if(o.intersects(c)){i.calcSeparationAmount(o,c,h,n.DEFAULT_EDGE_LENGTH/2),G=2*h[0],V=2*h[1];var Y=t.noOfChildren*s.noOfChildren/(t.noOfChildren+s.noOfChildren);t.repulsionForceX-=Y*G,t.repulsionForceY-=Y*V,s.repulsionForceX+=Y*G,s.repulsionForceY+=Y*V}else this.uniformLeafNodeSizes&&t.getChild()==null&&s.getChild()==null?(u=c.getCenterX()-o.getCenterX(),d=c.getCenterY()-o.getCenterY()):(i.getIntersection(o,c,T),u=T[2]-T[0],d=T[3]-T[1]),Math.abs(u)<n.MIN_REPULSION_DIST&&(u=f.sign(u)*n.MIN_REPULSION_DIST),Math.abs(d)<n.MIN_REPULSION_DIST&&(d=f.sign(d)*n.MIN_REPULSION_DIST),L=u*u+d*d,b=Math.sqrt(L),w=(t.nodeRepulsion/2+s.nodeRepulsion/2)*t.noOfChildren*s.noOfChildren/L,G=w*u/b,V=w*d/b,t.repulsionForceX-=G,t.repulsionForceY-=V,s.repulsionForceX+=G,s.repulsionForceY+=V},e.prototype.calcGravitationalForce=function(t){var s,o,c,h,T,u,d,L;s=t.getOwner(),o=(s.getRight()+s.getLeft())/2,c=(s.getTop()+s.getBottom())/2,h=t.getCenterX()-o,T=t.getCenterY()-c,u=Math.abs(h)+t.getWidth()/2,d=Math.abs(T)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(L=s.getEstimatedSize()*this.gravityRangeFactor,(u>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*h,t.gravitationForceY=-this.gravityConstant*T)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(u>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*h*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||s},e.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},e.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,s=this.graphManager.getAllNodes(),o=0;o<s.length;o++)t=s[o],t.noOfChildren=t.getNoOfChildren()},e.prototype.calcGrid=function(t){var s=0,o=0;s=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),o=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var c=new Array(s),h=0;h<s;h++)c[h]=new Array(o);for(var h=0;h<s;h++)for(var T=0;T<o;T++)c[h][T]=new Array;return c},e.prototype.addNodeToGrid=function(t,s,o){var c=0,h=0,T=0,u=0;c=parseInt(Math.floor((t.getRect().x-s)/this.repulsionRange)),h=parseInt(Math.floor((t.getRect().width+t.getRect().x-s)/this.repulsionRange)),T=parseInt(Math.floor((t.getRect().y-o)/this.repulsionRange)),u=parseInt(Math.floor((t.getRect().height+t.getRect().y-o)/this.repulsionRange));for(var d=c;d<=h;d++)for(var L=T;L<=u;L++)this.grid[d][L].push(t),t.setGridCoordinates(c,h,T,u)},e.prototype.updateGrid=function(){var t,s,o=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<o.length;t++)s=o[t],this.addNodeToGrid(s,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},e.prototype.calculateRepulsionForceOfANode=function(t,s,o,c){if(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&o||c){var h=new Set;t.surrounding=new Array;for(var T,u=this.grid,d=t.startX-1;d<t.finishX+2;d++)for(var L=t.startY-1;L<t.finishY+2;L++)if(!(d<0||L<0||d>=u.length||L>=u[0].length)){for(var b=0;b<u[d][L].length;b++)if(T=u[d][L][b],!(t.getOwner()!=T.getOwner()||t==T)&&!s.has(T)&&!h.has(T)){var w=Math.abs(t.getCenterX()-T.getCenterX())-(t.getWidth()/2+T.getWidth()/2),G=Math.abs(t.getCenterY()-T.getCenterY())-(t.getHeight()/2+T.getHeight()/2);w<=this.repulsionRange&&G<=this.repulsionRange&&h.add(T)}}t.surrounding=[].concat(v(h))}for(d=0;d<t.surrounding.length;d++)this.calcRepulsionForce(t,t.surrounding[d])},e.prototype.calcRepulsionRange=function(){return 0},C.exports=e}),(function(C,x,N){var v=N(1),l=N(4);function n(i,f,e){v.call(this,i,f,e),this.idealLength=l.DEFAULT_EDGE_LENGTH,this.edgeElasticity=l.DEFAULT_SPRING_STRENGTH}n.prototype=Object.create(v.prototype);for(var r in v)n[r]=v[r];C.exports=n}),(function(C,x,N){var v=N(3),l=N(4);function n(i,f,e,g){v.call(this,i,f,e,g),this.nodeRepulsion=l.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}n.prototype=Object.create(v.prototype);for(var r in v)n[r]=v[r];n.prototype.setGridCoordinates=function(i,f,e,g){this.startX=i,this.finishX=f,this.startY=e,this.finishY=g},C.exports=n}),(function(C,x,N){function v(l,n){this.width=0,this.height=0,l!==null&&n!==null&&(this.height=n,this.width=l)}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(l){this.width=l},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(l){this.height=l},C.exports=v}),(function(C,x,N){var v=N(14);function l(){this.map={},this.keys=[]}l.prototype.put=function(n,r){var i=v.createID(n);this.contains(i)||(this.map[i]=r,this.keys.push(n))},l.prototype.contains=function(n){return v.createID(n),this.map[n]!=null},l.prototype.get=function(n){var r=v.createID(n);return this.map[r]},l.prototype.keySet=function(){return this.keys},C.exports=l}),(function(C,x,N){var v=N(14);function l(){this.set={}}l.prototype.add=function(n){var r=v.createID(n);this.contains(r)||(this.set[r]=n)},l.prototype.remove=function(n){delete this.set[v.createID(n)]},l.prototype.clear=function(){this.set={}},l.prototype.contains=function(n){return this.set[v.createID(n)]==n},l.prototype.isEmpty=function(){return this.size()===0},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAllTo=function(n){for(var r=Object.keys(this.set),i=r.length,f=0;f<i;f++)n.push(this.set[r[f]])},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAll=function(n){for(var r=n.length,i=0;i<r;i++){var f=n[i];this.add(f)}},C.exports=l}),(function(C,x,N){function v(){}v.multMat=function(l,n){for(var r=[],i=0;i<l.length;i++){r[i]=[];for(var f=0;f<n[0].length;f++){r[i][f]=0;for(var e=0;e<l[0].length;e++)r[i][f]+=l[i][e]*n[e][f]}}return r},v.transpose=function(l){for(var n=[],r=0;r<l[0].length;r++){n[r]=[];for(var i=0;i<l.length;i++)n[r][i]=l[i][r]}return n},v.multCons=function(l,n){for(var r=[],i=0;i<l.length;i++)r[i]=l[i]*n;return r},v.minusOp=function(l,n){for(var r=[],i=0;i<l.length;i++)r[i]=l[i]-n[i];return r},v.dotProduct=function(l,n){for(var r=0,i=0;i<l.length;i++)r+=l[i]*n[i];return r},v.mag=function(l){return Math.sqrt(this.dotProduct(l,l))},v.normalize=function(l){for(var n=[],r=this.mag(l),i=0;i<l.length;i++)n[i]=l[i]/r;return n},v.multGamma=function(l){for(var n=[],r=0,i=0;i<l.length;i++)r+=l[i];r*=-1/l.length;for(var f=0;f<l.length;f++)n[f]=r+l[f];return n},v.multL=function(l,n,r){for(var i=[],f=[],e=[],g=0;g<n[0].length;g++){for(var t=0,s=0;s<n.length;s++)t+=-.5*n[s][g]*l[s];f[g]=t}for(var o=0;o<r.length;o++){for(var c=0,h=0;h<r.length;h++)c+=r[o][h]*f[h];e[o]=c}for(var T=0;T<n.length;T++){for(var u=0,d=0;d<n[0].length;d++)u+=n[T][d]*e[d];i[T]=u}return i},C.exports=v}),(function(C,x,N){var v=(function(){function i(f,e){for(var g=0;g<e.length;g++){var t=e[g];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(f,t.key,t)}}return function(f,e,g){return e&&i(f.prototype,e),g&&i(f,g),f}})();function l(i,f){if(!(i instanceof f))throw new TypeError("Cannot call a class as a function")}var n=N(11),r=(function(){function i(f,e){l(this,i),(e!==null||e!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var g=void 0;f instanceof n?g=f.size():g=f.length,this._quicksort(f,0,g-1)}return v(i,[{key:"_quicksort",value:function(e,g,t){if(g<t){var s=this._partition(e,g,t);this._quicksort(e,g,s),this._quicksort(e,s+1,t)}}},{key:"_partition",value:function(e,g,t){for(var s=this._get(e,g),o=g,c=t;;){for(;this.compareFunction(s,this._get(e,c));)c--;for(;this.compareFunction(this._get(e,o),s);)o++;if(o<c)this._swap(e,o,c),o++,c--;else return c}}},{key:"_get",value:function(e,g){return e instanceof n?e.get_object_at(g):e[g]}},{key:"_set",value:function(e,g,t){e instanceof n?e.set_object_at(g,t):e[g]=t}},{key:"_swap",value:function(e,g,t){var s=this._get(e,g);this._set(e,g,this._get(e,t)),this._set(e,t,s)}},{key:"_defaultCompareFunction",value:function(e,g){return g>e}}]),i})();C.exports=r}),(function(C,x,N){function v(){}v.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var n=Math.min(this.m,this.n);this.s=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var wt=function zt(bt){if(bt.length==0)return 0;for(var $t=[],St=0;St<bt[0];St++)$t.push(zt(bt.slice(1)));return $t};return wt(Tt)})([this.m,n]),this.V=(function(Tt){var wt=function zt(bt){if(bt.length==0)return 0;for(var $t=[],St=0;St<bt[0];St++)$t.push(zt(bt.slice(1)));return $t};return wt(Tt)})([this.n,this.n]);for(var r=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(this.n),i=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(this.m),f=!0,e=Math.min(this.m-1,this.n),g=Math.max(0,Math.min(this.n-2,this.m)),t=0;t<Math.max(e,g);t++){if(t<e){this.s[t]=0;for(var s=t;s<this.m;s++)this.s[t]=v.hypot(this.s[t],l[s][t]);if(this.s[t]!==0){l[t][t]<0&&(this.s[t]=-this.s[t]);for(var o=t;o<this.m;o++)l[o][t]/=this.s[t];l[t][t]+=1}this.s[t]=-this.s[t]}for(var c=t+1;c<this.n;c++){if((function(Tt,wt){return Tt&&wt})(t<e,this.s[t]!==0)){for(var h=0,T=t;T<this.m;T++)h+=l[T][t]*l[T][c];h=-h/l[t][t];for(var u=t;u<this.m;u++)l[u][c]+=h*l[u][t]}r[c]=l[t][c]}if((function(Tt,wt){return wt})(f,t<e))for(var d=t;d<this.m;d++)this.U[d][t]=l[d][t];if(t<g){r[t]=0;for(var L=t+1;L<this.n;L++)r[t]=v.hypot(r[t],r[L]);if(r[t]!==0){r[t+1]<0&&(r[t]=-r[t]);for(var b=t+1;b<this.n;b++)r[b]/=r[t];r[t+1]+=1}if(r[t]=-r[t],(function(Tt,wt){return Tt&&wt})(t+1<this.m,r[t]!==0)){for(var w=t+1;w<this.m;w++)i[w]=0;for(var G=t+1;G<this.n;G++)for(var V=t+1;V<this.m;V++)i[V]+=r[G]*l[V][G];for(var Y=t+1;Y<this.n;Y++)for(var B=-r[Y]/r[t+1],A=t+1;A<this.m;A++)l[A][Y]+=B*i[A]}for(var j=t+1;j<this.n;j++)this.V[j][t]=r[j]}}var a=Math.min(this.n,this.m+1);e<this.n&&(this.s[e]=l[e][e]),this.m<a&&(this.s[a-1]=0),g+1<a&&(r[g]=l[g][a-1]),r[a-1]=0;{for(var E=e;E<n;E++){for(var p=0;p<this.m;p++)this.U[p][E]=0;this.U[E][E]=1}for(var m=e-1;m>=0;m--)if(this.s[m]!==0){for(var y=m+1;y<n;y++){for(var S=0,D=m;D<this.m;D++)S+=this.U[D][m]*this.U[D][y];S=-S/this.U[m][m];for(var F=m;F<this.m;F++)this.U[F][y]+=S*this.U[F][m]}for(var W=m;W<this.m;W++)this.U[W][m]=-this.U[W][m];this.U[m][m]=1+this.U[m][m];for(var R=0;R<m-1;R++)this.U[R][m]=0}else{for(var Q=0;Q<this.m;Q++)this.U[Q][m]=0;this.U[m][m]=1}}for(var $=this.n-1;$>=0;$--){if((function(Tt,wt){return Tt&&wt})($<g,r[$]!==0))for(var X=$+1;X<n;X++){for(var rt=0,z=$+1;z<this.n;z++)rt+=this.V[z][$]*this.V[z][X];rt=-rt/this.V[$+1][$];for(var O=$+1;O<this.n;O++)this.V[O][X]+=rt*this.V[O][$]}for(var H=0;H<this.n;H++)this.V[H][$]=0;this.V[$][$]=1}for(var Z=a-1,tt=Math.pow(2,-52),ht=Math.pow(2,-966);a>0;){var J=void 0,It=void 0;for(J=a-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===a-2)It=4;else{var Nt=void 0;for(Nt=a-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==a?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===a-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[a-2];r[a-2]=0;for(var ut=a-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*r[ut-1],r[ut-1]=Ct*r[ut-1]);for(var mt=0;mt<this.n;mt++)Et=Ct*this.V[mt][ut]+Dt*this.V[mt][a-1],this.V[mt][a-1]=-Dt*this.V[mt][ut]+Ct*this.V[mt][a-1],this.V[mt][ut]=Et}}break;case 2:{var Ot=r[J-1];r[J-1]=0;for(var Rt=J;Rt<a;Rt++){var Ht=v.hypot(this.s[Rt],Ot),Ut=this.s[Rt]/Ht,Pt=Ot/Ht;this.s[Rt]=Ht,Ot=-Pt*r[Rt],r[Rt]=Ut*r[Rt];for(var Ft=0;Ft<this.m;Ft++)Ht=Ut*this.U[Ft][Rt]+Pt*this.U[Ft][J-1],this.U[Ft][J-1]=-Pt*this.U[Ft][Rt]+Ut*this.U[Ft][J-1],this.U[Ft][Rt]=Ht}}break;case 3:{var Yt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[a-1]),Math.abs(this.s[a-2])),Math.abs(r[a-2])),Math.abs(this.s[J])),Math.abs(r[J])),Vt=this.s[a-1]/Yt,P=this.s[a-2]/Yt,U=r[a-2]/Yt,k=this.s[J]/Yt,K=r[J]/Yt,q=((P+Vt)*(P-Vt)+U*U)/2,at=Vt*U*(Vt*U),gt=0;(function(Tt,wt){return Tt||wt})(q!==0,at!==0)&&(gt=Math.sqrt(q*q+at),q<0&&(gt=-gt),gt=at/(q+gt));for(var nt=(k+Vt)*(k-Vt)+gt,et=k*K,_=J;_<a-1;_++){var dt=v.hypot(nt,et),Mt=nt/dt,pt=et/dt;_!==J&&(r[_-1]=dt),nt=Mt*this.s[_]+pt*r[_],r[_]=Mt*r[_]-pt*this.s[_],et=pt*this.s[_+1],this.s[_+1]=Mt*this.s[_+1];for(var xt=0;xt<this.n;xt++)dt=Mt*this.V[xt][_]+pt*this.V[xt][_+1],this.V[xt][_+1]=-pt*this.V[xt][_]+Mt*this.V[xt][_+1],this.V[xt][_]=dt;if(dt=v.hypot(nt,et),Mt=nt/dt,pt=et/dt,this.s[_]=dt,nt=Mt*r[_]+pt*this.s[_+1],this.s[_+1]=-pt*r[_]+Mt*this.s[_+1],et=pt*r[_+1],r[_+1]=Mt*r[_+1],_<this.m-1)for(var lt=0;lt<this.m;lt++)dt=Mt*this.U[lt][_]+pt*this.U[lt][_+1],this.U[lt][_+1]=-pt*this.U[lt][_]+Mt*this.U[lt][_+1],this.U[lt][_]=dt}r[a-2]=nt}break;case 4:{if(this.s[J]<=0){this.s[J]=this.s[J]<0?-this.s[J]:0;for(var ot=0;ot<=Z;ot++)this.V[ot][J]=-this.V[ot][J]}for(;J<Z&&!(this.s[J]>=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,J<this.n-1)for(var ft=0;ft<this.n;ft++)Lt=this.V[ft][J+1],this.V[ft][J+1]=this.V[ft][J],this.V[ft][J]=Lt;if(J<this.m-1)for(var st=0;st<this.m;st++)Lt=this.U[st][J+1],this.U[st][J+1]=this.U[st][J],this.U[st][J]=Lt;J++}a--}break}}var Xt={U:this.U,V:this.V,S:this.s};return Xt},v.hypot=function(l,n){var r=void 0;return Math.abs(l)>Math.abs(n)?(r=n/l,r=Math.abs(l)*Math.sqrt(1+r*r)):n!=0?(r=l/n,r=Math.abs(n)*Math.sqrt(1+r*r)):r=0,r},C.exports=v}),(function(C,x,N){var v=(function(){function r(i,f){for(var e=0;e<f.length;e++){var g=f[e];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(i,g.key,g)}}return function(i,f,e){return f&&r(i.prototype,f),e&&r(i,e),i}})();function l(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")}var n=(function(){function r(i,f){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,r),this.sequence1=i,this.sequence2=f,this.match_score=e,this.mismatch_penalty=g,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var o=0;o<this.jMax;o++)this.grid[s][o]=0}this.tracebackGrid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.tracebackGrid[c]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.tracebackGrid[c][h]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(r,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var g=1;g<this.iMax;g++)for(var t=1;t<this.jMax;t++){var s=void 0;this.sequence1[g-1]===this.sequence2[t-1]?s=this.grid[g-1][t-1]+this.match_score:s=this.grid[g-1][t-1]+this.mismatch_penalty;var o=this.grid[g-1][t]+this.gap_penalty,c=this.grid[g][t-1]+this.gap_penalty,h=[s,o,c],T=this.arrayAllMaxIndexes(h);this.grid[g][t]=h[T[0]],this.tracebackGrid[g][t]=[T.includes(0),T.includes(1),T.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var e=f[0],g=this.tracebackGrid[e.pos[0]][e.pos[1]];g[0]&&f.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),g[1]&&f.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),g[2]&&f.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),e.pos[0]===0&&e.pos[1]===0&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,e){for(var g=[],t=-1;(t=f.indexOf(e,t+1))!==-1;)g.push(t);return g}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),r})();C.exports=n}),(function(C,x,N){var v=function(){};v.FDLayout=N(18),v.FDLayoutConstants=N(4),v.FDLayoutEdge=N(19),v.FDLayoutNode=N(20),v.DimensionD=N(21),v.HashMap=N(22),v.HashSet=N(23),v.IGeometry=N(8),v.IMath=N(9),v.Integer=N(10),v.Point=N(12),v.PointD=N(5),v.RandomSeed=N(16),v.RectangleD=N(13),v.Transform=N(17),v.UniqueIDGeneretor=N(14),v.Quicksort=N(25),v.LinkedList=N(11),v.LGraphObject=N(2),v.LGraph=N(6),v.LEdge=N(1),v.LGraphManager=N(7),v.LNode=N(3),v.Layout=N(15),v.LayoutConstants=N(0),v.NeedlemanWunsch=N(27),v.Matrix=N(24),v.SVD=N(26),C.exports=v}),(function(C,x,N){function v(){this.listeners=[]}var l=v.prototype;l.addListener=function(n,r){this.listeners.push({event:n,callback:r})},l.removeListener=function(n,r){for(var i=this.listeners.length;i>=0;i--){var f=this.listeners[i];f.event===n&&f.callback===r&&this.listeners.splice(i,1)}},l.emit=function(n,r){for(var i=0;i<this.listeners.length;i++){var f=this.listeners[i];n===f.event&&f.callback(r)}},C.exports=v})])})})(fe)),fe.exports}var pr=le.exports,Oe;function yr(){return Oe||(Oe=1,(function(I,M){(function(x,N){I.exports=N(vr())})(pr,function(C){return(()=>{var x={45:((n,r,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),n.exports=f}),806:((n,r,i)=>{var f=i(551).FDLayoutConstants;function e(){}for(var g in f)e[g]=f[g];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,n.exports=e}),767:((n,r,i)=>{var f=i(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e}),880:((n,r,i)=>{var f=i(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e}),578:((n,r,i)=>{var f=i(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e}),765:((n,r,i)=>{var f=i(551).FDLayout,e=i(578),g=i(880),t=i(991),s=i(767),o=i(806),c=i(902),h=i(551).FDLayoutConstants,T=i(551).LayoutConstants,u=i(551).Point,d=i(551).PointD,L=i(551).DimensionD,b=i(551).Layout,w=i(551).Integer,G=i(551).IGeometry,V=i(551).LGraph,Y=i(551).Transform,B=i(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var j in f)A[j]=f[j];A.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},A.prototype.newGraph=function(a){return new g(null,this.graphManager,a)},A.prototype.newNode=function(a){return new t(this.graphManager,a)},A.prototype.newEdge=function(a){return new s(null,null,a)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var a=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return a&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(S){return E.has(S)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var a=this.getFlatForest();if(a.length>0)this.positionNodesRadially(a);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return a.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.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()),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),E={},p=0;p<a.length;p++){var m=a[p].rect,y=a[p].id;E[y]={id:y,x:m.getCenterX(),y:m.getCenterY(),w:m.width,h:m.height}}return E},A.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var a=!1;if(h.ANIMATE==="during")this.emit("layoutstarted");else{for(;!a;)a=this.tick();this.graphManager.updateBounds()}},A.prototype.moveNodes=function(){for(var a=this.getAllNodes(),E,p=0;p<a.length;p++)E=a[p],E.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var p=0;p<a.length;p++)E=a[p],E.move()},A.prototype.initConstraintVariables=function(){var a=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var E=this.graphManager.getAllNodes(),p=0;p<E.length;p++){var m=E[p];this.idToNodeMap.set(m.id,m)}var y=function O(H){for(var Z=H.getChild().getNodes(),tt,ht=0,J=0;J<Z.length;J++)tt=Z[J],tt.getChild()==null?a.fixedNodeSet.has(tt.id)&&(ht+=100):ht+=O(tt);return ht};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(Z){a.fixedNodeSet.add(Z.nodeId)});for(var E=this.graphManager.getAllNodes(),m,p=0;p<E.length;p++)if(m=E[p],m.getChild()!=null){var S=y(m);S>0&&(m.fixedNodeWeight=S)}}if(this.constraints.relativePlacementConstraint){var D=new Map,F=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){a.fixedNodesOnHorizontal.add(O),a.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p<W.length;p++)this.dummyToNodeForVerticalAlignment.set("dummy"+p,[]),W[p].forEach(function(H){D.set(H,"dummy"+p),a.dummyToNodeForVerticalAlignment.get("dummy"+p).push(H),a.fixedNodeSet.has(H)&&a.fixedNodesOnHorizontal.add("dummy"+p)});if(this.constraints.alignmentConstraint.horizontal)for(var R=this.constraints.alignmentConstraint.horizontal,p=0;p<R.length;p++)this.dummyToNodeForHorizontalAlignment.set("dummy"+p,[]),R[p].forEach(function(H){F.set(H,"dummy"+p),a.dummyToNodeForHorizontalAlignment.get("dummy"+p).push(H),a.fixedNodeSet.has(H)&&a.fixedNodesOnVertical.add("dummy"+p)})}if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(O){var H,Z,tt;for(tt=O.length-1;tt>=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),Z=O[tt],O[tt]=O[H],O[H]=Z;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;a.nodesInRelativeHorizontal.includes(H)||(a.nodesInRelativeHorizontal.push(H),a.nodeToRelativeConstraintMapHorizontal.set(H,[]),a.dummyToNodeForVerticalAlignment.has(H)?a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(H).getCenterX())),a.nodesInRelativeHorizontal.includes(Z)||(a.nodesInRelativeHorizontal.push(Z),a.nodeToRelativeConstraintMapHorizontal.set(Z,[]),a.dummyToNodeForVerticalAlignment.has(Z)?a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(Z).getCenterX())),a.nodeToRelativeConstraintMapHorizontal.get(H).push({right:Z,gap:O.gap}),a.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:H,gap:O.gap})}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;a.nodesInRelativeVertical.includes(tt)||(a.nodesInRelativeVertical.push(tt),a.nodeToRelativeConstraintMapVertical.set(tt,[]),a.dummyToNodeForHorizontalAlignment.has(tt)?a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(tt).getCenterY())),a.nodesInRelativeVertical.includes(ht)||(a.nodesInRelativeVertical.push(ht),a.nodeToRelativeConstraintMapVertical.set(ht,[]),a.dummyToNodeForHorizontalAlignment.has(ht)?a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(ht).getCenterY())),a.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),a.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,$=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(Z):Q.set(H,[Z]),Q.has(Z)?Q.get(Z).push(H):Q.set(Z,[H])}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;$.has(tt)?$.get(tt).push(ht):$.set(tt,[ht]),$.has(ht)?$.get(ht).push(tt):$.set(ht,[tt])}});var X=function(H,Z){var tt=[],ht=[],J=new B,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),Z.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,a.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var z=X($,a.fixedNodesOnVertical);this.componentsOnVertical=z.components,this.fixedComponentsOnVertical=z.isFixed}}},A.prototype.updateDisplacements=function(){var a=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(z){var O=a.idToNodeMap.get(z.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p<E.length;p++){for(var m=0,y=0;y<E[p].length;y++){if(this.fixedNodeSet.has(E[p][y])){m=0;break}m+=this.idToNodeMap.get(E[p][y]).displacementX}for(var S=m/E[p].length,y=0;y<E[p].length;y++)this.idToNodeMap.get(E[p][y]).displacementX=S}if(this.constraints.alignmentConstraint.horizontal)for(var D=this.constraints.alignmentConstraint.horizontal,p=0;p<D.length;p++){for(var F=0,y=0;y<D[p].length;y++){if(this.fixedNodeSet.has(D[p][y])){F=0;break}F+=this.idToNodeMap.get(D[p][y]).displacementY}for(var W=F/D[p].length,y=0;y<D[p].length;y++)this.idToNodeMap.get(D[p][y]).displacementY=W}}if(this.constraints.relativePlacementConstraint)if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(z){if(!a.fixedNodesOnHorizontal.has(z)){var O=0;a.dummyToNodeForVerticalAlignment.has(z)?O=a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(z)[0]).displacementX:O=a.idToNodeMap.get(z).displacementX,a.nodeToRelativeConstraintMapHorizontal.get(z).forEach(function(H){if(H.right){var Z=a.nodeToTempPositionMapHorizontal.get(H.right)-a.nodeToTempPositionMapHorizontal.get(z)-O;Z<H.gap&&(O-=H.gap-Z)}else{var Z=a.nodeToTempPositionMapHorizontal.get(z)-a.nodeToTempPositionMapHorizontal.get(H.left)+O;Z<H.gap&&(O+=H.gap-Z)}}),a.nodeToTempPositionMapHorizontal.set(z,a.nodeToTempPositionMapHorizontal.get(z)+O),a.dummyToNodeForVerticalAlignment.has(z)?a.dummyToNodeForVerticalAlignment.get(z).forEach(function(H){a.idToNodeMap.get(H).displacementX=O}):a.idToNodeMap.get(z).displacementX=O}}),this.nodesInRelativeVertical.forEach(function(z){if(!a.fixedNodesOnHorizontal.has(z)){var O=0;a.dummyToNodeForHorizontalAlignment.has(z)?O=a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(z)[0]).displacementY:O=a.idToNodeMap.get(z).displacementY,a.nodeToRelativeConstraintMapVertical.get(z).forEach(function(H){if(H.bottom){var Z=a.nodeToTempPositionMapVertical.get(H.bottom)-a.nodeToTempPositionMapVertical.get(z)-O;Z<H.gap&&(O-=H.gap-Z)}else{var Z=a.nodeToTempPositionMapVertical.get(z)-a.nodeToTempPositionMapVertical.get(H.top)+O;Z<H.gap&&(O+=H.gap-Z)}}),a.nodeToTempPositionMapVertical.set(z,a.nodeToTempPositionMapVertical.get(z)+O),a.dummyToNodeForHorizontalAlignment.has(z)?a.dummyToNodeForHorizontalAlignment.get(z).forEach(function(H){a.idToNodeMap.get(H).displacementY=O}):a.idToNodeMap.get(z).displacementY=O}});else{for(var p=0;p<this.componentsOnHorizontal.length;p++){var R=this.componentsOnHorizontal[p];if(this.fixedComponentsOnHorizontal[p])for(var y=0;y<R.length;y++)this.dummyToNodeForVerticalAlignment.has(R[y])?this.dummyToNodeForVerticalAlignment.get(R[y]).forEach(function(H){a.idToNodeMap.get(H).displacementX=0}):this.idToNodeMap.get(R[y]).displacementX=0;else{for(var Q=0,$=0,y=0;y<R.length;y++)if(this.dummyToNodeForVerticalAlignment.has(R[y])){var X=this.dummyToNodeForVerticalAlignment.get(R[y]);Q+=X.length*this.idToNodeMap.get(X[0]).displacementX,$+=X.length}else Q+=this.idToNodeMap.get(R[y]).displacementX,$++;for(var rt=Q/$,y=0;y<R.length;y++)this.dummyToNodeForVerticalAlignment.has(R[y])?this.dummyToNodeForVerticalAlignment.get(R[y]).forEach(function(H){a.idToNodeMap.get(H).displacementX=rt}):this.idToNodeMap.get(R[y]).displacementX=rt}}for(var p=0;p<this.componentsOnVertical.length;p++){var R=this.componentsOnVertical[p];if(this.fixedComponentsOnVertical[p])for(var y=0;y<R.length;y++)this.dummyToNodeForHorizontalAlignment.has(R[y])?this.dummyToNodeForHorizontalAlignment.get(R[y]).forEach(function(Z){a.idToNodeMap.get(Z).displacementY=0}):this.idToNodeMap.get(R[y]).displacementY=0;else{for(var Q=0,$=0,y=0;y<R.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(R[y])){var X=this.dummyToNodeForHorizontalAlignment.get(R[y]);Q+=X.length*this.idToNodeMap.get(X[0]).displacementY,$+=X.length}else Q+=this.idToNodeMap.get(R[y]).displacementY,$++;for(var rt=Q/$,y=0;y<R.length;y++)this.dummyToNodeForHorizontalAlignment.has(R[y])?this.dummyToNodeForHorizontalAlignment.get(R[y]).forEach(function(J){a.idToNodeMap.get(J).displacementY=rt}):this.idToNodeMap.get(R[y]).displacementY=rt}}}},A.prototype.calculateNodesToApplyGravitationTo=function(){var a=[],E,p=this.graphManager.getGraphs(),m=p.length,y;for(y=0;y<m;y++)E=p[y],E.updateConnected(),E.isConnected||(a=a.concat(E.getNodes()));return a},A.prototype.createBendpoints=function(){var a=[];a=a.concat(this.graphManager.getAllEdges());var E=new Set,p;for(p=0;p<a.length;p++){var m=a[p];if(!E.has(m)){var y=m.getSource(),S=m.getTarget();if(y==S)m.getBendpoints().push(new d),m.getBendpoints().push(new d),this.createDummyNodesForBendpoints(m),E.add(m);else{var D=[];if(D=D.concat(y.getEdgeListToNode(S)),D=D.concat(S.getEdgeListToNode(y)),!E.has(D[0])){if(D.length>1){var F;for(F=0;F<D.length;F++){var W=D[F];W.getBendpoints().push(new d),this.createDummyNodesForBendpoints(W)}}D.forEach(function(R){E.add(R)})}}}if(E.size==a.length)break}},A.prototype.positionNodesRadially=function(a){for(var E=new u(0,0),p=Math.ceil(Math.sqrt(a.length)),m=0,y=0,S=0,D=new d(0,0),F=0;F<a.length;F++){F%p==0&&(S=0,y=m,F!=0&&(y+=o.DEFAULT_COMPONENT_SEPERATION),m=0);var W=a[F],R=b.findCenterOfTree(W);E.x=S,E.y=y,D=A.radialLayout(W,R,E),D.y>m&&(m=Math.floor(D.y)),S=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-D.x/2,T.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(a,E,p){var m=Math.max(this.maxDiagonalInTree(a),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(a),S=new Y;S.setDeviceOrgX(y.getMinX()),S.setDeviceOrgY(y.getMinY()),S.setWorldOrgX(p.x),S.setWorldOrgY(p.y);for(var D=0;D<a.length;D++){var F=a[D];F.transform(S)}var W=new d(y.getMaxX(),y.getMaxY());return S.inverseTransformPoint(W)},A.branchRadialLayout=function(a,E,p,m,y,S){var D=(m-p+1)/2;D<0&&(D+=180);var F=(D+p)%360,W=F*G.TWO_PI/360,R=y*Math.cos(W),Q=y*Math.sin(W);a.setCenter(R,Q);var $=[];$=$.concat(a.getEdges());var X=$.length;E!=null&&X--;for(var rt=0,z=$.length,O,H=a.getEdgesBetween(E);H.length>1;){var Z=H[0];H.splice(0,1);var tt=$.indexOf(Z);tt>=0&&$.splice(tt,1),z--,X--}E!=null?O=($.indexOf(H[0])+1)%z:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%z){var It=$[J].getOtherEnd(a);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,a,Nt,vt,y+S,S),rt++}}},A.maxDiagonalInTree=function(a){for(var E=w.MIN_VALUE,p=0;p<a.length;p++){var m=a[p],y=m.getDiagonal();y>E&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var a=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y<m.length;y++){var S=m[y],D=S.getParent();this.getNodeDegreeWithChildren(S)===0&&(D.id==null||!this.getToBeTiled(D))&&p.push(S)}for(var y=0;y<p.length;y++){var S=p[y],F=S.getParent().id;typeof E[F]>"u"&&(E[F]=[]),E[F]=E[F].concat(S)}Object.keys(E).forEach(function(W){if(E[W].length>1){var R="DummyCompound_"+W;a.memberGroups[R]=E[W];var Q=E[W][0].getParent(),$=new t(a.graphManager);$.id=R,$.paddingLeft=Q.paddingLeft||0,$.paddingRight=Q.paddingRight||0,$.paddingBottom=Q.paddingBottom||0,$.paddingTop=Q.paddingTop||0,a.idToDummyNode[R]=$;var X=a.getGraphManager().add(a.newGraph(),$),rt=Q.getChild();rt.add($);for(var z=0;z<E[W].length;z++){var O=E[W][z];rt.remove(O),X.add(O)}}})},A.prototype.clearCompounds=function(){var a={},E={};this.performDFSOnCompounds();for(var p=0;p<this.compoundOrder.length;p++)E[this.compoundOrder[p].id]=this.compoundOrder[p],a[this.compoundOrder[p].id]=[].concat(this.compoundOrder[p].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[p].getChild()),this.compoundOrder[p].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(a,E)},A.prototype.clearZeroDegreeMembers=function(){var a=this,E=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(p){var m=a.idToDummyNode[p];if(E[p]=a.tileNodes(a.memberGroups[p],m.paddingLeft+m.paddingRight),m.rect.width=E[p].width,m.rect.height=E[p].height,m.setCenter(E[p].centerX,E[p].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var y=m.rect.width,S=m.rect.height;m.labelWidth&&(m.labelPosHorizontal=="left"?(m.rect.x-=m.labelWidth,m.setWidth(y+m.labelWidth),m.labelMarginLeft=m.labelWidth):m.labelPosHorizontal=="center"&&m.labelWidth>y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(S+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>S?(m.rect.y-=(m.labelHeight-S)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-S)/2):m.labelPosVertical=="bottom"&&m.setHeight(S+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var E=this.compoundOrder[a],p=E.id,m=E.paddingLeft,y=E.paddingTop,S=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,S,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var a=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=a.idToDummyNode[p],y=m.paddingLeft,S=m.paddingTop,D=m.labelMarginLeft,F=m.labelMarginTop;a.adjustLocations(E[p],m.rect.x,m.rect.y,y,S,D,F)})},A.prototype.getToBeTiled=function(a){var E=a.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=a.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y<m.length;y++){var S=m[y];if(this.getNodeDegree(S)>0)return this.toBeTiled[E]=!1,!1;if(S.getChild()==null){this.toBeTiled[S.id]=!1;continue}if(!this.getToBeTiled(S))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(a){a.id;for(var E=a.getEdges(),p=0,m=0;m<E.length;m++){var y=E[m];y.getSource().id!==y.getTarget().id&&(p=p+1)}return p},A.prototype.getNodeDegreeWithChildren=function(a){var E=this.getNodeDegree(a);if(a.getChild()==null)return E;for(var p=a.getChild().getNodes(),m=0;m<p.length;m++){var y=p[m];E+=this.getNodeDegreeWithChildren(y)}return E},A.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},A.prototype.fillCompexOrderByDFS=function(a){for(var E=0;E<a.length;E++){var p=a[E];p.getChild()!=null&&this.fillCompexOrderByDFS(p.getChild().getNodes()),this.getToBeTiled(p)&&this.compoundOrder.push(p)}},A.prototype.adjustLocations=function(a,E,p,m,y,S,D){E+=m+S,p+=y+D;for(var F=E,W=0;W<a.rows.length;W++){var R=a.rows[W];E=F;for(var Q=0,$=0;$<R.length;$++){var X=R[$];X.rect.x=E,X.rect.y=p,E+=X.rect.width+a.horizontalPadding,X.rect.height>Q&&(Q=X.rect.height)}p+=Q+a.verticalPadding}},A.prototype.tileCompoundMembers=function(a,E){var p=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(a[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var S=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(S+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>S?(y.rect.x-=(y.labelWidth-S)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-S)/2):y.labelPosHorizontal=="right"&&y.setWidth(S+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(a,E){var p=this.tileNodesByFavoringDim(a,E,!0),m=this.tileNodesByFavoringDim(a,E,!1),y=this.getOrgRatio(p),S=this.getOrgRatio(m),D;return S<y?D=m:D=p,D},A.prototype.getOrgRatio=function(a){var E=a.width,p=a.height,m=E/p;return m<1&&(m=1/m),m},A.prototype.calcIdealRowWidth=function(a,E){var p=o.TILING_PADDING_VERTICAL,m=o.TILING_PADDING_HORIZONTAL,y=a.length,S=0,D=0,F=0;a.forEach(function(z){S+=z.getWidth(),D+=z.getHeight(),z.getWidth()>F&&(F=z.getWidth())});var W=S/y,R=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(R+p)*y,$=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil($),X==$&&X++):X=Math.floor($);var rt=X*(W+m)-m;return F>rt&&(rt=F),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(a,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,S=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};S&&(D.idealRowWidth=this.calcIdealRowWidth(a,p));var F=function(O){return O.rect.width*O.rect.height},W=function(O,H){return F(H)-F(O)};a.sort(function(z,O){var H=W;return D.idealRowWidth?(H=S,H(z.id,O.id)):H(z,O)});for(var R=0,Q=0,$=0;$<a.length;$++){var X=a[$];R+=X.getCenterX(),Q+=X.getCenterY()}D.centerX=R/a.length,D.centerY=Q/a.length;for(var $=0;$<a.length;$++){var X=a[$];if(D.rows.length==0)this.insertNodeToRow(D,X,0,E);else if(this.canAddHorizontal(D,X.rect.width,X.rect.height)){var rt=D.rows.length-1;D.idealRowWidth||(rt=this.getShortestRowIndex(D)),this.insertNodeToRow(D,X,rt,E)}else this.insertNodeToRow(D,X,D.rows.length,E);this.shiftToLastRow(D)}return D},A.prototype.insertNodeToRow=function(a,E,p,m){var y=m;if(p==a.rows.length){var S=[];a.rows.push(S),a.rowWidth.push(y),a.rowHeight.push(0)}var D=a.rowWidth[p]+E.rect.width;a.rows[p].length>0&&(D+=a.horizontalPadding),a.rowWidth[p]=D,a.width<D&&(a.width=D);var F=E.rect.height;p>0&&(F+=a.verticalPadding);var W=0;F>a.rowHeight[p]&&(W=a.rowHeight[p],a.rowHeight[p]=F,W=a.rowHeight[p]-W),a.height+=W,a.rows[p].push(E)},A.prototype.getShortestRowIndex=function(a){for(var E=-1,p=Number.MAX_VALUE,m=0;m<a.rows.length;m++)a.rowWidth[m]<p&&(E=m,p=a.rowWidth[m]);return E},A.prototype.getLongestRowIndex=function(a){for(var E=-1,p=Number.MIN_VALUE,m=0;m<a.rows.length;m++)a.rowWidth[m]>p&&(E=m,p=a.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(a,E,p){if(a.idealRowWidth){var m=a.rows.length-1,y=a.rowWidth[m];return y+E+a.horizontalPadding<=a.idealRowWidth}var S=this.getShortestRowIndex(a);if(S<0)return!0;var D=a.rowWidth[S];if(D+a.horizontalPadding+E<=a.width)return!0;var F=0;a.rowHeight[S]<p&&S>0&&(F=p+a.verticalPadding-a.rowHeight[S]);var W;a.width-D>=E+a.horizontalPadding?W=(a.height+F)/(D+E+a.horizontalPadding):W=(a.height+F)/a.width,F=p+a.verticalPadding;var R;return a.width<E?R=(a.height+F)/E:R=(a.height+F)/a.width,R<1&&(R=1/R),W<1&&(W=1/W),W<R},A.prototype.shiftToLastRow=function(a){var E=this.getLongestRowIndex(a),p=a.rowWidth.length-1,m=a.rows[E],y=m[m.length-1],S=y.width+a.horizontalPadding;if(a.width-a.rowWidth[p]>S&&E!=p){m.splice(-1,1),a.rows[p].push(y),a.rowWidth[E]=a.rowWidth[E]-S,a.rowWidth[p]=a.rowWidth[p]+S,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var D=Number.MIN_VALUE,F=0;F<m.length;F++)m[F].height>D&&(D=m[F].height);E>0&&(D+=a.verticalPadding);var W=a.rowHeight[E]+a.rowHeight[p];a.rowHeight[E]=D,a.rowHeight[p]<y.height+a.verticalPadding&&(a.rowHeight[p]=y.height+a.verticalPadding);var R=a.rowHeight[E]+a.rowHeight[p];a.height+=R-W,this.shiftToLastRow(a)}},A.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},A.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},A.prototype.reduceTrees=function(){for(var a=[],E=!0,p;E;){var m=this.graphManager.getAllNodes(),y=[];E=!1;for(var S=0;S<m.length;S++)if(p=m[S],p.getEdges().length==1&&!p.getEdges()[0].isInterGraph&&p.getChild()==null){if(o.PURE_INCREMENTAL){var D=p.getEdges()[0].getOtherEnd(p),F=new L(p.getCenterX()-D.getCenterX(),p.getCenterY()-D.getCenterY());y.push([p,p.getEdges()[0],p.getOwner(),F])}else y.push([p,p.getEdges()[0],p.getOwner()]);E=!0}if(E==!0){for(var W=[],R=0;R<y.length;R++)y[R][0].getEdges().length==1&&(W.push(y[R]),y[R][0].getOwner().remove(y[R][0]));a.push(W),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=a},A.prototype.growTree=function(a){for(var E=a.length,p=a[E-1],m,y=0;y<p.length;y++)m=p[y],this.findPlaceforPrunedNode(m),m[2].add(m[0]),m[2].add(m[1],m[1].source,m[1].target);a.splice(a.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},A.prototype.findPlaceforPrunedNode=function(a){var E,p,m=a[0];if(m==a[1].source?p=a[1].target:p=a[1].source,o.PURE_INCREMENTAL)m.setCenter(p.getCenterX()+a[3].getWidth(),p.getCenterY()+a[3].getHeight());else{var y=p.startX,S=p.finishX,D=p.startY,F=p.finishY,W=0,R=0,Q=0,$=0,X=[W,Q,R,$];if(D>0)for(var rt=y;rt<=S;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(S<this.grid.length-1)for(var rt=D;rt<=F;rt++)X[1]+=this.grid[S+1][rt].length+this.grid[S][rt].length-1;if(F<this.grid[0].length-1)for(var rt=y;rt<=S;rt++)X[2]+=this.grid[rt][F+1].length+this.grid[rt][F].length-1;if(y>0)for(var rt=D;rt<=F;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var z=w.MAX_VALUE,O,H,Z=0;Z<X.length;Z++)X[Z]<z?(z=X[Z],O=1,H=Z):X[Z]==z&&O++;if(O==3&&z==0)X[0]==0&&X[1]==0&&X[2]==0?E=1:X[0]==0&&X[1]==0&&X[3]==0?E=0:X[0]==0&&X[2]==0&&X[3]==0?E=3:X[1]==0&&X[2]==0&&X[3]==0&&(E=2);else if(O==2&&z==0){var tt=Math.floor(Math.random()*2);X[0]==0&&X[1]==0?tt==0?E=0:E=1:X[0]==0&&X[2]==0?tt==0?E=0:E=2:X[0]==0&&X[3]==0?tt==0?E=0:E=3:X[1]==0&&X[2]==0?tt==0?E=1:E=2:X[1]==0&&X[3]==0?tt==0?E=1:E=3:tt==0?E=2:E=3}else if(O==4&&z==0){var tt=Math.floor(Math.random()*4);E=tt}else E=H;E==0?m.setCenter(p.getCenterX(),p.getCenterY()-p.getHeight()/2-h.DEFAULT_EDGE_LENGTH-m.getHeight()/2):E==1?m.setCenter(p.getCenterX()+p.getWidth()/2+h.DEFAULT_EDGE_LENGTH+m.getWidth()/2,p.getCenterY()):E==2?m.setCenter(p.getCenterX(),p.getCenterY()+p.getHeight()/2+h.DEFAULT_EDGE_LENGTH+m.getHeight()/2):m.setCenter(p.getCenterX()-p.getWidth()/2-h.DEFAULT_EDGE_LENGTH-m.getWidth()/2,p.getCenterY())}},n.exports=A}),991:((n,r,i)=>{var f=i(551).FDLayoutNode,e=i(551).IMath;function g(s,o,c,h){f.call(this,s,o,c,h)}g.prototype=Object.create(f.prototype);for(var t in f)g[t]=f[t];g.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),h,T=0;T<c.length;T++)h=c[T],h.getChild()==null?(h.displacementX+=s,h.displacementY+=o):h.propogateDisplacementToChildren(s,o)},g.prototype.move=function(){var s=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),s.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},g.prototype.setPred1=function(s){this.pred1=s},g.prototype.getPred1=function(){return pred1},g.prototype.getPred2=function(){return pred2},g.prototype.setNext=function(s){this.next=s},g.prototype.getNext=function(){return next},g.prototype.setProcessed=function(s){this.processed=s},g.prototype.isProcessed=function(){return processed},n.exports=g}),902:((n,r,i)=>{function f(c){if(Array.isArray(c)){for(var h=0,T=Array(c.length);h<c.length;h++)T[h]=c[h];return T}else return Array.from(c)}var e=i(806),g=i(551).LinkedList,t=i(551).Matrix,s=i(551).SVD;function o(){}o.handleConstraints=function(c){var h={};h.fixedNodeConstraint=c.constraints.fixedNodeConstraint,h.alignmentConstraint=c.constraints.alignmentConstraint,h.relativePlacementConstraint=c.constraints.relativePlacementConstraint;for(var T=new Map,u=new Map,d=[],L=[],b=c.getAllNodes(),w=0,G=0;G<b.length;G++){var V=b[G];V.getChild()==null&&(u.set(V.id,w++),d.push(V.getCenterX()),L.push(V.getCenterY()),T.set(V.id,V))}h.relativePlacementConstraint&&h.relativePlacementConstraint.forEach(function(P){!P.gap&&P.gap!=0&&(P.left?P.gap=e.DEFAULT_EDGE_LENGTH+T.get(P.left).getWidth()/2+T.get(P.right).getWidth()/2:P.gap=e.DEFAULT_EDGE_LENGTH+T.get(P.top).getHeight()/2+T.get(P.bottom).getHeight()/2)});var Y=function(U,k){return{x:U.x-k.x,y:U.y-k.y}},B=function(U){var k=0,K=0;return U.forEach(function(q){k+=d[u.get(q)],K+=L[u.get(q)]}),{x:k/U.size,y:K/U.size}},A=function(U,k,K,q,at){function gt(lt,ot){var Lt=new Set(lt),ft=!0,st=!1,Xt=void 0;try{for(var Tt=ot[Symbol.iterator](),wt;!(ft=(wt=Tt.next()).done);ft=!0){var zt=wt.value;Lt.add(zt)}}catch(bt){st=!0,Xt=bt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}return Lt}var nt=new Map;U.forEach(function(lt,ot){nt.set(ot,0)}),U.forEach(function(lt,ot){lt.forEach(function(Lt){nt.set(Lt.id,nt.get(Lt.id)+1)})});var et=new Map,_=new Map,dt=new g;nt.forEach(function(lt,ot){lt==0?(dt.push(ot),K||(k=="horizontal"?et.set(ot,u.has(ot)?d[u.get(ot)]:q.get(ot)):et.set(ot,u.has(ot)?L[u.get(ot)]:q.get(ot)))):et.set(ot,Number.NEGATIVE_INFINITY),K&&_.set(ot,new Set([ot]))}),K&&at.forEach(function(lt){var ot=[];if(lt.forEach(function(st){K.has(st)&&ot.push(st)}),ot.length>0){var Lt=0;ot.forEach(function(st){k=="horizontal"?(et.set(st,u.has(st)?d[u.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,u.has(st)?L[u.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){k=="horizontal"?ft+=u.has(st)?d[u.get(st)]:q.get(st):ft+=u.has(st)?L[u.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)<et.get(ot)+ft.gap)if(K&&K.has(ft.id)){var st=void 0;if(k=="horizontal"?st=u.has(ft.id)?d[u.get(ft.id)]:q.get(ft.id):st=u.has(ft.id)?L[u.get(ft.id)]:q.get(ft.id),et.set(ft.id,st),st<et.get(ot)+ft.gap){var Xt=et.get(ot)+ft.gap-st;_.get(ot).forEach(function(Tt){et.set(Tt,et.get(Tt)-Xt)})}}else et.set(ft.id,et.get(ot)+ft.gap);nt.set(ft.id,nt.get(ft.id)-1),nt.get(ft.id)==0&&dt.push(ft.id),K&&_.set(ft.id,gt(_.get(ot),_.get(ft.id)))})};dt.length!=0;)Mt();if(K){var pt=new Set;U.forEach(function(lt,ot){lt.length==0&&pt.add(ot)});var xt=[];_.forEach(function(lt,ot){if(pt.has(ot)){var Lt=!1,ft=!0,st=!1,Xt=void 0;try{for(var Tt=lt[Symbol.iterator](),wt;!(ft=(wt=Tt.next()).done);ft=!0){var zt=wt.value;K.has(zt)&&(Lt=!0)}}catch(St){st=!0,Xt=St}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}if(!Lt){var bt=!1,$t=void 0;xt.forEach(function(St,Zt){St.has([].concat(f(lt))[0])&&(bt=!0,$t=Zt)}),bt?lt.forEach(function(St){xt[$t].add(St)}):xt.push(new Set(lt))}}}),xt.forEach(function(lt,ot){var Lt=Number.POSITIVE_INFINITY,ft=Number.POSITIVE_INFINITY,st=Number.NEGATIVE_INFINITY,Xt=Number.NEGATIVE_INFINITY,Tt=!0,wt=!1,zt=void 0;try{for(var bt=lt[Symbol.iterator](),$t;!(Tt=($t=bt.next()).done);Tt=!0){var St=$t.value,Zt=void 0;k=="horizontal"?Zt=u.has(St)?d[u.get(St)]:q.get(St):Zt=u.has(St)?L[u.get(St)]:q.get(St);var Kt=et.get(St);Zt<Lt&&(Lt=Zt),Zt>st&&(st=Zt),Kt<ft&&(ft=Kt),Kt>Xt&&(Xt=Kt)}}catch(ee){wt=!0,zt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw zt}}var ce=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;et.set(te,et.get(te)+ce)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},j=function(U){var k=0,K=0,q=0,at=0;if(U.forEach(function(_){_.left?d[u.get(_.left)]-d[u.get(_.right)]>=0?k++:K++:L[u.get(_.top)]-L[u.get(_.bottom)]>=0?q++:at++}),k>K&&q>at)for(var gt=0;gt<u.size;gt++)d[gt]=-1*d[gt],L[gt]=-1*L[gt];else if(k>K)for(var nt=0;nt<u.size;nt++)d[nt]=-1*d[nt];else if(q>at)for(var et=0;et<u.size;et++)L[et]=-1*L[et]},a=function(U){var k=[],K=new g,q=new Set,at=0;return U.forEach(function(gt,nt){if(!q.has(nt)){k[at]=[];var et=nt;for(K.push(et),q.add(et),k[at].push(et);K.length!=0;){et=K.shift();var _=U.get(et);_.forEach(function(dt){q.has(dt.id)||(K.push(dt.id),q.add(dt.id),k[at].push(dt.id))})}at++}}),k},E=function(U){var k=new Map;return U.forEach(function(K,q){k.set(q,[])}),U.forEach(function(K,q){K.forEach(function(at){k.get(q).push(at),k.get(at.id).push({id:q,gap:at.gap,direction:at.direction})})}),k},p=function(U){var k=new Map;return U.forEach(function(K,q){k.set(q,[])}),U.forEach(function(K,q){K.forEach(function(at){k.get(at.id).push({id:q,gap:at.gap,direction:at.direction})})}),k},m=[],y=[],S=!1,D=!1,F=new Set,W=new Map,R=new Map,Q=[];if(h.fixedNodeConstraint&&h.fixedNodeConstraint.forEach(function(P){F.add(P.nodeId)}),h.relativePlacementConstraint&&(h.relativePlacementConstraint.forEach(function(P){P.left?(W.has(P.left)?W.get(P.left).push({id:P.right,gap:P.gap,direction:"horizontal"}):W.set(P.left,[{id:P.right,gap:P.gap,direction:"horizontal"}]),W.has(P.right)||W.set(P.right,[])):(W.has(P.top)?W.get(P.top).push({id:P.bottom,gap:P.gap,direction:"vertical"}):W.set(P.top,[{id:P.bottom,gap:P.gap,direction:"vertical"}]),W.has(P.bottom)||W.set(P.bottom,[]))}),R=E(W),Q=a(R)),e.TRANSFORM_ON_CONSTRAINT_HANDLING){if(h.fixedNodeConstraint&&h.fixedNodeConstraint.length>1)h.fixedNodeConstraint.forEach(function(P,U){m[U]=[P.position.x,P.position.y],y[U]=[d[u.get(P.nodeId)],L[u.get(P.nodeId)]]}),S=!0;else if(h.alignmentConstraint)(function(){var P=0;if(h.alignmentConstraint.vertical){for(var U=h.alignmentConstraint.vertical,k=function(et){var _=new Set;U[et].forEach(function(pt){_.add(pt)});var dt=new Set([].concat(f(_)).filter(function(pt){return F.has(pt)})),Mt=void 0;dt.size>0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).x,U[et].forEach(function(pt){m[P]=[Mt,L[u.get(pt)]],y[P]=[d[u.get(pt)],L[u.get(pt)]],P++})},K=0;K<U.length;K++)k(K);S=!0}if(h.alignmentConstraint.horizontal){for(var q=h.alignmentConstraint.horizontal,at=function(et){var _=new Set;q[et].forEach(function(pt){_.add(pt)});var dt=new Set([].concat(f(_)).filter(function(pt){return F.has(pt)})),Mt=void 0;dt.size>0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).y,q[et].forEach(function(pt){m[P]=[d[u.get(pt)],Mt],y[P]=[d[u.get(pt)],L[u.get(pt)]],P++})},gt=0;gt<q.length;gt++)at(gt);S=!0}h.relativePlacementConstraint&&(D=!0)})();else if(h.relativePlacementConstraint){for(var $=0,X=0,rt=0;rt<Q.length;rt++)Q[rt].length>$&&($=Q[rt].length,X=rt);if($<R.size/2)j(h.relativePlacementConstraint),S=!1,D=!1;else{var z=new Map,O=new Map,H=[];Q[X].forEach(function(P){W.get(P).forEach(function(U){U.direction=="horizontal"?(z.has(P)?z.get(P).push(U):z.set(P,[U]),z.has(U.id)||z.set(U.id,[]),H.push({left:P,right:U.id})):(O.has(P)?O.get(P).push(U):O.set(P,[U]),O.has(U.id)||O.set(U.id,[]),H.push({top:P,bottom:U.id}))})}),j(H),D=!1;var Z=A(z,"horizontal"),tt=A(O,"vertical");Q[X].forEach(function(P,U){y[U]=[d[u.get(P)],L[u.get(P)]],m[U]=[],Z.has(P)?m[U][0]=Z.get(P):m[U][0]=d[u.get(P)],tt.has(P)?m[U][1]=tt.get(P):m[U][1]=L[u.get(P)]}),S=!0}}if(S){for(var ht=void 0,J=t.transpose(m),It=t.transpose(y),Nt=0;Nt<J.length;Nt++)J[Nt]=t.multGamma(J[Nt]),It[Nt]=t.multGamma(It[Nt]);var vt=t.multMat(J,t.transpose(It)),it=s.svd(vt);ht=t.multMat(it.V,t.transpose(it.U));for(var ut=0;ut<u.size;ut++){var Et=[d[ut],L[ut]],Ct=[ht[0][0],ht[1][0]],Dt=[ht[0][1],ht[1][1]];d[ut]=t.dotProduct(Et,Ct),L[ut]=t.dotProduct(Et,Dt)}D&&j(h.relativePlacementConstraint)}}if(e.ENFORCE_CONSTRAINTS){if(h.fixedNodeConstraint&&h.fixedNodeConstraint.length>0){var mt={x:0,y:0};h.fixedNodeConstraint.forEach(function(P,U){var k={x:d[u.get(P.nodeId)],y:L[u.get(P.nodeId)]},K=P.position,q=Y(K,k);mt.x+=q.x,mt.y+=q.y}),mt.x/=h.fixedNodeConstraint.length,mt.y/=h.fixedNodeConstraint.length,d.forEach(function(P,U){d[U]+=mt.x}),L.forEach(function(P,U){L[U]+=mt.y}),h.fixedNodeConstraint.forEach(function(P){d[u.get(P.nodeId)]=P.position.x,L[u.get(P.nodeId)]=P.position.y})}if(h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var Ot=h.alignmentConstraint.vertical,Rt=function(U){var k=new Set;Ot[U].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return F.has(at)})),q=void 0;K.size>0?q=d[u.get(K.values().next().value)]:q=B(k).x,k.forEach(function(at){F.has(at)||(d[u.get(at)]=q)})},Ht=0;Ht<Ot.length;Ht++)Rt(Ht);if(h.alignmentConstraint.horizontal)for(var Ut=h.alignmentConstraint.horizontal,Pt=function(U){var k=new Set;Ut[U].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return F.has(at)})),q=void 0;K.size>0?q=L[u.get(K.values().next().value)]:q=B(k).y,k.forEach(function(at){F.has(at)||(L[u.get(at)]=q)})},Ft=0;Ft<Ut.length;Ft++)Pt(Ft)}h.relativePlacementConstraint&&(function(){var P=new Map,U=new Map,k=new Map,K=new Map,q=new Map,at=new Map,gt=new Set,nt=new Set;if(F.forEach(function(Gt){gt.add(Gt),nt.add(Gt)}),h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var et=h.alignmentConstraint.vertical,_=function(yt){k.set("dummy"+yt,[]),et[yt].forEach(function(At){P.set(At,"dummy"+yt),k.get("dummy"+yt).push(At),F.has(At)&&gt.add("dummy"+yt)}),q.set("dummy"+yt,d[u.get(et[yt][0])])},dt=0;dt<et.length;dt++)_(dt);if(h.alignmentConstraint.horizontal)for(var Mt=h.alignmentConstraint.horizontal,pt=function(yt){K.set("dummy"+yt,[]),Mt[yt].forEach(function(At){U.set(At,"dummy"+yt),K.get("dummy"+yt).push(At),F.has(At)&&nt.add("dummy"+yt)}),at.set("dummy"+yt,L[u.get(Mt[yt][0])])},xt=0;xt<Mt.length;xt++)pt(xt)}var lt=new Map,ot=new Map,Lt=function(yt){W.get(yt).forEach(function(At){var kt=void 0,Bt=void 0;At.direction=="horizontal"?(kt=P.get(yt)?P.get(yt):yt,P.get(At.id)?Bt={id:P.get(At.id),gap:At.gap,direction:At.direction}:Bt=At,lt.has(kt)?lt.get(kt).push(Bt):lt.set(kt,[Bt]),lt.has(Bt.id)||lt.set(Bt.id,[])):(kt=U.get(yt)?U.get(yt):yt,U.get(At.id)?Bt={id:U.get(At.id),gap:At.gap,direction:At.direction}:Bt=At,ot.has(kt)?ot.get(kt).push(Bt):ot.set(kt,[Bt]),ot.has(Bt.id)||ot.set(Bt.id,[]))})},ft=!0,st=!1,Xt=void 0;try{for(var Tt=W.keys()[Symbol.iterator](),wt;!(ft=(wt=Tt.next()).done);ft=!0){var zt=wt.value;Lt(zt)}}catch(Gt){st=!0,Xt=Gt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}var bt=E(lt),$t=E(ot),St=a(bt),Zt=a($t),Kt=p(lt),ce=p(ot),Qt=[],jt=[];St.forEach(function(Gt,yt){Qt[yt]=[],Gt.forEach(function(At){Kt.get(At).length==0&&Qt[yt].push(At)})}),Zt.forEach(function(Gt,yt){jt[yt]=[],Gt.forEach(function(At){ce.get(At).length==0&&jt[yt].push(At)})});var _t=A(lt,"horizontal",gt,q,Qt),Jt=A(ot,"vertical",nt,at,jt),oe=function(yt){k.get(yt)?k.get(yt).forEach(function(At){d[u.get(At)]=_t.get(yt)}):d[u.get(yt)]=_t.get(yt)},te=!0,ee=!1,Le=void 0;try{for(var ge=_t.keys()[Symbol.iterator](),we;!(te=(we=ge.next()).done);te=!0){var ue=we.value;oe(ue)}}catch(Gt){ee=!0,Le=Gt}finally{try{!te&&ge.return&&ge.return()}finally{if(ee)throw Le}}var ke=function(yt){K.get(yt)?K.get(yt).forEach(function(At){L[u.get(At)]=Jt.get(yt)}):L[u.get(yt)]=Jt.get(yt)},de=!0,Ce=!1,Me=void 0;try{for(var ve=Jt.keys()[Symbol.iterator](),Ae;!(de=(Ae=ve.next()).done);de=!0){var ue=Ae.value;ke(ue)}}catch(Gt){Ce=!0,Me=Gt}finally{try{!de&&ve.return&&ve.return()}finally{if(Ce)throw Me}}})()}for(var Yt=0;Yt<b.length;Yt++){var Vt=b[Yt];Vt.getChild()==null&&Vt.setCenter(d[u.get(Vt.id)],L[u.get(Vt.id)])}},n.exports=o}),551:(n=>{n.exports=C})},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(45);return l})()})})(le)),le.exports}var mr=he.exports,xe;function Er(){return xe||(xe=1,(function(I,M){(function(x,N){I.exports=N(yr())})(mr,function(C){return(()=>{var x={658:(n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var i=arguments.length,f=Array(i>1?i-1:0),e=1;e<i;e++)f[e-1]=arguments[e];return f.forEach(function(g){Object.keys(g).forEach(function(t){return r[t]=g[t]})}),r}}),548:((n,r,i)=>{var f=(function(){function t(s,o){var c=[],h=!0,T=!1,u=void 0;try{for(var d=s[Symbol.iterator](),L;!(h=(L=d.next()).done)&&(c.push(L.value),!(o&&c.length===o));h=!0);}catch(b){T=!0,u=b}finally{try{!h&&d.return&&d.return()}finally{if(T)throw u}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=i(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(t){for(var s={},o=0;o<t.length;o++)s[t[o].id()]=!0;var c=t.filter(function(h,T){typeof h=="number"&&(h=T);for(var u=h.parent()[0];u!=null;){if(s[u.id()])return!1;u=u.parent()[0]}return!0});return c},g.connectComponents=function(t,s,o,c){var h=new e,T=new Set,u=[],d=void 0,L=void 0,b=void 0,w=!1,G=1,V=[],Y=[],B=function(){var j=t.collection();Y.push(j);var a=o[0],E=t.collection();E.merge(a).merge(a.descendants().intersection(s)),u.push(a),E.forEach(function(y){h.push(y),T.add(y),j.merge(y)});for(var p=function(){a=h.shift();var S=t.collection();a.neighborhood().nodes().forEach(function(R){s.intersection(a.edgesWith(R)).length>0&&S.merge(R)});for(var D=0;D<S.length;D++){var F=S[D];if(d=o.intersection(F.union(F.ancestors())),d!=null&&!T.has(d[0])){var W=d.union(d.descendants());W.forEach(function(R){h.push(R),T.add(R),j.merge(R),o.has(R)&&u.push(R)})}}};h.length!=0;)p();if(j.forEach(function(y){s.intersection(y.connectedEdges()).forEach(function(S){j.has(S.source())&&j.has(S.target())&&j.merge(S)})}),u.length==o.length&&(w=!0),!w||w&&G>1){L=u[0],b=L.connectedEdges().length,u.forEach(function(y){y.connectedEdges().length<b&&(b=y.connectedEdges().length,L=y)}),V.push(L.id());var m=t.collection();m.merge(u[0]),u.forEach(function(y){m.merge(y)}),u=[],o=o.difference(m),G++}};do B();while(!w);return c&&V.length>0&&c.set("dummy"+(c.size+1),V),Y},g.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,L=!1,b=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),G;!(d=(G=w.next()).done);d=!0){var V=G.value,Y=f(V,2),B=Y[0],A=Y[1],j=o.cy.getElementById(B);if(j){var a=j.boundingBox(),E=s.xCoords[A]-a.w/2,p=s.xCoords[A]+a.w/2,m=s.yCoords[A]-a.h/2,y=s.yCoords[A]+a.h/2;E<c&&(c=E),p>h&&(h=p),m<T&&(T=m),y>u&&(u=y)}}}catch(R){L=!0,b=R}finally{try{!d&&w.return&&w.return()}finally{if(L)throw b}}var S=t.x-(h+c)/2,D=t.y-(u+T)/2;s.xCoords=s.xCoords.map(function(R){return R+S}),s.yCoords=s.yCoords.map(function(R){return R+D})}else{Object.keys(s).forEach(function(R){var Q=s[R],$=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,z=Q.getRect().y+Q.getRect().height;$<c&&(c=$),X>h&&(h=X),rt<T&&(T=rt),z>u&&(u=z)});var F=t.x-(h+c)/2,W=t.y-(u+T)/2;Object.keys(s).forEach(function(R){var Q=s[R];Q.setCenter(Q.getCenterX()+F,Q.getCenterY()+W)})}}},g.calcBoundingBox=function(t,s,o,c){for(var h=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,L=void 0,b=void 0,w=void 0,G=void 0,V=t.descendants().not(":parent"),Y=V.length,B=0;B<Y;B++){var A=V[B];L=s[c.get(A.id())]-A.width()/2,b=s[c.get(A.id())]+A.width()/2,w=o[c.get(A.id())]-A.height()/2,G=o[c.get(A.id())]+A.height()/2,h>L&&(h=L),T<b&&(T=b),u>w&&(u=w),d<G&&(d=G)}var j={};return j.topLeftX=h,j.topLeftY=u,j.width=T-h,j.height=d-u,j},g.calcParentsWithoutChildren=function(t,s){var o=t.collection();return s.nodes(":parent").forEach(function(c){var h=!1;c.children().forEach(function(T){T.css("display")!="none"&&(h=!0)}),h||o.merge(c)}),o},n.exports=g}),816:((n,r,i)=>{var f=i(548),e=i(140).CoSELayout,g=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,h=i(140).CoSEConstants,T=function(d,L){var b=d.cy,w=d.eles,G=w.nodes(),V=w.edges(),Y=void 0,B=void 0,A=void 0,j={};d.randomize&&(Y=L.nodeIndexes,B=L.xCoords,A=L.yCoords);var a=function(R){return typeof R=="function"},E=function(R,Q){return a(R)?R(Q):R},p=f.calcParentsWithoutChildren(b,w),m=function W(R,Q,$,X){for(var rt=Q.length,z=0;z<rt;z++){var O=Q[z],H=null;O.intersection(p).length==0&&(H=O.children());var Z=void 0,tt=O.layoutDimensions({nodeDimensionsIncludeLabels:X.nodeDimensionsIncludeLabels});if(O.outerWidth()!=null&&O.outerHeight()!=null)if(X.randomize)if(!O.isParent())Z=R.add(new g($.graphManager,new t(B[Y.get(O.id())]-tt.w/2,A[Y.get(O.id())]-tt.h/2),new s(parseFloat(tt.w),parseFloat(tt.h))));else{var ht=f.calcBoundingBox(O,B,A,Y);O.intersection(p).length==0?Z=R.add(new g($.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(ht.width,ht.height))):Z=R.add(new g($.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(parseFloat(tt.w),parseFloat(tt.h))))}else Z=R.add(new g($.graphManager,new t(O.position("x")-tt.w/2,O.position("y")-tt.h/2),new s(parseFloat(tt.w),parseFloat(tt.h))));else Z=R.add(new g(this.graphManager));if(Z.id=O.data("id"),Z.nodeRepulsion=E(X.nodeRepulsion,O),Z.paddingLeft=parseInt(O.css("padding")),Z.paddingTop=parseInt(O.css("padding")),Z.paddingRight=parseInt(O.css("padding")),Z.paddingBottom=parseInt(O.css("padding")),X.nodeDimensionsIncludeLabels&&(Z.labelWidth=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,Z.labelHeight=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,Z.labelPosVertical=O.css("text-valign"),Z.labelPosHorizontal=O.css("text-halign")),j[O.data("id")]=Z,isNaN(Z.rect.x)&&(Z.rect.x=0),isNaN(Z.rect.y)&&(Z.rect.y=0),H!=null&&H.length>0){var J=void 0;J=$.getGraphManager().add($.newGraph(),Z),W(J,H,$,X)}}},y=function(R,Q,$){for(var X=0,rt=0,z=0;z<$.length;z++){var O=$[z],H=j[O.data("source")],Z=j[O.data("target")];if(H&&Z&&H!==Z&&H.getEdgesBetween(Z).length==0){var tt=Q.add(R.newEdge(),H,Z);tt.id=O.id(),tt.idealLength=E(d.idealEdgeLength,O),tt.edgeElasticity=E(d.edgeElasticity,O),X+=tt.idealLength,rt++}}d.idealEdgeLength!=null&&(rt>0?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:a(d.idealEdgeLength)?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,h.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,h.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},S=function(R,Q){Q.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(R.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(h.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(h.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(h.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(h.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(h.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,h.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,h.TILE=d.tile,h.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,h.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,h.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!1),d.step=="enforced"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!1),d.step=="cose"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?h.TREE_REDUCTION_ON_INCREMENTAL=!1:h.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new e,F=D.newGraphManager();return m(F.addRoot(),f.getTopMostNodes(G),D,d),y(D,F,V),S(D,d),D.runLayout(),j};n.exports={coseLayout:T}}),212:((n,r,i)=>{var f=(function(){function d(L,b){for(var w=0;w<b.length;w++){var G=b[w];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(L,G.key,G)}}return function(L,b,w){return b&&d(L.prototype,b),w&&d(L,w),L}})();function e(d,L){if(!(d instanceof L))throw new TypeError("Cannot call a class as a function")}var g=i(658),t=i(548),s=i(657),o=s.spectralLayout,c=i(816),h=c.coseLayout,T=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(L){return 4500},idealEdgeLength:function(L){return 50},edgeElasticity:function(L){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),u=(function(){function d(L){e(this,d),this.options=g({},T,L)}return f(d,[{key:"run",value:function(){var b=this,w=this.options,G=w.cy,V=w.eles,Y=[],B=[],A=void 0,j=[];w.fixedNodeConstraint&&(!Array.isArray(w.fixedNodeConstraint)||w.fixedNodeConstraint.length==0)&&(w.fixedNodeConstraint=void 0),w.alignmentConstraint&&(w.alignmentConstraint.vertical&&(!Array.isArray(w.alignmentConstraint.vertical)||w.alignmentConstraint.vertical.length==0)&&(w.alignmentConstraint.vertical=void 0),w.alignmentConstraint.horizontal&&(!Array.isArray(w.alignmentConstraint.horizontal)||w.alignmentConstraint.horizontal.length==0)&&(w.alignmentConstraint.horizontal=void 0)),w.relativePlacementConstraint&&(!Array.isArray(w.relativePlacementConstraint)||w.relativePlacementConstraint.length==0)&&(w.relativePlacementConstraint=void 0);var a=w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint;a&&(w.tile=!1,w.packComponents=!1);var E=void 0,p=!1;if(G.layoutUtilities&&w.packComponents&&(E=G.layoutUtilities("get"),E||(E=G.layoutUtilities()),p=!0),V.nodes().length>0)if(p){var S=t.getTopMostNodes(w.eles.nodes());if(A=t.connectComponents(G,w.eles,S),A.forEach(function(vt){var it=vt.boundingBox();j.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&A.forEach(function(vt){w.eles=vt,Y.push(o(w))}),w.quality=="default"||w.quality=="proof"){var D=G.collection();if(w.tile){var F=new Map,W=[],R=[],Q=0,$={nodeIndexes:F,xCoords:W,yCoords:R},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||($.nodeIndexes.set(vt.nodes()[Et].id(),Q++),$.xCoords.push(vt.nodes()[0].position().x),$.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();j.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push($);for(var z=X.length-1;z>=0;z--)A.splice(X[z],1),Y.splice(X[z],1),j.splice(X[z],1)}}A.forEach(function(vt,it){w.eles=vt,B.push(h(w,Y[it])),t.relocateComponent(j[it],B[it],w)})}else A.forEach(function(vt,it){t.relocateComponent(j[it],Y[it],w)});var O=new Set;if(A.length>1){var H=[],Z=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(Z).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(Z).forEach(function(Dt){if(w.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else B[it][Dt.id()]&&Et.nodes.push({x:B[it][Dt.id()].getLeft(),y:B[it][Dt.id()].getTop(),width:B[it][Dt.id()].getWidth(),height:B[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(Y[it].xCoords[Ht]),Pt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else B[it][mt.id()]&&B[it][Ot.id()]&&Et.edges.push({startX:B[it][mt.id()].getCenterX(),startY:B[it][mt.id()].getCenterY(),endX:B[it][Ot.id()].getCenterX(),endY:B[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys(B[vt]).forEach(function(it){var ut=B[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(j.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);Y.push(y)}w.quality=="default"||w.quality=="proof"?(B.push(h(w,Y[0])),t.relocateComponent(j[0],B[0],w)):t.relocateComponent(j[0],Y[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return B.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),w.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(G,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});w.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(b,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();n.exports=u}),657:((n,r,i)=>{var f=i(548),e=i(140).layoutBase.Matrix,g=i(140).layoutBase.SVD,t=function(o){var c=o.cy,h=o.eles,T=h.nodes(),u=h.nodes(":parent"),d=new Map,L=new Map,b=new Map,w=[],G=[],V=[],Y=[],B=[],A=[],j=[],a=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,S=o.samplingType,D=o.nodeSeparation,F=void 0,W=function(){for(var U=0,k=0,K=!1;k<F;){U=Math.floor(Math.random()*E),K=!1;for(var q=0;q<k;q++)if(Y[q]==U){K=!0;break}if(!K)Y[k]=U,k++;else continue}},R=function(U,k,K){for(var q=[],at=0,gt=0,nt=0,et=void 0,_=[],dt=0,Mt=1,pt=0;pt<E;pt++)_[pt]=p;for(q[gt]=U,_[U]=0;gt>=at;){nt=q[at++];for(var xt=w[nt],lt=0;lt<xt.length;lt++)et=L.get(xt[lt]),_[et]==p&&(_[et]=_[nt]+1,q[++gt]=et);A[nt][k]=_[nt]*D}if(K){for(var ot=0;ot<E;ot++)A[ot][k]<B[ot]&&(B[ot]=A[ot][k]);for(var Lt=0;Lt<E;Lt++)B[Lt]>dt&&(dt=B[Lt],Mt=Lt)}return Mt},Q=function(U){var k=void 0;if(U){k=Math.floor(Math.random()*E);for(var q=0;q<E;q++)B[q]=p;for(var at=0;at<F;at++)Y[at]=k,k=R(k,at,U)}else{W();for(var K=0;K<F;K++)R(Y[K],K,U)}for(var gt=0;gt<E;gt++)for(var nt=0;nt<F;nt++)A[gt][nt]*=A[gt][nt];for(var et=0;et<F;et++)j[et]=[];for(var _=0;_<F;_++)for(var dt=0;dt<F;dt++)j[_][dt]=A[Y[dt]][_]},$=function(){for(var U=g.svd(j),k=U.S,K=U.U,q=U.V,at=k[0]*k[0]*k[0],gt=[],nt=0;nt<F;nt++){gt[nt]=[];for(var et=0;et<F;et++)gt[nt][et]=0,nt==et&&(gt[nt][et]=k[nt]/(k[nt]*k[nt]+at/(k[nt]*k[nt])))}a=e.multMat(e.multMat(q,gt),e.transpose(K))},X=function(){for(var U=void 0,k=void 0,K=[],q=[],at=[],gt=[],nt=0;nt<E;nt++)K[nt]=Math.random(),q[nt]=Math.random();K=e.normalize(K),q=e.normalize(q);for(var et=m,_=m,dt=void 0;;){for(var Mt=0;Mt<E;Mt++)at[Mt]=K[Mt];if(K=e.multGamma(e.multL(e.multGamma(at),A,a)),U=e.dotProduct(at,K),K=e.normalize(K),et=e.dotProduct(at,K),dt=Math.abs(et/_),dt<=1+y&&dt>=1)break;_=et}for(var pt=0;pt<E;pt++)at[pt]=K[pt];for(_=m;;){for(var xt=0;xt<E;xt++)gt[xt]=q[xt];if(gt=e.minusOp(gt,e.multCons(at,e.dotProduct(at,gt))),q=e.multGamma(e.multL(e.multGamma(gt),A,a)),k=e.dotProduct(gt,q),q=e.normalize(q),et=e.dotProduct(gt,q),dt=Math.abs(et/_),dt<=1+y&&dt>=1)break;_=et}for(var lt=0;lt<E;lt++)gt[lt]=q[lt];G=e.multCons(at,Math.sqrt(Math.abs(U))),V=e.multCons(gt,Math.sqrt(Math.abs(k)))};f.connectComponents(c,h,f.getTopMostNodes(T),d),u.forEach(function(P){f.connectComponents(c,h,f.getTopMostNodes(P.descendants().intersection(h)),d)});for(var rt=0,z=0;z<T.length;z++)T[z].isParent()||L.set(T[z].id(),rt++);var O=!0,H=!1,Z=void 0;try{for(var tt=d.keys()[Symbol.iterator](),ht;!(O=(ht=tt.next()).done);O=!0){var J=ht.value;L.set(J,rt++)}}catch(P){H=!0,Z=P}finally{try{!O&&tt.return&&tt.return()}finally{if(H)throw Z}}for(var It=0;It<L.size;It++)w[It]=[];u.forEach(function(P){for(var U=P.children().intersection(h);U.nodes(":childless").length==0;)U=U.nodes()[0].children().intersection(h);var k=0,K=U.nodes(":childless")[0].connectedEdges().length;U.nodes(":childless").forEach(function(q,at){q.connectedEdges().length<K&&(K=q.connectedEdges().length,k=at)}),b.set(P.id(),U.nodes(":childless")[k].id())}),T.forEach(function(P){var U=void 0;P.isParent()?U=L.get(b.get(P.id())):U=L.get(P.id()),P.neighborhood().nodes().forEach(function(k){h.intersection(P.edgesWith(k)).length>0&&(k.isParent()?w[U].push(b.get(k.id())):w[U].push(k.id()))})});var Nt=function(U){var k=L.get(U),K=void 0;d.get(U).forEach(function(q){c.getElementById(q).isParent()?K=b.get(q):K=q,w[k].push(K),w[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(P){it=!0,ut=P}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){F=E<o.sampleSize?E:o.sampleSize;for(var Ot=0;Ot<E;Ot++)A[Ot]=[];for(var Rt=0;Rt<F;Rt++)a[Rt]=[];return o.quality=="draft"||o.step=="all"?(Q(S),$(),X(),mt={nodeIndexes:L,xCoords:G,yCoords:V}):(L.forEach(function(P,U){G.push(c.getElementById(U).position("x")),V.push(c.getElementById(U).position("y"))}),mt={nodeIndexes:L,xCoords:G,yCoords:V}),mt}else{var Ht=L.keys(),Ut=c.getElementById(Ht.next().value),Pt=Ut.position(),Ft=Ut.outerWidth();if(G.push(Pt.x),V.push(Pt.y),E==2){var Yt=c.getElementById(Ht.next().value),Vt=Yt.outerWidth();G.push(Pt.x+Ft/2+Vt/2+o.idealEdgeLength),V.push(Pt.y)}return mt={nodeIndexes:L,xCoords:G,yCoords:V},mt}};n.exports={spectralLayout:t}}),579:((n,r,i)=>{var f=i(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),n.exports=e}),140:(n=>{n.exports=C})},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(579);return l})()})})(he)),he.exports}var Tr=Er();const Nr=ur(Tr);var Ie={L:"left",R:"right",T:"top",B:"bottom"},Re={L:ct(I=>`${I},${I/2} 0,${I} 0,0`,"L"),R:ct(I=>`0,${I/2} ${I},0 ${I},${I}`,"R"),T:ct(I=>`0,0 ${I},0 ${I/2},${I}`,"T"),B:ct(I=>`${I/2},0 ${I},${I} 0,${I}`,"B")},se={L:ct((I,M)=>I-M+2,"L"),R:ct((I,M)=>I-2,"R"),T:ct((I,M)=>I-M+2,"T"),B:ct((I,M)=>I-2,"B")},Lr=ct(function(I){return Wt(I)?I==="L"?"R":"L":I==="T"?"B":"T"},"getOppositeArchitectureDirection"),Se=ct(function(I){const M=I;return M==="L"||M==="R"||M==="T"||M==="B"},"isArchitectureDirection"),Wt=ct(function(I){const M=I;return M==="L"||M==="R"},"isArchitectureDirectionX"),qt=ct(function(I){const M=I;return M==="T"||M==="B"},"isArchitectureDirectionY"),Ne=ct(function(I,M){const C=Wt(I)&&qt(M),x=qt(I)&&Wt(M);return C||x},"isArchitectureDirectionXY"),wr=ct(function(I){const M=I[0],C=I[1],x=Wt(M)&&qt(C),N=qt(M)&&Wt(C);return x||N},"isArchitecturePairXY"),Cr=ct(function(I){return I!=="LL"&&I!=="RR"&&I!=="TT"&&I!=="BB"},"isValidArchitectureDirectionPair"),ye=ct(function(I,M){const C=`${I}${M}`;return Cr(C)?C:void 0},"getArchitectureDirectionPair"),Mr=ct(function([I,M],C){const x=C[0],N=C[1];return Wt(x)?qt(N)?[I+(x==="L"?-1:1),M+(N==="T"?1:-1)]:[I+(x==="L"?-1:1),M]:Wt(N)?[I+(N==="L"?1:-1),M+(x==="T"?1:-1)]:[I,M+(x==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ar=ct(function(I){return I==="LT"||I==="TL"?[1,1]:I==="BL"||I==="LB"?[1,-1]:I==="BR"||I==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Dr=ct(function(I,M){return Ne(I,M)?"bend":Wt(I)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Or=ct(function(I){return I.type==="service"},"isArchitectureService"),xr=ct(function(I){return I.type==="junction"},"isArchitectureJunction"),Pe=ct((I,M)=>{const[C,x]=[I,M].sort();return`${JSON.stringify(C)}-${JSON.stringify(x)}`},"architectureGroupAlignmentKey"),Ge=ct(I=>I.data(),"edgeData"),ie=ct(I=>I.data(),"nodeData"),Ir=or.architecture,ae,Ue=(ae=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}setDiagramId(M){this.diagramId=M}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:M,icon:C,in:x,title:N,iconText:v}){if(this.registeredIds.has(M))throw new Error(`The service id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The service [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(x)==="node")throw new Error(`The service [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"service",icon:C,iconText:v,title:N,edges:[],in:x})}getServices(){return[...this.nodes.values()].filter(Or)}addJunction({id:M,in:C}){if(this.registeredIds.has(M))throw new Error(`The junction id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(C!==void 0){if(M===C)throw new Error(`The junction [${M}] cannot be placed within itself`);if(!this.registeredIds.has(C))throw new Error(`The junction [${M}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(C)==="node")throw new Error(`The junction [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"junction",edges:[],in:C})}getJunctions(){return[...this.nodes.values()].filter(xr)}getNodes(){return[...this.nodes.values()]}getNode(M){return this.nodes.get(M)??null}addGroup({id:M,icon:C,in:x,title:N}){if(this.registeredIds.has(M))throw new Error(`The group id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The group [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(x)==="node")throw new Error(`The group [${M}]'s parent is not a group`)}this.registeredIds.set(M,"group"),this.groups.set(M,{id:M,icon:C,title:N,in:x})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:M,rhsId:C,lhsDir:x,rhsDir:N,lhsInto:v,rhsInto:l,lhsGroup:n,rhsGroup:r,title:i}){if(!Se(x))throw new Error(`Invalid direction given for left hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(x)}`);if(!Se(N))throw new Error(`Invalid direction given for right hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(N)}`);if(!this.nodes.has(M)&&!this.groups.has(M))throw new Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(C)&&!this.groups.has(C))throw new Error(`The right-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes.get(M).in,e=this.nodes.get(C).in;if(n&&f&&e&&f==e)throw new Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&f&&e&&f==e)throw new Error(`The right-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:M,lhsDir:x,lhsInto:v,lhsGroup:n,rhsId:C,rhsDir:N,rhsInto:l,rhsGroup:r,title:i};this.edges.push(g);const t=this.nodes.get(M),s=this.nodes.get(C);t&&s&&(t.edges.push(this.edges[this.edges.length-1]),s.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(M){if(M.members.length<2)throw new Error(`An align directive requires at least two members; got ${M.members.length}`);const C=new Set;M.members.forEach(x=>{if(this.registeredIds.get(x)!=="node")throw new Error(`align ${M.direction} references [${x}], which is not a service or junction`);if(C.has(x))throw new Error(`align ${M.direction} lists [${x}] more than once`);C.add(x)}),this.layoutHints.push(M)}getLayoutHints(){return this.layoutHints}getDataStructures(){var M,C;if(this.dataStructures===void 0){const x=new Map,N=new Map;for(const[i,f]of this.nodes.entries()){const e=new Map;for(const g of f.edges){const t=(M=this.getNode(g.lhsId))==null?void 0:M.in,s=(C=this.getNode(g.rhsId))==null?void 0:C.in;if(t&&s&&t!==s){const o=Dr(g.lhsDir,g.rhsDir);o!=="bend"&&x.set(Pe(t,s),o)}if(g.lhsId===i){const o=ye(g.lhsDir,g.rhsDir);o&&e.set(o,g.rhsId)}else{const o=ye(g.rhsDir,g.lhsDir);o&&e.set(o,g.lhsId)}}N.set(i,e)}const v=new Set,l=new Set(N.keys()),n=ct(i=>{const f=new Map([[i,[0,0]]]),e=[i];for(;e.length>0;){const g=e.shift();if(g){v.add(g),l.delete(g);const t=N.get(g);if(!t)throw new Error(`BFS error: adjacency list for id ${g} not found. Please report this as a bug.`);const s=f.get(g);if(!s)throw new Error(`BFS error: position for id ${g} not found in spatial map. Please report this as a bug.`);const[o,c]=s;t.forEach((h,T)=>{v.has(h)||(f.set(h,Mr([o,c],T)),e.push(h))})}}return f},"BFS"),r=[];for(;l.size>0;){const i=l.values().next().value;r.push(n(i))}this.dataStructures={adjList:N,spatialMaps:r,groupAlignments:x}}return this.dataStructures}setElementForId(M,C){this.elements.set(M,C)}getElementById(M){return this.elements.get(M)}getConfig(){return ar({...Ir,...nr().architecture})}getConfigField(M){return this.getConfig()[M]}},ct(ae,"ArchitectureDB"),ae),Rr=ct((I,M)=>{var C;qe(I,M),I.groups.map(x=>M.addGroup(x)),I.services.map(x=>M.addService({...x,type:"service"})),I.junctions.map(x=>M.addJunction({...x,type:"junction"})),I.edges.map(x=>M.addEdge(x)),(C=I.alignments)==null||C.map(x=>M.addLayoutHint({direction:x.direction,members:[...x.members]}))},"populateDb"),Ye={parser:{yy:void 0},parse:ct(async I=>{var x;const M=await gr("architecture",I);Fe.debug(M);const C=(x=Ye.parser)==null?void 0:x.yy;if(!(C instanceof Ue))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Rr(M,C)},"parse")},Sr=ct(I=>`
1
+ import{p as qe}from"./chunk-JWPE2WC7-CHcgcd0s.js";import{_ as ct,D as Qe,Y as Je,l as Fe,b as Ke,a as je,n as _e,o as tr,g as er,s as rr,p as ir,A as ar,y as nr,B as or,c as Ee,b5 as Te,ak as pe,i as sr,j as hr,q as lr,al as fr,b6 as cr}from"./MermaidBlock-BO-46Du5.js";import{p as gr}from"./cynefin-OW5HDTMX-Bvt-gEmA.js";import{c as be}from"./cytoscape.esm-BjAbmLdb.js";import{Z as ur}from"./index-DGG5wIZs.js";var he={exports:{}},le={exports:{}},fe={exports:{}},dr=fe.exports,De;function vr(){return De||(De=1,(function(I,M){(function(x,N){I.exports=N()})(dr,function(){return(function(C){var x={};function N(v){if(x[v])return x[v].exports;var l=x[v]={i:v,l:!1,exports:{}};return C[v].call(l.exports,l,l.exports,N),l.l=!0,l.exports}return N.m=C,N.c=x,N.i=function(v){return v},N.d=function(v,l,n){N.o(v,l)||Object.defineProperty(v,l,{configurable:!1,enumerable:!0,get:n})},N.n=function(v){var l=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(l,"a",l),l},N.o=function(v,l){return Object.prototype.hasOwnProperty.call(v,l)},N.p="",N(N.s=28)})([(function(C,x,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,C.exports=v}),(function(C,x,N){var v=N(2),l=N(8),n=N(9);function r(f,e,g){v.call(this,g),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=g,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var i in v)r[i]=v[i];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var g=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(g.getOwner()==e)return g;if(g.getOwner()==t)break;g=g.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.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=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=r}),(function(C,x,N){function v(l){this.vGraphObject=l}C.exports=v}),(function(C,x,N){var v=N(2),l=N(10),n=N(13),r=N(0),i=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new n(s.x,s.y,o.width,o.height):this.rect=new n}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),h=0;h<c.length;h++)s=c[h],o=s.withChildren(),o.forEach(function(T){t.add(T)});return t},e.prototype.getNoOfChildren=function(){var t=0,s;if(this.child==null)t=1;else for(var o=this.child.getNodes(),c=0;c<o.length;c++)s=o[c],t+=s.getNoOfChildren();return t==0&&(t=1),t},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},e.prototype.scatter=function(){var t,s,o=-r.INITIAL_WORLD_BOUNDARY,c=r.INITIAL_WORLD_BOUNDARY;t=r.WORLD_CENTER_X+i.nextDouble()*(c-o)+o;var h=-r.INITIAL_WORLD_BOUNDARY,T=r.INITIAL_WORLD_BOUNDARY;s=r.WORLD_CENTER_Y+i.nextDouble()*(T-h)+h,this.rect.x=t,this.rect.y=s},e.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var s=t.getRight()-t.getLeft(),o=t.getBottom()-t.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(s+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>s?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),h=t.inverseTransformPoint(c);this.setLocation(h.x,h.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},C.exports=e}),(function(C,x,N){var v=N(0);function l(){}for(var n in v)l[n]=v[n];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,C.exports=l}),(function(C,x,N){function v(l,n){l==null&&n==null?(this.x=0,this.y=0):(this.x=l,this.y=n)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(l){this.x=l},v.prototype.setY=function(l){this.y=l},v.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},C.exports=v}),(function(C,x,N){var v=N(2),l=N(10),n=N(0),r=N(7),i=N(3),f=N(1),e=N(13),g=N(12),t=N(11);function s(c,h,T){v.call(this,T),this.estimatedSize=l.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,h!=null&&h instanceof r?this.graphManager=h:h!=null&&h instanceof Layout&&(this.graphManager=h.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,h,T){if(h==null&&T==null){var u=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var d=c;if(!(this.getNodes().indexOf(h)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(h.owner==T.owner&&h.owner==this))throw"Both owners must be this graph!";return h.owner!=T.owner?null:(d.source=h,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),h.edges.push(d),T!=h&&T.edges.push(d),d)}},s.prototype.remove=function(c){var h=c;if(c instanceof i){if(h==null)throw"Node is null!";if(!(h.owner!=null&&h.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=h.edges.slice(),u,d=T.length,L=0;L<d;L++)u=T[L],u.isInterGraph?this.graphManager.remove(u):u.source.owner.remove(u);var b=this.nodes.indexOf(h);if(b==-1)throw"Node not in owner node list!";this.nodes.splice(b,1)}else if(c instanceof f){var u=c;if(u==null)throw"Edge is null!";if(!(u.source!=null&&u.target!=null))throw"Source and/or target is null!";if(!(u.source.owner!=null&&u.target.owner!=null&&u.source.owner==this&&u.target.owner==this))throw"Source and/or target owner is invalid!";var w=u.source.edges.indexOf(u),G=u.target.edges.indexOf(u);if(!(w>-1&&G>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(w,1),u.target!=u.source&&u.target.edges.splice(G,1);var b=u.source.owner.getEdges().indexOf(u);if(b==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(b,1)}},s.prototype.updateLeftTop=function(){for(var c=l.MAX_VALUE,h=l.MAX_VALUE,T,u,d,L=this.getNodes(),b=L.length,w=0;w<b;w++){var G=L[w];T=G.getTop(),u=G.getLeft(),c>T&&(c=T),h>u&&(h=u)}return c==l.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?d=L[0].getParent().paddingLeft:d=this.margin,this.left=h-d,this.top=c-d,new g(this.left,this.top))},s.prototype.updateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,u=l.MAX_VALUE,d=-l.MAX_VALUE,L,b,w,G,V,Y=this.nodes,B=Y.length,A=0;A<B;A++){var j=Y[A];c&&j.child!=null&&j.updateBounds(),L=j.getLeft(),b=j.getRight(),w=j.getTop(),G=j.getBottom(),h>L&&(h=L),T<b&&(T=b),u>w&&(u=w),d<G&&(d=G)}var a=new e(h,u,T-h,d-u);h==l.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),Y[0].getParent().paddingLeft!=null?V=Y[0].getParent().paddingLeft:V=this.margin,this.left=a.x-V,this.right=a.x+a.width+V,this.top=a.y-V,this.bottom=a.y+a.height+V},s.calculateBounds=function(c){for(var h=l.MAX_VALUE,T=-l.MAX_VALUE,u=l.MAX_VALUE,d=-l.MAX_VALUE,L,b,w,G,V=c.length,Y=0;Y<V;Y++){var B=c[Y];L=B.getLeft(),b=B.getRight(),w=B.getTop(),G=B.getBottom(),h>L&&(h=L),T<b&&(T=b),u>w&&(u=w),d<G&&(d=G)}var A=new e(h,u,T-h,d-u);return A},s.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},s.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},s.prototype.calcEstimatedSize=function(){for(var c=0,h=this.nodes,T=h.length,u=0;u<T;u++){var d=h[u];c+=d.calcEstimatedSize()}return c==0?this.estimatedSize=n.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=c/Math.sqrt(this.nodes.length),this.estimatedSize},s.prototype.updateConnected=function(){var c=this;if(this.nodes.length==0){this.isConnected=!0;return}var h=new t,T=new Set,u=this.nodes[0],d,L,b=u.withChildren();for(b.forEach(function(A){h.push(A),T.add(A)});h.length!==0;){u=h.shift(),d=u.getEdges();for(var w=d.length,G=0;G<w;G++){var V=d[G];if(L=V.getOtherEndInGraph(u,this),L!=null&&!T.has(L)){var Y=L.withChildren();Y.forEach(function(A){h.push(A),T.add(A)})}}}if(this.isConnected=!1,T.size>=this.nodes.length){var B=0;T.forEach(function(A){A.owner==c&&B++}),B==this.nodes.length&&(this.isConnected=!0)}},C.exports=s}),(function(C,x,N){var v,l=N(1);function n(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var r=this.layout.newGraph(),i=this.layout.newNode(null),f=this.add(r,i);return this.setRootGraph(f),this.rootGraph},n.prototype.add=function(r,i,f,e,g){if(f==null&&e==null&&g==null){if(r==null)throw"Graph is null!";if(i==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(i.child!=null)throw"Already has a child!";return r.parent=i,i.child=r,r}else{g=f,e=i,f=r;var t=e.getOwner(),s=g.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,g);if(f.isInterGraph=!0,f.source=e,f.target=g,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},n.prototype.remove=function(r){if(r instanceof v){var i=r;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(i==this.rootGraph||i.parent!=null&&i.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(i.getEdges());for(var e,g=f.length,t=0;t<g;t++)e=f[t],i.remove(e);var s=[];s=s.concat(i.getNodes());var o;g=s.length;for(var t=0;t<g;t++)o=s[t],i.remove(o);i==this.rootGraph&&this.setRootGraph(null);var c=this.graphs.indexOf(i);this.graphs.splice(c,1),i.parent=null}else if(r instanceof l){if(e=r,e==null)throw"Edge is null!";if(!e.isInterGraph)throw"Not an inter-graph edge!";if(!(e.source!=null&&e.target!=null))throw"Source and/or target is null!";if(!(e.source.edges.indexOf(e)!=-1&&e.target.edges.indexOf(e)!=-1))throw"Source and/or target doesn't know this edge!";var c=e.source.edges.indexOf(e);if(e.source.edges.splice(c,1),c=e.target.edges.indexOf(e),e.target.edges.splice(c,1),!(e.source.owner!=null&&e.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(e.source.owner.getGraphManager().edges.indexOf(e)==-1)throw"Not in owner graph manager's edge list!";var c=e.source.owner.getGraphManager().edges.indexOf(e);e.source.owner.getGraphManager().edges.splice(c,1)}},n.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},n.prototype.getGraphs=function(){return this.graphs},n.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],i=this.getGraphs(),f=i.length,e=0;e<f;e++)r=r.concat(i[e].getNodes());this.allNodes=r}return this.allNodes},n.prototype.resetAllNodes=function(){this.allNodes=null},n.prototype.resetAllEdges=function(){this.allEdges=null},n.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},n.prototype.getAllEdges=function(){if(this.allEdges==null){var r=[],i=this.getGraphs();i.length;for(var f=0;f<i.length;f++)r=r.concat(i[f].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},n.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},n.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},n.prototype.getRoot=function(){return this.rootGraph},n.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},n.prototype.getLayout=function(){return this.layout},n.prototype.isOneAncestorOfOther=function(r,i){if(!(r!=null&&i!=null))throw"assert failed";if(r==i)return!0;var f=r.getOwner(),e;do{if(e=f.getParent(),e==null)break;if(e==i)return!0;if(f=e.getOwner(),f==null)break}while(!0);f=i.getOwner();do{if(e=f.getParent(),e==null)break;if(e==r)return!0;if(f=e.getOwner(),f==null)break}while(!0);return!1},n.prototype.calcLowestCommonAncestors=function(){for(var r,i,f,e,g,t=this.getAllEdges(),s=t.length,o=0;o<s;o++){if(r=t[o],i=r.source,f=r.target,r.lca=null,r.sourceInLca=i,r.targetInLca=f,i==f){r.lca=i.getOwner();continue}for(e=i.getOwner();r.lca==null;){for(r.targetInLca=f,g=f.getOwner();r.lca==null;){if(g==e){r.lca=g;break}if(g==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=g.getParent(),g=r.targetInLca.getOwner()}if(e==this.rootGraph)break;r.lca==null&&(r.sourceInLca=e.getParent(),e=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},n.prototype.calcLowestCommonAncestor=function(r,i){if(r==i)return r.getOwner();var f=r.getOwner();do{if(f==null)break;var e=i.getOwner();do{if(e==null)break;if(e==f)return e;e=e.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},n.prototype.calcInclusionTreeDepths=function(r,i){r==null&&i==null&&(r=this.rootGraph,i=1);for(var f,e=r.getNodes(),g=e.length,t=0;t<g;t++)f=e[t],f.inclusionTreeDepth=i,f.child!=null&&this.calcInclusionTreeDepths(f.child,i+1)},n.prototype.includesInvalidEdge=function(){for(var r,i=[],f=this.edges.length,e=0;e<f;e++)r=this.edges[e],this.isOneAncestorOfOther(r.source,r.target)&&i.push(r);for(var e=0;e<i.length;e++)this.remove(i[e]);return!1},C.exports=n}),(function(C,x,N){var v=N(12);function l(){}l.calcSeparationAmount=function(n,r,i,f){if(!n.intersects(r))throw"assert failed";var e=new Array(2);this.decideDirectionsForOverlappingNodes(n,r,e),i[0]=Math.min(n.getRight(),r.getRight())-Math.max(n.x,r.x),i[1]=Math.min(n.getBottom(),r.getBottom())-Math.max(n.y,r.y),n.getX()<=r.getX()&&n.getRight()>=r.getRight()?i[0]+=Math.min(r.getX()-n.getX(),n.getRight()-r.getRight()):r.getX()<=n.getX()&&r.getRight()>=n.getRight()&&(i[0]+=Math.min(n.getX()-r.getX(),r.getRight()-n.getRight())),n.getY()<=r.getY()&&n.getBottom()>=r.getBottom()?i[1]+=Math.min(r.getY()-n.getY(),n.getBottom()-r.getBottom()):r.getY()<=n.getY()&&r.getBottom()>=n.getBottom()&&(i[1]+=Math.min(n.getY()-r.getY(),r.getBottom()-n.getBottom()));var g=Math.abs((r.getCenterY()-n.getCenterY())/(r.getCenterX()-n.getCenterX()));r.getCenterY()===n.getCenterY()&&r.getCenterX()===n.getCenterX()&&(g=1);var t=g*i[0],s=i[1]/g;i[0]<s?s=i[0]:t=i[1],i[0]=-1*e[0]*(s/2+f),i[1]=-1*e[1]*(t/2+f)},l.decideDirectionsForOverlappingNodes=function(n,r,i){n.getCenterX()<r.getCenterX()?i[0]=-1:i[0]=1,n.getCenterY()<r.getCenterY()?i[1]=-1:i[1]=1},l.getIntersection2=function(n,r,i){var f=n.getCenterX(),e=n.getCenterY(),g=r.getCenterX(),t=r.getCenterY();if(n.intersects(r))return i[0]=f,i[1]=e,i[2]=g,i[3]=t,!0;var s=n.getX(),o=n.getY(),c=n.getRight(),h=n.getX(),T=n.getBottom(),u=n.getRight(),d=n.getWidthHalf(),L=n.getHeightHalf(),b=r.getX(),w=r.getY(),G=r.getRight(),V=r.getX(),Y=r.getBottom(),B=r.getRight(),A=r.getWidthHalf(),j=r.getHeightHalf(),a=!1,E=!1;if(f===g){if(e>t)return i[0]=f,i[1]=o,i[2]=g,i[3]=Y,!1;if(e<t)return i[0]=f,i[1]=T,i[2]=g,i[3]=w,!1}else if(e===t){if(f>g)return i[0]=s,i[1]=e,i[2]=G,i[3]=t,!1;if(f<g)return i[0]=c,i[1]=e,i[2]=b,i[3]=t,!1}else{var p=n.height/n.width,m=r.height/r.width,y=(t-e)/(g-f),S=void 0,D=void 0,F=void 0,W=void 0,R=void 0,Q=void 0;if(-p===y?f>g?(i[0]=h,i[1]=T,a=!0):(i[0]=c,i[1]=o,a=!0):p===y&&(f>g?(i[0]=s,i[1]=o,a=!0):(i[0]=u,i[1]=T,a=!0)),-m===y?g>f?(i[2]=V,i[3]=Y,E=!0):(i[2]=G,i[3]=w,E=!0):m===y&&(g>f?(i[2]=b,i[3]=w,E=!0):(i[2]=B,i[3]=Y,E=!0)),a&&E)return!1;if(f>g?e>t?(S=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(S=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):e>t?(S=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(S=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!a)switch(S){case 1:W=o,F=f+-L/y,i[0]=F,i[1]=W;break;case 2:F=u,W=e+d*y,i[0]=F,i[1]=W;break;case 3:W=T,F=f+L/y,i[0]=F,i[1]=W;break;case 4:F=h,W=e+-d*y,i[0]=F,i[1]=W;break}if(!E)switch(D){case 1:Q=w,R=g+-j/y,i[2]=R,i[3]=Q;break;case 2:R=B,Q=t+A*y,i[2]=R,i[3]=Q;break;case 3:Q=Y,R=g+j/y,i[2]=R,i[3]=Q;break;case 4:R=V,Q=t+-A*y,i[2]=R,i[3]=Q;break}}return!1},l.getCardinalDirection=function(n,r,i){return n>r?i:1+i%4},l.getIntersection=function(n,r,i,f){if(f==null)return this.getIntersection2(n,r,i);var e=n.x,g=n.y,t=r.x,s=r.y,o=i.x,c=i.y,h=f.x,T=f.y,u=void 0,d=void 0,L=void 0,b=void 0,w=void 0,G=void 0,V=void 0,Y=void 0,B=void 0;return L=s-g,w=e-t,V=t*g-e*s,b=T-c,G=o-h,Y=h*c-o*T,B=L*G-b*w,B===0?null:(u=(w*Y-G*V)/B,d=(b*V-L*Y)/B,new v(u,d))},l.angleOfVector=function(n,r,i,f){var e=void 0;return n!==i?(e=Math.atan((f-r)/(i-n)),i<n?e+=Math.PI:f<r&&(e+=this.TWO_PI)):f<r?e=this.ONE_AND_HALF_PI:e=this.HALF_PI,e},l.doIntersect=function(n,r,i,f){var e=n.x,g=n.y,t=r.x,s=r.y,o=i.x,c=i.y,h=f.x,T=f.y,u=(t-e)*(T-c)-(h-o)*(s-g);if(u===0)return!1;var d=((T-c)*(h-e)+(o-h)*(T-g))/u,L=((g-s)*(h-e)+(t-e)*(T-g))/u;return 0<d&&d<1&&0<L&&L<1},l.findCircleLineIntersections=function(n,r,i,f,e,g,t){var s=(i-n)*(i-n)+(f-r)*(f-r),o=2*((n-e)*(i-n)+(r-g)*(f-r)),c=(n-e)*(n-e)+(r-g)*(r-g)-t*t,h=o*o-4*s*c;if(h>=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),u=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:u>=0&&u<=1?[u]:d}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,C.exports=l}),(function(C,x,N){function v(){}v.sign=function(l){return l>0?1:l<0?-1:0},v.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},v.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},C.exports=v}),(function(C,x,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,C.exports=v}),(function(C,x,N){var v=(function(){function e(g,t){for(var s=0;s<t.length;s++){var o=t[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(g,o.key,o)}}return function(g,t,s){return t&&e(g.prototype,t),s&&e(g,s),g}})();function l(e,g){if(!(e instanceof g))throw new TypeError("Cannot call a class as a function")}var n=function(g){return{value:g,next:null,prev:null}},r=function(g,t,s,o){return g!==null?g.next=t:o.head=t,s!==null?s.prev=t:o.tail=t,t.prev=g,t.next=s,o.length++,t},i=function(g,t){var s=g.prev,o=g.next;return s!==null?s.next=o:t.head=o,o!==null?o.prev=s:t.tail=s,g.prev=g.next=null,t.length--,g},f=(function(){function e(g){var t=this;l(this,e),this.length=0,this.head=null,this.tail=null,g!=null&&g.forEach(function(s){return t.push(s)})}return v(e,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,s){return r(s.prev,n(t),s,this)}},{key:"insertAfter",value:function(t,s){return r(s,n(t),s.next,this)}},{key:"insertNodeBefore",value:function(t,s){return r(s.prev,t,s,this)}},{key:"insertNodeAfter",value:function(t,s){return r(s,t,s.next,this)}},{key:"push",value:function(t){return r(this.tail,n(t),null,this)}},{key:"unshift",value:function(t){return r(null,n(t),this.head,this)}},{key:"remove",value:function(t){return i(t,this)}},{key:"pop",value:function(){return i(this.tail,this).value}},{key:"popNode",value:function(){return i(this.tail,this)}},{key:"shift",value:function(){return i(this.head,this).value}},{key:"shiftNode",value:function(){return i(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var s=1,o=this.head;s<t;)o=o.next,s++;return o.value}}},{key:"set_object_at",value:function(t,s){if(t<=this.length()){for(var o=1,c=this.head;o<t;)c=c.next,o++;c.value=s}}}]),e})();C.exports=f}),(function(C,x,N){function v(l,n,r){this.x=null,this.y=null,l==null&&n==null&&r==null?(this.x=0,this.y=0):typeof l=="number"&&typeof n=="number"&&r==null?(this.x=l,this.y=n):l.constructor.name=="Point"&&n==null&&r==null&&(r=l,this.x=r.x,this.y=r.y)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(l,n,r){l.constructor.name=="Point"&&n==null&&r==null?(r=l,this.setLocation(r.x,r.y)):typeof l=="number"&&typeof n=="number"&&r==null&&(parseInt(l)==l&&parseInt(n)==n?this.move(l,n):(this.x=Math.floor(l+.5),this.y=Math.floor(n+.5)))},v.prototype.move=function(l,n){this.x=l,this.y=n},v.prototype.translate=function(l,n){this.x+=l,this.y+=n},v.prototype.equals=function(l){if(l.constructor.name=="Point"){var n=l;return this.x==n.x&&this.y==n.y}return this==l},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},C.exports=v}),(function(C,x,N){function v(l,n,r,i){this.x=0,this.y=0,this.width=0,this.height=0,l!=null&&n!=null&&r!=null&&i!=null&&(this.x=l,this.y=n,this.width=r,this.height=i)}v.prototype.getX=function(){return this.x},v.prototype.setX=function(l){this.x=l},v.prototype.getY=function(){return this.y},v.prototype.setY=function(l){this.y=l},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(l){this.width=l},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(l){this.height=l},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(l){return!(this.getRight()<l.x||this.getBottom()<l.y||l.getRight()<this.x||l.getBottom()<this.y)},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},C.exports=v}),(function(C,x,N){var v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function l(){}l.lastID=0,l.createID=function(n){return l.isPrimitive(n)?n:(n.uniqueID!=null||(n.uniqueID=l.getString(),l.lastID++),n.uniqueID)},l.getString=function(n){return n==null&&(n=l.lastID),"Object#"+n},l.isPrimitive=function(n){var r=typeof n>"u"?"undefined":v(n);return n==null||r!="object"&&r!="function"},C.exports=l}),(function(C,x,N){function v(o){if(Array.isArray(o)){for(var c=0,h=Array(o.length);c<o.length;c++)h[c]=o[c];return h}else return Array.from(o)}var l=N(0),n=N(7),r=N(3),i=N(1),f=N(6),e=N(5),g=N(17),t=N(29);function s(o){t.call(this),this.layoutQuality=l.QUALITY,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=l.DEFAULT_INCREMENTAL,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new n(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,o!=null&&(this.isRemoteUse=o)}s.RANDOM_SEED=1,s.prototype=Object.create(t.prototype),s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},s.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},s.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},s.prototype.newGraphManager=function(){var o=new n(this);return this.graphManager=o,o},s.prototype.newGraph=function(o){return new f(null,this.graphManager,o)},s.prototype.newNode=function(o){return new r(this.graphManager,o)},s.prototype.newEdge=function(o){return new i(null,null,o)},s.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},s.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var o;return this.checkLayoutSuccess()?o=!1:o=this.layout(),l.ANIMATE==="during"?!1:(o&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,o)},s.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},s.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var o=this.graphManager.getAllEdges(),c=0;c<o.length;c++)o[c];for(var h=this.graphManager.getRoot().getNodes(),c=0;c<h.length;c++)h[c];this.update(this.graphManager.getRoot())}},s.prototype.update=function(o){if(o==null)this.update2();else if(o instanceof r){var c=o;if(c.getChild()!=null)for(var h=c.getChild().getNodes(),T=0;T<h.length;T++)update(h[T]);if(c.vGraphObject!=null){var u=c.vGraphObject;u.update(c)}}else if(o instanceof i){var d=o;if(d.vGraphObject!=null){var L=d.vGraphObject;L.update(d)}}else if(o instanceof f){var b=o;if(b.vGraphObject!=null){var w=b.vGraphObject;w.update(b)}}},s.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=l.QUALITY,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=l.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},s.prototype.transform=function(o){if(o==null)this.transform(new e(0,0));else{var c=new g,h=this.graphManager.getRoot().updateLeftTop();if(h!=null){c.setWorldOrgX(o.x),c.setWorldOrgY(o.y),c.setDeviceOrgX(h.x),c.setDeviceOrgY(h.y);for(var T=this.getAllNodes(),u,d=0;d<T.length;d++)u=T[d],u.transform(c)}}},s.prototype.positionNodesRandomly=function(o){if(o==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var c,h,T=o.getNodes(),u=0;u<T.length;u++)c=T[u],h=c.getChild(),h==null||h.getNodes().length==0?c.scatter():(this.positionNodesRandomly(h),c.updateBounds())},s.prototype.getFlatForest=function(){for(var o=[],c=!0,h=this.graphManager.getRoot().getNodes(),T=!0,u=0;u<h.length;u++)h[u].getChild()!=null&&(T=!1);if(!T)return o;var d=new Set,L=[],b=new Map,w=[];for(w=w.concat(h);w.length>0&&c;){for(L.push(w[0]);L.length>0&&c;){var G=L[0];L.splice(0,1),d.add(G);for(var V=G.getEdges(),u=0;u<V.length;u++){var Y=V[u].getOtherEnd(G);if(b.get(G)!=Y)if(!d.has(Y))L.push(Y),b.set(Y,G);else{c=!1;break}}}if(!c)o=[];else{var B=[].concat(v(d));o.push(B);for(var u=0;u<B.length;u++){var A=B[u],j=w.indexOf(A);j>-1&&w.splice(j,1)}d=new Set,b=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],h=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),u=0;u<o.bendpoints.length;u++){var d=this.newNode(null);d.setRect(new Point(0,0),new Dimension(1,1)),T.add(d);var L=this.newEdge(null);this.graphManager.add(L,h,d),c.add(d),h=d}var L=this.newEdge(null);return this.graphManager.add(L,h,o.target),this.edgeToDummyNodes.set(o,c),o.isInterGraph()?this.graphManager.remove(o):T.remove(o),c},s.prototype.createBendpointsFromDummyNodes=function(){var o=[];o=o.concat(this.graphManager.getAllEdges()),o=[].concat(v(this.edgeToDummyNodes.keys())).concat(o);for(var c=0;c<o.length;c++){var h=o[c];if(h.bendpoints.length>0){for(var T=this.edgeToDummyNodes.get(h),u=0;u<T.length;u++){var d=T[u],L=new e(d.getCenterX(),d.getCenterY()),b=h.bendpoints.get(u);b.x=L.x,b.y=L.y,d.getOwner().remove(d)}this.graphManager.add(h,h.source,h.target)}}},s.transform=function(o,c,h,T){if(h!=null&&T!=null){var u=c;if(o<=50){var d=c/h;u-=(c-d)/50*(50-o)}else{var L=c*T;u+=(L-c)/50*(o-50)}return u}else{var b,w;return o<=50?(b=9*c/500,w=c/10):(b=9*c/50,w=-8*c),b*o+w}},s.findCenterOfTree=function(o){var c=[];c=c.concat(o);var h=[],T=new Map,u=!1,d=null;(c.length==1||c.length==2)&&(u=!0,d=c[0]);for(var L=0;L<c.length;L++){var b=c[L],w=b.getNeighborsList().size;T.set(b,b.getNeighborsList().size),w==1&&h.push(b)}var G=[];for(G=G.concat(h);!u;){var V=[];V=V.concat(G),G=[];for(var L=0;L<c.length;L++){var b=c[L],Y=c.indexOf(b);Y>=0&&c.splice(Y,1);var B=b.getNeighborsList();B.forEach(function(a){if(h.indexOf(a)<0){var E=T.get(a),p=E-1;p==1&&G.push(a),T.set(a,p)}})}h=h.concat(G),(c.length==1||c.length==2)&&(u=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},C.exports=s}),(function(C,x,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},C.exports=v}),(function(C,x,N){var v=N(5);function l(n,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(n){this.lworldExtX=n},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(n){this.lworldExtY=n},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},l.prototype.transformX=function(n){var r=0,i=this.lworldExtX;return i!=0&&(r=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/i),r},l.prototype.transformY=function(n){var r=0,i=this.lworldExtY;return i!=0&&(r=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/i),r},l.prototype.inverseTransformX=function(n){var r=0,i=this.ldeviceExtX;return i!=0&&(r=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/i),r},l.prototype.inverseTransformY=function(n){var r=0,i=this.ldeviceExtY;return i!=0&&(r=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/i),r},l.prototype.inverseTransformPoint=function(n){var r=new v(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return r},C.exports=l}),(function(C,x,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);s<t.length;s++)o[s]=t[s];return o}else return Array.from(t)}var l=N(15),n=N(4),r=N(0),i=N(8),f=N(9);function e(){l.call(this),this.useSmartIdealEdgeLengthCalculation=n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=n.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=n.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=n.MAX_ITERATIONS}e.prototype=Object.create(l.prototype);for(var g in l)e[g]=l[g];e.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},e.prototype.calcIdealEdgeLengths=function(){for(var t,s,o,c,h,T,u,d=this.getGraphManager().getAllEdges(),L=0;L<d.length;L++)t=d[L],s=t.idealLength,t.isInterGraph&&(c=t.getSource(),h=t.getTarget(),T=t.getSourceInLca().getEstimatedSize(),u=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=T+u-2*r.SIMPLE_NODE_SIZE),o=t.getLca().getInclusionTreeDepth(),t.idealLength+=s*n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(c.getInclusionTreeDepth()+h.getInclusionTreeDepth()-2*o))},e.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>n.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(t-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o<t.length;o++)s=t[o],this.calcSpringForce(s,s.idealLength)},e.prototype.calcRepulsionForces=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,h,T,u=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;o<u.length;o++)h=u[o],this.calculateRepulsionForceOfANode(h,d,t,s),d.add(h);else for(o=0;o<u.length;o++)for(h=u[o],c=o+1;c<u.length;c++)T=u[c],h.getOwner()==T.getOwner()&&this.calcRepulsionForce(h,T)},e.prototype.calcGravitationalForces=function(){for(var t,s=this.getAllNodesToApplyGravitation(),o=0;o<s.length;o++)t=s[o],this.calcGravitationalForce(t)},e.prototype.moveNodes=function(){for(var t=this.getAllNodes(),s,o=0;o<t.length;o++)s=t[o],s.move()},e.prototype.calcSpringForce=function(t,s){var o=t.getSource(),c=t.getTarget(),h,T,u,d;if(this.uniformLeafNodeSizes&&o.getChild()==null&&c.getChild()==null)t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;h=t.getLength(),h!=0&&(T=t.edgeElasticity*(h-s),u=T*(t.lengthX/h),d=T*(t.lengthY/h),o.springForceX+=u,o.springForceY+=d,c.springForceX-=u,c.springForceY-=d)},e.prototype.calcRepulsionForce=function(t,s){var o=t.getRect(),c=s.getRect(),h=new Array(2),T=new Array(4),u,d,L,b,w,G,V;if(o.intersects(c)){i.calcSeparationAmount(o,c,h,n.DEFAULT_EDGE_LENGTH/2),G=2*h[0],V=2*h[1];var Y=t.noOfChildren*s.noOfChildren/(t.noOfChildren+s.noOfChildren);t.repulsionForceX-=Y*G,t.repulsionForceY-=Y*V,s.repulsionForceX+=Y*G,s.repulsionForceY+=Y*V}else this.uniformLeafNodeSizes&&t.getChild()==null&&s.getChild()==null?(u=c.getCenterX()-o.getCenterX(),d=c.getCenterY()-o.getCenterY()):(i.getIntersection(o,c,T),u=T[2]-T[0],d=T[3]-T[1]),Math.abs(u)<n.MIN_REPULSION_DIST&&(u=f.sign(u)*n.MIN_REPULSION_DIST),Math.abs(d)<n.MIN_REPULSION_DIST&&(d=f.sign(d)*n.MIN_REPULSION_DIST),L=u*u+d*d,b=Math.sqrt(L),w=(t.nodeRepulsion/2+s.nodeRepulsion/2)*t.noOfChildren*s.noOfChildren/L,G=w*u/b,V=w*d/b,t.repulsionForceX-=G,t.repulsionForceY-=V,s.repulsionForceX+=G,s.repulsionForceY+=V},e.prototype.calcGravitationalForce=function(t){var s,o,c,h,T,u,d,L;s=t.getOwner(),o=(s.getRight()+s.getLeft())/2,c=(s.getTop()+s.getBottom())/2,h=t.getCenterX()-o,T=t.getCenterY()-c,u=Math.abs(h)+t.getWidth()/2,d=Math.abs(T)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(L=s.getEstimatedSize()*this.gravityRangeFactor,(u>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*h,t.gravitationForceY=-this.gravityConstant*T)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(u>L||d>L)&&(t.gravitationForceX=-this.gravityConstant*h*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||s},e.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},e.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,s=this.graphManager.getAllNodes(),o=0;o<s.length;o++)t=s[o],t.noOfChildren=t.getNoOfChildren()},e.prototype.calcGrid=function(t){var s=0,o=0;s=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),o=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var c=new Array(s),h=0;h<s;h++)c[h]=new Array(o);for(var h=0;h<s;h++)for(var T=0;T<o;T++)c[h][T]=new Array;return c},e.prototype.addNodeToGrid=function(t,s,o){var c=0,h=0,T=0,u=0;c=parseInt(Math.floor((t.getRect().x-s)/this.repulsionRange)),h=parseInt(Math.floor((t.getRect().width+t.getRect().x-s)/this.repulsionRange)),T=parseInt(Math.floor((t.getRect().y-o)/this.repulsionRange)),u=parseInt(Math.floor((t.getRect().height+t.getRect().y-o)/this.repulsionRange));for(var d=c;d<=h;d++)for(var L=T;L<=u;L++)this.grid[d][L].push(t),t.setGridCoordinates(c,h,T,u)},e.prototype.updateGrid=function(){var t,s,o=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<o.length;t++)s=o[t],this.addNodeToGrid(s,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},e.prototype.calculateRepulsionForceOfANode=function(t,s,o,c){if(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&o||c){var h=new Set;t.surrounding=new Array;for(var T,u=this.grid,d=t.startX-1;d<t.finishX+2;d++)for(var L=t.startY-1;L<t.finishY+2;L++)if(!(d<0||L<0||d>=u.length||L>=u[0].length)){for(var b=0;b<u[d][L].length;b++)if(T=u[d][L][b],!(t.getOwner()!=T.getOwner()||t==T)&&!s.has(T)&&!h.has(T)){var w=Math.abs(t.getCenterX()-T.getCenterX())-(t.getWidth()/2+T.getWidth()/2),G=Math.abs(t.getCenterY()-T.getCenterY())-(t.getHeight()/2+T.getHeight()/2);w<=this.repulsionRange&&G<=this.repulsionRange&&h.add(T)}}t.surrounding=[].concat(v(h))}for(d=0;d<t.surrounding.length;d++)this.calcRepulsionForce(t,t.surrounding[d])},e.prototype.calcRepulsionRange=function(){return 0},C.exports=e}),(function(C,x,N){var v=N(1),l=N(4);function n(i,f,e){v.call(this,i,f,e),this.idealLength=l.DEFAULT_EDGE_LENGTH,this.edgeElasticity=l.DEFAULT_SPRING_STRENGTH}n.prototype=Object.create(v.prototype);for(var r in v)n[r]=v[r];C.exports=n}),(function(C,x,N){var v=N(3),l=N(4);function n(i,f,e,g){v.call(this,i,f,e,g),this.nodeRepulsion=l.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}n.prototype=Object.create(v.prototype);for(var r in v)n[r]=v[r];n.prototype.setGridCoordinates=function(i,f,e,g){this.startX=i,this.finishX=f,this.startY=e,this.finishY=g},C.exports=n}),(function(C,x,N){function v(l,n){this.width=0,this.height=0,l!==null&&n!==null&&(this.height=n,this.width=l)}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(l){this.width=l},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(l){this.height=l},C.exports=v}),(function(C,x,N){var v=N(14);function l(){this.map={},this.keys=[]}l.prototype.put=function(n,r){var i=v.createID(n);this.contains(i)||(this.map[i]=r,this.keys.push(n))},l.prototype.contains=function(n){return v.createID(n),this.map[n]!=null},l.prototype.get=function(n){var r=v.createID(n);return this.map[r]},l.prototype.keySet=function(){return this.keys},C.exports=l}),(function(C,x,N){var v=N(14);function l(){this.set={}}l.prototype.add=function(n){var r=v.createID(n);this.contains(r)||(this.set[r]=n)},l.prototype.remove=function(n){delete this.set[v.createID(n)]},l.prototype.clear=function(){this.set={}},l.prototype.contains=function(n){return this.set[v.createID(n)]==n},l.prototype.isEmpty=function(){return this.size()===0},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAllTo=function(n){for(var r=Object.keys(this.set),i=r.length,f=0;f<i;f++)n.push(this.set[r[f]])},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAll=function(n){for(var r=n.length,i=0;i<r;i++){var f=n[i];this.add(f)}},C.exports=l}),(function(C,x,N){function v(){}v.multMat=function(l,n){for(var r=[],i=0;i<l.length;i++){r[i]=[];for(var f=0;f<n[0].length;f++){r[i][f]=0;for(var e=0;e<l[0].length;e++)r[i][f]+=l[i][e]*n[e][f]}}return r},v.transpose=function(l){for(var n=[],r=0;r<l[0].length;r++){n[r]=[];for(var i=0;i<l.length;i++)n[r][i]=l[i][r]}return n},v.multCons=function(l,n){for(var r=[],i=0;i<l.length;i++)r[i]=l[i]*n;return r},v.minusOp=function(l,n){for(var r=[],i=0;i<l.length;i++)r[i]=l[i]-n[i];return r},v.dotProduct=function(l,n){for(var r=0,i=0;i<l.length;i++)r+=l[i]*n[i];return r},v.mag=function(l){return Math.sqrt(this.dotProduct(l,l))},v.normalize=function(l){for(var n=[],r=this.mag(l),i=0;i<l.length;i++)n[i]=l[i]/r;return n},v.multGamma=function(l){for(var n=[],r=0,i=0;i<l.length;i++)r+=l[i];r*=-1/l.length;for(var f=0;f<l.length;f++)n[f]=r+l[f];return n},v.multL=function(l,n,r){for(var i=[],f=[],e=[],g=0;g<n[0].length;g++){for(var t=0,s=0;s<n.length;s++)t+=-.5*n[s][g]*l[s];f[g]=t}for(var o=0;o<r.length;o++){for(var c=0,h=0;h<r.length;h++)c+=r[o][h]*f[h];e[o]=c}for(var T=0;T<n.length;T++){for(var u=0,d=0;d<n[0].length;d++)u+=n[T][d]*e[d];i[T]=u}return i},C.exports=v}),(function(C,x,N){var v=(function(){function i(f,e){for(var g=0;g<e.length;g++){var t=e[g];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(f,t.key,t)}}return function(f,e,g){return e&&i(f.prototype,e),g&&i(f,g),f}})();function l(i,f){if(!(i instanceof f))throw new TypeError("Cannot call a class as a function")}var n=N(11),r=(function(){function i(f,e){l(this,i),(e!==null||e!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var g=void 0;f instanceof n?g=f.size():g=f.length,this._quicksort(f,0,g-1)}return v(i,[{key:"_quicksort",value:function(e,g,t){if(g<t){var s=this._partition(e,g,t);this._quicksort(e,g,s),this._quicksort(e,s+1,t)}}},{key:"_partition",value:function(e,g,t){for(var s=this._get(e,g),o=g,c=t;;){for(;this.compareFunction(s,this._get(e,c));)c--;for(;this.compareFunction(this._get(e,o),s);)o++;if(o<c)this._swap(e,o,c),o++,c--;else return c}}},{key:"_get",value:function(e,g){return e instanceof n?e.get_object_at(g):e[g]}},{key:"_set",value:function(e,g,t){e instanceof n?e.set_object_at(g,t):e[g]=t}},{key:"_swap",value:function(e,g,t){var s=this._get(e,g);this._set(e,g,this._get(e,t)),this._set(e,t,s)}},{key:"_defaultCompareFunction",value:function(e,g){return g>e}}]),i})();C.exports=r}),(function(C,x,N){function v(){}v.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var n=Math.min(this.m,this.n);this.s=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var wt=function zt(bt){if(bt.length==0)return 0;for(var $t=[],St=0;St<bt[0];St++)$t.push(zt(bt.slice(1)));return $t};return wt(Tt)})([this.m,n]),this.V=(function(Tt){var wt=function zt(bt){if(bt.length==0)return 0;for(var $t=[],St=0;St<bt[0];St++)$t.push(zt(bt.slice(1)));return $t};return wt(Tt)})([this.n,this.n]);for(var r=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(this.n),i=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(this.m),f=!0,e=Math.min(this.m-1,this.n),g=Math.max(0,Math.min(this.n-2,this.m)),t=0;t<Math.max(e,g);t++){if(t<e){this.s[t]=0;for(var s=t;s<this.m;s++)this.s[t]=v.hypot(this.s[t],l[s][t]);if(this.s[t]!==0){l[t][t]<0&&(this.s[t]=-this.s[t]);for(var o=t;o<this.m;o++)l[o][t]/=this.s[t];l[t][t]+=1}this.s[t]=-this.s[t]}for(var c=t+1;c<this.n;c++){if((function(Tt,wt){return Tt&&wt})(t<e,this.s[t]!==0)){for(var h=0,T=t;T<this.m;T++)h+=l[T][t]*l[T][c];h=-h/l[t][t];for(var u=t;u<this.m;u++)l[u][c]+=h*l[u][t]}r[c]=l[t][c]}if((function(Tt,wt){return wt})(f,t<e))for(var d=t;d<this.m;d++)this.U[d][t]=l[d][t];if(t<g){r[t]=0;for(var L=t+1;L<this.n;L++)r[t]=v.hypot(r[t],r[L]);if(r[t]!==0){r[t+1]<0&&(r[t]=-r[t]);for(var b=t+1;b<this.n;b++)r[b]/=r[t];r[t+1]+=1}if(r[t]=-r[t],(function(Tt,wt){return Tt&&wt})(t+1<this.m,r[t]!==0)){for(var w=t+1;w<this.m;w++)i[w]=0;for(var G=t+1;G<this.n;G++)for(var V=t+1;V<this.m;V++)i[V]+=r[G]*l[V][G];for(var Y=t+1;Y<this.n;Y++)for(var B=-r[Y]/r[t+1],A=t+1;A<this.m;A++)l[A][Y]+=B*i[A]}for(var j=t+1;j<this.n;j++)this.V[j][t]=r[j]}}var a=Math.min(this.n,this.m+1);e<this.n&&(this.s[e]=l[e][e]),this.m<a&&(this.s[a-1]=0),g+1<a&&(r[g]=l[g][a-1]),r[a-1]=0;{for(var E=e;E<n;E++){for(var p=0;p<this.m;p++)this.U[p][E]=0;this.U[E][E]=1}for(var m=e-1;m>=0;m--)if(this.s[m]!==0){for(var y=m+1;y<n;y++){for(var S=0,D=m;D<this.m;D++)S+=this.U[D][m]*this.U[D][y];S=-S/this.U[m][m];for(var F=m;F<this.m;F++)this.U[F][y]+=S*this.U[F][m]}for(var W=m;W<this.m;W++)this.U[W][m]=-this.U[W][m];this.U[m][m]=1+this.U[m][m];for(var R=0;R<m-1;R++)this.U[R][m]=0}else{for(var Q=0;Q<this.m;Q++)this.U[Q][m]=0;this.U[m][m]=1}}for(var $=this.n-1;$>=0;$--){if((function(Tt,wt){return Tt&&wt})($<g,r[$]!==0))for(var X=$+1;X<n;X++){for(var rt=0,z=$+1;z<this.n;z++)rt+=this.V[z][$]*this.V[z][X];rt=-rt/this.V[$+1][$];for(var O=$+1;O<this.n;O++)this.V[O][X]+=rt*this.V[O][$]}for(var H=0;H<this.n;H++)this.V[H][$]=0;this.V[$][$]=1}for(var Z=a-1,tt=Math.pow(2,-52),ht=Math.pow(2,-966);a>0;){var J=void 0,It=void 0;for(J=a-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===a-2)It=4;else{var Nt=void 0;for(Nt=a-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==a?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===a-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[a-2];r[a-2]=0;for(var ut=a-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*r[ut-1],r[ut-1]=Ct*r[ut-1]);for(var mt=0;mt<this.n;mt++)Et=Ct*this.V[mt][ut]+Dt*this.V[mt][a-1],this.V[mt][a-1]=-Dt*this.V[mt][ut]+Ct*this.V[mt][a-1],this.V[mt][ut]=Et}}break;case 2:{var Ot=r[J-1];r[J-1]=0;for(var Rt=J;Rt<a;Rt++){var Ht=v.hypot(this.s[Rt],Ot),Ut=this.s[Rt]/Ht,Pt=Ot/Ht;this.s[Rt]=Ht,Ot=-Pt*r[Rt],r[Rt]=Ut*r[Rt];for(var Ft=0;Ft<this.m;Ft++)Ht=Ut*this.U[Ft][Rt]+Pt*this.U[Ft][J-1],this.U[Ft][J-1]=-Pt*this.U[Ft][Rt]+Ut*this.U[Ft][J-1],this.U[Ft][Rt]=Ht}}break;case 3:{var Yt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[a-1]),Math.abs(this.s[a-2])),Math.abs(r[a-2])),Math.abs(this.s[J])),Math.abs(r[J])),Vt=this.s[a-1]/Yt,P=this.s[a-2]/Yt,U=r[a-2]/Yt,k=this.s[J]/Yt,K=r[J]/Yt,q=((P+Vt)*(P-Vt)+U*U)/2,at=Vt*U*(Vt*U),gt=0;(function(Tt,wt){return Tt||wt})(q!==0,at!==0)&&(gt=Math.sqrt(q*q+at),q<0&&(gt=-gt),gt=at/(q+gt));for(var nt=(k+Vt)*(k-Vt)+gt,et=k*K,_=J;_<a-1;_++){var dt=v.hypot(nt,et),Mt=nt/dt,pt=et/dt;_!==J&&(r[_-1]=dt),nt=Mt*this.s[_]+pt*r[_],r[_]=Mt*r[_]-pt*this.s[_],et=pt*this.s[_+1],this.s[_+1]=Mt*this.s[_+1];for(var xt=0;xt<this.n;xt++)dt=Mt*this.V[xt][_]+pt*this.V[xt][_+1],this.V[xt][_+1]=-pt*this.V[xt][_]+Mt*this.V[xt][_+1],this.V[xt][_]=dt;if(dt=v.hypot(nt,et),Mt=nt/dt,pt=et/dt,this.s[_]=dt,nt=Mt*r[_]+pt*this.s[_+1],this.s[_+1]=-pt*r[_]+Mt*this.s[_+1],et=pt*r[_+1],r[_+1]=Mt*r[_+1],_<this.m-1)for(var lt=0;lt<this.m;lt++)dt=Mt*this.U[lt][_]+pt*this.U[lt][_+1],this.U[lt][_+1]=-pt*this.U[lt][_]+Mt*this.U[lt][_+1],this.U[lt][_]=dt}r[a-2]=nt}break;case 4:{if(this.s[J]<=0){this.s[J]=this.s[J]<0?-this.s[J]:0;for(var ot=0;ot<=Z;ot++)this.V[ot][J]=-this.V[ot][J]}for(;J<Z&&!(this.s[J]>=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,J<this.n-1)for(var ft=0;ft<this.n;ft++)Lt=this.V[ft][J+1],this.V[ft][J+1]=this.V[ft][J],this.V[ft][J]=Lt;if(J<this.m-1)for(var st=0;st<this.m;st++)Lt=this.U[st][J+1],this.U[st][J+1]=this.U[st][J],this.U[st][J]=Lt;J++}a--}break}}var Xt={U:this.U,V:this.V,S:this.s};return Xt},v.hypot=function(l,n){var r=void 0;return Math.abs(l)>Math.abs(n)?(r=n/l,r=Math.abs(l)*Math.sqrt(1+r*r)):n!=0?(r=l/n,r=Math.abs(n)*Math.sqrt(1+r*r)):r=0,r},C.exports=v}),(function(C,x,N){var v=(function(){function r(i,f){for(var e=0;e<f.length;e++){var g=f[e];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(i,g.key,g)}}return function(i,f,e){return f&&r(i.prototype,f),e&&r(i,e),i}})();function l(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")}var n=(function(){function r(i,f){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,r),this.sequence1=i,this.sequence2=f,this.match_score=e,this.mismatch_penalty=g,this.gap_penalty=t,this.iMax=i.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var o=0;o<this.jMax;o++)this.grid[s][o]=0}this.tracebackGrid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.tracebackGrid[c]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.tracebackGrid[c][h]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(r,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var g=1;g<this.iMax;g++)for(var t=1;t<this.jMax;t++){var s=void 0;this.sequence1[g-1]===this.sequence2[t-1]?s=this.grid[g-1][t-1]+this.match_score:s=this.grid[g-1][t-1]+this.mismatch_penalty;var o=this.grid[g-1][t]+this.gap_penalty,c=this.grid[g][t-1]+this.gap_penalty,h=[s,o,c],T=this.arrayAllMaxIndexes(h);this.grid[g][t]=h[T[0]],this.tracebackGrid[g][t]=[T.includes(0),T.includes(1),T.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var e=f[0],g=this.tracebackGrid[e.pos[0]][e.pos[1]];g[0]&&f.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),g[1]&&f.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),g[2]&&f.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),e.pos[0]===0&&e.pos[1]===0&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,e){for(var g=[],t=-1;(t=f.indexOf(e,t+1))!==-1;)g.push(t);return g}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),r})();C.exports=n}),(function(C,x,N){var v=function(){};v.FDLayout=N(18),v.FDLayoutConstants=N(4),v.FDLayoutEdge=N(19),v.FDLayoutNode=N(20),v.DimensionD=N(21),v.HashMap=N(22),v.HashSet=N(23),v.IGeometry=N(8),v.IMath=N(9),v.Integer=N(10),v.Point=N(12),v.PointD=N(5),v.RandomSeed=N(16),v.RectangleD=N(13),v.Transform=N(17),v.UniqueIDGeneretor=N(14),v.Quicksort=N(25),v.LinkedList=N(11),v.LGraphObject=N(2),v.LGraph=N(6),v.LEdge=N(1),v.LGraphManager=N(7),v.LNode=N(3),v.Layout=N(15),v.LayoutConstants=N(0),v.NeedlemanWunsch=N(27),v.Matrix=N(24),v.SVD=N(26),C.exports=v}),(function(C,x,N){function v(){this.listeners=[]}var l=v.prototype;l.addListener=function(n,r){this.listeners.push({event:n,callback:r})},l.removeListener=function(n,r){for(var i=this.listeners.length;i>=0;i--){var f=this.listeners[i];f.event===n&&f.callback===r&&this.listeners.splice(i,1)}},l.emit=function(n,r){for(var i=0;i<this.listeners.length;i++){var f=this.listeners[i];n===f.event&&f.callback(r)}},C.exports=v})])})})(fe)),fe.exports}var pr=le.exports,Oe;function yr(){return Oe||(Oe=1,(function(I,M){(function(x,N){I.exports=N(vr())})(pr,function(C){return(()=>{var x={45:((n,r,i)=>{var f={};f.layoutBase=i(551),f.CoSEConstants=i(806),f.CoSEEdge=i(767),f.CoSEGraph=i(880),f.CoSEGraphManager=i(578),f.CoSELayout=i(765),f.CoSENode=i(991),f.ConstraintHandler=i(902),n.exports=f}),806:((n,r,i)=>{var f=i(551).FDLayoutConstants;function e(){}for(var g in f)e[g]=f[g];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,n.exports=e}),767:((n,r,i)=>{var f=i(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e}),880:((n,r,i)=>{var f=i(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e}),578:((n,r,i)=>{var f=i(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var g in f)e[g]=f[g];n.exports=e}),765:((n,r,i)=>{var f=i(551).FDLayout,e=i(578),g=i(880),t=i(991),s=i(767),o=i(806),c=i(902),h=i(551).FDLayoutConstants,T=i(551).LayoutConstants,u=i(551).Point,d=i(551).PointD,L=i(551).DimensionD,b=i(551).Layout,w=i(551).Integer,G=i(551).IGeometry,V=i(551).LGraph,Y=i(551).Transform,B=i(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var j in f)A[j]=f[j];A.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},A.prototype.newGraph=function(a){return new g(null,this.graphManager,a)},A.prototype.newNode=function(a){return new t(this.graphManager,a)},A.prototype.newEdge=function(a){return new s(null,null,a)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var a=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return a&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(S){return E.has(S)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var a=this.getFlatForest();if(a.length>0)this.positionNodesRadially(a);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return a.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.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()),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),E={},p=0;p<a.length;p++){var m=a[p].rect,y=a[p].id;E[y]={id:y,x:m.getCenterX(),y:m.getCenterY(),w:m.width,h:m.height}}return E},A.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var a=!1;if(h.ANIMATE==="during")this.emit("layoutstarted");else{for(;!a;)a=this.tick();this.graphManager.updateBounds()}},A.prototype.moveNodes=function(){for(var a=this.getAllNodes(),E,p=0;p<a.length;p++)E=a[p],E.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var p=0;p<a.length;p++)E=a[p],E.move()},A.prototype.initConstraintVariables=function(){var a=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var E=this.graphManager.getAllNodes(),p=0;p<E.length;p++){var m=E[p];this.idToNodeMap.set(m.id,m)}var y=function O(H){for(var Z=H.getChild().getNodes(),tt,ht=0,J=0;J<Z.length;J++)tt=Z[J],tt.getChild()==null?a.fixedNodeSet.has(tt.id)&&(ht+=100):ht+=O(tt);return ht};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(Z){a.fixedNodeSet.add(Z.nodeId)});for(var E=this.graphManager.getAllNodes(),m,p=0;p<E.length;p++)if(m=E[p],m.getChild()!=null){var S=y(m);S>0&&(m.fixedNodeWeight=S)}}if(this.constraints.relativePlacementConstraint){var D=new Map,F=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){a.fixedNodesOnHorizontal.add(O),a.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p<W.length;p++)this.dummyToNodeForVerticalAlignment.set("dummy"+p,[]),W[p].forEach(function(H){D.set(H,"dummy"+p),a.dummyToNodeForVerticalAlignment.get("dummy"+p).push(H),a.fixedNodeSet.has(H)&&a.fixedNodesOnHorizontal.add("dummy"+p)});if(this.constraints.alignmentConstraint.horizontal)for(var R=this.constraints.alignmentConstraint.horizontal,p=0;p<R.length;p++)this.dummyToNodeForHorizontalAlignment.set("dummy"+p,[]),R[p].forEach(function(H){F.set(H,"dummy"+p),a.dummyToNodeForHorizontalAlignment.get("dummy"+p).push(H),a.fixedNodeSet.has(H)&&a.fixedNodesOnVertical.add("dummy"+p)})}if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(O){var H,Z,tt;for(tt=O.length-1;tt>=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),Z=O[tt],O[tt]=O[H],O[H]=Z;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;a.nodesInRelativeHorizontal.includes(H)||(a.nodesInRelativeHorizontal.push(H),a.nodeToRelativeConstraintMapHorizontal.set(H,[]),a.dummyToNodeForVerticalAlignment.has(H)?a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(H,a.idToNodeMap.get(H).getCenterX())),a.nodesInRelativeHorizontal.includes(Z)||(a.nodesInRelativeHorizontal.push(Z),a.nodeToRelativeConstraintMapHorizontal.set(Z,[]),a.dummyToNodeForVerticalAlignment.has(Z)?a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(Z).getCenterX())),a.nodeToRelativeConstraintMapHorizontal.get(H).push({right:Z,gap:O.gap}),a.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:H,gap:O.gap})}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;a.nodesInRelativeVertical.includes(tt)||(a.nodesInRelativeVertical.push(tt),a.nodeToRelativeConstraintMapVertical.set(tt,[]),a.dummyToNodeForHorizontalAlignment.has(tt)?a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(tt,a.idToNodeMap.get(tt).getCenterY())),a.nodesInRelativeVertical.includes(ht)||(a.nodesInRelativeVertical.push(ht),a.nodeToRelativeConstraintMapVertical.set(ht,[]),a.dummyToNodeForHorizontalAlignment.has(ht)?a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(ht,a.idToNodeMap.get(ht).getCenterY())),a.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),a.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,$=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(Z):Q.set(H,[Z]),Q.has(Z)?Q.get(Z).push(H):Q.set(Z,[H])}else{var tt=F.has(O.top)?F.get(O.top):O.top,ht=F.has(O.bottom)?F.get(O.bottom):O.bottom;$.has(tt)?$.get(tt).push(ht):$.set(tt,[ht]),$.has(ht)?$.get(ht).push(tt):$.set(ht,[tt])}});var X=function(H,Z){var tt=[],ht=[],J=new B,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),Z.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,a.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var z=X($,a.fixedNodesOnVertical);this.componentsOnVertical=z.components,this.fixedComponentsOnVertical=z.isFixed}}},A.prototype.updateDisplacements=function(){var a=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(z){var O=a.idToNodeMap.get(z.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p<E.length;p++){for(var m=0,y=0;y<E[p].length;y++){if(this.fixedNodeSet.has(E[p][y])){m=0;break}m+=this.idToNodeMap.get(E[p][y]).displacementX}for(var S=m/E[p].length,y=0;y<E[p].length;y++)this.idToNodeMap.get(E[p][y]).displacementX=S}if(this.constraints.alignmentConstraint.horizontal)for(var D=this.constraints.alignmentConstraint.horizontal,p=0;p<D.length;p++){for(var F=0,y=0;y<D[p].length;y++){if(this.fixedNodeSet.has(D[p][y])){F=0;break}F+=this.idToNodeMap.get(D[p][y]).displacementY}for(var W=F/D[p].length,y=0;y<D[p].length;y++)this.idToNodeMap.get(D[p][y]).displacementY=W}}if(this.constraints.relativePlacementConstraint)if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(z){if(!a.fixedNodesOnHorizontal.has(z)){var O=0;a.dummyToNodeForVerticalAlignment.has(z)?O=a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(z)[0]).displacementX:O=a.idToNodeMap.get(z).displacementX,a.nodeToRelativeConstraintMapHorizontal.get(z).forEach(function(H){if(H.right){var Z=a.nodeToTempPositionMapHorizontal.get(H.right)-a.nodeToTempPositionMapHorizontal.get(z)-O;Z<H.gap&&(O-=H.gap-Z)}else{var Z=a.nodeToTempPositionMapHorizontal.get(z)-a.nodeToTempPositionMapHorizontal.get(H.left)+O;Z<H.gap&&(O+=H.gap-Z)}}),a.nodeToTempPositionMapHorizontal.set(z,a.nodeToTempPositionMapHorizontal.get(z)+O),a.dummyToNodeForVerticalAlignment.has(z)?a.dummyToNodeForVerticalAlignment.get(z).forEach(function(H){a.idToNodeMap.get(H).displacementX=O}):a.idToNodeMap.get(z).displacementX=O}}),this.nodesInRelativeVertical.forEach(function(z){if(!a.fixedNodesOnHorizontal.has(z)){var O=0;a.dummyToNodeForHorizontalAlignment.has(z)?O=a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(z)[0]).displacementY:O=a.idToNodeMap.get(z).displacementY,a.nodeToRelativeConstraintMapVertical.get(z).forEach(function(H){if(H.bottom){var Z=a.nodeToTempPositionMapVertical.get(H.bottom)-a.nodeToTempPositionMapVertical.get(z)-O;Z<H.gap&&(O-=H.gap-Z)}else{var Z=a.nodeToTempPositionMapVertical.get(z)-a.nodeToTempPositionMapVertical.get(H.top)+O;Z<H.gap&&(O+=H.gap-Z)}}),a.nodeToTempPositionMapVertical.set(z,a.nodeToTempPositionMapVertical.get(z)+O),a.dummyToNodeForHorizontalAlignment.has(z)?a.dummyToNodeForHorizontalAlignment.get(z).forEach(function(H){a.idToNodeMap.get(H).displacementY=O}):a.idToNodeMap.get(z).displacementY=O}});else{for(var p=0;p<this.componentsOnHorizontal.length;p++){var R=this.componentsOnHorizontal[p];if(this.fixedComponentsOnHorizontal[p])for(var y=0;y<R.length;y++)this.dummyToNodeForVerticalAlignment.has(R[y])?this.dummyToNodeForVerticalAlignment.get(R[y]).forEach(function(H){a.idToNodeMap.get(H).displacementX=0}):this.idToNodeMap.get(R[y]).displacementX=0;else{for(var Q=0,$=0,y=0;y<R.length;y++)if(this.dummyToNodeForVerticalAlignment.has(R[y])){var X=this.dummyToNodeForVerticalAlignment.get(R[y]);Q+=X.length*this.idToNodeMap.get(X[0]).displacementX,$+=X.length}else Q+=this.idToNodeMap.get(R[y]).displacementX,$++;for(var rt=Q/$,y=0;y<R.length;y++)this.dummyToNodeForVerticalAlignment.has(R[y])?this.dummyToNodeForVerticalAlignment.get(R[y]).forEach(function(H){a.idToNodeMap.get(H).displacementX=rt}):this.idToNodeMap.get(R[y]).displacementX=rt}}for(var p=0;p<this.componentsOnVertical.length;p++){var R=this.componentsOnVertical[p];if(this.fixedComponentsOnVertical[p])for(var y=0;y<R.length;y++)this.dummyToNodeForHorizontalAlignment.has(R[y])?this.dummyToNodeForHorizontalAlignment.get(R[y]).forEach(function(Z){a.idToNodeMap.get(Z).displacementY=0}):this.idToNodeMap.get(R[y]).displacementY=0;else{for(var Q=0,$=0,y=0;y<R.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(R[y])){var X=this.dummyToNodeForHorizontalAlignment.get(R[y]);Q+=X.length*this.idToNodeMap.get(X[0]).displacementY,$+=X.length}else Q+=this.idToNodeMap.get(R[y]).displacementY,$++;for(var rt=Q/$,y=0;y<R.length;y++)this.dummyToNodeForHorizontalAlignment.has(R[y])?this.dummyToNodeForHorizontalAlignment.get(R[y]).forEach(function(J){a.idToNodeMap.get(J).displacementY=rt}):this.idToNodeMap.get(R[y]).displacementY=rt}}}},A.prototype.calculateNodesToApplyGravitationTo=function(){var a=[],E,p=this.graphManager.getGraphs(),m=p.length,y;for(y=0;y<m;y++)E=p[y],E.updateConnected(),E.isConnected||(a=a.concat(E.getNodes()));return a},A.prototype.createBendpoints=function(){var a=[];a=a.concat(this.graphManager.getAllEdges());var E=new Set,p;for(p=0;p<a.length;p++){var m=a[p];if(!E.has(m)){var y=m.getSource(),S=m.getTarget();if(y==S)m.getBendpoints().push(new d),m.getBendpoints().push(new d),this.createDummyNodesForBendpoints(m),E.add(m);else{var D=[];if(D=D.concat(y.getEdgeListToNode(S)),D=D.concat(S.getEdgeListToNode(y)),!E.has(D[0])){if(D.length>1){var F;for(F=0;F<D.length;F++){var W=D[F];W.getBendpoints().push(new d),this.createDummyNodesForBendpoints(W)}}D.forEach(function(R){E.add(R)})}}}if(E.size==a.length)break}},A.prototype.positionNodesRadially=function(a){for(var E=new u(0,0),p=Math.ceil(Math.sqrt(a.length)),m=0,y=0,S=0,D=new d(0,0),F=0;F<a.length;F++){F%p==0&&(S=0,y=m,F!=0&&(y+=o.DEFAULT_COMPONENT_SEPERATION),m=0);var W=a[F],R=b.findCenterOfTree(W);E.x=S,E.y=y,D=A.radialLayout(W,R,E),D.y>m&&(m=Math.floor(D.y)),S=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-D.x/2,T.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(a,E,p){var m=Math.max(this.maxDiagonalInTree(a),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(a),S=new Y;S.setDeviceOrgX(y.getMinX()),S.setDeviceOrgY(y.getMinY()),S.setWorldOrgX(p.x),S.setWorldOrgY(p.y);for(var D=0;D<a.length;D++){var F=a[D];F.transform(S)}var W=new d(y.getMaxX(),y.getMaxY());return S.inverseTransformPoint(W)},A.branchRadialLayout=function(a,E,p,m,y,S){var D=(m-p+1)/2;D<0&&(D+=180);var F=(D+p)%360,W=F*G.TWO_PI/360,R=y*Math.cos(W),Q=y*Math.sin(W);a.setCenter(R,Q);var $=[];$=$.concat(a.getEdges());var X=$.length;E!=null&&X--;for(var rt=0,z=$.length,O,H=a.getEdgesBetween(E);H.length>1;){var Z=H[0];H.splice(0,1);var tt=$.indexOf(Z);tt>=0&&$.splice(tt,1),z--,X--}E!=null?O=($.indexOf(H[0])+1)%z:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%z){var It=$[J].getOtherEnd(a);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,a,Nt,vt,y+S,S),rt++}}},A.maxDiagonalInTree=function(a){for(var E=w.MIN_VALUE,p=0;p<a.length;p++){var m=a[p],y=m.getDiagonal();y>E&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var a=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y<m.length;y++){var S=m[y],D=S.getParent();this.getNodeDegreeWithChildren(S)===0&&(D.id==null||!this.getToBeTiled(D))&&p.push(S)}for(var y=0;y<p.length;y++){var S=p[y],F=S.getParent().id;typeof E[F]>"u"&&(E[F]=[]),E[F]=E[F].concat(S)}Object.keys(E).forEach(function(W){if(E[W].length>1){var R="DummyCompound_"+W;a.memberGroups[R]=E[W];var Q=E[W][0].getParent(),$=new t(a.graphManager);$.id=R,$.paddingLeft=Q.paddingLeft||0,$.paddingRight=Q.paddingRight||0,$.paddingBottom=Q.paddingBottom||0,$.paddingTop=Q.paddingTop||0,a.idToDummyNode[R]=$;var X=a.getGraphManager().add(a.newGraph(),$),rt=Q.getChild();rt.add($);for(var z=0;z<E[W].length;z++){var O=E[W][z];rt.remove(O),X.add(O)}}})},A.prototype.clearCompounds=function(){var a={},E={};this.performDFSOnCompounds();for(var p=0;p<this.compoundOrder.length;p++)E[this.compoundOrder[p].id]=this.compoundOrder[p],a[this.compoundOrder[p].id]=[].concat(this.compoundOrder[p].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[p].getChild()),this.compoundOrder[p].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(a,E)},A.prototype.clearZeroDegreeMembers=function(){var a=this,E=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(p){var m=a.idToDummyNode[p];if(E[p]=a.tileNodes(a.memberGroups[p],m.paddingLeft+m.paddingRight),m.rect.width=E[p].width,m.rect.height=E[p].height,m.setCenter(E[p].centerX,E[p].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var y=m.rect.width,S=m.rect.height;m.labelWidth&&(m.labelPosHorizontal=="left"?(m.rect.x-=m.labelWidth,m.setWidth(y+m.labelWidth),m.labelMarginLeft=m.labelWidth):m.labelPosHorizontal=="center"&&m.labelWidth>y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(S+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>S?(m.rect.y-=(m.labelHeight-S)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-S)/2):m.labelPosVertical=="bottom"&&m.setHeight(S+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var E=this.compoundOrder[a],p=E.id,m=E.paddingLeft,y=E.paddingTop,S=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,S,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var a=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=a.idToDummyNode[p],y=m.paddingLeft,S=m.paddingTop,D=m.labelMarginLeft,F=m.labelMarginTop;a.adjustLocations(E[p],m.rect.x,m.rect.y,y,S,D,F)})},A.prototype.getToBeTiled=function(a){var E=a.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=a.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y<m.length;y++){var S=m[y];if(this.getNodeDegree(S)>0)return this.toBeTiled[E]=!1,!1;if(S.getChild()==null){this.toBeTiled[S.id]=!1;continue}if(!this.getToBeTiled(S))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(a){a.id;for(var E=a.getEdges(),p=0,m=0;m<E.length;m++){var y=E[m];y.getSource().id!==y.getTarget().id&&(p=p+1)}return p},A.prototype.getNodeDegreeWithChildren=function(a){var E=this.getNodeDegree(a);if(a.getChild()==null)return E;for(var p=a.getChild().getNodes(),m=0;m<p.length;m++){var y=p[m];E+=this.getNodeDegreeWithChildren(y)}return E},A.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},A.prototype.fillCompexOrderByDFS=function(a){for(var E=0;E<a.length;E++){var p=a[E];p.getChild()!=null&&this.fillCompexOrderByDFS(p.getChild().getNodes()),this.getToBeTiled(p)&&this.compoundOrder.push(p)}},A.prototype.adjustLocations=function(a,E,p,m,y,S,D){E+=m+S,p+=y+D;for(var F=E,W=0;W<a.rows.length;W++){var R=a.rows[W];E=F;for(var Q=0,$=0;$<R.length;$++){var X=R[$];X.rect.x=E,X.rect.y=p,E+=X.rect.width+a.horizontalPadding,X.rect.height>Q&&(Q=X.rect.height)}p+=Q+a.verticalPadding}},A.prototype.tileCompoundMembers=function(a,E){var p=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(a[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var S=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(S+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>S?(y.rect.x-=(y.labelWidth-S)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-S)/2):y.labelPosHorizontal=="right"&&y.setWidth(S+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(a,E){var p=this.tileNodesByFavoringDim(a,E,!0),m=this.tileNodesByFavoringDim(a,E,!1),y=this.getOrgRatio(p),S=this.getOrgRatio(m),D;return S<y?D=m:D=p,D},A.prototype.getOrgRatio=function(a){var E=a.width,p=a.height,m=E/p;return m<1&&(m=1/m),m},A.prototype.calcIdealRowWidth=function(a,E){var p=o.TILING_PADDING_VERTICAL,m=o.TILING_PADDING_HORIZONTAL,y=a.length,S=0,D=0,F=0;a.forEach(function(z){S+=z.getWidth(),D+=z.getHeight(),z.getWidth()>F&&(F=z.getWidth())});var W=S/y,R=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(R+p)*y,$=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil($),X==$&&X++):X=Math.floor($);var rt=X*(W+m)-m;return F>rt&&(rt=F),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(a,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,S=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};S&&(D.idealRowWidth=this.calcIdealRowWidth(a,p));var F=function(O){return O.rect.width*O.rect.height},W=function(O,H){return F(H)-F(O)};a.sort(function(z,O){var H=W;return D.idealRowWidth?(H=S,H(z.id,O.id)):H(z,O)});for(var R=0,Q=0,$=0;$<a.length;$++){var X=a[$];R+=X.getCenterX(),Q+=X.getCenterY()}D.centerX=R/a.length,D.centerY=Q/a.length;for(var $=0;$<a.length;$++){var X=a[$];if(D.rows.length==0)this.insertNodeToRow(D,X,0,E);else if(this.canAddHorizontal(D,X.rect.width,X.rect.height)){var rt=D.rows.length-1;D.idealRowWidth||(rt=this.getShortestRowIndex(D)),this.insertNodeToRow(D,X,rt,E)}else this.insertNodeToRow(D,X,D.rows.length,E);this.shiftToLastRow(D)}return D},A.prototype.insertNodeToRow=function(a,E,p,m){var y=m;if(p==a.rows.length){var S=[];a.rows.push(S),a.rowWidth.push(y),a.rowHeight.push(0)}var D=a.rowWidth[p]+E.rect.width;a.rows[p].length>0&&(D+=a.horizontalPadding),a.rowWidth[p]=D,a.width<D&&(a.width=D);var F=E.rect.height;p>0&&(F+=a.verticalPadding);var W=0;F>a.rowHeight[p]&&(W=a.rowHeight[p],a.rowHeight[p]=F,W=a.rowHeight[p]-W),a.height+=W,a.rows[p].push(E)},A.prototype.getShortestRowIndex=function(a){for(var E=-1,p=Number.MAX_VALUE,m=0;m<a.rows.length;m++)a.rowWidth[m]<p&&(E=m,p=a.rowWidth[m]);return E},A.prototype.getLongestRowIndex=function(a){for(var E=-1,p=Number.MIN_VALUE,m=0;m<a.rows.length;m++)a.rowWidth[m]>p&&(E=m,p=a.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(a,E,p){if(a.idealRowWidth){var m=a.rows.length-1,y=a.rowWidth[m];return y+E+a.horizontalPadding<=a.idealRowWidth}var S=this.getShortestRowIndex(a);if(S<0)return!0;var D=a.rowWidth[S];if(D+a.horizontalPadding+E<=a.width)return!0;var F=0;a.rowHeight[S]<p&&S>0&&(F=p+a.verticalPadding-a.rowHeight[S]);var W;a.width-D>=E+a.horizontalPadding?W=(a.height+F)/(D+E+a.horizontalPadding):W=(a.height+F)/a.width,F=p+a.verticalPadding;var R;return a.width<E?R=(a.height+F)/E:R=(a.height+F)/a.width,R<1&&(R=1/R),W<1&&(W=1/W),W<R},A.prototype.shiftToLastRow=function(a){var E=this.getLongestRowIndex(a),p=a.rowWidth.length-1,m=a.rows[E],y=m[m.length-1],S=y.width+a.horizontalPadding;if(a.width-a.rowWidth[p]>S&&E!=p){m.splice(-1,1),a.rows[p].push(y),a.rowWidth[E]=a.rowWidth[E]-S,a.rowWidth[p]=a.rowWidth[p]+S,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var D=Number.MIN_VALUE,F=0;F<m.length;F++)m[F].height>D&&(D=m[F].height);E>0&&(D+=a.verticalPadding);var W=a.rowHeight[E]+a.rowHeight[p];a.rowHeight[E]=D,a.rowHeight[p]<y.height+a.verticalPadding&&(a.rowHeight[p]=y.height+a.verticalPadding);var R=a.rowHeight[E]+a.rowHeight[p];a.height+=R-W,this.shiftToLastRow(a)}},A.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},A.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},A.prototype.reduceTrees=function(){for(var a=[],E=!0,p;E;){var m=this.graphManager.getAllNodes(),y=[];E=!1;for(var S=0;S<m.length;S++)if(p=m[S],p.getEdges().length==1&&!p.getEdges()[0].isInterGraph&&p.getChild()==null){if(o.PURE_INCREMENTAL){var D=p.getEdges()[0].getOtherEnd(p),F=new L(p.getCenterX()-D.getCenterX(),p.getCenterY()-D.getCenterY());y.push([p,p.getEdges()[0],p.getOwner(),F])}else y.push([p,p.getEdges()[0],p.getOwner()]);E=!0}if(E==!0){for(var W=[],R=0;R<y.length;R++)y[R][0].getEdges().length==1&&(W.push(y[R]),y[R][0].getOwner().remove(y[R][0]));a.push(W),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=a},A.prototype.growTree=function(a){for(var E=a.length,p=a[E-1],m,y=0;y<p.length;y++)m=p[y],this.findPlaceforPrunedNode(m),m[2].add(m[0]),m[2].add(m[1],m[1].source,m[1].target);a.splice(a.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},A.prototype.findPlaceforPrunedNode=function(a){var E,p,m=a[0];if(m==a[1].source?p=a[1].target:p=a[1].source,o.PURE_INCREMENTAL)m.setCenter(p.getCenterX()+a[3].getWidth(),p.getCenterY()+a[3].getHeight());else{var y=p.startX,S=p.finishX,D=p.startY,F=p.finishY,W=0,R=0,Q=0,$=0,X=[W,Q,R,$];if(D>0)for(var rt=y;rt<=S;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(S<this.grid.length-1)for(var rt=D;rt<=F;rt++)X[1]+=this.grid[S+1][rt].length+this.grid[S][rt].length-1;if(F<this.grid[0].length-1)for(var rt=y;rt<=S;rt++)X[2]+=this.grid[rt][F+1].length+this.grid[rt][F].length-1;if(y>0)for(var rt=D;rt<=F;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var z=w.MAX_VALUE,O,H,Z=0;Z<X.length;Z++)X[Z]<z?(z=X[Z],O=1,H=Z):X[Z]==z&&O++;if(O==3&&z==0)X[0]==0&&X[1]==0&&X[2]==0?E=1:X[0]==0&&X[1]==0&&X[3]==0?E=0:X[0]==0&&X[2]==0&&X[3]==0?E=3:X[1]==0&&X[2]==0&&X[3]==0&&(E=2);else if(O==2&&z==0){var tt=Math.floor(Math.random()*2);X[0]==0&&X[1]==0?tt==0?E=0:E=1:X[0]==0&&X[2]==0?tt==0?E=0:E=2:X[0]==0&&X[3]==0?tt==0?E=0:E=3:X[1]==0&&X[2]==0?tt==0?E=1:E=2:X[1]==0&&X[3]==0?tt==0?E=1:E=3:tt==0?E=2:E=3}else if(O==4&&z==0){var tt=Math.floor(Math.random()*4);E=tt}else E=H;E==0?m.setCenter(p.getCenterX(),p.getCenterY()-p.getHeight()/2-h.DEFAULT_EDGE_LENGTH-m.getHeight()/2):E==1?m.setCenter(p.getCenterX()+p.getWidth()/2+h.DEFAULT_EDGE_LENGTH+m.getWidth()/2,p.getCenterY()):E==2?m.setCenter(p.getCenterX(),p.getCenterY()+p.getHeight()/2+h.DEFAULT_EDGE_LENGTH+m.getHeight()/2):m.setCenter(p.getCenterX()-p.getWidth()/2-h.DEFAULT_EDGE_LENGTH-m.getWidth()/2,p.getCenterY())}},n.exports=A}),991:((n,r,i)=>{var f=i(551).FDLayoutNode,e=i(551).IMath;function g(s,o,c,h){f.call(this,s,o,c,h)}g.prototype=Object.create(f.prototype);for(var t in f)g[t]=f[t];g.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),h,T=0;T<c.length;T++)h=c[T],h.getChild()==null?(h.displacementX+=s,h.displacementY+=o):h.propogateDisplacementToChildren(s,o)},g.prototype.move=function(){var s=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),s.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},g.prototype.setPred1=function(s){this.pred1=s},g.prototype.getPred1=function(){return pred1},g.prototype.getPred2=function(){return pred2},g.prototype.setNext=function(s){this.next=s},g.prototype.getNext=function(){return next},g.prototype.setProcessed=function(s){this.processed=s},g.prototype.isProcessed=function(){return processed},n.exports=g}),902:((n,r,i)=>{function f(c){if(Array.isArray(c)){for(var h=0,T=Array(c.length);h<c.length;h++)T[h]=c[h];return T}else return Array.from(c)}var e=i(806),g=i(551).LinkedList,t=i(551).Matrix,s=i(551).SVD;function o(){}o.handleConstraints=function(c){var h={};h.fixedNodeConstraint=c.constraints.fixedNodeConstraint,h.alignmentConstraint=c.constraints.alignmentConstraint,h.relativePlacementConstraint=c.constraints.relativePlacementConstraint;for(var T=new Map,u=new Map,d=[],L=[],b=c.getAllNodes(),w=0,G=0;G<b.length;G++){var V=b[G];V.getChild()==null&&(u.set(V.id,w++),d.push(V.getCenterX()),L.push(V.getCenterY()),T.set(V.id,V))}h.relativePlacementConstraint&&h.relativePlacementConstraint.forEach(function(P){!P.gap&&P.gap!=0&&(P.left?P.gap=e.DEFAULT_EDGE_LENGTH+T.get(P.left).getWidth()/2+T.get(P.right).getWidth()/2:P.gap=e.DEFAULT_EDGE_LENGTH+T.get(P.top).getHeight()/2+T.get(P.bottom).getHeight()/2)});var Y=function(U,k){return{x:U.x-k.x,y:U.y-k.y}},B=function(U){var k=0,K=0;return U.forEach(function(q){k+=d[u.get(q)],K+=L[u.get(q)]}),{x:k/U.size,y:K/U.size}},A=function(U,k,K,q,at){function gt(lt,ot){var Lt=new Set(lt),ft=!0,st=!1,Xt=void 0;try{for(var Tt=ot[Symbol.iterator](),wt;!(ft=(wt=Tt.next()).done);ft=!0){var zt=wt.value;Lt.add(zt)}}catch(bt){st=!0,Xt=bt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}return Lt}var nt=new Map;U.forEach(function(lt,ot){nt.set(ot,0)}),U.forEach(function(lt,ot){lt.forEach(function(Lt){nt.set(Lt.id,nt.get(Lt.id)+1)})});var et=new Map,_=new Map,dt=new g;nt.forEach(function(lt,ot){lt==0?(dt.push(ot),K||(k=="horizontal"?et.set(ot,u.has(ot)?d[u.get(ot)]:q.get(ot)):et.set(ot,u.has(ot)?L[u.get(ot)]:q.get(ot)))):et.set(ot,Number.NEGATIVE_INFINITY),K&&_.set(ot,new Set([ot]))}),K&&at.forEach(function(lt){var ot=[];if(lt.forEach(function(st){K.has(st)&&ot.push(st)}),ot.length>0){var Lt=0;ot.forEach(function(st){k=="horizontal"?(et.set(st,u.has(st)?d[u.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,u.has(st)?L[u.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){k=="horizontal"?ft+=u.has(st)?d[u.get(st)]:q.get(st):ft+=u.has(st)?L[u.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)<et.get(ot)+ft.gap)if(K&&K.has(ft.id)){var st=void 0;if(k=="horizontal"?st=u.has(ft.id)?d[u.get(ft.id)]:q.get(ft.id):st=u.has(ft.id)?L[u.get(ft.id)]:q.get(ft.id),et.set(ft.id,st),st<et.get(ot)+ft.gap){var Xt=et.get(ot)+ft.gap-st;_.get(ot).forEach(function(Tt){et.set(Tt,et.get(Tt)-Xt)})}}else et.set(ft.id,et.get(ot)+ft.gap);nt.set(ft.id,nt.get(ft.id)-1),nt.get(ft.id)==0&&dt.push(ft.id),K&&_.set(ft.id,gt(_.get(ot),_.get(ft.id)))})};dt.length!=0;)Mt();if(K){var pt=new Set;U.forEach(function(lt,ot){lt.length==0&&pt.add(ot)});var xt=[];_.forEach(function(lt,ot){if(pt.has(ot)){var Lt=!1,ft=!0,st=!1,Xt=void 0;try{for(var Tt=lt[Symbol.iterator](),wt;!(ft=(wt=Tt.next()).done);ft=!0){var zt=wt.value;K.has(zt)&&(Lt=!0)}}catch(St){st=!0,Xt=St}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}if(!Lt){var bt=!1,$t=void 0;xt.forEach(function(St,Zt){St.has([].concat(f(lt))[0])&&(bt=!0,$t=Zt)}),bt?lt.forEach(function(St){xt[$t].add(St)}):xt.push(new Set(lt))}}}),xt.forEach(function(lt,ot){var Lt=Number.POSITIVE_INFINITY,ft=Number.POSITIVE_INFINITY,st=Number.NEGATIVE_INFINITY,Xt=Number.NEGATIVE_INFINITY,Tt=!0,wt=!1,zt=void 0;try{for(var bt=lt[Symbol.iterator](),$t;!(Tt=($t=bt.next()).done);Tt=!0){var St=$t.value,Zt=void 0;k=="horizontal"?Zt=u.has(St)?d[u.get(St)]:q.get(St):Zt=u.has(St)?L[u.get(St)]:q.get(St);var Kt=et.get(St);Zt<Lt&&(Lt=Zt),Zt>st&&(st=Zt),Kt<ft&&(ft=Kt),Kt>Xt&&(Xt=Kt)}}catch(ee){wt=!0,zt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw zt}}var ce=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;et.set(te,et.get(te)+ce)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},j=function(U){var k=0,K=0,q=0,at=0;if(U.forEach(function(_){_.left?d[u.get(_.left)]-d[u.get(_.right)]>=0?k++:K++:L[u.get(_.top)]-L[u.get(_.bottom)]>=0?q++:at++}),k>K&&q>at)for(var gt=0;gt<u.size;gt++)d[gt]=-1*d[gt],L[gt]=-1*L[gt];else if(k>K)for(var nt=0;nt<u.size;nt++)d[nt]=-1*d[nt];else if(q>at)for(var et=0;et<u.size;et++)L[et]=-1*L[et]},a=function(U){var k=[],K=new g,q=new Set,at=0;return U.forEach(function(gt,nt){if(!q.has(nt)){k[at]=[];var et=nt;for(K.push(et),q.add(et),k[at].push(et);K.length!=0;){et=K.shift();var _=U.get(et);_.forEach(function(dt){q.has(dt.id)||(K.push(dt.id),q.add(dt.id),k[at].push(dt.id))})}at++}}),k},E=function(U){var k=new Map;return U.forEach(function(K,q){k.set(q,[])}),U.forEach(function(K,q){K.forEach(function(at){k.get(q).push(at),k.get(at.id).push({id:q,gap:at.gap,direction:at.direction})})}),k},p=function(U){var k=new Map;return U.forEach(function(K,q){k.set(q,[])}),U.forEach(function(K,q){K.forEach(function(at){k.get(at.id).push({id:q,gap:at.gap,direction:at.direction})})}),k},m=[],y=[],S=!1,D=!1,F=new Set,W=new Map,R=new Map,Q=[];if(h.fixedNodeConstraint&&h.fixedNodeConstraint.forEach(function(P){F.add(P.nodeId)}),h.relativePlacementConstraint&&(h.relativePlacementConstraint.forEach(function(P){P.left?(W.has(P.left)?W.get(P.left).push({id:P.right,gap:P.gap,direction:"horizontal"}):W.set(P.left,[{id:P.right,gap:P.gap,direction:"horizontal"}]),W.has(P.right)||W.set(P.right,[])):(W.has(P.top)?W.get(P.top).push({id:P.bottom,gap:P.gap,direction:"vertical"}):W.set(P.top,[{id:P.bottom,gap:P.gap,direction:"vertical"}]),W.has(P.bottom)||W.set(P.bottom,[]))}),R=E(W),Q=a(R)),e.TRANSFORM_ON_CONSTRAINT_HANDLING){if(h.fixedNodeConstraint&&h.fixedNodeConstraint.length>1)h.fixedNodeConstraint.forEach(function(P,U){m[U]=[P.position.x,P.position.y],y[U]=[d[u.get(P.nodeId)],L[u.get(P.nodeId)]]}),S=!0;else if(h.alignmentConstraint)(function(){var P=0;if(h.alignmentConstraint.vertical){for(var U=h.alignmentConstraint.vertical,k=function(et){var _=new Set;U[et].forEach(function(pt){_.add(pt)});var dt=new Set([].concat(f(_)).filter(function(pt){return F.has(pt)})),Mt=void 0;dt.size>0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).x,U[et].forEach(function(pt){m[P]=[Mt,L[u.get(pt)]],y[P]=[d[u.get(pt)],L[u.get(pt)]],P++})},K=0;K<U.length;K++)k(K);S=!0}if(h.alignmentConstraint.horizontal){for(var q=h.alignmentConstraint.horizontal,at=function(et){var _=new Set;q[et].forEach(function(pt){_.add(pt)});var dt=new Set([].concat(f(_)).filter(function(pt){return F.has(pt)})),Mt=void 0;dt.size>0?Mt=d[u.get(dt.values().next().value)]:Mt=B(_).y,q[et].forEach(function(pt){m[P]=[d[u.get(pt)],Mt],y[P]=[d[u.get(pt)],L[u.get(pt)]],P++})},gt=0;gt<q.length;gt++)at(gt);S=!0}h.relativePlacementConstraint&&(D=!0)})();else if(h.relativePlacementConstraint){for(var $=0,X=0,rt=0;rt<Q.length;rt++)Q[rt].length>$&&($=Q[rt].length,X=rt);if($<R.size/2)j(h.relativePlacementConstraint),S=!1,D=!1;else{var z=new Map,O=new Map,H=[];Q[X].forEach(function(P){W.get(P).forEach(function(U){U.direction=="horizontal"?(z.has(P)?z.get(P).push(U):z.set(P,[U]),z.has(U.id)||z.set(U.id,[]),H.push({left:P,right:U.id})):(O.has(P)?O.get(P).push(U):O.set(P,[U]),O.has(U.id)||O.set(U.id,[]),H.push({top:P,bottom:U.id}))})}),j(H),D=!1;var Z=A(z,"horizontal"),tt=A(O,"vertical");Q[X].forEach(function(P,U){y[U]=[d[u.get(P)],L[u.get(P)]],m[U]=[],Z.has(P)?m[U][0]=Z.get(P):m[U][0]=d[u.get(P)],tt.has(P)?m[U][1]=tt.get(P):m[U][1]=L[u.get(P)]}),S=!0}}if(S){for(var ht=void 0,J=t.transpose(m),It=t.transpose(y),Nt=0;Nt<J.length;Nt++)J[Nt]=t.multGamma(J[Nt]),It[Nt]=t.multGamma(It[Nt]);var vt=t.multMat(J,t.transpose(It)),it=s.svd(vt);ht=t.multMat(it.V,t.transpose(it.U));for(var ut=0;ut<u.size;ut++){var Et=[d[ut],L[ut]],Ct=[ht[0][0],ht[1][0]],Dt=[ht[0][1],ht[1][1]];d[ut]=t.dotProduct(Et,Ct),L[ut]=t.dotProduct(Et,Dt)}D&&j(h.relativePlacementConstraint)}}if(e.ENFORCE_CONSTRAINTS){if(h.fixedNodeConstraint&&h.fixedNodeConstraint.length>0){var mt={x:0,y:0};h.fixedNodeConstraint.forEach(function(P,U){var k={x:d[u.get(P.nodeId)],y:L[u.get(P.nodeId)]},K=P.position,q=Y(K,k);mt.x+=q.x,mt.y+=q.y}),mt.x/=h.fixedNodeConstraint.length,mt.y/=h.fixedNodeConstraint.length,d.forEach(function(P,U){d[U]+=mt.x}),L.forEach(function(P,U){L[U]+=mt.y}),h.fixedNodeConstraint.forEach(function(P){d[u.get(P.nodeId)]=P.position.x,L[u.get(P.nodeId)]=P.position.y})}if(h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var Ot=h.alignmentConstraint.vertical,Rt=function(U){var k=new Set;Ot[U].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return F.has(at)})),q=void 0;K.size>0?q=d[u.get(K.values().next().value)]:q=B(k).x,k.forEach(function(at){F.has(at)||(d[u.get(at)]=q)})},Ht=0;Ht<Ot.length;Ht++)Rt(Ht);if(h.alignmentConstraint.horizontal)for(var Ut=h.alignmentConstraint.horizontal,Pt=function(U){var k=new Set;Ut[U].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return F.has(at)})),q=void 0;K.size>0?q=L[u.get(K.values().next().value)]:q=B(k).y,k.forEach(function(at){F.has(at)||(L[u.get(at)]=q)})},Ft=0;Ft<Ut.length;Ft++)Pt(Ft)}h.relativePlacementConstraint&&(function(){var P=new Map,U=new Map,k=new Map,K=new Map,q=new Map,at=new Map,gt=new Set,nt=new Set;if(F.forEach(function(Gt){gt.add(Gt),nt.add(Gt)}),h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var et=h.alignmentConstraint.vertical,_=function(yt){k.set("dummy"+yt,[]),et[yt].forEach(function(At){P.set(At,"dummy"+yt),k.get("dummy"+yt).push(At),F.has(At)&&gt.add("dummy"+yt)}),q.set("dummy"+yt,d[u.get(et[yt][0])])},dt=0;dt<et.length;dt++)_(dt);if(h.alignmentConstraint.horizontal)for(var Mt=h.alignmentConstraint.horizontal,pt=function(yt){K.set("dummy"+yt,[]),Mt[yt].forEach(function(At){U.set(At,"dummy"+yt),K.get("dummy"+yt).push(At),F.has(At)&&nt.add("dummy"+yt)}),at.set("dummy"+yt,L[u.get(Mt[yt][0])])},xt=0;xt<Mt.length;xt++)pt(xt)}var lt=new Map,ot=new Map,Lt=function(yt){W.get(yt).forEach(function(At){var kt=void 0,Bt=void 0;At.direction=="horizontal"?(kt=P.get(yt)?P.get(yt):yt,P.get(At.id)?Bt={id:P.get(At.id),gap:At.gap,direction:At.direction}:Bt=At,lt.has(kt)?lt.get(kt).push(Bt):lt.set(kt,[Bt]),lt.has(Bt.id)||lt.set(Bt.id,[])):(kt=U.get(yt)?U.get(yt):yt,U.get(At.id)?Bt={id:U.get(At.id),gap:At.gap,direction:At.direction}:Bt=At,ot.has(kt)?ot.get(kt).push(Bt):ot.set(kt,[Bt]),ot.has(Bt.id)||ot.set(Bt.id,[]))})},ft=!0,st=!1,Xt=void 0;try{for(var Tt=W.keys()[Symbol.iterator](),wt;!(ft=(wt=Tt.next()).done);ft=!0){var zt=wt.value;Lt(zt)}}catch(Gt){st=!0,Xt=Gt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}var bt=E(lt),$t=E(ot),St=a(bt),Zt=a($t),Kt=p(lt),ce=p(ot),Qt=[],jt=[];St.forEach(function(Gt,yt){Qt[yt]=[],Gt.forEach(function(At){Kt.get(At).length==0&&Qt[yt].push(At)})}),Zt.forEach(function(Gt,yt){jt[yt]=[],Gt.forEach(function(At){ce.get(At).length==0&&jt[yt].push(At)})});var _t=A(lt,"horizontal",gt,q,Qt),Jt=A(ot,"vertical",nt,at,jt),oe=function(yt){k.get(yt)?k.get(yt).forEach(function(At){d[u.get(At)]=_t.get(yt)}):d[u.get(yt)]=_t.get(yt)},te=!0,ee=!1,Le=void 0;try{for(var ge=_t.keys()[Symbol.iterator](),we;!(te=(we=ge.next()).done);te=!0){var ue=we.value;oe(ue)}}catch(Gt){ee=!0,Le=Gt}finally{try{!te&&ge.return&&ge.return()}finally{if(ee)throw Le}}var ke=function(yt){K.get(yt)?K.get(yt).forEach(function(At){L[u.get(At)]=Jt.get(yt)}):L[u.get(yt)]=Jt.get(yt)},de=!0,Ce=!1,Me=void 0;try{for(var ve=Jt.keys()[Symbol.iterator](),Ae;!(de=(Ae=ve.next()).done);de=!0){var ue=Ae.value;ke(ue)}}catch(Gt){Ce=!0,Me=Gt}finally{try{!de&&ve.return&&ve.return()}finally{if(Ce)throw Me}}})()}for(var Yt=0;Yt<b.length;Yt++){var Vt=b[Yt];Vt.getChild()==null&&Vt.setCenter(d[u.get(Vt.id)],L[u.get(Vt.id)])}},n.exports=o}),551:(n=>{n.exports=C})},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(45);return l})()})})(le)),le.exports}var mr=he.exports,xe;function Er(){return xe||(xe=1,(function(I,M){(function(x,N){I.exports=N(yr())})(mr,function(C){return(()=>{var x={658:(n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var i=arguments.length,f=Array(i>1?i-1:0),e=1;e<i;e++)f[e-1]=arguments[e];return f.forEach(function(g){Object.keys(g).forEach(function(t){return r[t]=g[t]})}),r}}),548:((n,r,i)=>{var f=(function(){function t(s,o){var c=[],h=!0,T=!1,u=void 0;try{for(var d=s[Symbol.iterator](),L;!(h=(L=d.next()).done)&&(c.push(L.value),!(o&&c.length===o));h=!0);}catch(b){T=!0,u=b}finally{try{!h&&d.return&&d.return()}finally{if(T)throw u}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=i(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(t){for(var s={},o=0;o<t.length;o++)s[t[o].id()]=!0;var c=t.filter(function(h,T){typeof h=="number"&&(h=T);for(var u=h.parent()[0];u!=null;){if(s[u.id()])return!1;u=u.parent()[0]}return!0});return c},g.connectComponents=function(t,s,o,c){var h=new e,T=new Set,u=[],d=void 0,L=void 0,b=void 0,w=!1,G=1,V=[],Y=[],B=function(){var j=t.collection();Y.push(j);var a=o[0],E=t.collection();E.merge(a).merge(a.descendants().intersection(s)),u.push(a),E.forEach(function(y){h.push(y),T.add(y),j.merge(y)});for(var p=function(){a=h.shift();var S=t.collection();a.neighborhood().nodes().forEach(function(R){s.intersection(a.edgesWith(R)).length>0&&S.merge(R)});for(var D=0;D<S.length;D++){var F=S[D];if(d=o.intersection(F.union(F.ancestors())),d!=null&&!T.has(d[0])){var W=d.union(d.descendants());W.forEach(function(R){h.push(R),T.add(R),j.merge(R),o.has(R)&&u.push(R)})}}};h.length!=0;)p();if(j.forEach(function(y){s.intersection(y.connectedEdges()).forEach(function(S){j.has(S.source())&&j.has(S.target())&&j.merge(S)})}),u.length==o.length&&(w=!0),!w||w&&G>1){L=u[0],b=L.connectedEdges().length,u.forEach(function(y){y.connectedEdges().length<b&&(b=y.connectedEdges().length,L=y)}),V.push(L.id());var m=t.collection();m.merge(u[0]),u.forEach(function(y){m.merge(y)}),u=[],o=o.difference(m),G++}};do B();while(!w);return c&&V.length>0&&c.set("dummy"+(c.size+1),V),Y},g.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,L=!1,b=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),G;!(d=(G=w.next()).done);d=!0){var V=G.value,Y=f(V,2),B=Y[0],A=Y[1],j=o.cy.getElementById(B);if(j){var a=j.boundingBox(),E=s.xCoords[A]-a.w/2,p=s.xCoords[A]+a.w/2,m=s.yCoords[A]-a.h/2,y=s.yCoords[A]+a.h/2;E<c&&(c=E),p>h&&(h=p),m<T&&(T=m),y>u&&(u=y)}}}catch(R){L=!0,b=R}finally{try{!d&&w.return&&w.return()}finally{if(L)throw b}}var S=t.x-(h+c)/2,D=t.y-(u+T)/2;s.xCoords=s.xCoords.map(function(R){return R+S}),s.yCoords=s.yCoords.map(function(R){return R+D})}else{Object.keys(s).forEach(function(R){var Q=s[R],$=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,z=Q.getRect().y+Q.getRect().height;$<c&&(c=$),X>h&&(h=X),rt<T&&(T=rt),z>u&&(u=z)});var F=t.x-(h+c)/2,W=t.y-(u+T)/2;Object.keys(s).forEach(function(R){var Q=s[R];Q.setCenter(Q.getCenterX()+F,Q.getCenterY()+W)})}}},g.calcBoundingBox=function(t,s,o,c){for(var h=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,L=void 0,b=void 0,w=void 0,G=void 0,V=t.descendants().not(":parent"),Y=V.length,B=0;B<Y;B++){var A=V[B];L=s[c.get(A.id())]-A.width()/2,b=s[c.get(A.id())]+A.width()/2,w=o[c.get(A.id())]-A.height()/2,G=o[c.get(A.id())]+A.height()/2,h>L&&(h=L),T<b&&(T=b),u>w&&(u=w),d<G&&(d=G)}var j={};return j.topLeftX=h,j.topLeftY=u,j.width=T-h,j.height=d-u,j},g.calcParentsWithoutChildren=function(t,s){var o=t.collection();return s.nodes(":parent").forEach(function(c){var h=!1;c.children().forEach(function(T){T.css("display")!="none"&&(h=!0)}),h||o.merge(c)}),o},n.exports=g}),816:((n,r,i)=>{var f=i(548),e=i(140).CoSELayout,g=i(140).CoSENode,t=i(140).layoutBase.PointD,s=i(140).layoutBase.DimensionD,o=i(140).layoutBase.LayoutConstants,c=i(140).layoutBase.FDLayoutConstants,h=i(140).CoSEConstants,T=function(d,L){var b=d.cy,w=d.eles,G=w.nodes(),V=w.edges(),Y=void 0,B=void 0,A=void 0,j={};d.randomize&&(Y=L.nodeIndexes,B=L.xCoords,A=L.yCoords);var a=function(R){return typeof R=="function"},E=function(R,Q){return a(R)?R(Q):R},p=f.calcParentsWithoutChildren(b,w),m=function W(R,Q,$,X){for(var rt=Q.length,z=0;z<rt;z++){var O=Q[z],H=null;O.intersection(p).length==0&&(H=O.children());var Z=void 0,tt=O.layoutDimensions({nodeDimensionsIncludeLabels:X.nodeDimensionsIncludeLabels});if(O.outerWidth()!=null&&O.outerHeight()!=null)if(X.randomize)if(!O.isParent())Z=R.add(new g($.graphManager,new t(B[Y.get(O.id())]-tt.w/2,A[Y.get(O.id())]-tt.h/2),new s(parseFloat(tt.w),parseFloat(tt.h))));else{var ht=f.calcBoundingBox(O,B,A,Y);O.intersection(p).length==0?Z=R.add(new g($.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(ht.width,ht.height))):Z=R.add(new g($.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(parseFloat(tt.w),parseFloat(tt.h))))}else Z=R.add(new g($.graphManager,new t(O.position("x")-tt.w/2,O.position("y")-tt.h/2),new s(parseFloat(tt.w),parseFloat(tt.h))));else Z=R.add(new g(this.graphManager));if(Z.id=O.data("id"),Z.nodeRepulsion=E(X.nodeRepulsion,O),Z.paddingLeft=parseInt(O.css("padding")),Z.paddingTop=parseInt(O.css("padding")),Z.paddingRight=parseInt(O.css("padding")),Z.paddingBottom=parseInt(O.css("padding")),X.nodeDimensionsIncludeLabels&&(Z.labelWidth=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,Z.labelHeight=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,Z.labelPosVertical=O.css("text-valign"),Z.labelPosHorizontal=O.css("text-halign")),j[O.data("id")]=Z,isNaN(Z.rect.x)&&(Z.rect.x=0),isNaN(Z.rect.y)&&(Z.rect.y=0),H!=null&&H.length>0){var J=void 0;J=$.getGraphManager().add($.newGraph(),Z),W(J,H,$,X)}}},y=function(R,Q,$){for(var X=0,rt=0,z=0;z<$.length;z++){var O=$[z],H=j[O.data("source")],Z=j[O.data("target")];if(H&&Z&&H!==Z&&H.getEdgesBetween(Z).length==0){var tt=Q.add(R.newEdge(),H,Z);tt.id=O.id(),tt.idealLength=E(d.idealEdgeLength,O),tt.edgeElasticity=E(d.edgeElasticity,O),X+=tt.idealLength,rt++}}d.idealEdgeLength!=null&&(rt>0?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:a(d.idealEdgeLength)?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,h.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,h.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},S=function(R,Q){Q.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(R.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(h.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(h.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(h.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(h.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(h.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,h.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,h.TILE=d.tile,h.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,h.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,h.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!1),d.step=="enforced"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!1),d.step=="cose"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?h.TREE_REDUCTION_ON_INCREMENTAL=!1:h.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new e,F=D.newGraphManager();return m(F.addRoot(),f.getTopMostNodes(G),D,d),y(D,F,V),S(D,d),D.runLayout(),j};n.exports={coseLayout:T}}),212:((n,r,i)=>{var f=(function(){function d(L,b){for(var w=0;w<b.length;w++){var G=b[w];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(L,G.key,G)}}return function(L,b,w){return b&&d(L.prototype,b),w&&d(L,w),L}})();function e(d,L){if(!(d instanceof L))throw new TypeError("Cannot call a class as a function")}var g=i(658),t=i(548),s=i(657),o=s.spectralLayout,c=i(816),h=c.coseLayout,T=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(L){return 4500},idealEdgeLength:function(L){return 50},edgeElasticity:function(L){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),u=(function(){function d(L){e(this,d),this.options=g({},T,L)}return f(d,[{key:"run",value:function(){var b=this,w=this.options,G=w.cy,V=w.eles,Y=[],B=[],A=void 0,j=[];w.fixedNodeConstraint&&(!Array.isArray(w.fixedNodeConstraint)||w.fixedNodeConstraint.length==0)&&(w.fixedNodeConstraint=void 0),w.alignmentConstraint&&(w.alignmentConstraint.vertical&&(!Array.isArray(w.alignmentConstraint.vertical)||w.alignmentConstraint.vertical.length==0)&&(w.alignmentConstraint.vertical=void 0),w.alignmentConstraint.horizontal&&(!Array.isArray(w.alignmentConstraint.horizontal)||w.alignmentConstraint.horizontal.length==0)&&(w.alignmentConstraint.horizontal=void 0)),w.relativePlacementConstraint&&(!Array.isArray(w.relativePlacementConstraint)||w.relativePlacementConstraint.length==0)&&(w.relativePlacementConstraint=void 0);var a=w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint;a&&(w.tile=!1,w.packComponents=!1);var E=void 0,p=!1;if(G.layoutUtilities&&w.packComponents&&(E=G.layoutUtilities("get"),E||(E=G.layoutUtilities()),p=!0),V.nodes().length>0)if(p){var S=t.getTopMostNodes(w.eles.nodes());if(A=t.connectComponents(G,w.eles,S),A.forEach(function(vt){var it=vt.boundingBox();j.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&A.forEach(function(vt){w.eles=vt,Y.push(o(w))}),w.quality=="default"||w.quality=="proof"){var D=G.collection();if(w.tile){var F=new Map,W=[],R=[],Q=0,$={nodeIndexes:F,xCoords:W,yCoords:R},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||($.nodeIndexes.set(vt.nodes()[Et].id(),Q++),$.xCoords.push(vt.nodes()[0].position().x),$.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();j.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push($);for(var z=X.length-1;z>=0;z--)A.splice(X[z],1),Y.splice(X[z],1),j.splice(X[z],1)}}A.forEach(function(vt,it){w.eles=vt,B.push(h(w,Y[it])),t.relocateComponent(j[it],B[it],w)})}else A.forEach(function(vt,it){t.relocateComponent(j[it],Y[it],w)});var O=new Set;if(A.length>1){var H=[],Z=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(Z).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(Z).forEach(function(Dt){if(w.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else B[it][Dt.id()]&&Et.nodes.push({x:B[it][Dt.id()].getLeft(),y:B[it][Dt.id()].getTop(),width:B[it][Dt.id()].getWidth(),height:B[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(Y[it].xCoords[Ht]),Pt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else B[it][mt.id()]&&B[it][Ot.id()]&&Et.edges.push({startX:B[it][mt.id()].getCenterX(),startY:B[it][mt.id()].getCenterY(),endX:B[it][Ot.id()].getCenterX(),endY:B[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys(B[vt]).forEach(function(it){var ut=B[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(j.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);Y.push(y)}w.quality=="default"||w.quality=="proof"?(B.push(h(w,Y[0])),t.relocateComponent(j[0],B[0],w)):t.relocateComponent(j[0],Y[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return B.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),w.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(G,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});w.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(b,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();n.exports=u}),657:((n,r,i)=>{var f=i(548),e=i(140).layoutBase.Matrix,g=i(140).layoutBase.SVD,t=function(o){var c=o.cy,h=o.eles,T=h.nodes(),u=h.nodes(":parent"),d=new Map,L=new Map,b=new Map,w=[],G=[],V=[],Y=[],B=[],A=[],j=[],a=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,S=o.samplingType,D=o.nodeSeparation,F=void 0,W=function(){for(var U=0,k=0,K=!1;k<F;){U=Math.floor(Math.random()*E),K=!1;for(var q=0;q<k;q++)if(Y[q]==U){K=!0;break}if(!K)Y[k]=U,k++;else continue}},R=function(U,k,K){for(var q=[],at=0,gt=0,nt=0,et=void 0,_=[],dt=0,Mt=1,pt=0;pt<E;pt++)_[pt]=p;for(q[gt]=U,_[U]=0;gt>=at;){nt=q[at++];for(var xt=w[nt],lt=0;lt<xt.length;lt++)et=L.get(xt[lt]),_[et]==p&&(_[et]=_[nt]+1,q[++gt]=et);A[nt][k]=_[nt]*D}if(K){for(var ot=0;ot<E;ot++)A[ot][k]<B[ot]&&(B[ot]=A[ot][k]);for(var Lt=0;Lt<E;Lt++)B[Lt]>dt&&(dt=B[Lt],Mt=Lt)}return Mt},Q=function(U){var k=void 0;if(U){k=Math.floor(Math.random()*E);for(var q=0;q<E;q++)B[q]=p;for(var at=0;at<F;at++)Y[at]=k,k=R(k,at,U)}else{W();for(var K=0;K<F;K++)R(Y[K],K,U)}for(var gt=0;gt<E;gt++)for(var nt=0;nt<F;nt++)A[gt][nt]*=A[gt][nt];for(var et=0;et<F;et++)j[et]=[];for(var _=0;_<F;_++)for(var dt=0;dt<F;dt++)j[_][dt]=A[Y[dt]][_]},$=function(){for(var U=g.svd(j),k=U.S,K=U.U,q=U.V,at=k[0]*k[0]*k[0],gt=[],nt=0;nt<F;nt++){gt[nt]=[];for(var et=0;et<F;et++)gt[nt][et]=0,nt==et&&(gt[nt][et]=k[nt]/(k[nt]*k[nt]+at/(k[nt]*k[nt])))}a=e.multMat(e.multMat(q,gt),e.transpose(K))},X=function(){for(var U=void 0,k=void 0,K=[],q=[],at=[],gt=[],nt=0;nt<E;nt++)K[nt]=Math.random(),q[nt]=Math.random();K=e.normalize(K),q=e.normalize(q);for(var et=m,_=m,dt=void 0;;){for(var Mt=0;Mt<E;Mt++)at[Mt]=K[Mt];if(K=e.multGamma(e.multL(e.multGamma(at),A,a)),U=e.dotProduct(at,K),K=e.normalize(K),et=e.dotProduct(at,K),dt=Math.abs(et/_),dt<=1+y&&dt>=1)break;_=et}for(var pt=0;pt<E;pt++)at[pt]=K[pt];for(_=m;;){for(var xt=0;xt<E;xt++)gt[xt]=q[xt];if(gt=e.minusOp(gt,e.multCons(at,e.dotProduct(at,gt))),q=e.multGamma(e.multL(e.multGamma(gt),A,a)),k=e.dotProduct(gt,q),q=e.normalize(q),et=e.dotProduct(gt,q),dt=Math.abs(et/_),dt<=1+y&&dt>=1)break;_=et}for(var lt=0;lt<E;lt++)gt[lt]=q[lt];G=e.multCons(at,Math.sqrt(Math.abs(U))),V=e.multCons(gt,Math.sqrt(Math.abs(k)))};f.connectComponents(c,h,f.getTopMostNodes(T),d),u.forEach(function(P){f.connectComponents(c,h,f.getTopMostNodes(P.descendants().intersection(h)),d)});for(var rt=0,z=0;z<T.length;z++)T[z].isParent()||L.set(T[z].id(),rt++);var O=!0,H=!1,Z=void 0;try{for(var tt=d.keys()[Symbol.iterator](),ht;!(O=(ht=tt.next()).done);O=!0){var J=ht.value;L.set(J,rt++)}}catch(P){H=!0,Z=P}finally{try{!O&&tt.return&&tt.return()}finally{if(H)throw Z}}for(var It=0;It<L.size;It++)w[It]=[];u.forEach(function(P){for(var U=P.children().intersection(h);U.nodes(":childless").length==0;)U=U.nodes()[0].children().intersection(h);var k=0,K=U.nodes(":childless")[0].connectedEdges().length;U.nodes(":childless").forEach(function(q,at){q.connectedEdges().length<K&&(K=q.connectedEdges().length,k=at)}),b.set(P.id(),U.nodes(":childless")[k].id())}),T.forEach(function(P){var U=void 0;P.isParent()?U=L.get(b.get(P.id())):U=L.get(P.id()),P.neighborhood().nodes().forEach(function(k){h.intersection(P.edgesWith(k)).length>0&&(k.isParent()?w[U].push(b.get(k.id())):w[U].push(k.id()))})});var Nt=function(U){var k=L.get(U),K=void 0;d.get(U).forEach(function(q){c.getElementById(q).isParent()?K=b.get(q):K=q,w[k].push(K),w[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(P){it=!0,ut=P}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){F=E<o.sampleSize?E:o.sampleSize;for(var Ot=0;Ot<E;Ot++)A[Ot]=[];for(var Rt=0;Rt<F;Rt++)a[Rt]=[];return o.quality=="draft"||o.step=="all"?(Q(S),$(),X(),mt={nodeIndexes:L,xCoords:G,yCoords:V}):(L.forEach(function(P,U){G.push(c.getElementById(U).position("x")),V.push(c.getElementById(U).position("y"))}),mt={nodeIndexes:L,xCoords:G,yCoords:V}),mt}else{var Ht=L.keys(),Ut=c.getElementById(Ht.next().value),Pt=Ut.position(),Ft=Ut.outerWidth();if(G.push(Pt.x),V.push(Pt.y),E==2){var Yt=c.getElementById(Ht.next().value),Vt=Yt.outerWidth();G.push(Pt.x+Ft/2+Vt/2+o.idealEdgeLength),V.push(Pt.y)}return mt={nodeIndexes:L,xCoords:G,yCoords:V},mt}};n.exports={spectralLayout:t}}),579:((n,r,i)=>{var f=i(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),n.exports=e}),140:(n=>{n.exports=C})},N={};function v(n){var r=N[n];if(r!==void 0)return r.exports;var i=N[n]={exports:{}};return x[n](i,i.exports,v),i.exports}var l=v(579);return l})()})})(he)),he.exports}var Tr=Er();const Nr=ur(Tr);var Ie={L:"left",R:"right",T:"top",B:"bottom"},Re={L:ct(I=>`${I},${I/2} 0,${I} 0,0`,"L"),R:ct(I=>`0,${I/2} ${I},0 ${I},${I}`,"R"),T:ct(I=>`0,0 ${I},0 ${I/2},${I}`,"T"),B:ct(I=>`${I/2},0 ${I},${I} 0,${I}`,"B")},se={L:ct((I,M)=>I-M+2,"L"),R:ct((I,M)=>I-2,"R"),T:ct((I,M)=>I-M+2,"T"),B:ct((I,M)=>I-2,"B")},Lr=ct(function(I){return Wt(I)?I==="L"?"R":"L":I==="T"?"B":"T"},"getOppositeArchitectureDirection"),Se=ct(function(I){const M=I;return M==="L"||M==="R"||M==="T"||M==="B"},"isArchitectureDirection"),Wt=ct(function(I){const M=I;return M==="L"||M==="R"},"isArchitectureDirectionX"),qt=ct(function(I){const M=I;return M==="T"||M==="B"},"isArchitectureDirectionY"),Ne=ct(function(I,M){const C=Wt(I)&&qt(M),x=qt(I)&&Wt(M);return C||x},"isArchitectureDirectionXY"),wr=ct(function(I){const M=I[0],C=I[1],x=Wt(M)&&qt(C),N=qt(M)&&Wt(C);return x||N},"isArchitecturePairXY"),Cr=ct(function(I){return I!=="LL"&&I!=="RR"&&I!=="TT"&&I!=="BB"},"isValidArchitectureDirectionPair"),ye=ct(function(I,M){const C=`${I}${M}`;return Cr(C)?C:void 0},"getArchitectureDirectionPair"),Mr=ct(function([I,M],C){const x=C[0],N=C[1];return Wt(x)?qt(N)?[I+(x==="L"?-1:1),M+(N==="T"?1:-1)]:[I+(x==="L"?-1:1),M]:Wt(N)?[I+(N==="L"?1:-1),M+(x==="T"?1:-1)]:[I,M+(x==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ar=ct(function(I){return I==="LT"||I==="TL"?[1,1]:I==="BL"||I==="LB"?[1,-1]:I==="BR"||I==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Dr=ct(function(I,M){return Ne(I,M)?"bend":Wt(I)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Or=ct(function(I){return I.type==="service"},"isArchitectureService"),xr=ct(function(I){return I.type==="junction"},"isArchitectureJunction"),Pe=ct((I,M)=>{const[C,x]=[I,M].sort();return`${JSON.stringify(C)}-${JSON.stringify(x)}`},"architectureGroupAlignmentKey"),Ge=ct(I=>I.data(),"edgeData"),ie=ct(I=>I.data(),"nodeData"),Ir=or.architecture,ae,Ue=(ae=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}setDiagramId(M){this.diagramId=M}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:M,icon:C,in:x,title:N,iconText:v}){if(this.registeredIds.has(M))throw new Error(`The service id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The service [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(x)==="node")throw new Error(`The service [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"service",icon:C,iconText:v,title:N,edges:[],in:x})}getServices(){return[...this.nodes.values()].filter(Or)}addJunction({id:M,in:C}){if(this.registeredIds.has(M))throw new Error(`The junction id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(C!==void 0){if(M===C)throw new Error(`The junction [${M}] cannot be placed within itself`);if(!this.registeredIds.has(C))throw new Error(`The junction [${M}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(C)==="node")throw new Error(`The junction [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"junction",edges:[],in:C})}getJunctions(){return[...this.nodes.values()].filter(xr)}getNodes(){return[...this.nodes.values()]}getNode(M){return this.nodes.get(M)??null}addGroup({id:M,icon:C,in:x,title:N}){if(this.registeredIds.has(M))throw new Error(`The group id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(x!==void 0){if(M===x)throw new Error(`The group [${M}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw new Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(x)==="node")throw new Error(`The group [${M}]'s parent is not a group`)}this.registeredIds.set(M,"group"),this.groups.set(M,{id:M,icon:C,title:N,in:x})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:M,rhsId:C,lhsDir:x,rhsDir:N,lhsInto:v,rhsInto:l,lhsGroup:n,rhsGroup:r,title:i}){if(!Se(x))throw new Error(`Invalid direction given for left hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(x)}`);if(!Se(N))throw new Error(`Invalid direction given for right hand side of edge ${M}--${C}. Expected (L,R,T,B) got ${String(N)}`);if(!this.nodes.has(M)&&!this.groups.has(M))throw new Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(C)&&!this.groups.has(C))throw new Error(`The right-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes.get(M).in,e=this.nodes.get(C).in;if(n&&f&&e&&f==e)throw new Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&f&&e&&f==e)throw new Error(`The right-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const g={lhsId:M,lhsDir:x,lhsInto:v,lhsGroup:n,rhsId:C,rhsDir:N,rhsInto:l,rhsGroup:r,title:i};this.edges.push(g);const t=this.nodes.get(M),s=this.nodes.get(C);t&&s&&(t.edges.push(this.edges[this.edges.length-1]),s.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(M){if(M.members.length<2)throw new Error(`An align directive requires at least two members; got ${M.members.length}`);const C=new Set;M.members.forEach(x=>{if(this.registeredIds.get(x)!=="node")throw new Error(`align ${M.direction} references [${x}], which is not a service or junction`);if(C.has(x))throw new Error(`align ${M.direction} lists [${x}] more than once`);C.add(x)}),this.layoutHints.push(M)}getLayoutHints(){return this.layoutHints}getDataStructures(){var M,C;if(this.dataStructures===void 0){const x=new Map,N=new Map;for(const[i,f]of this.nodes.entries()){const e=new Map;for(const g of f.edges){const t=(M=this.getNode(g.lhsId))==null?void 0:M.in,s=(C=this.getNode(g.rhsId))==null?void 0:C.in;if(t&&s&&t!==s){const o=Dr(g.lhsDir,g.rhsDir);o!=="bend"&&x.set(Pe(t,s),o)}if(g.lhsId===i){const o=ye(g.lhsDir,g.rhsDir);o&&e.set(o,g.rhsId)}else{const o=ye(g.rhsDir,g.lhsDir);o&&e.set(o,g.lhsId)}}N.set(i,e)}const v=new Set,l=new Set(N.keys()),n=ct(i=>{const f=new Map([[i,[0,0]]]),e=[i];for(;e.length>0;){const g=e.shift();if(g){v.add(g),l.delete(g);const t=N.get(g);if(!t)throw new Error(`BFS error: adjacency list for id ${g} not found. Please report this as a bug.`);const s=f.get(g);if(!s)throw new Error(`BFS error: position for id ${g} not found in spatial map. Please report this as a bug.`);const[o,c]=s;t.forEach((h,T)=>{v.has(h)||(f.set(h,Mr([o,c],T)),e.push(h))})}}return f},"BFS"),r=[];for(;l.size>0;){const i=l.values().next().value;r.push(n(i))}this.dataStructures={adjList:N,spatialMaps:r,groupAlignments:x}}return this.dataStructures}setElementForId(M,C){this.elements.set(M,C)}getElementById(M){return this.elements.get(M)}getConfig(){return ar({...Ir,...nr().architecture})}getConfigField(M){return this.getConfig()[M]}},ct(ae,"ArchitectureDB"),ae),Rr=ct((I,M)=>{var C;qe(I,M),I.groups.map(x=>M.addGroup(x)),I.services.map(x=>M.addService({...x,type:"service"})),I.junctions.map(x=>M.addJunction({...x,type:"junction"})),I.edges.map(x=>M.addEdge(x)),(C=I.alignments)==null||C.map(x=>M.addLayoutHint({direction:x.direction,members:[...x.members]}))},"populateDb"),Ye={parser:{yy:void 0},parse:ct(async I=>{var x;const M=await gr("architecture",I);Fe.debug(M);const C=(x=Ye.parser)==null?void 0:x.yy;if(!(C instanceof Ue))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Rr(M,C)},"parse")},Sr=ct(I=>`
2
2
  .edge {
3
3
  stroke-width: ${I.archEdgeWidth};
4
4
  stroke: ${I.archEdgeColor};