@lacneu/atrium 0.102.1 → 0.103.1
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/assets/AccessTab-DIDDsgPT.js +1 -0
- package/dist/assets/{AdminSettings-B8n1yLsD.js → AdminSettings-RN5-vhFB.js} +1 -1
- package/dist/assets/{AdvancedFilter-Bb66m5kb.js → AdvancedFilter-D14bDnZM.js} +1 -1
- package/dist/assets/AgentFilesTab-CzlG0CZI.js +3 -0
- package/dist/assets/AnomaliesTab-DI6_13hV.js +1 -0
- package/dist/assets/AuditTab-CtudlEKL.js +1 -0
- package/dist/assets/BridgeTab-D7vwrcIC.js +1 -0
- package/dist/assets/ChatDefaultsTab-C29wKwC9.js +1 -0
- package/dist/assets/{ConfirmDialog-BXcki0Ee.js → ConfirmDialog-DUn2vS3y.js} +1 -1
- package/dist/assets/{DataTableShell-DRFFBx_j.js → DataTableShell-DlkJe0in.js} +1 -1
- package/dist/assets/DeletedChatsTab-fwnKocED.js +1 -0
- package/dist/assets/{DetailChips-Cv1sxdhU.js → DetailChips-CYx7WQ4_.js} +1 -1
- package/dist/assets/{EntitySheet-B2B48bss.js → EntitySheet-BHlTwSgy.js} +1 -1
- package/dist/assets/FeedbacksTab-B6yZLeCu.js +1 -0
- package/dist/assets/{FieldLabel-Tea3wyVe.js → FieldLabel-rU6Ua6ki.js} +1 -1
- package/dist/assets/FilesTab-CX2DlSAl.js +1 -0
- package/dist/assets/{FilterBar-DTVwlDpF.js → FilterBar-1CED41DE.js} +1 -1
- package/dist/assets/GroupsTab-XqYgSNbn.js +1 -0
- package/dist/assets/InstancesTab-k_xDuLN5.js +1 -0
- package/dist/assets/IntegrationsTab-wQIr0NRQ.js +1 -0
- package/dist/assets/KnobRow-GQ-yjRd-.js +1 -0
- package/dist/assets/KpiTab-Bqw-Ktyf.js +1 -0
- package/dist/assets/PreferencesTab-B3IgHTIx.js +1 -0
- package/dist/assets/ProjectPage-3f1bBxNm.js +1 -0
- package/dist/assets/PromptInjectionsTab-C_NJLRVi.js +4 -0
- package/dist/assets/RolesTab-BH7cwUSl.js +1 -0
- package/dist/assets/ScheduledTab-DEPYdnlj.js +1 -0
- package/dist/assets/ServiceAccountsTab-BW_IZtpv.js +1 -0
- package/dist/assets/SubAgentReportsTab-tnmtmSGh.js +1 -0
- package/dist/assets/ThemeShowroom-CXAiw6jt.js +1 -0
- package/dist/assets/{TimeRangePicker-D3PJq1H8.js → TimeRangePicker-DGRmfXqe.js} +1 -1
- package/dist/assets/{TimezoneCombobox-CPTpWNQm.js → TimezoneCombobox-DAhFeIgd.js} +1 -1
- package/dist/assets/TracesTab-peFnZ-Tw.js +1 -0
- package/dist/assets/TrashTab-Hd_LRcrR.js +1 -0
- package/dist/assets/UsersTab-CYiw3R0P.js +1 -0
- package/dist/assets/VoiceTab-BIJNy57E.js +1 -0
- package/dist/assets/{alert-dialog-BoEv1f8g.js → alert-dialog-BdTFPzVf.js} +1 -1
- package/dist/assets/{api-DSJJn0d7.js → api-DNOgniXv.js} +5 -5
- package/dist/assets/{badge-C4po8DQ1.js → badge-D7TV9F5d.js} +1 -1
- package/dist/assets/{button-Dio0PVrp.js → button-2XjWVeWK.js} +1 -1
- package/dist/assets/capabilities-CASxhKEd.js +1 -0
- package/dist/assets/{card-CerX9wDn.js → card-CB4fBpkx.js} +1 -1
- package/dist/assets/check-ByAmVIRT.js +1 -0
- package/dist/assets/{checkbox-CsI4ggnp.js → checkbox-kFoJxcMJ.js} +1 -1
- package/dist/assets/chevron-left-SzhbAbEJ.js +1 -0
- package/dist/assets/chevron-right-9DjIYDNR.js +1 -0
- package/dist/assets/chevron-up-uykFYjFv.js +1 -0
- package/dist/assets/chevrons-up-down-C45M3ZYP.js +1 -0
- package/dist/assets/{compatView--1YlftIc.js → compatView-BsJMEfMH.js} +1 -1
- package/dist/assets/confTabs-BzReq467.css +1 -0
- package/dist/assets/convexApi-4XI9Ua6G.js +1 -0
- package/dist/assets/{copy-BaUCUMp2.js → copy-uA2kyeTq.js} +1 -1
- package/dist/assets/{cronDescribe-CAuRX7uW.js → cronDescribe-CWrWu4NY.js} +1 -1
- package/dist/assets/{deliveryRecorder-C7NQZrrH.js → deliveryRecorder-D2L37goZ.js} +1 -1
- package/dist/assets/{dialog-BfrsWZiD.js → dialog-Cw-buQuR.js} +1 -1
- package/dist/assets/dispatchErrorInfo-rA4PAW2w.js +1 -0
- package/dist/assets/{dist-ChrIV8UV.js → dist-BuPfsZqj.js} +1 -1
- package/dist/assets/{dist-CkbybbG7.js → dist-CjNu_N10.js} +1 -1
- package/dist/assets/{dist-D-RIDSJc.js → dist-s7OhF_Fl.js} +1 -1
- package/dist/assets/{dist-ClkJChBn.js → dist-vqdeesMI.js} +1 -1
- package/dist/assets/{dist-D7doQlva.js → dist-whjwthuB.js} +1 -1
- package/dist/assets/{dist-Cw3aN_jM.js → dist-yuq8NbqZ.js} +1 -1
- package/dist/assets/{download-DWgC7zCa.js → download-7V52FIS0.js} +1 -1
- package/dist/assets/{dropdown-menu-DHMOOlaP.js → dropdown-menu-BaUA_yBi.js} +1 -1
- package/dist/assets/{eye-B-ipuYEd.js → eye-Dj_nvUMH.js} +1 -1
- package/dist/assets/{format-DGKgJf2p.js → format-Dmvblmga.js} +1 -1
- package/dist/assets/{groupManageView-BMBqgRhV.js → groupManageView-B0Fd_T1s.js} +1 -1
- package/dist/assets/index-C5sCqQtj.js +158 -0
- package/dist/assets/index-D8Eob_Mc.css +1 -0
- package/dist/assets/{input-BSpTsBA6.js → input-BOl1ZpD6.js} +1 -1
- package/dist/assets/{list-eSch39T9.js → list-CgDCvRps.js} +1 -1
- package/dist/assets/loader-circle-D-oC88g9.js +1 -0
- package/dist/assets/{lock-0lxfSnTE.js → lock-BlAOODxr.js} +1 -1
- package/dist/assets/{pencil-aUWxuLhy.js → pencil-C9Bd090l.js} +1 -1
- package/dist/assets/plus-1T1-a2EN.js +1 -0
- package/dist/assets/{popover-DBaIbsBr.js → popover-BHbAt2S-.js} +1 -1
- package/dist/assets/roleDescriptions-DIDUvLuU.js +1 -0
- package/dist/assets/rotate-ccw-WHZ3xMbc.js +1 -0
- package/dist/assets/{search-BK6bzZNi.js → search-CU2PGfXc.js} +1 -1
- package/dist/assets/{select-qM3ZfTHx.js → select-CYo6IZR2.js} +1 -1
- package/dist/assets/{server-DLnWqkX-.js → server-BJJ3cVit.js} +1 -1
- package/dist/assets/speech-DCWd2QRW.js +1 -0
- package/dist/assets/{star-CM6J2w_J.js → star-DBwak3-9.js} +1 -1
- package/dist/assets/switch-B0io8PF7.js +1 -0
- package/dist/assets/{table-D2SJC960.js → table-C6NnEhxy.js} +1 -1
- package/dist/assets/{tabs-mZfLmn2f.js → tabs-DiirWTCN.js} +1 -1
- package/dist/assets/{toast-xNFwDnUy.js → toast-DN6P_at0.js} +1 -1
- package/dist/assets/{tooltip-v_AyOWn6.js → tooltip-6h3mm-V5.js} +1 -1
- package/dist/assets/{trash-2-B4WSfc7G.js → trash-2-BmifkPwA.js} +1 -1
- package/dist/assets/trashPage-DsBekB4q.js +1 -0
- package/dist/assets/trashView-Cd0pvgnM.js +1 -0
- package/dist/assets/{triangle-alert-BkDa-x8g.js → triangle-alert-DjNOW8SM.js} +1 -1
- package/dist/assets/{usageView-C9Y6E0Zu.js → usageView-DsAOFF89.js} +1 -1
- package/dist/assets/{useChart-CKFEN42T.js → useChart-CvUnULHg.js} +1 -1
- package/dist/assets/{useFontScale-ByBFat3y.js → useFontScale-T-slFQPF.js} +1 -1
- package/dist/assets/{useStartNewChat-BszDHUjD.js → useStartNewChat-Bg4hLp3d.js} +2 -2
- package/dist/assets/{use_paginated_query-CQj09xXv.js → use_paginated_query-CrHKVq5I.js} +1 -1
- package/dist/assets/{users-BJqaWlH1.js → users-4cOOjyOf.js} +1 -1
- package/dist/assets/x-xmpoCnTJ.js +1 -0
- package/dist/index.html +56 -56
- package/package.json +1 -1
- package/dist/assets/AccessTab-JmFp20Kp.js +0 -1
- package/dist/assets/AgentFilesTab-C3CUT4Ep.js +0 -3
- package/dist/assets/AnomaliesTab-CpiY8ZTC.js +0 -1
- package/dist/assets/AuditTab-D5YrLbTy.js +0 -1
- package/dist/assets/BridgeTab-D4RFq-Rb.js +0 -1
- package/dist/assets/ChatDefaultsTab-D0d9yEow.js +0 -1
- package/dist/assets/DeletedChatsTab-COYSFkNf.js +0 -1
- package/dist/assets/FeedbacksTab-6URuFdfg.js +0 -1
- package/dist/assets/FilesTab-esMtHJXt.js +0 -1
- package/dist/assets/GroupsTab-Io16XZHz.js +0 -1
- package/dist/assets/InstancesTab-BevtM68H.js +0 -1
- package/dist/assets/IntegrationsTab-DMY6VTUC.js +0 -1
- package/dist/assets/KnobRow-BsOT2O6U.js +0 -1
- package/dist/assets/KpiTab-DCfAwBfJ.js +0 -1
- package/dist/assets/PreferencesTab-DJ9p401L.js +0 -1
- package/dist/assets/ProjectPage-BxEF71jN.js +0 -1
- package/dist/assets/PromptInjectionsTab-Vdb1lF36.js +0 -4
- package/dist/assets/RolesTab-DU0g4d-R.js +0 -1
- package/dist/assets/ScheduledTab-B6gWc0HN.js +0 -1
- package/dist/assets/ServiceAccountsTab-Dmb_LH0V.js +0 -1
- package/dist/assets/SubAgentReportsTab-D9rclslo.js +0 -1
- package/dist/assets/ThemeShowroom-N4qzUtlq.js +0 -1
- package/dist/assets/TracesTab-DMdT_psj.js +0 -1
- package/dist/assets/TrashTab-BMSJ7ANC.js +0 -1
- package/dist/assets/UsersTab-BQaLsUCK.js +0 -1
- package/dist/assets/VoiceTab-BSh-05Ze.js +0 -1
- package/dist/assets/capabilities-BTqhMVxR.js +0 -1
- package/dist/assets/check-DmQzfrws.js +0 -1
- package/dist/assets/chevron-left-DQ9FCoo_.js +0 -1
- package/dist/assets/chevron-right-C_b_y922.js +0 -1
- package/dist/assets/chevron-up-Dsqj2Oaj.js +0 -1
- package/dist/assets/chevrons-up-down-Pva00Np5.js +0 -1
- package/dist/assets/confTabs-CCBW5ofF.css +0 -1
- package/dist/assets/convexApi-CyScjgcq.js +0 -1
- package/dist/assets/dispatchErrorInfo-Bb7JyJFO.js +0 -1
- package/dist/assets/index-CQk5TM8W.js +0 -158
- package/dist/assets/index-D6RuTaB7.css +0 -1
- package/dist/assets/loader-circle-BNhIFGdg.js +0 -1
- package/dist/assets/plus-Djbdyc2E.js +0 -1
- package/dist/assets/roleDescriptions-x3mUxTcX.js +0 -1
- package/dist/assets/rotate-ccw-BD-9XzMC.js +0 -1
- package/dist/assets/speech-CrNma2Ue.js +0 -1
- package/dist/assets/trashPage-WtAhGCt7.js +0 -1
- package/dist/assets/trashView-Ct0Xw-a9.js +0 -1
- package/dist/assets/x-CK8d5DC1.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$z as r,FB as i,IZ as a,Sk as o,_k as s,bk as c,cB as l,ck as u,dk as d,eB as f,fk as p,gk as m,hk as h,lB as g,lk as ee,mk as te,pk as _,sB as v,t as y,uB as b,uk as x,vk as S,xk as C,yk as w}from"./api-DNOgniXv.js";import{n as T,t as E}from"./useNavigate-D3GIoxyW.js";import"./convexApi-4XI9Ua6G.js";import{c as D,n as ne,o as re}from"./searchSchemas-Dm-Qg010.js";import{t as O}from"./appHost-CH3EGcJw.js";import{a as k,n as A,o as j,r as M,t as N}from"./card-CB4fBpkx.js";import{n as P,t as F}from"./TimeRangePicker-DGRmfXqe.js";var I=t(e(),1),L={API_CALLS:`api.calls`,API_ERRORS:`api.errors`,API_LATENCY_AVG_MS:`api.latency.avg_ms`,OPENCLAW_INGEST:`openclaw.ingest`,CHAT_SEND:`chat.send`,ASSISTANT_STREAM_ERRORS:`assistant.stream.errors`,ASSISTANT_ANNOUNCE_ERRORS:`assistant.announce.errors`,CONVEX_PROBE_LATENCY_AVG_MS:`convex.probe.latency.avg_ms`},R=Object.keys(L).length,z=n(),B=15,V=e=>String(Math.round(e));function H(){let e=a(y.me.getMe,{host:O})?.permissions?.includes(`traces.read`)??!1,t=a(y.deliveryTiming.listDeliverySessions,e?{}:`skip`),n=(0,I.useMemo)(()=>t?t.filter(e=>!e.active&&e.rollup!==null&&e.rollup.cP50!==null&&e.rollup.aP50!==null).slice(0,B).reverse().map(e=>({startedAt:e.startedAt,cP50:e.rollup?.cP50,aP50:e.rollup?.aP50})):[],[t]);return t===void 0?null:(0,z.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,z.jsx)(`h2`,{className:`oc-kpi__group-title`,children:i()}),(0,z.jsxs)(N,{children:[(0,z.jsxs)(k,{children:[(0,z.jsx)(j,{children:b()}),(0,z.jsx)(M,{children:l()})]}),(0,z.jsx)(A,{children:n.length<2?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):(0,z.jsx)(U,{series:n})})]})]})}function U({series:e}){let t=e.map(e=>e.cP50),n=e.map(e=>e.aP50),i=Math.max(1,...t,...n),a=t=>6+t*468/(e.length-1),o=e=>74-e*68/i,s=e=>e.map((e,t)=>`${t===0?`M`:`L`}${a(t).toFixed(1)},${o(e).toFixed(1)}`).join(` `),c=e[e.length-1];return(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsxs)(`div`,{className:`flex gap-3 text-xs text-muted-foreground`,children:[(0,z.jsxs)(`span`,{style:{color:`var(--primary)`},children:[r(),` p50 `,V(c.cP50),` `,g()]}),(0,z.jsxs)(`span`,{children:[f(),` p50 `,V(c.aP50),` `,g()]})]}),(0,z.jsxs)(`svg`,{viewBox:`0 0 480 80`,className:`h-20 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":b(),children:[(0,z.jsx)(`path`,{d:s(n),fill:`none`,style:{stroke:`var(--muted-foreground)`},strokeWidth:1.5}),(0,z.jsx)(`path`,{d:s(t),fill:`none`,style:{stroke:`var(--primary)`},strokeWidth:1.5})]})]})}var W=[{metric:`api.calls`,label:o(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:C(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:c(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:w(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:S(),unit:`/h`,group:`Chat`,isError:!1},{metric:L.ASSISTANT_STREAM_ERRORS,label:s(),unit:`/h`,group:`Assistant`,isError:!0},{metric:L.ASSISTANT_ANNOUNCE_ERRORS,label:m(),unit:`/h`,group:`Assistant`,isError:!0}],G=R,K=[`API`,`OpenClaw`,`Chat`,`Assistant`],q=1e3,J=36e5;function Y(e,t){let n=Math.max(1,Math.ceil((t-e)/J)),r=Math.min(n*G,q);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/G))}}function ie(){let e=T({from:`/settings/kpi`}),t=E({from:`/settings/kpi`}),n=re(e.from,e.to,ne,`now`),r=e=>void t({search:t=>({...t,...D(e)})}),{from:i,to:o}=P(n),{rowLimit:s,buckets:c}=Y(i,o),l=a(y.kpi.listKpis,{limit:s,filter:{from:i,to:o}}),u=(0,I.useMemo)(()=>{let e=new Map;for(let t of l??[]){let n=e.get(t.metric)??[];n.push({bucket:t.bucket,value:t.value}),e.set(t.metric,n)}for(let[t,n]of e)n.sort((e,t)=>e.bucket<t.bucket?-1:+(e.bucket>t.bucket)),n.length>c&&e.set(t,n.slice(n.length-c));return e},[l,c]),d=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`oc-admin__hint`,children:[h(),` `,(0,z.jsx)(`span`,{className:`oc-filter__window`,children:te()})]}),(0,z.jsx)(ae,{value:n,onChange:r})]});return l===void 0?(0,z.jsxs)(z.Fragment,{children:[d,(0,z.jsx)(H,{}),(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:_()})]}):l.length===0?(0,z.jsxs)(z.Fragment,{children:[d,(0,z.jsx)(H,{}),(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:p()})]}):(0,z.jsxs)(z.Fragment,{children:[d,(0,z.jsx)(H,{}),K.map(e=>{let t=W.filter(t=>t.group===e);return t.some(e=>(u.get(e.metric)??[]).length>0)?(0,z.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,z.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,z.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,z.jsx)(oe,{config:e,series:u.get(e.metric)??[]},e.metric))})]},e):null})]})}function ae({value:e,onChange:t}){return(0,z.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,z.jsx)(F,{value:e,onChange:t})})}function oe({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,r=n?n.value:0;return(0,z.jsxs)(N,{size:`sm`,className:`oc-kpi__card`,children:[(0,z.jsxs)(k,{children:[(0,z.jsx)(j,{className:`oc-kpi__card-title`,children:e.label}),(0,z.jsx)(M,{className:`oc-kpi__card-metric`,children:(0,z.jsx)(`code`,{children:e.metric})})]}),(0,z.jsxs)(A,{className:`oc-kpi__card-body`,children:[(0,z.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,z.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&r>0?` oc-kpi__value--error`:``),children:Q(r)}),(0,z.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,z.jsx)(ce,{series:t,isError:e.isError,unit:e.unit}),(0,z.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,z.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:d({value:$(n.bucket)})}):(0,z.jsx)(`span`,{className:`oc-kpi__muted`,children:x()}),(0,z.jsx)(`span`,{className:`oc-kpi__muted`,children:ee({count:t.length})})]})]})]})}var X=240,Z=48,se=1;function ce({series:e,isError:t,unit:n}){if(e.length===0)return(0,z.jsx)(`div`,{className:`oc-kpi__chart oc-kpi__chart--empty`,"aria-hidden":!0});let r=e.reduce((e,t)=>t.value>e?t.value:e,0),i=X/e.length,a=Math.max(i-se,1);return(0,z.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${X} ${Z}`,preserveAspectRatio:`none`,role:`img`,"aria-label":u({max:Q(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(Z-1):0,c=o*i,l=Z-s;return(0,z.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,z.jsxs)(`title`,{children:[$(e.bucket),` · `,Q(e.value),` `,n]})},e.bucket)})})}function Q(e){return Number.isFinite(e)?Math.abs(e)>=1e3?(e/1e3).toFixed(e%1e3==0?0:1)+`k`:String(e):`0`}function $(e){let t=new Date(`${e}:00:00Z`);return Number.isNaN(t.getTime())?e:`${String(t.getUTCDate()).padStart(2,`0`)}/${String(t.getUTCMonth()+1).padStart(2,`0`)} ${String(t.getUTCHours()).padStart(2,`0`)}h`}export{ie as KpiTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$G as r,$X as i,CK as a,DK as o,EK as s,EZ as c,FZ as l,GG as u,IZ as d,JG as f,KG as p,OK as m,QG as h,QX as ee,SK as te,TK as ne,Tl as re,WG as ie,XG as ae,XI as oe,XX as se,YG as ce,YX as le,ZG as g,ZX as ue,_K as de,_Z as fe,aK as pe,aZ as me,al as he,bK as _,cK as v,cZ as y,cl as b,dK as x,dZ as S,dl as C,eK as w,eZ as T,fK as E,fZ as D,gK as O,gZ as k,hK as A,hZ as j,iK as M,iZ as N,il as P,kK as F,lK as I,lZ as L,ll as R,mK as ge,mZ as _e,nK as ve,nZ as ye,oK as be,oZ as xe,ol as Se,pK as Ce,pZ as we,qG as Te,rK as z,rZ as Ee,sK as De,sZ as Oe,sl as ke,t as B,tK as Ae,tZ as je,uK as Me,uZ as Ne,ul as Pe,vK as Fe,vZ as Ie,wK as Le,wl as Re,xK as ze,xZ as Be,yK as Ve,yl as He}from"./api-DNOgniXv.js";import{t as V}from"./checkbox-kFoJxcMJ.js";import{a as Ue,i as We,n as Ge,r as H,t as Ke}from"./select-CYo6IZR2.js";import{t as U}from"./button-2XjWVeWK.js";import{t as W}from"./input-BOl1ZpD6.js";import"./convexApi-4XI9Ua6G.js";import{c as qe,d as Je,r as Ye,t as Xe,u as Ze}from"./useFontScale-T-slFQPF.js";import{r as Qe}from"./toast-DN6P_at0.js";import{t as G}from"./badge-D7TV9F5d.js";import{t as K}from"./appHost-CH3EGcJw.js";import{t as $e}from"./localePickerView-C2RmOS86.js";import{t as et}from"./switch-B0io8PF7.js";import{t as tt}from"./TimezoneCombobox-DAhFeIgd.js";var q=t(e(),1),J=[{id:`messages`,label:()=>F()},{id:`composer`,label:()=>m()},{id:`sidebar`,label:()=>o()},{id:`notifications`,label:()=>Me()},{id:`other`,label:()=>s()}],Y={showSource:{category:`messages`,label:()=>ne(),help:()=>Le()},showReport:{category:`messages`,label:()=>a(),help:()=>te()},copyAssistant:{category:`messages`,label:()=>ze()},copyUser:{category:`messages`,label:()=>_()},showDelete:{category:`messages`,label:()=>Ve()},showTools:{category:`messages`,label:()=>Fe(),help:()=>de()},voiceInput:{category:`composer`,label:()=>O(),help:()=>A()},showUsage:{category:`composer`,label:()=>ge(),help:()=>Ce()},autoReadAloud:{category:`composer`,label:()=>re(),help:()=>Re()},showChatAge:{category:`sidebar`,label:()=>E(),help:()=>x()},notifSound:{category:`notifications`,label:()=>I(),help:()=>v()},notifSystem:{category:`notifications`,label:()=>De(),help:()=>be()},replySound:{category:`notifications`,label:()=>pe(),help:()=>M()}};function X(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function nt(e,t){let n=X(t.trim()),r=new Map(J.map(e=>[e.id,e.label()])),i=new Map(J.map(e=>[e.id,[]]));for(let t of e){let e=Y[t],a=e?.category??`other`;n&&!X(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return J.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var rt=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showUsage`,`autoReadAloud`,`notifSound`,`notifSystem`,`replySound`],it={voiceInput:`voiceInput`};function at(e){return rt.includes(e)}function Z(e){return e===`admin`}function Q(e){return e===!0?`on`:e===!1?`off`:`inherit`}function ot(e){return e===`on`||e!==`off`&&null}function st(e){return at(e)?it[e]:void 0}var $=n(),ct={voiceInput:()=>f()};function lt({prefKey:e,ui:t}){let n=l(B.admin.setUiPrefDefault),r=l(B.admin.setFeatureEnabled),i=st(e),a=i?ct[e]?.():void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,$.jsx)(`span`,{className:`oc-prefs__gov-label`,children:h()}),(0,$.jsxs)(Ke,{value:Q(t.defaults[e]),onValueChange:t=>void n({key:e,value:ot(t)}),children:[(0,$.jsx)(We,{size:`sm`,className:`w-36`,children:(0,$.jsx)(Ue,{})}),(0,$.jsxs)(Ge,{children:[(0,$.jsx)(H,{value:`on`,children:p()}),(0,$.jsx)(H,{value:`off`,children:u()}),(0,$.jsx)(H,{value:`inherit`,children:ie()})]})]}),i?(0,$.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,$.jsx)(V,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":g()}),g()]}):null]}),a?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function ut({current:e,enabled:t}){let n=l(B.me.setDictationShortcut),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(!1);return(0,q.useEffect)(()=>{if(!r)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){i(!1);return}let t=Ze(e);if(t===null){[`Shift`,`Control`,`Meta`,`Alt`].includes(e.key)||(o(!0),window.setTimeout(()=>o(!1),1800));return}i(!1),n({shortcut:t})};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[r,n]),(0,$.jsxs)(`div`,{className:`oc-prefs__row${t?``:` is-locked`}`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,$.jsxs)(`span`,{className:`oc-prefs__label`,children:[C(),e?(0,$.jsx)(G,{variant:`secondary`,children:Je(e,qe())}):null]}),(0,$.jsx)(`span`,{className:`oc-prefs__help`,children:a?b():r?R():Pe()})]}),(0,$.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[e&&!r?(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void n({shortcut:null}),children:P()}):null,(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,disabled:!t,"aria-pressed":r,onClick:()=>i(e=>!e),children:r?he():e?Se():ke()})]})]})}function dt(){let[e,t]=(0,q.useState)(``),[n,i]=(0,q.useState)(!1),a=d(B.me.getMe,{host:K}),o=a?.ui,s=Z(a?.role)&&n,u=l(B.me.setUiPref).withOptimisticUpdate(Ye),f=(0,q.useMemo)(()=>o?nt(Object.keys(o.effective),e):[],[o,e]);return o?(0,$.jsxs)(`div`,{className:`oc-prefs-panel`,children:[Z(a?.role)?(0,$.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,$.jsx)(V,{checked:n,onCheckedChange:e=>i(e===!0),"aria-label":r()}),r()]}):null,s?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:ae()}),(0,$.jsx)(`p`,{children:ce()}),(0,$.jsx)(`p`,{children:Te()})]}):null,(0,$.jsx)(W,{value:e,onChange:e=>t(e.target.value),placeholder:z(),"aria-label":z(),className:`mb-2`}),f.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:ve()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:f.map(e=>(0,$.jsxs)(`section`,{className:`oc-prefs__card`,children:[(0,$.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Y[e],n=t?t.label():e,r=t?.help?.(),i=o.locked[e],a=o.effective[e],c=o.userOverrides[e]!==void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,$.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,$.jsx)(G,{variant:`outline`,children:Ae()}):c?(0,$.jsx)(G,{variant:`secondary`,children:He()}):null]}),r?(0,$.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,$.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&c?(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void u({key:e,value:null}),children:w()}):null,(0,$.jsx)(et,{checked:a,disabled:i,onCheckedChange:t=>{e===`notifSystem`&&t&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission(),u({key:e,value:t})},"aria-label":n})]}),s?(0,$.jsx)(lt,{prefKey:e,ui:o}):null]},e)})]},e.id))}),(0,$.jsx)(ut,{current:a?.dictationShortcut??null,enabled:o.effective.voiceInput===!0})]}):(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:c()})}var ft={sm:()=>xe(),md:()=>me(),lg:()=>N(),xl:()=>Ee(),"2xl":()=>ye(),"3xl":()=>je()};function pt(){let e=d(B.me.getMe,{host:K}),t=l(B.me.setLocale),n=l(B.me.setTimezone),r=l(B.me.setFontScale).withOptimisticUpdate((e,{scale:t})=>{let n=e.getQuery(B.me.getMe,{host:K});n&&e.setQuery(B.me.getMe,{host:K},{...n,fontScale:t,resolvedFontScale:t??`md`})}),a=l(B.me.setMyName),o=Qe(),s=e?.locale??`default`,c=e?.name??``,[u,f]=(0,q.useState)(null),p=u??c,m=p.trim()!==c.trim();async function h(){try{await a({name:p}),f(null),o.success(_e())}catch(e){o.error(we(),e)}}return(0,$.jsxs)(`div`,{className:`oc-appearance`,children:[(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:Ie()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:fe()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(W,{className:`max-w-xs`,value:p,maxLength:120,placeholder:k(),onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&m&&(e.preventDefault(),h())}}),(0,$.jsx)(U,{size:`sm`,disabled:!m,onClick:()=>void h(),children:oe()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:j()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:D()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:S()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[$e().map(e=>(0,$.jsx)(U,{variant:s===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,$.jsx)(U,{variant:s==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:Be()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:Ne()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:T()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(tt,{value:e?.timezone??``,onChange:e=>void n({timezone:e})}),(0,$.jsx)(U,{variant:e?.timezone===null||e?.timezone===void 0?`default`:`outline`,size:`sm`,onClick:()=>void n({timezone:null}),children:ee()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:ue()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:L()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:y()})]}),(0,$.jsx)(`div`,{className:`oc-show__row`,children:Xe.map(t=>(0,$.jsx)(U,{variant:(e?.fontScale??`md`)===t?`default`:`outline`,size:`sm`,onClick:()=>void r({scale:t}),children:ft[t]()},t))}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:Oe()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:se()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:le()})]}),(0,$.jsx)(dt,{})]})]})}export{pt as PreferencesTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$D as r,AO as i,BD as a,CO as o,E as s,EO as c,EZ as l,FO as u,FZ as d,GD as f,GO as ee,HD as p,ID as m,IO as te,IZ as h,LD as ne,MO as g,Ms as _,Mw as re,QD as ie,RD as ae,RO as v,SO as y,UD as b,UO as oe,VD as x,WO as se,ZD as ce,_O as S,aO as C,bO as w,cO as le,dO as T,eO as E,fO as ue,gO as de,hO as D,iO as O,js as fe,kO as pe,lO as me,mO as he,nD as ge,nO as _e,oO as ve,pO as ye,qD as be,rO as xe,sO as Se,t as k,uO as Ce,vO as we,wO as A,xO as Te,zD as Ee,zO as De}from"./api-DNOgniXv.js";import{n as Oe,t as j}from"./useNavigate-D3GIoxyW.js";import{A as ke,B as Ae,C as M,D as je,E as N,F as P,G as Me,H as Ne,I as F,J as Pe,K as I,R as Fe,S as L,T as Ie,U as Le,V as Re,W as R,_ as ze,a as z,f as B,h as Be,i as Ve,j as He,m as Ue,n as V,o as H,p as U,r as We,s as W,t as Ge,u as Ke,w as qe,x as Je,y as Ye,z as Xe}from"./useStartNewChat-Bg4hLp3d.js";import{r as Ze}from"./dist-vqdeesMI.js";import{t as Qe}from"./chevron-right-9DjIYDNR.js";import{c as $e,g as et,i as tt,n as nt,r as G,s as rt,t as it}from"./dropdown-menu-BaUA_yBi.js";import{n as at,t as ot}from"./eye-Dj_nvUMH.js";import{t as st}from"./list-CgDCvRps.js";import{t as ct}from"./pencil-C9Bd090l.js";import{t as lt}from"./trash-2-BmifkPwA.js";import{t as K}from"./button-2XjWVeWK.js";import{t as ut}from"./input-BOl1ZpD6.js";import"./convexApi-4XI9Ua6G.js";import{r as dt}from"./toast-DN6P_at0.js";import{n as ft,r as pt}from"./ConfirmDialog-DUn2vS3y.js";import{t as mt}from"./EntitySheet-BHlTwSgy.js";import{r as ht,t as gt}from"./trashView-Cd0pvgnM.js";var _t=s(`columns-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),vt=s(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),yt=s(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),q=s(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),J=t(e(),1),Y=n();function bt({className:e}){return(0,Y.jsx)($e,{asChild:!0,children:(0,Y.jsx)(K,{variant:`ghost`,size:`icon-xs`,"aria-label":b(),className:e,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,Y.jsx)(et,{})})})}function X({folderId:e,name:t,color:n,currentParentId:a,className:o,onOpen:s}){let l=d(k.projects.renameProject),m=d(k.projects.setProjectColor),te=d(k.projects.moveProject),ne=d(k.projects.deleteProject),g=d(k.projects.createProject),_=ft(),re=ht(),ie=pt(),[v,y]=(0,J.useState)(!1),[b,x]=(0,J.useState)(t),[C,w]=(0,J.useState)(!1),[le,T]=(0,J.useState)(!1),E=h(k.projects.projectTreeCount,le?{projectId:e}:`skip`);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(it,{onOpenChange:e=>e&&T(!0),children:[(0,Y.jsx)(bt,{className:o}),(0,Y.jsxs)(nt,{align:`end`,className:`w-48`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsxs)(G,{onSelect:()=>s(),children:[(0,Y.jsx)(I,{}),` `,c()]}),(0,Y.jsxs)(G,{onSelect:()=>{x(t),y(!0)},children:[(0,Y.jsx)(ct,{}),` `,p()]}),(0,Y.jsxs)(G,{onSelect:()=>{requestAnimationFrame(async()=>{let t=await ie({title:S(),label:ee(),placeholder:se(),confirmLabel:oe()});t&&await g({name:t,parentId:e})})},children:[(0,Y.jsx)(Me,{}),` `,S()]}),(0,Y.jsxs)(G,{onSelect:()=>w(!0),children:[(0,Y.jsx)(vt,{}),` `,r()]}),(0,Y.jsx)(tt,{children:Ee()}),(0,Y.jsxs)(`div`,{className:`oc-colorgrid`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsx)(`button`,{className:`oc-colorgrid__none`,onClick:()=>void m({projectId:e,color:null}),"aria-label":ae(),children:`✕`}),Ve.map(t=>(0,Y.jsx)(`button`,{className:`oc-colorgrid__dot`+(n===t.value?` is-selected`:``),style:{background:t.hue},"aria-label":t.value,onClick:()=>void m({projectId:e,color:t.value})},t.value))]}),(0,Y.jsx)(rt,{}),(0,Y.jsxs)(G,{variant:`destructive`,onSelect:()=>{requestAnimationFrame(async()=>{let n=E?.folders??0,r=E?.chats??0;await _({title:pe({name:t}),description:gt({folders:n,chats:r,days:re}),confirmWord:f(),confirmLabel:i(),destructive:!0})&&await ne({projectId:e})})},children:[(0,Y.jsx)(lt,{}),` `,f()]})]})]}),(0,Y.jsx)(mt,{open:v,onOpenChange:y,title:u(),canSubmit:b.trim().length>0,onSubmit:async()=>{await l({projectId:e,name:b.trim()}),y(!1)},submitLabel:p(),children:(0,Y.jsx)(ut,{value:b,onChange:e=>x(e.target.value),autoFocus:!0})}),C?(0,Y.jsx)(We,{open:C,onOpenChange:w,title:ce(),movingFolderId:e,currentId:a,onPick:t=>void te({projectId:e,parentId:t})}):null]})}function xt({chat:e,currentFolderId:t,className:n}){let r=d(k.chats.pinChat),i=d(k.chats.deleteChat),s=d(k.chats.renameChat),c=d(k.chats.setChatSidebar),l=d(k.chats.moveChatToProject),u=ft(),ee=ht(),[te,h]=(0,J.useState)(!1),[g,_]=(0,J.useState)(e.title??``),[re,ae]=(0,J.useState)(!1);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(it,{children:[(0,Y.jsx)(bt,{className:n}),(0,Y.jsxs)(nt,{align:`end`,className:`w-52`,onClick:e=>e.stopPropagation(),children:[(0,Y.jsxs)(G,{onSelect:()=>{_(e.title??``),h(!0)},children:[(0,Y.jsx)(ct,{}),` `,p()]}),(0,Y.jsxs)(G,{onSelect:()=>void r({chatId:e._id,pinned:!e.pinned}),children:[e.pinned?(0,Y.jsx)(Xe,{}):(0,Y.jsx)(Ae,{}),e.pinned?x():a()]}),(0,Y.jsxs)(G,{onSelect:()=>ae(!0),children:[(0,Y.jsx)(vt,{}),` `,E()]}),e.pinned&&e.inSidebar?null:(0,Y.jsxs)(G,{onSelect:()=>void c({chatId:e._id,hidden:e.inSidebar}),children:[e.inSidebar?(0,Y.jsx)(Re,{}):(0,Y.jsx)(q,{}),e.inSidebar?o():A()]}),(0,Y.jsx)(rt,{}),(0,Y.jsxs)(G,{variant:`destructive`,onSelect:()=>{requestAnimationFrame(async()=>{await u({title:ne(),description:m({days:ee}),confirmLabel:f(),destructive:!0})&&await i({chatId:e._id})})},children:[(0,Y.jsx)(lt,{}),` `,f()]})]})]}),(0,Y.jsx)(mt,{open:te,onOpenChange:h,title:ge(),canSubmit:g.trim().length>0,onSubmit:async()=>{await s({chatId:e._id,title:g.trim()}),h(!1)},submitLabel:p(),children:(0,Y.jsx)(ut,{value:g,onChange:e=>_(e.target.value),autoFocus:!0})}),re?(0,Y.jsx)(We,{open:re,onOpenChange:ae,title:ie(),currentId:t,onPick:t=>void l({chatId:e._id,projectId:t})}):null]})}function St(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>(e.title??``).toLowerCase().includes(n))}function Ct(e,t,n,r,i){let a=e.map(t),o=a.indexOf(i);if(o<0)return null;let s=a.indexOf(r);if(s>=0){let t=[...e],[r]=t.splice(s,1);t.splice(o,0,r);let i=t[o-1],a=t[o+1];return{prevKey:i===void 0?null:n(i),nextKey:a===void 0?null:n(a)}}let c=e[o-1];return{prevKey:c===void 0?null:n(c),nextKey:n(e[o])}}function wt(e,t){let n=new Map(t.map(e=>[e.chatId,e.lastSeenAt])),r=new Set;for(let t of e){let e=n.get(t._id);e!==void 0&&t.lastAssistantAt!==null&&t.lastAssistantAt>e&&r.add(t._id)}return r}var Tt=`oc.projpage.view`;function Et(){let e=localStorage.getItem(Tt);return e===`cards`||e===`list`?e:`columns`}var Z=e=>`into:${e}`,Dt=e=>`col:${e??`null`}`,Q=e=>`crumb:${e}`;function Ot(e){if(e.startsWith(`into:`))return e.slice(5);if(e.startsWith(`crumb:`))return e.slice(6);if(e.startsWith(`col:`)){let t=e.slice(4);return t===`null`?null:t}}function kt(){let{projectId:e}=Pe({from:`/project/$projectId`}),t=j(),n=h(k.projects.projectPage,{projectId:e});return(0,Y.jsx)(`div`,{className:`oc-projpage`,children:n===void 0?(0,Y.jsx)(`p`,{className:`oc-projpage__hint`,children:l()}):n===null?(0,Y.jsxs)(`div`,{className:`oc-projpage__notfound`,children:[(0,Y.jsx)(`h2`,{children:C()}),(0,Y.jsx)(`p`,{className:`oc-projpage__hint`,children:O()}),(0,Y.jsx)(K,{variant:`outline`,onClick:()=>void t({to:`/`}),children:xe()})]}):(0,Y.jsx)(At,{page:n})})}function At({page:e}){let t=j(),n=ft(),a=ht(),o=pt(),s=dt(),c=d(k.projects.renameProject),l=d(k.projects.setProjectColor),m=d(k.projects.deleteProject),ne=d(k.projects.createProject),g=d(k.projects.moveProject),ie=d(k.projects.setProjectSidebar),v=d(k.chats.moveChatToProject),b=d(k.chats.reorderChat),x=d(k.projects.reorderProject),C=h(k.projects.projectTreeCount,{projectId:e.project._id}),[T,E]=(0,J.useState)(Et),de=e=>{localStorage.setItem(Tt,e),E(e)},D=h(k.projects.folderColumns,T===`columns`?{projectId:e.project._id}:`skip`),O=h(k.projects.projectTreeList,T===`list`?{projectId:e.project._id}:`skip`),{c:ge}=Oe({from:`/project/$projectId`}),xe=h(k.projects.listProjects,{}),Ce=h(k.chatReads.myBusyChats,{}),A=(0,J.useMemo)(()=>new Set(Ce??[]),[Ce]),{byChat:Ae}=Fe(Ce??null),M=h(k.chatReads.myChatReads,{}),N=(0,J.useMemo)(()=>wt(e.chats,M??[]),[e.chats,M]),{startNewChat:F,picker:Pe}=Ge(e=>void t({to:`/chat/$chatId`,params:{chatId:e}})),[I,Re]=(0,J.useState)(``),[z,B]=(0,J.useState)(!1),[V,Xe]=(0,J.useState)(e.project.name),[Ze,Qe]=(0,J.useState)(!1),[q,bt]=(0,J.useState)(``);(0,J.useEffect)(()=>{let e=setTimeout(()=>bt(I.trim()),180);return()=>clearTimeout(e)},[I]);let X=h(k.search.searchConversations,q.length>=2?{query:q,projectId:e.project._id}:`skip`),xt=Ie(qe(ze,{activationConstraint:{distance:4}}),qe(Ye,{activationConstraint:{delay:250,tolerance:8}})),Z=(0,J.useRef)(!1),Dt=()=>{Z.current=!0,setTimeout(()=>{Z.current=!1},0)},[Q,kt]=(0,J.useState)(null),At=t=>{if(t.startsWith(`chat:`)){let n=t.slice(5),r=e.chats.find(e=>e._id===n),i=D?.columns.flatMap(e=>e.chats).find(e=>e._id===n);return{kind:`chat`,label:(r??i)?.title||De()}}if(t.startsWith(`folder:`)){let e=t.slice(7);return{kind:`folder`,label:(xe??[]).find(t=>t._id===e)?.name??``}}return null},Nt=e=>kt(At(String(e.active.id))),$=(0,J.useCallback)(e=>{let t=String(e.active.id).startsWith(`folder:`),n=t=>({...e,droppableContainers:e.droppableContainers.filter(e=>String(e.id).startsWith(t))}),r=L(n(`into:`));if(r.length>0){if(!t)return r;let n=r[0],i=e.droppableRects.get(n.id),a=e.pointerCoordinates?.y;if(i&&a!=null){let e=i.height*.3;if(a>i.top+e&&a<i.top+i.height-e)return r}}let i=L(n(t?`folder:`:`chat:`));if(i.length>0)return i;let a=L(n(`crumb:`));if(a.length>0)return a;let o=L(n(`col:`));return o.length>0?o:Je(n(t?`folder:`:`chat:`))},[]),It=t=>{if(T===`columns`){for(let e of D?.columns??[])if(e.chats.some(e=>e._id===t))return{list:e.chats,folderId:e.folderId};return null}if(T===`list`){let e=O?.chats.find(e=>e._id===t);return e?{list:O.chats.filter(t=>t.folderId===e.folderId),folderId:e.folderId}:null}return e.chats.some(e=>e._id===t)?{list:e.chats,folderId:e.project._id}:null},Lt=t=>{if(T===`columns`){for(let e of D?.columns??[])if(e.folders.some(e=>e._id===t))return{list:e.folders,parentId:e.folderId};return null}if(T===`list`){let e=O?.folders.find(e=>e._id===t);if(!e||!O)return null;let n=e.parentId??O.rootId;return{list:He(O.folders,e.parentId),parentId:n}}return e.children.some(e=>e._id===t)?{list:e.children,parentId:e.project._id}:null},zt=async e=>{kt(null),Dt();let{active:t,over:n}=e;if(!n)return;let r=String(n.id),i=String(t.id),a=i.startsWith(`chat:`);try{let e=Ot(r);if(e!==void 0){if(a){let t=i.slice(5);await v({chatId:t,projectId:e})}else{let t=i.slice(7);if(t===e)return;if(!ke(xe??[],t,e)){s.error(we());return}await g({projectId:t,parentId:e})}return}if(a&&r.startsWith(`chat:`)){let e=i.slice(5),t=r.slice(5);if(e===t)return;let n=It(t);if(!n)return;n.list.some(t=>t._id===e)||await v({chatId:e,projectId:n.folderId});let a=Ct(n.list,e=>e._id,e=>e.sortKey,e,t);a&&await b({chatId:e,...a});return}if(!a&&r.startsWith(`folder:`)){let e=i.slice(7),t=r.slice(7);if(e===t)return;let n=Lt(t);if(!n)return;if(!n.list.some(t=>t._id===e)){if(!ke(xe??[],e,n.parentId)){s.error(we());return}await g({projectId:e,parentId:n.parentId})}let a=Ct(n.list,e=>e._id,e=>e.sortKey,e,t);a&&await x({projectId:e,...a});return}}catch{s.error(we())}},[,Bt]=(0,J.useState)(0);(0,J.useEffect)(()=>{let e=window.setInterval(()=>Bt(e=>e+1),6e4);return()=>window.clearInterval(e)},[]);let Vt=Date.now(),Ht=H(e.project),Ut=St(e.chats,I),Wt=e.breadcrumb.slice(0,-1),Gt=e=>()=>{Z.current||e()};return(0,Y.jsx)(P.Provider,{value:Ae,children:(0,Y.jsxs)(Ue,{sensors:xt,collisionDetection:$,onDragStart:Nt,onDragEnd:zt,children:[(0,Y.jsxs)(`div`,{className:`oc-projpage__body`,style:{"--proj-hue":Ht},children:[(0,Y.jsxs)(`nav`,{className:`oc-projpage__crumbs`,"aria-label":_e(),children:[Wt.map(e=>(0,Y.jsxs)(`span`,{className:`oc-projpage__crumb`,children:[(0,Y.jsx)(jt,{folderId:e._id,children:(0,Y.jsx)(`button`,{type:`button`,className:`oc-projpage__crumblink`,onClick:Gt(()=>void t({to:`/project/$projectId`,params:{projectId:e._id}})),children:e.name})}),(0,Y.jsx)(`span`,{className:`oc-projpage__crumbsep`,"aria-hidden":!0,children:`›`})]},e._id)),(0,Y.jsx)(`span`,{className:`oc-projpage__crumbcur`,children:e.project.name})]}),(0,Y.jsxs)(`header`,{className:`oc-projpage__head`,children:[(0,Y.jsx)(`span`,{className:`oc-projpage__dot`,"aria-hidden":!0}),(0,Y.jsx)(`h1`,{className:`oc-projpage__title`,children:e.project.name}),e.project.sidebarHidden?(0,Y.jsxs)(K,{variant:`ghost`,size:`sm`,className:`oc-projpage__hiddenbadge`,title:_(),onClick:()=>{ie({projectId:e.project._id,hidden:!1})},children:[(0,Y.jsx)(at,{"aria-hidden":!0}),(0,Y.jsx)(`span`,{children:fe()}),(0,Y.jsx)(ot,{"aria-hidden":!0})]}):null,(0,Y.jsxs)(`div`,{className:`oc-projpage__actions`,children:[(0,Y.jsxs)(`div`,{className:`oc-projpage__viewtoggle`,role:`group`,"aria-label":y(),children:[(0,Y.jsx)(K,{variant:T===`cards`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":y(),title:y(),"aria-pressed":T===`cards`,onClick:()=>de(`cards`),children:(0,Y.jsx)(yt,{})}),(0,Y.jsx)(K,{variant:T===`columns`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":Te(),title:Te(),"aria-pressed":T===`columns`,onClick:()=>de(`columns`),children:(0,Y.jsx)(_t,{})}),(0,Y.jsx)(K,{variant:T===`list`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":w(),title:w(),"aria-pressed":T===`list`,onClick:()=>de(`list`),children:(0,Y.jsx)(st,{})})]}),(0,Y.jsxs)(K,{variant:`outline`,size:`sm`,onClick:()=>void F({projectId:e.project._id}),children:[(0,Y.jsx)(Le,{}),ue()]}),(0,Y.jsxs)(K,{variant:`outline`,size:`sm`,onClick:async()=>{let t=await o({title:S(),label:ee(),placeholder:se(),confirmLabel:oe()});t&&await ne({name:t,parentId:e.project._id})},children:[(0,Y.jsx)(Me,{}),S()]}),(0,Y.jsxs)(it,{children:[(0,Y.jsx)($e,{asChild:!0,children:(0,Y.jsx)(K,{variant:`ghost`,size:`icon-sm`,"aria-label":te(),children:(0,Y.jsx)(et,{})})}),(0,Y.jsxs)(nt,{align:`end`,className:`w-48`,children:[(0,Y.jsxs)(G,{onSelect:()=>{Xe(e.project.name),B(!0)},children:[(0,Y.jsx)(ct,{}),` `,p()]}),(0,Y.jsxs)(G,{onSelect:()=>Qe(!0),children:[(0,Y.jsx)(vt,{}),` `,r()]}),(0,Y.jsx)(tt,{children:Ee()}),(0,Y.jsxs)(`div`,{className:`oc-colorgrid`,children:[(0,Y.jsx)(`button`,{className:`oc-colorgrid__none`,onClick:()=>void l({projectId:e.project._id,color:null}),"aria-label":ae(),children:`✕`}),Ve.map(t=>(0,Y.jsx)(`button`,{className:`oc-colorgrid__dot`+(e.project.color===t.value?` is-selected`:``),style:{background:t.hue},"aria-label":t.value,onClick:()=>void l({projectId:e.project._id,color:t.value})},t.value))]}),(0,Y.jsx)(rt,{}),(0,Y.jsxs)(G,{variant:`destructive`,onSelect:()=>{let r=e.project.parentId;requestAnimationFrame(async()=>{let o=C?.folders??0,s=C?.chats??0;await n({title:pe({name:e.project.name}),description:gt({folders:o,chats:s,days:a}),confirmWord:f(),confirmLabel:i(),destructive:!0})&&(await m({projectId:e.project._id}),t(r===null?{to:`/`}:{to:`/project/$projectId`,params:{projectId:r}}))})},children:[(0,Y.jsx)(lt,{}),` `,f()]})]})]})]})]}),T===`columns`?(0,Y.jsx)(Rt,{data:D,currentId:e.project._id,busyIds:A,suppressClick:Z,locateChatId:ge??null}):T===`list`?(0,Y.jsx)(Ft,{data:O,busyIds:A,suppressClick:Z,locateChatId:ge??null}):(0,Y.jsxs)(Y.Fragment,{children:[e.children.length>0?(0,Y.jsxs)(`section`,{className:`oc-projpage__section`,children:[(0,Y.jsx)(`h2`,{className:`oc-projpage__subtitle`,children:he()}),(0,Y.jsx)(`div`,{className:`oc-projpage__cards`,children:(0,Y.jsx)(W,{items:e.children.map(e=>`folder:${e._id}`),strategy:Ke,children:e.children.map(t=>(0,Y.jsx)(Mt,{child:t,parentId:e.project._id,now:Vt,suppressClick:Z},t._id))})})]}):null,(0,Y.jsxs)(`section`,{className:`oc-projpage__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-projpage__convhead`,children:[(0,Y.jsx)(`h2`,{className:`oc-projpage__subtitle`,children:ye()}),e.chats.length>0?(0,Y.jsx)(ut,{value:I,onChange:e=>Re(e.target.value),placeholder:me(),className:`oc-projpage__filter`}):null]}),e.chats.length===0?(0,Y.jsx)(`p`,{className:`oc-projpage__hint`,children:e.children.length===0?Se():ve()}):Ut.length===0&&(X??[]).length===0?(0,Y.jsx)(`p`,{className:`oc-projpage__hint`,children:le({term:I.trim()})}):(0,Y.jsx)(`ul`,{className:`oc-projpage__chats`,children:(0,Y.jsx)(W,{items:Ut.map(e=>`chat:${e._id}`),strategy:U,children:Ut.map(t=>(0,Y.jsx)(Pt,{chat:t,currentFolderId:e.project._id,now:Vt,busy:A.has(t._id),unread:N.has(t._id),locate:t._id===ge,suppressClick:Z},t._id))})})]}),q.length>=2&&X!==void 0?(0,Y.jsxs)(`section`,{className:`oc-projpage__section`,children:[(0,Y.jsx)(`h2`,{className:`oc-projpage__subtitle`,children:be()}),X.length===0?(0,Y.jsx)(`p`,{className:`oc-projpage__hint`,children:le({term:q})}):(0,Y.jsx)(`ul`,{className:`oc-projpage__chats`,children:X.map(e=>(0,Y.jsx)(`li`,{className:`oc-projpage__chatrow`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-projpage__chatbtn`,onClick:()=>{e.messageId&&q&&je(e.messageId,q),t({to:`/chat/$chatId`,params:{chatId:e.chatId},...e.messageId?{search:{m:e.messageId}}:{}})},children:[(0,Y.jsx)(Ne,{size:13,"aria-hidden":!0,className:`oc-projpage__hitico`}),(0,Y.jsxs)(`span`,{className:`oc-projpage__hitbody`,children:[(0,Y.jsx)(`span`,{className:`oc-projpage__chattitle`,children:e.title||re()}),e.projectPath&&e.projectPath.length>1?(0,Y.jsx)(`span`,{className:`oc-projpage__hitpath`,children:e.projectPath.join(` › `)}):null,e.snippet?(0,Y.jsx)(`span`,{className:`oc-projpage__hitsnippet`,children:e.snippet}):null]})]})},`${e.chatId}:${e.messageId??`t`}`))})]}):null]}),(0,Y.jsx)(mt,{open:z,onOpenChange:B,title:u(),canSubmit:V.trim().length>0,onSubmit:async()=>{await c({projectId:e.project._id,name:V.trim()}),B(!1)},submitLabel:p(),children:(0,Y.jsx)(ut,{value:V,onChange:e=>Xe(e.target.value),autoFocus:!0})}),Ze?(0,Y.jsx)(We,{open:Ze,onOpenChange:Qe,title:ce(),movingFolderId:e.project._id,currentId:e.project.parentId,onPick:t=>void g({projectId:e.project._id,parentId:t})}):null,Pe]}),(0,Y.jsx)(Be,{children:Q?(0,Y.jsxs)(`div`,{className:`oc-projpage__dragghost`,children:[Q.kind===`folder`?(0,Y.jsx)(R,{size:13,"aria-hidden":!0}):(0,Y.jsx)(Ne,{size:13,"aria-hidden":!0}),(0,Y.jsx)(`span`,{children:Q.label})]}):null})]})})}function jt({folderId:e,children:t}){let{setNodeRef:n,isOver:r}=M({id:Q(e)});return(0,Y.jsx)(`span`,{ref:n,className:r?`oc-projpage__cdrop is-over`:`oc-projpage__cdrop`,children:t})}function Mt({child:e,parentId:t,now:n,suppressClick:r}){let i=j(),a=B({id:`folder:${e._id}`}),o=M({id:Z(e._id)});return(0,Y.jsxs)(`div`,{ref:e=>{a.setNodeRef(e),o.setNodeRef(e)},className:`oc-projpage__card`+(o.isOver?` is-over`:``)+(a.isDragging?` is-dragging`:``),style:{"--proj-hue":H(e),transform:N.Transform.toString(a.transform),transition:a.transition},onClick:()=>{r.current||i({to:`/project/$projectId`,params:{projectId:e._id}})},onKeyDown:t=>{t.key===`Enter`&&i({to:`/project/$projectId`,params:{projectId:e._id}})},...a.listeners,...a.attributes,role:`link`,tabIndex:0,children:[(0,Y.jsxs)(`span`,{className:`oc-projpage__cardhead`,children:[(0,Y.jsx)(R,{size:15,"aria-hidden":!0,className:`oc-projpage__cardico`}),(0,Y.jsx)(`span`,{className:`oc-projpage__cardname`,children:e.name}),(0,Y.jsx)(X,{folderId:e._id,name:e.name,color:e.color,currentParentId:t,className:`oc-projpage__cardmenu`,onOpen:()=>void i({to:`/project/$projectId`,params:{projectId:e._id}})})]}),(0,Y.jsxs)(`span`,{className:`oc-projpage__cardmeta`,children:[e.folderCount>0?T({count:e.folderCount})+` · `:``,Ce({count:e.recursiveChatCount})]}),e.lastActivityAt===null?null:(0,Y.jsx)(`span`,{className:`oc-projpage__cardage`,children:V(e.lastActivityAt,n)})]})}function Nt({chat:e}){let t=d(k.chats.setChatSidebar),n=e.inSidebar?o():A();return(0,Y.jsx)(K,{variant:`ghost`,size:`icon-xs`,"aria-label":n,title:n,className:`oc-projpage__barbtn`+(e.inSidebar?` is-on`:``),disabled:e.pinned&&e.inSidebar,onClick:n=>{n.stopPropagation(),t({chatId:e._id,hidden:e.inSidebar})},children:e.inSidebar?(0,Y.jsx)(Re,{}):(0,Y.jsx)(q,{})})}function Pt({chat:e,currentFolderId:t,now:n,busy:r,unread:i,locate:a,suppressClick:o}){let s=(0,J.useContext)(P).get(e._id),c=j(),l=z(e.color),u=B({id:`chat:${e._id}`}),d=$(a);return(0,Y.jsxs)(`li`,{ref:e=>{u.setNodeRef(e),d.current=e},className:`oc-projpage__chatrow`+(u.isDragging?` is-dragging`:``)+(a?` is-locate`:``),style:{transform:N.Transform.toString(u.transform),transition:u.transition},children:[(0,Y.jsxs)(`button`,{type:`button`,className:`oc-projpage__chatbtn`,onClick:()=>{o.current||c({to:`/chat/$chatId`,params:{chatId:e._id}})},...u.listeners,...u.attributes,children:[l?(0,Y.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:l}}):(0,Y.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,Y.jsx)(`span`,{className:`oc-projpage__chattitle`,children:e.title||De()}),e.pinned?(0,Y.jsx)(Ae,{size:12,"aria-hidden":!0,className:`oc-projpage__chatpin`}):null,(0,Y.jsx)(`span`,{className:`oc-projpage__chatage`,children:V(e.updatedAt,n)}),r?(0,Y.jsx)(`span`,{className:F(s,v()).className,title:F(s,v()).label,"aria-label":F(s,v()).label}):null,i&&!r?(0,Y.jsx)(`span`,{className:`oc-chatitem__unread`,title:g(),"aria-label":g()}):null]}),(0,Y.jsx)(Nt,{chat:e}),(0,Y.jsx)(xt,{chat:e,currentFolderId:t,className:`oc-projpage__chatmenu`})]})}function $(e){let t=(0,J.useRef)(null);return(0,J.useEffect)(()=>{e&&t.current&&t.current.scrollIntoView({block:`center`})},[e]),t}function Ft({data:e,busyIds:t,suppressClick:n,locateChatId:r}){let[i,a]=(0,J.useState)(new Set),o=(0,J.useMemo)(()=>{let t=new Map;for(let n of e?.chats??[]){let e=t.get(n.folderId);e===void 0?t.set(n.folderId,[n]):e.push(n)}return t},[e]);if(e===void 0)return(0,Y.jsx)(`p`,{className:`oc-projpage__hint`,children:l()});if(e===null)return null;let s=e=>a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),c=(a,l)=>{let u=o.get(a??e.rootId)??[],d=He(e.folders,a);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(W,{items:u.map(e=>`chat:${e._id}`),strategy:U,children:u.map(e=>(0,Y.jsx)(Lt,{chat:e,depth:l,busy:t.has(e._id),locate:e._id===r,suppressClick:n},e._id))}),(0,Y.jsx)(W,{items:d.map(e=>`folder:${e._id}`),strategy:U,children:d.map(t=>(0,Y.jsx)(It,{folder:t,parentId:a??e.rootId,depth:l,folded:i.has(t._id),onToggle:()=>s(t._id),suppressClick:n,children:i.has(t._id)?null:c(t._id,l+1)},t._id))})]})};return(0,Y.jsx)(`div`,{className:`oc-projpage__tree`,children:(o.get(e.rootId)??[]).length===0&&He(e.folders,null).length===0?(0,Y.jsx)(`p`,{className:`oc-projpage__hint`,children:Se()}):c(null,0)})}function It({folder:e,parentId:t,depth:n,folded:r,onToggle:i,suppressClick:a,children:o}){let s=j(),c=B({id:`folder:${e._id}`}),l=M({id:Z(e._id)});return(0,Y.jsxs)(`div`,{className:`oc-projpage__treegroup`,children:[(0,Y.jsxs)(`div`,{ref:e=>{c.setNodeRef(e),l.setNodeRef(e)},className:`oc-projpage__treerow oc-projpage__treerow--folder`+(l.isOver?` is-over`:``)+(c.isDragging?` is-dragging`:``),style:{"--tree-depth":n,"--proj-hue":H(e),transform:N.Transform.toString(c.transform),transition:c.transition},...c.listeners,...c.attributes,role:`button`,tabIndex:0,onClick:()=>{a.current||s({to:`/project/$projectId`,params:{projectId:e._id}})},onKeyDown:t=>{t.key===`Enter`&&s({to:`/project/$projectId`,params:{projectId:e._id}})},children:[(0,Y.jsx)(`button`,{type:`button`,className:`oc-projpage__treechev`,"aria-label":r?de():D(),"aria-expanded":!r,onClick:e=>{e.stopPropagation(),!a.current&&i()},onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),children:r?(0,Y.jsx)(Qe,{size:13}):(0,Y.jsx)(Ze,{size:13})}),(0,Y.jsx)(R,{size:13,"aria-hidden":!0,className:`oc-projpage__colico`}),(0,Y.jsx)(`span`,{className:`oc-projpage__colname`,children:e.name}),(0,Y.jsx)(X,{folderId:e._id,name:e.name,color:e.color,currentParentId:t,className:`oc-projpage__treemenu`,onOpen:()=>void s({to:`/project/$projectId`,params:{projectId:e._id}})})]}),o]})}function Lt({chat:e,depth:t,busy:n,locate:r,suppressClick:i}){let a=(0,J.useContext)(P).get(e._id),o=j(),s=B({id:`chat:${e._id}`}),c=$(r),l=z(e.color);return(0,Y.jsxs)(`div`,{ref:e=>{s.setNodeRef(e),c.current=e},className:`oc-projpage__treerow oc-projpage__treerow--chat`+(s.isDragging?` is-dragging`:``)+(r?` is-locate`:``),style:{"--tree-depth":t,transform:N.Transform.toString(s.transform),transition:s.transition},children:[(0,Y.jsxs)(`button`,{type:`button`,className:`oc-projpage__colchatbtn`,onClick:()=>{i.current||o({to:`/chat/$chatId`,params:{chatId:e._id}})},...s.listeners,...s.attributes,children:[l?(0,Y.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:l}}):(0,Y.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,Y.jsx)(`span`,{className:`oc-projpage__colname`,children:e.title||De()}),n?(0,Y.jsx)(`span`,{className:F(a,``).className,"aria-hidden":!0}):null]}),(0,Y.jsx)(xt,{chat:e,currentFolderId:e.folderId,className:`oc-projpage__treemenu`}),(0,Y.jsx)(Nt,{chat:e})]})}function Rt({data:e,currentId:t,busyIds:n,suppressClick:r,locateChatId:i}){let a=(0,J.useRef)(null);return(0,J.useEffect)(()=>{let e=a.current;e&&(e.scrollLeft=e.scrollWidth)},[e?.columns.length??0,t]),e===void 0?(0,Y.jsx)(`p`,{className:`oc-projpage__hint`,children:l()}):(0,Y.jsx)(`div`,{className:`oc-projpage__cols`,ref:a,children:e.columns.map((a,o)=>(0,Y.jsx)(zt,{col:a,isLast:o===e.columns.length-1,currentId:t,busyIds:n,suppressClick:r,locateChatId:i},a.folderId??`root`))})}function zt({col:e,isLast:t,currentId:n,busyIds:r,suppressClick:i,locateChatId:a}){let o=j(),s=M({id:Dt(e.folderId)});return(0,Y.jsxs)(`div`,{ref:s.setNodeRef,className:`oc-projpage__col`+(s.isOver?` is-over`:``)+(t?` is-last`:``),children:[(0,Y.jsx)(W,{items:e.folders.map(e=>`folder:${e._id}`),strategy:U,children:e.folders.map(t=>(0,Y.jsx)(Bt,{folder:t,parentId:e.folderId,isCurrent:t._id===n,suppressClick:i,onOpen:()=>void o({to:`/project/$projectId`,params:{projectId:t._id}})},t._id))}),(0,Y.jsx)(W,{items:e.chats.map(e=>`chat:${e._id}`),strategy:U,children:e.chats.map(t=>(0,Y.jsx)(Vt,{chat:t,folderId:e.folderId,busy:r.has(t._id),locate:t._id===a,suppressClick:i,onOpen:()=>void o({to:`/chat/$chatId`,params:{chatId:t._id}})},t._id))}),e.folders.length===0&&e.chats.length===0?(0,Y.jsx)(`p`,{className:`oc-projpage__colempty`,children:ve()}):null]})}function Bt({folder:e,parentId:t,isCurrent:n,suppressClick:r,onOpen:i}){let a=B({id:`folder:${e._id}`}),o=M({id:Z(e._id)});return(0,Y.jsxs)(`div`,{ref:e=>{a.setNodeRef(e),o.setNodeRef(e)},className:`oc-projpage__colentry oc-projpage__colentry--folder`+(e.selected||n?` is-selected`:``)+(o.isOver?` is-over`:``)+(a.isDragging?` is-dragging`:``),style:{"--proj-hue":H(e),transform:N.Transform.toString(a.transform),transition:a.transition},onClick:()=>{r.current||i()},onKeyDown:e=>{e.key===`Enter`&&e.target===e.currentTarget&&i()},...a.listeners,...a.attributes,role:`button`,tabIndex:0,children:[(0,Y.jsx)(R,{size:13,"aria-hidden":!0,className:`oc-projpage__colico`}),(0,Y.jsx)(`span`,{className:`oc-projpage__colname`,children:e.name}),(0,Y.jsx)(`span`,{className:`oc-projpage__colchev`,"aria-hidden":!0,children:`›`}),(0,Y.jsx)(X,{folderId:e._id,name:e.name,color:e.color,currentParentId:t,className:`oc-projpage__colmenu`,onOpen:i})]})}function Vt({chat:e,folderId:t,busy:n,locate:r,suppressClick:i,onOpen:a}){let o=(0,J.useContext)(P).get(e._id),s=B({id:`chat:${e._id}`}),c=$(r),l=z(e.color);return(0,Y.jsxs)(`div`,{ref:e=>{s.setNodeRef(e),c.current=e},className:`oc-projpage__colentry oc-projpage__colentry--chat`+(s.isDragging?` is-dragging`:``)+(r?` is-locate`:``),style:{transform:N.Transform.toString(s.transform),transition:s.transition},children:[(0,Y.jsxs)(`button`,{type:`button`,className:`oc-projpage__colchatbtn`,onClick:()=>{i.current||a()},...s.listeners,...s.attributes,children:[l?(0,Y.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:l}}):(0,Y.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,Y.jsx)(`span`,{className:`oc-projpage__colname`,children:e.title||De()}),n?(0,Y.jsx)(`span`,{className:F(o,``).className,"aria-hidden":!0}):null]}),(0,Y.jsx)(xt,{chat:e,currentFolderId:t,className:`oc-projpage__colmenu oc-projpage__colmenu--chat`}),(0,Y.jsx)(Nt,{chat:e})]})}export{kt as ProjectPage};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$A as r,$f as i,$m as a,BA as o,FZ as s,GA as c,HA as l,IA as u,IZ as d,JA as f,KA as p,LA as m,Os as h,QA as g,Qf as _,Qm as ee,RA as te,UA as ne,VA as re,WA as ie,XA as v,Xf as y,YA as b,ZA as x,Zf as S,cj as C,cp as ae,eh as oe,ej as se,ep as ce,hd as le,lj as w,lp as T,md as E,nh as D,pd as O,qA as k,sp as A,t as j,th as M,tj as N,up as P,zA as F}from"./api-DNOgniXv.js";import{i as I,n as L,r as R,t as z}from"./FieldLabel-rU6Ua6ki.js";import{t as B}from"./checkbox-kFoJxcMJ.js";import{a as V,c as H,o as ue,s as U}from"./tooltip-6h3mm-V5.js";import{a as W,i as G,n as K,r as q,t as J}from"./select-CYo6IZR2.js";import{t as Y}from"./button-2XjWVeWK.js";import{r as de}from"./toast-DN6P_at0.js";import{t as fe}from"./appHost-CH3EGcJw.js";import{r as X,t as Z}from"./locales-CPjguROj.js";import{t as pe}from"./localePickerView-C2RmOS86.js";/* empty css */var Q=t(e(),1),$=n(),me={media_delivery:{label:v,help:b},documentary_fetch:{label:f,help:k},inbound_files:{label:p,help:c},history_summary:{label:D,help:M},file_curation:{label:P,help:ce},quote_reply:{label:T,help:ae}},he={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
|
|
2
|
+
- gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`,previous_summary:`Projet Alpha : budget 40 000 EUR ; choix du serveur en cours.`,new_messages:`Utilisateur : Compare OVH et Scaleway.
|
|
3
|
+
Assistant : Comparaison en cours.`,max_chars:`6000`,file_name:`MEMORY.md`,budget_chars:`20000`,feedback:`Trop de suppressions dans la section des liens, garde-les.`,content:`# Memory index
|
|
4
|
+
- [Fait 1](fait-1.md) - note du projet`,excerpt:`Le classement propose trois dossiers : Clients, Fournisseurs, Interne.`},ge={outboundDir:te,references:m,files:u,previous_summary:oe,new_messages:a,max_chars:ee,file_name:i,budget_chars:_,feedback:S,content:y,excerpt:A};function _e(){let e=d(j.admin.listInstances,{}),[t,n]=(0,Q.useState)(null);if(e===void 0)return(0,$.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,$.jsx)(`div`,{className:`oc-injtab`,children:(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:ne()})});let r=e.find(e=>e._id===t)??e[0];return(0,$.jsxs)(`div`,{className:`oc-injtab`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,$.jsx)(L,{label:N(),help:se()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:ie()}),(0,$.jsxs)(J,{value:r._id,onValueChange:e=>n(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(W,{})}),(0,$.jsx)(K,{children:e.map(e=>(0,$.jsx)(q,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(ve,{instance:r},r._id)]})}function ve({instance:e}){let t=s(j.admin.upsertInstanceConfig),n=de(),r=d(j.me.getMe,{host:fe}),i=e.config??{},a=X(e.config?.contentLocale,r?.defaultLocale??void 0),[o,c]=(0,Q.useState)(()=>I(i,a));(0,Q.useEffect)(()=>{c(I(i,a))},[a,e._id]);let[l,u]=(0,Q.useState)(!1),f=o.promptInjections,p=(e,t)=>c({...o,promptInjections:{...f,[e]:{...f[e],...t}}});async function m(){u(!0);try{await t({instanceId:e._id,config:R(o,i,a)})}catch(e){n.error(C(),e)}finally{u(!1)}}async function h(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(C(),e)}}let g=e.config?.contentLocale??`default`,_=Z[X(void 0,r?.defaultLocale??void 0)];return(0,$.jsxs)(`div`,{className:`oc-injtab__body`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__content-locale`,children:[(0,$.jsx)(`span`,{children:le()}),(0,$.jsxs)(J,{value:g,onValueChange:e=>void h(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(W,{})}),(0,$.jsxs)(K,{children:[(0,$.jsx)(q,{value:`default`,children:O({locale:_})}),pe().map(e=>(0,$.jsx)(q,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:E()})]}),ue.map(e=>(0,$.jsx)(ye,{injKey:e,def:V[e],i18n:me[e],row:f[e]??{enabled:!0,template:V[e].defaultTemplate[a]},contentLocale:a,onChange:t=>p(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(Y,{size:`sm`,onClick:()=>void m(),disabled:l,children:w()})})]})}function ye({injKey:e,def:t,i18n:n,row:i,contentLocale:a,onChange:s}){let[c,u]=(0,Q.useState)(!1),d=i.template.trim()!==t.defaultTemplate[a],f=t.togglable&&!i.enabled,p=Object.fromEntries(t.placeholders.map(e=>[e,he[e]??`{${e}}`])),m=U(e,i,a),_=m?H(m,p):``;return(0,$.jsxs)(`section`,{className:`oc-injcard`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,$.jsxs)(`label`,{className:`oc-field--row`,children:[(0,$.jsx)(B,{checked:i.enabled,onCheckedChange:e=>s({enabled:e===!0})}),(0,$.jsx)(L,{label:n.label(),help:n.help()})]}):(0,$.jsx)(L,{label:n.label(),help:n.help()}),d&&(0,$.jsx)(`span`,{className:`oc-injection__badge`,children:g()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:i.template,disabled:f,rows:8,spellCheck:!1,onChange:e=>s({template:e.target.value})}),(0,$.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:x()}),t.placeholders.map(e=>(0,$.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,$.jsx)(`code`,{children:`{${e}}`}),(0,$.jsx)(z,{text:(ge[e]??(()=>e))()})]},e))]}),(0,$.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,$.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>u(e=>!e),children:c?re():l()}),d&&(0,$.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>s({template:t.defaultTemplate[a]}),children:r()})]})]}),c&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:_?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:_}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:o()}),t.pluralDefaultTemplate!==void 0&&!f?(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:h()}):null]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:F()})})]})}export{_e as PromptInjectionsTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,AP as i,BP as ee,CP as te,FP as ne,FZ as a,GP as o,HP as s,IP as re,IZ as ie,JP as c,KP as l,LP as u,MP as d,NP as f,PP as p,Pp as m,QP as h,RP as g,SP as _,UP as v,VP as y,WP as ae,XP as b,YP as x,ZP as S,_P as C,aF as w,bP as T,eF as E,gP as D,hP as O,iF as k,jP as A,kP as j,nF as M,qP as N,rF as P,t as F,tF as I,vP as L,xP as oe,yP as R,zP as z}from"./api-DNOgniXv.js";import{t as B}from"./lock-BlAOODxr.js";import{t as V}from"./checkbox-kFoJxcMJ.js";import{t as H}from"./button-2XjWVeWK.js";import{t as U}from"./input-BOl1ZpD6.js";import"./convexApi-4XI9Ua6G.js";import{r as W}from"./toast-DN6P_at0.js";import{t as G}from"./badge-D7TV9F5d.js";import{n as K}from"./ConfirmDialog-DUn2vS3y.js";import{t as q}from"./EntitySheet-BHlTwSgy.js";import{t as J}from"./roleDescriptions-DIDUvLuU.js";var Y=t(e(),1),X=n(),Z=[{group:()=>w(),keys:[{key:`traces.read`,label:()=>E()},{key:`traces.read.content`,label:()=>r(),phi:!0},{key:`traces.write`,label:()=>h()}]},{group:()=>k(),keys:[{key:`kpi.read`,label:()=>E()},{key:`kpi.write`,label:()=>h()}]},{group:()=>P(),keys:[{key:`openclaw.query`,label:()=>S()},{key:`anomalies.read`,label:()=>b()},{key:`anomalies.report`,label:()=>x()}]},{group:()=>M(),keys:[{key:`chats.read`,label:()=>E()},{key:`selfheal`,label:()=>N()},{key:`media.repair`,label:()=>l()},{key:`feedback.respond`,label:()=>m()}]},{group:()=>I(),keys:[{key:`admin.manage`,label:()=>c()}]}],se=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function ce(){let e=ie(F.apiKeys.listRoles,{}),t=a(F.apiKeys.createRole),n=a(F.apiKeys.ensureRolesSeeded),r=a(F.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(F.apiKeys.listRoles,{});r&&e.setQuery(F.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),c=K(),l=W(),[m,h]=(0,Y.useState)(!1),[b,x]=(0,Y.useState)($),[S,w]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{l.error(ae(),e)})},[n,l]);let E=e??[];async function k(e,t){if(Q(e.permissions))return;if(e.builtin){await c({title:v({name:e.name}),description:s(),confirmLabel:y()});return}if(S.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];w(t=>new Set(t).add(e._id));try{await r({roleId:e._id,permissions:n})}catch(e){l.error(ee(),e)}finally{w(t=>{let n=new Set(t);return n.delete(e._id),n})}}async function M(){try{await t({key:b.key,name:b.name,description:b.description||void 0,permissions:[]}),x($),h(!1)}catch(e){l.error(z(),e)}}let N=e===void 0,P=!N&&E.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[g(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,u(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,re()]}),(0,X.jsxs)(`div`,{className:`oc-dt`,children:[(0,X.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,X.jsx)(`h2`,{className:`oc-dt__title`,children:ne()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(H,{size:`sm`,onClick:()=>{x($),h(!0)},children:p()})})]}),N?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):P?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):(0,X.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,X.jsxs)(`table`,{className:`oc-matrix`,children:[(0,X.jsxs)(`thead`,{children:[(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:A()}),Z.map(e=>(0,X.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,X.jsx)(`tr`,{children:Z.flatMap(e=>e.keys.map(e=>(0,X.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?o({key:e.key}):e.key,children:[e.label(),e.phi?(0,X.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,X.jsx)(`tbody`,{children:E.map(e=>{let t=Q(e.permissions),n=S.has(e._id);return(0,X.jsxs)(`tr`,{children:[(0,X.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,X.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,X.jsx)(`span`,{children:e.name}),(0,X.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,X.jsxs)(G,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(B,{}),` `,i()]}):(0,X.jsx)(G,{variant:`secondary`,children:j()})]}),J(e)?(0,X.jsx)(`p`,{className:`oc-matrix__roledesc`,children:J(e)}):null]}),se.map(r=>(0,X.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,X.jsx)(V,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?te():n?_():r,onCheckedChange:()=>void k(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(q,{open:m,onOpenChange:h,title:oe(),description:T(),canSubmit:!!(b.key&&b.name),onSubmit:M,submitLabel:R(),children:(0,X.jsxs)(`div`,{className:`oc-form`,children:[(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:L()}),(0,X.jsx)(U,{value:b.key,placeholder:C(),onChange:e=>x({...b,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:D()}),(0,X.jsx)(U,{value:b.name,onChange:e=>x({...b,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:O()}),(0,X.jsx)(U,{value:b.description,onChange:e=>x({...b,description:e.target.value})})]})]})})]})}export{ce as RolesTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$Y as r,AY as i,BJ as a,CJ as o,CY as s,DY as c,E as l,EY as u,EZ as d,FJ as f,GJ as ee,HJ as p,IJ as m,IZ as te,JJ as ne,KJ as h,LJ as g,NZ as _,OY as re,OZ as v,QY as ie,RJ as ae,SJ as oe,SY as se,TJ as ce,TY as le,UJ as ue,VJ as de,WJ as fe,XJ as y,XY as pe,YJ as me,YY as he,ZY as ge,_J as _e,_Y as ve,aX as ye,aY as be,bJ as xe,bY as Se,cJ as Ce,cX as we,cY as Te,dJ as Ee,eX as De,fJ as Oe,fY as ke,gJ as Ae,gY as je,hJ as Me,hY as Ne,iX as Pe,iY as Fe,kY as Ie,lJ as Le,lX as Re,lY as ze,mJ as Be,nJ as Ve,nX as He,nY as Ue,oX as We,oY as Ge,pJ as Ke,qJ as b,rX as qe,rY as Je,sX as Ye,sY as Xe,t as x,tX as Ze,tY as Qe,uJ as $e,uX as et,uY as tt,vJ as nt,vY as rt,wJ as it,xJ as at,xY as ot,yJ as st,yY as ct,zJ as lt}from"./api-DNOgniXv.js";import{t as S}from"./chevron-left-SzhbAbEJ.js";import{t as C}from"./chevron-right-9DjIYDNR.js";import{t as ut}from"./list-CgDCvRps.js";import{t as dt}from"./loader-circle-D-oC88g9.js";import{a as ft,i as pt,n as mt,r as ht,t as gt}from"./cronDescribe-CWrWu4NY.js";import{t as _t}from"./pencil-C9Bd090l.js";import{t as vt}from"./rotate-ccw-WHZ3xMbc.js";import{t as yt}from"./trash-2-BmifkPwA.js";import{a as w,i as T,n as E,r as D,t as O}from"./select-CYo6IZR2.js";import{a as bt,c as xt,i as St,n as Ct,o as wt,r as Tt,s as Et,t as Dt}from"./alert-dialog-BdTFPzVf.js";import{n as k,r as A,t as j}from"./popover-BHbAt2S-.js";import{t as M}from"./button-2XjWVeWK.js";import{t as Ot}from"./input-BOl1ZpD6.js";import"./convexApi-4XI9Ua6G.js";import{r as kt}from"./toast-DN6P_at0.js";import{t as N}from"./badge-D7TV9F5d.js";import{a as At,i as jt,n as Mt,o as Nt,r as Pt,t as Ft}from"./dialog-Cw-buQuR.js";import{t as It}from"./appHost-CH3EGcJw.js";import{a as Lt,i as P,n as Rt,o as zt,r as F,t as Bt}from"./table-C6NnEhxy.js";import{t as Vt}from"./FilterBar-1CED41DE.js";/* empty css */import{a as Ht,c as I,i as L,l as Ut,n as Wt,o as R,r as Gt,s as Kt,t as qt,u as z}from"./TimezoneCombobox-DAhFeIgd.js";var Jt=l(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Yt=l(`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`}]]),B=t(e(),1),V=n();function H(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function Xt({value:e,onChange:t}){let n=Ut(e),r=(0,B.useMemo)(()=>new Date,[]),[i,a]=(0,B.useState)(()=>({year:n?.year??r.getFullYear(),month:n?.month??r.getMonth()})),[o,s]=(0,B.useState)(!1),c=(0,B.useMemo)(()=>H(v()),[]),l=(0,B.useMemo)(()=>new Intl.DateTimeFormat(v(),{month:`long`,year:`numeric`}),[]),u=(0,B.useMemo)(()=>new Intl.DateTimeFormat(v(),{dateStyle:`medium`,timeStyle:`short`}),[]),d=I(i.year,i.month),f=n?.hour??9,p=n?.minute??0,m=(e,n,r,i,a)=>t(z(e,n,r,i,a)),te=(e,t,n)=>{a({year:e,month:t}),m(e,t,n,f,p)},g=e=>{let t=new Date(i.year,i.month+e,1);a({year:t.getFullYear(),month:t.getMonth()})},_=n===null?me():u.format(new Date(n.year,n.month,n.day,n.hour,n.minute));return(0,V.jsxs)(j,{modal:!0,open:o,onOpenChange:s,children:[(0,V.jsx)(A,{asChild:!0,children:(0,V.jsxs)(`button`,{type:`button`,className:`oc-dtp__trigger`,"aria-label":y(),children:[(0,V.jsx)(Jt,{size:14,"aria-hidden":!0,className:`oc-dtp__icon`}),(0,V.jsx)(`span`,{className:n===null?`oc-dtp__placeholder`:void 0,children:_})]})}),(0,V.jsxs)(k,{align:`start`,className:`oc-dtp__pop`,children:[(0,V.jsxs)(`div`,{className:`oc-dtp__head`,children:[(0,V.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":ne(),onClick:()=>g(-1),children:(0,V.jsx)(S,{size:15,"aria-hidden":!0})}),(0,V.jsx)(`span`,{className:`oc-dtp__month`,children:l.format(new Date(i.year,i.month,1))}),(0,V.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":b(),onClick:()=>g(1),children:(0,V.jsx)(C,{size:15,"aria-hidden":!0})})]}),(0,V.jsxs)(`div`,{className:`oc-dtp__grid`,children:[c.map((e,t)=>(0,V.jsx)(`span`,{className:`oc-dtp__wd`,children:e},t)),d.map((e,t)=>{let i=n!==null&&n.year===e.year&&n.month===e.month&&n.day===e.day,a=r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,V.jsx)(`button`,{type:`button`,className:`oc-dtp__day`+(e.inMonth?``:` oc-dtp__day--out`)+(i?` oc-dtp__day--sel`:``)+(a&&!i?` oc-dtp__day--today`:``),onClick:()=>te(e.year,e.month,e.day),children:e.day},t)})]}),(0,V.jsxs)(`div`,{className:`oc-dtp__time`,children:[(0,V.jsxs)(O,{value:String(f),onValueChange:e=>m(i.year,i.month,n?.day??r.getDate(),Number(e),p),children:[(0,V.jsx)(T,{size:`sm`,"aria-label":h(),children:(0,V.jsx)(w,{})}),(0,V.jsx)(E,{className:`oc-dtp__timeopts`,children:Array.from({length:24},(e,t)=>(0,V.jsx)(D,{value:String(t),children:String(t).padStart(2,`0`)},t))})]}),(0,V.jsx)(`span`,{className:`oc-dtp__colon`,children:`:`}),(0,V.jsxs)(O,{value:String(p),onValueChange:e=>m(i.year,i.month,n?.day??r.getDate(),f,Number(e)),children:[(0,V.jsx)(T,{size:`sm`,"aria-label":ee(),children:(0,V.jsx)(w,{})}),(0,V.jsx)(E,{className:`oc-dtp__timeopts`,children:Array.from({length:60},(e,t)=>(0,V.jsx)(D,{value:String(t),children:String(t).padStart(2,`0`)},t))})]})]})]})]})}function U(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function Zt(e,t,n){let r=e=>String(e).padStart(2,`0`);return`${e}-${r(t+1)}-${r(n)}`}function Qt(e){let t=new Map;for(let n of e){let e=U(n.atMs),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}for(let e of t.values())e.sort((e,t)=>e.atMs-t.atMs);return t}function W(e,t,n){let r=new Map,i=new Date(t,n+1,0).getDate();for(let a=1;a<=i;a++){let i=e.get(Zt(t,n,a));i!==void 0&&i.length>0&&r.set(a,i.length)}return r}function $t(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function en(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()+42);return{startMs:r.getTime(),endMs:i.getTime()}}function tn(e){return{startMs:new Date(e,0,1).getTime(),endMs:new Date(e+1,0,1).getTime()}}var G=3;function nn({events:e,mode:t,cursor:n,onModeChange:r,onCursorChange:i,onEventClick:o,footnote:s}){let c=v(),l=(0,B.useMemo)(()=>Qt(e),[e]),u=(0,B.useMemo)(()=>$t(c),[c]),d=(0,B.useMemo)(()=>new Intl.DateTimeFormat(c,{month:`long`,year:`numeric`}),[c]),f=(0,B.useMemo)(()=>new Intl.DateTimeFormat(c,{month:`long`}),[c]),ee=(0,B.useMemo)(()=>new Intl.DateTimeFormat(c,{hour:`2-digit`,minute:`2-digit`}),[c]),p=new Date,m=e=>{if(t===`year`){i({year:n.year+e,month:n.month});return}let r=new Date(n.year,n.month+e,1);i({year:r.getFullYear(),month:r.getMonth()})},te=t===`year`?String(n.year):d.format(new Date(n.year,n.month,1));return(0,V.jsxs)(`div`,{className:`oc-cal`,children:[(0,V.jsxs)(`div`,{className:`oc-cal__head`,children:[(0,V.jsxs)(`div`,{className:`oc-cal__nav`,children:[(0,V.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":ae(),onClick:()=>m(-1),children:(0,V.jsx)(S,{})}),(0,V.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":g(),onClick:()=>m(1),children:(0,V.jsx)(C,{})}),(0,V.jsx)(M,{variant:`ghost`,size:`sm`,onClick:()=>i({year:p.getFullYear(),month:p.getMonth()}),children:lt()})]}),(0,V.jsx)(`span`,{className:`oc-cal__title`,children:te}),(0,V.jsxs)(`div`,{className:`oc-cal__modes`,role:`group`,children:[(0,V.jsx)(M,{variant:t===`month`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`month`,onClick:()=>r(`month`),children:de()}),(0,V.jsx)(M,{variant:t===`year`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`year`,onClick:()=>r(`year`),children:a()})]})]}),t===`month`?(0,V.jsx)(rn,{cursor:n,byDay:l,weekdays:u,timeFmt:ee,now:p,onEventClick:o}):(0,V.jsx)(an,{year:n.year,byDay:l,monthShortFmt:f,now:p,onOpenMonth:e=>{i({year:n.year,month:e}),r(`month`)}}),s?(0,V.jsx)(`p`,{className:`oc-cal__footnote`,children:s}):null]})}function rn({cursor:e,byDay:t,weekdays:n,timeFmt:r,now:i,onEventClick:a}){let o=I(e.year,e.month);return(0,V.jsxs)(`div`,{className:`oc-cal__month`,children:[n.map((e,t)=>(0,V.jsx)(`span`,{className:`oc-cal__wd`,children:e},t)),o.map((e,n)=>{let o=t.get(Zt(e.year,e.month,e.day))??[],s=i.getFullYear()===e.year&&i.getMonth()===e.month&&i.getDate()===e.day;return(0,V.jsxs)(`div`,{className:`oc-cal__day`+(e.inMonth?``:` oc-cal__day--out`)+(s?` oc-cal__day--today`:``),children:[(0,V.jsx)(`span`,{className:`oc-cal__daynum`,children:e.day}),o.slice(0,G).map(e=>(0,V.jsxs)(`button`,{type:`button`,className:`oc-cal__event`+(e.muted?` oc-cal__event--muted`:``)+(e.exact?` oc-cal__event--exact`:``),style:e.color?{"--cal-ev":e.color}:void 0,title:`${r.format(e.atMs)} ${e.title}`,onClick:a?()=>a(e):void 0,children:[(0,V.jsx)(`span`,{className:`oc-cal__evdot`,"aria-hidden":!0}),(0,V.jsx)(`span`,{className:`oc-cal__evtime`,children:r.format(e.atMs)}),(0,V.jsx)(`span`,{className:`oc-cal__evtitle`,children:e.title})]},e.id)),o.length>G?(0,V.jsx)(`span`,{className:`oc-cal__more`,children:m({count:o.length-G})}):null]},n)})]})}function an({year:e,byDay:t,monthShortFmt:n,now:r,onOpenMonth:i}){return(0,V.jsx)(`div`,{className:`oc-cal__year`,children:Array.from({length:12},(a,o)=>{let s=W(t,e,o),c=I(e,o);return(0,V.jsxs)(`button`,{type:`button`,className:`oc-cal__mini`,onClick:()=>i(o),children:[(0,V.jsx)(`span`,{className:`oc-cal__mininame`,children:n.format(new Date(e,o,1))}),(0,V.jsx)(`span`,{className:`oc-cal__minigrid`,"aria-hidden":!0,children:c.map((e,t)=>{let n=e.inMonth?s.get(e.day)??0:0,i=e.inMonth&&r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,V.jsx)(`span`,{className:`oc-cal__minidot`+(e.inMonth?``:` is-out`)+(n===1?` has-one`:``)+(n>1?` has-many`:``)+(i?` is-today`:``)},t)})})]},o)})})}var on={h:36e5,min:6e4,s:1e3,ms:1};function sn(e){if(e===null)return null;let t=e.trim(),n=/^every\s+(\d+(?:\.\d+)?)(h|min|s|ms)$/.exec(t);if(n!==null){let e=Number(n[1])*on[n[2]];return Number.isFinite(e)&&e>0?{kind:`every`,everyMs:e}:null}let r=/^(?:cron\s+)?([\d*,/-]+(?:\s+[\d*,/-]+){4})(?:\s*\(([^)]+)\))?$/.exec(t);if(r!==null)return{kind:`cron`,expr:r[1],tz:r[2]??null};let i=Date.parse(t);return Number.isFinite(i)?{kind:`at`,atMs:i}:null}function K(e,t,n){let r=new Set;for(let i of e.split(`,`)){let e=i,a=1,o=/^(.+)\/(\d{1,3})$/.exec(i);if(o!==null&&(e=o[1],a=Number(o[2]),a<1))return null;let s,c;if(e===`*`)s=t,c=n;else{let r=/^(\d{1,3})(?:-(\d{1,3}))?$/.exec(e);if(r===null||(s=Number(r[1]),c=r[2]===void 0?s:Number(r[2]),r[2]===void 0&&o!==null&&(c=n),s<t||c>n||s>c))return null}for(let e=s;e<=c;e+=a)r.add(e)}return r.size>0?[...r].sort((e,t)=>e-t):null}function q(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let n=K(t[0],0,59),r=K(t[1],0,23),i=K(t[2],1,31),a=K(t[3],1,12),o=K(t[4],0,7);if(!n||!r||!i||!a||!o)return null;let s=new Set(o.map(e=>e%7));return{minutes:n,hours:r,dom:new Set(i),months:new Set(a),dow:s,domRestricted:t[2]!==`*`,dowRestricted:t[4]!==`*`}}var cn=new Map;function J(e){let t=cn.get(e);if(t!==void 0)return t;let n=null;try{n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{n=null}return cn.set(e,n),n}function Y(e,t){if(t!==null){let n=J(t);if(n!==null){let t={};for(let r of n.formatToParts(e))r.type!==`literal`&&(t[r.type]=Number(r.value));return{y:t.year,mo:t.month-1,d:t.day,h:t.hour===24?0:t.hour,mi:t.minute}}}let n=new Date(e);return{y:n.getFullYear(),mo:n.getMonth(),d:n.getDate(),h:n.getHours(),mi:n.getMinutes()}}function X(e,t,n,r,i,a){if(a===null||J(a)===null)return new Date(e,t,n,r,i).getTime();let o=Date.UTC(e,t,n,r,i),s=e=>{let t=Y(e,a);return Date.UTC(t.y,t.mo,t.d,t.h,t.mi)-e},c=s(o),l=o-c,u=s(l);return u!==c&&(l=o-u),l}function Z(e,t,n,r){let i=new Map,a=(e,t)=>{e<n||e>=r||i.set(e,t||(i.get(e)??!1))};if(e?.kind===`at`)a(e.atMs,!0);else if(e?.kind===`every`){if(t!==null){let i=e.everyMs,o=Math.ceil((n-t)/i);for(let e=t+o*i,n=0;e<r&&n<400;e+=i,n++)a(e,e===t)}}else if(e?.kind===`cron`){let t=q(e.expr);if(t!==null&&t.hours.length*t.minutes.length<=400){let i=0,o=n-864e5;for(;o<r+864e5&&i<400;){let s=Y(o,e.tz);if(t.months.has(s.mo+1)){let o=new Date(Date.UTC(s.y,s.mo,s.d)).getUTCDay(),c=t.dom.has(s.d),l=t.dow.has(o);if(t.domRestricted&&t.dowRestricted?c||l:c&&l)for(let o of t.hours)for(let c of t.minutes){if(i>=400)break;let t=X(s.y,s.mo,s.d,o,c,e.tz);t>=n&&t<r&&(a(t,!1),i++)}}o=X(s.y,s.mo,s.d,12,0,e.tz)+864e5}}}return t!==null&&a(t,!0),[...i.entries()].map(([e,t])=>({atMs:e,exact:t})).sort((e,t)=>e.atMs-t.atMs).slice(0,400)}var Q=`crons`;function ln(e,t){return`${e}\u0000${t}`}function un(e,t,n){let r=[],i=new Map;for(let a of e){let{job:e}=a;if(e.id===null)continue;let o=ln(a.instanceName,e.id);i.set(o,a);let s=R(e)!==`active`,c=Z(s?null:sn(e.schedule),e.nextRunAtMs,t,n);for(let t of c)r.push({id:`${o}:${t.atMs}`,sourceId:Q,itemId:o,atMs:t.atMs,title:e.name??e.id,muted:s,exact:t.exact})}return{events:r,byItemId:i}}var $={minutes:6e4,hours:36e5,days:864e5};function dn(e){return e?.data?.code??`unknown`}function fn({status:e}){switch(Kt(e)){case`ok`:return(0,V.jsx)(N,{variant:`secondary`,children:ze()});case`error`:return(0,V.jsx)(N,{variant:`destructive`,children:Xe()});case`running`:return(0,V.jsx)(N,{variant:`outline`,children:Ge()});case`other`:return(0,V.jsx)(N,{variant:`outline`,children:e});case`none`:return(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}}function pn(){let e=_(x.scheduled.listMyCrons),t=_(x.scheduled.getCronDetail),n=_(x.scheduled.listCronRuns),a=_(x.scheduled.updateCron),l=_(x.scheduled.removeCron),ee=_(x.scheduled.runCronNow),m=kt(),ne=te(x.me.getMe,{host:It})?.timezone,[h,g]=(0,B.useState)(null),[ae,de]=(0,B.useState)(!1),[y,me]=(0,B.useState)(!1),[b,lt]=(0,B.useState)(null),[S,C]=(0,B.useState)(null),[k,A]=(0,B.useState)(null),[j,I]=(0,B.useState)(null),[Ut,Kt]=(0,B.useState)(!1),[z,H]=(0,B.useState)(Wt),[U,Zt]=(0,B.useState)(()=>new URLSearchParams(window.location.search).get(`job`)===null&&localStorage.getItem(`oc.sched.view`)===`calendar`?`calendar`:`list`),Qt=e=>{localStorage.setItem(`oc.sched.view`,e),Zt(e)},[W,$t]=(0,B.useState)(`month`),[G,rn]=(0,B.useState)(()=>{let e=new Date;return{year:e.getFullYear(),month:e.getMonth()}}),an=(0,B.useMemo)(()=>{let e=[];for(let t of h??[]){if(!t.supported||t.error!==null)continue;let n=t.kind===`openclaw`&&t.manageSupported;for(let r of t.jobs)Ht(r,z)&&e.push({instanceName:t.instanceName,canEdit:n,job:r})}return e},[h,z]),on=(0,B.useMemo)(()=>W===`year`?tn(G.year):en(G.year,G.month),[W,G]),sn=(0,B.useMemo)(()=>un(an,on.startMs,on.endMs),[an,on]),K=e=>{let t=sn.byItemId.get(e.itemId);t===void 0||!t.canEdit||t.job.id===null||pn(t.instanceName,t.job)},q=(0,B.useCallback)(async()=>{de(!0),me(!1);try{g(await e({}))}catch{me(!0)}finally{de(!1)}},[e]);(0,B.useEffect)(()=>{q()},[q]);let cn=(0,B.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),J=(0,B.useRef)(null);(0,B.useEffect)(()=>{h!==null&&J.current!==null&&J.current.scrollIntoView({block:`center`})},[h]);let Y=(0,B.useMemo)(()=>new Intl.DateTimeFormat(v(),{dateStyle:`medium`,timeStyle:`short`}),[]),X=async(e,t,n)=>{lt(e);try{await t(),m.success(n),await q()}catch(e){m.toast({variant:`error`,title:s({code:dn(e)})})}finally{lt(null)}},Z=(0,B.useRef)(0),Q=(0,B.useRef)(0),ln=async(e,t)=>{if(t.id===null)return;let r=++Z.current;A({name:t.name??t.id,entries:null});try{let i=await n({instanceName:e,jobId:t.id,limit:20});if(r!==Z.current)return;A({name:t.name??t.id,entries:i})}catch(e){if(r!==Z.current)return;A(null),m.toast({variant:`error`,title:s({code:dn(e)})})}},pn=async(e,n)=>{if(n.id===null)return;let r=++Q.current;I({instanceName:e,jobId:n.id,loading:!0,name:n.name??``,scheduleKind:`cron`,cronExpr:``,tz:``,everyValue:`1`,everyUnit:`hours`,at:``,message:``,hasMessage:!1,scheduleDirty:!1,messageDirty:!1,nameDirty:!1});try{let i=(await t({instanceName:e,jobId:n.id})).job,a=i.scheduleKind===`every`||i.scheduleKind===`at`?i.scheduleKind:`cron`,o=``;if(a===`at`&&i.scheduleExpr!==null){let e=Date.parse(i.scheduleExpr);Number.isFinite(e)&&(o=new Date(e-new Date(e).getTimezoneOffset()*6e4).toISOString().slice(0,16))}let s=`1`,c=`hours`;if(a===`every`&&i.scheduleExpr!==null){let e=Number(i.scheduleExpr);Number.isFinite(e)&&e>0&&(e%$.days===0?(s=String(e/$.days),c=`days`):e%$.hours===0?(s=String(e/$.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/$.minutes))),c=`minutes`))}if(r!==Q.current)return;I(e=>e===null||e.jobId!==n.id?e:{...e,loading:!1,name:i.name??e.name,scheduleKind:a,cronExpr:a===`cron`?i.scheduleExpr??``:``,tz:i.tz??``,everyValue:s,everyUnit:c,at:o,message:i.message??``,hasMessage:i.message!==null&&!i.messageTruncated})}catch(e){if(r!==Q.current)return;I(null),m.toast({variant:`error`,title:s({code:dn(e)})})}},mn=async()=>{if(j===null)return;let e={};if(j.nameDirty&&j.name.trim()===``||j.messageDirty&&j.hasMessage&&j.message.trim()===``){m.toast({variant:`error`,title:Ce()});return}if(j.nameDirty&&j.name.trim()!==``&&(e.name=j.name.trim()),j.scheduleDirty){if(j.scheduleKind===`cron`&&j.cronExpr.trim()!==``)e.schedule={kind:`cron`,expr:j.cronExpr.trim(),...j.tz.trim()===``?{}:{tz:j.tz.trim()}};else if(j.scheduleKind===`every`){let t=Number(j.everyValue);Number.isFinite(t)&&t>=1&&(e.schedule={kind:`every`,everyMs:Math.round(t*$[j.everyUnit])})}else if(j.scheduleKind===`at`&&j.at!==``){let t=Date.parse(j.at);Number.isFinite(t)&&(e.schedule={kind:`at`,at:new Date(t).toISOString()})}}if(j.scheduleDirty&&e.schedule===void 0){m.toast({variant:`error`,title:Le()});return}if(j.messageDirty&&j.hasMessage&&j.message.trim()!==``&&(e.message=j.message.trim()),Object.keys(e).length===0){I(null);return}let t=Q.current;Kt(!0);try{await a({instanceName:j.instanceName,jobId:j.jobId,patch:e}),m.success(oe()),t===Q.current&&I(null),await q()}catch(e){m.toast({variant:`error`,title:s({code:dn(e)})})}finally{Kt(!1)}},hn=h?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,V.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:et()}),(0,V.jsxs)(`div`,{className:`oc-sched__viewtoggle`,role:`group`,"aria-label":fe(),children:[(0,V.jsx)(M,{variant:U===`list`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":ue(),title:ue(),"aria-pressed":U===`list`,onClick:()=>Qt(`list`),children:(0,V.jsx)(ut,{})}),(0,V.jsx)(M,{variant:U===`calendar`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":p(),title:p(),"aria-pressed":U===`calendar`,onClick:()=>Qt(`calendar`),children:(0,V.jsx)(Jt,{})})]}),(0,V.jsxs)(M,{variant:`ghost`,size:`sm`,onClick:()=>void q(),disabled:ae,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,V.jsx)(vt,{size:14,"aria-hidden":!0}),Re()]})]}),h!==null&&hn>0?(0,V.jsxs)(Vt,{q:z.q,onQChange:e=>H(t=>({...t,q:e})),searchPlaceholder:Fe(),onReset:()=>H(Wt),canReset:Gt(z),children:[(0,V.jsxs)(O,{value:z.state,onValueChange:e=>H(t=>({...t,state:e})),children:[(0,V.jsx)(T,{size:`sm`,className:`w-40`,children:(0,V.jsx)(w,{})}),(0,V.jsxs)(E,{children:[(0,V.jsx)(D,{value:`all`,children:Je()}),(0,V.jsx)(D,{value:`active`,children:pe()}),(0,V.jsx)(D,{value:`paused`,children:ge()}),(0,V.jsx)(D,{value:`auto-disabled`,children:he()})]})]}),(0,V.jsxs)(O,{value:z.result,onValueChange:e=>H(t=>({...t,result:e})),children:[(0,V.jsx)(T,{size:`sm`,className:`w-40`,children:(0,V.jsx)(w,{})}),(0,V.jsxs)(E,{children:[(0,V.jsx)(D,{value:`all`,children:Ue()}),(0,V.jsx)(D,{value:`ok`,children:ze()}),(0,V.jsx)(D,{value:`error`,children:Xe()}),(0,V.jsx)(D,{value:`running`,children:Ge()}),(0,V.jsx)(D,{value:`none`,children:be()})]})]})]}):null,h===null?(0,V.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":ae,children:y?we():d()}):U===`calendar`?(0,V.jsxs)(V.Fragment,{children:[y?(0,V.jsx)(`p`,{className:`oc-admin__hint`,children:we()}):null,h.length===0?(0,V.jsx)(`p`,{className:`oc-admin__hint`,children:Ye()}):(0,V.jsx)(nn,{events:sn.events,mode:W,cursor:G,onModeChange:$t,onCursorChange:rn,onEventClick:K,footnote:f()})]}):(0,V.jsxs)(V.Fragment,{children:[y?(0,V.jsx)(`p`,{className:`oc-admin__hint`,children:we()}):null,h.length===0?(0,V.jsx)(`p`,{className:`oc-admin__hint`,children:Ye()}):null,h.map(e=>{let t=e.jobs.filter(e=>Ht(e,z)),n=Gt(z)&&e.jobs.length>0&&t.length===0;return(0,V.jsxs)(`section`,{style:{marginBottom:20},children:[h.length>1||e.error||!e.supported?(0,V.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,V.jsx)(N,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,V.jsx)(`p`,{className:`oc-admin__hint`,children:ye({code:e.error})}):e.jobs.length===0?(0,V.jsx)(`p`,{className:`oc-admin__hint`,children:Pe()}):n?(0,V.jsx)(`p`,{className:`oc-admin__hint`,children:Qe()}):(0,V.jsxs)(Bt,{children:[(0,V.jsx)(Lt,{children:(0,V.jsxs)(zt,{children:[(0,V.jsx)(P,{children:qe()}),(0,V.jsx)(P,{children:He()}),(0,V.jsx)(P,{children:Ze()}),(0,V.jsx)(P,{children:De()}),(0,V.jsx)(P,{children:r()}),(0,V.jsx)(P,{children:tt()}),(0,V.jsx)(P,{children:ce()})]})}),(0,V.jsx)(Rt,{children:t.map((t,n)=>{let r=`${e.instanceName}:${t.id??n}`,s=b===r,l=e.manageSupported,d=e.kind===`openclaw`&&l;return(0,V.jsxs)(zt,{ref:t.id!==null&&t.id===cn?J:void 0,"data-state":t.id!==null&&t.id===cn?`selected`:void 0,children:[(0,V.jsx)(F,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??ie()}),(0,V.jsx)(F,{children:(0,V.jsx)(N,{variant:`secondary`,children:t.agentId})}),(0,V.jsxs)(F,{className:`whitespace-nowrap`,children:[(0,V.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=gt(t.schedule),n=e===null?null:mt(e);return n===null?null:(0,V.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,V.jsx)(F,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:Y.format(t.nextRunAtMs)}),(0,V.jsx)(F,{children:R(t)===`auto-disabled`?(0,V.jsx)(N,{variant:`destructive`,title:`${t.autoDisabledReason??``}${t.autoDisabledAtMs===null?``:` · ${Y.format(t.autoDisabledAtMs)}`}`,children:he()}):R(t)===`active`?(0,V.jsx)(N,{variant:`secondary`,children:pe()}):R(t)===`paused`?(0,V.jsx)(N,{variant:`outline`,children:ge()}):(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,V.jsxs)(F,{children:[(0,V.jsx)(fn,{status:t.lastRunStatus}),t.lastDelivered===!1?(0,V.jsx)(N,{variant:`destructive`,title:t.lastDeliveryError??i(),children:Te()}):null]}),(0,V.jsx)(F,{className:`whitespace-nowrap`,children:t.id===null?(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):s?(0,V.jsx)(dt,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,V.jsxs)(`span`,{className:`oc-cronactions`,children:[d?(0,V.jsx)(M,{variant:`ghost`,size:`icon-sm`,title:re(),"aria-label":re(),disabled:b!==null,onClick:()=>void X(r,async()=>{let n=await ee({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},se()),children:(0,V.jsx)(ht,{size:14,"aria-hidden":!0})}):null,d&&t.enabled!==null?(0,V.jsx)(M,{variant:`ghost`,size:`icon-sm`,title:L(t)===`pause`?c():u(),"aria-label":L(t)===`pause`?c():u(),disabled:b!==null,onClick:()=>void X(r,()=>a({instanceName:e.instanceName,jobId:t.id,patch:{enabled:L(t)===`resume`}}),L(t)===`pause`?ot():Se()),children:L(t)===`pause`?(0,V.jsx)(ft,{size:14,"aria-hidden":!0}):(0,V.jsx)(pt,{size:14,"aria-hidden":!0})}):null,d?(0,V.jsx)(M,{variant:`ghost`,size:`icon-sm`,title:it(),"aria-label":it(),disabled:b!==null,onClick:()=>void pn(e.instanceName,t),children:(0,V.jsx)(_t,{size:14,"aria-hidden":!0})}):null,d?(0,V.jsx)(M,{variant:`ghost`,size:`icon-sm`,title:o(),"aria-label":o(),disabled:b!==null,onClick:()=>void ln(e.instanceName,t),children:(0,V.jsx)(Yt,{size:14,"aria-hidden":!0})}):null,l?(0,V.jsx)(M,{variant:`ghost`,size:`icon-sm`,title:le(),"aria-label":le(),disabled:b!==null,onClick:()=>C({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,V.jsx)(yt,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,V.jsx)(`p`,{className:`oc-admin__hint`,children:We()})]},e.instanceName)}),hn>0?(0,V.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:Ve()}):null]}),(0,V.jsx)(Dt,{open:S!==null,onOpenChange:e=>{e||C(null)},children:(0,V.jsxs)(St,{children:[(0,V.jsxs)(Et,{children:[(0,V.jsx)(xt,{children:rt()}),(0,V.jsx)(bt,{children:ve({name:S?.name??``})})]}),(0,V.jsxs)(wt,{children:[(0,V.jsx)(Tt,{children:je()}),(0,V.jsx)(Ct,{onClick:()=>{let e=S;C(null),e!==null&&X(`${e.instanceName}:${e.jobId}`,()=>l({instanceName:e.instanceName,jobId:e.jobId}),ct())},children:Ne()})]})]})}),(0,V.jsx)(Ft,{open:k!==null,onOpenChange:e=>{e||(Z.current++,A(null))},children:(0,V.jsxs)(Mt,{style:{maxWidth:640},children:[(0,V.jsx)(At,{children:(0,V.jsx)(Nt,{children:at({name:k?.name??``})})}),k?.entries===null?(0,V.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):k!==null&&k.entries.length===0?(0,V.jsx)(`p`,{className:`oc-admin__hint`,children:xe()}):k===null?null:(0,V.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:k.entries.map((e,t)=>(0,V.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,V.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[(0,V.jsx)(fn,{status:e.status}),(0,V.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?Y.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,V.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,V.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,V.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error}),e.delivered===!1?(0,V.jsxs)(`div`,{className:`oc-cronpanel__run-undelivered`,children:[ke({channel:e.deliveryChannel??`—`}),e.deliveryError===null?null:(0,V.jsx)(`span`,{className:`oc-cronpanel__plain`,children:e.deliveryError})]}):null]},t))})]})}),(0,V.jsx)(Ft,{open:j!==null,onOpenChange:e=>{e||(Q.current++,I(null))},children:(0,V.jsxs)(Mt,{className:`oc-cronedit`,children:[(0,V.jsxs)(At,{children:[(0,V.jsx)(Nt,{children:st()}),(0,V.jsx)(Pt,{children:nt()})]}),j===null?null:j.loading?(0,V.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,V.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,V.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:qe()}),(0,V.jsx)(Ot,{value:j.name,maxLength:200,onChange:e=>I({...j,name:e.target.value,nameDirty:!0})})]}),(0,V.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,V.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:_e()}),(0,V.jsxs)(O,{value:j.scheduleKind,onValueChange:e=>I({...j,scheduleKind:e,scheduleDirty:!0}),children:[(0,V.jsx)(T,{children:(0,V.jsx)(w,{})}),(0,V.jsxs)(E,{children:[(0,V.jsx)(D,{value:`cron`,children:Ae()}),(0,V.jsx)(D,{value:`every`,children:Me()}),(0,V.jsx)(D,{value:`at`,children:Be()})]})]}),j.scheduleKind===`cron`?(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,V.jsx)(Ot,{value:j.cronExpr,onChange:e=>I({...j,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,V.jsx)(qt,{value:j.tz,onChange:e=>I({...j,tz:e,scheduleDirty:!0}),fallbackTz:ne??void 0})]}):j.scheduleKind===`every`?(0,V.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,V.jsx)(Ot,{type:`number`,min:1,value:j.everyValue,onChange:e=>I({...j,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,V.jsxs)(O,{value:j.everyUnit,onValueChange:e=>I({...j,everyUnit:e,scheduleDirty:!0}),children:[(0,V.jsx)(T,{style:{maxWidth:160},children:(0,V.jsx)(w,{})}),(0,V.jsxs)(E,{children:[(0,V.jsx)(D,{value:`minutes`,children:Ke()}),(0,V.jsx)(D,{value:`hours`,children:Oe()}),(0,V.jsx)(D,{value:`days`,children:Ee()})]})]})]}):(0,V.jsx)(Xt,{value:j.at,onChange:e=>I({...j,at:e,scheduleDirty:!0})})]}),j.hasMessage?(0,V.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,V.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Ie()}),(0,V.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:j.message,onChange:e=>I({...j,message:e.target.value,messageDirty:!0})})]}):null]}),(0,V.jsxs)(jt,{children:[(0,V.jsx)(M,{variant:`ghost`,onClick:()=>I(null),children:je()}),(0,V.jsxs)(M,{onClick:()=>void mn(),disabled:j===null||j.loading||Ut,children:[Ut?(0,V.jsx)(dt,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,$e()]})]})]})})]})}export{pn as ScheduledTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$W as r,AG as i,AW as a,BG as ee,BW as o,CG as te,CW as s,DG as ne,DW as c,EG as re,EW as l,FG as ie,FW as ae,FZ as u,GW as d,HG as oe,HW as f,IG as se,IW as p,IZ as m,JW as ce,KW as h,LG as le,LW as g,MG as ue,MW as _,NG as de,NW as v,NZ as fe,OG as pe,OW as y,PG as me,PW as b,QW as he,RG as x,RW as S,SG as ge,TG as _e,TW as ve,UG as ye,UW as be,VG as xe,VW as C,WW as w,XW as Se,YW as Ce,ZW as we,_G as Te,aG as Ee,bG as De,cG as Oe,dG as ke,eG as Ae,fG as je,gG as Me,hG as Ne,iG as Pe,jG as Fe,jW as T,kG as Ie,kW as E,lG as Le,mG as Re,nG as ze,oG as Be,pG as Ve,qW as He,rG as Ue,sG as We,t as D,tG as Ge,uG as Ke,vG as qe,wG as Je,wW as O,xG as Ye,yG as Xe,zG as Ze,zW as k}from"./api-DNOgniXv.js";import{n as Qe,t as $e}from"./useNavigate-D3GIoxyW.js";import{t as A}from"./check-ByAmVIRT.js";import{r as et}from"./dist-vqdeesMI.js";import{t as tt}from"./chevron-right-9DjIYDNR.js";import{t as j}from"./copy-uA2kyeTq.js";import{a as M,i as N,n as P,r as F,t as I}from"./select-CYo6IZR2.js";import{t as L}from"./button-2XjWVeWK.js";import{t as R}from"./input-BOl1ZpD6.js";import"./convexApi-4XI9Ua6G.js";import{r as nt}from"./toast-DN6P_at0.js";import{t as z}from"./badge-D7TV9F5d.js";import{n as B,t as V}from"./format-Dmvblmga.js";import{a as H,i as U,n as W,o as G,r as K,t as q}from"./dialog-Cw-buQuR.js";import{n as rt}from"./ConfirmDialog-DUn2vS3y.js";import{t as it}from"./EntitySheet-BHlTwSgy.js";import{t as at}from"./FilterBar-1CED41DE.js";import{t as ot}from"./DataTableShell-DlkJe0in.js";import{t as st}from"./roleDescriptions-DIDUvLuU.js";var J=t(e(),1),Y=n(),ct=[{value:`never`,label:()=>E(),days:null},{value:`30`,label:()=>y(),days:30},{value:`90`,label:()=>c(),days:90}],X=720*60*60*1e3,Z=`__all__`,Q={name:``,roleKey:``,description:``};function $(){let e=Qe({from:`/settings/serviceAccounts`}),t=$e({from:`/settings/serviceAccounts`}),n=e.q??``,a=e.status??Z,[o,s]=(0,J.useState)(Z),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,status:e===Z?void 0:e})}),ae=m(D.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===Z?void 0:o,disabled:a===Z?void 0:a===`disabled`}}),d=m(D.apiKeys.listKeys,{}),f=m(D.apiKeys.listRoles,{}),p=u(D.apiKeys.createServiceAccount),h=u(D.apiKeys.updateServiceAccount),g=u(D.apiKeys.deleteServiceAccount),_=fe(D.apiKeys.mintApiKey),v=u(D.apiKeys.revokeApiKey),y=rt(),b=nt(),S=n!==``||o!==Z||a!==Z;function ve(){s(Z),t({search:{},replace:!0})}let[be,C]=(0,J.useState)(!1),[w,T]=(0,J.useState)(Q),[E,O]=(0,J.useState)(null),[k,A]=(0,J.useState)(new Set),[j,B]=(0,J.useState)(null),V=(0,J.useRef)(!1),[H,U]=(0,J.useState)(new Set),[W,G]=(0,J.useState)({}),[K,q]=(0,J.useState)(null),X=(0,J.useMemo)(()=>{let e=new Map;for(let t of d??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[d]);function $(e){A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{E?(await h({serviceAccountId:E,name:w.name,roleKey:w.roleKey,description:w.description}),b.success(We())):await p({name:w.name,roleKey:w.roleKey,description:w.description||void 0}),T(Q),O(null),C(!1)}catch(e){b.error(E?Oe():Le(),e)}}function ft(e){T({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),C(!0)}async function pt(e){if(V.current)return;V.current=!0;let t=W[e._id]??`never`,n=ct.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;B(e._id);try{let t=await _({serviceAccountId:e._id,expiresAt:r});q({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){b.error(Be(),e)}finally{V.current=!1,B(null)}}async function mt(e){if(await y({title:Ee(),description:(0,Y.jsxs)(Y.Fragment,{children:[Pe(),` `,(0,Y.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Ue(),` `,(0,Y.jsx)(`strong`,{children:ze()}),` `,Ge()]}),confirmWord:e.name,confirmLabel:Ae(),destructive:!0}))try{await g({serviceAccountId:e._id}),b.success(r(),e.name)}catch(e){b.error(he(),e)}}async function ht(e){if(await y({title:we(),description:(0,Y.jsxs)(Y.Fragment,{children:[Se(),` `,(0,Y.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Ce()]}),confirmLabel:ce(),destructive:!0})&&!H.has(e._id)){U(t=>new Set(t).add(e._id));try{await v({keyId:e._id})}catch(e){b.error(He(),e)}finally{U(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ye()}),(0,Y.jsxs)(at,{q:n,onQChange:c,searchPlaceholder:oe(),onReset:ve,canReset:S,children:[(0,Y.jsxs)(I,{value:o,onValueChange:s,children:[(0,Y.jsx)(N,{size:`sm`,className:`w-40`,children:(0,Y.jsx)(M,{placeholder:xe()})}),(0,Y.jsxs)(P,{children:[(0,Y.jsx)(F,{value:Z,children:ee()}),(f??[]).map(e=>(0,Y.jsx)(F,{value:e.key,children:e.key},e._id))]})]}),(0,Y.jsxs)(I,{value:a,onValueChange:l,children:[(0,Y.jsx)(N,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(M,{})}),(0,Y.jsxs)(P,{children:[(0,Y.jsx)(F,{value:Z,children:Ze()}),(0,Y.jsx)(F,{value:`active`,children:x()}),(0,Y.jsx)(F,{value:`disabled`,children:le()})]})]})]}),(0,Y.jsx)(ot,{title:se(),rows:ae,addLabel:ie(),onAdd:()=>{T(Q),O(null),C(!0)},emptyHint:me(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,Y.jsx)(lt,{account:e,keys:X.get(e._id)??[],onRevoke:ht,revoking:H}),rowActions:e=>[...(e.managedBy??null)===null?[{label:i(),onSelect:()=>ft(e)},{label:de(),onSelect:()=>void pt(e)}]:[],{label:k.has(e._id)?ue():Fe(),onSelect:()=>$(e._id)},...(e.managedBy??null)===null?[{label:Ie(),variant:`destructive`,onSelect:()=>void mt(e)}]:[]],columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(L,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?pe():ne(),onClick:()=>$(e._id),children:k.has(e._id)?(0,Y.jsx)(et,{}):(0,Y.jsx)(tt,{})})},{header:re(),sort:e=>e.name,cell:e=>(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{children:e.name}),e.description?(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:_e(),sort:e=>e.roleKey,cell:e=>(0,Y.jsx)(z,{variant:`secondary`,children:e.roleKey})},{header:Je(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,Y.jsx)(z,{variant:`destructive`,children:le()}):(0,Y.jsx)(z,{variant:`outline`,children:x()})},{header:te(),cell:e=>(0,Y.jsxs)(I,{value:W[e._id]??`never`,onValueChange:t=>G(n=>({...n,[e._id]:t})),children:[(0,Y.jsx)(N,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(M,{})}),(0,Y.jsx)(P,{children:ct.map(e=>(0,Y.jsx)(F,{value:e.value,children:e.label()},e.value))})]})},{header:ge(),sort:e=>(X.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(X.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,Y.jsx)(`span`,{className:`oc-sa__keycount`,children:j===e._id?Ye():De({count:t})})}}]}),(0,Y.jsx)(it,{open:be,onOpenChange:e=>{C(e),e||O(null)},title:E?Xe():Me(),description:E?qe():Ne(),canSubmit:!!(w.name&&w.roleKey),onSubmit:dt,submitLabel:E?Te():Re(),children:(0,Y.jsxs)(`div`,{className:`oc-form`,children:[(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:Ve()}),(0,Y.jsx)(R,{value:w.name,onChange:e=>T({...w,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:je()}),(0,Y.jsxs)(I,{value:w.roleKey||void 0,onValueChange:e=>T({...w,roleKey:e}),children:[(0,Y.jsx)(N,{className:`w-full`,children:(0,Y.jsx)(M,{placeholder:ke()})}),(0,Y.jsx)(P,{children:(f??[]).map(e=>(0,Y.jsxs)(F,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(f??[]).find(e=>e.key===w.roleKey),t=e?st(e):null;return t?(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:Ke()}),(0,Y.jsx)(R,{value:w.description,onChange:e=>T({...w,description:e.target.value})})]})]})}),(0,Y.jsx)(ut,{minted:K,onClose:()=>q(null)})]})}function lt({account:e,keys:t,onRevoke:n,revoking:r}){return(0,Y.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,Y.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[h(),` `,(0,Y.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):(0,Y.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{children:w()}),(0,Y.jsx)(`th`,{children:be()}),(0,Y.jsx)(`th`,{children:f()}),(0,Y.jsx)(`th`,{children:C()}),(0,Y.jsx)(`th`,{children:o()}),(0,Y.jsx)(`th`,{children:k()}),(0,Y.jsx)(`th`,{})]})}),(0,Y.jsx)(`tbody`,{children:t.map(t=>(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:(0,Y.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,Y.jsx)(`td`,{children:(0,Y.jsx)(z,{variant:`secondary`,children:e.roleKey})}),(0,Y.jsx)(`td`,{children:B(t.createdAt)}),(0,Y.jsx)(`td`,{className:dt(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,Y.jsx)(`td`,{children:pt(t.expiresAt)}),(0,Y.jsx)(`td`,{children:mt(t)}),(0,Y.jsx)(`td`,{className:`text-right`,children:!t.disabled&&(e.managedBy??null)===null?(0,Y.jsx)(L,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?S():g()}):null})]},t._id))})]})]})}function ut({minted:e,onClose:t}){let[n,r]=(0,J.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,Y.jsx)(q,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,Y.jsxs)(W,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,Y.jsxs)(H,{children:[(0,Y.jsx)(G,{children:p()}),(0,Y.jsx)(K,{children:ae({name:e.accountName})})]}),(0,Y.jsx)(`div`,{className:`oc-sa__minted-warning`,children:b()}),(0,Y.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Y.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,Y.jsxs)(L,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":v(),children:[n?(0,Y.jsx)(A,{}):(0,Y.jsx)(j,{}),n?_():T()]})]}),(0,Y.jsx)(U,{children:(0,Y.jsx)(L,{onClick:()=>{r(!1),t()},children:a()})})]}):null})}function dt(e){return e!==null&&Date.now()-e>X}function ft(e){return e===null?l():B(e)}function pt(e){return e===null?`—`:V(e)}function mt(e){return e.disabled?(0,Y.jsx)(z,{variant:`destructive`,children:ve()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,Y.jsx)(z,{variant:`outline`,children:O()}):(0,Y.jsx)(z,{variant:`outline`,children:s()})}export{$ as ServiceAccountsTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ah as r,Bh as i,Ch as a,Dh as o,Eh as s,FZ as c,Fh as l,Gh as u,Hh as d,IZ as f,Ih as p,Lh as m,Mh as h,Nh as g,Oh as _,Ph as v,Rh as y,Sh as b,Th as x,Uh as S,Vh as C,Wh as w,_h as T,bh as E,ch as D,dh as O,fh as k,gh as A,hh as j,jh as M,kh as N,lh as P,mh as F,ph as I,sh as ee,t as L,uh as R,vh as z,wh as B,xh as V,yh as H,zh as U}from"./api-DNOgniXv.js";import{t as W}from"./button-2XjWVeWK.js";import"./convexApi-4XI9Ua6G.js";import{n as G}from"./format-Dmvblmga.js";import{n as K}from"./ConfirmDialog-DUn2vS3y.js";import{t as q}from"./DataTableShell-DlkJe0in.js";var J=t(e(),1),Y=n(),X={hung:()=>_(),wrong_result:()=>o(),error:()=>s(),other:()=>x()},Z=e=>(e&&X[e]?.())??e??`—`;function Q(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function $({data:e}){let t=e.snapshot,n=c(L.subAgentReports.respondToReport),[r,i]=(0,J.useState)(e.thread),[o,s]=(0,J.useState)(``),[l,u]=(0,J.useState)(!1);async function d(){let t=o.trim();if(!(!t||l)){u(!0);try{await n({reportId:e._id,text:t}),i(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),s(``)}finally{u(!1)}}}return(0,Y.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,Y.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Z(e.category),` · `,B({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:a()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:b()}),r.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:r.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?V():E()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:H()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:z(),value:o,maxLength:2e3,rows:3,onChange:e=>s(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void d(),disabled:!o.trim()||l,children:l?A():T()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[j({count:t.children.length}),t.childrenTruncated?` ${F()}`:``,t.textTruncated?` ${I()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${k()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:O()}),(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:R()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function te(){let e=f(L.subAgentReports.listForAdmin,{}),t=c(L.subAgentReports.readReport),n=c(L.subAgentReports.deleteReport),a=K(),[o,s]=(0,J.useState)(null),[_,b]=(0,J.useState)({});async function x(e){if(o===e._id){s(null);return}if(!_[e._id]){let n=await t({reportId:e._id});b(t=>({...t,[e._id]:n}))}s(e._id)}async function T(e){await a({title:P(),description:D(),confirmLabel:ee(),destructive:!0})&&(await n({reportId:e._id}),o===e._id&&s(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[S(),` `,(0,Y.jsx)(`strong`,{children:d()}),` `,C()]}),(0,Y.jsx)(q,{title:u(),rows:e,emptyHint:w(),isExpanded:e=>o===e._id&&!!_[e._id],renderExpanded:e=>_[e._id]?(0,Y.jsx)($,{data:_[e._id]}):null,columns:[{header:i(),cell:e=>G(e.at),sort:e=>e.at},{header:U(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:y(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:m(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${v({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:p(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:l(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:g()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:h()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:o===e._id?r():M(),onSelect:()=>void x(e)},{label:N(),onSelect:()=>void T(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$K as r,AK as i,Aq as a,BK as o,Bq as s,CZ as c,Cq as l,Dq as u,Eq as d,FK as f,FZ as p,Fq as m,GK as h,Gq as g,HK as ee,Hq as _,IK as v,IZ as y,Iq as te,JK as ne,Jq as re,KK as ie,Kq as ae,LK as oe,Lq as se,MK as ce,Mq as le,NK as ue,NZ as de,Nq as fe,Oq as pe,PK as b,Pq as me,QK as he,Qq as ge,RK as _e,Rq as ve,SZ as ye,Sq as be,Tq as xe,UK as Se,Uq as Ce,VK as we,Vq as Te,WK as Ee,Wq as De,XK as x,Xq as Oe,YK as ke,Yq as Ae,ZK as je,Zq as Me,_q as Ne,ah as S,aq as Pe,bq as Fe,cq as Ie,dq as Le,eq as Re,fq as ze,gq as Be,hq as C,ih as Ve,iq as He,jK as Ue,jq as We,kq as Ge,lq as Ke,mq as qe,nq as Je,oh as w,oq as Ye,pq as Xe,qK as Ze,qq as Qe,r as $e,rh as et,rq as tt,sq as nt,t as T,tq as rt,uq as it,vq as at,wZ as ot,wq as st,xq as ct,yq as lt,zK as ut,zq as dt}from"./api-DNOgniXv.js";import{t as E}from"./check-ByAmVIRT.js";import{c as ft,g as D,i as pt,n as mt,r as O,s as k,t as ht}from"./dropdown-menu-BaUA_yBi.js";import{t as gt}from"./download-7V52FIS0.js";import{t as A}from"./checkbox-kFoJxcMJ.js";import{i as j,n as _t,r as vt}from"./useChart-CvUnULHg.js";import{t as M}from"./x-xmpoCnTJ.js";import{a as N,i as P,n as F,r as I,t as L}from"./select-CYo6IZR2.js";import{t as R}from"./button-2XjWVeWK.js";import{t as z}from"./input-BOl1ZpD6.js";import"./convexApi-4XI9Ua6G.js";import{t as B}from"./badge-D7TV9F5d.js";import{t as V}from"./appHost-CH3EGcJw.js";import{t as yt}from"./localePickerView-C2RmOS86.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-CB4fBpkx.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-C6NnEhxy.js";import{t as kt}from"./TimeRangePicker-DGRmfXqe.js";import{t as At}from"./FilterBar-1CED41DE.js";import{t as jt}from"./AdvancedFilter-D14bDnZM.js";var G=t(e(),1),Mt=.1,Nt=[248,248,248],Pt=[24,24,24];function Ft(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function It(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function K(e,t,n){return It(e,t,n)>=Mt}function Lt(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function Rt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var zt=12*1024*1024,Bt=480,Vt=160,Ht=.92;async function Ut(e,t={}){if(!e.type.startsWith(`image/`))throw Error(r());if(e.size>zt)throw Error(he());let{source:n,width:i,height:a,cleanup:o}=await Wt(e);try{let r=e.type===`image/svg+xml`,o=Math.min(Bt/i,Vt/a,r?1/0:1),s=Math.max(1,Math.round(i*o)),c=Math.max(1,Math.round(a*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(x());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Ft(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(x());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);K(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=K(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await J(f,`image/webp`,Ht)??await J(f,`image/png`);if(!h)throw Error(ke());return{blob:h,hasAlpha:m}}finally{o()}}async function Wt(e){if(e.type===`image/svg+xml`)return q(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return q(e)}async function q(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(je())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function J(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var Y=n();function Gt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var X=`__all__`,Z={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,Y.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?ot():e===`dark`?c():ye()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,Y.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,Y.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,Y.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:$e(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,Y.jsx)(E,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,Y.jsx)(Yt,{tokens:r,mode:i}):(0,Y.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,Y.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,Y.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,Y.jsx)(R,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":w(),title:w(),children:(0,Y.jsx)(gt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=y(T.charts.listMyCharts),r=p(T.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:De()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Ce()})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,Y.jsx)(Xt,{selected:e===null,title:_(),subtitle:Te(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?s():n.via===`owner`?dt():ve({group:n.via.group});return(0,Y.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:se()}):null]})}function Qt(){let e=p(T.charts.importChart),[t,n]=(0,G.useState)(``),[r,i]=(0,G.useState)(``),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(!1),[u,d]=(0,G.useState)(!1);async function f(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{let e=await t.text();i(e)}catch{o(C())}}}async function m(){if(o(null),c(!1),t.trim()===``){o(Xe());return}let a;try{a=JSON.parse(r)}catch{o(C());return}d(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{d(!1)}}return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:l()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:be()})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:ct()}),(0,Y.jsx)(z,{value:t,onChange:e=>n(e.target.value),placeholder:Fe(),maxLength:60})]}),(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:lt()}),(0,Y.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:at(),rows:8,spellCheck:!1})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(R,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Y.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Y.jsx)(j,{className:`size-4`}),Ne(),(0,Y.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void f(e)})]})}),(0,Y.jsx)(R,{size:`sm`,disabled:u,onClick:()=>void m(),children:Be()})]}),a?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,Y.jsx)(`p`,{className:`oc-chart-import__ok`,children:qe()}):null]})]})}function $t({chart:e}){let t=de(T.charts.setChartLogo),n=p(T.charts.removeChartLogo),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ut(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Ye():Pe()}),(0,Y.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,Y.jsx)(`img`,{src:t,alt:``}):null}),(0,Y.jsx)(R,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Y.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Y.jsx)(j,{className:`size-4`}),t?tt():He(),(0,Y.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,Y.jsx)(R,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:rt()}):null,t?(0,Y.jsx)(R,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Je()}):null]})}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:nt()}),(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,Y.jsx)(f,{mode:`light`}),(0,Y.jsx)(f,{mode:`dark`})]}),r?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:Re()}):null,a?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=y(T.me.getMe,{host:V}),n=p(T.charts.addChartDomain),r=p(T.charts.removeChartDomain),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ne()}),(0,Y.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,Y.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:Ee()}):u.map(e=>(0,Y.jsxs)(B,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,Y.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Se({domain:e}),onClick:()=>void f(e),children:(0,Y.jsx)(M,{className:`size-3`})})]},e))}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(z,{value:i,onChange:e=>a(e.target.value),placeholder:ie(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,Y.jsx)(R,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:h()})]}),(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:Ze()}),o?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function tn({chart:e}){let t=p(T.charts.updateChart),n=p(T.charts.deleteChart),[r,i]=(0,G.useState)(!1),[a,s]=(0,G.useState)(e.name),[c,l]=(0,G.useState)(()=>$(e.tokens)),[u,d]=(0,G.useState)(e.tokens.bpm??0),[f,m]=(0,G.useState)(null),[h,g]=(0,G.useState)(!1);function _(){s(e.name),l($(e.tokens)),d(e.tokens.bpm??0),m(null),i(!0)}async function v(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(c)}catch{m(C());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){m(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(_e()))try{await n({chartId:e.chartId})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(R,{variant:`outline`,size:`sm`,onClick:_,children:Ke()}),(0,Y.jsx)(R,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:Ie()})]})})]}),r?(0,Y.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:o()}),(0,Y.jsx)(z,{value:a,onChange:e=>s(e.target.value),maxLength:60})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:S()}),(0,Y.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,Y.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>d(Number(e.target.value)),"aria-label":S()}),(0,Y.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?Ve():`${u} BPM`})]}),(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:et()})]}),(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:ut()}),(0,Y.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),f?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(R,{size:`sm`,disabled:h,onClick:()=>void v(),children:ee()}),(0,Y.jsx)(R,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:we()})]})]}):null,(0,Y.jsx)($t,{chart:e}),(0,Y.jsx)(en,{chart:e})]})}function nn(){let e=y(T.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:ze()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Le()})]}),e!==void 0&&t.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:it()}):(0,Y.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,Y.jsx)(tn,{chart:e},e.key))})]})}function rn({chart:e,groups:t}){let n=p(T.charts.addChartToGroupPool),r=p(T.charts.removeChartFromGroupPool),i=e.restrictedToGroups,o=e.poolGroups,s=new Set((o??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function f(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Y.jsx)(B,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?Ge():e.kind===`custom`&&e.scope===`personal`?b():a()}),e.isGlobalDefault?(0,Y.jsx)(B,{variant:`default`,children:pe()}):null]}),(0,Y.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:d()}),(o??[]).map(e=>(0,Y.jsxs)(B,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,Y.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":st({group:e.name}),onClick:()=>void f(e.groupId),children:(0,Y.jsx)(M,{className:`size-3`})})]},e.groupId)),c.length>0?(0,Y.jsxs)(L,{value:``,onValueChange:e=>void l(e),children:[(0,Y.jsx)(P,{size:`sm`,className:`w-56`,children:(0,Y.jsx)(N,{placeholder:xe()})}),(0,Y.jsx)(F,{children:c.map(e=>(0,Y.jsx)(I,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:u()}):null]})]})}function an({chart:e}){let t=p(T.charts.promoteChartToCommon),n=p(T.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(_e()))try{await n({chartId:e.chartId})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Y.jsx)(B,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?ue():b()}),e.ownerLabel?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:f({owner:e.ownerLabel})}):null]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,Y.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:ce()}):null,(0,Y.jsx)(R,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Ue()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=p(T.admin.setDefaultThemeMode),a=p(T.admin.setDefaultLocale),o=p(T.charts.setDefaultChart),s=y(T.charts.listChartsAdmin),c=y(T.groups.listGroups,{}),l=e??`system`,u=t??`fr`;return(0,Y.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:ae()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:g()})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:te()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:m()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(R,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:_()}),vt.map(e=>(0,Y.jsx)(R,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,Y.jsx)(R,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key))]})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:me()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:fe()})]}),(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,Y.jsx)(rn,{chart:e,groups:c??[]},e.key))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:le()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:We()})]}),(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,Y.jsx)(en,{chart:e})]},e.key))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:oe()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:v()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:i()}):(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,Y.jsx)(an,{chart:e},e.key))})})()]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:ge()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Me()})]}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,Y.jsx)(R,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:Oe()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,Y.jsx)(R,{variant:u===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:re()})]})]})}function sn(){let e=y(T.me.getMe,{host:V}),t=_t(e?.resolvedThemeMode);return(0,Y.jsxs)(`div`,{className:`oc-appearance`,children:[(0,Y.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,Y.jsx)(Qt,{}),(0,Y.jsx)(nn,{}),e?.role===`admin`?(0,Y.jsx)(on,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function cn(){let[e,t]=(0,G.useState)(!0),[n,r]=(0,G.useState)(`per-user`),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(X),[c,l]=(0,G.useState)(X),[u,d]=(0,G.useState)(Z),f=i!==``||o!==X||c!==X;function p(){a(``),s(X),l(X),d(Z)}return(0,Y.jsxs)(`div`,{className:`oc-show`,children:[(0,Y.jsx)(sn,{}),(0,Y.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,Y.jsx)(`summary`,{className:`oc-show__title`,children:Qe()}),(0,Y.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(R,{children:`Default`}),(0,Y.jsx)(R,{variant:`secondary`,children:`Secondary`}),(0,Y.jsx)(R,{variant:`outline`,children:`Outline`}),(0,Y.jsx)(R,{variant:`ghost`,children:`Ghost`}),(0,Y.jsx)(R,{variant:`destructive`,children:`Destructive`}),(0,Y.jsx)(R,{variant:`link`,children:`Link`})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(R,{size:`sm`,children:`Small`}),(0,Y.jsx)(R,{children:`Default`}),(0,Y.jsx)(R,{size:`lg`,children:`Large`}),(0,Y.jsx)(R,{size:`icon`,"aria-label":`more`,children:(0,Y.jsx)(D,{})}),(0,Y.jsx)(R,{disabled:!0,children:`Disabled`})]})]}),(0,Y.jsx)(Q,{title:`Badges`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(B,{children:`Default`}),(0,Y.jsx)(B,{variant:`secondary`,children:`Secondary`}),(0,Y.jsx)(B,{variant:`outline`,children:`Outline`}),(0,Y.jsx)(B,{variant:`destructive`,children:`Destructive`})]})}),(0,Y.jsx)(Q,{title:`Inputs & selection`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsx)(z,{placeholder:`Text input…`}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsxs)(L,{value:n,onValueChange:r,children:[(0,Y.jsx)(P,{className:`w-56`,children:(0,Y.jsx)(N,{placeholder:`Select…`})}),(0,Y.jsxs)(F,{children:[(0,Y.jsx)(I,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,Y.jsx)(I,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,Y.jsxs)(`label`,{className:`oc-show__check`,children:[(0,Y.jsx)(A,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,Y.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsxs)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,Y.jsxs)(L,{value:o,onValueChange:s,children:[(0,Y.jsx)(P,{size:`sm`,children:(0,Y.jsx)(N,{})}),(0,Y.jsxs)(F,{children:[(0,Y.jsx)(I,{value:X,children:`Toutes directions`}),(0,Y.jsx)(I,{value:`inbound`,children:`inbound`}),(0,Y.jsx)(I,{value:`outbound`,children:`outbound`}),(0,Y.jsx)(I,{value:`internal`,children:`internal`})]})]}),(0,Y.jsxs)(L,{value:c,onValueChange:l,children:[(0,Y.jsx)(P,{size:`sm`,children:(0,Y.jsx)(N,{})}),(0,Y.jsxs)(F,{children:[(0,Y.jsx)(I,{value:X,children:`Toutes sévérités`}),(0,Y.jsx)(I,{value:`info`,children:`info`}),(0,Y.jsx)(I,{value:`warn`,children:`warn`}),(0,Y.jsx)(I,{value:`critical`,children:`critical`})]})]})]}),(0,Y.jsx)(jt,{fields:Kt,onChange:()=>{}}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,Y.jsx)(kt,{value:u,onChange:d})]})]})}),(0,Y.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,Y.jsxs)(ht,{children:[(0,Y.jsx)(ft,{asChild:!0,children:(0,Y.jsx)(R,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,Y.jsx)(D,{})})}),(0,Y.jsxs)(mt,{align:`start`,children:[(0,Y.jsx)(pt,{children:`Actions`}),(0,Y.jsx)(k,{}),(0,Y.jsx)(O,{children:`Edit`}),(0,Y.jsx)(O,{children:`Duplicate`}),(0,Y.jsx)(k,{}),(0,Y.jsx)(O,{variant:`destructive`,children:`Delete`})]})]})}),(0,Y.jsx)(Q,{title:`Card`,children:(0,Y.jsxs)(Tt,{className:`w-80`,children:[(0,Y.jsxs)(bt,{children:[(0,Y.jsx)(Ct,{children:`Instance`}),(0,Y.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,Y.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,Y.jsxs)(xt,{className:`gap-2`,children:[(0,Y.jsx)(R,{size:`sm`,children:`Save`}),(0,Y.jsx)(R,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,Y.jsx)(Q,{title:`Table`,children:(0,Y.jsxs)(Ot,{children:[(0,Y.jsx)(Et,{children:(0,Y.jsxs)(U,{children:[(0,Y.jsx)(H,{className:`w-8`,children:(0,Y.jsx)(A,{"aria-label":`select all`})}),(0,Y.jsx)(H,{children:`Name`}),(0,Y.jsx)(H,{children:`Mode`}),(0,Y.jsx)(H,{className:`text-right`,children:`Status`}),(0,Y.jsx)(H,{className:`w-8`})]})}),(0,Y.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,Y.jsxs)(U,{children:[(0,Y.jsx)(W,{children:(0,Y.jsx)(A,{"aria-label":`select ${e.n}`})}),(0,Y.jsx)(W,{className:`font-medium`,children:e.n}),(0,Y.jsx)(W,{children:(0,Y.jsx)(B,{variant:`secondary`,children:e.m})}),(0,Y.jsx)(W,{className:`text-right`,children:(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,Y.jsx)(E,{className:`size-3.5`}),` `,e.s]})}),(0,Y.jsx)(W,{children:(0,Y.jsx)(R,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,Y.jsx)(D,{})})})]},e.n))})]})}),(0,Y.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,Y.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,Y.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,Y.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,Y.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,Y.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,Y.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,Y.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,Y.jsx)(`span`,{className:`oc-run-status__dot`}),(0,Y.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{cn as ThemeShowroom};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ak as r,Bf as i,Ck as a,Dk as o,Ek as s,Fk as c,Hf as l,If as u,Lf as d,Mk as f,Nk as p,Ok as m,Pk as h,Rf as g,Tk as _,Vf as v,jk as y,kk as b,wk as x,zf as S}from"./api-DNOgniXv.js";import{n as C,t as w}from"./search-CU2PGfXc.js";import{i as T,n as E,r as D,t as O}from"./dist-BuPfsZqj.js";import{t as k}from"./button-2XjWVeWK.js";import{t as A}from"./input-BOl1ZpD6.js";import{n as j}from"./format-Dmvblmga.js";var M=t(e(),1),N={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function P(e,t){let n=e.trim();if(n===`now`)return t;let r=/^now-(\d+)([smhdw])$/.exec(n);if(r===null)return null;let i=Number(r[1]),a=N[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function F(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:P(e.from,t)??t-N.h,to:P(e.to,t)??t}}var I=[{label:c(),from:`now-5m`},{label:h(),from:`now-15m`},{label:p(),from:`now-30m`},{label:f(),from:`now-1h`},{label:y(),from:`now-3h`},{label:r(),from:`now-6h`},{label:b(),from:`now-12h`},{label:m(),from:`now-24h`},{label:o(),from:`now-2d`},{label:s(),from:`now-7d`},{label:_(),from:`now-30d`},{label:x(),from:`now-90d`},{label:a(),from:`now-520w`}];function L(e){return j(e,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function R(e){if(e.kind===`relative`){let t=I.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${L(e.from)} → ${L(e.to)}`}function z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function B(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function V(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var H=n();function U(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=F(e);return e.kind===`absolute`?{from:t,to:n}:{from:W(t),to:W(n)}},[e,t])}function W(e){return Math.floor(e/6e4)*6e4}function G({value:e,onChange:t}){let[n,r]=(0,M.useState)(!1),[a,o]=(0,M.useState)(``),s=F(e),[c,f]=(0,M.useState)(()=>z(s.from)),[p,m]=(0,M.useState)(()=>z(s.to));function h(t){if(t){let t=F(e);f(z(t.from)),m(z(t.to)),o(``)}r(t)}function _(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function y(){let e=B(c),n=B(p);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let b=(0,M.useMemo)(()=>{let e=a.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[a]),x=B(c)!==null&&B(p)!==null;return(0,H.jsxs)(D,{open:n,onOpenChange:h,children:[(0,H.jsx)(T,{asChild:!0,children:(0,H.jsxs)(k,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(C,{}),R(e)]})}),(0,H.jsx)(E,{children:(0,H.jsx)(O,{align:`end`,sideOffset:6,className:`oc-timerange__panel oc-overlay-layer rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:l()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:v()}),(0,H.jsx)(A,{type:`datetime-local`,value:c,onChange:e=>f(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:i()}),(0,H.jsx)(A,{type:`datetime-local`,value:p,onChange:e=>m(e.target.value)})]}),(0,H.jsx)(k,{size:`sm`,className:`oc-timerange__apply`,disabled:!x,onClick:y,children:S()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(w,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(A,{value:a,onChange:e=>o(e.target.value),placeholder:g(),"aria-label":d()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:b.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:u()}):b.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>_(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$J as r,QJ as i,ZJ as a,eY as o}from"./api-DNOgniXv.js";import{t as s}from"./check-ByAmVIRT.js";import{t as c}from"./chevrons-up-down-C45M3ZYP.js";import{n as l,r as u,t as d}from"./popover-BHbAt2S-.js";import{t as f}from"./input-BOl1ZpD6.js";/* empty css */var p=t(e(),1);function m(e){if(e==null||e===``)return`none`;let t=e.trim().toLowerCase();return t===`ok`||t===`success`||t===`completed`?`ok`:t===`error`||t===`failed`||t===`failure`?`error`:t===`running`||t===`in_progress`||t===`pending`?`running`:`other`}function h(e){return e===!0?`active`:e===!1?`paused`:`unknown`}function g(e){return typeof e.autoDisabledReason==`string`&&e.autoDisabledReason!==``?`auto-disabled`:h(e.enabled)}function _(e){return g(e)===`active`?`pause`:`resume`}var v={q:``,state:`all`,result:`all`};function y(e){return e.q.trim()!==``||e.state!==`all`||e.result!==`all`}function b(e,t){let n=t.q.trim().toLowerCase();return!(n!==``&&!`${e.name??``} ${e.agentId}`.toLowerCase().includes(n)||t.state!==`all`&&g(e)!==t.state||t.result!==`all`&&m(e.lastRunStatus)!==t.result)}function x(){try{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):[]}catch{return[]}}function S(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function C(e,t,n=50,r){let i=e=>e.toLowerCase().replace(/[_/]+/g,` `),a=i(t.trim()),o=(a===``?e:e.filter(e=>i(e).includes(a))).slice(0,n);return r&&r!==``&&!o.includes(r)?[r,...o].slice(0,n):o}function w(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=[];for(let e=0;e<42;e++){let n=new Date(r.getFullYear(),r.getMonth(),r.getDate()+e);i.push({year:n.getFullYear(),month:n.getMonth(),day:n.getDate(),inMonth:n.getMonth()===t})}return i}function T(e,t,n,r,i){let a=(e,t=2)=>String(e).padStart(t,`0`);return`${a(e,4)}-${a(t+1)}-${a(n)}T${a(r)}:${a(i)}`}function E(e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(e);if(t===null)return null;let[,n,r,i,a,o]=t;return{year:Number(n),month:Number(r)-1,day:Number(i),hour:Number(a),minute:Number(o)}}var D=n();function O({value:e,onChange:t,className:n,fallbackTz:m}){let h=(0,p.useMemo)(()=>x(),[]),[g,_]=(0,p.useState)(!1),[v,y]=(0,p.useState)(``);if(h.length===0)return(0,D.jsx)(f,{value:e,onChange:e=>t(e.target.value),placeholder:m||S()||`America/Toronto`,className:n});let b=C(h,v,h.length,e||void 0),w=e===``?m||S()||a():e;return(0,D.jsxs)(d,{modal:!0,open:g,onOpenChange:e=>{_(e),e||y(``)},children:[(0,D.jsx)(u,{asChild:!0,children:(0,D.jsxs)(`button`,{type:`button`,className:`oc-tzcombo__trigger${n?` ${n}`:``}`,"aria-label":o(),children:[(0,D.jsx)(`span`,{className:`oc-tzcombo__value`,children:w}),(0,D.jsx)(c,{size:14,"aria-hidden":!0,className:`oc-tzcombo__chev`})]})}),(0,D.jsxs)(l,{align:`start`,className:`oc-tzcombo__pop p-0`,children:[(0,D.jsx)(f,{autoFocus:!0,value:v,onChange:e=>y(e.target.value),placeholder:r(),className:`oc-tzcombo__search`}),(0,D.jsx)(`div`,{className:`oc-tzcombo__list`,role:`listbox`,children:b.length===0?(0,D.jsx)(`p`,{className:`oc-tzcombo__empty`,children:i()}):b.map(n=>(0,D.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===e,className:`oc-tzcombo__opt`,onClick:()=>{t(n),_(!1),y(``)},children:[(0,D.jsx)(s,{size:13,"aria-hidden":!0,className:`oc-tzcombo__check`,style:{opacity:+(n===e)}}),(0,D.jsx)(`span`,{children:n})]},n))})]})]})}export{b as a,w as c,_ as i,E as l,v as n,g as o,y as r,m as s,O as t,T as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$z as r,AB as i,AM as a,BM as o,CB as s,CM as c,DB as l,DM as u,E as d,EB as f,EM as p,FB as m,FM as h,FZ as g,GM as _,HM as v,IM as y,IZ as b,Jz as x,Kz as ee,LM as te,MB as ne,MM as re,Md as S,NB as C,NM as ie,Nd as ae,OB as w,OM as oe,PB as T,PM as se,Qz as E,RM as ce,SB as D,SM as le,TB as ue,TM as de,UM as fe,VM as pe,WM as me,Xz as he,Yz as O,Zz as k,_B as A,_M as ge,aB as _e,bB as j,bM as ve,cM as M,dB as ye,dM as be,eB as xe,fB as N,fM as Se,gB as Ce,gM as we,hB as Te,hM as Ee,iB as De,jB as P,jM as Oe,jd as F,kB as ke,kM as Ae,lM as je,mB as Me,mM as Ne,nB as Pe,oB as Fe,pB as Ie,pM as Le,qz as Re,rB as ze,t as I,tB as Be,uM as Ve,vB as He,vM as Ue,wB as We,wM as Ge,xB as Ke,xM as qe,yB as Je,yM as Ye,zM as Xe}from"./api-DNOgniXv.js";import{n as Ze,t as Qe}from"./useNavigate-D3GIoxyW.js";import{t as $e}from"./check-ByAmVIRT.js";import{t as et}from"./copy-uA2kyeTq.js";import{n as tt,t as nt}from"./eye-Dj_nvUMH.js";import{o as rt,r as it}from"./deliveryRecorder-D2L37goZ.js";import{t as at}from"./x-xmpoCnTJ.js";import{a as L,i as R,n as z,r as B,t as V}from"./select-CYo6IZR2.js";import{i as H,n as U,r as ot,t as st}from"./tabs-DiirWTCN.js";import{t as W}from"./button-2XjWVeWK.js";import"./convexApi-4XI9Ua6G.js";import{t as G}from"./badge-D7TV9F5d.js";import{a as ct,n as K}from"./format-Dmvblmga.js";import{a as lt,n as ut,o as dt,r as ft,t as pt}from"./dialog-Cw-buQuR.js";import{c as mt,o as ht,s as gt,u as _t}from"./searchSchemas-Dm-Qg010.js";import{t as vt}from"./appHost-CH3EGcJw.js";import{n as yt}from"./TimeRangePicker-DGRmfXqe.js";import{t as bt}from"./FilterBar-1CED41DE.js";import{t as xt}from"./AdvancedFilter-D14bDnZM.js";import{t as St}from"./DataTableShell-DlkJe0in.js";var Ct=d(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?Ce():n===`agent`?`${Te()} - ${r}`:e}function Tt(){let e=b(I.me.getMe,{host:vt})?.role===`admin`,t=b(I.deliveryTiming.getDeliveryStatus,{}),n=g(I.deliveryTiming.startDeliveryRecord),r=g(I.deliveryTiming.stopDeliveryRecord),[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(!1),u=t?.recording??!1,d=async()=>{c(!0);try{u?await r({}):await n({})}finally{c(!1)}};return(0,J.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:m()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:T()})]}),e?(0,J.jsx)(W,{variant:u?`destructive`:`default`,size:`sm`,disabled:s||t===void 0,onClick:()=>void d(),children:u?ne():C()}):null]}),u?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(G,{variant:`secondary`,children:P()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:i({time:ct(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>o(e=>!e),children:a?l():w()})}),a?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=b(I.deliveryTiming.listDeliverySessions,{}),n=g(I.deliveryTiming.deleteDeliverySessions),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(`all`),[c,l]=(0,q.useState)(Y),[u,d]=(0,q.useState)(null),{from:p,to:m}=yt(c),h=c.to===`now`?1/0:m,_=r.trim()!==``||a!==`all`||c!==Y,v=()=>{i(``),o(`all`),l(Y)},y=(0,q.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(a===`all`||(a===`active`?t.active:!t.active))&&t.startedAt>=p&&t.startedAt<=h).map(e=>({...e,_id:e.sessionId}))},[t,r,a,p,h]),x=e=>{let t=new Set((y??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),u!==null&&r.includes(u)&&d(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(bt,{q:r,onQChange:i,searchPlaceholder:ue(),timeRange:c,onTimeRangeChange:l,onReset:v,canReset:_,children:(0,J.jsxs)(V,{value:a,onValueChange:e=>o(e),children:[(0,J.jsx)(R,{size:`sm`,className:`w-36`,children:(0,J.jsx)(L,{})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:`all`,children:We()}),(0,J.jsx)(B,{value:`active`,children:s()}),(0,J.jsx)(B,{value:`stopped`,children:D()})]})]})}),(0,J.jsx)(St,{title:f(),rows:y,emptyHint:Re(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(W,{variant:`ghost`,size:`icon`,"aria-label":u===e.sessionId?Ie():Me(),onClick:()=>d(t=>t===e.sessionId?null:e.sessionId),children:u===e.sessionId?(0,J.jsx)(tt,{size:15,"aria-hidden":!0}):(0,J.jsx)(nt,{size:15,"aria-hidden":!0})})},{header:Ke(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:K(e.startedAt)})},{header:j(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,J.jsx)(`span`,{className:`tabular-nums`,children:K(e.stoppedAt)})},{header:Je(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:He(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:A(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(G,{variant:`secondary`,children:s()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:D()})}],rowActions:e?e=>[{label:N(),variant:`destructive`,onSelect:()=>x([e.sessionId])}]:void 0,bulkActions:e?[{label:N(),variant:`destructive`,onSelect:e=>x(e)}]:void 0,isExpanded:e=>e.sessionId===u,renderExpanded:e=>(0,J.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=b(I.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(it(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ye()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ke()});let i=e.segments,a=(e,t)=>(0,J.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,J.jsx)(`td`,{className:`py-1`,children:e}),(0,J.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,J.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,ee()]}),(0,J.jsxs)(W,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)($e,{size:13,"aria-hidden":!0}):(0,J.jsx)(et,{size:13,"aria-hidden":!0}),t?x():O()]})]}),(0,J.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,J.jsx)(`th`,{className:`py-1 font-medium`,children:De()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:ze()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Pe()})]})}),(0,J.jsxs)(`tbody`,{children:[a(Be(),i.bridge),a(xe(),i.A),a(r(),i.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:E()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:he()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:k()})]})}var kt=[50,100,200,500],Z=`all`,Q=`__all__`,At=[`2xx`,`4xx`,`5xx`],jt=[`user`,`service`,`system`],Mt=[`inbound`,`outbound`,`internal`],Nt={kind:`relative`,from:`now-30d`,to:`now`},Pt=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:ae()},{value:`principalType`,label:S()},{value:`direction`,label:`direction`},{value:`roleKey`,label:F()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=Ze({from:`/settings/traces`}),t=Qe({from:`/settings/traces`}),n=e.limit,r=e.kind,i=e.statusClass??Q,s=e.principalType??Q,l=e.direction??Q,d=e.roleKey??Q,f=e.q??``,m=e.correlationId,g=ht(e.from,e.to),x=(0,q.useMemo)(()=>_t(e.adv),[e.adv]),{from:ee,to:ne}=yt(g),[S,C]=(0,q.useState)(null),[ae,w]=(0,q.useState)(null),T=e=>void t({search:t=>({...t,limit:e})}),E=e=>void t({search:t=>({...t,kind:e})}),D=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ue=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),he=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),O=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),A=e=>void t({search:t=>({...t,...mt(e)})}),j=e=>void t({search:t=>({...t,adv:gt(e)}),replace:!0}),M=b(I.observability.listEvents,{limit:n}),ye=b(I.observability.listEvents,{limit:n,kind:r===Z?void 0:r,...m?{correlationId:m}:{},filter:{q:f||void 0,from:ee,to:ne,statusClass:i===Q?void 0:i,principalType:s===Q?void 0:s,direction:l===Q?void 0:l,roleKey:d===Q?void 0:d,advanced:x.length>0?x:void 0}}),xe=(0,q.useMemo)(()=>{let e=new Set;for(let t of M??[])e.add(t.kind);return[...e].sort()},[M]),N=(0,q.useMemo)(()=>{let e=new Set;for(let t of M??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[M]),Ce=f!==``||i!==Q||s!==Q||l!==Q||d!==Q||x.length>0||g.kind!==`relative`||g.from!==Nt.from;function Te(){t({search:{limit:100,kind:`all`},replace:!0})}let De=S?M?.filter(e=>e.correlationId===S):ye,P=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)(st,{value:P,onValueChange:e=>F(e),children:[(0,J.jsxs)(ot,{className:`w-full`,children:[(0,J.jsxs)(H,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(rt,{size:13,"aria-hidden":!0}),Fe()]}),(0,J.jsxs)(H,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),_e()]})]}),(0,J.jsx)(U,{value:`latency`,children:(0,J.jsx)(Tt,{})}),(0,J.jsxs)(U,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[_(),(0,J.jsx)(`strong`,{children:me()}),fe(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:v()})]}),(0,J.jsxs)(bt,{q:f,onQChange:D,searchPlaceholder:pe(),timeRange:g,onTimeRangeChange:A,onReset:Te,canReset:Ce,children:[(0,J.jsxs)(V,{value:i,onValueChange:ue,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:o()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:Xe()}),At.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:s,onValueChange:he,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:ce()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:te()}),jt.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:l,onValueChange:O,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:y()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:h()}),Mt.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:d,onValueChange:k,children:[(0,J.jsx)(R,{size:`sm`,className:`w-36`,children:(0,J.jsx)(L,{placeholder:se()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:ie()}),N.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsx)(`input`,{list:`oc-trace-kinds`,className:`oc-input oc-input--sm w-44`,value:r===Z?``:r,placeholder:re(),"aria-label":re(),onChange:e=>{let t=e.target.value.trim();E(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:xe.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(V,{value:String(n),onValueChange:e=>T(Number(e)),children:[(0,J.jsx)(R,{size:`sm`,className:`w-28`,children:(0,J.jsx)(L,{})}),(0,J.jsx)(z,{children:kt.map(e=>(0,J.jsx)(B,{value:String(e),children:Oe({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:x,onChange:j}),S?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>C(null),title:a(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[Ae(),(0,J.jsx)(`code`,{children:$(S)})]}),(0,J.jsx)(at,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:oe()})]})}):null,(0,J.jsx)(St,{title:u(),rows:De,emptyHint:S?p():de(),columns:[{header:Ge(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:K(e.at)})},{header:c(),sort:e=>e.kind,cell:e=>(0,J.jsx)(G,{variant:`secondary`,children:e.kind})},{header:le(),sort:e=>Lt(e)??null,cell:e=>{let t=Lt(e);return t?(0,J.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,J.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":qe(),children:`✓`})}},{header:ve(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(G,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Ye(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(G,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:Ue(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(G,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ge(),sort:e=>e.route,cell:e=>e.route?(0,J.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,J.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:we(),sort:e=>e.status,cell:e=>e.status===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsx)(`span`,{className:`oc-traces__status ${It(e.status)}`,children:e.status})},{header:Ee(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:Ne(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:Le(),onClick:()=>C(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Se(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>w(e),children:be()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:ae,onClose:()=>w(null)})]})]})}function It(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Lt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function Rt({row:e,onClose:t}){let n=(0,q.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,J.jsx)(pt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(ut,{className:`max-w-lg`,children:[(0,J.jsxs)(lt,{children:[(0,J.jsxs)(dt,{className:`oc-traces__meta-title`,children:[Ve(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(G,{variant:`outline`,children:je()})]}),(0,J.jsx)(ft,{children:M()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{Ft as TracesTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{CD as r,E as i,FZ as a,IZ as o,OZ as s,SD as c,_D as l,aD as u,cD as d,dD as f,fD as p,gD as m,hD as h,iD as g,lD as _,mD as v,oD as y,pD as b,rD as x,sD as S,sM as C,t as w,uD as T,vD as E,yD as D}from"./api-DNOgniXv.js";import{t as O}from"./use_paginated_query-CrHKVq5I.js";import{t as k}from"./trash-2-BmifkPwA.js";import{t as A}from"./button-2XjWVeWK.js";import"./convexApi-4XI9Ua6G.js";import{r as j}from"./toast-DN6P_at0.js";import{n as M}from"./format-Dmvblmga.js";import{n as N}from"./ConfirmDialog-DUn2vS3y.js";import{r as P}from"./fileMetaView-Ci5C4w9Q.js";import{r as F}from"./trashView-Cd0pvgnM.js";import{n as I,t as L}from"./trashPage-DsBekB4q.js";var R=i(`scan-search`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]),z=t(e(),1);function B(e,t){let n=e.find(e=>e.status===`running`&&!e.stale)??null,r=e.find(e=>e.mode===`dryRun`&&e.status===`done`)??null,i=e.find(e=>e.mode===`apply`&&(e.status===`done`||e.status===`refused`)&&(r===null||e.startedAt>r.startedAt))??null,a=null;return n===null?r===null||i!==null?a=`no_report`:r.applicableUntil===null||r.applicableUntil<=t?a=`expired`:r.mirrorMissing>0?a=`mirror`:r.orphans.count===0&&(a=`nothing`):a=`running`,{running:n,report:r,lastApply:i,applyBlock:a}}var V=n();function H(){let e=o(w.blobSweep.listBlobSweeps,{}),t=o(w.blobQuarantine.quarantineSettings,{}),n=a(w.blobSweep.startBlobSweep),r=N(),{toast:i}=j(),[c,O]=(0,z.useState)(!1),F=s(),I=e=>P(e,F),L=B(e??[],Date.now()),H=L.report,U=async e=>{O(!0);try{await e()}catch(e){i({title:x(),description:e.message,variant:`error`})}finally{O(!1)}},W=()=>U(()=>n({mode:`dryRun`})),G=async()=>{H!==null&&await r({title:S({count:H.orphans.count}),description:y({size:I(H.orphans.bytes)}),confirmLabel:d(),destructive:!0})&&await U(()=>n({mode:`apply`,confirms:H._id}))};return(0,V.jsxs)(`section`,{className:`oc-trash__body`,"aria-labelledby":`oc-blobsweep-title`,children:[(0,V.jsxs)(`div`,{className:`oc-trash__head`,children:[(0,V.jsx)(`h3`,{id:`oc-blobsweep-title`,className:`oc-trash__heading`,children:D()}),(0,V.jsxs)(`div`,{className:`oc-trash__actions`,children:[(0,V.jsxs)(A,{variant:`outline`,size:`sm`,disabled:c||L.running!==null,onClick:()=>void W(),children:[(0,V.jsx)(R,{}),` `,l()]}),(0,V.jsxs)(A,{variant:`ghost`,size:`sm`,className:`text-destructive`,disabled:c||L.applyBlock!==null,onClick:()=>void G(),children:[(0,V.jsx)(k,{}),` `,d()]})]})]}),(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:E({days:H?.minAgeDays??7,quarantine:t?.days??7})}),e===void 0?(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:C()}):null,L.running===null?null:(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:m({scanned:L.running.blobsScanned})}),e!==void 0&&H===null&&L.running===null?(0,V.jsx)(`p`,{className:`oc-trash__empty`,children:h()}):null,H===null?null:(0,V.jsxs)(`div`,{className:`oc-trash__hint`,children:[(0,V.jsx)(`p`,{children:v({date:M(H.finishedAt??H.startedAt),count:H.orphans.count,size:I(H.orphans.bytes),scanned:H.blobsScanned})}),(0,V.jsxs)(`ul`,{children:[(0,V.jsx)(`li`,{children:b({count:H.byOrigin.upload?.count??0,size:I(H.byOrigin.upload?.bytes??0)})}),(0,V.jsx)(`li`,{children:p({count:H.byOrigin.unregistered?.count??0,size:I(H.byOrigin.unregistered?.bytes??0)})})]}),H.importing>0?(0,V.jsx)(`p`,{children:f({count:H.importing})}):null,H.mirrorMissing>0?(0,V.jsx)(`p`,{className:`text-destructive`,children:T({count:H.mirrorMissing})}):null,L.applyBlock===`expired`?(0,V.jsx)(`p`,{children:_()}):null]}),L.lastApply===null?null:(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:L.lastApply.status===`refused`?g({date:M(L.lastApply.finishedAt??L.lastApply.startedAt)}):u({date:M(L.lastApply.finishedAt??L.lastApply.startedAt),count:L.lastApply.deleted.count,size:I(L.lastApply.deleted.bytes)})})]})}function U(){let{results:e,status:t,loadMore:n}=O(w.trash.adminListTrash,{},{initialNumItems:50}),i=F(),o=a(w.trash.adminRestoreChat),s=a(w.trash.adminPurgeChat);return(0,V.jsxs)(`div`,{className:`oc-trash__body`,children:[(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:r({days:i})}),t===`LoadingFirstPage`?(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:C()}):e.length===0?(0,V.jsx)(`p`,{className:`oc-trash__empty`,children:c()}):(0,V.jsx)(L,{items:e,onRestore:e=>o({chatId:e}),onPurge:e=>s({chatId:e})}),(0,V.jsx)(I,{status:t,loadMore:n}),(0,V.jsx)(H,{})]})}export{U as TrashTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AL as r,BL as i,CL as a,Cj as o,DL as s,Dj as c,EL as l,Ej as u,FL as d,FZ as f,HL as p,IL as ee,IZ as m,Ix as h,LL as te,Lx as g,ML as ne,NL as re,OL as _,Oj as v,PL as ie,RL as ae,Rx as y,SL as oe,Sj as b,TL as se,Tj as x,UL as S,VL as C,XI as ce,_L as le,_j as w,bL as T,bj as E,gL as ue,hL as de,jL as fe,kL as pe,kj as D,t as O,vL as me,vj as k,wL as he,wj as A,xL as ge,xj as j,yL as _e,yj as M,zL as ve}from"./api-DNOgniXv.js";import{n as ye,t as be}from"./useNavigate-D3GIoxyW.js";import{c as N,i as P,n as F,r as xe,t as Se}from"./dropdown-menu-BaUA_yBi.js";import{t as I}from"./checkbox-kFoJxcMJ.js";import{t as L}from"./server-BJJ3cVit.js";import{t as R}from"./star-DBwak3-9.js";import{a as z,i as B,n as V,r as H,t as U}from"./select-CYo6IZR2.js";import{t as W}from"./button-2XjWVeWK.js";import"./convexApi-4XI9Ua6G.js";import{r as G}from"./toast-DN6P_at0.js";import{t as K}from"./badge-D7TV9F5d.js";import{a as Ce,n as we,o as Te,r as Ee,t as De}from"./dialog-Cw-buQuR.js";import{t as Oe}from"./appHost-CH3EGcJw.js";import{n as ke,r as Ae}from"./ConfirmDialog-DUn2vS3y.js";import{a as q}from"./groupManageView-B0Fd_T1s.js";import{a as je,o as J,t as Y}from"./AdminSettings-RN5-vhFB.js";import{t as Me}from"./FilterBar-1CED41DE.js";import{t as Ne}from"./DataTableShell-DlkJe0in.js";import{t as Pe}from"./DetailChips-CYx7WQ4_.js";var X=t(e(),1),Z=n();function Fe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=m(O.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=m(O.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,l=s?`${s.instanceName}/${s.agentId}`:null,d=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),f=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!d.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],p=new Map;for(let e of f){let t=p.get(e.instanceName)??[];t.push(e),p.set(e.instanceName,t)}return(0,Z.jsx)(De,{open:n,onOpenChange:r,children:(0,Z.jsxs)(we,{className:`oc-access`,children:[(0,Z.jsxs)(Ce,{children:[(0,Z.jsx)(Te,{children:D({user:t})}),(0,Z.jsx)(Ee,{children:v()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?c():u()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:x()}):f.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:b()}):[...p.entries()].map(([t,n])=>(0,Z.jsx)(Ie,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:l},t))})]})})}function Ie({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let s=f(O.agents.assignAgent),c=f(O.agents.removeAgent),l=f(O.agents.setDefaultAgent),u=G();if(!e)return null;async function d(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await s({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(A(),q(e))}}async function p(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(o(),q(e))}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(L,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,Z.jsx)(I,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void d(e.agentId,r),"aria-label":j({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:E()}):null,e.outOfPool?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:M()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":k(),title:k(),children:(0,Z.jsx)(R,{size:14,fill:`currentColor`})}):(0,Z.jsx)(W,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":w(),title:w(),disabled:c,onClick:()=>void p(e.agentId),children:(0,Z.jsx)(R,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return h();case`user`:return g();case`admin`:return y();default:return e}}function Le({granted:e,onToggle:t}){let n=new Set(e),r=Y.filter(e=>n.has(J[e])).length;return(0,Z.jsxs)(Se,{children:[(0,Z.jsx)(N,{asChild:!0,children:(0,Z.jsx)(W,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?S():p({count:r})})}),(0,Z.jsxs)(F,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(P,{children:C()}),Y.map(e=>{let r=J[e];return(0,Z.jsxs)(xe,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(I,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:je[e]()})]},e)})]})]})}function Re(){let e=ye({from:`/settings/users`}),t=be({from:`/settings/users`}),n=e.q??``,o=e.role??Q,c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),u=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),p=m(O.admin.listUsers,{filter:{q:n||void 0,role:o===Q?void 0:o},withAgents:!0}),h=m(O.me.getMe,{host:Oe}),g=f(O.admin.setRole),v=f(O.admin.setUserPermissions),y=f(O.admin.startImpersonation),b=f(O.admin.deleteUser),x=f(O.admin.setUserName),S=ke(),C=Ae(),w=G(),[E,D]=(0,X.useState)(null),k=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of p??[])e.add(t.role);return[...e]},[p]),A=n!==``||o!==Q;function j(){t({search:{},replace:!0})}async function M(e){try{await g(e)}catch(e){w.error(i(),e)}}async function N(e){try{await v(e)}catch(e){w.error(ve(),e)}}async function P(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await S({title:ne(),description:fe({user:t}),confirmWord:r(),confirmLabel:pe(),destructive:!0}))try{await b({profileId:e._id}),w.success(s({user:t}))}catch(e){w.error(_(),e)}}async function F(e){let t=e.email||e.name||e.userId.slice(0,8),n=await C({title:se(),label:he({user:t}),placeholder:a(),defaultValue:e.name??``,confirmLabel:ce()});if(n!==null)try{await x({profileId:e._id,name:n}),w.success(oe())}catch(e){w.error(ge(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Me,{q:n,onQChange:c,searchPlaceholder:ae(),onReset:j,canReset:A,children:(0,Z.jsxs)(U,{value:o,onValueChange:u,children:[(0,Z.jsx)(B,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:Q,children:te()}),k.map(e=>(0,Z.jsx)(H,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Ne,{title:ee(),rows:p,emptyHint:d(),rowActions:e=>{let t=[{label:de(),onSelect:()=>D({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:l(),onSelect:()=>void F(e)}];return e.userId!==h?.userId&&t.push({label:ie(),onSelect:()=>void y({profileId:e._id})},{label:re(),variant:`destructive`,onSelect:()=>void P(e)}),t},columns:[{header:T(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{children:t}),n?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:_e(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(U,{value:e.role,onValueChange:t=>void M({profileId:e._id,role:t}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(H,{value:`user`,children:$(`user`)}),(0,Z.jsx)(H,{value:`admin`,children:$(`admin`)})]})]})},{header:me(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:le()}):(0,Z.jsx)(Le,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),N({profileId:e._id,permissions:[...n]})}})},{header:ue(),cell:e=>(0,Z.jsx)(Pe,{icon:(0,Z.jsx)(L,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Fe,{profileId:E?.profileId??null,userLabel:E?.label??``,open:E!==null,onOpenChange:e=>{e||D(null)}})]})}export{Re as UsersTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Al as r,Au as i,Bu as a,Cl as o,Dl as s,Du as c,EZ as l,El as u,FZ as d,Fu as ee,Gu as f,Hu as p,IZ as m,Iu as te,Ju as h,Ku as g,Lu as ne,Mu as _,NZ as re,Nu as v,OZ as y,Ol as b,Ou as x,Pu as S,Rl as ie,Ru as C,Sl as ae,Uu as w,Uy as T,Vu as oe,Wu as se,Xu as ce,Yu as le,Zu as ue,_l as de,bl as fe,bv as pe,gl as me,hl as he,ju as ge,kl as E,ku as D,qR as O,qu as k,rl as A,t as j,vl as M,vv as N,xl as P,zu as F}from"./api-DNOgniXv.js";import{n as I,t as L}from"./useNavigate-D3GIoxyW.js";import{a as _e,c as R,d as ve,f as ye,i as be,l as z,m as xe,o as Se,p as Ce,r as we}from"./speech-DCWd2QRW.js";import{t as B}from"./checkbox-kFoJxcMJ.js";import{a as V,i as H,n as U,r as W,t as G}from"./select-CYo6IZR2.js";import{i as K,n as q,r as Te,t as Ee}from"./tabs-DiirWTCN.js";import{t as J}from"./button-2XjWVeWK.js";import"./convexApi-4XI9Ua6G.js";import{t as Y}from"./badge-D7TV9F5d.js";import{t as X}from"./appHost-CH3EGcJw.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>se()],[`fr-FR`,()=>r()],[`en-US`,()=>E()],[`en-GB`,()=>b()],[`de-DE`,()=>s()],[`es-ES`,()=>u()]],Oe=[[`0.75`,()=>p()],[`1`,()=>oe()],[`1.25`,()=>a()],[`1.5`,()=>F()]],$=0;function ke({instance:e}){let t=d(j.admin.upsertInstanceConfig),n=e.config??{},r={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[i,a]=(0,Z.useState)(r),[o,s]=(0,Z.useState)(`idle`),[c,l]=(0,Z.useState)(!1),[u,p]=(0,Z.useState)(!1),m=re(j.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{a({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),s(`idle`)},[e._id]);let h=i.enabled!==r.enabled||i.engine!==r.engine||i.lang!==r.lang||i.rate!==r.rate||i.autoRead!==r.autoRead;async function _(){s(`saving`);try{let n={...e.config??{}};n.voiceEnabled=i.enabled,i.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,i.lang===`auto`?delete n.voiceLang:n.voiceLang=i.lang;let r=Number.parseFloat(i.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,i.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),s(`idle`)}catch{s(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(Y,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(B,{checked:i.enabled,onCheckedChange:e=>a({...i,enabled:e===!0}),"aria-label":g()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:g()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:M()}),(0,Q.jsxs)(G,{value:i.engine,onValueChange:e=>a({...i,engine:e}),disabled:!i.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":M(),children:(0,Q.jsx)(V,{})}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(W,{value:`browser`,children:de()}),e.kind===`hermes`?null:(0,Q.jsx)(W,{value:`gateway`,children:me()})]})]})]}),i.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:he()}):null,i.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:f()}),(0,Q.jsxs)(G,{value:i.lang,onValueChange:e=>a({...i,lang:e}),disabled:!i.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":f(),children:(0,Q.jsx)(V,{})}),(0,Q.jsx)(U,{children:De.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:w()}),(0,Q.jsxs)(G,{value:i.rate,onValueChange:e=>a({...i,rate:e}),disabled:!i.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":w(),children:(0,Q.jsx)(V,{})}),(0,Q.jsx)(U,{children:Oe.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),i.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(B,{checked:i.autoRead,onCheckedChange:e=>a({...i,autoRead:e===!0}),disabled:!i.enabled,"aria-label":C()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:C()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ne()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(J,{size:`sm`,disabled:!h||o===`saving`,onClick:()=>void _(),children:o===`saving`?T():pe()}),(0,Q.jsx)(J,{variant:`outline`,size:`sm`,disabled:!i.enabled||c,onClick:()=>{let t=Number.parseFloat(i.rate)||1,n=++$;if(p(!1),z(),R(),i.engine!==`gateway`){Se(S(),{lang:_e(i.lang,y()),rate:t});return}l(!0),m({instanceName:e.name,text:S()}).then(({mime:e,audioBase64:r})=>{n===$&&be(r,e,{rate:t})}).catch(()=>{n===$&&p(!0)}).finally(()=>l(!1))},children:c?T():te()}),(0,Q.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>{$++,l(!1),z(),R()},children:ee()})]}),o===`error`||u?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:u?A():N()}):null]})}function Ae({stt:e}){let t=m(j.me.getMe,{host:X}),n=d(j.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:_()}),(0,Q.jsx)(Y,{variant:e?`secondary`:`outline`,children:e?x():c()}),(0,Q.jsx)(Y,{variant:r?`secondary`:`destructive`,children:r?ae():P()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(B,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":o()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:o()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ge()})]})}function je(){let e=m(j.admin.listInstances,{}),t=(0,Z.useMemo)(()=>ve(),[]),n=(0,Z.useMemo)(()=>we(),[]),{section:r}=I({from:`/settings/voice`}),a=L({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ue()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(Y,{variant:t?`secondary`:`destructive`,children:t?ce():le()}),(0,Q.jsx)(Y,{variant:n?`secondary`:`destructive`,children:n?h():k()})]}),(0,Q.jsxs)(Ee,{value:r,onValueChange:e=>void a({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(Te,{className:`w-full`,children:[(0,Q.jsxs)(K,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ye,{size:13,"aria-hidden":!0}),fe()]}),(0,Q.jsxs)(K,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ce,{size:13,"aria-hidden":!0}),_()]}),(0,Q.jsxs)(K,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(xe,{size:13,"aria-hidden":!0}),i()]})]}),(0,Q.jsx)(q,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(q,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(q,{value:`talk`,children:[(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsx)(`header`,{className:`oc-voice__cardhead`,children:(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:i()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:D()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=d(j.admin.upsertInstanceConfig),n=e.config??{},r=n.talkEnabled===!0,i=e.kind===`hermes`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(Y,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ie()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(B,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":O()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()})]})]})}export{je as VoiceTab};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{C as r,T as i,h as a,r as o,v as s}from"./api-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{C as r,T as i,h as a,r as o,v as s}from"./api-DNOgniXv.js";import{a as c,c as l,i as u,l as d,n as f,o as p,r as ee,s as m,t as h,u as g}from"./dist-CjNu_N10.js";import{n as _}from"./button-2XjWVeWK.js";var v=t(e(),1),y=n(),b=`AlertDialog`,[x,te]=a(b,[g]),S=g(),C=e=>{let{__scopeAlertDialog:t,...n}=e,r=S(t);return(0,y.jsx)(p,{...r,...n,modal:!0})};C.displayName=b;var w=`AlertDialogTrigger`,T=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=S(n);return(0,y.jsx)(l,{...i,...r,ref:t})});T.displayName=w;var E=`AlertDialogPortal`,D=e=>{let{__scopeAlertDialog:t,...n}=e,r=S(t);return(0,y.jsx)(c,{...r,...n})};D.displayName=E;var O=`AlertDialogOverlay`,k=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=S(n);return(0,y.jsx)(u,{...i,...r,ref:t})});k.displayName=O;var A=`AlertDialogContent`,[j,M]=x(A),N=r(`AlertDialogContent`),P=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...a}=e,o=S(n),c=v.useRef(null),l=i(t,c),u=v.useRef(null);return(0,y.jsx)(d,{contentName:A,titleName:F,docsSlug:`alert-dialog`,children:(0,y.jsx)(j,{scope:n,cancelRef:u,children:(0,y.jsxs)(f,{role:`alertdialog`,...o,...a,ref:l,onOpenAutoFocus:s(a.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,y.jsx)(N,{children:r}),(0,y.jsx)(U,{contentRef:c})]})})})});P.displayName=A;var F=`AlertDialogTitle`,I=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=S(n);return(0,y.jsx)(m,{...i,...r,ref:t})});I.displayName=F;var L=`AlertDialogDescription`,R=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=S(n);return(0,y.jsx)(ee,{...i,...r,ref:t})});R.displayName=L;var z=`AlertDialogAction`,B=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=S(n);return(0,y.jsx)(h,{...i,...r,ref:t})});B.displayName=z;var V=`AlertDialogCancel`,H=v.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=M(V,n),o=S(n),s=i(t,a);return(0,y.jsx)(h,{...o,...r,ref:s})});H.displayName=V;var U=({contentRef:e})=>{let t=`\`${A}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${A}\` by passing a \`${L}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|