@rubytech/create-maxy-code 0.1.227 → 0.1.229

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.
Files changed (86) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/plugins/admin/mcp/dist/index.js +9 -20
  3. package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
  4. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +33 -1
  5. package/payload/platform/plugins/admin/skills/qr-code/SKILL.md +6 -5
  6. package/payload/platform/plugins/admin/skills/qr-code/references/data-formats.md +2 -2
  7. package/payload/platform/plugins/admin/skills/unzip-attachment/SKILL.md +1 -1
  8. package/payload/platform/plugins/cloudflare/references/dashboard-guide.md +28 -0
  9. package/payload/platform/plugins/cloudflare/references/serving-published-sites.md +73 -0
  10. package/payload/platform/plugins/cloudflare/skills/setup-tunnel/SKILL.md +1 -1
  11. package/payload/platform/plugins/docs/references/troubleshooting.md +32 -0
  12. package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts.map +1 -1
  13. package/payload/platform/services/claude-session-manager/dist/rc-daemon.js +5 -2
  14. package/payload/platform/services/claude-session-manager/dist/rc-daemon.js.map +1 -1
  15. package/payload/server/public/assets/AdminShell-1-LbiDAw.js +1 -0
  16. package/payload/server/public/assets/{Checkbox-COiFXiXL.js → Checkbox-CfE7p1Tv.js} +1 -1
  17. package/payload/server/public/assets/{admin-DvyQYLR6.js → admin-BrCMyi1e.js} +1 -1
  18. package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-DI6JZI13.js → architectureDiagram-Q4EWVU46-DvDVmNbJ.js} +1 -1
  19. package/payload/server/public/assets/{blockDiagram-DXYQGD6D-dgDvswLd.js → blockDiagram-DXYQGD6D-CVCQHVcw.js} +1 -1
  20. package/payload/server/public/assets/{brand-CAMMU5lz.css → brand-hVIfBy3s.css} +1 -1
  21. package/payload/server/public/assets/{c4Diagram-AHTNJAMY-odaGY4GZ.js → c4Diagram-AHTNJAMY-DancbaY-.js} +1 -1
  22. package/payload/server/public/assets/channel-t5srld-W.js +1 -0
  23. package/payload/server/public/assets/{chunk-336JU56O-BpbY8F27.js → chunk-336JU56O-DL5O4-qf.js} +2 -2
  24. package/payload/server/public/assets/{chunk-426QAEUC-BWbVhEVC.js → chunk-426QAEUC-Dqt07sZz.js} +1 -1
  25. package/payload/server/public/assets/{chunk-4TB4RGXK-C3IfRdvA.js → chunk-4TB4RGXK-Bdm77ygl.js} +1 -1
  26. package/payload/server/public/assets/{chunk-5FUZZQ4R-CSRMBAGr.js → chunk-5FUZZQ4R-nDbgOH1b.js} +1 -1
  27. package/payload/server/public/assets/{chunk-5PVQY5BW-CGAe6GJJ.js → chunk-5PVQY5BW-mYip6Ias.js} +1 -1
  28. package/payload/server/public/assets/{chunk-EDXVE4YY-BnXC8cYQ.js → chunk-EDXVE4YY-DubyAY7F.js} +1 -1
  29. package/payload/server/public/assets/{chunk-ENJZ2VHE-7qfDalAB.js → chunk-ENJZ2VHE-DIa8CJbF.js} +1 -1
  30. package/payload/server/public/assets/{chunk-ICPOFSXX-TRvVGIDw.js → chunk-ICPOFSXX-bKmK-tZo.js} +1 -1
  31. package/payload/server/public/assets/{chunk-OYMX7WX6-Cfv8vBvI.js → chunk-OYMX7WX6-KcUQTwd8.js} +1 -1
  32. package/payload/server/public/assets/{chunk-U2HBQHQK-BfLvbEyu.js → chunk-U2HBQHQK-3p-zDDFG.js} +1 -1
  33. package/payload/server/public/assets/{chunk-X2U36JSP-Cj3k-dYC.js → chunk-X2U36JSP-C5F60GoO.js} +1 -1
  34. package/payload/server/public/assets/{chunk-YZCP3GAM-CygW6I0h.js → chunk-YZCP3GAM-CEhP6XMC.js} +1 -1
  35. package/payload/server/public/assets/{chunk-ZZ45TVLE-CBF3hFJH.js → chunk-ZZ45TVLE-Bac24FOS.js} +1 -1
  36. package/payload/server/public/assets/classDiagram-6PBFFD2Q-197c9FtA.js +1 -0
  37. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-C5RIsovf.js +1 -0
  38. package/payload/server/public/assets/clone-BJPTkE0R.js +1 -0
  39. package/payload/server/public/assets/{dagre-KV5264BT-B2lbkuGd.js → dagre-KV5264BT-DqGsPaYJ.js} +1 -1
  40. package/payload/server/public/assets/{dagre-BTGABQJX.js → dagre-xntZVDsO.js} +1 -1
  41. package/payload/server/public/assets/data-V17bGzzl.js +1 -0
  42. package/payload/server/public/assets/{diagram-5BDNPKRD-BUK4LqT8.js → diagram-5BDNPKRD-Co8NC28s.js} +1 -1
  43. package/payload/server/public/assets/{diagram-G4DWMVQ6-e49HrvxL.js → diagram-G4DWMVQ6-HewQArEf.js} +1 -1
  44. package/payload/server/public/assets/{diagram-MMDJMWI5-k4Kx_qWe.js → diagram-MMDJMWI5-s6NqURmM.js} +1 -1
  45. package/payload/server/public/assets/{diagram-TYMM5635-DzavOUdK.js → diagram-TYMM5635-CAof9UmL.js} +1 -1
  46. package/payload/server/public/assets/{erDiagram-SMLLAGMA-CJKecRhi.js → erDiagram-SMLLAGMA-CUqIICFD.js} +1 -1
  47. package/payload/server/public/assets/{flowDiagram-DWJPFMVM-GM7H1TDt.js → flowDiagram-DWJPFMVM-DN1n7xgU.js} +1 -1
  48. package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-kDEA1A-3.js → ganttDiagram-T4ZO3ILL-sGoWsEWZ.js} +1 -1
  49. package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-jVZZdeg2.js → gitGraphDiagram-UUTBAWPF-Dz_cZL1Q.js} +1 -1
  50. package/payload/server/public/assets/graph-CYsyxGM1.js +51 -0
  51. package/payload/server/public/assets/{graph-labels-CavkO4DG.js → graph-labels-iPC15OmD.js} +1 -1
  52. package/payload/server/public/assets/{graphlib-DFU2rJiY.js → graphlib-eZzlPtt9.js} +1 -1
  53. package/payload/server/public/assets/{infoDiagram-42DDH7IO-CFxVoRBy.js → infoDiagram-42DDH7IO-DFMOgYMn.js} +1 -1
  54. package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-CDvZs3Ua.js → ishikawaDiagram-UXIWVN3A-C9AGnqZn.js} +1 -1
  55. package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-DUI1m9vW.js → journeyDiagram-VCZTEJTY-C4-y1Faf.js} +1 -1
  56. package/payload/server/public/assets/{kanban-definition-6JOO6SKY-C_jSVK7W.js → kanban-definition-6JOO6SKY-DIynz-Si.js} +1 -1
  57. package/payload/server/public/assets/{line-DfwJeo6J.js → line-CzaIC22F.js} +1 -1
  58. package/payload/server/public/assets/{mermaid-parser.core-BN-2kBfU.js → mermaid-parser.core-Dcdye_D2.js} +1 -1
  59. package/payload/server/public/assets/{mermaid.core-C6amhHAQ.js → mermaid.core-HWxg8X0R.js} +3 -3
  60. package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-eTKDlw3c.js → mindmap-definition-QFDTVHPH-ve0J3SsF.js} +1 -1
  61. package/payload/server/public/assets/{pieDiagram-DEJITSTG-DNX5VeMZ.js → pieDiagram-DEJITSTG-DdiZi8Iv.js} +1 -1
  62. package/payload/server/public/assets/{public-BADBLzOZ.js → public-DbW8Up_b.js} +3 -3
  63. package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-BFnmYiHX.js → quadrantDiagram-34T5L4WZ-CvNd8CMM.js} +1 -1
  64. package/payload/server/public/assets/{requirementDiagram-MS252O5E-DvHvTyzu.js → requirementDiagram-MS252O5E-8LsItfG7.js} +1 -1
  65. package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-CMFnNT1G.js → sankeyDiagram-XADWPNL6-CoXsggQF.js} +1 -1
  66. package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-BYon1ouU.js → sequenceDiagram-FGHM5R23-CxtIGmey.js} +1 -1
  67. package/payload/server/public/assets/{stateDiagram-FHFEXIEX-n6l3hcuJ.js → stateDiagram-FHFEXIEX-C2zgoy3P.js} +1 -1
  68. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-C3CpI3Q7.js +1 -0
  69. package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-DFPFHrQF.js → timeline-definition-GMOUNBTQ-DQ_J-0lx.js} +1 -1
  70. package/payload/server/public/assets/{useSelectionMode-iqIyL24g.js → useSelectionMode-BbLqtKTJ.js} +1 -1
  71. package/payload/server/public/assets/{vennDiagram-DHZGUBPP-DZLturYa.js → vennDiagram-DHZGUBPP-B7Y7Cw54.js} +1 -1
  72. package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-BBt2pdjM.js → wardleyDiagram-NUSXRM2D-1XkR1IH-.js} +1 -1
  73. package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-DOZxLvEi.js → xychartDiagram-5P7HB3ND-CcatDElf.js} +1 -1
  74. package/payload/server/public/data.html +5 -5
  75. package/payload/server/public/graph.html +6 -6
  76. package/payload/server/public/index.html +6 -6
  77. package/payload/server/public/public.html +5 -5
  78. package/payload/server/public/assets/AdminShell-DPmNVsja.js +0 -1
  79. package/payload/server/public/assets/channel-DfwLbKck.js +0 -1
  80. package/payload/server/public/assets/classDiagram-6PBFFD2Q-CE0XZQre.js +0 -1
  81. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-Bj41Y3XD.js +0 -1
  82. package/payload/server/public/assets/clone-DTd5nONj.js +0 -1
  83. package/payload/server/public/assets/data-6BwvUMsS.js +0 -1
  84. package/payload/server/public/assets/graph-CEp8nRBr.js +0 -51
  85. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-CS46-Mhi.js +0 -1
  86. /package/payload/server/public/assets/{brand-DfykKss4.js → brand-Dmpzr6Qq.js} +0 -0
