@leanspec/ui 0.2.21 → 0.2.23

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 (129) hide show
  1. package/dist/assets/_baseUniq-C4bkXOdh-BJ3-SRjw.js +1 -0
  2. package/dist/assets/{_baseUniq--5gbTAb8.js → _baseUniq-DuAmhUI0.js} +1 -1
  3. package/dist/assets/arc-DFohBtPV-Cpx6wOGp.js +1 -0
  4. package/dist/assets/{arc-4N6yDHjl.js → arc-DlFrPohT.js} +1 -1
  5. package/dist/assets/{architectureDiagram-VXUJARFQ-DDCzyF2V.js → architectureDiagram-VXUJARFQ-DieXp-qW.js} +1 -1
  6. package/dist/assets/architectureDiagram-VXUJARFQ-_R9_zrc5-D59ZHzYq.js +36 -0
  7. package/dist/assets/blockDiagram-VD42YOAC-CiyHYW6w-D8Afi1Q2.js +122 -0
  8. package/dist/assets/{blockDiagram-VD42YOAC-CqzgSlfV.js → blockDiagram-VD42YOAC-Cr1Ymz-c.js} +1 -1
  9. package/dist/assets/c4Diagram-YG6GDRKO-D9NuNc3r-Cre6pw7Q.js +10 -0
  10. package/dist/assets/{c4Diagram-YG6GDRKO-DcDDI9XD.js → c4Diagram-YG6GDRKO-w76CB7zN.js} +1 -1
  11. package/dist/assets/channel-C9MJ1fN1.js +1 -0
  12. package/dist/assets/channel-mhjF1lKa-DRGKdmbU.js +1 -0
  13. package/dist/assets/{chunk-4BX2VUAB-CVAs-OQz.js → chunk-4BX2VUAB-C4VXUg_9.js} +1 -1
  14. package/dist/assets/chunk-4BX2VUAB-D4Zhvat9-CJ2cQFgO.js +1 -0
  15. package/dist/assets/{chunk-55IACEB6-Dd3NjClm-icx5kZVe.js → chunk-55IACEB6-C_MzxCLx-DeYSk-O4.js} +1 -1
  16. package/dist/assets/{chunk-55IACEB6-Ccr-HMFu.js → chunk-55IACEB6-DUEMD_vX.js} +1 -1
  17. package/dist/assets/{chunk-B4BG7PRW-xLNbTmXA.js → chunk-B4BG7PRW-DlwRLtQb.js} +1 -1
  18. package/dist/assets/{chunk-B4BG7PRW-DLUrgkJI-Cic_-nsr.js → chunk-B4BG7PRW-Q8H7OQ1o-CGrle4fB.js} +6 -6
  19. package/dist/assets/{chunk-DI55MBZ5-BsHIkgDC.js → chunk-DI55MBZ5-DqvoeGRX.js} +1 -1
  20. package/dist/assets/chunk-DI55MBZ5-qwPYmgAw-BDnXruql.js +220 -0
  21. package/dist/assets/{chunk-FMBD7UC4-6dsbMKM7-DZVEYpsF.js → chunk-FMBD7UC4-DhXvRHU3-Ck_6Dma3.js} +1 -1
  22. package/dist/assets/{chunk-FMBD7UC4-CN5kw4_J.js → chunk-FMBD7UC4-eFjHw5gB.js} +1 -1
  23. package/dist/assets/chunk-QN33PNHL-CLwAcvO2-CC8RVa2u.js +1 -0
  24. package/dist/assets/{chunk-QN33PNHL-CHu6LVbN.js → chunk-QN33PNHL-CXXtNr0q.js} +1 -1
  25. package/dist/assets/{chunk-QZHKN3VN-CVAEdzef-CICjYRZu.js → chunk-QZHKN3VN-3tLb49S_-7wBVjYM3.js} +1 -1
  26. package/dist/assets/{chunk-QZHKN3VN-DOlyc5a_.js → chunk-QZHKN3VN-HkJTS77T.js} +1 -1
  27. package/dist/assets/{chunk-TZMSLE5B-qgYeZfVw.js → chunk-TZMSLE5B-CC9IwurK.js} +1 -1
  28. package/dist/assets/{chunk-TZMSLE5B-Cc8_PJIq-DBNHj8Jc.js → chunk-TZMSLE5B-DfaYobmr-uCvXwJUe.js} +1 -1
  29. package/dist/assets/classDiagram-2ON5EDUG-Dl5mwgLk.js +1 -0
  30. package/dist/assets/classDiagram-2ON5EDUG-xB0RyXwt-B4jZvvsf.js +1 -0
  31. package/dist/assets/classDiagram-v2-WZHVMYZB-Dl5mwgLk.js +1 -0
  32. package/dist/assets/classDiagram-v2-WZHVMYZB-xB0RyXwt-B4jZvvsf.js +1 -0
  33. package/dist/assets/clone-B-ElcgAC.js +1 -0
  34. package/dist/assets/clone-DqT6If4_-aVfgI0F6.js +1 -0
  35. package/dist/assets/code-block-37QAKDTI-CWOOD74I-DcBaZRtr.js +2 -0
  36. package/dist/assets/{cose-bilkent-S5V4N54A-aMn5Snue.js → cose-bilkent-S5V4N54A-BYenyErH.js} +1 -1
  37. package/dist/assets/{cose-bilkent-S5V4N54A-0O3dLIoy-Au1JV0Hr.js → cose-bilkent-S5V4N54A-DBS7wwrE-CwpmLGLG.js} +1 -1
  38. package/dist/assets/{cytoscape.esm-CjI2IsL8-U70Mzu-N.js → cytoscape.esm-Cvf3sx9F-DgU3JdRZ.js} +1 -1
  39. package/dist/assets/{dagre-6UL2VRFP-C0nN6YID.js → dagre-6UL2VRFP-DC4sfLGs.js} +1 -1
  40. package/dist/assets/dagre-6UL2VRFP-Lv6cE2gX-BtLPrZf0.js +4 -0
  41. package/dist/assets/diagram-PSM6KHXK-8QKT-Vki-CYrLTehq.js +24 -0
  42. package/dist/assets/{diagram-PSM6KHXK-DhvTMswv.js → diagram-PSM6KHXK-DSaG1dLc.js} +1 -1
  43. package/dist/assets/diagram-QEK2KX5R-Bqh-tlSV-BSsdJ6p7.js +43 -0
  44. package/dist/assets/{diagram-QEK2KX5R-w4lZ6XEJ.js → diagram-QEK2KX5R-z8D6ilji.js} +1 -1
  45. package/dist/assets/diagram-S2PKOQOG-Csj0p-s--BSyJI4Aq.js +24 -0
  46. package/dist/assets/{diagram-S2PKOQOG-DOXHCu2g.js → diagram-S2PKOQOG-gFoeY1VL.js} +1 -1
  47. package/dist/assets/{erDiagram-Q2GNP2WA-B0P-TPNi.js → erDiagram-Q2GNP2WA-oZvzX2B_.js} +1 -1
  48. package/dist/assets/{erDiagram-Q2GNP2WA-CXv6THpi-Cd4jg1J5.js → erDiagram-Q2GNP2WA-sDpapMNP-BlW75l-5.js} +5 -5
  49. package/dist/assets/flowDiagram-NV44I4VS-CitCGiJE-2Yn6xqge.js +162 -0
  50. package/dist/assets/{flowDiagram-NV44I4VS-KDzE7AT1.js → flowDiagram-NV44I4VS-DNfZjFHv.js} +1 -1
  51. package/dist/assets/{ganttDiagram-JELNMOA3-Ce3vKfsr.js → ganttDiagram-JELNMOA3-CI7qwp_G.js} +1 -1
  52. package/dist/assets/{ganttDiagram-JELNMOA3-CqVYbgbk-Dm-Q7o3L.js → ganttDiagram-JELNMOA3-DAaUYzNs-CqERSUiR.js} +3 -3
  53. package/dist/assets/{gitGraphDiagram-NY62KEGX-DDQ3wMsb.js → gitGraphDiagram-NY62KEGX-CTRy4vBb.js} +1 -1
  54. package/dist/assets/gitGraphDiagram-NY62KEGX-lj732X3H-CLhZmLfE.js +65 -0
  55. package/dist/assets/{graph-rt_wscbL-BYOC6Zos.js → graph-Bg_3T7Ud-8p9G4Jrq.js} +1 -1
  56. package/dist/assets/{graph-CIQI-Qnx.js → graph-C_DQAJXv.js} +1 -1
  57. package/dist/assets/index-BA4_7VkX.css +1 -0
  58. package/dist/assets/index-BzhKcNOt.js +2548 -0
  59. package/dist/assets/infoDiagram-WHAUD3N6-BbjOpAi3-DFq7Zumb.js +2 -0
  60. package/dist/assets/{infoDiagram-WHAUD3N6-CKi2MdjK.js → infoDiagram-WHAUD3N6-BjgZuatx.js} +1 -1
  61. package/dist/assets/{journeyDiagram-XKPGCS4Q-BzZgPZwu-FS4BVd7N.js → journeyDiagram-XKPGCS4Q-Cx34P8cj-Cuc55qMS.js} +4 -4
  62. package/dist/assets/{journeyDiagram-XKPGCS4Q-C8gYN3B8.js → journeyDiagram-XKPGCS4Q-JTQBV6RS.js} +1 -1
  63. package/dist/assets/kanban-definition-3W4ZIXB7-BP3ykzKL-BccB0ADl.js +89 -0
  64. package/dist/assets/{kanban-definition-3W4ZIXB7-CJBvuSy_.js → kanban-definition-3W4ZIXB7-CB7Cc0I4.js} +1 -1
  65. package/dist/assets/{layout-BoDR3kQT.js → layout-BDWTKgn6.js} +1 -1
  66. package/dist/assets/{layout-CX9neEHw-DZXKxUst.js → layout-Bft_7Aja-CYwoLCqB.js} +1 -1
  67. package/dist/assets/{linear-CkUVga7d-DcwQdvDv.js → linear-BDIyMYXP-Va3gUrsu.js} +1 -1
  68. package/dist/assets/{min-USsdh-HW.js → min-CzDI_uFs.js} +1 -1
  69. package/dist/assets/min-g4o2CnuX-D41MdeNm.js +1 -0
  70. package/dist/assets/{mindmap-definition-VGOIOE7T-CahlRCoo.js → mindmap-definition-VGOIOE7T-BFemN0Et.js} +1 -1
  71. package/dist/assets/mindmap-definition-VGOIOE7T-CteUNe1z-BgC77XEX.js +68 -0
  72. package/dist/assets/{pieDiagram-ADFJNKIX-B3ej6Rof.js → pieDiagram-ADFJNKIX-2fKAK3CV.js} +1 -1
  73. package/dist/assets/pieDiagram-ADFJNKIX-COS6mtim-2rnhimKu.js +30 -0
  74. package/dist/assets/{quadrantDiagram-AYHSOK5B-Di2kSbDD.js → quadrantDiagram-AYHSOK5B-Del1ofYi.js} +1 -1
  75. package/dist/assets/quadrantDiagram-AYHSOK5B-DmRa7VCS-D5jPyfOD.js +7 -0
  76. package/dist/assets/{requirementDiagram-UZGBJVZJ-MnXD59Yw-DoLLmzEr.js → requirementDiagram-UZGBJVZJ-CcQIz-20-DYIFGLWB.js} +7 -7
  77. package/dist/assets/{requirementDiagram-UZGBJVZJ-BIKMHzOU.js → requirementDiagram-UZGBJVZJ-aYICY3Ph.js} +1 -1
  78. package/dist/assets/{sankeyDiagram-TZEHDZUN-B45aWneB.js → sankeyDiagram-TZEHDZUN-CSxXWX7b.js} +1 -1
  79. package/dist/assets/{sankeyDiagram-TZEHDZUN-Dfyu7oJ6-upd_w6uL.js → sankeyDiagram-TZEHDZUN-CpcshR0Z-Ds6_Y4XZ.js} +8 -8
  80. package/dist/assets/sequenceDiagram-WL72ISMW-B1iDbV8x-Ba6xj9am.js +145 -0
  81. package/dist/assets/{sequenceDiagram-WL72ISMW-0WGvejjk.js → sequenceDiagram-WL72ISMW-_zLrGWf3.js} +1 -1
  82. package/dist/assets/{stateDiagram-FKZM4ZOC-DYV-na53-BrTgUi_v.js → stateDiagram-FKZM4ZOC-DIutB6RS-BM8RqJKW.js} +1 -1
  83. package/dist/assets/{stateDiagram-FKZM4ZOC-CyN90BQP.js → stateDiagram-FKZM4ZOC-DOd4P3H-.js} +1 -1
  84. package/dist/assets/stateDiagram-v2-4FDKWEC3-BKEaZomO-8zJq3ge5.js +1 -0
  85. package/dist/assets/stateDiagram-v2-4FDKWEC3-nRAFnllC.js +1 -0
  86. package/dist/assets/{timeline-definition-IT6M3QCI-B_SrPNXx.js → timeline-definition-IT6M3QCI-BKxuM11p.js} +1 -1
  87. package/dist/assets/timeline-definition-IT6M3QCI-D1yY4TSO-DoVTwDMg.js +61 -0
  88. package/dist/assets/{treemap-KMMF4GRG-Bj5u1csA.js → treemap-KMMF4GRG-ByJ02xk5.js} +1 -1
  89. package/dist/assets/{treemap-KMMF4GRG-l6HrdCLC-BpLaQV_H.js → treemap-KMMF4GRG-KtkxYt13-CZA1d7fY.js} +59 -59
  90. package/dist/assets/{xychartDiagram-PRI3JC2R-Ca3wGEm0.js → xychartDiagram-PRI3JC2R-CGA3Bi-e.js} +1 -1
  91. package/dist/assets/{xychartDiagram-PRI3JC2R-CkfCv2o_-BblxmbGy.js → xychartDiagram-PRI3JC2R-a_g9ptTp-BX4uGx-D.js} +3 -3
  92. package/dist/index.html +2 -2
  93. package/package.json +8 -15
  94. package/dist/assets/_baseUniq-KSDS6tgF-vSUSx1j2.js +0 -1
  95. package/dist/assets/arc-C-X5Xt_b-DxNTmc8E.js +0 -1
  96. package/dist/assets/architectureDiagram-VXUJARFQ-Bal8NTn4-C3CDAmmj.js +0 -36
  97. package/dist/assets/blockDiagram-VD42YOAC-B2gTo5wW-Chk-bWEZ.js +0 -122
  98. package/dist/assets/c4Diagram-YG6GDRKO-dIf_vNCY-B78U9OXb.js +0 -10
  99. package/dist/assets/channel-CXjddKEr.js +0 -1
  100. package/dist/assets/channel-klR7o7JB-D3KnrQ1u.js +0 -1
  101. package/dist/assets/chunk-4BX2VUAB-BQgzc1Sm-3MUJBN6J.js +0 -1
  102. package/dist/assets/chunk-DI55MBZ5-BwHLqSW9-Dg6tgfWJ.js +0 -220
  103. package/dist/assets/chunk-QN33PNHL-DHNejhbC-DbJMzG-e.js +0 -1
  104. package/dist/assets/classDiagram-2ON5EDUG-Cf3QVtDa.js +0 -1
  105. package/dist/assets/classDiagram-2ON5EDUG-D7bjndmT-0h2otGW6.js +0 -1
  106. package/dist/assets/classDiagram-v2-WZHVMYZB-Cf3QVtDa.js +0 -1
  107. package/dist/assets/classDiagram-v2-WZHVMYZB-D7bjndmT-0h2otGW6.js +0 -1
  108. package/dist/assets/clone-7srXemyd-DGxkCAtg.js +0 -1
  109. package/dist/assets/clone-DZrMJ9hz.js +0 -1
  110. package/dist/assets/code-block-37QAKDTI-MRm4xHKr-DLRpbM4W.js +0 -2
  111. package/dist/assets/dagre-6UL2VRFP-BqaZre9N-vdYA4a1q.js +0 -4
  112. package/dist/assets/diagram-PSM6KHXK-s2xYLlND-B6BOy07D.js +0 -24
  113. package/dist/assets/diagram-QEK2KX5R-D700jvoY-tTlqymfs.js +0 -43
  114. package/dist/assets/diagram-S2PKOQOG-BkgBSa1Q-59esupTS.js +0 -24
  115. package/dist/assets/flowDiagram-NV44I4VS-Dsrv00Gy-Cz-kjEu8.js +0 -162
  116. package/dist/assets/gitGraphDiagram-NY62KEGX-DOanbk62-D2EAn-OM.js +0 -65
  117. package/dist/assets/index-BXRJOAs4.js +0 -2540
  118. package/dist/assets/index-C5i0a-mH.css +0 -1
  119. package/dist/assets/infoDiagram-WHAUD3N6-Fq8ToFQ6-BmtVQ1WU.js +0 -2
  120. package/dist/assets/kanban-definition-3W4ZIXB7-CrmrjRAg-BJFHq-Xg.js +0 -89
  121. package/dist/assets/min-Ar5ebLd--DYc60i1a.js +0 -1
  122. package/dist/assets/mindmap-definition-VGOIOE7T-DeGZNL21-hbAsMota.js +0 -68
  123. package/dist/assets/pieDiagram-ADFJNKIX-C_V2NX6O-BNls6JWQ.js +0 -30
  124. package/dist/assets/quadrantDiagram-AYHSOK5B-B8fSnYQi-BEGj5HDN.js +0 -7
  125. package/dist/assets/sequenceDiagram-WL72ISMW-D2pgAoWi-CIx9uPOq.js +0 -145
  126. package/dist/assets/stateDiagram-v2-4FDKWEC3-Kp4sxr9o--i7eh5f-.js +0 -1
  127. package/dist/assets/stateDiagram-v2-4FDKWEC3-yJXh1tES.js +0 -1
  128. package/dist/assets/timeline-definition-IT6M3QCI-621ePKJ0-i5oeWE__.js +0 -61
  129. /package/dist/assets/{ordinal-DfAQgscy-Pc8f3NoK.js → ordinal-B6-f3MAq-Pc8f3NoK.js} +0 -0
