@staticbolt/docs 0.0.1-beta.3 → 0.0.1-beta.5

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 (117) hide show
  1. package/README.md +16 -19
  2. package/lib/index.d.mts +62 -35
  3. package/lib/mermaid/abnfDiagram-PAR5IXJI-Ibbj5eGO.js +1 -0
  4. package/lib/mermaid/architecture-7GRP2DOG-M7G3SWCO-BJAoKIRD.js +1 -0
  5. package/lib/mermaid/architectureDiagram-2PNWDENW-CI3fLWIN.js +36 -0
  6. package/lib/mermaid/blockDiagram-PUWGUBOA-DAfWpjz7.js +129 -0
  7. package/lib/mermaid/c4Diagram-3NLNHZP5-at-f4FDi.js +38 -0
  8. package/lib/mermaid/chunk-2NMSUPJH-DuxvnX1p.js +1 -0
  9. package/lib/mermaid/chunk-32MCUW2P-D8U-Oy6M.js +206 -0
  10. package/lib/mermaid/chunk-3NPNU5GP-8WYybYAh.js +1 -0
  11. package/lib/mermaid/chunk-3SMGFRGC-C0WC5bhP.js +1 -0
  12. package/lib/mermaid/chunk-4CAJECRU-C_QnaDal.js +15 -0
  13. package/lib/mermaid/chunk-4OADUZ5Q-DHE3k_pb.js +10 -0
  14. package/lib/mermaid/chunk-5IMINLNL-Cl3N81sR.js +1 -0
  15. package/lib/mermaid/chunk-5IQCK5RY-Df5Ppxew.js +3 -0
  16. package/lib/mermaid/chunk-5MVFYWFU-DgXg5u6h.js +1 -0
  17. package/lib/mermaid/chunk-AQ6EADP3-CZhslHi-.js +1 -0
  18. package/lib/mermaid/chunk-AZZRMDJM-y-xJBuMz.js +15 -0
  19. package/lib/mermaid/chunk-CLS4B6BI-BRLlisnG.js +168 -0
  20. package/lib/mermaid/chunk-DZP67EKU-9RpG5Rdc.js +70 -0
  21. package/lib/mermaid/chunk-EICP7K5X-8YS1Gtlr.js +1 -0
  22. package/lib/mermaid/chunk-GDY2UAB4-QtXfmDIW.js +1 -0
  23. package/lib/mermaid/chunk-H7VHZCWX-CwFRFlEn.js +1 -0
  24. package/lib/mermaid/chunk-IJBDOHL6-CgcssvZb.js +1 -0
  25. package/lib/mermaid/chunk-JFFVMJIA-Cx1_ZSMR.js +1 -0
  26. package/lib/mermaid/chunk-JQRUD6KW-Dbva2Z17.js +1 -0
  27. package/lib/mermaid/chunk-JZGDI5JK-BspJQ1vQ.js +1 -0
  28. package/lib/mermaid/chunk-KD6SPIPN-4bKl37hM.js +2 -0
  29. package/lib/mermaid/chunk-NF366YI6-D1lnbapv.js +231 -0
  30. package/lib/mermaid/chunk-NUDPKBEF-CL0e9XiQ.js +34 -0
  31. package/lib/mermaid/chunk-OJINMHTS-rKnCIFV0.js +1 -0
  32. package/lib/mermaid/chunk-Q6NGPIAH-CM9NYxWM.js +2 -0
  33. package/lib/mermaid/chunk-QJSWEUOL-kvKBktmc.js +133 -0
  34. package/lib/mermaid/chunk-R7JDMUKV-CSyCOfYj.js +1 -0
  35. package/lib/mermaid/chunk-RCXAM2GK-BeKcutEV.js +1 -0
  36. package/lib/mermaid/chunk-RT4MAWR3-Cv_8LyN5.js +1 -0
  37. package/lib/mermaid/chunk-SFMINX4W-BW2NSwFJ.js +1 -0
  38. package/lib/mermaid/chunk-SLDQ463B-D15xTdNW.js +88 -0
  39. package/lib/mermaid/chunk-STOV2HOB-GnExfzIX.js +1 -0
  40. package/lib/mermaid/chunk-T5OCTHI4-DdZvN-9i.js +1 -0
  41. package/lib/mermaid/chunk-TCEHX7R3-BXjgPiQF.js +1 -0
  42. package/lib/mermaid/chunk-VQC2EELJ-sGo2yn97.js +1 -0
  43. package/lib/mermaid/chunk-VRZKL3EH-BzaZ6KlD.js +1 -0
  44. package/lib/mermaid/chunk-VTHDQ7BV-BqUEu5Ml.js +1 -0
  45. package/lib/mermaid/chunk-VY2OSTJR-BYk2nUI_.js +2 -0
  46. package/lib/mermaid/chunk-WUBWJARI-Z8MI6quX.js +1 -0
  47. package/lib/mermaid/chunk-YBMQ5JGJ-DlZ1nCKo.js +2 -0
  48. package/lib/mermaid/chunk-YDMLL4PJ-BHgx6nXf.js +1 -0
  49. package/lib/mermaid/chunk-Z6V44ARX-CWGOZvke.js +62 -0
  50. package/lib/mermaid/chunk-ZJJ7VQJP-CZ7qJzqZ.js +340 -0
  51. package/lib/mermaid/chunk-ZNLK7HRR-B-wIfXTw.js +1 -0
  52. package/lib/mermaid/chunk-ZQN7UHIL-CNp35E78.js +1 -0
  53. package/lib/mermaid/chunk-ZS6VBONO-D-IFTJgn.js +175 -0
  54. package/lib/mermaid/chunk-ZUNWM646-DRKPDcQl.js +1 -0
  55. package/lib/mermaid/classDiagram-FGAMPOII-D1sf64vv.js +1 -0
  56. package/lib/mermaid/classDiagram-v2-AI5RJEK4-D1sf64vv.js +1 -0
  57. package/lib/mermaid/cose-bilkent-Q72C2OJ3-iX90typn.js +1 -0
  58. package/lib/mermaid/cynefin-OW5HDTMX-6OCTWOGG-6jDAiaRu.js +1 -0
  59. package/lib/mermaid/cynefinDiagram-2OOWUY4M-5ACKe62t.js +62 -0
  60. package/lib/mermaid/dagre-MPVFI544-BUrJjGwd.js +4 -0
  61. package/lib/mermaid/diagram-AE4NWXFW-B3Lkw8MS.js +24 -0
  62. package/lib/mermaid/diagram-BUJID5UG-p2ajLLgr.js +41 -0
  63. package/lib/mermaid/diagram-C44CZ5NI-CO0U1GX-.js +24 -0
  64. package/lib/mermaid/diagram-EYOLEXXS-DDoUndBV.js +30 -0
  65. package/lib/mermaid/diagram-P7B6PWOJ-C_dSNQyG.js +3 -0
  66. package/lib/mermaid/ebnfDiagram-FTPZ3PV6-DIwB5te0.js +1 -0
  67. package/lib/mermaid/erDiagram-H3ERR26V-CN4pCzIq.js +99 -0
  68. package/lib/mermaid/eventmodeling-NTZA5JFV-WKSWQHFS-Ruta89_N.js +1 -0
  69. package/lib/mermaid/flowDiagram-YHGXBVSY-CrSHzFwR.js +1 -0
  70. package/lib/mermaid/ganttDiagram-RWFTB7ED-C-rfEOn5.js +292 -0
  71. package/lib/mermaid/gitGraph-4MIJSDKK-JH2HKYUO-B76vihW5.js +1 -0
  72. package/lib/mermaid/gitGraphDiagram-MAR6GKOP-peAd7EYO.js +106 -0
  73. package/lib/mermaid/index.js +15 -0
  74. package/lib/mermaid/info-A6RAGUB7-3TX3OFWW-DykwOJ0Z.js +1 -0
  75. package/lib/mermaid/infoDiagram-LV547AFH-C46dOKDG.js +2 -0
  76. package/lib/mermaid/ishikawaDiagram-PUJQGNDS-DUmHXvO9.js +70 -0
  77. package/lib/mermaid/journeyDiagram-EW5QJT4W-CNAhUHsQ.js +139 -0
  78. package/lib/mermaid/kanban-definition-JSQERAZB-uOEoksHt.js +89 -0
  79. package/lib/mermaid/katex-CZ4GXH2S-CaEE-8Xf.js +257 -0
  80. package/lib/mermaid/mindmap-definition-VBJCLQLM-DZceCWFq.js +96 -0
  81. package/lib/mermaid/packet-AYTQ26CC-MKII6P3Y-XqJQX7OO.js +1 -0
  82. package/lib/mermaid/pegDiagram-7WILOQTJ-DMKA8PUf.js +1 -0
  83. package/lib/mermaid/pie-WAS4IAKB-6B4OPMJ5-DpoRuAye.js +1 -0
  84. package/lib/mermaid/pieDiagram-EFA7CBSB-BzO4xw8C.js +39 -0
  85. package/lib/mermaid/quadrantDiagram-WARVYA7P-DMQd2xKZ.js +7 -0
  86. package/lib/mermaid/radar-RG4KPBEZ-UPTR3XUL-BcwE6tO1.js +1 -0
  87. package/lib/mermaid/railroad-74A4TZTK-MEFUPFMS-B2Kwx3Uk.js +1 -0
  88. package/lib/mermaid/railroad-abnf-HS5TGJTU-R5YG2S5D-uBY3fYzG.js +1 -0
  89. package/lib/mermaid/railroad-ebnf-LZEXJU2U-G5QEX2L6-AhpzdU_3.js +1 -0
  90. package/lib/mermaid/railroad-peg-WCYAUIDC-H5I2ZRY2-CrsmP7-8.js +1 -0
  91. package/lib/mermaid/railroadDiagram-5NIQVNLQ-BGyZ628g.js +1 -0
  92. package/lib/mermaid/requirementDiagram-SXREGOKZ-CtCO7u9U.js +84 -0
  93. package/lib/mermaid/sankeyDiagram-VV74M2VP-CPXqmSKK.js +40 -0
  94. package/lib/mermaid/sequenceDiagram-52ZFIFDL-B1rSqWZp.js +162 -0
  95. package/lib/mermaid/sizeCapture-FGA5AGYP-BEqQzsxs.js +1 -0
  96. package/lib/mermaid/stateDiagram-3QAKPIVI-3KzWPUq3.js +1 -0
  97. package/lib/mermaid/stateDiagram-v2-HN2P4RDZ-dXASbYMy.js +1 -0
  98. package/lib/mermaid/swimlanes-QLVP42QD-CLpR90IY.js +1 -0
  99. package/lib/mermaid/swimlanesDiagram-JKPDBFCN-C2sgVGQE.js +8 -0
  100. package/lib/mermaid/timeline-definition-GS45XAXW-DLn0_RV5.js +120 -0
  101. package/lib/mermaid/treeView-Q6P3EWNA-ZRJGANNQ-u1bD1sZ1.js +1 -0
  102. package/lib/mermaid/treemap-WGGIJYW6-K64VN5AS-DrIaTBlj.js +1 -0
  103. package/lib/mermaid/vennDiagram-QIQU2ZRJ-FxbUp7-Z.js +34 -0
  104. package/lib/mermaid/wardley-WFR3VGLG-D67OWCCH-Br9hyuFK.js +1 -0
  105. package/lib/mermaid/wardleyDiagram-U6YNM66N-l-Kvr0Az.js +78 -0
  106. package/lib/mermaid/xychartDiagram-XJAZEDNM-O9bztWNh.js +7 -0
  107. package/lib/plugins.mjs +213 -162
  108. package/package.json +3 -10
  109. package/sources/parts/document/document.part.html +7 -7
  110. package/sources/parts/header/header.part.html +2 -2
  111. package/sources/parts/header/header.style.css +4 -2
  112. package/sources/parts/mermaid/mermaid.part.html +1 -1
  113. package/sources/parts/pagefind/pagefind.part.html +5 -3
  114. package/sources/parts/sidebar/sidebar.part.html +1 -1
  115. package/sources/parts/sidebar/sidebar.style.css +10 -0
  116. package/sources/parts/table-of-content/table-of-content-desktop.part.html +2 -2
  117. package/sources/scripts/mermaid.ts +3 -1
