pmx-canvas 0.11.0 → 0.12.1

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 (300) hide show
  1. package/.github/extensions/pmx-canvas/extension.mjs +4 -1
  2. package/.github/extensions/pmx-canvas/runtime.json +1 -1
  3. package/.github/extensions/pmx-canvas/tools.json +440 -18
  4. package/CHANGELOG.md +51 -0
  5. package/dist/amp-plugin/pmx-canvas/LICENSE +21 -0
  6. package/dist/amp-plugin/pmx-canvas/THIRD_PARTY_LICENSES.txt +331 -0
  7. package/dist/amp-plugin/pmx-canvas/index.js +5445 -0
  8. package/dist/amp-plugin/pmx-canvas/runtime.json +3 -0
  9. package/dist/amp-plugin/pmx-canvas/shared-runtime.mjs +194 -0
  10. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/SKILL.md +267 -0
  11. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/evals.json +1168 -0
  12. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/jwt.ts +17 -0
  13. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/login.ts +12 -0
  14. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/middleware.ts +13 -0
  15. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/routes/auth.ts +13 -0
  16. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/investigation-board/src/handlers/users.ts +27 -0
  17. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/mcp.json +36 -0
  18. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/ax-html-control-surface.md +101 -0
  19. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/codex-app-adapter.md +151 -0
  20. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/excalidraw-diagram-authoring.md +150 -0
  21. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/full-reference.md +1839 -0
  22. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/github-copilot-app-adapter.md +223 -0
  23. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/html-primitives.md +139 -0
  24. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/importing-context.md +132 -0
  25. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/installing-pmx-canvas.md +301 -0
  26. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/tours-and-recording.md +117 -0
  27. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/workbench-workflows.md +908 -0
  28. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas-orchestration/SKILL.md +141 -0
  29. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas-testing/SKILL.md +266 -0
  30. package/dist/amp-plugin/pmx-canvas/start-mcp.mjs +14857 -0
  31. package/dist/amp-plugin/pmx-canvas/tools.json +10963 -0
  32. package/dist/canvas/chunks/{abnfDiagram-N423BO3Z-p8dtp6va.js → abnfDiagram-N423BO3Z-cwtsds5d.js} +1 -1
  33. package/dist/canvas/chunks/architecture-TIHT7OUA-x63cwejs.js +1 -0
  34. package/dist/canvas/chunks/{architectureDiagram-T3A2C74G-5jhmxrzf.js → architectureDiagram-T3A2C74G-b4xc9tpz.js} +3 -3
  35. package/dist/canvas/chunks/{blockDiagram-VBNYF7ZC-pw1fa9yb.js → blockDiagram-VBNYF7ZC-ahp3yxxs.js} +7 -7
  36. package/dist/canvas/chunks/{c4Diagram-5PPSVZJV-x07nq0tt.js → c4Diagram-5PPSVZJV-nappnay7.js} +4 -4
  37. package/dist/canvas/chunks/classDiagram-JCYQIIEL-k1j2xc1t.js +1 -0
  38. package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-33x08xf2.js +1 -0
  39. package/dist/canvas/chunks/{cose-bilkent-JH36ORCC-nm39npq0.js → cose-bilkent-JH36ORCC-a428syda.js} +1 -1
  40. package/dist/canvas/chunks/cynefin-VYW2F7L2-8v6jxfz8.js +1 -0
  41. package/dist/canvas/chunks/{cynefinDiagram-MW4NZA55-vdxrwahz.js → cynefinDiagram-MW4NZA55-nspsqebj.js} +1 -1
  42. package/dist/canvas/chunks/{dagre-VZM6K2ZE-bqdm7wpd.js → dagre-VZM6K2ZE-8y6177fh.js} +2 -2
  43. package/dist/canvas/chunks/{diagram-7IWD3JNH-gs5gpr93.js → diagram-7IWD3JNH-vym028wn.js} +4 -4
  44. package/dist/canvas/chunks/{diagram-B4RE2ZJO-cgwjg47s.js → diagram-B4RE2ZJO-jddqb8sy.js} +1 -1
  45. package/dist/canvas/chunks/{diagram-LBJQPF4R-w3vahpav.js → diagram-LBJQPF4R-bjwbpkrn.js} +1 -1
  46. package/dist/canvas/chunks/{diagram-Q27KOJAE-42837z6h.js → diagram-Q27KOJAE-j6ph6hcx.js} +2 -2
  47. package/dist/canvas/chunks/{diagram-UB23O5K3-4fz83q59.js → diagram-UB23O5K3-p09w8jej.js} +1 -1
  48. package/dist/canvas/chunks/{ebnfDiagram-BXEA7PRR-zphtgegj.js → ebnfDiagram-BXEA7PRR-j975ycq5.js} +1 -1
  49. package/dist/canvas/chunks/{erDiagram-JOGREHBK-zvbbdxp4.js → erDiagram-JOGREHBK-sxp6hjn8.js} +5 -5
  50. package/dist/canvas/chunks/eventmodeling-45OFAUF4-xzfgn6xg.js +1 -0
  51. package/dist/canvas/chunks/flowDiagram-UKHOOZJN-2nsmkskb.js +1 -0
  52. package/dist/canvas/chunks/{ganttDiagram-PKOTCBZU-282jzycm.js → ganttDiagram-PKOTCBZU-4tv230y2.js} +2 -2
  53. package/dist/canvas/chunks/gitGraph-TEB2WS4Q-macbhand.js +1 -0
  54. package/dist/canvas/chunks/{gitGraphDiagram-DS77QQ5N-vqqy6p1b.js → gitGraphDiagram-DS77QQ5N-mqgmnw9g.js} +1 -1
  55. package/dist/canvas/chunks/{index-wgv7en21.js → index-037z5dz2.js} +2 -2
  56. package/dist/canvas/chunks/{index-w2mra17t.js → index-081n3har.js} +1 -1
  57. package/dist/canvas/chunks/{index-353m7b0p.js → index-5n03dmb9.js} +1 -1
  58. package/dist/canvas/chunks/{index-yw8h9vha.js → index-60pgzdqe.js} +1 -1
  59. package/dist/canvas/chunks/index-8g1vb57n.js +2 -0
  60. package/dist/canvas/chunks/{index-vv56h019.js → index-8rjes9r6.js} +1 -1
  61. package/dist/canvas/chunks/{index-nprm96xp.js → index-9022d1n9.js} +1 -1
  62. package/dist/canvas/chunks/{index-194m3hc3.js → index-9b02042t.js} +1 -1
  63. package/dist/canvas/chunks/{index-0rk4gp1g.js → index-ap4q4vez.js} +1 -1
  64. package/dist/canvas/chunks/{index-rh7nv68n.js → index-dyp2nhd3.js} +1 -1
  65. package/dist/canvas/chunks/index-frvta4tm.js +2 -0
  66. package/dist/canvas/chunks/{index-s4j678gj.js → index-h9ycj8n2.js} +1 -1
  67. package/dist/canvas/chunks/{index-fjtdggjn.js → index-mergmj97.js} +2 -2
  68. package/dist/canvas/chunks/index-nwsya6dj.js +301 -0
  69. package/dist/canvas/chunks/{index-3cy1bzwh.js → index-nz8qbd1p.js} +1 -1
  70. package/dist/canvas/chunks/{index-d3b3gqe9.js → index-qhfrazv3.js} +1 -1
  71. package/dist/canvas/chunks/{index-6qmsnxwy.js → index-v119nznk.js} +4 -4
  72. package/dist/canvas/chunks/{index-r2fyc9w1.js → index-vpt37m3d.js} +6 -6
  73. package/dist/canvas/chunks/{index-qj8fxwsf.js → index-y9ma6azy.js} +1 -1
  74. package/dist/canvas/chunks/{index-tb1wf525.js → index-zx0j3a2z.js} +26 -26
  75. package/dist/canvas/chunks/info-DKCQHKI2-a0ykzs9z.js +1 -0
  76. package/dist/canvas/chunks/{infoDiagram-6WML65LV-v1yvggqj.js → infoDiagram-6WML65LV-qv97qq6a.js} +2 -2
  77. package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-p9306gh0.js +70 -0
  78. package/dist/canvas/chunks/{journeyDiagram-NVQOT4AX-zjcffveh.js → journeyDiagram-NVQOT4AX-sv67zats.js} +5 -5
  79. package/dist/canvas/chunks/{kanban-definition-27J2QSJJ-dakqtfp1.js → kanban-definition-27J2QSJJ-k2pfam6p.js} +1 -1
  80. package/dist/canvas/chunks/{mermaid.core-j2geswrd.js → mermaid.core-83r0fdce.js} +4 -4
  81. package/dist/canvas/chunks/{mindmap-definition-FAOFIHXS-142xhr3k.js → mindmap-definition-FAOFIHXS-vg2newm1.js} +1 -1
  82. package/dist/canvas/chunks/packet-7NZHBO7P-tqnabcdv.js +1 -0
  83. package/dist/canvas/chunks/{pegDiagram-VL7TDLO6-5wvk7vsd.js → pegDiagram-VL7TDLO6-k2h7zc5n.js} +1 -1
  84. package/dist/canvas/chunks/pie-RZYD4A2V-wke6gyhe.js +1 -0
  85. package/dist/canvas/chunks/{pieDiagram-7S7Q4E2Y-ztdhwycc.js → pieDiagram-7S7Q4E2Y-hg169p1v.js} +2 -2
  86. package/dist/canvas/chunks/{quadrantDiagram-CIZ2JOQS-c5p9gmg6.js → quadrantDiagram-CIZ2JOQS-bxtvsq0b.js} +5 -5
  87. package/dist/canvas/chunks/radar-I7S5WNFK-w7ka0drw.js +1 -0
  88. package/dist/canvas/chunks/railroad-3IZDKUUU-y3vg318x.js +1 -0
  89. package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-6hqvcz3c.js +1 -0
  90. package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-vcae260m.js +1 -0
  91. package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-0dbyme23.js +1 -0
  92. package/dist/canvas/chunks/{railroadDiagram-AXF67PYL-xkmqkjwf.js → railroadDiagram-AXF67PYL-njyhcp4p.js} +1 -1
  93. package/dist/canvas/chunks/{requirementDiagram-LRYGKXZP-9wm2dyaw.js → requirementDiagram-LRYGKXZP-2z6v09gm.js} +4 -4
  94. package/dist/canvas/chunks/{sankeyDiagram-W5VNT64P-2w19etgb.js → sankeyDiagram-W5VNT64P-15mzam0e.js} +1 -1
  95. package/dist/canvas/chunks/{sequenceDiagram-SI44F4Z6-0jn0vwmz.js → sequenceDiagram-SI44F4Z6-rbshyd2c.js} +12 -12
  96. package/dist/canvas/chunks/{sizeCapture-X5ZJPWSS-x75epwdq.js → sizeCapture-X5ZJPWSS-sg26xwts.js} +1 -1
  97. package/dist/canvas/chunks/{stateDiagram-OKZ733FA-schjpy6d.js → stateDiagram-OKZ733FA-6eahp98e.js} +1 -1
  98. package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-tty0ggn5.js +1 -0
  99. package/dist/canvas/chunks/{swimlanes-SLNWSIFB-gkw4xce3.js → swimlanes-SLNWSIFB-ze5db10t.js} +1 -1
  100. package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-thze75gq.js +8 -0
  101. package/dist/canvas/chunks/{timeline-definition-Z64GVDOM-x7nkcy01.js → timeline-definition-Z64GVDOM-vnp7jyy8.js} +3 -3
  102. package/dist/canvas/chunks/treeView-QDETBFTQ-6ysffnm6.js +1 -0
  103. package/dist/canvas/chunks/treemap-6X3UGDF4-m3h9p066.js +1 -0
  104. package/dist/canvas/chunks/vennDiagram-T6HMQDX7-0qrnb7mj.js +34 -0
  105. package/dist/canvas/chunks/wardley-OPB4EBWU-dp37drwx.js +1 -0
  106. package/dist/canvas/chunks/{wardleyDiagram-T6FBY63Y-t1j52t9r.js → wardleyDiagram-T6FBY63Y-8nxg8wqt.js} +4 -4
  107. package/dist/canvas/chunks/{xychartDiagram-ELKLHX3M-38t16pme.js → xychartDiagram-ELKLHX3M-nj921e7s.js} +5 -5
  108. package/dist/canvas/global.css +94 -1
  109. package/dist/canvas/index.js +154 -145
  110. package/dist/canvas/mcp-app.html +600 -498
  111. package/dist/json-render/index.css +1 -1
  112. package/dist/types/client/canvas/BoardMoveDialog.d.ts +2 -0
  113. package/dist/types/client/canvas/EdgeEditor.d.ts +19 -0
  114. package/dist/types/client/canvas/GroupNavigation.d.ts +2 -0
  115. package/dist/types/client/canvas/TextPrompt.d.ts +4 -0
  116. package/dist/types/client/nodes/PromptNode.d.ts +1 -0
  117. package/dist/types/client/nodes/ViewerFrame.d.ts +1 -1
  118. package/dist/types/client/nodes/WorkCard.d.ts +7 -0
  119. package/dist/types/client/nodes/use-ax-surface-bridge.d.ts +1 -0
  120. package/dist/types/client/state/canvas-store.d.ts +15 -0
  121. package/dist/types/client/state/human-store.d.ts +2 -0
  122. package/dist/types/client/state/intent-bridge.d.ts +4 -2
  123. package/dist/types/client/state/relation-store.d.ts +11 -0
  124. package/dist/types/client/types.d.ts +1 -1
  125. package/dist/types/json-render/catalog.d.ts +2 -2
  126. package/dist/types/server/agent-presence.d.ts +1 -0
  127. package/dist/types/server/ax-interaction.d.ts +1 -0
  128. package/dist/types/server/ax-state-manager.d.ts +10 -2
  129. package/dist/types/server/board-local.d.ts +4 -0
  130. package/dist/types/server/board-move.d.ts +38 -0
  131. package/dist/types/server/canvas-db.d.ts +12 -2
  132. package/dist/types/server/canvas-operations.d.ts +5 -6
  133. package/dist/types/server/canvas-provenance.d.ts +1 -1
  134. package/dist/types/server/canvas-serialization.d.ts +1 -0
  135. package/dist/types/server/canvas-state.d.ts +84 -20
  136. package/dist/types/server/card-relocation.d.ts +6 -0
  137. package/dist/types/server/context-reads.d.ts +3 -1
  138. package/dist/types/server/human-presence.d.ts +1 -1
  139. package/dist/types/server/index.d.ts +16 -5
  140. package/dist/types/server/intent-registry.d.ts +8 -4
  141. package/dist/types/server/knowledge-lifecycle.d.ts +4 -2
  142. package/dist/types/server/mutation-history.d.ts +7 -5
  143. package/dist/types/server/operations/registry.d.ts +2 -0
  144. package/dist/types/server/trace-manager.d.ts +1 -0
  145. package/dist/types/shared/ax-kinds.d.ts +6 -0
  146. package/dist/types/shared/ax-surface-protocol.d.ts +8 -0
  147. package/dist/types/shared/human-presence.d.ts +1 -0
  148. package/dist/types/shared/lifecycle-status.d.ts +2 -0
  149. package/docs/RELEASE.md +21 -14
  150. package/docs/agent-plugin.md +22 -2
  151. package/docs/amp-plugin.md +270 -0
  152. package/docs/cli.md +42 -3
  153. package/docs/design/GuestName.dc.html +50 -0
  154. package/docs/design/PluginLogo.svg +7 -0
  155. package/docs/design/WorkCards.dc.html +39 -0
  156. package/docs/design/canvas.json +16 -0
  157. package/docs/design/plugin-logo.png +0 -0
  158. package/docs/design.md +111 -8
  159. package/docs/evals/agents-md-sections.md +38 -0
  160. package/docs/http-api.md +128 -10
  161. package/docs/mcp.md +61 -9
  162. package/docs/node-types.md +71 -1
  163. package/docs/plans/plan-009-tech-debt-backlog.md +1 -1
  164. package/docs/plans/plan-019-post-0.9-roadmap.md +44 -20
  165. package/docs/plans/plan-020-wave-5-work-planning.md +553 -0
  166. package/docs/product-vision-2026-09.md +33 -17
  167. package/docs/sdk.md +18 -0
  168. package/package.json +6 -3
  169. package/plugins/pmx-canvas/assets/preview.png +0 -0
  170. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/extension.mjs +4 -1
  171. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +1 -1
  172. package/plugins/pmx-canvas/plugin.json +2 -2
  173. package/plugins/pmx-canvas/runtime.json +1 -1
  174. package/plugins/pmx-canvas/tools.json +440 -18
  175. package/skills/data-analysis/SKILL.md +13 -26
  176. package/skills/frontend-design/LICENSE.txt +177 -0
  177. package/skills/frontend-design/SKILL.md +3 -0
  178. package/skills/pmx-canvas/SKILL.md +248 -842
  179. package/skills/pmx-canvas/evals/evals.json +110 -5
  180. package/skills/pmx-canvas/references/full-reference.md +142 -28
  181. package/skills/pmx-canvas/references/html-primitives.md +7 -0
  182. package/skills/pmx-canvas/references/installing-pmx-canvas.md +61 -11
  183. package/skills/pmx-canvas/references/tours-and-recording.md +39 -6
  184. package/skills/pmx-canvas/references/workbench-workflows.md +908 -0
  185. package/skills/pmx-canvas-testing/SKILL.md +7 -5
  186. package/skills/published-consumer-e2e/SKILL.md +25 -8
  187. package/skills/published-consumer-e2e/scripts/run-published-consumer-e2e.sh +51 -75
  188. package/skills/web-artifacts-builder/LICENSE.txt +202 -0
  189. package/skills/web-artifacts-builder/SKILL.md +6 -0
  190. package/skills/web-artifacts-builder/scripts/bundle-artifact.sh +2 -2
  191. package/skills/web-artifacts-builder/scripts/init-artifact.sh +8 -8
  192. package/src/cli/commands/apps.ts +1 -0
  193. package/src/cli/commands/boards.ts +30 -0
  194. package/src/client/App.tsx +20 -4
  195. package/src/client/canvas/AttentionHistory.tsx +10 -2
  196. package/src/client/canvas/BoardMoveDialog.tsx +225 -0
  197. package/src/client/canvas/CanvasNode.tsx +45 -2
  198. package/src/client/canvas/CanvasViewport.tsx +38 -9
  199. package/src/client/canvas/ContextMenu.tsx +34 -12
  200. package/src/client/canvas/EdgeEditor.tsx +149 -0
  201. package/src/client/canvas/EdgeLayer.tsx +87 -16
  202. package/src/client/canvas/ExpandedNodeOverlay.tsx +4 -0
  203. package/src/client/canvas/GroupNavigation.tsx +85 -0
  204. package/src/client/canvas/RelationsPanel.tsx +9 -0
  205. package/src/client/canvas/SelectionBar.tsx +21 -0
  206. package/src/client/canvas/SessionPanel.tsx +35 -1
  207. package/src/client/canvas/TextPrompt.tsx +18 -1
  208. package/src/client/canvas/TopBar.tsx +30 -0
  209. package/src/client/canvas/canvas-area.ts +1 -1
  210. package/src/client/nodes/ExtAppFrame.tsx +26 -10
  211. package/src/client/nodes/MarkdownNode.tsx +6 -7
  212. package/src/client/nodes/PromptNode.tsx +32 -3
  213. package/src/client/nodes/StatusNode.tsx +12 -0
  214. package/src/client/nodes/StatusSummary.tsx +11 -0
  215. package/src/client/nodes/ViewerFrame.tsx +21 -10
  216. package/src/client/nodes/WorkCard.tsx +175 -0
  217. package/src/client/nodes/use-ax-surface-bridge.ts +18 -14
  218. package/src/client/state/attention-bridge.ts +5 -0
  219. package/src/client/state/attention-store.ts +1 -0
  220. package/src/client/state/canvas-store.ts +185 -15
  221. package/src/client/state/human-store.ts +22 -2
  222. package/src/client/state/intent-bridge.ts +19 -5
  223. package/src/client/state/relation-store.ts +127 -1
  224. package/src/client/theme/global.css +94 -1
  225. package/src/client/types.ts +1 -0
  226. package/src/mcp/server.ts +13 -3
  227. package/src/server/agent-presence.ts +43 -23
  228. package/src/server/ax-flow-loop.ts +6 -0
  229. package/src/server/ax-gate-ttl.ts +8 -1
  230. package/src/server/ax-interaction.ts +16 -10
  231. package/src/server/ax-state-manager.ts +17 -4
  232. package/src/server/ax-wait.ts +20 -6
  233. package/src/server/board-export.ts +19 -6
  234. package/src/server/board-local.ts +20 -0
  235. package/src/server/board-move.ts +297 -0
  236. package/src/server/canvas-db.ts +262 -160
  237. package/src/server/canvas-operations.ts +139 -109
  238. package/src/server/canvas-schema.ts +21 -0
  239. package/src/server/canvas-serialization.ts +2 -0
  240. package/src/server/canvas-state.ts +792 -159
  241. package/src/server/card-relocation.ts +53 -0
  242. package/src/server/code-graph.ts +4 -3
  243. package/src/server/context-reads.ts +83 -55
  244. package/src/server/demo-state.json +35 -15
  245. package/src/server/file-watcher.ts +30 -10
  246. package/src/server/human-presence.ts +18 -5
  247. package/src/server/index.ts +35 -15
  248. package/src/server/intent-registry.ts +43 -5
  249. package/src/server/knowledge-lifecycle.ts +32 -9
  250. package/src/server/lifecycle-status.ts +29 -1
  251. package/src/server/mcp-app-runtime.ts +26 -7
  252. package/src/server/mutation-history.ts +37 -8
  253. package/src/server/operations/composites.ts +6 -3
  254. package/src/server/operations/mcp-contracts.ts +15 -0
  255. package/src/server/operations/mcp.ts +36 -9
  256. package/src/server/operations/ops/annotation.ts +22 -1
  257. package/src/server/operations/ops/ax-await.ts +1 -0
  258. package/src/server/operations/ops/ax-timeline.ts +28 -2
  259. package/src/server/operations/ops/batch.ts +25 -11
  260. package/src/server/operations/ops/boards.ts +44 -3
  261. package/src/server/operations/ops/nodes.ts +70 -0
  262. package/src/server/operations/ops/query.ts +32 -3
  263. package/src/server/operations/ops/snapshots.ts +1 -0
  264. package/src/server/operations/registry.ts +49 -4
  265. package/src/server/server.ts +62 -16
  266. package/src/server/tour-control.ts +37 -12
  267. package/src/server/trace-manager.ts +4 -0
  268. package/src/server/web-artifacts/scripts/bundle-artifact.sh +2 -2
  269. package/src/server/web-artifacts/scripts/init-artifact.sh +8 -8
  270. package/src/shared/agent-context.ts +7 -1
  271. package/src/shared/auto-arrange.ts +5 -4
  272. package/src/shared/ax-kinds.ts +13 -0
  273. package/src/shared/ax-surface-protocol.ts +22 -0
  274. package/src/shared/human-presence.ts +1 -0
  275. package/src/shared/lifecycle-status.ts +2 -0
  276. package/dist/canvas/chunks/architecture-TIHT7OUA-9tffvpsv.js +0 -1
  277. package/dist/canvas/chunks/classDiagram-JCYQIIEL-nc6g5x1r.js +0 -1
  278. package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-0qnbpwvh.js +0 -1
  279. package/dist/canvas/chunks/cynefin-VYW2F7L2-ys8p46ts.js +0 -1
  280. package/dist/canvas/chunks/eventmodeling-45OFAUF4-v9q6dn4c.js +0 -1
  281. package/dist/canvas/chunks/flowDiagram-UKHOOZJN-yrr5z8tc.js +0 -1
  282. package/dist/canvas/chunks/gitGraph-TEB2WS4Q-kdwb8m0a.js +0 -1
  283. package/dist/canvas/chunks/index-1r72hdzb.js +0 -301
  284. package/dist/canvas/chunks/index-g3pwnqeb.js +0 -2
  285. package/dist/canvas/chunks/index-rft2hcz5.js +0 -2
  286. package/dist/canvas/chunks/info-DKCQHKI2-wpzs6sz3.js +0 -1
  287. package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-5hnq1a9p.js +0 -70
  288. package/dist/canvas/chunks/packet-7NZHBO7P-xn439f0s.js +0 -1
  289. package/dist/canvas/chunks/pie-RZYD4A2V-0kf16rwh.js +0 -1
  290. package/dist/canvas/chunks/radar-I7S5WNFK-0g2pz36t.js +0 -1
  291. package/dist/canvas/chunks/railroad-3IZDKUUU-fcaran6j.js +0 -1
  292. package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-wgdya41q.js +0 -1
  293. package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-gy07a4ka.js +0 -1
  294. package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-ewk6wtkh.js +0 -1
  295. package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-k8sfp2e7.js +0 -1
  296. package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-nqysw67j.js +0 -8
  297. package/dist/canvas/chunks/treeView-QDETBFTQ-cesw6gp0.js +0 -1
  298. package/dist/canvas/chunks/treemap-6X3UGDF4-zdv4knp9.js +0 -1
  299. package/dist/canvas/chunks/vennDiagram-T6HMQDX7-x8dqn9yf.js +0 -34
  300. package/dist/canvas/chunks/wardley-OPB4EBWU-44pdddez.js +0 -1
