@rubytech/create-maxy-code 0.1.296 → 0.1.297
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/package.json +1 -1
- package/payload/platform/plugins/admin/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/admin/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/admin/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +3 -13
- package/payload/platform/plugins/aeo/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/aeo/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/aeo/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/browser/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/browser/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/browser/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/contacts/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/contacts/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/contacts/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/docs/references/getting-started.md +1 -1
- package/payload/platform/plugins/docs/references/platform.md +1 -11
- package/payload/platform/plugins/email/.claude-plugin/plugin.json +6 -2
- package/payload/platform/plugins/email/PLUGIN.md +6 -2
- package/payload/platform/plugins/email/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/email/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft.test.js +75 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-setup.test.js +58 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-setup.test.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-drafts.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-drafts.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-drafts.test.js +74 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-drafts.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-probe.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-probe.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-probe.test.js +69 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/imap-probe.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/mail-options.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/mail-options.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/mail-options.test.js +46 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/mail-options.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/setup-probe.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/setup-probe.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/setup-probe.test.js +56 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/setup-probe.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/smtp-probe.test.d.ts +2 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/smtp-probe.test.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/smtp-probe.test.js +46 -0
- package/payload/platform/plugins/email/mcp/dist/__tests__/smtp-probe.test.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/index.js +44 -0
- package/payload/platform/plugins/email/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts +16 -3
- package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/imap.js +62 -5
- package/payload/platform/plugins/email/mcp/dist/lib/imap.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.d.ts +42 -0
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.js +72 -0
- package/payload/platform/plugins/email/mcp/dist/lib/setup-probe.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/smtp.d.ts +16 -6
- package/payload/platform/plugins/email/mcp/dist/lib/smtp.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/smtp.js +37 -20
- package/payload/platform/plugins/email/mcp/dist/lib/smtp.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/scripts/send-transactional.js +1 -2
- package/payload/platform/plugins/email/mcp/dist/scripts/send-transactional.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft.d.ts +13 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft.js +45 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-draft.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/tools/email-send.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-send.js +2 -8
- package/payload/platform/plugins/email/mcp/dist/tools/email-send.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-setup.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-setup.js +25 -3
- package/payload/platform/plugins/email/mcp/dist/tools/email-setup.js.map +1 -1
- package/payload/platform/plugins/email/references/email-reference.md +15 -0
- package/payload/platform/plugins/email/skills/email-composition/SKILL.md +15 -4
- package/payload/platform/plugins/memory/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/memory/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/memory/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/outlook/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/outlook/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/replicate/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/replicate/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/replicate/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/scheduling/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/scheduling/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/scheduling/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/telegram/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/telegram/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/telegram/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/url-get/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/url-get/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/url-get/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/whatsapp/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/whatsapp/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/whatsapp/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/work/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/work/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/work/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/workflows/.claude-plugin/plugin.json +5 -1
- package/payload/platform/plugins/workflows/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/platform/plugins/workflows/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +1 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/jsonl-watch.d.ts +10 -0
- package/payload/platform/services/whatsapp-channel/dist/jsonl-watch.d.ts.map +1 -0
- package/payload/platform/services/whatsapp-channel/dist/jsonl-watch.js +70 -0
- package/payload/platform/services/whatsapp-channel/dist/jsonl-watch.js.map +1 -0
- package/payload/platform/services/whatsapp-channel/dist/server.d.ts +6 -1
- package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.js +38 -1
- package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
- package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
- package/payload/premium-plugins/writer-craft/.claude-plugin/plugin.json +5 -1
- package/payload/premium-plugins/writer-craft/lib/mcp-spawn-tee/index.js +159 -0
- package/payload/premium-plugins/writer-craft/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/server/public/assets/AdminShell-DpjiG4KO.js +1 -0
- package/payload/server/public/assets/{Checkbox-DTrIyIFP.js → Checkbox-o5EbM1Sd.js} +1 -1
- package/payload/server/public/assets/{Transcript-C3aDVJ-n.js → Transcript-B-roO2vK.js} +1 -1
- package/payload/server/public/assets/{admin-DVdyV-Q6.js → admin-DmBG61gA.js} +1 -1
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-DR9W0q1P.js → architectureDiagram-Q4EWVU46-DCLfcVZf.js} +1 -1
- package/payload/server/public/assets/{audio-attachment-mime-DGEfApkA.js → audio-attachment-mime-D_YMUIBb.js} +1 -1
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-C3uwaI7p.js → blockDiagram-DXYQGD6D-DtTb6oGR.js} +1 -1
- package/payload/server/public/assets/{browser-DrJReVEG.js → browser-DPqQnY8B.js} +1 -1
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-C8hmUDdd.js → c4Diagram-AHTNJAMY-DHMgkbse.js} +1 -1
- package/payload/server/public/assets/channel-BGB5Q-QM.js +1 -0
- package/payload/server/public/assets/chat-BpceL2qA.js +1 -0
- package/payload/server/public/assets/{chunk-336JU56O-BRCubMCb.js → chunk-336JU56O-DQja-fc4.js} +2 -2
- package/payload/server/public/assets/{chunk-426QAEUC-BNINkVsL.js → chunk-426QAEUC-uBZXKz4Z.js} +1 -1
- package/payload/server/public/assets/{chunk-4TB4RGXK-DSMj_AZh.js → chunk-4TB4RGXK-DViPFnGL.js} +1 -1
- package/payload/server/public/assets/{chunk-5FUZZQ4R-6DNGaUkf.js → chunk-5FUZZQ4R-CdKJ7vdW.js} +1 -1
- package/payload/server/public/assets/{chunk-5PVQY5BW-DPhkkS4p.js → chunk-5PVQY5BW-BIJiayBe.js} +1 -1
- package/payload/server/public/assets/{chunk-EDXVE4YY-BjWSqn7_.js → chunk-EDXVE4YY-CDDqx-TB.js} +1 -1
- package/payload/server/public/assets/{chunk-ENJZ2VHE-BX1ZnU4A.js → chunk-ENJZ2VHE-BVNFvue5.js} +1 -1
- package/payload/server/public/assets/{chunk-ICPOFSXX-DvYSWH7x.js → chunk-ICPOFSXX-DEZQolUW.js} +1 -1
- package/payload/server/public/assets/{chunk-OYMX7WX6-7_m3mEOK.js → chunk-OYMX7WX6-Dn0reHna.js} +1 -1
- package/payload/server/public/assets/{chunk-U2HBQHQK-Bl1a895I.js → chunk-U2HBQHQK-sqMpBHaS.js} +1 -1
- package/payload/server/public/assets/{chunk-X2U36JSP-WkSpBPYx.js → chunk-X2U36JSP-ByhTOa14.js} +1 -1
- package/payload/server/public/assets/{chunk-YZCP3GAM-DpWRmPUo.js → chunk-YZCP3GAM-CGo_et0d.js} +1 -1
- package/payload/server/public/assets/{chunk-ZZ45TVLE-D9Dgmeso.js → chunk-ZZ45TVLE-B9aPwq_o.js} +1 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-DdUR3hKH.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-B0ZE2WR0.js +1 -0
- package/payload/server/public/assets/clone-B5aO4uPo.js +1 -0
- package/payload/server/public/assets/{dagre-PrVfCcSt.js → dagre-DE88U4Vk.js} +1 -1
- package/payload/server/public/assets/{dagre-KV5264BT-DPq3dcLH.js → dagre-KV5264BT-oeoQWi1f.js} +1 -1
- package/payload/server/public/assets/data-6mvcS2_6.js +1 -0
- package/payload/server/public/assets/{diagram-5BDNPKRD-DoszElKb.js → diagram-5BDNPKRD-HmWmPhlY.js} +1 -1
- package/payload/server/public/assets/{diagram-G4DWMVQ6-BRuqosix.js → diagram-G4DWMVQ6-Bkao4d6n.js} +1 -1
- package/payload/server/public/assets/{diagram-MMDJMWI5-CpigG1d_.js → diagram-MMDJMWI5-Eh2fnSb-.js} +1 -1
- package/payload/server/public/assets/{diagram-TYMM5635-BS0eYiq9.js → diagram-TYMM5635-C8705_ZE.js} +1 -1
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-VEQyXCFl.js → erDiagram-SMLLAGMA-Bkhe0ZPv.js} +1 -1
- package/payload/server/public/assets/{file-download-C3pBZjt9.js → file-download-DVUMxBgB.js} +1 -1
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-2NYMfqHX.js → flowDiagram-DWJPFMVM-rQKH0HF0.js} +1 -1
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-AAAa2sqE.js → ganttDiagram-T4ZO3ILL-C3oSBbAe.js} +1 -1
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-d8NUAIz5.js → gitGraphDiagram-UUTBAWPF-28GEOzIR.js} +1 -1
- package/payload/server/public/assets/{graph-Bx9_2qbJ.js → graph-B5R9qDya.js} +1 -1
- package/payload/server/public/assets/{graph-labels-Cc1nU1_f.js → graph-labels-Bcq_R9X9.js} +1 -1
- package/payload/server/public/assets/{graphlib-DUlqr2mr.js → graphlib-DhAwTSya.js} +1 -1
- package/payload/server/public/assets/{infoDiagram-42DDH7IO-D4dh4-0g.js → infoDiagram-42DDH7IO-DnSzN29F.js} +1 -1
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-DPTmm2IE.js → ishikawaDiagram-UXIWVN3A-B0mYhBS0.js} +1 -1
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-B85vjqkE.js → journeyDiagram-VCZTEJTY-CIcZskca.js} +1 -1
- package/payload/server/public/assets/{jsx-runtime-D3PZpOAF.css → jsx-runtime-DqAwfhuD.css} +1 -1
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-C2Lfb5Xh.js → kanban-definition-6JOO6SKY-DWEpWX0D.js} +1 -1
- package/payload/server/public/assets/{line-CODKFpwO.js → line-D6evlE4c.js} +1 -1
- package/payload/server/public/assets/{mermaid-parser.core-DYdFZnXH.js → mermaid-parser.core-DyRhDebz.js} +1 -1
- package/payload/server/public/assets/{mermaid.core-Bamjzahu.js → mermaid.core-DaD391Xr.js} +3 -3
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-CLK90bKJ.js → mindmap-definition-QFDTVHPH-D7IMib-k.js} +1 -1
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-DEsnxhqP.js → pieDiagram-DEJITSTG-CyOSJozN.js} +1 -1
- package/payload/server/public/assets/{public-BFMu-jux.js → public-Cj7vjoG1.js} +5 -5
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-uIP9V2jZ.js → quadrantDiagram-34T5L4WZ-CHWWRW-7.js} +1 -1
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-CVS6t5tv.js → requirementDiagram-MS252O5E-x4-mHKrQ.js} +1 -1
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-BIsmtyZA.js → sankeyDiagram-XADWPNL6-DvKrAe78.js} +1 -1
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-Cu8TfQiW.js → sequenceDiagram-FGHM5R23-DW778VnP.js} +1 -1
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-ax4vYGft.js → stateDiagram-FHFEXIEX-DVnPPuE8.js} +1 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-B3nWH_hq.js +1 -0
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-3l7ojkMA.js → timeline-definition-GMOUNBTQ-CO4Sp85K.js} +1 -1
- package/payload/server/public/assets/{useSelectionMode-C_EBRd2k.js → useSelectionMode-BK4pznA6.js} +1 -1
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP-C_sv0qMD.js → vennDiagram-DHZGUBPP-OCcztoT8.js} +1 -1
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-C7u4IHMB.js → wardleyDiagram-NUSXRM2D-C_1o3jux.js} +1 -1
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-A-uLXr1a.js → xychartDiagram-5P7HB3ND-BPJxl9U1.js} +1 -1
- package/payload/server/public/browser.html +6 -6
- package/payload/server/public/chat.html +8 -8
- package/payload/server/public/data.html +5 -5
- package/payload/server/public/graph.html +8 -8
- package/payload/server/public/index.html +8 -8
- package/payload/server/public/public.html +6 -6
- package/payload/server/public/whatsapp-wallpaper.webp +0 -0
- package/payload/server/server.js +6 -2
- package/payload/server/public/assets/AdminShell-DDieHnzi.js +0 -1
- package/payload/server/public/assets/channel-drVqp11B.js +0 -1
- package/payload/server/public/assets/chat-rJYaCD6C.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-Dplkw_pj.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-sJXv1Ihp.js +0 -1
- package/payload/server/public/assets/clone-Q_B6oO0c.js +0 -1
- package/payload/server/public/assets/data-CYyR2m_B.js +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-BRv1By5g.js +0 -1
- /package/payload/server/public/assets/{jsx-runtime-5auA0FEj.js → jsx-runtime-CynkhuPm.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-K5T4RW27-CTZnA5fq.js";import"./chunk-7N4EOEYR-BDpzHOmv.js";import"./chunk-67CJDMHE-Ca9KwdQm.js";import"./chunk-KGLVRYIC-CeuKp7uR.js";import"./chunk-FOC6F5B3-565zaYb3.js";import"./chunk-AA7GKIK3-DXo9fZho.js";import"./chunk-2KRD3SAO-BYqpHDvA.js";import"./chunk-ORNJ4GCN-DcZUCmgM.js";import"./chunk-LIHQZDEY-DXkzlh3_.js";import"./chunk-CIAEETIT-NufEId2j.js";import{g as e,h as t}from"./src-CozP7LCe.js";import{B as n,C as r,L as i,V as a,W as o,_ as s,a as c,b as l,c as u,v as d}from"./chunk-ICPOFSXX-
|
|
1
|
+
import"./chunk-K5T4RW27-CTZnA5fq.js";import"./chunk-7N4EOEYR-BDpzHOmv.js";import"./chunk-67CJDMHE-Ca9KwdQm.js";import"./chunk-KGLVRYIC-CeuKp7uR.js";import"./chunk-FOC6F5B3-565zaYb3.js";import"./chunk-AA7GKIK3-DXo9fZho.js";import"./chunk-2KRD3SAO-BYqpHDvA.js";import"./chunk-ORNJ4GCN-DcZUCmgM.js";import"./chunk-LIHQZDEY-DXkzlh3_.js";import"./chunk-CIAEETIT-NufEId2j.js";import{g as e,h as t}from"./src-CozP7LCe.js";import{B as n,C as r,L as i,V as a,W as o,_ as s,a as c,b as l,c as u,v as d}from"./chunk-ICPOFSXX-DEZQolUW.js";import{t as f}from"./chunk-426QAEUC-uBZXKz4Z.js";import{t as p}from"./chunk-4BX2VUAB-BeDVr5Tb.js";import{t as m}from"./mermaid-parser.core-DyRhDebz.js";var h=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),g=t((e,t,n)=>({x:h(t,`${n} evolution`),y:h(e,`${n} visibility`)}),`toCoordinates`),_=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),v=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),y=t((e,t)=>{if(p(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=g(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=g(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=g(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=h(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=_(e.fromPort)??_(e.toPort),{flow:i,label:a}=v(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(e.from,e.to,n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=h(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=g(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=g(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=g(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=g(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),b={parser:{yy:void 0},parse:t(async t=>{let n=await m(`wardley`,t);e.debug(n);let r=b.parser?.yy;if(!r||typeof r.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);y(n,r)},`parse`)},x=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function S(e){let t=l();return i(e.trim(),t)}t(S,`textSanitizer`);function C(){return l()[`wardley-beta`]}t(C,`getConfig`);function w(e,t,n,r,i,a,o,s,c){x.addNode({id:e,label:S(t),x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(w,`addNode`);function T(e,t,n=!1,r,i){x.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(T,`addLink`);function E(e,t,n){x.addTrend({nodeId:e,targetX:t,targetY:n})}t(E,`addTrend`);function D(e,t,n){x.addAnnotation({number:e,coordinates:t,text:n?S(n):void 0})}t(D,`addAnnotation`);function O(e,t,n){x.addNote({text:S(e),x:t,y:n})}t(O,`addNote`);function k(e,t,n){x.addAccelerator({name:S(e),x:t,y:n})}t(k,`addAccelerator`);function A(e,t,n){x.addDeaccelerator({name:S(e),x:t,y:n})}t(A,`addDeaccelerator`);function j(e,t){x.setAnnotationsBox(e,t)}t(j,`setAnnotationsBox`);function M(e,t){x.setSize(e,t)}t(M,`setSize`);function N(e){x.startPipeline(e)}t(N,`startPipeline`);function P(e,t){x.addPipelineComponent(e,t)}t(P,`addPipelineComponent`);function F(e){let t={};e.xLabel&&(t.xLabel=S(e.xLabel)),e.yLabel&&(t.yLabel=S(e.yLabel)),e.stages&&(t.stages=e.stages.map(e=>S(e))),e.stageBoundaries&&(t.stageBoundaries=e.stageBoundaries),x.setAxes(t)}t(F,`updateAxes`);function I(e){return x.getNode(e)}t(I,`getNode`);function L(){return x.build()}t(L,`getWardleyData`);function R(){x.clear(),c()}t(R,`clear`);var z={getConfig:C,addNode:w,addLink:T,addTrend:E,addAnnotation:D,addNote:O,addAccelerator:k,addDeaccelerator:A,setAnnotationsBox:j,setSize:M,startPipeline:N,addPipelineComponent:P,updateAxes:F,getNode:I,getWardleyData:L,clear:R,setAccTitle:a,getAccTitle:d,setDiagramTitle:o,getDiagramTitle:r,getAccDescription:s,setAccDescription:n},B=[`Genesis`,`Custom Built`,`Product`,`Commodity`],V=t(()=>{let{themeVariables:e}=l();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),H=t(()=>{let e=l()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),U={parser:b,db:z,renderer:{draw:t((n,r,i,a)=>{e.debug(`Rendering Wardley map
|
|
2
2
|
`+n);let o=H(),s=V(),c=o.nodeRadius*1.6,l=a.db,d=l.getWardleyData(),p=l.getDiagramTitle(),m=d.size?.width??o.width,h=d.size?.height??o.height,g=f(r);g.selectAll(`*`).remove(),u(g,h,m,o.useMaxWidth),g.attr(`viewBox`,`0 0 ${m} ${h}`);let _=g.append(`g`).attr(`class`,`wardley-map`),v=g.append(`defs`);v.append(`marker`).attr(`id`,`arrow-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.evolutionStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-end-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-start-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,1).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),_.append(`rect`).attr(`class`,`wardley-background`).attr(`width`,m).attr(`height`,h).attr(`fill`,s.backgroundColor);let y=m-o.padding*2,b=h-o.padding*2;p&&_.append(`text`).attr(`class`,`wardley-title`).attr(`x`,m/2).attr(`y`,o.padding/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize*1.05).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(p);let x=t(e=>o.padding+e/100*y,`projectX`),S=t(e=>h-o.padding-e/100*b,`projectY`),C=_.append(`g`).attr(`class`,`wardley-axes`);C.append(`line`).attr(`x1`,o.padding).attr(`x2`,m-o.padding).attr(`y1`,h-o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1),C.append(`line`).attr(`x1`,o.padding).attr(`x2`,o.padding).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1);let w=d.axes.xLabel??`Evolution`,T=d.axes.yLabel??`Visibility`;C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-x`).attr(`x`,o.padding+y/2).attr(`y`,h-o.padding/4).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).text(w),C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-y`).attr(`x`,o.padding/3).attr(`y`,o.padding+b/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`transform`,`rotate(-90 ${o.padding/3} ${o.padding+b/2})`).text(T);let E=d.axes.stages&&d.axes.stages.length>0?d.axes.stages:B;if(E.length>0){let e=_.append(`g`).attr(`class`,`wardley-stages`),t=d.axes.stageBoundaries,n=[];if(t&&t.length===E.length){let e=0;t.forEach(t=>{n.push({start:e,end:t}),e=t})}else{let e=1/E.length;E.forEach((t,r)=>{n.push({start:r*e,end:(r+1)*e})})}E.forEach((t,r)=>{let i=n[r],a=o.padding+i.start*y,c=(a+(o.padding+i.end*y))/2;r>0&&e.append(`line`).attr(`x1`,a).attr(`x2`,a).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`stroke-dasharray`,`5 5`).attr(`opacity`,.8),e.append(`text`).attr(`class`,`wardley-stage-label`).attr(`x`,c).attr(`y`,h-o.padding/1.5).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize-2).attr(`text-anchor`,`middle`).text(t)})}if(o.showGrid){let e=_.append(`g`).attr(`class`,`wardley-grid`);for(let t=1;t<4;t++){let n=t/4,r=o.padding+y*n;e.append(`line`).attr(`x1`,r).attr(`x2`,r).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`),e.append(`line`).attr(`x1`,o.padding).attr(`x2`,m-o.padding).attr(`y1`,h-o.padding-b*n).attr(`y2`,h-o.padding-b*n).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`)}}let D=new Map;if(d.nodes.forEach(e=>{D.set(e.id,{x:x(e.x),y:S(e.y),node:e})}),d.pipelines.length>0){let e=_.append(`g`).attr(`class`,`wardley-pipelines`),t=_.append(`g`).attr(`class`,`wardley-pipeline-links`);d.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let r=n.componentIds.map(e=>({id:e,pos:D.get(e),node:d.nodes.find(t=>t.id===e)})).filter(e=>e.pos&&e.node).sort((e,t)=>e.node.x-t.node.x);for(let e=0;e<r.length-1;e++){let n=r[e],i=r[e+1];t.append(`line`).attr(`class`,`wardley-pipeline-evolution-link`).attr(`x1`,n.pos.x).attr(`y1`,n.pos.y).attr(`x2`,i.pos.x).attr(`y2`,i.pos.y).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`)}let i=1/0,a=-1/0,l=0;if(n.componentIds.forEach(e=>{let t=D.get(e);t&&(i=Math.min(i,t.x),a=Math.max(a,t.x),l=t.y)}),i!==1/0&&a!==-1/0){let t=o.nodeRadius*4,r=l-t/2,u=D.get(n.nodeId);u&&(u.x=(i+a)/2,u.y=r-c/6),e.append(`rect`).attr(`class`,`wardley-pipeline-box`).attr(`x`,i-15).attr(`y`,r).attr(`width`,a-i+30).attr(`height`,t).attr(`fill`,`none`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}})}let O=_.append(`g`).attr(`class`,`wardley-links`),k=new Map;d.pipelines.forEach(e=>{k.set(e.nodeId,new Set(e.componentIds))});let A=d.links.filter(e=>!(!D.has(e.source)||!D.has(e.target)||k.get(e.target)?.has(e.source)));O.selectAll(`line`).data(A).enter().append(`line`).attr(`class`,e=>`wardley-link${e.dashed?` wardley-link--dashed`:``}`).attr(`x1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.x+i/s*r}).attr(`y1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.y+a/s*r}).attr(`x2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.x+i/s*r}).attr(`y2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.y+a/s*r}).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,e=>e.dashed?`6 6`:null).attr(`marker-end`,e=>e.flow===`forward`||e.flow===`bidirectional`?`url(#link-arrow-end-${r})`:null).attr(`marker-start`,e=>e.flow===`backward`||e.flow===`bidirectional`?`url(#link-arrow-start-${r})`:null),O.selectAll(`text`).data(A.filter(e=>e.label)).enter().append(`text`).attr(`class`,`wardley-link-label`).attr(`x`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=n.y-t.y,a=n.x-t.x;return r+i/Math.sqrt(a*a+i*i)*8}).attr(`y`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.y+n.y)/2,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return r+-i/o*8}).attr(`fill`,s.axisTextColor).attr(`font-size`,o.labelFontSize).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`transform`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=(t.y+n.y)/2,a=n.x-t.x,o=n.y-t.y,s=Math.sqrt(a*a+o*o),c=o/s,l=-a/s,u=r+c*8,d=i+l*8,f=Math.atan2(o,a)*180/Math.PI;return(f>90||f<-90)&&(f+=180),`rotate(${f} ${u} ${d})`}).text(e=>e.label);let j=_.append(`g`).attr(`class`,`wardley-trends`),M=d.trends.map(e=>{let t=D.get(e.nodeId);if(!t)return null;let n=x(e.targetX),r=S(e.targetY),i=n-t.x,a=r-t.y,s=Math.sqrt(i*i+a*a),c=o.nodeRadius+2;return{origin:t,targetX:n,targetY:r,adjustedX2:s>c?n-i/s*c:n,adjustedY2:s>c?r-a/s*c:r}}).filter(e=>e!==null);j.selectAll(`line`).data(M).enter().append(`line`).attr(`class`,`wardley-trend`).attr(`x1`,e=>e.origin.x).attr(`y1`,e=>e.origin.y).attr(`x2`,e=>e.adjustedX2).attr(`y2`,e=>e.adjustedY2).attr(`stroke`,s.evolutionStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`).attr(`marker-end`,`url(#arrow-${r})`);let N=_.append(`g`).attr(`class`,`wardley-nodes`).selectAll(`g`).data(d.nodes).enter().append(`g`).attr(`class`,e=>[`wardley-node`,e.className?`wardley-node--${e.className}`:``].filter(Boolean).join(` `));N.filter(e=>e.sourceStrategy===`outsource`).append(`circle`).attr(`class`,`wardley-outsource-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#666`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`buy`).append(`circle`).attr(`class`,`wardley-buy-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#ccc`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`build`).append(`circle`).attr(`class`,`wardley-build-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#eee`).attr(`stroke`,`#000`).attr(`stroke-width`,1);let P=N.filter(e=>e.sourceStrategy===`market`);P.append(`circle`).attr(`class`,`wardley-market-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>!e.isPipelineParent&&e.sourceStrategy!==`market`&&e.className!==`anchor`).append(`circle`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1);let F=o.nodeRadius*.7,I=o.nodeRadius*1.2;if(P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x).attr(`y1`,e=>D.get(e.id).y-I).attr(`x2`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x).attr(`y2`,e=>D.get(e.id).y-I).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y-I).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),N.filter(e=>e.isPipelineParent===!0).append(`rect`).attr(`x`,e=>D.get(e.id).x-c/2).attr(`y`,e=>D.get(e.id).y-c/2).attr(`width`,c).attr(`height`,c).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.inertia===!0).append(`line`).attr(`class`,`wardley-inertia`).attr(`x1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y-n/2}).attr(`x2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y+n/2}).attr(`stroke`,s.componentStroke).attr(`stroke-width`,6),N.append(`text`).attr(`x`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetX===void 0?t.x:t.x+e.labelOffsetX;let n=o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetX===void 0&&(n+=10);let r=e.labelOffsetX??n;return t.x+r}).attr(`y`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetY===void 0?t.y-3:t.y+e.labelOffsetY;let n=-o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetY===void 0&&(n-=10);let r=e.labelOffsetY??n;return t.y+r}).attr(`class`,`wardley-node-label`).attr(`fill`,e=>e.className===`evolved`?s.evolutionStroke:e.className===`anchor`?`#000`:s.componentLabelColor).attr(`font-size`,o.labelFontSize).attr(`font-weight`,e=>e.className===`anchor`?`bold`:`normal`).attr(`text-anchor`,e=>e.className===`anchor`?`middle`:`start`).attr(`dominant-baseline`,e=>e.className===`anchor`?`middle`:`auto`).text(e=>e.label),d.annotations.length>0){let e=_.append(`g`).attr(`class`,`wardley-annotations`);if(d.annotations.forEach(t=>{let n=t.coordinates.map(e=>({x:x(e.x),y:S(e.y)}));if(n.length>1)for(let t=0;t<n.length-1;t++)e.append(`line`).attr(`class`,`wardley-annotation-line`).attr(`x1`,n[t].x).attr(`y1`,n[t].y).attr(`x2`,n[t+1].x).attr(`y2`,n[t+1].y).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`stroke-dasharray`,`4 4`);n.forEach(n=>{let r=e.append(`g`).attr(`class`,`wardley-annotation`);r.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5),r.append(`text`).attr(`x`,n.x).attr(`y`,n.y).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.number)})}),d.annotationsBox){let t=x(d.annotationsBox.x),n=S(d.annotationsBox.y),r=e.append(`g`).attr(`class`,`wardley-annotations-box`),i=[...d.annotations].filter(e=>e.text).sort((e,t)=>e.number-t.number),a=[];if(i.forEach((e,i)=>{let o=r.append(`text`).attr(`x`,t+10).attr(`y`,n+10+(i+1)*16).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`middle`).text(`${e.number}. ${e.text}`);a.push(o)}),a.length>0){let e=0,c=0;a.forEach(t=>{let n=t.node(),r=n.getComputedTextLength();e=Math.max(e,r);let i=n.getBBox();c=Math.max(c,i.height)});let l=e+20+105,u=i.length*16+20+c/2,d=o.padding,f=m-o.padding-l,p=o.padding,g=h-o.padding-u;t=Math.max(d,Math.min(t,f)),n=Math.max(p,Math.min(n,g)),a.forEach((e,r)=>{e.attr(`x`,t+10).attr(`y`,n+10+(r+1)*16)}),r.insert(`rect`,`text`).attr(`x`,t).attr(`y`,n).attr(`width`,l).attr(`height`,u).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}}}if(d.notes.length>0){let e=_.append(`g`).attr(`class`,`wardley-notes`);d.notes.forEach(t=>{let n=x(t.x),r=S(t.y);e.append(`text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,`start`).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.text)})}if(d.accelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-accelerators`);d.accelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
|
|
3
3
|
M ${n} ${r-30/2}
|
|
4
4
|
L ${n+60-20} ${r-30/2}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as e,h as t}from"./src-CozP7LCe.js";import{B as n,C as r,E as i,L as a,V as o,W as s,_ as c,a as l,c as u,d,v as f,y as p}from"./chunk-ICPOFSXX-
|
|
1
|
+
import{g as e,h as t}from"./src-CozP7LCe.js";import{B as n,C as r,E as i,L as a,V as o,W as s,_ as c,a as l,c as u,d,v as f,y as p}from"./chunk-ICPOFSXX-DEZQolUW.js";import{t as m}from"./linear-CgbkJiu6.js";import{t as h}from"./ordinal-C-EimP2j.js";import"./defaultLocale-Dl3Sud5K.js";import{t as g}from"./init-BukMwkmL.js";import"./dist-Pgmncqde.js";import{r as _}from"./chunk-5PVQY5BW-BIJiayBe.js";import{t as v}from"./line-D6evlE4c.js";import{t as y}from"./chunk-426QAEUC-uBZXKz4Z.js";import{t as b}from"./chunk-U2HBQHQK-sqMpBHaS.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,34,35,36],E=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],D=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],O=[1,64],k={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,27:`NUMBER_WITH_DECIMAL`,28:`COMMA`,31:`ARROW_DELIMITER`,34:`NEWLINE`,35:`SEMI`,36:`EOF`,38:`STR`,39:`MD_STR`,41:`AMP`,42:`NUM`,43:`ALPHA`,44:`PLUS`,45:`EQUALS`,46:`MULT`,47:`DOT`,48:`BRKT`,49:`MINUS`,50:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:this.$=[Number(a[s-2]),...a[s]];break;case 21:this.$=[Number(a[s])];break;case 22:r.setXAxisTitle(a[s]);break;case 23:r.setXAxisTitle(a[s-1]);break;case 24:r.setXAxisTitle({type:`text`,text:``});break;case 25:r.setXAxisBand(a[s]);break;case 26:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 27:this.$=a[s-1];break;case 28:this.$=[a[s-2],...a[s]];break;case 29:this.$=[a[s]];break;case 30:r.setYAxisTitle(a[s]);break;case 31:r.setYAxisTitle(a[s-1]);break;case 32:r.setYAxisTitle({type:`text`,text:``});break;case 33:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 37:this.$={text:a[s],type:`text`};break;case 38:this.$={text:a[s],type:`text`};break;case 39:this.$={text:a[s],type:`markdown`};break;case 40:this.$=a[s];break;case 41:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[e(n,r,{3:1,4:2,7:4,5:i,34:a,35:o,36:s}),{1:[3]},e(n,r,{4:2,7:4,3:8,5:i,34:a,35:o,36:s}),e(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],34:a,35:o,36:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,34]),e(c,[2,35]),e(c,[2,36]),{1:[2,1]},e(n,r,{4:2,7:4,3:21,5:i,34:a,35:o,36:s}),{1:[2,3]},e(c,[2,5]),e(n,[2,7],{4:22,34:a,35:o,36:s}),{11:23,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:39,13:38,24:x,27:S,29:40,30:41,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:45,15:44,27:C,33:46,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:49,17:48,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{11:52,17:51,24:w,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,37],{40:55,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b}),e(E,[2,38]),e(E,[2,39]),e(D,[2,40]),e(D,[2,42]),e(D,[2,43]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(T,[2,10]),e(T,[2,22],{30:41,29:56,24:x,27:S}),e(T,[2,24]),e(T,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,11]),e(T,[2,30],{33:60,27:C}),e(T,[2,32]),{31:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:O},e(T,[2,14]),{17:65,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,41]),e(T,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(T,[2,31]),{27:[1,69]},e(T,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(T,[2,15]),e(T,[2,26]),e(T,[2,27]),{11:59,32:72,37:24,38:l,39:u,40:27,41:d,42:f,43:p,44:m,45:h,46:g,47:_,48:v,49:y,50:b},e(T,[2,33]),e(T,[2,19]),{25:73,27:O},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){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(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){r.length-=2*e,a.length-=e,o.length-=e}t(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}t(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`)};k.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(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:t(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:t(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:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(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:t(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:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Browser — Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/browser-
|
|
8
|
+
<script type="module" crossorigin src="/assets/browser-DPqQnY8B.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/useSelectionMode-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/file-download-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/AdminShell-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-CynkhuPm.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BK4pznA6.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/file-download-DVUMxBgB.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/AdminShell-DpjiG4KO.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-DqAwfhuD.css">
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/file-download-qc_xy7Az.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Chat — Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/chat-
|
|
8
|
+
<script type="module" crossorigin src="/assets/chat-BpceL2qA.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/useSelectionMode-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/file-download-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/AdminShell-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/audio-attachment-mime-
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/Transcript-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-CynkhuPm.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BK4pznA6.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/file-download-DVUMxBgB.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/AdminShell-DpjiG4KO.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/audio-attachment-mime-D_YMUIBb.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/Transcript-B-roO2vK.js">
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-DqAwfhuD.css">
|
|
17
17
|
<link rel="stylesheet" crossorigin href="/assets/file-download-qc_xy7Az.css">
|
|
18
18
|
</head>
|
|
19
19
|
<body>
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Data — Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/data-
|
|
8
|
+
<script type="module" crossorigin src="/assets/data-6mvcS2_6.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/graph-labels-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/file-download-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-CynkhuPm.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/graph-labels-Bcq_R9X9.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/file-download-DVUMxBgB.js">
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-DqAwfhuD.css">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/file-download-qc_xy7Az.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Graph — Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/graph-
|
|
8
|
+
<script type="module" crossorigin src="/assets/graph-B5R9qDya.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/graph-labels-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/useSelectionMode-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/file-download-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/AdminShell-
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/Checkbox-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-CynkhuPm.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/graph-labels-Bcq_R9X9.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BK4pznA6.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/file-download-DVUMxBgB.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/AdminShell-DpjiG4KO.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/Checkbox-o5EbM1Sd.js">
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-DqAwfhuD.css">
|
|
17
17
|
<link rel="stylesheet" crossorigin href="/assets/file-download-qc_xy7Az.css">
|
|
18
18
|
</head>
|
|
19
19
|
<body>
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/admin-
|
|
8
|
+
<script type="module" crossorigin src="/assets/admin-DmBG61gA.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/useSelectionMode-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/file-download-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/AdminShell-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/Checkbox-
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/Transcript-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-CynkhuPm.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BK4pznA6.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/file-download-DVUMxBgB.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/AdminShell-DpjiG4KO.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/Checkbox-o5EbM1Sd.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/Transcript-B-roO2vK.js">
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-DqAwfhuD.css">
|
|
17
17
|
<link rel="stylesheet" crossorigin href="/assets/file-download-qc_xy7Az.css">
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/admin-CWMpccrR.css">
|
|
19
19
|
<link rel="stylesheet" href="/brand-defaults.css">
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/public-
|
|
8
|
+
<script type="module" crossorigin src="/assets/public-Cj7vjoG1.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-CWOGyPgy.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/useSelectionMode-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/Checkbox-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/audio-attachment-mime-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-CynkhuPm.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BK4pznA6.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/Checkbox-o5EbM1Sd.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/audio-attachment-mime-D_YMUIBb.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-DqAwfhuD.css">
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/public-vnj7OhQj.css">
|
|
16
16
|
<link rel="stylesheet" href="/brand-defaults.css">
|
|
17
17
|
</head>
|
|
Binary file
|
package/payload/server/server.js
CHANGED
|
@@ -5715,7 +5715,9 @@ app2.post("/", async (c) => {
|
|
|
5715
5715
|
if (!result.ok) {
|
|
5716
5716
|
return c.json({ error: result.error }, 422);
|
|
5717
5717
|
}
|
|
5718
|
-
message =
|
|
5718
|
+
message = message.length > 0 ? `${message}
|
|
5719
|
+
|
|
5720
|
+
${result.result.text}` : result.result.text;
|
|
5719
5721
|
}
|
|
5720
5722
|
for (const file of regularFiles) {
|
|
5721
5723
|
try {
|
|
@@ -7885,7 +7887,9 @@ function createWebchatRoutes(deps) {
|
|
|
7885
7887
|
console.error(`[webchat:inbound] op=send-refused kind=voice reason=stt-failed detail=${result.error}`);
|
|
7886
7888
|
return c.json({ error: result.error }, 422);
|
|
7887
7889
|
}
|
|
7888
|
-
text =
|
|
7890
|
+
text = text.length > 0 ? `${text}
|
|
7891
|
+
|
|
7892
|
+
${result.result.text}` : result.result.text;
|
|
7889
7893
|
}
|
|
7890
7894
|
for (const file of regularFiles) {
|
|
7891
7895
|
try {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CWOGyPgy.js";import{a as t,n,r,t as i}from"./jsx-runtime-5auA0FEj.js";import{a,c as o,o as s,r as c,s as l,t as u}from"./file-download-C3pBZjt9.js";import{l as d,o as f,r as p,t as m}from"./useSelectionMode-C_EBRd2k.js";async function h(){try{let e=await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`logout`})});return e.ok?(await e.json().catch(()=>({})))?.logged_out===!0:(console.error(`[admin-ui] claude-logout http-status=${e.status}`),!1)}catch(e){return console.error(`[admin-ui] claude-logout fetch failed: ${e instanceof Error?e.message:String(e)}`),!1}}var g=r(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),_=r(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),v=r(`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`}]]),y=r(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),b=r(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),x=r(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),S=r(`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`}]]),C=r(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),w=r(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ee=r(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),T=r(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),te=r(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),E=r(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),ne=r(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),re=r(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),D=r(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),ie=r(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),O=r(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),k=r(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),ae=r(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),oe=r(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),se=r(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),A=e(t(),1),j=i();function M(e){let{businessName:t,onNavigate:r,onToggleSidebar:i,sidebarOpen:o,onLogout:s,onDisconnect:u,disconnecting:d}=e,[m,h]=(0,A.useState)(!1),g=(0,A.useRef)(null),_=(0,A.useRef)(null),v=c(null),[y,w]=(0,A.useState)(null),[te,re]=(0,A.useState)(!1),[O,ae]=(0,A.useState)(null),[se,M]=(0,A.useState)(null),[N,P]=(0,A.useState)(!1),[F,I]=(0,A.useState)(null),[L,R]=(0,A.useState)(null),[ce,z]=(0,A.useState)(``);(0,A.useEffect)(()=>{z(window.location.hostname.startsWith(`admin.`)?window.location.origin.replace(`admin.`,`public.`):window.location.origin)},[]),(0,A.useEffect)(()=>{if(!m)return;let e=e=>{g.current&&!g.current.contains(e.target)&&h(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]),(0,A.useEffect)(()=>{if(!m)return;let e=e=>{e.key===`Escape`&&h(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]),(0,A.useEffect)(()=>{m&&_.current?.focus()},[m]),(0,A.useEffect)(()=>{if(!m)return;let e=!1;return v(`/api/admin/version`).then(e=>e.json()).then(t=>{e||R(t)}).catch(e=>{console.error(`[admin/version] menu-open client fetch failed:`,e)}),()=>{e=!0}},[m,v]);let le=(0,A.useCallback)(()=>{h(e=>{let t=!e;return t&&console.info(`[admin-ui] header-menu-open`),t})},[]),B=(0,A.useCallback)(e=>{h(!1),r(e)},[r]),ue=(0,A.useCallback)(async()=>{if(y!==null){w(null),M(null);return}re(!0),ae(null);try{let e=await v(`/api/admin/agents`);if(!e.ok)throw Error(`Failed to load agents`);w((await e.json()).agents??[])}catch(e){console.error(`[admin/agents] list failed:`,e),ae(e instanceof Error?e.message:String(e)),w([])}finally{re(!1)}},[y,v]),de=(0,A.useCallback)(e=>{M(null),w(t=>t?.filter(t=>t.slug!==e)??null),v(`/api/admin/agents/${encodeURIComponent(e)}`,{method:`DELETE`}).catch(e=>console.error(`[admin/agents] delete failed:`,e))},[v]),V=(0,A.useCallback)(()=>{h(!1),s()},[s]),H=(0,A.useCallback)(async()=>{I(null),await u()?(P(!1),h(!1)):I(`Disconnect failed — credentials still present. Try again.`)},[u]),fe=t||p.productName;return(0,j.jsxs)(`header`,{className:`admin-header`,children:[(0,j.jsx)(`button`,{type:`button`,className:`admin-sidebar-toggle`,"aria-label":o?`Hide sidebar`:`Show sidebar`,title:o?`Hide sidebar`:`Show sidebar`,"aria-expanded":o,onClick:i,children:o?(0,j.jsx)(D,{size:20,strokeWidth:1.5}):(0,j.jsx)(ie,{size:20,strokeWidth:1.5})}),(0,j.jsxs)(`div`,{className:`chat-header-label`,children:[(0,j.jsx)(`span`,{className:`chat-logo-btn`,"aria-hidden":`true`,children:(0,j.jsx)(`img`,{src:f,alt:``,className:`chat-logo`})}),(0,j.jsx)(`h1`,{className:`chat-tagline`,children:fe})]}),(0,j.jsxs)(`div`,{className:`chat-burger-wrap`,ref:g,children:[(0,j.jsx)(`button`,{type:`button`,className:`admin-burger`,onClick:le,"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":m,children:(0,j.jsx)(ne,{size:20})}),m&&(0,j.jsxs)(`div`,{className:`admin-menu`,role:`menu`,children:[(0,j.jsxs)(`button`,{ref:_,type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>B(`dashboard`),children:[(0,j.jsx)(T,{size:14}),` Dashboard`]}),(0,j.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>B(`data`),children:[(0,j.jsx)(x,{size:14}),` Data`]}),(0,j.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>B(`graph`),children:[(0,j.jsx)(k,{size:14}),` Graph`]}),(0,j.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>B(`browser`),children:[(0,j.jsx)(C,{size:14}),` Browser`]}),(0,j.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>B(`chat`),children:[(0,j.jsx)(`img`,{src:`/brand/claude.png`,alt:``,className:`chat-menu-claude-icon`}),` Chat`]}),(0,j.jsx)(`div`,{className:`chat-menu-divider`}),(0,j.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:ue,children:[(0,j.jsx)(S,{size:14}),` Public`,te&&(0,j.jsx)(l,{size:12,className:`spin`})]}),y!==null&&(0,j.jsxs)(`div`,{className:`chat-menu-agents`,children:[O&&(0,j.jsx)(`span`,{className:`chat-menu-agent-error`,children:O}),y.length===0&&!O&&(0,j.jsx)(`span`,{className:`chat-menu-agent-empty`,children:`No public agents configured`}),y.map(e=>(0,j.jsxs)(`div`,{className:`chat-menu-item chat-menu-agent-item`,children:[(0,j.jsx)(`span`,{className:`agent-status-dot ${e.status}`}),(0,j.jsxs)(`span`,{className:`agent-text`,children:[(0,j.jsx)(`span`,{className:`agent-display-name`,children:e.displayName}),(0,j.jsxs)(`span`,{className:`agent-slug`,children:[`/`,e.slug]})]}),se===e.slug?(0,j.jsxs)(`span`,{className:`agent-actions agent-confirm`,children:[(0,j.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-yes`,title:`Confirm delete`,onClick:()=>de(e.slug),children:(0,j.jsx)(b,{size:12})}),(0,j.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-no`,title:`Cancel`,onClick:()=>M(null),children:(0,j.jsx)(a,{size:12})})]}):(0,j.jsxs)(`span`,{className:`agent-actions`,children:[(0,j.jsx)(`a`,{href:`${ce}/${e.slug}`,target:`_blank`,rel:`noopener noreferrer`,className:`agent-action-btn`,title:`Open agent`,onClick:()=>h(!1),children:(0,j.jsx)(S,{size:12})}),(0,j.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-delete-btn`,title:`Delete agent`,onClick:()=>M(e.slug),children:(0,j.jsx)(n,{size:12})})]})]},e.slug))]}),(0,j.jsx)(`div`,{className:`chat-menu-divider`}),(0,j.jsxs)(`div`,{className:`chat-menu-version chat-menu-version-passive`,children:[(0,j.jsx)(ee,{size:14}),(0,j.jsxs)(`span`,{className:`version-installed`,children:[L?`v${L.installed}`:`…`,L&&!L.updateAvailable&&(0,j.jsx)(`span`,{className:`version-uptodate-dot`}),L?.updateAvailable&&(0,j.jsx)(`span`,{className:`version-update-dot`})]})]}),N?(0,j.jsxs)(`div`,{className:`chat-menu-item chat-menu-disconnect`,children:[(0,j.jsx)(`span`,{children:`Disconnect Claude account?`}),(0,j.jsxs)(`span`,{className:`agent-actions agent-confirm`,children:[(0,j.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-yes`,title:`Confirm disconnect`,disabled:d,onClick:H,children:d?(0,j.jsx)(l,{size:12,className:`spin`}):(0,j.jsx)(b,{size:12})}),(0,j.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-no`,title:`Cancel disconnect`,disabled:d,onClick:()=>{P(!1),I(null)},children:(0,j.jsx)(a,{size:12})})]})]}):(0,j.jsxs)(`button`,{type:`button`,className:`chat-menu-item chat-menu-disconnect`,role:`menuitem`,onClick:()=>{I(null),P(!0)},children:[(0,j.jsx)(oe,{size:14}),` Disconnect Claude account`]}),F&&(0,j.jsx)(`span`,{className:`chat-menu-agent-error`,children:F}),(0,j.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:V,children:[(0,j.jsx)(E,{size:14}),` Log out`]})]})]})]})}var N=`maxy-shell-side-px`;function P(){if(typeof window>`u`)return 0;let e=document.querySelector(`.platform > .artefact`)?.getBoundingClientRect();return e&&e.width>0?Math.round(e.width):0}function F(e){if(typeof window>`u`)return e;let t=window.innerWidth,n=Math.max(248,t-480-P());return Math.min(Math.max(e,248),n)}function I(){if(typeof window>`u`)return 264;try{let e=window.localStorage.getItem(N);if(!e)return 264;let t=parseInt(e,10);if(!Number.isFinite(t))return console.warn(`[admin-ui] sidebar-width-parse-failed stored=${JSON.stringify(e)} fallback=264`),264;if(t>=248)return F(t)}catch{}return 264}function L({targetSelector:e=`.platform`}){let t=(0,A.useRef)(null),[n,r]=(0,A.useState)(()=>I()),i=(0,A.useRef)(n);(0,A.useLayoutEffect)(()=>{let t=document.querySelector(e);!t||!(t instanceof HTMLElement)||(t.style.setProperty(`--side-px`,`${n}px`),i.current=n)},[n,e]);let a=(0,A.useCallback)(()=>{r(e=>{let t=F(e);return t===e?e:t})},[]);(0,A.useEffect)(()=>{a(),window.addEventListener(`resize`,a);let t=document.querySelector(e),n=null;return t instanceof HTMLElement&&(n=new MutationObserver(a),n.observe(t,{attributes:!0,attributeFilter:[`data-artefact`,`class`]})),()=>{window.removeEventListener(`resize`,a),n?.disconnect()}},[a,e]);let o=e=>{e.preventDefault();let n=t.current;if(!n)return;n.setPointerCapture(e.pointerId),n.classList.add(`dragging`);let a=!1,o=e=>{a=!0,r(F(Math.round(e.clientX)))},s=()=>{if(n.releasePointerCapture(e.pointerId),n.classList.remove(`dragging`),window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),!a)return;let t=i.current;try{window.localStorage.setItem(N,String(t))}catch{}console.info(`[admin-ui] sidebar-resize px=${t}`)};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s)},s=()=>{let e=F(264);r(e);try{window.localStorage.removeItem(N)}catch{}console.info(`[admin-ui] sidebar-resize px=${e}`)};return(0,j.jsx)(`div`,{ref:t,className:`side-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,onPointerDown:o,onDoubleClick:s})}var R={whatsapp:{fill:`#25D366`,label:`WhatsApp`,path:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.71.306 1.263.489 1.694.625.712.227 1.36.195 1.872.118.571-.085 1.758-.719 2.006-1.413.247-.694.247-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.885-9.885 9.885M20.52 3.449C18.24 1.245 15.24.044 12.045.044 5.463.044.103 5.404.1 11.99c0 2.096.546 4.142 1.588 5.945L0 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.585 0 11.946-5.36 11.949-11.946 0-3.193-1.24-6.19-3.495-8.445`},telegram:{fill:`#229ED9`,label:`Telegram`,path:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`}};function ce({channel:e,size:t=16}){let n=R[e];return(0,j.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:n.fill,role:`img`,"aria-label":n.label,className:`channel-icon`,children:(0,j.jsx)(`path`,{d:n.path})})}var z=[`whatsapp`,`telegram`];function le(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),n=e%60;return n>0?`${t}m ${n}s`:`${t}m`}function B(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}var ue=`auth-refresh-failed`;function de({error:e,onClose:t}){if(!e)return null;let n=e.reason===ue,r=n?`Claude sign-in expired`:`Session didn’t open`,i=n?`Your claude.ai login has expired. Re-authenticate to resume sessions.`:`The session did not bind within 60 seconds, so there is no live conversation to open.`;return(0,j.jsx)(`div`,{className:`claude-info-overlay`,onClick:t,children:(0,j.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-label":`Session could not be opened`,children:[(0,j.jsxs)(`div`,{className:`claude-info-header`,children:[(0,j.jsx)(`span`,{children:r}),(0,j.jsx)(`button`,{className:`claude-info-close`,onClick:t,"aria-label":`Close`,children:`✕`})]}),(0,j.jsxs)(`div`,{className:`claude-info-section`,style:{padding:`12px 14px`,fontSize:`11px`,color:`var(--text-secondary)`},children:[i,(0,j.jsxs)(`div`,{className:`claude-info-row`,style:{marginTop:`8px`},children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Reason`}),(0,j.jsx)(`span`,{className:`claude-info-value`,children:e.reason})]}),e.sessionId&&(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,j.jsxs)(`span`,{className:`claude-info-value`,children:[e.sessionId.slice(0,8),`…`]})]})]})]})})}function V(e){let{show:t,onClose:n,claudeInfo:r,messages:i,sessionElapsed:a,sessionId:o,cacheKey:s}=e,[c,l]=(0,A.useState)(null);if(!t)return null;let u=i.flatMap(e=>e.events?.filter(e=>e.type===`usage`)??[]),d=u.at(-1),f=d?.peak_request_pct==null?d?.context_window?Math.round((d.input_tokens+d.cache_creation_tokens+d.cache_read_tokens)/d.context_window*100):0:Math.round(d.peak_request_pct*100),p=u.reduce((e,t)=>e+t.input_tokens+t.cache_creation_tokens+t.cache_read_tokens+t.output_tokens,0),h=i.flatMap(e=>e.events?.filter(e=>e.type===`rate_limit`)??[]).at(-1),g=u.reduce((e,t)=>e+(t.total_cost_usd??0),0),_=r?.account?.subscriptionType,v=e=>{let t=e*1e3-Date.now();if(t<=0)return`now`;let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h ${r}m`:`${r}m`};return(0,j.jsx)(`div`,{className:`claude-info-overlay`,onClick:n,children:(0,j.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),children:[(0,j.jsxs)(`div`,{className:`claude-info-header`,children:[(0,j.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`claude-info-icon`}),(0,j.jsx)(`span`,{children:`Claude Code`}),(0,j.jsx)(`button`,{className:`claude-info-close`,onClick:n,"aria-label":`Close`,children:`✕`})]}),(0,j.jsxs)(`div`,{className:`claude-info-section`,children:[(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Version`}),(0,j.jsx)(`span`,{className:`claude-info-value`,children:r?r.version:`…`})]}),(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Email`}),(0,j.jsx)(`span`,{className:`claude-info-value`,children:r?.account?.email??`…`})]})]}),(_||h||g>0)&&(0,j.jsxs)(`div`,{className:`claude-info-section`,children:[_&&(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Plan`}),(0,j.jsx)(`span`,{className:`claude-info-value`,style:{textTransform:`capitalize`},children:_})]}),h&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Usage`}),(0,j.jsxs)(`span`,{className:`claude-info-value`,children:[Math.round(h.utilization*100),`%`]})]}),(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Resets in`}),(0,j.jsx)(`span`,{className:`claude-info-value`,children:v(h.resetsAt)})]}),h.isUsingOverage&&(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Overage`}),(0,j.jsx)(`span`,{className:`claude-info-value`,children:`Active`})]})]}),g>0&&(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Session cost`}),(0,j.jsxs)(`span`,{className:`claude-info-value`,children:[`$`,g<.01?g.toFixed(4):g.toFixed(2)]})]})]}),(0,j.jsxs)(`div`,{className:`claude-info-section`,children:[(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Model`}),(0,j.jsx)(`span`,{className:`claude-info-value`,children:r?.model??`…`})]}),(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Context used`}),(0,j.jsx)(`span`,{className:`claude-info-value`,children:f>0?`${f}%`:`—`})]}),(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Tokens`}),(0,j.jsx)(`span`,{className:`claude-info-value`,children:p>0?B(p):`—`})]}),(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,j.jsx)(`span`,{className:`claude-info-value`,children:le(a)})]}),(o||s)&&(()=>{let e=o??s??``;return(0,j.jsxs)(`div`,{className:`claude-info-row`,children:[(0,j.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,j.jsx)(`button`,{type:`button`,className:`claude-info-value claude-info-id-copy`,title:`${e} (${o?`flushed`:`pre-flush`}) — click to copy`,onClick:async()=>{l(await m(e)?`copied`:`failed`),setTimeout(()=>l(null),1200)},children:c===`copied`?`copied ✓`:c===`failed`?`copy failed ✕`:`${e.slice(0,8)}…`})]})})()]})]})})}var H=`https://claude.ai/code`,fe=[500,1e3,1500,2e3,2500,3e3,3e3];function pe(e,t,n){let r=n.slug??n.bridgeSessionId??null;if(e&&r)return{kind:`navigate`,url:`${H}/${r}`};let i=n.reason||n.error||`status ${t}`;return{kind:`error`,sessionId:n.sessionId??null,reason:i}}function me(e){if(!e)return``;let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):``}function he(e){let{businessName:t,cacheKey:r,role:i,userName:a,userAvatar:l,onSelectProjects:f,onSelectPeople:m,onSelectTasks:h,onSelectAgents:b,onCloseMobileDrawer:x,collapsed:C,selectedWhatsappId:ee,onSelectWhatsappConversation:T}=e,E=c(r),ne=p.productName,D=typeof a==`string`?a:a===null?`name unavailable`:t||ne,ie=(D.trim().charAt(0)||`?`).toUpperCase(),[k,oe]=(0,A.useState)(`sessions`),[M,N]=(0,A.useState)([]),[P,F]=(0,A.useState)(!1),[I,L]=(0,A.useState)(null),[R,le]=(0,A.useState)(!1),[B,ue]=(0,A.useState)(`file`),[V,H]=(0,A.useState)(null),[he,U]=(0,A.useState)(null),[W,G]=(0,A.useState)([]),[K,_e]=(0,A.useState)(!1),[q,ve]=(0,A.useState)(null),[J,ye]=(0,A.useState)(!1),[Y,be]=(0,A.useState)(!1),[xe,Se]=(0,A.useState)(!1),[Ce,we]=(0,A.useState)(null),[Te,Ee]=(0,A.useState)(new Set),[De,Oe]=(0,A.useState)(new Set),[ke,Ae]=(0,A.useState)(new Set),[je,Me]=(0,A.useState)(new Set),[X,Ne]=(0,A.useState)(!1),[Pe,Fe]=(0,A.useState)([]),[Ie,Le]=(0,A.useState)(!1),[Re,ze]=(0,A.useState)(null),[Z,Be]=(0,A.useState)(`whatsapp`),Ve=(0,A.useCallback)(e=>{if(x(),!r){console.error(`[admin-ui] artefact-download-blocked id=${e.id} reason=no-cache-key`),H({message:`Session not ready — try again`,failed:!0});return}if(!e.downloadPath){console.error(`[admin-ui] artefact-download-blocked id=${e.id} reason=not-downloadable`),H({message:`${e.name} can’t be downloaded`,failed:!0});return}console.info(`[admin-ui] artefact-download id=${e.id} root=${e.downloadRoot??`data`} path=${e.downloadPath}`),u(r,e.downloadPath,e.downloadRoot??`data`),H({message:`Downloading ${e.name}`,failed:!1})},[r,x]);(0,A.useEffect)(()=>{if(!V)return;let e=setTimeout(()=>H(null),2500);return()=>clearTimeout(e)},[V]);let He=(0,A.useCallback)(async()=>{if(r){le(!0),L(null);try{let e=await E(`/api/admin/sidebar-artefacts`);if(!e.ok)throw Error(`status ${e.status}`);N((await e.json()).artefacts??[]),F(!0)}catch(e){let t=e instanceof Error?e.message:String(e);L(`Failed to load artefacts: ${t}`),console.error(`[admin-ui] sidebar-artefacts fetch failed: ${t}`)}finally{le(!1)}}},[r,E]),Q=(0,A.useCallback)(async()=>{if(!r)return null;ye(!0),ve(null);try{let e=await E(`/api/admin/sidebar-sessions`);if(!e.ok)throw Error(`status ${e.status}`);let t=await e.json(),n=t.sessions??[];return G(n),we(t.accountId??null),_e(!0),n}catch(e){let t=e instanceof Error?e.message:String(e);return ve(`Failed to load sessions: ${t}`),console.error(`[admin-ui] sidebar-sessions fetch failed: ${t}`),null}finally{ye(!1)}},[r,E]),Ue=(0,A.useCallback)(async()=>{if(r){ze(null);try{let e=await E(`/api/whatsapp-reader/conversations`);if(!e.ok)throw Error(`status ${e.status}`);Fe((await e.json()).conversations??[]),Le(!0)}catch(e){let t=e instanceof Error?e.message:String(e);ze(`Couldn't load conversations: ${t}`),console.error(`[admin-ui] channel-convos fetch failed: ${t}`)}}},[r,E]);(0,A.useEffect)(()=>{!r||K||Q()},[r,K,Q]),(0,A.useEffect)(()=>{r&&Ue()},[r,Ue]);let We=(0,A.useMemo)(()=>{let e=new Map;for(let t of z)e.set(t,[]);for(let t of Pe)e.get(t.channel)?.push(t);for(let t of z)console.info(`[admin-ui] sidebar-nav surface=${t} count=${e.get(t).length}`);return e},[Pe]),Ge={whatsapp:`WhatsApp`,telegram:`Telegram`},Ke=()=>{T(null),oe(`artefacts`),console.info(`[admin-ui] sidebar-nav surface=artefacts count=${P?M.length:0} collapsed=${C}`),He()},$=1.5,qe=()=>{console.info(`[admin-ui] sidebar-refresh surface=artefacts`),He()},Je=()=>{T(null),oe(`sessions`),console.info(`[admin-ui] sidebar-nav surface=sessions count=${K?W.length:0} collapsed=${C}`),K||Q()},Ye=()=>{console.info(`[admin-ui] sidebar-refresh surface=sessions`),Q()},Xe=e=>{oe(`whatsapp`),Be(e),console.info(`[admin-ui] sidebar-nav surface=${e} count=${We.get(e)?.length??0} collapsed=${C}`)},Ze=(0,A.useCallback)(async e=>{if(e.resumable===!1||De.has(e.sessionId))return;Oe(t=>{let n=new Set(t);return n.add(e.sessionId),n});let t=window.open(``,`_blank`);try{let n=await E(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:e.sessionId,name:e.title||e.sessionId})}),r=await n.json().catch(()=>({})),i=pe(n.ok,n.status,{...r,sessionId:r.sessionId??e.sessionId});console.info(`[admin-ui] sidebar-session-resume sessionId=${e.sessionId} status=${n.status} outcome=${i.kind} slug=${r.slug??r.bridgeSessionId??`none`}`),i.kind===`navigate`?(x(),t?t.location.href=i.url:window.open(i.url,`_blank`)):(t?.close(),console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} status=${n.status} reason=${i.reason}`),U(i))}catch(n){t?.close();let r=n instanceof Error?n.message:String(n);console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} error=${r}`),U({sessionId:e.sessionId,reason:r})}finally{Oe(t=>{let n=new Set(t);return n.delete(e.sessionId),n})}},[E,x,De]),Qe=(0,A.useCallback)(async e=>{let t=e.slice(0,8);for(let n=1;n<=fe.length;n++){await new Promise(e=>setTimeout(e,fe[n-1]));let r=await Q();if(r&&r.some(t=>t.sessionId===e)){console.info(`[admin-ui] sidebar-new-session-converged sessionId=${t} via=retry attempts=${n}`);return}}console.error(`[admin-ui] sidebar-new-session-converge-timeout sessionId=${t}`)},[Q]),$e=(0,A.useCallback)(async()=>{if(X)return;Ne(!0);let e=window.open(``,`_blank`);try{let t=await E(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})}),n=await t.json().catch(()=>({})),r=pe(t.ok,t.status,n);console.info(`[admin-ui] sidebar-new-session-spawned status=${t.status} outcome=${r.kind} slug=${n.slug??n.bridgeSessionId??`none`}`),r.kind===`navigate`?(e?e.location.href=r.url:window.open(r.url,`_blank`),n.sessionId?Qe(n.sessionId):console.error(`[admin-ui] sidebar-new-session-converge-skipped reason=no-session-id`)):(e?.close(),console.error(`[admin-ui] sidebar-new-session-failed status=${t.status} reason=${r.reason}`),U(r))}catch(t){e?.close();let n=t instanceof Error?t.message:String(t);console.error(`[admin-ui] sidebar-new-session-failed error=${n}`),U({sessionId:null,reason:n})}finally{Ne(!1)}},[E,X,Qe]),et=(0,A.useCallback)(async(e,t)=>{if(e.stopPropagation(),!Te.has(t.sessionId)){Ee(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await E(`/api/admin/session-delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId})});if(!e.ok){let n=await e.json().catch(()=>({}));console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${t.sessionId} status=${e.status} error=${n.error??`unknown`}`),H({message:`Delete failed: ${n.error??`status ${e.status}`}`,failed:!0});return}let n=await e.json();console.info(`[admin-ui] sidebar-session-delete sessionId=${t.sessionId} pidKilled=${n.pidKilled??`?`} deleted=${n.deleted??`?`}`),G(e=>e.filter(e=>e.sessionId!==t.sessionId)),Q()}catch(e){let n=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${t.sessionId} error=${n}`),H({message:`Delete failed: ${n}`,failed:!0})}finally{Ee(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[E,Te,Q]),tt=(0,A.useCallback)(async(e,t)=>{if(e.stopPropagation(),!ke.has(t.sessionId)){Ae(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await E(`/api/admin/session-stop`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId})});if(!e.ok){let n=await e.json().catch(()=>({}));console.error(`[admin-ui] sidebar-session-stop-failed sessionId=${t.sessionId} status=${e.status} error=${n.error??`unknown`}`),H({message:`Stop failed: ${n.error??`status ${e.status}`}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-stop sessionId=${t.sessionId}`),Q()}catch(e){let n=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-stop-failed sessionId=${t.sessionId} error=${n}`),H({message:`Stop failed: ${n}`,failed:!0})}finally{Ae(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[E,ke,Q]),nt=(0,A.useCallback)(async(e,t,n)=>{if(e.stopPropagation(),!je.has(t.sessionId)){Me(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await E(`/api/admin/session-archive`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId,mode:n})});if(!e.ok){let r=await e.json().catch(()=>({})),i=r.detail??r.error??`status ${e.status}`;console.error(`[admin-ui] sidebar-session-archive-failed sessionId=${t.sessionId} mode=${n} status=${e.status} error=${r.error??`unknown`}`),H({message:`${n===`archive`?`Archive`:`Unarchive`} failed: ${i}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-archive sessionId=${t.sessionId} mode=${n}`),Q()}catch(e){let r=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-archive-failed sessionId=${t.sessionId} mode=${n} error=${r}`),H({message:`${n===`archive`?`Archive`:`Unarchive`} failed: ${r}`,failed:!0})}finally{Me(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[E,je,Q]);return(0,j.jsxs)(`aside`,{className:`side`,children:[(0,j.jsx)(`div`,{className:`side-new-session-row`,children:(0,j.jsxs)(`button`,{type:`button`,className:`side-new-session`,onClick:$e,disabled:X,"aria-busy":X,children:[(0,j.jsx)(O,{size:14}),(0,j.jsx)(`span`,{children:X?`Spawning…`:`New session`})]})}),(0,j.jsxs)(`nav`,{className:`side-nav`,children:[(0,j.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=people`),m(),x()},children:[(0,j.jsx)(se,{size:20,strokeWidth:$}),(0,j.jsx)(`span`,{className:`label`,children:`People`}),(0,j.jsx)(`span`,{className:`kbd`})]}),(0,j.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=agents`),b(),x()},children:[(0,j.jsx)(v,{size:20,strokeWidth:$}),(0,j.jsx)(`span`,{className:`label`,children:`Agents`}),(0,j.jsx)(`span`,{className:`kbd`})]}),(0,j.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=projects`),f(),x()},children:[(0,j.jsx)(y,{size:20,strokeWidth:$}),(0,j.jsx)(`span`,{className:`label`,children:`Projects`}),(0,j.jsx)(`span`,{className:`kbd`})]}),(0,j.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=tasks`),h(),x()},children:[(0,j.jsx)(te,{size:20,strokeWidth:$}),(0,j.jsx)(`span`,{className:`label`,children:`Tasks`}),(0,j.jsx)(`span`,{className:`kbd`})]}),(0,j.jsxs)(`button`,{type:`button`,className:`nav-row${k===`artefacts`?` active`:``}`,onClick:Ke,children:[(0,j.jsx)(d,{size:20,strokeWidth:$}),(0,j.jsx)(`span`,{className:`label`,children:`Artefacts`}),(0,j.jsx)(`span`,{className:`kbd`})]}),(0,j.jsxs)(`button`,{type:`button`,className:`nav-row${k===`sessions`?` active`:``}`,onClick:Je,children:[(0,j.jsx)(w,{size:20,strokeWidth:$}),(0,j.jsx)(`span`,{className:`label`,children:`Sessions`}),(0,j.jsx)(`span`,{className:`kbd`})]}),Ie&&z.filter(e=>We.get(e).length>0).map(e=>(0,j.jsxs)(`button`,{type:`button`,className:`nav-row${k===`whatsapp`&&Z===e?` active`:``}`,onClick:()=>Xe(e),children:[(0,j.jsx)(ce,{channel:e,size:16}),(0,j.jsx)(`span`,{className:`label`,children:Ge[e]}),(0,j.jsx)(`span`,{className:`kbd`})]},e)),Re&&(0,j.jsx)(`div`,{className:`nav-row`,style:{color:`var(--text-tertiary)`,cursor:`default`},"aria-disabled":`true`,children:(0,j.jsx)(`span`,{className:`label`,children:Re})})]}),k===`artefacts`&&(0,j.jsxs)(`div`,{className:`side-list`,children:[(0,j.jsxs)(`div`,{className:`group-head`,children:[(0,j.jsx)(`span`,{children:`Artefacts`}),(0,j.jsxs)(`span`,{className:`group-head-meta`,children:[(0,j.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh artefacts`,"aria-label":`Refresh artefacts`,onClick:qe,disabled:R,children:(0,j.jsx)(s,{size:12,className:R?`spinning`:void 0})}),(0,j.jsx)(`span`,{children:R?`…`:String(M.length)})]})]}),I&&(0,j.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:I}),P&&!I&&M.length>0&&(()=>{let e=M.filter(e=>e.kind===`agent-template`).length,t=M.length-e;return(0,j.jsx)(`div`,{className:`artefact-filter-chips`,children:[{key:`all`,label:`All`,count:M.length},{key:`agent`,label:`Agents`,count:e},{key:`file`,label:`Files`,count:t}].map(e=>(0,j.jsxs)(`button`,{type:`button`,className:`artefact-filter-chip${B===e.key?` active`:``}`,onClick:()=>ue(e.key),disabled:e.count===0&&e.key!==`all`,children:[e.label,(0,j.jsx)(`span`,{className:`artefact-filter-chip-count`,children:e.count})]},e.key))})})(),P&&!I&&M.length===0&&(0,j.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No artefacts yet`}),M.filter(e=>B===`all`?!0:B===`agent`?e.kind===`agent-template`:e.kind!==`agent-template`).map(e=>{let t=e.kind===`agent-template`,n=t?v:d,r=me(e.updatedAt),i=e.downloadPath!==null;return(0,j.jsxs)(`button`,{type:`button`,className:`conv`,onClick:()=>Ve(e),disabled:!i,style:i?void 0:{cursor:`default`},title:i?`Download ${e.name}`:`${e.name} can’t be downloaded`,children:[(0,j.jsx)(n,{size:14,className:`conv-icon`,"data-kind":t?`agent`:`file`,"aria-label":t?`agent template`:`file`}),(0,j.jsxs)(`span`,{className:`conv-stack`,children:[(0,j.jsx)(`span`,{className:`conv-name-line`,children:(0,j.jsx)(`span`,{className:`conv-name`,children:e.name})}),r&&(0,j.jsx)(`span`,{className:`conv-timestamp`,children:r})]}),i&&(0,j.jsx)(o,{size:12,className:`conv-rc-icon`,"aria-hidden":`true`})]},e.id)})]}),k===`sessions`&&(()=>{let e=W.filter(e=>Y?!0:!e.isSubagent).filter(e=>xe?!0:!e.archived),t=W.some(e=>e.isSubagent),r=W.some(e=>e.archived);return(0,j.jsxs)(`div`,{className:`side-list`,children:[(0,j.jsxs)(`div`,{className:`group-head`,children:[(0,j.jsx)(`span`,{children:`Sessions`}),(0,j.jsxs)(`span`,{className:`group-head-meta`,children:[(0,j.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh sessions`,"aria-label":`Refresh sessions`,onClick:Ye,disabled:J,children:(0,j.jsx)(s,{size:12,className:J?`spinning`:void 0})}),(0,j.jsx)(`span`,{children:J?`…`:String(e.length)})]})]}),Ce&&(0,j.jsx)(`div`,{className:`side-account-id`,title:`This install's accountId. The first 8 characters match the truncated UUID label on the live Remote Control daemon entry in claude.ai/code.`,children:(0,j.jsx)(`code`,{children:Ce})}),(t||r)&&(0,j.jsxs)(`div`,{className:`artefact-filter-chips`,children:[t&&(0,j.jsx)(`button`,{type:`button`,className:`artefact-filter-chip${Y?` active`:``}`,onClick:()=>be(e=>!e),title:Y?`Hide subagent sessions`:`Show subagent sessions`,children:`Subagents`}),r&&(0,j.jsx)(`button`,{type:`button`,className:`artefact-filter-chip${xe?` active`:``}`,onClick:()=>Se(e=>!e),title:xe?`Hide archived sessions`:`Show archived sessions`,children:`Archived`})]}),q&&(0,j.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:q}),K&&!q&&e.length===0&&(0,j.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No sessions yet`}),e.map(e=>{let t=me(e.startedAt),r=De.has(e.sessionId),i=Te.has(e.sessionId),a=ke.has(e.sessionId),o=je.has(e.sessionId);return(0,j.jsxs)(`div`,{className:`conv conv-with-actions`,children:[(0,j.jsxs)(`div`,{className:`conv-main-static`,children:[(0,j.jsx)(`span`,{className:`conv-live-dot`,"data-live":e.live?`1`:`0`,"aria-label":e.live?`live session`:`ended session`}),(0,j.jsxs)(`span`,{className:`conv-stack`,children:[(0,j.jsx)(`span`,{className:`conv-name-line`,children:(0,j.jsx)(`span`,{className:`conv-name`,title:e.title,children:e.title})}),(0,j.jsxs)(`span`,{className:`conv-timestamp`,children:[(0,j.jsx)(`code`,{className:`conv-session-id`,title:`First 8 characters of this session's id — distinguishes rows with identical auto-titles. The resume/delete buttons act on the full id.`,children:e.sessionId.slice(0,8)}),t&&(0,j.jsxs)(`span`,{children:[` · `,t]})]})]})]}),(0,j.jsxs)(`div`,{className:`conv-actions`,children:[e.resumable===!1?(0,j.jsx)(`span`,{className:`conv-ephemeral`,title:`Public webchat session — ephemeral, not resumable`,"aria-label":`Ephemeral public session (not resumable)`,children:(0,j.jsx)(w,{size:12})}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:()=>{Ze(e)},disabled:r||i||a||o,"aria-busy":r,"aria-label":`Resume session ${e.title} in claude.ai/code`,title:`Resume in a fresh local Remote Control PTY`,children:(0,j.jsx)(S,{size:12})}),(0,j.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:()=>{window.location.assign(`/chat?session=${e.sessionId}`)},disabled:r||i||a||o,"aria-label":`Open session ${e.title} in admin webchat`,title:`Open in admin webchat (/chat) — sending resumes this session`,children:(0,j.jsx)(re,{size:12})})]}),e.live?(0,j.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:t=>{tt(t,e)},disabled:r||i||a||o,"aria-busy":a,"aria-label":`Stop session ${e.title}`,title:`Stop session process (keeps the conversation, can resume later)`,children:(0,j.jsx)(ae,{size:12})}):null,e.archived?(0,j.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:t=>{nt(t,e,`unarchive`)},disabled:r||i||a||o,"aria-busy":o,"aria-label":`Unarchive session ${e.title}`,title:`Unarchive (move back to the active list)`,children:(0,j.jsx)(g,{size:12})}):(0,j.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:t=>{nt(t,e,`archive`)},disabled:r||i||a||o,"aria-busy":o,"aria-label":`Archive session ${e.title}`,title:`Archive (hide from the list, keeps the conversation resumable)`,children:(0,j.jsx)(_,{size:12})}),(0,j.jsx)(`button`,{type:`button`,className:`conv-action conv-action-danger`,onClick:t=>{et(t,e)},disabled:r||i||a||o,"aria-busy":i,"aria-label":`Delete session ${e.title}`,title:`Delete session (stops the process, removes the conversation)`,children:(0,j.jsx)(n,{size:12})})]})]},e.sessionId)})]})})(),k===`whatsapp`&&(0,j.jsxs)(`div`,{className:`side-list`,children:[(0,j.jsxs)(`div`,{className:`group-head`,children:[(0,j.jsx)(`span`,{children:Ge[Z]}),(0,j.jsxs)(`span`,{className:`group-head-meta`,children:[(0,j.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh conversations`,"aria-label":`Refresh conversations`,onClick:()=>{Ue()},children:(0,j.jsx)(s,{size:12})}),(0,j.jsx)(`span`,{children:String(We.get(Z).length)})]})]}),We.get(Z).map(e=>{let t=me(e.lastMessageAt);return(0,j.jsxs)(`button`,{type:`button`,className:`conv${ee===e.sessionId?` active`:``}`,onClick:()=>{T(e),x()},title:e.title,children:[(0,j.jsx)(ce,{channel:e.channel,size:14}),(0,j.jsxs)(`span`,{className:`conv-stack`,children:[(0,j.jsx)(`span`,{className:`conv-name-line`,children:(0,j.jsx)(`span`,{className:`conv-name`,children:e.operatorName??e.whatsappName??e.senderId??e.title})}),t&&(0,j.jsx)(`span`,{className:`conv-timestamp`,children:t})]})]},e.sessionId)})]}),(0,j.jsx)(ge,{}),(0,j.jsxs)(`div`,{className:`side-foot`,children:[(0,j.jsx)(`div`,{className:`avatar`,children:l?(0,j.jsx)(`img`,{src:l,alt:D}):ie}),(0,j.jsxs)(`div`,{className:`who`,children:[(0,j.jsx)(`span`,{className:`name`,children:D}),(0,j.jsx)(`span`,{className:`role`,children:i??`operator`})]})]}),V&&(0,j.jsx)(`div`,{className:`copy-toast${V.failed?` copy-toast-failed`:``}`,role:`status`,children:V.message}),(0,j.jsx)(de,{error:he,onClose:()=>U(null)})]})}var U=5e3;function ge(){let[e,t]=(0,A.useState)(null);if((0,A.useEffect)(()=>{let e=!1,n=null;async function r(){try{let n=await fetch(`/api/admin/system-stats`);if(!n.ok){console.error(`[admin-ui] system-stats-fetch-failed status=${n.status}`);return}let r=await n.json();e||t(r)}catch(e){console.error(`[admin-ui] system-stats-fetch-failed reason=${e instanceof Error?e.message:String(e)}`)}}function i(){n===null&&(r(),n=setInterval(()=>{r()},U))}function a(){n!==null&&(clearInterval(n),n=null)}function o(){document.hidden?a():i()}return document.hidden||i(),document.addEventListener(`visibilitychange`,o),()=>{e=!0,a(),document.removeEventListener(`visibilitychange`,o)}},[]),!e||e.platform===`darwin`)return null;let n=e.cpuPct,r=e.memUsedPct,i=n!==null&&n>=.9,a=n!==null&&n>=.98,o=r!==null&&r>=.9,s=r!==null&&r>=.98,c=i||o,l=a||s,u=e=>e===null?`—`:`${Math.round(e*100)}%`,d=e=>{if(e===null)return{width:`0%`,background:`var(--text-tertiary)`};let t=Math.min(1,Math.max(0,e)),n=Math.round(140*(1-t));return{width:`${Math.round(t*100)}%`,background:`hsl(${n}, 65%, 45%)`}},f=[`system-stats`];return c&&f.push(`system-stats--warn`),l&&f.push(`system-stats--crit`),(0,j.jsxs)(`div`,{className:f.join(` `),role:`status`,"aria-label":`host CPU and RAM`,children:[(0,j.jsxs)(`div`,{className:`system-stats__metric`,children:[(0,j.jsxs)(`span`,{className:i?`system-stats__fig system-stats__fig--warn`:`system-stats__fig`,children:[`CPU `,u(n)]}),(0,j.jsx)(`div`,{className:`system-stats__bar`,children:(0,j.jsx)(`div`,{className:`system-stats__bar-fill`,style:d(n)})})]}),(0,j.jsxs)(`div`,{className:`system-stats__metric`,children:[(0,j.jsxs)(`span`,{className:o?`system-stats__fig system-stats__fig--warn`:`system-stats__fig`,children:[`RAM `,u(r)]}),(0,j.jsx)(`div`,{className:`system-stats__bar`,children:(0,j.jsx)(`div`,{className:`system-stats__bar-fill`,style:d(r)})})]})]})}var W=`admin-sidebar-collapsed`,G=`admin-sidebar-drawer-open`;function K(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(W)===`1`}catch{return!1}}function _e(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(W,`1`):window.sessionStorage.removeItem(W)}catch{}}function q(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(G)===`1`}catch{return!1}}function ve(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(G,`1`):window.sessionStorage.removeItem(G)}catch{}}var J=720;function ye(e,t){return e===`/`?{via:`in-place`}:{via:`navigate`,href:`/?wa=${encodeURIComponent(t.sessionId)}&projectDir=${encodeURIComponent(t.projectDir)}`}}function Y(e,t){if(e!==`/`)return null;let n=new URLSearchParams(t),r=n.get(`wa`),i=n.get(`projectDir`);return!r||!i?null:{sessionId:r,projectDir:i,title:``,senderId:null,startedAt:``,channel:`whatsapp`,operatorName:null,whatsappName:null,lastMessageAt:null}}function be(e){let{cacheKey:t,businessName:n,onLogout:r,onDisconnect:i,disconnecting:a,userName:o,userAvatar:s,role:c,children:l,footer:u}=e,[d,f]=(0,A.useState)(()=>K()),[p,m]=(0,A.useState)(()=>q()),[h,g]=(0,A.useState)(()=>typeof window<`u`&&window.matchMedia(`(max-width: ${J}px)`).matches),[_,v]=(0,A.useState)(null);(0,A.useEffect)(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: ${J}px)`),t=e=>g(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let y=(0,A.useCallback)(e=>{_e(e),f(e)},[]),b=(0,A.useCallback)(e=>{ve(e),m(e)},[]);(0,A.useEffect)(()=>{if(typeof window>`u`)return;let e=window.location?.pathname??``;console.info(`[admin-ui] shell-mount route=${e} collapsed=${d} drawer=${p}`)},[]),(0,A.useEffect)(()=>{if(typeof window>`u`)return;let e=Y(window.location.pathname,window.location.search);e&&(v(e),console.info(`[admin-ui] wa-hydrate route=/ sessionId=${e.sessionId.slice(0,8)}`),window.history.replaceState(null,``,`/`))},[]);let x=(0,A.useCallback)(e=>{if(e===null){v(null);return}let t=typeof window<`u`?window.location.pathname:`/`,n=ye(t,e);console.info(`[admin-ui] wa-open route=${t} via=${n.via} sessionId=${e.sessionId.slice(0,8)}`),n.via===`in-place`?v(e):window.location.href=n.href},[]),S=h?p:!d,C=(0,A.useCallback)(()=>{if(!(typeof window>`u`))if(window.matchMedia(`(max-width: ${J}px)`).matches){let e=p;console.info(`[admin-ui] header-sidebar-toggle from=${e?`open`:`closed`} mode=drawer`),b(!e)}else{let e=d;console.info(`[admin-ui] header-sidebar-toggle from=${e?`closed`:`open`} mode=collapse`),y(!e)}},[d,p,y,b]),w=(0,A.useCallback)(e=>{console.info(`[admin-ui] header-menu-nav target=${e}`);let t=e===`dashboard`?`/`:e===`data`?`/data`:e===`graph`?`/graph`:e===`chat`?`/chat`:`/browser`;window.location.href=t},[]),ee={collapsed:d,mobileDrawerOpen:p,sidebarOpen:S,onToggleSidebar:C,setMobileDrawerOpen:b,selectedWhatsapp:_,onClearWhatsapp:()=>v(null)};return(0,j.jsxs)(`div`,{className:`admin-shell admin-page admin-shell-root`,children:[(0,j.jsx)(M,{businessName:n,onNavigate:w,onToggleSidebar:C,sidebarOpen:S,onLogout:r,onDisconnect:i,disconnecting:a}),(0,j.jsxs)(`div`,{className:`platform${p?` menu-open`:``}${d?` sidebar-collapsed`:``}`,"data-artefact":`closed`,children:[(0,j.jsx)(he,{businessName:n,cacheKey:t,role:c??null,userName:o,userAvatar:s??null,onSelectProjects:()=>{window.location.href=`/graph?label=Project`},onSelectPeople:()=>{window.location.href=`/graph?label=Person`},onSelectTasks:()=>{window.location.href=`/graph?label=Task`},onSelectAgents:()=>{window.location.href=`/graph?label=Agent`},onCloseMobileDrawer:()=>b(!1),collapsed:d,mobileDrawerOpen:p,selectedWhatsappId:_?.sessionId??null,onSelectWhatsappConversation:x}),!h&&(0,j.jsx)(L,{}),typeof l==`function`?l(ee):l]}),p&&(0,j.jsx)(`div`,{className:`sidebar-backdrop menu-open`,"aria-hidden":`true`,onClick:()=>b(!1)}),u]})}export{O as a,S as c,k as i,h as l,V as n,te as o,se as r,C as s,be as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{it as e,rt as t}from"./chunk-ICPOFSXX-DvYSWH7x.js";var n=(n,r)=>e.lang.round(t.parse(n)[r]);export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CWOGyPgy.js";import{a as t,i as n,r,t as i}from"./jsx-runtime-5auA0FEj.js";import{n as a,s as o}from"./file-download-C3pBZjt9.js";import{a as s,l as c,o as l,r as u,t as d}from"./AdminShell-DDieHnzi.js";import{a as f,d as p,f as m,i as h,n as g,o as _,r as v,t as y}from"./audio-attachment-mime-DGEfApkA.js";import{l as b}from"./useSelectionMode-C_EBRd2k.js";import{n as x,r as S,t as C}from"./Transcript-C3aDVJ-n.js";var w=r(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),ee=r(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),T=n(),E=e(t(),1),D=`claude-fable-5[1m]`,O=`claude-opus-4-8[1m]`,k=`claude-sonnet-4-6`,A=`claude-haiku-4-5`,j=i();function M({turns:e}){let[t,n]=(0,E.useState)(!1),r=e.filter(e=>e.kind===`tool-call`).length,i=r>0?`Used ${r} tool${r===1?``:`s`}`:`${e.length} tool result${e.length===1?``:`s`}`;return(0,j.jsxs)(`div`,{className:`chat-toolrun`,children:[(0,j.jsxs)(`button`,{type:`button`,className:`chat-toolrun-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,j.jsx)(`span`,{className:`wa-chevron`,children:t?`▾`:`▸`}),(0,j.jsx)(`span`,{className:`chat-toolrun-label`,children:i})]}),t&&e.map((e,t)=>(0,j.jsxs)(`div`,{className:`chat-toolrun-item`,children:[(0,j.jsx)(`span`,{className:`chat-toolrun-name`,children:e.kind===`tool-call`?`↳ ${e.name}`:e.isError?`result (error)`:`result`}),(0,j.jsx)(`pre`,{className:`wa-code`,children:e.kind===`tool-call`?JSON.stringify(e.input,null,2):e.text})]},t))]})}function N(e,t){switch(e.kind){case`operator-inbound`:case`operator-typed`:return(0,j.jsx)(`div`,{className:`chat-turn-op`,children:(0,j.jsx)(`p`,{className:`chat-op-body`,children:e.text})},t);case`agent-text`:case`agent-reply`:return(0,j.jsx)(`div`,{className:`chat-prose`,children:(0,j.jsx)(`p`,{className:`chat-prose-body`,children:e.text})},t);case`agent-reply-document`:return(0,j.jsxs)(`div`,{className:`chat-prose`,children:[(0,j.jsxs)(`p`,{className:`chat-doc`,children:[`📎 sent document(s): `,e.files.map(S).join(`, `)]}),e.caption&&(0,j.jsx)(`p`,{className:`chat-prose-body`,children:e.caption})]},t)}}function te(e,t,n){let r=[],i=[],a=()=>{i.length!==0&&(r.push((0,j.jsx)(M,{turns:i},`run-${r.length}`)),i=[])};return e.forEach((e,o)=>{if(e.kind===`turn`&&(e.turn.kind===`tool-call`||e.turn.kind===`tool-result`)){i.push(e.turn);return}a(),e.kind===`directive`?r.push((0,j.jsx)(C,{entry:e.entry,sessionId:t,sessionKey:n},o)):r.push(N(e.turn,o))}),a(),r}var P=[D,O,k,A],ne=[`low`,`medium`,`high`,`xhigh`],re=2500;function F(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{weekday:`short`,day:`numeric`,month:`short`,hour:`2-digit`,minute:`2-digit`})}function ie({cacheKey:e,userName:t}){let[n,r]=(0,E.useState)(null);(0,E.useEffect)(()=>{let t=!1;return fetch(`/api/webchat/greeting?session_key=${encodeURIComponent(e)}`).then(async e=>{let n=await e.json();if(!t){if(!e.ok||n.ok!==!0){console.warn(`[admin-ui] greeting-unavailable status=${e.status} ok=${String(n.ok)}`);return}r({events:n.events,tasks:n.tasks,specialists:n.specialists??[]})}}).catch(e=>{t||console.warn(`[admin-ui] greeting-unavailable error=${e instanceof Error?e.message:String(e)}`)}),()=>{t=!0}},[e]);let i=t?.trim().split(/\s+/)[0],a=n?n.tasks.total-n.tasks.items.length:0;return(0,j.jsxs)(`div`,{className:`webchat-greeting`,children:[(0,j.jsx)(`h2`,{className:`webchat-greeting-head`,children:i?`What's up next, ${i}?`:`What's up next?`}),n&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`section`,{className:`webchat-greeting-section`,"data-kind":`events`,children:[(0,j.jsxs)(`h3`,{className:`webchat-greeting-label`,children:[(0,j.jsx)(w,{size:14}),` Upcoming schedule`]}),n.events.length===0?(0,j.jsx)(`p`,{className:`webchat-greeting-none`,children:`Nothing scheduled`}):n.events.map(e=>(0,j.jsxs)(`div`,{className:`webchat-greeting-row`,children:[(0,j.jsx)(`span`,{className:`webchat-greeting-name`,children:e.name}),(0,j.jsx)(`span`,{className:`webchat-greeting-when`,children:F(e.at)})]},e.eventId))]}),(0,j.jsxs)(`section`,{className:`webchat-greeting-section`,"data-kind":`tasks`,children:[(0,j.jsxs)(`h3`,{className:`webchat-greeting-label`,children:[(0,j.jsx)(l,{size:14}),` Outstanding tasks`]}),n.tasks.items.length===0?(0,j.jsx)(`p`,{className:`webchat-greeting-none`,children:`No open tasks`}):(0,j.jsxs)(j.Fragment,{children:[n.tasks.items.map(e=>(0,j.jsxs)(`div`,{className:`webchat-greeting-row`,children:[(0,j.jsx)(`span`,{className:`webchat-greeting-name`,children:e.name}),(0,j.jsx)(`span`,{className:`webchat-greeting-status`,children:e.status})]},e.taskId)),a>0&&(0,j.jsxs)(`p`,{className:`webchat-greeting-more`,children:[`+`,a,` more`]})]})]}),(0,j.jsxs)(`section`,{className:`webchat-greeting-section`,"data-kind":`specialists`,children:[(0,j.jsxs)(`h3`,{className:`webchat-greeting-label`,children:[(0,j.jsx)(u,{size:14}),` Your specialists`]}),n.specialists.length===0?(0,j.jsx)(`p`,{className:`webchat-greeting-none`,children:`No specialists installed`}):n.specialists.map((e,t)=>(0,j.jsxs)(`div`,{className:`webchat-greeting-row webchat-greeting-row-stacked`,children:[(0,j.jsx)(`span`,{className:`webchat-greeting-name`,children:e.name}),e.summary&&(0,j.jsx)(`span`,{className:`webchat-greeting-summary`,children:e.summary})]},`${t}-${e.name}`))]})]})]})}function I({cacheKey:e,userName:t,targetSessionId:n}){let[r,i]=(0,E.useState)(null),[a,c]=(0,E.useState)(``),[l,u]=(0,E.useState)(!1),[d,S]=(0,E.useState)([]),[C,w]=(0,E.useState)(null),[T,D]=(0,E.useState)(!1),O=(0,E.useRef)(null),k=(0,E.useCallback)(e=>{w(null);let t=e.find(e=>!y(e.type,_));if(t){w(`Unsupported file type: "${t.type}". Supported: images, PDF, plain text, markdown, CSV, calendar, voice notes.`);return}let n=e.find(e=>e.size>f);if(n){w(`"${n.name}" exceeds the 50 MB limit.`);return}S(t=>[...t,...e].slice(0,5))},[]),A=(0,E.useMemo)(()=>d.map(e=>e.type.startsWith(`image/`)?URL.createObjectURL(e):null),[d]);(0,E.useEffect)(()=>()=>{for(let e of A)e&&URL.revokeObjectURL(e)},[A]);let M=g(),N=M.state===`recording`||M.state===`paused`||M.state===`sending`,F=(0,E.useCallback)(async()=>{let t=await M.send();if(!t)return;let r=t.type===`audio/ogg`?`.ogg`:t.type===`audio/mp4`?`.m4a`:`.webm`,i=new File([t],`voice-note${r}`,{type:t.type}),a=new FormData;a.append(`text`,``),a.append(`attachments`,i),n&&a.append(`session`,n);try{let t=await fetch(`/api/webchat/send?session_key=${encodeURIComponent(e)}`,{method:`POST`,body:a});t.ok||console.error(`[admin-ui] webchat-send-failed status=${t.status}`)}catch(e){console.error(`[admin-ui] webchat-send-failed error=${e instanceof Error?e.message:String(e)}`)}},[M,e,n]),I=(0,E.useRef)(!1);(0,E.useEffect)(()=>(I.current=!1,()=>{I.current=!0}),[]);let L=(0,E.useRef)(!1),R=(0,E.useCallback)(async()=>{if(L.current)return null;L.current=!0;try{let t=`session_key=${encodeURIComponent(e)}${n?`&session=${encodeURIComponent(n)}`:``}`,r=await fetch(`/api/webchat/session?${t}`);if(!r.ok)return null;let a=await r.json();return I.current||i(a),a}catch{return null}finally{L.current=!1}},[e,n]);(0,E.useEffect)(()=>{R();let e=setInterval(()=>{R()},re);return()=>clearInterval(e)},[R]);let z=(0,E.useCallback)(async()=>{let t=a.trim();if(!(!t&&d.length===0||l)){u(!0);try{let r;if(d.length>0){let i=new FormData;i.append(`text`,t);for(let e of d)i.append(`attachments`,e);n&&i.append(`session`,n),r=await fetch(`/api/webchat/send?session_key=${encodeURIComponent(e)}`,{method:`POST`,body:i})}else r=await fetch(`/api/webchat/send?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(n?{text:t,session:n}:{text:t})});r.ok?(c(``),S([])):r.status===409?console.error(`[admin-ui] webchat-send-refused reason=channel-conflict`):console.error(`[admin-ui] webchat-send-failed status=${r.status}`)}catch(e){console.error(`[admin-ui] webchat-send-failed error=${e instanceof Error?e.message:String(e)}`)}finally{u(!1)}}},[a,l,e,d,n]),ae=(0,E.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),z())},[z]),B=n?r?.channelBinding??null:null,V=(0,E.useRef)(!1);(0,E.useEffect)(()=>{!n||V.current||!r||(V.current=!0,console.warn(`[admin-ui] chat-session-target sessionId=${n} jsonl=${r.projectDir?`found`:`missing`}`))},[r,n]);let H=r?r.effectivePermissionMode??r.permissionMode??null:null,U=r?.model??null,oe=r?.activity===`busy`,[W,G]=(0,E.useState)(null),[K,q]=(0,E.useState)(null),[J,Y]=(0,E.useState)(null),X=(0,E.useCallback)(async(t,n)=>{let r=t===`model`?G:q;r(n),Y(null);try{let i=await fetch(`/api/webchat/settings?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({op:t,value:n})});i.ok||(r(null),Y(`Could not save ${t} (status ${i.status})`),console.error(`[admin-ui] webchat-settings-failed op=${t} status=${i.status}`))}catch(e){r(null),Y(`Could not save ${t} (network error)`),console.error(`[admin-ui] webchat-settings-failed op=${t} error=${e instanceof Error?e.message:String(e)}`)}},[e]);(0,E.useEffect)(()=>{W!==null&&r?.leverModel===W&&G(null),K!==null&&r?.leverEffort===K&&q(null)},[r,W,K]);let Z=W??r?.leverModel??U??``,Q=K??r?.leverEffort??``,se=Z&&!P.includes(Z)?[...P,Z]:P,$=(0,E.useRef)(!1);return(0,E.useEffect)(()=>{$.current||r?.projectDir&&r.activity==null&&H==null&&U==null&&($.current=!0,console.warn(`[admin-ui] composer-indicators-unavailable sessionId=${r.sessionId} (manager meta unreadable or pre-activity)`))},[r,H,U]),(0,j.jsxs)(`div`,{className:`webchat-page`,children:[r?.projectDir?(0,j.jsx)(x,{sessionId:r.sessionId,projectDir:r.projectDir,sessionKey:e,renderItems:te},r.sessionId):r?n?(0,j.jsx)(`div`,{className:`webchat-greeting`,children:(0,j.jsx)(`p`,{className:`webchat-greeting-none`,children:`No transcript found for this session.`})}):(0,j.jsx)(ie,{cacheKey:e,userName:t}):null,(0,j.jsx)(`div`,{className:`webchat-composer`,children:(0,j.jsxs)(`div`,{className:`webchat-composer-box${T?` drag-over`:``}`,onDragOver:e=>{e.preventDefault(),D(!0)},onDragLeave:()=>D(!1),onDrop:e=>{e.preventDefault(),D(!1),k([...e.dataTransfer.files])},children:[(0,j.jsx)(`input`,{ref:O,type:`file`,multiple:!0,accept:h,style:{display:`none`},onChange:e=>{e.target.files&&k([...e.target.files]),e.target.value=``}}),d.length>0&&(0,j.jsx)(`div`,{className:`attachment-strip`,children:d.map((e,t)=>(0,j.jsxs)(`div`,{className:`attachment-chip`,children:[A[t]?(0,j.jsx)(`img`,{src:A[t],alt:e.name,className:`attachment-chip-thumb`}):e.type.startsWith(`audio/`)?(0,j.jsx)(p,{size:14}):e.type===`application/pdf`?(0,j.jsx)(b,{size:14}):(0,j.jsx)(m,{size:14}),(0,j.jsx)(`span`,{className:`attachment-chip-name`,children:e.name}),(0,j.jsx)(`button`,{type:`button`,className:`attachment-chip-remove`,onClick:()=>S(e=>e.filter((e,n)=>n!==t)),"aria-label":`Remove ${e.name}`,children:`×`})]},t))}),C&&(0,j.jsx)(`p`,{className:`attach-error`,children:C}),M.state===`error`&&M.errorMessage&&(0,j.jsxs)(`p`,{className:`voice-error`,role:`alert`,children:[(0,j.jsx)(p,{size:14}),M.errorMessage]}),N?(0,j.jsx)(`div`,{className:`webchat-input-row voice-active`,children:(0,j.jsx)(v,{state:M.state,elapsedSeconds:M.elapsedSeconds,waveform:M.waveform,onTogglePause:M.togglePause,onDiscard:M.discard,onSend:()=>void F()})}):(0,j.jsxs)(`div`,{className:`webchat-input-row`,children:[(0,j.jsx)(`textarea`,{className:`webchat-input`,value:a,placeholder:`Message your agent…`,rows:2,disabled:B!==null,onChange:e=>c(e.target.value),onKeyDown:ae,onPaste:e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t){if(e.kind!==`file`)continue;let t=e.getAsFile();if(!t)continue;let r=t.type.split(`/`)[1]?.replace(`jpeg`,`jpg`)||`png`;n.push(new File([t],`pasted-image-${Date.now()}.${r}`,{type:t.type}))}n.length>0&&k(n)}}),(0,j.jsx)(`button`,{type:`button`,className:`webchat-send`,onClick:()=>void z(),disabled:l||a.trim().length===0&&d.length===0||B!==null,"aria-label":`Send`,title:`Send`,children:(0,j.jsx)(ee,{size:16})})]}),B!==null&&(0,j.jsxs)(`p`,{className:`webchat-conflict-hint`,children:[`This session is bound to the `,B,` channel — message it there. The transcript stays readable here.`]}),(0,j.jsxs)(`div`,{className:`webchat-controls`,children:[(0,j.jsxs)(`div`,{className:`webchat-controls-left`,children:[H&&(0,j.jsx)(`span`,{className:`webchat-chip`,title:`Permission mode (read-only)`,children:H}),(0,j.jsx)(`button`,{type:`button`,className:`webchat-control`,onClick:()=>O.current?.click(),disabled:B!==null,title:`Attach files`,"aria-label":`Attach`,children:(0,j.jsx)(s,{size:14})}),(0,j.jsx)(`button`,{type:`button`,className:`webchat-control`,onClick:M.start,disabled:N||B!==null,title:`Record voice note`,"aria-label":`Voice input`,children:(0,j.jsx)(p,{size:14})})]}),(0,j.jsxs)(`div`,{className:`webchat-controls-right`,children:[J&&(0,j.jsx)(`span`,{className:`webchat-settings-error`,role:`alert`,children:J}),(0,j.jsxs)(`select`,{className:`webchat-select`,"data-kind":`model`,value:Z,onChange:e=>void X(`model`,e.target.value),title:`Model for new sessions — the current session keeps its model`,"aria-label":`Model for new sessions`,children:[Z===``&&(0,j.jsx)(`option`,{value:``,disabled:!0,children:`model`}),se.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]}),(0,j.jsxs)(`select`,{className:`webchat-select`,"data-kind":`effort`,value:Q,onChange:e=>void X(`effort`,e.target.value),title:`Effort for new sessions — the current session keeps its effort`,"aria-label":`Effort for new sessions`,children:[Q===``&&(0,j.jsx)(`option`,{value:``,disabled:!0,children:`effort`}),ne.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]}),oe&&(0,j.jsx)(o,{size:14,className:`spin webchat-busy`,"aria-label":`Agent is working`})]})]})]})})]})}function L(){let[e,t]=(0,E.useState)(null),[n]=(0,E.useState)(()=>{try{return new URLSearchParams(window.location.search).get(`session`)}catch{return null}}),[r,i]=(0,E.useState)(!1),[s,l]=(0,E.useState)(void 0),[u,f]=(0,E.useState)(null),[p,m]=(0,E.useState)(void 0),[h,g]=(0,E.useState)(null),[_,v]=(0,E.useState)(null);(0,E.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),i(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async r=>{if(!e){if(r.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(r.ok)try{let e=await r.json();typeof e.businessName==`string`&&l(e.businessName),e.sessionId!==void 0&&f(e.sessionId??null),v(e.role??null),m(e.userName===void 0?null:e.userName),g(e.avatar??null)}catch{}t(n),i(!0)}}).catch(()=>{e||(t(n),i(!0))}),()=>{e=!0}},[]);let y=(0,E.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[b,x]=(0,E.useState)(!1),S=(0,E.useCallback)(async()=>{x(!0);try{let e=await c();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{x(!1)}},[]);return r?e?(0,j.jsx)(a,{cacheKey:e,surface:`chat`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=chat`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,j.jsx)(d,{cacheKey:e,businessName:s,sessionId:u,onLogout:y,onDisconnect:S,disconnecting:b,userName:p,userAvatar:h,role:_,children:(0,j.jsx)(I,{cacheKey:e,userName:p??null,targetSessionId:n})})}):(0,j.jsx)(`div`,{className:`data-page`,children:(0,j.jsxs)(`div`,{className:`data-empty`,children:[(0,j.jsx)(`p`,{children:`You are not signed in.`}),(0,j.jsxs)(`p`,{children:[`Open the `,(0,j.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,j.jsx)(`div`,{className:`data-page`,children:(0,j.jsxs)(`div`,{className:`data-loading`,children:[(0,j.jsx)(o,{size:18,className:`spin`}),` Loading…`]})})}(0,T.createRoot)(document.getElementById(`root`)).render((0,j.jsx)(L,{}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./src-CozP7LCe.js";import"./chunk-ICPOFSXX-DvYSWH7x.js";import"./dist-Pgmncqde.js";import"./chunk-5PVQY5BW-DPhkkS4p.js";import"./chunk-U2HBQHQK-Bl1a895I.js";import"./chunk-FMBD7UC4-_4wtKsfc.js";import"./chunk-BSJP7CBP-CTqmM6qI.js";import"./chunk-ZZ45TVLE-D9Dgmeso.js";import"./chunk-YZCP3GAM-DpWRmPUo.js";import"./chunk-55IACEB6-DB18cH4S.js";import"./chunk-EDXVE4YY-BjWSqn7_.js";import"./chunk-X2U36JSP-WkSpBPYx.js";import"./chunk-5FUZZQ4R-6DNGaUkf.js";import"./chunk-ENJZ2VHE-BX1ZnU4A.js";import"./chunk-336JU56O-BRCubMCb.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-DSMj_AZh.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./src-CozP7LCe.js";import"./chunk-ICPOFSXX-DvYSWH7x.js";import"./dist-Pgmncqde.js";import"./chunk-5PVQY5BW-DPhkkS4p.js";import"./chunk-U2HBQHQK-Bl1a895I.js";import"./chunk-FMBD7UC4-_4wtKsfc.js";import"./chunk-BSJP7CBP-CTqmM6qI.js";import"./chunk-ZZ45TVLE-D9Dgmeso.js";import"./chunk-YZCP3GAM-DpWRmPUo.js";import"./chunk-55IACEB6-DB18cH4S.js";import"./chunk-EDXVE4YY-BjWSqn7_.js";import"./chunk-X2U36JSP-WkSpBPYx.js";import"./chunk-5FUZZQ4R-6DNGaUkf.js";import"./chunk-ENJZ2VHE-BX1ZnU4A.js";import"./chunk-336JU56O-BRCubMCb.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-DSMj_AZh.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./graphlib-DUlqr2mr.js";var t=4;function n(n){return e(n,t)}export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CWOGyPgy.js";import{a as t,i as n,n as r,r as i,t as a}from"./jsx-runtime-5auA0FEj.js";import{a as o,c as s,i as c,n as l,o as u,s as d,t as ee}from"./file-download-C3pBZjt9.js";import{a as f,i as p,t as m}from"./graph-labels-Cc1nU1_f.js";var h=i(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),te=i(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),ne=i(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),re=i(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),g=n(),_=e(t(),1);function ie(e){let t=new Set,n=[];for(let r of e)for(let e of r.labels)e&&(t.has(e)||m.has(e)&&(t.add(e),n.push(e)));return n}var v=a();function y(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]),n?e?(0,v.jsx)(l,{cacheKey:e,surface:`data`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=data`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,v.jsx)(`div`,{className:`data-page data-page-full`,children:(0,v.jsx)(ae,{cacheKey:e})})}):(0,v.jsx)(`div`,{className:`data-page`,children:(0,v.jsxs)(`div`,{className:`data-empty`,children:[(0,v.jsx)(`p`,{children:`You are not signed in.`}),(0,v.jsxs)(`p`,{children:[`Open the `,(0,v.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,v.jsx)(`div`,{className:`data-page`,children:(0,v.jsxs)(`div`,{className:`data-loading`,children:[(0,v.jsx)(d,{size:18,className:`spin`}),` Loading…`]})})}function ae({cacheKey:e}){let{adminFetch:t,cacheKey:n,sessionRefetchNonce:r}=c({initialCacheKey:e,surface:`data`});return(0,v.jsx)(ce,{adminFetch:t,cacheKey:n,sessionRefetchNonce:r})}function oe(){if(typeof window>`u`)return`.`;let e=new URLSearchParams(window.location.hash.replace(/^#/,``)).get(`path`);return e&&e.length>0?e:`.`}function se(e){if(typeof window>`u`)return;let t=new URL(window.location.href);t.hash=e===`.`?``:`path=${encodeURIComponent(e)}`,window.history.replaceState(window.history.state,``,t.toString())}function ce({adminFetch:e,cacheKey:t,sessionRefetchNonce:n}){let[i,a]=(0,_.useState)(``),c=(0,_.useRef)(null),[l,m]=(0,_.useState)(``),[g,y]=(0,_.useState)(null),[ae,ce]=(0,_.useState)(`hybrid`),[b,x]=(0,_.useState)(!1),[S,w]=(0,_.useState)(null),[T,fe]=(0,_.useState)(null),[E,pe]=(0,_.useState)(0),[D,O]=(0,_.useState)(!1),[k,A]=(0,_.useState)(()=>oe()),[j,me]=(0,_.useState)(null),[M,he]=(0,_.useState)([]),[N,ge]=(0,_.useState)(!1),[P,F]=(0,_.useState)(null),[I,L]=(0,_.useState)(!1),[R,_e]=(0,_.useState)(null),[ve,z]=(0,_.useState)(null),[ye,B]=(0,_.useState)(null),[V,H]=(0,_.useState)(null),U=(0,_.useRef)(null),[be,W]=(0,_.useState)(0),[G,K]=(0,_.useState)(!1),q=(0,_.useRef)(null),xe=(0,_.useRef)(null),[J,Se]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=xe.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(e=>{Se(e[0].contentRect.width<=600)});return t.observe(e),()=>t.disconnect()},[]),(0,_.useEffect)(()=>{let e=i.trim();if(!e){m(``),y(null);return}O(!1);let t=setTimeout(()=>m(e),300);return()=>clearTimeout(t)},[i]),(0,_.useEffect)(()=>{if(!l)return;let t=!1;return x(!0),w(null),e(`/api/admin/graph-search?q=${encodeURIComponent(l)}&labels=FileArtifact&limit=20${D?`&threshold=0`:``}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(y(e.results),ce(e.mode??`hybrid`),pe(typeof e.suppressed==`number`?e.suppressed:0))}).catch(e=>{t||w(e instanceof Error?e.message:String(e))}).finally(()=>{t||x(!1)}),()=>{t=!0}},[l,e,n,D]);let Y=(0,_.useMemo)(()=>g?ie(g):[],[g]),X=T&&Y.includes(T)?T:null,Z=(0,_.useMemo)(()=>g?X?g.filter(e=>e.labels.includes(X)):g:null,[g,X]),Ce=(0,_.useCallback)(e=>{let n=e.properties.relativePath;if(typeof n!=`string`||n.length===0)return;let r=`/api/admin/files/download?session_key=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}`,i=document.createElement(`a`);i.href=r,i.rel=`noopener noreferrer`,document.body.appendChild(i),i.click(),i.remove()},[t]);(0,_.useEffect)(()=>{if(!g)return;let e=g.filter(e=>{let t=e.properties.relativePath;return typeof t!=`string`||t.length===0});e.length>0&&console.warn(`[data-search] op=locate-link-missing nodeId=${e.map(e=>e.nodeId).join(`,`)}`)},[g]),(0,_.useEffect)(()=>{let t=!1;return ge(!0),F(null),e(`/api/admin/files?path=${encodeURIComponent(k===`.`?``:k)}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(me(e.entries),he(e.displayPath??[]))}).catch(e=>{t||(me([]),he([]),F(e instanceof Error?e.message:String(e)))}).finally(()=>{t||ge(!1)}),()=>{t=!0}},[e,k,be,n]),(0,_.useEffect)(()=>{se(k)},[k]);let we=(0,_.useCallback)(()=>{W(e=>e+1)},[]),Q=(0,_.useCallback)(e=>{K(!1),A(e)},[]),Te=(0,_.useCallback)(e=>{let t=e.properties.relativePath;if(typeof t!=`string`||t.length===0)return;let n=t.lastIndexOf(`/`),r=n===-1?`.`:t.slice(0,n);console.log(`[data-search] op=locate nodeId=${e.nodeId} folder=${r}`),a(``),w(null),fe(null),Q(r)},[Q]),Ee=(0,_.useCallback)(()=>{if(k===`.`||k===``)return;let e=k.split(`/`).filter(Boolean);e.pop(),A(e.length===0?`.`:e.join(`/`))},[k]),De=(0,_.useCallback)(e=>{ee(t,k===`.`?e.name:`${k}/${e.name}`)},[k,t]),Oe=(0,_.useCallback)(()=>{U.current?.click()},[]),ke=(0,_.useCallback)(e=>{z(null),H(e.name)},[]),Ae=(0,_.useCallback)(()=>{H(null)},[]),je=(0,_.useCallback)(async t=>{let n=k===`.`?t.name:`${k}/${t.name}`;z(null),H(null),B(t.name);try{let t=await e(`/api/admin/files?path=${encodeURIComponent(n)}`,{method:`DELETE`}),r=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(r.error??`HTTP ${t.status}`);W(e=>e+1)}catch(e){z(e instanceof Error?e.message:String(e))}finally{B(null)}},[k,e]);(0,_.useEffect)(()=>{if(!V)return;let e=e=>{e.key===`Escape`&&H(null)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[V]);let Me=(0,_.useCallback)(async e=>{_e(null),L(!0);try{let n=new FormData;n.append(`session_key`,t),n.append(`file`,e);let r=await fetch(`/api/admin/files/upload`,{method:`POST`,body:n}),i=await r.json().catch(()=>({error:`HTTP ${r.status}`}));if(!r.ok)throw Error(i.error??`HTTP ${r.status}`);A(i.path.split(`/`).slice(0,-1).join(`/`)||`.`),W(e=>e+1)}catch(e){_e(e instanceof Error?e.message:String(e))}finally{L(!1),U.current&&(U.current.value=``)}},[t]);(0,_.useEffect)(()=>{if(!G)return;let e=e=>{q.current&&!q.current.contains(e.target)&&K(!1)},t=e=>{e.key===`Escape`&&K(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[G]);let $=(0,_.useCallback)(e=>M.slice(0,e+1).map(e=>e.name).join(`/`),[M]),Ne=M.length>=2,Pe=Ne?[{name:`.`,label:`data`},...M.slice(0,M.length-2).map((e,t)=>({name:$(t),label:e.displayName??e.name}))]:[];return(0,v.jsxs)(`main`,{className:`data-main`,children:[(0,v.jsxs)(`div`,{className:`data-toolbar`,ref:xe,children:[(0,v.jsx)(`a`,{href:`/`,className:`data-btn data-btn-ghost data-home-btn`,title:`Back to home`,"aria-label":`Back to home`,children:(0,v.jsx)(f,{size:16})}),(0,v.jsxs)(`div`,{className:`data-search-input`,children:[!(J&&i!==``)&&(0,v.jsx)(p,{size:14}),(0,v.jsx)(`input`,{ref:c,type:`text`,value:i,onChange:e=>a(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),b&&(0,v.jsx)(d,{size:14,className:`spin`}),i!==``&&(0,v.jsx)(`button`,{type:`button`,className:`data-search-inline-btn`,onClick:()=>{a(``),w(null),c.current?.focus()},title:`Clear search`,"aria-label":`Clear search`,children:(0,v.jsx)(o,{size:14})}),J&&i===``&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`button`,{type:`button`,className:`data-search-inline-btn`,onClick:we,disabled:N,title:`Refresh this folder`,"aria-label":`Refresh this folder`,children:N?(0,v.jsx)(d,{size:14,className:`spin`}):(0,v.jsx)(u,{size:14})}),(0,v.jsx)(`button`,{type:`button`,className:`data-search-inline-btn`,onClick:Oe,disabled:I,title:`Upload a file`,"aria-label":`Upload a file`,children:I?(0,v.jsx)(d,{size:14,className:`spin`}):(0,v.jsx)(re,{size:14})})]})]}),(0,v.jsxs)(`div`,{className:`data-breadcrumbs`,children:[k!==`.`&&(0,v.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-back-btn`,onClick:Ee,title:`Up one level`,"aria-label":`Up one level`,children:(0,v.jsx)(h,{size:14})}),Ne?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,ref:q,children:[(0,v.jsx)(`button`,{type:`button`,className:`data-crumb data-crumb-ellipsis`,onClick:()=>K(e=>!e),"aria-haspopup":`menu`,"aria-expanded":G,"aria-label":`Show parent folders`,title:`Show parent folders`,children:`…`}),G&&(0,v.jsx)(`div`,{className:`data-crumb-menu`,role:`menu`,children:Pe.map(e=>(0,v.jsx)(`button`,{type:`button`,role:`menuitem`,className:`data-crumb-menu-item`,onClick:()=>Q(e.name),title:e.label,children:e.label},e.name))})]}),[M.length-2,M.length-1].map(e=>{let t=M[e];return(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,v.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>Q($(e)),title:t.name,children:t.displayName??t.name})]},$(e))})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>Q(`.`),children:`data`}),M.map((e,t)=>(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,v.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>Q($(t)),title:e.name,children:e.displayName??e.name})]},$(t)))]})]}),!J&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`button`,{type:`button`,className:`data-btn`,onClick:we,disabled:N,title:`Refresh this folder`,"aria-label":`Refresh this folder`,children:[N?(0,v.jsx)(d,{size:14,className:`spin`}):(0,v.jsx)(u,{size:14}),(0,v.jsx)(`span`,{className:`data-btn-label`,children:`Refresh`})]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-btn`,onClick:Oe,disabled:I,title:`Upload a file`,"aria-label":`Upload a file`,children:[I?(0,v.jsx)(d,{size:14,className:`spin`}):(0,v.jsx)(re,{size:14}),(0,v.jsx)(`span`,{className:`data-btn-label`,children:`Upload`})]})]}),(0,v.jsx)(`input`,{type:`file`,ref:U,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&Me(t)}})]}),(0,v.jsxs)(`div`,{className:`data-body`,children:[(S!==null||g!==null)&&(0,v.jsxs)(`section`,{className:`data-panel`,children:[S&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,S]}),Y.length>0&&(0,v.jsx)(`div`,{className:`data-chip-row`,role:`group`,"aria-label":`Filter by type`,children:Y.map(e=>{let t=e===X;return(0,v.jsx)(`button`,{type:`button`,className:`data-chip`,"data-active":t,onClick:()=>fe(t?null:e),children:ue([e])??e},e)})}),g&&!b&&(0,v.jsxs)(`div`,{className:`data-results-meta`,children:[Z.length,` of `,g.length,` result`,g.length===1?``:`s`]}),g&&!b&&!X&&E>0&&!D&&(0,v.jsxs)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>O(!0),children:[E,` low-confidence result`,E===1?``:`s`,` hidden — show all`]}),g&&!b&&!X&&D&&(0,v.jsx)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>O(!1),children:`Showing all results — hide low-confidence`}),g&&g.length===0&&!b&&(0,v.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),Z&&Z.length>0&&(0,v.jsx)(`ul`,{className:`data-results`,children:Z.map(e=>(0,v.jsx)(le,{hit:e,mode:ae,onDownload:Ce,onLocate:Te},e.nodeId))})]}),(0,v.jsxs)(`section`,{className:`data-panel`,children:[R&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,R]}),ve&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Delete failed: `,ve]}),P&&(0,v.jsx)(`div`,{className:`data-error`,children:P}),N&&(0,v.jsxs)(`div`,{className:`data-loading`,children:[(0,v.jsx)(d,{size:14,className:`spin`}),` Loading…`]}),!N&&j&&j.length===0&&!P&&(0,v.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!N&&j&&j.length>0&&(0,v.jsx)(`ul`,{className:`data-entries`,children:j.map(e=>{let t=e.displayName??e.name,n=ye===e.name,i=V===e.name;return(0,v.jsx)(`li`,{className:`data-entry`,children:e.kind===`directory`?(0,v.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>Q(k===`.`?e.name:`${k}/${e.name}`),children:[(0,v.jsx)(ne,{size:14}),(0,v.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t})]}):e.kind===`file`?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>De(e),title:`Download ${t}`,disabled:i,children:[(0,v.jsx)(te,{size:14}),(0,v.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t}),(0,v.jsxs)(`span`,{className:`data-entry-meta`,title:`Modified ${C(e.modifiedAt)}`,children:[de(e.sizeBytes),` · `,C(e.modifiedAt)]}),(0,v.jsx)(s,{size:12,className:`data-entry-download-icon`})]}),i?(0,v.jsxs)(`div`,{className:`data-entry-confirm`,role:`group`,"aria-label":`Confirm delete ${t}`,children:[(0,v.jsx)(`span`,{className:`data-entry-confirm-label`,children:`Delete?`}),(0,v.jsx)(`button`,{type:`button`,className:`data-entry-confirm-yes`,onClick:()=>je(e),autoFocus:!0,children:`Yes`}),(0,v.jsx)(`button`,{type:`button`,className:`data-entry-confirm-no`,onClick:Ae,children:`No`})]}):(0,v.jsx)(`button`,{type:`button`,className:`data-entry-delete`,onClick:()=>ke(e),disabled:n,title:`Delete ${t}`,"aria-label":`Delete ${t}`,children:n?(0,v.jsx)(d,{size:14,className:`spin`}):(0,v.jsx)(r,{size:14})})]}):(0,v.jsxs)(`div`,{className:`data-entry-btn data-entry-disabled`,children:[(0,v.jsx)(te,{size:14}),(0,v.jsx)(`span`,{className:`data-entry-name`,children:t}),(0,v.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})},e.name)})})]})]})]})}function le({hit:e,mode:t,onDownload:n,onLocate:r}){let i=b(e.properties),a=x(e.properties),o=ue(e.labels),s=S(e.properties),[c,l]=(0,_.useState)(!1),u=a&&a.length>280,d=c||!u?a:a?.slice(0,280)+`…`,ee=t===`bm25`?`bm25 ${e.bm25Score.toFixed(2)}`:`vector ${e.vectorScore.toFixed(2)} · bm25 ${e.bm25Score.toFixed(2)} · combined ${e.score.toFixed(2)}`,f=e.properties.relativePath,p=typeof f==`string`&&f.length>0,m=p?f.lastIndexOf(`/`):-1,h=p?m===-1?`data`:f.slice(0,m):null;return(0,v.jsxs)(`li`,{className:`data-result`,children:[(0,v.jsxs)(`div`,{role:`button`,tabIndex:0,className:`data-result-open`,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e))},"aria-label":`Download ${i??o??`file`}`,children:[o&&(0,v.jsx)(`div`,{className:`data-result-header`,children:(0,v.jsx)(`span`,{className:`data-result-labels`,children:o})}),i&&(0,v.jsx)(`div`,{className:`data-result-title`,children:i}),a&&(0,v.jsx)(`pre`,{className:`data-result-body`,children:d}),(0,v.jsxs)(`div`,{className:`data-result-scores`,children:[s&&(0,v.jsxs)(`span`,{className:`data-result-updated`,children:[`Updated `,C(s),` · `]}),ee]})]}),p&&(0,v.jsxs)(`button`,{type:`button`,className:`data-result-locate`,onClick:()=>r(e),title:`Locate in ${h}`,"aria-label":`Locate in ${h}`,children:[(0,v.jsx)(ne,{size:12}),h]}),u&&(0,v.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>l(e=>!e),children:c?`Show less`:`Show more`})]})}function ue(e){if(e.length===0)return null;let t=e[0].replace(/([a-z])([A-Z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function b(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n.length>140?n.slice(0,140)+`…`:n}return null}function x(e){for(let t of[`content`,`summary`,`body`,`description`,`text`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function S(e){for(let t of[`updatedAt`,`modifiedAt`,`fetchedAt`,`createdAt`,`lastModified`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function de(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024/1024/1024).toFixed(1)} GB`}function C(e){try{let t=new Date(e);if(isNaN(t.getTime()))return`—`;let n=typeof navigator<`u`?navigator.languages&&navigator.languages.length>0?[...navigator.languages]:[navigator.language]:void 0;return t.toLocaleString(n,{dateStyle:`medium`,timeStyle:`short`})}catch{return`—`}}(0,g.createRoot)(document.getElementById(`root`)).render((0,v.jsx)(y,{}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./src-CozP7LCe.js";import"./chunk-ICPOFSXX-DvYSWH7x.js";import"./dist-Pgmncqde.js";import"./chunk-5PVQY5BW-DPhkkS4p.js";import"./chunk-U2HBQHQK-Bl1a895I.js";import"./chunk-BSJP7CBP-CTqmM6qI.js";import"./chunk-ZZ45TVLE-D9Dgmeso.js";import"./chunk-55IACEB6-DB18cH4S.js";import"./chunk-EDXVE4YY-BjWSqn7_.js";import"./chunk-X2U36JSP-WkSpBPYx.js";import"./chunk-5FUZZQ4R-6DNGaUkf.js";import"./chunk-ENJZ2VHE-BX1ZnU4A.js";import"./chunk-336JU56O-BRCubMCb.js";import{i as t,n,r,t as i}from"./chunk-OYMX7WX6-7_m3mEOK.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};
|
|
File without changes
|