@tea-agent/loop-agent 0.37.0 → 0.37.1-beta.0

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 (192) hide show
  1. package/AGENTS.md +2 -6
  2. package/CHANGELOG.md +71 -144
  3. package/README.md +1 -1
  4. package/bin/loop-agent.js +1 -37
  5. package/dist/application/task-lifecycle/advance.js +0 -1
  6. package/dist/application/task-lifecycle/observe.js +0 -15
  7. package/dist/application/task-lifecycle/plan-transitions.js +0 -15
  8. package/dist/cli/command-definitions.js +0 -7
  9. package/dist/cli/program.js +3 -8
  10. package/dist/commands/init-upgrade.js +19 -351
  11. package/dist/commands/init.js +67 -14
  12. package/dist/commands/run-dag-progress.js +0 -14
  13. package/dist/commands/task-advance.js +3 -33
  14. package/dist/executors/dag-pi-executor.js +30 -47
  15. package/dist/executors/pi-sdk-executor.js +0 -34
  16. package/dist/executors/shell-executor.js +95 -6
  17. package/dist/shared/operator/capabilities.js +13 -200
  18. package/dist/shared/package-metadata.js +0 -42
  19. package/dist/task/contract/project.js +0 -4
  20. package/dist/task/source-prepare/completeness.js +0 -53
  21. package/dist/task/source-prepare/parse-intent.js +12 -82
  22. package/dist/task/source-prepare/prepare.js +5 -102
  23. package/dist/task/source-prepare/semantic-intake.js +23 -144
  24. package/dist/worker/console/chat/artifact-card.js +1 -8
  25. package/dist/worker/console/chat/chat-event-store.js +0 -152
  26. package/dist/worker/console/chat/human-gate-card.js +1 -9
  27. package/dist/worker/console/chat/operation-card.js +2 -71
  28. package/dist/worker/console/chat/pi-runtime.js +62 -111
  29. package/dist/worker/console/chat/routes.js +10 -43
  30. package/dist/worker/console/chat/session-store.js +1 -9
  31. package/dist/worker/console/chat/shortcuts.js +7 -9
  32. package/dist/worker/console/chat/turn-process.js +23 -204
  33. package/dist/worker/console/chat/workspace-landing.js +1 -2
  34. package/dist/worker/console/operation-runner.js +6 -155
  35. package/dist/worker/console/operator-actions.js +14 -391
  36. package/dist/worker/console/operator-user-error.js +0 -4
  37. package/dist/worker/console/recovery-cta.js +3 -50
  38. package/dist/worker/console/static/assets/index-HX1pbOyl.css +1 -0
  39. package/dist/worker/console/static/assets/index-M0BLEBfh.js +56 -0
  40. package/dist/worker/console/static/index.html +2 -2
  41. package/dist/worker/console/static-src/app/console-types.js +9 -13
  42. package/dist/worker/console/static-src/app/useOperatorActions.js +2 -4
  43. package/dist/worker/console/static-src/app/useRecoveryActions.js +56 -65
  44. package/dist/worker/console/static-src/app/useRecoveryConsole.js +1 -73
  45. package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +30 -114
  46. package/dist/worker/console/static-src/operator-chat/refs.js +0 -3
  47. package/dist/worker/console/static-src/operator-chat/spatial-overlay.js +1 -2
  48. package/dist/worker/console/static-src/operator-chat/useChatSessions.js +13 -67
  49. package/dist/worker/console/static-src/operator-chat/useChatThread.js +6 -12
  50. package/dist/worker/console/static-src/operator-chat/useComposer.js +8 -45
  51. package/dist/worker/console/static-src/operator-chat/workspace-layout-mode.js +3 -7
  52. package/dist/worker/loop-agent/loop-agent-client.js +3 -17
  53. package/dist/worker/observability/read-model.js +0 -20
  54. package/dist/worker/observe/spec-evidence.js +8 -3
  55. package/dist/worker/observe/static/operator-chrome.d.ts +0 -1
  56. package/dist/worker/observe/static/operator-chrome.js +3 -10
  57. package/dist/worker/observe/static/views/dag-inspector.js +71 -6
  58. package/dist/worker/observe/static/views/dag.js +0 -12
  59. package/dist/worker/preflight.js +1 -2
  60. package/dist/workflows/dag/backend-test-case-coverage-analysis.js +707 -37
  61. package/dist/workflows/dag/backend-test-case-manifest.js +4 -0
  62. package/dist/workflows/dag/backend-test-markdown-workflow.js +109 -7
  63. package/dist/workflows/dag/backend-test-module-stem.js +5 -0
  64. package/dist/workflows/dag/backend-test-pytest-collection.js +345 -24
  65. package/dist/workflows/dag/backend-test-scenario-param.js +890 -164
  66. package/dist/workflows/dag/backend-test-writer-completeness.js +47 -16
  67. package/dist/workflows/dag/dynamic-runtime/map.js +24 -8
  68. package/dist/workflows/dag/dynamic-runtime/shared.js +1 -9
  69. package/dist/workflows/dag/frontend-implementation-contract.js +39 -233
  70. package/dist/workflows/dag/frontend-prewrite-gate.js +61 -364
  71. package/dist/workflows/dag/frontend-repair.js +18 -219
  72. package/dist/workflows/dag/frontend-verification-trace.js +32 -47
  73. package/dist/workflows/dag/init-hybrid.js +82 -165
  74. package/dist/workflows/dag/node-execution.js +0 -89
  75. package/dist/workflows/dag/recovery-recommendation.js +0 -58
  76. package/dist/workflows/dag/runner.js +15 -333
  77. package/dist/workflows/dag/scheduler.js +3 -257
  78. package/dist/workflows/dag/types.js +9 -130
  79. package/docs/README.md +3 -3
  80. package/docs/architecture/evolution.md +67 -102
  81. package/docs/templates/backend-test-dag.json +50 -32
  82. package/docs/templates/init-managed-agents.md +2 -5
  83. package/harness.json +2 -2
  84. package/package.json +3 -9
  85. package/skills/loop-agent/SKILL.md +0 -1
  86. package/skills/loop-agent/references/command-reference.md +0 -4
  87. package/dist/build-stamp.json +0 -6
  88. package/dist/commands/dag-request-interrupt.js +0 -20
  89. package/dist/worker/console/chat/assistant-content.js +0 -121
  90. package/dist/worker/console/chat/semantic-activity.js +0 -477
  91. package/dist/worker/console/operation-run-facts.js +0 -190
  92. package/dist/worker/console/operation-wait.js +0 -355
  93. package/dist/worker/console/recovery-error-copy.js +0 -198
  94. package/dist/worker/console/static/assets/abnfDiagram-N423BO3Z-DSvF6RXQ.js +0 -1
  95. package/dist/worker/console/static/assets/arc-DuI4ogtJ.js +0 -1
  96. package/dist/worker/console/static/assets/architectureDiagram-T3A2C74G-DdBbgD4y.js +0 -36
  97. package/dist/worker/console/static/assets/blockDiagram-VBNYF7ZC-xQC2HELm.js +0 -132
  98. package/dist/worker/console/static/assets/c4Diagram-5PPSVZJV-DPMSgwIZ.js +0 -10
  99. package/dist/worker/console/static/assets/channel-DLVz9TYW.js +0 -1
  100. package/dist/worker/console/static/assets/chunk-2GRJ4B5K-WTEKTxin.js +0 -1
  101. package/dist/worker/console/static/assets/chunk-2Q5K7J3B-B6vZ0Pv_.js +0 -1
  102. package/dist/worker/console/static/assets/chunk-5RXB4S5H-BrerNAix.js +0 -231
  103. package/dist/worker/console/static/assets/chunk-5VM5RSS4-D_ch2aaI.js +0 -15
  104. package/dist/worker/console/static/assets/chunk-6Q2QTUOP-VvfacNrq.js +0 -88
  105. package/dist/worker/console/static/assets/chunk-GF5L2VYU-B-uGFIg2.js +0 -206
  106. package/dist/worker/console/static/assets/chunk-JWPE2WC7-BlysCtod.js +0 -1
  107. package/dist/worker/console/static/assets/chunk-KBJHAD2P-BjAUAfcT.js +0 -1
  108. package/dist/worker/console/static/assets/chunk-RYQCIY6F-BeZnBmb-.js +0 -1
  109. package/dist/worker/console/static/assets/chunk-XXDRQBXY-Bbfe3UJG.js +0 -1
  110. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-BeAuGcO9.js +0 -1
  111. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-BeAuGcO9.js +0 -1
  112. package/dist/worker/console/static/assets/cose-bilkent-JH36ORCC-BKJQnYVM.js +0 -1
  113. package/dist/worker/console/static/assets/cynefin-VYW2F7L2-B1wtI3hU.js +0 -166
  114. package/dist/worker/console/static/assets/cynefinDiagram-MW4NZA55-DCF6DBSu.js +0 -62
  115. package/dist/worker/console/static/assets/cytoscape.esm-yzknjiTM.js +0 -321
  116. package/dist/worker/console/static/assets/dagre-VZM6K2ZE-BJyNGRlP.js +0 -4
  117. package/dist/worker/console/static/assets/defaultLocale-DX6XiGOO.js +0 -1
  118. package/dist/worker/console/static/assets/diagram-7IWD3JNH-B7j1-VsZ.js +0 -30
  119. package/dist/worker/console/static/assets/diagram-B4RE2ZJO-BREJ140a.js +0 -3
  120. package/dist/worker/console/static/assets/diagram-LBJQPF4R-CDPHmHGH.js +0 -24
  121. package/dist/worker/console/static/assets/diagram-Q27KOJAE-BtZLrez1.js +0 -24
  122. package/dist/worker/console/static/assets/diagram-UB23O5K3-mzybu8oU.js +0 -41
  123. package/dist/worker/console/static/assets/ebnfDiagram-BXEA7PRR-Dk3I2uO6.js +0 -1
  124. package/dist/worker/console/static/assets/erDiagram-JOGREHBK-BT97u_tQ.js +0 -85
  125. package/dist/worker/console/static/assets/flowDiagram-UKHOOZJN-CMOtYzui.js +0 -156
  126. package/dist/worker/console/static/assets/ganttDiagram-PKOTCBZU-DiNydkuY.js +0 -292
  127. package/dist/worker/console/static/assets/gitGraphDiagram-DS77QQ5N-Cwt6fLkl.js +0 -106
  128. package/dist/worker/console/static/assets/graph-DOmOIIwC.js +0 -1
  129. package/dist/worker/console/static/assets/index-DQxiso1w.js +0 -325
  130. package/dist/worker/console/static/assets/index-_j0Hzo69.css +0 -1
  131. package/dist/worker/console/static/assets/infoDiagram-6WML65LV-AsGIGKKB.js +0 -2
  132. package/dist/worker/console/static/assets/init-Gi6I4Gst.js +0 -1
  133. package/dist/worker/console/static/assets/ishikawaDiagram-WSZJBQD7-BL8ITZh3.js +0 -70
  134. package/dist/worker/console/static/assets/journeyDiagram-NVQOT4AX-VPKAUX8M.js +0 -139
  135. package/dist/worker/console/static/assets/kanban-definition-27J2QSJJ-BL56hfGp.js +0 -89
  136. package/dist/worker/console/static/assets/layout-D-LzfAck.js +0 -1
  137. package/dist/worker/console/static/assets/linear-BmSG3nIZ.js +0 -1
  138. package/dist/worker/console/static/assets/map-DxJ2ADlA.js +0 -1
  139. package/dist/worker/console/static/assets/mermaid.core-DWGK9kwP.js +0 -308
  140. package/dist/worker/console/static/assets/mindmap-definition-FAOFIHXS--vvKLjo0.js +0 -96
  141. package/dist/worker/console/static/assets/ordinal-Cboi1Yqb.js +0 -1
  142. package/dist/worker/console/static/assets/pegDiagram-VL7TDLO6-B41mxb2-.js +0 -1
  143. package/dist/worker/console/static/assets/pieDiagram-7S7Q4E2Y-DTlu77sw.js +0 -39
  144. package/dist/worker/console/static/assets/quadrantDiagram-CIZ2JOQS-Bk5A7alv.js +0 -7
  145. package/dist/worker/console/static/assets/railroadDiagram-AXF67PYL-Csf9jzQy.js +0 -1
  146. package/dist/worker/console/static/assets/requirementDiagram-LRYGKXZP-CeptoSNx.js +0 -84
  147. package/dist/worker/console/static/assets/sankeyDiagram-W5VNT64P-A-DLCLer.js +0 -40
  148. package/dist/worker/console/static/assets/sequenceDiagram-SI44F4Z6-22VbPdOI.js +0 -162
  149. package/dist/worker/console/static/assets/sizeCapture-X5ZJPWSS-DWvAyBC9.js +0 -1
  150. package/dist/worker/console/static/assets/stateDiagram-OKZ733FA-qICZ75yT.js +0 -1
  151. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-DzKvfHTX.js +0 -1
  152. package/dist/worker/console/static/assets/swimlanes-SLNWSIFB-xi7lcMyp.js +0 -2
  153. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-Cxqr_qM1.js +0 -8
  154. package/dist/worker/console/static/assets/timeline-definition-Z64GVDOM-Bu6Nl6O2.js +0 -120
  155. package/dist/worker/console/static/assets/vennDiagram-T6HMQDX7-BzMz4Bn9.js +0 -34
  156. package/dist/worker/console/static/assets/wardleyDiagram-T6FBY63Y-CxaJnzc5.js +0 -78
  157. package/dist/worker/console/static/assets/xychartDiagram-ELKLHX3M-5JK-omQK.js +0 -7
  158. package/dist/worker/console/static/fonts/katex/KaTeX_AMS-Regular.woff2 +0 -0
  159. package/dist/worker/console/static/fonts/katex/KaTeX_Caligraphic-Bold.woff2 +0 -0
  160. package/dist/worker/console/static/fonts/katex/KaTeX_Caligraphic-Regular.woff2 +0 -0
  161. package/dist/worker/console/static/fonts/katex/KaTeX_Fraktur-Bold.woff2 +0 -0
  162. package/dist/worker/console/static/fonts/katex/KaTeX_Fraktur-Regular.woff2 +0 -0
  163. package/dist/worker/console/static/fonts/katex/KaTeX_Main-Bold.woff2 +0 -0
  164. package/dist/worker/console/static/fonts/katex/KaTeX_Main-BoldItalic.woff2 +0 -0
  165. package/dist/worker/console/static/fonts/katex/KaTeX_Main-Italic.woff2 +0 -0
  166. package/dist/worker/console/static/fonts/katex/KaTeX_Main-Regular.woff2 +0 -0
  167. package/dist/worker/console/static/fonts/katex/KaTeX_Math-BoldItalic.woff2 +0 -0
  168. package/dist/worker/console/static/fonts/katex/KaTeX_Math-Italic.woff2 +0 -0
  169. package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Bold.woff2 +0 -0
  170. package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Italic.woff2 +0 -0
  171. package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Regular.woff2 +0 -0
  172. package/dist/worker/console/static/fonts/katex/KaTeX_Script-Regular.woff2 +0 -0
  173. package/dist/worker/console/static/fonts/katex/KaTeX_Size1-Regular.woff2 +0 -0
  174. package/dist/worker/console/static/fonts/katex/KaTeX_Size2-Regular.woff2 +0 -0
  175. package/dist/worker/console/static/fonts/katex/KaTeX_Size3-Regular.woff2 +0 -0
  176. package/dist/worker/console/static/fonts/katex/KaTeX_Size4-Regular.woff2 +0 -0
  177. package/dist/worker/console/static/fonts/katex/KaTeX_Typewriter-Regular.woff2 +0 -0
  178. package/dist/worker/console/static-src/operator-chat/activity-journey.js +0 -125
  179. package/dist/worker/console/static-src/operator-chat/activity-rail-presentation.js +0 -73
  180. package/dist/worker/console/static-src/operator-chat/activity-references.js +0 -20
  181. package/dist/worker/console/static-src/operator-chat/slash-palette-layout.js +0 -24
  182. package/dist/worker/console/static-src/operator-chat/slash-palette-nav.js +0 -141
  183. package/dist/worker/console/static-src/operator-chat/useActivityRailTransition.js +0 -59
  184. package/dist/worker/observability/interrupt-eligibility.js +0 -264
  185. package/dist/workflows/dag/contract-output-registry.js +0 -14
  186. package/dist/workflows/dag/contract-validator-registrations.js +0 -8
  187. package/dist/workflows/dag/frontend-recovery-plan.js +0 -73
  188. package/dist/workflows/dag/frontend-recovery-root-manifest.js +0 -123
  189. package/dist/workflows/dag/frontend-recovery-run.js +0 -539
  190. package/dist/workflows/dag/frontend-writer-recovery.js +0 -106
  191. package/dist/workflows/dag/frontend-writer-rollback.js +0 -821
  192. package/dist/workflows/dag/interrupt-request.js +0 -559
