@hienlh/ppm 0.9.0-beta.2 → 0.9.0-beta.4
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/CHANGELOG.md +10 -26
- package/dist/web/assets/{_basePickBy-CZovQgWd.js → _basePickBy-COwDPZl_.js} +1 -1
- package/dist/web/assets/{_baseUniq-ClnvscgW.js → _baseUniq-DCb0mkTp.js} +1 -1
- package/dist/web/assets/{api-settings--eVrUeZM.js → api-settings-CuUkz5gb.js} +1 -1
- package/dist/web/assets/{arc-C2Qaz-ch.js → arc-D0bJaFyD.js} +1 -1
- package/dist/web/assets/architecture-PBZL5I3N-281eTKQ3.js +1 -0
- package/dist/web/assets/{architectureDiagram-2XIMDMQ5-Jq91S_rs.js → architectureDiagram-2XIMDMQ5-BVEUkQYB.js} +1 -1
- package/dist/web/assets/arrow-left-C_j9Ki73.js +1 -0
- package/dist/web/assets/{blockDiagram-WCTKOSBZ-CKGufRTy.js → blockDiagram-WCTKOSBZ-CU2t4NHJ.js} +1 -1
- package/dist/web/assets/browser-tab-BhTdeeZd.js +1 -0
- package/dist/web/assets/{c4Diagram-IC4MRINW-BNP2L9r_.js → c4Diagram-IC4MRINW-DzjR91sM.js} +1 -1
- package/dist/web/assets/channel-CKNZAqoN.js +1 -0
- package/dist/web/assets/chat-tab-ZiiUVOxM.js +7 -0
- package/dist/web/assets/{chunk-4BX2VUAB-BptTlTyl.js → chunk-4BX2VUAB-0YMkpW2S.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-C4mUdyio.js → chunk-55IACEB6-Dp0pTM5r.js} +1 -1
- package/dist/web/assets/{chunk-7E7YKBS2-6xAQfBwa.js → chunk-7E7YKBS2-CuYKSUgJ.js} +1 -1
- package/dist/web/assets/{chunk-7R4GIKGN-DXaGAn_K.js → chunk-7R4GIKGN-DvbvLUIN.js} +2 -2
- package/dist/web/assets/{chunk-C72U2L5F-DOtEiN5f.js → chunk-C72U2L5F-CcEW1AMZ.js} +1 -1
- package/dist/web/assets/{chunk-EGIJ26TM-D0KJTa_T.js → chunk-EGIJ26TM-Cgt-qg75.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-C_1aG0eb.js → chunk-FMBD7UC4-JCLgVcaC.js} +1 -1
- package/dist/web/assets/{chunk-GEFDOKGD-DwVPiYfW.js → chunk-GEFDOKGD-B82RP9ow.js} +1 -1
- package/dist/web/assets/chunk-GLR3WWYH-Bx2UL5jF.js +2 -0
- package/dist/web/assets/chunk-HHEYEP7N-BnRVfNc5.js +1 -0
- package/dist/web/assets/{chunk-JSJVCQXG-BSrqCL_3.js → chunk-JSJVCQXG-Pb-JMOgO.js} +1 -1
- package/dist/web/assets/{chunk-KX2RTZJC-BCxGmbzy.js → chunk-KX2RTZJC-BRj-ZEvL.js} +1 -1
- package/dist/web/assets/{chunk-KYZI473N-BKO5gMeU.js → chunk-KYZI473N-CBRPKraG.js} +1 -1
- package/dist/web/assets/{chunk-L3YUKLVL-3wBgkSvL.js → chunk-L3YUKLVL-DNFj84V6.js} +1 -1
- package/dist/web/assets/{chunk-MX3YWQON-BgjSEzus.js → chunk-MX3YWQON-BnPzQK-O.js} +1 -1
- package/dist/web/assets/{chunk-NQ4KR5QH-DLrZwBEm.js → chunk-NQ4KR5QH-BRj25yO7.js} +1 -1
- package/dist/web/assets/{chunk-O4XLMI2P-BurQy8tt.js → chunk-O4XLMI2P-BdXwVXjJ.js} +1 -1
- package/dist/web/assets/{chunk-OZEHJAEY-YTn24bGg.js → chunk-OZEHJAEY-LfXT4p8B.js} +1 -1
- package/dist/web/assets/{chunk-PQ6SQG4A-BxtUGYhW.js → chunk-PQ6SQG4A-EdgQyTqa.js} +1 -1
- package/dist/web/assets/{chunk-PU5JKC2W-B66ELkQm.js → chunk-PU5JKC2W-D3thuSok.js} +1 -1
- package/dist/web/assets/chunk-QZHKN3VN-gaBt0Rbd.js +1 -0
- package/dist/web/assets/{chunk-R5LLSJPH-euR2RxLN.js → chunk-R5LLSJPH-LdG7RqsM.js} +1 -1
- package/dist/web/assets/{chunk-WL4C6EOR-_2CBOJdI.js → chunk-WL4C6EOR-BHFnnXOt.js} +1 -1
- package/dist/web/assets/{chunk-XIRO2GV7-kqQ0g6wW.js → chunk-XIRO2GV7-DUmQrLsF.js} +1 -1
- package/dist/web/assets/{chunk-XPW4576I-CtcaMb09.js → chunk-XPW4576I-CsGTseUr.js} +1 -1
- package/dist/web/assets/{chunk-XZSTWKYB-BYxFzZwS.js → chunk-XZSTWKYB-5W2emiq4.js} +1 -1
- package/dist/web/assets/{chunk-YBOYWFTD-Dx_fX35n.js → chunk-YBOYWFTD-COdZIaX4.js} +1 -1
- package/dist/web/assets/classDiagram-VBA2DB6C-CqaIqYPn.js +1 -0
- package/dist/web/assets/classDiagram-v2-RAHNMMFH-Bo5WN2ok.js +1 -0
- package/dist/web/assets/clone-DNDy9Sms.js +1 -0
- package/dist/web/assets/{code-editor-CQ7gq0Vj.js → code-editor-BRMOypkX.js} +1 -1
- package/dist/web/assets/{cose-bilkent-S5V4N54A-CHHjH2dV.js → cose-bilkent-S5V4N54A-C1QJ6GPW.js} +1 -1
- package/dist/web/assets/{dagre-CNtSxiE_.js → dagre-CWo8w9wK.js} +1 -1
- package/dist/web/assets/{dagre-KLK3FWXG-ChenfPp1.js → dagre-KLK3FWXG-Br4t5TRV.js} +1 -1
- package/dist/web/assets/database-viewer-CEoDpzPz.js +1 -0
- package/dist/web/assets/{diagram-E7M64L7V-CzKYZM0Y.js → diagram-E7M64L7V-CkDC2uAj.js} +1 -1
- package/dist/web/assets/{diagram-IFDJBPK2-ChB_paPo.js → diagram-IFDJBPK2-NvhckwcA.js} +1 -1
- package/dist/web/assets/{diagram-P4PSJMXO-D1eW1dkL.js → diagram-P4PSJMXO--nUaNiyB.js} +1 -1
- package/dist/web/assets/{diff-viewer-BjtTemkK.js → diff-viewer-jDU2bcGj.js} +1 -1
- package/dist/web/assets/{erDiagram-INFDFZHY-mCvUFSn6.js → erDiagram-INFDFZHY-DK4QEZYh.js} +1 -1
- package/dist/web/assets/{flowDiagram-PKNHOUZH-14ohZ1M1.js → flowDiagram-PKNHOUZH-B9h_Ba-v.js} +1 -1
- package/dist/web/assets/{ganttDiagram-A5KZAMGK-DIX0pLbk.js → ganttDiagram-A5KZAMGK-BVlftqyZ.js} +1 -1
- package/dist/web/assets/git-graph-DMQzw4Sp.js +1 -0
- package/dist/web/assets/gitGraph-HDMCJU4V-D5qEPjgs.js +1 -0
- package/dist/web/assets/{gitGraphDiagram-K3NZZRJ6-yEWZbdf_.js → gitGraphDiagram-K3NZZRJ6-L7sj3Bs-.js} +1 -1
- package/dist/web/assets/{graphlib-DhOZxqsh.js → graphlib-BbbiUImY.js} +1 -1
- package/dist/web/assets/index-B4Iz1Wbi.css +2 -0
- package/dist/web/assets/index-QiSWS6f-.js +37 -0
- package/dist/web/assets/info-3K5VOQVL-CbpovIYU.js +1 -0
- package/dist/web/assets/infoDiagram-LFFYTUFH-DFh9c-S2.js +2 -0
- package/dist/web/assets/input-DGlv6gt_.js +41 -0
- package/dist/web/assets/{isEmpty-C0YYdhYj.js → isEmpty-DXomfd7J.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-PHBUUO56-olazD6dZ.js → ishikawaDiagram-PHBUUO56-cW7SMLa_.js} +1 -1
- package/dist/web/assets/{journeyDiagram-4ABVD52K-CttDH9bb.js → journeyDiagram-4ABVD52K-DFQXUZsc.js} +1 -1
- package/dist/web/assets/{kanban-definition-K7BYSVSG-BBXbI37U.js → kanban-definition-K7BYSVSG-BMUhjxqj.js} +1 -1
- package/dist/web/assets/keybindings-store-BplH-yiN.js +1 -0
- package/dist/web/assets/{line-DBLLF7lH.js → line--xyfYP3x.js} +1 -1
- package/dist/web/assets/{linear-BLFWatDe.js → linear-BdqW7iQu.js} +1 -1
- package/dist/web/assets/{markdown-renderer-BtPXdzTv.js → markdown-renderer-BCjJbGP8.js} +5 -5
- package/dist/web/assets/{mermaid-parser.core-BKiGOTjR.js → mermaid-parser.core-BY8JfkE_.js} +2 -2
- package/dist/web/assets/{mindmap-definition-YRQLILUH-DoT7m4Sz.js → mindmap-definition-YRQLILUH-DIv-LMXG.js} +1 -1
- package/dist/web/assets/{ordinal-CCj7PWgZ.js → ordinal-CIoJK3nc.js} +1 -1
- package/dist/web/assets/packet-RMMSAZCW-BbzPU9BK.js +1 -0
- package/dist/web/assets/pie-UPGHQEXC-B0h6hM1j.js +1 -0
- package/dist/web/assets/{pieDiagram-SKSYHLDU-Bkh2E4zE.js → pieDiagram-SKSYHLDU-seSK40d1.js} +1 -1
- package/dist/web/assets/postgres-viewer-s0snZ9CL.js +1 -0
- package/dist/web/assets/{quadrantDiagram-337W2JSQ-B7zgALOL.js → quadrantDiagram-337W2JSQ-BaRFqlsA.js} +1 -1
- package/dist/web/assets/radar-KQ55EAFF-CHptMqVT.js +1 -0
- package/dist/web/assets/{requirementDiagram-Z7DCOOCP-D_5GXNRo.js → requirementDiagram-Z7DCOOCP-1WWjMQB_.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-WA2Y5GQK-BA9EFAAe.js → sankeyDiagram-WA2Y5GQK-DEGGYsk7.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-2WXFIKYE-fyWIrHiG.js → sequenceDiagram-2WXFIKYE-BtRvoUTC.js} +1 -1
- package/dist/web/assets/{settings-store-Bbhg_ptG.js → settings-store-D3dJqGhB.js} +2 -2
- package/dist/web/assets/settings-tab-2YkgmrY0.js +1 -0
- package/dist/web/assets/sqlite-viewer-B5GNwXaG.js +1 -0
- package/dist/web/assets/{stateDiagram-RAJIS63D-DfRBcaBu.js → stateDiagram-RAJIS63D-C16aO8tn.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-FVOUBMTO-D7qSAjnK.js +1 -0
- package/dist/web/assets/switch-mjGtIVDJ.js +1 -0
- package/dist/web/assets/{tab-store-dpsCvqhH.js → tab-store-DSz5PQI0.js} +1 -1
- package/dist/web/assets/{terminal-tab--Gw14HP3.js → terminal-tab-MRg8y1xF.js} +2 -2
- package/dist/web/assets/{timeline-definition-YZTLITO2-DYfwJ1jM.js → timeline-definition-YZTLITO2-DrjxCpEM.js} +1 -1
- package/dist/web/assets/treemap-KZPCXAKY-BL9OJq3X.js +1 -0
- package/dist/web/assets/{use-monaco-theme-DHbyUrzJ.js → use-monaco-theme-BQzvItNE.js} +1 -1
- package/dist/web/assets/{vennDiagram-LZ73GAT5-DqbKNRD9.js → vennDiagram-LZ73GAT5-DfYFnniI.js} +1 -1
- package/dist/web/assets/{xychartDiagram-JWTSCODW-DhUL86qT.js → xychartDiagram-JWTSCODW-BRvXOVlG.js} +1 -1
- package/dist/web/index.html +12 -10
- package/dist/web/sw.js +1 -1
- package/docs/code-standards.md +260 -7
- package/docs/codebase-summary.md +255 -95
- package/docs/project-changelog.md +88 -1
- package/docs/system-architecture.md +177 -12
- package/package.json +1 -1
- package/src/providers/claude-agent-sdk.ts +9 -0
- package/src/providers/cli-provider-base.ts +238 -0
- package/src/providers/cursor-cli/cursor-event-mapper.ts +85 -0
- package/src/providers/cursor-cli/cursor-history.ts +207 -0
- package/src/providers/cursor-cli/cursor-provider.ts +146 -0
- package/src/providers/mock-provider.ts +1 -1
- package/src/providers/provider.interface.ts +1 -0
- package/src/providers/registry.ts +43 -4
- package/src/server/index.ts +8 -0
- package/src/server/routes/browser-preview.ts +89 -0
- package/src/server/routes/chat.ts +14 -3
- package/src/server/routes/settings.ts +14 -0
- package/src/server/ws/chat.ts +24 -8
- package/src/services/chat.service.ts +10 -15
- package/src/types/chat.ts +21 -2
- package/src/types/config.ts +33 -11
- package/src/utils/ndjson-line-parser.ts +36 -0
- package/src/web/components/browser/browser-tab.tsx +269 -0
- package/src/web/components/chat/chat-history-bar.tsx +49 -29
- package/src/web/components/chat/chat-tab.tsx +14 -2
- package/src/web/components/chat/message-input.tsx +91 -3
- package/src/web/components/chat/provider-selector.tsx +150 -0
- package/src/web/components/chat/session-picker.tsx +3 -1
- package/src/web/components/layout/command-palette.tsx +4 -0
- package/src/web/components/layout/editor-panel.tsx +1 -0
- package/src/web/components/layout/mobile-nav.tsx +2 -2
- package/src/web/components/layout/panel-layout.tsx +17 -1
- package/src/web/components/layout/tab-bar.tsx +2 -0
- package/src/web/components/layout/tab-content.tsx +5 -0
- package/src/web/components/settings/ai-settings-section.tsx +196 -137
- package/src/web/hooks/use-chat.ts +11 -0
- package/src/web/hooks/use-global-keybindings.ts +7 -0
- package/src/web/hooks/use-voice-input.ts +111 -0
- package/src/web/stores/keybindings-store.ts +1 -0
- package/src/web/stores/panel-store.ts +10 -10
- package/src/web/stores/tab-store.ts +2 -1
- package/dist/web/assets/architecture-PBZL5I3N-ChOahOB7.js +0 -1
- package/dist/web/assets/channel-w7yboq56.js +0 -1
- package/dist/web/assets/chat-tab-DmF14O6G.js +0 -7
- package/dist/web/assets/chunk-GLR3WWYH-D9pZakqr.js +0 -2
- package/dist/web/assets/chunk-HHEYEP7N-Dld5BpGB.js +0 -1
- package/dist/web/assets/chunk-QZHKN3VN-DwSXwtjH.js +0 -1
- package/dist/web/assets/classDiagram-VBA2DB6C-BpJ6Oog2.js +0 -1
- package/dist/web/assets/classDiagram-v2-RAHNMMFH-Bj8gIhkP.js +0 -1
- package/dist/web/assets/clone-BSi6cgDh.js +0 -1
- package/dist/web/assets/database-viewer-B27aRtdQ.js +0 -1
- package/dist/web/assets/git-graph-BGXo0o-J.js +0 -1
- package/dist/web/assets/gitGraph-HDMCJU4V-CEee2FCA.js +0 -1
- package/dist/web/assets/index-BAioKo_2.css +0 -2
- package/dist/web/assets/index-CfClIVo2.js +0 -37
- package/dist/web/assets/info-3K5VOQVL-ce_pi3En.js +0 -1
- package/dist/web/assets/infoDiagram-LFFYTUFH-BzqyoqXw.js +0 -2
- package/dist/web/assets/input-Brjz2Vv-.js +0 -41
- package/dist/web/assets/keybindings-store-nDbczFnq.js +0 -1
- package/dist/web/assets/packet-RMMSAZCW-CdYSLjRL.js +0 -1
- package/dist/web/assets/pie-UPGHQEXC-Bm5LiD-6.js +0 -1
- package/dist/web/assets/postgres-viewer-BMg-qFcO.js +0 -1
- package/dist/web/assets/radar-KQ55EAFF-C4PnyG7_.js +0 -1
- package/dist/web/assets/settings-tab-NPuwQHzs.js +0 -1
- package/dist/web/assets/sqlite-viewer-CAsUczio.js +0 -1
- package/dist/web/assets/stateDiagram-v2-FVOUBMTO-CMN4M2Em.js +0 -1
- package/dist/web/assets/treemap-KZPCXAKY-2_y-mhkz.js +0 -1
- package/snapshot-state.md +0 -1526
- package/test-tokens.mjs +0 -212
- /package/dist/web/assets/{api-client-DpGMOZNf.js → api-client-icCZ-07C.js} +0 -0
- /package/dist/web/assets/{array-BGFCBI0e.js → array-CLwNaqU1.js} +0 -0
- /package/dist/web/assets/{columns-2-ChOTgl3e.js → columns-2-Bcg3QJBg.js} +0 -0
- /package/dist/web/assets/{cytoscape.esm-Ccan6xou.js → cytoscape.esm-B-QQuWwK.js} +0 -0
- /package/dist/web/assets/{defaultLocale-CRZydyG6.js → defaultLocale-D_VMtRaY.js} +0 -0
- /package/dist/web/assets/{dist-T0Vhi0Mh.js → dist-CMmNEgEP.js} +0 -0
- /package/dist/web/assets/{dist-Cce3efmT.js → dist-Ckxnw5rl.js} +0 -0
- /package/dist/web/assets/{init-B8gtcn7T.js → init-vVpfz1D6.js} +0 -0
- /package/dist/web/assets/{isArrayLikeObject-B4pdpV8V.js → isArrayLikeObject-DvHDmeBe.js} +0 -0
- /package/dist/web/assets/{katex-Bbu770d9.js → katex-C3cZrCvP.js} +0 -0
- /package/dist/web/assets/{math-DwgHI-Cu.js → math-a44lmFDa.js} +0 -0
- /package/dist/web/assets/{path-DZF-JdEe.js → path-CuyvWNAH.js} +0 -0
- /package/dist/web/assets/{preload-helper-qlgyTAkD.js → preload-helper-CsoeaaUJ.js} +0 -0
- /package/dist/web/assets/{react-BGf7KNLk.js → react-BPIfZRKM.js} +0 -0
- /package/dist/web/assets/{rough.esm-VLpapkIG.js → rough.esm-c4PR5shF.js} +0 -0
- /package/dist/web/assets/{src-BoSBNdA_.js → src-CLWraeNW.js} +0 -0
- /package/dist/web/assets/{table-Yo02WRH-.js → table-C9jDaRl2.js} +0 -0
- /package/dist/web/assets/{tag-CaC1ng2E.js → tag-CENGyt_L.js} +0 -0
- /package/dist/web/assets/{utils-btZ8C8-R.js → utils-Bslrbb-G.js} +0 -0
package/dist/web/assets/{sankeyDiagram-WA2Y5GQK-BA9EFAAe.js → sankeyDiagram-WA2Y5GQK-DEGGYsk7.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as e,p as t}from"./src-BoSBNdA_.js";import{B as n,C as r,K as i,V as a,W as o,_ as s,a as c,b as l,s as u,u as d,v as f}from"./chunk-7R4GIKGN-DXaGAn_K.js";import{t as p}from"./ordinal-CCj7PWgZ.js";function m(e){for(var t=e.length/6|0,n=Array(t),r=0;r<t;)n[r]=`#`+e.slice(r*6,++r*6);return n}var h=m(`4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab`);function g(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function _(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function v(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function y(e){return e.target.depth}function b(e){return e.depth}function x(e,t){return t-1-e.height}function S(e,t){return e.sourceLinks.length?e.depth:t-1}function C(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?_(e.sourceLinks,y)-1:0}function w(e){return function(){return e}}function T(e,t){return D(e.source,t.source)||e.index-t.index}function E(e,t){return D(e.target,t.target)||e.index-t.index}function D(e,t){return e.y0-t.y0}function O(e){return e.value}function k(e){return e.index}function A(e){return e.nodes}function j(e){return e.links}function M(e,t){let n=e.get(t);if(!n)throw Error(`missing: `+t);return n}function N({nodes:e}){for(let t of e){let e=t.y0,n=e;for(let n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(let e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function P(){let e=0,t=0,n=1,r=1,i=24,a=8,o,s=k,c=S,l,u,d=A,f=j,p=6;function m(){let e={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return h(e),y(e),b(e),x(e),F(e),N(e),e}m.update=function(e){return N(e),e},m.nodeId=function(e){return arguments.length?(s=typeof e==`function`?e:w(e),m):s},m.nodeAlign=function(e){return arguments.length?(c=typeof e==`function`?e:w(e),m):c},m.nodeSort=function(e){return arguments.length?(l=e,m):l},m.nodeWidth=function(e){return arguments.length?(i=+e,m):i},m.nodePadding=function(e){return arguments.length?(a=o=+e,m):a},m.nodes=function(e){return arguments.length?(d=typeof e==`function`?e:w(e),m):d},m.links=function(e){return arguments.length?(f=typeof e==`function`?e:w(e),m):f},m.linkSort=function(e){return arguments.length?(u=e,m):u},m.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],m):[n-e,r-t]},m.extent=function(i){return arguments.length?(e=+i[0][0],n=+i[1][0],t=+i[0][1],r=+i[1][1],m):[[e,t],[n,r]]},m.iterations=function(e){return arguments.length?(p=+e,m):p};function h({nodes:e,links:t}){for(let[t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];let n=new Map(e.map((t,n)=>[s(t,n,e),t]));for(let[e,r]of t.entries()){r.index=e;let{source:t,target:i}=r;typeof t!=`object`&&(t=r.source=M(n,t)),typeof i!=`object`&&(i=r.target=M(n,i)),t.sourceLinks.push(r),i.targetLinks.push(r)}if(u!=null)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(u),n.sort(u)}function y({nodes:e}){for(let t of e)t.value=t.fixedValue===void 0?Math.max(v(t.sourceLinks,O),v(t.targetLinks,O)):t.fixedValue}function b({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.depth=i;for(let{target:t}of e.sourceLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function x({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.height=i;for(let{source:t}of e.targetLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function C({nodes:t}){let r=g(t,e=>e.depth)+1,a=(n-e-i)/(r-1),o=Array(r);for(let n of t){let t=Math.max(0,Math.min(r-1,Math.floor(c.call(null,n,r))));n.layer=t,n.x0=e+t*a,n.x1=n.x0+i,o[t]?o[t].push(n):o[t]=[n]}if(l)for(let e of o)e.sort(l);return o}function P(e){let n=_(e,e=>(r-t-(e.length-1)*o)/v(e,O));for(let i of e){let e=t;for(let t of i){t.y0=e,t.y1=e+t.value*n,e=t.y1+o;for(let e of t.sourceLinks)e.width=e.value*n}e=(r-e+o)/(i.length+1);for(let t=0;t<i.length;++t){let n=i[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}H(i)}}function F(e){let n=C(e);o=Math.min(a,(r-t)/(g(n,e=>e.length)-1)),P(n);for(let e=0;e<p;++e){let t=.99**e,r=Math.max(1-t,(e+1)/p);L(n,t,r),I(n,t,r)}}function I(e,t,n){for(let r=1,i=e.length;r<i;++r){let i=e[r];for(let e of i){let n=0,r=0;for(let{source:t,value:i}of e.targetLinks){let a=i*(e.layer-t.layer);n+=U(t,e)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function L(e,t,n){for(let r=e.length-2;r>=0;--r){let i=e[r];for(let e of i){let n=0,r=0;for(let{target:t,value:i}of e.sourceLinks){let a=i*(t.layer-e.layer);n+=W(e,t)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function R(e,n){let i=e.length>>1,a=e[i];B(e,a.y0-o,i-1,n),z(e,a.y1+o,i+1,n),B(e,r,e.length-1,n),z(e,t,0,n)}function z(e,t,n,r){for(;n<e.length;++n){let i=e[n],a=(t-i.y0)*r;a>1e-6&&(i.y0+=a,i.y1+=a),t=i.y1+o}}function B(e,t,n,r){for(;n>=0;--n){let i=e[n],a=(i.y1-t)*r;a>1e-6&&(i.y0-=a,i.y1-=a),t=i.y0-o}}function V({sourceLinks:e,targetLinks:t}){if(u===void 0){for(let{source:{sourceLinks:e}}of t)e.sort(E);for(let{target:{targetLinks:t}}of e)t.sort(T)}}function H(e){if(u===void 0)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(E),n.sort(T)}function U(e,t){let n=e.y0-(e.sourceLinks.length-1)*o/2;for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n+=i+o}for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n-=i}return n}function W(e,t){let n=t.y0-(t.targetLinks.length-1)*o/2;for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n+=i+o}for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n-=i}return n}return m}var F=Math.PI,I=2*F,L=1e-6,R=I-L;function z(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function B(){return new z}z.prototype=B.prototype={constructor:z,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>L)if(!(Math.abs(u*s-c*l)>L)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((F-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>L&&(this._+=`L`+(e+y*l)+`,`+(t+y*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*p)+`,`+(this._x1=e+b*s)+`,`+(this._y1=t+b*c)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>L||Math.abs(this._y1-l)>L)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%I+I),d>R?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>L&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=F)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}};function V(e){return function(){return e}}function H(e){return e[0]}function U(e){return e[1]}var W=Array.prototype.slice;function ee(e){return e.source}function G(e){return e.target}function K(e){var t=ee,n=G,r=H,i=U,a=null;function o(){var o,s=W.call(arguments),c=t.apply(this,s),l=n.apply(this,s);if(a||=o=B(),e(a,+r.apply(this,(s[0]=c,s)),+i.apply(this,s),+r.apply(this,(s[0]=l,s)),+i.apply(this,s)),o)return a=null,o+``||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r=typeof e==`function`?e:V(+e),o):r},o.y=function(e){return arguments.length?(i=typeof e==`function`?e:V(+e),o):i},o.context=function(e){return arguments.length?(a=e??null,o):a},o}function q(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function te(){return K(q)}function ne(e){return[e.source.x1,e.y0]}function re(e){return[e.target.x0,e.y1]}function ie(){return te().source(ne).target(re)}var J=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,9],r=[1,10],i=[1,5,10,12],a={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:`error`,4:`SANKEY`,5:`NEWLINE`,10:`EOF`,11:`field[source]`,12:`COMMA`,13:`field[target]`,14:`field[value]`,18:`DQUOTE`,19:`ESCAPED_TEXT`,20:`NON_ESCAPED_TEXT`},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 7:let e=r.findOrCreateNode(a[s-4].trim().replaceAll(`""`,`"`)),t=r.findOrCreateNode(a[s-2].trim().replaceAll(`""`,`"`)),n=parseFloat(a[s].trim());r.addLink(e,t,n);break;case 8:case 9:case 11:this.$=a[s];break;case 10:this.$=a[s-1];break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:r},{15:18,16:7,17:8,18:n,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
1
|
+
import{h as e,p as t}from"./src-CLWraeNW.js";import{B as n,C as r,K as i,V as a,W as o,_ as s,a as c,b as l,s as u,u as d,v as f}from"./chunk-7R4GIKGN-DvbvLUIN.js";import{t as p}from"./ordinal-CIoJK3nc.js";function m(e){for(var t=e.length/6|0,n=Array(t),r=0;r<t;)n[r]=`#`+e.slice(r*6,++r*6);return n}var h=m(`4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab`);function g(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function _(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function v(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function y(e){return e.target.depth}function b(e){return e.depth}function x(e,t){return t-1-e.height}function S(e,t){return e.sourceLinks.length?e.depth:t-1}function C(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?_(e.sourceLinks,y)-1:0}function w(e){return function(){return e}}function T(e,t){return D(e.source,t.source)||e.index-t.index}function E(e,t){return D(e.target,t.target)||e.index-t.index}function D(e,t){return e.y0-t.y0}function O(e){return e.value}function k(e){return e.index}function A(e){return e.nodes}function j(e){return e.links}function M(e,t){let n=e.get(t);if(!n)throw Error(`missing: `+t);return n}function N({nodes:e}){for(let t of e){let e=t.y0,n=e;for(let n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(let e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function P(){let e=0,t=0,n=1,r=1,i=24,a=8,o,s=k,c=S,l,u,d=A,f=j,p=6;function m(){let e={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return h(e),y(e),b(e),x(e),F(e),N(e),e}m.update=function(e){return N(e),e},m.nodeId=function(e){return arguments.length?(s=typeof e==`function`?e:w(e),m):s},m.nodeAlign=function(e){return arguments.length?(c=typeof e==`function`?e:w(e),m):c},m.nodeSort=function(e){return arguments.length?(l=e,m):l},m.nodeWidth=function(e){return arguments.length?(i=+e,m):i},m.nodePadding=function(e){return arguments.length?(a=o=+e,m):a},m.nodes=function(e){return arguments.length?(d=typeof e==`function`?e:w(e),m):d},m.links=function(e){return arguments.length?(f=typeof e==`function`?e:w(e),m):f},m.linkSort=function(e){return arguments.length?(u=e,m):u},m.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],m):[n-e,r-t]},m.extent=function(i){return arguments.length?(e=+i[0][0],n=+i[1][0],t=+i[0][1],r=+i[1][1],m):[[e,t],[n,r]]},m.iterations=function(e){return arguments.length?(p=+e,m):p};function h({nodes:e,links:t}){for(let[t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];let n=new Map(e.map((t,n)=>[s(t,n,e),t]));for(let[e,r]of t.entries()){r.index=e;let{source:t,target:i}=r;typeof t!=`object`&&(t=r.source=M(n,t)),typeof i!=`object`&&(i=r.target=M(n,i)),t.sourceLinks.push(r),i.targetLinks.push(r)}if(u!=null)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(u),n.sort(u)}function y({nodes:e}){for(let t of e)t.value=t.fixedValue===void 0?Math.max(v(t.sourceLinks,O),v(t.targetLinks,O)):t.fixedValue}function b({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.depth=i;for(let{target:t}of e.sourceLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function x({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.height=i;for(let{source:t}of e.targetLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function C({nodes:t}){let r=g(t,e=>e.depth)+1,a=(n-e-i)/(r-1),o=Array(r);for(let n of t){let t=Math.max(0,Math.min(r-1,Math.floor(c.call(null,n,r))));n.layer=t,n.x0=e+t*a,n.x1=n.x0+i,o[t]?o[t].push(n):o[t]=[n]}if(l)for(let e of o)e.sort(l);return o}function P(e){let n=_(e,e=>(r-t-(e.length-1)*o)/v(e,O));for(let i of e){let e=t;for(let t of i){t.y0=e,t.y1=e+t.value*n,e=t.y1+o;for(let e of t.sourceLinks)e.width=e.value*n}e=(r-e+o)/(i.length+1);for(let t=0;t<i.length;++t){let n=i[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}H(i)}}function F(e){let n=C(e);o=Math.min(a,(r-t)/(g(n,e=>e.length)-1)),P(n);for(let e=0;e<p;++e){let t=.99**e,r=Math.max(1-t,(e+1)/p);L(n,t,r),I(n,t,r)}}function I(e,t,n){for(let r=1,i=e.length;r<i;++r){let i=e[r];for(let e of i){let n=0,r=0;for(let{source:t,value:i}of e.targetLinks){let a=i*(e.layer-t.layer);n+=U(t,e)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function L(e,t,n){for(let r=e.length-2;r>=0;--r){let i=e[r];for(let e of i){let n=0,r=0;for(let{target:t,value:i}of e.sourceLinks){let a=i*(t.layer-e.layer);n+=W(e,t)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function R(e,n){let i=e.length>>1,a=e[i];B(e,a.y0-o,i-1,n),z(e,a.y1+o,i+1,n),B(e,r,e.length-1,n),z(e,t,0,n)}function z(e,t,n,r){for(;n<e.length;++n){let i=e[n],a=(t-i.y0)*r;a>1e-6&&(i.y0+=a,i.y1+=a),t=i.y1+o}}function B(e,t,n,r){for(;n>=0;--n){let i=e[n],a=(i.y1-t)*r;a>1e-6&&(i.y0-=a,i.y1-=a),t=i.y0-o}}function V({sourceLinks:e,targetLinks:t}){if(u===void 0){for(let{source:{sourceLinks:e}}of t)e.sort(E);for(let{target:{targetLinks:t}}of e)t.sort(T)}}function H(e){if(u===void 0)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(E),n.sort(T)}function U(e,t){let n=e.y0-(e.sourceLinks.length-1)*o/2;for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n+=i+o}for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n-=i}return n}function W(e,t){let n=t.y0-(t.targetLinks.length-1)*o/2;for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n+=i+o}for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n-=i}return n}return m}var F=Math.PI,I=2*F,L=1e-6,R=I-L;function z(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function B(){return new z}z.prototype=B.prototype={constructor:z,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>L)if(!(Math.abs(u*s-c*l)>L)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((F-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>L&&(this._+=`L`+(e+y*l)+`,`+(t+y*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*p)+`,`+(this._x1=e+b*s)+`,`+(this._y1=t+b*c)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>L||Math.abs(this._y1-l)>L)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%I+I),d>R?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>L&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=F)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}};function V(e){return function(){return e}}function H(e){return e[0]}function U(e){return e[1]}var W=Array.prototype.slice;function ee(e){return e.source}function G(e){return e.target}function K(e){var t=ee,n=G,r=H,i=U,a=null;function o(){var o,s=W.call(arguments),c=t.apply(this,s),l=n.apply(this,s);if(a||=o=B(),e(a,+r.apply(this,(s[0]=c,s)),+i.apply(this,s),+r.apply(this,(s[0]=l,s)),+i.apply(this,s)),o)return a=null,o+``||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r=typeof e==`function`?e:V(+e),o):r},o.y=function(e){return arguments.length?(i=typeof e==`function`?e:V(+e),o):i},o.context=function(e){return arguments.length?(a=e??null,o):a},o}function q(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function te(){return K(q)}function ne(e){return[e.source.x1,e.y0]}function re(e){return[e.target.x0,e.y1]}function ie(){return te().source(ne).target(re)}var J=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,9],r=[1,10],i=[1,5,10,12],a={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:`error`,4:`SANKEY`,5:`NEWLINE`,10:`EOF`,11:`field[source]`,12:`COMMA`,13:`field[target]`,14:`field[value]`,18:`DQUOTE`,19:`ESCAPED_TEXT`,20:`NON_ESCAPED_TEXT`},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 7:let e=r.findOrCreateNode(a[s-4].trim().replaceAll(`""`,`"`)),t=r.findOrCreateNode(a[s-2].trim().replaceAll(`""`,`"`)),n=parseFloat(a[s].trim());r.addLink(e,t,n);break;case 8:case 9:case 11:this.$=a[s];break;case 10:this.$=a[s-1];break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:r},{15:18,16:7,17:8,18:n,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};a.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,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]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(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:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as e,h as t}from"./chunk-GEFDOKGD-DwVPiYfW.js";import{g as n,h as r,p as i}from"./src-BoSBNdA_.js";import{B as a,C as o,D as s,L as c,P as l,U as u,V as d,W as f,_ as p,a as m,b as h,c as g,i as _,k as v,r as y,s as b,v as x,y as S}from"./chunk-7R4GIKGN-DXaGAn_K.js";import{t as C}from"./dist-Cce3efmT.js";import{a as w,c as T,i as E,n as D,r as O,s as k}from"./chunk-JSJVCQXG-BSrqCL_3.js";import{n as A,t as j}from"./chunk-XPW4576I-CtcaMb09.js";import{t as M}from"./chunk-QZHKN3VN-DwSXwtjH.js";var N=C(),P=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,2],n=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],te=[1,80],ne=[1,81],re=[1,82],ie=[1,83],L=[1,84],R=[1,85],z=[1,86],ae=[1,87],B=[1,88],V=[1,89],oe=[1,90],H=[1,91],U=[1,92],W=[1,93],se=[1,94],G=[1,95],ce=[1,96],le=[1,97],ue=[1,98],de=[1,99],fe=[1,100],pe=[1,101],me=[1,102],he=[1,103],ge=[1,104],_e=[1,105],ve=[2,78],ye=[4,5,17,51,53,54],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],we=[5,52],K=[70,71,72,73],q=[1,151],Te={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1));break}},`anonymous`),table:[{3:1,4:t,5:n,6:i},{1:[3]},{3:5,4:t,5:n,6:i},{3:6,4:t,5:n,6:i},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:te,79:ne,80:re,81:ie,82:L,83:R,84:z,85:ae,86:B,87:V,88:oe,89:H,90:U,91:W,92:se,93:G,94:ce,95:le,96:ue,97:de,98:fe,99:pe,100:me,101:he,102:ge,103:_e},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],ve),e(I,[2,6]),e(I,[2,16]),e(ye,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(be,a,{7:120}),e(be,a,{7:121}),e(be,a,{7:122}),e(xe,a,{41:123,7:124}),e(Se,a,{43:125,7:126}),e(Se,a,{7:126,43:127}),e(Ce,a,{46:128,7:129}),e(be,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(we,ve,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:te,79:ne,80:re,81:ie,82:L,83:R,84:z,85:ae,86:B,87:V,88:oe,89:H,90:U,91:W,92:se,93:G,94:ce,95:le,96:ue,97:de,98:fe,99:pe,100:me,101:he,102:ge,103:_e},e(K,[2,79]),e(K,[2,80]),e(K,[2,81]),e(K,[2,82]),e(K,[2,83]),e(K,[2,84]),e(K,[2,85]),e(K,[2,86]),e(K,[2,87]),e(K,[2,88]),e(K,[2,89]),e(K,[2,90]),e(K,[2,91]),e(K,[2,92]),e(K,[2,93]),e(K,[2,94]),e(K,[2,95]),e(K,[2,96]),e(K,[2,97]),e(K,[2,98]),e(K,[2,99]),e(K,[2,100]),e(K,[2,101]),e(K,[2,102]),e(K,[2,103]),e(K,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:q},{58:152,104:q},{58:153,104:q},{58:154,104:q},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(we,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:q},{23:181,72:[1,182],73:F},{58:183,104:q},{58:184,104:q},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ye,[2,11]),{13:186,51:D,53:O,54:k},e(ye,[2,13]),e(ye,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:q},{58:196,104:q},{58:197,104:q},{5:[2,75]},{58:198,104:q},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ye,[2,12]),e(xe,a,{7:124,41:201}),e(Se,a,{7:126,43:202}),e(Ce,a,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(we,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:q},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
1
|
+
import{f as e,h as t}from"./chunk-GEFDOKGD-B82RP9ow.js";import{g as n,h as r,p as i}from"./src-CLWraeNW.js";import{B as a,C as o,D as s,L as c,P as l,U as u,V as d,W as f,_ as p,a as m,b as h,c as g,i as _,k as v,r as y,s as b,v as x,y as S}from"./chunk-7R4GIKGN-DvbvLUIN.js";import{t as C}from"./dist-Ckxnw5rl.js";import{a as w,c as T,i as E,n as D,r as O,s as k}from"./chunk-JSJVCQXG-Pb-JMOgO.js";import{n as A,t as j}from"./chunk-XPW4576I-CsGTseUr.js";import{t as M}from"./chunk-QZHKN3VN-gaBt0Rbd.js";var N=C(),P=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,2],n=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],te=[1,80],ne=[1,81],re=[1,82],ie=[1,83],L=[1,84],R=[1,85],z=[1,86],ae=[1,87],B=[1,88],V=[1,89],oe=[1,90],H=[1,91],U=[1,92],W=[1,93],se=[1,94],G=[1,95],ce=[1,96],le=[1,97],ue=[1,98],de=[1,99],fe=[1,100],pe=[1,101],me=[1,102],he=[1,103],ge=[1,104],_e=[1,105],ve=[2,78],ye=[4,5,17,51,53,54],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],we=[5,52],K=[70,71,72,73],q=[1,151],Te={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1));break}},`anonymous`),table:[{3:1,4:t,5:n,6:i},{1:[3]},{3:5,4:t,5:n,6:i},{3:6,4:t,5:n,6:i},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:te,79:ne,80:re,81:ie,82:L,83:R,84:z,85:ae,86:B,87:V,88:oe,89:H,90:U,91:W,92:se,93:G,94:ce,95:le,96:ue,97:de,98:fe,99:pe,100:me,101:he,102:ge,103:_e},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],ve),e(I,[2,6]),e(I,[2,16]),e(ye,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(be,a,{7:120}),e(be,a,{7:121}),e(be,a,{7:122}),e(xe,a,{41:123,7:124}),e(Se,a,{43:125,7:126}),e(Se,a,{7:126,43:127}),e(Ce,a,{46:128,7:129}),e(be,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(we,ve,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:te,79:ne,80:re,81:ie,82:L,83:R,84:z,85:ae,86:B,87:V,88:oe,89:H,90:U,91:W,92:se,93:G,94:ce,95:le,96:ue,97:de,98:fe,99:pe,100:me,101:he,102:ge,103:_e},e(K,[2,79]),e(K,[2,80]),e(K,[2,81]),e(K,[2,82]),e(K,[2,83]),e(K,[2,84]),e(K,[2,85]),e(K,[2,86]),e(K,[2,87]),e(K,[2,88]),e(K,[2,89]),e(K,[2,90]),e(K,[2,91]),e(K,[2,92]),e(K,[2,93]),e(K,[2,94]),e(K,[2,95]),e(K,[2,96]),e(K,[2,97]),e(K,[2,98]),e(K,[2,99]),e(K,[2,100]),e(K,[2,101]),e(K,[2,102]),e(K,[2,103]),e(K,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:q},{58:152,104:q},{58:153,104:q},{58:154,104:q},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(we,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:q},{23:181,72:[1,182],73:F},{58:183,104:q},{58:184,104:q},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ye,[2,11]),{13:186,51:D,53:O,54:k},e(ye,[2,13]),e(ye,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:q},{58:196,104:q},{58:197,104:q},{5:[2,75]},{58:198,104:q},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ye,[2,12]),e(xe,a,{7:124,41:201}),e(Se,a,{7:126,43:202}),e(Ce,a,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(we,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:q},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),a.push(h.yytext),o.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};Te.lexer=(function(){return{EOF:1,parseError:r(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:r(function(e,t){return this.yy=t||this.yy||{},this._input=e,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]),this.offset=0,this},`setInput`),input:r(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:r(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:r(function(){return this._more=!0,this},`more`),reject:r(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:r(function(e){this.unput(this.match.slice(e))},`less`),pastInput:r(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:r(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:r(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/api-settings
|
|
2
|
-
import{t as e}from"./react-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/api-settings-CuUkz5gb.js","assets/chunk-CFjPhJqf.js","assets/api-client-icCZ-07C.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./react-BPIfZRKM.js";import{t}from"./preload-helper-CsoeaaUJ.js";var n=`ppm-settings`;function r(){try{let e=localStorage.getItem(n);if(e)return JSON.parse(e)}catch{}return{}}function i(e){let t=r();localStorage.setItem(n,JSON.stringify({...t,...e}))}function a(e){let t=e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e;document.documentElement.classList.toggle(`dark`,t===`dark`),document.documentElement.classList.toggle(`light`,t===`light`);let n=document.querySelector(`meta[name="theme-color"]`);n&&n.setAttribute(`content`,t===`dark`?`#0f1419`:`#ffffff`)}var o=r(),s=e((e,n)=>({theme:o.theme===`light`||o.theme===`dark`||o.theme===`system`?o.theme:`system`,sidebarCollapsed:o.sidebarCollapsed??!1,sidebarWidth:o.sidebarWidth??280,gitStatusViewMode:o.gitStatusViewMode===`flat`?`flat`:`tree`,wordWrap:o.wordWrap??!1,sidebarActiveTab:[`git`,`settings`,`database`,`search`].includes(o.sidebarActiveTab)?o.sidebarActiveTab:`explorer`,deviceName:null,version:null,setTheme:t=>{i({theme:t}),a(t),e({theme:t}),fetch(`/api/settings/theme`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({theme:t})}).catch(()=>{})},setDeviceName:async n=>{let r=n.trim();e({deviceName:r||null}),r?document.title=`PPM — ${r}`:document.title=`PPM`;try{let{updateDeviceName:e}=await t(async()=>{let{updateDeviceName:e}=await import(`./api-settings-CuUkz5gb.js`).then(e=>e.n);return{updateDeviceName:e}},__vite__mapDeps([0,1,2]));await e(r)}catch{}},toggleSidebar:()=>{let t=!n().sidebarCollapsed;i({sidebarCollapsed:t}),e({sidebarCollapsed:t})},setSidebarWidth:t=>{let n=Math.max(200,Math.min(600,t));i({sidebarWidth:n}),e({sidebarWidth:n})},setGitStatusViewMode:t=>{i({gitStatusViewMode:t}),e({gitStatusViewMode:t})},toggleWordWrap:()=>{let t=!n().wordWrap;i({wordWrap:t}),e({wordWrap:t})},setSidebarActiveTab:t=>{i({sidebarActiveTab:t}),e({sidebarActiveTab:t})},fetchServerInfo:async()=>{try{let[t,n]=await Promise.all([fetch(`/api/info`),fetch(`/api/settings/theme`)]),r=await t.json();if(r.ok){let{device_name:t,version:n}=r.data;e({deviceName:t||null,version:n||null}),t&&(document.title=`PPM — ${t}`)}let o=await n.json();if(o.ok&&o.data?.theme){let t=o.data.theme;i({theme:t}),a(t),e({theme:t})}}catch{}}}));export{s as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./react-nm2Ru1Pt.js";import"./input-DGlv6gt_.js";import"./jsx-runtime-BRW_vwa9.js";import"./switch-mjGtIVDJ.js";import"./settings-store-D3dJqGhB.js";import"./api-client-icCZ-07C.js";import"./api-settings-CuUkz5gb.js";import{i as e}from"./index-QiSWS6f-.js";export{e as SettingsTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{t}from"./react-nm2Ru1Pt.js";import{t as n}from"./jsx-runtime-BRW_vwa9.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l}from"./dist-CMmNEgEP.js";import{t as u}from"./table-C9jDaRl2.js";import{i as d,t as f}from"./api-client-icCZ-07C.js";import{G as p,I as m,X as h,Y as g,Z as _,j as v}from"./index-QiSWS6f-.js";var y=e(t(),1);function b(e,t,n){let[r,i]=(0,y.useState)([]),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)([]),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(1),[b,x]=(0,y.useState)(null),[S,C]=(0,y.useState)(null),[w,T]=(0,y.useState)(!1),E=n?`/api/db/connections/${n}`:null,D=E??`${d(e)}/sqlite`,O=E?``:`path=${encodeURIComponent(t)}`,k=(0,y.useCallback)(async()=>{m(!0),g(null);try{let e=E?`?cached=1`:O?`?${O}`:``,t=await f.get(`${D}/tables${e}`);i(t),!E&&t.length>0&&!a&&o(t[0].name)}catch(e){g(e.message)}finally{m(!1)}},[D,O,E]);(0,y.useEffect)(()=>{k()},[k]);let A=(0,y.useCallback)(async()=>{if(a){m(!0);try{let e=O?`${O}&`:``,[t,n]=await Promise.all([f.get(`${D}/data?${e}table=${encodeURIComponent(a)}&page=${_}&limit=100`),f.get(`${D}/schema?${e}table=${encodeURIComponent(a)}`)]);c(t),u(n)}catch(e){g(e.message)}finally{m(!1)}}},[D,O,a,_]);return(0,y.useEffect)(()=>{A()},[A]),{tables:r,selectedTable:a,selectTable:(0,y.useCallback)(e=>{o(e),v(1),x(null)},[]),tableData:s,schema:l,loading:p,error:h,page:_,setPage:v,queryResult:b,queryError:S,queryLoading:w,executeQuery:(0,y.useCallback)(async e=>{T(!0),C(null);try{let n=E?{sql:e}:{path:t,sql:e},r=await f.post(`${D}/query`,n);x(r),r.changeType===`modify`&&A()}catch(e){C(e.message)}finally{T(!1)}},[D,E,t,A]),updateCell:(0,y.useCallback)(async(e,n,r)=>{if(a)try{E?await f.put(`${D}/cell`,{table:a,pkColumn:`rowid`,pkValue:e,column:n,value:r}):await f.put(`${D}/cell`,{path:t,table:a,rowid:e,column:n,value:r}),A()}catch(e){g(e.message)}},[D,E,t,a,A]),refreshTables:k,refreshData:A}}var x=n();function S({tables:e,selectedTable:t,onSelect:n,onRefresh:r}){return(0,x.jsxs)(`div`,{className:`w-48 shrink-0 flex flex-col bg-background overflow-hidden`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:`Tables`}),(0,x.jsx)(`button`,{type:`button`,onClick:r,className:`text-muted-foreground hover:text-foreground transition-colors`,title:`Refresh tables`,children:(0,x.jsx)(v,{className:`size-3`})})]}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[e.map(e=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>n(e.name),className:`w-full flex items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors ${t===e.name?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`}`,children:[(0,x.jsx)(u,{className:`size-3 shrink-0`}),(0,x.jsx)(`span`,{className:`truncate flex-1`,children:e.name}),(0,x.jsx)(`span`,{className:`text-[10px] opacity-60`,children:e.rowCount})]},e.name)),e.length===0&&(0,x.jsx)(`p`,{className:`px-3 py-4 text-xs text-muted-foreground text-center`,children:`No tables found`})]})]})}function C({tableData:e,schema:t,loading:n,page:r,onPageChange:i,onCellUpdate:a}){if(!e)return(0,x.jsx)(`div`,{className:`flex items-center justify-center h-full text-xs text-muted-foreground`,children:n?(0,x.jsx)(m,{className:`size-4 animate-spin`}):`Select a table`});let o=Math.ceil(e.total/e.limit)||1;return(0,x.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[(0,x.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,x.jsx)(w,{columns:e.columns,rows:e.rows,schema:t,onCellUpdate:a})}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1.5 border-t border-border bg-background shrink-0 text-xs text-muted-foreground`,children:[(0,x.jsxs)(`span`,{children:[e.total.toLocaleString(),` rows`]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`button`,{type:`button`,disabled:r<=1,onClick:()=>i(r-1),className:`p-0.5 rounded hover:bg-muted disabled:opacity-30`,children:(0,x.jsx)(_,{className:`size-3.5`})}),(0,x.jsxs)(`span`,{children:[r,` / `,o]}),(0,x.jsx)(`button`,{type:`button`,disabled:r>=o,onClick:()=>i(r+1),className:`p-0.5 rounded hover:bg-muted disabled:opacity-30`,children:(0,x.jsx)(h,{className:`size-3.5`})})]})]})]})}function w({columns:e,rows:t,schema:n,onCellUpdate:i}){let[a,o]=(0,y.useState)(null),[c,u]=(0,y.useState)(``),d=(0,y.useMemo)(()=>new Set(n.filter(e=>e.pk).map(e=>e.name)),[n]),f=(0,y.useCallback)((e,t,n)=>{t!==`rowid`&&(o({rowIdx:e,col:t}),u(n==null?``:String(n)))},[]),p=(0,y.useCallback)(()=>{if(!a)return;let e=t[a.rowIdx];if(!e)return;let n=e.rowid,r=e[a.col];String(r??``)!==c&&i(n,a.col,c===``?null:c),o(null)},[a,c,t,i]),m=(0,y.useCallback)(()=>o(null),[]),h=s({data:t,columns:(0,y.useMemo)(()=>e.map(e=>({id:e,accessorFn:t=>t[e],header:()=>(0,x.jsx)(`span`,{className:`${d.has(e)?`font-bold`:``} ${e===`rowid`?`text-muted-foreground/50`:``}`,children:e}),cell:({row:t,getValue:n})=>{let r=t.index,i=a?.rowIdx===r&&a?.col===e,o=n();return i?(0,x.jsx)(`input`,{autoFocus:!0,className:`w-full bg-transparent border border-primary/50 rounded px-1 py-0 text-xs outline-none`,value:c,onChange:e=>u(e.target.value),onBlur:p,onKeyDown:e=>{e.key===`Enter`&&p(),e.key===`Escape`&&m()}}):(0,x.jsx)(`span`,{className:`cursor-pointer truncate block ${o==null?`text-muted-foreground/40 italic`:``} ${e===`rowid`?`text-muted-foreground/50`:``}`,onDoubleClick:()=>f(r,e,o),title:o==null?`NULL`:String(o),children:o==null?`NULL`:String(o)})}})),[e,d,a,c,p,m,f]),getCoreRowModel:l()});return(0,x.jsxs)(`table`,{className:`w-full text-xs border-collapse`,children:[(0,x.jsx)(`thead`,{className:`sticky top-0 z-10 bg-muted`,children:h.getHeaderGroups().map(e=>(0,x.jsx)(`tr`,{children:e.headers.map(e=>(0,x.jsx)(`th`,{className:`px-2 py-1.5 text-left font-medium text-muted-foreground border-b border-border whitespace-nowrap`,children:r(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,x.jsxs)(`tbody`,{children:[h.getRowModel().rows.map(e=>(0,x.jsx)(`tr`,{className:`hover:bg-muted/30 border-b border-border/50`,children:e.getVisibleCells().map(e=>(0,x.jsx)(`td`,{className:`px-2 py-1 max-w-[300px]`,children:r(e.column.columnDef.cell,e.getContext())},e.id))},e.id)),t.length===0&&(0,x.jsx)(`tr`,{children:(0,x.jsx)(`td`,{colSpan:e.length,className:`px-2 py-8 text-center text-muted-foreground`,children:`No data`})})]})]})}function T({onExecute:e,result:t,error:n,loading:r}){let[s,l]=(0,y.useState)(`SELECT * FROM `),u=(0,y.useCallback)(()=>{let t=s.trim();t&&e(t)},[s,e]);return(0,x.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[(0,x.jsxs)(`div`,{className:`flex items-start gap-1 border-b border-border bg-background`,onKeyDown:(0,y.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),u())},[u]),children:[(0,x.jsx)(`div`,{className:`flex-1 max-h-[120px] overflow-auto`,children:(0,x.jsx)(a,{value:s,onChange:l,extensions:[c({dialect:o})],basicSetup:{lineNumbers:!1,foldGutter:!1,highlightActiveLine:!1},className:`text-xs [&_.cm-editor]:!outline-none [&_.cm-scroller]:!overflow-auto`})}),(0,x.jsx)(`button`,{type:`button`,onClick:u,disabled:r,className:`shrink-0 m-1 p-1.5 rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors`,title:`Execute (Cmd+Enter)`,children:r?(0,x.jsx)(m,{className:`size-3.5 animate-spin`}):(0,x.jsx)(i,{className:`size-3.5`})})]}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-auto text-xs`,children:[n&&(0,x.jsx)(`div`,{className:`px-3 py-2 text-destructive bg-destructive/5`,children:n}),t&&t.changeType===`modify`&&(0,x.jsxs)(`div`,{className:`px-3 py-2 text-green-500`,children:[`Query executed. `,t.rowsAffected,` row(s) affected.`]}),t&&t.changeType===`select`&&t.rows.length>0&&(0,x.jsxs)(`table`,{className:`w-full border-collapse`,children:[(0,x.jsx)(`thead`,{className:`sticky top-0 bg-muted`,children:(0,x.jsx)(`tr`,{children:t.columns.map(e=>(0,x.jsx)(`th`,{className:`px-2 py-1 text-left font-medium text-muted-foreground border-b border-border whitespace-nowrap`,children:e},e))})}),(0,x.jsx)(`tbody`,{children:t.rows.map((e,n)=>(0,x.jsx)(`tr`,{className:`hover:bg-muted/30 border-b border-border/50`,children:t.columns.map(t=>(0,x.jsx)(`td`,{className:`px-2 py-1 max-w-[300px] truncate`,title:e[t]==null?`NULL`:String(e[t]),children:e[t]==null?(0,x.jsx)(`span`,{className:`text-muted-foreground/40 italic`,children:`NULL`}):String(e[t])},t))},n))})]}),t&&t.changeType===`select`&&t.rows.length===0&&(0,x.jsx)(`div`,{className:`px-3 py-2 text-muted-foreground`,children:`No results`})]})]})}function E({metadata:e}){let t=e?.filePath,n=e?.projectName,r=e?.connectionId,i=e?.tableName,[a,o]=(0,y.useState)(!1);return r?(0,x.jsx)(D,{projectName:``,dbPath:``,connectionId:r,connectionName:e?.connectionName,initialTable:i,queryPanelOpen:a,onToggleQueryPanel:()=>o(e=>!e),hideTableList:!0}):!t||!n?(0,x.jsxs)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:[(0,x.jsx)(p,{className:`size-5 mr-2`}),` No database file selected.`]}):(0,x.jsx)(D,{projectName:n,dbPath:t,queryPanelOpen:a,onToggleQueryPanel:()=>o(e=>!e)})}function D({projectName:e,dbPath:t,connectionId:n,connectionName:r,initialTable:i,queryPanelOpen:a,onToggleQueryPanel:o,hideTableList:s}){let c=b(e,t,n),l=(0,y.useRef)(!1);return(0,y.useEffect)(()=>{i&&!l.current&&c.tables.length>0&&(l.current=!0,c.selectTable(i))},[i,c.tables]),c.error&&c.tables.length===0?(0,x.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,x.jsx)(g,{className:`size-10 text-destructive`}),(0,x.jsx)(`p`,{className:`text-sm`,children:c.error})]}):c.loading&&c.tables.length===0?(0,x.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-text-secondary`,children:[(0,x.jsx)(m,{className:`size-5 animate-spin`}),(0,x.jsx)(`span`,{className:`text-sm`,children:`Loading database...`})]}):(0,x.jsxs)(`div`,{className:`flex h-full w-full overflow-hidden`,children:[!s&&(0,x.jsx)(S,{tables:c.tables,selectedTable:c.selectedTable,onSelect:c.selectTable,onRefresh:c.refreshTables}),(0,x.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden ${s?``:`border-l border-border`}`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border bg-background shrink-0`,children:[(0,x.jsx)(p,{className:`size-3.5 text-muted-foreground`}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:r??t}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.selectedTable&&`/ ${c.selectedTable}`}),(0,x.jsx)(`div`,{className:`ml-auto`,children:(0,x.jsx)(`button`,{type:`button`,onClick:o,className:`px-2 py-1 rounded text-xs transition-colors ${a?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`}`,children:`SQL`})})]}),(0,x.jsx)(`div`,{className:`flex-1 overflow-hidden ${a?`max-h-[60%]`:``}`,children:(0,x.jsx)(C,{tableData:c.tableData,schema:c.schema,loading:c.loading,page:c.page,onPageChange:c.setPage,onCellUpdate:c.updateCell})}),a&&(0,x.jsx)(`div`,{className:`border-t border-border h-[40%] shrink-0`,children:(0,x.jsx)(T,{onExecute:c.executeQuery,result:c.queryResult,error:c.queryError,loading:c.queryLoading})})]})]})}export{E as SqliteViewer};
|
package/dist/web/assets/{stateDiagram-RAJIS63D-DfRBcaBu.js → stateDiagram-RAJIS63D-C16aO8tn.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./dagre-CNtSxiE_.js";import{T as t,h as n}from"./chunk-GEFDOKGD-DwVPiYfW.js";import{t as r}from"./graphlib-DhOZxqsh.js";import{g as i,h as a,p as o}from"./src-BoSBNdA_.js";import{D as s,b as c,c as l,s as u}from"./chunk-7R4GIKGN-DXaGAn_K.js";import{t as d}from"./line-DBLLF7lH.js";import"./dist-Cce3efmT.js";import"./chunk-PU5JKC2W-B66ELkQm.js";import"./chunk-MX3YWQON-BgjSEzus.js";import"./chunk-YBOYWFTD-Dx_fX35n.js";import"./chunk-55IACEB6-C4mUdyio.js";import"./chunk-KX2RTZJC-BCxGmbzy.js";import"./chunk-PQ6SQG4A-BxtUGYhW.js";import"./chunk-KYZI473N-BKO5gMeU.js";import"./chunk-O4XLMI2P-BurQy8tt.js";import"./chunk-GLR3WWYH-D9pZakqr.js";import{i as f,n as p,t as m}from"./chunk-NQ4KR5QH-DLrZwBEm.js";var h=a(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,c().state.sizeUnit).attr(`cx`,c().state.padding+c().state.sizeUnit).attr(`cy`,c().state.padding+c().state.sizeUnit),`drawStartState`),g=a(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,c().state.textHeight).attr(`class`,`divider`).attr(`x2`,c().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=a((e,t)=>{let n=e.append(`text`).attr(`x`,2*c().state.padding).attr(`y`,c().state.textHeight+2*c().state.padding).attr(`font-size`,c().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,c().state.padding).attr(`y`,c().state.padding).attr(`width`,r.width+2*c().state.padding).attr(`height`,r.height+2*c().state.padding).attr(`rx`,c().state.radius),n},`drawSimpleState`),v=a((e,t)=>{let n=a(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*c().state.padding).text(t);n||r.attr(`dy`,c().state.textHeight)},`addTspan`),r=e.append(`text`).attr(`x`,2*c().state.padding).attr(`y`,c().state.textHeight+1.3*c().state.padding).attr(`font-size`,c().state.fontSize).attr(`class`,`state-title`).text(t.descriptions[0]).node().getBBox(),i=r.height,o=e.append(`text`).attr(`x`,c().state.padding).attr(`y`,i+c().state.padding*.4+c().state.dividerMargin+c().state.textHeight).attr(`class`,`state-description`),s=!0,l=!0;t.descriptions.forEach(function(e){s||(n(o,e,l),l=!1),s=!1});let u=e.append(`line`).attr(`x1`,c().state.padding).attr(`y1`,c().state.padding+i+c().state.dividerMargin/2).attr(`y2`,c().state.padding+i+c().state.dividerMargin/2).attr(`class`,`descr-divider`),d=o.node().getBBox(),f=Math.max(d.width,r.width);return u.attr(`x2`,f+3*c().state.padding),e.insert(`rect`,`:first-child`).attr(`x`,c().state.padding).attr(`y`,c().state.padding).attr(`width`,f+2*c().state.padding).attr(`height`,d.height+i+2*c().state.padding).attr(`rx`,c().state.radius),e},`drawDescrState`),y=a((e,t,n)=>{let r=c().state.padding,i=2*c().state.padding,a=e.node().getBBox(),o=a.width,s=a.x,l=e.append(`text`).attr(`x`,0).attr(`y`,c().state.titleShift).attr(`font-size`,c().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,o);d===o&&(d+=i);let f,p=e.node().getBBox();t.doc,f=s-r,u>o&&(f=(o-d)/2+r),Math.abs(s-p.x)<r&&u>o&&(f=s-(u-o)/2);let m=1-c().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+c().state.textHeight+c().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=o&&l.attr(`x`,s+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,c().state.titleShift-c().state.textHeight-c().state.padding).attr(`width`,d).attr(`height`,c().state.textHeight*3).attr(`rx`,c().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,c().state.titleShift-c().state.textHeight-c().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*c().state.textHeight).attr(`rx`,c().state.radius),e},`addTitleAndBox`),b=a(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,c().state.sizeUnit+c().state.miniPadding).attr(`cx`,c().state.padding+c().state.sizeUnit+c().state.miniPadding).attr(`cy`,c().state.padding+c().state.sizeUnit+c().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,c().state.sizeUnit).attr(`cx`,c().state.padding+c().state.sizeUnit+2).attr(`cy`,c().state.padding+c().state.sizeUnit+2)),`drawEndState`),x=a((e,t)=>{let n=c().state.forkWidth,r=c().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,c().state.padding).attr(`y`,c().state.padding)},`drawForkJoinState`),S=a((e,t,n,r)=>{let i=0,a=r.append(`text`);a.style(`text-anchor`,`start`),a.attr(`class`,`noteText`);let o=e.replace(/\r\n/g,`<br/>`);o=o.replace(/\n/g,`<br/>`);let s=o.split(u.lineBreakRegex),l=1.25*c().state.noteMargin;for(let e of s){let r=e.trim();if(r.length>0){let e=a.append(`tspan`);if(e.text(r),l===0){let t=e.node().getBBox();l+=t.height}i+=l,e.attr(`x`,t+c().state.noteMargin),e.attr(`y`,n+i+1.25*c().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},`_drawLongText`),C=a((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,c().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*c().state.noteMargin),n.attr(`width`,r+c().state.noteMargin*2),n},`drawNote`),w=a(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type===`default`&&t.descriptions.length===0&&_(i,t),t.type===`default`&&t.descriptions.length>0&&v(i,t);let a=i.node().getBBox();return r.width=a.width+2*c().state.padding,r.height=a.height+2*c().state.padding,r},`drawState`),T=0,E=a(function(e,r,o){let l=a(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);r.points=r.points.filter(e=>!Number.isNaN(e.y));let f=r.points,p=d().x(function(e){return e.x}).y(function(e){return e.y}).curve(t),h=e.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(c().state.arrowMarkerAbsolute&&(g=s(!0)),h.attr(`marker-end`,`url(`+g+`#`+l(m.relationType.DEPENDENCY)+`End)`),o.title!==void 0){let t=e.append(`g`).attr(`class`,`stateLabel`),{x:a,y:s}=n.calcLabelPosition(r.points),l=u.getRows(o.title),d=0,f=[],p=0,m=0;for(let e=0;e<=l.length;e++){let n=t.append(`text`).attr(`text-anchor`,`middle`).text(l[e]).attr(`x`,a).attr(`y`,s+d),r=n.node().getBBox();p=Math.max(p,r.width),m=Math.min(m,r.x),i.info(r.x,a,s+d),d===0&&(d=n.node().getBBox().height,i.info(`Title height`,d,s)),f.push(n)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=t.node().getBBox();t.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,a-p/2-c().state.padding/2).attr(`y`,s-h/2-c().state.padding/2-3.5).attr(`width`,p+c().state.padding).attr(`height`,h+c().state.padding),i.info(g)}T++},`drawEdge`),D,O={},k=a(function(){},`setConf`),A=a(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=a(function(e,t,n,r){D=c().state;let a=c().securityLevel,s;a===`sandbox`&&(s=o(`#i`+t));let u=o(a===`sandbox`?s.nodes()[0].contentDocument.body:`body`),d=a===`sandbox`?s.nodes()[0].contentDocument:document;i.debug(`Rendering diagram `+e);let f=u.select(`[id='${t}']`);A(f),N(r.db.getRootDoc(),f,void 0,!1,u,d,r);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;l(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=a(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=a((t,n,a,o,s,c,l)=>{let d=new r({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<t.length;f++)if(t[f].stmt===`relation`){p=!1;break}a?d.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):d.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),d.setDefaultEdgeLabel(function(){return{}});let m=l.db.getStates(),h=l.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];a&&(t.parentId=a);let r;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);r=N(t.doc,e,t.id,!o,s,c,l);{e=y(e,t,o);let n=e.node().getBBox();r.width=n.width,r.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else r=w(n,t,d);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},d);t.note.position===`left of`?(d.setNode(r.id+`-note`,e),d.setNode(r.id,r)):(d.setNode(r.id,r),d.setNode(r.id+`-note`,e)),d.setParent(r.id,r.id+`-group`),d.setParent(r.id+`-note`,r.id+`-group`)}else d.setNode(r.id,r)}i.debug(`Count=`,d.nodeCount(),d);let _=0;h.forEach(function(e){_++,i.debug(`Setting edge`,e),d.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*u.getRows(e.title).length,labelpos:`c`},`id`+_)}),e(d),i.debug(`Graph after layout`,d.nodes());let v=n.node();d.nodes().forEach(function(e){e!==void 0&&d.node(e)!==void 0?(i.warn(`Node `+e+`: `+JSON.stringify(d.node(e))),s.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(d.node(e).x-d.node(e).width/2)+`,`+(d.node(e).y+(O[e]?O[e].y:0)-d.node(e).height/2)+` )`),s.select(`#`+v.id+` #`+e).attr(`data-x-shift`,d.node(e).x-d.node(e).width/2),c.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):i.debug(`No Node `+e+`: `+JSON.stringify(d.node(e)))});let b=v.getBBox();d.edges().forEach(function(e){e!==void 0&&d.edge(e)!==void 0&&(i.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(d.edge(e))),E(n,d.edge(e),d.edge(e).relation))}),b=v.getBBox();let x={id:a||`root`,label:a||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,i.debug(`Doc rendered`,x,d),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:a(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
|
|
1
|
+
import{t as e}from"./dagre-CWo8w9wK.js";import{T as t,h as n}from"./chunk-GEFDOKGD-B82RP9ow.js";import{t as r}from"./graphlib-BbbiUImY.js";import{g as i,h as a,p as o}from"./src-CLWraeNW.js";import{D as s,b as c,c as l,s as u}from"./chunk-7R4GIKGN-DvbvLUIN.js";import{t as d}from"./line--xyfYP3x.js";import"./dist-Ckxnw5rl.js";import"./chunk-PU5JKC2W-D3thuSok.js";import"./chunk-MX3YWQON-BnPzQK-O.js";import"./chunk-YBOYWFTD-COdZIaX4.js";import"./chunk-55IACEB6-Dp0pTM5r.js";import"./chunk-KX2RTZJC-BRj-ZEvL.js";import"./chunk-PQ6SQG4A-EdgQyTqa.js";import"./chunk-KYZI473N-CBRPKraG.js";import"./chunk-O4XLMI2P-BdXwVXjJ.js";import"./chunk-GLR3WWYH-Bx2UL5jF.js";import{i as f,n as p,t as m}from"./chunk-NQ4KR5QH-BRj25yO7.js";var h=a(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,c().state.sizeUnit).attr(`cx`,c().state.padding+c().state.sizeUnit).attr(`cy`,c().state.padding+c().state.sizeUnit),`drawStartState`),g=a(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,c().state.textHeight).attr(`class`,`divider`).attr(`x2`,c().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=a((e,t)=>{let n=e.append(`text`).attr(`x`,2*c().state.padding).attr(`y`,c().state.textHeight+2*c().state.padding).attr(`font-size`,c().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,c().state.padding).attr(`y`,c().state.padding).attr(`width`,r.width+2*c().state.padding).attr(`height`,r.height+2*c().state.padding).attr(`rx`,c().state.radius),n},`drawSimpleState`),v=a((e,t)=>{let n=a(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*c().state.padding).text(t);n||r.attr(`dy`,c().state.textHeight)},`addTspan`),r=e.append(`text`).attr(`x`,2*c().state.padding).attr(`y`,c().state.textHeight+1.3*c().state.padding).attr(`font-size`,c().state.fontSize).attr(`class`,`state-title`).text(t.descriptions[0]).node().getBBox(),i=r.height,o=e.append(`text`).attr(`x`,c().state.padding).attr(`y`,i+c().state.padding*.4+c().state.dividerMargin+c().state.textHeight).attr(`class`,`state-description`),s=!0,l=!0;t.descriptions.forEach(function(e){s||(n(o,e,l),l=!1),s=!1});let u=e.append(`line`).attr(`x1`,c().state.padding).attr(`y1`,c().state.padding+i+c().state.dividerMargin/2).attr(`y2`,c().state.padding+i+c().state.dividerMargin/2).attr(`class`,`descr-divider`),d=o.node().getBBox(),f=Math.max(d.width,r.width);return u.attr(`x2`,f+3*c().state.padding),e.insert(`rect`,`:first-child`).attr(`x`,c().state.padding).attr(`y`,c().state.padding).attr(`width`,f+2*c().state.padding).attr(`height`,d.height+i+2*c().state.padding).attr(`rx`,c().state.radius),e},`drawDescrState`),y=a((e,t,n)=>{let r=c().state.padding,i=2*c().state.padding,a=e.node().getBBox(),o=a.width,s=a.x,l=e.append(`text`).attr(`x`,0).attr(`y`,c().state.titleShift).attr(`font-size`,c().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,o);d===o&&(d+=i);let f,p=e.node().getBBox();t.doc,f=s-r,u>o&&(f=(o-d)/2+r),Math.abs(s-p.x)<r&&u>o&&(f=s-(u-o)/2);let m=1-c().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+c().state.textHeight+c().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=o&&l.attr(`x`,s+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,c().state.titleShift-c().state.textHeight-c().state.padding).attr(`width`,d).attr(`height`,c().state.textHeight*3).attr(`rx`,c().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,c().state.titleShift-c().state.textHeight-c().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*c().state.textHeight).attr(`rx`,c().state.radius),e},`addTitleAndBox`),b=a(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,c().state.sizeUnit+c().state.miniPadding).attr(`cx`,c().state.padding+c().state.sizeUnit+c().state.miniPadding).attr(`cy`,c().state.padding+c().state.sizeUnit+c().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,c().state.sizeUnit).attr(`cx`,c().state.padding+c().state.sizeUnit+2).attr(`cy`,c().state.padding+c().state.sizeUnit+2)),`drawEndState`),x=a((e,t)=>{let n=c().state.forkWidth,r=c().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,c().state.padding).attr(`y`,c().state.padding)},`drawForkJoinState`),S=a((e,t,n,r)=>{let i=0,a=r.append(`text`);a.style(`text-anchor`,`start`),a.attr(`class`,`noteText`);let o=e.replace(/\r\n/g,`<br/>`);o=o.replace(/\n/g,`<br/>`);let s=o.split(u.lineBreakRegex),l=1.25*c().state.noteMargin;for(let e of s){let r=e.trim();if(r.length>0){let e=a.append(`tspan`);if(e.text(r),l===0){let t=e.node().getBBox();l+=t.height}i+=l,e.attr(`x`,t+c().state.noteMargin),e.attr(`y`,n+i+1.25*c().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},`_drawLongText`),C=a((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,c().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*c().state.noteMargin),n.attr(`width`,r+c().state.noteMargin*2),n},`drawNote`),w=a(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type===`default`&&t.descriptions.length===0&&_(i,t),t.type===`default`&&t.descriptions.length>0&&v(i,t);let a=i.node().getBBox();return r.width=a.width+2*c().state.padding,r.height=a.height+2*c().state.padding,r},`drawState`),T=0,E=a(function(e,r,o){let l=a(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);r.points=r.points.filter(e=>!Number.isNaN(e.y));let f=r.points,p=d().x(function(e){return e.x}).y(function(e){return e.y}).curve(t),h=e.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(c().state.arrowMarkerAbsolute&&(g=s(!0)),h.attr(`marker-end`,`url(`+g+`#`+l(m.relationType.DEPENDENCY)+`End)`),o.title!==void 0){let t=e.append(`g`).attr(`class`,`stateLabel`),{x:a,y:s}=n.calcLabelPosition(r.points),l=u.getRows(o.title),d=0,f=[],p=0,m=0;for(let e=0;e<=l.length;e++){let n=t.append(`text`).attr(`text-anchor`,`middle`).text(l[e]).attr(`x`,a).attr(`y`,s+d),r=n.node().getBBox();p=Math.max(p,r.width),m=Math.min(m,r.x),i.info(r.x,a,s+d),d===0&&(d=n.node().getBBox().height,i.info(`Title height`,d,s)),f.push(n)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=t.node().getBBox();t.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,a-p/2-c().state.padding/2).attr(`y`,s-h/2-c().state.padding/2-3.5).attr(`width`,p+c().state.padding).attr(`height`,h+c().state.padding),i.info(g)}T++},`drawEdge`),D,O={},k=a(function(){},`setConf`),A=a(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=a(function(e,t,n,r){D=c().state;let a=c().securityLevel,s;a===`sandbox`&&(s=o(`#i`+t));let u=o(a===`sandbox`?s.nodes()[0].contentDocument.body:`body`),d=a===`sandbox`?s.nodes()[0].contentDocument:document;i.debug(`Rendering diagram `+e);let f=u.select(`[id='${t}']`);A(f),N(r.db.getRootDoc(),f,void 0,!1,u,d,r);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;l(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=a(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=a((t,n,a,o,s,c,l)=>{let d=new r({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<t.length;f++)if(t[f].stmt===`relation`){p=!1;break}a?d.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):d.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),d.setDefaultEdgeLabel(function(){return{}});let m=l.db.getStates(),h=l.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];a&&(t.parentId=a);let r;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);r=N(t.doc,e,t.id,!o,s,c,l);{e=y(e,t,o);let n=e.node().getBBox();r.width=n.width,r.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else r=w(n,t,d);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},d);t.note.position===`left of`?(d.setNode(r.id+`-note`,e),d.setNode(r.id,r)):(d.setNode(r.id,r),d.setNode(r.id+`-note`,e)),d.setParent(r.id,r.id+`-group`),d.setParent(r.id+`-note`,r.id+`-group`)}else d.setNode(r.id,r)}i.debug(`Count=`,d.nodeCount(),d);let _=0;h.forEach(function(e){_++,i.debug(`Setting edge`,e),d.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*u.getRows(e.title).length,labelpos:`c`},`id`+_)}),e(d),i.debug(`Graph after layout`,d.nodes());let v=n.node();d.nodes().forEach(function(e){e!==void 0&&d.node(e)!==void 0?(i.warn(`Node `+e+`: `+JSON.stringify(d.node(e))),s.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(d.node(e).x-d.node(e).width/2)+`,`+(d.node(e).y+(O[e]?O[e].y:0)-d.node(e).height/2)+` )`),s.select(`#`+v.id+` #`+e).attr(`data-x-shift`,d.node(e).x-d.node(e).width/2),c.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):i.debug(`No Node `+e+`: `+JSON.stringify(d.node(e)))});let b=v.getBBox();d.edges().forEach(function(e){e!==void 0&&d.edge(e)!==void 0&&(i.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(d.edge(e))),E(n,d.edge(e),d.edge(e).relation))}),b=v.getBBox();let x={id:a||`root`,label:a||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,i.debug(`Doc rendered`,x,d),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:a(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-GEFDOKGD-B82RP9ow.js";import{h as e}from"./src-CLWraeNW.js";import"./chunk-7R4GIKGN-DvbvLUIN.js";import"./dist-Ckxnw5rl.js";import"./chunk-PU5JKC2W-D3thuSok.js";import"./chunk-MX3YWQON-BnPzQK-O.js";import"./chunk-YBOYWFTD-COdZIaX4.js";import"./chunk-55IACEB6-Dp0pTM5r.js";import"./chunk-KX2RTZJC-BRj-ZEvL.js";import"./chunk-PQ6SQG4A-EdgQyTqa.js";import"./chunk-KYZI473N-CBRPKraG.js";import"./chunk-O4XLMI2P-BdXwVXjJ.js";import"./chunk-GLR3WWYH-Bx2UL5jF.js";import{i as t,n,r,t as i}from"./chunk-NQ4KR5QH-BRj25yO7.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{t}from"./react-nm2Ru1Pt.js";import{A as n,D as r,M as i,N as a,S as o,T as s,_ as c,a as l,b as u,c as d,d as f,f as p,g as m,h,i as g,j as _,l as v,m as y,o as b,p as x,r as S,s as C,t as w,u as ee,w as T,x as E,y as D}from"./input-DGlv6gt_.js";import{n as O,t as k}from"./jsx-runtime-BRW_vwa9.js";import{n as A}from"./utils-Bslrbb-G.js";import{i as te,t as j}from"./api-client-icCZ-07C.js";import{f as M,i as N}from"./api-settings-CuUkz5gb.js";var P=O(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),ne=O(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),F=O(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),I=O(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),L=e(t(),1),R=k(),z=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),B=`VisuallyHidden`,V=L.forwardRef((e,t)=>(0,R.jsx)(s.span,{...e,ref:t,style:{...z,...e.style}}));V.displayName=B;var re=V;function ie(e){let t=L.useRef({value:e,previous:e});return L.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ae=`Label`,oe=L.forwardRef((e,t)=>(0,R.jsx)(s.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));oe.displayName=ae;var se=oe;function H(e,[t,n]){return Math.min(n,Math.max(t,e))}var ce=e(a(),1),le=[` `,`Enter`,`ArrowUp`,`ArrowDown`],ue=[` `,`Enter`],U=`Select`,[W,G,de]=o(U),[K,fe]=T(U,[de,C]),q=C(),[pe,J]=K(U),[me,he]=K(U),ge=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:g}=e,_=q(t),[v,y]=L.useState(null),[x,S]=L.useState(null),[C,w]=L.useState(!1),ee=m(u),[T,E]=D({prop:r,defaultProp:i??!1,onChange:a,caller:U}),[O,k]=D({prop:o,defaultProp:s,onChange:l,caller:U}),A=L.useRef(null),te=v?g||!!v.closest(`form`):!0,[j,M]=L.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(`;`);return(0,R.jsx)(b,{..._,children:(0,R.jsxs)(pe,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:c(),value:O,onValueChange:k,open:T,onOpenChange:E,dir:ee,triggerPointerDownPosRef:A,disabled:p,children:[(0,R.jsx)(W.Provider,{scope:t,children:(0,R.jsx)(me,{scope:e.__scopeSelect,onNativeOptionAdd:L.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:L.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),te?(0,R.jsxs)(st,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:O,onChange:e=>k(e.target.value),disabled:p,form:g,children:[O===void 0?(0,R.jsx)(`option`,{value:``}):null,Array.from(j)]},N):null]})})};ge.displayName=U;var _e=`SelectTrigger`,ve=L.forwardRef((e,t)=>{let{__scopeSelect:r,disabled:i=!1,...a}=e,o=q(r),c=J(_e,r),l=c.disabled||i,u=n(t,c.onTriggerChange),d=G(r),f=L.useRef(`touch`),[p,m,h]=lt(e=>{let t=d().filter(e=>!e.disabled),n=ut(t,e,t.find(e=>e.value===c.value));n!==void 0&&c.onValueChange(n.value)}),g=e=>{l||(c.onOpenChange(!0),h()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,R.jsx)(S,{asChild:!0,...o,children:(0,R.jsx)(s.button,{type:`button`,role:`combobox`,"aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":`none`,dir:c.dir,"data-state":c.open?`open`:`closed`,disabled:l,"data-disabled":l?``:void 0,"data-placeholder":ct(c.value)?``:void 0,...a,ref:u,onClick:E(a.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:E(a.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:E(a.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&le.includes(e.key)&&(g(),e.preventDefault())})})})});ve.displayName=_e;var ye=`SelectValue`,be=L.forwardRef((e,t)=>{let{__scopeSelect:r,className:i,style:a,children:o,placeholder:c=``,...l}=e,d=J(ye,r),{onValueNodeHasChildrenChange:f}=d,p=o!==void 0,m=n(t,d.onValueNodeChange);return u(()=>{f(p)},[f,p]),(0,R.jsx)(s.span,{...l,ref:m,style:{pointerEvents:`none`},children:ct(d.value)?(0,R.jsx)(R.Fragment,{children:c}):o})});be.displayName=ye;var xe=`SelectIcon`,Se=L.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,R.jsx)(s.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Se.displayName=xe;var Ce=`SelectPortal`,we=e=>(0,R.jsx)(p,{asChild:!0,...e});we.displayName=Ce;var Y=`SelectContent`,Te=L.forwardRef((e,t)=>{let n=J(Y,e.__scopeSelect),[r,i]=L.useState();if(u(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?ce.createPortal((0,R.jsx)(Ee,{scope:e.__scopeSelect,children:(0,R.jsx)(W.Slot,{scope:e.__scopeSelect,children:(0,R.jsx)(`div`,{children:e.children})})}),t):null}return(0,R.jsx)(ke,{...e,ref:t})});Te.displayName=Y;var X=10,[Ee,Z]=K(Y),De=`SelectContentImpl`,Oe=r(`SelectContent.RemoveScroll`),ke=L.forwardRef((e,t)=>{let{__scopeSelect:r,position:i=`item-aligned`,onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:b,...S}=e,C=J(Y,r),[w,T]=L.useState(null),[D,O]=L.useState(null),k=n(t,e=>T(e)),[A,te]=L.useState(null),[j,M]=L.useState(null),N=G(r),[P,ne]=L.useState(!1),F=L.useRef(!1);L.useEffect(()=>{if(w)return v(w)},[w]),f();let I=L.useCallback(e=>{let[t,...n]=N().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&D&&(D.scrollTop=0),n===r&&D&&(D.scrollTop=D.scrollHeight),n?.focus(),document.activeElement!==i))return},[N,D]),z=L.useCallback(()=>I([A,w]),[I,A,w]);L.useEffect(()=>{P&&z()},[P,z]);let{onOpenChange:B,triggerPointerDownPosRef:V}=C;L.useEffect(()=>{if(w){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(V.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(V.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||B(!1),document.removeEventListener(`pointermove`,t),V.current=null};return V.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[w,B,V]),L.useEffect(()=>{let e=()=>B(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[B]);let[re,ie]=lt(e=>{let t=N().filter(e=>!e.disabled),n=ut(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ae=L.useCallback((e,t,n)=>{let r=!F.current&&!n;(C.value!==void 0&&C.value===t||r)&&(te(e),r&&(F.current=!0))},[C.value]),oe=L.useCallback(()=>w?.focus(),[w]),se=L.useCallback((e,t,n)=>{let r=!F.current&&!n;(C.value!==void 0&&C.value===t||r)&&M(e)},[C.value]),H=i===`popper`?Ne:je,ce=H===Ne?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:b}:{};return(0,R.jsx)(Ee,{scope:r,content:w,viewport:D,onViewportChange:O,itemRefCallback:ae,selectedItem:A,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:z,selectedItemText:j,position:i,isPositioned:P,searchRef:re,children:(0,R.jsx)(ee,{as:Oe,allowPinchZoom:!0,children:(0,R.jsx)(x,{asChild:!0,trapped:C.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:E(a,e=>{C.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,R.jsx)(y,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:(0,R.jsx)(H,{role:`listbox`,id:C.contentId,"data-state":C.open?`open`:`closed`,dir:C.dir,onContextMenu:e=>e.preventDefault(),...S,...ce,onPlaced:()=>ne(!0),ref:k,style:{display:`flex`,flexDirection:`column`,outline:`none`,...S.style},onKeyDown:E(S.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>I(t)),e.preventDefault()}})})})})})})});ke.displayName=De;var Ae=`SelectItemAlignedPosition`,je=L.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:i,...a}=e,o=J(Y,r),c=Z(Y,r),[l,d]=L.useState(null),[f,p]=L.useState(null),m=n(t,e=>p(e)),h=G(r),g=L.useRef(!1),_=L.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=c,S=L.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&f&&v&&y&&b){let e=o.trigger.getBoundingClientRect(),t=f.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if(o.dir!==`rtl`){let i=r.left-t.left,a=n.left-i,o=e.left-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-X,d=H(a,[X,Math.max(X,u-c)]);l.style.minWidth=s+`px`,l.style.left=d+`px`}else{let i=t.right-r.right,a=window.innerWidth-n.right-i,o=window.innerWidth-e.right-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-X,d=H(a,[X,Math.max(X,u-c)]);l.style.minWidth=s+`px`,l.style.right=d+`px`}let a=h(),s=window.innerHeight-X*2,c=v.scrollHeight,u=window.getComputedStyle(f),d=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),m=parseInt(u.borderBottomWidth,10),_=parseInt(u.paddingBottom,10),x=d+p+c+_+m,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),ee=parseInt(C.paddingBottom,10),T=e.top+e.height/2-X,E=s-T,D=y.offsetHeight/2,O=y.offsetTop+D,k=d+p+O,A=x-k;if(k<=T){let e=a.length>0&&y===a[a.length-1].ref.current;l.style.bottom=`0px`;let t=f.clientHeight-v.offsetTop-v.offsetHeight,n=k+Math.max(E,D+(e?ee:0)+t+m);l.style.height=n+`px`}else{let e=a.length>0&&y===a[0].ref.current;l.style.top=`0px`;let t=Math.max(T,d+v.offsetTop+(e?w:0)+D)+A;l.style.height=t+`px`,v.scrollTop=k-T+v.offsetTop}l.style.margin=`${X}px 0`,l.style.minHeight=S+`px`,l.style.maxHeight=s+`px`,i?.(),requestAnimationFrame(()=>g.current=!0)}},[h,o.trigger,o.valueNode,l,f,v,y,b,o.dir,i]);u(()=>S(),[S]);let[C,w]=L.useState();return u(()=>{f&&w(window.getComputedStyle(f).zIndex)},[f]),(0,R.jsx)(Pe,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:L.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]),children:(0,R.jsx)(`div`,{ref:d,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,R.jsx)(s.div,{...a,ref:m,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});je.displayName=Ae;var Me=`SelectPopperPosition`,Ne=L.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=X,...a}=e,o=q(n);return(0,R.jsx)(l,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});Ne.displayName=Me;var[Pe,Fe]=K(Y,{}),Ie=`SelectViewport`,Le=L.forwardRef((e,t)=>{let{__scopeSelect:r,nonce:i,...a}=e,o=Z(Ie,r),c=Fe(Ie,r),l=n(t,o.onViewportChange),u=L.useRef(0);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,R.jsx)(W.Slot,{scope:r,children:(0,R.jsx)(s.div,{"data-radix-select-viewport":``,role:`presentation`,...a,ref:l,style:{position:`relative`,flex:1,overflow:`hidden auto`,...a.style},onScroll:E(a.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=c;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-X*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})});Le.displayName=Ie;var Re=`SelectGroup`,[ze,Be]=K(Re),Ve=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=c();return(0,R.jsx)(ze,{scope:n,id:i,children:(0,R.jsx)(s.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Ve.displayName=Re;var He=`SelectLabel`,Ue=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Be(He,n);return(0,R.jsx)(s.div,{id:i.id,...r,ref:t})});Ue.displayName=He;var We=`SelectItem`,[Ge,Ke]=K(We),qe=L.forwardRef((e,t)=>{let{__scopeSelect:r,value:i,disabled:a=!1,textValue:o,...l}=e,u=J(We,r),d=Z(We,r),f=u.value===i,[p,m]=L.useState(o??``),[h,g]=L.useState(!1),_=n(t,e=>d.itemRefCallback?.(e,i,a)),v=c(),y=L.useRef(`touch`),b=()=>{a||(u.onValueChange(i),u.onOpenChange(!1))};if(i===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,R.jsx)(Ge,{scope:r,value:i,disabled:a,textId:v,isSelected:f,onItemTextChange:L.useCallback(e=>{m(t=>t||(e?.textContent??``).trim())},[]),children:(0,R.jsx)(W.ItemSlot,{scope:r,value:i,disabled:a,textValue:p,children:(0,R.jsx)(s.div,{role:`option`,"aria-labelledby":v,"data-highlighted":h?``:void 0,"aria-selected":f&&h,"data-state":f?`checked`:`unchecked`,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,tabIndex:a?void 0:-1,...l,ref:_,onFocus:E(l.onFocus,()=>g(!0)),onBlur:E(l.onBlur,()=>g(!1)),onClick:E(l.onClick,()=>{y.current!==`mouse`&&b()}),onPointerUp:E(l.onPointerUp,()=>{y.current===`mouse`&&b()}),onPointerDown:E(l.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:E(l.onPointerMove,e=>{y.current=e.pointerType,a?d.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:E(l.onKeyDown,e=>{d.searchRef?.current!==``&&e.key===` `||(ue.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})});qe.displayName=We;var Q=`SelectItemText`,Je=L.forwardRef((e,t)=>{let{__scopeSelect:r,className:i,style:a,...o}=e,c=J(Q,r),l=Z(Q,r),d=Ke(Q,r),f=he(Q,r),[p,m]=L.useState(null),h=n(t,e=>m(e),d.onItemTextChange,e=>l.itemTextRefCallback?.(e,d.value,d.disabled)),g=p?.textContent,_=L.useMemo(()=>(0,R.jsx)(`option`,{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=f;return u(()=>(v(_),()=>y(_)),[v,y,_]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(s.span,{id:d.textId,...o,ref:h}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?ce.createPortal(o.children,c.valueNode):null]})});Je.displayName=Q;var Ye=`SelectItemIndicator`,Xe=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Ke(Ye,n).isSelected?(0,R.jsx)(s.span,{"aria-hidden":!0,...r,ref:t}):null});Xe.displayName=Ye;var Ze=`SelectScrollUpButton`,Qe=L.forwardRef((e,t)=>{let r=Z(Ze,e.__scopeSelect),i=Fe(Ze,e.__scopeSelect),[a,o]=L.useState(!1),s=n(t,i.onScrollButtonChange);return u(()=>{if(r.viewport&&r.isPositioned){let e=function(){o(t.scrollTop>0)},t=r.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[r.viewport,r.isPositioned]),a?(0,R.jsx)(tt,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Qe.displayName=Ze;var $e=`SelectScrollDownButton`,et=L.forwardRef((e,t)=>{let r=Z($e,e.__scopeSelect),i=Fe($e,e.__scopeSelect),[a,o]=L.useState(!1),s=n(t,i.onScrollButtonChange);return u(()=>{if(r.viewport&&r.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;o(Math.ceil(t.scrollTop)<e)},t=r.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[r.viewport,r.isPositioned]),a?(0,R.jsx)(tt,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});et.displayName=$e;var tt=L.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Z(`SelectScrollButton`,n),o=L.useRef(null),c=G(n),l=L.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return L.useEffect(()=>()=>l(),[l]),u(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,R.jsx)(s.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:E(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:E(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:E(i.onPointerLeave,()=>{l()})})}),nt=`SelectSeparator`,rt=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,R.jsx)(s.div,{"aria-hidden":!0,...r,ref:t})});rt.displayName=nt;var it=`SelectArrow`,at=L.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=q(n),a=J(it,n),o=Z(it,n);return a.open&&o.position===`popper`?(0,R.jsx)(g,{...i,...r,ref:t}):null});at.displayName=it;var ot=`SelectBubbleInput`,st=L.forwardRef(({__scopeSelect:e,value:t,...r},i)=>{let a=L.useRef(null),o=n(i,a),c=ie(t);return L.useEffect(()=>{let e=a.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(c!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[c,t]),(0,R.jsx)(s.select,{...r,style:{...z,...r.style},ref:o,defaultValue:t})});st.displayName=ot;function ct(e){return e===``||e===void 0}function lt(e){let t=h(e),n=L.useRef(``),r=L.useRef(0),i=L.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=L.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return L.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function ut(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=dt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function dt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ft=ge,pt=ve,mt=be,ht=Se,gt=we,_t=Te,vt=Le,yt=qe,bt=Je,xt=Xe,St=Qe,Ct=et,wt=`Switch`,[Tt,Et]=T(wt),[Dt,Ot]=Tt(wt),kt=L.forwardRef((e,t)=>{let{__scopeSwitch:r,name:i,checked:a,defaultChecked:o,required:c,disabled:l,value:u=`on`,onCheckedChange:d,form:f,...p}=e,[m,h]=L.useState(null),g=n(t,e=>h(e)),_=L.useRef(!1),v=m?f||!!m.closest(`form`):!0,[y,b]=D({prop:a,defaultProp:o??!1,onChange:d,caller:wt});return(0,R.jsxs)(Dt,{scope:r,checked:y,disabled:l,children:[(0,R.jsx)(s.button,{type:`button`,role:`switch`,"aria-checked":y,"aria-required":c,"data-state":Pt(y),"data-disabled":l?``:void 0,disabled:l,value:u,...p,ref:g,onClick:E(e.onClick,e=>{b(e=>!e),v&&(_.current=e.isPropagationStopped(),_.current||e.stopPropagation())})}),v&&(0,R.jsx)(Nt,{control:m,bubbles:!_.current,name:i,value:u,checked:y,required:c,disabled:l,form:f,style:{transform:`translateX(-100%)`}})]})});kt.displayName=wt;var At=`SwitchThumb`,jt=L.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=Ot(At,n);return(0,R.jsx)(s.span,{"data-state":Pt(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});jt.displayName=At;var Mt=`SwitchBubbleInput`,Nt=L.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:i=!0,...a},o)=>{let s=L.useRef(null),c=n(s,o),l=ie(r),u=d(t);return L.useEffect(()=>{let e=s.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(l!==r&&n){let t=new Event(`click`,{bubbles:i});n.call(e,r),e.dispatchEvent(t)}},[l,r,i]),(0,R.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:c,style:{...a.style,...u,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});Nt.displayName=Mt;function Pt(e){return e?`checked`:`unchecked`}var Ft=kt,It=jt;function $({className:e,...t}){return(0,R.jsx)(se,{"data-slot":`label`,className:A(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Lt({...e}){return(0,R.jsx)(ft,{"data-slot":`select`,...e})}function Rt({...e}){return(0,R.jsx)(mt,{"data-slot":`select-value`,...e})}function zt({className:e,size:t=`default`,children:n,...r}){return(0,R.jsxs)(pt,{"data-slot":`select-trigger`,"data-size":t,className:A(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,R.jsx)(ht,{asChild:!0,children:(0,R.jsx)(_,{className:`size-4 opacity-50`})})]})}function Bt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,R.jsx)(gt,{children:(0,R.jsxs)(_t,{"data-slot":`select-content`,className:A(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,R.jsx)(Ht,{}),(0,R.jsx)(vt,{className:A(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,R.jsx)(Ut,{})]})})}function Vt({className:e,children:t,...n}){return(0,R.jsxs)(yt,{"data-slot":`select-item`,className:A(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,R.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,R.jsx)(xt,{children:(0,R.jsx)(i,{className:`size-4`})})}),(0,R.jsx)(bt,{children:t})]})}function Ht({className:e,...t}){return(0,R.jsx)(St,{"data-slot":`select-scroll-up-button`,className:A(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,R.jsx)(F,{className:`size-4`})})}function Ut({className:e,...t}){return(0,R.jsx)(Ct,{"data-slot":`select-scroll-down-button`,className:A(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,R.jsx)(_,{className:`size-4`})})}var Wt={claude:`C`,cursor:`▶`,codex:`◆`,gemini:`G`};function Gt({value:e,onChange:t,projectName:n}){let[r,a]=(0,L.useState)([]),[o,s]=(0,L.useState)(!1),c=(0,L.useRef)(null),l=(0,L.useRef)(0);(0,L.useEffect)(()=>{n&&j.get(`${te(n)}/chat/providers`).then(a).catch(()=>{})},[n]),(0,L.useEffect)(()=>{if(!o)return;let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]),(0,L.useEffect)(()=>{o&&(l.current=Math.max(0,r.findIndex(t=>t.id===e)))},[o,e,r]);let u=(0,L.useCallback)(e=>{if(e.key===`Escape`){s(!1);return}if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;l.current=(l.current+t+r.length)%r.length,(c.current?.querySelector(`[data-idx="${l.current}"]`))?.focus()}if(e.key===`Enter`){e.preventDefault();let n=r[l.current];n&&(t(n.id),s(!1))}},[t,r]);if(r.length<=1)return null;let d=r.find(t=>t.id===e),f=Wt[e]||`?`;return(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s(e=>!e)},className:`inline-flex items-center gap-1 px-2 py-1 rounded-md text-[11px] text-text-subtle hover:text-text-primary hover:bg-surface-elevated transition-colors border border-transparent hover:border-border`,"aria-label":`AI Provider: ${d?.name??e}`,children:[(0,R.jsx)(`span`,{className:`inline-flex h-3.5 w-3.5 items-center justify-center rounded text-[9px] font-bold bg-surface-elevated shrink-0`,children:f}),(0,R.jsx)(`span`,{className:`max-w-[80px] truncate capitalize`,children:d?.name??e})]}),o&&(0,R.jsxs)(`div`,{ref:c,role:`listbox`,"aria-label":`AI Providers`,onKeyDown:u,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),className:`absolute bottom-full left-0 mb-1 z-50 w-56 rounded-lg border border-border bg-surface shadow-lg`,children:[(0,R.jsx)(`div`,{className:`px-3 py-2 border-b border-border`,children:(0,R.jsx)(`span`,{className:`text-xs font-medium text-text-secondary`,children:`Provider`})}),(0,R.jsx)(`div`,{className:`py-1`,children:r.map((n,r)=>{let a=Wt[n.id]||`?`,o=n.id===e;return(0,R.jsxs)(`button`,{"data-idx":r,role:`option`,"aria-selected":o,tabIndex:0,onClick:()=>{t(n.id),s(!1)},className:`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-surface-elevated focus:bg-surface-elevated focus:outline-none ${o?`bg-surface-elevated`:``}`,children:[(0,R.jsx)(`span`,{className:`inline-flex h-5 w-5 items-center justify-center rounded text-[11px] font-bold bg-surface-elevated text-text-subtle shrink-0`,children:a}),(0,R.jsx)(`span`,{className:`flex-1 text-sm font-medium text-text-primary capitalize`,children:n.name}),o&&(0,R.jsx)(i,{className:`size-4 shrink-0 text-primary`})]},n.id)})})]})]})}function Kt({providerId:e}){return(0,R.jsx)(`span`,{className:`inline-flex h-4 w-4 items-center justify-center rounded text-[10px] font-bold bg-surface-elevated text-text-subtle shrink-0`,title:e,children:Wt[e]||`?`})}var qt=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}],Jt=[{value:`bypassPermissions`,label:`Bypass permissions (default)`},{value:`default`,label:`Ask before edits`},{value:`acceptEdits`,label:`Edit automatically`},{value:`plan`,label:`Plan mode`}],Yt={claude:`Claude`,cursor:`Cursor`,codex:`Codex`,gemini:`Gemini`};function Xt({compact:e}={}){let[t,n]=(0,L.useState)(null),[r,i]=(0,L.useState)(``),[a,o]=(0,L.useState)([]),[s,c]=(0,L.useState)(!1),[l,u]=(0,L.useState)(!1),[d,f]=(0,L.useState)(null),[p,m]=(0,L.useState)(0);(0,L.useEffect)(()=>{N().then(e=>{n(e),i(e.default_provider??`claude`)}).catch(e=>f(e.message))},[]),(0,L.useEffect)(()=>{r&&(c(!0),j.get(`/api/settings/ai/providers/${r}/models`).then(o).catch(()=>o([])).finally(()=>c(!1)))},[r]);let h=t?Object.keys(t.providers).filter(e=>e!==`mock`).map(e=>({id:e,name:Yt[e]??e})):[],g=t?.providers[r],_=g?.type===`agent-sdk`||!g?.type&&r===`claude`,v=async(e,i)=>{if(t){u(!0),f(null);try{n(await M({providers:{[r]:{[e]:i}}})),m(e=>e+1)}catch(e){f(e.message)}finally{u(!1)}}},y=e?`text-[11px]`:`text-sm`,b=e?`text-xs`:`text-sm`,x=e?`space-y-2`:`space-y-4`,S=e?`space-y-1.5`:`space-y-3`,C=e?`space-y-1`:`space-y-1.5`;if(!t)return(0,R.jsxs)(`div`,{className:S,children:[(0,R.jsx)(`h3`,{className:`${b} font-medium text-text-secondary`,children:`AI Settings`}),(0,R.jsx)(`p`,{className:`${y} text-text-subtle`,children:d?`Error: ${d}`:`Loading...`})]});let ee=_?a:[{value:`__default__`,label:`Auto (default)`},...a];return(0,R.jsxs)(`div`,{className:x,children:[(0,R.jsx)(`h3`,{className:`${b} font-medium text-text-secondary`,children:`AI Settings`}),h.length>1&&(0,R.jsx)(`div`,{className:`flex gap-0.5 border-b border-border/50 -mx-1 px-1`,children:h.map(e=>(0,R.jsxs)(`button`,{onClick:()=>i(e.id),className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-t transition-colors ${r===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,R.jsx)(Kt,{providerId:e.id}),(0,R.jsx)(`span`,{className:`capitalize`,children:e.name})]},e.id))}),(0,R.jsxs)(`div`,{className:S,children:[a.length>0&&(0,R.jsxs)(`div`,{className:C,children:[(0,R.jsx)($,{htmlFor:`ai-model`,className:e?y:void 0,children:`Model`}),(0,R.jsxs)(Lt,{value:_?g?.model??a[0]?.value:g?.model||`__default__`,onValueChange:e=>v(`model`,e===`__default__`?void 0:e),disabled:s,children:[(0,R.jsx)(zt,{id:`ai-model`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,R.jsx)(Rt,{placeholder:s?`Loading models...`:`Select model`})}),(0,R.jsx)(Bt,{className:`max-h-[300px]`,children:ee.map(e=>(0,R.jsx)(Vt,{value:e.value,children:e.label},e.value))})]})]}),_&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:C,children:[(0,R.jsx)($,{htmlFor:`ai-base-url`,className:e?y:void 0,children:`Base URL`}),(0,R.jsx)(w,{id:`ai-base-url`,type:`url`,defaultValue:g?.base_url??``,placeholder:`https://api.anthropic.com (default)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{v(`base_url`,e.target.value.trim()||void 0)}},`baseurl-${r}-${p}`)]}),(0,R.jsxs)(`div`,{className:C,children:[(0,R.jsx)($,{htmlFor:`ai-api-key`,className:e?y:void 0,children:`API Key / Token`}),(0,R.jsx)(w,{id:`ai-api-key`,type:`password`,defaultValue:g?.api_key??``,placeholder:`sk-ant-... (optional, overrides accounts)`,className:e?`h-7 text-[11px] font-mono`:`font-mono`,onBlur:e=>{let t=e.target.value.trim();t.startsWith(`••••`)||v(`api_key`,t||void 0)}},`apikey-${r}-${p}`),(0,R.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Direct API key or OAuth token. Leave empty to use connected accounts.`})]}),(0,R.jsxs)(`div`,{className:C,children:[(0,R.jsx)($,{htmlFor:`ai-effort`,className:e?y:void 0,children:`Effort`}),(0,R.jsxs)(Lt,{value:g?.effort??`high`,onValueChange:e=>v(`effort`,e),children:[(0,R.jsx)(zt,{id:`ai-effort`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,R.jsx)(Rt,{})}),(0,R.jsx)(Bt,{children:qt.map(e=>(0,R.jsx)(Vt,{value:e.value,children:e.label},e.value))})]})]}),(0,R.jsxs)(`div`,{className:C,children:[(0,R.jsx)($,{htmlFor:`ai-max-turns`,className:e?y:void 0,children:`Max Turns (1-500)`}),(0,R.jsx)(w,{id:`ai-max-turns`,type:`number`,min:1,max:500,defaultValue:g?.max_turns??100,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);isNaN(t)||v(`max_turns`,t)}},`turns-${r}-${p}`)]}),(0,R.jsxs)(`div`,{className:C,children:[(0,R.jsx)($,{htmlFor:`ai-budget`,className:e?y:void 0,children:`Max Budget (USD)`}),(0,R.jsx)(w,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:g?.max_budget_usd??``,placeholder:`No limit`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseFloat(e.target.value);v(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${r}-${p}`)]}),(0,R.jsxs)(`div`,{className:C,children:[(0,R.jsx)($,{htmlFor:`ai-thinking`,className:e?y:void 0,children:`Thinking Budget (tokens)`}),(0,R.jsx)(w,{id:`ai-thinking`,type:`number`,min:0,defaultValue:g?.thinking_budget_tokens??``,placeholder:`Disabled`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);v(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${r}-${p}`)]})]}),(0,R.jsxs)(`div`,{className:C,children:[(0,R.jsx)($,{htmlFor:`ai-permission-mode`,className:e?y:void 0,children:`Default Permission Mode`}),(0,R.jsxs)(Lt,{value:g?.permission_mode??`bypassPermissions`,onValueChange:e=>v(`permission_mode`,e),children:[(0,R.jsx)(zt,{id:`ai-permission-mode`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,R.jsx)(Rt,{})}),(0,R.jsx)(Bt,{children:Jt.map(e=>(0,R.jsx)(Vt,{value:e.value,children:e.label},e.value))})]})]}),(0,R.jsxs)(`div`,{className:C,children:[(0,R.jsx)($,{htmlFor:`ai-system-prompt`,className:e?y:void 0,children:`Additional Instructions`}),(0,R.jsx)(`textarea`,{id:`ai-system-prompt`,rows:e?3:4,defaultValue:g?.system_prompt??``,placeholder:`Enter additional instructions for ${r}...`,className:`w-full rounded-md border border-input bg-background px-3 py-2 ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${e?`text-[11px]`:`text-sm`}`,onBlur:e=>{v(`system_prompt`,e.target.value.trim()||void 0)}},`sysprompt-${r}-${p}`)]})]}),l&&(0,R.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),d&&(0,R.jsx)(`p`,{className:`text-xs text-red-500`,children:d})]})}var Zt=L.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Ft,{className:A(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...t,ref:n,children:(0,R.jsx)(It,{className:A(`pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`)})}));Zt.displayName=Ft.displayName;export{$ as a,I as c,P as d,Gt as i,F as l,Xt as n,H as o,Kt as r,re as s,Zt as t,ne as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./jsx-runtime-BRW_vwa9.js";import{t}from"./react-
|
|
1
|
+
import{n as e}from"./jsx-runtime-BRW_vwa9.js";import{t}from"./react-BPIfZRKM.js";import{r as n}from"./utils-Bslrbb-G.js";var r=e(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);function i(){return`panel-${n()}`}function a(e=[],t=null){return{id:i(),tabs:e,activeTabId:t,tabHistory:t?[t]:[]}}function o(e){return e?1:3}function s(e,t){return e.map(e=>e.filter(e=>e!==t)).filter(e=>e.length>0)}function c(e,t){for(let n=0;n<e.length;n++){let r=e[n].indexOf(t);if(r!==-1)return{row:n,col:r}}return null}var l=`ppm-panels-`,u=`ppm-tabs-`;function d(e){return`${l}${e}`}function f(e,t){try{localStorage.setItem(d(e),JSON.stringify(t))}catch{}}function p(e){try{let t=localStorage.getItem(d(e));if(t)return JSON.parse(t)}catch{}return m(e)}function m(e){try{let t=localStorage.getItem(`${u}${e}`);if(!t)return null;let n=JSON.parse(t);if(!n.tabs?.length)return null;let r=a(n.tabs,n.activeTabId),i={panels:{[r.id]:r},grid:[[r.id]],focusedPanelId:r.id};return f(e,i),localStorage.removeItem(`${u}${e}`),i}catch{return null}}var h=new Set([`git-graph`]),g=new Set([`projects`,`git-status`]);function _(){return`tab-${n()}`}function v(e,t){let n=e.filter(e=>e!==t);return n.push(t),n.length>50&&n.shift(),n}function y(){let e=a();return{panels:{[e.id]:e},grid:[[e.id]],focusedPanelId:e.id}}var b=t()((e,t)=>{function n(){let{currentProject:e,panels:n,grid:r,focusedPanelId:i}=t();if(!e)return;let a=new Set(r.flat()),o={};for(let[e,t]of Object.entries(n))a.has(e)&&(o[e]=t);f(e,{panels:o,grid:r,focusedPanelId:i})}function r(e){return Object.values(t().panels).find(t=>t.tabs.some(t=>t.id===e))}function i(e){return e??t().focusedPanelId}return{...y(),currentProject:null,projectGrids:{},projectFocused:{},switchProject:n=>{let{currentProject:r,panels:i,grid:o,focusedPanelId:s,projectGrids:c,projectFocused:l}=t();if(r===n)return;let u={...c},d={...l};if(r){u[r]=o,d[r]=s;let e=new Set(o.flat()),t={};for(let[n,r]of Object.entries(i))e.has(n)&&(t[n]=r);f(r,{panels:t,grid:o,focusedPanelId:s})}if(u[n]){let t=u[n];e({currentProject:n,grid:t,focusedPanelId:d[n]??t[0]?.[0]??``,projectGrids:u,projectFocused:d});return}let m=p(n);if(m&&Object.keys(m.panels).length>0){let t={};for(let[e,n]of Object.entries(m.panels)){let r=n.tabs.filter(e=>!g.has(e.type)),i=n.tabHistory.filter(e=>r.some(t=>t.id===e)),a=n.activeTabId&&r.some(e=>e.id===n.activeTabId)?n.activeTabId:i[i.length-1]??r[0]?.id??null;t[e]={...n,tabs:r,tabHistory:i,activeTabId:a}}let r={...i,...t};u[n]=m.grid,d[n]=m.focusedPanelId,e({currentProject:n,panels:r,grid:m.grid,focusedPanelId:m.focusedPanelId,projectGrids:u,projectFocused:d})}else{let t=a(),r=[[t.id]],o={...i,[t.id]:t};u[n]=r,d[n]=t.id,f(n,{panels:{[t.id]:t},grid:r,focusedPanelId:t.id}),e({currentProject:n,panels:o,grid:r,focusedPanelId:t.id,projectGrids:u,projectFocused:d})}},setFocusedPanel:n=>{t().panels[n]&&e({focusedPanelId:n})},openTab:(r,a)=>{let o=i(a);if(!t().panels[o])return``;if(h.has(r.type))for(let i of Object.values(t().panels)){let t=i.tabs.find(e=>e.type===r.type&&e.projectId===r.projectId);if(t)return e(e=>({focusedPanelId:i.id,panels:{...e.panels,[i.id]:{...i,activeTabId:t.id,tabHistory:v(i.tabHistory,t.id)}}})),n(),t.id}let s=_(),c={...r,id:s};return e(e=>{let t=e.panels[o];return{focusedPanelId:o,panels:{...e.panels,[o]:{...t,tabs:[...t.tabs,c],activeTabId:s,tabHistory:v(t.tabHistory,s)}}}}),n(),s},closeTab:(i,a)=>{let o=a?t().panels[a]:r(i);if(!o)return;let c=o.id;e(e=>{let t=e.panels[c],n=t.tabs.filter(e=>e.id!==i),r=t.tabHistory.filter(e=>e!==i),a=t.activeTabId;if(t.activeTabId===i){let e=r.length>0?r[r.length-1]:null;a=e&&n.some(t=>t.id===e)?e:n[n.length-1]?.id??null}let o=e.grid.flat().length;if(n.length===0&&o>1){let{[c]:t,...n}=e.panels;return{panels:n,grid:s(e.grid,c),focusedPanelId:e.focusedPanelId===c?Object.keys(n)[0]:e.focusedPanelId}}return{panels:{...e.panels,[c]:{...t,tabs:n,activeTabId:a,tabHistory:r}}}}),n()},setActiveTab:(i,a)=>{let o=a?t().panels[a]:r(i);if(!o)return;let s=o.id;e(e=>{let t=e.panels[s];return{focusedPanelId:s,panels:{...e.panels,[s]:{...t,activeTabId:i,tabHistory:v(t.tabHistory,i)}}}}),n()},updateTab:(t,i)=>{let a=r(t);a&&(e(e=>({panels:{...e.panels,[a.id]:{...a,tabs:a.tabs.map(e=>e.id===t?{...e,...i}:e)}}})),n())},reorderTab:(r,i,a)=>{let o=t().panels[i];if(!o)return;let s=o.tabs.findIndex(e=>e.id===r);if(s===-1||s===a)return;let c=[...o.tabs],[l]=c.splice(s,1);c.splice(a,0,l),e(e=>({panels:{...e.panels,[i]:{...o,tabs:c}}})),n()},moveTab:(r,i,a,o)=>{if(i===a)return;let c=t().panels[i],l=t().panels[a];if(!c||!l)return;let u=c.tabs.find(e=>e.id===r);if(!u)return;let d=c.tabs.filter(e=>e.id!==r),f=c.tabHistory.filter(e=>e!==r),p=c.activeTabId===r?f[f.length-1]??d[d.length-1]?.id??null:c.activeTabId,m=[...l.tabs];o===void 0?m.push(u):m.splice(o,0,u),e(e=>{let t=e.grid.flat().length;if(d.length===0&&t>1){let{[i]:t,...n}=e.panels;return{panels:{...n,[a]:{...l,tabs:m,activeTabId:r,tabHistory:v(l.tabHistory,r)}},grid:s(e.grid,i),focusedPanelId:a}}return{focusedPanelId:a,panels:{...e.panels,[i]:{...c,tabs:d,activeTabId:p,tabHistory:f},[a]:{...l,tabs:m,activeTabId:r,tabHistory:v(l.tabHistory,r)}}}}),n()},splitPanel:(r,i,l,u)=>{let{grid:d,panels:f}=t(),p=t().isMobile(),m=f[l];if(!m)return!1;let h=m.tabs.find(e=>e.id===i);if(!h)return!1;let g=c(d,u??l);if(!g)return!1;let _=r===`left`||r===`right`,v=r===`up`||r===`down`;if(_&&(d[g.row]?.length??0)>=o(p)||v&&d.length>=3)return!1;let y=a([h],h.id);y.tabHistory=[h.id];let b=m.tabs.filter(e=>e.id!==i),x=m.tabHistory.filter(e=>e!==i),S=m.activeTabId===i?x[x.length-1]??b[b.length-1]?.id??null:m.activeTabId,C;if(_)C=d.map((e,t)=>{if(t!==g.row)return e;let n=[...e],i=r===`right`?g.col+1:g.col;return n.splice(i,0,y.id),n});else{C=[...d];let e=r===`down`?g.row+1:g.row;C.splice(e,0,[y.id])}return e(e=>{let t=e.grid.flat().length,n={...e.panels,[y.id]:y};if(b.length===0&&t>1){let{[l]:e,...t}=n;n=t,C=s(C,l)}else n[l]={...m,tabs:b,activeTabId:S,tabHistory:x};return{panels:n,grid:C,focusedPanelId:y.id}}),n(),!0},closePanel:r=>{let{panels:i,grid:a}=t();if(a.flat().length<=1)return;let o=i[r];if(!o)return;c(a,r);let l=a.flat(),u=l.indexOf(r),d=u>0?l[u-1]:l[1],f=i[d];f&&(e(e=>{let{[r]:t,...n}=e.panels,i=[...f.tabs,...o.tabs],a=f.activeTabId??o.activeTabId;return{panels:{...n,[d]:{...f,tabs:i,activeTabId:a,tabHistory:[...f.tabHistory,...o.tabHistory]}},grid:s(e.grid,r),focusedPanelId:d}}),n())},getPanelForTab:e=>r(e),isMobile:()=>typeof window<`u`&&window.innerWidth<768}}),x=t()(()=>({tabs:[],activeTabId:null,tabHistory:[],currentProject:null,switchProject:e=>{b.getState().switchProject(e),S()},openTab:e=>{let t=b.getState().openTab(e);return S(),t},closeTab:e=>{b.getState().closeTab(e),S()},setActiveTab:e=>{b.getState().setActiveTab(e),S()},updateTab:(e,t)=>{b.getState().updateTab(e,t),S()}}));function S(){let e=b.getState(),t=e.panels[e.focusedPanelId];x.setState({tabs:t?.tabs??[],activeTabId:t?.activeTabId??null,tabHistory:t?.tabHistory??[],currentProject:e.currentProject})}b.subscribe(()=>S());export{o as a,c as i,b as n,r as o,a as r,x as t};
|