@@ -1 +1 @@
1
- import{e,t,n}from"./index-1r72hdzb.js";import{Re}from"./index-6ceya556.js";import{K,se}from"./index-6qmsnxwy.js";var z=se(function(Z,q){(function(w,L){if(typeof Z==="object"&&typeof q==="object")q.exports=L();else if(typeof define==="function"&&define.amd)define([],L);else if(typeof Z==="object")Z.layoutBase=L();else w.layoutBase=L()})(Z,function(){return function(m){var w={};function L(a){if(w[a])return w[a].exports;var i=w[a]={i:a,l:!1,exports:{}};return m[a].call(i.exports,i,i.exports,L),i.l=!0,i.exports}return L.m=m,L.c=w,L.i=function(a){return a},L.d=function(a,i,r){if(!L.o(a,i))Object.defineProperty(a,i,{configurable:!1,enumerable:!0,get:r})},L.n=function(a){var i=a&&a.__esModule?function(){return a.default}:function(){return a};return L.d(i,"a",i),i},L.o=function(a,i){return Object.prototype.hasOwnProperty.call(a,i)},L.p="",L(L.s=26)}([function(m,w,L){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1000,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,m.exports=a},function(m,w,L){var a=L(2),i=L(8),r=L(9);function s(c,h,y){a.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=c,this.target=h}s.prototype=Object.create(a.prototype);for(var u in a)s[u]=a[u];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;else if(this.target===c)return this.source;else throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(c,h){var y=this.getOtherEnd(c),o=h.getGraphManager().getRoot();while(!0){if(y.getOwner()==h)return y;if(y.getOwner()==o)break;y=y.getOwner().getParent()}return null},s.prototype.updateLength=function(){var c=[,,,,];if(this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),c),!this.isOverlapingSourceAndTarget){if(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[3],Math.abs(this.lengthX)<1)this.lengthX=r.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=r.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},s.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=r.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=r.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=s},function(m,w,L){function a(i){this.vGraphObject=i}m.exports=a},function(m,w,L){var a=L(2),i=L(10),r=L(13),s=L(0),u=L(16),c=L(4);function h(o,g,f,E){if(f==null&&E==null)E=g;if(a.call(this,E),o.graphManager!=null)o=o.graphManager;if(this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=E,this.edges=[],this.graphManager=o,f!=null&&g!=null)this.rect=new r(g.x,g.y,f.width,f.height);else this.rect=new r}h.prototype=Object.create(a.prototype);for(var y in a)h[y]=a[y];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(o){this.rect.width=o},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(o){this.rect.height=o},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(o,g){this.rect.x=o.x,this.rect.y=o.y,this.rect.width=g.width,this.rect.height=g.height},h.prototype.setCenter=function(o,g){this.rect.x=o-this.rect.width/2,this.rect.y=g-this.rect.height/2},h.prototype.setLocation=function(o,g){this.rect.x=o,this.rect.y=g},h.prototype.moveBy=function(o,g){this.rect.x+=o,this.rect.y+=g},h.prototype.getEdgeListToNode=function(o){var g=[],f,E=this;return E.edges.forEach(function(T){if(T.target==o){if(T.source!=E)throw"Incorrect edge source!";g.push(T)}}),g},h.prototype.getEdgesBetween=function(o){var g=[],f,E=this;return E.edges.forEach(function(T){if(!(T.source==E||T.target==E))throw"Incorrect edge source and/or target";if(T.target==o||T.source==o)g.push(T)}),g},h.prototype.getNeighborsList=function(){var o=new Set,g=this;return g.edges.forEach(function(f){if(f.source==g)o.add(f.target);else{if(f.target!=g)throw"Incorrect incidency!";o.add(f.source)}}),o},h.prototype.withChildren=function(){var o=new Set,g,f;if(o.add(this),this.child!=null){var E=this.child.getNodes();for(var T=0;T<E.length;T++)g=E[T],f=g.withChildren(),f.forEach(function(N){o.add(N)})}return o},h.prototype.getNoOfChildren=function(){var o=0,g;if(this.child==null)o=1;else{var f=this.child.getNodes();for(var E=0;E<f.length;E++)g=f[E],o+=g.getNoOfChildren()}if(o==0)o=1;return o},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},h.prototype.scatter=function(){var o,g,f=-s.INITIAL_WORLD_BOUNDARY,E=s.INITIAL_WORLD_BOUNDARY;o=s.WORLD_CENTER_X+u.nextDouble()*(E-f)+f;var T=-s.INITIAL_WORLD_BOUNDARY,N=s.INITIAL_WORLD_BOUNDARY;g=s.WORLD_CENTER_Y+u.nextDouble()*(N-T)+T,this.rect.x=o,this.rect.y=g},h.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var o=this.getChild();if(o.updateBounds(!0),this.rect.x=o.getLeft(),this.rect.y=o.getTop(),this.setWidth(o.getRight()-o.getLeft()),this.setHeight(o.getBottom()-o.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var g=o.getRight()-o.getLeft(),f=o.getBottom()-o.getTop();if(this.labelWidth>g)this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth);if(this.labelHeight>f){if(this.labelPos=="center")this.rect.y-=(this.labelHeight-f)/2;else if(this.labelPos=="top")this.rect.y-=this.labelHeight-f;this.setHeight(this.labelHeight)}}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(o){var g=this.rect.x;if(g>s.WORLD_BOUNDARY)g=s.WORLD_BOUNDARY;else if(g<-s.WORLD_BOUNDARY)g=-s.WORLD_BOUNDARY;var f=this.rect.y;if(f>s.WORLD_BOUNDARY)f=s.WORLD_BOUNDARY;else if(f<-s.WORLD_BOUNDARY)f=-s.WORLD_BOUNDARY;var E=new c(g,f),T=o.inverseTransformPoint(E);this.setLocation(T.x,T.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},m.exports=h},function(m,w,L){function a(i,r){if(i==null&&r==null)this.x=0,this.y=0;else this.x=i,this.y=r}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(i){this.x=i},a.prototype.setY=function(i){this.y=i},a.prototype.getDifference=function(i){return new DimensionD(this.x-i.x,this.y-i.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(i){return this.x+=i.width,this.y+=i.height,this},m.exports=a},function(m,w,L){var a=L(2),i=L(10),r=L(0),s=L(6),u=L(3),c=L(1),h=L(13),y=L(12),o=L(11);function g(E,T,N){if(a.call(this,N),this.estimatedSize=i.MIN_VALUE,this.margin=r.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=E,T!=null&&T instanceof s)this.graphManager=T;else if(T!=null&&T instanceof Layout)this.graphManager=T.graphManager}g.prototype=Object.create(a.prototype);for(var f in a)g[f]=a[f];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(E,T,N){if(T==null&&N==null){var v=E;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(v)>-1)throw"Node already in graph!";return v.owner=this,this.getNodes().push(v),v}else{var O=E;if(!(this.getNodes().indexOf(T)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(T.owner==N.owner&&T.owner==this))throw"Both owners must be this graph!";if(T.owner!=N.owner)return null;if(O.source=T,O.target=N,O.isInterGraph=!1,this.getEdges().push(O),T.edges.push(O),N!=T)N.edges.push(O);return O}},g.prototype.remove=function(E){var T=E;if(E instanceof u){if(T==null)throw"Node is null!";if(!(T.owner!=null&&T.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var N=T.edges.slice(),v,O=N.length;for(var D=0;D<O;D++)if(v=N[D],v.isInterGraph)this.graphManager.remove(v);else v.source.owner.remove(v);var R=this.nodes.indexOf(T);if(R==-1)throw"Node not in owner node list!";this.nodes.splice(R,1)}else if(E instanceof c){var v=E;if(v==null)throw"Edge is null!";if(!(v.source!=null&&v.target!=null))throw"Source and/or target is null!";if(!(v.source.owner!=null&&v.target.owner!=null&&v.source.owner==this&&v.target.owner==this))throw"Source and/or target owner is invalid!";var l=v.source.edges.indexOf(v),p=v.target.edges.indexOf(v);if(!(l>-1&&p>-1))throw"Source and/or target doesn't know this edge!";if(v.source.edges.splice(l,1),v.target!=v.source)v.target.edges.splice(p,1);var R=v.source.owner.getEdges().indexOf(v);if(R==-1)throw"Not in owner's edge list!";v.source.owner.getEdges().splice(R,1)}},g.prototype.updateLeftTop=function(){var{MAX_VALUE:E,MAX_VALUE:T}=i,N,v,O,D=this.getNodes(),R=D.length;for(var l=0;l<R;l++){var p=D[l];if(N=p.getTop(),v=p.getLeft(),E>N)E=N;if(T>v)T=v}if(E==i.MAX_VALUE)return null;if(D[0].getParent().paddingLeft!=null)O=D[0].getParent().paddingLeft;else O=this.margin;return this.left=T-O,this.top=E-O,new y(this.left,this.top)},g.prototype.updateBounds=function(E){var T=i.MAX_VALUE,N=-i.MAX_VALUE,v=i.MAX_VALUE,O=-i.MAX_VALUE,D,R,l,p,d,A=this.nodes,I=A.length;for(var C=0;C<I;C++){var M=A[C];if(E&&M.child!=null)M.updateBounds();if(D=M.getLeft(),R=M.getRight(),l=M.getTop(),p=M.getBottom(),T>D)T=D;if(N<R)N=R;if(v>l)v=l;if(O<p)O=p}var G=new h(T,v,N-T,O-v);if(T==i.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(A[0].getParent().paddingLeft!=null)d=A[0].getParent().paddingLeft;else d=this.margin;this.left=G.x-d,this.right=G.x+G.width+d,this.top=G.y-d,this.bottom=G.y+G.height+d},g.calculateBounds=function(E){var T=i.MAX_VALUE,N=-i.MAX_VALUE,v=i.MAX_VALUE,O=-i.MAX_VALUE,D,R,l,p,d=E.length;for(var A=0;A<d;A++){var I=E[A];if(D=I.getLeft(),R=I.getRight(),l=I.getTop(),p=I.getBottom(),T>D)T=D;if(N<R)N=R;if(v>l)v=l;if(O<p)O=p}var C=new h(T,v,N-T,O-v);return C},g.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){var E=0,T=this.nodes,N=T.length;for(var v=0;v<N;v++){var O=T[v];E+=O.calcEstimatedSize()}if(E==0)this.estimatedSize=r.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=E/Math.sqrt(this.nodes.length);return this.estimatedSize},g.prototype.updateConnected=function(){var E=this;if(this.nodes.length==0){this.isConnected=!0;return}var T=new o,N=new Set,v=this.nodes[0],O,D,R=v.withChildren();R.forEach(function(C){T.push(C),N.add(C)});while(T.length!==0){v=T.shift(),O=v.getEdges();var l=O.length;for(var p=0;p<l;p++){var d=O[p];if(D=d.getOtherEndInGraph(v,this),D!=null&&!N.has(D)){var A=D.withChildren();A.forEach(function(C){T.push(C),N.add(C)})}}}if(this.isConnected=!1,N.size>=this.nodes.length){var I=0;if(N.forEach(function(C){if(C.owner==E)I++}),I==this.nodes.length)this.isConnected=!0}},m.exports=g},function(m,w,L){var a,i=L(1);function r(s){a=L(5),this.layout=s,this.graphs=[],this.edges=[]}r.prototype.addRoot=function(){var s=this.layout.newGraph(),u=this.layout.newNode(null),c=this.add(s,u);return this.setRootGraph(c),this.rootGraph},r.prototype.add=function(s,u,c,h,y){if(c==null&&h==null&&y==null){if(s==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return s.parent=u,u.child=s,s}else{y=c,h=u,c=s;var o=h.getOwner(),g=y.getOwner();if(!(o!=null&&o.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(o==g)return c.isInterGraph=!1,o.add(c,h,y);else{if(c.isInterGraph=!0,c.source=h,c.target=y,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}}},r.prototype.remove=function(s){if(s instanceof a){var u=s;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var c=[];c=c.concat(u.getEdges());var h,y=c.length;for(var o=0;o<y;o++)h=c[o],u.remove(h);var g=[];g=g.concat(u.getNodes());var f;y=g.length;for(var o=0;o<y;o++)f=g[o],u.remove(f);if(u==this.rootGraph)this.setRootGraph(null);var E=this.graphs.indexOf(u);this.graphs.splice(E,1),u.parent=null}else if(s instanceof i){if(h=s,h==null)throw"Edge is null!";if(!h.isInterGraph)throw"Not an inter-graph edge!";if(!(h.source!=null&&h.target!=null))throw"Source and/or target is null!";if(!(h.source.edges.indexOf(h)!=-1&&h.target.edges.indexOf(h)!=-1))throw"Source and/or target doesn't know this edge!";var E=h.source.edges.indexOf(h);if(h.source.edges.splice(E,1),E=h.target.edges.indexOf(h),h.target.edges.splice(E,1),!(h.source.owner!=null&&h.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(h.source.owner.getGraphManager().edges.indexOf(h)==-1)throw"Not in owner graph manager's edge list!";var E=h.source.owner.getGraphManager().edges.indexOf(h);h.source.owner.getGraphManager().edges.splice(E,1)}},r.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},r.prototype.getGraphs=function(){return this.graphs},r.prototype.getAllNodes=function(){if(this.allNodes==null){var s=[],u=this.getGraphs(),c=u.length;for(var h=0;h<c;h++)s=s.concat(u[h].getNodes());this.allNodes=s}return this.allNodes},r.prototype.resetAllNodes=function(){this.allNodes=null},r.prototype.resetAllEdges=function(){this.allEdges=null},r.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},r.prototype.getAllEdges=function(){if(this.allEdges==null){var s=[],u=this.getGraphs(),c=u.length;for(var h=0;h<u.length;h++)s=s.concat(u[h].getEdges());s=s.concat(this.edges),this.allEdges=s}return this.allEdges},r.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},r.prototype.setAllNodesToApplyGravitation=function(s){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=s},r.prototype.getRoot=function(){return this.rootGraph},r.prototype.setRootGraph=function(s){if(s.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=s,s.parent==null)s.parent=this.layout.newNode("Root node")},r.prototype.getLayout=function(){return this.layout},r.prototype.isOneAncestorOfOther=function(s,u){if(!(s!=null&&u!=null))throw"assert failed";if(s==u)return!0;var c=s.getOwner(),h;do{if(h=c.getParent(),h==null)break;if(h==u)return!0;if(c=h.getOwner(),c==null)break}while(!0);c=u.getOwner();do{if(h=c.getParent(),h==null)break;if(h==s)return!0;if(c=h.getOwner(),c==null)break}while(!0);return!1},r.prototype.calcLowestCommonAncestors=function(){var s,u,c,h,y,o=this.getAllEdges(),g=o.length;for(var f=0;f<g;f++){if(s=o[f],u=s.source,c=s.target,s.lca=null,s.sourceInLca=u,s.targetInLca=c,u==c){s.lca=u.getOwner();continue}h=u.getOwner();while(s.lca==null){s.targetInLca=c,y=c.getOwner();while(s.lca==null){if(y==h){s.lca=y;break}if(y==this.rootGraph)break;if(s.lca!=null)throw"assert failed";s.targetInLca=y.getParent(),y=s.targetInLca.getOwner()}if(h==this.rootGraph)break;if(s.lca==null)s.sourceInLca=h.getParent(),h=s.sourceInLca.getOwner()}if(s.lca==null)throw"assert failed"}},r.prototype.calcLowestCommonAncestor=function(s,u){if(s==u)return s.getOwner();var c=s.getOwner();do{if(c==null)break;var h=u.getOwner();do{if(h==null)break;if(h==c)return h;h=h.getParent().getOwner()}while(!0);c=c.getParent().getOwner()}while(!0);return c},r.prototype.calcInclusionTreeDepths=function(s,u){if(s==null&&u==null)s=this.rootGraph,u=1;var c,h=s.getNodes(),y=h.length;for(var o=0;o<y;o++)if(c=h[o],c.inclusionTreeDepth=u,c.child!=null)this.calcInclusionTreeDepths(c.child,u+1)},r.prototype.includesInvalidEdge=function(){var s,u=this.edges.length;for(var c=0;c<u;c++)if(s=this.edges[c],this.isOneAncestorOfOther(s.source,s.target))return!0;return!1},m.exports=r},function(m,w,L){var a=L(0);function i(){}for(var r in a)i[r]=a[r];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=0.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=0.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,i.COOLING_ADAPTATION_FACTOR=0.33,i.ADAPTATION_LOWER_NODE_LIMIT=1000,i.ADAPTATION_UPPER_NODE_LIMIT=5000,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=i},function(m,w,L){var a=L(12);function i(){}i.calcSeparationAmount=function(r,s,u,c){if(!r.intersects(s))throw"assert failed";var h=[,,];if(this.decideDirectionsForOverlappingNodes(r,s,h),u[0]=Math.min(r.getRight(),s.getRight())-Math.max(r.x,s.x),u[1]=Math.min(r.getBottom(),s.getBottom())-Math.max(r.y,s.y),r.getX()<=s.getX()&&r.getRight()>=s.getRight())u[0]+=Math.min(s.getX()-r.getX(),r.getRight()-s.getRight());else if(s.getX()<=r.getX()&&s.getRight()>=r.getRight())u[0]+=Math.min(r.getX()-s.getX(),s.getRight()-r.getRight());if(r.getY()<=s.getY()&&r.getBottom()>=s.getBottom())u[1]+=Math.min(s.getY()-r.getY(),r.getBottom()-s.getBottom());else if(s.getY()<=r.getY()&&s.getBottom()>=r.getBottom())u[1]+=Math.min(r.getY()-s.getY(),s.getBottom()-r.getBottom());var y=Math.abs((s.getCenterY()-r.getCenterY())/(s.getCenterX()-r.getCenterX()));if(s.getCenterY()===r.getCenterY()&&s.getCenterX()===r.getCenterX())y=1;var o=y*u[0],g=u[1]/y;if(u[0]<g)g=u[0];else o=u[1];u[0]=-1*h[0]*(g/2+c),u[1]=-1*h[1]*(o/2+c)},i.decideDirectionsForOverlappingNodes=function(r,s,u){if(r.getCenterX()<s.getCenterX())u[0]=-1;else u[0]=1;if(r.getCenterY()<s.getCenterY())u[1]=-1;else u[1]=1},i.getIntersection2=function(r,s,u){var c=r.getCenterX(),h=r.getCenterY(),y=s.getCenterX(),o=s.getCenterY();if(r.intersects(s))return u[0]=c,u[1]=h,u[2]=y,u[3]=o,!0;var g=r.getX(),f=r.getY(),E=r.getRight(),T=r.getX(),N=r.getBottom(),v=r.getRight(),O=r.getWidthHalf(),D=r.getHeightHalf(),R=s.getX(),l=s.getY(),p=s.getRight(),d=s.getX(),A=s.getBottom(),I=s.getRight(),C=s.getWidthHalf(),M=s.getHeightHalf(),G=!1,F=!1;if(c===y){if(h>o)return u[0]=c,u[1]=f,u[2]=y,u[3]=A,!1;else if(h<o)return u[0]=c,u[1]=N,u[2]=y,u[3]=l,!1}else if(h===o){if(c>y)return u[0]=g,u[1]=h,u[2]=p,u[3]=o,!1;else if(c<y)return u[0]=E,u[1]=h,u[2]=R,u[3]=o,!1}else{var P=r.height/r.width,b=s.height/s.width,U=(o-h)/(y-c),x=void 0,S=void 0,Y=void 0,X=void 0,H=void 0,_=void 0;if(-P===U)if(c>y)u[0]=T,u[1]=N,G=!0;else u[0]=E,u[1]=f,G=!0;else if(P===U)if(c>y)u[0]=g,u[1]=f,G=!0;else u[0]=v,u[1]=N,G=!0;if(-b===U)if(y>c)u[2]=d,u[3]=A,F=!0;else u[2]=p,u[3]=l,F=!0;else if(b===U)if(y>c)u[2]=R,u[3]=l,F=!0;else u[2]=I,u[3]=A,F=!0;if(G&&F)return!1;if(c>y)if(h>o)x=this.getCardinalDirection(P,U,4),S=this.getCardinalDirection(b,U,2);else x=this.getCardinalDirection(-P,U,3),S=this.getCardinalDirection(-b,U,1);else if(h>o)x=this.getCardinalDirection(-P,U,1),S=this.getCardinalDirection(-b,U,3);else x=this.getCardinalDirection(P,U,2),S=this.getCardinalDirection(b,U,4);if(!G)switch(x){case 1:X=f,Y=c+-D/U,u[0]=Y,u[1]=X;break;case 2:Y=v,X=h+O*U,u[0]=Y,u[1]=X;break;case 3:X=N,Y=c+D/U,u[0]=Y,u[1]=X;break;case 4:Y=T,X=h+-O*U,u[0]=Y,u[1]=X;break}if(!F)switch(S){case 1:_=l,H=y+-M/U,u[2]=H,u[3]=_;break;case 2:H=I,_=o+C*U,u[2]=H,u[3]=_;break;case 3:_=A,H=y+M/U,u[2]=H,u[3]=_;break;case 4:H=d,_=o+-C*U,u[2]=H,u[3]=_;break}}return!1},i.getCardinalDirection=function(r,s,u){if(r>s)return u;else return 1+u%4},i.getIntersection=function(r,s,u,c){if(c==null)return this.getIntersection2(r,s,u);var{x:h,y}=r,{x:o,y:g}=s,{x:f,y:E}=u,{x:T,y:N}=c,v=void 0,O=void 0,D=void 0,R=void 0,l=void 0,p=void 0,d=void 0,A=void 0,I=void 0;if(D=g-y,l=h-o,d=o*y-h*g,R=N-E,p=f-T,A=T*E-f*N,I=D*p-R*l,I===0)return null;return v=(l*A-p*d)/I,O=(R*d-D*A)/I,new a(v,O)},i.angleOfVector=function(r,s,u,c){var h=void 0;if(r!==u){if(h=Math.atan((c-s)/(u-r)),u<r)h+=Math.PI;else if(c<s)h+=this.TWO_PI}else if(c<s)h=this.ONE_AND_HALF_PI;else h=this.HALF_PI;return h},i.doIntersect=function(r,s,u,c){var{x:h,y}=r,{x:o,y:g}=s,{x:f,y:E}=u,{x:T,y:N}=c,v=(o-h)*(N-E)-(T-f)*(g-y);if(v===0)return!1;else{var O=((N-E)*(T-h)+(f-T)*(N-y))/v,D=((y-g)*(T-h)+(o-h)*(N-y))/v;return 0<O&&O<1&&0<D&&D<1}},i.HALF_PI=0.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,m.exports=i},function(m,w,L){function a(){}a.sign=function(i){if(i>0)return 1;else if(i<0)return-1;else return 0},a.floor=function(i){return i<0?Math.ceil(i):Math.floor(i)},a.ceil=function(i){return i<0?Math.floor(i):Math.ceil(i)},m.exports=a},function(m,w,L){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,m.exports=a},function(m,w,L){var a=function(){function h(y,o){for(var g=0;g<o.length;g++){var f=o[g];if(f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f)f.writable=!0;Object.defineProperty(y,f.key,f)}}return function(y,o,g){if(o)h(y.prototype,o);if(g)h(y,g);return y}}();function i(h,y){if(!(h instanceof y))throw TypeError("Cannot call a class as a function")}var r=function(y){return{value:y,next:null,prev:null}},s=function(y,o,g,f){if(y!==null)y.next=o;else f.head=o;if(g!==null)g.prev=o;else f.tail=o;return o.prev=y,o.next=g,f.length++,o},u=function(y,o){var{prev:g,next:f}=y;if(g!==null)g.next=f;else o.head=f;if(f!==null)f.prev=g;else o.tail=g;return y.prev=y.next=null,o.length--,y},c=function(){function h(y){var o=this;if(i(this,h),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(g){return o.push(g)})}return a(h,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(o,g){return s(g.prev,r(o),g,this)}},{key:"insertAfter",value:function(o,g){return s(g,r(o),g.next,this)}},{key:"insertNodeBefore",value:function(o,g){return s(g.prev,o,g,this)}},{key:"insertNodeAfter",value:function(o,g){return s(g,o,g.next,this)}},{key:"push",value:function(o){return s(this.tail,r(o),null,this)}},{key:"unshift",value:function(o){return s(null,r(o),this.head,this)}},{key:"remove",value:function(o){return u(o,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(o){if(o<=this.length()){var g=1,f=this.head;while(g<o)f=f.next,g++;return f.value}}},{key:"set_object_at",value:function(o,g){if(o<=this.length()){var f=1,E=this.head;while(f<o)E=E.next,f++;E.value=g}}}]),h}();m.exports=c},function(m,w,L){function a(i,r,s){if(this.x=null,this.y=null,i==null&&r==null&&s==null)this.x=0,this.y=0;else if(typeof i=="number"&&typeof r=="number"&&s==null)this.x=i,this.y=r;else if(i.constructor.name=="Point"&&r==null&&s==null)s=i,this.x=s.x,this.y=s.y}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(i,r,s){if(i.constructor.name=="Point"&&r==null&&s==null)s=i,this.setLocation(s.x,s.y);else if(typeof i=="number"&&typeof r=="number"&&s==null)if(parseInt(i)==i&&parseInt(r)==r)this.move(i,r);else this.x=Math.floor(i+0.5),this.y=Math.floor(r+0.5)},a.prototype.move=function(i,r){this.x=i,this.y=r},a.prototype.translate=function(i,r){this.x+=i,this.y+=r},a.prototype.equals=function(i){if(i.constructor.name=="Point"){var r=i;return this.x==r.x&&this.y==r.y}return this==i},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=a},function(m,w,L){function a(i,r,s,u){if(this.x=0,this.y=0,this.width=0,this.height=0,i!=null&&r!=null&&s!=null&&u!=null)this.x=i,this.y=r,this.width=s,this.height=u}a.prototype.getX=function(){return this.x},a.prototype.setX=function(i){this.x=i},a.prototype.getY=function(){return this.y},a.prototype.setY=function(i){this.y=i},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(i){this.width=i},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(i){this.height=i},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(i){if(this.getRight()<i.x)return!1;if(this.getBottom()<i.y)return!1;if(i.getRight()<this.x)return!1;if(i.getBottom()<this.y)return!1;return!0},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},m.exports=a},function(m,w,L){var a=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol==="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function i(){}i.lastID=0,i.createID=function(r){if(i.isPrimitive(r))return r;if(r.uniqueID!=null)return r.uniqueID;return r.uniqueID=i.getString(),i.lastID++,r.uniqueID},i.getString=function(r){if(r==null)r=i.lastID;return"Object#"+r},i.isPrimitive=function(r){var s=typeof r>"u"?"undefined":a(r);return r==null||s!="object"&&s!="function"},m.exports=i},function(m,w,L){function a(f){if(Array.isArray(f)){for(var E=0,T=Array(f.length);E<f.length;E++)T[E]=f[E];return T}else return Array.from(f)}var i=L(0),r=L(6),s=L(3),u=L(1),c=L(5),h=L(4),y=L(17),o=L(27);function g(f){if(o.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new r(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,f!=null)this.isRemoteUse=f}g.RANDOM_SEED=1,g.prototype=Object.create(o.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var f=new r(this);return this.graphManager=f,f},g.prototype.newGraph=function(f){return new c(null,this.graphManager,f)},g.prototype.newNode=function(f){return new s(this.graphManager,f)},g.prototype.newEdge=function(f){return new u(null,null,f)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var f;if(this.checkLayoutSuccess())f=!1;else f=this.layout();if(i.ANIMATE==="during")return!1;if(f){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,f},g.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var f,E=this.graphManager.getAllEdges();for(var T=0;T<E.length;T++)f=E[T];var N,v=this.graphManager.getRoot().getNodes();for(var T=0;T<v.length;T++)N=v[T];this.update(this.graphManager.getRoot())}},g.prototype.update=function(f){if(f==null)this.update2();else if(f instanceof s){var E=f;if(E.getChild()!=null){var T=E.getChild().getNodes();for(var N=0;N<T.length;N++)update(T[N])}if(E.vGraphObject!=null){var v=E.vGraphObject;v.update(E)}}else if(f instanceof u){var O=f;if(O.vGraphObject!=null){var D=O.vGraphObject;D.update(O)}}else if(f instanceof c){var R=f;if(R.vGraphObject!=null){var l=R.vGraphObject;l.update(R)}}},g.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},g.prototype.transform=function(f){if(f==null)this.transform(new h(0,0));else{var E=new y,T=this.graphManager.getRoot().updateLeftTop();if(T!=null){E.setWorldOrgX(f.x),E.setWorldOrgY(f.y),E.setDeviceOrgX(T.x),E.setDeviceOrgY(T.y);var N=this.getAllNodes(),v;for(var O=0;O<N.length;O++)v=N[O],v.transform(E)}}},g.prototype.positionNodesRandomly=function(f){if(f==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var E,T,N=f.getNodes();for(var v=0;v<N.length;v++)if(E=N[v],T=E.getChild(),T==null)E.scatter();else if(T.getNodes().length==0)E.scatter();else this.positionNodesRandomly(T),E.updateBounds()}},g.prototype.getFlatForest=function(){var f=[],E=!0,T=this.graphManager.getRoot().getNodes(),N=!0;for(var v=0;v<T.length;v++)if(T[v].getChild()!=null)N=!1;if(!N)return f;var O=new Set,D=[],R=new Map,l=[];l=l.concat(T);while(l.length>0&&E){D.push(l[0]);while(D.length>0&&E){var p=D[0];D.splice(0,1),O.add(p);var d=p.getEdges();for(var v=0;v<d.length;v++){var A=d[v].getOtherEnd(p);if(R.get(p)!=A)if(!O.has(A))D.push(A),R.set(A,p);else{E=!1;break}}}if(!E)f=[];else{var I=[].concat(a(O));f.push(I);for(var v=0;v<I.length;v++){var C=I[v],M=l.indexOf(C);if(M>-1)l.splice(M,1)}O=new Set,R=new Map}}return f},g.prototype.createDummyNodesForBendpoints=function(f){var E=[],T=f.source,N=this.graphManager.calcLowestCommonAncestor(f.source,f.target);for(var v=0;v<f.bendpoints.length;v++){var O=this.newNode(null);O.setRect(new Point(0,0),new Dimension(1,1)),N.add(O);var D=this.newEdge(null);this.graphManager.add(D,T,O),E.add(O),T=O}var D=this.newEdge(null);if(this.graphManager.add(D,T,f.target),this.edgeToDummyNodes.set(f,E),f.isInterGraph())this.graphManager.remove(f);else N.remove(f);return E},g.prototype.createBendpointsFromDummyNodes=function(){var f=[];f=f.concat(this.graphManager.getAllEdges()),f=[].concat(a(this.edgeToDummyNodes.keys())).concat(f);for(var E=0;E<f.length;E++){var T=f[E];if(T.bendpoints.length>0){var N=this.edgeToDummyNodes.get(T);for(var v=0;v<N.length;v++){var O=N[v],D=new h(O.getCenterX(),O.getCenterY()),R=T.bendpoints.get(v);R.x=D.x,R.y=D.y,O.getOwner().remove(O)}this.graphManager.add(T,T.source,T.target)}}},g.transform=function(f,E,T,N){if(T!=null&&N!=null){var v=E;if(f<=50){var O=E/T;v-=(E-O)/50*(50-f)}else{var D=E*N;v+=(D-E)/50*(f-50)}return v}else{var R,l;if(f<=50)R=9*E/500,l=E/10;else R=9*E/50,l=-8*E;return R*f+l}},g.findCenterOfTree=function(f){var E=[];E=E.concat(f);var T=[],N=new Map,v=!1,O=null;if(E.length==1||E.length==2)v=!0,O=E[0];for(var D=0;D<E.length;D++){var R=E[D],l=R.getNeighborsList().size;if(N.set(R,R.getNeighborsList().size),l==1)T.push(R)}var p=[];p=p.concat(T);while(!v){var d=[];d=d.concat(p),p=[];for(var D=0;D<E.length;D++){var R=E[D],A=E.indexOf(R);if(A>=0)E.splice(A,1);var I=R.getNeighborsList();I.forEach(function(G){if(T.indexOf(G)<0){var F=N.get(G),P=F-1;if(P==1)p.push(G);N.set(G,P)}})}if(T=T.concat(p),E.length==1||E.length==2)v=!0,O=E[0]}return O},g.prototype.setGraphManager=function(f){this.graphManager=f},m.exports=g},function(m,w,L){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},m.exports=a},function(m,w,L){var a=L(4);function i(r,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(r){this.lworldOrgX=r},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(r){this.lworldOrgY=r},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(r){this.lworldExtX=r},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(r){this.lworldExtY=r},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(r){this.ldeviceOrgX=r},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(r){this.ldeviceOrgY=r},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(r){this.ldeviceExtX=r},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(r){this.ldeviceExtY=r},i.prototype.transformX=function(r){var s=0,u=this.lworldExtX;if(u!=0)s=this.ldeviceOrgX+(r-this.lworldOrgX)*this.ldeviceExtX/u;return s},i.prototype.transformY=function(r){var s=0,u=this.lworldExtY;if(u!=0)s=this.ldeviceOrgY+(r-this.lworldOrgY)*this.ldeviceExtY/u;return s},i.prototype.inverseTransformX=function(r){var s=0,u=this.ldeviceExtX;if(u!=0)s=this.lworldOrgX+(r-this.ldeviceOrgX)*this.lworldExtX/u;return s},i.prototype.inverseTransformY=function(r){var s=0,u=this.ldeviceExtY;if(u!=0)s=this.lworldOrgY+(r-this.ldeviceOrgY)*this.lworldExtY/u;return s},i.prototype.inverseTransformPoint=function(r){var s=new a(this.inverseTransformX(r.x),this.inverseTransformY(r.y));return s},m.exports=i},function(m,w,L){function a(o){if(Array.isArray(o)){for(var g=0,f=Array(o.length);g<o.length;g++)f[g]=o[g];return f}else return Array.from(o)}var i=L(15),r=L(7),s=L(0),u=L(8),c=L(9);function h(){i.call(this),this.useSmartIdealEdgeLengthCalculation=r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=r.DEFAULT_EDGE_LENGTH,this.springConstant=r.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=r.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=r.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=r.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=r.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*r.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=r.MAX_ITERATIONS}h.prototype=Object.create(i.prototype);for(var y in i)h[y]=i[y];h.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){var o,g,f,E,T,N,v=this.getGraphManager().getAllEdges();for(var O=0;O<v.length;O++)if(o=v[O],o.idealLength=this.idealEdgeLength,o.isInterGraph){if(f=o.getSource(),E=o.getTarget(),T=o.getSourceInLca().getEstimatedSize(),N=o.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)o.idealLength+=T+N-2*s.SIMPLE_NODE_SIZE;g=o.getLca().getInclusionTreeDepth(),o.idealLength+=r.DEFAULT_EDGE_LENGTH*r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(f.getInclusionTreeDepth()+E.getInclusionTreeDepth()-2*g)}},h.prototype.initSpringEmbedder=function(){var o=this.getAllNodes().length;if(this.incremental){if(o>r.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*r.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(o-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-r.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(o>r.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(r.COOLING_ADAPTATION_FACTOR,1-(o-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*(1-r.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){var o=this.getAllEdges(),g;for(var f=0;f<o.length;f++)g=o[f],this.calcSpringForce(g,g.idealLength)},h.prototype.calcRepulsionForces=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f,E,T,N,v=this.getAllNodes(),O;if(this.useFRGridVariant){if(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&o)this.updateGrid();O=new Set;for(f=0;f<v.length;f++)T=v[f],this.calculateRepulsionForceOfANode(T,O,o,g),O.add(T)}else for(f=0;f<v.length;f++){T=v[f];for(E=f+1;E<v.length;E++){if(N=v[E],T.getOwner()!=N.getOwner())continue;this.calcRepulsionForce(T,N)}}},h.prototype.calcGravitationalForces=function(){var o,g=this.getAllNodesToApplyGravitation();for(var f=0;f<g.length;f++)o=g[f],this.calcGravitationalForce(o)},h.prototype.moveNodes=function(){var o=this.getAllNodes(),g;for(var f=0;f<o.length;f++)g=o[f],g.move()},h.prototype.calcSpringForce=function(o,g){var f=o.getSource(),E=o.getTarget(),T,N,v,O;if(this.uniformLeafNodeSizes&&f.getChild()==null&&E.getChild()==null)o.updateLengthSimple();else if(o.updateLength(),o.isOverlapingSourceAndTarget)return;if(T=o.getLength(),T==0)return;N=this.springConstant*(T-g),v=N*(o.lengthX/T),O=N*(o.lengthY/T),f.springForceX+=v,f.springForceY+=O,E.springForceX-=v,E.springForceY-=O},h.prototype.calcRepulsionForce=function(o,g){var f=o.getRect(),E=g.getRect(),T=[,,],N=[,,,,],v,O,D,R,l,p,d;if(f.intersects(E)){u.calcSeparationAmount(f,E,T,r.DEFAULT_EDGE_LENGTH/2),p=2*T[0],d=2*T[1];var A=o.noOfChildren*g.noOfChildren/(o.noOfChildren+g.noOfChildren);o.repulsionForceX-=A*p,o.repulsionForceY-=A*d,g.repulsionForceX+=A*p,g.repulsionForceY+=A*d}else{if(this.uniformLeafNodeSizes&&o.getChild()==null&&g.getChild()==null)v=E.getCenterX()-f.getCenterX(),O=E.getCenterY()-f.getCenterY();else u.getIntersection(f,E,N),v=N[2]-N[0],O=N[3]-N[1];if(Math.abs(v)<r.MIN_REPULSION_DIST)v=c.sign(v)*r.MIN_REPULSION_DIST;if(Math.abs(O)<r.MIN_REPULSION_DIST)O=c.sign(O)*r.MIN_REPULSION_DIST;D=v*v+O*O,R=Math.sqrt(D),l=this.repulsionConstant*o.noOfChildren*g.noOfChildren/D,p=l*v/R,d=l*O/R,o.repulsionForceX-=p,o.repulsionForceY-=d,g.repulsionForceX+=p,g.repulsionForceY+=d}},h.prototype.calcGravitationalForce=function(o){var g,f,E,T,N,v,O,D;if(g=o.getOwner(),f=(g.getRight()+g.getLeft())/2,E=(g.getTop()+g.getBottom())/2,T=o.getCenterX()-f,N=o.getCenterY()-E,v=Math.abs(T)+o.getWidth()/2,O=Math.abs(N)+o.getHeight()/2,o.getOwner()==this.graphManager.getRoot()){if(D=g.getEstimatedSize()*this.gravityRangeFactor,v>D||O>D)o.gravitationForceX=-this.gravityConstant*T,o.gravitationForceY=-this.gravityConstant*N}else if(D=g.getEstimatedSize()*this.compoundGravityRangeFactor,v>D||O>D)o.gravitationForceX=-this.gravityConstant*T*this.compoundGravityConstant,o.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant},h.prototype.isConverged=function(){var o,g=!1;if(this.totalIterations>this.maxIterations/3)g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return o=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,o||g},h.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},h.prototype.calcNoOfChildrenForAllNodes=function(){var o,g=this.graphManager.getAllNodes();for(var f=0;f<g.length;f++)o=g[f],o.noOfChildren=o.getNoOfChildren()},h.prototype.calcGrid=function(o){var g=0,f=0;g=parseInt(Math.ceil((o.getRight()-o.getLeft())/this.repulsionRange)),f=parseInt(Math.ceil((o.getBottom()-o.getTop())/this.repulsionRange));var E=Array(g);for(var T=0;T<g;T++)E[T]=Array(f);for(var T=0;T<g;T++)for(var N=0;N<f;N++)E[T][N]=[];return E},h.prototype.addNodeToGrid=function(o,g,f){var E=0,T=0,N=0,v=0;E=parseInt(Math.floor((o.getRect().x-g)/this.repulsionRange)),T=parseInt(Math.floor((o.getRect().width+o.getRect().x-g)/this.repulsionRange)),N=parseInt(Math.floor((o.getRect().y-f)/this.repulsionRange)),v=parseInt(Math.floor((o.getRect().height+o.getRect().y-f)/this.repulsionRange));for(var O=E;O<=T;O++)for(var D=N;D<=v;D++)this.grid[O][D].push(o),o.setGridCoordinates(E,T,N,v)},h.prototype.updateGrid=function(){var o,g,f=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(o=0;o<f.length;o++)g=f[o],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(o,g,f,E){if(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&f||E){var T=new Set;o.surrounding=[];var N,v=this.grid;for(var O=o.startX-1;O<o.finishX+2;O++)for(var D=o.startY-1;D<o.finishY+2;D++)if(!(O<0||D<0||O>=v.length||D>=v[0].length))for(var R=0;R<v[O][D].length;R++){if(N=v[O][D][R],o.getOwner()!=N.getOwner()||o==N)continue;if(!g.has(N)&&!T.has(N)){var l=Math.abs(o.getCenterX()-N.getCenterX())-(o.getWidth()/2+N.getWidth()/2),p=Math.abs(o.getCenterY()-N.getCenterY())-(o.getHeight()/2+N.getHeight()/2);if(l<=this.repulsionRange&&p<=this.repulsionRange)T.add(N)}}o.surrounding=[].concat(a(T))}for(O=0;O<o.surrounding.length;O++)this.calcRepulsionForce(o,o.surrounding[O])},h.prototype.calcRepulsionRange=function(){return 0},m.exports=h},function(m,w,L){var a=L(1),i=L(7);function r(u,c,h){a.call(this,u,c,h),this.idealLength=i.DEFAULT_EDGE_LENGTH}r.prototype=Object.create(a.prototype);for(var s in a)r[s]=a[s];m.exports=r},function(m,w,L){var a=L(3);function i(s,u,c,h){a.call(this,s,u,c,h),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(a.prototype);for(var r in a)i[r]=a[r];i.prototype.setGridCoordinates=function(s,u,c,h){this.startX=s,this.finishX=u,this.startY=c,this.finishY=h},m.exports=i},function(m,w,L){function a(i,r){if(this.width=0,this.height=0,i!==null&&r!==null)this.height=r,this.width=i}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(i){this.width=i},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(i){this.height=i},m.exports=a},function(m,w,L){var a=L(14);function i(){this.map={},this.keys=[]}i.prototype.put=function(r,s){var u=a.createID(r);if(!this.contains(u))this.map[u]=s,this.keys.push(r)},i.prototype.contains=function(r){var s=a.createID(r);return this.map[r]!=null},i.prototype.get=function(r){var s=a.createID(r);return this.map[s]},i.prototype.keySet=function(){return this.keys},m.exports=i},function(m,w,L){var a=L(14);function i(){this.set={}}i.prototype.add=function(r){var s=a.createID(r);if(!this.contains(s))this.set[s]=r},i.prototype.remove=function(r){delete this.set[a.createID(r)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(r){return this.set[a.createID(r)]==r},i.prototype.isEmpty=function(){return this.size()===0},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(r){var s=Object.keys(this.set),u=s.length;for(var c=0;c<u;c++)r.push(this.set[s[c]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(r){var s=r.length;for(var u=0;u<s;u++){var c=r[u];this.add(c)}},m.exports=i},function(m,w,L){var a=function(){function u(c,h){for(var y=0;y<h.length;y++){var o=h[y];if(o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o)o.writable=!0;Object.defineProperty(c,o.key,o)}}return function(c,h,y){if(h)u(c.prototype,h);if(y)u(c,y);return c}}();function i(u,c){if(!(u instanceof c))throw TypeError("Cannot call a class as a function")}var r=L(11),s=function(){function u(c,h){if(i(this,u),h!==null||h!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(c instanceof r)y=c.size();else y=c.length;this._quicksort(c,0,y-1)}return a(u,[{key:"_quicksort",value:function(h,y,o){if(y<o){var g=this._partition(h,y,o);this._quicksort(h,y,g),this._quicksort(h,g+1,o)}}},{key:"_partition",value:function(h,y,o){var g=this._get(h,y),f=y,E=o;while(!0){while(this.compareFunction(g,this._get(h,E)))E--;while(this.compareFunction(this._get(h,f),g))f++;if(f<E)this._swap(h,f,E),f++,E--;else return E}}},{key:"_get",value:function(h,y){if(h instanceof r)return h.get_object_at(y);else return h[y]}},{key:"_set",value:function(h,y,o){if(h instanceof r)h.set_object_at(y,o);else h[y]=o}},{key:"_swap",value:function(h,y,o){var g=this._get(h,y);this._set(h,y,this._get(h,o)),this._set(h,o,g)}},{key:"_defaultCompareFunction",value:function(h,y){return y>h}}]),u}();m.exports=s},function(m,w,L){var a=function(){function s(u,c){for(var h=0;h<c.length;h++){var y=c[h];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(u,y.key,y)}}return function(u,c,h){if(c)s(u.prototype,c);if(h)s(u,h);return u}}();function i(s,u){if(!(s instanceof u))throw TypeError("Cannot call a class as a function")}var r=function(){function s(u,c){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,s),this.sequence1=u,this.sequence2=c,this.match_score=h,this.mismatch_penalty=y,this.gap_penalty=o,this.iMax=u.length+1,this.jMax=c.length+1,this.grid=Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=Array(this.jMax);for(var f=0;f<this.jMax;f++)this.grid[g][f]=0}this.tracebackGrid=Array(this.iMax);for(var E=0;E<this.iMax;E++){this.tracebackGrid[E]=Array(this.jMax);for(var T=0;T<this.jMax;T++)this.tracebackGrid[E][T]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(s,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var c=1;c<this.jMax;c++)this.grid[0][c]=this.grid[0][c-1]+this.gap_penalty,this.tracebackGrid[0][c]=[!1,!1,!0];for(var h=1;h<this.iMax;h++)this.grid[h][0]=this.grid[h-1][0]+this.gap_penalty,this.tracebackGrid[h][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var o=1;o<this.jMax;o++){var g=void 0;if(this.sequence1[y-1]===this.sequence2[o-1])g=this.grid[y-1][o-1]+this.match_score;else g=this.grid[y-1][o-1]+this.mismatch_penalty;var f=this.grid[y-1][o]+this.gap_penalty,E=this.grid[y][o-1]+this.gap_penalty,T=[g,f,E],N=this.arrayAllMaxIndexes(T);this.grid[y][o]=T[N[0]],this.tracebackGrid[y][o]=[N.includes(0),N.includes(1),N.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var c=[];c.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(c[0]){var h=c[0],y=this.tracebackGrid[h.pos[0]][h.pos[1]];if(y[0])c.push({pos:[h.pos[0]-1,h.pos[1]-1],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2});if(y[1])c.push({pos:[h.pos[0]-1,h.pos[1]],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:"-"+h.seq2});if(y[2])c.push({pos:[h.pos[0],h.pos[1]-1],seq1:"-"+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2});if(h.pos[0]===0&&h.pos[1]===0)this.alignments.push({sequence1:h.seq1,sequence2:h.seq2});c.shift()}return this.alignments}},{key:"getAllIndexes",value:function(c,h){var y=[],o=-1;while((o=c.indexOf(h,o+1))!==-1)y.push(o);return y}},{key:"arrayAllMaxIndexes",value:function(c){return this.getAllIndexes(c,Math.max.apply(null,c))}}]),s}();m.exports=r},function(m,w,L){var a=function(){return};a.FDLayout=L(18),a.FDLayoutConstants=L(7),a.FDLayoutEdge=L(19),a.FDLayoutNode=L(20),a.DimensionD=L(21),a.HashMap=L(22),a.HashSet=L(23),a.IGeometry=L(8),a.IMath=L(9),a.Integer=L(10),a.Point=L(12),a.PointD=L(4),a.RandomSeed=L(16),a.RectangleD=L(13),a.Transform=L(17),a.UniqueIDGeneretor=L(14),a.Quicksort=L(24),a.LinkedList=L(11),a.LGraphObject=L(2),a.LGraph=L(5),a.LEdge=L(1),a.LGraphManager=L(6),a.LNode=L(3),a.Layout=L(15),a.LayoutConstants=L(0),a.NeedlemanWunsch=L(25),m.exports=a},function(m,w,L){function a(){this.listeners=[]}var i=a.prototype;i.addListener=function(r,s){this.listeners.push({event:r,callback:s})},i.removeListener=function(r,s){for(var u=this.listeners.length;u>=0;u--){var c=this.listeners[u];if(c.event===r&&c.callback===s)this.listeners.splice(u,1)}},i.emit=function(r,s){for(var u=0;u<this.listeners.length;u++){var c=this.listeners[u];if(r===c.event)c.callback(s)}},m.exports=a}])})});var tt=se(function(Q,J){(function(w,L){if(typeof Q==="object"&&typeof J==="object")J.exports=L(z());else if(typeof define==="function"&&define.amd)define(["layout-base"],L);else if(typeof Q==="object")Q.coseBase=L(z());else w.coseBase=L(w.layoutBase)})(Q,function(m){return function(w){var L={};function a(i){if(L[i])return L[i].exports;var r=L[i]={i,l:!1,exports:{}};return w[i].call(r.exports,r,r.exports,a),r.l=!0,r.exports}return a.m=w,a.c=L,a.i=function(i){return i},a.d=function(i,r,s){if(!a.o(i,r))Object.defineProperty(i,r,{configurable:!1,enumerable:!0,get:s})},a.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return a.d(r,"a",r),r},a.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},a.p="",a(a.s=7)}([function(w,L){w.exports=m},function(w,L,a){var i=a(0).FDLayoutConstants;function r(){}for(var s in i)r[s]=i[s];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TREE_REDUCTION_ON_INCREMENTAL=!1,w.exports=r},function(w,L,a){var i=a(0).FDLayoutEdge;function r(u,c,h){i.call(this,u,c,h)}r.prototype=Object.create(i.prototype);for(var s in i)r[s]=i[s];w.exports=r},function(w,L,a){var i=a(0).LGraph;function r(u,c,h){i.call(this,u,c,h)}r.prototype=Object.create(i.prototype);for(var s in i)r[s]=i[s];w.exports=r},function(w,L,a){var i=a(0).LGraphManager;function r(u){i.call(this,u)}r.prototype=Object.create(i.prototype);for(var s in i)r[s]=i[s];w.exports=r},function(w,L,a){var i=a(0).FDLayoutNode,r=a(0).IMath;function s(c,h,y,o){i.call(this,c,h,y,o)}s.prototype=Object.create(i.prototype);for(var u in i)s[u]=i[u];s.prototype.move=function(){var c=this.graphManager.getLayout();if(this.displacementX=c.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=c.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>c.coolingFactor*c.maxNodeDisplacement)this.displacementX=c.coolingFactor*c.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>c.coolingFactor*c.maxNodeDisplacement)this.displacementY=c.coolingFactor*c.maxNodeDisplacement*r.sign(this.displacementY);if(this.child==null)this.moveBy(this.displacementX,this.displacementY);else if(this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY);else this.propogateDisplacementToChildren(this.displacementX,this.displacementY);c.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},s.prototype.propogateDisplacementToChildren=function(c,h){var y=this.getChild().getNodes(),o;for(var g=0;g<y.length;g++)if(o=y[g],o.getChild()==null)o.moveBy(c,h),o.displacementX+=c,o.displacementY+=h;else o.propogateDisplacementToChildren(c,h)},s.prototype.setPred1=function(c){this.pred1=c},s.prototype.getPred1=function(){return pred1},s.prototype.getPred2=function(){return pred2},s.prototype.setNext=function(c){this.next=c},s.prototype.getNext=function(){return next},s.prototype.setProcessed=function(c){this.processed=c},s.prototype.isProcessed=function(){return processed},w.exports=s},function(w,L,a){var i=a(0).FDLayout,r=a(4),s=a(3),u=a(5),c=a(2),h=a(1),y=a(0).FDLayoutConstants,o=a(0).LayoutConstants,g=a(0).Point,f=a(0).PointD,E=a(0).Layout,T=a(0).Integer,N=a(0).IGeometry,v=a(0).LGraph,O=a(0).Transform;function D(){i.call(this),this.toBeTiled={}}D.prototype=Object.create(i.prototype);for(var R in i)D[R]=i[R];D.prototype.newGraphManager=function(){var l=new r(this);return this.graphManager=l,l},D.prototype.newGraph=function(l){return new s(null,this.graphManager,l)},D.prototype.newNode=function(l){return new u(this.graphManager,l)},D.prototype.newEdge=function(l){return new c(null,null,l)},D.prototype.initParameters=function(){if(i.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(h.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=y.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=y.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=y.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1}},D.prototype.layout=function(){var l=o.DEFAULT_CREATE_BENDS_AS_NEEDED;if(l)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},D.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){var l=this.getFlatForest();if(l.length>0)this.positionNodesRadially(l);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var p=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(A){return p.has(A)});this.graphManager.setAllNodesToApplyGravitation(d),this.positionNodesRandomly()}}else if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var p=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(C){return p.has(C)});this.graphManager.setAllNodesToApplyGravitation(d)}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},D.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%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(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 l=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return l.has(I)});this.graphManager.setAllNodesToApplyGravitation(p),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var d=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(d,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){var l=this.graphManager.getAllNodes(),p={};for(var d=0;d<l.length;d++){var A=l[d].rect,I=l[d].id;p[I]={id:I,x:A.getCenterX(),y:A.getCenterY(),w:A.width,h:A.height}}return p},D.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var l=!1;if(y.ANIMATE==="during")this.emit("layoutstarted");else{while(!l)l=this.tick();this.graphManager.updateBounds()}},D.prototype.calculateNodesToApplyGravitationTo=function(){var l=[],p,d=this.graphManager.getGraphs(),A=d.length,I;for(I=0;I<A;I++)if(p=d[I],p.updateConnected(),!p.isConnected)l=l.concat(p.getNodes());return l},D.prototype.createBendpoints=function(){var l=[];l=l.concat(this.graphManager.getAllEdges());var p=new Set,d;for(d=0;d<l.length;d++){var A=l[d];if(!p.has(A)){var I=A.getSource(),C=A.getTarget();if(I==C)A.getBendpoints().push(new f),A.getBendpoints().push(new f),this.createDummyNodesForBendpoints(A),p.add(A);else{var M=[];if(M=M.concat(I.getEdgeListToNode(C)),M=M.concat(C.getEdgeListToNode(I)),!p.has(M[0])){if(M.length>1){var G;for(G=0;G<M.length;G++){var F=M[G];F.getBendpoints().push(new f),this.createDummyNodesForBendpoints(F)}}M.forEach(function(P){p.add(P)})}}}if(p.size==l.length)break}},D.prototype.positionNodesRadially=function(l){var p=new g(0,0),d=Math.ceil(Math.sqrt(l.length)),A=0,I=0,C=0,M=new f(0,0);for(var G=0;G<l.length;G++){if(G%d==0){if(C=0,I=A,G!=0)I+=h.DEFAULT_COMPONENT_SEPERATION;A=0}var F=l[G],P=E.findCenterOfTree(F);if(p.x=C,p.y=I,M=D.radialLayout(F,P,p),M.y>A)A=Math.floor(M.y);C=Math.floor(M.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new f(o.WORLD_CENTER_X-M.x/2,o.WORLD_CENTER_Y-M.y/2))},D.radialLayout=function(l,p,d){var A=Math.max(this.maxDiagonalInTree(l),h.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(p,null,0,359,0,A);var I=v.calculateBounds(l),C=new O;C.setDeviceOrgX(I.getMinX()),C.setDeviceOrgY(I.getMinY()),C.setWorldOrgX(d.x),C.setWorldOrgY(d.y);for(var M=0;M<l.length;M++){var G=l[M];G.transform(C)}var F=new f(I.getMaxX(),I.getMaxY());return C.inverseTransformPoint(F)},D.branchRadialLayout=function(l,p,d,A,I,C){var M=(A-d+1)/2;if(M<0)M+=180;var G=(M+d)%360,F=G*N.TWO_PI/360,P=Math.cos(F),b=I*Math.cos(F),U=I*Math.sin(F);l.setCenter(b,U);var x=[];x=x.concat(l.getEdges());var S=x.length;if(p!=null)S--;var Y=0,X=x.length,H,_=l.getEdgesBetween(p);while(_.length>1){var W=_[0];_.splice(0,1);var k=x.indexOf(W);if(k>=0)x.splice(k,1);X--,S--}if(p!=null)H=(x.indexOf(_[0])+1)%X;else H=0;var B=Math.abs(A-d)/S;for(var V=H;Y!=S;V=++V%X){var rt=x[V].getOtherEnd(l);if(rt==p)continue;var it=(d+Y*B)%360,ct=(it+B)%360;D.branchRadialLayout(rt,l,it,ct,I+C,C),Y++}},D.maxDiagonalInTree=function(l){var p=T.MIN_VALUE;for(var d=0;d<l.length;d++){var A=l[d],I=A.getDiagonal();if(I>p)p=I}return p},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var l=this,p={};this.memberGroups={},this.idToDummyNode={};var d=[],A=this.graphManager.getAllNodes();for(var I=0;I<A.length;I++){var C=A[I],M=C.getParent();if(this.getNodeDegreeWithChildren(C)===0&&(M.id==null||!this.getToBeTiled(M)))d.push(C)}for(var I=0;I<d.length;I++){var C=d[I],G=C.getParent().id;if(typeof p[G]>"u")p[G]=[];p[G]=p[G].concat(C)}Object.keys(p).forEach(function(F){if(p[F].length>1){var P="DummyCompound_"+F;l.memberGroups[P]=p[F];var b=p[F][0].getParent(),U=new u(l.graphManager);U.id=P,U.paddingLeft=b.paddingLeft||0,U.paddingRight=b.paddingRight||0,U.paddingBottom=b.paddingBottom||0,U.paddingTop=b.paddingTop||0,l.idToDummyNode[P]=U;var x=l.getGraphManager().add(l.newGraph(),U),S=b.getChild();S.add(U);for(var Y=0;Y<p[F].length;Y++){var X=p[F][Y];S.remove(X),x.add(X)}}})},D.prototype.clearCompounds=function(){var l={},p={};this.performDFSOnCompounds();for(var d=0;d<this.compoundOrder.length;d++)p[this.compoundOrder[d].id]=this.compoundOrder[d],l[this.compoundOrder[d].id]=[].concat(this.compoundOrder[d].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[d].getChild()),this.compoundOrder[d].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(l,p)},D.prototype.clearZeroDegreeMembers=function(){var l=this,p=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(d){var A=l.idToDummyNode[d];p[d]=l.tileNodes(l.memberGroups[d],A.paddingLeft+A.paddingRight),A.rect.width=p[d].width,A.rect.height=p[d].height})},D.prototype.repopulateCompounds=function(){for(var l=this.compoundOrder.length-1;l>=0;l--){var p=this.compoundOrder[l],{id:d,paddingLeft:A,paddingTop:I}=p;this.adjustLocations(this.tiledMemberPack[d],p.rect.x,p.rect.y,A,I)}},D.prototype.repopulateZeroDegreeMembers=function(){var l=this,p=this.tiledZeroDegreePack;Object.keys(p).forEach(function(d){var A=l.idToDummyNode[d],{paddingLeft:I,paddingTop:C}=A;l.adjustLocations(p[d],A.rect.x,A.rect.y,I,C)})},D.prototype.getToBeTiled=function(l){var p=l.id;if(this.toBeTiled[p]!=null)return this.toBeTiled[p];var d=l.getChild();if(d==null)return this.toBeTiled[p]=!1,!1;var A=d.getNodes();for(var I=0;I<A.length;I++){var C=A[I];if(this.getNodeDegree(C)>0)return this.toBeTiled[p]=!1,!1;if(C.getChild()==null){this.toBeTiled[C.id]=!1;continue}if(!this.getToBeTiled(C))return this.toBeTiled[p]=!1,!1}return this.toBeTiled[p]=!0,!0},D.prototype.getNodeDegree=function(l){var p=l.id,d=l.getEdges(),A=0;for(var I=0;I<d.length;I++){var C=d[I];if(C.getSource().id!==C.getTarget().id)A=A+1}return A},D.prototype.getNodeDegreeWithChildren=function(l){var p=this.getNodeDegree(l);if(l.getChild()==null)return p;var d=l.getChild().getNodes();for(var A=0;A<d.length;A++){var I=d[A];p+=this.getNodeDegreeWithChildren(I)}return p},D.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},D.prototype.fillCompexOrderByDFS=function(l){for(var p=0;p<l.length;p++){var d=l[p];if(d.getChild()!=null)this.fillCompexOrderByDFS(d.getChild().getNodes());if(this.getToBeTiled(d))this.compoundOrder.push(d)}},D.prototype.adjustLocations=function(l,p,d,A,I){p+=A,d+=I;var C=p;for(var M=0;M<l.rows.length;M++){var G=l.rows[M];p=C;var F=0;for(var P=0;P<G.length;P++){var b=G[P];if(b.rect.x=p,b.rect.y=d,p+=b.rect.width+l.horizontalPadding,b.rect.height>F)F=b.rect.height}d+=F+l.verticalPadding}},D.prototype.tileCompoundMembers=function(l,p){var d=this;this.tiledMemberPack=[],Object.keys(l).forEach(function(A){var I=p[A];d.tiledMemberPack[A]=d.tileNodes(l[A],I.paddingLeft+I.paddingRight),I.rect.width=d.tiledMemberPack[A].width,I.rect.height=d.tiledMemberPack[A].height})},D.prototype.tileNodes=function(l,p){var{TILING_PADDING_VERTICAL:d,TILING_PADDING_HORIZONTAL:A}=h,I={rows:[],rowWidth:[],rowHeight:[],width:0,height:p,verticalPadding:d,horizontalPadding:A};l.sort(function(G,F){if(G.rect.width*G.rect.height>F.rect.width*F.rect.height)return-1;if(G.rect.width*G.rect.height<F.rect.width*F.rect.height)return 1;return 0});for(var C=0;C<l.length;C++){var M=l[C];if(I.rows.length==0)this.insertNodeToRow(I,M,0,p);else if(this.canAddHorizontal(I,M.rect.width,M.rect.height))this.insertNodeToRow(I,M,this.getShortestRowIndex(I),p);else this.insertNodeToRow(I,M,I.rows.length,p);this.shiftToLastRow(I)}return I},D.prototype.insertNodeToRow=function(l,p,d,A){var I=A;if(d==l.rows.length){var C=[];l.rows.push(C),l.rowWidth.push(I),l.rowHeight.push(0)}var M=l.rowWidth[d]+p.rect.width;if(l.rows[d].length>0)M+=l.horizontalPadding;if(l.rowWidth[d]=M,l.width<M)l.width=M;var G=p.rect.height;if(d>0)G+=l.verticalPadding;var F=0;if(G>l.rowHeight[d])F=l.rowHeight[d],l.rowHeight[d]=G,F=l.rowHeight[d]-F;l.height+=F,l.rows[d].push(p)},D.prototype.getShortestRowIndex=function(l){var p=-1,d=Number.MAX_VALUE;for(var A=0;A<l.rows.length;A++)if(l.rowWidth[A]<d)p=A,d=l.rowWidth[A];return p},D.prototype.getLongestRowIndex=function(l){var p=-1,d=Number.MIN_VALUE;for(var A=0;A<l.rows.length;A++)if(l.rowWidth[A]>d)p=A,d=l.rowWidth[A];return p},D.prototype.canAddHorizontal=function(l,p,d){var A=this.getShortestRowIndex(l);if(A<0)return!0;var I=l.rowWidth[A];if(I+l.horizontalPadding+p<=l.width)return!0;var C=0;if(l.rowHeight[A]<d){if(A>0)C=d+l.verticalPadding-l.rowHeight[A]}var M;if(l.width-I>=p+l.horizontalPadding)M=(l.height+C)/(I+p+l.horizontalPadding);else M=(l.height+C)/l.width;C=d+l.verticalPadding;var G;if(l.width<p)G=(l.height+C)/p;else G=(l.height+C)/l.width;if(G<1)G=1/G;if(M<1)M=1/M;return M<G},D.prototype.shiftToLastRow=function(l){var p=this.getLongestRowIndex(l),d=l.rowWidth.length-1,A=l.rows[p],I=A[A.length-1],C=I.width+l.horizontalPadding;if(l.width-l.rowWidth[d]>C&&p!=d){A.splice(-1,1),l.rows[d].push(I),l.rowWidth[p]=l.rowWidth[p]-C,l.rowWidth[d]=l.rowWidth[d]+C,l.width=l.rowWidth[instance.getLongestRowIndex(l)];var M=Number.MIN_VALUE;for(var G=0;G<A.length;G++)if(A[G].height>M)M=A[G].height;if(p>0)M+=l.verticalPadding;var F=l.rowHeight[p]+l.rowHeight[d];if(l.rowHeight[p]=M,l.rowHeight[d]<I.height+l.verticalPadding)l.rowHeight[d]=I.height+l.verticalPadding;var P=l.rowHeight[p]+l.rowHeight[d];l.height+=P-F,this.shiftToLastRow(l)}},D.prototype.tilingPreLayout=function(){if(h.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},D.prototype.tilingPostLayout=function(){if(h.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},D.prototype.reduceTrees=function(){var l=[],p=!0,d;while(p){var A=this.graphManager.getAllNodes(),I=[];p=!1;for(var C=0;C<A.length;C++)if(d=A[C],d.getEdges().length==1&&!d.getEdges()[0].isInterGraph&&d.getChild()==null)I.push([d,d.getEdges()[0],d.getOwner()]),p=!0;if(p==!0){var M=[];for(var G=0;G<I.length;G++)if(I[G][0].getEdges().length==1)M.push(I[G]),I[G][0].getOwner().remove(I[G][0]);l.push(M),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=l},D.prototype.growTree=function(l){var p=l.length,d=l[p-1],A;for(var I=0;I<d.length;I++)A=d[I],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);l.splice(l.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},D.prototype.findPlaceforPrunedNode=function(l){var p,d,A=l[0];if(A==l[1].source)d=l[1].target;else d=l[1].source;var I=d.startX,C=d.finishX,M=d.startY,G=d.finishY,F=0,P=0,b=0,U=0,x=[F,b,P,U];if(M>0)for(var S=I;S<=C;S++)x[0]+=this.grid[S][M-1].length+this.grid[S][M].length-1;if(C<this.grid.length-1)for(var S=M;S<=G;S++)x[1]+=this.grid[C+1][S].length+this.grid[C][S].length-1;if(G<this.grid[0].length-1)for(var S=I;S<=C;S++)x[2]+=this.grid[S][G+1].length+this.grid[S][G].length-1;if(I>0)for(var S=M;S<=G;S++)x[3]+=this.grid[I-1][S].length+this.grid[I][S].length-1;var Y=T.MAX_VALUE,X,H;for(var _=0;_<x.length;_++)if(x[_]<Y)Y=x[_],X=1,H=_;else if(x[_]==Y)X++;if(X==3&&Y==0){if(x[0]==0&&x[1]==0&&x[2]==0)p=1;else if(x[0]==0&&x[1]==0&&x[3]==0)p=0;else if(x[0]==0&&x[2]==0&&x[3]==0)p=3;else if(x[1]==0&&x[2]==0&&x[3]==0)p=2}else if(X==2&&Y==0){var W=Math.floor(Math.random()*2);if(x[0]==0&&x[1]==0)if(W==0)p=0;else p=1;else if(x[0]==0&&x[2]==0)if(W==0)p=0;else p=2;else if(x[0]==0&&x[3]==0)if(W==0)p=0;else p=3;else if(x[1]==0&&x[2]==0)if(W==0)p=1;else p=2;else if(x[1]==0&&x[3]==0)if(W==0)p=1;else p=3;else if(W==0)p=2;else p=3}else if(X==4&&Y==0){var W=Math.floor(Math.random()*4);p=W}else p=H;if(p==0)A.setCenter(d.getCenterX(),d.getCenterY()-d.getHeight()/2-y.DEFAULT_EDGE_LENGTH-A.getHeight()/2);else if(p==1)A.setCenter(d.getCenterX()+d.getWidth()/2+y.DEFAULT_EDGE_LENGTH+A.getWidth()/2,d.getCenterY());else if(p==2)A.setCenter(d.getCenterX(),d.getCenterY()+d.getHeight()/2+y.DEFAULT_EDGE_LENGTH+A.getHeight()/2);else A.setCenter(d.getCenterX()-d.getWidth()/2-y.DEFAULT_EDGE_LENGTH-A.getWidth()/2,d.getCenterY())},w.exports=D},function(w,L,a){var i={};i.layoutBase=a(0),i.CoSEConstants=a(1),i.CoSEEdge=a(2),i.CoSEGraph=a(3),i.CoSEGraphManager=a(4),i.CoSELayout=a(6),i.CoSENode=a(5),w.exports=i}])})});var nt=se(function(j,et){(function(w,L){if(typeof j==="object"&&typeof et==="object")et.exports=L(tt());else if(typeof define==="function"&&define.amd)define(["cose-base"],L);else if(typeof j==="object")j.cytoscapeCoseBilkent=L(tt());else w.cytoscapeCoseBilkent=L(w.coseBase)})(j,function(m){return function(w){var L={};function a(i){if(L[i])return L[i].exports;var r=L[i]={i,l:!1,exports:{}};return w[i].call(r.exports,r,r.exports,a),r.l=!0,r.exports}return a.m=w,a.c=L,a.i=function(i){return i},a.d=function(i,r,s){if(!a.o(i,r))Object.defineProperty(i,r,{configurable:!1,enumerable:!0,get:s})},a.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return a.d(r,"a",r),r},a.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},a.p="",a(a.s=1)}([function(w,L){w.exports=m},function(w,L,a){var i=a(0).layoutBase.LayoutConstants,r=a(0).layoutBase.FDLayoutConstants,s=a(0).CoSEConstants,u=a(0).CoSELayout,c=a(0).CoSENode,h=a(0).layoutBase.PointD,y=a(0).layoutBase.DimensionD,o={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:0.45,nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.5};function g(N,v){var O={};for(var D in N)O[D]=N[D];for(var D in v)O[D]=v[D];return O}function f(N){this.options=g(o,N),E(this.options)}var E=function(v){if(v.nodeRepulsion!=null)s.DEFAULT_REPULSION_STRENGTH=r.DEFAULT_REPULSION_STRENGTH=v.nodeRepulsion;if(v.idealEdgeLength!=null)s.DEFAULT_EDGE_LENGTH=r.DEFAULT_EDGE_LENGTH=v.idealEdgeLength;if(v.edgeElasticity!=null)s.DEFAULT_SPRING_STRENGTH=r.DEFAULT_SPRING_STRENGTH=v.edgeElasticity;if(v.nestingFactor!=null)s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor;if(v.gravity!=null)s.DEFAULT_GRAVITY_STRENGTH=r.DEFAULT_GRAVITY_STRENGTH=v.gravity;if(v.numIter!=null)s.MAX_ITERATIONS=r.MAX_ITERATIONS=v.numIter;if(v.gravityRange!=null)s.DEFAULT_GRAVITY_RANGE_FACTOR=r.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange;if(v.gravityCompound!=null)s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound;if(v.gravityRangeCompound!=null)s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound;if(v.initialEnergyOnIncremental!=null)s.DEFAULT_COOLING_FACTOR_INCREMENTAL=r.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental;if(v.quality=="draft")i.QUALITY=0;else if(v.quality=="proof")i.QUALITY=2;else i.QUALITY=1;s.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,s.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!v.randomize,s.ANIMATE=r.ANIMATE=i.ANIMATE=v.animate,s.TILE=v.tile,s.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical==="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,s.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal==="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal};f.prototype.run=function(){var N,v,O=this.options,D=this.idToLNode={},R=this.layout=new u,l=this;l.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var p=R.newGraphManager();this.gm=p;var d=this.options.eles.nodes(),A=this.options.eles.edges();this.root=p.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(d),R);for(var I=0;I<A.length;I++){var C=A[I],M=this.idToLNode[C.data("source")],G=this.idToLNode[C.data("target")];if(M!==G&&M.getEdgesBetween(G).length==0){var F=p.add(R.newEdge(),M,G);F.id=C.id()}}var P=function(x,S){if(typeof x==="number")x=S;var Y=x.data("id"),X=l.idToLNode[Y];return{x:X.getRect().getCenterX(),y:X.getRect().getCenterY()}},b=function U(){var x=function(){if(O.fit)O.cy.fit(O.eles,O.padding);if(!N)N=!0,l.cy.one("layoutready",O.ready),l.cy.trigger({type:"layoutready",layout:l})},S=l.options.refresh,Y;for(var X=0;X<S&&!Y;X++)Y=l.stopped||l.layout.tick();if(Y){if(R.checkLayoutSuccess()&&!R.isSubLayout)R.doPostLayout();if(R.tilingPostLayout)R.tilingPostLayout();if(R.isLayoutFinished=!0,l.options.eles.nodes().positions(P),x(),l.cy.one("layoutstop",l.options.stop),l.cy.trigger({type:"layoutstop",layout:l}),v)cancelAnimationFrame(v);N=!1;return}var H=l.layout.getPositionsData();O.eles.nodes().positions(function(_,W){if(typeof _==="number")_=W;if(!_.isParent()){var k=_.id(),B=H[k],V=_;while(B==null)if(B=H[V.data("parent")]||H["DummyCompound_"+V.data("parent")],H[k]=B,V=V.parent()[0],V==null)break;if(B!=null)return{x:B.x,y:B.y};else return{x:_.position("x"),y:_.position("y")}}}),x(),v=requestAnimationFrame(U)};if(R.addListener("layoutstarted",function(){if(l.options.animate==="during")v=requestAnimationFrame(b)}),R.runLayout(),this.options.animate!=="during")l.options.eles.nodes().not(":parent").layoutPositions(l,l.options,P),N=!1;return this},f.prototype.getTopMostNodes=function(N){var v={};for(var O=0;O<N.length;O++)v[N[O].id()]=!0;var D=N.filter(function(R,l){if(typeof R==="number")R=l;var p=R.parent()[0];while(p!=null){if(v[p.id()])return!1;p=p.parent()[0]}return!0});return D},f.prototype.processChildrenList=function(N,v,O){var D=v.length;for(var R=0;R<D;R++){var l=v[R],p=l.children(),d,A=l.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(l.outerWidth()!=null&&l.outerHeight()!=null)d=N.add(new c(O.graphManager,new h(l.position("x")-A.w/2,l.position("y")-A.h/2),new y(parseFloat(A.w),parseFloat(A.h))));else d=N.add(new c(this.graphManager));if(d.id=l.data("id"),d.paddingLeft=parseInt(l.css("padding")),d.paddingTop=parseInt(l.css("padding")),d.paddingRight=parseInt(l.css("padding")),d.paddingBottom=parseInt(l.css("padding")),this.options.nodeDimensionsIncludeLabels){if(l.isParent()){var I=l.boundingBox({includeLabels:!0,includeNodes:!1}).w,C=l.boundingBox({includeLabels:!0,includeNodes:!1}).h,M=l.css("text-halign");d.labelWidth=I,d.labelHeight=C,d.labelPos=M}}if(this.idToLNode[l.data("id")]=d,isNaN(d.rect.x))d.rect.x=0;if(isNaN(d.rect.y))d.rect.y=0;if(p!=null&&p.length>0){var G=O.getGraphManager().add(O.newGraph(),d);this.processChildrenList(G,p,O)}}},f.prototype.stop=function(){return this.stopped=!0,this};var T=function(v){v("layout","cose-bilkent",f)};if(typeof cytoscape<"u")T(cytoscape);w.exports=T}])})});var st=K(nt(),1);Re.use(st.default);function ot(m,w){m.forEach((L)=>{let a={id:L.id,labelText:L.label,height:L.height,width:L.width,padding:L.padding??0};Object.keys(L).forEach((i)=>{if(!["id","label","height","width","padding","x","y"].includes(i))a[i]=L[i]}),w.add({group:"nodes",data:a,position:{x:L.x??0,y:L.y??0}})})}e(ot,"addNodes");function at(m,w){m.forEach((L)=>{let a={id:L.id,source:L.start,target:L.end};Object.keys(L).forEach((i)=>{if(!["id","start","end"].includes(i))a[i]=L[i]}),w.add({group:"edges",data:a})})}e(at,"addEdges");function ht(m){return new Promise((w)=>{let L=n("body").append("div").attr("id","cy").attr("style","display:none"),a=Re({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});L.remove(),ot(m.nodes,a),at(m.edges,a),a.nodes().forEach(function(r){r.layoutDimensions=()=>{let s=r.data();return{w:s.width,h:s.height}}});let i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};a.layout(i).run(),a.ready((r)=>{t.info("Cytoscape ready",r),w(a)})})}e(ht,"createCytoscapeInstance");function lt(m){return m.nodes().map((w)=>{let L=w.data(),a=w.position(),i={id:L.id,x:a.x,y:a.y};return Object.keys(L).forEach((r)=>{if(r!=="id")i[r]=L[r]}),i})}e(lt,"extractPositionedNodes");function ut(m){return m.edges().map((w)=>{let L=w.data(),a=w._private.rscratch,i={id:L.id,source:L.source,target:L.target,startX:a.startX,startY:a.startY,midX:a.midX,midY:a.midY,endX:a.endX,endY:a.endY};return Object.keys(L).forEach((r)=>{if(!["id","source","target"].includes(r))i[r]=L[r]}),i})}e(ut,"extractPositionedEdges");async function gt(m,w){t.debug("Starting cose-bilkent layout algorithm");try{ft(m);let L=await ht(m),a=lt(L),i=ut(L);return t.debug(`Layout completed: ${a.length} nodes, ${i.length} edges`),{nodes:a,edges:i}}catch(L){throw t.error("Error in cose-bilkent layout algorithm:",L),L}}e(gt,"executeCoseBilkentLayout");function ft(m){if(!m)throw Error("Layout data is required");if(!m.config)throw Error("Configuration is required in layout data");if(!m.rootNode)throw Error("Root node is required");if(!m.nodes||!Array.isArray(m.nodes))throw Error("No nodes found in layout data");if(!Array.isArray(m.edges))throw Error("Edges array is required in layout data");return!0}e(ft,"validateLayoutData");var pt=e(async(m,w,{insertCluster:L,insertEdge:a,insertEdgeLabel:i,insertMarkers:r,insertNode:s,log:u,positionEdgeLabel:c},{algorithm:h})=>{let y={},o={},g=w.select("g");r(g,m.markers,m.type,m.diagramId);let f=g.insert("g").attr("class","subgraphs"),E=g.insert("g").attr("class","edgePaths"),T=g.insert("g").attr("class","edgeLabels"),N=g.insert("g").attr("class","nodes");u.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(m.nodes.map(async(D)=>{if(D.isGroup){let R={...D};o[D.id]=R,y[D.id]=R,await L(f,D)}else{let R={...D};y[D.id]=R;let l=await s(N,D,{config:m.config,dir:m.direction||"TB"}),p=l.node().getBBox();R.width=p.width,R.height=p.height,R.domId=l,u.debug(`Node ${D.id} dimensions: ${p.width}x${p.height}`)}})),u.debug("Running cose-bilkent layout algorithm");let v={...m,nodes:m.nodes.map((D)=>{let R=y[D.id];return{...D,width:R.width,height:R.height}})},O=await gt(v,m.config);u.debug("Positioning nodes based on layout results"),O.nodes.forEach((D)=>{let R=y[D.id];if(R?.domId)R.domId.attr("transform",`translate(${D.x}, ${D.y})`),R.x=D.x,R.y=D.y,u.debug(`Positioned node ${R.id} at center (${D.x}, ${D.y})`)}),O.edges.forEach((D)=>{let R=m.edges.find((l)=>l.id===D.id);if(R)R.points=[{x:D.startX,y:D.startY},{x:D.midX,y:D.midY},{x:D.endX,y:D.endY}]}),u.debug("Inserting and positioning edges"),await Promise.all(m.edges.map(async(D)=>{let R=await i(T,D),l=y[D.start??""],p=y[D.end??""];if(l&&p){let d=O.edges.find((A)=>A.id===D.id);if(d){u.debug("APA01 positionedEdge",d);let A={...D},I=a(E,A,o,m.type,l,p,m.diagramId);c(A,I)}else{let A={...D,points:[{x:l.x||0,y:l.y||0},{x:p.x||0,y:p.y||0}]},I=a(E,A,o,m.type,l,p,m.diagramId);c(A,I)}}})),u.debug("Cose-bilkent rendering completed")},"render"),Lt=pt;export{Lt as render};
1
+ import{e,t,n}from"./index-nwsya6dj.js";import{Re}from"./index-6ceya556.js";import{K,oe}from"./index-v119nznk.js";var z=oe(function(Z,q){(function(w,L){if(typeof Z==="object"&&typeof q==="object")q.exports=L();else if(typeof define==="function"&&define.amd)define([],L);else if(typeof Z==="object")Z.layoutBase=L();else w.layoutBase=L()})(Z,function(){return function(m){var w={};function L(a){if(w[a])return w[a].exports;var i=w[a]={i:a,l:!1,exports:{}};return m[a].call(i.exports,i,i.exports,L),i.l=!0,i.exports}return L.m=m,L.c=w,L.i=function(a){return a},L.d=function(a,i,r){if(!L.o(a,i))Object.defineProperty(a,i,{configurable:!1,enumerable:!0,get:r})},L.n=function(a){var i=a&&a.__esModule?function(){return a.default}:function(){return a};return L.d(i,"a",i),i},L.o=function(a,i){return Object.prototype.hasOwnProperty.call(a,i)},L.p="",L(L.s=26)}([function(m,w,L){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1000,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,m.exports=a},function(m,w,L){var a=L(2),i=L(8),r=L(9);function s(c,h,y){a.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=c,this.target=h}s.prototype=Object.create(a.prototype);for(var u in a)s[u]=a[u];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;else if(this.target===c)return this.source;else throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(c,h){var y=this.getOtherEnd(c),o=h.getGraphManager().getRoot();while(!0){if(y.getOwner()==h)return y;if(y.getOwner()==o)break;y=y.getOwner().getParent()}return null},s.prototype.updateLength=function(){var c=[,,,,];if(this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),c),!this.isOverlapingSourceAndTarget){if(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[3],Math.abs(this.lengthX)<1)this.lengthX=r.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=r.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},s.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=r.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=r.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=s},function(m,w,L){function a(i){this.vGraphObject=i}m.exports=a},function(m,w,L){var a=L(2),i=L(10),r=L(13),s=L(0),u=L(16),c=L(4);function h(o,g,f,E){if(f==null&&E==null)E=g;if(a.call(this,E),o.graphManager!=null)o=o.graphManager;if(this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=E,this.edges=[],this.graphManager=o,f!=null&&g!=null)this.rect=new r(g.x,g.y,f.width,f.height);else this.rect=new r}h.prototype=Object.create(a.prototype);for(var y in a)h[y]=a[y];h.prototype.getEdges=function(){return this.edges},h.prototype.getChild=function(){return this.child},h.prototype.getOwner=function(){return this.owner},h.prototype.getWidth=function(){return this.rect.width},h.prototype.setWidth=function(o){this.rect.width=o},h.prototype.getHeight=function(){return this.rect.height},h.prototype.setHeight=function(o){this.rect.height=o},h.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},h.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},h.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},h.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},h.prototype.getRect=function(){return this.rect},h.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},h.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},h.prototype.setRect=function(o,g){this.rect.x=o.x,this.rect.y=o.y,this.rect.width=g.width,this.rect.height=g.height},h.prototype.setCenter=function(o,g){this.rect.x=o-this.rect.width/2,this.rect.y=g-this.rect.height/2},h.prototype.setLocation=function(o,g){this.rect.x=o,this.rect.y=g},h.prototype.moveBy=function(o,g){this.rect.x+=o,this.rect.y+=g},h.prototype.getEdgeListToNode=function(o){var g=[],f,E=this;return E.edges.forEach(function(T){if(T.target==o){if(T.source!=E)throw"Incorrect edge source!";g.push(T)}}),g},h.prototype.getEdgesBetween=function(o){var g=[],f,E=this;return E.edges.forEach(function(T){if(!(T.source==E||T.target==E))throw"Incorrect edge source and/or target";if(T.target==o||T.source==o)g.push(T)}),g},h.prototype.getNeighborsList=function(){var o=new Set,g=this;return g.edges.forEach(function(f){if(f.source==g)o.add(f.target);else{if(f.target!=g)throw"Incorrect incidency!";o.add(f.source)}}),o},h.prototype.withChildren=function(){var o=new Set,g,f;if(o.add(this),this.child!=null){var E=this.child.getNodes();for(var T=0;T<E.length;T++)g=E[T],f=g.withChildren(),f.forEach(function(N){o.add(N)})}return o},h.prototype.getNoOfChildren=function(){var o=0,g;if(this.child==null)o=1;else{var f=this.child.getNodes();for(var E=0;E<f.length;E++)g=f[E],o+=g.getNoOfChildren()}if(o==0)o=1;return o},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},h.prototype.scatter=function(){var o,g,f=-s.INITIAL_WORLD_BOUNDARY,E=s.INITIAL_WORLD_BOUNDARY;o=s.WORLD_CENTER_X+u.nextDouble()*(E-f)+f;var T=-s.INITIAL_WORLD_BOUNDARY,N=s.INITIAL_WORLD_BOUNDARY;g=s.WORLD_CENTER_Y+u.nextDouble()*(N-T)+T,this.rect.x=o,this.rect.y=g},h.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var o=this.getChild();if(o.updateBounds(!0),this.rect.x=o.getLeft(),this.rect.y=o.getTop(),this.setWidth(o.getRight()-o.getLeft()),this.setHeight(o.getBottom()-o.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var g=o.getRight()-o.getLeft(),f=o.getBottom()-o.getTop();if(this.labelWidth>g)this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth);if(this.labelHeight>f){if(this.labelPos=="center")this.rect.y-=(this.labelHeight-f)/2;else if(this.labelPos=="top")this.rect.y-=this.labelHeight-f;this.setHeight(this.labelHeight)}}}},h.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},h.prototype.transform=function(o){var g=this.rect.x;if(g>s.WORLD_BOUNDARY)g=s.WORLD_BOUNDARY;else if(g<-s.WORLD_BOUNDARY)g=-s.WORLD_BOUNDARY;var f=this.rect.y;if(f>s.WORLD_BOUNDARY)f=s.WORLD_BOUNDARY;else if(f<-s.WORLD_BOUNDARY)f=-s.WORLD_BOUNDARY;var E=new c(g,f),T=o.inverseTransformPoint(E);this.setLocation(T.x,T.y)},h.prototype.getLeft=function(){return this.rect.x},h.prototype.getRight=function(){return this.rect.x+this.rect.width},h.prototype.getTop=function(){return this.rect.y},h.prototype.getBottom=function(){return this.rect.y+this.rect.height},h.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},m.exports=h},function(m,w,L){function a(i,r){if(i==null&&r==null)this.x=0,this.y=0;else this.x=i,this.y=r}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(i){this.x=i},a.prototype.setY=function(i){this.y=i},a.prototype.getDifference=function(i){return new DimensionD(this.x-i.x,this.y-i.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(i){return this.x+=i.width,this.y+=i.height,this},m.exports=a},function(m,w,L){var a=L(2),i=L(10),r=L(0),s=L(6),u=L(3),c=L(1),h=L(13),y=L(12),o=L(11);function g(E,T,N){if(a.call(this,N),this.estimatedSize=i.MIN_VALUE,this.margin=r.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=E,T!=null&&T instanceof s)this.graphManager=T;else if(T!=null&&T instanceof Layout)this.graphManager=T.graphManager}g.prototype=Object.create(a.prototype);for(var f in a)g[f]=a[f];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(E,T,N){if(T==null&&N==null){var v=E;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(v)>-1)throw"Node already in graph!";return v.owner=this,this.getNodes().push(v),v}else{var O=E;if(!(this.getNodes().indexOf(T)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(T.owner==N.owner&&T.owner==this))throw"Both owners must be this graph!";if(T.owner!=N.owner)return null;if(O.source=T,O.target=N,O.isInterGraph=!1,this.getEdges().push(O),T.edges.push(O),N!=T)N.edges.push(O);return O}},g.prototype.remove=function(E){var T=E;if(E instanceof u){if(T==null)throw"Node is null!";if(!(T.owner!=null&&T.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var N=T.edges.slice(),v,O=N.length;for(var D=0;D<O;D++)if(v=N[D],v.isInterGraph)this.graphManager.remove(v);else v.source.owner.remove(v);var R=this.nodes.indexOf(T);if(R==-1)throw"Node not in owner node list!";this.nodes.splice(R,1)}else if(E instanceof c){var v=E;if(v==null)throw"Edge is null!";if(!(v.source!=null&&v.target!=null))throw"Source and/or target is null!";if(!(v.source.owner!=null&&v.target.owner!=null&&v.source.owner==this&&v.target.owner==this))throw"Source and/or target owner is invalid!";var l=v.source.edges.indexOf(v),p=v.target.edges.indexOf(v);if(!(l>-1&&p>-1))throw"Source and/or target doesn't know this edge!";if(v.source.edges.splice(l,1),v.target!=v.source)v.target.edges.splice(p,1);var R=v.source.owner.getEdges().indexOf(v);if(R==-1)throw"Not in owner's edge list!";v.source.owner.getEdges().splice(R,1)}},g.prototype.updateLeftTop=function(){var{MAX_VALUE:E,MAX_VALUE:T}=i,N,v,O,D=this.getNodes(),R=D.length;for(var l=0;l<R;l++){var p=D[l];if(N=p.getTop(),v=p.getLeft(),E>N)E=N;if(T>v)T=v}if(E==i.MAX_VALUE)return null;if(D[0].getParent().paddingLeft!=null)O=D[0].getParent().paddingLeft;else O=this.margin;return this.left=T-O,this.top=E-O,new y(this.left,this.top)},g.prototype.updateBounds=function(E){var T=i.MAX_VALUE,N=-i.MAX_VALUE,v=i.MAX_VALUE,O=-i.MAX_VALUE,D,R,l,p,d,A=this.nodes,I=A.length;for(var C=0;C<I;C++){var M=A[C];if(E&&M.child!=null)M.updateBounds();if(D=M.getLeft(),R=M.getRight(),l=M.getTop(),p=M.getBottom(),T>D)T=D;if(N<R)N=R;if(v>l)v=l;if(O<p)O=p}var G=new h(T,v,N-T,O-v);if(T==i.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(A[0].getParent().paddingLeft!=null)d=A[0].getParent().paddingLeft;else d=this.margin;this.left=G.x-d,this.right=G.x+G.width+d,this.top=G.y-d,this.bottom=G.y+G.height+d},g.calculateBounds=function(E){var T=i.MAX_VALUE,N=-i.MAX_VALUE,v=i.MAX_VALUE,O=-i.MAX_VALUE,D,R,l,p,d=E.length;for(var A=0;A<d;A++){var I=E[A];if(D=I.getLeft(),R=I.getRight(),l=I.getTop(),p=I.getBottom(),T>D)T=D;if(N<R)N=R;if(v>l)v=l;if(O<p)O=p}var C=new h(T,v,N-T,O-v);return C},g.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){var E=0,T=this.nodes,N=T.length;for(var v=0;v<N;v++){var O=T[v];E+=O.calcEstimatedSize()}if(E==0)this.estimatedSize=r.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=E/Math.sqrt(this.nodes.length);return this.estimatedSize},g.prototype.updateConnected=function(){var E=this;if(this.nodes.length==0){this.isConnected=!0;return}var T=new o,N=new Set,v=this.nodes[0],O,D,R=v.withChildren();R.forEach(function(C){T.push(C),N.add(C)});while(T.length!==0){v=T.shift(),O=v.getEdges();var l=O.length;for(var p=0;p<l;p++){var d=O[p];if(D=d.getOtherEndInGraph(v,this),D!=null&&!N.has(D)){var A=D.withChildren();A.forEach(function(C){T.push(C),N.add(C)})}}}if(this.isConnected=!1,N.size>=this.nodes.length){var I=0;if(N.forEach(function(C){if(C.owner==E)I++}),I==this.nodes.length)this.isConnected=!0}},m.exports=g},function(m,w,L){var a,i=L(1);function r(s){a=L(5),this.layout=s,this.graphs=[],this.edges=[]}r.prototype.addRoot=function(){var s=this.layout.newGraph(),u=this.layout.newNode(null),c=this.add(s,u);return this.setRootGraph(c),this.rootGraph},r.prototype.add=function(s,u,c,h,y){if(c==null&&h==null&&y==null){if(s==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return s.parent=u,u.child=s,s}else{y=c,h=u,c=s;var o=h.getOwner(),g=y.getOwner();if(!(o!=null&&o.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(o==g)return c.isInterGraph=!1,o.add(c,h,y);else{if(c.isInterGraph=!0,c.source=h,c.target=y,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}}},r.prototype.remove=function(s){if(s instanceof a){var u=s;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var c=[];c=c.concat(u.getEdges());var h,y=c.length;for(var o=0;o<y;o++)h=c[o],u.remove(h);var g=[];g=g.concat(u.getNodes());var f;y=g.length;for(var o=0;o<y;o++)f=g[o],u.remove(f);if(u==this.rootGraph)this.setRootGraph(null);var E=this.graphs.indexOf(u);this.graphs.splice(E,1),u.parent=null}else if(s instanceof i){if(h=s,h==null)throw"Edge is null!";if(!h.isInterGraph)throw"Not an inter-graph edge!";if(!(h.source!=null&&h.target!=null))throw"Source and/or target is null!";if(!(h.source.edges.indexOf(h)!=-1&&h.target.edges.indexOf(h)!=-1))throw"Source and/or target doesn't know this edge!";var E=h.source.edges.indexOf(h);if(h.source.edges.splice(E,1),E=h.target.edges.indexOf(h),h.target.edges.splice(E,1),!(h.source.owner!=null&&h.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(h.source.owner.getGraphManager().edges.indexOf(h)==-1)throw"Not in owner graph manager's edge list!";var E=h.source.owner.getGraphManager().edges.indexOf(h);h.source.owner.getGraphManager().edges.splice(E,1)}},r.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},r.prototype.getGraphs=function(){return this.graphs},r.prototype.getAllNodes=function(){if(this.allNodes==null){var s=[],u=this.getGraphs(),c=u.length;for(var h=0;h<c;h++)s=s.concat(u[h].getNodes());this.allNodes=s}return this.allNodes},r.prototype.resetAllNodes=function(){this.allNodes=null},r.prototype.resetAllEdges=function(){this.allEdges=null},r.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},r.prototype.getAllEdges=function(){if(this.allEdges==null){var s=[],u=this.getGraphs(),c=u.length;for(var h=0;h<u.length;h++)s=s.concat(u[h].getEdges());s=s.concat(this.edges),this.allEdges=s}return this.allEdges},r.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},r.prototype.setAllNodesToApplyGravitation=function(s){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=s},r.prototype.getRoot=function(){return this.rootGraph},r.prototype.setRootGraph=function(s){if(s.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=s,s.parent==null)s.parent=this.layout.newNode("Root node")},r.prototype.getLayout=function(){return this.layout},r.prototype.isOneAncestorOfOther=function(s,u){if(!(s!=null&&u!=null))throw"assert failed";if(s==u)return!0;var c=s.getOwner(),h;do{if(h=c.getParent(),h==null)break;if(h==u)return!0;if(c=h.getOwner(),c==null)break}while(!0);c=u.getOwner();do{if(h=c.getParent(),h==null)break;if(h==s)return!0;if(c=h.getOwner(),c==null)break}while(!0);return!1},r.prototype.calcLowestCommonAncestors=function(){var s,u,c,h,y,o=this.getAllEdges(),g=o.length;for(var f=0;f<g;f++){if(s=o[f],u=s.source,c=s.target,s.lca=null,s.sourceInLca=u,s.targetInLca=c,u==c){s.lca=u.getOwner();continue}h=u.getOwner();while(s.lca==null){s.targetInLca=c,y=c.getOwner();while(s.lca==null){if(y==h){s.lca=y;break}if(y==this.rootGraph)break;if(s.lca!=null)throw"assert failed";s.targetInLca=y.getParent(),y=s.targetInLca.getOwner()}if(h==this.rootGraph)break;if(s.lca==null)s.sourceInLca=h.getParent(),h=s.sourceInLca.getOwner()}if(s.lca==null)throw"assert failed"}},r.prototype.calcLowestCommonAncestor=function(s,u){if(s==u)return s.getOwner();var c=s.getOwner();do{if(c==null)break;var h=u.getOwner();do{if(h==null)break;if(h==c)return h;h=h.getParent().getOwner()}while(!0);c=c.getParent().getOwner()}while(!0);return c},r.prototype.calcInclusionTreeDepths=function(s,u){if(s==null&&u==null)s=this.rootGraph,u=1;var c,h=s.getNodes(),y=h.length;for(var o=0;o<y;o++)if(c=h[o],c.inclusionTreeDepth=u,c.child!=null)this.calcInclusionTreeDepths(c.child,u+1)},r.prototype.includesInvalidEdge=function(){var s,u=this.edges.length;for(var c=0;c<u;c++)if(s=this.edges[c],this.isOneAncestorOfOther(s.source,s.target))return!0;return!1},m.exports=r},function(m,w,L){var a=L(0);function i(){}for(var r in a)i[r]=a[r];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=0.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=0.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,i.COOLING_ADAPTATION_FACTOR=0.33,i.ADAPTATION_LOWER_NODE_LIMIT=1000,i.ADAPTATION_UPPER_NODE_LIMIT=5000,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=i},function(m,w,L){var a=L(12);function i(){}i.calcSeparationAmount=function(r,s,u,c){if(!r.intersects(s))throw"assert failed";var h=[,,];if(this.decideDirectionsForOverlappingNodes(r,s,h),u[0]=Math.min(r.getRight(),s.getRight())-Math.max(r.x,s.x),u[1]=Math.min(r.getBottom(),s.getBottom())-Math.max(r.y,s.y),r.getX()<=s.getX()&&r.getRight()>=s.getRight())u[0]+=Math.min(s.getX()-r.getX(),r.getRight()-s.getRight());else if(s.getX()<=r.getX()&&s.getRight()>=r.getRight())u[0]+=Math.min(r.getX()-s.getX(),s.getRight()-r.getRight());if(r.getY()<=s.getY()&&r.getBottom()>=s.getBottom())u[1]+=Math.min(s.getY()-r.getY(),r.getBottom()-s.getBottom());else if(s.getY()<=r.getY()&&s.getBottom()>=r.getBottom())u[1]+=Math.min(r.getY()-s.getY(),s.getBottom()-r.getBottom());var y=Math.abs((s.getCenterY()-r.getCenterY())/(s.getCenterX()-r.getCenterX()));if(s.getCenterY()===r.getCenterY()&&s.getCenterX()===r.getCenterX())y=1;var o=y*u[0],g=u[1]/y;if(u[0]<g)g=u[0];else o=u[1];u[0]=-1*h[0]*(g/2+c),u[1]=-1*h[1]*(o/2+c)},i.decideDirectionsForOverlappingNodes=function(r,s,u){if(r.getCenterX()<s.getCenterX())u[0]=-1;else u[0]=1;if(r.getCenterY()<s.getCenterY())u[1]=-1;else u[1]=1},i.getIntersection2=function(r,s,u){var c=r.getCenterX(),h=r.getCenterY(),y=s.getCenterX(),o=s.getCenterY();if(r.intersects(s))return u[0]=c,u[1]=h,u[2]=y,u[3]=o,!0;var g=r.getX(),f=r.getY(),E=r.getRight(),T=r.getX(),N=r.getBottom(),v=r.getRight(),O=r.getWidthHalf(),D=r.getHeightHalf(),R=s.getX(),l=s.getY(),p=s.getRight(),d=s.getX(),A=s.getBottom(),I=s.getRight(),C=s.getWidthHalf(),M=s.getHeightHalf(),G=!1,F=!1;if(c===y){if(h>o)return u[0]=c,u[1]=f,u[2]=y,u[3]=A,!1;else if(h<o)return u[0]=c,u[1]=N,u[2]=y,u[3]=l,!1}else if(h===o){if(c>y)return u[0]=g,u[1]=h,u[2]=p,u[3]=o,!1;else if(c<y)return u[0]=E,u[1]=h,u[2]=R,u[3]=o,!1}else{var P=r.height/r.width,b=s.height/s.width,U=(o-h)/(y-c),x=void 0,S=void 0,Y=void 0,X=void 0,H=void 0,_=void 0;if(-P===U)if(c>y)u[0]=T,u[1]=N,G=!0;else u[0]=E,u[1]=f,G=!0;else if(P===U)if(c>y)u[0]=g,u[1]=f,G=!0;else u[0]=v,u[1]=N,G=!0;if(-b===U)if(y>c)u[2]=d,u[3]=A,F=!0;else u[2]=p,u[3]=l,F=!0;else if(b===U)if(y>c)u[2]=R,u[3]=l,F=!0;else u[2]=I,u[3]=A,F=!0;if(G&&F)return!1;if(c>y)if(h>o)x=this.getCardinalDirection(P,U,4),S=this.getCardinalDirection(b,U,2);else x=this.getCardinalDirection(-P,U,3),S=this.getCardinalDirection(-b,U,1);else if(h>o)x=this.getCardinalDirection(-P,U,1),S=this.getCardinalDirection(-b,U,3);else x=this.getCardinalDirection(P,U,2),S=this.getCardinalDirection(b,U,4);if(!G)switch(x){case 1:X=f,Y=c+-D/U,u[0]=Y,u[1]=X;break;case 2:Y=v,X=h+O*U,u[0]=Y,u[1]=X;break;case 3:X=N,Y=c+D/U,u[0]=Y,u[1]=X;break;case 4:Y=T,X=h+-O*U,u[0]=Y,u[1]=X;break}if(!F)switch(S){case 1:_=l,H=y+-M/U,u[2]=H,u[3]=_;break;case 2:H=I,_=o+C*U,u[2]=H,u[3]=_;break;case 3:_=A,H=y+M/U,u[2]=H,u[3]=_;break;case 4:H=d,_=o+-C*U,u[2]=H,u[3]=_;break}}return!1},i.getCardinalDirection=function(r,s,u){if(r>s)return u;else return 1+u%4},i.getIntersection=function(r,s,u,c){if(c==null)return this.getIntersection2(r,s,u);var{x:h,y}=r,{x:o,y:g}=s,{x:f,y:E}=u,{x:T,y:N}=c,v=void 0,O=void 0,D=void 0,R=void 0,l=void 0,p=void 0,d=void 0,A=void 0,I=void 0;if(D=g-y,l=h-o,d=o*y-h*g,R=N-E,p=f-T,A=T*E-f*N,I=D*p-R*l,I===0)return null;return v=(l*A-p*d)/I,O=(R*d-D*A)/I,new a(v,O)},i.angleOfVector=function(r,s,u,c){var h=void 0;if(r!==u){if(h=Math.atan((c-s)/(u-r)),u<r)h+=Math.PI;else if(c<s)h+=this.TWO_PI}else if(c<s)h=this.ONE_AND_HALF_PI;else h=this.HALF_PI;return h},i.doIntersect=function(r,s,u,c){var{x:h,y}=r,{x:o,y:g}=s,{x:f,y:E}=u,{x:T,y:N}=c,v=(o-h)*(N-E)-(T-f)*(g-y);if(v===0)return!1;else{var O=((N-E)*(T-h)+(f-T)*(N-y))/v,D=((y-g)*(T-h)+(o-h)*(N-y))/v;return 0<O&&O<1&&0<D&&D<1}},i.HALF_PI=0.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,m.exports=i},function(m,w,L){function a(){}a.sign=function(i){if(i>0)return 1;else if(i<0)return-1;else return 0},a.floor=function(i){return i<0?Math.ceil(i):Math.floor(i)},a.ceil=function(i){return i<0?Math.floor(i):Math.ceil(i)},m.exports=a},function(m,w,L){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,m.exports=a},function(m,w,L){var a=function(){function h(y,o){for(var g=0;g<o.length;g++){var f=o[g];if(f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f)f.writable=!0;Object.defineProperty(y,f.key,f)}}return function(y,o,g){if(o)h(y.prototype,o);if(g)h(y,g);return y}}();function i(h,y){if(!(h instanceof y))throw TypeError("Cannot call a class as a function")}var r=function(y){return{value:y,next:null,prev:null}},s=function(y,o,g,f){if(y!==null)y.next=o;else f.head=o;if(g!==null)g.prev=o;else f.tail=o;return o.prev=y,o.next=g,f.length++,o},u=function(y,o){var{prev:g,next:f}=y;if(g!==null)g.next=f;else o.head=f;if(f!==null)f.prev=g;else o.tail=g;return y.prev=y.next=null,o.length--,y},c=function(){function h(y){var o=this;if(i(this,h),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(g){return o.push(g)})}return a(h,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(o,g){return s(g.prev,r(o),g,this)}},{key:"insertAfter",value:function(o,g){return s(g,r(o),g.next,this)}},{key:"insertNodeBefore",value:function(o,g){return s(g.prev,o,g,this)}},{key:"insertNodeAfter",value:function(o,g){return s(g,o,g.next,this)}},{key:"push",value:function(o){return s(this.tail,r(o),null,this)}},{key:"unshift",value:function(o){return s(null,r(o),this.head,this)}},{key:"remove",value:function(o){return u(o,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(o){if(o<=this.length()){var g=1,f=this.head;while(g<o)f=f.next,g++;return f.value}}},{key:"set_object_at",value:function(o,g){if(o<=this.length()){var f=1,E=this.head;while(f<o)E=E.next,f++;E.value=g}}}]),h}();m.exports=c},function(m,w,L){function a(i,r,s){if(this.x=null,this.y=null,i==null&&r==null&&s==null)this.x=0,this.y=0;else if(typeof i=="number"&&typeof r=="number"&&s==null)this.x=i,this.y=r;else if(i.constructor.name=="Point"&&r==null&&s==null)s=i,this.x=s.x,this.y=s.y}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(i,r,s){if(i.constructor.name=="Point"&&r==null&&s==null)s=i,this.setLocation(s.x,s.y);else if(typeof i=="number"&&typeof r=="number"&&s==null)if(parseInt(i)==i&&parseInt(r)==r)this.move(i,r);else this.x=Math.floor(i+0.5),this.y=Math.floor(r+0.5)},a.prototype.move=function(i,r){this.x=i,this.y=r},a.prototype.translate=function(i,r){this.x+=i,this.y+=r},a.prototype.equals=function(i){if(i.constructor.name=="Point"){var r=i;return this.x==r.x&&this.y==r.y}return this==i},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=a},function(m,w,L){function a(i,r,s,u){if(this.x=0,this.y=0,this.width=0,this.height=0,i!=null&&r!=null&&s!=null&&u!=null)this.x=i,this.y=r,this.width=s,this.height=u}a.prototype.getX=function(){return this.x},a.prototype.setX=function(i){this.x=i},a.prototype.getY=function(){return this.y},a.prototype.setY=function(i){this.y=i},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(i){this.width=i},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(i){this.height=i},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(i){if(this.getRight()<i.x)return!1;if(this.getBottom()<i.y)return!1;if(i.getRight()<this.x)return!1;if(i.getBottom()<this.y)return!1;return!0},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},m.exports=a},function(m,w,L){var a=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol==="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function i(){}i.lastID=0,i.createID=function(r){if(i.isPrimitive(r))return r;if(r.uniqueID!=null)return r.uniqueID;return r.uniqueID=i.getString(),i.lastID++,r.uniqueID},i.getString=function(r){if(r==null)r=i.lastID;return"Object#"+r},i.isPrimitive=function(r){var s=typeof r>"u"?"undefined":a(r);return r==null||s!="object"&&s!="function"},m.exports=i},function(m,w,L){function a(f){if(Array.isArray(f)){for(var E=0,T=Array(f.length);E<f.length;E++)T[E]=f[E];return T}else return Array.from(f)}var i=L(0),r=L(6),s=L(3),u=L(1),c=L(5),h=L(4),y=L(17),o=L(27);function g(f){if(o.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new r(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,f!=null)this.isRemoteUse=f}g.RANDOM_SEED=1,g.prototype=Object.create(o.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var f=new r(this);return this.graphManager=f,f},g.prototype.newGraph=function(f){return new c(null,this.graphManager,f)},g.prototype.newNode=function(f){return new s(this.graphManager,f)},g.prototype.newEdge=function(f){return new u(null,null,f)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var f;if(this.checkLayoutSuccess())f=!1;else f=this.layout();if(i.ANIMATE==="during")return!1;if(f){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,f},g.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var f,E=this.graphManager.getAllEdges();for(var T=0;T<E.length;T++)f=E[T];var N,v=this.graphManager.getRoot().getNodes();for(var T=0;T<v.length;T++)N=v[T];this.update(this.graphManager.getRoot())}},g.prototype.update=function(f){if(f==null)this.update2();else if(f instanceof s){var E=f;if(E.getChild()!=null){var T=E.getChild().getNodes();for(var N=0;N<T.length;N++)update(T[N])}if(E.vGraphObject!=null){var v=E.vGraphObject;v.update(E)}}else if(f instanceof u){var O=f;if(O.vGraphObject!=null){var D=O.vGraphObject;D.update(O)}}else if(f instanceof c){var R=f;if(R.vGraphObject!=null){var l=R.vGraphObject;l.update(R)}}},g.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},g.prototype.transform=function(f){if(f==null)this.transform(new h(0,0));else{var E=new y,T=this.graphManager.getRoot().updateLeftTop();if(T!=null){E.setWorldOrgX(f.x),E.setWorldOrgY(f.y),E.setDeviceOrgX(T.x),E.setDeviceOrgY(T.y);var N=this.getAllNodes(),v;for(var O=0;O<N.length;O++)v=N[O],v.transform(E)}}},g.prototype.positionNodesRandomly=function(f){if(f==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var E,T,N=f.getNodes();for(var v=0;v<N.length;v++)if(E=N[v],T=E.getChild(),T==null)E.scatter();else if(T.getNodes().length==0)E.scatter();else this.positionNodesRandomly(T),E.updateBounds()}},g.prototype.getFlatForest=function(){var f=[],E=!0,T=this.graphManager.getRoot().getNodes(),N=!0;for(var v=0;v<T.length;v++)if(T[v].getChild()!=null)N=!1;if(!N)return f;var O=new Set,D=[],R=new Map,l=[];l=l.concat(T);while(l.length>0&&E){D.push(l[0]);while(D.length>0&&E){var p=D[0];D.splice(0,1),O.add(p);var d=p.getEdges();for(var v=0;v<d.length;v++){var A=d[v].getOtherEnd(p);if(R.get(p)!=A)if(!O.has(A))D.push(A),R.set(A,p);else{E=!1;break}}}if(!E)f=[];else{var I=[].concat(a(O));f.push(I);for(var v=0;v<I.length;v++){var C=I[v],M=l.indexOf(C);if(M>-1)l.splice(M,1)}O=new Set,R=new Map}}return f},g.prototype.createDummyNodesForBendpoints=function(f){var E=[],T=f.source,N=this.graphManager.calcLowestCommonAncestor(f.source,f.target);for(var v=0;v<f.bendpoints.length;v++){var O=this.newNode(null);O.setRect(new Point(0,0),new Dimension(1,1)),N.add(O);var D=this.newEdge(null);this.graphManager.add(D,T,O),E.add(O),T=O}var D=this.newEdge(null);if(this.graphManager.add(D,T,f.target),this.edgeToDummyNodes.set(f,E),f.isInterGraph())this.graphManager.remove(f);else N.remove(f);return E},g.prototype.createBendpointsFromDummyNodes=function(){var f=[];f=f.concat(this.graphManager.getAllEdges()),f=[].concat(a(this.edgeToDummyNodes.keys())).concat(f);for(var E=0;E<f.length;E++){var T=f[E];if(T.bendpoints.length>0){var N=this.edgeToDummyNodes.get(T);for(var v=0;v<N.length;v++){var O=N[v],D=new h(O.getCenterX(),O.getCenterY()),R=T.bendpoints.get(v);R.x=D.x,R.y=D.y,O.getOwner().remove(O)}this.graphManager.add(T,T.source,T.target)}}},g.transform=function(f,E,T,N){if(T!=null&&N!=null){var v=E;if(f<=50){var O=E/T;v-=(E-O)/50*(50-f)}else{var D=E*N;v+=(D-E)/50*(f-50)}return v}else{var R,l;if(f<=50)R=9*E/500,l=E/10;else R=9*E/50,l=-8*E;return R*f+l}},g.findCenterOfTree=function(f){var E=[];E=E.concat(f);var T=[],N=new Map,v=!1,O=null;if(E.length==1||E.length==2)v=!0,O=E[0];for(var D=0;D<E.length;D++){var R=E[D],l=R.getNeighborsList().size;if(N.set(R,R.getNeighborsList().size),l==1)T.push(R)}var p=[];p=p.concat(T);while(!v){var d=[];d=d.concat(p),p=[];for(var D=0;D<E.length;D++){var R=E[D],A=E.indexOf(R);if(A>=0)E.splice(A,1);var I=R.getNeighborsList();I.forEach(function(G){if(T.indexOf(G)<0){var F=N.get(G),P=F-1;if(P==1)p.push(G);N.set(G,P)}})}if(T=T.concat(p),E.length==1||E.length==2)v=!0,O=E[0]}return O},g.prototype.setGraphManager=function(f){this.graphManager=f},m.exports=g},function(m,w,L){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},m.exports=a},function(m,w,L){var a=L(4);function i(r,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(r){this.lworldOrgX=r},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(r){this.lworldOrgY=r},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(r){this.lworldExtX=r},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(r){this.lworldExtY=r},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(r){this.ldeviceOrgX=r},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(r){this.ldeviceOrgY=r},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(r){this.ldeviceExtX=r},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(r){this.ldeviceExtY=r},i.prototype.transformX=function(r){var s=0,u=this.lworldExtX;if(u!=0)s=this.ldeviceOrgX+(r-this.lworldOrgX)*this.ldeviceExtX/u;return s},i.prototype.transformY=function(r){var s=0,u=this.lworldExtY;if(u!=0)s=this.ldeviceOrgY+(r-this.lworldOrgY)*this.ldeviceExtY/u;return s},i.prototype.inverseTransformX=function(r){var s=0,u=this.ldeviceExtX;if(u!=0)s=this.lworldOrgX+(r-this.ldeviceOrgX)*this.lworldExtX/u;return s},i.prototype.inverseTransformY=function(r){var s=0,u=this.ldeviceExtY;if(u!=0)s=this.lworldOrgY+(r-this.ldeviceOrgY)*this.lworldExtY/u;return s},i.prototype.inverseTransformPoint=function(r){var s=new a(this.inverseTransformX(r.x),this.inverseTransformY(r.y));return s},m.exports=i},function(m,w,L){function a(o){if(Array.isArray(o)){for(var g=0,f=Array(o.length);g<o.length;g++)f[g]=o[g];return f}else return Array.from(o)}var i=L(15),r=L(7),s=L(0),u=L(8),c=L(9);function h(){i.call(this),this.useSmartIdealEdgeLengthCalculation=r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=r.DEFAULT_EDGE_LENGTH,this.springConstant=r.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=r.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=r.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=r.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=r.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*r.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=r.MAX_ITERATIONS}h.prototype=Object.create(i.prototype);for(var y in i)h[y]=i[y];h.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){var o,g,f,E,T,N,v=this.getGraphManager().getAllEdges();for(var O=0;O<v.length;O++)if(o=v[O],o.idealLength=this.idealEdgeLength,o.isInterGraph){if(f=o.getSource(),E=o.getTarget(),T=o.getSourceInLca().getEstimatedSize(),N=o.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)o.idealLength+=T+N-2*s.SIMPLE_NODE_SIZE;g=o.getLca().getInclusionTreeDepth(),o.idealLength+=r.DEFAULT_EDGE_LENGTH*r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(f.getInclusionTreeDepth()+E.getInclusionTreeDepth()-2*g)}},h.prototype.initSpringEmbedder=function(){var o=this.getAllNodes().length;if(this.incremental){if(o>r.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*r.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(o-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-r.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(o>r.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(r.COOLING_ADAPTATION_FACTOR,1-(o-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*(1-r.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){var o=this.getAllEdges(),g;for(var f=0;f<o.length;f++)g=o[f],this.calcSpringForce(g,g.idealLength)},h.prototype.calcRepulsionForces=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f,E,T,N,v=this.getAllNodes(),O;if(this.useFRGridVariant){if(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&o)this.updateGrid();O=new Set;for(f=0;f<v.length;f++)T=v[f],this.calculateRepulsionForceOfANode(T,O,o,g),O.add(T)}else for(f=0;f<v.length;f++){T=v[f];for(E=f+1;E<v.length;E++){if(N=v[E],T.getOwner()!=N.getOwner())continue;this.calcRepulsionForce(T,N)}}},h.prototype.calcGravitationalForces=function(){var o,g=this.getAllNodesToApplyGravitation();for(var f=0;f<g.length;f++)o=g[f],this.calcGravitationalForce(o)},h.prototype.moveNodes=function(){var o=this.getAllNodes(),g;for(var f=0;f<o.length;f++)g=o[f],g.move()},h.prototype.calcSpringForce=function(o,g){var f=o.getSource(),E=o.getTarget(),T,N,v,O;if(this.uniformLeafNodeSizes&&f.getChild()==null&&E.getChild()==null)o.updateLengthSimple();else if(o.updateLength(),o.isOverlapingSourceAndTarget)return;if(T=o.getLength(),T==0)return;N=this.springConstant*(T-g),v=N*(o.lengthX/T),O=N*(o.lengthY/T),f.springForceX+=v,f.springForceY+=O,E.springForceX-=v,E.springForceY-=O},h.prototype.calcRepulsionForce=function(o,g){var f=o.getRect(),E=g.getRect(),T=[,,],N=[,,,,],v,O,D,R,l,p,d;if(f.intersects(E)){u.calcSeparationAmount(f,E,T,r.DEFAULT_EDGE_LENGTH/2),p=2*T[0],d=2*T[1];var A=o.noOfChildren*g.noOfChildren/(o.noOfChildren+g.noOfChildren);o.repulsionForceX-=A*p,o.repulsionForceY-=A*d,g.repulsionForceX+=A*p,g.repulsionForceY+=A*d}else{if(this.uniformLeafNodeSizes&&o.getChild()==null&&g.getChild()==null)v=E.getCenterX()-f.getCenterX(),O=E.getCenterY()-f.getCenterY();else u.getIntersection(f,E,N),v=N[2]-N[0],O=N[3]-N[1];if(Math.abs(v)<r.MIN_REPULSION_DIST)v=c.sign(v)*r.MIN_REPULSION_DIST;if(Math.abs(O)<r.MIN_REPULSION_DIST)O=c.sign(O)*r.MIN_REPULSION_DIST;D=v*v+O*O,R=Math.sqrt(D),l=this.repulsionConstant*o.noOfChildren*g.noOfChildren/D,p=l*v/R,d=l*O/R,o.repulsionForceX-=p,o.repulsionForceY-=d,g.repulsionForceX+=p,g.repulsionForceY+=d}},h.prototype.calcGravitationalForce=function(o){var g,f,E,T,N,v,O,D;if(g=o.getOwner(),f=(g.getRight()+g.getLeft())/2,E=(g.getTop()+g.getBottom())/2,T=o.getCenterX()-f,N=o.getCenterY()-E,v=Math.abs(T)+o.getWidth()/2,O=Math.abs(N)+o.getHeight()/2,o.getOwner()==this.graphManager.getRoot()){if(D=g.getEstimatedSize()*this.gravityRangeFactor,v>D||O>D)o.gravitationForceX=-this.gravityConstant*T,o.gravitationForceY=-this.gravityConstant*N}else if(D=g.getEstimatedSize()*this.compoundGravityRangeFactor,v>D||O>D)o.gravitationForceX=-this.gravityConstant*T*this.compoundGravityConstant,o.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant},h.prototype.isConverged=function(){var o,g=!1;if(this.totalIterations>this.maxIterations/3)g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return o=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,o||g},h.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},h.prototype.calcNoOfChildrenForAllNodes=function(){var o,g=this.graphManager.getAllNodes();for(var f=0;f<g.length;f++)o=g[f],o.noOfChildren=o.getNoOfChildren()},h.prototype.calcGrid=function(o){var g=0,f=0;g=parseInt(Math.ceil((o.getRight()-o.getLeft())/this.repulsionRange)),f=parseInt(Math.ceil((o.getBottom()-o.getTop())/this.repulsionRange));var E=Array(g);for(var T=0;T<g;T++)E[T]=Array(f);for(var T=0;T<g;T++)for(var N=0;N<f;N++)E[T][N]=[];return E},h.prototype.addNodeToGrid=function(o,g,f){var E=0,T=0,N=0,v=0;E=parseInt(Math.floor((o.getRect().x-g)/this.repulsionRange)),T=parseInt(Math.floor((o.getRect().width+o.getRect().x-g)/this.repulsionRange)),N=parseInt(Math.floor((o.getRect().y-f)/this.repulsionRange)),v=parseInt(Math.floor((o.getRect().height+o.getRect().y-f)/this.repulsionRange));for(var O=E;O<=T;O++)for(var D=N;D<=v;D++)this.grid[O][D].push(o),o.setGridCoordinates(E,T,N,v)},h.prototype.updateGrid=function(){var o,g,f=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(o=0;o<f.length;o++)g=f[o],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(o,g,f,E){if(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&f||E){var T=new Set;o.surrounding=[];var N,v=this.grid;for(var O=o.startX-1;O<o.finishX+2;O++)for(var D=o.startY-1;D<o.finishY+2;D++)if(!(O<0||D<0||O>=v.length||D>=v[0].length))for(var R=0;R<v[O][D].length;R++){if(N=v[O][D][R],o.getOwner()!=N.getOwner()||o==N)continue;if(!g.has(N)&&!T.has(N)){var l=Math.abs(o.getCenterX()-N.getCenterX())-(o.getWidth()/2+N.getWidth()/2),p=Math.abs(o.getCenterY()-N.getCenterY())-(o.getHeight()/2+N.getHeight()/2);if(l<=this.repulsionRange&&p<=this.repulsionRange)T.add(N)}}o.surrounding=[].concat(a(T))}for(O=0;O<o.surrounding.length;O++)this.calcRepulsionForce(o,o.surrounding[O])},h.prototype.calcRepulsionRange=function(){return 0},m.exports=h},function(m,w,L){var a=L(1),i=L(7);function r(u,c,h){a.call(this,u,c,h),this.idealLength=i.DEFAULT_EDGE_LENGTH}r.prototype=Object.create(a.prototype);for(var s in a)r[s]=a[s];m.exports=r},function(m,w,L){var a=L(3);function i(s,u,c,h){a.call(this,s,u,c,h),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(a.prototype);for(var r in a)i[r]=a[r];i.prototype.setGridCoordinates=function(s,u,c,h){this.startX=s,this.finishX=u,this.startY=c,this.finishY=h},m.exports=i},function(m,w,L){function a(i,r){if(this.width=0,this.height=0,i!==null&&r!==null)this.height=r,this.width=i}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(i){this.width=i},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(i){this.height=i},m.exports=a},function(m,w,L){var a=L(14);function i(){this.map={},this.keys=[]}i.prototype.put=function(r,s){var u=a.createID(r);if(!this.contains(u))this.map[u]=s,this.keys.push(r)},i.prototype.contains=function(r){var s=a.createID(r);return this.map[r]!=null},i.prototype.get=function(r){var s=a.createID(r);return this.map[s]},i.prototype.keySet=function(){return this.keys},m.exports=i},function(m,w,L){var a=L(14);function i(){this.set={}}i.prototype.add=function(r){var s=a.createID(r);if(!this.contains(s))this.set[s]=r},i.prototype.remove=function(r){delete this.set[a.createID(r)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(r){return this.set[a.createID(r)]==r},i.prototype.isEmpty=function(){return this.size()===0},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(r){var s=Object.keys(this.set),u=s.length;for(var c=0;c<u;c++)r.push(this.set[s[c]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(r){var s=r.length;for(var u=0;u<s;u++){var c=r[u];this.add(c)}},m.exports=i},function(m,w,L){var a=function(){function u(c,h){for(var y=0;y<h.length;y++){var o=h[y];if(o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o)o.writable=!0;Object.defineProperty(c,o.key,o)}}return function(c,h,y){if(h)u(c.prototype,h);if(y)u(c,y);return c}}();function i(u,c){if(!(u instanceof c))throw TypeError("Cannot call a class as a function")}var r=L(11),s=function(){function u(c,h){if(i(this,u),h!==null||h!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(c instanceof r)y=c.size();else y=c.length;this._quicksort(c,0,y-1)}return a(u,[{key:"_quicksort",value:function(h,y,o){if(y<o){var g=this._partition(h,y,o);this._quicksort(h,y,g),this._quicksort(h,g+1,o)}}},{key:"_partition",value:function(h,y,o){var g=this._get(h,y),f=y,E=o;while(!0){while(this.compareFunction(g,this._get(h,E)))E--;while(this.compareFunction(this._get(h,f),g))f++;if(f<E)this._swap(h,f,E),f++,E--;else return E}}},{key:"_get",value:function(h,y){if(h instanceof r)return h.get_object_at(y);else return h[y]}},{key:"_set",value:function(h,y,o){if(h instanceof r)h.set_object_at(y,o);else h[y]=o}},{key:"_swap",value:function(h,y,o){var g=this._get(h,y);this._set(h,y,this._get(h,o)),this._set(h,o,g)}},{key:"_defaultCompareFunction",value:function(h,y){return y>h}}]),u}();m.exports=s},function(m,w,L){var a=function(){function s(u,c){for(var h=0;h<c.length;h++){var y=c[h];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(u,y.key,y)}}return function(u,c,h){if(c)s(u.prototype,c);if(h)s(u,h);return u}}();function i(s,u){if(!(s instanceof u))throw TypeError("Cannot call a class as a function")}var r=function(){function s(u,c){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,s),this.sequence1=u,this.sequence2=c,this.match_score=h,this.mismatch_penalty=y,this.gap_penalty=o,this.iMax=u.length+1,this.jMax=c.length+1,this.grid=Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=Array(this.jMax);for(var f=0;f<this.jMax;f++)this.grid[g][f]=0}this.tracebackGrid=Array(this.iMax);for(var E=0;E<this.iMax;E++){this.tracebackGrid[E]=Array(this.jMax);for(var T=0;T<this.jMax;T++)this.tracebackGrid[E][T]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(s,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var c=1;c<this.jMax;c++)this.grid[0][c]=this.grid[0][c-1]+this.gap_penalty,this.tracebackGrid[0][c]=[!1,!1,!0];for(var h=1;h<this.iMax;h++)this.grid[h][0]=this.grid[h-1][0]+this.gap_penalty,this.tracebackGrid[h][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var o=1;o<this.jMax;o++){var g=void 0;if(this.sequence1[y-1]===this.sequence2[o-1])g=this.grid[y-1][o-1]+this.match_score;else g=this.grid[y-1][o-1]+this.mismatch_penalty;var f=this.grid[y-1][o]+this.gap_penalty,E=this.grid[y][o-1]+this.gap_penalty,T=[g,f,E],N=this.arrayAllMaxIndexes(T);this.grid[y][o]=T[N[0]],this.tracebackGrid[y][o]=[N.includes(0),N.includes(1),N.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var c=[];c.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(c[0]){var h=c[0],y=this.tracebackGrid[h.pos[0]][h.pos[1]];if(y[0])c.push({pos:[h.pos[0]-1,h.pos[1]-1],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2});if(y[1])c.push({pos:[h.pos[0]-1,h.pos[1]],seq1:this.sequence1[h.pos[0]-1]+h.seq1,seq2:"-"+h.seq2});if(y[2])c.push({pos:[h.pos[0],h.pos[1]-1],seq1:"-"+h.seq1,seq2:this.sequence2[h.pos[1]-1]+h.seq2});if(h.pos[0]===0&&h.pos[1]===0)this.alignments.push({sequence1:h.seq1,sequence2:h.seq2});c.shift()}return this.alignments}},{key:"getAllIndexes",value:function(c,h){var y=[],o=-1;while((o=c.indexOf(h,o+1))!==-1)y.push(o);return y}},{key:"arrayAllMaxIndexes",value:function(c){return this.getAllIndexes(c,Math.max.apply(null,c))}}]),s}();m.exports=r},function(m,w,L){var a=function(){return};a.FDLayout=L(18),a.FDLayoutConstants=L(7),a.FDLayoutEdge=L(19),a.FDLayoutNode=L(20),a.DimensionD=L(21),a.HashMap=L(22),a.HashSet=L(23),a.IGeometry=L(8),a.IMath=L(9),a.Integer=L(10),a.Point=L(12),a.PointD=L(4),a.RandomSeed=L(16),a.RectangleD=L(13),a.Transform=L(17),a.UniqueIDGeneretor=L(14),a.Quicksort=L(24),a.LinkedList=L(11),a.LGraphObject=L(2),a.LGraph=L(5),a.LEdge=L(1),a.LGraphManager=L(6),a.LNode=L(3),a.Layout=L(15),a.LayoutConstants=L(0),a.NeedlemanWunsch=L(25),m.exports=a},function(m,w,L){function a(){this.listeners=[]}var i=a.prototype;i.addListener=function(r,s){this.listeners.push({event:r,callback:s})},i.removeListener=function(r,s){for(var u=this.listeners.length;u>=0;u--){var c=this.listeners[u];if(c.event===r&&c.callback===s)this.listeners.splice(u,1)}},i.emit=function(r,s){for(var u=0;u<this.listeners.length;u++){var c=this.listeners[u];if(r===c.event)c.callback(s)}},m.exports=a}])})});var tt=oe(function(Q,J){(function(w,L){if(typeof Q==="object"&&typeof J==="object")J.exports=L(z());else if(typeof define==="function"&&define.amd)define(["layout-base"],L);else if(typeof Q==="object")Q.coseBase=L(z());else w.coseBase=L(w.layoutBase)})(Q,function(m){return function(w){var L={};function a(i){if(L[i])return L[i].exports;var r=L[i]={i,l:!1,exports:{}};return w[i].call(r.exports,r,r.exports,a),r.l=!0,r.exports}return a.m=w,a.c=L,a.i=function(i){return i},a.d=function(i,r,s){if(!a.o(i,r))Object.defineProperty(i,r,{configurable:!1,enumerable:!0,get:s})},a.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return a.d(r,"a",r),r},a.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},a.p="",a(a.s=7)}([function(w,L){w.exports=m},function(w,L,a){var i=a(0).FDLayoutConstants;function r(){}for(var s in i)r[s]=i[s];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TREE_REDUCTION_ON_INCREMENTAL=!1,w.exports=r},function(w,L,a){var i=a(0).FDLayoutEdge;function r(u,c,h){i.call(this,u,c,h)}r.prototype=Object.create(i.prototype);for(var s in i)r[s]=i[s];w.exports=r},function(w,L,a){var i=a(0).LGraph;function r(u,c,h){i.call(this,u,c,h)}r.prototype=Object.create(i.prototype);for(var s in i)r[s]=i[s];w.exports=r},function(w,L,a){var i=a(0).LGraphManager;function r(u){i.call(this,u)}r.prototype=Object.create(i.prototype);for(var s in i)r[s]=i[s];w.exports=r},function(w,L,a){var i=a(0).FDLayoutNode,r=a(0).IMath;function s(c,h,y,o){i.call(this,c,h,y,o)}s.prototype=Object.create(i.prototype);for(var u in i)s[u]=i[u];s.prototype.move=function(){var c=this.graphManager.getLayout();if(this.displacementX=c.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=c.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>c.coolingFactor*c.maxNodeDisplacement)this.displacementX=c.coolingFactor*c.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>c.coolingFactor*c.maxNodeDisplacement)this.displacementY=c.coolingFactor*c.maxNodeDisplacement*r.sign(this.displacementY);if(this.child==null)this.moveBy(this.displacementX,this.displacementY);else if(this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY);else this.propogateDisplacementToChildren(this.displacementX,this.displacementY);c.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},s.prototype.propogateDisplacementToChildren=function(c,h){var y=this.getChild().getNodes(),o;for(var g=0;g<y.length;g++)if(o=y[g],o.getChild()==null)o.moveBy(c,h),o.displacementX+=c,o.displacementY+=h;else o.propogateDisplacementToChildren(c,h)},s.prototype.setPred1=function(c){this.pred1=c},s.prototype.getPred1=function(){return pred1},s.prototype.getPred2=function(){return pred2},s.prototype.setNext=function(c){this.next=c},s.prototype.getNext=function(){return next},s.prototype.setProcessed=function(c){this.processed=c},s.prototype.isProcessed=function(){return processed},w.exports=s},function(w,L,a){var i=a(0).FDLayout,r=a(4),s=a(3),u=a(5),c=a(2),h=a(1),y=a(0).FDLayoutConstants,o=a(0).LayoutConstants,g=a(0).Point,f=a(0).PointD,E=a(0).Layout,T=a(0).Integer,N=a(0).IGeometry,v=a(0).LGraph,O=a(0).Transform;function D(){i.call(this),this.toBeTiled={}}D.prototype=Object.create(i.prototype);for(var R in i)D[R]=i[R];D.prototype.newGraphManager=function(){var l=new r(this);return this.graphManager=l,l},D.prototype.newGraph=function(l){return new s(null,this.graphManager,l)},D.prototype.newNode=function(l){return new u(this.graphManager,l)},D.prototype.newEdge=function(l){return new c(null,null,l)},D.prototype.initParameters=function(){if(i.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(h.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=y.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=y.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=y.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=y.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/y.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=y.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1}},D.prototype.layout=function(){var l=o.DEFAULT_CREATE_BENDS_AS_NEEDED;if(l)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},D.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){var l=this.getFlatForest();if(l.length>0)this.positionNodesRadially(l);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var p=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(A){return p.has(A)});this.graphManager.setAllNodesToApplyGravitation(d),this.positionNodesRandomly()}}else if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var p=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(C){return p.has(C)});this.graphManager.setAllNodesToApplyGravitation(d)}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},D.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%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(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 l=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return l.has(I)});this.graphManager.setAllNodesToApplyGravitation(p),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var d=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(d,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){var l=this.graphManager.getAllNodes(),p={};for(var d=0;d<l.length;d++){var A=l[d].rect,I=l[d].id;p[I]={id:I,x:A.getCenterX(),y:A.getCenterY(),w:A.width,h:A.height}}return p},D.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var l=!1;if(y.ANIMATE==="during")this.emit("layoutstarted");else{while(!l)l=this.tick();this.graphManager.updateBounds()}},D.prototype.calculateNodesToApplyGravitationTo=function(){var l=[],p,d=this.graphManager.getGraphs(),A=d.length,I;for(I=0;I<A;I++)if(p=d[I],p.updateConnected(),!p.isConnected)l=l.concat(p.getNodes());return l},D.prototype.createBendpoints=function(){var l=[];l=l.concat(this.graphManager.getAllEdges());var p=new Set,d;for(d=0;d<l.length;d++){var A=l[d];if(!p.has(A)){var I=A.getSource(),C=A.getTarget();if(I==C)A.getBendpoints().push(new f),A.getBendpoints().push(new f),this.createDummyNodesForBendpoints(A),p.add(A);else{var M=[];if(M=M.concat(I.getEdgeListToNode(C)),M=M.concat(C.getEdgeListToNode(I)),!p.has(M[0])){if(M.length>1){var G;for(G=0;G<M.length;G++){var F=M[G];F.getBendpoints().push(new f),this.createDummyNodesForBendpoints(F)}}M.forEach(function(P){p.add(P)})}}}if(p.size==l.length)break}},D.prototype.positionNodesRadially=function(l){var p=new g(0,0),d=Math.ceil(Math.sqrt(l.length)),A=0,I=0,C=0,M=new f(0,0);for(var G=0;G<l.length;G++){if(G%d==0){if(C=0,I=A,G!=0)I+=h.DEFAULT_COMPONENT_SEPERATION;A=0}var F=l[G],P=E.findCenterOfTree(F);if(p.x=C,p.y=I,M=D.radialLayout(F,P,p),M.y>A)A=Math.floor(M.y);C=Math.floor(M.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new f(o.WORLD_CENTER_X-M.x/2,o.WORLD_CENTER_Y-M.y/2))},D.radialLayout=function(l,p,d){var A=Math.max(this.maxDiagonalInTree(l),h.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(p,null,0,359,0,A);var I=v.calculateBounds(l),C=new O;C.setDeviceOrgX(I.getMinX()),C.setDeviceOrgY(I.getMinY()),C.setWorldOrgX(d.x),C.setWorldOrgY(d.y);for(var M=0;M<l.length;M++){var G=l[M];G.transform(C)}var F=new f(I.getMaxX(),I.getMaxY());return C.inverseTransformPoint(F)},D.branchRadialLayout=function(l,p,d,A,I,C){var M=(A-d+1)/2;if(M<0)M+=180;var G=(M+d)%360,F=G*N.TWO_PI/360,P=Math.cos(F),b=I*Math.cos(F),U=I*Math.sin(F);l.setCenter(b,U);var x=[];x=x.concat(l.getEdges());var S=x.length;if(p!=null)S--;var Y=0,X=x.length,H,_=l.getEdgesBetween(p);while(_.length>1){var W=_[0];_.splice(0,1);var k=x.indexOf(W);if(k>=0)x.splice(k,1);X--,S--}if(p!=null)H=(x.indexOf(_[0])+1)%X;else H=0;var B=Math.abs(A-d)/S;for(var V=H;Y!=S;V=++V%X){var rt=x[V].getOtherEnd(l);if(rt==p)continue;var it=(d+Y*B)%360,ct=(it+B)%360;D.branchRadialLayout(rt,l,it,ct,I+C,C),Y++}},D.maxDiagonalInTree=function(l){var p=T.MIN_VALUE;for(var d=0;d<l.length;d++){var A=l[d],I=A.getDiagonal();if(I>p)p=I}return p},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var l=this,p={};this.memberGroups={},this.idToDummyNode={};var d=[],A=this.graphManager.getAllNodes();for(var I=0;I<A.length;I++){var C=A[I],M=C.getParent();if(this.getNodeDegreeWithChildren(C)===0&&(M.id==null||!this.getToBeTiled(M)))d.push(C)}for(var I=0;I<d.length;I++){var C=d[I],G=C.getParent().id;if(typeof p[G]>"u")p[G]=[];p[G]=p[G].concat(C)}Object.keys(p).forEach(function(F){if(p[F].length>1){var P="DummyCompound_"+F;l.memberGroups[P]=p[F];var b=p[F][0].getParent(),U=new u(l.graphManager);U.id=P,U.paddingLeft=b.paddingLeft||0,U.paddingRight=b.paddingRight||0,U.paddingBottom=b.paddingBottom||0,U.paddingTop=b.paddingTop||0,l.idToDummyNode[P]=U;var x=l.getGraphManager().add(l.newGraph(),U),S=b.getChild();S.add(U);for(var Y=0;Y<p[F].length;Y++){var X=p[F][Y];S.remove(X),x.add(X)}}})},D.prototype.clearCompounds=function(){var l={},p={};this.performDFSOnCompounds();for(var d=0;d<this.compoundOrder.length;d++)p[this.compoundOrder[d].id]=this.compoundOrder[d],l[this.compoundOrder[d].id]=[].concat(this.compoundOrder[d].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[d].getChild()),this.compoundOrder[d].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(l,p)},D.prototype.clearZeroDegreeMembers=function(){var l=this,p=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(d){var A=l.idToDummyNode[d];p[d]=l.tileNodes(l.memberGroups[d],A.paddingLeft+A.paddingRight),A.rect.width=p[d].width,A.rect.height=p[d].height})},D.prototype.repopulateCompounds=function(){for(var l=this.compoundOrder.length-1;l>=0;l--){var p=this.compoundOrder[l],{id:d,paddingLeft:A,paddingTop:I}=p;this.adjustLocations(this.tiledMemberPack[d],p.rect.x,p.rect.y,A,I)}},D.prototype.repopulateZeroDegreeMembers=function(){var l=this,p=this.tiledZeroDegreePack;Object.keys(p).forEach(function(d){var A=l.idToDummyNode[d],{paddingLeft:I,paddingTop:C}=A;l.adjustLocations(p[d],A.rect.x,A.rect.y,I,C)})},D.prototype.getToBeTiled=function(l){var p=l.id;if(this.toBeTiled[p]!=null)return this.toBeTiled[p];var d=l.getChild();if(d==null)return this.toBeTiled[p]=!1,!1;var A=d.getNodes();for(var I=0;I<A.length;I++){var C=A[I];if(this.getNodeDegree(C)>0)return this.toBeTiled[p]=!1,!1;if(C.getChild()==null){this.toBeTiled[C.id]=!1;continue}if(!this.getToBeTiled(C))return this.toBeTiled[p]=!1,!1}return this.toBeTiled[p]=!0,!0},D.prototype.getNodeDegree=function(l){var p=l.id,d=l.getEdges(),A=0;for(var I=0;I<d.length;I++){var C=d[I];if(C.getSource().id!==C.getTarget().id)A=A+1}return A},D.prototype.getNodeDegreeWithChildren=function(l){var p=this.getNodeDegree(l);if(l.getChild()==null)return p;var d=l.getChild().getNodes();for(var A=0;A<d.length;A++){var I=d[A];p+=this.getNodeDegreeWithChildren(I)}return p},D.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},D.prototype.fillCompexOrderByDFS=function(l){for(var p=0;p<l.length;p++){var d=l[p];if(d.getChild()!=null)this.fillCompexOrderByDFS(d.getChild().getNodes());if(this.getToBeTiled(d))this.compoundOrder.push(d)}},D.prototype.adjustLocations=function(l,p,d,A,I){p+=A,d+=I;var C=p;for(var M=0;M<l.rows.length;M++){var G=l.rows[M];p=C;var F=0;for(var P=0;P<G.length;P++){var b=G[P];if(b.rect.x=p,b.rect.y=d,p+=b.rect.width+l.horizontalPadding,b.rect.height>F)F=b.rect.height}d+=F+l.verticalPadding}},D.prototype.tileCompoundMembers=function(l,p){var d=this;this.tiledMemberPack=[],Object.keys(l).forEach(function(A){var I=p[A];d.tiledMemberPack[A]=d.tileNodes(l[A],I.paddingLeft+I.paddingRight),I.rect.width=d.tiledMemberPack[A].width,I.rect.height=d.tiledMemberPack[A].height})},D.prototype.tileNodes=function(l,p){var{TILING_PADDING_VERTICAL:d,TILING_PADDING_HORIZONTAL:A}=h,I={rows:[],rowWidth:[],rowHeight:[],width:0,height:p,verticalPadding:d,horizontalPadding:A};l.sort(function(G,F){if(G.rect.width*G.rect.height>F.rect.width*F.rect.height)return-1;if(G.rect.width*G.rect.height<F.rect.width*F.rect.height)return 1;return 0});for(var C=0;C<l.length;C++){var M=l[C];if(I.rows.length==0)this.insertNodeToRow(I,M,0,p);else if(this.canAddHorizontal(I,M.rect.width,M.rect.height))this.insertNodeToRow(I,M,this.getShortestRowIndex(I),p);else this.insertNodeToRow(I,M,I.rows.length,p);this.shiftToLastRow(I)}return I},D.prototype.insertNodeToRow=function(l,p,d,A){var I=A;if(d==l.rows.length){var C=[];l.rows.push(C),l.rowWidth.push(I),l.rowHeight.push(0)}var M=l.rowWidth[d]+p.rect.width;if(l.rows[d].length>0)M+=l.horizontalPadding;if(l.rowWidth[d]=M,l.width<M)l.width=M;var G=p.rect.height;if(d>0)G+=l.verticalPadding;var F=0;if(G>l.rowHeight[d])F=l.rowHeight[d],l.rowHeight[d]=G,F=l.rowHeight[d]-F;l.height+=F,l.rows[d].push(p)},D.prototype.getShortestRowIndex=function(l){var p=-1,d=Number.MAX_VALUE;for(var A=0;A<l.rows.length;A++)if(l.rowWidth[A]<d)p=A,d=l.rowWidth[A];return p},D.prototype.getLongestRowIndex=function(l){var p=-1,d=Number.MIN_VALUE;for(var A=0;A<l.rows.length;A++)if(l.rowWidth[A]>d)p=A,d=l.rowWidth[A];return p},D.prototype.canAddHorizontal=function(l,p,d){var A=this.getShortestRowIndex(l);if(A<0)return!0;var I=l.rowWidth[A];if(I+l.horizontalPadding+p<=l.width)return!0;var C=0;if(l.rowHeight[A]<d){if(A>0)C=d+l.verticalPadding-l.rowHeight[A]}var M;if(l.width-I>=p+l.horizontalPadding)M=(l.height+C)/(I+p+l.horizontalPadding);else M=(l.height+C)/l.width;C=d+l.verticalPadding;var G;if(l.width<p)G=(l.height+C)/p;else G=(l.height+C)/l.width;if(G<1)G=1/G;if(M<1)M=1/M;return M<G},D.prototype.shiftToLastRow=function(l){var p=this.getLongestRowIndex(l),d=l.rowWidth.length-1,A=l.rows[p],I=A[A.length-1],C=I.width+l.horizontalPadding;if(l.width-l.rowWidth[d]>C&&p!=d){A.splice(-1,1),l.rows[d].push(I),l.rowWidth[p]=l.rowWidth[p]-C,l.rowWidth[d]=l.rowWidth[d]+C,l.width=l.rowWidth[instance.getLongestRowIndex(l)];var M=Number.MIN_VALUE;for(var G=0;G<A.length;G++)if(A[G].height>M)M=A[G].height;if(p>0)M+=l.verticalPadding;var F=l.rowHeight[p]+l.rowHeight[d];if(l.rowHeight[p]=M,l.rowHeight[d]<I.height+l.verticalPadding)l.rowHeight[d]=I.height+l.verticalPadding;var P=l.rowHeight[p]+l.rowHeight[d];l.height+=P-F,this.shiftToLastRow(l)}},D.prototype.tilingPreLayout=function(){if(h.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},D.prototype.tilingPostLayout=function(){if(h.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},D.prototype.reduceTrees=function(){var l=[],p=!0,d;while(p){var A=this.graphManager.getAllNodes(),I=[];p=!1;for(var C=0;C<A.length;C++)if(d=A[C],d.getEdges().length==1&&!d.getEdges()[0].isInterGraph&&d.getChild()==null)I.push([d,d.getEdges()[0],d.getOwner()]),p=!0;if(p==!0){var M=[];for(var G=0;G<I.length;G++)if(I[G][0].getEdges().length==1)M.push(I[G]),I[G][0].getOwner().remove(I[G][0]);l.push(M),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=l},D.prototype.growTree=function(l){var p=l.length,d=l[p-1],A;for(var I=0;I<d.length;I++)A=d[I],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);l.splice(l.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},D.prototype.findPlaceforPrunedNode=function(l){var p,d,A=l[0];if(A==l[1].source)d=l[1].target;else d=l[1].source;var I=d.startX,C=d.finishX,M=d.startY,G=d.finishY,F=0,P=0,b=0,U=0,x=[F,b,P,U];if(M>0)for(var S=I;S<=C;S++)x[0]+=this.grid[S][M-1].length+this.grid[S][M].length-1;if(C<this.grid.length-1)for(var S=M;S<=G;S++)x[1]+=this.grid[C+1][S].length+this.grid[C][S].length-1;if(G<this.grid[0].length-1)for(var S=I;S<=C;S++)x[2]+=this.grid[S][G+1].length+this.grid[S][G].length-1;if(I>0)for(var S=M;S<=G;S++)x[3]+=this.grid[I-1][S].length+this.grid[I][S].length-1;var Y=T.MAX_VALUE,X,H;for(var _=0;_<x.length;_++)if(x[_]<Y)Y=x[_],X=1,H=_;else if(x[_]==Y)X++;if(X==3&&Y==0){if(x[0]==0&&x[1]==0&&x[2]==0)p=1;else if(x[0]==0&&x[1]==0&&x[3]==0)p=0;else if(x[0]==0&&x[2]==0&&x[3]==0)p=3;else if(x[1]==0&&x[2]==0&&x[3]==0)p=2}else if(X==2&&Y==0){var W=Math.floor(Math.random()*2);if(x[0]==0&&x[1]==0)if(W==0)p=0;else p=1;else if(x[0]==0&&x[2]==0)if(W==0)p=0;else p=2;else if(x[0]==0&&x[3]==0)if(W==0)p=0;else p=3;else if(x[1]==0&&x[2]==0)if(W==0)p=1;else p=2;else if(x[1]==0&&x[3]==0)if(W==0)p=1;else p=3;else if(W==0)p=2;else p=3}else if(X==4&&Y==0){var W=Math.floor(Math.random()*4);p=W}else p=H;if(p==0)A.setCenter(d.getCenterX(),d.getCenterY()-d.getHeight()/2-y.DEFAULT_EDGE_LENGTH-A.getHeight()/2);else if(p==1)A.setCenter(d.getCenterX()+d.getWidth()/2+y.DEFAULT_EDGE_LENGTH+A.getWidth()/2,d.getCenterY());else if(p==2)A.setCenter(d.getCenterX(),d.getCenterY()+d.getHeight()/2+y.DEFAULT_EDGE_LENGTH+A.getHeight()/2);else A.setCenter(d.getCenterX()-d.getWidth()/2-y.DEFAULT_EDGE_LENGTH-A.getWidth()/2,d.getCenterY())},w.exports=D},function(w,L,a){var i={};i.layoutBase=a(0),i.CoSEConstants=a(1),i.CoSEEdge=a(2),i.CoSEGraph=a(3),i.CoSEGraphManager=a(4),i.CoSELayout=a(6),i.CoSENode=a(5),w.exports=i}])})});var nt=oe(function(j,et){(function(w,L){if(typeof j==="object"&&typeof et==="object")et.exports=L(tt());else if(typeof define==="function"&&define.amd)define(["cose-base"],L);else if(typeof j==="object")j.cytoscapeCoseBilkent=L(tt());else w.cytoscapeCoseBilkent=L(w.coseBase)})(j,function(m){return function(w){var L={};function a(i){if(L[i])return L[i].exports;var r=L[i]={i,l:!1,exports:{}};return w[i].call(r.exports,r,r.exports,a),r.l=!0,r.exports}return a.m=w,a.c=L,a.i=function(i){return i},a.d=function(i,r,s){if(!a.o(i,r))Object.defineProperty(i,r,{configurable:!1,enumerable:!0,get:s})},a.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return a.d(r,"a",r),r},a.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},a.p="",a(a.s=1)}([function(w,L){w.exports=m},function(w,L,a){var i=a(0).layoutBase.LayoutConstants,r=a(0).layoutBase.FDLayoutConstants,s=a(0).CoSEConstants,u=a(0).CoSELayout,c=a(0).CoSENode,h=a(0).layoutBase.PointD,y=a(0).layoutBase.DimensionD,o={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:0.45,nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.5};function g(N,v){var O={};for(var D in N)O[D]=N[D];for(var D in v)O[D]=v[D];return O}function f(N){this.options=g(o,N),E(this.options)}var E=function(v){if(v.nodeRepulsion!=null)s.DEFAULT_REPULSION_STRENGTH=r.DEFAULT_REPULSION_STRENGTH=v.nodeRepulsion;if(v.idealEdgeLength!=null)s.DEFAULT_EDGE_LENGTH=r.DEFAULT_EDGE_LENGTH=v.idealEdgeLength;if(v.edgeElasticity!=null)s.DEFAULT_SPRING_STRENGTH=r.DEFAULT_SPRING_STRENGTH=v.edgeElasticity;if(v.nestingFactor!=null)s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor;if(v.gravity!=null)s.DEFAULT_GRAVITY_STRENGTH=r.DEFAULT_GRAVITY_STRENGTH=v.gravity;if(v.numIter!=null)s.MAX_ITERATIONS=r.MAX_ITERATIONS=v.numIter;if(v.gravityRange!=null)s.DEFAULT_GRAVITY_RANGE_FACTOR=r.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange;if(v.gravityCompound!=null)s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound;if(v.gravityRangeCompound!=null)s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound;if(v.initialEnergyOnIncremental!=null)s.DEFAULT_COOLING_FACTOR_INCREMENTAL=r.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental;if(v.quality=="draft")i.QUALITY=0;else if(v.quality=="proof")i.QUALITY=2;else i.QUALITY=1;s.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,s.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!v.randomize,s.ANIMATE=r.ANIMATE=i.ANIMATE=v.animate,s.TILE=v.tile,s.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical==="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,s.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal==="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal};f.prototype.run=function(){var N,v,O=this.options,D=this.idToLNode={},R=this.layout=new u,l=this;l.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var p=R.newGraphManager();this.gm=p;var d=this.options.eles.nodes(),A=this.options.eles.edges();this.root=p.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(d),R);for(var I=0;I<A.length;I++){var C=A[I],M=this.idToLNode[C.data("source")],G=this.idToLNode[C.data("target")];if(M!==G&&M.getEdgesBetween(G).length==0){var F=p.add(R.newEdge(),M,G);F.id=C.id()}}var P=function(x,S){if(typeof x==="number")x=S;var Y=x.data("id"),X=l.idToLNode[Y];return{x:X.getRect().getCenterX(),y:X.getRect().getCenterY()}},b=function U(){var x=function(){if(O.fit)O.cy.fit(O.eles,O.padding);if(!N)N=!0,l.cy.one("layoutready",O.ready),l.cy.trigger({type:"layoutready",layout:l})},S=l.options.refresh,Y;for(var X=0;X<S&&!Y;X++)Y=l.stopped||l.layout.tick();if(Y){if(R.checkLayoutSuccess()&&!R.isSubLayout)R.doPostLayout();if(R.tilingPostLayout)R.tilingPostLayout();if(R.isLayoutFinished=!0,l.options.eles.nodes().positions(P),x(),l.cy.one("layoutstop",l.options.stop),l.cy.trigger({type:"layoutstop",layout:l}),v)cancelAnimationFrame(v);N=!1;return}var H=l.layout.getPositionsData();O.eles.nodes().positions(function(_,W){if(typeof _==="number")_=W;if(!_.isParent()){var k=_.id(),B=H[k],V=_;while(B==null)if(B=H[V.data("parent")]||H["DummyCompound_"+V.data("parent")],H[k]=B,V=V.parent()[0],V==null)break;if(B!=null)return{x:B.x,y:B.y};else return{x:_.position("x"),y:_.position("y")}}}),x(),v=requestAnimationFrame(U)};if(R.addListener("layoutstarted",function(){if(l.options.animate==="during")v=requestAnimationFrame(b)}),R.runLayout(),this.options.animate!=="during")l.options.eles.nodes().not(":parent").layoutPositions(l,l.options,P),N=!1;return this},f.prototype.getTopMostNodes=function(N){var v={};for(var O=0;O<N.length;O++)v[N[O].id()]=!0;var D=N.filter(function(R,l){if(typeof R==="number")R=l;var p=R.parent()[0];while(p!=null){if(v[p.id()])return!1;p=p.parent()[0]}return!0});return D},f.prototype.processChildrenList=function(N,v,O){var D=v.length;for(var R=0;R<D;R++){var l=v[R],p=l.children(),d,A=l.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(l.outerWidth()!=null&&l.outerHeight()!=null)d=N.add(new c(O.graphManager,new h(l.position("x")-A.w/2,l.position("y")-A.h/2),new y(parseFloat(A.w),parseFloat(A.h))));else d=N.add(new c(this.graphManager));if(d.id=l.data("id"),d.paddingLeft=parseInt(l.css("padding")),d.paddingTop=parseInt(l.css("padding")),d.paddingRight=parseInt(l.css("padding")),d.paddingBottom=parseInt(l.css("padding")),this.options.nodeDimensionsIncludeLabels){if(l.isParent()){var I=l.boundingBox({includeLabels:!0,includeNodes:!1}).w,C=l.boundingBox({includeLabels:!0,includeNodes:!1}).h,M=l.css("text-halign");d.labelWidth=I,d.labelHeight=C,d.labelPos=M}}if(this.idToLNode[l.data("id")]=d,isNaN(d.rect.x))d.rect.x=0;if(isNaN(d.rect.y))d.rect.y=0;if(p!=null&&p.length>0){var G=O.getGraphManager().add(O.newGraph(),d);this.processChildrenList(G,p,O)}}},f.prototype.stop=function(){return this.stopped=!0,this};var T=function(v){v("layout","cose-bilkent",f)};if(typeof cytoscape<"u")T(cytoscape);w.exports=T}])})});var st=K(nt(),1);Re.use(st.default);function ot(m,w){m.forEach((L)=>{let a={id:L.id,labelText:L.label,height:L.height,width:L.width,padding:L.padding??0};Object.keys(L).forEach((i)=>{if(!["id","label","height","width","padding","x","y"].includes(i))a[i]=L[i]}),w.add({group:"nodes",data:a,position:{x:L.x??0,y:L.y??0}})})}e(ot,"addNodes");function at(m,w){m.forEach((L)=>{let a={id:L.id,source:L.start,target:L.end};Object.keys(L).forEach((i)=>{if(!["id","start","end"].includes(i))a[i]=L[i]}),w.add({group:"edges",data:a})})}e(at,"addEdges");function ht(m){return new Promise((w)=>{let L=n("body").append("div").attr("id","cy").attr("style","display:none"),a=Re({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});L.remove(),ot(m.nodes,a),at(m.edges,a),a.nodes().forEach(function(r){r.layoutDimensions=()=>{let s=r.data();return{w:s.width,h:s.height}}});let i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};a.layout(i).run(),a.ready((r)=>{t.info("Cytoscape ready",r),w(a)})})}e(ht,"createCytoscapeInstance");function lt(m){return m.nodes().map((w)=>{let L=w.data(),a=w.position(),i={id:L.id,x:a.x,y:a.y};return Object.keys(L).forEach((r)=>{if(r!=="id")i[r]=L[r]}),i})}e(lt,"extractPositionedNodes");function ut(m){return m.edges().map((w)=>{let L=w.data(),a=w._private.rscratch,i={id:L.id,source:L.source,target:L.target,startX:a.startX,startY:a.startY,midX:a.midX,midY:a.midY,endX:a.endX,endY:a.endY};return Object.keys(L).forEach((r)=>{if(!["id","source","target"].includes(r))i[r]=L[r]}),i})}e(ut,"extractPositionedEdges");async function gt(m,w){t.debug("Starting cose-bilkent layout algorithm");try{ft(m);let L=await ht(m),a=lt(L),i=ut(L);return t.debug(`Layout completed: ${a.length} nodes, ${i.length} edges`),{nodes:a,edges:i}}catch(L){throw t.error("Error in cose-bilkent layout algorithm:",L),L}}e(gt,"executeCoseBilkentLayout");function ft(m){if(!m)throw Error("Layout data is required");if(!m.config)throw Error("Configuration is required in layout data");if(!m.rootNode)throw Error("Root node is required");if(!m.nodes||!Array.isArray(m.nodes))throw Error("No nodes found in layout data");if(!Array.isArray(m.edges))throw Error("Edges array is required in layout data");return!0}e(ft,"validateLayoutData");var pt=e(async(m,w,{insertCluster:L,insertEdge:a,insertEdgeLabel:i,insertMarkers:r,insertNode:s,log:u,positionEdgeLabel:c},{algorithm:h})=>{let y={},o={},g=w.select("g");r(g,m.markers,m.type,m.diagramId);let f=g.insert("g").attr("class","subgraphs"),E=g.insert("g").attr("class","edgePaths"),T=g.insert("g").attr("class","edgeLabels"),N=g.insert("g").attr("class","nodes");u.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(m.nodes.map(async(D)=>{if(D.isGroup){let R={...D};o[D.id]=R,y[D.id]=R,await L(f,D)}else{let R={...D};y[D.id]=R;let l=await s(N,D,{config:m.config,dir:m.direction||"TB"}),p=l.node().getBBox();R.width=p.width,R.height=p.height,R.domId=l,u.debug(`Node ${D.id} dimensions: ${p.width}x${p.height}`)}})),u.debug("Running cose-bilkent layout algorithm");let v={...m,nodes:m.nodes.map((D)=>{let R=y[D.id];return{...D,width:R.width,height:R.height}})},O=await gt(v,m.config);u.debug("Positioning nodes based on layout results"),O.nodes.forEach((D)=>{let R=y[D.id];if(R?.domId)R.domId.attr("transform",`translate(${D.x}, ${D.y})`),R.x=D.x,R.y=D.y,u.debug(`Positioned node ${R.id} at center (${D.x}, ${D.y})`)}),O.edges.forEach((D)=>{let R=m.edges.find((l)=>l.id===D.id);if(R)R.points=[{x:D.startX,y:D.startY},{x:D.midX,y:D.midY},{x:D.endX,y:D.endY}]}),u.debug("Inserting and positioning edges"),await Promise.all(m.edges.map(async(D)=>{let R=await i(T,D),l=y[D.start??""],p=y[D.end??""];if(l&&p){let d=O.edges.find((A)=>A.id===D.id);if(d){u.debug("APA01 positionedEdge",d);let A={...D},I=a(E,A,o,m.type,l,p,m.diagramId);c(A,I)}else{let A={...D,points:[{x:l.x||0,y:l.y||0},{x:p.x||0,y:p.y||0}]},I=a(E,A,o,m.type,l,p,m.diagramId);c(A,I)}}})),u.debug("Cose-bilkent rendering completed")},"render"),Lt=pt;export{Lt as render};
@@ -0,0 +1 @@
1
+ import{ni}from"./index-zx0j3a2z.js";export{ni as createCynefinServices};
@@ -1,4 +1,4 @@
1
- import{R}from"./index-353m7b0p.js";import{e,t,j,x,u,k,d,f,p,m,g,b,v,A,E}from"./index-1r72hdzb.js";import"./index-6qmsnxwy.js";import{D}from"./index-tb1wf525.js";var xt=e(()=>({domains:new Map,transitions:[]}),"createDefaultData"),at=xt(),Mt=e(()=>at.domains,"getDomains"),zt=e(()=>at.transitions,"getTransitions"),Lt=e((n)=>{if(!n)return;for(let o of n){let a=o.domain,r=(o.items??[]).map((l)=>({label:l.label}));at.domains.set(a,{name:a,items:r})}},"setDomains"),Nt=e((n)=>{if(!n)return;at.transitions=n.filter((o)=>{if(o.from===o.to)return t.warn(`Cynefin: self-loop transition on domain "${o.from}" is not meaningful and will be skipped.`),!1;return!0}).map((o)=>({from:o.from,to:o.to,label:o.label||void 0}))},"setTransitions"),Pt=e(()=>E({...x.cynefin,...u().cynefin}),"getConfig"),It=e(()=>{d(),at=xt()},"clear"),st={getDomains:Mt,getTransitions:zt,setDomains:Lt,setTransitions:Nt,getConfig:Pt,clear:It,setAccTitle:f,getAccTitle:p,setDiagramTitle:b,getDiagramTitle:v,getAccDescription:g,setAccDescription:m},Wt=e((n)=>{R(n,st),st.setDomains(n.domains),st.setTransitions(n.transitions)},"populate"),Rt={parse:e(async(n)=>{let o=await D("cynefin",n);t.debug(o),Wt(o)},"parse")};function ot(n){let o=n+1831565813|0;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}e(ot,"seededRandom");function $t(n){let o=0;for(let a=0;a<n.length;a++){let r=n.charCodeAt(a);o=(o<<5)-o+r,o|=0}return o}e($t,"hashString");function bt(n,o){if(typeof n==="number"&&Number.isFinite(n)&&n!==0)return n;return $t(o)}e(bt,"resolveSeed");function wt(n,o,a,r){let l=n/2,C=r??n*0.015,rt=7,J=o/7,h=[];for(let i=0;i<=7;i++){let T=ot(a+i*17)*C*2-C;h.push({x:l+T,y:i*J})}let F=`M${h[0].x},${h[0].y}`;for(let i=0;i<h.length-1;i++){let T=h[i],c=h[i+1],w=(T.y+c.y)/2,P=i%2===0?1:-1,M=C*1.5*P*ot(a+i*31+7),K=T.x+M,tt=w,et=c.x-M;F+=` C${K},${tt} ${et},${w} ${c.x},${c.y}`}return F}e(wt,"generateFoldPath");function Ct(n,o,a,r){let l=o/2,C=r??o*0.015,rt=7,J=n/7,h=[];for(let i=0;i<=7;i++){let T=ot(a+i*23)*C*2-C;h.push({x:i*J,y:l+T})}let F=`M${h[0].x},${h[0].y}`;for(let i=0;i<h.length-1;i++){let T=h[i],c=h[i+1],w=(T.x+c.x)/2,P=i%2===0?1:-1,M=C*1.5*P*ot(a+i*37+11),K=w,tt=T.y+M,et=w,X=c.y-M;F+=` C${K},${tt} ${et},${X} ${c.x},${c.y}`}return F}e(Ct,"generateHorizontalBoundary");function vt(n,o){let a=n/2,r=o*0.5,l=o,C=n*0.03;return[`M${a},${r}`,`C${a+C},${r+(l-r)*0.2}`,`${a-C*1.5},${r+(l-r)*0.55}`,`${a+C*0.5},${r+(l-r)*0.75}`,`C${a-C},${r+(l-r)*0.85}`,`${a+C*0.3},${r+(l-r)*0.95}`,`${a},${l}`].join(" ")}e(vt,"generateCliffPath");function Dt(n,o,a,r){return[`M${n-a},${o}`,`A${a},${r} 0 1,1 ${n+a},${o}`,`A${a},${r} 0 1,1 ${n-a},${o}`,"Z"].join(" ")}e(Dt,"generateConfusionPath");var ht={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Ft=e((n,o)=>{let a=n/2,r=o/2;return{complex:{cx:a/2,cy:r/2,x:0,y:0,w:a,h:r},complicated:{cx:a+a/2,cy:r/2,x:a,y:0,w:a,h:r},chaotic:{cx:a/2,cy:r+r/2,x:0,y:r,w:a,h:r},clear:{cx:a+a/2,cy:r+r/2,x:a,y:r,w:a,h:r},confusion:{cx:a,cy:r,x:a*0.7,y:r*0.7,w:a*0.6,h:r*0.6}}},"getDomainLayouts"),Vt=e(()=>{let n=j(),o=u();return E(n,o.themeVariables).cynefin},"getCynefinDomainColors"),dt=3,_t=e((n,o,a,r)=>{let l=r.db,C=l.getDomains(),rt=l.getTransitions(),J=l.getDiagramTitle(),h=l.getAccTitle(),F=l.getAccDescription(),i=l.getConfig(),T=Vt();t.debug("Rendering Cynefin diagram");let{width:c,height:w,padding:P,showDomainDescriptions:M,boundaryAmplitude:K}=i,tt=c+P*2,et=w+P*2,X={complex:T.complexBg,complicated:T.complicatedBg,clear:T.clearBg,chaotic:T.chaoticBg,confusion:T.confusionBg},V=A(o);if(k(V,et,tt,i.useMaxWidth??!0),V.attr("viewBox",`0 0 ${tt} ${et}`),h)V.append("title").text(h);if(F)V.append("desc").text(F);let _=V.append("g").attr("transform",`translate(${P}, ${P})`),nt=Ft(c,w),ft=bt(i.seed,o),kt=_.append("g").attr("class","cynefin-backgrounds"),ct=["complex","complicated","chaotic","clear"];for(let y of ct){let s=nt[y];kt.append("rect").attr("class","cynefinDomain").attr("x",s.x).attr("y",s.y).attr("width",s.w).attr("height",s.h).attr("fill",X[y]).attr("fill-opacity",0.4).attr("stroke","none")}let lt=_.append("g").attr("class","cynefin-boundaries");lt.append("path").attr("class","cynefinBoundary").attr("d",wt(c,w,ft,K)).attr("fill","none"),lt.append("path").attr("class","cynefinBoundary").attr("d",Ct(c,w,ft+100,K)).attr("fill","none"),lt.append("path").attr("class","cynefinCliff").attr("d",vt(c,w)).attr("fill","none");let Tt=c*0.15,At=w*0.15;_.append("path").attr("class","cynefinConfusion").attr("d",Dt(c/2,w/2,Tt,At)).attr("fill",X.confusion).attr("fill-opacity",0.5);let mt=_.append("g").attr("class","cynefin-labels");for(let y of ct){let s=nt[y];mt.append("text").attr("class","cynefinDomainLabel").attr("x",s.cx).attr("y",M?s.cy-30:s.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.charAt(0).toUpperCase()+y.slice(1))}if(mt.append("text").attr("class","cynefinDomainLabel").attr("x",c/2).attr("y",M?w/2-10:w/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),M){let y=_.append("g").attr("class","cynefin-subtitles");for(let s of ct){let S=nt[s],B=ht[s];y.append("text").attr("class","cynefinSubtitle").attr("x",S.cx).attr("y",S.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(B.model),y.append("text").attr("class","cynefinSubtitle").attr("x",S.cx).attr("y",S.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(B.practice)}y.append("text").attr("class","cynefinSubtitle").attr("x",c/2).attr("y",w/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(ht.confusion.practice)}let pt=_.append("g").attr("class","cynefin-items"),H=26,yt=10,Bt=["complex","complicated","chaotic","clear","confusion"];for(let y of Bt){let s=C.get(y);if(!s||s.items.length===0)continue;let S=nt[y],B=y==="confusion",q=s.items,U=0;if(B&&s.items.length>dt)U=s.items.length-dt,q=s.items.slice(0,dt);let G;if(B){let L=M?22:14;G=S.cy+L}else G=S.cy+(M?25:15);if([...q].forEach((L,Y)=>{let I=G+Y*(H+4),O=pt.append("g"),Q=O.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",H/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(L.label),N=L.label.length*7,z=Q.node();if(z&&typeof z.getBBox==="function"){let it=z.getBBox();if(it.width>0)N=it.width}let W=N+yt*2,Z=S.cx-W/2;O.attr("transform",`translate(${Z}, ${I})`),O.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",W).attr("height",H).attr("rx",4).attr("ry",4).attr("fill",X[y]).attr("fill-opacity",0.95),Q.attr("x",W/2).attr("y",H/2)}),U>0){let L=G+q.length*(H+4),Y=`+${U} more`,I=pt.append("g"),O=I.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",H/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(Y),Q=Y.length*7,N=O.node();if(N&&typeof N.getBBox==="function"){let Z=N.getBBox();if(Z.width>0)Q=Z.width}let z=Q+yt*2,W=S.cx-z/2;I.attr("transform",`translate(${W}, ${L})`),I.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",z).attr("height",H).attr("rx",4).attr("ry",4).attr("fill",X[y]).attr("fill-opacity",0.6),O.attr("x",z/2).attr("y",H/2)}}if(rt.length>0){let y=V.select("defs").empty()?V.append("defs"):V.select("defs"),s=`cynefin-arrow-${o}`;y.append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");let S=_.append("g").attr("class","cynefin-arrows");rt.forEach((B)=>{let q=nt[B.from],U=nt[B.to];if(!q||!U)return;if(B.from===B.to){t.warn(`Cynefin renderer: skipping self-loop on domain "${B.from}"`);return}let{cx:G,cy:L}=q,{cx:Y,cy:I}=U,O=(G+Y)/2,Q=(L+I)/2,N=Y-G,z=I-L,W=Math.sqrt(N*N+z*z),Z=W*0.15,it=-z/W,St=N/W,ut=O+it*Z,gt=Q+St*Z;if(S.append("path").attr("class","cynefinArrowLine").attr("d",`M${G},${L} Q${ut},${gt} ${Y},${I}`).attr("fill","none").attr("marker-end",`url(#${s})`),B.label)S.append("text").attr("class","cynefinArrowLabel").attr("x",ut).attr("y",gt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(B.label)})}if(J)_.append("text").attr("class","cynefinTitle").attr("x",c/2).attr("y",-P/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(J)},"draw"),Et={draw:_t},Ht=e(()=>{let n=j(),o=u();return E(n,o.themeVariables).cynefin},"getCynefinTheme"),Gt=e(()=>{let n=Ht();return`
1
+ import{R}from"./index-5n03dmb9.js";import{e,t,j,x,u,T,d,f,p,m,g,b,v,A,E}from"./index-nwsya6dj.js";import"./index-v119nznk.js";import{D}from"./index-zx0j3a2z.js";var xt=e(()=>({domains:new Map,transitions:[]}),"createDefaultData"),at=xt(),Mt=e(()=>at.domains,"getDomains"),zt=e(()=>at.transitions,"getTransitions"),Lt=e((n)=>{if(!n)return;for(let o of n){let a=o.domain,r=(o.items??[]).map((l)=>({label:l.label}));at.domains.set(a,{name:a,items:r})}},"setDomains"),Nt=e((n)=>{if(!n)return;at.transitions=n.filter((o)=>{if(o.from===o.to)return t.warn(`Cynefin: self-loop transition on domain "${o.from}" is not meaningful and will be skipped.`),!1;return!0}).map((o)=>({from:o.from,to:o.to,label:o.label||void 0}))},"setTransitions"),Pt=e(()=>E({...x.cynefin,...u().cynefin}),"getConfig"),It=e(()=>{d(),at=xt()},"clear"),st={getDomains:Mt,getTransitions:zt,setDomains:Lt,setTransitions:Nt,getConfig:Pt,clear:It,setAccTitle:f,getAccTitle:p,setDiagramTitle:b,getDiagramTitle:v,getAccDescription:g,setAccDescription:m},Wt=e((n)=>{R(n,st),st.setDomains(n.domains),st.setTransitions(n.transitions)},"populate"),Rt={parse:e(async(n)=>{let o=await D("cynefin",n);t.debug(o),Wt(o)},"parse")};function ot(n){let o=n+1831565813|0;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}e(ot,"seededRandom");function $t(n){let o=0;for(let a=0;a<n.length;a++){let r=n.charCodeAt(a);o=(o<<5)-o+r,o|=0}return o}e($t,"hashString");function bt(n,o){if(typeof n==="number"&&Number.isFinite(n)&&n!==0)return n;return $t(o)}e(bt,"resolveSeed");function wt(n,o,a,r){let l=n/2,C=r??n*0.015,rt=7,J=o/7,h=[];for(let i=0;i<=7;i++){let k=ot(a+i*17)*C*2-C;h.push({x:l+k,y:i*J})}let F=`M${h[0].x},${h[0].y}`;for(let i=0;i<h.length-1;i++){let k=h[i],c=h[i+1],w=(k.y+c.y)/2,P=i%2===0?1:-1,M=C*1.5*P*ot(a+i*31+7),K=k.x+M,tt=w,et=c.x-M;F+=` C${K},${tt} ${et},${w} ${c.x},${c.y}`}return F}e(wt,"generateFoldPath");function Ct(n,o,a,r){let l=o/2,C=r??o*0.015,rt=7,J=n/7,h=[];for(let i=0;i<=7;i++){let k=ot(a+i*23)*C*2-C;h.push({x:i*J,y:l+k})}let F=`M${h[0].x},${h[0].y}`;for(let i=0;i<h.length-1;i++){let k=h[i],c=h[i+1],w=(k.x+c.x)/2,P=i%2===0?1:-1,M=C*1.5*P*ot(a+i*37+11),K=w,tt=k.y+M,et=w,X=c.y-M;F+=` C${K},${tt} ${et},${X} ${c.x},${c.y}`}return F}e(Ct,"generateHorizontalBoundary");function vt(n,o){let a=n/2,r=o*0.5,l=o,C=n*0.03;return[`M${a},${r}`,`C${a+C},${r+(l-r)*0.2}`,`${a-C*1.5},${r+(l-r)*0.55}`,`${a+C*0.5},${r+(l-r)*0.75}`,`C${a-C},${r+(l-r)*0.85}`,`${a+C*0.3},${r+(l-r)*0.95}`,`${a},${l}`].join(" ")}e(vt,"generateCliffPath");function Dt(n,o,a,r){return[`M${n-a},${o}`,`A${a},${r} 0 1,1 ${n+a},${o}`,`A${a},${r} 0 1,1 ${n-a},${o}`,"Z"].join(" ")}e(Dt,"generateConfusionPath");var ht={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Ft=e((n,o)=>{let a=n/2,r=o/2;return{complex:{cx:a/2,cy:r/2,x:0,y:0,w:a,h:r},complicated:{cx:a+a/2,cy:r/2,x:a,y:0,w:a,h:r},chaotic:{cx:a/2,cy:r+r/2,x:0,y:r,w:a,h:r},clear:{cx:a+a/2,cy:r+r/2,x:a,y:r,w:a,h:r},confusion:{cx:a,cy:r,x:a*0.7,y:r*0.7,w:a*0.6,h:r*0.6}}},"getDomainLayouts"),Vt=e(()=>{let n=j(),o=u();return E(n,o.themeVariables).cynefin},"getCynefinDomainColors"),dt=3,_t=e((n,o,a,r)=>{let l=r.db,C=l.getDomains(),rt=l.getTransitions(),J=l.getDiagramTitle(),h=l.getAccTitle(),F=l.getAccDescription(),i=l.getConfig(),k=Vt();t.debug("Rendering Cynefin diagram");let{width:c,height:w,padding:P,showDomainDescriptions:M,boundaryAmplitude:K}=i,tt=c+P*2,et=w+P*2,X={complex:k.complexBg,complicated:k.complicatedBg,clear:k.clearBg,chaotic:k.chaoticBg,confusion:k.confusionBg},V=A(o);if(T(V,et,tt,i.useMaxWidth??!0),V.attr("viewBox",`0 0 ${tt} ${et}`),h)V.append("title").text(h);if(F)V.append("desc").text(F);let _=V.append("g").attr("transform",`translate(${P}, ${P})`),nt=Ft(c,w),ft=bt(i.seed,o),kt=_.append("g").attr("class","cynefin-backgrounds"),ct=["complex","complicated","chaotic","clear"];for(let y of ct){let s=nt[y];kt.append("rect").attr("class","cynefinDomain").attr("x",s.x).attr("y",s.y).attr("width",s.w).attr("height",s.h).attr("fill",X[y]).attr("fill-opacity",0.4).attr("stroke","none")}let lt=_.append("g").attr("class","cynefin-boundaries");lt.append("path").attr("class","cynefinBoundary").attr("d",wt(c,w,ft,K)).attr("fill","none"),lt.append("path").attr("class","cynefinBoundary").attr("d",Ct(c,w,ft+100,K)).attr("fill","none"),lt.append("path").attr("class","cynefinCliff").attr("d",vt(c,w)).attr("fill","none");let Tt=c*0.15,At=w*0.15;_.append("path").attr("class","cynefinConfusion").attr("d",Dt(c/2,w/2,Tt,At)).attr("fill",X.confusion).attr("fill-opacity",0.5);let mt=_.append("g").attr("class","cynefin-labels");for(let y of ct){let s=nt[y];mt.append("text").attr("class","cynefinDomainLabel").attr("x",s.cx).attr("y",M?s.cy-30:s.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.charAt(0).toUpperCase()+y.slice(1))}if(mt.append("text").attr("class","cynefinDomainLabel").attr("x",c/2).attr("y",M?w/2-10:w/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),M){let y=_.append("g").attr("class","cynefin-subtitles");for(let s of ct){let S=nt[s],B=ht[s];y.append("text").attr("class","cynefinSubtitle").attr("x",S.cx).attr("y",S.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(B.model),y.append("text").attr("class","cynefinSubtitle").attr("x",S.cx).attr("y",S.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(B.practice)}y.append("text").attr("class","cynefinSubtitle").attr("x",c/2).attr("y",w/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(ht.confusion.practice)}let pt=_.append("g").attr("class","cynefin-items"),H=26,yt=10,Bt=["complex","complicated","chaotic","clear","confusion"];for(let y of Bt){let s=C.get(y);if(!s||s.items.length===0)continue;let S=nt[y],B=y==="confusion",q=s.items,U=0;if(B&&s.items.length>dt)U=s.items.length-dt,q=s.items.slice(0,dt);let G;if(B){let L=M?22:14;G=S.cy+L}else G=S.cy+(M?25:15);if([...q].forEach((L,Y)=>{let I=G+Y*(H+4),O=pt.append("g"),Q=O.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",H/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(L.label),N=L.label.length*7,z=Q.node();if(z&&typeof z.getBBox==="function"){let it=z.getBBox();if(it.width>0)N=it.width}let W=N+yt*2,Z=S.cx-W/2;O.attr("transform",`translate(${Z}, ${I})`),O.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",W).attr("height",H).attr("rx",4).attr("ry",4).attr("fill",X[y]).attr("fill-opacity",0.95),Q.attr("x",W/2).attr("y",H/2)}),U>0){let L=G+q.length*(H+4),Y=`+${U} more`,I=pt.append("g"),O=I.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",H/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(Y),Q=Y.length*7,N=O.node();if(N&&typeof N.getBBox==="function"){let Z=N.getBBox();if(Z.width>0)Q=Z.width}let z=Q+yt*2,W=S.cx-z/2;I.attr("transform",`translate(${W}, ${L})`),I.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",z).attr("height",H).attr("rx",4).attr("ry",4).attr("fill",X[y]).attr("fill-opacity",0.6),O.attr("x",z/2).attr("y",H/2)}}if(rt.length>0){let y=V.select("defs").empty()?V.append("defs"):V.select("defs"),s=`cynefin-arrow-${o}`;y.append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");let S=_.append("g").attr("class","cynefin-arrows");rt.forEach((B)=>{let q=nt[B.from],U=nt[B.to];if(!q||!U)return;if(B.from===B.to){t.warn(`Cynefin renderer: skipping self-loop on domain "${B.from}"`);return}let{cx:G,cy:L}=q,{cx:Y,cy:I}=U,O=(G+Y)/2,Q=(L+I)/2,N=Y-G,z=I-L,W=Math.sqrt(N*N+z*z),Z=W*0.15,it=-z/W,St=N/W,ut=O+it*Z,gt=Q+St*Z;if(S.append("path").attr("class","cynefinArrowLine").attr("d",`M${G},${L} Q${ut},${gt} ${Y},${I}`).attr("fill","none").attr("marker-end",`url(#${s})`),B.label)S.append("text").attr("class","cynefinArrowLabel").attr("x",ut).attr("y",gt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(B.label)})}if(J)_.append("text").attr("class","cynefinTitle").attr("x",c/2).attr("y",-P/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(J)},"draw"),Et={draw:_t},Ht=e(()=>{let n=j(),o=u();return E(n,o.themeVariables).cynefin},"getCynefinTheme"),Gt=e(()=>{let n=Ht();return`
2
2
  .cynefinDomain {
3
3
  stroke: none;
4
4
  }
@@ -1,4 +1,4 @@
1
- import{e,t,r,Ne,C,ct,sn,Qe,Ui,on,yt,ln,Ft,Qn,Xt,Kt}from"./index-1r72hdzb.js";import{L}from"./index-fjtdggjn.js";import"./index-6qmsnxwy.js";import{rr}from"./index-rft2hcz5.js";import{qe,_,Dr,zt,Ii,Li}from"./index-0rk4gp1g.js";import"./index-d3b3gqe9.js";var P=e((s,n,p)=>Math.max(n,Math.min(p,s)),"clamp"),R=e((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),B=e((s)=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),T=e((s,n,p,w,g)=>{let d=[],l=new Set;if(p.forEach(({start:a,end:i})=>{if(a!==w)l.add(a);if(i!==w)l.add(i)}),l.forEach((a)=>{let i=s.node(a);if(typeof i?.x==="number"&&typeof i?.y==="number")d.push(i)}),d.length===0)p.forEach(({edge:a})=>{(a.points??[]).forEach((i)=>{if(typeof i?.x==="number"&&typeof i?.y==="number")d.push(i)})});if(d.length===0)return R(g);let h=d.reduce((a,i)=>({x:a.x+i.x/d.length,y:a.y+i.y/d.length}),{x:0,y:0}),u=h.x-n.x,f=h.y-n.y;if(Math.abs(u)>Math.abs(f))return u>0?"right":"left";if(Math.abs(f)>0)return f>0?"bottom":"top";return R(g)},"getSelfLoopSide"),k=e((s,n="top",p=0,w=0)=>{let g=s.x,d=s.y-p,l=s.width/2,h=s.height/2,u=Math.max(36,Math.min(100,s.width*0.8)),f=P(Math.max(w,s.width*0.35),36,u),a=P(Math.min(s.width,s.height)*0.45,24,48);switch(n){case"bottom":{let i=d+h;return[{x:g-f/2,y:i},{x:g-f/2,y:i+a},{x:g+f/2,y:i+a},{x:g+f/2,y:i}]}case"right":{let i=g+l;return[{x:i,y:d-f/2},{x:i+a,y:d-f/2},{x:i+a,y:d+f/2},{x:i,y:d+f/2}]}case"left":{let i=g-l;return[{x:i,y:d-f/2},{x:i-a,y:d-f/2},{x:i-a,y:d+f/2},{x:i,y:d+f/2}]}case"top":default:{let i=d-h;return[{x:g-f/2,y:i},{x:g-f/2,y:i-a},{x:g+f/2,y:i-a},{x:g+f/2,y:i}]}}},"getSelfLoopPoints"),O=e((s,n,p="top",w=0,g={})=>{let l=s.x,h=s.y-w,u=g.width??0,f=g.height??0;switch(p){case"bottom":return{x:l,y:Math.max(...n.map((a)=>a.y))+f/2+4};case"right":return{x:Math.max(...n.map((a)=>a.x))+u/2+4,y:h};case"left":return{x:Math.min(...n.map((a)=>a.x))-u/2-4,y:h};case"top":default:return{x:l,y:Math.min(...n.map((a)=>a.y))-f/2-4}}},"getSelfLoopLabelPosition"),A=e((s,n=0,{mergeSelfLoops:p=!0}={})=>{let w=new Map,g=[],d=s.graph()?.rankdir;return s.edges().forEach((l)=>{let h=s.edge(l);if(p&&h.selfLoop){let u=h.selfLoop.id;if(!w.has(u))w.set(u,[]);w.get(u).push({edge:h,start:l.v,end:l.w})}else g.push({edge:h,start:l.v,end:l.w})}),w.forEach((l)=>{if(l.length!==3){l.forEach((N)=>g.push(N));return}l.sort((N,c)=>N.edge.selfLoop.order-c.edge.selfLoop.order);let[h,u,f]=l,a=h.edge.originalEdge??u.edge.originalEdge??f.edge.originalEdge??u.edge,i=s.node(a.start);if(!i){l.forEach((N)=>g.push(N));return}let y={width:u.edge.width,height:u.edge.height},b=T(s,i,l,a.start,d),X=k(i,b,n,y.width??0),E=O(i,X,b,n,y),x={...u.edge,...a,id:a.id,points:X,start:a.start,end:a.end,x:E.x,y:E.y,width:y.width,height:y.height,labelStyle:u.edge.labelStyle,fromCluster:h.edge.fromCluster??u.edge.fromCluster??f.edge.fromCluster,toCluster:h.edge.toCluster??u.edge.toCluster??f.edge.toCluster};delete x.selfLoop,delete x.originalEdge,g.push({edge:x,start:x.start,end:x.end})}),g},"getEdgesToRender"),J=e(async(s,n,p,w,g,d)=>{t.warn("Graph in recursive render:XAX",qe(n),g);let l=n.graph().rankdir;t.trace("Dir in recursive render - dir:",l);let h=s.insert("g").attr("class","root");if(!n.nodes())t.info("No nodes found for",n);else t.info("Recursive render XXX",n.nodes());if(n.edges().length>0)t.info("Recursive edges",n.edge(n.edges()[0]));let u=h.insert("g").attr("class","clusters"),f=h.insert("g").attr("class","edgePaths"),a=h.insert("g").attr("class","edgeLabels"),i=h.insert("g").attr("class","nodes"),y=B(p);await Promise.all(n.nodes().map(async function(c){let o=n.node(c);if(g!==void 0){let m=JSON.parse(JSON.stringify(g.clusterData));if(t.trace(`Setting data for parent cluster XXX
1
+ import{e,t,r,Ne,C,ct,on,Qe,Ui,sn,yt,ln,Ft,Qn,Xt,Kt}from"./index-nwsya6dj.js";import{L}from"./index-mergmj97.js";import"./index-v119nznk.js";import{rr}from"./index-8g1vb57n.js";import{qe,_,Dr,zt,Ii,Li}from"./index-ap4q4vez.js";import"./index-qhfrazv3.js";var P=e((s,n,p)=>Math.max(n,Math.min(p,s)),"clamp"),R=e((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),B=e((s)=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),T=e((s,n,p,w,g)=>{let d=[],l=new Set;if(p.forEach(({start:a,end:i})=>{if(a!==w)l.add(a);if(i!==w)l.add(i)}),l.forEach((a)=>{let i=s.node(a);if(typeof i?.x==="number"&&typeof i?.y==="number")d.push(i)}),d.length===0)p.forEach(({edge:a})=>{(a.points??[]).forEach((i)=>{if(typeof i?.x==="number"&&typeof i?.y==="number")d.push(i)})});if(d.length===0)return R(g);let h=d.reduce((a,i)=>({x:a.x+i.x/d.length,y:a.y+i.y/d.length}),{x:0,y:0}),u=h.x-n.x,f=h.y-n.y;if(Math.abs(u)>Math.abs(f))return u>0?"right":"left";if(Math.abs(f)>0)return f>0?"bottom":"top";return R(g)},"getSelfLoopSide"),k=e((s,n="top",p=0,w=0)=>{let g=s.x,d=s.y-p,l=s.width/2,h=s.height/2,u=Math.max(36,Math.min(100,s.width*0.8)),f=P(Math.max(w,s.width*0.35),36,u),a=P(Math.min(s.width,s.height)*0.45,24,48);switch(n){case"bottom":{let i=d+h;return[{x:g-f/2,y:i},{x:g-f/2,y:i+a},{x:g+f/2,y:i+a},{x:g+f/2,y:i}]}case"right":{let i=g+l;return[{x:i,y:d-f/2},{x:i+a,y:d-f/2},{x:i+a,y:d+f/2},{x:i,y:d+f/2}]}case"left":{let i=g-l;return[{x:i,y:d-f/2},{x:i-a,y:d-f/2},{x:i-a,y:d+f/2},{x:i,y:d+f/2}]}case"top":default:{let i=d-h;return[{x:g-f/2,y:i},{x:g-f/2,y:i-a},{x:g+f/2,y:i-a},{x:g+f/2,y:i}]}}},"getSelfLoopPoints"),O=e((s,n,p="top",w=0,g={})=>{let l=s.x,h=s.y-w,u=g.width??0,f=g.height??0;switch(p){case"bottom":return{x:l,y:Math.max(...n.map((a)=>a.y))+f/2+4};case"right":return{x:Math.max(...n.map((a)=>a.x))+u/2+4,y:h};case"left":return{x:Math.min(...n.map((a)=>a.x))-u/2-4,y:h};case"top":default:return{x:l,y:Math.min(...n.map((a)=>a.y))-f/2-4}}},"getSelfLoopLabelPosition"),A=e((s,n=0,{mergeSelfLoops:p=!0}={})=>{let w=new Map,g=[],d=s.graph()?.rankdir;return s.edges().forEach((l)=>{let h=s.edge(l);if(p&&h.selfLoop){let u=h.selfLoop.id;if(!w.has(u))w.set(u,[]);w.get(u).push({edge:h,start:l.v,end:l.w})}else g.push({edge:h,start:l.v,end:l.w})}),w.forEach((l)=>{if(l.length!==3){l.forEach((N)=>g.push(N));return}l.sort((N,c)=>N.edge.selfLoop.order-c.edge.selfLoop.order);let[h,u,f]=l,a=h.edge.originalEdge??u.edge.originalEdge??f.edge.originalEdge??u.edge,i=s.node(a.start);if(!i){l.forEach((N)=>g.push(N));return}let y={width:u.edge.width,height:u.edge.height},b=T(s,i,l,a.start,d),X=k(i,b,n,y.width??0),E=O(i,X,b,n,y),x={...u.edge,...a,id:a.id,points:X,start:a.start,end:a.end,x:E.x,y:E.y,width:y.width,height:y.height,labelStyle:u.edge.labelStyle,fromCluster:h.edge.fromCluster??u.edge.fromCluster??f.edge.fromCluster,toCluster:h.edge.toCluster??u.edge.toCluster??f.edge.toCluster};delete x.selfLoop,delete x.originalEdge,g.push({edge:x,start:x.start,end:x.end})}),g},"getEdgesToRender"),J=e(async(s,n,p,w,g,d)=>{t.warn("Graph in recursive render:XAX",qe(n),g);let l=n.graph().rankdir;t.trace("Dir in recursive render - dir:",l);let h=s.insert("g").attr("class","root");if(!n.nodes())t.info("No nodes found for",n);else t.info("Recursive render XXX",n.nodes());if(n.edges().length>0)t.info("Recursive edges",n.edge(n.edges()[0]));let u=h.insert("g").attr("class","clusters"),f=h.insert("g").attr("class","edgePaths"),a=h.insert("g").attr("class","edgeLabels"),i=h.insert("g").attr("class","nodes"),y=B(p);await Promise.all(n.nodes().map(async function(c){let o=n.node(c);if(g!==void 0){let m=JSON.parse(JSON.stringify(g.clusterData));if(t.trace(`Setting data for parent cluster XXX
2
2
  Node.id = `,c,`
3
3
  data=`,m.height,`
4
- Parent cluster`,g.height),n.setNode(g.id,m),!n.parent(c))t.trace("Setting parent",c,g.id),n.setParent(c,g.id,m)}if(t.info("(Insert) Node XXX"+c+": "+JSON.stringify(n.node(c))),o?.clusterNode){t.info("Cluster identified XBX",c,o.width,n.node(c));let{ranksep:m,nodesep:S}=n.graph();o.graph.setGraph({...o.graph.graph(),ranksep:m+25,nodesep:S});let I=await J(i,o.graph,p,w,n.node(c),d),M=I.elem;C(o,M),o.diff=I.diff||0,t.info("New compound node after recursive render XAX",c,"width",o.width,"height",o.height),Ui(M,o)}else if(n.children(c).length>0)t.trace("Cluster - the non recursive path XBX",c,o.id,o,o.width,"Graph:",n),t.trace(zt(o.id,n)),_.set(o.id,{id:zt(o.id,n),node:o});else t.trace("Node - the non recursive path XAX",c,i,n.node(c),l),await Qe(i,n.node(c),{config:d,dir:l})})),await e(async()=>{let c=n.edges().map(async function(o){let m=n.edge(o.v,o.w,o.name);if(t.info("Edge "+o.v+" -> "+o.w+": "+JSON.stringify(o)),t.info("Edge "+o.v+" -> "+o.w+": ",o," ",JSON.stringify(n.edge(o))),t.info("Fix",_,"ids:",o.v,o.w,"Translating: ",_.get(o.v),_.get(o.w)),y&&m.selfLoop){if(m.selfLoop.order!==1)return;let S=m.id;m.id=m.selfLoop.id,await Ft(a,m),m.id=S;return}await Ft(a,m)});await Promise.all(c)},"processEdges")(),t.info("Graph before layout:",JSON.stringify(qe(n))),t.info("############################################# XXX"),t.info("### Layout ### XXX"),t.info("############################################# XXX"),rr(n),t.info("Graph after layout:",JSON.stringify(qe(n)));let X=0,{subGraphTitleTotalMargin:E}=Ne(d);await Promise.all(Li(n).map(async function(c){let o=n.node(c);if(t.info("Position XBX => "+c+": ("+o.x,","+o.y,") width: ",o.width," height: ",o.height),o?.clusterNode)o.y+=E,t.info("A tainted cluster node XBX1",c,o.id,o.width,o.height,o.x,o.y,n.parent(c)),_.get(o.id).node=o,yt(o);else if(n.children(c).length>0){t.info("A pure cluster node XBX1",c,o.id,o.x,o.y,o.width,o.height,n.parent(c)),o.height+=E,n.node(o.parentId);let m=o?.padding/2||0,S=o?.labelBBox?.height||0,I=S-m||0;t.debug("OffsetY",I,"labelHeight",S,"halfPadding",m),await ct(u,o),_.get(o.id).node=o}else{let m=n.node(o.parentId);o.y+=E/2,t.info("A regular node XBX1 - using the padding",o.id,"parent",o.parentId,o.width,o.height,o.x,o.y,"offsetY",o.offsetY,"parent",m,m?.offsetY,o),yt(o)}}));let x=E/2;return A(n,x,{mergeSelfLoops:y}).forEach(function({edge:c,start:o,end:m}){t.info("Edge "+o+" -> "+m+": "+JSON.stringify(c),c),c.points.forEach((G)=>G.y+=x);let S=n.node(o),I=n.node(m),M=Xt(f,c,_,p,S,I,w);Qn(c,M)}),n.nodes().forEach(function(c){let o=n.node(c);if(t.info(c,o.type,o.diff),o.isGroup)X=o.diff}),t.warn("Returning from recursive render XAX",h,X),{elem:h,diff:X}},"recursiveRender"),te=e(async(s,n)=>{let p=new L({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),w=n.select("g");Kt(w,s.markers,s.type,s.diagramId),on(),ln(),sn(),Dr(),s.nodes.forEach((d)=>{if(p.setNode(d.id,{...d}),d.parentId)p.setParent(d.id,d.parentId)}),t.debug("Edges:",s.edges),s.edges.forEach((d)=>{if(d.start===d.end){let l=d.start,h=l+"---"+l+"---1",u=l+"---"+l+"---2",f=p.node(l);p.setNode(h,{domId:h,id:h,parentId:f.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),p.setParent(h,f.parentId),p.setNode(u,{domId:u,id:u,parentId:f.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),p.setParent(u,f.parentId);let a=structuredClone(d),i=structuredClone(d),y=structuredClone(d),b=structuredClone(d);if(i.originalEdge=a,i.selfLoop={id:a.id,order:0},y.originalEdge=a,y.selfLoop={id:a.id,order:1},b.originalEdge=a,b.selfLoop={id:a.id,order:2},i.label="",i.arrowTypeEnd="none",i.endLabelLeft="",i.endLabelRight="",i.startLabelLeft="",i.id=l+"-cyclic-special-1",y.startLabelRight="",y.startLabelLeft="",y.endLabelLeft="",y.endLabelRight="",y.arrowTypeStart="none",y.arrowTypeEnd="none",y.id=l+"-cyclic-special-mid",b.label="",b.startLabelRight="",b.startLabelLeft="",b.arrowTypeStart="none",f.isGroup)i.fromCluster=l,b.toCluster=l;b.id=l+"-cyclic-special-2",b.arrowTypeStart="none",p.setEdge(l,h,i,l+"-cyclic-special-0"),p.setEdge(h,u,y,l+"-cyclic-special-1"),p.setEdge(u,l,b,l+"-cyclic-special-2")}else p.setEdge(d.start,d.end,{...d},d.id)}),t.warn("Graph at first:",JSON.stringify(qe(p))),Ii(p),t.warn("Graph after XAX:",JSON.stringify(qe(p)));let g=r();await J(w,p,s.type,s.diagramId,void 0,g)},"render");export{A as getEdgesToRender,te as render};
4
+ Parent cluster`,g.height),n.setNode(g.id,m),!n.parent(c))t.trace("Setting parent",c,g.id),n.setParent(c,g.id,m)}if(t.info("(Insert) Node XXX"+c+": "+JSON.stringify(n.node(c))),o?.clusterNode){t.info("Cluster identified XBX",c,o.width,n.node(c));let{ranksep:m,nodesep:S}=n.graph();o.graph.setGraph({...o.graph.graph(),ranksep:m+25,nodesep:S});let I=await J(i,o.graph,p,w,n.node(c),d),M=I.elem;C(o,M),o.diff=I.diff||0,t.info("New compound node after recursive render XAX",c,"width",o.width,"height",o.height),Ui(M,o)}else if(n.children(c).length>0)t.trace("Cluster - the non recursive path XBX",c,o.id,o,o.width,"Graph:",n),t.trace(zt(o.id,n)),_.set(o.id,{id:zt(o.id,n),node:o});else t.trace("Node - the non recursive path XAX",c,i,n.node(c),l),await Qe(i,n.node(c),{config:d,dir:l})})),await e(async()=>{let c=n.edges().map(async function(o){let m=n.edge(o.v,o.w,o.name);if(t.info("Edge "+o.v+" -> "+o.w+": "+JSON.stringify(o)),t.info("Edge "+o.v+" -> "+o.w+": ",o," ",JSON.stringify(n.edge(o))),t.info("Fix",_,"ids:",o.v,o.w,"Translating: ",_.get(o.v),_.get(o.w)),y&&m.selfLoop){if(m.selfLoop.order!==1)return;let S=m.id;m.id=m.selfLoop.id,await Ft(a,m),m.id=S;return}await Ft(a,m)});await Promise.all(c)},"processEdges")(),t.info("Graph before layout:",JSON.stringify(qe(n))),t.info("############################################# XXX"),t.info("### Layout ### XXX"),t.info("############################################# XXX"),rr(n),t.info("Graph after layout:",JSON.stringify(qe(n)));let X=0,{subGraphTitleTotalMargin:E}=Ne(d);await Promise.all(Li(n).map(async function(c){let o=n.node(c);if(t.info("Position XBX => "+c+": ("+o.x,","+o.y,") width: ",o.width," height: ",o.height),o?.clusterNode)o.y+=E,t.info("A tainted cluster node XBX1",c,o.id,o.width,o.height,o.x,o.y,n.parent(c)),_.get(o.id).node=o,yt(o);else if(n.children(c).length>0){t.info("A pure cluster node XBX1",c,o.id,o.x,o.y,o.width,o.height,n.parent(c)),o.height+=E,n.node(o.parentId);let m=o?.padding/2||0,S=o?.labelBBox?.height||0,I=S-m||0;t.debug("OffsetY",I,"labelHeight",S,"halfPadding",m),await ct(u,o),_.get(o.id).node=o}else{let m=n.node(o.parentId);o.y+=E/2,t.info("A regular node XBX1 - using the padding",o.id,"parent",o.parentId,o.width,o.height,o.x,o.y,"offsetY",o.offsetY,"parent",m,m?.offsetY,o),yt(o)}}));let x=E/2;return A(n,x,{mergeSelfLoops:y}).forEach(function({edge:c,start:o,end:m}){t.info("Edge "+o+" -> "+m+": "+JSON.stringify(c),c),c.points.forEach((G)=>G.y+=x);let S=n.node(o),I=n.node(m),M=Xt(f,c,_,p,S,I,w);Qn(c,M)}),n.nodes().forEach(function(c){let o=n.node(c);if(t.info(c,o.type,o.diff),o.isGroup)X=o.diff}),t.warn("Returning from recursive render XAX",h,X),{elem:h,diff:X}},"recursiveRender"),te=e(async(s,n)=>{let p=new L({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),w=n.select("g");Kt(w,s.markers,s.type,s.diagramId),sn(),ln(),on(),Dr(),s.nodes.forEach((d)=>{if(p.setNode(d.id,{...d}),d.parentId)p.setParent(d.id,d.parentId)}),t.debug("Edges:",s.edges),s.edges.forEach((d)=>{if(d.start===d.end){let l=d.start,h=l+"---"+l+"---1",u=l+"---"+l+"---2",f=p.node(l);p.setNode(h,{domId:h,id:h,parentId:f.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),p.setParent(h,f.parentId),p.setNode(u,{domId:u,id:u,parentId:f.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),p.setParent(u,f.parentId);let a=structuredClone(d),i=structuredClone(d),y=structuredClone(d),b=structuredClone(d);if(i.originalEdge=a,i.selfLoop={id:a.id,order:0},y.originalEdge=a,y.selfLoop={id:a.id,order:1},b.originalEdge=a,b.selfLoop={id:a.id,order:2},i.label="",i.arrowTypeEnd="none",i.endLabelLeft="",i.endLabelRight="",i.startLabelLeft="",i.id=l+"-cyclic-special-1",y.startLabelRight="",y.startLabelLeft="",y.endLabelLeft="",y.endLabelRight="",y.arrowTypeStart="none",y.arrowTypeEnd="none",y.id=l+"-cyclic-special-mid",b.label="",b.startLabelRight="",b.startLabelLeft="",b.arrowTypeStart="none",f.isGroup)i.fromCluster=l,b.toCluster=l;b.id=l+"-cyclic-special-2",b.arrowTypeStart="none",p.setEdge(l,h,i,l+"-cyclic-special-0"),p.setEdge(h,u,y,l+"-cyclic-special-1"),p.setEdge(u,l,b,l+"-cyclic-special-2")}else p.setEdge(d.start,d.end,{...d},d.id)}),t.warn("Graph at first:",JSON.stringify(qe(p))),Ii(p),t.warn("Graph after XAX:",JSON.stringify(qe(p)));let g=r();await J(w,p,s.type,s.diagramId,void 0,g)},"render");export{A as getEdgesToRender,te as render};
@@ -1,7 +1,7 @@
1
- import{vt}from"./index-vv56h019.js";import{R}from"./index-353m7b0p.js";import{e,t,x,u,w,k,d,f,p,m,g,b,v,A,E,Bt,ke}from"./index-1r72hdzb.js";import"./index-6qmsnxwy.js";import{D}from"./index-tb1wf525.js";var F=/[─━│┃└┗├┣]/,j=/[└┗├┣]/,te=/[─━]/,O=/^[\s│┃]+$/,G=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Y=/^\s*%%/,ne=" ";function Z(i){return i.some((n)=>F.test(n))}e(Z,"isBoxDrawingFormat");function q(i){for(let n of i){let r=j.exec(n);if(r?.index&&r.index>0)return r.index}return 4}e(q,"inferSegmentWidth");function U(i,n){return i.replace(/\bline\s+(\d+)\b/gi,(r,o)=>{let s=parseInt(o,10),l=n.get(s);return l?`line ${l}`:r})}e(U,"remapErrorLines");function J(i){let n=i.split(`
2
- `),r=new Map,o=-1;for(let[c,a]of n.entries())if(a.trim()==="treeView-beta"){o=c;break}if(o===-1)return{text:i,lineMap:r};let s=[];for(let c=o+1;c<n.length;c++){let a=n[c];if(a.trim()===""||Y.test(a)||G.test(a))continue;if(O.test(a))continue;s.push(a.replace(/\t/g," "))}if(!Z(s))return{text:i,lineMap:r};let l=q(s),h=[],I=0;for(let c=0;c<=o;c++)h.push(n[c]),I++,r.set(I,c+1);for(let c=o+1;c<n.length;c++){let a=n[c],y=a.trim(),B=c+1;if(y===""){h.push(a),I++,r.set(I,B);continue}if(Y.test(a)){h.push(a),I++,r.set(I,B);continue}if(G.test(a)){h.push(a),I++,r.set(I,B);continue}if(O.test(a))continue;let C=a.replace(/\t/g," "),N=j.exec(C);if(N?.index!==void 0){let V=N.index,S=Math.round(V/l)+1,T=V+1;while(T<C.length&&te.test(C[T]))T++;while(T<C.length&&C[T]===" ")T++;let _=C.slice(T).trimEnd();if(!_)throw Error(`Line ${B}: Empty node — expected a filename or directory name after the box-drawing prefix`);let ee=ne.repeat(S);h.push(ee+_),I++,r.set(I,B)}else if(/^[\s─━│┃└┗├┣]+$/.test(C))continue;else if(F.test(C))h.push(a),I++,r.set(I,B);else if(/^\s+/.test(C))throw Error(`Line ${B}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);else h.push(a),I++,r.set(I,B)}return{text:h.join(`
3
- `),lineMap:r}}e(J,"preprocessBoxDrawing");var L=new vt(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),re=e(()=>{L.reset(),d()},"clear"),ie=e(()=>L.records.stack[0],"getRoot"),oe=e(()=>L.records.cnt,"getCount"),se=x.treeView,ae=e(()=>E(se,u().treeView),"getConfig"),ce=e((i,n,r,o,s,l)=>{while(i<=L.records.stack[L.records.stack.length-1].level)L.records.stack.pop();let h={id:L.records.cnt++,level:i,name:n,nodeType:r,icon:s,cssClass:o,description:l,children:[]};L.records.stack[L.records.stack.length-1].children.push(h),L.records.stack.push(h)},"addNode"),le={clear:re,addNode:ce,getRoot:ie,getCount:oe,getConfig:ae,getAccTitle:p,getAccDescription:g,getDiagramTitle:v,setAccDescription:m,setAccTitle:f,setDiagramTitle:b},H=le,de=e((i)=>{R(i,H);for(let n of i.nodes){let r=typeof n.indent==="number"?n.indent:0,o=n.name,s=o.endsWith("/");if(s)o=o.slice(0,-1);let l=s?"directory":"file",h=n.classAnnotation||void 0,I=n.iconAnnotation,c=I!==void 0?I||"none":void 0,a=n.descAnnotation||void 0,y=a?w(a,u()):void 0;H.addNode(r,o,l,h,c,y)}},"populate"),he={parse:e(async(i)=>{let{text:n,lineMap:r}=J(i);try{let o=await D("treeView",n);t.debug(o),de(o)}catch(o){if(r.size>0&&o instanceof Error)o.message=U(o.message,r);throw o}},"parse")},M={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function K(i,n){let r=n?.filenameIcons?.[i];if(r)return r;let o=i.lastIndexOf(".");if(o>0){let s=i.substring(o).toLowerCase(),l=n?.extensionIcons;return l?.[s]??l?.[s.slice(1)]}return}e(K,"detectIcon");function z(i,n){if(i.includes(":"))return i;if(i in M.icons||!n)return`${M.prefix}:${i}`;return`${n}:${i}`}e(z,"qualifyIcon");function X(i,n){if(i.icon==="none")return;if(i.icon)return z(i.icon,n.defaultIconPack);if(!n.showIcons)return;if(i.nodeType==="file"){let r=K(i.name,n);if(r==="none")return;if(r)return z(r,n.defaultIconPack)}return`${M.prefix}:${i.nodeType==="directory"?"folder":"file"}`}e(X,"getNodeIcon");Bt([{name:M.prefix,icons:M}]);var W=14,pe=4,fe=16,Q=e((i,n)=>`tv-icon-${i}-${n.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),ge=e(async(i,n,r,o)=>{let s=new Set,l=e((c)=>{let a=X(c,r);if(a)s.add(a);c.children.forEach(l)},"collect");if(l(n),s.size===0)return;let h=await Promise.all([...s].map(async(c)=>({icon:c,svg:await ke(c,{height:W,width:W})}))),I=i.append("defs");for(let{icon:c,svg:a}of h)I.append("g").attr("id",Q(o,c)).html(a)},"injectIconDefs"),ue=e((i,n,r,o,s,l)=>{let h=o.append("g"),I="treeView-node-label";if(r.nodeType==="directory")I+=" treeView-node-dir";if(r.cssClass)I+=` ${r.cssClass}`;let c=W+pe,a=X(r,s),y=a!==void 0;if(a)h.append("use").attr("xlink:href",`#${Q(l,a)}`).attr("x",i+s.paddingX).attr("y",n+s.paddingY).attr("class","treeView-node-icon");let B=h.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",I),{height:C,width:N}=B.node().getBBox(),V=C+s.paddingY*2,S=i+s.paddingX+(y?c:0);B.attr("x",S),B.attr("y",n+V/2);let T=S+N,_=N+s.paddingX*2+(y?c:0);if(r.BBox={x:i,y:n,width:_,height:V},r.cssClass?.split(/\s+/).includes("highlight"))h.insert("rect",":first-child").attr("x",i).attr("y",n+1).attr("width",0).attr("height",V-2).attr("rx",3).attr("class","treeView-highlight-bg");return{node:r,nodeGroup:h,labelRightEdge:T,centerY:n+V/2}},"positionLabel"),P=e((i,n,r,o,s,l)=>i.append("line").attr("x1",n).attr("y1",r).attr("x2",o).attr("y2",s).attr("stroke-width",l).attr("class","treeView-node-line"),"positionLine"),me=e((i,n,r,o)=>{let s=0,l=0,h=[],I=e((y,B,C,N)=>{let V=N*(C.rowIndent+C.paddingX),S=ue(V,s,B,y,C,o);h.push(S);let{height:T,width:_}=B.BBox;P(y,V-C.rowIndent,s+T/2,V,s+T/2,C.lineThickness),l=Math.max(l,V+_),s+=T},"drawNode"),c=e((y,B=0)=>{I(i,y,r,B),y.children.forEach((S)=>{c(S,B+1)});let{x:C,y:N,height:V}=y.BBox;if(y.children.length){let{y:S,height:T}=y.children[y.children.length-1].BBox;P(i,C+r.paddingX,N+V,C+r.paddingX,S+T/2+r.lineThickness/2,r.lineThickness)}},"processNode");c(n);let a=h.filter((y)=>y.node.description);if(a.length>0){let B=Math.max(...h.map((C)=>C.labelRightEdge))+fe;for(let C of a){let V=C.nodeGroup.append("text").text(C.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",B).attr("y",C.centerY).node().getBBox();l=Math.max(l,B+V.width+r.paddingX)}}for(let y of h)if(y.node.cssClass?.split(/\s+/).includes("highlight")){let B=y.nodeGroup.select(".treeView-highlight-bg");if(!B.empty()){let C=l-y.node.BBox.x+8;B.attr("width",C),l=Math.max(l,y.node.BBox.x+C+2)}}return{totalHeight:s,totalWidth:l}},"drawTree"),we=e(async(i,n,r,o)=>{t.debug(`Rendering treeView diagram
4
- `+i);let s=o.db,l=s.getRoot(),h=s.getConfig(),I=A(n);await ge(I,l,h,n);let c=I.append("g");c.attr("class","tree-view");let{totalHeight:a,totalWidth:y}=me(c,l,h,n);I.attr("viewBox",`-${h.lineThickness/2} 0 ${y} ${a}`),k(I,a,y,h.useMaxWidth)},"draw"),xe={draw:we},ve=xe,be={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ie=e(({treeView:i})=>{let{labelFontSize:n,labelColor:r,lineColor:o,iconColor:s,descriptionColor:l,highlightBg:h,highlightStroke:I}=E(be,i);return`
1
+ import{vt}from"./index-8rjes9r6.js";import{R}from"./index-5n03dmb9.js";import{e,t,x,u,w,T,d,f,p,m,g,b,v,A,E,Bt,Te}from"./index-nwsya6dj.js";import"./index-v119nznk.js";import{D}from"./index-zx0j3a2z.js";var F=/[─━│┃└┗├┣]/,j=/[└┗├┣]/,te=/[─━]/,O=/^[\s│┃]+$/,G=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Y=/^\s*%%/,ne=" ";function Z(i){return i.some((n)=>F.test(n))}e(Z,"isBoxDrawingFormat");function q(i){for(let n of i){let r=j.exec(n);if(r?.index&&r.index>0)return r.index}return 4}e(q,"inferSegmentWidth");function U(i,n){return i.replace(/\bline\s+(\d+)\b/gi,(r,o)=>{let s=parseInt(o,10),l=n.get(s);return l?`line ${l}`:r})}e(U,"remapErrorLines");function J(i){let n=i.split(`
2
+ `),r=new Map,o=-1;for(let[c,a]of n.entries())if(a.trim()==="treeView-beta"){o=c;break}if(o===-1)return{text:i,lineMap:r};let s=[];for(let c=o+1;c<n.length;c++){let a=n[c];if(a.trim()===""||Y.test(a)||G.test(a))continue;if(O.test(a))continue;s.push(a.replace(/\t/g," "))}if(!Z(s))return{text:i,lineMap:r};let l=q(s),h=[],I=0;for(let c=0;c<=o;c++)h.push(n[c]),I++,r.set(I,c+1);for(let c=o+1;c<n.length;c++){let a=n[c],y=a.trim(),B=c+1;if(y===""){h.push(a),I++,r.set(I,B);continue}if(Y.test(a)){h.push(a),I++,r.set(I,B);continue}if(G.test(a)){h.push(a),I++,r.set(I,B);continue}if(O.test(a))continue;let C=a.replace(/\t/g," "),N=j.exec(C);if(N?.index!==void 0){let V=N.index,S=Math.round(V/l)+1,k=V+1;while(k<C.length&&te.test(C[k]))k++;while(k<C.length&&C[k]===" ")k++;let _=C.slice(k).trimEnd();if(!_)throw Error(`Line ${B}: Empty node — expected a filename or directory name after the box-drawing prefix`);let ee=ne.repeat(S);h.push(ee+_),I++,r.set(I,B)}else if(/^[\s─━│┃└┗├┣]+$/.test(C))continue;else if(F.test(C))h.push(a),I++,r.set(I,B);else if(/^\s+/.test(C))throw Error(`Line ${B}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);else h.push(a),I++,r.set(I,B)}return{text:h.join(`
3
+ `),lineMap:r}}e(J,"preprocessBoxDrawing");var L=new vt(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),re=e(()=>{L.reset(),d()},"clear"),ie=e(()=>L.records.stack[0],"getRoot"),oe=e(()=>L.records.cnt,"getCount"),se=x.treeView,ae=e(()=>E(se,u().treeView),"getConfig"),ce=e((i,n,r,o,s,l)=>{while(i<=L.records.stack[L.records.stack.length-1].level)L.records.stack.pop();let h={id:L.records.cnt++,level:i,name:n,nodeType:r,icon:s,cssClass:o,description:l,children:[]};L.records.stack[L.records.stack.length-1].children.push(h),L.records.stack.push(h)},"addNode"),le={clear:re,addNode:ce,getRoot:ie,getCount:oe,getConfig:ae,getAccTitle:p,getAccDescription:g,getDiagramTitle:v,setAccDescription:m,setAccTitle:f,setDiagramTitle:b},H=le,de=e((i)=>{R(i,H);for(let n of i.nodes){let r=typeof n.indent==="number"?n.indent:0,o=n.name,s=o.endsWith("/");if(s)o=o.slice(0,-1);let l=s?"directory":"file",h=n.classAnnotation||void 0,I=n.iconAnnotation,c=I!==void 0?I||"none":void 0,a=n.descAnnotation||void 0,y=a?w(a,u()):void 0;H.addNode(r,o,l,h,c,y)}},"populate"),he={parse:e(async(i)=>{let{text:n,lineMap:r}=J(i);try{let o=await D("treeView",n);t.debug(o),de(o)}catch(o){if(r.size>0&&o instanceof Error)o.message=U(o.message,r);throw o}},"parse")},M={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function K(i,n){let r=n?.filenameIcons?.[i];if(r)return r;let o=i.lastIndexOf(".");if(o>0){let s=i.substring(o).toLowerCase(),l=n?.extensionIcons;return l?.[s]??l?.[s.slice(1)]}return}e(K,"detectIcon");function z(i,n){if(i.includes(":"))return i;if(i in M.icons||!n)return`${M.prefix}:${i}`;return`${n}:${i}`}e(z,"qualifyIcon");function X(i,n){if(i.icon==="none")return;if(i.icon)return z(i.icon,n.defaultIconPack);if(!n.showIcons)return;if(i.nodeType==="file"){let r=K(i.name,n);if(r==="none")return;if(r)return z(r,n.defaultIconPack)}return`${M.prefix}:${i.nodeType==="directory"?"folder":"file"}`}e(X,"getNodeIcon");Bt([{name:M.prefix,icons:M}]);var W=14,pe=4,fe=16,Q=e((i,n)=>`tv-icon-${i}-${n.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),ge=e(async(i,n,r,o)=>{let s=new Set,l=e((c)=>{let a=X(c,r);if(a)s.add(a);c.children.forEach(l)},"collect");if(l(n),s.size===0)return;let h=await Promise.all([...s].map(async(c)=>({icon:c,svg:await Te(c,{height:W,width:W})}))),I=i.append("defs");for(let{icon:c,svg:a}of h)I.append("g").attr("id",Q(o,c)).html(a)},"injectIconDefs"),ue=e((i,n,r,o,s,l)=>{let h=o.append("g"),I="treeView-node-label";if(r.nodeType==="directory")I+=" treeView-node-dir";if(r.cssClass)I+=` ${r.cssClass}`;let c=W+pe,a=X(r,s),y=a!==void 0;if(a)h.append("use").attr("xlink:href",`#${Q(l,a)}`).attr("x",i+s.paddingX).attr("y",n+s.paddingY).attr("class","treeView-node-icon");let B=h.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",I),{height:C,width:N}=B.node().getBBox(),V=C+s.paddingY*2,S=i+s.paddingX+(y?c:0);B.attr("x",S),B.attr("y",n+V/2);let k=S+N,_=N+s.paddingX*2+(y?c:0);if(r.BBox={x:i,y:n,width:_,height:V},r.cssClass?.split(/\s+/).includes("highlight"))h.insert("rect",":first-child").attr("x",i).attr("y",n+1).attr("width",0).attr("height",V-2).attr("rx",3).attr("class","treeView-highlight-bg");return{node:r,nodeGroup:h,labelRightEdge:k,centerY:n+V/2}},"positionLabel"),P=e((i,n,r,o,s,l)=>i.append("line").attr("x1",n).attr("y1",r).attr("x2",o).attr("y2",s).attr("stroke-width",l).attr("class","treeView-node-line"),"positionLine"),me=e((i,n,r,o)=>{let s=0,l=0,h=[],I=e((y,B,C,N)=>{let V=N*(C.rowIndent+C.paddingX),S=ue(V,s,B,y,C,o);h.push(S);let{height:k,width:_}=B.BBox;P(y,V-C.rowIndent,s+k/2,V,s+k/2,C.lineThickness),l=Math.max(l,V+_),s+=k},"drawNode"),c=e((y,B=0)=>{I(i,y,r,B),y.children.forEach((S)=>{c(S,B+1)});let{x:C,y:N,height:V}=y.BBox;if(y.children.length){let{y:S,height:k}=y.children[y.children.length-1].BBox;P(i,C+r.paddingX,N+V,C+r.paddingX,S+k/2+r.lineThickness/2,r.lineThickness)}},"processNode");c(n);let a=h.filter((y)=>y.node.description);if(a.length>0){let B=Math.max(...h.map((C)=>C.labelRightEdge))+fe;for(let C of a){let V=C.nodeGroup.append("text").text(C.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",B).attr("y",C.centerY).node().getBBox();l=Math.max(l,B+V.width+r.paddingX)}}for(let y of h)if(y.node.cssClass?.split(/\s+/).includes("highlight")){let B=y.nodeGroup.select(".treeView-highlight-bg");if(!B.empty()){let C=l-y.node.BBox.x+8;B.attr("width",C),l=Math.max(l,y.node.BBox.x+C+2)}}return{totalHeight:s,totalWidth:l}},"drawTree"),we=e(async(i,n,r,o)=>{t.debug(`Rendering treeView diagram
4
+ `+i);let s=o.db,l=s.getRoot(),h=s.getConfig(),I=A(n);await ge(I,l,h,n);let c=I.append("g");c.attr("class","tree-view");let{totalHeight:a,totalWidth:y}=me(c,l,h,n);I.attr("viewBox",`-${h.lineThickness/2} 0 ${y} ${a}`),T(I,a,y,h.useMaxWidth)},"draw"),xe={draw:we},ve=xe,be={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ie=e(({treeView:i})=>{let{labelFontSize:n,labelColor:r,lineColor:o,iconColor:s,descriptionColor:l,highlightBg:h,highlightStroke:I}=E(be,i);return`
5
5
  .treeView-node-label {
6
6
  font-size: ${n};
7
7
  fill: ${r};