@@ -0,0 +1,36 @@
1
+ import{H as pt,aP as ze,bh as Ve,a as be,aa as je,a9 as qe,ao as $e,ap as Ke,a8 as Ze,a7 as Je,au as Qe,aB as ti,aC as ei,aD as ii,b as me,bp as ve,bt as ce,ae as ri,a5 as ni,at as oi,bu as ai,bv as si,a6 as hi}from"./index-BzhKcNOt.js";import{t as li}from"./chunk-4BX2VUAB-D4Zhvat9-CJ2cQFgO.js";import{F as di}from"./treemap-KMMF4GRG-KtkxYt13-CZA1d7fY.js";import{e as De}from"./cytoscape.esm-Cvf3sx9F-DgU3JdRZ.js";import"./min-g4o2CnuX-D41MdeNm.js";import"./_baseUniq-C4bkXOdh-BJ3-SRjw.js";var ge={exports:{}},ue={exports:{}},fe={exports:{}},ci=fe.exports,Le;function gi(){return Le||(Le=1,(function(C,X){(function(L,S){C.exports=S()})(ci,function(){return(function(L){var S={};function N(u){if(S[u])return S[u].exports;var h=S[u]={i:u,l:!1,exports:{}};return L[u].call(h.exports,h,h.exports,N),h.l=!0,h.exports}return N.m=L,N.c=S,N.i=function(u){return u},N.d=function(u,h,n){N.o(u,h)||Object.defineProperty(u,h,{configurable:!1,enumerable:!0,get:n})},N.n=function(u){var h=u&&u.__esModule?(function(){return u.default}):(function(){return u});return N.d(h,"a",h),h},N.o=function(u,h){return Object.prototype.hasOwnProperty.call(u,h)},N.p="",N(N.s=28)})([(function(L,S,N){function u(){}u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,L.exports=u}),(function(L,S,N){var u=N(2),h=N(8),n=N(9);function i(a,o,f){u.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=a,this.target=o}i.prototype=Object.create(u.prototype);for(var e in u)i[e]=u[e];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(a,o){for(var f=this.getOtherEnd(a),t=o.getGraphManager().getRoot();;){if(f.getOwner()==o)return f;if(f.getOwner()==t)break;f=f.getOwner().getParent()}return null},i.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[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))},i.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)},L.exports=i}),(function(L,S,N){function u(h){this.vGraphObject=h}L.exports=u}),(function(L,S,N){var u=N(2),h=N(10),n=N(13),i=N(0),e=N(16),a=N(5);function o(t,s,l,g){l==null&&g==null&&(g=s),u.call(this,g),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=t,l!=null&&s!=null?this.rect=new n(s.x,s.y,l.width,l.height):this.rect=new n}o.prototype=Object.create(u.prototype);for(var f in u)o[f]=u[f];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(t){this.rect.width=t},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(t){this.rect.height=t},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.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},o.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},o.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},o.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},o.prototype.getEdgeListToNode=function(t){var s=[],l=this;return l.edges.forEach(function(g){if(g.target==t){if(g.source!=l)throw"Incorrect edge source!";s.push(g)}}),s},o.prototype.getEdgesBetween=function(t){var s=[],l=this;return l.edges.forEach(function(g){if(!(g.source==l||g.target==l))throw"Incorrect edge source and/or target";(g.target==t||g.source==t)&&s.push(g)}),s},o.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(l){if(l.source==s)t.add(l.target);else{if(l.target!=s)throw"Incorrect incidency!";t.add(l.source)}}),t},o.prototype.withChildren=function(){var t=new Set,s,l;if(t.add(this),this.child!=null)for(var g=this.child.getNodes(),d=0;d<g.length;d++)s=g[d],l=s.withChildren(),l.forEach(function(T){t.add(T)});return t},o.prototype.getNoOfChildren=function(){var t=0,s;if(this.child==null)t=1;else for(var l=this.child.getNodes(),g=0;g<l.length;g++)s=l[g],t+=s.getNoOfChildren();return t==0&&(t=1),t},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.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)},o.prototype.scatter=function(){var t,s,l=-i.INITIAL_WORLD_BOUNDARY,g=i.INITIAL_WORLD_BOUNDARY;t=i.WORLD_CENTER_X+e.nextDouble()*(g-l)+l;var d=-i.INITIAL_WORLD_BOUNDARY,T=i.INITIAL_WORLD_BOUNDARY;s=i.WORLD_CENTER_Y+e.nextDouble()*(T-d)+d,this.rect.x=t,this.rect.y=s},o.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()),i.NODE_DIMENSIONS_INCLUDE_LABELS){var s=t.getRight()-t.getLeft(),l=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(l+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>l?(this.rect.y-=(this.labelHeight-l)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(l+this.labelHeight))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(t){var s=this.rect.x;s>i.WORLD_BOUNDARY?s=i.WORLD_BOUNDARY:s<-i.WORLD_BOUNDARY&&(s=-i.WORLD_BOUNDARY);var l=this.rect.y;l>i.WORLD_BOUNDARY?l=i.WORLD_BOUNDARY:l<-i.WORLD_BOUNDARY&&(l=-i.WORLD_BOUNDARY);var g=new a(s,l),d=t.inverseTransformPoint(g);this.setLocation(d.x,d.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},L.exports=o}),(function(L,S,N){var u=N(0);function h(){}for(var n in u)h[n]=u[n];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,L.exports=h}),(function(L,S,N){function u(h,n){h==null&&n==null?(this.x=0,this.y=0):(this.x=h,this.y=n)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(h){this.x=h},u.prototype.setY=function(h){this.y=h},u.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},L.exports=u}),(function(L,S,N){var u=N(2),h=N(10),n=N(0),i=N(7),e=N(3),a=N(1),o=N(13),f=N(12),t=N(11);function s(g,d,T){u.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,d!=null&&d instanceof i?this.graphManager=d:d!=null&&d instanceof Layout&&(this.graphManager=d.graphManager)}s.prototype=Object.create(u.prototype);for(var l in u)s[l]=u[l];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(g,d,T){if(d==null&&T==null){var c=g;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(c)>-1)throw"Node already in graph!";return c.owner=this,this.getNodes().push(c),c}else{var y=g;if(!(this.getNodes().indexOf(d)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(d.owner==T.owner&&d.owner==this))throw"Both owners must be this graph!";return d.owner!=T.owner?null:(y.source=d,y.target=T,y.isInterGraph=!1,this.getEdges().push(y),d.edges.push(y),T!=d&&T.edges.push(y),y)}},s.prototype.remove=function(g){var d=g;if(g instanceof e){if(d==null)throw"Node is null!";if(!(d.owner!=null&&d.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=d.edges.slice(),c,y=T.length,A=0;A<y;A++)c=T[A],c.isInterGraph?this.graphManager.remove(c):c.source.owner.remove(c);var I=this.nodes.indexOf(d);if(I==-1)throw"Node not in owner node list!";this.nodes.splice(I,1)}else if(g instanceof a){var c=g;if(c==null)throw"Edge is null!";if(!(c.source!=null&&c.target!=null))throw"Source and/or target is null!";if(!(c.source.owner!=null&&c.target.owner!=null&&c.source.owner==this&&c.target.owner==this))throw"Source and/or target owner is invalid!";var G=c.source.edges.indexOf(c),k=c.target.edges.indexOf(c);if(!(G>-1&&k>-1))throw"Source and/or target doesn't know this edge!";c.source.edges.splice(G,1),c.target!=c.source&&c.target.edges.splice(k,1);var I=c.source.owner.getEdges().indexOf(c);if(I==-1)throw"Not in owner's edge list!";c.source.owner.getEdges().splice(I,1)}},s.prototype.updateLeftTop=function(){for(var g=h.MAX_VALUE,d=h.MAX_VALUE,T,c,y,A=this.getNodes(),I=A.length,G=0;G<I;G++){var k=A[G];T=k.getTop(),c=k.getLeft(),g>T&&(g=T),d>c&&(d=c)}return g==h.MAX_VALUE?null:(A[0].getParent().paddingLeft!=null?y=A[0].getParent().paddingLeft:y=this.margin,this.left=d-y,this.top=g-y,new f(this.left,this.top))},s.prototype.updateBounds=function(g){for(var d=h.MAX_VALUE,T=-h.MAX_VALUE,c=h.MAX_VALUE,y=-h.MAX_VALUE,A,I,G,k,U,H=this.nodes,Z=H.length,x=0;x<Z;x++){var nt=H[x];g&&nt.child!=null&&nt.updateBounds(),A=nt.getLeft(),I=nt.getRight(),G=nt.getTop(),k=nt.getBottom(),d>A&&(d=A),T<I&&(T=I),c>G&&(c=G),y<k&&(y=k)}var r=new o(d,c,T-d,y-c);d==h.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),H[0].getParent().paddingLeft!=null?U=H[0].getParent().paddingLeft:U=this.margin,this.left=r.x-U,this.right=r.x+r.width+U,this.top=r.y-U,this.bottom=r.y+r.height+U},s.calculateBounds=function(g){for(var d=h.MAX_VALUE,T=-h.MAX_VALUE,c=h.MAX_VALUE,y=-h.MAX_VALUE,A,I,G,k,U=g.length,H=0;H<U;H++){var Z=g[H];A=Z.getLeft(),I=Z.getRight(),G=Z.getTop(),k=Z.getBottom(),d>A&&(d=A),T<I&&(T=I),c>G&&(c=G),y<k&&(y=k)}var x=new o(d,c,T-d,y-c);return x},s.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},s.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},s.prototype.calcEstimatedSize=function(){for(var g=0,d=this.nodes,T=d.length,c=0;c<T;c++){var y=d[c];g+=y.calcEstimatedSize()}return g==0?this.estimatedSize=n.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=g/Math.sqrt(this.nodes.length),this.estimatedSize},s.prototype.updateConnected=function(){var g=this;if(this.nodes.length==0){this.isConnected=!0;return}var d=new t,T=new Set,c=this.nodes[0],y,A,I=c.withChildren();for(I.forEach(function(x){d.push(x),T.add(x)});d.length!==0;){c=d.shift(),y=c.getEdges();for(var G=y.length,k=0;k<G;k++){var U=y[k];if(A=U.getOtherEndInGraph(c,this),A!=null&&!T.has(A)){var H=A.withChildren();H.forEach(function(x){d.push(x),T.add(x)})}}}if(this.isConnected=!1,T.size>=this.nodes.length){var Z=0;T.forEach(function(x){x.owner==g&&Z++}),Z==this.nodes.length&&(this.isConnected=!0)}},L.exports=s}),(function(L,S,N){var u,h=N(1);function n(i){u=N(6),this.layout=i,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var i=this.layout.newGraph(),e=this.layout.newNode(null),a=this.add(i,e);return this.setRootGraph(a),this.rootGraph},n.prototype.add=function(i,e,a,o,f){if(a==null&&o==null&&f==null){if(i==null)throw"Graph is null!";if(e==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(e.child!=null)throw"Already has a child!";return i.parent=e,e.child=i,i}else{f=a,o=e,a=i;var t=o.getOwner(),s=f.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 a.isInterGraph=!1,t.add(a,o,f);if(a.isInterGraph=!0,a.source=o,a.target=f,this.edges.indexOf(a)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(a),!(a.source!=null&&a.target!=null))throw"Edge source and/or target is null!";if(!(a.source.edges.indexOf(a)==-1&&a.target.edges.indexOf(a)==-1))throw"Edge already in source and/or target incidency list!";return a.source.edges.push(a),a.target.edges.push(a),a}},n.prototype.remove=function(i){if(i instanceof u){var e=i;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(e==this.rootGraph||e.parent!=null&&e.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(e.getEdges());for(var o,f=a.length,t=0;t<f;t++)o=a[t],e.remove(o);var s=[];s=s.concat(e.getNodes());var l;f=s.length;for(var t=0;t<f;t++)l=s[t],e.remove(l);e==this.rootGraph&&this.setRootGraph(null);var g=this.graphs.indexOf(e);this.graphs.splice(g,1),e.parent=null}else if(i instanceof h){if(o=i,o==null)throw"Edge is null!";if(!o.isInterGraph)throw"Not an inter-graph edge!";if(!(o.source!=null&&o.target!=null))throw"Source and/or target is null!";if(!(o.source.edges.indexOf(o)!=-1&&o.target.edges.indexOf(o)!=-1))throw"Source and/or target doesn't know this edge!";var g=o.source.edges.indexOf(o);if(o.source.edges.splice(g,1),g=o.target.edges.indexOf(o),o.target.edges.splice(g,1),!(o.source.owner!=null&&o.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(o.source.owner.getGraphManager().edges.indexOf(o)==-1)throw"Not in owner graph manager's edge list!";var g=o.source.owner.getGraphManager().edges.indexOf(o);o.source.owner.getGraphManager().edges.splice(g,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 i=[],e=this.getGraphs(),a=e.length,o=0;o<a;o++)i=i.concat(e[o].getNodes());this.allNodes=i}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 i=[],e=this.getGraphs();e.length;for(var a=0;a<e.length;a++)i=i.concat(e[a].getEdges());i=i.concat(this.edges),this.allEdges=i}return this.allEdges},n.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},n.prototype.setAllNodesToApplyGravitation=function(i){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=i},n.prototype.getRoot=function(){return this.rootGraph},n.prototype.setRootGraph=function(i){if(i.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=i,i.parent==null&&(i.parent=this.layout.newNode("Root node"))},n.prototype.getLayout=function(){return this.layout},n.prototype.isOneAncestorOfOther=function(i,e){if(!(i!=null&&e!=null))throw"assert failed";if(i==e)return!0;var a=i.getOwner(),o;do{if(o=a.getParent(),o==null)break;if(o==e)return!0;if(a=o.getOwner(),a==null)break}while(!0);a=e.getOwner();do{if(o=a.getParent(),o==null)break;if(o==i)return!0;if(a=o.getOwner(),a==null)break}while(!0);return!1},n.prototype.calcLowestCommonAncestors=function(){for(var i,e,a,o,f,t=this.getAllEdges(),s=t.length,l=0;l<s;l++){if(i=t[l],e=i.source,a=i.target,i.lca=null,i.sourceInLca=e,i.targetInLca=a,e==a){i.lca=e.getOwner();continue}for(o=e.getOwner();i.lca==null;){for(i.targetInLca=a,f=a.getOwner();i.lca==null;){if(f==o){i.lca=f;break}if(f==this.rootGraph)break;if(i.lca!=null)throw"assert failed";i.targetInLca=f.getParent(),f=i.targetInLca.getOwner()}if(o==this.rootGraph)break;i.lca==null&&(i.sourceInLca=o.getParent(),o=i.sourceInLca.getOwner())}if(i.lca==null)throw"assert failed"}},n.prototype.calcLowestCommonAncestor=function(i,e){if(i==e)return i.getOwner();var a=i.getOwner();do{if(a==null)break;var o=e.getOwner();do{if(o==null)break;if(o==a)return o;o=o.getParent().getOwner()}while(!0);a=a.getParent().getOwner()}while(!0);return a},n.prototype.calcInclusionTreeDepths=function(i,e){i==null&&e==null&&(i=this.rootGraph,e=1);for(var a,o=i.getNodes(),f=o.length,t=0;t<f;t++)a=o[t],a.inclusionTreeDepth=e,a.child!=null&&this.calcInclusionTreeDepths(a.child,e+1)},n.prototype.includesInvalidEdge=function(){for(var i,e=[],a=this.edges.length,o=0;o<a;o++)i=this.edges[o],this.isOneAncestorOfOther(i.source,i.target)&&e.push(i);for(var o=0;o<e.length;o++)this.remove(e[o]);return!1},L.exports=n}),(function(L,S,N){var u=N(12);function h(){}h.calcSeparationAmount=function(n,i,e,a){if(!n.intersects(i))throw"assert failed";var o=new Array(2);this.decideDirectionsForOverlappingNodes(n,i,o),e[0]=Math.min(n.getRight(),i.getRight())-Math.max(n.x,i.x),e[1]=Math.min(n.getBottom(),i.getBottom())-Math.max(n.y,i.y),n.getX()<=i.getX()&&n.getRight()>=i.getRight()?e[0]+=Math.min(i.getX()-n.getX(),n.getRight()-i.getRight()):i.getX()<=n.getX()&&i.getRight()>=n.getRight()&&(e[0]+=Math.min(n.getX()-i.getX(),i.getRight()-n.getRight())),n.getY()<=i.getY()&&n.getBottom()>=i.getBottom()?e[1]+=Math.min(i.getY()-n.getY(),n.getBottom()-i.getBottom()):i.getY()<=n.getY()&&i.getBottom()>=n.getBottom()&&(e[1]+=Math.min(n.getY()-i.getY(),i.getBottom()-n.getBottom()));var f=Math.abs((i.getCenterY()-n.getCenterY())/(i.getCenterX()-n.getCenterX()));i.getCenterY()===n.getCenterY()&&i.getCenterX()===n.getCenterX()&&(f=1);var t=f*e[0],s=e[1]/f;e[0]<s?s=e[0]:t=e[1],e[0]=-1*o[0]*(s/2+a),e[1]=-1*o[1]*(t/2+a)},h.decideDirectionsForOverlappingNodes=function(n,i,e){n.getCenterX()<i.getCenterX()?e[0]=-1:e[0]=1,n.getCenterY()<i.getCenterY()?e[1]=-1:e[1]=1},h.getIntersection2=function(n,i,e){var a=n.getCenterX(),o=n.getCenterY(),f=i.getCenterX(),t=i.getCenterY();if(n.intersects(i))return e[0]=a,e[1]=o,e[2]=f,e[3]=t,!0;var s=n.getX(),l=n.getY(),g=n.getRight(),d=n.getX(),T=n.getBottom(),c=n.getRight(),y=n.getWidthHalf(),A=n.getHeightHalf(),I=i.getX(),G=i.getY(),k=i.getRight(),U=i.getX(),H=i.getBottom(),Z=i.getRight(),x=i.getWidthHalf(),nt=i.getHeightHalf(),r=!1,E=!1;if(a===f){if(o>t)return e[0]=a,e[1]=l,e[2]=f,e[3]=H,!1;if(o<t)return e[0]=a,e[1]=T,e[2]=f,e[3]=G,!1}else if(o===t){if(a>f)return e[0]=s,e[1]=o,e[2]=k,e[3]=t,!1;if(a<f)return e[0]=g,e[1]=o,e[2]=I,e[3]=t,!1}else{var p=n.height/n.width,m=i.height/i.width,v=(t-o)/(f-a),b=void 0,w=void 0,O=void 0,F=void 0,Y=void 0,z=void 0;if(-p===v?a>f?(e[0]=d,e[1]=T,r=!0):(e[0]=g,e[1]=l,r=!0):p===v&&(a>f?(e[0]=s,e[1]=l,r=!0):(e[0]=c,e[1]=T,r=!0)),-m===v?f>a?(e[2]=U,e[3]=H,E=!0):(e[2]=k,e[3]=G,E=!0):m===v&&(f>a?(e[2]=I,e[3]=G,E=!0):(e[2]=Z,e[3]=H,E=!0)),r&&E)return!1;if(a>f?o>t?(b=this.getCardinalDirection(p,v,4),w=this.getCardinalDirection(m,v,2)):(b=this.getCardinalDirection(-p,v,3),w=this.getCardinalDirection(-m,v,1)):o>t?(b=this.getCardinalDirection(-p,v,1),w=this.getCardinalDirection(-m,v,3)):(b=this.getCardinalDirection(p,v,2),w=this.getCardinalDirection(m,v,4)),!r)switch(b){case 1:F=l,O=a+-A/v,e[0]=O,e[1]=F;break;case 2:O=c,F=o+y*v,e[0]=O,e[1]=F;break;case 3:F=T,O=a+A/v,e[0]=O,e[1]=F;break;case 4:O=d,F=o+-y*v,e[0]=O,e[1]=F;break}if(!E)switch(w){case 1:z=G,Y=f+-nt/v,e[2]=Y,e[3]=z;break;case 2:Y=Z,z=t+x*v,e[2]=Y,e[3]=z;break;case 3:z=H,Y=f+nt/v,e[2]=Y,e[3]=z;break;case 4:Y=U,z=t+-x*v,e[2]=Y,e[3]=z;break}}return!1},h.getCardinalDirection=function(n,i,e){return n>i?e:1+e%4},h.getIntersection=function(n,i,e,a){if(a==null)return this.getIntersection2(n,i,e);var o=n.x,f=n.y,t=i.x,s=i.y,l=e.x,g=e.y,d=a.x,T=a.y,c=void 0,y=void 0,A=void 0,I=void 0,G=void 0,k=void 0,U=void 0,H=void 0,Z=void 0;return A=s-f,G=o-t,U=t*f-o*s,I=T-g,k=l-d,H=d*g-l*T,Z=A*k-I*G,Z===0?null:(c=(G*H-k*U)/Z,y=(I*U-A*H)/Z,new u(c,y))},h.angleOfVector=function(n,i,e,a){var o=void 0;return n!==e?(o=Math.atan((a-i)/(e-n)),e<n?o+=Math.PI:a<i&&(o+=this.TWO_PI)):a<i?o=this.ONE_AND_HALF_PI:o=this.HALF_PI,o},h.doIntersect=function(n,i,e,a){var o=n.x,f=n.y,t=i.x,s=i.y,l=e.x,g=e.y,d=a.x,T=a.y,c=(t-o)*(T-g)-(d-l)*(s-f);if(c===0)return!1;var y=((T-g)*(d-o)+(l-d)*(T-f))/c,A=((f-s)*(d-o)+(t-o)*(T-f))/c;return 0<y&&y<1&&0<A&&A<1},h.findCircleLineIntersections=function(n,i,e,a,o,f,t){var s=(e-n)*(e-n)+(a-i)*(a-i),l=2*((n-o)*(e-n)+(i-f)*(a-i)),g=(n-o)*(n-o)+(i-f)*(i-f)-t*t,d=l*l-4*s*g;if(d>=0){var T=(-l+Math.sqrt(l*l-4*s*g))/(2*s),c=(-l-Math.sqrt(l*l-4*s*g))/(2*s),y=null;return T>=0&&T<=1?[T]:c>=0&&c<=1?[c]:y}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,L.exports=h}),(function(L,S,N){function u(){}u.sign=function(h){return h>0?1:h<0?-1:0},u.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},u.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},L.exports=u}),(function(L,S,N){function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,L.exports=u}),(function(L,S,N){var u=(function(){function o(f,t){for(var s=0;s<t.length;s++){var l=t[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(f,l.key,l)}}return function(f,t,s){return t&&o(f.prototype,t),s&&o(f,s),f}})();function h(o,f){if(!(o instanceof f))throw new TypeError("Cannot call a class as a function")}var n=function(o){return{value:o,next:null,prev:null}},i=function(o,f,t,s){return o!==null?o.next=f:s.head=f,t!==null?t.prev=f:s.tail=f,f.prev=o,f.next=t,s.length++,f},e=function(o,f){var t=o.prev,s=o.next;return t!==null?t.next=s:f.head=s,s!==null?s.prev=t:f.tail=t,o.prev=o.next=null,f.length--,o},a=(function(){function o(f){var t=this;h(this,o),this.length=0,this.head=null,this.tail=null,f?.forEach(function(s){return t.push(s)})}return u(o,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(f,t){return i(t.prev,n(f),t,this)}},{key:"insertAfter",value:function(f,t){return i(t,n(f),t.next,this)}},{key:"insertNodeBefore",value:function(f,t){return i(t.prev,f,t,this)}},{key:"insertNodeAfter",value:function(f,t){return i(t,f,t.next,this)}},{key:"push",value:function(f){return i(this.tail,n(f),null,this)}},{key:"unshift",value:function(f){return i(null,n(f),this.head,this)}},{key:"remove",value:function(f){return e(f,this)}},{key:"pop",value:function(){return e(this.tail,this).value}},{key:"popNode",value:function(){return e(this.tail,this)}},{key:"shift",value:function(){return e(this.head,this).value}},{key:"shiftNode",value:function(){return e(this.head,this)}},{key:"get_object_at",value:function(f){if(f<=this.length()){for(var t=1,s=this.head;t<f;)s=s.next,t++;return s.value}}},{key:"set_object_at",value:function(f,t){if(f<=this.length()){for(var s=1,l=this.head;s<f;)l=l.next,s++;l.value=t}}}]),o})();L.exports=a}),(function(L,S,N){function u(h,n,i){this.x=null,this.y=null,h==null&&n==null&&i==null?(this.x=0,this.y=0):typeof h=="number"&&typeof n=="number"&&i==null?(this.x=h,this.y=n):h.constructor.name=="Point"&&n==null&&i==null&&(i=h,this.x=i.x,this.y=i.y)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.getLocation=function(){return new u(this.x,this.y)},u.prototype.setLocation=function(h,n,i){h.constructor.name=="Point"&&n==null&&i==null?(i=h,this.setLocation(i.x,i.y)):typeof h=="number"&&typeof n=="number"&&i==null&&(parseInt(h)==h&&parseInt(n)==n?this.move(h,n):(this.x=Math.floor(h+.5),this.y=Math.floor(n+.5)))},u.prototype.move=function(h,n){this.x=h,this.y=n},u.prototype.translate=function(h,n){this.x+=h,this.y+=n},u.prototype.equals=function(h){if(h.constructor.name=="Point"){var n=h;return this.x==n.x&&this.y==n.y}return this==h},u.prototype.toString=function(){return new u().constructor.name+"[x="+this.x+",y="+this.y+"]"},L.exports=u}),(function(L,S,N){function u(h,n,i,e){this.x=0,this.y=0,this.width=0,this.height=0,h!=null&&n!=null&&i!=null&&e!=null&&(this.x=h,this.y=n,this.width=i,this.height=e)}u.prototype.getX=function(){return this.x},u.prototype.setX=function(h){this.x=h},u.prototype.getY=function(){return this.y},u.prototype.setY=function(h){this.y=h},u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(h){this.width=h},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(h){this.height=h},u.prototype.getRight=function(){return this.x+this.width},u.prototype.getBottom=function(){return this.y+this.height},u.prototype.intersects=function(h){return!(this.getRight()<h.x||this.getBottom()<h.y||h.getRight()<this.x||h.getBottom()<this.y)},u.prototype.getCenterX=function(){return this.x+this.width/2},u.prototype.getMinX=function(){return this.getX()},u.prototype.getMaxX=function(){return this.getX()+this.width},u.prototype.getCenterY=function(){return this.y+this.height/2},u.prototype.getMinY=function(){return this.getY()},u.prototype.getMaxY=function(){return this.getY()+this.height},u.prototype.getWidthHalf=function(){return this.width/2},u.prototype.getHeightHalf=function(){return this.height/2},L.exports=u}),(function(L,S,N){var u=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 h(){}h.lastID=0,h.createID=function(n){return h.isPrimitive(n)?n:(n.uniqueID!=null||(n.uniqueID=h.getString(),h.lastID++),n.uniqueID)},h.getString=function(n){return n==null&&(n=h.lastID),"Object#"+n},h.isPrimitive=function(n){var i=typeof n>"u"?"undefined":u(n);return n==null||i!="object"&&i!="function"},L.exports=h}),(function(L,S,N){function u(l){if(Array.isArray(l)){for(var g=0,d=Array(l.length);g<l.length;g++)d[g]=l[g];return d}else return Array.from(l)}var h=N(0),n=N(7),i=N(3),e=N(1),a=N(6),o=N(5),f=N(17),t=N(29);function s(l){t.call(this),this.layoutQuality=h.QUALITY,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=h.DEFAULT_INCREMENTAL,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new n(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}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 l=new n(this);return this.graphManager=l,l},s.prototype.newGraph=function(l){return new a(null,this.graphManager,l)},s.prototype.newNode=function(l){return new i(this.graphManager,l)},s.prototype.newEdge=function(l){return new e(null,null,l)},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 l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),h.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},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 l=this.graphManager.getAllEdges(),g=0;g<l.length;g++)l[g];for(var d=this.graphManager.getRoot().getNodes(),g=0;g<d.length;g++)d[g];this.update(this.graphManager.getRoot())}},s.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof i){var g=l;if(g.getChild()!=null)for(var d=g.getChild().getNodes(),T=0;T<d.length;T++)update(d[T]);if(g.vGraphObject!=null){var c=g.vGraphObject;c.update(g)}}else if(l instanceof e){var y=l;if(y.vGraphObject!=null){var A=y.vGraphObject;A.update(y)}}else if(l instanceof a){var I=l;if(I.vGraphObject!=null){var G=I.vGraphObject;G.update(I)}}},s.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=h.QUALITY,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=h.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},s.prototype.transform=function(l){if(l==null)this.transform(new o(0,0));else{var g=new f,d=this.graphManager.getRoot().updateLeftTop();if(d!=null){g.setWorldOrgX(l.x),g.setWorldOrgY(l.y),g.setDeviceOrgX(d.x),g.setDeviceOrgY(d.y);for(var T=this.getAllNodes(),c,y=0;y<T.length;y++)c=T[y],c.transform(g)}}},s.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var g,d,T=l.getNodes(),c=0;c<T.length;c++)g=T[c],d=g.getChild(),d==null||d.getNodes().length==0?g.scatter():(this.positionNodesRandomly(d),g.updateBounds())},s.prototype.getFlatForest=function(){for(var l=[],g=!0,d=this.graphManager.getRoot().getNodes(),T=!0,c=0;c<d.length;c++)d[c].getChild()!=null&&(T=!1);if(!T)return l;var y=new Set,A=[],I=new Map,G=[];for(G=G.concat(d);G.length>0&&g;){for(A.push(G[0]);A.length>0&&g;){var k=A[0];A.splice(0,1),y.add(k);for(var U=k.getEdges(),c=0;c<U.length;c++){var H=U[c].getOtherEnd(k);if(I.get(k)!=H)if(!y.has(H))A.push(H),I.set(H,k);else{g=!1;break}}}if(!g)l=[];else{var Z=[].concat(u(y));l.push(Z);for(var c=0;c<Z.length;c++){var x=Z[c],nt=G.indexOf(x);nt>-1&&G.splice(nt,1)}y=new Set,I=new Map}}return l},s.prototype.createDummyNodesForBendpoints=function(l){for(var g=[],d=l.source,T=this.graphManager.calcLowestCommonAncestor(l.source,l.target),c=0;c<l.bendpoints.length;c++){var y=this.newNode(null);y.setRect(new Point(0,0),new Dimension(1,1)),T.add(y);var A=this.newEdge(null);this.graphManager.add(A,d,y),g.add(y),d=y}var A=this.newEdge(null);return this.graphManager.add(A,d,l.target),this.edgeToDummyNodes.set(l,g),l.isInterGraph()?this.graphManager.remove(l):T.remove(l),g},s.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(u(this.edgeToDummyNodes.keys())).concat(l);for(var g=0;g<l.length;g++){var d=l[g];if(d.bendpoints.length>0){for(var T=this.edgeToDummyNodes.get(d),c=0;c<T.length;c++){var y=T[c],A=new o(y.getCenterX(),y.getCenterY()),I=d.bendpoints.get(c);I.x=A.x,I.y=A.y,y.getOwner().remove(y)}this.graphManager.add(d,d.source,d.target)}}},s.transform=function(l,g,d,T){if(d!=null&&T!=null){var c=g;if(l<=50){var y=g/d;c-=(g-y)/50*(50-l)}else{var A=g*T;c+=(A-g)/50*(l-50)}return c}else{var I,G;return l<=50?(I=9*g/500,G=g/10):(I=9*g/50,G=-8*g),I*l+G}},s.findCenterOfTree=function(l){var g=[];g=g.concat(l);var d=[],T=new Map,c=!1,y=null;(g.length==1||g.length==2)&&(c=!0,y=g[0]);for(var A=0;A<g.length;A++){var I=g[A],G=I.getNeighborsList().size;T.set(I,I.getNeighborsList().size),G==1&&d.push(I)}var k=[];for(k=k.concat(d);!c;){var U=[];U=U.concat(k),k=[];for(var A=0;A<g.length;A++){var I=g[A],H=g.indexOf(I);H>=0&&g.splice(H,1);var Z=I.getNeighborsList();Z.forEach(function(r){if(d.indexOf(r)<0){var E=T.get(r),p=E-1;p==1&&k.push(r),T.set(r,p)}})}d=d.concat(k),(g.length==1||g.length==2)&&(c=!0,y=g[0])}return y},s.prototype.setGraphManager=function(l){this.graphManager=l},L.exports=s}),(function(L,S,N){function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},L.exports=u}),(function(L,S,N){var u=N(5);function h(n,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(n){this.lworldExtX=n},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(n){this.lworldExtY=n},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},h.prototype.transformX=function(n){var i=0,e=this.lworldExtX;return e!=0&&(i=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/e),i},h.prototype.transformY=function(n){var i=0,e=this.lworldExtY;return e!=0&&(i=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/e),i},h.prototype.inverseTransformX=function(n){var i=0,e=this.ldeviceExtX;return e!=0&&(i=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/e),i},h.prototype.inverseTransformY=function(n){var i=0,e=this.ldeviceExtY;return e!=0&&(i=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/e),i},h.prototype.inverseTransformPoint=function(n){var i=new u(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return i},L.exports=h}),(function(L,S,N){function u(t){if(Array.isArray(t)){for(var s=0,l=Array(t.length);s<t.length;s++)l[s]=t[s];return l}else return Array.from(t)}var h=N(15),n=N(4),i=N(0),e=N(8),a=N(9);function o(){h.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}o.prototype=Object.create(h.prototype);for(var f in h)o[f]=h[f];o.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},o.prototype.calcIdealEdgeLengths=function(){for(var t,s,l,g,d,T,c,y=this.getGraphManager().getAllEdges(),A=0;A<y.length;A++)t=y[A],s=t.idealLength,t.isInterGraph&&(g=t.getSource(),d=t.getTarget(),T=t.getSourceInLca().getEstimatedSize(),c=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=T+c-2*i.SIMPLE_NODE_SIZE),l=t.getLca().getInclusionTreeDepth(),t.idealLength+=s*n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(g.getInclusionTreeDepth()+d.getInclusionTreeDepth()-2*l))},o.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()},o.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,l=0;l<t.length;l++)s=t[l],this.calcSpringForce(s,s.idealLength)},o.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,l,g,d,T,c=this.getAllNodes(),y;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),y=new Set,l=0;l<c.length;l++)d=c[l],this.calculateRepulsionForceOfANode(d,y,t,s),y.add(d);else for(l=0;l<c.length;l++)for(d=c[l],g=l+1;g<c.length;g++)T=c[g],d.getOwner()==T.getOwner()&&this.calcRepulsionForce(d,T)},o.prototype.calcGravitationalForces=function(){for(var t,s=this.getAllNodesToApplyGravitation(),l=0;l<s.length;l++)t=s[l],this.calcGravitationalForce(t)},o.prototype.moveNodes=function(){for(var t=this.getAllNodes(),s,l=0;l<t.length;l++)s=t[l],s.move()},o.prototype.calcSpringForce=function(t,s){var l=t.getSource(),g=t.getTarget(),d,T,c,y;if(this.uniformLeafNodeSizes&&l.getChild()==null&&g.getChild()==null)t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;d=t.getLength(),d!=0&&(T=t.edgeElasticity*(d-s),c=T*(t.lengthX/d),y=T*(t.lengthY/d),l.springForceX+=c,l.springForceY+=y,g.springForceX-=c,g.springForceY-=y)},o.prototype.calcRepulsionForce=function(t,s){var l=t.getRect(),g=s.getRect(),d=new Array(2),T=new Array(4),c,y,A,I,G,k,U;if(l.intersects(g)){e.calcSeparationAmount(l,g,d,n.DEFAULT_EDGE_LENGTH/2),k=2*d[0],U=2*d[1];var H=t.noOfChildren*s.noOfChildren/(t.noOfChildren+s.noOfChildren);t.repulsionForceX-=H*k,t.repulsionForceY-=H*U,s.repulsionForceX+=H*k,s.repulsionForceY+=H*U}else this.uniformLeafNodeSizes&&t.getChild()==null&&s.getChild()==null?(c=g.getCenterX()-l.getCenterX(),y=g.getCenterY()-l.getCenterY()):(e.getIntersection(l,g,T),c=T[2]-T[0],y=T[3]-T[1]),Math.abs(c)<n.MIN_REPULSION_DIST&&(c=a.sign(c)*n.MIN_REPULSION_DIST),Math.abs(y)<n.MIN_REPULSION_DIST&&(y=a.sign(y)*n.MIN_REPULSION_DIST),A=c*c+y*y,I=Math.sqrt(A),G=(t.nodeRepulsion/2+s.nodeRepulsion/2)*t.noOfChildren*s.noOfChildren/A,k=G*c/I,U=G*y/I,t.repulsionForceX-=k,t.repulsionForceY-=U,s.repulsionForceX+=k,s.repulsionForceY+=U},o.prototype.calcGravitationalForce=function(t){var s,l,g,d,T,c,y,A;s=t.getOwner(),l=(s.getRight()+s.getLeft())/2,g=(s.getTop()+s.getBottom())/2,d=t.getCenterX()-l,T=t.getCenterY()-g,c=Math.abs(d)+t.getWidth()/2,y=Math.abs(T)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(A=s.getEstimatedSize()*this.gravityRangeFactor,(c>A||y>A)&&(t.gravitationForceX=-this.gravityConstant*d,t.gravitationForceY=-this.gravityConstant*T)):(A=s.getEstimatedSize()*this.compoundGravityRangeFactor,(c>A||y>A)&&(t.gravitationForceX=-this.gravityConstant*d*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},o.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},o.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},o.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,s=this.graphManager.getAllNodes(),l=0;l<s.length;l++)t=s[l],t.noOfChildren=t.getNoOfChildren()},o.prototype.calcGrid=function(t){var s=0,l=0;s=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var g=new Array(s),d=0;d<s;d++)g[d]=new Array(l);for(var d=0;d<s;d++)for(var T=0;T<l;T++)g[d][T]=new Array;return g},o.prototype.addNodeToGrid=function(t,s,l){var g=0,d=0,T=0,c=0;g=parseInt(Math.floor((t.getRect().x-s)/this.repulsionRange)),d=parseInt(Math.floor((t.getRect().width+t.getRect().x-s)/this.repulsionRange)),T=parseInt(Math.floor((t.getRect().y-l)/this.repulsionRange)),c=parseInt(Math.floor((t.getRect().height+t.getRect().y-l)/this.repulsionRange));for(var y=g;y<=d;y++)for(var A=T;A<=c;A++)this.grid[y][A].push(t),t.setGridCoordinates(g,d,T,c)},o.prototype.updateGrid=function(){var t,s,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<l.length;t++)s=l[t],this.addNodeToGrid(s,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},o.prototype.calculateRepulsionForceOfANode=function(t,s,l,g){if(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&l||g){var d=new Set;t.surrounding=new Array;for(var T,c=this.grid,y=t.startX-1;y<t.finishX+2;y++)for(var A=t.startY-1;A<t.finishY+2;A++)if(!(y<0||A<0||y>=c.length||A>=c[0].length)){for(var I=0;I<c[y][A].length;I++)if(T=c[y][A][I],!(t.getOwner()!=T.getOwner()||t==T)&&!s.has(T)&&!d.has(T)){var G=Math.abs(t.getCenterX()-T.getCenterX())-(t.getWidth()/2+T.getWidth()/2),k=Math.abs(t.getCenterY()-T.getCenterY())-(t.getHeight()/2+T.getHeight()/2);G<=this.repulsionRange&&k<=this.repulsionRange&&d.add(T)}}t.surrounding=[].concat(u(d))}for(y=0;y<t.surrounding.length;y++)this.calcRepulsionForce(t,t.surrounding[y])},o.prototype.calcRepulsionRange=function(){return 0},L.exports=o}),(function(L,S,N){var u=N(1),h=N(4);function n(e,a,o){u.call(this,e,a,o),this.idealLength=h.DEFAULT_EDGE_LENGTH,this.edgeElasticity=h.DEFAULT_SPRING_STRENGTH}n.prototype=Object.create(u.prototype);for(var i in u)n[i]=u[i];L.exports=n}),(function(L,S,N){var u=N(3),h=N(4);function n(e,a,o,f){u.call(this,e,a,o,f),this.nodeRepulsion=h.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(u.prototype);for(var i in u)n[i]=u[i];n.prototype.setGridCoordinates=function(e,a,o,f){this.startX=e,this.finishX=a,this.startY=o,this.finishY=f},L.exports=n}),(function(L,S,N){function u(h,n){this.width=0,this.height=0,h!==null&&n!==null&&(this.height=n,this.width=h)}u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(h){this.width=h},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(h){this.height=h},L.exports=u}),(function(L,S,N){var u=N(14);function h(){this.map={},this.keys=[]}h.prototype.put=function(n,i){var e=u.createID(n);this.contains(e)||(this.map[e]=i,this.keys.push(n))},h.prototype.contains=function(n){return u.createID(n),this.map[n]!=null},h.prototype.get=function(n){var i=u.createID(n);return this.map[i]},h.prototype.keySet=function(){return this.keys},L.exports=h}),(function(L,S,N){var u=N(14);function h(){this.set={}}h.prototype.add=function(n){var i=u.createID(n);this.contains(i)||(this.set[i]=n)},h.prototype.remove=function(n){delete this.set[u.createID(n)]},h.prototype.clear=function(){this.set={}},h.prototype.contains=function(n){return this.set[u.createID(n)]==n},h.prototype.isEmpty=function(){return this.size()===0},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAllTo=function(n){for(var i=Object.keys(this.set),e=i.length,a=0;a<e;a++)n.push(this.set[i[a]])},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAll=function(n){for(var i=n.length,e=0;e<i;e++){var a=n[e];this.add(a)}},L.exports=h}),(function(L,S,N){function u(){}u.multMat=function(h,n){for(var i=[],e=0;e<h.length;e++){i[e]=[];for(var a=0;a<n[0].length;a++){i[e][a]=0;for(var o=0;o<h[0].length;o++)i[e][a]+=h[e][o]*n[o][a]}}return i},u.transpose=function(h){for(var n=[],i=0;i<h[0].length;i++){n[i]=[];for(var e=0;e<h.length;e++)n[i][e]=h[e][i]}return n},u.multCons=function(h,n){for(var i=[],e=0;e<h.length;e++)i[e]=h[e]*n;return i},u.minusOp=function(h,n){for(var i=[],e=0;e<h.length;e++)i[e]=h[e]-n[e];return i},u.dotProduct=function(h,n){for(var i=0,e=0;e<h.length;e++)i+=h[e]*n[e];return i},u.mag=function(h){return Math.sqrt(this.dotProduct(h,h))},u.normalize=function(h){for(var n=[],i=this.mag(h),e=0;e<h.length;e++)n[e]=h[e]/i;return n},u.multGamma=function(h){for(var n=[],i=0,e=0;e<h.length;e++)i+=h[e];i*=-1/h.length;for(var a=0;a<h.length;a++)n[a]=i+h[a];return n},u.multL=function(h,n,i){for(var e=[],a=[],o=[],f=0;f<n[0].length;f++){for(var t=0,s=0;s<n.length;s++)t+=-.5*n[s][f]*h[s];a[f]=t}for(var l=0;l<i.length;l++){for(var g=0,d=0;d<i.length;d++)g+=i[l][d]*a[d];o[l]=g}for(var T=0;T<n.length;T++){for(var c=0,y=0;y<n[0].length;y++)c+=n[T][y]*o[y];e[T]=c}return e},L.exports=u}),(function(L,S,N){var u=(function(){function e(a,o){for(var f=0;f<o.length;f++){var t=o[f];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,t.key,t)}}return function(a,o,f){return o&&e(a.prototype,o),f&&e(a,f),a}})();function h(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}var n=N(11),i=(function(){function e(a,o){h(this,e),(o!==null||o!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;a instanceof n?f=a.size():f=a.length,this._quicksort(a,0,f-1)}return u(e,[{key:"_quicksort",value:function(a,o,f){if(o<f){var t=this._partition(a,o,f);this._quicksort(a,o,t),this._quicksort(a,t+1,f)}}},{key:"_partition",value:function(a,o,f){for(var t=this._get(a,o),s=o,l=f;;){for(;this.compareFunction(t,this._get(a,l));)l--;for(;this.compareFunction(this._get(a,s),t);)s++;if(s<l)this._swap(a,s,l),s++,l--;else return l}}},{key:"_get",value:function(a,o){return a instanceof n?a.get_object_at(o):a[o]}},{key:"_set",value:function(a,o,f){a instanceof n?a.set_object_at(o,f):a[o]=f}},{key:"_swap",value:function(a,o,f){var t=this._get(a,o);this._set(a,o,this._get(a,f)),this._set(a,f,t)}},{key:"_defaultCompareFunction",value:function(a,o){return o>a}}]),e})();L.exports=i}),(function(L,S,N){function u(){}u.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var n=Math.min(this.m,this.n);this.s=(function(It){for(var Nt=[];It-- >0;)Nt.push(0);return Nt})(Math.min(this.m+1,this.n)),this.U=(function(It){var Nt=function Ut(kt){if(kt.length==0)return 0;for(var bt=[],St=0;St<kt[0];St++)bt.push(Ut(kt.slice(1)));return bt};return Nt(It)})([this.m,n]),this.V=(function(It){var Nt=function Ut(kt){if(kt.length==0)return 0;for(var bt=[],St=0;St<kt[0];St++)bt.push(Ut(kt.slice(1)));return bt};return Nt(It)})([this.n,this.n]);for(var i=(function(It){for(var Nt=[];It-- >0;)Nt.push(0);return Nt})(this.n),e=(function(It){for(var Nt=[];It-- >0;)Nt.push(0);return Nt})(this.m),a=!0,o=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),t=0;t<Math.max(o,f);t++){if(t<o){this.s[t]=0;for(var s=t;s<this.m;s++)this.s[t]=u.hypot(this.s[t],h[s][t]);if(this.s[t]!==0){h[t][t]<0&&(this.s[t]=-this.s[t]);for(var l=t;l<this.m;l++)h[l][t]/=this.s[t];h[t][t]+=1}this.s[t]=-this.s[t]}for(var g=t+1;g<this.n;g++){if((function(It,Nt){return It&&Nt})(t<o,this.s[t]!==0)){for(var d=0,T=t;T<this.m;T++)d+=h[T][t]*h[T][g];d=-d/h[t][t];for(var c=t;c<this.m;c++)h[c][g]+=d*h[c][t]}i[g]=h[t][g]}if((function(It,Nt){return Nt})(a,t<o))for(var y=t;y<this.m;y++)this.U[y][t]=h[y][t];if(t<f){i[t]=0;for(var A=t+1;A<this.n;A++)i[t]=u.hypot(i[t],i[A]);if(i[t]!==0){i[t+1]<0&&(i[t]=-i[t]);for(var I=t+1;I<this.n;I++)i[I]/=i[t];i[t+1]+=1}if(i[t]=-i[t],(function(It,Nt){return It&&Nt})(t+1<this.m,i[t]!==0)){for(var G=t+1;G<this.m;G++)e[G]=0;for(var k=t+1;k<this.n;k++)for(var U=t+1;U<this.m;U++)e[U]+=i[k]*h[U][k];for(var H=t+1;H<this.n;H++)for(var Z=-i[H]/i[t+1],x=t+1;x<this.m;x++)h[x][H]+=Z*e[x]}for(var nt=t+1;nt<this.n;nt++)this.V[nt][t]=i[nt]}}var r=Math.min(this.n,this.m+1);o<this.n&&(this.s[o]=h[o][o]),this.m<r&&(this.s[r-1]=0),f+1<r&&(i[f]=h[f][r-1]),i[r-1]=0;{for(var E=o;E<n;E++){for(var p=0;p<this.m;p++)this.U[p][E]=0;this.U[E][E]=1}for(var m=o-1;m>=0;m--)if(this.s[m]!==0){for(var v=m+1;v<n;v++){for(var b=0,w=m;w<this.m;w++)b+=this.U[w][m]*this.U[w][v];b=-b/this.U[m][m];for(var O=m;O<this.m;O++)this.U[O][v]+=b*this.U[O][m]}for(var F=m;F<this.m;F++)this.U[F][m]=-this.U[F][m];this.U[m][m]=1+this.U[m][m];for(var Y=0;Y<m-1;Y++)this.U[Y][m]=0}else{for(var z=0;z<this.m;z++)this.U[z][m]=0;this.U[m][m]=1}}for(var W=this.n-1;W>=0;W--){if((function(It,Nt){return It&&Nt})(W<f,i[W]!==0))for(var B=W+1;B<n;B++){for(var $=0,P=W+1;P<this.n;P++)$+=this.V[P][W]*this.V[P][B];$=-$/this.V[W+1][W];for(var M=W+1;M<this.n;M++)this.V[M][B]+=$*this.V[M][W]}for(var R=0;R<this.n;R++)this.V[R][W]=0;this.V[W][W]=1}for(var q=r-1,et=Math.pow(2,-52),mt=Math.pow(2,-966);r>0;){var j=void 0,Ot=void 0;for(j=r-2;j>=-1&&j!==-1;j--)if(Math.abs(i[j])<=mt+et*(Math.abs(this.s[j])+Math.abs(this.s[j+1]))){i[j]=0;break}if(j===r-2)Ot=4;else{var Q=void 0;for(Q=r-1;Q>=j&&Q!==j;Q--){var rt=(Q!==r?Math.abs(i[Q]):0)+(Q!==j+1?Math.abs(i[Q-1]):0);if(Math.abs(this.s[Q])<=mt+et*rt){this.s[Q]=0;break}}Q===j?Ot=3:Q===r-1?Ot=1:(Ot=2,j=Q)}switch(j++,Ot){case 1:{var vt=i[r-2];i[r-2]=0;for(var st=r-2;st>=j;st--){var Lt=u.hypot(this.s[st],vt),_t=this.s[st]/Lt,Tt=vt/Lt;this.s[st]=Lt,st!==j&&(vt=-Tt*i[st-1],i[st-1]=_t*i[st-1]);for(var At=0;At<this.n;At++)Lt=_t*this.V[At][st]+Tt*this.V[At][r-1],this.V[At][r-1]=-Tt*this.V[At][st]+_t*this.V[At][r-1],this.V[At][st]=Lt}}break;case 2:{var Xt=i[j-1];i[j-1]=0;for(var Dt=j;Dt<r;Dt++){var Rt=u.hypot(this.s[Dt],Xt),Gt=this.s[Dt]/Rt,Bt=Xt/Rt;this.s[Dt]=Rt,Xt=-Bt*i[Dt],i[Dt]=Gt*i[Dt];for(var Pt=0;Pt<this.m;Pt++)Rt=Gt*this.U[Pt][Dt]+Bt*this.U[Pt][j-1],this.U[Pt][j-1]=-Bt*this.U[Pt][Dt]+Gt*this.U[Pt][j-1],this.U[Pt][Dt]=Rt}}break;case 3:{var zt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[r-1]),Math.abs(this.s[r-2])),Math.abs(i[r-2])),Math.abs(this.s[j])),Math.abs(i[j])),dt=this.s[r-1]/zt,_=this.s[r-2]/zt,D=i[r-2]/zt,V=this.s[j]/zt,J=i[j]/zt,K=((_+dt)*(_-dt)+D*D)/2,ft=dt*D*(dt*D),ht=0;(function(It,Nt){return It||Nt})(K!==0,ft!==0)&&(ht=Math.sqrt(K*K+ft),K<0&&(ht=-ht),ht=ft/(K+ht));for(var tt=(V+dt)*(V-dt)+ht,ct=V*J,it=j;it<r-1;it++){var Et=u.hypot(tt,ct),yt=tt/Et,xt=ct/Et;it!==j&&(i[it-1]=Et),tt=yt*this.s[it]+xt*i[it],i[it]=yt*i[it]-xt*this.s[it],ct=xt*this.s[it+1],this.s[it+1]=yt*this.s[it+1];for(var lt=0;lt<this.n;lt++)Et=yt*this.V[lt][it]+xt*this.V[lt][it+1],this.V[lt][it+1]=-xt*this.V[lt][it]+yt*this.V[lt][it+1],this.V[lt][it]=Et;if(Et=u.hypot(tt,ct),yt=tt/Et,xt=ct/Et,this.s[it]=Et,tt=yt*i[it]+xt*this.s[it+1],this.s[it+1]=-xt*i[it]+yt*this.s[it+1],ct=xt*i[it+1],i[it+1]=yt*i[it+1],it<this.m-1)for(var ot=0;ot<this.m;ot++)Et=yt*this.U[ot][it]+xt*this.U[ot][it+1],this.U[ot][it+1]=-xt*this.U[ot][it]+yt*this.U[ot][it+1],this.U[ot][it]=Et}i[r-2]=tt}break;case 4:{if(this.s[j]<=0){this.s[j]=this.s[j]<0?-this.s[j]:0;for(var at=0;at<=q;at++)this.V[at][j]=-this.V[at][j]}for(;j<q&&!(this.s[j]>=this.s[j+1]);){var Ct=this.s[j];if(this.s[j]=this.s[j+1],this.s[j+1]=Ct,j<this.n-1)for(var gt=0;gt<this.n;gt++)Ct=this.V[gt][j+1],this.V[gt][j+1]=this.V[gt][j],this.V[gt][j]=Ct;if(j<this.m-1)for(var Mt=0;Mt<this.m;Mt++)Ct=this.U[Mt][j+1],this.U[Mt][j+1]=this.U[Mt][j],this.U[Mt][j]=Ct;j++}r--}break}}var Ft={U:this.U,V:this.V,S:this.s};return Ft},u.hypot=function(h,n){var i=void 0;return Math.abs(h)>Math.abs(n)?(i=n/h,i=Math.abs(h)*Math.sqrt(1+i*i)):n!=0?(i=h/n,i=Math.abs(n)*Math.sqrt(1+i*i)):i=0,i},L.exports=u}),(function(L,S,N){var u=(function(){function i(e,a){for(var o=0;o<a.length;o++){var f=a[o];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(e,f.key,f)}}return function(e,a,o){return a&&i(e.prototype,a),o&&i(e,o),e}})();function h(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var n=(function(){function i(e,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,i),this.sequence1=e,this.sequence2=a,this.match_score=o,this.mismatch_penalty=f,this.gap_penalty=t,this.iMax=e.length+1,this.jMax=a.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 l=0;l<this.jMax;l++)this.grid[s][l]=0}this.tracebackGrid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.tracebackGrid[g]=new Array(this.jMax);for(var d=0;d<this.jMax;d++)this.tracebackGrid[g][d]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return u(i,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var e=1;e<this.jMax;e++)this.grid[0][e]=this.grid[0][e-1]+this.gap_penalty,this.tracebackGrid[0][e]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var o=1;o<this.iMax;o++)for(var f=1;f<this.jMax;f++){var t=void 0;this.sequence1[o-1]===this.sequence2[f-1]?t=this.grid[o-1][f-1]+this.match_score:t=this.grid[o-1][f-1]+this.mismatch_penalty;var s=this.grid[o-1][f]+this.gap_penalty,l=this.grid[o][f-1]+this.gap_penalty,g=[t,s,l],d=this.arrayAllMaxIndexes(g);this.grid[o][f]=g[d[0]],this.tracebackGrid[o][f]=[d.includes(0),d.includes(1),d.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var e=[];for(e.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});e[0];){var a=e[0],o=this.tracebackGrid[a.pos[0]][a.pos[1]];o[0]&&e.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),o[1]&&e.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),o[2]&&e.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),a.pos[0]===0&&a.pos[1]===0&&this.alignments.push({sequence1:a.seq1,sequence2:a.seq2}),e.shift()}return this.alignments}},{key:"getAllIndexes",value:function(e,a){for(var o=[],f=-1;(f=e.indexOf(a,f+1))!==-1;)o.push(f);return o}},{key:"arrayAllMaxIndexes",value:function(e){return this.getAllIndexes(e,Math.max.apply(null,e))}}]),i})();L.exports=n}),(function(L,S,N){var u=function(){};u.FDLayout=N(18),u.FDLayoutConstants=N(4),u.FDLayoutEdge=N(19),u.FDLayoutNode=N(20),u.DimensionD=N(21),u.HashMap=N(22),u.HashSet=N(23),u.IGeometry=N(8),u.IMath=N(9),u.Integer=N(10),u.Point=N(12),u.PointD=N(5),u.RandomSeed=N(16),u.RectangleD=N(13),u.Transform=N(17),u.UniqueIDGeneretor=N(14),u.Quicksort=N(25),u.LinkedList=N(11),u.LGraphObject=N(2),u.LGraph=N(6),u.LEdge=N(1),u.LGraphManager=N(7),u.LNode=N(3),u.Layout=N(15),u.LayoutConstants=N(0),u.NeedlemanWunsch=N(27),u.Matrix=N(24),u.SVD=N(26),L.exports=u}),(function(L,S,N){function u(){this.listeners=[]}var h=u.prototype;h.addListener=function(n,i){this.listeners.push({event:n,callback:i})},h.removeListener=function(n,i){for(var e=this.listeners.length;e>=0;e--){var a=this.listeners[e];a.event===n&&a.callback===i&&this.listeners.splice(e,1)}},h.emit=function(n,i){for(var e=0;e<this.listeners.length;e++){var a=this.listeners[e];n===a.event&&a.callback(i)}},L.exports=u})])})})(fe)),fe.exports}var ui=ue.exports,_e;function fi(){return _e||(_e=1,(function(C,X){(function(L,S){C.exports=S(gi())})(ui,function(L){return(()=>{var S={45:((n,i,e)=>{var a={};a.layoutBase=e(551),a.CoSEConstants=e(806),a.CoSEEdge=e(767),a.CoSEGraph=e(880),a.CoSEGraphManager=e(578),a.CoSELayout=e(765),a.CoSENode=e(991),a.ConstraintHandler=e(902),n.exports=a}),806:((n,i,e)=>{var a=e(551).FDLayoutConstants;function o(){}for(var f in a)o[f]=a[f];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=a.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,o.ENFORCE_CONSTRAINTS=!0,o.APPLY_LAYOUT=!0,o.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,o.TREE_REDUCTION_ON_INCREMENTAL=!0,o.PURE_INCREMENTAL=o.DEFAULT_INCREMENTAL,n.exports=o}),767:((n,i,e)=>{var a=e(551).FDLayoutEdge;function o(t,s,l){a.call(this,t,s,l)}o.prototype=Object.create(a.prototype);for(var f in a)o[f]=a[f];n.exports=o}),880:((n,i,e)=>{var a=e(551).LGraph;function o(t,s,l){a.call(this,t,s,l)}o.prototype=Object.create(a.prototype);for(var f in a)o[f]=a[f];n.exports=o}),578:((n,i,e)=>{var a=e(551).LGraphManager;function o(t){a.call(this,t)}o.prototype=Object.create(a.prototype);for(var f in a)o[f]=a[f];n.exports=o}),765:((n,i,e)=>{var a=e(551).FDLayout,o=e(578),f=e(880),t=e(991),s=e(767),l=e(806),g=e(902),d=e(551).FDLayoutConstants,T=e(551).LayoutConstants,c=e(551).Point,y=e(551).PointD,A=e(551).DimensionD,I=e(551).Layout,G=e(551).Integer,k=e(551).IGeometry,U=e(551).LGraph,H=e(551).Transform,Z=e(551).LinkedList;function x(){a.call(this),this.toBeTiled={},this.constraints={}}x.prototype=Object.create(a.prototype);for(var nt in a)x[nt]=a[nt];x.prototype.newGraphManager=function(){var r=new o(this);return this.graphManager=r,r},x.prototype.newGraph=function(r){return new f(null,this.graphManager,r)},x.prototype.newNode=function(r){return new t(this.graphManager,r)},x.prototype.newEdge=function(r){return new s(null,null,r)},x.prototype.initParameters=function(){a.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){a.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){var r=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return r&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.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(l.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var r=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(m){return r.has(m)});this.graphManager.setAllNodesToApplyGravitation(E)}}else{var p=this.getFlatForest();if(p.length>0)this.positionNodesRadially(p);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var r=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(b){return r.has(b)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(g.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},x.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%d.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 r=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(v){return r.has(v)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=d.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()),l.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.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},x.prototype.getPositionsData=function(){for(var r=this.graphManager.getAllNodes(),E={},p=0;p<r.length;p++){var m=r[p].rect,v=r[p].id;E[v]={id:v,x:m.getCenterX(),y:m.getCenterY(),w:m.width,h:m.height}}return E},x.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var r=!1;if(d.ANIMATE==="during")this.emit("layoutstarted");else{for(;!r;)r=this.tick();this.graphManager.updateBounds()}},x.prototype.moveNodes=function(){for(var r=this.getAllNodes(),E,p=0;p<r.length;p++)E=r[p],E.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var p=0;p<r.length;p++)E=r[p],E.move()},x.prototype.initConstraintVariables=function(){var r=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 v=function M(R){for(var q=R.getChild().getNodes(),et,mt=0,j=0;j<q.length;j++)et=q[j],et.getChild()==null?r.fixedNodeSet.has(et.id)&&(mt+=100):mt+=M(et);return mt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(M){r.fixedNodeSet.add(M.nodeId)});for(var E=this.graphManager.getAllNodes(),m,p=0;p<E.length;p++)if(m=E[p],m.getChild()!=null){var b=v(m);b>0&&(m.fixedNodeWeight=b)}}if(this.constraints.relativePlacementConstraint){var w=new Map,O=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(M){r.fixedNodesOnHorizontal.add(M),r.fixedNodesOnVertical.add(M)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var F=this.constraints.alignmentConstraint.vertical,p=0;p<F.length;p++)this.dummyToNodeForVerticalAlignment.set("dummy"+p,[]),F[p].forEach(function(R){w.set(R,"dummy"+p),r.dummyToNodeForVerticalAlignment.get("dummy"+p).push(R),r.fixedNodeSet.has(R)&&r.fixedNodesOnHorizontal.add("dummy"+p)});if(this.constraints.alignmentConstraint.horizontal)for(var Y=this.constraints.alignmentConstraint.horizontal,p=0;p<Y.length;p++)this.dummyToNodeForHorizontalAlignment.set("dummy"+p,[]),Y[p].forEach(function(R){O.set(R,"dummy"+p),r.dummyToNodeForHorizontalAlignment.get("dummy"+p).push(R),r.fixedNodeSet.has(R)&&r.fixedNodesOnVertical.add("dummy"+p)})}if(l.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(M){var R,q,et;for(et=M.length-1;et>=2*M.length/3;et--)R=Math.floor(Math.random()*(et+1)),q=M[et],M[et]=M[R],M[R]=q;return M},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(M){if(M.left){var R=w.has(M.left)?w.get(M.left):M.left,q=w.has(M.right)?w.get(M.right):M.right;r.nodesInRelativeHorizontal.includes(R)||(r.nodesInRelativeHorizontal.push(R),r.nodeToRelativeConstraintMapHorizontal.set(R,[]),r.dummyToNodeForVerticalAlignment.has(R)?r.nodeToTempPositionMapHorizontal.set(R,r.idToNodeMap.get(r.dummyToNodeForVerticalAlignment.get(R)[0]).getCenterX()):r.nodeToTempPositionMapHorizontal.set(R,r.idToNodeMap.get(R).getCenterX())),r.nodesInRelativeHorizontal.includes(q)||(r.nodesInRelativeHorizontal.push(q),r.nodeToRelativeConstraintMapHorizontal.set(q,[]),r.dummyToNodeForVerticalAlignment.has(q)?r.nodeToTempPositionMapHorizontal.set(q,r.idToNodeMap.get(r.dummyToNodeForVerticalAlignment.get(q)[0]).getCenterX()):r.nodeToTempPositionMapHorizontal.set(q,r.idToNodeMap.get(q).getCenterX())),r.nodeToRelativeConstraintMapHorizontal.get(R).push({right:q,gap:M.gap}),r.nodeToRelativeConstraintMapHorizontal.get(q).push({left:R,gap:M.gap})}else{var et=O.has(M.top)?O.get(M.top):M.top,mt=O.has(M.bottom)?O.get(M.bottom):M.bottom;r.nodesInRelativeVertical.includes(et)||(r.nodesInRelativeVertical.push(et),r.nodeToRelativeConstraintMapVertical.set(et,[]),r.dummyToNodeForHorizontalAlignment.has(et)?r.nodeToTempPositionMapVertical.set(et,r.idToNodeMap.get(r.dummyToNodeForHorizontalAlignment.get(et)[0]).getCenterY()):r.nodeToTempPositionMapVertical.set(et,r.idToNodeMap.get(et).getCenterY())),r.nodesInRelativeVertical.includes(mt)||(r.nodesInRelativeVertical.push(mt),r.nodeToRelativeConstraintMapVertical.set(mt,[]),r.dummyToNodeForHorizontalAlignment.has(mt)?r.nodeToTempPositionMapVertical.set(mt,r.idToNodeMap.get(r.dummyToNodeForHorizontalAlignment.get(mt)[0]).getCenterY()):r.nodeToTempPositionMapVertical.set(mt,r.idToNodeMap.get(mt).getCenterY())),r.nodeToRelativeConstraintMapVertical.get(et).push({bottom:mt,gap:M.gap}),r.nodeToRelativeConstraintMapVertical.get(mt).push({top:et,gap:M.gap})}});else{var z=new Map,W=new Map;this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var R=w.has(M.left)?w.get(M.left):M.left,q=w.has(M.right)?w.get(M.right):M.right;z.has(R)?z.get(R).push(q):z.set(R,[q]),z.has(q)?z.get(q).push(R):z.set(q,[R])}else{var et=O.has(M.top)?O.get(M.top):M.top,mt=O.has(M.bottom)?O.get(M.bottom):M.bottom;W.has(et)?W.get(et).push(mt):W.set(et,[mt]),W.has(mt)?W.get(mt).push(et):W.set(mt,[et])}});var B=function(M,R){var q=[],et=[],mt=new Z,j=new Set,Ot=0;return M.forEach(function(Q,rt){if(!j.has(rt)){q[Ot]=[],et[Ot]=!1;var vt=rt;for(mt.push(vt),j.add(vt),q[Ot].push(vt);mt.length!=0;){vt=mt.shift(),R.has(vt)&&(et[Ot]=!0);var st=M.get(vt);st.forEach(function(Lt){j.has(Lt)||(mt.push(Lt),j.add(Lt),q[Ot].push(Lt))})}Ot++}}),{components:q,isFixed:et}},$=B(z,r.fixedNodesOnHorizontal);this.componentsOnHorizontal=$.components,this.fixedComponentsOnHorizontal=$.isFixed;var P=B(W,r.fixedNodesOnVertical);this.componentsOnVertical=P.components,this.fixedComponentsOnVertical=P.isFixed}}},x.prototype.updateDisplacements=function(){var r=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(P){var M=r.idToNodeMap.get(P.nodeId);M.displacementX=0,M.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,v=0;v<E[p].length;v++){if(this.fixedNodeSet.has(E[p][v])){m=0;break}m+=this.idToNodeMap.get(E[p][v]).displacementX}for(var b=m/E[p].length,v=0;v<E[p].length;v++)this.idToNodeMap.get(E[p][v]).displacementX=b}if(this.constraints.alignmentConstraint.horizontal)for(var w=this.constraints.alignmentConstraint.horizontal,p=0;p<w.length;p++){for(var O=0,v=0;v<w[p].length;v++){if(this.fixedNodeSet.has(w[p][v])){O=0;break}O+=this.idToNodeMap.get(w[p][v]).displacementY}for(var F=O/w[p].length,v=0;v<w[p].length;v++)this.idToNodeMap.get(w[p][v]).displacementY=F}}if(this.constraints.relativePlacementConstraint)if(l.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(P){if(!r.fixedNodesOnHorizontal.has(P)){var M=0;r.dummyToNodeForVerticalAlignment.has(P)?M=r.idToNodeMap.get(r.dummyToNodeForVerticalAlignment.get(P)[0]).displacementX:M=r.idToNodeMap.get(P).displacementX,r.nodeToRelativeConstraintMapHorizontal.get(P).forEach(function(R){if(R.right){var q=r.nodeToTempPositionMapHorizontal.get(R.right)-r.nodeToTempPositionMapHorizontal.get(P)-M;q<R.gap&&(M-=R.gap-q)}else{var q=r.nodeToTempPositionMapHorizontal.get(P)-r.nodeToTempPositionMapHorizontal.get(R.left)+M;q<R.gap&&(M+=R.gap-q)}}),r.nodeToTempPositionMapHorizontal.set(P,r.nodeToTempPositionMapHorizontal.get(P)+M),r.dummyToNodeForVerticalAlignment.has(P)?r.dummyToNodeForVerticalAlignment.get(P).forEach(function(R){r.idToNodeMap.get(R).displacementX=M}):r.idToNodeMap.get(P).displacementX=M}}),this.nodesInRelativeVertical.forEach(function(P){if(!r.fixedNodesOnHorizontal.has(P)){var M=0;r.dummyToNodeForHorizontalAlignment.has(P)?M=r.idToNodeMap.get(r.dummyToNodeForHorizontalAlignment.get(P)[0]).displacementY:M=r.idToNodeMap.get(P).displacementY,r.nodeToRelativeConstraintMapVertical.get(P).forEach(function(R){if(R.bottom){var q=r.nodeToTempPositionMapVertical.get(R.bottom)-r.nodeToTempPositionMapVertical.get(P)-M;q<R.gap&&(M-=R.gap-q)}else{var q=r.nodeToTempPositionMapVertical.get(P)-r.nodeToTempPositionMapVertical.get(R.top)+M;q<R.gap&&(M+=R.gap-q)}}),r.nodeToTempPositionMapVertical.set(P,r.nodeToTempPositionMapVertical.get(P)+M),r.dummyToNodeForHorizontalAlignment.has(P)?r.dummyToNodeForHorizontalAlignment.get(P).forEach(function(R){r.idToNodeMap.get(R).displacementY=M}):r.idToNodeMap.get(P).displacementY=M}});else{for(var p=0;p<this.componentsOnHorizontal.length;p++){var Y=this.componentsOnHorizontal[p];if(this.fixedComponentsOnHorizontal[p])for(var v=0;v<Y.length;v++)this.dummyToNodeForVerticalAlignment.has(Y[v])?this.dummyToNodeForVerticalAlignment.get(Y[v]).forEach(function(R){r.idToNodeMap.get(R).displacementX=0}):this.idToNodeMap.get(Y[v]).displacementX=0;else{for(var z=0,W=0,v=0;v<Y.length;v++)if(this.dummyToNodeForVerticalAlignment.has(Y[v])){var B=this.dummyToNodeForVerticalAlignment.get(Y[v]);z+=B.length*this.idToNodeMap.get(B[0]).displacementX,W+=B.length}else z+=this.idToNodeMap.get(Y[v]).displacementX,W++;for(var $=z/W,v=0;v<Y.length;v++)this.dummyToNodeForVerticalAlignment.has(Y[v])?this.dummyToNodeForVerticalAlignment.get(Y[v]).forEach(function(R){r.idToNodeMap.get(R).displacementX=$}):this.idToNodeMap.get(Y[v]).displacementX=$}}for(var p=0;p<this.componentsOnVertical.length;p++){var Y=this.componentsOnVertical[p];if(this.fixedComponentsOnVertical[p])for(var v=0;v<Y.length;v++)this.dummyToNodeForHorizontalAlignment.has(Y[v])?this.dummyToNodeForHorizontalAlignment.get(Y[v]).forEach(function(q){r.idToNodeMap.get(q).displacementY=0}):this.idToNodeMap.get(Y[v]).displacementY=0;else{for(var z=0,W=0,v=0;v<Y.length;v++)if(this.dummyToNodeForHorizontalAlignment.has(Y[v])){var B=this.dummyToNodeForHorizontalAlignment.get(Y[v]);z+=B.length*this.idToNodeMap.get(B[0]).displacementY,W+=B.length}else z+=this.idToNodeMap.get(Y[v]).displacementY,W++;for(var $=z/W,v=0;v<Y.length;v++)this.dummyToNodeForHorizontalAlignment.has(Y[v])?this.dummyToNodeForHorizontalAlignment.get(Y[v]).forEach(function(et){r.idToNodeMap.get(et).displacementY=$}):this.idToNodeMap.get(Y[v]).displacementY=$}}}},x.prototype.calculateNodesToApplyGravitationTo=function(){var r=[],E,p=this.graphManager.getGraphs(),m=p.length,v;for(v=0;v<m;v++)E=p[v],E.updateConnected(),E.isConnected||(r=r.concat(E.getNodes()));return r},x.prototype.createBendpoints=function(){var r=[];r=r.concat(this.graphManager.getAllEdges());var E=new Set,p;for(p=0;p<r.length;p++){var m=r[p];if(!E.has(m)){var v=m.getSource(),b=m.getTarget();if(v==b)m.getBendpoints().push(new y),m.getBendpoints().push(new y),this.createDummyNodesForBendpoints(m),E.add(m);else{var w=[];if(w=w.concat(v.getEdgeListToNode(b)),w=w.concat(b.getEdgeListToNode(v)),!E.has(w[0])){if(w.length>1){var O;for(O=0;O<w.length;O++){var F=w[O];F.getBendpoints().push(new y),this.createDummyNodesForBendpoints(F)}}w.forEach(function(Y){E.add(Y)})}}}if(E.size==r.length)break}},x.prototype.positionNodesRadially=function(r){for(var E=new c(0,0),p=Math.ceil(Math.sqrt(r.length)),m=0,v=0,b=0,w=new y(0,0),O=0;O<r.length;O++){O%p==0&&(b=0,v=m,O!=0&&(v+=l.DEFAULT_COMPONENT_SEPERATION),m=0);var F=r[O],Y=I.findCenterOfTree(F);E.x=b,E.y=v,w=x.radialLayout(F,Y,E),w.y>m&&(m=Math.floor(w.y)),b=Math.floor(w.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new y(T.WORLD_CENTER_X-w.x/2,T.WORLD_CENTER_Y-w.y/2))},x.radialLayout=function(r,E,p){var m=Math.max(this.maxDiagonalInTree(r),l.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(E,null,0,359,0,m);var v=U.calculateBounds(r),b=new H;b.setDeviceOrgX(v.getMinX()),b.setDeviceOrgY(v.getMinY()),b.setWorldOrgX(p.x),b.setWorldOrgY(p.y);for(var w=0;w<r.length;w++){var O=r[w];O.transform(b)}var F=new y(v.getMaxX(),v.getMaxY());return b.inverseTransformPoint(F)},x.branchRadialLayout=function(r,E,p,m,v,b){var w=(m-p+1)/2;w<0&&(w+=180);var O=(w+p)%360,F=O*k.TWO_PI/360,Y=v*Math.cos(F),z=v*Math.sin(F);r.setCenter(Y,z);var W=[];W=W.concat(r.getEdges());var B=W.length;E!=null&&B--;for(var $=0,P=W.length,M,R=r.getEdgesBetween(E);R.length>1;){var q=R[0];R.splice(0,1);var et=W.indexOf(q);et>=0&&W.splice(et,1),P--,B--}E!=null?M=(W.indexOf(R[0])+1)%P:M=0;for(var mt=Math.abs(m-p)/B,j=M;$!=B;j=++j%P){var Ot=W[j].getOtherEnd(r);if(Ot!=E){var Q=(p+$*mt)%360,rt=(Q+mt)%360;x.branchRadialLayout(Ot,r,Q,rt,v+b,b),$++}}},x.maxDiagonalInTree=function(r){for(var E=G.MIN_VALUE,p=0;p<r.length;p++){var m=r[p],v=m.getDiagonal();v>E&&(E=v)}return E},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var r=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),v=0;v<m.length;v++){var b=m[v],w=b.getParent();this.getNodeDegreeWithChildren(b)===0&&(w.id==null||!this.getToBeTiled(w))&&p.push(b)}for(var v=0;v<p.length;v++){var b=p[v],O=b.getParent().id;typeof E[O]>"u"&&(E[O]=[]),E[O]=E[O].concat(b)}Object.keys(E).forEach(function(F){if(E[F].length>1){var Y="DummyCompound_"+F;r.memberGroups[Y]=E[F];var z=E[F][0].getParent(),W=new t(r.graphManager);W.id=Y,W.paddingLeft=z.paddingLeft||0,W.paddingRight=z.paddingRight||0,W.paddingBottom=z.paddingBottom||0,W.paddingTop=z.paddingTop||0,r.idToDummyNode[Y]=W;var B=r.getGraphManager().add(r.newGraph(),W),$=z.getChild();$.add(W);for(var P=0;P<E[F].length;P++){var M=E[F][P];$.remove(M),B.add(M)}}})},x.prototype.clearCompounds=function(){var r={},E={};this.performDFSOnCompounds();for(var p=0;p<this.compoundOrder.length;p++)E[this.compoundOrder[p].id]=this.compoundOrder[p],r[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(r,E)},x.prototype.clearZeroDegreeMembers=function(){var r=this,E=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(p){var m=r.idToDummyNode[p];if(E[p]=r.tileNodes(r.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,l.NODE_DIMENSIONS_INCLUDE_LABELS){var v=m.rect.width,b=m.rect.height;m.labelWidth&&(m.labelPosHorizontal=="left"?(m.rect.x-=m.labelWidth,m.setWidth(v+m.labelWidth),m.labelMarginLeft=m.labelWidth):m.labelPosHorizontal=="center"&&m.labelWidth>v?(m.rect.x-=(m.labelWidth-v)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-v)/2):m.labelPosHorizontal=="right"&&m.setWidth(v+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(b+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>b?(m.rect.y-=(m.labelHeight-b)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-b)/2):m.labelPosVertical=="bottom"&&m.setHeight(b+m.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var r=this.compoundOrder.length-1;r>=0;r--){var E=this.compoundOrder[r],p=E.id,m=E.paddingLeft,v=E.paddingTop,b=E.labelMarginLeft,w=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,v,b,w)}},x.prototype.repopulateZeroDegreeMembers=function(){var r=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=r.idToDummyNode[p],v=m.paddingLeft,b=m.paddingTop,w=m.labelMarginLeft,O=m.labelMarginTop;r.adjustLocations(E[p],m.rect.x,m.rect.y,v,b,w,O)})},x.prototype.getToBeTiled=function(r){var E=r.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=r.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),v=0;v<m.length;v++){var b=m[v];if(this.getNodeDegree(b)>0)return this.toBeTiled[E]=!1,!1;if(b.getChild()==null){this.toBeTiled[b.id]=!1;continue}if(!this.getToBeTiled(b))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},x.prototype.getNodeDegree=function(r){r.id;for(var E=r.getEdges(),p=0,m=0;m<E.length;m++){var v=E[m];v.getSource().id!==v.getTarget().id&&(p=p+1)}return p},x.prototype.getNodeDegreeWithChildren=function(r){var E=this.getNodeDegree(r);if(r.getChild()==null)return E;for(var p=r.getChild().getNodes(),m=0;m<p.length;m++){var v=p[m];E+=this.getNodeDegreeWithChildren(v)}return E},x.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},x.prototype.fillCompexOrderByDFS=function(r){for(var E=0;E<r.length;E++){var p=r[E];p.getChild()!=null&&this.fillCompexOrderByDFS(p.getChild().getNodes()),this.getToBeTiled(p)&&this.compoundOrder.push(p)}},x.prototype.adjustLocations=function(r,E,p,m,v,b,w){E+=m+b,p+=v+w;for(var O=E,F=0;F<r.rows.length;F++){var Y=r.rows[F];E=O;for(var z=0,W=0;W<Y.length;W++){var B=Y[W];B.rect.x=E,B.rect.y=p,E+=B.rect.width+r.horizontalPadding,B.rect.height>z&&(z=B.rect.height)}p+=z+r.verticalPadding}},x.prototype.tileCompoundMembers=function(r,E){var p=this;this.tiledMemberPack=[],Object.keys(r).forEach(function(m){var v=E[m];if(p.tiledMemberPack[m]=p.tileNodes(r[m],v.paddingLeft+v.paddingRight),v.rect.width=p.tiledMemberPack[m].width,v.rect.height=p.tiledMemberPack[m].height,v.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),v.labelMarginLeft=0,v.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var b=v.rect.width,w=v.rect.height;v.labelWidth&&(v.labelPosHorizontal=="left"?(v.rect.x-=v.labelWidth,v.setWidth(b+v.labelWidth),v.labelMarginLeft=v.labelWidth):v.labelPosHorizontal=="center"&&v.labelWidth>b?(v.rect.x-=(v.labelWidth-b)/2,v.setWidth(v.labelWidth),v.labelMarginLeft=(v.labelWidth-b)/2):v.labelPosHorizontal=="right"&&v.setWidth(b+v.labelWidth)),v.labelHeight&&(v.labelPosVertical=="top"?(v.rect.y-=v.labelHeight,v.setHeight(w+v.labelHeight),v.labelMarginTop=v.labelHeight):v.labelPosVertical=="center"&&v.labelHeight>w?(v.rect.y-=(v.labelHeight-w)/2,v.setHeight(v.labelHeight),v.labelMarginTop=(v.labelHeight-w)/2):v.labelPosVertical=="bottom"&&v.setHeight(w+v.labelHeight))}})},x.prototype.tileNodes=function(r,E){var p=this.tileNodesByFavoringDim(r,E,!0),m=this.tileNodesByFavoringDim(r,E,!1),v=this.getOrgRatio(p),b=this.getOrgRatio(m),w;return b<v?w=m:w=p,w},x.prototype.getOrgRatio=function(r){var E=r.width,p=r.height,m=E/p;return m<1&&(m=1/m),m},x.prototype.calcIdealRowWidth=function(r,E){var p=l.TILING_PADDING_VERTICAL,m=l.TILING_PADDING_HORIZONTAL,v=r.length,b=0,w=0,O=0;r.forEach(function(P){b+=P.getWidth(),w+=P.getHeight(),P.getWidth()>O&&(O=P.getWidth())});var F=b/v,Y=w/v,z=Math.pow(p-m,2)+4*(F+m)*(Y+p)*v,W=(m-p+Math.sqrt(z))/(2*(F+m)),B;E?(B=Math.ceil(W),B==W&&B++):B=Math.floor(W);var $=B*(F+m)-m;return O>$&&($=O),$+=m*2,$},x.prototype.tileNodesByFavoringDim=function(r,E,p){var m=l.TILING_PADDING_VERTICAL,v=l.TILING_PADDING_HORIZONTAL,b=l.TILING_COMPARE_BY,w={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:v,centerX:0,centerY:0};b&&(w.idealRowWidth=this.calcIdealRowWidth(r,p));var O=function(P){return P.rect.width*P.rect.height},F=function(P,M){return O(M)-O(P)};r.sort(function(P,M){var R=F;return w.idealRowWidth?(R=b,R(P.id,M.id)):R(P,M)});for(var Y=0,z=0,W=0;W<r.length;W++){var B=r[W];Y+=B.getCenterX(),z+=B.getCenterY()}w.centerX=Y/r.length,w.centerY=z/r.length;for(var W=0;W<r.length;W++){var B=r[W];if(w.rows.length==0)this.insertNodeToRow(w,B,0,E);else if(this.canAddHorizontal(w,B.rect.width,B.rect.height)){var $=w.rows.length-1;w.idealRowWidth||($=this.getShortestRowIndex(w)),this.insertNodeToRow(w,B,$,E)}else this.insertNodeToRow(w,B,w.rows.length,E);this.shiftToLastRow(w)}return w},x.prototype.insertNodeToRow=function(r,E,p,m){var v=m;if(p==r.rows.length){var b=[];r.rows.push(b),r.rowWidth.push(v),r.rowHeight.push(0)}var w=r.rowWidth[p]+E.rect.width;r.rows[p].length>0&&(w+=r.horizontalPadding),r.rowWidth[p]=w,r.width<w&&(r.width=w);var O=E.rect.height;p>0&&(O+=r.verticalPadding);var F=0;O>r.rowHeight[p]&&(F=r.rowHeight[p],r.rowHeight[p]=O,F=r.rowHeight[p]-F),r.height+=F,r.rows[p].push(E)},x.prototype.getShortestRowIndex=function(r){for(var E=-1,p=Number.MAX_VALUE,m=0;m<r.rows.length;m++)r.rowWidth[m]<p&&(E=m,p=r.rowWidth[m]);return E},x.prototype.getLongestRowIndex=function(r){for(var E=-1,p=Number.MIN_VALUE,m=0;m<r.rows.length;m++)r.rowWidth[m]>p&&(E=m,p=r.rowWidth[m]);return E},x.prototype.canAddHorizontal=function(r,E,p){if(r.idealRowWidth){var m=r.rows.length-1,v=r.rowWidth[m];return v+E+r.horizontalPadding<=r.idealRowWidth}var b=this.getShortestRowIndex(r);if(b<0)return!0;var w=r.rowWidth[b];if(w+r.horizontalPadding+E<=r.width)return!0;var O=0;r.rowHeight[b]<p&&b>0&&(O=p+r.verticalPadding-r.rowHeight[b]);var F;r.width-w>=E+r.horizontalPadding?F=(r.height+O)/(w+E+r.horizontalPadding):F=(r.height+O)/r.width,O=p+r.verticalPadding;var Y;return r.width<E?Y=(r.height+O)/E:Y=(r.height+O)/r.width,Y<1&&(Y=1/Y),F<1&&(F=1/F),F<Y},x.prototype.shiftToLastRow=function(r){var E=this.getLongestRowIndex(r),p=r.rowWidth.length-1,m=r.rows[E],v=m[m.length-1],b=v.width+r.horizontalPadding;if(r.width-r.rowWidth[p]>b&&E!=p){m.splice(-1,1),r.rows[p].push(v),r.rowWidth[E]=r.rowWidth[E]-b,r.rowWidth[p]=r.rowWidth[p]+b,r.width=r.rowWidth[instance.getLongestRowIndex(r)];for(var w=Number.MIN_VALUE,O=0;O<m.length;O++)m[O].height>w&&(w=m[O].height);E>0&&(w+=r.verticalPadding);var F=r.rowHeight[E]+r.rowHeight[p];r.rowHeight[E]=w,r.rowHeight[p]<v.height+r.verticalPadding&&(r.rowHeight[p]=v.height+r.verticalPadding);var Y=r.rowHeight[E]+r.rowHeight[p];r.height+=Y-F,this.shiftToLastRow(r)}},x.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},x.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},x.prototype.reduceTrees=function(){for(var r=[],E=!0,p;E;){var m=this.graphManager.getAllNodes(),v=[];E=!1;for(var b=0;b<m.length;b++)if(p=m[b],p.getEdges().length==1&&!p.getEdges()[0].isInterGraph&&p.getChild()==null){if(l.PURE_INCREMENTAL){var w=p.getEdges()[0].getOtherEnd(p),O=new A(p.getCenterX()-w.getCenterX(),p.getCenterY()-w.getCenterY());v.push([p,p.getEdges()[0],p.getOwner(),O])}else v.push([p,p.getEdges()[0],p.getOwner()]);E=!0}if(E==!0){for(var F=[],Y=0;Y<v.length;Y++)v[Y][0].getEdges().length==1&&(F.push(v[Y]),v[Y][0].getOwner().remove(v[Y][0]));r.push(F),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=r},x.prototype.growTree=function(r){for(var E=r.length,p=r[E-1],m,v=0;v<p.length;v++)m=p[v],this.findPlaceforPrunedNode(m),m[2].add(m[0]),m[2].add(m[1],m[1].source,m[1].target);r.splice(r.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},x.prototype.findPlaceforPrunedNode=function(r){var E,p,m=r[0];if(m==r[1].source?p=r[1].target:p=r[1].source,l.PURE_INCREMENTAL)m.setCenter(p.getCenterX()+r[3].getWidth(),p.getCenterY()+r[3].getHeight());else{var v=p.startX,b=p.finishX,w=p.startY,O=p.finishY,F=0,Y=0,z=0,W=0,B=[F,z,Y,W];if(w>0)for(var $=v;$<=b;$++)B[0]+=this.grid[$][w-1].length+this.grid[$][w].length-1;if(b<this.grid.length-1)for(var $=w;$<=O;$++)B[1]+=this.grid[b+1][$].length+this.grid[b][$].length-1;if(O<this.grid[0].length-1)for(var $=v;$<=b;$++)B[2]+=this.grid[$][O+1].length+this.grid[$][O].length-1;if(v>0)for(var $=w;$<=O;$++)B[3]+=this.grid[v-1][$].length+this.grid[v][$].length-1;for(var P=G.MAX_VALUE,M,R,q=0;q<B.length;q++)B[q]<P?(P=B[q],M=1,R=q):B[q]==P&&M++;if(M==3&&P==0)B[0]==0&&B[1]==0&&B[2]==0?E=1:B[0]==0&&B[1]==0&&B[3]==0?E=0:B[0]==0&&B[2]==0&&B[3]==0?E=3:B[1]==0&&B[2]==0&&B[3]==0&&(E=2);else if(M==2&&P==0){var et=Math.floor(Math.random()*2);B[0]==0&&B[1]==0?et==0?E=0:E=1:B[0]==0&&B[2]==0?et==0?E=0:E=2:B[0]==0&&B[3]==0?et==0?E=0:E=3:B[1]==0&&B[2]==0?et==0?E=1:E=2:B[1]==0&&B[3]==0?et==0?E=1:E=3:et==0?E=2:E=3}else if(M==4&&P==0){var et=Math.floor(Math.random()*4);E=et}else E=R;E==0?m.setCenter(p.getCenterX(),p.getCenterY()-p.getHeight()/2-d.DEFAULT_EDGE_LENGTH-m.getHeight()/2):E==1?m.setCenter(p.getCenterX()+p.getWidth()/2+d.DEFAULT_EDGE_LENGTH+m.getWidth()/2,p.getCenterY()):E==2?m.setCenter(p.getCenterX(),p.getCenterY()+p.getHeight()/2+d.DEFAULT_EDGE_LENGTH+m.getHeight()/2):m.setCenter(p.getCenterX()-p.getWidth()/2-d.DEFAULT_EDGE_LENGTH-m.getWidth()/2,p.getCenterY())}},n.exports=x}),991:((n,i,e)=>{var a=e(551).FDLayoutNode,o=e(551).IMath;function f(s,l,g,d){a.call(this,s,l,g,d)}f.prototype=Object.create(a.prototype);for(var t in a)f[t]=a[t];f.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*o.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*o.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(s,l){for(var g=this.getChild().getNodes(),d,T=0;T<g.length;T++)d=g[T],d.getChild()==null?(d.displacementX+=s,d.displacementY+=l):d.propogateDisplacementToChildren(s,l)},f.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},f.prototype.setPred1=function(s){this.pred1=s},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(s){this.next=s},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(s){this.processed=s},f.prototype.isProcessed=function(){return processed},n.exports=f}),902:((n,i,e)=>{function a(g){if(Array.isArray(g)){for(var d=0,T=Array(g.length);d<g.length;d++)T[d]=g[d];return T}else return Array.from(g)}var o=e(806),f=e(551).LinkedList,t=e(551).Matrix,s=e(551).SVD;function l(){}l.handleConstraints=function(g){var d={};d.fixedNodeConstraint=g.constraints.fixedNodeConstraint,d.alignmentConstraint=g.constraints.alignmentConstraint,d.relativePlacementConstraint=g.constraints.relativePlacementConstraint;for(var T=new Map,c=new Map,y=[],A=[],I=g.getAllNodes(),G=0,k=0;k<I.length;k++){var U=I[k];U.getChild()==null&&(c.set(U.id,G++),y.push(U.getCenterX()),A.push(U.getCenterY()),T.set(U.id,U))}d.relativePlacementConstraint&&d.relativePlacementConstraint.forEach(function(_){!_.gap&&_.gap!=0&&(_.left?_.gap=o.DEFAULT_EDGE_LENGTH+T.get(_.left).getWidth()/2+T.get(_.right).getWidth()/2:_.gap=o.DEFAULT_EDGE_LENGTH+T.get(_.top).getHeight()/2+T.get(_.bottom).getHeight()/2)});var H=function(_,D){return{x:_.x-D.x,y:_.y-D.y}},Z=function(_){var D=0,V=0;return _.forEach(function(J){D+=y[c.get(J)],V+=A[c.get(J)]}),{x:D/_.size,y:V/_.size}},x=function(_,D,V,J,K){function ft(lt,ot){var at=new Set(lt),Ct=!0,gt=!1,Mt=void 0;try{for(var Ft=ot[Symbol.iterator](),It;!(Ct=(It=Ft.next()).done);Ct=!0){var Nt=It.value;at.add(Nt)}}catch(Ut){gt=!0,Mt=Ut}finally{try{!Ct&&Ft.return&&Ft.return()}finally{if(gt)throw Mt}}return at}var ht=new Map;_.forEach(function(lt,ot){ht.set(ot,0)}),_.forEach(function(lt,ot){lt.forEach(function(at){ht.set(at.id,ht.get(at.id)+1)})});var tt=new Map,ct=new Map,it=new f;ht.forEach(function(lt,ot){lt==0?(it.push(ot),V||(D=="horizontal"?tt.set(ot,c.has(ot)?y[c.get(ot)]:J.get(ot)):tt.set(ot,c.has(ot)?A[c.get(ot)]:J.get(ot)))):tt.set(ot,Number.NEGATIVE_INFINITY),V&&ct.set(ot,new Set([ot]))}),V&&K.forEach(function(lt){var ot=[];if(lt.forEach(function(gt){V.has(gt)&&ot.push(gt)}),ot.length>0){var at=0;ot.forEach(function(gt){D=="horizontal"?(tt.set(gt,c.has(gt)?y[c.get(gt)]:J.get(gt)),at+=tt.get(gt)):(tt.set(gt,c.has(gt)?A[c.get(gt)]:J.get(gt)),at+=tt.get(gt))}),at=at/ot.length,lt.forEach(function(gt){V.has(gt)||tt.set(gt,at)})}else{var Ct=0;lt.forEach(function(gt){D=="horizontal"?Ct+=c.has(gt)?y[c.get(gt)]:J.get(gt):Ct+=c.has(gt)?A[c.get(gt)]:J.get(gt)}),Ct=Ct/lt.length,lt.forEach(function(gt){tt.set(gt,Ct)})}});for(var Et=function(){var lt=it.shift(),ot=_.get(lt);ot.forEach(function(at){if(tt.get(at.id)<tt.get(lt)+at.gap)if(V&&V.has(at.id)){var Ct=void 0;if(D=="horizontal"?Ct=c.has(at.id)?y[c.get(at.id)]:J.get(at.id):Ct=c.has(at.id)?A[c.get(at.id)]:J.get(at.id),tt.set(at.id,Ct),Ct<tt.get(lt)+at.gap){var gt=tt.get(lt)+at.gap-Ct;ct.get(lt).forEach(function(Mt){tt.set(Mt,tt.get(Mt)-gt)})}}else tt.set(at.id,tt.get(lt)+at.gap);ht.set(at.id,ht.get(at.id)-1),ht.get(at.id)==0&&it.push(at.id),V&&ct.set(at.id,ft(ct.get(lt),ct.get(at.id)))})};it.length!=0;)Et();if(V){var yt=new Set;_.forEach(function(lt,ot){lt.length==0&&yt.add(ot)});var xt=[];ct.forEach(function(lt,ot){if(yt.has(ot)){var at=!1,Ct=!0,gt=!1,Mt=void 0;try{for(var Ft=lt[Symbol.iterator](),It;!(Ct=(It=Ft.next()).done);Ct=!0){var Nt=It.value;V.has(Nt)&&(at=!0)}}catch(bt){gt=!0,Mt=bt}finally{try{!Ct&&Ft.return&&Ft.return()}finally{if(gt)throw Mt}}if(!at){var Ut=!1,kt=void 0;xt.forEach(function(bt,St){bt.has([].concat(a(lt))[0])&&(Ut=!0,kt=St)}),Ut?lt.forEach(function(bt){xt[kt].add(bt)}):xt.push(new Set(lt))}}}),xt.forEach(function(lt,ot){var at=Number.POSITIVE_INFINITY,Ct=Number.POSITIVE_INFINITY,gt=Number.NEGATIVE_INFINITY,Mt=Number.NEGATIVE_INFINITY,Ft=!0,It=!1,Nt=void 0;try{for(var Ut=lt[Symbol.iterator](),kt;!(Ft=(kt=Ut.next()).done);Ft=!0){var bt=kt.value,St=void 0;D=="horizontal"?St=c.has(bt)?y[c.get(bt)]:J.get(bt):St=c.has(bt)?A[c.get(bt)]:J.get(bt);var $t=tt.get(bt);St<at&&(at=St),St>gt&&(gt=St),$t<Ct&&(Ct=$t),$t>Mt&&(Mt=$t)}}catch(qt){It=!0,Nt=qt}finally{try{!Ft&&Ut.return&&Ut.return()}finally{if(It)throw Nt}}var oe=(at+gt)/2-(Ct+Mt)/2,ee=!0,Kt=!1,Zt=void 0;try{for(var jt=lt[Symbol.iterator](),Jt;!(ee=(Jt=jt.next()).done);ee=!0){var re=Jt.value;tt.set(re,tt.get(re)+oe)}}catch(qt){Kt=!0,Zt=qt}finally{try{!ee&&jt.return&&jt.return()}finally{if(Kt)throw Zt}}})}return tt},nt=function(_){var D=0,V=0,J=0,K=0;if(_.forEach(function(ct){ct.left?y[c.get(ct.left)]-y[c.get(ct.right)]>=0?D++:V++:A[c.get(ct.top)]-A[c.get(ct.bottom)]>=0?J++:K++}),D>V&&J>K)for(var ft=0;ft<c.size;ft++)y[ft]=-1*y[ft],A[ft]=-1*A[ft];else if(D>V)for(var ht=0;ht<c.size;ht++)y[ht]=-1*y[ht];else if(J>K)for(var tt=0;tt<c.size;tt++)A[tt]=-1*A[tt]},r=function(_){var D=[],V=new f,J=new Set,K=0;return _.forEach(function(ft,ht){if(!J.has(ht)){D[K]=[];var tt=ht;for(V.push(tt),J.add(tt),D[K].push(tt);V.length!=0;){tt=V.shift();var ct=_.get(tt);ct.forEach(function(it){J.has(it.id)||(V.push(it.id),J.add(it.id),D[K].push(it.id))})}K++}}),D},E=function(_){var D=new Map;return _.forEach(function(V,J){D.set(J,[])}),_.forEach(function(V,J){V.forEach(function(K){D.get(J).push(K),D.get(K.id).push({id:J,gap:K.gap,direction:K.direction})})}),D},p=function(_){var D=new Map;return _.forEach(function(V,J){D.set(J,[])}),_.forEach(function(V,J){V.forEach(function(K){D.get(K.id).push({id:J,gap:K.gap,direction:K.direction})})}),D},m=[],v=[],b=!1,w=!1,O=new Set,F=new Map,Y=new Map,z=[];if(d.fixedNodeConstraint&&d.fixedNodeConstraint.forEach(function(_){O.add(_.nodeId)}),d.relativePlacementConstraint&&(d.relativePlacementConstraint.forEach(function(_){_.left?(F.has(_.left)?F.get(_.left).push({id:_.right,gap:_.gap,direction:"horizontal"}):F.set(_.left,[{id:_.right,gap:_.gap,direction:"horizontal"}]),F.has(_.right)||F.set(_.right,[])):(F.has(_.top)?F.get(_.top).push({id:_.bottom,gap:_.gap,direction:"vertical"}):F.set(_.top,[{id:_.bottom,gap:_.gap,direction:"vertical"}]),F.has(_.bottom)||F.set(_.bottom,[]))}),Y=E(F),z=r(Y)),o.TRANSFORM_ON_CONSTRAINT_HANDLING){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>1)d.fixedNodeConstraint.forEach(function(_,D){m[D]=[_.position.x,_.position.y],v[D]=[y[c.get(_.nodeId)],A[c.get(_.nodeId)]]}),b=!0;else if(d.alignmentConstraint)(function(){var _=0;if(d.alignmentConstraint.vertical){for(var D=d.alignmentConstraint.vertical,V=function(tt){var ct=new Set;D[tt].forEach(function(yt){ct.add(yt)});var it=new Set([].concat(a(ct)).filter(function(yt){return O.has(yt)})),Et=void 0;it.size>0?Et=y[c.get(it.values().next().value)]:Et=Z(ct).x,D[tt].forEach(function(yt){m[_]=[Et,A[c.get(yt)]],v[_]=[y[c.get(yt)],A[c.get(yt)]],_++})},J=0;J<D.length;J++)V(J);b=!0}if(d.alignmentConstraint.horizontal){for(var K=d.alignmentConstraint.horizontal,ft=function(tt){var ct=new Set;K[tt].forEach(function(yt){ct.add(yt)});var it=new Set([].concat(a(ct)).filter(function(yt){return O.has(yt)})),Et=void 0;it.size>0?Et=y[c.get(it.values().next().value)]:Et=Z(ct).y,K[tt].forEach(function(yt){m[_]=[y[c.get(yt)],Et],v[_]=[y[c.get(yt)],A[c.get(yt)]],_++})},ht=0;ht<K.length;ht++)ft(ht);b=!0}d.relativePlacementConstraint&&(w=!0)})();else if(d.relativePlacementConstraint){for(var W=0,B=0,$=0;$<z.length;$++)z[$].length>W&&(W=z[$].length,B=$);if(W<Y.size/2)nt(d.relativePlacementConstraint),b=!1,w=!1;else{var P=new Map,M=new Map,R=[];z[B].forEach(function(_){F.get(_).forEach(function(D){D.direction=="horizontal"?(P.has(_)?P.get(_).push(D):P.set(_,[D]),P.has(D.id)||P.set(D.id,[]),R.push({left:_,right:D.id})):(M.has(_)?M.get(_).push(D):M.set(_,[D]),M.has(D.id)||M.set(D.id,[]),R.push({top:_,bottom:D.id}))})}),nt(R),w=!1;var q=x(P,"horizontal"),et=x(M,"vertical");z[B].forEach(function(_,D){v[D]=[y[c.get(_)],A[c.get(_)]],m[D]=[],q.has(_)?m[D][0]=q.get(_):m[D][0]=y[c.get(_)],et.has(_)?m[D][1]=et.get(_):m[D][1]=A[c.get(_)]}),b=!0}}if(b){for(var mt=void 0,j=t.transpose(m),Ot=t.transpose(v),Q=0;Q<j.length;Q++)j[Q]=t.multGamma(j[Q]),Ot[Q]=t.multGamma(Ot[Q]);var rt=t.multMat(j,t.transpose(Ot)),vt=s.svd(rt);mt=t.multMat(vt.V,t.transpose(vt.U));for(var st=0;st<c.size;st++){var Lt=[y[st],A[st]],_t=[mt[0][0],mt[1][0]],Tt=[mt[0][1],mt[1][1]];y[st]=t.dotProduct(Lt,_t),A[st]=t.dotProduct(Lt,Tt)}w&&nt(d.relativePlacementConstraint)}}if(o.ENFORCE_CONSTRAINTS){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>0){var At={x:0,y:0};d.fixedNodeConstraint.forEach(function(_,D){var V={x:y[c.get(_.nodeId)],y:A[c.get(_.nodeId)]},J=_.position,K=H(J,V);At.x+=K.x,At.y+=K.y}),At.x/=d.fixedNodeConstraint.length,At.y/=d.fixedNodeConstraint.length,y.forEach(function(_,D){y[D]+=At.x}),A.forEach(function(_,D){A[D]+=At.y}),d.fixedNodeConstraint.forEach(function(_){y[c.get(_.nodeId)]=_.position.x,A[c.get(_.nodeId)]=_.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var Xt=d.alignmentConstraint.vertical,Dt=function(_){var D=new Set;Xt[_].forEach(function(K){D.add(K)});var V=new Set([].concat(a(D)).filter(function(K){return O.has(K)})),J=void 0;V.size>0?J=y[c.get(V.values().next().value)]:J=Z(D).x,D.forEach(function(K){O.has(K)||(y[c.get(K)]=J)})},Rt=0;Rt<Xt.length;Rt++)Dt(Rt);if(d.alignmentConstraint.horizontal)for(var Gt=d.alignmentConstraint.horizontal,Bt=function(_){var D=new Set;Gt[_].forEach(function(K){D.add(K)});var V=new Set([].concat(a(D)).filter(function(K){return O.has(K)})),J=void 0;V.size>0?J=A[c.get(V.values().next().value)]:J=Z(D).y,D.forEach(function(K){O.has(K)||(A[c.get(K)]=J)})},Pt=0;Pt<Gt.length;Pt++)Bt(Pt)}d.relativePlacementConstraint&&(function(){var _=new Map,D=new Map,V=new Map,J=new Map,K=new Map,ft=new Map,ht=new Set,tt=new Set;if(O.forEach(function(ut){ht.add(ut),tt.add(ut)}),d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var ct=d.alignmentConstraint.vertical,it=function(ut){V.set("dummy"+ut,[]),ct[ut].forEach(function(wt){_.set(wt,"dummy"+ut),V.get("dummy"+ut).push(wt),O.has(wt)&&ht.add("dummy"+ut)}),K.set("dummy"+ut,y[c.get(ct[ut][0])])},Et=0;Et<ct.length;Et++)it(Et);if(d.alignmentConstraint.horizontal)for(var yt=d.alignmentConstraint.horizontal,xt=function(ut){J.set("dummy"+ut,[]),yt[ut].forEach(function(wt){D.set(wt,"dummy"+ut),J.get("dummy"+ut).push(wt),O.has(wt)&&tt.add("dummy"+ut)}),ft.set("dummy"+ut,A[c.get(yt[ut][0])])},lt=0;lt<yt.length;lt++)xt(lt)}var ot=new Map,at=new Map,Ct=function(ut){F.get(ut).forEach(function(wt){var Ht=void 0,Wt=void 0;wt.direction=="horizontal"?(Ht=_.get(ut)?_.get(ut):ut,_.get(wt.id)?Wt={id:_.get(wt.id),gap:wt.gap,direction:wt.direction}:Wt=wt,ot.has(Ht)?ot.get(Ht).push(Wt):ot.set(Ht,[Wt]),ot.has(Wt.id)||ot.set(Wt.id,[])):(Ht=D.get(ut)?D.get(ut):ut,D.get(wt.id)?Wt={id:D.get(wt.id),gap:wt.gap,direction:wt.direction}:Wt=wt,at.has(Ht)?at.get(Ht).push(Wt):at.set(Ht,[Wt]),at.has(Wt.id)||at.set(Wt.id,[]))})},gt=!0,Mt=!1,Ft=void 0;try{for(var It=F.keys()[Symbol.iterator](),Nt;!(gt=(Nt=It.next()).done);gt=!0){var Ut=Nt.value;Ct(Ut)}}catch(ut){Mt=!0,Ft=ut}finally{try{!gt&&It.return&&It.return()}finally{if(Mt)throw Ft}}var kt=E(ot),bt=E(at),St=r(kt),$t=r(bt),oe=p(ot),ee=p(at),Kt=[],Zt=[];St.forEach(function(ut,wt){Kt[wt]=[],ut.forEach(function(Ht){oe.get(Ht).length==0&&Kt[wt].push(Ht)})}),$t.forEach(function(ut,wt){Zt[wt]=[],ut.forEach(function(Ht){ee.get(Ht).length==0&&Zt[wt].push(Ht)})});var jt=x(ot,"horizontal",ht,K,Kt),Jt=x(at,"vertical",tt,ft,Zt),re=function(ut){V.get(ut)?V.get(ut).forEach(function(wt){y[c.get(wt)]=jt.get(ut)}):y[c.get(ut)]=jt.get(ut)},qt=!0,Ee=!1,Te=void 0;try{for(var ae=jt.keys()[Symbol.iterator](),Ne;!(qt=(Ne=ae.next()).done);qt=!0){var se=Ne.value;re(se)}}catch(ut){Ee=!0,Te=ut}finally{try{!qt&&ae.return&&ae.return()}finally{if(Ee)throw Te}}var We=function(ut){J.get(ut)?J.get(ut).forEach(function(wt){A[c.get(wt)]=Jt.get(ut)}):A[c.get(ut)]=Jt.get(ut)},he=!0,Ae=!1,Ce=void 0;try{for(var le=Jt.keys()[Symbol.iterator](),Ie;!(he=(Ie=le.next()).done);he=!0){var se=Ie.value;We(se)}}catch(ut){Ae=!0,Ce=ut}finally{try{!he&&le.return&&le.return()}finally{if(Ae)throw Ce}}})()}for(var zt=0;zt<I.length;zt++){var dt=I[zt];dt.getChild()==null&&dt.setCenter(y[c.get(dt.id)],A[c.get(dt.id)])}},n.exports=l}),551:(n=>{n.exports=L})},N={};function u(n){var i=N[n];if(i!==void 0)return i.exports;var e=N[n]={exports:{}};return S[n](e,e.exports,u),e.exports}var h=u(45);return h})()})})(ue)),ue.exports}var pi=ge.exports,we;function mi(){return we||(we=1,(function(C,X){(function(L,S){C.exports=S(fi())})(pi,function(L){return(()=>{var S={658:(n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var e=arguments.length,a=Array(e>1?e-1:0),o=1;o<e;o++)a[o-1]=arguments[o];return a.forEach(function(f){Object.keys(f).forEach(function(t){return i[t]=f[t]})}),i}}),548:((n,i,e)=>{var a=(function(){function t(s,l){var g=[],d=!0,T=!1,c=void 0;try{for(var y=s[Symbol.iterator](),A;!(d=(A=y.next()).done)&&(g.push(A.value),!(l&&g.length===l));d=!0);}catch(I){T=!0,c=I}finally{try{!d&&y.return&&y.return()}finally{if(T)throw c}}return g}return function(s,l){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,l);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=e(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(t){for(var s={},l=0;l<t.length;l++)s[t[l].id()]=!0;var g=t.filter(function(d,T){typeof d=="number"&&(d=T);for(var c=d.parent()[0];c!=null;){if(s[c.id()])return!1;c=c.parent()[0]}return!0});return g},f.connectComponents=function(t,s,l,g){var d=new o,T=new Set,c=[],y=void 0,A=void 0,I=void 0,G=!1,k=1,U=[],H=[],Z=function(){var x=t.collection();H.push(x);var nt=l[0],r=t.collection();r.merge(nt).merge(nt.descendants().intersection(s)),c.push(nt),r.forEach(function(m){d.push(m),T.add(m),x.merge(m)});for(var E=function(){nt=d.shift();var m=t.collection();nt.neighborhood().nodes().forEach(function(O){s.intersection(nt.edgesWith(O)).length>0&&m.merge(O)});for(var v=0;v<m.length;v++){var b=m[v];if(y=l.intersection(b.union(b.ancestors())),y!=null&&!T.has(y[0])){var w=y.union(y.descendants());w.forEach(function(O){d.push(O),T.add(O),x.merge(O),l.has(O)&&c.push(O)})}}};d.length!=0;)E();if(x.forEach(function(m){s.intersection(m.connectedEdges()).forEach(function(v){x.has(v.source())&&x.has(v.target())&&x.merge(v)})}),c.length==l.length&&(G=!0),!G||G&&k>1){A=c[0],I=A.connectedEdges().length,c.forEach(function(m){m.connectedEdges().length<I&&(I=m.connectedEdges().length,A=m)}),U.push(A.id());var p=t.collection();p.merge(c[0]),c.forEach(function(m){p.merge(m)}),c=[],l=l.difference(p),k++}};do Z();while(!G);return g&&U.length>0&&g.set("dummy"+(g.size+1),U),H},f.relocateComponent=function(t,s,l){if(!l.fixedNodeConstraint){var g=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;if(l.quality=="draft"){var y=!0,A=!1,I=void 0;try{for(var G=s.nodeIndexes[Symbol.iterator](),k;!(y=(k=G.next()).done);y=!0){var U=k.value,H=a(U,2),Z=H[0],x=H[1],nt=l.cy.getElementById(Z);if(nt){var r=nt.boundingBox(),E=s.xCoords[x]-r.w/2,p=s.xCoords[x]+r.w/2,m=s.yCoords[x]-r.h/2,v=s.yCoords[x]+r.h/2;E<g&&(g=E),p>d&&(d=p),m<T&&(T=m),v>c&&(c=v)}}}catch(Y){A=!0,I=Y}finally{try{!y&&G.return&&G.return()}finally{if(A)throw I}}var b=t.x-(d+g)/2,w=t.y-(c+T)/2;s.xCoords=s.xCoords.map(function(Y){return Y+b}),s.yCoords=s.yCoords.map(function(Y){return Y+w})}else{Object.keys(s).forEach(function(Y){var z=s[Y],W=z.getRect().x,B=z.getRect().x+z.getRect().width,$=z.getRect().y,P=z.getRect().y+z.getRect().height;W<g&&(g=W),B>d&&(d=B),$<T&&(T=$),P>c&&(c=P)});var O=t.x-(d+g)/2,F=t.y-(c+T)/2;Object.keys(s).forEach(function(Y){var z=s[Y];z.setCenter(z.getCenterX()+O,z.getCenterY()+F)})}}},f.calcBoundingBox=function(t,s,l,g){for(var d=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,y=Number.MIN_SAFE_INTEGER,A=void 0,I=void 0,G=void 0,k=void 0,U=t.descendants().not(":parent"),H=U.length,Z=0;Z<H;Z++){var x=U[Z];A=s[g.get(x.id())]-x.width()/2,I=s[g.get(x.id())]+x.width()/2,G=l[g.get(x.id())]-x.height()/2,k=l[g.get(x.id())]+x.height()/2,d>A&&(d=A),T<I&&(T=I),c>G&&(c=G),y<k&&(y=k)}var nt={};return nt.topLeftX=d,nt.topLeftY=c,nt.width=T-d,nt.height=y-c,nt},f.calcParentsWithoutChildren=function(t,s){var l=t.collection();return s.nodes(":parent").forEach(function(g){var d=!1;g.children().forEach(function(T){T.css("display")!="none"&&(d=!0)}),d||l.merge(g)}),l},n.exports=f}),816:((n,i,e)=>{var a=e(548),o=e(140).CoSELayout,f=e(140).CoSENode,t=e(140).layoutBase.PointD,s=e(140).layoutBase.DimensionD,l=e(140).layoutBase.LayoutConstants,g=e(140).layoutBase.FDLayoutConstants,d=e(140).CoSEConstants,T=function(c,y){var A=c.cy,I=c.eles,G=I.nodes(),k=I.edges(),U=void 0,H=void 0,Z=void 0,x={};c.randomize&&(U=y.nodeIndexes,H=y.xCoords,Z=y.yCoords);var nt=function(O){return typeof O=="function"},r=function(O,F){return nt(O)?O(F):O},E=a.calcParentsWithoutChildren(A,I),p=function O(F,Y,z,W){for(var B=Y.length,$=0;$<B;$++){var P=Y[$],M=null;P.intersection(E).length==0&&(M=P.children());var R=void 0,q=P.layoutDimensions({nodeDimensionsIncludeLabels:W.nodeDimensionsIncludeLabels});if(P.outerWidth()!=null&&P.outerHeight()!=null)if(W.randomize)if(!P.isParent())R=F.add(new f(z.graphManager,new t(H[U.get(P.id())]-q.w/2,Z[U.get(P.id())]-q.h/2),new s(parseFloat(q.w),parseFloat(q.h))));else{var et=a.calcBoundingBox(P,H,Z,U);P.intersection(E).length==0?R=F.add(new f(z.graphManager,new t(et.topLeftX,et.topLeftY),new s(et.width,et.height))):R=F.add(new f(z.graphManager,new t(et.topLeftX,et.topLeftY),new s(parseFloat(q.w),parseFloat(q.h))))}else R=F.add(new f(z.graphManager,new t(P.position("x")-q.w/2,P.position("y")-q.h/2),new s(parseFloat(q.w),parseFloat(q.h))));else R=F.add(new f(this.graphManager));if(R.id=P.data("id"),R.nodeRepulsion=r(W.nodeRepulsion,P),R.paddingLeft=parseInt(P.css("padding")),R.paddingTop=parseInt(P.css("padding")),R.paddingRight=parseInt(P.css("padding")),R.paddingBottom=parseInt(P.css("padding")),W.nodeDimensionsIncludeLabels&&(R.labelWidth=P.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,R.labelHeight=P.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,R.labelPosVertical=P.css("text-valign"),R.labelPosHorizontal=P.css("text-halign")),x[P.data("id")]=R,isNaN(R.rect.x)&&(R.rect.x=0),isNaN(R.rect.y)&&(R.rect.y=0),M!=null&&M.length>0){var mt=void 0;mt=z.getGraphManager().add(z.newGraph(),R),O(mt,M,z,W)}}},m=function(O,F,Y){for(var z=0,W=0,B=0;B<Y.length;B++){var $=Y[B],P=x[$.data("source")],M=x[$.data("target")];if(P&&M&&P!==M&&P.getEdgesBetween(M).length==0){var R=F.add(O.newEdge(),P,M);R.id=$.id(),R.idealLength=r(c.idealEdgeLength,$),R.edgeElasticity=r(c.edgeElasticity,$),z+=R.idealLength,W++}}c.idealEdgeLength!=null&&(W>0?d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=z/W:nt(c.idealEdgeLength)?d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50:d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=c.idealEdgeLength,d.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,d.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH)},v=function(O,F){F.fixedNodeConstraint&&(O.constraints.fixedNodeConstraint=F.fixedNodeConstraint),F.alignmentConstraint&&(O.constraints.alignmentConstraint=F.alignmentConstraint),F.relativePlacementConstraint&&(O.constraints.relativePlacementConstraint=F.relativePlacementConstraint)};c.nestingFactor!=null&&(d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.nestingFactor),c.gravity!=null&&(d.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=c.gravity),c.numIter!=null&&(d.MAX_ITERATIONS=g.MAX_ITERATIONS=c.numIter),c.gravityRange!=null&&(d.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=c.gravityRange),c.gravityCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.gravityCompound),c.gravityRangeCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.gravityRangeCompound),c.initialEnergyOnIncremental!=null&&(d.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.initialEnergyOnIncremental),c.tilingCompareBy!=null&&(d.TILING_COMPARE_BY=c.tilingCompareBy),c.quality=="proof"?l.QUALITY=2:l.QUALITY=0,d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=c.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!c.randomize,d.ANIMATE=g.ANIMATE=l.ANIMATE=c.animate,d.TILE=c.tile,d.TILING_PADDING_VERTICAL=typeof c.tilingPaddingVertical=="function"?c.tilingPaddingVertical.call():c.tilingPaddingVertical,d.TILING_PADDING_HORIZONTAL=typeof c.tilingPaddingHorizontal=="function"?c.tilingPaddingHorizontal.call():c.tilingPaddingHorizontal,d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!c.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=c.uniformNodeDimensions,c.step=="transformed"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!1),c.step=="enforced"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!1),c.step=="cose"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!0),c.step=="all"&&(c.randomize?d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0),c.fixedNodeConstraint||c.alignmentConstraint||c.relativePlacementConstraint?d.TREE_REDUCTION_ON_INCREMENTAL=!1:d.TREE_REDUCTION_ON_INCREMENTAL=!0;var b=new o,w=b.newGraphManager();return p(w.addRoot(),a.getTopMostNodes(G),b,c),m(b,w,k),v(b,c),b.runLayout(),x};n.exports={coseLayout:T}}),212:((n,i,e)=>{var a=(function(){function y(A,I){for(var G=0;G<I.length;G++){var k=I[G];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(A,k.key,k)}}return function(A,I,G){return I&&y(A.prototype,I),G&&y(A,G),A}})();function o(y,A){if(!(y instanceof A))throw new TypeError("Cannot call a class as a function")}var f=e(658),t=e(548),s=e(657),l=s.spectralLayout,g=e(816),d=g.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(y){return 4500},idealEdgeLength:function(y){return 50},edgeElasticity:function(y){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(){}}),c=(function(){function y(A){o(this,y),this.options=f({},T,A)}return a(y,[{key:"run",value:function(){var A=this,I=this.options,G=I.cy,k=I.eles,U=[],H=[],Z=void 0,x=[];I.fixedNodeConstraint&&(!Array.isArray(I.fixedNodeConstraint)||I.fixedNodeConstraint.length==0)&&(I.fixedNodeConstraint=void 0),I.alignmentConstraint&&(I.alignmentConstraint.vertical&&(!Array.isArray(I.alignmentConstraint.vertical)||I.alignmentConstraint.vertical.length==0)&&(I.alignmentConstraint.vertical=void 0),I.alignmentConstraint.horizontal&&(!Array.isArray(I.alignmentConstraint.horizontal)||I.alignmentConstraint.horizontal.length==0)&&(I.alignmentConstraint.horizontal=void 0)),I.relativePlacementConstraint&&(!Array.isArray(I.relativePlacementConstraint)||I.relativePlacementConstraint.length==0)&&(I.relativePlacementConstraint=void 0);var nt=I.fixedNodeConstraint||I.alignmentConstraint||I.relativePlacementConstraint;nt&&(I.tile=!1,I.packComponents=!1);var r=void 0,E=!1;if(G.layoutUtilities&&I.packComponents&&(r=G.layoutUtilities("get"),r||(r=G.layoutUtilities()),E=!0),k.nodes().length>0)if(E){var p=t.getTopMostNodes(I.eles.nodes());if(Z=t.connectComponents(G,I.eles,p),Z.forEach(function(Q){var rt=Q.boundingBox();x.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2})}),I.randomize&&Z.forEach(function(Q){I.eles=Q,U.push(l(I))}),I.quality=="default"||I.quality=="proof"){var m=G.collection();if(I.tile){var v=new Map,b=[],w=[],O=0,F={nodeIndexes:v,xCoords:b,yCoords:w},Y=[];if(Z.forEach(function(Q,rt){Q.edges().length==0&&(Q.nodes().forEach(function(vt,st){m.merge(Q.nodes()[st]),vt.isParent()||(F.nodeIndexes.set(Q.nodes()[st].id(),O++),F.xCoords.push(Q.nodes()[0].position().x),F.yCoords.push(Q.nodes()[0].position().y))}),Y.push(rt))}),m.length>1){var z=m.boundingBox();x.push({x:z.x1+z.w/2,y:z.y1+z.h/2}),Z.push(m),U.push(F);for(var W=Y.length-1;W>=0;W--)Z.splice(Y[W],1),U.splice(Y[W],1),x.splice(Y[W],1)}}Z.forEach(function(Q,rt){I.eles=Q,H.push(d(I,U[rt])),t.relocateComponent(x[rt],H[rt],I)})}else Z.forEach(function(Q,rt){t.relocateComponent(x[rt],U[rt],I)});var B=new Set;if(Z.length>1){var $=[],P=k.filter(function(Q){return Q.css("display")=="none"});Z.forEach(function(Q,rt){var vt=void 0;if(I.quality=="draft"&&(vt=U[rt].nodeIndexes),Q.nodes().not(P).length>0){var st={};st.edges=[],st.nodes=[];var Lt=void 0;Q.nodes().not(P).forEach(function(_t){if(I.quality=="draft")if(!_t.isParent())Lt=vt.get(_t.id()),st.nodes.push({x:U[rt].xCoords[Lt]-_t.boundingbox().w/2,y:U[rt].yCoords[Lt]-_t.boundingbox().h/2,width:_t.boundingbox().w,height:_t.boundingbox().h});else{var Tt=t.calcBoundingBox(_t,U[rt].xCoords,U[rt].yCoords,vt);st.nodes.push({x:Tt.topLeftX,y:Tt.topLeftY,width:Tt.width,height:Tt.height})}else H[rt][_t.id()]&&st.nodes.push({x:H[rt][_t.id()].getLeft(),y:H[rt][_t.id()].getTop(),width:H[rt][_t.id()].getWidth(),height:H[rt][_t.id()].getHeight()})}),Q.edges().forEach(function(_t){var Tt=_t.source(),At=_t.target();if(Tt.css("display")!="none"&&At.css("display")!="none")if(I.quality=="draft"){var Xt=vt.get(Tt.id()),Dt=vt.get(At.id()),Rt=[],Gt=[];if(Tt.isParent()){var Bt=t.calcBoundingBox(Tt,U[rt].xCoords,U[rt].yCoords,vt);Rt.push(Bt.topLeftX+Bt.width/2),Rt.push(Bt.topLeftY+Bt.height/2)}else Rt.push(U[rt].xCoords[Xt]),Rt.push(U[rt].yCoords[Xt]);if(At.isParent()){var Pt=t.calcBoundingBox(At,U[rt].xCoords,U[rt].yCoords,vt);Gt.push(Pt.topLeftX+Pt.width/2),Gt.push(Pt.topLeftY+Pt.height/2)}else Gt.push(U[rt].xCoords[Dt]),Gt.push(U[rt].yCoords[Dt]);st.edges.push({startX:Rt[0],startY:Rt[1],endX:Gt[0],endY:Gt[1]})}else H[rt][Tt.id()]&&H[rt][At.id()]&&st.edges.push({startX:H[rt][Tt.id()].getCenterX(),startY:H[rt][Tt.id()].getCenterY(),endX:H[rt][At.id()].getCenterX(),endY:H[rt][At.id()].getCenterY()})}),st.nodes.length>0&&($.push(st),B.add(rt))}});var M=r.packComponents($,I.randomize).shifts;if(I.quality=="draft")U.forEach(function(Q,rt){var vt=Q.xCoords.map(function(Lt){return Lt+M[rt].dx}),st=Q.yCoords.map(function(Lt){return Lt+M[rt].dy});Q.xCoords=vt,Q.yCoords=st});else{var R=0;B.forEach(function(Q){Object.keys(H[Q]).forEach(function(rt){var vt=H[Q][rt];vt.setCenter(vt.getCenterX()+M[R].dx,vt.getCenterY()+M[R].dy)}),R++})}}}else{var q=I.eles.boundingBox();if(x.push({x:q.x1+q.w/2,y:q.y1+q.h/2}),I.randomize){var et=l(I);U.push(et)}I.quality=="default"||I.quality=="proof"?(H.push(d(I,U[0])),t.relocateComponent(x[0],H[0],I)):t.relocateComponent(x[0],U[0],I)}var mt=function(Q,rt){if(I.quality=="default"||I.quality=="proof"){typeof Q=="number"&&(Q=rt);var vt=void 0,st=void 0,Lt=Q.data("id");return H.forEach(function(Tt){Lt in Tt&&(vt={x:Tt[Lt].getRect().getCenterX(),y:Tt[Lt].getRect().getCenterY()},st=Tt[Lt])}),I.nodeDimensionsIncludeLabels&&(st.labelWidth&&(st.labelPosHorizontal=="left"?vt.x+=st.labelWidth/2:st.labelPosHorizontal=="right"&&(vt.x-=st.labelWidth/2)),st.labelHeight&&(st.labelPosVertical=="top"?vt.y+=st.labelHeight/2:st.labelPosVertical=="bottom"&&(vt.y-=st.labelHeight/2))),vt==null&&(vt={x:Q.position("x"),y:Q.position("y")}),{x:vt.x,y:vt.y}}else{var _t=void 0;return U.forEach(function(Tt){var At=Tt.nodeIndexes.get(Q.id());At!=null&&(_t={x:Tt.xCoords[At],y:Tt.yCoords[At]})}),_t==null&&(_t={x:Q.position("x"),y:Q.position("y")}),{x:_t.x,y:_t.y}}};if(I.quality=="default"||I.quality=="proof"||I.randomize){var j=t.calcParentsWithoutChildren(G,k),Ot=k.filter(function(Q){return Q.css("display")=="none"});I.eles=k.not(Ot),k.nodes().not(":parent").not(Ot).layoutPositions(A,I,mt),j.length>0&&j.forEach(function(Q){Q.position(mt(Q))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),y})();n.exports=c}),657:((n,i,e)=>{var a=e(548),o=e(140).layoutBase.Matrix,f=e(140).layoutBase.SVD,t=function(s){var l=s.cy,g=s.eles,d=g.nodes(),T=g.nodes(":parent"),c=new Map,y=new Map,A=new Map,I=[],G=[],k=[],U=[],H=[],Z=[],x=[],nt=[],r=void 0,E=1e8,p=1e-9,m=s.piTol,v=s.samplingType,b=s.nodeSeparation,w=void 0,O=function(){for(var dt=0,_=0,D=!1;_<w;){dt=Math.floor(Math.random()*r),D=!1;for(var V=0;V<_;V++)if(U[V]==dt){D=!0;break}if(!D)U[_]=dt,_++;else continue}},F=function(dt,_,D){for(var V=[],J=0,K=0,ft=0,ht=void 0,tt=[],ct=0,it=1,Et=0;Et<r;Et++)tt[Et]=E;for(V[K]=dt,tt[dt]=0;K>=J;){ft=V[J++];for(var yt=I[ft],xt=0;xt<yt.length;xt++)ht=y.get(yt[xt]),tt[ht]==E&&(tt[ht]=tt[ft]+1,V[++K]=ht);Z[ft][_]=tt[ft]*b}if(D){for(var lt=0;lt<r;lt++)Z[lt][_]<H[lt]&&(H[lt]=Z[lt][_]);for(var ot=0;ot<r;ot++)H[ot]>ct&&(ct=H[ot],it=ot)}return it},Y=function(dt){var _=void 0;if(dt){_=Math.floor(Math.random()*r);for(var D=0;D<r;D++)H[D]=E;for(var V=0;V<w;V++)U[V]=_,_=F(_,V,dt)}else{O();for(var J=0;J<w;J++)F(U[J],J,dt)}for(var K=0;K<r;K++)for(var ft=0;ft<w;ft++)Z[K][ft]*=Z[K][ft];for(var ht=0;ht<w;ht++)x[ht]=[];for(var tt=0;tt<w;tt++)for(var ct=0;ct<w;ct++)x[tt][ct]=Z[U[ct]][tt]},z=function(){for(var dt=f.svd(x),_=dt.S,D=dt.U,V=dt.V,J=_[0]*_[0]*_[0],K=[],ft=0;ft<w;ft++){K[ft]=[];for(var ht=0;ht<w;ht++)K[ft][ht]=0,ft==ht&&(K[ft][ht]=_[ft]/(_[ft]*_[ft]+J/(_[ft]*_[ft])))}nt=o.multMat(o.multMat(V,K),o.transpose(D))},W=function(){for(var dt=void 0,_=void 0,D=[],V=[],J=[],K=[],ft=0;ft<r;ft++)D[ft]=Math.random(),V[ft]=Math.random();D=o.normalize(D),V=o.normalize(V);for(var ht=p,tt=p,ct=void 0;;){for(var it=0;it<r;it++)J[it]=D[it];if(D=o.multGamma(o.multL(o.multGamma(J),Z,nt)),dt=o.dotProduct(J,D),D=o.normalize(D),ht=o.dotProduct(J,D),ct=Math.abs(ht/tt),ct<=1+m&&ct>=1)break;tt=ht}for(var Et=0;Et<r;Et++)J[Et]=D[Et];for(tt=p;;){for(var yt=0;yt<r;yt++)K[yt]=V[yt];if(K=o.minusOp(K,o.multCons(J,o.dotProduct(J,K))),V=o.multGamma(o.multL(o.multGamma(K),Z,nt)),_=o.dotProduct(K,V),V=o.normalize(V),ht=o.dotProduct(K,V),ct=Math.abs(ht/tt),ct<=1+m&&ct>=1)break;tt=ht}for(var xt=0;xt<r;xt++)K[xt]=V[xt];G=o.multCons(J,Math.sqrt(Math.abs(dt))),k=o.multCons(K,Math.sqrt(Math.abs(_)))};a.connectComponents(l,g,a.getTopMostNodes(d),c),T.forEach(function(dt){a.connectComponents(l,g,a.getTopMostNodes(dt.descendants().intersection(g)),c)});for(var B=0,$=0;$<d.length;$++)d[$].isParent()||y.set(d[$].id(),B++);var P=!0,M=!1,R=void 0;try{for(var q=c.keys()[Symbol.iterator](),et;!(P=(et=q.next()).done);P=!0){var mt=et.value;y.set(mt,B++)}}catch(dt){M=!0,R=dt}finally{try{!P&&q.return&&q.return()}finally{if(M)throw R}}for(var j=0;j<y.size;j++)I[j]=[];T.forEach(function(dt){for(var _=dt.children().intersection(g);_.nodes(":childless").length==0;)_=_.nodes()[0].children().intersection(g);var D=0,V=_.nodes(":childless")[0].connectedEdges().length;_.nodes(":childless").forEach(function(J,K){J.connectedEdges().length<V&&(V=J.connectedEdges().length,D=K)}),A.set(dt.id(),_.nodes(":childless")[D].id())}),d.forEach(function(dt){var _=void 0;dt.isParent()?_=y.get(A.get(dt.id())):_=y.get(dt.id()),dt.neighborhood().nodes().forEach(function(D){g.intersection(dt.edgesWith(D)).length>0&&(D.isParent()?I[_].push(A.get(D.id())):I[_].push(D.id()))})});var Ot=function(dt){var _=y.get(dt),D=void 0;c.get(dt).forEach(function(V){l.getElementById(V).isParent()?D=A.get(V):D=V,I[_].push(D),I[y.get(D)].push(dt)})},Q=!0,rt=!1,vt=void 0;try{for(var st=c.keys()[Symbol.iterator](),Lt;!(Q=(Lt=st.next()).done);Q=!0){var _t=Lt.value;Ot(_t)}}catch(dt){rt=!0,vt=dt}finally{try{!Q&&st.return&&st.return()}finally{if(rt)throw vt}}r=y.size;var Tt=void 0;if(r>2){w=r<s.sampleSize?r:s.sampleSize;for(var At=0;At<r;At++)Z[At]=[];for(var Xt=0;Xt<w;Xt++)nt[Xt]=[];return s.quality=="draft"||s.step=="all"?(Y(v),z(),W(),Tt={nodeIndexes:y,xCoords:G,yCoords:k}):(y.forEach(function(dt,_){G.push(l.getElementById(_).position("x")),k.push(l.getElementById(_).position("y"))}),Tt={nodeIndexes:y,xCoords:G,yCoords:k}),Tt}else{var Dt=y.keys(),Rt=l.getElementById(Dt.next().value),Gt=Rt.position(),Bt=Rt.outerWidth();if(G.push(Gt.x),k.push(Gt.y),r==2){var Pt=l.getElementById(Dt.next().value),zt=Pt.outerWidth();G.push(Gt.x+Bt/2+zt/2+s.idealEdgeLength),k.push(Gt.y)}return Tt={nodeIndexes:y,xCoords:G,yCoords:k},Tt}};n.exports={spectralLayout:t}}),579:((n,i,e)=>{var a=e(212),o=function(f){f&&f("layout","fcose",a)};typeof cytoscape<"u"&&o(cytoscape),n.exports=o}),140:(n=>{n.exports=L})},N={};function u(n){var i=N[n];if(i!==void 0)return i.exports;var e=N[n]={exports:{}};return S[n](e,e.exports,u),e.exports}var h=u(579);return h})()})})(ge)),ge.exports}var vi=mi();const yi=hi(vi);var xe={L:"left",R:"right",T:"top",B:"bottom"},Oe={L:pt(C=>`${C},${C/2} 0,${C} 0,0`,"L"),R:pt(C=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:pt(C=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:pt(C=>`${C/2},0 ${C},${C} 0,${C}`,"B")},ne={L:pt((C,X)=>C-X+2,"L"),R:pt((C,X)=>C-2,"R"),T:pt((C,X)=>C-X+2,"T"),B:pt((C,X)=>C-2,"B")},Ei=pt(function(C){return Yt(C)?C==="L"?"R":"L":C==="T"?"B":"T"},"getOppositeArchitectureDirection"),Me=pt(function(C){const X=C;return X==="L"||X==="R"||X==="T"||X==="B"},"isArchitectureDirection"),Yt=pt(function(C){const X=C;return X==="L"||X==="R"},"isArchitectureDirectionX"),Vt=pt(function(C){const X=C;return X==="T"||X==="B"},"isArchitectureDirectionY"),ye=pt(function(C,X){const L=Yt(C)&&Vt(X),S=Vt(C)&&Yt(X);return L||S},"isArchitectureDirectionXY"),Ti=pt(function(C){const X=C[0],L=C[1],S=Yt(X)&&Vt(L),N=Vt(X)&&Yt(L);return S||N},"isArchitecturePairXY"),Ni=pt(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),pe=pt(function(C,X){const L=`${C}${X}`;return Ni(L)?L:void 0},"getArchitectureDirectionPair"),Ai=pt(function([C,X],L){const S=L[0],N=L[1];return Yt(S)?Vt(N)?[C+(S==="L"?-1:1),X+(N==="T"?1:-1)]:[C+(S==="L"?-1:1),X]:Yt(N)?[C+(N==="L"?1:-1),X+(S==="T"?1:-1)]:[C,X+(S==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ci=pt(function(C){return C==="LT"||C==="TL"?[1,1]:C==="BL"||C==="LB"?[1,-1]:C==="BR"||C==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ii=pt(function(C,X){return ye(C,X)?"bend":Yt(C)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Li=pt(function(C){return C.type==="service"},"isArchitectureService"),_i=pt(function(C){return C.type==="junction"},"isArchitectureJunction"),Re=pt(C=>C.data(),"edgeData"),te=pt(C=>C.data(),"nodeData"),wi=ii.architecture,de,Pe=(de=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=je,this.getAccTitle=qe,this.setDiagramTitle=$e,this.getDiagramTitle=Ke,this.getAccDescription=Ze,this.setAccDescription=Je,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},Qe()}addService({id:C,icon:X,in:L,title:S,iconText:N}){if(this.registeredIds[C]!==void 0)throw new Error(`The service id [${C}] is already in use by another ${this.registeredIds[C]}`);if(L!==void 0){if(C===L)throw new Error(`The service [${C}] cannot be placed within itself`);if(this.registeredIds[L]===void 0)throw new Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[L]==="node")throw new Error(`The service [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"service",icon:X,iconText:N,title:S,edges:[],in:L}}getServices(){return Object.values(this.nodes).filter(Li)}addJunction({id:C,in:X}){this.registeredIds[C]="node",this.nodes[C]={id:C,type:"junction",edges:[],in:X}}getJunctions(){return Object.values(this.nodes).filter(_i)}getNodes(){return Object.values(this.nodes)}getNode(C){return this.nodes[C]??null}addGroup({id:C,icon:X,in:L,title:S}){if(this.registeredIds?.[C]!==void 0)throw new Error(`The group id [${C}] is already in use by another ${this.registeredIds[C]}`);if(L!==void 0){if(C===L)throw new Error(`The group [${C}] cannot be placed within itself`);if(this.registeredIds?.[L]===void 0)throw new Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[L]==="node")throw new Error(`The group [${C}]'s parent is not a group`)}this.registeredIds[C]="group",this.groups[C]={id:C,icon:X,title:S,in:L}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:C,rhsId:X,lhsDir:L,rhsDir:S,lhsInto:N,rhsInto:u,lhsGroup:h,rhsGroup:n,title:i}){if(!Me(L))throw new Error(`Invalid direction given for left hand side of edge ${C}--${X}. Expected (L,R,T,B) got ${String(L)}`);if(!Me(S))throw new Error(`Invalid direction given for right hand side of edge ${C}--${X}. Expected (L,R,T,B) got ${String(S)}`);if(this.nodes[C]===void 0&&this.groups[C]===void 0)throw new Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[X]===void 0&&this.groups[X]===void 0)throw new Error(`The right-hand id [${X}] does not yet exist. Please create the service/group before declaring an edge to it.`);const e=this.nodes[C].in,a=this.nodes[X].in;if(h&&e&&a&&e==a)throw new Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(n&&e&&a&&e==a)throw new Error(`The right-hand id [${X}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const o={lhsId:C,lhsDir:L,lhsInto:N,lhsGroup:h,rhsId:X,rhsDir:S,rhsInto:u,rhsGroup:n,title:i};this.edges.push(o),this.nodes[C]&&this.nodes[X]&&(this.nodes[C].edges.push(this.edges[this.edges.length-1]),this.nodes[X].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const C={},X=Object.entries(this.nodes).reduce((n,[i,e])=>(n[i]=e.edges.reduce((a,o)=>{const f=this.getNode(o.lhsId)?.in,t=this.getNode(o.rhsId)?.in;if(f&&t&&f!==t){const s=Ii(o.lhsDir,o.rhsDir);s!=="bend"&&(C[f]??={},C[f][t]=s,C[t]??={},C[t][f]=s)}if(o.lhsId===i){const s=pe(o.lhsDir,o.rhsDir);s&&(a[s]=o.rhsId)}else{const s=pe(o.rhsDir,o.lhsDir);s&&(a[s]=o.lhsId)}return a},{}),n),{}),L=Object.keys(X)[0],S={[L]:1},N=Object.keys(X).reduce((n,i)=>i===L?n:{...n,[i]:1},{}),u=pt(n=>{const i={[n]:[0,0]},e=[n];for(;e.length>0;){const a=e.shift();if(a){S[a]=1,delete N[a];const o=X[a],[f,t]=i[a];Object.entries(o).forEach(([s,l])=>{S[l]||(i[l]=Ai([f,t],s),e.push(l))})}}return i},"BFS"),h=[u(L)];for(;Object.keys(N).length>0;)h.push(u(Object.keys(N)[0]));this.dataStructures={adjList:X,spatialMaps:h,groupAlignments:C}}return this.dataStructures}setElementForId(C,X){this.elements[C]=X}getElementById(C){return this.elements[C]}getConfig(){return ti({...wi,...ei().architecture})}getConfigField(C){return this.getConfig()[C]}},pt(de,"ArchitectureDB"),de),xi=pt((C,X)=>{li(C,X),C.groups.map(L=>X.addGroup(L)),C.services.map(L=>X.addService({...L,type:"service"})),C.junctions.map(L=>X.addJunction({...L,type:"junction"})),C.edges.map(L=>X.addEdge(L))},"populateDb"),Ge={parser:{yy:void 0},parse:pt(async C=>{const X=await di("architecture",C);be.debug(X);const L=Ge.parser?.yy;if(!(L instanceof Pe))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.");xi(X,L)},"parse")},Oi=pt(C=>`
2
+ .edge {
3
+ stroke-width: ${C.archEdgeWidth};
4
+ stroke: ${C.archEdgeColor};
5
+ fill: none;
6
+ }
7
+
8
+ .arrow {
9
+ fill: ${C.archEdgeArrowColor};
10
+ }
11
+
12
+ .node-bkg {
13
+ fill: none;
14
+ stroke: ${C.archGroupBorderColor};
15
+ stroke-width: ${C.archGroupBorderWidth};
16
+ stroke-dasharray: 8;
17
+ }
18
+ .node-icon-text {
19
+ display: flex;
20
+ align-items: center;
21
+ }
22
+
23
+ .node-icon-text > div {
24
+ color: #fff;
25
+ margin: 1px;
26
+ height: fit-content;
27
+ text-align: center;
28
+ overflow: hidden;
29
+ display: -webkit-box;
30
+ -webkit-box-orient: vertical;
31
+ }
32
+ `,"getStyles"),Mi=Oi,Qt=pt(C=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${C}</g>`,"wrapIcon"),ie={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Qt('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:Qt('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:Qt('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:Qt('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:Qt('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:si,blank:{body:Qt("")}}},bi=pt(async function(C,X,L){const S=L.getConfigField("padding"),N=L.getConfigField("iconSize"),u=N/2,h=N/6,n=h/2;await Promise.all(X.edges().map(async i=>{const{source:e,sourceDir:a,sourceArrow:o,sourceGroup:f,target:t,targetDir:s,targetArrow:l,targetGroup:g,label:d}=Re(i);let{x:T,y:c}=i[0].sourceEndpoint();const{x:y,y:A}=i[0].midpoint();let{x:I,y:G}=i[0].targetEndpoint();const k=S+4;if(f&&(Yt(a)?T+=a==="L"?-k:k:c+=a==="T"?-k:k+18),g&&(Yt(s)?I+=s==="L"?-k:k:G+=s==="T"?-k:k+18),!f&&L.getNode(e)?.type==="junction"&&(Yt(a)?T+=a==="L"?u:-u:c+=a==="T"?u:-u),!g&&L.getNode(t)?.type==="junction"&&(Yt(s)?I+=s==="L"?u:-u:G+=s==="T"?u:-u),i[0]._private.rscratch){const U=C.insert("g");if(U.insert("path").attr("d",`M ${T},${c} L ${y},${A} L${I},${G} `).attr("class","edge").attr("id",oi(e,t,{prefix:"L"})),o){const H=Yt(a)?ne[a](T,h):T-n,Z=Vt(a)?ne[a](c,h):c-n;U.insert("polygon").attr("points",Oe[a](h)).attr("transform",`translate(${H},${Z})`).attr("class","arrow")}if(l){const H=Yt(s)?ne[s](I,h):I-n,Z=Vt(s)?ne[s](G,h):G-n;U.insert("polygon").attr("points",Oe[s](h)).attr("transform",`translate(${H},${Z})`).attr("class","arrow")}if(d){const H=ye(a,s)?"XY":Yt(a)?"X":"Y";let Z=0;H==="X"?Z=Math.abs(T-I):H==="Y"?Z=Math.abs(c-G)/1.5:Z=Math.abs(T-I)/2;const x=U.append("g");if(await ve(x,d,{useHtmlLabels:!1,width:Z,classes:"architecture-service-label"},me()),x.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),H==="X")x.attr("transform","translate("+y+", "+A+")");else if(H==="Y")x.attr("transform","translate("+y+", "+A+") rotate(-90)");else if(H==="XY"){const nt=pe(a,s);if(nt&&Ti(nt)){const r=x.node().getBoundingClientRect(),[E,p]=Ci(nt);x.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*E*p*45})`);const m=x.node().getBoundingClientRect();x.attr("transform",`
33
+ translate(${y}, ${A-r.height/2})
34
+ translate(${E*m.width/2}, ${p*m.height/2})
35
+ rotate(${-1*E*p*45}, 0, ${r.height/2})
36
+ `)}}}}}))},"drawEdges"),Di=pt(async function(C,X,L){const S=L.getConfigField("padding")*.75,N=L.getConfigField("fontSize"),u=L.getConfigField("iconSize")/2;await Promise.all(X.nodes().map(async h=>{const n=te(h);if(n.type==="group"){const{h:i,w:e,x1:a,y1:o}=h.boundingBox(),f=C.append("rect");f.attr("id",`group-${n.id}`).attr("x",a+u).attr("y",o+u).attr("width",e).attr("height",i).attr("class","node-bkg");const t=C.append("g");let s=a,l=o;if(n.icon){const g=t.append("g");g.html(`<g>${await ce(n.icon,{height:S,width:S,fallbackPrefix:ie.prefix})}</g>`),g.attr("transform","translate("+(s+u+1)+", "+(l+u+1)+")"),s+=S,l+=N/2-1-2}if(n.label){const g=t.append("g");await ve(g,n.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},me()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(s+u+4)+", "+(l+u+2)+")")}L.setElementForId(n.id,f)}}))},"drawGroups"),Ri=pt(async function(C,X,L){const S=me();for(const N of L){const u=X.append("g"),h=C.getConfigField("iconSize");if(N.title){const a=u.append("g");await ve(a,N.title,{useHtmlLabels:!1,width:h*1.5,classes:"architecture-service-label"},S),a.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),a.attr("transform","translate("+h/2+", "+h+")")}const n=u.append("g");if(N.icon)n.html(`<g>${await ce(N.icon,{height:h,width:h,fallbackPrefix:ie.prefix})}</g>`);else if(N.iconText){n.html(`<g>${await ce("blank",{height:h,width:h,fallbackPrefix:ie.prefix})}</g>`);const a=n.append("g").append("foreignObject").attr("width",h).attr("height",h).append("div").attr("class","node-icon-text").attr("style",`height: ${h}px;`).append("div").html(ri(N.iconText,S)),o=parseInt(window.getComputedStyle(a.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;a.attr("style",`-webkit-line-clamp: ${Math.floor((h-2)/o)};`)}else n.append("path").attr("class","node-bkg").attr("id","node-"+N.id).attr("d",`M0 ${h} v${-h} q0,-5 5,-5 h${h} q5,0 5,5 v${h} H0 Z`);u.attr("id",`service-${N.id}`).attr("class","architecture-service");const{width:i,height:e}=u.node().getBBox();N.width=i,N.height=e,C.setElementForId(N.id,u)}return 0},"drawServices"),Pi=pt(function(C,X,L){L.forEach(S=>{const N=X.append("g"),u=C.getConfigField("iconSize");N.append("g").append("rect").attr("id","node-"+S.id).attr("fill-opacity","0").attr("width",u).attr("height",u),N.attr("class","architecture-junction");const{width:h,height:n}=N._groups[0][0].getBBox();N.width=h,N.height=n,C.setElementForId(S.id,N)})},"drawJunctions");ai([{name:ie.prefix,icons:ie}]);De.use(yi);function Fe(C,X,L){C.forEach(S=>{X.add({group:"nodes",data:{type:"service",id:S.id,icon:S.icon,label:S.title,parent:S.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-service"})})}pt(Fe,"addServices");function Se(C,X,L){C.forEach(S=>{X.add({group:"nodes",data:{type:"junction",id:S.id,parent:S.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-junction"})})}pt(Se,"addJunctions");function ke(C,X){X.nodes().map(L=>{const S=te(L);S.type!=="group"&&(S.x=L.position().x,S.y=L.position().y,C.getElementById(S.id).attr("transform","translate("+(S.x||0)+","+(S.y||0)+")"))})}pt(ke,"positionNodes");function Ye(C,X){C.forEach(L=>{X.add({group:"nodes",data:{type:"group",id:L.id,icon:L.icon,label:L.title,parent:L.in},classes:"node-group"})})}pt(Ye,"addGroups");function Ue(C,X){C.forEach(L=>{const{lhsId:S,rhsId:N,lhsInto:u,lhsGroup:h,rhsInto:n,lhsDir:i,rhsDir:e,rhsGroup:a,title:o}=L,f=ye(L.lhsDir,L.rhsDir)?"segments":"straight",t={id:`${S}-${N}`,label:o,source:S,sourceDir:i,sourceArrow:u,sourceGroup:h,sourceEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%",target:N,targetDir:e,targetArrow:n,targetGroup:a,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};X.add({group:"edges",data:t,classes:f})})}pt(Ue,"addEdges");function He(C,X,L){const S=pt((n,i)=>Object.entries(n).reduce((e,[a,o])=>{let f=0;const t=Object.entries(o);if(t.length===1)return e[a]=t[0][1],e;for(let s=0;s<t.length-1;s++)for(let l=s+1;l<t.length;l++){const[g,d]=t[s],[T,c]=t[l];if(L[g]?.[T]===i)e[a]??=[],e[a]=[...e[a],...d,...c];else if(g==="default"||T==="default")e[a]??=[],e[a]=[...e[a],...d,...c];else{const y=`${a}-${f++}`;e[y]=d;const A=`${a}-${f++}`;e[A]=c}}return e},{}),"flattenAlignments"),N=X.map(n=>{const i={},e={};return Object.entries(n).forEach(([a,[o,f]])=>{const t=C.getNode(a)?.in??"default";i[f]??={},i[f][t]??=[],i[f][t].push(a),e[o]??={},e[o][t]??=[],e[o][t].push(a)}),{horiz:Object.values(S(i,"horizontal")).filter(a=>a.length>1),vert:Object.values(S(e,"vertical")).filter(a=>a.length>1)}}),[u,h]=N.reduce(([n,i],{horiz:e,vert:a})=>[[...n,...e],[...i,...a]],[[],[]]);return{horizontal:u,vertical:h}}pt(He,"getAlignments");function Xe(C,X){const L=[],S=pt(u=>`${u[0]},${u[1]}`,"posToStr"),N=pt(u=>u.split(",").map(h=>parseInt(h)),"strToPos");return C.forEach(u=>{const h=Object.fromEntries(Object.entries(u).map(([a,o])=>[S(o),a])),n=[S([0,0])],i={},e={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;n.length>0;){const a=n.shift();if(a){i[a]=1;const o=h[a];if(o){const f=N(a);Object.entries(e).forEach(([t,s])=>{const l=S([f[0]+s[0],f[1]+s[1]]),g=h[l];g&&!i[l]&&(n.push(l),L.push({[xe[t]]:g,[xe[Ei(t)]]:o,gap:1.5*X.getConfigField("iconSize")}))})}}}}),L}pt(Xe,"getRelativeConstraints");function Be(C,X,L,S,N,{spatialMaps:u,groupAlignments:h}){return new Promise(n=>{const i=ni("body").append("div").attr("id","cy").attr("style","display:none"),e=De({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${N.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${N.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});i.remove(),Ye(L,e),Fe(C,e,N),Se(X,e,N),Ue(S,e);const a=He(N,u,h),o=Xe(u,N),f=e.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[s,l]=t.connectedNodes(),{parent:g}=te(s),{parent:d}=te(l);return g===d?1.5*N.getConfigField("iconSize"):.5*N.getConfigField("iconSize")},edgeElasticity(t){const[s,l]=t.connectedNodes(),{parent:g}=te(s),{parent:d}=te(l);return g===d?.45:.001},alignmentConstraint:a,relativePlacementConstraint:o});f.one("layoutstop",()=>{function t(s,l,g,d){let T,c;const{x:y,y:A}=s,{x:I,y:G}=l;c=(d-A+(y-g)*(A-G)/(y-I))/Math.sqrt(1+Math.pow((A-G)/(y-I),2)),T=Math.sqrt(Math.pow(d-A,2)+Math.pow(g-y,2)-Math.pow(c,2));const k=Math.sqrt(Math.pow(I-y,2)+Math.pow(G-A,2));T=T/k;let U=(I-y)*(d-A)-(G-A)*(g-y);switch(!0){case U>=0:U=1;break;case U<0:U=-1;break}let H=(I-y)*(g-y)+(G-A)*(d-A);switch(!0){case H>=0:H=1;break;case H<0:H=-1;break}return c=Math.abs(c)*U,T=T*H,{distances:c,weights:T}}pt(t,"getSegmentWeights"),e.startBatch();for(const s of Object.values(e.edges()))if(s.data?.()){const{x:l,y:g}=s.source().position(),{x:d,y:T}=s.target().position();if(l!==d&&g!==T){const c=s.sourceEndpoint(),y=s.targetEndpoint(),{sourceDir:A}=Re(s),[I,G]=Vt(A)?[c.x,y.y]:[y.x,c.y],{weights:k,distances:U}=t(c,y,I,G);s.style("segment-distances",U),s.style("segment-weights",k)}}e.endBatch(),f.run()}),f.run(),e.ready(t=>{be.info("Ready",t),n(e)})})}pt(Be,"layoutArchitecture");var Gi=pt(async(C,X,L,S)=>{const N=S.db,u=N.getServices(),h=N.getJunctions(),n=N.getGroups(),i=N.getEdges(),e=N.getDataStructures(),a=ze(X),o=a.append("g");o.attr("class","architecture-edges");const f=a.append("g");f.attr("class","architecture-services");const t=a.append("g");t.attr("class","architecture-groups"),await Ri(N,f,u),Pi(N,f,h);const s=await Be(u,h,n,i,N,e);await bi(o,s,N),await Di(t,s,N),ke(N,s),Ve(void 0,a,N.getConfigField("padding"),N.getConfigField("useMaxWidth"))},"draw"),Fi={draw:Gi},Bi={parser:Ge,get db(){return new Pe},renderer:Fi,styles:Mi};export{Bi as diagram};