@rubytech/create-maxy-code 0.1.286 → 0.1.287
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/samba-provision.test.js +84 -16
- package/dist/index.js +17 -8
- package/dist/samba-provision.js +81 -24
- package/dist/uninstall.js +5 -1
- package/package.json +1 -1
- package/payload/platform/plugins/admin/PLUGIN.md +1 -1
- package/payload/platform/plugins/admin/hooks/__tests__/prompt-optimiser-compliance.test.sh +52 -3
- package/payload/platform/plugins/admin/hooks/__tests__/prompt-optimiser-directive.test.sh +55 -0
- package/payload/platform/plugins/admin/hooks/prompt-optimiser-compliance.sh +29 -13
- package/payload/platform/plugins/admin/hooks/prompt-optimiser-directive.sh +60 -11
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +30 -17
- package/payload/platform/plugins/docs/references/admin-ui.md +2 -2
- package/payload/platform/plugins/docs/references/deployment.md +1 -1
- package/payload/platform/plugins/docs/references/plugins-guide.md +1 -1
- package/payload/platform/plugins/docs/references/samba.md +25 -12
- package/payload/platform/plugins/whatsapp/PLUGIN.md +4 -0
- package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +1 -1
- package/payload/platform/scripts/__tests__/prompt-optimiser-audit.test.sh +59 -0
- package/payload/platform/scripts/installer-device-verify.sh +74 -3
- package/payload/platform/scripts/prompt-optimiser-audit.sh +82 -0
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +46 -7
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/notification.js +49 -9
- package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.js +70 -17
- package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
- package/payload/server/{chunk-QHD5TKLQ.js → chunk-EAJMRICW.js} +21 -0
- package/payload/server/maxy-edge.js +1 -1
- package/payload/server/public/assets/AdminShell-DkP2rJdF.js +1 -0
- package/payload/server/public/assets/{Checkbox-DlwyBGbH.js → Checkbox-CsQq7YPC.js} +1 -1
- package/payload/server/public/assets/{admin-sjHlmwFk.js → admin-C_bkVvXh.js} +1 -1
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-BheZXEzK.js → architectureDiagram-Q4EWVU46-PGePlVpb.js} +1 -1
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-dYNElb4l.js → blockDiagram-DXYQGD6D-BJCbJRRs.js} +1 -1
- package/payload/server/public/assets/{browser-Dx1D0tI_.js → browser-DynPFG_A.js} +1 -1
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-Q6g8vHmX.js → c4Diagram-AHTNJAMY-DcMhi4gF.js} +1 -1
- package/payload/server/public/assets/channel-idaGQqlP.js +1 -0
- package/payload/server/public/assets/{chunk-336JU56O-D-Cn77jA.js → chunk-336JU56O-0vhS0MI-.js} +2 -2
- package/payload/server/public/assets/{chunk-426QAEUC-BAE0JfL6.js → chunk-426QAEUC-DbVU-p-q.js} +1 -1
- package/payload/server/public/assets/{chunk-4TB4RGXK-BI2HTCey.js → chunk-4TB4RGXK-dgx3qIz_.js} +1 -1
- package/payload/server/public/assets/{chunk-5FUZZQ4R-BsWXvze8.js → chunk-5FUZZQ4R-BglTosdT.js} +1 -1
- package/payload/server/public/assets/{chunk-5PVQY5BW-DWO5wTr8.js → chunk-5PVQY5BW-hZB3AxUF.js} +1 -1
- package/payload/server/public/assets/{chunk-EDXVE4YY-BM4DLBML.js → chunk-EDXVE4YY-DXqLJyYa.js} +1 -1
- package/payload/server/public/assets/{chunk-ENJZ2VHE-aOt2Re1y.js → chunk-ENJZ2VHE-BD4I_a54.js} +1 -1
- package/payload/server/public/assets/{chunk-ICPOFSXX-_ioQjgQ1.js → chunk-ICPOFSXX-BdQx0Ahc.js} +1 -1
- package/payload/server/public/assets/{chunk-OYMX7WX6-DkuLduF1.js → chunk-OYMX7WX6-BDjtbZvS.js} +1 -1
- package/payload/server/public/assets/{chunk-U2HBQHQK-1ESGrUQ6.js → chunk-U2HBQHQK-hYN7A3g_.js} +1 -1
- package/payload/server/public/assets/{chunk-X2U36JSP-C0MUqJKJ.js → chunk-X2U36JSP-D3njJ7WG.js} +1 -1
- package/payload/server/public/assets/{chunk-YZCP3GAM-BjIcv7r1.js → chunk-YZCP3GAM-BfZKEcvU.js} +1 -1
- package/payload/server/public/assets/{chunk-ZZ45TVLE-LW116-Vw.js → chunk-ZZ45TVLE-DLJMNqLn.js} +1 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-CmRFpirU.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DFy8xZjP.js +1 -0
- package/payload/server/public/assets/clone-kFPktUPQ.js +1 -0
- package/payload/server/public/assets/{dagre-CxO2ywW2.js → dagre-DVLE4-m6.js} +1 -1
- package/payload/server/public/assets/{dagre-KV5264BT-DcPqQxUG.js → dagre-KV5264BT-DGjcX5uz.js} +1 -1
- package/payload/server/public/assets/{data-Ca6hPEtp.js → data-D1FFhz2k.js} +1 -1
- package/payload/server/public/assets/{diagram-5BDNPKRD-B25vZ2cO.js → diagram-5BDNPKRD-CQI2o8Cv.js} +1 -1
- package/payload/server/public/assets/{diagram-G4DWMVQ6-p7maXzYr.js → diagram-G4DWMVQ6-C8kXsEdQ.js} +1 -1
- package/payload/server/public/assets/{diagram-MMDJMWI5-Deu8Io1I.js → diagram-MMDJMWI5-DaWrNg_c.js} +1 -1
- package/payload/server/public/assets/{diagram-TYMM5635-Cp3l9iiP.js → diagram-TYMM5635-Ql9QPUxX.js} +1 -1
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-D8_SMZL-.js → erDiagram-SMLLAGMA-B2fBZhPo.js} +1 -1
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-pECrNCIH.js → flowDiagram-DWJPFMVM-BA0LiOm5.js} +1 -1
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-DAbNRh0p.js → ganttDiagram-T4ZO3ILL-CBKdEgUk.js} +1 -1
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-CHVyAvfu.js → gitGraphDiagram-UUTBAWPF-BIyEfuwB.js} +1 -1
- package/payload/server/public/assets/{graph-ChJs-qY8.js → graph-BxWBNsFs.js} +1 -1
- package/payload/server/public/assets/{graph-labels-B-BTHvfh.js → graph-labels-DSLdDXoF.js} +1 -1
- package/payload/server/public/assets/{graphlib-DS0srZLX.js → graphlib-Cv4SvsQN.js} +1 -1
- package/payload/server/public/assets/{infoDiagram-42DDH7IO-lioeuA4m.js → infoDiagram-42DDH7IO-DovHLDHz.js} +1 -1
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-Dq2MKHxM.js → ishikawaDiagram-UXIWVN3A-haFza9s4.js} +1 -1
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-BTC5zuDZ.js → journeyDiagram-VCZTEJTY-l-8tJ21z.js} +1 -1
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-DQDOg3tk.js → kanban-definition-6JOO6SKY-DSZUvFLs.js} +1 -1
- package/payload/server/public/assets/{line---rBtN__.js → line-mfTElknw.js} +1 -1
- package/payload/server/public/assets/{mermaid-parser.core-BivSpldT.js → mermaid-parser.core-4temHHPS.js} +1 -1
- package/payload/server/public/assets/{mermaid.core-2mrA7rmo.js → mermaid.core-DO2iS9my.js} +3 -3
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-CduFYM-3.js → mindmap-definition-QFDTVHPH-Cymf2IGG.js} +1 -1
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-s68UJf6f.js → pieDiagram-DEJITSTG-_2tmuvMb.js} +1 -1
- package/payload/server/public/assets/{public-B2WWbnkK.js → public-Rz_GzOrN.js} +3 -3
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-ykHWuSCg.js → quadrantDiagram-34T5L4WZ-CVCrGnBi.js} +1 -1
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-DaRlmBk1.js → requirementDiagram-MS252O5E-Bc-o8i8Z.js} +1 -1
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-CjSaDmJD.js → sankeyDiagram-XADWPNL6-DrTBxqE6.js} +1 -1
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-DJcun441.js → sequenceDiagram-FGHM5R23-BjVjSsUJ.js} +1 -1
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-DMLxc8L0.js → stateDiagram-FHFEXIEX-DWAJP6ly.js} +1 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-BHDyrxpj.js +1 -0
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-Ls4Sv2EN.js → timeline-definition-GMOUNBTQ-Br_nbteH.js} +1 -1
- package/payload/server/public/assets/{useSelectionMode-BiULiLka.css → useSelectionMode-BLb-o9RX.css} +1 -1
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP-NpboV334.js → vennDiagram-DHZGUBPP-D_ozeKV6.js} +1 -1
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-s71AWI0_.js → wardleyDiagram-NUSXRM2D-B87ZKC2B.js} +1 -1
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-DYjbwXgQ.js → xychartDiagram-5P7HB3ND-DosRlk2T.js} +1 -1
- package/payload/server/public/browser.html +4 -4
- package/payload/server/public/data.html +5 -5
- package/payload/server/public/graph.html +6 -6
- package/payload/server/public/index.html +5 -5
- package/payload/server/public/public.html +4 -4
- package/payload/server/server.js +269 -81
- package/payload/server/public/assets/AdminShell-D06jh8Lz.js +0 -1
- package/payload/server/public/assets/channel-yIp47StE.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-DGPa3QR8.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-De6lAWAi.js +0 -1
- package/payload/server/public/assets/clone-C29IA5qA.js +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-a-wkzuCq.js +0 -1
- /package/payload/server/public/assets/{useSelectionMode-DMNfbxHW.js → useSelectionMode-hZ5bdL8b.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CnGqDkHZ.js";import{d as t,f as n,l as r,m as i,o as a,r as o,t as s,u as c}from"./useSelectionMode-DMNfbxHW.js";var l=n(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),u=n(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),d=n(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),f=n(`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`}]]),p=n(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),m=n(`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`}]]),h=n(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),g=n(`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`}]]),_=n(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),v=n(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),y=n(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),b=n(`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`}]]),x=n(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),S=n(`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`}]]),ee=n(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),C=n(`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`}]]),w=n(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),te=n(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),T=n(`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`}]]),ne=n(`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`}]]),re=n(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ie=n(`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`}]]),E=n(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),D=e(i(),1),O=r(),k=`maxy-shell-side-px`;function A(){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-A());return Math.min(Math.max(e,248),n)}function M(){if(typeof window>`u`)return 264;try{let e=window.localStorage.getItem(k);if(!e)return 264;let t=parseInt(e,10);if(Number.isFinite(t)&&t>=248)return j(t)}catch{}return 264}function ae({targetSelector:e=`.platform`}){let t=(0,D.useRef)(null),[n,r]=(0,D.useState)(()=>M()),i=(0,D.useRef)(n);(0,D.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,D.useCallback)(()=>{r(e=>{let t=j(e);return t===e?e:t})},[]);(0,D.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(k,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(k)}catch{}console.info(`[admin-ui] sidebar-resize px=${e}`)};return(0,O.jsx)(`div`,{ref:t,className:`side-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,onPointerDown:o,onDoubleClick:s})}var N=`maxy-admin-session`,oe=typeof BroadcastChannel<`u`;function P(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 se(e){if(!oe)return()=>{};let t=new BroadcastChannel(N),n=t=>{if(!P(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 F=`maxy-admin-session-key`;function I(e,t){return`${e}${e.includes(`?`)?`&`:`?`}session_key=${encodeURIComponent(t)}`}async function L(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 ce(){try{return sessionStorage.getItem(F)}catch{return null}}function R(e){let{initialCacheKey:t,surface:n}=e,[r,i]=(0,D.useState)(t),a=(0,D.useRef)(t);(0,D.useEffect)(()=>{a.current=r},[r]),(0,D.useEffect)(()=>{t!==a.current&&(i(t),a.current=t,s(e=>e+1))},[t]);let[o,s]=(0,D.useState)(0);(0,D.useEffect)(()=>se(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))}),[n]);let c=(0,D.useCallback)(()=>{try{sessionStorage.removeItem(F)}catch{}window.location.href=`/`},[]);return{adminFetch:(0,D.useCallback)(async(e,t)=>{let r=a.current,o=I(e,r),l=await fetch(o,t);if(l.status!==401)return l;let u=await L(l);if(u===`session-missing`||u!==`session-not-registered`)return console.warn(`[useAdminFetch] outcome=session-expired-redirect reason=${u} surface=${n} path=${e}`),c(),l;let d=ce();if(!d||d===r)return console.warn(`[useAdminFetch] outcome=session-expired-redirect reason=session-not-registered-no-fresh-key surface=${n} path=${e}`),c(),l;i(d),a.current=d,s(e=>e+1),console.log(`[useAdminFetch] outcome=retry-after-rotation oldKey=${r.slice(0,8)} newKey=${d.slice(0,8)} surface=${n} path=${e}`);let f=I(e,d),p=await fetch(f,t);return p.status===401&&(console.warn(`[useAdminFetch] outcome=session-expired-redirect reason=second-401-after-retry surface=${n} path=${e}`),c()),p},[c,n]),cacheKey:r,sessionRefetchNonce:o}}var z=(0,D.createContext)(null);function le({cacheKey:e,onSessionExpired:t,surface:n,children:r}){let i=(0,D.useCallback)(async(r,i)=>{if(!e)return fetch(r,i);let a=I(r,e),o=await fetch(a,i);if(o.status!==401)return o;let s=await L(o),c=e.slice(-8);if(s===`session-not-registered`){let a=ce();if(a&&a!==e){let e=I(r,a),o=await fetch(e,i);return o.status===401?(console.warn(`[admin-auth] outcome=session-expired-redirect code=second-401-after-retry path=${r} cacheKey=${c} surface=${n}`),t({code:`second-401-after-retry`,path:r}),o):o}}return console.warn(`[admin-auth] outcome=session-expired-redirect code=${s} path=${r} cacheKey=${c} surface=${n}`),t({code:s,path:r}),o},[e,t,n]);return(0,O.jsx)(z.Provider,{value:i,children:r})}function B(){return(0,D.useContext)(z)}function ue(e){let t=B();return(0,D.useMemo)(()=>t||(async(t,n)=>fetch(e?I(t,e):t,n)),[t,e])}function V(e){let{businessName:t,onNavigate:n,onToggleSidebar:r,sidebarOpen:i,onLogout:s}=e,[l,u]=(0,D.useState)(!1),d=(0,D.useRef)(null),f=(0,D.useRef)(null),h=ue(null),[v,b]=(0,D.useState)(null),[te,T]=(0,D.useState)(!1),[re,ie]=(0,D.useState)(null),[k,A]=(0,D.useState)(null),[j,M]=(0,D.useState)(null),[ae,N]=(0,D.useState)(``);(0,D.useEffect)(()=>{N(window.location.hostname.startsWith(`admin.`)?window.location.origin.replace(`admin.`,`public.`):window.location.origin)},[]),(0,D.useEffect)(()=>{if(!l)return;let e=e=>{d.current&&!d.current.contains(e.target)&&u(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[l]),(0,D.useEffect)(()=>{if(!l)return;let e=e=>{e.key===`Escape`&&u(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[l]),(0,D.useEffect)(()=>{l&&f.current?.focus()},[l]),(0,D.useEffect)(()=>{if(!l)return;let e=!1;return h(`/api/admin/version`).then(e=>e.json()).then(t=>{e||M(t)}).catch(e=>{console.error(`[admin/version] menu-open client fetch failed:`,e)}),()=>{e=!0}},[l,h]);let oe=(0,D.useCallback)(()=>{u(e=>{let t=!e;return t&&console.info(`[admin-ui] header-menu-open`),t})},[]),P=(0,D.useCallback)(e=>{u(!1),n(e)},[n]),se=(0,D.useCallback)(async()=>{if(v!==null){b(null),A(null);return}T(!0),ie(null);try{let e=await h(`/api/admin/agents`);if(!e.ok)throw Error(`Failed to load agents`);b((await e.json()).agents??[])}catch(e){console.error(`[admin/agents] list failed:`,e),ie(e instanceof Error?e.message:String(e)),b([])}finally{T(!1)}},[v,h]),F=(0,D.useCallback)(e=>{A(null),b(t=>t?.filter(t=>t.slug!==e)??null),h(`/api/admin/agents/${encodeURIComponent(e)}`,{method:`DELETE`}).catch(e=>console.error(`[admin/agents] delete failed:`,e))},[h]),I=(0,D.useCallback)(()=>{u(!1),s()},[s]),L=t||o.productName;return(0,O.jsxs)(`header`,{className:`admin-header`,children:[(0,O.jsx)(`button`,{type:`button`,className:`admin-sidebar-toggle`,"aria-label":i?`Hide sidebar`:`Show sidebar`,title:i?`Hide sidebar`:`Show sidebar`,"aria-expanded":i,onClick:r,children:i?(0,O.jsx)(C,{size:20,strokeWidth:1.5}):(0,O.jsx)(w,{size:20,strokeWidth:1.5})}),(0,O.jsxs)(`div`,{className:`chat-header-label`,children:[(0,O.jsx)(`span`,{className:`chat-logo-btn`,"aria-hidden":`true`,children:(0,O.jsx)(`img`,{src:a,alt:``,className:`chat-logo`})}),(0,O.jsx)(`h1`,{className:`chat-tagline`,children:L})]}),(0,O.jsxs)(`div`,{className:`chat-burger-wrap`,ref:d,children:[(0,O.jsx)(`button`,{type:`button`,className:`admin-burger`,onClick:oe,"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":l,children:(0,O.jsx)(ee,{size:20})}),l&&(0,O.jsxs)(`div`,{className:`admin-menu`,role:`menu`,children:[(0,O.jsxs)(`button`,{ref:f,type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>P(`data`),children:[(0,O.jsx)(m,{size:14}),` Data`]}),(0,O.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>P(`graph`),children:[(0,O.jsx)(ne,{size:14}),` Graph`]}),(0,O.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>P(`browser`),children:[(0,O.jsx)(_,{size:14}),` Browser`]}),(0,O.jsx)(`div`,{className:`chat-menu-divider`}),(0,O.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:se,children:[(0,O.jsx)(g,{size:14}),` Public`,te&&(0,O.jsx)(x,{size:12,className:`spin`})]}),v!==null&&(0,O.jsxs)(`div`,{className:`chat-menu-agents`,children:[re&&(0,O.jsx)(`span`,{className:`chat-menu-agent-error`,children:re}),v.length===0&&!re&&(0,O.jsx)(`span`,{className:`chat-menu-agent-empty`,children:`No public agents configured`}),v.map(e=>(0,O.jsxs)(`div`,{className:`chat-menu-item chat-menu-agent-item`,children:[(0,O.jsx)(`span`,{className:`agent-status-dot ${e.status}`}),(0,O.jsxs)(`span`,{className:`agent-text`,children:[(0,O.jsx)(`span`,{className:`agent-display-name`,children:e.displayName}),(0,O.jsxs)(`span`,{className:`agent-slug`,children:[`/`,e.slug]})]}),k===e.slug?(0,O.jsxs)(`span`,{className:`agent-actions agent-confirm`,children:[(0,O.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-yes`,title:`Confirm delete`,onClick:()=>F(e.slug),children:(0,O.jsx)(p,{size:12})}),(0,O.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-no`,title:`Cancel`,onClick:()=>A(null),children:(0,O.jsx)(E,{size:12})})]}):(0,O.jsxs)(`span`,{className:`agent-actions`,children:[(0,O.jsx)(`a`,{href:`${ae}/${e.slug}`,target:`_blank`,rel:`noopener noreferrer`,className:`agent-action-btn`,title:`Open agent`,onClick:()=>u(!1),children:(0,O.jsx)(g,{size:12})}),(0,O.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-delete-btn`,title:`Delete agent`,onClick:()=>A(e.slug),children:(0,O.jsx)(c,{size:12})})]})]},e.slug))]}),(0,O.jsx)(`div`,{className:`chat-menu-divider`}),(0,O.jsxs)(`div`,{className:`chat-menu-version chat-menu-version-passive`,children:[(0,O.jsx)(y,{size:14}),(0,O.jsxs)(`span`,{className:`version-installed`,children:[j?`v${j.installed}`:`…`,j&&!j.updateAvailable&&(0,O.jsx)(`span`,{className:`version-uptodate-dot`}),j?.updateAvailable&&(0,O.jsx)(`span`,{className:`version-update-dot`})]})]}),(0,O.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:I,children:[(0,O.jsx)(S,{size:14}),` Log out`]})]})]})]})}var de={whatsapp:{fill:`#25D366`,label:`WhatsApp`,path:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.71.306 1.263.489 1.694.625.712.227 1.36.195 1.872.118.571-.085 1.758-.719 2.006-1.413.247-.694.247-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.885-9.885 9.885M20.52 3.449C18.24 1.245 15.24.044 12.045.044 5.463.044.103 5.404.1 11.99c0 2.096.546 4.142 1.588 5.945L0 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.585 0 11.946-5.36 11.949-11.946 0-3.193-1.24-6.19-3.495-8.445`},telegram:{fill:`#229ED9`,label:`Telegram`,path:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`}};function fe({channel:e,size:t=16}){let n=de[e];return(0,O.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:n.fill,role:`img`,"aria-label":n.label,className:`channel-icon`,children:(0,O.jsx)(`path`,{d:n.path})})}var pe=[`whatsapp`,`telegram`];function me(e,t,n=`data`){let r=`/api/admin/files/download?session_key=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`+(n===`data`?``:`&root=${encodeURIComponent(n)}`),i=document.createElement(`a`);i.href=r,i.rel=`noopener noreferrer`,document.body.appendChild(i),i.click(),i.remove()}function H(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),n=e%60;return n>0?`${t}m ${n}s`:`${t}m`}function he(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}var U=`auth-refresh-failed`;function ge({error:e,onClose:t}){if(!e)return null;let n=e.reason===U,r=n?`Claude sign-in expired`:`Session didn’t open`,i=n?`Your claude.ai login has expired. Re-authenticate to resume sessions.`:`The session did not bind within 60 seconds, so there is no live conversation to open.`;return(0,O.jsx)(`div`,{className:`claude-info-overlay`,onClick:t,children:(0,O.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-label":`Session could not be opened`,children:[(0,O.jsxs)(`div`,{className:`claude-info-header`,children:[(0,O.jsx)(`span`,{children:r}),(0,O.jsx)(`button`,{className:`claude-info-close`,onClick:t,"aria-label":`Close`,children:`✕`})]}),(0,O.jsxs)(`div`,{className:`claude-info-section`,style:{padding:`12px 14px`,fontSize:`11px`,color:`var(--text-secondary)`},children:[i,(0,O.jsxs)(`div`,{className:`claude-info-row`,style:{marginTop:`8px`},children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Reason`}),(0,O.jsx)(`span`,{className:`claude-info-value`,children:e.reason})]}),e.sessionId&&(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,O.jsxs)(`span`,{className:`claude-info-value`,children:[e.sessionId.slice(0,8),`…`]})]})]})]})})}function _e(e){let{show:t,onClose:n,claudeInfo:r,messages:i,sessionElapsed:a,sessionId:o,cacheKey:c}=e,[l,u]=(0,D.useState)(null);if(!t)return null;let d=i.flatMap(e=>e.events?.filter(e=>e.type===`usage`)??[]),f=d.at(-1),p=f?.peak_request_pct==null?f?.context_window?Math.round((f.input_tokens+f.cache_creation_tokens+f.cache_read_tokens)/f.context_window*100):0:Math.round(f.peak_request_pct*100),m=d.reduce((e,t)=>e+t.input_tokens+t.cache_creation_tokens+t.cache_read_tokens+t.output_tokens,0),h=i.flatMap(e=>e.events?.filter(e=>e.type===`rate_limit`)??[]).at(-1),g=d.reduce((e,t)=>e+(t.total_cost_usd??0),0),_=r?.account?.subscriptionType,v=e=>{let t=e*1e3-Date.now();if(t<=0)return`now`;let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h ${r}m`:`${r}m`};return(0,O.jsx)(`div`,{className:`claude-info-overlay`,onClick:n,children:(0,O.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),children:[(0,O.jsxs)(`div`,{className:`claude-info-header`,children:[(0,O.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`claude-info-icon`}),(0,O.jsx)(`span`,{children:`Claude Code`}),(0,O.jsx)(`button`,{className:`claude-info-close`,onClick:n,"aria-label":`Close`,children:`✕`})]}),(0,O.jsxs)(`div`,{className:`claude-info-section`,children:[(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Version`}),(0,O.jsx)(`span`,{className:`claude-info-value`,children:r?r.version:`…`})]}),(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Email`}),(0,O.jsx)(`span`,{className:`claude-info-value`,children:r?.account?.email??`…`})]})]}),(_||h||g>0)&&(0,O.jsxs)(`div`,{className:`claude-info-section`,children:[_&&(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Plan`}),(0,O.jsx)(`span`,{className:`claude-info-value`,style:{textTransform:`capitalize`},children:_})]}),h&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Usage`}),(0,O.jsxs)(`span`,{className:`claude-info-value`,children:[Math.round(h.utilization*100),`%`]})]}),(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Resets in`}),(0,O.jsx)(`span`,{className:`claude-info-value`,children:v(h.resetsAt)})]}),h.isUsingOverage&&(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Overage`}),(0,O.jsx)(`span`,{className:`claude-info-value`,children:`Active`})]})]}),g>0&&(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Session cost`}),(0,O.jsxs)(`span`,{className:`claude-info-value`,children:[`$`,g<.01?g.toFixed(4):g.toFixed(2)]})]})]}),(0,O.jsxs)(`div`,{className:`claude-info-section`,children:[(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Model`}),(0,O.jsx)(`span`,{className:`claude-info-value`,children:r?.model??`…`})]}),(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Context used`}),(0,O.jsx)(`span`,{className:`claude-info-value`,children:p>0?`${p}%`:`—`})]}),(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Tokens`}),(0,O.jsx)(`span`,{className:`claude-info-value`,children:m>0?he(m):`—`})]}),(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,O.jsx)(`span`,{className:`claude-info-value`,children:H(a)})]}),(o||c)&&(()=>{let e=o??c??``;return(0,O.jsxs)(`div`,{className:`claude-info-row`,children:[(0,O.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,O.jsx)(`button`,{type:`button`,className:`claude-info-value claude-info-id-copy`,title:`${e} (${o?`flushed`:`pre-flush`}) — click to copy`,onClick:async()=>{u(await s(e)?`copied`:`failed`),setTimeout(()=>u(null),1200)},children:l===`copied`?`copied ✓`:l===`failed`?`copy failed ✕`:`${e.slice(0,8)}…`})]})})()]})]})})}var W=`https://claude.ai/code`,ve=[500,1e3,1500,2e3,2500,3e3,3e3];function ye(e,t,n){let r=n.slug??n.bridgeSessionId??null;if(e&&r)return{kind:`navigate`,url:`${W}/${r}`};let i=n.reason||n.error||`status ${t}`;return{kind:`error`,sessionId:n.sessionId??null,reason:i}}function be(e){let{businessName:n,cacheKey:r,role:i,userName:a,userAvatar:s,onSelectProjects:p,onSelectPeople:m,onSelectTasks:_,onSelectAgents:y,onCloseMobileDrawer:x,collapsed:S,selectedWhatsappId:ee,onSelectWhatsappConversation:C}=e,w=ue(r),ne=o.productName,E=typeof a==`string`?a:a===null?`name unavailable`:n||ne,k=(E.trim().charAt(0)||`?`).toUpperCase(),[A,j]=(0,D.useState)(`sessions`),[M,ae]=(0,D.useState)([]),[N,oe]=(0,D.useState)(!1),[P,se]=(0,D.useState)(null),[F,I]=(0,D.useState)(!1),[L,ce]=(0,D.useState)(`file`),[R,z]=(0,D.useState)(null),[le,B]=(0,D.useState)(null),[V,de]=(0,D.useState)([]),[H,he]=(0,D.useState)(!1),[U,_e]=(0,D.useState)(null),[W,be]=(0,D.useState)(!1),[G,K]=(0,D.useState)(!1),[q,Se]=(0,D.useState)(!1),[Ce,we]=(0,D.useState)(null),[Te,J]=(0,D.useState)(new Set),[Ee,De]=(0,D.useState)(new Set),[Oe,ke]=(0,D.useState)(new Set),[Ae,je]=(0,D.useState)(new Set),[Y,Me]=(0,D.useState)(!1),[Ne,Pe]=(0,D.useState)([]),[Fe,Ie]=(0,D.useState)(!1),[Le,Re]=(0,D.useState)(null),[X,ze]=(0,D.useState)(`whatsapp`),Be=(0,D.useCallback)(e=>{if(x(),!r){console.error(`[admin-ui] artefact-download-blocked id=${e.id} reason=no-cache-key`),z({message:`Session not ready — try again`,failed:!0});return}if(!e.downloadPath){console.error(`[admin-ui] artefact-download-blocked id=${e.id} reason=not-downloadable`),z({message:`${e.name} can’t be downloaded`,failed:!0});return}console.info(`[admin-ui] artefact-download id=${e.id} root=${e.downloadRoot??`data`} path=${e.downloadPath}`),me(r,e.downloadPath,e.downloadRoot??`data`),z({message:`Downloading ${e.name}`,failed:!1})},[r,x]);(0,D.useEffect)(()=>{if(!R)return;let e=setTimeout(()=>z(null),2500);return()=>clearTimeout(e)},[R]);let Ve=(0,D.useCallback)(async()=>{if(r){I(!0),se(null);try{let e=await w(`/api/admin/sidebar-artefacts`);if(!e.ok)throw Error(`status ${e.status}`);ae((await e.json()).artefacts??[]),oe(!0)}catch(e){let t=e instanceof Error?e.message:String(e);se(`Failed to load artefacts: ${t}`),console.error(`[admin-ui] sidebar-artefacts fetch failed: ${t}`)}finally{I(!1)}}},[r,w]),Z=(0,D.useCallback)(async()=>{if(!r)return null;be(!0),_e(null);try{let e=await w(`/api/admin/sidebar-sessions`);if(!e.ok)throw Error(`status ${e.status}`);let t=await e.json(),n=t.sessions??[];return de(n),we(t.accountId??null),he(!0),n}catch(e){let t=e instanceof Error?e.message:String(e);return _e(`Failed to load sessions: ${t}`),console.error(`[admin-ui] sidebar-sessions fetch failed: ${t}`),null}finally{be(!1)}},[r,w]),He=(0,D.useCallback)(async()=>{if(r){Re(null);try{let e=await w(`/api/whatsapp-reader/conversations`);if(!e.ok)throw Error(`status ${e.status}`);Pe((await e.json()).conversations??[]),Ie(!0)}catch(e){let t=e instanceof Error?e.message:String(e);Re(`Couldn't load conversations: ${t}`),console.error(`[admin-ui] channel-convos fetch failed: ${t}`)}}},[r,w]);(0,D.useEffect)(()=>{!r||H||Z()},[r,H,Z]),(0,D.useEffect)(()=>{r&&He()},[r,He]);let Q=(0,D.useMemo)(()=>{let e=new Map;for(let t of pe)e.set(t,[]);for(let t of Ne)e.get(t.channel)?.push(t);for(let t of pe)console.info(`[admin-ui] sidebar-nav surface=${t} count=${e.get(t).length}`);return e},[Ne]),Ue={whatsapp:`WhatsApp`,telegram:`Telegram`},We=()=>{C(null),j(`artefacts`),console.info(`[admin-ui] sidebar-nav surface=artefacts count=${N?M.length:0} collapsed=${S}`),Ve()},$=1.5,Ge=()=>{console.info(`[admin-ui] sidebar-refresh surface=artefacts`),Ve()},Ke=()=>{C(null),j(`sessions`),console.info(`[admin-ui] sidebar-nav surface=sessions count=${H?V.length:0} collapsed=${S}`),H||Z()},qe=()=>{console.info(`[admin-ui] sidebar-refresh surface=sessions`),Z()},Je=e=>{j(`whatsapp`),ze(e),console.info(`[admin-ui] sidebar-nav surface=${e} count=${Q.get(e)?.length??0} collapsed=${S}`),x()},Ye=(0,D.useCallback)(async e=>{if(e.resumable===!1||Ee.has(e.sessionId))return;De(t=>{let n=new Set(t);return n.add(e.sessionId),n});let t=window.open(``,`_blank`);try{let n=await w(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:e.sessionId,name:e.title||e.sessionId})}),r=await n.json().catch(()=>({})),i=ye(n.ok,n.status,{...r,sessionId:r.sessionId??e.sessionId});console.info(`[admin-ui] sidebar-session-resume sessionId=${e.sessionId} status=${n.status} outcome=${i.kind} slug=${r.slug??r.bridgeSessionId??`none`}`),i.kind===`navigate`?(x(),t?t.location.href=i.url:window.open(i.url,`_blank`)):(t?.close(),console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} status=${n.status} reason=${i.reason}`),B(i))}catch(n){t?.close();let r=n instanceof Error?n.message:String(n);console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} error=${r}`),B({sessionId:e.sessionId,reason:r})}finally{De(t=>{let n=new Set(t);return n.delete(e.sessionId),n})}},[w,x,Ee]),Xe=(0,D.useCallback)(async e=>{let t=e.slice(0,8);for(let n=1;n<=ve.length;n++){await new Promise(e=>setTimeout(e,ve[n-1]));let r=await Z();if(r&&r.some(t=>t.sessionId===e)){console.info(`[admin-ui] sidebar-new-session-converged sessionId=${t} via=retry attempts=${n}`);return}}console.error(`[admin-ui] sidebar-new-session-converge-timeout sessionId=${t}`)},[Z]),Ze=(0,D.useCallback)(async()=>{if(Y)return;Me(!0);let e=window.open(``,`_blank`);try{let t=await w(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})}),n=await t.json().catch(()=>({})),r=ye(t.ok,t.status,n);console.info(`[admin-ui] sidebar-new-session-spawned status=${t.status} outcome=${r.kind} slug=${n.slug??n.bridgeSessionId??`none`}`),r.kind===`navigate`?(e?e.location.href=r.url:window.open(r.url,`_blank`),n.sessionId?Xe(n.sessionId):console.error(`[admin-ui] sidebar-new-session-converge-skipped reason=no-session-id`)):(e?.close(),console.error(`[admin-ui] sidebar-new-session-failed status=${t.status} reason=${r.reason}`),B(r))}catch(t){e?.close();let n=t instanceof Error?t.message:String(t);console.error(`[admin-ui] sidebar-new-session-failed error=${n}`),B({sessionId:null,reason:n})}finally{Me(!1)}},[w,Y,Xe]),Qe=(0,D.useCallback)(async(e,t)=>{if(e.stopPropagation(),!Te.has(t.sessionId)){J(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await w(`/api/admin/session-delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId})});if(!e.ok){let n=await e.json().catch(()=>({}));console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${t.sessionId} status=${e.status} error=${n.error??`unknown`}`),z({message:`Delete failed: ${n.error??`status ${e.status}`}`,failed:!0});return}let n=await e.json();console.info(`[admin-ui] sidebar-session-delete sessionId=${t.sessionId} pidKilled=${n.pidKilled??`?`} deleted=${n.deleted??`?`}`),de(e=>e.filter(e=>e.sessionId!==t.sessionId)),Z()}catch(e){let n=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${t.sessionId} error=${n}`),z({message:`Delete failed: ${n}`,failed:!0})}finally{J(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[w,Te,Z]),$e=(0,D.useCallback)(async(e,t)=>{if(e.stopPropagation(),!Oe.has(t.sessionId)){ke(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await w(`/api/admin/session-stop`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId})});if(!e.ok){let n=await e.json().catch(()=>({}));console.error(`[admin-ui] sidebar-session-stop-failed sessionId=${t.sessionId} status=${e.status} error=${n.error??`unknown`}`),z({message:`Stop failed: ${n.error??`status ${e.status}`}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-stop sessionId=${t.sessionId}`),Z()}catch(e){let n=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-stop-failed sessionId=${t.sessionId} error=${n}`),z({message:`Stop failed: ${n}`,failed:!0})}finally{ke(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[w,Oe,Z]),et=(0,D.useCallback)(async(e,t,n)=>{if(e.stopPropagation(),!Ae.has(t.sessionId)){je(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await w(`/api/admin/session-archive`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId,mode:n})});if(!e.ok){let r=await e.json().catch(()=>({})),i=r.detail??r.error??`status ${e.status}`;console.error(`[admin-ui] sidebar-session-archive-failed sessionId=${t.sessionId} mode=${n} status=${e.status} error=${r.error??`unknown`}`),z({message:`${n===`archive`?`Archive`:`Unarchive`} failed: ${i}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-archive sessionId=${t.sessionId} mode=${n}`),Z()}catch(e){let r=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-archive-failed sessionId=${t.sessionId} mode=${n} error=${r}`),z({message:`${n===`archive`?`Archive`:`Unarchive`} failed: ${r}`,failed:!0})}finally{je(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[w,Ae,Z]);return(0,O.jsxs)(`aside`,{className:`side`,children:[(0,O.jsx)(`div`,{className:`side-new-session-row`,children:(0,O.jsxs)(`button`,{type:`button`,className:`side-new-session`,onClick:Ze,disabled:Y,"aria-busy":Y,children:[(0,O.jsx)(te,{size:14}),(0,O.jsx)(`span`,{children:Y?`Spawning…`:`New session`})]})}),(0,O.jsxs)(`nav`,{className:`side-nav`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=people`),m(),x()},children:[(0,O.jsx)(ie,{size:20,strokeWidth:$}),(0,O.jsx)(`span`,{className:`label`,children:`People`}),(0,O.jsx)(`span`,{className:`kbd`})]}),(0,O.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=agents`),y(),x()},children:[(0,O.jsx)(d,{size:20,strokeWidth:$}),(0,O.jsx)(`span`,{className:`label`,children:`Agents`}),(0,O.jsx)(`span`,{className:`kbd`})]}),(0,O.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=projects`),p(),x()},children:[(0,O.jsx)(f,{size:20,strokeWidth:$}),(0,O.jsx)(`span`,{className:`label`,children:`Projects`}),(0,O.jsx)(`span`,{className:`kbd`})]}),(0,O.jsxs)(`button`,{type:`button`,className:`nav-row`,onClick:()=>{console.info(`[admin-ui] sidebar-nav surface=tasks`),_(),x()},children:[(0,O.jsx)(b,{size:20,strokeWidth:$}),(0,O.jsx)(`span`,{className:`label`,children:`Tasks`}),(0,O.jsx)(`span`,{className:`kbd`})]}),(0,O.jsxs)(`button`,{type:`button`,className:`nav-row${A===`artefacts`?` active`:``}`,onClick:We,children:[(0,O.jsx)(t,{size:20,strokeWidth:$}),(0,O.jsx)(`span`,{className:`label`,children:`Artefacts`}),(0,O.jsx)(`span`,{className:`kbd`})]}),(0,O.jsxs)(`button`,{type:`button`,className:`nav-row${A===`sessions`?` active`:``}`,onClick:Ke,children:[(0,O.jsx)(v,{size:20,strokeWidth:$}),(0,O.jsx)(`span`,{className:`label`,children:`Sessions`}),(0,O.jsx)(`span`,{className:`kbd`})]}),Fe&&pe.filter(e=>Q.get(e).length>0).map(e=>(0,O.jsxs)(`button`,{type:`button`,className:`nav-row${A===`whatsapp`&&X===e?` active`:``}`,onClick:()=>Je(e),children:[(0,O.jsx)(fe,{channel:e,size:16}),(0,O.jsx)(`span`,{className:`label`,children:Ue[e]}),(0,O.jsx)(`span`,{className:`kbd`})]},e)),Le&&(0,O.jsx)(`div`,{className:`nav-row`,style:{color:`var(--text-tertiary)`,cursor:`default`},"aria-disabled":`true`,children:(0,O.jsx)(`span`,{className:`label`,children:Le})})]}),A===`artefacts`&&(0,O.jsxs)(`div`,{className:`side-list`,children:[(0,O.jsxs)(`div`,{className:`group-head`,children:[(0,O.jsx)(`span`,{children:`Artefacts`}),(0,O.jsxs)(`span`,{className:`group-head-meta`,children:[(0,O.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh artefacts`,"aria-label":`Refresh artefacts`,onClick:Ge,disabled:F,children:(0,O.jsx)(T,{size:12,className:F?`spinning`:void 0})}),(0,O.jsx)(`span`,{children:F?`…`:String(M.length)})]})]}),P&&(0,O.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:P}),N&&!P&&M.length>0&&(()=>{let e=M.filter(e=>e.kind===`agent-template`).length,t=M.length-e;return(0,O.jsx)(`div`,{className:`artefact-filter-chips`,children:[{key:`all`,label:`All`,count:M.length},{key:`agent`,label:`Agents`,count:e},{key:`file`,label:`Files`,count:t}].map(e=>(0,O.jsxs)(`button`,{type:`button`,className:`artefact-filter-chip${L===e.key?` active`:``}`,onClick:()=>ce(e.key),disabled:e.count===0&&e.key!==`all`,children:[e.label,(0,O.jsx)(`span`,{className:`artefact-filter-chip-count`,children:e.count})]},e.key))})})(),N&&!P&&M.length===0&&(0,O.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No artefacts yet`}),M.filter(e=>L===`all`?!0:L===`agent`?e.kind===`agent-template`:e.kind!==`agent-template`).map(e=>{let n=e.kind===`agent-template`,r=n?d:t,i=Date.parse(e.updatedAt),a=Number.isFinite(i)?new Date(i).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):``,o=e.downloadPath!==null;return(0,O.jsxs)(`button`,{type:`button`,className:`conv`,onClick:()=>Be(e),disabled:!o,style:o?void 0:{cursor:`default`},title:o?`Download ${e.name}`:`${e.name} can’t be downloaded`,children:[(0,O.jsx)(r,{size:14,className:`conv-icon`,"data-kind":n?`agent`:`file`,"aria-label":n?`agent template`:`file`}),(0,O.jsxs)(`span`,{className:`conv-stack`,children:[(0,O.jsx)(`span`,{className:`conv-name-line`,children:(0,O.jsx)(`span`,{className:`conv-name`,children:e.name})}),a&&(0,O.jsx)(`span`,{className:`conv-timestamp`,children:a})]}),o&&(0,O.jsx)(h,{size:12,className:`conv-rc-icon`,"aria-hidden":`true`})]},e.id)})]}),A===`sessions`&&(()=>{let e=V.filter(e=>G?!0:!e.isSubagent).filter(e=>q?!0:!e.archived),t=V.some(e=>e.isSubagent),n=V.some(e=>e.archived);return(0,O.jsxs)(`div`,{className:`side-list`,children:[(0,O.jsxs)(`div`,{className:`group-head`,children:[(0,O.jsx)(`span`,{children:`Sessions`}),(0,O.jsxs)(`span`,{className:`group-head-meta`,children:[(0,O.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh sessions`,"aria-label":`Refresh sessions`,onClick:qe,disabled:W,children:(0,O.jsx)(T,{size:12,className:W?`spinning`:void 0})}),(0,O.jsx)(`span`,{children:W?`…`:String(e.length)})]})]}),Ce&&(0,O.jsx)(`div`,{className:`side-account-id`,title:`This install's accountId. The first 8 characters match the truncated UUID label on the live Remote Control daemon entry in claude.ai/code.`,children:(0,O.jsx)(`code`,{children:Ce})}),(t||n)&&(0,O.jsxs)(`div`,{className:`artefact-filter-chips`,children:[t&&(0,O.jsx)(`button`,{type:`button`,className:`artefact-filter-chip${G?` active`:``}`,onClick:()=>K(e=>!e),title:G?`Hide subagent sessions`:`Show subagent sessions`,children:`Subagents`}),n&&(0,O.jsx)(`button`,{type:`button`,className:`artefact-filter-chip${q?` active`:``}`,onClick:()=>Se(e=>!e),title:q?`Hide archived sessions`:`Show archived sessions`,children:`Archived`})]}),U&&(0,O.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:U}),H&&!U&&e.length===0&&(0,O.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No sessions yet`}),e.map(e=>{let t=Date.parse(e.startedAt),n=Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):``,r=Ee.has(e.sessionId),i=Te.has(e.sessionId),a=Oe.has(e.sessionId),o=Ae.has(e.sessionId);return(0,O.jsxs)(`div`,{className:`conv conv-with-actions`,children:[(0,O.jsxs)(`div`,{className:`conv-main-static`,children:[(0,O.jsx)(`span`,{className:`conv-live-dot`,"data-live":e.live?`1`:`0`,"aria-label":e.live?`live session`:`ended session`}),(0,O.jsxs)(`span`,{className:`conv-stack`,children:[(0,O.jsx)(`span`,{className:`conv-name-line`,children:(0,O.jsx)(`span`,{className:`conv-name`,title:e.title,children:e.title})}),(0,O.jsxs)(`span`,{className:`conv-timestamp`,children:[(0,O.jsx)(`code`,{className:`conv-session-id`,title:`First 8 characters of this session's id — distinguishes rows with identical auto-titles. The resume/delete buttons act on the full id.`,children:e.sessionId.slice(0,8)}),n&&(0,O.jsxs)(`span`,{children:[` · `,n]})]})]})]}),(0,O.jsxs)(`div`,{className:`conv-actions`,children:[e.resumable===!1?(0,O.jsx)(`span`,{className:`conv-ephemeral`,title:`Public webchat session — ephemeral, not resumable`,"aria-label":`Ephemeral public session (not resumable)`,children:(0,O.jsx)(v,{size:12})}):(0,O.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:()=>{Ye(e)},disabled:r||i||a||o,"aria-busy":r,"aria-label":`Resume session ${e.title} in claude.ai/code`,title:`Resume in a fresh local Remote Control PTY`,children:(0,O.jsx)(g,{size:12})}),e.live?(0,O.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:t=>{$e(t,e)},disabled:r||i||a||o,"aria-busy":a,"aria-label":`Stop session ${e.title}`,title:`Stop session process (keeps the conversation, can resume later)`,children:(0,O.jsx)(re,{size:12})}):null,e.archived?(0,O.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:t=>{et(t,e,`unarchive`)},disabled:r||i||a||o,"aria-busy":o,"aria-label":`Unarchive session ${e.title}`,title:`Unarchive (move back to the active list)`,children:(0,O.jsx)(l,{size:12})}):(0,O.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:t=>{et(t,e,`archive`)},disabled:r||i||a||o,"aria-busy":o,"aria-label":`Archive session ${e.title}`,title:`Archive (hide from the list, keeps the conversation resumable)`,children:(0,O.jsx)(u,{size:12})}),(0,O.jsx)(`button`,{type:`button`,className:`conv-action conv-action-danger`,onClick:t=>{Qe(t,e)},disabled:r||i||a||o,"aria-busy":i,"aria-label":`Delete session ${e.title}`,title:`Delete session (stops the process, removes the conversation)`,children:(0,O.jsx)(c,{size:12})})]})]},e.sessionId)})]})})(),A===`whatsapp`&&(0,O.jsxs)(`div`,{className:`side-list`,children:[(0,O.jsxs)(`div`,{className:`group-head`,children:[(0,O.jsx)(`span`,{children:Ue[X]}),(0,O.jsxs)(`span`,{className:`group-head-meta`,children:[(0,O.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh conversations`,"aria-label":`Refresh conversations`,onClick:()=>{He()},children:(0,O.jsx)(T,{size:12})}),(0,O.jsx)(`span`,{children:String(Q.get(X).length)})]})]}),Q.get(X).map(e=>(0,O.jsxs)(`button`,{type:`button`,className:`conv${ee===e.sessionId?` active`:``}`,onClick:()=>{C(e),x()},title:e.title,children:[(0,O.jsx)(fe,{channel:e.channel,size:14}),(0,O.jsx)(`span`,{className:`conv-stack`,children:(0,O.jsx)(`span`,{className:`conv-name-line`,children:(0,O.jsx)(`span`,{className:`conv-name`,children:e.operatorName??e.senderId??e.title})})})]},e.sessionId))]}),(0,O.jsx)(xe,{}),(0,O.jsxs)(`div`,{className:`side-foot`,children:[(0,O.jsx)(`div`,{className:`avatar`,children:s?(0,O.jsx)(`img`,{src:s,alt:E}):k}),(0,O.jsxs)(`div`,{className:`who`,children:[(0,O.jsx)(`span`,{className:`name`,children:E}),(0,O.jsx)(`span`,{className:`role`,children:i??`operator`})]})]}),R&&(0,O.jsx)(`div`,{className:`copy-toast${R.failed?` copy-toast-failed`:``}`,role:`status`,children:R.message}),(0,O.jsx)(ge,{error:le,onClose:()=>B(null)})]})}var G=5e3;function xe(){let[e,t]=(0,D.useState)(null);if((0,D.useEffect)(()=>{let e=!1,n=null;async function r(){try{let n=await fetch(`/api/admin/system-stats`);if(!n.ok){console.error(`[admin-ui] system-stats-fetch-failed status=${n.status}`);return}let r=await n.json();e||t(r)}catch(e){console.error(`[admin-ui] system-stats-fetch-failed reason=${e instanceof Error?e.message:String(e)}`)}}function i(){n===null&&(r(),n=setInterval(()=>{r()},G))}function a(){n!==null&&(clearInterval(n),n=null)}function o(){document.hidden?a():i()}return document.hidden||i(),document.addEventListener(`visibilitychange`,o),()=>{e=!0,a(),document.removeEventListener(`visibilitychange`,o)}},[]),!e||e.platform===`darwin`)return null;let n=e.cpuPct,r=e.memUsedPct,i=n!==null&&n>=.9,a=n!==null&&n>=.98,o=r!==null&&r>=.9,s=r!==null&&r>=.98,c=i||o,l=a||s,u=e=>e===null?`—`:`${Math.round(e*100)}%`,d=e=>{if(e===null)return{width:`0%`,background:`var(--text-tertiary)`};let t=Math.min(1,Math.max(0,e)),n=Math.round(140*(1-t));return{width:`${Math.round(t*100)}%`,background:`hsl(${n}, 65%, 45%)`}},f=[`system-stats`];return c&&f.push(`system-stats--warn`),l&&f.push(`system-stats--crit`),(0,O.jsxs)(`div`,{className:f.join(` `),role:`status`,"aria-label":`host CPU and RAM`,children:[(0,O.jsxs)(`div`,{className:`system-stats__metric`,children:[(0,O.jsxs)(`span`,{className:i?`system-stats__fig system-stats__fig--warn`:`system-stats__fig`,children:[`CPU `,u(n)]}),(0,O.jsx)(`div`,{className:`system-stats__bar`,children:(0,O.jsx)(`div`,{className:`system-stats__bar-fill`,style:d(n)})})]}),(0,O.jsxs)(`div`,{className:`system-stats__metric`,children:[(0,O.jsxs)(`span`,{className:o?`system-stats__fig system-stats__fig--warn`:`system-stats__fig`,children:[`RAM `,u(r)]}),(0,O.jsx)(`div`,{className:`system-stats__bar`,children:(0,O.jsx)(`div`,{className:`system-stats__bar-fill`,style:d(r)})})]})]})}var K=`admin-sidebar-collapsed`,q=`admin-sidebar-drawer-open`;function Se(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(K)===`1`}catch{return!1}}function Ce(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(K,`1`):window.sessionStorage.removeItem(K)}catch{}}function we(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(q)===`1`}catch{return!1}}function Te(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(q,`1`):window.sessionStorage.removeItem(q)}catch{}}var J=720;function Ee(e){let{cacheKey:t,businessName:n,onLogout:r,userName:i,userAvatar:a,role:o,children:s,footer:c}=e,[l,u]=(0,D.useState)(()=>Se()),[d,f]=(0,D.useState)(()=>we()),[p,m]=(0,D.useState)(()=>typeof window<`u`&&window.matchMedia(`(max-width: ${J}px)`).matches),[h,g]=(0,D.useState)(null);(0,D.useEffect)(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: ${J}px)`),t=e=>m(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let _=(0,D.useCallback)(e=>{Ce(e),u(e)},[]),v=(0,D.useCallback)(e=>{Te(e),f(e)},[]);(0,D.useEffect)(()=>{if(typeof window>`u`)return;let e=window.location?.pathname??``;console.info(`[admin-ui] shell-mount route=${e} collapsed=${l} drawer=${d}`)},[]);let y=p?d:!l,b=(0,D.useCallback)(()=>{if(!(typeof window>`u`))if(window.matchMedia(`(max-width: ${J}px)`).matches){let e=d;console.info(`[admin-ui] header-sidebar-toggle from=${e?`open`:`closed`} mode=drawer`),v(!e)}else{let e=l;console.info(`[admin-ui] header-sidebar-toggle from=${e?`closed`:`open`} mode=collapse`),_(!e)}},[l,d,_,v]),x=(0,D.useCallback)(e=>{console.info(`[admin-ui] header-menu-nav target=${e}`);let t=e===`data`?`/data`:e===`graph`?`/graph`:`/browser`;window.location.href=t},[]),S={collapsed:l,mobileDrawerOpen:d,sidebarOpen:y,onToggleSidebar:b,setMobileDrawerOpen:v,selectedWhatsapp:h,onClearWhatsapp:()=>g(null)};return(0,O.jsxs)(`div`,{className:`admin-shell admin-page admin-shell-root`,children:[(0,O.jsx)(V,{businessName:n,onNavigate:x,onToggleSidebar:b,sidebarOpen:y,onLogout:r}),(0,O.jsxs)(`div`,{className:`platform${d?` menu-open`:``}${l?` sidebar-collapsed`:``}`,"data-artefact":`closed`,children:[(0,O.jsx)(be,{businessName:n,cacheKey:t,role:o??null,userName:i,userAvatar:a??null,onSelectProjects:()=>{window.location.href=`/graph?label=Project`},onSelectPeople:()=>{window.location.href=`/graph?label=Person`},onSelectTasks:()=>{window.location.href=`/graph?label=Task`},onSelectAgents:()=>{window.location.href=`/graph?label=Agent`},onCloseMobileDrawer:()=>v(!1),collapsed:l,mobileDrawerOpen:d,selectedWhatsappId:h?.sessionId??null,onSelectWhatsappConversation:g}),typeof s==`function`?s(S):s]}),d&&(0,O.jsx)(`div`,{className:`sidebar-backdrop menu-open`,"aria-hidden":`true`,onClick:()=>v(!1)}),c]})}export{ue as a,E as c,te as d,x as f,m as g,h,le as i,ne as l,g as m,_e as n,R as o,_ as p,me as r,ae as s,Ee as t,T as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{it as e,rt as t}from"./chunk-ICPOFSXX-_ioQjgQ1.js";var n=(n,r)=>e.lang.round(t.parse(n)[r]);export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./src-DLEIsjER.js";import"./chunk-ICPOFSXX-_ioQjgQ1.js";import"./dist-BmvZ8OaX.js";import"./chunk-5PVQY5BW-DWO5wTr8.js";import"./chunk-U2HBQHQK-1ESGrUQ6.js";import"./chunk-FMBD7UC4-DxAQS3UB.js";import"./chunk-BSJP7CBP-U0Fi-Ers.js";import"./chunk-ZZ45TVLE-LW116-Vw.js";import"./chunk-YZCP3GAM-BjIcv7r1.js";import"./chunk-55IACEB6-JLT9m7Hd.js";import"./chunk-EDXVE4YY-BM4DLBML.js";import"./chunk-X2U36JSP-C0MUqJKJ.js";import"./chunk-5FUZZQ4R-BsWXvze8.js";import"./chunk-ENJZ2VHE-aOt2Re1y.js";import"./chunk-336JU56O-D-Cn77jA.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-BI2HTCey.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./src-DLEIsjER.js";import"./chunk-ICPOFSXX-_ioQjgQ1.js";import"./dist-BmvZ8OaX.js";import"./chunk-5PVQY5BW-DWO5wTr8.js";import"./chunk-U2HBQHQK-1ESGrUQ6.js";import"./chunk-FMBD7UC4-DxAQS3UB.js";import"./chunk-BSJP7CBP-U0Fi-Ers.js";import"./chunk-ZZ45TVLE-LW116-Vw.js";import"./chunk-YZCP3GAM-BjIcv7r1.js";import"./chunk-55IACEB6-JLT9m7Hd.js";import"./chunk-EDXVE4YY-BM4DLBML.js";import"./chunk-X2U36JSP-C0MUqJKJ.js";import"./chunk-5FUZZQ4R-BsWXvze8.js";import"./chunk-ENJZ2VHE-aOt2Re1y.js";import"./chunk-336JU56O-D-Cn77jA.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-BI2HTCey.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./graphlib-DS0srZLX.js";var t=4;function n(n){return e(n,t)}export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./src-DLEIsjER.js";import"./chunk-ICPOFSXX-_ioQjgQ1.js";import"./dist-BmvZ8OaX.js";import"./chunk-5PVQY5BW-DWO5wTr8.js";import"./chunk-U2HBQHQK-1ESGrUQ6.js";import"./chunk-BSJP7CBP-U0Fi-Ers.js";import"./chunk-ZZ45TVLE-LW116-Vw.js";import"./chunk-55IACEB6-JLT9m7Hd.js";import"./chunk-EDXVE4YY-BM4DLBML.js";import"./chunk-X2U36JSP-C0MUqJKJ.js";import"./chunk-5FUZZQ4R-BsWXvze8.js";import"./chunk-ENJZ2VHE-aOt2Re1y.js";import"./chunk-336JU56O-D-Cn77jA.js";import{i as t,n,r,t as i}from"./chunk-OYMX7WX6-DkuLduF1.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
|
/package/payload/server/public/assets/{useSelectionMode-DMNfbxHW.js → useSelectionMode-hZ5bdL8b.js}
RENAMED
|
File without changes
|