@lacneu/atrium 0.69.1 → 0.69.3

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 (85) hide show
  1. package/dist/assets/AccessTab-nOqXnNqd.js +1 -0
  2. package/dist/assets/{AdvancedFilter-B3seyYt-.js → AdvancedFilter-DalnKKbE.js} +1 -1
  3. package/dist/assets/AgentFilesTab-Dz1pqhpI.js +3 -0
  4. package/dist/assets/AnomaliesTab-Cpq-17Ix.js +1 -0
  5. package/dist/assets/{AuditTab-DhuJS60M.js → AuditTab-jQhjHz-F.js} +1 -1
  6. package/dist/assets/BridgeTab-B7X1qwdk.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-DpQZBBbZ.js +1 -0
  8. package/dist/assets/{DataTableShell-CgSphYFu.js → DataTableShell-CqU0-4M7.js} +1 -1
  9. package/dist/assets/{DetailChips-D3CrYO3c.js → DetailChips-DrJgW8-P.js} +1 -1
  10. package/dist/assets/FeedbacksTab-BWqtFYsM.js +1 -0
  11. package/dist/assets/{FieldLabel-Dt5eJKiD.js → FieldLabel-JybJ9RRM.js} +1 -1
  12. package/dist/assets/FilesTab-Bkj8zpxC.js +1 -0
  13. package/dist/assets/{FilterBar-I6E15DsP.js → FilterBar-B4i5RQ5h.js} +1 -1
  14. package/dist/assets/GroupsTab-CIkUWA6C.js +1 -0
  15. package/dist/assets/InstancesTab-Dbbu5JKt.js +1 -0
  16. package/dist/assets/IntegrationsTab-CSgNim1Y.js +1 -0
  17. package/dist/assets/{KpiTab-Cqfp8moM.js → KpiTab-BYdiUCW7.js} +1 -1
  18. package/dist/assets/PreferencesTab-BynMX7kx.js +1 -0
  19. package/dist/assets/ProjectPage-CrSQfAic.js +1 -0
  20. package/dist/assets/PromptInjectionsTab-GhxMEHYm.js +4 -0
  21. package/dist/assets/RolesTab-BJtxahDw.js +1 -0
  22. package/dist/assets/ScheduledTab-EtubzHoE.js +1 -0
  23. package/dist/assets/ServiceAccountsTab-D36fZOx2.js +1 -0
  24. package/dist/assets/SubAgentReportsTab-I5YZ1Jjr.js +1 -0
  25. package/dist/assets/ThemeShowroom-BeidaWln.js +1 -0
  26. package/dist/assets/TimeRangePicker-I8KZZSiJ.js +1 -0
  27. package/dist/assets/{TimezoneCombobox-ko6S60ZX.js → TimezoneCombobox-DuZNYkVA.js} +1 -1
  28. package/dist/assets/TracesTab-B3nkM0Pt.js +1 -0
  29. package/dist/assets/UsersTab-CffKSu3G.js +1 -0
  30. package/dist/assets/VoiceTab-vGLsZHre.js +1 -0
  31. package/dist/assets/api-Dv9KEyyu.js +44 -0
  32. package/dist/assets/{button-B_rxV4Hv.js → button-D9yXQ2Th.js} +1 -1
  33. package/dist/assets/{card-1R1vH3Wp.js → card-CwT7Pj_Y.js} +1 -1
  34. package/dist/assets/check-RMjSSPfa.js +1 -0
  35. package/dist/assets/chevron-up-NPxwzzmO.js +1 -0
  36. package/dist/assets/chevrons-up-down-DT1RCPP_.js +1 -0
  37. package/dist/assets/{compatView-Dg7wsTPK.js → compatView-5r10IMkT.js} +1 -1
  38. package/dist/assets/dispatchErrorInfo-Cqf1On-M.js +1 -0
  39. package/dist/assets/{dist-60cgSkkV.js → dist-1Isc78ze.js} +1 -1
  40. package/dist/assets/{dist-mHgdDBUV.js → dist-BaKVbU2X.js} +1 -1
  41. package/dist/assets/{dist-Bzknt9lC.js → dist-C0PHqVM0.js} +1 -1
  42. package/dist/assets/{highlighted-body-OFNGDK62-CsJyfjdy.js → highlighted-body-OFNGDK62-CB56Z3oc.js} +1 -1
  43. package/dist/assets/index-BAyOACwC.js +238 -0
  44. package/dist/assets/index-o45yUihd.css +1 -0
  45. package/dist/assets/{list-CJldmRo5.js → list-Cxi8aGjl.js} +1 -1
  46. package/dist/assets/mermaid-GHXKKRXX-Uu9pqaP0.js +1 -0
  47. package/dist/assets/{pdf-D-Us2R6E.js → pdf-DmlUy5B4.js} +1 -1
  48. package/dist/assets/roleDescriptions-DgcNSNlq.js +1 -0
  49. package/dist/assets/{table-C2BiIaq6.js → table-DCOgab8-.js} +1 -1
  50. package/dist/assets/{tabs-CJVl3r7X.js → tabs-Dv-cJfvQ.js} +1 -1
  51. package/dist/assets/x-C58t2mLG.js +1 -0
  52. package/dist/index.html +10 -10
  53. package/package.json +1 -1
  54. package/dist/assets/AccessTab-BrxEpjsr.js +0 -1
  55. package/dist/assets/AgentFilesTab-Cs8Nzz_I.js +0 -3
  56. package/dist/assets/AnomaliesTab-D6D6CYSk.js +0 -1
  57. package/dist/assets/BridgeTab-DnIaX4fN.js +0 -1
  58. package/dist/assets/ChatDefaultsTab-BnteHH3v.js +0 -1
  59. package/dist/assets/FeedbacksTab-CSsK5q9T.js +0 -1
  60. package/dist/assets/FilesTab-DRf2WHHd.js +0 -1
  61. package/dist/assets/GroupsTab-DdMjDK06.js +0 -1
  62. package/dist/assets/InstancesTab-s9iO39kt.js +0 -1
  63. package/dist/assets/IntegrationsTab-0BQN2eLD.js +0 -1
  64. package/dist/assets/PreferencesTab-iuWpDWjc.js +0 -1
  65. package/dist/assets/ProjectPage-CLKrB8ZU.js +0 -1
  66. package/dist/assets/PromptInjectionsTab-CV-LnDsD.js +0 -4
  67. package/dist/assets/RolesTab-BlEtFwR8.js +0 -1
  68. package/dist/assets/ScheduledTab-C_ijI98X.js +0 -1
  69. package/dist/assets/ServiceAccountsTab-0RaoKfJe.js +0 -1
  70. package/dist/assets/SubAgentReportsTab-wWGDafZX.js +0 -1
  71. package/dist/assets/ThemeShowroom-BMPThlV5.js +0 -1
  72. package/dist/assets/TimeRangePicker-CVMLr89E.js +0 -1
  73. package/dist/assets/TracesTab-BFLB5V7D.js +0 -1
  74. package/dist/assets/UsersTab-CBVfw_2T.js +0 -1
  75. package/dist/assets/VoiceTab-D55jFmxr.js +0 -1
  76. package/dist/assets/api-CbVyaw6f.js +0 -44
  77. package/dist/assets/check-DI-pspfc.js +0 -1
  78. package/dist/assets/chevron-up-D9LbKOmX.js +0 -1
  79. package/dist/assets/chevrons-up-down-huJFCk51.js +0 -1
  80. package/dist/assets/dispatchErrorInfo-sCqe0cBT.js +0 -1
  81. package/dist/assets/index-Dr-TdniH.css +0 -1
  82. package/dist/assets/index-EISUCtE9.js +0 -238
  83. package/dist/assets/mermaid-GHXKKRXX-C9ORYnsN.js +0 -1
  84. package/dist/assets/roleDescriptions-B4jROh9m.js +0 -1
  85. package/dist/assets/x-DniS1cpm.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$F as r,AF as i,AR as a,CF as o,CI as s,D as c,DF as l,DI as u,EF as ee,EI as te,FI as d,GF as f,HF as p,II as ne,IR as m,JF as re,KF as ie,MI as ae,MR as h,NI as oe,OF as se,OI as ce,PI as le,QF as g,SF as ue,SI as de,TF as fe,TI as pe,UF as me,VF as he,WF as ge,XF as _e,YF as ve,ZF as ye,_F as be,aL as xe,bF as Se,cF as Ce,cI as we,cL as Te,dI as Ee,dL as De,eI as _,eL as Oe,fI as ke,fL as Ae,gF as je,gI as Me,hF as Ne,hI as Pe,iL as Fe,jF as Ie,jI as Le,kF as Re,kI as v,lI as ze,lL as Be,mF as Ve,mI as He,mL as Ue,nI as We,nL as Ge,oL as Ke,pI as qe,pL as Je,qF as y,rL as Ye,sI as Xe,sL as Ze,t as b,tI as Qe,tL as $e,uI as et,uL as tt,vF as nt,vI as rt,wF as it,wI as at,xF as ot,xI as st,yF as ct,zR as lt}from"./api-Dv9KEyyu.js";import{t as ut}from"./list-Cxi8aGjl.js";import{t as x}from"./button-D9yXQ2Th.js";import{$ as dt,Bt as S,Dt as ft,Mn as C,Rt as w,X as pt,Y as mt,_t as T,at as ht,bn as gt,bt as E,cn as _t,dt as vt,et as yt,ft as bt,gt as xt,ht as St,in as Ct,it as wt,jn as D,jt as Tt,mn as Et,mt as Dt,nt as Ot,ot as kt,pn as At,pt as jt,rt as Mt,tn as Nt,tt as Pt,un as Ft,ut as O,vt as k,wt as It,xt as A,yt as j,zt as M}from"./index-BAyOACwC.js";import{a as Lt,i as N,n as Rt,o as zt,r as P,t as Bt}from"./table-DCOgab8-.js";import{t as Vt}from"./FilterBar-B4i5RQ5h.js";/* empty css */import{a as F,c as Ht,i as Ut,l as Wt,n as Gt,o as Kt,r as qt,s as I,t as Jt}from"./TimezoneCombobox-DuZNYkVA.js";var Yt=c(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Xt=c(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),L=t(e(),1),R=n();function z(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function Zt({value:e,onChange:t}){let n=Ht(e),i=(0,L.useMemo)(()=>new Date,[]),[a,o]=(0,L.useState)(()=>({year:n?.year??i.getFullYear(),month:n?.month??i.getMonth()})),[s,c]=(0,L.useState)(!1),l=(0,L.useMemo)(()=>z(h()),[]),u=(0,L.useMemo)(()=>new Intl.DateTimeFormat(h(),{month:`long`,year:`numeric`}),[]),ee=(0,L.useMemo)(()=>new Intl.DateTimeFormat(h(),{dateStyle:`medium`,timeStyle:`short`}),[]),te=I(a.year,a.month),d=n?.hour??9,f=n?.minute??0,p=(e,n,r,i,a)=>t(Wt(e,n,r,i,a)),ne=(e,t,n)=>{o({year:e,month:t}),p(e,t,n,d,f)},m=e=>{let t=new Date(a.year,a.month+e,1);o({year:t.getFullYear(),month:t.getMonth()})},re=n===null?Qe():ee.format(new Date(n.year,n.month,n.day,n.hour,n.minute));return(0,R.jsxs)(w,{modal:!0,open:s,onOpenChange:c,children:[(0,R.jsx)(S,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,className:`oc-dtp__trigger`,"aria-label":We(),children:[(0,R.jsx)(Yt,{size:14,"aria-hidden":!0,className:`oc-dtp__icon`}),(0,R.jsx)(`span`,{className:n===null?`oc-dtp__placeholder`:void 0,children:re})]})}),(0,R.jsxs)(M,{align:`start`,className:`oc-dtp__pop`,children:[(0,R.jsxs)(`div`,{className:`oc-dtp__head`,children:[(0,R.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":_(),onClick:()=>m(-1),children:(0,R.jsx)(C,{size:15,"aria-hidden":!0})}),(0,R.jsx)(`span`,{className:`oc-dtp__month`,children:u.format(new Date(a.year,a.month,1))}),(0,R.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":r(),onClick:()=>m(1),children:(0,R.jsx)(D,{size:15,"aria-hidden":!0})})]}),(0,R.jsxs)(`div`,{className:`oc-dtp__grid`,children:[l.map((e,t)=>(0,R.jsx)(`span`,{className:`oc-dtp__wd`,children:e},t)),te.map((e,t)=>{let r=n!==null&&n.year===e.year&&n.month===e.month&&n.day===e.day,a=i.getFullYear()===e.year&&i.getMonth()===e.month&&i.getDate()===e.day;return(0,R.jsx)(`button`,{type:`button`,className:`oc-dtp__day`+(e.inMonth?``:` oc-dtp__day--out`)+(r?` oc-dtp__day--sel`:``)+(a&&!r?` oc-dtp__day--today`:``),onClick:()=>ne(e.year,e.month,e.day),children:e.day},t)})]}),(0,R.jsxs)(`div`,{className:`oc-dtp__time`,children:[(0,R.jsxs)(T,{value:String(d),onValueChange:e=>p(a.year,a.month,n?.day??i.getDate(),Number(e),f),children:[(0,R.jsx)(E,{size:`sm`,"aria-label":g(),children:(0,R.jsx)(A,{})}),(0,R.jsx)(k,{className:`oc-dtp__timeopts`,children:Array.from({length:24},(e,t)=>(0,R.jsx)(j,{value:String(t),children:String(t).padStart(2,`0`)},t))})]}),(0,R.jsx)(`span`,{className:`oc-dtp__colon`,children:`:`}),(0,R.jsxs)(T,{value:String(f),onValueChange:e=>p(a.year,a.month,n?.day??i.getDate(),d,Number(e)),children:[(0,R.jsx)(E,{size:`sm`,"aria-label":ye(),children:(0,R.jsx)(A,{})}),(0,R.jsx)(k,{className:`oc-dtp__timeopts`,children:Array.from({length:60},(e,t)=>(0,R.jsx)(j,{value:String(t),children:String(t).padStart(2,`0`)},t))})]})]})]})]})}function B(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function Qt(e,t,n){let r=e=>String(e).padStart(2,`0`);return`${e}-${r(t+1)}-${r(n)}`}function $t(e){let t=new Map;for(let n of e){let e=B(n.atMs),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}for(let e of t.values())e.sort((e,t)=>e.atMs-t.atMs);return t}function V(e,t,n){let r=new Map,i=new Date(t,n+1,0).getDate();for(let a=1;a<=i;a++){let i=e.get(Qt(t,n,a));i!==void 0&&i.length>0&&r.set(a,i.length)}return r}function en(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function tn(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()+42);return{startMs:r.getTime(),endMs:i.getTime()}}function nn(e){return{startMs:new Date(e,0,1).getTime(),endMs:new Date(e+1,0,1).getTime()}}var H=3;function rn({events:e,mode:t,cursor:n,onModeChange:r,onCursorChange:i,onEventClick:a,footnote:o}){let s=h(),c=(0,L.useMemo)(()=>$t(e),[e]),l=(0,L.useMemo)(()=>en(s),[s]),u=(0,L.useMemo)(()=>new Intl.DateTimeFormat(s,{month:`long`,year:`numeric`}),[s]),ee=(0,L.useMemo)(()=>new Intl.DateTimeFormat(s,{month:`long`}),[s]),te=(0,L.useMemo)(()=>new Intl.DateTimeFormat(s,{hour:`2-digit`,minute:`2-digit`}),[s]),d=new Date,p=e=>{if(t===`year`){i({year:n.year+e,month:n.month});return}let r=new Date(n.year,n.month+e,1);i({year:r.getFullYear(),month:r.getMonth()})},ne=t===`year`?String(n.year):u.format(new Date(n.year,n.month,1));return(0,R.jsxs)(`div`,{className:`oc-cal`,children:[(0,R.jsxs)(`div`,{className:`oc-cal__head`,children:[(0,R.jsxs)(`div`,{className:`oc-cal__nav`,children:[(0,R.jsx)(x,{variant:`ghost`,size:`icon-sm`,"aria-label":ge(),onClick:()=>p(-1),children:(0,R.jsx)(C,{})}),(0,R.jsx)(x,{variant:`ghost`,size:`icon-sm`,"aria-label":me(),onClick:()=>p(1),children:(0,R.jsx)(D,{})}),(0,R.jsx)(x,{variant:`ghost`,size:`sm`,onClick:()=>i({year:d.getFullYear(),month:d.getMonth()}),children:f()})]}),(0,R.jsx)(`span`,{className:`oc-cal__title`,children:ne}),(0,R.jsxs)(`div`,{className:`oc-cal__modes`,role:`group`,children:[(0,R.jsx)(x,{variant:t===`month`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`month`,onClick:()=>r(`month`),children:y()}),(0,R.jsx)(x,{variant:t===`year`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`year`,onClick:()=>r(`year`),children:ie()})]})]}),t===`month`?(0,R.jsx)(an,{cursor:n,byDay:c,weekdays:l,timeFmt:te,now:d,onEventClick:a}):(0,R.jsx)(on,{year:n.year,byDay:c,monthShortFmt:ee,now:d,onOpenMonth:e=>{i({year:n.year,month:e}),r(`month`)}}),o?(0,R.jsx)(`p`,{className:`oc-cal__footnote`,children:o}):null]})}function an({cursor:e,byDay:t,weekdays:n,timeFmt:r,now:i,onEventClick:a}){let o=I(e.year,e.month);return(0,R.jsxs)(`div`,{className:`oc-cal__month`,children:[n.map((e,t)=>(0,R.jsx)(`span`,{className:`oc-cal__wd`,children:e},t)),o.map((e,n)=>{let o=t.get(Qt(e.year,e.month,e.day))??[],s=i.getFullYear()===e.year&&i.getMonth()===e.month&&i.getDate()===e.day;return(0,R.jsxs)(`div`,{className:`oc-cal__day`+(e.inMonth?``:` oc-cal__day--out`)+(s?` oc-cal__day--today`:``),children:[(0,R.jsx)(`span`,{className:`oc-cal__daynum`,children:e.day}),o.slice(0,H).map(e=>(0,R.jsxs)(`button`,{type:`button`,className:`oc-cal__event`+(e.muted?` oc-cal__event--muted`:``)+(e.exact?` oc-cal__event--exact`:``),style:e.color?{"--cal-ev":e.color}:void 0,title:`${r.format(e.atMs)} ${e.title}`,onClick:a?()=>a(e):void 0,children:[(0,R.jsx)(`span`,{className:`oc-cal__evdot`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`oc-cal__evtime`,children:r.format(e.atMs)}),(0,R.jsx)(`span`,{className:`oc-cal__evtitle`,children:e.title})]},e.id)),o.length>H?(0,R.jsx)(`span`,{className:`oc-cal__more`,children:p({count:o.length-H})}):null]},n)})]})}function on({year:e,byDay:t,monthShortFmt:n,now:r,onOpenMonth:i}){return(0,R.jsx)(`div`,{className:`oc-cal__year`,children:Array.from({length:12},(a,o)=>{let s=V(t,e,o),c=I(e,o);return(0,R.jsxs)(`button`,{type:`button`,className:`oc-cal__mini`,onClick:()=>i(o),children:[(0,R.jsx)(`span`,{className:`oc-cal__mininame`,children:n.format(new Date(e,o,1))}),(0,R.jsx)(`span`,{className:`oc-cal__minigrid`,"aria-hidden":!0,children:c.map((e,t)=>{let n=e.inMonth?s.get(e.day)??0:0,i=e.inMonth&&r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,R.jsx)(`span`,{className:`oc-cal__minidot`+(e.inMonth?``:` is-out`)+(n===1?` has-one`:``)+(n>1?` has-many`:``)+(i?` is-today`:``)},t)})})]},o)})})}var U={h:36e5,min:6e4,s:1e3,ms:1};function sn(e){if(e===null)return null;let t=e.trim(),n=/^every\s+(\d+(?:\.\d+)?)(h|min|s|ms)$/.exec(t);if(n!==null){let e=Number(n[1])*U[n[2]];return Number.isFinite(e)&&e>0?{kind:`every`,everyMs:e}:null}let r=/^(?:cron\s+)?([\d*,/-]+(?:\s+[\d*,/-]+){4})(?:\s*\(([^)]+)\))?$/.exec(t);if(r!==null)return{kind:`cron`,expr:r[1],tz:r[2]??null};let i=Date.parse(t);return Number.isFinite(i)?{kind:`at`,atMs:i}:null}function W(e,t,n){let r=new Set;for(let i of e.split(`,`)){let e=i,a=1,o=/^(.+)\/(\d{1,3})$/.exec(i);if(o!==null&&(e=o[1],a=Number(o[2]),a<1))return null;let s,c;if(e===`*`)s=t,c=n;else{let r=/^(\d{1,3})(?:-(\d{1,3}))?$/.exec(e);if(r===null||(s=Number(r[1]),c=r[2]===void 0?s:Number(r[2]),r[2]===void 0&&o!==null&&(c=n),s<t||c>n||s>c))return null}for(let e=s;e<=c;e+=a)r.add(e)}return r.size>0?[...r].sort((e,t)=>e-t):null}function G(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let n=W(t[0],0,59),r=W(t[1],0,23),i=W(t[2],1,31),a=W(t[3],1,12),o=W(t[4],0,7);if(!n||!r||!i||!a||!o)return null;let s=new Set(o.map(e=>e%7));return{minutes:n,hours:r,dom:new Set(i),months:new Set(a),dow:s,domRestricted:t[2]!==`*`,dowRestricted:t[4]!==`*`}}var K=new Map;function q(e){let t=K.get(e);if(t!==void 0)return t;let n=null;try{n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{n=null}return K.set(e,n),n}function J(e,t){if(t!==null){let n=q(t);if(n!==null){let t={};for(let r of n.formatToParts(e))r.type!==`literal`&&(t[r.type]=Number(r.value));return{y:t.year,mo:t.month-1,d:t.day,h:t.hour===24?0:t.hour,mi:t.minute}}}let n=new Date(e);return{y:n.getFullYear(),mo:n.getMonth(),d:n.getDate(),h:n.getHours(),mi:n.getMinutes()}}function Y(e,t,n,r,i,a){if(a===null||q(a)===null)return new Date(e,t,n,r,i).getTime();let o=Date.UTC(e,t,n,r,i),s=e=>{let t=J(e,a);return Date.UTC(t.y,t.mo,t.d,t.h,t.mi)-e},c=s(o),l=o-c,u=s(l);return u!==c&&(l=o-u),l}function X(e,t,n,r){let i=new Map,a=(e,t)=>{e<n||e>=r||i.set(e,t||(i.get(e)??!1))};if(e?.kind===`at`)a(e.atMs,!0);else if(e?.kind===`every`){if(t!==null){let i=e.everyMs,o=Math.ceil((n-t)/i);for(let e=t+o*i,n=0;e<r&&n<400;e+=i,n++)a(e,e===t)}}else if(e?.kind===`cron`){let t=G(e.expr);if(t!==null&&t.hours.length*t.minutes.length<=400){let i=0,o=n-864e5;for(;o<r+864e5&&i<400;){let s=J(o,e.tz);if(t.months.has(s.mo+1)){let o=new Date(Date.UTC(s.y,s.mo,s.d)).getUTCDay(),c=t.dom.has(s.d),l=t.dow.has(o);if(t.domRestricted&&t.dowRestricted?c||l:c&&l)for(let o of t.hours)for(let c of t.minutes){if(i>=400)break;let t=Y(s.y,s.mo,s.d,o,c,e.tz);t>=n&&t<r&&(a(t,!1),i++)}}o=Y(s.y,s.mo,s.d,12,0,e.tz)+864e5}}}return t!==null&&a(t,!0),[...i.entries()].map(([e,t])=>({atMs:e,exact:t})).sort((e,t)=>e.atMs-t.atMs).slice(0,400)}var Z=`crons`;function cn(e,t){return`${e}\u0000${t}`}function ln(e,t,n){let r=[],i=new Map;for(let a of e){let{job:e}=a;if(e.id===null)continue;let o=cn(a.instanceName,e.id);i.set(o,a);let s=X(e.enabled===!1?null:sn(e.schedule),e.nextRunAtMs,t,n);for(let t of s)r.push({id:`${o}:${t.atMs}`,sourceId:Z,itemId:o,atMs:t.atMs,title:e.name??e.id,muted:e.enabled===!1,exact:t.exact})}return{events:r,byItemId:i}}var Q={minutes:6e4,hours:36e5,days:864e5};function $(e){return e?.data?.code??`unknown`}function un({status:e}){switch(F(e)){case`ok`:return(0,R.jsx)(O,{variant:`secondary`,children:Pe()});case`error`:return(0,R.jsx)(O,{variant:`destructive`,children:qe()});case`running`:return(0,R.jsx)(O,{variant:`outline`,children:ke()});case`other`:return(0,R.jsx)(O,{variant:`outline`,children:e});case`none`:return(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}}function dn(){let e=m(b.scheduled.listMyCrons),t=m(b.scheduled.getCronDetail),n=m(b.scheduled.listCronRuns),r=m(b.scheduled.updateCron),c=m(b.scheduled.removeCron),f=m(b.scheduled.runCronNow),p=ft(),ie=lt(b.me.getMe,{host:It})?.timezone,[g,me]=(0,L.useState)(null),[ge,ye]=(0,L.useState)(!1),[_,We]=(0,L.useState)(!1),[y,Qe]=(0,L.useState)(null),[S,C]=(0,L.useState)(null),[w,D]=(0,L.useState)(null),[M,F]=(0,L.useState)(null),[Ht,Wt]=(0,L.useState)(!1),[I,z]=(0,L.useState)(Gt),[B,Qt]=(0,L.useState)(()=>new URLSearchParams(window.location.search).get(`job`)===null&&localStorage.getItem(`oc.sched.view`)===`calendar`?`calendar`:`list`),$t=e=>{localStorage.setItem(`oc.sched.view`,e),Qt(e)},[V,en]=(0,L.useState)(`month`),[H,an]=(0,L.useState)(()=>{let e=new Date;return{year:e.getFullYear(),month:e.getMonth()}}),on=(0,L.useMemo)(()=>{let e=[];for(let t of g??[]){if(!t.supported||t.error!==null)continue;let n=t.kind===`openclaw`&&t.manageSupported;for(let r of t.jobs)Ut(r,I)&&e.push({instanceName:t.instanceName,canEdit:n,job:r})}return e},[g,I]),U=(0,L.useMemo)(()=>V===`year`?nn(H.year):tn(H.year,H.month),[V,H]),sn=(0,L.useMemo)(()=>ln(on,U.startMs,U.endMs),[on,U]),W=e=>{let t=sn.byItemId.get(e.itemId);t===void 0||!t.canEdit||t.job.id===null||dn(t.instanceName,t.job)},G=(0,L.useCallback)(async()=>{ye(!0),We(!1);try{me(await e({}))}catch{We(!0)}finally{ye(!1)}},[e]);(0,L.useEffect)(()=>{G()},[G]);let K=(0,L.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),q=(0,L.useRef)(null);(0,L.useEffect)(()=>{g!==null&&q.current!==null&&q.current.scrollIntoView({block:`center`})},[g]);let J=(0,L.useMemo)(()=>new Intl.DateTimeFormat(h(),{dateStyle:`medium`,timeStyle:`short`}),[]),Y=async(e,t,n)=>{Qe(e);try{await t(),p.success(n),await G()}catch(e){p.toast({variant:`error`,title:v({code:$(e)})})}finally{Qe(null)}},X=(0,L.useRef)(0),Z=(0,L.useRef)(0),cn=async(e,t)=>{if(t.id===null)return;let r=++X.current;D({name:t.name??t.id,entries:null});try{let i=await n({instanceName:e,jobId:t.id,limit:20});if(r!==X.current)return;D({name:t.name??t.id,entries:i})}catch(e){if(r!==X.current)return;D(null),p.toast({variant:`error`,title:v({code:$(e)})})}},dn=async(e,n)=>{if(n.id===null)return;let r=++Z.current;F({instanceName:e,jobId:n.id,loading:!0,name:n.name??``,scheduleKind:`cron`,cronExpr:``,tz:``,everyValue:`1`,everyUnit:`hours`,at:``,message:``,hasMessage:!1,scheduleDirty:!1,messageDirty:!1,nameDirty:!1});try{let i=(await t({instanceName:e,jobId:n.id})).job,a=i.scheduleKind===`every`||i.scheduleKind===`at`?i.scheduleKind:`cron`,o=``;if(a===`at`&&i.scheduleExpr!==null){let e=Date.parse(i.scheduleExpr);Number.isFinite(e)&&(o=new Date(e-new Date(e).getTimezoneOffset()*6e4).toISOString().slice(0,16))}let s=`1`,c=`hours`;if(a===`every`&&i.scheduleExpr!==null){let e=Number(i.scheduleExpr);Number.isFinite(e)&&e>0&&(e%Q.days===0?(s=String(e/Q.days),c=`days`):e%Q.hours===0?(s=String(e/Q.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/Q.minutes))),c=`minutes`))}if(r!==Z.current)return;F(e=>e===null||e.jobId!==n.id?e:{...e,loading:!1,name:i.name??e.name,scheduleKind:a,cronExpr:a===`cron`?i.scheduleExpr??``:``,tz:i.tz??``,everyValue:s,everyUnit:c,at:o,message:i.message??``,hasMessage:i.message!==null&&!i.messageTruncated})}catch(e){if(r!==Z.current)return;F(null),p.toast({variant:`error`,title:v({code:$(e)})})}},fn=async()=>{if(M===null)return;let e={};if(M.nameDirty&&M.name.trim()===``||M.messageDirty&&M.hasMessage&&M.message.trim()===``){p.toast({variant:`error`,title:Ve()});return}if(M.nameDirty&&M.name.trim()!==``&&(e.name=M.name.trim()),M.scheduleDirty){if(M.scheduleKind===`cron`&&M.cronExpr.trim()!==``)e.schedule={kind:`cron`,expr:M.cronExpr.trim(),...M.tz.trim()===``?{}:{tz:M.tz.trim()}};else if(M.scheduleKind===`every`){let t=Number(M.everyValue);Number.isFinite(t)&&t>=1&&(e.schedule={kind:`every`,everyMs:Math.round(t*Q[M.everyUnit])})}else if(M.scheduleKind===`at`&&M.at!==``){let t=Date.parse(M.at);Number.isFinite(t)&&(e.schedule={kind:`at`,at:new Date(t).toISOString()})}}if(M.scheduleDirty&&e.schedule===void 0){p.toast({variant:`error`,title:Ne()});return}if(M.messageDirty&&M.hasMessage&&M.message.trim()!==``&&(e.message=M.message.trim()),Object.keys(e).length===0){F(null);return}let t=Z.current;Wt(!0);try{await r({instanceName:M.instanceName,jobId:M.jobId,patch:e}),p.success(se()),t===Z.current&&F(null),await G()}catch(e){p.toast({variant:`error`,title:v({code:$(e)})})}finally{Wt(!1)}},pn=g?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,R.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:Ue()}),(0,R.jsxs)(`div`,{className:`oc-sched__viewtoggle`,role:`group`,"aria-label":_e(),children:[(0,R.jsx)(x,{variant:B===`list`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":ve(),title:ve(),"aria-pressed":B===`list`,onClick:()=>$t(`list`),children:(0,R.jsx)(ut,{})}),(0,R.jsx)(x,{variant:B===`calendar`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":re(),title:re(),"aria-pressed":B===`calendar`,onClick:()=>$t(`calendar`),children:(0,R.jsx)(Yt,{})})]}),(0,R.jsxs)(x,{variant:`ghost`,size:`sm`,onClick:()=>void G(),disabled:ge,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,R.jsx)(_t,{size:14,"aria-hidden":!0}),Je()]})]}),g!==null&&pn>0?(0,R.jsxs)(Vt,{q:I.q,onQChange:e=>z(t=>({...t,q:e})),searchPlaceholder:et(),onReset:()=>z(Gt),canReset:qt(I),children:[(0,R.jsxs)(T,{value:I.state,onValueChange:e=>z(t=>({...t,state:e})),children:[(0,R.jsx)(E,{size:`sm`,className:`w-40`,children:(0,R.jsx)(A,{})}),(0,R.jsxs)(k,{children:[(0,R.jsx)(j,{value:`all`,children:ze()}),(0,R.jsx)(j,{value:`active`,children:Oe()}),(0,R.jsx)(j,{value:`paused`,children:$e()})]})]}),(0,R.jsxs)(T,{value:I.result,onValueChange:e=>z(t=>({...t,result:e})),children:[(0,R.jsx)(E,{size:`sm`,className:`w-40`,children:(0,R.jsx)(A,{})}),(0,R.jsxs)(k,{children:[(0,R.jsx)(j,{value:`all`,children:we()}),(0,R.jsx)(j,{value:`ok`,children:Pe()}),(0,R.jsx)(j,{value:`error`,children:qe()}),(0,R.jsx)(j,{value:`running`,children:ke()}),(0,R.jsx)(j,{value:`none`,children:Ee()})]})]})]}):null,g===null?(0,R.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":ge,children:_?Ae():a()}):B===`calendar`?(0,R.jsxs)(R.Fragment,{children:[_?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:Ae()}):null,g.length===0?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:De()}):(0,R.jsx)(rn,{events:sn.events,mode:V,cursor:H,onModeChange:en,onCursorChange:an,onEventClick:W,footnote:he()})]}):(0,R.jsxs)(R.Fragment,{children:[_?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:Ae()}):null,g.length===0?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:De()}):null,g.map(e=>{let t=e.jobs.filter(e=>Ut(e,I)),n=qt(I)&&e.jobs.length>0&&t.length===0;return(0,R.jsxs)(`section`,{style:{marginBottom:20},children:[g.length>1||e.error||!e.supported?(0,R.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,R.jsx)(O,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:Be({code:e.error})}):e.jobs.length===0?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:Te()}):n?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:Xe()}):(0,R.jsxs)(Bt,{children:[(0,R.jsx)(Lt,{children:(0,R.jsxs)(zt,{children:[(0,R.jsx)(N,{children:Ze()}),(0,R.jsx)(N,{children:Ke()}),(0,R.jsx)(N,{children:xe()}),(0,R.jsx)(N,{children:Fe()}),(0,R.jsx)(N,{children:Ye()}),(0,R.jsx)(N,{children:Me()}),(0,R.jsx)(N,{children:Ie()})]})}),(0,R.jsx)(Rt,{children:t.map((t,n)=>{let a=`${e.instanceName}:${t.id??n}`,o=y===a,s=e.manageSupported,c=e.kind===`openclaw`&&s;return(0,R.jsxs)(zt,{ref:t.id!==null&&t.id===K?q:void 0,"data-state":t.id!==null&&t.id===K?`selected`:void 0,children:[(0,R.jsx)(P,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??Ge()}),(0,R.jsx)(P,{children:(0,R.jsx)(O,{variant:`secondary`,children:t.agentId})}),(0,R.jsxs)(P,{className:`whitespace-nowrap`,children:[(0,R.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=mt(t.schedule),n=e===null?null:pt(e);return n===null?null:(0,R.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,R.jsx)(P,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:J.format(t.nextRunAtMs)}),(0,R.jsx)(P,{children:Kt(t.enabled)===`active`?(0,R.jsx)(O,{variant:`secondary`,children:Oe()}):Kt(t.enabled)===`paused`?(0,R.jsx)(O,{variant:`outline`,children:$e()}):(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,R.jsxs)(P,{children:[(0,R.jsx)(un,{status:t.lastRunStatus}),t.lastDelivered===!1?(0,R.jsx)(O,{variant:`destructive`,title:t.lastDeliveryError??ne(),children:He()}):null]}),(0,R.jsx)(P,{className:`whitespace-nowrap`,children:t.id===null?(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):o?(0,R.jsx)(gt,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,R.jsxs)(`span`,{className:`oc-cronactions`,children:[c?(0,R.jsx)(x,{variant:`ghost`,size:`icon-sm`,title:le(),"aria-label":le(),disabled:y!==null,onClick:()=>void Y(a,async()=>{let n=await f({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},ce()),children:(0,R.jsx)(Nt,{size:14,"aria-hidden":!0})}):null,c&&t.enabled!==null?(0,R.jsx)(x,{variant:`ghost`,size:`icon-sm`,title:t.enabled?oe():ae(),"aria-label":t.enabled?oe():ae(),disabled:y!==null,onClick:()=>void Y(a,()=>r({instanceName:e.instanceName,jobId:t.id,patch:{enabled:!t.enabled}}),t.enabled?u():te()),children:t.enabled?(0,R.jsx)(Et,{size:14,"aria-hidden":!0}):(0,R.jsx)(Ft,{size:14,"aria-hidden":!0})}):null,c?(0,R.jsx)(x,{variant:`ghost`,size:`icon-sm`,title:i(),"aria-label":i(),disabled:y!==null,onClick:()=>void dn(e.instanceName,t),children:(0,R.jsx)(At,{size:14,"aria-hidden":!0})}):null,c?(0,R.jsx)(x,{variant:`ghost`,size:`icon-sm`,title:Re(),"aria-label":Re(),disabled:y!==null,onClick:()=>void cn(e.instanceName,t),children:(0,R.jsx)(Xt,{size:14,"aria-hidden":!0})}):null,s?(0,R.jsx)(x,{variant:`ghost`,size:`icon-sm`,title:Le(),"aria-label":Le(),disabled:y!==null,onClick:()=>C({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,R.jsx)(Ct,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:tt()})]},e.instanceName)}),pn>0?(0,R.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:Ce()}):null]}),(0,R.jsx)(dt,{open:S!==null,onOpenChange:e=>{e||C(null)},children:(0,R.jsxs)(Ot,{children:[(0,R.jsxs)(ht,{children:[(0,R.jsx)(kt,{children:at()}),(0,R.jsx)(Mt,{children:s({name:S?.name??``})})]}),(0,R.jsxs)(wt,{children:[(0,R.jsx)(Pt,{children:de()}),(0,R.jsx)(yt,{onClick:()=>{let e=S;C(null),e!==null&&Y(`${e.instanceName}:${e.jobId}`,()=>c({instanceName:e.instanceName,jobId:e.jobId}),pe())},children:st()})]})]})}),(0,R.jsx)(vt,{open:w!==null,onOpenChange:e=>{e||(X.current++,D(null))},children:(0,R.jsxs)(bt,{style:{maxWidth:640},children:[(0,R.jsx)(St,{children:(0,R.jsx)(xt,{children:l({name:w?.name??``})})}),w?.entries===null?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):w!==null&&w.entries.length===0?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:ee()}):w===null?null:(0,R.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:w.entries.map((e,t)=>(0,R.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,R.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[(0,R.jsx)(un,{status:e.status}),(0,R.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?J.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,R.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,R.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,R.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error}),e.delivered===!1?(0,R.jsxs)(`div`,{className:`oc-cronpanel__run-undelivered`,children:[rt({channel:e.deliveryChannel??`—`}),e.deliveryError===null?null:(0,R.jsx)(`span`,{className:`oc-cronpanel__plain`,children:e.deliveryError})]}):null]},t))})]})}),(0,R.jsx)(vt,{open:M!==null,onOpenChange:e=>{e||(Z.current++,F(null))},children:(0,R.jsxs)(bt,{className:`oc-cronedit`,children:[(0,R.jsxs)(St,{children:[(0,R.jsx)(xt,{children:fe()}),(0,R.jsx)(jt,{children:it()})]}),M===null?null:M.loading?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,R.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,R.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Ze()}),(0,R.jsx)(Tt,{value:M.name,maxLength:200,onChange:e=>F({...M,name:e.target.value,nameDirty:!0})})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,R.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:o()}),(0,R.jsxs)(T,{value:M.scheduleKind,onValueChange:e=>F({...M,scheduleKind:e,scheduleDirty:!0}),children:[(0,R.jsx)(E,{children:(0,R.jsx)(A,{})}),(0,R.jsxs)(k,{children:[(0,R.jsx)(j,{value:`cron`,children:ue()}),(0,R.jsx)(j,{value:`every`,children:ot()}),(0,R.jsx)(j,{value:`at`,children:Se()})]})]}),M.scheduleKind===`cron`?(0,R.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,R.jsx)(Tt,{value:M.cronExpr,onChange:e=>F({...M,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,R.jsx)(Jt,{value:M.tz,onChange:e=>F({...M,tz:e,scheduleDirty:!0}),fallbackTz:ie??void 0})]}):M.scheduleKind===`every`?(0,R.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,R.jsx)(Tt,{type:`number`,min:1,value:M.everyValue,onChange:e=>F({...M,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,R.jsxs)(T,{value:M.everyUnit,onValueChange:e=>F({...M,everyUnit:e,scheduleDirty:!0}),children:[(0,R.jsx)(E,{style:{maxWidth:160},children:(0,R.jsx)(A,{})}),(0,R.jsxs)(k,{children:[(0,R.jsx)(j,{value:`minutes`,children:ct()}),(0,R.jsx)(j,{value:`hours`,children:nt()}),(0,R.jsx)(j,{value:`days`,children:be()})]})]})]}):(0,R.jsx)(Zt,{value:M.at,onChange:e=>F({...M,at:e,scheduleDirty:!0})})]}),M.hasMessage?(0,R.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,R.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:d()}),(0,R.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:M.message,onChange:e=>F({...M,message:e.target.value,messageDirty:!0})})]}):null]}),(0,R.jsxs)(Dt,{children:[(0,R.jsx)(x,{variant:`ghost`,onClick:()=>F(null),children:de()}),(0,R.jsxs)(x,{onClick:()=>void fn(),disabled:M===null||M.loading||Ht,children:[Ht?(0,R.jsx)(gt,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,je()]})]})]})})]})}export{dn as ScheduledTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$j as r,AM as i,Aj as a,BM as ee,Bj as o,CM as te,DM as ne,EM as re,FM as ie,Fj as s,GM as ae,Gj as c,HM as oe,Hj as l,IM as se,IR as ce,Ij as u,JM as le,Jj as d,KM as ue,Kj as f,LM as de,Lj as p,MM as fe,Mj as m,NM as pe,Nj as me,OM as he,PM as ge,Pj as _e,Qj as ve,RM as ye,RR as h,Rj as g,SM as be,TM as xe,UM as Se,Uj as _,VM as Ce,Vj as v,WM as y,Wj as b,Xj as x,YM as we,Yj as S,Zj as C,_M as Te,aM as Ee,bM as De,cM as Oe,dM as ke,eM as Ae,fM as je,gM as Me,hM as Ne,iM as Pe,jM as Fe,jj as w,kM as Ie,kj as T,lM as Le,mM as Re,nM as ze,oM as Be,pM as Ve,qM as He,qj as E,rM as Ue,sM as We,t as D,tM as Ge,uM as Ke,vM as qe,wM as Je,xM as Ye,yM as Xe,zM as Ze,zR as O,zj as k}from"./api-Dv9KEyyu.js";import{t as A}from"./check-RMjSSPfa.js";import{r as Qe}from"./dist-BaKVbU2X.js";import{t as j}from"./button-D9yXQ2Th.js";import{Dt as $e,Fn as et,On as M,Pn as tt,Z as nt,_ as rt,_t as N,bt as P,ct as F,dt as I,ft as L,gt as R,ht as z,jn as it,jt as B,mt as at,pt as ot,st as V,ut as H,vt as U,xt as W,yt as G}from"./index-BAyOACwC.js";import{t as st}from"./FilterBar-B4i5RQ5h.js";import{t as ct}from"./DataTableShell-CqU0-4M7.js";import{t as lt}from"./roleDescriptions-DgcNSNlq.js";var K=t(e(),1),q=n(),J=[{value:`never`,label:()=>s(),days:null},{value:`30`,label:()=>_e(),days:30},{value:`90`,label:()=>me(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=et({from:`/settings/serviceAccounts`}),t=tt({from:`/settings/serviceAccounts`}),n=e.q??``,a=e.status??X,[o,s]=(0,K.useState)(X),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),u=O(D.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===X?void 0:o,disabled:a===X?void 0:a===`disabled`}}),d=O(D.apiKeys.listKeys,{}),f=O(D.apiKeys.listRoles,{}),p=h(D.apiKeys.createServiceAccount),m=h(D.apiKeys.updateServiceAccount),me=h(D.apiKeys.deleteServiceAccount),_e=ce(D.apiKeys.mintApiKey),ve=h(D.apiKeys.revokeApiKey),g=nt(),_=$e(),v=n!==``||o!==X||a!==X;function b(){s(X),t({search:{},replace:!0})}let[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(Z),[T,E]=(0,K.useState)(null),[k,A]=(0,K.useState)(new Set),[M,F]=(0,K.useState)(null),I=(0,K.useRef)(!1),[L,R]=(0,K.useState)(new Set),[z,at]=(0,K.useState)({}),[ot,V]=(0,K.useState)(null),Y=(0,K.useMemo)(()=>{let e=new Map;for(let t of d??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[d]);function Q(e){A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{T?(await m({serviceAccountId:T,name:C.name,roleKey:C.roleKey,description:C.description}),_.success(Ve())):await p({name:C.name,roleKey:C.roleKey,description:C.description||void 0}),w(Z),E(null),S(!1)}catch(e){_.error(T?Re():Ne(),e)}}function pt(e){w({name:e.name,roleKey:e.roleKey,description:e.description??``}),E(e._id),S(!0)}async function mt(e){if(I.current)return;I.current=!0;let t=z[e._id]??`never`,n=J.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;F(e._id);try{let t=await _e({serviceAccountId:e._id,expiresAt:r});V({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){_.error(je(),e)}finally{I.current=!1,F(null)}}async function $(e){if(await g({title:ke(),description:(0,q.jsxs)(q.Fragment,{children:[Ke(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Le(),` `,(0,q.jsx)(`strong`,{children:Oe()}),` `,We()]}),confirmWord:e.name,confirmLabel:Be(),destructive:!0}))try{await me({serviceAccountId:e._id}),_.success(Ee(),e.name)}catch(e){_.error(Pe(),e)}}async function ht(e){if(await g({title:Ue(),description:(0,q.jsxs)(q.Fragment,{children:[ze(),` `,(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Ge()]}),confirmLabel:Ae(),destructive:!0})&&!L.has(e._id)){R(t=>new Set(t).add(e._id));try{await ve({keyId:e._id})}catch(e){_.error(r(),e)}finally{R(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:we()}),(0,q.jsxs)(st,{q:n,onQChange:c,searchPlaceholder:le(),onReset:b,canReset:v,children:[(0,q.jsxs)(N,{value:o,onValueChange:s,children:[(0,q.jsx)(P,{size:`sm`,className:`w-40`,children:(0,q.jsx)(W,{placeholder:He()})}),(0,q.jsxs)(U,{children:[(0,q.jsx)(G,{value:X,children:ue()}),(f??[]).map(e=>(0,q.jsx)(G,{value:e.key,children:e.key},e._id))]})]}),(0,q.jsxs)(N,{value:a,onValueChange:l,children:[(0,q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,q.jsx)(W,{})}),(0,q.jsxs)(U,{children:[(0,q.jsx)(G,{value:X,children:ae()}),(0,q.jsx)(G,{value:`active`,children:y()}),(0,q.jsx)(G,{value:`disabled`,children:Se()})]})]})]}),(0,q.jsx)(ct,{title:oe(),rows:u,addLabel:Ce(),onAdd:()=>{w(Z),E(null),S(!0)},emptyHint:ee(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,q.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:L}),rowActions:e=>[{label:se(),onSelect:()=>pt(e)},{label:Ze(),onSelect:()=>void mt(e)},{label:k.has(e._id)?ye():de(),onSelect:()=>Q(e._id)},{label:ie(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,q.jsx)(j,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?ge():pe(),onClick:()=>Q(e._id),children:k.has(e._id)?(0,q.jsx)(Qe,{}):(0,q.jsx)(it,{})})},{header:fe(),sort:e=>e.name,cell:e=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`span`,{children:e.name}),e.description?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Fe(),sort:e=>e.roleKey,cell:e=>(0,q.jsx)(H,{variant:`secondary`,children:e.roleKey})},{header:i(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,q.jsx)(H,{variant:`destructive`,children:Se()}):(0,q.jsx)(H,{variant:`outline`,children:y()})},{header:Ie(),cell:e=>(0,q.jsxs)(N,{value:z[e._id]??`never`,onValueChange:t=>at(n=>({...n,[e._id]:t})),children:[(0,q.jsx)(P,{size:`sm`,className:`w-32`,children:(0,q.jsx)(W,{})}),(0,q.jsx)(U,{children:J.map(e=>(0,q.jsx)(G,{value:e.value,children:e.label()},e.value))})]})},{header:he(),sort:e=>(Y.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Y.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,q.jsx)(`span`,{className:`oc-sa__keycount`,children:M===e._id?ne():re({count:t})})}}]}),(0,q.jsx)(rt,{open:x,onOpenChange:e=>{S(e),e||E(null)},title:T?xe():be(),description:T?Je():Ye(),canSubmit:!!(C.name&&C.roleKey),onSubmit:ft,submitLabel:T?te():De(),children:(0,q.jsxs)(`div`,{className:`oc-form`,children:[(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Xe()}),(0,q.jsx)(B,{value:C.name,onChange:e=>w({...C,name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:qe()}),(0,q.jsxs)(N,{value:C.roleKey||void 0,onValueChange:e=>w({...C,roleKey:e}),children:[(0,q.jsx)(P,{className:`w-full`,children:(0,q.jsx)(W,{placeholder:Te()})}),(0,q.jsx)(U,{children:(f??[]).map(e=>(0,q.jsxs)(G,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(f??[]).find(e=>e.key===C.roleKey),t=e?lt(e):null;return t?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Me()}),(0,q.jsx)(B,{value:C.description,onChange:e=>w({...C,description:e.target.value})})]})]})}),(0,q.jsx)(dt,{minted:ot,onClose:()=>V(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,q.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,q.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[ve(),` `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):(0,q.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:x()}),(0,q.jsx)(`th`,{children:S()}),(0,q.jsx)(`th`,{children:d()}),(0,q.jsx)(`th`,{children:E()}),(0,q.jsx)(`th`,{children:f()}),(0,q.jsx)(`th`,{children:c()}),(0,q.jsx)(`th`,{})]})}),(0,q.jsx)(`tbody`,{children:t.map(t=>(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{children:(0,q.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,q.jsx)(`td`,{children:(0,q.jsx)(H,{variant:`secondary`,children:e.roleKey})}),(0,q.jsx)(`td`,{children:F(t.createdAt)}),(0,q.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,q.jsx)(`td`,{children:mt(t.expiresAt)}),(0,q.jsx)(`td`,{children:$(t)}),(0,q.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,q.jsx)(j,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?b():_()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,K.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,q.jsx)(I,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,q.jsxs)(L,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,q.jsxs)(z,{children:[(0,q.jsx)(R,{children:l()}),(0,q.jsx)(ot,{children:v({name:e.accountName})})]}),(0,q.jsx)(`div`,{className:`oc-sa__minted-warning`,children:o()}),(0,q.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,q.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,q.jsxs)(j,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":k(),children:[n?(0,q.jsx)(A,{}):(0,q.jsx)(M,{}),n?g():p()]})]}),(0,q.jsx)(at,{children:(0,q.jsx)(j,{onClick:()=>{r(!1),t()},children:u()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?m():F(e)}function mt(e){return e===null?`—`:V(e)}function $(e){return e.disabled?(0,q.jsx)(H,{variant:`destructive`,children:w()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,q.jsx)(H,{variant:`outline`,children:a()}):(0,q.jsx)(H,{variant:`outline`,children:T()})}export{Q as ServiceAccountsTab};
@@ -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,Cs as a,Ds as o,Es as s,Fs as c,Hs as l,Is as u,Ls as ee,Ms as d,Ns as f,Os as p,Ps as m,RR as h,Rs as g,Ss as _,Ts as v,Us as y,Vs as b,Ws as x,_s as S,bs as C,cs as w,ds as T,fs as E,gs as D,hs as O,js as k,ks as A,ls as j,ms as M,os as N,ps as P,ss as F,t as I,us as L,vs as R,ws as z,xs as B,ys as V,zR as H,zs as U}from"./api-Dv9KEyyu.js";import{t as W}from"./button-D9yXQ2Th.js";import{Z as G,ct as K}from"./index-BAyOACwC.js";import{t as q}from"./DataTableShell-CqU0-4M7.js";var J=t(e(),1),Y=n(),X={hung:()=>o(),wrong_result:()=>s(),error:()=>v(),other:()=>z()},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=h(I.subAgentReports.respondToReport),[r,i]=(0,J.useState)(e.thread),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(!1);async function u(){let t=o.trim();if(!(!t||c)){l(!0);try{await n({reportId:e._id,text:t}),i(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),s(``)}finally{l(!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),` · `,a({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:_()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:B()}),r.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:r.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?C():V()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:R()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:S(),value:o,maxLength:2e3,rows:3,onChange:e=>s(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void u(),disabled:!o.trim()||c,children:c?O():D()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[M({count:t.children.length}),t.childrenTruncated?` ${P()}`:``,t.textTruncated?` ${E()}`:``]}),(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?` · ${T()}`:``]}),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:L()}),(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:j()}),(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=H(I.subAgentReports.listForAdmin,{}),t=h(I.subAgentReports.readReport),n=h(I.subAgentReports.deleteReport),a=G(),[o,s]=(0,J.useState)(null),[_,v]=(0,J.useState)({});async function S(e){if(o===e._id){s(null);return}if(!_[e._id]){let n=await t({reportId:e._id});v(t=>({...t,[e._id]:n}))}s(e._id)}async function C(e){await a({title:w(),description:F(),confirmLabel:N(),destructive:!0})&&(await n({reportId:e._id}),o===e._id&&s(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[l(),` `,(0,Y.jsx)(`strong`,{children:b()}),` `,i()]}),(0,Y.jsx)(q,{title:x(),rows:e,emptyHint:y(),isExpanded:e=>o===e._id&&!!_[e._id],renderExpanded:e=>_[e._id]?(0,Y.jsx)($,{data:_[e._id]}):null,columns:[{header:U(),cell:e=>K(e.at),sort:e=>e.at},{header:g(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:ee(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:u(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${f({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:c(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:m(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:d()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:k()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:o===e._id?A():r(),onSelect:()=>void S(e)},{label:p(),onSelect:()=>void C(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{$N as r,$P as i,AP as a,BN as o,BP as s,CP as c,D as l,DP as u,DR as d,EP as f,ER as p,FP as m,GN as h,GP as g,HN as _,HP as v,IN as ee,IP as te,IR as ne,JN as re,JP as y,KN as ie,KP as ae,LN as oe,LP as se,MP as ce,NP as le,OP as ue,OR as de,PP as fe,QN as pe,QP as me,RN as he,RP as ge,RR as b,SP as _e,TP as ve,UN as ye,UP as be,VN as xe,VP as Se,WN as x,WP as Ce,XN as we,XP as Te,YN as Ee,YP as De,ZN as Oe,ZP as ke,_P as Ae,aP as je,as as S,bP as Me,cP as Ne,dP as Pe,eF as Fe,eP as Ie,fP as Le,gP as Re,hP as ze,iF as Be,iP as Ve,is as C,jP as He,kP as Ue,lP as We,mP as Ge,nF as Ke,nP as w,ns as qe,oP as Je,pP as Ye,qN as Xe,qP as Ze,r as Qe,rF as $e,rP as et,rs as tt,sP as nt,t as T,tF as rt,tP as it,uP as at,vP as ot,wP as st,xP as E,yP as ct,zN as lt,zP as ut,zR as D}from"./api-Dv9KEyyu.js";import{t as O}from"./check-RMjSSPfa.js";import{t as k}from"./x-C58t2mLG.js";import{t as A}from"./button-D9yXQ2Th.js";import{Ct as dt,Dn as ft,En as j,Ft as pt,It as M,Lt as mt,Mt as ht,Nt as gt,P as N,Pt as P,St as _t,_t as F,bt as I,jt as L,ut as R,vt as z,wt as B,xt as V,yt as H}from"./index-BAyOACwC.js";import{t as vt}from"./localePickerView-C2RmOS86.js";import{a as yt,i as bt,n as xt,o as St,r as Ct,t as wt}from"./card-CwT7Pj_Y.js";import{a as Tt,i as U,n as Et,o as W,r as G,t as Dt}from"./table-DCOgab8-.js";import{t as Ot}from"./TimeRangePicker-I8KZZSiJ.js";import{t as kt}from"./FilterBar-B4i5RQ5h.js";import{t as At}from"./AdvancedFilter-DalnKKbE.js";var K=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`}]]),q=t(e(),1),jt=.1,Mt=[248,248,248],Nt=[24,24,24];function Pt(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 Ft(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 J(e,t,n){return Ft(e,t,n)>=jt}function It(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 Lt(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 Rt=12*1024*1024,zt=480,Bt=160,Vt=.92;async function Ht(e,t={}){if(!e.type.startsWith(`image/`))throw Error(je());if(e.size>Rt)throw Error(Ve());let{source:n,width:r,height:i,cleanup:a}=await Ut(e);try{let a=e.type===`image/svg+xml`,o=Math.min(zt/r,Bt/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(w());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Pt(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(w());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);J(e.data,d.width,d.height)?It(e.data,t.variantFor===`dark`?Mt:Nt):Lt(e.data),p.putImageData(e,0,0)}let m=J(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Wt(f,`image/webp`,Vt)??await Wt(f,`image/png`);if(!h)throw Error(it());return{blob:h,hasAlpha:m}}finally{a()}}async function Ut(e){if(e.type===`image/svg+xml`)return Y(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 Y(e)}async function Y(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(et())),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 Wt(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__`,Kt={kind:`relative`,from:`now-24h`,to:`now`},qt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,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 Jt(e){return e===`light`?de():e===`dark`?d():p()}var Yt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Xt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Yt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Zt({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:Qe(`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)(Xt,{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)(A,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":S(),title:S(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function Qt({selectedKey:e,resolvedMode:t}){let n=D(T.charts.listMyCharts),r=b(T.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:Te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:De()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Zt,{selected:e===null,title:y(),subtitle:Ze(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?ae():n.via===`owner`?g():Ce({group:n.via.group});return(0,X.jsx)(Zt,{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:be()}):null]})}function $t(){let e=b(T.charts.importChart),[t,n]=(0,q.useState)(``),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(null),[s,l]=(0,q.useState)(!1),[d,p]=(0,q.useState)(!1);async function m(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),l(!1);try{i(await t.text())}catch{o(E())}}}async function h(){if(o(null),l(!1),t.trim()===``){o(ct());return}let a;try{a=JSON.parse(r)}catch{o(E());return}p(!0);try{await e({name:t.trim(),tokens:a}),l(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{p(!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:Ue()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ue()})]}),(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:u()}),(0,X.jsx)(L,{value:t,onChange:e=>n(e.target.value),placeholder:f(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ve()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:st(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(K,{className:`size-4`}),c(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void m(e)})]})}),(0,X.jsx)(A,{size:`sm`,disabled:d,onClick:()=>void h(),children:_e()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Me()}):null]})]})}function en({chart:e}){let t=ne(T.charts.setChartLogo),n=b(T.charts.removeChartLogo),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.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 Ht(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Le():Pe()}),(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)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(K,{className:`size-4`}),t?We():at(),(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)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:nt()}):null,t?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Ne()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ye()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(f,{mode:`light`}),(0,X.jsx)(f,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Je()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function tn({chart:e}){let t=D(T.me.getMe,{host:B}),n=b(T.charts.addChartDomain),i=b(T.charts.removeChartDomain),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(null),[l,u]=(0,q.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function f(){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 p(t){c(null);try{await i({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:Ie()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:d.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:we()}):d.map(e=>(0,X.jsxs)(R,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ee({domain:e}),onClick:()=>void p(e),children:(0,X.jsx)(k,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(L,{value:a,onChange:e=>o(e.target.value),placeholder:pe(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&f()}}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void f(),children:Oe()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:r()}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=b(T.charts.updateChart),n=b(T.charts.deleteChart),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(e.name),[s,c]=(0,q.useState)(()=>$(e.tokens)),[l,u]=(0,q.useState)(e.tokens.bpm??0),[d,f]=(0,q.useState)(null),[p,m]=(0,q.useState)(!1);function g(){o(e.name),c($(e.tokens)),u(e.tokens.bpm??0),f(null),i(!0)}async function _(){if(e.chartId===void 0)return;f(null);let n;try{n=JSON.parse(s)}catch{f(E());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}m(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){f(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function v(){if(e.chartId!==void 0&&window.confirm(x()))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)(A,{variant:`outline`,size:`sm`,onClick:g,children:ze()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void v(),children:Ge()})]})})]}),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:ie()}),(0,X.jsx)(L,{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:C()}),(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":C()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?tt():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:qe()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:h()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),d?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:d}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,disabled:p,onClick:()=>void _(),children:re()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:Xe()})]})]}):null,(0,X.jsx)(en,{chart:e}),(0,X.jsx)(tn,{chart:e})]})}function rn(){let e=D(T.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:ot()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Re()}):(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=b(T.charts.addChartToGroupPool),r=b(T.charts.removeChartFromGroupPool),i=e.restrictedToGroups,s=e.poolGroups,c=new Set((s??[]).map(e=>e.groupId)),l=t.filter(e=>!c.has(e._id));async function u(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function d(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)(R,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?m():e.kind===`custom`&&e.scope===`personal`?o():te()}),e.isGlobalDefault?(0,X.jsx)(R,{variant:`default`,children:fe()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ce()}),(s??[]).map(e=>(0,X.jsxs)(R,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":a({group:e.name}),onClick:()=>void d(e.groupId),children:(0,X.jsx)(k,{className:`size-3`})})]},e.groupId)),l.length>0?(0,X.jsxs)(F,{value:``,onValueChange:e=>void u(e),children:[(0,X.jsx)(I,{size:`sm`,className:`w-56`,children:(0,X.jsx)(V,{placeholder:He()})}),(0,X.jsx)(z,{children:l.map(e=>(0,X.jsx)(H,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:le()}):null]})]})}function on({chart:e}){let t=b(T.charts.promoteChartToCommon),n=b(T.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(x()))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)(R,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?lt():o()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:xe({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:he()}):null,(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:oe()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=b(T.admin.setDefaultThemeMode),i=b(T.admin.setDefaultLocale),a=b(T.charts.setDefaultChart),o=D(T.charts.listChartsAdmin),c=D(T.groups.listGroups,{}),l=e??`system`,u=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:me()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ke()})]}),(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:v()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Se()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:y()}),dt.map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(o??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({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:s()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ut()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:c??[]},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:se()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).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)(tn,{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:ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ee()}):(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:Be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:$e()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(A,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Jt(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:Ke()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:rt()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:vt().map(e=>(0,X.jsx)(A,{variant:u===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Fe()})]})]})}function cn(){let e=D(T.me.getMe,{host:B}),t=_t(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Qt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)($t,{}),(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,q.useState)(!0),[n,r]=(0,q.useState)(`per-user`),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(Z),[l,u]=(0,q.useState)(Z),[d,f]=(0,q.useState)(Kt),p=a!==``||s!==Z||l!==Z;function m(){o(``),c(Z),u(Z),f(Kt)}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:i()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(A,{variant:`outline`,children:`Outline`}),(0,X.jsx)(A,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(A,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(A,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,children:`Small`}),(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{size:`lg`,children:`Large`}),(0,X.jsx)(A,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(j,{})}),(0,X.jsx)(A,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(R,{children:`Default`}),(0,X.jsx)(R,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(R,{variant:`outline`,children:`Outline`}),(0,X.jsx)(R,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(L,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(F,{value:n,onValueChange:r,children:[(0,X.jsx)(I,{className:`w-56`,children:(0,X.jsx)(V,{placeholder:`Select…`})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(H,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(H,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(N,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(kt,{q:a,onQChange:o,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:d,onTimeRangeChange:f,onReset:m,canReset:p,children:[(0,X.jsxs)(F,{value:s,onValueChange:c,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(H,{value:Z,children:`Toutes directions`}),(0,X.jsx)(H,{value:`inbound`,children:`inbound`}),(0,X.jsx)(H,{value:`outbound`,children:`outbound`}),(0,X.jsx)(H,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(F,{value:l,onValueChange:u,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(H,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(H,{value:`info`,children:`info`}),(0,X.jsx)(H,{value:`warn`,children:`warn`}),(0,X.jsx)(H,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(At,{fields:qt,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)(Ot,{value:d,onChange:f})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(ht,{children:[(0,X.jsx)(mt,{asChild:!0,children:(0,X.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(j,{})})}),(0,X.jsxs)(gt,{align:`start`,children:[(0,X.jsx)(pt,{children:`Actions`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{children:`Edit`}),(0,X.jsx)(P,{children:`Duplicate`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(wt,{className:`w-80`,children:[(0,X.jsxs)(yt,{children:[(0,X.jsx)(St,{children:`Instance`}),(0,X.jsx)(Ct,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(xt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(bt,{className:`gap-2`,children:[(0,X.jsx)(A,{size:`sm`,children:`Save`}),(0,X.jsx)(A,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Dt,{children:[(0,X.jsx)(Tt,{children:(0,X.jsxs)(W,{children:[(0,X.jsx)(U,{className:`w-8`,children:(0,X.jsx)(N,{"aria-label":`select all`})}),(0,X.jsx)(U,{children:`Name`}),(0,X.jsx)(U,{children:`Mode`}),(0,X.jsx)(U,{className:`text-right`,children:`Status`}),(0,X.jsx)(U,{className:`w-8`})]})}),(0,X.jsx)(Et,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(W,{children:[(0,X.jsx)(G,{children:(0,X.jsx)(N,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(G,{className:`font-medium`,children:e.n}),(0,X.jsx)(G,{children:(0,X.jsx)(R,{variant:`secondary`,children:e.m})}),(0,X.jsx)(G,{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)(G,{children:(0,X.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(j,{})})})]},e.n))})]})}),(0,X.jsx)(Q,{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};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Av as r,Bi as i,Dv as a,Ev as o,Fv as s,Hi as c,Iv as l,Li as u,Mv as d,Nv as f,Ov as p,Pv as m,Ri as h,Tv as g,Ui as _,Vi as v,jv as y,kv as b,wv as x,zi as S}from"./api-Dv9KEyyu.js";import{t as C}from"./button-D9yXQ2Th.js";import{Ht as w,Ut as T,Vt as E,Wt as D,ct as O,jt as k,kn as A,sn as j}from"./index-BAyOACwC.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:l(),from:`now-5m`},{label:s(),from:`now-15m`},{label:m(),from:`now-30m`},{label:f(),from:`now-1h`},{label:d(),from:`now-3h`},{label:y(),from:`now-6h`},{label:r(),from:`now-12h`},{label:b(),from:`now-24h`},{label:p(),from:`now-2d`},{label:a(),from:`now-7d`},{label:o(),from:`now-30d`},{label:g(),from:`now-90d`},{label:x(),from:`now-520w`}];function L(e){return O(e,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function R(e){if(e.kind===`relative`){let t=I.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${L(e.from)} → ${L(e.to)}`}function z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function B(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function V(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var H=n();function U(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=F(e);return e.kind===`absolute`?{from:t,to:n}:{from:W(t),to:W(n)}},[e,t])}function W(e){return Math.floor(e/6e4)*6e4}function G({value:e,onChange:t}){let[n,r]=(0,M.useState)(!1),[a,o]=(0,M.useState)(``),s=F(e),[l,d]=(0,M.useState)(()=>z(s.from)),[f,p]=(0,M.useState)(()=>z(s.to));function m(t){if(t){let t=F(e);d(z(t.from)),p(z(t.to)),o(``)}r(t)}function g(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function y(){let e=B(l),n=B(f);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let b=(0,M.useMemo)(()=>{let e=a.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[a]),x=B(l)!==null&&B(f)!==null;return(0,H.jsxs)(T,{open:n,onOpenChange:m,children:[(0,H.jsx)(D,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(A,{}),R(e)]})}),(0,H.jsx)(w,{children:(0,H.jsx)(E,{align:`end`,sideOffset:6,className:`oc-timerange__panel oc-overlay-layer rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:_()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:c()}),(0,H.jsx)(k,{type:`datetime-local`,value:l,onChange:e=>d(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:v()}),(0,H.jsx)(k,{type:`datetime-local`,value:f,onChange:e=>p(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!x,onClick:y,children:i()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(j,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(k,{value:a,onChange:e=>o(e.target.value),placeholder:S(),"aria-label":h()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:b.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:u()}):b.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>g(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$F as r,eI as i,nI as a,tI as o}from"./api-CbVyaw6f.js";import{t as s}from"./check-DI-pspfc.js";import{t as c}from"./chevrons-up-down-huJFCk51.js";import{Bt as l,Rt as u,jt as d,zt as f}from"./index-EISUCtE9.js";/* empty css */var p=t(e(),1);function m(e){if(e==null||e===``)return`none`;let t=e.trim().toLowerCase();return t===`ok`||t===`success`||t===`completed`?`ok`:t===`error`||t===`failed`||t===`failure`?`error`:t===`running`||t===`in_progress`||t===`pending`?`running`:`other`}function h(e){return e===!0?`active`:e===!1?`paused`:`unknown`}var g={q:``,state:`all`,result:`all`};function _(e){return e.q.trim()!==``||e.state!==`all`||e.result!==`all`}function v(e,t){let n=t.q.trim().toLowerCase();return!(n!==``&&!`${e.name??``} ${e.agentId}`.toLowerCase().includes(n)||t.state!==`all`&&h(e.enabled)!==t.state||t.result!==`all`&&m(e.lastRunStatus)!==t.result)}function y(){try{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):[]}catch{return[]}}function b(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function x(e,t,n=50,r){let i=e=>e.toLowerCase().replace(/[_/]+/g,` `),a=i(t.trim()),o=(a===``?e:e.filter(e=>i(e).includes(a))).slice(0,n);return r&&r!==``&&!o.includes(r)?[r,...o].slice(0,n):o}function S(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=[];for(let e=0;e<42;e++){let n=new Date(r.getFullYear(),r.getMonth(),r.getDate()+e);i.push({year:n.getFullYear(),month:n.getMonth(),day:n.getDate(),inMonth:n.getMonth()===t})}return i}function C(e,t,n,r,i){let a=(e,t=2)=>String(e).padStart(t,`0`);return`${a(e,4)}-${a(t+1)}-${a(n)}T${a(r)}:${a(i)}`}function w(e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(e);if(t===null)return null;let[,n,r,i,a,o]=t;return{year:Number(n),month:Number(r)-1,day:Number(i),hour:Number(a),minute:Number(o)}}var T=n();function E({value:e,onChange:t,className:n,fallbackTz:m}){let h=(0,p.useMemo)(()=>y(),[]),[g,_]=(0,p.useState)(!1),[v,S]=(0,p.useState)(``);if(h.length===0)return(0,T.jsx)(d,{value:e,onChange:e=>t(e.target.value),placeholder:m||b()||`America/Toronto`,className:n});let C=x(h,v,h.length,e||void 0),w=e===``?m||b()||r():e;return(0,T.jsxs)(u,{modal:!0,open:g,onOpenChange:e=>{_(e),e||S(``)},children:[(0,T.jsx)(l,{asChild:!0,children:(0,T.jsxs)(`button`,{type:`button`,className:`oc-tzcombo__trigger${n?` ${n}`:``}`,"aria-label":a(),children:[(0,T.jsx)(`span`,{className:`oc-tzcombo__value`,children:w}),(0,T.jsx)(c,{size:14,"aria-hidden":!0,className:`oc-tzcombo__chev`})]})}),(0,T.jsxs)(f,{align:`start`,className:`oc-tzcombo__pop p-0`,children:[(0,T.jsx)(d,{autoFocus:!0,value:v,onChange:e=>S(e.target.value),placeholder:o(),className:`oc-tzcombo__search`}),(0,T.jsx)(`div`,{className:`oc-tzcombo__list`,role:`listbox`,children:C.length===0?(0,T.jsx)(`p`,{className:`oc-tzcombo__empty`,children:i()}):C.map(n=>(0,T.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===e,className:`oc-tzcombo__opt`,onClick:()=>{t(n),_(!1),S(``)},children:[(0,T.jsx)(s,{size:13,"aria-hidden":!0,className:`oc-tzcombo__check`,style:{opacity:+(n===e)}}),(0,T.jsx)(`span`,{children:n})]},n))})]})]})}export{m as a,w as c,v as i,C as l,g as n,h as o,_ as r,S as s,E as t};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{aI as r,iI as i,oI as a,rI as o}from"./api-Dv9KEyyu.js";import{t as s}from"./check-RMjSSPfa.js";import{t as c}from"./chevrons-up-down-DT1RCPP_.js";import{Bt as l,Rt as u,jt as d,zt as f}from"./index-BAyOACwC.js";/* empty css */var p=t(e(),1);function m(e){if(e==null||e===``)return`none`;let t=e.trim().toLowerCase();return t===`ok`||t===`success`||t===`completed`?`ok`:t===`error`||t===`failed`||t===`failure`?`error`:t===`running`||t===`in_progress`||t===`pending`?`running`:`other`}function h(e){return e===!0?`active`:e===!1?`paused`:`unknown`}var g={q:``,state:`all`,result:`all`};function _(e){return e.q.trim()!==``||e.state!==`all`||e.result!==`all`}function v(e,t){let n=t.q.trim().toLowerCase();return!(n!==``&&!`${e.name??``} ${e.agentId}`.toLowerCase().includes(n)||t.state!==`all`&&h(e.enabled)!==t.state||t.result!==`all`&&m(e.lastRunStatus)!==t.result)}function y(){try{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):[]}catch{return[]}}function b(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function x(e,t,n=50,r){let i=e=>e.toLowerCase().replace(/[_/]+/g,` `),a=i(t.trim()),o=(a===``?e:e.filter(e=>i(e).includes(a))).slice(0,n);return r&&r!==``&&!o.includes(r)?[r,...o].slice(0,n):o}function S(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=[];for(let e=0;e<42;e++){let n=new Date(r.getFullYear(),r.getMonth(),r.getDate()+e);i.push({year:n.getFullYear(),month:n.getMonth(),day:n.getDate(),inMonth:n.getMonth()===t})}return i}function C(e,t,n,r,i){let a=(e,t=2)=>String(e).padStart(t,`0`);return`${a(e,4)}-${a(t+1)}-${a(n)}T${a(r)}:${a(i)}`}function w(e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(e);if(t===null)return null;let[,n,r,i,a,o]=t;return{year:Number(n),month:Number(r)-1,day:Number(i),hour:Number(a),minute:Number(o)}}var T=n();function E({value:e,onChange:t,className:n,fallbackTz:m}){let h=(0,p.useMemo)(()=>y(),[]),[g,_]=(0,p.useState)(!1),[v,S]=(0,p.useState)(``);if(h.length===0)return(0,T.jsx)(d,{value:e,onChange:e=>t(e.target.value),placeholder:m||b()||`America/Toronto`,className:n});let C=x(h,v,h.length,e||void 0),w=e===``?m||b()||o():e;return(0,T.jsxs)(u,{modal:!0,open:g,onOpenChange:e=>{_(e),e||S(``)},children:[(0,T.jsx)(l,{asChild:!0,children:(0,T.jsxs)(`button`,{type:`button`,className:`oc-tzcombo__trigger${n?` ${n}`:``}`,"aria-label":a(),children:[(0,T.jsx)(`span`,{className:`oc-tzcombo__value`,children:w}),(0,T.jsx)(c,{size:14,"aria-hidden":!0,className:`oc-tzcombo__chev`})]})}),(0,T.jsxs)(f,{align:`start`,className:`oc-tzcombo__pop p-0`,children:[(0,T.jsx)(d,{autoFocus:!0,value:v,onChange:e=>S(e.target.value),placeholder:r(),className:`oc-tzcombo__search`}),(0,T.jsx)(`div`,{className:`oc-tzcombo__list`,role:`listbox`,children:C.length===0?(0,T.jsx)(`p`,{className:`oc-tzcombo__empty`,children:i()}):C.map(n=>(0,T.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===e,className:`oc-tzcombo__opt`,onClick:()=>{t(n),_(!1),S(``)},children:[(0,T.jsx)(s,{size:13,"aria-hidden":!0,className:`oc-tzcombo__check`,style:{opacity:+(n===e)}}),(0,T.jsx)(`span`,{children:n})]},n))})]})]})}export{m as a,w as c,v as i,C as l,g as n,h as o,_ as r,S as s,E as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$O as r,AO as i,Ax as a,BO as o,Br as s,Bx as c,CO as l,Cx as u,D as d,DO as f,Dx as p,EO as m,Ex as h,FO as g,Fx as _,GO as v,HO as y,Hx as ee,IO as b,Ix as te,JO as x,KO as S,LO as C,Lx as ne,Mx as re,Nx as ie,OO as w,Ox as ae,Px as oe,QO as se,RO as ce,RR as T,Rr as le,Rx as ue,SO as de,Sx as fe,TO as E,Tx as pe,UO as D,VO as O,Vx as me,WO as k,XO as A,YO as j,ZO as M,_O as N,_x as he,ak as P,ax as ge,bO as _e,bx as ve,cx as ye,dx as be,ek as xe,fx as Se,gO as Ce,gx as we,hx as Te,ik as Ee,ix as De,jx as Oe,kO as ke,kx as Ae,lx as je,mx as Me,nk as Ne,ox as Pe,px as Fe,qO as F,rk as Ie,sx as Le,t as I,tk as Re,ux as ze,vO as Be,vx as Ve,wO as He,wx as Ue,xO as We,xx as Ge,yO as Ke,yx as qe,zO as Je,zR as L,zr as Ye,zx as Xe}from"./api-Dv9KEyyu.js";import{t as Ze}from"./check-RMjSSPfa.js";import{t as Qe}from"./x-C58t2mLG.js";import{i as R,n as z,r as $e,t as et}from"./tabs-Dv-cJfvQ.js";import{t as B}from"./button-D9yXQ2Th.js";import{Fn as tt,J as nt,On as rt,Pn as it,Tn as at,_t as V,a as ot,bt as H,ct as U,dt as st,ft as ct,gt as lt,ht as ut,i as dt,lt as ft,o as pt,pt as mt,s as ht,ut as W,vt as G,wt as gt,xn as _t,xt as K,yt as q}from"./index-BAyOACwC.js";import{n as vt}from"./TimeRangePicker-I8KZZSiJ.js";import{t as yt}from"./FilterBar-B4i5RQ5h.js";import{t as bt}from"./AdvancedFilter-DalnKKbE.js";import{t as xt}from"./DataTableShell-CqU0-4M7.js";var St=d(`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=d(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),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`?o():n===`agent`?`${Je()} - ${r}`:e}function Tt(){let e=L(I.me.getMe,{host:gt})?.role===`admin`,t=L(I.deliveryTiming.getDeliveryStatus,{}),n=T(I.deliveryTiming.startDeliveryRecord),r=T(I.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:P()}),(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?Ne():Ie()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(W,{variant:`secondary`,children:Re()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:xe({time:ft(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?M():se()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=L(I.deliveryTiming.listDeliverySessions,{}),n=T(I.deliveryTiming.deleteDeliverySessions),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(`all`),[s,c]=(0,J.useState)(X),[l,u]=(0,J.useState)(null),{from:d,to:f}=vt(s),p=s.to===`now`?1/0:f,m=r.trim()!==``||a!==`all`||s!==X,h=()=>{i(``),o(`all`),c(X)},g=(0,J.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(a===`all`||(a===`active`?t.active:!t.active))&&t.startedAt>=d&&t.startedAt<=p).map(e=>({...e,_id:e.sessionId}))},[t,r,a,d,p]),_=e=>{let t=new Set((g??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),l!==null&&r.includes(l)&&u(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(yt,{q:r,onQChange:i,searchPlaceholder:j(),timeRange:s,onTimeRangeChange:c,onReset:h,canReset:m,children:(0,Y.jsxs)(V,{value:a,onValueChange:e=>o(e),children:[(0,Y.jsx)(H,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:`all`,children:x()}),(0,Y.jsx)(q,{value:`active`,children:F()}),(0,Y.jsx)(q,{value:`stopped`,children:S()})]})]})}),(0,Y.jsx)(xt,{title:A(),rows:g,emptyHint:N(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":l===e.sessionId?C():ce(),onClick:()=>u(t=>t===e.sessionId?null:e.sessionId),children:l===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(at,{size:15,"aria-hidden":!0})})},{header:v(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:U(e.startedAt)})},{header:k(),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:U(e.stoppedAt)})},{header:D(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:y(),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:F()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:S()})}],rowActions:e?e=>[{label:b(),variant:`destructive`,onSelect:()=>_([e.sessionId])}]:void 0,bulkActions:e?[{label:b(),variant:`destructive`,onSelect:e=>_(e)}]:void 0,isExpanded:e=>e.sessionId===l,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=L(I.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(nt(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:g()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:r()});let i=e.segments,a=(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,` `,Ce()]}),(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?Be():Ke()]})]}),(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:w()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:f()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:m()})]})}),(0,Y.jsxs)(`tbody`,{children:[a(E(),i.bridge),a(He(),i.A),a(l(),i.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:de()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:_e()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:We()})]})}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:s()},{value:`principalType`,label:Ye()},{value:`direction`,label:`direction`},{value:`roleKey`,label:le()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=tt({from:`/settings/traces`}),t=it({from:`/settings/traces`}),n=e.limit,r=e.kind,o=e.statusClass??Q,s=e.principalType??Q,l=e.direction??Q,d=e.roleKey??Q,f=e.q??``,m=dt(e.from,e.to),g=(0,J.useMemo)(()=>ht(e.adv),[e.adv]),{from:v,to:y}=vt(m),[b,x]=(0,J.useState)(null),[S,C]=(0,J.useState)(null),w=e=>void t({search:t=>({...t,limit:e})}),se=e=>void t({search:t=>({...t,kind:e})}),ce=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),T=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),le=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),de=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),E=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),D=e=>void t({search:t=>({...t,...pt(e)})}),O=e=>void t({search:t=>({...t,adv:ot(e)}),replace:!0}),k=L(I.observability.listEvents,{limit:n}),A=L(I.observability.listEvents,{limit:n,kind:r===At?void 0:r,filter:{q:f||void 0,from:v,to:y,statusClass:o===Q?void 0:o,principalType:s===Q?void 0:s,direction:l===Q?void 0:l,roleKey:d===Q?void 0:d,advanced:g.length>0?g:void 0}}),j=(0,J.useMemo)(()=>{let e=new Set;for(let t of k??[])e.add(t.kind);return[...e].sort()},[k]),M=(0,J.useMemo)(()=>{let e=new Set;for(let t of k??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[k]),N=f!==``||o!==Q||s!==Q||l!==Q||d!==Q||g.length>0||m.kind!==`relative`||m.from!==Pt.from;function P(){t({search:{limit:100,kind:`all`},replace:!0})}let ge=b?k?.filter(e=>e.correlationId===b):A,_e=e.section,xe=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:_e,onValueChange:e=>xe(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)(_t,{size:13,"aria-hidden":!0}),i()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),ke()]})]}),(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:[ee(),(0,Y.jsx)(`strong`,{children:me()}),c(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:Xe()})]}),(0,Y.jsxs)(yt,{q:f,onQChange:ce,searchPlaceholder:ue(),timeRange:m,onTimeRangeChange:D,onReset:P,canReset:N,children:[(0,Y.jsxs)(V,{value:o,onValueChange:T,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:ne()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:Q,children:te()}),jt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(V,{value:s,onValueChange:le,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:_()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:Q,children:oe()}),Mt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(V,{value:l,onValueChange:de,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:ie()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:Q,children:re()}),Nt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(V,{value:d,onValueChange:E,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{placeholder:Oe()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:Q,children:a()}),M.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(V,{value:r,onValueChange:se,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(K,{placeholder:Ae()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:At,children:ae()}),j.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(V,{value:String(n),onValueChange:e=>w(Number(e)),children:[(0,Y.jsx)(H,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(K,{})}),(0,Y.jsx)(G,{children:kt.map(e=>(0,Y.jsx)(q,{value:String(e),children:p({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:g,onChange:O}),b?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>x(null),title:h(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[pe(),(0,Y.jsx)(`code`,{children:$(b)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:Ue()})]})}):null,(0,Y.jsx)(xt,{title:u(),rows:ge,emptyHint:b?fe():Ge(),columns:[{header:ve(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:U(e.at)})},{header:qe(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(W,{variant:`secondary`,children:e.kind})},{header:Ve(),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":he(),children:`✓`})}},{header:we(),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:Te(),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:Me(),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:Fe(),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:be(),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:ze(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:je(),onClick:()=>x(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ye(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:Le()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:S,onClose:()=>C(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)(st,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(ct,{className:`max-w-lg`,children:[(0,Y.jsxs)(ut,{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:ge()})]}),(0,Y.jsx)(mt,{children:De()})]}),(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{AE as r,Ab as i,BT as a,CE as o,Cb as s,DE as c,Db as l,EE as u,Eb as d,ME as f,NE as p,OE as m,Ob as h,RR as g,SE as ee,Sb as _,TE as te,Tb as v,_E as ne,aE as re,bE as ie,bb as y,cE as ae,dE as oe,df as b,fE as se,ff as x,gE as ce,hE as le,jE as S,kE as ue,kb as C,lE as w,mE as T,oE as de,pE as fe,pf as E,sE as pe,t as D,uE as me,vE as he,vb as O,wE as ge,wb as k,xE as _e,xb as A,yE as ve,yb as j,zR as M}from"./api-Dv9KEyyu.js";import{t as N}from"./button-D9yXQ2Th.js";import{Dt as P,Fn as F,Ft as I,Lt as L,Mt as ye,Nt as R,P as z,Pn as be,Pt as xe,Q as Se,Z as Ce,_t as B,an as V,bt as H,c as U,dt as we,ft as Te,gt as Ee,ht as De,l as Oe,on as W,pt as ke,u as G,ut as K,vt as q,wt as Ae,xt as J,yt as Y}from"./index-BAyOACwC.js";import{t as je}from"./FilterBar-B4i5RQ5h.js";import{t as Me}from"./DataTableShell-CqU0-4M7.js";import{t as Ne}from"./DetailChips-DrJgW8-P.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let a=M(D.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=M(D.agents.listUserAgents,n&&e?{profileId:e}:`skip`),c=new Set((o??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=(o??[]).find(e=>e.isDefault)??null,f=u?`${u.instanceName}/${u.agentId}`:null,p=new Set((a?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),m=[...(a?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).filter(e=>!p.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}))],g=new Map;for(let e of m){let t=g.get(e.instanceName)??[];t.push(e),g.set(e.instanceName,t)}return(0,Z.jsx)(we,{open:n,onOpenChange:r,children:(0,Z.jsxs)(Te,{className:`oc-access`,children:[(0,Z.jsxs)(De,{children:[(0,Z.jsx)(Ee,{children:i({user:t})}),(0,Z.jsx)(ke,{children:C()})]}),a?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:a.inGroup?h():l()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:a===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:d()}):m.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:s()}):[...g.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:c,defaultKey:f},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=g(D.agents.assignAgent),s=g(D.agents.removeAgent),c=g(D.agents.setDefaultAgent),l=P();if(!e)return null;async function u(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(v(),e)}}async function d(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(k(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(W,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,Z.jsx)(z,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":_({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:A()}):null,e.outOfPool?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:y()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":j(),title:j(),children:(0,Z.jsx)(V,{size:14,fill:`currentColor`})}):(0,Z.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":O(),title:O(),disabled:c,onClick:()=>void d(e.agentId),children:(0,Z.jsx)(V,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return b();case`user`:return x();case`admin`:return E();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=U.filter(e=>n.has(G[e])).length;return(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(L,{asChild:!0,children:(0,Z.jsx)(N,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?p():f({count:r})})}),(0,Z.jsxs)(R,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(I,{children:S()}),U.map(e=>{let r=G[e];return(0,Z.jsxs)(xe,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(z,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Oe[e]()})]},e)})]})]})}function Le(){let e=F({from:`/settings/users`}),t=be({from:`/settings/users`}),n=e.q??``,i=e.role??Q,s=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),d=M(D.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),f=M(D.me.getMe,{host:Ae}),p=g(D.admin.setRole),h=g(D.admin.setUserPermissions),_=g(D.admin.startImpersonation),v=g(D.admin.deleteUser),y=g(D.admin.setUserName),b=Ce(),x=Se(),S=P(),[C,E]=(0,X.useState)(null),O=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of d??[])e.add(t.role);return[...e]},[d]),k=n!==``||i!==Q;function A(){t({search:{},replace:!0})}async function j(e){try{await p(e)}catch(e){S.error(r(),e)}}async function N(e){try{await h(e)}catch(e){S.error(ue(),e)}}async function I(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await b({title:ee(),description:_e({user:t}),confirmWord:ie(),confirmLabel:ve(),destructive:!0}))try{await v({profileId:e._id}),S.success(ne({user:t}))}catch(e){S.error(he(),e)}}async function L(e){let t=e.email||e.name||e.userId.slice(0,8),n=await x({title:le(),label:T({user:t}),placeholder:fe(),defaultValue:e.name??``,confirmLabel:a()});if(n!==null)try{await y({profileId:e._id,name:n}),S.success(se())}catch(e){S.error(oe(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(je,{q:n,onQChange:s,searchPlaceholder:m(),onReset:A,canReset:k,children:(0,Z.jsxs)(B,{value:i,onValueChange:l,children:[(0,Z.jsx)(H,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(J,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(Y,{value:Q,children:c()}),O.map(e=>(0,Z.jsx)(Y,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:u(),rows:d,emptyHint:te(),rowActions:e=>{let t=[{label:re(),onSelect:()=>E({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:ce(),onSelect:()=>void L(e)}];return e.userId!==f?.userId&&t.push({label:ge(),onSelect:()=>void _({profileId:e._id})},{label:o(),variant:`destructive`,onSelect:()=>void I(e)}),t},columns:[{header:me(),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:w(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(B,{value:e.role,onValueChange:t=>void j({profileId:e._id,role:t}),children:[(0,Z.jsx)(H,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(J,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(Y,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(Y,{value:`user`,children:$(`user`)}),(0,Z.jsx)(Y,{value:`admin`,children:$(`admin`)})]})]})},{header:ae(),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:pe()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),N({profileId:e._id,permissions:[...n]})}})},{header:de(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(W,{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:C?.profileId??null,userLabel:C?.label??``,open:C!==null,onOpenChange:e=>{e||E(null)}})]})}export{Le as UsersTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,AR as i,At as a,Bn as o,Bt as s,Fn as c,Ft as l,Gn as ee,Hn as u,Ht as d,IR as te,In as f,It as p,Jn as m,Kn as h,LD as g,Ln as _,MR as ne,Nt as v,Ot as y,Pt as b,Qn as re,RR as x,Rn as S,Td as C,Un as ie,Ut as ae,Vn as w,Vt as oe,Wn as T,Xn as se,Xt as ce,Yn as E,Zn as D,ar as le,er as O,eu as ue,gt as de,ir as fe,jt as k,kt as pe,nr as me,nu as A,qn as j,rr as M,t as N,tr as P,zR as F,zn as I,zt as L}from"./api-Dv9KEyyu.js";import{i as R,n as z,r as he,t as ge}from"./tabs-Dv-cJfvQ.js";import{t as B}from"./button-D9yXQ2Th.js";import{$t as V,Fn as _e,Jt as ve,Nn as ye,P as H,Pn as U,Qt as W,Xt as be,Yt as xe,Zt as Se,_t as G,bt as K,en as Ce,gn as we,nn as Te,ut as q,vt as J,wt as Ee,xt as Y,yt as X}from"./index-BAyOACwC.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>re()],[`fr-FR`,()=>ae()],[`en-US`,()=>d()],[`en-GB`,()=>oe()],[`de-DE`,()=>s()],[`es-ES`,()=>L()]],Oe=[[`0.75`,()=>se()],[`1`,()=>E()],[`1.25`,()=>m()],[`1.5`,()=>j()]],$=0;function ke({instance:e}){let t=x(N.admin.upsertInstanceConfig),n=e.config??{},i={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},[o,s]=(0,Z.useState)(i),[c,l]=(0,Z.useState)(`idle`),[d,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(!1),g=te(N.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{s({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}),l(`idle`)},[e._id]);let _=o.enabled!==i.enabled||o.engine!==i.engine||o.lang!==i.lang||o.rate!==i.rate||o.autoRead!==i.autoRead;async function v(){l(`saving`);try{let n={...e.config??{}};n.voiceEnabled=o.enabled,o.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,o.lang===`auto`?delete n.voiceLang:n.voiceLang=o.lang;let r=Number.parseFloat(o.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,o.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),l(`idle`)}catch{l(`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)(q,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(H,{checked:o.enabled,onCheckedChange:e=>s({...o,enabled:e===!0}),"aria-label":O()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:k()}),(0,Q.jsxs)(G,{value:o.engine,onValueChange:e=>s({...o,engine:e}),disabled:!o.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":k(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(X,{value:`browser`,children:a()}),e.kind===`hermes`?null:(0,Q.jsx)(X,{value:`gateway`,children:pe()})]})]})]}),o.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:y()}):null,o.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:r()}),(0,Q.jsxs)(G,{value:o.lang,onValueChange:e=>s({...o,lang:e}),disabled:!o.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":r(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:De.map(([e,t])=>(0,Q.jsx)(X,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()}),(0,Q.jsxs)(G,{value:o.rate,onValueChange:e=>s({...o,rate:e}),disabled:!o.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":D(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:Oe.map(([e,t])=>(0,Q.jsx)(X,{value:e,children:t()},e))})]})]}),o.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(H,{checked:o.autoRead,onCheckedChange:e=>s({...o,autoRead:e===!0}),disabled:!o.enabled,"aria-label":h()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:h()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ee()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(B,{size:`sm`,disabled:!_||c===`saving`,onClick:()=>void v(),children:c===`saving`?C():A()}),(0,Q.jsx)(B,{variant:`outline`,size:`sm`,disabled:!o.enabled||d,onClick:()=>{let t=Number.parseFloat(o.rate)||1,n=++$;if(m(!1),V(),W(),o.engine!==`gateway`){Se(u(),{lang:be(o.lang,ne()),rate:t});return}f(!0),g({instanceName:e.name,text:u()}).then(({mime:e,audioBase64:r})=>{n===$&&xe(r,e,{rate:t})}).catch(()=>{n===$&&m(!0)}).finally(()=>f(!1))},children:d?C():T()}),(0,Q.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>{$++,f(!1),V(),W()},children:ie()})]}),c===`error`||p?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:p?de():ue()}):null]})}function Ae({stt:e}){let t=F(N.me.getMe,{host:Ee}),n=x(N.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:o()}),(0,Q.jsx)(q,{variant:e?`secondary`:`outline`,children:e?f():c()}),(0,Q.jsx)(q,{variant:r?`secondary`:`destructive`,children:r?l():b()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(H,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":p()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:p()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:I()})]})}function je(){let e=F(N.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Ce(),[]),n=(0,Z.useMemo)(()=>ve(),[]),{section:r}=_e({from:`/settings/voice`}),a=U({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:le()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(q,{variant:t?`secondary`:`destructive`,children:t?fe():M()}),(0,Q.jsx)(q,{variant:n?`secondary`:`destructive`,children:n?me():P()})]}),(0,Q.jsxs)(ge,{value:r,onValueChange:e=>void a({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}),v()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(we,{size:13,"aria-hidden":!0}),o()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ye,{size:13,"aria-hidden":!0}),S()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):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.jsxs)(z,{value:`talk`,children:[(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsx)(`header`,{className:`oc-voice__cardhead`,children:(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:S()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:_()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=x(N.admin.upsertInstanceConfig),n=e.config??{},r=n.talkEnabled===!0,i=e.kind===`hermes`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(q,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ce()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(H,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":g()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:g()})]})]})}export{je as VoiceTab};