omni-context-cli 0.0.90 → 0.0.92

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 (116) hide show
  1. package/README.md +12 -8
  2. package/README.zh-CN.md +12 -8
  3. package/dist/agents/audit.md +77 -0
  4. package/dist/agents/deduce.md +1 -0
  5. package/dist/agents/explore.md +1 -0
  6. package/dist/agents/glance.md +1 -0
  7. package/dist/agents/recall.md +1 -0
  8. package/dist/agents/review.md +1 -0
  9. package/dist/agents/search.md +1 -0
  10. package/dist/cli.js +7 -7
  11. package/dist/clients/extension.vsix +0 -0
  12. package/dist/clients/web/assets/App-CBmFCdgC.css +1 -0
  13. package/dist/clients/web/assets/App-CM8Va3JQ.js +2 -0
  14. package/dist/clients/web/assets/ImageWorkshop-D0woOaMP.js +1 -0
  15. package/dist/clients/web/assets/_baseUniq-8ZoXEUbL.js +1 -0
  16. package/dist/clients/web/assets/arc-B2TpLZAc.js +1 -0
  17. package/dist/clients/web/assets/architectureDiagram-VXUJARFQ-sCw1Bqxj.js +1 -0
  18. package/dist/clients/web/assets/blockDiagram-VD42YOAC-TzLCV8cu.js +1 -0
  19. package/dist/clients/web/assets/c4Diagram-YG6GDRKO-CB75g8mk.js +1 -0
  20. package/dist/clients/web/assets/channel-Cc6WLpkH.js +1 -0
  21. package/dist/clients/web/assets/chunk-4BX2VUAB-CnCH9PHV.js +1 -0
  22. package/dist/clients/web/assets/chunk-55IACEB6-j6kgk2Ub.js +1 -0
  23. package/dist/clients/web/assets/chunk-B4BG7PRW-CU5TkBMe.js +1 -0
  24. package/dist/clients/web/assets/chunk-DI55MBZ5-B9PNM453.js +1 -0
  25. package/dist/clients/web/assets/chunk-FMBD7UC4-ubTGnudB.js +1 -0
  26. package/dist/clients/web/assets/chunk-QN33PNHL-D5no8Jfp.js +1 -0
  27. package/dist/clients/web/assets/chunk-QZHKN3VN-RIiVnjQx.js +1 -0
  28. package/dist/clients/web/assets/chunk-TZMSLE5B-DTy2vR2B.js +1 -0
  29. package/dist/clients/web/assets/classDiagram-2ON5EDUG-8oZ_o2z8.js +1 -0
  30. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-8oZ_o2z8.js +1 -0
  31. package/dist/clients/web/assets/clone-Z2wHm8pw.js +1 -0
  32. package/dist/clients/web/assets/cose-bilkent-S5V4N54A-Bqct6Lvl.js +1 -0
  33. package/dist/clients/web/assets/dagre-6UL2VRFP-441VQkK1.js +1 -0
  34. package/dist/clients/web/assets/diagram-PSM6KHXK-BO9H2Aak.js +1 -0
  35. package/dist/clients/web/assets/diagram-QEK2KX5R-3lGBBCVw.js +1 -0
  36. package/dist/clients/web/assets/diagram-S2PKOQOG-DY84HL8G.js +1 -0
  37. package/dist/clients/web/assets/erDiagram-Q2GNP2WA-DWcgMtNO.js +1 -0
  38. package/dist/clients/web/assets/flowDiagram-NV44I4VS-Ybex1wXj.js +1 -0
  39. package/dist/clients/web/assets/ganttDiagram-JELNMOA3-ChWIAt1T.js +1 -0
  40. package/dist/clients/web/assets/gitGraphDiagram-NY62KEGX-ClJFv0ul.js +1 -0
  41. package/dist/clients/web/assets/graph-Cs6Qxtax.js +1 -0
  42. package/dist/clients/web/assets/index-DPbcKIIg.js +2 -0
  43. package/dist/clients/web/assets/index-Fz55nSNP.css +1 -0
  44. package/dist/clients/web/assets/infoDiagram-WHAUD3N6-DnTUhHY0.js +1 -0
  45. package/dist/clients/web/assets/journeyDiagram-XKPGCS4Q-CIENPsGT.js +1 -0
  46. package/dist/clients/web/assets/kanban-definition-3W4ZIXB7-AhFkjsY3.js +1 -0
  47. package/dist/clients/web/assets/layout-BntZLQYy.js +1 -0
  48. package/dist/clients/web/assets/linear-CbNyjCBb.js +1 -0
  49. package/dist/clients/web/assets/min-1nUrt3JX.js +1 -0
  50. package/dist/clients/web/assets/mindmap-definition-VGOIOE7T-Cs3o7Dfz.js +1 -0
  51. package/dist/clients/web/assets/pieDiagram-ADFJNKIX-yQPBfZ8y.js +1 -0
  52. package/dist/clients/web/assets/quadrantDiagram-AYHSOK5B-5kPfWslR.js +1 -0
  53. package/dist/clients/web/assets/requirementDiagram-UZGBJVZJ-DoucrOtZ.js +1 -0
  54. package/dist/clients/web/assets/sankeyDiagram-TZEHDZUN-PTFbpc-u.js +1 -0
  55. package/dist/clients/web/assets/sequenceDiagram-WL72ISMW-BZ33cKfm.js +1 -0
  56. package/dist/clients/web/assets/stateDiagram-FKZM4ZOC-C4idf-WB.js +1 -0
  57. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-B-b2Duqy.js +1 -0
  58. package/dist/clients/web/assets/timeline-definition-IT6M3QCI-P1su699P.js +1 -0
  59. package/dist/clients/web/assets/treemap-KMMF4GRG-BmD_DFh3.js +1 -0
  60. package/dist/clients/web/assets/useAppearance-PXtz8423.js +1 -0
  61. package/dist/clients/web/assets/xychartDiagram-PRI3JC2R-DtIpn1yU.js +1 -0
  62. package/dist/clients/web/index.html +2 -2
  63. package/dist/skills/audit/SKILL.md +69 -0
  64. package/dist/skills/cookbook/SKILL.md +1 -1
  65. package/dist/skills/save-atlas/SKILL.md +12 -0
  66. package/dist/skills/simplify/SKILL.md +1 -1
  67. package/dist/workflows/general.md +1 -0
  68. package/dist/workflows/programming.md +4 -4
  69. package/package.json +1 -1
  70. package/dist/clients/web/assets/_baseUniq-DmXMUmS1.js +0 -1
  71. package/dist/clients/web/assets/arc-BI_u3fUi.js +0 -1
  72. package/dist/clients/web/assets/architectureDiagram-VXUJARFQ-SdbVcUgb.js +0 -1
  73. package/dist/clients/web/assets/blockDiagram-VD42YOAC-Dgdw02Dx.js +0 -1
  74. package/dist/clients/web/assets/c4Diagram-YG6GDRKO-BBWW1C-U.js +0 -1
  75. package/dist/clients/web/assets/channel-BhvEAUA0.js +0 -1
  76. package/dist/clients/web/assets/chunk-4BX2VUAB-Db240ZuE.js +0 -1
  77. package/dist/clients/web/assets/chunk-55IACEB6-DVkBB5tN.js +0 -1
  78. package/dist/clients/web/assets/chunk-B4BG7PRW-Dby3xfQV.js +0 -1
  79. package/dist/clients/web/assets/chunk-DI55MBZ5-Bfv0NfQG.js +0 -1
  80. package/dist/clients/web/assets/chunk-FMBD7UC4-cCEjZ-PC.js +0 -1
  81. package/dist/clients/web/assets/chunk-QN33PNHL-BV-_VgzY.js +0 -1
  82. package/dist/clients/web/assets/chunk-QZHKN3VN-Gs37F5Ic.js +0 -1
  83. package/dist/clients/web/assets/chunk-TZMSLE5B-DgC76yOA.js +0 -1
  84. package/dist/clients/web/assets/classDiagram-2ON5EDUG-Dyqgnar4.js +0 -1
  85. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-Dyqgnar4.js +0 -1
  86. package/dist/clients/web/assets/clone-BboBU3Th.js +0 -1
  87. package/dist/clients/web/assets/cose-bilkent-S5V4N54A-bneOLhzB.js +0 -1
  88. package/dist/clients/web/assets/dagre-6UL2VRFP-ljEPzfmc.js +0 -1
  89. package/dist/clients/web/assets/diagram-PSM6KHXK-D0qLR_dT.js +0 -1
  90. package/dist/clients/web/assets/diagram-QEK2KX5R-DtpACMvD.js +0 -1
  91. package/dist/clients/web/assets/diagram-S2PKOQOG-Cj0GsMab.js +0 -1
  92. package/dist/clients/web/assets/erDiagram-Q2GNP2WA-3sJDRSxi.js +0 -1
  93. package/dist/clients/web/assets/flowDiagram-NV44I4VS-8hEf0ody.js +0 -1
  94. package/dist/clients/web/assets/ganttDiagram-JELNMOA3-BISgxk3R.js +0 -1
  95. package/dist/clients/web/assets/gitGraphDiagram-NY62KEGX-B_JfDS-5.js +0 -1
  96. package/dist/clients/web/assets/graph-BP-dUxFo.js +0 -1
  97. package/dist/clients/web/assets/index-5mQ2UgiF.css +0 -1
  98. package/dist/clients/web/assets/index-p16PXaGU.js +0 -2
  99. package/dist/clients/web/assets/infoDiagram-WHAUD3N6-Dc1GFa63.js +0 -1
  100. package/dist/clients/web/assets/journeyDiagram-XKPGCS4Q-BEHx0kcS.js +0 -1
  101. package/dist/clients/web/assets/kanban-definition-3W4ZIXB7-COM5k42v.js +0 -1
  102. package/dist/clients/web/assets/layout-DZRhlj_5.js +0 -1
  103. package/dist/clients/web/assets/linear-Fc7iPbNO.js +0 -1
  104. package/dist/clients/web/assets/min-DemC8Mr5.js +0 -1
  105. package/dist/clients/web/assets/mindmap-definition-VGOIOE7T-Cffc7FCU.js +0 -1
  106. package/dist/clients/web/assets/pieDiagram-ADFJNKIX-Dd5xGHtJ.js +0 -1
  107. package/dist/clients/web/assets/quadrantDiagram-AYHSOK5B-DysuwPQH.js +0 -1
  108. package/dist/clients/web/assets/requirementDiagram-UZGBJVZJ-DoWGHHXZ.js +0 -1
  109. package/dist/clients/web/assets/sankeyDiagram-TZEHDZUN-i3lt19eC.js +0 -1
  110. package/dist/clients/web/assets/sequenceDiagram-WL72ISMW-n0Ibqx5U.js +0 -1
  111. package/dist/clients/web/assets/stateDiagram-FKZM4ZOC-iA9KFFKN.js +0 -1
  112. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-CNCP3dFh.js +0 -1
  113. package/dist/clients/web/assets/timeline-definition-IT6M3QCI-BI2_Hz7G.js +0 -1
  114. package/dist/clients/web/assets/treemap-KMMF4GRG-D7R01SBC.js +0 -1
  115. package/dist/clients/web/assets/xychartDiagram-PRI3JC2R-CHEh-H7p.js +0 -1
  116. package/dist/skills/landmark/SKILL.md +0 -12
