@kabmo-labs/kabmo 0.42.2 → 0.43.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 +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +619 -582
- package/dist/client/static/js/{CsvGrid-g6rek8y9.js → CsvGrid-3fr85032.js} +2 -2
- package/dist/client/static/js/{DocxView-41t9ryws.js → DocxView-pqbp2fpd.js} +4 -4
- package/dist/client/static/js/{DrawioView-mfxhfz1h.js → DrawioView-m0vecq1m.js} +2 -2
- package/dist/client/static/js/ImageView-rbejbjwg.js +1 -0
- package/dist/client/static/js/LayoutWrapper-mxfsqh57.js +2 -0
- package/dist/client/static/js/Modal-vnwg4xn3.js +59 -0
- package/dist/client/static/js/{PdfView-bek8k888.js → PdfView-wmg0vk2p.js} +1 -1
- package/dist/client/static/js/SessionsView-90z2t4qe.js +1 -0
- package/dist/client/static/js/{SheetView-vezssf6b.js → SheetView-rg5gkcd7.js} +13 -13
- package/dist/client/static/js/{SvgPreview-f1qaw73k.js → SvgPreview-wpb7b0ez.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-4qn94h52.js → abnfDiagram-O67JEVCF-4pxqt66j.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-7j23x20s.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-tbewzdya.js → architectureDiagram-NJMV4G6O-kwt1va5y.js} +11 -11
- package/dist/client/static/js/{astro-nn7xg0we.js → astro-dpfdhc5e.js} +1 -1
- package/dist/client/static/js/bash-vv2ysp0a.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-njgnwckz.js → blockDiagram-BEXU5L5S-hbj5v7n7.js} +7 -7
- package/dist/client/static/js/c-8jf64j6h.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-f58pcvbk.js → c4Diagram-YGBWAQC7-epfzh8dw.js} +6 -6
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-52g73vyw.js → classDiagram-v2-NBCMYWYE-kbks4qgz.js} +6 -6
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-ptdnshzh.js → cose-bilkent-JH36ORCC-dvdmckrf.js} +1 -1
- package/dist/client/static/js/cpp-vh94zee0.js +1 -0
- package/dist/client/static/js/css-p57h1fme.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-me5xnx6a.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-qabfdkzr.js → cynefinDiagram-VND7K2PF-r084stj5.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-kyf5jetf.js → dagre-6A5THRUB-64qc51n1.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-bxrsjtv9.js → diagram-22UHCM2B-70qtb1rm.js} +16 -16
- package/dist/client/static/js/{diagram-3UASUU5V-0f41s00j.js → diagram-3UASUU5V-dgkvnsme.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-0z1zx9h1.js → diagram-ATOU4E4O-rnpsp26v.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-znrmr6bk.js → diagram-CDSNMT55-26hthh60.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-jfe2jhk0.js → diagram-MLGK6HIB-nc1s85r5.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-2kaawmwa.js → diagram-MPIPVDR6-e4dckqhv.js} +3 -3
- package/dist/client/static/js/{dockerfile-12exatm9.js → dockerfile-rxtyyhr1.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-s5n37rfp.js → ebnfDiagram-ZINNZB2B-3w9h8qk7.js} +1 -1
- package/dist/client/static/js/{elixir-szk51ehr.js → elixir-5ewfhvfh.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-433rd9fp.js → elk-276RUBZZ-httpkyb1.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-key6ah0b.js → erDiagram-OPXOYQCR-3qhvf7se.js} +8 -8
- package/dist/client/static/js/{erlang-zwy7cqdk.js → erlang-jqqa3ehb.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-5zbvjj84.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-1jat076e.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-4efkhmca.js → ganttDiagram-FUAMR5RP-t53m50e5.js} +6 -6
- package/dist/client/static/js/gitGraph-4MIJSDKK-tjhkv71w.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-ac376y2k.js → gitGraphDiagram-X574FWY7-b5wn9eht.js} +14 -14
- package/dist/client/static/js/graphql-kesh8gk0.js +1 -0
- package/dist/client/static/js/html-sxpfydga.js +1 -0
- package/dist/client/static/js/{index-e1yz59fa.js → index-0c6vpk89.js} +2 -2
- package/dist/client/static/js/{index-p0ez6hqd.js → index-181p91hf.js} +1 -1
- package/dist/client/static/js/{index-s4gv0rpk.js → index-1dwdgp27.js} +1 -1
- package/dist/client/static/js/{index-0e9nkc0g.js → index-2q23dwrs.js} +2 -2
- package/dist/client/static/js/{index-4cncqz8j.js → index-38v0781h.js} +2 -2
- package/dist/client/static/js/{index-zs7sjv6x.js → index-4banz7gr.js} +1 -1
- package/dist/client/static/js/{index-nh29fkk9.js → index-7dp90ad1.js} +2 -2
- package/dist/client/static/js/{index-yjmm73jm.js → index-7z9tz4ze.js} +2 -2
- package/dist/client/static/js/{index-zs73zwjz.js → index-7zc1z9z9.js} +4 -4
- package/dist/client/static/js/{index-z78bzryw.js → index-8y51kgan.js} +3 -3
- package/dist/client/static/js/{index-gp57dx2v.js → index-axszsg7a.js} +1 -1
- package/dist/client/static/js/{index-pxtff3ez.js → index-bvjct7sp.js} +2 -2
- package/dist/client/static/js/{index-8b3t2y77.js → index-cqnpsw2m.js} +2 -2
- package/dist/client/static/js/{index-yzda8j2d.js → index-d8r84zjd.js} +12 -12
- package/dist/client/static/js/{index-02543wk3.js → index-dg3b0mfk.js} +2 -2
- package/dist/client/static/js/index-dkqgmacr.js +4 -0
- package/dist/client/static/js/{index-pkes9492.js → index-e7yf273s.js} +2 -2
- package/dist/client/static/js/{index-8k7vjp8b.js → index-egd0vfey.js} +1 -1
- package/dist/client/static/js/{index-dzmar8jr.js → index-enb6chty.js} +1 -1
- package/dist/client/static/js/{index-v3f7we4n.js → index-f4fqvct6.js} +22 -22
- package/dist/client/static/js/{index-pysqpc5n.js → index-fg965t62.js} +2 -2
- package/dist/client/static/js/{index-raca8tsh.js → index-fgyenbv8.js} +4 -4
- package/dist/client/static/js/{index-qsw5edtk.js → index-fjnkzk12.js} +5 -5
- package/dist/client/static/js/{index-50mdqev0.js → index-g3a9j9hf.js} +1 -1
- package/dist/client/static/js/{index-1t5ybx9v.js → index-g4rsmakg.js} +3 -3
- package/dist/client/static/js/{index-qx6x4z0y.js → index-gmnmnfm0.js} +2 -2
- package/dist/client/static/js/{index-f33c4paw.js → index-gwqb7m8g.js} +1 -1
- package/dist/client/static/js/{index-ykfd2fyj.js → index-j60gtvw8.js} +1 -1
- package/dist/client/static/js/index-jvs2fvqz.js +2 -0
- package/dist/client/static/js/{index-r8cc80w5.js → index-jz93j0at.js} +2 -2
- package/dist/client/static/js/{index-82vk27q1.js → index-k9ws464d.js} +2 -2
- package/dist/client/static/js/{index-0pabfaac.js → index-kc3c2gzb.js} +1 -1
- package/dist/client/static/js/{index-5jnvz9hw.js → index-kccp6tgd.js} +2 -2
- package/dist/client/static/js/{index-1y3rzw6b.js → index-kmzd0adv.js} +1 -1
- package/dist/client/static/js/{index-77t0nvt1.js → index-ksph3kpr.js} +2 -2
- package/dist/client/static/js/{index-dfqmwm7j.js → index-m9s9rg5k.js} +2 -2
- package/dist/client/static/js/{index-gsxebrq9.js → index-n9scbxy5.js} +2 -2
- package/dist/client/static/js/{index-7a2efrbj.js → index-q1gwgmxt.js} +2 -2
- package/dist/client/static/js/{index-b42t14wk.js → index-q81rxwh7.js} +35 -35
- package/dist/client/static/js/{index-ktbrmp29.js → index-qhytrsyb.js} +2 -2
- package/dist/client/static/js/index-qzw4jnnv.js +1 -0
- package/dist/client/static/js/{index-cz50ha6x.js → index-r11bbnek.js} +78 -78
- package/dist/client/static/js/{index-zndbhb9w.js → index-rv4qs3wm.js} +2 -2
- package/dist/client/static/js/{index-hga3e13s.js → index-s78n0dtv.js} +2 -2
- package/dist/client/static/js/{index-03pyvmcz.js → index-sesghshh.js} +2 -2
- package/dist/client/static/js/index-tnv3dryk.js +9 -0
- package/dist/client/static/js/{index-dtj73vs1.js → index-tzbzehqd.js} +1 -1
- package/dist/client/static/js/index-vcrh95gf.css +1 -0
- package/dist/client/static/js/{index-8kbp24xg.js → index-vmgzhp41.js} +1 -1
- package/dist/client/static/js/{index-r9db1gsf.js → index-wmv3crye.js} +2 -2
- package/dist/client/static/js/{index-b0v6gwym.js → index-ycks7gyg.js} +2 -2
- package/dist/client/static/js/{index-hw14rhen.js → index-ynaxep06.js} +2 -2
- package/dist/client/static/js/{index-rab39785.js → index-ys0xpw3q.js} +2 -2
- package/dist/client/static/js/{index-feffxxss.js → index-yvgbr7ek.js} +2 -2
- package/dist/client/static/js/index-zqthmaxq.js +478 -0
- package/dist/client/static/js/info-A6RAGUB7-m6qz24p8.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-4e7ej63f.js → infoDiagram-VRGFBTTK-qv7438m3.js} +1 -1
- package/dist/client/static/js/ini-1x0ad976.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-k3yet1ec.js → ishikawaDiagram-OU5B5YK6-p1w6zg5y.js} +4 -4
- package/dist/client/static/js/java-3944nq02.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-qe352kyd.js → journeyDiagram-ZHPQQLJL-ywk6xqxr.js} +5 -5
- package/dist/client/static/js/json-g5ggnd94.js +1 -0
- package/dist/client/static/js/jsx-f6p72qpc.js +1 -0
- package/dist/client/static/js/{julia-2eekpjq8.js → julia-0h9krgsd.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-58hag75n.js → kanban-definition-PNTS6WVX-gtrmhggc.js} +5 -5
- package/dist/client/static/js/lua-edn2b3wn.js +1 -0
- package/dist/client/static/js/markdown-9dhg1fax.js +1 -0
- package/dist/client/static/js/{mermaid.core-6e89h6vm.js → mermaid.core-5s24b4hh.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-ncsam2fm.js → mindmap-definition-NLK3R4M7-3wx7abqn.js} +4 -4
- package/dist/client/static/js/one-dark-pro-3vya9z02.js +1 -0
- package/dist/client/static/js/one-light-1yrwn9my.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-ng6wq5xj.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-b5ckc39d.js → pegDiagram-GJSIUBJH-yvyqnjya.js} +1 -1
- package/dist/client/static/js/{perl-dtn1fccw.js → perl-rptyx23q.js} +1 -1
- package/dist/client/static/js/{php-7av78hch.js → php-sagvq3wz.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-rf6jhxf6.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-s4d47ve8.js → pieDiagram-5QR66LMP-26x6pj38.js} +3 -3
- package/dist/client/static/js/properties-fcmj08pv.js +1 -0
- package/dist/client/static/js/python-532d8ezm.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-zm0ekvjz.js → quadrantDiagram-O4NWA36T-qhe8h0j9.js} +6 -6
- package/dist/client/static/js/r-ptmdxs2a.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-ygp6hxq4.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-rxgnrb2g.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-xkv52a2p.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-bvcktbqh.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-9c3v7jsq.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-52vdqf53.js → railroadDiagram-XR7U4H2S-dwy3k2jx.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-7kf8bmk9.js → requirementDiagram-PLB6GJNP-hcmgfesg.js} +4 -4
- package/dist/client/static/js/{ruby-s2bqr910.js → ruby-9qyx7knh.js} +1 -1
- package/dist/client/static/js/{rust-q98kssv3.js → rust-bmb4ee5w.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-bcb9f54a.js → sankeyDiagram-IPEJSGJF-s6d3k4zs.js} +6 -6
- package/dist/client/static/js/{sass-bm32bb5k.js → sass-07rteya0.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-76ywvj7g.js → sequenceDiagram-PO4LG4MO-0fcmzgdy.js} +19 -19
- package/dist/client/static/js/{sizeCapture-INFHLROL-p9bsf5dc.js → sizeCapture-INFHLROL-t8fcm7rq.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-1ecfb3fs.js → stateDiagram-v2-GCMORJYK-jr80hfeg.js} +6 -6
- package/dist/client/static/js/{svelte-ztkaww47.js → svelte-w365cpwa.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-2pyjr946.js → swimlanes-2SLR337P-x1ay6w39.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xj123xrp.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-4csxwmn2.js → timeline-definition-EJHVYXUP-qz0g6msb.js} +2 -2
- package/dist/client/static/js/treeView-Q6P3EWNA-fb58a7z1.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-ej4qhksx.js +1 -0
- package/dist/client/static/js/typescript-683kkkaw.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-0p1jnbsn.js → usecaseDiagram-POWQR4AR-sxzrv8ht.js} +43 -43
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-y1hgdet4.js → vennDiagram-UO4OBE2U-qsqgnjcv.js} +5 -5
- package/dist/client/static/js/{vue-cbqm4bed.js → vue-d6cesny1.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-mkp0kanv.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-p578yrgm.js → wardleyDiagram-VNRHLVJA-rvwxn458.js} +4 -4
- package/dist/client/static/js/xml-6ct32gys.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-b08b4ah0.js → xychartDiagram-PMCCYNJV-nb4w7rcg.js} +5 -5
- package/dist/client/static/js/yaml-1d5m3bfj.js +1 -0
- package/marketplace/plugins/command-runner/package.json +2 -2
- package/marketplace/plugins/command-runner/src/app.test.tsx +161 -0
- package/marketplace/plugins/command-runner/src/app.tsx +37 -3
- package/marketplace/plugins/command-runner/src/panel/Glyph.tsx +22 -4
- package/marketplace/plugins/git-forge/package.json +2 -2
- package/marketplace/plugins/git-forge/src/panel/Glyph.tsx +22 -3
- package/marketplace/plugins/git-forge/src/panel/index.tsx +21 -3
- package/marketplace/plugins/git-forge/src/panel/refresh.test.tsx +192 -0
- package/marketplace/plugins/git-forge/src/panel/use-forge.ts +4 -2
- package/marketplace/plugins/git-forge/src/panel/write.test.tsx +21 -0
- package/marketplace/plugins/stats/package.json +2 -2
- package/marketplace/plugins/stats/src/RefreshButton.tsx +9 -7
- package/marketplace/plugins/stats/src/app.tsx +15 -1
- package/marketplace/plugins/stats/src/refresh.test.tsx +166 -0
- package/package.json +1 -1
- package/src/client/components/common/anchored-menu/index.tsx +26 -8
- package/src/client/components/common/context-usage-button/McpSection.test.tsx +34 -5
- package/src/client/components/common/context-usage-button/McpSection.tsx +25 -3
- package/src/client/components/common/harness-glyph/brands.ts +3 -0
- package/src/client/components/common/harness-glyph/omo.ts +22 -0
- package/src/client/components/common/server-control/Panel.tsx +24 -86
- package/src/client/components/common/server-control/Row.tsx +98 -0
- package/src/client/components/common/server-control/index.test.tsx +69 -9
- package/src/client/components/layout/VisibilityMenu.tsx +18 -6
- package/src/client/components/layout/new-workspace-host/index.test.tsx +84 -0
- package/src/client/components/layout/new-workspace-host/index.tsx +35 -0
- package/src/client/components/mobile/header-titlebar.test.tsx +38 -3
- package/src/client/components/settings/Sidebar.tsx +2 -1
- package/src/client/components/settings/categories/GitSettings.tsx +31 -0
- package/src/client/components/settings/categories/git-settings/CommitMessageSection.tsx +292 -0
- package/src/client/components/settings/categories/git-settings/IdentitySection.tsx +215 -0
- package/src/client/components/settings/category-content.tsx +3 -0
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +8 -0
- package/src/client/components/workspace/chat-timeline/MessageList.test.ts +55 -2
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +13 -1
- package/src/client/components/workspace/chat-timeline/PendingChatView.tsx +56 -50
- package/src/client/components/workspace/chat-timeline/ThinkingSection.test.tsx +38 -2
- package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +13 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +50 -0
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +20 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +2 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +1 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +3 -2
- package/src/client/components/workspace/git-panel/CommitBox.test.tsx +98 -0
- package/src/client/components/workspace/git-panel/CommitBox.tsx +68 -3
- package/src/client/components/workspace/git-panel/index.test.ts +12 -0
- package/src/client/components/workspace/git-panel/index.tsx +20 -1
- package/src/client/components/workspace/repo-picker/index.test.tsx +20 -0
- package/src/client/components/workspace/repo-picker/index.tsx +5 -6
- package/src/client/data/settings/omp-schema.json +134 -8
- package/src/client/hooks/chat/context/mcp.ts +19 -1
- package/src/client/hooks/chat/timeline/jump-rail.ts +1 -0
- package/src/client/hooks/chat/timeline/row-window.test.ts +38 -3
- package/src/client/hooks/chat/timeline/row-window.ts +33 -9
- package/src/client/hooks/chat/timeline/scroll-geometry.ts +19 -1
- package/src/client/hooks/chat/timeline/scroll.ts +15 -0
- package/src/client/hooks/chat/timeline/thinking-open.ts +10 -4
- package/src/client/hooks/workspace/commit-box.test.ts +62 -1
- package/src/client/hooks/workspace/commit-box.ts +94 -2
- package/src/client/hooks/workspace/git-panel-data.ts +15 -7
- package/src/client/hooks/workspace/repo-scope/index.test.ts +10 -3
- package/src/client/hooks/workspace/repo-scope/index.ts +21 -9
- package/src/client/lib/plugins/repo-scope-service.ts +7 -25
- package/src/server/lib/chat/session-store.server.ts +22 -1
- package/src/server/lib/fs/git-commit-context.test.ts +111 -0
- package/src/server/lib/fs/git-commit-context.ts +85 -0
- package/src/server/lib/fs/git-commit-message.server.ts +251 -0
- package/src/server/lib/fs/git-commit-message.test.ts +211 -0
- package/src/server/lib/fs/git-commit-prompt.test.ts +69 -0
- package/src/server/lib/fs/git-commit-prompt.ts +57 -0
- package/src/server/lib/fs/git-commit-settings.server.ts +42 -0
- package/src/server/lib/fs/git-identity.server.test.ts +129 -0
- package/src/server/lib/fs/git-identity.server.ts +130 -0
- package/src/server/lib/harness/acp/acp-audit.server.ts +13 -62
- package/src/server/lib/harness/acp/acp-frames.server.test.ts +105 -0
- package/src/server/lib/harness/acp/acp-frames.server.ts +217 -0
- package/src/server/lib/harness/acp/acp-raw-messages.server.test.ts +69 -0
- package/src/server/lib/harness/acp/acp-raw-messages.server.ts +129 -0
- package/src/server/lib/harness/acp/acp-telemetry.server.ts +19 -0
- package/src/server/lib/harness/acp/one-shot.server.ts +141 -0
- package/src/server/lib/harness/acp/raw-listeners.ts +30 -0
- package/src/server/lib/harness/acp/session-handshake.ts +11 -3
- package/src/server/lib/harness/acp/session.test-util.ts +2 -0
- package/src/server/lib/harness/acp/session.ts +8 -0
- package/src/server/lib/harness/capabilities.ts +11 -0
- package/src/server/lib/harness/launch-table.ts +19 -0
- package/src/server/lib/harness/launch.ts +4 -0
- package/src/server/lib/harness/schema.server.ts +23 -0
- package/src/server/lib/harness/spawn.server.ts +18 -2
- package/src/server/lib/mcp/agent-config.server.test.ts +111 -0
- package/src/server/lib/mcp/agent-config.server.ts +205 -0
- package/src/server/lib/mcp/probe.server.ts +7 -1
- package/src/server/lib/mcp/registry.server.ts +4 -3
- package/src/server/lib/mcp/secrets.server.test.ts +85 -0
- package/src/server/lib/mcp/secrets.server.ts +108 -0
- package/src/server/lib/omp/core/print.server.ts +100 -0
- package/src/server/lib/omp/rpc/frame-fold.ts +4 -0
- package/src/server/lib/omp/session/artifacts.server.test.ts +15 -5
- package/src/server/lib/omp/session/artifacts.server.ts +41 -26
- package/src/server/lib/omp/session/delete.server.ts +2 -0
- package/src/server/lib/omp/session/goal-auditor.server.ts +10 -48
- package/src/server/lib/realtime/topics/session-data.server.ts +6 -14
- package/src/server/routes/fs/git-message.test.ts +101 -0
- package/src/server/routes/fs/git-message.ts +60 -0
- package/src/server/routes/fs/index.ts +2 -0
- package/src/server/routes/omp/artifact.ts +4 -3
- package/src/server/routes/sessions/mcp.test.ts +65 -1
- package/src/server/routes/sessions/mcp.ts +77 -5
- package/src/server/routes/settings/git-identity.test.ts +77 -0
- package/src/server/routes/settings/git-identity.ts +47 -0
- package/src/server/routes/settings/index.ts +2 -0
- package/src/server/routes/telemetry/acp-telemetry.test.ts +149 -0
- package/src/server/routes/telemetry/context.ts +31 -0
- package/src/server/routes/telemetry/raw-messages.ts +34 -0
- package/src/shared/lib/chat/tool/artifact.test.ts +4 -2
- package/src/shared/lib/chat/tool/artifact.ts +6 -1
- package/src/shared/lib/chat/tool/proc-facts.ts +2 -1
- package/src/shared/lib/fs/paths.test.ts +2 -0
- package/src/shared/lib/fs/repo-label.test.ts +22 -1
- package/src/shared/lib/fs/repo-label.ts +29 -0
- package/src/shared/lib/git/commit-prompt.test.ts +47 -0
- package/src/shared/lib/git/commit-prompt.ts +72 -0
- package/src/shared/lib/git/identity.test.ts +46 -0
- package/src/shared/lib/git/identity.ts +70 -0
- package/src/shared/lib/harness/brand-color.ts +3 -0
- package/src/shared/lib/harness/catalog.test.ts +14 -0
- package/src/shared/lib/harness/catalog.ts +9 -1
- package/src/shared/lib/harness/mcp-facts.ts +4 -0
- package/src/shared/lib/harness/provider-facts.test.ts +11 -0
- package/src/shared/lib/harness/provider-facts.ts +14 -0
- package/src/shared/lib/harness/providers.ts +2 -2
- package/src/shared/lib/harness/updates.test.ts +8 -0
- package/src/shared/lib/harness/updates.ts +9 -0
- package/src/shared/lib/omp/session/proc-daemon.ts +124 -0
- package/src/shared/lib/omp/session/proc.test.ts +30 -3
- package/src/shared/lib/omp/session/proc.ts +6 -82
- package/src/shared/lib/omp/session/wait-idle.test.ts +15 -4
- package/src/shared/lib/omp/session/wait-idle.ts +11 -4
- package/src/shared/lib/settings/defaults.ts +5 -0
- package/src/shared/lib/workspace/new-workspace.ts +20 -0
- package/src/shared/types/settings/mcp.ts +2 -2
- package/src/shared/types/settings/state.ts +16 -0
- package/src/test-support/preload.ts +1 -0
- package/dist/client/static/js/ImageView-bxqw3t4k.js +0 -1
- package/dist/client/static/js/LayoutWrapper-zt14rv9m.js +0 -2
- package/dist/client/static/js/Modal-cm35g20x.js +0 -38
- package/dist/client/static/js/SessionsView-gn53zyn7.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-cagtcfhk.js +0 -1
- package/dist/client/static/js/bash-fjzhxy10.js +0 -1
- package/dist/client/static/js/c-wqtyezvw.js +0 -1
- package/dist/client/static/js/cpp-y0nzwner.js +0 -1
- package/dist/client/static/js/css-n2waj098.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-6g2ydrss.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-b774qbn2.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-nznq0n36.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-b047d6vk.js +0 -1
- package/dist/client/static/js/graphql-gvb7e2eb.js +0 -1
- package/dist/client/static/js/html-tbz83eke.js +0 -1
- package/dist/client/static/js/index-0gbj4270.js +0 -2
- package/dist/client/static/js/index-38xv8h4t.js +0 -1
- package/dist/client/static/js/index-f4vr1c6e.css +0 -1
- package/dist/client/static/js/index-fb6pw9xb.js +0 -2
- package/dist/client/static/js/index-pzvr1699.js +0 -478
- package/dist/client/static/js/index-rf29f3fq.js +0 -9
- package/dist/client/static/js/index-zw621xez.js +0 -4
- package/dist/client/static/js/info-A6RAGUB7-n495k952.js +0 -1
- package/dist/client/static/js/ini-2gvjwh83.js +0 -1
- package/dist/client/static/js/java-1xwcq79s.js +0 -1
- package/dist/client/static/js/json-4pqjabgq.js +0 -1
- package/dist/client/static/js/jsx-wcsss15s.js +0 -1
- package/dist/client/static/js/lua-h7vjcn0h.js +0 -1
- package/dist/client/static/js/markdown-f30jjjh9.js +0 -1
- package/dist/client/static/js/one-dark-pro-qmyne0tn.js +0 -1
- package/dist/client/static/js/one-light-dj0ecjcj.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-zajj62z6.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-1ve78y5f.js +0 -1
- package/dist/client/static/js/properties-ymexza6q.js +0 -1
- package/dist/client/static/js/python-31ycwa66.js +0 -1
- package/dist/client/static/js/r-t2nne4xp.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-8rqadb58.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-v6ppm8dy.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-9j6bae14.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-56cpyt0g.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-yfdmspf4.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-qr5hdxm4.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-vwpg3wp8.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-htfxwd32.js +0 -1
- package/dist/client/static/js/typescript-p3syh43m.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-hapfjkzq.js +0 -1
- package/dist/client/static/js/xml-4enq788a.js +0 -1
- package/dist/client/static/js/yaml-pjtt3jsc.js +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{be}from"./index-1y3rzw6b.js";import{t,l,V,C,ee,$r,R,F,z,P,U,q,j,p,h,de,zf,Fi,lr,se,Cn,on}from"./index-cz50ha6x.js";import{De}from"./index-b42t14wk.js";import{Pr}from"./index-qsw5edtk.js";import{mn,In}from"./index-pxtff3ez.js";var Re=In(function(me,Ie){(function(I,A){if(typeof me==="object"&&typeof Ie==="object")Ie.exports=A();else if(typeof define==="function"&&define.amd)define([],A);else if(typeof me==="object")me.layoutBase=A();else I.layoutBase=A()})(me,function(){return function(w){var I={};function A(v){if(I[v])return I[v].exports;var f=I[v]={i:v,l:!1,exports:{}};return w[v].call(f.exports,f,f.exports,A),f.l=!0,f.exports}return A.m=w,A.c=I,A.i=function(v){return v},A.d=function(v,f,o){if(!A.o(v,f))Object.defineProperty(v,f,{configurable:!1,enumerable:!0,get:o})},A.n=function(v){var f=v&&v.__esModule?function(){return v.default}:function(){return v};return A.d(f,"a",f),f},A.o=function(v,f){return Object.prototype.hasOwnProperty.call(v,f)},A.p="",A(A.s=28)}([function(w,I,A){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1000,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,w.exports=v},function(w,I,A){var v=A(2),f=A(8),o=A(9);function n(u,r,y){v.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=u,this.target=r}n.prototype=Object.create(v.prototype);for(var a in v)n[a]=v[a];n.prototype.getSource=function(){return this.source},n.prototype.getTarget=function(){return this.target},n.prototype.isInterGraph=function(){return this.isInterGraph},n.prototype.getLength=function(){return this.length},n.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},n.prototype.getBendpoints=function(){return this.bendpoints},n.prototype.getLca=function(){return this.lca},n.prototype.getSourceInLca=function(){return this.sourceInLca},n.prototype.getTargetInLca=function(){return this.targetInLca},n.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;else if(this.target===u)return this.source;else throw"Node is not incident with this edge"},n.prototype.getOtherEndInGraph=function(u,r){var y=this.getOtherEnd(u),i=r.getGraphManager().getRoot();while(!0){if(y.getOwner()==r)return y;if(y.getOwner()==i)break;y=y.getOwner().getParent()}return null},n.prototype.updateLength=function(){var u=[,,,,];if(this.isOverlapingSourceAndTarget=f.getIntersection(this.target.getRect(),this.source.getRect(),u),!this.isOverlapingSourceAndTarget){if(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},n.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},w.exports=n},function(w,I,A){function v(f){this.vGraphObject=f}w.exports=v},function(w,I,A){var v=A(2),f=A(10),o=A(13),n=A(0),a=A(16),u=A(5);function r(i,e,g,d){if(g==null&&d==null)d=e;if(v.call(this,d),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=f.MIN_VALUE,this.inclusionTreeDepth=f.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,g!=null&&e!=null)this.rect=new o(e.x,e.y,g.width,g.height);else this.rect=new o}r.prototype=Object.create(v.prototype);for(var y in v)r[y]=v[y];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(i){this.rect.width=i},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(i){this.rect.height=i},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(i,e){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=e.width,this.rect.height=e.height},r.prototype.setCenter=function(i,e){this.rect.x=i-this.rect.width/2,this.rect.y=e-this.rect.height/2},r.prototype.setLocation=function(i,e){this.rect.x=i,this.rect.y=e},r.prototype.moveBy=function(i,e){this.rect.x+=i,this.rect.y+=e},r.prototype.getEdgeListToNode=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(c.target==i){if(c.source!=d)throw"Incorrect edge source!";e.push(c)}}),e},r.prototype.getEdgesBetween=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(!(c.source==d||c.target==d))throw"Incorrect edge source and/or target";if(c.target==i||c.source==i)e.push(c)}),e},r.prototype.getNeighborsList=function(){var i=new Set,e=this;return e.edges.forEach(function(g){if(g.source==e)i.add(g.target);else{if(g.target!=e)throw"Incorrect incidency!";i.add(g.source)}}),i},r.prototype.withChildren=function(){var i=new Set,e,g;if(i.add(this),this.child!=null){var d=this.child.getNodes();for(var c=0;c<d.length;c++)e=d[c],g=e.withChildren(),g.forEach(function(O){i.add(O)})}return i},r.prototype.getNoOfChildren=function(){var i=0,e;if(this.child==null)i=1;else{var g=this.child.getNodes();for(var d=0;d<g.length;d++)e=g[d],i+=e.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},r.prototype.scatter=function(){var i,e,g=-n.INITIAL_WORLD_BOUNDARY,d=n.INITIAL_WORLD_BOUNDARY;i=n.WORLD_CENTER_X+a.nextDouble()*(d-g)+g;var c=-n.INITIAL_WORLD_BOUNDARY,O=n.INITIAL_WORLD_BOUNDARY;e=n.WORLD_CENTER_Y+a.nextDouble()*(O-c)+c,this.rect.x=i,this.rect.y=e},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),n.NODE_DIMENSIONS_INCLUDE_LABELS){var e=i.getRight()-i.getLeft(),g=i.getBottom()-i.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>e)this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(e+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(g+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>g)this.rect.y-=(this.labelHeight-g)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(g+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==f.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(i){var e=this.rect.x;if(e>n.WORLD_BOUNDARY)e=n.WORLD_BOUNDARY;else if(e<-n.WORLD_BOUNDARY)e=-n.WORLD_BOUNDARY;var g=this.rect.y;if(g>n.WORLD_BOUNDARY)g=n.WORLD_BOUNDARY;else if(g<-n.WORLD_BOUNDARY)g=-n.WORLD_BOUNDARY;var d=new u(e,g),c=i.inverseTransformPoint(d);this.setLocation(c.x,c.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},w.exports=r},function(w,I,A){var v=A(0);function f(){}for(var o in v)f[o]=v[o];f.MAX_ITERATIONS=2500,f.DEFAULT_EDGE_LENGTH=50,f.DEFAULT_SPRING_STRENGTH=0.45,f.DEFAULT_REPULSION_STRENGTH=4500,f.DEFAULT_GRAVITY_STRENGTH=0.4,f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,f.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,f.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,f.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,f.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,f.COOLING_ADAPTATION_FACTOR=0.33,f.ADAPTATION_LOWER_NODE_LIMIT=1000,f.ADAPTATION_UPPER_NODE_LIMIT=5000,f.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,f.MAX_NODE_DISPLACEMENT=f.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,f.CONVERGENCE_CHECK_PERIOD=100,f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,f.MIN_EDGE_LENGTH=1,f.GRID_CALCULATION_CHECK_PERIOD=10,w.exports=f},function(w,I,A){function v(f,o){if(f==null&&o==null)this.x=0,this.y=0;else this.x=f,this.y=o}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(f){this.x=f},v.prototype.setY=function(f){this.y=f},v.prototype.getDifference=function(f){return new DimensionD(this.x-f.x,this.y-f.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(f){return this.x+=f.width,this.y+=f.height,this},w.exports=v},function(w,I,A){var v=A(2),f=A(10),o=A(0),n=A(7),a=A(3),u=A(1),r=A(13),y=A(12),i=A(11);function e(d,c,O){if(v.call(this,O),this.estimatedSize=f.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,c!=null&&c instanceof n)this.graphManager=c;else if(c!=null&&c instanceof Layout)this.graphManager=c.graphManager}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getNodes=function(){return this.nodes},e.prototype.getEdges=function(){return this.edges},e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getParent=function(){return this.parent},e.prototype.getLeft=function(){return this.left},e.prototype.getRight=function(){return this.right},e.prototype.getTop=function(){return this.top},e.prototype.getBottom=function(){return this.bottom},e.prototype.isConnected=function(){return this.isConnected},e.prototype.add=function(d,c,O){if(c==null&&O==null){var T=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(T)>-1)throw"Node already in graph!";return T.owner=this,this.getNodes().push(T),T}else{var N=d;if(!(this.getNodes().indexOf(c)>-1&&this.getNodes().indexOf(O)>-1))throw"Source or target not in graph!";if(!(c.owner==O.owner&&c.owner==this))throw"Both owners must be this graph!";if(c.owner!=O.owner)return null;if(N.source=c,N.target=O,N.isInterGraph=!1,this.getEdges().push(N),c.edges.push(N),O!=c)O.edges.push(N);return N}},e.prototype.remove=function(d){var c=d;if(d instanceof a){if(c==null)throw"Node is null!";if(!(c.owner!=null&&c.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var O=c.edges.slice(),T,N=O.length;for(var D=0;D<N;D++)if(T=O[D],T.isInterGraph)this.graphManager.remove(T);else T.source.owner.remove(T);var X=this.nodes.indexOf(c);if(X==-1)throw"Node not in owner node list!";this.nodes.splice(X,1)}else if(d instanceof u){var T=d;if(T==null)throw"Edge is null!";if(!(T.source!=null&&T.target!=null))throw"Source and/or target is null!";if(!(T.source.owner!=null&&T.target.owner!=null&&T.source.owner==this&&T.target.owner==this))throw"Source and/or target owner is invalid!";var x=T.source.edges.indexOf(T),W=T.target.edges.indexOf(T);if(!(x>-1&&W>-1))throw"Source and/or target doesn't know this edge!";if(T.source.edges.splice(x,1),T.target!=T.source)T.target.edges.splice(W,1);var X=T.source.owner.getEdges().indexOf(T);if(X==-1)throw"Not in owner's edge list!";T.source.owner.getEdges().splice(X,1)}},e.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:c}=f,O,T,N,D=this.getNodes(),X=D.length;for(var x=0;x<X;x++){var W=D[x];if(O=W.getTop(),T=W.getLeft(),d>O)d=O;if(c>T)c=T}if(d==f.MAX_VALUE)return null;if(D[0].getParent().paddingLeft!=null)N=D[0].getParent().paddingLeft;else N=this.margin;return this.left=c-N,this.top=d-N,new y(this.left,this.top)},e.prototype.updateBounds=function(d){var c=f.MAX_VALUE,O=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,D,X,x,W,_,Q=this.nodes,lt=Q.length;for(var G=0;G<lt;G++){var tt=Q[G];if(d&&tt.child!=null)tt.updateBounds();if(D=tt.getLeft(),X=tt.getRight(),x=tt.getTop(),W=tt.getBottom(),c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<W)N=W}var s=new r(c,T,O-c,N-T);if(c==f.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(Q[0].getParent().paddingLeft!=null)_=Q[0].getParent().paddingLeft;else _=this.margin;this.left=s.x-_,this.right=s.x+s.width+_,this.top=s.y-_,this.bottom=s.y+s.height+_},e.calculateBounds=function(d){var c=f.MAX_VALUE,O=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,D,X,x,W,_=d.length;for(var Q=0;Q<_;Q++){var lt=d[Q];if(D=lt.getLeft(),X=lt.getRight(),x=lt.getTop(),W=lt.getBottom(),c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<W)N=W}var G=new r(c,T,O-c,N-T);return G},e.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){var d=0,c=this.nodes,O=c.length;for(var T=0;T<O;T++){var N=c[T];d+=N.calcEstimatedSize()}if(d==0)this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},e.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var c=new i,O=new Set,T=this.nodes[0],N,D,X=T.withChildren();X.forEach(function(G){c.push(G),O.add(G)});while(c.length!==0){T=c.shift(),N=T.getEdges();var x=N.length;for(var W=0;W<x;W++){var _=N[W];if(D=_.getOtherEndInGraph(T,this),D!=null&&!O.has(D)){var Q=D.withChildren();Q.forEach(function(G){c.push(G),O.add(G)})}}}if(this.isConnected=!1,O.size>=this.nodes.length){var lt=0;if(O.forEach(function(G){if(G.owner==d)lt++}),lt==this.nodes.length)this.isConnected=!0}},w.exports=e},function(w,I,A){var v,f=A(1);function o(n){v=A(6),this.layout=n,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var n=this.layout.newGraph(),a=this.layout.newNode(null),u=this.add(n,a);return this.setRootGraph(u),this.rootGraph},o.prototype.add=function(n,a,u,r,y){if(u==null&&r==null&&y==null){if(n==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(n)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(n),n.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return n.parent=a,a.child=n,n}else{y=u,r=a,u=n;var i=r.getOwner(),e=y.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(e!=null&&e.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==e)return u.isInterGraph=!1,i.add(u,r,y);else{if(u.isInterGraph=!0,u.source=r,u.target=y,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}}},o.prototype.remove=function(n){if(n instanceof v){var a=n;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 u=[];u=u.concat(a.getEdges());var r,y=u.length;for(var i=0;i<y;i++)r=u[i],a.remove(r);var e=[];e=e.concat(a.getNodes());var g;y=e.length;for(var i=0;i<y;i++)g=e[i],a.remove(g);if(a==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(a);this.graphs.splice(d,1),a.parent=null}else if(n instanceof f){if(r=n,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var d=r.source.edges.indexOf(r);if(r.source.edges.splice(d,1),d=r.target.edges.indexOf(r),r.target.edges.splice(d,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var d=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<u;r++)n=n.concat(a[r].getNodes());this.allNodes=n}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<a.length;r++)n=n.concat(a[r].getEdges());n=n.concat(this.edges),this.allEdges=n}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(n){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=n},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(n){if(n.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=n,n.parent==null)n.parent=this.layout.newNode("Root node")},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(n,a){if(!(n!=null&&a!=null))throw"assert failed";if(n==a)return!0;var u=n.getOwner(),r;do{if(r=u.getParent(),r==null)break;if(r==a)return!0;if(u=r.getOwner(),u==null)break}while(!0);u=a.getOwner();do{if(r=u.getParent(),r==null)break;if(r==n)return!0;if(u=r.getOwner(),u==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){var n,a,u,r,y,i=this.getAllEdges(),e=i.length;for(var g=0;g<e;g++){if(n=i[g],a=n.source,u=n.target,n.lca=null,n.sourceInLca=a,n.targetInLca=u,a==u){n.lca=a.getOwner();continue}r=a.getOwner();while(n.lca==null){n.targetInLca=u,y=u.getOwner();while(n.lca==null){if(y==r){n.lca=y;break}if(y==this.rootGraph)break;if(n.lca!=null)throw"assert failed";n.targetInLca=y.getParent(),y=n.targetInLca.getOwner()}if(r==this.rootGraph)break;if(n.lca==null)n.sourceInLca=r.getParent(),r=n.sourceInLca.getOwner()}if(n.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(n,a){if(n==a)return n.getOwner();var u=n.getOwner();do{if(u==null)break;var r=a.getOwner();do{if(r==null)break;if(r==u)return r;r=r.getParent().getOwner()}while(!0);u=u.getParent().getOwner()}while(!0);return u},o.prototype.calcInclusionTreeDepths=function(n,a){if(n==null&&a==null)n=this.rootGraph,a=1;var u,r=n.getNodes(),y=r.length;for(var i=0;i<y;i++)if(u=r[i],u.inclusionTreeDepth=a,u.child!=null)this.calcInclusionTreeDepths(u.child,a+1)},o.prototype.includesInvalidEdge=function(){var n,a=[],u=this.edges.length;for(var r=0;r<u;r++)if(n=this.edges[r],this.isOneAncestorOfOther(n.source,n.target))a.push(n);for(var r=0;r<a.length;r++)this.remove(a[r]);return!1},w.exports=o},function(w,I,A){var v=A(12);function f(){}f.calcSeparationAmount=function(o,n,a,u){if(!o.intersects(n))throw"assert failed";var r=[,,];if(this.decideDirectionsForOverlappingNodes(o,n,r),a[0]=Math.min(o.getRight(),n.getRight())-Math.max(o.x,n.x),a[1]=Math.min(o.getBottom(),n.getBottom())-Math.max(o.y,n.y),o.getX()<=n.getX()&&o.getRight()>=n.getRight())a[0]+=Math.min(n.getX()-o.getX(),o.getRight()-n.getRight());else if(n.getX()<=o.getX()&&n.getRight()>=o.getRight())a[0]+=Math.min(o.getX()-n.getX(),n.getRight()-o.getRight());if(o.getY()<=n.getY()&&o.getBottom()>=n.getBottom())a[1]+=Math.min(n.getY()-o.getY(),o.getBottom()-n.getBottom());else if(n.getY()<=o.getY()&&n.getBottom()>=o.getBottom())a[1]+=Math.min(o.getY()-n.getY(),n.getBottom()-o.getBottom());var y=Math.abs((n.getCenterY()-o.getCenterY())/(n.getCenterX()-o.getCenterX()));if(n.getCenterY()===o.getCenterY()&&n.getCenterX()===o.getCenterX())y=1;var i=y*a[0],e=a[1]/y;if(a[0]<e)e=a[0];else i=a[1];a[0]=-1*r[0]*(e/2+u),a[1]=-1*r[1]*(i/2+u)},f.decideDirectionsForOverlappingNodes=function(o,n,a){if(o.getCenterX()<n.getCenterX())a[0]=-1;else a[0]=1;if(o.getCenterY()<n.getCenterY())a[1]=-1;else a[1]=1},f.getIntersection2=function(o,n,a){var u=o.getCenterX(),r=o.getCenterY(),y=n.getCenterX(),i=n.getCenterY();if(o.intersects(n))return a[0]=u,a[1]=r,a[2]=y,a[3]=i,!0;var e=o.getX(),g=o.getY(),d=o.getRight(),c=o.getX(),O=o.getBottom(),T=o.getRight(),N=o.getWidthHalf(),D=o.getHeightHalf(),X=n.getX(),x=n.getY(),W=n.getRight(),_=n.getX(),Q=n.getBottom(),lt=n.getRight(),G=n.getWidthHalf(),tt=n.getHeightHalf(),s=!1,L=!1;if(u===y){if(r>i)return a[0]=u,a[1]=g,a[2]=y,a[3]=Q,!1;else if(r<i)return a[0]=u,a[1]=O,a[2]=y,a[3]=x,!1}else if(r===i){if(u>y)return a[0]=e,a[1]=r,a[2]=W,a[3]=i,!1;else if(u<y)return a[0]=d,a[1]=r,a[2]=X,a[3]=i,!1}else{var E=o.height/o.width,M=n.height/n.width,m=(i-r)/(y-u),Y=void 0,b=void 0,k=void 0,B=void 0,H=void 0,st=void 0;if(-E===m)if(u>y)a[0]=c,a[1]=O,s=!0;else a[0]=d,a[1]=g,s=!0;else if(E===m)if(u>y)a[0]=e,a[1]=g,s=!0;else a[0]=T,a[1]=O,s=!0;if(-M===m)if(y>u)a[2]=_,a[3]=Q,L=!0;else a[2]=W,a[3]=x,L=!0;else if(M===m)if(y>u)a[2]=X,a[3]=x,L=!0;else a[2]=lt,a[3]=Q,L=!0;if(s&&L)return!1;if(u>y)if(r>i)Y=this.getCardinalDirection(E,m,4),b=this.getCardinalDirection(M,m,2);else Y=this.getCardinalDirection(-E,m,3),b=this.getCardinalDirection(-M,m,1);else if(r>i)Y=this.getCardinalDirection(-E,m,1),b=this.getCardinalDirection(-M,m,3);else Y=this.getCardinalDirection(E,m,2),b=this.getCardinalDirection(M,m,4);if(!s)switch(Y){case 1:B=g,k=u+-D/m,a[0]=k,a[1]=B;break;case 2:k=T,B=r+N*m,a[0]=k,a[1]=B;break;case 3:B=O,k=u+D/m,a[0]=k,a[1]=B;break;case 4:k=c,B=r+-N*m,a[0]=k,a[1]=B;break}if(!L)switch(b){case 1:st=x,H=y+-tt/m,a[2]=H,a[3]=st;break;case 2:H=lt,st=i+G*m,a[2]=H,a[3]=st;break;case 3:st=Q,H=y+tt/m,a[2]=H,a[3]=st;break;case 4:H=_,st=i+-G*m,a[2]=H,a[3]=st;break}}return!1},f.getCardinalDirection=function(o,n,a){if(o>n)return a;else return 1+a%4},f.getIntersection=function(o,n,a,u){if(u==null)return this.getIntersection2(o,n,a);var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:O}=u,T=void 0,N=void 0,D=void 0,X=void 0,x=void 0,W=void 0,_=void 0,Q=void 0,lt=void 0;if(D=e-y,x=r-i,_=i*y-r*e,X=O-d,W=g-c,Q=c*d-g*O,lt=D*W-X*x,lt===0)return null;return T=(x*Q-W*_)/lt,N=(X*_-D*Q)/lt,new v(T,N)},f.angleOfVector=function(o,n,a,u){var r=void 0;if(o!==a){if(r=Math.atan((u-n)/(a-o)),a<o)r+=Math.PI;else if(u<n)r+=this.TWO_PI}else if(u<n)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},f.doIntersect=function(o,n,a,u){var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:O}=u,T=(i-r)*(O-d)-(c-g)*(e-y);if(T===0)return!1;else{var N=((O-d)*(c-r)+(g-c)*(O-y))/T,D=((y-e)*(c-r)+(i-r)*(O-y))/T;return 0<N&&N<1&&0<D&&D<1}},f.findCircleLineIntersections=function(o,n,a,u,r,y,i){var e=(a-o)*(a-o)+(u-n)*(u-n),g=2*((o-r)*(a-o)+(n-y)*(u-n)),d=(o-r)*(o-r)+(n-y)*(n-y)-i*i,c=g*g-4*e*d;if(c>=0){var O=(-g+Math.sqrt(g*g-4*e*d))/(2*e),T=(-g-Math.sqrt(g*g-4*e*d))/(2*e),N=null;if(O>=0&&O<=1)return[O];if(T>=0&&T<=1)return[T];return N}else return null},f.HALF_PI=0.5*Math.PI,f.ONE_AND_HALF_PI=1.5*Math.PI,f.TWO_PI=2*Math.PI,f.THREE_PI=3*Math.PI,w.exports=f},function(w,I,A){function v(){}v.sign=function(f){if(f>0)return 1;else if(f<0)return-1;else return 0},v.floor=function(f){return f<0?Math.ceil(f):Math.floor(f)},v.ceil=function(f){return f<0?Math.floor(f):Math.ceil(f)},w.exports=v},function(w,I,A){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,w.exports=v},function(w,I,A){var v=function(){function r(y,i){for(var e=0;e<i.length;e++){var g=i[e];if(g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g)g.writable=!0;Object.defineProperty(y,g.key,g)}}return function(y,i,e){if(i)r(y.prototype,i);if(e)r(y,e);return y}}();function f(r,y){if(!(r instanceof y))throw TypeError("Cannot call a class as a function")}var o=function(y){return{value:y,next:null,prev:null}},n=function(y,i,e,g){if(y!==null)y.next=i;else g.head=i;if(e!==null)e.prev=i;else g.tail=i;return i.prev=y,i.next=e,g.length++,i},a=function(y,i){var{prev:e,next:g}=y;if(e!==null)e.next=g;else i.head=g;if(g!==null)g.prev=e;else i.tail=e;return y.prev=y.next=null,i.length--,y},u=function(){function r(y){var i=this;if(f(this,r),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(e){return i.push(e)})}return v(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,e){return n(e.prev,o(i),e,this)}},{key:"insertAfter",value:function(i,e){return n(e,o(i),e.next,this)}},{key:"insertNodeBefore",value:function(i,e){return n(e.prev,i,e,this)}},{key:"insertNodeAfter",value:function(i,e){return n(e,i,e.next,this)}},{key:"push",value:function(i){return n(this.tail,o(i),null,this)}},{key:"unshift",value:function(i){return n(null,o(i),this.head,this)}},{key:"remove",value:function(i){return a(i,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(i){if(i<=this.length()){var e=1,g=this.head;while(e<i)g=g.next,e++;return g.value}}},{key:"set_object_at",value:function(i,e){if(i<=this.length()){var g=1,d=this.head;while(g<i)d=d.next,g++;d.value=e}}}]),r}();w.exports=u},function(w,I,A){function v(f,o,n){if(this.x=null,this.y=null,f==null&&o==null&&n==null)this.x=0,this.y=0;else if(typeof f=="number"&&typeof o=="number"&&n==null)this.x=f,this.y=o;else if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.x=n.x,this.y=n.y}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(f,o,n){if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.setLocation(n.x,n.y);else if(typeof f=="number"&&typeof o=="number"&&n==null)if(parseInt(f)==f&&parseInt(o)==o)this.move(f,o);else this.x=Math.floor(f+0.5),this.y=Math.floor(o+0.5)},v.prototype.move=function(f,o){this.x=f,this.y=o},v.prototype.translate=function(f,o){this.x+=f,this.y+=o},v.prototype.equals=function(f){if(f.constructor.name=="Point"){var o=f;return this.x==o.x&&this.y==o.y}return this==f},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},w.exports=v},function(w,I,A){function v(f,o,n,a){if(this.x=0,this.y=0,this.width=0,this.height=0,f!=null&&o!=null&&n!=null&&a!=null)this.x=f,this.y=o,this.width=n,this.height=a}v.prototype.getX=function(){return this.x},v.prototype.setX=function(f){this.x=f},v.prototype.getY=function(){return this.y},v.prototype.setY=function(f){this.y=f},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(f){if(this.getRight()<f.x)return!1;if(this.getBottom()<f.y)return!1;if(f.getRight()<this.x)return!1;if(f.getBottom()<this.y)return!1;return!0},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},w.exports=v},function(w,I,A){var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol==="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function f(){}f.lastID=0,f.createID=function(o){if(f.isPrimitive(o))return o;if(o.uniqueID!=null)return o.uniqueID;return o.uniqueID=f.getString(),f.lastID++,o.uniqueID},f.getString=function(o){if(o==null)o=f.lastID;return"Object#"+o},f.isPrimitive=function(o){var n=typeof o>"u"?"undefined":v(o);return o==null||n!="object"&&n!="function"},w.exports=f},function(w,I,A){function v(g){if(Array.isArray(g)){for(var d=0,c=Array(g.length);d<g.length;d++)c[d]=g[d];return c}else return Array.from(g)}var f=A(0),o=A(7),n=A(3),a=A(1),u=A(6),r=A(5),y=A(17),i=A(29);function e(g){if(i.call(this),this.layoutQuality=f.QUALITY,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=f.DEFAULT_INCREMENTAL,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null)this.isRemoteUse=g}e.RANDOM_SEED=1,e.prototype=Object.create(i.prototype),e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},e.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},e.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},e.prototype.newGraphManager=function(){var g=new o(this);return this.graphManager=g,g},e.prototype.newGraph=function(g){return new u(null,this.graphManager,g)},e.prototype.newNode=function(g){return new n(this.graphManager,g)},e.prototype.newEdge=function(g){return new a(null,null,g)},e.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},e.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var g;if(this.checkLayoutSuccess())g=!1;else g=this.layout();if(f.ANIMATE==="during")return!1;if(g){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,g},e.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},e.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var g,d=this.graphManager.getAllEdges();for(var c=0;c<d.length;c++)g=d[c];var O,T=this.graphManager.getRoot().getNodes();for(var c=0;c<T.length;c++)O=T[c];this.update(this.graphManager.getRoot())}},e.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof n){var d=g;if(d.getChild()!=null){var c=d.getChild().getNodes();for(var O=0;O<c.length;O++)update(c[O])}if(d.vGraphObject!=null){var T=d.vGraphObject;T.update(d)}}else if(g instanceof a){var N=g;if(N.vGraphObject!=null){var D=N.vGraphObject;D.update(N)}}else if(g instanceof u){var X=g;if(X.vGraphObject!=null){var x=X.vGraphObject;x.update(X)}}},e.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=f.QUALITY,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=f.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},e.prototype.transform=function(g){if(g==null)this.transform(new r(0,0));else{var d=new y,c=this.graphManager.getRoot().updateLeftTop();if(c!=null){d.setWorldOrgX(g.x),d.setWorldOrgY(g.y),d.setDeviceOrgX(c.x),d.setDeviceOrgY(c.y);var O=this.getAllNodes(),T;for(var N=0;N<O.length;N++)T=O[N],T.transform(d)}}},e.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,c,O=g.getNodes();for(var T=0;T<O.length;T++)if(d=O[T],c=d.getChild(),c==null)d.scatter();else if(c.getNodes().length==0)d.scatter();else this.positionNodesRandomly(c),d.updateBounds()}},e.prototype.getFlatForest=function(){var g=[],d=!0,c=this.graphManager.getRoot().getNodes(),O=!0;for(var T=0;T<c.length;T++)if(c[T].getChild()!=null)O=!1;if(!O)return g;var N=new Set,D=[],X=new Map,x=[];x=x.concat(c);while(x.length>0&&d){D.push(x[0]);while(D.length>0&&d){var W=D[0];D.splice(0,1),N.add(W);var _=W.getEdges();for(var T=0;T<_.length;T++){var Q=_[T].getOtherEnd(W);if(X.get(W)!=Q)if(!N.has(Q))D.push(Q),X.set(Q,W);else{d=!1;break}}}if(!d)g=[];else{var lt=[].concat(v(N));g.push(lt);for(var T=0;T<lt.length;T++){var G=lt[T],tt=x.indexOf(G);if(tt>-1)x.splice(tt,1)}N=new Set,X=new Map}}return g},e.prototype.createDummyNodesForBendpoints=function(g){var d=[],c=g.source,O=this.graphManager.calcLowestCommonAncestor(g.source,g.target);for(var T=0;T<g.bendpoints.length;T++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),O.add(N);var D=this.newEdge(null);this.graphManager.add(D,c,N),d.add(N),c=N}var D=this.newEdge(null);if(this.graphManager.add(D,c,g.target),this.edgeToDummyNodes.set(g,d),g.isInterGraph())this.graphManager.remove(g);else O.remove(g);return d},e.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(v(this.edgeToDummyNodes.keys())).concat(g);for(var d=0;d<g.length;d++){var c=g[d];if(c.bendpoints.length>0){var O=this.edgeToDummyNodes.get(c);for(var T=0;T<O.length;T++){var N=O[T],D=new r(N.getCenterX(),N.getCenterY()),X=c.bendpoints.get(T);X.x=D.x,X.y=D.y,N.getOwner().remove(N)}this.graphManager.add(c,c.source,c.target)}}},e.transform=function(g,d,c,O){if(c!=null&&O!=null){var T=d;if(g<=50){var N=d/c;T-=(d-N)/50*(50-g)}else{var D=d*O;T+=(D-d)/50*(g-50)}return T}else{var X,x;if(g<=50)X=9*d/500,x=d/10;else X=9*d/50,x=-8*d;return X*g+x}},e.findCenterOfTree=function(g){var d=[];d=d.concat(g);var c=[],O=new Map,T=!1,N=null;if(d.length==1||d.length==2)T=!0,N=d[0];for(var D=0;D<d.length;D++){var X=d[D],x=X.getNeighborsList().size;if(O.set(X,X.getNeighborsList().size),x==1)c.push(X)}var W=[];W=W.concat(c);while(!T){var _=[];_=_.concat(W),W=[];for(var D=0;D<d.length;D++){var X=d[D],Q=d.indexOf(X);if(Q>=0)d.splice(Q,1);var lt=X.getNeighborsList();lt.forEach(function(s){if(c.indexOf(s)<0){var L=O.get(s),E=L-1;if(E==1)W.push(s);O.set(s,E)}})}if(c=c.concat(W),d.length==1||d.length==2)T=!0,N=d[0]}return N},e.prototype.setGraphManager=function(g){this.graphManager=g},w.exports=e},function(w,I,A){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},w.exports=v},function(w,I,A){var v=A(5);function f(o,n){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}f.prototype.getWorldOrgX=function(){return this.lworldOrgX},f.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},f.prototype.getWorldOrgY=function(){return this.lworldOrgY},f.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},f.prototype.getWorldExtX=function(){return this.lworldExtX},f.prototype.setWorldExtX=function(o){this.lworldExtX=o},f.prototype.getWorldExtY=function(){return this.lworldExtY},f.prototype.setWorldExtY=function(o){this.lworldExtY=o},f.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},f.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},f.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},f.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},f.prototype.getDeviceExtX=function(){return this.ldeviceExtX},f.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},f.prototype.getDeviceExtY=function(){return this.ldeviceExtY},f.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},f.prototype.transformX=function(o){var n=0,a=this.lworldExtX;if(a!=0)n=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/a;return n},f.prototype.transformY=function(o){var n=0,a=this.lworldExtY;if(a!=0)n=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/a;return n},f.prototype.inverseTransformX=function(o){var n=0,a=this.ldeviceExtX;if(a!=0)n=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/a;return n},f.prototype.inverseTransformY=function(o){var n=0,a=this.ldeviceExtY;if(a!=0)n=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/a;return n},f.prototype.inverseTransformPoint=function(o){var n=new v(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return n},w.exports=f},function(w,I,A){function v(i){if(Array.isArray(i)){for(var e=0,g=Array(i.length);e<i.length;e++)g[e]=i[e];return g}else return Array.from(i)}var f=A(15),o=A(4),n=A(0),a=A(8),u=A(9);function r(){f.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}r.prototype=Object.create(f.prototype);for(var y in f)r[y]=f[y];r.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){var i,e,g,d,c,O,T,N=this.getGraphManager().getAllEdges();for(var D=0;D<N.length;D++)if(i=N[D],e=i.idealLength,i.isInterGraph){if(d=i.getSource(),c=i.getTarget(),O=i.getSourceInLca().getEstimatedSize(),T=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=O+T-2*n.SIMPLE_NODE_SIZE;g=i.getLca().getInclusionTreeDepth(),i.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+c.getInclusionTreeDepth()-2*g)}},r.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;if(this.incremental){if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){var i=this.getAllEdges(),e;for(var g=0;g<i.length;g++)e=i[g],this.calcSpringForce(e,e.idealLength)},r.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,d,c,O,T=this.getAllNodes(),N;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();N=new Set;for(g=0;g<T.length;g++)c=T[g],this.calculateRepulsionForceOfANode(c,N,i,e),N.add(c)}else for(g=0;g<T.length;g++){c=T[g];for(d=g+1;d<T.length;d++){if(O=T[d],c.getOwner()!=O.getOwner())continue;this.calcRepulsionForce(c,O)}}},r.prototype.calcGravitationalForces=function(){var i,e=this.getAllNodesToApplyGravitation();for(var g=0;g<e.length;g++)i=e[g],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),e;for(var g=0;g<i.length;g++)e=i[g],e.move()},r.prototype.calcSpringForce=function(i,e){var g=i.getSource(),d=i.getTarget(),c,O,T,N;if(this.uniformLeafNodeSizes&&g.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(c=i.getLength(),c==0)return;O=i.edgeElasticity*(c-e),T=O*(i.lengthX/c),N=O*(i.lengthY/c),g.springForceX+=T,g.springForceY+=N,d.springForceX-=T,d.springForceY-=N},r.prototype.calcRepulsionForce=function(i,e){var g=i.getRect(),d=e.getRect(),c=[,,],O=[,,,,],T,N,D,X,x,W,_;if(g.intersects(d)){a.calcSeparationAmount(g,d,c,o.DEFAULT_EDGE_LENGTH/2),W=2*c[0],_=2*c[1];var Q=i.noOfChildren*e.noOfChildren/(i.noOfChildren+e.noOfChildren);i.repulsionForceX-=Q*W,i.repulsionForceY-=Q*_,e.repulsionForceX+=Q*W,e.repulsionForceY+=Q*_}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&e.getChild()==null)T=d.getCenterX()-g.getCenterX(),N=d.getCenterY()-g.getCenterY();else a.getIntersection(g,d,O),T=O[2]-O[0],N=O[3]-O[1];if(Math.abs(T)<o.MIN_REPULSION_DIST)T=u.sign(T)*o.MIN_REPULSION_DIST;if(Math.abs(N)<o.MIN_REPULSION_DIST)N=u.sign(N)*o.MIN_REPULSION_DIST;D=T*T+N*N,X=Math.sqrt(D),x=(i.nodeRepulsion/2+e.nodeRepulsion/2)*i.noOfChildren*e.noOfChildren/D,W=x*T/X,_=x*N/X,i.repulsionForceX-=W,i.repulsionForceY-=_,e.repulsionForceX+=W,e.repulsionForceY+=_}},r.prototype.calcGravitationalForce=function(i){var e,g,d,c,O,T,N,D;if(e=i.getOwner(),g=(e.getRight()+e.getLeft())/2,d=(e.getTop()+e.getBottom())/2,c=i.getCenterX()-g,O=i.getCenterY()-d,T=Math.abs(c)+i.getWidth()/2,N=Math.abs(O)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(D=e.getEstimatedSize()*this.gravityRangeFactor,T>D||N>D)i.gravitationForceX=-this.gravityConstant*c,i.gravitationForceY=-this.gravityConstant*O}else if(D=e.getEstimatedSize()*this.compoundGravityRangeFactor,T>D||N>D)i.gravitationForceX=-this.gravityConstant*c*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*O*this.compoundGravityConstant},r.prototype.isConverged=function(){var i,e=!1;if(this.totalIterations>this.maxIterations/3)e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||e},r.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},r.prototype.calcNoOfChildrenForAllNodes=function(){var i,e=this.graphManager.getAllNodes();for(var g=0;g<e.length;g++)i=e[g],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var e=0,g=0;e=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var d=Array(e);for(var c=0;c<e;c++)d[c]=Array(g);for(var c=0;c<e;c++)for(var O=0;O<g;O++)d[c][O]=[];return d},r.prototype.addNodeToGrid=function(i,e,g){var d=0,c=0,O=0,T=0;d=parseInt(Math.floor((i.getRect().x-e)/this.repulsionRange)),c=parseInt(Math.floor((i.getRect().width+i.getRect().x-e)/this.repulsionRange)),O=parseInt(Math.floor((i.getRect().y-g)/this.repulsionRange)),T=parseInt(Math.floor((i.getRect().height+i.getRect().y-g)/this.repulsionRange));for(var N=d;N<=c;N++)for(var D=O;D<=T;D++)this.grid[N][D].push(i),i.setGridCoordinates(d,c,O,T)},r.prototype.updateGrid=function(){var i,e,g=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<g.length;i++)e=g[i],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,e,g,d){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&g||d){var c=new Set;i.surrounding=[];var O,T=this.grid;for(var N=i.startX-1;N<i.finishX+2;N++)for(var D=i.startY-1;D<i.finishY+2;D++)if(!(N<0||D<0||N>=T.length||D>=T[0].length))for(var X=0;X<T[N][D].length;X++){if(O=T[N][D][X],i.getOwner()!=O.getOwner()||i==O)continue;if(!e.has(O)&&!c.has(O)){var x=Math.abs(i.getCenterX()-O.getCenterX())-(i.getWidth()/2+O.getWidth()/2),W=Math.abs(i.getCenterY()-O.getCenterY())-(i.getHeight()/2+O.getHeight()/2);if(x<=this.repulsionRange&&W<=this.repulsionRange)c.add(O)}}i.surrounding=[].concat(v(c))}for(N=0;N<i.surrounding.length;N++)this.calcRepulsionForce(i,i.surrounding[N])},r.prototype.calcRepulsionRange=function(){return 0},w.exports=r},function(w,I,A){var v=A(1),f=A(4);function o(a,u,r){v.call(this,a,u,r),this.idealLength=f.DEFAULT_EDGE_LENGTH,this.edgeElasticity=f.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];w.exports=o},function(w,I,A){var v=A(3),f=A(4);function o(a,u,r,y){v.call(this,a,u,r,y),this.nodeRepulsion=f.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=[]}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];o.prototype.setGridCoordinates=function(a,u,r,y){this.startX=a,this.finishX=u,this.startY=r,this.finishY=y},w.exports=o},function(w,I,A){function v(f,o){if(this.width=0,this.height=0,f!==null&&o!==null)this.height=o,this.width=f}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},w.exports=v},function(w,I,A){var v=A(14);function f(){this.map={},this.keys=[]}f.prototype.put=function(o,n){var a=v.createID(o);if(!this.contains(a))this.map[a]=n,this.keys.push(o)},f.prototype.contains=function(o){var n=v.createID(o);return this.map[o]!=null},f.prototype.get=function(o){var n=v.createID(o);return this.map[n]},f.prototype.keySet=function(){return this.keys},w.exports=f},function(w,I,A){var v=A(14);function f(){this.set={}}f.prototype.add=function(o){var n=v.createID(o);if(!this.contains(n))this.set[n]=o},f.prototype.remove=function(o){delete this.set[v.createID(o)]},f.prototype.clear=function(){this.set={}},f.prototype.contains=function(o){return this.set[v.createID(o)]==o},f.prototype.isEmpty=function(){return this.size()===0},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAllTo=function(o){var n=Object.keys(this.set),a=n.length;for(var u=0;u<a;u++)o.push(this.set[n[u]])},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAll=function(o){var n=o.length;for(var a=0;a<n;a++){var u=o[a];this.add(u)}},w.exports=f},function(w,I,A){function v(){}v.multMat=function(f,o){var n=[];for(var a=0;a<f.length;a++){n[a]=[];for(var u=0;u<o[0].length;u++){n[a][u]=0;for(var r=0;r<f[0].length;r++)n[a][u]+=f[a][r]*o[r][u]}}return n},v.transpose=function(f){var o=[];for(var n=0;n<f[0].length;n++){o[n]=[];for(var a=0;a<f.length;a++)o[n][a]=f[a][n]}return o},v.multCons=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]*o;return n},v.minusOp=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]-o[a];return n},v.dotProduct=function(f,o){var n=0;for(var a=0;a<f.length;a++)n+=f[a]*o[a];return n},v.mag=function(f){return Math.sqrt(this.dotProduct(f,f))},v.normalize=function(f){var o=[],n=this.mag(f);for(var a=0;a<f.length;a++)o[a]=f[a]/n;return o},v.multGamma=function(f){var o=[],n=0;for(var a=0;a<f.length;a++)n+=f[a];n*=-1/f.length;for(var u=0;u<f.length;u++)o[u]=n+f[u];return o},v.multL=function(f,o,n){var a=[],u=[],r=[];for(var y=0;y<o[0].length;y++){var i=0;for(var e=0;e<o.length;e++)i+=-0.5*o[e][y]*f[e];u[y]=i}for(var g=0;g<n.length;g++){var d=0;for(var c=0;c<n.length;c++)d+=n[g][c]*u[c];r[g]=d}for(var O=0;O<o.length;O++){var T=0;for(var N=0;N<o[0].length;N++)T+=o[O][N]*r[N];a[O]=T}return a},w.exports=v},function(w,I,A){var v=function(){function a(u,r){for(var y=0;y<r.length;y++){var i=r[y];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(u,i.key,i)}}return function(u,r,y){if(r)a(u.prototype,r);if(y)a(u,y);return u}}();function f(a,u){if(!(a instanceof u))throw TypeError("Cannot call a class as a function")}var o=A(11),n=function(){function a(u,r){if(f(this,a),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(u instanceof o)y=u.size();else y=u.length;this._quicksort(u,0,y-1)}return v(a,[{key:"_quicksort",value:function(r,y,i){if(y<i){var e=this._partition(r,y,i);this._quicksort(r,y,e),this._quicksort(r,e+1,i)}}},{key:"_partition",value:function(r,y,i){var e=this._get(r,y),g=y,d=i;while(!0){while(this.compareFunction(e,this._get(r,d)))d--;while(this.compareFunction(this._get(r,g),e))g++;if(g<d)this._swap(r,g,d),g++,d--;else return d}}},{key:"_get",value:function(r,y){if(r instanceof o)return r.get_object_at(y);else return r[y]}},{key:"_set",value:function(r,y,i){if(r instanceof o)r.set_object_at(y,i);else r[y]=i}},{key:"_swap",value:function(r,y,i){var e=this._get(r,y);this._set(r,y,this._get(r,i)),this._set(r,i,e)}},{key:"_defaultCompareFunction",value:function(r,y){return y>r}}]),a}();w.exports=n},function(w,I,A){function v(){}v.svd=function(f){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=f.length,this.n=f[0].length;var o=Math.min(this.m,this.n);this.s=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(Math.min(this.m+1,this.n)),this.U=function(Wt){var bt=function ae($t){if($t.length==0)return 0;else{var jt=[];for(var ie=0;ie<$t[0];ie++)jt.push(ae($t.slice(1)));return jt}};return bt(Wt)}([this.m,o]),this.V=function(Wt){var bt=function ae($t){if($t.length==0)return 0;else{var jt=[];for(var ie=0;ie<$t[0];ie++)jt.push(ae($t.slice(1)));return jt}};return bt(Wt)}([this.n,this.n]);var n=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.n),a=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.m),u=!0,r=!0,y=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m));for(var e=0;e<Math.max(y,i);e++){if(e<y){this.s[e]=0;for(var g=e;g<this.m;g++)this.s[e]=v.hypot(this.s[e],f[g][e]);if(this.s[e]!==0){if(f[e][e]<0)this.s[e]=-this.s[e];for(var d=e;d<this.m;d++)f[d][e]/=this.s[e];f[e][e]+=1}this.s[e]=-this.s[e]}for(var c=e+1;c<this.n;c++){if(function(Wt,bt){return Wt&&bt}(e<y,this.s[e]!==0)){var O=0;for(var T=e;T<this.m;T++)O+=f[T][e]*f[T][c];O=-O/f[e][e];for(var N=e;N<this.m;N++)f[N][c]+=O*f[N][e]}n[c]=f[e][c]}if(function(Wt,bt){return Wt&&bt}(u,e<y))for(var D=e;D<this.m;D++)this.U[D][e]=f[D][e];if(e<i){n[e]=0;for(var X=e+1;X<this.n;X++)n[e]=v.hypot(n[e],n[X]);if(n[e]!==0){if(n[e+1]<0)n[e]=-n[e];for(var x=e+1;x<this.n;x++)n[x]/=n[e];n[e+1]+=1}if(n[e]=-n[e],function(Wt,bt){return Wt&&bt}(e+1<this.m,n[e]!==0)){for(var W=e+1;W<this.m;W++)a[W]=0;for(var _=e+1;_<this.n;_++)for(var Q=e+1;Q<this.m;Q++)a[Q]+=n[_]*f[Q][_];for(var lt=e+1;lt<this.n;lt++){var G=-n[lt]/n[e+1];for(var tt=e+1;tt<this.m;tt++)f[tt][lt]+=G*a[tt]}}if(r)for(var s=e+1;s<this.n;s++)this.V[s][e]=n[s]}}var L=Math.min(this.n,this.m+1);if(y<this.n)this.s[y]=f[y][y];if(this.m<L)this.s[L-1]=0;if(i+1<L)n[i]=f[i][L-1];if(n[L-1]=0,u){for(var E=y;E<o;E++){for(var M=0;M<this.m;M++)this.U[M][E]=0;this.U[E][E]=1}for(var m=y-1;m>=0;m--)if(this.s[m]!==0){for(var Y=m+1;Y<o;Y++){var b=0;for(var k=m;k<this.m;k++)b+=this.U[k][m]*this.U[k][Y];b=-b/this.U[m][m];for(var B=m;B<this.m;B++)this.U[B][Y]+=b*this.U[B][m]}for(var H=m;H<this.m;H++)this.U[H][m]=-this.U[H][m];this.U[m][m]=1+this.U[m][m];for(var st=0;st<m-1;st++)this.U[st][m]=0}else{for(var dt=0;dt<this.m;dt++)this.U[dt][m]=0;this.U[m][m]=1}}if(r)for(var Z=this.n-1;Z>=0;Z--){if(function(Wt,bt){return Wt&&bt}(Z<i,n[Z]!==0))for(var ut=Z+1;ut<o;ut++){var nt=0;for(var S=Z+1;S<this.n;S++)nt+=this.V[S][Z]*this.V[S][ut];nt=-nt/this.V[Z+1][Z];for(var K=Z+1;K<this.n;K++)this.V[K][ut]+=nt*this.V[K][Z]}for(var et=0;et<this.n;et++)this.V[et][Z]=0;this.V[Z][Z]=1}var ct=L-1,Nt=0,Pt=Math.pow(2,-52),Bt=Math.pow(2,-966);while(L>0){var ft=void 0,Jt=void 0;for(ft=L-2;ft>=-1;ft--){if(ft===-1)break;if(Math.abs(n[ft])<=Bt+Pt*(Math.abs(this.s[ft])+Math.abs(this.s[ft+1]))){n[ft]=0;break}}if(ft===L-2)Jt=4;else{var Xt=void 0;for(Xt=L-1;Xt>=ft;Xt--){if(Xt===ft)break;var Et=(Xt!==L?Math.abs(n[Xt]):0)+(Xt!==ft+1?Math.abs(n[Xt-1]):0);if(Math.abs(this.s[Xt])<=Bt+Pt*Et){this.s[Xt]=0;break}}if(Xt===ft)Jt=3;else if(Xt===L-1)Jt=1;else Jt=2,ft=Xt}switch(ft++,Jt){case 1:{var vt=n[L-2];n[L-2]=0;for(var xt=L-2;xt>=ft;xt--){var Rt=v.hypot(this.s[xt],vt),Gt=this.s[xt]/Rt,St=vt/Rt;if(this.s[xt]=Rt,xt!==ft)vt=-St*n[xt-1],n[xt-1]=Gt*n[xt-1];if(r)for(var Ft=0;Ft<this.n;Ft++)Rt=Gt*this.V[Ft][xt]+St*this.V[Ft][L-1],this.V[Ft][L-1]=-St*this.V[Ft][xt]+Gt*this.V[Ft][L-1],this.V[Ft][xt]=Rt}}break;case 2:{var Ht=n[ft-1];n[ft-1]=0;for(var zt=ft;zt<L;zt++){var te=v.hypot(this.s[zt],Ht),qt=this.s[zt]/te,Kt=Ht/te;if(this.s[zt]=te,Ht=-Kt*n[zt],n[zt]=qt*n[zt],u)for(var kt=0;kt<this.m;kt++)te=qt*this.U[kt][zt]+Kt*this.U[kt][ft-1],this.U[kt][ft-1]=-Kt*this.U[kt][zt]+qt*this.U[kt][ft-1],this.U[kt][zt]=te}}break;case 3:{var J=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[L-1]),Math.abs(this.s[L-2])),Math.abs(n[L-2])),Math.abs(this.s[ft])),Math.abs(n[ft])),rt=this.s[L-1]/J,it=this.s[L-2]/J,at=n[L-2]/J,ot=this.s[ft]/J,gt=n[ft]/J,At=((it+rt)*(it-rt)+at*at)/2,Mt=rt*at*(rt*at),ht=0;if(function(Wt,bt){return Wt||bt}(At!==0,Mt!==0)){if(ht=Math.sqrt(At*At+Mt),At<0)ht=-ht;ht=Mt/(At+ht)}var Lt=(ot+rt)*(ot-rt)+ht,Ct=ot*gt;for(var pt=ft;pt<L-1;pt++){var Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot;if(pt!==ft)n[pt-1]=Ot;if(Lt=Ut*this.s[pt]+Tt*n[pt],n[pt]=Ut*n[pt]-Tt*this.s[pt],Ct=Tt*this.s[pt+1],this.s[pt+1]=Ut*this.s[pt+1],r)for(var yt=0;yt<this.n;yt++)Ot=Ut*this.V[yt][pt]+Tt*this.V[yt][pt+1],this.V[yt][pt+1]=-Tt*this.V[yt][pt]+Ut*this.V[yt][pt+1],this.V[yt][pt]=Ot;if(Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot,this.s[pt]=Ot,Lt=Ut*n[pt]+Tt*this.s[pt+1],this.s[pt+1]=-Tt*n[pt]+Ut*this.s[pt+1],Ct=Tt*n[pt+1],n[pt+1]=Ut*n[pt+1],u&&pt<this.m-1)for(var Dt=0;Dt<this.m;Dt++)Ot=Ut*this.U[Dt][pt]+Tt*this.U[Dt][pt+1],this.U[Dt][pt+1]=-Tt*this.U[Dt][pt]+Ut*this.U[Dt][pt+1],this.U[Dt][pt]=Ot}n[L-2]=Lt,Nt=Nt+1}break;case 4:{if(this.s[ft]<=0){if(this.s[ft]=this.s[ft]<0?-this.s[ft]:0,r)for(var mt=0;mt<=ct;mt++)this.V[mt][ft]=-this.V[mt][ft]}while(ft<ct){if(this.s[ft]>=this.s[ft+1])break;var wt=this.s[ft];if(this.s[ft]=this.s[ft+1],this.s[ft+1]=wt,r&&ft<this.n-1)for(var Zt=0;Zt<this.n;Zt++)wt=this.V[Zt][ft+1],this.V[Zt][ft+1]=this.V[Zt][ft],this.V[Zt][ft]=wt;if(u&&ft<this.m-1)for(var Vt=0;Vt<this.m;Vt++)wt=this.U[Vt][ft+1],this.U[Vt][ft+1]=this.U[Vt][ft],this.U[Vt][ft]=wt;ft++}Nt=0,L--}break}}var re={U:this.U,V:this.V,S:this.s};return re},v.hypot=function(f,o){var n=void 0;if(Math.abs(f)>Math.abs(o))n=o/f,n=Math.abs(f)*Math.sqrt(1+n*n);else if(o!=0)n=f/o,n=Math.abs(o)*Math.sqrt(1+n*n);else n=0;return n},w.exports=v},function(w,I,A){var v=function(){function n(a,u){for(var r=0;r<u.length;r++){var y=u[r];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(a,y.key,y)}}return function(a,u,r){if(u)n(a.prototype,u);if(r)n(a,r);return a}}();function f(n,a){if(!(n instanceof a))throw TypeError("Cannot call a class as a function")}var o=function(){function n(a,u){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;f(this,n),this.sequence1=a,this.sequence2=u,this.match_score=r,this.mismatch_penalty=y,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=u.length+1,this.grid=Array(this.iMax);for(var e=0;e<this.iMax;e++){this.grid[e]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.grid[e][g]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.tracebackGrid[d][c]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(n,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var u=1;u<this.jMax;u++)this.grid[0][u]=this.grid[0][u-1]+this.gap_penalty,this.tracebackGrid[0][u]=[!1,!1,!0];for(var r=1;r<this.iMax;r++)this.grid[r][0]=this.grid[r-1][0]+this.gap_penalty,this.tracebackGrid[r][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var i=1;i<this.jMax;i++){var e=void 0;if(this.sequence1[y-1]===this.sequence2[i-1])e=this.grid[y-1][i-1]+this.match_score;else e=this.grid[y-1][i-1]+this.mismatch_penalty;var g=this.grid[y-1][i]+this.gap_penalty,d=this.grid[y][i-1]+this.gap_penalty,c=[e,g,d],O=this.arrayAllMaxIndexes(c);this.grid[y][i]=c[O[0]],this.tracebackGrid[y][i]=[O.includes(0),O.includes(1),O.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var u=[];u.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(u[0]){var r=u[0],y=this.tracebackGrid[r.pos[0]][r.pos[1]];if(y[0])u.push({pos:[r.pos[0]-1,r.pos[1]-1],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(y[1])u.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(y[2])u.push({pos:[r.pos[0],r.pos[1]-1],seq1:"-"+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(r.pos[0]===0&&r.pos[1]===0)this.alignments.push({sequence1:r.seq1,sequence2:r.seq2});u.shift()}return this.alignments}},{key:"getAllIndexes",value:function(u,r){var y=[],i=-1;while((i=u.indexOf(r,i+1))!==-1)y.push(i);return y}},{key:"arrayAllMaxIndexes",value:function(u){return this.getAllIndexes(u,Math.max.apply(null,u))}}]),n}();w.exports=o},function(w,I,A){var v=function(){return};v.FDLayout=A(18),v.FDLayoutConstants=A(4),v.FDLayoutEdge=A(19),v.FDLayoutNode=A(20),v.DimensionD=A(21),v.HashMap=A(22),v.HashSet=A(23),v.IGeometry=A(8),v.IMath=A(9),v.Integer=A(10),v.Point=A(12),v.PointD=A(5),v.RandomSeed=A(16),v.RectangleD=A(13),v.Transform=A(17),v.UniqueIDGeneretor=A(14),v.Quicksort=A(25),v.LinkedList=A(11),v.LGraphObject=A(2),v.LGraph=A(6),v.LEdge=A(1),v.LGraphManager=A(7),v.LNode=A(3),v.Layout=A(15),v.LayoutConstants=A(0),v.NeedlemanWunsch=A(27),v.Matrix=A(24),v.SVD=A(26),w.exports=v},function(w,I,A){function v(){this.listeners=[]}var f=v.prototype;f.addListener=function(o,n){this.listeners.push({event:o,callback:n})},f.removeListener=function(o,n){for(var a=this.listeners.length;a>=0;a--){var u=this.listeners[a];if(u.event===o&&u.callback===n)this.listeners.splice(a,1)}},f.emit=function(o,n){for(var a=0;a<this.listeners.length;a++){var u=this.listeners[a];if(o===u.event)u.callback(n)}},w.exports=v}])})});var Fe=In(function(Ee,Se){(function(I,A){if(typeof Ee==="object"&&typeof Se==="object")Se.exports=A(Re());else if(typeof define==="function"&&define.amd)define(["layout-base"],A);else if(typeof Ee==="object")Ee.coseBase=A(Re());else I.coseBase=A(I.layoutBase)})(Ee,function(w){return(()=>{var I={45:(o,n,a)=>{var u={};u.layoutBase=a(551),u.CoSEConstants=a(806),u.CoSEEdge=a(767),u.CoSEGraph=a(880),u.CoSEGraphManager=a(578),u.CoSELayout=a(765),u.CoSENode=a(991),u.ConstraintHandler=a(902),o.exports=u},806:(o,n,a)=>{var u=a(551).FDLayoutConstants;function r(){}for(var y in u)r[y]=u[y];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r},767:(o,n,a)=>{var u=a(551).FDLayoutEdge;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},880:(o,n,a)=>{var u=a(551).LGraph;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},578:(o,n,a)=>{var u=a(551).LGraphManager;function r(i){u.call(this,i)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},765:(o,n,a)=>{var u=a(551).FDLayout,r=a(578),y=a(880),i=a(991),e=a(767),g=a(806),d=a(902),c=a(551).FDLayoutConstants,O=a(551).LayoutConstants,T=a(551).Point,N=a(551).PointD,D=a(551).DimensionD,X=a(551).Layout,x=a(551).Integer,W=a(551).IGeometry,_=a(551).LGraph,Q=a(551).Transform,lt=a(551).LinkedList;function G(){u.call(this),this.toBeTiled={},this.constraints={}}G.prototype=Object.create(u.prototype);for(var tt in u)G[tt]=u[tt];G.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},G.prototype.newGraph=function(s){return new y(null,this.graphManager,s)},G.prototype.newNode=function(s){return new i(this.graphManager,s)},G.prototype.newEdge=function(s){return new e(null,null,s)},G.prototype.initParameters=function(){if(u.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(g.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=g.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=g.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},G.prototype.initSpringEmbedder=function(){u.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},G.prototype.layout=function(){var s=O.DEFAULT_CREATE_BENDS_AS_NEEDED;if(s)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},G.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),!this.incremental){var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(M){return L.has(M)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}else if(g.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(Y){return L.has(Y)});this.graphManager.setAllNodesToApplyGravitation(E)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),g.APPLY_LAYOUT)this.runSpringEmbedder();return!0},G.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%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(this.layoutQuality==1)this.coolingAdjuster=this.coolingCycle/3;this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(m){return s.has(m)});if(this.graphManager.setAllNodesToApplyGravitation(L),this.graphManager.updateBounds(),this.updateGrid(),g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var E=!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(E,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},G.prototype.getPositionsData=function(){var s=this.graphManager.getAllNodes(),L={};for(var E=0;E<s.length;E++){var M=s[E].rect,m=s[E].id;L[m]={id:m,x:M.getCenterX(),y:M.getCenterY(),w:M.width,h:M.height}}return L},G.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(c.ANIMATE==="during")this.emit("layoutstarted");else{while(!s)s=this.tick();this.graphManager.updateBounds()}},G.prototype.moveNodes=function(){var s=this.getAllNodes(),L;for(var E=0;E<s.length;E++)L=s[E],L.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var E=0;E<s.length;E++)L=s[E],L.move()},G.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var L=this.graphManager.getAllNodes();for(var E=0;E<L.length;E++){var M=L[E];this.idToNodeMap.set(M.id,M)}var m=function S(K){var et=K.getChild().getNodes(),ct,Nt=0;for(var Pt=0;Pt<et.length;Pt++)if(ct=et[Pt],ct.getChild()==null){if(s.fixedNodeSet.has(ct.id))Nt+=100}else Nt+=S(ct);return Nt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(et){s.fixedNodeSet.add(et.nodeId)});var L=this.graphManager.getAllNodes(),M;for(var E=0;E<L.length;E++)if(M=L[E],M.getChild()!=null){var Y=m(M);if(Y>0)M.fixedNodeWeight=Y}}if(this.constraints.relativePlacementConstraint){var b=new Map,k=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(S){s.fixedNodesOnHorizontal.add(S),s.fixedNodesOnVertical.add(S)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var B=this.constraints.alignmentConstraint.vertical;for(var E=0;E<B.length;E++)this.dummyToNodeForVerticalAlignment.set("dummy"+E,[]),B[E].forEach(function(K){if(b.set(K,"dummy"+E),s.dummyToNodeForVerticalAlignment.get("dummy"+E).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnHorizontal.add("dummy"+E)})}if(this.constraints.alignmentConstraint.horizontal){var H=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<H.length;E++)this.dummyToNodeForHorizontalAlignment.set("dummy"+E,[]),H[E].forEach(function(K){if(k.set(K,"dummy"+E),s.dummyToNodeForHorizontalAlignment.get("dummy"+E).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnVertical.add("dummy"+E)})}}if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(S){var K,et,ct;for(ct=S.length-1;ct>=2*S.length/3;ct--)K=Math.floor(Math.random()*(ct+1)),et=S[ct],S[ct]=S[K],S[K]=et;return S},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(S){if(S.left){var K=b.has(S.left)?b.get(S.left):S.left,et=b.has(S.right)?b.get(S.right):S.right;if(!s.nodesInRelativeHorizontal.includes(K))if(s.nodesInRelativeHorizontal.push(K),s.nodeToRelativeConstraintMapHorizontal.set(K,[]),s.dummyToNodeForVerticalAlignment.has(K))s.nodeToTempPositionMapHorizontal.set(K,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(K)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(K,s.idToNodeMap.get(K).getCenterX());if(!s.nodesInRelativeHorizontal.includes(et))if(s.nodesInRelativeHorizontal.push(et),s.nodeToRelativeConstraintMapHorizontal.set(et,[]),s.dummyToNodeForVerticalAlignment.has(et))s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(et)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(et).getCenterX());s.nodeToRelativeConstraintMapHorizontal.get(K).push({right:et,gap:S.gap}),s.nodeToRelativeConstraintMapHorizontal.get(et).push({left:K,gap:S.gap})}else{var ct=k.has(S.top)?k.get(S.top):S.top,Nt=k.has(S.bottom)?k.get(S.bottom):S.bottom;if(!s.nodesInRelativeVertical.includes(ct))if(s.nodesInRelativeVertical.push(ct),s.nodeToRelativeConstraintMapVertical.set(ct,[]),s.dummyToNodeForHorizontalAlignment.has(ct))s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(ct)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(ct).getCenterY());if(!s.nodesInRelativeVertical.includes(Nt))if(s.nodesInRelativeVertical.push(Nt),s.nodeToRelativeConstraintMapVertical.set(Nt,[]),s.dummyToNodeForHorizontalAlignment.has(Nt))s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(Nt)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(Nt).getCenterY());s.nodeToRelativeConstraintMapVertical.get(ct).push({bottom:Nt,gap:S.gap}),s.nodeToRelativeConstraintMapVertical.get(Nt).push({top:ct,gap:S.gap})}});else{var st=new Map,dt=new Map;this.constraints.relativePlacementConstraint.forEach(function(S){if(S.left){var K=b.has(S.left)?b.get(S.left):S.left,et=b.has(S.right)?b.get(S.right):S.right;if(st.has(K))st.get(K).push(et);else st.set(K,[et]);if(st.has(et))st.get(et).push(K);else st.set(et,[K])}else{var ct=k.has(S.top)?k.get(S.top):S.top,Nt=k.has(S.bottom)?k.get(S.bottom):S.bottom;if(dt.has(ct))dt.get(ct).push(Nt);else dt.set(ct,[Nt]);if(dt.has(Nt))dt.get(Nt).push(ct);else dt.set(Nt,[ct])}});var Z=function(K,et){var ct=[],Nt=[],Pt=new lt,Bt=new Set,ft=0;return K.forEach(function(Jt,Xt){if(!Bt.has(Xt)){ct[ft]=[],Nt[ft]=!1;var Et=Xt;Pt.push(Et),Bt.add(Et),ct[ft].push(Et);while(Pt.length!=0){if(Et=Pt.shift(),et.has(Et))Nt[ft]=!0;var vt=K.get(Et);vt.forEach(function(xt){if(!Bt.has(xt))Pt.push(xt),Bt.add(xt),ct[ft].push(xt)})}ft++}}),{components:ct,isFixed:Nt}},ut=Z(st,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=ut.components,this.fixedComponentsOnHorizontal=ut.isFixed;var nt=Z(dt,s.fixedNodesOnVertical);this.componentsOnVertical=nt.components,this.fixedComponentsOnVertical=nt.isFixed}}},G.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(nt){var S=s.idToNodeMap.get(nt.nodeId);S.displacementX=0,S.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var L=this.constraints.alignmentConstraint.vertical;for(var E=0;E<L.length;E++){var M=0;for(var m=0;m<L[E].length;m++){if(this.fixedNodeSet.has(L[E][m])){M=0;break}M+=this.idToNodeMap.get(L[E][m]).displacementX}var Y=M/L[E].length;for(var m=0;m<L[E].length;m++)this.idToNodeMap.get(L[E][m]).displacementX=Y}}if(this.constraints.alignmentConstraint.horizontal){var b=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<b.length;E++){var k=0;for(var m=0;m<b[E].length;m++){if(this.fixedNodeSet.has(b[E][m])){k=0;break}k+=this.idToNodeMap.get(b[E][m]).displacementY}var B=k/b[E].length;for(var m=0;m<b[E].length;m++)this.idToNodeMap.get(b[E][m]).displacementY=B}}}if(this.constraints.relativePlacementConstraint)if(g.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var S=0;if(s.dummyToNodeForVerticalAlignment.has(nt))S=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(nt)[0]).displacementX;else S=s.idToNodeMap.get(nt).displacementX;if(s.nodeToRelativeConstraintMapHorizontal.get(nt).forEach(function(K){if(K.right){var et=s.nodeToTempPositionMapHorizontal.get(K.right)-s.nodeToTempPositionMapHorizontal.get(nt)-S;if(et<K.gap)S-=K.gap-et}else{var et=s.nodeToTempPositionMapHorizontal.get(nt)-s.nodeToTempPositionMapHorizontal.get(K.left)+S;if(et<K.gap)S+=K.gap-et}}),s.nodeToTempPositionMapHorizontal.set(nt,s.nodeToTempPositionMapHorizontal.get(nt)+S),s.dummyToNodeForVerticalAlignment.has(nt))s.dummyToNodeForVerticalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementX=S});else s.idToNodeMap.get(nt).displacementX=S}}),this.nodesInRelativeVertical.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var S=0;if(s.dummyToNodeForHorizontalAlignment.has(nt))S=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(nt)[0]).displacementY;else S=s.idToNodeMap.get(nt).displacementY;if(s.nodeToRelativeConstraintMapVertical.get(nt).forEach(function(K){if(K.bottom){var et=s.nodeToTempPositionMapVertical.get(K.bottom)-s.nodeToTempPositionMapVertical.get(nt)-S;if(et<K.gap)S-=K.gap-et}else{var et=s.nodeToTempPositionMapVertical.get(nt)-s.nodeToTempPositionMapVertical.get(K.top)+S;if(et<K.gap)S+=K.gap-et}}),s.nodeToTempPositionMapVertical.set(nt,s.nodeToTempPositionMapVertical.get(nt)+S),s.dummyToNodeForHorizontalAlignment.has(nt))s.dummyToNodeForHorizontalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementY=S});else s.idToNodeMap.get(nt).displacementY=S}})}else{for(var E=0;E<this.componentsOnHorizontal.length;E++){var H=this.componentsOnHorizontal[E];if(this.fixedComponentsOnHorizontal[E])for(var m=0;m<H.length;m++)if(this.dummyToNodeForVerticalAlignment.has(H[m]))this.dummyToNodeForVerticalAlignment.get(H[m]).forEach(function(K){s.idToNodeMap.get(K).displacementX=0});else this.idToNodeMap.get(H[m]).displacementX=0;else{var st=0,dt=0;for(var m=0;m<H.length;m++)if(this.dummyToNodeForVerticalAlignment.has(H[m])){var Z=this.dummyToNodeForVerticalAlignment.get(H[m]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementX,dt+=Z.length}else st+=this.idToNodeMap.get(H[m]).displacementX,dt++;var ut=st/dt;for(var m=0;m<H.length;m++)if(this.dummyToNodeForVerticalAlignment.has(H[m]))this.dummyToNodeForVerticalAlignment.get(H[m]).forEach(function(K){s.idToNodeMap.get(K).displacementX=ut});else this.idToNodeMap.get(H[m]).displacementX=ut}}for(var E=0;E<this.componentsOnVertical.length;E++){var H=this.componentsOnVertical[E];if(this.fixedComponentsOnVertical[E])for(var m=0;m<H.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(H[m]))this.dummyToNodeForHorizontalAlignment.get(H[m]).forEach(function(et){s.idToNodeMap.get(et).displacementY=0});else this.idToNodeMap.get(H[m]).displacementY=0;else{var st=0,dt=0;for(var m=0;m<H.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(H[m])){var Z=this.dummyToNodeForHorizontalAlignment.get(H[m]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementY,dt+=Z.length}else st+=this.idToNodeMap.get(H[m]).displacementY,dt++;var ut=st/dt;for(var m=0;m<H.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(H[m]))this.dummyToNodeForHorizontalAlignment.get(H[m]).forEach(function(Pt){s.idToNodeMap.get(Pt).displacementY=ut});else this.idToNodeMap.get(H[m]).displacementY=ut}}}},G.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],L,E=this.graphManager.getGraphs(),M=E.length,m;for(m=0;m<M;m++)if(L=E[m],L.updateConnected(),!L.isConnected)s=s.concat(L.getNodes());return s},G.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var L=new Set,E;for(E=0;E<s.length;E++){var M=s[E];if(!L.has(M)){var m=M.getSource(),Y=M.getTarget();if(m==Y)M.getBendpoints().push(new N),M.getBendpoints().push(new N),this.createDummyNodesForBendpoints(M),L.add(M);else{var b=[];if(b=b.concat(m.getEdgeListToNode(Y)),b=b.concat(Y.getEdgeListToNode(m)),!L.has(b[0])){if(b.length>1){var k;for(k=0;k<b.length;k++){var B=b[k];B.getBendpoints().push(new N),this.createDummyNodesForBendpoints(B)}}b.forEach(function(H){L.add(H)})}}}if(L.size==s.length)break}},G.prototype.positionNodesRadially=function(s){var L=new T(0,0),E=Math.ceil(Math.sqrt(s.length)),M=0,m=0,Y=0,b=new N(0,0);for(var k=0;k<s.length;k++){if(k%E==0){if(Y=0,m=M,k!=0)m+=g.DEFAULT_COMPONENT_SEPERATION;M=0}var B=s[k],H=X.findCenterOfTree(B);if(L.x=Y,L.y=m,b=G.radialLayout(B,H,L),b.y>M)M=Math.floor(b.y);Y=Math.floor(b.x+g.DEFAULT_COMPONENT_SEPERATION)}this.transform(new N(O.WORLD_CENTER_X-b.x/2,O.WORLD_CENTER_Y-b.y/2))},G.radialLayout=function(s,L,E){var M=Math.max(this.maxDiagonalInTree(s),g.DEFAULT_RADIAL_SEPARATION);G.branchRadialLayout(L,null,0,359,0,M);var m=_.calculateBounds(s),Y=new Q;Y.setDeviceOrgX(m.getMinX()),Y.setDeviceOrgY(m.getMinY()),Y.setWorldOrgX(E.x),Y.setWorldOrgY(E.y);for(var b=0;b<s.length;b++){var k=s[b];k.transform(Y)}var B=new N(m.getMaxX(),m.getMaxY());return Y.inverseTransformPoint(B)},G.branchRadialLayout=function(s,L,E,M,m,Y){var b=(M-E+1)/2;if(b<0)b+=180;var k=(b+E)%360,B=k*W.TWO_PI/360,H=Math.cos(B),st=m*Math.cos(B),dt=m*Math.sin(B);s.setCenter(st,dt);var Z=[];Z=Z.concat(s.getEdges());var ut=Z.length;if(L!=null)ut--;var nt=0,S=Z.length,K,et=s.getEdgesBetween(L);while(et.length>1){var ct=et[0];et.splice(0,1);var Nt=Z.indexOf(ct);if(Nt>=0)Z.splice(Nt,1);S--,ut--}if(L!=null)K=(Z.indexOf(et[0])+1)%S;else K=0;var Pt=Math.abs(M-E)/ut;for(var Bt=K;nt!=ut;Bt=++Bt%S){var ft=Z[Bt].getOtherEnd(s);if(ft==L)continue;var Jt=(E+nt*Pt)%360,Xt=(Jt+Pt)%360;G.branchRadialLayout(ft,s,Jt,Xt,m+Y,Y),nt++}},G.maxDiagonalInTree=function(s){var L=x.MIN_VALUE;for(var E=0;E<s.length;E++){var M=s[E],m=M.getDiagonal();if(m>L)L=m}return L},G.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},G.prototype.groupZeroDegreeMembers=function(){var s=this,L={};this.memberGroups={},this.idToDummyNode={};var E=[],M=this.graphManager.getAllNodes();for(var m=0;m<M.length;m++){var Y=M[m],b=Y.getParent();if(this.getNodeDegreeWithChildren(Y)===0&&(b.id==null||!this.getToBeTiled(b)))E.push(Y)}for(var m=0;m<E.length;m++){var Y=E[m],k=Y.getParent().id;if(typeof L[k]>"u")L[k]=[];L[k]=L[k].concat(Y)}Object.keys(L).forEach(function(B){if(L[B].length>1){var H="DummyCompound_"+B;s.memberGroups[H]=L[B];var st=L[B][0].getParent(),dt=new i(s.graphManager);dt.id=H,dt.paddingLeft=st.paddingLeft||0,dt.paddingRight=st.paddingRight||0,dt.paddingBottom=st.paddingBottom||0,dt.paddingTop=st.paddingTop||0,s.idToDummyNode[H]=dt;var Z=s.getGraphManager().add(s.newGraph(),dt),ut=st.getChild();ut.add(dt);for(var nt=0;nt<L[B].length;nt++){var S=L[B][nt];ut.remove(S),Z.add(S)}}})},G.prototype.clearCompounds=function(){var s={},L={};this.performDFSOnCompounds();for(var E=0;E<this.compoundOrder.length;E++)L[this.compoundOrder[E].id]=this.compoundOrder[E],s[this.compoundOrder[E].id]=[].concat(this.compoundOrder[E].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[E].getChild()),this.compoundOrder[E].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,L)},G.prototype.clearZeroDegreeMembers=function(){var s=this,L=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(E){var M=s.idToDummyNode[E];if(L[E]=s.tileNodes(s.memberGroups[E],M.paddingLeft+M.paddingRight),M.rect.width=L[E].width,M.rect.height=L[E].height,M.setCenter(L[E].centerX,L[E].centerY),M.labelMarginLeft=0,M.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var m=M.rect.width,Y=M.rect.height;if(M.labelWidth){if(M.labelPosHorizontal=="left")M.rect.x-=M.labelWidth,M.setWidth(m+M.labelWidth),M.labelMarginLeft=M.labelWidth;else if(M.labelPosHorizontal=="center"&&M.labelWidth>m)M.rect.x-=(M.labelWidth-m)/2,M.setWidth(M.labelWidth),M.labelMarginLeft=(M.labelWidth-m)/2;else if(M.labelPosHorizontal=="right")M.setWidth(m+M.labelWidth)}if(M.labelHeight){if(M.labelPosVertical=="top")M.rect.y-=M.labelHeight,M.setHeight(Y+M.labelHeight),M.labelMarginTop=M.labelHeight;else if(M.labelPosVertical=="center"&&M.labelHeight>Y)M.rect.y-=(M.labelHeight-Y)/2,M.setHeight(M.labelHeight),M.labelMarginTop=(M.labelHeight-Y)/2;else if(M.labelPosVertical=="bottom")M.setHeight(Y+M.labelHeight)}}})},G.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var L=this.compoundOrder[s],{id:E,paddingLeft:M,paddingTop:m,labelMarginLeft:Y,labelMarginTop:b}=L;this.adjustLocations(this.tiledMemberPack[E],L.rect.x,L.rect.y,M,m,Y,b)}},G.prototype.repopulateZeroDegreeMembers=function(){var s=this,L=this.tiledZeroDegreePack;Object.keys(L).forEach(function(E){var M=s.idToDummyNode[E],{paddingLeft:m,paddingTop:Y,labelMarginLeft:b,labelMarginTop:k}=M;s.adjustLocations(L[E],M.rect.x,M.rect.y,m,Y,b,k)})},G.prototype.getToBeTiled=function(s){var L=s.id;if(this.toBeTiled[L]!=null)return this.toBeTiled[L];var E=s.getChild();if(E==null)return this.toBeTiled[L]=!1,!1;var M=E.getNodes();for(var m=0;m<M.length;m++){var Y=M[m];if(this.getNodeDegree(Y)>0)return this.toBeTiled[L]=!1,!1;if(Y.getChild()==null){this.toBeTiled[Y.id]=!1;continue}if(!this.getToBeTiled(Y))return this.toBeTiled[L]=!1,!1}return this.toBeTiled[L]=!0,!0},G.prototype.getNodeDegree=function(s){var L=s.id,E=s.getEdges(),M=0;for(var m=0;m<E.length;m++){var Y=E[m];if(Y.getSource().id!==Y.getTarget().id)M=M+1}return M},G.prototype.getNodeDegreeWithChildren=function(s){var L=this.getNodeDegree(s);if(s.getChild()==null)return L;var E=s.getChild().getNodes();for(var M=0;M<E.length;M++){var m=E[M];L+=this.getNodeDegreeWithChildren(m)}return L},G.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},G.prototype.fillCompexOrderByDFS=function(s){for(var L=0;L<s.length;L++){var E=s[L];if(E.getChild()!=null)this.fillCompexOrderByDFS(E.getChild().getNodes());if(this.getToBeTiled(E))this.compoundOrder.push(E)}},G.prototype.adjustLocations=function(s,L,E,M,m,Y,b){L+=M+Y,E+=m+b;var k=L;for(var B=0;B<s.rows.length;B++){var H=s.rows[B];L=k;var st=0;for(var dt=0;dt<H.length;dt++){var Z=H[dt];if(Z.rect.x=L,Z.rect.y=E,L+=Z.rect.width+s.horizontalPadding,Z.rect.height>st)st=Z.rect.height}E+=st+s.verticalPadding}},G.prototype.tileCompoundMembers=function(s,L){var E=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(M){var m=L[M];if(E.tiledMemberPack[M]=E.tileNodes(s[M],m.paddingLeft+m.paddingRight),m.rect.width=E.tiledMemberPack[M].width,m.rect.height=E.tiledMemberPack[M].height,m.setCenter(E.tiledMemberPack[M].centerX,E.tiledMemberPack[M].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var Y=m.rect.width,b=m.rect.height;if(m.labelWidth){if(m.labelPosHorizontal=="left")m.rect.x-=m.labelWidth,m.setWidth(Y+m.labelWidth),m.labelMarginLeft=m.labelWidth;else if(m.labelPosHorizontal=="center"&&m.labelWidth>Y)m.rect.x-=(m.labelWidth-Y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-Y)/2;else if(m.labelPosHorizontal=="right")m.setWidth(Y+m.labelWidth)}if(m.labelHeight){if(m.labelPosVertical=="top")m.rect.y-=m.labelHeight,m.setHeight(b+m.labelHeight),m.labelMarginTop=m.labelHeight;else if(m.labelPosVertical=="center"&&m.labelHeight>b)m.rect.y-=(m.labelHeight-b)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-b)/2;else if(m.labelPosVertical=="bottom")m.setHeight(b+m.labelHeight)}}})},G.prototype.tileNodes=function(s,L){var E=this.tileNodesByFavoringDim(s,L,!0),M=this.tileNodesByFavoringDim(s,L,!1),m=this.getOrgRatio(E),Y=this.getOrgRatio(M),b;if(Y<m)b=M;else b=E;return b},G.prototype.getOrgRatio=function(s){var{width:L,height:E}=s,M=L/E;if(M<1)M=1/M;return M},G.prototype.calcIdealRowWidth=function(s,L){var{TILING_PADDING_VERTICAL:E,TILING_PADDING_HORIZONTAL:M}=g,m=s.length,Y=0,b=0,k=0;s.forEach(function(nt){if(Y+=nt.getWidth(),b+=nt.getHeight(),nt.getWidth()>k)k=nt.getWidth()});var B=Y/m,H=b/m,st=Math.pow(E-M,2)+4*(B+M)*(H+E)*m,dt=(M-E+Math.sqrt(st))/(2*(B+M)),Z;if(L){if(Z=Math.ceil(dt),Z==dt)Z++}else Z=Math.floor(dt);var ut=Z*(B+M)-M;if(k>ut)ut=k;return ut+=M*2,ut},G.prototype.tileNodesByFavoringDim=function(s,L,E){var{TILING_PADDING_VERTICAL:M,TILING_PADDING_HORIZONTAL:m,TILING_COMPARE_BY:Y}=g,b={rows:[],rowWidth:[],rowHeight:[],width:0,height:L,verticalPadding:M,horizontalPadding:m,centerX:0,centerY:0};if(Y)b.idealRowWidth=this.calcIdealRowWidth(s,E);var k=function(S){return S.rect.width*S.rect.height},B=function(S,K){return k(K)-k(S)};s.sort(function(nt,S){var K=B;if(b.idealRowWidth)return K=Y,K(nt.id,S.id);return K(nt,S)});var H=0,st=0;for(var dt=0;dt<s.length;dt++){var Z=s[dt];H+=Z.getCenterX(),st+=Z.getCenterY()}b.centerX=H/s.length,b.centerY=st/s.length;for(var dt=0;dt<s.length;dt++){var Z=s[dt];if(b.rows.length==0)this.insertNodeToRow(b,Z,0,L);else if(this.canAddHorizontal(b,Z.rect.width,Z.rect.height)){var ut=b.rows.length-1;if(!b.idealRowWidth)ut=this.getShortestRowIndex(b);this.insertNodeToRow(b,Z,ut,L)}else this.insertNodeToRow(b,Z,b.rows.length,L);this.shiftToLastRow(b)}return b},G.prototype.insertNodeToRow=function(s,L,E,M){var m=M;if(E==s.rows.length){var Y=[];s.rows.push(Y),s.rowWidth.push(m),s.rowHeight.push(0)}var b=s.rowWidth[E]+L.rect.width;if(s.rows[E].length>0)b+=s.horizontalPadding;if(s.rowWidth[E]=b,s.width<b)s.width=b;var k=L.rect.height;if(E>0)k+=s.verticalPadding;var B=0;if(k>s.rowHeight[E])B=s.rowHeight[E],s.rowHeight[E]=k,B=s.rowHeight[E]-B;s.height+=B,s.rows[E].push(L)},G.prototype.getShortestRowIndex=function(s){var L=-1,E=Number.MAX_VALUE;for(var M=0;M<s.rows.length;M++)if(s.rowWidth[M]<E)L=M,E=s.rowWidth[M];return L},G.prototype.getLongestRowIndex=function(s){var L=-1,E=Number.MIN_VALUE;for(var M=0;M<s.rows.length;M++)if(s.rowWidth[M]>E)L=M,E=s.rowWidth[M];return L},G.prototype.canAddHorizontal=function(s,L,E){if(s.idealRowWidth){var M=s.rows.length-1,m=s.rowWidth[M];return m+L+s.horizontalPadding<=s.idealRowWidth}var Y=this.getShortestRowIndex(s);if(Y<0)return!0;var b=s.rowWidth[Y];if(b+s.horizontalPadding+L<=s.width)return!0;var k=0;if(s.rowHeight[Y]<E){if(Y>0)k=E+s.verticalPadding-s.rowHeight[Y]}var B;if(s.width-b>=L+s.horizontalPadding)B=(s.height+k)/(b+L+s.horizontalPadding);else B=(s.height+k)/s.width;k=E+s.verticalPadding;var H;if(s.width<L)H=(s.height+k)/L;else H=(s.height+k)/s.width;if(H<1)H=1/H;if(B<1)B=1/B;return B<H},G.prototype.shiftToLastRow=function(s){var L=this.getLongestRowIndex(s),E=s.rowWidth.length-1,M=s.rows[L],m=M[M.length-1],Y=m.width+s.horizontalPadding;if(s.width-s.rowWidth[E]>Y&&L!=E){M.splice(-1,1),s.rows[E].push(m),s.rowWidth[L]=s.rowWidth[L]-Y,s.rowWidth[E]=s.rowWidth[E]+Y,s.width=s.rowWidth[instance.getLongestRowIndex(s)];var b=Number.MIN_VALUE;for(var k=0;k<M.length;k++)if(M[k].height>b)b=M[k].height;if(L>0)b+=s.verticalPadding;var B=s.rowHeight[L]+s.rowHeight[E];if(s.rowHeight[L]=b,s.rowHeight[E]<m.height+s.verticalPadding)s.rowHeight[E]=m.height+s.verticalPadding;var H=s.rowHeight[L]+s.rowHeight[E];s.height+=H-B,this.shiftToLastRow(s)}},G.prototype.tilingPreLayout=function(){if(g.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},G.prototype.tilingPostLayout=function(){if(g.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},G.prototype.reduceTrees=function(){var s=[],L=!0,E;while(L){var M=this.graphManager.getAllNodes(),m=[];L=!1;for(var Y=0;Y<M.length;Y++)if(E=M[Y],E.getEdges().length==1&&!E.getEdges()[0].isInterGraph&&E.getChild()==null){if(g.PURE_INCREMENTAL){var b=E.getEdges()[0].getOtherEnd(E),k=new D(E.getCenterX()-b.getCenterX(),E.getCenterY()-b.getCenterY());m.push([E,E.getEdges()[0],E.getOwner(),k])}else m.push([E,E.getEdges()[0],E.getOwner()]);L=!0}if(L==!0){var B=[];for(var H=0;H<m.length;H++)if(m[H][0].getEdges().length==1)B.push(m[H]),m[H][0].getOwner().remove(m[H][0]);s.push(B),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},G.prototype.growTree=function(s){var L=s.length,E=s[L-1],M;for(var m=0;m<E.length;m++)M=E[m],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()},G.prototype.findPlaceforPrunedNode=function(s){var L,E,M=s[0];if(M==s[1].source)E=s[1].target;else E=s[1].source;if(g.PURE_INCREMENTAL)M.setCenter(E.getCenterX()+s[3].getWidth(),E.getCenterY()+s[3].getHeight());else{var m=E.startX,Y=E.finishX,b=E.startY,k=E.finishY,B=0,H=0,st=0,dt=0,Z=[B,st,H,dt];if(b>0)for(var ut=m;ut<=Y;ut++)Z[0]+=this.grid[ut][b-1].length+this.grid[ut][b].length-1;if(Y<this.grid.length-1)for(var ut=b;ut<=k;ut++)Z[1]+=this.grid[Y+1][ut].length+this.grid[Y][ut].length-1;if(k<this.grid[0].length-1)for(var ut=m;ut<=Y;ut++)Z[2]+=this.grid[ut][k+1].length+this.grid[ut][k].length-1;if(m>0)for(var ut=b;ut<=k;ut++)Z[3]+=this.grid[m-1][ut].length+this.grid[m][ut].length-1;var nt=x.MAX_VALUE,S,K;for(var et=0;et<Z.length;et++)if(Z[et]<nt)nt=Z[et],S=1,K=et;else if(Z[et]==nt)S++;if(S==3&&nt==0){if(Z[0]==0&&Z[1]==0&&Z[2]==0)L=1;else if(Z[0]==0&&Z[1]==0&&Z[3]==0)L=0;else if(Z[0]==0&&Z[2]==0&&Z[3]==0)L=3;else if(Z[1]==0&&Z[2]==0&&Z[3]==0)L=2}else if(S==2&&nt==0){var ct=Math.floor(Math.random()*2);if(Z[0]==0&&Z[1]==0)if(ct==0)L=0;else L=1;else if(Z[0]==0&&Z[2]==0)if(ct==0)L=0;else L=2;else if(Z[0]==0&&Z[3]==0)if(ct==0)L=0;else L=3;else if(Z[1]==0&&Z[2]==0)if(ct==0)L=1;else L=2;else if(Z[1]==0&&Z[3]==0)if(ct==0)L=1;else L=3;else if(ct==0)L=2;else L=3}else if(S==4&&nt==0){var ct=Math.floor(Math.random()*4);L=ct}else L=K;if(L==0)M.setCenter(E.getCenterX(),E.getCenterY()-E.getHeight()/2-c.DEFAULT_EDGE_LENGTH-M.getHeight()/2);else if(L==1)M.setCenter(E.getCenterX()+E.getWidth()/2+c.DEFAULT_EDGE_LENGTH+M.getWidth()/2,E.getCenterY());else if(L==2)M.setCenter(E.getCenterX(),E.getCenterY()+E.getHeight()/2+c.DEFAULT_EDGE_LENGTH+M.getHeight()/2);else M.setCenter(E.getCenterX()-E.getWidth()/2-c.DEFAULT_EDGE_LENGTH-M.getWidth()/2,E.getCenterY())}},o.exports=G},991:(o,n,a)=>{var u=a(551).FDLayoutNode,r=a(551).IMath;function y(e,g,d,c){u.call(this,e,g,d,c)}y.prototype=Object.create(u.prototype);for(var i in u)y[i]=u[i];y.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement)this.displacementX=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement)this.displacementY=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},y.prototype.propogateDisplacementToChildren=function(e,g){var d=this.getChild().getNodes(),c;for(var O=0;O<d.length;O++)if(c=d[O],c.getChild()==null)c.displacementX+=e,c.displacementY+=g;else c.propogateDisplacementToChildren(e,g)},y.prototype.move=function(){var e=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY);this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},y.prototype.setPred1=function(e){this.pred1=e},y.prototype.getPred1=function(){return pred1},y.prototype.getPred2=function(){return pred2},y.prototype.setNext=function(e){this.next=e},y.prototype.getNext=function(){return next},y.prototype.setProcessed=function(e){this.processed=e},y.prototype.isProcessed=function(){return processed},o.exports=y},902:(o,n,a)=>{function u(d){if(Array.isArray(d)){for(var c=0,O=Array(d.length);c<d.length;c++)O[c]=d[c];return O}else return Array.from(d)}var r=a(806),y=a(551).LinkedList,i=a(551).Matrix,e=a(551).SVD;function g(){}g.handleConstraints=function(d){var c={};c.fixedNodeConstraint=d.constraints.fixedNodeConstraint,c.alignmentConstraint=d.constraints.alignmentConstraint,c.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var O=new Map,T=new Map,N=[],D=[],X=d.getAllNodes(),x=0;for(var W=0;W<X.length;W++){var _=X[W];if(_.getChild()==null)T.set(_.id,x++),N.push(_.getCenterX()),D.push(_.getCenterY()),O.set(_.id,_)}if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(!J.gap&&J.gap!=0)if(J.left)J.gap=r.DEFAULT_EDGE_LENGTH+O.get(J.left).getWidth()/2+O.get(J.right).getWidth()/2;else J.gap=r.DEFAULT_EDGE_LENGTH+O.get(J.top).getHeight()/2+O.get(J.bottom).getHeight()/2});var Q=function(rt,it){return{x:rt.x-it.x,y:rt.y-it.y}},lt=function(rt){var it=0,at=0;return rt.forEach(function(ot){it+=N[T.get(ot)],at+=D[T.get(ot)]}),{x:it/rt.size,y:at/rt.size}},G=function(rt,it,at,ot,gt){function At(Tt,yt){var Dt=new Set(Tt),mt=!0,wt=!1,Zt=void 0;try{for(var Vt=yt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt.add(Wt)}}catch(bt){wt=!0,Zt=bt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}return Dt}var Mt=new Map;rt.forEach(function(Tt,yt){Mt.set(yt,0)}),rt.forEach(function(Tt,yt){Tt.forEach(function(Dt){Mt.set(Dt.id,Mt.get(Dt.id)+1)})});var ht=new Map,Lt=new Map,Ct=new y;if(Mt.forEach(function(Tt,yt){if(Tt==0){if(Ct.push(yt),!at)if(it=="horizontal")ht.set(yt,T.has(yt)?N[T.get(yt)]:ot.get(yt));else ht.set(yt,T.has(yt)?D[T.get(yt)]:ot.get(yt))}else ht.set(yt,Number.NEGATIVE_INFINITY);if(at)Lt.set(yt,new Set([yt]))}),at)gt.forEach(function(Tt){var yt=[];if(Tt.forEach(function(wt){if(at.has(wt))yt.push(wt)}),yt.length>0){var Dt=0;yt.forEach(function(wt){if(it=="horizontal")ht.set(wt,T.has(wt)?N[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt);else ht.set(wt,T.has(wt)?D[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt)}),Dt=Dt/yt.length,Tt.forEach(function(wt){if(!at.has(wt))ht.set(wt,Dt)})}else{var mt=0;Tt.forEach(function(wt){if(it=="horizontal")mt+=T.has(wt)?N[T.get(wt)]:ot.get(wt);else mt+=T.has(wt)?D[T.get(wt)]:ot.get(wt)}),mt=mt/Tt.length,Tt.forEach(function(wt){ht.set(wt,mt)})}});var pt=function(){var yt=Ct.shift(),Dt=rt.get(yt);Dt.forEach(function(mt){if(ht.get(mt.id)<ht.get(yt)+mt.gap)if(at&&at.has(mt.id)){var wt=void 0;if(it=="horizontal")wt=T.has(mt.id)?N[T.get(mt.id)]:ot.get(mt.id);else wt=T.has(mt.id)?D[T.get(mt.id)]:ot.get(mt.id);if(ht.set(mt.id,wt),wt<ht.get(yt)+mt.gap){var Zt=ht.get(yt)+mt.gap-wt;Lt.get(yt).forEach(function(Vt){ht.set(Vt,ht.get(Vt)-Zt)})}}else ht.set(mt.id,ht.get(yt)+mt.gap);if(Mt.set(mt.id,Mt.get(mt.id)-1),Mt.get(mt.id)==0)Ct.push(mt.id);if(at)Lt.set(mt.id,At(Lt.get(yt),Lt.get(mt.id)))})};while(Ct.length!=0)pt();if(at){var Ot=new Set;rt.forEach(function(Tt,yt){if(Tt.length==0)Ot.add(yt)});var Ut=[];Lt.forEach(function(Tt,yt){if(Ot.has(yt)){var Dt=!1,mt=!0,wt=!1,Zt=void 0;try{for(var Vt=Tt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;if(at.has(Wt))Dt=!0}}catch($t){wt=!0,Zt=$t}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}if(!Dt){var bt=!1,ae=void 0;if(Ut.forEach(function($t,jt){if($t.has([].concat(u(Tt))[0]))bt=!0,ae=jt}),!bt)Ut.push(new Set(Tt));else Tt.forEach(function($t){Ut[ae].add($t)})}}}),Ut.forEach(function(Tt,yt){var{POSITIVE_INFINITY:Dt,POSITIVE_INFINITY:mt,NEGATIVE_INFINITY:wt,NEGATIVE_INFINITY:Zt}=Number,Vt=!0,re=!1,Wt=void 0;try{for(var bt=Tt[Symbol.iterator](),ae;!(Vt=(ae=bt.next()).done);Vt=!0){var $t=ae.value,jt=void 0;if(it=="horizontal")jt=T.has($t)?N[T.get($t)]:ot.get($t);else jt=T.has($t)?D[T.get($t)]:ot.get($t);var ie=ht.get($t);if(jt<Dt)Dt=jt;if(jt>wt)wt=jt;if(ie<mt)mt=ie;if(ie>Zt)Zt=ie}}catch(ve){re=!0,Wt=ve}finally{try{if(!Vt&&bt.return)bt.return()}finally{if(re)throw Wt}}var Me=(Dt+wt)/2-(mt+Zt)/2,le=!0,ce=!1,ge=void 0;try{for(var fe=Tt[Symbol.iterator](),Le;!(le=(Le=fe.next()).done);le=!0){var ue=Le.value;ht.set(ue,ht.get(ue)+Me)}}catch(ve){ce=!0,ge=ve}finally{try{if(!le&&fe.return)fe.return()}finally{if(ce)throw ge}}})}return ht},tt=function(rt){var it=0,at=0,ot=0,gt=0;if(rt.forEach(function(Lt){if(Lt.left)N[T.get(Lt.left)]-N[T.get(Lt.right)]>=0?it++:at++;else D[T.get(Lt.top)]-D[T.get(Lt.bottom)]>=0?ot++:gt++}),it>at&&ot>gt)for(var At=0;At<T.size;At++)N[At]=-1*N[At],D[At]=-1*D[At];else if(it>at)for(var Mt=0;Mt<T.size;Mt++)N[Mt]=-1*N[Mt];else if(ot>gt)for(var ht=0;ht<T.size;ht++)D[ht]=-1*D[ht]},s=function(rt){var it=[],at=new y,ot=new Set,gt=0;return rt.forEach(function(At,Mt){if(!ot.has(Mt)){it[gt]=[];var ht=Mt;at.push(ht),ot.add(ht),it[gt].push(ht);while(at.length!=0){ht=at.shift();var Lt=rt.get(ht);Lt.forEach(function(Ct){if(!ot.has(Ct.id))at.push(Ct.id),ot.add(Ct.id),it[gt].push(Ct.id)})}gt++}}),it},L=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(ot).push(gt),it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},E=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},M=[],m=[],Y=!1,b=!1,k=new Set,B=new Map,H=new Map,st=[];if(c.fixedNodeConstraint)c.fixedNodeConstraint.forEach(function(J){k.add(J.nodeId)});if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(J){if(J.left){if(B.has(J.left))B.get(J.left).push({id:J.right,gap:J.gap,direction:"horizontal"});else B.set(J.left,[{id:J.right,gap:J.gap,direction:"horizontal"}]);if(!B.has(J.right))B.set(J.right,[])}else{if(B.has(J.top))B.get(J.top).push({id:J.bottom,gap:J.gap,direction:"vertical"});else B.set(J.top,[{id:J.bottom,gap:J.gap,direction:"vertical"}]);if(!B.has(J.bottom))B.set(J.bottom,[])}}),H=L(B),st=s(H);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>1)c.fixedNodeConstraint.forEach(function(J,rt){M[rt]=[J.position.x,J.position.y],m[rt]=[N[T.get(J.nodeId)],D[T.get(J.nodeId)]]}),Y=!0;else if(c.alignmentConstraint)(function(){var J=0;if(c.alignmentConstraint.vertical){var rt=c.alignmentConstraint.vertical,it=function(ht){var Lt=new Set;rt[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).x;rt[ht].forEach(function(Ot){M[J]=[pt,D[T.get(Ot)]],m[J]=[N[T.get(Ot)],D[T.get(Ot)]],J++})};for(var at=0;at<rt.length;at++)it(at);Y=!0}if(c.alignmentConstraint.horizontal){var ot=c.alignmentConstraint.horizontal,gt=function(ht){var Lt=new Set;ot[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).y;ot[ht].forEach(function(Ot){M[J]=[N[T.get(Ot)],pt],m[J]=[N[T.get(Ot)],D[T.get(Ot)]],J++})};for(var At=0;At<ot.length;At++)gt(At);Y=!0}if(c.relativePlacementConstraint)b=!0})();else if(c.relativePlacementConstraint){var dt=0,Z=0;for(var ut=0;ut<st.length;ut++)if(st[ut].length>dt)dt=st[ut].length,Z=ut;if(dt<H.size/2)tt(c.relativePlacementConstraint),Y=!1,b=!1;else{var nt=new Map,S=new Map,K=[];st[Z].forEach(function(J){B.get(J).forEach(function(rt){if(rt.direction=="horizontal"){if(nt.has(J))nt.get(J).push(rt);else nt.set(J,[rt]);if(!nt.has(rt.id))nt.set(rt.id,[]);K.push({left:J,right:rt.id})}else{if(S.has(J))S.get(J).push(rt);else S.set(J,[rt]);if(!S.has(rt.id))S.set(rt.id,[]);K.push({top:J,bottom:rt.id})}})}),tt(K),b=!1;var et=G(nt,"horizontal"),ct=G(S,"vertical");st[Z].forEach(function(J,rt){if(m[rt]=[N[T.get(J)],D[T.get(J)]],M[rt]=[],et.has(J))M[rt][0]=et.get(J);else M[rt][0]=N[T.get(J)];if(ct.has(J))M[rt][1]=ct.get(J);else M[rt][1]=D[T.get(J)]}),Y=!0}}if(Y){var Nt=void 0,Pt=i.transpose(M),Bt=i.transpose(m);for(var ft=0;ft<Pt.length;ft++)Pt[ft]=i.multGamma(Pt[ft]),Bt[ft]=i.multGamma(Bt[ft]);var Jt=i.multMat(Pt,i.transpose(Bt)),Xt=e.svd(Jt);Nt=i.multMat(Xt.V,i.transpose(Xt.U));for(var Et=0;Et<T.size;Et++){var vt=[N[Et],D[Et]],xt=[Nt[0][0],Nt[1][0]],Rt=[Nt[0][1],Nt[1][1]];N[Et]=i.dotProduct(vt,xt),D[Et]=i.dotProduct(vt,Rt)}if(b)tt(c.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>0){var Gt={x:0,y:0};c.fixedNodeConstraint.forEach(function(J,rt){var it={x:N[T.get(J.nodeId)],y:D[T.get(J.nodeId)]},at=J.position,ot=Q(at,it);Gt.x+=ot.x,Gt.y+=ot.y}),Gt.x/=c.fixedNodeConstraint.length,Gt.y/=c.fixedNodeConstraint.length,N.forEach(function(J,rt){N[rt]+=Gt.x}),D.forEach(function(J,rt){D[rt]+=Gt.y}),c.fixedNodeConstraint.forEach(function(J){N[T.get(J.nodeId)]=J.position.x,D[T.get(J.nodeId)]=J.position.y})}if(c.alignmentConstraint){if(c.alignmentConstraint.vertical){var St=c.alignmentConstraint.vertical,Ft=function(rt){var it=new Set;St[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=N[T.get(at.values().next().value)];else ot=lt(it).x;it.forEach(function(gt){if(!k.has(gt))N[T.get(gt)]=ot})};for(var Ht=0;Ht<St.length;Ht++)Ft(Ht)}if(c.alignmentConstraint.horizontal){var zt=c.alignmentConstraint.horizontal,te=function(rt){var it=new Set;zt[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=D[T.get(at.values().next().value)];else ot=lt(it).y;it.forEach(function(gt){if(!k.has(gt))D[T.get(gt)]=ot})};for(var qt=0;qt<zt.length;qt++)te(qt)}}if(c.relativePlacementConstraint)(function(){var J=new Map,rt=new Map,it=new Map,at=new Map,ot=new Map,gt=new Map,At=new Set,Mt=new Set;if(k.forEach(function(Qt){At.add(Qt),Mt.add(Qt)}),c.alignmentConstraint){if(c.alignmentConstraint.vertical){var ht=c.alignmentConstraint.vertical,Lt=function(It){it.set("dummy"+It,[]),ht[It].forEach(function(Yt){if(J.set(Yt,"dummy"+It),it.get("dummy"+It).push(Yt),k.has(Yt))At.add("dummy"+It)}),ot.set("dummy"+It,N[T.get(ht[It][0])])};for(var Ct=0;Ct<ht.length;Ct++)Lt(Ct)}if(c.alignmentConstraint.horizontal){var pt=c.alignmentConstraint.horizontal,Ot=function(It){at.set("dummy"+It,[]),pt[It].forEach(function(Yt){if(rt.set(Yt,"dummy"+It),at.get("dummy"+It).push(Yt),k.has(Yt))Mt.add("dummy"+It)}),gt.set("dummy"+It,D[T.get(pt[It][0])])};for(var Ut=0;Ut<pt.length;Ut++)Ot(Ut)}}var Tt=new Map,yt=new Map,Dt=function(It){B.get(It).forEach(function(Yt){var oe=void 0,ne=void 0;if(Yt.direction=="horizontal"){if(oe=J.get(It)?J.get(It):It,J.get(Yt.id))ne={id:J.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ne=Yt;if(Tt.has(oe))Tt.get(oe).push(ne);else Tt.set(oe,[ne]);if(!Tt.has(ne.id))Tt.set(ne.id,[])}else{if(oe=rt.get(It)?rt.get(It):It,rt.get(Yt.id))ne={id:rt.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ne=Yt;if(yt.has(oe))yt.get(oe).push(ne);else yt.set(oe,[ne]);if(!yt.has(ne.id))yt.set(ne.id,[])}})},mt=!0,wt=!1,Zt=void 0;try{for(var Vt=B.keys()[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt(Wt)}}catch(Qt){wt=!0,Zt=Qt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}var bt=L(Tt),ae=L(yt),$t=s(bt),jt=s(ae),ie=E(Tt),Me=E(yt),le=[],ce=[];$t.forEach(function(Qt,It){le[It]=[],Qt.forEach(function(Yt){if(ie.get(Yt).length==0)le[It].push(Yt)})}),jt.forEach(function(Qt,It){ce[It]=[],Qt.forEach(function(Yt){if(Me.get(Yt).length==0)ce[It].push(Yt)})});var ge=G(Tt,"horizontal",At,ot,le),fe=G(yt,"vertical",Mt,gt,ce),Le=function(It){if(it.get(It))it.get(It).forEach(function(Yt){N[T.get(Yt)]=ge.get(It)});else N[T.get(It)]=ge.get(It)},ue=!0,ve=!1,Xe=void 0;try{for(var Ce=ge.keys()[Symbol.iterator](),He;!(ue=(He=Ce.next()).done);ue=!0){var Ae=He.value;Le(Ae)}}catch(Qt){ve=!0,Xe=Qt}finally{try{if(!ue&&Ce.return)Ce.return()}finally{if(ve)throw Xe}}var sr=function(It){if(at.get(It))at.get(It).forEach(function(Yt){D[T.get(Yt)]=fe.get(It)});else D[T.get(It)]=fe.get(It)},Oe=!0,We=!1,Ve=void 0;try{for(var xe=fe.keys()[Symbol.iterator](),ze;!(Oe=(ze=xe.next()).done);Oe=!0){var Ae=ze.value;sr(Ae)}}catch(Qt){We=!0,Ve=Qt}finally{try{if(!Oe&&xe.return)xe.return()}finally{if(We)throw Ve}}})()}for(var Kt=0;Kt<X.length;Kt++){var kt=X[Kt];if(kt.getChild()==null)kt.setCenter(N[T.get(kt.id)],D[T.get(kt.id)])}},o.exports=g},551:(o)=>{o.exports=w}},A={};function v(o){var n=A[o];if(n!==void 0)return n.exports;var a=A[o]={exports:{}};return I[o](a,a.exports,v),a.exports}var f=v(45);return f})()})});var $e=In(function(Te,Pe){(function(I,A){if(typeof Te==="object"&&typeof Pe==="object")Pe.exports=A(Fe());else if(typeof define==="function"&&define.amd)define(["cose-base"],A);else if(typeof Te==="object")Te.cytoscapeFcose=A(Fe());else I.cytoscapeFcose=A(I.coseBase)})(Te,function(w){return(()=>{var I={658:(o)=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(n){for(var a=arguments.length,u=Array(a>1?a-1:0),r=1;r<a;r++)u[r-1]=arguments[r];return u.forEach(function(y){Object.keys(y).forEach(function(i){return n[i]=y[i]})}),n}},548:(o,n,a)=>{var u=function(){function i(e,g){var d=[],c=!0,O=!1,T=void 0;try{for(var N=e[Symbol.iterator](),D;!(c=(D=N.next()).done);c=!0)if(d.push(D.value),g&&d.length===g)break}catch(X){O=!0,T=X}finally{try{if(!c&&N.return)N.return()}finally{if(O)throw T}}return d}return function(e,g){if(Array.isArray(e))return e;else if(Symbol.iterator in Object(e))return i(e,g);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(i){var e={};for(var g=0;g<i.length;g++)e[i[g].id()]=!0;var d=i.filter(function(c,O){if(typeof c==="number")c=O;var T=c.parent()[0];while(T!=null){if(e[T.id()])return!1;T=T.parent()[0]}return!0});return d},y.connectComponents=function(i,e,g,d){var c=new r,O=new Set,T=[],N=void 0,D=void 0,X=void 0,x=!1,W=1,_=[],Q=[],lt=function(){var tt=i.collection();Q.push(tt);var s=g[0],L=i.collection();L.merge(s).merge(s.descendants().intersection(e)),T.push(s),L.forEach(function(m){c.push(m),O.add(m),tt.merge(m)});var E=function(){s=c.shift();var Y=i.collection();s.neighborhood().nodes().forEach(function(H){if(e.intersection(s.edgesWith(H)).length>0)Y.merge(H)});for(var b=0;b<Y.length;b++){var k=Y[b];if(N=g.intersection(k.union(k.ancestors())),N!=null&&!O.has(N[0])){var B=N.union(N.descendants());B.forEach(function(H){if(c.push(H),O.add(H),tt.merge(H),g.has(H))T.push(H)})}}};while(c.length!=0)E();if(tt.forEach(function(m){e.intersection(m.connectedEdges()).forEach(function(Y){if(tt.has(Y.source())&&tt.has(Y.target()))tt.merge(Y)})}),T.length==g.length)x=!0;if(!x||x&&W>1){D=T[0],X=D.connectedEdges().length,T.forEach(function(m){if(m.connectedEdges().length<X)X=m.connectedEdges().length,D=m}),_.push(D.id());var M=i.collection();M.merge(T[0]),T.forEach(function(m){M.merge(m)}),T=[],g=g.difference(M),W++}};do lt();while(!x);if(d){if(_.length>0)d.set("dummy"+(d.size+1),_)}return Q},y.relocateComponent=function(i,e,g){if(!g.fixedNodeConstraint){var{POSITIVE_INFINITY:d,NEGATIVE_INFINITY:c,POSITIVE_INFINITY:O,NEGATIVE_INFINITY:T}=Number;if(g.quality=="draft"){var N=!0,D=!1,X=void 0;try{for(var x=e.nodeIndexes[Symbol.iterator](),W;!(N=(W=x.next()).done);N=!0){var _=W.value,Q=u(_,2),lt=Q[0],G=Q[1],tt=g.cy.getElementById(lt);if(tt){var s=tt.boundingBox(),L=e.xCoords[G]-s.w/2,E=e.xCoords[G]+s.w/2,M=e.yCoords[G]-s.h/2,m=e.yCoords[G]+s.h/2;if(L<d)d=L;if(E>c)c=E;if(M<O)O=M;if(m>T)T=m}}}catch(H){D=!0,X=H}finally{try{if(!N&&x.return)x.return()}finally{if(D)throw X}}var Y=i.x-(c+d)/2,b=i.y-(T+O)/2;e.xCoords=e.xCoords.map(function(H){return H+Y}),e.yCoords=e.yCoords.map(function(H){return H+b})}else{Object.keys(e).forEach(function(H){var st=e[H],dt=st.getRect().x,Z=st.getRect().x+st.getRect().width,ut=st.getRect().y,nt=st.getRect().y+st.getRect().height;if(dt<d)d=dt;if(Z>c)c=Z;if(ut<O)O=ut;if(nt>T)T=nt});var k=i.x-(c+d)/2,B=i.y-(T+O)/2;Object.keys(e).forEach(function(H){var st=e[H];st.setCenter(st.getCenterX()+k,st.getCenterY()+B)})}}},y.calcBoundingBox=function(i,e,g,d){var{MAX_SAFE_INTEGER:c,MIN_SAFE_INTEGER:O,MAX_SAFE_INTEGER:T,MIN_SAFE_INTEGER:N}=Number,D=void 0,X=void 0,x=void 0,W=void 0,_=i.descendants().not(":parent"),Q=_.length;for(var lt=0;lt<Q;lt++){var G=_[lt];if(D=e[d.get(G.id())]-G.width()/2,X=e[d.get(G.id())]+G.width()/2,x=g[d.get(G.id())]-G.height()/2,W=g[d.get(G.id())]+G.height()/2,c>D)c=D;if(O<X)O=X;if(T>x)T=x;if(N<W)N=W}var tt={};return tt.topLeftX=c,tt.topLeftY=T,tt.width=O-c,tt.height=N-T,tt},y.calcParentsWithoutChildren=function(i,e){var g=i.collection();return e.nodes(":parent").forEach(function(d){var c=!1;if(d.children().forEach(function(O){if(O.css("display")!="none")c=!0}),!c)g.merge(d)}),g},o.exports=y},816:(o,n,a)=>{var u=a(548),r=a(140).CoSELayout,y=a(140).CoSENode,i=a(140).layoutBase.PointD,e=a(140).layoutBase.DimensionD,g=a(140).layoutBase.LayoutConstants,d=a(140).layoutBase.FDLayoutConstants,c=a(140).CoSEConstants,O=function(N,D){var{cy:X,eles:x}=N,W=x.nodes(),_=x.edges(),Q=void 0,lt=void 0,G=void 0,tt={};if(N.randomize)Q=D.nodeIndexes,lt=D.xCoords,G=D.yCoords;var s=function(H){return typeof H==="function"},L=function(H,st){if(s(H))return H(st);else return H},E=u.calcParentsWithoutChildren(X,x),M=function B(H,st,dt,Z){var ut=st.length;for(var nt=0;nt<ut;nt++){var S=st[nt],K=null;if(S.intersection(E).length==0)K=S.children();var et=void 0,ct=S.layoutDimensions({nodeDimensionsIncludeLabels:Z.nodeDimensionsIncludeLabels});if(S.outerWidth()!=null&&S.outerHeight()!=null)if(Z.randomize)if(!S.isParent())et=H.add(new y(dt.graphManager,new i(lt[Q.get(S.id())]-ct.w/2,G[Q.get(S.id())]-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else{var Nt=u.calcBoundingBox(S,lt,G,Q);if(S.intersection(E).length==0)et=H.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(Nt.width,Nt.height)));else et=H.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(parseFloat(ct.w),parseFloat(ct.h))))}else et=H.add(new y(dt.graphManager,new i(S.position("x")-ct.w/2,S.position("y")-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else et=H.add(new y(this.graphManager));if(et.id=S.data("id"),et.nodeRepulsion=L(Z.nodeRepulsion,S),et.paddingLeft=parseInt(S.css("padding")),et.paddingTop=parseInt(S.css("padding")),et.paddingRight=parseInt(S.css("padding")),et.paddingBottom=parseInt(S.css("padding")),Z.nodeDimensionsIncludeLabels)et.labelWidth=S.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,et.labelHeight=S.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,et.labelPosVertical=S.css("text-valign"),et.labelPosHorizontal=S.css("text-halign");if(tt[S.data("id")]=et,isNaN(et.rect.x))et.rect.x=0;if(isNaN(et.rect.y))et.rect.y=0;if(K!=null&&K.length>0){var Pt=void 0;Pt=dt.getGraphManager().add(dt.newGraph(),et),B(Pt,K,dt,Z)}}},m=function(H,st,dt){var Z=0,ut=0;for(var nt=0;nt<dt.length;nt++){var S=dt[nt],K=tt[S.data("source")],et=tt[S.data("target")];if(K&&et&&K!==et&&K.getEdgesBetween(et).length==0){var ct=st.add(H.newEdge(),K,et);ct.id=S.id(),ct.idealLength=L(N.idealEdgeLength,S),ct.edgeElasticity=L(N.edgeElasticity,S),Z+=ct.idealLength,ut++}}if(N.idealEdgeLength!=null){if(ut>0)c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=Z/ut;else if(!s(N.idealEdgeLength))c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=N.idealEdgeLength;else c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=50;c.MIN_REPULSION_DIST=d.MIN_REPULSION_DIST=d.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH}},Y=function(H,st){if(st.fixedNodeConstraint)H.constraints.fixedNodeConstraint=st.fixedNodeConstraint;if(st.alignmentConstraint)H.constraints.alignmentConstraint=st.alignmentConstraint;if(st.relativePlacementConstraint)H.constraints.relativePlacementConstraint=st.relativePlacementConstraint};if(N.nestingFactor!=null)c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=N.nestingFactor;if(N.gravity!=null)c.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=N.gravity;if(N.numIter!=null)c.MAX_ITERATIONS=d.MAX_ITERATIONS=N.numIter;if(N.gravityRange!=null)c.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=N.gravityRange;if(N.gravityCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=N.gravityCompound;if(N.gravityRangeCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=N.gravityRangeCompound;if(N.initialEnergyOnIncremental!=null)c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=N.initialEnergyOnIncremental;if(N.tilingCompareBy!=null)c.TILING_COMPARE_BY=N.tilingCompareBy;if(N.quality=="proof")g.QUALITY=2;else g.QUALITY=0;if(c.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=N.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!N.randomize,c.ANIMATE=d.ANIMATE=g.ANIMATE=N.animate,c.TILE=N.tile,c.TILING_PADDING_VERTICAL=typeof N.tilingPaddingVertical==="function"?N.tilingPaddingVertical.call():N.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL=typeof N.tilingPaddingHorizontal==="function"?N.tilingPaddingHorizontal.call():N.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!N.randomize,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=N.uniformNodeDimensions,N.step=="transformed")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1;if(N.step=="enforced")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1;if(N.step=="cose")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0;if(N.step=="all"){if(N.randomize)c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0}if(N.fixedNodeConstraint||N.alignmentConstraint||N.relativePlacementConstraint)c.TREE_REDUCTION_ON_INCREMENTAL=!1;else c.TREE_REDUCTION_ON_INCREMENTAL=!0;var b=new r,k=b.newGraphManager();return M(k.addRoot(),u.getTopMostNodes(W),b,N),m(b,k,_),Y(b,N),b.runLayout(),tt};o.exports={coseLayout:O}},212:(o,n,a)=>{var u=function(){function N(D,X){for(var x=0;x<X.length;x++){var W=X[x];if(W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W)W.writable=!0;Object.defineProperty(D,W.key,W)}}return function(D,X,x){if(X)N(D.prototype,X);if(x)N(D,x);return D}}();function r(N,D){if(!(N instanceof D))throw TypeError("Cannot call a class as a function")}var y=a(658),i=a(548),e=a(657),g=e.spectralLayout,d=a(816),c=d.coseLayout,O=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(D){return 4500},idealEdgeLength:function(D){return 50},edgeElasticity:function(D){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),T=function(){function N(D){r(this,N),this.options=y({},O,D)}return u(N,[{key:"run",value:function(){var X=this,x=this.options,{cy:W,eles:_}=x,Q=[],lt=void 0,G=void 0,tt=[],s=void 0,L=[];if(x.fixedNodeConstraint&&(!Array.isArray(x.fixedNodeConstraint)||x.fixedNodeConstraint.length==0))x.fixedNodeConstraint=void 0;if(x.alignmentConstraint){if(x.alignmentConstraint.vertical&&(!Array.isArray(x.alignmentConstraint.vertical)||x.alignmentConstraint.vertical.length==0))x.alignmentConstraint.vertical=void 0;if(x.alignmentConstraint.horizontal&&(!Array.isArray(x.alignmentConstraint.horizontal)||x.alignmentConstraint.horizontal.length==0))x.alignmentConstraint.horizontal=void 0}if(x.relativePlacementConstraint&&(!Array.isArray(x.relativePlacementConstraint)||x.relativePlacementConstraint.length==0))x.relativePlacementConstraint=void 0;var E=x.fixedNodeConstraint||x.alignmentConstraint||x.relativePlacementConstraint;if(E)x.tile=!1,x.packComponents=!1;var M=void 0,m=!1;if(W.layoutUtilities&&x.packComponents){if(M=W.layoutUtilities("get"),!M)M=W.layoutUtilities();m=!0}if(_.nodes().length>0)if(!m){var Y=x.eles.boundingBox();if(L.push({x:Y.x1+Y.w/2,y:Y.y1+Y.h/2}),x.randomize){var b=g(x);Q.push(b)}if(x.quality=="default"||x.quality=="proof")tt.push(c(x,Q[0])),i.relocateComponent(L[0],tt[0],x);else i.relocateComponent(L[0],Q[0],x)}else{var k=i.getTopMostNodes(x.eles.nodes());if(s=i.connectComponents(W,x.eles,k),s.forEach(function(Et){var vt=Et.boundingBox();L.push({x:vt.x1+vt.w/2,y:vt.y1+vt.h/2})}),x.randomize)s.forEach(function(Et){x.eles=Et,Q.push(g(x))});if(x.quality=="default"||x.quality=="proof"){var B=W.collection();if(x.tile){var H=new Map,st=[],dt=[],Z=0,ut={nodeIndexes:H,xCoords:st,yCoords:dt},nt=[];if(s.forEach(function(Et,vt){if(Et.edges().length==0)Et.nodes().forEach(function(xt,Rt){if(B.merge(Et.nodes()[Rt]),!xt.isParent())ut.nodeIndexes.set(Et.nodes()[Rt].id(),Z++),ut.xCoords.push(Et.nodes()[0].position().x),ut.yCoords.push(Et.nodes()[0].position().y)}),nt.push(vt)}),B.length>1){var S=B.boundingBox();L.push({x:S.x1+S.w/2,y:S.y1+S.h/2}),s.push(B),Q.push(ut);for(var K=nt.length-1;K>=0;K--)s.splice(nt[K],1),Q.splice(nt[K],1),L.splice(nt[K],1)}}s.forEach(function(Et,vt){x.eles=Et,tt.push(c(x,Q[vt])),i.relocateComponent(L[vt],tt[vt],x)})}else s.forEach(function(Et,vt){i.relocateComponent(L[vt],Q[vt],x)});var et=new Set;if(s.length>1){var ct=[],Nt=_.filter(function(Et){return Et.css("display")=="none"});s.forEach(function(Et,vt){var xt=void 0;if(x.quality=="draft")xt=Q[vt].nodeIndexes;if(Et.nodes().not(Nt).length>0){var Rt={};Rt.edges=[],Rt.nodes=[];var Gt=void 0;if(Et.nodes().not(Nt).forEach(function(St){if(x.quality=="draft")if(!St.isParent())Gt=xt.get(St.id()),Rt.nodes.push({x:Q[vt].xCoords[Gt]-St.boundingbox().w/2,y:Q[vt].yCoords[Gt]-St.boundingbox().h/2,width:St.boundingbox().w,height:St.boundingbox().h});else{var Ft=i.calcBoundingBox(St,Q[vt].xCoords,Q[vt].yCoords,xt);Rt.nodes.push({x:Ft.topLeftX,y:Ft.topLeftY,width:Ft.width,height:Ft.height})}else if(tt[vt][St.id()])Rt.nodes.push({x:tt[vt][St.id()].getLeft(),y:tt[vt][St.id()].getTop(),width:tt[vt][St.id()].getWidth(),height:tt[vt][St.id()].getHeight()})}),Et.edges().forEach(function(St){var Ft=St.source(),Ht=St.target();if(Ft.css("display")!="none"&&Ht.css("display")!="none"){if(x.quality=="draft"){var zt=xt.get(Ft.id()),te=xt.get(Ht.id()),qt=[],Kt=[];if(Ft.isParent()){var kt=i.calcBoundingBox(Ft,Q[vt].xCoords,Q[vt].yCoords,xt);qt.push(kt.topLeftX+kt.width/2),qt.push(kt.topLeftY+kt.height/2)}else qt.push(Q[vt].xCoords[zt]),qt.push(Q[vt].yCoords[zt]);if(Ht.isParent()){var J=i.calcBoundingBox(Ht,Q[vt].xCoords,Q[vt].yCoords,xt);Kt.push(J.topLeftX+J.width/2),Kt.push(J.topLeftY+J.height/2)}else Kt.push(Q[vt].xCoords[te]),Kt.push(Q[vt].yCoords[te]);Rt.edges.push({startX:qt[0],startY:qt[1],endX:Kt[0],endY:Kt[1]})}else if(tt[vt][Ft.id()]&&tt[vt][Ht.id()])Rt.edges.push({startX:tt[vt][Ft.id()].getCenterX(),startY:tt[vt][Ft.id()].getCenterY(),endX:tt[vt][Ht.id()].getCenterX(),endY:tt[vt][Ht.id()].getCenterY()})}}),Rt.nodes.length>0)ct.push(Rt),et.add(vt)}});var Pt=M.packComponents(ct,x.randomize).shifts;if(x.quality=="draft")Q.forEach(function(Et,vt){var xt=Et.xCoords.map(function(Gt){return Gt+Pt[vt].dx}),Rt=Et.yCoords.map(function(Gt){return Gt+Pt[vt].dy});Et.xCoords=xt,Et.yCoords=Rt});else{var Bt=0;et.forEach(function(Et){Object.keys(tt[Et]).forEach(function(vt){var xt=tt[Et][vt];xt.setCenter(xt.getCenterX()+Pt[Bt].dx,xt.getCenterY()+Pt[Bt].dy)}),Bt++})}}}var ft=function(vt,xt){if(x.quality=="default"||x.quality=="proof"){if(typeof vt==="number")vt=xt;var Rt=void 0,Gt=void 0,St=vt.data("id");if(tt.forEach(function(Ht){if(St in Ht)Rt={x:Ht[St].getRect().getCenterX(),y:Ht[St].getRect().getCenterY()},Gt=Ht[St]}),x.nodeDimensionsIncludeLabels){if(Gt.labelWidth){if(Gt.labelPosHorizontal=="left")Rt.x+=Gt.labelWidth/2;else if(Gt.labelPosHorizontal=="right")Rt.x-=Gt.labelWidth/2}if(Gt.labelHeight){if(Gt.labelPosVertical=="top")Rt.y+=Gt.labelHeight/2;else if(Gt.labelPosVertical=="bottom")Rt.y-=Gt.labelHeight/2}}if(Rt==null)Rt={x:vt.position("x"),y:vt.position("y")};return{x:Rt.x,y:Rt.y}}else{var Ft=void 0;if(Q.forEach(function(Ht){var zt=Ht.nodeIndexes.get(vt.id());if(zt!=null)Ft={x:Ht.xCoords[zt],y:Ht.yCoords[zt]}}),Ft==null)Ft={x:vt.position("x"),y:vt.position("y")};return{x:Ft.x,y:Ft.y}}};if(x.quality=="default"||x.quality=="proof"||x.randomize){var Jt=i.calcParentsWithoutChildren(W,_),Xt=_.filter(function(Et){return Et.css("display")=="none"});if(x.eles=_.not(Xt),_.nodes().not(":parent").not(Xt).layoutPositions(X,x,ft),Jt.length>0)Jt.forEach(function(Et){Et.position(ft(Et))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),N}();o.exports=T},657:(o,n,a)=>{var u=a(548),r=a(140).layoutBase.Matrix,y=a(140).layoutBase.SVD,i=function(g){var{cy:d,eles:c}=g,O=c.nodes(),T=c.nodes(":parent"),N=new Map,D=new Map,X=new Map,x=[],W=[],_=[],Q=[],lt=[],G=[],tt=[],s=[],L=void 0,E=void 0,M=1e8,m=0.000000001,{piTol:Y,samplingType:b,nodeSeparation:k}=g,B=void 0,H=function(){var it=0,at=0,ot=!1;while(at<B){it=Math.floor(Math.random()*E),ot=!1;for(var gt=0;gt<at;gt++)if(Q[gt]==it){ot=!0;break}if(!ot)Q[at]=it,at++;else continue}},st=function(it,at,ot){var gt=[],At=0,Mt=0,ht=0,Lt=void 0,Ct=[],pt=0,Ot=1;for(var Ut=0;Ut<E;Ut++)Ct[Ut]=M;gt[Mt]=it,Ct[it]=0;while(Mt>=At){ht=gt[At++];var Tt=x[ht];for(var yt=0;yt<Tt.length;yt++)if(Lt=D.get(Tt[yt]),Ct[Lt]==M)Ct[Lt]=Ct[ht]+1,gt[++Mt]=Lt;G[ht][at]=Ct[ht]*k}if(ot){for(var Dt=0;Dt<E;Dt++)if(G[Dt][at]<lt[Dt])lt[Dt]=G[Dt][at];for(var mt=0;mt<E;mt++)if(lt[mt]>pt)pt=lt[mt],Ot=mt}return Ot},dt=function(it){var at=void 0;if(!it){H();for(var ot=0;ot<B;ot++)st(Q[ot],ot,it,!1)}else{at=Math.floor(Math.random()*E),L=at;for(var gt=0;gt<E;gt++)lt[gt]=M;for(var At=0;At<B;At++)Q[At]=at,at=st(at,At,it)}for(var Mt=0;Mt<E;Mt++)for(var ht=0;ht<B;ht++)G[Mt][ht]*=G[Mt][ht];for(var Lt=0;Lt<B;Lt++)tt[Lt]=[];for(var Ct=0;Ct<B;Ct++)for(var pt=0;pt<B;pt++)tt[Ct][pt]=G[Q[pt]][Ct]},Z=function(){var it=y.svd(tt),{S:at,U:ot,V:gt}=it,At=at[0]*at[0]*at[0],Mt=[];for(var ht=0;ht<B;ht++){Mt[ht]=[];for(var Lt=0;Lt<B;Lt++)if(Mt[ht][Lt]=0,ht==Lt)Mt[ht][Lt]=at[ht]/(at[ht]*at[ht]+At/(at[ht]*at[ht]))}s=r.multMat(r.multMat(gt,Mt),r.transpose(ot))},ut=function(){var it=void 0,at=void 0,ot=[],gt=[],At=[],Mt=[];for(var ht=0;ht<E;ht++)ot[ht]=Math.random(),gt[ht]=Math.random();ot=r.normalize(ot),gt=r.normalize(gt);var Lt=0,Ct=m,pt=m,Ot=void 0;while(!0){Lt++;for(var Ut=0;Ut<E;Ut++)At[Ut]=ot[Ut];if(ot=r.multGamma(r.multL(r.multGamma(At),G,s)),it=r.dotProduct(At,ot),ot=r.normalize(ot),Ct=r.dotProduct(At,ot),Ot=Math.abs(Ct/pt),Ot<=1+Y&&Ot>=1)break;pt=Ct}for(var Tt=0;Tt<E;Tt++)At[Tt]=ot[Tt];Lt=0,pt=m;while(!0){Lt++;for(var yt=0;yt<E;yt++)Mt[yt]=gt[yt];if(Mt=r.minusOp(Mt,r.multCons(At,r.dotProduct(At,Mt))),gt=r.multGamma(r.multL(r.multGamma(Mt),G,s)),at=r.dotProduct(Mt,gt),gt=r.normalize(gt),Ct=r.dotProduct(Mt,gt),Ot=Math.abs(Ct/pt),Ot<=1+Y&&Ot>=1)break;pt=Ct}for(var Dt=0;Dt<E;Dt++)Mt[Dt]=gt[Dt];W=r.multCons(At,Math.sqrt(Math.abs(it))),_=r.multCons(Mt,Math.sqrt(Math.abs(at)))};u.connectComponents(d,c,u.getTopMostNodes(O),N),T.forEach(function(rt){u.connectComponents(d,c,u.getTopMostNodes(rt.descendants().intersection(c)),N)});var nt=0;for(var S=0;S<O.length;S++)if(!O[S].isParent())D.set(O[S].id(),nt++);var K=!0,et=!1,ct=void 0;try{for(var Nt=N.keys()[Symbol.iterator](),Pt;!(K=(Pt=Nt.next()).done);K=!0){var Bt=Pt.value;D.set(Bt,nt++)}}catch(rt){et=!0,ct=rt}finally{try{if(!K&&Nt.return)Nt.return()}finally{if(et)throw ct}}for(var ft=0;ft<D.size;ft++)x[ft]=[];T.forEach(function(rt){var it=rt.children().intersection(c);while(it.nodes(":childless").length==0)it=it.nodes()[0].children().intersection(c);var at=0,ot=it.nodes(":childless")[0].connectedEdges().length;it.nodes(":childless").forEach(function(gt,At){if(gt.connectedEdges().length<ot)ot=gt.connectedEdges().length,at=At}),X.set(rt.id(),it.nodes(":childless")[at].id())}),O.forEach(function(rt){var it=void 0;if(rt.isParent())it=D.get(X.get(rt.id()));else it=D.get(rt.id());rt.neighborhood().nodes().forEach(function(at){if(c.intersection(rt.edgesWith(at)).length>0)if(at.isParent())x[it].push(X.get(at.id()));else x[it].push(at.id())})});var Jt=function(it){var at=D.get(it),ot=void 0;N.get(it).forEach(function(gt){if(d.getElementById(gt).isParent())ot=X.get(gt);else ot=gt;x[at].push(ot),x[D.get(ot)].push(it)})},Xt=!0,Et=!1,vt=void 0;try{for(var xt=N.keys()[Symbol.iterator](),Rt;!(Xt=(Rt=xt.next()).done);Xt=!0){var Gt=Rt.value;Jt(Gt)}}catch(rt){Et=!0,vt=rt}finally{try{if(!Xt&&xt.return)xt.return()}finally{if(Et)throw vt}}E=D.size;var St=void 0;if(E>2){B=E<g.sampleSize?E:g.sampleSize;for(var Ft=0;Ft<E;Ft++)G[Ft]=[];for(var Ht=0;Ht<B;Ht++)s[Ht]=[];if(g.quality=="draft"||g.step=="all")dt(b),Z(),ut(),St={nodeIndexes:D,xCoords:W,yCoords:_};else D.forEach(function(rt,it){W.push(d.getElementById(it).position("x")),_.push(d.getElementById(it).position("y"))}),St={nodeIndexes:D,xCoords:W,yCoords:_};return St}else{var zt=D.keys(),te=d.getElementById(zt.next().value),qt=te.position(),Kt=te.outerWidth();if(W.push(qt.x),_.push(qt.y),E==2){var kt=d.getElementById(zt.next().value),J=kt.outerWidth();W.push(qt.x+Kt/2+J/2+g.idealEdgeLength),_.push(qt.y)}return St={nodeIndexes:D,xCoords:W,yCoords:_},St}};o.exports={spectralLayout:i}},579:(o,n,a)=>{var u=a(212),r=function(i){if(!i)return;i("layout","fcose",u)};if(typeof cytoscape<"u")r(cytoscape);o.exports=r},140:(o)=>{o.exports=w}},A={};function v(o){var n=A[o];if(n!==void 0)return n.exports;var a=A[o]={exports:{}};return I[o](a,a.exports,v),a.exports}var f=v(579);return f})()})});var je=mn($e(),1);var Be={L:"left",R:"right",T:"top",B:"bottom"},Ze={L:t((w)=>`${w},${w/2} 0,${w} 0,0`,"L"),R:t((w)=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:t((w)=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:t((w)=>`${w/2},0 ${w},${w} 0,${w}`,"B")},we={L:t((w,I)=>w-I+2,"L"),R:t((w,I)=>w-2,"R"),T:t((w,I)=>w-I+2,"T"),B:t((w,I)=>w-2,"B")},hr=t(function(w){if(_t(w))return w==="L"?"R":"L";else return w==="T"?"B":"T"},"getOppositeArchitectureDirection"),ke=t(function(w){let I=w;return I==="L"||I==="R"||I==="T"||I==="B"},"isArchitectureDirection"),_t=t(function(w){let I=w;return I==="L"||I==="R"},"isArchitectureDirectionX"),he=t(function(w){let I=w;return I==="T"||I==="B"},"isArchitectureDirectionY"),Ye=t(function(w,I){let A=_t(w)&&he(I),v=he(w)&&_t(I);return A||v},"isArchitectureDirectionXY"),fr=t(function(w){let I=w[0],A=w[1],v=_t(I)&&he(A),f=he(I)&&_t(A);return v||f},"isArchitecturePairXY"),cr=t(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),Ge=t(function(w,I){let A=`${w}${I}`;return cr(A)?A:void 0},"getArchitectureDirectionPair"),gr=t(function([w,I],A){let v=A[0],f=A[1];if(_t(v))if(he(f))return[w+(v==="L"?-1:1),I+(f==="T"?1:-1)];else return[w+(v==="L"?-1:1),I];else if(_t(f))return[w+(f==="L"?1:-1),I+(v==="T"?1:-1)];else return[w,I+(v==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ur=t(function(w){if(w==="LT"||w==="TL")return[1,1];else if(w==="BL"||w==="LB")return[1,-1];else if(w==="BR"||w==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),dr=t(function(w,I){if(Ye(w,I))return"bend";else if(_t(w))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),vr=t(function(w){return w.type==="service"},"isArchitectureService"),pr=t(function(w){return w.type==="junction"},"isArchitectureJunction"),qe=t((w,I)=>{let[A,v]=[w,I].sort();return`${JSON.stringify(A)}-${JSON.stringify(v)}`},"architectureGroupAlignmentKey"),Qe=t((w)=>w.data(),"edgeData"),ye=t((w)=>w.data(),"nodeData"),yr=V.architecture,Je=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=F,this.getAccTitle=z,this.setDiagramTitle=q,this.getDiagramTitle=j,this.getAccDescription=U,this.setAccDescription=P,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(w){this.diagramId=w}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",R()}addService({id:w,icon:I,in:A,title:v,iconText:f}){if(this.registeredIds.has(w))throw Error(`The service id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(A!==void 0){if(w===A)throw Error(`The service [${w}] cannot be placed within itself`);if(!this.registeredIds.has(A))throw Error(`The service [${w}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(A)==="node")throw Error(`The service [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"service",icon:I,iconText:f,title:v,edges:[],in:A})}getServices(){return[...this.nodes.values()].filter(vr)}addJunction({id:w,in:I}){if(this.registeredIds.has(w))throw Error(`The junction id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(I!==void 0){if(w===I)throw Error(`The junction [${w}] cannot be placed within itself`);if(!this.registeredIds.has(I))throw Error(`The junction [${w}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(I)==="node")throw Error(`The junction [${w}]'s parent is not a group`)}this.registeredIds.set(w,"node"),this.nodes.set(w,{id:w,type:"junction",edges:[],in:I})}getJunctions(){return[...this.nodes.values()].filter(pr)}getNodes(){return[...this.nodes.values()]}getNode(w){return this.nodes.get(w)??null}addGroup({id:w,icon:I,in:A,title:v}){if(this.registeredIds.has(w))throw Error(`The group id [${w}] is already in use by another ${this.registeredIds.get(w)}`);if(A!==void 0){if(w===A)throw Error(`The group [${w}] cannot be placed within itself`);if(!this.registeredIds.has(A))throw Error(`The group [${w}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(A)==="node")throw Error(`The group [${w}]'s parent is not a group`)}this.registeredIds.set(w,"group"),this.groups.set(w,{id:w,icon:I,title:v,in:A})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:w,rhsId:I,lhsDir:A,rhsDir:v,lhsInto:f,rhsInto:o,lhsGroup:n,rhsGroup:a,title:u}){if(!ke(A))throw Error(`Invalid direction given for left hand side of edge ${w}--${I}. Expected (L,R,T,B) got ${String(A)}`);if(!ke(v))throw Error(`Invalid direction given for right hand side of edge ${w}--${I}. Expected (L,R,T,B) got ${String(v)}`);if(!this.nodes.has(w)&&!this.groups.has(w))throw Error(`The left-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(I)&&!this.groups.has(I))throw Error(`The right-hand id [${I}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(w).in,y=this.nodes.get(I).in;if(n&&r&&y&&r==y)throw Error(`The left-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&r&&y&&r==y)throw Error(`The right-hand id [${I}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:w,lhsDir:A,lhsInto:f,lhsGroup:n,rhsId:I,rhsDir:v,rhsInto:o,rhsGroup:a,title:u};this.edges.push(i);let e=this.nodes.get(w),g=this.nodes.get(I);if(e&&g)e.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(w){if(w.members.length<2)throw Error(`An align directive requires at least two members; got ${w.members.length}`);let I=new Set;w.members.forEach((A)=>{if(this.registeredIds.get(A)!=="node")throw Error(`align ${w.direction} references [${A}], which is not a service or junction`);if(I.has(A))throw Error(`align ${w.direction} lists [${A}] more than once`);I.add(A)}),this.layoutHints.push(w)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let w=new Map,I=new Map;for(let[n,a]of this.nodes.entries()){let u=new Map;for(let r of a.edges){let y=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(y&&i&&y!==i){let e=dr(r.lhsDir,r.rhsDir);if(e!=="bend")w.set(qe(y,i),e)}if(r.lhsId===n){let e=Ge(r.lhsDir,r.rhsDir);if(e)u.set(e,r.rhsId)}else{let e=Ge(r.rhsDir,r.lhsDir);if(e)u.set(e,r.lhsId)}}I.set(n,u)}let A=new Set,v=new Set(I.keys()),f=t((n)=>{let a=new Map([[n,[0,0]]]),u=[n];while(u.length>0){let r=u.shift();if(r){A.add(r),v.delete(r);let y=I.get(r);if(!y)throw Error(`BFS error: adjacency list for id ${r} not found. Please report this as a bug.`);let i=a.get(r);if(!i)throw Error(`BFS error: position for id ${r} not found in spatial map. Please report this as a bug.`);let[e,g]=i;y.forEach((d,c)=>{if(!A.has(d))a.set(d,gr([e,g],c)),u.push(d)})}}return a},"BFS"),o=[];while(v.size>0){let n=v.values().next().value;o.push(f(n))}this.dataStructures={adjList:I,spatialMaps:o,groupAlignments:w}}return this.dataStructures}setElementForId(w,I){this.elements.set(w,I)}getElementById(w){return this.elements.get(w)}getConfig(){return se({...yr,...C().architecture})}getConfigField(w){return this.getConfig()[w]}},mr=t((w,I)=>{be(w,I),w.groups.map((A)=>I.addGroup(A)),w.services.map((A)=>I.addService({...A,type:"service"})),w.junctions.map((A)=>I.addJunction({...A,type:"junction"})),w.edges.map((A)=>I.addEdge(A)),w.alignments?.map((A)=>I.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ke={parser:{yy:void 0},parse:t(async(w)=>{let I=await De("architecture",w);l.debug(I);let A=Ke.parser?.yy;if(!(A instanceof Je))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");mr(I,A)},"parse")},Er=t((w)=>`
|
|
1
|
+
import{be}from"./index-kmzd0adv.js";import{t,l,Y,C,ee,Or,R,L,z,P,U,q,G,p,h,de,Mf,Ri,lr,ie,En,sn}from"./index-r11bbnek.js";import{Ne}from"./index-q81rxwh7.js";import{Mr}from"./index-fjnkzk12.js";import{fn,_n}from"./index-bvjct7sp.js";var Re=_n(function(me,Ie){(function(S,D){if(typeof me==="object"&&typeof Ie==="object")Ie.exports=D();else if(typeof define==="function"&&define.amd)define([],D);else if(typeof me==="object")me.layoutBase=D();else S.layoutBase=D()})(me,function(){return function(M){var S={};function D(v){if(S[v])return S[v].exports;var f=S[v]={i:v,l:!1,exports:{}};return M[v].call(f.exports,f,f.exports,D),f.l=!0,f.exports}return D.m=M,D.c=S,D.i=function(v){return v},D.d=function(v,f,o){if(!D.o(v,f))Object.defineProperty(v,f,{configurable:!1,enumerable:!0,get:o})},D.n=function(v){var f=v&&v.__esModule?function(){return v.default}:function(){return v};return D.d(f,"a",f),f},D.o=function(v,f){return Object.prototype.hasOwnProperty.call(v,f)},D.p="",D(D.s=28)}([function(M,S,D){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1000,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,M.exports=v},function(M,S,D){var v=D(2),f=D(8),o=D(9);function n(u,r,y){v.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=u,this.target=r}n.prototype=Object.create(v.prototype);for(var a in v)n[a]=v[a];n.prototype.getSource=function(){return this.source},n.prototype.getTarget=function(){return this.target},n.prototype.isInterGraph=function(){return this.isInterGraph},n.prototype.getLength=function(){return this.length},n.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},n.prototype.getBendpoints=function(){return this.bendpoints},n.prototype.getLca=function(){return this.lca},n.prototype.getSourceInLca=function(){return this.sourceInLca},n.prototype.getTargetInLca=function(){return this.targetInLca},n.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;else if(this.target===u)return this.source;else throw"Node is not incident with this edge"},n.prototype.getOtherEndInGraph=function(u,r){var y=this.getOtherEnd(u),i=r.getGraphManager().getRoot();while(!0){if(y.getOwner()==r)return y;if(y.getOwner()==i)break;y=y.getOwner().getParent()}return null},n.prototype.updateLength=function(){var u=[,,,,];if(this.isOverlapingSourceAndTarget=f.getIntersection(this.target.getRect(),this.source.getRect(),u),!this.isOverlapingSourceAndTarget){if(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},n.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=o.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=o.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},M.exports=n},function(M,S,D){function v(f){this.vGraphObject=f}M.exports=v},function(M,S,D){var v=D(2),f=D(10),o=D(13),n=D(0),a=D(16),u=D(5);function r(i,e,g,d){if(g==null&&d==null)d=e;if(v.call(this,d),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=f.MIN_VALUE,this.inclusionTreeDepth=f.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,g!=null&&e!=null)this.rect=new o(e.x,e.y,g.width,g.height);else this.rect=new o}r.prototype=Object.create(v.prototype);for(var y in v)r[y]=v[y];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(i){this.rect.width=i},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(i){this.rect.height=i},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(i,e){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=e.width,this.rect.height=e.height},r.prototype.setCenter=function(i,e){this.rect.x=i-this.rect.width/2,this.rect.y=e-this.rect.height/2},r.prototype.setLocation=function(i,e){this.rect.x=i,this.rect.y=e},r.prototype.moveBy=function(i,e){this.rect.x+=i,this.rect.y+=e},r.prototype.getEdgeListToNode=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(c.target==i){if(c.source!=d)throw"Incorrect edge source!";e.push(c)}}),e},r.prototype.getEdgesBetween=function(i){var e=[],g,d=this;return d.edges.forEach(function(c){if(!(c.source==d||c.target==d))throw"Incorrect edge source and/or target";if(c.target==i||c.source==i)e.push(c)}),e},r.prototype.getNeighborsList=function(){var i=new Set,e=this;return e.edges.forEach(function(g){if(g.source==e)i.add(g.target);else{if(g.target!=e)throw"Incorrect incidency!";i.add(g.source)}}),i},r.prototype.withChildren=function(){var i=new Set,e,g;if(i.add(this),this.child!=null){var d=this.child.getNodes();for(var c=0;c<d.length;c++)e=d[c],g=e.withChildren(),g.forEach(function(x){i.add(x)})}return i},r.prototype.getNoOfChildren=function(){var i=0,e;if(this.child==null)i=1;else{var g=this.child.getNodes();for(var d=0;d<g.length;d++)e=g[d],i+=e.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},r.prototype.scatter=function(){var i,e,g=-n.INITIAL_WORLD_BOUNDARY,d=n.INITIAL_WORLD_BOUNDARY;i=n.WORLD_CENTER_X+a.nextDouble()*(d-g)+g;var c=-n.INITIAL_WORLD_BOUNDARY,x=n.INITIAL_WORLD_BOUNDARY;e=n.WORLD_CENTER_Y+a.nextDouble()*(x-c)+c,this.rect.x=i,this.rect.y=e},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),n.NODE_DIMENSIONS_INCLUDE_LABELS){var e=i.getRight()-i.getLeft(),g=i.getBottom()-i.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(e+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>e)this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(e+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(g+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>g)this.rect.y-=(this.labelHeight-g)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(g+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==f.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(i){var e=this.rect.x;if(e>n.WORLD_BOUNDARY)e=n.WORLD_BOUNDARY;else if(e<-n.WORLD_BOUNDARY)e=-n.WORLD_BOUNDARY;var g=this.rect.y;if(g>n.WORLD_BOUNDARY)g=n.WORLD_BOUNDARY;else if(g<-n.WORLD_BOUNDARY)g=-n.WORLD_BOUNDARY;var d=new u(e,g),c=i.inverseTransformPoint(d);this.setLocation(c.x,c.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},M.exports=r},function(M,S,D){var v=D(0);function f(){}for(var o in v)f[o]=v[o];f.MAX_ITERATIONS=2500,f.DEFAULT_EDGE_LENGTH=50,f.DEFAULT_SPRING_STRENGTH=0.45,f.DEFAULT_REPULSION_STRENGTH=4500,f.DEFAULT_GRAVITY_STRENGTH=0.4,f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,f.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,f.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,f.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,f.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,f.COOLING_ADAPTATION_FACTOR=0.33,f.ADAPTATION_LOWER_NODE_LIMIT=1000,f.ADAPTATION_UPPER_NODE_LIMIT=5000,f.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,f.MAX_NODE_DISPLACEMENT=f.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,f.CONVERGENCE_CHECK_PERIOD=100,f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,f.MIN_EDGE_LENGTH=1,f.GRID_CALCULATION_CHECK_PERIOD=10,M.exports=f},function(M,S,D){function v(f,o){if(f==null&&o==null)this.x=0,this.y=0;else this.x=f,this.y=o}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(f){this.x=f},v.prototype.setY=function(f){this.y=f},v.prototype.getDifference=function(f){return new DimensionD(this.x-f.x,this.y-f.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(f){return this.x+=f.width,this.y+=f.height,this},M.exports=v},function(M,S,D){var v=D(2),f=D(10),o=D(0),n=D(7),a=D(3),u=D(1),r=D(13),y=D(12),i=D(11);function e(d,c,x){if(v.call(this,x),this.estimatedSize=f.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,c!=null&&c instanceof n)this.graphManager=c;else if(c!=null&&c instanceof Layout)this.graphManager=c.graphManager}e.prototype=Object.create(v.prototype);for(var g in v)e[g]=v[g];e.prototype.getNodes=function(){return this.nodes},e.prototype.getEdges=function(){return this.edges},e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getParent=function(){return this.parent},e.prototype.getLeft=function(){return this.left},e.prototype.getRight=function(){return this.right},e.prototype.getTop=function(){return this.top},e.prototype.getBottom=function(){return this.bottom},e.prototype.isConnected=function(){return this.isConnected},e.prototype.add=function(d,c,x){if(c==null&&x==null){var T=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(T)>-1)throw"Node already in graph!";return T.owner=this,this.getNodes().push(T),T}else{var N=d;if(!(this.getNodes().indexOf(c)>-1&&this.getNodes().indexOf(x)>-1))throw"Source or target not in graph!";if(!(c.owner==x.owner&&c.owner==this))throw"Both owners must be this graph!";if(c.owner!=x.owner)return null;if(N.source=c,N.target=x,N.isInterGraph=!1,this.getEdges().push(N),c.edges.push(N),x!=c)x.edges.push(N);return N}},e.prototype.remove=function(d){var c=d;if(d instanceof a){if(c==null)throw"Node is null!";if(!(c.owner!=null&&c.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var x=c.edges.slice(),T,N=x.length;for(var O=0;O<N;O++)if(T=x[O],T.isInterGraph)this.graphManager.remove(T);else T.source.owner.remove(T);var W=this.nodes.indexOf(c);if(W==-1)throw"Node not in owner node list!";this.nodes.splice(W,1)}else if(d instanceof u){var T=d;if(T==null)throw"Edge is null!";if(!(T.source!=null&&T.target!=null))throw"Source and/or target is null!";if(!(T.source.owner!=null&&T.target.owner!=null&&T.source.owner==this&&T.target.owner==this))throw"Source and/or target owner is invalid!";var I=T.source.edges.indexOf(T),B=T.target.edges.indexOf(T);if(!(I>-1&&B>-1))throw"Source and/or target doesn't know this edge!";if(T.source.edges.splice(I,1),T.target!=T.source)T.target.edges.splice(B,1);var W=T.source.owner.getEdges().indexOf(T);if(W==-1)throw"Not in owner's edge list!";T.source.owner.getEdges().splice(W,1)}},e.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:c}=f,x,T,N,O=this.getNodes(),W=O.length;for(var I=0;I<W;I++){var B=O[I];if(x=B.getTop(),T=B.getLeft(),d>x)d=x;if(c>T)c=T}if(d==f.MAX_VALUE)return null;if(O[0].getParent().paddingLeft!=null)N=O[0].getParent().paddingLeft;else N=this.margin;return this.left=c-N,this.top=d-N,new y(this.left,this.top)},e.prototype.updateBounds=function(d){var c=f.MAX_VALUE,x=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,O,W,I,B,_,J=this.nodes,lt=J.length;for(var X=0;X<lt;X++){var tt=J[X];if(d&&tt.child!=null)tt.updateBounds();if(O=tt.getLeft(),W=tt.getRight(),I=tt.getTop(),B=tt.getBottom(),c>O)c=O;if(x<W)x=W;if(T>I)T=I;if(N<B)N=B}var s=new r(c,T,x-c,N-T);if(c==f.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(J[0].getParent().paddingLeft!=null)_=J[0].getParent().paddingLeft;else _=this.margin;this.left=s.x-_,this.right=s.x+s.width+_,this.top=s.y-_,this.bottom=s.y+s.height+_},e.calculateBounds=function(d){var c=f.MAX_VALUE,x=-f.MAX_VALUE,T=f.MAX_VALUE,N=-f.MAX_VALUE,O,W,I,B,_=d.length;for(var J=0;J<_;J++){var lt=d[J];if(O=lt.getLeft(),W=lt.getRight(),I=lt.getTop(),B=lt.getBottom(),c>O)c=O;if(x<W)x=W;if(T>I)T=I;if(N<B)N=B}var X=new r(c,T,x-c,N-T);return X},e.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==f.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){var d=0,c=this.nodes,x=c.length;for(var T=0;T<x;T++){var N=c[T];d+=N.calcEstimatedSize()}if(d==0)this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},e.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var c=new i,x=new Set,T=this.nodes[0],N,O,W=T.withChildren();W.forEach(function(X){c.push(X),x.add(X)});while(c.length!==0){T=c.shift(),N=T.getEdges();var I=N.length;for(var B=0;B<I;B++){var _=N[B];if(O=_.getOtherEndInGraph(T,this),O!=null&&!x.has(O)){var J=O.withChildren();J.forEach(function(X){c.push(X),x.add(X)})}}}if(this.isConnected=!1,x.size>=this.nodes.length){var lt=0;if(x.forEach(function(X){if(X.owner==d)lt++}),lt==this.nodes.length)this.isConnected=!0}},M.exports=e},function(M,S,D){var v,f=D(1);function o(n){v=D(6),this.layout=n,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var n=this.layout.newGraph(),a=this.layout.newNode(null),u=this.add(n,a);return this.setRootGraph(u),this.rootGraph},o.prototype.add=function(n,a,u,r,y){if(u==null&&r==null&&y==null){if(n==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(n)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(n),n.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return n.parent=a,a.child=n,n}else{y=u,r=a,u=n;var i=r.getOwner(),e=y.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(e!=null&&e.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==e)return u.isInterGraph=!1,i.add(u,r,y);else{if(u.isInterGraph=!0,u.source=r,u.target=y,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}}},o.prototype.remove=function(n){if(n instanceof v){var a=n;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 u=[];u=u.concat(a.getEdges());var r,y=u.length;for(var i=0;i<y;i++)r=u[i],a.remove(r);var e=[];e=e.concat(a.getNodes());var g;y=e.length;for(var i=0;i<y;i++)g=e[i],a.remove(g);if(a==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(a);this.graphs.splice(d,1),a.parent=null}else if(n instanceof f){if(r=n,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var d=r.source.edges.indexOf(r);if(r.source.edges.splice(d,1),d=r.target.edges.indexOf(r),r.target.edges.splice(d,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var d=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(d,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<u;r++)n=n.concat(a[r].getNodes());this.allNodes=n}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var n=[],a=this.getGraphs(),u=a.length;for(var r=0;r<a.length;r++)n=n.concat(a[r].getEdges());n=n.concat(this.edges),this.allEdges=n}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(n){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=n},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(n){if(n.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=n,n.parent==null)n.parent=this.layout.newNode("Root node")},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(n,a){if(!(n!=null&&a!=null))throw"assert failed";if(n==a)return!0;var u=n.getOwner(),r;do{if(r=u.getParent(),r==null)break;if(r==a)return!0;if(u=r.getOwner(),u==null)break}while(!0);u=a.getOwner();do{if(r=u.getParent(),r==null)break;if(r==n)return!0;if(u=r.getOwner(),u==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){var n,a,u,r,y,i=this.getAllEdges(),e=i.length;for(var g=0;g<e;g++){if(n=i[g],a=n.source,u=n.target,n.lca=null,n.sourceInLca=a,n.targetInLca=u,a==u){n.lca=a.getOwner();continue}r=a.getOwner();while(n.lca==null){n.targetInLca=u,y=u.getOwner();while(n.lca==null){if(y==r){n.lca=y;break}if(y==this.rootGraph)break;if(n.lca!=null)throw"assert failed";n.targetInLca=y.getParent(),y=n.targetInLca.getOwner()}if(r==this.rootGraph)break;if(n.lca==null)n.sourceInLca=r.getParent(),r=n.sourceInLca.getOwner()}if(n.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(n,a){if(n==a)return n.getOwner();var u=n.getOwner();do{if(u==null)break;var r=a.getOwner();do{if(r==null)break;if(r==u)return r;r=r.getParent().getOwner()}while(!0);u=u.getParent().getOwner()}while(!0);return u},o.prototype.calcInclusionTreeDepths=function(n,a){if(n==null&&a==null)n=this.rootGraph,a=1;var u,r=n.getNodes(),y=r.length;for(var i=0;i<y;i++)if(u=r[i],u.inclusionTreeDepth=a,u.child!=null)this.calcInclusionTreeDepths(u.child,a+1)},o.prototype.includesInvalidEdge=function(){var n,a=[],u=this.edges.length;for(var r=0;r<u;r++)if(n=this.edges[r],this.isOneAncestorOfOther(n.source,n.target))a.push(n);for(var r=0;r<a.length;r++)this.remove(a[r]);return!1},M.exports=o},function(M,S,D){var v=D(12);function f(){}f.calcSeparationAmount=function(o,n,a,u){if(!o.intersects(n))throw"assert failed";var r=[,,];if(this.decideDirectionsForOverlappingNodes(o,n,r),a[0]=Math.min(o.getRight(),n.getRight())-Math.max(o.x,n.x),a[1]=Math.min(o.getBottom(),n.getBottom())-Math.max(o.y,n.y),o.getX()<=n.getX()&&o.getRight()>=n.getRight())a[0]+=Math.min(n.getX()-o.getX(),o.getRight()-n.getRight());else if(n.getX()<=o.getX()&&n.getRight()>=o.getRight())a[0]+=Math.min(o.getX()-n.getX(),n.getRight()-o.getRight());if(o.getY()<=n.getY()&&o.getBottom()>=n.getBottom())a[1]+=Math.min(n.getY()-o.getY(),o.getBottom()-n.getBottom());else if(n.getY()<=o.getY()&&n.getBottom()>=o.getBottom())a[1]+=Math.min(o.getY()-n.getY(),n.getBottom()-o.getBottom());var y=Math.abs((n.getCenterY()-o.getCenterY())/(n.getCenterX()-o.getCenterX()));if(n.getCenterY()===o.getCenterY()&&n.getCenterX()===o.getCenterX())y=1;var i=y*a[0],e=a[1]/y;if(a[0]<e)e=a[0];else i=a[1];a[0]=-1*r[0]*(e/2+u),a[1]=-1*r[1]*(i/2+u)},f.decideDirectionsForOverlappingNodes=function(o,n,a){if(o.getCenterX()<n.getCenterX())a[0]=-1;else a[0]=1;if(o.getCenterY()<n.getCenterY())a[1]=-1;else a[1]=1},f.getIntersection2=function(o,n,a){var u=o.getCenterX(),r=o.getCenterY(),y=n.getCenterX(),i=n.getCenterY();if(o.intersects(n))return a[0]=u,a[1]=r,a[2]=y,a[3]=i,!0;var e=o.getX(),g=o.getY(),d=o.getRight(),c=o.getX(),x=o.getBottom(),T=o.getRight(),N=o.getWidthHalf(),O=o.getHeightHalf(),W=n.getX(),I=n.getY(),B=n.getRight(),_=n.getX(),J=n.getBottom(),lt=n.getRight(),X=n.getWidthHalf(),tt=n.getHeightHalf(),s=!1,w=!1;if(u===y){if(r>i)return a[0]=u,a[1]=g,a[2]=y,a[3]=J,!1;else if(r<i)return a[0]=u,a[1]=x,a[2]=y,a[3]=I,!1}else if(r===i){if(u>y)return a[0]=e,a[1]=r,a[2]=B,a[3]=i,!1;else if(u<y)return a[0]=d,a[1]=r,a[2]=W,a[3]=i,!1}else{var E=o.height/o.width,A=n.height/n.width,m=(i-r)/(y-u),H=void 0,b=void 0,Q=void 0,Z=void 0,V=void 0,st=void 0;if(-E===m)if(u>y)a[0]=c,a[1]=x,s=!0;else a[0]=d,a[1]=g,s=!0;else if(E===m)if(u>y)a[0]=e,a[1]=g,s=!0;else a[0]=T,a[1]=x,s=!0;if(-A===m)if(y>u)a[2]=_,a[3]=J,w=!0;else a[2]=B,a[3]=I,w=!0;else if(A===m)if(y>u)a[2]=W,a[3]=I,w=!0;else a[2]=lt,a[3]=J,w=!0;if(s&&w)return!1;if(u>y)if(r>i)H=this.getCardinalDirection(E,m,4),b=this.getCardinalDirection(A,m,2);else H=this.getCardinalDirection(-E,m,3),b=this.getCardinalDirection(-A,m,1);else if(r>i)H=this.getCardinalDirection(-E,m,1),b=this.getCardinalDirection(-A,m,3);else H=this.getCardinalDirection(E,m,2),b=this.getCardinalDirection(A,m,4);if(!s)switch(H){case 1:Z=g,Q=u+-O/m,a[0]=Q,a[1]=Z;break;case 2:Q=T,Z=r+N*m,a[0]=Q,a[1]=Z;break;case 3:Z=x,Q=u+O/m,a[0]=Q,a[1]=Z;break;case 4:Q=c,Z=r+-N*m,a[0]=Q,a[1]=Z;break}if(!w)switch(b){case 1:st=I,V=y+-tt/m,a[2]=V,a[3]=st;break;case 2:V=lt,st=i+X*m,a[2]=V,a[3]=st;break;case 3:st=J,V=y+tt/m,a[2]=V,a[3]=st;break;case 4:V=_,st=i+-X*m,a[2]=V,a[3]=st;break}}return!1},f.getCardinalDirection=function(o,n,a){if(o>n)return a;else return 1+a%4},f.getIntersection=function(o,n,a,u){if(u==null)return this.getIntersection2(o,n,a);var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:x}=u,T=void 0,N=void 0,O=void 0,W=void 0,I=void 0,B=void 0,_=void 0,J=void 0,lt=void 0;if(O=e-y,I=r-i,_=i*y-r*e,W=x-d,B=g-c,J=c*d-g*x,lt=O*B-W*I,lt===0)return null;return T=(I*J-B*_)/lt,N=(W*_-O*J)/lt,new v(T,N)},f.angleOfVector=function(o,n,a,u){var r=void 0;if(o!==a){if(r=Math.atan((u-n)/(a-o)),a<o)r+=Math.PI;else if(u<n)r+=this.TWO_PI}else if(u<n)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},f.doIntersect=function(o,n,a,u){var{x:r,y}=o,{x:i,y:e}=n,{x:g,y:d}=a,{x:c,y:x}=u,T=(i-r)*(x-d)-(c-g)*(e-y);if(T===0)return!1;else{var N=((x-d)*(c-r)+(g-c)*(x-y))/T,O=((y-e)*(c-r)+(i-r)*(x-y))/T;return 0<N&&N<1&&0<O&&O<1}},f.findCircleLineIntersections=function(o,n,a,u,r,y,i){var e=(a-o)*(a-o)+(u-n)*(u-n),g=2*((o-r)*(a-o)+(n-y)*(u-n)),d=(o-r)*(o-r)+(n-y)*(n-y)-i*i,c=g*g-4*e*d;if(c>=0){var x=(-g+Math.sqrt(g*g-4*e*d))/(2*e),T=(-g-Math.sqrt(g*g-4*e*d))/(2*e),N=null;if(x>=0&&x<=1)return[x];if(T>=0&&T<=1)return[T];return N}else return null},f.HALF_PI=0.5*Math.PI,f.ONE_AND_HALF_PI=1.5*Math.PI,f.TWO_PI=2*Math.PI,f.THREE_PI=3*Math.PI,M.exports=f},function(M,S,D){function v(){}v.sign=function(f){if(f>0)return 1;else if(f<0)return-1;else return 0},v.floor=function(f){return f<0?Math.ceil(f):Math.floor(f)},v.ceil=function(f){return f<0?Math.floor(f):Math.ceil(f)},M.exports=v},function(M,S,D){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,M.exports=v},function(M,S,D){var v=function(){function r(y,i){for(var e=0;e<i.length;e++){var g=i[e];if(g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g)g.writable=!0;Object.defineProperty(y,g.key,g)}}return function(y,i,e){if(i)r(y.prototype,i);if(e)r(y,e);return y}}();function f(r,y){if(!(r instanceof y))throw TypeError("Cannot call a class as a function")}var o=function(y){return{value:y,next:null,prev:null}},n=function(y,i,e,g){if(y!==null)y.next=i;else g.head=i;if(e!==null)e.prev=i;else g.tail=i;return i.prev=y,i.next=e,g.length++,i},a=function(y,i){var{prev:e,next:g}=y;if(e!==null)e.next=g;else i.head=g;if(g!==null)g.prev=e;else i.tail=e;return y.prev=y.next=null,i.length--,y},u=function(){function r(y){var i=this;if(f(this,r),this.length=0,this.head=null,this.tail=null,y!=null)y.forEach(function(e){return i.push(e)})}return v(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,e){return n(e.prev,o(i),e,this)}},{key:"insertAfter",value:function(i,e){return n(e,o(i),e.next,this)}},{key:"insertNodeBefore",value:function(i,e){return n(e.prev,i,e,this)}},{key:"insertNodeAfter",value:function(i,e){return n(e,i,e.next,this)}},{key:"push",value:function(i){return n(this.tail,o(i),null,this)}},{key:"unshift",value:function(i){return n(null,o(i),this.head,this)}},{key:"remove",value:function(i){return a(i,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(i){if(i<=this.length()){var e=1,g=this.head;while(e<i)g=g.next,e++;return g.value}}},{key:"set_object_at",value:function(i,e){if(i<=this.length()){var g=1,d=this.head;while(g<i)d=d.next,g++;d.value=e}}}]),r}();M.exports=u},function(M,S,D){function v(f,o,n){if(this.x=null,this.y=null,f==null&&o==null&&n==null)this.x=0,this.y=0;else if(typeof f=="number"&&typeof o=="number"&&n==null)this.x=f,this.y=o;else if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.x=n.x,this.y=n.y}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.getLocation=function(){return new v(this.x,this.y)},v.prototype.setLocation=function(f,o,n){if(f.constructor.name=="Point"&&o==null&&n==null)n=f,this.setLocation(n.x,n.y);else if(typeof f=="number"&&typeof o=="number"&&n==null)if(parseInt(f)==f&&parseInt(o)==o)this.move(f,o);else this.x=Math.floor(f+0.5),this.y=Math.floor(o+0.5)},v.prototype.move=function(f,o){this.x=f,this.y=o},v.prototype.translate=function(f,o){this.x+=f,this.y+=o},v.prototype.equals=function(f){if(f.constructor.name=="Point"){var o=f;return this.x==o.x&&this.y==o.y}return this==f},v.prototype.toString=function(){return new v().constructor.name+"[x="+this.x+",y="+this.y+"]"},M.exports=v},function(M,S,D){function v(f,o,n,a){if(this.x=0,this.y=0,this.width=0,this.height=0,f!=null&&o!=null&&n!=null&&a!=null)this.x=f,this.y=o,this.width=n,this.height=a}v.prototype.getX=function(){return this.x},v.prototype.setX=function(f){this.x=f},v.prototype.getY=function(){return this.y},v.prototype.setY=function(f){this.y=f},v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},v.prototype.getRight=function(){return this.x+this.width},v.prototype.getBottom=function(){return this.y+this.height},v.prototype.intersects=function(f){if(this.getRight()<f.x)return!1;if(this.getBottom()<f.y)return!1;if(f.getRight()<this.x)return!1;if(f.getBottom()<this.y)return!1;return!0},v.prototype.getCenterX=function(){return this.x+this.width/2},v.prototype.getMinX=function(){return this.getX()},v.prototype.getMaxX=function(){return this.getX()+this.width},v.prototype.getCenterY=function(){return this.y+this.height/2},v.prototype.getMinY=function(){return this.getY()},v.prototype.getMaxY=function(){return this.getY()+this.height},v.prototype.getWidthHalf=function(){return this.width/2},v.prototype.getHeightHalf=function(){return this.height/2},M.exports=v},function(M,S,D){var v=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol==="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function f(){}f.lastID=0,f.createID=function(o){if(f.isPrimitive(o))return o;if(o.uniqueID!=null)return o.uniqueID;return o.uniqueID=f.getString(),f.lastID++,o.uniqueID},f.getString=function(o){if(o==null)o=f.lastID;return"Object#"+o},f.isPrimitive=function(o){var n=typeof o>"u"?"undefined":v(o);return o==null||n!="object"&&n!="function"},M.exports=f},function(M,S,D){function v(g){if(Array.isArray(g)){for(var d=0,c=Array(g.length);d<g.length;d++)c[d]=g[d];return c}else return Array.from(g)}var f=D(0),o=D(7),n=D(3),a=D(1),u=D(6),r=D(5),y=D(17),i=D(29);function e(g){if(i.call(this),this.layoutQuality=f.QUALITY,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=f.DEFAULT_INCREMENTAL,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null)this.isRemoteUse=g}e.RANDOM_SEED=1,e.prototype=Object.create(i.prototype),e.prototype.getGraphManager=function(){return this.graphManager},e.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},e.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},e.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},e.prototype.newGraphManager=function(){var g=new o(this);return this.graphManager=g,g},e.prototype.newGraph=function(g){return new u(null,this.graphManager,g)},e.prototype.newNode=function(g){return new n(this.graphManager,g)},e.prototype.newEdge=function(g){return new a(null,null,g)},e.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},e.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var g;if(this.checkLayoutSuccess())g=!1;else g=this.layout();if(f.ANIMATE==="during")return!1;if(g){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,g},e.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},e.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var g,d=this.graphManager.getAllEdges();for(var c=0;c<d.length;c++)g=d[c];var x,T=this.graphManager.getRoot().getNodes();for(var c=0;c<T.length;c++)x=T[c];this.update(this.graphManager.getRoot())}},e.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof n){var d=g;if(d.getChild()!=null){var c=d.getChild().getNodes();for(var x=0;x<c.length;x++)update(c[x])}if(d.vGraphObject!=null){var T=d.vGraphObject;T.update(d)}}else if(g instanceof a){var N=g;if(N.vGraphObject!=null){var O=N.vGraphObject;O.update(N)}}else if(g instanceof u){var W=g;if(W.vGraphObject!=null){var I=W.vGraphObject;I.update(W)}}},e.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=f.QUALITY,this.animationDuringLayout=f.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=f.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=f.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=f.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=f.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=f.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},e.prototype.transform=function(g){if(g==null)this.transform(new r(0,0));else{var d=new y,c=this.graphManager.getRoot().updateLeftTop();if(c!=null){d.setWorldOrgX(g.x),d.setWorldOrgY(g.y),d.setDeviceOrgX(c.x),d.setDeviceOrgY(c.y);var x=this.getAllNodes(),T;for(var N=0;N<x.length;N++)T=x[N],T.transform(d)}}},e.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,c,x=g.getNodes();for(var T=0;T<x.length;T++)if(d=x[T],c=d.getChild(),c==null)d.scatter();else if(c.getNodes().length==0)d.scatter();else this.positionNodesRandomly(c),d.updateBounds()}},e.prototype.getFlatForest=function(){var g=[],d=!0,c=this.graphManager.getRoot().getNodes(),x=!0;for(var T=0;T<c.length;T++)if(c[T].getChild()!=null)x=!1;if(!x)return g;var N=new Set,O=[],W=new Map,I=[];I=I.concat(c);while(I.length>0&&d){O.push(I[0]);while(O.length>0&&d){var B=O[0];O.splice(0,1),N.add(B);var _=B.getEdges();for(var T=0;T<_.length;T++){var J=_[T].getOtherEnd(B);if(W.get(B)!=J)if(!N.has(J))O.push(J),W.set(J,B);else{d=!1;break}}}if(!d)g=[];else{var lt=[].concat(v(N));g.push(lt);for(var T=0;T<lt.length;T++){var X=lt[T],tt=I.indexOf(X);if(tt>-1)I.splice(tt,1)}N=new Set,W=new Map}}return g},e.prototype.createDummyNodesForBendpoints=function(g){var d=[],c=g.source,x=this.graphManager.calcLowestCommonAncestor(g.source,g.target);for(var T=0;T<g.bendpoints.length;T++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),x.add(N);var O=this.newEdge(null);this.graphManager.add(O,c,N),d.add(N),c=N}var O=this.newEdge(null);if(this.graphManager.add(O,c,g.target),this.edgeToDummyNodes.set(g,d),g.isInterGraph())this.graphManager.remove(g);else x.remove(g);return d},e.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(v(this.edgeToDummyNodes.keys())).concat(g);for(var d=0;d<g.length;d++){var c=g[d];if(c.bendpoints.length>0){var x=this.edgeToDummyNodes.get(c);for(var T=0;T<x.length;T++){var N=x[T],O=new r(N.getCenterX(),N.getCenterY()),W=c.bendpoints.get(T);W.x=O.x,W.y=O.y,N.getOwner().remove(N)}this.graphManager.add(c,c.source,c.target)}}},e.transform=function(g,d,c,x){if(c!=null&&x!=null){var T=d;if(g<=50){var N=d/c;T-=(d-N)/50*(50-g)}else{var O=d*x;T+=(O-d)/50*(g-50)}return T}else{var W,I;if(g<=50)W=9*d/500,I=d/10;else W=9*d/50,I=-8*d;return W*g+I}},e.findCenterOfTree=function(g){var d=[];d=d.concat(g);var c=[],x=new Map,T=!1,N=null;if(d.length==1||d.length==2)T=!0,N=d[0];for(var O=0;O<d.length;O++){var W=d[O],I=W.getNeighborsList().size;if(x.set(W,W.getNeighborsList().size),I==1)c.push(W)}var B=[];B=B.concat(c);while(!T){var _=[];_=_.concat(B),B=[];for(var O=0;O<d.length;O++){var W=d[O],J=d.indexOf(W);if(J>=0)d.splice(J,1);var lt=W.getNeighborsList();lt.forEach(function(s){if(c.indexOf(s)<0){var w=x.get(s),E=w-1;if(E==1)B.push(s);x.set(s,E)}})}if(c=c.concat(B),d.length==1||d.length==2)T=!0,N=d[0]}return N},e.prototype.setGraphManager=function(g){this.graphManager=g},M.exports=e},function(M,S,D){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},M.exports=v},function(M,S,D){var v=D(5);function f(o,n){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}f.prototype.getWorldOrgX=function(){return this.lworldOrgX},f.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},f.prototype.getWorldOrgY=function(){return this.lworldOrgY},f.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},f.prototype.getWorldExtX=function(){return this.lworldExtX},f.prototype.setWorldExtX=function(o){this.lworldExtX=o},f.prototype.getWorldExtY=function(){return this.lworldExtY},f.prototype.setWorldExtY=function(o){this.lworldExtY=o},f.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},f.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},f.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},f.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},f.prototype.getDeviceExtX=function(){return this.ldeviceExtX},f.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},f.prototype.getDeviceExtY=function(){return this.ldeviceExtY},f.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},f.prototype.transformX=function(o){var n=0,a=this.lworldExtX;if(a!=0)n=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/a;return n},f.prototype.transformY=function(o){var n=0,a=this.lworldExtY;if(a!=0)n=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/a;return n},f.prototype.inverseTransformX=function(o){var n=0,a=this.ldeviceExtX;if(a!=0)n=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/a;return n},f.prototype.inverseTransformY=function(o){var n=0,a=this.ldeviceExtY;if(a!=0)n=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/a;return n},f.prototype.inverseTransformPoint=function(o){var n=new v(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return n},M.exports=f},function(M,S,D){function v(i){if(Array.isArray(i)){for(var e=0,g=Array(i.length);e<i.length;e++)g[e]=i[e];return g}else return Array.from(i)}var f=D(15),o=D(4),n=D(0),a=D(8),u=D(9);function r(){f.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}r.prototype=Object.create(f.prototype);for(var y in f)r[y]=f[y];r.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){var i,e,g,d,c,x,T,N=this.getGraphManager().getAllEdges();for(var O=0;O<N.length;O++)if(i=N[O],e=i.idealLength,i.isInterGraph){if(d=i.getSource(),c=i.getTarget(),x=i.getSourceInLca().getEstimatedSize(),T=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=x+T-2*n.SIMPLE_NODE_SIZE;g=i.getLca().getInclusionTreeDepth(),i.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+c.getInclusionTreeDepth()-2*g)}},r.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;if(this.incremental){if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(i>o.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(i-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){var i=this.getAllEdges(),e;for(var g=0;g<i.length;g++)e=i[g],this.calcSpringForce(e,e.idealLength)},r.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,d,c,x,T=this.getAllNodes(),N;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();N=new Set;for(g=0;g<T.length;g++)c=T[g],this.calculateRepulsionForceOfANode(c,N,i,e),N.add(c)}else for(g=0;g<T.length;g++){c=T[g];for(d=g+1;d<T.length;d++){if(x=T[d],c.getOwner()!=x.getOwner())continue;this.calcRepulsionForce(c,x)}}},r.prototype.calcGravitationalForces=function(){var i,e=this.getAllNodesToApplyGravitation();for(var g=0;g<e.length;g++)i=e[g],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),e;for(var g=0;g<i.length;g++)e=i[g],e.move()},r.prototype.calcSpringForce=function(i,e){var g=i.getSource(),d=i.getTarget(),c,x,T,N;if(this.uniformLeafNodeSizes&&g.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(c=i.getLength(),c==0)return;x=i.edgeElasticity*(c-e),T=x*(i.lengthX/c),N=x*(i.lengthY/c),g.springForceX+=T,g.springForceY+=N,d.springForceX-=T,d.springForceY-=N},r.prototype.calcRepulsionForce=function(i,e){var g=i.getRect(),d=e.getRect(),c=[,,],x=[,,,,],T,N,O,W,I,B,_;if(g.intersects(d)){a.calcSeparationAmount(g,d,c,o.DEFAULT_EDGE_LENGTH/2),B=2*c[0],_=2*c[1];var J=i.noOfChildren*e.noOfChildren/(i.noOfChildren+e.noOfChildren);i.repulsionForceX-=J*B,i.repulsionForceY-=J*_,e.repulsionForceX+=J*B,e.repulsionForceY+=J*_}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&e.getChild()==null)T=d.getCenterX()-g.getCenterX(),N=d.getCenterY()-g.getCenterY();else a.getIntersection(g,d,x),T=x[2]-x[0],N=x[3]-x[1];if(Math.abs(T)<o.MIN_REPULSION_DIST)T=u.sign(T)*o.MIN_REPULSION_DIST;if(Math.abs(N)<o.MIN_REPULSION_DIST)N=u.sign(N)*o.MIN_REPULSION_DIST;O=T*T+N*N,W=Math.sqrt(O),I=(i.nodeRepulsion/2+e.nodeRepulsion/2)*i.noOfChildren*e.noOfChildren/O,B=I*T/W,_=I*N/W,i.repulsionForceX-=B,i.repulsionForceY-=_,e.repulsionForceX+=B,e.repulsionForceY+=_}},r.prototype.calcGravitationalForce=function(i){var e,g,d,c,x,T,N,O;if(e=i.getOwner(),g=(e.getRight()+e.getLeft())/2,d=(e.getTop()+e.getBottom())/2,c=i.getCenterX()-g,x=i.getCenterY()-d,T=Math.abs(c)+i.getWidth()/2,N=Math.abs(x)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(O=e.getEstimatedSize()*this.gravityRangeFactor,T>O||N>O)i.gravitationForceX=-this.gravityConstant*c,i.gravitationForceY=-this.gravityConstant*x}else if(O=e.getEstimatedSize()*this.compoundGravityRangeFactor,T>O||N>O)i.gravitationForceX=-this.gravityConstant*c*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*x*this.compoundGravityConstant},r.prototype.isConverged=function(){var i,e=!1;if(this.totalIterations>this.maxIterations/3)e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||e},r.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},r.prototype.calcNoOfChildrenForAllNodes=function(){var i,e=this.graphManager.getAllNodes();for(var g=0;g<e.length;g++)i=e[g],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var e=0,g=0;e=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var d=Array(e);for(var c=0;c<e;c++)d[c]=Array(g);for(var c=0;c<e;c++)for(var x=0;x<g;x++)d[c][x]=[];return d},r.prototype.addNodeToGrid=function(i,e,g){var d=0,c=0,x=0,T=0;d=parseInt(Math.floor((i.getRect().x-e)/this.repulsionRange)),c=parseInt(Math.floor((i.getRect().width+i.getRect().x-e)/this.repulsionRange)),x=parseInt(Math.floor((i.getRect().y-g)/this.repulsionRange)),T=parseInt(Math.floor((i.getRect().height+i.getRect().y-g)/this.repulsionRange));for(var N=d;N<=c;N++)for(var O=x;O<=T;O++)this.grid[N][O].push(i),i.setGridCoordinates(d,c,x,T)},r.prototype.updateGrid=function(){var i,e,g=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<g.length;i++)e=g[i],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,e,g,d){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&g||d){var c=new Set;i.surrounding=[];var x,T=this.grid;for(var N=i.startX-1;N<i.finishX+2;N++)for(var O=i.startY-1;O<i.finishY+2;O++)if(!(N<0||O<0||N>=T.length||O>=T[0].length))for(var W=0;W<T[N][O].length;W++){if(x=T[N][O][W],i.getOwner()!=x.getOwner()||i==x)continue;if(!e.has(x)&&!c.has(x)){var I=Math.abs(i.getCenterX()-x.getCenterX())-(i.getWidth()/2+x.getWidth()/2),B=Math.abs(i.getCenterY()-x.getCenterY())-(i.getHeight()/2+x.getHeight()/2);if(I<=this.repulsionRange&&B<=this.repulsionRange)c.add(x)}}i.surrounding=[].concat(v(c))}for(N=0;N<i.surrounding.length;N++)this.calcRepulsionForce(i,i.surrounding[N])},r.prototype.calcRepulsionRange=function(){return 0},M.exports=r},function(M,S,D){var v=D(1),f=D(4);function o(a,u,r){v.call(this,a,u,r),this.idealLength=f.DEFAULT_EDGE_LENGTH,this.edgeElasticity=f.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];M.exports=o},function(M,S,D){var v=D(3),f=D(4);function o(a,u,r,y){v.call(this,a,u,r,y),this.nodeRepulsion=f.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=[]}o.prototype=Object.create(v.prototype);for(var n in v)o[n]=v[n];o.prototype.setGridCoordinates=function(a,u,r,y){this.startX=a,this.finishX=u,this.startY=r,this.finishY=y},M.exports=o},function(M,S,D){function v(f,o){if(this.width=0,this.height=0,f!==null&&o!==null)this.height=o,this.width=f}v.prototype.getWidth=function(){return this.width},v.prototype.setWidth=function(f){this.width=f},v.prototype.getHeight=function(){return this.height},v.prototype.setHeight=function(f){this.height=f},M.exports=v},function(M,S,D){var v=D(14);function f(){this.map={},this.keys=[]}f.prototype.put=function(o,n){var a=v.createID(o);if(!this.contains(a))this.map[a]=n,this.keys.push(o)},f.prototype.contains=function(o){var n=v.createID(o);return this.map[o]!=null},f.prototype.get=function(o){var n=v.createID(o);return this.map[n]},f.prototype.keySet=function(){return this.keys},M.exports=f},function(M,S,D){var v=D(14);function f(){this.set={}}f.prototype.add=function(o){var n=v.createID(o);if(!this.contains(n))this.set[n]=o},f.prototype.remove=function(o){delete this.set[v.createID(o)]},f.prototype.clear=function(){this.set={}},f.prototype.contains=function(o){return this.set[v.createID(o)]==o},f.prototype.isEmpty=function(){return this.size()===0},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAllTo=function(o){var n=Object.keys(this.set),a=n.length;for(var u=0;u<a;u++)o.push(this.set[n[u]])},f.prototype.size=function(){return Object.keys(this.set).length},f.prototype.addAll=function(o){var n=o.length;for(var a=0;a<n;a++){var u=o[a];this.add(u)}},M.exports=f},function(M,S,D){function v(){}v.multMat=function(f,o){var n=[];for(var a=0;a<f.length;a++){n[a]=[];for(var u=0;u<o[0].length;u++){n[a][u]=0;for(var r=0;r<f[0].length;r++)n[a][u]+=f[a][r]*o[r][u]}}return n},v.transpose=function(f){var o=[];for(var n=0;n<f[0].length;n++){o[n]=[];for(var a=0;a<f.length;a++)o[n][a]=f[a][n]}return o},v.multCons=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]*o;return n},v.minusOp=function(f,o){var n=[];for(var a=0;a<f.length;a++)n[a]=f[a]-o[a];return n},v.dotProduct=function(f,o){var n=0;for(var a=0;a<f.length;a++)n+=f[a]*o[a];return n},v.mag=function(f){return Math.sqrt(this.dotProduct(f,f))},v.normalize=function(f){var o=[],n=this.mag(f);for(var a=0;a<f.length;a++)o[a]=f[a]/n;return o},v.multGamma=function(f){var o=[],n=0;for(var a=0;a<f.length;a++)n+=f[a];n*=-1/f.length;for(var u=0;u<f.length;u++)o[u]=n+f[u];return o},v.multL=function(f,o,n){var a=[],u=[],r=[];for(var y=0;y<o[0].length;y++){var i=0;for(var e=0;e<o.length;e++)i+=-0.5*o[e][y]*f[e];u[y]=i}for(var g=0;g<n.length;g++){var d=0;for(var c=0;c<n.length;c++)d+=n[g][c]*u[c];r[g]=d}for(var x=0;x<o.length;x++){var T=0;for(var N=0;N<o[0].length;N++)T+=o[x][N]*r[N];a[x]=T}return a},M.exports=v},function(M,S,D){var v=function(){function a(u,r){for(var y=0;y<r.length;y++){var i=r[y];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(u,i.key,i)}}return function(u,r,y){if(r)a(u.prototype,r);if(y)a(u,y);return u}}();function f(a,u){if(!(a instanceof u))throw TypeError("Cannot call a class as a function")}var o=D(11),n=function(){function a(u,r){if(f(this,a),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var y=void 0;if(u instanceof o)y=u.size();else y=u.length;this._quicksort(u,0,y-1)}return v(a,[{key:"_quicksort",value:function(r,y,i){if(y<i){var e=this._partition(r,y,i);this._quicksort(r,y,e),this._quicksort(r,e+1,i)}}},{key:"_partition",value:function(r,y,i){var e=this._get(r,y),g=y,d=i;while(!0){while(this.compareFunction(e,this._get(r,d)))d--;while(this.compareFunction(this._get(r,g),e))g++;if(g<d)this._swap(r,g,d),g++,d--;else return d}}},{key:"_get",value:function(r,y){if(r instanceof o)return r.get_object_at(y);else return r[y]}},{key:"_set",value:function(r,y,i){if(r instanceof o)r.set_object_at(y,i);else r[y]=i}},{key:"_swap",value:function(r,y,i){var e=this._get(r,y);this._set(r,y,this._get(r,i)),this._set(r,i,e)}},{key:"_defaultCompareFunction",value:function(r,y){return y>r}}]),a}();M.exports=n},function(M,S,D){function v(){}v.svd=function(f){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=f.length,this.n=f[0].length;var o=Math.min(this.m,this.n);this.s=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(Math.min(this.m+1,this.n)),this.U=function(Wt){var bt=function oe($t){if($t.length==0)return 0;else{var jt=[];for(var ne=0;ne<$t[0];ne++)jt.push(oe($t.slice(1)));return jt}};return bt(Wt)}([this.m,o]),this.V=function(Wt){var bt=function oe($t){if($t.length==0)return 0;else{var jt=[];for(var ne=0;ne<$t[0];ne++)jt.push(oe($t.slice(1)));return jt}};return bt(Wt)}([this.n,this.n]);var n=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.n),a=function(Wt){var bt=[];while(Wt-- >0)bt.push(0);return bt}(this.m),u=!0,r=!0,y=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m));for(var e=0;e<Math.max(y,i);e++){if(e<y){this.s[e]=0;for(var g=e;g<this.m;g++)this.s[e]=v.hypot(this.s[e],f[g][e]);if(this.s[e]!==0){if(f[e][e]<0)this.s[e]=-this.s[e];for(var d=e;d<this.m;d++)f[d][e]/=this.s[e];f[e][e]+=1}this.s[e]=-this.s[e]}for(var c=e+1;c<this.n;c++){if(function(Wt,bt){return Wt&&bt}(e<y,this.s[e]!==0)){var x=0;for(var T=e;T<this.m;T++)x+=f[T][e]*f[T][c];x=-x/f[e][e];for(var N=e;N<this.m;N++)f[N][c]+=x*f[N][e]}n[c]=f[e][c]}if(function(Wt,bt){return Wt&&bt}(u,e<y))for(var O=e;O<this.m;O++)this.U[O][e]=f[O][e];if(e<i){n[e]=0;for(var W=e+1;W<this.n;W++)n[e]=v.hypot(n[e],n[W]);if(n[e]!==0){if(n[e+1]<0)n[e]=-n[e];for(var I=e+1;I<this.n;I++)n[I]/=n[e];n[e+1]+=1}if(n[e]=-n[e],function(Wt,bt){return Wt&&bt}(e+1<this.m,n[e]!==0)){for(var B=e+1;B<this.m;B++)a[B]=0;for(var _=e+1;_<this.n;_++)for(var J=e+1;J<this.m;J++)a[J]+=n[_]*f[J][_];for(var lt=e+1;lt<this.n;lt++){var X=-n[lt]/n[e+1];for(var tt=e+1;tt<this.m;tt++)f[tt][lt]+=X*a[tt]}}if(r)for(var s=e+1;s<this.n;s++)this.V[s][e]=n[s]}}var w=Math.min(this.n,this.m+1);if(y<this.n)this.s[y]=f[y][y];if(this.m<w)this.s[w-1]=0;if(i+1<w)n[i]=f[i][w-1];if(n[w-1]=0,u){for(var E=y;E<o;E++){for(var A=0;A<this.m;A++)this.U[A][E]=0;this.U[E][E]=1}for(var m=y-1;m>=0;m--)if(this.s[m]!==0){for(var H=m+1;H<o;H++){var b=0;for(var Q=m;Q<this.m;Q++)b+=this.U[Q][m]*this.U[Q][H];b=-b/this.U[m][m];for(var Z=m;Z<this.m;Z++)this.U[Z][H]+=b*this.U[Z][m]}for(var V=m;V<this.m;V++)this.U[V][m]=-this.U[V][m];this.U[m][m]=1+this.U[m][m];for(var st=0;st<m-1;st++)this.U[st][m]=0}else{for(var dt=0;dt<this.m;dt++)this.U[dt][m]=0;this.U[m][m]=1}}if(r)for(var k=this.n-1;k>=0;k--){if(function(Wt,bt){return Wt&&bt}(k<i,n[k]!==0))for(var ut=k+1;ut<o;ut++){var nt=0;for(var F=k+1;F<this.n;F++)nt+=this.V[F][k]*this.V[F][ut];nt=-nt/this.V[k+1][k];for(var j=k+1;j<this.n;j++)this.V[j][ut]+=nt*this.V[j][k]}for(var et=0;et<this.n;et++)this.V[et][k]=0;this.V[k][k]=1}var ct=w-1,Nt=0,Pt=Math.pow(2,-52),Bt=Math.pow(2,-966);while(w>0){var ft=void 0,Jt=void 0;for(ft=w-2;ft>=-1;ft--){if(ft===-1)break;if(Math.abs(n[ft])<=Bt+Pt*(Math.abs(this.s[ft])+Math.abs(this.s[ft+1]))){n[ft]=0;break}}if(ft===w-2)Jt=4;else{var Xt=void 0;for(Xt=w-1;Xt>=ft;Xt--){if(Xt===ft)break;var Et=(Xt!==w?Math.abs(n[Xt]):0)+(Xt!==ft+1?Math.abs(n[Xt-1]):0);if(Math.abs(this.s[Xt])<=Bt+Pt*Et){this.s[Xt]=0;break}}if(Xt===ft)Jt=3;else if(Xt===w-1)Jt=1;else Jt=2,ft=Xt}switch(ft++,Jt){case 1:{var vt=n[w-2];n[w-2]=0;for(var xt=w-2;xt>=ft;xt--){var Rt=v.hypot(this.s[xt],vt),Gt=this.s[xt]/Rt,St=vt/Rt;if(this.s[xt]=Rt,xt!==ft)vt=-St*n[xt-1],n[xt-1]=Gt*n[xt-1];if(r)for(var Ft=0;Ft<this.n;Ft++)Rt=Gt*this.V[Ft][xt]+St*this.V[Ft][w-1],this.V[Ft][w-1]=-St*this.V[Ft][xt]+Gt*this.V[Ft][w-1],this.V[Ft][xt]=Rt}}break;case 2:{var Ht=n[ft-1];n[ft-1]=0;for(var zt=ft;zt<w;zt++){var te=v.hypot(this.s[zt],Ht),qt=this.s[zt]/te,Kt=Ht/te;if(this.s[zt]=te,Ht=-Kt*n[zt],n[zt]=qt*n[zt],u)for(var kt=0;kt<this.m;kt++)te=qt*this.U[kt][zt]+Kt*this.U[kt][ft-1],this.U[kt][ft-1]=-Kt*this.U[kt][zt]+qt*this.U[kt][ft-1],this.U[kt][zt]=te}}break;case 3:{var K=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[w-1]),Math.abs(this.s[w-2])),Math.abs(n[w-2])),Math.abs(this.s[ft])),Math.abs(n[ft])),rt=this.s[w-1]/K,it=this.s[w-2]/K,at=n[w-2]/K,ot=this.s[ft]/K,gt=n[ft]/K,At=((it+rt)*(it-rt)+at*at)/2,Mt=rt*at*(rt*at),ht=0;if(function(Wt,bt){return Wt||bt}(At!==0,Mt!==0)){if(ht=Math.sqrt(At*At+Mt),At<0)ht=-ht;ht=Mt/(At+ht)}var Lt=(ot+rt)*(ot-rt)+ht,Ct=ot*gt;for(var pt=ft;pt<w-1;pt++){var Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot;if(pt!==ft)n[pt-1]=Ot;if(Lt=Ut*this.s[pt]+Tt*n[pt],n[pt]=Ut*n[pt]-Tt*this.s[pt],Ct=Tt*this.s[pt+1],this.s[pt+1]=Ut*this.s[pt+1],r)for(var yt=0;yt<this.n;yt++)Ot=Ut*this.V[yt][pt]+Tt*this.V[yt][pt+1],this.V[yt][pt+1]=-Tt*this.V[yt][pt]+Ut*this.V[yt][pt+1],this.V[yt][pt]=Ot;if(Ot=v.hypot(Lt,Ct),Ut=Lt/Ot,Tt=Ct/Ot,this.s[pt]=Ot,Lt=Ut*n[pt]+Tt*this.s[pt+1],this.s[pt+1]=-Tt*n[pt]+Ut*this.s[pt+1],Ct=Tt*n[pt+1],n[pt+1]=Ut*n[pt+1],u&&pt<this.m-1)for(var Dt=0;Dt<this.m;Dt++)Ot=Ut*this.U[Dt][pt]+Tt*this.U[Dt][pt+1],this.U[Dt][pt+1]=-Tt*this.U[Dt][pt]+Ut*this.U[Dt][pt+1],this.U[Dt][pt]=Ot}n[w-2]=Lt,Nt=Nt+1}break;case 4:{if(this.s[ft]<=0){if(this.s[ft]=this.s[ft]<0?-this.s[ft]:0,r)for(var mt=0;mt<=ct;mt++)this.V[mt][ft]=-this.V[mt][ft]}while(ft<ct){if(this.s[ft]>=this.s[ft+1])break;var wt=this.s[ft];if(this.s[ft]=this.s[ft+1],this.s[ft+1]=wt,r&&ft<this.n-1)for(var Zt=0;Zt<this.n;Zt++)wt=this.V[Zt][ft+1],this.V[Zt][ft+1]=this.V[Zt][ft],this.V[Zt][ft]=wt;if(u&&ft<this.m-1)for(var Vt=0;Vt<this.m;Vt++)wt=this.U[Vt][ft+1],this.U[Vt][ft+1]=this.U[Vt][ft],this.U[Vt][ft]=wt;ft++}Nt=0,w--}break}}var re={U:this.U,V:this.V,S:this.s};return re},v.hypot=function(f,o){var n=void 0;if(Math.abs(f)>Math.abs(o))n=o/f,n=Math.abs(f)*Math.sqrt(1+n*n);else if(o!=0)n=f/o,n=Math.abs(o)*Math.sqrt(1+n*n);else n=0;return n},M.exports=v},function(M,S,D){var v=function(){function n(a,u){for(var r=0;r<u.length;r++){var y=u[r];if(y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y)y.writable=!0;Object.defineProperty(a,y.key,y)}}return function(a,u,r){if(u)n(a.prototype,u);if(r)n(a,r);return a}}();function f(n,a){if(!(n instanceof a))throw TypeError("Cannot call a class as a function")}var o=function(){function n(a,u){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;f(this,n),this.sequence1=a,this.sequence2=u,this.match_score=r,this.mismatch_penalty=y,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=u.length+1,this.grid=Array(this.iMax);for(var e=0;e<this.iMax;e++){this.grid[e]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.grid[e][g]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.tracebackGrid[d][c]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return v(n,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var u=1;u<this.jMax;u++)this.grid[0][u]=this.grid[0][u-1]+this.gap_penalty,this.tracebackGrid[0][u]=[!1,!1,!0];for(var r=1;r<this.iMax;r++)this.grid[r][0]=this.grid[r-1][0]+this.gap_penalty,this.tracebackGrid[r][0]=[!1,!0,!1];for(var y=1;y<this.iMax;y++)for(var i=1;i<this.jMax;i++){var e=void 0;if(this.sequence1[y-1]===this.sequence2[i-1])e=this.grid[y-1][i-1]+this.match_score;else e=this.grid[y-1][i-1]+this.mismatch_penalty;var g=this.grid[y-1][i]+this.gap_penalty,d=this.grid[y][i-1]+this.gap_penalty,c=[e,g,d],x=this.arrayAllMaxIndexes(c);this.grid[y][i]=c[x[0]],this.tracebackGrid[y][i]=[x.includes(0),x.includes(1),x.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var u=[];u.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(u[0]){var r=u[0],y=this.tracebackGrid[r.pos[0]][r.pos[1]];if(y[0])u.push({pos:[r.pos[0]-1,r.pos[1]-1],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(y[1])u.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(y[2])u.push({pos:[r.pos[0],r.pos[1]-1],seq1:"-"+r.seq1,seq2:this.sequence2[r.pos[1]-1]+r.seq2});if(r.pos[0]===0&&r.pos[1]===0)this.alignments.push({sequence1:r.seq1,sequence2:r.seq2});u.shift()}return this.alignments}},{key:"getAllIndexes",value:function(u,r){var y=[],i=-1;while((i=u.indexOf(r,i+1))!==-1)y.push(i);return y}},{key:"arrayAllMaxIndexes",value:function(u){return this.getAllIndexes(u,Math.max.apply(null,u))}}]),n}();M.exports=o},function(M,S,D){var v=function(){return};v.FDLayout=D(18),v.FDLayoutConstants=D(4),v.FDLayoutEdge=D(19),v.FDLayoutNode=D(20),v.DimensionD=D(21),v.HashMap=D(22),v.HashSet=D(23),v.IGeometry=D(8),v.IMath=D(9),v.Integer=D(10),v.Point=D(12),v.PointD=D(5),v.RandomSeed=D(16),v.RectangleD=D(13),v.Transform=D(17),v.UniqueIDGeneretor=D(14),v.Quicksort=D(25),v.LinkedList=D(11),v.LGraphObject=D(2),v.LGraph=D(6),v.LEdge=D(1),v.LGraphManager=D(7),v.LNode=D(3),v.Layout=D(15),v.LayoutConstants=D(0),v.NeedlemanWunsch=D(27),v.Matrix=D(24),v.SVD=D(26),M.exports=v},function(M,S,D){function v(){this.listeners=[]}var f=v.prototype;f.addListener=function(o,n){this.listeners.push({event:o,callback:n})},f.removeListener=function(o,n){for(var a=this.listeners.length;a>=0;a--){var u=this.listeners[a];if(u.event===o&&u.callback===n)this.listeners.splice(a,1)}},f.emit=function(o,n){for(var a=0;a<this.listeners.length;a++){var u=this.listeners[a];if(o===u.event)u.callback(n)}},M.exports=v}])})});var Fe=_n(function(Ee,Se){(function(S,D){if(typeof Ee==="object"&&typeof Se==="object")Se.exports=D(Re());else if(typeof define==="function"&&define.amd)define(["layout-base"],D);else if(typeof Ee==="object")Ee.coseBase=D(Re());else S.coseBase=D(S.layoutBase)})(Ee,function(M){return(()=>{var S={45:(o,n,a)=>{var u={};u.layoutBase=a(551),u.CoSEConstants=a(806),u.CoSEEdge=a(767),u.CoSEGraph=a(880),u.CoSEGraphManager=a(578),u.CoSELayout=a(765),u.CoSENode=a(991),u.ConstraintHandler=a(902),o.exports=u},806:(o,n,a)=>{var u=a(551).FDLayoutConstants;function r(){}for(var y in u)r[y]=u[y];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r},767:(o,n,a)=>{var u=a(551).FDLayoutEdge;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},880:(o,n,a)=>{var u=a(551).LGraph;function r(i,e,g){u.call(this,i,e,g)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},578:(o,n,a)=>{var u=a(551).LGraphManager;function r(i){u.call(this,i)}r.prototype=Object.create(u.prototype);for(var y in u)r[y]=u[y];o.exports=r},765:(o,n,a)=>{var u=a(551).FDLayout,r=a(578),y=a(880),i=a(991),e=a(767),g=a(806),d=a(902),c=a(551).FDLayoutConstants,x=a(551).LayoutConstants,T=a(551).Point,N=a(551).PointD,O=a(551).DimensionD,W=a(551).Layout,I=a(551).Integer,B=a(551).IGeometry,_=a(551).LGraph,J=a(551).Transform,lt=a(551).LinkedList;function X(){u.call(this),this.toBeTiled={},this.constraints={}}X.prototype=Object.create(u.prototype);for(var tt in u)X[tt]=u[tt];X.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},X.prototype.newGraph=function(s){return new y(null,this.graphManager,s)},X.prototype.newNode=function(s){return new i(this.graphManager,s)},X.prototype.newEdge=function(s){return new e(null,null,s)},X.prototype.initParameters=function(){if(u.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(g.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=g.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=g.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},X.prototype.initSpringEmbedder=function(){u.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},X.prototype.layout=function(){var s=x.DEFAULT_CREATE_BENDS_AS_NEEDED;if(s)this.createBendpoints(),this.graphManager.resetAllEdges();return 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){var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var w=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(A){return w.has(A)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}else if(g.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var w=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(H){return w.has(H)});this.graphManager.setAllNodesToApplyGravitation(E)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),g.APPLY_LAYOUT)this.runSpringEmbedder();return!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%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(this.layoutQuality==1)this.coolingAdjuster=this.coolingCycle/3;this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),w=this.nodesWithGravity.filter(function(m){return s.has(m)});if(this.graphManager.setAllNodesToApplyGravitation(w),this.graphManager.updateBounds(),this.updateGrid(),g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(g.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var E=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(E,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},X.prototype.getPositionsData=function(){var s=this.graphManager.getAllNodes(),w={};for(var E=0;E<s.length;E++){var A=s[E].rect,m=s[E].id;w[m]={id:m,x:A.getCenterX(),y:A.getCenterY(),w:A.width,h:A.height}}return w},X.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(c.ANIMATE==="during")this.emit("layoutstarted");else{while(!s)s=this.tick();this.graphManager.updateBounds()}},X.prototype.moveNodes=function(){var s=this.getAllNodes(),w;for(var E=0;E<s.length;E++)w=s[E],w.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var E=0;E<s.length;E++)w=s[E],w.move()},X.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var w=this.graphManager.getAllNodes();for(var E=0;E<w.length;E++){var A=w[E];this.idToNodeMap.set(A.id,A)}var m=function F(j){var et=j.getChild().getNodes(),ct,Nt=0;for(var Pt=0;Pt<et.length;Pt++)if(ct=et[Pt],ct.getChild()==null){if(s.fixedNodeSet.has(ct.id))Nt+=100}else Nt+=F(ct);return Nt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(et){s.fixedNodeSet.add(et.nodeId)});var w=this.graphManager.getAllNodes(),A;for(var E=0;E<w.length;E++)if(A=w[E],A.getChild()!=null){var H=m(A);if(H>0)A.fixedNodeWeight=H}}if(this.constraints.relativePlacementConstraint){var b=new Map,Q=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(F){s.fixedNodesOnHorizontal.add(F),s.fixedNodesOnVertical.add(F)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var Z=this.constraints.alignmentConstraint.vertical;for(var E=0;E<Z.length;E++)this.dummyToNodeForVerticalAlignment.set("dummy"+E,[]),Z[E].forEach(function(j){if(b.set(j,"dummy"+E),s.dummyToNodeForVerticalAlignment.get("dummy"+E).push(j),s.fixedNodeSet.has(j))s.fixedNodesOnHorizontal.add("dummy"+E)})}if(this.constraints.alignmentConstraint.horizontal){var V=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<V.length;E++)this.dummyToNodeForHorizontalAlignment.set("dummy"+E,[]),V[E].forEach(function(j){if(Q.set(j,"dummy"+E),s.dummyToNodeForHorizontalAlignment.get("dummy"+E).push(j),s.fixedNodeSet.has(j))s.fixedNodesOnVertical.add("dummy"+E)})}}if(g.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(F){var j,et,ct;for(ct=F.length-1;ct>=2*F.length/3;ct--)j=Math.floor(Math.random()*(ct+1)),et=F[ct],F[ct]=F[j],F[j]=et;return F},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(F){if(F.left){var j=b.has(F.left)?b.get(F.left):F.left,et=b.has(F.right)?b.get(F.right):F.right;if(!s.nodesInRelativeHorizontal.includes(j))if(s.nodesInRelativeHorizontal.push(j),s.nodeToRelativeConstraintMapHorizontal.set(j,[]),s.dummyToNodeForVerticalAlignment.has(j))s.nodeToTempPositionMapHorizontal.set(j,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(j)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(j,s.idToNodeMap.get(j).getCenterX());if(!s.nodesInRelativeHorizontal.includes(et))if(s.nodesInRelativeHorizontal.push(et),s.nodeToRelativeConstraintMapHorizontal.set(et,[]),s.dummyToNodeForVerticalAlignment.has(et))s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(et)[0]).getCenterX());else s.nodeToTempPositionMapHorizontal.set(et,s.idToNodeMap.get(et).getCenterX());s.nodeToRelativeConstraintMapHorizontal.get(j).push({right:et,gap:F.gap}),s.nodeToRelativeConstraintMapHorizontal.get(et).push({left:j,gap:F.gap})}else{var ct=Q.has(F.top)?Q.get(F.top):F.top,Nt=Q.has(F.bottom)?Q.get(F.bottom):F.bottom;if(!s.nodesInRelativeVertical.includes(ct))if(s.nodesInRelativeVertical.push(ct),s.nodeToRelativeConstraintMapVertical.set(ct,[]),s.dummyToNodeForHorizontalAlignment.has(ct))s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(ct)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(ct,s.idToNodeMap.get(ct).getCenterY());if(!s.nodesInRelativeVertical.includes(Nt))if(s.nodesInRelativeVertical.push(Nt),s.nodeToRelativeConstraintMapVertical.set(Nt,[]),s.dummyToNodeForHorizontalAlignment.has(Nt))s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(Nt)[0]).getCenterY());else s.nodeToTempPositionMapVertical.set(Nt,s.idToNodeMap.get(Nt).getCenterY());s.nodeToRelativeConstraintMapVertical.get(ct).push({bottom:Nt,gap:F.gap}),s.nodeToRelativeConstraintMapVertical.get(Nt).push({top:ct,gap:F.gap})}});else{var st=new Map,dt=new Map;this.constraints.relativePlacementConstraint.forEach(function(F){if(F.left){var j=b.has(F.left)?b.get(F.left):F.left,et=b.has(F.right)?b.get(F.right):F.right;if(st.has(j))st.get(j).push(et);else st.set(j,[et]);if(st.has(et))st.get(et).push(j);else st.set(et,[j])}else{var ct=Q.has(F.top)?Q.get(F.top):F.top,Nt=Q.has(F.bottom)?Q.get(F.bottom):F.bottom;if(dt.has(ct))dt.get(ct).push(Nt);else dt.set(ct,[Nt]);if(dt.has(Nt))dt.get(Nt).push(ct);else dt.set(Nt,[ct])}});var k=function(j,et){var ct=[],Nt=[],Pt=new lt,Bt=new Set,ft=0;return j.forEach(function(Jt,Xt){if(!Bt.has(Xt)){ct[ft]=[],Nt[ft]=!1;var Et=Xt;Pt.push(Et),Bt.add(Et),ct[ft].push(Et);while(Pt.length!=0){if(Et=Pt.shift(),et.has(Et))Nt[ft]=!0;var vt=j.get(Et);vt.forEach(function(xt){if(!Bt.has(xt))Pt.push(xt),Bt.add(xt),ct[ft].push(xt)})}ft++}}),{components:ct,isFixed:Nt}},ut=k(st,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=ut.components,this.fixedComponentsOnHorizontal=ut.isFixed;var nt=k(dt,s.fixedNodesOnVertical);this.componentsOnVertical=nt.components,this.fixedComponentsOnVertical=nt.isFixed}}},X.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(nt){var F=s.idToNodeMap.get(nt.nodeId);F.displacementX=0,F.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var w=this.constraints.alignmentConstraint.vertical;for(var E=0;E<w.length;E++){var A=0;for(var m=0;m<w[E].length;m++){if(this.fixedNodeSet.has(w[E][m])){A=0;break}A+=this.idToNodeMap.get(w[E][m]).displacementX}var H=A/w[E].length;for(var m=0;m<w[E].length;m++)this.idToNodeMap.get(w[E][m]).displacementX=H}}if(this.constraints.alignmentConstraint.horizontal){var b=this.constraints.alignmentConstraint.horizontal;for(var E=0;E<b.length;E++){var Q=0;for(var m=0;m<b[E].length;m++){if(this.fixedNodeSet.has(b[E][m])){Q=0;break}Q+=this.idToNodeMap.get(b[E][m]).displacementY}var Z=Q/b[E].length;for(var m=0;m<b[E].length;m++)this.idToNodeMap.get(b[E][m]).displacementY=Z}}}if(this.constraints.relativePlacementConstraint)if(g.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var F=0;if(s.dummyToNodeForVerticalAlignment.has(nt))F=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(nt)[0]).displacementX;else F=s.idToNodeMap.get(nt).displacementX;if(s.nodeToRelativeConstraintMapHorizontal.get(nt).forEach(function(j){if(j.right){var et=s.nodeToTempPositionMapHorizontal.get(j.right)-s.nodeToTempPositionMapHorizontal.get(nt)-F;if(et<j.gap)F-=j.gap-et}else{var et=s.nodeToTempPositionMapHorizontal.get(nt)-s.nodeToTempPositionMapHorizontal.get(j.left)+F;if(et<j.gap)F+=j.gap-et}}),s.nodeToTempPositionMapHorizontal.set(nt,s.nodeToTempPositionMapHorizontal.get(nt)+F),s.dummyToNodeForVerticalAlignment.has(nt))s.dummyToNodeForVerticalAlignment.get(nt).forEach(function(j){s.idToNodeMap.get(j).displacementX=F});else s.idToNodeMap.get(nt).displacementX=F}}),this.nodesInRelativeVertical.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var F=0;if(s.dummyToNodeForHorizontalAlignment.has(nt))F=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(nt)[0]).displacementY;else F=s.idToNodeMap.get(nt).displacementY;if(s.nodeToRelativeConstraintMapVertical.get(nt).forEach(function(j){if(j.bottom){var et=s.nodeToTempPositionMapVertical.get(j.bottom)-s.nodeToTempPositionMapVertical.get(nt)-F;if(et<j.gap)F-=j.gap-et}else{var et=s.nodeToTempPositionMapVertical.get(nt)-s.nodeToTempPositionMapVertical.get(j.top)+F;if(et<j.gap)F+=j.gap-et}}),s.nodeToTempPositionMapVertical.set(nt,s.nodeToTempPositionMapVertical.get(nt)+F),s.dummyToNodeForHorizontalAlignment.has(nt))s.dummyToNodeForHorizontalAlignment.get(nt).forEach(function(j){s.idToNodeMap.get(j).displacementY=F});else s.idToNodeMap.get(nt).displacementY=F}})}else{for(var E=0;E<this.componentsOnHorizontal.length;E++){var V=this.componentsOnHorizontal[E];if(this.fixedComponentsOnHorizontal[E])for(var m=0;m<V.length;m++)if(this.dummyToNodeForVerticalAlignment.has(V[m]))this.dummyToNodeForVerticalAlignment.get(V[m]).forEach(function(j){s.idToNodeMap.get(j).displacementX=0});else this.idToNodeMap.get(V[m]).displacementX=0;else{var st=0,dt=0;for(var m=0;m<V.length;m++)if(this.dummyToNodeForVerticalAlignment.has(V[m])){var k=this.dummyToNodeForVerticalAlignment.get(V[m]);st+=k.length*this.idToNodeMap.get(k[0]).displacementX,dt+=k.length}else st+=this.idToNodeMap.get(V[m]).displacementX,dt++;var ut=st/dt;for(var m=0;m<V.length;m++)if(this.dummyToNodeForVerticalAlignment.has(V[m]))this.dummyToNodeForVerticalAlignment.get(V[m]).forEach(function(j){s.idToNodeMap.get(j).displacementX=ut});else this.idToNodeMap.get(V[m]).displacementX=ut}}for(var E=0;E<this.componentsOnVertical.length;E++){var V=this.componentsOnVertical[E];if(this.fixedComponentsOnVertical[E])for(var m=0;m<V.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(V[m]))this.dummyToNodeForHorizontalAlignment.get(V[m]).forEach(function(et){s.idToNodeMap.get(et).displacementY=0});else this.idToNodeMap.get(V[m]).displacementY=0;else{var st=0,dt=0;for(var m=0;m<V.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(V[m])){var k=this.dummyToNodeForHorizontalAlignment.get(V[m]);st+=k.length*this.idToNodeMap.get(k[0]).displacementY,dt+=k.length}else st+=this.idToNodeMap.get(V[m]).displacementY,dt++;var ut=st/dt;for(var m=0;m<V.length;m++)if(this.dummyToNodeForHorizontalAlignment.has(V[m]))this.dummyToNodeForHorizontalAlignment.get(V[m]).forEach(function(Pt){s.idToNodeMap.get(Pt).displacementY=ut});else this.idToNodeMap.get(V[m]).displacementY=ut}}}},X.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],w,E=this.graphManager.getGraphs(),A=E.length,m;for(m=0;m<A;m++)if(w=E[m],w.updateConnected(),!w.isConnected)s=s.concat(w.getNodes());return s},X.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var w=new Set,E;for(E=0;E<s.length;E++){var A=s[E];if(!w.has(A)){var m=A.getSource(),H=A.getTarget();if(m==H)A.getBendpoints().push(new N),A.getBendpoints().push(new N),this.createDummyNodesForBendpoints(A),w.add(A);else{var b=[];if(b=b.concat(m.getEdgeListToNode(H)),b=b.concat(H.getEdgeListToNode(m)),!w.has(b[0])){if(b.length>1){var Q;for(Q=0;Q<b.length;Q++){var Z=b[Q];Z.getBendpoints().push(new N),this.createDummyNodesForBendpoints(Z)}}b.forEach(function(V){w.add(V)})}}}if(w.size==s.length)break}},X.prototype.positionNodesRadially=function(s){var w=new T(0,0),E=Math.ceil(Math.sqrt(s.length)),A=0,m=0,H=0,b=new N(0,0);for(var Q=0;Q<s.length;Q++){if(Q%E==0){if(H=0,m=A,Q!=0)m+=g.DEFAULT_COMPONENT_SEPERATION;A=0}var Z=s[Q],V=W.findCenterOfTree(Z);if(w.x=H,w.y=m,b=X.radialLayout(Z,V,w),b.y>A)A=Math.floor(b.y);H=Math.floor(b.x+g.DEFAULT_COMPONENT_SEPERATION)}this.transform(new N(x.WORLD_CENTER_X-b.x/2,x.WORLD_CENTER_Y-b.y/2))},X.radialLayout=function(s,w,E){var A=Math.max(this.maxDiagonalInTree(s),g.DEFAULT_RADIAL_SEPARATION);X.branchRadialLayout(w,null,0,359,0,A);var m=_.calculateBounds(s),H=new J;H.setDeviceOrgX(m.getMinX()),H.setDeviceOrgY(m.getMinY()),H.setWorldOrgX(E.x),H.setWorldOrgY(E.y);for(var b=0;b<s.length;b++){var Q=s[b];Q.transform(H)}var Z=new N(m.getMaxX(),m.getMaxY());return H.inverseTransformPoint(Z)},X.branchRadialLayout=function(s,w,E,A,m,H){var b=(A-E+1)/2;if(b<0)b+=180;var Q=(b+E)%360,Z=Q*B.TWO_PI/360,V=Math.cos(Z),st=m*Math.cos(Z),dt=m*Math.sin(Z);s.setCenter(st,dt);var k=[];k=k.concat(s.getEdges());var ut=k.length;if(w!=null)ut--;var nt=0,F=k.length,j,et=s.getEdgesBetween(w);while(et.length>1){var ct=et[0];et.splice(0,1);var Nt=k.indexOf(ct);if(Nt>=0)k.splice(Nt,1);F--,ut--}if(w!=null)j=(k.indexOf(et[0])+1)%F;else j=0;var Pt=Math.abs(A-E)/ut;for(var Bt=j;nt!=ut;Bt=++Bt%F){var ft=k[Bt].getOtherEnd(s);if(ft==w)continue;var Jt=(E+nt*Pt)%360,Xt=(Jt+Pt)%360;X.branchRadialLayout(ft,s,Jt,Xt,m+H,H),nt++}},X.maxDiagonalInTree=function(s){var w=I.MIN_VALUE;for(var E=0;E<s.length;E++){var A=s[E],m=A.getDiagonal();if(m>w)w=m}return w},X.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},X.prototype.groupZeroDegreeMembers=function(){var s=this,w={};this.memberGroups={},this.idToDummyNode={};var E=[],A=this.graphManager.getAllNodes();for(var m=0;m<A.length;m++){var H=A[m],b=H.getParent();if(this.getNodeDegreeWithChildren(H)===0&&(b.id==null||!this.getToBeTiled(b)))E.push(H)}for(var m=0;m<E.length;m++){var H=E[m],Q=H.getParent().id;if(typeof w[Q]>"u")w[Q]=[];w[Q]=w[Q].concat(H)}Object.keys(w).forEach(function(Z){if(w[Z].length>1){var V="DummyCompound_"+Z;s.memberGroups[V]=w[Z];var st=w[Z][0].getParent(),dt=new i(s.graphManager);dt.id=V,dt.paddingLeft=st.paddingLeft||0,dt.paddingRight=st.paddingRight||0,dt.paddingBottom=st.paddingBottom||0,dt.paddingTop=st.paddingTop||0,s.idToDummyNode[V]=dt;var k=s.getGraphManager().add(s.newGraph(),dt),ut=st.getChild();ut.add(dt);for(var nt=0;nt<w[Z].length;nt++){var F=w[Z][nt];ut.remove(F),k.add(F)}}})},X.prototype.clearCompounds=function(){var s={},w={};this.performDFSOnCompounds();for(var E=0;E<this.compoundOrder.length;E++)w[this.compoundOrder[E].id]=this.compoundOrder[E],s[this.compoundOrder[E].id]=[].concat(this.compoundOrder[E].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[E].getChild()),this.compoundOrder[E].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,w)},X.prototype.clearZeroDegreeMembers=function(){var s=this,w=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(E){var A=s.idToDummyNode[E];if(w[E]=s.tileNodes(s.memberGroups[E],A.paddingLeft+A.paddingRight),A.rect.width=w[E].width,A.rect.height=w[E].height,A.setCenter(w[E].centerX,w[E].centerY),A.labelMarginLeft=0,A.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var m=A.rect.width,H=A.rect.height;if(A.labelWidth){if(A.labelPosHorizontal=="left")A.rect.x-=A.labelWidth,A.setWidth(m+A.labelWidth),A.labelMarginLeft=A.labelWidth;else if(A.labelPosHorizontal=="center"&&A.labelWidth>m)A.rect.x-=(A.labelWidth-m)/2,A.setWidth(A.labelWidth),A.labelMarginLeft=(A.labelWidth-m)/2;else if(A.labelPosHorizontal=="right")A.setWidth(m+A.labelWidth)}if(A.labelHeight){if(A.labelPosVertical=="top")A.rect.y-=A.labelHeight,A.setHeight(H+A.labelHeight),A.labelMarginTop=A.labelHeight;else if(A.labelPosVertical=="center"&&A.labelHeight>H)A.rect.y-=(A.labelHeight-H)/2,A.setHeight(A.labelHeight),A.labelMarginTop=(A.labelHeight-H)/2;else if(A.labelPosVertical=="bottom")A.setHeight(H+A.labelHeight)}}})},X.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var w=this.compoundOrder[s],{id:E,paddingLeft:A,paddingTop:m,labelMarginLeft:H,labelMarginTop:b}=w;this.adjustLocations(this.tiledMemberPack[E],w.rect.x,w.rect.y,A,m,H,b)}},X.prototype.repopulateZeroDegreeMembers=function(){var s=this,w=this.tiledZeroDegreePack;Object.keys(w).forEach(function(E){var A=s.idToDummyNode[E],{paddingLeft:m,paddingTop:H,labelMarginLeft:b,labelMarginTop:Q}=A;s.adjustLocations(w[E],A.rect.x,A.rect.y,m,H,b,Q)})},X.prototype.getToBeTiled=function(s){var w=s.id;if(this.toBeTiled[w]!=null)return this.toBeTiled[w];var E=s.getChild();if(E==null)return this.toBeTiled[w]=!1,!1;var A=E.getNodes();for(var m=0;m<A.length;m++){var H=A[m];if(this.getNodeDegree(H)>0)return this.toBeTiled[w]=!1,!1;if(H.getChild()==null){this.toBeTiled[H.id]=!1;continue}if(!this.getToBeTiled(H))return this.toBeTiled[w]=!1,!1}return this.toBeTiled[w]=!0,!0},X.prototype.getNodeDegree=function(s){var w=s.id,E=s.getEdges(),A=0;for(var m=0;m<E.length;m++){var H=E[m];if(H.getSource().id!==H.getTarget().id)A=A+1}return A},X.prototype.getNodeDegreeWithChildren=function(s){var w=this.getNodeDegree(s);if(s.getChild()==null)return w;var E=s.getChild().getNodes();for(var A=0;A<E.length;A++){var m=E[A];w+=this.getNodeDegreeWithChildren(m)}return w},X.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},X.prototype.fillCompexOrderByDFS=function(s){for(var w=0;w<s.length;w++){var E=s[w];if(E.getChild()!=null)this.fillCompexOrderByDFS(E.getChild().getNodes());if(this.getToBeTiled(E))this.compoundOrder.push(E)}},X.prototype.adjustLocations=function(s,w,E,A,m,H,b){w+=A+H,E+=m+b;var Q=w;for(var Z=0;Z<s.rows.length;Z++){var V=s.rows[Z];w=Q;var st=0;for(var dt=0;dt<V.length;dt++){var k=V[dt];if(k.rect.x=w,k.rect.y=E,w+=k.rect.width+s.horizontalPadding,k.rect.height>st)st=k.rect.height}E+=st+s.verticalPadding}},X.prototype.tileCompoundMembers=function(s,w){var E=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(A){var m=w[A];if(E.tiledMemberPack[A]=E.tileNodes(s[A],m.paddingLeft+m.paddingRight),m.rect.width=E.tiledMemberPack[A].width,m.rect.height=E.tiledMemberPack[A].height,m.setCenter(E.tiledMemberPack[A].centerX,E.tiledMemberPack[A].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,g.NODE_DIMENSIONS_INCLUDE_LABELS){var H=m.rect.width,b=m.rect.height;if(m.labelWidth){if(m.labelPosHorizontal=="left")m.rect.x-=m.labelWidth,m.setWidth(H+m.labelWidth),m.labelMarginLeft=m.labelWidth;else if(m.labelPosHorizontal=="center"&&m.labelWidth>H)m.rect.x-=(m.labelWidth-H)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-H)/2;else if(m.labelPosHorizontal=="right")m.setWidth(H+m.labelWidth)}if(m.labelHeight){if(m.labelPosVertical=="top")m.rect.y-=m.labelHeight,m.setHeight(b+m.labelHeight),m.labelMarginTop=m.labelHeight;else if(m.labelPosVertical=="center"&&m.labelHeight>b)m.rect.y-=(m.labelHeight-b)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-b)/2;else if(m.labelPosVertical=="bottom")m.setHeight(b+m.labelHeight)}}})},X.prototype.tileNodes=function(s,w){var E=this.tileNodesByFavoringDim(s,w,!0),A=this.tileNodesByFavoringDim(s,w,!1),m=this.getOrgRatio(E),H=this.getOrgRatio(A),b;if(H<m)b=A;else b=E;return b},X.prototype.getOrgRatio=function(s){var{width:w,height:E}=s,A=w/E;if(A<1)A=1/A;return A},X.prototype.calcIdealRowWidth=function(s,w){var{TILING_PADDING_VERTICAL:E,TILING_PADDING_HORIZONTAL:A}=g,m=s.length,H=0,b=0,Q=0;s.forEach(function(nt){if(H+=nt.getWidth(),b+=nt.getHeight(),nt.getWidth()>Q)Q=nt.getWidth()});var Z=H/m,V=b/m,st=Math.pow(E-A,2)+4*(Z+A)*(V+E)*m,dt=(A-E+Math.sqrt(st))/(2*(Z+A)),k;if(w){if(k=Math.ceil(dt),k==dt)k++}else k=Math.floor(dt);var ut=k*(Z+A)-A;if(Q>ut)ut=Q;return ut+=A*2,ut},X.prototype.tileNodesByFavoringDim=function(s,w,E){var{TILING_PADDING_VERTICAL:A,TILING_PADDING_HORIZONTAL:m,TILING_COMPARE_BY:H}=g,b={rows:[],rowWidth:[],rowHeight:[],width:0,height:w,verticalPadding:A,horizontalPadding:m,centerX:0,centerY:0};if(H)b.idealRowWidth=this.calcIdealRowWidth(s,E);var Q=function(F){return F.rect.width*F.rect.height},Z=function(F,j){return Q(j)-Q(F)};s.sort(function(nt,F){var j=Z;if(b.idealRowWidth)return j=H,j(nt.id,F.id);return j(nt,F)});var V=0,st=0;for(var dt=0;dt<s.length;dt++){var k=s[dt];V+=k.getCenterX(),st+=k.getCenterY()}b.centerX=V/s.length,b.centerY=st/s.length;for(var dt=0;dt<s.length;dt++){var k=s[dt];if(b.rows.length==0)this.insertNodeToRow(b,k,0,w);else if(this.canAddHorizontal(b,k.rect.width,k.rect.height)){var ut=b.rows.length-1;if(!b.idealRowWidth)ut=this.getShortestRowIndex(b);this.insertNodeToRow(b,k,ut,w)}else this.insertNodeToRow(b,k,b.rows.length,w);this.shiftToLastRow(b)}return b},X.prototype.insertNodeToRow=function(s,w,E,A){var m=A;if(E==s.rows.length){var H=[];s.rows.push(H),s.rowWidth.push(m),s.rowHeight.push(0)}var b=s.rowWidth[E]+w.rect.width;if(s.rows[E].length>0)b+=s.horizontalPadding;if(s.rowWidth[E]=b,s.width<b)s.width=b;var Q=w.rect.height;if(E>0)Q+=s.verticalPadding;var Z=0;if(Q>s.rowHeight[E])Z=s.rowHeight[E],s.rowHeight[E]=Q,Z=s.rowHeight[E]-Z;s.height+=Z,s.rows[E].push(w)},X.prototype.getShortestRowIndex=function(s){var w=-1,E=Number.MAX_VALUE;for(var A=0;A<s.rows.length;A++)if(s.rowWidth[A]<E)w=A,E=s.rowWidth[A];return w},X.prototype.getLongestRowIndex=function(s){var w=-1,E=Number.MIN_VALUE;for(var A=0;A<s.rows.length;A++)if(s.rowWidth[A]>E)w=A,E=s.rowWidth[A];return w},X.prototype.canAddHorizontal=function(s,w,E){if(s.idealRowWidth){var A=s.rows.length-1,m=s.rowWidth[A];return m+w+s.horizontalPadding<=s.idealRowWidth}var H=this.getShortestRowIndex(s);if(H<0)return!0;var b=s.rowWidth[H];if(b+s.horizontalPadding+w<=s.width)return!0;var Q=0;if(s.rowHeight[H]<E){if(H>0)Q=E+s.verticalPadding-s.rowHeight[H]}var Z;if(s.width-b>=w+s.horizontalPadding)Z=(s.height+Q)/(b+w+s.horizontalPadding);else Z=(s.height+Q)/s.width;Q=E+s.verticalPadding;var V;if(s.width<w)V=(s.height+Q)/w;else V=(s.height+Q)/s.width;if(V<1)V=1/V;if(Z<1)Z=1/Z;return Z<V},X.prototype.shiftToLastRow=function(s){var w=this.getLongestRowIndex(s),E=s.rowWidth.length-1,A=s.rows[w],m=A[A.length-1],H=m.width+s.horizontalPadding;if(s.width-s.rowWidth[E]>H&&w!=E){A.splice(-1,1),s.rows[E].push(m),s.rowWidth[w]=s.rowWidth[w]-H,s.rowWidth[E]=s.rowWidth[E]+H,s.width=s.rowWidth[instance.getLongestRowIndex(s)];var b=Number.MIN_VALUE;for(var Q=0;Q<A.length;Q++)if(A[Q].height>b)b=A[Q].height;if(w>0)b+=s.verticalPadding;var Z=s.rowHeight[w]+s.rowHeight[E];if(s.rowHeight[w]=b,s.rowHeight[E]<m.height+s.verticalPadding)s.rowHeight[E]=m.height+s.verticalPadding;var V=s.rowHeight[w]+s.rowHeight[E];s.height+=V-Z,this.shiftToLastRow(s)}},X.prototype.tilingPreLayout=function(){if(g.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},X.prototype.tilingPostLayout=function(){if(g.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},X.prototype.reduceTrees=function(){var s=[],w=!0,E;while(w){var A=this.graphManager.getAllNodes(),m=[];w=!1;for(var H=0;H<A.length;H++)if(E=A[H],E.getEdges().length==1&&!E.getEdges()[0].isInterGraph&&E.getChild()==null){if(g.PURE_INCREMENTAL){var b=E.getEdges()[0].getOtherEnd(E),Q=new O(E.getCenterX()-b.getCenterX(),E.getCenterY()-b.getCenterY());m.push([E,E.getEdges()[0],E.getOwner(),Q])}else m.push([E,E.getEdges()[0],E.getOwner()]);w=!0}if(w==!0){var Z=[];for(var V=0;V<m.length;V++)if(m[V][0].getEdges().length==1)Z.push(m[V]),m[V][0].getOwner().remove(m[V][0]);s.push(Z),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},X.prototype.growTree=function(s){var w=s.length,E=s[w-1],A;for(var m=0;m<E.length;m++)A=E[m],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},X.prototype.findPlaceforPrunedNode=function(s){var w,E,A=s[0];if(A==s[1].source)E=s[1].target;else E=s[1].source;if(g.PURE_INCREMENTAL)A.setCenter(E.getCenterX()+s[3].getWidth(),E.getCenterY()+s[3].getHeight());else{var m=E.startX,H=E.finishX,b=E.startY,Q=E.finishY,Z=0,V=0,st=0,dt=0,k=[Z,st,V,dt];if(b>0)for(var ut=m;ut<=H;ut++)k[0]+=this.grid[ut][b-1].length+this.grid[ut][b].length-1;if(H<this.grid.length-1)for(var ut=b;ut<=Q;ut++)k[1]+=this.grid[H+1][ut].length+this.grid[H][ut].length-1;if(Q<this.grid[0].length-1)for(var ut=m;ut<=H;ut++)k[2]+=this.grid[ut][Q+1].length+this.grid[ut][Q].length-1;if(m>0)for(var ut=b;ut<=Q;ut++)k[3]+=this.grid[m-1][ut].length+this.grid[m][ut].length-1;var nt=I.MAX_VALUE,F,j;for(var et=0;et<k.length;et++)if(k[et]<nt)nt=k[et],F=1,j=et;else if(k[et]==nt)F++;if(F==3&&nt==0){if(k[0]==0&&k[1]==0&&k[2]==0)w=1;else if(k[0]==0&&k[1]==0&&k[3]==0)w=0;else if(k[0]==0&&k[2]==0&&k[3]==0)w=3;else if(k[1]==0&&k[2]==0&&k[3]==0)w=2}else if(F==2&&nt==0){var ct=Math.floor(Math.random()*2);if(k[0]==0&&k[1]==0)if(ct==0)w=0;else w=1;else if(k[0]==0&&k[2]==0)if(ct==0)w=0;else w=2;else if(k[0]==0&&k[3]==0)if(ct==0)w=0;else w=3;else if(k[1]==0&&k[2]==0)if(ct==0)w=1;else w=2;else if(k[1]==0&&k[3]==0)if(ct==0)w=1;else w=3;else if(ct==0)w=2;else w=3}else if(F==4&&nt==0){var ct=Math.floor(Math.random()*4);w=ct}else w=j;if(w==0)A.setCenter(E.getCenterX(),E.getCenterY()-E.getHeight()/2-c.DEFAULT_EDGE_LENGTH-A.getHeight()/2);else if(w==1)A.setCenter(E.getCenterX()+E.getWidth()/2+c.DEFAULT_EDGE_LENGTH+A.getWidth()/2,E.getCenterY());else if(w==2)A.setCenter(E.getCenterX(),E.getCenterY()+E.getHeight()/2+c.DEFAULT_EDGE_LENGTH+A.getHeight()/2);else A.setCenter(E.getCenterX()-E.getWidth()/2-c.DEFAULT_EDGE_LENGTH-A.getWidth()/2,E.getCenterY())}},o.exports=X},991:(o,n,a)=>{var u=a(551).FDLayoutNode,r=a(551).IMath;function y(e,g,d,c){u.call(this,e,g,d,c)}y.prototype=Object.create(u.prototype);for(var i in u)y[i]=u[i];y.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement)this.displacementX=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementX);if(Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement)this.displacementY=e.coolingFactor*e.maxNodeDisplacement*r.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},y.prototype.propogateDisplacementToChildren=function(e,g){var d=this.getChild().getNodes(),c;for(var x=0;x<d.length;x++)if(c=d[x],c.getChild()==null)c.displacementX+=e,c.displacementY+=g;else c.propogateDisplacementToChildren(e,g)},y.prototype.move=function(){var e=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY);this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},y.prototype.setPred1=function(e){this.pred1=e},y.prototype.getPred1=function(){return pred1},y.prototype.getPred2=function(){return pred2},y.prototype.setNext=function(e){this.next=e},y.prototype.getNext=function(){return next},y.prototype.setProcessed=function(e){this.processed=e},y.prototype.isProcessed=function(){return processed},o.exports=y},902:(o,n,a)=>{function u(d){if(Array.isArray(d)){for(var c=0,x=Array(d.length);c<d.length;c++)x[c]=d[c];return x}else return Array.from(d)}var r=a(806),y=a(551).LinkedList,i=a(551).Matrix,e=a(551).SVD;function g(){}g.handleConstraints=function(d){var c={};c.fixedNodeConstraint=d.constraints.fixedNodeConstraint,c.alignmentConstraint=d.constraints.alignmentConstraint,c.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var x=new Map,T=new Map,N=[],O=[],W=d.getAllNodes(),I=0;for(var B=0;B<W.length;B++){var _=W[B];if(_.getChild()==null)T.set(_.id,I++),N.push(_.getCenterX()),O.push(_.getCenterY()),x.set(_.id,_)}if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(K){if(!K.gap&&K.gap!=0)if(K.left)K.gap=r.DEFAULT_EDGE_LENGTH+x.get(K.left).getWidth()/2+x.get(K.right).getWidth()/2;else K.gap=r.DEFAULT_EDGE_LENGTH+x.get(K.top).getHeight()/2+x.get(K.bottom).getHeight()/2});var J=function(rt,it){return{x:rt.x-it.x,y:rt.y-it.y}},lt=function(rt){var it=0,at=0;return rt.forEach(function(ot){it+=N[T.get(ot)],at+=O[T.get(ot)]}),{x:it/rt.size,y:at/rt.size}},X=function(rt,it,at,ot,gt){function At(Tt,yt){var Dt=new Set(Tt),mt=!0,wt=!1,Zt=void 0;try{for(var Vt=yt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt.add(Wt)}}catch(bt){wt=!0,Zt=bt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}return Dt}var Mt=new Map;rt.forEach(function(Tt,yt){Mt.set(yt,0)}),rt.forEach(function(Tt,yt){Tt.forEach(function(Dt){Mt.set(Dt.id,Mt.get(Dt.id)+1)})});var ht=new Map,Lt=new Map,Ct=new y;if(Mt.forEach(function(Tt,yt){if(Tt==0){if(Ct.push(yt),!at)if(it=="horizontal")ht.set(yt,T.has(yt)?N[T.get(yt)]:ot.get(yt));else ht.set(yt,T.has(yt)?O[T.get(yt)]:ot.get(yt))}else ht.set(yt,Number.NEGATIVE_INFINITY);if(at)Lt.set(yt,new Set([yt]))}),at)gt.forEach(function(Tt){var yt=[];if(Tt.forEach(function(wt){if(at.has(wt))yt.push(wt)}),yt.length>0){var Dt=0;yt.forEach(function(wt){if(it=="horizontal")ht.set(wt,T.has(wt)?N[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt);else ht.set(wt,T.has(wt)?O[T.get(wt)]:ot.get(wt)),Dt+=ht.get(wt)}),Dt=Dt/yt.length,Tt.forEach(function(wt){if(!at.has(wt))ht.set(wt,Dt)})}else{var mt=0;Tt.forEach(function(wt){if(it=="horizontal")mt+=T.has(wt)?N[T.get(wt)]:ot.get(wt);else mt+=T.has(wt)?O[T.get(wt)]:ot.get(wt)}),mt=mt/Tt.length,Tt.forEach(function(wt){ht.set(wt,mt)})}});var pt=function(){var yt=Ct.shift(),Dt=rt.get(yt);Dt.forEach(function(mt){if(ht.get(mt.id)<ht.get(yt)+mt.gap)if(at&&at.has(mt.id)){var wt=void 0;if(it=="horizontal")wt=T.has(mt.id)?N[T.get(mt.id)]:ot.get(mt.id);else wt=T.has(mt.id)?O[T.get(mt.id)]:ot.get(mt.id);if(ht.set(mt.id,wt),wt<ht.get(yt)+mt.gap){var Zt=ht.get(yt)+mt.gap-wt;Lt.get(yt).forEach(function(Vt){ht.set(Vt,ht.get(Vt)-Zt)})}}else ht.set(mt.id,ht.get(yt)+mt.gap);if(Mt.set(mt.id,Mt.get(mt.id)-1),Mt.get(mt.id)==0)Ct.push(mt.id);if(at)Lt.set(mt.id,At(Lt.get(yt),Lt.get(mt.id)))})};while(Ct.length!=0)pt();if(at){var Ot=new Set;rt.forEach(function(Tt,yt){if(Tt.length==0)Ot.add(yt)});var Ut=[];Lt.forEach(function(Tt,yt){if(Ot.has(yt)){var Dt=!1,mt=!0,wt=!1,Zt=void 0;try{for(var Vt=Tt[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;if(at.has(Wt))Dt=!0}}catch($t){wt=!0,Zt=$t}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}if(!Dt){var bt=!1,oe=void 0;if(Ut.forEach(function($t,jt){if($t.has([].concat(u(Tt))[0]))bt=!0,oe=jt}),!bt)Ut.push(new Set(Tt));else Tt.forEach(function($t){Ut[oe].add($t)})}}}),Ut.forEach(function(Tt,yt){var{POSITIVE_INFINITY:Dt,POSITIVE_INFINITY:mt,NEGATIVE_INFINITY:wt,NEGATIVE_INFINITY:Zt}=Number,Vt=!0,re=!1,Wt=void 0;try{for(var bt=Tt[Symbol.iterator](),oe;!(Vt=(oe=bt.next()).done);Vt=!0){var $t=oe.value,jt=void 0;if(it=="horizontal")jt=T.has($t)?N[T.get($t)]:ot.get($t);else jt=T.has($t)?O[T.get($t)]:ot.get($t);var ne=ht.get($t);if(jt<Dt)Dt=jt;if(jt>wt)wt=jt;if(ne<mt)mt=ne;if(ne>Zt)Zt=ne}}catch(ve){re=!0,Wt=ve}finally{try{if(!Vt&&bt.return)bt.return()}finally{if(re)throw Wt}}var Ce=(Dt+wt)/2-(mt+Zt)/2,le=!0,ce=!1,ge=void 0;try{for(var fe=Tt[Symbol.iterator](),we;!(le=(we=fe.next()).done);le=!0){var ue=we.value;ht.set(ue,ht.get(ue)+Ce)}}catch(ve){ce=!0,ge=ve}finally{try{if(!le&&fe.return)fe.return()}finally{if(ce)throw ge}}})}return ht},tt=function(rt){var it=0,at=0,ot=0,gt=0;if(rt.forEach(function(Lt){if(Lt.left)N[T.get(Lt.left)]-N[T.get(Lt.right)]>=0?it++:at++;else O[T.get(Lt.top)]-O[T.get(Lt.bottom)]>=0?ot++:gt++}),it>at&&ot>gt)for(var At=0;At<T.size;At++)N[At]=-1*N[At],O[At]=-1*O[At];else if(it>at)for(var Mt=0;Mt<T.size;Mt++)N[Mt]=-1*N[Mt];else if(ot>gt)for(var ht=0;ht<T.size;ht++)O[ht]=-1*O[ht]},s=function(rt){var it=[],at=new y,ot=new Set,gt=0;return rt.forEach(function(At,Mt){if(!ot.has(Mt)){it[gt]=[];var ht=Mt;at.push(ht),ot.add(ht),it[gt].push(ht);while(at.length!=0){ht=at.shift();var Lt=rt.get(ht);Lt.forEach(function(Ct){if(!ot.has(Ct.id))at.push(Ct.id),ot.add(Ct.id),it[gt].push(Ct.id)})}gt++}}),it},w=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(ot).push(gt),it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},E=function(rt){var it=new Map;return rt.forEach(function(at,ot){it.set(ot,[])}),rt.forEach(function(at,ot){at.forEach(function(gt){it.get(gt.id).push({id:ot,gap:gt.gap,direction:gt.direction})})}),it},A=[],m=[],H=!1,b=!1,Q=new Set,Z=new Map,V=new Map,st=[];if(c.fixedNodeConstraint)c.fixedNodeConstraint.forEach(function(K){Q.add(K.nodeId)});if(c.relativePlacementConstraint)c.relativePlacementConstraint.forEach(function(K){if(K.left){if(Z.has(K.left))Z.get(K.left).push({id:K.right,gap:K.gap,direction:"horizontal"});else Z.set(K.left,[{id:K.right,gap:K.gap,direction:"horizontal"}]);if(!Z.has(K.right))Z.set(K.right,[])}else{if(Z.has(K.top))Z.get(K.top).push({id:K.bottom,gap:K.gap,direction:"vertical"});else Z.set(K.top,[{id:K.bottom,gap:K.gap,direction:"vertical"}]);if(!Z.has(K.bottom))Z.set(K.bottom,[])}}),V=w(Z),st=s(V);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>1)c.fixedNodeConstraint.forEach(function(K,rt){A[rt]=[K.position.x,K.position.y],m[rt]=[N[T.get(K.nodeId)],O[T.get(K.nodeId)]]}),H=!0;else if(c.alignmentConstraint)(function(){var K=0;if(c.alignmentConstraint.vertical){var rt=c.alignmentConstraint.vertical,it=function(ht){var Lt=new Set;rt[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return Q.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).x;rt[ht].forEach(function(Ot){A[K]=[pt,O[T.get(Ot)]],m[K]=[N[T.get(Ot)],O[T.get(Ot)]],K++})};for(var at=0;at<rt.length;at++)it(at);H=!0}if(c.alignmentConstraint.horizontal){var ot=c.alignmentConstraint.horizontal,gt=function(ht){var Lt=new Set;ot[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(u(Lt)).filter(function(Ot){return Q.has(Ot)})),pt=void 0;if(Ct.size>0)pt=N[T.get(Ct.values().next().value)];else pt=lt(Lt).y;ot[ht].forEach(function(Ot){A[K]=[N[T.get(Ot)],pt],m[K]=[N[T.get(Ot)],O[T.get(Ot)]],K++})};for(var At=0;At<ot.length;At++)gt(At);H=!0}if(c.relativePlacementConstraint)b=!0})();else if(c.relativePlacementConstraint){var dt=0,k=0;for(var ut=0;ut<st.length;ut++)if(st[ut].length>dt)dt=st[ut].length,k=ut;if(dt<V.size/2)tt(c.relativePlacementConstraint),H=!1,b=!1;else{var nt=new Map,F=new Map,j=[];st[k].forEach(function(K){Z.get(K).forEach(function(rt){if(rt.direction=="horizontal"){if(nt.has(K))nt.get(K).push(rt);else nt.set(K,[rt]);if(!nt.has(rt.id))nt.set(rt.id,[]);j.push({left:K,right:rt.id})}else{if(F.has(K))F.get(K).push(rt);else F.set(K,[rt]);if(!F.has(rt.id))F.set(rt.id,[]);j.push({top:K,bottom:rt.id})}})}),tt(j),b=!1;var et=X(nt,"horizontal"),ct=X(F,"vertical");st[k].forEach(function(K,rt){if(m[rt]=[N[T.get(K)],O[T.get(K)]],A[rt]=[],et.has(K))A[rt][0]=et.get(K);else A[rt][0]=N[T.get(K)];if(ct.has(K))A[rt][1]=ct.get(K);else A[rt][1]=O[T.get(K)]}),H=!0}}if(H){var Nt=void 0,Pt=i.transpose(A),Bt=i.transpose(m);for(var ft=0;ft<Pt.length;ft++)Pt[ft]=i.multGamma(Pt[ft]),Bt[ft]=i.multGamma(Bt[ft]);var Jt=i.multMat(Pt,i.transpose(Bt)),Xt=e.svd(Jt);Nt=i.multMat(Xt.V,i.transpose(Xt.U));for(var Et=0;Et<T.size;Et++){var vt=[N[Et],O[Et]],xt=[Nt[0][0],Nt[1][0]],Rt=[Nt[0][1],Nt[1][1]];N[Et]=i.dotProduct(vt,xt),O[Et]=i.dotProduct(vt,Rt)}if(b)tt(c.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(c.fixedNodeConstraint&&c.fixedNodeConstraint.length>0){var Gt={x:0,y:0};c.fixedNodeConstraint.forEach(function(K,rt){var it={x:N[T.get(K.nodeId)],y:O[T.get(K.nodeId)]},at=K.position,ot=J(at,it);Gt.x+=ot.x,Gt.y+=ot.y}),Gt.x/=c.fixedNodeConstraint.length,Gt.y/=c.fixedNodeConstraint.length,N.forEach(function(K,rt){N[rt]+=Gt.x}),O.forEach(function(K,rt){O[rt]+=Gt.y}),c.fixedNodeConstraint.forEach(function(K){N[T.get(K.nodeId)]=K.position.x,O[T.get(K.nodeId)]=K.position.y})}if(c.alignmentConstraint){if(c.alignmentConstraint.vertical){var St=c.alignmentConstraint.vertical,Ft=function(rt){var it=new Set;St[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return Q.has(gt)})),ot=void 0;if(at.size>0)ot=N[T.get(at.values().next().value)];else ot=lt(it).x;it.forEach(function(gt){if(!Q.has(gt))N[T.get(gt)]=ot})};for(var Ht=0;Ht<St.length;Ht++)Ft(Ht)}if(c.alignmentConstraint.horizontal){var zt=c.alignmentConstraint.horizontal,te=function(rt){var it=new Set;zt[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(u(it)).filter(function(gt){return Q.has(gt)})),ot=void 0;if(at.size>0)ot=O[T.get(at.values().next().value)];else ot=lt(it).y;it.forEach(function(gt){if(!Q.has(gt))O[T.get(gt)]=ot})};for(var qt=0;qt<zt.length;qt++)te(qt)}}if(c.relativePlacementConstraint)(function(){var K=new Map,rt=new Map,it=new Map,at=new Map,ot=new Map,gt=new Map,At=new Set,Mt=new Set;if(Q.forEach(function(Qt){At.add(Qt),Mt.add(Qt)}),c.alignmentConstraint){if(c.alignmentConstraint.vertical){var ht=c.alignmentConstraint.vertical,Lt=function(It){it.set("dummy"+It,[]),ht[It].forEach(function(Yt){if(K.set(Yt,"dummy"+It),it.get("dummy"+It).push(Yt),Q.has(Yt))At.add("dummy"+It)}),ot.set("dummy"+It,N[T.get(ht[It][0])])};for(var Ct=0;Ct<ht.length;Ct++)Lt(Ct)}if(c.alignmentConstraint.horizontal){var pt=c.alignmentConstraint.horizontal,Ot=function(It){at.set("dummy"+It,[]),pt[It].forEach(function(Yt){if(rt.set(Yt,"dummy"+It),at.get("dummy"+It).push(Yt),Q.has(Yt))Mt.add("dummy"+It)}),gt.set("dummy"+It,O[T.get(pt[It][0])])};for(var Ut=0;Ut<pt.length;Ut++)Ot(Ut)}}var Tt=new Map,yt=new Map,Dt=function(It){Z.get(It).forEach(function(Yt){var se=void 0,ae=void 0;if(Yt.direction=="horizontal"){if(se=K.get(It)?K.get(It):It,K.get(Yt.id))ae={id:K.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ae=Yt;if(Tt.has(se))Tt.get(se).push(ae);else Tt.set(se,[ae]);if(!Tt.has(ae.id))Tt.set(ae.id,[])}else{if(se=rt.get(It)?rt.get(It):It,rt.get(Yt.id))ae={id:rt.get(Yt.id),gap:Yt.gap,direction:Yt.direction};else ae=Yt;if(yt.has(se))yt.get(se).push(ae);else yt.set(se,[ae]);if(!yt.has(ae.id))yt.set(ae.id,[])}})},mt=!0,wt=!1,Zt=void 0;try{for(var Vt=Z.keys()[Symbol.iterator](),re;!(mt=(re=Vt.next()).done);mt=!0){var Wt=re.value;Dt(Wt)}}catch(Qt){wt=!0,Zt=Qt}finally{try{if(!mt&&Vt.return)Vt.return()}finally{if(wt)throw Zt}}var bt=w(Tt),oe=w(yt),$t=s(bt),jt=s(oe),ne=E(Tt),Ce=E(yt),le=[],ce=[];$t.forEach(function(Qt,It){le[It]=[],Qt.forEach(function(Yt){if(ne.get(Yt).length==0)le[It].push(Yt)})}),jt.forEach(function(Qt,It){ce[It]=[],Qt.forEach(function(Yt){if(Ce.get(Yt).length==0)ce[It].push(Yt)})});var ge=X(Tt,"horizontal",At,ot,le),fe=X(yt,"vertical",Mt,gt,ce),we=function(It){if(it.get(It))it.get(It).forEach(function(Yt){N[T.get(Yt)]=ge.get(It)});else N[T.get(It)]=ge.get(It)},ue=!0,ve=!1,Xe=void 0;try{for(var Ae=ge.keys()[Symbol.iterator](),He;!(ue=(He=Ae.next()).done);ue=!0){var De=He.value;we(De)}}catch(Qt){ve=!0,Xe=Qt}finally{try{if(!ue&&Ae.return)Ae.return()}finally{if(ve)throw Xe}}var sr=function(It){if(at.get(It))at.get(It).forEach(function(Yt){O[T.get(Yt)]=fe.get(It)});else O[T.get(It)]=fe.get(It)},Oe=!0,We=!1,Ve=void 0;try{for(var xe=fe.keys()[Symbol.iterator](),ze;!(Oe=(ze=xe.next()).done);Oe=!0){var De=ze.value;sr(De)}}catch(Qt){We=!0,Ve=Qt}finally{try{if(!Oe&&xe.return)xe.return()}finally{if(We)throw Ve}}})()}for(var Kt=0;Kt<W.length;Kt++){var kt=W[Kt];if(kt.getChild()==null)kt.setCenter(N[T.get(kt.id)],O[T.get(kt.id)])}},o.exports=g},551:(o)=>{o.exports=M}},D={};function v(o){var n=D[o];if(n!==void 0)return n.exports;var a=D[o]={exports:{}};return S[o](a,a.exports,v),a.exports}var f=v(45);return f})()})});var $e=_n(function(Te,Pe){(function(S,D){if(typeof Te==="object"&&typeof Pe==="object")Pe.exports=D(Fe());else if(typeof define==="function"&&define.amd)define(["cose-base"],D);else if(typeof Te==="object")Te.cytoscapeFcose=D(Fe());else S.cytoscapeFcose=D(S.coseBase)})(Te,function(M){return(()=>{var S={658:(o)=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(n){for(var a=arguments.length,u=Array(a>1?a-1:0),r=1;r<a;r++)u[r-1]=arguments[r];return u.forEach(function(y){Object.keys(y).forEach(function(i){return n[i]=y[i]})}),n}},548:(o,n,a)=>{var u=function(){function i(e,g){var d=[],c=!0,x=!1,T=void 0;try{for(var N=e[Symbol.iterator](),O;!(c=(O=N.next()).done);c=!0)if(d.push(O.value),g&&d.length===g)break}catch(W){x=!0,T=W}finally{try{if(!c&&N.return)N.return()}finally{if(x)throw T}}return d}return function(e,g){if(Array.isArray(e))return e;else if(Symbol.iterator in Object(e))return i(e,g);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(i){var e={};for(var g=0;g<i.length;g++)e[i[g].id()]=!0;var d=i.filter(function(c,x){if(typeof c==="number")c=x;var T=c.parent()[0];while(T!=null){if(e[T.id()])return!1;T=T.parent()[0]}return!0});return d},y.connectComponents=function(i,e,g,d){var c=new r,x=new Set,T=[],N=void 0,O=void 0,W=void 0,I=!1,B=1,_=[],J=[],lt=function(){var tt=i.collection();J.push(tt);var s=g[0],w=i.collection();w.merge(s).merge(s.descendants().intersection(e)),T.push(s),w.forEach(function(m){c.push(m),x.add(m),tt.merge(m)});var E=function(){s=c.shift();var H=i.collection();s.neighborhood().nodes().forEach(function(V){if(e.intersection(s.edgesWith(V)).length>0)H.merge(V)});for(var b=0;b<H.length;b++){var Q=H[b];if(N=g.intersection(Q.union(Q.ancestors())),N!=null&&!x.has(N[0])){var Z=N.union(N.descendants());Z.forEach(function(V){if(c.push(V),x.add(V),tt.merge(V),g.has(V))T.push(V)})}}};while(c.length!=0)E();if(tt.forEach(function(m){e.intersection(m.connectedEdges()).forEach(function(H){if(tt.has(H.source())&&tt.has(H.target()))tt.merge(H)})}),T.length==g.length)I=!0;if(!I||I&&B>1){O=T[0],W=O.connectedEdges().length,T.forEach(function(m){if(m.connectedEdges().length<W)W=m.connectedEdges().length,O=m}),_.push(O.id());var A=i.collection();A.merge(T[0]),T.forEach(function(m){A.merge(m)}),T=[],g=g.difference(A),B++}};do lt();while(!I);if(d){if(_.length>0)d.set("dummy"+(d.size+1),_)}return J},y.relocateComponent=function(i,e,g){if(!g.fixedNodeConstraint){var{POSITIVE_INFINITY:d,NEGATIVE_INFINITY:c,POSITIVE_INFINITY:x,NEGATIVE_INFINITY:T}=Number;if(g.quality=="draft"){var N=!0,O=!1,W=void 0;try{for(var I=e.nodeIndexes[Symbol.iterator](),B;!(N=(B=I.next()).done);N=!0){var _=B.value,J=u(_,2),lt=J[0],X=J[1],tt=g.cy.getElementById(lt);if(tt){var s=tt.boundingBox(),w=e.xCoords[X]-s.w/2,E=e.xCoords[X]+s.w/2,A=e.yCoords[X]-s.h/2,m=e.yCoords[X]+s.h/2;if(w<d)d=w;if(E>c)c=E;if(A<x)x=A;if(m>T)T=m}}}catch(V){O=!0,W=V}finally{try{if(!N&&I.return)I.return()}finally{if(O)throw W}}var H=i.x-(c+d)/2,b=i.y-(T+x)/2;e.xCoords=e.xCoords.map(function(V){return V+H}),e.yCoords=e.yCoords.map(function(V){return V+b})}else{Object.keys(e).forEach(function(V){var st=e[V],dt=st.getRect().x,k=st.getRect().x+st.getRect().width,ut=st.getRect().y,nt=st.getRect().y+st.getRect().height;if(dt<d)d=dt;if(k>c)c=k;if(ut<x)x=ut;if(nt>T)T=nt});var Q=i.x-(c+d)/2,Z=i.y-(T+x)/2;Object.keys(e).forEach(function(V){var st=e[V];st.setCenter(st.getCenterX()+Q,st.getCenterY()+Z)})}}},y.calcBoundingBox=function(i,e,g,d){var{MAX_SAFE_INTEGER:c,MIN_SAFE_INTEGER:x,MAX_SAFE_INTEGER:T,MIN_SAFE_INTEGER:N}=Number,O=void 0,W=void 0,I=void 0,B=void 0,_=i.descendants().not(":parent"),J=_.length;for(var lt=0;lt<J;lt++){var X=_[lt];if(O=e[d.get(X.id())]-X.width()/2,W=e[d.get(X.id())]+X.width()/2,I=g[d.get(X.id())]-X.height()/2,B=g[d.get(X.id())]+X.height()/2,c>O)c=O;if(x<W)x=W;if(T>I)T=I;if(N<B)N=B}var tt={};return tt.topLeftX=c,tt.topLeftY=T,tt.width=x-c,tt.height=N-T,tt},y.calcParentsWithoutChildren=function(i,e){var g=i.collection();return e.nodes(":parent").forEach(function(d){var c=!1;if(d.children().forEach(function(x){if(x.css("display")!="none")c=!0}),!c)g.merge(d)}),g},o.exports=y},816:(o,n,a)=>{var u=a(548),r=a(140).CoSELayout,y=a(140).CoSENode,i=a(140).layoutBase.PointD,e=a(140).layoutBase.DimensionD,g=a(140).layoutBase.LayoutConstants,d=a(140).layoutBase.FDLayoutConstants,c=a(140).CoSEConstants,x=function(N,O){var{cy:W,eles:I}=N,B=I.nodes(),_=I.edges(),J=void 0,lt=void 0,X=void 0,tt={};if(N.randomize)J=O.nodeIndexes,lt=O.xCoords,X=O.yCoords;var s=function(V){return typeof V==="function"},w=function(V,st){if(s(V))return V(st);else return V},E=u.calcParentsWithoutChildren(W,I),A=function Z(V,st,dt,k){var ut=st.length;for(var nt=0;nt<ut;nt++){var F=st[nt],j=null;if(F.intersection(E).length==0)j=F.children();var et=void 0,ct=F.layoutDimensions({nodeDimensionsIncludeLabels:k.nodeDimensionsIncludeLabels});if(F.outerWidth()!=null&&F.outerHeight()!=null)if(k.randomize)if(!F.isParent())et=V.add(new y(dt.graphManager,new i(lt[J.get(F.id())]-ct.w/2,X[J.get(F.id())]-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else{var Nt=u.calcBoundingBox(F,lt,X,J);if(F.intersection(E).length==0)et=V.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(Nt.width,Nt.height)));else et=V.add(new y(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(parseFloat(ct.w),parseFloat(ct.h))))}else et=V.add(new y(dt.graphManager,new i(F.position("x")-ct.w/2,F.position("y")-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else et=V.add(new y(this.graphManager));if(et.id=F.data("id"),et.nodeRepulsion=w(k.nodeRepulsion,F),et.paddingLeft=parseInt(F.css("padding")),et.paddingTop=parseInt(F.css("padding")),et.paddingRight=parseInt(F.css("padding")),et.paddingBottom=parseInt(F.css("padding")),k.nodeDimensionsIncludeLabels)et.labelWidth=F.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,et.labelHeight=F.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,et.labelPosVertical=F.css("text-valign"),et.labelPosHorizontal=F.css("text-halign");if(tt[F.data("id")]=et,isNaN(et.rect.x))et.rect.x=0;if(isNaN(et.rect.y))et.rect.y=0;if(j!=null&&j.length>0){var Pt=void 0;Pt=dt.getGraphManager().add(dt.newGraph(),et),Z(Pt,j,dt,k)}}},m=function(V,st,dt){var k=0,ut=0;for(var nt=0;nt<dt.length;nt++){var F=dt[nt],j=tt[F.data("source")],et=tt[F.data("target")];if(j&&et&&j!==et&&j.getEdgesBetween(et).length==0){var ct=st.add(V.newEdge(),j,et);ct.id=F.id(),ct.idealLength=w(N.idealEdgeLength,F),ct.edgeElasticity=w(N.edgeElasticity,F),k+=ct.idealLength,ut++}}if(N.idealEdgeLength!=null){if(ut>0)c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=k/ut;else if(!s(N.idealEdgeLength))c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=N.idealEdgeLength;else c.DEFAULT_EDGE_LENGTH=d.DEFAULT_EDGE_LENGTH=50;c.MIN_REPULSION_DIST=d.MIN_REPULSION_DIST=d.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH}},H=function(V,st){if(st.fixedNodeConstraint)V.constraints.fixedNodeConstraint=st.fixedNodeConstraint;if(st.alignmentConstraint)V.constraints.alignmentConstraint=st.alignmentConstraint;if(st.relativePlacementConstraint)V.constraints.relativePlacementConstraint=st.relativePlacementConstraint};if(N.nestingFactor!=null)c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=N.nestingFactor;if(N.gravity!=null)c.DEFAULT_GRAVITY_STRENGTH=d.DEFAULT_GRAVITY_STRENGTH=N.gravity;if(N.numIter!=null)c.MAX_ITERATIONS=d.MAX_ITERATIONS=N.numIter;if(N.gravityRange!=null)c.DEFAULT_GRAVITY_RANGE_FACTOR=d.DEFAULT_GRAVITY_RANGE_FACTOR=N.gravityRange;if(N.gravityCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=N.gravityCompound;if(N.gravityRangeCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=N.gravityRangeCompound;if(N.initialEnergyOnIncremental!=null)c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.DEFAULT_COOLING_FACTOR_INCREMENTAL=N.initialEnergyOnIncremental;if(N.tilingCompareBy!=null)c.TILING_COMPARE_BY=N.tilingCompareBy;if(N.quality=="proof")g.QUALITY=2;else g.QUALITY=0;if(c.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=N.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!N.randomize,c.ANIMATE=d.ANIMATE=g.ANIMATE=N.animate,c.TILE=N.tile,c.TILING_PADDING_VERTICAL=typeof N.tilingPaddingVertical==="function"?N.tilingPaddingVertical.call():N.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL=typeof N.tilingPaddingHorizontal==="function"?N.tilingPaddingHorizontal.call():N.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!N.randomize,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=N.uniformNodeDimensions,N.step=="transformed")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1;if(N.step=="enforced")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1;if(N.step=="cose")c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0;if(N.step=="all"){if(N.randomize)c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0}if(N.fixedNodeConstraint||N.alignmentConstraint||N.relativePlacementConstraint)c.TREE_REDUCTION_ON_INCREMENTAL=!1;else c.TREE_REDUCTION_ON_INCREMENTAL=!0;var b=new r,Q=b.newGraphManager();return A(Q.addRoot(),u.getTopMostNodes(B),b,N),m(b,Q,_),H(b,N),b.runLayout(),tt};o.exports={coseLayout:x}},212:(o,n,a)=>{var u=function(){function N(O,W){for(var I=0;I<W.length;I++){var B=W[I];if(B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B)B.writable=!0;Object.defineProperty(O,B.key,B)}}return function(O,W,I){if(W)N(O.prototype,W);if(I)N(O,I);return O}}();function r(N,O){if(!(N instanceof O))throw TypeError("Cannot call a class as a function")}var y=a(658),i=a(548),e=a(657),g=e.spectralLayout,d=a(816),c=d.coseLayout,x=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(O){return 4500},idealEdgeLength:function(O){return 50},edgeElasticity:function(O){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),T=function(){function N(O){r(this,N),this.options=y({},x,O)}return u(N,[{key:"run",value:function(){var W=this,I=this.options,{cy:B,eles:_}=I,J=[],lt=void 0,X=void 0,tt=[],s=void 0,w=[];if(I.fixedNodeConstraint&&(!Array.isArray(I.fixedNodeConstraint)||I.fixedNodeConstraint.length==0))I.fixedNodeConstraint=void 0;if(I.alignmentConstraint){if(I.alignmentConstraint.vertical&&(!Array.isArray(I.alignmentConstraint.vertical)||I.alignmentConstraint.vertical.length==0))I.alignmentConstraint.vertical=void 0;if(I.alignmentConstraint.horizontal&&(!Array.isArray(I.alignmentConstraint.horizontal)||I.alignmentConstraint.horizontal.length==0))I.alignmentConstraint.horizontal=void 0}if(I.relativePlacementConstraint&&(!Array.isArray(I.relativePlacementConstraint)||I.relativePlacementConstraint.length==0))I.relativePlacementConstraint=void 0;var E=I.fixedNodeConstraint||I.alignmentConstraint||I.relativePlacementConstraint;if(E)I.tile=!1,I.packComponents=!1;var A=void 0,m=!1;if(B.layoutUtilities&&I.packComponents){if(A=B.layoutUtilities("get"),!A)A=B.layoutUtilities();m=!0}if(_.nodes().length>0)if(!m){var H=I.eles.boundingBox();if(w.push({x:H.x1+H.w/2,y:H.y1+H.h/2}),I.randomize){var b=g(I);J.push(b)}if(I.quality=="default"||I.quality=="proof")tt.push(c(I,J[0])),i.relocateComponent(w[0],tt[0],I);else i.relocateComponent(w[0],J[0],I)}else{var Q=i.getTopMostNodes(I.eles.nodes());if(s=i.connectComponents(B,I.eles,Q),s.forEach(function(Et){var vt=Et.boundingBox();w.push({x:vt.x1+vt.w/2,y:vt.y1+vt.h/2})}),I.randomize)s.forEach(function(Et){I.eles=Et,J.push(g(I))});if(I.quality=="default"||I.quality=="proof"){var Z=B.collection();if(I.tile){var V=new Map,st=[],dt=[],k=0,ut={nodeIndexes:V,xCoords:st,yCoords:dt},nt=[];if(s.forEach(function(Et,vt){if(Et.edges().length==0)Et.nodes().forEach(function(xt,Rt){if(Z.merge(Et.nodes()[Rt]),!xt.isParent())ut.nodeIndexes.set(Et.nodes()[Rt].id(),k++),ut.xCoords.push(Et.nodes()[0].position().x),ut.yCoords.push(Et.nodes()[0].position().y)}),nt.push(vt)}),Z.length>1){var F=Z.boundingBox();w.push({x:F.x1+F.w/2,y:F.y1+F.h/2}),s.push(Z),J.push(ut);for(var j=nt.length-1;j>=0;j--)s.splice(nt[j],1),J.splice(nt[j],1),w.splice(nt[j],1)}}s.forEach(function(Et,vt){I.eles=Et,tt.push(c(I,J[vt])),i.relocateComponent(w[vt],tt[vt],I)})}else s.forEach(function(Et,vt){i.relocateComponent(w[vt],J[vt],I)});var et=new Set;if(s.length>1){var ct=[],Nt=_.filter(function(Et){return Et.css("display")=="none"});s.forEach(function(Et,vt){var xt=void 0;if(I.quality=="draft")xt=J[vt].nodeIndexes;if(Et.nodes().not(Nt).length>0){var Rt={};Rt.edges=[],Rt.nodes=[];var Gt=void 0;if(Et.nodes().not(Nt).forEach(function(St){if(I.quality=="draft")if(!St.isParent())Gt=xt.get(St.id()),Rt.nodes.push({x:J[vt].xCoords[Gt]-St.boundingbox().w/2,y:J[vt].yCoords[Gt]-St.boundingbox().h/2,width:St.boundingbox().w,height:St.boundingbox().h});else{var Ft=i.calcBoundingBox(St,J[vt].xCoords,J[vt].yCoords,xt);Rt.nodes.push({x:Ft.topLeftX,y:Ft.topLeftY,width:Ft.width,height:Ft.height})}else if(tt[vt][St.id()])Rt.nodes.push({x:tt[vt][St.id()].getLeft(),y:tt[vt][St.id()].getTop(),width:tt[vt][St.id()].getWidth(),height:tt[vt][St.id()].getHeight()})}),Et.edges().forEach(function(St){var Ft=St.source(),Ht=St.target();if(Ft.css("display")!="none"&&Ht.css("display")!="none"){if(I.quality=="draft"){var zt=xt.get(Ft.id()),te=xt.get(Ht.id()),qt=[],Kt=[];if(Ft.isParent()){var kt=i.calcBoundingBox(Ft,J[vt].xCoords,J[vt].yCoords,xt);qt.push(kt.topLeftX+kt.width/2),qt.push(kt.topLeftY+kt.height/2)}else qt.push(J[vt].xCoords[zt]),qt.push(J[vt].yCoords[zt]);if(Ht.isParent()){var K=i.calcBoundingBox(Ht,J[vt].xCoords,J[vt].yCoords,xt);Kt.push(K.topLeftX+K.width/2),Kt.push(K.topLeftY+K.height/2)}else Kt.push(J[vt].xCoords[te]),Kt.push(J[vt].yCoords[te]);Rt.edges.push({startX:qt[0],startY:qt[1],endX:Kt[0],endY:Kt[1]})}else if(tt[vt][Ft.id()]&&tt[vt][Ht.id()])Rt.edges.push({startX:tt[vt][Ft.id()].getCenterX(),startY:tt[vt][Ft.id()].getCenterY(),endX:tt[vt][Ht.id()].getCenterX(),endY:tt[vt][Ht.id()].getCenterY()})}}),Rt.nodes.length>0)ct.push(Rt),et.add(vt)}});var Pt=A.packComponents(ct,I.randomize).shifts;if(I.quality=="draft")J.forEach(function(Et,vt){var xt=Et.xCoords.map(function(Gt){return Gt+Pt[vt].dx}),Rt=Et.yCoords.map(function(Gt){return Gt+Pt[vt].dy});Et.xCoords=xt,Et.yCoords=Rt});else{var Bt=0;et.forEach(function(Et){Object.keys(tt[Et]).forEach(function(vt){var xt=tt[Et][vt];xt.setCenter(xt.getCenterX()+Pt[Bt].dx,xt.getCenterY()+Pt[Bt].dy)}),Bt++})}}}var ft=function(vt,xt){if(I.quality=="default"||I.quality=="proof"){if(typeof vt==="number")vt=xt;var Rt=void 0,Gt=void 0,St=vt.data("id");if(tt.forEach(function(Ht){if(St in Ht)Rt={x:Ht[St].getRect().getCenterX(),y:Ht[St].getRect().getCenterY()},Gt=Ht[St]}),I.nodeDimensionsIncludeLabels){if(Gt.labelWidth){if(Gt.labelPosHorizontal=="left")Rt.x+=Gt.labelWidth/2;else if(Gt.labelPosHorizontal=="right")Rt.x-=Gt.labelWidth/2}if(Gt.labelHeight){if(Gt.labelPosVertical=="top")Rt.y+=Gt.labelHeight/2;else if(Gt.labelPosVertical=="bottom")Rt.y-=Gt.labelHeight/2}}if(Rt==null)Rt={x:vt.position("x"),y:vt.position("y")};return{x:Rt.x,y:Rt.y}}else{var Ft=void 0;if(J.forEach(function(Ht){var zt=Ht.nodeIndexes.get(vt.id());if(zt!=null)Ft={x:Ht.xCoords[zt],y:Ht.yCoords[zt]}}),Ft==null)Ft={x:vt.position("x"),y:vt.position("y")};return{x:Ft.x,y:Ft.y}}};if(I.quality=="default"||I.quality=="proof"||I.randomize){var Jt=i.calcParentsWithoutChildren(B,_),Xt=_.filter(function(Et){return Et.css("display")=="none"});if(I.eles=_.not(Xt),_.nodes().not(":parent").not(Xt).layoutPositions(W,I,ft),Jt.length>0)Jt.forEach(function(Et){Et.position(ft(Et))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),N}();o.exports=T},657:(o,n,a)=>{var u=a(548),r=a(140).layoutBase.Matrix,y=a(140).layoutBase.SVD,i=function(g){var{cy:d,eles:c}=g,x=c.nodes(),T=c.nodes(":parent"),N=new Map,O=new Map,W=new Map,I=[],B=[],_=[],J=[],lt=[],X=[],tt=[],s=[],w=void 0,E=void 0,A=1e8,m=0.000000001,{piTol:H,samplingType:b,nodeSeparation:Q}=g,Z=void 0,V=function(){var it=0,at=0,ot=!1;while(at<Z){it=Math.floor(Math.random()*E),ot=!1;for(var gt=0;gt<at;gt++)if(J[gt]==it){ot=!0;break}if(!ot)J[at]=it,at++;else continue}},st=function(it,at,ot){var gt=[],At=0,Mt=0,ht=0,Lt=void 0,Ct=[],pt=0,Ot=1;for(var Ut=0;Ut<E;Ut++)Ct[Ut]=A;gt[Mt]=it,Ct[it]=0;while(Mt>=At){ht=gt[At++];var Tt=I[ht];for(var yt=0;yt<Tt.length;yt++)if(Lt=O.get(Tt[yt]),Ct[Lt]==A)Ct[Lt]=Ct[ht]+1,gt[++Mt]=Lt;X[ht][at]=Ct[ht]*Q}if(ot){for(var Dt=0;Dt<E;Dt++)if(X[Dt][at]<lt[Dt])lt[Dt]=X[Dt][at];for(var mt=0;mt<E;mt++)if(lt[mt]>pt)pt=lt[mt],Ot=mt}return Ot},dt=function(it){var at=void 0;if(!it){V();for(var ot=0;ot<Z;ot++)st(J[ot],ot,it,!1)}else{at=Math.floor(Math.random()*E),w=at;for(var gt=0;gt<E;gt++)lt[gt]=A;for(var At=0;At<Z;At++)J[At]=at,at=st(at,At,it)}for(var Mt=0;Mt<E;Mt++)for(var ht=0;ht<Z;ht++)X[Mt][ht]*=X[Mt][ht];for(var Lt=0;Lt<Z;Lt++)tt[Lt]=[];for(var Ct=0;Ct<Z;Ct++)for(var pt=0;pt<Z;pt++)tt[Ct][pt]=X[J[pt]][Ct]},k=function(){var it=y.svd(tt),{S:at,U:ot,V:gt}=it,At=at[0]*at[0]*at[0],Mt=[];for(var ht=0;ht<Z;ht++){Mt[ht]=[];for(var Lt=0;Lt<Z;Lt++)if(Mt[ht][Lt]=0,ht==Lt)Mt[ht][Lt]=at[ht]/(at[ht]*at[ht]+At/(at[ht]*at[ht]))}s=r.multMat(r.multMat(gt,Mt),r.transpose(ot))},ut=function(){var it=void 0,at=void 0,ot=[],gt=[],At=[],Mt=[];for(var ht=0;ht<E;ht++)ot[ht]=Math.random(),gt[ht]=Math.random();ot=r.normalize(ot),gt=r.normalize(gt);var Lt=0,Ct=m,pt=m,Ot=void 0;while(!0){Lt++;for(var Ut=0;Ut<E;Ut++)At[Ut]=ot[Ut];if(ot=r.multGamma(r.multL(r.multGamma(At),X,s)),it=r.dotProduct(At,ot),ot=r.normalize(ot),Ct=r.dotProduct(At,ot),Ot=Math.abs(Ct/pt),Ot<=1+H&&Ot>=1)break;pt=Ct}for(var Tt=0;Tt<E;Tt++)At[Tt]=ot[Tt];Lt=0,pt=m;while(!0){Lt++;for(var yt=0;yt<E;yt++)Mt[yt]=gt[yt];if(Mt=r.minusOp(Mt,r.multCons(At,r.dotProduct(At,Mt))),gt=r.multGamma(r.multL(r.multGamma(Mt),X,s)),at=r.dotProduct(Mt,gt),gt=r.normalize(gt),Ct=r.dotProduct(Mt,gt),Ot=Math.abs(Ct/pt),Ot<=1+H&&Ot>=1)break;pt=Ct}for(var Dt=0;Dt<E;Dt++)Mt[Dt]=gt[Dt];B=r.multCons(At,Math.sqrt(Math.abs(it))),_=r.multCons(Mt,Math.sqrt(Math.abs(at)))};u.connectComponents(d,c,u.getTopMostNodes(x),N),T.forEach(function(rt){u.connectComponents(d,c,u.getTopMostNodes(rt.descendants().intersection(c)),N)});var nt=0;for(var F=0;F<x.length;F++)if(!x[F].isParent())O.set(x[F].id(),nt++);var j=!0,et=!1,ct=void 0;try{for(var Nt=N.keys()[Symbol.iterator](),Pt;!(j=(Pt=Nt.next()).done);j=!0){var Bt=Pt.value;O.set(Bt,nt++)}}catch(rt){et=!0,ct=rt}finally{try{if(!j&&Nt.return)Nt.return()}finally{if(et)throw ct}}for(var ft=0;ft<O.size;ft++)I[ft]=[];T.forEach(function(rt){var it=rt.children().intersection(c);while(it.nodes(":childless").length==0)it=it.nodes()[0].children().intersection(c);var at=0,ot=it.nodes(":childless")[0].connectedEdges().length;it.nodes(":childless").forEach(function(gt,At){if(gt.connectedEdges().length<ot)ot=gt.connectedEdges().length,at=At}),W.set(rt.id(),it.nodes(":childless")[at].id())}),x.forEach(function(rt){var it=void 0;if(rt.isParent())it=O.get(W.get(rt.id()));else it=O.get(rt.id());rt.neighborhood().nodes().forEach(function(at){if(c.intersection(rt.edgesWith(at)).length>0)if(at.isParent())I[it].push(W.get(at.id()));else I[it].push(at.id())})});var Jt=function(it){var at=O.get(it),ot=void 0;N.get(it).forEach(function(gt){if(d.getElementById(gt).isParent())ot=W.get(gt);else ot=gt;I[at].push(ot),I[O.get(ot)].push(it)})},Xt=!0,Et=!1,vt=void 0;try{for(var xt=N.keys()[Symbol.iterator](),Rt;!(Xt=(Rt=xt.next()).done);Xt=!0){var Gt=Rt.value;Jt(Gt)}}catch(rt){Et=!0,vt=rt}finally{try{if(!Xt&&xt.return)xt.return()}finally{if(Et)throw vt}}E=O.size;var St=void 0;if(E>2){Z=E<g.sampleSize?E:g.sampleSize;for(var Ft=0;Ft<E;Ft++)X[Ft]=[];for(var Ht=0;Ht<Z;Ht++)s[Ht]=[];if(g.quality=="draft"||g.step=="all")dt(b),k(),ut(),St={nodeIndexes:O,xCoords:B,yCoords:_};else O.forEach(function(rt,it){B.push(d.getElementById(it).position("x")),_.push(d.getElementById(it).position("y"))}),St={nodeIndexes:O,xCoords:B,yCoords:_};return St}else{var zt=O.keys(),te=d.getElementById(zt.next().value),qt=te.position(),Kt=te.outerWidth();if(B.push(qt.x),_.push(qt.y),E==2){var kt=d.getElementById(zt.next().value),K=kt.outerWidth();B.push(qt.x+Kt/2+K/2+g.idealEdgeLength),_.push(qt.y)}return St={nodeIndexes:O,xCoords:B,yCoords:_},St}};o.exports={spectralLayout:i}},579:(o,n,a)=>{var u=a(212),r=function(i){if(!i)return;i("layout","fcose",u)};if(typeof cytoscape<"u")r(cytoscape);o.exports=r},140:(o)=>{o.exports=M}},D={};function v(o){var n=D[o];if(n!==void 0)return n.exports;var a=D[o]={exports:{}};return S[o](a,a.exports,v),a.exports}var f=v(579);return f})()})});var je=fn($e(),1);var Be={L:"left",R:"right",T:"top",B:"bottom"},Ze={L:t((M)=>`${M},${M/2} 0,${M} 0,0`,"L"),R:t((M)=>`0,${M/2} ${M},0 ${M},${M}`,"R"),T:t((M)=>`0,0 ${M},0 ${M/2},${M}`,"T"),B:t((M)=>`${M/2},0 ${M},${M} 0,${M}`,"B")},Me={L:t((M,S)=>M-S+2,"L"),R:t((M,S)=>M-2,"R"),T:t((M,S)=>M-S+2,"T"),B:t((M,S)=>M-2,"B")},hr=t(function(M){if(_t(M))return M==="L"?"R":"L";else return M==="T"?"B":"T"},"getOppositeArchitectureDirection"),ke=t(function(M){let S=M;return S==="L"||S==="R"||S==="T"||S==="B"},"isArchitectureDirection"),_t=t(function(M){let S=M;return S==="L"||S==="R"},"isArchitectureDirectionX"),he=t(function(M){let S=M;return S==="T"||S==="B"},"isArchitectureDirectionY"),Ye=t(function(M,S){let D=_t(M)&&he(S),v=he(M)&&_t(S);return D||v},"isArchitectureDirectionXY"),fr=t(function(M){let S=M[0],D=M[1],v=_t(S)&&he(D),f=he(S)&&_t(D);return v||f},"isArchitecturePairXY"),cr=t(function(M){return M!=="LL"&&M!=="RR"&&M!=="TT"&&M!=="BB"},"isValidArchitectureDirectionPair"),Ge=t(function(M,S){let D=`${M}${S}`;return cr(D)?D:void 0},"getArchitectureDirectionPair"),gr=t(function([M,S],D){let v=D[0],f=D[1];if(_t(v))if(he(f))return[M+(v==="L"?-1:1),S+(f==="T"?1:-1)];else return[M+(v==="L"?-1:1),S];else if(_t(f))return[M+(f==="L"?1:-1),S+(v==="T"?1:-1)];else return[M,S+(v==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ur=t(function(M){if(M==="LT"||M==="TL")return[1,1];else if(M==="BL"||M==="LB")return[1,-1];else if(M==="BR"||M==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),dr=t(function(M,S){if(Ye(M,S))return"bend";else if(_t(M))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),vr=t(function(M){return M.type==="service"},"isArchitectureService"),pr=t(function(M){return M.type==="junction"},"isArchitectureJunction"),qe=t((M,S)=>{let[D,v]=[M,S].sort();return`${JSON.stringify(D)}-${JSON.stringify(v)}`},"architectureGroupAlignmentKey"),Qe=t((M)=>M.data(),"edgeData"),ye=t((M)=>M.data(),"nodeData"),yr=Y.architecture,Je=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=L,this.getAccTitle=z,this.setDiagramTitle=q,this.getDiagramTitle=G,this.getAccDescription=U,this.setAccDescription=P,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(M){this.diagramId=M}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",R()}addService({id:M,icon:S,in:D,title:v,iconText:f}){if(this.registeredIds.has(M))throw Error(`The service id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(D!==void 0){if(M===D)throw Error(`The service [${M}] cannot be placed within itself`);if(!this.registeredIds.has(D))throw Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(D)==="node")throw Error(`The service [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"service",icon:S,iconText:f,title:v,edges:[],in:D})}getServices(){return[...this.nodes.values()].filter(vr)}addJunction({id:M,in:S}){if(this.registeredIds.has(M))throw Error(`The junction id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(S!==void 0){if(M===S)throw Error(`The junction [${M}] cannot be placed within itself`);if(!this.registeredIds.has(S))throw Error(`The junction [${M}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(S)==="node")throw Error(`The junction [${M}]'s parent is not a group`)}this.registeredIds.set(M,"node"),this.nodes.set(M,{id:M,type:"junction",edges:[],in:S})}getJunctions(){return[...this.nodes.values()].filter(pr)}getNodes(){return[...this.nodes.values()]}getNode(M){return this.nodes.get(M)??null}addGroup({id:M,icon:S,in:D,title:v}){if(this.registeredIds.has(M))throw Error(`The group id [${M}] is already in use by another ${this.registeredIds.get(M)}`);if(D!==void 0){if(M===D)throw Error(`The group [${M}] cannot be placed within itself`);if(!this.registeredIds.has(D))throw Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(D)==="node")throw Error(`The group [${M}]'s parent is not a group`)}this.registeredIds.set(M,"group"),this.groups.set(M,{id:M,icon:S,title:v,in:D})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:M,rhsId:S,lhsDir:D,rhsDir:v,lhsInto:f,rhsInto:o,lhsGroup:n,rhsGroup:a,title:u}){if(!ke(D))throw Error(`Invalid direction given for left hand side of edge ${M}--${S}. Expected (L,R,T,B) got ${String(D)}`);if(!ke(v))throw Error(`Invalid direction given for right hand side of edge ${M}--${S}. Expected (L,R,T,B) got ${String(v)}`);if(!this.nodes.has(M)&&!this.groups.has(M))throw Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(S)&&!this.groups.has(S))throw Error(`The right-hand id [${S}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(M).in,y=this.nodes.get(S).in;if(n&&r&&y&&r==y)throw Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&r&&y&&r==y)throw Error(`The right-hand id [${S}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:M,lhsDir:D,lhsInto:f,lhsGroup:n,rhsId:S,rhsDir:v,rhsInto:o,rhsGroup:a,title:u};this.edges.push(i);let e=this.nodes.get(M),g=this.nodes.get(S);if(e&&g)e.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(M){if(M.members.length<2)throw Error(`An align directive requires at least two members; got ${M.members.length}`);let S=new Set;M.members.forEach((D)=>{if(this.registeredIds.get(D)!=="node")throw Error(`align ${M.direction} references [${D}], which is not a service or junction`);if(S.has(D))throw Error(`align ${M.direction} lists [${D}] more than once`);S.add(D)}),this.layoutHints.push(M)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let M=new Map,S=new Map;for(let[n,a]of this.nodes.entries()){let u=new Map;for(let r of a.edges){let y=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(y&&i&&y!==i){let e=dr(r.lhsDir,r.rhsDir);if(e!=="bend")M.set(qe(y,i),e)}if(r.lhsId===n){let e=Ge(r.lhsDir,r.rhsDir);if(e)u.set(e,r.rhsId)}else{let e=Ge(r.rhsDir,r.lhsDir);if(e)u.set(e,r.lhsId)}}S.set(n,u)}let D=new Set,v=new Set(S.keys()),f=t((n)=>{let a=new Map([[n,[0,0]]]),u=[n];while(u.length>0){let r=u.shift();if(r){D.add(r),v.delete(r);let y=S.get(r);if(!y)throw Error(`BFS error: adjacency list for id ${r} not found. Please report this as a bug.`);let i=a.get(r);if(!i)throw Error(`BFS error: position for id ${r} not found in spatial map. Please report this as a bug.`);let[e,g]=i;y.forEach((d,c)=>{if(!D.has(d))a.set(d,gr([e,g],c)),u.push(d)})}}return a},"BFS"),o=[];while(v.size>0){let n=v.values().next().value;o.push(f(n))}this.dataStructures={adjList:S,spatialMaps:o,groupAlignments:M}}return this.dataStructures}setElementForId(M,S){this.elements.set(M,S)}getElementById(M){return this.elements.get(M)}getConfig(){return ie({...yr,...C().architecture})}getConfigField(M){return this.getConfig()[M]}},mr=t((M,S)=>{be(M,S),M.groups.map((D)=>S.addGroup(D)),M.services.map((D)=>S.addService({...D,type:"service"})),M.junctions.map((D)=>S.addJunction({...D,type:"junction"})),M.edges.map((D)=>S.addEdge(D)),M.alignments?.map((D)=>S.addLayoutHint({direction:D.direction,members:[...D.members]}))},"populateDb"),Ke={parser:{yy:void 0},parse:t(async(M)=>{let S=await Ne("architecture",M);l.debug(S);let D=Ke.parser?.yy;if(!(D instanceof Je))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");mr(S,D)},"parse")},Er=t((M)=>`
|
|
2
2
|
.edge {
|
|
3
|
-
stroke-width: ${
|
|
4
|
-
stroke: ${
|
|
3
|
+
stroke-width: ${M.archEdgeWidth};
|
|
4
|
+
stroke: ${M.archEdgeColor};
|
|
5
5
|
fill: none;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.arrow {
|
|
9
|
-
fill: ${
|
|
9
|
+
fill: ${M.archEdgeArrowColor};
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.node-bkg {
|
|
13
13
|
fill: none;
|
|
14
|
-
stroke: ${
|
|
15
|
-
stroke-width: ${
|
|
14
|
+
stroke: ${M.archGroupBorderColor};
|
|
15
|
+
stroke-width: ${M.archGroupBorderWidth};
|
|
16
16
|
stroke-dasharray: 8;
|
|
17
17
|
}
|
|
18
18
|
.node-icon-text {
|
|
@@ -29,8 +29,8 @@ import{be}from"./index-1y3rzw6b.js";import{t,l,V,C,ee,$r,R,F,z,P,U,q,j,p,h,de,zf
|
|
|
29
29
|
display: -webkit-box;
|
|
30
30
|
-webkit-box-orient: vertical;
|
|
31
31
|
}
|
|
32
|
-
`,"getStyles"),Tr=Er;function Ue(
|
|
33
|
-
translate(${
|
|
34
|
-
translate(${m*b.width/2}, ${
|
|
35
|
-
rotate(${-1*m*
|
|
36
|
-
`)}}}}}))},"drawEdges"),Lr=t(async function(w,I,A,v){let o=A.getConfigField("padding")*0.75,n=A.getConfigField("fontSize"),u=A.getConfigField("iconSize")/2;await Promise.all(I.nodes().map(async(r)=>{let y=ye(r);if(y.type==="group"){let{h:i,w:e,x1:g,y1:d}=r.boundingBox(),c=w.append("rect");c.attr("id",`${v}-group-${y.id}`).attr("x",g+u).attr("y",d+u).attr("width",e).attr("height",i).attr("class","node-bkg");let O=w.append("g"),T=g,N=d;if(y.icon){let D=O.append("g");D.html(`<g>${await lr(y.icon,{height:o,width:o,fallbackPrefix:Ne.prefix})}</g>`),D.attr("transform","translate("+(T+u+1)+", "+(N+u+1)+")"),T+=o,N+=n/2-1-2}if(y.label){let D=O.append("g");await on(D,y.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},p()),D.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),D.attr("transform","translate("+(T+u+4)+", "+(N+u+2)+")")}A.setElementForId(y.id,c)}}))},"drawGroups"),wr=t(async function(w,I,A,v){let f=p();for(let o of A){let n=I.append("g"),a=w.getConfigField("iconSize");if(o.title){let i=n.append("g");await on(i,o.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},f),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+a/2+", "+a+")")}let u=n.append("g");if(o.icon)u.html(`<g>${await lr(o.icon,{height:a,width:a,fallbackPrefix:Ne.prefix})}</g>`);else if(o.iconText){u.html(`<g>${await lr("blank",{height:a,width:a,fallbackPrefix:Ne.prefix})}</g>`);let g=u.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(ee(o.iconText,f)),d=parseInt(window.getComputedStyle(g.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;g.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/d)};`)}else u.append("path").attr("class","node-bkg").attr("id",`${v}-node-${o.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);n.attr("id",`${v}-service-${o.id}`).attr("class","architecture-service");let{width:r,height:y}=n.node().getBBox();o.width=r,o.height=y,w.setElementForId(o.id,n)}return 0},"drawServices"),Mr=t(function(w,I,A,v){A.forEach((f)=>{let o=I.append("g"),n=w.getConfigField("iconSize");o.append("g").append("rect").attr("id",`${v}-node-${f.id}`).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:u,height:r}=o._groups[0][0].getBBox();o.width=u,o.height=r,w.setElementForId(f.id,o)})},"drawJunctions");Fi([{name:Ne.prefix,icons:Ne}]);Pr.use(je.default);function _e(w,I,A){w.forEach((v)=>{I.add({group:"nodes",data:{type:"service",id:v.id,icon:v.icon,label:v.title,parent:v.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-service"})})}t(_e,"addServices");function tr(w,I,A){w.forEach((v)=>{I.add({group:"nodes",data:{type:"junction",id:v.id,parent:v.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-junction"})})}t(tr,"addJunctions");function er(w,I){I.nodes().map((A)=>{let v=ye(A);if(v.type==="group")return;v.x=A.position().x,v.y=A.position().y,w.getElementById(v.id).attr("transform","translate("+(v.x||0)+","+(v.y||0)+")")})}t(er,"positionNodes");function rr(w,I){w.forEach((A)=>{I.add({group:"nodes",data:{type:"group",id:A.id,icon:A.icon,label:A.title,parent:A.in},classes:"node-group"})})}t(rr,"addGroups");function ir(w,I){w.forEach((A)=>{let{lhsId:v,rhsId:f,lhsInto:o,lhsGroup:n,rhsInto:a,lhsDir:u,rhsDir:r,rhsGroup:y,title:i}=A,e=Ye(A.lhsDir,A.rhsDir)?"segments":"straight",g={id:`${v}-${f}`,label:i,source:v,sourceDir:u,sourceArrow:o,sourceGroup:n,sourceEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%",target:f,targetDir:r,targetArrow:a,targetGroup:y,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};I.add({group:"edges",data:g,classes:e})})}t(ir,"addEdges");function nr(w,I,A,v=[]){let f=t((e,g)=>{let d=new Map;for(let[c,O]of e.entries()){let T=`${c}`,N=0,D=[...O.entries()];if(D.length===1){d.set(T,D[0][1]);continue}for(let X=0;X<D.length-1;X++)for(let x=X+1;x<D.length;x++){let[W,_]=D[X],[Q,lt]=D[x];if(A.get(qe(W,Q))===g)d.set(T,[...d.get(T)??[],..._,...lt]);else if(W==="default"||Q==="default")d.set(T,[...d.get(T)??[],..._,...lt]);else{let tt=`${T}-${N++}`;d.set(tt,_);let s=`${T}-${N++}`;d.set(s,lt)}}}return d},"flattenAlignments"),o=I.map((e)=>{let g=new Map,d=new Map;return e.forEach(([c,O],T)=>{let N=w.getNode(T)?.in??"default",D=g.get(O)??new Map;if(!g.has(O))g.set(O,D);let X=d.get(c)??new Map;if(!d.has(c))d.set(c,X);for(let x of[D,X]){let W=x.get(N)??[];if(!x.has(N))x.set(N,W);W.push(T)}}),{horiz:[...f(g,"horizontal").values()].filter((c)=>c.length>1),vert:[...f(d,"vertical").values()].filter((c)=>c.length>1)}}),[n,a]=o.reduce(([e,g],{horiz:d,vert:c})=>[[...e,...d],[...g,...c]],[[],[]]),u=new Set;v.forEach((e)=>e.members.forEach((g)=>u.add(g)));let r=t((e)=>e.filter((g)=>!g.some((d)=>u.has(d))),"dropOverlapping"),y=r(n),i=r(a);return v.forEach((e)=>{if(e.members.length<2)return;if(e.direction==="row")y.push([...e.members]);else i.push([...e.members])}),{horizontal:y,vertical:i}}t(nr,"getAlignments");function ar(w,I,A=[]){let v=[],f=I.getConfigField("iconSize"),o=I.getConfigField("idealEdgeLengthMultiplier"),n=o*f,a=new Set;A.forEach((y)=>{for(let i=0;i<y.members.length-1;i++){let e=y.members[i],g=y.members[i+1];if(a.add(`${e}|${g}`),a.add(`${g}|${e}`),y.direction==="row")v.push({left:e,right:g,gap:n});else v.push({top:e,bottom:g,gap:n})}});let u=t((y)=>`${y[0]},${y[1]}`,"posToStr"),r=t((y)=>y.split(",").map((i)=>parseInt(i)),"strToPos");return w.forEach((y)=>{let i=new Map([...y.entries()].map(([c,O])=>[u(O),c])),e=[u([0,0])],g={},d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(e.length>0){let c=e.shift();if(c){g[c]=1;let O=i.get(c);if(O){let T=r(c);Object.entries(d).forEach(([N,D])=>{let X=u([T[0]+D[0],T[1]+D[1]]),x=i.get(X);if(x&&!g[X]){if(e.push(X),a.has(`${O}|${x}`))return;v.push({[Be[N]]:x,[Be[hr(N)]]:O,gap:o*f})}})}}}}),v}t(ar,"getRelativeConstraints");function or(w,I,A,v,f,{spatialMaps:o,groupAlignments:n}){return new Promise((a)=>{let u=h("body").append("div").attr("id","cy").attr("style","display:none"),r=Pr({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":[0.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":`${f.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:`${f.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),rr(A,r),_e(w,r,f),tr(I,r,f),ir(v,r);let y=f.getLayoutHints(),i=nr(f,o,n,y),e=ar(o,f,y),g=f.getConfigField("iconSize"),d=f.getConfigField("idealEdgeLengthMultiplier")*g,c=0.5*g,O=f.getConfigField("edgeElasticity"),T=f.getConfigField("seed"),N=r.layout({name:"fcose",quality:"proof",randomize:f.getConfigField("randomize"),nodeSeparation:f.getConfigField("nodeSeparation"),numIter:f.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(D){let[X,x]=D.connectedNodes(),{parent:W}=ye(X),{parent:_}=ye(x);return W===_?d:c},edgeElasticity(D){let[X,x]=D.connectedNodes(),{parent:W}=ye(X),{parent:_}=ye(x);return W===_?O:0.001},alignmentConstraint:i,relativePlacementConstraint:e});N.one("layoutstop",()=>{function D(X,x,W,_){let Q,lt,{x:G,y:tt}=X,{x:s,y:L}=x;lt=(_-tt+(G-W)*(tt-L)/(G-s))/Math.sqrt(1+Math.pow((tt-L)/(G-s),2)),Q=Math.sqrt(Math.pow(_-tt,2)+Math.pow(W-G,2)-Math.pow(lt,2));let E=Math.sqrt(Math.pow(s-G,2)+Math.pow(L-tt,2));Q=Q/E;let M=(s-G)*(_-tt)-(L-tt)*(W-G);switch(!0){case M>=0:M=1;break;case M<0:M=-1;break}let m=(s-G)*(W-G)+(L-tt)*(_-tt);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}return lt=Math.abs(lt)*M,Q=Q*m,{distances:lt,weights:Q}}t(D,"getSegmentWeights"),r.startBatch();for(let X of Object.values(r.edges()))if(X.data?.()){let{x,y:W}=X.source().position(),{x:_,y:Q}=X.target().position();if(x!==_&&W!==Q){let lt=X.sourceEndpoint(),G=X.targetEndpoint(),{sourceDir:tt}=Qe(X),[s,L]=he(tt)?[lt.x,G.y]:[G.x,lt.y],{weights:E,distances:M}=D(lt,G,s,L);X.style("segment-distances",M),X.style("segment-weights",E)}}r.endBatch(),Ue(T,()=>N.run())});try{Ue(T,()=>N.run())}catch(D){if(D instanceof RangeError&&D.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw D}r.ready((D)=>{l.info("Ready",D),a(r)})})}t(or,"layoutArchitecture");var Cr=t(async(w,I,A,v)=>{let f=v.db;f.setDiagramId(I);let o=f.getServices(),n=f.getJunctions(),a=f.getGroups(),u=f.getEdges(),r=f.getDataStructures(),y=de(I),i=y.append("g");i.attr("class","architecture-edges");let e=y.append("g");e.attr("class","architecture-services");let g=y.append("g");g.attr("class","architecture-groups"),await wr(f,e,o,I),Mr(f,e,n,I);let d=await or(o,n,a,u,f,r);await Nr(i,d,f,I),await Lr(g,d,f,I),er(f,d),$r(void 0,y,f.getConfigField("padding"),f.getConfigField("useMaxWidth"))},"draw"),Ar={draw:Cr},Xr={parser:Ke,get db(){return new Je},renderer:Ar,styles:Tr};export{Xr as diagram};
|
|
32
|
+
`,"getStyles"),Tr=Er;function Ue(M,S){if(M===0)return S();let D=Math.random,v=M>>>0;Math.random=function(){v=v+1831565813>>>0;let f=v;return f=Math.imul(f^f>>>15,f|1),f^=f+Math.imul(f^f>>>7,f|61),((f^f>>>14)>>>0)/4294967296};try{return S()}finally{Math.random=D}}t(Ue,"withSeededRandom");var pe=t((M)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${M}</g>`,"wrapIcon"),Le={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:pe('<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:pe('<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:pe('<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:pe('<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:pe('<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:Mf,blank:{body:pe("")}}},Nr=t(async function(M,S,D,v){let f=D.getConfigField("padding"),o=D.getConfigField("iconSize"),n=o/2,a=o/6,u=a/2;await Promise.all(S.edges().map(async(r)=>{let{source:y,sourceDir:i,sourceArrow:e,sourceGroup:g,target:d,targetDir:c,targetArrow:x,targetGroup:T,label:N}=Qe(r),{x:O,y:W}=r[0].sourceEndpoint(),{x:I,y:B}=r[0].midpoint(),{x:_,y:J}=r[0].targetEndpoint(),lt=f+4;if(g)if(_t(i))O+=i==="L"?-lt:lt;else W+=i==="T"?-lt:lt+18;if(T)if(_t(c))_+=c==="L"?-lt:lt;else J+=c==="T"?-lt:lt+18;if(!g&&D.getNode(y)?.type==="junction")if(_t(i))O+=i==="L"?n:-n;else W+=i==="T"?n:-n;if(!T&&D.getNode(d)?.type==="junction")if(_t(c))_+=c==="L"?n:-n;else J+=c==="T"?n:-n;if(r[0]._private.rscratch){let X=M.insert("g");if(X.insert("path").attr("d",`M ${O},${W} L ${I},${B} L${_},${J} `).attr("class","edge").attr("id",`${v}-${En(y,d,{prefix:"L"})}`),e){let tt=_t(i)?Me[i](O,a):O-u,s=he(i)?Me[i](W,a):W-u;X.insert("polygon").attr("points",Ze[i](a)).attr("transform",`translate(${tt},${s})`).attr("class","arrow")}if(x){let tt=_t(c)?Me[c](_,a):_-u,s=he(c)?Me[c](J,a):J-u;X.insert("polygon").attr("points",Ze[c](a)).attr("transform",`translate(${tt},${s})`).attr("class","arrow")}if(N){let tt=!Ye(i,c)?_t(i)?"X":"Y":"XY",s=0;if(tt==="X")s=Math.abs(O-_);else if(tt==="Y")s=Math.abs(W-J)/1.5;else s=Math.abs(O-_)/2;let w=X.append("g");if(await sn(w,N,{useHtmlLabels:!1,width:s,classes:"architecture-service-label"},p()),w.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),tt==="X")w.attr("transform","translate("+I+", "+B+")");else if(tt==="Y")w.attr("transform","translate("+I+", "+B+") rotate(-90)");else if(tt==="XY"){let E=Ge(i,c);if(E&&fr(E)){let A=w.node().getBoundingClientRect(),[m,H]=ur(E);w.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*m*H*45})`);let b=w.node().getBoundingClientRect();w.attr("transform",`
|
|
33
|
+
translate(${I}, ${B-A.height/2})
|
|
34
|
+
translate(${m*b.width/2}, ${H*b.height/2})
|
|
35
|
+
rotate(${-1*m*H*45}, 0, ${A.height/2})
|
|
36
|
+
`)}}}}}))},"drawEdges"),Lr=t(async function(M,S,D,v){let o=D.getConfigField("padding")*0.75,n=D.getConfigField("fontSize"),u=D.getConfigField("iconSize")/2;await Promise.all(S.nodes().map(async(r)=>{let y=ye(r);if(y.type==="group"){let{h:i,w:e,x1:g,y1:d}=r.boundingBox(),c=M.append("rect");c.attr("id",`${v}-group-${y.id}`).attr("x",g+u).attr("y",d+u).attr("width",e).attr("height",i).attr("class","node-bkg");let x=M.append("g"),T=g,N=d;if(y.icon){let O=x.append("g");O.html(`<g>${await lr(y.icon,{height:o,width:o,fallbackPrefix:Le.prefix})}</g>`),O.attr("transform","translate("+(T+u+1)+", "+(N+u+1)+")"),T+=o,N+=n/2-1-2}if(y.label){let O=x.append("g");await sn(O,y.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},p()),O.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),O.attr("transform","translate("+(T+u+4)+", "+(N+u+2)+")")}D.setElementForId(y.id,c)}}))},"drawGroups"),wr=t(async function(M,S,D,v){let f=p();for(let o of D){let n=S.append("g"),a=M.getConfigField("iconSize");if(o.title){let i=n.append("g");await sn(i,o.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},f),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+a/2+", "+a+")")}let u=n.append("g");if(o.icon)u.html(`<g>${await lr(o.icon,{height:a,width:a,fallbackPrefix:Le.prefix})}</g>`);else if(o.iconText){u.html(`<g>${await lr("blank",{height:a,width:a,fallbackPrefix:Le.prefix})}</g>`);let g=u.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(ee(o.iconText,f)),d=parseInt(window.getComputedStyle(g.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;g.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/d)};`)}else u.append("path").attr("class","node-bkg").attr("id",`${v}-node-${o.id}`).attr("d",`M0,${a} V5 Q0,0 5,0 H${a-5} Q${a},0 ${a},5 V${a} Z`);n.attr("id",`${v}-service-${o.id}`).attr("class","architecture-service");let{width:r,height:y}=n.node().getBBox();o.width=r,o.height=y,M.setElementForId(o.id,n)}return 0},"drawServices"),Cr=t(function(M,S,D,v){D.forEach((f)=>{let o=S.append("g"),n=M.getConfigField("iconSize");o.append("g").append("rect").attr("id",`${v}-node-${f.id}`).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:u,height:r}=o._groups[0][0].getBBox();o.width=u,o.height=r,M.setElementForId(f.id,o)})},"drawJunctions");Ri([{name:Le.prefix,icons:Le}]);Mr.use(je.default);function _e(M,S,D){M.forEach((v)=>{S.add({group:"nodes",data:{type:"service",id:v.id,icon:v.icon,label:v.title,parent:v.in,width:D.getConfigField("iconSize"),height:D.getConfigField("iconSize")},classes:"node-service"})})}t(_e,"addServices");function tr(M,S,D){M.forEach((v)=>{S.add({group:"nodes",data:{type:"junction",id:v.id,parent:v.in,width:D.getConfigField("iconSize"),height:D.getConfigField("iconSize")},classes:"node-junction"})})}t(tr,"addJunctions");function er(M,S){S.nodes().map((D)=>{let v=ye(D);if(v.type==="group")return;v.x=D.position().x,v.y=D.position().y,M.getElementById(v.id).attr("transform","translate("+(v.x||0)+","+(v.y||0)+")")})}t(er,"positionNodes");function rr(M,S){M.forEach((D)=>{S.add({group:"nodes",data:{type:"group",id:D.id,icon:D.icon,label:D.title,parent:D.in},classes:"node-group"})})}t(rr,"addGroups");function ir(M,S){M.forEach((D)=>{let{lhsId:v,rhsId:f,lhsInto:o,lhsGroup:n,rhsInto:a,lhsDir:u,rhsDir:r,rhsGroup:y,title:i}=D,e=Ye(D.lhsDir,D.rhsDir)?"segments":"straight",g={id:`${v}-${f}`,label:i,source:v,sourceDir:u,sourceArrow:o,sourceGroup:n,sourceEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%",target:f,targetDir:r,targetArrow:a,targetGroup:y,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};S.add({group:"edges",data:g,classes:e})})}t(ir,"addEdges");function nr(M,S,D,v=[]){let f=t((e,g)=>{let d=new Map;for(let[c,x]of e.entries()){let T=`${c}`,N=0,O=[...x.entries()];if(O.length===1){d.set(T,O[0][1]);continue}for(let W=0;W<O.length-1;W++)for(let I=W+1;I<O.length;I++){let[B,_]=O[W],[J,lt]=O[I];if(D.get(qe(B,J))===g)d.set(T,[...d.get(T)??[],..._,...lt]);else if(B==="default"||J==="default")d.set(T,[...d.get(T)??[],..._,...lt]);else{let tt=`${T}-${N++}`;d.set(tt,_);let s=`${T}-${N++}`;d.set(s,lt)}}}return d},"flattenAlignments"),o=S.map((e)=>{let g=new Map,d=new Map;return e.forEach(([c,x],T)=>{let N=M.getNode(T)?.in??"default",O=g.get(x)??new Map;if(!g.has(x))g.set(x,O);let W=d.get(c)??new Map;if(!d.has(c))d.set(c,W);for(let I of[O,W]){let B=I.get(N)??[];if(!I.has(N))I.set(N,B);B.push(T)}}),{horiz:[...f(g,"horizontal").values()].filter((c)=>c.length>1),vert:[...f(d,"vertical").values()].filter((c)=>c.length>1)}}),[n,a]=o.reduce(([e,g],{horiz:d,vert:c})=>[[...e,...d],[...g,...c]],[[],[]]),u=new Set;v.forEach((e)=>e.members.forEach((g)=>u.add(g)));let r=t((e)=>e.filter((g)=>!g.some((d)=>u.has(d))),"dropOverlapping"),y=r(n),i=r(a);return v.forEach((e)=>{if(e.members.length<2)return;if(e.direction==="row")y.push([...e.members]);else i.push([...e.members])}),{horizontal:y,vertical:i}}t(nr,"getAlignments");function ar(M,S,D=[]){let v=[],f=S.getConfigField("iconSize"),o=S.getConfigField("idealEdgeLengthMultiplier"),n=o*f,a=new Set;D.forEach((y)=>{for(let i=0;i<y.members.length-1;i++){let e=y.members[i],g=y.members[i+1];if(a.add(`${e}|${g}`),a.add(`${g}|${e}`),y.direction==="row")v.push({left:e,right:g,gap:n});else v.push({top:e,bottom:g,gap:n})}});let u=t((y)=>`${y[0]},${y[1]}`,"posToStr"),r=t((y)=>y.split(",").map((i)=>parseInt(i)),"strToPos");return M.forEach((y)=>{let i=new Map([...y.entries()].map(([c,x])=>[u(x),c])),e=[u([0,0])],g={},d={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(e.length>0){let c=e.shift();if(c){g[c]=1;let x=i.get(c);if(x){let T=r(c);Object.entries(d).forEach(([N,O])=>{let W=u([T[0]+O[0],T[1]+O[1]]),I=i.get(W);if(I&&!g[W]){if(e.push(W),a.has(`${x}|${I}`))return;v.push({[Be[N]]:I,[Be[hr(N)]]:x,gap:o*f})}})}}}}),v}t(ar,"getRelativeConstraints");function or(M,S,D,v,f,{spatialMaps:o,groupAlignments:n}){return new Promise((a)=>{let u=h("body").append("div").attr("id","cy").attr("style","display:none"),r=Mr({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":[0.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":`${f.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:`${f.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),rr(D,r),_e(M,r,f),tr(S,r,f),ir(v,r);let y=f.getLayoutHints(),i=nr(f,o,n,y),e=ar(o,f,y),g=f.getConfigField("iconSize"),d=f.getConfigField("idealEdgeLengthMultiplier")*g,c=0.5*g,x=f.getConfigField("edgeElasticity"),T=f.getConfigField("seed"),N=r.layout({name:"fcose",quality:"proof",randomize:f.getConfigField("randomize"),nodeSeparation:f.getConfigField("nodeSeparation"),numIter:f.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(O){let[W,I]=O.connectedNodes(),{parent:B}=ye(W),{parent:_}=ye(I);return B===_?d:c},edgeElasticity(O){let[W,I]=O.connectedNodes(),{parent:B}=ye(W),{parent:_}=ye(I);return B===_?x:0.001},alignmentConstraint:i,relativePlacementConstraint:e});N.one("layoutstop",()=>{function O(W,I,B,_){let J,lt,{x:X,y:tt}=W,{x:s,y:w}=I;lt=(_-tt+(X-B)*(tt-w)/(X-s))/Math.sqrt(1+Math.pow((tt-w)/(X-s),2)),J=Math.sqrt(Math.pow(_-tt,2)+Math.pow(B-X,2)-Math.pow(lt,2));let E=Math.sqrt(Math.pow(s-X,2)+Math.pow(w-tt,2));J=J/E;let A=(s-X)*(_-tt)-(w-tt)*(B-X);switch(!0){case A>=0:A=1;break;case A<0:A=-1;break}let m=(s-X)*(B-X)+(w-tt)*(_-tt);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}return lt=Math.abs(lt)*A,J=J*m,{distances:lt,weights:J}}t(O,"getSegmentWeights"),r.startBatch();for(let W of Object.values(r.edges()))if(W.data?.()){let{x:I,y:B}=W.source().position(),{x:_,y:J}=W.target().position();if(I!==_&&B!==J){let lt=W.sourceEndpoint(),X=W.targetEndpoint(),{sourceDir:tt}=Qe(W),[s,w]=he(tt)?[lt.x,X.y]:[X.x,lt.y],{weights:E,distances:A}=O(lt,X,s,w);W.style("segment-distances",A),W.style("segment-weights",E)}}r.endBatch(),Ue(T,()=>N.run())});try{Ue(T,()=>N.run())}catch(O){if(O instanceof RangeError&&O.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw O}r.ready((O)=>{l.info("Ready",O),a(r)})})}t(or,"layoutArchitecture");var Ar=t(async(M,S,D,v)=>{let f=v.db;f.setDiagramId(S);let o=f.getServices(),n=f.getJunctions(),a=f.getGroups(),u=f.getEdges(),r=f.getDataStructures(),y=de(S),i=y.append("g");i.attr("class","architecture-edges");let e=y.append("g");e.attr("class","architecture-services");let g=y.append("g");g.attr("class","architecture-groups"),await wr(f,e,o,S),Cr(f,e,n,S);let d=await or(o,n,a,u,f,r);await Nr(i,d,f,S),await Lr(g,d,f,S),er(f,d),Or(void 0,y,f.getConfigField("padding"),f.getConfigField("useMaxWidth"))},"draw"),Dr={draw:Ar},Hr={parser:Ke,get db(){return new Je},renderer:Dr,styles:Tr};export{Hr as diagram};
|