@@ -5,12 +5,12 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/public-BADBLzOZ.js"></script>
8
+ <script type="module" crossorigin src="/assets/public-DbW8Up_b.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
10
- <link rel="modulepreload" crossorigin href="/assets/brand-DfykKss4.js">
11
- <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-iqIyL24g.js">
12
- <link rel="modulepreload" crossorigin href="/assets/Checkbox-COiFXiXL.js">
13
- <link rel="stylesheet" crossorigin href="/assets/brand-CAMMU5lz.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/brand-Dmpzr6Qq.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/useSelectionMode-BbLqtKTJ.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/Checkbox-CfE7p1Tv.js">
13
+ <link rel="stylesheet" crossorigin href="/assets/brand-hVIfBy3s.css">
14
14
  <link rel="stylesheet" href="/brand-defaults.css">
15
15
  </head>
16
16
  <body>
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-DD-I1_y5.js";import{c as t,d as n,i as r,l as i,o as a,s as o,t as s}from"./brand-DfykKss4.js";var c=i(`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`}]]),l=i(`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`}]]),u=i(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),d=i(`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`}]]),f=i(`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`}]]),p=i(`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`}]]),m=i(`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`}]]),h=i(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),g=i(`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`}]]),_=i(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),v=i(`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`}]]),y=i(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),b=i(`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`}]]),x=i(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),S=i(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),C=i(`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`}]]),w=i(`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`}]]),T=i(`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=i(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),D=e(n(),1),O=a(),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 ee({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`,P=typeof BroadcastChannel<`u`;function F(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 I(e){if(!P)return()=>{};let t=new BroadcastChannel(N),n=t=>{if(!F(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 L=`maxy-admin-session-key`;function R(e,t){return`${e}${e.includes(`?`)?`&`:`?`}session_key=${encodeURIComponent(t)}`}async function z(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 B(){try{return sessionStorage.getItem(L)}catch{return null}}function V(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),[c,l]=(0,D.useState)(null);(0,D.useEffect)(()=>I(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,D.useCallback)(()=>{try{sessionStorage.removeItem(L)}catch{}window.location.href=`/`},[]);return{adminFetch:(0,D.useCallback)(async(e,t)=>{let r=a.current,o=R(e,r),c=await fetch(o,t);if(c.status!==401)return c;let d=await z(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=B();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=R(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 H=(0,D.createContext)(null);function U({cacheKey:e,onSessionExpired:t,surface:n,children:r}){let i=(0,D.useCallback)(async(r,i)=>{if(!e)return fetch(r,i);let a=R(r,e),o=await fetch(a,i);if(o.status!==401)return o;let s=await z(o),c=e.slice(-8);if(s===`session-not-registered`){let a=B();if(a&&a!==e){let e=R(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)(H.Provider,{value:i,children:r})}function te(){return(0,D.useContext)(H)}function ne(e){let t=te();return(0,D.useMemo)(()=>t||(async(t,n)=>fetch(e?R(t,e):t,n)),[t,e])}function W(e){let{businessName:t,onNavigate:n,onToggleSidebar:i,sidebarOpen:a,onLogout:c}=e,[l,f]=(0,D.useState)(!1),m=(0,D.useRef)(null),g=(0,D.useRef)(null),S=ne(null),[C,T]=(0,D.useState)(null),[k,A]=(0,D.useState)(!1),[j,M]=(0,D.useState)(null),[ee,N]=(0,D.useState)(null),[P,F]=(0,D.useState)(null),[I,L]=(0,D.useState)(``);(0,D.useEffect)(()=>{L(window.location.hostname.startsWith(`admin.`)?window.location.origin.replace(`admin.`,`public.`):window.location.origin)},[]),(0,D.useEffect)(()=>{if(!l)return;let e=e=>{m.current&&!m.current.contains(e.target)&&f(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[l]),(0,D.useEffect)(()=>{if(!l)return;let e=e=>{e.key===`Escape`&&f(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[l]),(0,D.useEffect)(()=>{l&&g.current?.focus()},[l]),(0,D.useEffect)(()=>{if(!l)return;let e=!1;return S(`/api/admin/version`).then(e=>e.json()).then(t=>{e||F(t)}).catch(e=>{console.error(`[admin/version] menu-open client fetch failed:`,e)}),()=>{e=!0}},[l,S]);let R=(0,D.useCallback)(()=>{f(e=>{let t=!e;return t&&console.info(`[admin-ui] header-menu-open`),t})},[]),z=(0,D.useCallback)(e=>{f(!1),n(e)},[n]),B=(0,D.useCallback)(async()=>{if(C!==null){T(null),N(null);return}A(!0),M(null);try{let e=await S(`/api/admin/agents`);if(!e.ok)throw Error(`Failed to load agents`);T((await e.json()).agents??[])}catch(e){console.error(`[admin/agents] list failed:`,e),M(e instanceof Error?e.message:String(e)),T([])}finally{A(!1)}},[C,S]),V=(0,D.useCallback)(e=>{N(null),T(t=>t?.filter(t=>t.slug!==e)??null),S(`/api/admin/agents/${encodeURIComponent(e)}`,{method:`DELETE`}).catch(e=>console.error(`[admin/agents] delete failed:`,e))},[S]),H=(0,D.useCallback)(()=>{f(!1),c()},[c]),U=t||s.productName;return(0,O.jsxs)(`header`,{className:`admin-header`,children:[(0,O.jsx)(`button`,{type:`button`,className:`admin-sidebar-toggle`,"aria-label":a?`Hide sidebar`:`Show sidebar`,title:a?`Hide sidebar`:`Show sidebar`,"aria-expanded":a,onClick:i,children:a?(0,O.jsx)(b,{size:20,strokeWidth:1.5}):(0,O.jsx)(x,{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:r,alt:``,className:`chat-logo`})}),(0,O.jsx)(`h1`,{className:`chat-tagline`,children:U})]}),(0,O.jsxs)(`div`,{className:`chat-burger-wrap`,ref:m,children:[(0,O.jsx)(`button`,{type:`button`,className:`admin-burger`,onClick:R,"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":l,children:(0,O.jsx)(y,{size:20})}),l&&(0,O.jsxs)(`div`,{className:`admin-menu`,role:`menu`,children:[(0,O.jsxs)(`button`,{ref:g,type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>z(`data`),children:[(0,O.jsx)(d,{size:14}),` Data`]}),(0,O.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:()=>z(`graph`),children:[(0,O.jsx)(w,{size:14}),` Graph`]}),(0,O.jsx)(`div`,{className:`chat-menu-divider`}),(0,O.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:B,children:[(0,O.jsx)(p,{size:14}),` Public`,k&&(0,O.jsx)(_,{size:12,className:`spin`})]}),C!==null&&(0,O.jsxs)(`div`,{className:`chat-menu-agents`,children:[j&&(0,O.jsx)(`span`,{className:`chat-menu-agent-error`,children:j}),C.length===0&&!j&&(0,O.jsx)(`span`,{className:`chat-menu-agent-empty`,children:`No public agents configured`}),C.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]})]}),ee===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:()=>V(e.slug),children:(0,O.jsx)(u,{size:12})}),(0,O.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-confirm-no`,title:`Cancel`,onClick:()=>N(null),children:(0,O.jsx)(E,{size:12})})]}):(0,O.jsxs)(`span`,{className:`agent-actions`,children:[(0,O.jsx)(`a`,{href:`${I}/${e.slug}`,target:`_blank`,rel:`noopener noreferrer`,className:`agent-action-btn`,title:`Open agent`,onClick:()=>f(!1),children:(0,O.jsx)(p,{size:12})}),(0,O.jsx)(`button`,{type:`button`,className:`agent-action-btn agent-delete-btn`,title:`Delete agent`,onClick:()=>N(e.slug),children:(0,O.jsx)(o,{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)(h,{size:14}),(0,O.jsxs)(`span`,{className:`version-installed`,children:[P?`v${P.installed}`:`…`,P&&!P.updateAvailable&&(0,O.jsx)(`span`,{className:`version-uptodate-dot`}),P?.updateAvailable&&(0,O.jsx)(`span`,{className:`version-update-dot`})]})]}),(0,O.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,role:`menuitem`,onClick:H,children:[(0,O.jsx)(v,{size:14}),` Log out`]})]})]})]})}function re(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()}var ie=`https://claude.ai/code`;function ae(e){let{businessName:n,cacheKey:r,role:i,userName:a,userAvatar:u,onSelectProjects:d,onSelectPeople:h,onSelectTasks:_,onSelectAgents:v,onCloseMobileDrawer:y,collapsed:b}=e,x=ne(r),w=s.productName,E=typeof a==`string`?a:a===null?`name unavailable`:n||w,k=(E.trim().charAt(0)||`?`).toUpperCase(),[A,j]=(0,D.useState)(`sessions`),[M,ee]=(0,D.useState)([]),[N,P]=(0,D.useState)(!1),[F,I]=(0,D.useState)(null),[L,R]=(0,D.useState)(!1),[z,B]=(0,D.useState)(`file`),[V,H]=(0,D.useState)(null),[U,te]=(0,D.useState)([]),[W,ae]=(0,D.useState)(!1),[G,K]=(0,D.useState)(null),[q,se]=(0,D.useState)(!1),[J,ce]=(0,D.useState)(!1),[le,Y]=(0,D.useState)(null),[X,ue]=(0,D.useState)(new Set),[de,fe]=(0,D.useState)(new Set),[Z,pe]=(0,D.useState)(!1),me=(0,D.useCallback)(e=>{if(y(),!r){console.error(`[admin-ui] artefact-download-blocked id=${e.id} reason=no-cache-key`),H({message:`Session not ready — try again`,failed:!0});return}if(!e.downloadPath){console.error(`[admin-ui] artefact-download-blocked id=${e.id} reason=not-downloadable`),H({message:`${e.name} can’t be downloaded`,failed:!0});return}console.info(`[admin-ui] artefact-download id=${e.id} root=${e.downloadRoot??`data`} path=${e.downloadPath}`),re(r,e.downloadPath,e.downloadRoot??`data`),H({message:`Downloading ${e.name}`,failed:!1})},[r,y]);(0,D.useEffect)(()=>{if(!V)return;let e=setTimeout(()=>H(null),2500);return()=>clearTimeout(e)},[V]);let he=(0,D.useCallback)(async()=>{if(r){R(!0),I(null);try{let e=await x(`/api/admin/sidebar-artefacts`);if(!e.ok)throw Error(`status ${e.status}`);ee((await e.json()).artefacts??[]),P(!0)}catch(e){let t=e instanceof Error?e.message:String(e);I(`Failed to load artefacts: ${t}`),console.error(`[admin-ui] sidebar-artefacts fetch failed: ${t}`)}finally{R(!1)}}},[r,x]);(0,D.useEffect)(()=>{!r||W||$()},[r,W,$]);let ge=()=>{j(`artefacts`),console.info(`[admin-ui] sidebar-nav surface=artefacts count=${N?M.length:0} collapsed=${b}`),he()},Q=1.5,_e=()=>{console.info(`[admin-ui] sidebar-refresh surface=artefacts`),he()},$=(0,D.useCallback)(async()=>{if(r){se(!0),K(null);try{let e=await x(`/api/admin/sidebar-sessions`);if(!e.ok)throw Error(`status ${e.status}`);let t=await e.json();te(t.sessions??[]),Y(t.accountId??null),ae(!0)}catch(e){let t=e instanceof Error?e.message:String(e);K(`Failed to load sessions: ${t}`),console.error(`[admin-ui] sidebar-sessions fetch failed: ${t}`)}finally{se(!1)}}},[r,x]),ve=()=>{j(`sessions`),console.info(`[admin-ui] sidebar-nav surface=sessions count=${W?U.length:0} collapsed=${b}`),W||$()},ye=()=>{console.info(`[admin-ui] sidebar-refresh surface=sessions`),$()},be=(0,D.useCallback)(async e=>{if(!de.has(e.sessionId)){fe(t=>{let n=new Set(t);return n.add(e.sessionId),n});try{let t=await x(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:e.sessionId,name:e.title||e.sessionId})});if(!t.ok){let n=await t.json().catch(()=>({}));console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} status=${t.status} error=${n.error??`unknown`}`),H({message:`Resume failed: ${n.error??`status ${t.status}`}`,failed:!0});return}let n=await t.json();console.info(`[admin-ui] sidebar-session-resume sessionId=${e.sessionId} spawnedPid=${n.spawnedPid??`?`}`),y(),window.open(ie,`_blank`,`noopener,noreferrer`)}catch(t){let n=t instanceof Error?t.message:String(t);console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} error=${n}`),H({message:`Resume failed: ${n}`,failed:!0})}finally{fe(t=>{let n=new Set(t);return n.delete(e.sessionId),n})}}},[x,y,de]),xe=(0,D.useCallback)(async()=>{if(!Z){pe(!0);try{let e=await x(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});if(!e.ok){let t=await e.json().catch(()=>({}));console.error(`[admin-ui] sidebar-new-session-failed status=${e.status} error=${t.error??`unknown`}`),H({message:`New session failed: ${t.error??`status ${e.status}`}`,failed:!0});return}let t=await e.json();console.info(`[admin-ui] sidebar-new-session-spawned spawnedPid=${t.spawnedPid??`?`}`),window.open(ie,`_blank`,`noopener,noreferrer`)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-new-session-failed error=${t}`),H({message:`New session failed: ${t}`,failed:!0})}finally{pe(!1)}}},[x,Z]),Se=(0,D.useCallback)(async(e,t)=>{if(e.stopPropagation(),!X.has(t.sessionId)){ue(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await x(`/api/admin/session-delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId,projectDir:t.projectDir})});if(!e.ok){let n=await e.json().catch(()=>({}));console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${t.sessionId} status=${e.status} error=${n.error??`unknown`}`),H({message:`Delete failed: ${n.error??`status ${e.status}`}`,failed:!0});return}let n=await e.json();console.info(`[admin-ui] sidebar-session-delete sessionId=${t.sessionId} pidKilled=${n.pidKilled??`?`} deleted=${n.deleted??`?`}`),te(e=>e.filter(e=>e.sessionId!==t.sessionId)),$()}catch(e){let n=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${t.sessionId} error=${n}`),H({message:`Delete failed: ${n}`,failed:!0})}finally{ue(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[x,X,$]);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:xe,disabled:Z,"aria-busy":Z,children:[(0,O.jsx)(S,{size:14}),(0,O.jsx)(`span`,{children:Z?`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`),h(),y()},children:[(0,O.jsx)(T,{size:20,strokeWidth:Q}),(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`),v(),y()},children:[(0,O.jsx)(c,{size:20,strokeWidth:Q}),(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`),d(),y()},children:[(0,O.jsx)(l,{size:20,strokeWidth:Q}),(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`),_(),y()},children:[(0,O.jsx)(g,{size:20,strokeWidth:Q}),(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:ge,children:[(0,O.jsx)(t,{size:20,strokeWidth:Q}),(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:ve,children:[(0,O.jsx)(m,{size:20,strokeWidth:Q}),(0,O.jsx)(`span`,{className:`label`,children:`Sessions`}),(0,O.jsx)(`span`,{className:`kbd`})]})]}),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:_e,disabled:L,children:(0,O.jsx)(C,{size:12,className:L?`spinning`:void 0})}),(0,O.jsx)(`span`,{children:L?`…`:String(M.length)})]})]}),F&&(0,O.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:F}),N&&!F&&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${z===e.key?` active`:``}`,onClick:()=>B(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&&!F&&M.length===0&&(0,O.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No artefacts yet`}),M.filter(e=>z===`all`?!0:z===`agent`?e.kind===`agent-template`:e.kind!==`agent-template`).map(e=>{let n=e.kind===`agent-template`,r=n?c: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:()=>me(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)(f,{size:12,className:`conv-rc-icon`,"aria-hidden":`true`})]},e.id)})]}),A===`sessions`&&(()=>{let e=J?U:U.filter(e=>!e.isSubagent),t=U.some(e=>e.isSubagent);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:ye,disabled:q,children:(0,O.jsx)(C,{size:12,className:q?`spinning`:void 0})}),(0,O.jsx)(`span`,{children:q?`…`:String(e.length)})]})]}),le&&(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:le})}),t&&(0,O.jsx)(`div`,{className:`artefact-filter-chips`,children:(0,O.jsx)(`button`,{type:`button`,className:`artefact-filter-chip${J?` active`:``}`,onClick:()=>ce(e=>!e),title:J?`Hide subagent sessions`:`Show subagent sessions`,children:`Subagents`})}),G&&(0,O.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:G}),W&&!G&&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=de.has(e.sessionId),i=X.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`,children:e.title})}),n&&(0,O.jsx)(`span`,{className:`conv-timestamp`,children:n})]})]}),(0,O.jsxs)(`div`,{className:`conv-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`conv-action`,onClick:()=>{be(e)},disabled:r||i,"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)(p,{size:12})}),(0,O.jsx)(`button`,{type:`button`,className:`conv-action conv-action-danger`,onClick:t=>{Se(t,e)},disabled:r||i,"aria-busy":i,"aria-label":`Delete session ${e.title}`,title:`Delete session (kills PID if live, removes JSONL)`,children:(0,O.jsx)(o,{size:12})})]})]},e.sessionId)})]})})(),(0,O.jsx)(oe,{}),(0,O.jsxs)(`div`,{className:`side-foot`,children:[(0,O.jsx)(`div`,{className:`avatar`,children:u?(0,O.jsx)(`img`,{src:u,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`})]})]}),V&&(0,O.jsx)(`div`,{className:`copy-toast${V.failed?` copy-toast-failed`:``}`,role:`status`,children:V.message})]})}var G=5e3;function oe(){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 J(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(K,`1`):window.sessionStorage.removeItem(K)}catch{}}function ce(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(q)===`1`}catch{return!1}}function le(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(q,`1`):window.sessionStorage.removeItem(q)}catch{}}var Y=720;function X(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)(()=>ce()),[p,m]=(0,D.useState)(()=>typeof window<`u`&&window.matchMedia(`(max-width: ${Y}px)`).matches);(0,D.useEffect)(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: ${Y}px)`),t=e=>m(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let h=(0,D.useCallback)(e=>{J(e),u(e)},[]),g=(0,D.useCallback)(e=>{le(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 _=p?d:!l,v=(0,D.useCallback)(()=>{if(!(typeof window>`u`))if(window.matchMedia(`(max-width: ${Y}px)`).matches){let e=d;console.info(`[admin-ui] header-sidebar-toggle from=${e?`open`:`closed`} mode=drawer`),g(!e)}else{let e=l;console.info(`[admin-ui] header-sidebar-toggle from=${e?`closed`:`open`} mode=collapse`),h(!e)}},[l,d,h,g]),y=(0,D.useCallback)(e=>{console.info(`[admin-ui] header-menu-nav target=${e}`),window.location.href=e===`data`?`/data`:`/graph`},[]),b={collapsed:l,mobileDrawerOpen:d,sidebarOpen:_,onToggleSidebar:v,setMobileDrawerOpen:g};return(0,O.jsxs)(`div`,{className:`admin-shell admin-page admin-shell-root`,children:[(0,O.jsx)(W,{businessName:n,onNavigate:y,onToggleSidebar:v,sidebarOpen:_,onLogout:r}),(0,O.jsxs)(`div`,{className:`platform${d?` menu-open`:``}${l?` sidebar-collapsed`:``}`,"data-artefact":`closed`,children:[(0,O.jsx)(ae,{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:()=>g(!1),collapsed:l,mobileDrawerOpen:d}),typeof s==`function`?s(b):s]}),d&&(0,O.jsx)(`div`,{className:`sidebar-backdrop menu-open`,"aria-hidden":`true`,onClick:()=>g(!1)}),c]})}export{ee as a,C as c,f as d,d as f,V as i,S as l,re as n,E as o,U as r,w as s,X as t,_ as u};
@@ -1 +0,0 @@
1
- import{it as e,rt as t}from"./chunk-ICPOFSXX-TRvVGIDw.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-CWiyyVfn.js";import"./chunk-ICPOFSXX-TRvVGIDw.js";import"./dist-BzAsli7o.js";import"./chunk-5PVQY5BW-CGAe6GJJ.js";import"./chunk-U2HBQHQK-BfLvbEyu.js";import"./chunk-FMBD7UC4-C_E43NFJ.js";import"./chunk-BSJP7CBP-L79XKVcb.js";import"./chunk-ZZ45TVLE-CBF3hFJH.js";import"./chunk-YZCP3GAM-CygW6I0h.js";import"./chunk-55IACEB6-BwZyF7vR.js";import"./chunk-EDXVE4YY-BnXC8cYQ.js";import"./chunk-X2U36JSP-Cj3k-dYC.js";import"./chunk-5FUZZQ4R-CSRMBAGr.js";import"./chunk-ENJZ2VHE-7qfDalAB.js";import"./chunk-336JU56O-BpbY8F27.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-C3IfRdvA.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-CWiyyVfn.js";import"./chunk-ICPOFSXX-TRvVGIDw.js";import"./dist-BzAsli7o.js";import"./chunk-5PVQY5BW-CGAe6GJJ.js";import"./chunk-U2HBQHQK-BfLvbEyu.js";import"./chunk-FMBD7UC4-C_E43NFJ.js";import"./chunk-BSJP7CBP-L79XKVcb.js";import"./chunk-ZZ45TVLE-CBF3hFJH.js";import"./chunk-YZCP3GAM-CygW6I0h.js";import"./chunk-55IACEB6-BwZyF7vR.js";import"./chunk-EDXVE4YY-BnXC8cYQ.js";import"./chunk-X2U36JSP-Cj3k-dYC.js";import"./chunk-5FUZZQ4R-CSRMBAGr.js";import"./chunk-ENJZ2VHE-7qfDalAB.js";import"./chunk-336JU56O-BpbY8F27.js";import{i as t,n,r,t as i}from"./chunk-4TB4RGXK-C3IfRdvA.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-DFU2rJiY.js";var t=4;function n(n){return e(n,t)}export{n as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-DD-I1_y5.js";import{d as t,l as n,o as r,s as i,u as a}from"./brand-DfykKss4.js";import{a as o,c as s,d as c,f as l,i as u,n as d,t as f,u as p}from"./AdminShell-DPmNVsja.js";import{i as m,t as h}from"./graph-labels-CavkO4DG.js";var g=n(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),_=n(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),v=n(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),y=n(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),b=a(),x=e(t(),1);function S(e){let t=new Set,n=[];for(let r of e)for(let e of r.labels)e&&(t.has(e)||h.has(e)&&(t.add(e),n.push(e)));return n}var C=r();function w(){let[e,t]=(0,x.useState)(null),[n,r]=(0,x.useState)(!1),[i,a]=(0,x.useState)(void 0),[s,c]=(0,x.useState)(null),[u,d]=(0,x.useState)(void 0),[m,h]=(0,x.useState)(null),[g,_]=(0,x.useState)(null);(0,x.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&a(e.businessName),e.sessionId!==void 0&&c(e.sessionId??null),_(e.role??null),d(e.userName===void 0?null:e.userName),h(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let v=(0,x.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]);return n?e?(0,C.jsxs)(f,{cacheKey:e,businessName:i,sessionId:s,onLogout:v,userName:u,userAvatar:m,role:g,children:[(0,C.jsx)(o,{}),(0,C.jsxs)(`div`,{className:`data-page`,children:[(0,C.jsx)(`header`,{className:`data-header`,children:(0,C.jsxs)(`h1`,{className:`data-title`,children:[(0,C.jsx)(l,{size:18}),` Data`]})}),(0,C.jsx)(T,{cacheKey:e})]})]}):(0,C.jsxs)(`div`,{className:`data-page`,children:[(0,C.jsx)(`header`,{className:`data-header`,children:(0,C.jsxs)(`h1`,{className:`data-title`,children:[(0,C.jsx)(l,{size:18}),` Data`]})}),(0,C.jsxs)(`div`,{className:`data-empty`,children:[(0,C.jsx)(`p`,{children:`You are not signed in.`}),(0,C.jsxs)(`p`,{children:[`Open the `,(0,C.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,C.jsx)(`div`,{className:`data-page`,children:(0,C.jsxs)(`div`,{className:`data-loading`,children:[(0,C.jsx)(p,{size:18,className:`spin`}),` Loading…`]})})}function T({cacheKey:e}){let{adminFetch:t,cacheKey:n,sessionRefetchNonce:r,banner:i,reloadToLogin:a}=u({initialCacheKey:e,surface:`data`});return(0,C.jsxs)(`main`,{className:`data-main`,children:[i&&(0,C.jsx)(`button`,{type:`button`,className:`data-session-banner`,onClick:a,"data-reason":i.reason,children:i.message}),(0,C.jsx)(E,{adminFetch:t,cacheKey:n,sessionRefetchNonce:r}),(0,C.jsx)(N,{adminFetch:t,cacheKey:n,sessionRefetchNonce:r})]})}function E({adminFetch:e,cacheKey:t,sessionRefetchNonce:n}){let[r,i]=(0,x.useState)(``),[a,o]=(0,x.useState)(``),[s,c]=(0,x.useState)(null),[l,u]=(0,x.useState)(`hybrid`),[d,f]=(0,x.useState)(!1),[h,g]=(0,x.useState)(null),[_,v]=(0,x.useState)(null),[y,b]=(0,x.useState)(0),[w,T]=(0,x.useState)(!1);(0,x.useEffect)(()=>{let e=r.trim();if(!e){o(``),c(null);return}T(!1);let t=setTimeout(()=>o(e),300);return()=>clearTimeout(t)},[r]),(0,x.useEffect)(()=>{if(!a)return;let t=!1;return f(!0),g(null),e(`/api/admin/graph-search?q=${encodeURIComponent(a)}&labels=FileArtifact&limit=20${w?`&threshold=0`:``}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(c(e.results),u(e.mode??`hybrid`),b(typeof e.suppressed==`number`?e.suppressed:0))}).catch(e=>{t||g(e instanceof Error?e.message:String(e))}).finally(()=>{t||f(!1)}),()=>{t=!0}},[a,e,n,w]);let E=(0,x.useMemo)(()=>s?S(s):[],[s]),k=_&&E.includes(_)?_:null,A=(0,x.useMemo)(()=>s?k?s.filter(e=>e.labels.includes(k)):s:null,[s,k]),j=(0,x.useCallback)(e=>{let n=e.properties.relativePath;if(typeof n!=`string`||n.length===0)return;let r=`/api/admin/files/download?session_key=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}`,i=document.createElement(`a`);i.href=r,i.rel=`noopener noreferrer`,document.body.appendChild(i),i.click(),i.remove()},[t]);return(0,C.jsxs)(`section`,{className:`data-panel`,children:[(0,C.jsx)(`h2`,{className:`data-panel-title`,children:`Search`}),(0,C.jsx)(`p`,{className:`data-panel-subtitle`,children:`Find anything in your knowledge base by keyword.`}),(0,C.jsxs)(`div`,{className:`data-search-input`,children:[(0,C.jsx)(m,{size:14}),(0,C.jsx)(`input`,{type:`text`,placeholder:`Search your knowledge…`,value:r,onChange:e=>i(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),d&&(0,C.jsx)(p,{size:14,className:`spin`})]}),h&&(0,C.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,h]}),E.length>0&&(0,C.jsx)(`div`,{className:`data-chip-row`,role:`group`,"aria-label":`Filter by type`,children:E.map(e=>{let t=e===k;return(0,C.jsx)(`button`,{type:`button`,className:`data-chip`,"data-active":t,onClick:()=>v(t?null:e),children:O([e])??e},e)})}),s&&!d&&(0,C.jsxs)(`div`,{className:`data-results-meta`,children:[A.length,` of `,s.length,` result`,s.length===1?``:`s`]}),s&&!d&&!k&&y>0&&!w&&(0,C.jsxs)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>T(!0),children:[y,` low-confidence result`,y===1?``:`s`,` hidden — show all`]}),s&&!d&&!k&&w&&(0,C.jsx)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>T(!1),children:`Showing all results — hide low-confidence`}),s&&s.length===0&&!d&&(0,C.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),A&&A.length>0&&(0,C.jsx)(`ul`,{className:`data-results`,children:A.map(e=>(0,C.jsx)(D,{hit:e,mode:l,onDownload:j},e.nodeId))})]})}function D({hit:e,mode:t,onDownload:n}){let r=k(e.properties),i=A(e.properties),a=O(e.labels),[o,s]=(0,x.useState)(!1),c=i&&i.length>280,l=o||!c?i:i?.slice(0,280)+`…`,u=t===`bm25`?`bm25 ${e.bm25Score.toFixed(2)}`:`vector ${e.vectorScore.toFixed(2)} · bm25 ${e.bm25Score.toFixed(2)} · combined ${e.score.toFixed(2)}`;return(0,C.jsxs)(`li`,{className:`data-result`,children:[(0,C.jsxs)(`div`,{role:`button`,tabIndex:0,className:`data-result-open`,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e))},"aria-label":`Download ${r??a??`file`}`,children:[a&&(0,C.jsx)(`div`,{className:`data-result-header`,children:(0,C.jsx)(`span`,{className:`data-result-labels`,children:a})}),r&&(0,C.jsx)(`div`,{className:`data-result-title`,children:r}),i&&(0,C.jsx)(`pre`,{className:`data-result-body`,children:l}),(0,C.jsx)(`div`,{className:`data-result-scores`,children:u})]}),c&&(0,C.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>s(e=>!e),children:o?`Show less`:`Show more`})]})}function O(e){if(e.length===0)return null;let t=e[0].replace(/([a-z])([A-Z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function k(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n.length>140?n.slice(0,140)+`…`:n}return null}function A(e){for(let t of[`content`,`summary`,`body`,`description`,`text`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function j(){if(typeof window>`u`)return`.`;let e=new URLSearchParams(window.location.hash.replace(/^#/,``)).get(`path`);return e&&e.length>0?e:`.`}function M(e){if(typeof window>`u`)return;let t=new URL(window.location.href);t.hash=e===`.`?``:`path=${encodeURIComponent(e)}`,window.history.replaceState(window.history.state,``,t.toString())}function N({adminFetch:e,cacheKey:t,sessionRefetchNonce:n}){let[r,a]=(0,x.useState)(()=>j()),[o,l]=(0,x.useState)(null),[u,f]=(0,x.useState)([]),[m,h]=(0,x.useState)(!1),[b,S]=(0,x.useState)(null),[w,T]=(0,x.useState)(!1),[E,D]=(0,x.useState)(null),[O,k]=(0,x.useState)(null),[A,N]=(0,x.useState)(null),[I,L]=(0,x.useState)(null),R=(0,x.useRef)(null),[z,B]=(0,x.useState)(0);(0,x.useEffect)(()=>{let t=!1;return h(!0),S(null),e(`/api/admin/files?path=${encodeURIComponent(r===`.`?``:r)}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(l(e.entries),f(e.displayPath??[]))}).catch(e=>{t||(l([]),f([]),S(e instanceof Error?e.message:String(e)))}).finally(()=>{t||h(!1)}),()=>{t=!0}},[e,r,z,n]),(0,x.useEffect)(()=>{M(r)},[r]);let V=(0,x.useCallback)(()=>{B(e=>e+1)},[]),H=(0,x.useCallback)(e=>{a(e)},[]),U=(0,x.useCallback)(()=>{if(r===`.`||r===``)return;let e=r.split(`/`).filter(Boolean);e.pop(),a(e.length===0?`.`:e.join(`/`))},[r]),W=(0,x.useCallback)(e=>{d(t,r===`.`?e.name:`${r}/${e.name}`)},[r,t]),G=(0,x.useCallback)(()=>{R.current?.click()},[]),K=(0,x.useCallback)(e=>{k(null),L(e.name)},[]),q=(0,x.useCallback)(()=>{L(null)},[]),J=(0,x.useCallback)(async t=>{let n=r===`.`?t.name:`${r}/${t.name}`;k(null),L(null),N(t.name);try{let t=await e(`/api/admin/files?path=${encodeURIComponent(n)}`,{method:`DELETE`}),r=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(r.error??`HTTP ${t.status}`);B(e=>e+1)}catch(e){k(e instanceof Error?e.message:String(e))}finally{N(null)}},[r,e]);(0,x.useEffect)(()=>{if(!I)return;let e=e=>{e.key===`Escape`&&L(null)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[I]);let Y=(0,x.useCallback)(async e=>{D(null),T(!0);try{let n=new FormData;n.append(`session_key`,t),n.append(`file`,e);let r=await fetch(`/api/admin/files/upload`,{method:`POST`,body:n}),i=await r.json().catch(()=>({error:`HTTP ${r.status}`}));if(!r.ok)throw Error(i.error??`HTTP ${r.status}`);a(i.path.split(`/`).slice(0,-1).join(`/`)||`.`),B(e=>e+1)}catch(e){D(e instanceof Error?e.message:String(e))}finally{T(!1),R.current&&(R.current.value=``)}},[t]);return(0,C.jsxs)(`section`,{className:`data-panel`,children:[(0,C.jsxs)(`div`,{className:`data-panel-heading`,children:[(0,C.jsx)(`h2`,{className:`data-panel-title`,children:`Files`}),(0,C.jsxs)(`div`,{className:`data-file-actions`,children:[(0,C.jsxs)(`button`,{type:`button`,className:`data-btn`,onClick:V,disabled:m,title:`Refresh this folder`,"aria-label":`Refresh this folder`,children:[m?(0,C.jsx)(p,{size:14,className:`spin`}):(0,C.jsx)(s,{size:14}),` Refresh`]}),(0,C.jsxs)(`button`,{type:`button`,className:`data-btn`,onClick:G,disabled:w,children:[w?(0,C.jsx)(p,{size:14,className:`spin`}):(0,C.jsx)(y,{size:14}),` Upload`]}),(0,C.jsx)(`input`,{type:`file`,ref:R,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&Y(t)}})]})]}),(0,C.jsxs)(`p`,{className:`data-panel-subtitle`,children:[`Everything under your install's `,(0,C.jsx)(`code`,{children:`data/`}),` directory. Click a folder to open it, a file to download it. Uploads go to `,(0,C.jsx)(`code`,{children:`data/uploads/`}),`.`]}),(0,C.jsxs)(`div`,{className:`data-breadcrumbs`,children:[(0,C.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>H(`.`),children:`data`}),u.map((e,t)=>{let n=u.slice(0,t+1).map(e=>e.name).join(`/`);return(0,C.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,C.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,C.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>H(n),title:e.name,children:e.displayName??e.name})]},n)}),r!==`.`&&(0,C.jsxs)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-up-btn`,onClick:U,children:[(0,C.jsx)(g,{size:14}),` Up`]})]}),E&&(0,C.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,E]}),O&&(0,C.jsxs)(`div`,{className:`data-error`,children:[`Delete failed: `,O]}),b&&(0,C.jsx)(`div`,{className:`data-error`,children:b}),m&&(0,C.jsxs)(`div`,{className:`data-loading`,children:[(0,C.jsx)(p,{size:14,className:`spin`}),` Loading…`]}),!m&&o&&o.length===0&&!b&&(0,C.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!m&&o&&o.length>0&&(0,C.jsx)(`ul`,{className:`data-entries`,children:o.map(e=>{let t=e.displayName??e.name,n=A===e.name,a=I===e.name;return(0,C.jsx)(`li`,{className:`data-entry`,children:e.kind===`directory`?(0,C.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>H(r===`.`?e.name:`${r}/${e.name}`),children:[(0,C.jsx)(v,{size:14}),(0,C.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t})]}):e.kind===`file`?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>W(e),title:`Download ${t}`,disabled:a,children:[(0,C.jsx)(_,{size:14}),(0,C.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t}),(0,C.jsxs)(`span`,{className:`data-entry-meta`,title:`Modified ${F(e.modifiedAt)}`,children:[P(e.sizeBytes),` · `,F(e.modifiedAt)]}),(0,C.jsx)(c,{size:12,className:`data-entry-download-icon`})]}),a?(0,C.jsxs)(`div`,{className:`data-entry-confirm`,role:`group`,"aria-label":`Confirm delete ${t}`,children:[(0,C.jsx)(`span`,{className:`data-entry-confirm-label`,children:`Delete?`}),(0,C.jsx)(`button`,{type:`button`,className:`data-entry-confirm-yes`,onClick:()=>J(e),autoFocus:!0,children:`Yes`}),(0,C.jsx)(`button`,{type:`button`,className:`data-entry-confirm-no`,onClick:q,children:`No`})]}):(0,C.jsx)(`button`,{type:`button`,className:`data-entry-delete`,onClick:()=>K(e),disabled:n,title:`Delete ${t}`,"aria-label":`Delete ${t}`,children:n?(0,C.jsx)(p,{size:14,className:`spin`}):(0,C.jsx)(i,{size:14})})]}):(0,C.jsxs)(`div`,{className:`data-entry-btn data-entry-disabled`,children:[(0,C.jsx)(_,{size:14}),(0,C.jsx)(`span`,{className:`data-entry-name`,children:t}),(0,C.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})},e.name)})})]})}function P(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024/1024/1024).toFixed(1)} GB`}function F(e){try{let t=new Date(e);if(isNaN(t.getTime()))return`—`;let n=typeof navigator<`u`?navigator.languages&&navigator.languages.length>0?[...navigator.languages]:[navigator.language]:void 0;return t.toLocaleString(n,{dateStyle:`medium`,timeStyle:`short`})}catch{return`—`}}(0,b.createRoot)(document.getElementById(`root`)).render((0,C.jsx)(w,{}));