@@ -1 +0,0 @@
1
- var t;import{aG as i,_ as n,H as r,V as s,l as e,b as o,a as h,p as a,q as f,g as u,s as c,y as l,D as v,E as d,F as y,c as p,ak as w,aH as g,i as m,d as b,x as M,aI as k,aJ as x}from"./index-p16PXaGU.js";import{p as S}from"./chunk-4BX2VUAB-Db240ZuE.js";import{p as $}from"./treemap-KMMF4GRG-D7R01SBC.js";import{c as j}from"./cytoscape.esm-Cw0kmstm.js";import"./min-DemC8Mr5.js";import"./_baseUniq-DmXMUmS1.js";var O,A={exports:{}},T={exports:{}},I={exports:{}};function E(){return O?I.exports:(O=1,t=function(){return function(t){var i={};function n(r){if(i[r])return i[r].exports;var s=i[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=i,n.i=function(t){return t},n.d=function(t,i,r){n.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(i,"a",i),i},n.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},n.p="",n(n.s=28)}([function(t,i,n){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,t.exports=r},function(t,i,n){var r=n(2),s=n(8),e=n(9);function o(t,i,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=t,this.target=i}for(var h in o.prototype=Object.create(r.prototype),r)o[h]=r[h];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},o.prototype.getOtherEndInGraph=function(t,i){for(var n=this.getOtherEnd(t),r=i.getGraphManager().getRoot();;){if(n.getOwner()==i)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.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=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=o},function(t,i,n){t.exports=function(t){this.vGraphObject=t}},function(t,i,n){var r=n(2),s=n(10),e=n(13),o=n(0),h=n(16),a=n(5);function f(t,i,n,o){null==n&&null==o&&(o=i),r.call(this,o),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=t,this.rect=null!=n&&null!=i?new e(i.x,i.y,n.width,n.height):new e}for(var u in f.prototype=Object.create(r.prototype),r)f[u]=r[u];f.prototype.getEdges=function(){return this.edges},f.prototype.getChild=function(){return this.child},f.prototype.getOwner=function(){return this.owner},f.prototype.getWidth=function(){return this.rect.width},f.prototype.setWidth=function(t){this.rect.width=t},f.prototype.getHeight=function(){return this.rect.height},f.prototype.setHeight=function(t){this.rect.height=t},f.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},f.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},f.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},f.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},f.prototype.getRect=function(){return this.rect},f.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},f.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},f.prototype.setRect=function(t,i){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=i.width,this.rect.height=i.height},f.prototype.setCenter=function(t,i){this.rect.x=t-this.rect.width/2,this.rect.y=i-this.rect.height/2},f.prototype.setLocation=function(t,i){this.rect.x=t,this.rect.y=i},f.prototype.moveBy=function(t,i){this.rect.x+=t,this.rect.y+=i},f.prototype.getEdgeListToNode=function(t){var i=[],n=this;return n.edges.forEach(function(r){if(r.target==t){if(r.source!=n)throw"Incorrect edge source!";i.push(r)}}),i},f.prototype.getEdgesBetween=function(t){var i=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=t&&r.source!=t||i.push(r)}),i},f.prototype.getNeighborsList=function(){var t=new Set,i=this;return i.edges.forEach(function(n){if(n.source==i)t.add(n.target);else{if(n.target!=i)throw"Incorrect incidency!";t.add(n.source)}}),t},f.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var i=this.child.getNodes(),n=0;n<i.length;n++)i[n].withChildren().forEach(function(i){t.add(i)});return t},f.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var i=this.child.getNodes(),n=0;n<i.length;n++)t+=i[n].getNoOfChildren();return 0==t&&(t=1),t},f.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},f.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},f.prototype.scatter=function(){var t,i,n=-o.INITIAL_WORLD_BOUNDARY,r=o.INITIAL_WORLD_BOUNDARY;t=o.WORLD_CENTER_X+h.nextDouble()*(r-n)+n;var s=-o.INITIAL_WORLD_BOUNDARY,e=o.INITIAL_WORLD_BOUNDARY;i=o.WORLD_CENTER_Y+h.nextDouble()*(e-s)+s,this.rect.x=t,this.rect.y=i},f.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),o.NODE_DIMENSIONS_INCLUDE_LABELS){var i=t.getRight()-t.getLeft(),n=t.getBottom()-t.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(i+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>i?(this.rect.x-=(this.labelWidth-i)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(i+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},f.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},f.prototype.transform=function(t){var i=this.rect.x;i>o.WORLD_BOUNDARY?i=o.WORLD_BOUNDARY:i<-o.WORLD_BOUNDARY&&(i=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new a(i,n),s=t.inverseTransformPoint(r);this.setLocation(s.x,s.y)},f.prototype.getLeft=function(){return this.rect.x},f.prototype.getRight=function(){return this.rect.x+this.rect.width},f.prototype.getTop=function(){return this.rect.y},f.prototype.getBottom=function(){return this.rect.y+this.rect.height},f.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=f},function(t,i,n){var r=n(0);function s(){}for(var e in r)s[e]=r[e];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=3*s.MAX_NODE_DISPLACEMENT_INCREMENTAL,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=s},function(t,i,n){function r(t,i){null==t&&null==i?(this.x=0,this.y=0):(this.x=t,this.y=i)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(t){this.x=t},r.prototype.setY=function(t){this.y=t},r.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=r},function(t,i,n){var r=n(2),s=n(10),e=n(0),o=n(7),h=n(3),a=n(1),f=n(13),u=n(12),c=n(11);function l(t,i,n){r.call(this,n),this.estimatedSize=s.MIN_VALUE,this.margin=e.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=i&&i instanceof o?this.graphManager=i:null!=i&&i instanceof Layout&&(this.graphManager=i.graphManager)}for(var v in l.prototype=Object.create(r.prototype),r)l[v]=r[v];l.prototype.getNodes=function(){return this.nodes},l.prototype.getEdges=function(){return this.edges},l.prototype.getGraphManager=function(){return this.graphManager},l.prototype.getParent=function(){return this.parent},l.prototype.getLeft=function(){return this.left},l.prototype.getRight=function(){return this.right},l.prototype.getTop=function(){return this.top},l.prototype.getBottom=function(){return this.bottom},l.prototype.isConnected=function(){return this.isConnected},l.prototype.add=function(t,i,n){if(null==i&&null==n){var r=t;if(null==this.graphManager)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 s=t;if(!(this.getNodes().indexOf(i)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(i.owner!=n.owner||i.owner!=this)throw"Both owners must be this graph!";return i.owner!=n.owner?null:(s.source=i,s.target=n,s.isInterGraph=!1,this.getEdges().push(s),i.edges.push(s),n!=i&&n.edges.push(s),s)},l.prototype.remove=function(t){var i=t;if(t instanceof h){if(null==i)throw"Node is null!";if(null==i.owner||i.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=i.edges.slice(),r=n.length,s=0;s<r;s++)(e=n[s]).isInterGraph?this.graphManager.remove(e):e.source.owner.remove(e);if(-1==(o=this.nodes.indexOf(i)))throw"Node not in owner node list!";this.nodes.splice(o,1)}else if(t instanceof a){var e;if(null==(e=t))throw"Edge is null!";if(null==e.source||null==e.target)throw"Source and/or target is null!";if(null==e.source.owner||null==e.target.owner||e.source.owner!=this||e.target.owner!=this)throw"Source and/or target owner is invalid!";var o,f=e.source.edges.indexOf(e),u=e.target.edges.indexOf(e);if(!(f>-1&&u>-1))throw"Source and/or target doesn't know this edge!";if(e.source.edges.splice(f,1),e.target!=e.source&&e.target.edges.splice(u,1),-1==(o=e.source.owner.getEdges().indexOf(e)))throw"Not in owner's edge list!";e.source.owner.getEdges().splice(o,1)}},l.prototype.updateLeftTop=function(){for(var t,i,n,r=s.MAX_VALUE,e=s.MAX_VALUE,o=this.getNodes(),h=o.length,a=0;a<h;a++){var f=o[a];r>(t=f.getTop())&&(r=t),e>(i=f.getLeft())&&(e=i)}return r==s.MAX_VALUE?null:(n=null!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=e-n,this.top=r-n,new u(this.left,this.top))},l.prototype.updateBounds=function(t){for(var i,n,r,e,o,h=s.MAX_VALUE,a=-s.MAX_VALUE,u=s.MAX_VALUE,c=-s.MAX_VALUE,l=this.nodes,v=l.length,d=0;d<v;d++){var y=l[d];t&&null!=y.child&&y.updateBounds(),h>(i=y.getLeft())&&(h=i),a<(n=y.getRight())&&(a=n),u>(r=y.getTop())&&(u=r),c<(e=y.getBottom())&&(c=e)}var p=new f(h,u,a-h,c-u);h==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),o=null!=l[0].getParent().paddingLeft?l[0].getParent().paddingLeft:this.margin,this.left=p.x-o,this.right=p.x+p.width+o,this.top=p.y-o,this.bottom=p.y+p.height+o},l.calculateBounds=function(t){for(var i,n,r,e,o=s.MAX_VALUE,h=-s.MAX_VALUE,a=s.MAX_VALUE,u=-s.MAX_VALUE,c=t.length,l=0;l<c;l++){var v=t[l];o>(i=v.getLeft())&&(o=i),h<(n=v.getRight())&&(h=n),a>(r=v.getTop())&&(a=r),u<(e=v.getBottom())&&(u=e)}return new f(o,a,h-o,u-a)},l.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},l.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},l.prototype.calcEstimatedSize=function(){for(var t=0,i=this.nodes,n=i.length,r=0;r<n;r++)t+=i[r].calcEstimatedSize();return this.estimatedSize=0==t?e.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},l.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var i,n,r=new c,s=new Set,e=this.nodes[0];for(e.withChildren().forEach(function(t){r.push(t),s.add(t)});0!==r.length;)for(var o=(i=(e=r.shift()).getEdges()).length,h=0;h<o;h++)null==(n=i[h].getOtherEndInGraph(e,this))||s.has(n)||n.withChildren().forEach(function(t){r.push(t),s.add(t)});if(this.isConnected=!1,s.size>=this.nodes.length){var a=0;s.forEach(function(i){i.owner==t&&a++}),a==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=l},function(t,i,n){var r,s=n(1);function e(t){r=n(6),this.layout=t,this.graphs=[],this.edges=[]}e.prototype.addRoot=function(){var t=this.layout.newGraph(),i=this.layout.newNode(null),n=this.add(t,i);return this.setRootGraph(n),this.rootGraph},e.prototype.add=function(t,i,n,r,s){if(null==n&&null==r&&null==s){if(null==t)throw"Graph is null!";if(null==i)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=i.child)throw"Already has a child!";return t.parent=i,i.child=t,t}s=n,n=t;var e=(r=i).getOwner(),o=s.getOwner();if(null==e||e.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==o||o.getGraphManager()!=this)throw"Target not in this graph mgr!";if(e==o)return n.isInterGraph=!1,e.add(n,r,s);if(n.isInterGraph=!0,n.source=r,n.target=s,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},e.prototype.remove=function(t){if(t instanceof r){var i=t;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(i!=this.rootGraph&&(null==i.parent||i.parent.graphManager!=this))throw"Invalid parent node!";for(var n,e=[],o=(e=e.concat(i.getEdges())).length,h=0;h<o;h++)n=e[h],i.remove(n);var a,f=[];for(o=(f=f.concat(i.getNodes())).length,h=0;h<o;h++)a=f[h],i.remove(a);i==this.rootGraph&&this.setRootGraph(null);var u=this.graphs.indexOf(i);this.graphs.splice(u,1),i.parent=null}else if(t instanceof s){if(null==(n=t))throw"Edge is null!";if(!n.isInterGraph)throw"Not an inter-graph edge!";if(null==n.source||null==n.target)throw"Source and/or target is null!";if(-1==n.source.edges.indexOf(n)||-1==n.target.edges.indexOf(n))throw"Source and/or target doesn't know this edge!";if(u=n.source.edges.indexOf(n),n.source.edges.splice(u,1),u=n.target.edges.indexOf(n),n.target.edges.splice(u,1),null==n.source.owner||null==n.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==n.source.owner.getGraphManager().edges.indexOf(n))throw"Not in owner graph manager's edge list!";u=n.source.owner.getGraphManager().edges.indexOf(n),n.source.owner.getGraphManager().edges.splice(u,1)}},e.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},e.prototype.getGraphs=function(){return this.graphs},e.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],i=this.getGraphs(),n=i.length,r=0;r<n;r++)t=t.concat(i[r].getNodes());this.allNodes=t}return this.allNodes},e.prototype.resetAllNodes=function(){this.allNodes=null},e.prototype.resetAllEdges=function(){this.allEdges=null},e.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},e.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],i=this.getGraphs();i.length;for(var n=0;n<i.length;n++)t=t.concat(i[n].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},e.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},e.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},e.prototype.getRoot=function(){return this.rootGraph},e.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},e.prototype.getLayout=function(){return this.layout},e.prototype.isOneAncestorOfOther=function(t,i){if(null==t||null==i)throw"assert failed";if(t==i)return!0;for(var n,r=t.getOwner();null!=(n=r.getParent());){if(n==i)return!0;if(null==(r=n.getOwner()))break}for(r=i.getOwner();null!=(n=r.getParent());){if(n==t)return!0;if(null==(r=n.getOwner()))break}return!1},e.prototype.calcLowestCommonAncestors=function(){for(var t,i,n,r,s,e=this.getAllEdges(),o=e.length,h=0;h<o;h++)if(i=(t=e[h]).source,n=t.target,t.lca=null,t.sourceInLca=i,t.targetInLca=n,i!=n){for(r=i.getOwner();null==t.lca;){for(t.targetInLca=n,s=n.getOwner();null==t.lca;){if(s==r){t.lca=s;break}if(s==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=s.getParent(),s=t.targetInLca.getOwner()}if(r==this.rootGraph)break;null==t.lca&&(t.sourceInLca=r.getParent(),r=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=i.getOwner()},e.prototype.calcLowestCommonAncestor=function(t,i){if(t==i)return t.getOwner();for(var n=t.getOwner();null!=n;){for(var r=i.getOwner();null!=r;){if(r==n)return r;r=r.getParent().getOwner()}n=n.getParent().getOwner()}return n},e.prototype.calcInclusionTreeDepths=function(t,i){var n;null==t&&null==i&&(t=this.rootGraph,i=1);for(var r=t.getNodes(),s=r.length,e=0;e<s;e++)(n=r[e]).inclusionTreeDepth=i,null!=n.child&&this.calcInclusionTreeDepths(n.child,i+1)},e.prototype.includesInvalidEdge=function(){for(var t,i=[],n=this.edges.length,r=0;r<n;r++)t=this.edges[r],this.isOneAncestorOfOther(t.source,t.target)&&i.push(t);for(r=0;r<i.length;r++)this.remove(i[r]);return!1},t.exports=e},function(t,i,n){var r=n(12);function s(){}s.calcSeparationAmount=function(t,i,n,r){if(!t.intersects(i))throw"assert failed";var s=new Array(2);this.decideDirectionsForOverlappingNodes(t,i,s),n[0]=Math.min(t.getRight(),i.getRight())-Math.max(t.x,i.x),n[1]=Math.min(t.getBottom(),i.getBottom())-Math.max(t.y,i.y),t.getX()<=i.getX()&&t.getRight()>=i.getRight()?n[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(n[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?n[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(n[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var e=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(e=1);var o=e*n[0],h=n[1]/e;n[0]<h?h=n[0]:o=n[1],n[0]=-1*s[0]*(h/2+r),n[1]=-1*s[1]*(o/2+r)},s.decideDirectionsForOverlappingNodes=function(t,i,n){t.getCenterX()<i.getCenterX()?n[0]=-1:n[0]=1,t.getCenterY()<i.getCenterY()?n[1]=-1:n[1]=1},s.getIntersection2=function(t,i,n){var r=t.getCenterX(),s=t.getCenterY(),e=i.getCenterX(),o=i.getCenterY();if(t.intersects(i))return n[0]=r,n[1]=s,n[2]=e,n[3]=o,!0;var h=t.getX(),a=t.getY(),f=t.getRight(),u=t.getX(),c=t.getBottom(),l=t.getRight(),v=t.getWidthHalf(),d=t.getHeightHalf(),y=i.getX(),p=i.getY(),w=i.getRight(),g=i.getX(),m=i.getBottom(),b=i.getRight(),M=i.getWidthHalf(),k=i.getHeightHalf(),x=!1,S=!1;if(r===e){if(s>o)return n[0]=r,n[1]=a,n[2]=e,n[3]=m,!1;if(s<o)return n[0]=r,n[1]=c,n[2]=e,n[3]=p,!1}else if(s===o){if(r>e)return n[0]=h,n[1]=s,n[2]=w,n[3]=o,!1;if(r<e)return n[0]=f,n[1]=s,n[2]=y,n[3]=o,!1}else{var $=t.height/t.width,j=i.height/i.width,O=(o-s)/(e-r),A=void 0,T=void 0,I=void 0,E=void 0,L=void 0,D=void 0;if(-$===O?r>e?(n[0]=u,n[1]=c,x=!0):(n[0]=f,n[1]=a,x=!0):$===O&&(r>e?(n[0]=h,n[1]=a,x=!0):(n[0]=l,n[1]=c,x=!0)),-j===O?e>r?(n[2]=g,n[3]=m,S=!0):(n[2]=w,n[3]=p,S=!0):j===O&&(e>r?(n[2]=y,n[3]=p,S=!0):(n[2]=b,n[3]=m,S=!0)),x&&S)return!1;if(r>e?s>o?(A=this.getCardinalDirection($,O,4),T=this.getCardinalDirection(j,O,2)):(A=this.getCardinalDirection(-$,O,3),T=this.getCardinalDirection(-j,O,1)):s>o?(A=this.getCardinalDirection(-$,O,1),T=this.getCardinalDirection(-j,O,3)):(A=this.getCardinalDirection($,O,2),T=this.getCardinalDirection(j,O,4)),!x)switch(A){case 1:E=a,I=r+-d/O,n[0]=I,n[1]=E;break;case 2:I=l,E=s+v*O,n[0]=I,n[1]=E;break;case 3:E=c,I=r+d/O,n[0]=I,n[1]=E;break;case 4:I=u,E=s+-v*O,n[0]=I,n[1]=E}if(!S)switch(T){case 1:D=p,L=e+-k/O,n[2]=L,n[3]=D;break;case 2:L=b,D=o+M*O,n[2]=L,n[3]=D;break;case 3:D=m,L=e+k/O,n[2]=L,n[3]=D;break;case 4:L=g,D=o+-M*O,n[2]=L,n[3]=D}}return!1},s.getCardinalDirection=function(t,i,n){return t>i?n:1+n%4},s.getIntersection=function(t,i,n,s){if(null==s)return this.getIntersection2(t,i,n);var e,o,h,a,f,u,c,l=t.x,v=t.y,d=i.x,y=i.y,p=n.x,w=n.y,g=s.x,m=s.y;return 0===(c=(e=y-v)*(a=p-g)-(o=m-w)*(h=l-d))?null:new r((h*(u=g*w-p*m)-a*(f=d*v-l*y))/c,(o*f-e*u)/c)},s.angleOfVector=function(t,i,n,r){var s=void 0;return t!==n?(s=Math.atan((r-i)/(n-t)),n<t?s+=Math.PI:r<i&&(s+=this.TWO_PI)):s=r<i?this.ONE_AND_HALF_PI:this.HALF_PI,s},s.doIntersect=function(t,i,n,r){var s=t.x,e=t.y,o=i.x,h=i.y,a=n.x,f=n.y,u=r.x,c=r.y,l=(o-s)*(c-f)-(u-a)*(h-e);if(0===l)return!1;var v=((c-f)*(u-s)+(a-u)*(c-e))/l,d=((e-h)*(u-s)+(o-s)*(c-e))/l;return 0<v&&v<1&&0<d&&d<1},s.findCircleLineIntersections=function(t,i,n,r,s,e,o){var h=(n-t)*(n-t)+(r-i)*(r-i),a=2*((t-s)*(n-t)+(i-e)*(r-i)),f=(t-s)*(t-s)+(i-e)*(i-e)-o*o;if(a*a-4*h*f>=0){var u=(-a+Math.sqrt(a*a-4*h*f))/(2*h),c=(-a-Math.sqrt(a*a-4*h*f))/(2*h);return u>=0&&u<=1?[u]:c>=0&&c<=1?[c]:null}return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,t.exports=s},function(t,i,n){function r(){}r.sign=function(t){return t>0?1:t<0?-1:0},r.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},r.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=r},function(t,i,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=function(t){return{value:t,next:null,prev:null}},e=function(t,i,n,r){return null!==t?t.next=i:r.head=i,null!==n?n.prev=i:r.tail=i,i.prev=t,i.next=n,r.length++,i},o=function(t,i){var n=t.prev,r=t.next;return null!==n?n.next=r:i.head=r,null!==r?r.prev=n:i.tail=n,t.prev=t.next=null,i.length--,t},h=function(){function t(i){var n=this;!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.length=0,this.head=null,this.tail=null,null!=i&&i.forEach(function(t){return n.push(t)})}return r(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,i){return e(i.prev,s(t),i,this)}},{key:"insertAfter",value:function(t,i){return e(i,s(t),i.next,this)}},{key:"insertNodeBefore",value:function(t,i){return e(i.prev,t,i,this)}},{key:"insertNodeAfter",value:function(t,i){return e(i,t,i.next,this)}},{key:"push",value:function(t){return e(this.tail,s(t),null,this)}},{key:"unshift",value:function(t){return e(null,s(t),this.head,this)}},{key:"remove",value:function(t){return o(t,this)}},{key:"pop",value:function(){return o(this.tail,this).value}},{key:"popNode",value:function(){return o(this.tail,this)}},{key:"shift",value:function(){return o(this.head,this).value}},{key:"shiftNode",value:function(){return o(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var i=1,n=this.head;i<t;)n=n.next,i++;return n.value}}},{key:"set_object_at",value:function(t,i){if(t<=this.length()){for(var n=1,r=this.head;n<t;)r=r.next,n++;r.value=i}}}]),t}();t.exports=h},function(t,i,n){function r(t,i,n){this.x=null,this.y=null,null==t&&null==i&&null==n?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof i&&null==n?(this.x=t,this.y=i):"Point"==t.constructor.name&&null==i&&null==n&&(n=t,this.x=n.x,this.y=n.y)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.getLocation=function(){return new r(this.x,this.y)},r.prototype.setLocation=function(t,i,n){"Point"==t.constructor.name&&null==i&&null==n?(n=t,this.setLocation(n.x,n.y)):"number"==typeof t&&"number"==typeof i&&null==n&&(parseInt(t)==t&&parseInt(i)==i?this.move(t,i):(this.x=Math.floor(t+.5),this.y=Math.floor(i+.5)))},r.prototype.move=function(t,i){this.x=t,this.y=i},r.prototype.translate=function(t,i){this.x+=t,this.y+=i},r.prototype.equals=function(t){if("Point"==t.constructor.name){var i=t;return this.x==i.x&&this.y==i.y}return this==t},r.prototype.toString=function(){return(new r).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=r},function(t,i,n){function r(t,i,n,r){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=i&&null!=n&&null!=r&&(this.x=t,this.y=i,this.width=n,this.height=r)}r.prototype.getX=function(){return this.x},r.prototype.setX=function(t){this.x=t},r.prototype.getY=function(){return this.y},r.prototype.setY=function(t){this.y=t},r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},r.prototype.getRight=function(){return this.x+this.width},r.prototype.getBottom=function(){return this.y+this.height},r.prototype.intersects=function(t){return!(this.getRight()<t.x||this.getBottom()<t.y||t.getRight()<this.x||t.getBottom()<this.y)},r.prototype.getCenterX=function(){return this.x+this.width/2},r.prototype.getMinX=function(){return this.getX()},r.prototype.getMaxX=function(){return this.getX()+this.width},r.prototype.getCenterY=function(){return this.y+this.height/2},r.prototype.getMinY=function(){return this.getY()},r.prototype.getMaxY=function(){return this.getY()+this.height},r.prototype.getWidthHalf=function(){return this.width/2},r.prototype.getHeightHalf=function(){return this.height/2},t.exports=r},function(t,i,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function s(){}s.lastID=0,s.createID=function(t){return s.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=s.getString(),s.lastID++),t.uniqueID)},s.getString=function(t){return null==t&&(t=s.lastID),"Object#"+t},s.isPrimitive=function(t){var i=void 0===t?"undefined":r(t);return null==t||"object"!=i&&"function"!=i},t.exports=s},function(t,i,n){function r(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}var s=n(0),e=n(7),o=n(3),h=n(1),a=n(6),f=n(5),u=n(17),c=n(29);function l(t){c.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new e(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}l.RANDOM_SEED=1,l.prototype=Object.create(c.prototype),l.prototype.getGraphManager=function(){return this.graphManager},l.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},l.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},l.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},l.prototype.newGraphManager=function(){var t=new e(this);return this.graphManager=t,t},l.prototype.newGraph=function(t){return new a(null,this.graphManager,t)},l.prototype.newNode=function(t){return new o(this.graphManager,t)},l.prototype.newEdge=function(t){return new h(null,null,t)},l.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},l.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==s.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},l.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},l.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),i=0;i<t.length;i++)t[i];var n=this.graphManager.getRoot().getNodes();for(i=0;i<n.length;i++)n[i];this.update(this.graphManager.getRoot())}},l.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof o){var i=t;if(null!=i.getChild())for(var n=i.getChild().getNodes(),r=0;r<n.length;r++)update(n[r]);null!=i.vGraphObject&&i.vGraphObject.update(i)}else if(t instanceof h){var s=t;null!=s.vGraphObject&&s.vGraphObject.update(s)}else if(t instanceof a){var e=t;null!=e.vGraphObject&&e.vGraphObject.update(e)}},l.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},l.prototype.transform=function(t){if(null==t)this.transform(new f(0,0));else{var i=new u,n=this.graphManager.getRoot().updateLeftTop();if(null!=n){i.setWorldOrgX(t.x),i.setWorldOrgY(t.y),i.setDeviceOrgX(n.x),i.setDeviceOrgY(n.y);for(var r=this.getAllNodes(),s=0;s<r.length;s++)r[s].transform(i)}}},l.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var i,n,r=t.getNodes(),s=0;s<r.length;s++)null==(n=(i=r[s]).getChild())||0==n.getNodes().length?i.scatter():(this.positionNodesRandomly(n),i.updateBounds())},l.prototype.getFlatForest=function(){for(var t=[],i=!0,n=this.graphManager.getRoot().getNodes(),s=!0,e=0;e<n.length;e++)null!=n[e].getChild()&&(s=!1);if(!s)return t;var o=new Set,h=[],a=new Map,f=[];for(f=f.concat(n);f.length>0&&i;){for(h.push(f[0]);h.length>0&&i;){var u=h[0];h.splice(0,1),o.add(u);var c=u.getEdges();for(e=0;e<c.length;e++){var l=c[e].getOtherEnd(u);if(a.get(u)!=l){if(o.has(l)){i=!1;break}h.push(l),a.set(l,u)}}}if(i){var v=[].concat(r(o));for(t.push(v),e=0;e<v.length;e++){var d=v[e],y=f.indexOf(d);y>-1&&f.splice(y,1)}o=new Set,a=new Map}else t=[]}return t},l.prototype.createDummyNodesForBendpoints=function(t){for(var i=[],n=t.source,r=this.graphManager.calcLowestCommonAncestor(t.source,t.target),s=0;s<t.bendpoints.length;s++){var e=this.newNode(null);e.setRect(new Point(0,0),new Dimension(1,1)),r.add(e);var o=this.newEdge(null);this.graphManager.add(o,n,e),i.add(e),n=e}return o=this.newEdge(null),this.graphManager.add(o,n,t.target),this.edgeToDummyNodes.set(t,i),t.isInterGraph()?this.graphManager.remove(t):r.remove(t),i},l.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(r(this.edgeToDummyNodes.keys())).concat(t);for(var i=0;i<t.length;i++){var n=t[i];if(n.bendpoints.length>0){for(var s=this.edgeToDummyNodes.get(n),e=0;e<s.length;e++){var o=s[e],h=new f(o.getCenterX(),o.getCenterY()),a=n.bendpoints.get(e);a.x=h.x,a.y=h.y,o.getOwner().remove(o)}this.graphManager.add(n,n.source,n.target)}}},l.transform=function(t,i,n,r){if(null!=n&&null!=r){var s=i;return t<=50?s-=(i-i/n)/50*(50-t):s+=(i*r-i)/50*(t-50),s}var e,o;return t<=50?(e=9*i/500,o=i/10):(e=9*i/50,o=-8*i),e*t+o},l.findCenterOfTree=function(t){var i=[];i=i.concat(t);var n=[],r=new Map,s=!1,e=null;1!=i.length&&2!=i.length||(s=!0,e=i[0]);for(var o=0;o<i.length;o++){var h=(u=i[o]).getNeighborsList().size;r.set(u,u.getNeighborsList().size),1==h&&n.push(u)}var a=[];for(a=a.concat(n);!s;){var f=[];for(f=f.concat(a),a=[],o=0;o<i.length;o++){var u=i[o],c=i.indexOf(u);c>=0&&i.splice(c,1),u.getNeighborsList().forEach(function(t){if(n.indexOf(t)<0){var i=r.get(t)-1;1==i&&a.push(t),r.set(t,i)}})}n=n.concat(a),1!=i.length&&2!=i.length||(s=!0,e=i[0])}return e},l.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=l},function(t,i,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},t.exports=r},function(t,i,n){var r=n(5);function s(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(t){this.lworldExtX=t},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(t){this.lworldExtY=t},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},s.prototype.transformX=function(t){var i=0,n=this.lworldExtX;return 0!=n&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/n),i},s.prototype.transformY=function(t){var i=0,n=this.lworldExtY;return 0!=n&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/n),i},s.prototype.inverseTransformX=function(t){var i=0,n=this.ldeviceExtX;return 0!=n&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/n),i},s.prototype.inverseTransformY=function(t){var i=0,n=this.ldeviceExtY;return 0!=n&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/n),i},s.prototype.inverseTransformPoint=function(t){return new r(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=s},function(t,i,n){var r=n(15),s=n(4),e=n(0),o=n(8),h=n(9);function a(){r.call(this),this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=s.MAX_ITERATIONS}for(var f in a.prototype=Object.create(r.prototype),r)a[f]=r[f];a.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},a.prototype.calcIdealEdgeLengths=function(){for(var t,i,n,r,o,h,a,f=this.getGraphManager().getAllEdges(),u=0;u<f.length;u++)i=(t=f[u]).idealLength,t.isInterGraph&&(r=t.getSource(),o=t.getTarget(),h=t.getSourceInLca().getEstimatedSize(),a=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=h+a-2*e.SIMPLE_NODE_SIZE),n=t.getLca().getInclusionTreeDepth(),t.idealLength+=i*s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(r.getInclusionTreeDepth()+o.getInclusionTreeDepth()-2*n))},a.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>s.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(t-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},a.prototype.calcSpringForces=function(){for(var t,i=this.getAllEdges(),n=0;n<i.length;n++)t=i[n],this.calcSpringForce(t,t.idealLength)},a.prototype.calcRepulsionForces=function(){var t,i,n,r,e,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],h=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),e=new Set,t=0;t<a.length;t++)n=a[t],this.calculateRepulsionForceOfANode(n,e,o,h),e.add(n);else for(t=0;t<a.length;t++)for(n=a[t],i=t+1;i<a.length;i++)r=a[i],n.getOwner()==r.getOwner()&&this.calcRepulsionForce(n,r)},a.prototype.calcGravitationalForces=function(){for(var t,i=this.getAllNodesToApplyGravitation(),n=0;n<i.length;n++)t=i[n],this.calcGravitationalForce(t)},a.prototype.moveNodes=function(){for(var t=this.getAllNodes(),i=0;i<t.length;i++)t[i].move()},a.prototype.calcSpringForce=function(t,i){var n,r,s,e,o=t.getSource(),h=t.getTarget();if(this.uniformLeafNodeSizes&&null==o.getChild()&&null==h.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(n=t.getLength())&&(s=(r=t.edgeElasticity*(n-i))*(t.lengthX/n),e=r*(t.lengthY/n),o.springForceX+=s,o.springForceY+=e,h.springForceX-=s,h.springForceY-=e)},a.prototype.calcRepulsionForce=function(t,i){var n,r,e,a,f,u,c,l=t.getRect(),v=i.getRect(),d=new Array(2),y=new Array(4);if(l.intersects(v)){o.calcSeparationAmount(l,v,d,s.DEFAULT_EDGE_LENGTH/2),u=2*d[0],c=2*d[1];var p=t.noOfChildren*i.noOfChildren/(t.noOfChildren+i.noOfChildren);t.repulsionForceX-=p*u,t.repulsionForceY-=p*c,i.repulsionForceX+=p*u,i.repulsionForceY+=p*c}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==i.getChild()?(n=v.getCenterX()-l.getCenterX(),r=v.getCenterY()-l.getCenterY()):(o.getIntersection(l,v,y),n=y[2]-y[0],r=y[3]-y[1]),Math.abs(n)<s.MIN_REPULSION_DIST&&(n=h.sign(n)*s.MIN_REPULSION_DIST),Math.abs(r)<s.MIN_REPULSION_DIST&&(r=h.sign(r)*s.MIN_REPULSION_DIST),e=n*n+r*r,a=Math.sqrt(e),u=(f=(t.nodeRepulsion/2+i.nodeRepulsion/2)*t.noOfChildren*i.noOfChildren/e)*n/a,c=f*r/a,t.repulsionForceX-=u,t.repulsionForceY-=c,i.repulsionForceX+=u,i.repulsionForceY+=c},a.prototype.calcGravitationalForce=function(t){var i,n,r,s,e,o,h,a;n=((i=t.getOwner()).getRight()+i.getLeft())/2,r=(i.getTop()+i.getBottom())/2,s=t.getCenterX()-n,e=t.getCenterY()-r,o=Math.abs(s)+t.getWidth()/2,h=Math.abs(e)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(o>(a=i.getEstimatedSize()*this.gravityRangeFactor)||h>a)&&(t.gravitationForceX=-this.gravityConstant*s,t.gravitationForceY=-this.gravityConstant*e):(o>(a=i.getEstimatedSize()*this.compoundGravityRangeFactor)||h>a)&&(t.gravitationForceX=-this.gravityConstant*s*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*e*this.compoundGravityConstant)},a.prototype.isConverged=function(){var t,i=!1;return this.totalIterations>this.maxIterations/3&&(i=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||i},a.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},a.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,i=this.graphManager.getAllNodes(),n=0;n<i.length;n++)(t=i[n]).noOfChildren=t.getNoOfChildren()},a.prototype.calcGrid=function(t){var i,n;i=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),n=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var r=new Array(i),s=0;s<i;s++)r[s]=new Array(n);for(s=0;s<i;s++)for(var e=0;e<n;e++)r[s][e]=new Array;return r},a.prototype.addNodeToGrid=function(t,i,n){var r,s,e,o;r=parseInt(Math.floor((t.getRect().x-i)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().width+t.getRect().x-i)/this.repulsionRange)),e=parseInt(Math.floor((t.getRect().y-n)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().height+t.getRect().y-n)/this.repulsionRange));for(var h=r;h<=s;h++)for(var a=e;a<=o;a++)this.grid[h][a].push(t),t.setGridCoordinates(r,s,e,o)},a.prototype.updateGrid=function(){var t,i,n=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<n.length;t++)i=n[t],this.addNodeToGrid(i,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},a.prototype.calculateRepulsionForceOfANode=function(t,i,n,r){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&n||r){var e,o=new Set;t.surrounding=new Array;for(var h=this.grid,a=t.startX-1;a<t.finishX+2;a++)for(var f=t.startY-1;f<t.finishY+2;f++)if(!(a<0||f<0||a>=h.length||f>=h[0].length))for(var u=0;u<h[a][f].length;u++)if(e=h[a][f][u],t.getOwner()==e.getOwner()&&t!=e&&!i.has(e)&&!o.has(e)){var c=Math.abs(t.getCenterX()-e.getCenterX())-(t.getWidth()/2+e.getWidth()/2),l=Math.abs(t.getCenterY()-e.getCenterY())-(t.getHeight()/2+e.getHeight()/2);c<=this.repulsionRange&&l<=this.repulsionRange&&o.add(e)}t.surrounding=[].concat(function(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}(o))}for(a=0;a<t.surrounding.length;a++)this.calcRepulsionForce(t,t.surrounding[a])},a.prototype.calcRepulsionRange=function(){return 0},t.exports=a},function(t,i,n){var r=n(1),s=n(4);function e(t,i,n){r.call(this,t,i,n),this.idealLength=s.DEFAULT_EDGE_LENGTH,this.edgeElasticity=s.DEFAULT_SPRING_STRENGTH}for(var o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];t.exports=e},function(t,i,n){var r=n(3),s=n(4);function e(t,i,n,e){r.call(this,t,i,n,e),this.nodeRepulsion=s.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 o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];e.prototype.setGridCoordinates=function(t,i,n,r){this.startX=t,this.finishX=i,this.startY=n,this.finishY=r},t.exports=e},function(t,i,n){function r(t,i){this.width=0,this.height=0,null!==t&&null!==i&&(this.height=i,this.width=t)}r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(t){this.width=t},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(t){this.height=t},t.exports=r},function(t,i,n){var r=n(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(t,i){var n=r.createID(t);this.contains(n)||(this.map[n]=i,this.keys.push(t))},s.prototype.contains=function(t){return r.createID(t),null!=this.map[t]},s.prototype.get=function(t){var i=r.createID(t);return this.map[i]},s.prototype.keySet=function(){return this.keys},t.exports=s},function(t,i,n){var r=n(14);function s(){this.set={}}s.prototype.add=function(t){var i=r.createID(t);this.contains(i)||(this.set[i]=t)},s.prototype.remove=function(t){delete this.set[r.createID(t)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(t){return this.set[r.createID(t)]==t},s.prototype.isEmpty=function(){return 0===this.size()},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(t){for(var i=Object.keys(this.set),n=i.length,r=0;r<n;r++)t.push(this.set[i[r]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(t){for(var i=t.length,n=0;n<i;n++){var r=t[n];this.add(r)}},t.exports=s},function(t,i,n){function r(){}r.multMat=function(t,i){for(var n=[],r=0;r<t.length;r++){n[r]=[];for(var s=0;s<i[0].length;s++){n[r][s]=0;for(var e=0;e<t[0].length;e++)n[r][s]+=t[r][e]*i[e][s]}}return n},r.transpose=function(t){for(var i=[],n=0;n<t[0].length;n++){i[n]=[];for(var r=0;r<t.length;r++)i[n][r]=t[r][n]}return i},r.multCons=function(t,i){for(var n=[],r=0;r<t.length;r++)n[r]=t[r]*i;return n},r.minusOp=function(t,i){for(var n=[],r=0;r<t.length;r++)n[r]=t[r]-i[r];return n},r.dotProduct=function(t,i){for(var n=0,r=0;r<t.length;r++)n+=t[r]*i[r];return n},r.mag=function(t){return Math.sqrt(this.dotProduct(t,t))},r.normalize=function(t){for(var i=[],n=this.mag(t),r=0;r<t.length;r++)i[r]=t[r]/n;return i},r.multGamma=function(t){for(var i=[],n=0,r=0;r<t.length;r++)n+=t[r];n*=-1/t.length;for(var s=0;s<t.length;s++)i[s]=n+t[s];return i},r.multL=function(t,i,n){for(var r=[],s=[],e=[],o=0;o<i[0].length;o++){for(var h=0,a=0;a<i.length;a++)h+=-.5*i[a][o]*t[a];s[o]=h}for(var f=0;f<n.length;f++){for(var u=0,c=0;c<n.length;c++)u+=n[f][c]*s[c];e[f]=u}for(var l=0;l<i.length;l++){for(var v=0,d=0;d<i[0].length;d++)v+=i[l][d]*e[d];r[l]=v}return r},t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=n(11),e=function(){function t(i,n){!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),null===n&&void 0===n||(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=i instanceof s?i.size():i.length,this._quicksort(i,0,r-1)}return r(t,[{key:"_quicksort",value:function(t,i,n){if(i<n){var r=this._partition(t,i,n);this._quicksort(t,i,r),this._quicksort(t,r+1,n)}}},{key:"_partition",value:function(t,i,n){for(var r=this._get(t,i),s=i,e=n;;){for(;this.compareFunction(r,this._get(t,e));)e--;for(;this.compareFunction(this._get(t,s),r);)s++;if(!(s<e))return e;this._swap(t,s,e),s++,e--}}},{key:"_get",value:function(t,i){return t instanceof s?t.get_object_at(i):t[i]}},{key:"_set",value:function(t,i,n){t instanceof s?t.set_object_at(i,n):t[i]=n}},{key:"_swap",value:function(t,i,n){var r=this._get(t,i);this._set(t,i,this._get(t,n)),this._set(t,n,r)}},{key:"_defaultCompareFunction",value:function(t,i){return i>t}}]),t}();t.exports=e},function(t,i,n){function r(){}r.svd=function(t){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=t.length,this.n=t[0].length;var i=Math.min(this.m,this.n);this.s=function(t){for(var i=[];t-- >0;)i.push(0);return i}(Math.min(this.m+1,this.n)),this.U=function t(i){if(0==i.length)return 0;for(var n=[],r=0;r<i[0];r++)n.push(t(i.slice(1)));return n}([this.m,i]),this.V=function(t){return function t(i){if(0==i.length)return 0;for(var n=[],r=0;r<i[0];r++)n.push(t(i.slice(1)));return n}(t)}([this.n,this.n]);for(var n=function(t){for(var i=[];t-- >0;)i.push(0);return i}(this.n),s=function(t){for(var i=[];t-- >0;)i.push(0);return i}(this.m),e=Math.min(this.m-1,this.n),o=Math.max(0,Math.min(this.n-2,this.m)),h=0;h<Math.max(e,o);h++){if(h<e){this.s[h]=0;for(var a=h;a<this.m;a++)this.s[h]=r.hypot(this.s[h],t[a][h]);if(0!==this.s[h]){t[h][h]<0&&(this.s[h]=-this.s[h]);for(var f=h;f<this.m;f++)t[f][h]/=this.s[h];t[h][h]+=1}this.s[h]=-this.s[h]}for(var u=h+1;u<this.n;u++){if(function(t,i){return t&&i}(h<e,0!==this.s[h])){for(var c=0,l=h;l<this.m;l++)c+=t[l][h]*t[l][u];c=-c/t[h][h];for(var v=h;v<this.m;v++)t[v][u]+=c*t[v][h]}n[u]=t[h][u]}if(function(t,i){return i}(0,h<e))for(var d=h;d<this.m;d++)this.U[d][h]=t[d][h];if(h<o){n[h]=0;for(var y=h+1;y<this.n;y++)n[h]=r.hypot(n[h],n[y]);if(0!==n[h]){n[h+1]<0&&(n[h]=-n[h]);for(var p=h+1;p<this.n;p++)n[p]/=n[h];n[h+1]+=1}if(n[h]=-n[h],function(t,i){return t&&i}(h+1<this.m,0!==n[h])){for(var w=h+1;w<this.m;w++)s[w]=0;for(var g=h+1;g<this.n;g++)for(var m=h+1;m<this.m;m++)s[m]+=n[g]*t[m][g];for(var b=h+1;b<this.n;b++)for(var M=-n[b]/n[h+1],k=h+1;k<this.m;k++)t[k][b]+=M*s[k]}for(var x=h+1;x<this.n;x++)this.V[x][h]=n[x]}}var S=Math.min(this.n,this.m+1);e<this.n&&(this.s[e]=t[e][e]),this.m<S&&(this.s[S-1]=0),o+1<S&&(n[o]=t[o][S-1]),n[S-1]=0;for(var $=e;$<i;$++){for(var j=0;j<this.m;j++)this.U[j][$]=0;this.U[$][$]=1}for(var O=e-1;O>=0;O--)if(0!==this.s[O]){for(var A=O+1;A<i;A++){for(var T=0,I=O;I<this.m;I++)T+=this.U[I][O]*this.U[I][A];T=-T/this.U[O][O];for(var E=O;E<this.m;E++)this.U[E][A]+=T*this.U[E][O]}for(var L=O;L<this.m;L++)this.U[L][O]=-this.U[L][O];this.U[O][O]=1+this.U[O][O];for(var D=0;D<O-1;D++)this.U[D][O]=0}else{for(var N=0;N<this.m;N++)this.U[N][O]=0;this.U[O][O]=1}for(var z=this.n-1;z>=0;z--){if(function(t,i){return t&&i}(z<o,0!==n[z]))for(var B=z+1;B<i;B++){for(var C=0,P=z+1;P<this.n;P++)C+=this.V[P][z]*this.V[P][B];C=-C/this.V[z+1][z];for(var R=z+1;R<this.n;R++)this.V[R][B]+=C*this.V[R][z]}for(var G=0;G<this.n;G++)this.V[G][z]=0;this.V[z][z]=1}for(var q=S-1,F=Math.pow(2,-52),X=Math.pow(2,-966);S>0;){var Y=void 0,_=void 0;for(Y=S-2;Y>=-1&&-1!==Y;Y--)if(Math.abs(n[Y])<=X+F*(Math.abs(this.s[Y])+Math.abs(this.s[Y+1]))){n[Y]=0;break}if(Y===S-2)_=4;else{var H=void 0;for(H=S-1;H>=Y&&H!==Y;H--){var Z=(H!==S?Math.abs(n[H]):0)+(H!==Y+1?Math.abs(n[H-1]):0);if(Math.abs(this.s[H])<=X+F*Z){this.s[H]=0;break}}H===Y?_=3:H===S-1?_=1:(_=2,Y=H)}switch(Y++,_){case 1:var J=n[S-2];n[S-2]=0;for(var V=S-2;V>=Y;V--){var W=r.hypot(this.s[V],J),U=this.s[V]/W,K=J/W;this.s[V]=W,V!==Y&&(J=-K*n[V-1],n[V-1]=U*n[V-1]);for(var Q=0;Q<this.n;Q++)W=U*this.V[Q][V]+K*this.V[Q][S-1],this.V[Q][S-1]=-K*this.V[Q][V]+U*this.V[Q][S-1],this.V[Q][V]=W}break;case 2:var tt=n[Y-1];n[Y-1]=0;for(var it=Y;it<S;it++){var nt=r.hypot(this.s[it],tt),rt=this.s[it]/nt,st=tt/nt;this.s[it]=nt,tt=-st*n[it],n[it]=rt*n[it];for(var et=0;et<this.m;et++)nt=rt*this.U[et][it]+st*this.U[et][Y-1],this.U[et][Y-1]=-st*this.U[et][it]+rt*this.U[et][Y-1],this.U[et][it]=nt}break;case 3:var ot=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[S-1]),Math.abs(this.s[S-2])),Math.abs(n[S-2])),Math.abs(this.s[Y])),Math.abs(n[Y])),ht=this.s[S-1]/ot,at=this.s[S-2]/ot,ft=n[S-2]/ot,ut=this.s[Y]/ot,ct=n[Y]/ot,lt=((at+ht)*(at-ht)+ft*ft)/2,vt=ht*ft*(ht*ft),dt=0;(function(t,i){return t||i})(0!==lt,0!==vt)&&(dt=Math.sqrt(lt*lt+vt),lt<0&&(dt=-dt),dt=vt/(lt+dt));for(var yt=(ut+ht)*(ut-ht)+dt,pt=ut*ct,wt=Y;wt<S-1;wt++){var gt=r.hypot(yt,pt),mt=yt/gt,bt=pt/gt;wt!==Y&&(n[wt-1]=gt),yt=mt*this.s[wt]+bt*n[wt],n[wt]=mt*n[wt]-bt*this.s[wt],pt=bt*this.s[wt+1],this.s[wt+1]=mt*this.s[wt+1];for(var Mt=0;Mt<this.n;Mt++)gt=mt*this.V[Mt][wt]+bt*this.V[Mt][wt+1],this.V[Mt][wt+1]=-bt*this.V[Mt][wt]+mt*this.V[Mt][wt+1],this.V[Mt][wt]=gt;if(mt=yt/(gt=r.hypot(yt,pt)),bt=pt/gt,this.s[wt]=gt,yt=mt*n[wt]+bt*this.s[wt+1],this.s[wt+1]=-bt*n[wt]+mt*this.s[wt+1],pt=bt*n[wt+1],n[wt+1]=mt*n[wt+1],wt<this.m-1)for(var kt=0;kt<this.m;kt++)gt=mt*this.U[kt][wt]+bt*this.U[kt][wt+1],this.U[kt][wt+1]=-bt*this.U[kt][wt]+mt*this.U[kt][wt+1],this.U[kt][wt]=gt}n[S-2]=yt;break;case 4:if(this.s[Y]<=0){this.s[Y]=this.s[Y]<0?-this.s[Y]:0;for(var xt=0;xt<=q;xt++)this.V[xt][Y]=-this.V[xt][Y]}for(;Y<q&&!(this.s[Y]>=this.s[Y+1]);){var St=this.s[Y];if(this.s[Y]=this.s[Y+1],this.s[Y+1]=St,Y<this.n-1)for(var $t=0;$t<this.n;$t++)St=this.V[$t][Y+1],this.V[$t][Y+1]=this.V[$t][Y],this.V[$t][Y]=St;if(Y<this.m-1)for(var jt=0;jt<this.m;jt++)St=this.U[jt][Y+1],this.U[jt][Y+1]=this.U[jt][Y],this.U[jt][Y]=St;Y++}S--}}return{U:this.U,V:this.V,S:this.s}},r.hypot=function(t,i){var n=void 0;return Math.abs(t)>Math.abs(i)?(n=i/t,n=Math.abs(t)*Math.sqrt(1+n*n)):0!=i?(n=t/i,n=Math.abs(i)*Math.sqrt(1+n*n)):n=0,n},t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=function(){function t(i,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.sequence1=i,this.sequence2=n,this.match_score=r,this.mismatch_penalty=s,this.gap_penalty=e,this.iMax=i.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o<this.iMax;o++){this.grid[o]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[o][h]=0}this.tracebackGrid=new Array(this.iMax);for(var a=0;a<this.iMax;a++){this.tracebackGrid[a]=new Array(this.jMax);for(var f=0;f<this.jMax;f++)this.tracebackGrid[a][f]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(t,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var i=1;i<this.iMax;i++)this.grid[i][0]=this.grid[i-1][0]+this.gap_penalty,this.tracebackGrid[i][0]=[!1,!0,!1];for(var n=1;n<this.iMax;n++)for(var r=1;r<this.jMax;r++){var s=[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,this.grid[n-1][r]+this.gap_penalty,this.grid[n][r-1]+this.gap_penalty],e=this.arrayAllMaxIndexes(s);this.grid[n][r]=s[e[0]],this.tracebackGrid[n][r]=[e.includes(0),e.includes(1),e.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var i=t[0],n=this.tracebackGrid[i.pos[0]][i.pos[1]];n[0]&&t.push({pos:[i.pos[0]-1,i.pos[1]-1],seq1:this.sequence1[i.pos[0]-1]+i.seq1,seq2:this.sequence2[i.pos[1]-1]+i.seq2}),n[1]&&t.push({pos:[i.pos[0]-1,i.pos[1]],seq1:this.sequence1[i.pos[0]-1]+i.seq1,seq2:"-"+i.seq2}),n[2]&&t.push({pos:[i.pos[0],i.pos[1]-1],seq1:"-"+i.seq1,seq2:this.sequence2[i.pos[1]-1]+i.seq2}),0===i.pos[0]&&0===i.pos[1]&&this.alignments.push({sequence1:i.seq1,sequence2:i.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,i){for(var n=[],r=-1;-1!==(r=t.indexOf(i,r+1));)n.push(r);return n}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]),t}();t.exports=s},function(t,i,n){var r=function(){};r.FDLayout=n(18),r.FDLayoutConstants=n(4),r.FDLayoutEdge=n(19),r.FDLayoutNode=n(20),r.DimensionD=n(21),r.HashMap=n(22),r.HashSet=n(23),r.IGeometry=n(8),r.IMath=n(9),r.Integer=n(10),r.Point=n(12),r.PointD=n(5),r.RandomSeed=n(16),r.RectangleD=n(13),r.Transform=n(17),r.UniqueIDGeneretor=n(14),r.Quicksort=n(25),r.LinkedList=n(11),r.LGraphObject=n(2),r.LGraph=n(6),r.LEdge=n(1),r.LGraphManager=n(7),r.LNode=n(3),r.Layout=n(15),r.LayoutConstants=n(0),r.NeedlemanWunsch=n(27),r.Matrix=n(24),r.SVD=n(26),t.exports=r},function(t,i,n){function r(){this.listeners=[]}var s=r.prototype;s.addListener=function(t,i){this.listeners.push({event:t,callback:i})},s.removeListener=function(t,i){for(var n=this.listeners.length;n>=0;n--){var r=this.listeners[n];r.event===t&&r.callback===i&&this.listeners.splice(n,1)}},s.emit=function(t,i){for(var n=0;n<this.listeners.length;n++){var r=this.listeners[n];t===r.event&&r.callback(i)}},t.exports=r}])},I.exports=t());var t}var L;function D(){return L?T.exports:(L=1,t=function(t){return i={45:(t,i,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),t.exports=r},806:(t,i,n)=>{var r=n(551).FDLayoutConstants;function s(){}for(var e in r)s[e]=r[e];s.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,s.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,s.DEFAULT_COMPONENT_SEPERATION=60,s.TILE=!0,s.TILING_PADDING_VERTICAL=10,s.TILING_PADDING_HORIZONTAL=10,s.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,s.ENFORCE_CONSTRAINTS=!0,s.APPLY_LAYOUT=!0,s.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,s.TREE_REDUCTION_ON_INCREMENTAL=!0,s.PURE_INCREMENTAL=s.DEFAULT_INCREMENTAL,t.exports=s},767:(t,i,n)=>{var r=n(551).FDLayoutEdge;function s(t,i,n){r.call(this,t,i,n)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},880:(t,i,n)=>{var r=n(551).LGraph;function s(t,i,n){r.call(this,t,i,n)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},578:(t,i,n)=>{var r=n(551).LGraphManager;function s(t){r.call(this,t)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},765:(t,i,n)=>{var r=n(551).FDLayout,s=n(578),e=n(880),o=n(991),h=n(767),a=n(806),f=n(902),u=n(551).FDLayoutConstants,c=n(551).LayoutConstants,l=n(551).Point,v=n(551).PointD,d=n(551).DimensionD,y=n(551).Layout,p=n(551).Integer,w=n(551).IGeometry,g=n(551).LGraph,m=n(551).Transform,b=n(551).LinkedList;function M(){r.call(this),this.toBeTiled={},this.constraints={}}for(var k in M.prototype=Object.create(r.prototype),r)M[k]=r[k];M.prototype.newGraphManager=function(){var t=new s(this);return this.graphManager=t,t},M.prototype.newGraph=function(t){return new e(null,this.graphManager,t)},M.prototype.newNode=function(t){return new o(this.graphManager,t)},M.prototype.newEdge=function(t){return new h(null,null,t)},M.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(a.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=a.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){return c.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.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)a.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),i=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(t){return i.has(t)}),this.graphManager.setAllNodesToApplyGravitation(n));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var i=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(t){return i.has(t)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(f.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),a.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter(function(i){return t.has(i)});this.graphManager.setAllNodesToApplyGravitation(i),this.graphManager.updateBounds(),this.updateGrid(),a.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=u.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()),a.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=u.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},M.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),i={},n=0;n<t.length;n++){var r=t[n].rect,s=t[n].id;i[s]={id:s,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return i},M.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===u.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},M.prototype.moveNodes=function(){for(var t=this.getAllNodes(),i=0;i<t.length;i++)t[i].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),i=0;i<t.length;i++)t[i].move()},M.prototype.initConstraintVariables=function(){var t=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var i=this.graphManager.getAllNodes(),n=0;n<i.length;n++){var r=i[n];this.idToNodeMap.set(r.id,r)}var s=function i(n){for(var r,s=n.getChild().getNodes(),e=0,o=0;o<s.length;o++)null==(r=s[o]).getChild()?t.fixedNodeSet.has(r.id)&&(e+=100):e+=i(r);return e};if(this.constraints.fixedNodeConstraint)for(this.constraints.fixedNodeConstraint.forEach(function(i){t.fixedNodeSet.add(i.nodeId)}),i=this.graphManager.getAllNodes(),n=0;n<i.length;n++)if(null!=(r=i[n]).getChild()){var e=s(r);e>0&&(r.fixedNodeWeight=e)}if(this.constraints.relativePlacementConstraint){var o=new Map,h=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(i){t.fixedNodesOnHorizontal.add(i),t.fixedNodesOnVertical.add(i)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var f=this.constraints.alignmentConstraint.vertical;for(n=0;n<f.length;n++)this.dummyToNodeForVerticalAlignment.set("dummy"+n,[]),f[n].forEach(function(i){o.set(i,"dummy"+n),t.dummyToNodeForVerticalAlignment.get("dummy"+n).push(i),t.fixedNodeSet.has(i)&&t.fixedNodesOnHorizontal.add("dummy"+n)})}if(this.constraints.alignmentConstraint.horizontal){var u=this.constraints.alignmentConstraint.horizontal;for(n=0;n<u.length;n++)this.dummyToNodeForHorizontalAlignment.set("dummy"+n,[]),u[n].forEach(function(i){h.set(i,"dummy"+n),t.dummyToNodeForHorizontalAlignment.get("dummy"+n).push(i),t.fixedNodeSet.has(i)&&t.fixedNodesOnVertical.add("dummy"+n)})}}if(a.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(t){var i,n,r;for(r=t.length-1;r>=2*t.length/3;r--)i=Math.floor(Math.random()*(r+1)),n=t[r],t[r]=t[i],t[i]=n;return t},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(i){if(i.left){var n=o.has(i.left)?o.get(i.left):i.left,r=o.has(i.right)?o.get(i.right):i.right;t.nodesInRelativeHorizontal.includes(n)||(t.nodesInRelativeHorizontal.push(n),t.nodeToRelativeConstraintMapHorizontal.set(n,[]),t.dummyToNodeForVerticalAlignment.has(n)?t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(n,t.idToNodeMap.get(n).getCenterX())),t.nodesInRelativeHorizontal.includes(r)||(t.nodesInRelativeHorizontal.push(r),t.nodeToRelativeConstraintMapHorizontal.set(r,[]),t.dummyToNodeForVerticalAlignment.has(r)?t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(r).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:i.gap}),t.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:i.gap})}else{var s=h.has(i.top)?h.get(i.top):i.top,e=h.has(i.bottom)?h.get(i.bottom):i.bottom;t.nodesInRelativeVertical.includes(s)||(t.nodesInRelativeVertical.push(s),t.nodeToRelativeConstraintMapVertical.set(s,[]),t.dummyToNodeForHorizontalAlignment.has(s)?t.nodeToTempPositionMapVertical.set(s,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(s)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(s,t.idToNodeMap.get(s).getCenterY())),t.nodesInRelativeVertical.includes(e)||(t.nodesInRelativeVertical.push(e),t.nodeToRelativeConstraintMapVertical.set(e,[]),t.dummyToNodeForHorizontalAlignment.has(e)?t.nodeToTempPositionMapVertical.set(e,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(e,t.idToNodeMap.get(e).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(s).push({bottom:e,gap:i.gap}),t.nodeToRelativeConstraintMapVertical.get(e).push({top:s,gap:i.gap})}});else{var c=new Map,l=new Map;this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var i=o.has(t.left)?o.get(t.left):t.left,n=o.has(t.right)?o.get(t.right):t.right;c.has(i)?c.get(i).push(n):c.set(i,[n]),c.has(n)?c.get(n).push(i):c.set(n,[i])}else{var r=h.has(t.top)?h.get(t.top):t.top,s=h.has(t.bottom)?h.get(t.bottom):t.bottom;l.has(r)?l.get(r).push(s):l.set(r,[s]),l.has(s)?l.get(s).push(r):l.set(s,[r])}});var v=function(t,i){var n=[],r=[],s=new b,e=new Set,o=0;return t.forEach(function(h,a){if(!e.has(a)){n[o]=[],r[o]=!1;var f=a;for(s.push(f),e.add(f),n[o].push(f);0!=s.length;)f=s.shift(),i.has(f)&&(r[o]=!0),t.get(f).forEach(function(t){e.has(t)||(s.push(t),e.add(t),n[o].push(t))});o++}}),{components:n,isFixed:r}},d=v(c,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=d.components,this.fixedComponentsOnHorizontal=d.isFixed;var y=v(l,t.fixedNodesOnVertical);this.componentsOnVertical=y.components,this.fixedComponentsOnVertical=y.isFixed}}},M.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(i){var n=t.idToNodeMap.get(i.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var i=this.constraints.alignmentConstraint.vertical,n=0;n<i.length;n++){for(var r=0,s=0;s<i[n].length;s++){if(this.fixedNodeSet.has(i[n][s])){r=0;break}r+=this.idToNodeMap.get(i[n][s]).displacementX}var e=r/i[n].length;for(s=0;s<i[n].length;s++)this.idToNodeMap.get(i[n][s]).displacementX=e}if(this.constraints.alignmentConstraint.horizontal){var o=this.constraints.alignmentConstraint.horizontal;for(n=0;n<o.length;n++){var h=0;for(s=0;s<o[n].length;s++){if(this.fixedNodeSet.has(o[n][s])){h=0;break}h+=this.idToNodeMap.get(o[n][s]).displacementY}var f=h/o[n].length;for(s=0;s<o[n].length;s++)this.idToNodeMap.get(o[n][s]).displacementY=f}}}if(this.constraints.relativePlacementConstraint)if(a.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(i){if(!t.fixedNodesOnHorizontal.has(i)){var n=0;n=t.dummyToNodeForVerticalAlignment.has(i)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).displacementX:t.idToNodeMap.get(i).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(i).forEach(function(r){var s;r.right?(s=t.nodeToTempPositionMapHorizontal.get(r.right)-t.nodeToTempPositionMapHorizontal.get(i)-n)<r.gap&&(n-=r.gap-s):(s=t.nodeToTempPositionMapHorizontal.get(i)-t.nodeToTempPositionMapHorizontal.get(r.left)+n)<r.gap&&(n+=r.gap-s)}),t.nodeToTempPositionMapHorizontal.set(i,t.nodeToTempPositionMapHorizontal.get(i)+n),t.dummyToNodeForVerticalAlignment.has(i)?t.dummyToNodeForVerticalAlignment.get(i).forEach(function(i){t.idToNodeMap.get(i).displacementX=n}):t.idToNodeMap.get(i).displacementX=n}}),this.nodesInRelativeVertical.forEach(function(i){if(!t.fixedNodesOnHorizontal.has(i)){var n=0;n=t.dummyToNodeForHorizontalAlignment.has(i)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(i)[0]).displacementY:t.idToNodeMap.get(i).displacementY,t.nodeToRelativeConstraintMapVertical.get(i).forEach(function(r){var s;r.bottom?(s=t.nodeToTempPositionMapVertical.get(r.bottom)-t.nodeToTempPositionMapVertical.get(i)-n)<r.gap&&(n-=r.gap-s):(s=t.nodeToTempPositionMapVertical.get(i)-t.nodeToTempPositionMapVertical.get(r.top)+n)<r.gap&&(n+=r.gap-s)}),t.nodeToTempPositionMapVertical.set(i,t.nodeToTempPositionMapVertical.get(i)+n),t.dummyToNodeForHorizontalAlignment.has(i)?t.dummyToNodeForHorizontalAlignment.get(i).forEach(function(i){t.idToNodeMap.get(i).displacementY=n}):t.idToNodeMap.get(i).displacementY=n}});else{for(n=0;n<this.componentsOnHorizontal.length;n++){var u=this.componentsOnHorizontal[n];if(this.fixedComponentsOnHorizontal[n])for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?this.dummyToNodeForVerticalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementX=0}):this.idToNodeMap.get(u[s]).displacementX=0;else{var c=0,l=0;for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?(c+=(d=this.dummyToNodeForVerticalAlignment.get(u[s])).length*this.idToNodeMap.get(d[0]).displacementX,l+=d.length):(c+=this.idToNodeMap.get(u[s]).displacementX,l++);var v=c/l;for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?this.dummyToNodeForVerticalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementX=v}):this.idToNodeMap.get(u[s]).displacementX=v}}for(n=0;n<this.componentsOnVertical.length;n++)if(u=this.componentsOnVertical[n],this.fixedComponentsOnVertical[n])for(s=0;s<u.length;s++)this.dummyToNodeForHorizontalAlignment.has(u[s])?this.dummyToNodeForHorizontalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementY=0}):this.idToNodeMap.get(u[s]).displacementY=0;else{for(c=0,l=0,s=0;s<u.length;s++){var d;this.dummyToNodeForHorizontalAlignment.has(u[s])?(c+=(d=this.dummyToNodeForHorizontalAlignment.get(u[s])).length*this.idToNodeMap.get(d[0]).displacementY,l+=d.length):(c+=this.idToNodeMap.get(u[s]).displacementY,l++)}for(v=c/l,s=0;s<u.length;s++)this.dummyToNodeForHorizontalAlignment.has(u[s])?this.dummyToNodeForHorizontalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementY=v}):this.idToNodeMap.get(u[s]).displacementY=v}}},M.prototype.calculateNodesToApplyGravitationTo=function(){var t,i,n=[],r=this.graphManager.getGraphs(),s=r.length;for(i=0;i<s;i++)(t=r[i]).updateConnected(),t.isConnected||(n=n.concat(t.getNodes()));return n},M.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var i,n=new Set;for(i=0;i<t.length;i++){var r=t[i];if(!n.has(r)){var s=r.getSource(),e=r.getTarget();if(s==e)r.getBendpoints().push(new v),r.getBendpoints().push(new v),this.createDummyNodesForBendpoints(r),n.add(r);else{var o=[];if(o=(o=o.concat(s.getEdgeListToNode(e))).concat(e.getEdgeListToNode(s)),!n.has(o[0])){var h;if(o.length>1)for(h=0;h<o.length;h++){var a=o[h];a.getBendpoints().push(new v),this.createDummyNodesForBendpoints(a)}o.forEach(function(t){n.add(t)})}}}if(n.size==t.length)break}},M.prototype.positionNodesRadially=function(t){for(var i=new l(0,0),n=Math.ceil(Math.sqrt(t.length)),r=0,s=0,e=0,o=new v(0,0),h=0;h<t.length;h++){h%n==0&&(e=0,s=r,0!=h&&(s+=a.DEFAULT_COMPONENT_SEPERATION),r=0);var f=t[h],u=y.findCenterOfTree(f);i.x=e,i.y=s,(o=M.radialLayout(f,u,i)).y>r&&(r=Math.floor(o.y)),e=Math.floor(o.x+a.DEFAULT_COMPONENT_SEPERATION)}this.transform(new v(c.WORLD_CENTER_X-o.x/2,c.WORLD_CENTER_Y-o.y/2))},M.radialLayout=function(t,i,n){var r=Math.max(this.maxDiagonalInTree(t),a.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(i,null,0,359,0,r);var s=g.calculateBounds(t),e=new m;e.setDeviceOrgX(s.getMinX()),e.setDeviceOrgY(s.getMinY()),e.setWorldOrgX(n.x),e.setWorldOrgY(n.y);for(var o=0;o<t.length;o++)t[o].transform(e);var h=new v(s.getMaxX(),s.getMaxY());return e.inverseTransformPoint(h)},M.branchRadialLayout=function(t,i,n,r,s,e){var o=(r-n+1)/2;o<0&&(o+=180);var h=(o+n)%360*w.TWO_PI/360,a=s*Math.cos(h),f=s*Math.sin(h);t.setCenter(a,f);var u=[],c=(u=u.concat(t.getEdges())).length;null!=i&&c--;for(var l,v=0,d=u.length,y=t.getEdgesBetween(i);y.length>1;){var p=y[0];y.splice(0,1);var g=u.indexOf(p);g>=0&&u.splice(g,1),d--,c--}l=null!=i?(u.indexOf(y[0])+1)%d:0;for(var m=Math.abs(r-n)/c,b=l;v!=c;b=++b%d){var k=u[b].getOtherEnd(t);if(k!=i){var x=(n+v*m)%360,S=(x+m)%360;M.branchRadialLayout(k,t,x,S,s+e,e),v++}}},M.maxDiagonalInTree=function(t){for(var i=p.MIN_VALUE,n=0;n<t.length;n++){var r=t[n].getDiagonal();r>i&&(i=r)}return i},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var t=this,i={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),s=0;s<r.length;s++){var e=(h=r[s]).getParent();0!==this.getNodeDegreeWithChildren(h)||null!=e.id&&this.getToBeTiled(e)||n.push(h)}for(s=0;s<n.length;s++){var h,a=(h=n[s]).getParent().id;void 0===i[a]&&(i[a]=[]),i[a]=i[a].concat(h)}Object.keys(i).forEach(function(n){if(i[n].length>1){var r="DummyCompound_"+n;t.memberGroups[r]=i[n];var s=i[n][0].getParent(),e=new o(t.graphManager);e.id=r,e.paddingLeft=s.paddingLeft||0,e.paddingRight=s.paddingRight||0,e.paddingBottom=s.paddingBottom||0,e.paddingTop=s.paddingTop||0,t.idToDummyNode[r]=e;var h=t.getGraphManager().add(t.newGraph(),e),a=s.getChild();a.add(e);for(var f=0;f<i[n].length;f++){var u=i[n][f];a.remove(u),h.add(u)}}})},M.prototype.clearCompounds=function(){var t={},i={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)i[this.compoundOrder[n].id]=this.compoundOrder[n],t[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(t,i)},M.prototype.clearZeroDegreeMembers=function(){var t=this,i=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(n){var r=t.idToDummyNode[n];if(i[n]=t.tileNodes(t.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=i[n].width,r.rect.height=i[n].height,r.setCenter(i[n].centerX,i[n].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,a.NODE_DIMENSIONS_INCLUDE_LABELS){var s=r.rect.width,e=r.rect.height;r.labelWidth&&("left"==r.labelPosHorizontal?(r.rect.x-=r.labelWidth,r.setWidth(s+r.labelWidth),r.labelMarginLeft=r.labelWidth):"center"==r.labelPosHorizontal&&r.labelWidth>s?(r.rect.x-=(r.labelWidth-s)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-s)/2):"right"==r.labelPosHorizontal&&r.setWidth(s+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(e+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>e?(r.rect.y-=(r.labelHeight-e)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-e)/2):"bottom"==r.labelPosVertical&&r.setHeight(e+r.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var i=this.compoundOrder[t],n=i.id,r=i.paddingLeft,s=i.paddingTop,e=i.labelMarginLeft,o=i.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],i.rect.x,i.rect.y,r,s,e,o)}},M.prototype.repopulateZeroDegreeMembers=function(){var t=this,i=this.tiledZeroDegreePack;Object.keys(i).forEach(function(n){var r=t.idToDummyNode[n],s=r.paddingLeft,e=r.paddingTop,o=r.labelMarginLeft,h=r.labelMarginTop;t.adjustLocations(i[n],r.rect.x,r.rect.y,s,e,o,h)})},M.prototype.getToBeTiled=function(t){var i=t.id;if(null!=this.toBeTiled[i])return this.toBeTiled[i];var n=t.getChild();if(null==n)return this.toBeTiled[i]=!1,!1;for(var r=n.getNodes(),s=0;s<r.length;s++){var e=r[s];if(this.getNodeDegree(e)>0)return this.toBeTiled[i]=!1,!1;if(null!=e.getChild()){if(!this.getToBeTiled(e))return this.toBeTiled[i]=!1,!1}else this.toBeTiled[e.id]=!1}return this.toBeTiled[i]=!0,!0},M.prototype.getNodeDegree=function(t){t.id;for(var i=t.getEdges(),n=0,r=0;r<i.length;r++){var s=i[r];s.getSource().id!==s.getTarget().id&&(n+=1)}return n},M.prototype.getNodeDegreeWithChildren=function(t){var i=this.getNodeDegree(t);if(null==t.getChild())return i;for(var n=t.getChild().getNodes(),r=0;r<n.length;r++){var s=n[r];i+=this.getNodeDegreeWithChildren(s)}return i},M.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},M.prototype.fillCompexOrderByDFS=function(t){for(var i=0;i<t.length;i++){var n=t[i];null!=n.getChild()&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},M.prototype.adjustLocations=function(t,i,n,r,s,e,o){n+=s+o;for(var h=i+=r+e,a=0;a<t.rows.length;a++){var f=t.rows[a];i=h;for(var u=0,c=0;c<f.length;c++){var l=f[c];l.rect.x=i,l.rect.y=n,i+=l.rect.width+t.horizontalPadding,l.rect.height>u&&(u=l.rect.height)}n+=u+t.verticalPadding}},M.prototype.tileCompoundMembers=function(t,i){var n=this;this.tiledMemberPack=[],Object.keys(t).forEach(function(r){var s=i[r];if(n.tiledMemberPack[r]=n.tileNodes(t[r],s.paddingLeft+s.paddingRight),s.rect.width=n.tiledMemberPack[r].width,s.rect.height=n.tiledMemberPack[r].height,s.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),s.labelMarginLeft=0,s.labelMarginTop=0,a.NODE_DIMENSIONS_INCLUDE_LABELS){var e=s.rect.width,o=s.rect.height;s.labelWidth&&("left"==s.labelPosHorizontal?(s.rect.x-=s.labelWidth,s.setWidth(e+s.labelWidth),s.labelMarginLeft=s.labelWidth):"center"==s.labelPosHorizontal&&s.labelWidth>e?(s.rect.x-=(s.labelWidth-e)/2,s.setWidth(s.labelWidth),s.labelMarginLeft=(s.labelWidth-e)/2):"right"==s.labelPosHorizontal&&s.setWidth(e+s.labelWidth)),s.labelHeight&&("top"==s.labelPosVertical?(s.rect.y-=s.labelHeight,s.setHeight(o+s.labelHeight),s.labelMarginTop=s.labelHeight):"center"==s.labelPosVertical&&s.labelHeight>o?(s.rect.y-=(s.labelHeight-o)/2,s.setHeight(s.labelHeight),s.labelMarginTop=(s.labelHeight-o)/2):"bottom"==s.labelPosVertical&&s.setHeight(o+s.labelHeight))}})},M.prototype.tileNodes=function(t,i){var n=this.tileNodesByFavoringDim(t,i,!0),r=this.tileNodesByFavoringDim(t,i,!1),s=this.getOrgRatio(n);return this.getOrgRatio(r)<s?r:n},M.prototype.getOrgRatio=function(t){var i=t.width/t.height;return i<1&&(i=1/i),i},M.prototype.calcIdealRowWidth=function(t,i){var n=a.TILING_PADDING_VERTICAL,r=a.TILING_PADDING_HORIZONTAL,s=t.length,e=0,o=0,h=0;t.forEach(function(t){e+=t.getWidth(),o+=t.getHeight(),t.getWidth()>h&&(h=t.getWidth())});var f,u=e/s,c=o/s,l=Math.pow(n-r,2)+4*(u+r)*(c+n)*s,v=(r-n+Math.sqrt(l))/(2*(u+r));i?(f=Math.ceil(v))==v&&f++:f=Math.floor(v);var d=f*(u+r)-r;return h>d&&(d=h),d+=2*r},M.prototype.tileNodesByFavoringDim=function(t,i,n){var r=a.TILING_PADDING_VERTICAL,s=a.TILING_PADDING_HORIZONTAL,e=a.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:i,verticalPadding:r,horizontalPadding:s,centerX:0,centerY:0};e&&(o.idealRowWidth=this.calcIdealRowWidth(t,n));var h=function(t){return t.rect.width*t.rect.height},f=function(t,i){return h(i)-h(t)};t.sort(function(t,i){var n=f;return o.idealRowWidth?(n=e)(t.id,i.id):n(t,i)});for(var u=0,c=0,l=0;l<t.length;l++)u+=(v=t[l]).getCenterX(),c+=v.getCenterY();for(o.centerX=u/t.length,o.centerY=c/t.length,l=0;l<t.length;l++){var v=t[l];if(0==o.rows.length)this.insertNodeToRow(o,v,0,i);else if(this.canAddHorizontal(o,v.rect.width,v.rect.height)){var d=o.rows.length-1;o.idealRowWidth||(d=this.getShortestRowIndex(o)),this.insertNodeToRow(o,v,d,i)}else this.insertNodeToRow(o,v,o.rows.length,i);this.shiftToLastRow(o)}return o},M.prototype.insertNodeToRow=function(t,i,n,r){var s=r;n==t.rows.length&&(t.rows.push([]),t.rowWidth.push(s),t.rowHeight.push(0));var e=t.rowWidth[n]+i.rect.width;t.rows[n].length>0&&(e+=t.horizontalPadding),t.rowWidth[n]=e,t.width<e&&(t.width=e);var o=i.rect.height;n>0&&(o+=t.verticalPadding);var h=0;o>t.rowHeight[n]&&(h=t.rowHeight[n],t.rowHeight[n]=o,h=t.rowHeight[n]-h),t.height+=h,t.rows[n].push(i)},M.prototype.getShortestRowIndex=function(t){for(var i=-1,n=Number.MAX_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]<n&&(i=r,n=t.rowWidth[r]);return i},M.prototype.getLongestRowIndex=function(t){for(var i=-1,n=Number.MIN_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]>n&&(i=r,n=t.rowWidth[r]);return i},M.prototype.canAddHorizontal=function(t,i,n){if(t.idealRowWidth){var r=t.rows.length-1;return t.rowWidth[r]+i+t.horizontalPadding<=t.idealRowWidth}var s=this.getShortestRowIndex(t);if(s<0)return!0;var e=t.rowWidth[s];if(e+t.horizontalPadding+i<=t.width)return!0;var o,h,a=0;return t.rowHeight[s]<n&&s>0&&(a=n+t.verticalPadding-t.rowHeight[s]),o=t.width-e>=i+t.horizontalPadding?(t.height+a)/(e+i+t.horizontalPadding):(t.height+a)/t.width,a=n+t.verticalPadding,(h=t.width<i?(t.height+a)/i:(t.height+a)/t.width)<1&&(h=1/h),o<1&&(o=1/o),o<h},M.prototype.shiftToLastRow=function(t){var i=this.getLongestRowIndex(t),n=t.rowWidth.length-1,r=t.rows[i],s=r[r.length-1],e=s.width+t.horizontalPadding;if(t.width-t.rowWidth[n]>e&&i!=n){r.splice(-1,1),t.rows[n].push(s),t.rowWidth[i]=t.rowWidth[i]-e,t.rowWidth[n]=t.rowWidth[n]+e,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var o=Number.MIN_VALUE,h=0;h<r.length;h++)r[h].height>o&&(o=r[h].height);i>0&&(o+=t.verticalPadding);var a=t.rowHeight[i]+t.rowHeight[n];t.rowHeight[i]=o,t.rowHeight[n]<s.height+t.verticalPadding&&(t.rowHeight[n]=s.height+t.verticalPadding);var f=t.rowHeight[i]+t.rowHeight[n];t.height+=f-a,this.shiftToLastRow(t)}},M.prototype.tilingPreLayout=function(){a.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},M.prototype.tilingPostLayout=function(){a.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},M.prototype.reduceTrees=function(){for(var t,i=[],n=!0;n;){var r=this.graphManager.getAllNodes(),s=[];n=!1;for(var e=0;e<r.length;e++)if(1==(t=r[e]).getEdges().length&&!t.getEdges()[0].isInterGraph&&null==t.getChild()){if(a.PURE_INCREMENTAL){var o=t.getEdges()[0].getOtherEnd(t),h=new d(t.getCenterX()-o.getCenterX(),t.getCenterY()-o.getCenterY());s.push([t,t.getEdges()[0],t.getOwner(),h])}else s.push([t,t.getEdges()[0],t.getOwner()]);n=!0}if(1==n){for(var f=[],u=0;u<s.length;u++)1==s[u][0].getEdges().length&&(f.push(s[u]),s[u][0].getOwner().remove(s[u][0]));i.push(f),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=i},M.prototype.growTree=function(t){for(var i,n=t[t.length-1],r=0;r<n.length;r++)i=n[r],this.findPlaceforPrunedNode(i),i[2].add(i[0]),i[2].add(i[1],i[1].source,i[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},M.prototype.findPlaceforPrunedNode=function(t){var i,n,r=t[0];if(n=r==t[1].source?t[1].target:t[1].source,a.PURE_INCREMENTAL)r.setCenter(n.getCenterX()+t[3].getWidth(),n.getCenterY()+t[3].getHeight());else{var s=n.startX,e=n.finishX,o=n.startY,h=n.finishY,f=[0,0,0,0];if(o>0)for(var c=s;c<=e;c++)f[0]+=this.grid[c][o-1].length+this.grid[c][o].length-1;if(e<this.grid.length-1)for(c=o;c<=h;c++)f[1]+=this.grid[e+1][c].length+this.grid[e][c].length-1;if(h<this.grid[0].length-1)for(c=s;c<=e;c++)f[2]+=this.grid[c][h+1].length+this.grid[c][h].length-1;if(s>0)for(c=o;c<=h;c++)f[3]+=this.grid[s-1][c].length+this.grid[s][c].length-1;for(var l,v,d=p.MAX_VALUE,y=0;y<f.length;y++)f[y]<d?(d=f[y],l=1,v=y):f[y]==d&&l++;if(3==l&&0==d)0==f[0]&&0==f[1]&&0==f[2]?i=1:0==f[0]&&0==f[1]&&0==f[3]?i=0:0==f[0]&&0==f[2]&&0==f[3]?i=3:0==f[1]&&0==f[2]&&0==f[3]&&(i=2);else if(2==l&&0==d){var w=Math.floor(2*Math.random());i=0==f[0]&&0==f[1]?0==w?0:1:0==f[0]&&0==f[2]?0==w?0:2:0==f[0]&&0==f[3]?0==w?0:3:0==f[1]&&0==f[2]?0==w?1:2:0==f[1]&&0==f[3]?0==w?1:3:0==w?2:3}else i=4==l&&0==d?w=Math.floor(4*Math.random()):v;0==i?r.setCenter(n.getCenterX(),n.getCenterY()-n.getHeight()/2-u.DEFAULT_EDGE_LENGTH-r.getHeight()/2):1==i?r.setCenter(n.getCenterX()+n.getWidth()/2+u.DEFAULT_EDGE_LENGTH+r.getWidth()/2,n.getCenterY()):2==i?r.setCenter(n.getCenterX(),n.getCenterY()+n.getHeight()/2+u.DEFAULT_EDGE_LENGTH+r.getHeight()/2):r.setCenter(n.getCenterX()-n.getWidth()/2-u.DEFAULT_EDGE_LENGTH-r.getWidth()/2,n.getCenterY())}},t.exports=M},991:(t,i,n)=>{var r=n(551).FDLayoutNode,s=n(551).IMath;function e(t,i,n,s){r.call(this,t,i,n,s)}for(var o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];e.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*s.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*s.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},e.prototype.propogateDisplacementToChildren=function(t,i){for(var n,r=this.getChild().getNodes(),s=0;s<r.length;s++)null==(n=r[s]).getChild()?(n.displacementX+=t,n.displacementY+=i):n.propogateDisplacementToChildren(t,i)},e.prototype.move=function(){var t=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(this.displacementX,this.displacementY),t.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},e.prototype.setPred1=function(t){this.pred1=t},e.prototype.getPred1=function(){return pred1},e.prototype.getPred2=function(){return pred2},e.prototype.setNext=function(t){this.next=t},e.prototype.getNext=function(){return next},e.prototype.setProcessed=function(t){this.processed=t},e.prototype.isProcessed=function(){return processed},t.exports=e},902:(t,i,n)=>{function r(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}var s=n(806),e=n(551).LinkedList,o=n(551).Matrix,h=n(551).SVD;function a(){}a.handleConstraints=function(t){var i={};i.fixedNodeConstraint=t.constraints.fixedNodeConstraint,i.alignmentConstraint=t.constraints.alignmentConstraint,i.relativePlacementConstraint=t.constraints.relativePlacementConstraint;for(var n=new Map,a=new Map,f=[],u=[],c=t.getAllNodes(),l=0,v=0;v<c.length;v++){var d=c[v];null==d.getChild()&&(a.set(d.id,l++),f.push(d.getCenterX()),u.push(d.getCenterY()),n.set(d.id,d))}i.relativePlacementConstraint&&i.relativePlacementConstraint.forEach(function(t){t.gap||0==t.gap||(t.left?t.gap=s.DEFAULT_EDGE_LENGTH+n.get(t.left).getWidth()/2+n.get(t.right).getWidth()/2:t.gap=s.DEFAULT_EDGE_LENGTH+n.get(t.top).getHeight()/2+n.get(t.bottom).getHeight()/2)});var y=function(t){var i=0,n=0;return t.forEach(function(t){i+=f[a.get(t)],n+=u[a.get(t)]}),{x:i/t.size,y:n/t.size}},p=function(t,i,n,s,o){var h=new Map;t.forEach(function(t,i){h.set(i,0)}),t.forEach(function(t,i){t.forEach(function(t){h.set(t.id,h.get(t.id)+1)})});var c=new Map,l=new Map,v=new e;h.forEach(function(t,r){0==t?(v.push(r),n||("horizontal"==i?c.set(r,a.has(r)?f[a.get(r)]:s.get(r)):c.set(r,a.has(r)?u[a.get(r)]:s.get(r)))):c.set(r,Number.NEGATIVE_INFINITY),n&&l.set(r,new Set([r]))}),n&&o.forEach(function(t){var r=[];if(t.forEach(function(t){n.has(t)&&r.push(t)}),r.length>0){var e=0;r.forEach(function(t){"horizontal"==i?(c.set(t,a.has(t)?f[a.get(t)]:s.get(t)),e+=c.get(t)):(c.set(t,a.has(t)?u[a.get(t)]:s.get(t)),e+=c.get(t))}),e/=r.length,t.forEach(function(t){n.has(t)||c.set(t,e)})}else{var o=0;t.forEach(function(t){o+="horizontal"==i?a.has(t)?f[a.get(t)]:s.get(t):a.has(t)?u[a.get(t)]:s.get(t)}),o/=t.length,t.forEach(function(t){c.set(t,o)})}});for(var d=function(){var r=v.shift();t.get(r).forEach(function(t){if(c.get(t.id)<c.get(r)+t.gap)if(n&&n.has(t.id)){var e=void 0;if(e="horizontal"==i?a.has(t.id)?f[a.get(t.id)]:s.get(t.id):a.has(t.id)?u[a.get(t.id)]:s.get(t.id),c.set(t.id,e),e<c.get(r)+t.gap){var o=c.get(r)+t.gap-e;l.get(r).forEach(function(t){c.set(t,c.get(t)-o)})}}else c.set(t.id,c.get(r)+t.gap);h.set(t.id,h.get(t.id)-1),0==h.get(t.id)&&v.push(t.id),n&&l.set(t.id,function(t,i){var n=new Set(t),r=!0,s=!1,e=void 0;try{for(var o,h=i[Symbol.iterator]();!(r=(o=h.next()).done);r=!0){var a=o.value;n.add(a)}}catch(f){s=!0,e=f}finally{try{!r&&h.return&&h.return()}finally{if(s)throw e}}return n}(l.get(r),l.get(t.id)))})};0!=v.length;)d();if(n){var y=new Set;t.forEach(function(t,i){0==t.length&&y.add(i)});var p=[];l.forEach(function(t,i){if(y.has(i)){var s=!1,e=!0,o=!1,h=void 0;try{for(var a,f=t[Symbol.iterator]();!(e=(a=f.next()).done);e=!0){var u=a.value;n.has(u)&&(s=!0)}}catch(v){o=!0,h=v}finally{try{!e&&f.return&&f.return()}finally{if(o)throw h}}if(!s){var c=!1,l=void 0;p.forEach(function(i,n){i.has([].concat(r(t))[0])&&(c=!0,l=n)}),c?t.forEach(function(t){p[l].add(t)}):p.push(new Set(t))}}}),p.forEach(function(t,n){var r=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=!0,v=!1,d=void 0;try{for(var y,p=t[Symbol.iterator]();!(l=(y=p.next()).done);l=!0){var w=y.value,g=void 0;g="horizontal"==i?a.has(w)?f[a.get(w)]:s.get(w):a.has(w)?u[a.get(w)]:s.get(w);var m=c.get(w);g<r&&(r=g),g>o&&(o=g),m<e&&(e=m),m>h&&(h=m)}}catch(O){v=!0,d=O}finally{try{!l&&p.return&&p.return()}finally{if(v)throw d}}var b=(r+o)/2-(e+h)/2,M=!0,k=!1,x=void 0;try{for(var S,$=t[Symbol.iterator]();!(M=(S=$.next()).done);M=!0){var j=S.value;c.set(j,c.get(j)+b)}}catch(O){k=!0,x=O}finally{try{!M&&$.return&&$.return()}finally{if(k)throw x}}})}return c},w=function(t){var i=0,n=0,r=0,s=0;if(t.forEach(function(t){t.left?f[a.get(t.left)]-f[a.get(t.right)]>=0?i++:n++:u[a.get(t.top)]-u[a.get(t.bottom)]>=0?r++:s++}),i>n&&r>s)for(var e=0;e<a.size;e++)f[e]=-1*f[e],u[e]=-1*u[e];else if(i>n)for(var o=0;o<a.size;o++)f[o]=-1*f[o];else if(r>s)for(var h=0;h<a.size;h++)u[h]=-1*u[h]},g=function(t){var i=[],n=new e,r=new Set,s=0;return t.forEach(function(e,o){if(!r.has(o)){i[s]=[];var h=o;for(n.push(h),r.add(h),i[s].push(h);0!=n.length;)h=n.shift(),t.get(h).forEach(function(t){r.has(t.id)||(n.push(t.id),r.add(t.id),i[s].push(t.id))});s++}}),i},m=function(t){var i=new Map;return t.forEach(function(t,n){i.set(n,[])}),t.forEach(function(t,n){t.forEach(function(t){i.get(n).push(t),i.get(t.id).push({id:n,gap:t.gap,direction:t.direction})})}),i},b=function(t){var i=new Map;return t.forEach(function(t,n){i.set(n,[])}),t.forEach(function(t,n){t.forEach(function(t){i.get(t.id).push({id:n,gap:t.gap,direction:t.direction})})}),i},M=[],k=[],x=!1,S=!1,$=new Set,j=new Map,O=new Map,A=[];if(i.fixedNodeConstraint&&i.fixedNodeConstraint.forEach(function(t){$.add(t.nodeId)}),i.relativePlacementConstraint&&(i.relativePlacementConstraint.forEach(function(t){t.left?(j.has(t.left)?j.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):j.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),j.has(t.right)||j.set(t.right,[])):(j.has(t.top)?j.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):j.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),j.has(t.bottom)||j.set(t.bottom,[]))}),O=m(j),A=g(O)),s.TRANSFORM_ON_CONSTRAINT_HANDLING){if(i.fixedNodeConstraint&&i.fixedNodeConstraint.length>1)i.fixedNodeConstraint.forEach(function(t,i){M[i]=[t.position.x,t.position.y],k[i]=[f[a.get(t.nodeId)],u[a.get(t.nodeId)]]}),x=!0;else if(i.alignmentConstraint)!function(){var t=0;if(i.alignmentConstraint.vertical){for(var n=i.alignmentConstraint.vertical,s=function(i){var s=new Set;n[i].forEach(function(t){s.add(t)});var e=new Set([].concat(r(s)).filter(function(t){return $.has(t)})),o=void 0;o=e.size>0?f[a.get(e.values().next().value)]:y(s).x,n[i].forEach(function(i){M[t]=[o,u[a.get(i)]],k[t]=[f[a.get(i)],u[a.get(i)]],t++})},e=0;e<n.length;e++)s(e);x=!0}if(i.alignmentConstraint.horizontal){for(var o=i.alignmentConstraint.horizontal,h=function(i){var n=new Set;o[i].forEach(function(t){n.add(t)});var s=new Set([].concat(r(n)).filter(function(t){return $.has(t)})),e=void 0;e=s.size>0?f[a.get(s.values().next().value)]:y(n).y,o[i].forEach(function(i){M[t]=[f[a.get(i)],e],k[t]=[f[a.get(i)],u[a.get(i)]],t++})},c=0;c<o.length;c++)h(c);x=!0}i.relativePlacementConstraint&&(S=!0)}();else if(i.relativePlacementConstraint){for(var T=0,I=0,E=0;E<A.length;E++)A[E].length>T&&(T=A[E].length,I=E);if(T<O.size/2)w(i.relativePlacementConstraint),x=!1,S=!1;else{var L=new Map,D=new Map,N=[];A[I].forEach(function(t){j.get(t).forEach(function(i){"horizontal"==i.direction?(L.has(t)?L.get(t).push(i):L.set(t,[i]),L.has(i.id)||L.set(i.id,[]),N.push({left:t,right:i.id})):(D.has(t)?D.get(t).push(i):D.set(t,[i]),D.has(i.id)||D.set(i.id,[]),N.push({top:t,bottom:i.id}))})}),w(N),S=!1;var z=p(L,"horizontal"),B=p(D,"vertical");A[I].forEach(function(t,i){k[i]=[f[a.get(t)],u[a.get(t)]],M[i]=[],z.has(t)?M[i][0]=z.get(t):M[i][0]=f[a.get(t)],B.has(t)?M[i][1]=B.get(t):M[i][1]=u[a.get(t)]}),x=!0}}if(x){for(var C,P=o.transpose(M),R=o.transpose(k),G=0;G<P.length;G++)P[G]=o.multGamma(P[G]),R[G]=o.multGamma(R[G]);var q=o.multMat(P,o.transpose(R)),F=h.svd(q);C=o.multMat(F.V,o.transpose(F.U));for(var X=0;X<a.size;X++){var Y=[f[X],u[X]],_=[C[0][0],C[1][0]],H=[C[0][1],C[1][1]];f[X]=o.dotProduct(Y,_),u[X]=o.dotProduct(Y,H)}S&&w(i.relativePlacementConstraint)}}if(s.ENFORCE_CONSTRAINTS){if(i.fixedNodeConstraint&&i.fixedNodeConstraint.length>0){var Z={x:0,y:0};i.fixedNodeConstraint.forEach(function(t,i){var n,r,s={x:f[a.get(t.nodeId)],y:u[a.get(t.nodeId)]},e=t.position,o=(r=s,{x:(n=e).x-r.x,y:n.y-r.y});Z.x+=o.x,Z.y+=o.y}),Z.x/=i.fixedNodeConstraint.length,Z.y/=i.fixedNodeConstraint.length,f.forEach(function(t,i){f[i]+=Z.x}),u.forEach(function(t,i){u[i]+=Z.y}),i.fixedNodeConstraint.forEach(function(t){f[a.get(t.nodeId)]=t.position.x,u[a.get(t.nodeId)]=t.position.y})}if(i.alignmentConstraint){if(i.alignmentConstraint.vertical)for(var J=i.alignmentConstraint.vertical,V=function(t){var i=new Set;J[t].forEach(function(t){i.add(t)});var n=new Set([].concat(r(i)).filter(function(t){return $.has(t)})),s=void 0;s=n.size>0?f[a.get(n.values().next().value)]:y(i).x,i.forEach(function(t){$.has(t)||(f[a.get(t)]=s)})},W=0;W<J.length;W++)V(W);if(i.alignmentConstraint.horizontal)for(var U=i.alignmentConstraint.horizontal,K=function(t){var i=new Set;U[t].forEach(function(t){i.add(t)});var n=new Set([].concat(r(i)).filter(function(t){return $.has(t)})),s=void 0;s=n.size>0?u[a.get(n.values().next().value)]:y(i).y,i.forEach(function(t){$.has(t)||(u[a.get(t)]=s)})},Q=0;Q<U.length;Q++)K(Q)}i.relativePlacementConstraint&&function(){var t=new Map,n=new Map,r=new Map,s=new Map,e=new Map,o=new Map,h=new Set,c=new Set;if($.forEach(function(t){h.add(t),c.add(t)}),i.alignmentConstraint){if(i.alignmentConstraint.vertical)for(var l=i.alignmentConstraint.vertical,v=function(i){r.set("dummy"+i,[]),l[i].forEach(function(n){t.set(n,"dummy"+i),r.get("dummy"+i).push(n),$.has(n)&&h.add("dummy"+i)}),e.set("dummy"+i,f[a.get(l[i][0])])},d=0;d<l.length;d++)v(d);if(i.alignmentConstraint.horizontal)for(var y=i.alignmentConstraint.horizontal,w=function(t){s.set("dummy"+t,[]),y[t].forEach(function(i){n.set(i,"dummy"+t),s.get("dummy"+t).push(i),$.has(i)&&c.add("dummy"+t)}),o.set("dummy"+t,u[a.get(y[t][0])])},M=0;M<y.length;M++)w(M)}var k=new Map,x=new Map,S=function(i){j.get(i).forEach(function(r){var s=void 0,e=void 0;"horizontal"==r.direction?(s=t.get(i)?t.get(i):i,e=t.get(r.id)?{id:t.get(r.id),gap:r.gap,direction:r.direction}:r,k.has(s)?k.get(s).push(e):k.set(s,[e]),k.has(e.id)||k.set(e.id,[])):(s=n.get(i)?n.get(i):i,e=n.get(r.id)?{id:n.get(r.id),gap:r.gap,direction:r.direction}:r,x.has(s)?x.get(s).push(e):x.set(s,[e]),x.has(e.id)||x.set(e.id,[]))})},O=!0,A=!1,T=void 0;try{for(var I,E=j.keys()[Symbol.iterator]();!(O=(I=E.next()).done);O=!0)S(I.value)}catch(tt){A=!0,T=tt}finally{try{!O&&E.return&&E.return()}finally{if(A)throw T}}var L=m(k),D=m(x),N=g(L),z=g(D),B=b(k),C=b(x),P=[],R=[];N.forEach(function(t,i){P[i]=[],t.forEach(function(t){0==B.get(t).length&&P[i].push(t)})}),z.forEach(function(t,i){R[i]=[],t.forEach(function(t){0==C.get(t).length&&R[i].push(t)})});var G=p(k,"horizontal",h,e,P),q=p(x,"vertical",c,o,R),F=function(t){r.get(t)?r.get(t).forEach(function(i){f[a.get(i)]=G.get(t)}):f[a.get(t)]=G.get(t)},X=!0,Y=!1,_=void 0;try{for(var H,Z=G.keys()[Symbol.iterator]();!(X=(H=Z.next()).done);X=!0)F(H.value)}catch(tt){Y=!0,_=tt}finally{try{!X&&Z.return&&Z.return()}finally{if(Y)throw _}}var J=function(t){s.get(t)?s.get(t).forEach(function(i){u[a.get(i)]=q.get(t)}):u[a.get(t)]=q.get(t)},V=!0,W=!1,U=void 0;try{for(var K,Q=q.keys()[Symbol.iterator]();!(V=(K=Q.next()).done);V=!0)J(K.value)}catch(tt){W=!0,U=tt}finally{try{!V&&Q.return&&Q.return()}finally{if(W)throw U}}}()}for(var tt=0;tt<c.length;tt++){var it=c[tt];null==it.getChild()&&it.setCenter(f[a.get(it.id)],u[a.get(it.id)])}},t.exports=a},551:i=>{i.exports=t}},n={},function t(r){var s=n[r];if(void 0!==s)return s.exports;var e=n[r]={exports:{}};return i[r](e,e.exports,t),e.exports}(45);var i,n},T.exports=t(E()));var t}var N,z,B,C;const P=i(N?A.exports:(N=1,A.exports=(z=D(),B={658:t=>{t.exports=null!=Object.assign?Object.assign.bind(Object):function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.forEach(function(i){Object.keys(i).forEach(function(n){return t[n]=i[n]})}),t}},548:(t,i,n)=>{var r=function(){return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,i){var n=[],r=!0,s=!1,e=void 0;try{for(var o,h=t[Symbol.iterator]();!(r=(o=h.next()).done)&&(n.push(o.value),!i||n.length!==i);r=!0);}catch(a){s=!0,e=a}finally{try{!r&&h.return&&h.return()}finally{if(s)throw e}}return n}(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=n(140).layoutBase.LinkedList,e={getTopMostNodes:function(t){for(var i={},n=0;n<t.length;n++)i[t[n].id()]=!0;return t.filter(function(t,n){"number"==typeof t&&(t=n);for(var r=t.parent()[0];null!=r;){if(i[r.id()])return!1;r=r.parent()[0]}return!0})},connectComponents:function(t,i,n,r){var e=new s,o=new Set,h=[],a=void 0,f=void 0,u=void 0,c=!1,l=1,v=[],d=[],y=function(){var r=t.collection();d.push(r);var s=n[0],y=t.collection();y.merge(s).merge(s.descendants().intersection(i)),h.push(s),y.forEach(function(t){e.push(t),o.add(t),r.merge(t)});for(var p=function(){s=e.shift();var f=t.collection();s.neighborhood().nodes().forEach(function(t){i.intersection(s.edgesWith(t)).length>0&&f.merge(t)});for(var u=0;u<f.length;u++){var c=f[u];null==(a=n.intersection(c.union(c.ancestors())))||o.has(a[0])||a.union(a.descendants()).forEach(function(t){e.push(t),o.add(t),r.merge(t),n.has(t)&&h.push(t)})}};0!=e.length;)p();if(r.forEach(function(t){i.intersection(t.connectedEdges()).forEach(function(t){r.has(t.source())&&r.has(t.target())&&r.merge(t)})}),h.length==n.length&&(c=!0),!c||c&&l>1){f=h[0],u=f.connectedEdges().length,h.forEach(function(t){t.connectedEdges().length<u&&(u=t.connectedEdges().length,f=t)}),v.push(f.id());var w=t.collection();w.merge(h[0]),h.forEach(function(t){w.merge(t)}),h=[],n=n.difference(w),l++}};do{y()}while(!c);return r&&v.length>0&&r.set("dummy"+(r.size+1),v),d},relocateComponent:function(t,i,n){if(!n.fixedNodeConstraint){var s=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var a=!0,f=!1,u=void 0;try{for(var c,l=i.nodeIndexes[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var v=c.value,d=r(v,2),y=d[0],p=d[1],w=n.cy.getElementById(y);if(w){var g=w.boundingBox(),m=i.xCoords[p]-g.w/2,b=i.xCoords[p]+g.w/2,M=i.yCoords[p]-g.h/2,k=i.yCoords[p]+g.h/2;m<s&&(s=m),b>e&&(e=b),M<o&&(o=M),k>h&&(h=k)}}}catch(O){f=!0,u=O}finally{try{!a&&l.return&&l.return()}finally{if(f)throw u}}var x=t.x-(e+s)/2,S=t.y-(h+o)/2;i.xCoords=i.xCoords.map(function(t){return t+x}),i.yCoords=i.yCoords.map(function(t){return t+S})}else{Object.keys(i).forEach(function(t){var n=i[t],r=n.getRect().x,a=n.getRect().x+n.getRect().width,f=n.getRect().y,u=n.getRect().y+n.getRect().height;r<s&&(s=r),a>e&&(e=a),f<o&&(o=f),u>h&&(h=u)});var $=t.x-(e+s)/2,j=t.y-(h+o)/2;Object.keys(i).forEach(function(t){var n=i[t];n.setCenter(n.getCenterX()+$,n.getCenterY()+j)})}}},calcBoundingBox:function(t,i,n,r){for(var s=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER,a=void 0,f=void 0,u=void 0,c=void 0,l=t.descendants().not(":parent"),v=l.length,d=0;d<v;d++){var y=l[d];s>(a=i[r.get(y.id())]-y.width()/2)&&(s=a),e<(f=i[r.get(y.id())]+y.width()/2)&&(e=f),o>(u=n[r.get(y.id())]-y.height()/2)&&(o=u),h<(c=n[r.get(y.id())]+y.height()/2)&&(h=c)}var p={};return p.topLeftX=s,p.topLeftY=o,p.width=e-s,p.height=h-o,p},calcParentsWithoutChildren:function(t,i){var n=t.collection();return i.nodes(":parent").forEach(function(t){var i=!1;t.children().forEach(function(t){"none"!=t.css("display")&&(i=!0)}),i||n.merge(t)}),n}};t.exports=e},816:(t,i,n)=>{var r=n(548),s=n(140).CoSELayout,e=n(140).CoSENode,o=n(140).layoutBase.PointD,h=n(140).layoutBase.DimensionD,a=n(140).layoutBase.LayoutConstants,f=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;t.exports={coseLayout:function(t,i){var n=t.cy,c=t.eles,l=c.nodes(),v=c.edges(),d=void 0,y=void 0,p=void 0,w={};t.randomize&&(d=i.nodeIndexes,y=i.xCoords,p=i.yCoords);var g=function(t){return"function"==typeof t},m=function(t,i){return g(t)?t(i):t},b=r.calcParentsWithoutChildren(n,c);null!=t.nestingFactor&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(u.DEFAULT_GRAVITY_STRENGTH=f.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(u.MAX_ITERATIONS=f.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=f.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=f.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),null!=t.tilingCompareBy&&(u.TILING_COMPARE_BY=t.tilingCompareBy),"proof"==t.quality?a.QUALITY=2:a.QUALITY=0,u.NODE_DIMENSIONS_INCLUDE_LABELS=f.NODE_DIMENSIONS_INCLUDE_LABELS=a.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=!t.randomize,u.ANIMATE=f.ANIMATE=a.ANIMATE=t.animate,u.TILE=t.tile,u.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!t.randomize,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,"transformed"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),"enforced"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),"cose"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),"all"==t.step&&(t.randomize?u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?u.TREE_REDUCTION_ON_INCREMENTAL=!1:u.TREE_REDUCTION_ON_INCREMENTAL=!0;var M,k,x=new s,S=x.newGraphManager();return function t(i,n,s,a){for(var f=n.length,u=0;u<f;u++){var c=n[u],l=null;0==c.intersection(b).length&&(l=c.children());var v=void 0,g=c.layoutDimensions({nodeDimensionsIncludeLabels:a.nodeDimensionsIncludeLabels});if(null!=c.outerWidth()&&null!=c.outerHeight())if(a.randomize)if(c.isParent()){var M=r.calcBoundingBox(c,y,p,d);v=0==c.intersection(b).length?i.add(new e(s.graphManager,new o(M.topLeftX,M.topLeftY),new h(M.width,M.height))):i.add(new e(s.graphManager,new o(M.topLeftX,M.topLeftY),new h(parseFloat(g.w),parseFloat(g.h))))}else v=i.add(new e(s.graphManager,new o(y[d.get(c.id())]-g.w/2,p[d.get(c.id())]-g.h/2),new h(parseFloat(g.w),parseFloat(g.h))));else v=i.add(new e(s.graphManager,new o(c.position("x")-g.w/2,c.position("y")-g.h/2),new h(parseFloat(g.w),parseFloat(g.h))));else v=i.add(new e(this.graphManager));v.id=c.data("id"),v.nodeRepulsion=m(a.nodeRepulsion,c),v.paddingLeft=parseInt(c.css("padding")),v.paddingTop=parseInt(c.css("padding")),v.paddingRight=parseInt(c.css("padding")),v.paddingBottom=parseInt(c.css("padding")),a.nodeDimensionsIncludeLabels&&(v.labelWidth=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,v.labelHeight=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,v.labelPosVertical=c.css("text-valign"),v.labelPosHorizontal=c.css("text-halign")),w[c.data("id")]=v,isNaN(v.rect.x)&&(v.rect.x=0),isNaN(v.rect.y)&&(v.rect.y=0),null!=l&&l.length>0&&t(s.getGraphManager().add(s.newGraph(),v),l,s,a)}}(S.addRoot(),r.getTopMostNodes(l),x,t),function(i,n,r){for(var s=0,e=0,o=0;o<r.length;o++){var h=r[o],a=w[h.data("source")],c=w[h.data("target")];if(a&&c&&a!==c&&0==a.getEdgesBetween(c).length){var l=n.add(i.newEdge(),a,c);l.id=h.id(),l.idealLength=m(t.idealEdgeLength,h),l.edgeElasticity=m(t.edgeElasticity,h),s+=l.idealLength,e++}}null!=t.idealEdgeLength&&(e>0?u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=s/e:g(t.idealEdgeLength)?u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=50:u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,u.MIN_REPULSION_DIST=f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH)}(x,S,v),M=x,(k=t).fixedNodeConstraint&&(M.constraints.fixedNodeConstraint=k.fixedNodeConstraint),k.alignmentConstraint&&(M.constraints.alignmentConstraint=k.alignmentConstraint),k.relativePlacementConstraint&&(M.constraints.relativePlacementConstraint=k.relativePlacementConstraint),x.runLayout(),w}}},212:(t,i,n)=>{var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=n(658),e=n(548),o=n(657).spectralLayout,h=n(816).coseLayout,a=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(t){return 4500},idealEdgeLength:function(t){return 50},edgeElasticity:function(t){return.45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),f=function(){function t(i){!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=s({},a,i)}return r(t,[{key:"run",value:function(){var t=this.options,i=t.cy,n=t.eles,r=[],s=[],a=void 0,f=[];!t.fixedNodeConstraint||Array.isArray(t.fixedNodeConstraint)&&0!=t.fixedNodeConstraint.length||(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(!t.alignmentConstraint.vertical||Array.isArray(t.alignmentConstraint.vertical)&&0!=t.alignmentConstraint.vertical.length||(t.alignmentConstraint.vertical=void 0),!t.alignmentConstraint.horizontal||Array.isArray(t.alignmentConstraint.horizontal)&&0!=t.alignmentConstraint.horizontal.length||(t.alignmentConstraint.horizontal=void 0)),!t.relativePlacementConstraint||Array.isArray(t.relativePlacementConstraint)&&0!=t.relativePlacementConstraint.length||(t.relativePlacementConstraint=void 0),(t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint)&&(t.tile=!1,t.packComponents=!1);var u=void 0,c=!1;if(i.layoutUtilities&&t.packComponents&&((u=i.layoutUtilities("get"))||(u=i.layoutUtilities()),c=!0),n.nodes().length>0)if(c){var l=e.getTopMostNodes(t.eles.nodes());if((a=e.connectComponents(i,t.eles,l)).forEach(function(t){var i=t.boundingBox();f.push({x:i.x1+i.w/2,y:i.y1+i.h/2})}),t.randomize&&a.forEach(function(i){t.eles=i,r.push(o(t))}),"default"==t.quality||"proof"==t.quality){var v=i.collection();if(t.tile){var d=0,y={nodeIndexes:new Map,xCoords:[],yCoords:[]},p=[];if(a.forEach(function(t,i){0==t.edges().length&&(t.nodes().forEach(function(i,n){v.merge(t.nodes()[n]),i.isParent()||(y.nodeIndexes.set(t.nodes()[n].id(),d++),y.xCoords.push(t.nodes()[0].position().x),y.yCoords.push(t.nodes()[0].position().y))}),p.push(i))}),v.length>1){var w=v.boundingBox();f.push({x:w.x1+w.w/2,y:w.y1+w.h/2}),a.push(v),r.push(y);for(var g=p.length-1;g>=0;g--)a.splice(p[g],1),r.splice(p[g],1),f.splice(p[g],1)}}a.forEach(function(i,n){t.eles=i,s.push(h(t,r[n])),e.relocateComponent(f[n],s[n],t)})}else a.forEach(function(i,n){e.relocateComponent(f[n],r[n],t)});var m=new Set;if(a.length>1){var b=[],M=n.filter(function(t){return"none"==t.css("display")});a.forEach(function(i,n){var o=void 0;if("draft"==t.quality&&(o=r[n].nodeIndexes),i.nodes().not(M).length>0){var h={edges:[],nodes:[]},a=void 0;i.nodes().not(M).forEach(function(i){if("draft"==t.quality)if(i.isParent()){var f=e.calcBoundingBox(i,r[n].xCoords,r[n].yCoords,o);h.nodes.push({x:f.topLeftX,y:f.topLeftY,width:f.width,height:f.height})}else a=o.get(i.id()),h.nodes.push({x:r[n].xCoords[a]-i.boundingbox().w/2,y:r[n].yCoords[a]-i.boundingbox().h/2,width:i.boundingbox().w,height:i.boundingbox().h});else s[n][i.id()]&&h.nodes.push({x:s[n][i.id()].getLeft(),y:s[n][i.id()].getTop(),width:s[n][i.id()].getWidth(),height:s[n][i.id()].getHeight()})}),i.edges().forEach(function(i){var a=i.source(),f=i.target();if("none"!=a.css("display")&&"none"!=f.css("display"))if("draft"==t.quality){var u=o.get(a.id()),c=o.get(f.id()),l=[],v=[];if(a.isParent()){var d=e.calcBoundingBox(a,r[n].xCoords,r[n].yCoords,o);l.push(d.topLeftX+d.width/2),l.push(d.topLeftY+d.height/2)}else l.push(r[n].xCoords[u]),l.push(r[n].yCoords[u]);if(f.isParent()){var y=e.calcBoundingBox(f,r[n].xCoords,r[n].yCoords,o);v.push(y.topLeftX+y.width/2),v.push(y.topLeftY+y.height/2)}else v.push(r[n].xCoords[c]),v.push(r[n].yCoords[c]);h.edges.push({startX:l[0],startY:l[1],endX:v[0],endY:v[1]})}else s[n][a.id()]&&s[n][f.id()]&&h.edges.push({startX:s[n][a.id()].getCenterX(),startY:s[n][a.id()].getCenterY(),endX:s[n][f.id()].getCenterX(),endY:s[n][f.id()].getCenterY()})}),h.nodes.length>0&&(b.push(h),m.add(n))}});var k=u.packComponents(b,t.randomize).shifts;if("draft"==t.quality)r.forEach(function(t,i){var n=t.xCoords.map(function(t){return t+k[i].dx}),r=t.yCoords.map(function(t){return t+k[i].dy});t.xCoords=n,t.yCoords=r});else{var x=0;m.forEach(function(t){Object.keys(s[t]).forEach(function(i){var n=s[t][i];n.setCenter(n.getCenterX()+k[x].dx,n.getCenterY()+k[x].dy)}),x++})}}}else{var S=t.eles.boundingBox();if(f.push({x:S.x1+S.w/2,y:S.y1+S.h/2}),t.randomize){var $=o(t);r.push($)}"default"==t.quality||"proof"==t.quality?(s.push(h(t,r[0])),e.relocateComponent(f[0],s[0],t)):e.relocateComponent(f[0],r[0],t)}var j=function(i,n){if("default"==t.quality||"proof"==t.quality){"number"==typeof i&&(i=n);var e=void 0,o=void 0,h=i.data("id");return s.forEach(function(t){h in t&&(e={x:t[h].getRect().getCenterX(),y:t[h].getRect().getCenterY()},o=t[h])}),t.nodeDimensionsIncludeLabels&&(o.labelWidth&&("left"==o.labelPosHorizontal?e.x+=o.labelWidth/2:"right"==o.labelPosHorizontal&&(e.x-=o.labelWidth/2)),o.labelHeight&&("top"==o.labelPosVertical?e.y+=o.labelHeight/2:"bottom"==o.labelPosVertical&&(e.y-=o.labelHeight/2))),null==e&&(e={x:i.position("x"),y:i.position("y")}),{x:e.x,y:e.y}}var a=void 0;return r.forEach(function(t){var n=t.nodeIndexes.get(i.id());null!=n&&(a={x:t.xCoords[n],y:t.yCoords[n]})}),null==a&&(a={x:i.position("x"),y:i.position("y")}),{x:a.x,y:a.y}};if("default"==t.quality||"proof"==t.quality||t.randomize){var O=e.calcParentsWithoutChildren(i,n),A=n.filter(function(t){return"none"==t.css("display")});t.eles=n.not(A),n.nodes().not(":parent").not(A).layoutPositions(this,t,j),O.length>0&&O.forEach(function(t){t.position(j(t))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),t}();t.exports=f},657:(t,i,n)=>{var r=n(548),s=n(140).layoutBase.Matrix,e=n(140).layoutBase.SVD;t.exports={spectralLayout:function(t){var i=t.cy,n=t.eles,o=n.nodes(),h=n.nodes(":parent"),a=new Map,f=new Map,u=new Map,c=[],l=[],v=[],d=[],y=[],p=[],w=[],g=[],m=void 0,b=1e8,M=1e-9,k=t.piTol,x=t.samplingType,S=t.nodeSeparation,$=void 0,j=function(t,i,n){for(var r=[],s=0,e=0,o=0,h=void 0,a=[],u=0,l=1,v=0;v<m;v++)a[v]=b;for(r[e]=t,a[t]=0;e>=s;){o=r[s++];for(var d=c[o],w=0;w<d.length;w++)a[h=f.get(d[w])]==b&&(a[h]=a[o]+1,r[++e]=h);p[o][i]=a[o]*S}if(n){for(var g=0;g<m;g++)p[g][i]<y[g]&&(y[g]=p[g][i]);for(var M=0;M<m;M++)y[M]>u&&(u=y[M],l=M)}return l};r.connectComponents(i,n,r.getTopMostNodes(o),a),h.forEach(function(t){r.connectComponents(i,n,r.getTopMostNodes(t.descendants().intersection(n)),a)});for(var O=0,A=0;A<o.length;A++)o[A].isParent()||f.set(o[A].id(),O++);var T=!0,I=!1,E=void 0;try{for(var L,D=a.keys()[Symbol.iterator]();!(T=(L=D.next()).done);T=!0){var N=L.value;f.set(N,O++)}}catch(W){I=!0,E=W}finally{try{!T&&D.return&&D.return()}finally{if(I)throw E}}for(var z=0;z<f.size;z++)c[z]=[];h.forEach(function(t){for(var i=t.children().intersection(n);0==i.nodes(":childless").length;)i=i.nodes()[0].children().intersection(n);var r=0,s=i.nodes(":childless")[0].connectedEdges().length;i.nodes(":childless").forEach(function(t,i){t.connectedEdges().length<s&&(s=t.connectedEdges().length,r=i)}),u.set(t.id(),i.nodes(":childless")[r].id())}),o.forEach(function(t){var i=void 0;i=t.isParent()?f.get(u.get(t.id())):f.get(t.id()),t.neighborhood().nodes().forEach(function(r){n.intersection(t.edgesWith(r)).length>0&&(r.isParent()?c[i].push(u.get(r.id())):c[i].push(r.id()))})});var B=function(t){var n=f.get(t),r=void 0;a.get(t).forEach(function(s){r=i.getElementById(s).isParent()?u.get(s):s,c[n].push(r),c[f.get(r)].push(t)})},C=!0,P=!1,R=void 0;try{for(var G,q=a.keys()[Symbol.iterator]();!(C=(G=q.next()).done);C=!0)B(G.value)}catch(W){P=!0,R=W}finally{try{!C&&q.return&&q.return()}finally{if(P)throw R}}var F=void 0;if((m=f.size)>2){$=m<t.sampleSize?m:t.sampleSize;for(var X=0;X<m;X++)p[X]=[];for(var Y=0;Y<$;Y++)g[Y]=[];return"draft"==t.quality||"all"==t.step?(function(t){var i=void 0;if(t){i=Math.floor(Math.random()*m);for(var n=0;n<m;n++)y[n]=b;for(var r=0;r<$;r++)d[r]=i,i=j(i,r,t)}else{!function(){for(var t=0,i=0,n=!1;i<$;){t=Math.floor(Math.random()*m),n=!1;for(var r=0;r<i;r++)if(d[r]==t){n=!0;break}n||(d[i]=t,i++)}}();for(var s=0;s<$;s++)j(d[s],s,t)}for(var e=0;e<m;e++)for(var o=0;o<$;o++)p[e][o]*=p[e][o];for(var h=0;h<$;h++)w[h]=[];for(var a=0;a<$;a++)for(var f=0;f<$;f++)w[a][f]=p[d[f]][a]}(x),function(){for(var t=e.svd(w),i=t.S,n=t.U,r=t.V,o=i[0]*i[0]*i[0],h=[],a=0;a<$;a++){h[a]=[];for(var f=0;f<$;f++)h[a][f]=0,a==f&&(h[a][f]=i[a]/(i[a]*i[a]+o/(i[a]*i[a])))}g=s.multMat(s.multMat(r,h),s.transpose(n))}(),function(){for(var t=void 0,i=void 0,n=[],r=[],e=[],o=[],h=0;h<m;h++)n[h]=Math.random(),r[h]=Math.random();n=s.normalize(n),r=s.normalize(r);for(var a=M,f=M,u=void 0;;){for(var c=0;c<m;c++)e[c]=n[c];if(n=s.multGamma(s.multL(s.multGamma(e),p,g)),t=s.dotProduct(e,n),n=s.normalize(n),a=s.dotProduct(e,n),(u=Math.abs(a/f))<=1+k&&u>=1)break;f=a}for(var d=0;d<m;d++)e[d]=n[d];for(f=M;;){for(var y=0;y<m;y++)o[y]=r[y];if(o=s.minusOp(o,s.multCons(e,s.dotProduct(e,o))),r=s.multGamma(s.multL(s.multGamma(o),p,g)),i=s.dotProduct(o,r),r=s.normalize(r),a=s.dotProduct(o,r),(u=Math.abs(a/f))<=1+k&&u>=1)break;f=a}for(var w=0;w<m;w++)o[w]=r[w];l=s.multCons(e,Math.sqrt(Math.abs(t))),v=s.multCons(o,Math.sqrt(Math.abs(i)))}(),F={nodeIndexes:f,xCoords:l,yCoords:v}):(f.forEach(function(t,n){l.push(i.getElementById(n).position("x")),v.push(i.getElementById(n).position("y"))}),F={nodeIndexes:f,xCoords:l,yCoords:v}),F}var _=f.keys(),H=i.getElementById(_.next().value),Z=H.position(),J=H.outerWidth();if(l.push(Z.x),v.push(Z.y),2==m){var V=i.getElementById(_.next().value).outerWidth();l.push(Z.x+J/2+V/2+t.idealEdgeLength),v.push(Z.y)}return F={nodeIndexes:f,xCoords:l,yCoords:v}}}},579:(t,i,n)=>{var r=n(212),s=function(t){t&&t("layout","fcose",r)};"undefined"!=typeof cytoscape&&s(cytoscape),t.exports=s},140:t=>{t.exports=z}},C={},function t(i){var n=C[i];if(void 0!==n)return n.exports;var r=C[i]={exports:{}};return B[i](r,r.exports,t),r.exports}(579))));var R={L:"left",R:"right",T:"top",B:"bottom"},G={L:n(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:n(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:n(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:n(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},q={L:n((t,i)=>t-i+2,"L"),R:n((t,i)=>t-2,"R"),T:n((t,i)=>t-i+2,"T"),B:n((t,i)=>t-2,"B")},F=n(function(t){return Y(t)?"L"===t?"R":"L":"T"===t?"B":"T"},"getOppositeArchitectureDirection"),X=n(function(t){return"L"===t||"R"===t||"T"===t||"B"===t},"isArchitectureDirection"),Y=n(function(t){return"L"===t||"R"===t},"isArchitectureDirectionX"),_=n(function(t){return"T"===t||"B"===t},"isArchitectureDirectionY"),H=n(function(t,i){const n=Y(t)&&_(i),r=_(t)&&Y(i);return n||r},"isArchitectureDirectionXY"),Z=n(function(t){const i=t[0],n=t[1],r=Y(i)&&_(n),s=_(i)&&Y(n);return r||s},"isArchitecturePairXY"),J=n(function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t},"isValidArchitectureDirectionPair"),V=n(function(t,i){const n=`${t}${i}`;return J(n)?n:void 0},"getArchitectureDirectionPair"),W=n(function([t,i],n){const r=n[0],s=n[1];return Y(r)?_(s)?[t+("L"===r?-1:1),i+("T"===s?1:-1)]:[t+("L"===r?-1:1),i]:Y(s)?[t+("L"===s?1:-1),i+("T"===r?1:-1)]:[t,i+("T"===r?1:-1)]},"shiftPositionByArchitectureDirectionPair"),U=n(function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),K=n(function(t,i){return H(t,i)?"bend":Y(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Q=n(function(t){return"service"===t.type},"isArchitectureService"),tt=n(function(t){return"junction"===t.type},"isArchitectureJunction"),it=n(t=>t.data(),"edgeData"),nt=n(t=>t.data(),"nodeData"),rt=d.architecture,st=(n(t=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=o,this.getAccTitle=h,this.setDiagramTitle=a,this.getDiagramTitle=f,this.getAccDescription=u,this.setAccDescription=c,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},l()}addService({id:t,icon:i,in:n,title:r,iconText:s}){if(void 0!==this.registeredIds[t])throw new Error(`The service id [${t}] is already in use by another ${this.registeredIds[t]}`);if(void 0!==n){if(t===n)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===this.registeredIds[n])throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===this.registeredIds[n])throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:i,iconText:s,title:r,edges:[],in:n}}getServices(){return Object.values(this.nodes).filter(Q)}addJunction({id:t,in:i}){this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:i}}getJunctions(){return Object.values(this.nodes).filter(tt)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:i,in:n,title:r}){var s,e,o;if(void 0!==(null==(s=this.registeredIds)?void 0:s[t]))throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds[t]}`);if(void 0!==n){if(t===n)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===(null==(e=this.registeredIds)?void 0:e[n]))throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===(null==(o=this.registeredIds)?void 0:o[n]))throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:i,title:r,in:n}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:i,lhsDir:n,rhsDir:r,lhsInto:s,rhsInto:e,lhsGroup:o,rhsGroup:h,title:a}){if(!X(n))throw new Error(`Invalid direction given for left hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(n)}`);if(!X(r))throw new Error(`Invalid direction given for right hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(r)}`);if(void 0===this.nodes[t]&&void 0===this.groups[t])throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===this.nodes[i]&&void 0===this.groups[i])throw new Error(`The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes[t].in,u=this.nodes[i].in;if(o&&f&&u&&f==u)throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(h&&f&&u&&f==u)throw new Error(`The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const c={lhsId:t,lhsDir:n,lhsInto:s,lhsGroup:o,rhsId:i,rhsDir:r,rhsInto:e,rhsGroup:h,title:a};this.edges.push(c),this.nodes[t]&&this.nodes[i]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[i].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(void 0===this.dataStructures){const t={},i=Object.entries(this.nodes).reduce((i,[n,r])=>(i[n]=r.edges.reduce((i,r)=>{var s,e;const o=null==(s=this.getNode(r.lhsId))?void 0:s.in,h=null==(e=this.getNode(r.rhsId))?void 0:e.in;if(o&&h&&o!==h){const i=K(r.lhsDir,r.rhsDir);"bend"!==i&&(t[o]??(t[o]={}),t[o][h]=i,t[h]??(t[h]={}),t[h][o]=i)}if(r.lhsId===n){const t=V(r.lhsDir,r.rhsDir);t&&(i[t]=r.rhsId)}else{const t=V(r.rhsDir,r.lhsDir);t&&(i[t]=r.lhsId)}return i},{}),i),{}),r=Object.keys(i)[0],s={[r]:1},e=Object.keys(i).reduce((t,i)=>i===r?t:{...t,[i]:1},{}),o=n(t=>{const n={[t]:[0,0]},r=[t];for(;r.length>0;){const t=r.shift();if(t){s[t]=1,delete e[t];const o=i[t],[h,a]=n[t];Object.entries(o).forEach(([t,i])=>{s[i]||(n[i]=W([h,a],t),r.push(i))})}}return n},"BFS"),h=[o(r)];for(;Object.keys(e).length>0;)h.push(o(Object.keys(e)[0]));this.dataStructures={adjList:i,spatialMaps:h,groupAlignments:t}}return this.dataStructures}setElementForId(t,i){this.elements[t]=i}getElementById(t){return this.elements[t]}getConfig(){return v({...rt,...y().architecture})}getConfigField(t){return this.getConfig()[t]}},"ArchitectureDB"),t),et=n((t,i)=>{S(t,i),t.groups.map(t=>i.addGroup(t)),t.services.map(t=>i.addService({...t,type:"service"})),t.junctions.map(t=>i.addJunction({...t,type:"junction"})),t.edges.map(t=>i.addEdge(t))},"populateDb"),ot={parser:{yy:void 0},parse:n(async t=>{var i;const n=await $("architecture",t);e.debug(n);const r=null==(i=ot.parser)?void 0:i.yy;if(!(r instanceof st))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");et(n,r)},"parse")},ht=n(t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`,"getStyles"),at=n(t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`,"wrapIcon"),ft={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:at('<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:at('<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:at('<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:at('<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:at('<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:x,blank:{body:at("")}}},ut=n(async function(t,i,n){const r=n.getConfigField("padding"),s=n.getConfigField("iconSize"),e=s/2,o=s/6,h=o/2;await Promise.all(i.edges().map(async i=>{var s,a;const{source:f,sourceDir:u,sourceArrow:c,sourceGroup:l,target:v,targetDir:d,targetArrow:y,targetGroup:g,label:m}=it(i);let{x:b,y:k}=i[0].sourceEndpoint();const{x:x,y:S}=i[0].midpoint();let{x:$,y:j}=i[0].targetEndpoint();const O=r+4;if(l&&(Y(u)?b+="L"===u?-O:O:k+="T"===u?-O:O+18),g&&(Y(d)?$+="L"===d?-O:O:j+="T"===d?-O:O+18),l||"junction"!==(null==(s=n.getNode(f))?void 0:s.type)||(Y(u)?b+="L"===u?e:-e:k+="T"===u?e:-e),g||"junction"!==(null==(a=n.getNode(v))?void 0:a.type)||(Y(d)?$+="L"===d?e:-e:j+="T"===d?e:-e),i[0].t.rscratch){const i=t.insert("g");if(i.insert("path").attr("d",`M ${b},${k} L ${x},${S} L${$},${j} `).attr("class","edge").attr("id",M(f,v,{prefix:"L"})),c){const t=Y(u)?q[u](b,o):b-h,n=_(u)?q[u](k,o):k-h;i.insert("polygon").attr("points",G[u](o)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(y){const t=Y(d)?q[d]($,o):$-h,n=_(d)?q[d](j,o):j-h;i.insert("polygon").attr("points",G[d](o)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(m){const t=H(u,d)?"XY":Y(u)?"X":"Y";let n=0;n="X"===t?Math.abs(b-$):"Y"===t?Math.abs(k-j)/1.5:Math.abs(b-$)/2;const r=i.append("g");if(await w(r,m,{useHtmlLabels:!1,width:n,classes:"architecture-service-label"},p()),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===t)r.attr("transform","translate("+x+", "+S+")");else if("Y"===t)r.attr("transform","translate("+x+", "+S+") rotate(-90)");else if("XY"===t){const t=V(u,d);if(t&&Z(t)){const i=r.node().getBoundingClientRect(),[n,s]=U(t);r.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*n*s*45})`);const e=r.node().getBoundingClientRect();r.attr("transform",`\n translate(${x}, ${S-i.height/2})\n translate(${n*e.width/2}, ${s*e.height/2})\n rotate(${-1*n*s*45}, 0, ${i.height/2})\n `)}}}}}))},"drawEdges"),ct=n(async function(t,i,n){const r=.75*n.getConfigField("padding"),s=n.getConfigField("fontSize"),e=n.getConfigField("iconSize")/2;await Promise.all(i.nodes().map(async i=>{const o=nt(i);if("group"===o.type){const{h:h,w:a,x1:f,y1:u}=i.boundingBox(),c=t.append("rect");c.attr("id",`group-${o.id}`).attr("x",f+e).attr("y",u+e).attr("width",a).attr("height",h).attr("class","node-bkg");const l=t.append("g");let v=f,d=u;if(o.icon){const t=l.append("g");t.html(`<g>${await g(o.icon,{height:r,width:r,fallbackPrefix:ft.prefix})}</g>`),t.attr("transform","translate("+(v+e+1)+", "+(d+e+1)+")"),v+=r,d+=s/2-1-2}if(o.label){const t=l.append("g");await w(t,o.label,{useHtmlLabels:!1,width:a,classes:"architecture-service-label"},p()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),t.attr("transform","translate("+(v+e+4)+", "+(d+e+2)+")")}n.setElementForId(o.id,c)}}))},"drawGroups"),lt=n(async function(t,i,n){const r=p();for(const s of n){const n=i.append("g"),e=t.getConfigField("iconSize");if(s.title){const t=n.append("g");await w(t,s.title,{useHtmlLabels:!1,width:1.5*e,classes:"architecture-service-label"},r),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+e/2+", "+e+")")}const o=n.append("g");if(s.icon)o.html(`<g>${await g(s.icon,{height:e,width:e,fallbackPrefix:ft.prefix})}</g>`);else if(s.iconText){o.html(`<g>${await g("blank",{height:e,width:e,fallbackPrefix:ft.prefix})}</g>`);const t=o.append("g").append("foreignObject").attr("width",e).attr("height",e).append("div").attr("class","node-icon-text").attr("style",`height: ${e}px;`).append("div").html(m(s.iconText,r)),i=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((e-2)/i)};`)}else o.append("path").attr("class","node-bkg").attr("id","node-"+s.id).attr("d",`M0 ${e} v${-e} q0,-5 5,-5 h${e} q5,0 5,5 v${e} H0 Z`);n.attr("id",`service-${s.id}`).attr("class","architecture-service");const{width:h,height:a}=n.node().getBBox();s.width=h,s.height=a,t.setElementForId(s.id,n)}return 0},"drawServices"),vt=n(function(t,i,n){n.forEach(n=>{const r=i.append("g"),s=t.getConfigField("iconSize");r.append("g").append("rect").attr("id","node-"+n.id).attr("fill-opacity","0").attr("width",s).attr("height",s),r.attr("class","architecture-junction");const{width:e,height:o}=r._groups[0][0].getBBox();r.width=e,r.height=o,t.setElementForId(n.id,r)})},"drawJunctions");function dt(t,i,n){t.forEach(t=>{i.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:n.getConfigField("iconSize"),height:n.getConfigField("iconSize")},classes:"node-service"})})}function yt(t,i,n){t.forEach(t=>{i.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:n.getConfigField("iconSize"),height:n.getConfigField("iconSize")},classes:"node-junction"})})}function pt(t,i){i.nodes().map(i=>{const n=nt(i);if("group"===n.type)return;n.x=i.position().x,n.y=i.position().y;t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}function wt(t,i){t.forEach(t=>{i.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})})}function gt(t,i){t.forEach(t=>{const{lhsId:n,rhsId:r,lhsInto:s,lhsGroup:e,rhsInto:o,lhsDir:h,rhsDir:a,rhsGroup:f,title:u}=t,c=H(t.lhsDir,t.rhsDir)?"segments":"straight",l={id:`${n}-${r}`,label:u,source:n,sourceDir:h,sourceArrow:s,sourceGroup:e,sourceEndpoint:"L"===h?"0 50%":"R"===h?"100% 50%":"T"===h?"50% 0":"50% 100%",target:r,targetDir:a,targetArrow:o,targetGroup:f,targetEndpoint:"L"===a?"0 50%":"R"===a?"100% 50%":"T"===a?"50% 0":"50% 100%"};i.add({group:"edges",data:l,classes:c})})}function mt(t,i,r){const s=n((t,i)=>Object.entries(t).reduce((t,[n,s])=>{var e;let o=0;const h=Object.entries(s);if(1===h.length)return t[n]=h[0][1],t;for(let a=0;a<h.length-1;a++)for(let s=a+1;s<h.length;s++){const[f,u]=h[a],[c,l]=h[s];if((null==(e=r[f])?void 0:e[c])===i)t[n]??(t[n]=[]),t[n]=[...t[n],...u,...l];else if("default"===f||"default"===c)t[n]??(t[n]=[]),t[n]=[...t[n],...u,...l];else{t[`${n}-${o++}`]=u;t[`${n}-${o++}`]=l}}return t},{}),"flattenAlignments"),e=i.map(i=>{const n={},r={};return Object.entries(i).forEach(([i,[s,e]])=>{var o,h,a;const f=(null==(o=t.getNode(i))?void 0:o.in)??"default";n[e]??(n[e]={}),(h=n[e])[f]??(h[f]=[]),n[e][f].push(i),r[s]??(r[s]={}),(a=r[s])[f]??(a[f]=[]),r[s][f].push(i)}),{horiz:Object.values(s(n,"horizontal")).filter(t=>t.length>1),vert:Object.values(s(r,"vertical")).filter(t=>t.length>1)}}),[o,h]=e.reduce(([t,i],{horiz:n,vert:r})=>[[...t,...n],[...i,...r]],[[],[]]);return{horizontal:o,vertical:h}}function bt(t,i){const r=[],s=n(t=>`${t[0]},${t[1]}`,"posToStr"),e=n(t=>t.split(",").map(t=>parseInt(t)),"strToPos");return t.forEach(t=>{const n=Object.fromEntries(Object.entries(t).map(([t,i])=>[s(i),t])),o=[s([0,0])],h={},a={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const t=o.shift();if(t){h[t]=1;const f=n[t];if(f){const u=e(t);Object.entries(a).forEach(([t,e])=>{const a=s([u[0]+e[0],u[1]+e[1]]),c=n[a];c&&!h[a]&&(o.push(a),r.push({[R[t]]:c,[R[F(t)]]:f,gap:1.5*i.getConfigField("iconSize")}))})}}}}),r}function Mt(t,i,r,s,o,{spatialMaps:h,groupAlignments:a}){return new Promise(f=>{const u=b("body").append("div").attr("id","cy").attr("style","display:none"),c=j({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${o.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:`${o.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),wt(r,c),dt(t,c,o),yt(i,c,o),gt(s,c);const l=mt(o,h,a),v=bt(h,o),d=c.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[i,n]=t.connectedNodes(),{parent:r}=nt(i),{parent:s}=nt(n);return r===s?1.5*o.getConfigField("iconSize"):.5*o.getConfigField("iconSize")},edgeElasticity(t){const[i,n]=t.connectedNodes(),{parent:r}=nt(i),{parent:s}=nt(n);return r===s?.45:.001},alignmentConstraint:l,relativePlacementConstraint:v});d.one("layoutstop",()=>{var t;function i(t,i,n,r){let s,e;const{x:o,y:h}=t,{x:a,y:f}=i;e=(r-h+(o-n)*(h-f)/(o-a))/Math.sqrt(1+Math.pow((h-f)/(o-a),2)),s=Math.sqrt(Math.pow(r-h,2)+Math.pow(n-o,2)-Math.pow(e,2));s/=Math.sqrt(Math.pow(a-o,2)+Math.pow(f-h,2));let u=(a-o)*(r-h)-(f-h)*(n-o);switch(!0){case u>=0:u=1;break;case u<0:u=-1}let c=(a-o)*(n-o)+(f-h)*(r-h);switch(!0){case c>=0:c=1;break;case c<0:c=-1}return e=Math.abs(e)*u,s*=c,{distances:e,weights:s}}n(i,"getSegmentWeights"),c.startBatch();for(const n of Object.values(c.edges()))if(null==(t=n.data)?void 0:t.call(n)){const{x:t,y:r}=n.source().position(),{x:s,y:e}=n.target().position();if(t!==s&&r!==e){const t=n.sourceEndpoint(),r=n.targetEndpoint(),{sourceDir:s}=it(n),[e,o]=_(s)?[t.x,r.y]:[r.x,t.y],{weights:h,distances:a}=i(t,r,e,o);n.style("segment-distances",a),n.style("segment-weights",h)}}c.endBatch(),d.run()}),d.run(),c.ready(t=>{e.info("Ready",t),f(c)})})}k([{name:ft.prefix,icons:ft}]),j.use(P),n(dt,"addServices"),n(yt,"addJunctions"),n(pt,"positionNodes"),n(wt,"addGroups"),n(gt,"addEdges"),n(mt,"getAlignments"),n(bt,"getRelativeConstraints"),n(Mt,"layoutArchitecture");var kt={draw:n(async(t,i,n,e)=>{const o=e.db,h=o.getServices(),a=o.getJunctions(),f=o.getGroups(),u=o.getEdges(),c=o.getDataStructures(),l=r(i),v=l.append("g");v.attr("class","architecture-edges");const d=l.append("g");d.attr("class","architecture-services");const y=l.append("g");y.attr("class","architecture-groups"),await lt(o,d,h),vt(o,d,a);const p=await Mt(h,a,f,u,o,c);await ut(v,p,o),await ct(y,p,o),pt(o,p),s(void 0,l,o.getConfigField("padding"),o.getConfigField("useMaxWidth"))},"draw")},xt={parser:ot,get db(){return new st},renderer:kt,styles:ht};export{xt as diagram};
@@ -1 +0,0 @@
1
- var t,e;import{g as r}from"./chunk-FMBD7UC4-cCEjZ-PC.js";import{_ as s,F as n,d as i,e as a,l as o,y as c,A as l,ai as d,R as h,S as u,c as f,O as y,aj as x,ak as p,al as g,u as b,k as m,am as k,an as w,i as v,ao as S}from"./index-p16PXaGU.js";import{c as _}from"./clone-BboBU3Th.js";import{G as L}from"./graph-BP-dUxFo.js";import{c as E}from"./channel-BhvEAUA0.js";import"./_baseUniq-DmXMUmS1.js";var D=function(){var t=s(function(t,e,r,s){for(r=r||{},s=t.length;s--;r[t[s]]=e);return r},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],o=[1,16],c=[1,17],l=[1,18],d=[8,30],h=[8,10,21,28,29,30,31,39,43,46],u=[1,23],f=[1,24],y=[8,10,15,16,21,28,29,30,31,39,43,46],x=[8,10,15,16,21,27,28,29,30,31,39,43,46],p=[1,49],g={trace:s(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:s(function(t,e,r,s,n,i,a){var o=i.length-1;switch(n){case 4:s.getLogger().debug("Rule: separator (NL) ");break;case 5:s.getLogger().debug("Rule: separator (Space) ");break;case 6:s.getLogger().debug("Rule: separator (EOF) ");break;case 7:s.getLogger().debug("Rule: hierarchy: ",i[o-1]),s.setHierarchy(i[o-1]);break;case 8:s.getLogger().debug("Stop NL ");break;case 9:s.getLogger().debug("Stop EOF ");break;case 10:s.getLogger().debug("Stop NL2 ");break;case 11:s.getLogger().debug("Stop EOF2 ");break;case 12:s.getLogger().debug("Rule: statement: ",i[o]),"number"==typeof i[o].length?this.$=i[o]:this.$=[i[o]];break;case 13:s.getLogger().debug("Rule: statement #2: ",i[o-1]),this.$=[i[o-1]].concat(i[o]);break;case 14:s.getLogger().debug("Rule: link: ",i[o],t),this.$={edgeTypeStr:i[o],label:""};break;case 15:s.getLogger().debug("Rule: LABEL link: ",i[o-3],i[o-1],i[o]),this.$={edgeTypeStr:i[o],label:i[o-1]};break;case 18:const e=parseInt(i[o]),r=s.generateId();this.$={id:r,type:"space",label:"",width:e,children:[]};break;case 23:s.getLogger().debug("Rule: (nodeStatement link node) ",i[o-2],i[o-1],i[o]," typestr: ",i[o-1].edgeTypeStr);const n=s.edgeStrToEdgeData(i[o-1].edgeTypeStr);this.$=[{id:i[o-2].id,label:i[o-2].label,type:i[o-2].type,directions:i[o-2].directions},{id:i[o-2].id+"-"+i[o].id,start:i[o-2].id,end:i[o].id,label:i[o-1].label,type:"edge",directions:i[o].directions,arrowTypeEnd:n,arrowTypeStart:"arrow_open"},{id:i[o].id,label:i[o].label,type:s.typeStr2Type(i[o].typeStr),directions:i[o].directions}];break;case 24:s.getLogger().debug("Rule: nodeStatement (abc88 node size) ",i[o-1],i[o]),this.$={id:i[o-1].id,label:i[o-1].label,type:s.typeStr2Type(i[o-1].typeStr),directions:i[o-1].directions,widthInColumns:parseInt(i[o],10)};break;case 25:s.getLogger().debug("Rule: nodeStatement (node) ",i[o]),this.$={id:i[o].id,label:i[o].label,type:s.typeStr2Type(i[o].typeStr),directions:i[o].directions,widthInColumns:1};break;case 26:s.getLogger().debug("APA123",this?this:"na"),s.getLogger().debug("COLUMNS: ",i[o]),this.$={type:"column-setting",columns:"auto"===i[o]?-1:parseInt(i[o])};break;case 27:s.getLogger().debug("Rule: id-block statement : ",i[o-2],i[o-1]),s.generateId(),this.$={...i[o-2],type:"composite",children:i[o-1]};break;case 28:s.getLogger().debug("Rule: blockStatement : ",i[o-2],i[o-1],i[o]);const a=s.generateId();this.$={id:a,type:"composite",label:"",children:i[o-1]};break;case 29:s.getLogger().debug("Rule: node (NODE_ID separator): ",i[o]),this.$={id:i[o]};break;case 30:s.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",i[o-1],i[o]),this.$={id:i[o-1],label:i[o].label,typeStr:i[o].typeStr,directions:i[o].directions};break;case 31:s.getLogger().debug("Rule: dirList: ",i[o]),this.$=[i[o]];break;case 32:s.getLogger().debug("Rule: dirList: ",i[o-1],i[o]),this.$=[i[o-1]].concat(i[o]);break;case 33:s.getLogger().debug("Rule: nodeShapeNLabel: ",i[o-2],i[o-1],i[o]),this.$={typeStr:i[o-2]+i[o],label:i[o-1]};break;case 34:s.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",i[o-3],i[o-2]," #3:",i[o-1],i[o]),this.$={typeStr:i[o-3]+i[o],label:i[o-2],directions:i[o-1]};break;case 35:case 36:this.$={type:"classDef",id:i[o-1].trim(),css:i[o].trim()};break;case 37:this.$={type:"applyClass",id:i[o-1].trim(),styleClass:i[o].trim()};break;case 38:this.$={type:"applyStyles",id:i[o-1].trim(),stylesStr:i[o].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:o,43:c,46:l},{8:[1,20]},t(d,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:o,43:c,46:l}),t(h,[2,16],{14:22,15:u,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(y,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:o,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(x,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(d,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(y,[2,24]),{10:e,11:37,13:4,14:22,15:u,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:o,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(x,[2,30]),{18:[1,43]},{18:[1,44]},t(y,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:p},{15:[1,50]},t(h,[2,27]),t(x,[2,33]),{38:[1,51]},{33:52,34:p,38:[2,31]},{31:[2,15]},t(x,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:s(function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)},"parseError"),parse:s(function(t){var e=this,r=[0],n=[],i=[null],a=[],o=this.table,c="",l=0,d=0,h=a.slice.call(arguments,1),u=Object.create(this.lexer),f={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(f.yy[y]=this.yy[y]);u.setInput(t,f.yy),f.yy.lexer=u,f.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var x=u.yylloc;a.push(x);var p=u.options&&u.options.ranges;function g(){var t;return"number"!=typeof(t=n.pop()||u.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(function(t){r.length=r.length-2*t,i.length=i.length-t,a.length=a.length-t},"popStack"),s(g,"lex");for(var b,m,k,w,v,S,_,L,E={};;){if(m=r[r.length-1],this.defaultActions[m]?k=this.defaultActions[m]:(null==b&&(b=g()),k=o[m]&&o[m][b]),void 0===k||!k.length||!k[0]){var D="";for(v in L=[],o[m])this.terminals_[v]&&v>2&&L.push("'"+this.terminals_[v]+"'");D=u.showPosition?"Parse error on line "+(l+1)+":\n"+u.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(D,{text:u.match,token:this.terminals_[b]||b,line:u.yylineno,loc:x,expected:L})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+b);switch(k[0]){case 1:r.push(b),i.push(u.yytext),a.push(u.yylloc),r.push(k[1]),b=null,d=u.yyleng,c=u.yytext,l=u.yylineno,x=u.yylloc;break;case 2:if(S=this.productions_[k[1]][1],E.$=i[i.length-S],E._$={first_line:a[a.length-(S||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(S||1)].first_column,last_column:a[a.length-1].last_column},p&&(E._$.range=[a[a.length-(S||1)].range[0],a[a.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[c,d,l,f.yy,k[1],i,a].concat(h))))return w;S&&(r=r.slice(0,-1*S*2),i=i.slice(0,-1*S),a=a.slice(0,-1*S)),r.push(this.productions_[k[1]][0]),i.push(E.$),a.push(E._$),_=o[r[r.length-2]][r[r.length-1]],r.push(_);break;case 3:return!0}}return!0},"parse")},b=function(){return{EOF:1,parseError:s(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:s(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:s(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.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),t},"input"),unput:s(function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=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),r.length-1&&(this.yylineno-=r.length-1);var n=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:r?(r.length===s.length?this.yylloc.first_column:0)+s[s.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:s(function(t){this.unput(this.match.slice(t))},"less"),pastInput:s(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:s(function(t,e){var r,s,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in n)this[i]=n[i];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;var t,e,r,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),i=0;i<n.length;i++)if((r=this._input.match(this.rules[n[i]]))&&(!e||r[0].length>e[0].length)){if(e=r,s=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,n[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var t=this.next();return t||this.lex()},"lex"),begin:s(function(t){this.conditionStack.push(t)},"begin"),popState:s(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(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:s(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:s(function(t){this.begin(t)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:s(function(t,e,r,s){switch(r){case 0:return t.getLogger().debug("Found block-beta"),10;case 1:return t.getLogger().debug("Found id-block"),29;case 2:return t.getLogger().debug("Found block"),10;case 3:t.getLogger().debug(".",e.yytext);break;case 4:t.getLogger().debug("_",e.yytext);break;case 5:return 5;case 6:return e.yytext=-1,28;case 7:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 13:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 14:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 15:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.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 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),37;case 74:return t.getLogger().debug("Lex: NODE_ID",e.yytext),31;case 75:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 78:return"NODE_DESCR";case 80:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 83:t.getLogger().debug("LEX POPPING"),this.popState();break;case 84:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 91:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 93:case 94:case 95:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 96:case 97:case 98:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 100:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 102:case 103:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 104:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.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 m(){this.yy={}}return g.lexer=b,s(m,"Parser"),m.prototype=g,g.Parser=m,new m}();D.parser=D;var $=D,N=new Map,T=[],O=new Map,I="color",R="fill",A=f(),M=new Map,C=s(t=>m.sanitizeText(t,A),"sanitizeText"),B=s(function(t,e=""){let r=M.get(t);r||(r={id:t,styles:[],textStyles:[]},M.set(t,r)),null!=e&&e.split(",").forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(I).exec(t)){const t=e.replace(R,"bgFill").replace(I,R);r.textStyles.push(t)}r.styles.push(e)})},"addStyleClass"),P=s(function(t,e=""){const r=N.get(t);null!=e&&(r.styles=e.split(","))},"addStyle2Node"),Y=s(function(t,e){t.split(",").forEach(function(t){let r=N.get(t);if(void 0===r){const e=t.trim();r={id:e,type:"na",children:[]},N.set(e,r)}r.classes||(r.classes=[]),r.classes.push(e)})},"setCssClass"),X=s((t,e)=>{const r=t.flat(),s=[],n=r.find(t=>"column-setting"===(null==t?void 0:t.type)),i=(null==n?void 0:n.columns)??-1;for(const a of r)if("number"==typeof i&&i>0&&"column-setting"!==a.type&&"number"==typeof a.widthInColumns&&a.widthInColumns>i&&o.warn(`Block ${a.id} width ${a.widthInColumns} exceeds configured column width ${i}`),a.label&&(a.label=C(a.label)),"classDef"!==a.type)if("applyClass"!==a.type)if("applyStyles"!==a.type)if("column-setting"===a.type)e.columns=a.columns??-1;else if("edge"===a.type){const t=(O.get(a.id)??0)+1;O.set(a.id,t),a.id=t+"-"+a.id,T.push(a)}else{a.label||("composite"===a.type?a.label="":a.label=a.id);const t=N.get(a.id);if(void 0===t?N.set(a.id,a):("na"!==a.type&&(t.type=a.type),a.label!==a.id&&(t.label=a.label)),a.children&&X(a.children,a),"space"===a.type){const t=a.width??1;for(let e=0;e<t;e++){const t=_(a);t.id=t.id+"-"+e,N.set(t.id,t),s.push(t)}}else void 0===t&&s.push(a)}else(null==a?void 0:a.stylesStr)&&P(a.id,null==a?void 0:a.stylesStr);else Y(a.id,(null==a?void 0:a.styleClass)??"");else B(a.id,a.css);e.children=s},"populateBlockDatabase"),W=[],z={id:"root",type:"composite",children:[],columns:-1},F=s(()=>{o.debug("Clear called"),c(),z={id:"root",type:"composite",children:[],columns:-1},N=new Map([["root",z]]),W=[],M=new Map,T=[],O=new Map},"clear");function U(t){switch(o.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return o.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"}}function H(t){return o.debug("typeStr2Type",t),"=="===t?"thick":"normal"}function K(t){switch(t.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}s(U,"typeStr2Type"),s(H,"edgeTypeStr2Type"),s(K,"edgeStrToEdgeData");var j=0,Z=s(()=>(j++,"id-"+Math.random().toString(36).substr(2,12)+"-"+j),"generateId"),q=s(t=>{z.children=t,X(t,z),W=z.children},"setHierarchy"),G=s(t=>{const e=N.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),J=s(()=>[...N.values()],"getBlocksFlat"),Q=s(()=>W||[],"getBlocks"),V=s(()=>T,"getEdges"),tt=s(t=>N.get(t),"getBlock"),et=s(t=>{N.set(t.id,t)},"setBlock"),rt=s(()=>o,"getLogger"),st=s(function(){return M},"getClasses"),nt={getConfig:s(()=>n().block,"getConfig"),typeStr2Type:U,edgeTypeStr2Type:H,edgeStrToEdgeData:K,getLogger:rt,getBlocksFlat:J,getBlocks:Q,getEdges:V,setHierarchy:q,getBlock:tt,setBlock:et,getColumns:G,getClasses:st,clear:F,generateId:Z},it=s((t,e)=>{const r=E,s=r(t,"r"),n=r(t,"g"),i=r(t,"b");return l(s,n,i,e)},"fade"),at=s(t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .cluster-label text {\n fill: ${t.titleColor};\n }\n .cluster-label span,p {\n color: ${t.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${it(t.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .node .cluster {\n // fill: ${it(t.mainBkg,.5)};\n fill: ${it(t.clusterBkg,.5)};\n stroke: ${it(t.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n .cluster span,p {\n color: ${t.titleColor};\n }\n /* .cluster div {\n color: ${t.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n ${r()}\n`,"getStyles"),ot=s((t,e,r,s)=>{e.forEach(e=>{ct[e](t,r,s)})},"insertMarkers"),ct={extension:s((t,e,r)=>{o.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),composition:s((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),aggregation:s((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),dependency:s((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),lollipop:s((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),point:s((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),circle:s((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),cross:s((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),barb:s((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb")},lt=ot,dt=(null==(e=null==(t=f())?void 0:t.block)?void 0:e.padding)??8;function ht(t,e){if(0===t||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(1===t)return{px:0,py:e};return{px:e%t,py:Math.floor(e/t)}}s(ht,"calculateBlockPosition");var ut=s(t=>{let e=0,r=0;for(const s of t.children){const{width:n,height:i,x:a,y:c}=s.size??{width:0,height:0,x:0,y:0};o.debug("getMaxChildSize abc95 child:",s.id,"width:",n,"height:",i,"x:",a,"y:",c,s.type),"space"!==s.type&&(n>e&&(e=n/(t.widthInColumns??1)),i>r&&(r=i))}return{width:e,height:r}},"getMaxChildSize");function ft(t,e,r=0,s=0){var n,i,a,c,l,d,h,u,f,y,x;o.debug("setBlockSizes abc95 (start)",t.id,null==(n=null==t?void 0:t.size)?void 0:n.x,"block width =",null==t?void 0:t.size,"siblingWidth",r),(null==(i=null==t?void 0:t.size)?void 0:i.width)||(t.size={width:r,height:s,x:0,y:0});let p=0,g=0;if((null==(a=t.children)?void 0:a.length)>0){for(const r of t.children)ft(r,e);const n=ut(t);p=n.width,g=n.height,o.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",p,g);for(const e of t.children)e.size&&(o.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${p} ${g} ${JSON.stringify(e.size)}`),e.size.width=p*(e.widthInColumns??1)+dt*((e.widthInColumns??1)-1),e.size.height=g,e.size.x=0,e.size.y=0,o.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${p} maxHeight:${g}`));for(const r of t.children)ft(r,e,p,g);const i=t.columns??-1;let a=0;for(const e of t.children)a+=e.widthInColumns??1;let u=t.children.length;i>0&&i<a&&(u=i);const f=Math.ceil(a/u);let y=u*(p+dt)+dt,x=f*(g+dt)+dt;if(y<r){o.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${s} width ${y}`),y=r,x=s;const e=(r-u*dt-dt)/u,n=(s-f*dt-dt)/f;o.debug("Size indata abc88",t.id,"childWidth",e,"maxWidth",p),o.debug("Size indata abc88",t.id,"childHeight",n,"maxHeight",g),o.debug("Size indata abc88 xSize",u,"padding",dt);for(const r of t.children)r.size&&(r.size.width=e,r.size.height=n,r.size.x=0,r.size.y=0)}if(o.debug(`abc95 (finale calc) ${t.id} xSize ${u} ySize ${f} columns ${i}${t.children.length} width=${Math.max(y,(null==(c=t.size)?void 0:c.width)||0)}`),y<((null==(l=null==t?void 0:t.size)?void 0:l.width)||0)){y=(null==(d=null==t?void 0:t.size)?void 0:d.width)||0;const e=i>0?Math.min(t.children.length,i):t.children.length;if(e>0){const r=(y-e*dt-dt)/e;o.debug("abc95 (growing to fit) width",t.id,y,null==(h=t.size)?void 0:h.width,r);for(const e of t.children)e.size&&(e.size.width=r)}}t.size={width:y,height:x,x:0,y:0}}o.debug("setBlockSizes abc94 (done)",t.id,null==(u=null==t?void 0:t.size)?void 0:u.x,null==(f=null==t?void 0:t.size)?void 0:f.width,null==(y=null==t?void 0:t.size)?void 0:y.y,null==(x=null==t?void 0:t.size)?void 0:x.height)}function yt(t,e){var r,s,n,i,a,c,l,d,h,u,f,y,x,p,g,b,m;o.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${null==(r=null==t?void 0:t.size)?void 0:r.x} y: ${null==(s=null==t?void 0:t.size)?void 0:s.y} width: ${null==(n=null==t?void 0:t.size)?void 0:n.width}`);const k=t.columns??-1;if(o.debug("layoutBlocks columns abc95",t.id,"=>",k,t),t.children&&t.children.length>0){const e=(null==(a=null==(i=null==t?void 0:t.children[0])?void 0:i.size)?void 0:a.width)??0,r=t.children.length*e+(t.children.length-1)*dt;o.debug("widthOfChildren 88",r,"posX");let s=0;o.debug("abc91 block?.size?.x",t.id,null==(c=null==t?void 0:t.size)?void 0:c.x);let n=(null==(l=null==t?void 0:t.size)?void 0:l.x)?(null==(d=null==t?void 0:t.size)?void 0:d.x)+(-(null==(h=null==t?void 0:t.size)?void 0:h.width)/2||0):-dt,g=0;for(const i of t.children){const e=t;if(!i.size)continue;const{width:r,height:a}=i.size,{px:c,py:l}=ht(k,s);if(l!=g&&(g=l,n=(null==(u=null==t?void 0:t.size)?void 0:u.x)?(null==(f=null==t?void 0:t.size)?void 0:f.x)+(-(null==(y=null==t?void 0:t.size)?void 0:y.width)/2||0):-dt,o.debug("New row in layout for block",t.id," and child ",i.id,g)),o.debug(`abc89 layout blocks (child) id: ${i.id} Pos: ${s} (px, py) ${c},${l} (${null==(x=null==e?void 0:e.size)?void 0:x.x},${null==(p=null==e?void 0:e.size)?void 0:p.y}) parent: ${e.id} width: ${r}${dt}`),e.size){const t=r/2;i.size.x=n+dt+t,o.debug(`abc91 layout blocks (calc) px, pyid:${i.id} startingPos=X${n} new startingPosX${i.size.x} ${t} padding=${dt} width=${r} halfWidth=${t} => x:${i.size.x} y:${i.size.y} ${i.widthInColumns} (width * (child?.w || 1)) / 2 ${r*((null==i?void 0:i.widthInColumns)??1)/2}`),n=i.size.x+t,i.size.y=e.size.y-e.size.height/2+l*(a+dt)+a/2+dt,o.debug(`abc88 layout blocks (calc) px, pyid:${i.id}startingPosX${n}${dt}${t}=>x:${i.size.x}y:${i.size.y}${i.widthInColumns}(width * (child?.w || 1)) / 2${r*((null==i?void 0:i.widthInColumns)??1)/2}`)}i.children&&yt(i);let d=(null==i?void 0:i.widthInColumns)??1;k>0&&(d=Math.min(d,k-s%k)),s+=d,o.debug("abc88 columnsPos",i,s)}}o.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${null==(g=null==t?void 0:t.size)?void 0:g.x} y: ${null==(b=null==t?void 0:t.size)?void 0:b.y} width: ${null==(m=null==t?void 0:t.size)?void 0:m.width}`)}function xt(t,{minX:e,minY:r,maxX:s,maxY:n}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){const{x:i,y:a,width:o,height:c}=t.size;i-o/2<e&&(e=i-o/2),a-c/2<r&&(r=a-c/2),i+o/2>s&&(s=i+o/2),a+c/2>n&&(n=a+c/2)}if(t.children)for(const i of t.children)({minX:e,minY:r,maxX:s,maxY:n}=xt(i,{minX:e,minY:r,maxX:s,maxY:n}));return{minX:e,minY:r,maxX:s,maxY:n}}function pt(t){const e=t.getBlock("root");if(!e)return;ft(e,t,0,0),yt(e),o.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:s,maxX:n,maxY:i}=xt(e);return{x:r,y:s,width:n-r,height:i-s}}function gt(t,e){e&&t.attr("style",e)}function bt(t,e){const r=i(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),s=r.append("xhtml:div"),n=t.label,a=t.isNode?"nodeLabel":"edgeLabel",o=s.append("span");return o.html(v(n,e)),gt(o,t.labelStyle),o.attr("class",a),gt(s,t.labelStyle),s.style("display","inline-block"),s.style("white-space","nowrap"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),r.node()}s(ft,"setBlockSizes"),s(yt,"layoutBlocks"),s(xt,"findBounds"),s(pt,"layout"),s(gt,"applyStyle"),s(bt,"addHtmlLabel");var mt=s(async(t,e,r,s)=>{let n=t||"";"object"==typeof n&&(n=n[0]);const i=f();if(x(i.flowchart.htmlLabels)){n=n.replace(/\\n|\n/g,"<br />"),o.debug("vertexText"+n);return bt({isNode:s,label:await k(w(n)),labelStyle:e.replace("fill:","color:")},i)}{const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));let s=[];s="string"==typeof n?n.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(n)?n:[];for(const e of s){const s=document.createElementNS("http://www.w3.org/2000/svg","tspan");s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.setAttribute("dy","1em"),s.setAttribute("x","0"),r?s.setAttribute("class","title-row"):s.setAttribute("class","row"),s.textContent=e.trim(),t.appendChild(s)}return t}},"createLabel"),kt=s((t,e,r,s,n)=>{e.arrowTypeStart&&vt(t,"start",e.arrowTypeStart,r,s,n),e.arrowTypeEnd&&vt(t,"end",e.arrowTypeEnd,r,s,n)},"addEdgeMarkers"),wt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},vt=s((t,e,r,s,n,i)=>{const a=wt[r];if(!a)return void o.warn(`Unknown arrow type: ${r}`);const c="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${s}#${n}_${i}-${a}${c})`)},"addEdgeMarker"),St={},_t={},Lt=s(async(t,e)=>{const r=f(),s=x(r.flowchart.htmlLabels),n="markdown"===e.labelType?p(t,e.label,{style:e.labelStyle,useHtmlLabels:s,addSvgBackground:!0},r):await mt(e.label,e.labelStyle),a=t.insert("g").attr("class","edgeLabel"),o=a.insert("g").attr("class","label");o.node().appendChild(n);let c,l=n.getBBox();if(s){const t=n.children[0],e=i(n);l=t.getBoundingClientRect(),e.attr("width",l.width),e.attr("height",l.height)}if(o.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),St[e.id]=a,e.width=l.width,e.height=l.height,e.startLabelLeft){const r=await mt(e.startLabelLeft,e.labelStyle),s=t.insert("g").attr("class","edgeTerminals"),n=s.insert("g").attr("class","inner");c=n.node().appendChild(r);const i=r.getBBox();n.attr("transform","translate("+-i.width/2+", "+-i.height/2+")"),_t[e.id]||(_t[e.id]={}),_t[e.id].startLeft=s,Et(c,e.startLabelLeft)}if(e.startLabelRight){const r=await mt(e.startLabelRight,e.labelStyle),s=t.insert("g").attr("class","edgeTerminals"),n=s.insert("g").attr("class","inner");c=s.node().appendChild(r),n.node().appendChild(r);const i=r.getBBox();n.attr("transform","translate("+-i.width/2+", "+-i.height/2+")"),_t[e.id]||(_t[e.id]={}),_t[e.id].startRight=s,Et(c,e.startLabelRight)}if(e.endLabelLeft){const r=await mt(e.endLabelLeft,e.labelStyle),s=t.insert("g").attr("class","edgeTerminals"),n=s.insert("g").attr("class","inner");c=n.node().appendChild(r);const i=r.getBBox();n.attr("transform","translate("+-i.width/2+", "+-i.height/2+")"),s.node().appendChild(r),_t[e.id]||(_t[e.id]={}),_t[e.id].endLeft=s,Et(c,e.endLabelLeft)}if(e.endLabelRight){const r=await mt(e.endLabelRight,e.labelStyle),s=t.insert("g").attr("class","edgeTerminals"),n=s.insert("g").attr("class","inner");c=n.node().appendChild(r);const i=r.getBBox();n.attr("transform","translate("+-i.width/2+", "+-i.height/2+")"),s.node().appendChild(r),_t[e.id]||(_t[e.id]={}),_t[e.id].endRight=s,Et(c,e.endLabelRight)}return n},"insertEdgeLabel");function Et(t,e){f().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}s(Et,"setTerminalWidth");var Dt=s((t,e)=>{o.debug("Moving label abc88 ",t.id,t.label,St[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const s=f(),{subGraphTitleTotalMargin:n}=g(s);if(t.label){const s=St[t.id];let i=t.x,a=t.y;if(r){const s=b.calcLabelPosition(r);o.debug("Moving label "+t.label+" from (",i,",",a,") to (",s.x,",",s.y,") abc88"),e.updatedPath&&(i=s.x,a=s.y)}s.attr("transform",`translate(${i}, ${a+n/2})`)}if(t.startLabelLeft){const e=_t[t.id].startLeft;let s=t.x,n=t.y;if(r){const e=b.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=e.x,n=e.y}e.attr("transform",`translate(${s}, ${n})`)}if(t.startLabelRight){const e=_t[t.id].startRight;let s=t.x,n=t.y;if(r){const e=b.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=e.x,n=e.y}e.attr("transform",`translate(${s}, ${n})`)}if(t.endLabelLeft){const e=_t[t.id].endLeft;let s=t.x,n=t.y;if(r){const e=b.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=e.x,n=e.y}e.attr("transform",`translate(${s}, ${n})`)}if(t.endLabelRight){const e=_t[t.id].endRight;let s=t.x,n=t.y;if(r){const e=b.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=e.x,n=e.y}e.attr("transform",`translate(${s}, ${n})`)}},"positionEdgeLabel"),$t=s((t,e)=>{const r=t.x,s=t.y,n=Math.abs(e.x-r),i=Math.abs(e.y-s),a=t.width/2,o=t.height/2;return n>=a||i>=o},"outsideNode"),Nt=s((t,e,r)=>{o.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const s=t.x,n=t.y,i=Math.abs(s-r.x),a=t.width/2;let c=r.x<e.x?a-i:a+i;const l=t.height/2,d=Math.abs(e.y-r.y),h=Math.abs(e.x-r.x);if(Math.abs(n-e.y)*a>Math.abs(s-e.x)*l){let t=r.y<e.y?e.y-l-n:n-l-e.y;c=h*t/d;const s={x:r.x<e.x?r.x+c:r.x-h+c,y:r.y<e.y?r.y+d-t:r.y-d+t};return 0===c&&(s.x=e.x,s.y=e.y),0===h&&(s.x=e.x),0===d&&(s.y=e.y),o.debug(`abc89 topp/bott calc, Q ${d}, q ${t}, R ${h}, r ${c}`,s),s}{c=r.x<e.x?e.x-a-s:s-a-e.x;let t=d*c/h,n=r.x<e.x?r.x+h-c:r.x-h+c,i=r.y<e.y?r.y+t:r.y-t;return o.debug(`sides calc abc89, Q ${d}, q ${t}, R ${h}, r ${c}`,{_x:n,_y:i}),0===c&&(n=e.x,i=e.y),0===h&&(n=e.x),0===d&&(i=e.y),{x:n,y:i}}},"intersection"),Tt=s((t,e)=>{o.debug("abc88 cutPathAtIntersect",t,e);let r=[],s=t[0],n=!1;return t.forEach(t=>{if($t(e,t)||n)s=t,n||r.push(t);else{const i=Nt(e,s,t);let a=!1;r.forEach(t=>{a=a||t.x===i.x&&t.y===i.y}),r.some(t=>t.x===i.x&&t.y===i.y)||r.push(i),n=!0}}),r},"cutPathAtIntersect"),Ot=s(function(t,e,r,s,n,i,a){let c=r.points;o.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const x=i.node(e.v);var p=i.node(e.w);(null==p?void 0:p.intersect)&&(null==x?void 0:x.intersect)&&(c=c.slice(1,r.points.length-1),c.unshift(x.intersect(c[0])),c.push(p.intersect(c[c.length-1]))),r.toCluster&&(o.debug("to cluster abc88",s[r.toCluster]),c=Tt(r.points,s[r.toCluster].node),l=!0),r.fromCluster&&(o.debug("from cluster abc88",s[r.fromCluster]),c=Tt(c.reverse(),s[r.fromCluster].node).reverse(),l=!0);const g=c.filter(t=>!Number.isNaN(t.y));let b=u;!r.curve||"graph"!==n&&"flowchart"!==n||(b=r.curve);const{x:m,y:k}=d(r),w=h().x(m).y(k).curve(b);let v;switch(r.thickness){case"normal":v="edge-thickness-normal";break;case"thick":case"invisible":v="edge-thickness-thick";break;default:v=""}switch(r.pattern){case"solid":v+=" edge-pattern-solid";break;case"dotted":v+=" edge-pattern-dotted";break;case"dashed":v+=" edge-pattern-dashed"}const S=t.append("path").attr("d",w(g)).attr("id",r.id).attr("class"," "+v+(r.classes?" "+r.classes:"")).attr("style",r.style);let _="";(f().flowchart.arrowMarkerAbsolute||f().state.arrowMarkerAbsolute)&&(_=y(!0)),kt(S,r,_,a,n);let L={};return l&&(L.updatedPath=c),L.originalPath=r.points,L},"insertEdge"),It=s(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e},"expandAndDeduplicateDirections"),Rt=s((t,e,r)=>{const s=It(t),n=e.height+2*r.padding,i=n/2,a=e.width+2*i+r.padding,o=r.padding/2;return s.has("right")&&s.has("left")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:i,y:0},{x:a/2,y:2*o},{x:a-i,y:0},{x:a,y:0},{x:a,y:-n/3},{x:a+2*o,y:-n/2},{x:a,y:-2*n/3},{x:a,y:-n},{x:a-i,y:-n},{x:a/2,y:-n-2*o},{x:i,y:-n},{x:0,y:-n},{x:0,y:-2*n/3},{x:-2*o,y:-n/2},{x:0,y:-n/3}]:s.has("right")&&s.has("left")&&s.has("up")?[{x:i,y:0},{x:a-i,y:0},{x:a,y:-n/2},{x:a-i,y:-n},{x:i,y:-n},{x:0,y:-n/2}]:s.has("right")&&s.has("left")&&s.has("down")?[{x:0,y:0},{x:i,y:-n},{x:a-i,y:-n},{x:a,y:0}]:s.has("right")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:a,y:-i},{x:a,y:-n+i},{x:0,y:-n}]:s.has("left")&&s.has("up")&&s.has("down")?[{x:a,y:0},{x:0,y:-i},{x:0,y:-n+i},{x:a,y:-n}]:s.has("right")&&s.has("left")?[{x:i,y:0},{x:i,y:-o},{x:a-i,y:-o},{x:a-i,y:0},{x:a,y:-n/2},{x:a-i,y:-n},{x:a-i,y:-n+o},{x:i,y:-n+o},{x:i,y:-n},{x:0,y:-n/2}]:s.has("up")&&s.has("down")?[{x:a/2,y:0},{x:0,y:-o},{x:i,y:-o},{x:i,y:-n+o},{x:0,y:-n+o},{x:a/2,y:-n},{x:a,y:-n+o},{x:a-i,y:-n+o},{x:a-i,y:-o},{x:a,y:-o}]:s.has("right")&&s.has("up")?[{x:0,y:0},{x:a,y:-i},{x:0,y:-n}]:s.has("right")&&s.has("down")?[{x:0,y:0},{x:a,y:0},{x:0,y:-n}]:s.has("left")&&s.has("up")?[{x:a,y:0},{x:0,y:-i},{x:a,y:-n}]:s.has("left")&&s.has("down")?[{x:a,y:0},{x:0,y:0},{x:a,y:-n}]:s.has("right")?[{x:i,y:-o},{x:i,y:-o},{x:a-i,y:-o},{x:a-i,y:0},{x:a,y:-n/2},{x:a-i,y:-n},{x:a-i,y:-n+o},{x:i,y:-n+o},{x:i,y:-n+o}]:s.has("left")?[{x:i,y:0},{x:i,y:-o},{x:a-i,y:-o},{x:a-i,y:-n+o},{x:i,y:-n+o},{x:i,y:-n},{x:0,y:-n/2}]:s.has("up")?[{x:i,y:-o},{x:i,y:-n+o},{x:0,y:-n+o},{x:a/2,y:-n},{x:a,y:-n+o},{x:a-i,y:-n+o},{x:a-i,y:-o}]:s.has("down")?[{x:a/2,y:0},{x:0,y:-o},{x:i,y:-o},{x:i,y:-n+o},{x:a-i,y:-n+o},{x:a-i,y:-o},{x:a,y:-o}]:[{x:0,y:0}]},"getArrowPoints");function At(t,e){return t.intersect(e)}s(At,"intersectNode");var Mt=At;function Ct(t,e,r,s){var n=t.x,i=t.y,a=n-s.x,o=i-s.y,c=Math.sqrt(e*e*o*o+r*r*a*a),l=Math.abs(e*r*a/c);s.x<n&&(l=-l);var d=Math.abs(e*r*o/c);return s.y<i&&(d=-d),{x:n+l,y:i+d}}s(Ct,"intersectEllipse");var Bt=Ct;function Pt(t,e,r){return Bt(t,e,e,r)}s(Pt,"intersectCircle");var Yt=Pt;function Xt(t,e,r,s){var n,i,a,o,c,l,d,h,u,f,y,x,p;if(n=e.y-t.y,a=t.x-e.x,c=e.x*t.y-t.x*e.y,u=n*r.x+a*r.y+c,f=n*s.x+a*s.y+c,!(0!==u&&0!==f&&Wt(u,f)||(i=s.y-r.y,o=r.x-s.x,l=s.x*r.y-r.x*s.y,d=i*t.x+o*t.y+l,h=i*e.x+o*e.y+l,0!==d&&0!==h&&Wt(d,h)||0===(y=n*o-i*a))))return x=Math.abs(y/2),{x:(p=a*l-o*c)<0?(p-x)/y:(p+x)/y,y:(p=i*c-n*l)<0?(p-x)/y:(p+x)/y}}function Wt(t,e){return t*e>0}s(Xt,"intersectLine"),s(Wt,"sameSign");var zt=Xt,Ft=Ut;function Ut(t,e,r){var s=t.x,n=t.y,i=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){a=Math.min(a,t.x),o=Math.min(o,t.y)}):(a=Math.min(a,e.x),o=Math.min(o,e.y));for(var c=s-t.width/2-a,l=n-t.height/2-o,d=0;d<e.length;d++){var h=e[d],u=e[d<e.length-1?d+1:0],f=zt(t,r,{x:c+h.x,y:l+h.y},{x:c+u.x,y:l+u.y});f&&i.push(f)}return i.length?(i.length>1&&i.sort(function(t,e){var s=t.x-r.x,n=t.y-r.y,i=Math.sqrt(s*s+n*n),a=e.x-r.x,o=e.y-r.y,c=Math.sqrt(a*a+o*o);return i<c?-1:i===c?0:1}),i[0]):t}s(Ut,"intersectPolygon");var Ht={node:Mt,circle:Yt,ellipse:Bt,polygon:Ft,rect:s((t,e)=>{var r,s,n=t.x,i=t.y,a=e.x-n,o=e.y-i,c=t.width/2,l=t.height/2;return Math.abs(o)*c>Math.abs(a)*l?(o<0&&(l=-l),r=0===o?0:l*a/o,s=l):(a<0&&(c=-c),r=c,s=0===a?0:c*o/a),{x:n+r,y:i+s}},"intersectRect")},Kt=s(async(t,e,r,n)=>{const a=f();let o;const c=e.useHtmlLabels||x(a.flowchart.htmlLabels);o=r||"node default";const l=t.insert("g").attr("class",o).attr("id",e.domId||e.id),d=l.insert("g").attr("class","label").attr("style",e.labelStyle);let h;h=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0];const u=d.node();let y;y="markdown"===e.labelType?p(d,v(w(h),a),{useHtmlLabels:c,width:e.width||a.flowchart.wrappingWidth,classes:"markdown-node-label"},a):u.appendChild(await mt(v(w(h),a),e.labelStyle,!1,n));let g=y.getBBox();const b=e.padding/2;if(x(a.flowchart.htmlLabels)){const t=y.children[0],e=i(y),r=t.getElementsByTagName("img");if(r){const t=""===h.replace(/<img[^>]*>/g,"").trim();await Promise.all([...r].map(e=>new Promise(r=>{function n(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=a.fontSize?a.fontSize:window.getComputedStyle(document.body).fontSize,r=5,s=parseInt(t,10)*r+"px";e.style.minWidth=s,e.style.maxWidth=s}else e.style.width="100%";r(e)}s(n,"setupImage"),setTimeout(()=>{e.complete&&n()}),e.addEventListener("error",n),e.addEventListener("load",n)})))}g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}return c?d.attr("transform","translate("+-g.width/2+", "+-g.height/2+")"):d.attr("transform","translate(0, "+-g.height/2+")"),e.centerLabel&&d.attr("transform","translate("+-g.width/2+", "+-g.height/2+")"),d.insert("rect",":first-child"),{shapeSvg:l,bbox:g,halfPadding:b,label:d}},"labelHelper"),jt=s((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function Zt(t,e,r,s){return t.insert("polygon",":first-child").attr("points",s.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}s(Zt,"insertPolygonShape");var qt=s(async(t,e)=>{e.useHtmlLabels||f().flowchart.htmlLabels||(e.centerLabel=!0);const{shapeSvg:r,bbox:s,halfPadding:n}=await Kt(t,e,"node "+e.classes,!0);o.info("Classes = ",e.classes);const i=r.insert("rect",":first-child");return i.attr("rx",e.rx).attr("ry",e.ry).attr("x",-s.width/2-n).attr("y",-s.height/2-n).attr("width",s.width+e.padding).attr("height",s.height+e.padding),jt(e,i),e.intersect=function(t){return Ht.rect(e,t)},r},"note"),Gt=s(t=>t?" "+t:"","formatClass"),Jt=s((t,e)=>`${e||"node default"}${Gt(t.classes)} ${Gt(t.class)}`,"getClassesFromNode"),Qt=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,Jt(e,void 0),!0),n=s.width+e.padding+(s.height+e.padding),i=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}];o.info("Question main (Circle)");const a=Zt(r,n,n,i);return a.attr("style",e.style),jt(e,a),e.intersect=function(t){return o.warn("Intersect called"),Ht.polygon(e,i,t)},r},"question"),Vt=s((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),s=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return r.insert("polygon",":first-child").attr("points",s.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return Ht.circle(e,14,t)},r},"choice"),te=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,Jt(e,void 0),!0),n=s.height+e.padding,i=n/4,a=s.width+2*i+e.padding,o=[{x:i,y:0},{x:a-i,y:0},{x:a,y:-n/2},{x:a-i,y:-n},{x:i,y:-n},{x:0,y:-n/2}],c=Zt(r,a,n,o);return c.attr("style",e.style),jt(e,c),e.intersect=function(t){return Ht.polygon(e,o,t)},r},"hexagon"),ee=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,void 0,!0),n=s.height+2*e.padding,i=n/2,a=s.width+2*i+e.padding,o=Rt(e.directions,s,e),c=Zt(r,a,n,o);return c.attr("style",e.style),jt(e,c),e.intersect=function(t){return Ht.polygon(e,o,t)},r},"block_arrow"),re=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,Jt(e,void 0),!0),n=s.width+e.padding,i=s.height+e.padding,a=[{x:-i/2,y:0},{x:n,y:0},{x:n,y:-i},{x:-i/2,y:-i},{x:0,y:-i/2}];return Zt(r,n,i,a).attr("style",e.style),e.width=n+i,e.height=i,e.intersect=function(t){return Ht.polygon(e,a,t)},r},"rect_left_inv_arrow"),se=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,Jt(e),!0),n=s.width+e.padding,i=s.height+e.padding,a=[{x:-2*i/6,y:0},{x:n-i/6,y:0},{x:n+2*i/6,y:-i},{x:i/6,y:-i}],o=Zt(r,n,i,a);return o.attr("style",e.style),jt(e,o),e.intersect=function(t){return Ht.polygon(e,a,t)},r},"lean_right"),ne=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,Jt(e,void 0),!0),n=s.width+e.padding,i=s.height+e.padding,a=[{x:2*i/6,y:0},{x:n+i/6,y:0},{x:n-2*i/6,y:-i},{x:-i/6,y:-i}],o=Zt(r,n,i,a);return o.attr("style",e.style),jt(e,o),e.intersect=function(t){return Ht.polygon(e,a,t)},r},"lean_left"),ie=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,Jt(e,void 0),!0),n=s.width+e.padding,i=s.height+e.padding,a=[{x:-2*i/6,y:0},{x:n+2*i/6,y:0},{x:n-i/6,y:-i},{x:i/6,y:-i}],o=Zt(r,n,i,a);return o.attr("style",e.style),jt(e,o),e.intersect=function(t){return Ht.polygon(e,a,t)},r},"trapezoid"),ae=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,Jt(e,void 0),!0),n=s.width+e.padding,i=s.height+e.padding,a=[{x:i/6,y:0},{x:n-i/6,y:0},{x:n+2*i/6,y:-i},{x:-2*i/6,y:-i}],o=Zt(r,n,i,a);return o.attr("style",e.style),jt(e,o),e.intersect=function(t){return Ht.polygon(e,a,t)},r},"inv_trapezoid"),oe=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,Jt(e,void 0),!0),n=s.width+e.padding,i=s.height+e.padding,a=[{x:0,y:0},{x:n+i/2,y:0},{x:n,y:-i/2},{x:n+i/2,y:-i},{x:0,y:-i}],o=Zt(r,n,i,a);return o.attr("style",e.style),jt(e,o),e.intersect=function(t){return Ht.polygon(e,a,t)},r},"rect_right_inv_arrow"),ce=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,Jt(e,void 0),!0),n=s.width+e.padding,i=n/2,a=i/(2.5+n/50),o=s.height+a+e.padding,c="M 0,"+a+" a "+i+","+a+" 0,0,0 "+n+" 0 a "+i+","+a+" 0,0,0 "+-n+" 0 l 0,"+o+" a "+i+","+a+" 0,0,0 "+n+" 0 l 0,"+-o,l=r.attr("label-offset-y",a).insert("path",":first-child").attr("style",e.style).attr("d",c).attr("transform","translate("+-n/2+","+-(o/2+a)+")");return jt(e,l),e.intersect=function(t){const r=Ht.rect(e,t),s=r.x-e.x;if(0!=i&&(Math.abs(s)<e.width/2||Math.abs(s)==e.width/2&&Math.abs(r.y-e.y)>e.height/2-a)){let n=a*a*(1-s*s/(i*i));0!=n&&(n=Math.sqrt(n)),n=a-n,t.y-e.y>0&&(n=-n),r.y+=n}return r},r},"cylinder"),le=s(async(t,e)=>{const{shapeSvg:r,bbox:s,halfPadding:n}=await Kt(t,e,"node "+e.classes+" "+e.class,!0),i=r.insert("rect",":first-child"),a=e.positioned?e.width:s.width+e.padding,c=e.positioned?e.height:s.height+e.padding,l=e.positioned?-a/2:-s.width/2-n,d=e.positioned?-c/2:-s.height/2-n;if(i.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",d).attr("width",a).attr("height",c),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(ue(i,e.props.borders,a,c),t.delete("borders")),t.forEach(t=>{o.warn(`Unknown node property ${t}`)})}return jt(e,i),e.intersect=function(t){return Ht.rect(e,t)},r},"rect"),de=s(async(t,e)=>{const{shapeSvg:r,bbox:s,halfPadding:n}=await Kt(t,e,"node "+e.classes,!0),i=r.insert("rect",":first-child"),a=e.positioned?e.width:s.width+e.padding,c=e.positioned?e.height:s.height+e.padding,l=e.positioned?-a/2:-s.width/2-n,d=e.positioned?-c/2:-s.height/2-n;if(i.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",d).attr("width",a).attr("height",c),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(ue(i,e.props.borders,a,c),t.delete("borders")),t.forEach(t=>{o.warn(`Unknown node property ${t}`)})}return jt(e,i),e.intersect=function(t){return Ht.rect(e,t)},r},"composite"),he=s(async(t,e)=>{const{shapeSvg:r}=await Kt(t,e,"label",!0);o.trace("Classes = ",e.class);const s=r.insert("rect",":first-child");if(s.attr("width",0).attr("height",0),r.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(ue(s,e.props.borders,0,0),t.delete("borders")),t.forEach(t=>{o.warn(`Unknown node property ${t}`)})}return jt(e,s),e.intersect=function(t){return Ht.rect(e,t)},r},"labelRect");function ue(t,e,r,n){const i=[],a=s(t=>{i.push(t,0)},"addBorder"),c=s(t=>{i.push(0,t)},"skipBorder");e.includes("t")?(o.debug("add top border"),a(r)):c(r),e.includes("r")?(o.debug("add right border"),a(n)):c(n),e.includes("b")?(o.debug("add bottom border"),a(r)):c(r),e.includes("l")?(o.debug("add left border"),a(n)):c(n),t.attr("stroke-dasharray",i.join(" "))}s(ue,"applyNodePropertyBorders");var fe=s(async(t,e)=>{let r;r=e.classes?"node "+e.classes:"node default";const s=t.insert("g").attr("class",r).attr("id",e.domId||e.id),n=s.insert("rect",":first-child"),a=s.insert("line"),c=s.insert("g").attr("class","label"),l=e.labelText.flat?e.labelText.flat():e.labelText;let d="";d="object"==typeof l?l[0]:l,o.info("Label text abc79",d,l,"object"==typeof l);const h=c.node().appendChild(await mt(d,e.labelStyle,!0,!0));let u={width:0,height:0};if(x(f().flowchart.htmlLabels)){const t=h.children[0],e=i(h);u=t.getBoundingClientRect(),e.attr("width",u.width),e.attr("height",u.height)}o.info("Text 2",l);const y=l.slice(1,l.length);let p=h.getBBox();const g=c.node().appendChild(await mt(y.join?y.join("<br/>"):y,e.labelStyle,!0,!0));if(x(f().flowchart.htmlLabels)){const t=g.children[0],e=i(g);u=t.getBoundingClientRect(),e.attr("width",u.width),e.attr("height",u.height)}const b=e.padding/2;return i(g).attr("transform","translate( "+(u.width>p.width?0:(p.width-u.width)/2)+", "+(p.height+b+5)+")"),i(h).attr("transform","translate( "+(u.width<p.width?0:-(p.width-u.width)/2)+", 0)"),u=c.node().getBBox(),c.attr("transform","translate("+-u.width/2+", "+(-u.height/2-b+3)+")"),n.attr("class","outer title-state").attr("x",-u.width/2-b).attr("y",-u.height/2-b).attr("width",u.width+e.padding).attr("height",u.height+e.padding),a.attr("class","divider").attr("x1",-u.width/2-b).attr("x2",u.width/2+b).attr("y1",-u.height/2-b+p.height+b).attr("y2",-u.height/2-b+p.height+b),jt(e,n),e.intersect=function(t){return Ht.rect(e,t)},s},"rectWithTitle"),ye=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,Jt(e,void 0),!0),n=s.height+e.padding,i=s.width+n/4+e.padding,a=r.insert("rect",":first-child").attr("style",e.style).attr("rx",n/2).attr("ry",n/2).attr("x",-i/2).attr("y",-n/2).attr("width",i).attr("height",n);return jt(e,a),e.intersect=function(t){return Ht.rect(e,t)},r},"stadium"),xe=s(async(t,e)=>{const{shapeSvg:r,bbox:s,halfPadding:n}=await Kt(t,e,Jt(e,void 0),!0),i=r.insert("circle",":first-child");return i.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",s.width/2+n).attr("width",s.width+e.padding).attr("height",s.height+e.padding),o.info("Circle main"),jt(e,i),e.intersect=function(t){return o.info("Circle intersect",e,s.width/2+n,t),Ht.circle(e,s.width/2+n,t)},r},"circle"),pe=s(async(t,e)=>{const{shapeSvg:r,bbox:s,halfPadding:n}=await Kt(t,e,Jt(e,void 0),!0),i=r.insert("g",":first-child"),a=i.insert("circle"),c=i.insert("circle");return i.attr("class",e.class),a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",s.width/2+n+5).attr("width",s.width+e.padding+10).attr("height",s.height+e.padding+10),c.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",s.width/2+n).attr("width",s.width+e.padding).attr("height",s.height+e.padding),o.info("DoubleCircle main"),jt(e,a),e.intersect=function(t){return o.info("DoubleCircle intersect",e,s.width/2+n+5,t),Ht.circle(e,s.width/2+n+5,t)},r},"doublecircle"),ge=s(async(t,e)=>{const{shapeSvg:r,bbox:s}=await Kt(t,e,Jt(e,void 0),!0),n=s.width+e.padding,i=s.height+e.padding,a=[{x:0,y:0},{x:n,y:0},{x:n,y:-i},{x:0,y:-i},{x:0,y:0},{x:-8,y:0},{x:n+8,y:0},{x:n+8,y:-i},{x:-8,y:-i},{x:-8,y:0}],o=Zt(r,n,i,a);return o.attr("style",e.style),jt(e,o),e.intersect=function(t){return Ht.polygon(e,a,t)},r},"subroutine"),be=s((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),s=r.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),jt(e,s),e.intersect=function(t){return Ht.circle(e,7,t)},r},"start"),me=s((t,e,r)=>{const s=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let n=70,i=10;"LR"===r&&(n=10,i=70);const a=s.append("rect").attr("x",-1*n/2).attr("y",-1*i/2).attr("width",n).attr("height",i).attr("class","fork-join");return jt(e,a),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return Ht.rect(e,t)},s},"forkJoin"),ke={rhombus:Qt,composite:de,question:Qt,rect:le,labelRect:he,rectWithTitle:fe,choice:Vt,circle:xe,doublecircle:pe,stadium:ye,hexagon:te,block_arrow:ee,rect_left_inv_arrow:re,lean_right:se,lean_left:ne,trapezoid:ie,inv_trapezoid:ae,rect_right_inv_arrow:oe,cylinder:ce,start:be,end:s((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),s=r.insert("circle",":first-child"),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),jt(e,n),e.intersect=function(t){return Ht.circle(e,7,t)},r},"end"),note:qt,subroutine:ge,fork:me,join:me,class_box:s(async(t,e)=>{var r;const s=e.padding/2;let n;n=e.classes?"node "+e.classes:"node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),o=a.insert("rect",":first-child"),c=a.insert("line"),l=a.insert("line");let d=0,h=4;const u=a.insert("g").attr("class","label");let y=0;const p=null==(r=e.classData.annotations)?void 0:r[0],g=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",b=u.node().appendChild(await mt(g,e.labelStyle,!0,!0));let m=b.getBBox();if(x(f().flowchart.htmlLabels)){const t=b.children[0],e=i(b);m=t.getBoundingClientRect(),e.attr("width",m.width),e.attr("height",m.height)}e.classData.annotations[0]&&(h+=m.height+4,d+=m.width);let k=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&(f().flowchart.htmlLabels?k+="&lt;"+e.classData.type+"&gt;":k+="<"+e.classData.type+">");const w=u.node().appendChild(await mt(k,e.labelStyle,!0,!0));i(w).attr("class","classTitle");let v=w.getBBox();if(x(f().flowchart.htmlLabels)){const t=w.children[0],e=i(w);v=t.getBoundingClientRect(),e.attr("width",v.width),e.attr("height",v.height)}h+=v.height+4,v.width>d&&(d=v.width);const S=[];e.classData.members.forEach(async t=>{const r=t.getDisplayDetails();let s=r.displayText;f().flowchart.htmlLabels&&(s=s.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const n=u.node().appendChild(await mt(s,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0));let a=n.getBBox();if(x(f().flowchart.htmlLabels)){const t=n.children[0],e=i(n);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}a.width>d&&(d=a.width),h+=a.height+4,S.push(n)}),h+=8;const _=[];if(e.classData.methods.forEach(async t=>{const r=t.getDisplayDetails();let s=r.displayText;f().flowchart.htmlLabels&&(s=s.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const n=u.node().appendChild(await mt(s,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0));let a=n.getBBox();if(x(f().flowchart.htmlLabels)){const t=n.children[0],e=i(n);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}a.width>d&&(d=a.width),h+=a.height+4,_.push(n)}),h+=8,p){let t=(d-m.width)/2;i(b).attr("transform","translate( "+(-1*d/2+t)+", "+-1*h/2+")"),y=m.height+4}let L=(d-v.width)/2;return i(w).attr("transform","translate( "+(-1*d/2+L)+", "+(-1*h/2+y)+")"),y+=v.height+4,c.attr("class","divider").attr("x1",-d/2-s).attr("x2",d/2+s).attr("y1",-h/2-s+8+y).attr("y2",-h/2-s+8+y),y+=8,S.forEach(t=>{i(t).attr("transform","translate( "+-d/2+", "+(-1*h/2+y+4)+")");const e=null==t?void 0:t.getBBox();y+=((null==e?void 0:e.height)??0)+4}),y+=8,l.attr("class","divider").attr("x1",-d/2-s).attr("x2",d/2+s).attr("y1",-h/2-s+8+y).attr("y2",-h/2-s+8+y),y+=8,_.forEach(t=>{i(t).attr("transform","translate( "+-d/2+", "+(-1*h/2+y)+")");const e=null==t?void 0:t.getBBox();y+=((null==e?void 0:e.height)??0)+4}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-d/2-s).attr("y",-h/2-s).attr("width",d+e.padding).attr("height",h+e.padding),jt(e,o),e.intersect=function(t){return Ht.rect(e,t)},a},"class_box")},we={},ve=s(async(t,e,r)=>{let s,n;if(e.link){let i;"sandbox"===f().securityLevel?i="_top":e.linkTarget&&(i=e.linkTarget||"_blank"),s=t.insert("svg:a").attr("xlink:href",e.link).attr("target",i),n=await ke[e.shape](s,e,r)}else n=await ke[e.shape](t,e,r),s=n;return e.tooltip&&n.attr("title",e.tooltip),e.class&&n.attr("class","node default "+e.class),we[e.id]=s,e.haveCallback&&we[e.id].attr("class",we[e.id].attr("class")+" clickable"),s},"insertNode"),Se=s(t=>{const e=we[t.id];o.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");function _e(t,e,r=!1){var s,i,a;const o=t;let c="default";((null==(s=null==o?void 0:o.classes)?void 0:s.length)||0)>0&&(c=((null==o?void 0:o.classes)??[]).join(" ")),c+=" flowchart-label";let l,d=0,h="";switch(o.type){case"round":d=5,h="rect";break;case"composite":d=0,h="composite",l=0;break;case"square":case"group":default:h="rect";break;case"diamond":h="question";break;case"hexagon":h="hexagon";break;case"block_arrow":h="block_arrow";break;case"odd":case"rect_left_inv_arrow":h="rect_left_inv_arrow";break;case"lean_right":h="lean_right";break;case"lean_left":h="lean_left";break;case"trapezoid":h="trapezoid";break;case"inv_trapezoid":h="inv_trapezoid";break;case"circle":h="circle";break;case"ellipse":h="ellipse";break;case"stadium":h="stadium";break;case"subroutine":h="subroutine";break;case"cylinder":h="cylinder";break;case"doublecircle":h="doublecircle"}const u=S((null==o?void 0:o.styles)??[]),f=o.label,y=o.size??{width:0,height:0,x:0,y:0};return{labelStyle:u.labelStyle,shape:h,labelText:f,rx:d,ry:d,class:c,style:u.style,id:o.id,directions:o.directions,width:y.width,height:y.height,x:y.x,y:y.y,positioned:r,intersect:void 0,type:o.type,padding:l??(null==(a=null==(i=n())?void 0:i.block)?void 0:a.padding)??0}}async function Le(t,e,r){const s=_e(e,0,!1);if("group"===s.type)return;const i=n(),a=await ve(t,s,{config:i}),o=a.node().getBBox(),c=r.getBlock(s.id);c.size={width:o.width,height:o.height,x:0,y:0,node:a},r.setBlock(c),a.remove()}async function Ee(t,e,r){const s=_e(e,0,!0);if("space"!==r.getBlock(s.id).type){const r=n();await ve(t,s,{config:r}),e.intersect=null==s?void 0:s.intersect,Se(s)}}async function De(t,e,r,s){for(const n of e)await s(t,n,r),n.children&&await De(t,n.children,r,s)}async function $e(t,e,r){await De(t,e,r,Le)}async function Ne(t,e,r){await De(t,e,r,Ee)}async function Te(t,e,r,s,n){const i=new L({multigraph:!0,compound:!0});i.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const a of r)a.size&&i.setNode(a.id,{width:a.size.width,height:a.size.height,intersect:a.intersect});for(const a of e)if(a.start&&a.end){const e=s.getBlock(a.start),r=s.getBlock(a.end);if((null==e?void 0:e.size)&&(null==r?void 0:r.size)){const s=e.size,o=r.size,c=[{x:s.x,y:s.y},{x:s.x+(o.x-s.x)/2,y:s.y+(o.y-s.y)/2},{x:o.x,y:o.y}];Ot(t,{v:a.start,w:a.end,name:a.id},{...a,arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:c,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",i,n),a.label&&(await Lt(t,{...a,label:a.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:c,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),Dt({...a,x:c[1].x,y:c[1].y},{originalPath:c}))}}}s(_e,"getNodeFromBlock"),s(Le,"calculateBlockSize"),s(Ee,"insertBlockPositioned"),s(De,"performOperations"),s($e,"calculateBlockSizes"),s(Ne,"insertBlocks"),s(Te,"insertEdges");var Oe=s(function(t,e){return e.db.getClasses()},"getClasses"),Ie={parser:$,db:nt,renderer:{draw:s(async function(t,e,r,s){const{securityLevel:c,block:l}=n(),d=s.db;let h;"sandbox"===c&&(h=i("#i"+e));const u=i("sandbox"===c?h.nodes()[0].contentDocument.body:"body"),f="sandbox"===c?u.select(`[id="${e}"]`):i(`[id="${e}"]`);lt(f,["point","circle","cross"],s.type,e);const y=d.getBlocks(),x=d.getBlocksFlat(),p=d.getEdges(),g=f.insert("g").attr("class","block");await $e(g,y,d);const b=pt(d);if(await Ne(g,y,d),await Te(g,p,x,d,e),b){const t=b,e=Math.max(1,Math.round(t.width/t.height*.125)),r=t.height+e+10,s=t.width+10,{useMaxWidth:n}=l;a(f,r,s,!!n),o.debug("Here Bounds",b,t),f.attr("viewBox",`${t.x-5} ${t.y-5} ${t.width+10} ${t.height+10}`)}},"draw"),getClasses:Oe},styles:at};export{Ie as diagram};