@@ -0,0 +1,36 @@
1
+ import{i as e,n as t,t as n}from"./chunk-AQ6EADP3-CZhslHi-.js";import{V as r,q as i}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{B as a,F as o,Q as s,V as c,X as l,Y as u,c as d,h as f,l as p,q as m,v as h,y as g}from"./chunk-QJSWEUOL-kvKBktmc.js";import{t as _}from"./chunk-IJBDOHL6-CgcssvZb.js";import{i as v,r as y,t as b}from"./chunk-2NMSUPJH-DuxvnX1p.js";import"./chunk-STOV2HOB-GnExfzIX.js";import{a as x,n as S}from"./chunk-VY2OSTJR-BYk2nUI_.js";import{n as C}from"./chunk-DZP67EKU-9RpG5Rdc.js";import{t as w}from"./chunk-JQRUD6KW-Dbva2Z17.js";import"./chunk-ZS6VBONO-D-IFTJgn.js";import{t as T}from"./chunk-5IQCK5RY-Df5Ppxew.js";import"./chunk-JZGDI5JK-BspJQ1vQ.js";import"./chunk-OJINMHTS-rKnCIFV0.js";import"./chunk-VQC2EELJ-sGo2yn97.js";import"./chunk-KD6SPIPN-4bKl37hM.js";import"./chunk-Q6NGPIAH-CM9NYxWM.js";import"./chunk-RT4MAWR3-Cv_8LyN5.js";import"./chunk-YBMQ5JGJ-DlZ1nCKo.js";import"./chunk-GDY2UAB4-QtXfmDIW.js";import"./chunk-3SMGFRGC-C0WC5bhP.js";import"./chunk-3NPNU5GP-8WYybYAh.js";import"./chunk-TCEHX7R3-BXjgPiQF.js";import"./chunk-5MVFYWFU-DgXg5u6h.js";import"./chunk-SFMINX4W-BW2NSwFJ.js";import"./chunk-JFFVMJIA-Cx1_ZSMR.js";import"./chunk-ZUNWM646-DRKPDcQl.js";import{t as E}from"./chunk-ZJJ7VQJP-CZ7qJzqZ.js";var D=t((e,t)=>{n((function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.layoutBase=r():n.layoutBase=r()}),`webpackUniversalModuleDefinition`)(e,function(){return(function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return n(r,`__webpack_require__`),r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?n(function(){return e.default},`getDefault`):n(function(){return e},`getModuleExports`);return r.d(t,`a`,t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=``,r(r.s=28)})([(function(e,t,r){function i(){}n(i,`LayoutConstants`),i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,e.exports=i}),(function(e,t,r){var i=r(2),a=r(8),o=r(9);function s(e,t,n){i.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var c in n(s,`LEdge`),s.prototype=Object.create(i.prototype),i)s[c]=i[c];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw`Node is not incident with this edge`},s.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},s.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=a.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.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=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=s}),(function(e,t,r){function i(e){this.vGraphObject=e}n(i,`LGraphObject`),e.exports=i}),(function(e,t,r){var i=r(2),a=r(10),o=r(13),s=r(0),c=r(16),l=r(5);function u(e,t,n,r){n==null&&r==null&&(r=t),i.call(this,r),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=a.MIN_VALUE,this.inclusionTreeDepth=a.MAX_VALUE,this.vGraphObject=r,this.edges=[],this.graphManager=e,this.rect=n!=null&&t!=null?new o(t.x,t.y,n.width,n.height):new o}for(var d in n(u,`LNode`),u.prototype=Object.create(i.prototype),i)u[d]=i[d];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw`Incorrect edge source!`;t.push(r)}}),t},u.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw`Incorrect edge source and/or target`;(r.target==e||r.source==e)&&t.push(r)}),t},u.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw`Incorrect incidency!`;e.add(n.source)}}),e},u.prototype.withChildren=function(){var e=new Set,t,n;if(e.add(this),this.child!=null)for(var r=this.child.getNodes(),i=0;i<r.length;i++)t=r[i],n=t.withChildren(),n.forEach(function(t){e.add(t)});return e},u.prototype.getNoOfChildren=function(){var e=0,t;if(this.child==null)e=1;else for(var n=this.child.getNodes(),r=0;r<n.length;r++)t=n[r],e+=t.getNoOfChildren();return e==0&&(e=1),e},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==a.MIN_VALUE)throw`assert failed`;return this.estimatedSize},u.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)},u.prototype.scatter=function(){var e,t,n=-s.INITIAL_WORLD_BOUNDARY,r=s.INITIAL_WORLD_BOUNDARY;e=s.WORLD_CENTER_X+c.nextDouble()*(r-n)+n;var i=-s.INITIAL_WORLD_BOUNDARY,a=s.INITIAL_WORLD_BOUNDARY;t=s.WORLD_CENTER_Y+c.nextDouble()*(a-i)+i,this.rect.x=e,this.rect.y=t},u.prototype.updateBounds=function(){if(this.getChild()==null)throw`assert failed`;if(this.getChild().getNodes().length!=0){var e=this.getChild();if(e.updateBounds(!0),this.rect.x=e.getLeft(),this.rect.y=e.getTop(),this.setWidth(e.getRight()-e.getLeft()),this.setHeight(e.getBottom()-e.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var t=e.getRight()-e.getLeft(),n=e.getBottom()-e.getTop();this.labelWidth&&(this.labelPosHorizontal==`left`?(this.rect.x-=this.labelWidth,this.setWidth(t+this.labelWidth)):this.labelPosHorizontal==`center`&&this.labelWidth>t?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal==`right`&&this.setWidth(t+this.labelWidth)),this.labelHeight&&(this.labelPosVertical==`top`?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):this.labelPosVertical==`center`&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):this.labelPosVertical==`bottom`&&this.setHeight(n+this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==a.MAX_VALUE)throw`assert failed`;return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>s.WORLD_BOUNDARY?t=s.WORLD_BOUNDARY:t<-s.WORLD_BOUNDARY&&(t=-s.WORLD_BOUNDARY);var n=this.rect.y;n>s.WORLD_BOUNDARY?n=s.WORLD_BOUNDARY:n<-s.WORLD_BOUNDARY&&(n=-s.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=u}),(function(e,t,r){var i=r(0);function a(){}for(var o in n(a,`FDLayoutConstants`),i)a[o]=i[o];a.MAX_ITERATIONS=2500,a.DEFAULT_EDGE_LENGTH=50,a.DEFAULT_SPRING_STRENGTH=.45,a.DEFAULT_REPULSION_STRENGTH=4500,a.DEFAULT_GRAVITY_STRENGTH=.4,a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,a.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,a.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,a.COOLING_ADAPTATION_FACTOR=.33,a.ADAPTATION_LOWER_NODE_LIMIT=1e3,a.ADAPTATION_UPPER_NODE_LIMIT=5e3,a.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,a.MAX_NODE_DISPLACEMENT=a.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,a.MIN_REPULSION_DIST=a.DEFAULT_EDGE_LENGTH/10,a.CONVERGENCE_CHECK_PERIOD=100,a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,a.MIN_EDGE_LENGTH=1,a.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=a}),(function(e,t,r){function i(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}n(i,`PointD`),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(e){this.x=e},i.prototype.setY=function(e){this.y=e},i.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=i}),(function(e,t,r){var i=r(2),a=r(10),o=r(0),s=r(7),c=r(3),l=r(1),u=r(13),d=r(12),f=r(11);function p(e,t,n){i.call(this,n),this.estimatedSize=a.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,t!=null&&t instanceof s?this.graphManager=t:t!=null&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var m in n(p,`LGraph`),p.prototype=Object.create(i.prototype),i)p[m]=i[m];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.prototype.add=function(e,t,n){if(t==null&&n==null){var r=e;if(this.graphManager==null)throw`Graph has no graph mgr!`;if(this.getNodes().indexOf(r)>-1)throw`Node already in graph!`;return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw`Source or target not in graph!`;if(t.owner!=n.owner||t.owner!=this)throw`Both owners must be this graph!`;return t.owner==n.owner?(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i):null},p.prototype.remove=function(e){var t=e;if(e instanceof c){if(t==null)throw`Node is null!`;if(t.owner==null||t.owner!=this)throw`Owner graph is invalid!`;if(this.graphManager==null)throw`Owner graph manager is invalid!`;for(var n=t.edges.slice(),r,i=n.length,a=0;a<i;a++)r=n[a],r.isInterGraph?this.graphManager.remove(r):r.source.owner.remove(r);var o=this.nodes.indexOf(t);if(o==-1)throw`Node not in owner node list!`;this.nodes.splice(o,1)}else if(e instanceof l){var r=e;if(r==null)throw`Edge is null!`;if(r.source==null||r.target==null)throw`Source and/or target is null!`;if(r.source.owner==null||r.target.owner==null||r.source.owner!=this||r.target.owner!=this)throw`Source and/or target owner is invalid!`;var s=r.source.edges.indexOf(r),u=r.target.edges.indexOf(r);if(!(s>-1&&u>-1))throw`Source and/or target doesn't know this edge!`;r.source.edges.splice(s,1),r.target!=r.source&&r.target.edges.splice(u,1);var o=r.source.owner.getEdges().indexOf(r);if(o==-1)throw`Not in owner's edge list!`;r.source.owner.getEdges().splice(o,1)}},p.prototype.updateLeftTop=function(){for(var e=a.MAX_VALUE,t=a.MAX_VALUE,n,r,i,o=this.getNodes(),s=o.length,c=0;c<s;c++){var l=o[c];n=l.getTop(),r=l.getLeft(),e>n&&(e=n),t>r&&(t=r)}return e==a.MAX_VALUE?null:(i=o[0].getParent().paddingLeft==null?this.margin:o[0].getParent().paddingLeft,this.left=t-i,this.top=e-i,new d(this.left,this.top))},p.prototype.updateBounds=function(e){for(var t=a.MAX_VALUE,n=-a.MAX_VALUE,r=a.MAX_VALUE,i=-a.MAX_VALUE,o,s,c,l,d,f=this.nodes,p=f.length,m=0;m<p;m++){var h=f[m];e&&h.child!=null&&h.updateBounds(),o=h.getLeft(),s=h.getRight(),c=h.getTop(),l=h.getBottom(),t>o&&(t=o),n<s&&(n=s),r>c&&(r=c),i<l&&(i=l)}var g=new u(t,r,n-t,i-r);t==a.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),d=f[0].getParent().paddingLeft==null?this.margin:f[0].getParent().paddingLeft,this.left=g.x-d,this.right=g.x+g.width+d,this.top=g.y-d,this.bottom=g.y+g.height+d},p.calculateBounds=function(e){for(var t=a.MAX_VALUE,n=-a.MAX_VALUE,r=a.MAX_VALUE,i=-a.MAX_VALUE,o,s,c,l,d=e.length,f=0;f<d;f++){var p=e[f];o=p.getLeft(),s=p.getRight(),c=p.getTop(),l=p.getBottom(),t>o&&(t=o),n<s&&(n=s),r>c&&(r=c),i<l&&(i=l)}return new u(t,r,n-t,i-r)},p.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},p.prototype.getEstimatedSize=function(){if(this.estimatedSize==a.MIN_VALUE)throw`assert failed`;return this.estimatedSize},p.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r<n;r++){var i=t[r];e+=i.calcEstimatedSize()}return this.estimatedSize=e==0?o.EMPTY_COMPOUND_NODE_SIZE:e/Math.sqrt(this.nodes.length),this.estimatedSize},p.prototype.updateConnected=function(){var e=this;if(this.nodes.length==0){this.isConnected=!0;return}var t=new f,n=new Set,r=this.nodes[0],i,a;for(r.withChildren().forEach(function(e){t.push(e),n.add(e)});t.length!==0;){r=t.shift(),i=r.getEdges();for(var o=i.length,s=0;s<o;s++)a=i[s].getOtherEndInGraph(r,this),a!=null&&!n.has(a)&&a.withChildren().forEach(function(e){t.push(e),n.add(e)})}if(this.isConnected=!1,n.size>=this.nodes.length){var c=0;n.forEach(function(t){t.owner==e&&c++}),c==this.nodes.length&&(this.isConnected=!0)}},e.exports=p}),(function(e,t,r){var i,a=r(1);function o(e){i=r(6),this.layout=e,this.graphs=[],this.edges=[]}n(o,`LGraphManager`),o.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},o.prototype.add=function(e,t,n,r,i){if(n==null&&r==null&&i==null){if(e==null)throw`Graph is null!`;if(t==null)throw`Parent node is null!`;if(this.graphs.indexOf(e)>-1)throw`Graph already in this graph mgr!`;if(this.graphs.push(e),e.parent!=null)throw`Already has a parent!`;if(t.child!=null)throw`Already has a child!`;return e.parent=t,t.child=e,e}i=n,r=t,n=e;var a=r.getOwner(),o=i.getOwner();if(a==null||a.getGraphManager()!=this)throw`Source not in this graph mgr!`;if(o==null||o.getGraphManager()!=this)throw`Target not in this graph mgr!`;if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw`Edge already in inter-graph edge list!`;if(this.edges.push(n),n.source==null||n.target==null)throw`Edge source and/or target is null!`;if(n.source.edges.indexOf(n)!=-1||n.target.edges.indexOf(n)!=-1)throw`Edge already in source and/or target incidency list!`;return n.source.edges.push(n),n.target.edges.push(n),n},o.prototype.remove=function(e){if(e instanceof i){var t=e;if(t.getGraphManager()!=this)throw`Graph not in this graph mgr`;if(!(t==this.rootGraph||t.parent!=null&&t.parent.graphManager==this))throw`Invalid parent node!`;var n=[];n=n.concat(t.getEdges());for(var r,o=n.length,s=0;s<o;s++)r=n[s],t.remove(r);var c=[];c=c.concat(t.getNodes());var l;o=c.length;for(var s=0;s<o;s++)l=c[s],t.remove(l);t==this.rootGraph&&this.setRootGraph(null);var u=this.graphs.indexOf(t);this.graphs.splice(u,1),t.parent=null}else if(e instanceof a){if(r=e,r==null)throw`Edge is null!`;if(!r.isInterGraph)throw`Not an inter-graph edge!`;if(r.source==null||r.target==null)throw`Source and/or target is null!`;if(r.source.edges.indexOf(r)==-1||r.target.edges.indexOf(r)==-1)throw`Source and/or target doesn't know this edge!`;var u=r.source.edges.indexOf(r);if(r.source.edges.splice(u,1),u=r.target.edges.indexOf(r),r.target.edges.splice(u,1),r.source.owner==null||r.source.owner.getGraphManager()==null)throw`Edge owner graph or owner graph manager is null!`;if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw`Not in owner graph manager's edge list!`;var u=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(u,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var e=[],t=this.getGraphs(),n=t.length,r=0;r<n;r++)e=e.concat(t[r].getNodes());this.allNodes=e}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){for(var e=[],t=this.getGraphs(),n=t.length,r=0;r<t.length;r++)e=e.concat(t[r].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw`assert failed`;this.allNodesToApplyGravitation=e},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw`Root not in this graph mgr!`;this.rootGraph=e,e.parent??=this.layout.newNode(`Root node`)},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(e,t){if(e==null||t==null)throw`assert failed`;if(e==t)return!0;var n=e.getOwner(),r;do{if(r=n.getParent(),r==null)break;if(r==t)return!0;if(n=r.getOwner(),n==null)break}while(!0);n=t.getOwner();do{if(r=n.getParent(),r==null)break;if(r==e)return!0;if(n=r.getOwner(),n==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var e,t,n,r,i,a=this.getAllEdges(),o=a.length,s=0;s<o;s++){if(e=a[s],t=e.source,n=e.target,e.lca=null,e.sourceInLca=t,e.targetInLca=n,t==n){e.lca=t.getOwner();continue}for(r=t.getOwner();e.lca==null;){for(e.targetInLca=n,i=n.getOwner();e.lca==null;){if(i==r){e.lca=i;break}if(i==this.rootGraph)break;if(e.lca!=null)throw`assert failed`;e.targetInLca=i.getParent(),i=e.targetInLca.getOwner()}if(r==this.rootGraph)break;e.lca??(e.sourceInLca=r.getParent(),r=e.sourceInLca.getOwner())}if(e.lca==null)throw`assert failed`}},o.prototype.calcLowestCommonAncestor=function(e,t){if(e==t)return e.getOwner();var n=e.getOwner();do{if(n==null)break;var r=t.getOwner();do{if(r==null)break;if(r==n)return r;r=r.getParent().getOwner()}while(!0);n=n.getParent().getOwner()}while(!0);return n},o.prototype.calcInclusionTreeDepths=function(e,t){e==null&&t==null&&(e=this.rootGraph,t=1);for(var n,r=e.getNodes(),i=r.length,a=0;a<i;a++)n=r[a],n.inclusionTreeDepth=t,n.child!=null&&this.calcInclusionTreeDepths(n.child,t+1)},o.prototype.includesInvalidEdge=function(){for(var e,t=[],n=this.edges.length,r=0;r<n;r++)e=this.edges[r],this.isOneAncestorOfOther(e.source,e.target)&&t.push(e);for(var r=0;r<t.length;r++)this.remove(t[r]);return!1},e.exports=o}),(function(e,t,r){var i=r(12);function a(){}n(a,`IGeometry`),a.calcSeparationAmount=function(e,t,n,r){if(!e.intersects(t))throw`assert failed`;var i=[,,];this.decideDirectionsForOverlappingNodes(e,t,i),n[0]=Math.min(e.getRight(),t.getRight())-Math.max(e.x,t.x),n[1]=Math.min(e.getBottom(),t.getBottom())-Math.max(e.y,t.y),e.getX()<=t.getX()&&e.getRight()>=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]<s?s=n[0]:o=n[1],n[0]=-1*i[0]*(s/2+r),n[1]=-1*i[1]*(o/2+r)},a.decideDirectionsForOverlappingNodes=function(e,t,n){n[0]=e.getCenterX()<t.getCenterX()?-1:1,n[1]=e.getCenterY()<t.getCenterY()?-1:1},a.getIntersection2=function(e,t,n){var r=e.getCenterX(),i=e.getCenterY(),a=t.getCenterX(),o=t.getCenterY();if(e.intersects(t))return n[0]=r,n[1]=i,n[2]=a,n[3]=o,!0;var s=e.getX(),c=e.getY(),l=e.getRight(),u=e.getX(),d=e.getBottom(),f=e.getRight(),p=e.getWidthHalf(),m=e.getHeightHalf(),h=t.getX(),g=t.getY(),_=t.getRight(),v=t.getX(),y=t.getBottom(),b=t.getRight(),x=t.getWidthHalf(),S=t.getHeightHalf(),C=!1,w=!1;if(r===a){if(i>o)return n[0]=r,n[1]=c,n[2]=a,n[3]=y,!1;if(i<o)return n[0]=r,n[1]=d,n[2]=a,n[3]=g,!1}else if(i===o){if(r>a)return n[0]=s,n[1]=i,n[2]=_,n[3]=o,!1;if(r<a)return n[0]=l,n[1]=i,n[2]=h,n[3]=o,!1}else{var T=e.height/e.width,E=t.height/t.width,D=(o-i)/(a-r),O=void 0,k=void 0,A=void 0,j=void 0,M=void 0,N=void 0;if(-T===D?r>a?(n[0]=u,n[1]=d,C=!0):(n[0]=l,n[1]=c,C=!0):T===D&&(r>a?(n[0]=s,n[1]=c,C=!0):(n[0]=f,n[1]=d,C=!0)),-E===D?a>r?(n[2]=v,n[3]=y,w=!0):(n[2]=_,n[3]=g,w=!0):E===D&&(a>r?(n[2]=h,n[3]=g,w=!0):(n[2]=b,n[3]=y,w=!0)),C&&w)return!1;if(r>a?i>o?(O=this.getCardinalDirection(T,D,4),k=this.getCardinalDirection(E,D,2)):(O=this.getCardinalDirection(-T,D,3),k=this.getCardinalDirection(-E,D,1)):i>o?(O=this.getCardinalDirection(-T,D,1),k=this.getCardinalDirection(-E,D,3)):(O=this.getCardinalDirection(T,D,2),k=this.getCardinalDirection(E,D,4)),!C)switch(O){case 1:j=c,A=r+-m/D,n[0]=A,n[1]=j;break;case 2:A=f,j=i+p*D,n[0]=A,n[1]=j;break;case 3:j=d,A=r+m/D,n[0]=A,n[1]=j;break;case 4:A=u,j=i+-p*D,n[0]=A,n[1]=j}if(!w)switch(k){case 1:N=g,M=a+-S/D,n[2]=M,n[3]=N;break;case 2:M=b,N=o+x*D,n[2]=M,n[3]=N;break;case 3:N=y,M=a+S/D,n[2]=M,n[3]=N;break;case 4:M=v,N=o+-x*D,n[2]=M,n[3]=N}}return!1},a.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},a.getIntersection=function(e,t,n,r){if(r==null)return this.getIntersection2(e,t,n);var a=e.x,o=e.y,s=t.x,c=t.y,l=n.x,u=n.y,d=r.x,f=r.y,p=void 0,m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0;return h=c-o,_=a-s,y=s*o-a*c,g=f-u,v=l-d,b=d*u-l*f,x=h*v-g*_,x===0?null:(p=(_*b-v*y)/x,m=(g*y-h*b)/x,new i(p,m))},a.angleOfVector=function(e,t,n,r){var i=void 0;return e===n?i=r<t?this.ONE_AND_HALF_PI:this.HALF_PI:(i=Math.atan((r-t)/(n-e)),n<e?i+=Math.PI:r<t&&(i+=this.TWO_PI)),i},a.doIntersect=function(e,t,n,r){var i=e.x,a=e.y,o=t.x,s=t.y,c=n.x,l=n.y,u=r.x,d=r.y,f=(o-i)*(d-l)-(u-c)*(s-a);if(f===0)return!1;var p=((d-l)*(u-i)+(c-u)*(d-a))/f,m=((a-s)*(u-i)+(o-i)*(d-a))/f;return 0<p&&p<1&&0<m&&m<1},a.findCircleLineIntersections=function(e,t,n,r,i,a,o){var s=(n-e)*(n-e)+(r-t)*(r-t),c=2*((e-i)*(n-e)+(t-a)*(r-t)),l=(e-i)*(e-i)+(t-a)*(t-a)-o*o;if(c*c-4*s*l>=0){var u=(-c+Math.sqrt(c*c-4*s*l))/(2*s),d=(-c-Math.sqrt(c*c-4*s*l))/(2*s);return u>=0&&u<=1?[u]:d>=0&&d<=1?[d]:null}return null},a.HALF_PI=.5*Math.PI,a.ONE_AND_HALF_PI=1.5*Math.PI,a.TWO_PI=2*Math.PI,a.THREE_PI=3*Math.PI,e.exports=a}),(function(e,t,r){function i(){}n(i,`IMath`),i.sign=function(e){return e>0?1:e<0?-1:0},i.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},i.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=i}),(function(e,t,r){function i(){}n(i,`Integer`),i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,e.exports=i}),(function(e,t,r){var i=(function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return n(e,`defineProperties`),function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})();function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}n(a,`_classCallCheck`);var o=n(function(e){return{value:e,next:null,prev:null}},`nodeFrom`),s=n(function(e,t,n,r){return e===null?r.head=t:e.next=t,n===null?r.tail=t:n.prev=t,t.prev=e,t.next=n,r.length++,t},`add`),c=n(function(e,t){var n=e.prev,r=e.next;return n===null?t.head=r:n.next=r,r===null?t.tail=n:r.prev=n,e.prev=e.next=null,t.length--,e},`_remove`);e.exports=(function(){function e(t){var n=this;a(this,e),this.length=0,this.head=null,this.tail=null,t?.forEach(function(e){return n.push(e)})}return n(e,`LinkedList`),i(e,[{key:`size`,value:n(function(){return this.length},`size`)},{key:`insertBefore`,value:n(function(e,t){return s(t.prev,o(e),t,this)},`insertBefore`)},{key:`insertAfter`,value:n(function(e,t){return s(t,o(e),t.next,this)},`insertAfter`)},{key:`insertNodeBefore`,value:n(function(e,t){return s(t.prev,e,t,this)},`insertNodeBefore`)},{key:`insertNodeAfter`,value:n(function(e,t){return s(t,e,t.next,this)},`insertNodeAfter`)},{key:`push`,value:n(function(e){return s(this.tail,o(e),null,this)},`push`)},{key:`unshift`,value:n(function(e){return s(null,o(e),this.head,this)},`unshift`)},{key:`remove`,value:n(function(e){return c(e,this)},`remove`)},{key:`pop`,value:n(function(){return c(this.tail,this).value},`pop`)},{key:`popNode`,value:n(function(){return c(this.tail,this)},`popNode`)},{key:`shift`,value:n(function(){return c(this.head,this).value},`shift`)},{key:`shiftNode`,value:n(function(){return c(this.head,this)},`shiftNode`)},{key:`get_object_at`,value:n(function(e){if(e<=this.length()){for(var t=1,n=this.head;t<e;)n=n.next,t++;return n.value}},`get_object_at`)},{key:`set_object_at`,value:n(function(e,t){if(e<=this.length()){for(var n=1,r=this.head;n<e;)r=r.next,n++;r.value=t}},`set_object_at`)}]),e})()}),(function(e,t,r){function i(e,t,n){this.x=null,this.y=null,e==null&&t==null&&n==null?(this.x=0,this.y=0):typeof e==`number`&&typeof t==`number`&&n==null?(this.x=e,this.y=t):e.constructor.name==`Point`&&t==null&&n==null&&(n=e,this.x=n.x,this.y=n.y)}n(i,`Point`),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.prototype.setLocation=function(e,t,n){e.constructor.name==`Point`&&t==null&&n==null?(n=e,this.setLocation(n.x,n.y)):typeof e==`number`&&typeof t==`number`&&n==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},i.prototype.move=function(e,t){this.x=e,this.y=t},i.prototype.translate=function(e,t){this.x+=e,this.y+=t},i.prototype.equals=function(e){if(e.constructor.name==`Point`){var t=e;return this.x==t.x&&this.y==t.y}return this==e},i.prototype.toString=function(){return new i().constructor.name+`[x=`+this.x+`,y=`+this.y+`]`},e.exports=i}),(function(e,t,r){function i(e,t,n,r){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&n!=null&&r!=null&&(this.x=e,this.y=t,this.width=n,this.height=r)}n(i,`RectangleD`),i.prototype.getX=function(){return this.x},i.prototype.setX=function(e){this.x=e},i.prototype.getY=function(){return this.y},i.prototype.setY=function(e){this.y=e},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},e.exports=i}),(function(e,t,r){var i=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e};function a(){}n(a,`UniqueIDGeneretor`),a.lastID=0,a.createID=function(e){return a.isPrimitive(e)?e:(e.uniqueID??(e.uniqueID=a.getString(),a.lastID++),e.uniqueID)},a.getString=function(e){return e??=a.lastID,`Object#`+e},a.isPrimitive=function(e){var t=typeof e>`u`?`undefined`:i(e);return e==null||t!=`object`&&t!=`function`},e.exports=a}),(function(e,t,r){function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}n(i,`_toConsumableArray`);var a=r(0),o=r(7),s=r(3),c=r(1),l=r(6),u=r(5),d=r(17),f=r(29);function p(e){f.call(this),this.layoutQuality=a.QUALITY,this.createBendsAsNeeded=a.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=a.DEFAULT_INCREMENTAL,this.animationOnLayout=a.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=a.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=a.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=a.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,e!=null&&(this.isRemoteUse=e)}n(p,`Layout`),p.RANDOM_SEED=1,p.prototype=Object.create(f.prototype),p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},p.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},p.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},p.prototype.newGraphManager=function(){var e=new o(this);return this.graphManager=e,e},p.prototype.newGraph=function(e){return new l(null,this.graphManager,e)},p.prototype.newNode=function(e){return new s(this.graphManager,e)},p.prototype.newEdge=function(e){return new c(null,null,e)},p.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},p.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var e;return e=!this.checkLayoutSuccess()&&this.layout(),a.ANIMATE!==`during`&&(e&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,e)},p.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},p.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var e=this.graphManager.getAllEdges(),t=0;t<e.length;t++)e[t];for(var n=this.graphManager.getRoot().getNodes(),t=0;t<n.length;t++)n[t];this.update(this.graphManager.getRoot())}},p.prototype.update=function(e){if(e==null)this.update2();else if(e instanceof s){var t=e;if(t.getChild()!=null)for(var n=t.getChild().getNodes(),r=0;r<n.length;r++)update(n[r]);t.vGraphObject!=null&&t.vGraphObject.update(t)}else if(e instanceof c){var i=e;i.vGraphObject!=null&&i.vGraphObject.update(i)}else if(e instanceof l){var a=e;a.vGraphObject!=null&&a.vGraphObject.update(a)}},p.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=a.QUALITY,this.animationDuringLayout=a.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=a.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=a.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=a.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=a.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=a.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},p.prototype.transform=function(e){if(e==null)this.transform(new u(0,0));else{var t=new d,n=this.graphManager.getRoot().updateLeftTop();if(n!=null){t.setWorldOrgX(e.x),t.setWorldOrgY(e.y),t.setDeviceOrgX(n.x),t.setDeviceOrgY(n.y);for(var r=this.getAllNodes(),i,a=0;a<r.length;a++)i=r[a],i.transform(t)}}},p.prototype.positionNodesRandomly=function(e){if(e==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var t,n,r=e.getNodes(),i=0;i<r.length;i++)t=r[i],n=t.getChild(),n==null||n.getNodes().length==0?t.scatter():(this.positionNodesRandomly(n),t.updateBounds())},p.prototype.getFlatForest=function(){for(var e=[],t=!0,n=this.graphManager.getRoot().getNodes(),r=!0,a=0;a<n.length;a++)n[a].getChild()!=null&&(r=!1);if(!r)return e;var o=new Set,s=[],c=new Map,l=[];for(l=l.concat(n);l.length>0&&t;){for(s.push(l[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);for(var d=u.getEdges(),a=0;a<d.length;a++){var f=d[a].getOtherEnd(u);if(c.get(u)!=f){if(!o.has(f))s.push(f),c.set(f,u);else{t=!1;break}}}}if(!t)e=[];else{var p=[].concat(i(o));e.push(p);for(var a=0;a<p.length;a++){var m=p[a],h=l.indexOf(m);h>-1&&l.splice(h,1)}o=new Set,c=new Map}}return e},p.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i<e.bendpoints.length;i++){var a=this.newNode(null);a.setRect(new Point(0,0),new Dimension(1,1)),r.add(a);var o=this.newEdge(null);this.graphManager.add(o,n,a),t.add(a),n=a}var o=this.newEdge(null);return this.graphManager.add(o,n,e.target),this.edgeToDummyNodes.set(e,t),e.isInterGraph()?this.graphManager.remove(e):r.remove(e),t},p.prototype.createBendpointsFromDummyNodes=function(){var e=[];e=e.concat(this.graphManager.getAllEdges()),e=[].concat(i(this.edgeToDummyNodes.keys()),e);for(var t=0;t<e.length;t++){var n=e[t];if(n.bendpoints.length>0){for(var r=this.edgeToDummyNodes.get(n),a=0;a<r.length;a++){var o=r[a],s=new u(o.getCenterX(),o.getCenterY()),c=n.bendpoints.get(a);c.x=s.x,c.y=s.y,o.getOwner().remove(o)}this.graphManager.add(n,n.source,n.target)}}},p.transform=function(e,t,n,r){if(n!=null&&r!=null){var i=t;if(e<=50){var a=t/n;i-=(t-a)/50*(50-e)}else{var o=t*r;i+=(o-t)/50*(e-50)}return i}var s,c;return e<=50?(s=9*t/500,c=t/10):(s=9*t/50,c=-8*t),s*e+c},p.findCenterOfTree=function(e){var t=[];t=t.concat(e);var n=[],r=new Map,i=!1,a=null;(t.length==1||t.length==2)&&(i=!0,a=t[0]);for(var o=0;o<t.length;o++){var s=t[o],c=s.getNeighborsList().size;r.set(s,s.getNeighborsList().size),c==1&&n.push(s)}var l=[];for(l=l.concat(n);!i;){var u=[];u=u.concat(l),l=[];for(var o=0;o<t.length;o++){var s=t[o],d=t.indexOf(s);d>=0&&t.splice(d,1),s.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;t==1&&l.push(e),r.set(e,t)}})}n=n.concat(l),(t.length==1||t.length==2)&&(i=!0,a=t[0])}return a},p.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=p}),(function(e,t,r){function i(){}n(i,`RandomSeed`),i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},e.exports=i}),(function(e,t,r){var i=r(5);function a(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}n(a,`Transform`),a.prototype.getWorldOrgX=function(){return this.lworldOrgX},a.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},a.prototype.getWorldOrgY=function(){return this.lworldOrgY},a.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},a.prototype.getWorldExtX=function(){return this.lworldExtX},a.prototype.setWorldExtX=function(e){this.lworldExtX=e},a.prototype.getWorldExtY=function(){return this.lworldExtY},a.prototype.setWorldExtY=function(e){this.lworldExtY=e},a.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},a.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},a.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},a.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},a.prototype.getDeviceExtX=function(){return this.ldeviceExtX},a.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},a.prototype.getDeviceExtY=function(){return this.ldeviceExtY},a.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},a.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},a.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},a.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},a.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},a.prototype.inverseTransformPoint=function(e){return new i(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=a}),(function(e,t,r){function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}n(i,`_toConsumableArray`);var a=r(15),o=r(4),s=r(0),c=r(8),l=r(9);function u(){a.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}for(var d in n(u,`FDLayout`),u.prototype=Object.create(a.prototype),a)u[d]=a[d];u.prototype.initParameters=function(){a.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},u.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,i,a,c,l=this.getGraphManager().getAllEdges(),u=0;u<l.length;u++)e=l[u],t=e.idealLength,e.isInterGraph&&(r=e.getSource(),i=e.getTarget(),a=e.getSourceInLca().getEstimatedSize(),c=e.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(e.idealLength+=a+c-2*s.SIMPLE_NODE_SIZE),n=e.getLca().getInclusionTreeDepth(),e.idealLength+=t*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(r.getInclusionTreeDepth()+i.getInclusionTreeDepth()-2*n))},u.prototype.initSpringEmbedder=function(){var e=this.getAllNodes().length;this.incremental?(e>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(this.coolingFactor=e>o.ADAPTATION_LOWER_NODE_LIMIT?Math.max(o.COOLING_ADAPTATION_FACTOR,1-(e-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),t,n=0;n<e.length;n++)t=e[n],this.calcSpringForce(t,t.idealLength)},u.prototype.calcRepulsionForces=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n,r,i,a,s=this.getAllNodes(),c;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),c=new Set,n=0;n<s.length;n++)i=s[n],this.calculateRepulsionForceOfANode(i,c,e,t),c.add(i);else for(n=0;n<s.length;n++)for(i=s[n],r=n+1;r<s.length;r++)a=s[r],i.getOwner()==a.getOwner()&&this.calcRepulsionForce(i,a)},u.prototype.calcGravitationalForces=function(){for(var e,t=this.getAllNodesToApplyGravitation(),n=0;n<t.length;n++)e=t[n],this.calcGravitationalForce(e)},u.prototype.moveNodes=function(){for(var e=this.getAllNodes(),t,n=0;n<e.length;n++)t=e[n],t.move()},u.prototype.calcSpringForce=function(e,t){var n=e.getSource(),r=e.getTarget(),i,a,o,s;if(this.uniformLeafNodeSizes&&n.getChild()==null&&r.getChild()==null)e.updateLengthSimple();else if(e.updateLength(),e.isOverlapingSourceAndTarget)return;i=e.getLength(),i!=0&&(a=e.edgeElasticity*(i-t),o=a*(e.lengthX/i),s=a*(e.lengthY/i),n.springForceX+=o,n.springForceY+=s,r.springForceX-=o,r.springForceY-=s)},u.prototype.calcRepulsionForce=function(e,t){var n=e.getRect(),r=t.getRect(),i=[,,],a=[,,,,],s,u,d,f,p,m,h;if(n.intersects(r)){c.calcSeparationAmount(n,r,i,o.DEFAULT_EDGE_LENGTH/2),m=2*i[0],h=2*i[1];var g=e.noOfChildren*t.noOfChildren/(e.noOfChildren+t.noOfChildren);e.repulsionForceX-=g*m,e.repulsionForceY-=g*h,t.repulsionForceX+=g*m,t.repulsionForceY+=g*h}else this.uniformLeafNodeSizes&&e.getChild()==null&&t.getChild()==null?(s=r.getCenterX()-n.getCenterX(),u=r.getCenterY()-n.getCenterY()):(c.getIntersection(n,r,a),s=a[2]-a[0],u=a[3]-a[1]),Math.abs(s)<o.MIN_REPULSION_DIST&&(s=l.sign(s)*o.MIN_REPULSION_DIST),Math.abs(u)<o.MIN_REPULSION_DIST&&(u=l.sign(u)*o.MIN_REPULSION_DIST),d=s*s+u*u,f=Math.sqrt(d),p=(e.nodeRepulsion/2+t.nodeRepulsion/2)*e.noOfChildren*t.noOfChildren/d,m=p*s/f,h=p*u/f,e.repulsionForceX-=m,e.repulsionForceY-=h,t.repulsionForceX+=m,t.repulsionForceY+=h},u.prototype.calcGravitationalForce=function(e){var t=e.getOwner(),n=(t.getRight()+t.getLeft())/2,r=(t.getTop()+t.getBottom())/2,i=e.getCenterX()-n,a=e.getCenterY()-r,o=Math.abs(i)+e.getWidth()/2,s=Math.abs(a)+e.getHeight()/2,c;e.getOwner()==this.graphManager.getRoot()?(c=t.getEstimatedSize()*this.gravityRangeFactor,(o>c||s>c)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a)):(c=t.getEstimatedSize()*this.compoundGravityRangeFactor,(o>c||s>c)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant))},u.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,e||t},u.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},u.prototype.calcNoOfChildrenForAllNodes=function(){for(var e,t=this.graphManager.getAllNodes(),n=0;n<t.length;n++)e=t[n],e.noOfChildren=e.getNoOfChildren()},u.prototype.calcGrid=function(e){var t=0,n=0;t=parseInt(Math.ceil((e.getRight()-e.getLeft())/this.repulsionRange)),n=parseInt(Math.ceil((e.getBottom()-e.getTop())/this.repulsionRange));for(var r=Array(t),i=0;i<t;i++)r[i]=Array(n);for(var i=0;i<t;i++)for(var a=0;a<n;a++)r[i][a]=[];return r},u.prototype.addNodeToGrid=function(e,t,n){var r=0,i=0,a=0,o=0;r=parseInt(Math.floor((e.getRect().x-t)/this.repulsionRange)),i=parseInt(Math.floor((e.getRect().width+e.getRect().x-t)/this.repulsionRange)),a=parseInt(Math.floor((e.getRect().y-n)/this.repulsionRange)),o=parseInt(Math.floor((e.getRect().height+e.getRect().y-n)/this.repulsionRange));for(var s=r;s<=i;s++)for(var c=a;c<=o;c++)this.grid[s][c].push(e),e.setGridCoordinates(r,i,a,o)},u.prototype.updateGrid=function(){var e,t,n=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),e=0;e<n.length;e++)t=n[e],this.addNodeToGrid(t,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},u.prototype.calculateRepulsionForceOfANode=function(e,t,n,r){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&n||r){var a=new Set;e.surrounding=[];for(var s,c=this.grid,l=e.startX-1;l<e.finishX+2;l++)for(var u=e.startY-1;u<e.finishY+2;u++)if(!(l<0||u<0||l>=c.length||u>=c[0].length)){for(var d=0;d<c[l][u].length;d++)if(s=c[l][u][d],e.getOwner()==s.getOwner()&&e!=s&&!t.has(s)&&!a.has(s)){var f=Math.abs(e.getCenterX()-s.getCenterX())-(e.getWidth()/2+s.getWidth()/2),p=Math.abs(e.getCenterY()-s.getCenterY())-(e.getHeight()/2+s.getHeight()/2);f<=this.repulsionRange&&p<=this.repulsionRange&&a.add(s)}}e.surrounding=[].concat(i(a))}for(l=0;l<e.surrounding.length;l++)this.calcRepulsionForce(e,e.surrounding[l])},u.prototype.calcRepulsionRange=function(){return 0},e.exports=u}),(function(e,t,r){var i=r(1),a=r(4);function o(e,t,n){i.call(this,e,t,n),this.idealLength=a.DEFAULT_EDGE_LENGTH,this.edgeElasticity=a.DEFAULT_SPRING_STRENGTH}for(var s in n(o,`FDLayoutEdge`),o.prototype=Object.create(i.prototype),i)o[s]=i[s];e.exports=o}),(function(e,t,r){var i=r(3),a=r(4);function o(e,t,n,r){i.call(this,e,t,n,r),this.nodeRepulsion=a.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var s in n(o,`FDLayoutNode`),o.prototype=Object.create(i.prototype),i)o[s]=i[s];o.prototype.setGridCoordinates=function(e,t,n,r){this.startX=e,this.finishX=t,this.startY=n,this.finishY=r},e.exports=o}),(function(e,t,r){function i(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}n(i,`DimensionD`),i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},e.exports=i}),(function(e,t,r){var i=r(14);function a(){this.map={},this.keys=[]}n(a,`HashMap`),a.prototype.put=function(e,t){var n=i.createID(e);this.contains(n)||(this.map[n]=t,this.keys.push(e))},a.prototype.contains=function(e){return i.createID(e),this.map[e]!=null},a.prototype.get=function(e){var t=i.createID(e);return this.map[t]},a.prototype.keySet=function(){return this.keys},e.exports=a}),(function(e,t,r){var i=r(14);function a(){this.set={}}n(a,`HashSet`),a.prototype.add=function(e){var t=i.createID(e);this.contains(t)||(this.set[t]=e)},a.prototype.remove=function(e){delete this.set[i.createID(e)]},a.prototype.clear=function(){this.set={}},a.prototype.contains=function(e){return this.set[i.createID(e)]==e},a.prototype.isEmpty=function(){return this.size()===0},a.prototype.size=function(){return Object.keys(this.set).length},a.prototype.addAllTo=function(e){for(var t=Object.keys(this.set),n=t.length,r=0;r<n;r++)e.push(this.set[t[r]])},a.prototype.size=function(){return Object.keys(this.set).length},a.prototype.addAll=function(e){for(var t=e.length,n=0;n<t;n++){var r=e[n];this.add(r)}},e.exports=a}),(function(e,t,r){function i(){}n(i,`Matrix`),i.multMat=function(e,t){for(var n=[],r=0;r<e.length;r++){n[r]=[];for(var i=0;i<t[0].length;i++){n[r][i]=0;for(var a=0;a<e[0].length;a++)n[r][i]+=e[r][a]*t[a][i]}}return n},i.transpose=function(e){for(var t=[],n=0;n<e[0].length;n++){t[n]=[];for(var r=0;r<e.length;r++)t[n][r]=e[r][n]}return t},i.multCons=function(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=e[r]*t;return n},i.minusOp=function(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=e[r]-t[r];return n},i.dotProduct=function(e,t){for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n},i.mag=function(e){return Math.sqrt(this.dotProduct(e,e))},i.normalize=function(e){for(var t=[],n=this.mag(e),r=0;r<e.length;r++)t[r]=e[r]/n;return t},i.multGamma=function(e){for(var t=[],n=0,r=0;r<e.length;r++)n+=e[r];n*=-1/e.length;for(var i=0;i<e.length;i++)t[i]=n+e[i];return t},i.multL=function(e,t,n){for(var r=[],i=[],a=[],o=0;o<t[0].length;o++){for(var s=0,c=0;c<t.length;c++)s+=-.5*t[c][o]*e[c];i[o]=s}for(var l=0;l<n.length;l++){for(var u=0,d=0;d<n.length;d++)u+=n[l][d]*i[d];a[l]=u}for(var f=0;f<t.length;f++){for(var p=0,m=0;m<t[0].length;m++)p+=t[f][m]*a[m];r[f]=p}return r},e.exports=i}),(function(e,t,r){var i=(function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return n(e,`defineProperties`),function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})();function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}n(a,`_classCallCheck`);var o=r(11);e.exports=(function(){function e(t,n){a(this,e),(n!==null||n!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=t instanceof o?t.size():t.length,this._quicksort(t,0,r-1)}return n(e,`Quicksort`),i(e,[{key:`_quicksort`,value:n(function(e,t,n){if(t<n){var r=this._partition(e,t,n);this._quicksort(e,t,r),this._quicksort(e,r+1,n)}},`_quicksort`)},{key:`_partition`,value:n(function(e,t,n){for(var r=this._get(e,t),i=t,a=n;;){for(;this.compareFunction(r,this._get(e,a));)a--;for(;this.compareFunction(this._get(e,i),r);)i++;if(i<a)this._swap(e,i,a),i++,a--;else return a}},`_partition`)},{key:`_get`,value:n(function(e,t){return e instanceof o?e.get_object_at(t):e[t]},`_get`)},{key:`_set`,value:n(function(e,t,n){e instanceof o?e.set_object_at(t,n):e[t]=n},`_set`)},{key:`_swap`,value:n(function(e,t,n){var r=this._get(e,t);this._set(e,t,this._get(e,n)),this._set(e,n,r)},`_swap`)},{key:`_defaultCompareFunction`,value:n(function(e,t){return t>e},`_defaultCompareFunction`)}]),e})()}),(function(e,t,r){function i(){}n(i,`SVD`),i.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=(function(e){for(var t=[];e-->0;)t.push(0);return t})(Math.min(this.m+1,this.n)),this.U=(function(e){return n(function e(t){if(t.length==0)return 0;for(var n=[],r=0;r<t[0];r++)n.push(e(t.slice(1)));return n},`allocate`)(e)})([this.m,t]),this.V=(function(e){return n(function e(t){if(t.length==0)return 0;for(var n=[],r=0;r<t[0];r++)n.push(e(t.slice(1)));return n},`allocate`)(e)})([this.n,this.n]);for(var r=(function(e){for(var t=[];e-->0;)t.push(0);return t})(this.n),a=(function(e){for(var t=[];e-->0;)t.push(0);return t})(this.m),o=!0,s=!0,c=Math.min(this.m-1,this.n),l=Math.max(0,Math.min(this.n-2,this.m)),u=0;u<Math.max(c,l);u++){if(u<c){this.s[u]=0;for(var d=u;d<this.m;d++)this.s[u]=i.hypot(this.s[u],e[d][u]);if(this.s[u]!==0){e[u][u]<0&&(this.s[u]=-this.s[u]);for(var f=u;f<this.m;f++)e[f][u]/=this.s[u];e[u][u]+=1}this.s[u]=-this.s[u]}for(var p=u+1;p<this.n;p++){if((function(e,t){return e&&t})(u<c,this.s[u]!==0)){for(var m=0,h=u;h<this.m;h++)m+=e[h][u]*e[h][p];m=-m/e[u][u];for(var g=u;g<this.m;g++)e[g][p]+=m*e[g][u]}r[p]=e[u][p]}if((function(e,t){return e&&t})(o,u<c))for(var _=u;_<this.m;_++)this.U[_][u]=e[_][u];if(u<l){r[u]=0;for(var v=u+1;v<this.n;v++)r[u]=i.hypot(r[u],r[v]);if(r[u]!==0){r[u+1]<0&&(r[u]=-r[u]);for(var y=u+1;y<this.n;y++)r[y]/=r[u];r[u+1]+=1}if(r[u]=-r[u],(function(e,t){return e&&t})(u+1<this.m,r[u]!==0)){for(var b=u+1;b<this.m;b++)a[b]=0;for(var x=u+1;x<this.n;x++)for(var S=u+1;S<this.m;S++)a[S]+=r[x]*e[S][x];for(var C=u+1;C<this.n;C++)for(var w=-r[C]/r[u+1],T=u+1;T<this.m;T++)e[T][C]+=w*a[T]}if(s)for(var E=u+1;E<this.n;E++)this.V[E][u]=r[E]}}var D=Math.min(this.n,this.m+1);if(c<this.n&&(this.s[c]=e[c][c]),this.m<D&&(this.s[D-1]=0),l+1<D&&(r[l]=e[l][D-1]),r[D-1]=0,o){for(var O=c;O<t;O++){for(var k=0;k<this.m;k++)this.U[k][O]=0;this.U[O][O]=1}for(var A=c-1;A>=0;A--)if(this.s[A]!==0){for(var j=A+1;j<t;j++){for(var M=0,N=A;N<this.m;N++)M+=this.U[N][A]*this.U[N][j];M=-M/this.U[A][A];for(var P=A;P<this.m;P++)this.U[P][j]+=M*this.U[P][A]}for(var F=A;F<this.m;F++)this.U[F][A]=-this.U[F][A];this.U[A][A]=1+this.U[A][A];for(var I=0;I<A-1;I++)this.U[I][A]=0}else{for(var L=0;L<this.m;L++)this.U[L][A]=0;this.U[A][A]=1}}if(s)for(var R=this.n-1;R>=0;R--){if((function(e,t){return e&&t})(R<l,r[R]!==0))for(var z=R+1;z<t;z++){for(var B=0,V=R+1;V<this.n;V++)B+=this.V[V][R]*this.V[V][z];B=-B/this.V[R+1][R];for(var H=R+1;H<this.n;H++)this.V[H][z]+=B*this.V[H][R]}for(var ee=0;ee<this.n;ee++)this.V[ee][R]=0;this.V[R][R]=1}for(var te=D-1,U=0,ne=2**-52,re=2**-966;D>0;){var W=void 0,G=void 0;for(W=D-2;W>=-1&&W!==-1;W--)if(Math.abs(r[W])<=re+ne*(Math.abs(this.s[W])+Math.abs(this.s[W+1]))){r[W]=0;break}if(W===D-2)G=4;else{var K=void 0;for(K=D-1;K>=W&&K!==W;K--){var ie=(K===D?0:Math.abs(r[K]))+(K===W+1?0:Math.abs(r[K-1]));if(Math.abs(this.s[K])<=re+ne*ie){this.s[K]=0;break}}K===W?G=3:K===D-1?G=1:(G=2,W=K)}switch(W++,G){case 1:var q=r[D-2];r[D-2]=0;for(var J=D-2;J>=W;J--){var ae=i.hypot(this.s[J],q),Y=this.s[J]/ae,X=q/ae;if(this.s[J]=ae,J!==W&&(q=-X*r[J-1],r[J-1]=Y*r[J-1]),s)for(var Z=0;Z<this.n;Z++)ae=Y*this.V[Z][J]+X*this.V[Z][D-1],this.V[Z][D-1]=-X*this.V[Z][J]+Y*this.V[Z][D-1],this.V[Z][J]=ae}break;case 2:var oe=r[W-1];r[W-1]=0;for(var Q=W;Q<D;Q++){var se=i.hypot(this.s[Q],oe),ce=this.s[Q]/se,le=oe/se;if(this.s[Q]=se,oe=-le*r[Q],r[Q]=ce*r[Q],o)for(var ue=0;ue<this.m;ue++)se=ce*this.U[ue][Q]+le*this.U[ue][W-1],this.U[ue][W-1]=-le*this.U[ue][Q]+ce*this.U[ue][W-1],this.U[ue][Q]=se}break;case 3:var de=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[D-1]),Math.abs(this.s[D-2])),Math.abs(r[D-2])),Math.abs(this.s[W])),Math.abs(r[W])),fe=this.s[D-1]/de,pe=this.s[D-2]/de,me=r[D-2]/de,he=this.s[W]/de,ge=r[W]/de,_e=((pe+fe)*(pe-fe)+me*me)/2,ve=fe*me*(fe*me),ye=0;(function(e,t){return e||t})(_e!==0,ve!==0)&&(ye=Math.sqrt(_e*_e+ve),_e<0&&(ye=-ye),ye=ve/(_e+ye));for(var be=(he+fe)*(he-fe)+ye,xe=he*ge,$=W;$<D-1;$++){var Se=i.hypot(be,xe),Ce=be/Se,we=xe/Se;if($!==W&&(r[$-1]=Se),be=Ce*this.s[$]+we*r[$],r[$]=Ce*r[$]-we*this.s[$],xe=we*this.s[$+1],this.s[$+1]=Ce*this.s[$+1],s)for(var Te=0;Te<this.n;Te++)Se=Ce*this.V[Te][$]+we*this.V[Te][$+1],this.V[Te][$+1]=-we*this.V[Te][$]+Ce*this.V[Te][$+1],this.V[Te][$]=Se;if(Se=i.hypot(be,xe),Ce=be/Se,we=xe/Se,this.s[$]=Se,be=Ce*r[$]+we*this.s[$+1],this.s[$+1]=-we*r[$]+Ce*this.s[$+1],xe=we*r[$+1],r[$+1]=Ce*r[$+1],o&&$<this.m-1)for(var Ee=0;Ee<this.m;Ee++)Se=Ce*this.U[Ee][$]+we*this.U[Ee][$+1],this.U[Ee][$+1]=-we*this.U[Ee][$]+Ce*this.U[Ee][$+1],this.U[Ee][$]=Se}r[D-2]=be,U+=1;break;case 4:if(this.s[W]<=0&&(this.s[W]=this.s[W]<0?-this.s[W]:0,s))for(var De=0;De<=te;De++)this.V[De][W]=-this.V[De][W];for(;W<te&&!(this.s[W]>=this.s[W+1]);){var Oe=this.s[W];if(this.s[W]=this.s[W+1],this.s[W+1]=Oe,s&&W<this.n-1)for(var ke=0;ke<this.n;ke++)Oe=this.V[ke][W+1],this.V[ke][W+1]=this.V[ke][W],this.V[ke][W]=Oe;if(o&&W<this.m-1)for(var Ae=0;Ae<this.m;Ae++)Oe=this.U[Ae][W+1],this.U[Ae][W+1]=this.U[Ae][W],this.U[Ae][W]=Oe;W++}U=0,D--}}return{U:this.U,V:this.V,S:this.s}},i.hypot=function(e,t){var n=void 0;return Math.abs(e)>Math.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):t==0?n=0:(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)),n},e.exports=i}),(function(e,t,r){var i=(function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return n(e,`defineProperties`),function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})();function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}n(a,`_classCallCheck`),e.exports=(function(){function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;a(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.grid[s][c]=0}this.tracebackGrid=Array(this.iMax);for(var l=0;l<this.iMax;l++){this.tracebackGrid[l]=Array(this.jMax);for(var u=0;u<this.jMax;u++)this.tracebackGrid[l][u]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return n(e,`NeedlemanWunsch`),i(e,[{key:`getScore`,value:n(function(){return this.score},`getScore`)},{key:`getAlignments`,value:n(function(){return this.alignments},`getAlignments`)},{key:`computeGrids`,value:n(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 t=1;t<this.iMax;t++)this.grid[t][0]=this.grid[t-1][0]+this.gap_penalty,this.tracebackGrid[t][0]=[!1,!0,!1];for(var n=1;n<this.iMax;n++)for(var r=1;r<this.jMax;r++){var i=void 0;i=this.sequence1[n-1]===this.sequence2[r-1]?this.grid[n-1][r-1]+this.match_score:this.grid[n-1][r-1]+this.mismatch_penalty;var a=this.grid[n-1][r]+this.gap_penalty,o=this.grid[n][r-1]+this.gap_penalty,s=[i,a,o],c=this.arrayAllMaxIndexes(s);this.grid[n][r]=s[c[0]],this.tracebackGrid[n][r]=[c.includes(0),c.includes(1),c.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]},`computeGrids`)},{key:`alignmentTraceback`,value:n(function(){var e=[];for(e.push({pos:[this.sequence1.length,this.sequence2.length],seq1:``,seq2:``});e[0];){var t=e[0],n=this.tracebackGrid[t.pos[0]][t.pos[1]];n[0]&&e.push({pos:[t.pos[0]-1,t.pos[1]-1],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),n[1]&&e.push({pos:[t.pos[0]-1,t.pos[1]],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:`-`+t.seq2}),n[2]&&e.push({pos:[t.pos[0],t.pos[1]-1],seq1:`-`+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),t.pos[0]===0&&t.pos[1]===0&&this.alignments.push({sequence1:t.seq1,sequence2:t.seq2}),e.shift()}return this.alignments},`alignmentTraceback`)},{key:`getAllIndexes`,value:n(function(e,t){for(var n=[],r=-1;(r=e.indexOf(t,r+1))!==-1;)n.push(r);return n},`getAllIndexes`)},{key:`arrayAllMaxIndexes`,value:n(function(e){return this.getAllIndexes(e,Math.max.apply(null,e))},`arrayAllMaxIndexes`)}]),e})()}),(function(e,t,r){var i=n(function(){},`layoutBase`);i.FDLayout=r(18),i.FDLayoutConstants=r(4),i.FDLayoutEdge=r(19),i.FDLayoutNode=r(20),i.DimensionD=r(21),i.HashMap=r(22),i.HashSet=r(23),i.IGeometry=r(8),i.IMath=r(9),i.Integer=r(10),i.Point=r(12),i.PointD=r(5),i.RandomSeed=r(16),i.RectangleD=r(13),i.Transform=r(17),i.UniqueIDGeneretor=r(14),i.Quicksort=r(25),i.LinkedList=r(11),i.LGraphObject=r(2),i.LGraph=r(6),i.LEdge=r(1),i.LGraphManager=r(7),i.LNode=r(3),i.Layout=r(15),i.LayoutConstants=r(0),i.NeedlemanWunsch=r(27),i.Matrix=r(24),i.SVD=r(26),e.exports=i}),(function(e,t,r){function i(){this.listeners=[]}n(i,`Emitter`);var a=i.prototype;a.addListener=function(e,t){this.listeners.push({event:e,callback:t})},a.removeListener=function(e,t){for(var n=this.listeners.length;n>=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},a.emit=function(e,t){for(var n=0;n<this.listeners.length;n++){var r=this.listeners[n];e===r.event&&r.callback(t)}},e.exports=i})])})}),O=t((e,t)=>{n((function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(D()):typeof define==`function`&&define.amd?define([`layout-base`],r):typeof e==`object`?e.coseBase=r(D()):n.coseBase=r(n.layoutBase)}),`webpackUniversalModuleDefinition`)(e,function(e){return(()=>{var t={45:((e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r}),806:((e,t,r)=>{var i=r(551).FDLayoutConstants;function a(){}for(var o in n(a,`CoSEConstants`),i)a[o]=i[o];a.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,a.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,a.DEFAULT_COMPONENT_SEPERATION=60,a.TILE=!0,a.TILING_PADDING_VERTICAL=10,a.TILING_PADDING_HORIZONTAL=10,a.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,a.ENFORCE_CONSTRAINTS=!0,a.APPLY_LAYOUT=!0,a.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,a.TREE_REDUCTION_ON_INCREMENTAL=!0,a.PURE_INCREMENTAL=a.DEFAULT_INCREMENTAL,e.exports=a}),767:((e,t,r)=>{var i=r(551).FDLayoutEdge;function a(e,t,n){i.call(this,e,t,n)}for(var o in n(a,`CoSEEdge`),a.prototype=Object.create(i.prototype),i)a[o]=i[o];e.exports=a}),880:((e,t,r)=>{var i=r(551).LGraph;function a(e,t,n){i.call(this,e,t,n)}for(var o in n(a,`CoSEGraph`),a.prototype=Object.create(i.prototype),i)a[o]=i[o];e.exports=a}),578:((e,t,r)=>{var i=r(551).LGraphManager;function a(e){i.call(this,e)}for(var o in n(a,`CoSEGraphManager`),a.prototype=Object.create(i.prototype),i)a[o]=i[o];e.exports=a}),765:((e,t,r)=>{var i=r(551).FDLayout,a=r(578),o=r(880),s=r(991),c=r(767),l=r(806),u=r(902),d=r(551).FDLayoutConstants,f=r(551).LayoutConstants,p=r(551).Point,m=r(551).PointD,h=r(551).DimensionD,g=r(551).Layout,_=r(551).Integer,v=r(551).IGeometry,y=r(551).LGraph,b=r(551).Transform,x=r(551).LinkedList;function S(){i.call(this),this.toBeTiled={},this.constraints={}}for(var C in n(S,`CoSELayout`),S.prototype=Object.create(i.prototype),i)S[C]=i[C];S.prototype.newGraphManager=function(){var e=new a(this);return this.graphManager=e,e},S.prototype.newGraph=function(e){return new o(null,this.graphManager,e)},S.prototype.newNode=function(e){return new s(this.graphManager,e)},S.prototype.newEdge=function(e){return new c(null,null,e)},S.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.isSubLayout||(this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH<10?10: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)},S.prototype.initSpringEmbedder=function(){i.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},S.prototype.layout=function(){return f.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},S.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 e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},S.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-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 e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=l.PURE_INCREMENTAL?d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2: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()),this.coolingFactor=l.PURE_INCREMENTAL?d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},S.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n<e.length;n++){var r=e[n].rect,i=e[n].id;t[i]={id:i,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return t},S.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var e=!1;if(d.ANIMATE===`during`)this.emit(`layoutstarted`);else{for(;!e;)e=this.tick();this.graphManager.updateBounds()}},S.prototype.moveNodes=function(){for(var e=this.getAllNodes(),t,n=0;n<e.length;n++)t=e[n],t.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var n=0;n<e.length;n++)t=e[n],t.move()},S.prototype.initConstraintVariables=function(){var e=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var t=this.graphManager.getAllNodes(),r=0;r<t.length;r++){var i=t[r];this.idToNodeMap.set(i.id,i)}var a=n(function t(n){for(var r=n.getChild().getNodes(),i,a=0,o=0;o<r.length;o++)i=r[o],i.getChild()==null?e.fixedNodeSet.has(i.id)&&(a+=100):a+=t(i);return a},`calculateCompoundWeight`);if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(t){e.fixedNodeSet.add(t.nodeId)});for(var t=this.graphManager.getAllNodes(),i,r=0;r<t.length;r++)if(i=t[r],i.getChild()!=null){var o=a(i);o>0&&(i.fixedNodeWeight=o)}}if(this.constraints.relativePlacementConstraint){var s=new Map,c=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var u=this.constraints.alignmentConstraint.vertical,r=0;r<u.length;r++)this.dummyToNodeForVerticalAlignment.set(`dummy`+r,[]),u[r].forEach(function(t){s.set(t,`dummy`+r),e.dummyToNodeForVerticalAlignment.get(`dummy`+r).push(t),e.fixedNodeSet.has(t)&&e.fixedNodesOnHorizontal.add(`dummy`+r)});if(this.constraints.alignmentConstraint.horizontal)for(var d=this.constraints.alignmentConstraint.horizontal,r=0;r<d.length;r++)this.dummyToNodeForHorizontalAlignment.set(`dummy`+r,[]),d[r].forEach(function(t){c.set(t,`dummy`+r),e.dummyToNodeForHorizontalAlignment.get(`dummy`+r).push(t),e.fixedNodeSet.has(t)&&e.fixedNodesOnVertical.add(`dummy`+r)})}if(l.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(e){var t,n,r;for(r=e.length-1;r>=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},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(t){if(t.left){var n=s.has(t.left)?s.get(t.left):t.left,r=s.has(t.right)?s.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=c.has(t.top)?c.get(t.top):t.top,a=c.has(t.bottom)?c.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(a)||(e.nodesInRelativeVertical.push(a),e.nodeToRelativeConstraintMapVertical.set(a,[]),e.dummyToNodeForHorizontalAlignment.has(a)?e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(a).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:t.gap})}});else{var f=new Map,p=new Map;this.constraints.relativePlacementConstraint.forEach(function(e){if(e.left){var t=s.has(e.left)?s.get(e.left):e.left,n=s.has(e.right)?s.get(e.right):e.right;f.has(t)?f.get(t).push(n):f.set(t,[n]),f.has(n)?f.get(n).push(t):f.set(n,[t])}else{var r=c.has(e.top)?c.get(e.top):e.top,i=c.has(e.bottom)?c.get(e.bottom):e.bottom;p.has(r)?p.get(r).push(i):p.set(r,[i]),p.has(i)?p.get(i).push(r):p.set(i,[r])}});var m=n(function(e,t){var n=[],r=[],i=new x,a=new Set,o=0;return e.forEach(function(s,c){if(!a.has(c)){n[o]=[],r[o]=!1;var l=c;for(i.push(l),a.add(l),n[o].push(l);i.length!=0;)l=i.shift(),t.has(l)&&(r[o]=!0),e.get(l).forEach(function(e){a.has(e)||(i.push(e),a.add(e),n[o].push(e))});o++}}),{components:n,isFixed:r}},`constructComponents`),h=m(f,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=h.components,this.fixedComponentsOnHorizontal=h.isFixed;var g=m(p,e.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},S.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n<t.length;n++){for(var r=0,i=0;i<t[n].length;i++){if(this.fixedNodeSet.has(t[n][i])){r=0;break}r+=this.idToNodeMap.get(t[n][i]).displacementX}for(var a=r/t[n].length,i=0;i<t[n].length;i++)this.idToNodeMap.get(t[n][i]).displacementX=a}if(this.constraints.alignmentConstraint.horizontal)for(var o=this.constraints.alignmentConstraint.horizontal,n=0;n<o.length;n++){for(var s=0,i=0;i<o[n].length;i++){if(this.fixedNodeSet.has(o[n][i])){s=0;break}s+=this.idToNodeMap.get(o[n][i]).displacementY}for(var c=s/o[n].length,i=0;i<o[n].length;i++)this.idToNodeMap.get(o[n][i]).displacementY=c}}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(t){if(!e.fixedNodesOnHorizontal.has(t)){var n=0;n=e.dummyToNodeForVerticalAlignment.has(t)?e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(t)[0]).displacementX:e.idToNodeMap.get(t).displacementX,e.nodeToRelativeConstraintMapHorizontal.get(t).forEach(function(r){if(r.right){var i=e.nodeToTempPositionMapHorizontal.get(r.right)-e.nodeToTempPositionMapHorizontal.get(t)-n;i<r.gap&&(n-=r.gap-i)}else{var i=e.nodeToTempPositionMapHorizontal.get(t)-e.nodeToTempPositionMapHorizontal.get(r.left)+n;i<r.gap&&(n+=r.gap-i)}}),e.nodeToTempPositionMapHorizontal.set(t,e.nodeToTempPositionMapHorizontal.get(t)+n),e.dummyToNodeForVerticalAlignment.has(t)?e.dummyToNodeForVerticalAlignment.get(t).forEach(function(t){e.idToNodeMap.get(t).displacementX=n}):e.idToNodeMap.get(t).displacementX=n}}),this.nodesInRelativeVertical.forEach(function(t){if(!e.fixedNodesOnHorizontal.has(t)){var n=0;n=e.dummyToNodeForHorizontalAlignment.has(t)?e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(t)[0]).displacementY:e.idToNodeMap.get(t).displacementY,e.nodeToRelativeConstraintMapVertical.get(t).forEach(function(r){if(r.bottom){var i=e.nodeToTempPositionMapVertical.get(r.bottom)-e.nodeToTempPositionMapVertical.get(t)-n;i<r.gap&&(n-=r.gap-i)}else{var i=e.nodeToTempPositionMapVertical.get(t)-e.nodeToTempPositionMapVertical.get(r.top)+n;i<r.gap&&(n+=r.gap-i)}}),e.nodeToTempPositionMapVertical.set(t,e.nodeToTempPositionMapVertical.get(t)+n),e.dummyToNodeForHorizontalAlignment.has(t)?e.dummyToNodeForHorizontalAlignment.get(t).forEach(function(t){e.idToNodeMap.get(t).displacementY=n}):e.idToNodeMap.get(t).displacementY=n}});else{for(var n=0;n<this.componentsOnHorizontal.length;n++){var u=this.componentsOnHorizontal[n];if(this.fixedComponentsOnHorizontal[n])for(var i=0;i<u.length;i++)this.dummyToNodeForVerticalAlignment.has(u[i])?this.dummyToNodeForVerticalAlignment.get(u[i]).forEach(function(t){e.idToNodeMap.get(t).displacementX=0}):this.idToNodeMap.get(u[i]).displacementX=0;else{for(var d=0,f=0,i=0;i<u.length;i++)if(this.dummyToNodeForVerticalAlignment.has(u[i])){var p=this.dummyToNodeForVerticalAlignment.get(u[i]);d+=p.length*this.idToNodeMap.get(p[0]).displacementX,f+=p.length}else d+=this.idToNodeMap.get(u[i]).displacementX,f++;for(var m=d/f,i=0;i<u.length;i++)this.dummyToNodeForVerticalAlignment.has(u[i])?this.dummyToNodeForVerticalAlignment.get(u[i]).forEach(function(t){e.idToNodeMap.get(t).displacementX=m}):this.idToNodeMap.get(u[i]).displacementX=m}}for(var n=0;n<this.componentsOnVertical.length;n++){var u=this.componentsOnVertical[n];if(this.fixedComponentsOnVertical[n])for(var i=0;i<u.length;i++)this.dummyToNodeForHorizontalAlignment.has(u[i])?this.dummyToNodeForHorizontalAlignment.get(u[i]).forEach(function(t){e.idToNodeMap.get(t).displacementY=0}):this.idToNodeMap.get(u[i]).displacementY=0;else{for(var d=0,f=0,i=0;i<u.length;i++)if(this.dummyToNodeForHorizontalAlignment.has(u[i])){var p=this.dummyToNodeForHorizontalAlignment.get(u[i]);d+=p.length*this.idToNodeMap.get(p[0]).displacementY,f+=p.length}else d+=this.idToNodeMap.get(u[i]).displacementY,f++;for(var m=d/f,i=0;i<u.length;i++)this.dummyToNodeForHorizontalAlignment.has(u[i])?this.dummyToNodeForHorizontalAlignment.get(u[i]).forEach(function(t){e.idToNodeMap.get(t).displacementY=m}):this.idToNodeMap.get(u[i]).displacementY=m}}}}},S.prototype.calculateNodesToApplyGravitationTo=function(){var e=[],t,n=this.graphManager.getGraphs(),r=n.length,i;for(i=0;i<r;i++)t=n[i],t.updateConnected(),t.isConnected||(e=e.concat(t.getNodes()));return e},S.prototype.createBendpoints=function(){var e=[];e=e.concat(this.graphManager.getAllEdges());var t=new Set,n;for(n=0;n<e.length;n++){var r=e[n];if(!t.has(r)){var i=r.getSource(),a=r.getTarget();if(i==a)r.getBendpoints().push(new m),r.getBendpoints().push(new m),this.createDummyNodesForBendpoints(r),t.add(r);else{var o=[];if(o=o.concat(i.getEdgeListToNode(a)),o=o.concat(a.getEdgeListToNode(i)),!t.has(o[0])){if(o.length>1){var s;for(s=0;s<o.length;s++){var c=o[s];c.getBendpoints().push(new m),this.createDummyNodesForBendpoints(c)}}o.forEach(function(e){t.add(e)})}}}if(t.size==e.length)break}},S.prototype.positionNodesRadially=function(e){for(var t=new p(0,0),n=Math.ceil(Math.sqrt(e.length)),r=0,i=0,a=0,o=new m(0,0),s=0;s<e.length;s++){s%n==0&&(a=0,i=r,s!=0&&(i+=l.DEFAULT_COMPONENT_SEPERATION),r=0);var c=e[s],u=g.findCenterOfTree(c);t.x=a,t.y=i,o=S.radialLayout(c,u,t),o.y>r&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(f.WORLD_CENTER_X-o.x/2,f.WORLD_CENTER_Y-o.y/2))},S.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);S.branchRadialLayout(t,null,0,359,0,r);var i=y.calculateBounds(e),a=new b;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o<e.length;o++)e[o].transform(a);var s=new m(i.getMaxX(),i.getMaxY());return a.inverseTransformPoint(s)},S.branchRadialLayout=function(e,t,n,r,i,a){var o=(r-n+1)/2;o<0&&(o+=180);var s=(o+n)%360*v.TWO_PI/360,c=i*Math.cos(s),l=i*Math.sin(s);e.setCenter(c,l);var u=[];u=u.concat(e.getEdges());var d=u.length;t!=null&&d--;for(var f=0,p=u.length,m,h=e.getEdgesBetween(t);h.length>1;){var g=h[0];h.splice(0,1);var _=u.indexOf(g);_>=0&&u.splice(_,1),p--,d--}m=t==null?0:(u.indexOf(h[0])+1)%p;for(var y=Math.abs(r-n)/d,b=m;f!=d;b=++b%p){var x=u[b].getOtherEnd(e);if(x!=t){var C=(n+f*y)%360,w=(C+y)%360;S.branchRadialLayout(x,e,C,w,i+a,a),f++}}},S.maxDiagonalInTree=function(e){for(var t=_.MIN_VALUE,n=0;n<e.length;n++){var r=e[n].getDiagonal();r>t&&(t=r)}return t},S.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},S.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i<r.length;i++){var a=r[i],o=a.getParent();this.getNodeDegreeWithChildren(a)===0&&(o.id==null||!this.getToBeTiled(o))&&n.push(a)}for(var i=0;i<n.length;i++){var a=n[i],c=a.getParent().id;typeof t[c]>`u`&&(t[c]=[]),t[c]=t[c].concat(a)}Object.keys(t).forEach(function(n){if(t[n].length>1){var r=`DummyCompound_`+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new s(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var o=e.getGraphManager().add(e.newGraph(),a),c=i.getChild();c.add(a);for(var l=0;l<t[n].length;l++){var u=t[n][l];c.remove(u),o.add(u)}}})},S.prototype.clearCompounds=function(){var e={},t={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)t[this.compoundOrder[n].id]=this.compoundOrder[n],e[this.compoundOrder[n].id]=[].concat(this.compoundOrder[n].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[n].getChild()),this.compoundOrder[n].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(e,t)},S.prototype.clearZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(n){var r=e.idToDummyNode[n];if(t[n]=e.tileNodes(e.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=t[n].width,r.rect.height=t[n].height,r.setCenter(t[n].centerX,t[n].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var i=r.rect.width,a=r.rect.height;r.labelWidth&&(r.labelPosHorizontal==`left`?(r.rect.x-=r.labelWidth,r.setWidth(i+r.labelWidth),r.labelMarginLeft=r.labelWidth):r.labelPosHorizontal==`center`&&r.labelWidth>i?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):r.labelPosHorizontal==`right`&&r.setWidth(i+r.labelWidth)),r.labelHeight&&(r.labelPosVertical==`top`?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):r.labelPosVertical==`center`&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):r.labelPosVertical==`bottom`&&r.setHeight(a+r.labelHeight))}})},S.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,a=t.labelMarginLeft,o=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,a,o)}},S.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,o=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a,o,s)})},S.prototype.getToBeTiled=function(e){var t=e.id;if(this.toBeTiled[t]!=null)return this.toBeTiled[t];var n=e.getChild();if(n==null)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i<r.length;i++){var a=r[i];if(this.getNodeDegree(a)>0)return this.toBeTiled[t]=!1,!1;if(a.getChild()==null){this.toBeTiled[a.id]=!1;continue}if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}return this.toBeTiled[t]=!0,!0},S.prototype.getNodeDegree=function(e){for(var t=e.id,n=e.getEdges(),r=0,i=0;i<n.length;i++){var a=n[i];a.getSource().id!==a.getTarget().id&&(r+=1)}return r},S.prototype.getNodeDegreeWithChildren=function(e){var t=this.getNodeDegree(e);if(e.getChild()==null)return t;for(var n=e.getChild().getNodes(),r=0;r<n.length;r++){var i=n[r];t+=this.getNodeDegreeWithChildren(i)}return t},S.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},S.prototype.fillCompexOrderByDFS=function(e){for(var t=0;t<e.length;t++){var n=e[t];n.getChild()!=null&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},S.prototype.adjustLocations=function(e,t,n,r,i,a,o){t+=r+a,n+=i+o;for(var s=t,c=0;c<e.rows.length;c++){var l=e.rows[c];t=s;for(var u=0,d=0;d<l.length;d++){var f=l[d];f.rect.x=t,f.rect.y=n,t+=f.rect.width+e.horizontalPadding,f.rect.height>u&&(u=f.rect.height)}n+=u+e.verticalPadding}},S.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,o=i.rect.height;i.labelWidth&&(i.labelPosHorizontal==`left`?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):i.labelPosHorizontal==`center`&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):i.labelPosHorizontal==`right`&&i.setWidth(a+i.labelWidth)),i.labelHeight&&(i.labelPosVertical==`top`?(i.rect.y-=i.labelHeight,i.setHeight(o+i.labelHeight),i.labelMarginTop=i.labelHeight):i.labelPosVertical==`center`&&i.labelHeight>o?(i.rect.y-=(i.labelHeight-o)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-o)/2):i.labelPosVertical==`bottom`&&i.setHeight(o+i.labelHeight))}})},S.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n),a=this.getOrgRatio(r),o;return o=a<i?r:n,o},S.prototype.getOrgRatio=function(e){var t=e.width/e.height;return t<1&&(t=1/t),t},S.prototype.calcIdealRowWidth=function(e,t){var n=l.TILING_PADDING_VERTICAL,r=l.TILING_PADDING_HORIZONTAL,i=e.length,a=0,o=0,s=0;e.forEach(function(e){a+=e.getWidth(),o+=e.getHeight(),e.getWidth()>s&&(s=e.getWidth())});var c=a/i,u=o/i,d=(n-r)**2+4*(c+r)*(u+n)*i,f=(r-n+Math.sqrt(d))/(2*(c+r)),p;t?(p=Math.ceil(f),p==f&&p++):p=Math.floor(f);var m=p*(c+r)-r;return s>m&&(m=s),m+=r*2,m},S.prototype.tileNodesByFavoringDim=function(e,t,r){var i=l.TILING_PADDING_VERTICAL,a=l.TILING_PADDING_HORIZONTAL,o=l.TILING_COMPARE_BY,s={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:i,horizontalPadding:a,centerX:0,centerY:0};o&&(s.idealRowWidth=this.calcIdealRowWidth(e,r));var c=n(function(e){return e.rect.width*e.rect.height},`getNodeArea`),u=n(function(e,t){return c(t)-c(e)},`areaCompareFcn`);e.sort(function(e,t){var n=u;return s.idealRowWidth?(n=o,n(e.id,t.id)):n(e,t)});for(var d=0,f=0,p=0;p<e.length;p++){var m=e[p];d+=m.getCenterX(),f+=m.getCenterY()}s.centerX=d/e.length,s.centerY=f/e.length;for(var p=0;p<e.length;p++){var m=e[p];if(s.rows.length==0)this.insertNodeToRow(s,m,0,t);else if(this.canAddHorizontal(s,m.rect.width,m.rect.height)){var h=s.rows.length-1;s.idealRowWidth||(h=this.getShortestRowIndex(s)),this.insertNodeToRow(s,m,h,t)}else this.insertNodeToRow(s,m,s.rows.length,t);this.shiftToLastRow(s)}return s},S.prototype.insertNodeToRow=function(e,t,n,r){var i=r;n==e.rows.length&&(e.rows.push([]),e.rowWidth.push(i),e.rowHeight.push(0));var a=e.rowWidth[n]+t.rect.width;e.rows[n].length>0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width<a&&(e.width=a);var o=t.rect.height;n>0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},S.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;r<e.rows.length;r++)e.rowWidth[r]<n&&(t=r,n=e.rowWidth[r]);return t},S.prototype.getLongestRowIndex=function(e){for(var t=-1,n=Number.MIN_VALUE,r=0;r<e.rows.length;r++)e.rowWidth[r]>n&&(t=r,n=e.rowWidth[r]);return t},S.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var a=e.rowWidth[i];if(a+e.horizontalPadding+t<=e.width)return!0;var o=0;e.rowHeight[i]<n&&i>0&&(o=n+e.verticalPadding-e.rowHeight[i]);var s=e.width-a>=t+e.horizontalPadding?(e.height+o)/(a+t+e.horizontalPadding):(e.height+o)/e.width;o=n+e.verticalPadding;var c;return c=e.width<t?(e.height+o)/t:(e.height+o)/e.width,c<1&&(c=1/c),s<1&&(s=1/s),s<c},S.prototype.shiftToLastRow=function(e){var t=this.getLongestRowIndex(e),n=e.rowWidth.length-1,r=e.rows[t],i=r[r.length-1],a=i.width+e.horizontalPadding;if(e.width-e.rowWidth[n]>a&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;s<r.length;s++)r[s].height>o&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var c=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]<i.height+e.verticalPadding&&(e.rowHeight[n]=i.height+e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.height+=l-c,this.shiftToLastRow(e)}},S.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},S.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},S.prototype.reduceTrees=function(){for(var e=[],t=!0,n;t;){var r=this.graphManager.getAllNodes(),i=[];t=!1;for(var a=0;a<r.length;a++)if(n=r[a],n.getEdges().length==1&&!n.getEdges()[0].isInterGraph&&n.getChild()==null){if(l.PURE_INCREMENTAL){var o=n.getEdges()[0].getOtherEnd(n),s=new h(n.getCenterX()-o.getCenterX(),n.getCenterY()-o.getCenterY());i.push([n,n.getEdges()[0],n.getOwner(),s])}else i.push([n,n.getEdges()[0],n.getOwner()]);t=!0}if(t==1){for(var c=[],u=0;u<i.length;u++)i[u][0].getEdges().length==1&&(c.push(i[u]),i[u][0].getOwner().remove(i[u][0]));e.push(c),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},S.prototype.growTree=function(e){for(var t=e[e.length-1],n,r=0;r<t.length;r++)n=t[r],this.findPlaceforPrunedNode(n),n[2].add(n[0]),n[2].add(n[1],n[1].source,n[1].target);e.splice(e.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},S.prototype.findPlaceforPrunedNode=function(e){var t,n,r=e[0];if(n=r==e[1].source?e[1].target:e[1].source,l.PURE_INCREMENTAL)r.setCenter(n.getCenterX()+e[3].getWidth(),n.getCenterY()+e[3].getHeight());else{var i=n.startX,a=n.finishX,o=n.startY,s=n.finishY,c=[0,0,0,0];if(o>0)for(var u=i;u<=a;u++)c[0]+=this.grid[u][o-1].length+this.grid[u][o].length-1;if(a<this.grid.length-1)for(var u=o;u<=s;u++)c[1]+=this.grid[a+1][u].length+this.grid[a][u].length-1;if(s<this.grid[0].length-1)for(var u=i;u<=a;u++)c[2]+=this.grid[u][s+1].length+this.grid[u][s].length-1;if(i>0)for(var u=o;u<=s;u++)c[3]+=this.grid[i-1][u].length+this.grid[i][u].length-1;for(var f=_.MAX_VALUE,p,m,h=0;h<c.length;h++)c[h]<f?(f=c[h],p=1,m=h):c[h]==f&&p++;if(p==3&&f==0)c[0]==0&&c[1]==0&&c[2]==0?t=1:c[0]==0&&c[1]==0&&c[3]==0?t=0:c[0]==0&&c[2]==0&&c[3]==0?t=3:c[1]==0&&c[2]==0&&c[3]==0&&(t=2);else if(p==2&&f==0){var g=Math.floor(Math.random()*2);t=c[0]==0&&c[1]==0?g==0?0:1:c[0]==0&&c[2]==0?g==0?0:2:c[0]==0&&c[3]==0?g==0?0:3:c[1]==0&&c[2]==0?g==0?1:2:c[1]==0&&c[3]==0?g==0?1:3:g==0?2:3}else if(p==4&&f==0){var g=Math.floor(Math.random()*4);t=g}else t=m;t==0?r.setCenter(n.getCenterX(),n.getCenterY()-n.getHeight()/2-d.DEFAULT_EDGE_LENGTH-r.getHeight()/2):t==1?r.setCenter(n.getCenterX()+n.getWidth()/2+d.DEFAULT_EDGE_LENGTH+r.getWidth()/2,n.getCenterY()):t==2?r.setCenter(n.getCenterX(),n.getCenterY()+n.getHeight()/2+d.DEFAULT_EDGE_LENGTH+r.getHeight()/2):r.setCenter(n.getCenterX()-n.getWidth()/2-d.DEFAULT_EDGE_LENGTH-r.getWidth()/2,n.getCenterY())}},e.exports=S}),991:((e,t,r)=>{var i=r(551).FDLayoutNode,a=r(551).IMath;function o(e,t,n,r){i.call(this,e,t,n,r)}for(var s in n(o,`CoSENode`),o.prototype=Object.create(i.prototype),i)o[s]=i[s];o.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*a.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*a.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(e,t){for(var n=this.getChild().getNodes(),r,i=0;i<n.length;i++)r=n[i],r.getChild()==null?(r.displacementX+=e,r.displacementY+=t):r.propogateDisplacementToChildren(e,t)},o.prototype.move=function(){var e=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),e.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},o.prototype.setPred1=function(e){this.pred1=e},o.prototype.getPred1=function(){return pred1},o.prototype.getPred2=function(){return pred2},o.prototype.setNext=function(e){this.next=e},o.prototype.getNext=function(){return next},o.prototype.setProcessed=function(e){this.processed=e},o.prototype.isProcessed=function(){return processed},e.exports=o}),902:((e,t,r)=>{function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}n(i,`_toConsumableArray`);var a=r(806),o=r(551).LinkedList,s=r(551).Matrix,c=r(551).SVD;function l(){}n(l,`ConstraintHandler`),l.handleConstraints=function(e){var t={};t.fixedNodeConstraint=e.constraints.fixedNodeConstraint,t.alignmentConstraint=e.constraints.alignmentConstraint,t.relativePlacementConstraint=e.constraints.relativePlacementConstraint;for(var r=new Map,l=new Map,u=[],d=[],f=e.getAllNodes(),p=0,m=0;m<f.length;m++){var h=f[m];h.getChild()??(l.set(h.id,p++),u.push(h.getCenterX()),d.push(h.getCenterY()),r.set(h.id,h))}t.relativePlacementConstraint&&t.relativePlacementConstraint.forEach(function(e){!e.gap&&e.gap!=0&&(e.gap=e.left?a.DEFAULT_EDGE_LENGTH+r.get(e.left).getWidth()/2+r.get(e.right).getWidth()/2:a.DEFAULT_EDGE_LENGTH+r.get(e.top).getHeight()/2+r.get(e.bottom).getHeight()/2)});var g=n(function(e,t){return{x:e.x-t.x,y:e.y-t.y}},`calculatePositionDiff`),_=n(function(e){var t=0,n=0;return e.forEach(function(e){t+=u[l.get(e)],n+=d[l.get(e)]}),{x:t/e.size,y:n/e.size}},`calculateAvgPosition`),v=n(function(e,t,r,a,s){function c(e,t){var n=new Set(e),r=!0,i=!1,a=void 0;try{for(var o=t[Symbol.iterator](),s;!(r=(s=o.next()).done);r=!0){var c=s.value;n.add(c)}}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}n(c,`setUnion`);var f=new Map;e.forEach(function(e,t){f.set(t,0)}),e.forEach(function(e,t){e.forEach(function(e){f.set(e.id,f.get(e.id)+1)})});var p=new Map,m=new Map,h=new o;f.forEach(function(e,n){e==0?(h.push(n),r||(t==`horizontal`?p.set(n,l.has(n)?u[l.get(n)]:a.get(n)):p.set(n,l.has(n)?d[l.get(n)]:a.get(n)))):p.set(n,-1/0),r&&m.set(n,new Set([n]))}),r&&s.forEach(function(e){var n=[];if(e.forEach(function(e){r.has(e)&&n.push(e)}),n.length>0){var i=0;n.forEach(function(e){t==`horizontal`?(p.set(e,l.has(e)?u[l.get(e)]:a.get(e)),i+=p.get(e)):(p.set(e,l.has(e)?d[l.get(e)]:a.get(e)),i+=p.get(e))}),i/=n.length,e.forEach(function(e){r.has(e)||p.set(e,i)})}else{var o=0;e.forEach(function(e){o+=t==`horizontal`?l.has(e)?u[l.get(e)]:a.get(e):l.has(e)?d[l.get(e)]:a.get(e)}),o/=e.length,e.forEach(function(e){p.set(e,o)})}});for(var g=n(function(){var n=h.shift();e.get(n).forEach(function(e){if(p.get(e.id)<p.get(n)+e.gap){if(r&&r.has(e.id)){var i=void 0;if(i=t==`horizontal`?l.has(e.id)?u[l.get(e.id)]:a.get(e.id):l.has(e.id)?d[l.get(e.id)]:a.get(e.id),p.set(e.id,i),i<p.get(n)+e.gap){var o=p.get(n)+e.gap-i;m.get(n).forEach(function(e){p.set(e,p.get(e)-o)})}}else p.set(e.id,p.get(n)+e.gap)}f.set(e.id,f.get(e.id)-1),f.get(e.id)==0&&h.push(e.id),r&&m.set(e.id,c(m.get(n),m.get(e.id)))})},`_loop`);h.length!=0;)g();if(r){var _=new Set;e.forEach(function(e,t){e.length==0&&_.add(t)});var v=[];m.forEach(function(e,t){if(_.has(t)){var n=!1,a=!0,o=!1,s=void 0;try{for(var c=e[Symbol.iterator](),l;!(a=(l=c.next()).done);a=!0){var u=l.value;r.has(u)&&(n=!0)}}catch(e){o=!0,s=e}finally{try{!a&&c.return&&c.return()}finally{if(o)throw s}}if(!n){var d=!1,f=void 0;v.forEach(function(t,n){t.has([].concat(i(e))[0])&&(d=!0,f=n)}),d?e.forEach(function(e){v[f].add(e)}):v.push(new Set(e))}}}),v.forEach(function(e,n){var r=1/0,i=1/0,o=-1/0,s=-1/0,c=!0,f=!1,m=void 0;try{for(var h=e[Symbol.iterator](),g;!(c=(g=h.next()).done);c=!0){var _=g.value,v=void 0;v=t==`horizontal`?l.has(_)?u[l.get(_)]:a.get(_):l.has(_)?d[l.get(_)]:a.get(_);var y=p.get(_);v<r&&(r=v),v>o&&(o=v),y<i&&(i=y),y>s&&(s=y)}}catch(e){f=!0,m=e}finally{try{!c&&h.return&&h.return()}finally{if(f)throw m}}var b=(r+o)/2-(i+s)/2,x=!0,S=!1,C=void 0;try{for(var w=e[Symbol.iterator](),T;!(x=(T=w.next()).done);x=!0){var E=T.value;p.set(E,p.get(E)+b)}}catch(e){S=!0,C=e}finally{try{!x&&w.return&&w.return()}finally{if(S)throw C}}})}return p},`findAppropriatePositionForRelativePlacement`),y=n(function(e){var t=0,n=0,r=0,i=0;if(e.forEach(function(e){e.left?u[l.get(e.left)]-u[l.get(e.right)]>=0?t++:n++:d[l.get(e.top)]-d[l.get(e.bottom)]>=0?r++:i++}),t>n&&r>i)for(var a=0;a<l.size;a++)u[a]=-1*u[a],d[a]=-1*d[a];else if(t>n)for(var o=0;o<l.size;o++)u[o]=-1*u[o];else if(r>i)for(var s=0;s<l.size;s++)d[s]=-1*d[s]},`applyReflectionForRelativePlacement`),b=n(function(e){var t=[],n=new o,r=new Set,i=0;return e.forEach(function(a,o){if(!r.has(o)){t[i]=[];var s=o;for(n.push(s),r.add(s),t[i].push(s);n.length!=0;)s=n.shift(),e.get(s).forEach(function(e){r.has(e.id)||(n.push(e.id),r.add(e.id),t[i].push(e.id))});i++}}),t},`findComponents`),x=n(function(e){var t=new Map;return e.forEach(function(e,n){t.set(n,[])}),e.forEach(function(e,n){e.forEach(function(e){t.get(n).push(e),t.get(e.id).push({id:n,gap:e.gap,direction:e.direction})})}),t},`dagToUndirected`),S=n(function(e){var t=new Map;return e.forEach(function(e,n){t.set(n,[])}),e.forEach(function(e,n){e.forEach(function(e){t.get(e.id).push({id:n,gap:e.gap,direction:e.direction})})}),t},`dagToReversed`),C=[],w=[],T=!1,E=!1,D=new Set,O=new Map,k=new Map,A=[];if(t.fixedNodeConstraint&&t.fixedNodeConstraint.forEach(function(e){D.add(e.nodeId)}),t.relativePlacementConstraint&&(t.relativePlacementConstraint.forEach(function(e){e.left?(O.has(e.left)?O.get(e.left).push({id:e.right,gap:e.gap,direction:`horizontal`}):O.set(e.left,[{id:e.right,gap:e.gap,direction:`horizontal`}]),O.has(e.right)||O.set(e.right,[])):(O.has(e.top)?O.get(e.top).push({id:e.bottom,gap:e.gap,direction:`vertical`}):O.set(e.top,[{id:e.bottom,gap:e.gap,direction:`vertical`}]),O.has(e.bottom)||O.set(e.bottom,[]))}),k=x(O),A=b(k)),a.TRANSFORM_ON_CONSTRAINT_HANDLING){if(t.fixedNodeConstraint&&t.fixedNodeConstraint.length>1)t.fixedNodeConstraint.forEach(function(e,t){C[t]=[e.position.x,e.position.y],w[t]=[u[l.get(e.nodeId)],d[l.get(e.nodeId)]]}),T=!0;else if(t.alignmentConstraint)(function(){var e=0;if(t.alignmentConstraint.vertical){for(var r=t.alignmentConstraint.vertical,a=n(function(t){var n=new Set;r[t].forEach(function(e){n.add(e)});var a=new Set([].concat(i(n)).filter(function(e){return D.has(e)})),o=void 0;o=a.size>0?u[l.get(a.values().next().value)]:_(n).x,r[t].forEach(function(t){C[e]=[o,d[l.get(t)]],w[e]=[u[l.get(t)],d[l.get(t)]],e++})},`_loop2`),o=0;o<r.length;o++)a(o);T=!0}if(t.alignmentConstraint.horizontal){for(var s=t.alignmentConstraint.horizontal,c=n(function(t){var n=new Set;s[t].forEach(function(e){n.add(e)});var r=new Set([].concat(i(n)).filter(function(e){return D.has(e)})),a=void 0;a=r.size>0?u[l.get(r.values().next().value)]:_(n).y,s[t].forEach(function(t){C[e]=[u[l.get(t)],a],w[e]=[u[l.get(t)],d[l.get(t)]],e++})},`_loop3`),f=0;f<s.length;f++)c(f);T=!0}t.relativePlacementConstraint&&(E=!0)})();else if(t.relativePlacementConstraint){for(var j=0,M=0,N=0;N<A.length;N++)A[N].length>j&&(j=A[N].length,M=N);if(j<k.size/2)y(t.relativePlacementConstraint),T=!1,E=!1;else{var P=new Map,F=new Map,I=[];A[M].forEach(function(e){O.get(e).forEach(function(t){t.direction==`horizontal`?(P.has(e)?P.get(e).push(t):P.set(e,[t]),P.has(t.id)||P.set(t.id,[]),I.push({left:e,right:t.id})):(F.has(e)?F.get(e).push(t):F.set(e,[t]),F.has(t.id)||F.set(t.id,[]),I.push({top:e,bottom:t.id}))})}),y(I),E=!1;var L=v(P,`horizontal`),R=v(F,`vertical`);A[M].forEach(function(e,t){w[t]=[u[l.get(e)],d[l.get(e)]],C[t]=[],L.has(e)?C[t][0]=L.get(e):C[t][0]=u[l.get(e)],R.has(e)?C[t][1]=R.get(e):C[t][1]=d[l.get(e)]}),T=!0}}if(T){for(var z=void 0,B=s.transpose(C),V=s.transpose(w),H=0;H<B.length;H++)B[H]=s.multGamma(B[H]),V[H]=s.multGamma(V[H]);var ee=s.multMat(B,s.transpose(V)),te=c.svd(ee);z=s.multMat(te.V,s.transpose(te.U));for(var U=0;U<l.size;U++){var ne=[u[U],d[U]],re=[z[0][0],z[1][0]],W=[z[0][1],z[1][1]];u[U]=s.dotProduct(ne,re),d[U]=s.dotProduct(ne,W)}E&&y(t.relativePlacementConstraint)}}if(a.ENFORCE_CONSTRAINTS){if(t.fixedNodeConstraint&&t.fixedNodeConstraint.length>0){var G={x:0,y:0};t.fixedNodeConstraint.forEach(function(e,t){var n={x:u[l.get(e.nodeId)],y:d[l.get(e.nodeId)]},r=e.position,i=g(r,n);G.x+=i.x,G.y+=i.y}),G.x/=t.fixedNodeConstraint.length,G.y/=t.fixedNodeConstraint.length,u.forEach(function(e,t){u[t]+=G.x}),d.forEach(function(e,t){d[t]+=G.y}),t.fixedNodeConstraint.forEach(function(e){u[l.get(e.nodeId)]=e.position.x,d[l.get(e.nodeId)]=e.position.y})}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var K=t.alignmentConstraint.vertical,ie=n(function(e){var t=new Set;K[e].forEach(function(e){t.add(e)});var n=new Set([].concat(i(t)).filter(function(e){return D.has(e)})),r=void 0;r=n.size>0?u[l.get(n.values().next().value)]:_(t).x,t.forEach(function(e){D.has(e)||(u[l.get(e)]=r)})},`_loop4`),q=0;q<K.length;q++)ie(q);if(t.alignmentConstraint.horizontal)for(var J=t.alignmentConstraint.horizontal,ae=n(function(e){var t=new Set;J[e].forEach(function(e){t.add(e)});var n=new Set([].concat(i(t)).filter(function(e){return D.has(e)})),r=void 0;r=n.size>0?d[l.get(n.values().next().value)]:_(t).y,t.forEach(function(e){D.has(e)||(d[l.get(e)]=r)})},`_loop5`),Y=0;Y<J.length;Y++)ae(Y)}t.relativePlacementConstraint&&(function(){var e=new Map,r=new Map,i=new Map,a=new Map,o=new Map,s=new Map,c=new Set,f=new Set;if(D.forEach(function(e){c.add(e),f.add(e)}),t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var p=t.alignmentConstraint.vertical,m=n(function(t){i.set(`dummy`+t,[]),p[t].forEach(function(n){e.set(n,`dummy`+t),i.get(`dummy`+t).push(n),D.has(n)&&c.add(`dummy`+t)}),o.set(`dummy`+t,u[l.get(p[t][0])])},`_loop6`),h=0;h<p.length;h++)m(h);if(t.alignmentConstraint.horizontal)for(var g=t.alignmentConstraint.horizontal,_=n(function(e){a.set(`dummy`+e,[]),g[e].forEach(function(t){r.set(t,`dummy`+e),a.get(`dummy`+e).push(t),D.has(t)&&f.add(`dummy`+e)}),s.set(`dummy`+e,d[l.get(g[e][0])])},`_loop7`),y=0;y<g.length;y++)_(y)}var C=new Map,w=new Map,T=n(function(t){O.get(t).forEach(function(n){var i=void 0,a=void 0;n.direction==`horizontal`?(i=e.get(t)?e.get(t):t,a=e.get(n.id)?{id:e.get(n.id),gap:n.gap,direction:n.direction}:n,C.has(i)?C.get(i).push(a):C.set(i,[a]),C.has(a.id)||C.set(a.id,[])):(i=r.get(t)?r.get(t):t,a=r.get(n.id)?{id:r.get(n.id),gap:n.gap,direction:n.direction}:n,w.has(i)?w.get(i).push(a):w.set(i,[a]),w.has(a.id)||w.set(a.id,[]))})},`_loop8`),E=!0,k=!1,A=void 0;try{for(var j=O.keys()[Symbol.iterator](),M;!(E=(M=j.next()).done);E=!0){var N=M.value;T(N)}}catch(e){k=!0,A=e}finally{try{!E&&j.return&&j.return()}finally{if(k)throw A}}var P=x(C),F=x(w),I=b(P),L=b(F),R=S(C),z=S(w),B=[],V=[];I.forEach(function(e,t){B[t]=[],e.forEach(function(e){R.get(e).length==0&&B[t].push(e)})}),L.forEach(function(e,t){V[t]=[],e.forEach(function(e){z.get(e).length==0&&V[t].push(e)})});var H=v(C,`horizontal`,c,o,B),ee=v(w,`vertical`,f,s,V),te=n(function(e){i.get(e)?i.get(e).forEach(function(t){u[l.get(t)]=H.get(e)}):u[l.get(e)]=H.get(e)},`_loop9`),U=!0,ne=!1,re=void 0;try{for(var W=H.keys()[Symbol.iterator](),G;!(U=(G=W.next()).done);U=!0){var K=G.value;te(K)}}catch(e){ne=!0,re=e}finally{try{!U&&W.return&&W.return()}finally{if(ne)throw re}}var ie=n(function(e){a.get(e)?a.get(e).forEach(function(t){d[l.get(t)]=ee.get(e)}):d[l.get(e)]=ee.get(e)},`_loop10`),q=!0,J=!1,ae=void 0;try{for(var Y=ee.keys()[Symbol.iterator](),X;!(q=(X=Y.next()).done);q=!0){var K=X.value;ie(K)}}catch(e){J=!0,ae=e}finally{try{!q&&Y.return&&Y.return()}finally{if(J)throw ae}}})()}for(var X=0;X<f.length;X++){var Z=f[X];Z.getChild()??Z.setCenter(u[l.get(Z.id)],d[l.get(Z.id)])}},e.exports=l}),551:(t=>{t.exports=e})},r={};function i(e){var n=r[e];if(n!==void 0)return n.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,i),a.exports}return n(i,`__webpack_require__`),i(45)})()})}),k=t((e,t)=>{n((function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(O()):typeof define==`function`&&define.amd?define([`cose-base`],r):typeof e==`object`?e.cytoscapeFcose=r(O()):n.cytoscapeFcose=r(n.coseBase)}),`webpackUniversalModuleDefinition`)(e,function(e){return(()=>{var t={658:(e=>{e.exports=Object.assign==null?function(e){return[...arguments].slice(1).forEach(function(t){Object.keys(t).forEach(function(n){return e[n]=t[n]})}),e}:Object.assign.bind(Object)}),548:((e,t,r)=>{var i=(function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return n(e,`sliceIterator`),function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}})(),a=r(140).layoutBase.LinkedList,o={};o.getTopMostNodes=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].id()]=!0;return e.filter(function(e,n){typeof e==`number`&&(e=n);for(var r=e.parent()[0];r!=null;){if(t[r.id()])return!1;r=r.parent()[0]}return!0})},o.connectComponents=function(e,t,r,i){var o=new a,s=new Set,c=[],l=void 0,u=void 0,d=void 0,f=!1,p=1,m=[],h=[],g=n(function(){var i=e.collection();h.push(i);var a=r[0],g=e.collection();g.merge(a).merge(a.descendants().intersection(t)),c.push(a),g.forEach(function(e){o.push(e),s.add(e),i.merge(e)});for(var _=n(function(){a=o.shift();var n=e.collection();a.neighborhood().nodes().forEach(function(e){t.intersection(a.edgesWith(e)).length>0&&n.merge(e)});for(var u=0;u<n.length;u++){var d=n[u];l=r.intersection(d.union(d.ancestors())),l!=null&&!s.has(l[0])&&l.union(l.descendants()).forEach(function(e){o.push(e),s.add(e),i.merge(e),r.has(e)&&c.push(e)})}},`_loop2`);o.length!=0;)_();if(i.forEach(function(e){t.intersection(e.connectedEdges()).forEach(function(e){i.has(e.source())&&i.has(e.target())&&i.merge(e)})}),c.length==r.length&&(f=!0),!f||f&&p>1){u=c[0],d=u.connectedEdges().length,c.forEach(function(e){e.connectedEdges().length<d&&(d=e.connectedEdges().length,u=e)}),m.push(u.id());var v=e.collection();v.merge(c[0]),c.forEach(function(e){v.merge(e)}),c=[],r=r.difference(v),p++}},`_loop`);do g();while(!f);return i&&m.length>0&&i.set(`dummy`+(i.size+1),m),h},o.relocateComponent=function(e,t,n){if(!n.fixedNodeConstraint){var r=1/0,a=-1/0,o=1/0,s=-1/0;if(n.quality==`draft`){var c=!0,l=!1,u=void 0;try{for(var d=t.nodeIndexes[Symbol.iterator](),f;!(c=(f=d.next()).done);c=!0){var p=f.value,m=i(p,2),h=m[0],g=m[1],_=n.cy.getElementById(h);if(_){var v=_.boundingBox(),y=t.xCoords[g]-v.w/2,b=t.xCoords[g]+v.w/2,x=t.yCoords[g]-v.h/2,S=t.yCoords[g]+v.h/2;y<r&&(r=y),b>a&&(a=b),x<o&&(o=x),S>s&&(s=S)}}}catch(e){l=!0,u=e}finally{try{!c&&d.return&&d.return()}finally{if(l)throw u}}var C=e.x-(a+r)/2,w=e.y-(s+o)/2;t.xCoords=t.xCoords.map(function(e){return e+C}),t.yCoords=t.yCoords.map(function(e){return e+w})}else{Object.keys(t).forEach(function(e){var n=t[e],i=n.getRect().x,c=n.getRect().x+n.getRect().width,l=n.getRect().y,u=n.getRect().y+n.getRect().height;i<r&&(r=i),c>a&&(a=c),l<o&&(o=l),u>s&&(s=u)});var T=e.x-(a+r)/2,E=e.y-(s+o)/2;Object.keys(t).forEach(function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+E)})}}},o.calcBoundingBox=function(e,t,n,r){for(var i=2**53-1,a=-(2**53-1),o=2**53-1,s=-(2**53-1),c=void 0,l=void 0,u=void 0,d=void 0,f=e.descendants().not(`:parent`),p=f.length,m=0;m<p;m++){var h=f[m];c=t[r.get(h.id())]-h.width()/2,l=t[r.get(h.id())]+h.width()/2,u=n[r.get(h.id())]-h.height()/2,d=n[r.get(h.id())]+h.height()/2,i>c&&(i=c),a<l&&(a=l),o>u&&(o=u),s<d&&(s=d)}var g={};return g.topLeftX=i,g.topLeftY=o,g.width=a-i,g.height=s-o,g},o.calcParentsWithoutChildren=function(e,t){var n=e.collection();return t.nodes(`:parent`).forEach(function(e){var t=!1;e.children().forEach(function(e){e.css(`display`)!=`none`&&(t=!0)}),t||n.merge(e)}),n},e.exports=o}),816:((e,t,r)=>{var i=r(548),a=r(140).CoSELayout,o=r(140).CoSENode,s=r(140).layoutBase.PointD,c=r(140).layoutBase.DimensionD,l=r(140).layoutBase.LayoutConstants,u=r(140).layoutBase.FDLayoutConstants,d=r(140).CoSEConstants;e.exports={coseLayout:n(function(e,t){var r=e.cy,f=e.eles,p=f.nodes(),m=f.edges(),h=void 0,g=void 0,_=void 0,v={};e.randomize&&(h=t.nodeIndexes,g=t.xCoords,_=t.yCoords);var y=n(function(e){return typeof e==`function`},`isFn`),b=n(function(e,t){return y(e)?e(t):e},`optFn`),x=i.calcParentsWithoutChildren(r,f),S=n(function e(t,n,r,a){for(var l=n.length,u=0;u<l;u++){var d=n[u],f=null;d.intersection(x).length==0&&(f=d.children());var p=void 0,m=d.layoutDimensions({nodeDimensionsIncludeLabels:a.nodeDimensionsIncludeLabels});if(d.outerWidth()!=null&&d.outerHeight()!=null){if(a.randomize){if(!d.isParent())p=t.add(new o(r.graphManager,new s(g[h.get(d.id())]-m.w/2,_[h.get(d.id())]-m.h/2),new c(parseFloat(m.w),parseFloat(m.h))));else{var y=i.calcBoundingBox(d,g,_,h);p=d.intersection(x).length==0?t.add(new o(r.graphManager,new s(y.topLeftX,y.topLeftY),new c(y.width,y.height))):t.add(new o(r.graphManager,new s(y.topLeftX,y.topLeftY),new c(parseFloat(m.w),parseFloat(m.h))))}}else p=t.add(new o(r.graphManager,new s(d.position(`x`)-m.w/2,d.position(`y`)-m.h/2),new c(parseFloat(m.w),parseFloat(m.h))))}else p=t.add(new o(this.graphManager));if(p.id=d.data(`id`),p.nodeRepulsion=b(a.nodeRepulsion,d),p.paddingLeft=parseInt(d.css(`padding`)),p.paddingTop=parseInt(d.css(`padding`)),p.paddingRight=parseInt(d.css(`padding`)),p.paddingBottom=parseInt(d.css(`padding`)),a.nodeDimensionsIncludeLabels&&(p.labelWidth=d.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,p.labelHeight=d.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,p.labelPosVertical=d.css(`text-valign`),p.labelPosHorizontal=d.css(`text-halign`)),v[d.data(`id`)]=p,isNaN(p.rect.x)&&(p.rect.x=0),isNaN(p.rect.y)&&(p.rect.y=0),f!=null&&f.length>0){var S=void 0;S=r.getGraphManager().add(r.newGraph(),p),e(S,f,r,a)}}},`processChildrenList`),C=n(function(t,n,r){for(var i=0,a=0,o=0;o<r.length;o++){var s=r[o],c=v[s.data(`source`)],l=v[s.data(`target`)];if(c&&l&&c!==l&&c.getEdgesBetween(l).length==0){var f=n.add(t.newEdge(),c,l);f.id=s.id(),f.idealLength=b(e.idealEdgeLength,s),f.edgeElasticity=b(e.edgeElasticity,s),i+=f.idealLength,a++}}e.idealEdgeLength!=null&&(d.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=a>0?i/a:y(e.idealEdgeLength)?50:e.idealEdgeLength,d.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,d.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)},`processEdges`),w=n(function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)},`processConstraints`);e.nestingFactor!=null&&(d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),e.gravity!=null&&(d.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=e.gravity),e.numIter!=null&&(d.MAX_ITERATIONS=u.MAX_ITERATIONS=e.numIter),e.gravityRange!=null&&(d.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),e.gravityCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),e.gravityRangeCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),e.initialEnergyOnIncremental!=null&&(d.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),e.tilingCompareBy!=null&&(d.TILING_COMPARE_BY=e.tilingCompareBy),l.QUALITY=e.quality==`proof`?2:0,d.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,d.ANIMATE=u.ANIMATE=l.ANIMATE=e.animate,d.TILE=e.tile,d.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==`function`?e.tilingPaddingVertical.call():e.tilingPaddingVertical,d.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==`function`?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,d.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,e.step==`transformed`&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!1),e.step==`enforced`&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!1),e.step==`cose`&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!0),e.step==`all`&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!!e.randomize,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0),d.TREE_REDUCTION_ON_INCREMENTAL=!(e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint);var T=new a,E=T.newGraphManager();return S(E.addRoot(),i.getTopMostNodes(p),T,e),C(T,E,m),w(T,e),T.runLayout(),v},`coseLayout`)}}),212:((e,t,r)=>{var i=(function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return n(e,`defineProperties`),function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}})();function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}n(a,`_classCallCheck`);var o=r(658),s=r(548),c=r(657).spectralLayout,l=r(816).coseLayout,u=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:n(function(e){return 4500},`nodeRepulsion`),idealEdgeLength:n(function(e){return 50},`idealEdgeLength`),edgeElasticity:n(function(e){return .45},`edgeElasticity`),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:n(function(){},`ready`),stop:n(function(){},`stop`)});e.exports=(function(){function e(t){a(this,e),this.options=o({},u,t)}return n(e,`Layout`),i(e,[{key:`run`,value:n(function(){var e=this,t=this.options,r=t.cy,i=t.eles,a=[],o=[],u=void 0,d=[];t.fixedNodeConstraint&&(!Array.isArray(t.fixedNodeConstraint)||t.fixedNodeConstraint.length==0)&&(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(t.alignmentConstraint.vertical&&(!Array.isArray(t.alignmentConstraint.vertical)||t.alignmentConstraint.vertical.length==0)&&(t.alignmentConstraint.vertical=void 0),t.alignmentConstraint.horizontal&&(!Array.isArray(t.alignmentConstraint.horizontal)||t.alignmentConstraint.horizontal.length==0)&&(t.alignmentConstraint.horizontal=void 0)),t.relativePlacementConstraint&&(!Array.isArray(t.relativePlacementConstraint)||t.relativePlacementConstraint.length==0)&&(t.relativePlacementConstraint=void 0),(t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint)&&(t.tile=!1,t.packComponents=!1);var f=void 0,p=!1;if(r.layoutUtilities&&t.packComponents&&(f=r.layoutUtilities(`get`),f||=r.layoutUtilities(),p=!0),i.nodes().length>0){if(p){var m=s.getTopMostNodes(t.eles.nodes());if(u=s.connectComponents(r,t.eles,m),u.forEach(function(e){var t=e.boundingBox();d.push({x:t.x1+t.w/2,y:t.y1+t.h/2})}),t.randomize&&u.forEach(function(e){t.eles=e,a.push(c(t))}),t.quality=="default"||t.quality==`proof`){var h=r.collection();if(t.tile){var g=new Map,_=[],v=[],y=0,b={nodeIndexes:g,xCoords:_,yCoords:v},x=[];if(u.forEach(function(e,t){e.edges().length==0&&(e.nodes().forEach(function(t,n){h.merge(e.nodes()[n]),t.isParent()||(b.nodeIndexes.set(e.nodes()[n].id(),y++),b.xCoords.push(e.nodes()[0].position().x),b.yCoords.push(e.nodes()[0].position().y))}),x.push(t))}),h.length>1){var S=h.boundingBox();d.push({x:S.x1+S.w/2,y:S.y1+S.h/2}),u.push(h),a.push(b);for(var C=x.length-1;C>=0;C--)u.splice(x[C],1),a.splice(x[C],1),d.splice(x[C],1)}}u.forEach(function(e,n){t.eles=e,o.push(l(t,a[n])),s.relocateComponent(d[n],o[n],t)})}else u.forEach(function(e,n){s.relocateComponent(d[n],a[n],t)});var w=new Set;if(u.length>1){var T=[],E=i.filter(function(e){return e.css(`display`)==`none`});u.forEach(function(e,n){var r=void 0;if(t.quality==`draft`&&(r=a[n].nodeIndexes),e.nodes().not(E).length>0){var i={};i.edges=[],i.nodes=[];var c=void 0;e.nodes().not(E).forEach(function(e){if(t.quality==`draft`){if(!e.isParent())c=r.get(e.id()),i.nodes.push({x:a[n].xCoords[c]-e.boundingbox().w/2,y:a[n].yCoords[c]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else{var l=s.calcBoundingBox(e,a[n].xCoords,a[n].yCoords,r);i.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})}}else o[n][e.id()]&&i.nodes.push({x:o[n][e.id()].getLeft(),y:o[n][e.id()].getTop(),width:o[n][e.id()].getWidth(),height:o[n][e.id()].getHeight()})}),e.edges().forEach(function(e){var c=e.source(),l=e.target();if(c.css(`display`)!=`none`&&l.css(`display`)!=`none`){if(t.quality==`draft`){var u=r.get(c.id()),d=r.get(l.id()),f=[],p=[];if(c.isParent()){var m=s.calcBoundingBox(c,a[n].xCoords,a[n].yCoords,r);f.push(m.topLeftX+m.width/2),f.push(m.topLeftY+m.height/2)}else f.push(a[n].xCoords[u]),f.push(a[n].yCoords[u]);if(l.isParent()){var h=s.calcBoundingBox(l,a[n].xCoords,a[n].yCoords,r);p.push(h.topLeftX+h.width/2),p.push(h.topLeftY+h.height/2)}else p.push(a[n].xCoords[d]),p.push(a[n].yCoords[d]);i.edges.push({startX:f[0],startY:f[1],endX:p[0],endY:p[1]})}else o[n][c.id()]&&o[n][l.id()]&&i.edges.push({startX:o[n][c.id()].getCenterX(),startY:o[n][c.id()].getCenterY(),endX:o[n][l.id()].getCenterX(),endY:o[n][l.id()].getCenterY()})}}),i.nodes.length>0&&(T.push(i),w.add(n))}});var D=f.packComponents(T,t.randomize).shifts;if(t.quality==`draft`)a.forEach(function(e,t){var n=e.xCoords.map(function(e){return e+D[t].dx}),r=e.yCoords.map(function(e){return e+D[t].dy});e.xCoords=n,e.yCoords=r});else{var O=0;w.forEach(function(e){Object.keys(o[e]).forEach(function(t){var n=o[e][t];n.setCenter(n.getCenterX()+D[O].dx,n.getCenterY()+D[O].dy)}),O++})}}}else{var k=t.eles.boundingBox();if(d.push({x:k.x1+k.w/2,y:k.y1+k.h/2}),t.randomize){var A=c(t);a.push(A)}t.quality=="default"||t.quality==`proof`?(o.push(l(t,a[0])),s.relocateComponent(d[0],o[0],t)):s.relocateComponent(d[0],a[0],t)}}var j=n(function(e,n){if(t.quality=="default"||t.quality==`proof`){typeof e==`number`&&(e=n);var r=void 0,i=void 0,s=e.data(`id`);return o.forEach(function(e){s in e&&(r={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},i=e[s])}),t.nodeDimensionsIncludeLabels&&(i.labelWidth&&(i.labelPosHorizontal==`left`?r.x+=i.labelWidth/2:i.labelPosHorizontal==`right`&&(r.x-=i.labelWidth/2)),i.labelHeight&&(i.labelPosVertical==`top`?r.y+=i.labelHeight/2:i.labelPosVertical==`bottom`&&(r.y-=i.labelHeight/2))),r??={x:e.position(`x`),y:e.position(`y`)},{x:r.x,y:r.y}}var c=void 0;return a.forEach(function(t){var n=t.nodeIndexes.get(e.id());n!=null&&(c={x:t.xCoords[n],y:t.yCoords[n]})}),c??={x:e.position(`x`),y:e.position(`y`)},{x:c.x,y:c.y}},`getPositions`);if(t.quality=="default"||t.quality==`proof`||t.randomize){var M=s.calcParentsWithoutChildren(r,i),N=i.filter(function(e){return e.css(`display`)==`none`});t.eles=i.not(N),i.nodes().not(`:parent`).not(N).layoutPositions(e,t,j),M.length>0&&M.forEach(function(e){e.position(j(e))})}else console.log(`If randomize option is set to false, then quality option must be 'default' or 'proof'.`)},`run`)}]),e})()}),657:((e,t,r)=>{var i=r(548),a=r(140).layoutBase.Matrix,o=r(140).layoutBase.SVD;e.exports={spectralLayout:n(function(e){var t=e.cy,r=e.eles,s=r.nodes(),c=r.nodes(`:parent`),l=new Map,u=new Map,d=new Map,f=[],p=[],m=[],h=[],g=[],_=[],v=[],y=[],b=void 0,x=1e8,S=1e-9,C=e.piTol,w=e.samplingType,T=e.nodeSeparation,E=void 0,D=n(function(){for(var e=0,t=0,n=!1;t<E;){e=Math.floor(Math.random()*b),n=!1;for(var r=0;r<t;r++)if(h[r]==e){n=!0;break}if(!n)h[t]=e,t++;else continue}},`randomSampleCR`),O=n(function(e,t,n){for(var r=[],i=0,a=0,o=0,s=void 0,c=[],l=0,d=1,p=0;p<b;p++)c[p]=x;for(r[a]=e,c[e]=0;a>=i;){o=r[i++];for(var m=f[o],h=0;h<m.length;h++)s=u.get(m[h]),c[s]==x&&(c[s]=c[o]+1,r[++a]=s);_[o][t]=c[o]*T}if(n){for(var v=0;v<b;v++)_[v][t]<g[v]&&(g[v]=_[v][t]);for(var y=0;y<b;y++)g[y]>l&&(l=g[y],d=y)}return d},`BFS`),k=n(function(e){var t=void 0;if(e){t=Math.floor(Math.random()*b);for(var n=0;n<b;n++)g[n]=x;for(var r=0;r<E;r++)h[r]=t,t=O(t,r,e)}else{D();for(var i=0;i<E;i++)O(h[i],i,e,!1)}for(var a=0;a<b;a++)for(var o=0;o<E;o++)_[a][o]*=_[a][o];for(var s=0;s<E;s++)v[s]=[];for(var c=0;c<E;c++)for(var l=0;l<E;l++)v[c][l]=_[h[l]][c]},`allBFS`),A=n(function(){for(var e=o.svd(v),t=e.S,n=e.U,r=e.V,i=t[0]*t[0]*t[0],s=[],c=0;c<E;c++){s[c]=[];for(var l=0;l<E;l++)s[c][l]=0,c==l&&(s[c][l]=t[c]/(t[c]*t[c]+i/(t[c]*t[c])))}y=a.multMat(a.multMat(r,s),a.transpose(n))},`sample`),j=n(function(){for(var e=void 0,t=void 0,n=[],r=[],i=[],o=[],s=0;s<b;s++)n[s]=Math.random(),r[s]=Math.random();n=a.normalize(n),r=a.normalize(r);for(var c=0,l=S,u=S,d=void 0;;){c++;for(var f=0;f<b;f++)i[f]=n[f];if(n=a.multGamma(a.multL(a.multGamma(i),_,y)),e=a.dotProduct(i,n),n=a.normalize(n),l=a.dotProduct(i,n),d=Math.abs(l/u),d<=1+C&&d>=1)break;u=l}for(var h=0;h<b;h++)i[h]=n[h];for(c=0,u=S;;){c++;for(var g=0;g<b;g++)o[g]=r[g];if(o=a.minusOp(o,a.multCons(i,a.dotProduct(i,o))),r=a.multGamma(a.multL(a.multGamma(o),_,y)),t=a.dotProduct(o,r),r=a.normalize(r),l=a.dotProduct(o,r),d=Math.abs(l/u),d<=1+C&&d>=1)break;u=l}for(var v=0;v<b;v++)o[v]=r[v];p=a.multCons(i,Math.sqrt(Math.abs(e))),m=a.multCons(o,Math.sqrt(Math.abs(t)))},`powerIteration`);i.connectComponents(t,r,i.getTopMostNodes(s),l),c.forEach(function(e){i.connectComponents(t,r,i.getTopMostNodes(e.descendants().intersection(r)),l)});for(var M=0,N=0;N<s.length;N++)s[N].isParent()||u.set(s[N].id(),M++);var P=!0,F=!1,I=void 0;try{for(var L=l.keys()[Symbol.iterator](),R;!(P=(R=L.next()).done);P=!0){var z=R.value;u.set(z,M++)}}catch(e){F=!0,I=e}finally{try{!P&&L.return&&L.return()}finally{if(F)throw I}}for(var B=0;B<u.size;B++)f[B]=[];c.forEach(function(e){for(var t=e.children().intersection(r);t.nodes(`:childless`).length==0;)t=t.nodes()[0].children().intersection(r);var n=0,i=t.nodes(`:childless`)[0].connectedEdges().length;t.nodes(`:childless`).forEach(function(e,t){e.connectedEdges().length<i&&(i=e.connectedEdges().length,n=t)}),d.set(e.id(),t.nodes(`:childless`)[n].id())}),s.forEach(function(e){var t=void 0;t=e.isParent()?u.get(d.get(e.id())):u.get(e.id()),e.neighborhood().nodes().forEach(function(n){r.intersection(e.edgesWith(n)).length>0&&(n.isParent()?f[t].push(d.get(n.id())):f[t].push(n.id()))})});var V=n(function(e){var n=u.get(e),r=void 0;l.get(e).forEach(function(i){r=t.getElementById(i).isParent()?d.get(i):i,f[n].push(r),f[u.get(r)].push(e)})},`_loop`),H=!0,ee=!1,te=void 0;try{for(var U=l.keys()[Symbol.iterator](),ne;!(H=(ne=U.next()).done);H=!0){var re=ne.value;V(re)}}catch(e){ee=!0,te=e}finally{try{!H&&U.return&&U.return()}finally{if(ee)throw te}}b=u.size;var W=void 0;if(b>2){E=b<e.sampleSize?b:e.sampleSize;for(var G=0;G<b;G++)_[G]=[];for(var K=0;K<E;K++)y[K]=[];return e.quality==`draft`||e.step==`all`?(k(w),A(),j(),W={nodeIndexes:u,xCoords:p,yCoords:m}):(u.forEach(function(e,n){p.push(t.getElementById(n).position(`x`)),m.push(t.getElementById(n).position(`y`))}),W={nodeIndexes:u,xCoords:p,yCoords:m}),W}var ie=u.keys(),q=t.getElementById(ie.next().value),J=q.position(),ae=q.outerWidth();if(p.push(J.x),m.push(J.y),b==2){var Y=t.getElementById(ie.next().value).outerWidth();p.push(J.x+ae/2+Y/2+e.idealEdgeLength),m.push(J.y)}return W={nodeIndexes:u,xCoords:p,yCoords:m},W},`spectralLayout`)}}),579:((e,t,r)=>{var i=r(212),a=n(function(e){e&&e(`layout`,`fcose`,i)},`register`);typeof cytoscape<`u`&&a(cytoscape),e.exports=a}),140:(t=>{t.exports=e})},r={};function i(e){var n=r[e];if(n!==void 0)return n.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,i),a.exports}return n(i,`__webpack_require__`),i(579)})()})}),A={L:`left`,R:`right`,T:`top`,B:`bottom`},j={L:n(e=>`${e},${e/2} 0,${e} 0,0`,`L`),R:n(e=>`0,${e/2} ${e},0 ${e},${e}`,`R`),T:n(e=>`0,0 ${e},0 ${e/2},${e}`,`T`),B:n(e=>`${e/2},0 ${e},${e} 0,${e}`,`B`)},M={L:n((e,t)=>e-t+2,`L`),R:n((e,t)=>e-2,`R`),T:n((e,t)=>e-t+2,`T`),B:n((e,t)=>e-2,`B`)},N=n(function(e){return F(e)?e===`L`?`R`:`L`:e===`T`?`B`:`T`},`getOppositeArchitectureDirection`),P=n(function(e){let t=e;return t===`L`||t===`R`||t===`T`||t===`B`},`isArchitectureDirection`),F=n(function(e){let t=e;return t===`L`||t===`R`},`isArchitectureDirectionX`),I=n(function(e){let t=e;return t===`T`||t===`B`},`isArchitectureDirectionY`),L=n(function(e,t){let n=F(e)&&I(t),r=I(e)&&F(t);return n||r},`isArchitectureDirectionXY`),R=n(function(e){let t=e[0],n=e[1],r=F(t)&&I(n),i=I(t)&&F(n);return r||i},`isArchitecturePairXY`),z=n(function(e){return e!==`LL`&&e!==`RR`&&e!==`TT`&&e!==`BB`},`isValidArchitectureDirectionPair`),B=n(function(e,t){let n=`${e}${t}`;return z(n)?n:void 0},`getArchitectureDirectionPair`),V=n(function([e,t],n){let r=n[0],i=n[1];return F(r)?I(i)?[e+(r===`L`?-1:1),t+(i===`T`?1:-1)]:[e+(r===`L`?-1:1),t]:F(i)?[e+(i===`L`?1:-1),t+(r===`T`?1:-1)]:[e,t+(r===`T`?1:-1)]},`shiftPositionByArchitectureDirectionPair`),H=n(function(e){return e===`LT`||e===`TL`?[1,1]:e===`BL`||e===`LB`?[1,-1]:e===`BR`||e===`RB`?[-1,-1]:[-1,1]},`getArchitectureDirectionXYFactors`),ee=n(function(e,t){return L(e,t)?`bend`:F(e)?`horizontal`:`vertical`},`getArchitectureDirectionAlignment`),te=n(function(e){return e.type===`service`},`isArchitectureService`),U=n(function(e){return e.type===`junction`},`isArchitectureJunction`),ne=n((e,t)=>{let[n,r]=[e,t].sort();return`${JSON.stringify(n)}-${JSON.stringify(r)}`},`architectureGroupAlignmentKey`),re=n(e=>e.data(),`edgeData`),W=n(e=>e.data(),`nodeData`),G=h.architecture,K=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId=``,this.setAccTitle=s,this.getAccTitle=c,this.setDiagramTitle=o,this.getDiagramTitle=l,this.getAccDescription=m,this.setAccDescription=u,this.clear()}static{n(this,`ArchitectureDB`)}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId=``,f()}addService({id:e,icon:t,in:n,title:r,iconText:i}){if(this.registeredIds.has(e))throw Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)===`node`)throw Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,`node`),this.nodes.set(e,{id:e,type:`service`,icon:t,iconText:i,title:r,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(te)}addJunction({id:e,in:t}){if(this.registeredIds.has(e))throw Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(t!==void 0){if(e===t)throw Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(t))throw Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(t)===`node`)throw Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,`node`),this.nodes.set(e,{id:e,type:`junction`,edges:[],in:t})}getJunctions(){return[...this.nodes.values()].filter(U)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:t,in:n,title:r}){if(this.registeredIds.has(e))throw Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)===`node`)throw Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,`group`),this.groups.set(e,{id:e,icon:t,title:r,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:t,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:o,rhsGroup:s,title:c}){if(!P(n))throw Error(`Invalid direction given for left hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(n)}`);if(!P(r))throw Error(`Invalid direction given for right hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(r)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(t)&&!this.groups.has(t))throw Error(`The right-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);let l=this.nodes.get(e).in,u=this.nodes.get(t).in;if(o&&l&&u&&l==u)throw Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(s&&l&&u&&l==u)throw Error(`The right-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:e,lhsDir:n,lhsInto:i,lhsGroup:o,rhsId:t,rhsDir:r,rhsInto:a,rhsGroup:s,title:c};this.edges.push(d);let f=this.nodes.get(e),p=this.nodes.get(t);f&&p&&(f.edges.push(this.edges[this.edges.length-1]),p.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw Error(`An align directive requires at least two members; got ${e.members.length}`);let t=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!==`node`)throw Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(t.has(n))throw Error(`align ${e.direction} lists [${n}] more than once`);t.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let e=new Map,t=new Map;for(let[n,r]of this.nodes.entries()){let i=new Map;for(let t of r.edges){let r=this.getNode(t.lhsId)?.in,a=this.getNode(t.rhsId)?.in;if(r&&a&&r!==a){let n=ee(t.lhsDir,t.rhsDir);n!==`bend`&&e.set(ne(r,a),n)}if(t.lhsId===n){let e=B(t.lhsDir,t.rhsDir);e&&i.set(e,t.rhsId)}else{let e=B(t.rhsDir,t.lhsDir);e&&i.set(e,t.lhsId)}}t.set(n,i)}let r=new Set,i=new Set(t.keys()),a=n(e=>{let n=new Map([[e,[0,0]]]),a=[e];for(;a.length>0;){let e=a.shift();if(e){r.add(e),i.delete(e);let o=t.get(e);if(!o)throw Error(`BFS error: adjacency list for id ${e} not found. Please report this as a bug.`);let s=n.get(e);if(!s)throw Error(`BFS error: position for id ${e} not found in spatial map. Please report this as a bug.`);let[c,l]=s;o.forEach((e,t)=>{r.has(e)||(n.set(e,V([c,l],t)),a.push(e))})}}return n},`BFS`),o=[];for(;i.size>0;){let e=i.values().next().value;o.push(a(e))}this.dataStructures={adjList:t,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,t){this.elements.set(e,t)}getElementById(e){return this.elements.get(e)}getConfig(){return x({...G,...p().architecture})}getConfigField(e){return this.getConfig()[e]}},ie=n((e,t)=>{w(e,t),e.groups.map(e=>t.addGroup(e)),e.services.map(e=>t.addService({...e,type:`service`})),e.junctions.map(e=>t.addJunction({...e,type:`junction`})),e.edges.map(e=>t.addEdge(e)),e.alignments?.map(e=>t.addLayoutHint({direction:e.direction,members:[...e.members]}))},`populateDb`),q={parser:{yy:void 0},parse:n(async e=>{let t=await T(`architecture`,e);i.debug(t);let n=q.parser?.yy;if(!(n instanceof K))throw 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.`);ie(t,n)},`parse`)},J=n(e=>`
2
+ .edge {
3
+ stroke-width: ${e.archEdgeWidth};
4
+ stroke: ${e.archEdgeColor};
5
+ fill: none;
6
+ }
7
+
8
+ .arrow {
9
+ fill: ${e.archEdgeArrowColor};
10
+ }
11
+
12
+ .node-bkg {
13
+ fill: none;
14
+ stroke: ${e.archGroupBorderColor};
15
+ stroke-width: ${e.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`),ae=e(k(),1);function Y(e,t){if(e===0)return t();let n=Math.random,r=e>>>0;Math.random=function(){r=r+1831565813>>>0;let e=r;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296};try{return t()}finally{Math.random=n}}n(Y,`withSeededRandom`);var X=n(e=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${e}</g>`,`wrapIcon`),Z={prefix:`mermaid-architecture`,height:80,width:80,icons:{database:{body:X(`<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:X(`<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:X(`<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:X(`<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:X(`<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:v,blank:{body:X(``)}}},oe=n(async function(e,t,n,r){let i=n.getConfigField(`padding`),o=n.getConfigField(`iconSize`),s=o/2,c=o/6,l=c/2;await Promise.all(t.edges().map(async t=>{let{source:o,sourceDir:u,sourceArrow:d,sourceGroup:f,target:p,targetDir:m,targetArrow:h,targetGroup:g,label:_}=re(t),{x:v,y}=t[0].sourceEndpoint(),{x:b,y:x}=t[0].midpoint(),{x:w,y:T}=t[0].targetEndpoint(),E=i+4;if(f&&(F(u)?v+=u===`L`?-E:E:y+=u===`T`?-E:E+18),g&&(F(m)?w+=m===`L`?-E:E:T+=m===`T`?-E:E+18),!f&&n.getNode(o)?.type===`junction`&&(F(u)?v+=u===`L`?s:-s:y+=u===`T`?s:-s),!g&&n.getNode(p)?.type===`junction`&&(F(m)?w+=m===`L`?s:-s:T+=m===`T`?s:-s),t[0]._private.rscratch){let t=e.insert(`g`);if(t.insert(`path`).attr(`d`,`M ${v},${y} L ${b},${x} L${w},${T} `).attr(`class`,`edge`).attr(`id`,`${r}-${S(o,p,{prefix:`L`})}`),d){let e=F(u)?M[u](v,c):v-l,n=I(u)?M[u](y,c):y-l;t.insert(`polygon`).attr(`points`,j[u](c)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(h){let e=F(m)?M[m](w,c):w-l,n=I(m)?M[m](T,c):T-l;t.insert(`polygon`).attr(`points`,j[m](c)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(_){let e=L(u,m)?`XY`:F(u)?`X`:`Y`,n=0;n=e===`X`?Math.abs(v-w):e===`Y`?Math.abs(y-T)/1.5:Math.abs(v-w)/2;let r=t.append(`g`);if(await C(r,_,{useHtmlLabels:!1,width:n,classes:`architecture-service-label`},a()),r.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e===`X`)r.attr(`transform`,`translate(`+b+`, `+x+`)`);else if(e===`Y`)r.attr(`transform`,`translate(`+b+`, `+x+`) rotate(-90)`);else if(e===`XY`){let e=B(u,m);if(e&&R(e)){let t=r.node().getBoundingClientRect(),[n,i]=H(e);r.attr(`dominant-baseline`,`auto`).attr(`transform`,`rotate(${-1*n*i*45})`);let a=r.node().getBoundingClientRect();r.attr(`transform`,`
33
+ translate(${b}, ${x-t.height/2})
34
+ translate(${n*a.width/2}, ${i*a.height/2})
35
+ rotate(${-1*n*i*45}, 0, ${t.height/2})
36
+ `)}}}}}))},`drawEdges`),Q=n(async function(e,t,n,r){let i=n.getConfigField(`padding`)*.75,o=n.getConfigField(`fontSize`),s=n.getConfigField(`iconSize`)/2;await Promise.all(t.nodes().map(async t=>{let c=W(t);if(c.type===`group`){let{h:l,w:u,x1:d,y1:f}=t.boundingBox(),p=e.append(`rect`);p.attr(`id`,`${r}-group-${c.id}`).attr(`x`,d+s).attr(`y`,f+s).attr(`width`,u).attr(`height`,l).attr(`class`,`node-bkg`);let m=e.append(`g`),h=d,g=f;if(c.icon){let e=m.append(`g`);e.html(`<g>${await b(c.icon,{height:i,width:i,fallbackPrefix:Z.prefix})}</g>`),e.attr(`transform`,`translate(`+(h+s+1)+`, `+(g+s+1)+`)`),h+=i,g+=o/2-1-2}if(c.label){let e=m.append(`g`);await C(e,c.label,{useHtmlLabels:!1,width:u,classes:`architecture-service-label`},a()),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`start`).attr(`text-anchor`,`start`),e.attr(`transform`,`translate(`+(h+s+4)+`, `+(g+s+2)+`)`)}n.setElementForId(c.id,p)}}))},`drawGroups`),se=n(async function(e,t,n,r){let i=a();for(let a of n){let n=t.append(`g`),o=e.getConfigField(`iconSize`);if(a.title){let e=n.append(`g`);await C(e,a.title,{useHtmlLabels:!1,width:o*1.5,classes:`architecture-service-label`},i),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e.attr(`transform`,`translate(`+o/2+`, `+o+`)`)}let s=n.append(`g`);if(a.icon)s.html(`<g>${await b(a.icon,{height:o,width:o,fallbackPrefix:Z.prefix})}</g>`);else if(a.iconText){s.html(`<g>${await b(`blank`,{height:o,width:o,fallbackPrefix:Z.prefix})}</g>`);let e=s.append(`g`).append(`foreignObject`).attr(`width`,o).attr(`height`,o).append(`div`).attr(`class`,`node-icon-text`).attr(`style`,`height: ${o}px;`).append(`div`).html(g(a.iconText,i)),t=parseInt(window.getComputedStyle(e.node(),null).getPropertyValue(`font-size`).replace(/\D/g,``))??16;e.attr(`style`,`-webkit-line-clamp: ${Math.floor((o-2)/t)};`)}else s.append(`path`).attr(`class`,`node-bkg`).attr(`id`,`${r}-node-${a.id}`).attr(`d`,`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);n.attr(`id`,`${r}-service-${a.id}`).attr(`class`,`architecture-service`);let{width:c,height:l}=n.node().getBBox();a.width=c,a.height=l,e.setElementForId(a.id,n)}return 0},`drawServices`),ce=n(function(e,t,n,r){n.forEach(n=>{let i=t.append(`g`),a=e.getConfigField(`iconSize`);i.append(`g`).append(`rect`).attr(`id`,`${r}-node-${n.id}`).attr(`fill-opacity`,`0`).attr(`width`,a).attr(`height`,a),i.attr(`class`,`architecture-junction`);let{width:o,height:s}=i._groups[0][0].getBBox();i.width=o,i.height=s,e.setElementForId(n.id,i)})},`drawJunctions`);y([{name:Z.prefix,icons:Z}]),E.use(ae.default);function le(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`service`,id:e.id,icon:e.icon,label:e.title,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-service`})})}n(le,`addServices`);function ue(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`junction`,id:e.id,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-junction`})})}n(ue,`addJunctions`);function de(e,t){t.nodes().map(t=>{let n=W(t);n.type!==`group`&&(n.x=t.position().x,n.y=t.position().y,e.getElementById(n.id).attr(`transform`,`translate(`+(n.x||0)+`,`+(n.y||0)+`)`))})}n(de,`positionNodes`);function fe(e,t){e.forEach(e=>{t.add({group:`nodes`,data:{type:`group`,id:e.id,icon:e.icon,label:e.title,parent:e.in},classes:`node-group`})})}n(fe,`addGroups`);function pe(e,t){e.forEach(e=>{let{lhsId:n,rhsId:r,lhsInto:i,lhsGroup:a,rhsInto:o,lhsDir:s,rhsDir:c,rhsGroup:l,title:u}=e,d=L(e.lhsDir,e.rhsDir)?`segments`:`straight`,f={id:`${n}-${r}`,label:u,source:n,sourceDir:s,sourceArrow:i,sourceGroup:a,sourceEndpoint:s===`L`?`0 50%`:s===`R`?`100% 50%`:s===`T`?`50% 0`:`50% 100%`,target:r,targetDir:c,targetArrow:o,targetGroup:l,targetEndpoint:c===`L`?`0 50%`:c===`R`?`100% 50%`:c===`T`?`50% 0`:`50% 100%`};t.add({group:`edges`,data:f,classes:d})})}n(pe,`addEdges`);function me(e,t,r,i=[]){let a=n((e,t)=>{let n=new Map;for(let[i,a]of e.entries()){let e=`${i}`,o=0,s=[...a.entries()];if(s.length===1){n.set(e,s[0][1]);continue}for(let i=0;i<s.length-1;i++)for(let a=i+1;a<s.length;a++){let[c,l]=s[i],[u,d]=s[a];if(r.get(ne(c,u))===t)n.set(e,[...n.get(e)??[],...l,...d]);else if(c==="default"||u==="default")n.set(e,[...n.get(e)??[],...l,...d]);else{let t=`${e}-${o++}`;n.set(t,l);let r=`${e}-${o++}`;n.set(r,d)}}}return n},`flattenAlignments`),[o,s]=t.map(t=>{let n=new Map,r=new Map;return t.forEach(([t,i],a)=>{let o=e.getNode(a)?.in??`default`,s=n.get(i)??new Map;n.has(i)||n.set(i,s);let c=r.get(t)??new Map;r.has(t)||r.set(t,c);for(let e of[s,c]){let t=e.get(o)??[];e.has(o)||e.set(o,t),t.push(a)}}),{horiz:[...a(n,`horizontal`).values()].filter(e=>e.length>1),vert:[...a(r,`vertical`).values()].filter(e=>e.length>1)}}).reduce(([e,t],{horiz:n,vert:r})=>[[...e,...n],[...t,...r]],[[],[]]),c=new Set;i.forEach(e=>e.members.forEach(e=>c.add(e)));let l=n(e=>e.filter(e=>!e.some(e=>c.has(e))),`dropOverlapping`),u=l(o),d=l(s);return i.forEach(e=>{e.members.length<2||(e.direction===`row`?u.push([...e.members]):d.push([...e.members]))}),{horizontal:u,vertical:d}}n(me,`getAlignments`);function he(e,t,r=[]){let i=[],a=t.getConfigField(`iconSize`),o=t.getConfigField(`idealEdgeLengthMultiplier`),s=o*a,c=new Set;r.forEach(e=>{for(let t=0;t<e.members.length-1;t++){let n=e.members[t],r=e.members[t+1];c.add(`${n}|${r}`),c.add(`${r}|${n}`),e.direction===`row`?i.push({left:n,right:r,gap:s}):i.push({top:n,bottom:r,gap:s})}});let l=n(e=>`${e[0]},${e[1]}`,`posToStr`),u=n(e=>e.split(`,`).map(e=>parseInt(e)),`strToPos`);return e.forEach(e=>{let t=new Map([...e.entries()].map(([e,t])=>[l(t),e])),n=[l([0,0])],r={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;n.length>0;){let e=n.shift();if(e){r[e]=1;let d=t.get(e);if(d){let f=u(e);Object.entries(s).forEach(([e,s])=>{let u=l([f[0]+s[0],f[1]+s[1]]),p=t.get(u);if(p&&!r[u]){if(n.push(u),c.has(`${d}|${p}`))return;i.push({[A[e]]:p,[A[N(e)]]:d,gap:o*a})}})}}}}),i}n(he,`getRelativeConstraints`);function ge(e,t,a,o,s,{spatialMaps:c,groupAlignments:l}){return new Promise(u=>{let d=r(`body`).append(`div`).attr(`id`,`cy`).attr(`style`,`display:none`),f=E({container:document.getElementById(`cy`),style:[{selector:`edge`,style:{"curve-style":`straight`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`edge[label]`,style:{label:`data(label)`}},{selector:`edge.segments`,style:{"curve-style":`segments`,"segment-weights":`0`,"segment-distances":[.5],"edge-distances":`endpoints`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`node`,style:{"compound-sizing-wrt-labels":`include`}},{selector:`node[label]`,style:{"text-valign":`bottom`,"text-halign":`center`,"font-size":`${s.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:`${s.getConfigField(`padding`)}px`}}],layout:{name:`grid`,boundingBox:{x1:0,x2:100,y1:0,y2:100}}});d.remove(),fe(a,f),le(e,f,s),ue(t,f,s),pe(o,f);let p=s.getLayoutHints(),m=me(s,c,l,p),h=he(c,s,p),g=s.getConfigField(`iconSize`),_=s.getConfigField(`idealEdgeLengthMultiplier`)*g,v=.5*g,y=s.getConfigField(`edgeElasticity`),b=s.getConfigField(`seed`),x=f.layout({name:`fcose`,quality:`proof`,randomize:s.getConfigField(`randomize`),nodeSeparation:s.getConfigField(`nodeSeparation`),numIter:s.getConfigField(`numIter`),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(e){let[t,n]=e.connectedNodes(),{parent:r}=W(t),{parent:i}=W(n);return r===i?_:v},edgeElasticity(e){let[t,n]=e.connectedNodes(),{parent:r}=W(t),{parent:i}=W(n);return r===i?y:.001},alignmentConstraint:m,relativePlacementConstraint:h});x.one(`layoutstop`,()=>{function e(e,t,n,r){let i,a,{x:o,y:s}=e,{x:c,y:l}=t;a=(r-s+(o-n)*(s-l)/(o-c))/Math.sqrt(1+((s-l)/(o-c))**2),i=Math.sqrt((r-s)**2+(n-o)**2-a**2);let u=Math.sqrt((c-o)**2+(l-s)**2);i/=u;let d=(c-o)*(r-s)-(l-s)*(n-o);switch(!0){case d>=0:d=1;break;case d<0:d=-1}let f=(c-o)*(n-o)+(l-s)*(r-s);switch(!0){case f>=0:f=1;break;case f<0:f=-1}return a=Math.abs(a)*d,i*=f,{distances:a,weights:i}}n(e,`getSegmentWeights`),f.startBatch();for(let t of Object.values(f.edges()))if(t.data?.()){let{x:n,y:r}=t.source().position(),{x:i,y:a}=t.target().position();if(n!==i&&r!==a){let n=t.sourceEndpoint(),r=t.targetEndpoint(),{sourceDir:i}=re(t),[a,o]=I(i)?[n.x,r.y]:[r.x,n.y],{weights:s,distances:c}=e(n,r,a,o);t.style(`segment-distances`,c),t.style(`segment-weights`,s)}}f.endBatch(),Y(b,()=>x.run())});try{Y(b,()=>x.run())}catch(e){throw e instanceof RangeError&&e.message.includes(`Invalid array length`)?Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):e}f.ready(e=>{i.info(`Ready`,e),u(f)})})}n(ge,`layoutArchitecture`);var _e={parser:q,get db(){return new K},renderer:{draw:n(async(e,t,n,r)=>{let i=r.db;i.setDiagramId(t);let a=i.getServices(),o=i.getJunctions(),s=i.getGroups(),c=i.getEdges(),l=i.getDataStructures(),u=_(t),f=u.append(`g`);f.attr(`class`,`architecture-edges`);let p=u.append(`g`);p.attr(`class`,`architecture-services`);let m=u.append(`g`);m.attr(`class`,`architecture-groups`),await se(i,p,a,t),ce(i,p,o,t);let h=await ge(a,o,s,c,i,l);await oe(f,h,i,t),await Q(m,h,i,t),de(i,h),d(void 0,u,i.getConfigField(`padding`),i.getConfigField(`useMaxWidth`))},`draw`)},styles:J};export{_e as diagram};
@@ -0,0 +1,129 @@
1
+ import{t as e}from"./chunk-AQ6EADP3-CZhslHi-.js";import{V as t,q as n}from"./chunk-H7VHZCWX-CwFRFlEn.js";import{B as r,O as i,R as a,S as o,b as s,h as c,l}from"./chunk-QJSWEUOL-kvKBktmc.js";import{o as u}from"./chunk-4CAJECRU-C_QnaDal.js";import"./chunk-5IMINLNL-Cl3N81sR.js";import"./chunk-ZNLK7HRR-B-wIfXTw.js";import"./chunk-2NMSUPJH-DuxvnX1p.js";import"./chunk-STOV2HOB-GnExfzIX.js";import{_ as d,f}from"./chunk-VY2OSTJR-BYk2nUI_.js";import"./chunk-DZP67EKU-9RpG5Rdc.js";import"./chunk-Z6V44ARX-CWGOZvke.js";import{a as p,r as m}from"./chunk-VRZKL3EH-BzaZ6KlD.js";import{a as h,c as g,r as _,s as v}from"./chunk-4OADUZ5Q-DHE3k_pb.js";import{t as y}from"./chunk-AZZRMDJM-y-xJBuMz.js";var b=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),this.$=typeof a[s].length==`number`?a[s]:[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()}}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,typeof h.yylloc>`u`&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e;return e=i.pop()||h.lex()||p,typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:((S===null||typeof S>`u`)&&(S=x()),T=s[w]&&s[w][S]),typeof T>`u`||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
+ `+h.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),typeof E<`u`)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};_.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:e(function(e,t,n,r){switch(n){case 0:return e.getLogger().debug(`Found block-beta`),10;case 1:return e.getLogger().debug(`Found id-block`),29;case 2:return e.getLogger().debug(`Found block`),10;case 3:e.getLogger().debug(`.`,t.yytext);break;case 4:e.getLogger().debug(`_`,t.yytext);break;case 5:return 5;case 6:return t.yytext=-1,28;case 7:return t.yytext=t.yytext.replace(/columns\s+/,``),e.getLogger().debug(`COLUMNS (LEX)`,t.yytext),28;case 8:this.pushState(`md_string`);break;case 9:return`MD_STR`;case 10:this.popState();break;case 11:this.pushState(`string`);break;case 12:e.getLogger().debug(`LEX: POPPING STR:`,t.yytext),this.popState();break;case 13:return e.getLogger().debug(`LEX: STR end:`,t.yytext),`STR`;case 14:return t.yytext=t.yytext.replace(/space\:/,``),e.getLogger().debug(`SPACE NUM (LEX)`,t.yytext),21;case 15:return t.yytext=`1`,e.getLogger().debug(`COLUMNS (LEX)`,t.yytext),21;case 16:return 42;case 17:return`LINKSTYLE`;case 18:return`INTERPOLATE`;case 19:return this.pushState(`CLASSDEF`),39;case 20:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 21:return this.popState(),this.pushState(`CLASSDEFID`),40;case 22:return this.popState(),41;case 23:return this.pushState(`CLASS`),43;case 24:return this.popState(),this.pushState(`CLASS_STYLE`),44;case 25:return this.popState(),45;case 26:return this.pushState(`STYLE_STMNT`),46;case 27:return this.popState(),this.pushState(`STYLE_DEFINITION`),47;case 28:return this.popState(),48;case 29:return this.pushState(`acc_title`),`acc_title`;case 30:return this.popState(),`acc_title_value`;case 31:return this.pushState(`acc_descr`),`acc_descr`;case 32:return this.popState(),`acc_descr_value`;case 33:this.pushState(`acc_descr_multiline`);break;case 34:this.popState();break;case 35:return`acc_descr_multiline_value`;case 36:return 30;case 37:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().debug(`Lex: ))`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 41:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 42:return this.popState(),e.getLogger().debug(`Lex: (-`),`NODE_DEND`;case 43:return this.popState(),e.getLogger().debug(`Lex: -)`),`NODE_DEND`;case 44:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 45:return this.popState(),e.getLogger().debug(`Lex: ]]`),`NODE_DEND`;case 46:return this.popState(),e.getLogger().debug(`Lex: (`),`NODE_DEND`;case 47:return this.popState(),e.getLogger().debug(`Lex: ])`),`NODE_DEND`;case 48:return this.popState(),e.getLogger().debug(`Lex: /]`),`NODE_DEND`;case 49:return this.popState(),e.getLogger().debug(`Lex: /]`),`NODE_DEND`;case 50:return this.popState(),e.getLogger().debug(`Lex: )]`),`NODE_DEND`;case 51:return this.popState(),e.getLogger().debug(`Lex: )`),`NODE_DEND`;case 52:return this.popState(),e.getLogger().debug(`Lex: ]>`),`NODE_DEND`;case 53:return this.popState(),e.getLogger().debug(`Lex: ]`),`NODE_DEND`;case 54:return e.getLogger().debug(`Lexa: -)`),this.pushState(`NODE`),35;case 55:return e.getLogger().debug(`Lexa: (-`),this.pushState(`NODE`),35;case 56:return e.getLogger().debug(`Lexa: ))`),this.pushState(`NODE`),35;case 57:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 58:return e.getLogger().debug(`Lex: (((`),this.pushState(`NODE`),35;case 59:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 60:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 61:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 62:return e.getLogger().debug(`Lexc: >`),this.pushState(`NODE`),35;case 63:return e.getLogger().debug(`Lexa: ([`),this.pushState(`NODE`),35;case 64:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 65:return this.pushState(`NODE`),35;case 66:return this.pushState(`NODE`),35;case 67:return this.pushState(`NODE`),35;case 68:return this.pushState(`NODE`),35;case 69:return this.pushState(`NODE`),35;case 70:return this.pushState(`NODE`),35;case 71:return this.pushState(`NODE`),35;case 72:return e.getLogger().debug(`Lexa: [`),this.pushState(`NODE`),35;case 73:return this.pushState(`BLOCK_ARROW`),e.getLogger().debug(`LEX ARR START`),37;case 74:return e.getLogger().debug(`Lex: NODE_ID`,t.yytext),31;case 75:return e.getLogger().debug(`Lex: EOF`,t.yytext),8;case 76:this.pushState(`md_string`);break;case 77:this.pushState(`md_string`);break;case 78:return`NODE_DESCR`;case 79:this.popState();break;case 80:e.getLogger().debug(`Lex: Starting string`),this.pushState(`string`);break;case 81:e.getLogger().debug(`LEX ARR: Starting string`),this.pushState(`string`);break;case 82:return e.getLogger().debug(`LEX: NODE_DESCR:`,t.yytext),`NODE_DESCR`;case 83:e.getLogger().debug(`LEX POPPING`),this.popState();break;case 84:e.getLogger().debug(`Lex: =>BAE`),this.pushState(`ARROW_DIR`);break;case 85:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (right): dir:`,t.yytext),`DIR`;case 86:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (left):`,t.yytext),`DIR`;case 87:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (x):`,t.yytext),`DIR`;case 88:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (y):`,t.yytext),`DIR`;case 89:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (up):`,t.yytext),`DIR`;case 90:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (down):`,t.yytext),`DIR`;case 91:return t.yytext=`]>`,e.getLogger().debug(`Lex (ARROW_DIR end):`,t.yytext),this.popState(),this.popState(),`BLOCK_ARROW_END`;case 92:return e.getLogger().debug(`Lex: LINK`,`#`+t.yytext+`#`),15;case 93:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 94:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 95:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 96:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 97:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 98:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 99:this.pushState(`md_string`);break;case 100:return e.getLogger().debug(`Lex: Starting string`),this.pushState(`string`),`LINK_LABEL`;case 101:return this.popState(),e.getLogger().debug(`Lex: LINK`,`#`+t.yytext+`#`),15;case 102:return this.popState(),e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 103:return this.popState(),e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 104:return e.getLogger().debug(`Lex: COLON`,t.yytext),t.yytext=t.yytext.slice(1),27}},`anonymous`),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}}})();function v(){this.yy={}}return e(v,`Parser`),v.prototype=_,_.Parser=v,new v})();b.parser=b;var x=b,S=new Map,C=[],w=new Map,T=`color`,E=`fill`,D=`bgFill`,O=`,`,k=new Map,A=``,j=e(e=>a.sanitizeText(e,r()),`sanitizeText`),M=e(function(e,t=``){let n=k.get(e);n||(n={id:e,styles:[],textStyles:[]},k.set(e,n)),t?.split(O).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(T).exec(e)){let e=t.replace(E,D).replace(T,E);n.textStyles.push(e)}n.styles.push(t)})},`addStyleClass`),ee=e(function(e,t=``){let n=S.get(e);t!=null&&(n.styles=t.split(O))},`addStyle2Node`),te=e(function(e,t){e.split(`,`).forEach(function(e){let n=S.get(e);if(n===void 0){let t=e.trim();n={id:t,type:`na`,children:[]},S.set(t,n)}n.classes||(n.classes=[]),n.classes.push(t)})},`setCssClass`),N=e((e,t)=>{let r=e.flat(),i=[],a=r.find(e=>e?.type===`column-setting`)?.columns??-1;for(let e of r){if(typeof a==`number`&&a>0&&e.type!==`column-setting`&&typeof e.widthInColumns==`number`&&e.widthInColumns>a&&n.warn(`Block ${e.id} width ${e.widthInColumns} exceeds configured column width ${a}`),e.label&&=j(e.label),e.type===`classDef`){M(e.id,e.css);continue}if(e.type===`applyClass`){te(e.id,e?.styleClass??``);continue}if(e.type===`applyStyles`){e?.stylesStr&&ee(e.id,e?.stylesStr);continue}if(e.type===`column-setting`)t.columns=e.columns??-1;else if(e.type===`edge`){let t=(w.get(e.id)??0)+1;w.set(e.id,t),e.id=t+`-`+e.id,C.push(e)}else{e.label||=e.type===`composite`?``:e.id;let t=S.get(e.id);if(t===void 0?S.set(e.id,e):(e.type!==`na`&&(t.type=e.type),e.label!==e.id&&(t.label=e.label)),e.children&&N(e.children,e),e.type===`space`){let t=e.width??1;for(let n=0;n<t;n++){let t=d(e);t.id=t.id+`-`+n,S.set(t.id,t),i.push(t)}}else t===void 0&&i.push(e)}}t.children=i},`populateBlockDatabase`),P=[],F={id:`root`,type:`composite`,children:[],columns:-1},ne=e(()=>{n.debug(`Clear called`),c(),F={id:`root`,type:`composite`,children:[],columns:-1},S=new Map([[`root`,F]]),P=[],k=new Map,C=[],w=new Map,A=``},`clear`);function I(e){switch(n.debug(`typeStr2Type`,e),e){case`[]`:return`square`;case`()`:return n.debug(`we have a round`),`round`;case`(())`:return`circle`;case`>]`:return`rect_left_inv_arrow`;case`{}`:return`diamond`;case`{{}}`:return`hexagon`;case`([])`:return`stadium`;case`[[]]`:return`subroutine`;case`[()]`:return`cylinder`;case`((()))`:return`doublecircle`;case`[//]`:return`lean_right`;case`[\\\\]`:return`lean_left`;case`[/\\]`:return`trapezoid`;case`[\\/]`:return`inv_trapezoid`;case`<[]>`:return`block_arrow`;default:return`na`}}e(I,`typeStr2Type`);function L(e){switch(n.debug(`typeStr2Type`,e),e){case`==`:return`thick`;default:return`normal`}}e(L,`edgeTypeStr2Type`);function R(e){switch(e.trim().slice(-1)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`>`:return`arrow_point`;default:return``}}e(R,`edgeStrToEdgeData`);function z(e){switch(e.trim().charAt(0)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`<`:return`arrow_point`;default:return`arrow_open`}}e(z,`edgeStrToEdgeStartData`);function B(e){return e.includes(`==`)?`thick`:`normal`}e(B,`edgeStrToThickness`);function V(e){return e.includes(`.-`)?`dotted`:`solid`}e(V,`edgeStrToPattern`);var H=0,re=e(()=>(H++,`id-`+Math.random().toString(36).substr(2,12)+`-`+H),`generateId`),ie=e(e=>{F.children=e,N(e,F),P=F.children},`setHierarchy`),ae=e(e=>{let t=S.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},`getColumns`),oe=e(()=>[...S.values()],`getBlocksFlat`),se=e(()=>P||[],`getBlocks`),ce=e(()=>C,`getEdges`),le=e(e=>S.get(e),`getBlock`),ue=e(e=>{S.set(e.id,e)},`setBlock`),de=e(e=>{A=e},`setDiagramId`),fe=e(()=>A,`getDiagramId`),pe=e(()=>n,`getLogger`),me=e(function(){return k},`getClasses`),he={getConfig:e(()=>l().block,`getConfig`),typeStr2Type:I,edgeTypeStr2Type:L,edgeStrToEdgeData:R,edgeStrToEdgeStartData:z,edgeStrToThickness:B,edgeStrToPattern:V,getLogger:pe,getBlocksFlat:oe,getBlocks:se,getEdges:ce,setHierarchy:ie,getBlock:le,setBlock:ue,getColumns:ae,getClasses:me,clear:ne,generateId:re,setDiagramId:de,getDiagramId:fe},U=e((e,t)=>{let n=o,r=n(e,`r`),i=n(e,`g`),a=n(e,`b`);return s(r,i,a,t)},`fade`),ge=e(e=>`.label {
7
+ font-family: ${e.fontFamily};
8
+ color: ${e.nodeTextColor||e.textColor};
9
+ }
10
+ .cluster-label text {
11
+ fill: ${e.titleColor};
12
+ }
13
+ .cluster-label span {
14
+ color: ${e.titleColor};
15
+ }
16
+
17
+
18
+
19
+ .label text,span {
20
+ fill: ${e.nodeTextColor||e.textColor};
21
+ color: ${e.nodeTextColor||e.textColor};
22
+ }
23
+
24
+ .node rect,
25
+ .node circle,
26
+ .node ellipse,
27
+ .node polygon,
28
+ .node path {
29
+ fill: ${e.mainBkg};
30
+ stroke: ${e.nodeBorder};
31
+ stroke-width: 1px;
32
+ }
33
+ .flowchart-label text {
34
+ text-anchor: middle;
35
+ }
36
+ // .flowchart-label .text-outer-tspan {
37
+ // text-anchor: middle;
38
+ // }
39
+ // .flowchart-label .text-inner-tspan {
40
+ // text-anchor: start;
41
+ // }
42
+
43
+ .node .label {
44
+ text-align: center;
45
+ }
46
+ .node.clickable {
47
+ cursor: pointer;
48
+ }
49
+
50
+ .arrowheadPath {
51
+ fill: ${e.arrowheadColor};
52
+ }
53
+
54
+ .edgePaths .path {
55
+ stroke: ${e.lineColor};
56
+ stroke-width: 2.0px;
57
+ }
58
+
59
+ .flowchart-link {
60
+ stroke: ${e.lineColor};
61
+ fill: none;
62
+ }
63
+
64
+ .edgeLabel {
65
+ background-color: ${e.edgeLabelBackground};
66
+ /*
67
+ * This is for backward compatibility with existing code that didn't
68
+ * add a \`<p>\` around edge labels.
69
+ *
70
+ * TODO: We should probably remove this in a future release.
71
+ */
72
+ p {
73
+ margin: 0;
74
+ padding: 0;
75
+ display: inline;
76
+ }
77
+ rect {
78
+ opacity: 0.5;
79
+ background-color: ${e.edgeLabelBackground};
80
+ fill: ${e.edgeLabelBackground};
81
+ }
82
+ text-align: center;
83
+ }
84
+
85
+ /* For html labels only */
86
+ .labelBkg {
87
+ background-color: ${e.edgeLabelBackground};
88
+ }
89
+
90
+ .node .cluster {
91
+ // fill: ${U(e.mainBkg,.5)};
92
+ fill: ${U(e.clusterBkg,.5)};
93
+ stroke: ${U(e.clusterBorder,.2)};
94
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
95
+ stroke-width: 1px;
96
+ }
97
+
98
+ .cluster text {
99
+ fill: ${e.titleColor};
100
+ }
101
+
102
+ .cluster span {
103
+ color: ${e.titleColor};
104
+ }
105
+ /* .cluster div {
106
+ color: ${e.titleColor};
107
+ } */
108
+
109
+ div.mermaidTooltip {
110
+ position: absolute;
111
+ text-align: center;
112
+ max-width: 200px;
113
+ padding: 2px;
114
+ font-family: ${e.fontFamily};
115
+ font-size: 12px;
116
+ background: ${e.tertiaryColor};
117
+ border: 1px solid ${e.border2};
118
+ border-radius: 2px;
119
+ pointer-events: none;
120
+ z-index: 100;
121
+ }
122
+
123
+ .flowchartTitleText {
124
+ text-anchor: middle;
125
+ font-size: 18px;
126
+ fill: ${e.textColor};
127
+ }
128
+ ${y()}
129
+ `,`getStyles`);function W(e,t){if(e===0||!Number.isInteger(e))throw Error(`Columns must be an integer !== 0.`);if(t<0||!Number.isInteger(t))throw Error(`Position must be a non-negative integer.`+t);return e<0?{px:t,py:0}:e===1?{px:0,py:t}:{px:t%e,py:Math.floor(t/e)}}e(W,`calculateBlockPosition`);var _e=e(e=>{let t=0,r=0;for(let i of e.children){let{width:e,height:a,x:o,y:s}=i.size??{width:0,height:0,x:0,y:0};if(n.debug(`getMaxChildSize abc95 child:`,i.id,`width:`,e,`height:`,a,`x:`,o,`y:`,s,i.type),i.type===`space`)continue;let c=e/(i.widthInColumns??1);c>t&&(t=c),a>r&&(r=a)}return{width:t,height:r}},`getMaxChildSize`);function G(e,t,r=0,i=0,a=8){n.debug(`setBlockSizes abc95 (start)`,e.id,e?.size?.x,`block width =`,e?.size,`siblingWidth`,r),e?.size?.width||(e.size={width:r,height:i,x:0,y:0});let o=0,s=0;if(e.children?.length>0){for(let n of e.children)G(n,t,0,0,a);let c=_e(e);o=c.width,s=c.height,n.debug(`setBlockSizes abc95 maxWidth of`,e.id,`:s children is `,o,s);for(let t of e.children)t.size&&(n.debug(`abc95 Setting size of children of ${e.id} id=${t.id} ${o} ${s} ${JSON.stringify(t.size)}`),t.size.width=o*(t.widthInColumns??1)+a*((t.widthInColumns??1)-1),t.size.height=s,t.size.x=0,t.size.y=0,n.debug(`abc95 updating size of ${e.id} children child:${t.id} maxWidth:${o} maxHeight:${s}`));for(let n of e.children)G(n,t,o,s,a);let l=e.columns??-1,u=0;for(let t of e.children)u+=t.widthInColumns??1;let d=e.children.length;l>0&&l<u&&(d=l);let f=Math.ceil(u/d),p=d*(o+a)+a,m=f*(s+a)+a;if(p<r){n.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${r} siblingHeight ${i} width ${p}`),p=r,m=i;let t=(r-d*a-a)/d,c=(i-f*a-a)/f;n.debug(`Size indata abc88`,e.id,`childWidth`,t,`maxWidth`,o),n.debug(`Size indata abc88`,e.id,`childHeight`,c,`maxHeight`,s),n.debug(`Size indata abc88 xSize`,d,`padding`,a);for(let n of e.children)n.size&&(n.size.width=t,n.size.height=c,n.size.x=0,n.size.y=0)}if(n.debug(`abc95 (finale calc) ${e.id} xSize ${d} ySize ${f} columns ${l}${e.children.length} width=${Math.max(p,e.size?.width||0)}`),p<(e?.size?.width||0)){p=e?.size?.width||0;let t=l>0?Math.min(e.children.length,l):e.children.length;if(t>0){let r=(p-t*a-a)/t;n.debug(`abc95 (growing to fit) width`,e.id,p,e.size?.width,r);for(let t of e.children)t.size&&(t.size.width=r)}}e.size={width:p,height:m,x:0,y:0}}n.debug(`setBlockSizes abc94 (done)`,e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}e(G,`setBlockSizes`);function K(e,t,r=8){n.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);let i=e.columns??-1;if(n.debug(`layoutBlocks columns abc95`,e.id,`=>`,i,e),e.children&&e.children.length>0){let a=e?.children[0]?.size?.width??0,o=e.children.length*a+(e.children.length-1)*r;n.debug(`widthOfChildren 88`,o,`posX`);let s=new Map;{let t=0;for(let n of e.children){if(!n.size)continue;let{py:e}=W(i,t),r=s.get(e)??0;n.size.height>r&&s.set(e,n.size.height);let a=n?.widthInColumns??1;i>0&&(a=Math.min(a,i-t%i)),t+=a}}let c=new Map;{let e=0,t=[...s.keys()].sort((e,t)=>e-t);for(let n of t)c.set(n,e),e+=(s.get(n)??0)+r}let l=0;n.debug(`abc91 block?.size?.x`,e.id,e?.size?.x);let u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,d=0;for(let a of e.children){let o=e;if(!a.size)continue;let{width:f,height:p}=a.size,{px:m,py:h}=W(i,l);if(h!=d&&(d=h,u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,n.debug(`New row in layout for block`,e.id,` and child `,a.id,d)),n.debug(`abc89 layout blocks (child) id: ${a.id} Pos: ${l} (px, py) ${m},${h} (${o?.size?.x},${o?.size?.y}) parent: ${o.id} width: ${f}${r}`),o.size){let e=f/2;a.size.x=u+r+e,n.debug(`abc91 layout blocks (calc) px, pyid:${a.id} startingPos=X${u} new startingPosX${a.size.x} ${e} padding=${r} width=${f} halfWidth=${e} => x:${a.size.x} y:${a.size.y} ${a.widthInColumns} (width * (child?.w || 1)) / 2 ${f*(a?.widthInColumns??1)/2}`),u=a.size.x+e;let t=c.get(h)??0,i=s.get(h)??p;a.size.y=o.size.y-o.size.height/2+t+i/2+r,n.debug(`abc88 layout blocks (calc) px, pyid:${a.id}startingPosX${u}${r}${e}=>x:${a.size.x}y:${a.size.y}${a.widthInColumns}(width * (child?.w || 1)) / 2${f*(a?.widthInColumns??1)/2}`)}a.children&&K(a,t,r);let g=a?.widthInColumns??1;i>0&&(g=Math.min(g,i-l%i)),l+=g,n.debug(`abc88 columnsPos`,a,l)}}n.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}e(K,`layoutBlocks`);function q(e,{minX:t,minY:n,maxX:r,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!==`root`){let{x:a,y:o,width:s,height:c}=e.size;a-s/2<t&&(t=a-s/2),o-c/2<n&&(n=o-c/2),a+s/2>r&&(r=a+s/2),o+c/2>i&&(i=o+c/2)}if(e.children)for(let a of e.children)({minX:t,minY:n,maxX:r,maxY:i}=q(a,{minX:t,minY:n,maxX:r,maxY:i}));return{minX:t,minY:n,maxX:r,maxY:i}}e(q,`findBounds`);function J(e){let t=e.getBlock(`root`);if(!t)return;let i=r()?.block?.padding??8;G(t,e,0,0,i),K(t,e,i),n.debug(`getBlocks`,JSON.stringify(t,null,2));let{minX:a,minY:o,maxX:s,maxY:c}=q(t),l=c-o;return{x:a,y:o,width:s-a,height:l}}e(J,`layout`);function Y(e,t,n=!1){let r=e,i=`default`;(r?.classes?.length||0)>0&&(i=(r?.classes??[]).join(` `)),i+=` flowchart-label`;let a=(r?.classes??[]).flatMap(e=>t.getClasses().get(e)?.styles??[]),o=0,s=`rect`,c;switch(r.type){case`round`:o=5,s=`rect`;break;case`composite`:o=0,s=`composite`,c=0;break;case`square`:s=`rect`;break;case`diamond`:s=`question`;break;case`hexagon`:s=`hexagon`;break;case`block_arrow`:s=`block_arrow`;break;case`odd`:s=`rect_left_inv_arrow`;break;case`lean_right`:s=`lean_right`;break;case`lean_left`:s=`lean_left`;break;case`trapezoid`:s=`trapezoid`;break;case`inv_trapezoid`:s=`inv_trapezoid`;break;case`rect_left_inv_arrow`:s=`rect_left_inv_arrow`;break;case`circle`:s=`circle`;break;case`ellipse`:s=`ellipse`;break;case`stadium`:s=`stadium`;break;case`subroutine`:s=`subroutine`;break;case`cylinder`:s=`cylinder`;break;case`group`:s=`rect`;break;case`doublecircle`:s=`doublecircle`;break;default:s=`rect`}let u=f(r?.styles??[]),d=r.label,p=r.size??{width:0,height:0,x:0,y:0},m=t.getDiagramId();return{labelStyle:u.labelStyle,shape:s,label:d,labelText:d,rx:o,ry:o,class:i,cssClasses:i,cssStyles:r?.styles??[],cssCompiledStyles:a,style:u.style,id:r.id,domId:m?`${m}-${r.id}`:r.id,isGroup:!1,directions:r.directions,width:p.width||void 0,height:p.height||void 0,wrappingWidth:p.width||1/0,x:p.x,y:p.y,positioned:n,intersect:void 0,padding:c??l()?.block?.padding??0,widthInColumns:r.widthInColumns??1}}e(Y,`getNodeFromBlock`);async function X(e,t,n){let r=Y(t,n,!1);if(t.type===`group`)return;let i=l(),a=await m(e,r,{config:i}),o=a.node()?.getBBox()??{width:0,height:0},s=n.getBlock(r.id);s.size={width:o.width,height:o.height,x:0,y:0,node:a},n.setBlock(s),a.remove()}e(X,`calculateBlockSize`);async function Z(e,t,n){let r=Y(t,n,!0);if(n.getBlock(r.id).type!==`space`){let n=l();await m(e,r,{config:n}),t.intersect=r?.intersect,p(r)}}e(Z,`insertBlockPositioned`);async function Q(e,t,n,r){for(let i of t)await r(e,i,n),i.children&&await Q(e,i.children,n,r)}e(Q,`performOperations`);async function ve(e,t,n){await Q(e,t,n,X)}e(ve,`calculateBlockSizes`);async function ye(e,t,n){await Q(e,t,n,Z)}e(ye,`insertBlocks`);async function $(e,t,n,r,i){let a=new u({multigraph:!0,compound:!0});a.setGraph({rankdir:`TB`,nodesep:10,ranksep:10,marginx:8,marginy:8});for(let e of n)e.size&&a.setNode(e.id,{width:e.size.width,height:e.size.height,intersect:e.intersect});for(let n of t)if(n.start&&n.end){let t=r.getBlock(n.start),o=r.getBlock(n.end);if(t?.size&&o?.size){let r=t.size,s=o.size,c=[{x:r.x,y:r.y},{x:r.x+(s.x-r.x)/2,y:r.y+(s.y-r.y)/2},{x:s.x,y:s.y}],l=i?`${i}-${n.id}`:n.id,u=`${n.thickness===`thick`?`edge-thickness-thick`:`edge-thickness-normal`} ${n.pattern===`dotted`?`edge-pattern-dotted`:`edge-pattern-solid`} flowchart-link LS-a1 LE-b1`;v(e,{...n,id:l,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:c,classes:u},{},`block`,a.node(n.start),a.node(n.end),i),n.label&&(await _(e,{...n,label:n.label,labelStyle:`stroke: #333; stroke-width: 1.5px;fill:none;`,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:c,classes:u}),g({...n,x:c[1].x,y:c[1].y},{originalPath:c}))}}}e($,`insertEdges`);var be=e(function(e,t){return t.db.getClasses()},`getClasses`),xe={parser:x,db:he,renderer:{draw:e(async function(e,r,a,o){let{securityLevel:s,block:c}=l(),u=o.db;u.setDiagramId(r);let d;s===`sandbox`&&(d=t(`#i`+r));let f=t(s===`sandbox`?d.nodes()[0].contentDocument.body:`body`),p=s===`sandbox`?f.select(`[id="${r}"]`):t(`[id="${r}"]`);h(p,[`point`,`circle`,`cross`],o.type,r);let m=u.getBlocks(),g=u.getBlocksFlat(),_=u.getEdges(),v=p.insert(`g`).attr(`class`,`block`);await ve(v,m,u);let y=J(u);await ye(v,m,u),await $(v,_,g,u,r);let b=v.node()?.getBBox(),x=b&&Number.isFinite(b.width)&&Number.isFinite(b.height)?b:y;if(x){let e=Math.max(1,Math.round(.125*(x.width/x.height))),t=x.height+e+10,r=x.width+10,{useMaxWidth:a}=c;i(p,t,r,!!a),n.debug(`Here Bounds`,y,x),p.attr(`viewBox`,`${x.x-5} ${x.y-5} ${x.width+10} ${x.height+10}`)}},`draw`),getClasses:be},styles:ge};export{xe as diagram};