@lacneu/atrium 0.49.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/assets/{AccessTab-C5QpmPe2.js → AccessTab-YfxJ8TyH.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-BzRzcaLe.js → AdvancedFilter-Bw_6N4Fp.js} +1 -1
  3. package/dist/assets/AgentFilesTab-BGjK8vy-.js +3 -0
  4. package/dist/assets/AnomaliesTab-ClY_uTZu.js +1 -0
  5. package/dist/assets/AuditTab-DNV2Z66C.js +1 -0
  6. package/dist/assets/BridgeTab-BDp1JcI8.js +1 -0
  7. package/dist/assets/{ChatDefaultsTab-BKky_1Av.js → ChatDefaultsTab-Cuma5jME.js} +1 -1
  8. package/dist/assets/{DataTableShell-CySP6pgB.js → DataTableShell-HZGBUlvm.js} +1 -1
  9. package/dist/assets/{DetailChips-CqgbiqUw.js → DetailChips-gFOfqX_a.js} +1 -1
  10. package/dist/assets/FeedbacksTab-BaSoBVK5.js +1 -0
  11. package/dist/assets/{FieldLabel-CyXK3G_H.js → FieldLabel-pNGSpfk-.js} +1 -1
  12. package/dist/assets/FilesTab-BxjNQ6IX.js +1 -0
  13. package/dist/assets/{FilterBar-irfwrPVv.js → FilterBar-DlPympG5.js} +1 -1
  14. package/dist/assets/{GroupsTab-KElXEjtm.js → GroupsTab-CUch1a_C.js} +1 -1
  15. package/dist/assets/InstancesTab-DRWZsjZC.js +1 -0
  16. package/dist/assets/IntegrationsTab-C7KPWF6x.js +1 -0
  17. package/dist/assets/{KpiTab-DLCBfUyr.js → KpiTab-6QaTYyCv.js} +1 -1
  18. package/dist/assets/PreferencesTab-CLEVHQTj.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-CnlX7r8C.js +4 -0
  20. package/dist/assets/RolesTab-orl-1HS-.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-CtwpNIDj.js +1 -0
  22. package/dist/assets/{SubAgentReportsTab-DmMB0i9U.js → SubAgentReportsTab-MRixaruJ.js} +1 -1
  23. package/dist/assets/ThemeShowroom-BCYOO2fm.js +1 -0
  24. package/dist/assets/{TimeRangePicker-3h2VniWx.js → TimeRangePicker-Cm5l2vkz.js} +1 -1
  25. package/dist/assets/TracesTab-BATP4Ee5.js +1 -0
  26. package/dist/assets/UsersTab-CN9dGPvE.js +1 -0
  27. package/dist/assets/{VoiceTab-CjWmW8mr.js → VoiceTab-DJyEAu0o.js} +1 -1
  28. package/dist/assets/{button-Dbs-wspp.js → button-B4Nos6AU.js} +1 -1
  29. package/dist/assets/{card-B_7M0l5O.js → card-DhM6Y5He.js} +1 -1
  30. package/dist/assets/chevrons-up-down-Du6glRFD.js +1 -0
  31. package/dist/assets/{compatView-CeYXlVzu.js → compatView-DwEzKEAD.js} +1 -1
  32. package/dist/assets/{dispatchErrorInfo-CgEoICK4.js → dispatchErrorInfo-C27wKMfE.js} +1 -1
  33. package/dist/assets/{dist-D8Kd0X5G.js → dist-BTpttlbH.js} +5 -5
  34. package/dist/assets/{dist-BC4E1wqn.js → dist-BwHHVs_B.js} +1 -1
  35. package/dist/assets/{dist-CF-vNq7s.js → dist-BzsC63K9.js} +1 -1
  36. package/dist/assets/{dist-CZwMA8Oj.js → dist-qfxevi2g.js} +1 -1
  37. package/dist/assets/{highlighted-body-OFNGDK62-DSPtdVav.js → highlighted-body-OFNGDK62-DUhXym2u.js} +1 -1
  38. package/dist/assets/{index-BH6LVgWl.css → index-CnCsAZYf.css} +1 -1
  39. package/dist/assets/index-GIhUlE6M.js +233 -0
  40. package/dist/assets/mermaid-GHXKKRXX-D_CGWBHm.js +1 -0
  41. package/dist/assets/{pdf-Dwqw551E.js → pdf-BjDyP8tM.js} +1 -1
  42. package/dist/assets/roleDescriptions-8ML7Rdme.js +1 -0
  43. package/dist/assets/{table-RDie4v3L.js → table-BBE4oFvW.js} +1 -1
  44. package/dist/assets/{tabs-uwXJdjSE.js → tabs-DlXyYN7h.js} +1 -1
  45. package/dist/assets/x-BLHWZzIt.js +1 -0
  46. package/dist/index.html +8 -8
  47. package/package.json +1 -1
  48. package/dist/assets/AgentFilesTab-DgyYp1Yu.js +0 -3
  49. package/dist/assets/AnomaliesTab-BfvM_oKR.js +0 -1
  50. package/dist/assets/AuditTab-B5U0zwjP.js +0 -1
  51. package/dist/assets/BridgeTab-BHnMaTub.js +0 -1
  52. package/dist/assets/FeedbacksTab-UO9aY9Rc.js +0 -1
  53. package/dist/assets/FilesTab-BAhDA2Oi.js +0 -1
  54. package/dist/assets/InstancesTab-CnxJKNrU.js +0 -1
  55. package/dist/assets/IntegrationsTab-C_WMMnfP.js +0 -1
  56. package/dist/assets/PreferencesTab-CsHMsOBx.js +0 -1
  57. package/dist/assets/PromptInjectionsTab-Iuv2LIWX.js +0 -4
  58. package/dist/assets/RolesTab-JyOSiabk.js +0 -1
  59. package/dist/assets/ServiceAccountsTab-C1S0vg1x.js +0 -1
  60. package/dist/assets/ThemeShowroom-DxS8vmei.js +0 -1
  61. package/dist/assets/TracesTab-DTrYQKIz.js +0 -1
  62. package/dist/assets/UsersTab-Bg8hwoUX.js +0 -1
  63. package/dist/assets/chevrons-up-down-CGy16B32.js +0 -1
  64. package/dist/assets/index-Se6baszB.js +0 -233
  65. package/dist/assets/mermaid-GHXKKRXX-C_IvlBqL.js +0 -1
  66. package/dist/assets/roleDescriptions-DuRh679l.js +0 -1
  67. package/dist/assets/x-B-jDgsYW.js +0 -1
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Aa as r,Ba as i,Ca as a,Da as o,E as s,Ea as c,Fa as l,Ga as u,Ha as d,Ia as f,Ja as p,Ka as m,La as h,Ma as g,Na as _,Oa as v,Pa as y,Ra as b,Sa as x,Ta as S,Ua as C,Va as w,Wa as T,_a as E,ba as D,da as O,fa as k,ga as A,hM as j,ha as M,ja as N,ka as P,mM as F,ma as I,pa as L,qa as ee,ua as R,va as z,wa as B,xa as V,ya as H,za as U}from"./dist-D8Kd0X5G.js";import{t as W}from"./button-Dbs-wspp.js";import{B as G,et as K}from"./index-Se6baszB.js";import{t as q}from"./DataTableShell-CySP6pgB.js";var J=t(e(),1),Y=n(),X={hung:()=>N(),wrong_result:()=>r(),error:()=>P(),other:()=>v()},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=F(s.subAgentReports.respondToReport),[r,i]=(0,J.useState)(e.thread),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(!1);async function p(){let t=l.trim();if(!(!t||d)){f(!0);try{await n({reportId:e._id,text:t}),i(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),u(``)}finally{f(!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),` · `,o({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:c()}),(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:S()}),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`?B():a()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:x()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:V(),value:l,maxLength:2e3,rows:3,onChange:e=>u(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 p(),disabled:!l.trim()||d,children:d?H():D()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[z({count:t.children.length}),t.childrenTruncated?` ${E()}`:``,t.textTruncated?` ${A()}`:``]}),(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?` · ${M()}`:``]}),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:I()}),(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:L()}),(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=j(s.subAgentReports.listForAdmin,{}),t=F(s.subAgentReports.readReport),n=F(s.subAgentReports.deleteReport),r=G(),[a,o]=(0,J.useState)(null),[c,v]=(0,J.useState)({});async function x(e){if(a===e._id){o(null);return}if(!c[e._id]){let n=await t({reportId:e._id});v(t=>({...t,[e._id]:n}))}o(e._id)}async function S(e){await r({title:k(),description:O(),confirmLabel:R(),destructive:!0})&&(await n({reportId:e._id}),a===e._id&&o(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[m(),` `,(0,Y.jsx)(`strong`,{children:u()}),` `,T()]}),(0,Y.jsx)(q,{title:p(),rows:e,emptyHint:ee(),isExpanded:e=>a===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Y.jsx)($,{data:c[e._id]}):null,columns:[{header:C(),cell:e=>K(e.at),sort:e=>e.at},{header:d(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:w(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:i(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${h({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:U(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:b(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:f()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:l()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:a===e._id?_():y(),onSelect:()=>void x(e)},{label:g(),onSelect:()=>void S(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Aa as r,Ba as i,Ca as a,Da as o,E as s,Ea as c,Fa as l,Ga as u,Ha as d,Ia as f,Ja as p,Ka as m,La as h,Ma as g,Na as _,Oa as v,Pa as y,Ra as b,Sa as x,Ta as S,Ua as C,Va as w,Wa as T,_M as E,_a as D,ba as O,da as k,fa as A,gM as j,ga as M,ha as N,ja as P,ka as F,ma as I,pa as L,qa as ee,ua as R,va as z,wa as B,xa as V,ya as H,za as U}from"./dist-BTpttlbH.js";import{t as W}from"./button-B4Nos6AU.js";import{B as G,et as K}from"./index-GIhUlE6M.js";import{t as q}from"./DataTableShell-HZGBUlvm.js";var J=t(e(),1),Y=n(),X={hung:()=>P(),wrong_result:()=>r(),error:()=>F(),other:()=>v()},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=j(s.subAgentReports.respondToReport),[r,i]=(0,J.useState)(e.thread),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(!1);async function p(){let t=l.trim();if(!(!t||d)){f(!0);try{await n({reportId:e._id,text:t}),i(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),u(``)}finally{f(!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),` · `,o({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:c()}),(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:S()}),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`?B():a()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:x()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:V(),value:l,maxLength:2e3,rows:3,onChange:e=>u(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 p(),disabled:!l.trim()||d,children:d?H():O()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[z({count:t.children.length}),t.childrenTruncated?` ${D()}`:``,t.textTruncated?` ${M()}`:``]}),(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?` · ${N()}`:``]}),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:I()}),(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:L()}),(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=E(s.subAgentReports.listForAdmin,{}),t=j(s.subAgentReports.readReport),n=j(s.subAgentReports.deleteReport),r=G(),[a,o]=(0,J.useState)(null),[c,v]=(0,J.useState)({});async function x(e){if(a===e._id){o(null);return}if(!c[e._id]){let n=await t({reportId:e._id});v(t=>({...t,[e._id]:n}))}o(e._id)}async function S(e){await r({title:A(),description:k(),confirmLabel:R(),destructive:!0})&&(await n({reportId:e._id}),a===e._id&&o(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[m(),` `,(0,Y.jsx)(`strong`,{children:u()}),` `,T()]}),(0,Y.jsx)(q,{title:p(),rows:e,emptyHint:ee(),isExpanded:e=>a===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Y.jsx)($,{data:c[e._id]}):null,columns:[{header:C(),cell:e=>K(e.at),sort:e=>e.at},{header:d(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:w(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:i(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${h({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:U(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:b(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:f()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:l()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:a===e._id?_():y(),onSelect:()=>void x(e)},{label:g(),onSelect:()=>void S(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{$A as r,$k as i,AA as a,BA as o,Bk as s,CA as c,D as l,DA as u,E as d,EA as f,FA as p,GA as m,Gk as h,HA as g,Hk as _,IA as v,JA as y,Jk as ee,KA as te,Kk as ne,LA as re,Lk as ie,MA as ae,NA as oe,OA as se,PA as ce,QA as le,Qk as ue,RA as de,Rk as fe,SA as b,TA as pe,UA as me,Uk as he,VA as ge,Vk as x,WA as _e,Wk as ve,XA as ye,Xk as be,YA as S,Yk as xe,ZA as Se,Zk as Ce,_A as we,_M as C,aA as Te,aM as Ee,aj as De,bA as Oe,cA as ke,ca as w,dA as Ae,eA as je,ej as Me,fA as Ne,gA as Pe,gM as T,hA as Fe,iA as Ie,iM as Le,ij as Re,jA as ze,kA as Be,lA as Ve,la as E,mA as He,mM as Ue,n as We,nA as Ge,nj as Ke,oA as qe,oM as Je,oa as Ye,pA as Xe,qA as Ze,qk as Qe,rA as D,rj as $e,sA as et,sa as tt,tA as nt,tj as rt,uA as it,vA as at,wA as ot,xA as st,yA as ct,zA as lt,zk as ut}from"./dist-BTpttlbH.js";import{n as O}from"./dist-BzsC63K9.js";import{t as dt}from"./x-BLHWZzIt.js";import{t as k}from"./button-B4Nos6AU.js";import{C as A,Ht as j,S as M,Ut as ft,_t as pt,at as mt,b as N,ct as P,gt as ht,it as F,lt as I,nt as gt,ot as L,p as R,rt as _t,st as vt,w as z,x as B,xt as V}from"./index-GIhUlE6M.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-DhM6Y5He.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-BBE4oFvW.js";import{t as kt}from"./TimeRangePicker-Cm5l2vkz.js";import{t as At}from"./FilterBar-DlPympG5.js";import{t as jt}from"./AdvancedFilter-Bw_6N4Fp.js";var G=l(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),K=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 q(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(qe());if(e.size>zt)throw Error(Te());let{source:n,width:r,height:i,cleanup:a}=await Wt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Bt/r,Vt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(D());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(D());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);q(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Ht)??await Y(f,`image/png`);if(!h)throw Error(Ge());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(e){if(e.type===`image/svg+xml`)return J(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 J(e)}async function J(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(Ie())),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 Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=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 Z=`__all__`,Q={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 $({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?Je():e===`dark`?Ee():Le()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.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,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:We(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(O,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":E(),title:E(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=C(d.charts.listMyCharts),r=T(d.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:S(),subtitle:y(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?Ze():n.via===`owner`?te():m({group:n.via.group});return(0,X.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,X.jsx)(`p`,{className:`oc-show__desc`,children:_e()}):null]})}function Qt(){let e=T(d.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[l,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(!1);async function g(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),p(!1);try{i(await t.text())}catch{s(b())}}}async function _(){if(s(null),p(!1),t.trim()===``){s(Oe());return}let a;try{a=JSON.parse(r)}catch{s(b());return}h(!0);try{await e({name:t.trim(),tokens:a}),p(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{h(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:a()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Be()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:se()}),(0,X.jsx)(I,{value:t,onChange:e=>n(e.target.value),placeholder:u(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:f()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:pe(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),ot(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void g(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:m,onClick:()=>void _(),children:c()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,l?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:st()}):null]})]})}function $t({chart:e}){let t=Ue(d.charts.setChartLogo),n=T(d.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.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 f(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 p({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Xe():Ne()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),t?it():Ae(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:ke()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Ve()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:He()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(p,{mode:`light`}),(0,X.jsx)(p,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:et()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=C(d.me.getMe,{host:V}),n=T(d.charts.addChartDomain),r=T(d.charts.removeChartDomain),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let f=e.domains??[];async function p(){let t=a.trim();if(t!==``){c(null),u(!0);try{await n({chartKey:e.key,domain:t}),o(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function m(t){c(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:nt()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:f.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ce()}):f.map(e=>(0,X.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":be({domain:e}),onClick:()=>void m(e),children:(0,X.jsx)(dt,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(I,{value:a,onChange:e=>o(e.target.value),placeholder:i(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&p()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void p(),children:ue()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:je()}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=T(d.charts.updateChart),n=T(d.charts.deleteChart),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(e.name),[s,c]=(0,K.useState)(()=>tn(e.tokens)),[l,u]=(0,K.useState)(e.tokens.bpm??0),[f,p]=(0,K.useState)(null),[m,g]=(0,K.useState)(!1);function _(){o(e.name),c(tn(e.tokens)),u(e.tokens.bpm??0),p(null),i(!0)}async function v(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(s)}catch{p(b());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(h()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:_,children:Pe()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:Fe()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Qe()}),(0,X.jsx)(I,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:w()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":w()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?tt():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ye()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ne()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:m,onClick:()=>void v(),children:xe()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:ee()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=C(d.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ct()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:at()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:we()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=T(d.charts.addChartToGroupPool),r=T(d.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(P,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?v():e.kind===`custom`&&e.scope===`personal`?x():re()}),e.isGlobalDefault?(0,X.jsx)(P,{variant:`default`,children:p()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:oe()}),(a??[]).map(e=>(0,X.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ze({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(dt,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(N,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(A,{size:`sm`,className:`w-56`,children:(0,X.jsx)(z,{placeholder:ae()})}),(0,X.jsx)(B,{children:s.map(e=>(0,X.jsx)(M,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ce()}):null]})]})}function on({chart:e}){let t=T(d.charts.promoteChartToCommon),n=T(d.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(h()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(P,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?s():x()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:_({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:ut()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:fe()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let i=T(d.admin.setDefaultThemeMode),a=T(d.admin.setDefaultLocale),s=T(d.charts.setDefaultChart),c=C(d.charts.listChartsAdmin),l=C(d.groups.listGroups,{}),u=e??`system`,f=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:r()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:le()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:me()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:g()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void s({name:null}),children:S()}),pt.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void s({name:e.key}),children:e.name},e.key)),(c??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void s({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ge()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:o()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:l??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:lt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:de()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:he()})]}),(()=>{let e=(c??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ie()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(on,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:De()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Re()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>void i({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:$e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ke()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:f===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:rt()})]})]})}function cn(){let e=C(d.me.getMe,{host:V}),t=ht(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:Me()}),(0,X.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(k,{variant:`outline`,children:`Outline`}),(0,X.jsx)(k,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(k,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(k,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,children:`Small`}),(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{size:`lg`,children:`Large`}),(0,X.jsx)(k,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(j,{})}),(0,X.jsx)(k,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(P,{children:`Default`}),(0,X.jsx)(P,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(P,{variant:`outline`,children:`Outline`}),(0,X.jsx)(P,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)($,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(I,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(N,{value:n,onValueChange:r,children:[(0,X.jsx)(A,{className:`w-56`,children:(0,X.jsx)(z,{placeholder:`Select…`})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(M,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(M,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(R,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)($,{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,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(N,{value:o,onValueChange:s,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(M,{value:Z,children:`Toutes directions`}),(0,X.jsx)(M,{value:`inbound`,children:`inbound`}),(0,X.jsx)(M,{value:`outbound`,children:`outbound`}),(0,X.jsx)(M,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(N,{value:c,onValueChange:l,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(M,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(M,{value:`info`,children:`info`}),(0,X.jsx)(M,{value:`warn`,children:`warn`}),(0,X.jsx)(M,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(kt,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(gt,{children:[(0,X.jsx)(vt,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(j,{})})}),(0,X.jsxs)(_t,{align:`start`,children:[(0,X.jsx)(mt,{children:`Actions`}),(0,X.jsx)(L,{}),(0,X.jsx)(F,{children:`Edit`}),(0,X.jsx)(F,{children:`Duplicate`}),(0,X.jsx)(L,{}),(0,X.jsx)(F,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Tt,{className:`w-80`,children:[(0,X.jsxs)(bt,{children:[(0,X.jsx)(Ct,{children:`Instance`}),(0,X.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(xt,{className:`gap-2`,children:[(0,X.jsx)(k,{size:`sm`,children:`Save`}),(0,X.jsx)(k,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)($,{title:`Table`,children:(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Et,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(R,{"aria-label":`select all`})}),(0,X.jsx)(H,{children:`Name`}),(0,X.jsx)(H,{children:`Mode`}),(0,X.jsx)(H,{className:`text-right`,children:`Status`}),(0,X.jsx)(H,{className:`w-8`})]})}),(0,X.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(U,{children:[(0,X.jsx)(W,{children:(0,X.jsx)(R,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(P,{variant:`secondary`,children:e.m})}),(0,X.jsx)(W,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(O,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(j,{})})})]},e.n))})]})}),(0,X.jsx)($,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$m as r,Gm as i,Hm as a,Jm as o,Km as s,Qm as c,Um as l,Vm as u,Wm as d,Xm as f,Ym as p,Zm as m,ar as h,cr as g,ir as _,nr as v,or as y,qm as b,rr as x,sr as S}from"./dist-D8Kd0X5G.js";import{t as C}from"./button-Dbs-wspp.js";import{Ct as w,Gt as T,Pt as E,St as D,Tt as O,et as k,lt as A,wt as j}from"./index-Se6baszB.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:r(),from:`now-5m`},{label:c(),from:`now-15m`},{label:m(),from:`now-30m`},{label:f(),from:`now-1h`},{label:p(),from:`now-3h`},{label:o(),from:`now-6h`},{label:b(),from:`now-12h`},{label:s(),from:`now-24h`},{label:i(),from:`now-2d`},{label:d(),from:`now-7d`},{label:l(),from:`now-30d`},{label:a(),from:`now-90d`},{label:u(),from:`now-520w`}];function L(e){return k(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),[i,a]=(0,M.useState)(``),o=F(e),[s,c]=(0,M.useState)(()=>z(o.from)),[l,u]=(0,M.useState)(()=>z(o.to));function d(t){if(t){let t=F(e);c(z(t.from)),u(z(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=B(s),n=B(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,M.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),b=B(s)!==null&&B(l)!==null;return(0,H.jsxs)(j,{open:n,onOpenChange:d,children:[(0,H.jsx)(O,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(T,{}),R(e)]})}),(0,H.jsx)(w,{children:(0,H.jsx)(D,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 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:g()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:S()}),(0,H.jsx)(A,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:y()}),(0,H.jsx)(A,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!b,onClick:p,children:h()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(E,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(A,{value:i,onChange:e=>a(e.target.value),placeholder:_(),"aria-label":x()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:v()}):m.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:()=>f(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$m as r,Gm as i,Hm as a,Jm as o,Km as s,Qm as c,Um as l,Vm as u,Wm as d,Xm as f,Ym as p,Zm as m,ar as h,cr as g,ir as _,nr as v,or as y,qm as b,rr as x,sr as S}from"./dist-BTpttlbH.js";import{t as C}from"./button-B4Nos6AU.js";import{Ct as w,Gt as T,Pt as E,St as D,Tt as O,et as k,lt as A,wt as j}from"./index-GIhUlE6M.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:r(),from:`now-5m`},{label:c(),from:`now-15m`},{label:m(),from:`now-30m`},{label:f(),from:`now-1h`},{label:p(),from:`now-3h`},{label:o(),from:`now-6h`},{label:b(),from:`now-12h`},{label:s(),from:`now-24h`},{label:i(),from:`now-2d`},{label:d(),from:`now-7d`},{label:l(),from:`now-30d`},{label:a(),from:`now-90d`},{label:u(),from:`now-520w`}];function L(e){return k(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),[i,a]=(0,M.useState)(``),o=F(e),[s,c]=(0,M.useState)(()=>z(o.from)),[l,u]=(0,M.useState)(()=>z(o.to));function d(t){if(t){let t=F(e);c(z(t.from)),u(z(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=B(s),n=B(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,M.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),b=B(s)!==null&&B(l)!==null;return(0,H.jsxs)(j,{open:n,onOpenChange:d,children:[(0,H.jsx)(O,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(T,{}),R(e)]})}),(0,H.jsx)(w,{children:(0,H.jsx)(D,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 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:g()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:S()}),(0,H.jsx)(A,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:y()}),(0,H.jsx)(A,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!b,onClick:p,children:h()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(E,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(A,{value:i,onChange:e=>a(e.target.value),placeholder:_(),"aria-label":x()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:v()}):m.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:()=>f(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,$w as i,A_ as a,Aw as o,B_ as s,C_ as c,D as l,D_ as u,Dw as d,E as f,E_ as p,Ew as m,F_ as h,Fw as g,G_ as _,Gw as v,H_ as y,I_ as b,Iw as x,J_ as ee,Jw as te,K_ as ne,Kw as S,L_ as re,Lw as ie,M_ as ae,Mw as C,N_ as oe,Nw as w,O_ as se,Ow as T,P_ as ce,Pw as E,Q_ as le,Qw as ue,R_ as de,Rw as fe,S_ as pe,T_ as me,Tw as he,U_ as ge,Uw as _e,V_ as ve,W_ as ye,Ww as D,X_ as be,Xw as xe,Y_ as Se,Yw as O,Z_ as Ce,Zw as k,_M as A,aT as we,b_ as j,cT as M,dT as N,eT as P,ev as Te,fT as Ee,gM as F,gn as De,hn as Oe,iT as I,iv as ke,j_ as Ae,jw as je,k_ as Me,kw as Ne,lT as Pe,mn as Fe,nT as Ie,nv as Le,oT as Re,pT as ze,q_ as Be,qw as Ve,rT as He,rv as Ue,sT as We,tT as L,tv as Ge,uT as Ke,w_ as qe,ww as Je,x_ as Ye,z_ as Xe}from"./dist-BTpttlbH.js";import{n as Ze}from"./dist-BzsC63K9.js";import{t as Qe}from"./x-BLHWZzIt.js";import{i as R,n as z,r as $e,t as et}from"./tabs-DlXyYN7h.js";import{t as B}from"./button-B4Nos6AU.js";import{Bt as tt,C as V,S as H,Vt as nt,Wt as rt,Xt as it,Yt as at,a as ot,b as U,ct as W,dt as st,et as G,ft as ct,ht as lt,i as ut,j as dt,mt as ft,o as pt,r as mt,tt as ht,ut as gt,w as K,x as q,xt as _t}from"./index-GIhUlE6M.js";import{n as vt}from"./TimeRangePicker-Cm5l2vkz.js";import{t as yt}from"./FilterBar-DlPympG5.js";import{t as bt}from"./AdvancedFilter-Bw_6N4Fp.js";import{t as xt}from"./DataTableShell-HZGBUlvm.js";var St=l(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=l(`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`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=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`?te():n===`agent`?`${Ve()} - ${r}`:e}function Tt(){let e=A(f.me.getMe,{host:_t})?.role===`admin`,t=A(f.deliveryTiming.getDeliveryStatus,{}),n=F(f.deliveryTiming.startDeliveryRecord),r=F(f.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:ze()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ee()})]}),e?(0,Y.jsx)(B,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?Ke():N()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(W,{variant:`secondary`,children:Pe()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:M({time:ht(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?we():Re()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=A(f.deliveryTiming.listDeliverySessions,{}),n=F(f.deliveryTiming.deleteDeliverySessions),[r,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(`all`),[c,l]=(0,J.useState)(X),[u,d]=(0,J.useState)(null),{from:p,to:m}=vt(c),h=c.to===`now`?1/0:m,g=r.trim()!==``||o!==`all`||c!==X,_=()=>{a(``),s(`all`),l(X)},y=(0,J.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(o===`all`||(o===`active`?t.active:!t.active))&&t.startedAt>=p&&t.startedAt<=h).map(e=>({...e,_id:e.sessionId}))},[t,r,o,p,h]),b=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,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(yt,{q:r,onQChange:a,searchPlaceholder:He(),timeRange:c,onTimeRangeChange:l,onReset:_,canReset:g,children:(0,Y.jsxs)(U,{value:o,onValueChange:e=>s(e),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:`all`,children:Ie()}),(0,Y.jsx)(H,{value:`active`,children:L()}),(0,Y.jsx)(H,{value:`stopped`,children:P()})]})]})}),(0,Y.jsx)(xt,{title:I(),rows:y,emptyHint:he(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":u===e.sessionId?v():S(),onClick:()=>d(t=>t===e.sessionId?null:e.sessionId),children:u===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(nt,{size:15,"aria-hidden":!0})})},{header:i(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:G(e.startedAt)})},{header:ue(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:G(e.stoppedAt)})},{header:k(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:xe(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:O(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(W,{variant:`secondary`,children:L()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:P()})}],rowActions:e?e=>[{label:D(),variant:`destructive`,onSelect:()=>b([e.sessionId])}]:void 0,bulkActions:e?[{label:D(),variant:`destructive`,onSelect:e=>b(e)}]:void 0,isExpanded:e=>e.sessionId===u,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=A(f.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(dt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:_e()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:We()});let r=e.segments,i=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,Je()]}),(0,Y.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Y.jsx)(rt,{size:13,"aria-hidden":!0}),t?m():d()]})]}),(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,Y.jsx)(`th`,{className:`py-1 font-medium`,children:x()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:g()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:E()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(w(),r.bridge),i(C(),r.A),i(je(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:o()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ne()})]})}var kt=[50,100,200,500],At=`all`,Q=`__all__`,jt=[`2xx`,`4xx`,`5xx`],Mt=[`user`,`service`,`system`],Nt=[`inbound`,`outbound`,`internal`],Pt={kind:`relative`,from:`now-30d`,to:`now`},Ft=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:De()},{value:`principalType`,label:Oe()},{value:`direction`,label:`direction`},{value:`roleKey`,label:Fe()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=it({from:`/settings/traces`}),t=at({from:`/settings/traces`}),n=e.limit,i=e.kind,o=e.statusClass??Q,l=e.principalType??Q,d=e.direction??Q,m=e.roleKey??Q,g=e.q??``,v=mt(e.from,e.to),x=(0,J.useMemo)(()=>pt(e.adv),[e.adv]),{from:te,to:S}=vt(v),[C,w]=(0,J.useState)(null),[T,E]=(0,J.useState)(null),ue=e=>void t({search:t=>({...t,limit:e})}),pe=e=>void t({search:t=>({...t,kind:e})}),he=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),_e=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),D=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),xe=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),O=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,...ot(e)})}),we=e=>void t({search:t=>({...t,adv:ut(e)}),replace:!0}),j=A(f.observability.listEvents,{limit:n}),M=A(f.observability.listEvents,{limit:n,kind:i===At?void 0:i,filter:{q:g||void 0,from:te,to:S,statusClass:o===Q?void 0:o,principalType:l===Q?void 0:l,direction:d===Q?void 0:d,roleKey:m===Q?void 0:m,advanced:x.length>0?x:void 0}}),N=(0,J.useMemo)(()=>{let e=new Set;for(let t of j??[])e.add(t.kind);return[...e].sort()},[j]),P=(0,J.useMemo)(()=>{let e=new Set;for(let t of j??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[j]),Ee=g!==``||o!==Q||l!==Q||d!==Q||m!==Q||x.length>0||v.kind!==`relative`||v.from!==Pt.from;function F(){t({search:{limit:100,kind:`all`},replace:!0})}let De=C?j?.filter(e=>e.correlationId===C):M,Oe=e.section,I=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:Oe,onValueChange:e=>I(e),children:[(0,Y.jsxs)($e,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(tt,{size:13,"aria-hidden":!0}),fe()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),ie()]})]}),(0,Y.jsx)(z,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[ke(),(0,Y.jsx)(`strong`,{children:Ue()}),Le(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:Ge()})]}),(0,Y.jsxs)(yt,{q:g,onQChange:he,searchPlaceholder:Te(),timeRange:v,onTimeRangeChange:k,onReset:F,canReset:Ee,children:[(0,Y.jsxs)(U,{value:o,onValueChange:_e,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:r()})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:Q,children:le()}),jt.map(e=>(0,Y.jsx)(H,{value:e,children:e},e))]})]}),(0,Y.jsxs)(U,{value:l,onValueChange:D,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:Ce()})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:Q,children:be()}),Mt.map(e=>(0,Y.jsx)(H,{value:e,children:e},e))]})]}),(0,Y.jsxs)(U,{value:d,onValueChange:xe,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:Se()})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:Q,children:ee()}),Nt.map(e=>(0,Y.jsx)(H,{value:e,children:e},e))]})]}),(0,Y.jsxs)(U,{value:m,onValueChange:O,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{placeholder:Be()})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:Q,children:ne()}),P.map(e=>(0,Y.jsx)(H,{value:e,children:e},e))]})]}),(0,Y.jsxs)(U,{value:i,onValueChange:pe,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(K,{placeholder:_()})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:At,children:ye()}),N.map(e=>(0,Y.jsx)(H,{value:e,children:e},e))]})]}),(0,Y.jsxs)(U,{value:String(n),onValueChange:e=>ue(Number(e)),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(K,{})}),(0,Y.jsx)(q,{children:kt.map(e=>(0,Y.jsx)(H,{value:String(e),children:ge({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:x,onChange:we}),C?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>w(null),title:y(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[ve(),(0,Y.jsx)(`code`,{children:$(C)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:s()})]})}):null,(0,Y.jsx)(xt,{title:Xe(),rows:De,emptyHint:C?de():re(),columns:[{header:b(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:G(e.at)})},{header:h(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(W,{variant:`secondary`,children:e.kind})},{header:ce(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":oe(),children:`✓`})}},{header:ae(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(W,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Ae(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(W,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:a(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(W,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Me(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:se(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:u(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:p(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:me(),onClick:()=>w(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:qe(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>E(e),children:c()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:T,onClose:()=>E(null)})]})]})}function Lt(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 Rt(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 zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(gt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(st,{className:`max-w-lg`,children:[(0,Y.jsxs)(ft,{children:[(0,Y.jsxs)(lt,{className:`oc-traces__meta-title`,children:[pe(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(W,{variant:`outline`,children:Ye()})]}),(0,Y.jsx)(ct,{children:j()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AS as r,BS as i,Bg as a,CS as o,DS as s,E as c,ES as l,FS as u,Fg as d,Gg as f,HS as p,Hg as m,IS as ee,Ig as h,Kg as g,LS as te,Lg as _,MS as ne,NS as v,OS as re,PS as ie,Pg as y,RS as ae,Rg as b,SS as oe,TS as se,US as x,Ug as S,VS as C,Vg as w,Wg as T,Xx as E,_M as D,_S as ce,bS as O,du as k,fu as A,gM as j,gS as le,hS as M,jS as ue,kS as de,uu as N,vS as fe,wS as pe,xS as me,yS as he,zS as ge,zg as P}from"./dist-BTpttlbH.js";import{t as F}from"./button-B4Nos6AU.js";import{B as I,C as L,Mt as R,Nt as z,S as B,V as _e,Xt as ve,Yt as ye,at as V,b as H,c as be,ct as U,dt as xe,ft as Se,ht as Ce,it as we,l as W,mt as Te,nt as Ee,p as G,rt as De,s as K,st as Oe,ut as ke,w as q,x as J,xt as Ae,z as Y}from"./index-GIhUlE6M.js";import{t as je}from"./FilterBar-DlPympG5.js";import{t as Me}from"./DataTableShell-HZGBUlvm.js";import{t as Ne}from"./DetailChips-gFOfqX_a.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=D(c.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=D(c.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,u=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),d=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!u.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 d){let t=p.get(e.instanceName)??[];t.push(e),p.set(e.instanceName,t)}return(0,Z.jsx)(ke,{open:n,onOpenChange:r,children:(0,Z.jsxs)(xe,{className:`oc-access`,children:[(0,Z.jsxs)(Te,{children:[(0,Z.jsx)(Ce,{children:g({user:t})}),(0,Z.jsx)(Se,{children:f()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?T():S()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:m()}):d.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:P()}):[...p.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:l},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:o}){let s=j(c.agents.assignAgent),l=j(c.agents.removeAgent),u=j(c.agents.setDefaultAgent),f=Y();if(!e)return null;async function p(n,r){try{r?await l({profileId:e,instanceName:t,agentId:n}):await s({profileId:e,instanceName:t,agentId:n})}catch(e){f.error(w(),e)}}async function m(n){try{await u({profileId:e,instanceName:t,agentId:n})}catch(e){f.error(a(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(z,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(U,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),a=o===n,s=e.state===`deleted`,c=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,Z.jsx)(G,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void p(e.agentId,r),"aria-label":b({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)(U,{variant:`outline`,className:`oc-access__gone`,children:_()}):null,e.outOfPool?(0,Z.jsx)(U,{variant:`outline`,className:`oc-access__gone`,children:h()}):null,r?a?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":d(),title:d(),children:(0,Z.jsx)(R,{size:14,fill:`currentColor`})}):(0,Z.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":y(),title:y(),disabled:c,onClick:()=>void m(e.agentId),children:(0,Z.jsx)(R,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return N();case`user`:return k();case`admin`:return A();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=K.filter(e=>n.has(W[e])).length;return(0,Z.jsxs)(Ee,{children:[(0,Z.jsx)(Oe,{asChild:!0,children:(0,Z.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?x():p({count:r})})}),(0,Z.jsxs)(De,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(V,{children:C()}),K.map(e=>{let r=W[e];return(0,Z.jsxs)(we,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(G,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:be[e]()})]},e)})]})]})}function Le(){let e=ve({from:`/settings/users`}),t=ye({from:`/settings/users`}),n=e.q??``,a=e.role??Q,d=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),f=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),p=D(c.admin.listUsers,{filter:{q:n||void 0,role:a===Q?void 0:a},withAgents:!0}),m=D(c.me.getMe,{host:Ae}),h=j(c.admin.setRole),g=j(c.admin.setUserPermissions),_=j(c.admin.startImpersonation),y=j(c.admin.deleteUser),b=j(c.admin.setUserName),x=I(),S=_e(),C=Y(),[w,T]=(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!==``||a!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await h(e)}catch(e){C.error(i(),e)}}async function F(e){try{await g(e)}catch(e){C.error(ge(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await x({title:ne(),description:ue({user:t}),confirmWord:r(),confirmLabel:de(),destructive:!0}))try{await y({profileId:e._id}),C.success(s({user:t}))}catch(e){C.error(re(),e)}}async function V(e){let t=e.email||e.name||e.userId.slice(0,8),n=await S({title:se(),label:pe({user:t}),placeholder:o(),defaultValue:e.name??``,confirmLabel:E()});if(n!==null)try{await b({profileId:e._id,name:n}),C.success(oe())}catch(e){C.error(me(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(je,{q:n,onQChange:d,searchPlaceholder:ae(),onReset:N,canReset:A,children:(0,Z.jsxs)(H,{value:a,onValueChange:f,children:[(0,Z.jsx)(L,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(J,{children:[(0,Z.jsx)(B,{value:Q,children:te()}),k.map(e=>(0,Z.jsx)(B,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:ee(),rows:p,emptyHint:u(),rowActions:e=>{let t=[{label:M(),onSelect:()=>T({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:l(),onSelect:()=>void V(e)}];return e.userId!==m?.userId&&t.push({label:ie(),onSelect:()=>void _({profileId:e._id})},{label:v(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:O(),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:he(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(H,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(J,{children:[(0,Z.jsx)(B,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(B,{value:`user`,children:$(`user`)}),(0,Z.jsx)(B,{value:`admin`,children:$(`admin`)})]})]})},{header:fe(),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:ce()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),F({profileId:e._id,permissions:[...n]})}})},{header:le(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(z,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Pe,{profileId:w?.profileId??null,userLabel:w?.label??``,open:w!==null,onOpenChange:e=>{e||T(null)}})]})}export{Le as UsersTab};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,At as i,Ct as a,D as o,Dt as s,E as c,Et as l,Ft as u,H as ee,J as d,K as f,Mt as p,Nt as m,Ot as h,Pt as g,Q as _,St as v,Tt as y,U as te,V as ne,W as b,Y as x,_t as re,bt as ie,cM as ae,dt as oe,et as se,fM as ce,ft as le,gt as S,hM as C,ht as ue,ic as w,jt as T,k as E,kt as D,mM as O,mt as k,nc as de,nt as fe,oM as pe,pt as me,q as A,tt as j,ut as M,vt as N,wl as P,wt as F,xt as I,yt as L}from"./dist-D8Kd0X5G.js";import{i as R,n as z,r as he,t as ge}from"./tabs-uwXJdjSE.js";import{t as B}from"./button-Dbs-wspp.js";import{C as V,F as _e,I as H,L as U,Lt as ve,M as ye,N as be,P as xe,R as Se,S as W,Xt as Ce,Yt as we,b as G,ct as K,kt as Te,p as q,w as J,x as Y,xt as Ee}from"./index-Se6baszB.js";/* empty css */var X=o(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),Z=t(e(),1),Q=n(),De=[[`auto`,()=>h()],[`fr-FR`,()=>fe()],[`en-US`,()=>j()],[`en-GB`,()=>se()],[`de-DE`,()=>r()],[`es-ES`,()=>_()]],Oe=[[`0.75`,()=>l()],[`1`,()=>y()],[`1.25`,()=>F()],[`1.5`,()=>a()]],$=0;function ke({instance:e}){let t=O(c.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},[a,o]=(0,Z.useState)(r),[l,u]=(0,Z.useState)(`idle`),[d,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(!1),h=ce(c.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{o({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}),u(`idle`)},[e._id]);let g=a.enabled!==r.enabled||a.engine!==r.engine||a.lang!==r.lang||a.rate!==r.rate||a.autoRead!==r.autoRead;async function _(){u(`saving`);try{let n={...e.config??{}};n.voiceEnabled=a.enabled,a.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,a.lang===`auto`?delete n.voiceLang:n.voiceLang=a.lang;let r=Number.parseFloat(a.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,a.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),u(`idle`)}catch{u(`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)(K,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":i()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:i()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:b()}),(0,Q.jsxs)(G,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":b(),children:(0,Q.jsx)(J,{})}),(0,Q.jsxs)(Y,{children:[(0,Q.jsx)(W,{value:`browser`,children:te()}),e.kind===`hermes`?null:(0,Q.jsx)(W,{value:`gateway`,children:ee()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ne()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()}),(0,Q.jsxs)(G,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":D(),children:(0,Q.jsx)(J,{})}),(0,Q.jsx)(Y,{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:s()}),(0,Q.jsxs)(G,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":s(),children:(0,Q.jsx)(J,{})}),(0,Q.jsx)(Y,{children:Oe.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),a.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":v()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:v()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:I()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(B,{size:`sm`,disabled:!g||l===`saving`,onClick:()=>void _(),children:l===`saving`?P():w()}),(0,Q.jsx)(B,{variant:`outline`,size:`sm`,disabled:!a.enabled||d,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(m(!1),U(),H(),a.engine!==`gateway`){_e(N(),{lang:xe(a.lang,ae()),rate:t});return}f(!0),h({instanceName:e.name,text:N()}).then(({mime:e,audioBase64:r})=>{n===$&&be(r,e,{rate:t})}).catch(()=>{n===$&&m(!0)}).finally(()=>f(!1))},children:d?P():ie()}),(0,Q.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>{$++,f(!1),U(),H()},children:L()})]}),l===`error`||p?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:p?E():de()}):null]})}function Ae({stt:e}){let t=C(c.me.getMe,{host:Ee}),n=O(c.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:S()}),(0,Q.jsx)(K,{variant:e?`secondary`:`outline`,children:e?oe():M()}),(0,Q.jsx)(K,{variant:r?`secondary`:`destructive`,children:r?d():A()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":x()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:x()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ue()})]})}function je(){let e=C(c.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Se(),[]),n=(0,Z.useMemo)(()=>ye(),[]),{section:r}=Ce({from:`/settings/voice`}),i=we({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(K,{variant:t?`secondary`:`destructive`,children:t?g():m()}),(0,Q.jsx)(K,{variant:n?`secondary`:`destructive`,children:n?p():T()})]}),(0,Q.jsxs)(ge,{value:r,onValueChange:e=>void i({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(he,{className:`w-full`,children:[(0,Q.jsxs)(R,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Te,{size:13,"aria-hidden":!0}),f()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),S()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(X,{size:13,"aria-hidden":!0}),k()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:pe()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:re()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(z,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsx)(z,{value:`talk`,children:(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:k()}),(0,Q.jsx)(K,{variant:`outline`,children:me()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:le()})]})})]})]})}export{je as VoiceTab};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,At as i,Ct as a,D as o,Dt as s,E as c,Et as l,Ft as u,H as ee,J as d,K as f,Mt as p,Nt as m,Ot as h,Pt as g,Q as _,St as v,Tt as y,U as te,V as ne,W as b,Y as x,_M as S,_t as re,bt as ie,cM as ae,dt as oe,et as se,ft as ce,gM as C,gt as w,ht as T,ic as E,jt as D,k as le,kt as O,mM as ue,mt as k,nc as de,nt as fe,pt as pe,q as me,tt as A,uM as j,ut as M,vt as N,wl as P,wt as F,xt as I,yt as L}from"./dist-BTpttlbH.js";import{i as R,n as z,r as he,t as ge}from"./tabs-DlXyYN7h.js";import{t as B}from"./button-B4Nos6AU.js";import{C as V,F as _e,I as H,L as U,Lt as ve,M as ye,N as be,P as xe,R as Se,S as W,Xt as Ce,Yt as we,b as G,ct as K,kt as Te,p as q,w as J,x as Y,xt as Ee}from"./index-GIhUlE6M.js";/* empty css */var X=o(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),Z=t(e(),1),Q=n(),De=[[`auto`,()=>h()],[`fr-FR`,()=>fe()],[`en-US`,()=>A()],[`en-GB`,()=>se()],[`de-DE`,()=>r()],[`es-ES`,()=>_()]],Oe=[[`0.75`,()=>l()],[`1`,()=>y()],[`1.25`,()=>F()],[`1.5`,()=>a()]],$=0;function ke({instance:e}){let t=C(c.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},[a,o]=(0,Z.useState)(r),[l,u]=(0,Z.useState)(`idle`),[d,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(!1),h=ue(c.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{o({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}),u(`idle`)},[e._id]);let g=a.enabled!==r.enabled||a.engine!==r.engine||a.lang!==r.lang||a.rate!==r.rate||a.autoRead!==r.autoRead;async function _(){u(`saving`);try{let n={...e.config??{}};n.voiceEnabled=a.enabled,a.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,a.lang===`auto`?delete n.voiceLang:n.voiceLang=a.lang;let r=Number.parseFloat(a.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,a.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),u(`idle`)}catch{u(`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)(K,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":i()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:i()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:b()}),(0,Q.jsxs)(G,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":b(),children:(0,Q.jsx)(J,{})}),(0,Q.jsxs)(Y,{children:[(0,Q.jsx)(W,{value:`browser`,children:te()}),e.kind===`hermes`?null:(0,Q.jsx)(W,{value:`gateway`,children:ee()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ne()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()}),(0,Q.jsxs)(G,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":O(),children:(0,Q.jsx)(J,{})}),(0,Q.jsx)(Y,{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:s()}),(0,Q.jsxs)(G,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":s(),children:(0,Q.jsx)(J,{})}),(0,Q.jsx)(Y,{children:Oe.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),a.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":v()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:v()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:I()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(B,{size:`sm`,disabled:!g||l===`saving`,onClick:()=>void _(),children:l===`saving`?P():E()}),(0,Q.jsx)(B,{variant:`outline`,size:`sm`,disabled:!a.enabled||d,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(m(!1),U(),H(),a.engine!==`gateway`){_e(N(),{lang:xe(a.lang,j()),rate:t});return}f(!0),h({instanceName:e.name,text:N()}).then(({mime:e,audioBase64:r})=>{n===$&&be(r,e,{rate:t})}).catch(()=>{n===$&&m(!0)}).finally(()=>f(!1))},children:d?P():ie()}),(0,Q.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>{$++,f(!1),U(),H()},children:L()})]}),l===`error`||p?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:p?le():de()}):null]})}function Ae({stt:e}){let t=S(c.me.getMe,{host:Ee}),n=C(c.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:w()}),(0,Q.jsx)(K,{variant:e?`secondary`:`outline`,children:e?oe():M()}),(0,Q.jsx)(K,{variant:r?`secondary`:`destructive`,children:r?d():me()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":x()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:x()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:T()})]})}function je(){let e=S(c.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Se(),[]),n=(0,Z.useMemo)(()=>ye(),[]),{section:r}=Ce({from:`/settings/voice`}),i=we({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(K,{variant:t?`secondary`:`destructive`,children:t?g():m()}),(0,Q.jsx)(K,{variant:n?`secondary`:`destructive`,children:n?p():D()})]}),(0,Q.jsxs)(ge,{value:r,onValueChange:e=>void i({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(he,{className:`w-full`,children:[(0,Q.jsxs)(R,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Te,{size:13,"aria-hidden":!0}),f()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),w()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(X,{size:13,"aria-hidden":!0}),k()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:re()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(z,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsx)(z,{value:`talk`,children:(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:k()}),(0,Q.jsx)(K,{variant:`outline`,children:pe()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ce()})]})})]})]})}export{je as VoiceTab};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n,t as r,x as i}from"./dist-D8Kd0X5G.js";e();var a=t(),o=r(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:r=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?i:`button`,{"data-slot":`button`,"data-variant":t,"data-size":r,className:n(o({variant:t,size:r,className:e})),...c})}export{o as n,s as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n,t as r,x as i}from"./dist-BTpttlbH.js";e();var a=t(),o=r(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:r=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?i:`button`,{"data-slot":`button`,"data-variant":t,"data-size":r,className:n(o({variant:t,size:r,className:e})),...c})}export{o as n,s as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-D8Kd0X5G.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-BTpttlbH.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-BTpttlbH.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
@@ -1 +1 @@
1
- import{Bs as e,Hs as t,Ls as n,Rs as r,Vs as i,Xs as a,qt as o}from"./dist-D8Kd0X5G.js";var s=e=>typeof e==`string`?e:null;function c(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function l(e,t){let n=c(e),r=c(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n[e]-r[e];if(t!==0)return t}return 0}function u(e,t){if(e===null||t===null)return!1;let n=l(t,e.min);return n!==null&&n>=0}function d(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,o=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=s(e.min),n=s(e.maxValidated);t!==null&&n!==null&&(o={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:o,validatedVersions:c}}function f(e,t,n){if(e===null)return`unknown`;let{range:r}=d(n,t);return u(r,e)?r!==null&&(l(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function p(n){return n===`supported`?t():n===`beyond`?i():e()}function m(e){return e??a()}function h(e,t){return t&&t!==`openclaw`?o({provider:t}):e===null?n():r({version:e})}function g(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{m as a,h as i,g as n,l as o,p as r,d as s,f as t};
1
+ import{Bs as e,Hs as t,Ls as n,Rs as r,Vs as i,Xs as a,qt as o}from"./dist-BTpttlbH.js";var s=e=>typeof e==`string`?e:null;function c(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function l(e,t){let n=c(e),r=c(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n[e]-r[e];if(t!==0)return t}return 0}function u(e,t){if(e===null||t===null)return!1;let n=l(t,e.min);return n!==null&&n>=0}function d(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,o=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=s(e.min),n=s(e.maxValidated);t!==null&&n!==null&&(o={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:o,validatedVersions:c}}function f(e,t,n){if(e===null)return`unknown`;let{range:r}=d(n,t);return u(r,e)?r!==null&&(l(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function p(n){return n===`supported`?t():n===`beyond`?i():e()}function m(e){return e??a()}function h(e,t){return t&&t!==`openclaw`?o({provider:t}):e===null?n():r({version:e})}function g(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{m as a,h as i,g as n,l as o,p as r,d as s,f as t};
@@ -1 +1 @@
1
- import{$d as e,Cf as t,Qd as n,Sf as r,Xd as i,Zd as a,_f as o,af as s,bf as c,cf as l,df as u,ef as d,ff as f,gf as p,hf as m,if as h,lf as g,mf as _,nf as v,of as y,pf as b,rf as x,sf as S,tf as C,uf as w,vf as T,wf as E,xf as D,yf as O}from"./dist-D8Kd0X5G.js";var k={AGENT_NOT_FOUND:()=>({label:E(),hint:t()}),AUTH_TOKEN_MISMATCH:()=>({label:r(),hint:D()}),DEVICE_SIGNING_FAILED:()=>({label:c(),hint:O()}),SESSION_SCOPE_DENIED:()=>({label:T(),hint:o()}),GATEWAY_TIMEOUT:()=>({label:p(),hint:m()}),GATEWAY_DISCONNECTED:()=>({label:_(),hint:b()}),ATTACHMENT_TOO_LARGE:()=>({label:w(),hint:g()}),ATTACHMENT_REJECTED:()=>({label:l(),hint:S()}),BRIDGE_UNREACHABLE:()=>({label:f(),hint:u()}),INVALID_REQUEST:()=>({label:y(),hint:s()}),NOT_CONFIGURED:()=>({label:h(),hint:x()}),UNROUTED:()=>({label:v(),hint:C()}),UPSTREAM_ERROR:()=>({label:d(),hint:e()}),UNKNOWN:()=>({label:n(),hint:a()})};function A(e){return e?k[e]?.()??{label:e,hint:i()}:k.UNKNOWN()}export{A as t};
1
+ import{$d as e,Cf as t,Qd as n,Sf as r,Xd as i,Zd as a,_f as o,af as s,bf as c,cf as l,df as u,ef as d,ff as f,gf as p,hf as m,if as h,lf as g,mf as _,nf as v,of as y,pf as b,rf as x,sf as S,tf as C,uf as w,vf as T,wf as E,xf as D,yf as O}from"./dist-BTpttlbH.js";var k={AGENT_NOT_FOUND:()=>({label:E(),hint:t()}),AUTH_TOKEN_MISMATCH:()=>({label:r(),hint:D()}),DEVICE_SIGNING_FAILED:()=>({label:c(),hint:O()}),SESSION_SCOPE_DENIED:()=>({label:T(),hint:o()}),GATEWAY_TIMEOUT:()=>({label:p(),hint:m()}),GATEWAY_DISCONNECTED:()=>({label:_(),hint:b()}),ATTACHMENT_TOO_LARGE:()=>({label:w(),hint:g()}),ATTACHMENT_REJECTED:()=>({label:l(),hint:S()}),BRIDGE_UNREACHABLE:()=>({label:f(),hint:u()}),INVALID_REQUEST:()=>({label:y(),hint:s()}),NOT_CONFIGURED:()=>({label:h(),hint:x()}),UNROUTED:()=>({label:v(),hint:C()}),UPSTREAM_ERROR:()=>({label:d(),hint:e()}),UNKNOWN:()=>({label:n(),hint:a()})};function A(e){return e?k[e]?.()??{label:e,hint:i()}:k.UNKNOWN()}export{A as t};