@kabmo-labs/kabmo 0.49.0 → 0.51.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/dist/client/index.html +1 -1
- package/dist/client/index.js +606 -560
- package/dist/client/static/js/{Body-9h5hd351.js → Body-s3nh6vet.js} +3 -3
- package/dist/client/static/js/{CsvGrid-s05k1q18.js → CsvGrid-j4h6cpnn.js} +2 -2
- package/dist/client/static/js/{DocxView-x6sjw5ht.js → DocxView-197x16zq.js} +3 -3
- package/dist/client/static/js/{DrawioView-jashn8sf.js → DrawioView-v6ps0cm5.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-eygzgtyc.js → HtmlPreview-a2t5zngp.js} +1 -1
- package/dist/client/static/js/ImageView-ar7hz7jx.js +1 -0
- package/dist/client/static/js/LayoutWrapper-epef152a.js +2 -0
- package/dist/client/static/js/MergeDiffView-7rwjvzk5.js +1 -0
- package/dist/client/static/js/Modal-9nxt67fm.js +60 -0
- package/dist/client/static/js/{PdfView-syhjmyqf.js → PdfView-gzhcym20.js} +1 -1
- package/dist/client/static/js/SessionsView-3h872gpe.js +1 -0
- package/dist/client/static/js/{SheetView-26r0e506.js → SheetView-baaynkb4.js} +22 -22
- package/dist/client/static/js/{SvgPreview-2fk85jzz.js → SvgPreview-jzcqwwcc.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-fdka7pxr.js → abnfDiagram-O67JEVCF-grb1sfhr.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-3hkq8grc.js +1 -0
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-9084jzwr.js +36 -0
- package/dist/client/static/js/{astro-rn2bvwpm.js → astro-m3fcq2sa.js} +1 -1
- package/dist/client/static/js/bash-n7wcmq3s.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-vpcmd3vx.js → blockDiagram-BEXU5L5S-qqcjrg1b.js} +8 -8
- package/dist/client/static/js/c-ypdp030b.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-1rgpdnbq.js → c4Diagram-YGBWAQC7-gc8fqbpc.js} +3 -3
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-fbsejvb9.js → classDiagram-v2-NBCMYWYE-pp6060kq.js} +9 -9
- package/dist/client/static/js/cose-bilkent-JH36ORCC-744ekavk.js +1 -0
- package/dist/client/static/js/cpp-cxwev3gs.js +1 -0
- package/dist/client/static/js/css-6mxcqf8c.js +1 -0
- package/dist/client/static/js/css-9gak6bze.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-9m18e6m5.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-7ta5vbrw.js → cynefinDiagram-VND7K2PF-57dja6g9.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-b8gtt32x.js → dagre-6A5THRUB-de4xrbrw.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-7emepy7h.js → diagram-22UHCM2B-ky3ncyv8.js} +21 -21
- package/dist/client/static/js/diagram-3UASUU5V-zgg82bz9.js +24 -0
- package/dist/client/static/js/{diagram-ATOU4E4O-t113exk3.js → diagram-ATOU4E4O-r4s13e4n.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-pyj3x97y.js → diagram-CDSNMT55-my21t0kq.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-183sgpjh.js → diagram-MLGK6HIB-pvt20jtj.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-fmbj4hcx.js → diagram-MPIPVDR6-as9dk4f3.js} +2 -2
- package/dist/client/static/js/{dockerfile-qay672za.js → dockerfile-3b5caedj.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-eafvfws2.js → ebnfDiagram-ZINNZB2B-tj3hkcj4.js} +1 -1
- package/dist/client/static/js/{elixir-t8bep87c.js → elixir-7q2k61zb.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-573f1vfs.js → elk-276RUBZZ-5e7wczf3.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-4z1r88ej.js → erDiagram-OPXOYQCR-5jje7qrh.js} +12 -12
- package/dist/client/static/js/{erlang-261km7r1.js → erlang-tjsd7n4d.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-d4egnv9v.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-pdeqndnd.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-49jd7msz.js → ganttDiagram-FUAMR5RP-7hresycc.js} +6 -6
- package/dist/client/static/js/gitGraph-4MIJSDKK-grqv890n.js +1 -0
- package/dist/client/static/js/gitGraphDiagram-X574FWY7-8m202jb7.js +106 -0
- package/dist/client/static/js/graphql-6rwdfcnf.js +1 -0
- package/dist/client/static/js/html-p76eszt9.js +1 -0
- package/dist/client/static/js/{index-0w4jqzqk.js → index-0prwdwyb.js} +2 -2
- package/dist/client/static/js/{index-3v8k8ms3.js → index-0y6tstk8.js} +1 -1
- package/dist/client/static/js/index-20hj80g4.js +4 -0
- package/dist/client/static/js/index-21421tq7.js +2 -0
- package/dist/client/static/js/{index-gg910gpv.js → index-254387vg.js} +2 -2
- package/dist/client/static/js/index-2y4gk5q5.js +2 -0
- package/dist/client/static/js/index-3fk8grhz.js +2 -0
- package/dist/client/static/js/index-3rrdmk9m.js +2 -0
- package/dist/client/static/js/{index-rz0tz4hg.js → index-3sz9cztk.js} +1 -1
- package/dist/client/static/js/index-4m2d73m3.css +1 -0
- package/dist/client/static/js/{index-2bf0txsp.js → index-4nvcwtvr.js} +2 -2
- package/dist/client/static/js/index-4ppap7vb.js +9 -0
- package/dist/client/static/js/{index-qs4n116g.js → index-4tbdws4r.js} +2 -2
- package/dist/client/static/js/index-56hy2hcy.js +1 -0
- package/dist/client/static/js/{index-7rmps91t.js → index-60g0e74a.js} +2 -2
- package/dist/client/static/js/{index-zp40g8ah.js → index-7ag37ghj.js} +12 -12
- package/dist/client/static/js/{index-z6y8j93w.js → index-7ehcjb3r.js} +7 -7
- package/dist/client/static/js/index-899yw6fh.js +2 -0
- package/dist/client/static/js/{index-2yzt8h3d.js → index-8pqx5n2p.js} +2 -2
- package/dist/client/static/js/{index-dh060b7r.js → index-91jm3ywm.js} +2 -2
- package/dist/client/static/js/{index-yg083mk0.js → index-9qf2h9jb.js} +6 -6
- package/dist/client/static/js/{index-tcfpzqb9.js → index-9rp7h1nv.js} +20 -20
- package/dist/client/static/js/index-9rr23e0e.js +2 -0
- package/dist/client/static/js/index-9wj4ma9g.js +3 -0
- package/dist/client/static/js/index-awtk0djy.js +1 -0
- package/dist/client/static/js/{index-4dnc1kys.js → index-awz6pyd0.js} +2 -2
- package/dist/client/static/js/index-cvx1vkrx.js +1 -0
- package/dist/client/static/js/{index-c3whkrwa.js → index-cwwg7k5f.js} +33 -33
- package/dist/client/static/js/{index-ykc14gez.js → index-dzatbdws.js} +6 -6
- package/dist/client/static/js/{index-j37m7pn9.js → index-e6ew77ph.js} +2 -2
- package/dist/client/static/js/{index-tb35a328.js → index-ej1va073.js} +2 -2
- package/dist/client/static/js/{index-4ccs971z.js → index-er7pj5k6.js} +2 -2
- package/dist/client/static/js/index-fm0t4pct.js +4 -0
- package/dist/client/static/js/{index-0857zpr0.js → index-g5wp6ksw.js} +2 -2
- package/dist/client/static/js/{index-nzvte8s5.js → index-gy4mtr2e.js} +2 -2
- package/dist/client/static/js/{index-1yq96wpa.js → index-j9y4tjk0.js} +2 -2
- package/dist/client/static/js/{index-7ff9scbm.js → index-kt7c42n7.js} +2 -2
- package/dist/client/static/js/index-ktmb341a.js +468 -0
- package/dist/client/static/js/{index-taev57jw.js → index-m6zncj00.js} +2 -2
- package/dist/client/static/js/{index-dmc82cxb.js → index-mpyd7qxj.js} +2 -2
- package/dist/client/static/js/{index-1p880x6e.js → index-ms80nne4.js} +2 -2
- package/dist/client/static/js/{index-yyjw1ty9.js → index-my856e49.js} +2 -2
- package/dist/client/static/js/{index-pygy21w5.js → index-nnqyew8n.js} +2 -2
- package/dist/client/static/js/{index-qwxawph7.js → index-nt17ejrm.js} +2 -2
- package/dist/client/static/js/index-pvv340b4.js +2 -0
- package/dist/client/static/js/{index-nbm5r9g1.js → index-pxr36neg.js} +2 -2
- package/dist/client/static/js/{index-5ztdqm1w.js → index-q0k1am0g.js} +2 -2
- package/dist/client/static/js/{index-tc6k8qt7.js → index-qrpx4sk1.js} +2 -2
- package/dist/client/static/js/{index-473hk8nb.js → index-r2zsw7nw.js} +9 -9
- package/dist/client/static/js/{index-gaqjrzdb.js → index-rbkvw2xs.js} +2 -2
- package/dist/client/static/js/{index-wbsvg1d9.js → index-scmtzcv1.js} +2 -2
- package/dist/client/static/js/{index-bmaktvm2.js → index-syvkpnc8.js} +1 -1
- package/dist/client/static/js/index-tfqqsj2g.js +1 -0
- package/dist/client/static/js/{index-4z5ram7g.js → index-tj7xr4ta.js} +1 -1
- package/dist/client/static/js/{index-h8hjcdj1.js → index-wvw70pgd.js} +2 -2
- package/dist/client/static/js/{index-5dn4159w.js → index-wxs0x3g1.js} +2 -2
- package/dist/client/static/js/index-x507ndnc.js +314 -0
- package/dist/client/static/js/{index-gr8sqjpz.js → index-x87scjpa.js} +1 -1
- package/dist/client/static/js/{index-s5vegk6q.js → index-xtrsvm0d.js} +2 -2
- package/dist/client/static/js/{index-e8mt8rag.js → index-y1j18rha.js} +2 -2
- package/dist/client/static/js/{index-7dqq7cjp.js → index-yv2ervdj.js} +5 -5
- package/dist/client/static/js/{index-gz7kvpnm.js → index-z2pmt1bc.js} +1 -1
- package/dist/client/static/js/{index-5p8dwr4y.js → index-z446edg9.js} +1 -1
- package/dist/client/static/js/{index-a4636gt1.js → index-zkgqa0c2.js} +2 -2
- package/dist/client/static/js/index-zwbw177x.js +2 -0
- package/dist/client/static/js/info-A6RAGUB7-rzpg7qk1.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-xsar9j6v.js → infoDiagram-VRGFBTTK-5mb5w005.js} +2 -2
- package/dist/client/static/js/ini-kjcpgebh.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-g2rvt9jp.js → ishikawaDiagram-OU5B5YK6-zk7fa0fm.js} +2 -2
- package/dist/client/static/js/java-0bcyv1jt.js +1 -0
- package/dist/client/static/js/javascript-0mqgcvps.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-q95v18zc.js → journeyDiagram-ZHPQQLJL-8jd7b2aw.js} +6 -6
- package/dist/client/static/js/json-mb8k0b1n.js +1 -0
- package/dist/client/static/js/jsx-8p6dqgpq.js +1 -0
- package/dist/client/static/js/{julia-pe5vpc2m.js → julia-nwh5w343.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-2e7m7ds3.js → kanban-definition-PNTS6WVX-yp9rks4k.js} +7 -7
- package/dist/client/static/js/lua-nxnqww9z.js +1 -0
- package/dist/client/static/js/markdown-8gbyxxjd.js +1 -0
- package/dist/client/static/js/mermaid.core-kxsxr8ec.js +12 -0
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-banecvf8.js → mindmap-definition-NLK3R4M7-anx2kj3b.js} +7 -7
- package/dist/client/static/js/one-dark-pro-wyegjr0d.js +1 -0
- package/dist/client/static/js/one-light-kp6c3eqh.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-eac14hsq.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-6erykm1c.js → pegDiagram-GJSIUBJH-9egqyzkc.js} +1 -1
- package/dist/client/static/js/{perl-cc2eqye8.js → perl-wb4wtc9x.js} +1 -1
- package/dist/client/static/js/{php-p9bvnpsv.js → php-9g594k9f.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-a9xqvysf.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-jn1d905q.js → pieDiagram-5QR66LMP-f3dvprbm.js} +3 -3
- package/dist/client/static/js/properties-d5bwhgwz.js +1 -0
- package/dist/client/static/js/python-fdwwjjhh.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-sz4afnp1.js → quadrantDiagram-O4NWA36T-qsghd295.js} +6 -6
- package/dist/client/static/js/r-4d2ygtfj.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-jv2pm0fe.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-j74sc0b6.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-eaf19baz.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d4j5nq31.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-ba862a9p.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-ewzhhth2.js → railroadDiagram-XR7U4H2S-6vmazht2.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-fcs3xd42.js → requirementDiagram-PLB6GJNP-phs0wn1v.js} +6 -6
- package/dist/client/static/js/{ruby-65s2ca5d.js → ruby-c4hxsegh.js} +1 -1
- package/dist/client/static/js/{rust-ec1j2hwy.js → rust-e4whdswc.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-2r829rjf.js → sankeyDiagram-IPEJSGJF-vkktegjk.js} +5 -5
- package/dist/client/static/js/{sass-p6cssgq8.js → sass-6yxywx7t.js} +1 -1
- package/dist/client/static/js/{scss-qfx8wt3b.js → scss-9wz47c6t.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-3mnte9tv.js → sequenceDiagram-PO4LG4MO-37e6se72.js} +13 -13
- package/dist/client/static/js/{sizeCapture-INFHLROL-r6hf9265.js → sizeCapture-INFHLROL-3b4nsa4s.js} +1 -1
- package/dist/client/static/js/sql-sd00wgem.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-hm2f0wdb.js → stateDiagram-v2-GCMORJYK-2nnyqs9x.js} +6 -6
- package/dist/client/static/js/{svelte-jz3a190v.js → svelte-mm3jfpje.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-s58xzqhw.js → swimlanes-2SLR337P-eezd46ps.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-h78096xp.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-ezm1c4pz.js → timeline-definition-EJHVYXUP-pz0f2b4h.js} +12 -12
- package/dist/client/static/js/treeView-Q6P3EWNA-e8yb44pd.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-zvdv84vp.js +1 -0
- package/dist/client/static/js/tsx-dk8rpgtw.js +1 -0
- package/dist/client/static/js/typescript-5txwpd9t.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-ryvgs5ac.js → usecaseDiagram-POWQR4AR-hvg7a87b.js} +82 -82
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-rd5prsf1.js → vennDiagram-UO4OBE2U-03zh9phs.js} +8 -8
- package/dist/client/static/js/{vue-rv4pea8r.js → vue-rcdqpz7q.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-hbv0cg4s.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-1kt8q8a4.js → wardleyDiagram-VNRHLVJA-xy77th92.js} +4 -4
- package/dist/client/static/js/xml-vtrdnrn6.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-q39bbgq4.js → xychartDiagram-PMCCYNJV-h48448cm.js} +4 -4
- package/dist/client/static/js/yaml-6k1tmwtm.js +1 -0
- package/package.json +2 -1
- package/src/client/components/common/MarkdownRenderer.tsx +31 -34
- package/src/client/components/common/ViewportSelector.tsx +4 -0
- package/src/client/components/common/command-palette/index.tsx +5 -2
- package/src/client/components/common/header-button/index.tsx +10 -2
- package/src/client/components/common/markdown-inline-file.test.tsx +131 -0
- package/src/client/components/common/search-select/OptionList.tsx +164 -0
- package/src/client/components/common/search-select/index.tsx +159 -136
- package/src/client/components/common/search-select/option.ts +16 -0
- package/src/client/components/common/search-select/search-select.test.tsx +61 -2
- package/src/client/components/common/sort-menu/index.tsx +9 -4
- package/src/client/components/layout/session-sidebar/HarnessFilter.tsx +26 -6
- package/src/client/components/layout/session-sidebar/scheduler-modal/ModelFields.tsx +45 -49
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +31 -25
- package/src/client/components/settings/ProjectSelectorDropdown.tsx +40 -101
- package/src/client/components/settings/apply-side-effects.test.ts +16 -0
- package/src/client/components/settings/apply-side-effects.ts +8 -0
- package/src/client/components/settings/categories/AppearanceSettings.test.tsx +1 -0
- package/src/client/components/settings/categories/AppearanceSettings.tsx +2 -0
- package/src/client/components/settings/categories/HarnessSettings.tsx +8 -0
- package/src/client/components/settings/categories/TokenUsageSettings.tsx +26 -3
- package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +12 -10
- package/src/client/components/settings/categories/appearance-settings/RightSideSection.test.tsx +97 -0
- package/src/client/components/settings/categories/appearance-settings/RightSideSection.tsx +94 -0
- package/src/client/components/settings/categories/appearance-settings/groups.ts +4 -3
- package/src/client/components/settings/categories/command-settings/DetailPane.tsx +12 -10
- package/src/client/components/settings/categories/dictation-settings/CaptureSection.tsx +13 -18
- package/src/client/components/settings/categories/git-settings/CommitMessageSection.tsx +8 -9
- package/src/client/components/settings/categories/harness-settings/AccountLoginPanel.tsx +224 -0
- package/src/client/components/settings/categories/harness-settings/AccountsPanel.test.tsx +139 -0
- package/src/client/components/settings/categories/harness-settings/AccountsPanel.tsx +349 -0
- package/src/client/components/settings/categories/harness-settings/AddAccountForm.tsx +58 -0
- package/src/client/components/settings/categories/harness-settings/HarnessCard.tsx +33 -0
- package/src/client/components/settings/categories/keyboard-settings/ComposerKeys.tsx +10 -10
- package/src/client/components/settings/categories/mcp-settings/AdvancedSection.tsx +21 -18
- package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +12 -7
- package/src/client/components/settings/categories/omp-settings/PresetBar.tsx +11 -11
- package/src/client/components/settings/categories/omp-settings/RoleEditor.test.ts +14 -11
- package/src/client/components/settings/categories/omp-settings/RowEditor.tsx +17 -16
- package/src/client/components/settings/categories/plugin-settings/MarketplacePane.tsx +11 -9
- package/src/client/components/settings/categories/plugin-settings/SettingsSection.tsx +10 -9
- package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +10 -8
- package/src/client/components/settings/categories/provider-settings/DialectFields.tsx +40 -24
- package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +13 -9
- package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +22 -17
- package/src/client/components/settings/categories/provider-settings/PresetPicker.tsx +79 -50
- package/src/client/components/settings/categories/provider-settings/model-dialogs.test.tsx +14 -7
- package/src/client/components/settings/categories/token-usage-settings/HarnessFilter.tsx +59 -0
- package/src/client/components/settings/categories/token-usage-settings/panel.test.tsx +37 -0
- package/src/client/components/settings/categories/usage-settings/limit-groups.test.ts +10 -0
- package/src/client/components/settings/categories/usage-settings/limit-groups.ts +4 -1
- package/src/client/components/settings/categories/usage-settings/providers.ts +28 -0
- package/src/client/components/settings/categories/usage-settings/usage-visibility.test.ts +60 -0
- package/src/client/components/settings/categories/voice-settings/SpeechSettings.test.tsx +147 -5
- package/src/client/components/settings/categories/voice-settings/SpeechSettings.tsx +27 -3
- package/src/client/components/settings/categories/voice-settings/speech/EndpointSection.tsx +11 -3
- package/src/client/components/settings/categories/voice-settings/speech/EngineSection.tsx +32 -2
- package/src/client/components/settings/categories/voice-settings/speech/ModelsSection.tsx +277 -0
- package/src/client/components/settings/categories/voice-settings/speech/TestSection.tsx +2 -1
- package/src/client/components/settings/categories/voice-settings/speech/VoiceSection.tsx +123 -50
- package/src/client/components/workspace/btw-panel/TopicMenu.tsx +20 -2
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.speech.test.tsx +35 -6
- package/src/client/components/workspace/chat-timeline/SpeechButton.tsx +111 -36
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +21 -6
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +7 -4
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +22 -6
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +17 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +8 -65
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.test.ts +12 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/registry.test.ts +35 -218
- package/src/client/components/workspace/chat-timeline/tool-renderers/registry.ts +40 -177
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.test.ts +13 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackToolJson.test.tsx +79 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackToolJson.tsx +86 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody.tsx +25 -16
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.test.ts +4 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view.ts +11 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.plugin.test.ts +3 -1
- package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +15 -15
- package/src/client/components/workspace/git-panel/BranchToolbar.tsx +30 -5
- package/src/client/components/workspace/usage-panel/index.test.tsx +92 -12
- package/src/client/components/workspace/usage-panel/index.tsx +48 -12
- package/src/client/data/mock/chat.ts +17 -0
- package/src/client/data/mock/token-usage.ts +53 -10
- package/src/client/data/samples/tools-session.ts +8 -5
- package/src/client/hooks/chat/timeline/reader-input.ts +53 -1
- package/src/client/hooks/chat/timeline/scroll-activity.test.ts +103 -0
- package/src/client/hooks/chat/timeline/scroll-geometry.ts +9 -4
- package/src/client/hooks/chat/timeline/scroll.ts +19 -2
- package/src/client/hooks/editor/font.test.ts +21 -0
- package/src/client/hooks/editor/font.ts +12 -9
- package/src/client/hooks/models/harness-accounts.ts +143 -0
- package/src/client/hooks/models/harness-catalog.ts +9 -2
- package/src/client/hooks/models/use-harnesses-controller.ts +12 -0
- package/src/client/hooks/models/use-harnesses.ts +14 -0
- package/src/client/hooks/settings/hide-empty-providers.test.ts +132 -0
- package/src/client/hooks/settings/hide-empty-providers.ts +49 -0
- package/src/client/hooks/settings/local-tts-models.ts +164 -0
- package/src/client/hooks/settings/useTokenUsage.ts +7 -2
- package/src/client/hooks/tts/tts-context.ts +6 -0
- package/src/client/hooks/tts/use-tts-player.ts +10 -0
- package/src/client/hooks/ui/markdown-render.ts +9 -1
- package/src/client/hooks/ui/markdown-scoped-links.ts +77 -0
- package/src/client/hooks/ui/open-inline-file.test.ts +144 -0
- package/src/client/hooks/ui/open-inline-file.ts +71 -0
- package/src/client/hooks/workspace/panel-tabs.ts +1 -1
- package/src/client/hooks/workspace/right-side.test.ts +75 -1
- package/src/client/hooks/workspace/right-side.ts +71 -10
- package/src/client/lib/commands/overlays.ts +16 -2
- package/src/client/lib/tts/player.test.ts +61 -0
- package/src/client/lib/tts/player.ts +120 -41
- package/src/client/tailwind.css +16 -0
- package/src/server/lib/antigravity/home.server.ts +27 -0
- package/src/server/lib/chat/normalize-tools.server.test.ts +79 -0
- package/src/server/lib/chat/normalize-tools.server.ts +87 -0
- package/src/server/lib/db/schema.ts +5 -1
- package/src/server/lib/harness/account-identity.server.ts +163 -0
- package/src/server/lib/harness/account-login.server.test.ts +151 -0
- package/src/server/lib/harness/account-login.server.ts +232 -0
- package/src/server/lib/harness/accounts.server.ts +339 -0
- package/src/server/lib/harness/accounts.test.ts +147 -0
- package/src/server/lib/harness/acp/background-probe.test.ts +314 -0
- package/src/server/lib/harness/acp/background-probe.ts +288 -0
- package/src/server/lib/harness/acp/background-replay.test.ts +37 -1
- package/src/server/lib/harness/acp/background-replay.ts +8 -3
- package/src/server/lib/harness/acp/background-work.test.ts +4 -194
- package/src/server/lib/harness/acp/background-work.ts +4 -207
- package/src/server/lib/harness/acp/client.ts +3 -0
- package/src/server/lib/harness/acp/commands.ts +2 -2
- package/src/server/lib/harness/acp/frames-tool-shapes.test.ts +41 -13
- package/src/server/lib/harness/acp/frames-vendor-names.test.ts +209 -0
- package/src/server/lib/harness/acp/frames.test.ts +11 -20
- package/src/server/lib/harness/acp/frames.ts +5 -3
- package/src/server/lib/harness/acp/mapper.ts +5 -41
- package/src/server/lib/harness/acp/one-shot.server.ts +4 -2
- package/src/server/lib/harness/acp/prewarm.server.ts +21 -16
- package/src/server/lib/harness/acp/replay-transcript.ts +6 -1
- package/src/server/lib/harness/acp/session-background.test.ts +2 -1
- package/src/server/lib/harness/acp/session-intake.test.ts +8 -0
- package/src/server/lib/harness/acp/session-intake.ts +12 -3
- package/src/server/lib/harness/acp/session-options.ts +2 -0
- package/src/server/lib/harness/acp/session-process.ts +1 -0
- package/src/server/lib/harness/acp/session-wiring.test.ts +2 -0
- package/src/server/lib/harness/acp/session-wiring.ts +22 -0
- package/src/server/lib/harness/acp/session.ts +3 -3
- package/src/server/lib/harness/acp/stdio.test.ts +52 -0
- package/src/server/lib/harness/acp/stdio.ts +7 -1
- package/src/server/lib/harness/acp/subagent-frames.test.ts +1 -1
- package/src/server/lib/harness/acp/subagent-frames.ts +0 -2
- package/src/server/lib/harness/acp/tool-calls.ts +5 -16
- package/src/server/lib/harness/acp/tool-identity.test.ts +69 -8
- package/src/server/lib/harness/acp/tool-identity.ts +58 -10
- package/src/server/lib/harness/acp/tool-shape.ts +5 -3
- package/src/server/lib/harness/auto-probe.server.ts +2 -2
- package/src/server/lib/harness/codex/transcript.server.test.ts +3 -1
- package/src/server/lib/harness/codex/transcript.server.ts +8 -15
- package/src/server/lib/harness/launch-table.ts +6 -1
- package/src/server/lib/harness/launch.ts +1 -0
- package/src/server/lib/harness/schema.server.ts +37 -0
- package/src/server/lib/harness/session-delete.server.ts +4 -2
- package/src/server/lib/harness/session-import.server.ts +21 -7
- package/src/server/lib/harness/session-store.server.test.ts +12 -0
- package/src/server/lib/harness/session-store.server.ts +21 -6
- package/src/server/lib/harness/session-transcript.server.ts +2 -1
- package/src/server/lib/harness/spawn.server.ts +27 -6
- package/src/server/lib/lifecycle/paths.ts +12 -0
- package/src/server/lib/models/provider-icon-fetch.test.ts +57 -3
- package/src/server/lib/models/provider-icon-fetch.ts +9 -1
- package/src/server/lib/models/provider-icon-store.server.ts +61 -0
- package/src/server/lib/models/provider-icon-store.test.ts +55 -0
- package/src/server/lib/models/provider-icon-svg.ts +57 -0
- package/src/server/lib/omp/session/messages.ts +5 -1
- package/src/server/lib/realtime/topics/peer-relay.server.ts +9 -1
- package/src/server/lib/realtime/topics/session.server.ts +5 -1
- package/src/server/lib/schedule/runtime.server.ts +4 -1
- package/src/server/lib/sessions/dispatch.server.ts +4 -1
- package/src/server/lib/sessions/fork.server.ts +2 -0
- package/src/server/lib/sessions/resolve.server.ts +4 -0
- package/src/server/lib/sessions/spawn.server.ts +4 -2
- package/src/server/lib/tts/engines/adapters.test.ts +50 -8
- package/src/server/lib/tts/engines/deepgram.ts +30 -9
- package/src/server/lib/tts/engines/elevenlabs.ts +6 -0
- package/src/server/lib/tts/engines/gemini.ts +116 -0
- package/src/server/lib/tts/engines/index.ts +14 -0
- package/src/server/lib/tts/engines/local.ts +53 -0
- package/src/server/lib/tts/engines/openai.ts +21 -4
- package/src/server/lib/tts/engines/sherpa-onnx-node.d.ts +38 -0
- package/src/server/lib/tts/engines/sherpa.test.ts +53 -0
- package/src/server/lib/tts/engines/sherpa.ts +287 -0
- package/src/server/lib/tts/local-models.server.ts +257 -0
- package/src/server/lib/tts/local-request.test.ts +66 -0
- package/src/server/lib/tts/local-request.ts +59 -0
- package/src/server/lib/tts/model-manifest.server.test.ts +71 -0
- package/src/server/lib/tts/model-manifest.server.ts +154 -0
- package/src/server/lib/tts/settings.server.ts +7 -4
- package/src/server/lib/tts/wav.test.ts +37 -0
- package/src/server/lib/tts/wav.ts +43 -0
- package/src/server/lib/usage/antigravity-quota.test.ts +249 -0
- package/src/server/lib/usage/antigravity-quota.ts +197 -0
- package/src/server/lib/usage/antigravity.test.ts +20 -0
- package/src/server/lib/usage/antigravity.ts +267 -0
- package/src/server/lib/usage/index-harness.test.ts +162 -0
- package/src/server/lib/usage/index-parse.test.ts +1 -0
- package/src/server/lib/usage/index-parse.ts +12 -4
- package/src/server/lib/usage/index-query.server.ts +64 -2
- package/src/server/lib/usage/index-scan.server.ts +68 -152
- package/src/server/lib/usage/index-schema.server.ts +24 -8
- package/src/server/lib/usage/index-schema.test.ts +54 -0
- package/src/server/lib/usage/index-sources.server.ts +54 -0
- package/src/server/lib/usage/providers.server.test.ts +67 -1
- package/src/server/lib/usage/providers.server.ts +82 -3
- package/src/server/lib/usage/sources/claude.server.ts +187 -0
- package/src/server/lib/usage/sources/claude.test.ts +86 -0
- package/src/server/lib/usage/sources/codex.server.ts +155 -0
- package/src/server/lib/usage/sources/codex.test.ts +53 -0
- package/src/server/lib/usage/sources/dsh.server.ts +120 -0
- package/src/server/lib/usage/sources/dsh.test.ts +49 -0
- package/src/server/lib/usage/sources/helpers.ts +191 -0
- package/src/server/lib/usage/sources/jsonl.server.ts +78 -0
- package/src/server/lib/usage/sources/jsonl.test.ts +72 -0
- package/src/server/lib/usage/sources/omp.server.ts +124 -0
- package/src/server/lib/usage/sources/opencode.server.ts +203 -0
- package/src/server/lib/usage/sources/opencode.test.ts +104 -0
- package/src/server/lib/usage/sources/qwen.server.ts +122 -0
- package/src/server/lib/usage/sources/qwen.test.ts +62 -0
- package/src/server/lib/usage/sources/types.ts +53 -0
- package/src/server/lib/usage/sources/zcode.server.ts +131 -0
- package/src/server/lib/usage/sources/zcode.test.ts +87 -0
- package/src/server/routes/agent/harness-command.ts +2 -0
- package/src/server/routes/agent/prewarm.ts +7 -2
- package/src/server/routes/chat/session-legacy-tools.test.ts +132 -0
- package/src/server/routes/chat/session.ts +10 -4
- package/src/server/routes/harness/accounts.test.ts +99 -0
- package/src/server/routes/harness/accounts.ts +106 -0
- package/src/server/routes/harness/root.ts +13 -1
- package/src/server/routes/sessions/local-image.ts +2 -2
- package/src/server/routes/telemetry/tokens.test.ts +20 -0
- package/src/server/routes/telemetry/tokens.ts +12 -3
- package/src/server/routes/tts/index.ts +2 -0
- package/src/server/routes/tts/models.test.ts +148 -0
- package/src/server/routes/tts/models.ts +89 -0
- package/src/server/routes/tts/speak.test.ts +40 -0
- package/src/shared/lib/chat/tool/normalize.ts +67 -0
- package/src/shared/lib/chat/tool/render-key.test.ts +167 -0
- package/src/shared/lib/chat/tool/render-key.ts +247 -0
- package/src/shared/lib/chat/tool/tool-aliases.test.ts +42 -0
- package/src/shared/lib/chat/tool/tool-aliases.ts +59 -12
- package/src/shared/lib/fs/open-reference.test.ts +64 -0
- package/src/shared/lib/fs/open-reference.ts +74 -0
- package/src/shared/lib/harness/accounts.test.ts +41 -0
- package/src/shared/lib/harness/accounts.ts +175 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +26 -25
- package/src/shared/lib/markdown/ascii-art.test.ts +154 -0
- package/src/shared/lib/markdown/ascii-art.ts +158 -0
- package/src/shared/lib/markdown/inline-file.test.ts +100 -0
- package/src/shared/lib/markdown/inline-file.ts +213 -0
- package/src/shared/lib/markdown/marked.ts +24 -2
- package/src/shared/lib/models/provider/identity.test.ts +34 -0
- package/src/shared/lib/models/provider/identity.ts +28 -0
- package/src/shared/lib/omp/session/messages-map.test.ts +2 -1
- package/src/shared/lib/omp/session/messages-parse.ts +3 -2
- package/src/shared/lib/omp/session/parse-message-blocks.ts +14 -0
- package/src/shared/lib/omp/subagent/transcript-client.ts +5 -1
- package/src/shared/lib/settings/defaults.ts +2 -0
- package/src/shared/lib/tts/engines.test.ts +39 -2
- package/src/shared/lib/tts/engines.ts +87 -61
- package/src/shared/lib/tts/local-models.test.ts +69 -0
- package/src/shared/lib/tts/local-models.ts +200 -0
- package/src/shared/lib/tts/settings.ts +1 -1
- package/src/shared/lib/tts/speakable.test.ts +21 -1
- package/src/shared/lib/tts/speakable.ts +66 -33
- package/src/shared/lib/tts/voices.ts +204 -0
- package/src/shared/lib/workspace/right-side-hidden.ts +57 -0
- package/src/shared/lib/workspace/session-state/store.ts +7 -5
- package/src/shared/types/chat.ts +3 -0
- package/src/shared/types/harness.ts +5 -0
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/settings/state.ts +12 -0
- package/src/shared/types/tokenUsage.ts +21 -0
- package/src/shared/types/tool-render.ts +37 -0
- package/src/test-support/preload.ts +9 -0
- package/dist/client/static/js/ImageView-g50pk5pt.js +0 -1
- package/dist/client/static/js/LayoutWrapper-tag0qpts.js +0 -2
- package/dist/client/static/js/MergeDiffView-c4mb8m1w.js +0 -1
- package/dist/client/static/js/Modal-pf9p6m1k.js +0 -59
- package/dist/client/static/js/SessionsView-2r1grxxs.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-ee9wjsht.js +0 -1
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-278nx8rt.js +0 -36
- package/dist/client/static/js/bash-36shcpcw.js +0 -1
- package/dist/client/static/js/c-kxeqssf9.js +0 -1
- package/dist/client/static/js/cose-bilkent-JH36ORCC-ydq7mvy0.js +0 -1
- package/dist/client/static/js/cpp-wtk1s3d7.js +0 -1
- package/dist/client/static/js/css-0a0r6rp3.js +0 -1
- package/dist/client/static/js/css-xhnrhg4e.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-gs16zjqa.js +0 -1
- package/dist/client/static/js/diagram-3UASUU5V-06nptkzc.js +0 -24
- package/dist/client/static/js/eventmodeling-NTZA5JFV-ftz7zrz5.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-ax0qfmp3.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-3rtkds4s.js +0 -1
- package/dist/client/static/js/gitGraphDiagram-X574FWY7-5p9mgq7n.js +0 -106
- package/dist/client/static/js/graphql-w9ajhndp.js +0 -1
- package/dist/client/static/js/html-krfbq5wp.js +0 -1
- package/dist/client/static/js/index-05n22cg9.js +0 -4
- package/dist/client/static/js/index-14dgbjsm.js +0 -2
- package/dist/client/static/js/index-2jgx68m0.js +0 -1
- package/dist/client/static/js/index-333rq9yy.js +0 -1
- package/dist/client/static/js/index-38g2eevc.js +0 -314
- package/dist/client/static/js/index-80fjn77c.js +0 -2
- package/dist/client/static/js/index-9wc36am3.css +0 -1
- package/dist/client/static/js/index-bvpzzhn2.js +0 -4
- package/dist/client/static/js/index-e19dbqd3.js +0 -2
- package/dist/client/static/js/index-epzvftkq.js +0 -1
- package/dist/client/static/js/index-fbg5vhhw.js +0 -2
- package/dist/client/static/js/index-mbtenbyc.js +0 -9
- package/dist/client/static/js/index-pv4z2mp2.js +0 -463
- package/dist/client/static/js/index-t522tpxt.js +0 -3
- package/dist/client/static/js/index-xw1bptp5.js +0 -2
- package/dist/client/static/js/index-yr3exz70.js +0 -2
- package/dist/client/static/js/index-zdw8bd5t.js +0 -2
- package/dist/client/static/js/index-zyefab6q.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-vr5mxm6f.js +0 -1
- package/dist/client/static/js/ini-zx7x1jj1.js +0 -1
- package/dist/client/static/js/java-bbw6kdcr.js +0 -1
- package/dist/client/static/js/javascript-p2a8rbpw.js +0 -1
- package/dist/client/static/js/json-zh7m2fyg.js +0 -1
- package/dist/client/static/js/jsx-3zyyt0eh.js +0 -1
- package/dist/client/static/js/lua-d656k76a.js +0 -1
- package/dist/client/static/js/markdown-b5w681mm.js +0 -1
- package/dist/client/static/js/mermaid.core-dzajkp0g.js +0 -12
- package/dist/client/static/js/one-dark-pro-z965dedc.js +0 -1
- package/dist/client/static/js/one-light-capdx801.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-ncb5xxtn.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-ff8fpvc4.js +0 -1
- package/dist/client/static/js/properties-3c6rmnqp.js +0 -1
- package/dist/client/static/js/python-a3x3zpv1.js +0 -1
- package/dist/client/static/js/r-7h3gwype.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-gbj4b1hf.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-ndv5tqgr.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-yjzj09s1.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-e6pw7e5z.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-9734dxy4.js +0 -1
- package/dist/client/static/js/sql-7a5vavm0.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-z4pt2kn1.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-rs10d4p5.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-ey6c5x9f.js +0 -1
- package/dist/client/static/js/tsx-4a9b8tqf.js +0 -1
- package/dist/client/static/js/typescript-kas107wb.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-kd9swrdr.js +0 -1
- package/dist/client/static/js/xml-3g4bdtpa.js +0 -1
- package/dist/client/static/js/yaml-ktxjn917.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`+a);let r=Ft(),c=Bt(),k=r.nodeRadius*1.6,T=g.db,u=T.getWardleyData(),Z=T.getDiagramTitle(),W=u.size?.width??r.width,P=u.size?.height??r.height,R=ge(s);R.selectAll("*").remove(),te(R,P,W,r.useMaxWidth),R.attr("viewBox",`0 0 ${W} ${P}`);let N=R.append("g").attr("class","wardley-map"),tt=R.append("defs");tt.append("marker").attr("id",`arrow-${s}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.evolutionStroke).attr("stroke","none"),tt.append("marker").attr("id",`link-arrow-end-${s}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.linkStroke).attr("stroke","none"),tt.append("marker").attr("id",`link-arrow-start-${s}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",c.linkStroke).attr("stroke","none"),N.append("rect").attr("class","wardley-background").attr("width",W).attr("height",P).attr("fill",c.backgroundColor);let D=W-r.padding*2,V=P-r.padding*2;if(Z)N.append("text").attr("class","wardley-title").attr("x",W/2).attr("y",r.padding/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(Z);let E=t((e)=>r.padding+e/100*D,"projectX"),Y=t((e)=>P-r.padding-e/100*V,"projectY"),U=N.append("g").attr("class","wardley-axes");U.append("line").attr("x1",r.padding).attr("x2",W-r.padding).attr("y1",P-r.padding).attr("y2",P-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1),U.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",P-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1);let Ct=u.axes.xLabel??"Evolution",St=u.axes.yLabel??"Visibility";U.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+D/2).attr("y",P-r.padding/4).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(Ct),U.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+V/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+V/2})`).text(St);let _=u.axes.stages&&u.axes.stages.length>0?u.axes.stages:It;if(_.length>0){let e=N.append("g").attr("class","wardley-stages"),i=u.axes.stageBoundaries,n=[];if(i&&i.length===_.length){let d=0;i.forEach((h)=>{n.push({start:d,end:h}),d=h})}else{let d=1/_.length;_.forEach((h,f)=>{n.push({start:f*d,end:(f+1)*d})})}_.forEach((d,h)=>{let f=n[h],y=r.padding+f.start*D,x=r.padding+f.end*D,w=(y+x)/2;if(h>0)e.append("line").attr("x1",y).attr("x2",y).attr("y1",r.padding).attr("y2",P-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",0.8);e.append("text").attr("class","wardley-stage-label").attr("x",w).attr("y",P-r.padding/1.5).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(d)})}if(r.showGrid){let e=N.append("g").attr("class","wardley-grid");for(let i=1;i<4;i++){let n=i/4,d=r.padding+D*n;e.append("line").attr("x1",d).attr("x2",d).attr("y1",r.padding).attr("y2",P-r.padding).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6"),e.append("line").attr("x1",r.padding).attr("x2",W-r.padding).attr("y1",P-r.padding-V*n).attr("y2",P-r.padding-V*n).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6")}}let p=new Map;if(u.nodes.forEach((e)=>{p.set(e.id,{x:E(e.x),y:Y(e.y),node:e})}),u.pipelines.length>0){let e=N.append("g").attr("class","wardley-pipelines"),i=N.append("g").attr("class","wardley-pipeline-links");u.pipelines.forEach((n)=>{if(n.componentIds.length===0)return;let d=n.componentIds.map((x)=>({id:x,pos:p.get(x),node:u.nodes.find((w)=>w.id===x)})).filter((x)=>x.pos&&x.node).sort((x,w)=>x.node.x-w.node.x);for(let x=0;x<d.length-1;x++){let w=d[x],b=d[x+1];i.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",w.pos.x).attr("y1",w.pos.y).attr("x2",b.pos.x).attr("y2",b.pos.y).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,f=-1/0,y=0;if(n.componentIds.forEach((x)=>{let w=p.get(x);if(w)h=Math.min(h,w.x),f=Math.max(f,w.x),y=w.y}),h!==1/0&&f!==-1/0){let w=r.nodeRadius*4,b=y-w/2,L=p.get(n.nodeId);if(L){let X=(h+f)/2;L.x=X,L.y=b-k/6}e.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",b).attr("width",f-h+30).attr("height",w).attr("fill","none").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let rt=N.append("g").attr("class","wardley-links"),ot=new Map;u.pipelines.forEach((e)=>{ot.set(e.nodeId,new Set(e.componentIds))});let nt=u.links.filter((e)=>{if(!p.has(e.source)||!p.has(e.target))return!1;if(ot.get(e.target)?.has(e.source))return!1;return!0});rt.selectAll("line").data(nt).enter().append("line").attr("class",(e)=>`wardley-link${e.dashed?" wardley-link--dashed":""}`).attr("x1",(e)=>{let i=p.get(e.source),n=p.get(e.target),h=u.nodes.find((w)=>w.id===e.source).isPipelineParent?k/Math.sqrt(2):r.nodeRadius,f=n.x-i.x,y=n.y-i.y,x=Math.sqrt(f*f+y*y);return i.x+f/x*h}).attr("y1",(e)=>{let i=p.get(e.source),n=p.get(e.target),h=u.nodes.find((w)=>w.id===e.source).isPipelineParent?k/Math.sqrt(2):r.nodeRadius,f=n.x-i.x,y=n.y-i.y,x=Math.sqrt(f*f+y*y);return i.y+y/x*h}).attr("x2",(e)=>{let i=p.get(e.source),n=p.get(e.target),h=u.nodes.find((w)=>w.id===e.target).isPipelineParent?k/Math.sqrt(2):r.nodeRadius,f=i.x-n.x,y=i.y-n.y,x=Math.sqrt(f*f+y*y);return n.x+f/x*h}).attr("y2",(e)=>{let i=p.get(e.source),n=p.get(e.target),h=u.nodes.find((w)=>w.id===e.target).isPipelineParent?k/Math.sqrt(2):r.nodeRadius,f=i.x-n.x,y=i.y-n.y,x=Math.sqrt(f*f+y*y);return n.y+y/x*h}).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",(e)=>e.dashed?"6 6":null).attr("marker-end",(e)=>{if(e.flow==="forward"||e.flow==="bidirectional")return`url(#link-arrow-end-${s})`;return null}).attr("marker-start",(e)=>{if(e.flow==="backward"||e.flow==="bidirectional")return`url(#link-arrow-start-${s})`;return null}),rt.selectAll("text").data(nt.filter((e)=>e.label)).enter().append("text").attr("class","wardley-link-label").attr("x",(e)=>{let i=p.get(e.source),n=p.get(e.target),d=(i.x+n.x)/2,h=n.y-i.y,f=n.x-i.x,y=Math.sqrt(f*f+h*h),x=8,w=h/y;return d+w*8}).attr("y",(e)=>{let i=p.get(e.source),n=p.get(e.target),d=(i.y+n.y)/2,h=n.x-i.x,f=n.y-i.y,y=Math.sqrt(h*h+f*f),x=8,w=-h/y;return d+w*8}).attr("fill",c.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",(e)=>{let i=p.get(e.source),n=p.get(e.target),d=(i.x+n.x)/2,h=(i.y+n.y)/2,f=n.x-i.x,y=n.y-i.y,x=Math.sqrt(f*f+y*y),w=8,b=y/x,L=-f/x,X=d+b*8,J=h+L*8,F=Math.atan2(y,f)*180/Math.PI;if(F>90||F<-90)F+=180;return`rotate(${F} ${X} ${J})`}).text((e)=>e.label);let Mt=N.append("g").attr("class","wardley-trends"),Nt=u.trends.map((e)=>{let i=p.get(e.nodeId);if(!i)return null;let n=E(e.targetX),d=Y(e.targetY),h=n-i.x,f=d-i.y,y=Math.sqrt(h*h+f*f),x=r.nodeRadius+2,w=y>x?n-h/y*x:n,b=y>x?d-f/y*x:d;return{origin:i,targetX:n,targetY:d,adjustedX2:w,adjustedY2:b}}).filter((e)=>e!==null);Mt.selectAll("line").data(Nt).enter().append("line").attr("class","wardley-trend").attr("x1",(e)=>e.origin.x).attr("y1",(e)=>e.origin.y).attr("x2",(e)=>e.adjustedX2).attr("y2",(e)=>e.adjustedY2).attr("stroke",c.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${s})`);let A=N.append("g").attr("class","wardley-nodes").selectAll("g").data(u.nodes).enter().append("g").attr("class",(e)=>["wardley-node",e.className?`wardley-node--${e.className}`:""].filter(Boolean).join(" "));A.filter((e)=>e.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",c.componentStroke).attr("stroke-width",1),A.filter((e)=>e.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",c.componentStroke).attr("stroke-width",1),A.filter((e)=>e.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let I=A.filter((e)=>e.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),A.filter((e)=>!e.isPipelineParent&&e.sourceStrategy!=="market"&&e.className!=="anchor").append("circle").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y).attr("r",r.nodeRadius).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1);let et=r.nodeRadius*0.7,S=r.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",(e)=>p.get(e.id).x).attr("y1",(e)=>p.get(e.id).y-S).attr("x2",(e)=>p.get(e.id).x-S*Math.cos(Math.PI/6)).attr("y2",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",(e)=>p.get(e.id).x-S*Math.cos(Math.PI/6)).attr("y1",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("x2",(e)=>p.get(e.id).x+S*Math.cos(Math.PI/6)).attr("y2",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",(e)=>p.get(e.id).x+S*Math.cos(Math.PI/6)).attr("y1",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("x2",(e)=>p.get(e.id).x).attr("y2",(e)=>p.get(e.id).y-S).attr("stroke",c.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y-S).attr("r",et).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",(e)=>p.get(e.id).x-S*Math.cos(Math.PI/6)).attr("cy",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("r",et).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",(e)=>p.get(e.id).x+S*Math.cos(Math.PI/6)).attr("cy",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("r",et).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),A.filter((e)=>e.isPipelineParent===!0).append("rect").attr("x",(e)=>p.get(e.id).x-k/2).attr("y",(e)=>p.get(e.id).y-k/2).attr("width",k).attr("height",k).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1),A.filter((e)=>e.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",(e)=>{let i=p.get(e.id),n=e.isPipelineParent?k/2+15:r.nodeRadius+15;if(e.sourceStrategy)n+=r.nodeRadius+10;return i.x+n}).attr("y1",(e)=>{let i=p.get(e.id),n=e.isPipelineParent?k:r.nodeRadius*2;return i.y-n/2}).attr("x2",(e)=>{let i=p.get(e.id),n=e.isPipelineParent?k/2+15:r.nodeRadius+15;if(e.sourceStrategy)n+=r.nodeRadius+10;return i.x+n}).attr("y2",(e)=>{let i=p.get(e.id),n=e.isPipelineParent?k:r.nodeRadius*2;return i.y+n/2}).attr("stroke",c.componentStroke).attr("stroke-width",6),A.append("text").attr("x",(e)=>{let i=p.get(e.id);if(e.className==="anchor")return e.labelOffsetX!==void 0?i.x+e.labelOffsetX:i.x;let n=r.nodeLabelOffset;if(e.sourceStrategy&&e.labelOffsetX===void 0)n+=10;let d=e.labelOffsetX??n;return i.x+d}).attr("y",(e)=>{let i=p.get(e.id);if(e.className==="anchor")return e.labelOffsetY!==void 0?i.y+e.labelOffsetY:i.y-3;let n=-r.nodeLabelOffset;if(e.sourceStrategy&&e.labelOffsetY===void 0)n-=10;let d=e.labelOffsetY??n;return i.y+d}).attr("class","wardley-node-label").attr("fill",(e)=>{if(e.className==="evolved")return c.evolutionStroke;if(e.className==="anchor")return"#000";return c.componentLabelColor}).attr("font-size",r.labelFontSize).attr("font-weight",(e)=>e.className==="anchor"?"bold":"normal").attr("text-anchor",(e)=>e.className==="anchor"?"middle":"start").attr("dominant-baseline",(e)=>e.className==="anchor"?"middle":"auto").text((e)=>e.label),u.annotations.length>0){let e=N.append("g").attr("class","wardley-annotations");if(u.annotations.forEach((i)=>{let n=i.coordinates.map((d)=>({x:E(d.x),y:Y(d.y)}));if(n.length>1)for(let d=0;d<n.length-1;d++)e.append("line").attr("class","wardley-annotation-line").attr("x1",n[d].x).attr("y1",n[d].y).attr("x2",n[d+1].x).attr("y2",n[d+1].y).attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach((d)=>{let h=e.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",d.x).attr("cy",d.y).attr("r",10).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",d.x).attr("y",d.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(i.number)})}),u.annotationsBox){let i=E(u.annotationsBox.x),n=Y(u.annotationsBox.y),d=10,h=16,f=11,y=e.append("g").attr("class","wardley-annotations-box"),x=[...u.annotations].filter((b)=>b.text).sort((b,L)=>b.number-L.number),w=[];if(x.forEach((b,L)=>{let X=y.append("text").attr("x",i+d).attr("y",n+d+(L+1)*h).attr("font-size",f).attr("fill",c.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${b.number}. ${b.text}`);w.push(X)}),w.length>0){let b=0,L=0;w.forEach((at)=>{let K=at.node(),Wt=K.getComputedTextLength();b=Math.max(b,Wt);let At=K.getBBox();L=Math.max(L,At.height)});let X=b+d*2+105,J=x.length*h+d*2+L/2,F=r.padding,zt=W-r.padding-X,Lt=r.padding,Tt=P-r.padding-J;i=Math.max(F,Math.min(i,zt)),n=Math.max(Lt,Math.min(n,Tt)),w.forEach((at,K)=>{at.attr("x",i+d).attr("y",n+d+(K+1)*h)}),y.insert("rect","text").attr("x",i).attr("y",n).attr("width",X).attr("height",J).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(u.notes.length>0){let e=N.append("g").attr("class","wardley-notes");u.notes.forEach((i)=>{let n=E(i.x),d=Y(i.y);e.append("text").attr("x",n).attr("y",d).attr("text-anchor","start").attr("font-size",11).attr("fill",c.axisTextColor).attr("font-weight","bold").text(i.text)})}if(u.accelerators.length>0){let e=N.append("g").attr("class","wardley-accelerators");u.accelerators.forEach((i)=>{let n=E(i.x),d=Y(i.y),h=60,f=30,y=20,x=`
|
|
1
|
+
import{xe}from"./index-zwbw177x.js";import{t,l,Yt,C,ne,M,O,G,z,j,q,H,m,Ae,le}from"./index-x507ndnc.js";import{$e}from"./index-cwwg7k5f.js";var Q=t((a,s)=>{let o=a<=1?a*100:a;if(o<0||o>100)throw Error(`${s} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return o},"toPercent"),B=t((a,s,o)=>({x:Q(s,`${o} evolution`),y:Q(a,`${o} visibility`)}),"toCoordinates"),st=t((a)=>{if(!a)return;if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward";return},"getFlowFromPort"),Xt=t((a)=>{if(!a?.startsWith("+"))return{};let o=/^\+'([^']*)'/.exec(a)?.[1];if(a.includes("<>"))return{flow:"bidirectional",label:o};if(a.includes("<"))return{flow:"backward",label:o};if(a.includes(">"))return{flow:"forward",label:o};return{label:o}},"extractFlowFromArrow"),Et=t((a,s)=>{if(xe(a,s),a.size)s.setSize(a.size.width,a.size.height);if(a.evolution){let o=a.evolution.stages.map((r)=>{if(r.secondName)return`${r.name.trim()} / ${r.secondName.trim()}`;return r.name.trim()}),g=a.evolution.stages.filter((r)=>r.boundary!==void 0).map((r)=>r.boundary);s.updateAxes({stages:o,stageBoundaries:g})}if(a.anchors.forEach((o)=>{let g=B(o.visibility,o.evolution,`Anchor "${o.name}"`);s.addNode(o.name,o.name,g.x,g.y,"anchor")}),a.components.forEach((o)=>{let g=B(o.visibility,o.evolution,`Component "${o.name}"`),r=o.label?(o.label.negX?-1:1)*o.label.offsetX:void 0,c=o.label?(o.label.negY?-1:1)*o.label.offsetY:void 0,k=o.decorator?.strategy;s.addNode(o.name,o.name,g.x,g.y,"component",r,c,o.inertia,k)}),a.notes.forEach((o)=>{let g=B(o.visibility,o.evolution,`Note "${o.text}"`);s.addNote(o.text,g.x,g.y)}),a.pipelines.forEach((o)=>{let g=s.getNode(o.parent);if(!g||typeof g.y!=="number")throw Error(`Pipeline "${o.parent}" must reference an existing component with coordinates.`);let r=g.y;s.startPipeline(o.parent),o.components.forEach((c)=>{let k=`${o.parent}_${c.name}`,T=c.label?(c.label.negX?-1:1)*c.label.offsetX:void 0,u=c.label?(c.label.negY?-1:1)*c.label.offsetY:void 0,Z=Q(c.evolution,`Pipeline component "${c.name}" evolution`);s.addNode(k,c.name,Z,r,"pipeline-component",T,u),s.addPipelineComponent(o.parent,k)})}),a.links.forEach((o)=>{let g=!!o.arrow&&(o.arrow.includes("-.->")||o.arrow.includes(".-.")),r=st(o.fromPort)??st(o.toPort),{flow:c,label:k}=Xt(o.arrow);if(!r&&c)r=c;let T=o.linkLabel,u=k??T;s.addLink(s.resolveNodeId(o.from),s.resolveNodeId(o.to),g,u,r)}),a.evolves.forEach((o)=>{let g=s.getNode(o.component);if(g?.y!==void 0){let r=Q(o.target,`Evolve target for "${o.component}"`);s.addTrend(o.component,r,g.y)}}),a.annotations.length>0){let o=a.annotations[0],g=B(o.x,o.y,"Annotations box");s.setAnnotationsBox(g.x,g.y)}a.annotation.forEach((o)=>{let g=B(o.x,o.y,`Annotation ${o.number}`);s.addAnnotation(o.number,[{x:g.x,y:g.y}],o.text)}),a.accelerators.forEach((o)=>{let g=B(o.x,o.y,`Accelerator "${o.name}"`);s.addAccelerator(o.name,g.x,g.y)}),a.deaccelerators.forEach((o)=>{let g=B(o.x,o.y,`Deaccelerator "${o.name}"`);s.addDeaccelerator(o.name,g.x,g.y)})},"populateDb"),it={parser:{yy:void 0},parse:t(async(a)=>{let s=await $e("wardley",a);l.debug(s);let o=it.parser?.yy;if(!o||typeof o.addNode!=="function")throw Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Et(s,o)},"parse")},Ht=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,"WardleyBuilder")}addNode(a){let s=this.nodes.get(a.id)??{id:a.id,label:a.label},o={...s,...a,className:a.className??s.className,labelOffsetX:a.labelOffsetX??s.labelOffsetX,labelOffsetY:a.labelOffsetY??s.labelOffsetY};this.nodes.set(a.id,o)}addLink(a){this.links.push(a)}addTrend(a){this.trends.set(a.nodeId,a)}startPipeline(a){this.pipelines.set(a,{nodeId:a,componentIds:[]});let s=this.nodes.get(a);if(s)s.isPipelineParent=!0}addPipelineComponent(a,s){let o=this.pipelines.get(a);if(o)o.componentIds.push(s);let g=this.nodes.get(s);if(g)g.inPipeline=!0}addAnnotation(a){this.annotations.push(a)}addNote(a){this.notes.push(a)}addAccelerator(a){this.accelerators.push(a)}addDeaccelerator(a){this.deaccelerators.push(a)}setAnnotationsBox(a,s){this.annotationsBox={x:a,y:s}}setAxes(a){this.axes={...this.axes,...a}}setSize(a,s){this.size={width:a,height:s}}getNode(a){return this.nodes.get(a)}resolveNodeId(a){if(this.nodes.has(a))return a;for(let[s,o]of this.nodes)if(o.label===a)return s;return a}build(){let a=[];for(let s of this.nodes.values()){if(typeof s.x!=="number"||typeof s.y!=="number")throw Error(`Node "${s.label}" is missing coordinates`);a.push(s)}return{nodes:a,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},v=new Ht;function dt(){return m()["wardley-beta"]}t(dt,"getConfig");function lt(a,s,o,g,r,c,k,T,u){v.addNode({id:a,label:s,x:o,y:g,className:r,labelOffsetX:c,labelOffsetY:k,inertia:T,sourceStrategy:u})}t(lt,"addNode");function ct(a,s,o=!1,g,r){v.addLink({source:a,target:s,dashed:o,label:g,flow:r})}t(ct,"addLink");function pt(a,s,o){v.addTrend({nodeId:a,targetX:s,targetY:o})}t(pt,"addTrend");function ht(a,s,o){v.addAnnotation({number:a,coordinates:s,text:o})}t(ht,"addAnnotation");function ft(a,s,o){v.addNote({text:a,x:s,y:o})}t(ft,"addNote");function xt(a,s,o){v.addAccelerator({name:a,x:s,y:o})}t(xt,"addAccelerator");function gt(a,s,o){v.addDeaccelerator({name:a,x:s,y:o})}t(gt,"addDeaccelerator");function yt(a,s){v.setAnnotationsBox(a,s)}t(yt,"setAnnotationsBox");function ut(a,s){v.setSize(a,s)}t(ut,"setSize");function wt(a){v.startPipeline(a)}t(wt,"startPipeline");function mt(a,s){v.addPipelineComponent(a,s)}t(mt,"addPipelineComponent");function kt(a){v.setAxes(a)}t(kt,"updateAxes");function bt(a){return v.getNode(a)}t(bt,"getNode");function $t(a){return v.resolveNodeId(a)}t($t,"resolveNodeId");function vt(){return v.build()}t(vt,"getWardleyData");function Pt(){v.clear(),M()}t(Pt,"clear");var It={getConfig:dt,addNode:lt,addLink:ct,addTrend:pt,addAnnotation:ht,addNote:ft,addAccelerator:xt,addDeaccelerator:gt,setAnnotationsBox:yt,setSize:ut,startPipeline:wt,addPipelineComponent:mt,updateAxes:kt,getNode:bt,resolveNodeId:$t,getWardleyData:vt,clear:Pt,setAccTitle:O,getAccTitle:G,setDiagramTitle:q,getDiagramTitle:H,getAccDescription:j,setAccDescription:z},Bt=["Genesis","Custom Built","Product","Commodity"],Ft=t(()=>{let{themeVariables:a}=m();return{backgroundColor:a.wardley?.backgroundColor??a.background??"#fff",axisColor:a.wardley?.axisColor??"#000",axisTextColor:a.wardley?.axisTextColor??a.primaryTextColor??"#222",gridColor:a.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:a.wardley?.componentFill??"#fff",componentStroke:a.wardley?.componentStroke??"#000",componentLabelColor:a.wardley?.componentLabelColor??a.primaryTextColor??"#222",linkStroke:a.wardley?.linkStroke??"#000",evolutionStroke:a.wardley?.evolutionStroke??"#dc3545",annotationStroke:a.wardley?.annotationStroke??"#000",annotationTextColor:a.wardley?.annotationTextColor??a.primaryTextColor??"#222",annotationFill:a.wardley?.annotationFill??a.background??"#fff"}},"getTheme"),Rt=t(()=>{let a=m()["wardley-beta"];return{width:a?.width??900,height:a?.height??600,padding:a?.padding??48,nodeRadius:a?.nodeRadius??6,nodeLabelOffset:a?.nodeLabelOffset??8,axisFontSize:a?.axisFontSize??12,labelFontSize:a?.labelFontSize??10,showGrid:a?.showGrid??!1,useMaxWidth:a?.useMaxWidth??!0}},"getConfigValues"),Ot=t((a,s,o,g)=>{l.debug(`Rendering Wardley map
|
|
2
|
+
`+a);let r=Rt(),c=Ft(),k=r.nodeRadius*1.6,T=g.db,u=T.getWardleyData(),Z=T.getDiagramTitle(),W=u.size?.width??r.width,P=u.size?.height??r.height,R=Ae(s);R.selectAll("*").remove(),ne(R,P,W,r.useMaxWidth),R.attr("viewBox",`0 0 ${W} ${P}`);let N=R.append("g").attr("class","wardley-map"),tt=R.append("defs");tt.append("marker").attr("id",`arrow-${s}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.evolutionStroke).attr("stroke","none"),tt.append("marker").attr("id",`link-arrow-end-${s}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",c.linkStroke).attr("stroke","none"),tt.append("marker").attr("id",`link-arrow-start-${s}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",c.linkStroke).attr("stroke","none"),N.append("rect").attr("class","wardley-background").attr("width",W).attr("height",P).attr("fill",c.backgroundColor);let D=W-r.padding*2,V=P-r.padding*2;if(Z)N.append("text").attr("class","wardley-title").attr("x",W/2).attr("y",r.padding/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(Z);let E=t((e)=>r.padding+e/100*D,"projectX"),Y=t((e)=>P-r.padding-e/100*V,"projectY"),U=N.append("g").attr("class","wardley-axes");U.append("line").attr("x1",r.padding).attr("x2",W-r.padding).attr("y1",P-r.padding).attr("y2",P-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1),U.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",P-r.padding).attr("stroke",c.axisColor).attr("stroke-width",1);let Ct=u.axes.xLabel??"Evolution",St=u.axes.yLabel??"Visibility";U.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+D/2).attr("y",P-r.padding/4).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(Ct),U.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+V/2).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+V/2})`).text(St);let _=u.axes.stages&&u.axes.stages.length>0?u.axes.stages:Bt;if(_.length>0){let e=N.append("g").attr("class","wardley-stages"),i=u.axes.stageBoundaries,n=[];if(i&&i.length===_.length){let d=0;i.forEach((h)=>{n.push({start:d,end:h}),d=h})}else{let d=1/_.length;_.forEach((h,f)=>{n.push({start:f*d,end:(f+1)*d})})}_.forEach((d,h)=>{let f=n[h],y=r.padding+f.start*D,x=r.padding+f.end*D,w=(y+x)/2;if(h>0)e.append("line").attr("x1",y).attr("x2",y).attr("y1",r.padding).attr("y2",P-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",0.8);e.append("text").attr("class","wardley-stage-label").attr("x",w).attr("y",P-r.padding/1.5).attr("fill",c.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(d)})}if(r.showGrid){let e=N.append("g").attr("class","wardley-grid");for(let i=1;i<4;i++){let n=i/4,d=r.padding+D*n;e.append("line").attr("x1",d).attr("x2",d).attr("y1",r.padding).attr("y2",P-r.padding).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6"),e.append("line").attr("x1",r.padding).attr("x2",W-r.padding).attr("y1",P-r.padding-V*n).attr("y2",P-r.padding-V*n).attr("stroke",c.gridColor).attr("stroke-dasharray","2 6")}}let p=new Map;if(u.nodes.forEach((e)=>{p.set(e.id,{x:E(e.x),y:Y(e.y),node:e})}),u.pipelines.length>0){let e=N.append("g").attr("class","wardley-pipelines"),i=N.append("g").attr("class","wardley-pipeline-links");u.pipelines.forEach((n)=>{if(n.componentIds.length===0)return;let d=n.componentIds.map((x)=>({id:x,pos:p.get(x),node:u.nodes.find((w)=>w.id===x)})).filter((x)=>x.pos&&x.node).sort((x,w)=>x.node.x-w.node.x);for(let x=0;x<d.length-1;x++){let w=d[x],b=d[x+1];i.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",w.pos.x).attr("y1",w.pos.y).attr("x2",b.pos.x).attr("y2",b.pos.y).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,f=-1/0,y=0;if(n.componentIds.forEach((x)=>{let w=p.get(x);if(w)h=Math.min(h,w.x),f=Math.max(f,w.x),y=w.y}),h!==1/0&&f!==-1/0){let w=r.nodeRadius*4,b=y-w/2,L=p.get(n.nodeId);if(L){let X=(h+f)/2;L.x=X,L.y=b-k/6}e.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",b).attr("width",f-h+30).attr("height",w).attr("fill","none").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let rt=N.append("g").attr("class","wardley-links"),ot=new Map;u.pipelines.forEach((e)=>{ot.set(e.nodeId,new Set(e.componentIds))});let nt=u.links.filter((e)=>{if(!p.has(e.source)||!p.has(e.target))return!1;if(ot.get(e.target)?.has(e.source))return!1;return!0});rt.selectAll("line").data(nt).enter().append("line").attr("class",(e)=>`wardley-link${e.dashed?" wardley-link--dashed":""}`).attr("x1",(e)=>{let i=p.get(e.source),n=p.get(e.target),h=u.nodes.find((w)=>w.id===e.source).isPipelineParent?k/Math.sqrt(2):r.nodeRadius,f=n.x-i.x,y=n.y-i.y,x=Math.sqrt(f*f+y*y);return i.x+f/x*h}).attr("y1",(e)=>{let i=p.get(e.source),n=p.get(e.target),h=u.nodes.find((w)=>w.id===e.source).isPipelineParent?k/Math.sqrt(2):r.nodeRadius,f=n.x-i.x,y=n.y-i.y,x=Math.sqrt(f*f+y*y);return i.y+y/x*h}).attr("x2",(e)=>{let i=p.get(e.source),n=p.get(e.target),h=u.nodes.find((w)=>w.id===e.target).isPipelineParent?k/Math.sqrt(2):r.nodeRadius,f=i.x-n.x,y=i.y-n.y,x=Math.sqrt(f*f+y*y);return n.x+f/x*h}).attr("y2",(e)=>{let i=p.get(e.source),n=p.get(e.target),h=u.nodes.find((w)=>w.id===e.target).isPipelineParent?k/Math.sqrt(2):r.nodeRadius,f=i.x-n.x,y=i.y-n.y,x=Math.sqrt(f*f+y*y);return n.y+y/x*h}).attr("stroke",c.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",(e)=>e.dashed?"6 6":null).attr("marker-end",(e)=>{if(e.flow==="forward"||e.flow==="bidirectional")return`url(#link-arrow-end-${s})`;return null}).attr("marker-start",(e)=>{if(e.flow==="backward"||e.flow==="bidirectional")return`url(#link-arrow-start-${s})`;return null}),rt.selectAll("text").data(nt.filter((e)=>e.label)).enter().append("text").attr("class","wardley-link-label").attr("x",(e)=>{let i=p.get(e.source),n=p.get(e.target),d=(i.x+n.x)/2,h=n.y-i.y,f=n.x-i.x,y=Math.sqrt(f*f+h*h),x=8,w=h/y;return d+w*8}).attr("y",(e)=>{let i=p.get(e.source),n=p.get(e.target),d=(i.y+n.y)/2,h=n.x-i.x,f=n.y-i.y,y=Math.sqrt(h*h+f*f),x=8,w=-h/y;return d+w*8}).attr("fill",c.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",(e)=>{let i=p.get(e.source),n=p.get(e.target),d=(i.x+n.x)/2,h=(i.y+n.y)/2,f=n.x-i.x,y=n.y-i.y,x=Math.sqrt(f*f+y*y),w=8,b=y/x,L=-f/x,X=d+b*8,J=h+L*8,F=Math.atan2(y,f)*180/Math.PI;if(F>90||F<-90)F+=180;return`rotate(${F} ${X} ${J})`}).text((e)=>e.label);let Mt=N.append("g").attr("class","wardley-trends"),Nt=u.trends.map((e)=>{let i=p.get(e.nodeId);if(!i)return null;let n=E(e.targetX),d=Y(e.targetY),h=n-i.x,f=d-i.y,y=Math.sqrt(h*h+f*f),x=r.nodeRadius+2,w=y>x?n-h/y*x:n,b=y>x?d-f/y*x:d;return{origin:i,targetX:n,targetY:d,adjustedX2:w,adjustedY2:b}}).filter((e)=>e!==null);Mt.selectAll("line").data(Nt).enter().append("line").attr("class","wardley-trend").attr("x1",(e)=>e.origin.x).attr("y1",(e)=>e.origin.y).attr("x2",(e)=>e.adjustedX2).attr("y2",(e)=>e.adjustedY2).attr("stroke",c.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${s})`);let A=N.append("g").attr("class","wardley-nodes").selectAll("g").data(u.nodes).enter().append("g").attr("class",(e)=>["wardley-node",e.className?`wardley-node--${e.className}`:""].filter(Boolean).join(" "));A.filter((e)=>e.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",c.componentStroke).attr("stroke-width",1),A.filter((e)=>e.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",c.componentStroke).attr("stroke-width",1),A.filter((e)=>e.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let I=A.filter((e)=>e.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),A.filter((e)=>!e.isPipelineParent&&e.sourceStrategy!=="market"&&e.className!=="anchor").append("circle").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y).attr("r",r.nodeRadius).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1);let et=r.nodeRadius*0.7,S=r.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",(e)=>p.get(e.id).x).attr("y1",(e)=>p.get(e.id).y-S).attr("x2",(e)=>p.get(e.id).x-S*Math.cos(Math.PI/6)).attr("y2",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",(e)=>p.get(e.id).x-S*Math.cos(Math.PI/6)).attr("y1",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("x2",(e)=>p.get(e.id).x+S*Math.cos(Math.PI/6)).attr("y2",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("stroke",c.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",(e)=>p.get(e.id).x+S*Math.cos(Math.PI/6)).attr("y1",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("x2",(e)=>p.get(e.id).x).attr("y2",(e)=>p.get(e.id).y-S).attr("stroke",c.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",(e)=>p.get(e.id).x).attr("cy",(e)=>p.get(e.id).y-S).attr("r",et).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",(e)=>p.get(e.id).x-S*Math.cos(Math.PI/6)).attr("cy",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("r",et).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",(e)=>p.get(e.id).x+S*Math.cos(Math.PI/6)).attr("cy",(e)=>p.get(e.id).y+S*Math.sin(Math.PI/6)).attr("r",et).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",2),A.filter((e)=>e.isPipelineParent===!0).append("rect").attr("x",(e)=>p.get(e.id).x-k/2).attr("y",(e)=>p.get(e.id).y-k/2).attr("width",k).attr("height",k).attr("fill",c.componentFill).attr("stroke",c.componentStroke).attr("stroke-width",1),A.filter((e)=>e.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",(e)=>{let i=p.get(e.id),n=e.isPipelineParent?k/2+15:r.nodeRadius+15;if(e.sourceStrategy)n+=r.nodeRadius+10;return i.x+n}).attr("y1",(e)=>{let i=p.get(e.id),n=e.isPipelineParent?k:r.nodeRadius*2;return i.y-n/2}).attr("x2",(e)=>{let i=p.get(e.id),n=e.isPipelineParent?k/2+15:r.nodeRadius+15;if(e.sourceStrategy)n+=r.nodeRadius+10;return i.x+n}).attr("y2",(e)=>{let i=p.get(e.id),n=e.isPipelineParent?k:r.nodeRadius*2;return i.y+n/2}).attr("stroke",c.componentStroke).attr("stroke-width",6),A.append("text").attr("x",(e)=>{let i=p.get(e.id);if(e.className==="anchor")return e.labelOffsetX!==void 0?i.x+e.labelOffsetX:i.x;let n=r.nodeLabelOffset;if(e.sourceStrategy&&e.labelOffsetX===void 0)n+=10;let d=e.labelOffsetX??n;return i.x+d}).attr("y",(e)=>{let i=p.get(e.id);if(e.className==="anchor")return e.labelOffsetY!==void 0?i.y+e.labelOffsetY:i.y-3;let n=-r.nodeLabelOffset;if(e.sourceStrategy&&e.labelOffsetY===void 0)n-=10;let d=e.labelOffsetY??n;return i.y+d}).attr("class","wardley-node-label").attr("fill",(e)=>{if(e.className==="evolved")return c.evolutionStroke;if(e.className==="anchor")return"#000";return c.componentLabelColor}).attr("font-size",r.labelFontSize).attr("font-weight",(e)=>e.className==="anchor"?"bold":"normal").attr("text-anchor",(e)=>e.className==="anchor"?"middle":"start").attr("dominant-baseline",(e)=>e.className==="anchor"?"middle":"auto").text((e)=>e.label),u.annotations.length>0){let e=N.append("g").attr("class","wardley-annotations");if(u.annotations.forEach((i)=>{let n=i.coordinates.map((d)=>({x:E(d.x),y:Y(d.y)}));if(n.length>1)for(let d=0;d<n.length-1;d++)e.append("line").attr("class","wardley-annotation-line").attr("x1",n[d].x).attr("y1",n[d].y).attr("x2",n[d+1].x).attr("y2",n[d+1].y).attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach((d)=>{let h=e.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",d.x).attr("cy",d.y).attr("r",10).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",d.x).attr("y",d.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(i.number)})}),u.annotationsBox){let i=E(u.annotationsBox.x),n=Y(u.annotationsBox.y),d=10,h=16,f=11,y=e.append("g").attr("class","wardley-annotations-box"),x=[...u.annotations].filter((b)=>b.text).sort((b,L)=>b.number-L.number),w=[];if(x.forEach((b,L)=>{let X=y.append("text").attr("x",i+d).attr("y",n+d+(L+1)*h).attr("font-size",f).attr("fill",c.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${b.number}. ${b.text}`);w.push(X)}),w.length>0){let b=0,L=0;w.forEach((at)=>{let K=at.node(),Wt=K.getComputedTextLength();b=Math.max(b,Wt);let At=K.getBBox();L=Math.max(L,At.height)});let X=b+d*2+105,J=x.length*h+d*2+L/2,F=r.padding,zt=W-r.padding-X,Lt=r.padding,Tt=P-r.padding-J;i=Math.max(F,Math.min(i,zt)),n=Math.max(Lt,Math.min(n,Tt)),w.forEach((at,K)=>{at.attr("x",i+d).attr("y",n+d+(K+1)*h)}),y.insert("rect","text").attr("x",i).attr("y",n).attr("width",X).attr("height",J).attr("fill","white").attr("stroke",c.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(u.notes.length>0){let e=N.append("g").attr("class","wardley-notes");u.notes.forEach((i)=>{let n=E(i.x),d=Y(i.y);e.append("text").attr("x",n).attr("y",d).attr("text-anchor","start").attr("font-size",11).attr("fill",c.axisTextColor).attr("font-weight","bold").text(i.text)})}if(u.accelerators.length>0){let e=N.append("g").attr("class","wardley-accelerators");u.accelerators.forEach((i)=>{let n=E(i.x),d=Y(i.y),h=60,f=30,y=20,x=`
|
|
3
3
|
M ${n} ${d-15}
|
|
4
4
|
L ${n+60-20} ${d-15}
|
|
5
5
|
L ${n+60-20} ${d-15-8}
|
|
@@ -17,7 +17,7 @@ import{ke}from"./index-14dgbjsm.js";import{t,l,Kt,C,te,M,O,G,z,j,H,q,m,ge,ie}fro
|
|
|
17
17
|
L ${n+20} ${d+15}
|
|
18
18
|
L ${n+60} ${d+15}
|
|
19
19
|
Z
|
|
20
|
-
`;e.append("path").attr("d",x).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),e.append("text").attr("x",n+30).attr("y",d+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(i.name)})}},"draw"),
|
|
20
|
+
`;e.append("path").attr("d",x).attr("fill","white").attr("stroke",c.componentStroke).attr("stroke-width",1),e.append("text").attr("x",n+30).attr("y",d+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",c.axisTextColor).attr("font-weight","bold").text(i.name)})}},"draw"),Dt={draw:Ot},Gt=t(({wardley:a}={})=>{let s=Yt(),o=C(),g=le(s,o.themeVariables),r=le(g.wardley,a);return`
|
|
21
21
|
.wardley-background {
|
|
22
22
|
fill: ${r.backgroundColor};
|
|
23
23
|
}
|
|
@@ -75,4 +75,4 @@ import{ke}from"./index-14dgbjsm.js";import{t,l,Kt,C,te,M,O,G,z,j,H,q,m,ge,ie}fro
|
|
|
75
75
|
.wardley-notes text {
|
|
76
76
|
fill: ${r.axisTextColor};
|
|
77
77
|
}
|
|
78
|
-
`},"styles"),Qt={parser:it,db:
|
|
78
|
+
`},"styles"),Qt={parser:it,db:It,renderer:Dt,styles:Gt};export{Qt as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fi}from"./index-ej1va073.js";import"./index-0prwdwyb.js";export{fi as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{t,l,
|
|
1
|
+
import{t,l,Yt,Y,C,te,ne,M,O,G,z,j,q,H,So,nr,ll,Ae,le,$g}from"./index-x507ndnc.js";import{Aa}from"./index-pxr36neg.js";function Rt(e,i,s){e=+e,i=+i,s=(a=arguments.length)<2?(i=e,e=0,1):a<3?1:+s;var n=-1,a=Math.max(0,Math.ceil((i-e)/s))|0,h=Array(a);while(++n<a)h[n]=e+n*s;return h}function ct(){var e=nr().unknown(void 0),{domain:i,range:s}=e,n=0,a=1,h,c,x=!1,f=0,R=0,D=0.5;delete e.unknown;function _(){var y=i().length,V=a<n,L=V?a:n,E=V?n:a;if(h=(E-L)/Math.max(1,y-f+R*2),x)h=Math.floor(h);if(L+=(E-L-h*(y-f))*D,c=h*(1-f),x)L=Math.round(L),c=Math.round(c);var F=Rt(y).map(function(Z){return L+h*Z});return s(V?F.reverse():F)}return e.domain=function(y){return arguments.length?(i(y),_()):i()},e.range=function(y){return arguments.length?([n,a]=y,n=+n,a=+a,_()):[n,a]},e.rangeRound=function(y){return[n,a]=y,n=+n,a=+a,x=!0,_()},e.bandwidth=function(){return c},e.step=function(){return h},e.round=function(y){return arguments.length?(x=!!y,_()):x},e.padding=function(y){return arguments.length?(f=Math.min(1,R=+y),_()):f},e.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),_()):f},e.paddingOuter=function(y){return arguments.length?(R=+y,_()):R},e.align=function(y){return arguments.length?(D=Math.max(0,Math.min(1,y)),_()):D},e.copy=function(){return ct(i(),[n,a]).round(x).paddingInner(f).paddingOuter(R).align(D)},So.apply(_(),arguments)}var _t=function(){var e=t(function(U,r,g,d){for(g=g||{},d=U.length;d--;g[U[d]]=r);return g},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],n=[1,3],a=[1,5],h=[1,6],c=[1,7],x=[1,5,10,12,14,16,18,19,21,23,36,37,38],f=[1,25],R=[1,26],D=[1,28],_=[1,29],y=[1,30],V=[1,31],L=[1,32],E=[1,33],F=[1,34],Z=[1,35],tt=[1,36],w=[1,37],X=[1,43],u=[1,42],W=[1,47],N=[1,50],A=[1,10,12,14,16,18,19,21,23,36,37,38],it=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],I=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],rt=[1,65],v=[26,28],k={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:t(function(r,g,d,p,S,o,st){var m=o.length-1;switch(S){case 5:p.setOrientation(o[m]);break;case 9:p.setDiagramTitle(o[m].text.trim());break;case 12:p.setLineData({text:"",type:"text"},o[m]);break;case 13:p.setLineData(o[m-1],o[m]);break;case 14:p.setBarData({text:"",type:"text"},o[m]);break;case 15:p.setBarData(o[m-1],o[m]);break;case 16:this.$=o[m].trim(),p.setAccTitle(this.$);break;case 17:case 18:this.$=o[m].trim(),p.setAccDescription(this.$);break;case 19:this.$=o[m-1];break;case 20:case 30:this.$=[o[m-2],...o[m]];break;case 21:case 31:this.$=[o[m]];break;case 22:this.$={value:Number(o[m-1]),label:o[m]};break;case 23:this.$={value:Number(o[m]),label:""};break;case 24:p.setXAxisTitle(o[m]);break;case 25:p.setXAxisTitle(o[m-1]);break;case 26:p.setXAxisTitle({type:"text",text:""});break;case 27:p.setXAxisBand(o[m]);break;case 28:p.setXAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 29:this.$=o[m-1];break;case 32:p.setYAxisTitle(o[m]);break;case 33:p.setYAxisTitle(o[m-1]);break;case 34:p.setYAxisTitle({type:"text",text:""});break;case 35:p.setYAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 39:this.$={text:o[m],type:"text"};break;case 40:this.$={text:o[m],type:"text"};break;case 41:this.$={text:o[m],type:"markdown"};break;case 42:this.$=o[m];break;case 43:this.$=o[m-1]+""+o[m];break}},"anonymous"),table:[e(i,s,{3:1,4:2,7:4,5:n,36:a,37:h,38:c}),{1:[3]},e(i,s,{4:2,7:4,3:8,5:n,36:a,37:h,38:c}),e(i,s,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:a,37:h,38:c}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{1:[2,1]},e(i,s,{4:2,7:4,3:21,5:n,36:a,37:h,38:c}),{1:[2,3]},e(x,[2,5]),e(i,[2,7],{4:22,36:a,37:h,38:c}),{11:23,30:f,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},{11:39,13:38,24:X,29:u,30:f,31:40,32:41,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},{11:45,15:44,29:W,30:f,35:46,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},{11:49,17:48,24:N,30:f,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},{11:52,17:51,24:N,30:f,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},{20:[1,53]},{22:[1,54]},e(A,[2,18]),{1:[2,2]},e(A,[2,8]),e(A,[2,9]),e(it,[2,39],{41:55,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w}),e(it,[2,40]),e(it,[2,41]),e(I,[2,42]),e(I,[2,44]),e(I,[2,45]),e(I,[2,46]),e(I,[2,47]),e(I,[2,48]),e(I,[2,49]),e(I,[2,50]),e(I,[2,51]),e(I,[2,52]),e(I,[2,53]),e(A,[2,10]),e(A,[2,24],{32:41,31:56,24:X,29:u}),e(A,[2,26]),e(A,[2,27]),{33:[1,57]},{11:59,30:f,34:58,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},e(A,[2,11]),e(A,[2,32],{35:60,29:W}),e(A,[2,34]),{33:[1,61]},e(A,[2,12]),{17:62,24:N},{25:63,27:64,29:rt},e(A,[2,14]),{17:66,24:N},e(A,[2,16]),e(A,[2,17]),e(I,[2,43]),e(A,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(A,[2,33]),{29:[1,70]},e(A,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(v,[2,23],{30:[1,73]}),e(A,[2,15]),e(A,[2,28]),e(A,[2,29]),{11:59,30:f,34:74,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},e(A,[2,35]),e(A,[2,19]),{25:75,27:64,29:rt},e(v,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:t(function(r,g){if(g.recoverable)this.trace(r);else{var d=Error(r);throw d.hash=g,d}},"parseError"),parse:t(function(r){var g=this,d=[0],p=[],S=[null],o=[],st=this.table,m="",xt=0,Vt=0,Ft=0,de=2,Wt=1,xe=o.slice.call(arguments,1),P=Object.create(this.lexer),nt={yy:{}};for(var wt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,wt))nt.yy[wt]=this.yy[wt];if(P.setInput(r,nt.yy),nt.yy.lexer=P,nt.yy.parser=this,typeof P.yylloc>"u")P.yylloc={};var kt=P.yylloc;o.push(kt);var fe=P.options&&P.options.ranges;if(typeof nt.yy.parseError==="function")this.parseError=nt.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function pe(K){d.length=d.length-2*K,S.length=S.length-K,o.length=o.length-K}t(pe,"popStack");function Xt(){var K=p.pop()||P.lex()||Wt;if(typeof K!=="number"){if(K instanceof Array)p=K,K=p.pop();K=g.symbols_[K]||K}return K}t(Xt,"lex");var B,At,at,Q,Be,Ct,ht={},ft,et,Nt,pt;while(!0){if(at=d[d.length-1],this.defaultActions[at])Q=this.defaultActions[at];else{if(B===null||typeof B>"u")B=Xt();Q=st[at]&&st[at][B]}if(typeof Q>"u"||!Q.length||!Q[0]){var St="";pt=[];for(ft in st[at])if(this.terminals_[ft]&&ft>de)pt.push("'"+this.terminals_[ft]+"'");if(P.showPosition)St="Parse error on line "+(xt+1)+`:
|
|
2
2
|
`+P.showPosition()+`
|
|
3
|
-
Expecting `+pt.join(", ")+", got '"+(this.terminals_[B]||B)+"'";else St="Parse error on line "+(xt+1)+": Unexpected "+(B==Wt?"end of input":"'"+(this.terminals_[B]||B)+"'");this.parseError(St,{text:P.match,token:this.terminals_[B]||B,line:P.yylineno,loc:kt,expected:pt})}if(Q[0]instanceof Array&&Q.length>1)throw Error("Parse Error: multiple actions possible at state: "+at+", token: "+B);switch(Q[0]){case 1:if(d.push(B),S.push(P.yytext),o.push(P.yylloc),d.push(Q[1]),B=null,!At){if(Vt=P.yyleng,m=P.yytext,xt=P.yylineno,kt=P.yylloc,Ft>0)Ft--}else B=At,At=null;break;case 2:if(et=this.productions_[Q[1]][1],ht.$=S[S.length-et],ht._$={first_line:o[o.length-(et||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(et||1)].first_column,last_column:o[o.length-1].last_column},
|
|
3
|
+
Expecting `+pt.join(", ")+", got '"+(this.terminals_[B]||B)+"'";else St="Parse error on line "+(xt+1)+": Unexpected "+(B==Wt?"end of input":"'"+(this.terminals_[B]||B)+"'");this.parseError(St,{text:P.match,token:this.terminals_[B]||B,line:P.yylineno,loc:kt,expected:pt})}if(Q[0]instanceof Array&&Q.length>1)throw Error("Parse Error: multiple actions possible at state: "+at+", token: "+B);switch(Q[0]){case 1:if(d.push(B),S.push(P.yytext),o.push(P.yylloc),d.push(Q[1]),B=null,!At){if(Vt=P.yyleng,m=P.yytext,xt=P.yylineno,kt=P.yylloc,Ft>0)Ft--}else B=At,At=null;break;case 2:if(et=this.productions_[Q[1]][1],ht.$=S[S.length-et],ht._$={first_line:o[o.length-(et||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(et||1)].first_column,last_column:o[o.length-1].last_column},fe)ht._$.range=[o[o.length-(et||1)].range[0],o[o.length-1].range[1]];if(Ct=this.performAction.apply(ht,[m,Vt,xt,nt.yy,Q[1],S,o].concat(xe)),typeof Ct<"u")return Ct;if(et)d=d.slice(0,-1*et*2),S=S.slice(0,-1*et),o=o.slice(0,-1*et);d.push(this.productions_[Q[1]][0]),S.push(ht.$),o.push(ht._$),Nt=st[d[d.length-2]][d[d.length-1]],d.push(Nt);break;case 3:return!0}}return!0},"parse")},J=function(){var U={EOF:1,parseError:t(function(g,d){if(this.yy.parser)this.yy.parser.parseError(g,d);else throw Error(g)},"parseError"),setInput:t(function(r,g){if(this.yy=g||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var g=r.match(/(?:\r\n?|\n).*/g);if(g)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),r},"input"),unput:t(function(r){var g=r.length,d=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var p=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1)this.yylineno-=d.length-1;var S=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===p.length?this.yylloc.first_column:0)+p[p.length-d.length].length-d[0].length:this.yylloc.first_column-g},this.options.ranges)this.yylloc.range=[S[0],S[0]+this.yyleng-g];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(r){this.unput(this.match.slice(r))},"less"),pastInput:t(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var r=this.match;if(r.length<20)r+=this._input.substr(0,20-r.length);return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var r=this.pastInput(),g=Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
5
|
`+g+"^"},"showPosition"),test_match:t(function(r,g){var d,p,S;if(this.options.backtrack_lexer){if(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)S.yylloc.range=this.yylloc.range.slice(0)}if(p=r[0].match(/(?:\r\n?|\n).*/g),p)this.yylineno+=p.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],d=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(d)return d;else if(this._backtrack){for(var o in S)this[o]=S[o];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var r,g,d,p;if(!this._more)this.yytext="",this.match="";var S=this._currentRules();for(var o=0;o<S.length;o++)if(d=this._input.match(this.rules[S[o]]),d&&(!g||d[0].length>g[0].length)){if(g=d,p=o,this.options.backtrack_lexer)if(r=this.test_match(d,S[o]),r!==!1)return r;else if(this._backtrack){g=!1;continue}else return!1;else if(!this.options.flex)break}if(g){if(r=this.test_match(g,S[p]),r!==!1)return r;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:t(function(g){this.conditionStack.push(g)},"begin"),popState:t(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:t(function(g){this.begin(g)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(g,d,p,S){var o=S;switch(p){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return U}();k.lexer=J;function T(){this.yy={}}return t(T,"Parser"),T.prototype=k,k.Parser=T,new T}();_t.parser=_t;var be=_t;function mt(e){return e.type==="bar"}t(mt,"isBarPlot");function bt(e){return e.type==="band"}t(bt,"isBandAxisData");function lt(e){return e.type==="linear"}t(lt,"isLinearAxisData");var Pt=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((a,h)=>Math.max(h.length,a),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(let a of e){let h=Mg(n,1,a),c=h?h.width:a.length*i,x=h?h.height:i;s.width=Math.max(s.width,c),s.height=Math.max(s.height,x)}return n.remove(),s}},Yt=0.7,Ht=0.2,$t=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if(Yt*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor(Yt*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ht*e.width;this.outerPadding=Math.min(s.width/2,n);let a=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(a+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=Ht*e.height;this.outerPadding=Math.min(s.height/2,n);let a=s.width+this.axisConfig.labelPadding*2;if(a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},ye=class extends $t{static{t(this,"BandAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.categories=s,this.scale=ct().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=ct().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),l.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},we=class extends $t{static{t(this,"LinearAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.domain=s,this.scale=fa().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=fa().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Tt(e,i,s,n){let a=new Pt(n);if(bt(e))return new ye(i,s,e.categories,e.title,a);return new we(i,s,[e.min,e.max],e.title,a)}t(Tt,"getAxis");var ke=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function Ut(e,i,s,n){let a=new Pt(n);return new ke(a,e,i,s)}t(Ut,"getChartTitleComponent");var Ae=0.75,Ce=0.5,Se=0.35;function Dt(e){return{fontSize:e,markerSize:e*Ae,markerSpacing:e*Se,itemSpacing:e*Ce}}t(Dt,"getLegendLayout");var Re=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((f)=>f.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:a}=Dt(this.chartConfig.legendFontSize),h=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((f)=>f.title),i),c=this.chartConfig.legendPadding*2+s+n+h.width,x=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*a;if(c<=e.width&&x<=e.height)this.boundingRect.width=c,this.boundingRect.height=x;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=Dt(this.chartConfig.legendFontSize),a=e+n,h=this.boundingRect.x+this.chartConfig.legendPadding,c=this.boundingRect.y+this.chartConfig.legendPadding,x=[],f=[];for(let[R,D]of this.visiblePlots.entries())if(mt(D))x.push({x:h,y:c+R*a,width:i,height:i,fill:D.fill,strokeFill:D.fill,strokeWidth:0});else{let _=c+R*a+i/2;f.push({path:`M ${h},${_} L ${h+i},${_}`,strokeFill:D.strokeFill,strokeWidth:D.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:x},{groupTexts:["legend","markers"],type:"path",data:f},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((R,D)=>({text:R.title,x:h+i+s,y:c+D*a+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function qt(e,i,s,n){let a=new Pt(n);return new Re(a,e,i,s)}t(qt,"getChartLegendComponent");var _e=class{constructor(e,i,s,n,a){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=a}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=cl().y((n)=>n[0]).x((n)=>n[1])(e);else i=cl().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let h=[];for(let[c,[x,f]]of e.entries()){let R=this.plotData.pointLabels[c];if(!R)continue;if(this.orientation==="horizontal")h.push({x:f+10,y:x,text:R,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else h.push({x,y:f-10,text:R,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(h.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:h})}return s}},Te=class{constructor(e,i,s,n,a,h){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=a,this.plotIndex=h}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((a)=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:this.boundingRect.x,y:a[0]-n,height:s,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:a[0]-n,y:a[1],width:s,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},De=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new _e(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new Te(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function Gt(e,i,s){return new De(e,i,s)}t(Gt,"getPlotComponent");var ve=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:Ut(e,i,s,n),plot:Gt(e,i,s),legend:qt(e,i,s,n),xAxis:Tt(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Tt(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a={width:0,height:0},h=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),x=this.componentStore.plot.calculateSpace({width:h,height:c});if(e-=x.width,i-=x.height,x=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=x.height,i-=x.height,this.componentStore.xAxis.setAxisPosition("bottom"),x=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=x.height,this.componentStore.yAxis.setAxisPosition("left"),x=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=x.width,e-=x.width,a=this.componentStore.legend.calculateSpace({width:e,height:c}),e-=a.width,e>0)h+=e,e=0;if(i>0)c+=i,i=0;if(this.componentStore.plot.calculateSpace({width:h,height:c}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.legend.setBoundingBoxXY({x:s+h,y:n+Math.max((c-a.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+c}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((f)=>mt(f)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a=0,h={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),x=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:c,height:x});if(e-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("left"),f=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=f.width,n=f.width,this.componentStore.yAxis.setAxisPosition("top"),f=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=f.height,a=s+f.height,h=this.componentStore.legend.calculateSpace({width:e,height:x}),e-=h.width,e>0)c+=e,e=0;if(i>0)x+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:x}),this.componentStore.plot.setBoundingBoxXY({x:n,y:a}),this.componentStore.legend.setBoundingBoxXY({x:n+c,y:a+Math.max((x-h.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([a,a+x]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some((R)=>mt(R)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Pe=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new ve(e,i,s,n).getDrawableElement()}},gt=0,jt,ut=It(),dt=Et(),b=Mt(),vt=dt.plotColorPalette.split(",").map((e)=>e.trim()),yt=!1,Lt=!1;function Et(){let e=Kt(),i=C();return ie(e.xyChart,i.themeVariables.xyChart)}t(Et,"getChartDefaultThemeConfig");function It(){let e=C();return ie(Y.xyChart,e.xyChart)}t(It,"getChartDefaultConfig");function Mt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(Mt,"getChartDefaultData");function ot(e){let i=C();return ee(e.trim(),i)}t(ot,"textSanitizer");function Qt(e){jt=e}t(Qt,"setTmpSVGG");function Zt(e){if(e==="horizontal")ut.chartOrientation="horizontal";else ut.chartOrientation="vertical"}t(Zt,"setOrientation");function Jt(e){b.xAxis.title=ot(e.text)}t(Jt,"setXAxisTitle");function Bt(e,i){b.xAxis={type:"linear",title:b.xAxis.title,min:e,max:i},yt=!0}t(Bt,"setXAxisRangeData");function se(e){b.xAxis={type:"band",title:b.xAxis.title,categories:e.map((i)=>ot(i.text))},yt=!0}t(se,"setXAxisBand");function ne(e){b.yAxis.title=ot(e.text)}t(ne,"setYAxisTitle");function ae(e,i){b.yAxis={type:"linear",title:b.yAxis.title,min:e,max:i},Lt=!0}t(ae,"setYAxisRangeData");function oe(e){let i=Math.min(...e),s=Math.max(...e),n=lt(b.yAxis)?b.yAxis.min:1/0,a=lt(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(n,i),max:Math.max(a,s)}}t(oe,"setYAxisRangeFromPlotData");function zt(e){let i=[];if(e.length===0)return i;if(!yt){let s=lt(b.xAxis)?b.xAxis.min:1/0,n=lt(b.xAxis)?b.xAxis.max:-1/0;Bt(Math.min(s,1),Math.max(n,e.length))}if(bt(b.xAxis)&&e.length>b.xAxis.categories.length)e=e.slice(0,b.xAxis.categories.length);if(!Lt)oe(e);if(bt(b.xAxis))i=b.xAxis.categories.map((s,n)=>[s,e[n]]);if(lt(b.xAxis)){let s=b.xAxis.min,n=b.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let a=(n-s)/(e.length-1);i=e.map((h,c)=>[`${s+c*a}`,h])}}return i}t(zt,"transformDataWithoutCategory");function Ot(e){return vt[e===0?0:e%vt.length]}t(Ot,"getPlotColorFromPalette");function re(e,i){let s=i.map((c)=>c.value),n=i.map((c)=>c.label?ot(c.label):""),a=zt(s),h=n.some((c)=>c!=="");b.plots.push({type:"line",title:ot(e.text),strokeFill:Ot(gt),strokeWidth:2,data:a,...h?{pointLabels:n}:{}}),gt++}t(re,"setLineData");function he(e,i){let s=i.map((a)=>a.value),n=zt(s);b.plots.push({type:"bar",title:ot(e.text),fill:Ot(gt),data:n}),gt++}t(he,"setBarData");function le(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=q(),Pe.build(ut,b,dt,jt)}t(le,"getDrawableElem");function ce(){return dt}t(ce,"getChartThemeConfig");function ue(){return ut}t(ue,"getChartConfig");function de(){return b}t(de,"getXYChartData");var Le=t(function(){M(),gt=0,ut=It(),b=Mt(),dt=Et(),vt=dt.plotColorPalette.split(",").map((e)=>e.trim()),yt=!1,Lt=!1},"clear"),Ee={getDrawableElem:le,clear:Le,setAccTitle:O,getAccTitle:G,setDiagramTitle:H,getDiagramTitle:q,getAccDescription:j,setAccDescription:z,setOrientation:Zt,setXAxisTitle:Jt,setXAxisRangeData:Bt,setXAxisBand:se,setYAxisTitle:ne,setYAxisRangeData:ae,setLineData:re,setBarData:he,setTmpSVGG:Qt,getChartThemeConfig:ce,getChartConfig:ue,getXYChartData:de},Ie=t((e,i,s,n)=>{let a=n.db,h=a.getChartThemeConfig(),c=a.getChartConfig(),x=a.getXYChartData().plots[0].data.map((w)=>w[1]);function f(w){return w==="top"?"text-before-edge":"middle"}t(f,"getDominantBaseLine");function R(w){return w==="left"?"start":w==="right"?"end":"middle"}t(R,"getTextAnchor");function D(w){return`translate(${w.x}, ${w.y}) rotate(${w.rotation||0})`}t(D,"getTextTransformation"),l.debug(`Rendering xychart chart
|
|
7
|
-
`+e);let _=
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:t(function(g){this.conditionStack.push(g)},"begin"),popState:t(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:t(function(g){this.begin(g)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(g,d,p,S){var o=S;switch(p){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return U}();k.lexer=J;function T(){this.yy={}}return t(T,"Parser"),T.prototype=k,k.Parser=T,new T}();_t.parser=_t;var me=_t;function mt(e){return e.type==="bar"}t(mt,"isBarPlot");function bt(e){return e.type==="band"}t(bt,"isBandAxisData");function lt(e){return e.type==="linear"}t(lt,"isLinearAxisData");var Pt=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((a,h)=>Math.max(h.length,a),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(let a of e){let h=$g(n,1,a),c=h?h.width:a.length*i,x=h?h.height:i;s.width=Math.max(s.width,c),s.height=Math.max(s.height,x)}return n.remove(),s}},Ht=0.7,$t=0.2,Ut=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if(Ht*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor(Ht*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=$t*e.width;this.outerPadding=Math.min(s.width/2,n);let a=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(a+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=$t*e.height;this.outerPadding=Math.min(s.height/2,n);let a=s.width+this.axisConfig.labelPadding*2;if(a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},be=class extends Ut{static{t(this,"BandAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.categories=s,this.scale=ct().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=ct().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),l.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},ye=class extends Ut{static{t(this,"LinearAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.domain=s,this.scale=Aa().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=Aa().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Tt(e,i,s,n){let a=new Pt(n);if(bt(e))return new be(i,s,e.categories,e.title,a);return new ye(i,s,[e.min,e.max],e.title,a)}t(Tt,"getAxis");var we=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function qt(e,i,s,n){let a=new Pt(n);return new we(a,e,i,s)}t(qt,"getChartTitleComponent");var ke=0.75,Ce=0.5,Se=0.35;function Dt(e){return{fontSize:e,markerSize:e*ke,markerSpacing:e*Se,itemSpacing:e*Ce}}t(Dt,"getLegendLayout");var Re=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((f)=>f.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:a}=Dt(this.chartConfig.legendFontSize),h=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((f)=>f.title),i),c=this.chartConfig.legendPadding*2+s+n+h.width,x=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*a;if(c<=e.width&&x<=e.height)this.boundingRect.width=c,this.boundingRect.height=x;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=Dt(this.chartConfig.legendFontSize),a=e+n,h=this.boundingRect.x+this.chartConfig.legendPadding,c=this.boundingRect.y+this.chartConfig.legendPadding,x=[],f=[];for(let[R,D]of this.visiblePlots.entries())if(mt(D))x.push({x:h,y:c+R*a,width:i,height:i,fill:D.fill,strokeFill:D.fill,strokeWidth:0});else{let _=c+R*a+i/2;f.push({path:`M ${h},${_} L ${h+i},${_}`,strokeFill:D.strokeFill,strokeWidth:D.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:x},{groupTexts:["legend","markers"],type:"path",data:f},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((R,D)=>({text:R.title,x:h+i+s,y:c+D*a+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function Gt(e,i,s,n){let a=new Pt(n);return new Re(a,e,i,s)}t(Gt,"getChartLegendComponent");var _e=class{constructor(e,i,s,n,a){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=a}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=ll().y((n)=>n[0]).x((n)=>n[1])(e);else i=ll().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let h=[];for(let[c,[x,f]]of e.entries()){let R=this.plotData.pointLabels[c];if(!R)continue;if(this.orientation==="horizontal")h.push({x:f+10,y:x,text:R,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else h.push({x,y:f-10,text:R,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(h.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:h})}return s}},Te=class{constructor(e,i,s,n,a,h){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=a,this.plotIndex=h}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((a)=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:this.boundingRect.x,y:a[0]-n,height:s,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:a[0]-n,y:a[1],width:s,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},De=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new _e(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new Te(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function jt(e,i,s){return new De(e,i,s)}t(jt,"getPlotComponent");var ve=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:qt(e,i,s,n),plot:jt(e,i,s),legend:Gt(e,i,s,n),xAxis:Tt(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Tt(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a={width:0,height:0},h=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),x=this.componentStore.plot.calculateSpace({width:h,height:c});if(e-=x.width,i-=x.height,x=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=x.height,i-=x.height,this.componentStore.xAxis.setAxisPosition("bottom"),x=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=x.height,this.componentStore.yAxis.setAxisPosition("left"),x=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=x.width,e-=x.width,a=this.componentStore.legend.calculateSpace({width:e,height:c}),e-=a.width,e>0)h+=e,e=0;if(i>0)c+=i,i=0;if(this.componentStore.plot.calculateSpace({width:h,height:c}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.legend.setBoundingBoxXY({x:s+h,y:n+Math.max((c-a.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+c}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((f)=>mt(f)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a=0,h={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),x=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:c,height:x});if(e-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("left"),f=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=f.width,n=f.width,this.componentStore.yAxis.setAxisPosition("top"),f=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=f.height,a=s+f.height,h=this.componentStore.legend.calculateSpace({width:e,height:x}),e-=h.width,e>0)c+=e,e=0;if(i>0)x+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:x}),this.componentStore.plot.setBoundingBoxXY({x:n,y:a}),this.componentStore.legend.setBoundingBoxXY({x:n+c,y:a+Math.max((x-h.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([a,a+x]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some((R)=>mt(R)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Pe=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new ve(e,i,s,n).getDrawableElement()}},gt=0,Qt,ut=It(),dt=Et(),b=Mt(),vt=dt.plotColorPalette.split(",").map((e)=>e.trim()),yt=!1,Lt=!1;function Et(){let e=Yt(),i=C();return le(e.xyChart,i.themeVariables.xyChart)}t(Et,"getChartDefaultThemeConfig");function It(){let e=C();return le(Y.xyChart,e.xyChart)}t(It,"getChartDefaultConfig");function Mt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(Mt,"getChartDefaultData");function ot(e){let i=C();return te(e.trim(),i)}t(ot,"textSanitizer");function Kt(e){Qt=e}t(Kt,"setTmpSVGG");function Zt(e){if(e==="horizontal")ut.chartOrientation="horizontal";else ut.chartOrientation="vertical"}t(Zt,"setOrientation");function Jt(e){b.xAxis.title=ot(e.text)}t(Jt,"setXAxisTitle");function Bt(e,i){b.xAxis={type:"linear",title:b.xAxis.title,min:e,max:i},yt=!0}t(Bt,"setXAxisRangeData");function ee(e){b.xAxis={type:"band",title:b.xAxis.title,categories:e.map((i)=>ot(i.text))},yt=!0}t(ee,"setXAxisBand");function ie(e){b.yAxis.title=ot(e.text)}t(ie,"setYAxisTitle");function se(e,i){b.yAxis={type:"linear",title:b.yAxis.title,min:e,max:i},Lt=!0}t(se,"setYAxisRangeData");function ae(e){let i=Math.min(...e),s=Math.max(...e),n=lt(b.yAxis)?b.yAxis.min:1/0,a=lt(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(n,i),max:Math.max(a,s)}}t(ae,"setYAxisRangeFromPlotData");function zt(e){let i=[];if(e.length===0)return i;if(!yt){let s=lt(b.xAxis)?b.xAxis.min:1/0,n=lt(b.xAxis)?b.xAxis.max:-1/0;Bt(Math.min(s,1),Math.max(n,e.length))}if(bt(b.xAxis)&&e.length>b.xAxis.categories.length)e=e.slice(0,b.xAxis.categories.length);if(!Lt)ae(e);if(bt(b.xAxis))i=b.xAxis.categories.map((s,n)=>[s,e[n]]);if(lt(b.xAxis)){let s=b.xAxis.min,n=b.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let a=(n-s)/(e.length-1);i=e.map((h,c)=>[`${s+c*a}`,h])}}return i}t(zt,"transformDataWithoutCategory");function Ot(e){return vt[e===0?0:e%vt.length]}t(Ot,"getPlotColorFromPalette");function oe(e,i){let s=i.map((c)=>c.value),n=i.map((c)=>c.label?ot(c.label):""),a=zt(s),h=n.some((c)=>c!=="");b.plots.push({type:"line",title:ot(e.text),strokeFill:Ot(gt),strokeWidth:2,data:a,...h?{pointLabels:n}:{}}),gt++}t(oe,"setLineData");function re(e,i){let s=i.map((a)=>a.value),n=zt(s);b.plots.push({type:"bar",title:ot(e.text),fill:Ot(gt),data:n}),gt++}t(re,"setBarData");function he(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=H(),Pe.build(ut,b,dt,Qt)}t(he,"getDrawableElem");function ce(){return dt}t(ce,"getChartThemeConfig");function ge(){return ut}t(ge,"getChartConfig");function ue(){return b}t(ue,"getXYChartData");var Le=t(function(){M(),gt=0,ut=It(),b=Mt(),dt=Et(),vt=dt.plotColorPalette.split(",").map((e)=>e.trim()),yt=!1,Lt=!1},"clear"),Ee={getDrawableElem:he,clear:Le,setAccTitle:O,getAccTitle:G,setDiagramTitle:q,getDiagramTitle:H,getAccDescription:j,setAccDescription:z,setOrientation:Zt,setXAxisTitle:Jt,setXAxisRangeData:Bt,setXAxisBand:ee,setYAxisTitle:ie,setYAxisRangeData:se,setLineData:oe,setBarData:re,setTmpSVGG:Kt,getChartThemeConfig:ce,getChartConfig:ge,getXYChartData:ue},Ie=t((e,i,s,n)=>{let a=n.db,h=a.getChartThemeConfig(),c=a.getChartConfig(),x=a.getXYChartData().plots[0].data.map((w)=>w[1]);function f(w){return w==="top"?"text-before-edge":"middle"}t(f,"getDominantBaseLine");function R(w){return w==="left"?"start":w==="right"?"end":"middle"}t(R,"getTextAnchor");function D(w){return`translate(${w.x}, ${w.y}) rotate(${w.rotation||0})`}t(D,"getTextTransformation"),l.debug(`Rendering xychart chart
|
|
7
|
+
`+e);let _=Ae(i),y=_.append("g").attr("class","main"),V=y.append("rect").attr("width",c.width).attr("height",c.height).attr("class","background");ne(_,c.height,c.width,!0),_.attr("viewBox",`0 0 ${c.width} ${c.height}`),V.attr("fill",h.backgroundColor),a.setTmpSVGG(_.append("g").attr("class","mermaid-tmp-group"));let L=a.getDrawableElem(),E={};function F(w){let X=y,u="";for(let[W]of w.entries()){let N=y;if(W>0&&E[u])N=E[u];if(u+=w[W],X=E[u],!X)X=E[u]=N.append("g").attr("class",w[W])}return X}t(F,"getGroup");for(let w of L){if(w.data.length===0)continue;let X=F(w.groupTexts);switch(w.type){case"rect":if(X.selectAll("rect").data(w.data).enter().append("rect").attr("x",(u)=>u.x).attr("y",(u)=>u.y).attr("width",(u)=>u.width).attr("height",(u)=>u.height).attr("fill",(u)=>u.fill).attr("stroke",(u)=>u.strokeFill).attr("stroke-width",(u)=>u.strokeWidth),c.showDataLabel){let u=c.showDataLabelOutsideBar;if(c.chartOrientation==="horizontal"){let W=function(k,J){let{data:T,label:U}=k;return J*U.length*N<=T.width-A};var Z=W;t(W,"fitsHorizontally");let N=0.7,A=10,it=w.data.map((k,J)=>({data:k,label:x[J].toString()})).filter((k)=>k.data.width>0&&k.data.height>0),I=it.map((k)=>{let{data:J}=k,T=J.height*0.7;while(!W(k,T)&&T>0)T-=1;return T}),rt=Math.floor(Math.min(...I)),v=t((k)=>{if(u)return k.data.x+k.data.width+A;else return k.data.x+k.data.width-A},"determineLabelXPosition");X.selectAll("text").data(it).enter().append("text").attr("x",v).attr("y",(k)=>k.data.y+k.data.height/2).attr("text-anchor",u?"start":"end").attr("dominant-baseline","middle").attr("fill",h.dataLabelColor).attr("font-size",`${rt}px`).text((k)=>k.label)}else{let W=function(v,k,J){let{data:T,label:U}=v,r=0.7,g=k*U.length*0.7,d=T.x+T.width/2,p=d-g/2,S=d+g/2,o=p>=T.x&&S<=T.x+T.width,st=T.y+J+k<=T.y+T.height;return o&&st};var tt=W;t(W,"fitsInBar");let N=10,A=w.data.map((v,k)=>({data:v,label:x[k].toString()})).filter((v)=>v.data.width>0&&v.data.height>0),it=A.map((v)=>{let{data:k,label:J}=v,T=k.width/(J.length*0.7);while(!W(v,T,N)&&T>0)T-=1;return T}),I=Math.floor(Math.min(...it)),rt=t((v)=>{if(u)return v.data.y-N;else return v.data.y+N},"determineLabelYPosition");X.selectAll("text").data(A).enter().append("text").attr("x",(v)=>v.data.x+v.data.width/2).attr("y",rt).attr("text-anchor","middle").attr("dominant-baseline",u?"auto":"hanging").attr("fill",h.dataLabelColor).attr("font-size",`${I}px`).text((v)=>v.label)}}break;case"text":X.selectAll("text").data(w.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(u)=>u.fill).attr("font-size",(u)=>u.fontSize).attr("dominant-baseline",(u)=>f(u.verticalPos)).attr("text-anchor",(u)=>R(u.horizontalPos)).attr("transform",(u)=>D(u)).text((u)=>u.text);break;case"path":X.selectAll("path").data(w.data).enter().append("path").attr("d",(u)=>u.path).attr("fill",(u)=>u.fill?u.fill:"none").attr("stroke",(u)=>u.strokeFill).attr("stroke-width",(u)=>u.strokeWidth);break}}},"draw"),Me={draw:Ie},Ke={parser:me,db:Ee,renderer:Me};export{Ke as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Kg}from"./index-ms80nne4.js";export{Kg as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kabmo-labs/kabmo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"description": "Web console and diagnostic workbench for AI coding agents: Elysia + Preact on Bun.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Wijanarko Putra Rajeb <wijanarko.rajeb@gmail.com>",
|
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
"qrcode-generator": "^2.0.4",
|
|
101
101
|
"remend": "^1.3.1",
|
|
102
102
|
"ripgrep": "^0.3.1",
|
|
103
|
+
"sherpa-onnx-node": "^2.0.2",
|
|
103
104
|
"shiki": "^4.4.3",
|
|
104
105
|
"smol-toml": "^1.9.1",
|
|
105
106
|
"tailwindcss": "^4.1.14",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* resolved into the wiki's own tree.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
-
import type { TargetedMouseEvent } from 'preact';
|
|
28
|
+
import type { TargetedKeyboardEvent, TargetedMouseEvent } from 'preact';
|
|
29
29
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'preact/hooks';
|
|
30
30
|
import type { BlockVerdict, MdBlock } from '@/shared/lib/markdown/blocks/types';
|
|
31
31
|
import type { DocumentScope } from '@/shared/lib/markdown/document-urls';
|
|
@@ -38,7 +38,8 @@ import { useLocalImageSources, useMathHydration, useMermaidHydration } from '@/c
|
|
|
38
38
|
import { useRenderedMarkdown } from '@/client/hooks/ui/markdown-render';
|
|
39
39
|
import { useDirectiveContext, useDirectiveRenderer } from '@/client/hooks/workspace/directives';
|
|
40
40
|
import { copyFromButton } from '@/client/hooks/ui/clipboard';
|
|
41
|
-
import {
|
|
41
|
+
import { activateInlineFileChip } from '@/client/hooks/ui/open-inline-file';
|
|
42
|
+
import { followScopedLink } from '@/client/hooks/ui/markdown-scoped-links';
|
|
42
43
|
import { useSyntaxReady } from '@/client/hooks/ui/syntax-ready';
|
|
43
44
|
import { DiagramViewer } from '@/client/components/common/diagram-viewer';
|
|
44
45
|
import { readDiagramBlock, type DiagramSnapshot } from '@/client/components/common/diagram-viewer/read-block';
|
|
@@ -282,46 +283,41 @@ export function MarkdownRenderer({
|
|
|
282
283
|
return;
|
|
283
284
|
}
|
|
284
285
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
if (!link) return;
|
|
292
|
-
const raw = link.getAttribute('href') ?? '';
|
|
293
|
-
// An in-page anchor is the browser's own business — the heading it names
|
|
294
|
-
// carries the id the wiki's table of contents wrote. Letting the default
|
|
295
|
-
// through is the whole point; preventing it made every TOC entry inert.
|
|
296
|
-
if (raw.startsWith('#')) return;
|
|
286
|
+
// Inline code that names a file. The marker (`markInlineFilePaths`) put
|
|
287
|
+
// `data-file-path` on the span; a drag that ends on a chip is a selection
|
|
288
|
+
// being finished, not a click, and opening a tab then would destroy it.
|
|
289
|
+
const chip = (e.target as HTMLElement).closest<HTMLElement>('code[data-file-path]');
|
|
290
|
+
if (chip) {
|
|
291
|
+
if (window.getSelection()?.isCollapsed === false) return;
|
|
297
292
|
e.preventDefault();
|
|
298
293
|
e.stopPropagation();
|
|
299
|
-
|
|
300
|
-
if (target && onWikiNavigate) {
|
|
301
|
-
onWikiNavigate(target);
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
if (/^https?:/i.test(raw)) window.open(raw, '_blank', 'noopener,noreferrer');
|
|
305
|
-
// A relative href that resolved to nothing in this wiki is inert.
|
|
294
|
+
activateInlineFileChip(chip);
|
|
306
295
|
return;
|
|
307
296
|
}
|
|
308
297
|
|
|
309
|
-
|
|
298
|
+
// The scoped surfaces: a wiki page's own links, and a document's relative
|
|
299
|
+
// references (which the render pipeline rewrote to `data-file-path`).
|
|
300
|
+
if (isWiki || isDocument) {
|
|
301
|
+
const link = (e.target as HTMLElement).closest<HTMLAnchorElement>('a[href]');
|
|
302
|
+
if (link) {
|
|
303
|
+
followScopedLink(e, link, { isWiki, isDocument, scopeRoot, scopeRepo, onWikiNavigate });
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}, [isDocument, scopeRoot, scopeRepo, isWiki, onWikiNavigate]);
|
|
310
307
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
308
|
+
/**
|
|
309
|
+
* A chip is focusable (`role="button"` + `tabindex="0"`), because a
|
|
310
|
+
* click-only affordance is unreachable from the keyboard. Enter and Space are
|
|
311
|
+
* a button's two activations; Space would otherwise scroll the timeline.
|
|
312
|
+
*/
|
|
313
|
+
const handleContainerKeyDown = useCallback((e: TargetedKeyboardEvent<HTMLDivElement>) => {
|
|
314
|
+
if (e.key !== 'Enter' && e.key !== ' ') return;
|
|
315
|
+
const chip = (e.target as HTMLElement).closest<HTMLElement>('code[data-file-path]');
|
|
316
|
+
if (!chip) return;
|
|
316
317
|
e.preventDefault();
|
|
317
318
|
e.stopPropagation();
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
openFileInEditor({ path: filePath, root: scopeRoot, repo: scopeRepo });
|
|
321
|
-
} else if (/^https?:/i.test(link.href)) {
|
|
322
|
-
window.open(link.href, '_blank', 'noopener,noreferrer');
|
|
323
|
-
}
|
|
324
|
-
}, [isDocument, scopeRoot, scopeRepo, isWiki, onWikiNavigate]);
|
|
319
|
+
activateInlineFileChip(chip);
|
|
320
|
+
}, []);
|
|
325
321
|
|
|
326
322
|
const closeDiagram = useCallback(() => {
|
|
327
323
|
diagramBlockRef.current = null;
|
|
@@ -336,6 +332,7 @@ export function MarkdownRenderer({
|
|
|
336
332
|
ref={containerRef}
|
|
337
333
|
className={`prose-content text-[13px] text-ink leading-relaxed select-text ${className}`}
|
|
338
334
|
onClick={handleContainerClick}
|
|
335
|
+
onKeyDown={handleContainerKeyDown}
|
|
339
336
|
dangerouslySetInnerHTML={{ __html: html }}
|
|
340
337
|
/>
|
|
341
338
|
{diagram && <DiagramViewer {...diagram} onClose={closeDiagram} />}
|
|
@@ -136,6 +136,8 @@ export function BrowserViewportSelector({
|
|
|
136
136
|
<button
|
|
137
137
|
key={opt.id}
|
|
138
138
|
type="button"
|
|
139
|
+
role="menuitemradio"
|
|
140
|
+
aria-checked={isSelected}
|
|
139
141
|
onClick={() => {
|
|
140
142
|
onChangeViewport(opt.id);
|
|
141
143
|
setAnchor(null);
|
|
@@ -164,6 +166,8 @@ export function BrowserViewportSelector({
|
|
|
164
166
|
<button
|
|
165
167
|
key={opt.id}
|
|
166
168
|
type="button"
|
|
169
|
+
role="menuitemradio"
|
|
170
|
+
aria-checked={isSelected}
|
|
167
171
|
onClick={() => {
|
|
168
172
|
onChangeViewport(opt.id);
|
|
169
173
|
setAnchor(null);
|
|
@@ -48,10 +48,13 @@ export function CommandPalette() {
|
|
|
48
48
|
|
|
49
49
|
useEffect(() => {
|
|
50
50
|
if (!palette.open) return;
|
|
51
|
-
|
|
51
|
+
// A caller that opened the picker on a name (a chat chip with several
|
|
52
|
+
// matches) seeds the field; every chord-opened palette has no query and
|
|
53
|
+
// starts empty.
|
|
54
|
+
setQuery(palette.query ?? '');
|
|
52
55
|
setActiveIndex(0);
|
|
53
56
|
inputRef.current?.focus();
|
|
54
|
-
}, [palette.open, palette.mode]);
|
|
57
|
+
}, [palette.open, palette.mode, palette.query]);
|
|
55
58
|
|
|
56
59
|
useEffect(() => {
|
|
57
60
|
setActiveIndex((previous) => Math.min(previous, Math.max(items.length - 1, 0)));
|
|
@@ -28,11 +28,18 @@ interface HeaderButtonProps {
|
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
/** Marks the control busy for assistive tech while its read is in flight. */
|
|
30
30
|
busy?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* A toggle's ON state. Left undefined for a plain action — an unconditional
|
|
33
|
+
* `aria-pressed` would announce a state the button does not have. The pressed
|
|
34
|
+
* look holds the hover fill, so the state survives the pointer leaving.
|
|
35
|
+
*/
|
|
36
|
+
pressed?: boolean;
|
|
31
37
|
/** The glyph, drawn at 14px by the caller. */
|
|
32
38
|
children: ReactNode;
|
|
33
39
|
}
|
|
34
40
|
|
|
35
|
-
export function HeaderButton({ label, onClick, disabled, busy, children }: HeaderButtonProps) {
|
|
41
|
+
export function HeaderButton({ label, onClick, disabled, busy, pressed, children }: HeaderButtonProps) {
|
|
42
|
+
const pressedClass = pressed ? 'bg-ink/10 text-ink' : 'text-ink/80 hover:bg-ink/5';
|
|
36
43
|
return (
|
|
37
44
|
<button
|
|
38
45
|
type="button"
|
|
@@ -41,7 +48,8 @@ export function HeaderButton({ label, onClick, disabled, busy, children }: Heade
|
|
|
41
48
|
title={label}
|
|
42
49
|
aria-label={label}
|
|
43
50
|
aria-busy={busy || undefined}
|
|
44
|
-
|
|
51
|
+
aria-pressed={pressed === undefined ? undefined : pressed}
|
|
52
|
+
className={`flex-shrink-0 rounded-md p-1.5 transition-colors disabled:opacity-50 ${pressedClass}`}
|
|
45
53
|
>
|
|
46
54
|
{children}
|
|
47
55
|
</button>
|