@usepagelet/runtime 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/v1/capabilities.md +59 -0
- package/dist/v1/chunks/architecture-7EHR7CIX-CDRXMAVQ.js +2 -0
- package/dist/v1/chunks/architecture-7EHR7CIX-CDRXMAVQ.js.map +7 -0
- package/dist/v1/chunks/architectureDiagram-3BPJPVTR-EYIVUOEK.js +37 -0
- package/dist/v1/chunks/architectureDiagram-3BPJPVTR-EYIVUOEK.js.map +7 -0
- package/dist/v1/chunks/blockDiagram-GPEHLZMM-P7MBAWVH.js +133 -0
- package/dist/v1/chunks/blockDiagram-GPEHLZMM-P7MBAWVH.js.map +7 -0
- package/dist/v1/chunks/c4Diagram-AAUBKEIU-2XSL5LGB.js +11 -0
- package/dist/v1/chunks/c4Diagram-AAUBKEIU-2XSL5LGB.js.map +7 -0
- package/dist/v1/chunks/chunk-2STBDRRH.js +2 -0
- package/dist/v1/chunks/chunk-2STBDRRH.js.map +7 -0
- package/dist/v1/chunks/chunk-6AA7JQNC.js +71 -0
- package/dist/v1/chunks/chunk-6AA7JQNC.js.map +7 -0
- package/dist/v1/chunks/chunk-72WSJX2P.js +2 -0
- package/dist/v1/chunks/chunk-72WSJX2P.js.map +7 -0
- package/dist/v1/chunks/chunk-AUV7QZZ7.js +2 -0
- package/dist/v1/chunks/chunk-AUV7QZZ7.js.map +7 -0
- package/dist/v1/chunks/chunk-AZFF2WJO.js +2 -0
- package/dist/v1/chunks/chunk-AZFF2WJO.js.map +7 -0
- package/dist/v1/chunks/chunk-C2IUOGBD.js +2 -0
- package/dist/v1/chunks/chunk-C2IUOGBD.js.map +7 -0
- package/dist/v1/chunks/chunk-DKQVSAO3.js +2 -0
- package/dist/v1/chunks/chunk-DKQVSAO3.js.map +7 -0
- package/dist/v1/chunks/chunk-DS52DG6H.js +2 -0
- package/dist/v1/chunks/chunk-DS52DG6H.js.map +7 -0
- package/dist/v1/chunks/chunk-DXEOG5W4.js +2 -0
- package/dist/v1/chunks/chunk-DXEOG5W4.js.map +7 -0
- package/dist/v1/chunks/chunk-EHSK6IMI.js +3 -0
- package/dist/v1/chunks/chunk-EHSK6IMI.js.map +7 -0
- package/dist/v1/chunks/chunk-FWZR474D.js +2 -0
- package/dist/v1/chunks/chunk-FWZR474D.js.map +7 -0
- package/dist/v1/chunks/chunk-FYLAOHYS.js +2 -0
- package/dist/v1/chunks/chunk-FYLAOHYS.js.map +7 -0
- package/dist/v1/chunks/chunk-G6W4FKMG.js +2 -0
- package/dist/v1/chunks/chunk-G6W4FKMG.js.map +7 -0
- package/dist/v1/chunks/chunk-HLP6UJDY.js +2 -0
- package/dist/v1/chunks/chunk-HLP6UJDY.js.map +7 -0
- package/dist/v1/chunks/chunk-IGLPGT7W.js +160 -0
- package/dist/v1/chunks/chunk-IGLPGT7W.js.map +7 -0
- package/dist/v1/chunks/chunk-IQVRW6XA.js +322 -0
- package/dist/v1/chunks/chunk-IQVRW6XA.js.map +7 -0
- package/dist/v1/chunks/chunk-IY5OUPDU.js +5 -0
- package/dist/v1/chunks/chunk-IY5OUPDU.js.map +7 -0
- package/dist/v1/chunks/chunk-JOJIMF7A.js +2 -0
- package/dist/v1/chunks/chunk-JOJIMF7A.js.map +7 -0
- package/dist/v1/chunks/chunk-NWD66TP4.js +2 -0
- package/dist/v1/chunks/chunk-NWD66TP4.js.map +7 -0
- package/dist/v1/chunks/chunk-PLQZIFSO.js +2 -0
- package/dist/v1/chunks/chunk-PLQZIFSO.js.map +7 -0
- package/dist/v1/chunks/chunk-PVPXGQIV.js +2 -0
- package/dist/v1/chunks/chunk-PVPXGQIV.js.map +7 -0
- package/dist/v1/chunks/chunk-QDJGX3SU.js +16 -0
- package/dist/v1/chunks/chunk-QDJGX3SU.js.map +7 -0
- package/dist/v1/chunks/chunk-QSGUWHXF.js +2 -0
- package/dist/v1/chunks/chunk-QSGUWHXF.js.map +7 -0
- package/dist/v1/chunks/chunk-RCIRWMC7.js +2 -0
- package/dist/v1/chunks/chunk-RCIRWMC7.js.map +7 -0
- package/dist/v1/chunks/chunk-S4ACHXBI.js +2 -0
- package/dist/v1/chunks/chunk-S4ACHXBI.js.map +7 -0
- package/dist/v1/chunks/chunk-SA4K3XYV.js +2 -0
- package/dist/v1/chunks/chunk-SA4K3XYV.js.map +7 -0
- package/dist/v1/chunks/chunk-SAENYLYK.js +232 -0
- package/dist/v1/chunks/chunk-SAENYLYK.js.map +7 -0
- package/dist/v1/chunks/chunk-SN6BTAM3.js +4 -0
- package/dist/v1/chunks/chunk-SN6BTAM3.js.map +7 -0
- package/dist/v1/chunks/chunk-SWJRRCAF.js +2 -0
- package/dist/v1/chunks/chunk-SWJRRCAF.js.map +7 -0
- package/dist/v1/chunks/chunk-TGL5CWDU.js +63 -0
- package/dist/v1/chunks/chunk-TGL5CWDU.js.map +7 -0
- package/dist/v1/chunks/chunk-TVSQ2OZ6.js +11 -0
- package/dist/v1/chunks/chunk-TVSQ2OZ6.js.map +7 -0
- package/dist/v1/chunks/chunk-URGT6V7R.js +2 -0
- package/dist/v1/chunks/chunk-URGT6V7R.js.map +7 -0
- package/dist/v1/chunks/chunk-WBEUYPCI.js +123 -0
- package/dist/v1/chunks/chunk-WBEUYPCI.js.map +7 -0
- package/dist/v1/chunks/chunk-WEZ3ELJO.js +2 -0
- package/dist/v1/chunks/chunk-WEZ3ELJO.js.map +7 -0
- package/dist/v1/chunks/chunk-WIIGSS4X.js +2 -0
- package/dist/v1/chunks/chunk-WIIGSS4X.js.map +7 -0
- package/dist/v1/chunks/chunk-XUJKMBZ5.js +2 -0
- package/dist/v1/chunks/chunk-XUJKMBZ5.js.map +7 -0
- package/dist/v1/chunks/chunk-YC75LZ32.js +33 -0
- package/dist/v1/chunks/chunk-YC75LZ32.js.map +7 -0
- package/dist/v1/chunks/chunk-YK2CHHQT.js +207 -0
- package/dist/v1/chunks/chunk-YK2CHHQT.js.map +7 -0
- package/dist/v1/chunks/chunk-YYWGGXI6.js +2 -0
- package/dist/v1/chunks/chunk-YYWGGXI6.js.map +7 -0
- package/dist/v1/chunks/chunk-ZY7EQCMR.js +4 -0
- package/dist/v1/chunks/chunk-ZY7EQCMR.js.map +7 -0
- package/dist/v1/chunks/classDiagram-4FO5ZUOK-4VU3VATX.js +2 -0
- package/dist/v1/chunks/classDiagram-4FO5ZUOK-4VU3VATX.js.map +7 -0
- package/dist/v1/chunks/classDiagram-v2-Q7XG4LA2-QIBN3KO6.js +2 -0
- package/dist/v1/chunks/classDiagram-v2-Q7XG4LA2-QIBN3KO6.js.map +7 -0
- package/dist/v1/chunks/cose-bilkent-S5V4N54A-MHLDSCZY.js +2 -0
- package/dist/v1/chunks/cose-bilkent-S5V4N54A-MHLDSCZY.js.map +7 -0
- package/dist/v1/chunks/dagre-BM42HDAG-U3ECKIMS.js +5 -0
- package/dist/v1/chunks/dagre-BM42HDAG-U3ECKIMS.js.map +7 -0
- package/dist/v1/chunks/diagram-2AECGRRQ-BNRGNWOM.js +44 -0
- package/dist/v1/chunks/diagram-2AECGRRQ-BNRGNWOM.js.map +7 -0
- package/dist/v1/chunks/diagram-5GNKFQAL-CPWZIJ4M.js +11 -0
- package/dist/v1/chunks/diagram-5GNKFQAL-CPWZIJ4M.js.map +7 -0
- package/dist/v1/chunks/diagram-KO2AKTUF-7CDCIBL3.js +4 -0
- package/dist/v1/chunks/diagram-KO2AKTUF-7CDCIBL3.js.map +7 -0
- package/dist/v1/chunks/diagram-LMA3HP47-LPHFNXWX.js +25 -0
- package/dist/v1/chunks/diagram-LMA3HP47-LPHFNXWX.js.map +7 -0
- package/dist/v1/chunks/diagram-OG6HWLK6-FWJ2MCGI.js +25 -0
- package/dist/v1/chunks/diagram-OG6HWLK6-FWJ2MCGI.js.map +7 -0
- package/dist/v1/chunks/erDiagram-TEJ5UH35-OX62GPYU.js +86 -0
- package/dist/v1/chunks/erDiagram-TEJ5UH35-OX62GPYU.js.map +7 -0
- package/dist/v1/chunks/eventmodeling-FCH6USID-NRRIBZEB.js +2 -0
- package/dist/v1/chunks/eventmodeling-FCH6USID-NRRIBZEB.js.map +7 -0
- package/dist/v1/chunks/flowDiagram-I6XJVG4X-I4ULL6MS.js +163 -0
- package/dist/v1/chunks/flowDiagram-I6XJVG4X-I4ULL6MS.js.map +7 -0
- package/dist/v1/chunks/ganttDiagram-6RSMTGT7-TIDOVKXT.js +293 -0
- package/dist/v1/chunks/ganttDiagram-6RSMTGT7-TIDOVKXT.js.map +7 -0
- package/dist/v1/chunks/gitGraph-WXDBUCRP-4LEEA2GI.js +2 -0
- package/dist/v1/chunks/gitGraph-WXDBUCRP-4LEEA2GI.js.map +7 -0
- package/dist/v1/chunks/gitGraphDiagram-PVQCEYII-BPEBW2KG.js +107 -0
- package/dist/v1/chunks/gitGraphDiagram-PVQCEYII-BPEBW2KG.js.map +7 -0
- package/dist/v1/chunks/info-J43DQDTF-EI2RS372.js +2 -0
- package/dist/v1/chunks/info-J43DQDTF-EI2RS372.js.map +7 -0
- package/dist/v1/chunks/infoDiagram-5YYISTIA-5GFVQYI7.js +3 -0
- package/dist/v1/chunks/infoDiagram-5YYISTIA-5GFVQYI7.js.map +7 -0
- package/dist/v1/chunks/ishikawaDiagram-YF4QCWOH-AZ7PAHIN.js +71 -0
- package/dist/v1/chunks/ishikawaDiagram-YF4QCWOH-AZ7PAHIN.js.map +7 -0
- package/dist/v1/chunks/journeyDiagram-JHISSGLW-B4ZN6VTS.js +140 -0
- package/dist/v1/chunks/journeyDiagram-JHISSGLW-B4ZN6VTS.js.map +7 -0
- package/dist/v1/chunks/kanban-definition-UN3LZRKU-5THRXHJP.js +90 -0
- package/dist/v1/chunks/kanban-definition-UN3LZRKU-5THRXHJP.js.map +7 -0
- package/dist/v1/chunks/katex-CLI7E3QC.js +258 -0
- package/dist/v1/chunks/katex-CLI7E3QC.js.map +7 -0
- package/dist/v1/chunks/mindmap-definition-RKZ34NQL-E57QDEMN.js +97 -0
- package/dist/v1/chunks/mindmap-definition-RKZ34NQL-E57QDEMN.js.map +7 -0
- package/dist/v1/chunks/packet-YPE3B663-PKWGZRBL.js +2 -0
- package/dist/v1/chunks/packet-YPE3B663-PKWGZRBL.js.map +7 -0
- package/dist/v1/chunks/pie-LRSECV5Y-QSTOXR4H.js +2 -0
- package/dist/v1/chunks/pie-LRSECV5Y-QSTOXR4H.js.map +7 -0
- package/dist/v1/chunks/pieDiagram-4H26LBE5-CZULUIHM.js +31 -0
- package/dist/v1/chunks/pieDiagram-4H26LBE5-CZULUIHM.js.map +7 -0
- package/dist/v1/chunks/quadrantDiagram-W4KKPZXB-WRXQ2LCP.js +8 -0
- package/dist/v1/chunks/quadrantDiagram-W4KKPZXB-WRXQ2LCP.js.map +7 -0
- package/dist/v1/chunks/radar-GUYGQ44K-UJHF7VJA.js +2 -0
- package/dist/v1/chunks/radar-GUYGQ44K-UJHF7VJA.js.map +7 -0
- package/dist/v1/chunks/requirementDiagram-4Y6WPE33-LUKBHY3G.js +85 -0
- package/dist/v1/chunks/requirementDiagram-4Y6WPE33-LUKBHY3G.js.map +7 -0
- package/dist/v1/chunks/sankeyDiagram-5OEKKPKP-IHGIKQ7Q.js +41 -0
- package/dist/v1/chunks/sankeyDiagram-5OEKKPKP-IHGIKQ7Q.js.map +7 -0
- package/dist/v1/chunks/sequenceDiagram-3UESZ5HK-AZIJM7V2.js +163 -0
- package/dist/v1/chunks/sequenceDiagram-3UESZ5HK-AZIJM7V2.js.map +7 -0
- package/dist/v1/chunks/stateDiagram-AJRCARHV-7TL53ICK.js +2 -0
- package/dist/v1/chunks/stateDiagram-AJRCARHV-7TL53ICK.js.map +7 -0
- package/dist/v1/chunks/stateDiagram-v2-BHNVJYJU-TJ245A24.js +2 -0
- package/dist/v1/chunks/stateDiagram-v2-BHNVJYJU-TJ245A24.js.map +7 -0
- package/dist/v1/chunks/timeline-definition-PNZ67QCA-C5FF5CVI.js +121 -0
- package/dist/v1/chunks/timeline-definition-PNZ67QCA-C5FF5CVI.js.map +7 -0
- package/dist/v1/chunks/treeView-BLDUP644-2MCPJRE2.js +2 -0
- package/dist/v1/chunks/treeView-BLDUP644-2MCPJRE2.js.map +7 -0
- package/dist/v1/chunks/treemap-LRROVOQU-WSVRI32O.js +2 -0
- package/dist/v1/chunks/treemap-LRROVOQU-WSVRI32O.js.map +7 -0
- package/dist/v1/chunks/vennDiagram-CIIHVFJN-NQU7FBQX.js +35 -0
- package/dist/v1/chunks/vennDiagram-CIIHVFJN-NQU7FBQX.js.map +7 -0
- package/dist/v1/chunks/wardley-L42UT6IY-GONRRIFG.js +2 -0
- package/dist/v1/chunks/wardley-L42UT6IY-GONRRIFG.js.map +7 -0
- package/dist/v1/chunks/wardleyDiagram-YWT4CUSO-KNM7EB5A.js +79 -0
- package/dist/v1/chunks/wardleyDiagram-YWT4CUSO-KNM7EB5A.js.map +7 -0
- package/dist/v1/chunks/xychartDiagram-2RQKCTM6-CMGOBHPC.js +8 -0
- package/dist/v1/chunks/xychartDiagram-2RQKCTM6-CMGOBHPC.js.map +7 -0
- package/dist/v1/modules/charts.js +4 -0
- package/dist/v1/modules/charts.js.map +7 -0
- package/dist/v1/modules/code.js +26 -0
- package/dist/v1/modules/code.js.map +7 -0
- package/dist/v1/modules/markdown.js +65 -0
- package/dist/v1/modules/markdown.js.map +7 -0
- package/dist/v1/modules/math.js +258 -0
- package/dist/v1/modules/math.js.map +7 -0
- package/dist/v1/modules/mermaid.js +9 -0
- package/dist/v1/modules/mermaid.js.map +7 -0
- package/dist/v1/modules/png.js +3 -0
- package/dist/v1/modules/png.js.map +7 -0
- package/dist/v1/pagelet.js +128 -0
- package/dist/v1/pagelet.js.map +7 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @usepagelet/runtime
|
|
2
|
+
|
|
3
|
+
The **Pagelet runtime** — one tag that turns plain HTML into a polished, self-contained
|
|
4
|
+
document. Add it to any page and it renders Markdown, Mermaid diagrams, KaTeX math, and
|
|
5
|
+
Chart.js charts, applies a (shadcn-style) theme, and mounts a standard toolbar
|
|
6
|
+
(theme / print / PNG / copy-as-Markdown). Heavy libraries are lazy-loaded — only what a page
|
|
7
|
+
uses is fetched.
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<script src="https://cdn.pagelet.link/v1/pagelet.js" defer></script>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Served from `cdn.pagelet.link` (primary) and mirrored on jsDelivr:
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<script src="https://cdn.jsdelivr.net/npm/@usepagelet/runtime@0/dist/v1/pagelet.js" defer></script>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- **Conventions & capabilities:** <https://cdn.pagelet.link/v1/capabilities.md>
|
|
20
|
+
- **Project:** <https://pagelet.link> · <https://github.com/jontybrook/pagelet>
|
|
21
|
+
- **Licence:** Apache-2.0
|
|
22
|
+
|
|
23
|
+
This package ships prebuilt static assets (`dist/v1/`) intended to be loaded as a script in
|
|
24
|
+
the browser, not imported as a Node module.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema: 1
|
|
3
|
+
runtime_version: "0.1.0"
|
|
4
|
+
base_url: "https://cdn.pagelet.link/v1/"
|
|
5
|
+
capabilities: [markdown, mermaid, math, code, charts, theme, toolbar, toc]
|
|
6
|
+
status: alpha
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Pagelet runtime — v1 capabilities (alpha)
|
|
10
|
+
|
|
11
|
+
> Served alongside the runtime. To learn what it can do right now, fetch this file and follow it. This is the authoritative menu (D15); the installed skill only teaches the protocol. Each capability is **lazy-loaded** — only the modules a page uses are fetched.
|
|
12
|
+
|
|
13
|
+
## The tag
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<script src="https://cdn.pagelet.link/v1/pagelet.js" defer></script>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Add it to any HTML. The ~12 KB loader scans the DOM, lazy-loads the needed modules, enhances in place, and removes the offline banner on success. Self-host by pointing the tag at your own copy; pin a version with `/v1.x.y/`.
|
|
20
|
+
|
|
21
|
+
## markdown — *stable*
|
|
22
|
+
|
|
23
|
+
`<script type="text/markdown" data-pagelet="markdown">…</script>` → rendered (marked + sanitised) into `.pagelet-prose`. Source retained (hidden) for round-trip export. Indentation is auto-stripped. Fenced ` ```mermaid ` blocks become diagrams; ` ```lang ` blocks get highlighting; `$$…$$` / `\(…\)` / `\[…\]` get math.
|
|
24
|
+
|
|
25
|
+
## mermaid — *stable*
|
|
26
|
+
|
|
27
|
+
A ` ```mermaid ` fenced block (inside markdown) or `<pre class="mermaid">…</pre>` → an SVG diagram with **pan / zoom / fullscreen**.
|
|
28
|
+
|
|
29
|
+
## math — *stable*
|
|
30
|
+
|
|
31
|
+
KaTeX over the prose. Delimiters: `$$…$$` and `\[…\]` (display), `\(…\)` (inline). `$…$` inline is **off** by default (currency). Fonts load from a pinned CDN.
|
|
32
|
+
|
|
33
|
+
## code — *stable*
|
|
34
|
+
|
|
35
|
+
` ```lang ` fenced blocks (or `<pre><code class="language-x">`) → syntax highlighting + a copy button. Theme-aware.
|
|
36
|
+
|
|
37
|
+
## charts — *stable*
|
|
38
|
+
|
|
39
|
+
`<script type="application/json" data-pagelet="chart">{ Chart.js config }</script>` → a responsive `<canvas>`, themed to the page.
|
|
40
|
+
|
|
41
|
+
## theme — *stable*
|
|
42
|
+
|
|
43
|
+
`<script type="application/json" data-pagelet="theme">{ "colors": { "primary": "#…" }, "radius": "…" }</script>` → compiled to `:root` / `[data-theme="dark"]` with shadcn variable names. `<html data-theme="dark">` forces dark.
|
|
44
|
+
|
|
45
|
+
## toolbar & toc — *stable*
|
|
46
|
+
|
|
47
|
+
Auto-mounted: a floating toolbar (theme toggle, print/PDF, PNG export, copy-as-Markdown round-trip), a scroll-progress bar, and — for documents with ≥3 headings — a sticky table of contents with scroll-spy. Disable the toolbar with `<body data-pagelet-toolbar="off">`.
|
|
48
|
+
|
|
49
|
+
## offline banner
|
|
50
|
+
|
|
51
|
+
Include this so a no-network open degrades gracefully; the runtime removes it on boot:
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<div id="pagelet-offline">⏳ This pagelet needs an internet connection to render its interactive parts.</div>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Coming next
|
|
58
|
+
|
|
59
|
+
Cloud publish (short `pagelet.link` URLs), cloud PDF, accounts, and private artifacts — feature-detected, so they light up here when shipped with no reinstall.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{a as Qe}from"./chunk-DS52DG6H.js";import{a as Je}from"./chunk-ZY7EQCMR.js";import"./chunk-72WSJX2P.js";import"./chunk-WIIGSS4X.js";import"./chunk-FWZR474D.js";import"./chunk-C2IUOGBD.js";import"./chunk-YYWGGXI6.js";import"./chunk-SWJRRCAF.js";import{a as me}from"./chunk-IQVRW6XA.js";import"./chunk-WEZ3ELJO.js";import"./chunk-NWD66TP4.js";import"./chunk-PLQZIFSO.js";import"./chunk-QSGUWHXF.js";import"./chunk-IGLPGT7W.js";import{a as Be}from"./chunk-DXEOG5W4.js";import{b as Ze,c as qe,d as le,f as fe}from"./chunk-6AA7JQNC.js";import{o as $e,s as ke}from"./chunk-EHSK6IMI.js";import"./chunk-SA4K3XYV.js";import{A as Fe,G as be,O as Pe,S as Ge,T as Ue,U as Ye,V as Xe,W as He,X as We,Y as Ve,Z as he,q as Se}from"./chunk-WBEUYPCI.js";import{b as ct,d as Ee,j as ze}from"./chunk-PVPXGQIV.js";import"./chunk-SN6BTAM3.js";import{a as ye,b as dr}from"./chunk-URGT6V7R.js";var Ne=ye((ie,Te)=>{(function(A,T){typeof ie=="object"&&typeof Te=="object"?Te.exports=T():typeof define=="function"&&define.amd?define([],T):typeof ie=="object"?ie.layoutBase=T():A.layoutBase=T()})(ie,function(){return(function(C){var A={};function T(u){if(A[u])return A[u].exports;var l=A[u]={i:u,l:!1,exports:{}};return C[u].call(l.exports,l,l.exports,T),l.l=!0,l.exports}return T.m=C,T.c=A,T.i=function(u){return u},T.d=function(u,l,n){T.o(u,l)||Object.defineProperty(u,l,{configurable:!1,enumerable:!0,get:n})},T.n=function(u){var l=u&&u.__esModule?function(){return u.default}:function(){return u};return T.d(l,"a",l),l},T.o=function(u,l){return Object.prototype.hasOwnProperty.call(u,l)},T.p="",T(T.s=28)})([(function(C,A,T){"use strict";function u(){}u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,C.exports=u}),(function(C,A,T){"use strict";var u=T(2),l=T(8),n=T(9);function i(f,t,c){u.call(this,c),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=c,this.bendpoints=[],this.source=f,this.target=t}i.prototype=Object.create(u.prototype);for(var a in u)i[a]=u[a];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(f,t){for(var c=this.getOtherEnd(f),e=t.getGraphManager().getRoot();;){if(c.getOwner()==t)return c;if(c.getOwner()==e)break;c=c.getOwner().getParent()}return null},i.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=i}),(function(C,A,T){"use strict";function u(l){this.vGraphObject=l}C.exports=u}),(function(C,A,T){"use strict";var u=T(2),l=T(10),n=T(13),i=T(0),a=T(16),f=T(5);function t(e,r,h,g){h==null&&g==null&&(g=r),u.call(this,g),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=e,h!=null&&r!=null?this.rect=new n(r.x,r.y,h.width,h.height):this.rect=new n}t.prototype=Object.create(u.prototype);for(var c in u)t[c]=u[c];t.prototype.getEdges=function(){return this.edges},t.prototype.getChild=function(){return this.child},t.prototype.getOwner=function(){return this.owner},t.prototype.getWidth=function(){return this.rect.width},t.prototype.setWidth=function(e){this.rect.width=e},t.prototype.getHeight=function(){return this.rect.height},t.prototype.setHeight=function(e){this.rect.height=e},t.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},t.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},t.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},t.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},t.prototype.getRect=function(){return this.rect},t.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},t.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},t.prototype.setRect=function(e,r){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=r.width,this.rect.height=r.height},t.prototype.setCenter=function(e,r){this.rect.x=e-this.rect.width/2,this.rect.y=r-this.rect.height/2},t.prototype.setLocation=function(e,r){this.rect.x=e,this.rect.y=r},t.prototype.moveBy=function(e,r){this.rect.x+=e,this.rect.y+=r},t.prototype.getEdgeListToNode=function(e){var r=[],h,g=this;return g.edges.forEach(function(o){if(o.target==e){if(o.source!=g)throw"Incorrect edge source!";r.push(o)}}),r},t.prototype.getEdgesBetween=function(e){var r=[],h,g=this;return g.edges.forEach(function(o){if(!(o.source==g||o.target==g))throw"Incorrect edge source and/or target";(o.target==e||o.source==e)&&r.push(o)}),r},t.prototype.getNeighborsList=function(){var e=new Set,r=this;return r.edges.forEach(function(h){if(h.source==r)e.add(h.target);else{if(h.target!=r)throw"Incorrect incidency!";e.add(h.source)}}),e},t.prototype.withChildren=function(){var e=new Set,r,h;if(e.add(this),this.child!=null)for(var g=this.child.getNodes(),o=0;o<g.length;o++)r=g[o],h=r.withChildren(),h.forEach(function(N){e.add(N)});return e},t.prototype.getNoOfChildren=function(){var e=0,r;if(this.child==null)e=1;else for(var h=this.child.getNodes(),g=0;g<h.length;g++)r=h[g],e+=r.getNoOfChildren();return e==0&&(e=1),e},t.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},t.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},t.prototype.scatter=function(){var e,r,h=-i.INITIAL_WORLD_BOUNDARY,g=i.INITIAL_WORLD_BOUNDARY;e=i.WORLD_CENTER_X+a.nextDouble()*(g-h)+h;var o=-i.INITIAL_WORLD_BOUNDARY,N=i.INITIAL_WORLD_BOUNDARY;r=i.WORLD_CENTER_Y+a.nextDouble()*(N-o)+o,this.rect.x=e,this.rect.y=r},t.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var e=this.getChild();if(e.updateBounds(!0),this.rect.x=e.getLeft(),this.rect.y=e.getTop(),this.setWidth(e.getRight()-e.getLeft()),this.setHeight(e.getBottom()-e.getTop()),i.NODE_DIMENSIONS_INCLUDE_LABELS){var r=e.getRight()-e.getLeft(),h=e.getBottom()-e.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(r+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>r?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(h+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>h?(this.rect.y-=(this.labelHeight-h)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(h+this.labelHeight))}}},t.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},t.prototype.transform=function(e){var r=this.rect.x;r>i.WORLD_BOUNDARY?r=i.WORLD_BOUNDARY:r<-i.WORLD_BOUNDARY&&(r=-i.WORLD_BOUNDARY);var h=this.rect.y;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var g=new f(r,h),o=e.inverseTransformPoint(g);this.setLocation(o.x,o.y)},t.prototype.getLeft=function(){return this.rect.x},t.prototype.getRight=function(){return this.rect.x+this.rect.width},t.prototype.getTop=function(){return this.rect.y},t.prototype.getBottom=function(){return this.rect.y+this.rect.height},t.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},C.exports=t}),(function(C,A,T){"use strict";var u=T(0);function l(){}for(var n in u)l[n]=u[n];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,C.exports=l}),(function(C,A,T){"use strict";function u(l,n){l==null&&n==null?(this.x=0,this.y=0):(this.x=l,this.y=n)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(l){this.x=l},u.prototype.setY=function(l){this.y=l},u.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},C.exports=u}),(function(C,A,T){"use strict";var u=T(2),l=T(10),n=T(0),i=T(7),a=T(3),f=T(1),t=T(13),c=T(12),e=T(11);function r(g,o,N){u.call(this,N),this.estimatedSize=l.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,o!=null&&o instanceof i?this.graphManager=o:o!=null&&o instanceof Layout&&(this.graphManager=o.graphManager)}r.prototype=Object.create(u.prototype);for(var h in u)r[h]=u[h];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(g,o,N){if(o==null&&N==null){var y=g;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(y)>-1)throw"Node already in graph!";return y.owner=this,this.getNodes().push(y),y}else{var p=g;if(!(this.getNodes().indexOf(o)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(o.owner==N.owner&&o.owner==this))throw"Both owners must be this graph!";return o.owner!=N.owner?null:(p.source=o,p.target=N,p.isInterGraph=!1,this.getEdges().push(p),o.edges.push(p),N!=o&&N.edges.push(p),p)}},r.prototype.remove=function(g){var o=g;if(g instanceof a){if(o==null)throw"Node is null!";if(!(o.owner!=null&&o.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var N=o.edges.slice(),y,p=N.length,L=0;L<p;L++)y=N[L],y.isInterGraph?this.graphManager.remove(y):y.source.owner.remove(y);var R=this.nodes.indexOf(o);if(R==-1)throw"Node not in owner node list!";this.nodes.splice(R,1)}else if(g instanceof f){var y=g;if(y==null)throw"Edge is null!";if(!(y.source!=null&&y.target!=null))throw"Source and/or target is null!";if(!(y.source.owner!=null&&y.target.owner!=null&&y.source.owner==this&&y.target.owner==this))throw"Source and/or target owner is invalid!";var w=y.source.edges.indexOf(y),b=y.target.edges.indexOf(y);if(!(w>-1&&b>-1))throw"Source and/or target doesn't know this edge!";y.source.edges.splice(w,1),y.target!=y.source&&y.target.edges.splice(b,1);var R=y.source.owner.getEdges().indexOf(y);if(R==-1)throw"Not in owner's edge list!";y.source.owner.getEdges().splice(R,1)}},r.prototype.updateLeftTop=function(){for(var g=l.MAX_VALUE,o=l.MAX_VALUE,N,y,p,L=this.getNodes(),R=L.length,w=0;w<R;w++){var b=L[w];N=b.getTop(),y=b.getLeft(),g>N&&(g=N),o>y&&(o=y)}return g==l.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?p=L[0].getParent().paddingLeft:p=this.margin,this.left=o-p,this.top=g-p,new c(this.left,this.top))},r.prototype.updateBounds=function(g){for(var o=l.MAX_VALUE,N=-l.MAX_VALUE,y=l.MAX_VALUE,p=-l.MAX_VALUE,L,R,w,b,W,G=this.nodes,J=G.length,x=0;x<J;x++){var z=G[x];g&&z.child!=null&&z.updateBounds(),L=z.getLeft(),R=z.getRight(),w=z.getTop(),b=z.getBottom(),o>L&&(o=L),N<R&&(N=R),y>w&&(y=w),p<b&&(p=b)}var s=new t(o,y,N-o,p-y);o==l.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),G[0].getParent().paddingLeft!=null?W=G[0].getParent().paddingLeft:W=this.margin,this.left=s.x-W,this.right=s.x+s.width+W,this.top=s.y-W,this.bottom=s.y+s.height+W},r.calculateBounds=function(g){for(var o=l.MAX_VALUE,N=-l.MAX_VALUE,y=l.MAX_VALUE,p=-l.MAX_VALUE,L,R,w,b,W=g.length,G=0;G<W;G++){var J=g[G];L=J.getLeft(),R=J.getRight(),w=J.getTop(),b=J.getBottom(),o>L&&(o=L),N<R&&(N=R),y>w&&(y=w),p<b&&(p=b)}var x=new t(o,y,N-o,p-y);return x},r.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){for(var g=0,o=this.nodes,N=o.length,y=0;y<N;y++){var p=o[y];g+=p.calcEstimatedSize()}return g==0?this.estimatedSize=n.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=g/Math.sqrt(this.nodes.length),this.estimatedSize},r.prototype.updateConnected=function(){var g=this;if(this.nodes.length==0){this.isConnected=!0;return}var o=new e,N=new Set,y=this.nodes[0],p,L,R=y.withChildren();for(R.forEach(function(x){o.push(x),N.add(x)});o.length!==0;){y=o.shift(),p=y.getEdges();for(var w=p.length,b=0;b<w;b++){var W=p[b];if(L=W.getOtherEndInGraph(y,this),L!=null&&!N.has(L)){var G=L.withChildren();G.forEach(function(x){o.push(x),N.add(x)})}}}if(this.isConnected=!1,N.size>=this.nodes.length){var J=0;N.forEach(function(x){x.owner==g&&J++}),J==this.nodes.length&&(this.isConnected=!0)}},C.exports=r}),(function(C,A,T){"use strict";var u,l=T(1);function n(i){u=T(6),this.layout=i,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var i=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(i,a);return this.setRootGraph(f),this.rootGraph},n.prototype.add=function(i,a,f,t,c){if(f==null&&t==null&&c==null){if(i==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return i.parent=a,a.child=i,i}else{c=f,t=a,f=i;var e=t.getOwner(),r=c.getOwner();if(!(e!=null&&e.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(r!=null&&r.getGraphManager()==this))throw"Target not in this graph mgr!";if(e==r)return f.isInterGraph=!1,e.add(f,t,c);if(f.isInterGraph=!0,f.source=t,f.target=c,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},n.prototype.remove=function(i){if(i instanceof u){var a=i;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var t,c=f.length,e=0;e<c;e++)t=f[e],a.remove(t);var r=[];r=r.concat(a.getNodes());var h;c=r.length;for(var e=0;e<c;e++)h=r[e],a.remove(h);a==this.rootGraph&&this.setRootGraph(null);var g=this.graphs.indexOf(a);this.graphs.splice(g,1),a.parent=null}else if(i instanceof l){if(t=i,t==null)throw"Edge is null!";if(!t.isInterGraph)throw"Not an inter-graph edge!";if(!(t.source!=null&&t.target!=null))throw"Source and/or target is null!";if(!(t.source.edges.indexOf(t)!=-1&&t.target.edges.indexOf(t)!=-1))throw"Source and/or target doesn't know this edge!";var g=t.source.edges.indexOf(t);if(t.source.edges.splice(g,1),g=t.target.edges.indexOf(t),t.target.edges.splice(g,1),!(t.source.owner!=null&&t.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(t.source.owner.getGraphManager().edges.indexOf(t)==-1)throw"Not in owner graph manager's edge list!";var g=t.source.owner.getGraphManager().edges.indexOf(t);t.source.owner.getGraphManager().edges.splice(g,1)}},n.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},n.prototype.getGraphs=function(){return this.graphs},n.prototype.getAllNodes=function(){if(this.allNodes==null){for(var i=[],a=this.getGraphs(),f=a.length,t=0;t<f;t++)i=i.concat(a[t].getNodes());this.allNodes=i}return this.allNodes},n.prototype.resetAllNodes=function(){this.allNodes=null},n.prototype.resetAllEdges=function(){this.allEdges=null},n.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},n.prototype.getAllEdges=function(){if(this.allEdges==null){for(var i=[],a=this.getGraphs(),f=a.length,t=0;t<a.length;t++)i=i.concat(a[t].getEdges());i=i.concat(this.edges),this.allEdges=i}return this.allEdges},n.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},n.prototype.setAllNodesToApplyGravitation=function(i){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=i},n.prototype.getRoot=function(){return this.rootGraph},n.prototype.setRootGraph=function(i){if(i.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=i,i.parent==null&&(i.parent=this.layout.newNode("Root node"))},n.prototype.getLayout=function(){return this.layout},n.prototype.isOneAncestorOfOther=function(i,a){if(!(i!=null&&a!=null))throw"assert failed";if(i==a)return!0;var f=i.getOwner(),t;do{if(t=f.getParent(),t==null)break;if(t==a)return!0;if(f=t.getOwner(),f==null)break}while(!0);f=a.getOwner();do{if(t=f.getParent(),t==null)break;if(t==i)return!0;if(f=t.getOwner(),f==null)break}while(!0);return!1},n.prototype.calcLowestCommonAncestors=function(){for(var i,a,f,t,c,e=this.getAllEdges(),r=e.length,h=0;h<r;h++){if(i=e[h],a=i.source,f=i.target,i.lca=null,i.sourceInLca=a,i.targetInLca=f,a==f){i.lca=a.getOwner();continue}for(t=a.getOwner();i.lca==null;){for(i.targetInLca=f,c=f.getOwner();i.lca==null;){if(c==t){i.lca=c;break}if(c==this.rootGraph)break;if(i.lca!=null)throw"assert failed";i.targetInLca=c.getParent(),c=i.targetInLca.getOwner()}if(t==this.rootGraph)break;i.lca==null&&(i.sourceInLca=t.getParent(),t=i.sourceInLca.getOwner())}if(i.lca==null)throw"assert failed"}},n.prototype.calcLowestCommonAncestor=function(i,a){if(i==a)return i.getOwner();var f=i.getOwner();do{if(f==null)break;var t=a.getOwner();do{if(t==null)break;if(t==f)return t;t=t.getParent().getOwner()}while(!0);f=f.getParent().getOwner()}while(!0);return f},n.prototype.calcInclusionTreeDepths=function(i,a){i==null&&a==null&&(i=this.rootGraph,a=1);for(var f,t=i.getNodes(),c=t.length,e=0;e<c;e++)f=t[e],f.inclusionTreeDepth=a,f.child!=null&&this.calcInclusionTreeDepths(f.child,a+1)},n.prototype.includesInvalidEdge=function(){for(var i,a=[],f=this.edges.length,t=0;t<f;t++)i=this.edges[t],this.isOneAncestorOfOther(i.source,i.target)&&a.push(i);for(var t=0;t<a.length;t++)this.remove(a[t]);return!1},C.exports=n}),(function(C,A,T){"use strict";var u=T(12);function l(){}l.calcSeparationAmount=function(n,i,a,f){if(!n.intersects(i))throw"assert failed";var t=new Array(2);this.decideDirectionsForOverlappingNodes(n,i,t),a[0]=Math.min(n.getRight(),i.getRight())-Math.max(n.x,i.x),a[1]=Math.min(n.getBottom(),i.getBottom())-Math.max(n.y,i.y),n.getX()<=i.getX()&&n.getRight()>=i.getRight()?a[0]+=Math.min(i.getX()-n.getX(),n.getRight()-i.getRight()):i.getX()<=n.getX()&&i.getRight()>=n.getRight()&&(a[0]+=Math.min(n.getX()-i.getX(),i.getRight()-n.getRight())),n.getY()<=i.getY()&&n.getBottom()>=i.getBottom()?a[1]+=Math.min(i.getY()-n.getY(),n.getBottom()-i.getBottom()):i.getY()<=n.getY()&&i.getBottom()>=n.getBottom()&&(a[1]+=Math.min(n.getY()-i.getY(),i.getBottom()-n.getBottom()));var c=Math.abs((i.getCenterY()-n.getCenterY())/(i.getCenterX()-n.getCenterX()));i.getCenterY()===n.getCenterY()&&i.getCenterX()===n.getCenterX()&&(c=1);var e=c*a[0],r=a[1]/c;a[0]<r?r=a[0]:e=a[1],a[0]=-1*t[0]*(r/2+f),a[1]=-1*t[1]*(e/2+f)},l.decideDirectionsForOverlappingNodes=function(n,i,a){n.getCenterX()<i.getCenterX()?a[0]=-1:a[0]=1,n.getCenterY()<i.getCenterY()?a[1]=-1:a[1]=1},l.getIntersection2=function(n,i,a){var f=n.getCenterX(),t=n.getCenterY(),c=i.getCenterX(),e=i.getCenterY();if(n.intersects(i))return a[0]=f,a[1]=t,a[2]=c,a[3]=e,!0;var r=n.getX(),h=n.getY(),g=n.getRight(),o=n.getX(),N=n.getBottom(),y=n.getRight(),p=n.getWidthHalf(),L=n.getHeightHalf(),R=i.getX(),w=i.getY(),b=i.getRight(),W=i.getX(),G=i.getBottom(),J=i.getRight(),x=i.getWidthHalf(),z=i.getHeightHalf(),s=!1,E=!1;if(f===c){if(t>e)return a[0]=f,a[1]=h,a[2]=c,a[3]=G,!1;if(t<e)return a[0]=f,a[1]=N,a[2]=c,a[3]=w,!1}else if(t===e){if(f>c)return a[0]=r,a[1]=t,a[2]=b,a[3]=e,!1;if(f<c)return a[0]=g,a[1]=t,a[2]=R,a[3]=e,!1}else{var d=n.height/n.width,m=i.height/i.width,v=(e-t)/(c-f),D=void 0,O=void 0,P=void 0,S=void 0,I=void 0,Z=void 0;if(-d===v?f>c?(a[0]=o,a[1]=N,s=!0):(a[0]=g,a[1]=h,s=!0):d===v&&(f>c?(a[0]=r,a[1]=h,s=!0):(a[0]=y,a[1]=N,s=!0)),-m===v?c>f?(a[2]=W,a[3]=G,E=!0):(a[2]=b,a[3]=w,E=!0):m===v&&(c>f?(a[2]=R,a[3]=w,E=!0):(a[2]=J,a[3]=G,E=!0)),s&&E)return!1;if(f>c?t>e?(D=this.getCardinalDirection(d,v,4),O=this.getCardinalDirection(m,v,2)):(D=this.getCardinalDirection(-d,v,3),O=this.getCardinalDirection(-m,v,1)):t>e?(D=this.getCardinalDirection(-d,v,1),O=this.getCardinalDirection(-m,v,3)):(D=this.getCardinalDirection(d,v,2),O=this.getCardinalDirection(m,v,4)),!s)switch(D){case 1:S=h,P=f+-L/v,a[0]=P,a[1]=S;break;case 2:P=y,S=t+p*v,a[0]=P,a[1]=S;break;case 3:S=N,P=f+L/v,a[0]=P,a[1]=S;break;case 4:P=o,S=t+-p*v,a[0]=P,a[1]=S;break}if(!E)switch(O){case 1:Z=w,I=c+-z/v,a[2]=I,a[3]=Z;break;case 2:I=J,Z=e+x*v,a[2]=I,a[3]=Z;break;case 3:Z=G,I=c+z/v,a[2]=I,a[3]=Z;break;case 4:I=W,Z=e+-x*v,a[2]=I,a[3]=Z;break}}return!1},l.getCardinalDirection=function(n,i,a){return n>i?a:1+a%4},l.getIntersection=function(n,i,a,f){if(f==null)return this.getIntersection2(n,i,a);var t=n.x,c=n.y,e=i.x,r=i.y,h=a.x,g=a.y,o=f.x,N=f.y,y=void 0,p=void 0,L=void 0,R=void 0,w=void 0,b=void 0,W=void 0,G=void 0,J=void 0;return L=r-c,w=t-e,W=e*c-t*r,R=N-g,b=h-o,G=o*g-h*N,J=L*b-R*w,J===0?null:(y=(w*G-b*W)/J,p=(R*W-L*G)/J,new u(y,p))},l.angleOfVector=function(n,i,a,f){var t=void 0;return n!==a?(t=Math.atan((f-i)/(a-n)),a<n?t+=Math.PI:f<i&&(t+=this.TWO_PI)):f<i?t=this.ONE_AND_HALF_PI:t=this.HALF_PI,t},l.doIntersect=function(n,i,a,f){var t=n.x,c=n.y,e=i.x,r=i.y,h=a.x,g=a.y,o=f.x,N=f.y,y=(e-t)*(N-g)-(o-h)*(r-c);if(y===0)return!1;var p=((N-g)*(o-t)+(h-o)*(N-c))/y,L=((c-r)*(o-t)+(e-t)*(N-c))/y;return 0<p&&p<1&&0<L&&L<1},l.findCircleLineIntersections=function(n,i,a,f,t,c,e){var r=(a-n)*(a-n)+(f-i)*(f-i),h=2*((n-t)*(a-n)+(i-c)*(f-i)),g=(n-t)*(n-t)+(i-c)*(i-c)-e*e,o=h*h-4*r*g;if(o>=0){var N=(-h+Math.sqrt(h*h-4*r*g))/(2*r),y=(-h-Math.sqrt(h*h-4*r*g))/(2*r),p=null;return N>=0&&N<=1?[N]:y>=0&&y<=1?[y]:p}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,C.exports=l}),(function(C,A,T){"use strict";function u(){}u.sign=function(l){return l>0?1:l<0?-1:0},u.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},u.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},C.exports=u}),(function(C,A,T){"use strict";function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,C.exports=u}),(function(C,A,T){"use strict";var u=(function(){function t(c,e){for(var r=0;r<e.length;r++){var h=e[r];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(c,h.key,h)}}return function(c,e,r){return e&&t(c.prototype,e),r&&t(c,r),c}})();function l(t,c){if(!(t instanceof c))throw new TypeError("Cannot call a class as a function")}var n=function(c){return{value:c,next:null,prev:null}},i=function(c,e,r,h){return c!==null?c.next=e:h.head=e,r!==null?r.prev=e:h.tail=e,e.prev=c,e.next=r,h.length++,e},a=function(c,e){var r=c.prev,h=c.next;return r!==null?r.next=h:e.head=h,h!==null?h.prev=r:e.tail=r,c.prev=c.next=null,e.length--,c},f=(function(){function t(c){var e=this;l(this,t),this.length=0,this.head=null,this.tail=null,c?.forEach(function(r){return e.push(r)})}return u(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(e,r){return i(r.prev,n(e),r,this)}},{key:"insertAfter",value:function(e,r){return i(r,n(e),r.next,this)}},{key:"insertNodeBefore",value:function(e,r){return i(r.prev,e,r,this)}},{key:"insertNodeAfter",value:function(e,r){return i(r,e,r.next,this)}},{key:"push",value:function(e){return i(this.tail,n(e),null,this)}},{key:"unshift",value:function(e){return i(null,n(e),this.head,this)}},{key:"remove",value:function(e){return a(e,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(e){if(e<=this.length()){for(var r=1,h=this.head;r<e;)h=h.next,r++;return h.value}}},{key:"set_object_at",value:function(e,r){if(e<=this.length()){for(var h=1,g=this.head;h<e;)g=g.next,h++;g.value=r}}}]),t})();C.exports=f}),(function(C,A,T){"use strict";function u(l,n,i){this.x=null,this.y=null,l==null&&n==null&&i==null?(this.x=0,this.y=0):typeof l=="number"&&typeof n=="number"&&i==null?(this.x=l,this.y=n):l.constructor.name=="Point"&&n==null&&i==null&&(i=l,this.x=i.x,this.y=i.y)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.getLocation=function(){return new u(this.x,this.y)},u.prototype.setLocation=function(l,n,i){l.constructor.name=="Point"&&n==null&&i==null?(i=l,this.setLocation(i.x,i.y)):typeof l=="number"&&typeof n=="number"&&i==null&&(parseInt(l)==l&&parseInt(n)==n?this.move(l,n):(this.x=Math.floor(l+.5),this.y=Math.floor(n+.5)))},u.prototype.move=function(l,n){this.x=l,this.y=n},u.prototype.translate=function(l,n){this.x+=l,this.y+=n},u.prototype.equals=function(l){if(l.constructor.name=="Point"){var n=l;return this.x==n.x&&this.y==n.y}return this==l},u.prototype.toString=function(){return new u().constructor.name+"[x="+this.x+",y="+this.y+"]"},C.exports=u}),(function(C,A,T){"use strict";function u(l,n,i,a){this.x=0,this.y=0,this.width=0,this.height=0,l!=null&&n!=null&&i!=null&&a!=null&&(this.x=l,this.y=n,this.width=i,this.height=a)}u.prototype.getX=function(){return this.x},u.prototype.setX=function(l){this.x=l},u.prototype.getY=function(){return this.y},u.prototype.setY=function(l){this.y=l},u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(l){this.width=l},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(l){this.height=l},u.prototype.getRight=function(){return this.x+this.width},u.prototype.getBottom=function(){return this.y+this.height},u.prototype.intersects=function(l){return!(this.getRight()<l.x||this.getBottom()<l.y||l.getRight()<this.x||l.getBottom()<this.y)},u.prototype.getCenterX=function(){return this.x+this.width/2},u.prototype.getMinX=function(){return this.getX()},u.prototype.getMaxX=function(){return this.getX()+this.width},u.prototype.getCenterY=function(){return this.y+this.height/2},u.prototype.getMinY=function(){return this.getY()},u.prototype.getMaxY=function(){return this.getY()+this.height},u.prototype.getWidthHalf=function(){return this.width/2},u.prototype.getHeightHalf=function(){return this.height/2},C.exports=u}),(function(C,A,T){"use strict";var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function l(){}l.lastID=0,l.createID=function(n){return l.isPrimitive(n)?n:(n.uniqueID!=null||(n.uniqueID=l.getString(),l.lastID++),n.uniqueID)},l.getString=function(n){return n==null&&(n=l.lastID),"Object#"+n},l.isPrimitive=function(n){var i=typeof n>"u"?"undefined":u(n);return n==null||i!="object"&&i!="function"},C.exports=l}),(function(C,A,T){"use strict";function u(h){if(Array.isArray(h)){for(var g=0,o=Array(h.length);g<h.length;g++)o[g]=h[g];return o}else return Array.from(h)}var l=T(0),n=T(7),i=T(3),a=T(1),f=T(6),t=T(5),c=T(17),e=T(29);function r(h){e.call(this),this.layoutQuality=l.QUALITY,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=l.DEFAULT_INCREMENTAL,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new n(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,h!=null&&(this.isRemoteUse=h)}r.RANDOM_SEED=1,r.prototype=Object.create(e.prototype),r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},r.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},r.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},r.prototype.newGraphManager=function(){var h=new n(this);return this.graphManager=h,h},r.prototype.newGraph=function(h){return new f(null,this.graphManager,h)},r.prototype.newNode=function(h){return new i(this.graphManager,h)},r.prototype.newEdge=function(h){return new a(null,null,h)},r.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},r.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var h;return this.checkLayoutSuccess()?h=!1:h=this.layout(),l.ANIMATE==="during"?!1:(h&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,h)},r.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},r.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var h,g=this.graphManager.getAllEdges(),o=0;o<g.length;o++)h=g[o];for(var N,y=this.graphManager.getRoot().getNodes(),o=0;o<y.length;o++)N=y[o];this.update(this.graphManager.getRoot())}},r.prototype.update=function(h){if(h==null)this.update2();else if(h instanceof i){var g=h;if(g.getChild()!=null)for(var o=g.getChild().getNodes(),N=0;N<o.length;N++)update(o[N]);if(g.vGraphObject!=null){var y=g.vGraphObject;y.update(g)}}else if(h instanceof a){var p=h;if(p.vGraphObject!=null){var L=p.vGraphObject;L.update(p)}}else if(h instanceof f){var R=h;if(R.vGraphObject!=null){var w=R.vGraphObject;w.update(R)}}},r.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=l.QUALITY,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=l.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},r.prototype.transform=function(h){if(h==null)this.transform(new t(0,0));else{var g=new c,o=this.graphManager.getRoot().updateLeftTop();if(o!=null){g.setWorldOrgX(h.x),g.setWorldOrgY(h.y),g.setDeviceOrgX(o.x),g.setDeviceOrgY(o.y);for(var N=this.getAllNodes(),y,p=0;p<N.length;p++)y=N[p],y.transform(g)}}},r.prototype.positionNodesRandomly=function(h){if(h==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var g,o,N=h.getNodes(),y=0;y<N.length;y++)g=N[y],o=g.getChild(),o==null||o.getNodes().length==0?g.scatter():(this.positionNodesRandomly(o),g.updateBounds())},r.prototype.getFlatForest=function(){for(var h=[],g=!0,o=this.graphManager.getRoot().getNodes(),N=!0,y=0;y<o.length;y++)o[y].getChild()!=null&&(N=!1);if(!N)return h;var p=new Set,L=[],R=new Map,w=[];for(w=w.concat(o);w.length>0&&g;){for(L.push(w[0]);L.length>0&&g;){var b=L[0];L.splice(0,1),p.add(b);for(var W=b.getEdges(),y=0;y<W.length;y++){var G=W[y].getOtherEnd(b);if(R.get(b)!=G)if(!p.has(G))L.push(G),R.set(G,b);else{g=!1;break}}}if(!g)h=[];else{var J=[].concat(u(p));h.push(J);for(var y=0;y<J.length;y++){var x=J[y],z=w.indexOf(x);z>-1&&w.splice(z,1)}p=new Set,R=new Map}}return h},r.prototype.createDummyNodesForBendpoints=function(h){for(var g=[],o=h.source,N=this.graphManager.calcLowestCommonAncestor(h.source,h.target),y=0;y<h.bendpoints.length;y++){var p=this.newNode(null);p.setRect(new Point(0,0),new Dimension(1,1)),N.add(p);var L=this.newEdge(null);this.graphManager.add(L,o,p),g.add(p),o=p}var L=this.newEdge(null);return this.graphManager.add(L,o,h.target),this.edgeToDummyNodes.set(h,g),h.isInterGraph()?this.graphManager.remove(h):N.remove(h),g},r.prototype.createBendpointsFromDummyNodes=function(){var h=[];h=h.concat(this.graphManager.getAllEdges()),h=[].concat(u(this.edgeToDummyNodes.keys())).concat(h);for(var g=0;g<h.length;g++){var o=h[g];if(o.bendpoints.length>0){for(var N=this.edgeToDummyNodes.get(o),y=0;y<N.length;y++){var p=N[y],L=new t(p.getCenterX(),p.getCenterY()),R=o.bendpoints.get(y);R.x=L.x,R.y=L.y,p.getOwner().remove(p)}this.graphManager.add(o,o.source,o.target)}}},r.transform=function(h,g,o,N){if(o!=null&&N!=null){var y=g;if(h<=50){var p=g/o;y-=(g-p)/50*(50-h)}else{var L=g*N;y+=(L-g)/50*(h-50)}return y}else{var R,w;return h<=50?(R=9*g/500,w=g/10):(R=9*g/50,w=-8*g),R*h+w}},r.findCenterOfTree=function(h){var g=[];g=g.concat(h);var o=[],N=new Map,y=!1,p=null;(g.length==1||g.length==2)&&(y=!0,p=g[0]);for(var L=0;L<g.length;L++){var R=g[L],w=R.getNeighborsList().size;N.set(R,R.getNeighborsList().size),w==1&&o.push(R)}var b=[];for(b=b.concat(o);!y;){var W=[];W=W.concat(b),b=[];for(var L=0;L<g.length;L++){var R=g[L],G=g.indexOf(R);G>=0&&g.splice(G,1);var J=R.getNeighborsList();J.forEach(function(s){if(o.indexOf(s)<0){var E=N.get(s),d=E-1;d==1&&b.push(s),N.set(s,d)}})}o=o.concat(b),(g.length==1||g.length==2)&&(y=!0,p=g[0])}return p},r.prototype.setGraphManager=function(h){this.graphManager=h},C.exports=r}),(function(C,A,T){"use strict";function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},C.exports=u}),(function(C,A,T){"use strict";var u=T(5);function l(n,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(n){this.lworldExtX=n},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(n){this.lworldExtY=n},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},l.prototype.transformX=function(n){var i=0,a=this.lworldExtX;return a!=0&&(i=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/a),i},l.prototype.transformY=function(n){var i=0,a=this.lworldExtY;return a!=0&&(i=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/a),i},l.prototype.inverseTransformX=function(n){var i=0,a=this.ldeviceExtX;return a!=0&&(i=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/a),i},l.prototype.inverseTransformY=function(n){var i=0,a=this.ldeviceExtY;return a!=0&&(i=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/a),i},l.prototype.inverseTransformPoint=function(n){var i=new u(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return i},C.exports=l}),(function(C,A,T){"use strict";function u(e){if(Array.isArray(e)){for(var r=0,h=Array(e.length);r<e.length;r++)h[r]=e[r];return h}else return Array.from(e)}var l=T(15),n=T(4),i=T(0),a=T(8),f=T(9);function t(){l.call(this),this.useSmartIdealEdgeLengthCalculation=n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=n.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=n.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=n.MAX_ITERATIONS}t.prototype=Object.create(l.prototype);for(var c in l)t[c]=l[c];t.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},t.prototype.calcIdealEdgeLengths=function(){for(var e,r,h,g,o,N,y,p=this.getGraphManager().getAllEdges(),L=0;L<p.length;L++)e=p[L],r=e.idealLength,e.isInterGraph&&(g=e.getSource(),o=e.getTarget(),N=e.getSourceInLca().getEstimatedSize(),y=e.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(e.idealLength+=N+y-2*i.SIMPLE_NODE_SIZE),h=e.getLca().getInclusionTreeDepth(),e.idealLength+=r*n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(g.getInclusionTreeDepth()+o.getInclusionTreeDepth()-2*h))},t.prototype.initSpringEmbedder=function(){var e=this.getAllNodes().length;this.incremental?(e>n.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(e-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},t.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),r,h=0;h<e.length;h++)r=e[h],this.calcSpringForce(r,r.idealLength)},t.prototype.calcRepulsionForces=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h,g,o,N,y=this.getAllNodes(),p;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),p=new Set,h=0;h<y.length;h++)o=y[h],this.calculateRepulsionForceOfANode(o,p,e,r),p.add(o);else for(h=0;h<y.length;h++)for(o=y[h],g=h+1;g<y.length;g++)N=y[g],o.getOwner()==N.getOwner()&&this.calcRepulsionForce(o,N)},t.prototype.calcGravitationalForces=function(){for(var e,r=this.getAllNodesToApplyGravitation(),h=0;h<r.length;h++)e=r[h],this.calcGravitationalForce(e)},t.prototype.moveNodes=function(){for(var e=this.getAllNodes(),r,h=0;h<e.length;h++)r=e[h],r.move()},t.prototype.calcSpringForce=function(e,r){var h=e.getSource(),g=e.getTarget(),o,N,y,p;if(this.uniformLeafNodeSizes&&h.getChild()==null&&g.getChild()==null)e.updateLengthSimple();else if(e.updateLength(),e.isOverlapingSourceAndTarget)return;o=e.getLength(),o!=0&&(N=e.edgeElasticity*(o-r),y=N*(e.lengthX/o),p=N*(e.lengthY/o),h.springForceX+=y,h.springForceY+=p,g.springForceX-=y,g.springForceY-=p)},t.prototype.calcRepulsionForce=function(e,r){var h=e.getRect(),g=r.getRect(),o=new Array(2),N=new Array(4),y,p,L,R,w,b,W;if(h.intersects(g)){a.calcSeparationAmount(h,g,o,n.DEFAULT_EDGE_LENGTH/2),b=2*o[0],W=2*o[1];var G=e.noOfChildren*r.noOfChildren/(e.noOfChildren+r.noOfChildren);e.repulsionForceX-=G*b,e.repulsionForceY-=G*W,r.repulsionForceX+=G*b,r.repulsionForceY+=G*W}else this.uniformLeafNodeSizes&&e.getChild()==null&&r.getChild()==null?(y=g.getCenterX()-h.getCenterX(),p=g.getCenterY()-h.getCenterY()):(a.getIntersection(h,g,N),y=N[2]-N[0],p=N[3]-N[1]),Math.abs(y)<n.MIN_REPULSION_DIST&&(y=f.sign(y)*n.MIN_REPULSION_DIST),Math.abs(p)<n.MIN_REPULSION_DIST&&(p=f.sign(p)*n.MIN_REPULSION_DIST),L=y*y+p*p,R=Math.sqrt(L),w=(e.nodeRepulsion/2+r.nodeRepulsion/2)*e.noOfChildren*r.noOfChildren/L,b=w*y/R,W=w*p/R,e.repulsionForceX-=b,e.repulsionForceY-=W,r.repulsionForceX+=b,r.repulsionForceY+=W},t.prototype.calcGravitationalForce=function(e){var r,h,g,o,N,y,p,L;r=e.getOwner(),h=(r.getRight()+r.getLeft())/2,g=(r.getTop()+r.getBottom())/2,o=e.getCenterX()-h,N=e.getCenterY()-g,y=Math.abs(o)+e.getWidth()/2,p=Math.abs(N)+e.getHeight()/2,e.getOwner()==this.graphManager.getRoot()?(L=r.getEstimatedSize()*this.gravityRangeFactor,(y>L||p>L)&&(e.gravitationForceX=-this.gravityConstant*o,e.gravitationForceY=-this.gravityConstant*N)):(L=r.getEstimatedSize()*this.compoundGravityRangeFactor,(y>L||p>L)&&(e.gravitationForceX=-this.gravityConstant*o*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant))},t.prototype.isConverged=function(){var e,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,e||r},t.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},t.prototype.calcNoOfChildrenForAllNodes=function(){for(var e,r=this.graphManager.getAllNodes(),h=0;h<r.length;h++)e=r[h],e.noOfChildren=e.getNoOfChildren()},t.prototype.calcGrid=function(e){var r=0,h=0;r=parseInt(Math.ceil((e.getRight()-e.getLeft())/this.repulsionRange)),h=parseInt(Math.ceil((e.getBottom()-e.getTop())/this.repulsionRange));for(var g=new Array(r),o=0;o<r;o++)g[o]=new Array(h);for(var o=0;o<r;o++)for(var N=0;N<h;N++)g[o][N]=new Array;return g},t.prototype.addNodeToGrid=function(e,r,h){var g=0,o=0,N=0,y=0;g=parseInt(Math.floor((e.getRect().x-r)/this.repulsionRange)),o=parseInt(Math.floor((e.getRect().width+e.getRect().x-r)/this.repulsionRange)),N=parseInt(Math.floor((e.getRect().y-h)/this.repulsionRange)),y=parseInt(Math.floor((e.getRect().height+e.getRect().y-h)/this.repulsionRange));for(var p=g;p<=o;p++)for(var L=N;L<=y;L++)this.grid[p][L].push(e),e.setGridCoordinates(g,o,N,y)},t.prototype.updateGrid=function(){var e,r,h=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),e=0;e<h.length;e++)r=h[e],this.addNodeToGrid(r,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},t.prototype.calculateRepulsionForceOfANode=function(e,r,h,g){if(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&h||g){var o=new Set;e.surrounding=new Array;for(var N,y=this.grid,p=e.startX-1;p<e.finishX+2;p++)for(var L=e.startY-1;L<e.finishY+2;L++)if(!(p<0||L<0||p>=y.length||L>=y[0].length)){for(var R=0;R<y[p][L].length;R++)if(N=y[p][L][R],!(e.getOwner()!=N.getOwner()||e==N)&&!r.has(N)&&!o.has(N)){var w=Math.abs(e.getCenterX()-N.getCenterX())-(e.getWidth()/2+N.getWidth()/2),b=Math.abs(e.getCenterY()-N.getCenterY())-(e.getHeight()/2+N.getHeight()/2);w<=this.repulsionRange&&b<=this.repulsionRange&&o.add(N)}}e.surrounding=[].concat(u(o))}for(p=0;p<e.surrounding.length;p++)this.calcRepulsionForce(e,e.surrounding[p])},t.prototype.calcRepulsionRange=function(){return 0},C.exports=t}),(function(C,A,T){"use strict";var u=T(1),l=T(4);function n(a,f,t){u.call(this,a,f,t),this.idealLength=l.DEFAULT_EDGE_LENGTH,this.edgeElasticity=l.DEFAULT_SPRING_STRENGTH}n.prototype=Object.create(u.prototype);for(var i in u)n[i]=u[i];C.exports=n}),(function(C,A,T){"use strict";var u=T(3),l=T(4);function n(a,f,t,c){u.call(this,a,f,t,c),this.nodeRepulsion=l.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}n.prototype=Object.create(u.prototype);for(var i in u)n[i]=u[i];n.prototype.setGridCoordinates=function(a,f,t,c){this.startX=a,this.finishX=f,this.startY=t,this.finishY=c},C.exports=n}),(function(C,A,T){"use strict";function u(l,n){this.width=0,this.height=0,l!==null&&n!==null&&(this.height=n,this.width=l)}u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(l){this.width=l},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(l){this.height=l},C.exports=u}),(function(C,A,T){"use strict";var u=T(14);function l(){this.map={},this.keys=[]}l.prototype.put=function(n,i){var a=u.createID(n);this.contains(a)||(this.map[a]=i,this.keys.push(n))},l.prototype.contains=function(n){var i=u.createID(n);return this.map[n]!=null},l.prototype.get=function(n){var i=u.createID(n);return this.map[i]},l.prototype.keySet=function(){return this.keys},C.exports=l}),(function(C,A,T){"use strict";var u=T(14);function l(){this.set={}}l.prototype.add=function(n){var i=u.createID(n);this.contains(i)||(this.set[i]=n)},l.prototype.remove=function(n){delete this.set[u.createID(n)]},l.prototype.clear=function(){this.set={}},l.prototype.contains=function(n){return this.set[u.createID(n)]==n},l.prototype.isEmpty=function(){return this.size()===0},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAllTo=function(n){for(var i=Object.keys(this.set),a=i.length,f=0;f<a;f++)n.push(this.set[i[f]])},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAll=function(n){for(var i=n.length,a=0;a<i;a++){var f=n[a];this.add(f)}},C.exports=l}),(function(C,A,T){"use strict";function u(){}u.multMat=function(l,n){for(var i=[],a=0;a<l.length;a++){i[a]=[];for(var f=0;f<n[0].length;f++){i[a][f]=0;for(var t=0;t<l[0].length;t++)i[a][f]+=l[a][t]*n[t][f]}}return i},u.transpose=function(l){for(var n=[],i=0;i<l[0].length;i++){n[i]=[];for(var a=0;a<l.length;a++)n[i][a]=l[a][i]}return n},u.multCons=function(l,n){for(var i=[],a=0;a<l.length;a++)i[a]=l[a]*n;return i},u.minusOp=function(l,n){for(var i=[],a=0;a<l.length;a++)i[a]=l[a]-n[a];return i},u.dotProduct=function(l,n){for(var i=0,a=0;a<l.length;a++)i+=l[a]*n[a];return i},u.mag=function(l){return Math.sqrt(this.dotProduct(l,l))},u.normalize=function(l){for(var n=[],i=this.mag(l),a=0;a<l.length;a++)n[a]=l[a]/i;return n},u.multGamma=function(l){for(var n=[],i=0,a=0;a<l.length;a++)i+=l[a];i*=-1/l.length;for(var f=0;f<l.length;f++)n[f]=i+l[f];return n},u.multL=function(l,n,i){for(var a=[],f=[],t=[],c=0;c<n[0].length;c++){for(var e=0,r=0;r<n.length;r++)e+=-.5*n[r][c]*l[r];f[c]=e}for(var h=0;h<i.length;h++){for(var g=0,o=0;o<i.length;o++)g+=i[h][o]*f[o];t[h]=g}for(var N=0;N<n.length;N++){for(var y=0,p=0;p<n[0].length;p++)y+=n[N][p]*t[p];a[N]=y}return a},C.exports=u}),(function(C,A,T){"use strict";var u=(function(){function a(f,t){for(var c=0;c<t.length;c++){var e=t[c];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(f,e.key,e)}}return function(f,t,c){return t&&a(f.prototype,t),c&&a(f,c),f}})();function l(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")}var n=T(11),i=(function(){function a(f,t){l(this,a),(t!==null||t!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var c=void 0;f instanceof n?c=f.size():c=f.length,this._quicksort(f,0,c-1)}return u(a,[{key:"_quicksort",value:function(t,c,e){if(c<e){var r=this._partition(t,c,e);this._quicksort(t,c,r),this._quicksort(t,r+1,e)}}},{key:"_partition",value:function(t,c,e){for(var r=this._get(t,c),h=c,g=e;;){for(;this.compareFunction(r,this._get(t,g));)g--;for(;this.compareFunction(this._get(t,h),r);)h++;if(h<g)this._swap(t,h,g),h++,g--;else return g}}},{key:"_get",value:function(t,c){return t instanceof n?t.get_object_at(c):t[c]}},{key:"_set",value:function(t,c,e){t instanceof n?t.set_object_at(c,e):t[c]=e}},{key:"_swap",value:function(t,c,e){var r=this._get(t,c);this._set(t,c,this._get(t,e)),this._set(t,e,r)}},{key:"_defaultCompareFunction",value:function(t,c){return c>t}}]),a})();C.exports=i}),(function(C,A,T){"use strict";function u(){}u.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var n=Math.min(this.m,this.n);this.s=(function(Dt){for(var Nt=[];Dt-- >0;)Nt.push(0);return Nt})(Math.min(this.m+1,this.n)),this.U=(function(Dt){var Nt=function $t(Rt){if(Rt.length==0)return 0;for(var Xt=[],zt=0;zt<Rt[0];zt++)Xt.push($t(Rt.slice(1)));return Xt};return Nt(Dt)})([this.m,n]),this.V=(function(Dt){var Nt=function $t(Rt){if(Rt.length==0)return 0;for(var Xt=[],zt=0;zt<Rt[0];zt++)Xt.push($t(Rt.slice(1)));return Xt};return Nt(Dt)})([this.n,this.n]);for(var i=(function(Dt){for(var Nt=[];Dt-- >0;)Nt.push(0);return Nt})(this.n),a=(function(Dt){for(var Nt=[];Dt-- >0;)Nt.push(0);return Nt})(this.m),f=!0,t=!0,c=Math.min(this.m-1,this.n),e=Math.max(0,Math.min(this.n-2,this.m)),r=0;r<Math.max(c,e);r++){if(r<c){this.s[r]=0;for(var h=r;h<this.m;h++)this.s[r]=u.hypot(this.s[r],l[h][r]);if(this.s[r]!==0){l[r][r]<0&&(this.s[r]=-this.s[r]);for(var g=r;g<this.m;g++)l[g][r]/=this.s[r];l[r][r]+=1}this.s[r]=-this.s[r]}for(var o=r+1;o<this.n;o++){if((function(Dt,Nt){return Dt&&Nt})(r<c,this.s[r]!==0)){for(var N=0,y=r;y<this.m;y++)N+=l[y][r]*l[y][o];N=-N/l[r][r];for(var p=r;p<this.m;p++)l[p][o]+=N*l[p][r]}i[o]=l[r][o]}if((function(Dt,Nt){return Dt&&Nt})(f,r<c))for(var L=r;L<this.m;L++)this.U[L][r]=l[L][r];if(r<e){i[r]=0;for(var R=r+1;R<this.n;R++)i[r]=u.hypot(i[r],i[R]);if(i[r]!==0){i[r+1]<0&&(i[r]=-i[r]);for(var w=r+1;w<this.n;w++)i[w]/=i[r];i[r+1]+=1}if(i[r]=-i[r],(function(Dt,Nt){return Dt&&Nt})(r+1<this.m,i[r]!==0)){for(var b=r+1;b<this.m;b++)a[b]=0;for(var W=r+1;W<this.n;W++)for(var G=r+1;G<this.m;G++)a[G]+=i[W]*l[G][W];for(var J=r+1;J<this.n;J++)for(var x=-i[J]/i[r+1],z=r+1;z<this.m;z++)l[z][J]+=x*a[z]}if(t)for(var s=r+1;s<this.n;s++)this.V[s][r]=i[s]}}var E=Math.min(this.n,this.m+1);if(c<this.n&&(this.s[c]=l[c][c]),this.m<E&&(this.s[E-1]=0),e+1<E&&(i[e]=l[e][E-1]),i[E-1]=0,f){for(var d=c;d<n;d++){for(var m=0;m<this.m;m++)this.U[m][d]=0;this.U[d][d]=1}for(var v=c-1;v>=0;v--)if(this.s[v]!==0){for(var D=v+1;D<n;D++){for(var O=0,P=v;P<this.m;P++)O+=this.U[P][v]*this.U[P][D];O=-O/this.U[v][v];for(var S=v;S<this.m;S++)this.U[S][D]+=O*this.U[S][v]}for(var I=v;I<this.m;I++)this.U[I][v]=-this.U[I][v];this.U[v][v]=1+this.U[v][v];for(var Z=0;Z<v-1;Z++)this.U[Z][v]=0}else{for(var tt=0;tt<this.m;tt++)this.U[tt][v]=0;this.U[v][v]=1}}if(t)for(var F=this.n-1;F>=0;F--){if((function(Dt,Nt){return Dt&&Nt})(F<e,i[F]!==0))for(var _=F+1;_<n;_++){for(var B=0,M=F+1;M<this.n;M++)B+=this.V[M][F]*this.V[M][_];B=-B/this.V[F+1][F];for(var Y=F+1;Y<this.n;Y++)this.V[Y][_]+=B*this.V[Y][F]}for(var X=0;X<this.n;X++)this.V[X][F]=0;this.V[F][F]=1}for(var K=E-1,st=0,Lt=Math.pow(2,-52),St=Math.pow(2,-966);E>0;){var Q=void 0,Ut=void 0;for(Q=E-2;Q>=-1&&Q!==-1;Q--)if(Math.abs(i[Q])<=St+Lt*(Math.abs(this.s[Q])+Math.abs(this.s[Q+1]))){i[Q]=0;break}if(Q===E-2)Ut=4;else{var Mt=void 0;for(Mt=E-1;Mt>=Q&&Mt!==Q;Mt--){var nt=(Mt!==E?Math.abs(i[Mt]):0)+(Mt!==Q+1?Math.abs(i[Mt-1]):0);if(Math.abs(this.s[Mt])<=St+Lt*nt){this.s[Mt]=0;break}}Mt===Q?Ut=3:Mt===E-1?Ut=1:(Ut=2,Q=Mt)}switch(Q++,Ut){case 1:{var et=i[E-2];i[E-2]=0;for(var pt=E-2;pt>=Q;pt--){var Et=u.hypot(this.s[pt],et),Ct=this.s[pt]/Et,mt=et/Et;if(this.s[pt]=Et,pt!==Q&&(et=-mt*i[pt-1],i[pt-1]=Ct*i[pt-1]),t)for(var Tt=0;Tt<this.n;Tt++)Et=Ct*this.V[Tt][pt]+mt*this.V[Tt][E-1],this.V[Tt][E-1]=-mt*this.V[Tt][pt]+Ct*this.V[Tt][E-1],this.V[Tt][pt]=Et}}break;case 2:{var Ot=i[Q-1];i[Q-1]=0;for(var It=Q;It<E;It++){var Wt=u.hypot(this.s[It],Ot),Pt=this.s[It]/Wt,Yt=Ot/Wt;if(this.s[It]=Wt,Ot=-Yt*i[It],i[It]=Pt*i[It],f)for(var bt=0;bt<this.m;bt++)Wt=Pt*this.U[bt][It]+Yt*this.U[bt][Q-1],this.U[bt][Q-1]=-Yt*this.U[bt][It]+Pt*this.U[bt][Q-1],this.U[bt][It]=Wt}}break;case 3:{var U=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[E-1]),Math.abs(this.s[E-2])),Math.abs(i[E-2])),Math.abs(this.s[Q])),Math.abs(i[Q])),H=this.s[E-1]/U,V=this.s[E-2]/U,$=i[E-2]/U,k=this.s[Q]/U,j=i[Q]/U,ut=((V+H)*(V-H)+$*$)/2,ft=H*$*(H*$),q=0;(function(Dt,Nt){return Dt||Nt})(ut!==0,ft!==0)&&(q=Math.sqrt(ut*ut+ft),ut<0&&(q=-q),q=ft/(ut+q));for(var ht=(k+H)*(k-H)+q,gt=k*j,rt=Q;rt<E-1;rt++){var vt=u.hypot(ht,gt),At=ht/vt,ot=gt/vt;if(rt!==Q&&(i[rt-1]=vt),ht=At*this.s[rt]+ot*i[rt],i[rt]=At*i[rt]-ot*this.s[rt],gt=ot*this.s[rt+1],this.s[rt+1]=At*this.s[rt+1],t)for(var it=0;it<this.n;it++)vt=At*this.V[it][rt]+ot*this.V[it][rt+1],this.V[it][rt+1]=-ot*this.V[it][rt]+At*this.V[it][rt+1],this.V[it][rt]=vt;if(vt=u.hypot(ht,gt),At=ht/vt,ot=gt/vt,this.s[rt]=vt,ht=At*i[rt]+ot*this.s[rt+1],this.s[rt+1]=-ot*i[rt]+At*this.s[rt+1],gt=ot*i[rt+1],i[rt+1]=At*i[rt+1],f&&rt<this.m-1)for(var dt=0;dt<this.m;dt++)vt=At*this.U[dt][rt]+ot*this.U[dt][rt+1],this.U[dt][rt+1]=-ot*this.U[dt][rt]+At*this.U[dt][rt+1],this.U[dt][rt]=vt}i[E-2]=ht,st=st+1}break;case 4:{if(this.s[Q]<=0&&(this.s[Q]=this.s[Q]<0?-this.s[Q]:0,t))for(var at=0;at<=K;at++)this.V[at][Q]=-this.V[at][Q];for(;Q<K&&!(this.s[Q]>=this.s[Q+1]);){var lt=this.s[Q];if(this.s[Q]=this.s[Q+1],this.s[Q+1]=lt,t&&Q<this.n-1)for(var Ft=0;Ft<this.n;Ft++)lt=this.V[Ft][Q+1],this.V[Ft][Q+1]=this.V[Ft][Q],this.V[Ft][Q]=lt;if(f&&Q<this.m-1)for(var xt=0;xt<this.m;xt++)lt=this.U[xt][Q+1],this.U[xt][Q+1]=this.U[xt][Q],this.U[xt][Q]=lt;Q++}st=0,E--}break}}var Vt={U:this.U,V:this.V,S:this.s};return Vt},u.hypot=function(l,n){var i=void 0;return Math.abs(l)>Math.abs(n)?(i=n/l,i=Math.abs(l)*Math.sqrt(1+i*i)):n!=0?(i=l/n,i=Math.abs(n)*Math.sqrt(1+i*i)):i=0,i},C.exports=u}),(function(C,A,T){"use strict";var u=(function(){function i(a,f){for(var t=0;t<f.length;t++){var c=f[t];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}}return function(a,f,t){return f&&i(a.prototype,f),t&&i(a,t),a}})();function l(i,a){if(!(i instanceof a))throw new TypeError("Cannot call a class as a function")}var n=(function(){function i(a,f){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,e=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,i),this.sequence1=a,this.sequence2=f,this.match_score=t,this.mismatch_penalty=c,this.gap_penalty=e,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var r=0;r<this.iMax;r++){this.grid[r]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[r][h]=0}this.tracebackGrid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.tracebackGrid[g]=new Array(this.jMax);for(var o=0;o<this.jMax;o++)this.tracebackGrid[g][o]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return u(i,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var f=1;f<this.jMax;f++)this.grid[0][f]=this.grid[0][f-1]+this.gap_penalty,this.tracebackGrid[0][f]=[!1,!1,!0];for(var t=1;t<this.iMax;t++)this.grid[t][0]=this.grid[t-1][0]+this.gap_penalty,this.tracebackGrid[t][0]=[!1,!0,!1];for(var c=1;c<this.iMax;c++)for(var e=1;e<this.jMax;e++){var r=void 0;this.sequence1[c-1]===this.sequence2[e-1]?r=this.grid[c-1][e-1]+this.match_score:r=this.grid[c-1][e-1]+this.mismatch_penalty;var h=this.grid[c-1][e]+this.gap_penalty,g=this.grid[c][e-1]+this.gap_penalty,o=[r,h,g],N=this.arrayAllMaxIndexes(o);this.grid[c][e]=o[N[0]],this.tracebackGrid[c][e]=[N.includes(0),N.includes(1),N.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var f=[];for(f.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});f[0];){var t=f[0],c=this.tracebackGrid[t.pos[0]][t.pos[1]];c[0]&&f.push({pos:[t.pos[0]-1,t.pos[1]-1],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),c[1]&&f.push({pos:[t.pos[0]-1,t.pos[1]],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:"-"+t.seq2}),c[2]&&f.push({pos:[t.pos[0],t.pos[1]-1],seq1:"-"+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),t.pos[0]===0&&t.pos[1]===0&&this.alignments.push({sequence1:t.seq1,sequence2:t.seq2}),f.shift()}return this.alignments}},{key:"getAllIndexes",value:function(f,t){for(var c=[],e=-1;(e=f.indexOf(t,e+1))!==-1;)c.push(e);return c}},{key:"arrayAllMaxIndexes",value:function(f){return this.getAllIndexes(f,Math.max.apply(null,f))}}]),i})();C.exports=n}),(function(C,A,T){"use strict";var u=function(){};u.FDLayout=T(18),u.FDLayoutConstants=T(4),u.FDLayoutEdge=T(19),u.FDLayoutNode=T(20),u.DimensionD=T(21),u.HashMap=T(22),u.HashSet=T(23),u.IGeometry=T(8),u.IMath=T(9),u.Integer=T(10),u.Point=T(12),u.PointD=T(5),u.RandomSeed=T(16),u.RectangleD=T(13),u.Transform=T(17),u.UniqueIDGeneretor=T(14),u.Quicksort=T(25),u.LinkedList=T(11),u.LGraphObject=T(2),u.LGraph=T(6),u.LEdge=T(1),u.LGraphManager=T(7),u.LNode=T(3),u.Layout=T(15),u.LayoutConstants=T(0),u.NeedlemanWunsch=T(27),u.Matrix=T(24),u.SVD=T(26),C.exports=u}),(function(C,A,T){"use strict";function u(){this.listeners=[]}var l=u.prototype;l.addListener=function(n,i){this.listeners.push({event:n,callback:i})},l.removeListener=function(n,i){for(var a=this.listeners.length;a>=0;a--){var f=this.listeners[a];f.event===n&&f.callback===i&&this.listeners.splice(a,1)}},l.emit=function(n,i){for(var a=0;a<this.listeners.length;a++){var f=this.listeners[a];n===f.event&&f.callback(i)}},C.exports=u})])})});var Ce=ye((ae,Le)=>{(function(A,T){typeof ae=="object"&&typeof Le=="object"?Le.exports=T(Ne()):typeof define=="function"&&define.amd?define(["layout-base"],T):typeof ae=="object"?ae.coseBase=T(Ne()):A.coseBase=T(A.layoutBase)})(ae,function(C){return(()=>{"use strict";var A={45:((n,i,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),n.exports=f}),806:((n,i,a)=>{var f=a(551).FDLayoutConstants;function t(){}for(var c in f)t[c]=f[c];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,t.ENFORCE_CONSTRAINTS=!0,t.APPLY_LAYOUT=!0,t.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,t.TREE_REDUCTION_ON_INCREMENTAL=!0,t.PURE_INCREMENTAL=t.DEFAULT_INCREMENTAL,n.exports=t}),767:((n,i,a)=>{var f=a(551).FDLayoutEdge;function t(e,r,h){f.call(this,e,r,h)}t.prototype=Object.create(f.prototype);for(var c in f)t[c]=f[c];n.exports=t}),880:((n,i,a)=>{var f=a(551).LGraph;function t(e,r,h){f.call(this,e,r,h)}t.prototype=Object.create(f.prototype);for(var c in f)t[c]=f[c];n.exports=t}),578:((n,i,a)=>{var f=a(551).LGraphManager;function t(e){f.call(this,e)}t.prototype=Object.create(f.prototype);for(var c in f)t[c]=f[c];n.exports=t}),765:((n,i,a)=>{var f=a(551).FDLayout,t=a(578),c=a(880),e=a(991),r=a(767),h=a(806),g=a(902),o=a(551).FDLayoutConstants,N=a(551).LayoutConstants,y=a(551).Point,p=a(551).PointD,L=a(551).DimensionD,R=a(551).Layout,w=a(551).Integer,b=a(551).IGeometry,W=a(551).LGraph,G=a(551).Transform,J=a(551).LinkedList;function x(){f.call(this),this.toBeTiled={},this.constraints={}}x.prototype=Object.create(f.prototype);for(var z in f)x[z]=f[z];x.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},x.prototype.newGraph=function(s){return new c(null,this.graphManager,s)},x.prototype.newNode=function(s){return new e(this.graphManager,s)},x.prototype.newEdge=function(s){return new r(null,null,s)},x.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/o.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){var s=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(D){return E.has(D)});this.graphManager.setAllNodesToApplyGravitation(d)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(d),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(g.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%o.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(v){return s.has(v)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),h.PURE_INCREMENTAL?this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var d=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(d,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),E={},d=0;d<s.length;d++){var m=s[d].rect,v=s[d].id;E[v]={id:v,x:m.getCenterX(),y:m.getCenterY(),w:m.width,h:m.height}}return E},x.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(o.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},x.prototype.moveNodes=function(){for(var s=this.getAllNodes(),E,d=0;d<s.length;d++)E=s[d],E.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var d=0;d<s.length;d++)E=s[d],E.move()},x.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var E=this.graphManager.getAllNodes(),d=0;d<E.length;d++){var m=E[d];this.idToNodeMap.set(m.id,m)}var v=function M(Y){for(var X=Y.getChild().getNodes(),K,st=0,Lt=0;Lt<X.length;Lt++)K=X[Lt],K.getChild()==null?s.fixedNodeSet.has(K.id)&&(st+=100):st+=M(K);return st};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(X){s.fixedNodeSet.add(X.nodeId)});for(var E=this.graphManager.getAllNodes(),m,d=0;d<E.length;d++)if(m=E[d],m.getChild()!=null){var D=v(m);D>0&&(m.fixedNodeWeight=D)}}if(this.constraints.relativePlacementConstraint){var O=new Map,P=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(M){s.fixedNodesOnHorizontal.add(M),s.fixedNodesOnVertical.add(M)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var S=this.constraints.alignmentConstraint.vertical,d=0;d<S.length;d++)this.dummyToNodeForVerticalAlignment.set("dummy"+d,[]),S[d].forEach(function(Y){O.set(Y,"dummy"+d),s.dummyToNodeForVerticalAlignment.get("dummy"+d).push(Y),s.fixedNodeSet.has(Y)&&s.fixedNodesOnHorizontal.add("dummy"+d)});if(this.constraints.alignmentConstraint.horizontal)for(var I=this.constraints.alignmentConstraint.horizontal,d=0;d<I.length;d++)this.dummyToNodeForHorizontalAlignment.set("dummy"+d,[]),I[d].forEach(function(Y){P.set(Y,"dummy"+d),s.dummyToNodeForHorizontalAlignment.get("dummy"+d).push(Y),s.fixedNodeSet.has(Y)&&s.fixedNodesOnVertical.add("dummy"+d)})}if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(M){var Y,X,K;for(K=M.length-1;K>=2*M.length/3;K--)Y=Math.floor(Math.random()*(K+1)),X=M[K],M[K]=M[Y],M[Y]=X;return M},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var Y=O.has(M.left)?O.get(M.left):M.left,X=O.has(M.right)?O.get(M.right):M.right;s.nodesInRelativeHorizontal.includes(Y)||(s.nodesInRelativeHorizontal.push(Y),s.nodeToRelativeConstraintMapHorizontal.set(Y,[]),s.dummyToNodeForVerticalAlignment.has(Y)?s.nodeToTempPositionMapHorizontal.set(Y,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(Y)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(Y,s.idToNodeMap.get(Y).getCenterX())),s.nodesInRelativeHorizontal.includes(X)||(s.nodesInRelativeHorizontal.push(X),s.nodeToRelativeConstraintMapHorizontal.set(X,[]),s.dummyToNodeForVerticalAlignment.has(X)?s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(X).getCenterX())),s.nodeToRelativeConstraintMapHorizontal.get(Y).push({right:X,gap:M.gap}),s.nodeToRelativeConstraintMapHorizontal.get(X).push({left:Y,gap:M.gap})}else{var K=P.has(M.top)?P.get(M.top):M.top,st=P.has(M.bottom)?P.get(M.bottom):M.bottom;s.nodesInRelativeVertical.includes(K)||(s.nodesInRelativeVertical.push(K),s.nodeToRelativeConstraintMapVertical.set(K,[]),s.dummyToNodeForHorizontalAlignment.has(K)?s.nodeToTempPositionMapVertical.set(K,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(K)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(K,s.idToNodeMap.get(K).getCenterY())),s.nodesInRelativeVertical.includes(st)||(s.nodesInRelativeVertical.push(st),s.nodeToRelativeConstraintMapVertical.set(st,[]),s.dummyToNodeForHorizontalAlignment.has(st)?s.nodeToTempPositionMapVertical.set(st,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(st)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(st,s.idToNodeMap.get(st).getCenterY())),s.nodeToRelativeConstraintMapVertical.get(K).push({bottom:st,gap:M.gap}),s.nodeToRelativeConstraintMapVertical.get(st).push({top:K,gap:M.gap})}});else{var Z=new Map,tt=new Map;this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var Y=O.has(M.left)?O.get(M.left):M.left,X=O.has(M.right)?O.get(M.right):M.right;Z.has(Y)?Z.get(Y).push(X):Z.set(Y,[X]),Z.has(X)?Z.get(X).push(Y):Z.set(X,[Y])}else{var K=P.has(M.top)?P.get(M.top):M.top,st=P.has(M.bottom)?P.get(M.bottom):M.bottom;tt.has(K)?tt.get(K).push(st):tt.set(K,[st]),tt.has(st)?tt.get(st).push(K):tt.set(st,[K])}});var F=function(Y,X){var K=[],st=[],Lt=new J,St=new Set,Q=0;return Y.forEach(function(Ut,Mt){if(!St.has(Mt)){K[Q]=[],st[Q]=!1;var nt=Mt;for(Lt.push(nt),St.add(nt),K[Q].push(nt);Lt.length!=0;){nt=Lt.shift(),X.has(nt)&&(st[Q]=!0);var et=Y.get(nt);et.forEach(function(pt){St.has(pt)||(Lt.push(pt),St.add(pt),K[Q].push(pt))})}Q++}}),{components:K,isFixed:st}},_=F(Z,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=_.components,this.fixedComponentsOnHorizontal=_.isFixed;var B=F(tt,s.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},x.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var M=s.idToNodeMap.get(B.nodeId);M.displacementX=0,M.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,d=0;d<E.length;d++){for(var m=0,v=0;v<E[d].length;v++){if(this.fixedNodeSet.has(E[d][v])){m=0;break}m+=this.idToNodeMap.get(E[d][v]).displacementX}for(var D=m/E[d].length,v=0;v<E[d].length;v++)this.idToNodeMap.get(E[d][v]).displacementX=D}if(this.constraints.alignmentConstraint.horizontal)for(var O=this.constraints.alignmentConstraint.horizontal,d=0;d<O.length;d++){for(var P=0,v=0;v<O[d].length;v++){if(this.fixedNodeSet.has(O[d][v])){P=0;break}P+=this.idToNodeMap.get(O[d][v]).displacementY}for(var S=P/O[d].length,v=0;v<O[d].length;v++)this.idToNodeMap.get(O[d][v]).displacementY=S}}if(this.constraints.relativePlacementConstraint)if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(B){if(!s.fixedNodesOnHorizontal.has(B)){var M=0;s.dummyToNodeForVerticalAlignment.has(B)?M=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(B)[0]).displacementX:M=s.idToNodeMap.get(B).displacementX,s.nodeToRelativeConstraintMapHorizontal.get(B).forEach(function(Y){if(Y.right){var X=s.nodeToTempPositionMapHorizontal.get(Y.right)-s.nodeToTempPositionMapHorizontal.get(B)-M;X<Y.gap&&(M-=Y.gap-X)}else{var X=s.nodeToTempPositionMapHorizontal.get(B)-s.nodeToTempPositionMapHorizontal.get(Y.left)+M;X<Y.gap&&(M+=Y.gap-X)}}),s.nodeToTempPositionMapHorizontal.set(B,s.nodeToTempPositionMapHorizontal.get(B)+M),s.dummyToNodeForVerticalAlignment.has(B)?s.dummyToNodeForVerticalAlignment.get(B).forEach(function(Y){s.idToNodeMap.get(Y).displacementX=M}):s.idToNodeMap.get(B).displacementX=M}}),this.nodesInRelativeVertical.forEach(function(B){if(!s.fixedNodesOnHorizontal.has(B)){var M=0;s.dummyToNodeForHorizontalAlignment.has(B)?M=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(B)[0]).displacementY:M=s.idToNodeMap.get(B).displacementY,s.nodeToRelativeConstraintMapVertical.get(B).forEach(function(Y){if(Y.bottom){var X=s.nodeToTempPositionMapVertical.get(Y.bottom)-s.nodeToTempPositionMapVertical.get(B)-M;X<Y.gap&&(M-=Y.gap-X)}else{var X=s.nodeToTempPositionMapVertical.get(B)-s.nodeToTempPositionMapVertical.get(Y.top)+M;X<Y.gap&&(M+=Y.gap-X)}}),s.nodeToTempPositionMapVertical.set(B,s.nodeToTempPositionMapVertical.get(B)+M),s.dummyToNodeForHorizontalAlignment.has(B)?s.dummyToNodeForHorizontalAlignment.get(B).forEach(function(Y){s.idToNodeMap.get(Y).displacementY=M}):s.idToNodeMap.get(B).displacementY=M}});else{for(var d=0;d<this.componentsOnHorizontal.length;d++){var I=this.componentsOnHorizontal[d];if(this.fixedComponentsOnHorizontal[d])for(var v=0;v<I.length;v++)this.dummyToNodeForVerticalAlignment.has(I[v])?this.dummyToNodeForVerticalAlignment.get(I[v]).forEach(function(Y){s.idToNodeMap.get(Y).displacementX=0}):this.idToNodeMap.get(I[v]).displacementX=0;else{for(var Z=0,tt=0,v=0;v<I.length;v++)if(this.dummyToNodeForVerticalAlignment.has(I[v])){var F=this.dummyToNodeForVerticalAlignment.get(I[v]);Z+=F.length*this.idToNodeMap.get(F[0]).displacementX,tt+=F.length}else Z+=this.idToNodeMap.get(I[v]).displacementX,tt++;for(var _=Z/tt,v=0;v<I.length;v++)this.dummyToNodeForVerticalAlignment.has(I[v])?this.dummyToNodeForVerticalAlignment.get(I[v]).forEach(function(Y){s.idToNodeMap.get(Y).displacementX=_}):this.idToNodeMap.get(I[v]).displacementX=_}}for(var d=0;d<this.componentsOnVertical.length;d++){var I=this.componentsOnVertical[d];if(this.fixedComponentsOnVertical[d])for(var v=0;v<I.length;v++)this.dummyToNodeForHorizontalAlignment.has(I[v])?this.dummyToNodeForHorizontalAlignment.get(I[v]).forEach(function(X){s.idToNodeMap.get(X).displacementY=0}):this.idToNodeMap.get(I[v]).displacementY=0;else{for(var Z=0,tt=0,v=0;v<I.length;v++)if(this.dummyToNodeForHorizontalAlignment.has(I[v])){var F=this.dummyToNodeForHorizontalAlignment.get(I[v]);Z+=F.length*this.idToNodeMap.get(F[0]).displacementY,tt+=F.length}else Z+=this.idToNodeMap.get(I[v]).displacementY,tt++;for(var _=Z/tt,v=0;v<I.length;v++)this.dummyToNodeForHorizontalAlignment.has(I[v])?this.dummyToNodeForHorizontalAlignment.get(I[v]).forEach(function(Lt){s.idToNodeMap.get(Lt).displacementY=_}):this.idToNodeMap.get(I[v]).displacementY=_}}}},x.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],E,d=this.graphManager.getGraphs(),m=d.length,v;for(v=0;v<m;v++)E=d[v],E.updateConnected(),E.isConnected||(s=s.concat(E.getNodes()));return s},x.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var E=new Set,d;for(d=0;d<s.length;d++){var m=s[d];if(!E.has(m)){var v=m.getSource(),D=m.getTarget();if(v==D)m.getBendpoints().push(new p),m.getBendpoints().push(new p),this.createDummyNodesForBendpoints(m),E.add(m);else{var O=[];if(O=O.concat(v.getEdgeListToNode(D)),O=O.concat(D.getEdgeListToNode(v)),!E.has(O[0])){if(O.length>1){var P;for(P=0;P<O.length;P++){var S=O[P];S.getBendpoints().push(new p),this.createDummyNodesForBendpoints(S)}}O.forEach(function(I){E.add(I)})}}}if(E.size==s.length)break}},x.prototype.positionNodesRadially=function(s){for(var E=new y(0,0),d=Math.ceil(Math.sqrt(s.length)),m=0,v=0,D=0,O=new p(0,0),P=0;P<s.length;P++){P%d==0&&(D=0,v=m,P!=0&&(v+=h.DEFAULT_COMPONENT_SEPERATION),m=0);var S=s[P],I=R.findCenterOfTree(S);E.x=D,E.y=v,O=x.radialLayout(S,I,E),O.y>m&&(m=Math.floor(O.y)),D=Math.floor(O.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(N.WORLD_CENTER_X-O.x/2,N.WORLD_CENTER_Y-O.y/2))},x.radialLayout=function(s,E,d){var m=Math.max(this.maxDiagonalInTree(s),h.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(E,null,0,359,0,m);var v=W.calculateBounds(s),D=new G;D.setDeviceOrgX(v.getMinX()),D.setDeviceOrgY(v.getMinY()),D.setWorldOrgX(d.x),D.setWorldOrgY(d.y);for(var O=0;O<s.length;O++){var P=s[O];P.transform(D)}var S=new p(v.getMaxX(),v.getMaxY());return D.inverseTransformPoint(S)},x.branchRadialLayout=function(s,E,d,m,v,D){var O=(m-d+1)/2;O<0&&(O+=180);var P=(O+d)%360,S=P*b.TWO_PI/360,I=Math.cos(S),Z=v*Math.cos(S),tt=v*Math.sin(S);s.setCenter(Z,tt);var F=[];F=F.concat(s.getEdges());var _=F.length;E!=null&&_--;for(var B=0,M=F.length,Y,X=s.getEdgesBetween(E);X.length>1;){var K=X[0];X.splice(0,1);var st=F.indexOf(K);st>=0&&F.splice(st,1),M--,_--}E!=null?Y=(F.indexOf(X[0])+1)%M:Y=0;for(var Lt=Math.abs(m-d)/_,St=Y;B!=_;St=++St%M){var Q=F[St].getOtherEnd(s);if(Q!=E){var Ut=(d+B*Lt)%360,Mt=(Ut+Lt)%360;x.branchRadialLayout(Q,s,Ut,Mt,v+D,D),B++}}},x.maxDiagonalInTree=function(s){for(var E=w.MIN_VALUE,d=0;d<s.length;d++){var m=s[d],v=m.getDiagonal();v>E&&(E=v)}return E},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var s=this,E={};this.memberGroups={},this.idToDummyNode={};for(var d=[],m=this.graphManager.getAllNodes(),v=0;v<m.length;v++){var D=m[v],O=D.getParent();this.getNodeDegreeWithChildren(D)===0&&(O.id==null||!this.getToBeTiled(O))&&d.push(D)}for(var v=0;v<d.length;v++){var D=d[v],P=D.getParent().id;typeof E[P]>"u"&&(E[P]=[]),E[P]=E[P].concat(D)}Object.keys(E).forEach(function(S){if(E[S].length>1){var I="DummyCompound_"+S;s.memberGroups[I]=E[S];var Z=E[S][0].getParent(),tt=new e(s.graphManager);tt.id=I,tt.paddingLeft=Z.paddingLeft||0,tt.paddingRight=Z.paddingRight||0,tt.paddingBottom=Z.paddingBottom||0,tt.paddingTop=Z.paddingTop||0,s.idToDummyNode[I]=tt;var F=s.getGraphManager().add(s.newGraph(),tt),_=Z.getChild();_.add(tt);for(var B=0;B<E[S].length;B++){var M=E[S][B];_.remove(M),F.add(M)}}})},x.prototype.clearCompounds=function(){var s={},E={};this.performDFSOnCompounds();for(var d=0;d<this.compoundOrder.length;d++)E[this.compoundOrder[d].id]=this.compoundOrder[d],s[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(s,E)},x.prototype.clearZeroDegreeMembers=function(){var s=this,E=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(d){var m=s.idToDummyNode[d];if(E[d]=s.tileNodes(s.memberGroups[d],m.paddingLeft+m.paddingRight),m.rect.width=E[d].width,m.rect.height=E[d].height,m.setCenter(E[d].centerX,E[d].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var v=m.rect.width,D=m.rect.height;m.labelWidth&&(m.labelPosHorizontal=="left"?(m.rect.x-=m.labelWidth,m.setWidth(v+m.labelWidth),m.labelMarginLeft=m.labelWidth):m.labelPosHorizontal=="center"&&m.labelWidth>v?(m.rect.x-=(m.labelWidth-v)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-v)/2):m.labelPosHorizontal=="right"&&m.setWidth(v+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(D+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>D?(m.rect.y-=(m.labelHeight-D)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-D)/2):m.labelPosVertical=="bottom"&&m.setHeight(D+m.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var E=this.compoundOrder[s],d=E.id,m=E.paddingLeft,v=E.paddingTop,D=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[d],E.rect.x,E.rect.y,m,v,D,O)}},x.prototype.repopulateZeroDegreeMembers=function(){var s=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(d){var m=s.idToDummyNode[d],v=m.paddingLeft,D=m.paddingTop,O=m.labelMarginLeft,P=m.labelMarginTop;s.adjustLocations(E[d],m.rect.x,m.rect.y,v,D,O,P)})},x.prototype.getToBeTiled=function(s){var E=s.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var d=s.getChild();if(d==null)return this.toBeTiled[E]=!1,!1;for(var m=d.getNodes(),v=0;v<m.length;v++){var D=m[v];if(this.getNodeDegree(D)>0)return this.toBeTiled[E]=!1,!1;if(D.getChild()==null){this.toBeTiled[D.id]=!1;continue}if(!this.getToBeTiled(D))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},x.prototype.getNodeDegree=function(s){for(var E=s.id,d=s.getEdges(),m=0,v=0;v<d.length;v++){var D=d[v];D.getSource().id!==D.getTarget().id&&(m=m+1)}return m},x.prototype.getNodeDegreeWithChildren=function(s){var E=this.getNodeDegree(s);if(s.getChild()==null)return E;for(var d=s.getChild().getNodes(),m=0;m<d.length;m++){var v=d[m];E+=this.getNodeDegreeWithChildren(v)}return E},x.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},x.prototype.fillCompexOrderByDFS=function(s){for(var E=0;E<s.length;E++){var d=s[E];d.getChild()!=null&&this.fillCompexOrderByDFS(d.getChild().getNodes()),this.getToBeTiled(d)&&this.compoundOrder.push(d)}},x.prototype.adjustLocations=function(s,E,d,m,v,D,O){E+=m+D,d+=v+O;for(var P=E,S=0;S<s.rows.length;S++){var I=s.rows[S];E=P;for(var Z=0,tt=0;tt<I.length;tt++){var F=I[tt];F.rect.x=E,F.rect.y=d,E+=F.rect.width+s.horizontalPadding,F.rect.height>Z&&(Z=F.rect.height)}d+=Z+s.verticalPadding}},x.prototype.tileCompoundMembers=function(s,E){var d=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(m){var v=E[m];if(d.tiledMemberPack[m]=d.tileNodes(s[m],v.paddingLeft+v.paddingRight),v.rect.width=d.tiledMemberPack[m].width,v.rect.height=d.tiledMemberPack[m].height,v.setCenter(d.tiledMemberPack[m].centerX,d.tiledMemberPack[m].centerY),v.labelMarginLeft=0,v.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var D=v.rect.width,O=v.rect.height;v.labelWidth&&(v.labelPosHorizontal=="left"?(v.rect.x-=v.labelWidth,v.setWidth(D+v.labelWidth),v.labelMarginLeft=v.labelWidth):v.labelPosHorizontal=="center"&&v.labelWidth>D?(v.rect.x-=(v.labelWidth-D)/2,v.setWidth(v.labelWidth),v.labelMarginLeft=(v.labelWidth-D)/2):v.labelPosHorizontal=="right"&&v.setWidth(D+v.labelWidth)),v.labelHeight&&(v.labelPosVertical=="top"?(v.rect.y-=v.labelHeight,v.setHeight(O+v.labelHeight),v.labelMarginTop=v.labelHeight):v.labelPosVertical=="center"&&v.labelHeight>O?(v.rect.y-=(v.labelHeight-O)/2,v.setHeight(v.labelHeight),v.labelMarginTop=(v.labelHeight-O)/2):v.labelPosVertical=="bottom"&&v.setHeight(O+v.labelHeight))}})},x.prototype.tileNodes=function(s,E){var d=this.tileNodesByFavoringDim(s,E,!0),m=this.tileNodesByFavoringDim(s,E,!1),v=this.getOrgRatio(d),D=this.getOrgRatio(m),O;return D<v?O=m:O=d,O},x.prototype.getOrgRatio=function(s){var E=s.width,d=s.height,m=E/d;return m<1&&(m=1/m),m},x.prototype.calcIdealRowWidth=function(s,E){var d=h.TILING_PADDING_VERTICAL,m=h.TILING_PADDING_HORIZONTAL,v=s.length,D=0,O=0,P=0;s.forEach(function(B){D+=B.getWidth(),O+=B.getHeight(),B.getWidth()>P&&(P=B.getWidth())});var S=D/v,I=O/v,Z=Math.pow(d-m,2)+4*(S+m)*(I+d)*v,tt=(m-d+Math.sqrt(Z))/(2*(S+m)),F;E?(F=Math.ceil(tt),F==tt&&F++):F=Math.floor(tt);var _=F*(S+m)-m;return P>_&&(_=P),_+=m*2,_},x.prototype.tileNodesByFavoringDim=function(s,E,d){var m=h.TILING_PADDING_VERTICAL,v=h.TILING_PADDING_HORIZONTAL,D=h.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:v,centerX:0,centerY:0};D&&(O.idealRowWidth=this.calcIdealRowWidth(s,d));var P=function(M){return M.rect.width*M.rect.height},S=function(M,Y){return P(Y)-P(M)};s.sort(function(B,M){var Y=S;return O.idealRowWidth?(Y=D,Y(B.id,M.id)):Y(B,M)});for(var I=0,Z=0,tt=0;tt<s.length;tt++){var F=s[tt];I+=F.getCenterX(),Z+=F.getCenterY()}O.centerX=I/s.length,O.centerY=Z/s.length;for(var tt=0;tt<s.length;tt++){var F=s[tt];if(O.rows.length==0)this.insertNodeToRow(O,F,0,E);else if(this.canAddHorizontal(O,F.rect.width,F.rect.height)){var _=O.rows.length-1;O.idealRowWidth||(_=this.getShortestRowIndex(O)),this.insertNodeToRow(O,F,_,E)}else this.insertNodeToRow(O,F,O.rows.length,E);this.shiftToLastRow(O)}return O},x.prototype.insertNodeToRow=function(s,E,d,m){var v=m;if(d==s.rows.length){var D=[];s.rows.push(D),s.rowWidth.push(v),s.rowHeight.push(0)}var O=s.rowWidth[d]+E.rect.width;s.rows[d].length>0&&(O+=s.horizontalPadding),s.rowWidth[d]=O,s.width<O&&(s.width=O);var P=E.rect.height;d>0&&(P+=s.verticalPadding);var S=0;P>s.rowHeight[d]&&(S=s.rowHeight[d],s.rowHeight[d]=P,S=s.rowHeight[d]-S),s.height+=S,s.rows[d].push(E)},x.prototype.getShortestRowIndex=function(s){for(var E=-1,d=Number.MAX_VALUE,m=0;m<s.rows.length;m++)s.rowWidth[m]<d&&(E=m,d=s.rowWidth[m]);return E},x.prototype.getLongestRowIndex=function(s){for(var E=-1,d=Number.MIN_VALUE,m=0;m<s.rows.length;m++)s.rowWidth[m]>d&&(E=m,d=s.rowWidth[m]);return E},x.prototype.canAddHorizontal=function(s,E,d){if(s.idealRowWidth){var m=s.rows.length-1,v=s.rowWidth[m];return v+E+s.horizontalPadding<=s.idealRowWidth}var D=this.getShortestRowIndex(s);if(D<0)return!0;var O=s.rowWidth[D];if(O+s.horizontalPadding+E<=s.width)return!0;var P=0;s.rowHeight[D]<d&&D>0&&(P=d+s.verticalPadding-s.rowHeight[D]);var S;s.width-O>=E+s.horizontalPadding?S=(s.height+P)/(O+E+s.horizontalPadding):S=(s.height+P)/s.width,P=d+s.verticalPadding;var I;return s.width<E?I=(s.height+P)/E:I=(s.height+P)/s.width,I<1&&(I=1/I),S<1&&(S=1/S),S<I},x.prototype.shiftToLastRow=function(s){var E=this.getLongestRowIndex(s),d=s.rowWidth.length-1,m=s.rows[E],v=m[m.length-1],D=v.width+s.horizontalPadding;if(s.width-s.rowWidth[d]>D&&E!=d){m.splice(-1,1),s.rows[d].push(v),s.rowWidth[E]=s.rowWidth[E]-D,s.rowWidth[d]=s.rowWidth[d]+D,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var O=Number.MIN_VALUE,P=0;P<m.length;P++)m[P].height>O&&(O=m[P].height);E>0&&(O+=s.verticalPadding);var S=s.rowHeight[E]+s.rowHeight[d];s.rowHeight[E]=O,s.rowHeight[d]<v.height+s.verticalPadding&&(s.rowHeight[d]=v.height+s.verticalPadding);var I=s.rowHeight[E]+s.rowHeight[d];s.height+=I-S,this.shiftToLastRow(s)}},x.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},x.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},x.prototype.reduceTrees=function(){for(var s=[],E=!0,d;E;){var m=this.graphManager.getAllNodes(),v=[];E=!1;for(var D=0;D<m.length;D++)if(d=m[D],d.getEdges().length==1&&!d.getEdges()[0].isInterGraph&&d.getChild()==null){if(h.PURE_INCREMENTAL){var O=d.getEdges()[0].getOtherEnd(d),P=new L(d.getCenterX()-O.getCenterX(),d.getCenterY()-O.getCenterY());v.push([d,d.getEdges()[0],d.getOwner(),P])}else v.push([d,d.getEdges()[0],d.getOwner()]);E=!0}if(E==!0){for(var S=[],I=0;I<v.length;I++)v[I][0].getEdges().length==1&&(S.push(v[I]),v[I][0].getOwner().remove(v[I][0]));s.push(S),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},x.prototype.growTree=function(s){for(var E=s.length,d=s[E-1],m,v=0;v<d.length;v++)m=d[v],this.findPlaceforPrunedNode(m),m[2].add(m[0]),m[2].add(m[1],m[1].source,m[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},x.prototype.findPlaceforPrunedNode=function(s){var E,d,m=s[0];if(m==s[1].source?d=s[1].target:d=s[1].source,h.PURE_INCREMENTAL)m.setCenter(d.getCenterX()+s[3].getWidth(),d.getCenterY()+s[3].getHeight());else{var v=d.startX,D=d.finishX,O=d.startY,P=d.finishY,S=0,I=0,Z=0,tt=0,F=[S,Z,I,tt];if(O>0)for(var _=v;_<=D;_++)F[0]+=this.grid[_][O-1].length+this.grid[_][O].length-1;if(D<this.grid.length-1)for(var _=O;_<=P;_++)F[1]+=this.grid[D+1][_].length+this.grid[D][_].length-1;if(P<this.grid[0].length-1)for(var _=v;_<=D;_++)F[2]+=this.grid[_][P+1].length+this.grid[_][P].length-1;if(v>0)for(var _=O;_<=P;_++)F[3]+=this.grid[v-1][_].length+this.grid[v][_].length-1;for(var B=w.MAX_VALUE,M,Y,X=0;X<F.length;X++)F[X]<B?(B=F[X],M=1,Y=X):F[X]==B&&M++;if(M==3&&B==0)F[0]==0&&F[1]==0&&F[2]==0?E=1:F[0]==0&&F[1]==0&&F[3]==0?E=0:F[0]==0&&F[2]==0&&F[3]==0?E=3:F[1]==0&&F[2]==0&&F[3]==0&&(E=2);else if(M==2&&B==0){var K=Math.floor(Math.random()*2);F[0]==0&&F[1]==0?K==0?E=0:E=1:F[0]==0&&F[2]==0?K==0?E=0:E=2:F[0]==0&&F[3]==0?K==0?E=0:E=3:F[1]==0&&F[2]==0?K==0?E=1:E=2:F[1]==0&&F[3]==0?K==0?E=1:E=3:K==0?E=2:E=3}else if(M==4&&B==0){var K=Math.floor(Math.random()*4);E=K}else E=Y;E==0?m.setCenter(d.getCenterX(),d.getCenterY()-d.getHeight()/2-o.DEFAULT_EDGE_LENGTH-m.getHeight()/2):E==1?m.setCenter(d.getCenterX()+d.getWidth()/2+o.DEFAULT_EDGE_LENGTH+m.getWidth()/2,d.getCenterY()):E==2?m.setCenter(d.getCenterX(),d.getCenterY()+d.getHeight()/2+o.DEFAULT_EDGE_LENGTH+m.getHeight()/2):m.setCenter(d.getCenterX()-d.getWidth()/2-o.DEFAULT_EDGE_LENGTH-m.getWidth()/2,d.getCenterY())}},n.exports=x}),991:((n,i,a)=>{var f=a(551).FDLayoutNode,t=a(551).IMath;function c(r,h,g,o){f.call(this,r,h,g,o)}c.prototype=Object.create(f.prototype);for(var e in f)c[e]=f[e];c.prototype.calculateDisplacement=function(){var r=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementX=r.coolingFactor*r.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementY=r.coolingFactor*r.maxNodeDisplacement*t.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},c.prototype.propogateDisplacementToChildren=function(r,h){for(var g=this.getChild().getNodes(),o,N=0;N<g.length;N++)o=g[N],o.getChild()==null?(o.displacementX+=r,o.displacementY+=h):o.propogateDisplacementToChildren(r,h)},c.prototype.move=function(){var r=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),r.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},c.prototype.setPred1=function(r){this.pred1=r},c.prototype.getPred1=function(){return pred1},c.prototype.getPred2=function(){return pred2},c.prototype.setNext=function(r){this.next=r},c.prototype.getNext=function(){return next},c.prototype.setProcessed=function(r){this.processed=r},c.prototype.isProcessed=function(){return processed},n.exports=c}),902:((n,i,a)=>{function f(g){if(Array.isArray(g)){for(var o=0,N=Array(g.length);o<g.length;o++)N[o]=g[o];return N}else return Array.from(g)}var t=a(806),c=a(551).LinkedList,e=a(551).Matrix,r=a(551).SVD;function h(){}h.handleConstraints=function(g){var o={};o.fixedNodeConstraint=g.constraints.fixedNodeConstraint,o.alignmentConstraint=g.constraints.alignmentConstraint,o.relativePlacementConstraint=g.constraints.relativePlacementConstraint;for(var N=new Map,y=new Map,p=[],L=[],R=g.getAllNodes(),w=0,b=0;b<R.length;b++){var W=R[b];W.getChild()==null&&(y.set(W.id,w++),p.push(W.getCenterX()),L.push(W.getCenterY()),N.set(W.id,W))}o.relativePlacementConstraint&&o.relativePlacementConstraint.forEach(function(U){!U.gap&&U.gap!=0&&(U.left?U.gap=t.DEFAULT_EDGE_LENGTH+N.get(U.left).getWidth()/2+N.get(U.right).getWidth()/2:U.gap=t.DEFAULT_EDGE_LENGTH+N.get(U.top).getHeight()/2+N.get(U.bottom).getHeight()/2)});var G=function(H,V){return{x:H.x-V.x,y:H.y-V.y}},J=function(H){var V=0,$=0;return H.forEach(function(k){V+=p[y.get(k)],$+=L[y.get(k)]}),{x:V/H.size,y:$/H.size}},x=function(H,V,$,k,j){function ut(ot,it){var dt=new Set(ot),at=!0,lt=!1,Ft=void 0;try{for(var xt=it[Symbol.iterator](),Vt;!(at=(Vt=xt.next()).done);at=!0){var Dt=Vt.value;dt.add(Dt)}}catch(Nt){lt=!0,Ft=Nt}finally{try{!at&&xt.return&&xt.return()}finally{if(lt)throw Ft}}return dt}var ft=new Map;H.forEach(function(ot,it){ft.set(it,0)}),H.forEach(function(ot,it){ot.forEach(function(dt){ft.set(dt.id,ft.get(dt.id)+1)})});var q=new Map,ht=new Map,gt=new c;ft.forEach(function(ot,it){ot==0?(gt.push(it),$||(V=="horizontal"?q.set(it,y.has(it)?p[y.get(it)]:k.get(it)):q.set(it,y.has(it)?L[y.get(it)]:k.get(it)))):q.set(it,Number.NEGATIVE_INFINITY),$&&ht.set(it,new Set([it]))}),$&&j.forEach(function(ot){var it=[];if(ot.forEach(function(lt){$.has(lt)&&it.push(lt)}),it.length>0){var dt=0;it.forEach(function(lt){V=="horizontal"?(q.set(lt,y.has(lt)?p[y.get(lt)]:k.get(lt)),dt+=q.get(lt)):(q.set(lt,y.has(lt)?L[y.get(lt)]:k.get(lt)),dt+=q.get(lt))}),dt=dt/it.length,ot.forEach(function(lt){$.has(lt)||q.set(lt,dt)})}else{var at=0;ot.forEach(function(lt){V=="horizontal"?at+=y.has(lt)?p[y.get(lt)]:k.get(lt):at+=y.has(lt)?L[y.get(lt)]:k.get(lt)}),at=at/ot.length,ot.forEach(function(lt){q.set(lt,at)})}});for(var rt=function(){var it=gt.shift(),dt=H.get(it);dt.forEach(function(at){if(q.get(at.id)<q.get(it)+at.gap)if($&&$.has(at.id)){var lt=void 0;if(V=="horizontal"?lt=y.has(at.id)?p[y.get(at.id)]:k.get(at.id):lt=y.has(at.id)?L[y.get(at.id)]:k.get(at.id),q.set(at.id,lt),lt<q.get(it)+at.gap){var Ft=q.get(it)+at.gap-lt;ht.get(it).forEach(function(xt){q.set(xt,q.get(xt)-Ft)})}}else q.set(at.id,q.get(it)+at.gap);ft.set(at.id,ft.get(at.id)-1),ft.get(at.id)==0&>.push(at.id),$&&ht.set(at.id,ut(ht.get(it),ht.get(at.id)))})};gt.length!=0;)rt();if($){var vt=new Set;H.forEach(function(ot,it){ot.length==0&&vt.add(it)});var At=[];ht.forEach(function(ot,it){if(vt.has(it)){var dt=!1,at=!0,lt=!1,Ft=void 0;try{for(var xt=ot[Symbol.iterator](),Vt;!(at=(Vt=xt.next()).done);at=!0){var Dt=Vt.value;$.has(Dt)&&(dt=!0)}}catch(Rt){lt=!0,Ft=Rt}finally{try{!at&&xt.return&&xt.return()}finally{if(lt)throw Ft}}if(!dt){var Nt=!1,$t=void 0;At.forEach(function(Rt,Xt){Rt.has([].concat(f(ot))[0])&&(Nt=!0,$t=Xt)}),Nt?ot.forEach(function(Rt){At[$t].add(Rt)}):At.push(new Set(ot))}}}),At.forEach(function(ot,it){var dt=Number.POSITIVE_INFINITY,at=Number.POSITIVE_INFINITY,lt=Number.NEGATIVE_INFINITY,Ft=Number.NEGATIVE_INFINITY,xt=!0,Vt=!1,Dt=void 0;try{for(var Nt=ot[Symbol.iterator](),$t;!(xt=($t=Nt.next()).done);xt=!0){var Rt=$t.value,Xt=void 0;V=="horizontal"?Xt=y.has(Rt)?p[y.get(Rt)]:k.get(Rt):Xt=y.has(Rt)?L[y.get(Rt)]:k.get(Rt);var zt=q.get(Rt);Xt<dt&&(dt=Xt),Xt>lt&&(lt=Xt),zt<at&&(at=zt),zt>Ft&&(Ft=zt)}}catch(_t){Vt=!0,Dt=_t}finally{try{!xt&&Nt.return&&Nt.return()}finally{if(Vt)throw Dt}}var ge=(dt+lt)/2-(at+Ft)/2,qt=!0,Jt=!1,Kt=void 0;try{for(var Qt=ot[Symbol.iterator](),se;!(qt=(se=Qt.next()).done);qt=!0){var jt=se.value;q.set(jt,q.get(jt)+ge)}}catch(_t){Jt=!0,Kt=_t}finally{try{!qt&&Qt.return&&Qt.return()}finally{if(Jt)throw Kt}}})}return q},z=function(H){var V=0,$=0,k=0,j=0;if(H.forEach(function(ht){ht.left?p[y.get(ht.left)]-p[y.get(ht.right)]>=0?V++:$++:L[y.get(ht.top)]-L[y.get(ht.bottom)]>=0?k++:j++}),V>$&&k>j)for(var ut=0;ut<y.size;ut++)p[ut]=-1*p[ut],L[ut]=-1*L[ut];else if(V>$)for(var ft=0;ft<y.size;ft++)p[ft]=-1*p[ft];else if(k>j)for(var q=0;q<y.size;q++)L[q]=-1*L[q]},s=function(H){var V=[],$=new c,k=new Set,j=0;return H.forEach(function(ut,ft){if(!k.has(ft)){V[j]=[];var q=ft;for($.push(q),k.add(q),V[j].push(q);$.length!=0;){q=$.shift();var ht=H.get(q);ht.forEach(function(gt){k.has(gt.id)||($.push(gt.id),k.add(gt.id),V[j].push(gt.id))})}j++}}),V},E=function(H){var V=new Map;return H.forEach(function($,k){V.set(k,[])}),H.forEach(function($,k){$.forEach(function(j){V.get(k).push(j),V.get(j.id).push({id:k,gap:j.gap,direction:j.direction})})}),V},d=function(H){var V=new Map;return H.forEach(function($,k){V.set(k,[])}),H.forEach(function($,k){$.forEach(function(j){V.get(j.id).push({id:k,gap:j.gap,direction:j.direction})})}),V},m=[],v=[],D=!1,O=!1,P=new Set,S=new Map,I=new Map,Z=[];if(o.fixedNodeConstraint&&o.fixedNodeConstraint.forEach(function(U){P.add(U.nodeId)}),o.relativePlacementConstraint&&(o.relativePlacementConstraint.forEach(function(U){U.left?(S.has(U.left)?S.get(U.left).push({id:U.right,gap:U.gap,direction:"horizontal"}):S.set(U.left,[{id:U.right,gap:U.gap,direction:"horizontal"}]),S.has(U.right)||S.set(U.right,[])):(S.has(U.top)?S.get(U.top).push({id:U.bottom,gap:U.gap,direction:"vertical"}):S.set(U.top,[{id:U.bottom,gap:U.gap,direction:"vertical"}]),S.has(U.bottom)||S.set(U.bottom,[]))}),I=E(S),Z=s(I)),t.TRANSFORM_ON_CONSTRAINT_HANDLING){if(o.fixedNodeConstraint&&o.fixedNodeConstraint.length>1)o.fixedNodeConstraint.forEach(function(U,H){m[H]=[U.position.x,U.position.y],v[H]=[p[y.get(U.nodeId)],L[y.get(U.nodeId)]]}),D=!0;else if(o.alignmentConstraint)(function(){var U=0;if(o.alignmentConstraint.vertical){for(var H=o.alignmentConstraint.vertical,V=function(q){var ht=new Set;H[q].forEach(function(vt){ht.add(vt)});var gt=new Set([].concat(f(ht)).filter(function(vt){return P.has(vt)})),rt=void 0;gt.size>0?rt=p[y.get(gt.values().next().value)]:rt=J(ht).x,H[q].forEach(function(vt){m[U]=[rt,L[y.get(vt)]],v[U]=[p[y.get(vt)],L[y.get(vt)]],U++})},$=0;$<H.length;$++)V($);D=!0}if(o.alignmentConstraint.horizontal){for(var k=o.alignmentConstraint.horizontal,j=function(q){var ht=new Set;k[q].forEach(function(vt){ht.add(vt)});var gt=new Set([].concat(f(ht)).filter(function(vt){return P.has(vt)})),rt=void 0;gt.size>0?rt=p[y.get(gt.values().next().value)]:rt=J(ht).y,k[q].forEach(function(vt){m[U]=[p[y.get(vt)],rt],v[U]=[p[y.get(vt)],L[y.get(vt)]],U++})},ut=0;ut<k.length;ut++)j(ut);D=!0}o.relativePlacementConstraint&&(O=!0)})();else if(o.relativePlacementConstraint){for(var tt=0,F=0,_=0;_<Z.length;_++)Z[_].length>tt&&(tt=Z[_].length,F=_);if(tt<I.size/2)z(o.relativePlacementConstraint),D=!1,O=!1;else{var B=new Map,M=new Map,Y=[];Z[F].forEach(function(U){S.get(U).forEach(function(H){H.direction=="horizontal"?(B.has(U)?B.get(U).push(H):B.set(U,[H]),B.has(H.id)||B.set(H.id,[]),Y.push({left:U,right:H.id})):(M.has(U)?M.get(U).push(H):M.set(U,[H]),M.has(H.id)||M.set(H.id,[]),Y.push({top:U,bottom:H.id}))})}),z(Y),O=!1;var X=x(B,"horizontal"),K=x(M,"vertical");Z[F].forEach(function(U,H){v[H]=[p[y.get(U)],L[y.get(U)]],m[H]=[],X.has(U)?m[H][0]=X.get(U):m[H][0]=p[y.get(U)],K.has(U)?m[H][1]=K.get(U):m[H][1]=L[y.get(U)]}),D=!0}}if(D){for(var st=void 0,Lt=e.transpose(m),St=e.transpose(v),Q=0;Q<Lt.length;Q++)Lt[Q]=e.multGamma(Lt[Q]),St[Q]=e.multGamma(St[Q]);var Ut=e.multMat(Lt,e.transpose(St)),Mt=r.svd(Ut);st=e.multMat(Mt.V,e.transpose(Mt.U));for(var nt=0;nt<y.size;nt++){var et=[p[nt],L[nt]],pt=[st[0][0],st[1][0]],Et=[st[0][1],st[1][1]];p[nt]=e.dotProduct(et,pt),L[nt]=e.dotProduct(et,Et)}O&&z(o.relativePlacementConstraint)}}if(t.ENFORCE_CONSTRAINTS){if(o.fixedNodeConstraint&&o.fixedNodeConstraint.length>0){var Ct={x:0,y:0};o.fixedNodeConstraint.forEach(function(U,H){var V={x:p[y.get(U.nodeId)],y:L[y.get(U.nodeId)]},$=U.position,k=G($,V);Ct.x+=k.x,Ct.y+=k.y}),Ct.x/=o.fixedNodeConstraint.length,Ct.y/=o.fixedNodeConstraint.length,p.forEach(function(U,H){p[H]+=Ct.x}),L.forEach(function(U,H){L[H]+=Ct.y}),o.fixedNodeConstraint.forEach(function(U){p[y.get(U.nodeId)]=U.position.x,L[y.get(U.nodeId)]=U.position.y})}if(o.alignmentConstraint){if(o.alignmentConstraint.vertical)for(var mt=o.alignmentConstraint.vertical,Tt=function(H){var V=new Set;mt[H].forEach(function(j){V.add(j)});var $=new Set([].concat(f(V)).filter(function(j){return P.has(j)})),k=void 0;$.size>0?k=p[y.get($.values().next().value)]:k=J(V).x,V.forEach(function(j){P.has(j)||(p[y.get(j)]=k)})},Ot=0;Ot<mt.length;Ot++)Tt(Ot);if(o.alignmentConstraint.horizontal)for(var It=o.alignmentConstraint.horizontal,Wt=function(H){var V=new Set;It[H].forEach(function(j){V.add(j)});var $=new Set([].concat(f(V)).filter(function(j){return P.has(j)})),k=void 0;$.size>0?k=L[y.get($.values().next().value)]:k=J(V).y,V.forEach(function(j){P.has(j)||(L[y.get(j)]=k)})},Pt=0;Pt<It.length;Pt++)Wt(Pt)}o.relativePlacementConstraint&&(function(){var U=new Map,H=new Map,V=new Map,$=new Map,k=new Map,j=new Map,ut=new Set,ft=new Set;if(P.forEach(function(Gt){ut.add(Gt),ft.add(Gt)}),o.alignmentConstraint){if(o.alignmentConstraint.vertical)for(var q=o.alignmentConstraint.vertical,ht=function(yt){V.set("dummy"+yt,[]),q[yt].forEach(function(wt){U.set(wt,"dummy"+yt),V.get("dummy"+yt).push(wt),P.has(wt)&&ut.add("dummy"+yt)}),k.set("dummy"+yt,p[y.get(q[yt][0])])},gt=0;gt<q.length;gt++)ht(gt);if(o.alignmentConstraint.horizontal)for(var rt=o.alignmentConstraint.horizontal,vt=function(yt){$.set("dummy"+yt,[]),rt[yt].forEach(function(wt){H.set(wt,"dummy"+yt),$.get("dummy"+yt).push(wt),P.has(wt)&&ft.add("dummy"+yt)}),j.set("dummy"+yt,L[y.get(rt[yt][0])])},At=0;At<rt.length;At++)vt(At)}var ot=new Map,it=new Map,dt=function(yt){S.get(yt).forEach(function(wt){var kt=void 0,Bt=void 0;wt.direction=="horizontal"?(kt=U.get(yt)?U.get(yt):yt,U.get(wt.id)?Bt={id:U.get(wt.id),gap:wt.gap,direction:wt.direction}:Bt=wt,ot.has(kt)?ot.get(kt).push(Bt):ot.set(kt,[Bt]),ot.has(Bt.id)||ot.set(Bt.id,[])):(kt=H.get(yt)?H.get(yt):yt,H.get(wt.id)?Bt={id:H.get(wt.id),gap:wt.gap,direction:wt.direction}:Bt=wt,it.has(kt)?it.get(kt).push(Bt):it.set(kt,[Bt]),it.has(Bt.id)||it.set(Bt.id,[]))})},at=!0,lt=!1,Ft=void 0;try{for(var xt=S.keys()[Symbol.iterator](),Vt;!(at=(Vt=xt.next()).done);at=!0){var Dt=Vt.value;dt(Dt)}}catch(Gt){lt=!0,Ft=Gt}finally{try{!at&&xt.return&&xt.return()}finally{if(lt)throw Ft}}var Nt=E(ot),$t=E(it),Rt=s(Nt),Xt=s($t),zt=d(ot),ge=d(it),qt=[],Jt=[];Rt.forEach(function(Gt,yt){qt[yt]=[],Gt.forEach(function(wt){zt.get(wt).length==0&&qt[yt].push(wt)})}),Xt.forEach(function(Gt,yt){Jt[yt]=[],Gt.forEach(function(wt){ge.get(wt).length==0&&Jt[yt].push(wt)})});var Kt=x(ot,"horizontal",ut,k,qt),Qt=x(it,"vertical",ft,j,Jt),se=function(yt){V.get(yt)?V.get(yt).forEach(function(wt){p[y.get(wt)]=Kt.get(yt)}):p[y.get(yt)]=Kt.get(yt)},jt=!0,_t=!1,Oe=void 0;try{for(var ue=Kt.keys()[Symbol.iterator](),De;!(jt=(De=ue.next()).done);jt=!0){var de=De.value;se(de)}}catch(Gt){_t=!0,Oe=Gt}finally{try{!jt&&ue.return&&ue.return()}finally{if(_t)throw Oe}}var ur=function(yt){$.get(yt)?$.get(yt).forEach(function(wt){L[y.get(wt)]=Qt.get(yt)}):L[y.get(yt)]=Qt.get(yt)},ve=!0,xe=!1,Ie=void 0;try{for(var pe=Qt.keys()[Symbol.iterator](),Re;!(ve=(Re=pe.next()).done);ve=!0){var de=Re.value;ur(de)}}catch(Gt){xe=!0,Ie=Gt}finally{try{!ve&&pe.return&&pe.return()}finally{if(xe)throw Ie}}})()}for(var Yt=0;Yt<R.length;Yt++){var bt=R[Yt];bt.getChild()==null&&bt.setCenter(p[y.get(bt.id)],L[y.get(bt.id)])}},n.exports=h}),551:(n=>{n.exports=C})},T={};function u(n){var i=T[n];if(i!==void 0)return i.exports;var a=T[n]={exports:{}};return A[n](a,a.exports,u),a.exports}var l=u(45);return l})()})});var Ke=ye((ne,Ae)=>{(function(A,T){typeof ne=="object"&&typeof Ae=="object"?Ae.exports=T(Ce()):typeof define=="function"&&define.amd?define(["cose-base"],T):typeof ne=="object"?ne.cytoscapeFcose=T(Ce()):A.cytoscapeFcose=T(A.coseBase)})(ne,function(C){return(()=>{"use strict";var A={658:(n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var a=arguments.length,f=Array(a>1?a-1:0),t=1;t<a;t++)f[t-1]=arguments[t];return f.forEach(function(c){Object.keys(c).forEach(function(e){return i[e]=c[e]})}),i}}),548:((n,i,a)=>{var f=(function(){function e(r,h){var g=[],o=!0,N=!1,y=void 0;try{for(var p=r[Symbol.iterator](),L;!(o=(L=p.next()).done)&&(g.push(L.value),!(h&&g.length===h));o=!0);}catch(R){N=!0,y=R}finally{try{!o&&p.return&&p.return()}finally{if(N)throw y}}return g}return function(r,h){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),t=a(140).layoutBase.LinkedList,c={};c.getTopMostNodes=function(e){for(var r={},h=0;h<e.length;h++)r[e[h].id()]=!0;var g=e.filter(function(o,N){typeof o=="number"&&(o=N);for(var y=o.parent()[0];y!=null;){if(r[y.id()])return!1;y=y.parent()[0]}return!0});return g},c.connectComponents=function(e,r,h,g){var o=new t,N=new Set,y=[],p=void 0,L=void 0,R=void 0,w=!1,b=1,W=[],G=[],J=function(){var z=e.collection();G.push(z);var s=h[0],E=e.collection();E.merge(s).merge(s.descendants().intersection(r)),y.push(s),E.forEach(function(v){o.push(v),N.add(v),z.merge(v)});for(var d=function(){s=o.shift();var D=e.collection();s.neighborhood().nodes().forEach(function(I){r.intersection(s.edgesWith(I)).length>0&&D.merge(I)});for(var O=0;O<D.length;O++){var P=D[O];if(p=h.intersection(P.union(P.ancestors())),p!=null&&!N.has(p[0])){var S=p.union(p.descendants());S.forEach(function(I){o.push(I),N.add(I),z.merge(I),h.has(I)&&y.push(I)})}}};o.length!=0;)d();if(z.forEach(function(v){r.intersection(v.connectedEdges()).forEach(function(D){z.has(D.source())&&z.has(D.target())&&z.merge(D)})}),y.length==h.length&&(w=!0),!w||w&&b>1){L=y[0],R=L.connectedEdges().length,y.forEach(function(v){v.connectedEdges().length<R&&(R=v.connectedEdges().length,L=v)}),W.push(L.id());var m=e.collection();m.merge(y[0]),y.forEach(function(v){m.merge(v)}),y=[],h=h.difference(m),b++}};do J();while(!w);return g&&W.length>0&&g.set("dummy"+(g.size+1),W),G},c.relocateComponent=function(e,r,h){if(!h.fixedNodeConstraint){var g=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY;if(h.quality=="draft"){var p=!0,L=!1,R=void 0;try{for(var w=r.nodeIndexes[Symbol.iterator](),b;!(p=(b=w.next()).done);p=!0){var W=b.value,G=f(W,2),J=G[0],x=G[1],z=h.cy.getElementById(J);if(z){var s=z.boundingBox(),E=r.xCoords[x]-s.w/2,d=r.xCoords[x]+s.w/2,m=r.yCoords[x]-s.h/2,v=r.yCoords[x]+s.h/2;E<g&&(g=E),d>o&&(o=d),m<N&&(N=m),v>y&&(y=v)}}}catch(I){L=!0,R=I}finally{try{!p&&w.return&&w.return()}finally{if(L)throw R}}var D=e.x-(o+g)/2,O=e.y-(y+N)/2;r.xCoords=r.xCoords.map(function(I){return I+D}),r.yCoords=r.yCoords.map(function(I){return I+O})}else{Object.keys(r).forEach(function(I){var Z=r[I],tt=Z.getRect().x,F=Z.getRect().x+Z.getRect().width,_=Z.getRect().y,B=Z.getRect().y+Z.getRect().height;tt<g&&(g=tt),F>o&&(o=F),_<N&&(N=_),B>y&&(y=B)});var P=e.x-(o+g)/2,S=e.y-(y+N)/2;Object.keys(r).forEach(function(I){var Z=r[I];Z.setCenter(Z.getCenterX()+P,Z.getCenterY()+S)})}}},c.calcBoundingBox=function(e,r,h,g){for(var o=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,y=Number.MAX_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER,L=void 0,R=void 0,w=void 0,b=void 0,W=e.descendants().not(":parent"),G=W.length,J=0;J<G;J++){var x=W[J];L=r[g.get(x.id())]-x.width()/2,R=r[g.get(x.id())]+x.width()/2,w=h[g.get(x.id())]-x.height()/2,b=h[g.get(x.id())]+x.height()/2,o>L&&(o=L),N<R&&(N=R),y>w&&(y=w),p<b&&(p=b)}var z={};return z.topLeftX=o,z.topLeftY=y,z.width=N-o,z.height=p-y,z},c.calcParentsWithoutChildren=function(e,r){var h=e.collection();return r.nodes(":parent").forEach(function(g){var o=!1;g.children().forEach(function(N){N.css("display")!="none"&&(o=!0)}),o||h.merge(g)}),h},n.exports=c}),816:((n,i,a)=>{var f=a(548),t=a(140).CoSELayout,c=a(140).CoSENode,e=a(140).layoutBase.PointD,r=a(140).layoutBase.DimensionD,h=a(140).layoutBase.LayoutConstants,g=a(140).layoutBase.FDLayoutConstants,o=a(140).CoSEConstants,N=function(p,L){var R=p.cy,w=p.eles,b=w.nodes(),W=w.edges(),G=void 0,J=void 0,x=void 0,z={};p.randomize&&(G=L.nodeIndexes,J=L.xCoords,x=L.yCoords);var s=function(I){return typeof I=="function"},E=function(I,Z){return s(I)?I(Z):I},d=f.calcParentsWithoutChildren(R,w),m=function S(I,Z,tt,F){for(var _=Z.length,B=0;B<_;B++){var M=Z[B],Y=null;M.intersection(d).length==0&&(Y=M.children());var X=void 0,K=M.layoutDimensions({nodeDimensionsIncludeLabels:F.nodeDimensionsIncludeLabels});if(M.outerWidth()!=null&&M.outerHeight()!=null)if(F.randomize)if(!M.isParent())X=I.add(new c(tt.graphManager,new e(J[G.get(M.id())]-K.w/2,x[G.get(M.id())]-K.h/2),new r(parseFloat(K.w),parseFloat(K.h))));else{var st=f.calcBoundingBox(M,J,x,G);M.intersection(d).length==0?X=I.add(new c(tt.graphManager,new e(st.topLeftX,st.topLeftY),new r(st.width,st.height))):X=I.add(new c(tt.graphManager,new e(st.topLeftX,st.topLeftY),new r(parseFloat(K.w),parseFloat(K.h))))}else X=I.add(new c(tt.graphManager,new e(M.position("x")-K.w/2,M.position("y")-K.h/2),new r(parseFloat(K.w),parseFloat(K.h))));else X=I.add(new c(this.graphManager));if(X.id=M.data("id"),X.nodeRepulsion=E(F.nodeRepulsion,M),X.paddingLeft=parseInt(M.css("padding")),X.paddingTop=parseInt(M.css("padding")),X.paddingRight=parseInt(M.css("padding")),X.paddingBottom=parseInt(M.css("padding")),F.nodeDimensionsIncludeLabels&&(X.labelWidth=M.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,X.labelHeight=M.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,X.labelPosVertical=M.css("text-valign"),X.labelPosHorizontal=M.css("text-halign")),z[M.data("id")]=X,isNaN(X.rect.x)&&(X.rect.x=0),isNaN(X.rect.y)&&(X.rect.y=0),Y!=null&&Y.length>0){var Lt=void 0;Lt=tt.getGraphManager().add(tt.newGraph(),X),S(Lt,Y,tt,F)}}},v=function(I,Z,tt){for(var F=0,_=0,B=0;B<tt.length;B++){var M=tt[B],Y=z[M.data("source")],X=z[M.data("target")];if(Y&&X&&Y!==X&&Y.getEdgesBetween(X).length==0){var K=Z.add(I.newEdge(),Y,X);K.id=M.id(),K.idealLength=E(p.idealEdgeLength,M),K.edgeElasticity=E(p.edgeElasticity,M),F+=K.idealLength,_++}}p.idealEdgeLength!=null&&(_>0?o.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=F/_:s(p.idealEdgeLength)?o.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50:o.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=p.idealEdgeLength,o.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,o.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH)},D=function(I,Z){Z.fixedNodeConstraint&&(I.constraints.fixedNodeConstraint=Z.fixedNodeConstraint),Z.alignmentConstraint&&(I.constraints.alignmentConstraint=Z.alignmentConstraint),Z.relativePlacementConstraint&&(I.constraints.relativePlacementConstraint=Z.relativePlacementConstraint)};p.nestingFactor!=null&&(o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=p.nestingFactor),p.gravity!=null&&(o.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=p.gravity),p.numIter!=null&&(o.MAX_ITERATIONS=g.MAX_ITERATIONS=p.numIter),p.gravityRange!=null&&(o.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=p.gravityRange),p.gravityCompound!=null&&(o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=p.gravityCompound),p.gravityRangeCompound!=null&&(o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=p.gravityRangeCompound),p.initialEnergyOnIncremental!=null&&(o.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=p.initialEnergyOnIncremental),p.tilingCompareBy!=null&&(o.TILING_COMPARE_BY=p.tilingCompareBy),p.quality=="proof"?h.QUALITY=2:h.QUALITY=0,o.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=p.nodeDimensionsIncludeLabels,o.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!p.randomize,o.ANIMATE=g.ANIMATE=h.ANIMATE=p.animate,o.TILE=p.tile,o.TILING_PADDING_VERTICAL=typeof p.tilingPaddingVertical=="function"?p.tilingPaddingVertical.call():p.tilingPaddingVertical,o.TILING_PADDING_HORIZONTAL=typeof p.tilingPaddingHorizontal=="function"?p.tilingPaddingHorizontal.call():p.tilingPaddingHorizontal,o.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,o.PURE_INCREMENTAL=!p.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=p.uniformNodeDimensions,p.step=="transformed"&&(o.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,o.ENFORCE_CONSTRAINTS=!1,o.APPLY_LAYOUT=!1),p.step=="enforced"&&(o.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,o.ENFORCE_CONSTRAINTS=!0,o.APPLY_LAYOUT=!1),p.step=="cose"&&(o.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,o.ENFORCE_CONSTRAINTS=!1,o.APPLY_LAYOUT=!0),p.step=="all"&&(p.randomize?o.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:o.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,o.ENFORCE_CONSTRAINTS=!0,o.APPLY_LAYOUT=!0),p.fixedNodeConstraint||p.alignmentConstraint||p.relativePlacementConstraint?o.TREE_REDUCTION_ON_INCREMENTAL=!1:o.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new t,P=O.newGraphManager();return m(P.addRoot(),f.getTopMostNodes(b),O,p),v(O,P,W),D(O,p),O.runLayout(),z};n.exports={coseLayout:N}}),212:((n,i,a)=>{var f=(function(){function p(L,R){for(var w=0;w<R.length;w++){var b=R[w];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(L,b.key,b)}}return function(L,R,w){return R&&p(L.prototype,R),w&&p(L,w),L}})();function t(p,L){if(!(p instanceof L))throw new TypeError("Cannot call a class as a function")}var c=a(658),e=a(548),r=a(657),h=r.spectralLayout,g=a(816),o=g.coseLayout,N=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(L){return 4500},idealEdgeLength:function(L){return 50},edgeElasticity:function(L){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),y=(function(){function p(L){t(this,p),this.options=c({},N,L)}return f(p,[{key:"run",value:function(){var R=this,w=this.options,b=w.cy,W=w.eles,G=[],J=void 0,x=void 0,z=[],s=void 0,E=[];w.fixedNodeConstraint&&(!Array.isArray(w.fixedNodeConstraint)||w.fixedNodeConstraint.length==0)&&(w.fixedNodeConstraint=void 0),w.alignmentConstraint&&(w.alignmentConstraint.vertical&&(!Array.isArray(w.alignmentConstraint.vertical)||w.alignmentConstraint.vertical.length==0)&&(w.alignmentConstraint.vertical=void 0),w.alignmentConstraint.horizontal&&(!Array.isArray(w.alignmentConstraint.horizontal)||w.alignmentConstraint.horizontal.length==0)&&(w.alignmentConstraint.horizontal=void 0)),w.relativePlacementConstraint&&(!Array.isArray(w.relativePlacementConstraint)||w.relativePlacementConstraint.length==0)&&(w.relativePlacementConstraint=void 0);var d=w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint;d&&(w.tile=!1,w.packComponents=!1);var m=void 0,v=!1;if(b.layoutUtilities&&w.packComponents&&(m=b.layoutUtilities("get"),m||(m=b.layoutUtilities()),v=!0),W.nodes().length>0)if(v){var P=e.getTopMostNodes(w.eles.nodes());if(s=e.connectComponents(b,w.eles,P),s.forEach(function(nt){var et=nt.boundingBox();E.push({x:et.x1+et.w/2,y:et.y1+et.h/2})}),w.randomize&&s.forEach(function(nt){w.eles=nt,G.push(h(w))}),w.quality=="default"||w.quality=="proof"){var S=b.collection();if(w.tile){var I=new Map,Z=[],tt=[],F=0,_={nodeIndexes:I,xCoords:Z,yCoords:tt},B=[];if(s.forEach(function(nt,et){nt.edges().length==0&&(nt.nodes().forEach(function(pt,Et){S.merge(nt.nodes()[Et]),pt.isParent()||(_.nodeIndexes.set(nt.nodes()[Et].id(),F++),_.xCoords.push(nt.nodes()[0].position().x),_.yCoords.push(nt.nodes()[0].position().y))}),B.push(et))}),S.length>1){var M=S.boundingBox();E.push({x:M.x1+M.w/2,y:M.y1+M.h/2}),s.push(S),G.push(_);for(var Y=B.length-1;Y>=0;Y--)s.splice(B[Y],1),G.splice(B[Y],1),E.splice(B[Y],1)}}s.forEach(function(nt,et){w.eles=nt,z.push(o(w,G[et])),e.relocateComponent(E[et],z[et],w)})}else s.forEach(function(nt,et){e.relocateComponent(E[et],G[et],w)});var X=new Set;if(s.length>1){var K=[],st=W.filter(function(nt){return nt.css("display")=="none"});s.forEach(function(nt,et){var pt=void 0;if(w.quality=="draft"&&(pt=G[et].nodeIndexes),nt.nodes().not(st).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;nt.nodes().not(st).forEach(function(mt){if(w.quality=="draft")if(!mt.isParent())Ct=pt.get(mt.id()),Et.nodes.push({x:G[et].xCoords[Ct]-mt.boundingbox().w/2,y:G[et].yCoords[Ct]-mt.boundingbox().h/2,width:mt.boundingbox().w,height:mt.boundingbox().h});else{var Tt=e.calcBoundingBox(mt,G[et].xCoords,G[et].yCoords,pt);Et.nodes.push({x:Tt.topLeftX,y:Tt.topLeftY,width:Tt.width,height:Tt.height})}else z[et][mt.id()]&&Et.nodes.push({x:z[et][mt.id()].getLeft(),y:z[et][mt.id()].getTop(),width:z[et][mt.id()].getWidth(),height:z[et][mt.id()].getHeight()})}),nt.edges().forEach(function(mt){var Tt=mt.source(),Ot=mt.target();if(Tt.css("display")!="none"&&Ot.css("display")!="none")if(w.quality=="draft"){var It=pt.get(Tt.id()),Wt=pt.get(Ot.id()),Pt=[],Yt=[];if(Tt.isParent()){var bt=e.calcBoundingBox(Tt,G[et].xCoords,G[et].yCoords,pt);Pt.push(bt.topLeftX+bt.width/2),Pt.push(bt.topLeftY+bt.height/2)}else Pt.push(G[et].xCoords[It]),Pt.push(G[et].yCoords[It]);if(Ot.isParent()){var U=e.calcBoundingBox(Ot,G[et].xCoords,G[et].yCoords,pt);Yt.push(U.topLeftX+U.width/2),Yt.push(U.topLeftY+U.height/2)}else Yt.push(G[et].xCoords[Wt]),Yt.push(G[et].yCoords[Wt]);Et.edges.push({startX:Pt[0],startY:Pt[1],endX:Yt[0],endY:Yt[1]})}else z[et][Tt.id()]&&z[et][Ot.id()]&&Et.edges.push({startX:z[et][Tt.id()].getCenterX(),startY:z[et][Tt.id()].getCenterY(),endX:z[et][Ot.id()].getCenterX(),endY:z[et][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(K.push(Et),X.add(et))}});var Lt=m.packComponents(K,w.randomize).shifts;if(w.quality=="draft")G.forEach(function(nt,et){var pt=nt.xCoords.map(function(Ct){return Ct+Lt[et].dx}),Et=nt.yCoords.map(function(Ct){return Ct+Lt[et].dy});nt.xCoords=pt,nt.yCoords=Et});else{var St=0;X.forEach(function(nt){Object.keys(z[nt]).forEach(function(et){var pt=z[nt][et];pt.setCenter(pt.getCenterX()+Lt[St].dx,pt.getCenterY()+Lt[St].dy)}),St++})}}}else{var D=w.eles.boundingBox();if(E.push({x:D.x1+D.w/2,y:D.y1+D.h/2}),w.randomize){var O=h(w);G.push(O)}w.quality=="default"||w.quality=="proof"?(z.push(o(w,G[0])),e.relocateComponent(E[0],z[0],w)):e.relocateComponent(E[0],G[0],w)}var Q=function(et,pt){if(w.quality=="default"||w.quality=="proof"){typeof et=="number"&&(et=pt);var Et=void 0,Ct=void 0,mt=et.data("id");return z.forEach(function(Ot){mt in Ot&&(Et={x:Ot[mt].getRect().getCenterX(),y:Ot[mt].getRect().getCenterY()},Ct=Ot[mt])}),w.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:et.position("x"),y:et.position("y")}),{x:Et.x,y:Et.y}}else{var Tt=void 0;return G.forEach(function(Ot){var It=Ot.nodeIndexes.get(et.id());It!=null&&(Tt={x:Ot.xCoords[It],y:Ot.yCoords[It]})}),Tt==null&&(Tt={x:et.position("x"),y:et.position("y")}),{x:Tt.x,y:Tt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var Ut=e.calcParentsWithoutChildren(b,W),Mt=W.filter(function(nt){return nt.css("display")=="none"});w.eles=W.not(Mt),W.nodes().not(":parent").not(Mt).layoutPositions(R,w,Q),Ut.length>0&&Ut.forEach(function(nt){nt.position(Q(nt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),p})();n.exports=y}),657:((n,i,a)=>{var f=a(548),t=a(140).layoutBase.Matrix,c=a(140).layoutBase.SVD,e=function(h){var g=h.cy,o=h.eles,N=o.nodes(),y=o.nodes(":parent"),p=new Map,L=new Map,R=new Map,w=[],b=[],W=[],G=[],J=[],x=[],z=[],s=[],E=void 0,d=void 0,m=1e8,v=1e-9,D=h.piTol,O=h.samplingType,P=h.nodeSeparation,S=void 0,I=function(){for(var V=0,$=0,k=!1;$<S;){V=Math.floor(Math.random()*d),k=!1;for(var j=0;j<$;j++)if(G[j]==V){k=!0;break}if(!k)G[$]=V,$++;else continue}},Z=function(V,$,k){for(var j=[],ut=0,ft=0,q=0,ht=void 0,gt=[],rt=0,vt=1,At=0;At<d;At++)gt[At]=m;for(j[ft]=V,gt[V]=0;ft>=ut;){q=j[ut++];for(var ot=w[q],it=0;it<ot.length;it++)ht=L.get(ot[it]),gt[ht]==m&&(gt[ht]=gt[q]+1,j[++ft]=ht);x[q][$]=gt[q]*P}if(k){for(var dt=0;dt<d;dt++)x[dt][$]<J[dt]&&(J[dt]=x[dt][$]);for(var at=0;at<d;at++)J[at]>rt&&(rt=J[at],vt=at)}return vt},tt=function(V){var $=void 0;if(V){$=Math.floor(Math.random()*d),E=$;for(var j=0;j<d;j++)J[j]=m;for(var ut=0;ut<S;ut++)G[ut]=$,$=Z($,ut,V)}else{I();for(var k=0;k<S;k++)Z(G[k],k,V,!1)}for(var ft=0;ft<d;ft++)for(var q=0;q<S;q++)x[ft][q]*=x[ft][q];for(var ht=0;ht<S;ht++)z[ht]=[];for(var gt=0;gt<S;gt++)for(var rt=0;rt<S;rt++)z[gt][rt]=x[G[rt]][gt]},F=function(){for(var V=c.svd(z),$=V.S,k=V.U,j=V.V,ut=$[0]*$[0]*$[0],ft=[],q=0;q<S;q++){ft[q]=[];for(var ht=0;ht<S;ht++)ft[q][ht]=0,q==ht&&(ft[q][ht]=$[q]/($[q]*$[q]+ut/($[q]*$[q])))}s=t.multMat(t.multMat(j,ft),t.transpose(k))},_=function(){for(var V=void 0,$=void 0,k=[],j=[],ut=[],ft=[],q=0;q<d;q++)k[q]=Math.random(),j[q]=Math.random();k=t.normalize(k),j=t.normalize(j);for(var ht=0,gt=v,rt=v,vt=void 0;;){ht++;for(var At=0;At<d;At++)ut[At]=k[At];if(k=t.multGamma(t.multL(t.multGamma(ut),x,s)),V=t.dotProduct(ut,k),k=t.normalize(k),gt=t.dotProduct(ut,k),vt=Math.abs(gt/rt),vt<=1+D&&vt>=1)break;rt=gt}for(var ot=0;ot<d;ot++)ut[ot]=k[ot];for(ht=0,rt=v;;){ht++;for(var it=0;it<d;it++)ft[it]=j[it];if(ft=t.minusOp(ft,t.multCons(ut,t.dotProduct(ut,ft))),j=t.multGamma(t.multL(t.multGamma(ft),x,s)),$=t.dotProduct(ft,j),j=t.normalize(j),gt=t.dotProduct(ft,j),vt=Math.abs(gt/rt),vt<=1+D&&vt>=1)break;rt=gt}for(var dt=0;dt<d;dt++)ft[dt]=j[dt];b=t.multCons(ut,Math.sqrt(Math.abs(V))),W=t.multCons(ft,Math.sqrt(Math.abs($)))};f.connectComponents(g,o,f.getTopMostNodes(N),p),y.forEach(function(H){f.connectComponents(g,o,f.getTopMostNodes(H.descendants().intersection(o)),p)});for(var B=0,M=0;M<N.length;M++)N[M].isParent()||L.set(N[M].id(),B++);var Y=!0,X=!1,K=void 0;try{for(var st=p.keys()[Symbol.iterator](),Lt;!(Y=(Lt=st.next()).done);Y=!0){var St=Lt.value;L.set(St,B++)}}catch(H){X=!0,K=H}finally{try{!Y&&st.return&&st.return()}finally{if(X)throw K}}for(var Q=0;Q<L.size;Q++)w[Q]=[];y.forEach(function(H){for(var V=H.children().intersection(o);V.nodes(":childless").length==0;)V=V.nodes()[0].children().intersection(o);var $=0,k=V.nodes(":childless")[0].connectedEdges().length;V.nodes(":childless").forEach(function(j,ut){j.connectedEdges().length<k&&(k=j.connectedEdges().length,$=ut)}),R.set(H.id(),V.nodes(":childless")[$].id())}),N.forEach(function(H){var V=void 0;H.isParent()?V=L.get(R.get(H.id())):V=L.get(H.id()),H.neighborhood().nodes().forEach(function($){o.intersection(H.edgesWith($)).length>0&&($.isParent()?w[V].push(R.get($.id())):w[V].push($.id()))})});var Ut=function(V){var $=L.get(V),k=void 0;p.get(V).forEach(function(j){g.getElementById(j).isParent()?k=R.get(j):k=j,w[$].push(k),w[L.get(k)].push(V)})},Mt=!0,nt=!1,et=void 0;try{for(var pt=p.keys()[Symbol.iterator](),Et;!(Mt=(Et=pt.next()).done);Mt=!0){var Ct=Et.value;Ut(Ct)}}catch(H){nt=!0,et=H}finally{try{!Mt&&pt.return&&pt.return()}finally{if(nt)throw et}}d=L.size;var mt=void 0;if(d>2){S=d<h.sampleSize?d:h.sampleSize;for(var Tt=0;Tt<d;Tt++)x[Tt]=[];for(var Ot=0;Ot<S;Ot++)s[Ot]=[];return h.quality=="draft"||h.step=="all"?(tt(O),F(),_(),mt={nodeIndexes:L,xCoords:b,yCoords:W}):(L.forEach(function(H,V){b.push(g.getElementById(V).position("x")),W.push(g.getElementById(V).position("y"))}),mt={nodeIndexes:L,xCoords:b,yCoords:W}),mt}else{var It=L.keys(),Wt=g.getElementById(It.next().value),Pt=Wt.position(),Yt=Wt.outerWidth();if(b.push(Pt.x),W.push(Pt.y),d==2){var bt=g.getElementById(It.next().value),U=bt.outerWidth();b.push(Pt.x+Yt/2+U/2+h.idealEdgeLength),W.push(Pt.y)}return mt={nodeIndexes:L,xCoords:b,yCoords:W},mt}};n.exports={spectralLayout:e}}),579:((n,i,a)=>{var f=a(212),t=function(e){e&&e("layout","fcose",f)};typeof cytoscape<"u"&&t(cytoscape),n.exports=t}),140:(n=>{n.exports=C})},T={};function u(n){var i=T[n];if(i!==void 0)return i.exports;var a=T[n]={exports:{}};return A[n](a,a.exports,u),a.exports}var l=u(579);return l})()})});var ar=dr(Ke(),1);var je={L:"left",R:"right",T:"top",B:"bottom"},_e={L:ct(C=>`${C},${C/2} 0,${C} 0,0`,"L"),R:ct(C=>`0,${C/2} ${C},0 ${C},${C}`,"R"),T:ct(C=>`0,0 ${C},0 ${C/2},${C}`,"T"),B:ct(C=>`${C/2},0 ${C},${C} 0,${C}`,"B")},ce={L:ct((C,A)=>C-A+2,"L"),R:ct((C,A)=>C-2,"R"),T:ct((C,A)=>C-A+2,"T"),B:ct((C,A)=>C-2,"B")},vr=ct(function(C){return Ht(C)?C==="L"?"R":"L":C==="T"?"B":"T"},"getOppositeArchitectureDirection"),tr=ct(function(C){let A=C;return A==="L"||A==="R"||A==="T"||A==="B"},"isArchitectureDirection"),Ht=ct(function(C){let A=C;return A==="L"||A==="R"},"isArchitectureDirectionX"),Zt=ct(function(C){let A=C;return A==="T"||A==="B"},"isArchitectureDirectionY"),Me=ct(function(C,A){let T=Ht(C)&&Zt(A),u=Zt(C)&&Ht(A);return T||u},"isArchitectureDirectionXY"),pr=ct(function(C){let A=C[0],T=C[1],u=Ht(A)&&Zt(T),l=Zt(A)&&Ht(T);return u||l},"isArchitecturePairXY"),yr=ct(function(C){return C!=="LL"&&C!=="RR"&&C!=="TT"&&C!=="BB"},"isValidArchitectureDirectionPair"),we=ct(function(C,A){let T=`${C}${A}`;return yr(T)?T:void 0},"getArchitectureDirectionPair"),Er=ct(function([C,A],T){let u=T[0],l=T[1];return Ht(u)?Zt(l)?[C+(u==="L"?-1:1),A+(l==="T"?1:-1)]:[C+(u==="L"?-1:1),A]:Ht(l)?[C+(l==="L"?1:-1),A+(u==="T"?1:-1)]:[C,A+(u==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),mr=ct(function(C){return C==="LT"||C==="TL"?[1,1]:C==="BL"||C==="LB"?[1,-1]:C==="BR"||C==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Tr=ct(function(C,A){return Me(C,A)?"bend":Ht(C)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Nr=ct(function(C){return C.type==="service"},"isArchitectureService"),Lr=ct(function(C){return C.type==="junction"},"isArchitectureJunction"),er=ct(C=>C.data(),"edgeData"),ee=ct(C=>C.data(),"nodeData"),Cr=Se.architecture,re,rr=(re=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Ue,this.getAccTitle=Ye,this.setDiagramTitle=We,this.getDiagramTitle=Ve,this.getAccDescription=He,this.setAccDescription=Xe,this.clear()}setDiagramId(A){this.diagramId=A}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",Ge()}addService({id:A,icon:T,in:u,title:l,iconText:n}){if(this.registeredIds[A]!==void 0)throw new Error(`The service id [${A}] is already in use by another ${this.registeredIds[A]}`);if(u!==void 0){if(A===u)throw new Error(`The service [${A}] cannot be placed within itself`);if(this.registeredIds[u]===void 0)throw new Error(`The service [${A}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[u]==="node")throw new Error(`The service [${A}]'s parent is not a group`)}this.registeredIds[A]="node",this.nodes[A]={id:A,type:"service",icon:T,iconText:n,title:l,edges:[],in:u}}getServices(){return Object.values(this.nodes).filter(Nr)}addJunction({id:A,in:T}){if(this.registeredIds[A]!==void 0)throw new Error(`The junction id [${A}] is already in use by another ${this.registeredIds[A]}`);if(T!==void 0){if(A===T)throw new Error(`The junction [${A}] cannot be placed within itself`);if(this.registeredIds[T]===void 0)throw new Error(`The junction [${A}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[T]==="node")throw new Error(`The junction [${A}]'s parent is not a group`)}this.registeredIds[A]="node",this.nodes[A]={id:A,type:"junction",edges:[],in:T}}getJunctions(){return Object.values(this.nodes).filter(Lr)}getNodes(){return Object.values(this.nodes)}getNode(A){return this.nodes[A]??null}addGroup({id:A,icon:T,in:u,title:l}){if(this.registeredIds?.[A]!==void 0)throw new Error(`The group id [${A}] is already in use by another ${this.registeredIds[A]}`);if(u!==void 0){if(A===u)throw new Error(`The group [${A}] cannot be placed within itself`);if(this.registeredIds?.[u]===void 0)throw new Error(`The group [${A}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[u]==="node")throw new Error(`The group [${A}]'s parent is not a group`)}this.registeredIds[A]="group",this.groups[A]={id:A,icon:T,title:l,in:u}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:A,rhsId:T,lhsDir:u,rhsDir:l,lhsInto:n,rhsInto:i,lhsGroup:a,rhsGroup:f,title:t}){if(!tr(u))throw new Error(`Invalid direction given for left hand side of edge ${A}--${T}. Expected (L,R,T,B) got ${String(u)}`);if(!tr(l))throw new Error(`Invalid direction given for right hand side of edge ${A}--${T}. Expected (L,R,T,B) got ${String(l)}`);if(this.nodes[A]===void 0&&this.groups[A]===void 0)throw new Error(`The left-hand id [${A}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[T]===void 0&&this.groups[T]===void 0)throw new Error(`The right-hand id [${T}] does not yet exist. Please create the service/group before declaring an edge to it.`);let c=this.nodes[A].in,e=this.nodes[T].in;if(a&&c&&e&&c==e)throw new Error(`The left-hand id [${A}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(f&&c&&e&&c==e)throw new Error(`The right-hand id [${T}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let r={lhsId:A,lhsDir:u,lhsInto:n,lhsGroup:a,rhsId:T,rhsDir:l,rhsInto:i,rhsGroup:f,title:t};this.edges.push(r),this.nodes[A]&&this.nodes[T]&&(this.nodes[A].edges.push(this.edges[this.edges.length-1]),this.nodes[T].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){let A={},T=Object.entries(this.nodes).reduce((f,[t,c])=>(f[t]=c.edges.reduce((e,r)=>{let h=this.getNode(r.lhsId)?.in,g=this.getNode(r.rhsId)?.in;if(h&&g&&h!==g){let o=Tr(r.lhsDir,r.rhsDir);o!=="bend"&&(A[h]??(A[h]={}),A[h][g]=o,A[g]??(A[g]={}),A[g][h]=o)}if(r.lhsId===t){let o=we(r.lhsDir,r.rhsDir);o&&(e[o]=r.rhsId)}else{let o=we(r.rhsDir,r.lhsDir);o&&(e[o]=r.lhsId)}return e},{}),f),{}),u=Object.keys(T)[0],l={[u]:1},n=Object.keys(T).reduce((f,t)=>t===u?f:{...f,[t]:1},{}),i=ct(f=>{let t={[f]:[0,0]},c=[f];for(;c.length>0;){let e=c.shift();if(e){l[e]=1,delete n[e];let r=T[e],[h,g]=t[e];Object.entries(r).forEach(([o,N])=>{l[N]||(t[N]=Er([h,g],o),c.push(N))})}}return t},"BFS"),a=[i(u)];for(;Object.keys(n).length>0;)a.push(i(Object.keys(n)[0]));this.dataStructures={adjList:T,spatialMaps:a,groupAlignments:A}}return this.dataStructures}setElementForId(A,T){this.elements[A]=T}getElementById(A){return this.elements[A]}getConfig(){return $e({...Cr,...Fe().architecture})}getConfigField(A){return this.getConfig()[A]}},ct(re,"ArchitectureDB"),re),Ar=ct((C,A)=>{Qe(C,A),C.groups.map(T=>A.addGroup(T)),C.services.map(T=>A.addService({...T,type:"service"})),C.junctions.map(T=>A.addJunction({...T,type:"junction"})),C.edges.map(T=>A.addEdge(T))},"populateDb"),ir={parser:{yy:void 0},parse:ct(async C=>{let A=await Je("architecture",C);Ee.debug(A);let T=ir.parser?.yy;if(!(T instanceof rr))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ar(A,T)},"parse")},wr=ct(C=>`
|
|
2
|
+
.edge {
|
|
3
|
+
stroke-width: ${C.archEdgeWidth};
|
|
4
|
+
stroke: ${C.archEdgeColor};
|
|
5
|
+
fill: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.arrow {
|
|
9
|
+
fill: ${C.archEdgeArrowColor};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.node-bkg {
|
|
13
|
+
fill: none;
|
|
14
|
+
stroke: ${C.archGroupBorderColor};
|
|
15
|
+
stroke-width: ${C.archGroupBorderWidth};
|
|
16
|
+
stroke-dasharray: 8;
|
|
17
|
+
}
|
|
18
|
+
.node-icon-text {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.node-icon-text > div {
|
|
24
|
+
color: #fff;
|
|
25
|
+
margin: 1px;
|
|
26
|
+
height: fit-content;
|
|
27
|
+
text-align: center;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
display: -webkit-box;
|
|
30
|
+
-webkit-box-orient: vertical;
|
|
31
|
+
}
|
|
32
|
+
`,"getStyles"),Mr=wr,te=ct(C=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${C}</g>`,"wrapIcon"),oe={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:te('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:te('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:te('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:te('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:te('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:Ze,blank:{body:te("")}}},Or=ct(async function(C,A,T,u){let l=T.getConfigField("padding"),n=T.getConfigField("iconSize"),i=n/2,a=n/6,f=a/2;await Promise.all(A.edges().map(async t=>{let{source:c,sourceDir:e,sourceArrow:r,sourceGroup:h,target:g,targetDir:o,targetArrow:N,targetGroup:y,label:p}=er(t),{x:L,y:R}=t[0].sourceEndpoint(),{x:w,y:b}=t[0].midpoint(),{x:W,y:G}=t[0].targetEndpoint(),J=l+4;if(h&&(Ht(e)?L+=e==="L"?-J:J:R+=e==="T"?-J:J+18),y&&(Ht(o)?W+=o==="L"?-J:J:G+=o==="T"?-J:J+18),!h&&T.getNode(c)?.type==="junction"&&(Ht(e)?L+=e==="L"?i:-i:R+=e==="T"?i:-i),!y&&T.getNode(g)?.type==="junction"&&(Ht(o)?W+=o==="L"?i:-i:G+=o==="T"?i:-i),t[0]._private.rscratch){let x=C.insert("g");if(x.insert("path").attr("d",`M ${L},${R} L ${w},${b} L${W},${G} `).attr("class","edge").attr("id",`${u}-${ke(c,g,{prefix:"L"})}`),r){let z=Ht(e)?ce[e](L,a):L-f,s=Zt(e)?ce[e](R,a):R-f;x.insert("polygon").attr("points",_e[e](a)).attr("transform",`translate(${z},${s})`).attr("class","arrow")}if(N){let z=Ht(o)?ce[o](W,a):W-f,s=Zt(o)?ce[o](G,a):G-f;x.insert("polygon").attr("points",_e[o](a)).attr("transform",`translate(${z},${s})`).attr("class","arrow")}if(p){let z=Me(e,o)?"XY":Ht(e)?"X":"Y",s=0;z==="X"?s=Math.abs(L-W):z==="Y"?s=Math.abs(R-G)/1.5:s=Math.abs(L-W)/2;let E=x.append("g");if(await fe(E,p,{useHtmlLabels:!1,width:s,classes:"architecture-service-label"},he()),E.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),z==="X")E.attr("transform","translate("+w+", "+b+")");else if(z==="Y")E.attr("transform","translate("+w+", "+b+") rotate(-90)");else if(z==="XY"){let d=we(e,o);if(d&&pr(d)){let m=E.node().getBoundingClientRect(),[v,D]=mr(d);E.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*v*D*45})`);let O=E.node().getBoundingClientRect();E.attr("transform",`
|
|
33
|
+
translate(${w}, ${b-m.height/2})
|
|
34
|
+
translate(${v*O.width/2}, ${D*O.height/2})
|
|
35
|
+
rotate(${-1*v*D*45}, 0, ${m.height/2})
|
|
36
|
+
`)}}}}}))},"drawEdges"),Dr=ct(async function(C,A,T,u){let n=T.getConfigField("padding")*.75,i=T.getConfigField("fontSize"),f=T.getConfigField("iconSize")/2;await Promise.all(A.nodes().map(async t=>{let c=ee(t);if(c.type==="group"){let{h:e,w:r,x1:h,y1:g}=t.boundingBox(),o=C.append("rect");o.attr("id",`${u}-group-${c.id}`).attr("x",h+f).attr("y",g+f).attr("width",r).attr("height",e).attr("class","node-bkg");let N=C.append("g"),y=h,p=g;if(c.icon){let L=N.append("g");L.html(`<g>${await le(c.icon,{height:n,width:n,fallbackPrefix:oe.prefix})}</g>`),L.attr("transform","translate("+(y+f+1)+", "+(p+f+1)+")"),y+=n,p+=i/2-1-2}if(c.label){let L=N.append("g");await fe(L,c.label,{useHtmlLabels:!1,width:r,classes:"architecture-service-label"},he()),L.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),L.attr("transform","translate("+(y+f+4)+", "+(p+f+2)+")")}T.setElementForId(c.id,o)}}))},"drawGroups"),xr=ct(async function(C,A,T,u){let l=he();for(let n of T){let i=A.append("g"),a=C.getConfigField("iconSize");if(n.title){let e=i.append("g");await fe(e,n.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},l),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+a/2+", "+a+")")}let f=i.append("g");if(n.icon)f.html(`<g>${await le(n.icon,{height:a,width:a,fallbackPrefix:oe.prefix})}</g>`);else if(n.iconText){f.html(`<g>${await le("blank",{height:a,width:a,fallbackPrefix:oe.prefix})}</g>`);let h=f.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(be(n.iconText,l)),g=parseInt(window.getComputedStyle(h.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;h.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/g)};`)}else f.append("path").attr("class","node-bkg").attr("id",`${u}-node-${n.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);i.attr("id",`${u}-service-${n.id}`).attr("class","architecture-service");let{width:t,height:c}=i.node().getBBox();n.width=t,n.height=c,C.setElementForId(n.id,i)}return 0},"drawServices"),Ir=ct(function(C,A,T,u){T.forEach(l=>{let n=A.append("g"),i=C.getConfigField("iconSize");n.append("g").append("rect").attr("id",`${u}-node-${l.id}`).attr("fill-opacity","0").attr("width",i).attr("height",i),n.attr("class","architecture-junction");let{width:f,height:t}=n._groups[0][0].getBBox();n.width=f,n.height=t,C.setElementForId(l.id,n)})},"drawJunctions");qe([{name:oe.prefix,icons:oe}]);me.use(ar.default);function nr(C,A,T){C.forEach(u=>{A.add({group:"nodes",data:{type:"service",id:u.id,icon:u.icon,label:u.title,parent:u.in,width:T.getConfigField("iconSize"),height:T.getConfigField("iconSize")},classes:"node-service"})})}ct(nr,"addServices");function or(C,A,T){C.forEach(u=>{A.add({group:"nodes",data:{type:"junction",id:u.id,parent:u.in,width:T.getConfigField("iconSize"),height:T.getConfigField("iconSize")},classes:"node-junction"})})}ct(or,"addJunctions");function sr(C,A){A.nodes().map(T=>{let u=ee(T);if(u.type==="group")return;u.x=T.position().x,u.y=T.position().y,C.getElementById(u.id).attr("transform","translate("+(u.x||0)+","+(u.y||0)+")")})}ct(sr,"positionNodes");function hr(C,A){C.forEach(T=>{A.add({group:"nodes",data:{type:"group",id:T.id,icon:T.icon,label:T.title,parent:T.in},classes:"node-group"})})}ct(hr,"addGroups");function lr(C,A){C.forEach(T=>{let{lhsId:u,rhsId:l,lhsInto:n,lhsGroup:i,rhsInto:a,lhsDir:f,rhsDir:t,rhsGroup:c,title:e}=T,r=Me(T.lhsDir,T.rhsDir)?"segments":"straight",h={id:`${u}-${l}`,label:e,source:u,sourceDir:f,sourceArrow:n,sourceGroup:i,sourceEndpoint:f==="L"?"0 50%":f==="R"?"100% 50%":f==="T"?"50% 0":"50% 100%",target:l,targetDir:t,targetArrow:a,targetGroup:c,targetEndpoint:t==="L"?"0 50%":t==="R"?"100% 50%":t==="T"?"50% 0":"50% 100%"};A.add({group:"edges",data:h,classes:r})})}ct(lr,"addEdges");function fr(C,A,T){let u=ct((a,f)=>Object.entries(a).reduce((t,[c,e])=>{let r=0,h=Object.entries(e);if(h.length===1)return t[c]=h[0][1],t;for(let g=0;g<h.length-1;g++)for(let o=g+1;o<h.length;o++){let[N,y]=h[g],[p,L]=h[o];if(T[N]?.[p]===f)t[c]??(t[c]=[]),t[c]=[...t[c],...y,...L];else if(N==="default"||p==="default")t[c]??(t[c]=[]),t[c]=[...t[c],...y,...L];else{let w=`${c}-${r++}`;t[w]=y;let b=`${c}-${r++}`;t[b]=L}}return t},{}),"flattenAlignments"),l=A.map(a=>{let f={},t={};return Object.entries(a).forEach(([c,[e,r]])=>{var g,o;let h=C.getNode(c)?.in??"default";f[r]??(f[r]={}),(g=f[r])[h]??(g[h]=[]),f[r][h].push(c),t[e]??(t[e]={}),(o=t[e])[h]??(o[h]=[]),t[e][h].push(c)}),{horiz:Object.values(u(f,"horizontal")).filter(c=>c.length>1),vert:Object.values(u(t,"vertical")).filter(c=>c.length>1)}}),[n,i]=l.reduce(([a,f],{horiz:t,vert:c})=>[[...a,...t],[...f,...c]],[[],[]]);return{horizontal:n,vertical:i}}ct(fr,"getAlignments");function cr(C,A){let T=[],u=ct(n=>`${n[0]},${n[1]}`,"posToStr"),l=ct(n=>n.split(",").map(i=>parseInt(i)),"strToPos");return C.forEach(n=>{let i=Object.fromEntries(Object.entries(n).map(([c,e])=>[u(e),c])),a=[u([0,0])],f={},t={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){let c=a.shift();if(c){f[c]=1;let e=i[c];if(e){let r=l(c);Object.entries(t).forEach(([h,g])=>{let o=u([r[0]+g[0],r[1]+g[1]]),N=i[o];N&&!f[o]&&(a.push(o),T.push({[je[h]]:N,[je[vr(h)]]:e,gap:1.5*A.getConfigField("iconSize")}))})}}}}),T}ct(cr,"getRelativeConstraints");function gr(C,A,T,u,l,{spatialMaps:n,groupAlignments:i}){return new Promise(a=>{let f=ze("body").append("div").attr("id","cy").attr("style","display:none"),t=me({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${l.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${l.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});f.remove(),hr(T,t),nr(C,t,l),or(A,t,l),lr(u,t);let c=fr(l,n,i),e=cr(n,l),r=l.getConfigField("iconSize"),h=l.getConfigField("idealEdgeLengthMultiplier")*r,g=.5*r,o=l.getConfigField("edgeElasticity"),N=t.layout({name:"fcose",quality:"proof",randomize:l.getConfigField("randomize"),nodeSeparation:l.getConfigField("nodeSeparation"),numIter:l.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(y){let[p,L]=y.connectedNodes(),{parent:R}=ee(p),{parent:w}=ee(L);return R===w?h:g},edgeElasticity(y){let[p,L]=y.connectedNodes(),{parent:R}=ee(p),{parent:w}=ee(L);return R===w?o:.001},alignmentConstraint:c,relativePlacementConstraint:e});N.one("layoutstop",()=>{function y(p,L,R,w){let b,W,{x:G,y:J}=p,{x,y:z}=L;W=(w-J+(G-R)*(J-z)/(G-x))/Math.sqrt(1+Math.pow((J-z)/(G-x),2)),b=Math.sqrt(Math.pow(w-J,2)+Math.pow(R-G,2)-Math.pow(W,2));let s=Math.sqrt(Math.pow(x-G,2)+Math.pow(z-J,2));b=b/s;let E=(x-G)*(w-J)-(z-J)*(R-G);switch(!0){case E>=0:E=1;break;case E<0:E=-1;break}let d=(x-G)*(R-G)+(z-J)*(w-J);switch(!0){case d>=0:d=1;break;case d<0:d=-1;break}return W=Math.abs(W)*E,b=b*d,{distances:W,weights:b}}ct(y,"getSegmentWeights"),t.startBatch();for(let p of Object.values(t.edges()))if(p.data?.()){let{x:L,y:R}=p.source().position(),{x:w,y:b}=p.target().position();if(L!==w&&R!==b){let W=p.sourceEndpoint(),G=p.targetEndpoint(),{sourceDir:J}=er(p),[x,z]=Zt(J)?[W.x,G.y]:[G.x,W.y],{weights:s,distances:E}=y(W,G,x,z);p.style("segment-distances",E),p.style("segment-weights",s)}}t.endBatch(),N.run()}),N.run(),t.ready(y=>{Ee.info("Ready",y),a(t)})})}ct(gr,"layoutArchitecture");var Rr=ct(async(C,A,T,u)=>{let l=u.db;l.setDiagramId(A);let n=l.getServices(),i=l.getJunctions(),a=l.getGroups(),f=l.getEdges(),t=l.getDataStructures(),c=Be(A),e=c.append("g");e.attr("class","architecture-edges");let r=c.append("g");r.attr("class","architecture-services");let h=c.append("g");h.attr("class","architecture-groups"),await xr(l,r,n,A),Ir(l,r,i,A);let g=await gr(n,i,a,f,l,t);await Or(e,g,l,A),await Dr(h,g,l,A),sr(l,g),Pe(void 0,c,l.getConfigField("padding"),l.getConfigField("useMaxWidth"))},"draw"),Sr={draw:Rr},Vr={parser:ir,get db(){return new rr},renderer:Sr,styles:Mr};export{Vr as diagram};
|
|
37
|
+
//# sourceMappingURL=architectureDiagram-3BPJPVTR-EYIVUOEK.js.map
|