@rubytech/create-maxy-code 0.1.87 → 0.1.88
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/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +27 -17
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/server/public/assets/{ChatInput-CktRrxx1.css → ChatInput-BzjU6OoA.css} +1 -1
- package/payload/server/public/assets/{Checkbox-D2XqbR29.js → Checkbox-BWLS5Isf.js} +1 -1
- package/payload/server/public/assets/{admin-BK1F2LMD.js → admin-DjU0q63n.js} +1 -1
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-9F6y6ESU.js → architectureDiagram-Q4EWVU46-lcncWUol.js} +1 -1
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-LjGbzg0M.js → blockDiagram-DXYQGD6D-SqlxCp6m.js} +1 -1
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-Bxpn5T5R.js → c4Diagram-AHTNJAMY-DWzvXvDc.js} +1 -1
- package/payload/server/public/assets/channel-dZdJT-Ou.js +1 -0
- package/payload/server/public/assets/{chunk-336JU56O-Cc2kxWVN.js → chunk-336JU56O-Bz-tPZhS.js} +2 -2
- package/payload/server/public/assets/{chunk-426QAEUC-DRzEhHvW.js → chunk-426QAEUC-MYkbqx1u.js} +1 -1
- package/payload/server/public/assets/{chunk-4TB4RGXK-C8zRzH9g.js → chunk-4TB4RGXK-DfZRQtaZ.js} +1 -1
- package/payload/server/public/assets/{chunk-5FUZZQ4R-s8V7nzOd.js → chunk-5FUZZQ4R-BFMrOiNe.js} +1 -1
- package/payload/server/public/assets/{chunk-5PVQY5BW-KNShBlaM.js → chunk-5PVQY5BW-64laDovl.js} +1 -1
- package/payload/server/public/assets/{chunk-EDXVE4YY-C6GvGxn3.js → chunk-EDXVE4YY-dClAHBNd.js} +1 -1
- package/payload/server/public/assets/{chunk-ENJZ2VHE-XvXhU8ZS.js → chunk-ENJZ2VHE-Bz4gXG1p.js} +1 -1
- package/payload/server/public/assets/{chunk-ICPOFSXX-OSDYUb0H.js → chunk-ICPOFSXX-D5pWrJcN.js} +1 -1
- package/payload/server/public/assets/{chunk-OYMX7WX6-km_4dA-E.js → chunk-OYMX7WX6-BCiWtqaK.js} +1 -1
- package/payload/server/public/assets/{chunk-U2HBQHQK-BGHqDvzJ.js → chunk-U2HBQHQK-Brql314T.js} +1 -1
- package/payload/server/public/assets/{chunk-X2U36JSP-BKKSYdFO.js → chunk-X2U36JSP-C-79tMym.js} +1 -1
- package/payload/server/public/assets/{chunk-YZCP3GAM-DT_yhfJM.js → chunk-YZCP3GAM-G4idHEoZ.js} +1 -1
- package/payload/server/public/assets/{chunk-ZZ45TVLE-CP2JuBPA.js → chunk-ZZ45TVLE-DyHGASIn.js} +1 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-CP8AWLB9.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-bUe6tAo9.js +1 -0
- package/payload/server/public/assets/clone-gXHQCPU0.js +1 -0
- package/payload/server/public/assets/{dagre-CUhFHAG8.js → dagre-DfJ8a8tG.js} +1 -1
- package/payload/server/public/assets/{dagre-KV5264BT-Dk7osC4w.js → dagre-KV5264BT--Bba_VRf.js} +1 -1
- package/payload/server/public/assets/data-Bt6BTjvP.js +1 -0
- package/payload/server/public/assets/{diagram-5BDNPKRD-CdOEJbjg.js → diagram-5BDNPKRD-CfUotMr9.js} +1 -1
- package/payload/server/public/assets/{diagram-G4DWMVQ6-Dyx0MQk6.js → diagram-G4DWMVQ6-BWZJChPS.js} +1 -1
- package/payload/server/public/assets/{diagram-MMDJMWI5-Dw6sxLh8.js → diagram-MMDJMWI5-BExS6IWb.js} +1 -1
- package/payload/server/public/assets/{diagram-TYMM5635-Bm3GRH-1.js → diagram-TYMM5635-DQ4t_wIt.js} +1 -1
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-CAJ3Z9uD.js → erDiagram-SMLLAGMA-f1sfB-AQ.js} +1 -1
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-NrVUcQ2d.js → flowDiagram-DWJPFMVM-CZexxT3v.js} +1 -1
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-28YyrNXj.js → ganttDiagram-T4ZO3ILL-BNcFUX4K.js} +1 -1
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-D73FSDE8.js → gitGraphDiagram-UUTBAWPF-soyylUaR.js} +1 -1
- package/payload/server/public/assets/{graph-labels-BMqBNCYc.js → graph-labels-BeDsoEVY.js} +1 -1
- package/payload/server/public/assets/graph-szVcmw8D.js +1 -0
- package/payload/server/public/assets/{graphlib-n_bUAhub.js → graphlib-B2ezMQY4.js} +1 -1
- package/payload/server/public/assets/{infoDiagram-42DDH7IO-rFap2NoE.js → infoDiagram-42DDH7IO-4xmenbOP.js} +1 -1
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-KKAj626l.js → ishikawaDiagram-UXIWVN3A-C_D6CqVq.js} +1 -1
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-Do6hVThi.js → journeyDiagram-VCZTEJTY-DUDx0c35.js} +1 -1
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-C38qlZwy.js → kanban-definition-6JOO6SKY-BNr7ErhZ.js} +1 -1
- package/payload/server/public/assets/{lib-D-jcbjd4.js → lib-iKom7FFe.js} +1 -1
- package/payload/server/public/assets/{line-DsDSEpXU.js → line-Dvs5wrj5.js} +1 -1
- package/payload/server/public/assets/{mermaid-parser.core-Cvzc7ePL.js → mermaid-parser.core-D0ksZQlW.js} +1 -1
- package/payload/server/public/assets/{mermaid.core-BSZExB1C.js → mermaid.core--Btu4mYy.js} +3 -3
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-CrS3b5u5.js → mindmap-definition-QFDTVHPH-DfyZTghB.js} +1 -1
- package/payload/server/public/assets/{page-C438DjPa.js → page-BnBmdRbo.js} +1 -1
- package/payload/server/public/assets/{page-fdrpcuv5.js → page-x6ZXWwMx.js} +2 -2
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-Dk-6uOEj.js → pieDiagram-DEJITSTG-BiG9YoLj.js} +1 -1
- package/payload/server/public/assets/{public-BK3eOHJs.js → public-DW7yINk7.js} +3 -3
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-CEMK5xQ0.js → quadrantDiagram-34T5L4WZ-CVufUsie.js} +1 -1
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-vTyRxQOY.js → requirementDiagram-MS252O5E-UKCptCPk.js} +1 -1
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-s2z8dMpM.js → sankeyDiagram-XADWPNL6-e8iZYL5P.js} +1 -1
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-locoOgnm.js → sequenceDiagram-FGHM5R23-CfZqVRxe.js} +1 -1
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-m1d4aD0M.js → stateDiagram-FHFEXIEX-DrWX8OY8.js} +1 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-CvKXSO97.js +1 -0
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-HraDHuOp.js → timeline-definition-GMOUNBTQ-Blec2Yhc.js} +1 -1
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP-DkyF2rFo.js → vennDiagram-DHZGUBPP-BtACuGgu.js} +1 -1
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-BGScmzP0.js → wardleyDiagram-NUSXRM2D-BWT7orYV.js} +1 -1
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-CPJ1JLj2.js → xychartDiagram-5P7HB3ND-DBzoIRiJ.js} +1 -1
- package/payload/server/public/data.html +5 -5
- package/payload/server/public/graph.html +6 -6
- package/payload/server/public/index.html +8 -8
- package/payload/server/public/public.html +5 -5
- package/payload/server/public/assets/channel-CY_QocHj.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-BtwH3Rsu.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-tCRstAZ-.js +0 -1
- package/payload/server/public/assets/clone-Bc-lmwcQ.js +0 -1
- package/payload/server/public/assets/data-B3WPMQdR.js +0 -1
- package/payload/server/public/assets/graph-B6c5nlBL.js +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-B7eWHz7x.js +0 -1
- /package/payload/server/public/assets/{ChatInput-D62NmYfJ.js → ChatInput-AR8ym-HW.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DD-I1_y5.js";import{_ as t,a as n,c as r,d as i,f as a,g as o,h as s,m as c,p as l,r as u,t as d,u as f,v as p,x as m}from"./ChatInput-D62NmYfJ.js";var h=p(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),g=p(`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`}]]),_=p(`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`}]]),v=p(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),y=p(`briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),b=p(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),x=p(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),S=p(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),C=p(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),w=p(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),T=p(`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`}]]),E=p(`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`}]]),D=p(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),O=p(`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`}]]),k=p(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),ee=p(`folder-kanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),A=p(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),j=p(`graduation-cap`,[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]),M=p(`handshake`,[[`path`,{d:`m11 17 2 2a1 1 0 1 0 3-3`,key:`efffak`}],[`path`,{d:`m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4`,key:`9pr0kb`}],[`path`,{d:`m21 3 1 11h-2`,key:`1tisrp`}],[`path`,{d:`M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3`,key:`1uvwmv`}],[`path`,{d:`M3 4h8`,key:`1ep09j`}]]),N=p(`headset`,[[`path`,{d:`M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z`,key:`12oyoe`}],[`path`,{d:`M21 16v2a4 4 0 0 1-4 4h-5`,key:`1x7m43`}]]),P=p(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),F=p(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),I=p(`linkedin`,[[`path`,{d:`M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z`,key:`c2jq9f`}],[`rect`,{width:`4`,height:`12`,x:`2`,y:`9`,key:`mk3on5`}],[`circle`,{cx:`4`,cy:`4`,r:`2`,key:`bt5ra8`}]]),te=p(`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`}]]),L=p(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ne=p(`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`}]]),R=p(`magnet`,[[`path`,{d:`m12 15 4 4`,key:`lnac28`}],[`path`,{d:`M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282z`,key:`nlhkjb`}],[`path`,{d:`m5 8 4 4`,key:`j6kj7e`}]]),re=p(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),z=p(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),ie=p(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),ae=p(`microscope`,[[`path`,{d:`M6 18h8`,key:`1borvv`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M14 22a7 7 0 1 0 0-14h-1`,key:`1jwaiy`}],[`path`,{d:`M9 14h2`,key:`197e7h`}],[`path`,{d:`M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z`,key:`1bmzmy`}],[`path`,{d:`M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3`,key:`1drr47`}]]),B=p(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),oe=p(`newspaper`,[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]),se=p(`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`}]]),V=p(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),ce=p(`pen-tool`,[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]),le=p(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ue=p(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),de=p(`repeat`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]),fe=p(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),pe=p(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),H=p(`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`}]]),me=p(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),he=p(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ge=p(`store`,[[`path`,{d:`M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5`,key:`slp6dd`}],[`path`,{d:`M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244`,key:`o0xfot`}],[`path`,{d:`M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05`,key:`wn3emo`}]]),_e=p(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ve=p(`trophy`,[[`path`,{d:`M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978`,key:`1n3hpd`}],[`path`,{d:`M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978`,key:`rfe1zi`}],[`path`,{d:`M18 9h1.5a1 1 0 0 0 0-5H18`,key:`7xy6bh`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6 9H4.5a1 1 0 0 1 0-5H6`,key:`tex48p`}]]),U=p(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),ye=p(`user-check`,[[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),be=p(`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`}]]),W=p(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),G=e(m(),1),K=i(),q=`maxy-shell-side-px`;function xe(){if(typeof window>`u`)return 0;let e=document.querySelector(`.platform > .artefact`)?.getBoundingClientRect();return e&&e.width>0?Math.round(e.width):0}function J(e){if(typeof window>`u`)return e;let t=window.innerWidth,n=Math.max(248,t-480-xe());return Math.min(Math.max(e,248),n)}function Se(){if(typeof window>`u`)return 264;try{let e=window.localStorage.getItem(q);if(!e)return 264;let t=parseInt(e,10);if(Number.isFinite(t)&&t>=248)return J(t)}catch{}return 264}function Ce({targetSelector:e=`.platform`}){let t=(0,G.useRef)(null),[n,r]=(0,G.useState)(()=>Se()),i=(0,G.useRef)(n);(0,G.useEffect)(()=>{let t=document.querySelector(e);!t||!(t instanceof HTMLElement)||(t.style.setProperty(`--side-px`,`${n}px`),i.current=n)},[n,e]);let a=(0,G.useCallback)(()=>{r(e=>{let t=J(e);return t===e?e:t})},[]);(0,G.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(J(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(q,String(t))}catch{}console.info(`[admin-ui] sidebar-resize px=${t}`)};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s)},s=()=>{let e=J(264);r(e);try{window.localStorage.removeItem(q)}catch{}console.info(`[admin-ui] sidebar-resize px=${e}`)};return(0,K.jsx)(`div`,{ref:t,className:`side-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,onPointerDown:o,onDoubleClick:s})}var we=!1;function Te(){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function Y(){let e=typeof crypto<`u`&&typeof crypto.randomUUID==`function`;if(!we){we=!0;let t=typeof window<`u`&&`isSecureContext`in window?window.isSecureContext:!1;console.info(`[idempotency] uuid-source=${e?`native`:`getRandomValues`} secureContext=${t}`)}return e?crypto.randomUUID():Te()}function X(e,t,n,r){let i=e===`pane`?`pane-action`:`sidebar-${t}`;console.info(`[admin-ui] ${i} sessionId=${n.slice(0,8)} action=${t} outcome=${r}`)}var Ee=/session_([A-Za-z0-9_-]+)/;function De(e){if(!e)return null;let t=e.match(Ee);return t?t[1]:null}async function Oe(e,t,n,r,i){let a=De(r)??`unknown`,o=e=>e.slice(0,8),s=t===`pane`?`pane-action action=resume-archive`:`sidebar-resume-archive`,c;try{let t=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(n)}/archive?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({mode:`archive`})});c=t.ok?`ok`:t.status===409?`409`:`error`;let r=`[admin-ui] ${s} sourceSessionId=${o(n)} newSessionId=${o(a)} result=${c}`;c===`error`?console.error(r):console.info(r)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[admin-ui] ${s} sourceSessionId=${o(n)} newSessionId=${o(a)} result=error detail=${t}`)}finally{i.refetch()}}function ke(e,t,n=`pane`){let[r,i]=(0,G.useState)(null),a=(0,G.useRef)(!1),o=(0,G.useCallback)(async r=>{if(!e)return{ok:!1,error:`no-cache-key`};if(a.current)return X(n,`resume`,r,`skipped-in-flight`),{ok:!1,error:`in-flight`};a.current=!0,i(`resume`);let o=Y();try{let i=await fetch(`/api/admin/claude-sessions/resume?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({sessionId:r,channel:`browser`,idempotencyKey:o})}),a=await i.json();if(!i.ok||!(`sessionId`in a)){let e=a.error??`POST returned ${i.status}`;return X(n,`resume`,r,String(i.status)),{ok:!1,error:e}}return t.setSessions(e=>[a,...e.filter(e=>e.sessionId!==r)]),X(n,`resume`,r,`200`),Oe(e,n,r,a.url,t),{ok:!0}}catch(e){let i=e instanceof Error?e.message:String(e);return X(n,`resume`,r,`threw`),t.refetch(),{ok:!1,error:i}}finally{a.current=!1,i(null)}},[e,t,n]),s=(0,G.useCallback)(async r=>{if(!e)return{ok:!1,error:`no-cache-key`};i(`end`);try{let i=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(r)}/stop?session_key=${encodeURIComponent(e)}`,{method:`POST`});if(!i.ok){let e=await i.text().catch(()=>``);return X(n,`end`,r,String(i.status)),t.refetch(),{ok:!1,error:`POST /stop ${i.status} ${e.slice(0,200)}`}}return X(n,`end`,r,`204`),t.refetch(),{ok:!0}}catch(e){let i=e instanceof Error?e.message:String(e);return X(n,`end`,r,`threw`),t.refetch(),{ok:!1,error:i}}finally{i(null)}},[e,t,n]),c=(0,G.useCallback)(async r=>{if(!e)return{ok:!1,error:`no-cache-key`};i(`purge`);try{let i=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(r)}?purge=1&session_key=${encodeURIComponent(e)}`,{method:`DELETE`});if(!i.ok){let e=await i.json().catch(()=>({})),t=e.detail||e.error||`DELETE ?purge=1 ${i.status}`;return X(n,`purge`,r,String(i.status)),{ok:!1,error:t}}return t.setSessions(e=>e.filter(e=>e.sessionId!==r)),X(n,`purge`,r,`200`),t.refetch(),{ok:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return X(n,`purge`,r,`threw`),{ok:!1,error:t}}finally{i(null)}},[e,t,n]),l=(0,G.useCallback)(async(r,a)=>{if(!e)return{ok:!1,error:`no-cache-key`};i(a);try{let i=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(r)}/archive?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({mode:a})});if(!i.ok){let e=await i.json().catch(()=>({})),t=e.detail||e.error||`POST /archive ${i.status}`;return X(n,a,r,String(i.status)),{ok:!1,error:t}}return a===`archive`&&t.setSessions(e=>e.filter(e=>e.sessionId!==r)),t.refetch(),X(n,a,r,`200`),{ok:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return X(n,a,r,`threw`),{ok:!1,error:t}}finally{i(null)}},[e,t,n]);return{inFlight:r,resume:o,end:s,purge:c,archive:(0,G.useCallback)(e=>l(e,`archive`),[l]),unarchive:(0,G.useCallback)(e=>l(e,`unarchive`),[l])}}function Ae(e){return`code.session.pinned.${e}`}function je(e){if(typeof window>`u`)return new Set;try{let t=window.localStorage.getItem(Ae(e));if(!t)return new Set;let n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function Me(e,t){if(!(typeof window>`u`))try{window.localStorage.setItem(Ae(e),JSON.stringify([...t]))}catch{}}function Ne(e){let[t,n]=(0,G.useState)(()=>je(e));(0,G.useEffect)(()=>{n(je(e))},[e]);let r=(0,G.useCallback)(t=>{n(n=>{let r=new Set(n);return r.has(t)?r.delete(t):r.add(t),Me(e,r),r})},[e]);return{pinned:t,isPinned:(0,G.useCallback)(e=>t.has(e),[t]),togglePin:r}}function Z(e){let{businessName:i,onLaunchBrowser:o,onNavigate:s,onToggleSidebar:l,sidebarOpen:u,onLogout:d,browserLaunching:f}=e,[p,m]=(0,G.useState)(!1),h=(0,G.useRef)(null),g=(0,G.useRef)(null),[_,v]=(0,G.useState)(null),[y,b]=(0,G.useState)(!1),[x,S]=(0,G.useState)(null),[C,w]=(0,G.useState)(null),[T,D]=(0,G.useState)(null),[k,ee]=(0,G.useState)(``);(0,G.useEffect)(()=>{ee(window.location.hostname.startsWith(`admin.`)?window.location.origin.replace(`admin.`,`public.`):window.location.origin)},[]),(0,G.useEffect)(()=>{if(!p)return;let e=e=>{h.current&&!h.current.contains(e.target)&&m(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[p]),(0,G.useEffect)(()=>{if(!p)return;let e=e=>{e.key===`Escape`&&m(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[p]),(0,G.useEffect)(()=>{p&&g.current?.focus()},[p]),(0,G.useEffect)(()=>{if(!p)return;let e=!1;return fetch(`/api/admin/version`).then(e=>e.json()).then(t=>{e||D(t)}).catch(e=>{console.error(`[admin/version] menu-open client fetch failed:`,e)}),()=>{e=!0}},[p]);let A=(0,G.useCallback)(()=>{m(e=>{let t=!e;return t&&console.info(`[admin-ui] header-menu-open`),t})},[]),j=(0,G.useCallback)(()=>{m(!1),o()},[o]),M=(0,G.useCallback)(e=>{m(!1),s(e)},[s]),N=(0,G.useCallback)(async()=>{if(_!==null){v(null),w(null);return}b(!0),S(null);try{let e=await fetch(`/api/admin/agents`);if(!e.ok)throw Error(`Failed to load agents`);v((await e.json()).agents??[])}catch(e){console.error(`[admin/agents] list failed:`,e),S(e instanceof Error?e.message:String(e)),v([])}finally{b(!1)}},[_]),P=(0,G.useCallback)(e=>{w(null),v(t=>t?.filter(t=>t.slug!==e)??null),fetch(`/api/admin/agents/${encodeURIComponent(e)}`,{method:`DELETE`}).catch(e=>console.error(`[admin/agents] delete failed:`,e))},[]),I=(0,G.useCallback)(()=>{m(!1),d()},[d]),te=i||n.productName;return(0,K.jsxs)(`header`,{className:`admin-header`,children:[(0,K.jsx)(`button`,{type:`button`,className:`admin-sidebar-toggle`,"aria-label":u?`Hide sidebar`:`Show sidebar`,title:u?`Hide sidebar`:`Show sidebar`,"aria-expanded":u,onClick:l,children:u?(0,K.jsx)(se,{size:20,strokeWidth:1.5}):(0,K.jsx)(V,{size:20,strokeWidth:1.5})}),(0,K.jsxs)(`div`,{className:`chat-header-label`,children:[(0,K.jsx)(`span`,{className:`chat-logo-btn`,"aria-hidden":`true`,children:(0,K.jsx)(`img`,{src:r,alt:``,className:`chat-logo`})}),(0,K.jsx)(`h1`,{className:`chat-tagline`,children:te})]}),(0,K.jsxs)(`div`,{className:`chat-burger-wrap`,ref:h,children:[(0,K.jsx)(`button`,{type:`button`,className:`admin-burger`,onClick:A,"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":p,children:(0,K.jsx)(z,{size:20})}),p&&(0,K.jsxs)(`div`,{className:`admin-menu`,role:`menu`,children:[(0,K.jsxs)(`button`,{ref:g,type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:j,disabled:f,children:[(0,K.jsx)(c,{size:14}),` Browser`,f&&(0,K.jsx)(L,{size:12,className:`spin`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>M(`data`),children:[(0,K.jsx)(E,{size:14}),` Data`]}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>M(`graph`),children:[(0,K.jsx)(H,{size:14}),` Graph`]}),(0,K.jsx)(`div`,{className:`chat-menu-divider`}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:N,children:[(0,K.jsx)(O,{size:14}),` Public`,y&&(0,K.jsx)(L,{size:12,className:`spin`})]}),_!==null&&(0,K.jsxs)(`div`,{className:`chat-menu-agents`,children:[x&&(0,K.jsx)(`span`,{className:`chat-menu-agent-error`,children:x}),_.length===0&&!x&&(0,K.jsx)(`span`,{className:`chat-menu-agent-empty`,children:`No public agents configured`}),_.map(e=>(0,K.jsxs)(`div`,{className:`chat-menu-item chat-menu-agent-item`,children:[(0,K.jsx)(`span`,{className:`agent-status-dot ${e.status}`}),(0,K.jsxs)(`span`,{className:`agent-text`,children:[(0,K.jsx)(`span`,{className:`agent-display-name`,children:e.displayName}),(0,K.jsxs)(`span`,{className:`agent-slug`,children:[`/`,e.slug]})]}),C===e.slug?(0,K.jsxs)(`span`,{className:`agent-actions agent-confirm`,children:[(0,K.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-yes`,title:`Confirm delete`,onClick:()=>P(e.slug),children:(0,K.jsx)(t,{size:12})}),(0,K.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-no`,title:`Cancel`,onClick:()=>w(null),children:(0,K.jsx)(W,{size:12})})]}):(0,K.jsxs)(`span`,{className:`agent-actions`,children:[(0,K.jsx)(`a`,{href:`${k}/${e.slug}`,target:`_blank`,rel:`noopener noreferrer`,className:`agent-action-btn`,title:`Open agent`,onClick:()=>m(!1),children:(0,K.jsx)(O,{size:12})}),(0,K.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-delete-btn`,title:`Delete agent`,onClick:()=>w(e.slug),children:(0,K.jsx)(a,{size:12})})]})]},e.slug))]}),(0,K.jsx)(`div`,{className:`chat-menu-divider`}),(0,K.jsxs)(`div`,{className:`chat-menu-version chat-menu-version-passive`,children:[(0,K.jsx)(F,{size:14}),(0,K.jsxs)(`span`,{className:`version-installed`,children:[T?`v${T.installed}`:`…`,T&&!T.updateAvailable&&(0,K.jsx)(`span`,{className:`version-uptodate-dot`}),T?.updateAvailable&&(0,K.jsx)(`span`,{className:`version-update-dot`})]})]}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:I,children:[(0,K.jsx)(ne,{size:14}),` Log out`]})]})]})]})}var Pe=Object.freeze({admin:N,"business-assistant":y,cloudflare:w,contacts:be,"deep-research":fe,docs:s,email:re,"linkedin-import":I,memory:v,outlook:re,projects:ee,replicate:me,sales:D,scheduling:x,tasks:te,telegram:pe,waitlist:C,whatsapp:ie,workflows:A,teaching:j,"writer-craft":k,brochures:oe,"real-agent-buyers":ye,"real-agent-business":b,"real-agent-coaching":ve,"real-agent-leads":R,"real-agent-listings":P,"real-agent-loop":de,"real-agent-sales":M,"real-agent-teaching":j,"real-agent-vendors":ge,"content-producer":ce,"database-operator":E,librarian:h,"personal-assistant":U,"project-manager":S,"research-assistant":ae}),Fe=new Set;function Ie(e){return Pe[e]||(Fe.has(e)||(Fe.add(e),console.warn(`[admin-ui] sidebar-agent-icon-fallback label=${e}`)),g)}var Le=`maxy-admin-session`,Re=typeof BroadcastChannel<`u`;function ze(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`rotation`&&typeof t.newKey==`string`&&t.newKey.length>0&&(t.surface===`chat`||t.surface===`graph`||t.surface===`data`||t.surface===`sessions`)&&typeof t.ts==`number`}function Be(e){if(!Re)return()=>{};let t=new BroadcastChannel(Le),n=t=>{if(!ze(t.data)){console.warn(`[admin-session-broadcast] outcome=received-malformed payload=${JSON.stringify(t.data)}`);return}e(t.data)};return t.addEventListener(`message`,n),()=>{t.removeEventListener(`message`,n),t.close()}}var Ve=`maxy-admin-session-key`;function Q(e,t){return`${e}${e.includes(`?`)?`&`:`?`}session_key=${encodeURIComponent(t)}`}async function He(e){let t;try{t=await e.clone().json()}catch{return`parse-failed`}if(typeof t!=`object`||!t)return`unknown-401`;let n=t.code;return n===`session-missing`||n===`session-not-registered`||n===`session-expired-age`||n===`grant-expired`?n:`unknown-401`}function Ue(){try{return sessionStorage.getItem(Ve)}catch{return null}}function We(e){let{initialCacheKey:t,surface:n}=e,[r,i]=(0,G.useState)(t),a=(0,G.useRef)(t);(0,G.useEffect)(()=>{a.current=r},[r]),(0,G.useEffect)(()=>{t!==a.current&&(i(t),a.current=t,s(e=>e+1))},[t]);let[o,s]=(0,G.useState)(0),[c,l]=(0,G.useState)(null);(0,G.useEffect)(()=>Be(e=>{let t=a.current.slice(0,8),r=e.newKey.slice(0,8);e.newKey!==a.current&&(console.log(`[admin-session-broadcast] outcome=received oldKey=${t} newKey=${r} surface=${n} senderSurface=${e.surface}`),i(e.newKey),s(e=>e+1),l(null))}),[n]);let u=(0,G.useCallback)(()=>{try{sessionStorage.removeItem(Ve)}catch{}window.location.href=`/`},[]);return{adminFetch:(0,G.useCallback)(async(e,t)=>{let r=a.current,o=Q(e,r),c=await fetch(o,t);if(c.status!==401)return c;let d=await He(c);if(d===`session-missing`)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=${d} surface=${n} path=${e}`),u(),c;if(d!==`session-not-registered`)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=${d} surface=${n} path=${e}`),l({message:`Your admin session has expired. Click to reload and sign in.`,reason:d}),c;let f=Ue();if(!f||f===r)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=session-not-registered-no-fresh-key surface=${n} path=${e}`),l({message:`Your admin session was renewed in another tab. Click to reload.`,reason:`session-not-registered`}),c;i(f),a.current=f,s(e=>e+1),console.log(`[useAdminFetch] outcome=retry-after-rotation oldKey=${r.slice(0,8)} newKey=${f.slice(0,8)} surface=${n} path=${e}`);let p=Q(e,f),m=await fetch(p,t);return m.status===401&&(console.warn(`[useAdminFetch] outcome=redirect-to-login reason=second-401-after-retry surface=${n} path=${e}`),l({message:`Your admin session has expired. Click to reload and sign in.`,reason:`session-not-registered`})),m},[u,n]),cacheKey:r,sessionRefetchNonce:o,banner:c,reloadToLogin:u}}var Ge=`/api/admin/claude-sessions/events`,Ke=`admin-session-list-view`,qe=`admin-session-list-include-subagents`,Je=`admin-session-list-include-background`;function Ye(e){return e===`active`||e===`archived`||e===`all`}function Xe(){let e={rows:[],view:`active`,includeBackground:!1,connected:!1},t=new Map,n=new Set,r=null,i=null,a=0,o=0,s=null,c=!1,l=!1;function u(){let n=[...t.values()].sort((e,t)=>t.updatedAt===e.updatedAt?e.sessionId<t.sessionId?-1:1:t.updatedAt-e.updatedAt);e={...e,rows:n}}function d(){for(let e of n)e()}function f(e,n){if(e===`row-removed`){let e=n?.sessionId;if(typeof e!=`string`||!t.delete(e))return;u(),d();return}let r=n;if(typeof r.sessionId!=`string`)return;let i={sessionId:r.sessionId,live:r.live===!0,status:r.status===`busy`?`busy`:r.status===`idle`?`idle`:`gone`,agentLabel:typeof r.agentLabel==`string`&&r.agentLabel.length>0?r.agentLabel:null,cwd:typeof r.cwd==`string`?r.cwd:null,firstPrompt:typeof r.firstPrompt==`string`&&r.firstPrompt.length>0?r.firstPrompt:null,updatedAt:typeof r.updatedAt==`number`?r.updatedAt:0,url:typeof r.url==`string`&&r.url.length>0?r.url:null};t.set(i.sessionId,i),u(),d()}function p(t){if(r&&s===t||(r&&=(r.close(),null),!t))return;s=t,c=!1,l=!1;let n=Q(Ge,t);try{r=new EventSource(n)}catch(e){console.error(`[admin-ui] session-row-store EventSource construct failed:`,e),h(`auto`);return}r.addEventListener(`open`,()=>{c=!0,a=0,e={...e,connected:!0},d(),console.info(`[admin-ui] session-row-store connected events-received=${o}`)});for(let e of[`row-created`,`row-updated`,`row-archived`,`row-removed`])r.addEventListener(e,t=>{o+=1;try{f(e,JSON.parse(t.data))}catch(t){console.error(`[admin-ui] session-row-store parse failed kind=${e}:`,t)}});r.addEventListener(`error`,()=>{r&&=(r.close(),null),e={...e,connected:!1},d(),!c&&!l&&(l=!0,m(n)),h(`auto`)})}async function m(e){let t=a+1,n=0,r=`unknown`;try{let t=await fetch(e,{method:`GET`});n=t.status,r=t.status>=400&&t.status<500?await He(t):`unknown`}catch(e){console.error(`[admin-ui] session-row-store sse-error-probe-failed:`,e);return}console.error(`[admin-ui] session-row-store sse-error status=${n} code=${r} attempt=${t}`)}function h(e){if(i)return;a+=1;let t=Math.min(1e3*2**Math.min(a,5),3e4);console.info(`[admin-ui] session-row-store reconnect trigger=${e} attempt=${a} delay-ms=${t}`),i=setTimeout(()=>{i=null,s&&p(s)},t)}function g(){i&&=(clearTimeout(i),null),a=0,r&&=(r.close(),null),console.info(`[admin-ui] session-row-store reconnect trigger=manual attempt=0 delay-ms=0`),s&&p(s)}function _(){if(!(typeof window>`u`))try{let t=window.localStorage.getItem(Ke);Ye(t)&&(e={...e,view:t});let n=window.localStorage.getItem(qe);if(n===null){let e=window.localStorage.getItem(Je);e!==null&&(window.localStorage.setItem(qe,e),window.localStorage.removeItem(Je),n=e,console.info(`[admin-ui] session-list-storage-migrated from=${Je} to=${qe} value=${e}`))}n===`1`&&(e={...e,includeBackground:!0})}catch{}}function v(t){e={...e,view:t};try{window.localStorage.setItem(Ke,t)}catch{}d()}function y(t){e={...e,includeBackground:t};try{window.localStorage.setItem(qe,t?`1`:`0`)}catch{}d()}function b(e){return n.add(e),()=>{n.delete(e)}}function x(){return e}function S(){r&&=(r.close(),null),i&&=(clearTimeout(i),null),s=null,e={...e,connected:!1}}function C(e,t){f(e,t)}function w(t){e={...e,connected:t},d()}function T(){t.clear(),u(),d()}function E(e){let n=new Set(e),r=0;for(let e of[...t.keys()])n.has(e)||(t.delete(e),r+=1);r!==0&&(console.info(`[admin-ui] session-row-store reconcile evicted=${r} kept=${t.size}`),u(),d())}return _(),{subscribe:b,getSnapshot:x,connect:p,disconnect:S,setView:v,setIncludeBackground:y,reconnectNow:g,reconcileFromList:E,_injectEventForTesting:C,_setConnectedForTesting:w,_clearRowsForTesting:T}}var $=Xe();$._injectEventForTesting,$.connect,$._setConnectedForTesting,$.getSnapshot,$.reconcileFromList;function Ze(e){let t=(0,G.useSyncExternalStore)($.subscribe,$.getSnapshot,$.getSnapshot);(0,G.useEffect)(()=>{e&&$.connect(e)},[e]);let n=(0,G.useCallback)(e=>$.setView(e),[]),r=(0,G.useCallback)(e=>$.setIncludeBackground(e),[]),i=(0,G.useCallback)(()=>$.reconnectNow(),[]),a=(0,G.useCallback)(e=>$.reconcileFromList(e),[]);return{rows:t.rows,view:t.view,includeBackground:t.includeBackground,connected:t.connected,setView:n,setIncludeBackground:r,reconnectNow:i,reconcileFromList:a}}function Qe(e,t,n){return e.filter(e=>!(t===`active`&&!e.live||t===`archived`&&e.live||!n&&e.agentLabel!==null&&e.agentLabel!==`admin`))}var $e=6e4,et=60*$e,tt=24*et,nt=$e,rt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],it=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function at(e){return e<10?`0${e}`:String(e)}function ot(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function st(e,t){if(!Number.isFinite(e)||e<=0||!Number.isFinite(t))return`—`;let n=t-e;if(n<-nt)return`—`;let r=n<0?0:n;if(r<$e)return`just now`;if(r<et)return`${Math.floor(r/$e)}m`;if(r<tt)return`${Math.floor(r/et)}h`;let i=new Date(t),a=new Date(e),o=Math.round((ot(i)-ot(a))/tt);if(o===1)return`yesterday`;if(o>=2&&o<=6)return it[a.getDay()];let s=at(a.getDate()),c=rt[a.getMonth()];return a.getFullYear()===i.getFullYear()?`${s} ${c}`:`${s} ${c} ${a.getFullYear()}`}function ct(e=3e4){let[t,n]=(0,G.useState)(()=>Date.now());return(0,G.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var lt={default:`Ask`,acceptEdits:`Accept edits`,plan:`Plan`,auto:`Auto`,bypassPermissions:`Bypass permissions`},ut=[`default`,`acceptEdits`,`plan`,`auto`,`bypassPermissions`],dt=[{value:void 0,label:`Default`},{value:`claude-opus-4-7`,label:`Opus 4.7`},{value:`claude-sonnet-4-6`,label:`Sonnet 4.6`},{value:`claude-haiku-4-5`,label:`Haiku 4.5`}];function ft({seedMode:e,submitting:n,error:r,onSubmit:i,onCancel:a,onErrorClear:s}){let[c,l]=(0,G.useState)(``),[u,f]=(0,G.useState)(e),[p,m]=(0,G.useState)(void 0),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(!1),y=(0,G.useRef)(null),b=(0,G.useRef)(null),x=(0,G.useRef)(null);(0,G.useEffect)(()=>{y.current?.focus()},[]),(0,G.useEffect)(()=>{function e(e){if(e.key===`Escape`){if(h){g(!1),e.stopPropagation();return}if(_){v(!1),e.stopPropagation();return}a(`esc`)}}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[h,_,a]),(0,G.useEffect)(()=>{if(!h&&!_)return;function e(e){h&&b.current&&!b.current.contains(e.target)&&g(!1),_&&x.current&&!x.current.contains(e.target)&&v(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[h,_]);let S=c.trim(),C=S.length>0&&!n,w=(0,G.useCallback)(()=>{S.length===0||n||i({message:c,permissionMode:u,model:p})},[c,u,p,S,n,i]);function E(e){e.preventDefault(),w()}let D=dt.find(e=>e.value===p)?.label??`Default`;return(0,K.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`new-session-modal-title`,className:`new-session-modal-overlay`,onClick:e=>{e.target===e.currentTarget&&a(`backdrop`)},children:(0,K.jsxs)(`div`,{className:`new-session-modal`,children:[(0,K.jsx)(`h2`,{id:`new-session-modal-title`,className:`new-session-modal-title`,children:`New session`}),(0,K.jsxs)(`form`,{className:`new-session-modal-form`,onSubmit:E,children:[(0,K.jsx)(`div`,{className:`chat-form`,children:(0,K.jsx)(d,{ref:y,value:c,onChange:e=>{l(e),r&&s()},placeholder:`What should this session do?`,disabled:n})}),r&&(0,K.jsx)(`div`,{className:`tunnel-route__error`,role:`alert`,children:r}),(0,K.jsxs)(`div`,{className:`new-session-modal-actions`,children:[(0,K.jsxs)(`div`,{className:`new-session-modal-pickers`,children:[(0,K.jsxs)(`div`,{className:`new-session-modal-picker-wrap`,ref:b,children:[(0,K.jsxs)(`button`,{type:`button`,className:`side-mode-trigger`,onClick:()=>{let e=!h;console.info(`[admin-ui] new-session-modal-mode-picker action=${e?`open`:`close`} current=${u}`),g(e)},disabled:n,"aria-haspopup":`menu`,"aria-expanded":h,"aria-label":`Permission mode for this session`,children:[lt[u],(0,K.jsx)(o,{size:12,"aria-hidden":`true`})]}),h&&(0,K.jsxs)(`div`,{className:`side-mode-popover`,role:`menu`,"aria-label":`Mode`,children:[(0,K.jsx)(`div`,{className:`side-mode-popover-head`,children:(0,K.jsx)(`span`,{children:`Mode`})}),ut.map((e,n)=>(0,K.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`side-mode-popover-item`,onClick:()=>{console.info(`[admin-ui] new-session-modal-mode-change from=${u} to=${e} trigger=click`),f(e),g(!1)},children:[(0,K.jsx)(`span`,{children:lt[e]}),(0,K.jsxs)(`span`,{className:`side-mode-popover-shortcut`,children:[e===u&&(0,K.jsx)(t,{size:12}),(0,K.jsx)(`span`,{children:n+1})]})]},e))]})]}),(0,K.jsxs)(`div`,{className:`new-session-modal-picker-wrap`,ref:x,children:[(0,K.jsxs)(`button`,{type:`button`,className:`side-mode-trigger`,onClick:()=>{let e=!_;console.info(`[admin-ui] new-session-modal-model-picker action=${e?`open`:`close`} current=${p??`default`}`),v(e)},disabled:n,"aria-haspopup":`menu`,"aria-expanded":_,"aria-label":`Model for this session`,children:[D,(0,K.jsx)(o,{size:12,"aria-hidden":`true`})]}),_&&(0,K.jsxs)(`div`,{className:`side-mode-popover`,role:`menu`,"aria-label":`Model`,children:[(0,K.jsx)(`div`,{className:`side-mode-popover-head`,children:(0,K.jsx)(`span`,{children:`Model`})}),dt.map(e=>(0,K.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`side-mode-popover-item`,onClick:()=>{console.info(`[admin-ui] new-session-modal-model-change from=${p??`default`} to=${e.value??`default`} trigger=click`),m(e.value),v(!1)},children:[(0,K.jsx)(`span`,{children:e.label}),(0,K.jsx)(`span`,{className:`side-mode-popover-shortcut`,children:e.value===p&&(0,K.jsx)(t,{size:12})})]},e.label))]})]})]}),(0,K.jsxs)(`div`,{className:`new-session-modal-buttons`,children:[(0,K.jsx)(`button`,{type:`button`,className:`modal-action-btn`,onClick:()=>a(`button`),disabled:n,children:`Cancel`}),(0,K.jsx)(`button`,{type:`submit`,className:`new-session-modal-submit`,disabled:!C,"aria-label":`Send`,children:n?(0,K.jsx)(L,{size:14,className:`spinning`}):(0,K.jsx)(T,{size:14})})]})]})]})]})})}var pt=(0,G.forwardRef)(function(e,r){let{businessName:i,cacheKey:c,role:u,userName:d,userAvatar:f,sessions:p,sessionsLoading:m,sessionsError:h,ensureSessionsLoaded:v,refetchSessions:y,onSelectArtefact:b,onSelectProjects:x,onSelectPeople:S,onSelectTasks:C,onSelectAgents:w,onCloseMobileDrawer:T,onSelectSession:E,selectedSessionId:D,collapsed:k,mobileDrawerOpen:ee,recentsActions:A}=e,[j,M]=(0,G.useState)(null),[N,P]=(0,G.useState)(null),[F,I]=(0,G.useState)(!1);(0,G.useEffect)(()=>{v()},[v]);let ne=(0,G.useRef)(null),[R,re]=(0,G.useState)(!1),[z,ie]=(0,G.useState)(`default`),[ae,B]=(0,G.useState)(null),[oe,se]=(0,G.useState)(!1),V=(0,G.useRef)(0),ce=n.productName,de=typeof d==`string`?d:d===null?`name unavailable`:i||ce,fe=(de.trim().charAt(0)||`?`).toUpperCase(),pe=Ne(n.hostname),H=Ze(c),me=(0,G.useMemo)(()=>{let e=Qe(H.rows,H.view,H.includeBackground);if(pe.pinned.size===0)return e;let t=[],n=[];for(let r of e)(pe.pinned.has(r.sessionId)?t:n).push(r);return[...t,...n]},[H.rows,H.view,H.includeBackground,pe.pinned]),ge=me.length,ve=ct(3e4),[U,ye]=(0,G.useState)(`chat`),[W,q]=(0,G.useState)([]),[xe,J]=(0,G.useState)(!1),[Se,Ce]=(0,G.useState)(null),[we,Te]=(0,G.useState)(!1);(0,G.useImperativeHandle)(r,()=>({patchArtefact(e,t){q(n=>n.map(n=>n.id===e?{...n,...t}:n))}}),[]);let[Y,X]=(0,G.useState)(!1),Ee=(0,G.useRef)(null),De={default:`Ask`,acceptEdits:`Accept edits`,plan:`Plan`,auto:`Auto`,bypassPermissions:`Bypass permissions`},Oe=[`default`,`acceptEdits`,`plan`,`auto`,`bypassPermissions`];(0,G.useEffect)(()=>{if(!Y)return;function e(e){Ee.current&&!Ee.current.contains(e.target)&&(console.info(`[admin-ui] sidebar-mode-picker action=close mode=${z}`),X(!1))}function t(e){if(e.key===`Escape`){console.info(`[admin-ui] sidebar-mode-picker action=close mode=${z}`),X(!1);return}let t=[`1`,`2`,`3`,`4`,`5`].indexOf(e.key);if(t>=0&&!e.metaKey&&!e.ctrlKey&&!e.altKey){let n=Oe[t];n&&(e.preventDefault(),console.info(`[admin-ui] sidebar-mode-picker action=select mode=${n} via=shortcut`),ie(n),X(!1))}}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[Y,z]),(0,G.useEffect)(()=>{function e(e){e.shiftKey&&(e.metaKey||e.ctrlKey)&&(e.key===`m`||e.key===`M`)&&(e.preventDefault(),X(e=>{let t=!e;return console.info(`[admin-ui] sidebar-mode-picker action=${t?`open`:`close`} mode=${z} via=shortcut`),t}))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[z]);let Ae=(0,G.useCallback)(async()=>{if(c){Te(!0),Ce(null);try{let e=await fetch(`/api/admin/sidebar-artefacts?session_key=${encodeURIComponent(c)}`);if(!e.ok)throw Error(`status ${e.status}`);q((await e.json()).artefacts??[]),J(!0)}catch(e){let t=e instanceof Error?e.message:String(e);Ce(`Failed to load artefacts: ${t}`),console.error(`[admin-ui] sidebar-artefacts fetch failed: ${t}`)}finally{Te(!1)}}},[c]),je=()=>{ye(`chat`),console.info(`[admin-ui] sidebar-nav surface=sessions count=${ge}`)},Me=()=>{ye(`artefacts`),console.info(`[admin-ui] sidebar-nav surface=artefacts count=${xe?W.length:0} collapsed=${k}`),xe||Ae()},Z=1.5,Pe=U===`chat`?`Sessions`:`Artefacts`,Fe=U===`chat`?m?`…`:String(ge):we?`…`:String(W.length),Le=U===`chat`?m:we,Re=()=>{console.info(`[admin-ui] sidebar-refresh surface=${U}`),U===`chat`?y().then(e=>{e!==null&&H.reconcileFromList(e.map(e=>e.sessionId))}):Ae()},ze=(0,G.useCallback)(()=>{if(R||!c){console.info(`[admin-ui] sidebar-new-session-click-ignored startingSession=${R} cacheKey=${c?`set`:`missing`}`);return}B(null),V.current=Date.now(),console.info(`[admin-ui] sidebar-new-session-modal-open seedMode=${z} cacheKey-prefix=${c.slice(0,8)}`),se(!0)},[c,R,z]),Be=(0,G.useCallback)(e=>{let t=V.current?Date.now()-V.current:0;console.info(`[admin-ui] sidebar-new-session-modal-cancel reason=${e} dwell-ms=${t}`),se(!1)},[]),Ve=(0,G.useCallback)(async e=>{if(R||!c)return;let t=V.current?Date.now()-V.current:0,n=Date.now();console.info(`[admin-ui] sidebar-new-session-modal-submit permissionMode=${e.permissionMode} model=${e.model??`default`} messageChars=${e.message.length} dwell-ms=${t}`),re(!0),B(null);try{console.info(`[admin-ui] sidebar-new-session-fetch-start permissionMode=${e.permissionMode} model=${e.model??`default`} messageChars=${e.message.length}`);let t={channel:`browser`,permissionMode:e.permissionMode,initialMessage:e.message};e.model!==void 0&&(t.model=e.model);let r=await fetch(`/api/admin/claude-sessions?session_key=${encodeURIComponent(c)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),i=Date.now()-n;console.info(`[admin-ui] sidebar-new-session-fetch-done status=${r.status} ok=${r.ok} ms=${i}`);let a=await r.json();if(!r.ok||!(`sessionId`in a)){let e=a,t=e.error??`POST returned ${r.status}`,i=e.reason?`${t}: ${e.reason}`:t;console.error(`[admin-ui] sidebar-new-session-failed status=${r.status} ms=${Date.now()-n} error=${t} reason=${e.reason??`none`} tail=${JSON.stringify(e.stderrTail??``)}`),B(i);return}console.info(`[admin-ui] sidebar-new-session-ok pid=${a.pid} sessionId=${a.sessionId.slice(0,8)} permissionMode=${e.permissionMode} model=${e.model??`default`} ms=${Date.now()-n}`),A.setSessions(e=>[a,...e]),se(!1)}catch(e){let t=e instanceof Error?e.message:String(e);B(t),console.error(`[admin-ui] sidebar-new-session-threw ms=${Date.now()-n} message=${t}`)}finally{re(!1)}},[c,R,A]),Q=ke(c,A,`sidebar`),He=(0,G.useCallback)(async e=>{let t=await Q.resume(e);t.ok||console.error(`[admin-ui] sidebar-resume failed: ${t.error}`)},[Q]),Ue=(0,G.useCallback)(async e=>{I(!0),P(null);let t=await Q.purge(e);t.ok?M(null):P(t.error??`purge failed`),I(!1)},[Q]),We=(0,G.useCallback)(async e=>{let t=await Q.end(e);t.ok||console.error(`[admin-ui] sidebar-end-session failed: ${t.error}`)},[Q]);return(0,K.jsxs)(`aside`,{className:`side`,children:[U===`chat`&&(0,K.jsxs)(`div`,{className:`side-new-session-row`,ref:Ee,children:[(0,K.jsxs)(`button`,{type:`button`,className:`side-new-session`,onClick:ze,disabled:R||!c,children:[R?(0,K.jsx)(L,{size:14,className:`spinning`}):(0,K.jsx)(le,{size:14}),(0,K.jsx)(`span`,{children:`New session`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`side-mode-trigger`,onClick:()=>{let e=!Y;console.info(`[admin-ui] sidebar-mode-picker action=${e?`open`:`close`} mode=${z}`),X(e)},disabled:R,"aria-haspopup":`menu`,"aria-expanded":Y,"aria-label":`Permission mode for the next session`,title:`Shift+Cmd+M`,children:[De[z],(0,K.jsx)(o,{size:12,"aria-hidden":`true`})]}),Y&&(0,K.jsxs)(`div`,{className:`side-mode-popover`,role:`menu`,"aria-label":`Mode`,children:[(0,K.jsxs)(`div`,{className:`side-mode-popover-head`,children:[(0,K.jsx)(`span`,{children:`Mode`}),(0,K.jsx)(`span`,{className:`side-mode-popover-shortcut`,"aria-hidden":`true`,children:`⇧⌘M`})]}),Oe.map((e,n)=>(0,K.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`side-mode-popover-item`,onClick:()=>{console.info(`[admin-ui] sidebar-mode-picker action=select mode=${e}`),ie(e),X(!1)},children:[(0,K.jsx)(`span`,{children:De[e]}),(0,K.jsxs)(`span`,{className:`side-mode-popover-shortcut`,children:[e===z&&(0,K.jsx)(t,{size:12}),(0,K.jsx)(`span`,{children:n+1})]})]},e))]})]}),(0,K.jsxs)(`nav`,{className:`side-nav`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`nav-row${U===`chat`?` active`:``}`,onClick:je,children:[(0,K.jsx)(_e,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Sessions`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=people`),S(),T()},children:[(0,K.jsx)(be,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`People`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=agents`),w(),T()},children:[(0,K.jsx)(g,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Agents`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=projects`),x(),T()},children:[(0,K.jsx)(_,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Projects`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=tasks`),C(),T()},children:[(0,K.jsx)(te,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Tasks`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row${U===`artefacts`?` active`:``}`,onClick:Me,children:[(0,K.jsx)(s,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Artefacts`}),(0,K.jsx)(`span`,{className:`kbd`})]})]}),(0,K.jsxs)(`div`,{className:`side-list`,ref:ne,children:[(0,K.jsxs)(`div`,{className:`group-head`,children:[(0,K.jsx)(`span`,{children:Pe}),(0,K.jsxs)(`span`,{className:`group-head-meta`,children:[(0,K.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh ${Pe.toLowerCase()}`,"aria-label":`Refresh ${Pe.toLowerCase()}`,onClick:Re,disabled:Le,children:(0,K.jsx)(ue,{size:12,className:Le?`spinning`:void 0})}),(0,K.jsx)(`span`,{children:Fe})]})]}),ae&&U===`chat`&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:ae}),U===`chat`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ht,{view:H.view,setView:e=>{console.info(`[admin-ui] sidebar-view-change view=${e}`),H.setView(e)},connected:H.connected,reconnectNow:H.reconnectNow}),h&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:h}),me.map(e=>{let t=D===e.sessionId,n=e.agentLabel??`admin`,r=Ie(n);return(0,K.jsxs)(`div`,{className:`conv${t?` active`:``}`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`conv-name-button`,onClick:()=>{E(e.sessionId),T()},title:`Show metadata`,children:[(0,K.jsxs)(`span`,{className:`conv-name-line`,children:[(0,K.jsx)(_e,{size:12,className:`conv-channel-icon`,"aria-label":`claude session`}),(0,K.jsx)(gt,{live:e.live,status:e.status}),(0,K.jsx)(`span`,{className:`conv-name`,children:e.firstPrompt}),(0,K.jsxs)(`span`,{className:`conv-agent-badge`,"data-kind":e.agentLabel?`specialist`:`admin`,title:n,"aria-label":n,children:[(0,K.jsx)(r,{size:12,className:`conv-agent-icon`,"aria-label":n}),(0,K.jsx)(`span`,{className:`conv-agent-label`,children:n})]})]}),(0,K.jsx)(`span`,{className:`conv-timestamp`,children:st(e.updatedAt,ve)})]}),e.live?(0,K.jsxs)(K.Fragment,{children:[e.url!==null&&(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`Open in new tab`,"aria-label":`Open in new tab`,onClick:()=>_t(e.url,e.sessionId),children:(0,K.jsx)(O,{size:13})}),(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`End session`,"aria-label":`End session`,onClick:()=>void We(e.sessionId),children:(0,K.jsx)(he,{size:13})})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`Resume session`,"aria-label":`Resume session`,onClick:()=>void He(e.sessionId),disabled:Q.inFlight===`resume`,children:(0,K.jsx)(l,{size:13})}),(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`Purge JSONL`,"aria-label":`Purge JSONL`,onClick:()=>{P(null),M({sessionId:e.sessionId,displayName:e.firstPrompt})},children:(0,K.jsx)(a,{size:13})})]})]},e.sessionId)})]}),U===`artefacts`&&(0,K.jsxs)(K.Fragment,{children:[Se&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:Se}),xe&&!Se&&W.length===0&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No artefacts yet`}),W.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`conv`,onClick:()=>{b({docId:e.id,name:e.name,content:e.content,editable:e.editable,mimeType:e.mimeType,skipReason:e.skipReason},`sidebar-artefacts`),T()},children:[(0,K.jsx)(`span`,{className:`conv-name`,children:e.name}),(0,K.jsx)(`span`,{className:`conv-kind`,"data-kind":e.kind===`agent-template`?`agent`:`doc`,children:e.kind===`agent-template`?`agent`:`doc`})]},e.id))]})]}),(0,K.jsxs)(`div`,{className:`side-foot`,children:[(0,K.jsx)(`div`,{className:`avatar`,children:f?(0,K.jsx)(`img`,{src:f,alt:de}):fe}),(0,K.jsxs)(`div`,{className:`who`,children:[(0,K.jsx)(`span`,{className:`name`,children:de}),(0,K.jsx)(`span`,{className:`role`,children:u??`operator`})]})]}),oe&&(0,K.jsx)(ft,{seedMode:z,submitting:R,error:ae,onSubmit:e=>void Ve(e),onCancel:Be,onErrorClear:()=>B(null)}),j&&(0,K.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`purge-confirm-title`,className:`modal-overlay`,onClick:e=>{e.target===e.currentTarget&&!F&&M(null)},children:(0,K.jsxs)(`div`,{className:`modal-card`,children:[(0,K.jsx)(`h3`,{id:`purge-confirm-title`,style:{margin:0,marginBottom:8,fontSize:16,fontWeight:600},children:`Purge session JSONL?`}),(0,K.jsxs)(`p`,{style:{margin:0,marginBottom:8,fontSize:13},children:[`This hard-deletes the transcript for `,(0,K.jsx)(`strong`,{children:j.displayName??j.sessionId.slice(0,8)}),`. The action cannot be undone.`]}),N&&(0,K.jsx)(`p`,{style:{margin:0,marginBottom:8,fontSize:12,color:`var(--text-tertiary)`},children:N}),(0,K.jsxs)(`div`,{className:`modal-action-row`,children:[(0,K.jsx)(`button`,{type:`button`,className:`modal-action-btn`,disabled:F,onClick:()=>M(null),children:`Cancel`}),(0,K.jsx)(`button`,{type:`button`,className:`modal-action-btn`,"data-variant":`danger`,disabled:F,onClick:()=>void Ue(j.sessionId),children:F?(0,K.jsx)(L,{size:13,className:`spinning`}):`Purge`})]})]})})]})}),mt=[{value:`active`,label:`Active`},{value:`archived`,label:`Archived`},{value:`all`,label:`All`}];function ht(e){let{view:t,setView:n,connected:r,reconnectNow:i}=e;return(0,K.jsx)(`div`,{className:`session-view-controls`,children:(0,K.jsxs)(`div`,{className:`session-view-segmented`,role:`tablist`,"aria-label":`Session view`,children:[mt.map(e=>(0,K.jsx)(`button`,{type:`button`,role:`tab`,className:`session-view-tab${t===e.value?` active`:``}`,"aria-selected":t===e.value,onClick:()=>n(e.value),children:e.label},e.value)),r?(0,K.jsx)(`span`,{className:`session-view-connection connected`,"aria-label":`Live updates connected.`,title:`Live updates connected.`}):(0,K.jsx)(`button`,{type:`button`,className:`session-view-connection disconnected`,"aria-label":`Live updates paused. Click to retry.`,title:`Live updates paused. Click to retry.`,onClick:i})]})})}function gt({live:e,status:t}){return e?t===`busy`?(0,K.jsxs)(`span`,{className:`session-status session-status-busy`,"aria-label":`session busy`,children:[(0,K.jsx)(`span`,{className:`session-status-dot`}),(0,K.jsx)(`span`,{className:`session-status-dot`}),(0,K.jsx)(`span`,{className:`session-status-dot`})]}):(0,K.jsx)(`span`,{className:`session-status session-status-idle`,"aria-label":`session idle`}):(0,K.jsx)(`span`,{className:`session-status session-status-archived`,"aria-label":`session archived`})}function _t(e,t){let n=t.slice(0,8),r=window.open(e,`_blank`,`noopener,noreferrer`)===null?`blocked`:`ok`;console.info(`[admin-ui] sidebar-open-in-new-tab outcome=${r} sessionId=${n}`)}function vt(){(0,G.useEffect)(()=>{function e(e){e.data?.type===`vnc-clipboard`&&typeof e.data.text==`string`&&u(e.data.text)}window.addEventListener(`message`,e);let t=null;return typeof BroadcastChannel<`u`&&(t=new BroadcastChannel(`maxy-vnc-clipboard`),t.onmessage=e=>{typeof e.data==`string`&&u(e.data)}),()=>{window.removeEventListener(`message`,e),t?.close()}},[])}function yt({handlePopout:e,disabled:t=!1}){let n=(0,G.useCallback)(()=>{delete document.body.dataset.dragPopoutActive},[]);(0,G.useEffect)(()=>()=>n(),[n]);let r=(0,G.useCallback)(e=>{if(t){e.preventDefault();return}let n=e.target;if(n.closest(`.editor-base__actions`)||n.closest(`.browser-viewer__actions`)){e.preventDefault();return}if(!document.querySelector(`.chat-messages`)){e.preventDefault();return}e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,``),document.body.dataset.dragPopoutActive=`true`},[t,n]),i=(0,G.useCallback)(t=>{if(n(),t.clientX===0&&t.clientY===0)return;let r=document.querySelector(`.chat-messages`);if(!r)return;let i=r.getBoundingClientRect();(t.clientX<i.left||t.clientX>i.right||t.clientY<i.top||t.clientY>i.bottom)&&e()},[e,n]);return t?{draggable:!1,onDragStart:()=>{},onDragEnd:()=>{}}:{draggable:!0,onDragStart:r,onDragEnd:i}}function bt(e){(0,G.useEffect)(()=>{let t=Date.now(),r=`/api/admin/browser-iframe/event`,i={brand:n.productName,surface:e};return fetch(r,{method:`POST`,credentials:`same-origin`,headers:{"Content-Type":`application/json`},body:JSON.stringify({event:`mount`,...i}),keepalive:!0}).catch(()=>{}),()=>{let e=JSON.stringify({event:`unmount`,durationMs:Date.now()-t,...i});try{let t=new Blob([e],{type:`application/json`});navigator.sendBeacon(r,t)||fetch(r,{method:`POST`,credentials:`same-origin`,headers:{"Content-Type":`application/json`},body:e,keepalive:!0}).catch(()=>{})}catch{}}},[e])}var xt=`maxy-vnc-overlay-popout`;function St(e){let[t,r]=(0,G.useState)(!1),i=(0,G.useRef)(null),a=(0,G.useRef)(null),o=(0,G.useCallback)(()=>{a.current&&=(clearInterval(a.current),null),i.current&&!i.current.closed&&i.current.close(),i.current=null,r(!1)},[]),s=(0,G.useCallback)(()=>{let t=`/vnc-popout.html?title=${encodeURIComponent(n.productName)}`,s=window.open(t,xt,`width=1024,height=768`);s&&(i.current=s,r(!0),a.current=setInterval(()=>{i.current?.closed&&(o(),e?.())},500))},[o,e]);return(0,G.useEffect)(()=>()=>o(),[o]),{poppedOut:t,popout:s,cleanupPopout:o}}var Ct=(0,G.forwardRef)(function({onClose:e},t){vt(),bt(`overlay`);let{poppedOut:r,popout:i,cleanupPopout:a}=St(e);return(0,G.useImperativeHandle)(t,()=>({popout:i}),[i]),r?(0,K.jsxs)(`div`,{className:`browser-overlay-popout`,children:[(0,K.jsx)(c,{className:`browser-viewer__icon`}),(0,K.jsx)(`span`,{className:`browser-viewer__title`,children:n.productName}),(0,K.jsx)(`span`,{className:`browser-viewer__popout-label`,children:`Popped out`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:B,onClick:()=>a(),"aria-label":`Pop back in`}),e&&(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:W,onClick:()=>{a(),e()},"aria-label":`Close`})]}):(0,K.jsx)(`iframe`,{src:`/vnc-viewer.html`,className:`browser-surface__iframe`,title:n.productName})});function wt({onClose:e}){vt(),bt(`overlay`);let{poppedOut:t,popout:r,cleanupPopout:i}=St(e),a=(0,G.useCallback)(()=>{i(),e()},[i,e]);(0,G.useEffect)(()=>{if(t)return;let e=e=>{e.key===`Escape`&&a()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,a]);let o=yt({handlePopout:r,disabled:t});return t?(0,K.jsxs)(`div`,{className:`browser-overlay-popout`,children:[(0,K.jsx)(c,{className:`browser-viewer__icon`}),(0,K.jsx)(`span`,{className:`browser-viewer__title`,children:n.productName}),(0,K.jsx)(`span`,{className:`browser-viewer__popout-label`,children:`Popped out`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:B,onClick:()=>{i()},"aria-label":`Pop back in`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:W,onClick:a,"aria-label":`Close`})]}):(0,K.jsxs)(`div`,{className:`browser-viewer-fullscreen`,children:[(0,K.jsxs)(`div`,{className:`browser-viewer-fullscreen__bar`,...o,children:[(0,K.jsx)(c,{className:`browser-viewer__icon`}),(0,K.jsx)(`span`,{className:`browser-viewer-fullscreen__title`,children:n.productName}),(0,K.jsxs)(`div`,{className:`browser-viewer-fullscreen__actions`,children:[(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:O,onClick:r,"aria-label":`Pop out`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:W,onClick:a,"aria-label":`Close`})]})]}),(0,K.jsx)(`iframe`,{src:`/vnc-viewer.html`,className:`browser-viewer-fullscreen__iframe`,title:n.productName})]})}function Tt(e){return e.map(e=>[e.sessionId,e.displayName,e.lastMessageAt,e.status])}function Et(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r[0]!==i[0]||r[1]!==i[1]||r[2]!==i[2]||r[3]!==i[3])return!1}return!0}function Dt(e){let[t,n]=(0,G.useState)([]),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),l=(0,G.useRef)([]),u=(0,G.useCallback)(async t=>{if(!e||!t&&s===e)return null;i(!0),o(null);try{let t=await fetch(`/api/admin/claude-sessions?session_key=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`claude-sessions fetch returned ${t.status}`);let r=await t.json(),i=Array.isArray(r)?r:r.sessions??[],a=Tt(i),o=Et(l.current,a);return o||(n(i),l.current=a),c(e),console.info(`[admin-ui] sessions-poll outcome=${o?`unchanged`:`changed`} count=${i.length} cacheKey=${e.slice(0,8)}`),i}catch(t){return console.info(`[admin-ui] sessions-poll outcome=error count=0 cacheKey=${e.slice(0,8)}`),console.error(`[admin/claude-sessions] fetch failed:`,t),o(t instanceof Error?t.message:String(t)),null}finally{i(!1)}},[e,s]);(0,G.useEffect)(()=>{e||(c(null),n([]),o(null),l.current=[])},[e]);let d=(0,G.useCallback)(()=>u(!1),[u]),f=(0,G.useCallback)(()=>u(!0),[u]);return{sessions:t,setSessions:n,loading:r,loaded:s!==null&&s===e,error:a,ensureLoaded:d,refetch:f}}var Ot=`admin-sidebar-collapsed`,kt=`admin-sidebar-drawer-open`;function At(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(Ot)===`1`}catch{return!1}}function jt(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(Ot,`1`):window.sessionStorage.removeItem(Ot)}catch{}}function Mt(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(kt)===`1`}catch{return!1}}function Nt(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(kt,`1`):window.sessionStorage.removeItem(kt)}catch{}}var Pt=720;function Ft(e){let{cacheKey:t,businessName:n,onLaunchBrowser:r,onLogout:i,browserLaunching:a,userName:o,userAvatar:s,role:c,selectedSessionId:l,onSelectSession:u,onSelectArtefact:d,dataArtefact:f=`closed`,children:p,footer:m}=e,[h,g]=(0,G.useState)(()=>At()),[_,v]=(0,G.useState)(()=>Mt()),[y,b]=(0,G.useState)(()=>typeof window<`u`&&window.matchMedia(`(max-width: ${Pt}px)`).matches);(0,G.useEffect)(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: ${Pt}px)`),t=e=>b(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let x=(0,G.useCallback)(e=>{jt(e),g(e)},[]),S=(0,G.useCallback)(e=>{Nt(e),v(e)},[]);(0,G.useEffect)(()=>{if(typeof window>`u`)return;let e=window.location?.pathname??``;console.info(`[admin-ui] shell-mount route=${e} collapsed=${h} drawer=${_}`)},[]);let C=y?_:!h,w=(0,G.useCallback)(()=>{if(!(typeof window>`u`))if(window.matchMedia(`(max-width: ${Pt}px)`).matches){let e=_;console.info(`[admin-ui] header-sidebar-toggle from=${e?`open`:`closed`} mode=drawer`),S(!e)}else{let e=h;console.info(`[admin-ui] header-sidebar-toggle from=${e?`closed`:`open`} mode=collapse`),x(!e)}},[h,_,x,S]),T=(0,G.useCallback)(e=>{console.info(`[admin-ui] header-menu-nav target=${e}`),window.location.href=e===`data`?`/data`:`/graph`},[]),[E,D]=(0,G.useState)(!1),[O,k]=(0,G.useState)(!1),ee=(0,G.useCallback)(async()=>{if(E)return;D(!0);let e=typeof window<`u`?window.location?.pathname??``:``,t=`n/a`;try{let n=await fetch(`/api/admin/browser/launch`,{method:`POST`});t=n.status;let r=await n.json().catch(()=>({ok:!1,error:`Invalid response`}));if(!r.ok)throw Error(r.error??`Failed to launch browser`);k(!0),console.info(`[admin-ui] header-menu-browser-launch outcome=ok source=shell-overlay route=${e} httpStatus=${t}`)}catch(n){console.error(`[admin-ui] header-menu-browser-launch outcome=error source=shell-overlay route=${e} httpStatus=${t} error="${n instanceof Error?n.message:String(n)}"`),window.alert(n instanceof Error?n.message:`Failed to launch browser`)}finally{D(!1)}},[E]),A=a??E,j=Dt(t),M=Ze(t),N=(0,G.useMemo)(()=>M.rows.map(e=>e.sessionId),[M.rows]),P=(0,G.useCallback)(e=>{if(u){u(e);return}window.location.assign(`/?sessionId=${encodeURIComponent(e)}`)},[u]),F=(0,G.useCallback)(e=>{d&&d(e)},[d]),I={collapsed:h,mobileDrawerOpen:_,sidebarOpen:C,onToggleSidebar:w,setMobileDrawerOpen:S,sessionsState:j,sessionRowIds:N,sessionRowsConnected:M.connected};return(0,K.jsxs)(`div`,{className:`admin-shell admin-page admin-shell-root`,children:[(0,K.jsx)(Z,{businessName:n,onLaunchBrowser:r??ee,onNavigate:T,onToggleSidebar:w,sidebarOpen:C,onLogout:i,browserLaunching:A}),(0,K.jsxs)(`div`,{className:`platform${_?` menu-open`:``}${h?` sidebar-collapsed`:``}`,"data-artefact":f,children:[(0,K.jsx)(pt,{businessName:n,cacheKey:t,role:c??null,userName:o,userAvatar:s??null,sessions:j.sessions,sessionsLoading:j.loading,sessionsError:j.error,ensureSessionsLoaded:j.ensureLoaded,refetchSessions:j.refetch,onSelectArtefact:F,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:()=>S(!1),onSelectSession:P,selectedSessionId:l??null,collapsed:h,mobileDrawerOpen:_,recentsActions:{setSessions:j.setSessions,refetch:j.refetch}}),typeof p==`function`?p(I):p]}),_&&(0,K.jsx)(`div`,{className:`sidebar-backdrop menu-open`,"aria-hidden":`true`,onClick:()=>S(!1)}),O&&(0,K.jsx)(wt,{onClose:()=>k(!1)}),m]})}var It={LocalBusiness:`#4F6B8A`,Service:`#6B85A0`,PriceSpecification:`#8AA0B8`,OpeningHoursSpecification:`#A8BACE`,Organization:`#8A6B47`,Person:`#B86E4A`,UserProfile:`#D08960`,Preference:`#DFA67A`,AdminUser:`#8C5230`,AccessGrant:`#66381F`,KnowledgeDocument:`#6E8A5A`,ConversationArchive:`#82A06A`,Section:`#8AA876`,Chunk:`#A6C194`,DigitalDocument:`#5A7548`,CreativeWork:`#B5C9A2`,Question:`#C7D6B5`,FAQPage:`#95B385`,DefinedTerm:`#76906A`,Review:`#3F5A2E`,ImageObject:`#A0BB8C`,Conversation:`#6B5A85`,AdminConversation:`#4F4070`,PublicConversation:`#8A75A8`,Message:`#6B7280`,UserMessage:`#DFA67A`,AssistantMessage:`#C9A876`,ToolCall:`#B5ABCB`,Task:`#B0617A`,Project:`#8E4A60`,Event:`#C68095`,Workflow:`#3A6F77`,WorkflowStep:`#5A8E96`,WorkflowRun:`#7AAAB2`,StepResult:`#9CC4CB`,Email:`#6F7F4A`,EmailAccount:`#91A063`,Agent:`#B8893D`},Lt=`#94A3B8`;Object.freeze(Object.keys(It)),Object.freeze(new Set([`Chunk`,`GraphPreference`]));var Rt=Object.freeze(new Set(`LocalBusiness.Service.PriceSpecification.OpeningHoursSpecification.Organization.Person.UserProfile.Preference.AdminUser.AccessGrant.KnowledgeDocument.DigitalDocument.CreativeWork.Question.FAQPage.DefinedTerm.Review.ImageObject.AdminConversation.PublicConversation.Task.Project.Event.Workflow.Email.EmailAccount.Agent`.split(`.`)));Object.freeze(new Set([`ToolCall`,`StepResult`,`WorkflowStep`,`WorkflowRun`])),Object.freeze(new Set([`HAS_TOOL_CALL`,`RUN_OF`,`HAS_STEP`,`HAS_RESULT`]));function zt(e){for(let t=1;t<e.length;t++)if(Object.prototype.hasOwnProperty.call(It,e[t]))return e[t];return e[0]??null}function Bt(e){return It[e]??`#94A3B8`}function Vt(e){let t=zt(e),n=t?Bt(t):Lt,r=0;for(let t=1;t<e.length;t++)Object.prototype.hasOwnProperty.call(It,e[t])&&r++;return{displayLabel:t,colour:n,driftCandidates:r}}export{E as C,O as S,ue as _,Ft as a,L as b,yt as c,ke as d,Ce as f,fe as g,H as h,Vt as i,We as l,he as m,Bt as n,wt as o,W as p,zt as r,Ct as s,Rt as t,Ne as u,le as v,P as x,B as y};
|
|
1
|
+
import{o as e}from"./chunk-DD-I1_y5.js";import{_ as t,a as n,c as r,d as i,f as a,g as o,h as s,m as c,p as l,r as u,t as d,u as f,v as p,x as m}from"./ChatInput-AR8ym-HW.js";var h=p(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),g=p(`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`}]]),_=p(`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`}]]),v=p(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),y=p(`briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),b=p(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),x=p(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),S=p(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),C=p(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),w=p(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),T=p(`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`}]]),E=p(`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`}]]),D=p(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),O=p(`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`}]]),k=p(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),ee=p(`folder-kanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),A=p(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),j=p(`graduation-cap`,[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]),M=p(`handshake`,[[`path`,{d:`m11 17 2 2a1 1 0 1 0 3-3`,key:`efffak`}],[`path`,{d:`m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4`,key:`9pr0kb`}],[`path`,{d:`m21 3 1 11h-2`,key:`1tisrp`}],[`path`,{d:`M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3`,key:`1uvwmv`}],[`path`,{d:`M3 4h8`,key:`1ep09j`}]]),N=p(`headset`,[[`path`,{d:`M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z`,key:`12oyoe`}],[`path`,{d:`M21 16v2a4 4 0 0 1-4 4h-5`,key:`1x7m43`}]]),P=p(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),F=p(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),I=p(`linkedin`,[[`path`,{d:`M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z`,key:`c2jq9f`}],[`rect`,{width:`4`,height:`12`,x:`2`,y:`9`,key:`mk3on5`}],[`circle`,{cx:`4`,cy:`4`,r:`2`,key:`bt5ra8`}]]),te=p(`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`}]]),L=p(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ne=p(`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`}]]),R=p(`magnet`,[[`path`,{d:`m12 15 4 4`,key:`lnac28`}],[`path`,{d:`M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282z`,key:`nlhkjb`}],[`path`,{d:`m5 8 4 4`,key:`j6kj7e`}]]),re=p(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),z=p(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),ie=p(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),ae=p(`microscope`,[[`path`,{d:`M6 18h8`,key:`1borvv`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M14 22a7 7 0 1 0 0-14h-1`,key:`1jwaiy`}],[`path`,{d:`M9 14h2`,key:`197e7h`}],[`path`,{d:`M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z`,key:`1bmzmy`}],[`path`,{d:`M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3`,key:`1drr47`}]]),B=p(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),oe=p(`newspaper`,[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]),se=p(`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`}]]),V=p(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),ce=p(`pen-tool`,[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]),le=p(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ue=p(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),de=p(`repeat`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]),fe=p(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),pe=p(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),H=p(`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`}]]),me=p(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),he=p(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ge=p(`store`,[[`path`,{d:`M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5`,key:`slp6dd`}],[`path`,{d:`M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244`,key:`o0xfot`}],[`path`,{d:`M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05`,key:`wn3emo`}]]),_e=p(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ve=p(`trophy`,[[`path`,{d:`M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978`,key:`1n3hpd`}],[`path`,{d:`M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978`,key:`rfe1zi`}],[`path`,{d:`M18 9h1.5a1 1 0 0 0 0-5H18`,key:`7xy6bh`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6 9H4.5a1 1 0 0 1 0-5H6`,key:`tex48p`}]]),U=p(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),ye=p(`user-check`,[[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),be=p(`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`}]]),W=p(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),G=e(m(),1),K=i(),q=`maxy-shell-side-px`;function xe(){if(typeof window>`u`)return 0;let e=document.querySelector(`.platform > .artefact`)?.getBoundingClientRect();return e&&e.width>0?Math.round(e.width):0}function J(e){if(typeof window>`u`)return e;let t=window.innerWidth,n=Math.max(248,t-480-xe());return Math.min(Math.max(e,248),n)}function Se(){if(typeof window>`u`)return 264;try{let e=window.localStorage.getItem(q);if(!e)return 264;let t=parseInt(e,10);if(Number.isFinite(t)&&t>=248)return J(t)}catch{}return 264}function Ce({targetSelector:e=`.platform`}){let t=(0,G.useRef)(null),[n,r]=(0,G.useState)(()=>Se()),i=(0,G.useRef)(n);(0,G.useEffect)(()=>{let t=document.querySelector(e);!t||!(t instanceof HTMLElement)||(t.style.setProperty(`--side-px`,`${n}px`),i.current=n)},[n,e]);let a=(0,G.useCallback)(()=>{r(e=>{let t=J(e);return t===e?e:t})},[]);(0,G.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(J(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(q,String(t))}catch{}console.info(`[admin-ui] sidebar-resize px=${t}`)};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s)},s=()=>{let e=J(264);r(e);try{window.localStorage.removeItem(q)}catch{}console.info(`[admin-ui] sidebar-resize px=${e}`)};return(0,K.jsx)(`div`,{ref:t,className:`side-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,onPointerDown:o,onDoubleClick:s})}var we=!1;function Te(){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function Y(){let e=typeof crypto<`u`&&typeof crypto.randomUUID==`function`;if(!we){we=!0;let t=typeof window<`u`&&`isSecureContext`in window?window.isSecureContext:!1;console.info(`[idempotency] uuid-source=${e?`native`:`getRandomValues`} secureContext=${t}`)}return e?crypto.randomUUID():Te()}function X(e,t,n,r){let i=e===`pane`?`pane-action`:`sidebar-${t}`;console.info(`[admin-ui] ${i} sessionId=${n.slice(0,8)} action=${t} outcome=${r}`)}var Ee=/session_([A-Za-z0-9_-]+)/;function De(e){if(!e)return null;let t=e.match(Ee);return t?t[1]:null}async function Oe(e,t,n,r,i){let a=De(r)??`unknown`,o=e=>e.slice(0,8),s=t===`pane`?`pane-action action=resume-archive`:`sidebar-resume-archive`,c;try{let t=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(n)}/archive?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({mode:`archive`})});c=t.ok?`ok`:t.status===409?`409`:`error`;let r=`[admin-ui] ${s} sourceSessionId=${o(n)} newSessionId=${o(a)} result=${c}`;c===`error`?console.error(r):console.info(r)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[admin-ui] ${s} sourceSessionId=${o(n)} newSessionId=${o(a)} result=error detail=${t}`)}finally{i.refetch()}}function ke(e,t,n=`pane`){let[r,i]=(0,G.useState)(null),a=(0,G.useRef)(!1),o=(0,G.useCallback)(async r=>{if(!e)return{ok:!1,error:`no-cache-key`};if(a.current)return X(n,`resume`,r,`skipped-in-flight`),{ok:!1,error:`in-flight`};a.current=!0,i(`resume`);let o=Y();try{let i=await fetch(`/api/admin/claude-sessions/resume?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({sessionId:r,channel:`browser`,idempotencyKey:o})}),a=await i.json();if(!i.ok||!(`sessionId`in a)){let e=a.error??`POST returned ${i.status}`;return X(n,`resume`,r,String(i.status)),{ok:!1,error:e}}return t.setSessions(e=>[a,...e.filter(e=>e.sessionId!==r)]),X(n,`resume`,r,`200`),Oe(e,n,r,a.url,t),{ok:!0}}catch(e){let i=e instanceof Error?e.message:String(e);return X(n,`resume`,r,`threw`),t.refetch(),{ok:!1,error:i}}finally{a.current=!1,i(null)}},[e,t,n]),s=(0,G.useCallback)(async r=>{if(!e)return{ok:!1,error:`no-cache-key`};i(`end`);try{let i=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(r)}/stop?session_key=${encodeURIComponent(e)}`,{method:`POST`});if(!i.ok){let e=await i.text().catch(()=>``);return X(n,`end`,r,String(i.status)),t.refetch(),{ok:!1,error:`POST /stop ${i.status} ${e.slice(0,200)}`}}return X(n,`end`,r,`204`),t.refetch(),{ok:!0}}catch(e){let i=e instanceof Error?e.message:String(e);return X(n,`end`,r,`threw`),t.refetch(),{ok:!1,error:i}}finally{i(null)}},[e,t,n]),c=(0,G.useCallback)(async r=>{if(!e)return{ok:!1,error:`no-cache-key`};i(`purge`);try{let i=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(r)}?purge=1&session_key=${encodeURIComponent(e)}`,{method:`DELETE`});if(!i.ok){let e=await i.json().catch(()=>({})),t=e.detail||e.error||`DELETE ?purge=1 ${i.status}`;return X(n,`purge`,r,String(i.status)),{ok:!1,error:t}}return t.setSessions(e=>e.filter(e=>e.sessionId!==r)),X(n,`purge`,r,`200`),t.refetch(),{ok:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return X(n,`purge`,r,`threw`),{ok:!1,error:t}}finally{i(null)}},[e,t,n]),l=(0,G.useCallback)(async(r,a)=>{if(!e)return{ok:!1,error:`no-cache-key`};i(a);try{let i=await fetch(`/api/admin/claude-sessions/${encodeURIComponent(r)}/archive?session_key=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({mode:a})});if(!i.ok){let e=await i.json().catch(()=>({})),t=e.detail||e.error||`POST /archive ${i.status}`;return X(n,a,r,String(i.status)),{ok:!1,error:t}}return a===`archive`&&t.setSessions(e=>e.filter(e=>e.sessionId!==r)),t.refetch(),X(n,a,r,`200`),{ok:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return X(n,a,r,`threw`),{ok:!1,error:t}}finally{i(null)}},[e,t,n]);return{inFlight:r,resume:o,end:s,purge:c,archive:(0,G.useCallback)(e=>l(e,`archive`),[l]),unarchive:(0,G.useCallback)(e=>l(e,`unarchive`),[l])}}function Ae(e){return`code.session.pinned.${e}`}function je(e){if(typeof window>`u`)return new Set;try{let t=window.localStorage.getItem(Ae(e));if(!t)return new Set;let n=JSON.parse(t);return Array.isArray(n)?new Set(n.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function Me(e,t){if(!(typeof window>`u`))try{window.localStorage.setItem(Ae(e),JSON.stringify([...t]))}catch{}}function Ne(e){let[t,n]=(0,G.useState)(()=>je(e));(0,G.useEffect)(()=>{n(je(e))},[e]);let r=(0,G.useCallback)(t=>{n(n=>{let r=new Set(n);return r.has(t)?r.delete(t):r.add(t),Me(e,r),r})},[e]);return{pinned:t,isPinned:(0,G.useCallback)(e=>t.has(e),[t]),togglePin:r}}function Z(e){let{businessName:i,onLaunchBrowser:o,onNavigate:s,onToggleSidebar:l,sidebarOpen:u,onLogout:d,browserLaunching:f}=e,[p,m]=(0,G.useState)(!1),h=(0,G.useRef)(null),g=(0,G.useRef)(null),[_,v]=(0,G.useState)(null),[y,b]=(0,G.useState)(!1),[x,S]=(0,G.useState)(null),[C,w]=(0,G.useState)(null),[T,D]=(0,G.useState)(null),[k,ee]=(0,G.useState)(``);(0,G.useEffect)(()=>{ee(window.location.hostname.startsWith(`admin.`)?window.location.origin.replace(`admin.`,`public.`):window.location.origin)},[]),(0,G.useEffect)(()=>{if(!p)return;let e=e=>{h.current&&!h.current.contains(e.target)&&m(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[p]),(0,G.useEffect)(()=>{if(!p)return;let e=e=>{e.key===`Escape`&&m(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[p]),(0,G.useEffect)(()=>{p&&g.current?.focus()},[p]),(0,G.useEffect)(()=>{if(!p)return;let e=!1;return fetch(`/api/admin/version`).then(e=>e.json()).then(t=>{e||D(t)}).catch(e=>{console.error(`[admin/version] menu-open client fetch failed:`,e)}),()=>{e=!0}},[p]);let A=(0,G.useCallback)(()=>{m(e=>{let t=!e;return t&&console.info(`[admin-ui] header-menu-open`),t})},[]),j=(0,G.useCallback)(()=>{m(!1),o()},[o]),M=(0,G.useCallback)(e=>{m(!1),s(e)},[s]),N=(0,G.useCallback)(async()=>{if(_!==null){v(null),w(null);return}b(!0),S(null);try{let e=await fetch(`/api/admin/agents`);if(!e.ok)throw Error(`Failed to load agents`);v((await e.json()).agents??[])}catch(e){console.error(`[admin/agents] list failed:`,e),S(e instanceof Error?e.message:String(e)),v([])}finally{b(!1)}},[_]),P=(0,G.useCallback)(e=>{w(null),v(t=>t?.filter(t=>t.slug!==e)??null),fetch(`/api/admin/agents/${encodeURIComponent(e)}`,{method:`DELETE`}).catch(e=>console.error(`[admin/agents] delete failed:`,e))},[]),I=(0,G.useCallback)(()=>{m(!1),d()},[d]),te=i||n.productName;return(0,K.jsxs)(`header`,{className:`admin-header`,children:[(0,K.jsx)(`button`,{type:`button`,className:`admin-sidebar-toggle`,"aria-label":u?`Hide sidebar`:`Show sidebar`,title:u?`Hide sidebar`:`Show sidebar`,"aria-expanded":u,onClick:l,children:u?(0,K.jsx)(se,{size:20,strokeWidth:1.5}):(0,K.jsx)(V,{size:20,strokeWidth:1.5})}),(0,K.jsxs)(`div`,{className:`chat-header-label`,children:[(0,K.jsx)(`span`,{className:`chat-logo-btn`,"aria-hidden":`true`,children:(0,K.jsx)(`img`,{src:r,alt:``,className:`chat-logo`})}),(0,K.jsx)(`h1`,{className:`chat-tagline`,children:te})]}),(0,K.jsxs)(`div`,{className:`chat-burger-wrap`,ref:h,children:[(0,K.jsx)(`button`,{type:`button`,className:`admin-burger`,onClick:A,"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":p,children:(0,K.jsx)(z,{size:20})}),p&&(0,K.jsxs)(`div`,{className:`admin-menu`,role:`menu`,children:[(0,K.jsxs)(`button`,{ref:g,type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:j,disabled:f,children:[(0,K.jsx)(c,{size:14}),` Browser`,f&&(0,K.jsx)(L,{size:12,className:`spin`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>M(`data`),children:[(0,K.jsx)(E,{size:14}),` Data`]}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>M(`graph`),children:[(0,K.jsx)(H,{size:14}),` Graph`]}),(0,K.jsx)(`div`,{className:`chat-menu-divider`}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:N,children:[(0,K.jsx)(O,{size:14}),` Public`,y&&(0,K.jsx)(L,{size:12,className:`spin`})]}),_!==null&&(0,K.jsxs)(`div`,{className:`chat-menu-agents`,children:[x&&(0,K.jsx)(`span`,{className:`chat-menu-agent-error`,children:x}),_.length===0&&!x&&(0,K.jsx)(`span`,{className:`chat-menu-agent-empty`,children:`No public agents configured`}),_.map(e=>(0,K.jsxs)(`div`,{className:`chat-menu-item chat-menu-agent-item`,children:[(0,K.jsx)(`span`,{className:`agent-status-dot ${e.status}`}),(0,K.jsxs)(`span`,{className:`agent-text`,children:[(0,K.jsx)(`span`,{className:`agent-display-name`,children:e.displayName}),(0,K.jsxs)(`span`,{className:`agent-slug`,children:[`/`,e.slug]})]}),C===e.slug?(0,K.jsxs)(`span`,{className:`agent-actions agent-confirm`,children:[(0,K.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-yes`,title:`Confirm delete`,onClick:()=>P(e.slug),children:(0,K.jsx)(t,{size:12})}),(0,K.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-no`,title:`Cancel`,onClick:()=>w(null),children:(0,K.jsx)(W,{size:12})})]}):(0,K.jsxs)(`span`,{className:`agent-actions`,children:[(0,K.jsx)(`a`,{href:`${k}/${e.slug}`,target:`_blank`,rel:`noopener noreferrer`,className:`agent-action-btn`,title:`Open agent`,onClick:()=>m(!1),children:(0,K.jsx)(O,{size:12})}),(0,K.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-delete-btn`,title:`Delete agent`,onClick:()=>w(e.slug),children:(0,K.jsx)(a,{size:12})})]})]},e.slug))]}),(0,K.jsx)(`div`,{className:`chat-menu-divider`}),(0,K.jsxs)(`div`,{className:`chat-menu-version chat-menu-version-passive`,children:[(0,K.jsx)(F,{size:14}),(0,K.jsxs)(`span`,{className:`version-installed`,children:[T?`v${T.installed}`:`…`,T&&!T.updateAvailable&&(0,K.jsx)(`span`,{className:`version-uptodate-dot`}),T?.updateAvailable&&(0,K.jsx)(`span`,{className:`version-update-dot`})]})]}),(0,K.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:I,children:[(0,K.jsx)(ne,{size:14}),` Log out`]})]})]})]})}var Pe=Object.freeze({admin:N,"business-assistant":y,cloudflare:w,contacts:be,"deep-research":fe,docs:s,email:re,"linkedin-import":I,memory:v,outlook:re,projects:ee,replicate:me,sales:D,scheduling:x,tasks:te,telegram:pe,waitlist:C,whatsapp:ie,workflows:A,teaching:j,"writer-craft":k,brochures:oe,"real-agent-buyers":ye,"real-agent-business":b,"real-agent-coaching":ve,"real-agent-leads":R,"real-agent-listings":P,"real-agent-loop":de,"real-agent-sales":M,"real-agent-teaching":j,"real-agent-vendors":ge,"content-producer":ce,"database-operator":E,librarian:h,"personal-assistant":U,"project-manager":S,"research-assistant":ae}),Fe=new Set;function Ie(e){return Pe[e]||(Fe.has(e)||(Fe.add(e),console.warn(`[admin-ui] sidebar-agent-icon-fallback label=${e}`)),g)}var Le=`maxy-admin-session`,Re=typeof BroadcastChannel<`u`;function ze(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`rotation`&&typeof t.newKey==`string`&&t.newKey.length>0&&(t.surface===`chat`||t.surface===`graph`||t.surface===`data`||t.surface===`sessions`)&&typeof t.ts==`number`}function Be(e){if(!Re)return()=>{};let t=new BroadcastChannel(Le),n=t=>{if(!ze(t.data)){console.warn(`[admin-session-broadcast] outcome=received-malformed payload=${JSON.stringify(t.data)}`);return}e(t.data)};return t.addEventListener(`message`,n),()=>{t.removeEventListener(`message`,n),t.close()}}var Ve=`maxy-admin-session-key`;function Q(e,t){return`${e}${e.includes(`?`)?`&`:`?`}session_key=${encodeURIComponent(t)}`}async function He(e){let t;try{t=await e.clone().json()}catch{return`parse-failed`}if(typeof t!=`object`||!t)return`unknown-401`;let n=t.code;return n===`session-missing`||n===`session-not-registered`||n===`session-expired-age`||n===`grant-expired`?n:`unknown-401`}function Ue(){try{return sessionStorage.getItem(Ve)}catch{return null}}function We(e){let{initialCacheKey:t,surface:n}=e,[r,i]=(0,G.useState)(t),a=(0,G.useRef)(t);(0,G.useEffect)(()=>{a.current=r},[r]),(0,G.useEffect)(()=>{t!==a.current&&(i(t),a.current=t,s(e=>e+1))},[t]);let[o,s]=(0,G.useState)(0),[c,l]=(0,G.useState)(null);(0,G.useEffect)(()=>Be(e=>{let t=a.current.slice(0,8),r=e.newKey.slice(0,8);e.newKey!==a.current&&(console.log(`[admin-session-broadcast] outcome=received oldKey=${t} newKey=${r} surface=${n} senderSurface=${e.surface}`),i(e.newKey),s(e=>e+1),l(null))}),[n]);let u=(0,G.useCallback)(()=>{try{sessionStorage.removeItem(Ve)}catch{}window.location.href=`/`},[]);return{adminFetch:(0,G.useCallback)(async(e,t)=>{let r=a.current,o=Q(e,r),c=await fetch(o,t);if(c.status!==401)return c;let d=await He(c);if(d===`session-missing`)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=${d} surface=${n} path=${e}`),u(),c;if(d!==`session-not-registered`)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=${d} surface=${n} path=${e}`),l({message:`Your admin session has expired. Click to reload and sign in.`,reason:d}),c;let f=Ue();if(!f||f===r)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=session-not-registered-no-fresh-key surface=${n} path=${e}`),l({message:`Your admin session was renewed in another tab. Click to reload.`,reason:`session-not-registered`}),c;i(f),a.current=f,s(e=>e+1),console.log(`[useAdminFetch] outcome=retry-after-rotation oldKey=${r.slice(0,8)} newKey=${f.slice(0,8)} surface=${n} path=${e}`);let p=Q(e,f),m=await fetch(p,t);return m.status===401&&(console.warn(`[useAdminFetch] outcome=redirect-to-login reason=second-401-after-retry surface=${n} path=${e}`),l({message:`Your admin session has expired. Click to reload and sign in.`,reason:`session-not-registered`})),m},[u,n]),cacheKey:r,sessionRefetchNonce:o,banner:c,reloadToLogin:u}}var Ge=`/api/admin/claude-sessions/events`,Ke=`admin-session-list-view`,qe=`admin-session-list-include-subagents`,Je=`admin-session-list-include-background`;function Ye(e){return e===`active`||e===`archived`||e===`all`}function Xe(){let e={rows:[],view:`active`,includeBackground:!1,connected:!1},t=new Map,n=new Set,r=null,i=null,a=0,o=0,s=null,c=!1,l=!1;function u(){let n=[...t.values()].sort((e,t)=>t.updatedAt===e.updatedAt?e.sessionId<t.sessionId?-1:1:t.updatedAt-e.updatedAt);e={...e,rows:n}}function d(){for(let e of n)e()}function f(e,n){if(e===`row-removed`){let e=n?.sessionId;if(typeof e!=`string`||!t.delete(e))return;u(),d();return}let r=n;if(typeof r.sessionId!=`string`)return;let i={sessionId:r.sessionId,live:r.live===!0,status:r.status===`busy`?`busy`:r.status===`idle`?`idle`:`gone`,agentLabel:typeof r.agentLabel==`string`&&r.agentLabel.length>0?r.agentLabel:null,cwd:typeof r.cwd==`string`?r.cwd:null,firstPrompt:typeof r.firstPrompt==`string`&&r.firstPrompt.length>0?r.firstPrompt:null,updatedAt:typeof r.updatedAt==`number`?r.updatedAt:0,url:typeof r.url==`string`&&r.url.length>0?r.url:null};t.set(i.sessionId,i),u(),d()}function p(t){if(r&&s===t||(r&&=(r.close(),null),!t))return;s=t,c=!1,l=!1;let n=Q(Ge,t);try{r=new EventSource(n)}catch(e){console.error(`[admin-ui] session-row-store EventSource construct failed:`,e),h(`auto`);return}r.addEventListener(`open`,()=>{c=!0,a=0,e={...e,connected:!0},d(),console.info(`[admin-ui] session-row-store connected events-received=${o}`)});for(let e of[`row-created`,`row-updated`,`row-archived`,`row-removed`])r.addEventListener(e,t=>{o+=1;try{f(e,JSON.parse(t.data))}catch(t){console.error(`[admin-ui] session-row-store parse failed kind=${e}:`,t)}});r.addEventListener(`error`,()=>{r&&=(r.close(),null),e={...e,connected:!1},d(),!c&&!l&&(l=!0,m(n)),h(`auto`)})}async function m(e){let t=a+1,n=0,r=`unknown`;try{let t=await fetch(e,{method:`GET`});n=t.status,r=t.status>=400&&t.status<500?await He(t):`unknown`}catch(e){console.error(`[admin-ui] session-row-store sse-error-probe-failed:`,e);return}console.error(`[admin-ui] session-row-store sse-error status=${n} code=${r} attempt=${t}`)}function h(e){if(i)return;a+=1;let t=Math.min(1e3*2**Math.min(a,5),3e4);console.info(`[admin-ui] session-row-store reconnect trigger=${e} attempt=${a} delay-ms=${t}`),i=setTimeout(()=>{i=null,s&&p(s)},t)}function g(){i&&=(clearTimeout(i),null),a=0,r&&=(r.close(),null),console.info(`[admin-ui] session-row-store reconnect trigger=manual attempt=0 delay-ms=0`),s&&p(s)}function _(){if(!(typeof window>`u`))try{let t=window.localStorage.getItem(Ke);Ye(t)&&(e={...e,view:t});let n=window.localStorage.getItem(qe);if(n===null){let e=window.localStorage.getItem(Je);e!==null&&(window.localStorage.setItem(qe,e),window.localStorage.removeItem(Je),n=e,console.info(`[admin-ui] session-list-storage-migrated from=${Je} to=${qe} value=${e}`))}n===`1`&&(e={...e,includeBackground:!0})}catch{}}function v(t){e={...e,view:t};try{window.localStorage.setItem(Ke,t)}catch{}d()}function y(t){e={...e,includeBackground:t};try{window.localStorage.setItem(qe,t?`1`:`0`)}catch{}d()}function b(e){return n.add(e),()=>{n.delete(e)}}function x(){return e}function S(){r&&=(r.close(),null),i&&=(clearTimeout(i),null),s=null,e={...e,connected:!1}}function C(e,t){f(e,t)}function w(t){e={...e,connected:t},d()}function T(){t.clear(),u(),d()}function E(e){let n=new Set(e),r=0;for(let e of[...t.keys()])n.has(e)||(t.delete(e),r+=1);r!==0&&(console.info(`[admin-ui] session-row-store reconcile evicted=${r} kept=${t.size}`),u(),d())}return _(),{subscribe:b,getSnapshot:x,connect:p,disconnect:S,setView:v,setIncludeBackground:y,reconnectNow:g,reconcileFromList:E,_injectEventForTesting:C,_setConnectedForTesting:w,_clearRowsForTesting:T}}var $=Xe();$._injectEventForTesting,$.connect,$._setConnectedForTesting,$.getSnapshot,$.reconcileFromList;function Ze(e){let t=(0,G.useSyncExternalStore)($.subscribe,$.getSnapshot,$.getSnapshot);(0,G.useEffect)(()=>{e&&$.connect(e)},[e]);let n=(0,G.useCallback)(e=>$.setView(e),[]),r=(0,G.useCallback)(e=>$.setIncludeBackground(e),[]),i=(0,G.useCallback)(()=>$.reconnectNow(),[]),a=(0,G.useCallback)(e=>$.reconcileFromList(e),[]);return{rows:t.rows,view:t.view,includeBackground:t.includeBackground,connected:t.connected,setView:n,setIncludeBackground:r,reconnectNow:i,reconcileFromList:a}}function Qe(e,t,n){return e.filter(e=>!(t===`active`&&!e.live||t===`archived`&&e.live||!n&&e.agentLabel!==null&&e.agentLabel!==`admin`))}var $e=6e4,et=60*$e,tt=24*et,nt=$e,rt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],it=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function at(e){return e<10?`0${e}`:String(e)}function ot(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function st(e,t){if(!Number.isFinite(e)||e<=0||!Number.isFinite(t))return`—`;let n=t-e;if(n<-nt)return`—`;let r=n<0?0:n;if(r<$e)return`just now`;if(r<et)return`${Math.floor(r/$e)}m`;if(r<tt)return`${Math.floor(r/et)}h`;let i=new Date(t),a=new Date(e),o=Math.round((ot(i)-ot(a))/tt);if(o===1)return`yesterday`;if(o>=2&&o<=6)return it[a.getDay()];let s=at(a.getDate()),c=rt[a.getMonth()];return a.getFullYear()===i.getFullYear()?`${s} ${c}`:`${s} ${c} ${a.getFullYear()}`}function ct(e=3e4){let[t,n]=(0,G.useState)(()=>Date.now());return(0,G.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var lt={default:`Ask`,acceptEdits:`Accept edits`,plan:`Plan`,auto:`Auto`,bypassPermissions:`Bypass permissions`},ut=[`default`,`acceptEdits`,`plan`,`auto`,`bypassPermissions`],dt=[{value:void 0,label:`Default`},{value:`claude-opus-4-7`,label:`Opus 4.7`},{value:`claude-sonnet-4-6`,label:`Sonnet 4.6`},{value:`claude-haiku-4-5`,label:`Haiku 4.5`}];function ft({seedMode:e,submitting:n,error:r,onSubmit:i,onCancel:a,onErrorClear:s}){let[c,l]=(0,G.useState)(``),[u,f]=(0,G.useState)(e),[p,m]=(0,G.useState)(void 0),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(!1),y=(0,G.useRef)(null),b=(0,G.useRef)(null),x=(0,G.useRef)(null);(0,G.useEffect)(()=>{y.current?.focus()},[]),(0,G.useEffect)(()=>{function e(e){if(e.key===`Escape`){if(h){g(!1),e.stopPropagation();return}if(_){v(!1),e.stopPropagation();return}a(`esc`)}}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[h,_,a]),(0,G.useEffect)(()=>{if(!h&&!_)return;function e(e){h&&b.current&&!b.current.contains(e.target)&&g(!1),_&&x.current&&!x.current.contains(e.target)&&v(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[h,_]);let S=c.trim(),C=S.length>0&&!n,w=(0,G.useCallback)(()=>{S.length===0||n||i({message:c,permissionMode:u,model:p})},[c,u,p,S,n,i]);function E(e){e.preventDefault(),w()}let D=dt.find(e=>e.value===p)?.label??`Default`;return(0,K.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`new-session-modal-title`,className:`new-session-modal-overlay`,onClick:e=>{e.target===e.currentTarget&&a(`backdrop`)},children:(0,K.jsxs)(`div`,{className:`new-session-modal`,children:[(0,K.jsx)(`h2`,{id:`new-session-modal-title`,className:`new-session-modal-title`,children:`New session`}),(0,K.jsxs)(`form`,{className:`new-session-modal-form`,onSubmit:E,children:[(0,K.jsx)(`div`,{className:`chat-form`,children:(0,K.jsx)(d,{ref:y,value:c,onChange:e=>{l(e),r&&s()},placeholder:`What should this session do?`,disabled:n})}),r&&(0,K.jsx)(`div`,{className:`tunnel-route__error`,role:`alert`,children:r}),(0,K.jsxs)(`div`,{className:`new-session-modal-actions`,children:[(0,K.jsxs)(`div`,{className:`new-session-modal-pickers`,children:[(0,K.jsxs)(`div`,{className:`new-session-modal-picker-wrap`,ref:b,children:[(0,K.jsxs)(`button`,{type:`button`,className:`side-mode-trigger`,onClick:()=>{let e=!h;console.info(`[admin-ui] new-session-modal-mode-picker action=${e?`open`:`close`} current=${u}`),g(e)},disabled:n,"aria-haspopup":`menu`,"aria-expanded":h,"aria-label":`Permission mode for this session`,children:[lt[u],(0,K.jsx)(o,{size:12,"aria-hidden":`true`})]}),h&&(0,K.jsxs)(`div`,{className:`side-mode-popover`,role:`menu`,"aria-label":`Mode`,children:[(0,K.jsx)(`div`,{className:`side-mode-popover-head`,children:(0,K.jsx)(`span`,{children:`Mode`})}),ut.map((e,n)=>(0,K.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`side-mode-popover-item`,onClick:()=>{console.info(`[admin-ui] new-session-modal-mode-change from=${u} to=${e} trigger=click`),f(e),g(!1)},children:[(0,K.jsx)(`span`,{children:lt[e]}),(0,K.jsxs)(`span`,{className:`side-mode-popover-shortcut`,children:[e===u&&(0,K.jsx)(t,{size:12}),(0,K.jsx)(`span`,{children:n+1})]})]},e))]})]}),(0,K.jsxs)(`div`,{className:`new-session-modal-picker-wrap`,ref:x,children:[(0,K.jsxs)(`button`,{type:`button`,className:`side-mode-trigger`,onClick:()=>{let e=!_;console.info(`[admin-ui] new-session-modal-model-picker action=${e?`open`:`close`} current=${p??`default`}`),v(e)},disabled:n,"aria-haspopup":`menu`,"aria-expanded":_,"aria-label":`Model for this session`,children:[D,(0,K.jsx)(o,{size:12,"aria-hidden":`true`})]}),_&&(0,K.jsxs)(`div`,{className:`side-mode-popover`,role:`menu`,"aria-label":`Model`,children:[(0,K.jsx)(`div`,{className:`side-mode-popover-head`,children:(0,K.jsx)(`span`,{children:`Model`})}),dt.map(e=>(0,K.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`side-mode-popover-item`,onClick:()=>{console.info(`[admin-ui] new-session-modal-model-change from=${p??`default`} to=${e.value??`default`} trigger=click`),m(e.value),v(!1)},children:[(0,K.jsx)(`span`,{children:e.label}),(0,K.jsx)(`span`,{className:`side-mode-popover-shortcut`,children:e.value===p&&(0,K.jsx)(t,{size:12})})]},e.label))]})]})]}),(0,K.jsxs)(`div`,{className:`new-session-modal-buttons`,children:[(0,K.jsx)(`button`,{type:`button`,className:`modal-action-btn`,onClick:()=>a(`button`),disabled:n,children:`Cancel`}),(0,K.jsx)(`button`,{type:`submit`,className:`new-session-modal-submit`,disabled:!C,"aria-label":`Send`,children:n?(0,K.jsx)(L,{size:14,className:`spinning`}):(0,K.jsx)(T,{size:14})})]})]})]})]})})}var pt=(0,G.forwardRef)(function(e,r){let{businessName:i,cacheKey:c,role:u,userName:d,userAvatar:f,sessions:p,sessionsLoading:m,sessionsError:h,ensureSessionsLoaded:v,refetchSessions:y,onSelectArtefact:b,onSelectProjects:x,onSelectPeople:S,onSelectTasks:C,onSelectAgents:w,onCloseMobileDrawer:T,onSelectSession:E,selectedSessionId:D,collapsed:k,mobileDrawerOpen:ee,recentsActions:A}=e,[j,M]=(0,G.useState)(null),[N,P]=(0,G.useState)(null),[F,I]=(0,G.useState)(!1);(0,G.useEffect)(()=>{v()},[v]);let ne=(0,G.useRef)(null),[R,re]=(0,G.useState)(!1),[z,ie]=(0,G.useState)(`default`),[ae,B]=(0,G.useState)(null),[oe,se]=(0,G.useState)(!1),V=(0,G.useRef)(0),ce=n.productName,de=typeof d==`string`?d:d===null?`name unavailable`:i||ce,fe=(de.trim().charAt(0)||`?`).toUpperCase(),pe=Ne(n.hostname),H=Ze(c),me=(0,G.useMemo)(()=>{let e=Qe(H.rows,H.view,H.includeBackground);if(pe.pinned.size===0)return e;let t=[],n=[];for(let r of e)(pe.pinned.has(r.sessionId)?t:n).push(r);return[...t,...n]},[H.rows,H.view,H.includeBackground,pe.pinned]),ge=me.length,ve=ct(3e4),[U,ye]=(0,G.useState)(`chat`),[W,q]=(0,G.useState)([]),[xe,J]=(0,G.useState)(!1),[Se,Ce]=(0,G.useState)(null),[we,Te]=(0,G.useState)(!1);(0,G.useImperativeHandle)(r,()=>({patchArtefact(e,t){q(n=>n.map(n=>n.id===e?{...n,...t}:n))}}),[]);let[Y,X]=(0,G.useState)(!1),Ee=(0,G.useRef)(null),De={default:`Ask`,acceptEdits:`Accept edits`,plan:`Plan`,auto:`Auto`,bypassPermissions:`Bypass permissions`},Oe=[`default`,`acceptEdits`,`plan`,`auto`,`bypassPermissions`];(0,G.useEffect)(()=>{if(!Y)return;function e(e){Ee.current&&!Ee.current.contains(e.target)&&(console.info(`[admin-ui] sidebar-mode-picker action=close mode=${z}`),X(!1))}function t(e){if(e.key===`Escape`){console.info(`[admin-ui] sidebar-mode-picker action=close mode=${z}`),X(!1);return}let t=[`1`,`2`,`3`,`4`,`5`].indexOf(e.key);if(t>=0&&!e.metaKey&&!e.ctrlKey&&!e.altKey){let n=Oe[t];n&&(e.preventDefault(),console.info(`[admin-ui] sidebar-mode-picker action=select mode=${n} via=shortcut`),ie(n),X(!1))}}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[Y,z]),(0,G.useEffect)(()=>{function e(e){e.shiftKey&&(e.metaKey||e.ctrlKey)&&(e.key===`m`||e.key===`M`)&&(e.preventDefault(),X(e=>{let t=!e;return console.info(`[admin-ui] sidebar-mode-picker action=${t?`open`:`close`} mode=${z} via=shortcut`),t}))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[z]);let Ae=(0,G.useCallback)(async()=>{if(c){Te(!0),Ce(null);try{let e=await fetch(`/api/admin/sidebar-artefacts?session_key=${encodeURIComponent(c)}`);if(!e.ok)throw Error(`status ${e.status}`);q((await e.json()).artefacts??[]),J(!0)}catch(e){let t=e instanceof Error?e.message:String(e);Ce(`Failed to load artefacts: ${t}`),console.error(`[admin-ui] sidebar-artefacts fetch failed: ${t}`)}finally{Te(!1)}}},[c]),je=()=>{ye(`chat`),console.info(`[admin-ui] sidebar-nav surface=sessions count=${ge}`)},Me=()=>{ye(`artefacts`),console.info(`[admin-ui] sidebar-nav surface=artefacts count=${xe?W.length:0} collapsed=${k}`),xe||Ae()},Z=1.5,Pe=U===`chat`?`Sessions`:`Artefacts`,Fe=U===`chat`?m?`…`:String(ge):we?`…`:String(W.length),Le=U===`chat`?m:we,Re=()=>{console.info(`[admin-ui] sidebar-refresh surface=${U}`),U===`chat`?y().then(e=>{e!==null&&H.reconcileFromList(e.map(e=>e.sessionId))}):Ae()},ze=(0,G.useCallback)(()=>{if(R||!c){console.info(`[admin-ui] sidebar-new-session-click-ignored startingSession=${R} cacheKey=${c?`set`:`missing`}`);return}B(null),V.current=Date.now(),console.info(`[admin-ui] sidebar-new-session-modal-open seedMode=${z} cacheKey-prefix=${c.slice(0,8)}`),se(!0)},[c,R,z]),Be=(0,G.useCallback)(e=>{let t=V.current?Date.now()-V.current:0;console.info(`[admin-ui] sidebar-new-session-modal-cancel reason=${e} dwell-ms=${t}`),se(!1)},[]),Ve=(0,G.useCallback)(async e=>{if(R||!c)return;let t=V.current?Date.now()-V.current:0,n=Date.now();console.info(`[admin-ui] sidebar-new-session-modal-submit permissionMode=${e.permissionMode} model=${e.model??`default`} messageChars=${e.message.length} dwell-ms=${t}`),re(!0),B(null);try{console.info(`[admin-ui] sidebar-new-session-fetch-start permissionMode=${e.permissionMode} model=${e.model??`default`} messageChars=${e.message.length}`);let t={channel:`browser`,permissionMode:e.permissionMode,initialMessage:e.message};e.model!==void 0&&(t.model=e.model);let r=await fetch(`/api/admin/claude-sessions?session_key=${encodeURIComponent(c)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),i=Date.now()-n;console.info(`[admin-ui] sidebar-new-session-fetch-done status=${r.status} ok=${r.ok} ms=${i}`);let a=await r.json();if(!r.ok||!(`sessionId`in a)){let e=a,t=e.error??`POST returned ${r.status}`,i=e.reason?`${t}: ${e.reason}`:t;console.error(`[admin-ui] sidebar-new-session-failed status=${r.status} ms=${Date.now()-n} error=${t} reason=${e.reason??`none`} tail=${JSON.stringify(e.stderrTail??``)}`),B(i);return}console.info(`[admin-ui] sidebar-new-session-ok pid=${a.pid} sessionId=${a.sessionId.slice(0,8)} permissionMode=${e.permissionMode} model=${e.model??`default`} ms=${Date.now()-n}`),A.setSessions(e=>[a,...e]),se(!1)}catch(e){let t=e instanceof Error?e.message:String(e);B(t),console.error(`[admin-ui] sidebar-new-session-threw ms=${Date.now()-n} message=${t}`)}finally{re(!1)}},[c,R,A]),Q=ke(c,A,`sidebar`),He=(0,G.useCallback)(async e=>{let t=await Q.resume(e);t.ok||console.error(`[admin-ui] sidebar-resume failed: ${t.error}`)},[Q]),Ue=(0,G.useCallback)(async e=>{I(!0),P(null);let t=await Q.purge(e);t.ok?M(null):P(t.error??`purge failed`),I(!1)},[Q]),We=(0,G.useCallback)(async e=>{let t=await Q.end(e);t.ok||console.error(`[admin-ui] sidebar-end-session failed: ${t.error}`)},[Q]);return(0,K.jsxs)(`aside`,{className:`side`,children:[U===`chat`&&(0,K.jsxs)(`div`,{className:`side-new-session-row`,ref:Ee,children:[(0,K.jsxs)(`button`,{type:`button`,className:`side-new-session`,onClick:ze,disabled:R||!c,children:[R?(0,K.jsx)(L,{size:14,className:`spinning`}):(0,K.jsx)(le,{size:14}),(0,K.jsx)(`span`,{children:`New session`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`side-mode-trigger`,onClick:()=>{let e=!Y;console.info(`[admin-ui] sidebar-mode-picker action=${e?`open`:`close`} mode=${z}`),X(e)},disabled:R,"aria-haspopup":`menu`,"aria-expanded":Y,"aria-label":`Permission mode for the next session`,title:`Shift+Cmd+M`,children:[De[z],(0,K.jsx)(o,{size:12,"aria-hidden":`true`})]}),Y&&(0,K.jsxs)(`div`,{className:`side-mode-popover`,role:`menu`,"aria-label":`Mode`,children:[(0,K.jsxs)(`div`,{className:`side-mode-popover-head`,children:[(0,K.jsx)(`span`,{children:`Mode`}),(0,K.jsx)(`span`,{className:`side-mode-popover-shortcut`,"aria-hidden":`true`,children:`⇧⌘M`})]}),Oe.map((e,n)=>(0,K.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`side-mode-popover-item`,onClick:()=>{console.info(`[admin-ui] sidebar-mode-picker action=select mode=${e}`),ie(e),X(!1)},children:[(0,K.jsx)(`span`,{children:De[e]}),(0,K.jsxs)(`span`,{className:`side-mode-popover-shortcut`,children:[e===z&&(0,K.jsx)(t,{size:12}),(0,K.jsx)(`span`,{children:n+1})]})]},e))]})]}),(0,K.jsxs)(`nav`,{className:`side-nav`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`nav-row${U===`chat`?` active`:``}`,onClick:je,children:[(0,K.jsx)(_e,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Sessions`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=people`),S(),T()},children:[(0,K.jsx)(be,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`People`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=agents`),w(),T()},children:[(0,K.jsx)(g,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Agents`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=projects`),x(),T()},children:[(0,K.jsx)(_,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Projects`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=tasks`),C(),T()},children:[(0,K.jsx)(te,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Tasks`}),(0,K.jsx)(`span`,{className:`kbd`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`nav-row${U===`artefacts`?` active`:``}`,onClick:Me,children:[(0,K.jsx)(s,{size:20,strokeWidth:Z}),(0,K.jsx)(`span`,{className:`label`,children:`Artefacts`}),(0,K.jsx)(`span`,{className:`kbd`})]})]}),(0,K.jsxs)(`div`,{className:`side-list`,ref:ne,children:[(0,K.jsxs)(`div`,{className:`group-head`,children:[(0,K.jsx)(`span`,{children:Pe}),(0,K.jsxs)(`span`,{className:`group-head-meta`,children:[(0,K.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh ${Pe.toLowerCase()}`,"aria-label":`Refresh ${Pe.toLowerCase()}`,onClick:Re,disabled:Le,children:(0,K.jsx)(ue,{size:12,className:Le?`spinning`:void 0})}),(0,K.jsx)(`span`,{children:Fe})]})]}),ae&&U===`chat`&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:ae}),U===`chat`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ht,{view:H.view,setView:e=>{console.info(`[admin-ui] sidebar-view-change view=${e}`),H.setView(e)},connected:H.connected,reconnectNow:H.reconnectNow}),h&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:h}),me.map(e=>{let t=D===e.sessionId,n=e.agentLabel??`admin`,r=Ie(n);return(0,K.jsxs)(`div`,{className:`conv${t?` active`:``}`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`conv-name-button`,onClick:()=>{E(e.sessionId),T()},title:`Show metadata`,children:[(0,K.jsxs)(`span`,{className:`conv-name-line`,children:[(0,K.jsx)(_e,{size:12,className:`conv-channel-icon`,"aria-label":`claude session`}),(0,K.jsx)(gt,{live:e.live,status:e.status}),(0,K.jsx)(`span`,{className:`conv-name`,children:e.firstPrompt}),(0,K.jsxs)(`span`,{className:`conv-agent-badge`,"data-kind":e.agentLabel?`specialist`:`admin`,title:n,"aria-label":n,children:[(0,K.jsx)(r,{size:12,className:`conv-agent-icon`,"aria-label":n}),(0,K.jsx)(`span`,{className:`conv-agent-label`,children:n})]})]}),(0,K.jsx)(`span`,{className:`conv-timestamp`,children:st(e.updatedAt,ve)})]}),e.live?(0,K.jsxs)(K.Fragment,{children:[e.url!==null&&(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`Open in new tab`,"aria-label":`Open in new tab`,onClick:()=>_t(e.url,e.sessionId),children:(0,K.jsx)(O,{size:13})}),(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`End session`,"aria-label":`End session`,onClick:()=>void We(e.sessionId),children:(0,K.jsx)(he,{size:13})})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`Resume session`,"aria-label":`Resume session`,onClick:()=>void He(e.sessionId),disabled:Q.inFlight===`resume`,children:(0,K.jsx)(l,{size:13})}),(0,K.jsx)(`button`,{type:`button`,className:`conversations-action`,title:`Purge JSONL`,"aria-label":`Purge JSONL`,onClick:()=>{P(null),M({sessionId:e.sessionId,displayName:e.firstPrompt})},children:(0,K.jsx)(a,{size:13})})]})]},e.sessionId)})]}),U===`artefacts`&&(0,K.jsxs)(K.Fragment,{children:[Se&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:Se}),xe&&!Se&&W.length===0&&(0,K.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No artefacts yet`}),W.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`conv`,onClick:()=>{b({docId:e.id,name:e.name,content:e.content,editable:e.editable,mimeType:e.mimeType,skipReason:e.skipReason},`sidebar-artefacts`),T()},children:[(0,K.jsx)(`span`,{className:`conv-name`,children:e.name}),(0,K.jsx)(`span`,{className:`conv-kind`,"data-kind":e.kind===`agent-template`?`agent`:`doc`,children:e.kind===`agent-template`?`agent`:`doc`})]},e.id))]})]}),(0,K.jsxs)(`div`,{className:`side-foot`,children:[(0,K.jsx)(`div`,{className:`avatar`,children:f?(0,K.jsx)(`img`,{src:f,alt:de}):fe}),(0,K.jsxs)(`div`,{className:`who`,children:[(0,K.jsx)(`span`,{className:`name`,children:de}),(0,K.jsx)(`span`,{className:`role`,children:u??`operator`})]})]}),oe&&(0,K.jsx)(ft,{seedMode:z,submitting:R,error:ae,onSubmit:e=>void Ve(e),onCancel:Be,onErrorClear:()=>B(null)}),j&&(0,K.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`purge-confirm-title`,className:`modal-overlay`,onClick:e=>{e.target===e.currentTarget&&!F&&M(null)},children:(0,K.jsxs)(`div`,{className:`modal-card`,children:[(0,K.jsx)(`h3`,{id:`purge-confirm-title`,style:{margin:0,marginBottom:8,fontSize:16,fontWeight:600},children:`Purge session JSONL?`}),(0,K.jsxs)(`p`,{style:{margin:0,marginBottom:8,fontSize:13},children:[`This hard-deletes the transcript for `,(0,K.jsx)(`strong`,{children:j.displayName??j.sessionId.slice(0,8)}),`. The action cannot be undone.`]}),N&&(0,K.jsx)(`p`,{style:{margin:0,marginBottom:8,fontSize:12,color:`var(--text-tertiary)`},children:N}),(0,K.jsxs)(`div`,{className:`modal-action-row`,children:[(0,K.jsx)(`button`,{type:`button`,className:`modal-action-btn`,disabled:F,onClick:()=>M(null),children:`Cancel`}),(0,K.jsx)(`button`,{type:`button`,className:`modal-action-btn`,"data-variant":`danger`,disabled:F,onClick:()=>void Ue(j.sessionId),children:F?(0,K.jsx)(L,{size:13,className:`spinning`}):`Purge`})]})]})})]})}),mt=[{value:`active`,label:`Active`},{value:`archived`,label:`Archived`},{value:`all`,label:`All`}];function ht(e){let{view:t,setView:n,connected:r,reconnectNow:i}=e;return(0,K.jsx)(`div`,{className:`session-view-controls`,children:(0,K.jsxs)(`div`,{className:`session-view-segmented`,role:`tablist`,"aria-label":`Session view`,children:[mt.map(e=>(0,K.jsx)(`button`,{type:`button`,role:`tab`,className:`session-view-tab${t===e.value?` active`:``}`,"aria-selected":t===e.value,onClick:()=>n(e.value),children:e.label},e.value)),r?(0,K.jsx)(`span`,{className:`session-view-connection connected`,"aria-label":`Live updates connected.`,title:`Live updates connected.`}):(0,K.jsx)(`button`,{type:`button`,className:`session-view-connection disconnected`,"aria-label":`Live updates paused. Click to retry.`,title:`Live updates paused. Click to retry.`,onClick:i})]})})}function gt({live:e,status:t}){return e?t===`busy`?(0,K.jsxs)(`span`,{className:`session-status session-status-busy`,"aria-label":`session busy`,children:[(0,K.jsx)(`span`,{className:`session-status-dot`}),(0,K.jsx)(`span`,{className:`session-status-dot`}),(0,K.jsx)(`span`,{className:`session-status-dot`})]}):(0,K.jsx)(`span`,{className:`session-status session-status-idle`,"aria-label":`session idle`}):(0,K.jsx)(`span`,{className:`session-status session-status-archived`,"aria-label":`session archived`})}function _t(e,t){let n=t.slice(0,8),r=window.open(e,`_blank`,`noopener,noreferrer`)===null?`blocked`:`ok`;console.info(`[admin-ui] sidebar-open-in-new-tab outcome=${r} sessionId=${n}`)}function vt(){(0,G.useEffect)(()=>{function e(e){e.data?.type===`vnc-clipboard`&&typeof e.data.text==`string`&&u(e.data.text)}window.addEventListener(`message`,e);let t=null;return typeof BroadcastChannel<`u`&&(t=new BroadcastChannel(`maxy-vnc-clipboard`),t.onmessage=e=>{typeof e.data==`string`&&u(e.data)}),()=>{window.removeEventListener(`message`,e),t?.close()}},[])}function yt({handlePopout:e,disabled:t=!1}){let n=(0,G.useCallback)(()=>{delete document.body.dataset.dragPopoutActive},[]);(0,G.useEffect)(()=>()=>n(),[n]);let r=(0,G.useCallback)(e=>{if(t){e.preventDefault();return}let n=e.target;if(n.closest(`.editor-base__actions`)||n.closest(`.browser-viewer__actions`)){e.preventDefault();return}if(!document.querySelector(`.chat-messages`)){e.preventDefault();return}e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,``),document.body.dataset.dragPopoutActive=`true`},[t,n]),i=(0,G.useCallback)(t=>{if(n(),t.clientX===0&&t.clientY===0)return;let r=document.querySelector(`.chat-messages`);if(!r)return;let i=r.getBoundingClientRect();(t.clientX<i.left||t.clientX>i.right||t.clientY<i.top||t.clientY>i.bottom)&&e()},[e,n]);return t?{draggable:!1,onDragStart:()=>{},onDragEnd:()=>{}}:{draggable:!0,onDragStart:r,onDragEnd:i}}function bt(e){(0,G.useEffect)(()=>{let t=Date.now(),r=`/api/admin/browser-iframe/event`,i={brand:n.productName,surface:e};return fetch(r,{method:`POST`,credentials:`same-origin`,headers:{"Content-Type":`application/json`},body:JSON.stringify({event:`mount`,...i}),keepalive:!0}).catch(()=>{}),()=>{let e=JSON.stringify({event:`unmount`,durationMs:Date.now()-t,...i});try{let t=new Blob([e],{type:`application/json`});navigator.sendBeacon(r,t)||fetch(r,{method:`POST`,credentials:`same-origin`,headers:{"Content-Type":`application/json`},body:e,keepalive:!0}).catch(()=>{})}catch{}}},[e])}var xt=`maxy-vnc-overlay-popout`;function St(e){let[t,r]=(0,G.useState)(!1),i=(0,G.useRef)(null),a=(0,G.useRef)(null),o=(0,G.useCallback)(()=>{a.current&&=(clearInterval(a.current),null),i.current&&!i.current.closed&&i.current.close(),i.current=null,r(!1)},[]),s=(0,G.useCallback)(()=>{let t=`/vnc-popout.html?title=${encodeURIComponent(n.productName)}`,s=window.open(t,xt,`width=1024,height=768`);s&&(i.current=s,r(!0),a.current=setInterval(()=>{i.current?.closed&&(o(),e?.())},500))},[o,e]);return(0,G.useEffect)(()=>()=>o(),[o]),{poppedOut:t,popout:s,cleanupPopout:o}}var Ct=(0,G.forwardRef)(function({onClose:e},t){vt(),bt(`overlay`);let{poppedOut:r,popout:i,cleanupPopout:a}=St(e);return(0,G.useImperativeHandle)(t,()=>({popout:i}),[i]),r?(0,K.jsxs)(`div`,{className:`browser-overlay-popout`,children:[(0,K.jsx)(c,{className:`browser-viewer__icon`}),(0,K.jsx)(`span`,{className:`browser-viewer__title`,children:n.productName}),(0,K.jsx)(`span`,{className:`browser-viewer__popout-label`,children:`Popped out`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:B,onClick:()=>a(),"aria-label":`Pop back in`}),e&&(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:W,onClick:()=>{a(),e()},"aria-label":`Close`})]}):(0,K.jsx)(`iframe`,{src:`/vnc-viewer.html`,className:`browser-surface__iframe`,title:n.productName})});function wt({onClose:e}){vt(),bt(`overlay`);let{poppedOut:t,popout:r,cleanupPopout:i}=St(e),a=(0,G.useCallback)(()=>{i(),e()},[i,e]);(0,G.useEffect)(()=>{if(t)return;let e=e=>{e.key===`Escape`&&a()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,a]);let o=yt({handlePopout:r,disabled:t});return t?(0,K.jsxs)(`div`,{className:`browser-overlay-popout`,children:[(0,K.jsx)(c,{className:`browser-viewer__icon`}),(0,K.jsx)(`span`,{className:`browser-viewer__title`,children:n.productName}),(0,K.jsx)(`span`,{className:`browser-viewer__popout-label`,children:`Popped out`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:B,onClick:()=>{i()},"aria-label":`Pop back in`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:W,onClick:a,"aria-label":`Close`})]}):(0,K.jsxs)(`div`,{className:`browser-viewer-fullscreen`,children:[(0,K.jsxs)(`div`,{className:`browser-viewer-fullscreen__bar`,...o,children:[(0,K.jsx)(c,{className:`browser-viewer__icon`}),(0,K.jsx)(`span`,{className:`browser-viewer-fullscreen__title`,children:n.productName}),(0,K.jsxs)(`div`,{className:`browser-viewer-fullscreen__actions`,children:[(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:O,onClick:r,"aria-label":`Pop out`}),(0,K.jsx)(f,{variant:`ghost`,size:`sm`,icon:W,onClick:a,"aria-label":`Close`})]})]}),(0,K.jsx)(`iframe`,{src:`/vnc-viewer.html`,className:`browser-viewer-fullscreen__iframe`,title:n.productName})]})}function Tt(e){return e.map(e=>[e.sessionId,e.displayName,e.lastMessageAt,e.status])}function Et(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r[0]!==i[0]||r[1]!==i[1]||r[2]!==i[2]||r[3]!==i[3])return!1}return!0}function Dt(e){let[t,n]=(0,G.useState)([]),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),l=(0,G.useRef)([]),u=(0,G.useCallback)(async t=>{if(!e||!t&&s===e)return null;i(!0),o(null);try{let t=await fetch(`/api/admin/claude-sessions?session_key=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`claude-sessions fetch returned ${t.status}`);let r=await t.json(),i=Array.isArray(r)?r:r.sessions??[],a=Tt(i),o=Et(l.current,a);return o||(n(i),l.current=a),c(e),console.info(`[admin-ui] sessions-poll outcome=${o?`unchanged`:`changed`} count=${i.length} cacheKey=${e.slice(0,8)}`),i}catch(t){return console.info(`[admin-ui] sessions-poll outcome=error count=0 cacheKey=${e.slice(0,8)}`),console.error(`[admin/claude-sessions] fetch failed:`,t),o(t instanceof Error?t.message:String(t)),null}finally{i(!1)}},[e,s]);(0,G.useEffect)(()=>{e||(c(null),n([]),o(null),l.current=[])},[e]);let d=(0,G.useCallback)(()=>u(!1),[u]),f=(0,G.useCallback)(()=>u(!0),[u]);return{sessions:t,setSessions:n,loading:r,loaded:s!==null&&s===e,error:a,ensureLoaded:d,refetch:f}}var Ot=`admin-sidebar-collapsed`,kt=`admin-sidebar-drawer-open`;function At(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(Ot)===`1`}catch{return!1}}function jt(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(Ot,`1`):window.sessionStorage.removeItem(Ot)}catch{}}function Mt(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(kt)===`1`}catch{return!1}}function Nt(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(kt,`1`):window.sessionStorage.removeItem(kt)}catch{}}var Pt=720;function Ft(e){let{cacheKey:t,businessName:n,onLaunchBrowser:r,onLogout:i,browserLaunching:a,userName:o,userAvatar:s,role:c,selectedSessionId:l,onSelectSession:u,onSelectArtefact:d,dataArtefact:f=`closed`,children:p,footer:m}=e,[h,g]=(0,G.useState)(()=>At()),[_,v]=(0,G.useState)(()=>Mt()),[y,b]=(0,G.useState)(()=>typeof window<`u`&&window.matchMedia(`(max-width: ${Pt}px)`).matches);(0,G.useEffect)(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: ${Pt}px)`),t=e=>b(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let x=(0,G.useCallback)(e=>{jt(e),g(e)},[]),S=(0,G.useCallback)(e=>{Nt(e),v(e)},[]);(0,G.useEffect)(()=>{if(typeof window>`u`)return;let e=window.location?.pathname??``;console.info(`[admin-ui] shell-mount route=${e} collapsed=${h} drawer=${_}`)},[]);let C=y?_:!h,w=(0,G.useCallback)(()=>{if(!(typeof window>`u`))if(window.matchMedia(`(max-width: ${Pt}px)`).matches){let e=_;console.info(`[admin-ui] header-sidebar-toggle from=${e?`open`:`closed`} mode=drawer`),S(!e)}else{let e=h;console.info(`[admin-ui] header-sidebar-toggle from=${e?`closed`:`open`} mode=collapse`),x(!e)}},[h,_,x,S]),T=(0,G.useCallback)(e=>{console.info(`[admin-ui] header-menu-nav target=${e}`),window.location.href=e===`data`?`/data`:`/graph`},[]),[E,D]=(0,G.useState)(!1),[O,k]=(0,G.useState)(!1),ee=(0,G.useCallback)(async()=>{if(E)return;D(!0);let e=typeof window<`u`?window.location?.pathname??``:``,t=`n/a`;try{let n=await fetch(`/api/admin/browser/launch`,{method:`POST`});t=n.status;let r=await n.json().catch(()=>({ok:!1,error:`Invalid response`}));if(!r.ok)throw Error(r.error??`Failed to launch browser`);k(!0),console.info(`[admin-ui] header-menu-browser-launch outcome=ok source=shell-overlay route=${e} httpStatus=${t}`)}catch(n){console.error(`[admin-ui] header-menu-browser-launch outcome=error source=shell-overlay route=${e} httpStatus=${t} error="${n instanceof Error?n.message:String(n)}"`),window.alert(n instanceof Error?n.message:`Failed to launch browser`)}finally{D(!1)}},[E]),A=a??E,j=Dt(t),M=Ze(t),N=(0,G.useMemo)(()=>M.rows.map(e=>e.sessionId),[M.rows]),P=(0,G.useCallback)(e=>{if(u){u(e);return}window.location.assign(`/?sessionId=${encodeURIComponent(e)}`)},[u]),F=(0,G.useCallback)(e=>{d&&d(e)},[d]),I={collapsed:h,mobileDrawerOpen:_,sidebarOpen:C,onToggleSidebar:w,setMobileDrawerOpen:S,sessionsState:j,sessionRowIds:N,sessionRowsConnected:M.connected};return(0,K.jsxs)(`div`,{className:`admin-shell admin-page admin-shell-root`,children:[(0,K.jsx)(Z,{businessName:n,onLaunchBrowser:r??ee,onNavigate:T,onToggleSidebar:w,sidebarOpen:C,onLogout:i,browserLaunching:A}),(0,K.jsxs)(`div`,{className:`platform${_?` menu-open`:``}${h?` sidebar-collapsed`:``}`,"data-artefact":f,children:[(0,K.jsx)(pt,{businessName:n,cacheKey:t,role:c??null,userName:o,userAvatar:s??null,sessions:j.sessions,sessionsLoading:j.loading,sessionsError:j.error,ensureSessionsLoaded:j.ensureLoaded,refetchSessions:j.refetch,onSelectArtefact:F,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:()=>S(!1),onSelectSession:P,selectedSessionId:l??null,collapsed:h,mobileDrawerOpen:_,recentsActions:{setSessions:j.setSessions,refetch:j.refetch}}),typeof p==`function`?p(I):p]}),_&&(0,K.jsx)(`div`,{className:`sidebar-backdrop menu-open`,"aria-hidden":`true`,onClick:()=>S(!1)}),O&&(0,K.jsx)(wt,{onClose:()=>k(!1)}),m]})}var It={LocalBusiness:`#4F6B8A`,Service:`#6B85A0`,PriceSpecification:`#8AA0B8`,OpeningHoursSpecification:`#A8BACE`,Organization:`#8A6B47`,Person:`#B86E4A`,UserProfile:`#D08960`,Preference:`#DFA67A`,AdminUser:`#8C5230`,AccessGrant:`#66381F`,KnowledgeDocument:`#6E8A5A`,ConversationArchive:`#82A06A`,Section:`#8AA876`,Chunk:`#A6C194`,DigitalDocument:`#5A7548`,CreativeWork:`#B5C9A2`,Question:`#C7D6B5`,FAQPage:`#95B385`,DefinedTerm:`#76906A`,Review:`#3F5A2E`,ImageObject:`#A0BB8C`,Conversation:`#6B5A85`,AdminConversation:`#4F4070`,PublicConversation:`#8A75A8`,Message:`#6B7280`,UserMessage:`#DFA67A`,AssistantMessage:`#C9A876`,ToolCall:`#B5ABCB`,Task:`#B0617A`,Project:`#8E4A60`,Event:`#C68095`,Workflow:`#3A6F77`,WorkflowStep:`#5A8E96`,WorkflowRun:`#7AAAB2`,StepResult:`#9CC4CB`,Email:`#6F7F4A`,EmailAccount:`#91A063`,Agent:`#B8893D`},Lt=`#94A3B8`;Object.freeze(Object.keys(It)),Object.freeze(new Set([`Chunk`,`GraphPreference`]));var Rt=Object.freeze(new Set(`LocalBusiness.Service.PriceSpecification.OpeningHoursSpecification.Organization.Person.UserProfile.Preference.AdminUser.AccessGrant.KnowledgeDocument.DigitalDocument.CreativeWork.Question.FAQPage.DefinedTerm.Review.ImageObject.AdminConversation.PublicConversation.Task.Project.Event.Workflow.Email.EmailAccount.Agent`.split(`.`)));Object.freeze(new Set([`ToolCall`,`StepResult`,`WorkflowStep`,`WorkflowRun`])),Object.freeze(new Set([`HAS_TOOL_CALL`,`RUN_OF`,`HAS_STEP`,`HAS_RESULT`]));function zt(e){for(let t=1;t<e.length;t++)if(Object.prototype.hasOwnProperty.call(It,e[t]))return e[t];return e[0]??null}function Bt(e){return It[e]??`#94A3B8`}function Vt(e){let t=zt(e),n=t?Bt(t):Lt,r=0;for(let t=1;t<e.length;t++)Object.prototype.hasOwnProperty.call(It,e[t])&&r++;return{displayLabel:t,colour:n,driftCandidates:r}}export{E as C,O as S,ue as _,Ft as a,L as b,yt as c,ke as d,Ce as f,fe as g,H as h,Vt as i,We as l,he as m,Bt as n,wt as o,W as p,zt as r,Ct as s,Rt as t,Ne as u,le as v,P as x,B as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e,y as t}from"./ChatInput-AR8ym-HW.js";import"./graph-labels-BeDsoEVY.js";import{n}from"./page-x6ZXWwMx.js";import"./Checkbox-BWLS5Isf.js";var r=t(),i=e();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,E as t,S as n,T as r,a as i,b as a,c as o,i as s,n as c,s as l,t as u,w as d,x as f}from"./reduce-tk-xY6Fv.js";import{C as p,E as m,g as ee,h,l as g,p as te,u as _,v,w as ne}from"./_baseFor-BHtDrjIo.js";import{n as y,t as b}from"./isEmpty-BWl67LAZ.js";import{A as re,C as x,D as S,E as ie,M as ae,O as oe,T as se,j as C,k as ce,w,x as T,y as le}from"./chunk-5PVQY5BW-
|
|
1
|
+
import{C as e,E as t,S as n,T as r,a as i,b as a,c as o,i as s,n as c,s as l,t as u,w as d,x as f}from"./reduce-tk-xY6Fv.js";import{C as p,E as m,g as ee,h,l as g,p as te,u as _,v,w as ne}from"./_baseFor-BHtDrjIo.js";import{n as y,t as b}from"./isEmpty-BWl67LAZ.js";import{A as re,C as x,D as S,E as ie,M as ae,O as oe,T as se,j as C,k as ce,w,x as T,y as le}from"./chunk-5PVQY5BW-64laDovl.js";function ue(e,t){return e&&w(t,f(t),e)}function de(e,t){return e&&w(t,x(t),e)}function fe(e,t){return w(e,n(e),t)}var E=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,n(e)),e=oe(e);return t}:e;function pe(e,t){return w(e,E(e),t)}function me(e){return d(e,x,E)}var he=Object.prototype.hasOwnProperty;function ge(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&he.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function _e(e,t){var n=t?C(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var D=/\w*$/;function O(e){var t=new e.constructor(e.source,D.exec(e));return t.lastIndex=e.lastIndex,t}var k=m?m.prototype:void 0,A=k?k.valueOf:void 0;function j(e){return A?Object(A.call(e)):{}}var M=`[object Boolean]`,N=`[object Date]`,P=`[object Map]`,F=`[object Number]`,I=`[object RegExp]`,ve=`[object Set]`,ye=`[object String]`,be=`[object Symbol]`,xe=`[object ArrayBuffer]`,Se=`[object DataView]`,Ce=`[object Float32Array]`,we=`[object Float64Array]`,Te=`[object Int8Array]`,Ee=`[object Int16Array]`,De=`[object Int32Array]`,Oe=`[object Uint8Array]`,ke=`[object Uint8ClampedArray]`,Ae=`[object Uint16Array]`,je=`[object Uint32Array]`;function Me(e,t,n){var r=e.constructor;switch(t){case xe:return C(e);case M:case N:return new r(+e);case Se:return _e(e,n);case Ce:case we:case Te:case Ee:case De:case Oe:case ke:case Ae:case je:return re(e,n);case P:return new r;case F:case ye:return new r(e);case I:return O(e);case ve:return new r;case be:return j(e)}}var Ne=`[object Map]`;function Pe(e){return h(e)&&y(e)==Ne}var L=g&&g.isMap,Fe=L?_(L):Pe,Ie=`[object Set]`;function Le(e){return h(e)&&y(e)==Ie}var R=g&&g.isSet,Re=R?_(R):Le,ze=1,Be=2,Ve=4,z=`[object Arguments]`,He=`[object Array]`,Ue=`[object Boolean]`,We=`[object Date]`,Ge=`[object Error]`,B=`[object Function]`,Ke=`[object GeneratorFunction]`,qe=`[object Map]`,Je=`[object Number]`,V=`[object Object]`,Ye=`[object RegExp]`,Xe=`[object Set]`,Ze=`[object String]`,Qe=`[object Symbol]`,$e=`[object WeakMap]`,et=`[object ArrayBuffer]`,tt=`[object DataView]`,nt=`[object Float32Array]`,rt=`[object Float64Array]`,it=`[object Int8Array]`,at=`[object Int16Array]`,ot=`[object Int32Array]`,st=`[object Uint8Array]`,ct=`[object Uint8ClampedArray]`,lt=`[object Uint16Array]`,ut=`[object Uint32Array]`,H={};H[z]=H[He]=H[et]=H[tt]=H[Ue]=H[We]=H[nt]=H[rt]=H[it]=H[at]=H[ot]=H[qe]=H[Je]=H[V]=H[Ye]=H[Xe]=H[Ze]=H[Qe]=H[st]=H[ct]=H[lt]=H[ut]=!0,H[Ge]=H[B]=H[$e]=!1;function U(e,t,n,r,i,o){var c,l=t&ze,u=t&Be,d=t&Ve;if(n&&(c=i?n(e,r,i,o):n(e)),c!==void 0)return c;if(!ne(e))return e;var p=ee(e);if(p){if(c=ge(e),!l)return ce(e,c)}else{var m=y(e),h=m==B||m==Ke;if(te(e))return ae(e,l);if(m==V||m==z||h&&!i){if(c=u||h?{}:S(e),!l)return u?pe(e,de(c,e)):fe(e,ue(c,e))}else{if(!H[m])return i?e:{};c=Me(e,m,l)}}o||=new v;var g=o.get(e);if(g)return g;o.set(e,c),Re(e)?e.forEach(function(r){c.add(U(r,t,n,r,e,o))}):Fe(e)&&e.forEach(function(r,i){c.set(i,U(r,t,n,i,e,o))});var _=p?void 0:(d?u?me:a:u?x:f)(e);return s(_||e,function(r,i){_&&(i=r,r=e[i]),se(c,i,U(r,t,n,i,e,o))}),c}function W(e,n){return t(n,function(t){return e[t]})}function G(e){return e==null?[]:W(e,f(e))}function K(e){return e===void 0}var dt=le(function(e){return i(l(e,1,ie,!0))}),ft=`\0`,q=`\0`,J=``,Y=class{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,`directed`)?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,`compound`)?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=T(void 0),this._defaultEdgeLabelFn=T(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[q]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return p(e)||(e=T(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return f(this._nodes)}sources(){var e=this;return o(this.nodes(),function(t){return b(e._in[t])})}sinks(){var e=this;return o(this.nodes(),function(t){return b(e._out[t])})}setNodes(e,t){var n=arguments,r=this;return c(e,function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=q,this._children[e]={},this._children[q][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],c(this.children(e),e=>{this.setParent(e)}),delete this._children[e]),c(f(this._in[e]),t),delete this._in[e],delete this._preds[e],c(f(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(K(t))t=q;else{t+=``;for(var n=t;!K(n);n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==q)return t}}children(e){if(K(e)&&(e=q),this._isCompound){var t=this._children[e];if(t)return f(t)}else if(e===q)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){var t=this._preds[e];if(t)return f(t)}successors(e){var t=this._sucs[e];if(t)return f(t)}neighbors(e){var t=this.predecessors(e);if(t)return dt(t,this.successors(e))}isLeaf(e){return(this.isDirected()?this.successors(e):this.neighbors(e)).length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;c(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),c(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};function i(e){var a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&c(t.nodes(),function(e){t.setParent(e,i(e))}),t}setDefaultEdgeLabel(e){return p(e)||(e=T(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return G(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return u(e,function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i}),this}setEdge(){var e,t,n,r,i=!1,a=arguments[0];typeof a==`object`&&a&&`v`in a?(e=a.v,t=a.w,n=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=``+e,t=``+t,K(n)||(n=``+n);var o=Q(this._isDirected,e,t,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(!K(n)&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);var s=pt(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,X(this._preds[t],e),X(this._sucs[e],t),this._in[t][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,t,n){var r=arguments.length===1?$(this._isDirected,arguments[0]):Q(this._isDirected,e,t,n);return this._edgeLabels[r]}hasEdge(e,t,n){var r=arguments.length===1?$(this._isDirected,arguments[0]):Q(this._isDirected,e,t,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,r)}removeEdge(e,t,n){var r=arguments.length===1?$(this._isDirected,arguments[0]):Q(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],Z(this._preds[t],e),Z(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){var n=this._in[e];if(n){var r=G(n);return t?o(r,function(e){return e.v===t}):r}}outEdges(e,t){var n=this._out[e];if(n){var r=G(n);return t?o(r,function(e){return e.w===t}):r}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}};Y.prototype._nodeCount=0,Y.prototype._edgeCount=0;function X(e,t){e[t]?e[t]++:e[t]=1}function Z(e,t){--e[t]||delete e[t]}function Q(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}return i+J+a+J+(K(r)?ft:r)}function pt(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function $(e,t){return Q(e,t.v,t.w,t.name)}export{U as i,K as n,G as r,Y as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-K5T4RW27-B_ZUrFUq.js";import"./chunk-7N4EOEYR-BvMbitX7.js";import"./chunk-67CJDMHE-BG6-9r6c.js";import"./chunk-KGLVRYIC-CcWTvRlI.js";import"./chunk-FOC6F5B3-f9cFywhd.js";import"./chunk-AA7GKIK3-CE8mGBD5.js";import"./chunk-2KRD3SAO-Di4bO8ir.js";import"./chunk-ORNJ4GCN-B4Z5L25I.js";import"./chunk-LIHQZDEY-D-5-peQw.js";import"./chunk-CIAEETIT-VfnIdN-h.js";import{g as e,h as t}from"./src-B6XdH6xq.js";import{c as n}from"./chunk-ICPOFSXX-
|
|
1
|
+
import"./chunk-K5T4RW27-B_ZUrFUq.js";import"./chunk-7N4EOEYR-BvMbitX7.js";import"./chunk-67CJDMHE-BG6-9r6c.js";import"./chunk-KGLVRYIC-CcWTvRlI.js";import"./chunk-FOC6F5B3-f9cFywhd.js";import"./chunk-AA7GKIK3-CE8mGBD5.js";import"./chunk-2KRD3SAO-Di4bO8ir.js";import"./chunk-ORNJ4GCN-B4Z5L25I.js";import"./chunk-LIHQZDEY-D-5-peQw.js";import"./chunk-CIAEETIT-VfnIdN-h.js";import{g as e,h as t}from"./src-B6XdH6xq.js";import{c as n}from"./chunk-ICPOFSXX-D5pWrJcN.js";import{t as r}from"./chunk-426QAEUC-MYkbqx1u.js";import{t as i}from"./mermaid-parser.core-D0ksZQlW.js";var a={parse:t(async t=>{let n=await i(`info`,t);e.debug(n)},`parse`)},o={version:`11.14.0`},s={parser:a,db:{getVersion:t(()=>o.version,`getVersion`)},renderer:{draw:t((t,i,a)=>{e.debug(`rendering info diagram
|
|
2
2
|
`+t);let o=r(i);n(o,100,400,!0),o.append(`g`).append(`text`).attr(`x`,100).attr(`y`,40).attr(`class`,`version`).attr(`font-size`,32).style(`text-anchor`,`middle`).text(`v${a}`)},`draw`)}};export{s as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as e}from"./src-B6XdH6xq.js";import{B as t,C as n,V as r,W as i,_ as a,a as o,b as s,c,s as l,v as u}from"./chunk-ICPOFSXX-
|
|
1
|
+
import{h as e}from"./src-B6XdH6xq.js";import{B as t,C as n,V as r,W as i,_ as a,a as o,b as s,c,s as l,v as u}from"./chunk-ICPOFSXX-D5pWrJcN.js";import"./dist-Bd4S37oi.js";import{f as d}from"./chunk-5PVQY5BW-64laDovl.js";import{t as f}from"./chunk-426QAEUC-MYkbqx1u.js";import{t as p}from"./rough.esm-DKRO8IF-.js";var m=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,14],i=[1,12],a=[1,13],o=[6,7,8],s=[1,20],c=[1,18],l=[1,19],u=[6,7,11],d=[1,6,13,14],f=[1,23],p=[1,24],m=[1,6,7,11,13,14],h={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`ISHIKAWA`,11:`EOF`,13:`SPACELIST`,14:`TEXT`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 15:r.addNode(a[s-1].length,a[s].trim());break;case 16:r.addNode(0,a[s].trim());break}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:a},t(o,[2,3]),{1:[2,2]},t(o,[2,4]),t(o,[2,5]),{1:[2,6],6:r,12:15,13:i,14:a},{6:r,9:16,12:11,13:i,14:a},{6:s,7:c,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:c,10:22,11:l},{1:[2,7],6:r,12:15,13:i,14:a},t(d,[2,14],{7:f,11:p}),t(m,[2,8]),t(m,[2,9]),t(m,[2,10]),t(u,[2,15]),t(d,[2,13],{7:f,11:p}),t(m,[2,11]),t(m,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};h.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as e,p as t}from"./src-B6XdH6xq.js";import{B as n,C as r,V as i,W as a,_ as o,a as s,b as c,c as l,v as u}from"./chunk-ICPOFSXX-
|
|
1
|
+
import{h as e,p as t}from"./src-B6XdH6xq.js";import{B as n,C as r,V as i,W as a,_ as o,a as s,b as c,c as l,v as u}from"./chunk-ICPOFSXX-D5pWrJcN.js";import"./dist-Bd4S37oi.js";import{t as d}from"./arc-DMDAZHAN.js";import{t as f}from"./chunk-FMBD7UC4-w-yBZsN2.js";import{a as p,n as m,o as h,s as g}from"./chunk-YZCP3GAM-G4idHEoZ.js";var _=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,8,10,11,12,14,16,17,18],r=[1,9],i=[1,10],a=[1,11],o=[1,12],s=[1,13],c=[1,14],l={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:`error`,4:`journey`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,11:`title`,12:`acc_title`,13:`acc_title_value`,14:`acc_descr`,15:`acc_descr_value`,16:`acc_descr_multiline_value`,17:`section`,18:`taskName`,19:`taskData`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 13:r.addTask(a[s-1],a[s]),this.$=`task`;break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:i,14:a,16:o,17:s,18:c},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:15,11:r,12:i,14:a,16:o,17:s,18:c},t(n,[2,5]),t(n,[2,6]),t(n,[2,8]),{13:[1,16]},{15:[1,17]},t(n,[2,11]),t(n,[2,12]),{19:[1,18]},t(n,[2,4]),t(n,[2,9]),t(n,[2,10]),t(n,[2,13])],defaultActions:{},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};l.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as e,h as t}from"./src-B6XdH6xq.js";import{$ as n,K as r,L as i,Q as a,b as o,d as s,tt as c}from"./chunk-ICPOFSXX-
|
|
1
|
+
import{g as e,h as t}from"./src-B6XdH6xq.js";import{$ as n,K as r,L as i,Q as a,b as o,d as s,tt as c}from"./chunk-ICPOFSXX-D5pWrJcN.js";import"./dist-Bd4S37oi.js";import"./chunk-5PVQY5BW-64laDovl.js";import{t as l}from"./chunk-426QAEUC-MYkbqx1u.js";import"./chunk-U2HBQHQK-Brql314T.js";import{t as u}from"./chunk-FMBD7UC4-w-yBZsN2.js";import"./chunk-ZZ45TVLE-DyHGASIn.js";import"./chunk-X2U36JSP-C-79tMym.js";import{a as d,c as f,i as p}from"./chunk-5FUZZQ4R-BFMrOiNe.js";import{n as m,t as h}from"./chunk-XPW4576I-m1Y_r88I.js";var g=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,31],h=[6,7,11,24],g=[1,6,13,16,17,20,23],_=[1,35],v=[1,36],y=[1,6,7,11,13,16,17,20,23],b=[1,38],x={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`KANBAN`,11:`EOF`,13:`SPACELIST`,16:`ICON`,17:`CLASS`,20:`NODE_DSTART`,21:`NODE_DESCR`,22:`NODE_DEND`,23:`NODE_ID`,24:`SHAPE_DATA`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s-1].id),r.addNode(a[s-2].length,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 16:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 17:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 18:case 23:r.decorateNode({class:a[s]});break;case 19:r.getLogger().trace(`SPACELIST`);break;case 20:r.getLogger().trace(`Node: `,a[s-1].id),r.addNode(0,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 21:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 22:r.decorateNode({icon:a[s]});break;case 27:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 28:this.$={id:a[s],descr:a[s],type:0};break;case 29:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 30:this.$=a[s-1]+a[s];break;case 31:this.$=a[s];break}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:r,9:22,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:u,7:d,10:23,11:f},e(p,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:c}),e(p,[2,19]),e(p,[2,21],{15:30,24:m}),e(p,[2,22]),e(p,[2,23]),e(h,[2,25]),e(h,[2,26]),e(h,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:d,10:34,11:f},{1:[2,7],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},e(g,[2,14],{7:_,11:v}),e(y,[2,8]),e(y,[2,9]),e(y,[2,10]),e(p,[2,16],{15:37,24:m}),e(p,[2,17]),e(p,[2,18]),e(p,[2,20],{24:b}),e(h,[2,31]),{21:[1,39]},{22:[1,40]},e(g,[2,13],{7:_,11:v}),e(y,[2,11]),e(y,[2,12]),e(p,[2,15],{24:b}),e(h,[2,30]),{22:[1,41]},e(h,[2,27]),e(h,[2,29])],defaultActions:{2:[2,1],6:[2,2]},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`)};x.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()+`
|