@@ -1,36 +0,0 @@
1
- import{p as qe}from"./chunk-JWPE2WC7-BlysCtod.js";import{_ as ct,D as Qe,W as Je,l as Fe,b as Ke,a as je,n as _e,o as tr,g as er,s as rr,p as ir,A as ar,y as nr,B as or,c as Ee,a$ as Te,ai as pe,i as sr,d as hr,q as lr,aj as fr,b7 as cr}from"./mermaid.core-DWGK9kwP.js";import{p as gr}from"./cynefin-VYW2F7L2-B1wtI3hU.js";import{c as be}from"./cytoscape.esm-yzknjiTM.js";import{g as ur}from"./index-DQxiso1w.js";var he={exports:{}},le={exports:{}},fe={exports:{}},dr=fe.exports,De;function vr(){return De||(De=1,(function(x,M){(function(R,T){x.exports=T()})(dr,function(){return(function(w){var R={};function T(v){if(R[v])return R[v].exports;var l=R[v]={i:v,l:!1,exports:{}};return w[v].call(l.exports,l,l.exports,T),l.l=!0,l.exports}return T.m=w,T.c=R,T.i=function(v){return v},T.d=function(v,l,i){T.o(v,l)||Object.defineProperty(v,l,{configurable:!1,enumerable:!0,get:i})},T.n=function(v){var l=v&&v.__esModule?function(){return v.default}:function(){return v};return T.d(l,"a",l),l},T.o=function(v,l){return Object.prototype.hasOwnProperty.call(v,l)},T.p="",T(T.s=28)})([(function(w,R,T){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,w.exports=v}),(function(w,R,T){var v=T(2),l=T(8),i=T(9);function r(f,e,d){v.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var a in v)r[a]=v[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var d=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(d.getOwner()==e)return d;if(d.getOwner()==t)break;d=d.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},w.exports=r}),(function(w,R,T){function v(l){this.vGraphObject=l}w.exports=v}),(function(w,R,T){var v=T(2),l=T(10),i=T(13),r=T(0),a=T(16),f=T(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new i(s.x,s.y,o.width,o.height):this.rect=new i}e.prototype=Object.create(v.prototype);for(var d in v)e[d]=v[d];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),h=0;h<c.length;h++)s=c[h],o=s.withChildren(),o.forEach(function(N){t.add(N)});return t},e.prototype.getNoOfChildren=function(){var t=0,s;if(this.child==null)t=1;else for(var o=this.child.getNodes(),c=0;c<o.length;c++)s=o[c],t+=s.getNoOfChildren();return t==0&&(t=1),t},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},e.prototype.scatter=function(){var t,s,o=-r.INITIAL_WORLD_BOUNDARY,c=r.INITIAL_WORLD_BOUNDARY;t=r.WORLD_CENTER_X+a.nextDouble()*(c-o)+o;var h=-r.INITIAL_WORLD_BOUNDARY,N=r.INITIAL_WORLD_BOUNDARY;s=r.WORLD_CENTER_Y+a.nextDouble()*(N-h)+h,this.rect.x=t,this.rect.y=s},e.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var s=t.getRight()-t.getLeft(),o=t.getBottom()-t.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(s+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>s?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),h=t.inverseTransformPoint(c);this.setLocation(h.x,h.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},w.exports=e}),(function(w,R,T){var v=T(0);function l(){}for(var i in v)l[i]=v[i];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,w.exports=l}),(function(w,R,T){function v(l,i){l==null&&i==null?(this.x=0,this.y=0):(this.x=l,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(l){this.x=l},v.prototype.setY=function(l){this.y=l},v.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},w.exports=v}),(function(w,R,T){var v=T(2),l=T(10),i=T(0),r=T(7),a=T(3),f=T(1),e=T(13),d=T(12),t=T(11);function s(c,h,N){v.call(this,N),this.estimatedSize=l.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,h!=null&&h instanceof r?this.graphManager=h:h!=null&&h instanceof Layout&&(this.graphManager=h.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,h,N){if(h==null&&N==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var u=c;if(!(this.getNodes().indexOf(h)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(h.owner==N.owner&&h.owner==this))throw"Both owners must be this graph!";return h.owner!=N.owner?null:(u.source=h,u.target=N,u.isInterGraph=!1,this.getEdges().push(u),h.edges.push(u),N!=h&&N.edges.push(u),u)}},s.prototype.remove=function(c){var h=c;if(c instanceof a){if(h==null)throw"Node is null!";if(!(h.owner!=null&&h.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var N=h.edges.slice(),g,u=N.length,L=0;L<u;L++)g=N[L],g.isInterGraph?this.graphManager.remove(g):g.source.owner.remove(g);var F=this.nodes.indexOf(h);if(F==-1)throw"Node not in owner node list!";this.nodes.splice(F,1)}else if(c instanceof f){var g=c;if(g==null)throw"Edge is null!";if(!(g.source!=null&&g.target!=null))throw"Source and/or target is null!";if(!(g.source.owner!=null&&g.target.owner!=null&&g.source.owner==this&&g.target.owner==this))throw"Source and/or target owner is invalid!";var C=g.source.edges.indexOf(g),G=g.target.edges.indexOf(g);if(!(C>-1&&G>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(C,1),g.target!=g.source&&g.target.edges.splice(G,1);var F=g.source.owner.getEdges().indexOf(g);if(F==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(F,1)}},s.prototype.updateLeftTop=function(){for(var c=l.MAX_VALUE,h=l.MAX_VALUE,N,g,u,L=this.getNodes(),F=L.length,C=0;C<F;C++){var G=L[C];N=G.getTop(),g=G.getLeft(),c>N&&(c=N),h>g&&(h=g)}return c==l.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?u=L[0].getParent().paddingLeft:u=this.margin,this.left=h-u,this.top=c-u,new d(this.left,this.top))},s.prototype.updateBounds=function(c){for(var h=l.MAX_VALUE,N=-l.MAX_VALUE,g=l.MAX_VALUE,u=-l.MAX_VALUE,L,F,C,G,V,Y=this.nodes,z=Y.length,A=0;A<z;A++){var _=Y[A];c&&_.child!=null&&_.updateBounds(),L=_.getLeft(),F=_.getRight(),C=_.getTop(),G=_.getBottom(),h>L&&(h=L),N<F&&(N=F),g>C&&(g=C),u<G&&(u=G)}var n=new e(h,g,N-h,u-g);h==l.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),Y[0].getParent().paddingLeft!=null?V=Y[0].getParent().paddingLeft:V=this.margin,this.left=n.x-V,this.right=n.x+n.width+V,this.top=n.y-V,this.bottom=n.y+n.height+V},s.calculateBounds=function(c){for(var h=l.MAX_VALUE,N=-l.MAX_VALUE,g=l.MAX_VALUE,u=-l.MAX_VALUE,L,F,C,G,V=c.length,Y=0;Y<V;Y++){var z=c[Y];L=z.getLeft(),F=z.getRight(),C=z.getTop(),G=z.getBottom(),h>L&&(h=L),N<F&&(N=F),g>C&&(g=C),u<G&&(u=G)}var A=new e(h,g,N-h,u-g);return A},s.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},s.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},s.prototype.calcEstimatedSize=function(){for(var c=0,h=this.nodes,N=h.length,g=0;g<N;g++){var u=h[g];c+=u.calcEstimatedSize()}return c==0?this.estimatedSize=i.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=c/Math.sqrt(this.nodes.length),this.estimatedSize},s.prototype.updateConnected=function(){var c=this;if(this.nodes.length==0){this.isConnected=!0;return}var h=new t,N=new Set,g=this.nodes[0],u,L,F=g.withChildren();for(F.forEach(function(A){h.push(A),N.add(A)});h.length!==0;){g=h.shift(),u=g.getEdges();for(var C=u.length,G=0;G<C;G++){var V=u[G];if(L=V.getOtherEndInGraph(g,this),L!=null&&!N.has(L)){var Y=L.withChildren();Y.forEach(function(A){h.push(A),N.add(A)})}}}if(this.isConnected=!1,N.size>=this.nodes.length){var z=0;N.forEach(function(A){A.owner==c&&z++}),z==this.nodes.length&&(this.isConnected=!0)}},w.exports=s}),(function(w,R,T){var v,l=T(1);function i(r){v=T(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,d){if(f==null&&e==null&&d==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{d=f,e=a,f=r;var t=e.getOwner(),s=d.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,d);if(f.isInterGraph=!0,f.source=e,f.target=d,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,d=f.length,t=0;t<d;t++)e=f[t],a.remove(e);var s=[];s=s.concat(a.getNodes());var o;d=s.length;for(var t=0;t<d;t++)o=s[t],a.remove(o);a==this.rootGraph&&this.setRootGraph(null);var c=this.graphs.indexOf(a);this.graphs.splice(c,1),a.parent=null}else if(r instanceof l){if(e=r,e==null)throw"Edge is null!";if(!e.isInterGraph)throw"Not an inter-graph edge!";if(!(e.source!=null&&e.target!=null))throw"Source and/or target is null!";if(!(e.source.edges.indexOf(e)!=-1&&e.target.edges.indexOf(e)!=-1))throw"Source and/or target doesn't know this edge!";var c=e.source.edges.indexOf(e);if(e.source.edges.splice(c,1),c=e.target.edges.indexOf(e),e.target.edges.splice(c,1),!(e.source.owner!=null&&e.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(e.source.owner.getGraphManager().edges.indexOf(e)==-1)throw"Not in owner graph manager's edge list!";var c=e.source.owner.getGraphManager().edges.indexOf(e);e.source.owner.getGraphManager().edges.splice(c,1)}},i.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},i.prototype.getGraphs=function(){return this.graphs},i.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],a=this.getGraphs(),f=a.length,e=0;e<f;e++)r=r.concat(a[e].getNodes());this.allNodes=r}return this.allNodes},i.prototype.resetAllNodes=function(){this.allNodes=null},i.prototype.resetAllEdges=function(){this.allEdges=null},i.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},i.prototype.getAllEdges=function(){if(this.allEdges==null){var r=[],a=this.getGraphs();a.length;for(var f=0;f<a.length;f++)r=r.concat(a[f].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},i.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},i.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},i.prototype.getRoot=function(){return this.rootGraph},i.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},i.prototype.getLayout=function(){return this.layout},i.prototype.isOneAncestorOfOther=function(r,a){if(!(r!=null&&a!=null))throw"assert failed";if(r==a)return!0;var f=r.getOwner(),e;do{if(e=f.getParent(),e==null)break;if(e==a)return!0;if(f=e.getOwner(),f==null)break}while(!0);f=a.getOwner();do{if(e=f.getParent(),e==null)break;if(e==r)return!0;if(f=e.getOwner(),f==null)break}while(!0);return!1},i.prototype.calcLowestCommonAncestors=function(){for(var r,a,f,e,d,t=this.getAllEdges(),s=t.length,o=0;o<s;o++){if(r=t[o],a=r.source,f=r.target,r.lca=null,r.sourceInLca=a,r.targetInLca=f,a==f){r.lca=a.getOwner();continue}for(e=a.getOwner();r.lca==null;){for(r.targetInLca=f,d=f.getOwner();r.lca==null;){if(d==e){r.lca=d;break}if(d==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=d.getParent(),d=r.targetInLca.getOwner()}if(e==this.rootGraph)break;r.lca==null&&(r.sourceInLca=e.getParent(),e=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},i.prototype.calcLowestCommonAncestor=function(r,a){if(r==a)return r.getOwner();var f=r.getOwner();do{if(f==null)break;var e=a.getOwner();do{if(e==null)break;if(e==f)return e;e=e.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},i.prototype.calcInclusionTreeDepths=function(r,a){r==null&&a==null&&(r=this.rootGraph,a=1);for(var f,e=r.getNodes(),d=e.length,t=0;t<d;t++)f=e[t],f.inclusionTreeDepth=a,f.child!=null&&this.calcInclusionTreeDepths(f.child,a+1)},i.prototype.includesInvalidEdge=function(){for(var r,a=[],f=this.edges.length,e=0;e<f;e++)r=this.edges[e],this.isOneAncestorOfOther(r.source,r.target)&&a.push(r);for(var e=0;e<a.length;e++)this.remove(a[e]);return!1},w.exports=i}),(function(w,R,T){var v=T(12);function l(){}l.calcSeparationAmount=function(i,r,a,f){if(!i.intersects(r))throw"assert failed";var e=new Array(2);this.decideDirectionsForOverlappingNodes(i,r,e),a[0]=Math.min(i.getRight(),r.getRight())-Math.max(i.x,r.x),a[1]=Math.min(i.getBottom(),r.getBottom())-Math.max(i.y,r.y),i.getX()<=r.getX()&&i.getRight()>=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var d=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(d=1);var t=d*a[0],s=a[1]/d;a[0]<s?s=a[0]:t=a[1],a[0]=-1*e[0]*(s/2+f),a[1]=-1*e[1]*(t/2+f)},l.decideDirectionsForOverlappingNodes=function(i,r,a){i.getCenterX()<r.getCenterX()?a[0]=-1:a[0]=1,i.getCenterY()<r.getCenterY()?a[1]=-1:a[1]=1},l.getIntersection2=function(i,r,a){var f=i.getCenterX(),e=i.getCenterY(),d=r.getCenterX(),t=r.getCenterY();if(i.intersects(r))return a[0]=f,a[1]=e,a[2]=d,a[3]=t,!0;var s=i.getX(),o=i.getY(),c=i.getRight(),h=i.getX(),N=i.getBottom(),g=i.getRight(),u=i.getWidthHalf(),L=i.getHeightHalf(),F=r.getX(),C=r.getY(),G=r.getRight(),V=r.getX(),Y=r.getBottom(),z=r.getRight(),A=r.getWidthHalf(),_=r.getHeightHalf(),n=!1,E=!1;if(f===d){if(e>t)return a[0]=f,a[1]=o,a[2]=d,a[3]=Y,!1;if(e<t)return a[0]=f,a[1]=N,a[2]=d,a[3]=C,!1}else if(e===t){if(f>d)return a[0]=s,a[1]=e,a[2]=G,a[3]=t,!1;if(f<d)return a[0]=c,a[1]=e,a[2]=F,a[3]=t,!1}else{var p=i.height/i.width,m=r.height/r.width,y=(t-e)/(d-f),S=void 0,D=void 0,b=void 0,W=void 0,I=void 0,Q=void 0;if(-p===y?f>d?(a[0]=h,a[1]=N,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>d?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=N,n=!0)),-m===y?d>f?(a[2]=V,a[3]=Y,E=!0):(a[2]=G,a[3]=C,E=!0):m===y&&(d>f?(a[2]=F,a[3]=C,E=!0):(a[2]=z,a[3]=Y,E=!0)),n&&E)return!1;if(f>d?e>t?(S=this.getCardinalDirection(p,y,4),D=this.getCardinalDirection(m,y,2)):(S=this.getCardinalDirection(-p,y,3),D=this.getCardinalDirection(-m,y,1)):e>t?(S=this.getCardinalDirection(-p,y,1),D=this.getCardinalDirection(-m,y,3)):(S=this.getCardinalDirection(p,y,2),D=this.getCardinalDirection(m,y,4)),!n)switch(S){case 1:W=o,b=f+-L/y,a[0]=b,a[1]=W;break;case 2:b=g,W=e+u*y,a[0]=b,a[1]=W;break;case 3:W=N,b=f+L/y,a[0]=b,a[1]=W;break;case 4:b=h,W=e+-u*y,a[0]=b,a[1]=W;break}if(!E)switch(D){case 1:Q=C,I=d+-_/y,a[2]=I,a[3]=Q;break;case 2:I=z,Q=t+A*y,a[2]=I,a[3]=Q;break;case 3:Q=Y,I=d+_/y,a[2]=I,a[3]=Q;break;case 4:I=V,Q=t+-A*y,a[2]=I,a[3]=Q;break}}return!1},l.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},l.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,d=i.y,t=r.x,s=r.y,o=a.x,c=a.y,h=f.x,N=f.y,g=void 0,u=void 0,L=void 0,F=void 0,C=void 0,G=void 0,V=void 0,Y=void 0,z=void 0;return L=s-d,C=e-t,V=t*d-e*s,F=N-c,G=o-h,Y=h*c-o*N,z=L*G-F*C,z===0?null:(g=(C*Y-G*V)/z,u=(F*V-L*Y)/z,new v(g,u))},l.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a<i?e+=Math.PI:f<r&&(e+=this.TWO_PI)):f<r?e=this.ONE_AND_HALF_PI:e=this.HALF_PI,e},l.doIntersect=function(i,r,a,f){var e=i.x,d=i.y,t=r.x,s=r.y,o=a.x,c=a.y,h=f.x,N=f.y,g=(t-e)*(N-c)-(h-o)*(s-d);if(g===0)return!1;var u=((N-c)*(h-e)+(o-h)*(N-d))/g,L=((d-s)*(h-e)+(t-e)*(N-d))/g;return 0<u&&u<1&&0<L&&L<1},l.findCircleLineIntersections=function(i,r,a,f,e,d,t){var s=(a-i)*(a-i)+(f-r)*(f-r),o=2*((i-e)*(a-i)+(r-d)*(f-r)),c=(i-e)*(i-e)+(r-d)*(r-d)-t*t,h=o*o-4*s*c;if(h>=0){var N=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),u=null;return N>=0&&N<=1?[N]:g>=0&&g<=1?[g]:u}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,w.exports=l}),(function(w,R,T){function v(){}v.sign=function(l){return l>0?1:l<0?-1:0},v.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},v.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},w.exports=v}),(function(w,R,T){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,w.exports=v}),(function(w,R,T){var v=(function(){function e(d,t){for(var s=0;s<t.length;s++){var o=t[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(d,o.key,o)}}return function(d,t,s){return t&&e(d.prototype,t),s&&e(d,s),d}})();function l(e,d){if(!(e instanceof d))throw new TypeError("Cannot call a class as a function")}var i=function(d){return{value:d,next:null,prev:null}},r=function(d,t,s,o){return d!==null?d.next=t:o.head=t,s!==null?s.prev=t:o.tail=t,t.prev=d,t.next=s,o.length++,t},a=function(d,t){var s=d.prev,o=d.next;return s!==null?s.next=o:t.head=o,o!==null?o.prev=s:t.tail=s,d.prev=d.next=null,t.length--,d},f=(function(){function e(d){var t=this;l(this,e),this.length=0,this.head=null,this.tail=null,d?.forEach(function(s){return t.push(s)})}return v(e,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,s){return r(s.prev,i(t),s,this)}},{key:"insertAfter",value:function(t,s){return r(s,i(t),s.next,this)}},{key:"insertNodeBefore",value:function(t,s){return r(s.prev,t,s,this)}},{key:"insertNodeAfter",value:function(t,s){return r(s,t,s.next,this)}},{key:"push",value:function(t){return r(this.tail,i(t),null,this)}},{key:"unshift",value:function(t){return r(null,i(t),this.head,this)}},{key:"remove",value:function(t){return a(t,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var s=1,o=this.head;s<t;)o=o.next,s++;return o.value}}},{key:"set_object_at",value:function(t,s){if(t<=this.length()){for(var o=1,c=this.head;o<t;)c=c.next,o++;c.value=s}}}]),e})();w.exports=f}),(function(w,R,T){function v(l,i,r){this.x=null,this.y=null,l==null&&i==null&&r==null?(this.x=0,this.y=0):typeof l=="number"&&typeof i=="number"&&r==null?(this.x=l,this.y=i):l.constructor.name=="Point"&&i==null&&r==null&&(r=l,this.x=r.x,this.y=r.y)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(l,i,r){l.constructor.name=="Point"&&i==null&&r==null?(r=l,this.setLocation(r.x,r.y)):typeof l=="number"&&typeof i=="number"&&r==null&&(parseInt(l)==l&&parseInt(i)==i?this.move(l,i):(this.x=Math.floor(l+.5),this.y=Math.floor(i+.5)))},v.prototype.move=function(l,i){this.x=l,this.y=i},v.prototype.translate=function(l,i){this.x+=l,this.y+=i},v.prototype.equals=function(l){if(l.constructor.name=="Point"){var i=l;return this.x==i.x&&this.y==i.y}return this==l},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},w.exports=v}),(function(w,R,T){function v(l,i,r,a){this.x=0,this.y=0,this.width=0,this.height=0,l!=null&&i!=null&&r!=null&&a!=null&&(this.x=l,this.y=i,this.width=r,this.height=a)}v.prototype.getX=function(){return this.x},v.prototype.setX=function(l){this.x=l},v.prototype.getY=function(){return this.y},v.prototype.setY=function(l){this.y=l},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(l){this.width=l},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(l){this.height=l},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(l){return!(this.getRight()<l.x||this.getBottom()<l.y||l.getRight()<this.x||l.getBottom()<this.y)},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},w.exports=v}),(function(w,R,T){var v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i};function l(){}l.lastID=0,l.createID=function(i){return l.isPrimitive(i)?i:(i.uniqueID!=null||(i.uniqueID=l.getString(),l.lastID++),i.uniqueID)},l.getString=function(i){return i==null&&(i=l.lastID),"Object#"+i},l.isPrimitive=function(i){var r=typeof i>"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},w.exports=l}),(function(w,R,T){function v(o){if(Array.isArray(o)){for(var c=0,h=Array(o.length);c<o.length;c++)h[c]=o[c];return h}else return Array.from(o)}var l=T(0),i=T(7),r=T(3),a=T(1),f=T(6),e=T(5),d=T(17),t=T(29);function s(o){t.call(this),this.layoutQuality=l.QUALITY,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=l.DEFAULT_INCREMENTAL,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new i(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,o!=null&&(this.isRemoteUse=o)}s.RANDOM_SEED=1,s.prototype=Object.create(t.prototype),s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},s.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},s.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},s.prototype.newGraphManager=function(){var o=new i(this);return this.graphManager=o,o},s.prototype.newGraph=function(o){return new f(null,this.graphManager,o)},s.prototype.newNode=function(o){return new r(this.graphManager,o)},s.prototype.newEdge=function(o){return new a(null,null,o)},s.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},s.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var o;return this.checkLayoutSuccess()?o=!1:o=this.layout(),l.ANIMATE==="during"?!1:(o&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,o)},s.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},s.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var o=this.graphManager.getAllEdges(),c=0;c<o.length;c++)o[c];for(var h=this.graphManager.getRoot().getNodes(),c=0;c<h.length;c++)h[c];this.update(this.graphManager.getRoot())}},s.prototype.update=function(o){if(o==null)this.update2();else if(o instanceof r){var c=o;if(c.getChild()!=null)for(var h=c.getChild().getNodes(),N=0;N<h.length;N++)update(h[N]);if(c.vGraphObject!=null){var g=c.vGraphObject;g.update(c)}}else if(o instanceof a){var u=o;if(u.vGraphObject!=null){var L=u.vGraphObject;L.update(u)}}else if(o instanceof f){var F=o;if(F.vGraphObject!=null){var C=F.vGraphObject;C.update(F)}}},s.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=l.QUALITY,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=l.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},s.prototype.transform=function(o){if(o==null)this.transform(new e(0,0));else{var c=new d,h=this.graphManager.getRoot().updateLeftTop();if(h!=null){c.setWorldOrgX(o.x),c.setWorldOrgY(o.y),c.setDeviceOrgX(h.x),c.setDeviceOrgY(h.y);for(var N=this.getAllNodes(),g,u=0;u<N.length;u++)g=N[u],g.transform(c)}}},s.prototype.positionNodesRandomly=function(o){if(o==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var c,h,N=o.getNodes(),g=0;g<N.length;g++)c=N[g],h=c.getChild(),h==null||h.getNodes().length==0?c.scatter():(this.positionNodesRandomly(h),c.updateBounds())},s.prototype.getFlatForest=function(){for(var o=[],c=!0,h=this.graphManager.getRoot().getNodes(),N=!0,g=0;g<h.length;g++)h[g].getChild()!=null&&(N=!1);if(!N)return o;var u=new Set,L=[],F=new Map,C=[];for(C=C.concat(h);C.length>0&&c;){for(L.push(C[0]);L.length>0&&c;){var G=L[0];L.splice(0,1),u.add(G);for(var V=G.getEdges(),g=0;g<V.length;g++){var Y=V[g].getOtherEnd(G);if(F.get(G)!=Y)if(!u.has(Y))L.push(Y),F.set(Y,G);else{c=!1;break}}}if(!c)o=[];else{var z=[].concat(v(u));o.push(z);for(var g=0;g<z.length;g++){var A=z[g],_=C.indexOf(A);_>-1&&C.splice(_,1)}u=new Set,F=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],h=o.source,N=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g<o.bendpoints.length;g++){var u=this.newNode(null);u.setRect(new Point(0,0),new Dimension(1,1)),N.add(u);var L=this.newEdge(null);this.graphManager.add(L,h,u),c.add(u),h=u}var L=this.newEdge(null);return this.graphManager.add(L,h,o.target),this.edgeToDummyNodes.set(o,c),o.isInterGraph()?this.graphManager.remove(o):N.remove(o),c},s.prototype.createBendpointsFromDummyNodes=function(){var o=[];o=o.concat(this.graphManager.getAllEdges()),o=[].concat(v(this.edgeToDummyNodes.keys())).concat(o);for(var c=0;c<o.length;c++){var h=o[c];if(h.bendpoints.length>0){for(var N=this.edgeToDummyNodes.get(h),g=0;g<N.length;g++){var u=N[g],L=new e(u.getCenterX(),u.getCenterY()),F=h.bendpoints.get(g);F.x=L.x,F.y=L.y,u.getOwner().remove(u)}this.graphManager.add(h,h.source,h.target)}}},s.transform=function(o,c,h,N){if(h!=null&&N!=null){var g=c;if(o<=50){var u=c/h;g-=(c-u)/50*(50-o)}else{var L=c*N;g+=(L-c)/50*(o-50)}return g}else{var F,C;return o<=50?(F=9*c/500,C=c/10):(F=9*c/50,C=-8*c),F*o+C}},s.findCenterOfTree=function(o){var c=[];c=c.concat(o);var h=[],N=new Map,g=!1,u=null;(c.length==1||c.length==2)&&(g=!0,u=c[0]);for(var L=0;L<c.length;L++){var F=c[L],C=F.getNeighborsList().size;N.set(F,F.getNeighborsList().size),C==1&&h.push(F)}var G=[];for(G=G.concat(h);!g;){var V=[];V=V.concat(G),G=[];for(var L=0;L<c.length;L++){var F=c[L],Y=c.indexOf(F);Y>=0&&c.splice(Y,1);var z=F.getNeighborsList();z.forEach(function(n){if(h.indexOf(n)<0){var E=N.get(n),p=E-1;p==1&&G.push(n),N.set(n,p)}})}h=h.concat(G),(c.length==1||c.length==2)&&(g=!0,u=c[0])}return u},s.prototype.setGraphManager=function(o){this.graphManager=o},w.exports=s}),(function(w,R,T){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},w.exports=v}),(function(w,R,T){var v=T(5);function l(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(i){this.lworldExtX=i},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(i){this.lworldExtY=i},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},l.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},l.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},l.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},l.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},l.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},w.exports=l}),(function(w,R,T){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);s<t.length;s++)o[s]=t[s];return o}else return Array.from(t)}var l=T(15),i=T(4),r=T(0),a=T(8),f=T(9);function e(){l.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}e.prototype=Object.create(l.prototype);for(var d in l)e[d]=l[d];e.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},e.prototype.calcIdealEdgeLengths=function(){for(var t,s,o,c,h,N,g,u=this.getGraphManager().getAllEdges(),L=0;L<u.length;L++)t=u[L],s=t.idealLength,t.isInterGraph&&(c=t.getSource(),h=t.getTarget(),N=t.getSourceInLca().getEstimatedSize(),g=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=N+g-2*r.SIMPLE_NODE_SIZE),o=t.getLca().getInclusionTreeDepth(),t.idealLength+=s*i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(c.getInclusionTreeDepth()+h.getInclusionTreeDepth()-2*o))},e.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>i.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o<t.length;o++)s=t[o],this.calcSpringForce(s,s.idealLength)},e.prototype.calcRepulsionForces=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,h,N,g=this.getAllNodes(),u;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),u=new Set,o=0;o<g.length;o++)h=g[o],this.calculateRepulsionForceOfANode(h,u,t,s),u.add(h);else for(o=0;o<g.length;o++)for(h=g[o],c=o+1;c<g.length;c++)N=g[c],h.getOwner()==N.getOwner()&&this.calcRepulsionForce(h,N)},e.prototype.calcGravitationalForces=function(){for(var t,s=this.getAllNodesToApplyGravitation(),o=0;o<s.length;o++)t=s[o],this.calcGravitationalForce(t)},e.prototype.moveNodes=function(){for(var t=this.getAllNodes(),s,o=0;o<t.length;o++)s=t[o],s.move()},e.prototype.calcSpringForce=function(t,s){var o=t.getSource(),c=t.getTarget(),h,N,g,u;if(this.uniformLeafNodeSizes&&o.getChild()==null&&c.getChild()==null)t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;h=t.getLength(),h!=0&&(N=t.edgeElasticity*(h-s),g=N*(t.lengthX/h),u=N*(t.lengthY/h),o.springForceX+=g,o.springForceY+=u,c.springForceX-=g,c.springForceY-=u)},e.prototype.calcRepulsionForce=function(t,s){var o=t.getRect(),c=s.getRect(),h=new Array(2),N=new Array(4),g,u,L,F,C,G,V;if(o.intersects(c)){a.calcSeparationAmount(o,c,h,i.DEFAULT_EDGE_LENGTH/2),G=2*h[0],V=2*h[1];var Y=t.noOfChildren*s.noOfChildren/(t.noOfChildren+s.noOfChildren);t.repulsionForceX-=Y*G,t.repulsionForceY-=Y*V,s.repulsionForceX+=Y*G,s.repulsionForceY+=Y*V}else this.uniformLeafNodeSizes&&t.getChild()==null&&s.getChild()==null?(g=c.getCenterX()-o.getCenterX(),u=c.getCenterY()-o.getCenterY()):(a.getIntersection(o,c,N),g=N[2]-N[0],u=N[3]-N[1]),Math.abs(g)<i.MIN_REPULSION_DIST&&(g=f.sign(g)*i.MIN_REPULSION_DIST),Math.abs(u)<i.MIN_REPULSION_DIST&&(u=f.sign(u)*i.MIN_REPULSION_DIST),L=g*g+u*u,F=Math.sqrt(L),C=(t.nodeRepulsion/2+s.nodeRepulsion/2)*t.noOfChildren*s.noOfChildren/L,G=C*g/F,V=C*u/F,t.repulsionForceX-=G,t.repulsionForceY-=V,s.repulsionForceX+=G,s.repulsionForceY+=V},e.prototype.calcGravitationalForce=function(t){var s,o,c,h,N,g,u,L;s=t.getOwner(),o=(s.getRight()+s.getLeft())/2,c=(s.getTop()+s.getBottom())/2,h=t.getCenterX()-o,N=t.getCenterY()-c,g=Math.abs(h)+t.getWidth()/2,u=Math.abs(N)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(L=s.getEstimatedSize()*this.gravityRangeFactor,(g>L||u>L)&&(t.gravitationForceX=-this.gravityConstant*h,t.gravitationForceY=-this.gravityConstant*N)):(L=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>L||u>L)&&(t.gravitationForceX=-this.gravityConstant*h*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||s},e.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},e.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,s=this.graphManager.getAllNodes(),o=0;o<s.length;o++)t=s[o],t.noOfChildren=t.getNoOfChildren()},e.prototype.calcGrid=function(t){var s=0,o=0;s=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),o=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var c=new Array(s),h=0;h<s;h++)c[h]=new Array(o);for(var h=0;h<s;h++)for(var N=0;N<o;N++)c[h][N]=new Array;return c},e.prototype.addNodeToGrid=function(t,s,o){var c=0,h=0,N=0,g=0;c=parseInt(Math.floor((t.getRect().x-s)/this.repulsionRange)),h=parseInt(Math.floor((t.getRect().width+t.getRect().x-s)/this.repulsionRange)),N=parseInt(Math.floor((t.getRect().y-o)/this.repulsionRange)),g=parseInt(Math.floor((t.getRect().height+t.getRect().y-o)/this.repulsionRange));for(var u=c;u<=h;u++)for(var L=N;L<=g;L++)this.grid[u][L].push(t),t.setGridCoordinates(c,h,N,g)},e.prototype.updateGrid=function(){var t,s,o=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<o.length;t++)s=o[t],this.addNodeToGrid(s,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},e.prototype.calculateRepulsionForceOfANode=function(t,s,o,c){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&o||c){var h=new Set;t.surrounding=new Array;for(var N,g=this.grid,u=t.startX-1;u<t.finishX+2;u++)for(var L=t.startY-1;L<t.finishY+2;L++)if(!(u<0||L<0||u>=g.length||L>=g[0].length)){for(var F=0;F<g[u][L].length;F++)if(N=g[u][L][F],!(t.getOwner()!=N.getOwner()||t==N)&&!s.has(N)&&!h.has(N)){var C=Math.abs(t.getCenterX()-N.getCenterX())-(t.getWidth()/2+N.getWidth()/2),G=Math.abs(t.getCenterY()-N.getCenterY())-(t.getHeight()/2+N.getHeight()/2);C<=this.repulsionRange&&G<=this.repulsionRange&&h.add(N)}}t.surrounding=[].concat(v(h))}for(u=0;u<t.surrounding.length;u++)this.calcRepulsionForce(t,t.surrounding[u])},e.prototype.calcRepulsionRange=function(){return 0},w.exports=e}),(function(w,R,T){var v=T(1),l=T(4);function i(a,f,e){v.call(this,a,f,e),this.idealLength=l.DEFAULT_EDGE_LENGTH,this.edgeElasticity=l.DEFAULT_SPRING_STRENGTH}i.prototype=Object.create(v.prototype);for(var r in v)i[r]=v[r];w.exports=i}),(function(w,R,T){var v=T(3),l=T(4);function i(a,f,e,d){v.call(this,a,f,e,d),this.nodeRepulsion=l.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}i.prototype=Object.create(v.prototype);for(var r in v)i[r]=v[r];i.prototype.setGridCoordinates=function(a,f,e,d){this.startX=a,this.finishX=f,this.startY=e,this.finishY=d},w.exports=i}),(function(w,R,T){function v(l,i){this.width=0,this.height=0,l!==null&&i!==null&&(this.height=i,this.width=l)}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(l){this.width=l},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(l){this.height=l},w.exports=v}),(function(w,R,T){var v=T(14);function l(){this.map={},this.keys=[]}l.prototype.put=function(i,r){var a=v.createID(i);this.contains(a)||(this.map[a]=r,this.keys.push(i))},l.prototype.contains=function(i){return v.createID(i),this.map[i]!=null},l.prototype.get=function(i){var r=v.createID(i);return this.map[r]},l.prototype.keySet=function(){return this.keys},w.exports=l}),(function(w,R,T){var v=T(14);function l(){this.set={}}l.prototype.add=function(i){var r=v.createID(i);this.contains(r)||(this.set[r]=i)},l.prototype.remove=function(i){delete this.set[v.createID(i)]},l.prototype.clear=function(){this.set={}},l.prototype.contains=function(i){return this.set[v.createID(i)]==i},l.prototype.isEmpty=function(){return this.size()===0},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAllTo=function(i){for(var r=Object.keys(this.set),a=r.length,f=0;f<a;f++)i.push(this.set[r[f]])},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAll=function(i){for(var r=i.length,a=0;a<r;a++){var f=i[a];this.add(f)}},w.exports=l}),(function(w,R,T){function v(){}v.multMat=function(l,i){for(var r=[],a=0;a<l.length;a++){r[a]=[];for(var f=0;f<i[0].length;f++){r[a][f]=0;for(var e=0;e<l[0].length;e++)r[a][f]+=l[a][e]*i[e][f]}}return r},v.transpose=function(l){for(var i=[],r=0;r<l[0].length;r++){i[r]=[];for(var a=0;a<l.length;a++)i[r][a]=l[a][r]}return i},v.multCons=function(l,i){for(var r=[],a=0;a<l.length;a++)r[a]=l[a]*i;return r},v.minusOp=function(l,i){for(var r=[],a=0;a<l.length;a++)r[a]=l[a]-i[a];return r},v.dotProduct=function(l,i){for(var r=0,a=0;a<l.length;a++)r+=l[a]*i[a];return r},v.mag=function(l){return Math.sqrt(this.dotProduct(l,l))},v.normalize=function(l){for(var i=[],r=this.mag(l),a=0;a<l.length;a++)i[a]=l[a]/r;return i},v.multGamma=function(l){for(var i=[],r=0,a=0;a<l.length;a++)r+=l[a];r*=-1/l.length;for(var f=0;f<l.length;f++)i[f]=r+l[f];return i},v.multL=function(l,i,r){for(var a=[],f=[],e=[],d=0;d<i[0].length;d++){for(var t=0,s=0;s<i.length;s++)t+=-.5*i[s][d]*l[s];f[d]=t}for(var o=0;o<r.length;o++){for(var c=0,h=0;h<r.length;h++)c+=r[o][h]*f[h];e[o]=c}for(var N=0;N<i.length;N++){for(var g=0,u=0;u<i[0].length;u++)g+=i[N][u]*e[u];a[N]=g}return a},w.exports=v}),(function(w,R,T){var v=(function(){function a(f,e){for(var d=0;d<e.length;d++){var t=e[d];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(f,t.key,t)}}return function(f,e,d){return e&&a(f.prototype,e),d&&a(f,d),f}})();function l(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")}var i=T(11),r=(function(){function a(f,e){l(this,a),(e!==null||e!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var d=void 0;f instanceof i?d=f.size():d=f.length,this._quicksort(f,0,d-1)}return v(a,[{key:"_quicksort",value:function(e,d,t){if(d<t){var s=this._partition(e,d,t);this._quicksort(e,d,s),this._quicksort(e,s+1,t)}}},{key:"_partition",value:function(e,d,t){for(var s=this._get(e,d),o=d,c=t;;){for(;this.compareFunction(s,this._get(e,c));)c--;for(;this.compareFunction(this._get(e,o),s);)o++;if(o<c)this._swap(e,o,c),o++,c--;else return c}}},{key:"_get",value:function(e,d){return e instanceof i?e.get_object_at(d):e[d]}},{key:"_set",value:function(e,d,t){e instanceof i?e.set_object_at(d,t):e[d]=t}},{key:"_swap",value:function(e,d,t){var s=this._get(e,d);this._set(e,d,this._get(e,t)),this._set(e,t,s)}},{key:"_defaultCompareFunction",value:function(e,d){return d>e}}]),a})();w.exports=r}),(function(w,R,T){function v(){}v.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var wt=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St<bt[0];St++)zt.push($t(bt.slice(1)));return zt};return wt(Tt)})([this.m,i]),this.V=(function(Tt){var wt=function $t(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St<bt[0];St++)zt.push($t(bt.slice(1)));return zt};return wt(Tt)})([this.n,this.n]);for(var r=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(this.n),a=(function(Tt){for(var wt=[];Tt-- >0;)wt.push(0);return wt})(this.m),f=!0,e=Math.min(this.m-1,this.n),d=Math.max(0,Math.min(this.n-2,this.m)),t=0;t<Math.max(e,d);t++){if(t<e){this.s[t]=0;for(var s=t;s<this.m;s++)this.s[t]=v.hypot(this.s[t],l[s][t]);if(this.s[t]!==0){l[t][t]<0&&(this.s[t]=-this.s[t]);for(var o=t;o<this.m;o++)l[o][t]/=this.s[t];l[t][t]+=1}this.s[t]=-this.s[t]}for(var c=t+1;c<this.n;c++){if((function(Tt,wt){return Tt&&wt})(t<e,this.s[t]!==0)){for(var h=0,N=t;N<this.m;N++)h+=l[N][t]*l[N][c];h=-h/l[t][t];for(var g=t;g<this.m;g++)l[g][c]+=h*l[g][t]}r[c]=l[t][c]}if((function(Tt,wt){return wt})(f,t<e))for(var u=t;u<this.m;u++)this.U[u][t]=l[u][t];if(t<d){r[t]=0;for(var L=t+1;L<this.n;L++)r[t]=v.hypot(r[t],r[L]);if(r[t]!==0){r[t+1]<0&&(r[t]=-r[t]);for(var F=t+1;F<this.n;F++)r[F]/=r[t];r[t+1]+=1}if(r[t]=-r[t],(function(Tt,wt){return Tt&&wt})(t+1<this.m,r[t]!==0)){for(var C=t+1;C<this.m;C++)a[C]=0;for(var G=t+1;G<this.n;G++)for(var V=t+1;V<this.m;V++)a[V]+=r[G]*l[V][G];for(var Y=t+1;Y<this.n;Y++)for(var z=-r[Y]/r[t+1],A=t+1;A<this.m;A++)l[A][Y]+=z*a[A]}for(var _=t+1;_<this.n;_++)this.V[_][t]=r[_]}}var n=Math.min(this.n,this.m+1);e<this.n&&(this.s[e]=l[e][e]),this.m<n&&(this.s[n-1]=0),d+1<n&&(r[d]=l[d][n-1]),r[n-1]=0;{for(var E=e;E<i;E++){for(var p=0;p<this.m;p++)this.U[p][E]=0;this.U[E][E]=1}for(var m=e-1;m>=0;m--)if(this.s[m]!==0){for(var y=m+1;y<i;y++){for(var S=0,D=m;D<this.m;D++)S+=this.U[D][m]*this.U[D][y];S=-S/this.U[m][m];for(var b=m;b<this.m;b++)this.U[b][y]+=S*this.U[b][m]}for(var W=m;W<this.m;W++)this.U[W][m]=-this.U[W][m];this.U[m][m]=1+this.U[m][m];for(var I=0;I<m-1;I++)this.U[I][m]=0}else{for(var Q=0;Q<this.m;Q++)this.U[Q][m]=0;this.U[m][m]=1}}for(var $=this.n-1;$>=0;$--){if((function(Tt,wt){return Tt&&wt})($<d,r[$]!==0))for(var X=$+1;X<i;X++){for(var rt=0,B=$+1;B<this.n;B++)rt+=this.V[B][$]*this.V[B][X];rt=-rt/this.V[$+1][$];for(var O=$+1;O<this.n;O++)this.V[O][X]+=rt*this.V[O][$]}for(var H=0;H<this.n;H++)this.V[H][$]=0;this.V[$][$]=1}for(var Z=n-1,tt=Math.pow(2,-52),ht=Math.pow(2,-966);n>0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),Ct=this.s[ut]/Et,Dt=it/Et;this.s[ut]=Et,ut!==J&&(it=-Dt*r[ut-1],r[ut-1]=Ct*r[ut-1]);for(var mt=0;mt<this.n;mt++)Et=Ct*this.V[mt][ut]+Dt*this.V[mt][n-1],this.V[mt][n-1]=-Dt*this.V[mt][ut]+Ct*this.V[mt][n-1],this.V[mt][ut]=Et}}break;case 2:{var Ot=r[J-1];r[J-1]=0;for(var Rt=J;Rt<n;Rt++){var Ht=v.hypot(this.s[Rt],Ot),Ut=this.s[Rt]/Ht,Pt=Ot/Ht;this.s[Rt]=Ht,Ot=-Pt*r[Rt],r[Rt]=Ut*r[Rt];for(var Ft=0;Ft<this.m;Ft++)Ht=Ut*this.U[Ft][Rt]+Pt*this.U[Ft][J-1],this.U[Ft][J-1]=-Pt*this.U[Ft][Rt]+Ut*this.U[Ft][J-1],this.U[Ft][Rt]=Ht}}break;case 3:{var Yt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[n-1]),Math.abs(this.s[n-2])),Math.abs(r[n-2])),Math.abs(this.s[J])),Math.abs(r[J])),Vt=this.s[n-1]/Yt,P=this.s[n-2]/Yt,U=r[n-2]/Yt,k=this.s[J]/Yt,K=r[J]/Yt,q=((P+Vt)*(P-Vt)+U*U)/2,at=Vt*U*(Vt*U),gt=0;(function(Tt,wt){return Tt||wt})(q!==0,at!==0)&&(gt=Math.sqrt(q*q+at),q<0&&(gt=-gt),gt=at/(q+gt));for(var nt=(k+Vt)*(k-Vt)+gt,et=k*K,j=J;j<n-1;j++){var dt=v.hypot(nt,et),Mt=nt/dt,pt=et/dt;j!==J&&(r[j-1]=dt),nt=Mt*this.s[j]+pt*r[j],r[j]=Mt*r[j]-pt*this.s[j],et=pt*this.s[j+1],this.s[j+1]=Mt*this.s[j+1];for(var xt=0;xt<this.n;xt++)dt=Mt*this.V[xt][j]+pt*this.V[xt][j+1],this.V[xt][j+1]=-pt*this.V[xt][j]+Mt*this.V[xt][j+1],this.V[xt][j]=dt;if(dt=v.hypot(nt,et),Mt=nt/dt,pt=et/dt,this.s[j]=dt,nt=Mt*r[j]+pt*this.s[j+1],this.s[j+1]=-pt*r[j]+Mt*this.s[j+1],et=pt*r[j+1],r[j+1]=Mt*r[j+1],j<this.m-1)for(var lt=0;lt<this.m;lt++)dt=Mt*this.U[lt][j]+pt*this.U[lt][j+1],this.U[lt][j+1]=-pt*this.U[lt][j]+Mt*this.U[lt][j+1],this.U[lt][j]=dt}r[n-2]=nt}break;case 4:{if(this.s[J]<=0){this.s[J]=this.s[J]<0?-this.s[J]:0;for(var ot=0;ot<=Z;ot++)this.V[ot][J]=-this.V[ot][J]}for(;J<Z&&!(this.s[J]>=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,J<this.n-1)for(var ft=0;ft<this.n;ft++)Lt=this.V[ft][J+1],this.V[ft][J+1]=this.V[ft][J],this.V[ft][J]=Lt;if(J<this.m-1)for(var st=0;st<this.m;st++)Lt=this.U[st][J+1],this.U[st][J+1]=this.U[st][J],this.U[st][J]=Lt;J++}n--}break}}var Xt={U:this.U,V:this.V,S:this.s};return Xt},v.hypot=function(l,i){var r=void 0;return Math.abs(l)>Math.abs(i)?(r=i/l,r=Math.abs(l)*Math.sqrt(1+r*r)):i!=0?(r=l/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},w.exports=v}),(function(w,R,T){var v=(function(){function r(a,f){for(var e=0;e<f.length;e++){var d=f[e];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(a,f,e){return f&&r(a.prototype,f),e&&r(a,e),a}})();function l(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}var i=(function(){function r(a,f){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=d,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var o=0;o<this.jMax;o++)this.grid[s][o]=0}this.tracebackGrid=new Array(this.iMax);for(var c=0;c<this.iMax;c++){this.tracebackGrid[c]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.tracebackGrid[c][h]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(r,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var d=1;d<this.iMax;d++)for(var t=1;t<this.jMax;t++){var s=void 0;this.sequence1[d-1]===this.sequence2[t-1]?s=this.grid[d-1][t-1]+this.match_score:s=this.grid[d-1][t-1]+this.mismatch_penalty;var o=this.grid[d-1][t]+this.gap_penalty,c=this.grid[d][t-1]+this.gap_penalty,h=[s,o,c],N=this.arrayAllMaxIndexes(h);this.grid[d][t]=h[N[0]],this.tracebackGrid[d][t]=[N.includes(0),N.includes(1),N.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var e=f[0],d=this.tracebackGrid[e.pos[0]][e.pos[1]];d[0]&&f.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),d[1]&&f.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),d[2]&&f.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),e.pos[0]===0&&e.pos[1]===0&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,e){for(var d=[],t=-1;(t=f.indexOf(e,t+1))!==-1;)d.push(t);return d}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),r})();w.exports=i}),(function(w,R,T){var v=function(){};v.FDLayout=T(18),v.FDLayoutConstants=T(4),v.FDLayoutEdge=T(19),v.FDLayoutNode=T(20),v.DimensionD=T(21),v.HashMap=T(22),v.HashSet=T(23),v.IGeometry=T(8),v.IMath=T(9),v.Integer=T(10),v.Point=T(12),v.PointD=T(5),v.RandomSeed=T(16),v.RectangleD=T(13),v.Transform=T(17),v.UniqueIDGeneretor=T(14),v.Quicksort=T(25),v.LinkedList=T(11),v.LGraphObject=T(2),v.LGraph=T(6),v.LEdge=T(1),v.LGraphManager=T(7),v.LNode=T(3),v.Layout=T(15),v.LayoutConstants=T(0),v.NeedlemanWunsch=T(27),v.Matrix=T(24),v.SVD=T(26),w.exports=v}),(function(w,R,T){function v(){this.listeners=[]}var l=v.prototype;l.addListener=function(i,r){this.listeners.push({event:i,callback:r})},l.removeListener=function(i,r){for(var a=this.listeners.length;a>=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},l.emit=function(i,r){for(var a=0;a<this.listeners.length;a++){var f=this.listeners[a];i===f.event&&f.callback(r)}},w.exports=v})])})})(fe)),fe.exports}var pr=le.exports,Oe;function yr(){return Oe||(Oe=1,(function(x,M){(function(R,T){x.exports=T(vr())})(pr,function(w){return(()=>{var R={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var d in f)e[d]=f[d];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var d in f)e[d]=f[d];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var d in f)e[d]=f[d];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var d in f)e[d]=f[d];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),d=a(880),t=a(991),s=a(767),o=a(806),c=a(902),h=a(551).FDLayoutConstants,N=a(551).LayoutConstants,g=a(551).Point,u=a(551).PointD,L=a(551).DimensionD,F=a(551).Layout,C=a(551).Integer,G=a(551).IGeometry,V=a(551).LGraph,Y=a(551).Transform,z=a(551).LinkedList;function A(){f.call(this),this.toBeTiled={},this.constraints={}}A.prototype=Object.create(f.prototype);for(var _ in f)A[_]=f[_];A.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},A.prototype.newGraph=function(n){return new d(null,this.graphManager,n)},A.prototype.newNode=function(n){return new t(this.graphManager,n)},A.prototype.newEdge=function(n){return new s(null,null,n)},A.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=h.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=h.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=h.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},A.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/h.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},A.prototype.layout=function(){var n=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},A.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(S){return E.has(S)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},A.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%h.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},A.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p<n.length;p++){var m=n[p].rect,y=n[p].id;E[y]={id:y,x:m.getCenterX(),y:m.getCenterY(),w:m.width,h:m.height}}return E},A.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var n=!1;if(h.ANIMATE==="during")this.emit("layoutstarted");else{for(;!n;)n=this.tick();this.graphManager.updateBounds()}},A.prototype.moveNodes=function(){for(var n=this.getAllNodes(),E,p=0;p<n.length;p++)E=n[p],E.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var p=0;p<n.length;p++)E=n[p],E.move()},A.prototype.initConstraintVariables=function(){var n=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var E=this.graphManager.getAllNodes(),p=0;p<E.length;p++){var m=E[p];this.idToNodeMap.set(m.id,m)}var y=function O(H){for(var Z=H.getChild().getNodes(),tt,ht=0,J=0;J<Z.length;J++)tt=Z[J],tt.getChild()==null?n.fixedNodeSet.has(tt.id)&&(ht+=100):ht+=O(tt);return ht};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(Z){n.fixedNodeSet.add(Z.nodeId)});for(var E=this.graphManager.getAllNodes(),m,p=0;p<E.length;p++)if(m=E[p],m.getChild()!=null){var S=y(m);S>0&&(m.fixedNodeWeight=S)}}if(this.constraints.relativePlacementConstraint){var D=new Map,b=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p<W.length;p++)this.dummyToNodeForVerticalAlignment.set("dummy"+p,[]),W[p].forEach(function(H){D.set(H,"dummy"+p),n.dummyToNodeForVerticalAlignment.get("dummy"+p).push(H),n.fixedNodeSet.has(H)&&n.fixedNodesOnHorizontal.add("dummy"+p)});if(this.constraints.alignmentConstraint.horizontal)for(var I=this.constraints.alignmentConstraint.horizontal,p=0;p<I.length;p++)this.dummyToNodeForHorizontalAlignment.set("dummy"+p,[]),I[p].forEach(function(H){b.set(H,"dummy"+p),n.dummyToNodeForHorizontalAlignment.get("dummy"+p).push(H),n.fixedNodeSet.has(H)&&n.fixedNodesOnVertical.add("dummy"+p)})}if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(O){var H,Z,tt;for(tt=O.length-1;tt>=2*O.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),Z=O[tt],O[tt]=O[H],O[H]=Z;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(Z)||(n.nodesInRelativeHorizontal.push(Z),n.nodeToRelativeConstraintMapHorizontal.set(Z,[]),n.dummyToNodeForVerticalAlignment.has(Z)?n.nodeToTempPositionMapHorizontal.set(Z,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(Z,n.idToNodeMap.get(Z).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:Z,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:H,gap:O.gap})}else{var tt=b.has(O.top)?b.get(O.top):O.top,ht=b.has(O.bottom)?b.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:O.gap})}});else{var Q=new Map,$=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var H=D.has(O.left)?D.get(O.left):O.left,Z=D.has(O.right)?D.get(O.right):O.right;Q.has(H)?Q.get(H).push(Z):Q.set(H,[Z]),Q.has(Z)?Q.get(Z).push(H):Q.set(Z,[H])}else{var tt=b.has(O.top)?b.get(O.top):O.top,ht=b.has(O.bottom)?b.get(O.bottom):O.bottom;$.has(tt)?$.get(tt).push(ht):$.set(tt,[ht]),$.has(ht)?$.get(ht).push(tt):$.set(ht,[tt])}});var X=function(H,Z){var tt=[],ht=[],J=new z,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),Z.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(Ct){It.has(Ct)||(J.push(Ct),It.add(Ct),tt[Nt].push(Ct))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var B=X($,n.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},A.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var O=n.idToNodeMap.get(B.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p<E.length;p++){for(var m=0,y=0;y<E[p].length;y++){if(this.fixedNodeSet.has(E[p][y])){m=0;break}m+=this.idToNodeMap.get(E[p][y]).displacementX}for(var S=m/E[p].length,y=0;y<E[p].length;y++)this.idToNodeMap.get(E[p][y]).displacementX=S}if(this.constraints.alignmentConstraint.horizontal)for(var D=this.constraints.alignmentConstraint.horizontal,p=0;p<D.length;p++){for(var b=0,y=0;y<D[p].length;y++){if(this.fixedNodeSet.has(D[p][y])){b=0;break}b+=this.idToNodeMap.get(D[p][y]).displacementY}for(var W=b/D[p].length,y=0;y<D[p].length;y++)this.idToNodeMap.get(D[p][y]).displacementY=W}}if(this.constraints.relativePlacementConstraint)if(o.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(B){if(!n.fixedNodesOnHorizontal.has(B)){var O=0;n.dummyToNodeForVerticalAlignment.has(B)?O=n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(B)[0]).displacementX:O=n.idToNodeMap.get(B).displacementX,n.nodeToRelativeConstraintMapHorizontal.get(B).forEach(function(H){if(H.right){var Z=n.nodeToTempPositionMapHorizontal.get(H.right)-n.nodeToTempPositionMapHorizontal.get(B)-O;Z<H.gap&&(O-=H.gap-Z)}else{var Z=n.nodeToTempPositionMapHorizontal.get(B)-n.nodeToTempPositionMapHorizontal.get(H.left)+O;Z<H.gap&&(O+=H.gap-Z)}}),n.nodeToTempPositionMapHorizontal.set(B,n.nodeToTempPositionMapHorizontal.get(B)+O),n.dummyToNodeForVerticalAlignment.has(B)?n.dummyToNodeForVerticalAlignment.get(B).forEach(function(H){n.idToNodeMap.get(H).displacementX=O}):n.idToNodeMap.get(B).displacementX=O}}),this.nodesInRelativeVertical.forEach(function(B){if(!n.fixedNodesOnHorizontal.has(B)){var O=0;n.dummyToNodeForHorizontalAlignment.has(B)?O=n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(B)[0]).displacementY:O=n.idToNodeMap.get(B).displacementY,n.nodeToRelativeConstraintMapVertical.get(B).forEach(function(H){if(H.bottom){var Z=n.nodeToTempPositionMapVertical.get(H.bottom)-n.nodeToTempPositionMapVertical.get(B)-O;Z<H.gap&&(O-=H.gap-Z)}else{var Z=n.nodeToTempPositionMapVertical.get(B)-n.nodeToTempPositionMapVertical.get(H.top)+O;Z<H.gap&&(O+=H.gap-Z)}}),n.nodeToTempPositionMapVertical.set(B,n.nodeToTempPositionMapVertical.get(B)+O),n.dummyToNodeForHorizontalAlignment.has(B)?n.dummyToNodeForHorizontalAlignment.get(B).forEach(function(H){n.idToNodeMap.get(H).displacementY=O}):n.idToNodeMap.get(B).displacementY=O}});else{for(var p=0;p<this.componentsOnHorizontal.length;p++){var I=this.componentsOnHorizontal[p];if(this.fixedComponentsOnHorizontal[p])for(var y=0;y<I.length;y++)this.dummyToNodeForVerticalAlignment.has(I[y])?this.dummyToNodeForVerticalAlignment.get(I[y]).forEach(function(H){n.idToNodeMap.get(H).displacementX=0}):this.idToNodeMap.get(I[y]).displacementX=0;else{for(var Q=0,$=0,y=0;y<I.length;y++)if(this.dummyToNodeForVerticalAlignment.has(I[y])){var X=this.dummyToNodeForVerticalAlignment.get(I[y]);Q+=X.length*this.idToNodeMap.get(X[0]).displacementX,$+=X.length}else Q+=this.idToNodeMap.get(I[y]).displacementX,$++;for(var rt=Q/$,y=0;y<I.length;y++)this.dummyToNodeForVerticalAlignment.has(I[y])?this.dummyToNodeForVerticalAlignment.get(I[y]).forEach(function(H){n.idToNodeMap.get(H).displacementX=rt}):this.idToNodeMap.get(I[y]).displacementX=rt}}for(var p=0;p<this.componentsOnVertical.length;p++){var I=this.componentsOnVertical[p];if(this.fixedComponentsOnVertical[p])for(var y=0;y<I.length;y++)this.dummyToNodeForHorizontalAlignment.has(I[y])?this.dummyToNodeForHorizontalAlignment.get(I[y]).forEach(function(Z){n.idToNodeMap.get(Z).displacementY=0}):this.idToNodeMap.get(I[y]).displacementY=0;else{for(var Q=0,$=0,y=0;y<I.length;y++)if(this.dummyToNodeForHorizontalAlignment.has(I[y])){var X=this.dummyToNodeForHorizontalAlignment.get(I[y]);Q+=X.length*this.idToNodeMap.get(X[0]).displacementY,$+=X.length}else Q+=this.idToNodeMap.get(I[y]).displacementY,$++;for(var rt=Q/$,y=0;y<I.length;y++)this.dummyToNodeForHorizontalAlignment.has(I[y])?this.dummyToNodeForHorizontalAlignment.get(I[y]).forEach(function(J){n.idToNodeMap.get(J).displacementY=rt}):this.idToNodeMap.get(I[y]).displacementY=rt}}}},A.prototype.calculateNodesToApplyGravitationTo=function(){var n=[],E,p=this.graphManager.getGraphs(),m=p.length,y;for(y=0;y<m;y++)E=p[y],E.updateConnected(),E.isConnected||(n=n.concat(E.getNodes()));return n},A.prototype.createBendpoints=function(){var n=[];n=n.concat(this.graphManager.getAllEdges());var E=new Set,p;for(p=0;p<n.length;p++){var m=n[p];if(!E.has(m)){var y=m.getSource(),S=m.getTarget();if(y==S)m.getBendpoints().push(new u),m.getBendpoints().push(new u),this.createDummyNodesForBendpoints(m),E.add(m);else{var D=[];if(D=D.concat(y.getEdgeListToNode(S)),D=D.concat(S.getEdgeListToNode(y)),!E.has(D[0])){if(D.length>1){var b;for(b=0;b<D.length;b++){var W=D[b];W.getBendpoints().push(new u),this.createDummyNodesForBendpoints(W)}}D.forEach(function(I){E.add(I)})}}}if(E.size==n.length)break}},A.prototype.positionNodesRadially=function(n){for(var E=new g(0,0),p=Math.ceil(Math.sqrt(n.length)),m=0,y=0,S=0,D=new u(0,0),b=0;b<n.length;b++){b%p==0&&(S=0,y=m,b!=0&&(y+=o.DEFAULT_COMPONENT_SEPERATION),m=0);var W=n[b],I=F.findCenterOfTree(W);E.x=S,E.y=y,D=A.radialLayout(W,I,E),D.y>m&&(m=Math.floor(D.y)),S=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new u(N.WORLD_CENTER_X-D.x/2,N.WORLD_CENTER_Y-D.y/2))},A.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(E,null,0,359,0,m);var y=V.calculateBounds(n),S=new Y;S.setDeviceOrgX(y.getMinX()),S.setDeviceOrgY(y.getMinY()),S.setWorldOrgX(p.x),S.setWorldOrgY(p.y);for(var D=0;D<n.length;D++){var b=n[D];b.transform(S)}var W=new u(y.getMaxX(),y.getMaxY());return S.inverseTransformPoint(W)},A.branchRadialLayout=function(n,E,p,m,y,S){var D=(m-p+1)/2;D<0&&(D+=180);var b=(D+p)%360,W=b*G.TWO_PI/360,I=y*Math.cos(W),Q=y*Math.sin(W);n.setCenter(I,Q);var $=[];$=$.concat(n.getEdges());var X=$.length;E!=null&&X--;for(var rt=0,B=$.length,O,H=n.getEdgesBetween(E);H.length>1;){var Z=H[0];H.splice(0,1);var tt=$.indexOf(Z);tt>=0&&$.splice(tt,1),B--,X--}E!=null?O=($.indexOf(H[0])+1)%B:O=0;for(var ht=Math.abs(m-p)/X,J=O;rt!=X;J=++J%B){var It=$[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;A.branchRadialLayout(It,n,Nt,vt,y+S,S),rt++}}},A.maxDiagonalInTree=function(n){for(var E=C.MIN_VALUE,p=0;p<n.length;p++){var m=n[p],y=m.getDiagonal();y>E&&(E=y)}return E},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y<m.length;y++){var S=m[y],D=S.getParent();this.getNodeDegreeWithChildren(S)===0&&(D.id==null||!this.getToBeTiled(D))&&p.push(S)}for(var y=0;y<p.length;y++){var S=p[y],b=S.getParent().id;typeof E[b]>"u"&&(E[b]=[]),E[b]=E[b].concat(S)}Object.keys(E).forEach(function(W){if(E[W].length>1){var I="DummyCompound_"+W;n.memberGroups[I]=E[W];var Q=E[W][0].getParent(),$=new t(n.graphManager);$.id=I,$.paddingLeft=Q.paddingLeft||0,$.paddingRight=Q.paddingRight||0,$.paddingBottom=Q.paddingBottom||0,$.paddingTop=Q.paddingTop||0,n.idToDummyNode[I]=$;var X=n.getGraphManager().add(n.newGraph(),$),rt=Q.getChild();rt.add($);for(var B=0;B<E[W].length;B++){var O=E[W][B];rt.remove(O),X.add(O)}}})},A.prototype.clearCompounds=function(){var n={},E={};this.performDFSOnCompounds();for(var p=0;p<this.compoundOrder.length;p++)E[this.compoundOrder[p].id]=this.compoundOrder[p],n[this.compoundOrder[p].id]=[].concat(this.compoundOrder[p].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[p].getChild()),this.compoundOrder[p].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(n,E)},A.prototype.clearZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(p){var m=n.idToDummyNode[p];if(E[p]=n.tileNodes(n.memberGroups[p],m.paddingLeft+m.paddingRight),m.rect.width=E[p].width,m.rect.height=E[p].height,m.setCenter(E[p].centerX,E[p].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var y=m.rect.width,S=m.rect.height;m.labelWidth&&(m.labelPosHorizontal=="left"?(m.rect.x-=m.labelWidth,m.setWidth(y+m.labelWidth),m.labelMarginLeft=m.labelWidth):m.labelPosHorizontal=="center"&&m.labelWidth>y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(S+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>S?(m.rect.y-=(m.labelHeight-S)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-S)/2):m.labelPosVertical=="bottom"&&m.setHeight(S+m.labelHeight))}})},A.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,S=E.labelMarginLeft,D=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,S,D)}},A.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,S=m.paddingTop,D=m.labelMarginLeft,b=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,S,D,b)})},A.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y<m.length;y++){var S=m[y];if(this.getNodeDegree(S)>0)return this.toBeTiled[E]=!1,!1;if(S.getChild()==null){this.toBeTiled[S.id]=!1;continue}if(!this.getToBeTiled(S))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},A.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;m<E.length;m++){var y=E[m];y.getSource().id!==y.getTarget().id&&(p=p+1)}return p},A.prototype.getNodeDegreeWithChildren=function(n){var E=this.getNodeDegree(n);if(n.getChild()==null)return E;for(var p=n.getChild().getNodes(),m=0;m<p.length;m++){var y=p[m];E+=this.getNodeDegreeWithChildren(y)}return E},A.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},A.prototype.fillCompexOrderByDFS=function(n){for(var E=0;E<n.length;E++){var p=n[E];p.getChild()!=null&&this.fillCompexOrderByDFS(p.getChild().getNodes()),this.getToBeTiled(p)&&this.compoundOrder.push(p)}},A.prototype.adjustLocations=function(n,E,p,m,y,S,D){E+=m+S,p+=y+D;for(var b=E,W=0;W<n.rows.length;W++){var I=n.rows[W];E=b;for(var Q=0,$=0;$<I.length;$++){var X=I[$];X.rect.x=E,X.rect.y=p,E+=X.rect.width+n.horizontalPadding,X.rect.height>Q&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},A.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var S=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(S+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>S?(y.rect.x-=(y.labelWidth-S)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-S)/2):y.labelPosHorizontal=="right"&&y.setWidth(S+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},A.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),S=this.getOrgRatio(m),D;return S<y?D=m:D=p,D},A.prototype.getOrgRatio=function(n){var E=n.width,p=n.height,m=E/p;return m<1&&(m=1/m),m},A.prototype.calcIdealRowWidth=function(n,E){var p=o.TILING_PADDING_VERTICAL,m=o.TILING_PADDING_HORIZONTAL,y=n.length,S=0,D=0,b=0;n.forEach(function(B){S+=B.getWidth(),D+=B.getHeight(),B.getWidth()>b&&(b=B.getWidth())});var W=S/y,I=D/y,Q=Math.pow(p-m,2)+4*(W+m)*(I+p)*y,$=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil($),X==$&&X++):X=Math.floor($);var rt=X*(W+m)-m;return b>rt&&(rt=b),rt+=m*2,rt},A.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,S=o.TILING_COMPARE_BY,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};S&&(D.idealRowWidth=this.calcIdealRowWidth(n,p));var b=function(O){return O.rect.width*O.rect.height},W=function(O,H){return b(H)-b(O)};n.sort(function(B,O){var H=W;return D.idealRowWidth?(H=S,H(B.id,O.id)):H(B,O)});for(var I=0,Q=0,$=0;$<n.length;$++){var X=n[$];I+=X.getCenterX(),Q+=X.getCenterY()}D.centerX=I/n.length,D.centerY=Q/n.length;for(var $=0;$<n.length;$++){var X=n[$];if(D.rows.length==0)this.insertNodeToRow(D,X,0,E);else if(this.canAddHorizontal(D,X.rect.width,X.rect.height)){var rt=D.rows.length-1;D.idealRowWidth||(rt=this.getShortestRowIndex(D)),this.insertNodeToRow(D,X,rt,E)}else this.insertNodeToRow(D,X,D.rows.length,E);this.shiftToLastRow(D)}return D},A.prototype.insertNodeToRow=function(n,E,p,m){var y=m;if(p==n.rows.length){var S=[];n.rows.push(S),n.rowWidth.push(y),n.rowHeight.push(0)}var D=n.rowWidth[p]+E.rect.width;n.rows[p].length>0&&(D+=n.horizontalPadding),n.rowWidth[p]=D,n.width<D&&(n.width=D);var b=E.rect.height;p>0&&(b+=n.verticalPadding);var W=0;b>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=b,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},A.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;m<n.rows.length;m++)n.rowWidth[m]<p&&(E=m,p=n.rowWidth[m]);return E},A.prototype.getLongestRowIndex=function(n){for(var E=-1,p=Number.MIN_VALUE,m=0;m<n.rows.length;m++)n.rowWidth[m]>p&&(E=m,p=n.rowWidth[m]);return E},A.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var S=this.getShortestRowIndex(n);if(S<0)return!0;var D=n.rowWidth[S];if(D+n.horizontalPadding+E<=n.width)return!0;var b=0;n.rowHeight[S]<p&&S>0&&(b=p+n.verticalPadding-n.rowHeight[S]);var W;n.width-D>=E+n.horizontalPadding?W=(n.height+b)/(D+E+n.horizontalPadding):W=(n.height+b)/n.width,b=p+n.verticalPadding;var I;return n.width<E?I=(n.height+b)/E:I=(n.height+b)/n.width,I<1&&(I=1/I),W<1&&(W=1/W),W<I},A.prototype.shiftToLastRow=function(n){var E=this.getLongestRowIndex(n),p=n.rowWidth.length-1,m=n.rows[E],y=m[m.length-1],S=y.width+n.horizontalPadding;if(n.width-n.rowWidth[p]>S&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-S,n.rowWidth[p]=n.rowWidth[p]+S,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var D=Number.MIN_VALUE,b=0;b<m.length;b++)m[b].height>D&&(D=m[b].height);E>0&&(D+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=D,n.rowHeight[p]<y.height+n.verticalPadding&&(n.rowHeight[p]=y.height+n.verticalPadding);var I=n.rowHeight[E]+n.rowHeight[p];n.height+=I-W,this.shiftToLastRow(n)}},A.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},A.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},A.prototype.reduceTrees=function(){for(var n=[],E=!0,p;E;){var m=this.graphManager.getAllNodes(),y=[];E=!1;for(var S=0;S<m.length;S++)if(p=m[S],p.getEdges().length==1&&!p.getEdges()[0].isInterGraph&&p.getChild()==null){if(o.PURE_INCREMENTAL){var D=p.getEdges()[0].getOtherEnd(p),b=new L(p.getCenterX()-D.getCenterX(),p.getCenterY()-D.getCenterY());y.push([p,p.getEdges()[0],p.getOwner(),b])}else y.push([p,p.getEdges()[0],p.getOwner()]);E=!0}if(E==!0){for(var W=[],I=0;I<y.length;I++)y[I][0].getEdges().length==1&&(W.push(y[I]),y[I][0].getOwner().remove(y[I][0]));n.push(W),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=n},A.prototype.growTree=function(n){for(var E=n.length,p=n[E-1],m,y=0;y<p.length;y++)m=p[y],this.findPlaceforPrunedNode(m),m[2].add(m[0]),m[2].add(m[1],m[1].source,m[1].target);n.splice(n.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},A.prototype.findPlaceforPrunedNode=function(n){var E,p,m=n[0];if(m==n[1].source?p=n[1].target:p=n[1].source,o.PURE_INCREMENTAL)m.setCenter(p.getCenterX()+n[3].getWidth(),p.getCenterY()+n[3].getHeight());else{var y=p.startX,S=p.finishX,D=p.startY,b=p.finishY,W=0,I=0,Q=0,$=0,X=[W,Q,I,$];if(D>0)for(var rt=y;rt<=S;rt++)X[0]+=this.grid[rt][D-1].length+this.grid[rt][D].length-1;if(S<this.grid.length-1)for(var rt=D;rt<=b;rt++)X[1]+=this.grid[S+1][rt].length+this.grid[S][rt].length-1;if(b<this.grid[0].length-1)for(var rt=y;rt<=S;rt++)X[2]+=this.grid[rt][b+1].length+this.grid[rt][b].length-1;if(y>0)for(var rt=D;rt<=b;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var B=C.MAX_VALUE,O,H,Z=0;Z<X.length;Z++)X[Z]<B?(B=X[Z],O=1,H=Z):X[Z]==B&&O++;if(O==3&&B==0)X[0]==0&&X[1]==0&&X[2]==0?E=1:X[0]==0&&X[1]==0&&X[3]==0?E=0:X[0]==0&&X[2]==0&&X[3]==0?E=3:X[1]==0&&X[2]==0&&X[3]==0&&(E=2);else if(O==2&&B==0){var tt=Math.floor(Math.random()*2);X[0]==0&&X[1]==0?tt==0?E=0:E=1:X[0]==0&&X[2]==0?tt==0?E=0:E=2:X[0]==0&&X[3]==0?tt==0?E=0:E=3:X[1]==0&&X[2]==0?tt==0?E=1:E=2:X[1]==0&&X[3]==0?tt==0?E=1:E=3:tt==0?E=2:E=3}else if(O==4&&B==0){var tt=Math.floor(Math.random()*4);E=tt}else E=H;E==0?m.setCenter(p.getCenterX(),p.getCenterY()-p.getHeight()/2-h.DEFAULT_EDGE_LENGTH-m.getHeight()/2):E==1?m.setCenter(p.getCenterX()+p.getWidth()/2+h.DEFAULT_EDGE_LENGTH+m.getWidth()/2,p.getCenterY()):E==2?m.setCenter(p.getCenterX(),p.getCenterY()+p.getHeight()/2+h.DEFAULT_EDGE_LENGTH+m.getHeight()/2):m.setCenter(p.getCenterX()-p.getWidth()/2-h.DEFAULT_EDGE_LENGTH-m.getWidth()/2,p.getCenterY())}},i.exports=A}),991:((i,r,a)=>{var f=a(551).FDLayoutNode,e=a(551).IMath;function d(s,o,c,h){f.call(this,s,o,c,h)}d.prototype=Object.create(f.prototype);for(var t in f)d[t]=f[t];d.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},d.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),h,N=0;N<c.length;N++)h=c[N],h.getChild()==null?(h.displacementX+=s,h.displacementY+=o):h.propogateDisplacementToChildren(s,o)},d.prototype.move=function(){var s=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),s.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},d.prototype.setPred1=function(s){this.pred1=s},d.prototype.getPred1=function(){return pred1},d.prototype.getPred2=function(){return pred2},d.prototype.setNext=function(s){this.next=s},d.prototype.getNext=function(){return next},d.prototype.setProcessed=function(s){this.processed=s},d.prototype.isProcessed=function(){return processed},i.exports=d}),902:((i,r,a)=>{function f(c){if(Array.isArray(c)){for(var h=0,N=Array(c.length);h<c.length;h++)N[h]=c[h];return N}else return Array.from(c)}var e=a(806),d=a(551).LinkedList,t=a(551).Matrix,s=a(551).SVD;function o(){}o.handleConstraints=function(c){var h={};h.fixedNodeConstraint=c.constraints.fixedNodeConstraint,h.alignmentConstraint=c.constraints.alignmentConstraint,h.relativePlacementConstraint=c.constraints.relativePlacementConstraint;for(var N=new Map,g=new Map,u=[],L=[],F=c.getAllNodes(),C=0,G=0;G<F.length;G++){var V=F[G];V.getChild()==null&&(g.set(V.id,C++),u.push(V.getCenterX()),L.push(V.getCenterY()),N.set(V.id,V))}h.relativePlacementConstraint&&h.relativePlacementConstraint.forEach(function(P){!P.gap&&P.gap!=0&&(P.left?P.gap=e.DEFAULT_EDGE_LENGTH+N.get(P.left).getWidth()/2+N.get(P.right).getWidth()/2:P.gap=e.DEFAULT_EDGE_LENGTH+N.get(P.top).getHeight()/2+N.get(P.bottom).getHeight()/2)});var Y=function(U,k){return{x:U.x-k.x,y:U.y-k.y}},z=function(U){var k=0,K=0;return U.forEach(function(q){k+=u[g.get(q)],K+=L[g.get(q)]}),{x:k/U.size,y:K/U.size}},A=function(U,k,K,q,at){function gt(lt,ot){var Lt=new Set(lt),ft=!0,st=!1,Xt=void 0;try{for(var Tt=ot[Symbol.iterator](),wt;!(ft=(wt=Tt.next()).done);ft=!0){var $t=wt.value;Lt.add($t)}}catch(bt){st=!0,Xt=bt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}return Lt}var nt=new Map;U.forEach(function(lt,ot){nt.set(ot,0)}),U.forEach(function(lt,ot){lt.forEach(function(Lt){nt.set(Lt.id,nt.get(Lt.id)+1)})});var et=new Map,j=new Map,dt=new d;nt.forEach(function(lt,ot){lt==0?(dt.push(ot),K||(k=="horizontal"?et.set(ot,g.has(ot)?u[g.get(ot)]:q.get(ot)):et.set(ot,g.has(ot)?L[g.get(ot)]:q.get(ot)))):et.set(ot,Number.NEGATIVE_INFINITY),K&&j.set(ot,new Set([ot]))}),K&&at.forEach(function(lt){var ot=[];if(lt.forEach(function(st){K.has(st)&&ot.push(st)}),ot.length>0){var Lt=0;ot.forEach(function(st){k=="horizontal"?(et.set(st,g.has(st)?u[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?L[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){k=="horizontal"?ft+=g.has(st)?u[g.get(st)]:q.get(st):ft+=g.has(st)?L[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var Mt=function(){var ot=dt.shift(),Lt=U.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)<et.get(ot)+ft.gap)if(K&&K.has(ft.id)){var st=void 0;if(k=="horizontal"?st=g.has(ft.id)?u[g.get(ft.id)]:q.get(ft.id):st=g.has(ft.id)?L[g.get(ft.id)]:q.get(ft.id),et.set(ft.id,st),st<et.get(ot)+ft.gap){var Xt=et.get(ot)+ft.gap-st;j.get(ot).forEach(function(Tt){et.set(Tt,et.get(Tt)-Xt)})}}else et.set(ft.id,et.get(ot)+ft.gap);nt.set(ft.id,nt.get(ft.id)-1),nt.get(ft.id)==0&&dt.push(ft.id),K&&j.set(ft.id,gt(j.get(ot),j.get(ft.id)))})};dt.length!=0;)Mt();if(K){var pt=new Set;U.forEach(function(lt,ot){lt.length==0&&pt.add(ot)});var xt=[];j.forEach(function(lt,ot){if(pt.has(ot)){var Lt=!1,ft=!0,st=!1,Xt=void 0;try{for(var Tt=lt[Symbol.iterator](),wt;!(ft=(wt=Tt.next()).done);ft=!0){var $t=wt.value;K.has($t)&&(Lt=!0)}}catch(St){st=!0,Xt=St}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}if(!Lt){var bt=!1,zt=void 0;xt.forEach(function(St,Zt){St.has([].concat(f(lt))[0])&&(bt=!0,zt=Zt)}),bt?lt.forEach(function(St){xt[zt].add(St)}):xt.push(new Set(lt))}}}),xt.forEach(function(lt,ot){var Lt=Number.POSITIVE_INFINITY,ft=Number.POSITIVE_INFINITY,st=Number.NEGATIVE_INFINITY,Xt=Number.NEGATIVE_INFINITY,Tt=!0,wt=!1,$t=void 0;try{for(var bt=lt[Symbol.iterator](),zt;!(Tt=(zt=bt.next()).done);Tt=!0){var St=zt.value,Zt=void 0;k=="horizontal"?Zt=g.has(St)?u[g.get(St)]:q.get(St):Zt=g.has(St)?L[g.get(St)]:q.get(St);var Kt=et.get(St);Zt<Lt&&(Lt=Zt),Zt>st&&(st=Zt),Kt<ft&&(ft=Kt),Kt>Xt&&(Xt=Kt)}}catch(ee){wt=!0,$t=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(wt)throw $t}}var ce=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),oe;!(Qt=(oe=Jt.next()).done);Qt=!0){var te=oe.value;et.set(te,et.get(te)+ce)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(U){var k=0,K=0,q=0,at=0;if(U.forEach(function(j){j.left?u[g.get(j.left)]-u[g.get(j.right)]>=0?k++:K++:L[g.get(j.top)]-L[g.get(j.bottom)]>=0?q++:at++}),k>K&&q>at)for(var gt=0;gt<g.size;gt++)u[gt]=-1*u[gt],L[gt]=-1*L[gt];else if(k>K)for(var nt=0;nt<g.size;nt++)u[nt]=-1*u[nt];else if(q>at)for(var et=0;et<g.size;et++)L[et]=-1*L[et]},n=function(U){var k=[],K=new d,q=new Set,at=0;return U.forEach(function(gt,nt){if(!q.has(nt)){k[at]=[];var et=nt;for(K.push(et),q.add(et),k[at].push(et);K.length!=0;){et=K.shift();var j=U.get(et);j.forEach(function(dt){q.has(dt.id)||(K.push(dt.id),q.add(dt.id),k[at].push(dt.id))})}at++}}),k},E=function(U){var k=new Map;return U.forEach(function(K,q){k.set(q,[])}),U.forEach(function(K,q){K.forEach(function(at){k.get(q).push(at),k.get(at.id).push({id:q,gap:at.gap,direction:at.direction})})}),k},p=function(U){var k=new Map;return U.forEach(function(K,q){k.set(q,[])}),U.forEach(function(K,q){K.forEach(function(at){k.get(at.id).push({id:q,gap:at.gap,direction:at.direction})})}),k},m=[],y=[],S=!1,D=!1,b=new Set,W=new Map,I=new Map,Q=[];if(h.fixedNodeConstraint&&h.fixedNodeConstraint.forEach(function(P){b.add(P.nodeId)}),h.relativePlacementConstraint&&(h.relativePlacementConstraint.forEach(function(P){P.left?(W.has(P.left)?W.get(P.left).push({id:P.right,gap:P.gap,direction:"horizontal"}):W.set(P.left,[{id:P.right,gap:P.gap,direction:"horizontal"}]),W.has(P.right)||W.set(P.right,[])):(W.has(P.top)?W.get(P.top).push({id:P.bottom,gap:P.gap,direction:"vertical"}):W.set(P.top,[{id:P.bottom,gap:P.gap,direction:"vertical"}]),W.has(P.bottom)||W.set(P.bottom,[]))}),I=E(W),Q=n(I)),e.TRANSFORM_ON_CONSTRAINT_HANDLING){if(h.fixedNodeConstraint&&h.fixedNodeConstraint.length>1)h.fixedNodeConstraint.forEach(function(P,U){m[U]=[P.position.x,P.position.y],y[U]=[u[g.get(P.nodeId)],L[g.get(P.nodeId)]]}),S=!0;else if(h.alignmentConstraint)(function(){var P=0;if(h.alignmentConstraint.vertical){for(var U=h.alignmentConstraint.vertical,k=function(et){var j=new Set;U[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return b.has(pt)})),Mt=void 0;dt.size>0?Mt=u[g.get(dt.values().next().value)]:Mt=z(j).x,U[et].forEach(function(pt){m[P]=[Mt,L[g.get(pt)]],y[P]=[u[g.get(pt)],L[g.get(pt)]],P++})},K=0;K<U.length;K++)k(K);S=!0}if(h.alignmentConstraint.horizontal){for(var q=h.alignmentConstraint.horizontal,at=function(et){var j=new Set;q[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return b.has(pt)})),Mt=void 0;dt.size>0?Mt=u[g.get(dt.values().next().value)]:Mt=z(j).y,q[et].forEach(function(pt){m[P]=[u[g.get(pt)],Mt],y[P]=[u[g.get(pt)],L[g.get(pt)]],P++})},gt=0;gt<q.length;gt++)at(gt);S=!0}h.relativePlacementConstraint&&(D=!0)})();else if(h.relativePlacementConstraint){for(var $=0,X=0,rt=0;rt<Q.length;rt++)Q[rt].length>$&&($=Q[rt].length,X=rt);if($<I.size/2)_(h.relativePlacementConstraint),S=!1,D=!1;else{var B=new Map,O=new Map,H=[];Q[X].forEach(function(P){W.get(P).forEach(function(U){U.direction=="horizontal"?(B.has(P)?B.get(P).push(U):B.set(P,[U]),B.has(U.id)||B.set(U.id,[]),H.push({left:P,right:U.id})):(O.has(P)?O.get(P).push(U):O.set(P,[U]),O.has(U.id)||O.set(U.id,[]),H.push({top:P,bottom:U.id}))})}),_(H),D=!1;var Z=A(B,"horizontal"),tt=A(O,"vertical");Q[X].forEach(function(P,U){y[U]=[u[g.get(P)],L[g.get(P)]],m[U]=[],Z.has(P)?m[U][0]=Z.get(P):m[U][0]=u[g.get(P)],tt.has(P)?m[U][1]=tt.get(P):m[U][1]=L[g.get(P)]}),S=!0}}if(S){for(var ht=void 0,J=t.transpose(m),It=t.transpose(y),Nt=0;Nt<J.length;Nt++)J[Nt]=t.multGamma(J[Nt]),It[Nt]=t.multGamma(It[Nt]);var vt=t.multMat(J,t.transpose(It)),it=s.svd(vt);ht=t.multMat(it.V,t.transpose(it.U));for(var ut=0;ut<g.size;ut++){var Et=[u[ut],L[ut]],Ct=[ht[0][0],ht[1][0]],Dt=[ht[0][1],ht[1][1]];u[ut]=t.dotProduct(Et,Ct),L[ut]=t.dotProduct(Et,Dt)}D&&_(h.relativePlacementConstraint)}}if(e.ENFORCE_CONSTRAINTS){if(h.fixedNodeConstraint&&h.fixedNodeConstraint.length>0){var mt={x:0,y:0};h.fixedNodeConstraint.forEach(function(P,U){var k={x:u[g.get(P.nodeId)],y:L[g.get(P.nodeId)]},K=P.position,q=Y(K,k);mt.x+=q.x,mt.y+=q.y}),mt.x/=h.fixedNodeConstraint.length,mt.y/=h.fixedNodeConstraint.length,u.forEach(function(P,U){u[U]+=mt.x}),L.forEach(function(P,U){L[U]+=mt.y}),h.fixedNodeConstraint.forEach(function(P){u[g.get(P.nodeId)]=P.position.x,L[g.get(P.nodeId)]=P.position.y})}if(h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var Ot=h.alignmentConstraint.vertical,Rt=function(U){var k=new Set;Ot[U].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return b.has(at)})),q=void 0;K.size>0?q=u[g.get(K.values().next().value)]:q=z(k).x,k.forEach(function(at){b.has(at)||(u[g.get(at)]=q)})},Ht=0;Ht<Ot.length;Ht++)Rt(Ht);if(h.alignmentConstraint.horizontal)for(var Ut=h.alignmentConstraint.horizontal,Pt=function(U){var k=new Set;Ut[U].forEach(function(at){k.add(at)});var K=new Set([].concat(f(k)).filter(function(at){return b.has(at)})),q=void 0;K.size>0?q=L[g.get(K.values().next().value)]:q=z(k).y,k.forEach(function(at){b.has(at)||(L[g.get(at)]=q)})},Ft=0;Ft<Ut.length;Ft++)Pt(Ft)}h.relativePlacementConstraint&&(function(){var P=new Map,U=new Map,k=new Map,K=new Map,q=new Map,at=new Map,gt=new Set,nt=new Set;if(b.forEach(function(Gt){gt.add(Gt),nt.add(Gt)}),h.alignmentConstraint){if(h.alignmentConstraint.vertical)for(var et=h.alignmentConstraint.vertical,j=function(yt){k.set("dummy"+yt,[]),et[yt].forEach(function(At){P.set(At,"dummy"+yt),k.get("dummy"+yt).push(At),b.has(At)&&gt.add("dummy"+yt)}),q.set("dummy"+yt,u[g.get(et[yt][0])])},dt=0;dt<et.length;dt++)j(dt);if(h.alignmentConstraint.horizontal)for(var Mt=h.alignmentConstraint.horizontal,pt=function(yt){K.set("dummy"+yt,[]),Mt[yt].forEach(function(At){U.set(At,"dummy"+yt),K.get("dummy"+yt).push(At),b.has(At)&&nt.add("dummy"+yt)}),at.set("dummy"+yt,L[g.get(Mt[yt][0])])},xt=0;xt<Mt.length;xt++)pt(xt)}var lt=new Map,ot=new Map,Lt=function(yt){W.get(yt).forEach(function(At){var kt=void 0,Bt=void 0;At.direction=="horizontal"?(kt=P.get(yt)?P.get(yt):yt,P.get(At.id)?Bt={id:P.get(At.id),gap:At.gap,direction:At.direction}:Bt=At,lt.has(kt)?lt.get(kt).push(Bt):lt.set(kt,[Bt]),lt.has(Bt.id)||lt.set(Bt.id,[])):(kt=U.get(yt)?U.get(yt):yt,U.get(At.id)?Bt={id:U.get(At.id),gap:At.gap,direction:At.direction}:Bt=At,ot.has(kt)?ot.get(kt).push(Bt):ot.set(kt,[Bt]),ot.has(Bt.id)||ot.set(Bt.id,[]))})},ft=!0,st=!1,Xt=void 0;try{for(var Tt=W.keys()[Symbol.iterator](),wt;!(ft=(wt=Tt.next()).done);ft=!0){var $t=wt.value;Lt($t)}}catch(Gt){st=!0,Xt=Gt}finally{try{!ft&&Tt.return&&Tt.return()}finally{if(st)throw Xt}}var bt=E(lt),zt=E(ot),St=n(bt),Zt=n(zt),Kt=p(lt),ce=p(ot),Qt=[],jt=[];St.forEach(function(Gt,yt){Qt[yt]=[],Gt.forEach(function(At){Kt.get(At).length==0&&Qt[yt].push(At)})}),Zt.forEach(function(Gt,yt){jt[yt]=[],Gt.forEach(function(At){ce.get(At).length==0&&jt[yt].push(At)})});var _t=A(lt,"horizontal",gt,q,Qt),Jt=A(ot,"vertical",nt,at,jt),oe=function(yt){k.get(yt)?k.get(yt).forEach(function(At){u[g.get(At)]=_t.get(yt)}):u[g.get(yt)]=_t.get(yt)},te=!0,ee=!1,Le=void 0;try{for(var ge=_t.keys()[Symbol.iterator](),we;!(te=(we=ge.next()).done);te=!0){var ue=we.value;oe(ue)}}catch(Gt){ee=!0,Le=Gt}finally{try{!te&&ge.return&&ge.return()}finally{if(ee)throw Le}}var ke=function(yt){K.get(yt)?K.get(yt).forEach(function(At){L[g.get(At)]=Jt.get(yt)}):L[g.get(yt)]=Jt.get(yt)},de=!0,Ce=!1,Me=void 0;try{for(var ve=Jt.keys()[Symbol.iterator](),Ae;!(de=(Ae=ve.next()).done);de=!0){var ue=Ae.value;ke(ue)}}catch(Gt){Ce=!0,Me=Gt}finally{try{!de&&ve.return&&ve.return()}finally{if(Ce)throw Me}}})()}for(var Yt=0;Yt<F.length;Yt++){var Vt=F[Yt];Vt.getChild()==null&&Vt.setCenter(u[g.get(Vt.id)],L[g.get(Vt.id)])}},i.exports=o}),551:(i=>{i.exports=w})},T={};function v(i){var r=T[i];if(r!==void 0)return r.exports;var a=T[i]={exports:{}};return R[i](a,a.exports,v),a.exports}var l=v(45);return l})()})})(le)),le.exports}var mr=he.exports,xe;function Er(){return xe||(xe=1,(function(x,M){(function(R,T){x.exports=T(yr())})(mr,function(w){return(()=>{var R={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e<a;e++)f[e-1]=arguments[e];return f.forEach(function(d){Object.keys(d).forEach(function(t){return r[t]=d[t]})}),r}}),548:((i,r,a)=>{var f=(function(){function t(s,o){var c=[],h=!0,N=!1,g=void 0;try{for(var u=s[Symbol.iterator](),L;!(h=(L=u.next()).done)&&(c.push(L.value),!(o&&c.length===o));h=!0);}catch(F){N=!0,g=F}finally{try{!h&&u.return&&u.return()}finally{if(N)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,d={};d.getTopMostNodes=function(t){for(var s={},o=0;o<t.length;o++)s[t[o].id()]=!0;var c=t.filter(function(h,N){typeof h=="number"&&(h=N);for(var g=h.parent()[0];g!=null;){if(s[g.id()])return!1;g=g.parent()[0]}return!0});return c},d.connectComponents=function(t,s,o,c){var h=new e,N=new Set,g=[],u=void 0,L=void 0,F=void 0,C=!1,G=1,V=[],Y=[],z=function(){var _=t.collection();Y.push(_);var n=o[0],E=t.collection();E.merge(n).merge(n.descendants().intersection(s)),g.push(n),E.forEach(function(y){h.push(y),N.add(y),_.merge(y)});for(var p=function(){n=h.shift();var S=t.collection();n.neighborhood().nodes().forEach(function(I){s.intersection(n.edgesWith(I)).length>0&&S.merge(I)});for(var D=0;D<S.length;D++){var b=S[D];if(u=o.intersection(b.union(b.ancestors())),u!=null&&!N.has(u[0])){var W=u.union(u.descendants());W.forEach(function(I){h.push(I),N.add(I),_.merge(I),o.has(I)&&g.push(I)})}}};h.length!=0;)p();if(_.forEach(function(y){s.intersection(y.connectedEdges()).forEach(function(S){_.has(S.source())&&_.has(S.target())&&_.merge(S)})}),g.length==o.length&&(C=!0),!C||C&&G>1){L=g[0],F=L.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length<F&&(F=y.connectedEdges().length,L=y)}),V.push(L.id());var m=t.collection();m.merge(g[0]),g.forEach(function(y){m.merge(y)}),g=[],o=o.difference(m),G++}};do z();while(!C);return c&&V.length>0&&c.set("dummy"+(c.size+1),V),Y},d.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var u=!0,L=!1,F=void 0;try{for(var C=s.nodeIndexes[Symbol.iterator](),G;!(u=(G=C.next()).done);u=!0){var V=G.value,Y=f(V,2),z=Y[0],A=Y[1],_=o.cy.getElementById(z);if(_){var n=_.boundingBox(),E=s.xCoords[A]-n.w/2,p=s.xCoords[A]+n.w/2,m=s.yCoords[A]-n.h/2,y=s.yCoords[A]+n.h/2;E<c&&(c=E),p>h&&(h=p),m<N&&(N=m),y>g&&(g=y)}}}catch(I){L=!0,F=I}finally{try{!u&&C.return&&C.return()}finally{if(L)throw F}}var S=t.x-(h+c)/2,D=t.y-(g+N)/2;s.xCoords=s.xCoords.map(function(I){return I+S}),s.yCoords=s.yCoords.map(function(I){return I+D})}else{Object.keys(s).forEach(function(I){var Q=s[I],$=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,B=Q.getRect().y+Q.getRect().height;$<c&&(c=$),X>h&&(h=X),rt<N&&(N=rt),B>g&&(g=B)});var b=t.x-(h+c)/2,W=t.y-(g+N)/2;Object.keys(s).forEach(function(I){var Q=s[I];Q.setCenter(Q.getCenterX()+b,Q.getCenterY()+W)})}}},d.calcBoundingBox=function(t,s,o,c){for(var h=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,u=Number.MIN_SAFE_INTEGER,L=void 0,F=void 0,C=void 0,G=void 0,V=t.descendants().not(":parent"),Y=V.length,z=0;z<Y;z++){var A=V[z];L=s[c.get(A.id())]-A.width()/2,F=s[c.get(A.id())]+A.width()/2,C=o[c.get(A.id())]-A.height()/2,G=o[c.get(A.id())]+A.height()/2,h>L&&(h=L),N<F&&(N=F),g>C&&(g=C),u<G&&(u=G)}var _={};return _.topLeftX=h,_.topLeftY=g,_.width=N-h,_.height=u-g,_},d.calcParentsWithoutChildren=function(t,s){var o=t.collection();return s.nodes(":parent").forEach(function(c){var h=!1;c.children().forEach(function(N){N.css("display")!="none"&&(h=!0)}),h||o.merge(c)}),o},i.exports=d}),816:((i,r,a)=>{var f=a(548),e=a(140).CoSELayout,d=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,h=a(140).CoSEConstants,N=function(u,L){var F=u.cy,C=u.eles,G=C.nodes(),V=C.edges(),Y=void 0,z=void 0,A=void 0,_={};u.randomize&&(Y=L.nodeIndexes,z=L.xCoords,A=L.yCoords);var n=function(I){return typeof I=="function"},E=function(I,Q){return n(I)?I(Q):I},p=f.calcParentsWithoutChildren(F,C),m=function W(I,Q,$,X){for(var rt=Q.length,B=0;B<rt;B++){var O=Q[B],H=null;O.intersection(p).length==0&&(H=O.children());var Z=void 0,tt=O.layoutDimensions({nodeDimensionsIncludeLabels:X.nodeDimensionsIncludeLabels});if(O.outerWidth()!=null&&O.outerHeight()!=null)if(X.randomize)if(!O.isParent())Z=I.add(new d($.graphManager,new t(z[Y.get(O.id())]-tt.w/2,A[Y.get(O.id())]-tt.h/2),new s(parseFloat(tt.w),parseFloat(tt.h))));else{var ht=f.calcBoundingBox(O,z,A,Y);O.intersection(p).length==0?Z=I.add(new d($.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(ht.width,ht.height))):Z=I.add(new d($.graphManager,new t(ht.topLeftX,ht.topLeftY),new s(parseFloat(tt.w),parseFloat(tt.h))))}else Z=I.add(new d($.graphManager,new t(O.position("x")-tt.w/2,O.position("y")-tt.h/2),new s(parseFloat(tt.w),parseFloat(tt.h))));else Z=I.add(new d(this.graphManager));if(Z.id=O.data("id"),Z.nodeRepulsion=E(X.nodeRepulsion,O),Z.paddingLeft=parseInt(O.css("padding")),Z.paddingTop=parseInt(O.css("padding")),Z.paddingRight=parseInt(O.css("padding")),Z.paddingBottom=parseInt(O.css("padding")),X.nodeDimensionsIncludeLabels&&(Z.labelWidth=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,Z.labelHeight=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,Z.labelPosVertical=O.css("text-valign"),Z.labelPosHorizontal=O.css("text-halign")),_[O.data("id")]=Z,isNaN(Z.rect.x)&&(Z.rect.x=0),isNaN(Z.rect.y)&&(Z.rect.y=0),H!=null&&H.length>0){var J=void 0;J=$.getGraphManager().add($.newGraph(),Z),W(J,H,$,X)}}},y=function(I,Q,$){for(var X=0,rt=0,B=0;B<$.length;B++){var O=$[B],H=_[O.data("source")],Z=_[O.data("target")];if(H&&Z&&H!==Z&&H.getEdgesBetween(Z).length==0){var tt=Q.add(I.newEdge(),H,Z);tt.id=O.id(),tt.idealLength=E(u.idealEdgeLength,O),tt.edgeElasticity=E(u.edgeElasticity,O),X+=tt.idealLength,rt++}}u.idealEdgeLength!=null&&(rt>0?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(u.idealEdgeLength)?h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:h.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=u.idealEdgeLength,h.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,h.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},S=function(I,Q){Q.fixedNodeConstraint&&(I.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(I.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(I.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};u.nestingFactor!=null&&(h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.nestingFactor),u.gravity!=null&&(h.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=u.gravity),u.numIter!=null&&(h.MAX_ITERATIONS=c.MAX_ITERATIONS=u.numIter),u.gravityRange!=null&&(h.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=u.gravityRange),u.gravityCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.gravityCompound),u.gravityRangeCompound!=null&&(h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.gravityRangeCompound),u.initialEnergyOnIncremental!=null&&(h.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.initialEnergyOnIncremental),u.tilingCompareBy!=null&&(h.TILING_COMPARE_BY=u.tilingCompareBy),u.quality=="proof"?o.QUALITY=2:o.QUALITY=0,h.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=u.nodeDimensionsIncludeLabels,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!u.randomize,h.ANIMATE=c.ANIMATE=o.ANIMATE=u.animate,h.TILE=u.tile,h.TILING_PADDING_VERTICAL=typeof u.tilingPaddingVertical=="function"?u.tilingPaddingVertical.call():u.tilingPaddingVertical,h.TILING_PADDING_HORIZONTAL=typeof u.tilingPaddingHorizontal=="function"?u.tilingPaddingHorizontal.call():u.tilingPaddingHorizontal,h.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,h.PURE_INCREMENTAL=!u.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=u.uniformNodeDimensions,u.step=="transformed"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!1),u.step=="enforced"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!1),u.step=="cose"&&(h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!1,h.APPLY_LAYOUT=!0),u.step=="all"&&(u.randomize?h.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:h.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,h.ENFORCE_CONSTRAINTS=!0,h.APPLY_LAYOUT=!0),u.fixedNodeConstraint||u.alignmentConstraint||u.relativePlacementConstraint?h.TREE_REDUCTION_ON_INCREMENTAL=!1:h.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new e,b=D.newGraphManager();return m(b.addRoot(),f.getTopMostNodes(G),D,u),y(D,b,V),S(D,u),D.runLayout(),_};i.exports={coseLayout:N}}),212:((i,r,a)=>{var f=(function(){function u(L,F){for(var C=0;C<F.length;C++){var G=F[C];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(L,G.key,G)}}return function(L,F,C){return F&&u(L.prototype,F),C&&u(L,C),L}})();function e(u,L){if(!(u instanceof L))throw new TypeError("Cannot call a class as a function")}var d=a(658),t=a(548),s=a(657),o=s.spectralLayout,c=a(816),h=c.coseLayout,N=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(L){return 4500},idealEdgeLength:function(L){return 50},edgeElasticity:function(L){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),g=(function(){function u(L){e(this,u),this.options=d({},N,L)}return f(u,[{key:"run",value:function(){var F=this,C=this.options,G=C.cy,V=C.eles,Y=[],z=[],A=void 0,_=[];C.fixedNodeConstraint&&(!Array.isArray(C.fixedNodeConstraint)||C.fixedNodeConstraint.length==0)&&(C.fixedNodeConstraint=void 0),C.alignmentConstraint&&(C.alignmentConstraint.vertical&&(!Array.isArray(C.alignmentConstraint.vertical)||C.alignmentConstraint.vertical.length==0)&&(C.alignmentConstraint.vertical=void 0),C.alignmentConstraint.horizontal&&(!Array.isArray(C.alignmentConstraint.horizontal)||C.alignmentConstraint.horizontal.length==0)&&(C.alignmentConstraint.horizontal=void 0)),C.relativePlacementConstraint&&(!Array.isArray(C.relativePlacementConstraint)||C.relativePlacementConstraint.length==0)&&(C.relativePlacementConstraint=void 0);var n=C.fixedNodeConstraint||C.alignmentConstraint||C.relativePlacementConstraint;n&&(C.tile=!1,C.packComponents=!1);var E=void 0,p=!1;if(G.layoutUtilities&&C.packComponents&&(E=G.layoutUtilities("get"),E||(E=G.layoutUtilities()),p=!0),V.nodes().length>0)if(p){var S=t.getTopMostNodes(C.eles.nodes());if(A=t.connectComponents(G,C.eles,S),A.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),C.randomize&&A.forEach(function(vt){C.eles=vt,Y.push(o(C))}),C.quality=="default"||C.quality=="proof"){var D=G.collection();if(C.tile){var b=new Map,W=[],I=[],Q=0,$={nodeIndexes:b,xCoords:W,yCoords:I},X=[];if(A.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){D.merge(vt.nodes()[Et]),ut.isParent()||($.nodeIndexes.set(vt.nodes()[Et].id(),Q++),$.xCoords.push(vt.nodes()[0].position().x),$.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),D.length>1){var rt=D.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),A.push(D),Y.push($);for(var B=X.length-1;B>=0;B--)A.splice(X[B],1),Y.splice(X[B],1),_.splice(X[B],1)}}A.forEach(function(vt,it){C.eles=vt,z.push(h(C,Y[it])),t.relocateComponent(_[it],z[it],C)})}else A.forEach(function(vt,it){t.relocateComponent(_[it],Y[it],C)});var O=new Set;if(A.length>1){var H=[],Z=V.filter(function(vt){return vt.css("display")=="none"});A.forEach(function(vt,it){var ut=void 0;if(C.quality=="draft"&&(ut=Y[it].nodeIndexes),vt.nodes().not(Z).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;vt.nodes().not(Z).forEach(function(Dt){if(C.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Et.nodes.push({x:Y[it].xCoords[Ct]-Dt.boundingbox().w/2,y:Y[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,Y[it].xCoords,Y[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else z[it][Dt.id()]&&Et.nodes.push({x:z[it][Dt.id()].getLeft(),y:z[it][Dt.id()].getTop(),width:z[it][Dt.id()].getWidth(),height:z[it][Dt.id()].getHeight()})}),vt.edges().forEach(function(Dt){var mt=Dt.source(),Ot=Dt.target();if(mt.css("display")!="none"&&Ot.css("display")!="none")if(C.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Ot.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,Y[it].xCoords,Y[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(Y[it].xCoords[Rt]),Ut.push(Y[it].yCoords[Rt]);if(Ot.isParent()){var Yt=t.calcBoundingBox(Ot,Y[it].xCoords,Y[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(Y[it].xCoords[Ht]),Pt.push(Y[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else z[it][mt.id()]&&z[it][Ot.id()]&&Et.edges.push({startX:z[it][mt.id()].getCenterX(),startY:z[it][mt.id()].getCenterY(),endX:z[it][Ot.id()].getCenterX(),endY:z[it][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),O.add(it))}});var tt=E.packComponents(H,C.randomize).shifts;if(C.quality=="draft")Y.forEach(function(vt,it){var ut=vt.xCoords.map(function(Ct){return Ct+tt[it].dx}),Et=vt.yCoords.map(function(Ct){return Ct+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;O.forEach(function(vt){Object.keys(z[vt]).forEach(function(it){var ut=z[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=C.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),C.randomize){var y=o(C);Y.push(y)}C.quality=="default"||C.quality=="proof"?(z.push(h(C,Y[0])),t.relocateComponent(_[0],z[0],C)):t.relocateComponent(_[0],Y[0],C)}var J=function(it,ut){if(C.quality=="default"||C.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,Ct=void 0,Dt=it.data("id");return z.forEach(function(Ot){Dt in Ot&&(Et={x:Ot[Dt].getRect().getCenterX(),y:Ot[Dt].getRect().getCenterY()},Ct=Ot[Dt])}),C.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return Y.forEach(function(Ot){var Rt=Ot.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Ot.xCoords[Rt],y:Ot.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(C.quality=="default"||C.quality=="proof"||C.randomize){var It=t.calcParentsWithoutChildren(G,V),Nt=V.filter(function(vt){return vt.css("display")=="none"});C.eles=V.not(Nt),V.nodes().not(":parent").not(Nt).layoutPositions(F,C,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),u})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,d=a(140).layoutBase.SVD,t=function(o){var c=o.cy,h=o.eles,N=h.nodes(),g=h.nodes(":parent"),u=new Map,L=new Map,F=new Map,C=[],G=[],V=[],Y=[],z=[],A=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,S=o.samplingType,D=o.nodeSeparation,b=void 0,W=function(){for(var U=0,k=0,K=!1;k<b;){U=Math.floor(Math.random()*E),K=!1;for(var q=0;q<k;q++)if(Y[q]==U){K=!0;break}if(!K)Y[k]=U,k++;else continue}},I=function(U,k,K){for(var q=[],at=0,gt=0,nt=0,et=void 0,j=[],dt=0,Mt=1,pt=0;pt<E;pt++)j[pt]=p;for(q[gt]=U,j[U]=0;gt>=at;){nt=q[at++];for(var xt=C[nt],lt=0;lt<xt.length;lt++)et=L.get(xt[lt]),j[et]==p&&(j[et]=j[nt]+1,q[++gt]=et);A[nt][k]=j[nt]*D}if(K){for(var ot=0;ot<E;ot++)A[ot][k]<z[ot]&&(z[ot]=A[ot][k]);for(var Lt=0;Lt<E;Lt++)z[Lt]>dt&&(dt=z[Lt],Mt=Lt)}return Mt},Q=function(U){var k=void 0;if(U){k=Math.floor(Math.random()*E);for(var q=0;q<E;q++)z[q]=p;for(var at=0;at<b;at++)Y[at]=k,k=I(k,at,U)}else{W();for(var K=0;K<b;K++)I(Y[K],K,U)}for(var gt=0;gt<E;gt++)for(var nt=0;nt<b;nt++)A[gt][nt]*=A[gt][nt];for(var et=0;et<b;et++)_[et]=[];for(var j=0;j<b;j++)for(var dt=0;dt<b;dt++)_[j][dt]=A[Y[dt]][j]},$=function(){for(var U=d.svd(_),k=U.S,K=U.U,q=U.V,at=k[0]*k[0]*k[0],gt=[],nt=0;nt<b;nt++){gt[nt]=[];for(var et=0;et<b;et++)gt[nt][et]=0,nt==et&&(gt[nt][et]=k[nt]/(k[nt]*k[nt]+at/(k[nt]*k[nt])))}n=e.multMat(e.multMat(q,gt),e.transpose(K))},X=function(){for(var U=void 0,k=void 0,K=[],q=[],at=[],gt=[],nt=0;nt<E;nt++)K[nt]=Math.random(),q[nt]=Math.random();K=e.normalize(K),q=e.normalize(q);for(var et=m,j=m,dt=void 0;;){for(var Mt=0;Mt<E;Mt++)at[Mt]=K[Mt];if(K=e.multGamma(e.multL(e.multGamma(at),A,n)),U=e.dotProduct(at,K),K=e.normalize(K),et=e.dotProduct(at,K),dt=Math.abs(et/j),dt<=1+y&&dt>=1)break;j=et}for(var pt=0;pt<E;pt++)at[pt]=K[pt];for(j=m;;){for(var xt=0;xt<E;xt++)gt[xt]=q[xt];if(gt=e.minusOp(gt,e.multCons(at,e.dotProduct(at,gt))),q=e.multGamma(e.multL(e.multGamma(gt),A,n)),k=e.dotProduct(gt,q),q=e.normalize(q),et=e.dotProduct(gt,q),dt=Math.abs(et/j),dt<=1+y&&dt>=1)break;j=et}for(var lt=0;lt<E;lt++)gt[lt]=q[lt];G=e.multCons(at,Math.sqrt(Math.abs(U))),V=e.multCons(gt,Math.sqrt(Math.abs(k)))};f.connectComponents(c,h,f.getTopMostNodes(N),u),g.forEach(function(P){f.connectComponents(c,h,f.getTopMostNodes(P.descendants().intersection(h)),u)});for(var rt=0,B=0;B<N.length;B++)N[B].isParent()||L.set(N[B].id(),rt++);var O=!0,H=!1,Z=void 0;try{for(var tt=u.keys()[Symbol.iterator](),ht;!(O=(ht=tt.next()).done);O=!0){var J=ht.value;L.set(J,rt++)}}catch(P){H=!0,Z=P}finally{try{!O&&tt.return&&tt.return()}finally{if(H)throw Z}}for(var It=0;It<L.size;It++)C[It]=[];g.forEach(function(P){for(var U=P.children().intersection(h);U.nodes(":childless").length==0;)U=U.nodes()[0].children().intersection(h);var k=0,K=U.nodes(":childless")[0].connectedEdges().length;U.nodes(":childless").forEach(function(q,at){q.connectedEdges().length<K&&(K=q.connectedEdges().length,k=at)}),F.set(P.id(),U.nodes(":childless")[k].id())}),N.forEach(function(P){var U=void 0;P.isParent()?U=L.get(F.get(P.id())):U=L.get(P.id()),P.neighborhood().nodes().forEach(function(k){h.intersection(P.edgesWith(k)).length>0&&(k.isParent()?C[U].push(F.get(k.id())):C[U].push(k.id()))})});var Nt=function(U){var k=L.get(U),K=void 0;u.get(U).forEach(function(q){c.getElementById(q).isParent()?K=F.get(q):K=q,C[k].push(K),C[L.get(K)].push(U)})},vt=!0,it=!1,ut=void 0;try{for(var Et=u.keys()[Symbol.iterator](),Ct;!(vt=(Ct=Et.next()).done);vt=!0){var Dt=Ct.value;Nt(Dt)}}catch(P){it=!0,ut=P}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=L.size;var mt=void 0;if(E>2){b=E<o.sampleSize?E:o.sampleSize;for(var Ot=0;Ot<E;Ot++)A[Ot]=[];for(var Rt=0;Rt<b;Rt++)n[Rt]=[];return o.quality=="draft"||o.step=="all"?(Q(S),$(),X(),mt={nodeIndexes:L,xCoords:G,yCoords:V}):(L.forEach(function(P,U){G.push(c.getElementById(U).position("x")),V.push(c.getElementById(U).position("y"))}),mt={nodeIndexes:L,xCoords:G,yCoords:V}),mt}else{var Ht=L.keys(),Ut=c.getElementById(Ht.next().value),Pt=Ut.position(),Ft=Ut.outerWidth();if(G.push(Pt.x),V.push(Pt.y),E==2){var Yt=c.getElementById(Ht.next().value),Vt=Yt.outerWidth();G.push(Pt.x+Ft/2+Vt/2+o.idealEdgeLength),V.push(Pt.y)}return mt={nodeIndexes:L,xCoords:G,yCoords:V},mt}};i.exports={spectralLayout:t}}),579:((i,r,a)=>{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=w})},T={};function v(i){var r=T[i];if(r!==void 0)return r.exports;var a=T[i]={exports:{}};return R[i](a,a.exports,v),a.exports}var l=v(579);return l})()})})(he)),he.exports}var Tr=Er();const Nr=ur(Tr);var Ie={L:"left",R:"right",T:"top",B:"bottom"},Re={L:ct(x=>`${x},${x/2} 0,${x} 0,0`,"L"),R:ct(x=>`0,${x/2} ${x},0 ${x},${x}`,"R"),T:ct(x=>`0,0 ${x},0 ${x/2},${x}`,"T"),B:ct(x=>`${x/2},0 ${x},${x} 0,${x}`,"B")},se={L:ct((x,M)=>x-M+2,"L"),R:ct((x,M)=>x-2,"R"),T:ct((x,M)=>x-M+2,"T"),B:ct((x,M)=>x-2,"B")},Lr=ct(function(x){return Wt(x)?x==="L"?"R":"L":x==="T"?"B":"T"},"getOppositeArchitectureDirection"),Se=ct(function(x){const M=x;return M==="L"||M==="R"||M==="T"||M==="B"},"isArchitectureDirection"),Wt=ct(function(x){const M=x;return M==="L"||M==="R"},"isArchitectureDirectionX"),qt=ct(function(x){const M=x;return M==="T"||M==="B"},"isArchitectureDirectionY"),Ne=ct(function(x,M){const w=Wt(x)&&qt(M),R=qt(x)&&Wt(M);return w||R},"isArchitectureDirectionXY"),wr=ct(function(x){const M=x[0],w=x[1],R=Wt(M)&&qt(w),T=qt(M)&&Wt(w);return R||T},"isArchitecturePairXY"),Cr=ct(function(x){return x!=="LL"&&x!=="RR"&&x!=="TT"&&x!=="BB"},"isValidArchitectureDirectionPair"),ye=ct(function(x,M){const w=`${x}${M}`;return Cr(w)?w:void 0},"getArchitectureDirectionPair"),Mr=ct(function([x,M],w){const R=w[0],T=w[1];return Wt(R)?qt(T)?[x+(R==="L"?-1:1),M+(T==="T"?1:-1)]:[x+(R==="L"?-1:1),M]:Wt(T)?[x+(T==="L"?1:-1),M+(R==="T"?1:-1)]:[x,M+(R==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ar=ct(function(x){return x==="LT"||x==="TL"?[1,1]:x==="BL"||x==="LB"?[1,-1]:x==="BR"||x==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Dr=ct(function(x,M){return Ne(x,M)?"bend":Wt(x)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Or=ct(function(x){return x.type==="service"},"isArchitectureService"),xr=ct(function(x){return x.type==="junction"},"isArchitectureJunction"),Pe=ct((x,M)=>{const[w,R]=[x,M].sort();return`${JSON.stringify(w)}-${JSON.stringify(R)}`},"architectureGroupAlignmentKey"),Ge=ct(x=>x.data(),"edgeData"),ie=ct(x=>x.data(),"nodeData"),Ir=or.architecture,ae,Ue=(ae=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Ke,this.getAccTitle=je,this.setDiagramTitle=_e,this.getDiagramTitle=tr,this.getAccDescription=er,this.setAccDescription=rr,this.clear()}setDiagramId(M){this.diagramId=M}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",ir()}addService({id:M,icon:w,in:R,title:T,iconText:v}){if(this.registeredIds.has(M))throw new Error(`The service id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(R!==void 0){if(M===R)throw new Error(`The service [${M}] cannot be placed within itself`);if(!this.registeredIds.has(R))throw new Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(R)==="node")throw new Error(`The service [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"service",icon:w,iconText:v,title:T,edges:[],in:R})}getServices(){return[...this.nodes.values()].filter(Or)}addJunction({id:M,in:w}){if(this.registeredIds.has(M))throw new Error(`The junction id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(w!==void 0){if(M===w)throw new Error(`The junction [${M}] cannot be placed within itself`);if(!this.registeredIds.has(w))throw new Error(`The junction [${M}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(w)==="node")throw new Error(`The junction [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"junction",edges:[],in:w})}getJunctions(){return[...this.nodes.values()].filter(xr)}getNodes(){return[...this.nodes.values()]}getNode(M){return this.nodes.get(M)??null}addGroup({id:M,icon:w,in:R,title:T}){if(this.registeredIds.has(M))throw new Error(`The group id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(R!==void 0){if(M===R)throw new Error(`The group [${M}] cannot be placed within itself`);if(!this.registeredIds.has(R))throw new Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(R)==="node")throw new Error(`The group [${M}]'s parent is not a group`)}this.registeredIds.set(M,"group"),this.groups.set(M,{id:M,icon:w,title:T,in:R})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:M,rhsId:w,lhsDir:R,rhsDir:T,lhsInto:v,rhsInto:l,lhsGroup:i,rhsGroup:r,title:a}){if(!Se(R))throw new Error(`Invalid direction given for left hand side of edge ${M}--${w}. Expected (L,R,T,B) got ${String(R)}`);if(!Se(T))throw new Error(`Invalid direction given for right hand side of edge ${M}--${w}. Expected (L,R,T,B) got ${String(T)}`);if(!this.nodes.has(M)&&!this.groups.has(M))throw new Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(w)&&!this.groups.has(w))throw new Error(`The right-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes.get(M).in,e=this.nodes.get(w).in;if(i&&f&&e&&f==e)throw new Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&f&&e&&f==e)throw new Error(`The right-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const d={lhsId:M,lhsDir:R,lhsInto:v,lhsGroup:i,rhsId:w,rhsDir:T,rhsInto:l,rhsGroup:r,title:a};this.edges.push(d);const t=this.nodes.get(M),s=this.nodes.get(w);t&&s&&(t.edges.push(this.edges[this.edges.length-1]),s.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(M){if(M.members.length<2)throw new Error(`An align directive requires at least two members; got ${M.members.length}`);const w=new Set;M.members.forEach(R=>{if(this.registeredIds.get(R)!=="node")throw new Error(`align ${M.direction} references [${R}], which is not a service or junction`);if(w.has(R))throw new Error(`align ${M.direction} lists [${R}] more than once`);w.add(R)}),this.layoutHints.push(M)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const M=new Map,w=new Map;for(const[i,r]of this.nodes.entries()){const a=new Map;for(const f of r.edges){const e=this.getNode(f.lhsId)?.in,d=this.getNode(f.rhsId)?.in;if(e&&d&&e!==d){const t=Dr(f.lhsDir,f.rhsDir);t!=="bend"&&M.set(Pe(e,d),t)}if(f.lhsId===i){const t=ye(f.lhsDir,f.rhsDir);t&&a.set(t,f.rhsId)}else{const t=ye(f.rhsDir,f.lhsDir);t&&a.set(t,f.lhsId)}}w.set(i,a)}const R=new Set,T=new Set(w.keys()),v=ct(i=>{const r=new Map([[i,[0,0]]]),a=[i];for(;a.length>0;){const f=a.shift();if(f){R.add(f),T.delete(f);const e=w.get(f);if(!e)throw new Error(`BFS error: adjacency list for id ${f} not found. Please report this as a bug.`);const d=r.get(f);if(!d)throw new Error(`BFS error: position for id ${f} not found in spatial map. Please report this as a bug.`);const[t,s]=d;e.forEach((o,c)=>{R.has(o)||(r.set(o,Mr([t,s],c)),a.push(o))})}}return r},"BFS"),l=[];for(;T.size>0;){const i=T.values().next().value;l.push(v(i))}this.dataStructures={adjList:w,spatialMaps:l,groupAlignments:M}}return this.dataStructures}setElementForId(M,w){this.elements.set(M,w)}getElementById(M){return this.elements.get(M)}getConfig(){return ar({...Ir,...nr().architecture})}getConfigField(M){return this.getConfig()[M]}},ct(ae,"ArchitectureDB"),ae),Rr=ct((x,M)=>{qe(x,M),x.groups.map(w=>M.addGroup(w)),x.services.map(w=>M.addService({...w,type:"service"})),x.junctions.map(w=>M.addJunction({...w,type:"junction"})),x.edges.map(w=>M.addEdge(w)),x.alignments?.map(w=>M.addLayoutHint({direction:w.direction,members:[...w.members]}))},"populateDb"),Ye={parser:{yy:void 0},parse:ct(async x=>{const M=await gr("architecture",x);Fe.debug(M);const w=Ye.parser?.yy;if(!(w instanceof Ue))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Rr(M,w)},"parse")},Sr=ct(x=>`
2
- .edge {
3
- stroke-width: ${x.archEdgeWidth};
4
- stroke: ${x.archEdgeColor};
5
- fill: none;
6
- }
7
-
8
- .arrow {
9
- fill: ${x.archEdgeArrowColor};
10
- }
11
-
12
- .node-bkg {
13
- fill: none;
14
- stroke: ${x.archGroupBorderColor};
15
- stroke-width: ${x.archGroupBorderWidth};
16
- stroke-dasharray: 8;
17
- }
18
- .node-icon-text {
19
- display: flex;
20
- align-items: center;
21
- }
22
-
23
- .node-icon-text > div {
24
- color: #fff;
25
- margin: 1px;
26
- height: fit-content;
27
- text-align: center;
28
- overflow: hidden;
29
- display: -webkit-box;
30
- -webkit-box-orient: vertical;
31
- }
32
- `,"getStyles"),Fr=Sr;function me(x,M){if(x===0)return M();const w=Math.random;let R=x>>>0;Math.random=function(){R=R+1831565813>>>0;let T=R;return T=Math.imul(T^T>>>15,T|1),T^=T+Math.imul(T^T>>>7,T|61),((T^T>>>14)>>>0)/4294967296};try{return M()}finally{Math.random=w}}ct(me,"withSeededRandom");var re=ct(x=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${x}</g>`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('<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:re('<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:re('<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:re('<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:re('<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:cr,blank:{body:re("")}}},br=ct(async function(x,M,w,R){const T=w.getConfigField("padding"),v=w.getConfigField("iconSize"),l=v/2,i=v/6,r=i/2;await Promise.all(M.edges().map(async a=>{const{source:f,sourceDir:e,sourceArrow:d,sourceGroup:t,target:s,targetDir:o,targetArrow:c,targetGroup:h,label:N}=Ge(a);let{x:g,y:u}=a[0].sourceEndpoint();const{x:L,y:F}=a[0].midpoint();let{x:C,y:G}=a[0].targetEndpoint();const V=T+4;if(t&&(Wt(e)?g+=e==="L"?-V:V:u+=e==="T"?-V:V+18),h&&(Wt(o)?C+=o==="L"?-V:V:G+=o==="T"?-V:V+18),!t&&w.getNode(f)?.type==="junction"&&(Wt(e)?g+=e==="L"?l:-l:u+=e==="T"?l:-l),!h&&w.getNode(s)?.type==="junction"&&(Wt(o)?C+=o==="L"?l:-l:G+=o==="T"?l:-l),a[0]._private.rscratch){const Y=x.insert("g");if(Y.insert("path").attr("d",`M ${g},${u} L ${L},${F} L${C},${G} `).attr("class","edge").attr("id",`${R}-${lr(f,s,{prefix:"L"})}`),d){const z=Wt(e)?se[e](g,i):g-r,A=qt(e)?se[e](u,i):u-r;Y.insert("polygon").attr("points",Re[e](i)).attr("transform",`translate(${z},${A})`).attr("class","arrow")}if(c){const z=Wt(o)?se[o](C,i):C-r,A=qt(o)?se[o](G,i):G-r;Y.insert("polygon").attr("points",Re[o](i)).attr("transform",`translate(${z},${A})`).attr("class","arrow")}if(N){const z=Ne(e,o)?"XY":Wt(e)?"X":"Y";let A=0;z==="X"?A=Math.abs(g-C):z==="Y"?A=Math.abs(u-G)/1.5:A=Math.abs(g-C)/2;const _=Y.append("g");if(await Te(_,N,{useHtmlLabels:!1,width:A,classes:"architecture-service-label"},Ee()),_.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),z==="X")_.attr("transform","translate("+L+", "+F+")");else if(z==="Y")_.attr("transform","translate("+L+", "+F+") rotate(-90)");else if(z==="XY"){const n=ye(e,o);if(n&&wr(n)){const E=_.node().getBoundingClientRect(),[p,m]=Ar(n);_.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*m*45})`);const y=_.node().getBoundingClientRect();_.attr("transform",`
33
- translate(${L}, ${F-E.height/2})
34
- translate(${p*y.width/2}, ${m*y.height/2})
35
- rotate(${-1*p*m*45}, 0, ${E.height/2})
36
- `)}}}}}))},"drawEdges"),Pr=ct(async function(x,M,w,R){const v=w.getConfigField("padding")*.75,l=w.getConfigField("fontSize"),r=w.getConfigField("iconSize")/2;await Promise.all(M.nodes().map(async a=>{const f=ie(a);if(f.type==="group"){const{h:e,w:d,x1:t,y1:s}=a.boundingBox(),o=x.append("rect");o.attr("id",`${R}-group-${f.id}`).attr("x",t+r).attr("y",s+r).attr("width",d).attr("height",e).attr("class","node-bkg");const c=x.append("g");let h=t,N=s;if(f.icon){const g=c.append("g");g.html(`<g>${await pe(f.icon,{height:v,width:v,fallbackPrefix:ne.prefix})}</g>`),g.attr("transform","translate("+(h+r+1)+", "+(N+r+1)+")"),h+=v,N+=l/2-1-2}if(f.label){const g=c.append("g");await Te(g,f.label,{useHtmlLabels:!1,width:d,classes:"architecture-service-label"},Ee()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(h+r+4)+", "+(N+r+2)+")")}w.setElementForId(f.id,o)}}))},"drawGroups"),Gr=ct(async function(x,M,w,R){const T=Ee();for(const v of w){const l=M.append("g"),i=x.getConfigField("iconSize");if(v.title){const e=l.append("g");await Te(e,v.title,{useHtmlLabels:!1,width:i*1.5,classes:"architecture-service-label"},T),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+i/2+", "+i+")")}const r=l.append("g");if(v.icon)r.html(`<g>${await pe(v.icon,{height:i,width:i,fallbackPrefix:ne.prefix})}</g>`);else if(v.iconText){r.html(`<g>${await pe("blank",{height:i,width:i,fallbackPrefix:ne.prefix})}</g>`);const t=r.append("g").append("foreignObject").attr("width",i).attr("height",i).append("div").attr("class","node-icon-text").attr("style",`height: ${i}px;`).append("div").html(sr(v.iconText,T)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((i-2)/s)};`)}else r.append("path").attr("class","node-bkg").attr("id",`${R}-node-${v.id}`).attr("d",`M0,${i} V5 Q0,0 5,0 H${i-5} Q${i},0 ${i},5 V${i} Z`);l.attr("id",`${R}-service-${v.id}`).attr("class","architecture-service");const{width:a,height:f}=l.node().getBBox();v.width=a,v.height=f,x.setElementForId(v.id,l)}return 0},"drawServices"),Ur=ct(function(x,M,w,R){w.forEach(T=>{const v=M.append("g"),l=x.getConfigField("iconSize");v.append("g").append("rect").attr("id",`${R}-node-${T.id}`).attr("fill-opacity","0").attr("width",l).attr("height",l),v.attr("class","architecture-junction");const{width:r,height:a}=v._groups[0][0].getBBox();v.width=r,v.height=a,x.setElementForId(T.id,v)})},"drawJunctions");fr([{name:ne.prefix,icons:ne}]);be.use(Nr);function Xe(x,M,w){x.forEach(R=>{M.add({group:"nodes",data:{type:"service",id:R.id,icon:R.icon,label:R.title,parent:R.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-service"})})}ct(Xe,"addServices");function He(x,M,w){x.forEach(R=>{M.add({group:"nodes",data:{type:"junction",id:R.id,parent:R.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-junction"})})}ct(He,"addJunctions");function We(x,M){M.nodes().map(w=>{const R=ie(w);if(R.type==="group")return;R.x=w.position().x,R.y=w.position().y,x.getElementById(R.id).attr("transform","translate("+(R.x||0)+","+(R.y||0)+")")})}ct(We,"positionNodes");function Ve(x,M){x.forEach(w=>{M.add({group:"nodes",data:{type:"group",id:w.id,icon:w.icon,label:w.title,parent:w.in},classes:"node-group"})})}ct(Ve,"addGroups");function ze(x,M){x.forEach(w=>{const{lhsId:R,rhsId:T,lhsInto:v,lhsGroup:l,rhsInto:i,lhsDir:r,rhsDir:a,rhsGroup:f,title:e}=w,d=Ne(w.lhsDir,w.rhsDir)?"segments":"straight",t={id:`${R}-${T}`,label:e,source:R,sourceDir:r,sourceArrow:v,sourceGroup:l,sourceEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%",target:T,targetDir:a,targetArrow:i,targetGroup:f,targetEndpoint:a==="L"?"0 50%":a==="R"?"100% 50%":a==="T"?"50% 0":"50% 100%"};M.add({group:"edges",data:t,classes:d})})}ct(ze,"addEdges");function $e(x,M,w,R=[]){const T=ct((d,t)=>{const s=new Map;for(const[o,c]of d.entries()){const h=`${o}`;let N=0;const g=[...c.entries()];if(g.length===1){s.set(h,g[0][1]);continue}for(let u=0;u<g.length-1;u++)for(let L=u+1;L<g.length;L++){const[F,C]=g[u],[G,V]=g[L];if(w.get(Pe(F,G))===t)s.set(h,[...s.get(h)??[],...C,...V]);else if(F==="default"||G==="default")s.set(h,[...s.get(h)??[],...C,...V]);else{const z=`${h}-${N++}`;s.set(z,C);const A=`${h}-${N++}`;s.set(A,V)}}}return s},"flattenAlignments"),v=M.map(d=>{const t=new Map,s=new Map;return d.forEach(([o,c],h)=>{const N=x.getNode(h)?.in??"default",g=t.get(c)??new Map;t.has(c)||t.set(c,g);const u=s.get(o)??new Map;s.has(o)||s.set(o,u);for(const L of[g,u]){const F=L.get(N)??[];L.has(N)||L.set(N,F),F.push(h)}}),{horiz:[...T(t,"horizontal").values()].filter(o=>o.length>1),vert:[...T(s,"vertical").values()].filter(o=>o.length>1)}}),[l,i]=v.reduce(([d,t],{horiz:s,vert:o})=>[[...d,...s],[...t,...o]],[[],[]]),r=new Set;R.forEach(d=>d.members.forEach(t=>r.add(t)));const a=ct(d=>d.filter(t=>!t.some(s=>r.has(s))),"dropOverlapping"),f=a(l),e=a(i);return R.forEach(d=>{d.members.length<2||(d.direction==="row"?f.push([...d.members]):e.push([...d.members]))}),{horizontal:f,vertical:e}}ct($e,"getAlignments");function Be(x,M,w=[]){const R=[],T=M.getConfigField("iconSize"),v=M.getConfigField("idealEdgeLengthMultiplier"),l=v*T,i=new Set;w.forEach(f=>{for(let e=0;e<f.members.length-1;e++){const d=f.members[e],t=f.members[e+1];i.add(`${d}|${t}`),i.add(`${t}|${d}`),f.direction==="row"?R.push({left:d,right:t,gap:l}):R.push({top:d,bottom:t,gap:l})}});const r=ct(f=>`${f[0]},${f[1]}`,"posToStr"),a=ct(f=>f.split(",").map(e=>parseInt(e)),"strToPos");return x.forEach(f=>{const e=new Map([...f.entries()].map(([o,c])=>[r(c),o])),d=[r([0,0])],t={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;d.length>0;){const o=d.shift();if(o){t[o]=1;const c=e.get(o);if(c){const h=a(o);Object.entries(s).forEach(([N,g])=>{const u=r([h[0]+g[0],h[1]+g[1]]),L=e.get(u);if(L&&!t[u]){if(d.push(u),i.has(`${c}|${L}`))return;R.push({[Ie[N]]:L,[Ie[Lr(N)]]:c,gap:v*T})}})}}}}),R}ct(Be,"getRelativeConstraints");function Ze(x,M,w,R,T,{spatialMaps:v,groupAlignments:l}){return new Promise(i=>{const r=hr("body").append("div").attr("id","cy").attr("style","display:none"),a=be({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${T.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:`${T.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});r.remove(),Ve(w,a),Xe(x,a,T),He(M,a,T),ze(R,a);const f=T.getLayoutHints(),e=$e(T,v,l,f),d=Be(v,T,f),t=T.getConfigField("iconSize"),s=T.getConfigField("idealEdgeLengthMultiplier")*t,o=.5*t,c=T.getConfigField("edgeElasticity"),h=T.getConfigField("seed"),N=a.layout({name:"fcose",quality:"proof",randomize:T.getConfigField("randomize"),nodeSeparation:T.getConfigField("nodeSeparation"),numIter:T.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(g){const[u,L]=g.connectedNodes(),{parent:F}=ie(u),{parent:C}=ie(L);return F===C?s:o},edgeElasticity(g){const[u,L]=g.connectedNodes(),{parent:F}=ie(u),{parent:C}=ie(L);return F===C?c:.001},alignmentConstraint:e,relativePlacementConstraint:d});N.one("layoutstop",()=>{function g(u,L,F,C){let G,V;const{x:Y,y:z}=u,{x:A,y:_}=L;V=(C-z+(Y-F)*(z-_)/(Y-A))/Math.sqrt(1+Math.pow((z-_)/(Y-A),2)),G=Math.sqrt(Math.pow(C-z,2)+Math.pow(F-Y,2)-Math.pow(V,2));const n=Math.sqrt(Math.pow(A-Y,2)+Math.pow(_-z,2));G=G/n;let E=(A-Y)*(C-z)-(_-z)*(F-Y);switch(!0){case E>=0:E=1;break;case E<0:E=-1;break}let p=(A-Y)*(F-Y)+(_-z)*(C-z);switch(!0){case p>=0:p=1;break;case p<0:p=-1;break}return V=Math.abs(V)*E,G=G*p,{distances:V,weights:G}}ct(g,"getSegmentWeights"),a.startBatch();for(const u of Object.values(a.edges()))if(u.data?.()){const{x:L,y:F}=u.source().position(),{x:C,y:G}=u.target().position();if(L!==C&&F!==G){const V=u.sourceEndpoint(),Y=u.targetEndpoint(),{sourceDir:z}=Ge(u),[A,_]=qt(z)?[V.x,Y.y]:[Y.x,V.y],{weights:n,distances:E}=g(V,Y,A,_);u.style("segment-distances",E),u.style("segment-weights",n)}}a.endBatch(),me(h,()=>N.run())});try{me(h,()=>N.run())}catch(g){throw g instanceof RangeError&&g.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):g}a.ready(g=>{Fe.info("Ready",g),i(a)})})}ct(Ze,"layoutArchitecture");var Yr=ct(async(x,M,w,R)=>{const T=R.db;T.setDiagramId(M);const v=T.getServices(),l=T.getJunctions(),i=T.getGroups(),r=T.getEdges(),a=T.getDataStructures(),f=Qe(M),e=f.append("g");e.attr("class","architecture-edges");const d=f.append("g");d.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await Gr(T,d,v,M),Ur(T,d,l,M);const s=await Ze(v,l,i,r,T,a);await br(e,s,T,M),await Pr(t,s,T,M),We(T,s),Je(void 0,f,T.getConfigField("padding"),T.getConfigField("useMaxWidth"))},"draw"),Xr={draw:Yr},Br={parser:Ye,get db(){return new Ue},renderer:Xr,styles:Fr};export{Br as diagram};