@kabmo-labs/kabmo 0.60.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-p82s28sj.js → Body-z6kstvk6.js} +3 -3
- package/dist/client/static/js/{CsvGrid-erc5mcvc.js → CsvGrid-f73c0s4e.js} +2 -2
- package/dist/client/static/js/{DocxView-x3faj0jv.js → DocxView-a1pb7nsb.js} +3 -3
- package/dist/client/static/js/{DrawioView-t7fh3ens.js → DrawioView-r61gcg24.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-zy7x7jmm.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-kqx472q7.js → PdfView-mppt2gkd.js} +1 -1
- package/dist/client/static/js/SessionsView-vvsaw9f0.js +1 -0
- package/dist/client/static/js/{SheetView-0n9fze50.js → SheetView-5s9zfx9g.js} +9 -9
- package/dist/client/static/js/{SvgPreview-6xc6ts46.js → SvgPreview-ff78xn3e.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-2xdkkqwg.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-ja8cx19z.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-ytf7s99c.js → blockDiagram-BEXU5L5S-t8xbexa6.js} +6 -6
- package/dist/client/static/js/c-vvantfth.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-5a0kdx0z.js → c4Diagram-YGBWAQC7-9fwf2zxk.js} +3 -3
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-hd98dvjw.js → classDiagram-v2-NBCMYWYE-nbapgqbs.js} +4 -4
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-man3fqcj.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-2f0kbbv2.js → cynefinDiagram-VND7K2PF-qdg32wah.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-k7pyhgzn.js → dagre-6A5THRUB-qzshg1vs.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-qx0afa2m.js → diagram-22UHCM2B-197hemfa.js} +11 -11
- package/dist/client/static/js/{diagram-3UASUU5V-ydpe77sv.js → diagram-3UASUU5V-236gnjr6.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-e63v984n.js → diagram-ATOU4E4O-vjgpyaaq.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-8c765h3a.js → diagram-CDSNMT55-ywvzcx7z.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-3pq0n7v8.js → diagram-MLGK6HIB-9ey7ev7j.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-638atzxz.js → diagram-MPIPVDR6-vrqbb6r7.js} +2 -2
- package/dist/client/static/js/{dockerfile-yehc914q.js → dockerfile-4nked309.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-3gv43zvm.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-6s5pggfc.js → elk-276RUBZZ-nej6yy1c.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-x7cqyb89.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-g97te4v1.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-sw4f94tc.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-vejz38qt.js → index-0w1jzang.js} +5 -5
- package/dist/client/static/js/{index-bpcg34jp.js → index-1svt0cdw.js} +2 -2
- package/dist/client/static/js/{index-hgfyx8dt.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-pdz6j2g2.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-111bq6rs.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-hwdkxe4n.js → index-dxyjxhm1.js} +2 -2
- package/dist/client/static/js/{index-43gmn7yb.js → index-edpyqz9f.js} +1 -1
- package/dist/client/static/js/{index-pdgc9ccr.js → index-eesepb70.js} +2 -2
- package/dist/client/static/js/{index-vec7m1yd.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-vcq6zfxx.js → index-jcbp1d9d.js} +6 -6
- package/dist/client/static/js/index-jg5h18sm.js +2 -0
- package/dist/client/static/js/{index-6qn9kygb.js → index-jtdve6xw.js} +7 -7
- package/dist/client/static/js/{index-4xbc0j7t.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-2n2evsg0.js → index-kv1xnem9.js} +2 -2
- package/dist/client/static/js/{index-8zct30zd.js → index-m54ctmxr.js} +1 -1
- package/dist/client/static/js/index-mgzbypt5.js +314 -0
- package/dist/client/static/js/{index-cf69bhjx.js → index-mh52531j.js} +2 -2
- package/dist/client/static/js/{index-0ze5bwvw.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-9rz6kzsv.js → index-nxd6z7f9.js} +2 -2
- package/dist/client/static/js/{index-jfqd838j.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-cfvc1zpk.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-37apvxgj.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-z8k42dwz.js → index-w0j96eyy.js} +8 -8
- package/dist/client/static/js/{index-qkqkygrf.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-dv01prse.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-ywp0sd1e.js → index-zy963qbh.js} +1 -1
- package/dist/client/static/js/info-A6RAGUB7-t7pbg7rt.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-pw2qaa27.js → infoDiagram-VRGFBTTK-9pe7w3r5.js} +2 -2
- package/dist/client/static/js/ini-522adp5a.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-d13jhvxy.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-20gb8a04.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-s78e158c.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-xbm27k28.js → mermaid.core-3aae27b9.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-6y7xe2zm.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-dmvewetf.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-1q9e7rcm.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-mvrem3n6.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-axttcfhw.js → railroadDiagram-XR7U4H2S-70qy7qdh.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-5qx7erta.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-b3ckax3e.js → rust-6sddyxnt.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-es87a3j6.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-dgpnjrtk.js → sequenceDiagram-PO4LG4MO-w7z84f80.js} +7 -7
- package/dist/client/static/js/{sizeCapture-INFHLROL-kyw0p86n.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-vnsbw8y9.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-060q1rep.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-18sp73v7.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-q0kwmbzh.js → wardleyDiagram-VNRHLVJA-hjddd656.js} +3 -3
- package/dist/client/static/js/xml-59n0cjn6.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-y0gpmg6m.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 -37
- package/src/client/components/workspace/panel-tabs/TabStrip.connected.test.tsx +76 -49
- 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-xc90jc1c.js +0 -1
- package/dist/client/static/js/LayoutWrapper-wyqe98kf.js +0 -2
- package/dist/client/static/js/MergeDiffView-bng34cpr.js +0 -1
- package/dist/client/static/js/Modal-89jk7wff.js +0 -60
- package/dist/client/static/js/SessionsView-6bpz1faj.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-7sn6nwjv.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-4h2zkrk1.js +0 -2
- package/dist/client/static/js/index-5nm8hm4k.js +0 -2
- package/dist/client/static/js/index-95jfphx5.js +0 -481
- package/dist/client/static/js/index-9pw441wc.js +0 -4
- package/dist/client/static/js/index-bjz54ht6.js +0 -1
- package/dist/client/static/js/index-bqapt2e8.js +0 -2
- package/dist/client/static/js/index-ddkjgv5h.js +0 -2
- package/dist/client/static/js/index-dekvtt2a.js +0 -314
- package/dist/client/static/js/index-fnwaxc6r.js +0 -1
- package/dist/client/static/js/index-h65zrhva.js +0 -1
- package/dist/client/static/js/index-hxsqw7sz.js +0 -4
- package/dist/client/static/js/index-hxy1sadd.js +0 -2
- package/dist/client/static/js/index-ja0ajnvq.js +0 -10
- package/dist/client/static/js/index-qkyy563e.js +0 -1
- package/dist/client/static/js/index-t6nqy2n5.css +0 -1
- package/dist/client/static/js/index-wrk99kks.js +0 -3
- 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-7bgqnyhm.js +0 -1
- package/dist/client/static/js/one-light-47y6etng.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-y77g9dq0.js +0 -8
- package/dist/client/static/js/timeline-definition-EJHVYXUP-8a3yqmx0.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-gf4y1r3s.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{t,l,m,K,_a,Nh,la,Fo,Ta,gl,Po}from"./index-dekvtt2a.js";import{Jt,Rn,fr,un,ea,Io,we,Rt,Nr,_o,Qr,lc,Hp,qp,Wp,Ki,wa,Kp,Vi,Ln,Yi,no,Ca,Ji,So,Zi,Vp,Yp,cc,Zt,Jp,Xi,To,es,uc,dc,Do,Zp,pc,Xp,hd,ta,mc,em,tm,nm,nr,fc,gc,ts,rm,Ac,v,gr,na,Xt,No,et}from"./index-hxy1sadd.js";import{zp,Up,ve,cl,vh,Gp,gi}from"./index-cf69bhjx.js";import{Sn}from"./index-v88m5sva.js";var ur={};Sn(ur,{default:()=>Z});var xn=/\s/;function On(r){var e=r.length;while(e--&&xn.test(r.charAt(e)));return e}var Wr=On;var In=/^\s+/;function Nn(r){return r?r.slice(0,Wr(r)+1).replace(In,""):r}var qr=Nn;var Hr=NaN,Pn=/^[-+]0x[0-9a-f]+$/i,kn=/^0b[01]+$/i,Tn=/^0o[0-7]+$/i,Cn=parseInt;function An(r){if(typeof r=="number")return r;if(ea(r))return Hr;if(Rt(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Rt(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=qr(r);var n=kn.test(r);return n||Tn.test(r)?Cn(r.slice(2),n?2:8):Pn.test(r)?Hr:+r}var Kr=An;var Jr=1/0,Mn=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function jn(r){if(!r)return r===0?r:0;if(r=Kr(r),r===Jr||r===-Jr){var e=r<0?-1:1;return e*Mn}return r===r?r:0}var U=jn;function Bn(r){var e=U(r),n=e%1;return e===e?n?e-n:e:0}var Zr=Bn;var $r=Object.create,Dn=function(){function r(){}return function(e){if(!Rt(e))return{};if($r)return $r(e);r.prototype=e;var n=new r;return r.prototype=void 0,n}}(),re=Dn;function Fn(r,e){var n=-1,o=r.length;e||(e=Array(o));while(++n<o)e[n]=r[n];return e}var ar=Fn;function Gn(r,e,n){if(e=="__proto__"&&lc)lc(r,e,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[e]=n}var R=Gn;var Xn=Object.prototype,Un=Xn.hasOwnProperty;function Vn(r,e,n){var o=r[e];if(!(Un.call(r,e)&&wa(o,n))||n===void 0&&!(e in r))R(r,e,n)}var M=Vn;function Yn(r,e,n,o){var i=!n;n||(n={});var a=-1,f=e.length;while(++a<f){var s=e[a],u=o?o(n[s],r[s],s,n,r):void 0;if(u===void 0)u=r[s];if(i)R(n,s,u);else M(n,s,u)}return n}var P=Yn;function zn(r,e,n){if(!Rt(n))return!1;var o=typeof e;if(o=="number"?Ln(n)&&Ki(e,n.length):o=="string"&&(e in n))return wa(n[e],r);return!1}var T=zn;function Wn(r){return Vi(function(e,n){var o=-1,i=n.length,a=i>1?n[i-1]:void 0,f=i>2?n[2]:void 0;if(a=r.length>3&&typeof a=="function"?(i--,a):void 0,f&&T(n[0],n[1],f))a=i<3?void 0:a,i=1;e=Object(e);while(++o<i){var s=n[o];if(s)r(e,s,o,a)}return e})}var ee=Wn;function qn(r){var e=[];if(r!=null)for(var n in Object(r))e.push(n);return e}var te=qn;var Hn=Object.prototype,Kn=Hn.hasOwnProperty;function Jn(r){if(!Rt(r))return te(r);var e=Yi(r),n=[];for(var o in r)if(!(o=="constructor"&&(e||!Kn.call(r,o))))n.push(o);return n}var ne=Jn;function Zn(r){return Ln(r)?Vp(r,!0):ne(r)}var L=Zn;function $n(r){var e=r==null?0:r.length;return e?dc(r,1):[]}var S=$n;function Qn(r){return Hp(Kp(r,void 0,S),r+"")}var oe=Qn;var ro=Yp(Object.getPrototypeOf,Object),V=ro;var eo="[object Object]",to=Function.prototype,oo=Object.prototype,ie=to.toString,io=oo.hasOwnProperty,ao=ie.call(Object);function fo(r){if(!un(r)||fr(r)!=eo)return!1;var e=V(r);if(e===null)return!0;var n=io.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ie.call(n)==ao}var ae=fo;var so="\\ud800-\\udfff",uo="\\u0300-\\u036f",co="\\ufe20-\\ufe2f",po="\\u20d0-\\u20ff",lo=uo+co+po,mo="\\ufe0e\\ufe0f",ho="\\u200d",go=RegExp("["+ho+so+lo+mo+"]");function vo(r){return go.test(r)}var fe=vo;function bo(r,e){return r&&P(e,Zt(e),r)}var se=bo;function yo(r,e){return r&&P(e,L(e),r)}var ue=yo;var le=typeof ur=="object"&&ur&&!ur.nodeType&&ur,de=le&&typeof sr=="object"&&sr&&!sr.nodeType&&sr,wo=de&&de.exports===le,ce=wo?Jt.Buffer:void 0,pe=ce?ce.allocUnsafe:void 0;function Eo(r,e){if(e)return r.slice();var n=r.length,o=pe?pe(n):new r.constructor(n);return r.copy(o),o}var Z=Eo;function xo(r,e){return P(r,pc(r),e)}var me=xo;var Oo=Object.getOwnPropertySymbols,Lo=!Oo?Zp:function(r){var e=[];while(r)uc(e,pc(r)),r=V(r);return e},dr=Lo;function ko(r,e){return P(r,dr(r),e)}var he=ko;function Co(r){return Xp(r,L,dr)}var ge=Co;var Ao=Object.prototype,Ro=Ao.hasOwnProperty;function Mo(r){var e=r.length,n=new r.constructor(e);if(e&&typeof r[0]=="string"&&Ro.call(r,"index"))n.index=r.index,n.input=r.input;return n}var be=Mo;function jo(r){var e=new r.constructor(r.byteLength);return new mc(e).set(new mc(r)),e}var Y=jo;function Bo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var ye=Bo;var Go=/\w*$/;function Xo(r){var e=new r.constructor(r.source,Go.exec(r));return e.lastIndex=r.lastIndex,e}var _e=Xo;var Ee=Rn?Rn.prototype:void 0,xe=Ee?Ee.valueOf:void 0;function Uo(r){return xe?Object(xe.call(r)):{}}var Oe=Uo;function Vo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var cr=Vo;var Yo="[object Boolean]",zo="[object Date]",Wo="[object Map]",qo="[object Number]",Ho="[object RegExp]",Ko="[object Set]",Jo="[object String]",Zo="[object Symbol]",$o="[object ArrayBuffer]",Qo="[object DataView]",ri="[object Float32Array]",ei="[object Float64Array]",ti="[object Int8Array]",ni="[object Int16Array]",oi="[object Int32Array]",ii="[object Uint8Array]",ai="[object Uint8ClampedArray]",fi="[object Uint16Array]",si="[object Uint32Array]";function ui(r,e,n){var o=r.constructor;switch(e){case $o:return Y(r);case Yo:case zo:return new o(+r);case Qo:return ye(r,n);case ri:case ei:case ti:case ni:case oi:case ii:case ai:case fi:case si:return cr(r,n);case Wo:return new o;case qo:case Jo:return new o(r);case Ho:return _e(r);case Ko:return new o;case Zo:return Oe(r)}}var Le=ui;function di(r){return typeof r.constructor=="function"&&!Yi(r)?re(V(r)):{}}var pr=di;var ci="[object Map]";function pi(r){return un(r)&&ta(r)==ci}var Ie=pi;var Se=So&&So.isMap,li=Se?Ji(Se):Ie,Ne=li;var mi="[object Set]";function hi(r){return un(r)&&ta(r)==mi}var Pe=hi;var ke=So&&So.isSet,vi=ke?Ji(ke):Pe,Te=vi;var bi=1,yi=2,wi=4,Ce="[object Arguments]",_i="[object Array]",Ei="[object Boolean]",xi="[object Date]",Oi="[object Error]",Ae="[object Function]",Li="[object GeneratorFunction]",Ii="[object Map]",Si="[object Number]",Re="[object Object]",Ni="[object RegExp]",Pi="[object Set]",ki="[object String]",Ti="[object Symbol]",Ci="[object WeakMap]",Ai="[object ArrayBuffer]",Ri="[object DataView]",Mi="[object Float32Array]",ji="[object Float64Array]",Bi="[object Int8Array]",Di="[object Int16Array]",Fi="[object Int32Array]",Gi="[object Uint8Array]",Ui="[object Uint8ClampedArray]",zi="[object Uint16Array]",Wi="[object Uint32Array]",x={};x[Ce]=x[_i]=x[Ai]=x[Ri]=x[Ei]=x[xi]=x[Mi]=x[ji]=x[Bi]=x[Di]=x[Fi]=x[Ii]=x[Si]=x[Re]=x[Ni]=x[Pi]=x[ki]=x[Ti]=x[Gi]=x[Ui]=x[zi]=x[Wi]=!0;x[Oi]=x[Ae]=x[Ci]=!1;function lr(r,e,n,o,i,a){var f,s=e&bi,u=e&yi,d=e&wi;if(n)f=i?n(r,o,i,a):n(r);if(f!==void 0)return f;if(!Rt(r))return r;var c=we(r);if(c){if(f=be(r),!s)return ar(r,f)}else{var p=ta(r),h=p==Ae||p==Li;if(Ca(r))return Z(r,s);if(p==Re||p==Ce||h&&!i){if(f=u||h?{}:pr(r),!s)return u?he(r,ue(f,r)):me(r,se(f,r))}else{if(!x[p])return i?r:{};f=Le(r,p,s)}}a||(a=new Do);var b=a.get(r);if(b)return b;if(a.set(r,f),Te(r))r.forEach(function(g){f.add(lr(g,e,n,g,r,a))});else if(Ne(r))r.forEach(function(g,_){f.set(_,lr(g,e,n,_,r,a))});var w=d?u?ge:hd:u?L:Zt,y=c?void 0:w(r);return qp(y||r,function(g,_){if(y)_=g,g=r[_];M(f,_,lr(g,e,n,_,r,a))}),f}var Me=lr;var qi=1,Hi=4;function $i(r){return Me(r,qi|Hi)}var je=$i;var Qi=function(){return Jt.Date.now()},_r=Qi;var Be=Object.prototype,ra=Be.hasOwnProperty,oa=Vi(function(r,e){r=Object(r);var n=-1,o=e.length,i=o>2?e[2]:void 0;if(i&&T(e[0],e[1],i))o=1;while(++n<o){var a=e[n],f=L(a),s=-1,u=f.length;while(++s<u){var d=f[s],c=r[d];if(c===void 0||wa(c,Be[d])&&!ra.call(r,d))r[d]=a[d]}}return r}),De=oa;function ia(r,e,n){if(n!==void 0&&!wa(r[e],n)||n===void 0&&!(e in r))R(r,e,n)}var Q=ia;function aa(r,e){if(e==="constructor"&&typeof r[e]==="function")return;if(e=="__proto__")return;return r[e]}var rr=aa;function fa(r){return P(r,L(r))}var Fe=fa;function sa(r,e,n,o,i,a,f){var s=rr(r,n),u=rr(e,n),d=f.get(u);if(d){Q(r,n,d);return}var c=a?a(s,u,n+"",r,e,f):void 0,p=c===void 0;if(p){var h=we(u),b=!h&&Ca(u),w=!h&&!b&&Zi(u);if(c=u,h||b||w)if(we(s))c=s;else if(rm(s))c=ar(s);else if(b)p=!1,c=Z(u,!0);else if(w)p=!1,c=cr(u,!0);else c=[];else if(ae(u)||no(u)){if(c=s,no(s))c=Fe(s);else if(!Rt(s)||_o(s))c=pr(u)}else p=!1}if(p)f.set(u,c),i(c,u,o,a,f),f.delete(u);Q(r,n,c)}var Ge=sa;function Xe(r,e,n,o,i){if(r===e)return;fc(e,function(a,f){if(i||(i=new Do),Rt(a))Ge(r,e,f,n,Xe,o,i);else{var s=o?o(rr(r,f),a,f+"",r,e,i):void 0;if(s===void 0)s=a;Q(r,f,s)}},L)}var Ue=Xe;function ua(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var G=ua;function da(r){return function(e,n,o){var i=Object(e);if(!Ln(e)){var a=nr(n,3);e=Zt(e),n=function(s){return a(i[s],s,i)}}var f=r(e,n,o);return f>-1?i[a?e[f]:f]:void 0}}var Ve=da;var ca=Math.max;function pa(r,e,n){var o=r==null?0:r.length;if(!o)return-1;var i=n==null?0:Zr(n);if(i<0)i=ca(o+i,0);return Wp(r,nr(e,3),i)}var Ye=pa;var ma=Ve(Ye),er=ma;function ha(r,e){var n=-1,o=Ln(r)?Array(r.length):[];return ts(r,function(i,a,f){o[++n]=e(i,a,f)}),o}var mr=ha;function ga(r,e){var n=we(r)?Io:mr;return n(r,nr(e,3))}var E=ga;function va(r,e){return r==null?r:fc(r,Ac(e),L)}var ze=va;function ba(r,e){return r&&gc(r,Ac(e))}var We=ba;function ya(r,e){return r>e}var qe=ya;var Ea=Object.prototype,xa=Ea.hasOwnProperty;function Oa(r,e){return r!=null&&xa.call(r,e)}var He=Oa;function La(r,e){return r!=null&&em(r,e,He)}var hr=La;var Ia="[object String]";function Sa(r){return typeof r=="string"||!we(r)&&un(r)&&fr(r)==Ia}var Ke=Sa;function Na(r,e){return r<e}var vr=Na;function Pa(r,e){var n={};return e=nr(e,3),gc(r,function(o,i,a){R(n,i,e(o,i,a))}),n}var z=Pa;function ka(r,e,n){var o=-1,i=r.length;while(++o<i){var a=r[o],f=e(a);if(f!=null&&(s===void 0?f===f&&!ea(f):n(f,s)))var s=f,u=a}return u}var W=ka;function Aa(r){return r&&r.length?W(r,Nr,qe):void 0}var I=Aa;var Ra=ee(function(r,e,n){Ue(r,e,n)}),tr=Ra;function Ma(r){return r&&r.length?W(r,Nr,vr):void 0}var j=Ma;function ja(r,e){return r&&r.length?W(r,nr(e,2),vr):void 0}var q=ja;function Ba(r,e,n,o){if(!Rt(r))return r;e=Xi(e,r);var i=-1,a=e.length,f=a-1,s=r;while(s!=null&&++i<a){var u=To(e[i]),d=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return r;if(i!=f){var c=s[u];if(d=o?o(c,u,s):void 0,d===void 0)d=Rt(c)?c:Ki(e[i+1])?[]:{}}M(s,u,d),s=s[u]}return r}var Je=Ba;function Da(r,e,n){var o=-1,i=e.length,a={};while(++o<i){var f=e[o],s=es(r,f);if(n(s,f))Je(a,Xi(f,r),s)}return a}var Ze=Da;function Fa(r,e){var n=r.length;r.sort(e);while(n--)r[n]=r[n].value;return r}var $e=Fa;function Ga(r,e){if(r!==e){var n=r!==void 0,o=r===null,i=r===r,a=ea(r),f=e!==void 0,s=e===null,u=e===e,d=ea(e);if(!s&&!d&&!a&&r>e||a&&f&&u&&!s&&!d||o&&f&&u||!n&&u||!i)return 1;if(!o&&!a&&!d&&r<e||d&&n&&i&&!o&&!a||s&&n&&i||!f&&i||!u)return-1}return 0}var Qe=Ga;function Xa(r,e,n){var o=-1,i=r.criteria,a=e.criteria,f=i.length,s=n.length;while(++o<f){var u=Qe(i[o],a[o]);if(u){if(o>=s)return u;var d=n[o];return u*(d=="desc"?-1:1)}}return r.index-e.index}var rt=Xa;function Ua(r,e,n){if(e.length)e=Io(e,function(a){if(we(a))return function(f){return es(f,a.length===1?a[0]:a)};return a});else e=[Nr];var o=-1;e=Io(e,Ji(nr));var i=mr(r,function(a,f,s){var u=Io(e,function(d){return d(a)});return{criteria:u,index:++o,value:a}});return $e(i,function(a,f){return rt(a,f,n)})}var tt=Ua;var Va=nm("length"),nt=Va;var it="\\ud800-\\udfff",Ya="\\u0300-\\u036f",za="\\ufe20-\\ufe2f",Wa="\\u20d0-\\u20ff",qa=Ya+za+Wa,Ha="\\ufe0e\\ufe0f",Ka="["+it+"]",Er="["+qa+"]",xr="\\ud83c[\\udffb-\\udfff]",Ja="(?:"+Er+"|"+xr+")",at="[^"+it+"]",ft="(?:\\ud83c[\\udde6-\\uddff]){2}",st="[\\ud800-\\udbff][\\udc00-\\udfff]",Za="\\u200d",ut=Ja+"?",dt="["+Ha+"]?",$a="(?:"+Za+"(?:"+[at,ft,st].join("|")+")"+dt+ut+")*",Qa=dt+ut+$a,rf="(?:"+[at+Er+"?",Er,ft,st,Ka].join("|")+")",ot=RegExp(xr+"(?="+xr+")|"+rf+Qa,"g");function ef(r){var e=ot.lastIndex=0;while(ot.test(r))++e;return e}var ct=ef;function tf(r){return fe(r)?ct(r):nt(r)}var pt=tf;function nf(r,e){return Ze(r,e,function(n,o){return tm(r,o)})}var lt=nf;var of=oe(function(r,e){return r==null?{}:lt(r,e)}),H=of;var{ceil:af,max:ff}=Math;function sf(r,e,n,o){var i=-1,a=ff(af((e-r)/(n||1)),0),f=Array(a);while(a--)f[o?a:++i]=r,r+=n;return f}var mt=sf;function uf(r){return function(e,n,o){if(o&&typeof o!="number"&&T(e,n,o))n=o=void 0;if(e=U(e),n===void 0)n=e,e=0;else n=U(n);return o=o===void 0?e<n?1:-1:U(o),mt(e,n,o,r)}}var ht=uf;var df=ht(),N=df;var cf="[object Map]",pf="[object Set]";function lf(r){if(r==null)return 0;if(Ln(r))return Ke(r)?pt(r):r.length;var e=ta(r);if(e==cf||e==pf)return r.size;return cc(r).length}var gt=lf;var mf=Vi(function(r,e){if(r==null)return[];var n=e.length;if(n>1&&T(r,e[0],e[1]))e=[];else if(n>2&&T(e[0],e[1],e[2]))e=[e[0]];return tt(r,dc(e,1),[])}),C=mf;var hf=0;function gf(r){var e=++hf;return Jp(r)+e}var J=gf;function vf(r,e,n){var o=-1,i=r.length,a=e.length,f={};while(++o<i){var s=o<a?e[o]:void 0;n(f,r[o],s)}return f}var vt=vf;function bf(r,e){return vt(r||[],e||[],M)}var Or=bf;class Lr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return bt(e),e}enqueue(r){var e=this._sentinel;if(r._prev&&r._next)bt(r);r._next=e._next,e._next._prev=r,e._next=r,r._prev=e}toString(){var r=[],e=this._sentinel,n=e._prev;while(n!==e)r.push(JSON.stringify(n,yf)),n=n._prev;return"["+r.join(", ")+"]"}}function bt(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function yf(r,e){if(r!=="_next"&&r!=="_prev")return e}var wf=Qr(1);function yt(r,e){if(r.nodeCount()<=1)return[];var n=Ef(r,e||wf),o=_f(n.graph,n.buckets,n.zeroIdx);return S(E(o,function(i){return r.outEdges(i.v,i.w)}))}function _f(r,e,n){var o=[],i=e[e.length-1],a=e[0],f;while(r.nodeCount()){while(f=a.dequeue())Ir(r,e,n,f);while(f=i.dequeue())Ir(r,e,n,f);if(r.nodeCount()){for(var s=e.length-2;s>0;--s)if(f=e[s].dequeue(),f){o=o.concat(Ir(r,e,n,f,!0));break}}}return o}function Ir(r,e,n,o,i){var a=i?[]:void 0;return v(r.inEdges(o.v),function(f){var s=r.edge(f),u=r.node(f.v);if(i)a.push({v:f.v,w:f.w});u.out-=s,Sr(e,n,u)}),v(r.outEdges(o.v),function(f){var s=r.edge(f),u=f.w,d=r.node(u);d.in-=s,Sr(e,n,d)}),r.removeNode(o.v),a}function Ef(r,e){var n=new et,o=0,i=0;v(r.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),v(r.edges(),function(s){var u=n.edge(s.v,s.w)||0,d=e(s),c=u+d;n.setEdge(s.v,s.w,c),i=Math.max(i,n.node(s.v).out+=d),o=Math.max(o,n.node(s.w).in+=d)});var a=N(i+o+3).map(function(){return new Lr}),f=o+1;return v(n.nodes(),function(s){Sr(a,f,n.node(s))}),{graph:n,buckets:a,zeroIdx:f}}function Sr(r,e,n){if(!n.out)r[0].enqueue(n);else if(!n.in)r[r.length-1].enqueue(n);else r[n.out-n.in+e].enqueue(n)}function wt(r){var e=r.graph().acyclicer==="greedy"?yt(r,n(r)):xf(r);v(e,function(o){var i=r.edge(o);r.removeEdge(o),i.forwardName=o.name,i.reversed=!0,r.setEdge(o.w,o.v,i,J("rev"))});function n(o){return function(i){return o.edge(i).weight}}}function xf(r){var e=[],n={},o={};function i(a){if(Object.prototype.hasOwnProperty.call(o,a))return;o[a]=!0,n[a]=!0,v(r.outEdges(a),function(f){if(Object.prototype.hasOwnProperty.call(n,f.w))e.push(f);else i(f.w)}),delete n[a]}return v(r.nodes(),i),e}function _t(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed){r.removeEdge(e);var o=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(e.w,e.v,n,o)}})}function k(r,e,n,o){var i;do i=J(o);while(r.hasNode(i));return n.dummy=e,r.setNode(i,n),i}function xt(r){var e=new et().setGraph(r.graph());return v(r.nodes(),function(n){e.setNode(n,r.node(n))}),v(r.edges(),function(n){var o=e.edge(n.v,n.w)||{weight:0,minlen:1},i=r.edge(n);e.setEdge(n.v,n.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),e}function br(r){var e=new et({multigraph:r.isMultigraph()}).setGraph(r.graph());return v(r.nodes(),function(n){if(!r.children(n).length)e.setNode(n,r.node(n))}),v(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}function Pr(r,e){var{x:n,y:o}=r,i=e.x-n,a=e.y-o,f=r.width/2,s=r.height/2;if(!i&&!a)throw Error("Not possible to find intersection inside of the rectangle");var u,d;if(Math.abs(a)*f>Math.abs(i)*s){if(a<0)s=-s;u=s*i/a,d=s}else{if(i<0)f=-f;u=f,d=f*a/i}return{x:n+u,y:o+d}}function B(r){var e=E(N(Tr(r)+1),function(){return[]});return v(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!Xt(i))e[i][o.order]=n}),e}function Ot(r){var e=j(E(r.nodes(),function(n){return r.node(n).rank}));v(r.nodes(),function(n){var o=r.node(n);if(hr(o,"rank"))o.rank-=e})}function Lt(r){var e=j(E(r.nodes(),function(a){return r.node(a).rank})),n=[];v(r.nodes(),function(a){var f=r.node(a).rank-e;if(!n[f])n[f]=[];n[f].push(a)});var o=0,i=r.graph().nodeRankFactor;v(n,function(a,f){if(Xt(a)&&f%i!==0)--o;else if(o)v(a,function(s){r.node(s).rank+=o})})}function kr(r,e,n,o){var i={width:0,height:0};if(arguments.length>=4)i.rank=n,i.order=o;return k(r,"border",i,e)}function Tr(r){return I(E(r.nodes(),function(e){var n=r.node(e).rank;if(!Xt(n))return n}))}function It(r,e){var n={lhs:[],rhs:[]};return v(r,function(o){if(e(o))n.lhs.push(o);else n.rhs.push(o)}),n}function St(r,e){var n=_r();try{return e()}finally{console.log(r+" time: "+(_r()-n)+"ms")}}function Nt(r,e){return e()}function kt(r){function e(n){var o=r.children(n),i=r.node(n);if(o.length)v(o,e);if(Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,f=i.maxRank+1;a<f;++a)Pt(r,"borderLeft","_bl",n,i,a),Pt(r,"borderRight","_br",n,i,a)}}v(r.children(),e)}function Pt(r,e,n,o,i,a){var f={width:0,height:0,rank:a,borderType:e},s=i[e][a-1],u=k(r,"border",f,n);if(i[e][a]=u,r.setParent(u,o),s)r.setEdge(s,u,{weight:1})}function Ct(r){var e=r.graph().rankdir.toLowerCase();if(e==="lr"||e==="rl")Mt(r)}function At(r){var e=r.graph().rankdir.toLowerCase();if(e==="bt"||e==="rl")Of(r);if(e==="lr"||e==="rl")Lf(r),Mt(r)}function Mt(r){v(r.nodes(),function(e){Tt(r.node(e))}),v(r.edges(),function(e){Tt(r.edge(e))})}function Tt(r){var e=r.width;r.width=r.height,r.height=e}function Of(r){v(r.nodes(),function(e){Cr(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Cr),Object.prototype.hasOwnProperty.call(n,"y"))Cr(n)})}function Cr(r){r.y=-r.y}function Lf(r){v(r.nodes(),function(e){Ar(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Ar),Object.prototype.hasOwnProperty.call(n,"x"))Ar(n)})}function Ar(r){var e=r.x;r.x=r.y,r.y=e}function jt(r){r.graph().dummyChains=[],v(r.edges(),function(e){Sf(r,e)})}function Sf(r,e){var n=e.v,o=r.node(n).rank,i=e.w,a=r.node(i).rank,f=e.name,s=r.edge(e),u=s.labelRank;if(a===o+1)return;r.removeEdge(e);var d=void 0,c,p;for(p=0,++o;o<a;++p,++o){if(s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:o},c=k(r,"edge",d,"_d"),o===u)d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos;if(r.setEdge(n,c,{weight:s.weight},f),p===0)r.graph().dummyChains.push(c);n=c}r.setEdge(n,i,{weight:s.weight},f)}function Bt(r){v(r.graph().dummyChains,function(e){var n=r.node(e),o=n.edgeLabel,i;r.setEdge(n.edgeObj,o);while(n.dummy){if(i=r.successors(e)[0],r.removeNode(e),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label")o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height;e=i,n=r.node(e)}})}function or(r){var e={};function n(o){var i=r.node(o);if(Object.prototype.hasOwnProperty.call(e,o))return i.rank;e[o]=!0;var a=j(E(r.outEdges(o),function(f){return n(f.w)-r.edge(f).minlen}));if(a===Number.POSITIVE_INFINITY||a===void 0||a===null)a=0;return i.rank=a}v(r.sources(),n)}function X(r,e){return r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen}function yr(r){var e=new et({directed:!1}),n=r.nodes()[0],o=r.nodeCount();e.setNode(n,{});var i,a;while(Nf(e,r)<o)i=Pf(e,r),a=e.hasNode(i.v)?X(r,i):-X(r,i),kf(e,r,a);return e}function Nf(r,e){function n(o){v(e.nodeEdges(o),function(i){var a=i.v,f=o===a?i.w:a;if(!r.hasNode(f)&&!X(e,i))r.setNode(f,{}),r.setEdge(o,f,{}),n(f)})}return v(r.nodes(),n),r.nodeCount()}function Pf(r,e){return q(e.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return X(e,n)})}function kf(r,e,n){v(r.nodes(),function(o){e.node(o).rank+=n})}var fh=Qr(1);var mh=Qr(1);Rr.CycleException=ir;function Rr(r){var e={},n={},o=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new ir;if(!Object.prototype.hasOwnProperty.call(e,a))n[a]=!0,e[a]=!0,v(r.predecessors(a),i),delete n[a],o.push(a)}if(v(r.sinks(),i),gt(e)!==r.nodeCount())throw new ir;return o}function ir(){}ir.prototype=Error();function wr(r,e,n){if(!we(e))e=[e];var o=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],a={};return v(e,function(f){if(!r.hasNode(f))throw Error("Graph does not have node: "+f);Ft(r,f,n==="post",a,o,i)}),i}function Ft(r,e,n,o,i,a){if(!Object.prototype.hasOwnProperty.call(o,e)){if(o[e]=!0,!n)a.push(e);if(v(i(e),function(f){Ft(r,f,n,o,i,a)}),n)a.push(e)}}function Mr(r,e){return wr(r,e,"post")}function jr(r,e){return wr(r,e,"pre")}F.initLowLimValues=Dr;F.initCutValues=Br;F.calcCutValue=Ut;F.leaveEdge=Yt;F.enterEdge=zt;F.exchangeEdges=Wt;function F(r){r=xt(r),or(r);var e=yr(r);Dr(e),Br(e,r);var n,o;while(n=Yt(e))o=zt(e,r,n),Wt(e,r,n,o)}function Br(r,e){var n=Mr(r,r.nodes());n=n.slice(0,n.length-1),v(n,function(o){Mf(r,e,o)})}function Mf(r,e,n){var o=r.node(n),i=o.parent;r.edge(n,i).cutvalue=Ut(r,e,n)}function Ut(r,e,n){var o=r.node(n),i=o.parent,a=!0,f=e.edge(n,i),s=0;if(!f)a=!1,f=e.edge(i,n);return s=f.weight,v(e.nodeEdges(n),function(u){var d=u.v===n,c=d?u.w:u.v;if(c!==i){var p=d===a,h=e.edge(u).weight;if(s+=p?h:-h,Bf(r,n,c)){var b=r.edge(n,c).cutvalue;s+=p?-b:b}}}),s}function Dr(r,e){if(arguments.length<2)e=r.nodes()[0];Vt(r,{},1,e)}function Vt(r,e,n,o,i){var a=n,f=r.node(o);if(e[o]=!0,v(r.neighbors(o),function(s){if(!Object.prototype.hasOwnProperty.call(e,s))n=Vt(r,e,n,s,o)}),f.low=a,f.lim=n++,i)f.parent=i;else delete f.parent;return n}function Yt(r){return er(r.edges(),function(e){return r.edge(e).cutvalue<0})}function zt(r,e,n){var{v:o,w:i}=n;if(!e.hasEdge(o,i))o=n.w,i=n.v;var a=r.node(o),f=r.node(i),s=a,u=!1;if(a.lim>f.lim)s=f,u=!0;var d=gr(e.edges(),function(c){return u===Gt(r,r.node(c.v),s)&&u!==Gt(r,r.node(c.w),s)});return q(d,function(c){return X(e,c)})}function Wt(r,e,n,o){var{v:i,w:a}=n;r.removeEdge(i,a),r.setEdge(o.v,o.w,{}),Dr(r),Br(r,e),jf(r,e)}function jf(r,e){var n=er(r.nodes(),function(i){return!e.node(i).parent}),o=jr(r,n);o=o.slice(1),v(o,function(i){var a=r.node(i).parent,f=e.edge(i,a),s=!1;if(!f)f=e.edge(a,i),s=!0;e.node(i).rank=e.node(a).rank+(s?f.minlen:-f.minlen)})}function Bf(r,e,n){return r.hasEdge(e,n)}function Gt(r,e,n){return n.low<=e.lim&&e.lim<=n.lim}function Fr(r){switch(r.graph().ranker){case"network-simplex":qt(r);break;case"tight-tree":Ff(r);break;case"longest-path":Df(r);break;default:qt(r)}}var Df=or;function Ff(r){or(r),yr(r)}function qt(r){F(r)}function Ht(r){var e=k(r,"root",{},"_root"),n=Gf(r),o=I(na(n))-1,i=2*o+1;r.graph().nestingRoot=e,v(r.edges(),function(f){r.edge(f).minlen*=i});var a=Xf(r)+1;v(r.children(),function(f){Kt(r,e,i,a,o,n,f)}),r.graph().nodeRankFactor=i}function Kt(r,e,n,o,i,a,f){var s=r.children(f);if(!s.length){if(f!==e)r.setEdge(e,f,{weight:0,minlen:n});return}var u=kr(r,"_bt"),d=kr(r,"_bb"),c=r.node(f);if(r.setParent(u,f),c.borderTop=u,r.setParent(d,f),c.borderBottom=d,v(s,function(p){Kt(r,e,n,o,i,a,p);var h=r.node(p),b=h.borderTop?h.borderTop:p,w=h.borderBottom?h.borderBottom:p,y=h.borderTop?o:2*o,g=b!==w?1:i-a[f]+1;r.setEdge(u,b,{weight:y,minlen:g,nestingEdge:!0}),r.setEdge(w,d,{weight:y,minlen:g,nestingEdge:!0})}),!r.parent(f))r.setEdge(e,u,{weight:0,minlen:i+a[f]})}function Gf(r){var e={};function n(o,i){var a=r.children(o);if(a&&a.length)v(a,function(f){n(f,i+1)});e[o]=i}return v(r.children(),function(o){n(o,1)}),e}function Xf(r){return No(r.edges(),function(e,n){return e+r.edge(n).weight},0)}function $t(r){var e=r.graph();r.removeNode(e.nestingRoot),delete e.nestingRoot,v(r.edges(),function(n){var o=r.edge(n);if(o.nestingEdge)r.removeEdge(n)})}function Qt(r,e,n){var o={},i;v(n,function(a){var f=r.parent(a),s,u;while(f){if(s=r.parent(f),s)u=o[s],o[s]=f;else u=i,i=f;if(u&&u!==f){e.setEdge(u,f);return}f=s}})}function rn(r,e,n){var o=Vf(r),i=new et({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(a){return r.node(a)});return v(r.nodes(),function(a){var f=r.node(a),s=r.parent(a);if(f.rank===e||f.minRank<=e&&e<=f.maxRank){if(i.setNode(a),i.setParent(a,s||o),v(r[n](a),function(u){var d=u.v===a?u.w:u.v,c=i.edge(d,a),p=!Xt(c)?c.weight:0;i.setEdge(d,a,{weight:r.edge(u).weight+p})}),Object.prototype.hasOwnProperty.call(f,"minRank"))i.setNode(a,{borderLeft:f.borderLeft[e],borderRight:f.borderRight[e]})}}),i}function Vf(r){var e;while(r.hasNode(e=J("_root")));return e}function en(r,e){var n=0;for(var o=1;o<e.length;++o)n+=Yf(r,e[o-1],e[o]);return n}function Yf(r,e,n){var o=Or(n,E(n,function(d,c){return c})),i=S(E(e,function(d){return C(E(r.outEdges(d),function(c){return{pos:o[c.w],weight:r.edge(c).weight}}),"pos")})),a=1;while(a<n.length)a<<=1;var f=2*a-1;a-=1;var s=E(Array(f),function(){return 0}),u=0;return v(i.forEach(function(d){var c=d.pos+a;s[c]+=d.weight;var p=0;while(c>0){if(c%2)p+=s[c+1];c=c-1>>1,s[c]+=d.weight}u+=d.weight*p})),u}function tn(r){var e={},n=gr(r.nodes(),function(s){return!r.children(s).length}),o=I(E(n,function(s){return r.node(s).rank})),i=E(N(o+1),function(){return[]});function a(s){if(hr(e,s))return;e[s]=!0;var u=r.node(s);i[u.rank].push(s),v(r.successors(s),a)}var f=C(n,function(s){return r.node(s).rank});return v(f,a),i}function nn(r,e){return E(e,function(n){var o=r.inEdges(n);if(!o.length)return{v:n};else{var i=No(o,function(a,f){var s=r.edge(f),u=r.node(f.v);return{sum:a.sum+s.weight*u.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function on(r,e){var n={};v(r,function(i,a){var f=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};if(!Xt(i.barycenter))f.barycenter=i.barycenter,f.weight=i.weight}),v(e.edges(),function(i){var a=n[i.v],f=n[i.w];if(!Xt(a)&&!Xt(f))f.indegree++,a.out.push(n[i.w])});var o=gr(n,function(i){return!i.indegree});return zf(o)}function zf(r){var e=[];function n(a){return function(f){if(f.merged)return;if(Xt(f.barycenter)||Xt(a.barycenter)||f.barycenter>=a.barycenter)Wf(a,f)}}function o(a){return function(f){if(f.in.push(a),--f.indegree===0)r.push(f)}}while(r.length){var i=r.pop();e.push(i),v(i.in.reverse(),n(i)),v(i.out,o(i))}return E(gr(e,function(a){return!a.merged}),function(a){return H(a,["vs","i","barycenter","weight"])})}function Wf(r,e){var n=0,o=0;if(r.weight)n+=r.barycenter*r.weight,o+=r.weight;if(e.weight)n+=e.barycenter*e.weight,o+=e.weight;r.vs=e.vs.concat(r.vs),r.barycenter=n/o,r.weight=o,r.i=Math.min(e.i,r.i),e.merged=!0}function fn(r,e){var n=It(r,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),o=n.lhs,i=C(n.rhs,function(c){return-c.i}),a=[],f=0,s=0,u=0;o.sort(qf(!!e)),u=an(a,i,u),v(o,function(c){u+=c.vs.length,a.push(c.vs),f+=c.barycenter*c.weight,s+=c.weight,u=an(a,i,u)});var d={vs:S(a)};if(s)d.barycenter=f/s,d.weight=s;return d}function an(r,e,n){var o;while(e.length&&(o=G(e)).i<=n)e.pop(),r.push(o.vs),n++;return n}function qf(r){return function(e,n){if(e.barycenter<n.barycenter)return-1;else if(e.barycenter>n.barycenter)return 1;return!r?e.i-n.i:n.i-e.i}}function Gr(r,e,n,o){var i=r.children(e),a=r.node(e),f=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,u={};if(f)i=gr(i,function(w){return w!==f&&w!==s});var d=nn(r,i);v(d,function(w){if(r.children(w.v).length){var y=Gr(r,w.v,n,o);if(u[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Kf(w,y)}});var c=on(d,n);Hf(c,u);var p=fn(c,o);if(f){if(p.vs=S([f,p.vs,s]),r.predecessors(f).length){var h=r.node(r.predecessors(f)[0]),b=r.node(r.predecessors(s)[0]);if(!Object.prototype.hasOwnProperty.call(p,"barycenter"))p.barycenter=0,p.weight=0;p.barycenter=(p.barycenter*p.weight+h.order+b.order)/(p.weight+2),p.weight+=2}}return p}function Hf(r,e){v(r,function(n){n.vs=S(n.vs.map(function(o){if(e[o])return e[o].vs;return o}))})}function Kf(r,e){if(!Xt(r.barycenter))r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight;else r.barycenter=e.barycenter,r.weight=e.weight}function cn(r){var e=Tr(r),n=sn(r,N(1,e+1),"inEdges"),o=sn(r,N(e-1,-1,-1),"outEdges"),i=tn(r);dn(r,i);var a=Number.POSITIVE_INFINITY,f;for(var s=0,u=0;u<4;++s,++u){Jf(s%2?n:o,s%4>=2),i=B(r);var d=en(r,i);if(d<a)u=0,f=je(i),a=d}dn(r,f)}function sn(r,e,n){return E(e,function(o){return rn(r,o,n)})}function Jf(r,e){var n=new et;v(r,function(o){var i=o.graph().root,a=Gr(o,i,n,e);v(a.vs,function(f,s){o.node(f).order=s}),Qt(o,n,a.vs)})}function dn(r,e){v(e,function(n){v(n,function(o,i){r.node(o).order=i})})}function pn(r){var e=$f(r);v(r.graph().dummyChains,function(n){var o=r.node(n),i=o.edgeObj,a=Zf(r,e,i.v,i.w),{path:f,lca:s}=a,u=0,d=f[u],c=!0;while(n!==i.w){if(o=r.node(n),c){while((d=f[u])!==s&&r.node(d).maxRank<o.rank)u++;if(d===s)c=!1}if(!c){while(u<f.length-1&&r.node(d=f[u+1]).minRank<=o.rank)u++;d=f[u]}r.setParent(n,d),n=r.successors(n)[0]}})}function Zf(r,e,n,o){var i=[],a=[],f=Math.min(e[n].low,e[o].low),s=Math.max(e[n].lim,e[o].lim),u,d;u=n;do u=r.parent(u),i.push(u);while(u&&(e[u].low>f||s>e[u].lim));d=u,u=o;while((u=r.parent(u))!==d)a.push(u);return{path:i.concat(a.reverse()),lca:d}}function $f(r){var e={},n=0;function o(i){var a=n;v(r.children(i),o),e[i]={low:a,lim:n++}}return v(r.children(),o),e}function Qf(r,e){var n={};function o(i,a){var f=0,s=0,u=i.length,d=G(a);return v(a,function(c,p){var h=ns(r,c),b=h?r.node(h).order:u;if(h||c===d)v(a.slice(s,p+1),function(w){v(r.predecessors(w),function(y){var g=r.node(y),_=g.order;if((_<f||b<_)&&!(g.dummy&&r.node(w).dummy))ln(n,y,w)})}),s=p+1,f=b}),a}return No(e,o),n}function rs(r,e){var n={};function o(a,f,s,u,d){var c;v(N(f,s),function(p){if(c=a[p],r.node(c).dummy)v(r.predecessors(c),function(h){var b=r.node(h);if(b.dummy&&(b.order<u||b.order>d))ln(n,h,c)})})}function i(a,f){var s=-1,u,d=0;return v(f,function(c,p){if(r.node(c).dummy==="border"){var h=r.predecessors(c);if(h.length)u=r.node(h[0]).order,o(f,d,p,s,u),d=p,s=u}o(f,d,f.length,u,a.length)}),f}return No(e,i),n}function ns(r,e){if(r.node(e).dummy)return er(r.predecessors(e),function(n){return r.node(n).dummy})}function ln(r,e,n){if(e>n){var o=e;e=n,n=o}if(!Object.prototype.hasOwnProperty.call(r,e))Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=r[e];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function os(r,e,n){if(e>n){var o=e;e=n,n=o}return!!r[e]&&Object.prototype.hasOwnProperty.call(r[e],n)}function is(r,e,n,o){var i={},a={},f={};return v(e,function(s){v(s,function(u,d){i[u]=u,a[u]=u,f[u]=d})}),v(e,function(s){var u=-1;v(s,function(d){var c=o(d);if(c.length){c=C(c,function(y){return f[y]});var p=(c.length-1)/2;for(var h=Math.floor(p),b=Math.ceil(p);h<=b;++h){var w=c[h];if(a[d]===d&&u<f[w]&&!os(n,d,w))a[w]=d,a[d]=i[d]=i[w],u=f[w]}}})}),{root:i,align:a}}function as(r,e,n,o,i){var a={},f=fs(r,e,n,i),s=i?"borderLeft":"borderRight";function u(p,h){var b=f.nodes(),w=b.pop(),y={};while(w){if(y[w])p(w);else y[w]=!0,b.push(w),b=b.concat(h(w));w=b.pop()}}function d(p){a[p]=f.inEdges(p).reduce(function(h,b){return Math.max(h,a[b.v]+f.edge(b))},0)}function c(p){var h=f.outEdges(p).reduce(function(w,y){return Math.min(w,a[y.w]-f.edge(y))},Number.POSITIVE_INFINITY),b=r.node(p);if(h!==Number.POSITIVE_INFINITY&&b.borderType!==s)a[p]=Math.max(a[p],h)}return u(d,f.predecessors.bind(f)),u(c,f.successors.bind(f)),v(o,function(p){a[p]=a[n[p]]}),a}function fs(r,e,n,o){var i=new et,a=r.graph(),f=cs(a.nodesep,a.edgesep,o);return v(e,function(s){var u;v(s,function(d){var c=n[d];if(i.setNode(c),u){var p=n[u],h=i.edge(p,c);i.setEdge(p,c,Math.max(f(r,d,u),h||0))}u=d})}),i}function ss(r,e){return q(na(e),function(n){var{NEGATIVE_INFINITY:o,POSITIVE_INFINITY:i}=Number;return ze(n,function(a,f){var s=ps(r,f)/2;o=Math.max(a+s,o),i=Math.min(a-s,i)}),o-i})}function us(r,e){var n=na(e),o=j(n),i=I(n);v(["u","d"],function(a){v(["l","r"],function(f){var s=a+f,u=r[s],d;if(u===e)return;var c=na(u);if(d=f==="l"?o-j(c):i-I(c),d)r[s]=z(u,function(p){return p+d})})})}function ds(r,e){return z(r.ul,function(n,o){if(e)return r[e.toLowerCase()][o];else{var i=C(E(r,o));return(i[1]+i[2])/2}})}function mn(r){var e=B(r),n=tr(Qf(r,e),rs(r,e)),o={},i;v(["u","d"],function(f){i=f==="u"?e:na(e).reverse(),v(["l","r"],function(s){if(s==="r")i=E(i,function(p){return na(p).reverse()});var u=(f==="u"?r.predecessors:r.successors).bind(r),d=is(r,i,n,u),c=as(r,i,d.root,d.align,s==="r");if(s==="r")c=z(c,function(p){return-p});o[f+s]=c})});var a=ss(r,o);return us(o,a),ds(o,r.graph().align)}function cs(r,e,n){return function(o,i,a){var f=o.node(i),s=o.node(a),u=0,d;if(u+=f.width/2,Object.prototype.hasOwnProperty.call(f,"labelpos"))switch(f.labelpos.toLowerCase()){case"l":d=-f.width/2;break;case"r":d=f.width/2;break}if(d)u+=n?d:-d;if(d=0,u+=(f.dummy?e:r)/2,u+=(s.dummy?e:r)/2,u+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=s.width/2;break;case"r":d=-s.width/2;break}if(d)u+=n?d:-d;return d=0,u}}function ps(r,e){return r.node(e).width}function hn(r){r=br(r),ls(r),We(mn(r),function(e,n){r.node(n).x=e})}function ls(r){var e=B(r),n=r.graph().ranksep,o=0;v(e,function(i){var a=I(E(i,function(f){return r.node(f).height}));v(i,function(f){r.node(f).y=o+a/2}),o+=a+n})}function Vr(r,e){var n=e&&e.debugTiming?St:Nt;n("layout",()=>{var o=n(" buildLayoutGraph",()=>Os(r));n(" runLayout",()=>ms(o,n)),n(" updateInputGraph",()=>hs(r,o))})}function ms(r,e){e(" makeSpaceForEdgeLabels",()=>Ls(r)),e(" removeSelfEdges",()=>Rs(r)),e(" acyclic",()=>wt(r)),e(" nestingGraph.run",()=>Ht(r)),e(" rank",()=>Fr(br(r))),e(" injectEdgeLabelProxies",()=>Is(r)),e(" removeEmptyRanks",()=>Lt(r)),e(" nestingGraph.cleanup",()=>$t(r)),e(" normalizeRanks",()=>Ot(r)),e(" assignRankMinMax",()=>Ss(r)),e(" removeEdgeLabelProxies",()=>Ns(r)),e(" normalize.run",()=>jt(r)),e(" parentDummyChains",()=>pn(r)),e(" addBorderSegments",()=>kt(r)),e(" order",()=>cn(r)),e(" insertSelfEdges",()=>Ms(r)),e(" adjustCoordinateSystem",()=>Ct(r)),e(" position",()=>hn(r)),e(" positionSelfEdges",()=>js(r)),e(" removeBorderNodes",()=>As(r)),e(" normalize.undo",()=>Bt(r)),e(" fixupEdgeLabelCoords",()=>Ts(r)),e(" undoCoordinateSystem",()=>At(r)),e(" translateGraph",()=>Ps(r)),e(" assignNodeIntersects",()=>ks(r)),e(" reversePoints",()=>Cs(r)),e(" acyclic.undo",()=>_t(r))}function hs(r,e){v(r.nodes(),function(n){var o=r.node(n),i=e.node(n);if(o){if(o.x=i.x,o.y=i.y,e.children(n).length)o.width=i.width,o.height=i.height}}),v(r.edges(),function(n){var o=r.edge(n),i=e.edge(n);if(o.points=i.points,Object.prototype.hasOwnProperty.call(i,"x"))o.x=i.x,o.y=i.y}),r.graph().width=e.graph().width,r.graph().height=e.graph().height}var gs=["nodesep","edgesep","ranksep","marginx","marginy"],vs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},bs=["acyclicer","ranker","rankdir","align"],ys=["width","height"],ws={width:0,height:0},_s=["minlen","weight","width","height","labeloffset"],Es={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xs=["labelpos"];function Os(r){var e=new et({multigraph:!0,compound:!0}),n=Ur(r.graph());return e.setGraph(tr({},vs,Xr(n,gs),H(n,bs))),v(r.nodes(),function(o){var i=Ur(r.node(o));e.setNode(o,De(Xr(i,ys),ws)),e.setParent(o,r.parent(o))}),v(r.edges(),function(o){var i=Ur(r.edge(o));e.setEdge(o,tr({},Es,Xr(i,_s),H(i,xs)))}),e}function Ls(r){var e=r.graph();e.ranksep/=2,v(r.edges(),function(n){var o=r.edge(n);if(o.minlen*=2,o.labelpos.toLowerCase()!=="c")if(e.rankdir==="TB"||e.rankdir==="BT")o.width+=o.labeloffset;else o.height+=o.labeloffset})}function Is(r){v(r.edges(),function(e){var n=r.edge(e);if(n.width&&n.height){var o=r.node(e.v),i=r.node(e.w),a={rank:(i.rank-o.rank)/2+o.rank,e};k(r,"edge-proxy",a,"_ep")}})}function Ss(r){var e=0;v(r.nodes(),function(n){var o=r.node(n);if(o.borderTop)o.minRank=r.node(o.borderTop).rank,o.maxRank=r.node(o.borderBottom).rank,e=I(e,o.maxRank)}),r.graph().maxRank=e}function Ns(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="edge-proxy")r.edge(n.e).labelRank=n.rank,r.removeNode(e)})}function Ps(r){var e=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,a=r.graph(),f=a.marginx||0,s=a.marginy||0;function u(d){var{x:c,y:p,width:h,height:b}=d;e=Math.min(e,c-h/2),n=Math.max(n,c+h/2),o=Math.min(o,p-b/2),i=Math.max(i,p+b/2)}v(r.nodes(),function(d){u(r.node(d))}),v(r.edges(),function(d){var c=r.edge(d);if(Object.prototype.hasOwnProperty.call(c,"x"))u(c)}),e-=f,o-=s,v(r.nodes(),function(d){var c=r.node(d);c.x-=e,c.y-=o}),v(r.edges(),function(d){var c=r.edge(d);if(v(c.points,function(p){p.x-=e,p.y-=o}),Object.prototype.hasOwnProperty.call(c,"x"))c.x-=e;if(Object.prototype.hasOwnProperty.call(c,"y"))c.y-=o}),a.width=n-e+f,a.height=i-o+s}function ks(r){v(r.edges(),function(e){var n=r.edge(e),o=r.node(e.v),i=r.node(e.w),a,f;if(!n.points)n.points=[],a=i,f=o;else a=n.points[0],f=n.points[n.points.length-1];n.points.unshift(Pr(o,a)),n.points.push(Pr(i,f))})}function Ts(r){v(r.edges(),function(e){var n=r.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r")n.width-=n.labeloffset;switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function Cs(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed)n.points.reverse()})}function As(r){v(r.nodes(),function(e){if(r.children(e).length){var n=r.node(e),o=r.node(n.borderTop),i=r.node(n.borderBottom),a=r.node(G(n.borderLeft)),f=r.node(G(n.borderRight));n.width=Math.abs(f.x-a.x),n.height=Math.abs(i.y-o.y),n.x=a.x+n.width/2,n.y=o.y+n.height/2}}),v(r.nodes(),function(e){if(r.node(e).dummy==="border")r.removeNode(e)})}function Rs(r){v(r.edges(),function(e){if(e.v===e.w){var n=r.node(e.v);if(!n.selfEdges)n.selfEdges=[];n.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})}function Ms(r){var e=B(r);v(e,function(n){var o=0;v(n,function(i,a){var f=r.node(i);f.order=a+o,v(f.selfEdges,function(s){k(r,"selfedge",{width:s.label.width,height:s.label.height,rank:f.rank,order:a+ ++o,e:s.e,label:s.label},"_se")}),delete f.selfEdges})})}function js(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="selfedge"){var o=r.node(n.e.v),i=o.x+o.width/2,a=o.y,f=n.x-i,s=o.height/2;r.setEdge(n.e,n.label),r.removeNode(e),n.label.points=[{x:i+2*f/3,y:a-s},{x:i+5*f/6,y:a-s},{x:i+f,y:a},{x:i+5*f/6,y:a+s},{x:i+2*f/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Xr(r,e){return z(H(r,e),Number)}function Ur(r){var e={};return v(r,function(n,o){e[o.toLowerCase()]=n}),e}var gn=t((r,e,n)=>Math.max(e,Math.min(n,r)),"clamp"),vn=t((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Bs=t((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),Ds=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Fs=t((r,e,n,o,i)=>{let a=[],f=new Set;if(n.forEach(({start:c,end:p})=>{if(c!==o)f.add(c);if(p!==o)f.add(p)}),f.forEach((c)=>{let p=r.node(c);if(typeof p?.x==="number"&&typeof p?.y==="number")a.push(p)}),a.length===0)n.forEach(({edge:c})=>{(c.points??[]).forEach((p)=>{if(typeof p?.x==="number"&&typeof p?.y==="number")a.push(p)})});if(a.length===0)return vn(i);let s=a.reduce((c,p)=>({x:c.x+p.x/a.length,y:c.y+p.y/a.length}),{x:0,y:0}),u=s.x-e.x,d=s.y-e.y;if(Math.abs(u)>Math.abs(d))return u>0?"right":"left";if(Math.abs(d)>0)return d>0?"bottom":"top";return vn(i)},"getSelfLoopSide"),Gs=t((r,e="top",n=0,o=0)=>{let i=r.x,a=r.y-n,f=r.width/2,s=r.height/2,u=Math.max(36,Math.min(100,r.width*0.8)),d=gn(Math.max(o,r.width*0.35),36,u),c=gn(Math.min(r.width,r.height)*0.45,24,48);switch(e){case"bottom":{let p=a+s;return[{x:i-d/2,y:p},{x:i-d/2,y:p+c},{x:i+d/2,y:p+c},{x:i+d/2,y:p}]}case"right":{let p=i+f;return[{x:p,y:a-d/2},{x:p+c,y:a-d/2},{x:p+c,y:a+d/2},{x:p,y:a+d/2}]}case"left":{let p=i-f;return[{x:p,y:a-d/2},{x:p-c,y:a-d/2},{x:p-c,y:a+d/2},{x:p,y:a+d/2}]}case"top":default:{let p=a-s;return[{x:i-d/2,y:p},{x:i-d/2,y:p-c},{x:i+d/2,y:p-c},{x:i+d/2,y:p}]}}},"getSelfLoopPoints"),Xs=t((r,e,n="top",o=0,i={})=>{let f=r.x,s=r.y-o,u=i.width??0,d=i.height??0;switch(n){case"bottom":return{x:f,y:Math.max(...e.map((c)=>c.y))+d/2+4};case"right":return{x:Math.max(...e.map((c)=>c.x))+u/2+4,y:s};case"left":return{x:Math.min(...e.map((c)=>c.x))-u/2-4,y:s};case"top":default:return{x:f,y:Math.min(...e.map((c)=>c.y))-d/2-4}}},"getSelfLoopLabelPosition"),yn=t((r,e=0,{mergeSelfLoops:n=!0}={})=>{let o=new Map,i=[],a=r.graph()?.rankdir;return r.edges().forEach((f)=>{let s=r.edge(f);if(n&&s.selfLoop){let u=s.selfLoop.id;if(!o.has(u))o.set(u,[]);o.get(u).push({edge:s,start:f.v,end:f.w})}else i.push({edge:s,start:f.v,end:f.w})}),o.forEach((f)=>{if(f.length!==3){f.forEach((_)=>i.push(_));return}f.sort((_,A)=>_.edge.selfLoop.order-A.edge.selfLoop.order);let[s,u,d]=f,c=s.edge.originalEdge??u.edge.originalEdge??d.edge.originalEdge??u.edge,p=r.node(c.start);if(!p){f.forEach((_)=>i.push(_));return}let h={width:u.edge.width,height:u.edge.height},b=Fs(r,p,f,c.start,a),w=Gs(p,b,e,h.width??0),y=Xs(p,w,b,e,h),g={...u.edge,...c,id:c.id,points:w,start:c.start,end:c.end,x:y.x,y:y.y,width:h.width,height:h.height,labelStyle:u.edge.labelStyle,fromCluster:s.edge.fromCluster??u.edge.fromCluster??d.edge.fromCluster,toCluster:s.edge.toCluster??u.edge.toCluster??d.edge.toCluster};delete g.selfLoop,delete g.originalEdge,i.push({edge:g,start:g.start,end:g.end})}),i},"getEdgesToRender"),wn=t(async({element:r,graph:e,diagramType:n,id:o,parentCluster:i,siteConfig:a})=>{let f=e.graph().rankdir;l.trace("Dir in recursive render - dir:",f);let{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:p}=zp(r,{edgePathsClass:"edgePaths"});if(!e.nodes())l.info("No nodes found for",e);else l.info("Recursive render XXX",e.nodes());if(e.edges().length>0)l.info("Recursive edges",e.edge(e.edges()[0]));let h=Bs(n);await Promise.all(e.nodes().map(async function(y){let g=e.node(y);if(i!==void 0){let _=JSON.parse(JSON.stringify(i.clusterData));if(l.trace(`Setting data for parent cluster XXX
|
|
1
|
+
import{t,l,m,K,Na,jh,ua,Oo,Ra,Bl,$o}from"./index-mgzbypt5.js";import{Zt,Rn,Ar,un,na,So,we,Mt,Lr,To,Mr,gc,Jp,Zp,Xp,ns,Ia,em,rs,Ln,as,io,_a,os,Do,is,tm,nm,Ac,Xt,rm,ss,No,ls,hc,bc,Qo,am,yc,om,Bd,ra,vc,im,sm,lm,rr,xc,kc,cs,cm,wc,v,hr,aa,en,Ro,nt}from"./index-jg5h18sm.js";import{Wp,Kp,ve,vl,Qh,Vp,ki}from"./index-mh52531j.js";import{Sn}from"./index-0g82ph6h.js";var sr={};Sn(sr,{default:()=>Z});var xn=/\s/;function On(r){var e=r.length;while(e--&&xn.test(r.charAt(e)));return e}var qr=On;var In=/^\s+/;function Nn(r){return r?r.slice(0,qr(r)+1).replace(In,""):r}var Hr=Nn;var Kr=NaN,Pn=/^[-+]0x[0-9a-f]+$/i,kn=/^0b[01]+$/i,Tn=/^0o[0-7]+$/i,Cn=parseInt;function An(r){if(typeof r=="number")return r;if(na(r))return Kr;if(Mt(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Mt(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Hr(r);var n=kn.test(r);return n||Tn.test(r)?Cn(r.slice(2),n?2:8):Pn.test(r)?Kr:+r}var Jr=An;var Zr=1/0,Mn=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function jn(r){if(!r)return r===0?r:0;if(r=Jr(r),r===Zr||r===-Zr){var e=r<0?-1:1;return e*Mn}return r===r?r:0}var U=jn;function Bn(r){var e=U(r),n=e%1;return e===e?n?e-n:e:0}var $r=Bn;var Qr=Object.create,Dn=function(){function r(){}return function(e){if(!Mt(e))return{};if(Qr)return Qr(e);r.prototype=e;var n=new r;return r.prototype=void 0,n}}(),re=Dn;function Fn(r,e){var n=-1,o=r.length;e||(e=Array(o));while(++n<o)e[n]=r[n];return e}var ar=Fn;function Gn(r,e,n){if(e=="__proto__"&&gc)gc(r,e,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[e]=n}var R=Gn;var Xn=Object.prototype,Un=Xn.hasOwnProperty;function Vn(r,e,n){var o=r[e];if(!(Un.call(r,e)&&Ia(o,n))||n===void 0&&!(e in r))R(r,e,n)}var M=Vn;function Yn(r,e,n,o){var i=!n;n||(n={});var a=-1,f=e.length;while(++a<f){var s=e[a],u=o?o(n[s],r[s],s,n,r):void 0;if(u===void 0)u=r[s];if(i)R(n,s,u);else M(n,s,u)}return n}var P=Yn;function zn(r,e,n){if(!Mt(n))return!1;var o=typeof e;if(o=="number"?Ln(n)&&ns(e,n.length):o=="string"&&(e in n))return Ia(n[e],r);return!1}var T=zn;function Wn(r){return rs(function(e,n){var o=-1,i=n.length,a=i>1?n[i-1]:void 0,f=i>2?n[2]:void 0;if(a=r.length>3&&typeof a=="function"?(i--,a):void 0,f&&T(n[0],n[1],f))a=i<3?void 0:a,i=1;e=Object(e);while(++o<i){var s=n[o];if(s)r(e,s,o,a)}return e})}var ee=Wn;function qn(r){var e=[];if(r!=null)for(var n in Object(r))e.push(n);return e}var te=qn;var Hn=Object.prototype,Kn=Hn.hasOwnProperty;function Jn(r){if(!Mt(r))return te(r);var e=as(r),n=[];for(var o in r)if(!(o=="constructor"&&(e||!Kn.call(r,o))))n.push(o);return n}var ne=Jn;function Zn(r){return Ln(r)?tm(r,!0):ne(r)}var L=Zn;function $n(r){var e=r==null?0:r.length;return e?bc(r,1):[]}var S=$n;function Qn(r){return Jp(em(r,void 0,S),r+"")}var oe=Qn;var ro=nm(Object.getPrototypeOf,Object),V=ro;var eo="[object Object]",to=Function.prototype,no=Object.prototype,ie=to.toString,oo=no.hasOwnProperty,ao=ie.call(Object);function fo(r){if(!un(r)||Ar(r)!=eo)return!1;var e=V(r);if(e===null)return!0;var n=oo.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ie.call(n)==ao}var ae=fo;var so="\\ud800-\\udfff",uo="\\u0300-\\u036f",co="\\ufe20-\\ufe2f",po="\\u20d0-\\u20ff",lo=uo+co+po,mo="\\ufe0e\\ufe0f",ho="\\u200d",go=RegExp("["+ho+so+lo+mo+"]");function vo(r){return go.test(r)}var fe=vo;function bo(r,e){return r&&P(e,Xt(e),r)}var se=bo;function yo(r,e){return r&&P(e,L(e),r)}var ue=yo;var le=typeof sr=="object"&&sr&&!sr.nodeType&&sr,de=le&&typeof fr=="object"&&fr&&!fr.nodeType&&fr,wo=de&&de.exports===le,ce=wo?Zt.Buffer:void 0,pe=ce?ce.allocUnsafe:void 0;function _o(r,e){if(e)return r.slice();var n=r.length,o=pe?pe(n):new r.constructor(n);return r.copy(o),o}var Z=_o;function Eo(r,e){return P(r,yc(r),e)}var me=Eo;var xo=Object.getOwnPropertySymbols,Lo=!xo?am:function(r){var e=[];while(r)hc(e,yc(r)),r=V(r);return e},ur=Lo;function Io(r,e){return P(r,ur(r),e)}var he=Io;function Po(r){return om(r,L,ur)}var ge=Po;var ko=Object.prototype,Co=ko.hasOwnProperty;function Ao(r){var e=r.length,n=new r.constructor(e);if(e&&typeof r[0]=="string"&&Co.call(r,"index"))n.index=r.index,n.input=r.input;return n}var be=Ao;function Mo(r){var e=new r.constructor(r.byteLength);return new vc(e).set(new vc(r)),e}var Y=Mo;function jo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var ye=jo;var Bo=/\w*$/;function Fo(r){var e=new r.constructor(r.source,Bo.exec(r));return e.lastIndex=r.lastIndex,e}var _e=Fo;var Ee=Rn?Rn.prototype:void 0,xe=Ee?Ee.valueOf:void 0;function Go(r){return xe?Object(xe.call(r)):{}}var Oe=Go;function Xo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var dr=Xo;var Uo="[object Boolean]",Vo="[object Date]",Yo="[object Map]",zo="[object Number]",Wo="[object RegExp]",qo="[object Set]",Ho="[object String]",Ko="[object Symbol]",Jo="[object ArrayBuffer]",Zo="[object DataView]",ri="[object Float32Array]",ei="[object Float64Array]",ti="[object Int8Array]",ni="[object Int16Array]",oi="[object Int32Array]",ii="[object Uint8Array]",ai="[object Uint8ClampedArray]",fi="[object Uint16Array]",si="[object Uint32Array]";function ui(r,e,n){var o=r.constructor;switch(e){case Jo:return Y(r);case Uo:case Vo:return new o(+r);case Zo:return ye(r,n);case ri:case ei:case ti:case ni:case oi:case ii:case ai:case fi:case si:return dr(r,n);case Yo:return new o;case zo:case Ho:return new o(r);case Wo:return _e(r);case qo:return new o;case Ko:return Oe(r)}}var Le=ui;function di(r){return typeof r.constructor=="function"&&!as(r)?re(V(r)):{}}var cr=di;var ci="[object Map]";function pi(r){return un(r)&&ra(r)==ci}var Ie=pi;var Se=Do&&Do.isMap,li=Se?os(Se):Ie,Ne=li;var mi="[object Set]";function hi(r){return un(r)&&ra(r)==mi}var Pe=hi;var ke=Do&&Do.isSet,gi=ke?os(ke):Pe,Te=gi;var vi=1,bi=2,yi=4,Ce="[object Arguments]",wi="[object Array]",_i="[object Boolean]",Ei="[object Date]",xi="[object Error]",Ae="[object Function]",Oi="[object GeneratorFunction]",Li="[object Map]",Ii="[object Number]",Re="[object Object]",Si="[object RegExp]",Ni="[object Set]",Pi="[object String]",Ti="[object Symbol]",Ci="[object WeakMap]",Ai="[object ArrayBuffer]",Ri="[object DataView]",Mi="[object Float32Array]",ji="[object Float64Array]",Bi="[object Int8Array]",Di="[object Int16Array]",Fi="[object Int32Array]",Gi="[object Uint8Array]",Xi="[object Uint8ClampedArray]",Ui="[object Uint16Array]",Vi="[object Uint32Array]",x={};x[Ce]=x[wi]=x[Ai]=x[Ri]=x[_i]=x[Ei]=x[Mi]=x[ji]=x[Bi]=x[Di]=x[Fi]=x[Li]=x[Ii]=x[Re]=x[Si]=x[Ni]=x[Pi]=x[Ti]=x[Gi]=x[Xi]=x[Ui]=x[Vi]=!0;x[xi]=x[Ae]=x[Ci]=!1;function pr(r,e,n,o,i,a){var f,s=e&vi,u=e&bi,d=e&yi;if(n)f=i?n(r,o,i,a):n(r);if(f!==void 0)return f;if(!Mt(r))return r;var c=we(r);if(c){if(f=be(r),!s)return ar(r,f)}else{var p=ra(r),h=p==Ae||p==Oi;if(_a(r))return Z(r,s);if(p==Re||p==Ce||h&&!i){if(f=u||h?{}:cr(r),!s)return u?he(r,ue(f,r)):me(r,se(f,r))}else{if(!x[p])return i?r:{};f=Le(r,p,s)}}a||(a=new Qo);var b=a.get(r);if(b)return b;if(a.set(r,f),Te(r))r.forEach(function(g){f.add(pr(g,e,n,g,r,a))});else if(Ne(r))r.forEach(function(g,_){f.set(_,pr(g,e,n,_,r,a))});var w=d?u?ge:Bd:u?L:Xt,y=c?void 0:w(r);return Zp(y||r,function(g,_){if(y)_=g,g=r[_];M(f,_,pr(g,e,n,_,r,a))}),f}var Me=pr;var Yi=1,zi=4;function Wi(r){return Me(r,Yi|zi)}var je=Wi;var qi=function(){return Zt.Date.now()},wr=qi;var Be=Object.prototype,Hi=Be.hasOwnProperty,Ki=rs(function(r,e){r=Object(r);var n=-1,o=e.length,i=o>2?e[2]:void 0;if(i&&T(e[0],e[1],i))o=1;while(++n<o){var a=e[n],f=L(a),s=-1,u=f.length;while(++s<u){var d=f[s],c=r[d];if(c===void 0||Ia(c,Be[d])&&!Hi.call(r,d))r[d]=a[d]}}return r}),De=Ki;function Ji(r,e,n){if(n!==void 0&&!Ia(r[e],n)||n===void 0&&!(e in r))R(r,e,n)}var Q=Ji;function Zi(r,e){if(e==="constructor"&&typeof r[e]==="function")return;if(e=="__proto__")return;return r[e]}var er=Zi;function $i(r){return P(r,L(r))}var Fe=$i;function Qi(r,e,n,o,i,a,f){var s=er(r,n),u=er(e,n),d=f.get(u);if(d){Q(r,n,d);return}var c=a?a(s,u,n+"",r,e,f):void 0,p=c===void 0;if(p){var h=we(u),b=!h&&_a(u),w=!h&&!b&&is(u);if(c=u,h||b||w)if(we(s))c=s;else if(cm(s))c=ar(s);else if(b)p=!1,c=Z(u,!0);else if(w)p=!1,c=dr(u,!0);else c=[];else if(ae(u)||io(u)){if(c=s,io(s))c=Fe(s);else if(!Mt(s)||To(s))c=cr(u)}else p=!1}if(p)f.set(u,c),i(c,u,o,a,f),f.delete(u);Q(r,n,c)}var Ge=Qi;function Xe(r,e,n,o,i){if(r===e)return;xc(e,function(a,f){if(i||(i=new Qo),Mt(a))Ge(r,e,f,n,Xe,o,i);else{var s=o?o(er(r,f),a,f+"",r,e,i):void 0;if(s===void 0)s=a;Q(r,f,s)}},L)}var Ue=Xe;function ea(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var G=ea;function ta(r){return function(e,n,o){var i=Object(e);if(!Ln(e)){var a=rr(n,3);e=Xt(e),n=function(s){return a(i[s],s,i)}}var f=r(e,n,o);return f>-1?i[a?e[f]:f]:void 0}}var Ve=ta;var oa=Math.max;function ia(r,e,n){var o=r==null?0:r.length;if(!o)return-1;var i=n==null?0:$r(n);if(i<0)i=oa(o+i,0);return Xp(r,rr(e,3),i)}var Ye=ia;var fa=Ve(Ye),tr=fa;function sa(r,e){var n=-1,o=Ln(r)?Array(r.length):[];return cs(r,function(i,a,f){o[++n]=e(i,a,f)}),o}var lr=sa;function da(r,e){var n=we(r)?So:lr;return n(r,rr(e,3))}var E=da;function ca(r,e){return r==null?r:xc(r,wc(e),L)}var ze=ca;function pa(r,e){return r&&kc(r,wc(e))}var We=pa;function la(r,e){return r>e}var qe=la;var ma=Object.prototype,ha=ma.hasOwnProperty;function ga(r,e){return r!=null&&ha.call(r,e)}var He=ga;function va(r,e){return r!=null&&im(r,e,He)}var mr=va;var ba="[object String]";function ya(r){return typeof r=="string"||!we(r)&&un(r)&&Ar(r)==ba}var Ke=ya;function wa(r,e){return r<e}var gr=wa;function Ea(r,e){var n={};return e=rr(e,3),kc(r,function(o,i,a){R(n,i,e(o,i,a))}),n}var z=Ea;function xa(r,e,n){var o=-1,i=r.length;while(++o<i){var a=r[o],f=e(a);if(f!=null&&(s===void 0?f===f&&!na(f):n(f,s)))var s=f,u=a}return u}var W=xa;function Oa(r){return r&&r.length?W(r,Lr,qe):void 0}var I=Oa;var La=ee(function(r,e,n){Ue(r,e,n)}),nr=La;function Sa(r){return r&&r.length?W(r,Lr,gr):void 0}var j=Sa;function Pa(r,e){return r&&r.length?W(r,rr(e,2),gr):void 0}var q=Pa;function ka(r,e,n,o){if(!Mt(r))return r;e=ss(e,r);var i=-1,a=e.length,f=a-1,s=r;while(s!=null&&++i<a){var u=No(e[i]),d=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return r;if(i!=f){var c=s[u];if(d=o?o(c,u,s):void 0,d===void 0)d=Mt(c)?c:ns(e[i+1])?[]:{}}M(s,u,d),s=s[u]}return r}var Je=ka;function Ta(r,e,n){var o=-1,i=e.length,a={};while(++o<i){var f=e[o],s=ls(r,f);if(n(s,f))Je(a,ss(f,r),s)}return a}var Ze=Ta;function Ca(r,e){var n=r.length;r.sort(e);while(n--)r[n]=r[n].value;return r}var $e=Ca;function Aa(r,e){if(r!==e){var n=r!==void 0,o=r===null,i=r===r,a=na(r),f=e!==void 0,s=e===null,u=e===e,d=na(e);if(!s&&!d&&!a&&r>e||a&&f&&u&&!s&&!d||o&&f&&u||!n&&u||!i)return 1;if(!o&&!a&&!d&&r<e||d&&n&&i&&!o&&!a||s&&n&&i||!f&&i||!u)return-1}return 0}var Qe=Aa;function Ma(r,e,n){var o=-1,i=r.criteria,a=e.criteria,f=i.length,s=n.length;while(++o<f){var u=Qe(i[o],a[o]);if(u){if(o>=s)return u;var d=n[o];return u*(d=="desc"?-1:1)}}return r.index-e.index}var rt=Ma;function ja(r,e,n){if(e.length)e=So(e,function(a){if(we(a))return function(f){return ls(f,a.length===1?a[0]:a)};return a});else e=[Lr];var o=-1;e=So(e,os(rr));var i=lr(r,function(a,f,s){var u=So(e,function(d){return d(a)});return{criteria:u,index:++o,value:a}});return $e(i,function(a,f){return rt(a,f,n)})}var et=ja;var Ba=lm("length"),tt=Ba;var it="\\ud800-\\udfff",Da="\\u0300-\\u036f",Fa="\\ufe20-\\ufe2f",Ga="\\u20d0-\\u20ff",Xa=Da+Fa+Ga,Ua="\\ufe0e\\ufe0f",Va="["+it+"]",_r="["+Xa+"]",Er="\\ud83c[\\udffb-\\udfff]",Ya="(?:"+_r+"|"+Er+")",at="[^"+it+"]",ft="(?:\\ud83c[\\udde6-\\uddff]){2}",st="[\\ud800-\\udbff][\\udc00-\\udfff]",za="\\u200d",ut=Ya+"?",dt="["+Ua+"]?",Wa="(?:"+za+"(?:"+[at,ft,st].join("|")+")"+dt+ut+")*",qa=dt+ut+Wa,Ha="(?:"+[at+_r+"?",_r,ft,st,Va].join("|")+")",ot=RegExp(Er+"(?="+Er+")|"+Ha+qa,"g");function Ka(r){var e=ot.lastIndex=0;while(ot.test(r))++e;return e}var ct=Ka;function Ja(r){return fe(r)?ct(r):tt(r)}var pt=Ja;function Za(r,e){return Ze(r,e,function(n,o){return sm(r,o)})}var lt=Za;var $a=oe(function(r,e){return r==null?{}:lt(r,e)}),H=$a;var{ceil:Qa,max:rf}=Math;function ef(r,e,n,o){var i=-1,a=rf(Qa((e-r)/(n||1)),0),f=Array(a);while(a--)f[o?a:++i]=r,r+=n;return f}var mt=ef;function tf(r){return function(e,n,o){if(o&&typeof o!="number"&&T(e,n,o))n=o=void 0;if(e=U(e),n===void 0)n=e,e=0;else n=U(n);return o=o===void 0?e<n?1:-1:U(o),mt(e,n,o,r)}}var ht=tf;var nf=ht(),N=nf;var of="[object Map]",af="[object Set]";function ff(r){if(r==null)return 0;if(Ln(r))return Ke(r)?pt(r):r.length;var e=ra(r);if(e==of||e==af)return r.size;return Ac(r).length}var gt=ff;var sf=rs(function(r,e){if(r==null)return[];var n=e.length;if(n>1&&T(r,e[0],e[1]))e=[];else if(n>2&&T(e[0],e[1],e[2]))e=[e[0]];return et(r,bc(e,1),[])}),C=sf;var uf=0;function df(r){var e=++uf;return rm(r)+e}var J=df;function cf(r,e,n){var o=-1,i=r.length,a=e.length,f={};while(++o<i){var s=o<a?e[o]:void 0;n(f,r[o],s)}return f}var vt=cf;function pf(r,e){return vt(r||[],e||[],M)}var xr=pf;class Or{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return bt(e),e}enqueue(r){var e=this._sentinel;if(r._prev&&r._next)bt(r);r._next=e._next,e._next._prev=r,e._next=r,r._prev=e}toString(){var r=[],e=this._sentinel,n=e._prev;while(n!==e)r.push(JSON.stringify(n,lf)),n=n._prev;return"["+r.join(", ")+"]"}}function bt(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function lf(r,e){if(r!=="_next"&&r!=="_prev")return e}var mf=Mr(1);function yt(r,e){if(r.nodeCount()<=1)return[];var n=gf(r,e||mf),o=hf(n.graph,n.buckets,n.zeroIdx);return S(E(o,function(i){return r.outEdges(i.v,i.w)}))}function hf(r,e,n){var o=[],i=e[e.length-1],a=e[0],f;while(r.nodeCount()){while(f=a.dequeue())Ir(r,e,n,f);while(f=i.dequeue())Ir(r,e,n,f);if(r.nodeCount()){for(var s=e.length-2;s>0;--s)if(f=e[s].dequeue(),f){o=o.concat(Ir(r,e,n,f,!0));break}}}return o}function Ir(r,e,n,o,i){var a=i?[]:void 0;return v(r.inEdges(o.v),function(f){var s=r.edge(f),u=r.node(f.v);if(i)a.push({v:f.v,w:f.w});u.out-=s,Sr(e,n,u)}),v(r.outEdges(o.v),function(f){var s=r.edge(f),u=f.w,d=r.node(u);d.in-=s,Sr(e,n,d)}),r.removeNode(o.v),a}function gf(r,e){var n=new nt,o=0,i=0;v(r.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),v(r.edges(),function(s){var u=n.edge(s.v,s.w)||0,d=e(s),c=u+d;n.setEdge(s.v,s.w,c),i=Math.max(i,n.node(s.v).out+=d),o=Math.max(o,n.node(s.w).in+=d)});var a=N(i+o+3).map(function(){return new Or}),f=o+1;return v(n.nodes(),function(s){Sr(a,f,n.node(s))}),{graph:n,buckets:a,zeroIdx:f}}function Sr(r,e,n){if(!n.out)r[0].enqueue(n);else if(!n.in)r[r.length-1].enqueue(n);else r[n.out-n.in+e].enqueue(n)}function wt(r){var e=r.graph().acyclicer==="greedy"?yt(r,n(r)):vf(r);v(e,function(o){var i=r.edge(o);r.removeEdge(o),i.forwardName=o.name,i.reversed=!0,r.setEdge(o.w,o.v,i,J("rev"))});function n(o){return function(i){return o.edge(i).weight}}}function vf(r){var e=[],n={},o={};function i(a){if(Object.prototype.hasOwnProperty.call(o,a))return;o[a]=!0,n[a]=!0,v(r.outEdges(a),function(f){if(Object.prototype.hasOwnProperty.call(n,f.w))e.push(f);else i(f.w)}),delete n[a]}return v(r.nodes(),i),e}function _t(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed){r.removeEdge(e);var o=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(e.w,e.v,n,o)}})}function k(r,e,n,o){var i;do i=J(o);while(r.hasNode(i));return n.dummy=e,r.setNode(i,n),i}function xt(r){var e=new nt().setGraph(r.graph());return v(r.nodes(),function(n){e.setNode(n,r.node(n))}),v(r.edges(),function(n){var o=e.edge(n.v,n.w)||{weight:0,minlen:1},i=r.edge(n);e.setEdge(n.v,n.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),e}function vr(r){var e=new nt({multigraph:r.isMultigraph()}).setGraph(r.graph());return v(r.nodes(),function(n){if(!r.children(n).length)e.setNode(n,r.node(n))}),v(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}function Nr(r,e){var{x:n,y:o}=r,i=e.x-n,a=e.y-o,f=r.width/2,s=r.height/2;if(!i&&!a)throw Error("Not possible to find intersection inside of the rectangle");var u,d;if(Math.abs(a)*f>Math.abs(i)*s){if(a<0)s=-s;u=s*i/a,d=s}else{if(i<0)f=-f;u=f,d=f*a/i}return{x:n+u,y:o+d}}function B(r){var e=E(N(kr(r)+1),function(){return[]});return v(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!en(i))e[i][o.order]=n}),e}function Ot(r){var e=j(E(r.nodes(),function(n){return r.node(n).rank}));v(r.nodes(),function(n){var o=r.node(n);if(mr(o,"rank"))o.rank-=e})}function Lt(r){var e=j(E(r.nodes(),function(a){return r.node(a).rank})),n=[];v(r.nodes(),function(a){var f=r.node(a).rank-e;if(!n[f])n[f]=[];n[f].push(a)});var o=0,i=r.graph().nodeRankFactor;v(n,function(a,f){if(en(a)&&f%i!==0)--o;else if(o)v(a,function(s){r.node(s).rank+=o})})}function Pr(r,e,n,o){var i={width:0,height:0};if(arguments.length>=4)i.rank=n,i.order=o;return k(r,"border",i,e)}function kr(r){return I(E(r.nodes(),function(e){var n=r.node(e).rank;if(!en(n))return n}))}function It(r,e){var n={lhs:[],rhs:[]};return v(r,function(o){if(e(o))n.lhs.push(o);else n.rhs.push(o)}),n}function St(r,e){var n=wr();try{return e()}finally{console.log(r+" time: "+(wr()-n)+"ms")}}function Nt(r,e){return e()}function kt(r){function e(n){var o=r.children(n),i=r.node(n);if(o.length)v(o,e);if(Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,f=i.maxRank+1;a<f;++a)Pt(r,"borderLeft","_bl",n,i,a),Pt(r,"borderRight","_br",n,i,a)}}v(r.children(),e)}function Pt(r,e,n,o,i,a){var f={width:0,height:0,rank:a,borderType:e},s=i[e][a-1],u=k(r,"border",f,n);if(i[e][a]=u,r.setParent(u,o),s)r.setEdge(s,u,{weight:1})}function Ct(r){var e=r.graph().rankdir.toLowerCase();if(e==="lr"||e==="rl")Rt(r)}function At(r){var e=r.graph().rankdir.toLowerCase();if(e==="bt"||e==="rl")bf(r);if(e==="lr"||e==="rl")yf(r),Rt(r)}function Rt(r){v(r.nodes(),function(e){Tt(r.node(e))}),v(r.edges(),function(e){Tt(r.edge(e))})}function Tt(r){var e=r.width;r.width=r.height,r.height=e}function bf(r){v(r.nodes(),function(e){Tr(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Tr),Object.prototype.hasOwnProperty.call(n,"y"))Tr(n)})}function Tr(r){r.y=-r.y}function yf(r){v(r.nodes(),function(e){Cr(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Cr),Object.prototype.hasOwnProperty.call(n,"x"))Cr(n)})}function Cr(r){var e=r.x;r.x=r.y,r.y=e}function jt(r){r.graph().dummyChains=[],v(r.edges(),function(e){_f(r,e)})}function _f(r,e){var n=e.v,o=r.node(n).rank,i=e.w,a=r.node(i).rank,f=e.name,s=r.edge(e),u=s.labelRank;if(a===o+1)return;r.removeEdge(e);var d=void 0,c,p;for(p=0,++o;o<a;++p,++o){if(s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:o},c=k(r,"edge",d,"_d"),o===u)d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos;if(r.setEdge(n,c,{weight:s.weight},f),p===0)r.graph().dummyChains.push(c);n=c}r.setEdge(n,i,{weight:s.weight},f)}function Bt(r){v(r.graph().dummyChains,function(e){var n=r.node(e),o=n.edgeLabel,i;r.setEdge(n.edgeObj,o);while(n.dummy){if(i=r.successors(e)[0],r.removeNode(e),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label")o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height;e=i,n=r.node(e)}})}function or(r){var e={};function n(o){var i=r.node(o);if(Object.prototype.hasOwnProperty.call(e,o))return i.rank;e[o]=!0;var a=j(E(r.outEdges(o),function(f){return n(f.w)-r.edge(f).minlen}));if(a===Number.POSITIVE_INFINITY||a===void 0||a===null)a=0;return i.rank=a}v(r.sources(),n)}function X(r,e){return r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen}function br(r){var e=new nt({directed:!1}),n=r.nodes()[0],o=r.nodeCount();e.setNode(n,{});var i,a;while(Ef(e,r)<o)i=xf(e,r),a=e.hasNode(i.v)?X(r,i):-X(r,i),Of(e,r,a);return e}function Ef(r,e){function n(o){v(e.nodeEdges(o),function(i){var a=i.v,f=o===a?i.w:a;if(!r.hasNode(f)&&!X(e,i))r.setNode(f,{}),r.setEdge(o,f,{}),n(f)})}return v(r.nodes(),n),r.nodeCount()}function xf(r,e){return q(e.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return X(e,n)})}function Of(r,e,n){v(r.nodes(),function(o){e.node(o).rank+=n})}var fh=Mr(1);var mh=Mr(1);Rr.CycleException=ir;function Rr(r){var e={},n={},o=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new ir;if(!Object.prototype.hasOwnProperty.call(e,a))n[a]=!0,e[a]=!0,v(r.predecessors(a),i),delete n[a],o.push(a)}if(v(r.sinks(),i),gt(e)!==r.nodeCount())throw new ir;return o}function ir(){}ir.prototype=Error();function yr(r,e,n){if(!we(e))e=[e];var o=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],a={};return v(e,function(f){if(!r.hasNode(f))throw Error("Graph does not have node: "+f);Ft(r,f,n==="post",a,o,i)}),i}function Ft(r,e,n,o,i,a){if(!Object.prototype.hasOwnProperty.call(o,e)){if(o[e]=!0,!n)a.push(e);if(v(i(e),function(f){Ft(r,f,n,o,i,a)}),n)a.push(e)}}function jr(r,e){return yr(r,e,"post")}function Br(r,e){return yr(r,e,"pre")}F.initLowLimValues=Fr;F.initCutValues=Dr;F.calcCutValue=Ut;F.leaveEdge=Yt;F.enterEdge=zt;F.exchangeEdges=Wt;function F(r){r=xt(r),or(r);var e=br(r);Fr(e),Dr(e,r);var n,o;while(n=Yt(e))o=zt(e,r,n),Wt(e,r,n,o)}function Dr(r,e){var n=jr(r,r.nodes());n=n.slice(0,n.length-1),v(n,function(o){Pf(r,e,o)})}function Pf(r,e,n){var o=r.node(n),i=o.parent;r.edge(n,i).cutvalue=Ut(r,e,n)}function Ut(r,e,n){var o=r.node(n),i=o.parent,a=!0,f=e.edge(n,i),s=0;if(!f)a=!1,f=e.edge(i,n);return s=f.weight,v(e.nodeEdges(n),function(u){var d=u.v===n,c=d?u.w:u.v;if(c!==i){var p=d===a,h=e.edge(u).weight;if(s+=p?h:-h,Tf(r,n,c)){var b=r.edge(n,c).cutvalue;s+=p?-b:b}}}),s}function Fr(r,e){if(arguments.length<2)e=r.nodes()[0];Vt(r,{},1,e)}function Vt(r,e,n,o,i){var a=n,f=r.node(o);if(e[o]=!0,v(r.neighbors(o),function(s){if(!Object.prototype.hasOwnProperty.call(e,s))n=Vt(r,e,n,s,o)}),f.low=a,f.lim=n++,i)f.parent=i;else delete f.parent;return n}function Yt(r){return tr(r.edges(),function(e){return r.edge(e).cutvalue<0})}function zt(r,e,n){var{v:o,w:i}=n;if(!e.hasEdge(o,i))o=n.w,i=n.v;var a=r.node(o),f=r.node(i),s=a,u=!1;if(a.lim>f.lim)s=f,u=!0;var d=hr(e.edges(),function(c){return u===Gt(r,r.node(c.v),s)&&u!==Gt(r,r.node(c.w),s)});return q(d,function(c){return X(e,c)})}function Wt(r,e,n,o){var{v:i,w:a}=n;r.removeEdge(i,a),r.setEdge(o.v,o.w,{}),Fr(r),Dr(r,e),kf(r,e)}function kf(r,e){var n=tr(r.nodes(),function(i){return!e.node(i).parent}),o=Br(r,n);o=o.slice(1),v(o,function(i){var a=r.node(i).parent,f=e.edge(i,a),s=!1;if(!f)f=e.edge(a,i),s=!0;e.node(i).rank=e.node(a).rank+(s?f.minlen:-f.minlen)})}function Tf(r,e,n){return r.hasEdge(e,n)}function Gt(r,e,n){return n.low<=e.lim&&e.lim<=n.lim}function Gr(r){switch(r.graph().ranker){case"network-simplex":qt(r);break;case"tight-tree":Af(r);break;case"longest-path":Cf(r);break;default:qt(r)}}var Cf=or;function Af(r){or(r),br(r)}function qt(r){F(r)}function Ht(r){var e=k(r,"root",{},"_root"),n=Rf(r),o=I(aa(n))-1,i=2*o+1;r.graph().nestingRoot=e,v(r.edges(),function(f){r.edge(f).minlen*=i});var a=Mf(r)+1;v(r.children(),function(f){Kt(r,e,i,a,o,n,f)}),r.graph().nodeRankFactor=i}function Kt(r,e,n,o,i,a,f){var s=r.children(f);if(!s.length){if(f!==e)r.setEdge(e,f,{weight:0,minlen:n});return}var u=Pr(r,"_bt"),d=Pr(r,"_bb"),c=r.node(f);if(r.setParent(u,f),c.borderTop=u,r.setParent(d,f),c.borderBottom=d,v(s,function(p){Kt(r,e,n,o,i,a,p);var h=r.node(p),b=h.borderTop?h.borderTop:p,w=h.borderBottom?h.borderBottom:p,y=h.borderTop?o:2*o,g=b!==w?1:i-a[f]+1;r.setEdge(u,b,{weight:y,minlen:g,nestingEdge:!0}),r.setEdge(w,d,{weight:y,minlen:g,nestingEdge:!0})}),!r.parent(f))r.setEdge(e,u,{weight:0,minlen:i+a[f]})}function Rf(r){var e={};function n(o,i){var a=r.children(o);if(a&&a.length)v(a,function(f){n(f,i+1)});e[o]=i}return v(r.children(),function(o){n(o,1)}),e}function Mf(r){return Ro(r.edges(),function(e,n){return e+r.edge(n).weight},0)}function Jt(r){var e=r.graph();r.removeNode(e.nestingRoot),delete e.nestingRoot,v(r.edges(),function(n){var o=r.edge(n);if(o.nestingEdge)r.removeEdge(n)})}function $t(r,e,n){var o={},i;v(n,function(a){var f=r.parent(a),s,u;while(f){if(s=r.parent(f),s)u=o[s],o[s]=f;else u=i,i=f;if(u&&u!==f){e.setEdge(u,f);return}f=s}})}function Qt(r,e,n){var o=Bf(r),i=new nt({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(a){return r.node(a)});return v(r.nodes(),function(a){var f=r.node(a),s=r.parent(a);if(f.rank===e||f.minRank<=e&&e<=f.maxRank){if(i.setNode(a),i.setParent(a,s||o),v(r[n](a),function(u){var d=u.v===a?u.w:u.v,c=i.edge(d,a),p=!en(c)?c.weight:0;i.setEdge(d,a,{weight:r.edge(u).weight+p})}),Object.prototype.hasOwnProperty.call(f,"minRank"))i.setNode(a,{borderLeft:f.borderLeft[e],borderRight:f.borderRight[e]})}}),i}function Bf(r){var e;while(r.hasNode(e=J("_root")));return e}function rn(r,e){var n=0;for(var o=1;o<e.length;++o)n+=Df(r,e[o-1],e[o]);return n}function Df(r,e,n){var o=xr(n,E(n,function(d,c){return c})),i=S(E(e,function(d){return C(E(r.outEdges(d),function(c){return{pos:o[c.w],weight:r.edge(c).weight}}),"pos")})),a=1;while(a<n.length)a<<=1;var f=2*a-1;a-=1;var s=E(Array(f),function(){return 0}),u=0;return v(i.forEach(function(d){var c=d.pos+a;s[c]+=d.weight;var p=0;while(c>0){if(c%2)p+=s[c+1];c=c-1>>1,s[c]+=d.weight}u+=d.weight*p})),u}function tn(r){var e={},n=hr(r.nodes(),function(s){return!r.children(s).length}),o=I(E(n,function(s){return r.node(s).rank})),i=E(N(o+1),function(){return[]});function a(s){if(mr(e,s))return;e[s]=!0;var u=r.node(s);i[u.rank].push(s),v(r.successors(s),a)}var f=C(n,function(s){return r.node(s).rank});return v(f,a),i}function nn(r,e){return E(e,function(n){var o=r.inEdges(n);if(!o.length)return{v:n};else{var i=Ro(o,function(a,f){var s=r.edge(f),u=r.node(f.v);return{sum:a.sum+s.weight*u.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function on(r,e){var n={};v(r,function(i,a){var f=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};if(!en(i.barycenter))f.barycenter=i.barycenter,f.weight=i.weight}),v(e.edges(),function(i){var a=n[i.v],f=n[i.w];if(!en(a)&&!en(f))f.indegree++,a.out.push(n[i.w])});var o=hr(n,function(i){return!i.indegree});return Ff(o)}function Ff(r){var e=[];function n(a){return function(f){if(f.merged)return;if(en(f.barycenter)||en(a.barycenter)||f.barycenter>=a.barycenter)Gf(a,f)}}function o(a){return function(f){if(f.in.push(a),--f.indegree===0)r.push(f)}}while(r.length){var i=r.pop();e.push(i),v(i.in.reverse(),n(i)),v(i.out,o(i))}return E(hr(e,function(a){return!a.merged}),function(a){return H(a,["vs","i","barycenter","weight"])})}function Gf(r,e){var n=0,o=0;if(r.weight)n+=r.barycenter*r.weight,o+=r.weight;if(e.weight)n+=e.barycenter*e.weight,o+=e.weight;r.vs=e.vs.concat(r.vs),r.barycenter=n/o,r.weight=o,r.i=Math.min(e.i,r.i),e.merged=!0}function fn(r,e){var n=It(r,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),o=n.lhs,i=C(n.rhs,function(c){return-c.i}),a=[],f=0,s=0,u=0;o.sort(Xf(!!e)),u=an(a,i,u),v(o,function(c){u+=c.vs.length,a.push(c.vs),f+=c.barycenter*c.weight,s+=c.weight,u=an(a,i,u)});var d={vs:S(a)};if(s)d.barycenter=f/s,d.weight=s;return d}function an(r,e,n){var o;while(e.length&&(o=G(e)).i<=n)e.pop(),r.push(o.vs),n++;return n}function Xf(r){return function(e,n){if(e.barycenter<n.barycenter)return-1;else if(e.barycenter>n.barycenter)return 1;return!r?e.i-n.i:n.i-e.i}}function Xr(r,e,n,o){var i=r.children(e),a=r.node(e),f=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,u={};if(f)i=hr(i,function(w){return w!==f&&w!==s});var d=nn(r,i);v(d,function(w){if(r.children(w.v).length){var y=Xr(r,w.v,n,o);if(u[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Vf(w,y)}});var c=on(d,n);Uf(c,u);var p=fn(c,o);if(f){if(p.vs=S([f,p.vs,s]),r.predecessors(f).length){var h=r.node(r.predecessors(f)[0]),b=r.node(r.predecessors(s)[0]);if(!Object.prototype.hasOwnProperty.call(p,"barycenter"))p.barycenter=0,p.weight=0;p.barycenter=(p.barycenter*p.weight+h.order+b.order)/(p.weight+2),p.weight+=2}}return p}function Uf(r,e){v(r,function(n){n.vs=S(n.vs.map(function(o){if(e[o])return e[o].vs;return o}))})}function Vf(r,e){if(!en(r.barycenter))r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight;else r.barycenter=e.barycenter,r.weight=e.weight}function cn(r){var e=kr(r),n=sn(r,N(1,e+1),"inEdges"),o=sn(r,N(e-1,-1,-1),"outEdges"),i=tn(r);dn(r,i);var a=Number.POSITIVE_INFINITY,f;for(var s=0,u=0;u<4;++s,++u){Yf(s%2?n:o,s%4>=2),i=B(r);var d=rn(r,i);if(d<a)u=0,f=je(i),a=d}dn(r,f)}function sn(r,e,n){return E(e,function(o){return Qt(r,o,n)})}function Yf(r,e){var n=new nt;v(r,function(o){var i=o.graph().root,a=Xr(o,i,n,e);v(a.vs,function(f,s){o.node(f).order=s}),$t(o,n,a.vs)})}function dn(r,e){v(e,function(n){v(n,function(o,i){r.node(o).order=i})})}function pn(r){var e=Wf(r);v(r.graph().dummyChains,function(n){var o=r.node(n),i=o.edgeObj,a=zf(r,e,i.v,i.w),{path:f,lca:s}=a,u=0,d=f[u],c=!0;while(n!==i.w){if(o=r.node(n),c){while((d=f[u])!==s&&r.node(d).maxRank<o.rank)u++;if(d===s)c=!1}if(!c){while(u<f.length-1&&r.node(d=f[u+1]).minRank<=o.rank)u++;d=f[u]}r.setParent(n,d),n=r.successors(n)[0]}})}function zf(r,e,n,o){var i=[],a=[],f=Math.min(e[n].low,e[o].low),s=Math.max(e[n].lim,e[o].lim),u,d;u=n;do u=r.parent(u),i.push(u);while(u&&(e[u].low>f||s>e[u].lim));d=u,u=o;while((u=r.parent(u))!==d)a.push(u);return{path:i.concat(a.reverse()),lca:d}}function Wf(r){var e={},n=0;function o(i){var a=n;v(r.children(i),o),e[i]={low:a,lim:n++}}return v(r.children(),o),e}function qf(r,e){var n={};function o(i,a){var f=0,s=0,u=i.length,d=G(a);return v(a,function(c,p){var h=Kf(r,c),b=h?r.node(h).order:u;if(h||c===d)v(a.slice(s,p+1),function(w){v(r.predecessors(w),function(y){var g=r.node(y),_=g.order;if((_<f||b<_)&&!(g.dummy&&r.node(w).dummy))ln(n,y,w)})}),s=p+1,f=b}),a}return Ro(e,o),n}function Hf(r,e){var n={};function o(a,f,s,u,d){var c;v(N(f,s),function(p){if(c=a[p],r.node(c).dummy)v(r.predecessors(c),function(h){var b=r.node(h);if(b.dummy&&(b.order<u||b.order>d))ln(n,h,c)})})}function i(a,f){var s=-1,u,d=0;return v(f,function(c,p){if(r.node(c).dummy==="border"){var h=r.predecessors(c);if(h.length)u=r.node(h[0]).order,o(f,d,p,s,u),d=p,s=u}o(f,d,f.length,u,a.length)}),f}return Ro(e,i),n}function Kf(r,e){if(r.node(e).dummy)return tr(r.predecessors(e),function(n){return r.node(n).dummy})}function ln(r,e,n){if(e>n){var o=e;e=n,n=o}if(!Object.prototype.hasOwnProperty.call(r,e))Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=r[e];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Jf(r,e,n){if(e>n){var o=e;e=n,n=o}return!!r[e]&&Object.prototype.hasOwnProperty.call(r[e],n)}function Zf(r,e,n,o){var i={},a={},f={};return v(e,function(s){v(s,function(u,d){i[u]=u,a[u]=u,f[u]=d})}),v(e,function(s){var u=-1;v(s,function(d){var c=o(d);if(c.length){c=C(c,function(y){return f[y]});var p=(c.length-1)/2;for(var h=Math.floor(p),b=Math.ceil(p);h<=b;++h){var w=c[h];if(a[d]===d&&u<f[w]&&!Jf(n,d,w))a[w]=d,a[d]=i[d]=i[w],u=f[w]}}})}),{root:i,align:a}}function $f(r,e,n,o,i){var a={},f=Qf(r,e,n,i),s=i?"borderLeft":"borderRight";function u(p,h){var b=f.nodes(),w=b.pop(),y={};while(w){if(y[w])p(w);else y[w]=!0,b.push(w),b=b.concat(h(w));w=b.pop()}}function d(p){a[p]=f.inEdges(p).reduce(function(h,b){return Math.max(h,a[b.v]+f.edge(b))},0)}function c(p){var h=f.outEdges(p).reduce(function(w,y){return Math.min(w,a[y.w]-f.edge(y))},Number.POSITIVE_INFINITY),b=r.node(p);if(h!==Number.POSITIVE_INFINITY&&b.borderType!==s)a[p]=Math.max(a[p],h)}return u(d,f.predecessors.bind(f)),u(c,f.successors.bind(f)),v(o,function(p){a[p]=a[n[p]]}),a}function Qf(r,e,n,o){var i=new nt,a=r.graph(),f=us(a.nodesep,a.edgesep,o);return v(e,function(s){var u;v(s,function(d){var c=n[d];if(i.setNode(c),u){var p=n[u],h=i.edge(p,c);i.setEdge(p,c,Math.max(f(r,d,u),h||0))}u=d})}),i}function es(r,e){return q(aa(e),function(n){var{NEGATIVE_INFINITY:o,POSITIVE_INFINITY:i}=Number;return ze(n,function(a,f){var s=ds(r,f)/2;o=Math.max(a+s,o),i=Math.min(a-s,i)}),o-i})}function ts(r,e){var n=aa(e),o=j(n),i=I(n);v(["u","d"],function(a){v(["l","r"],function(f){var s=a+f,u=r[s],d;if(u===e)return;var c=aa(u);if(d=f==="l"?o-j(c):i-I(c),d)r[s]=z(u,function(p){return p+d})})})}function fs(r,e){return z(r.ul,function(n,o){if(e)return r[e.toLowerCase()][o];else{var i=C(E(r,o));return(i[1]+i[2])/2}})}function mn(r){var e=B(r),n=nr(qf(r,e),Hf(r,e)),o={},i;v(["u","d"],function(f){i=f==="u"?e:aa(e).reverse(),v(["l","r"],function(s){if(s==="r")i=E(i,function(p){return aa(p).reverse()});var u=(f==="u"?r.predecessors:r.successors).bind(r),d=Zf(r,i,n,u),c=$f(r,i,d.root,d.align,s==="r");if(s==="r")c=z(c,function(p){return-p});o[f+s]=c})});var a=es(r,o);return ts(o,a),fs(o,r.graph().align)}function us(r,e,n){return function(o,i,a){var f=o.node(i),s=o.node(a),u=0,d;if(u+=f.width/2,Object.prototype.hasOwnProperty.call(f,"labelpos"))switch(f.labelpos.toLowerCase()){case"l":d=-f.width/2;break;case"r":d=f.width/2;break}if(d)u+=n?d:-d;if(d=0,u+=(f.dummy?e:r)/2,u+=(s.dummy?e:r)/2,u+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=s.width/2;break;case"r":d=-s.width/2;break}if(d)u+=n?d:-d;return d=0,u}}function ds(r,e){return r.node(e).width}function hn(r){r=vr(r),ps(r),We(mn(r),function(e,n){r.node(n).x=e})}function ps(r){var e=B(r),n=r.graph().ranksep,o=0;v(e,function(i){var a=I(E(i,function(f){return r.node(f).height}));v(i,function(f){r.node(f).y=o+a/2}),o+=a+n})}function Yr(r,e){var n=e&&e.debugTiming?St:Nt;n("layout",()=>{var o=n(" buildLayoutGraph",()=>Os(r));n(" runLayout",()=>ms(o,n)),n(" updateInputGraph",()=>hs(r,o))})}function ms(r,e){e(" makeSpaceForEdgeLabels",()=>Ls(r)),e(" removeSelfEdges",()=>Rs(r)),e(" acyclic",()=>wt(r)),e(" nestingGraph.run",()=>Ht(r)),e(" rank",()=>Gr(vr(r))),e(" injectEdgeLabelProxies",()=>Is(r)),e(" removeEmptyRanks",()=>Lt(r)),e(" nestingGraph.cleanup",()=>Jt(r)),e(" normalizeRanks",()=>Ot(r)),e(" assignRankMinMax",()=>Ss(r)),e(" removeEdgeLabelProxies",()=>Ns(r)),e(" normalize.run",()=>jt(r)),e(" parentDummyChains",()=>pn(r)),e(" addBorderSegments",()=>kt(r)),e(" order",()=>cn(r)),e(" insertSelfEdges",()=>Ms(r)),e(" adjustCoordinateSystem",()=>Ct(r)),e(" position",()=>hn(r)),e(" positionSelfEdges",()=>js(r)),e(" removeBorderNodes",()=>As(r)),e(" normalize.undo",()=>Bt(r)),e(" fixupEdgeLabelCoords",()=>Ts(r)),e(" undoCoordinateSystem",()=>At(r)),e(" translateGraph",()=>Ps(r)),e(" assignNodeIntersects",()=>ks(r)),e(" reversePoints",()=>Cs(r)),e(" acyclic.undo",()=>_t(r))}function hs(r,e){v(r.nodes(),function(n){var o=r.node(n),i=e.node(n);if(o){if(o.x=i.x,o.y=i.y,e.children(n).length)o.width=i.width,o.height=i.height}}),v(r.edges(),function(n){var o=r.edge(n),i=e.edge(n);if(o.points=i.points,Object.prototype.hasOwnProperty.call(i,"x"))o.x=i.x,o.y=i.y}),r.graph().width=e.graph().width,r.graph().height=e.graph().height}var gs=["nodesep","edgesep","ranksep","marginx","marginy"],vs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},bs=["acyclicer","ranker","rankdir","align"],ys=["width","height"],ws={width:0,height:0},_s=["minlen","weight","width","height","labeloffset"],Es={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xs=["labelpos"];function Os(r){var e=new nt({multigraph:!0,compound:!0}),n=Vr(r.graph());return e.setGraph(nr({},vs,Ur(n,gs),H(n,bs))),v(r.nodes(),function(o){var i=Vr(r.node(o));e.setNode(o,De(Ur(i,ys),ws)),e.setParent(o,r.parent(o))}),v(r.edges(),function(o){var i=Vr(r.edge(o));e.setEdge(o,nr({},Es,Ur(i,_s),H(i,xs)))}),e}function Ls(r){var e=r.graph();e.ranksep/=2,v(r.edges(),function(n){var o=r.edge(n);if(o.minlen*=2,o.labelpos.toLowerCase()!=="c")if(e.rankdir==="TB"||e.rankdir==="BT")o.width+=o.labeloffset;else o.height+=o.labeloffset})}function Is(r){v(r.edges(),function(e){var n=r.edge(e);if(n.width&&n.height){var o=r.node(e.v),i=r.node(e.w),a={rank:(i.rank-o.rank)/2+o.rank,e};k(r,"edge-proxy",a,"_ep")}})}function Ss(r){var e=0;v(r.nodes(),function(n){var o=r.node(n);if(o.borderTop)o.minRank=r.node(o.borderTop).rank,o.maxRank=r.node(o.borderBottom).rank,e=I(e,o.maxRank)}),r.graph().maxRank=e}function Ns(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="edge-proxy")r.edge(n.e).labelRank=n.rank,r.removeNode(e)})}function Ps(r){var e=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,a=r.graph(),f=a.marginx||0,s=a.marginy||0;function u(d){var{x:c,y:p,width:h,height:b}=d;e=Math.min(e,c-h/2),n=Math.max(n,c+h/2),o=Math.min(o,p-b/2),i=Math.max(i,p+b/2)}v(r.nodes(),function(d){u(r.node(d))}),v(r.edges(),function(d){var c=r.edge(d);if(Object.prototype.hasOwnProperty.call(c,"x"))u(c)}),e-=f,o-=s,v(r.nodes(),function(d){var c=r.node(d);c.x-=e,c.y-=o}),v(r.edges(),function(d){var c=r.edge(d);if(v(c.points,function(p){p.x-=e,p.y-=o}),Object.prototype.hasOwnProperty.call(c,"x"))c.x-=e;if(Object.prototype.hasOwnProperty.call(c,"y"))c.y-=o}),a.width=n-e+f,a.height=i-o+s}function ks(r){v(r.edges(),function(e){var n=r.edge(e),o=r.node(e.v),i=r.node(e.w),a,f;if(!n.points)n.points=[],a=i,f=o;else a=n.points[0],f=n.points[n.points.length-1];n.points.unshift(Nr(o,a)),n.points.push(Nr(i,f))})}function Ts(r){v(r.edges(),function(e){var n=r.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r")n.width-=n.labeloffset;switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function Cs(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed)n.points.reverse()})}function As(r){v(r.nodes(),function(e){if(r.children(e).length){var n=r.node(e),o=r.node(n.borderTop),i=r.node(n.borderBottom),a=r.node(G(n.borderLeft)),f=r.node(G(n.borderRight));n.width=Math.abs(f.x-a.x),n.height=Math.abs(i.y-o.y),n.x=a.x+n.width/2,n.y=o.y+n.height/2}}),v(r.nodes(),function(e){if(r.node(e).dummy==="border")r.removeNode(e)})}function Rs(r){v(r.edges(),function(e){if(e.v===e.w){var n=r.node(e.v);if(!n.selfEdges)n.selfEdges=[];n.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})}function Ms(r){var e=B(r);v(e,function(n){var o=0;v(n,function(i,a){var f=r.node(i);f.order=a+o,v(f.selfEdges,function(s){k(r,"selfedge",{width:s.label.width,height:s.label.height,rank:f.rank,order:a+ ++o,e:s.e,label:s.label},"_se")}),delete f.selfEdges})})}function js(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="selfedge"){var o=r.node(n.e.v),i=o.x+o.width/2,a=o.y,f=n.x-i,s=o.height/2;r.setEdge(n.e,n.label),r.removeNode(e),n.label.points=[{x:i+2*f/3,y:a-s},{x:i+5*f/6,y:a-s},{x:i+f,y:a},{x:i+5*f/6,y:a+s},{x:i+2*f/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Ur(r,e){return z(H(r,e),Number)}function Vr(r){var e={};return v(r,function(n,o){e[o.toLowerCase()]=n}),e}var gn=t((r,e,n)=>Math.max(e,Math.min(n,r)),"clamp"),vn=t((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Bs=t((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),Ds=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Fs=t((r,e,n,o,i)=>{let a=[],f=new Set;if(n.forEach(({start:c,end:p})=>{if(c!==o)f.add(c);if(p!==o)f.add(p)}),f.forEach((c)=>{let p=r.node(c);if(typeof p?.x==="number"&&typeof p?.y==="number")a.push(p)}),a.length===0)n.forEach(({edge:c})=>{(c.points??[]).forEach((p)=>{if(typeof p?.x==="number"&&typeof p?.y==="number")a.push(p)})});if(a.length===0)return vn(i);let s=a.reduce((c,p)=>({x:c.x+p.x/a.length,y:c.y+p.y/a.length}),{x:0,y:0}),u=s.x-e.x,d=s.y-e.y;if(Math.abs(u)>Math.abs(d))return u>0?"right":"left";if(Math.abs(d)>0)return d>0?"bottom":"top";return vn(i)},"getSelfLoopSide"),Gs=t((r,e="top",n=0,o=0)=>{let i=r.x,a=r.y-n,f=r.width/2,s=r.height/2,u=Math.max(36,Math.min(100,r.width*0.8)),d=gn(Math.max(o,r.width*0.35),36,u),c=gn(Math.min(r.width,r.height)*0.45,24,48);switch(e){case"bottom":{let p=a+s;return[{x:i-d/2,y:p},{x:i-d/2,y:p+c},{x:i+d/2,y:p+c},{x:i+d/2,y:p}]}case"right":{let p=i+f;return[{x:p,y:a-d/2},{x:p+c,y:a-d/2},{x:p+c,y:a+d/2},{x:p,y:a+d/2}]}case"left":{let p=i-f;return[{x:p,y:a-d/2},{x:p-c,y:a-d/2},{x:p-c,y:a+d/2},{x:p,y:a+d/2}]}case"top":default:{let p=a-s;return[{x:i-d/2,y:p},{x:i-d/2,y:p-c},{x:i+d/2,y:p-c},{x:i+d/2,y:p}]}}},"getSelfLoopPoints"),Xs=t((r,e,n="top",o=0,i={})=>{let f=r.x,s=r.y-o,u=i.width??0,d=i.height??0;switch(n){case"bottom":return{x:f,y:Math.max(...e.map((c)=>c.y))+d/2+4};case"right":return{x:Math.max(...e.map((c)=>c.x))+u/2+4,y:s};case"left":return{x:Math.min(...e.map((c)=>c.x))-u/2-4,y:s};case"top":default:return{x:f,y:Math.min(...e.map((c)=>c.y))-d/2-4}}},"getSelfLoopLabelPosition"),yn=t((r,e=0,{mergeSelfLoops:n=!0}={})=>{let o=new Map,i=[],a=r.graph()?.rankdir;return r.edges().forEach((f)=>{let s=r.edge(f);if(n&&s.selfLoop){let u=s.selfLoop.id;if(!o.has(u))o.set(u,[]);o.get(u).push({edge:s,start:f.v,end:f.w})}else i.push({edge:s,start:f.v,end:f.w})}),o.forEach((f)=>{if(f.length!==3){f.forEach((_)=>i.push(_));return}f.sort((_,A)=>_.edge.selfLoop.order-A.edge.selfLoop.order);let[s,u,d]=f,c=s.edge.originalEdge??u.edge.originalEdge??d.edge.originalEdge??u.edge,p=r.node(c.start);if(!p){f.forEach((_)=>i.push(_));return}let h={width:u.edge.width,height:u.edge.height},b=Fs(r,p,f,c.start,a),w=Gs(p,b,e,h.width??0),y=Xs(p,w,b,e,h),g={...u.edge,...c,id:c.id,points:w,start:c.start,end:c.end,x:y.x,y:y.y,width:h.width,height:h.height,labelStyle:u.edge.labelStyle,fromCluster:s.edge.fromCluster??u.edge.fromCluster??d.edge.fromCluster,toCluster:s.edge.toCluster??u.edge.toCluster??d.edge.toCluster};delete g.selfLoop,delete g.originalEdge,i.push({edge:g,start:g.start,end:g.end})}),i},"getEdgesToRender"),wn=t(async({element:r,graph:e,diagramType:n,id:o,parentCluster:i,siteConfig:a})=>{let f=e.graph().rankdir;l.trace("Dir in recursive render - dir:",f);let{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:p}=Wp(r,{edgePathsClass:"edgePaths"});if(!e.nodes())l.info("No nodes found for",e);else l.info("Recursive render XXX",e.nodes());if(e.edges().length>0)l.info("Recursive edges",e.edge(e.edges()[0]));let h=Bs(n);await Promise.all(e.nodes().map(async function(y){let g=e.node(y);if(i!==void 0){let _=JSON.parse(JSON.stringify(i.clusterData));if(l.trace(`Setting data for parent cluster XXX
|
|
2
2
|
Node.id = `,y,`
|
|
3
3
|
data=`,_.height,`
|
|
4
|
-
Parent cluster`,i.height),e.setNode(i.id,_),!e.parent(y))l.trace("Setting parent",y,i.id),e.setParent(y,i.id,_)}if(l.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),g?.clusterNode){l.info("Cluster identified XBX",y,g.width,e.node(y));let{ranksep:_,nodesep:A}=e.graph();g.graph.setGraph({...g.graph.graph(),ranksep:_+25,nodesep:A});let
|
|
4
|
+
Parent cluster`,i.height),e.setNode(i.id,_),!e.parent(y))l.trace("Setting parent",y,i.id),e.setParent(y,i.id,_)}if(l.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),g?.clusterNode){l.info("Cluster identified XBX",y,g.width,e.node(y));let{ranksep:_,nodesep:A}=e.graph();g.graph.setGraph({...g.graph.graph(),ranksep:_+25,nodesep:A});let zr=await Ws({element:c,graph:g.graph,diagramType:n,id:o,parentCluster:e.node(y),siteConfig:a}),Wr=zr.elem;K(g,Wr),g.diff=zr.diff||0,l.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),jh(Wr,g)}else if(e.children(y).length>0)l.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",e),l.trace(vl(g.id,e)),ve.set(g.id,{id:vl(g.id,e),node:g});else l.trace("Node - the non recursive path XAX",y,c,e.node(y),f),await Kp(c,e.node(y),{config:a,dir:f})})),await t(async()=>{let y=e.edges().map(async function(g){let _=e.edge(g.v,g.w,g.name);if(l.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),l.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(e.edge(g))),l.info("Fix",ve,"ids:",g.v,g.w,"Translating: ",ve.get(g.v),ve.get(g.w)),h&&_.selfLoop){if(_.selfLoop.order!==1)return;let A={..._.originalEdge,..._,id:_.selfLoop.id,startLabelLeft:_.originalEdge?.startLabelLeft??_.startLabelLeft,startLabelRight:_.originalEdge?.startLabelRight??_.startLabelRight,endLabelLeft:_.originalEdge?.endLabelLeft??_.endLabelLeft,endLabelRight:_.originalEdge?.endLabelRight??_.endLabelRight};await Ra(d,A),_.width=A.width,_.height=A.height,_.labelStyle=A.labelStyle;return}await Ra(d,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=Na(a);return{elem:p,graph:e,groups:{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:p},diagramType:n,id:o,mergeSelfLoops:h,subGraphTitleTotalMargin:w}},"measureDagreGraph"),_n=t((r)=>{l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),Yr(r)},"runDagreGraphLayout"),Us=t((r,e,n)=>{let o=r.node(e);if(!o)return;let i={...o};if(o?.clusterNode)i.y=(o.y??0)+n;else if(r.children(e).length>0)i.height=(o.height??0)+n;else i.y=(o.y??0)+n/2;return i},"normalizeDagreNode"),bn=t((r,e)=>{Ds.forEach((n)=>{if(e[n]!==void 0)r[n]=e[n]})},"applyDagreNodeLayout"),Vs=t((r,e,n,o)=>({...r,start:r.start??e,end:r.end??n,points:(r.points??[]).map((i)=>({...i,y:typeof i.y==="number"?i.y+o:i.y}))}),"normalizeDagreEdge"),Ys=t((r,e)=>{let{graph:n,mergeSelfLoops:o,subGraphTitleTotalMargin:i=0}=e,a=new Map(r.nodes.map((s)=>[s.id,s]));Vp(n).forEach((s)=>{let u=Us(n,s,i);if(!u)return;bn(n.node(s),u);let d=a.get(s);if(d)bn(d,u)});let f=i/2;return r.edges=yn(n,f,{mergeSelfLoops:o}).map(({edge:s,start:u,end:d})=>Vs(s,u,d,f)),r},"applyDagreLayoutResult"),zs=t(async({elem:r,graph:e,groups:{clusters:n,edgePaths:o},diagramType:i,id:a,mergeSelfLoops:f,subGraphTitleTotalMargin:s})=>{let u=0;await Promise.all(Vp(e).map(async function(p){let h=e.node(p);if(l.info("Position XBX => "+p+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h?.clusterNode)h.y+=s,l.info("A tainted cluster node XBX1",p,h.id,h.width,h.height,h.x,h.y,e.parent(p)),ve.get(h.id).node=h,ua(h);else if(e.children(p).length>0){l.info("A pure cluster node XBX1",p,h.id,h.x,h.y,h.width,h.height,e.parent(p)),h.height+=s,e.node(h.parentId);let b=h?.padding/2||0,w=h?.labelBBox?.height||0,y=w-b||0;l.debug("OffsetY",y,"labelHeight",w,"halfPadding",b),await Oo(n,h),ve.get(h.id).node=h}else{let b=e.node(h.parentId);h.y+=s/2,l.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",b,b?.offsetY,h),ua(h)}}));let d=s/2;return yn(e,d,{mergeSelfLoops:f}).forEach(function({edge:p,start:h,end:b}){l.info("Edge "+h+" -> "+b+": "+JSON.stringify(p),p),p.points.forEach((_)=>_.y+=d);let w=e.node(h),y=e.node(b),g=$o(o,p,ve,i,w,y,a);Bl(p,g)}),e.nodes().forEach(function(p){let h=e.node(p);if(l.info(p,h.type,h.diff),h.isGroup)u=h.diff}),l.warn("Returning from recursive render XAX",r,u),{elem:r,diff:u}},"paintDagreLayoutCore"),Ws=t(async(r)=>{let e=await wn(r);return _n(e.graph),await zs(e)},"renderDagreSubgraph"),En=t((r)=>{let e=new nt({multigraph:!0,compound:!0}).setGraph({rankdir:r.direction,nodesep:r.config?.nodeSpacing||r.nodeSpacing||r.config?.flowchart?.nodeSpacing,ranksep:r.config?.rankSpacing||r.rankSpacing||r.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return r.nodes.forEach((n)=>{if(e.setNode(n.id,{...n}),n.parentId)e.setParent(n.id,n.parentId)}),l.debug("Edges:",r.edges),r.edges.forEach((n)=>{if(n.start===n.end){let o=n.start,i=o+"---"+o+"---1",a=o+"---"+o+"---2",f=e.node(o);e.setNode(i,{domId:i,id:i,parentId:f.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(i,f.parentId),e.setNode(a,{domId:a,id:a,parentId:f.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(a,f.parentId);let s=structuredClone(n),u=structuredClone(n),d=structuredClone(n),c=structuredClone(n);if(u.originalEdge=s,u.selfLoop={id:s.id,order:0},d.originalEdge=s,d.selfLoop={id:s.id,order:1},c.originalEdge=s,c.selfLoop={id:s.id,order:2},u.label="",u.arrowTypeEnd="none",u.endLabelLeft="",u.endLabelRight="",u.startLabelLeft="",u.id=o+"-cyclic-special-1",d.startLabelRight="",d.startLabelLeft="",d.endLabelLeft="",d.endLabelRight="",d.arrowTypeStart="none",d.arrowTypeEnd="none",d.id=o+"-cyclic-special-mid",c.label="",c.startLabelRight="",c.startLabelLeft="",c.arrowTypeStart="none",f.isGroup)u.fromCluster=o,c.toCluster=o;c.id=o+"-cyclic-special-2",c.arrowTypeStart="none",e.setEdge(o,i,u,o+"-cyclic-special-0"),e.setEdge(i,a,d,o+"-cyclic-special-1"),e.setEdge(a,o,c,o+"-cyclic-special-2")}else e.setEdge(n.start,n.end,{...n},n.id)}),Qh(e),{graph:e}},"prepareLayoutForDagre"),qs=t(async(r,{element:e,preparedLayout:n})=>{let o=n??En(r),i=m(),a=await wn({element:e,graph:o.graph,diagramType:r.type,id:r.diagramId,parentCluster:void 0,siteConfig:i});return o.measuredLayout=a,a},"measureDagreLayout"),Hs=t((r,e)=>{let n=e.preparedLayout?.measuredLayout;if(!n)throw Error("runDagreLayoutCore requires measureDagreLayout to run first");return _n(n.graph),Ys(r,n),n},"runDagreLayoutCore"),Ks=t((r,{measure:e})=>Vp(e.graph).map((n)=>e.graph.node(n)).filter(Boolean),"getDagrePaintNodes"),Js=t((r,e,{measure:n})=>r?n.graph.node(r):void 0,"getDagreEdgeNode"),Kg=ki({prepareLayout:En,measureLayout:qs,runLayoutCore:Hs,paintOptions:{clusterDb:ve,getNodes:Ks,getEdgeNode:Js,skipNode:t((r,{measure:e})=>!e.graph.hasNode(r.id),"skipNode"),isCluster:t((r,{measure:e})=>e.graph.hasNode(r.id)&&(e.graph.children(r.id)??[]).length>0,"isCluster")}});export{Ys as applyDagreLayoutResult,yn as getEdgesToRender,qs as measureDagreLayout,En as prepareLayoutForDagre,Kg as render,Hs as runDagreLayoutCore};
|