@kabmo-labs/kabmo 0.61.0 → 0.62.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 +53 -49
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +1157 -825
- package/dist/client/static/js/{Body-ab8wswhm.js → Body-z6kstvk6.js} +3 -3
- package/dist/client/static/js/{CsvGrid-czssywvz.js → CsvGrid-f73c0s4e.js} +2 -2
- package/dist/client/static/js/{DocxView-ke0dwdmt.js → DocxView-a1pb7nsb.js} +3 -3
- package/dist/client/static/js/{DrawioView-a1whhy84.js → DrawioView-r61gcg24.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-dr32dwjy.js → HtmlPreview-vt7j0b05.js} +1 -1
- package/dist/client/static/js/ImageView-4nhr5dtm.js +1 -0
- package/dist/client/static/js/LayoutWrapper-vwhy0vhj.js +2 -0
- package/dist/client/static/js/MergeDiffView-f4h9ss71.js +1 -0
- package/dist/client/static/js/Modal-cadmjkak.js +60 -0
- package/dist/client/static/js/{PdfView-2kdn91f9.js → PdfView-mppt2gkd.js} +1 -1
- package/dist/client/static/js/SessionsView-vvsaw9f0.js +1 -0
- package/dist/client/static/js/{SheetView-ettr9pdw.js → SheetView-5s9zfx9g.js} +9 -9
- package/dist/client/static/js/{SvgPreview-hzcejjry.js → SvgPreview-ff78xn3e.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-kdmv4y72.js → abnfDiagram-O67JEVCF-p29sh3w2.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-83w3kytq.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-qyrwaq0x.js → architectureDiagram-NJMV4G6O-nbpdyea3.js} +3 -3
- package/dist/client/static/js/{astro-yphdvdty.js → astro-qtfmc8x7.js} +1 -1
- package/dist/client/static/js/bash-wcy12qjx.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-tszxy2g7.js → blockDiagram-BEXU5L5S-t8xbexa6.js} +6 -6
- package/dist/client/static/js/c-vvantfth.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-0ye36hhv.js → c4Diagram-YGBWAQC7-9fwf2zxk.js} +3 -3
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-szgk1shv.js → classDiagram-v2-NBCMYWYE-nbapgqbs.js} +4 -4
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-0s9s4mmv.js → cose-bilkent-JH36ORCC-k54mmydp.js} +1 -1
- package/dist/client/static/js/cpp-5x63r6g0.js +1 -0
- package/dist/client/static/js/css-j2j6f03w.js +1 -0
- package/dist/client/static/js/css-qk59j6rj.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-80z02zrj.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-664g28ze.js → cynefinDiagram-VND7K2PF-qdg32wah.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-ga4rp1jx.js → dagre-6A5THRUB-qzshg1vs.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-aagj46ty.js → diagram-22UHCM2B-197hemfa.js} +11 -11
- package/dist/client/static/js/{diagram-3UASUU5V-20qk6whk.js → diagram-3UASUU5V-236gnjr6.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-1vg1tfca.js → diagram-ATOU4E4O-vjgpyaaq.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-90d6jrqs.js → diagram-CDSNMT55-ywvzcx7z.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-8je4z8m1.js → diagram-MLGK6HIB-9ey7ev7j.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-0kzpexsj.js → diagram-MPIPVDR6-vrqbb6r7.js} +2 -2
- package/dist/client/static/js/{dockerfile-5nrbr0ef.js → dockerfile-4nked309.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-47yg36zx.js → ebnfDiagram-ZINNZB2B-hvnkevqy.js} +1 -1
- package/dist/client/static/js/{elixir-3nwnd9yw.js → elixir-3jvh6v4k.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-5hqp6r2d.js → elk-276RUBZZ-nej6yy1c.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-bt9te7r0.js → erDiagram-OPXOYQCR-ww453xcy.js} +5 -5
- package/dist/client/static/js/{erlang-p5c4n3t0.js → erlang-4fz73a1q.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-y9pq2709.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-e6v7513q.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-kzc13swm.js → ganttDiagram-FUAMR5RP-abc5wy70.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-fzaf9azs.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-bjf8aa3j.js → gitGraphDiagram-X574FWY7-4acqzj2h.js} +7 -7
- package/dist/client/static/js/graphql-hpkvdvk7.js +1 -0
- package/dist/client/static/js/html-x12gb1wk.js +1 -0
- package/dist/client/static/js/{index-v88m5sva.js → index-0g82ph6h.js} +2 -2
- package/dist/client/static/js/{index-1fmjhm2d.js → index-0w1jzang.js} +5 -5
- package/dist/client/static/js/{index-kj70d2q9.js → index-1svt0cdw.js} +2 -2
- package/dist/client/static/js/{index-m24sebb0.js → index-1tb4py5v.js} +2 -2
- package/dist/client/static/js/index-2gt9krtj.js +4 -0
- package/dist/client/static/js/index-2x9m7s1a.js +1 -0
- package/dist/client/static/js/index-3fvqmz3m.js +4 -0
- package/dist/client/static/js/{index-k9yf2txw.js → index-42wvbkm5.js} +2 -2
- package/dist/client/static/js/index-477vtt51.js +2 -0
- package/dist/client/static/js/{index-ca6tmamh.js → index-4px56qaz.js} +2 -2
- package/dist/client/static/js/{index-excgtjhx.js → index-5anvw7xg.js} +36 -36
- package/dist/client/static/js/index-5nb9k2ph.js +1 -0
- package/dist/client/static/js/{index-97sw4d9n.js → index-615je3km.js} +2 -2
- package/dist/client/static/js/{index-jz4012t5.js → index-66qxrh5n.js} +1 -1
- package/dist/client/static/js/{index-a145x0w2.js → index-7kct1sz1.js} +2 -2
- package/dist/client/static/js/{index-hwv7bfxc.js → index-8e0d8y30.js} +2 -2
- package/dist/client/static/js/{index-s4j2ghmx.js → index-90bq56xw.js} +2 -2
- package/dist/client/static/js/{index-wsy6y5em.js → index-b1gzh60t.js} +11 -11
- package/dist/client/static/js/{index-10vzyga1.js → index-bypkmjrz.js} +2 -2
- package/dist/client/static/js/{index-n8r7r86r.js → index-c1vd63yd.js} +2 -2
- package/dist/client/static/js/index-c9f0hejv.js +3 -0
- package/dist/client/static/js/{index-2dmew334.js → index-cgqj15g0.js} +2 -2
- package/dist/client/static/js/{index-mtav0rpf.js → index-cts5re1t.js} +2 -2
- package/dist/client/static/js/index-dxc14kmm.js +1 -0
- package/dist/client/static/js/{index-krdz5vby.js → index-dxyjxhm1.js} +2 -2
- package/dist/client/static/js/{index-zr3965k9.js → index-edpyqz9f.js} +1 -1
- package/dist/client/static/js/{index-h7agc069.js → index-eesepb70.js} +2 -2
- package/dist/client/static/js/{index-r38e0rya.js → index-evh437bz.js} +2 -2
- package/dist/client/static/js/index-ey6v4t5b.js +1 -0
- package/dist/client/static/js/{index-025s3fp8.js → index-fsd7n336.js} +2 -2
- package/dist/client/static/js/{index-yfcy4cf6.js → index-h7a7fqag.js} +2 -2
- package/dist/client/static/js/{index-11qn05g9.js → index-hffgwnvz.js} +2 -2
- package/dist/client/static/js/index-j734ev6q.js +482 -0
- package/dist/client/static/js/{index-9g2nzgpx.js → index-jcbp1d9d.js} +6 -6
- package/dist/client/static/js/index-jg5h18sm.js +2 -0
- package/dist/client/static/js/{index-bq9f0mxp.js → index-jtdve6xw.js} +7 -7
- package/dist/client/static/js/{index-kyr612aa.js → index-k0bqrb1y.js} +1 -1
- package/dist/client/static/js/{index-bdtftrym.js → index-kegevd10.js} +2 -2
- package/dist/client/static/js/{index-fr6wsqk8.js → index-kqcfxkch.js} +2 -2
- package/dist/client/static/js/{index-sr14vwn5.js → index-kv1xnem9.js} +2 -2
- package/dist/client/static/js/{index-xy0m8te9.js → index-m54ctmxr.js} +1 -1
- package/dist/client/static/js/index-mgzbypt5.js +314 -0
- package/dist/client/static/js/{index-85jfn1fz.js → index-mh52531j.js} +2 -2
- package/dist/client/static/js/{index-776n5n29.js → index-mhz5ywa4.js} +5 -5
- package/dist/client/static/js/{index-3j2he86h.js → index-nnwdbg3t.js} +2 -2
- package/dist/client/static/js/{index-3x7cbxwq.js → index-nxd6z7f9.js} +2 -2
- package/dist/client/static/js/{index-dabnbvbc.js → index-pjrbt77c.js} +2 -2
- package/dist/client/static/js/index-r7h4pm42.js +2 -0
- package/dist/client/static/js/index-ratrdgc9.js +2 -0
- package/dist/client/static/js/{index-475dc6h9.js → index-rhmvh9w5.js} +2 -2
- package/dist/client/static/js/{index-twwsn91p.js → index-sqzjwy9h.js} +2 -2
- package/dist/client/static/js/{index-z5s9tmj8.js → index-tckzkw0f.js} +2 -2
- package/dist/client/static/js/index-tza9h3q6.css +1 -0
- package/dist/client/static/js/{index-qccydkze.js → index-vhjfr093.js} +2 -2
- package/dist/client/static/js/{index-653x8zdq.js → index-w0j96eyy.js} +8 -8
- package/dist/client/static/js/{index-24a40rw8.js → index-ws04kxy9.js} +1 -1
- package/dist/client/static/js/{index-a3bpmw2r.js → index-x1yqmzpr.js} +2 -2
- package/dist/client/static/js/{index-fb2fjndj.js → index-x2f7wykb.js} +6 -6
- package/dist/client/static/js/index-y8405hdg.js +10 -0
- package/dist/client/static/js/{index-sx83ans2.js → index-yxk7dgnb.js} +2 -2
- package/dist/client/static/js/{index-bkn6jtn1.js → index-zavecxak.js} +2 -2
- package/dist/client/static/js/{index-vn59zz0k.js → index-zg7q3kcb.js} +2 -2
- package/dist/client/static/js/{index-enm77k5z.js → index-zhn9vv3z.js} +2 -2
- package/dist/client/static/js/{index-vgcw01yk.js → index-zy963qbh.js} +1 -1
- package/dist/client/static/js/info-A6RAGUB7-t7pbg7rt.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-jy5zvvj8.js → infoDiagram-VRGFBTTK-9pe7w3r5.js} +2 -2
- package/dist/client/static/js/ini-522adp5a.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-pfky1nnf.js → ishikawaDiagram-OU5B5YK6-38arfrx5.js} +2 -2
- package/dist/client/static/js/java-z0rgs7v6.js +1 -0
- package/dist/client/static/js/javascript-fv87f565.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-mvaf7rfh.js → journeyDiagram-ZHPQQLJL-kcwzjgtz.js} +4 -4
- package/dist/client/static/js/json-1czq1ped.js +1 -0
- package/dist/client/static/js/jsx-1fch2jyr.js +1 -0
- package/dist/client/static/js/{julia-rpd1y9vh.js → julia-pzzxbptm.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-hw2xwe6e.js → kanban-definition-PNTS6WVX-nmegwy9w.js} +15 -15
- package/dist/client/static/js/lua-nn8bpjev.js +1 -0
- package/dist/client/static/js/markdown-38tqrgkn.js +1 -0
- package/dist/client/static/js/{mermaid.core-hsw87hmq.js → mermaid.core-3aae27b9.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-wfe4d846.js → mindmap-definition-NLK3R4M7-zsaq4e65.js} +12 -12
- package/dist/client/static/js/one-dark-pro-trnff03z.js +1 -0
- package/dist/client/static/js/one-light-ck31ptqs.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-rwac7scq.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-cvnmxgst.js → pegDiagram-GJSIUBJH-2b6whj1p.js} +1 -1
- package/dist/client/static/js/{perl-kmtz9dnv.js → perl-zdkbbjd2.js} +1 -1
- package/dist/client/static/js/{php-bttrsbxy.js → php-ktaxff6g.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-gjz20apz.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-0n3gz7sv.js → pieDiagram-5QR66LMP-y09ar7vz.js} +3 -3
- package/dist/client/static/js/properties-kncqeqhn.js +1 -0
- package/dist/client/static/js/python-gx8ggmyh.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-9qqh6xvv.js → quadrantDiagram-O4NWA36T-mapfzs06.js} +3 -3
- package/dist/client/static/js/r-x8rftkm3.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-akwdknab.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-m5v4rfhx.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-k2gmqcjb.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zdsfjf4.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-e98evqb6.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-5f3x3762.js → railroadDiagram-XR7U4H2S-70qy7qdh.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-a68bv6kh.js → requirementDiagram-PLB6GJNP-2vb2gp3e.js} +3 -3
- package/dist/client/static/js/{ruby-dve3y59w.js → ruby-ytqv3pqz.js} +1 -1
- package/dist/client/static/js/{rust-qjhdt4b0.js → rust-6sddyxnt.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-ry7xcphh.js → sankeyDiagram-IPEJSGJF-9jd8ebrn.js} +3 -3
- package/dist/client/static/js/{sass-emxqt5p2.js → sass-dvbra5b6.js} +1 -1
- package/dist/client/static/js/{scss-4j4t3r6y.js → scss-sy7w8916.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-mekzzhet.js → sequenceDiagram-PO4LG4MO-w7z84f80.js} +7 -7
- package/dist/client/static/js/{sizeCapture-INFHLROL-pvc16ame.js → sizeCapture-INFHLROL-q8w7ehgx.js} +1 -1
- package/dist/client/static/js/sql-99y0qnag.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-3ytxby83.js → stateDiagram-v2-GCMORJYK-4978hapr.js} +3 -3
- package/dist/client/static/js/{svelte-dbsx1ehx.js → svelte-xvs3fkza.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-c2zfp416.js → swimlanes-2SLR337P-eshg5fjy.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-914e28hd.js +8 -0
- package/dist/client/static/js/timeline-definition-EJHVYXUP-5h5q357k.js +120 -0
- package/dist/client/static/js/treeView-Q6P3EWNA-fkm3a7gx.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-hm4ktxjf.js +1 -0
- package/dist/client/static/js/tsx-phngprp0.js +1 -0
- package/dist/client/static/js/typescript-m62a7zr2.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-sz6b7bnv.js → usecaseDiagram-POWQR4AR-4j69y3zx.js} +20 -20
- package/dist/client/static/js/vennDiagram-UO4OBE2U-pa9p5jpw.js +34 -0
- package/dist/client/static/js/{vue-hyr58df9.js → vue-p4g4avm3.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-3y2rvdmy.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-xvtyvde9.js → wardleyDiagram-VNRHLVJA-hjddd656.js} +3 -3
- package/dist/client/static/js/xml-59n0cjn6.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-jcs20s84.js → xychartDiagram-PMCCYNJV-8ng5m849.js} +4 -4
- package/dist/client/static/js/yaml-9fw908s4.js +1 -0
- package/dist/client/tailwindcss-oxide.linux-x64-gnu-c0fa36dv.node +0 -0
- package/dist/client/tailwindcss-oxide.linux-x64-musl-kr04sh0e.node +0 -0
- package/marketplace/plugins/command-runner/package.json +2 -2
- package/marketplace/plugins/command-runner/src/app.tsx +2 -5
- package/marketplace/plugins/command-runner/src/panel/CustomForm.tsx +35 -52
- package/marketplace/plugins/command-runner/src/panel/Groups.tsx +6 -5
- package/marketplace/plugins/command-runner/src/panel/Header.tsx +18 -54
- package/marketplace/plugins/command-runner/src/panel/Output.tsx +3 -7
- package/marketplace/plugins/command-runner/src/panel/Row.tsx +19 -38
- package/marketplace/plugins/command-runner/src/panel/index.tsx +1 -4
- package/marketplace/plugins/git-forge/package.json +2 -2
- package/marketplace/plugins/git-forge/src/app.tsx +2 -0
- package/marketplace/plugins/git-forge/src/panel/Credential.tsx +8 -15
- package/marketplace/plugins/git-forge/src/panel/Header.tsx +35 -66
- package/marketplace/plugins/git-forge/src/panel/ItemView.tsx +7 -13
- package/marketplace/plugins/git-forge/src/panel/List.tsx +28 -56
- package/marketplace/plugins/git-forge/src/panel/Row.tsx +7 -9
- package/marketplace/plugins/git-forge/src/panel/Sidebar.tsx +21 -31
- package/marketplace/plugins/git-forge/src/panel/Write.tsx +26 -40
- package/marketplace/plugins/git-forge/src/panel/index.tsx +0 -1
- package/marketplace/plugins/github-actions/package.json +2 -2
- package/marketplace/plugins/github-actions/src/app.tsx +2 -0
- package/marketplace/plugins/github-actions/src/panel/Actions.tsx +9 -17
- package/marketplace/plugins/github-actions/src/panel/LogView.tsx +4 -13
- package/marketplace/plugins/github-actions/src/panel/Row.tsx +4 -5
- package/marketplace/plugins/github-actions/src/panel/RunView.tsx +8 -15
- package/marketplace/plugins/github-actions/src/panel/index.test.tsx +3 -2
- package/marketplace/plugins/github-actions/src/panel/index.tsx +31 -37
- package/marketplace/plugins/kanban/package.json +2 -2
- package/marketplace/plugins/kanban/src/app.tsx +2 -0
- package/marketplace/plugins/kanban/src/panel/CardSheet.tsx +88 -98
- package/marketplace/plugins/kanban/src/panel/CardTile.tsx +6 -10
- package/marketplace/plugins/kanban/src/panel/StageColumn.tsx +22 -18
- package/marketplace/plugins/kanban/src/panel/StageSheet.tsx +59 -70
- package/marketplace/plugins/kanban/src/panel/index.tsx +37 -52
- package/marketplace/plugins/kanban/src/panel/use-board.ts +2 -0
- package/marketplace/plugins/session-info/package.json +2 -2
- package/marketplace/plugins/session-info/src/app.tsx +6 -3
- package/marketplace/plugins/stats/package.json +2 -2
- package/marketplace/plugins/stats/src/KillConfirm.test.tsx +6 -4
- package/marketplace/plugins/stats/src/KillConfirm.tsx +26 -76
- package/marketplace/plugins/stats/src/ProcessTable.tsx +8 -6
- package/marketplace/plugins/stats/src/RefreshButton.tsx +7 -5
- package/marketplace/plugins/stats/src/app.tsx +11 -9
- package/package.json +10 -10
- package/src/cli/lib/commands/plugin.js +8 -5
- package/src/client/bootstrap.d.ts +5 -0
- package/src/client/chat-title-overlay.test.ts +53 -0
- package/src/client/components/auth/login-screen/index.tsx +31 -3
- package/src/client/components/common/SignOutButton.tsx +4 -5
- package/src/client/components/common/account-badge/index.tsx +31 -0
- package/src/client/components/common/footer-version/index.tsx +40 -0
- package/src/client/components/common/fullscreen-viewer/fullscreen-viewer.test.tsx +24 -0
- package/src/client/components/common/fullscreen-viewer/index.tsx +22 -31
- package/src/client/components/common/header-controls/MoreMenu.tsx +5 -56
- package/src/client/components/common/header-controls/index.test.tsx +2 -6
- package/src/client/components/common/header-controls/index.tsx +9 -25
- package/src/client/components/common/header-controls/phone-row.test.tsx +3 -16
- package/src/client/components/common/shell-update-button/index.tsx +2 -2
- package/src/client/components/common/zoom-pan-stage/index.tsx +54 -50
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +4 -5
- package/src/client/components/layout/desktop-layout/index.tsx +2 -4
- package/src/client/components/layout/left-bar/index.tsx +25 -3
- package/src/client/components/layout/rail-toggle.test.tsx +112 -0
- package/src/client/components/layout/session-sidebar/CategoryHeader.accent.test.tsx +81 -0
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +11 -3
- package/src/client/components/layout/session-sidebar/Footer.test.tsx +36 -0
- package/src/client/components/layout/session-sidebar/Footer.tsx +42 -61
- package/src/client/components/layout/session-sidebar/FooterHost.tsx +5 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +30 -10
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +4 -0
- package/src/client/components/layout/session-sidebar/modern/index.tsx +8 -1
- package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +25 -4
- package/src/client/components/layout/session-title-bar/index.tsx +13 -5
- package/src/client/components/layout/top-bars.test.tsx +4 -2
- package/src/client/components/mobile/LayoutWrapper.tsx +3 -1
- package/src/client/components/mobile/RightSidebar.tsx +12 -3
- package/src/client/components/mobile/SessionSidebar.tsx +6 -2
- package/src/client/components/mobile/drawer-layout.test.tsx +7 -3
- package/src/client/components/mobile/drawer-strip.tsx +9 -2
- package/src/client/components/mobile/mobile-main-view/Header.test.tsx +29 -9
- package/src/client/components/mobile/mobile-main-view/Header.tsx +43 -12
- package/src/client/components/mobile/mobile-right-sidebar/Chrome.tsx +12 -1
- package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +9 -2
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +1 -0
- package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +9 -1
- package/src/client/components/mobile/mobile-right-sidebar/StatusBar.tsx +4 -2
- package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +1 -1
- package/src/client/components/mobile/mobile-session-sidebar/Footer.tsx +48 -46
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +18 -1
- package/src/client/components/mobile/mobile-session-sidebar/Item.test.tsx +4 -0
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +4 -6
- package/src/client/components/mobile/right-drawer-nav.test.tsx +53 -1
- package/src/client/components/settings/Band.tsx +5 -2
- package/src/client/components/settings/Modal.tsx +8 -5
- package/src/client/components/settings/Sidebar.tsx +5 -3
- package/src/client/components/settings/apply-side-effects.ts +5 -0
- package/src/client/components/settings/categories/AccountSettings.tsx +266 -0
- package/src/client/components/settings/categories/ProjectSettings.tsx +2 -0
- package/src/client/components/settings/categories/account-settings/Dialogs.tsx +223 -0
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.test.tsx +3 -4
- package/src/client/components/settings/categories/appearance-settings/ChromeStyleSection.tsx +66 -39
- package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +7 -4
- package/src/client/components/settings/categories/project-settings/DetailsForm.tsx +14 -1
- package/src/client/components/settings/categories/project-settings/ProjectSharing.tsx +130 -0
- package/src/client/components/settings/categories/project-settings/SidebarList.tsx +5 -0
- package/src/client/components/settings/category-content.tsx +3 -0
- package/src/client/components/workspace/chat-timeline/AiMessageFooterSheet.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/ComposerDockFrame.tsx +2 -1
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/SessionSkeleton.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +9 -2
- package/src/client/components/workspace/chat-timeline/chat-input/expansion.test.ts +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/expansion.ts +2 -1
- package/src/client/components/workspace/chat-timeline/chat-input/narrow.test.tsx +34 -0
- package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +9 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/styles.test.tsx +4 -1
- package/src/client/components/workspace/editor/Tab.tsx +19 -26
- package/src/client/components/workspace/editor/Tabs.test.ts +13 -7
- package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +1 -0
- package/src/client/components/workspace/git-panel/commit-modal/floating.test.ts +46 -0
- package/src/client/components/workspace/git-panel/commit-modal/index.tsx +2 -0
- package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +4 -5
- package/src/client/components/workspace/panel-tabs/TabChip.tsx +40 -39
- package/src/client/components/workspace/panel-tabs/TabStrip.connected.test.tsx +76 -58
- package/src/client/components/workspace/panel-tabs/TabStrip.test.tsx +9 -9
- package/src/client/components/workspace/panel-tabs/TabStrip.tsx +14 -1
- package/src/client/components/workspace/panel-tabs/index.tsx +1 -1
- package/src/client/components/workspace/plugin-panel/catalog.tsx +22 -5
- package/src/client/components/workspace/plugin-panel/chrome.test.tsx +89 -0
- package/src/client/components/workspace/plugin-panel/chrome.tsx +62 -0
- package/src/client/data/settings/omp-schema.json +40 -4
- package/src/client/floating-phone.test.ts +189 -0
- package/src/client/floating.css +205 -2
- package/src/client/floating.test.ts +43 -0
- package/src/client/glass.css +47 -0
- package/src/client/hooks/chat/omp/index.ts +6 -5
- package/src/client/hooks/chat/omp/prompt-send.test.ts +18 -0
- package/src/client/hooks/chat/omp/prompt-send.ts +26 -8
- package/src/client/hooks/chat/omp/session-list.tsx +20 -8
- package/src/client/hooks/chat/timeline/deferred-model.ts +13 -5
- package/src/client/hooks/chat/timeline/index.ts +2 -0
- package/src/client/hooks/chat/timeline/send-props.ts +14 -0
- package/src/client/hooks/chat/timeline/send-steer.test.ts +11 -2
- package/src/client/hooks/chat/timeline/send-switch.test.ts +92 -0
- package/src/client/hooks/chat/timeline/send.test-util.ts +37 -7
- package/src/client/hooks/chat/timeline/send.test.ts +11 -2
- package/src/client/hooks/chat/timeline/send.ts +62 -42
- package/src/client/hooks/editor/image-generation.ts +24 -0
- package/src/client/hooks/editor/resolve-viewer.test.ts +26 -20
- package/src/client/hooks/editor/resolve-viewer.ts +14 -5
- package/src/client/hooks/editor/use-file-editor.test.ts +34 -0
- package/src/client/hooks/editor/use-file-editor.ts +6 -2
- package/src/client/hooks/settings/accounts.ts +162 -0
- package/src/client/hooks/ui/auth.ts +58 -3
- package/src/client/hooks/ui/border-style.test.ts +5 -4
- package/src/client/hooks/ui/border-style.ts +3 -2
- package/src/client/hooks/ui/mobile-chrome-style.ts +68 -0
- package/src/client/hooks/ui/navbar-controls.test.ts +1 -2
- package/src/client/hooks/ui/navbar-controls.ts +0 -3
- package/src/client/hooks/ui/zoom-gesture.ts +104 -0
- package/src/client/lib/desktop/titlebar.test.ts +21 -0
- package/src/client/lib/desktop/titlebar.ts +34 -0
- package/src/client/lib/plugins/bootstrap.test.ts +20 -0
- package/src/client/lib/plugins/bootstrap.tsx +10 -15
- package/src/client/lib/plugins/kit-components.test.tsx +119 -0
- package/src/client/lib/plugins/kit-components.tsx +79 -0
- package/src/client/lib/plugins/kit.ts +8 -0
- package/src/client/lib/plugins/slots.test.ts +34 -0
- package/src/client/lib/plugins/slots.ts +31 -4
- package/src/client/lib/plugins/stylesheets.ts +10 -11
- package/src/client/lib/ui/pinch.test.ts +74 -0
- package/src/client/lib/ui/pinch.ts +104 -0
- package/src/client/lib/ui/safe-area.test.ts +25 -0
- package/src/client/lib/ui/safe-area.ts +23 -0
- package/src/client/main.tsx +8 -1
- package/src/client/tailwind.css +54 -1
- package/src/server/index.ts +2 -0
- package/src/server/lib/assets/shell-attributes.server.ts +12 -4
- package/src/server/lib/assets/shell-attributes.test.ts +19 -18
- package/src/server/lib/auth/client-address.test.ts +2 -2
- package/src/server/lib/auth/guard.test.ts +2 -2
- package/src/server/lib/auth/guard.ts +81 -97
- package/src/server/lib/auth/handover-guard.test.ts +1 -1
- package/src/server/lib/auth/rate-limit.test.ts +2 -2
- package/src/server/lib/auth/token.test.ts +1 -1
- package/src/server/lib/auth/workspace-gate.server.ts +34 -0
- package/src/server/lib/bundler/css.test.ts +16 -0
- package/src/server/lib/connect/devices.server.test.ts +12 -0
- package/src/server/lib/connect/devices.server.ts +63 -19
- package/src/server/lib/connect/pairing.server.ts +5 -3
- package/src/server/lib/connect/status.server.ts +2 -2
- package/src/server/lib/db/schema.test.ts +3 -3
- package/src/server/lib/db/schema.ts +6 -0
- package/src/server/lib/harness/update-spawn.server.test.ts +97 -0
- package/src/server/lib/harness/update-spawn.server.ts +10 -0
- package/src/server/lib/models/provider-icon-override.server.test.ts +140 -0
- package/src/server/lib/models/provider-icon-override.server.ts +197 -0
- package/src/server/lib/models/provider-icon-store.server.ts +8 -0
- package/src/server/lib/models/provider-icon.server.ts +31 -6
- package/src/server/lib/omp/session/artifacts.server.test.ts +11 -7
- package/src/server/lib/omp/session/artifacts.server.ts +21 -17
- package/src/server/lib/panels/build.server.ts +19 -2
- package/src/server/lib/panels/css.server.test.ts +141 -0
- package/src/server/lib/panels/css.server.ts +255 -0
- package/src/server/lib/panels/plugin-ui-contract.test.ts +64 -0
- package/src/server/lib/panels/registry-stylesheet.server.test.ts +69 -0
- package/src/server/lib/panels/scan.server.ts +13 -7
- package/src/server/lib/panels/source-warnings.server.test.ts +65 -0
- package/src/server/lib/panels/source-warnings.server.ts +71 -0
- package/src/server/lib/realtime/topics/catalog.server.ts +3 -0
- package/src/server/lib/realtime/topics.server.ts +14 -0
- package/src/server/lib/sessions/last-opened-client.server.ts +1 -1
- package/src/server/lib/workspace/access.server.ts +108 -0
- package/src/server/lib/workspace/project-patch.server.ts +4 -2
- package/src/server/lib/workspace/register-folder.server.ts +19 -5
- package/src/server/lib/workspace/session-access.server.ts +55 -0
- package/src/server/lib/workspace/tenancy-schema.server.ts +40 -0
- package/src/server/plugins/ssr.ts +19 -3
- package/src/server/routes/accounts/index.ts +8 -0
- package/src/server/routes/accounts/management.test.ts +174 -0
- package/src/server/routes/accounts/management.ts +166 -0
- package/src/server/routes/auth/login.ts +22 -8
- package/src/server/routes/auth/logout.ts +1 -1
- package/src/server/routes/auth/password.ts +40 -33
- package/src/server/routes/auth/revoke.test.ts +1 -1
- package/src/server/routes/auth/revoke.ts +26 -8
- package/src/server/routes/auth/routes.test.ts +3 -3
- package/src/server/routes/auth/state.ts +14 -7
- package/src/server/routes/connect/devices.ts +7 -4
- package/src/server/routes/connect/pair.ts +4 -3
- package/src/server/routes/connect/status.ts +4 -2
- package/src/server/routes/connect/tunnels.ts +2 -1
- package/src/server/routes/folders/batch-delete.ts +12 -0
- package/src/server/routes/folders/clone.ts +7 -2
- package/src/server/routes/folders/create.ts +3 -1
- package/src/server/routes/folders/folder.ts +44 -4
- package/src/server/routes/folders/index.ts +3 -0
- package/src/server/routes/folders/shares.ts +62 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/panels/build.ts +1 -1
- package/src/server/routes/panels/css.test.ts +22 -0
- package/src/server/routes/panels/css.ts +5 -7
- package/src/server/routes/realtime/ws.ts +16 -1
- package/src/server/routes/sessions/list.ts +3 -2
- package/src/server/routes/settings/projects.ts +46 -7
- package/src/server/routes/settings/provider-icon.ts +18 -0
- package/src/shared/lib/chat/timeline/tool-render-mode.test.ts +2 -2
- package/src/shared/lib/chat/timeline/tool-render-mode.ts +6 -3
- package/src/shared/lib/icons/tint-hues.generated.ts +38 -37
- package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +27 -1
- package/src/shared/lib/omp/session/prewarm-misc.test.ts +1 -1
- package/src/shared/lib/realtime/protocol.ts +16 -0
- package/src/shared/lib/settings/defaults.ts +2 -1
- package/src/shared/lib/settings/sections.ts +1 -1
- package/src/shared/lib/theme/border-style.test.ts +11 -9
- package/src/shared/lib/theme/border-style.ts +7 -7
- package/src/shared/lib/theme/chrome-style.test.ts +15 -0
- package/src/shared/lib/theme/chrome-style.ts +16 -1
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/settings/state.ts +6 -5
- package/src/test-support/file-editor.test-util.ts +25 -6
- package/tsconfig.json +21 -0
- package/dist/client/static/js/ImageView-zf4kh5wp.js +0 -1
- package/dist/client/static/js/LayoutWrapper-dncbzcea.js +0 -2
- package/dist/client/static/js/MergeDiffView-btdx9yb9.js +0 -1
- package/dist/client/static/js/Modal-5cxfw2rv.js +0 -60
- package/dist/client/static/js/SessionsView-vbn0nvx4.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-sxrkxwbq.js +0 -1
- package/dist/client/static/js/bash-bcbct9gc.js +0 -1
- package/dist/client/static/js/c-fn9jz26e.js +0 -1
- package/dist/client/static/js/cpp-a1q64mke.js +0 -1
- package/dist/client/static/js/css-b92azee8.js +0 -1
- package/dist/client/static/js/css-sn00sq6v.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-g1xwa8b9.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-05p61bka.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-500fcx2a.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-z1yehwys.js +0 -1
- package/dist/client/static/js/graphql-8d8bn59j.js +0 -1
- package/dist/client/static/js/html-6hdrwtz2.js +0 -1
- package/dist/client/static/js/index-0kcnghxn.js +0 -4
- package/dist/client/static/js/index-2zhmmtye.js +0 -2
- package/dist/client/static/js/index-4vtc4xct.js +0 -481
- package/dist/client/static/js/index-5srvxsht.js +0 -2
- package/dist/client/static/js/index-6c1s0v4b.js +0 -1
- package/dist/client/static/js/index-cvm2ha01.js +0 -1
- package/dist/client/static/js/index-d11mbz2q.js +0 -4
- package/dist/client/static/js/index-fen0x3qh.js +0 -1
- package/dist/client/static/js/index-gwgh27h3.js +0 -314
- package/dist/client/static/js/index-hxy1sadd.js +0 -2
- package/dist/client/static/js/index-pg87cgpy.js +0 -2
- package/dist/client/static/js/index-q1a40v20.js +0 -3
- package/dist/client/static/js/index-qmvstmvh.js +0 -1
- package/dist/client/static/js/index-t6nqy2n5.css +0 -1
- package/dist/client/static/js/index-wf5j0009.js +0 -10
- package/dist/client/static/js/index-y6zbkh4p.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-dqyaxjc1.js +0 -1
- package/dist/client/static/js/ini-g6a5xsaw.js +0 -1
- package/dist/client/static/js/java-n596am4c.js +0 -1
- package/dist/client/static/js/javascript-zc1qnyyp.js +0 -1
- package/dist/client/static/js/json-7k70qbkj.js +0 -1
- package/dist/client/static/js/jsx-sndenqrc.js +0 -1
- package/dist/client/static/js/lua-djd3g9q5.js +0 -1
- package/dist/client/static/js/markdown-r2tpvxpn.js +0 -1
- package/dist/client/static/js/one-dark-pro-ckq5capv.js +0 -1
- package/dist/client/static/js/one-light-a908z398.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-7jxzax4z.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-wc9wxr7f.js +0 -1
- package/dist/client/static/js/properties-brn72zdk.js +0 -1
- package/dist/client/static/js/python-g9mghwgm.js +0 -1
- package/dist/client/static/js/r-e247x4mw.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-kwj5padj.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-h8sdx3w5.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-2wmwx246.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-h4cdgw3y.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-q7m0tfd0.js +0 -1
- package/dist/client/static/js/sql-0kar81jy.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-9gm67sq4.js +0 -8
- package/dist/client/static/js/timeline-definition-EJHVYXUP-xtvv4za2.js +0 -120
- package/dist/client/static/js/treeView-Q6P3EWNA-yv9640h3.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-7kpzjg21.js +0 -1
- package/dist/client/static/js/tsx-gjxfjnbk.js +0 -1
- package/dist/client/static/js/typescript-bm89v3gk.js +0 -1
- package/dist/client/static/js/vennDiagram-UO4OBE2U-56q0qs51.js +0 -34
- package/dist/client/static/js/wardley-WFR3VGLG-mggay64p.js +0 -1
- package/dist/client/static/js/xml-b7824nx0.js +0 -1
- package/dist/client/static/js/yaml-kqqktdv1.js +0 -1
- package/src/server/lib/auth/client-address.ts +0 -89
- package/src/server/lib/auth/config.ts +0 -133
- package/src/server/lib/auth/rate-limit.ts +0 -146
- package/src/server/lib/auth/token.ts +0 -220
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{xe}from"./index-5srvxsht.js";import{t,l,Y,C,te,oa,F,z,j,U,H,W,q,m,b,Ae,rA,is,yr,ue,Fn,bn}from"./index-gwgh27h3.js";import{je}from"./index-excgtjhx.js";import{ra}from"./index-fb2fjndj.js";import{xn,zn}from"./index-v88m5sva.js";var Re=zn(function(ye,Ie){(function(x,M){if(typeof ye==="object"&&typeof Ie==="object")Ie.exports=M();else if(typeof define==="function"&&define.amd)define([],M);else if(typeof ye==="object")ye.layoutBase=M();else x.layoutBase=M()})(ye,function(){return function(L){var x={};function M(d){if(x[d])return x[d].exports;var h=x[d]={i:d,l:!1,exports:{}};return L[d].call(h.exports,h,h.exports,M),h.l=!0,h.exports}return M.m=L,M.c=x,M.i=function(d){return d},M.d=function(d,h,o){if(!M.o(d,h))Object.defineProperty(d,h,{configurable:!1,enumerable:!0,get:o})},M.n=function(d){var h=d&&d.__esModule?function(){return d.default}:function(){return d};return M.d(h,"a",h),h},M.o=function(d,h){return Object.prototype.hasOwnProperty.call(d,h)},M.p="",M(M.s=28)}([function(L,x,M){function d(){}d.QUALITY=1,d.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,d.DEFAULT_INCREMENTAL=!1,d.DEFAULT_ANIMATION_ON_LAYOUT=!0,d.DEFAULT_ANIMATION_DURING_LAYOUT=!1,d.DEFAULT_ANIMATION_PERIOD=50,d.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,d.DEFAULT_GRAPH_MARGIN=15,d.NODE_DIMENSIONS_INCLUDE_LABELS=!1,d.SIMPLE_NODE_SIZE=40,d.SIMPLE_NODE_HALF_SIZE=d.SIMPLE_NODE_SIZE/2,d.EMPTY_COMPOUND_NODE_SIZE=40,d.MIN_EDGE_LENGTH=1,d.WORLD_BOUNDARY=1e6,d.INITIAL_WORLD_BOUNDARY=d.WORLD_BOUNDARY/1000,d.WORLD_CENTER_X=1200,d.WORLD_CENTER_Y=900,L.exports=d},function(L,x,M){var d=M(2),h=M(8),o=M(9);function n(g,r,v){d.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=g,this.target=r}n.prototype=Object.create(d.prototype);for(var a in d)n[a]=d[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(g){if(this.source===g)return this.target;else if(this.target===g)return this.source;else throw"Node is not incident with this edge"},n.prototype.getOtherEndInGraph=function(g,r){var v=this.getOtherEnd(g),i=r.getGraphManager().getRoot();while(!0){if(v.getOwner()==r)return v;if(v.getOwner()==i)break;v=v.getOwner().getParent()}return null},n.prototype.updateLength=function(){var g=[,,,,];if(this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),g),!this.isOverlapingSourceAndTarget){if(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[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)},L.exports=n},function(L,x,M){function d(h){this.vGraphObject=h}L.exports=d},function(L,x,M){var d=M(2),h=M(10),o=M(13),n=M(0),a=M(16),g=M(5);function r(i,e,c,u){if(c==null&&u==null)u=e;if(d.call(this,u),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=u,this.edges=[],this.graphManager=i,c!=null&&e!=null)this.rect=new o(e.x,e.y,c.width,c.height);else this.rect=new o}r.prototype=Object.create(d.prototype);for(var v in d)r[v]=d[v];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 g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new g(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=[],c,u=this;return u.edges.forEach(function(f){if(f.target==i){if(f.source!=u)throw"Incorrect edge source!";e.push(f)}}),e},r.prototype.getEdgesBetween=function(i){var e=[],c,u=this;return u.edges.forEach(function(f){if(!(f.source==u||f.target==u))throw"Incorrect edge source and/or target";if(f.target==i||f.source==i)e.push(f)}),e},r.prototype.getNeighborsList=function(){var i=new Set,e=this;return e.edges.forEach(function(c){if(c.source==e)i.add(c.target);else{if(c.target!=e)throw"Incorrect incidency!";i.add(c.source)}}),i},r.prototype.withChildren=function(){var i=new Set,e,c;if(i.add(this),this.child!=null){var u=this.child.getNodes();for(var f=0;f<u.length;f++)e=u[f],c=e.withChildren(),c.forEach(function(D){i.add(D)})}return i},r.prototype.getNoOfChildren=function(){var i=0,e;if(this.child==null)i=1;else{var c=this.child.getNodes();for(var u=0;u<c.length;u++)e=c[u],i+=e.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.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,c=-n.INITIAL_WORLD_BOUNDARY,u=n.INITIAL_WORLD_BOUNDARY;i=n.WORLD_CENTER_X+a.nextDouble()*(u-c)+c;var f=-n.INITIAL_WORLD_BOUNDARY,D=n.INITIAL_WORLD_BOUNDARY;e=n.WORLD_CENTER_Y+a.nextDouble()*(D-f)+f,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(),c=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(c+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>c)this.rect.y-=(this.labelHeight-c)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(c+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.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 c=this.rect.y;if(c>n.WORLD_BOUNDARY)c=n.WORLD_BOUNDARY;else if(c<-n.WORLD_BOUNDARY)c=-n.WORLD_BOUNDARY;var u=new g(e,c),f=i.inverseTransformPoint(u);this.setLocation(f.x,f.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()},L.exports=r},function(L,x,M){var d=M(0);function h(){}for(var o in d)h[o]=d[o];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=0.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=0.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,h.COOLING_ADAPTATION_FACTOR=0.33,h.ADAPTATION_LOWER_NODE_LIMIT=1000,h.ADAPTATION_UPPER_NODE_LIMIT=5000,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,L.exports=h},function(L,x,M){function d(h,o){if(h==null&&o==null)this.x=0,this.y=0;else this.x=h,this.y=o}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.setX=function(h){this.x=h},d.prototype.setY=function(h){this.y=h},d.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},d.prototype.getCopy=function(){return new d(this.x,this.y)},d.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},L.exports=d},function(L,x,M){var d=M(2),h=M(10),o=M(0),n=M(7),a=M(3),g=M(1),r=M(13),v=M(12),i=M(11);function e(u,f,D){if(d.call(this,D),this.estimatedSize=h.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=u,f!=null&&f instanceof n)this.graphManager=f;else if(f!=null&&f instanceof Layout)this.graphManager=f.graphManager}e.prototype=Object.create(d.prototype);for(var c in d)e[c]=d[c];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(u,f,D){if(f==null&&D==null){var E=u;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(E)>-1)throw"Node already in graph!";return E.owner=this,this.getNodes().push(E),E}else{var T=u;if(!(this.getNodes().indexOf(f)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(f.owner==D.owner&&f.owner==this))throw"Both owners must be this graph!";if(f.owner!=D.owner)return null;if(T.source=f,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),f.edges.push(T),D!=f)D.edges.push(T);return T}},e.prototype.remove=function(u){var f=u;if(u instanceof a){if(f==null)throw"Node is null!";if(!(f.owner!=null&&f.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var D=f.edges.slice(),E,T=D.length;for(var A=0;A<T;A++)if(E=D[A],E.isInterGraph)this.graphManager.remove(E);else E.source.owner.remove(E);var G=this.nodes.indexOf(f);if(G==-1)throw"Node not in owner node list!";this.nodes.splice(G,1)}else if(u instanceof g){var E=u;if(E==null)throw"Edge is null!";if(!(E.source!=null&&E.target!=null))throw"Source and/or target is null!";if(!(E.source.owner!=null&&E.target.owner!=null&&E.source.owner==this&&E.target.owner==this))throw"Source and/or target owner is invalid!";var O=E.source.edges.indexOf(E),V=E.target.edges.indexOf(E);if(!(O>-1&&V>-1))throw"Source and/or target doesn't know this edge!";if(E.source.edges.splice(O,1),E.target!=E.source)E.target.edges.splice(V,1);var G=E.source.owner.getEdges().indexOf(E);if(G==-1)throw"Not in owner's edge list!";E.source.owner.getEdges().splice(G,1)}},e.prototype.updateLeftTop=function(){var{MAX_VALUE:u,MAX_VALUE:f}=h,D,E,T,A=this.getNodes(),G=A.length;for(var O=0;O<G;O++){var V=A[O];if(D=V.getTop(),E=V.getLeft(),u>D)u=D;if(f>E)f=E}if(u==h.MAX_VALUE)return null;if(A[0].getParent().paddingLeft!=null)T=A[0].getParent().paddingLeft;else T=this.margin;return this.left=f-T,this.top=u-T,new v(this.left,this.top)},e.prototype.updateBounds=function(u){var f=h.MAX_VALUE,D=-h.MAX_VALUE,E=h.MAX_VALUE,T=-h.MAX_VALUE,A,G,O,V,_,Q=this.nodes,lt=Q.length;for(var S=0;S<lt;S++){var tt=Q[S];if(u&&tt.child!=null)tt.updateBounds();if(A=tt.getLeft(),G=tt.getRight(),O=tt.getTop(),V=tt.getBottom(),f>A)f=A;if(D<G)D=G;if(E>O)E=O;if(T<V)T=V}var s=new r(f,E,D-f,T-E);if(f==h.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(u){var f=h.MAX_VALUE,D=-h.MAX_VALUE,E=h.MAX_VALUE,T=-h.MAX_VALUE,A,G,O,V,_=u.length;for(var Q=0;Q<_;Q++){var lt=u[Q];if(A=lt.getLeft(),G=lt.getRight(),O=lt.getTop(),V=lt.getBottom(),f>A)f=A;if(D<G)D=G;if(E>O)E=O;if(T<V)T=V}var S=new r(f,E,D-f,T-E);return S},e.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){var u=0,f=this.nodes,D=f.length;for(var E=0;E<D;E++){var T=f[E];u+=T.calcEstimatedSize()}if(u==0)this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=u/Math.sqrt(this.nodes.length);return this.estimatedSize},e.prototype.updateConnected=function(){var u=this;if(this.nodes.length==0){this.isConnected=!0;return}var f=new i,D=new Set,E=this.nodes[0],T,A,G=E.withChildren();G.forEach(function(S){f.push(S),D.add(S)});while(f.length!==0){E=f.shift(),T=E.getEdges();var O=T.length;for(var V=0;V<O;V++){var _=T[V];if(A=_.getOtherEndInGraph(E,this),A!=null&&!D.has(A)){var Q=A.withChildren();Q.forEach(function(S){f.push(S),D.add(S)})}}}if(this.isConnected=!1,D.size>=this.nodes.length){var lt=0;if(D.forEach(function(S){if(S.owner==u)lt++}),lt==this.nodes.length)this.isConnected=!0}},L.exports=e},function(L,x,M){var d,h=M(1);function o(n){d=M(6),this.layout=n,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var n=this.layout.newGraph(),a=this.layout.newNode(null),g=this.add(n,a);return this.setRootGraph(g),this.rootGraph},o.prototype.add=function(n,a,g,r,v){if(g==null&&r==null&&v==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{v=g,r=a,g=n;var i=r.getOwner(),e=v.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 g.isInterGraph=!1,i.add(g,r,v);else{if(g.isInterGraph=!0,g.source=r,g.target=v,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}}},o.prototype.remove=function(n){if(n instanceof d){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 g=[];g=g.concat(a.getEdges());var r,v=g.length;for(var i=0;i<v;i++)r=g[i],a.remove(r);var e=[];e=e.concat(a.getNodes());var c;v=e.length;for(var i=0;i<v;i++)c=e[i],a.remove(c);if(a==this.rootGraph)this.setRootGraph(null);var u=this.graphs.indexOf(a);this.graphs.splice(u,1),a.parent=null}else if(n instanceof h){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 u=r.source.edges.indexOf(r);if(r.source.edges.splice(u,1),u=r.target.edges.indexOf(r),r.target.edges.splice(u,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 u=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(u,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(),g=a.length;for(var r=0;r<g;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(),g=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 g=n.getOwner(),r;do{if(r=g.getParent(),r==null)break;if(r==a)return!0;if(g=r.getOwner(),g==null)break}while(!0);g=a.getOwner();do{if(r=g.getParent(),r==null)break;if(r==n)return!0;if(g=r.getOwner(),g==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){var n,a,g,r,v,i=this.getAllEdges(),e=i.length;for(var c=0;c<e;c++){if(n=i[c],a=n.source,g=n.target,n.lca=null,n.sourceInLca=a,n.targetInLca=g,a==g){n.lca=a.getOwner();continue}r=a.getOwner();while(n.lca==null){n.targetInLca=g,v=g.getOwner();while(n.lca==null){if(v==r){n.lca=v;break}if(v==this.rootGraph)break;if(n.lca!=null)throw"assert failed";n.targetInLca=v.getParent(),v=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 g=n.getOwner();do{if(g==null)break;var r=a.getOwner();do{if(r==null)break;if(r==g)return r;r=r.getParent().getOwner()}while(!0);g=g.getParent().getOwner()}while(!0);return g},o.prototype.calcInclusionTreeDepths=function(n,a){if(n==null&&a==null)n=this.rootGraph,a=1;var g,r=n.getNodes(),v=r.length;for(var i=0;i<v;i++)if(g=r[i],g.inclusionTreeDepth=a,g.child!=null)this.calcInclusionTreeDepths(g.child,a+1)},o.prototype.includesInvalidEdge=function(){var n,a=[],g=this.edges.length;for(var r=0;r<g;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},L.exports=o},function(L,x,M){var d=M(12);function h(){}h.calcSeparationAmount=function(o,n,a,g){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 v=Math.abs((n.getCenterY()-o.getCenterY())/(n.getCenterX()-o.getCenterX()));if(n.getCenterY()===o.getCenterY()&&n.getCenterX()===o.getCenterX())v=1;var i=v*a[0],e=a[1]/v;if(a[0]<e)e=a[0];else i=a[1];a[0]=-1*r[0]*(e/2+g),a[1]=-1*r[1]*(i/2+g)},h.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},h.getIntersection2=function(o,n,a){var g=o.getCenterX(),r=o.getCenterY(),v=n.getCenterX(),i=n.getCenterY();if(o.intersects(n))return a[0]=g,a[1]=r,a[2]=v,a[3]=i,!0;var e=o.getX(),c=o.getY(),u=o.getRight(),f=o.getX(),D=o.getBottom(),E=o.getRight(),T=o.getWidthHalf(),A=o.getHeightHalf(),G=n.getX(),O=n.getY(),V=n.getRight(),_=n.getX(),Q=n.getBottom(),lt=n.getRight(),S=n.getWidthHalf(),tt=n.getHeightHalf(),s=!1,N=!1;if(g===v){if(r>i)return a[0]=g,a[1]=c,a[2]=v,a[3]=Q,!1;else if(r<i)return a[0]=g,a[1]=D,a[2]=v,a[3]=O,!1}else if(r===i){if(g>v)return a[0]=e,a[1]=r,a[2]=V,a[3]=i,!1;else if(g<v)return a[0]=u,a[1]=r,a[2]=G,a[3]=i,!1}else{var y=o.height/o.width,w=n.height/n.width,p=(i-r)/(v-g),P=void 0,R=void 0,k=void 0,B=void 0,X=void 0,st=void 0;if(-y===p)if(g>v)a[0]=f,a[1]=D,s=!0;else a[0]=u,a[1]=c,s=!0;else if(y===p)if(g>v)a[0]=e,a[1]=c,s=!0;else a[0]=E,a[1]=D,s=!0;if(-w===p)if(v>g)a[2]=_,a[3]=Q,N=!0;else a[2]=V,a[3]=O,N=!0;else if(w===p)if(v>g)a[2]=G,a[3]=O,N=!0;else a[2]=lt,a[3]=Q,N=!0;if(s&&N)return!1;if(g>v)if(r>i)P=this.getCardinalDirection(y,p,4),R=this.getCardinalDirection(w,p,2);else P=this.getCardinalDirection(-y,p,3),R=this.getCardinalDirection(-w,p,1);else if(r>i)P=this.getCardinalDirection(-y,p,1),R=this.getCardinalDirection(-w,p,3);else P=this.getCardinalDirection(y,p,2),R=this.getCardinalDirection(w,p,4);if(!s)switch(P){case 1:B=c,k=g+-A/p,a[0]=k,a[1]=B;break;case 2:k=E,B=r+T*p,a[0]=k,a[1]=B;break;case 3:B=D,k=g+A/p,a[0]=k,a[1]=B;break;case 4:k=f,B=r+-T*p,a[0]=k,a[1]=B;break}if(!N)switch(R){case 1:st=O,X=v+-tt/p,a[2]=X,a[3]=st;break;case 2:X=lt,st=i+S*p,a[2]=X,a[3]=st;break;case 3:st=Q,X=v+tt/p,a[2]=X,a[3]=st;break;case 4:X=_,st=i+-S*p,a[2]=X,a[3]=st;break}}return!1},h.getCardinalDirection=function(o,n,a){if(o>n)return a;else return 1+a%4},h.getIntersection=function(o,n,a,g){if(g==null)return this.getIntersection2(o,n,a);var{x:r,y:v}=o,{x:i,y:e}=n,{x:c,y:u}=a,{x:f,y:D}=g,E=void 0,T=void 0,A=void 0,G=void 0,O=void 0,V=void 0,_=void 0,Q=void 0,lt=void 0;if(A=e-v,O=r-i,_=i*v-r*e,G=D-u,V=c-f,Q=f*u-c*D,lt=A*V-G*O,lt===0)return null;return E=(O*Q-V*_)/lt,T=(G*_-A*Q)/lt,new d(E,T)},h.angleOfVector=function(o,n,a,g){var r=void 0;if(o!==a){if(r=Math.atan((g-n)/(a-o)),a<o)r+=Math.PI;else if(g<n)r+=this.TWO_PI}else if(g<n)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},h.doIntersect=function(o,n,a,g){var{x:r,y:v}=o,{x:i,y:e}=n,{x:c,y:u}=a,{x:f,y:D}=g,E=(i-r)*(D-u)-(f-c)*(e-v);if(E===0)return!1;else{var T=((D-u)*(f-r)+(c-f)*(D-v))/E,A=((v-e)*(f-r)+(i-r)*(D-v))/E;return 0<T&&T<1&&0<A&&A<1}},h.findCircleLineIntersections=function(o,n,a,g,r,v,i){var e=(a-o)*(a-o)+(g-n)*(g-n),c=2*((o-r)*(a-o)+(n-v)*(g-n)),u=(o-r)*(o-r)+(n-v)*(n-v)-i*i,f=c*c-4*e*u;if(f>=0){var D=(-c+Math.sqrt(c*c-4*e*u))/(2*e),E=(-c-Math.sqrt(c*c-4*e*u))/(2*e),T=null;if(D>=0&&D<=1)return[D];if(E>=0&&E<=1)return[E];return T}else return null},h.HALF_PI=0.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,L.exports=h},function(L,x,M){function d(){}d.sign=function(h){if(h>0)return 1;else if(h<0)return-1;else return 0},d.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},d.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},L.exports=d},function(L,x,M){function d(){}d.MAX_VALUE=2147483647,d.MIN_VALUE=-2147483648,L.exports=d},function(L,x,M){var d=function(){function r(v,i){for(var e=0;e<i.length;e++){var c=i[e];if(c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c)c.writable=!0;Object.defineProperty(v,c.key,c)}}return function(v,i,e){if(i)r(v.prototype,i);if(e)r(v,e);return v}}();function h(r,v){if(!(r instanceof v))throw TypeError("Cannot call a class as a function")}var o=function(v){return{value:v,next:null,prev:null}},n=function(v,i,e,c){if(v!==null)v.next=i;else c.head=i;if(e!==null)e.prev=i;else c.tail=i;return i.prev=v,i.next=e,c.length++,i},a=function(v,i){var{prev:e,next:c}=v;if(e!==null)e.next=c;else i.head=c;if(c!==null)c.prev=e;else i.tail=e;return v.prev=v.next=null,i.length--,v},g=function(){function r(v){var i=this;if(h(this,r),this.length=0,this.head=null,this.tail=null,v!=null)v.forEach(function(e){return i.push(e)})}return d(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,c=this.head;while(e<i)c=c.next,e++;return c.value}}},{key:"set_object_at",value:function(i,e){if(i<=this.length()){var c=1,u=this.head;while(c<i)u=u.next,c++;u.value=e}}}]),r}();L.exports=g},function(L,x,M){function d(h,o,n){if(this.x=null,this.y=null,h==null&&o==null&&n==null)this.x=0,this.y=0;else if(typeof h=="number"&&typeof o=="number"&&n==null)this.x=h,this.y=o;else if(h.constructor.name=="Point"&&o==null&&n==null)n=h,this.x=n.x,this.y=n.y}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.getLocation=function(){return new d(this.x,this.y)},d.prototype.setLocation=function(h,o,n){if(h.constructor.name=="Point"&&o==null&&n==null)n=h,this.setLocation(n.x,n.y);else if(typeof h=="number"&&typeof o=="number"&&n==null)if(parseInt(h)==h&&parseInt(o)==o)this.move(h,o);else this.x=Math.floor(h+0.5),this.y=Math.floor(o+0.5)},d.prototype.move=function(h,o){this.x=h,this.y=o},d.prototype.translate=function(h,o){this.x+=h,this.y+=o},d.prototype.equals=function(h){if(h.constructor.name=="Point"){var o=h;return this.x==o.x&&this.y==o.y}return this==h},d.prototype.toString=function(){return new d().constructor.name+"[x="+this.x+",y="+this.y+"]"},L.exports=d},function(L,x,M){function d(h,o,n,a){if(this.x=0,this.y=0,this.width=0,this.height=0,h!=null&&o!=null&&n!=null&&a!=null)this.x=h,this.y=o,this.width=n,this.height=a}d.prototype.getX=function(){return this.x},d.prototype.setX=function(h){this.x=h},d.prototype.getY=function(){return this.y},d.prototype.setY=function(h){this.y=h},d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(h){this.width=h},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(h){this.height=h},d.prototype.getRight=function(){return this.x+this.width},d.prototype.getBottom=function(){return this.y+this.height},d.prototype.intersects=function(h){if(this.getRight()<h.x)return!1;if(this.getBottom()<h.y)return!1;if(h.getRight()<this.x)return!1;if(h.getBottom()<this.y)return!1;return!0},d.prototype.getCenterX=function(){return this.x+this.width/2},d.prototype.getMinX=function(){return this.getX()},d.prototype.getMaxX=function(){return this.getX()+this.width},d.prototype.getCenterY=function(){return this.y+this.height/2},d.prototype.getMinY=function(){return this.getY()},d.prototype.getMaxY=function(){return this.getY()+this.height},d.prototype.getWidthHalf=function(){return this.width/2},d.prototype.getHeightHalf=function(){return this.height/2},L.exports=d},function(L,x,M){var d=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 h(){}h.lastID=0,h.createID=function(o){if(h.isPrimitive(o))return o;if(o.uniqueID!=null)return o.uniqueID;return o.uniqueID=h.getString(),h.lastID++,o.uniqueID},h.getString=function(o){if(o==null)o=h.lastID;return"Object#"+o},h.isPrimitive=function(o){var n=typeof o>"u"?"undefined":d(o);return o==null||n!="object"&&n!="function"},L.exports=h},function(L,x,M){function d(c){if(Array.isArray(c)){for(var u=0,f=Array(c.length);u<c.length;u++)f[u]=c[u];return f}else return Array.from(c)}var h=M(0),o=M(7),n=M(3),a=M(1),g=M(6),r=M(5),v=M(17),i=M(29);function e(c){if(i.call(this),this.layoutQuality=h.QUALITY,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=h.DEFAULT_INCREMENTAL,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,c!=null)this.isRemoteUse=c}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 c=new o(this);return this.graphManager=c,c},e.prototype.newGraph=function(c){return new g(null,this.graphManager,c)},e.prototype.newNode=function(c){return new n(this.graphManager,c)},e.prototype.newEdge=function(c){return new a(null,null,c)},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 c;if(this.checkLayoutSuccess())c=!1;else c=this.layout();if(h.ANIMATE==="during")return!1;if(c){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,c},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 c,u=this.graphManager.getAllEdges();for(var f=0;f<u.length;f++)c=u[f];var D,E=this.graphManager.getRoot().getNodes();for(var f=0;f<E.length;f++)D=E[f];this.update(this.graphManager.getRoot())}},e.prototype.update=function(c){if(c==null)this.update2();else if(c instanceof n){var u=c;if(u.getChild()!=null){var f=u.getChild().getNodes();for(var D=0;D<f.length;D++)update(f[D])}if(u.vGraphObject!=null){var E=u.vGraphObject;E.update(u)}}else if(c instanceof a){var T=c;if(T.vGraphObject!=null){var A=T.vGraphObject;A.update(T)}}else if(c instanceof g){var G=c;if(G.vGraphObject!=null){var O=G.vGraphObject;O.update(G)}}},e.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=h.QUALITY,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=h.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},e.prototype.transform=function(c){if(c==null)this.transform(new r(0,0));else{var u=new v,f=this.graphManager.getRoot().updateLeftTop();if(f!=null){u.setWorldOrgX(c.x),u.setWorldOrgY(c.y),u.setDeviceOrgX(f.x),u.setDeviceOrgY(f.y);var D=this.getAllNodes(),E;for(var T=0;T<D.length;T++)E=D[T],E.transform(u)}}},e.prototype.positionNodesRandomly=function(c){if(c==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var u,f,D=c.getNodes();for(var E=0;E<D.length;E++)if(u=D[E],f=u.getChild(),f==null)u.scatter();else if(f.getNodes().length==0)u.scatter();else this.positionNodesRandomly(f),u.updateBounds()}},e.prototype.getFlatForest=function(){var c=[],u=!0,f=this.graphManager.getRoot().getNodes(),D=!0;for(var E=0;E<f.length;E++)if(f[E].getChild()!=null)D=!1;if(!D)return c;var T=new Set,A=[],G=new Map,O=[];O=O.concat(f);while(O.length>0&&u){A.push(O[0]);while(A.length>0&&u){var V=A[0];A.splice(0,1),T.add(V);var _=V.getEdges();for(var E=0;E<_.length;E++){var Q=_[E].getOtherEnd(V);if(G.get(V)!=Q)if(!T.has(Q))A.push(Q),G.set(Q,V);else{u=!1;break}}}if(!u)c=[];else{var lt=[].concat(d(T));c.push(lt);for(var E=0;E<lt.length;E++){var S=lt[E],tt=O.indexOf(S);if(tt>-1)O.splice(tt,1)}T=new Set,G=new Map}}return c},e.prototype.createDummyNodesForBendpoints=function(c){var u=[],f=c.source,D=this.graphManager.calcLowestCommonAncestor(c.source,c.target);for(var E=0;E<c.bendpoints.length;E++){var T=this.newNode(null);T.setRect(new Point(0,0),new Dimension(1,1)),D.add(T);var A=this.newEdge(null);this.graphManager.add(A,f,T),u.add(T),f=T}var A=this.newEdge(null);if(this.graphManager.add(A,f,c.target),this.edgeToDummyNodes.set(c,u),c.isInterGraph())this.graphManager.remove(c);else D.remove(c);return u},e.prototype.createBendpointsFromDummyNodes=function(){var c=[];c=c.concat(this.graphManager.getAllEdges()),c=[].concat(d(this.edgeToDummyNodes.keys())).concat(c);for(var u=0;u<c.length;u++){var f=c[u];if(f.bendpoints.length>0){var D=this.edgeToDummyNodes.get(f);for(var E=0;E<D.length;E++){var T=D[E],A=new r(T.getCenterX(),T.getCenterY()),G=f.bendpoints.get(E);G.x=A.x,G.y=A.y,T.getOwner().remove(T)}this.graphManager.add(f,f.source,f.target)}}},e.transform=function(c,u,f,D){if(f!=null&&D!=null){var E=u;if(c<=50){var T=u/f;E-=(u-T)/50*(50-c)}else{var A=u*D;E+=(A-u)/50*(c-50)}return E}else{var G,O;if(c<=50)G=9*u/500,O=u/10;else G=9*u/50,O=-8*u;return G*c+O}},e.findCenterOfTree=function(c){var u=[];u=u.concat(c);var f=[],D=new Map,E=!1,T=null;if(u.length==1||u.length==2)E=!0,T=u[0];for(var A=0;A<u.length;A++){var G=u[A],O=G.getNeighborsList().size;if(D.set(G,G.getNeighborsList().size),O==1)f.push(G)}var V=[];V=V.concat(f);while(!E){var _=[];_=_.concat(V),V=[];for(var A=0;A<u.length;A++){var G=u[A],Q=u.indexOf(G);if(Q>=0)u.splice(Q,1);var lt=G.getNeighborsList();lt.forEach(function(s){if(f.indexOf(s)<0){var N=D.get(s),y=N-1;if(y==1)V.push(s);D.set(s,y)}})}if(f=f.concat(V),u.length==1||u.length==2)E=!0,T=u[0]}return T},e.prototype.setGraphManager=function(c){this.graphManager=c},L.exports=e},function(L,x,M){function d(){}d.seed=1,d.x=0,d.nextDouble=function(){return d.x=Math.sin(d.seed++)*1e4,d.x-Math.floor(d.x)},L.exports=d},function(L,x,M){var d=M(5);function h(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}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(o){this.lworldExtX=o},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(o){this.lworldExtY=o},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},h.prototype.transformX=function(o){var n=0,a=this.lworldExtX;if(a!=0)n=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/a;return n},h.prototype.transformY=function(o){var n=0,a=this.lworldExtY;if(a!=0)n=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/a;return n},h.prototype.inverseTransformX=function(o){var n=0,a=this.ldeviceExtX;if(a!=0)n=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/a;return n},h.prototype.inverseTransformY=function(o){var n=0,a=this.ldeviceExtY;if(a!=0)n=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/a;return n},h.prototype.inverseTransformPoint=function(o){var n=new d(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return n},L.exports=h},function(L,x,M){function d(i){if(Array.isArray(i)){for(var e=0,c=Array(i.length);e<i.length;e++)c[e]=i[e];return c}else return Array.from(i)}var h=M(15),o=M(4),n=M(0),a=M(8),g=M(9);function r(){h.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(h.prototype);for(var v in h)r[v]=h[v];r.prototype.initParameters=function(){h.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,c,u,f,D,E,T=this.getGraphManager().getAllEdges();for(var A=0;A<T.length;A++)if(i=T[A],e=i.idealLength,i.isInterGraph){if(u=i.getSource(),f=i.getTarget(),D=i.getSourceInLca().getEstimatedSize(),E=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=D+E-2*n.SIMPLE_NODE_SIZE;c=i.getLca().getInclusionTreeDepth(),i.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(u.getInclusionTreeDepth()+f.getInclusionTreeDepth()-2*c)}},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 c=0;c<i.length;c++)e=i[c],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,c,u,f,D,E=this.getAllNodes(),T;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();T=new Set;for(c=0;c<E.length;c++)f=E[c],this.calculateRepulsionForceOfANode(f,T,i,e),T.add(f)}else for(c=0;c<E.length;c++){f=E[c];for(u=c+1;u<E.length;u++){if(D=E[u],f.getOwner()!=D.getOwner())continue;this.calcRepulsionForce(f,D)}}},r.prototype.calcGravitationalForces=function(){var i,e=this.getAllNodesToApplyGravitation();for(var c=0;c<e.length;c++)i=e[c],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),e;for(var c=0;c<i.length;c++)e=i[c],e.move()},r.prototype.calcSpringForce=function(i,e){var c=i.getSource(),u=i.getTarget(),f,D,E,T;if(this.uniformLeafNodeSizes&&c.getChild()==null&&u.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(f=i.getLength(),f==0)return;D=i.edgeElasticity*(f-e),E=D*(i.lengthX/f),T=D*(i.lengthY/f),c.springForceX+=E,c.springForceY+=T,u.springForceX-=E,u.springForceY-=T},r.prototype.calcRepulsionForce=function(i,e){var c=i.getRect(),u=e.getRect(),f=[,,],D=[,,,,],E,T,A,G,O,V,_;if(c.intersects(u)){a.calcSeparationAmount(c,u,f,o.DEFAULT_EDGE_LENGTH/2),V=2*f[0],_=2*f[1];var Q=i.noOfChildren*e.noOfChildren/(i.noOfChildren+e.noOfChildren);i.repulsionForceX-=Q*V,i.repulsionForceY-=Q*_,e.repulsionForceX+=Q*V,e.repulsionForceY+=Q*_}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&e.getChild()==null)E=u.getCenterX()-c.getCenterX(),T=u.getCenterY()-c.getCenterY();else a.getIntersection(c,u,D),E=D[2]-D[0],T=D[3]-D[1];if(Math.abs(E)<o.MIN_REPULSION_DIST)E=g.sign(E)*o.MIN_REPULSION_DIST;if(Math.abs(T)<o.MIN_REPULSION_DIST)T=g.sign(T)*o.MIN_REPULSION_DIST;A=E*E+T*T,G=Math.sqrt(A),O=(i.nodeRepulsion/2+e.nodeRepulsion/2)*i.noOfChildren*e.noOfChildren/A,V=O*E/G,_=O*T/G,i.repulsionForceX-=V,i.repulsionForceY-=_,e.repulsionForceX+=V,e.repulsionForceY+=_}},r.prototype.calcGravitationalForce=function(i){var e,c,u,f,D,E,T,A;if(e=i.getOwner(),c=(e.getRight()+e.getLeft())/2,u=(e.getTop()+e.getBottom())/2,f=i.getCenterX()-c,D=i.getCenterY()-u,E=Math.abs(f)+i.getWidth()/2,T=Math.abs(D)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(A=e.getEstimatedSize()*this.gravityRangeFactor,E>A||T>A)i.gravitationForceX=-this.gravityConstant*f,i.gravitationForceY=-this.gravityConstant*D}else if(A=e.getEstimatedSize()*this.compoundGravityRangeFactor,E>A||T>A)i.gravitationForceX=-this.gravityConstant*f*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*D*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 c=0;c<e.length;c++)i=e[c],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var e=0,c=0;e=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),c=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var u=Array(e);for(var f=0;f<e;f++)u[f]=Array(c);for(var f=0;f<e;f++)for(var D=0;D<c;D++)u[f][D]=[];return u},r.prototype.addNodeToGrid=function(i,e,c){var u=0,f=0,D=0,E=0;u=parseInt(Math.floor((i.getRect().x-e)/this.repulsionRange)),f=parseInt(Math.floor((i.getRect().width+i.getRect().x-e)/this.repulsionRange)),D=parseInt(Math.floor((i.getRect().y-c)/this.repulsionRange)),E=parseInt(Math.floor((i.getRect().height+i.getRect().y-c)/this.repulsionRange));for(var T=u;T<=f;T++)for(var A=D;A<=E;A++)this.grid[T][A].push(i),i.setGridCoordinates(u,f,D,E)},r.prototype.updateGrid=function(){var i,e,c=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<c.length;i++)e=c[i],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,e,c,u){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&c||u){var f=new Set;i.surrounding=[];var D,E=this.grid;for(var T=i.startX-1;T<i.finishX+2;T++)for(var A=i.startY-1;A<i.finishY+2;A++)if(!(T<0||A<0||T>=E.length||A>=E[0].length))for(var G=0;G<E[T][A].length;G++){if(D=E[T][A][G],i.getOwner()!=D.getOwner()||i==D)continue;if(!e.has(D)&&!f.has(D)){var O=Math.abs(i.getCenterX()-D.getCenterX())-(i.getWidth()/2+D.getWidth()/2),V=Math.abs(i.getCenterY()-D.getCenterY())-(i.getHeight()/2+D.getHeight()/2);if(O<=this.repulsionRange&&V<=this.repulsionRange)f.add(D)}}i.surrounding=[].concat(d(f))}for(T=0;T<i.surrounding.length;T++)this.calcRepulsionForce(i,i.surrounding[T])},r.prototype.calcRepulsionRange=function(){return 0},L.exports=r},function(L,x,M){var d=M(1),h=M(4);function o(a,g,r){d.call(this,a,g,r),this.idealLength=h.DEFAULT_EDGE_LENGTH,this.edgeElasticity=h.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(d.prototype);for(var n in d)o[n]=d[n];L.exports=o},function(L,x,M){var d=M(3),h=M(4);function o(a,g,r,v){d.call(this,a,g,r,v),this.nodeRepulsion=h.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(d.prototype);for(var n in d)o[n]=d[n];o.prototype.setGridCoordinates=function(a,g,r,v){this.startX=a,this.finishX=g,this.startY=r,this.finishY=v},L.exports=o},function(L,x,M){function d(h,o){if(this.width=0,this.height=0,h!==null&&o!==null)this.height=o,this.width=h}d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(h){this.width=h},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(h){this.height=h},L.exports=d},function(L,x,M){var d=M(14);function h(){this.map={},this.keys=[]}h.prototype.put=function(o,n){var a=d.createID(o);if(!this.contains(a))this.map[a]=n,this.keys.push(o)},h.prototype.contains=function(o){var n=d.createID(o);return this.map[o]!=null},h.prototype.get=function(o){var n=d.createID(o);return this.map[n]},h.prototype.keySet=function(){return this.keys},L.exports=h},function(L,x,M){var d=M(14);function h(){this.set={}}h.prototype.add=function(o){var n=d.createID(o);if(!this.contains(n))this.set[n]=o},h.prototype.remove=function(o){delete this.set[d.createID(o)]},h.prototype.clear=function(){this.set={}},h.prototype.contains=function(o){return this.set[d.createID(o)]==o},h.prototype.isEmpty=function(){return this.size()===0},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAllTo=function(o){var n=Object.keys(this.set),a=n.length;for(var g=0;g<a;g++)o.push(this.set[n[g]])},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAll=function(o){var n=o.length;for(var a=0;a<n;a++){var g=o[a];this.add(g)}},L.exports=h},function(L,x,M){function d(){}d.multMat=function(h,o){var n=[];for(var a=0;a<h.length;a++){n[a]=[];for(var g=0;g<o[0].length;g++){n[a][g]=0;for(var r=0;r<h[0].length;r++)n[a][g]+=h[a][r]*o[r][g]}}return n},d.transpose=function(h){var o=[];for(var n=0;n<h[0].length;n++){o[n]=[];for(var a=0;a<h.length;a++)o[n][a]=h[a][n]}return o},d.multCons=function(h,o){var n=[];for(var a=0;a<h.length;a++)n[a]=h[a]*o;return n},d.minusOp=function(h,o){var n=[];for(var a=0;a<h.length;a++)n[a]=h[a]-o[a];return n},d.dotProduct=function(h,o){var n=0;for(var a=0;a<h.length;a++)n+=h[a]*o[a];return n},d.mag=function(h){return Math.sqrt(this.dotProduct(h,h))},d.normalize=function(h){var o=[],n=this.mag(h);for(var a=0;a<h.length;a++)o[a]=h[a]/n;return o},d.multGamma=function(h){var o=[],n=0;for(var a=0;a<h.length;a++)n+=h[a];n*=-1/h.length;for(var g=0;g<h.length;g++)o[g]=n+h[g];return o},d.multL=function(h,o,n){var a=[],g=[],r=[];for(var v=0;v<o[0].length;v++){var i=0;for(var e=0;e<o.length;e++)i+=-0.5*o[e][v]*h[e];g[v]=i}for(var c=0;c<n.length;c++){var u=0;for(var f=0;f<n.length;f++)u+=n[c][f]*g[f];r[c]=u}for(var D=0;D<o.length;D++){var E=0;for(var T=0;T<o[0].length;T++)E+=o[D][T]*r[T];a[D]=E}return a},L.exports=d},function(L,x,M){var d=function(){function a(g,r){for(var v=0;v<r.length;v++){var i=r[v];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(g,i.key,i)}}return function(g,r,v){if(r)a(g.prototype,r);if(v)a(g,v);return g}}();function h(a,g){if(!(a instanceof g))throw TypeError("Cannot call a class as a function")}var o=M(11),n=function(){function a(g,r){if(h(this,a),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var v=void 0;if(g instanceof o)v=g.size();else v=g.length;this._quicksort(g,0,v-1)}return d(a,[{key:"_quicksort",value:function(r,v,i){if(v<i){var e=this._partition(r,v,i);this._quicksort(r,v,e),this._quicksort(r,e+1,i)}}},{key:"_partition",value:function(r,v,i){var e=this._get(r,v),c=v,u=i;while(!0){while(this.compareFunction(e,this._get(r,u)))u--;while(this.compareFunction(this._get(r,c),e))c++;if(c<u)this._swap(r,c,u),c++,u--;else return u}}},{key:"_get",value:function(r,v){if(r instanceof o)return r.get_object_at(v);else return r[v]}},{key:"_set",value:function(r,v,i){if(r instanceof o)r.set_object_at(v,i);else r[v]=i}},{key:"_swap",value:function(r,v,i){var e=this._get(r,v);this._set(r,v,this._get(r,i)),this._set(r,i,e)}},{key:"_defaultCompareFunction",value:function(r,v){return v>r}}]),a}();L.exports=n},function(L,x,M){function d(){}d.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[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),g=!0,r=!0,v=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(v,i);e++){if(e<v){this.s[e]=0;for(var c=e;c<this.m;c++)this.s[e]=d.hypot(this.s[e],h[c][e]);if(this.s[e]!==0){if(h[e][e]<0)this.s[e]=-this.s[e];for(var u=e;u<this.m;u++)h[u][e]/=this.s[e];h[e][e]+=1}this.s[e]=-this.s[e]}for(var f=e+1;f<this.n;f++){if(function(Wt,bt){return Wt&&bt}(e<v,this.s[e]!==0)){var D=0;for(var E=e;E<this.m;E++)D+=h[E][e]*h[E][f];D=-D/h[e][e];for(var T=e;T<this.m;T++)h[T][f]+=D*h[T][e]}n[f]=h[e][f]}if(function(Wt,bt){return Wt&&bt}(g,e<v))for(var A=e;A<this.m;A++)this.U[A][e]=h[A][e];if(e<i){n[e]=0;for(var G=e+1;G<this.n;G++)n[e]=d.hypot(n[e],n[G]);if(n[e]!==0){if(n[e+1]<0)n[e]=-n[e];for(var O=e+1;O<this.n;O++)n[O]/=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 V=e+1;V<this.m;V++)a[V]=0;for(var _=e+1;_<this.n;_++)for(var Q=e+1;Q<this.m;Q++)a[Q]+=n[_]*h[Q][_];for(var lt=e+1;lt<this.n;lt++){var S=-n[lt]/n[e+1];for(var tt=e+1;tt<this.m;tt++)h[tt][lt]+=S*a[tt]}}if(r)for(var s=e+1;s<this.n;s++)this.V[s][e]=n[s]}}var N=Math.min(this.n,this.m+1);if(v<this.n)this.s[v]=h[v][v];if(this.m<N)this.s[N-1]=0;if(i+1<N)n[i]=h[i][N-1];if(n[N-1]=0,g){for(var y=v;y<o;y++){for(var w=0;w<this.m;w++)this.U[w][y]=0;this.U[y][y]=1}for(var p=v-1;p>=0;p--)if(this.s[p]!==0){for(var P=p+1;P<o;P++){var R=0;for(var k=p;k<this.m;k++)R+=this.U[k][p]*this.U[k][P];R=-R/this.U[p][p];for(var B=p;B<this.m;B++)this.U[B][P]+=R*this.U[B][p]}for(var X=p;X<this.m;X++)this.U[X][p]=-this.U[X][p];this.U[p][p]=1+this.U[p][p];for(var st=0;st<p-1;st++)this.U[st][p]=0}else{for(var dt=0;dt<this.m;dt++)this.U[dt][p]=0;this.U[p][p]=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 I=Z+1;I<this.n;I++)nt+=this.V[I][Z]*this.V[I][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=N-1,Nt=0,Pt=Math.pow(2,-52),Bt=Math.pow(2,-966);while(N>0){var ft=void 0,Jt=void 0;for(ft=N-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===N-2)Jt=4;else{var Xt=void 0;for(Xt=N-1;Xt>=ft;Xt--){if(Xt===ft)break;var Et=(Xt!==N?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===N-1)Jt=1;else Jt=2,ft=Xt}switch(ft++,Jt){case 1:{var vt=n[N-2];n[N-2]=0;for(var xt=N-2;xt>=ft;xt--){var Rt=d.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][N-1],this.V[Ft][N-1]=-St*this.V[Ft][xt]+Gt*this.V[Ft][N-1],this.V[Ft][xt]=Rt}}break;case 2:{var Ht=n[ft-1];n[ft-1]=0;for(var zt=ft;zt<N;zt++){var ee=d.hypot(this.s[zt],Ht),qt=this.s[zt]/ee,Kt=Ht/ee;if(this.s[zt]=ee,Ht=-Kt*n[zt],n[zt]=qt*n[zt],g)for(var kt=0;kt<this.m;kt++)ee=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]=ee}}break;case 3:{var J=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[N-1]),Math.abs(this.s[N-2])),Math.abs(n[N-2])),Math.abs(this.s[ft])),Math.abs(n[ft])),rt=this.s[N-1]/J,it=this.s[N-2]/J,at=n[N-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<N-1;pt++){var Ot=d.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=d.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],g&&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[N-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(g&&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,N--}break}}var re={U:this.U,V:this.V,S:this.s};return re},d.hypot=function(h,o){var n=void 0;if(Math.abs(h)>Math.abs(o))n=o/h,n=Math.abs(h)*Math.sqrt(1+n*n);else if(o!=0)n=h/o,n=Math.abs(o)*Math.sqrt(1+n*n);else n=0;return n},L.exports=d},function(L,x,M){var d=function(){function n(a,g){for(var r=0;r<g.length;r++){var v=g[r];if(v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v)v.writable=!0;Object.defineProperty(a,v.key,v)}}return function(a,g,r){if(g)n(a.prototype,g);if(r)n(a,r);return a}}();function h(n,a){if(!(n instanceof a))throw TypeError("Cannot call a class as a function")}var o=function(){function n(a,g){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,n),this.sequence1=a,this.sequence2=g,this.match_score=r,this.mismatch_penalty=v,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=g.length+1,this.grid=Array(this.iMax);for(var e=0;e<this.iMax;e++){this.grid[e]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.grid[e][c]=0}this.tracebackGrid=Array(this.iMax);for(var u=0;u<this.iMax;u++){this.tracebackGrid[u]=Array(this.jMax);for(var f=0;f<this.jMax;f++)this.tracebackGrid[u][f]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return d(n,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var g=1;g<this.jMax;g++)this.grid[0][g]=this.grid[0][g-1]+this.gap_penalty,this.tracebackGrid[0][g]=[!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 v=1;v<this.iMax;v++)for(var i=1;i<this.jMax;i++){var e=void 0;if(this.sequence1[v-1]===this.sequence2[i-1])e=this.grid[v-1][i-1]+this.match_score;else e=this.grid[v-1][i-1]+this.mismatch_penalty;var c=this.grid[v-1][i]+this.gap_penalty,u=this.grid[v][i-1]+this.gap_penalty,f=[e,c,u],D=this.arrayAllMaxIndexes(f);this.grid[v][i]=f[D[0]],this.tracebackGrid[v][i]=[D.includes(0),D.includes(1),D.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var g=[];g.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(g[0]){var r=g[0],v=this.tracebackGrid[r.pos[0]][r.pos[1]];if(v[0])g.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(v[1])g.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(v[2])g.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});g.shift()}return this.alignments}},{key:"getAllIndexes",value:function(g,r){var v=[],i=-1;while((i=g.indexOf(r,i+1))!==-1)v.push(i);return v}},{key:"arrayAllMaxIndexes",value:function(g){return this.getAllIndexes(g,Math.max.apply(null,g))}}]),n}();L.exports=o},function(L,x,M){var d=function(){return};d.FDLayout=M(18),d.FDLayoutConstants=M(4),d.FDLayoutEdge=M(19),d.FDLayoutNode=M(20),d.DimensionD=M(21),d.HashMap=M(22),d.HashSet=M(23),d.IGeometry=M(8),d.IMath=M(9),d.Integer=M(10),d.Point=M(12),d.PointD=M(5),d.RandomSeed=M(16),d.RectangleD=M(13),d.Transform=M(17),d.UniqueIDGeneretor=M(14),d.Quicksort=M(25),d.LinkedList=M(11),d.LGraphObject=M(2),d.LGraph=M(6),d.LEdge=M(1),d.LGraphManager=M(7),d.LNode=M(3),d.Layout=M(15),d.LayoutConstants=M(0),d.NeedlemanWunsch=M(27),d.Matrix=M(24),d.SVD=M(26),L.exports=d},function(L,x,M){function d(){this.listeners=[]}var h=d.prototype;h.addListener=function(o,n){this.listeners.push({event:o,callback:n})},h.removeListener=function(o,n){for(var a=this.listeners.length;a>=0;a--){var g=this.listeners[a];if(g.event===o&&g.callback===n)this.listeners.splice(a,1)}},h.emit=function(o,n){for(var a=0;a<this.listeners.length;a++){var g=this.listeners[a];if(o===g.event)g.callback(n)}},L.exports=d}])})});var Fe=zn(function(me,Se){(function(x,M){if(typeof me==="object"&&typeof Se==="object")Se.exports=M(Re());else if(typeof define==="function"&&define.amd)define(["layout-base"],M);else if(typeof me==="object")me.coseBase=M(Re());else x.coseBase=M(x.layoutBase)})(me,function(L){return(()=>{var x={45:(o,n,a)=>{var g={};g.layoutBase=a(551),g.CoSEConstants=a(806),g.CoSEEdge=a(767),g.CoSEGraph=a(880),g.CoSEGraphManager=a(578),g.CoSELayout=a(765),g.CoSENode=a(991),g.ConstraintHandler=a(902),o.exports=g},806:(o,n,a)=>{var g=a(551).FDLayoutConstants;function r(){}for(var v in g)r[v]=g[v];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=g.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 g=a(551).FDLayoutEdge;function r(i,e,c){g.call(this,i,e,c)}r.prototype=Object.create(g.prototype);for(var v in g)r[v]=g[v];o.exports=r},880:(o,n,a)=>{var g=a(551).LGraph;function r(i,e,c){g.call(this,i,e,c)}r.prototype=Object.create(g.prototype);for(var v in g)r[v]=g[v];o.exports=r},578:(o,n,a)=>{var g=a(551).LGraphManager;function r(i){g.call(this,i)}r.prototype=Object.create(g.prototype);for(var v in g)r[v]=g[v];o.exports=r},765:(o,n,a)=>{var g=a(551).FDLayout,r=a(578),v=a(880),i=a(991),e=a(767),c=a(806),u=a(902),f=a(551).FDLayoutConstants,D=a(551).LayoutConstants,E=a(551).Point,T=a(551).PointD,A=a(551).DimensionD,G=a(551).Layout,O=a(551).Integer,V=a(551).IGeometry,_=a(551).LGraph,Q=a(551).Transform,lt=a(551).LinkedList;function S(){g.call(this),this.toBeTiled={},this.constraints={}}S.prototype=Object.create(g.prototype);for(var tt in g)S[tt]=g[tt];S.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},S.prototype.newGraph=function(s){return new v(null,this.graphManager,s)},S.prototype.newNode=function(s){return new i(this.graphManager,s)},S.prototype.newEdge=function(s){return new e(null,null,s)},S.prototype.initParameters=function(){if(g.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(c.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=f.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=f.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},S.prototype.initSpringEmbedder=function(){g.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/f.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},S.prototype.layout=function(){var s=D.DEFAULT_CREATE_BENDS_AS_NEEDED;if(s)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},S.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 N=new Set(this.getAllNodes()),y=this.nodesWithGravity.filter(function(w){return N.has(w)});this.graphManager.setAllNodesToApplyGravitation(y),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var N=new Set(this.getAllNodes()),y=this.nodesWithGravity.filter(function(P){return N.has(P)});this.graphManager.setAllNodesToApplyGravitation(y)}if(Object.keys(this.constraints).length>0)u.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),c.APPLY_LAYOUT)this.runSpringEmbedder();return!0},S.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%f.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()),N=this.nodesWithGravity.filter(function(p){return s.has(p)});if(this.graphManager.setAllNodesToApplyGravitation(N),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL)this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=f.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(c.PURE_INCREMENTAL)this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var y=!this.isTreeGrowing&&!this.isGrowthFinished,w=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(y,w),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},S.prototype.getPositionsData=function(){var s=this.graphManager.getAllNodes(),N={};for(var y=0;y<s.length;y++){var w=s[y].rect,p=s[y].id;N[p]={id:p,x:w.getCenterX(),y:w.getCenterY(),w:w.width,h:w.height}}return N},S.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(f.ANIMATE==="during")this.emit("layoutstarted");else{while(!s)s=this.tick();this.graphManager.updateBounds()}},S.prototype.moveNodes=function(){var s=this.getAllNodes(),N;for(var y=0;y<s.length;y++)N=s[y],N.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var y=0;y<s.length;y++)N=s[y],N.move()},S.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var N=this.graphManager.getAllNodes();for(var y=0;y<N.length;y++){var w=N[y];this.idToNodeMap.set(w.id,w)}var p=function I(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+=I(ct);return Nt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(et){s.fixedNodeSet.add(et.nodeId)});var N=this.graphManager.getAllNodes(),w;for(var y=0;y<N.length;y++)if(w=N[y],w.getChild()!=null){var P=p(w);if(P>0)w.fixedNodeWeight=P}}if(this.constraints.relativePlacementConstraint){var R=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(I){s.fixedNodesOnHorizontal.add(I),s.fixedNodesOnVertical.add(I)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var B=this.constraints.alignmentConstraint.vertical;for(var y=0;y<B.length;y++)this.dummyToNodeForVerticalAlignment.set("dummy"+y,[]),B[y].forEach(function(K){if(R.set(K,"dummy"+y),s.dummyToNodeForVerticalAlignment.get("dummy"+y).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnHorizontal.add("dummy"+y)})}if(this.constraints.alignmentConstraint.horizontal){var X=this.constraints.alignmentConstraint.horizontal;for(var y=0;y<X.length;y++)this.dummyToNodeForHorizontalAlignment.set("dummy"+y,[]),X[y].forEach(function(K){if(k.set(K,"dummy"+y),s.dummyToNodeForHorizontalAlignment.get("dummy"+y).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnVertical.add("dummy"+y)})}}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(I){var K,et,ct;for(ct=I.length-1;ct>=2*I.length/3;ct--)K=Math.floor(Math.random()*(ct+1)),et=I[ct],I[ct]=I[K],I[K]=et;return I},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(I){if(I.left){var K=R.has(I.left)?R.get(I.left):I.left,et=R.has(I.right)?R.get(I.right):I.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:I.gap}),s.nodeToRelativeConstraintMapHorizontal.get(et).push({left:K,gap:I.gap})}else{var ct=k.has(I.top)?k.get(I.top):I.top,Nt=k.has(I.bottom)?k.get(I.bottom):I.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:I.gap}),s.nodeToRelativeConstraintMapVertical.get(Nt).push({top:ct,gap:I.gap})}});else{var st=new Map,dt=new Map;this.constraints.relativePlacementConstraint.forEach(function(I){if(I.left){var K=R.has(I.left)?R.get(I.left):I.left,et=R.has(I.right)?R.get(I.right):I.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(I.top)?k.get(I.top):I.top,Nt=k.has(I.bottom)?k.get(I.bottom):I.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}}},S.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(nt){var I=s.idToNodeMap.get(nt.nodeId);I.displacementX=0,I.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var N=this.constraints.alignmentConstraint.vertical;for(var y=0;y<N.length;y++){var w=0;for(var p=0;p<N[y].length;p++){if(this.fixedNodeSet.has(N[y][p])){w=0;break}w+=this.idToNodeMap.get(N[y][p]).displacementX}var P=w/N[y].length;for(var p=0;p<N[y].length;p++)this.idToNodeMap.get(N[y][p]).displacementX=P}}if(this.constraints.alignmentConstraint.horizontal){var R=this.constraints.alignmentConstraint.horizontal;for(var y=0;y<R.length;y++){var k=0;for(var p=0;p<R[y].length;p++){if(this.fixedNodeSet.has(R[y][p])){k=0;break}k+=this.idToNodeMap.get(R[y][p]).displacementY}var B=k/R[y].length;for(var p=0;p<R[y].length;p++)this.idToNodeMap.get(R[y][p]).displacementY=B}}}if(this.constraints.relativePlacementConstraint)if(c.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 I=0;if(s.dummyToNodeForVerticalAlignment.has(nt))I=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(nt)[0]).displacementX;else I=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)-I;if(et<K.gap)I-=K.gap-et}else{var et=s.nodeToTempPositionMapHorizontal.get(nt)-s.nodeToTempPositionMapHorizontal.get(K.left)+I;if(et<K.gap)I+=K.gap-et}}),s.nodeToTempPositionMapHorizontal.set(nt,s.nodeToTempPositionMapHorizontal.get(nt)+I),s.dummyToNodeForVerticalAlignment.has(nt))s.dummyToNodeForVerticalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementX=I});else s.idToNodeMap.get(nt).displacementX=I}}),this.nodesInRelativeVertical.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var I=0;if(s.dummyToNodeForHorizontalAlignment.has(nt))I=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(nt)[0]).displacementY;else I=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)-I;if(et<K.gap)I-=K.gap-et}else{var et=s.nodeToTempPositionMapVertical.get(nt)-s.nodeToTempPositionMapVertical.get(K.top)+I;if(et<K.gap)I+=K.gap-et}}),s.nodeToTempPositionMapVertical.set(nt,s.nodeToTempPositionMapVertical.get(nt)+I),s.dummyToNodeForHorizontalAlignment.has(nt))s.dummyToNodeForHorizontalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementY=I});else s.idToNodeMap.get(nt).displacementY=I}})}else{for(var y=0;y<this.componentsOnHorizontal.length;y++){var X=this.componentsOnHorizontal[y];if(this.fixedComponentsOnHorizontal[y])for(var p=0;p<X.length;p++)if(this.dummyToNodeForVerticalAlignment.has(X[p]))this.dummyToNodeForVerticalAlignment.get(X[p]).forEach(function(K){s.idToNodeMap.get(K).displacementX=0});else this.idToNodeMap.get(X[p]).displacementX=0;else{var st=0,dt=0;for(var p=0;p<X.length;p++)if(this.dummyToNodeForVerticalAlignment.has(X[p])){var Z=this.dummyToNodeForVerticalAlignment.get(X[p]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementX,dt+=Z.length}else st+=this.idToNodeMap.get(X[p]).displacementX,dt++;var ut=st/dt;for(var p=0;p<X.length;p++)if(this.dummyToNodeForVerticalAlignment.has(X[p]))this.dummyToNodeForVerticalAlignment.get(X[p]).forEach(function(K){s.idToNodeMap.get(K).displacementX=ut});else this.idToNodeMap.get(X[p]).displacementX=ut}}for(var y=0;y<this.componentsOnVertical.length;y++){var X=this.componentsOnVertical[y];if(this.fixedComponentsOnVertical[y])for(var p=0;p<X.length;p++)if(this.dummyToNodeForHorizontalAlignment.has(X[p]))this.dummyToNodeForHorizontalAlignment.get(X[p]).forEach(function(et){s.idToNodeMap.get(et).displacementY=0});else this.idToNodeMap.get(X[p]).displacementY=0;else{var st=0,dt=0;for(var p=0;p<X.length;p++)if(this.dummyToNodeForHorizontalAlignment.has(X[p])){var Z=this.dummyToNodeForHorizontalAlignment.get(X[p]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementY,dt+=Z.length}else st+=this.idToNodeMap.get(X[p]).displacementY,dt++;var ut=st/dt;for(var p=0;p<X.length;p++)if(this.dummyToNodeForHorizontalAlignment.has(X[p]))this.dummyToNodeForHorizontalAlignment.get(X[p]).forEach(function(Pt){s.idToNodeMap.get(Pt).displacementY=ut});else this.idToNodeMap.get(X[p]).displacementY=ut}}}},S.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],N,y=this.graphManager.getGraphs(),w=y.length,p;for(p=0;p<w;p++)if(N=y[p],N.updateConnected(),!N.isConnected)s=s.concat(N.getNodes());return s},S.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var N=new Set,y;for(y=0;y<s.length;y++){var w=s[y];if(!N.has(w)){var p=w.getSource(),P=w.getTarget();if(p==P)w.getBendpoints().push(new T),w.getBendpoints().push(new T),this.createDummyNodesForBendpoints(w),N.add(w);else{var R=[];if(R=R.concat(p.getEdgeListToNode(P)),R=R.concat(P.getEdgeListToNode(p)),!N.has(R[0])){if(R.length>1){var k;for(k=0;k<R.length;k++){var B=R[k];B.getBendpoints().push(new T),this.createDummyNodesForBendpoints(B)}}R.forEach(function(X){N.add(X)})}}}if(N.size==s.length)break}},S.prototype.positionNodesRadially=function(s){var N=new E(0,0),y=Math.ceil(Math.sqrt(s.length)),w=0,p=0,P=0,R=new T(0,0);for(var k=0;k<s.length;k++){if(k%y==0){if(P=0,p=w,k!=0)p+=c.DEFAULT_COMPONENT_SEPERATION;w=0}var B=s[k],X=G.findCenterOfTree(B);if(N.x=P,N.y=p,R=S.radialLayout(B,X,N),R.y>w)w=Math.floor(R.y);P=Math.floor(R.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new T(D.WORLD_CENTER_X-R.x/2,D.WORLD_CENTER_Y-R.y/2))},S.radialLayout=function(s,N,y){var w=Math.max(this.maxDiagonalInTree(s),c.DEFAULT_RADIAL_SEPARATION);S.branchRadialLayout(N,null,0,359,0,w);var p=_.calculateBounds(s),P=new Q;P.setDeviceOrgX(p.getMinX()),P.setDeviceOrgY(p.getMinY()),P.setWorldOrgX(y.x),P.setWorldOrgY(y.y);for(var R=0;R<s.length;R++){var k=s[R];k.transform(P)}var B=new T(p.getMaxX(),p.getMaxY());return P.inverseTransformPoint(B)},S.branchRadialLayout=function(s,N,y,w,p,P){var R=(w-y+1)/2;if(R<0)R+=180;var k=(R+y)%360,B=k*V.TWO_PI/360,X=Math.cos(B),st=p*Math.cos(B),dt=p*Math.sin(B);s.setCenter(st,dt);var Z=[];Z=Z.concat(s.getEdges());var ut=Z.length;if(N!=null)ut--;var nt=0,I=Z.length,K,et=s.getEdgesBetween(N);while(et.length>1){var ct=et[0];et.splice(0,1);var Nt=Z.indexOf(ct);if(Nt>=0)Z.splice(Nt,1);I--,ut--}if(N!=null)K=(Z.indexOf(et[0])+1)%I;else K=0;var Pt=Math.abs(w-y)/ut;for(var Bt=K;nt!=ut;Bt=++Bt%I){var ft=Z[Bt].getOtherEnd(s);if(ft==N)continue;var Jt=(y+nt*Pt)%360,Xt=(Jt+Pt)%360;S.branchRadialLayout(ft,s,Jt,Xt,p+P,P),nt++}},S.maxDiagonalInTree=function(s){var N=O.MIN_VALUE;for(var y=0;y<s.length;y++){var w=s[y],p=w.getDiagonal();if(p>N)N=p}return N},S.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},S.prototype.groupZeroDegreeMembers=function(){var s=this,N={};this.memberGroups={},this.idToDummyNode={};var y=[],w=this.graphManager.getAllNodes();for(var p=0;p<w.length;p++){var P=w[p],R=P.getParent();if(this.getNodeDegreeWithChildren(P)===0&&(R.id==null||!this.getToBeTiled(R)))y.push(P)}for(var p=0;p<y.length;p++){var P=y[p],k=P.getParent().id;if(typeof N[k]>"u")N[k]=[];N[k]=N[k].concat(P)}Object.keys(N).forEach(function(B){if(N[B].length>1){var X="DummyCompound_"+B;s.memberGroups[X]=N[B];var st=N[B][0].getParent(),dt=new i(s.graphManager);dt.id=X,dt.paddingLeft=st.paddingLeft||0,dt.paddingRight=st.paddingRight||0,dt.paddingBottom=st.paddingBottom||0,dt.paddingTop=st.paddingTop||0,s.idToDummyNode[X]=dt;var Z=s.getGraphManager().add(s.newGraph(),dt),ut=st.getChild();ut.add(dt);for(var nt=0;nt<N[B].length;nt++){var I=N[B][nt];ut.remove(I),Z.add(I)}}})},S.prototype.clearCompounds=function(){var s={},N={};this.performDFSOnCompounds();for(var y=0;y<this.compoundOrder.length;y++)N[this.compoundOrder[y].id]=this.compoundOrder[y],s[this.compoundOrder[y].id]=[].concat(this.compoundOrder[y].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[y].getChild()),this.compoundOrder[y].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,N)},S.prototype.clearZeroDegreeMembers=function(){var s=this,N=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(y){var w=s.idToDummyNode[y];if(N[y]=s.tileNodes(s.memberGroups[y],w.paddingLeft+w.paddingRight),w.rect.width=N[y].width,w.rect.height=N[y].height,w.setCenter(N[y].centerX,N[y].centerY),w.labelMarginLeft=0,w.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var p=w.rect.width,P=w.rect.height;if(w.labelWidth){if(w.labelPosHorizontal=="left")w.rect.x-=w.labelWidth,w.setWidth(p+w.labelWidth),w.labelMarginLeft=w.labelWidth;else if(w.labelPosHorizontal=="center"&&w.labelWidth>p)w.rect.x-=(w.labelWidth-p)/2,w.setWidth(w.labelWidth),w.labelMarginLeft=(w.labelWidth-p)/2;else if(w.labelPosHorizontal=="right")w.setWidth(p+w.labelWidth)}if(w.labelHeight){if(w.labelPosVertical=="top")w.rect.y-=w.labelHeight,w.setHeight(P+w.labelHeight),w.labelMarginTop=w.labelHeight;else if(w.labelPosVertical=="center"&&w.labelHeight>P)w.rect.y-=(w.labelHeight-P)/2,w.setHeight(w.labelHeight),w.labelMarginTop=(w.labelHeight-P)/2;else if(w.labelPosVertical=="bottom")w.setHeight(P+w.labelHeight)}}})},S.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var N=this.compoundOrder[s],{id:y,paddingLeft:w,paddingTop:p,labelMarginLeft:P,labelMarginTop:R}=N;this.adjustLocations(this.tiledMemberPack[y],N.rect.x,N.rect.y,w,p,P,R)}},S.prototype.repopulateZeroDegreeMembers=function(){var s=this,N=this.tiledZeroDegreePack;Object.keys(N).forEach(function(y){var w=s.idToDummyNode[y],{paddingLeft:p,paddingTop:P,labelMarginLeft:R,labelMarginTop:k}=w;s.adjustLocations(N[y],w.rect.x,w.rect.y,p,P,R,k)})},S.prototype.getToBeTiled=function(s){var N=s.id;if(this.toBeTiled[N]!=null)return this.toBeTiled[N];var y=s.getChild();if(y==null)return this.toBeTiled[N]=!1,!1;var w=y.getNodes();for(var p=0;p<w.length;p++){var P=w[p];if(this.getNodeDegree(P)>0)return this.toBeTiled[N]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[N]=!1,!1}return this.toBeTiled[N]=!0,!0},S.prototype.getNodeDegree=function(s){var N=s.id,y=s.getEdges(),w=0;for(var p=0;p<y.length;p++){var P=y[p];if(P.getSource().id!==P.getTarget().id)w=w+1}return w},S.prototype.getNodeDegreeWithChildren=function(s){var N=this.getNodeDegree(s);if(s.getChild()==null)return N;var y=s.getChild().getNodes();for(var w=0;w<y.length;w++){var p=y[w];N+=this.getNodeDegreeWithChildren(p)}return N},S.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},S.prototype.fillCompexOrderByDFS=function(s){for(var N=0;N<s.length;N++){var y=s[N];if(y.getChild()!=null)this.fillCompexOrderByDFS(y.getChild().getNodes());if(this.getToBeTiled(y))this.compoundOrder.push(y)}},S.prototype.adjustLocations=function(s,N,y,w,p,P,R){N+=w+P,y+=p+R;var k=N;for(var B=0;B<s.rows.length;B++){var X=s.rows[B];N=k;var st=0;for(var dt=0;dt<X.length;dt++){var Z=X[dt];if(Z.rect.x=N,Z.rect.y=y,N+=Z.rect.width+s.horizontalPadding,Z.rect.height>st)st=Z.rect.height}y+=st+s.verticalPadding}},S.prototype.tileCompoundMembers=function(s,N){var y=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(w){var p=N[w];if(y.tiledMemberPack[w]=y.tileNodes(s[w],p.paddingLeft+p.paddingRight),p.rect.width=y.tiledMemberPack[w].width,p.rect.height=y.tiledMemberPack[w].height,p.setCenter(y.tiledMemberPack[w].centerX,y.tiledMemberPack[w].centerY),p.labelMarginLeft=0,p.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var P=p.rect.width,R=p.rect.height;if(p.labelWidth){if(p.labelPosHorizontal=="left")p.rect.x-=p.labelWidth,p.setWidth(P+p.labelWidth),p.labelMarginLeft=p.labelWidth;else if(p.labelPosHorizontal=="center"&&p.labelWidth>P)p.rect.x-=(p.labelWidth-P)/2,p.setWidth(p.labelWidth),p.labelMarginLeft=(p.labelWidth-P)/2;else if(p.labelPosHorizontal=="right")p.setWidth(P+p.labelWidth)}if(p.labelHeight){if(p.labelPosVertical=="top")p.rect.y-=p.labelHeight,p.setHeight(R+p.labelHeight),p.labelMarginTop=p.labelHeight;else if(p.labelPosVertical=="center"&&p.labelHeight>R)p.rect.y-=(p.labelHeight-R)/2,p.setHeight(p.labelHeight),p.labelMarginTop=(p.labelHeight-R)/2;else if(p.labelPosVertical=="bottom")p.setHeight(R+p.labelHeight)}}})},S.prototype.tileNodes=function(s,N){var y=this.tileNodesByFavoringDim(s,N,!0),w=this.tileNodesByFavoringDim(s,N,!1),p=this.getOrgRatio(y),P=this.getOrgRatio(w),R;if(P<p)R=w;else R=y;return R},S.prototype.getOrgRatio=function(s){var{width:N,height:y}=s,w=N/y;if(w<1)w=1/w;return w},S.prototype.calcIdealRowWidth=function(s,N){var{TILING_PADDING_VERTICAL:y,TILING_PADDING_HORIZONTAL:w}=c,p=s.length,P=0,R=0,k=0;s.forEach(function(nt){if(P+=nt.getWidth(),R+=nt.getHeight(),nt.getWidth()>k)k=nt.getWidth()});var B=P/p,X=R/p,st=Math.pow(y-w,2)+4*(B+w)*(X+y)*p,dt=(w-y+Math.sqrt(st))/(2*(B+w)),Z;if(N){if(Z=Math.ceil(dt),Z==dt)Z++}else Z=Math.floor(dt);var ut=Z*(B+w)-w;if(k>ut)ut=k;return ut+=w*2,ut},S.prototype.tileNodesByFavoringDim=function(s,N,y){var{TILING_PADDING_VERTICAL:w,TILING_PADDING_HORIZONTAL:p,TILING_COMPARE_BY:P}=c,R={rows:[],rowWidth:[],rowHeight:[],width:0,height:N,verticalPadding:w,horizontalPadding:p,centerX:0,centerY:0};if(P)R.idealRowWidth=this.calcIdealRowWidth(s,y);var k=function(I){return I.rect.width*I.rect.height},B=function(I,K){return k(K)-k(I)};s.sort(function(nt,I){var K=B;if(R.idealRowWidth)return K=P,K(nt.id,I.id);return K(nt,I)});var X=0,st=0;for(var dt=0;dt<s.length;dt++){var Z=s[dt];X+=Z.getCenterX(),st+=Z.getCenterY()}R.centerX=X/s.length,R.centerY=st/s.length;for(var dt=0;dt<s.length;dt++){var Z=s[dt];if(R.rows.length==0)this.insertNodeToRow(R,Z,0,N);else if(this.canAddHorizontal(R,Z.rect.width,Z.rect.height)){var ut=R.rows.length-1;if(!R.idealRowWidth)ut=this.getShortestRowIndex(R);this.insertNodeToRow(R,Z,ut,N)}else this.insertNodeToRow(R,Z,R.rows.length,N);this.shiftToLastRow(R)}return R},S.prototype.insertNodeToRow=function(s,N,y,w){var p=w;if(y==s.rows.length){var P=[];s.rows.push(P),s.rowWidth.push(p),s.rowHeight.push(0)}var R=s.rowWidth[y]+N.rect.width;if(s.rows[y].length>0)R+=s.horizontalPadding;if(s.rowWidth[y]=R,s.width<R)s.width=R;var k=N.rect.height;if(y>0)k+=s.verticalPadding;var B=0;if(k>s.rowHeight[y])B=s.rowHeight[y],s.rowHeight[y]=k,B=s.rowHeight[y]-B;s.height+=B,s.rows[y].push(N)},S.prototype.getShortestRowIndex=function(s){var N=-1,y=Number.MAX_VALUE;for(var w=0;w<s.rows.length;w++)if(s.rowWidth[w]<y)N=w,y=s.rowWidth[w];return N},S.prototype.getLongestRowIndex=function(s){var N=-1,y=Number.MIN_VALUE;for(var w=0;w<s.rows.length;w++)if(s.rowWidth[w]>y)N=w,y=s.rowWidth[w];return N},S.prototype.canAddHorizontal=function(s,N,y){if(s.idealRowWidth){var w=s.rows.length-1,p=s.rowWidth[w];return p+N+s.horizontalPadding<=s.idealRowWidth}var P=this.getShortestRowIndex(s);if(P<0)return!0;var R=s.rowWidth[P];if(R+s.horizontalPadding+N<=s.width)return!0;var k=0;if(s.rowHeight[P]<y){if(P>0)k=y+s.verticalPadding-s.rowHeight[P]}var B;if(s.width-R>=N+s.horizontalPadding)B=(s.height+k)/(R+N+s.horizontalPadding);else B=(s.height+k)/s.width;k=y+s.verticalPadding;var X;if(s.width<N)X=(s.height+k)/N;else X=(s.height+k)/s.width;if(X<1)X=1/X;if(B<1)B=1/B;return B<X},S.prototype.shiftToLastRow=function(s){var N=this.getLongestRowIndex(s),y=s.rowWidth.length-1,w=s.rows[N],p=w[w.length-1],P=p.width+s.horizontalPadding;if(s.width-s.rowWidth[y]>P&&N!=y){w.splice(-1,1),s.rows[y].push(p),s.rowWidth[N]=s.rowWidth[N]-P,s.rowWidth[y]=s.rowWidth[y]+P,s.width=s.rowWidth[instance.getLongestRowIndex(s)];var R=Number.MIN_VALUE;for(var k=0;k<w.length;k++)if(w[k].height>R)R=w[k].height;if(N>0)R+=s.verticalPadding;var B=s.rowHeight[N]+s.rowHeight[y];if(s.rowHeight[N]=R,s.rowHeight[y]<p.height+s.verticalPadding)s.rowHeight[y]=p.height+s.verticalPadding;var X=s.rowHeight[N]+s.rowHeight[y];s.height+=X-B,this.shiftToLastRow(s)}},S.prototype.tilingPreLayout=function(){if(c.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},S.prototype.tilingPostLayout=function(){if(c.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},S.prototype.reduceTrees=function(){var s=[],N=!0,y;while(N){var w=this.graphManager.getAllNodes(),p=[];N=!1;for(var P=0;P<w.length;P++)if(y=w[P],y.getEdges().length==1&&!y.getEdges()[0].isInterGraph&&y.getChild()==null){if(c.PURE_INCREMENTAL){var R=y.getEdges()[0].getOtherEnd(y),k=new A(y.getCenterX()-R.getCenterX(),y.getCenterY()-R.getCenterY());p.push([y,y.getEdges()[0],y.getOwner(),k])}else p.push([y,y.getEdges()[0],y.getOwner()]);N=!0}if(N==!0){var B=[];for(var X=0;X<p.length;X++)if(p[X][0].getEdges().length==1)B.push(p[X]),p[X][0].getOwner().remove(p[X][0]);s.push(B),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},S.prototype.growTree=function(s){var N=s.length,y=s[N-1],w;for(var p=0;p<y.length;p++)w=y[p],this.findPlaceforPrunedNode(w),w[2].add(w[0]),w[2].add(w[1],w[1].source,w[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},S.prototype.findPlaceforPrunedNode=function(s){var N,y,w=s[0];if(w==s[1].source)y=s[1].target;else y=s[1].source;if(c.PURE_INCREMENTAL)w.setCenter(y.getCenterX()+s[3].getWidth(),y.getCenterY()+s[3].getHeight());else{var p=y.startX,P=y.finishX,R=y.startY,k=y.finishY,B=0,X=0,st=0,dt=0,Z=[B,st,X,dt];if(R>0)for(var ut=p;ut<=P;ut++)Z[0]+=this.grid[ut][R-1].length+this.grid[ut][R].length-1;if(P<this.grid.length-1)for(var ut=R;ut<=k;ut++)Z[1]+=this.grid[P+1][ut].length+this.grid[P][ut].length-1;if(k<this.grid[0].length-1)for(var ut=p;ut<=P;ut++)Z[2]+=this.grid[ut][k+1].length+this.grid[ut][k].length-1;if(p>0)for(var ut=R;ut<=k;ut++)Z[3]+=this.grid[p-1][ut].length+this.grid[p][ut].length-1;var nt=O.MAX_VALUE,I,K;for(var et=0;et<Z.length;et++)if(Z[et]<nt)nt=Z[et],I=1,K=et;else if(Z[et]==nt)I++;if(I==3&&nt==0){if(Z[0]==0&&Z[1]==0&&Z[2]==0)N=1;else if(Z[0]==0&&Z[1]==0&&Z[3]==0)N=0;else if(Z[0]==0&&Z[2]==0&&Z[3]==0)N=3;else if(Z[1]==0&&Z[2]==0&&Z[3]==0)N=2}else if(I==2&&nt==0){var ct=Math.floor(Math.random()*2);if(Z[0]==0&&Z[1]==0)if(ct==0)N=0;else N=1;else if(Z[0]==0&&Z[2]==0)if(ct==0)N=0;else N=2;else if(Z[0]==0&&Z[3]==0)if(ct==0)N=0;else N=3;else if(Z[1]==0&&Z[2]==0)if(ct==0)N=1;else N=2;else if(Z[1]==0&&Z[3]==0)if(ct==0)N=1;else N=3;else if(ct==0)N=2;else N=3}else if(I==4&&nt==0){var ct=Math.floor(Math.random()*4);N=ct}else N=K;if(N==0)w.setCenter(y.getCenterX(),y.getCenterY()-y.getHeight()/2-f.DEFAULT_EDGE_LENGTH-w.getHeight()/2);else if(N==1)w.setCenter(y.getCenterX()+y.getWidth()/2+f.DEFAULT_EDGE_LENGTH+w.getWidth()/2,y.getCenterY());else if(N==2)w.setCenter(y.getCenterX(),y.getCenterY()+y.getHeight()/2+f.DEFAULT_EDGE_LENGTH+w.getHeight()/2);else w.setCenter(y.getCenterX()-y.getWidth()/2-f.DEFAULT_EDGE_LENGTH-w.getWidth()/2,y.getCenterY())}},o.exports=S},991:(o,n,a)=>{var g=a(551).FDLayoutNode,r=a(551).IMath;function v(e,c,u,f){g.call(this,e,c,u,f)}v.prototype=Object.create(g.prototype);for(var i in g)v[i]=g[i];v.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)},v.prototype.propogateDisplacementToChildren=function(e,c){var u=this.getChild().getNodes(),f;for(var D=0;D<u.length;D++)if(f=u[D],f.getChild()==null)f.displacementX+=e,f.displacementY+=c;else f.propogateDisplacementToChildren(e,c)},v.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},v.prototype.setPred1=function(e){this.pred1=e},v.prototype.getPred1=function(){return pred1},v.prototype.getPred2=function(){return pred2},v.prototype.setNext=function(e){this.next=e},v.prototype.getNext=function(){return next},v.prototype.setProcessed=function(e){this.processed=e},v.prototype.isProcessed=function(){return processed},o.exports=v},902:(o,n,a)=>{function g(u){if(Array.isArray(u)){for(var f=0,D=Array(u.length);f<u.length;f++)D[f]=u[f];return D}else return Array.from(u)}var r=a(806),v=a(551).LinkedList,i=a(551).Matrix,e=a(551).SVD;function c(){}c.handleConstraints=function(u){var f={};f.fixedNodeConstraint=u.constraints.fixedNodeConstraint,f.alignmentConstraint=u.constraints.alignmentConstraint,f.relativePlacementConstraint=u.constraints.relativePlacementConstraint;var D=new Map,E=new Map,T=[],A=[],G=u.getAllNodes(),O=0;for(var V=0;V<G.length;V++){var _=G[V];if(_.getChild()==null)E.set(_.id,O++),T.push(_.getCenterX()),A.push(_.getCenterY()),D.set(_.id,_)}if(f.relativePlacementConstraint)f.relativePlacementConstraint.forEach(function(J){if(!J.gap&&J.gap!=0)if(J.left)J.gap=r.DEFAULT_EDGE_LENGTH+D.get(J.left).getWidth()/2+D.get(J.right).getWidth()/2;else J.gap=r.DEFAULT_EDGE_LENGTH+D.get(J.top).getHeight()/2+D.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+=T[E.get(ot)],at+=A[E.get(ot)]}),{x:it/rt.size,y:at/rt.size}},S=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 v;if(Mt.forEach(function(Tt,yt){if(Tt==0){if(Ct.push(yt),!at)if(it=="horizontal")ht.set(yt,E.has(yt)?T[E.get(yt)]:ot.get(yt));else ht.set(yt,E.has(yt)?A[E.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,E.has(wt)?T[E.get(wt)]:ot.get(wt)),Dt+=ht.get(wt);else ht.set(wt,E.has(wt)?A[E.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+=E.has(wt)?T[E.get(wt)]:ot.get(wt);else mt+=E.has(wt)?A[E.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=E.has(mt.id)?T[E.get(mt.id)]:ot.get(mt.id);else wt=E.has(mt.id)?A[E.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(g(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=E.has($t)?T[E.get($t)]:ot.get($t);else jt=E.has($t)?A[E.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(de){re=!0,Wt=de}finally{try{if(!Vt&&bt.return)bt.return()}finally{if(re)throw Wt}}var we=(Dt+wt)/2-(mt+Zt)/2,he=!0,fe=!1,ce=void 0;try{for(var le=Tt[Symbol.iterator](),Ne;!(he=(Ne=le.next()).done);he=!0){var ge=Ne.value;ht.set(ge,ht.get(ge)+we)}}catch(de){fe=!0,ce=de}finally{try{if(!he&&le.return)le.return()}finally{if(fe)throw ce}}})}return ht},tt=function(rt){var it=0,at=0,ot=0,gt=0;if(rt.forEach(function(Lt){if(Lt.left)T[E.get(Lt.left)]-T[E.get(Lt.right)]>=0?it++:at++;else A[E.get(Lt.top)]-A[E.get(Lt.bottom)]>=0?ot++:gt++}),it>at&&ot>gt)for(var At=0;At<E.size;At++)T[At]=-1*T[At],A[At]=-1*A[At];else if(it>at)for(var Mt=0;Mt<E.size;Mt++)T[Mt]=-1*T[Mt];else if(ot>gt)for(var ht=0;ht<E.size;ht++)A[ht]=-1*A[ht]},s=function(rt){var it=[],at=new v,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},N=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},y=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},w=[],p=[],P=!1,R=!1,k=new Set,B=new Map,X=new Map,st=[];if(f.fixedNodeConstraint)f.fixedNodeConstraint.forEach(function(J){k.add(J.nodeId)});if(f.relativePlacementConstraint)f.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,[])}}),X=N(B),st=s(X);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(f.fixedNodeConstraint&&f.fixedNodeConstraint.length>1)f.fixedNodeConstraint.forEach(function(J,rt){w[rt]=[J.position.x,J.position.y],p[rt]=[T[E.get(J.nodeId)],A[E.get(J.nodeId)]]}),P=!0;else if(f.alignmentConstraint)(function(){var J=0;if(f.alignmentConstraint.vertical){var rt=f.alignmentConstraint.vertical,it=function(ht){var Lt=new Set;rt[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(g(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=T[E.get(Ct.values().next().value)];else pt=lt(Lt).x;rt[ht].forEach(function(Ot){w[J]=[pt,A[E.get(Ot)]],p[J]=[T[E.get(Ot)],A[E.get(Ot)]],J++})};for(var at=0;at<rt.length;at++)it(at);P=!0}if(f.alignmentConstraint.horizontal){var ot=f.alignmentConstraint.horizontal,gt=function(ht){var Lt=new Set;ot[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(g(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=T[E.get(Ct.values().next().value)];else pt=lt(Lt).y;ot[ht].forEach(function(Ot){w[J]=[T[E.get(Ot)],pt],p[J]=[T[E.get(Ot)],A[E.get(Ot)]],J++})};for(var At=0;At<ot.length;At++)gt(At);P=!0}if(f.relativePlacementConstraint)R=!0})();else if(f.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<X.size/2)tt(f.relativePlacementConstraint),P=!1,R=!1;else{var nt=new Map,I=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(I.has(J))I.get(J).push(rt);else I.set(J,[rt]);if(!I.has(rt.id))I.set(rt.id,[]);K.push({top:J,bottom:rt.id})}})}),tt(K),R=!1;var et=S(nt,"horizontal"),ct=S(I,"vertical");st[Z].forEach(function(J,rt){if(p[rt]=[T[E.get(J)],A[E.get(J)]],w[rt]=[],et.has(J))w[rt][0]=et.get(J);else w[rt][0]=T[E.get(J)];if(ct.has(J))w[rt][1]=ct.get(J);else w[rt][1]=A[E.get(J)]}),P=!0}}if(P){var Nt=void 0,Pt=i.transpose(w),Bt=i.transpose(p);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<E.size;Et++){var vt=[T[Et],A[Et]],xt=[Nt[0][0],Nt[1][0]],Rt=[Nt[0][1],Nt[1][1]];T[Et]=i.dotProduct(vt,xt),A[Et]=i.dotProduct(vt,Rt)}if(R)tt(f.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(f.fixedNodeConstraint&&f.fixedNodeConstraint.length>0){var Gt={x:0,y:0};f.fixedNodeConstraint.forEach(function(J,rt){var it={x:T[E.get(J.nodeId)],y:A[E.get(J.nodeId)]},at=J.position,ot=Q(at,it);Gt.x+=ot.x,Gt.y+=ot.y}),Gt.x/=f.fixedNodeConstraint.length,Gt.y/=f.fixedNodeConstraint.length,T.forEach(function(J,rt){T[rt]+=Gt.x}),A.forEach(function(J,rt){A[rt]+=Gt.y}),f.fixedNodeConstraint.forEach(function(J){T[E.get(J.nodeId)]=J.position.x,A[E.get(J.nodeId)]=J.position.y})}if(f.alignmentConstraint){if(f.alignmentConstraint.vertical){var St=f.alignmentConstraint.vertical,Ft=function(rt){var it=new Set;St[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(g(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=T[E.get(at.values().next().value)];else ot=lt(it).x;it.forEach(function(gt){if(!k.has(gt))T[E.get(gt)]=ot})};for(var Ht=0;Ht<St.length;Ht++)Ft(Ht)}if(f.alignmentConstraint.horizontal){var zt=f.alignmentConstraint.horizontal,ee=function(rt){var it=new Set;zt[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(g(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=A[E.get(at.values().next().value)];else ot=lt(it).y;it.forEach(function(gt){if(!k.has(gt))A[E.get(gt)]=ot})};for(var qt=0;qt<zt.length;qt++)ee(qt)}}if(f.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)}),f.alignmentConstraint){if(f.alignmentConstraint.vertical){var ht=f.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,T[E.get(ht[It][0])])};for(var Ct=0;Ct<ht.length;Ct++)Lt(Ct)}if(f.alignmentConstraint.horizontal){var pt=f.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,A[E.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=N(Tt),ae=N(yt),$t=s(bt),jt=s(ae),ie=y(Tt),we=y(yt),he=[],fe=[];$t.forEach(function(Qt,It){he[It]=[],Qt.forEach(function(Yt){if(ie.get(Yt).length==0)he[It].push(Yt)})}),jt.forEach(function(Qt,It){fe[It]=[],Qt.forEach(function(Yt){if(we.get(Yt).length==0)fe[It].push(Yt)})});var ce=S(Tt,"horizontal",At,ot,he),le=S(yt,"vertical",Mt,gt,fe),Ne=function(It){if(it.get(It))it.get(It).forEach(function(Yt){T[E.get(Yt)]=ce.get(It)});else T[E.get(It)]=ce.get(It)},ge=!0,de=!1,Ye=void 0;try{for(var Me=ce.keys()[Symbol.iterator](),Xe;!(ge=(Xe=Me.next()).done);ge=!0){var Ce=Xe.value;Ne(Ce)}}catch(Qt){de=!0,Ye=Qt}finally{try{if(!ge&&Me.return)Me.return()}finally{if(de)throw Ye}}var sr=function(It){if(at.get(It))at.get(It).forEach(function(Yt){A[E.get(Yt)]=le.get(It)});else A[E.get(It)]=le.get(It)},De=!0,He=!1,We=void 0;try{for(var Oe=le.keys()[Symbol.iterator](),Ve;!(De=(Ve=Oe.next()).done);De=!0){var Ce=Ve.value;sr(Ce)}}catch(Qt){He=!0,We=Qt}finally{try{if(!De&&Oe.return)Oe.return()}finally{if(He)throw We}}})()}for(var Kt=0;Kt<G.length;Kt++){var kt=G[Kt];if(kt.getChild()==null)kt.setCenter(T[E.get(kt.id)],A[E.get(kt.id)])}},o.exports=c},551:(o)=>{o.exports=L}},M={};function d(o){var n=M[o];if(n!==void 0)return n.exports;var a=M[o]={exports:{}};return x[o](a,a.exports,d),a.exports}var h=d(45);return h})()})});var ze=zn(function(Ee,be){(function(x,M){if(typeof Ee==="object"&&typeof be==="object")be.exports=M(Fe());else if(typeof define==="function"&&define.amd)define(["cose-base"],M);else if(typeof Ee==="object")Ee.cytoscapeFcose=M(Fe());else x.cytoscapeFcose=M(x.coseBase)})(Ee,function(L){return(()=>{var x={658:(o)=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(n){for(var a=arguments.length,g=Array(a>1?a-1:0),r=1;r<a;r++)g[r-1]=arguments[r];return g.forEach(function(v){Object.keys(v).forEach(function(i){return n[i]=v[i]})}),n}},548:(o,n,a)=>{var g=function(){function i(e,c){var u=[],f=!0,D=!1,E=void 0;try{for(var T=e[Symbol.iterator](),A;!(f=(A=T.next()).done);f=!0)if(u.push(A.value),c&&u.length===c)break}catch(G){D=!0,E=G}finally{try{if(!f&&T.return)T.return()}finally{if(D)throw E}}return u}return function(e,c){if(Array.isArray(e))return e;else if(Symbol.iterator in Object(e))return i(e,c);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(140).layoutBase.LinkedList,v={};v.getTopMostNodes=function(i){var e={};for(var c=0;c<i.length;c++)e[i[c].id()]=!0;var u=i.filter(function(f,D){if(typeof f==="number")f=D;var E=f.parent()[0];while(E!=null){if(e[E.id()])return!1;E=E.parent()[0]}return!0});return u},v.connectComponents=function(i,e,c,u){var f=new r,D=new Set,E=[],T=void 0,A=void 0,G=void 0,O=!1,V=1,_=[],Q=[],lt=function(){var tt=i.collection();Q.push(tt);var s=c[0],N=i.collection();N.merge(s).merge(s.descendants().intersection(e)),E.push(s),N.forEach(function(p){f.push(p),D.add(p),tt.merge(p)});var y=function(){s=f.shift();var P=i.collection();s.neighborhood().nodes().forEach(function(X){if(e.intersection(s.edgesWith(X)).length>0)P.merge(X)});for(var R=0;R<P.length;R++){var k=P[R];if(T=c.intersection(k.union(k.ancestors())),T!=null&&!D.has(T[0])){var B=T.union(T.descendants());B.forEach(function(X){if(f.push(X),D.add(X),tt.merge(X),c.has(X))E.push(X)})}}};while(f.length!=0)y();if(tt.forEach(function(p){e.intersection(p.connectedEdges()).forEach(function(P){if(tt.has(P.source())&&tt.has(P.target()))tt.merge(P)})}),E.length==c.length)O=!0;if(!O||O&&V>1){A=E[0],G=A.connectedEdges().length,E.forEach(function(p){if(p.connectedEdges().length<G)G=p.connectedEdges().length,A=p}),_.push(A.id());var w=i.collection();w.merge(E[0]),E.forEach(function(p){w.merge(p)}),E=[],c=c.difference(w),V++}};do lt();while(!O);if(u){if(_.length>0)u.set("dummy"+(u.size+1),_)}return Q},v.relocateComponent=function(i,e,c){if(!c.fixedNodeConstraint){var{POSITIVE_INFINITY:u,NEGATIVE_INFINITY:f,POSITIVE_INFINITY:D,NEGATIVE_INFINITY:E}=Number;if(c.quality=="draft"){var T=!0,A=!1,G=void 0;try{for(var O=e.nodeIndexes[Symbol.iterator](),V;!(T=(V=O.next()).done);T=!0){var _=V.value,Q=g(_,2),lt=Q[0],S=Q[1],tt=c.cy.getElementById(lt);if(tt){var s=tt.boundingBox(),N=e.xCoords[S]-s.w/2,y=e.xCoords[S]+s.w/2,w=e.yCoords[S]-s.h/2,p=e.yCoords[S]+s.h/2;if(N<u)u=N;if(y>f)f=y;if(w<D)D=w;if(p>E)E=p}}}catch(X){A=!0,G=X}finally{try{if(!T&&O.return)O.return()}finally{if(A)throw G}}var P=i.x-(f+u)/2,R=i.y-(E+D)/2;e.xCoords=e.xCoords.map(function(X){return X+P}),e.yCoords=e.yCoords.map(function(X){return X+R})}else{Object.keys(e).forEach(function(X){var st=e[X],dt=st.getRect().x,Z=st.getRect().x+st.getRect().width,ut=st.getRect().y,nt=st.getRect().y+st.getRect().height;if(dt<u)u=dt;if(Z>f)f=Z;if(ut<D)D=ut;if(nt>E)E=nt});var k=i.x-(f+u)/2,B=i.y-(E+D)/2;Object.keys(e).forEach(function(X){var st=e[X];st.setCenter(st.getCenterX()+k,st.getCenterY()+B)})}}},v.calcBoundingBox=function(i,e,c,u){var{MAX_SAFE_INTEGER:f,MIN_SAFE_INTEGER:D,MAX_SAFE_INTEGER:E,MIN_SAFE_INTEGER:T}=Number,A=void 0,G=void 0,O=void 0,V=void 0,_=i.descendants().not(":parent"),Q=_.length;for(var lt=0;lt<Q;lt++){var S=_[lt];if(A=e[u.get(S.id())]-S.width()/2,G=e[u.get(S.id())]+S.width()/2,O=c[u.get(S.id())]-S.height()/2,V=c[u.get(S.id())]+S.height()/2,f>A)f=A;if(D<G)D=G;if(E>O)E=O;if(T<V)T=V}var tt={};return tt.topLeftX=f,tt.topLeftY=E,tt.width=D-f,tt.height=T-E,tt},v.calcParentsWithoutChildren=function(i,e){var c=i.collection();return e.nodes(":parent").forEach(function(u){var f=!1;if(u.children().forEach(function(D){if(D.css("display")!="none")f=!0}),!f)c.merge(u)}),c},o.exports=v},816:(o,n,a)=>{var g=a(548),r=a(140).CoSELayout,v=a(140).CoSENode,i=a(140).layoutBase.PointD,e=a(140).layoutBase.DimensionD,c=a(140).layoutBase.LayoutConstants,u=a(140).layoutBase.FDLayoutConstants,f=a(140).CoSEConstants,D=function(T,A){var{cy:G,eles:O}=T,V=O.nodes(),_=O.edges(),Q=void 0,lt=void 0,S=void 0,tt={};if(T.randomize)Q=A.nodeIndexes,lt=A.xCoords,S=A.yCoords;var s=function(X){return typeof X==="function"},N=function(X,st){if(s(X))return X(st);else return X},y=g.calcParentsWithoutChildren(G,O),w=function B(X,st,dt,Z){var ut=st.length;for(var nt=0;nt<ut;nt++){var I=st[nt],K=null;if(I.intersection(y).length==0)K=I.children();var et=void 0,ct=I.layoutDimensions({nodeDimensionsIncludeLabels:Z.nodeDimensionsIncludeLabels});if(I.outerWidth()!=null&&I.outerHeight()!=null)if(Z.randomize)if(!I.isParent())et=X.add(new v(dt.graphManager,new i(lt[Q.get(I.id())]-ct.w/2,S[Q.get(I.id())]-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else{var Nt=g.calcBoundingBox(I,lt,S,Q);if(I.intersection(y).length==0)et=X.add(new v(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(Nt.width,Nt.height)));else et=X.add(new v(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(parseFloat(ct.w),parseFloat(ct.h))))}else et=X.add(new v(dt.graphManager,new i(I.position("x")-ct.w/2,I.position("y")-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else et=X.add(new v(this.graphManager));if(et.id=I.data("id"),et.nodeRepulsion=N(Z.nodeRepulsion,I),et.paddingLeft=parseInt(I.css("padding")),et.paddingTop=parseInt(I.css("padding")),et.paddingRight=parseInt(I.css("padding")),et.paddingBottom=parseInt(I.css("padding")),Z.nodeDimensionsIncludeLabels)et.labelWidth=I.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,et.labelHeight=I.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,et.labelPosVertical=I.css("text-valign"),et.labelPosHorizontal=I.css("text-halign");if(tt[I.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)}}},p=function(X,st,dt){var Z=0,ut=0;for(var nt=0;nt<dt.length;nt++){var I=dt[nt],K=tt[I.data("source")],et=tt[I.data("target")];if(K&&et&&K!==et&&K.getEdgesBetween(et).length==0){var ct=st.add(X.newEdge(),K,et);ct.id=I.id(),ct.idealLength=N(T.idealEdgeLength,I),ct.edgeElasticity=N(T.edgeElasticity,I),Z+=ct.idealLength,ut++}}if(T.idealEdgeLength!=null){if(ut>0)f.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=Z/ut;else if(!s(T.idealEdgeLength))f.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=T.idealEdgeLength;else f.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50;f.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,f.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH}},P=function(X,st){if(st.fixedNodeConstraint)X.constraints.fixedNodeConstraint=st.fixedNodeConstraint;if(st.alignmentConstraint)X.constraints.alignmentConstraint=st.alignmentConstraint;if(st.relativePlacementConstraint)X.constraints.relativePlacementConstraint=st.relativePlacementConstraint};if(T.nestingFactor!=null)f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=T.nestingFactor;if(T.gravity!=null)f.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=T.gravity;if(T.numIter!=null)f.MAX_ITERATIONS=u.MAX_ITERATIONS=T.numIter;if(T.gravityRange!=null)f.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=T.gravityRange;if(T.gravityCompound!=null)f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=T.gravityCompound;if(T.gravityRangeCompound!=null)f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=T.gravityRangeCompound;if(T.initialEnergyOnIncremental!=null)f.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=T.initialEnergyOnIncremental;if(T.tilingCompareBy!=null)f.TILING_COMPARE_BY=T.tilingCompareBy;if(T.quality=="proof")c.QUALITY=2;else c.QUALITY=0;if(f.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=T.nodeDimensionsIncludeLabels,f.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!T.randomize,f.ANIMATE=u.ANIMATE=c.ANIMATE=T.animate,f.TILE=T.tile,f.TILING_PADDING_VERTICAL=typeof T.tilingPaddingVertical==="function"?T.tilingPaddingVertical.call():T.tilingPaddingVertical,f.TILING_PADDING_HORIZONTAL=typeof T.tilingPaddingHorizontal==="function"?T.tilingPaddingHorizontal.call():T.tilingPaddingHorizontal,f.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,f.PURE_INCREMENTAL=!T.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=T.uniformNodeDimensions,T.step=="transformed")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!1;if(T.step=="enforced")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!1;if(T.step=="cose")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!0;if(T.step=="all"){if(T.randomize)f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!0}if(T.fixedNodeConstraint||T.alignmentConstraint||T.relativePlacementConstraint)f.TREE_REDUCTION_ON_INCREMENTAL=!1;else f.TREE_REDUCTION_ON_INCREMENTAL=!0;var R=new r,k=R.newGraphManager();return w(k.addRoot(),g.getTopMostNodes(V),R,T),p(R,k,_),P(R,T),R.runLayout(),tt};o.exports={coseLayout:D}},212:(o,n,a)=>{var g=function(){function T(A,G){for(var O=0;O<G.length;O++){var V=G[O];if(V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V)V.writable=!0;Object.defineProperty(A,V.key,V)}}return function(A,G,O){if(G)T(A.prototype,G);if(O)T(A,O);return A}}();function r(T,A){if(!(T instanceof A))throw TypeError("Cannot call a class as a function")}var v=a(658),i=a(548),e=a(657),c=e.spectralLayout,u=a(816),f=u.coseLayout,D=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(A){return 4500},idealEdgeLength:function(A){return 50},edgeElasticity:function(A){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(){}}),E=function(){function T(A){r(this,T),this.options=v({},D,A)}return g(T,[{key:"run",value:function(){var G=this,O=this.options,{cy:V,eles:_}=O,Q=[],lt=void 0,S=void 0,tt=[],s=void 0,N=[];if(O.fixedNodeConstraint&&(!Array.isArray(O.fixedNodeConstraint)||O.fixedNodeConstraint.length==0))O.fixedNodeConstraint=void 0;if(O.alignmentConstraint){if(O.alignmentConstraint.vertical&&(!Array.isArray(O.alignmentConstraint.vertical)||O.alignmentConstraint.vertical.length==0))O.alignmentConstraint.vertical=void 0;if(O.alignmentConstraint.horizontal&&(!Array.isArray(O.alignmentConstraint.horizontal)||O.alignmentConstraint.horizontal.length==0))O.alignmentConstraint.horizontal=void 0}if(O.relativePlacementConstraint&&(!Array.isArray(O.relativePlacementConstraint)||O.relativePlacementConstraint.length==0))O.relativePlacementConstraint=void 0;var y=O.fixedNodeConstraint||O.alignmentConstraint||O.relativePlacementConstraint;if(y)O.tile=!1,O.packComponents=!1;var w=void 0,p=!1;if(V.layoutUtilities&&O.packComponents){if(w=V.layoutUtilities("get"),!w)w=V.layoutUtilities();p=!0}if(_.nodes().length>0)if(!p){var P=O.eles.boundingBox();if(N.push({x:P.x1+P.w/2,y:P.y1+P.h/2}),O.randomize){var R=c(O);Q.push(R)}if(O.quality=="default"||O.quality=="proof")tt.push(f(O,Q[0])),i.relocateComponent(N[0],tt[0],O);else i.relocateComponent(N[0],Q[0],O)}else{var k=i.getTopMostNodes(O.eles.nodes());if(s=i.connectComponents(V,O.eles,k),s.forEach(function(Et){var vt=Et.boundingBox();N.push({x:vt.x1+vt.w/2,y:vt.y1+vt.h/2})}),O.randomize)s.forEach(function(Et){O.eles=Et,Q.push(c(O))});if(O.quality=="default"||O.quality=="proof"){var B=V.collection();if(O.tile){var X=new Map,st=[],dt=[],Z=0,ut={nodeIndexes:X,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 I=B.boundingBox();N.push({x:I.x1+I.w/2,y:I.y1+I.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),N.splice(nt[K],1)}}s.forEach(function(Et,vt){O.eles=Et,tt.push(f(O,Q[vt])),i.relocateComponent(N[vt],tt[vt],O)})}else s.forEach(function(Et,vt){i.relocateComponent(N[vt],Q[vt],O)});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(O.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(O.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(O.quality=="draft"){var zt=xt.get(Ft.id()),ee=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[ee]),Kt.push(Q[vt].yCoords[ee]);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=w.packComponents(ct,O.randomize).shifts;if(O.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(O.quality=="default"||O.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]}),O.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(O.quality=="default"||O.quality=="proof"||O.randomize){var Jt=i.calcParentsWithoutChildren(V,_),Xt=_.filter(function(Et){return Et.css("display")=="none"});if(O.eles=_.not(Xt),_.nodes().not(":parent").not(Xt).layoutPositions(G,O,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'.")}}]),T}();o.exports=E},657:(o,n,a)=>{var g=a(548),r=a(140).layoutBase.Matrix,v=a(140).layoutBase.SVD,i=function(c){var{cy:u,eles:f}=c,D=f.nodes(),E=f.nodes(":parent"),T=new Map,A=new Map,G=new Map,O=[],V=[],_=[],Q=[],lt=[],S=[],tt=[],s=[],N=void 0,y=void 0,w=1e8,p=0.000000001,{piTol:P,samplingType:R,nodeSeparation:k}=c,B=void 0,X=function(){var it=0,at=0,ot=!1;while(at<B){it=Math.floor(Math.random()*y),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<y;Ut++)Ct[Ut]=w;gt[Mt]=it,Ct[it]=0;while(Mt>=At){ht=gt[At++];var Tt=O[ht];for(var yt=0;yt<Tt.length;yt++)if(Lt=A.get(Tt[yt]),Ct[Lt]==w)Ct[Lt]=Ct[ht]+1,gt[++Mt]=Lt;S[ht][at]=Ct[ht]*k}if(ot){for(var Dt=0;Dt<y;Dt++)if(S[Dt][at]<lt[Dt])lt[Dt]=S[Dt][at];for(var mt=0;mt<y;mt++)if(lt[mt]>pt)pt=lt[mt],Ot=mt}return Ot},dt=function(it){var at=void 0;if(!it){X();for(var ot=0;ot<B;ot++)st(Q[ot],ot,it,!1)}else{at=Math.floor(Math.random()*y),N=at;for(var gt=0;gt<y;gt++)lt[gt]=w;for(var At=0;At<B;At++)Q[At]=at,at=st(at,At,it)}for(var Mt=0;Mt<y;Mt++)for(var ht=0;ht<B;ht++)S[Mt][ht]*=S[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]=S[Q[pt]][Ct]},Z=function(){var it=v.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<y;ht++)ot[ht]=Math.random(),gt[ht]=Math.random();ot=r.normalize(ot),gt=r.normalize(gt);var Lt=0,Ct=p,pt=p,Ot=void 0;while(!0){Lt++;for(var Ut=0;Ut<y;Ut++)At[Ut]=ot[Ut];if(ot=r.multGamma(r.multL(r.multGamma(At),S,s)),it=r.dotProduct(At,ot),ot=r.normalize(ot),Ct=r.dotProduct(At,ot),Ot=Math.abs(Ct/pt),Ot<=1+P&&Ot>=1)break;pt=Ct}for(var Tt=0;Tt<y;Tt++)At[Tt]=ot[Tt];Lt=0,pt=p;while(!0){Lt++;for(var yt=0;yt<y;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),S,s)),at=r.dotProduct(Mt,gt),gt=r.normalize(gt),Ct=r.dotProduct(Mt,gt),Ot=Math.abs(Ct/pt),Ot<=1+P&&Ot>=1)break;pt=Ct}for(var Dt=0;Dt<y;Dt++)Mt[Dt]=gt[Dt];V=r.multCons(At,Math.sqrt(Math.abs(it))),_=r.multCons(Mt,Math.sqrt(Math.abs(at)))};g.connectComponents(u,f,g.getTopMostNodes(D),T),E.forEach(function(rt){g.connectComponents(u,f,g.getTopMostNodes(rt.descendants().intersection(f)),T)});var nt=0;for(var I=0;I<D.length;I++)if(!D[I].isParent())A.set(D[I].id(),nt++);var K=!0,et=!1,ct=void 0;try{for(var Nt=T.keys()[Symbol.iterator](),Pt;!(K=(Pt=Nt.next()).done);K=!0){var Bt=Pt.value;A.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<A.size;ft++)O[ft]=[];E.forEach(function(rt){var it=rt.children().intersection(f);while(it.nodes(":childless").length==0)it=it.nodes()[0].children().intersection(f);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}),G.set(rt.id(),it.nodes(":childless")[at].id())}),D.forEach(function(rt){var it=void 0;if(rt.isParent())it=A.get(G.get(rt.id()));else it=A.get(rt.id());rt.neighborhood().nodes().forEach(function(at){if(f.intersection(rt.edgesWith(at)).length>0)if(at.isParent())O[it].push(G.get(at.id()));else O[it].push(at.id())})});var Jt=function(it){var at=A.get(it),ot=void 0;T.get(it).forEach(function(gt){if(u.getElementById(gt).isParent())ot=G.get(gt);else ot=gt;O[at].push(ot),O[A.get(ot)].push(it)})},Xt=!0,Et=!1,vt=void 0;try{for(var xt=T.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}}y=A.size;var St=void 0;if(y>2){B=y<c.sampleSize?y:c.sampleSize;for(var Ft=0;Ft<y;Ft++)S[Ft]=[];for(var Ht=0;Ht<B;Ht++)s[Ht]=[];if(c.quality=="draft"||c.step=="all")dt(R),Z(),ut(),St={nodeIndexes:A,xCoords:V,yCoords:_};else A.forEach(function(rt,it){V.push(u.getElementById(it).position("x")),_.push(u.getElementById(it).position("y"))}),St={nodeIndexes:A,xCoords:V,yCoords:_};return St}else{var zt=A.keys(),ee=u.getElementById(zt.next().value),qt=ee.position(),Kt=ee.outerWidth();if(V.push(qt.x),_.push(qt.y),y==2){var kt=u.getElementById(zt.next().value),J=kt.outerWidth();V.push(qt.x+Kt/2+J/2+c.idealEdgeLength),_.push(qt.y)}return St={nodeIndexes:A,xCoords:V,yCoords:_},St}};o.exports={spectralLayout:i}},579:(o,n,a)=>{var g=a(212),r=function(i){if(!i)return;i("layout","fcose",g)};if(typeof cytoscape<"u")r(cytoscape);o.exports=r},140:(o)=>{o.exports=L}},M={};function d(o){var n=M[o];if(n!==void 0)return n.exports;var a=M[o]={exports:{}};return x[o](a,a.exports,d),a.exports}var h=d(579);return h})()})});var Ke=xn(ze(),1);var $e={L:"left",R:"right",T:"top",B:"bottom"},Be={L:t((L)=>`${L},${L/2} 0,${L} 0,0`,"L"),R:t((L)=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:t((L)=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:t((L)=>`${L/2},0 ${L},${L} 0,${L}`,"B")},Le={L:t((L,x)=>L-x+2,"L"),R:t((L,x)=>L-2,"R"),T:t((L,x)=>L-x+2,"T"),B:t((L,x)=>L-2,"B")},hr=t(function(L){if(_t(L))return L==="L"?"R":"L";else return L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ze=t(function(L){let x=L;return x==="L"||x==="R"||x==="T"||x==="B"},"isArchitectureDirection"),_t=t(function(L){let x=L;return x==="L"||x==="R"},"isArchitectureDirectionX"),se=t(function(L){let x=L;return x==="T"||x==="B"},"isArchitectureDirectionY"),Ue=t(function(L,x){let M=_t(L)&&se(x),d=se(L)&&_t(x);return M||d},"isArchitectureDirectionXY"),lr=t(function(L){let x=L[0],M=L[1],d=_t(x)&&se(M),h=se(x)&&_t(M);return d||h},"isArchitecturePairXY"),fr=t(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),Pe=t(function(L,x){let M=`${L}${x}`;return fr(M)?M:void 0},"getArchitectureDirectionPair"),cr=t(function([L,x],M){let d=M[0],h=M[1];if(_t(d))if(se(h))return[L+(d==="L"?-1:1),x+(h==="T"?1:-1)];else return[L+(d==="L"?-1:1),x];else if(_t(h))return[L+(h==="L"?1:-1),x+(d==="T"?1:-1)];else return[L,x+(d==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),gr=t(function(L){if(L==="LT"||L==="TL")return[1,1];else if(L==="BL"||L==="LB")return[1,-1];else if(L==="BR"||L==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),ur=t(function(L,x){if(Ue(L,x))return"bend";else if(_t(L))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),dr=t(function(L){return L.type==="service"},"isArchitectureService"),vr=t(function(L){return L.type==="junction"},"isArchitectureJunction"),ke=t((L,x)=>{let[M,d]=[L,x].sort();return`${JSON.stringify(M)}-${JSON.stringify(d)}`},"architectureGroupAlignmentKey"),qe=t((L)=>L.data(),"edgeData"),pe=t((L)=>L.data(),"nodeData"),pr=Y.architecture,Qe=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=z,this.getAccTitle=j,this.setDiagramTitle=W,this.getDiagramTitle=q,this.getAccDescription=H,this.setAccDescription=U,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}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="",F()}addService({id:L,icon:x,in:M,title:d,iconText:h}){if(this.registeredIds.has(L))throw Error(`The service id [${L}] is already in use by another ${this.registeredIds.get(L)}`);if(M!==void 0){if(L===M)throw Error(`The service [${L}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(M)==="node")throw Error(`The service [${L}]'s parent is not a group`)}this.registeredIds.set(L,"node"),this.nodes.set(L,{id:L,type:"service",icon:x,iconText:h,title:d,edges:[],in:M})}getServices(){return[...this.nodes.values()].filter(dr)}addJunction({id:L,in:x}){if(this.registeredIds.has(L))throw Error(`The junction id [${L}] is already in use by another ${this.registeredIds.get(L)}`);if(x!==void 0){if(L===x)throw Error(`The junction [${L}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(x)==="node")throw Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds.set(L,"node"),this.nodes.set(L,{id:L,type:"junction",edges:[],in:x})}getJunctions(){return[...this.nodes.values()].filter(vr)}getNodes(){return[...this.nodes.values()]}getNode(L){return this.nodes.get(L)??null}addGroup({id:L,icon:x,in:M,title:d}){if(this.registeredIds.has(L))throw Error(`The group id [${L}] is already in use by another ${this.registeredIds.get(L)}`);if(M!==void 0){if(L===M)throw Error(`The group [${L}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(M)==="node")throw Error(`The group [${L}]'s parent is not a group`)}this.registeredIds.set(L,"group"),this.groups.set(L,{id:L,icon:x,title:d,in:M})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:L,rhsId:x,lhsDir:M,rhsDir:d,lhsInto:h,rhsInto:o,lhsGroup:n,rhsGroup:a,title:g}){if(!Ze(M))throw Error(`Invalid direction given for left hand side of edge ${L}--${x}. Expected (L,R,T,B) got ${String(M)}`);if(!Ze(d))throw Error(`Invalid direction given for right hand side of edge ${L}--${x}. Expected (L,R,T,B) got ${String(d)}`);if(!this.nodes.has(L)&&!this.groups.has(L))throw Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(x)&&!this.groups.has(x))throw Error(`The right-hand id [${x}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(L).in,v=this.nodes.get(x).in;if(n&&r&&v&&r==v)throw Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&r&&v&&r==v)throw Error(`The right-hand id [${x}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:L,lhsDir:M,lhsInto:h,lhsGroup:n,rhsId:x,rhsDir:d,rhsInto:o,rhsGroup:a,title:g};this.edges.push(i);let e=this.nodes.get(L),c=this.nodes.get(x);if(e&&c)e.edges.push(this.edges[this.edges.length-1]),c.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw Error(`An align directive requires at least two members; got ${L.members.length}`);let x=new Set;L.members.forEach((M)=>{if(this.registeredIds.get(M)!=="node")throw Error(`align ${L.direction} references [${M}], which is not a service or junction`);if(x.has(M))throw Error(`align ${L.direction} lists [${M}] more than once`);x.add(M)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let L=new Map,x=new Map;for(let[n,a]of this.nodes.entries()){let g=new Map;for(let r of a.edges){let v=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(v&&i&&v!==i){let e=ur(r.lhsDir,r.rhsDir);if(e!=="bend")L.set(ke(v,i),e)}if(r.lhsId===n){let e=Pe(r.lhsDir,r.rhsDir);if(e)g.set(e,r.rhsId)}else{let e=Pe(r.rhsDir,r.lhsDir);if(e)g.set(e,r.lhsId)}}x.set(n,g)}let M=new Set,d=new Set(x.keys()),h=t((n)=>{let a=new Map([[n,[0,0]]]),g=[n];while(g.length>0){let r=g.shift();if(r){M.add(r),d.delete(r);let v=x.get(r);if(!v)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,c]=i;v.forEach((u,f)=>{if(!M.has(u))a.set(u,cr([e,c],f)),g.push(u)})}}return a},"BFS"),o=[];while(d.size>0){let n=d.values().next().value;o.push(h(n))}this.dataStructures={adjList:x,spatialMaps:o,groupAlignments:L}}return this.dataStructures}setElementForId(L,x){this.elements.set(L,x)}getElementById(L){return this.elements.get(L)}getConfig(){return ue({...pr,...C().architecture})}getConfigField(L){return this.getConfig()[L]}},mr=t((L,x)=>{xe(L,x),L.groups.map((M)=>x.addGroup(M)),L.services.map((M)=>x.addService({...M,type:"service"})),L.junctions.map((M)=>x.addJunction({...M,type:"junction"})),L.edges.map((M)=>x.addEdge(M)),L.alignments?.map((M)=>x.addLayoutHint({direction:M.direction,members:[...M.members]}))},"populateDb"),Je={parser:{yy:void 0},parse:t(async(L)=>{let x=await je("architecture",L);l.debug(x);let M=Je.parser?.yy;if(!(M instanceof Qe))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(x,M)},"parse")},Er=t((L)=>`
|
|
1
|
+
import{ke}from"./index-r7h4pm42.js";import{t,l,Y,C,te,sa,F,z,H,U,j,W,q,m,b,he,gA,fs,xr,ue,Fn,yn}from"./index-mgzbypt5.js";import{He}from"./index-5anvw7xg.js";import{oa}from"./index-x2f7wykb.js";import{wn,$n}from"./index-0g82ph6h.js";var Ie=$n(function(me,xe){(function(x,M){if(typeof me==="object"&&typeof xe==="object")xe.exports=M();else if(typeof define==="function"&&define.amd)define([],M);else if(typeof me==="object")me.layoutBase=M();else x.layoutBase=M()})(me,function(){return function(L){var x={};function M(d){if(x[d])return x[d].exports;var h=x[d]={i:d,l:!1,exports:{}};return L[d].call(h.exports,h,h.exports,M),h.l=!0,h.exports}return M.m=L,M.c=x,M.i=function(d){return d},M.d=function(d,h,o){if(!M.o(d,h))Object.defineProperty(d,h,{configurable:!1,enumerable:!0,get:o})},M.n=function(d){var h=d&&d.__esModule?function(){return d.default}:function(){return d};return M.d(h,"a",h),h},M.o=function(d,h){return Object.prototype.hasOwnProperty.call(d,h)},M.p="",M(M.s=28)}([function(L,x,M){function d(){}d.QUALITY=1,d.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,d.DEFAULT_INCREMENTAL=!1,d.DEFAULT_ANIMATION_ON_LAYOUT=!0,d.DEFAULT_ANIMATION_DURING_LAYOUT=!1,d.DEFAULT_ANIMATION_PERIOD=50,d.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,d.DEFAULT_GRAPH_MARGIN=15,d.NODE_DIMENSIONS_INCLUDE_LABELS=!1,d.SIMPLE_NODE_SIZE=40,d.SIMPLE_NODE_HALF_SIZE=d.SIMPLE_NODE_SIZE/2,d.EMPTY_COMPOUND_NODE_SIZE=40,d.MIN_EDGE_LENGTH=1,d.WORLD_BOUNDARY=1e6,d.INITIAL_WORLD_BOUNDARY=d.WORLD_BOUNDARY/1000,d.WORLD_CENTER_X=1200,d.WORLD_CENTER_Y=900,L.exports=d},function(L,x,M){var d=M(2),h=M(8),o=M(9);function n(g,r,v){d.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=g,this.target=r}n.prototype=Object.create(d.prototype);for(var a in d)n[a]=d[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(g){if(this.source===g)return this.target;else if(this.target===g)return this.source;else throw"Node is not incident with this edge"},n.prototype.getOtherEndInGraph=function(g,r){var v=this.getOtherEnd(g),i=r.getGraphManager().getRoot();while(!0){if(v.getOwner()==r)return v;if(v.getOwner()==i)break;v=v.getOwner().getParent()}return null},n.prototype.updateLength=function(){var g=[,,,,];if(this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),g),!this.isOverlapingSourceAndTarget){if(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[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)},L.exports=n},function(L,x,M){function d(h){this.vGraphObject=h}L.exports=d},function(L,x,M){var d=M(2),h=M(10),o=M(13),n=M(0),a=M(16),g=M(5);function r(i,e,c,u){if(c==null&&u==null)u=e;if(d.call(this,u),i.graphManager!=null)i=i.graphManager;if(this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=u,this.edges=[],this.graphManager=i,c!=null&&e!=null)this.rect=new o(e.x,e.y,c.width,c.height);else this.rect=new o}r.prototype=Object.create(d.prototype);for(var v in d)r[v]=d[v];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 g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new g(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=[],c,u=this;return u.edges.forEach(function(f){if(f.target==i){if(f.source!=u)throw"Incorrect edge source!";e.push(f)}}),e},r.prototype.getEdgesBetween=function(i){var e=[],c,u=this;return u.edges.forEach(function(f){if(!(f.source==u||f.target==u))throw"Incorrect edge source and/or target";if(f.target==i||f.source==i)e.push(f)}),e},r.prototype.getNeighborsList=function(){var i=new Set,e=this;return e.edges.forEach(function(c){if(c.source==e)i.add(c.target);else{if(c.target!=e)throw"Incorrect incidency!";i.add(c.source)}}),i},r.prototype.withChildren=function(){var i=new Set,e,c;if(i.add(this),this.child!=null){var u=this.child.getNodes();for(var f=0;f<u.length;f++)e=u[f],c=e.withChildren(),c.forEach(function(D){i.add(D)})}return i},r.prototype.getNoOfChildren=function(){var i=0,e;if(this.child==null)i=1;else{var c=this.child.getNodes();for(var u=0;u<c.length;u++)e=c[u],i+=e.getNoOfChildren()}if(i==0)i=1;return i},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.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,c=-n.INITIAL_WORLD_BOUNDARY,u=n.INITIAL_WORLD_BOUNDARY;i=n.WORLD_CENTER_X+a.nextDouble()*(u-c)+c;var f=-n.INITIAL_WORLD_BOUNDARY,D=n.INITIAL_WORLD_BOUNDARY;e=n.WORLD_CENTER_Y+a.nextDouble()*(D-f)+f,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(),c=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(c+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>c)this.rect.y-=(this.labelHeight-c)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(c+this.labelHeight)}}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.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 c=this.rect.y;if(c>n.WORLD_BOUNDARY)c=n.WORLD_BOUNDARY;else if(c<-n.WORLD_BOUNDARY)c=-n.WORLD_BOUNDARY;var u=new g(e,c),f=i.inverseTransformPoint(u);this.setLocation(f.x,f.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()},L.exports=r},function(L,x,M){var d=M(0);function h(){}for(var o in d)h[o]=d[o];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=0.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=0.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,h.COOLING_ADAPTATION_FACTOR=0.33,h.ADAPTATION_LOWER_NODE_LIMIT=1000,h.ADAPTATION_UPPER_NODE_LIMIT=5000,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,L.exports=h},function(L,x,M){function d(h,o){if(h==null&&o==null)this.x=0,this.y=0;else this.x=h,this.y=o}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.setX=function(h){this.x=h},d.prototype.setY=function(h){this.y=h},d.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},d.prototype.getCopy=function(){return new d(this.x,this.y)},d.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},L.exports=d},function(L,x,M){var d=M(2),h=M(10),o=M(0),n=M(7),a=M(3),g=M(1),r=M(13),v=M(12),i=M(11);function e(u,f,D){if(d.call(this,D),this.estimatedSize=h.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=u,f!=null&&f instanceof n)this.graphManager=f;else if(f!=null&&f instanceof Layout)this.graphManager=f.graphManager}e.prototype=Object.create(d.prototype);for(var c in d)e[c]=d[c];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(u,f,D){if(f==null&&D==null){var E=u;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(E)>-1)throw"Node already in graph!";return E.owner=this,this.getNodes().push(E),E}else{var T=u;if(!(this.getNodes().indexOf(f)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(f.owner==D.owner&&f.owner==this))throw"Both owners must be this graph!";if(f.owner!=D.owner)return null;if(T.source=f,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),f.edges.push(T),D!=f)D.edges.push(T);return T}},e.prototype.remove=function(u){var f=u;if(u instanceof a){if(f==null)throw"Node is null!";if(!(f.owner!=null&&f.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var D=f.edges.slice(),E,T=D.length;for(var A=0;A<T;A++)if(E=D[A],E.isInterGraph)this.graphManager.remove(E);else E.source.owner.remove(E);var G=this.nodes.indexOf(f);if(G==-1)throw"Node not in owner node list!";this.nodes.splice(G,1)}else if(u instanceof g){var E=u;if(E==null)throw"Edge is null!";if(!(E.source!=null&&E.target!=null))throw"Source and/or target is null!";if(!(E.source.owner!=null&&E.target.owner!=null&&E.source.owner==this&&E.target.owner==this))throw"Source and/or target owner is invalid!";var O=E.source.edges.indexOf(E),V=E.target.edges.indexOf(E);if(!(O>-1&&V>-1))throw"Source and/or target doesn't know this edge!";if(E.source.edges.splice(O,1),E.target!=E.source)E.target.edges.splice(V,1);var G=E.source.owner.getEdges().indexOf(E);if(G==-1)throw"Not in owner's edge list!";E.source.owner.getEdges().splice(G,1)}},e.prototype.updateLeftTop=function(){var{MAX_VALUE:u,MAX_VALUE:f}=h,D,E,T,A=this.getNodes(),G=A.length;for(var O=0;O<G;O++){var V=A[O];if(D=V.getTop(),E=V.getLeft(),u>D)u=D;if(f>E)f=E}if(u==h.MAX_VALUE)return null;if(A[0].getParent().paddingLeft!=null)T=A[0].getParent().paddingLeft;else T=this.margin;return this.left=f-T,this.top=u-T,new v(this.left,this.top)},e.prototype.updateBounds=function(u){var f=h.MAX_VALUE,D=-h.MAX_VALUE,E=h.MAX_VALUE,T=-h.MAX_VALUE,A,G,O,V,_,Q=this.nodes,lt=Q.length;for(var S=0;S<lt;S++){var tt=Q[S];if(u&&tt.child!=null)tt.updateBounds();if(A=tt.getLeft(),G=tt.getRight(),O=tt.getTop(),V=tt.getBottom(),f>A)f=A;if(D<G)D=G;if(E>O)E=O;if(T<V)T=V}var s=new r(f,E,D-f,T-E);if(f==h.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(u){var f=h.MAX_VALUE,D=-h.MAX_VALUE,E=h.MAX_VALUE,T=-h.MAX_VALUE,A,G,O,V,_=u.length;for(var Q=0;Q<_;Q++){var lt=u[Q];if(A=lt.getLeft(),G=lt.getRight(),O=lt.getTop(),V=lt.getBottom(),f>A)f=A;if(D<G)D=G;if(E>O)E=O;if(T<V)T=V}var S=new r(f,E,D-f,T-E);return S},e.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.prototype.calcEstimatedSize=function(){var u=0,f=this.nodes,D=f.length;for(var E=0;E<D;E++){var T=f[E];u+=T.calcEstimatedSize()}if(u==0)this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=u/Math.sqrt(this.nodes.length);return this.estimatedSize},e.prototype.updateConnected=function(){var u=this;if(this.nodes.length==0){this.isConnected=!0;return}var f=new i,D=new Set,E=this.nodes[0],T,A,G=E.withChildren();G.forEach(function(S){f.push(S),D.add(S)});while(f.length!==0){E=f.shift(),T=E.getEdges();var O=T.length;for(var V=0;V<O;V++){var _=T[V];if(A=_.getOtherEndInGraph(E,this),A!=null&&!D.has(A)){var Q=A.withChildren();Q.forEach(function(S){f.push(S),D.add(S)})}}}if(this.isConnected=!1,D.size>=this.nodes.length){var lt=0;if(D.forEach(function(S){if(S.owner==u)lt++}),lt==this.nodes.length)this.isConnected=!0}},L.exports=e},function(L,x,M){var d,h=M(1);function o(n){d=M(6),this.layout=n,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var n=this.layout.newGraph(),a=this.layout.newNode(null),g=this.add(n,a);return this.setRootGraph(g),this.rootGraph},o.prototype.add=function(n,a,g,r,v){if(g==null&&r==null&&v==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{v=g,r=a,g=n;var i=r.getOwner(),e=v.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 g.isInterGraph=!1,i.add(g,r,v);else{if(g.isInterGraph=!0,g.source=r,g.target=v,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}}},o.prototype.remove=function(n){if(n instanceof d){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 g=[];g=g.concat(a.getEdges());var r,v=g.length;for(var i=0;i<v;i++)r=g[i],a.remove(r);var e=[];e=e.concat(a.getNodes());var c;v=e.length;for(var i=0;i<v;i++)c=e[i],a.remove(c);if(a==this.rootGraph)this.setRootGraph(null);var u=this.graphs.indexOf(a);this.graphs.splice(u,1),a.parent=null}else if(n instanceof h){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 u=r.source.edges.indexOf(r);if(r.source.edges.splice(u,1),u=r.target.edges.indexOf(r),r.target.edges.splice(u,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 u=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(u,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(),g=a.length;for(var r=0;r<g;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(),g=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 g=n.getOwner(),r;do{if(r=g.getParent(),r==null)break;if(r==a)return!0;if(g=r.getOwner(),g==null)break}while(!0);g=a.getOwner();do{if(r=g.getParent(),r==null)break;if(r==n)return!0;if(g=r.getOwner(),g==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){var n,a,g,r,v,i=this.getAllEdges(),e=i.length;for(var c=0;c<e;c++){if(n=i[c],a=n.source,g=n.target,n.lca=null,n.sourceInLca=a,n.targetInLca=g,a==g){n.lca=a.getOwner();continue}r=a.getOwner();while(n.lca==null){n.targetInLca=g,v=g.getOwner();while(n.lca==null){if(v==r){n.lca=v;break}if(v==this.rootGraph)break;if(n.lca!=null)throw"assert failed";n.targetInLca=v.getParent(),v=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 g=n.getOwner();do{if(g==null)break;var r=a.getOwner();do{if(r==null)break;if(r==g)return r;r=r.getParent().getOwner()}while(!0);g=g.getParent().getOwner()}while(!0);return g},o.prototype.calcInclusionTreeDepths=function(n,a){if(n==null&&a==null)n=this.rootGraph,a=1;var g,r=n.getNodes(),v=r.length;for(var i=0;i<v;i++)if(g=r[i],g.inclusionTreeDepth=a,g.child!=null)this.calcInclusionTreeDepths(g.child,a+1)},o.prototype.includesInvalidEdge=function(){var n,a=[],g=this.edges.length;for(var r=0;r<g;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},L.exports=o},function(L,x,M){var d=M(12);function h(){}h.calcSeparationAmount=function(o,n,a,g){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 v=Math.abs((n.getCenterY()-o.getCenterY())/(n.getCenterX()-o.getCenterX()));if(n.getCenterY()===o.getCenterY()&&n.getCenterX()===o.getCenterX())v=1;var i=v*a[0],e=a[1]/v;if(a[0]<e)e=a[0];else i=a[1];a[0]=-1*r[0]*(e/2+g),a[1]=-1*r[1]*(i/2+g)},h.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},h.getIntersection2=function(o,n,a){var g=o.getCenterX(),r=o.getCenterY(),v=n.getCenterX(),i=n.getCenterY();if(o.intersects(n))return a[0]=g,a[1]=r,a[2]=v,a[3]=i,!0;var e=o.getX(),c=o.getY(),u=o.getRight(),f=o.getX(),D=o.getBottom(),E=o.getRight(),T=o.getWidthHalf(),A=o.getHeightHalf(),G=n.getX(),O=n.getY(),V=n.getRight(),_=n.getX(),Q=n.getBottom(),lt=n.getRight(),S=n.getWidthHalf(),tt=n.getHeightHalf(),s=!1,N=!1;if(g===v){if(r>i)return a[0]=g,a[1]=c,a[2]=v,a[3]=Q,!1;else if(r<i)return a[0]=g,a[1]=D,a[2]=v,a[3]=O,!1}else if(r===i){if(g>v)return a[0]=e,a[1]=r,a[2]=V,a[3]=i,!1;else if(g<v)return a[0]=u,a[1]=r,a[2]=G,a[3]=i,!1}else{var y=o.height/o.width,w=n.height/n.width,p=(i-r)/(v-g),P=void 0,R=void 0,k=void 0,B=void 0,X=void 0,st=void 0;if(-y===p)if(g>v)a[0]=f,a[1]=D,s=!0;else a[0]=u,a[1]=c,s=!0;else if(y===p)if(g>v)a[0]=e,a[1]=c,s=!0;else a[0]=E,a[1]=D,s=!0;if(-w===p)if(v>g)a[2]=_,a[3]=Q,N=!0;else a[2]=V,a[3]=O,N=!0;else if(w===p)if(v>g)a[2]=G,a[3]=O,N=!0;else a[2]=lt,a[3]=Q,N=!0;if(s&&N)return!1;if(g>v)if(r>i)P=this.getCardinalDirection(y,p,4),R=this.getCardinalDirection(w,p,2);else P=this.getCardinalDirection(-y,p,3),R=this.getCardinalDirection(-w,p,1);else if(r>i)P=this.getCardinalDirection(-y,p,1),R=this.getCardinalDirection(-w,p,3);else P=this.getCardinalDirection(y,p,2),R=this.getCardinalDirection(w,p,4);if(!s)switch(P){case 1:B=c,k=g+-A/p,a[0]=k,a[1]=B;break;case 2:k=E,B=r+T*p,a[0]=k,a[1]=B;break;case 3:B=D,k=g+A/p,a[0]=k,a[1]=B;break;case 4:k=f,B=r+-T*p,a[0]=k,a[1]=B;break}if(!N)switch(R){case 1:st=O,X=v+-tt/p,a[2]=X,a[3]=st;break;case 2:X=lt,st=i+S*p,a[2]=X,a[3]=st;break;case 3:st=Q,X=v+tt/p,a[2]=X,a[3]=st;break;case 4:X=_,st=i+-S*p,a[2]=X,a[3]=st;break}}return!1},h.getCardinalDirection=function(o,n,a){if(o>n)return a;else return 1+a%4},h.getIntersection=function(o,n,a,g){if(g==null)return this.getIntersection2(o,n,a);var{x:r,y:v}=o,{x:i,y:e}=n,{x:c,y:u}=a,{x:f,y:D}=g,E=void 0,T=void 0,A=void 0,G=void 0,O=void 0,V=void 0,_=void 0,Q=void 0,lt=void 0;if(A=e-v,O=r-i,_=i*v-r*e,G=D-u,V=c-f,Q=f*u-c*D,lt=A*V-G*O,lt===0)return null;return E=(O*Q-V*_)/lt,T=(G*_-A*Q)/lt,new d(E,T)},h.angleOfVector=function(o,n,a,g){var r=void 0;if(o!==a){if(r=Math.atan((g-n)/(a-o)),a<o)r+=Math.PI;else if(g<n)r+=this.TWO_PI}else if(g<n)r=this.ONE_AND_HALF_PI;else r=this.HALF_PI;return r},h.doIntersect=function(o,n,a,g){var{x:r,y:v}=o,{x:i,y:e}=n,{x:c,y:u}=a,{x:f,y:D}=g,E=(i-r)*(D-u)-(f-c)*(e-v);if(E===0)return!1;else{var T=((D-u)*(f-r)+(c-f)*(D-v))/E,A=((v-e)*(f-r)+(i-r)*(D-v))/E;return 0<T&&T<1&&0<A&&A<1}},h.findCircleLineIntersections=function(o,n,a,g,r,v,i){var e=(a-o)*(a-o)+(g-n)*(g-n),c=2*((o-r)*(a-o)+(n-v)*(g-n)),u=(o-r)*(o-r)+(n-v)*(n-v)-i*i,f=c*c-4*e*u;if(f>=0){var D=(-c+Math.sqrt(c*c-4*e*u))/(2*e),E=(-c-Math.sqrt(c*c-4*e*u))/(2*e),T=null;if(D>=0&&D<=1)return[D];if(E>=0&&E<=1)return[E];return T}else return null},h.HALF_PI=0.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,L.exports=h},function(L,x,M){function d(){}d.sign=function(h){if(h>0)return 1;else if(h<0)return-1;else return 0},d.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},d.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},L.exports=d},function(L,x,M){function d(){}d.MAX_VALUE=2147483647,d.MIN_VALUE=-2147483648,L.exports=d},function(L,x,M){var d=function(){function r(v,i){for(var e=0;e<i.length;e++){var c=i[e];if(c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c)c.writable=!0;Object.defineProperty(v,c.key,c)}}return function(v,i,e){if(i)r(v.prototype,i);if(e)r(v,e);return v}}();function h(r,v){if(!(r instanceof v))throw TypeError("Cannot call a class as a function")}var o=function(v){return{value:v,next:null,prev:null}},n=function(v,i,e,c){if(v!==null)v.next=i;else c.head=i;if(e!==null)e.prev=i;else c.tail=i;return i.prev=v,i.next=e,c.length++,i},a=function(v,i){var{prev:e,next:c}=v;if(e!==null)e.next=c;else i.head=c;if(c!==null)c.prev=e;else i.tail=e;return v.prev=v.next=null,i.length--,v},g=function(){function r(v){var i=this;if(h(this,r),this.length=0,this.head=null,this.tail=null,v!=null)v.forEach(function(e){return i.push(e)})}return d(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,c=this.head;while(e<i)c=c.next,e++;return c.value}}},{key:"set_object_at",value:function(i,e){if(i<=this.length()){var c=1,u=this.head;while(c<i)u=u.next,c++;u.value=e}}}]),r}();L.exports=g},function(L,x,M){function d(h,o,n){if(this.x=null,this.y=null,h==null&&o==null&&n==null)this.x=0,this.y=0;else if(typeof h=="number"&&typeof o=="number"&&n==null)this.x=h,this.y=o;else if(h.constructor.name=="Point"&&o==null&&n==null)n=h,this.x=n.x,this.y=n.y}d.prototype.getX=function(){return this.x},d.prototype.getY=function(){return this.y},d.prototype.getLocation=function(){return new d(this.x,this.y)},d.prototype.setLocation=function(h,o,n){if(h.constructor.name=="Point"&&o==null&&n==null)n=h,this.setLocation(n.x,n.y);else if(typeof h=="number"&&typeof o=="number"&&n==null)if(parseInt(h)==h&&parseInt(o)==o)this.move(h,o);else this.x=Math.floor(h+0.5),this.y=Math.floor(o+0.5)},d.prototype.move=function(h,o){this.x=h,this.y=o},d.prototype.translate=function(h,o){this.x+=h,this.y+=o},d.prototype.equals=function(h){if(h.constructor.name=="Point"){var o=h;return this.x==o.x&&this.y==o.y}return this==h},d.prototype.toString=function(){return new d().constructor.name+"[x="+this.x+",y="+this.y+"]"},L.exports=d},function(L,x,M){function d(h,o,n,a){if(this.x=0,this.y=0,this.width=0,this.height=0,h!=null&&o!=null&&n!=null&&a!=null)this.x=h,this.y=o,this.width=n,this.height=a}d.prototype.getX=function(){return this.x},d.prototype.setX=function(h){this.x=h},d.prototype.getY=function(){return this.y},d.prototype.setY=function(h){this.y=h},d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(h){this.width=h},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(h){this.height=h},d.prototype.getRight=function(){return this.x+this.width},d.prototype.getBottom=function(){return this.y+this.height},d.prototype.intersects=function(h){if(this.getRight()<h.x)return!1;if(this.getBottom()<h.y)return!1;if(h.getRight()<this.x)return!1;if(h.getBottom()<this.y)return!1;return!0},d.prototype.getCenterX=function(){return this.x+this.width/2},d.prototype.getMinX=function(){return this.getX()},d.prototype.getMaxX=function(){return this.getX()+this.width},d.prototype.getCenterY=function(){return this.y+this.height/2},d.prototype.getMinY=function(){return this.getY()},d.prototype.getMaxY=function(){return this.getY()+this.height},d.prototype.getWidthHalf=function(){return this.width/2},d.prototype.getHeightHalf=function(){return this.height/2},L.exports=d},function(L,x,M){var d=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 h(){}h.lastID=0,h.createID=function(o){if(h.isPrimitive(o))return o;if(o.uniqueID!=null)return o.uniqueID;return o.uniqueID=h.getString(),h.lastID++,o.uniqueID},h.getString=function(o){if(o==null)o=h.lastID;return"Object#"+o},h.isPrimitive=function(o){var n=typeof o>"u"?"undefined":d(o);return o==null||n!="object"&&n!="function"},L.exports=h},function(L,x,M){function d(c){if(Array.isArray(c)){for(var u=0,f=Array(c.length);u<c.length;u++)f[u]=c[u];return f}else return Array.from(c)}var h=M(0),o=M(7),n=M(3),a=M(1),g=M(6),r=M(5),v=M(17),i=M(29);function e(c){if(i.call(this),this.layoutQuality=h.QUALITY,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=h.DEFAULT_INCREMENTAL,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,c!=null)this.isRemoteUse=c}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 c=new o(this);return this.graphManager=c,c},e.prototype.newGraph=function(c){return new g(null,this.graphManager,c)},e.prototype.newNode=function(c){return new n(this.graphManager,c)},e.prototype.newEdge=function(c){return new a(null,null,c)},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 c;if(this.checkLayoutSuccess())c=!1;else c=this.layout();if(h.ANIMATE==="during")return!1;if(c){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,c},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 c,u=this.graphManager.getAllEdges();for(var f=0;f<u.length;f++)c=u[f];var D,E=this.graphManager.getRoot().getNodes();for(var f=0;f<E.length;f++)D=E[f];this.update(this.graphManager.getRoot())}},e.prototype.update=function(c){if(c==null)this.update2();else if(c instanceof n){var u=c;if(u.getChild()!=null){var f=u.getChild().getNodes();for(var D=0;D<f.length;D++)update(f[D])}if(u.vGraphObject!=null){var E=u.vGraphObject;E.update(u)}}else if(c instanceof a){var T=c;if(T.vGraphObject!=null){var A=T.vGraphObject;A.update(T)}}else if(c instanceof g){var G=c;if(G.vGraphObject!=null){var O=G.vGraphObject;O.update(G)}}},e.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=h.QUALITY,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=h.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},e.prototype.transform=function(c){if(c==null)this.transform(new r(0,0));else{var u=new v,f=this.graphManager.getRoot().updateLeftTop();if(f!=null){u.setWorldOrgX(c.x),u.setWorldOrgY(c.y),u.setDeviceOrgX(f.x),u.setDeviceOrgY(f.y);var D=this.getAllNodes(),E;for(var T=0;T<D.length;T++)E=D[T],E.transform(u)}}},e.prototype.positionNodesRandomly=function(c){if(c==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var u,f,D=c.getNodes();for(var E=0;E<D.length;E++)if(u=D[E],f=u.getChild(),f==null)u.scatter();else if(f.getNodes().length==0)u.scatter();else this.positionNodesRandomly(f),u.updateBounds()}},e.prototype.getFlatForest=function(){var c=[],u=!0,f=this.graphManager.getRoot().getNodes(),D=!0;for(var E=0;E<f.length;E++)if(f[E].getChild()!=null)D=!1;if(!D)return c;var T=new Set,A=[],G=new Map,O=[];O=O.concat(f);while(O.length>0&&u){A.push(O[0]);while(A.length>0&&u){var V=A[0];A.splice(0,1),T.add(V);var _=V.getEdges();for(var E=0;E<_.length;E++){var Q=_[E].getOtherEnd(V);if(G.get(V)!=Q)if(!T.has(Q))A.push(Q),G.set(Q,V);else{u=!1;break}}}if(!u)c=[];else{var lt=[].concat(d(T));c.push(lt);for(var E=0;E<lt.length;E++){var S=lt[E],tt=O.indexOf(S);if(tt>-1)O.splice(tt,1)}T=new Set,G=new Map}}return c},e.prototype.createDummyNodesForBendpoints=function(c){var u=[],f=c.source,D=this.graphManager.calcLowestCommonAncestor(c.source,c.target);for(var E=0;E<c.bendpoints.length;E++){var T=this.newNode(null);T.setRect(new Point(0,0),new Dimension(1,1)),D.add(T);var A=this.newEdge(null);this.graphManager.add(A,f,T),u.add(T),f=T}var A=this.newEdge(null);if(this.graphManager.add(A,f,c.target),this.edgeToDummyNodes.set(c,u),c.isInterGraph())this.graphManager.remove(c);else D.remove(c);return u},e.prototype.createBendpointsFromDummyNodes=function(){var c=[];c=c.concat(this.graphManager.getAllEdges()),c=[].concat(d(this.edgeToDummyNodes.keys())).concat(c);for(var u=0;u<c.length;u++){var f=c[u];if(f.bendpoints.length>0){var D=this.edgeToDummyNodes.get(f);for(var E=0;E<D.length;E++){var T=D[E],A=new r(T.getCenterX(),T.getCenterY()),G=f.bendpoints.get(E);G.x=A.x,G.y=A.y,T.getOwner().remove(T)}this.graphManager.add(f,f.source,f.target)}}},e.transform=function(c,u,f,D){if(f!=null&&D!=null){var E=u;if(c<=50){var T=u/f;E-=(u-T)/50*(50-c)}else{var A=u*D;E+=(A-u)/50*(c-50)}return E}else{var G,O;if(c<=50)G=9*u/500,O=u/10;else G=9*u/50,O=-8*u;return G*c+O}},e.findCenterOfTree=function(c){var u=[];u=u.concat(c);var f=[],D=new Map,E=!1,T=null;if(u.length==1||u.length==2)E=!0,T=u[0];for(var A=0;A<u.length;A++){var G=u[A],O=G.getNeighborsList().size;if(D.set(G,G.getNeighborsList().size),O==1)f.push(G)}var V=[];V=V.concat(f);while(!E){var _=[];_=_.concat(V),V=[];for(var A=0;A<u.length;A++){var G=u[A],Q=u.indexOf(G);if(Q>=0)u.splice(Q,1);var lt=G.getNeighborsList();lt.forEach(function(s){if(f.indexOf(s)<0){var N=D.get(s),y=N-1;if(y==1)V.push(s);D.set(s,y)}})}if(f=f.concat(V),u.length==1||u.length==2)E=!0,T=u[0]}return T},e.prototype.setGraphManager=function(c){this.graphManager=c},L.exports=e},function(L,x,M){function d(){}d.seed=1,d.x=0,d.nextDouble=function(){return d.x=Math.sin(d.seed++)*1e4,d.x-Math.floor(d.x)},L.exports=d},function(L,x,M){var d=M(5);function h(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}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(o){this.lworldExtX=o},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(o){this.lworldExtY=o},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},h.prototype.transformX=function(o){var n=0,a=this.lworldExtX;if(a!=0)n=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/a;return n},h.prototype.transformY=function(o){var n=0,a=this.lworldExtY;if(a!=0)n=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/a;return n},h.prototype.inverseTransformX=function(o){var n=0,a=this.ldeviceExtX;if(a!=0)n=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/a;return n},h.prototype.inverseTransformY=function(o){var n=0,a=this.ldeviceExtY;if(a!=0)n=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/a;return n},h.prototype.inverseTransformPoint=function(o){var n=new d(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return n},L.exports=h},function(L,x,M){function d(i){if(Array.isArray(i)){for(var e=0,c=Array(i.length);e<i.length;e++)c[e]=i[e];return c}else return Array.from(i)}var h=M(15),o=M(4),n=M(0),a=M(8),g=M(9);function r(){h.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(h.prototype);for(var v in h)r[v]=h[v];r.prototype.initParameters=function(){h.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,c,u,f,D,E,T=this.getGraphManager().getAllEdges();for(var A=0;A<T.length;A++)if(i=T[A],e=i.idealLength,i.isInterGraph){if(u=i.getSource(),f=i.getTarget(),D=i.getSourceInLca().getEstimatedSize(),E=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)i.idealLength+=D+E-2*n.SIMPLE_NODE_SIZE;c=i.getLca().getInclusionTreeDepth(),i.idealLength+=e*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(u.getInclusionTreeDepth()+f.getInclusionTreeDepth()-2*c)}},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 c=0;c<i.length;c++)e=i[c],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,c,u,f,D,E=this.getAllNodes(),T;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&i)this.updateGrid();T=new Set;for(c=0;c<E.length;c++)f=E[c],this.calculateRepulsionForceOfANode(f,T,i,e),T.add(f)}else for(c=0;c<E.length;c++){f=E[c];for(u=c+1;u<E.length;u++){if(D=E[u],f.getOwner()!=D.getOwner())continue;this.calcRepulsionForce(f,D)}}},r.prototype.calcGravitationalForces=function(){var i,e=this.getAllNodesToApplyGravitation();for(var c=0;c<e.length;c++)i=e[c],this.calcGravitationalForce(i)},r.prototype.moveNodes=function(){var i=this.getAllNodes(),e;for(var c=0;c<i.length;c++)e=i[c],e.move()},r.prototype.calcSpringForce=function(i,e){var c=i.getSource(),u=i.getTarget(),f,D,E,T;if(this.uniformLeafNodeSizes&&c.getChild()==null&&u.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;if(f=i.getLength(),f==0)return;D=i.edgeElasticity*(f-e),E=D*(i.lengthX/f),T=D*(i.lengthY/f),c.springForceX+=E,c.springForceY+=T,u.springForceX-=E,u.springForceY-=T},r.prototype.calcRepulsionForce=function(i,e){var c=i.getRect(),u=e.getRect(),f=[,,],D=[,,,,],E,T,A,G,O,V,_;if(c.intersects(u)){a.calcSeparationAmount(c,u,f,o.DEFAULT_EDGE_LENGTH/2),V=2*f[0],_=2*f[1];var Q=i.noOfChildren*e.noOfChildren/(i.noOfChildren+e.noOfChildren);i.repulsionForceX-=Q*V,i.repulsionForceY-=Q*_,e.repulsionForceX+=Q*V,e.repulsionForceY+=Q*_}else{if(this.uniformLeafNodeSizes&&i.getChild()==null&&e.getChild()==null)E=u.getCenterX()-c.getCenterX(),T=u.getCenterY()-c.getCenterY();else a.getIntersection(c,u,D),E=D[2]-D[0],T=D[3]-D[1];if(Math.abs(E)<o.MIN_REPULSION_DIST)E=g.sign(E)*o.MIN_REPULSION_DIST;if(Math.abs(T)<o.MIN_REPULSION_DIST)T=g.sign(T)*o.MIN_REPULSION_DIST;A=E*E+T*T,G=Math.sqrt(A),O=(i.nodeRepulsion/2+e.nodeRepulsion/2)*i.noOfChildren*e.noOfChildren/A,V=O*E/G,_=O*T/G,i.repulsionForceX-=V,i.repulsionForceY-=_,e.repulsionForceX+=V,e.repulsionForceY+=_}},r.prototype.calcGravitationalForce=function(i){var e,c,u,f,D,E,T,A;if(e=i.getOwner(),c=(e.getRight()+e.getLeft())/2,u=(e.getTop()+e.getBottom())/2,f=i.getCenterX()-c,D=i.getCenterY()-u,E=Math.abs(f)+i.getWidth()/2,T=Math.abs(D)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()){if(A=e.getEstimatedSize()*this.gravityRangeFactor,E>A||T>A)i.gravitationForceX=-this.gravityConstant*f,i.gravitationForceY=-this.gravityConstant*D}else if(A=e.getEstimatedSize()*this.compoundGravityRangeFactor,E>A||T>A)i.gravitationForceX=-this.gravityConstant*f*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*D*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 c=0;c<e.length;c++)i=e[c],i.noOfChildren=i.getNoOfChildren()},r.prototype.calcGrid=function(i){var e=0,c=0;e=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),c=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));var u=Array(e);for(var f=0;f<e;f++)u[f]=Array(c);for(var f=0;f<e;f++)for(var D=0;D<c;D++)u[f][D]=[];return u},r.prototype.addNodeToGrid=function(i,e,c){var u=0,f=0,D=0,E=0;u=parseInt(Math.floor((i.getRect().x-e)/this.repulsionRange)),f=parseInt(Math.floor((i.getRect().width+i.getRect().x-e)/this.repulsionRange)),D=parseInt(Math.floor((i.getRect().y-c)/this.repulsionRange)),E=parseInt(Math.floor((i.getRect().height+i.getRect().y-c)/this.repulsionRange));for(var T=u;T<=f;T++)for(var A=D;A<=E;A++)this.grid[T][A].push(i),i.setGridCoordinates(u,f,D,E)},r.prototype.updateGrid=function(){var i,e,c=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(i=0;i<c.length;i++)e=c[i],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(i,e,c,u){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&c||u){var f=new Set;i.surrounding=[];var D,E=this.grid;for(var T=i.startX-1;T<i.finishX+2;T++)for(var A=i.startY-1;A<i.finishY+2;A++)if(!(T<0||A<0||T>=E.length||A>=E[0].length))for(var G=0;G<E[T][A].length;G++){if(D=E[T][A][G],i.getOwner()!=D.getOwner()||i==D)continue;if(!e.has(D)&&!f.has(D)){var O=Math.abs(i.getCenterX()-D.getCenterX())-(i.getWidth()/2+D.getWidth()/2),V=Math.abs(i.getCenterY()-D.getCenterY())-(i.getHeight()/2+D.getHeight()/2);if(O<=this.repulsionRange&&V<=this.repulsionRange)f.add(D)}}i.surrounding=[].concat(d(f))}for(T=0;T<i.surrounding.length;T++)this.calcRepulsionForce(i,i.surrounding[T])},r.prototype.calcRepulsionRange=function(){return 0},L.exports=r},function(L,x,M){var d=M(1),h=M(4);function o(a,g,r){d.call(this,a,g,r),this.idealLength=h.DEFAULT_EDGE_LENGTH,this.edgeElasticity=h.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(d.prototype);for(var n in d)o[n]=d[n];L.exports=o},function(L,x,M){var d=M(3),h=M(4);function o(a,g,r,v){d.call(this,a,g,r,v),this.nodeRepulsion=h.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(d.prototype);for(var n in d)o[n]=d[n];o.prototype.setGridCoordinates=function(a,g,r,v){this.startX=a,this.finishX=g,this.startY=r,this.finishY=v},L.exports=o},function(L,x,M){function d(h,o){if(this.width=0,this.height=0,h!==null&&o!==null)this.height=o,this.width=h}d.prototype.getWidth=function(){return this.width},d.prototype.setWidth=function(h){this.width=h},d.prototype.getHeight=function(){return this.height},d.prototype.setHeight=function(h){this.height=h},L.exports=d},function(L,x,M){var d=M(14);function h(){this.map={},this.keys=[]}h.prototype.put=function(o,n){var a=d.createID(o);if(!this.contains(a))this.map[a]=n,this.keys.push(o)},h.prototype.contains=function(o){var n=d.createID(o);return this.map[o]!=null},h.prototype.get=function(o){var n=d.createID(o);return this.map[n]},h.prototype.keySet=function(){return this.keys},L.exports=h},function(L,x,M){var d=M(14);function h(){this.set={}}h.prototype.add=function(o){var n=d.createID(o);if(!this.contains(n))this.set[n]=o},h.prototype.remove=function(o){delete this.set[d.createID(o)]},h.prototype.clear=function(){this.set={}},h.prototype.contains=function(o){return this.set[d.createID(o)]==o},h.prototype.isEmpty=function(){return this.size()===0},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAllTo=function(o){var n=Object.keys(this.set),a=n.length;for(var g=0;g<a;g++)o.push(this.set[n[g]])},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAll=function(o){var n=o.length;for(var a=0;a<n;a++){var g=o[a];this.add(g)}},L.exports=h},function(L,x,M){function d(){}d.multMat=function(h,o){var n=[];for(var a=0;a<h.length;a++){n[a]=[];for(var g=0;g<o[0].length;g++){n[a][g]=0;for(var r=0;r<h[0].length;r++)n[a][g]+=h[a][r]*o[r][g]}}return n},d.transpose=function(h){var o=[];for(var n=0;n<h[0].length;n++){o[n]=[];for(var a=0;a<h.length;a++)o[n][a]=h[a][n]}return o},d.multCons=function(h,o){var n=[];for(var a=0;a<h.length;a++)n[a]=h[a]*o;return n},d.minusOp=function(h,o){var n=[];for(var a=0;a<h.length;a++)n[a]=h[a]-o[a];return n},d.dotProduct=function(h,o){var n=0;for(var a=0;a<h.length;a++)n+=h[a]*o[a];return n},d.mag=function(h){return Math.sqrt(this.dotProduct(h,h))},d.normalize=function(h){var o=[],n=this.mag(h);for(var a=0;a<h.length;a++)o[a]=h[a]/n;return o},d.multGamma=function(h){var o=[],n=0;for(var a=0;a<h.length;a++)n+=h[a];n*=-1/h.length;for(var g=0;g<h.length;g++)o[g]=n+h[g];return o},d.multL=function(h,o,n){var a=[],g=[],r=[];for(var v=0;v<o[0].length;v++){var i=0;for(var e=0;e<o.length;e++)i+=-0.5*o[e][v]*h[e];g[v]=i}for(var c=0;c<n.length;c++){var u=0;for(var f=0;f<n.length;f++)u+=n[c][f]*g[f];r[c]=u}for(var D=0;D<o.length;D++){var E=0;for(var T=0;T<o[0].length;T++)E+=o[D][T]*r[T];a[D]=E}return a},L.exports=d},function(L,x,M){var d=function(){function a(g,r){for(var v=0;v<r.length;v++){var i=r[v];if(i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i)i.writable=!0;Object.defineProperty(g,i.key,i)}}return function(g,r,v){if(r)a(g.prototype,r);if(v)a(g,v);return g}}();function h(a,g){if(!(a instanceof g))throw TypeError("Cannot call a class as a function")}var o=M(11),n=function(){function a(g,r){if(h(this,a),r!==null||r!==void 0)this.compareFunction=this._defaultCompareFunction;var v=void 0;if(g instanceof o)v=g.size();else v=g.length;this._quicksort(g,0,v-1)}return d(a,[{key:"_quicksort",value:function(r,v,i){if(v<i){var e=this._partition(r,v,i);this._quicksort(r,v,e),this._quicksort(r,e+1,i)}}},{key:"_partition",value:function(r,v,i){var e=this._get(r,v),c=v,u=i;while(!0){while(this.compareFunction(e,this._get(r,u)))u--;while(this.compareFunction(this._get(r,c),e))c++;if(c<u)this._swap(r,c,u),c++,u--;else return u}}},{key:"_get",value:function(r,v){if(r instanceof o)return r.get_object_at(v);else return r[v]}},{key:"_set",value:function(r,v,i){if(r instanceof o)r.set_object_at(v,i);else r[v]=i}},{key:"_swap",value:function(r,v,i){var e=this._get(r,v);this._set(r,v,this._get(r,i)),this._set(r,i,e)}},{key:"_defaultCompareFunction",value:function(r,v){return v>r}}]),a}();L.exports=n},function(L,x,M){function d(){}d.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[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),g=!0,r=!0,v=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(v,i);e++){if(e<v){this.s[e]=0;for(var c=e;c<this.m;c++)this.s[e]=d.hypot(this.s[e],h[c][e]);if(this.s[e]!==0){if(h[e][e]<0)this.s[e]=-this.s[e];for(var u=e;u<this.m;u++)h[u][e]/=this.s[e];h[e][e]+=1}this.s[e]=-this.s[e]}for(var f=e+1;f<this.n;f++){if(function(Wt,bt){return Wt&&bt}(e<v,this.s[e]!==0)){var D=0;for(var E=e;E<this.m;E++)D+=h[E][e]*h[E][f];D=-D/h[e][e];for(var T=e;T<this.m;T++)h[T][f]+=D*h[T][e]}n[f]=h[e][f]}if(function(Wt,bt){return Wt&&bt}(g,e<v))for(var A=e;A<this.m;A++)this.U[A][e]=h[A][e];if(e<i){n[e]=0;for(var G=e+1;G<this.n;G++)n[e]=d.hypot(n[e],n[G]);if(n[e]!==0){if(n[e+1]<0)n[e]=-n[e];for(var O=e+1;O<this.n;O++)n[O]/=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 V=e+1;V<this.m;V++)a[V]=0;for(var _=e+1;_<this.n;_++)for(var Q=e+1;Q<this.m;Q++)a[Q]+=n[_]*h[Q][_];for(var lt=e+1;lt<this.n;lt++){var S=-n[lt]/n[e+1];for(var tt=e+1;tt<this.m;tt++)h[tt][lt]+=S*a[tt]}}if(r)for(var s=e+1;s<this.n;s++)this.V[s][e]=n[s]}}var N=Math.min(this.n,this.m+1);if(v<this.n)this.s[v]=h[v][v];if(this.m<N)this.s[N-1]=0;if(i+1<N)n[i]=h[i][N-1];if(n[N-1]=0,g){for(var y=v;y<o;y++){for(var w=0;w<this.m;w++)this.U[w][y]=0;this.U[y][y]=1}for(var p=v-1;p>=0;p--)if(this.s[p]!==0){for(var P=p+1;P<o;P++){var R=0;for(var k=p;k<this.m;k++)R+=this.U[k][p]*this.U[k][P];R=-R/this.U[p][p];for(var B=p;B<this.m;B++)this.U[B][P]+=R*this.U[B][p]}for(var X=p;X<this.m;X++)this.U[X][p]=-this.U[X][p];this.U[p][p]=1+this.U[p][p];for(var st=0;st<p-1;st++)this.U[st][p]=0}else{for(var dt=0;dt<this.m;dt++)this.U[dt][p]=0;this.U[p][p]=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 I=Z+1;I<this.n;I++)nt+=this.V[I][Z]*this.V[I][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=N-1,Nt=0,Pt=Math.pow(2,-52),Bt=Math.pow(2,-966);while(N>0){var ft=void 0,Jt=void 0;for(ft=N-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===N-2)Jt=4;else{var Xt=void 0;for(Xt=N-1;Xt>=ft;Xt--){if(Xt===ft)break;var Et=(Xt!==N?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===N-1)Jt=1;else Jt=2,ft=Xt}switch(ft++,Jt){case 1:{var vt=n[N-2];n[N-2]=0;for(var xt=N-2;xt>=ft;xt--){var Rt=d.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][N-1],this.V[Ft][N-1]=-St*this.V[Ft][xt]+Gt*this.V[Ft][N-1],this.V[Ft][xt]=Rt}}break;case 2:{var Ht=n[ft-1];n[ft-1]=0;for(var zt=ft;zt<N;zt++){var ee=d.hypot(this.s[zt],Ht),qt=this.s[zt]/ee,Kt=Ht/ee;if(this.s[zt]=ee,Ht=-Kt*n[zt],n[zt]=qt*n[zt],g)for(var kt=0;kt<this.m;kt++)ee=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]=ee}}break;case 3:{var J=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[N-1]),Math.abs(this.s[N-2])),Math.abs(n[N-2])),Math.abs(this.s[ft])),Math.abs(n[ft])),rt=this.s[N-1]/J,it=this.s[N-2]/J,at=n[N-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<N-1;pt++){var Ot=d.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=d.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],g&&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[N-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(g&&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,N--}break}}var re={U:this.U,V:this.V,S:this.s};return re},d.hypot=function(h,o){var n=void 0;if(Math.abs(h)>Math.abs(o))n=o/h,n=Math.abs(h)*Math.sqrt(1+n*n);else if(o!=0)n=h/o,n=Math.abs(o)*Math.sqrt(1+n*n);else n=0;return n},L.exports=d},function(L,x,M){var d=function(){function n(a,g){for(var r=0;r<g.length;r++){var v=g[r];if(v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v)v.writable=!0;Object.defineProperty(a,v.key,v)}}return function(a,g,r){if(g)n(a.prototype,g);if(r)n(a,r);return a}}();function h(n,a){if(!(n instanceof a))throw TypeError("Cannot call a class as a function")}var o=function(){function n(a,g){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,n),this.sequence1=a,this.sequence2=g,this.match_score=r,this.mismatch_penalty=v,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=g.length+1,this.grid=Array(this.iMax);for(var e=0;e<this.iMax;e++){this.grid[e]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.grid[e][c]=0}this.tracebackGrid=Array(this.iMax);for(var u=0;u<this.iMax;u++){this.tracebackGrid[u]=Array(this.jMax);for(var f=0;f<this.jMax;f++)this.tracebackGrid[u][f]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return d(n,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var g=1;g<this.jMax;g++)this.grid[0][g]=this.grid[0][g-1]+this.gap_penalty,this.tracebackGrid[0][g]=[!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 v=1;v<this.iMax;v++)for(var i=1;i<this.jMax;i++){var e=void 0;if(this.sequence1[v-1]===this.sequence2[i-1])e=this.grid[v-1][i-1]+this.match_score;else e=this.grid[v-1][i-1]+this.mismatch_penalty;var c=this.grid[v-1][i]+this.gap_penalty,u=this.grid[v][i-1]+this.gap_penalty,f=[e,c,u],D=this.arrayAllMaxIndexes(f);this.grid[v][i]=f[D[0]],this.tracebackGrid[v][i]=[D.includes(0),D.includes(1),D.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var g=[];g.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(g[0]){var r=g[0],v=this.tracebackGrid[r.pos[0]][r.pos[1]];if(v[0])g.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(v[1])g.push({pos:[r.pos[0]-1,r.pos[1]],seq1:this.sequence1[r.pos[0]-1]+r.seq1,seq2:"-"+r.seq2});if(v[2])g.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});g.shift()}return this.alignments}},{key:"getAllIndexes",value:function(g,r){var v=[],i=-1;while((i=g.indexOf(r,i+1))!==-1)v.push(i);return v}},{key:"arrayAllMaxIndexes",value:function(g){return this.getAllIndexes(g,Math.max.apply(null,g))}}]),n}();L.exports=o},function(L,x,M){var d=function(){return};d.FDLayout=M(18),d.FDLayoutConstants=M(4),d.FDLayoutEdge=M(19),d.FDLayoutNode=M(20),d.DimensionD=M(21),d.HashMap=M(22),d.HashSet=M(23),d.IGeometry=M(8),d.IMath=M(9),d.Integer=M(10),d.Point=M(12),d.PointD=M(5),d.RandomSeed=M(16),d.RectangleD=M(13),d.Transform=M(17),d.UniqueIDGeneretor=M(14),d.Quicksort=M(25),d.LinkedList=M(11),d.LGraphObject=M(2),d.LGraph=M(6),d.LEdge=M(1),d.LGraphManager=M(7),d.LNode=M(3),d.Layout=M(15),d.LayoutConstants=M(0),d.NeedlemanWunsch=M(27),d.Matrix=M(24),d.SVD=M(26),L.exports=d},function(L,x,M){function d(){this.listeners=[]}var h=d.prototype;h.addListener=function(o,n){this.listeners.push({event:o,callback:n})},h.removeListener=function(o,n){for(var a=this.listeners.length;a>=0;a--){var g=this.listeners[a];if(g.event===o&&g.callback===n)this.listeners.splice(a,1)}},h.emit=function(o,n){for(var a=0;a<this.listeners.length;a++){var g=this.listeners[a];if(o===g.event)g.callback(n)}},L.exports=d}])})});var Se=$n(function(Ee,Re){(function(x,M){if(typeof Ee==="object"&&typeof Re==="object")Re.exports=M(Ie());else if(typeof define==="function"&&define.amd)define(["layout-base"],M);else if(typeof Ee==="object")Ee.coseBase=M(Ie());else x.coseBase=M(x.layoutBase)})(Ee,function(L){return(()=>{var x={45:(o,n,a)=>{var g={};g.layoutBase=a(551),g.CoSEConstants=a(806),g.CoSEEdge=a(767),g.CoSEGraph=a(880),g.CoSEGraphManager=a(578),g.CoSELayout=a(765),g.CoSENode=a(991),g.ConstraintHandler=a(902),o.exports=g},806:(o,n,a)=>{var g=a(551).FDLayoutConstants;function r(){}for(var v in g)r[v]=g[v];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=g.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 g=a(551).FDLayoutEdge;function r(i,e,c){g.call(this,i,e,c)}r.prototype=Object.create(g.prototype);for(var v in g)r[v]=g[v];o.exports=r},880:(o,n,a)=>{var g=a(551).LGraph;function r(i,e,c){g.call(this,i,e,c)}r.prototype=Object.create(g.prototype);for(var v in g)r[v]=g[v];o.exports=r},578:(o,n,a)=>{var g=a(551).LGraphManager;function r(i){g.call(this,i)}r.prototype=Object.create(g.prototype);for(var v in g)r[v]=g[v];o.exports=r},765:(o,n,a)=>{var g=a(551).FDLayout,r=a(578),v=a(880),i=a(991),e=a(767),c=a(806),u=a(902),f=a(551).FDLayoutConstants,D=a(551).LayoutConstants,E=a(551).Point,T=a(551).PointD,A=a(551).DimensionD,G=a(551).Layout,O=a(551).Integer,V=a(551).IGeometry,_=a(551).LGraph,Q=a(551).Transform,lt=a(551).LinkedList;function S(){g.call(this),this.toBeTiled={},this.constraints={}}S.prototype=Object.create(g.prototype);for(var tt in g)S[tt]=g[tt];S.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},S.prototype.newGraph=function(s){return new v(null,this.graphManager,s)},S.prototype.newNode=function(s){return new i(this.graphManager,s)},S.prototype.newEdge=function(s){return new e(null,null,s)},S.prototype.initParameters=function(){if(g.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(c.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=f.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=f.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},S.prototype.initSpringEmbedder=function(){g.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/f.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},S.prototype.layout=function(){var s=D.DEFAULT_CREATE_BENDS_AS_NEEDED;if(s)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},S.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 N=new Set(this.getAllNodes()),y=this.nodesWithGravity.filter(function(w){return N.has(w)});this.graphManager.setAllNodesToApplyGravitation(y),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var N=new Set(this.getAllNodes()),y=this.nodesWithGravity.filter(function(P){return N.has(P)});this.graphManager.setAllNodesToApplyGravitation(y)}if(Object.keys(this.constraints).length>0)u.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),c.APPLY_LAYOUT)this.runSpringEmbedder();return!0},S.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%f.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()),N=this.nodesWithGravity.filter(function(p){return s.has(p)});if(this.graphManager.setAllNodesToApplyGravitation(N),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL)this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=f.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(c.PURE_INCREMENTAL)this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var y=!this.isTreeGrowing&&!this.isGrowthFinished,w=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(y,w),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},S.prototype.getPositionsData=function(){var s=this.graphManager.getAllNodes(),N={};for(var y=0;y<s.length;y++){var w=s[y].rect,p=s[y].id;N[p]={id:p,x:w.getCenterX(),y:w.getCenterY(),w:w.width,h:w.height}}return N},S.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(f.ANIMATE==="during")this.emit("layoutstarted");else{while(!s)s=this.tick();this.graphManager.updateBounds()}},S.prototype.moveNodes=function(){var s=this.getAllNodes(),N;for(var y=0;y<s.length;y++)N=s[y],N.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var y=0;y<s.length;y++)N=s[y],N.move()},S.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var N=this.graphManager.getAllNodes();for(var y=0;y<N.length;y++){var w=N[y];this.idToNodeMap.set(w.id,w)}var p=function I(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+=I(ct);return Nt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(et){s.fixedNodeSet.add(et.nodeId)});var N=this.graphManager.getAllNodes(),w;for(var y=0;y<N.length;y++)if(w=N[y],w.getChild()!=null){var P=p(w);if(P>0)w.fixedNodeWeight=P}}if(this.constraints.relativePlacementConstraint){var R=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(I){s.fixedNodesOnHorizontal.add(I),s.fixedNodesOnVertical.add(I)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var B=this.constraints.alignmentConstraint.vertical;for(var y=0;y<B.length;y++)this.dummyToNodeForVerticalAlignment.set("dummy"+y,[]),B[y].forEach(function(K){if(R.set(K,"dummy"+y),s.dummyToNodeForVerticalAlignment.get("dummy"+y).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnHorizontal.add("dummy"+y)})}if(this.constraints.alignmentConstraint.horizontal){var X=this.constraints.alignmentConstraint.horizontal;for(var y=0;y<X.length;y++)this.dummyToNodeForHorizontalAlignment.set("dummy"+y,[]),X[y].forEach(function(K){if(k.set(K,"dummy"+y),s.dummyToNodeForHorizontalAlignment.get("dummy"+y).push(K),s.fixedNodeSet.has(K))s.fixedNodesOnVertical.add("dummy"+y)})}}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(I){var K,et,ct;for(ct=I.length-1;ct>=2*I.length/3;ct--)K=Math.floor(Math.random()*(ct+1)),et=I[ct],I[ct]=I[K],I[K]=et;return I},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(I){if(I.left){var K=R.has(I.left)?R.get(I.left):I.left,et=R.has(I.right)?R.get(I.right):I.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:I.gap}),s.nodeToRelativeConstraintMapHorizontal.get(et).push({left:K,gap:I.gap})}else{var ct=k.has(I.top)?k.get(I.top):I.top,Nt=k.has(I.bottom)?k.get(I.bottom):I.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:I.gap}),s.nodeToRelativeConstraintMapVertical.get(Nt).push({top:ct,gap:I.gap})}});else{var st=new Map,dt=new Map;this.constraints.relativePlacementConstraint.forEach(function(I){if(I.left){var K=R.has(I.left)?R.get(I.left):I.left,et=R.has(I.right)?R.get(I.right):I.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(I.top)?k.get(I.top):I.top,Nt=k.has(I.bottom)?k.get(I.bottom):I.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}}},S.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(nt){var I=s.idToNodeMap.get(nt.nodeId);I.displacementX=0,I.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var N=this.constraints.alignmentConstraint.vertical;for(var y=0;y<N.length;y++){var w=0;for(var p=0;p<N[y].length;p++){if(this.fixedNodeSet.has(N[y][p])){w=0;break}w+=this.idToNodeMap.get(N[y][p]).displacementX}var P=w/N[y].length;for(var p=0;p<N[y].length;p++)this.idToNodeMap.get(N[y][p]).displacementX=P}}if(this.constraints.alignmentConstraint.horizontal){var R=this.constraints.alignmentConstraint.horizontal;for(var y=0;y<R.length;y++){var k=0;for(var p=0;p<R[y].length;p++){if(this.fixedNodeSet.has(R[y][p])){k=0;break}k+=this.idToNodeMap.get(R[y][p]).displacementY}var B=k/R[y].length;for(var p=0;p<R[y].length;p++)this.idToNodeMap.get(R[y][p]).displacementY=B}}}if(this.constraints.relativePlacementConstraint)if(c.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 I=0;if(s.dummyToNodeForVerticalAlignment.has(nt))I=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(nt)[0]).displacementX;else I=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)-I;if(et<K.gap)I-=K.gap-et}else{var et=s.nodeToTempPositionMapHorizontal.get(nt)-s.nodeToTempPositionMapHorizontal.get(K.left)+I;if(et<K.gap)I+=K.gap-et}}),s.nodeToTempPositionMapHorizontal.set(nt,s.nodeToTempPositionMapHorizontal.get(nt)+I),s.dummyToNodeForVerticalAlignment.has(nt))s.dummyToNodeForVerticalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementX=I});else s.idToNodeMap.get(nt).displacementX=I}}),this.nodesInRelativeVertical.forEach(function(nt){if(!s.fixedNodesOnHorizontal.has(nt)){var I=0;if(s.dummyToNodeForHorizontalAlignment.has(nt))I=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(nt)[0]).displacementY;else I=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)-I;if(et<K.gap)I-=K.gap-et}else{var et=s.nodeToTempPositionMapVertical.get(nt)-s.nodeToTempPositionMapVertical.get(K.top)+I;if(et<K.gap)I+=K.gap-et}}),s.nodeToTempPositionMapVertical.set(nt,s.nodeToTempPositionMapVertical.get(nt)+I),s.dummyToNodeForHorizontalAlignment.has(nt))s.dummyToNodeForHorizontalAlignment.get(nt).forEach(function(K){s.idToNodeMap.get(K).displacementY=I});else s.idToNodeMap.get(nt).displacementY=I}})}else{for(var y=0;y<this.componentsOnHorizontal.length;y++){var X=this.componentsOnHorizontal[y];if(this.fixedComponentsOnHorizontal[y])for(var p=0;p<X.length;p++)if(this.dummyToNodeForVerticalAlignment.has(X[p]))this.dummyToNodeForVerticalAlignment.get(X[p]).forEach(function(K){s.idToNodeMap.get(K).displacementX=0});else this.idToNodeMap.get(X[p]).displacementX=0;else{var st=0,dt=0;for(var p=0;p<X.length;p++)if(this.dummyToNodeForVerticalAlignment.has(X[p])){var Z=this.dummyToNodeForVerticalAlignment.get(X[p]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementX,dt+=Z.length}else st+=this.idToNodeMap.get(X[p]).displacementX,dt++;var ut=st/dt;for(var p=0;p<X.length;p++)if(this.dummyToNodeForVerticalAlignment.has(X[p]))this.dummyToNodeForVerticalAlignment.get(X[p]).forEach(function(K){s.idToNodeMap.get(K).displacementX=ut});else this.idToNodeMap.get(X[p]).displacementX=ut}}for(var y=0;y<this.componentsOnVertical.length;y++){var X=this.componentsOnVertical[y];if(this.fixedComponentsOnVertical[y])for(var p=0;p<X.length;p++)if(this.dummyToNodeForHorizontalAlignment.has(X[p]))this.dummyToNodeForHorizontalAlignment.get(X[p]).forEach(function(et){s.idToNodeMap.get(et).displacementY=0});else this.idToNodeMap.get(X[p]).displacementY=0;else{var st=0,dt=0;for(var p=0;p<X.length;p++)if(this.dummyToNodeForHorizontalAlignment.has(X[p])){var Z=this.dummyToNodeForHorizontalAlignment.get(X[p]);st+=Z.length*this.idToNodeMap.get(Z[0]).displacementY,dt+=Z.length}else st+=this.idToNodeMap.get(X[p]).displacementY,dt++;var ut=st/dt;for(var p=0;p<X.length;p++)if(this.dummyToNodeForHorizontalAlignment.has(X[p]))this.dummyToNodeForHorizontalAlignment.get(X[p]).forEach(function(Pt){s.idToNodeMap.get(Pt).displacementY=ut});else this.idToNodeMap.get(X[p]).displacementY=ut}}}},S.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],N,y=this.graphManager.getGraphs(),w=y.length,p;for(p=0;p<w;p++)if(N=y[p],N.updateConnected(),!N.isConnected)s=s.concat(N.getNodes());return s},S.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var N=new Set,y;for(y=0;y<s.length;y++){var w=s[y];if(!N.has(w)){var p=w.getSource(),P=w.getTarget();if(p==P)w.getBendpoints().push(new T),w.getBendpoints().push(new T),this.createDummyNodesForBendpoints(w),N.add(w);else{var R=[];if(R=R.concat(p.getEdgeListToNode(P)),R=R.concat(P.getEdgeListToNode(p)),!N.has(R[0])){if(R.length>1){var k;for(k=0;k<R.length;k++){var B=R[k];B.getBendpoints().push(new T),this.createDummyNodesForBendpoints(B)}}R.forEach(function(X){N.add(X)})}}}if(N.size==s.length)break}},S.prototype.positionNodesRadially=function(s){var N=new E(0,0),y=Math.ceil(Math.sqrt(s.length)),w=0,p=0,P=0,R=new T(0,0);for(var k=0;k<s.length;k++){if(k%y==0){if(P=0,p=w,k!=0)p+=c.DEFAULT_COMPONENT_SEPERATION;w=0}var B=s[k],X=G.findCenterOfTree(B);if(N.x=P,N.y=p,R=S.radialLayout(B,X,N),R.y>w)w=Math.floor(R.y);P=Math.floor(R.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new T(D.WORLD_CENTER_X-R.x/2,D.WORLD_CENTER_Y-R.y/2))},S.radialLayout=function(s,N,y){var w=Math.max(this.maxDiagonalInTree(s),c.DEFAULT_RADIAL_SEPARATION);S.branchRadialLayout(N,null,0,359,0,w);var p=_.calculateBounds(s),P=new Q;P.setDeviceOrgX(p.getMinX()),P.setDeviceOrgY(p.getMinY()),P.setWorldOrgX(y.x),P.setWorldOrgY(y.y);for(var R=0;R<s.length;R++){var k=s[R];k.transform(P)}var B=new T(p.getMaxX(),p.getMaxY());return P.inverseTransformPoint(B)},S.branchRadialLayout=function(s,N,y,w,p,P){var R=(w-y+1)/2;if(R<0)R+=180;var k=(R+y)%360,B=k*V.TWO_PI/360,X=Math.cos(B),st=p*Math.cos(B),dt=p*Math.sin(B);s.setCenter(st,dt);var Z=[];Z=Z.concat(s.getEdges());var ut=Z.length;if(N!=null)ut--;var nt=0,I=Z.length,K,et=s.getEdgesBetween(N);while(et.length>1){var ct=et[0];et.splice(0,1);var Nt=Z.indexOf(ct);if(Nt>=0)Z.splice(Nt,1);I--,ut--}if(N!=null)K=(Z.indexOf(et[0])+1)%I;else K=0;var Pt=Math.abs(w-y)/ut;for(var Bt=K;nt!=ut;Bt=++Bt%I){var ft=Z[Bt].getOtherEnd(s);if(ft==N)continue;var Jt=(y+nt*Pt)%360,Xt=(Jt+Pt)%360;S.branchRadialLayout(ft,s,Jt,Xt,p+P,P),nt++}},S.maxDiagonalInTree=function(s){var N=O.MIN_VALUE;for(var y=0;y<s.length;y++){var w=s[y],p=w.getDiagonal();if(p>N)N=p}return N},S.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},S.prototype.groupZeroDegreeMembers=function(){var s=this,N={};this.memberGroups={},this.idToDummyNode={};var y=[],w=this.graphManager.getAllNodes();for(var p=0;p<w.length;p++){var P=w[p],R=P.getParent();if(this.getNodeDegreeWithChildren(P)===0&&(R.id==null||!this.getToBeTiled(R)))y.push(P)}for(var p=0;p<y.length;p++){var P=y[p],k=P.getParent().id;if(typeof N[k]>"u")N[k]=[];N[k]=N[k].concat(P)}Object.keys(N).forEach(function(B){if(N[B].length>1){var X="DummyCompound_"+B;s.memberGroups[X]=N[B];var st=N[B][0].getParent(),dt=new i(s.graphManager);dt.id=X,dt.paddingLeft=st.paddingLeft||0,dt.paddingRight=st.paddingRight||0,dt.paddingBottom=st.paddingBottom||0,dt.paddingTop=st.paddingTop||0,s.idToDummyNode[X]=dt;var Z=s.getGraphManager().add(s.newGraph(),dt),ut=st.getChild();ut.add(dt);for(var nt=0;nt<N[B].length;nt++){var I=N[B][nt];ut.remove(I),Z.add(I)}}})},S.prototype.clearCompounds=function(){var s={},N={};this.performDFSOnCompounds();for(var y=0;y<this.compoundOrder.length;y++)N[this.compoundOrder[y].id]=this.compoundOrder[y],s[this.compoundOrder[y].id]=[].concat(this.compoundOrder[y].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[y].getChild()),this.compoundOrder[y].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,N)},S.prototype.clearZeroDegreeMembers=function(){var s=this,N=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(y){var w=s.idToDummyNode[y];if(N[y]=s.tileNodes(s.memberGroups[y],w.paddingLeft+w.paddingRight),w.rect.width=N[y].width,w.rect.height=N[y].height,w.setCenter(N[y].centerX,N[y].centerY),w.labelMarginLeft=0,w.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var p=w.rect.width,P=w.rect.height;if(w.labelWidth){if(w.labelPosHorizontal=="left")w.rect.x-=w.labelWidth,w.setWidth(p+w.labelWidth),w.labelMarginLeft=w.labelWidth;else if(w.labelPosHorizontal=="center"&&w.labelWidth>p)w.rect.x-=(w.labelWidth-p)/2,w.setWidth(w.labelWidth),w.labelMarginLeft=(w.labelWidth-p)/2;else if(w.labelPosHorizontal=="right")w.setWidth(p+w.labelWidth)}if(w.labelHeight){if(w.labelPosVertical=="top")w.rect.y-=w.labelHeight,w.setHeight(P+w.labelHeight),w.labelMarginTop=w.labelHeight;else if(w.labelPosVertical=="center"&&w.labelHeight>P)w.rect.y-=(w.labelHeight-P)/2,w.setHeight(w.labelHeight),w.labelMarginTop=(w.labelHeight-P)/2;else if(w.labelPosVertical=="bottom")w.setHeight(P+w.labelHeight)}}})},S.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var N=this.compoundOrder[s],{id:y,paddingLeft:w,paddingTop:p,labelMarginLeft:P,labelMarginTop:R}=N;this.adjustLocations(this.tiledMemberPack[y],N.rect.x,N.rect.y,w,p,P,R)}},S.prototype.repopulateZeroDegreeMembers=function(){var s=this,N=this.tiledZeroDegreePack;Object.keys(N).forEach(function(y){var w=s.idToDummyNode[y],{paddingLeft:p,paddingTop:P,labelMarginLeft:R,labelMarginTop:k}=w;s.adjustLocations(N[y],w.rect.x,w.rect.y,p,P,R,k)})},S.prototype.getToBeTiled=function(s){var N=s.id;if(this.toBeTiled[N]!=null)return this.toBeTiled[N];var y=s.getChild();if(y==null)return this.toBeTiled[N]=!1,!1;var w=y.getNodes();for(var p=0;p<w.length;p++){var P=w[p];if(this.getNodeDegree(P)>0)return this.toBeTiled[N]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[N]=!1,!1}return this.toBeTiled[N]=!0,!0},S.prototype.getNodeDegree=function(s){var N=s.id,y=s.getEdges(),w=0;for(var p=0;p<y.length;p++){var P=y[p];if(P.getSource().id!==P.getTarget().id)w=w+1}return w},S.prototype.getNodeDegreeWithChildren=function(s){var N=this.getNodeDegree(s);if(s.getChild()==null)return N;var y=s.getChild().getNodes();for(var w=0;w<y.length;w++){var p=y[w];N+=this.getNodeDegreeWithChildren(p)}return N},S.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},S.prototype.fillCompexOrderByDFS=function(s){for(var N=0;N<s.length;N++){var y=s[N];if(y.getChild()!=null)this.fillCompexOrderByDFS(y.getChild().getNodes());if(this.getToBeTiled(y))this.compoundOrder.push(y)}},S.prototype.adjustLocations=function(s,N,y,w,p,P,R){N+=w+P,y+=p+R;var k=N;for(var B=0;B<s.rows.length;B++){var X=s.rows[B];N=k;var st=0;for(var dt=0;dt<X.length;dt++){var Z=X[dt];if(Z.rect.x=N,Z.rect.y=y,N+=Z.rect.width+s.horizontalPadding,Z.rect.height>st)st=Z.rect.height}y+=st+s.verticalPadding}},S.prototype.tileCompoundMembers=function(s,N){var y=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(w){var p=N[w];if(y.tiledMemberPack[w]=y.tileNodes(s[w],p.paddingLeft+p.paddingRight),p.rect.width=y.tiledMemberPack[w].width,p.rect.height=y.tiledMemberPack[w].height,p.setCenter(y.tiledMemberPack[w].centerX,y.tiledMemberPack[w].centerY),p.labelMarginLeft=0,p.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var P=p.rect.width,R=p.rect.height;if(p.labelWidth){if(p.labelPosHorizontal=="left")p.rect.x-=p.labelWidth,p.setWidth(P+p.labelWidth),p.labelMarginLeft=p.labelWidth;else if(p.labelPosHorizontal=="center"&&p.labelWidth>P)p.rect.x-=(p.labelWidth-P)/2,p.setWidth(p.labelWidth),p.labelMarginLeft=(p.labelWidth-P)/2;else if(p.labelPosHorizontal=="right")p.setWidth(P+p.labelWidth)}if(p.labelHeight){if(p.labelPosVertical=="top")p.rect.y-=p.labelHeight,p.setHeight(R+p.labelHeight),p.labelMarginTop=p.labelHeight;else if(p.labelPosVertical=="center"&&p.labelHeight>R)p.rect.y-=(p.labelHeight-R)/2,p.setHeight(p.labelHeight),p.labelMarginTop=(p.labelHeight-R)/2;else if(p.labelPosVertical=="bottom")p.setHeight(R+p.labelHeight)}}})},S.prototype.tileNodes=function(s,N){var y=this.tileNodesByFavoringDim(s,N,!0),w=this.tileNodesByFavoringDim(s,N,!1),p=this.getOrgRatio(y),P=this.getOrgRatio(w),R;if(P<p)R=w;else R=y;return R},S.prototype.getOrgRatio=function(s){var{width:N,height:y}=s,w=N/y;if(w<1)w=1/w;return w},S.prototype.calcIdealRowWidth=function(s,N){var{TILING_PADDING_VERTICAL:y,TILING_PADDING_HORIZONTAL:w}=c,p=s.length,P=0,R=0,k=0;s.forEach(function(nt){if(P+=nt.getWidth(),R+=nt.getHeight(),nt.getWidth()>k)k=nt.getWidth()});var B=P/p,X=R/p,st=Math.pow(y-w,2)+4*(B+w)*(X+y)*p,dt=(w-y+Math.sqrt(st))/(2*(B+w)),Z;if(N){if(Z=Math.ceil(dt),Z==dt)Z++}else Z=Math.floor(dt);var ut=Z*(B+w)-w;if(k>ut)ut=k;return ut+=w*2,ut},S.prototype.tileNodesByFavoringDim=function(s,N,y){var{TILING_PADDING_VERTICAL:w,TILING_PADDING_HORIZONTAL:p,TILING_COMPARE_BY:P}=c,R={rows:[],rowWidth:[],rowHeight:[],width:0,height:N,verticalPadding:w,horizontalPadding:p,centerX:0,centerY:0};if(P)R.idealRowWidth=this.calcIdealRowWidth(s,y);var k=function(I){return I.rect.width*I.rect.height},B=function(I,K){return k(K)-k(I)};s.sort(function(nt,I){var K=B;if(R.idealRowWidth)return K=P,K(nt.id,I.id);return K(nt,I)});var X=0,st=0;for(var dt=0;dt<s.length;dt++){var Z=s[dt];X+=Z.getCenterX(),st+=Z.getCenterY()}R.centerX=X/s.length,R.centerY=st/s.length;for(var dt=0;dt<s.length;dt++){var Z=s[dt];if(R.rows.length==0)this.insertNodeToRow(R,Z,0,N);else if(this.canAddHorizontal(R,Z.rect.width,Z.rect.height)){var ut=R.rows.length-1;if(!R.idealRowWidth)ut=this.getShortestRowIndex(R);this.insertNodeToRow(R,Z,ut,N)}else this.insertNodeToRow(R,Z,R.rows.length,N);this.shiftToLastRow(R)}return R},S.prototype.insertNodeToRow=function(s,N,y,w){var p=w;if(y==s.rows.length){var P=[];s.rows.push(P),s.rowWidth.push(p),s.rowHeight.push(0)}var R=s.rowWidth[y]+N.rect.width;if(s.rows[y].length>0)R+=s.horizontalPadding;if(s.rowWidth[y]=R,s.width<R)s.width=R;var k=N.rect.height;if(y>0)k+=s.verticalPadding;var B=0;if(k>s.rowHeight[y])B=s.rowHeight[y],s.rowHeight[y]=k,B=s.rowHeight[y]-B;s.height+=B,s.rows[y].push(N)},S.prototype.getShortestRowIndex=function(s){var N=-1,y=Number.MAX_VALUE;for(var w=0;w<s.rows.length;w++)if(s.rowWidth[w]<y)N=w,y=s.rowWidth[w];return N},S.prototype.getLongestRowIndex=function(s){var N=-1,y=Number.MIN_VALUE;for(var w=0;w<s.rows.length;w++)if(s.rowWidth[w]>y)N=w,y=s.rowWidth[w];return N},S.prototype.canAddHorizontal=function(s,N,y){if(s.idealRowWidth){var w=s.rows.length-1,p=s.rowWidth[w];return p+N+s.horizontalPadding<=s.idealRowWidth}var P=this.getShortestRowIndex(s);if(P<0)return!0;var R=s.rowWidth[P];if(R+s.horizontalPadding+N<=s.width)return!0;var k=0;if(s.rowHeight[P]<y){if(P>0)k=y+s.verticalPadding-s.rowHeight[P]}var B;if(s.width-R>=N+s.horizontalPadding)B=(s.height+k)/(R+N+s.horizontalPadding);else B=(s.height+k)/s.width;k=y+s.verticalPadding;var X;if(s.width<N)X=(s.height+k)/N;else X=(s.height+k)/s.width;if(X<1)X=1/X;if(B<1)B=1/B;return B<X},S.prototype.shiftToLastRow=function(s){var N=this.getLongestRowIndex(s),y=s.rowWidth.length-1,w=s.rows[N],p=w[w.length-1],P=p.width+s.horizontalPadding;if(s.width-s.rowWidth[y]>P&&N!=y){w.splice(-1,1),s.rows[y].push(p),s.rowWidth[N]=s.rowWidth[N]-P,s.rowWidth[y]=s.rowWidth[y]+P,s.width=s.rowWidth[instance.getLongestRowIndex(s)];var R=Number.MIN_VALUE;for(var k=0;k<w.length;k++)if(w[k].height>R)R=w[k].height;if(N>0)R+=s.verticalPadding;var B=s.rowHeight[N]+s.rowHeight[y];if(s.rowHeight[N]=R,s.rowHeight[y]<p.height+s.verticalPadding)s.rowHeight[y]=p.height+s.verticalPadding;var X=s.rowHeight[N]+s.rowHeight[y];s.height+=X-B,this.shiftToLastRow(s)}},S.prototype.tilingPreLayout=function(){if(c.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},S.prototype.tilingPostLayout=function(){if(c.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},S.prototype.reduceTrees=function(){var s=[],N=!0,y;while(N){var w=this.graphManager.getAllNodes(),p=[];N=!1;for(var P=0;P<w.length;P++)if(y=w[P],y.getEdges().length==1&&!y.getEdges()[0].isInterGraph&&y.getChild()==null){if(c.PURE_INCREMENTAL){var R=y.getEdges()[0].getOtherEnd(y),k=new A(y.getCenterX()-R.getCenterX(),y.getCenterY()-R.getCenterY());p.push([y,y.getEdges()[0],y.getOwner(),k])}else p.push([y,y.getEdges()[0],y.getOwner()]);N=!0}if(N==!0){var B=[];for(var X=0;X<p.length;X++)if(p[X][0].getEdges().length==1)B.push(p[X]),p[X][0].getOwner().remove(p[X][0]);s.push(B),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},S.prototype.growTree=function(s){var N=s.length,y=s[N-1],w;for(var p=0;p<y.length;p++)w=y[p],this.findPlaceforPrunedNode(w),w[2].add(w[0]),w[2].add(w[1],w[1].source,w[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},S.prototype.findPlaceforPrunedNode=function(s){var N,y,w=s[0];if(w==s[1].source)y=s[1].target;else y=s[1].source;if(c.PURE_INCREMENTAL)w.setCenter(y.getCenterX()+s[3].getWidth(),y.getCenterY()+s[3].getHeight());else{var p=y.startX,P=y.finishX,R=y.startY,k=y.finishY,B=0,X=0,st=0,dt=0,Z=[B,st,X,dt];if(R>0)for(var ut=p;ut<=P;ut++)Z[0]+=this.grid[ut][R-1].length+this.grid[ut][R].length-1;if(P<this.grid.length-1)for(var ut=R;ut<=k;ut++)Z[1]+=this.grid[P+1][ut].length+this.grid[P][ut].length-1;if(k<this.grid[0].length-1)for(var ut=p;ut<=P;ut++)Z[2]+=this.grid[ut][k+1].length+this.grid[ut][k].length-1;if(p>0)for(var ut=R;ut<=k;ut++)Z[3]+=this.grid[p-1][ut].length+this.grid[p][ut].length-1;var nt=O.MAX_VALUE,I,K;for(var et=0;et<Z.length;et++)if(Z[et]<nt)nt=Z[et],I=1,K=et;else if(Z[et]==nt)I++;if(I==3&&nt==0){if(Z[0]==0&&Z[1]==0&&Z[2]==0)N=1;else if(Z[0]==0&&Z[1]==0&&Z[3]==0)N=0;else if(Z[0]==0&&Z[2]==0&&Z[3]==0)N=3;else if(Z[1]==0&&Z[2]==0&&Z[3]==0)N=2}else if(I==2&&nt==0){var ct=Math.floor(Math.random()*2);if(Z[0]==0&&Z[1]==0)if(ct==0)N=0;else N=1;else if(Z[0]==0&&Z[2]==0)if(ct==0)N=0;else N=2;else if(Z[0]==0&&Z[3]==0)if(ct==0)N=0;else N=3;else if(Z[1]==0&&Z[2]==0)if(ct==0)N=1;else N=2;else if(Z[1]==0&&Z[3]==0)if(ct==0)N=1;else N=3;else if(ct==0)N=2;else N=3}else if(I==4&&nt==0){var ct=Math.floor(Math.random()*4);N=ct}else N=K;if(N==0)w.setCenter(y.getCenterX(),y.getCenterY()-y.getHeight()/2-f.DEFAULT_EDGE_LENGTH-w.getHeight()/2);else if(N==1)w.setCenter(y.getCenterX()+y.getWidth()/2+f.DEFAULT_EDGE_LENGTH+w.getWidth()/2,y.getCenterY());else if(N==2)w.setCenter(y.getCenterX(),y.getCenterY()+y.getHeight()/2+f.DEFAULT_EDGE_LENGTH+w.getHeight()/2);else w.setCenter(y.getCenterX()-y.getWidth()/2-f.DEFAULT_EDGE_LENGTH-w.getWidth()/2,y.getCenterY())}},o.exports=S},991:(o,n,a)=>{var g=a(551).FDLayoutNode,r=a(551).IMath;function v(e,c,u,f){g.call(this,e,c,u,f)}v.prototype=Object.create(g.prototype);for(var i in g)v[i]=g[i];v.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)},v.prototype.propogateDisplacementToChildren=function(e,c){var u=this.getChild().getNodes(),f;for(var D=0;D<u.length;D++)if(f=u[D],f.getChild()==null)f.displacementX+=e,f.displacementY+=c;else f.propogateDisplacementToChildren(e,c)},v.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},v.prototype.setPred1=function(e){this.pred1=e},v.prototype.getPred1=function(){return pred1},v.prototype.getPred2=function(){return pred2},v.prototype.setNext=function(e){this.next=e},v.prototype.getNext=function(){return next},v.prototype.setProcessed=function(e){this.processed=e},v.prototype.isProcessed=function(){return processed},o.exports=v},902:(o,n,a)=>{function g(u){if(Array.isArray(u)){for(var f=0,D=Array(u.length);f<u.length;f++)D[f]=u[f];return D}else return Array.from(u)}var r=a(806),v=a(551).LinkedList,i=a(551).Matrix,e=a(551).SVD;function c(){}c.handleConstraints=function(u){var f={};f.fixedNodeConstraint=u.constraints.fixedNodeConstraint,f.alignmentConstraint=u.constraints.alignmentConstraint,f.relativePlacementConstraint=u.constraints.relativePlacementConstraint;var D=new Map,E=new Map,T=[],A=[],G=u.getAllNodes(),O=0;for(var V=0;V<G.length;V++){var _=G[V];if(_.getChild()==null)E.set(_.id,O++),T.push(_.getCenterX()),A.push(_.getCenterY()),D.set(_.id,_)}if(f.relativePlacementConstraint)f.relativePlacementConstraint.forEach(function(J){if(!J.gap&&J.gap!=0)if(J.left)J.gap=r.DEFAULT_EDGE_LENGTH+D.get(J.left).getWidth()/2+D.get(J.right).getWidth()/2;else J.gap=r.DEFAULT_EDGE_LENGTH+D.get(J.top).getHeight()/2+D.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+=T[E.get(ot)],at+=A[E.get(ot)]}),{x:it/rt.size,y:at/rt.size}},S=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 v;if(Mt.forEach(function(Tt,yt){if(Tt==0){if(Ct.push(yt),!at)if(it=="horizontal")ht.set(yt,E.has(yt)?T[E.get(yt)]:ot.get(yt));else ht.set(yt,E.has(yt)?A[E.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,E.has(wt)?T[E.get(wt)]:ot.get(wt)),Dt+=ht.get(wt);else ht.set(wt,E.has(wt)?A[E.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+=E.has(wt)?T[E.get(wt)]:ot.get(wt);else mt+=E.has(wt)?A[E.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=E.has(mt.id)?T[E.get(mt.id)]:ot.get(mt.id);else wt=E.has(mt.id)?A[E.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(g(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=E.has($t)?T[E.get($t)]:ot.get($t);else jt=E.has($t)?A[E.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 de=Le.value;ht.set(de,ht.get(de)+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)T[E.get(Lt.left)]-T[E.get(Lt.right)]>=0?it++:at++;else A[E.get(Lt.top)]-A[E.get(Lt.bottom)]>=0?ot++:gt++}),it>at&&ot>gt)for(var At=0;At<E.size;At++)T[At]=-1*T[At],A[At]=-1*A[At];else if(it>at)for(var Mt=0;Mt<E.size;Mt++)T[Mt]=-1*T[Mt];else if(ot>gt)for(var ht=0;ht<E.size;ht++)A[ht]=-1*A[ht]},s=function(rt){var it=[],at=new v,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},N=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},y=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},w=[],p=[],P=!1,R=!1,k=new Set,B=new Map,X=new Map,st=[];if(f.fixedNodeConstraint)f.fixedNodeConstraint.forEach(function(J){k.add(J.nodeId)});if(f.relativePlacementConstraint)f.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,[])}}),X=N(B),st=s(X);if(r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(f.fixedNodeConstraint&&f.fixedNodeConstraint.length>1)f.fixedNodeConstraint.forEach(function(J,rt){w[rt]=[J.position.x,J.position.y],p[rt]=[T[E.get(J.nodeId)],A[E.get(J.nodeId)]]}),P=!0;else if(f.alignmentConstraint)(function(){var J=0;if(f.alignmentConstraint.vertical){var rt=f.alignmentConstraint.vertical,it=function(ht){var Lt=new Set;rt[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(g(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=T[E.get(Ct.values().next().value)];else pt=lt(Lt).x;rt[ht].forEach(function(Ot){w[J]=[pt,A[E.get(Ot)]],p[J]=[T[E.get(Ot)],A[E.get(Ot)]],J++})};for(var at=0;at<rt.length;at++)it(at);P=!0}if(f.alignmentConstraint.horizontal){var ot=f.alignmentConstraint.horizontal,gt=function(ht){var Lt=new Set;ot[ht].forEach(function(Ot){Lt.add(Ot)});var Ct=new Set([].concat(g(Lt)).filter(function(Ot){return k.has(Ot)})),pt=void 0;if(Ct.size>0)pt=T[E.get(Ct.values().next().value)];else pt=lt(Lt).y;ot[ht].forEach(function(Ot){w[J]=[T[E.get(Ot)],pt],p[J]=[T[E.get(Ot)],A[E.get(Ot)]],J++})};for(var At=0;At<ot.length;At++)gt(At);P=!0}if(f.relativePlacementConstraint)R=!0})();else if(f.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<X.size/2)tt(f.relativePlacementConstraint),P=!1,R=!1;else{var nt=new Map,I=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(I.has(J))I.get(J).push(rt);else I.set(J,[rt]);if(!I.has(rt.id))I.set(rt.id,[]);K.push({top:J,bottom:rt.id})}})}),tt(K),R=!1;var et=S(nt,"horizontal"),ct=S(I,"vertical");st[Z].forEach(function(J,rt){if(p[rt]=[T[E.get(J)],A[E.get(J)]],w[rt]=[],et.has(J))w[rt][0]=et.get(J);else w[rt][0]=T[E.get(J)];if(ct.has(J))w[rt][1]=ct.get(J);else w[rt][1]=A[E.get(J)]}),P=!0}}if(P){var Nt=void 0,Pt=i.transpose(w),Bt=i.transpose(p);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<E.size;Et++){var vt=[T[Et],A[Et]],xt=[Nt[0][0],Nt[1][0]],Rt=[Nt[0][1],Nt[1][1]];T[Et]=i.dotProduct(vt,xt),A[Et]=i.dotProduct(vt,Rt)}if(R)tt(f.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(f.fixedNodeConstraint&&f.fixedNodeConstraint.length>0){var Gt={x:0,y:0};f.fixedNodeConstraint.forEach(function(J,rt){var it={x:T[E.get(J.nodeId)],y:A[E.get(J.nodeId)]},at=J.position,ot=Q(at,it);Gt.x+=ot.x,Gt.y+=ot.y}),Gt.x/=f.fixedNodeConstraint.length,Gt.y/=f.fixedNodeConstraint.length,T.forEach(function(J,rt){T[rt]+=Gt.x}),A.forEach(function(J,rt){A[rt]+=Gt.y}),f.fixedNodeConstraint.forEach(function(J){T[E.get(J.nodeId)]=J.position.x,A[E.get(J.nodeId)]=J.position.y})}if(f.alignmentConstraint){if(f.alignmentConstraint.vertical){var St=f.alignmentConstraint.vertical,Ft=function(rt){var it=new Set;St[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(g(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=T[E.get(at.values().next().value)];else ot=lt(it).x;it.forEach(function(gt){if(!k.has(gt))T[E.get(gt)]=ot})};for(var Ht=0;Ht<St.length;Ht++)Ft(Ht)}if(f.alignmentConstraint.horizontal){var zt=f.alignmentConstraint.horizontal,ee=function(rt){var it=new Set;zt[rt].forEach(function(gt){it.add(gt)});var at=new Set([].concat(g(it)).filter(function(gt){return k.has(gt)})),ot=void 0;if(at.size>0)ot=A[E.get(at.values().next().value)];else ot=lt(it).y;it.forEach(function(gt){if(!k.has(gt))A[E.get(gt)]=ot})};for(var qt=0;qt<zt.length;qt++)ee(qt)}}if(f.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)}),f.alignmentConstraint){if(f.alignmentConstraint.vertical){var ht=f.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,T[E.get(ht[It][0])])};for(var Ct=0;Ct<ht.length;Ct++)Lt(Ct)}if(f.alignmentConstraint.horizontal){var pt=f.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,A[E.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=N(Tt),ae=N(yt),$t=s(bt),jt=s(ae),ie=y(Tt),Me=y(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=S(Tt,"horizontal",At,ot,le),fe=S(yt,"vertical",Mt,gt,ce),Le=function(It){if(it.get(It))it.get(It).forEach(function(Yt){T[E.get(Yt)]=ge.get(It)});else T[E.get(It)]=ge.get(It)},de=!0,ve=!1,Ue=void 0;try{for(var Ce=ge.keys()[Symbol.iterator](),Ye;!(de=(Ye=Ce.next()).done);de=!0){var Ae=Ye.value;Le(Ae)}}catch(Qt){ve=!0,Ue=Qt}finally{try{if(!de&&Ce.return)Ce.return()}finally{if(ve)throw Ue}}var sr=function(It){if(at.get(It))at.get(It).forEach(function(Yt){A[E.get(Yt)]=fe.get(It)});else A[E.get(It)]=fe.get(It)},De=!0,Xe=!1,We=void 0;try{for(var Oe=fe.keys()[Symbol.iterator](),Ve;!(De=(Ve=Oe.next()).done);De=!0){var Ae=Ve.value;sr(Ae)}}catch(Qt){Xe=!0,We=Qt}finally{try{if(!De&&Oe.return)Oe.return()}finally{if(Xe)throw We}}})()}for(var Kt=0;Kt<G.length;Kt++){var kt=G[Kt];if(kt.getChild()==null)kt.setCenter(T[E.get(kt.id)],A[E.get(kt.id)])}},o.exports=c},551:(o)=>{o.exports=L}},M={};function d(o){var n=M[o];if(n!==void 0)return n.exports;var a=M[o]={exports:{}};return x[o](a,a.exports,d),a.exports}var h=d(45);return h})()})});var ze=$n(function(Te,Fe){(function(x,M){if(typeof Te==="object"&&typeof Fe==="object")Fe.exports=M(Se());else if(typeof define==="function"&&define.amd)define(["cose-base"],M);else if(typeof Te==="object")Te.cytoscapeFcose=M(Se());else x.cytoscapeFcose=M(x.coseBase)})(Te,function(L){return(()=>{var x={658:(o)=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(n){for(var a=arguments.length,g=Array(a>1?a-1:0),r=1;r<a;r++)g[r-1]=arguments[r];return g.forEach(function(v){Object.keys(v).forEach(function(i){return n[i]=v[i]})}),n}},548:(o,n,a)=>{var g=function(){function i(e,c){var u=[],f=!0,D=!1,E=void 0;try{for(var T=e[Symbol.iterator](),A;!(f=(A=T.next()).done);f=!0)if(u.push(A.value),c&&u.length===c)break}catch(G){D=!0,E=G}finally{try{if(!f&&T.return)T.return()}finally{if(D)throw E}}return u}return function(e,c){if(Array.isArray(e))return e;else if(Symbol.iterator in Object(e))return i(e,c);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(140).layoutBase.LinkedList,v={};v.getTopMostNodes=function(i){var e={};for(var c=0;c<i.length;c++)e[i[c].id()]=!0;var u=i.filter(function(f,D){if(typeof f==="number")f=D;var E=f.parent()[0];while(E!=null){if(e[E.id()])return!1;E=E.parent()[0]}return!0});return u},v.connectComponents=function(i,e,c,u){var f=new r,D=new Set,E=[],T=void 0,A=void 0,G=void 0,O=!1,V=1,_=[],Q=[],lt=function(){var tt=i.collection();Q.push(tt);var s=c[0],N=i.collection();N.merge(s).merge(s.descendants().intersection(e)),E.push(s),N.forEach(function(p){f.push(p),D.add(p),tt.merge(p)});var y=function(){s=f.shift();var P=i.collection();s.neighborhood().nodes().forEach(function(X){if(e.intersection(s.edgesWith(X)).length>0)P.merge(X)});for(var R=0;R<P.length;R++){var k=P[R];if(T=c.intersection(k.union(k.ancestors())),T!=null&&!D.has(T[0])){var B=T.union(T.descendants());B.forEach(function(X){if(f.push(X),D.add(X),tt.merge(X),c.has(X))E.push(X)})}}};while(f.length!=0)y();if(tt.forEach(function(p){e.intersection(p.connectedEdges()).forEach(function(P){if(tt.has(P.source())&&tt.has(P.target()))tt.merge(P)})}),E.length==c.length)O=!0;if(!O||O&&V>1){A=E[0],G=A.connectedEdges().length,E.forEach(function(p){if(p.connectedEdges().length<G)G=p.connectedEdges().length,A=p}),_.push(A.id());var w=i.collection();w.merge(E[0]),E.forEach(function(p){w.merge(p)}),E=[],c=c.difference(w),V++}};do lt();while(!O);if(u){if(_.length>0)u.set("dummy"+(u.size+1),_)}return Q},v.relocateComponent=function(i,e,c){if(!c.fixedNodeConstraint){var{POSITIVE_INFINITY:u,NEGATIVE_INFINITY:f,POSITIVE_INFINITY:D,NEGATIVE_INFINITY:E}=Number;if(c.quality=="draft"){var T=!0,A=!1,G=void 0;try{for(var O=e.nodeIndexes[Symbol.iterator](),V;!(T=(V=O.next()).done);T=!0){var _=V.value,Q=g(_,2),lt=Q[0],S=Q[1],tt=c.cy.getElementById(lt);if(tt){var s=tt.boundingBox(),N=e.xCoords[S]-s.w/2,y=e.xCoords[S]+s.w/2,w=e.yCoords[S]-s.h/2,p=e.yCoords[S]+s.h/2;if(N<u)u=N;if(y>f)f=y;if(w<D)D=w;if(p>E)E=p}}}catch(X){A=!0,G=X}finally{try{if(!T&&O.return)O.return()}finally{if(A)throw G}}var P=i.x-(f+u)/2,R=i.y-(E+D)/2;e.xCoords=e.xCoords.map(function(X){return X+P}),e.yCoords=e.yCoords.map(function(X){return X+R})}else{Object.keys(e).forEach(function(X){var st=e[X],dt=st.getRect().x,Z=st.getRect().x+st.getRect().width,ut=st.getRect().y,nt=st.getRect().y+st.getRect().height;if(dt<u)u=dt;if(Z>f)f=Z;if(ut<D)D=ut;if(nt>E)E=nt});var k=i.x-(f+u)/2,B=i.y-(E+D)/2;Object.keys(e).forEach(function(X){var st=e[X];st.setCenter(st.getCenterX()+k,st.getCenterY()+B)})}}},v.calcBoundingBox=function(i,e,c,u){var{MAX_SAFE_INTEGER:f,MIN_SAFE_INTEGER:D,MAX_SAFE_INTEGER:E,MIN_SAFE_INTEGER:T}=Number,A=void 0,G=void 0,O=void 0,V=void 0,_=i.descendants().not(":parent"),Q=_.length;for(var lt=0;lt<Q;lt++){var S=_[lt];if(A=e[u.get(S.id())]-S.width()/2,G=e[u.get(S.id())]+S.width()/2,O=c[u.get(S.id())]-S.height()/2,V=c[u.get(S.id())]+S.height()/2,f>A)f=A;if(D<G)D=G;if(E>O)E=O;if(T<V)T=V}var tt={};return tt.topLeftX=f,tt.topLeftY=E,tt.width=D-f,tt.height=T-E,tt},v.calcParentsWithoutChildren=function(i,e){var c=i.collection();return e.nodes(":parent").forEach(function(u){var f=!1;if(u.children().forEach(function(D){if(D.css("display")!="none")f=!0}),!f)c.merge(u)}),c},o.exports=v},816:(o,n,a)=>{var g=a(548),r=a(140).CoSELayout,v=a(140).CoSENode,i=a(140).layoutBase.PointD,e=a(140).layoutBase.DimensionD,c=a(140).layoutBase.LayoutConstants,u=a(140).layoutBase.FDLayoutConstants,f=a(140).CoSEConstants,D=function(T,A){var{cy:G,eles:O}=T,V=O.nodes(),_=O.edges(),Q=void 0,lt=void 0,S=void 0,tt={};if(T.randomize)Q=A.nodeIndexes,lt=A.xCoords,S=A.yCoords;var s=function(X){return typeof X==="function"},N=function(X,st){if(s(X))return X(st);else return X},y=g.calcParentsWithoutChildren(G,O),w=function B(X,st,dt,Z){var ut=st.length;for(var nt=0;nt<ut;nt++){var I=st[nt],K=null;if(I.intersection(y).length==0)K=I.children();var et=void 0,ct=I.layoutDimensions({nodeDimensionsIncludeLabels:Z.nodeDimensionsIncludeLabels});if(I.outerWidth()!=null&&I.outerHeight()!=null)if(Z.randomize)if(!I.isParent())et=X.add(new v(dt.graphManager,new i(lt[Q.get(I.id())]-ct.w/2,S[Q.get(I.id())]-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else{var Nt=g.calcBoundingBox(I,lt,S,Q);if(I.intersection(y).length==0)et=X.add(new v(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(Nt.width,Nt.height)));else et=X.add(new v(dt.graphManager,new i(Nt.topLeftX,Nt.topLeftY),new e(parseFloat(ct.w),parseFloat(ct.h))))}else et=X.add(new v(dt.graphManager,new i(I.position("x")-ct.w/2,I.position("y")-ct.h/2),new e(parseFloat(ct.w),parseFloat(ct.h))));else et=X.add(new v(this.graphManager));if(et.id=I.data("id"),et.nodeRepulsion=N(Z.nodeRepulsion,I),et.paddingLeft=parseInt(I.css("padding")),et.paddingTop=parseInt(I.css("padding")),et.paddingRight=parseInt(I.css("padding")),et.paddingBottom=parseInt(I.css("padding")),Z.nodeDimensionsIncludeLabels)et.labelWidth=I.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,et.labelHeight=I.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,et.labelPosVertical=I.css("text-valign"),et.labelPosHorizontal=I.css("text-halign");if(tt[I.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)}}},p=function(X,st,dt){var Z=0,ut=0;for(var nt=0;nt<dt.length;nt++){var I=dt[nt],K=tt[I.data("source")],et=tt[I.data("target")];if(K&&et&&K!==et&&K.getEdgesBetween(et).length==0){var ct=st.add(X.newEdge(),K,et);ct.id=I.id(),ct.idealLength=N(T.idealEdgeLength,I),ct.edgeElasticity=N(T.edgeElasticity,I),Z+=ct.idealLength,ut++}}if(T.idealEdgeLength!=null){if(ut>0)f.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=Z/ut;else if(!s(T.idealEdgeLength))f.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=T.idealEdgeLength;else f.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50;f.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,f.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH}},P=function(X,st){if(st.fixedNodeConstraint)X.constraints.fixedNodeConstraint=st.fixedNodeConstraint;if(st.alignmentConstraint)X.constraints.alignmentConstraint=st.alignmentConstraint;if(st.relativePlacementConstraint)X.constraints.relativePlacementConstraint=st.relativePlacementConstraint};if(T.nestingFactor!=null)f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=T.nestingFactor;if(T.gravity!=null)f.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=T.gravity;if(T.numIter!=null)f.MAX_ITERATIONS=u.MAX_ITERATIONS=T.numIter;if(T.gravityRange!=null)f.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=T.gravityRange;if(T.gravityCompound!=null)f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=T.gravityCompound;if(T.gravityRangeCompound!=null)f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=T.gravityRangeCompound;if(T.initialEnergyOnIncremental!=null)f.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=T.initialEnergyOnIncremental;if(T.tilingCompareBy!=null)f.TILING_COMPARE_BY=T.tilingCompareBy;if(T.quality=="proof")c.QUALITY=2;else c.QUALITY=0;if(f.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=T.nodeDimensionsIncludeLabels,f.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!T.randomize,f.ANIMATE=u.ANIMATE=c.ANIMATE=T.animate,f.TILE=T.tile,f.TILING_PADDING_VERTICAL=typeof T.tilingPaddingVertical==="function"?T.tilingPaddingVertical.call():T.tilingPaddingVertical,f.TILING_PADDING_HORIZONTAL=typeof T.tilingPaddingHorizontal==="function"?T.tilingPaddingHorizontal.call():T.tilingPaddingHorizontal,f.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,f.PURE_INCREMENTAL=!T.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=T.uniformNodeDimensions,T.step=="transformed")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!1;if(T.step=="enforced")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!1;if(T.step=="cose")f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!0;if(T.step=="all"){if(T.randomize)f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!0}if(T.fixedNodeConstraint||T.alignmentConstraint||T.relativePlacementConstraint)f.TREE_REDUCTION_ON_INCREMENTAL=!1;else f.TREE_REDUCTION_ON_INCREMENTAL=!0;var R=new r,k=R.newGraphManager();return w(k.addRoot(),g.getTopMostNodes(V),R,T),p(R,k,_),P(R,T),R.runLayout(),tt};o.exports={coseLayout:D}},212:(o,n,a)=>{var g=function(){function T(A,G){for(var O=0;O<G.length;O++){var V=G[O];if(V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V)V.writable=!0;Object.defineProperty(A,V.key,V)}}return function(A,G,O){if(G)T(A.prototype,G);if(O)T(A,O);return A}}();function r(T,A){if(!(T instanceof A))throw TypeError("Cannot call a class as a function")}var v=a(658),i=a(548),e=a(657),c=e.spectralLayout,u=a(816),f=u.coseLayout,D=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(A){return 4500},idealEdgeLength:function(A){return 50},edgeElasticity:function(A){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(){}}),E=function(){function T(A){r(this,T),this.options=v({},D,A)}return g(T,[{key:"run",value:function(){var G=this,O=this.options,{cy:V,eles:_}=O,Q=[],lt=void 0,S=void 0,tt=[],s=void 0,N=[];if(O.fixedNodeConstraint&&(!Array.isArray(O.fixedNodeConstraint)||O.fixedNodeConstraint.length==0))O.fixedNodeConstraint=void 0;if(O.alignmentConstraint){if(O.alignmentConstraint.vertical&&(!Array.isArray(O.alignmentConstraint.vertical)||O.alignmentConstraint.vertical.length==0))O.alignmentConstraint.vertical=void 0;if(O.alignmentConstraint.horizontal&&(!Array.isArray(O.alignmentConstraint.horizontal)||O.alignmentConstraint.horizontal.length==0))O.alignmentConstraint.horizontal=void 0}if(O.relativePlacementConstraint&&(!Array.isArray(O.relativePlacementConstraint)||O.relativePlacementConstraint.length==0))O.relativePlacementConstraint=void 0;var y=O.fixedNodeConstraint||O.alignmentConstraint||O.relativePlacementConstraint;if(y)O.tile=!1,O.packComponents=!1;var w=void 0,p=!1;if(V.layoutUtilities&&O.packComponents){if(w=V.layoutUtilities("get"),!w)w=V.layoutUtilities();p=!0}if(_.nodes().length>0)if(!p){var P=O.eles.boundingBox();if(N.push({x:P.x1+P.w/2,y:P.y1+P.h/2}),O.randomize){var R=c(O);Q.push(R)}if(O.quality=="default"||O.quality=="proof")tt.push(f(O,Q[0])),i.relocateComponent(N[0],tt[0],O);else i.relocateComponent(N[0],Q[0],O)}else{var k=i.getTopMostNodes(O.eles.nodes());if(s=i.connectComponents(V,O.eles,k),s.forEach(function(Et){var vt=Et.boundingBox();N.push({x:vt.x1+vt.w/2,y:vt.y1+vt.h/2})}),O.randomize)s.forEach(function(Et){O.eles=Et,Q.push(c(O))});if(O.quality=="default"||O.quality=="proof"){var B=V.collection();if(O.tile){var X=new Map,st=[],dt=[],Z=0,ut={nodeIndexes:X,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 I=B.boundingBox();N.push({x:I.x1+I.w/2,y:I.y1+I.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),N.splice(nt[K],1)}}s.forEach(function(Et,vt){O.eles=Et,tt.push(f(O,Q[vt])),i.relocateComponent(N[vt],tt[vt],O)})}else s.forEach(function(Et,vt){i.relocateComponent(N[vt],Q[vt],O)});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(O.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(O.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(O.quality=="draft"){var zt=xt.get(Ft.id()),ee=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[ee]),Kt.push(Q[vt].yCoords[ee]);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=w.packComponents(ct,O.randomize).shifts;if(O.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(O.quality=="default"||O.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]}),O.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(O.quality=="default"||O.quality=="proof"||O.randomize){var Jt=i.calcParentsWithoutChildren(V,_),Xt=_.filter(function(Et){return Et.css("display")=="none"});if(O.eles=_.not(Xt),_.nodes().not(":parent").not(Xt).layoutPositions(G,O,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'.")}}]),T}();o.exports=E},657:(o,n,a)=>{var g=a(548),r=a(140).layoutBase.Matrix,v=a(140).layoutBase.SVD,i=function(c){var{cy:u,eles:f}=c,D=f.nodes(),E=f.nodes(":parent"),T=new Map,A=new Map,G=new Map,O=[],V=[],_=[],Q=[],lt=[],S=[],tt=[],s=[],N=void 0,y=void 0,w=1e8,p=0.000000001,{piTol:P,samplingType:R,nodeSeparation:k}=c,B=void 0,X=function(){var it=0,at=0,ot=!1;while(at<B){it=Math.floor(Math.random()*y),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<y;Ut++)Ct[Ut]=w;gt[Mt]=it,Ct[it]=0;while(Mt>=At){ht=gt[At++];var Tt=O[ht];for(var yt=0;yt<Tt.length;yt++)if(Lt=A.get(Tt[yt]),Ct[Lt]==w)Ct[Lt]=Ct[ht]+1,gt[++Mt]=Lt;S[ht][at]=Ct[ht]*k}if(ot){for(var Dt=0;Dt<y;Dt++)if(S[Dt][at]<lt[Dt])lt[Dt]=S[Dt][at];for(var mt=0;mt<y;mt++)if(lt[mt]>pt)pt=lt[mt],Ot=mt}return Ot},dt=function(it){var at=void 0;if(!it){X();for(var ot=0;ot<B;ot++)st(Q[ot],ot,it,!1)}else{at=Math.floor(Math.random()*y),N=at;for(var gt=0;gt<y;gt++)lt[gt]=w;for(var At=0;At<B;At++)Q[At]=at,at=st(at,At,it)}for(var Mt=0;Mt<y;Mt++)for(var ht=0;ht<B;ht++)S[Mt][ht]*=S[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]=S[Q[pt]][Ct]},Z=function(){var it=v.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<y;ht++)ot[ht]=Math.random(),gt[ht]=Math.random();ot=r.normalize(ot),gt=r.normalize(gt);var Lt=0,Ct=p,pt=p,Ot=void 0;while(!0){Lt++;for(var Ut=0;Ut<y;Ut++)At[Ut]=ot[Ut];if(ot=r.multGamma(r.multL(r.multGamma(At),S,s)),it=r.dotProduct(At,ot),ot=r.normalize(ot),Ct=r.dotProduct(At,ot),Ot=Math.abs(Ct/pt),Ot<=1+P&&Ot>=1)break;pt=Ct}for(var Tt=0;Tt<y;Tt++)At[Tt]=ot[Tt];Lt=0,pt=p;while(!0){Lt++;for(var yt=0;yt<y;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),S,s)),at=r.dotProduct(Mt,gt),gt=r.normalize(gt),Ct=r.dotProduct(Mt,gt),Ot=Math.abs(Ct/pt),Ot<=1+P&&Ot>=1)break;pt=Ct}for(var Dt=0;Dt<y;Dt++)Mt[Dt]=gt[Dt];V=r.multCons(At,Math.sqrt(Math.abs(it))),_=r.multCons(Mt,Math.sqrt(Math.abs(at)))};g.connectComponents(u,f,g.getTopMostNodes(D),T),E.forEach(function(rt){g.connectComponents(u,f,g.getTopMostNodes(rt.descendants().intersection(f)),T)});var nt=0;for(var I=0;I<D.length;I++)if(!D[I].isParent())A.set(D[I].id(),nt++);var K=!0,et=!1,ct=void 0;try{for(var Nt=T.keys()[Symbol.iterator](),Pt;!(K=(Pt=Nt.next()).done);K=!0){var Bt=Pt.value;A.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<A.size;ft++)O[ft]=[];E.forEach(function(rt){var it=rt.children().intersection(f);while(it.nodes(":childless").length==0)it=it.nodes()[0].children().intersection(f);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}),G.set(rt.id(),it.nodes(":childless")[at].id())}),D.forEach(function(rt){var it=void 0;if(rt.isParent())it=A.get(G.get(rt.id()));else it=A.get(rt.id());rt.neighborhood().nodes().forEach(function(at){if(f.intersection(rt.edgesWith(at)).length>0)if(at.isParent())O[it].push(G.get(at.id()));else O[it].push(at.id())})});var Jt=function(it){var at=A.get(it),ot=void 0;T.get(it).forEach(function(gt){if(u.getElementById(gt).isParent())ot=G.get(gt);else ot=gt;O[at].push(ot),O[A.get(ot)].push(it)})},Xt=!0,Et=!1,vt=void 0;try{for(var xt=T.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}}y=A.size;var St=void 0;if(y>2){B=y<c.sampleSize?y:c.sampleSize;for(var Ft=0;Ft<y;Ft++)S[Ft]=[];for(var Ht=0;Ht<B;Ht++)s[Ht]=[];if(c.quality=="draft"||c.step=="all")dt(R),Z(),ut(),St={nodeIndexes:A,xCoords:V,yCoords:_};else A.forEach(function(rt,it){V.push(u.getElementById(it).position("x")),_.push(u.getElementById(it).position("y"))}),St={nodeIndexes:A,xCoords:V,yCoords:_};return St}else{var zt=A.keys(),ee=u.getElementById(zt.next().value),qt=ee.position(),Kt=ee.outerWidth();if(V.push(qt.x),_.push(qt.y),y==2){var kt=u.getElementById(zt.next().value),J=kt.outerWidth();V.push(qt.x+Kt/2+J/2+c.idealEdgeLength),_.push(qt.y)}return St={nodeIndexes:A,xCoords:V,yCoords:_},St}};o.exports={spectralLayout:i}},579:(o,n,a)=>{var g=a(212),r=function(i){if(!i)return;i("layout","fcose",g)};if(typeof cytoscape<"u")r(cytoscape);o.exports=r},140:(o)=>{o.exports=L}},M={};function d(o){var n=M[o];if(n!==void 0)return n.exports;var a=M[o]={exports:{}};return x[o](a,a.exports,d),a.exports}var h=d(579);return h})()})});var je=wn(ze(),1);var $e={L:"left",R:"right",T:"top",B:"bottom"},Be={L:t((L)=>`${L},${L/2} 0,${L} 0,0`,"L"),R:t((L)=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:t((L)=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:t((L)=>`${L/2},0 ${L},${L} 0,${L}`,"B")},we={L:t((L,x)=>L-x+2,"L"),R:t((L,x)=>L-2,"R"),T:t((L,x)=>L-x+2,"T"),B:t((L,x)=>L-2,"B")},hr=t(function(L){if(_t(L))return L==="L"?"R":"L";else return L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ze=t(function(L){let x=L;return x==="L"||x==="R"||x==="T"||x==="B"},"isArchitectureDirection"),_t=t(function(L){let x=L;return x==="L"||x==="R"},"isArchitectureDirectionX"),se=t(function(L){let x=L;return x==="T"||x==="B"},"isArchitectureDirectionY"),Ge=t(function(L,x){let M=_t(L)&&se(x),d=se(L)&&_t(x);return M||d},"isArchitectureDirectionXY"),lr=t(function(L){let x=L[0],M=L[1],d=_t(x)&&se(M),h=se(x)&&_t(M);return d||h},"isArchitecturePairXY"),fr=t(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),be=t(function(L,x){let M=`${L}${x}`;return fr(M)?M:void 0},"getArchitectureDirectionPair"),cr=t(function([L,x],M){let d=M[0],h=M[1];if(_t(d))if(se(h))return[L+(d==="L"?-1:1),x+(h==="T"?1:-1)];else return[L+(d==="L"?-1:1),x];else if(_t(h))return[L+(h==="L"?1:-1),x+(d==="T"?1:-1)];else return[L,x+(d==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),gr=t(function(L){if(L==="LT"||L==="TL")return[1,1];else if(L==="BL"||L==="LB")return[1,-1];else if(L==="BR"||L==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),ur=t(function(L,x){if(Ge(L,x))return"bend";else if(_t(L))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),dr=t(function(L){return L.type==="service"},"isArchitectureService"),vr=t(function(L){return L.type==="junction"},"isArchitectureJunction"),qe=t((L,x)=>{let[M,d]=[L,x].sort();return`${JSON.stringify(M)}-${JSON.stringify(d)}`},"architectureGroupAlignmentKey"),Qe=t((L)=>L.data(),"edgeData"),ye=t((L)=>L.data(),"nodeData"),pr=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=z,this.getAccTitle=H,this.setDiagramTitle=W,this.getDiagramTitle=q,this.getAccDescription=j,this.setAccDescription=U,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}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="",F()}addService({id:L,icon:x,in:M,title:d,iconText:h}){if(this.registeredIds.has(L))throw Error(`The service id [${L}] is already in use by another ${this.registeredIds.get(L)}`);if(M!==void 0){if(L===M)throw Error(`The service [${L}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(M)==="node")throw Error(`The service [${L}]'s parent is not a group`)}this.registeredIds.set(L,"node"),this.nodes.set(L,{id:L,type:"service",icon:x,iconText:h,title:d,edges:[],in:M})}getServices(){return[...this.nodes.values()].filter(dr)}addJunction({id:L,in:x}){if(this.registeredIds.has(L))throw Error(`The junction id [${L}] is already in use by another ${this.registeredIds.get(L)}`);if(x!==void 0){if(L===x)throw Error(`The junction [${L}] cannot be placed within itself`);if(!this.registeredIds.has(x))throw Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(x)==="node")throw Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds.set(L,"node"),this.nodes.set(L,{id:L,type:"junction",edges:[],in:x})}getJunctions(){return[...this.nodes.values()].filter(vr)}getNodes(){return[...this.nodes.values()]}getNode(L){return this.nodes.get(L)??null}addGroup({id:L,icon:x,in:M,title:d}){if(this.registeredIds.has(L))throw Error(`The group id [${L}] is already in use by another ${this.registeredIds.get(L)}`);if(M!==void 0){if(L===M)throw Error(`The group [${L}] cannot be placed within itself`);if(!this.registeredIds.has(M))throw Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(M)==="node")throw Error(`The group [${L}]'s parent is not a group`)}this.registeredIds.set(L,"group"),this.groups.set(L,{id:L,icon:x,title:d,in:M})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:L,rhsId:x,lhsDir:M,rhsDir:d,lhsInto:h,rhsInto:o,lhsGroup:n,rhsGroup:a,title:g}){if(!Ze(M))throw Error(`Invalid direction given for left hand side of edge ${L}--${x}. Expected (L,R,T,B) got ${String(M)}`);if(!Ze(d))throw Error(`Invalid direction given for right hand side of edge ${L}--${x}. Expected (L,R,T,B) got ${String(d)}`);if(!this.nodes.has(L)&&!this.groups.has(L))throw Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(x)&&!this.groups.has(x))throw Error(`The right-hand id [${x}] does not yet exist. Please create the service/group before declaring an edge to it.`);let r=this.nodes.get(L).in,v=this.nodes.get(x).in;if(n&&r&&v&&r==v)throw Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&r&&v&&r==v)throw Error(`The right-hand id [${x}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:L,lhsDir:M,lhsInto:h,lhsGroup:n,rhsId:x,rhsDir:d,rhsInto:o,rhsGroup:a,title:g};this.edges.push(i);let e=this.nodes.get(L),c=this.nodes.get(x);if(e&&c)e.edges.push(this.edges[this.edges.length-1]),c.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw Error(`An align directive requires at least two members; got ${L.members.length}`);let x=new Set;L.members.forEach((M)=>{if(this.registeredIds.get(M)!=="node")throw Error(`align ${L.direction} references [${M}], which is not a service or junction`);if(x.has(M))throw Error(`align ${L.direction} lists [${M}] more than once`);x.add(M)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let L=new Map,x=new Map;for(let[n,a]of this.nodes.entries()){let g=new Map;for(let r of a.edges){let v=this.getNode(r.lhsId)?.in,i=this.getNode(r.rhsId)?.in;if(v&&i&&v!==i){let e=ur(r.lhsDir,r.rhsDir);if(e!=="bend")L.set(qe(v,i),e)}if(r.lhsId===n){let e=be(r.lhsDir,r.rhsDir);if(e)g.set(e,r.rhsId)}else{let e=be(r.rhsDir,r.lhsDir);if(e)g.set(e,r.lhsId)}}x.set(n,g)}let M=new Set,d=new Set(x.keys()),h=t((n)=>{let a=new Map([[n,[0,0]]]),g=[n];while(g.length>0){let r=g.shift();if(r){M.add(r),d.delete(r);let v=x.get(r);if(!v)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,c]=i;v.forEach((u,f)=>{if(!M.has(u))a.set(u,cr([e,c],f)),g.push(u)})}}return a},"BFS"),o=[];while(d.size>0){let n=d.values().next().value;o.push(h(n))}this.dataStructures={adjList:x,spatialMaps:o,groupAlignments:L}}return this.dataStructures}setElementForId(L,x){this.elements.set(L,x)}getElementById(L){return this.elements.get(L)}getConfig(){return ue({...pr,...C().architecture})}getConfigField(L){return this.getConfig()[L]}},yr=t((L,x)=>{ke(L,x),L.groups.map((M)=>x.addGroup(M)),L.services.map((M)=>x.addService({...M,type:"service"})),L.junctions.map((M)=>x.addJunction({...M,type:"junction"})),L.edges.map((M)=>x.addEdge(M)),L.alignments?.map((M)=>x.addLayoutHint({direction:M.direction,members:[...M.members]}))},"populateDb"),Ke={parser:{yy:void 0},parse:t(async(L)=>{let x=await He("architecture",L);l.debug(x);let M=Ke.parser?.yy;if(!(M 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.");yr(x,M)},"parse")},mr=t((L)=>`
|
|
2
2
|
.edge {
|
|
3
3
|
stroke-width: ${L.archEdgeWidth};
|
|
4
4
|
stroke: ${L.archEdgeColor};
|
|
@@ -29,8 +29,8 @@ import{xe}from"./index-5srvxsht.js";import{t,l,Y,C,te,oa,F,z,j,U,H,W,q,m,b,Ae,rA
|
|
|
29
29
|
display: -webkit-box;
|
|
30
30
|
-webkit-box-orient: vertical;
|
|
31
31
|
}
|
|
32
|
-
`,"getStyles"),
|
|
32
|
+
`,"getStyles"),Er=mr;function Pe(L,x){if(L===0)return x();let M=Math.random,d=L>>>0;Math.random=function(){d=d+1831565813>>>0;let h=d;return h=Math.imul(h^h>>>15,h|1),h^=h+Math.imul(h^h>>>7,h|61),((h^h>>>14)>>>0)/4294967296};try{return x()}finally{Math.random=M}}t(Pe,"withSeededRandom");var pe=t((L)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${L}</g>`,"wrapIcon"),Ne={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:gA,blank:{body:pe("")}}},Tr=t(async function(L,x,M,d){let h=M.getConfigField("padding"),o=M.getConfigField("iconSize"),n=o/2,a=o/6,g=a/2;await Promise.all(x.edges().map(async(r)=>{let{source:v,sourceDir:i,sourceArrow:e,sourceGroup:c,target:u,targetDir:f,targetArrow:D,targetGroup:E,label:T}=Qe(r),{x:A,y:G}=r[0].sourceEndpoint(),{x:O,y:V}=r[0].midpoint(),{x:_,y:Q}=r[0].targetEndpoint(),lt=h+4;if(c)if(_t(i))A+=i==="L"?-lt:lt;else G+=i==="T"?-lt:lt+18;if(E)if(_t(f))_+=f==="L"?-lt:lt;else Q+=f==="T"?-lt:lt+18;if(!c&&M.getNode(v)?.type==="junction")if(_t(i))A+=i==="L"?n:-n;else G+=i==="T"?n:-n;if(!E&&M.getNode(u)?.type==="junction")if(_t(f))_+=f==="L"?n:-n;else Q+=f==="T"?n:-n;if(r[0]._private.rscratch){let S=L.insert("g");if(S.insert("path").attr("d",`M ${A},${G} L ${O},${V} L${_},${Q} `).attr("class","edge").attr("id",`${d}-${Fn(v,u,{prefix:"L"})}`),e){let tt=_t(i)?we[i](A,a):A-g,s=se(i)?we[i](G,a):G-g;S.insert("polygon").attr("points",Be[i](a)).attr("transform",`translate(${tt},${s})`).attr("class","arrow")}if(D){let tt=_t(f)?we[f](_,a):_-g,s=se(f)?we[f](Q,a):Q-g;S.insert("polygon").attr("points",Be[f](a)).attr("transform",`translate(${tt},${s})`).attr("class","arrow")}if(T){let tt=!Ge(i,f)?_t(i)?"X":"Y":"XY",s=0;if(tt==="X")s=Math.abs(A-_);else if(tt==="Y")s=Math.abs(G-Q)/1.5;else s=Math.abs(A-_)/2;let N=S.append("g");if(await yn(N,T,{useHtmlLabels:!1,width:s,classes:"architecture-service-label"},m()),N.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),tt==="X")N.attr("transform","translate("+O+", "+V+")");else if(tt==="Y")N.attr("transform","translate("+O+", "+V+") rotate(-90)");else if(tt==="XY"){let y=be(i,f);if(y&&lr(y)){let w=N.node().getBoundingClientRect(),[p,P]=gr(y);N.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*P*45})`);let R=N.node().getBoundingClientRect();N.attr("transform",`
|
|
33
33
|
translate(${O}, ${V-w.height/2})
|
|
34
34
|
translate(${p*R.width/2}, ${P*R.height/2})
|
|
35
35
|
rotate(${-1*p*P*45}, 0, ${w.height/2})
|
|
36
|
-
`)}}}}}))},"drawEdges"),Lr=t(async function(L,x,M,d){let o=M.getConfigField("padding")*0.75,n=M.getConfigField("fontSize"),g=M.getConfigField("iconSize")/2;await Promise.all(x.nodes().map(async(r)=>{let v=pe(r);if(v.type==="group"){let{h:i,w:e,x1:c,y1:u}=r.boundingBox(),f=L.append("rect");f.attr("id",`${d}-group-${v.id}`).attr("x",c+g).attr("y",u+g).attr("width",e).attr("height",i).attr("class","node-bkg");let D=L.append("g"),E=c,T=u;if(v.icon){let A=D.append("g");A.html(`<g>${await yr(v.icon,{height:o,width:o,fallbackPrefix:Te.prefix})}</g>`),A.attr("transform","translate("+(E+g+1)+", "+(T+g+1)+")"),E+=o,T+=n/2-1-2}if(v.label){let A=D.append("g");await bn(A,v.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},m()),A.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),A.attr("transform","translate("+(E+g+4)+", "+(T+g+2)+")")}M.setElementForId(v.id,f)}}))},"drawGroups"),wr=t(async function(L,x,M,d){let h=m();for(let o of M){let n=x.append("g"),a=L.getConfigField("iconSize");if(o.title){let i=n.append("g");await bn(i,o.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},h),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+a/2+", "+a+")")}let g=n.append("g");if(o.icon)g.html(`<g>${await yr(o.icon,{height:a,width:a,fallbackPrefix:Te.prefix})}</g>`);else if(o.iconText){g.html(`<g>${await yr("blank",{height:a,width:a,fallbackPrefix:Te.prefix})}</g>`);let c=g.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(te(o.iconText,h)),u=parseInt(window.getComputedStyle(c.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;c.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/u)};`)}else g.append("path").attr("class","node-bkg").attr("id",`${d}-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",`${d}-service-${o.id}`).attr("class","architecture-service");let{width:r,height:v}=n.node().getBBox();o.width=r,o.height=v,L.setElementForId(o.id,n)}return 0},"drawServices"),Mr=t(function(L,x,M,d){M.forEach((h)=>{let o=x.append("g"),n=L.getConfigField("iconSize");o.append("g").append("rect").attr("id",`${d}-node-${h.id}`).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:g,height:r}=o._groups[0][0].getBBox();o.width=g,o.height=r,L.setElementForId(h.id,o)})},"drawJunctions");is([{name:Te.prefix,icons:Te}]);ra.use(Ke.default);function _e(L,x,M){L.forEach((d)=>{x.add({group:"nodes",data:{type:"service",id:d.id,icon:d.icon,label:d.title,parent:d.in,width:M.getConfigField("iconSize"),height:M.getConfigField("iconSize")},classes:"node-service"})})}t(_e,"addServices");function tr(L,x,M){L.forEach((d)=>{x.add({group:"nodes",data:{type:"junction",id:d.id,parent:d.in,width:M.getConfigField("iconSize"),height:M.getConfigField("iconSize")},classes:"node-junction"})})}t(tr,"addJunctions");function er(L,x){x.nodes().map((M)=>{let d=pe(M);if(d.type==="group")return;d.x=M.position().x,d.y=M.position().y,L.getElementById(d.id).attr("transform","translate("+(d.x||0)+","+(d.y||0)+")")})}t(er,"positionNodes");function rr(L,x){L.forEach((M)=>{x.add({group:"nodes",data:{type:"group",id:M.id,icon:M.icon,label:M.title,parent:M.in},classes:"node-group"})})}t(rr,"addGroups");function ir(L,x){L.forEach((M)=>{let{lhsId:d,rhsId:h,lhsInto:o,lhsGroup:n,rhsInto:a,lhsDir:g,rhsDir:r,rhsGroup:v,title:i}=M,e=Ue(M.lhsDir,M.rhsDir)?"segments":"straight",c={id:`${d}-${h}`,label:i,source:d,sourceDir:g,sourceArrow:o,sourceGroup:n,sourceEndpoint:g==="L"?"0 50%":g==="R"?"100% 50%":g==="T"?"50% 0":"50% 100%",target:h,targetDir:r,targetArrow:a,targetGroup:v,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};x.add({group:"edges",data:c,classes:e})})}t(ir,"addEdges");function nr(L,x,M,d=[]){let h=t((e,c)=>{let u=new Map;for(let[f,D]of e.entries()){let E=`${f}`,T=0,A=[...D.entries()];if(A.length===1){u.set(E,A[0][1]);continue}for(let G=0;G<A.length-1;G++)for(let O=G+1;O<A.length;O++){let[V,_]=A[G],[Q,lt]=A[O];if(M.get(ke(V,Q))===c)u.set(E,[...u.get(E)??[],..._,...lt]);else if(V==="default"||Q==="default")u.set(E,[...u.get(E)??[],..._,...lt]);else{let tt=`${E}-${T++}`;u.set(tt,_);let s=`${E}-${T++}`;u.set(s,lt)}}}return u},"flattenAlignments"),o=x.map((e)=>{let c=new Map,u=new Map;return e.forEach(([f,D],E)=>{let T=L.getNode(E)?.in??"default",A=c.get(D)??new Map;if(!c.has(D))c.set(D,A);let G=u.get(f)??new Map;if(!u.has(f))u.set(f,G);for(let O of[A,G]){let V=O.get(T)??[];if(!O.has(T))O.set(T,V);V.push(E)}}),{horiz:[...h(c,"horizontal").values()].filter((f)=>f.length>1),vert:[...h(u,"vertical").values()].filter((f)=>f.length>1)}}),[n,a]=o.reduce(([e,c],{horiz:u,vert:f})=>[[...e,...u],[...c,...f]],[[],[]]),g=new Set;d.forEach((e)=>e.members.forEach((c)=>g.add(c)));let r=t((e)=>e.filter((c)=>!c.some((u)=>g.has(u))),"dropOverlapping"),v=r(n),i=r(a);return d.forEach((e)=>{if(e.members.length<2)return;if(e.direction==="row")v.push([...e.members]);else i.push([...e.members])}),{horizontal:v,vertical:i}}t(nr,"getAlignments");function ar(L,x,M=[]){let d=[],h=x.getConfigField("iconSize"),o=x.getConfigField("idealEdgeLengthMultiplier"),n=o*h,a=new Set;M.forEach((v)=>{for(let i=0;i<v.members.length-1;i++){let e=v.members[i],c=v.members[i+1];if(a.add(`${e}|${c}`),a.add(`${c}|${e}`),v.direction==="row")d.push({left:e,right:c,gap:n});else d.push({top:e,bottom:c,gap:n})}});let g=t((v)=>`${v[0]},${v[1]}`,"posToStr"),r=t((v)=>v.split(",").map((i)=>parseInt(i)),"strToPos");return L.forEach((v)=>{let i=new Map([...v.entries()].map(([f,D])=>[g(D),f])),e=[g([0,0])],c={},u={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(e.length>0){let f=e.shift();if(f){c[f]=1;let D=i.get(f);if(D){let E=r(f);Object.entries(u).forEach(([T,A])=>{let G=g([E[0]+A[0],E[1]+A[1]]),O=i.get(G);if(O&&!c[G]){if(e.push(G),a.has(`${D}|${O}`))return;d.push({[$e[T]]:O,[$e[hr(T)]]:D,gap:o*h})}})}}}}),d}t(ar,"getRelativeConstraints");function or(L,x,M,d,h,{spatialMaps:o,groupAlignments:n}){return new Promise((a)=>{let g=b("body").append("div").attr("id","cy").attr("style","display:none"),r=ra({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":`${h.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:`${h.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});g.remove(),rr(M,r),_e(L,r,h),tr(x,r,h),ir(d,r);let v=h.getLayoutHints(),i=nr(h,o,n,v),e=ar(o,h,v),c=h.getConfigField("iconSize"),u=h.getConfigField("idealEdgeLengthMultiplier")*c,f=0.5*c,D=h.getConfigField("edgeElasticity"),E=h.getConfigField("seed"),T=r.layout({name:"fcose",quality:"proof",randomize:h.getConfigField("randomize"),nodeSeparation:h.getConfigField("nodeSeparation"),numIter:h.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(A){let[G,O]=A.connectedNodes(),{parent:V}=pe(G),{parent:_}=pe(O);return V===_?u:f},edgeElasticity(A){let[G,O]=A.connectedNodes(),{parent:V}=pe(G),{parent:_}=pe(O);return V===_?D:0.001},alignmentConstraint:i,relativePlacementConstraint:e});T.one("layoutstop",()=>{function A(G,O,V,_){let Q,lt,{x:S,y:tt}=G,{x:s,y:N}=O;lt=(_-tt+(S-V)*(tt-N)/(S-s))/Math.sqrt(1+Math.pow((tt-N)/(S-s),2)),Q=Math.sqrt(Math.pow(_-tt,2)+Math.pow(V-S,2)-Math.pow(lt,2));let y=Math.sqrt(Math.pow(s-S,2)+Math.pow(N-tt,2));Q=Q/y;let w=(s-S)*(_-tt)-(N-tt)*(V-S);switch(!0){case w>=0:w=1;break;case w<0:w=-1;break}let p=(s-S)*(V-S)+(N-tt)*(_-tt);switch(!0){case p>=0:p=1;break;case p<0:p=-1;break}return lt=Math.abs(lt)*w,Q=Q*p,{distances:lt,weights:Q}}t(A,"getSegmentWeights"),r.startBatch();for(let G of Object.values(r.edges()))if(G.data?.()){let{x:O,y:V}=G.source().position(),{x:_,y:Q}=G.target().position();if(O!==_&&V!==Q){let lt=G.sourceEndpoint(),S=G.targetEndpoint(),{sourceDir:tt}=qe(G),[s,N]=se(tt)?[lt.x,S.y]:[S.x,lt.y],{weights:y,distances:w}=A(lt,S,s,N);G.style("segment-distances",w),G.style("segment-weights",y)}}r.endBatch(),Ge(E,()=>T.run())});try{Ge(E,()=>T.run())}catch(A){if(A instanceof RangeError&&A.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 A}r.ready((A)=>{l.info("Ready",A),a(r)})})}t(or,"layoutArchitecture");var Cr=t(async(L,x,M,d)=>{let h=d.db;h.setDiagramId(x);let o=h.getServices(),n=h.getJunctions(),a=h.getGroups(),g=h.getEdges(),r=h.getDataStructures(),v=Ae(x),i=v.append("g");i.attr("class","architecture-edges");let e=v.append("g");e.attr("class","architecture-services");let c=v.append("g");c.attr("class","architecture-groups"),await wr(h,e,o,x),Mr(h,e,n,x);let u=await or(o,n,a,g,h,r);await Nr(i,u,h,x),await Lr(c,u,h,x),er(h,u),oa(void 0,v,h.getConfigField("padding"),h.getConfigField("useMaxWidth"))},"draw"),Ar={draw:Cr},Yr={parser:Je,get db(){return new Qe},renderer:Ar,styles:Tr};export{Yr as diagram};
|
|
36
|
+
`)}}}}}))},"drawEdges"),Nr=t(async function(L,x,M,d){let o=M.getConfigField("padding")*0.75,n=M.getConfigField("fontSize"),g=M.getConfigField("iconSize")/2;await Promise.all(x.nodes().map(async(r)=>{let v=ye(r);if(v.type==="group"){let{h:i,w:e,x1:c,y1:u}=r.boundingBox(),f=L.append("rect");f.attr("id",`${d}-group-${v.id}`).attr("x",c+g).attr("y",u+g).attr("width",e).attr("height",i).attr("class","node-bkg");let D=L.append("g"),E=c,T=u;if(v.icon){let A=D.append("g");A.html(`<g>${await xr(v.icon,{height:o,width:o,fallbackPrefix:Ne.prefix})}</g>`),A.attr("transform","translate("+(E+g+1)+", "+(T+g+1)+")"),E+=o,T+=n/2-1-2}if(v.label){let A=D.append("g");await yn(A,v.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},m()),A.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),A.attr("transform","translate("+(E+g+4)+", "+(T+g+2)+")")}M.setElementForId(v.id,f)}}))},"drawGroups"),Lr=t(async function(L,x,M,d){let h=m();for(let o of M){let n=x.append("g"),a=L.getConfigField("iconSize");if(o.title){let i=n.append("g");await yn(i,o.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},h),i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),i.attr("transform","translate("+a/2+", "+a+")")}let g=n.append("g");if(o.icon)g.html(`<g>${await xr(o.icon,{height:a,width:a,fallbackPrefix:Ne.prefix})}</g>`);else if(o.iconText){g.html(`<g>${await xr("blank",{height:a,width:a,fallbackPrefix:Ne.prefix})}</g>`);let c=g.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(te(o.iconText,h)),u=parseInt(window.getComputedStyle(c.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;c.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/u)};`)}else g.append("path").attr("class","node-bkg").attr("id",`${d}-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",`${d}-service-${o.id}`).attr("class","architecture-service");let{width:r,height:v}=n.node().getBBox();o.width=r,o.height=v,L.setElementForId(o.id,n)}return 0},"drawServices"),wr=t(function(L,x,M,d){M.forEach((h)=>{let o=x.append("g"),n=L.getConfigField("iconSize");o.append("g").append("rect").attr("id",`${d}-node-${h.id}`).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:g,height:r}=o._groups[0][0].getBBox();o.width=g,o.height=r,L.setElementForId(h.id,o)})},"drawJunctions");fs([{name:Ne.prefix,icons:Ne}]);oa.use(je.default);function _e(L,x,M){L.forEach((d)=>{x.add({group:"nodes",data:{type:"service",id:d.id,icon:d.icon,label:d.title,parent:d.in,width:M.getConfigField("iconSize"),height:M.getConfigField("iconSize")},classes:"node-service"})})}t(_e,"addServices");function tr(L,x,M){L.forEach((d)=>{x.add({group:"nodes",data:{type:"junction",id:d.id,parent:d.in,width:M.getConfigField("iconSize"),height:M.getConfigField("iconSize")},classes:"node-junction"})})}t(tr,"addJunctions");function er(L,x){x.nodes().map((M)=>{let d=ye(M);if(d.type==="group")return;d.x=M.position().x,d.y=M.position().y,L.getElementById(d.id).attr("transform","translate("+(d.x||0)+","+(d.y||0)+")")})}t(er,"positionNodes");function rr(L,x){L.forEach((M)=>{x.add({group:"nodes",data:{type:"group",id:M.id,icon:M.icon,label:M.title,parent:M.in},classes:"node-group"})})}t(rr,"addGroups");function ir(L,x){L.forEach((M)=>{let{lhsId:d,rhsId:h,lhsInto:o,lhsGroup:n,rhsInto:a,lhsDir:g,rhsDir:r,rhsGroup:v,title:i}=M,e=Ge(M.lhsDir,M.rhsDir)?"segments":"straight",c={id:`${d}-${h}`,label:i,source:d,sourceDir:g,sourceArrow:o,sourceGroup:n,sourceEndpoint:g==="L"?"0 50%":g==="R"?"100% 50%":g==="T"?"50% 0":"50% 100%",target:h,targetDir:r,targetArrow:a,targetGroup:v,targetEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%"};x.add({group:"edges",data:c,classes:e})})}t(ir,"addEdges");function nr(L,x,M,d=[]){let h=t((e,c)=>{let u=new Map;for(let[f,D]of e.entries()){let E=`${f}`,T=0,A=[...D.entries()];if(A.length===1){u.set(E,A[0][1]);continue}for(let G=0;G<A.length-1;G++)for(let O=G+1;O<A.length;O++){let[V,_]=A[G],[Q,lt]=A[O];if(M.get(qe(V,Q))===c)u.set(E,[...u.get(E)??[],..._,...lt]);else if(V==="default"||Q==="default")u.set(E,[...u.get(E)??[],..._,...lt]);else{let tt=`${E}-${T++}`;u.set(tt,_);let s=`${E}-${T++}`;u.set(s,lt)}}}return u},"flattenAlignments"),o=x.map((e)=>{let c=new Map,u=new Map;return e.forEach(([f,D],E)=>{let T=L.getNode(E)?.in??"default",A=c.get(D)??new Map;if(!c.has(D))c.set(D,A);let G=u.get(f)??new Map;if(!u.has(f))u.set(f,G);for(let O of[A,G]){let V=O.get(T)??[];if(!O.has(T))O.set(T,V);V.push(E)}}),{horiz:[...h(c,"horizontal").values()].filter((f)=>f.length>1),vert:[...h(u,"vertical").values()].filter((f)=>f.length>1)}}),[n,a]=o.reduce(([e,c],{horiz:u,vert:f})=>[[...e,...u],[...c,...f]],[[],[]]),g=new Set;d.forEach((e)=>e.members.forEach((c)=>g.add(c)));let r=t((e)=>e.filter((c)=>!c.some((u)=>g.has(u))),"dropOverlapping"),v=r(n),i=r(a);return d.forEach((e)=>{if(e.members.length<2)return;if(e.direction==="row")v.push([...e.members]);else i.push([...e.members])}),{horizontal:v,vertical:i}}t(nr,"getAlignments");function ar(L,x,M=[]){let d=[],h=x.getConfigField("iconSize"),o=x.getConfigField("idealEdgeLengthMultiplier"),n=o*h,a=new Set;M.forEach((v)=>{for(let i=0;i<v.members.length-1;i++){let e=v.members[i],c=v.members[i+1];if(a.add(`${e}|${c}`),a.add(`${c}|${e}`),v.direction==="row")d.push({left:e,right:c,gap:n});else d.push({top:e,bottom:c,gap:n})}});let g=t((v)=>`${v[0]},${v[1]}`,"posToStr"),r=t((v)=>v.split(",").map((i)=>parseInt(i)),"strToPos");return L.forEach((v)=>{let i=new Map([...v.entries()].map(([f,D])=>[g(D),f])),e=[g([0,0])],c={},u={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(e.length>0){let f=e.shift();if(f){c[f]=1;let D=i.get(f);if(D){let E=r(f);Object.entries(u).forEach(([T,A])=>{let G=g([E[0]+A[0],E[1]+A[1]]),O=i.get(G);if(O&&!c[G]){if(e.push(G),a.has(`${D}|${O}`))return;d.push({[$e[T]]:O,[$e[hr(T)]]:D,gap:o*h})}})}}}}),d}t(ar,"getRelativeConstraints");function or(L,x,M,d,h,{spatialMaps:o,groupAlignments:n}){return new Promise((a)=>{let g=b("body").append("div").attr("id","cy").attr("style","display:none"),r=oa({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":`${h.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:`${h.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});g.remove(),rr(M,r),_e(L,r,h),tr(x,r,h),ir(d,r);let v=h.getLayoutHints(),i=nr(h,o,n,v),e=ar(o,h,v),c=h.getConfigField("iconSize"),u=h.getConfigField("idealEdgeLengthMultiplier")*c,f=0.5*c,D=h.getConfigField("edgeElasticity"),E=h.getConfigField("seed"),T=r.layout({name:"fcose",quality:"proof",randomize:h.getConfigField("randomize"),nodeSeparation:h.getConfigField("nodeSeparation"),numIter:h.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(A){let[G,O]=A.connectedNodes(),{parent:V}=ye(G),{parent:_}=ye(O);return V===_?u:f},edgeElasticity(A){let[G,O]=A.connectedNodes(),{parent:V}=ye(G),{parent:_}=ye(O);return V===_?D:0.001},alignmentConstraint:i,relativePlacementConstraint:e});T.one("layoutstop",()=>{function A(G,O,V,_){let Q,lt,{x:S,y:tt}=G,{x:s,y:N}=O;lt=(_-tt+(S-V)*(tt-N)/(S-s))/Math.sqrt(1+Math.pow((tt-N)/(S-s),2)),Q=Math.sqrt(Math.pow(_-tt,2)+Math.pow(V-S,2)-Math.pow(lt,2));let y=Math.sqrt(Math.pow(s-S,2)+Math.pow(N-tt,2));Q=Q/y;let w=(s-S)*(_-tt)-(N-tt)*(V-S);switch(!0){case w>=0:w=1;break;case w<0:w=-1;break}let p=(s-S)*(V-S)+(N-tt)*(_-tt);switch(!0){case p>=0:p=1;break;case p<0:p=-1;break}return lt=Math.abs(lt)*w,Q=Q*p,{distances:lt,weights:Q}}t(A,"getSegmentWeights"),r.startBatch();for(let G of Object.values(r.edges()))if(G.data?.()){let{x:O,y:V}=G.source().position(),{x:_,y:Q}=G.target().position();if(O!==_&&V!==Q){let lt=G.sourceEndpoint(),S=G.targetEndpoint(),{sourceDir:tt}=Qe(G),[s,N]=se(tt)?[lt.x,S.y]:[S.x,lt.y],{weights:y,distances:w}=A(lt,S,s,N);G.style("segment-distances",w),G.style("segment-weights",y)}}r.endBatch(),Pe(E,()=>T.run())});try{Pe(E,()=>T.run())}catch(A){if(A instanceof RangeError&&A.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 A}r.ready((A)=>{l.info("Ready",A),a(r)})})}t(or,"layoutArchitecture");var Mr=t(async(L,x,M,d)=>{let h=d.db;h.setDiagramId(x);let o=h.getServices(),n=h.getJunctions(),a=h.getGroups(),g=h.getEdges(),r=h.getDataStructures(),v=he(x),i=v.append("g");i.attr("class","architecture-edges");let e=v.append("g");e.attr("class","architecture-services");let c=v.append("g");c.attr("class","architecture-groups"),await Lr(h,e,o,x),wr(h,e,n,x);let u=await or(o,n,a,g,h,r);await Tr(i,u,h,x),await Nr(c,u,h,x),er(h,u),sa(void 0,v,h.getConfigField("padding"),h.getConfigField("useMaxWidth"))},"draw"),Cr={draw:Mr},Yr={parser:Ke,get db(){return new Je},renderer:Cr,styles:Er};export{Yr as diagram};
|