@lacneu/atrium 0.71.1 → 0.71.2

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 (38) hide show
  1. package/dist/assets/{AccessTab-DlQoKrwl.js → AccessTab-CDi-2yXo.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-DFrGEtLa.js → AdvancedFilter-oNVoBmr5.js} +1 -1
  3. package/dist/assets/{AgentFilesTab-BBM8oBxF.js → AgentFilesTab-YQT3_OHb.js} +1 -1
  4. package/dist/assets/{AnomaliesTab-DJ1B3dOd.js → AnomaliesTab-BRIph00P.js} +1 -1
  5. package/dist/assets/{AuditTab-BASOz-B8.js → AuditTab-CDR9vWDW.js} +1 -1
  6. package/dist/assets/{BridgeTab-O1_8og1n.js → BridgeTab-DeYPFNVq.js} +1 -1
  7. package/dist/assets/{ChatDefaultsTab-DmitAVGb.js → ChatDefaultsTab-V66EFWzF.js} +1 -1
  8. package/dist/assets/{DataTableShell-Blu6x63O.js → DataTableShell-BbVvH8AP.js} +1 -1
  9. package/dist/assets/{DetailChips-BlVaLSpP.js → DetailChips-CEPfBJ3C.js} +1 -1
  10. package/dist/assets/{FeedbacksTab-Ck8De4Wn.js → FeedbacksTab-ShRJwRig.js} +1 -1
  11. package/dist/assets/{FieldLabel-C770osCH.js → FieldLabel-YPTLow_x.js} +1 -1
  12. package/dist/assets/{FilesTab-Bxk_68Kj.js → FilesTab-DMUdEQ-m.js} +1 -1
  13. package/dist/assets/{FilterBar-CEm67UB9.js → FilterBar-BQxNZSAj.js} +1 -1
  14. package/dist/assets/{GroupsTab-C-7CdQ3a.js → GroupsTab-O4TXB1Ob.js} +1 -1
  15. package/dist/assets/{InstancesTab-CKA30eEX.js → InstancesTab-Ct4hI8bm.js} +1 -1
  16. package/dist/assets/{IntegrationsTab-CcfG2eY0.js → IntegrationsTab-Ba2AWn_y.js} +1 -1
  17. package/dist/assets/{KpiTab-Dhxg1-kd.js → KpiTab-DDTX8X_Y.js} +1 -1
  18. package/dist/assets/{PreferencesTab-DRrdj9mG.js → PreferencesTab-CxFocwvh.js} +1 -1
  19. package/dist/assets/{ProjectPage-Ci3OadjK.js → ProjectPage-DXNQdzDR.js} +1 -1
  20. package/dist/assets/{PromptInjectionsTab-DJjtPco1.js → PromptInjectionsTab-CFe9KSPE.js} +1 -1
  21. package/dist/assets/{RolesTab-DCBrCRZb.js → RolesTab-DWLOWJub.js} +1 -1
  22. package/dist/assets/{ScheduledTab-DGDFU0Bk.js → ScheduledTab-KxaffW0K.js} +1 -1
  23. package/dist/assets/{ServiceAccountsTab-DyTKwJG9.js → ServiceAccountsTab-D2kskvcN.js} +1 -1
  24. package/dist/assets/{SubAgentReportsTab-B02qCp_c.js → SubAgentReportsTab-Bu0h7qO-.js} +1 -1
  25. package/dist/assets/{ThemeShowroom-BGvRzcmy.js → ThemeShowroom-Drc8NJ8v.js} +1 -1
  26. package/dist/assets/{TimeRangePicker-CB4DnrpD.js → TimeRangePicker-zbyQlb0G.js} +1 -1
  27. package/dist/assets/{TimezoneCombobox-CctzkxmD.js → TimezoneCombobox-673xwoei.js} +1 -1
  28. package/dist/assets/{TracesTab-HVAvdwPR.js → TracesTab-DKr7xXLx.js} +1 -1
  29. package/dist/assets/{UsersTab-CYU_DFzy.js → UsersTab-CO_GLnNQ.js} +1 -1
  30. package/dist/assets/{VoiceTab-Bx2ftuML.js → VoiceTab-i90LqIO5.js} +1 -1
  31. package/dist/assets/{highlighted-body-OFNGDK62-DuD41Cm9.js → highlighted-body-OFNGDK62-DYD_5B4x.js} +1 -1
  32. package/dist/assets/{index-CUrvXfN_.js → index-D02RwoOe.js} +82 -82
  33. package/dist/assets/mermaid-GHXKKRXX-5UTQL7SN.js +1 -0
  34. package/dist/assets/{pdf-ChpiPXqQ.js → pdf-DWIi2vJu.js} +1 -1
  35. package/dist/assets/{tabs-bhZ9UeCn.js → tabs-DkJ2Ivbq.js} +1 -1
  36. package/dist/index.html +1 -1
  37. package/package.json +1 -1
  38. package/dist/assets/mermaid-GHXKKRXX-DNDVI1sN.js +0 -1
@@ -1 +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,BP as o,CP as s,D as c,DP as l,EP as u,FP as d,FR as f,GN as p,GP as m,GR as h,HP as g,IP as _,JN as v,JP as y,KN as ee,KP as te,KR as b,LP as ne,MP as re,NP as ie,NR as ae,OP as x,PP as oe,PR as se,QN as ce,QP as le,RP as ue,SP as de,TP as fe,UN as pe,UP as me,UR as he,VP as ge,WN as _e,WP as ve,XN as ye,XP as be,YN as xe,YP as Se,ZN as S,ZP as Ce,_P as we,aF as Te,aP as Ee,as as C,bP as De,cF as Oe,cP as ke,dF as Ae,dP as je,eF as Me,eP as Ne,fP as Pe,gP as Fe,hP as Ie,iF as Le,iP as Re,is as w,jP as ze,kP as Be,lF as Ve,lP as T,mP as He,nF as Ue,nP as We,ns as Ge,oF as Ke,oP as qe,pP as Je,qN as E,qP as Ye,r as Xe,rF as Ze,rP as Qe,rs as $e,sF as et,sP as tt,t as D,tF as O,tP as nt,uF as rt,uP as it,vP as at,wP as ot,xP as st,yP as ct,zP as lt}from"./api-BASu8PYC.js";import{t as k}from"./check-BVOFzT6U.js";import{t as A}from"./x-C5QQoypN.js";import{t as j}from"./button-_UzA03A_.js";import{$ as M,Dn as ut,En as N,Et as P,Ft as dt,G as ft,It as F,K as pt,Lt as mt,Mt as ht,Nt as gt,Pt as I,Q as L,X as R,Z as z,et as B,jt as V,q as H,ut as U}from"./index-CUrvXfN_.js";import{t as _t}from"./localePickerView-C2RmOS86.js";import{a as vt,i as yt,n as bt,o as xt,r as St,t as Ct}from"./card-BoGX4FTX.js";import{a as wt,i as W,n as Tt,o as G,r as K,t as Et}from"./table-ChZTpaGw.js";import{t as Dt}from"./TimeRangePicker-CB4DnrpD.js";import{t as Ot}from"./FilterBar-CEm67UB9.js";import{t as kt}from"./AdvancedFilter-DFrGEtLa.js";var q=c(`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`}]]),J=t(e(),1),At=.1,jt=[248,248,248],Mt=[24,24,24];function Nt(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 Pt(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 Y(e,t,n){return Pt(e,t,n)>=At}function Ft(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 It(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 Lt=12*1024*1024,Rt=480,zt=160,Bt=.92;async function Vt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Pe());if(e.size>Lt)throw Error(je());let{source:n,width:r,height:i,cleanup:a}=await Ht(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Rt/r,zt/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(T());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Nt(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(T());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);Y(e.data,d.width,d.height)?Ft(e.data,t.variantFor===`dark`?jt:Mt):It(e.data),p.putImageData(e,0,0)}let m=Y(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Wt(f,`image/webp`,Bt)??await Wt(f,`image/png`);if(!h)throw Error(ke());return{blob:h,hasAlpha:m}}finally{a()}}async function Ht(e){if(e.type===`image/svg+xml`)return Ut(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 Ut(e)}async function Ut(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(it())),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`?f():e===`dark`?se():ae()}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:Xe(`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)(k,{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)(j,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":C(),title:C(),children:(0,X.jsx)(ut,{className:`size-4`})}):null]})}function Qt({selectedKey:e,resolvedMode:t}){let n=b(D.charts.listMyCharts),r=h(D.charts.setMyChart);async function a(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:Ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ue()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Zt,{selected:e===null,title:O(),subtitle:Me(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?i():n.via===`owner`?le():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 a(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=h(D.charts.importChart),[t,n]=(0,J.useState)(``),[r,i]=(0,J.useState)(``),[o,s]=(0,J.useState)(null),[c,f]=(0,J.useState)(!1),[p,m]=(0,J.useState)(!1);async function g(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),f(!1);try{i(await t.text())}catch{s(x())}}}async function v(){if(s(null),f(!1),t.trim()===``){s(u());return}let a;try{a=JSON.parse(r)}catch{s(x());return}m(!0);try{await e({name:t.trim(),tokens:a}),f(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{m(!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:_()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:d()})]}),(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:oe()}),(0,X.jsx)(V,{value:t,onChange:e=>n(e.target.value),placeholder:ie(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:re()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:ze(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(q,{className:`size-4`}),a(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void g(e)})]})}),(0,X.jsx)(j,{size:`sm`,disabled:p,onClick:()=>void v(),children:Be()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:l()}):null]})]})}function en({chart:e}){let t=he(D.charts.setChartLogo),n=h(D.charts.removeChartLogo),[r,i]=(0,J.useState)(!1),[a,o]=(0,J.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 Vt(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`?ct():at()}),(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)(j,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(q,{className:`size-4`}),t?Fe():we(),(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)(j,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:He()}):null,t?(0,X.jsx)(j,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Ie()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:De()}),(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=b(D.me.getMe,{host:H}),n=h(D.charts.addChartDomain),r=h(D.charts.removeChartDomain),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:tt()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Qe()}):u.map(e=>(0,X.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":We({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(A,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(V,{value:i,onChange:e=>a(e.target.value),placeholder:Ee(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(j,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:Re()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:qe()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=h(D.charts.updateChart),n=h(D.charts.deleteChart),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(e.name),[c,l]=(0,J.useState)(()=>$(e.tokens)),[u,d]=(0,J.useState)(e.tokens.bpm??0),[f,p]=(0,J.useState)(null),[m,g]=(0,J.useState)(!1);function _(){s(e.name),l($(e.tokens)),d(e.tokens.bpm??0),p(null),a(!0)}async function v(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(c)}catch{p(x());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),a(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(S()))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:i?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(j,{variant:`outline`,size:`sm`,onClick:_,children:de()}),(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:st()})]})})]}),i?(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:r()}),(0,X.jsx)(V,{value:o,onChange:e=>s(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:w()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>d(Number(e.target.value)),"aria-label":w()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?$e():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ge()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ce()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{size:`sm`,disabled:m,onClick:()=>void v(),children:nt()}),(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>a(!1),children:Ne()})]})]}):null,(0,X.jsx)(en,{chart:e}),(0,X.jsx)(tn,{chart:e})]})}function rn(){let e=b(D.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:fe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ot()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:s()}):(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=h(D.charts.addChartToGroupPool),r=h(D.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,s=new Set((a??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(P,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?g():e.kind===`custom`&&e.scope===`personal`?E():me()}),e.isGlobalDefault?(0,X.jsx)(P,{variant:`default`,children:ge()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:lt()}),(a??[]).map(e=>(0,X.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ne({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(A,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(R,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(M,{size:`sm`,className:`w-56`,children:(0,X.jsx)(B,{placeholder:ue()})}),(0,X.jsx)(z,{children:c.map(e=>(0,X.jsx)(L,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:o()}):null]})]})}function on({chart:e}){let t=h(D.charts.promoteChartToCommon),n=h(D.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(S()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(P,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?ee():E()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:v({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(j,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:p()}):null,(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:_e()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=h(D.admin.setDefaultThemeMode),i=h(D.admin.setDefaultLocale),a=h(D.charts.setDefaultChart),o=b(D.charts.listChartsAdmin),s=b(D.groups.listGroups,{}),c=e??`system`,l=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:Te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Le()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:y()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:O()}),pt.map(e=>(0,X.jsx)(j,{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)(j,{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:Ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:te()})]}),(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:s??[]},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:m()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ve()})]}),(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:xe()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:pe()}):(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:Ae()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:rt()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(j,{variant:c===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:Ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Oe()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:_t().map(e=>(0,X.jsx)(j,{variant:l===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:et()})]})]})}function cn(){let e=b(D.me.getMe,{host:H}),t=ft(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,J.useState)(!0),[n,r]=(0,J.useState)(`per-user`),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(Z),[c,l]=(0,J.useState)(Z),[u,d]=(0,J.useState)(Kt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(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:Ke()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(j,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(j,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{size:`sm`,children:`Small`}),(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{size:`lg`,children:`Large`}),(0,X.jsx)(j,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(N,{})}),(0,X.jsx)(j,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(P,{children:`Default`}),(0,X.jsx)(P,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(P,{variant:`outline`,children:`Outline`}),(0,X.jsx)(P,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(V,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(R,{value:n,onValueChange:r,children:[(0,X.jsx)(M,{className:`w-56`,children:(0,X.jsx)(B,{placeholder:`Select…`})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(L,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(L,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(U,{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)(Ot,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(R,{value:o,onValueChange:s,children:[(0,X.jsx)(M,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(L,{value:Z,children:`Toutes directions`}),(0,X.jsx)(L,{value:`inbound`,children:`inbound`}),(0,X.jsx)(L,{value:`outbound`,children:`outbound`}),(0,X.jsx)(L,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(R,{value:c,onValueChange:l,children:[(0,X.jsx)(M,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(L,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(L,{value:`info`,children:`info`}),(0,X.jsx)(L,{value:`warn`,children:`warn`}),(0,X.jsx)(L,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(kt,{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)(Dt,{value:u,onChange:d})]})]})}),(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)(j,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(gt,{align:`start`,children:[(0,X.jsx)(dt,{children:`Actions`}),(0,X.jsx)(F,{}),(0,X.jsx)(I,{children:`Edit`}),(0,X.jsx)(I,{children:`Duplicate`}),(0,X.jsx)(F,{}),(0,X.jsx)(I,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(Ct,{className:`w-80`,children:[(0,X.jsxs)(vt,{children:[(0,X.jsx)(xt,{children:`Instance`}),(0,X.jsx)(St,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(bt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(yt,{className:`gap-2`,children:[(0,X.jsx)(j,{size:`sm`,children:`Save`}),(0,X.jsx)(j,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Et,{children:[(0,X.jsx)(wt,{children:(0,X.jsxs)(G,{children:[(0,X.jsx)(W,{className:`w-8`,children:(0,X.jsx)(U,{"aria-label":`select all`})}),(0,X.jsx)(W,{children:`Name`}),(0,X.jsx)(W,{children:`Mode`}),(0,X.jsx)(W,{className:`text-right`,children:`Status`}),(0,X.jsx)(W,{className:`w-8`})]})}),(0,X.jsx)(Tt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(G,{children:[(0,X.jsx)(K,{children:(0,X.jsx)(U,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(K,{className:`font-medium`,children:e.n}),(0,X.jsx)(K,{children:(0,X.jsx)(P,{variant:`secondary`,children:e.m})}),(0,X.jsx)(K,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(k,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(K,{children:(0,X.jsx)(j,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},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};
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,BP as o,CP as s,D as c,DP as l,EP as u,FP as d,FR as f,GN as p,GP as m,GR as h,HP as g,IP as _,JN as v,JP as y,KN as ee,KP as te,KR as b,LP as ne,MP as re,NP as ie,NR as ae,OP as x,PP as oe,PR as se,QN as ce,QP as le,RP as ue,SP as de,TP as fe,UN as pe,UP as me,UR as he,VP as ge,WN as _e,WP as ve,XN as ye,XP as be,YN as xe,YP as Se,ZN as S,ZP as Ce,_P as we,aF as Te,aP as Ee,as as C,bP as De,cF as Oe,cP as ke,dF as Ae,dP as je,eF as Me,eP as Ne,fP as Pe,gP as Fe,hP as Ie,iF as Le,iP as Re,is as w,jP as ze,kP as Be,lF as Ve,lP as T,mP as He,nF as Ue,nP as We,ns as Ge,oF as Ke,oP as qe,pP as Je,qN as E,qP as Ye,r as Xe,rF as Ze,rP as Qe,rs as $e,sF as et,sP as tt,t as D,tF as O,tP as nt,uF as rt,uP as it,vP as at,wP as ot,xP as st,yP as ct,zP as lt}from"./api-BASu8PYC.js";import{t as k}from"./check-BVOFzT6U.js";import{t as A}from"./x-C5QQoypN.js";import{t as j}from"./button-_UzA03A_.js";import{$ as M,Dn as ut,En as N,Et as P,Ft as dt,G as ft,It as F,K as pt,Lt as mt,Mt as ht,Nt as gt,Pt as I,Q as L,X as R,Z as z,et as B,jt as V,q as H,ut as U}from"./index-D02RwoOe.js";import{t as _t}from"./localePickerView-C2RmOS86.js";import{a as vt,i as yt,n as bt,o as xt,r as St,t as Ct}from"./card-BoGX4FTX.js";import{a as wt,i as W,n as Tt,o as G,r as K,t as Et}from"./table-ChZTpaGw.js";import{t as Dt}from"./TimeRangePicker-zbyQlb0G.js";import{t as Ot}from"./FilterBar-BQxNZSAj.js";import{t as kt}from"./AdvancedFilter-oNVoBmr5.js";var q=c(`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`}]]),J=t(e(),1),At=.1,jt=[248,248,248],Mt=[24,24,24];function Nt(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 Pt(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 Y(e,t,n){return Pt(e,t,n)>=At}function Ft(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 It(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 Lt=12*1024*1024,Rt=480,zt=160,Bt=.92;async function Vt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Pe());if(e.size>Lt)throw Error(je());let{source:n,width:r,height:i,cleanup:a}=await Ht(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Rt/r,zt/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(T());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Nt(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(T());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);Y(e.data,d.width,d.height)?Ft(e.data,t.variantFor===`dark`?jt:Mt):It(e.data),p.putImageData(e,0,0)}let m=Y(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Wt(f,`image/webp`,Bt)??await Wt(f,`image/png`);if(!h)throw Error(ke());return{blob:h,hasAlpha:m}}finally{a()}}async function Ht(e){if(e.type===`image/svg+xml`)return Ut(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 Ut(e)}async function Ut(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(it())),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`?f():e===`dark`?se():ae()}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:Xe(`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)(k,{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)(j,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":C(),title:C(),children:(0,X.jsx)(ut,{className:`size-4`})}):null]})}function Qt({selectedKey:e,resolvedMode:t}){let n=b(D.charts.listMyCharts),r=h(D.charts.setMyChart);async function a(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:Ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ue()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Zt,{selected:e===null,title:O(),subtitle:Me(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?i():n.via===`owner`?le():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 a(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=h(D.charts.importChart),[t,n]=(0,J.useState)(``),[r,i]=(0,J.useState)(``),[o,s]=(0,J.useState)(null),[c,f]=(0,J.useState)(!1),[p,m]=(0,J.useState)(!1);async function g(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),f(!1);try{i(await t.text())}catch{s(x())}}}async function v(){if(s(null),f(!1),t.trim()===``){s(u());return}let a;try{a=JSON.parse(r)}catch{s(x());return}m(!0);try{await e({name:t.trim(),tokens:a}),f(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{m(!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:_()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:d()})]}),(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:oe()}),(0,X.jsx)(V,{value:t,onChange:e=>n(e.target.value),placeholder:ie(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:re()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:ze(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(q,{className:`size-4`}),a(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void g(e)})]})}),(0,X.jsx)(j,{size:`sm`,disabled:p,onClick:()=>void v(),children:Be()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:l()}):null]})]})}function en({chart:e}){let t=he(D.charts.setChartLogo),n=h(D.charts.removeChartLogo),[r,i]=(0,J.useState)(!1),[a,o]=(0,J.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 Vt(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`?ct():at()}),(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)(j,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(q,{className:`size-4`}),t?Fe():we(),(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)(j,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:He()}):null,t?(0,X.jsx)(j,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Ie()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:De()}),(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=b(D.me.getMe,{host:H}),n=h(D.charts.addChartDomain),r=h(D.charts.removeChartDomain),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:tt()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Qe()}):u.map(e=>(0,X.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":We({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(A,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(V,{value:i,onChange:e=>a(e.target.value),placeholder:Ee(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(j,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:Re()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:qe()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=h(D.charts.updateChart),n=h(D.charts.deleteChart),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(e.name),[c,l]=(0,J.useState)(()=>$(e.tokens)),[u,d]=(0,J.useState)(e.tokens.bpm??0),[f,p]=(0,J.useState)(null),[m,g]=(0,J.useState)(!1);function _(){s(e.name),l($(e.tokens)),d(e.tokens.bpm??0),p(null),a(!0)}async function v(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(c)}catch{p(x());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),a(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(S()))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:i?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(j,{variant:`outline`,size:`sm`,onClick:_,children:de()}),(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:st()})]})})]}),i?(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:r()}),(0,X.jsx)(V,{value:o,onChange:e=>s(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:w()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>d(Number(e.target.value)),"aria-label":w()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?$e():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ge()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ce()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{size:`sm`,disabled:m,onClick:()=>void v(),children:nt()}),(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>a(!1),children:Ne()})]})]}):null,(0,X.jsx)(en,{chart:e}),(0,X.jsx)(tn,{chart:e})]})}function rn(){let e=b(D.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:fe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ot()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:s()}):(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=h(D.charts.addChartToGroupPool),r=h(D.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,s=new Set((a??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(P,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?g():e.kind===`custom`&&e.scope===`personal`?E():me()}),e.isGlobalDefault?(0,X.jsx)(P,{variant:`default`,children:ge()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:lt()}),(a??[]).map(e=>(0,X.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ne({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(A,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(R,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(M,{size:`sm`,className:`w-56`,children:(0,X.jsx)(B,{placeholder:ue()})}),(0,X.jsx)(z,{children:c.map(e=>(0,X.jsx)(L,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:o()}):null]})]})}function on({chart:e}){let t=h(D.charts.promoteChartToCommon),n=h(D.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(S()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(P,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?ee():E()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:v({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(j,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:p()}):null,(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:_e()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=h(D.admin.setDefaultThemeMode),i=h(D.admin.setDefaultLocale),a=h(D.charts.setDefaultChart),o=b(D.charts.listChartsAdmin),s=b(D.groups.listGroups,{}),c=e??`system`,l=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:Te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Le()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:y()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:O()}),pt.map(e=>(0,X.jsx)(j,{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)(j,{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:Ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:te()})]}),(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:s??[]},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:m()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ve()})]}),(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:xe()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:pe()}):(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:Ae()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:rt()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(j,{variant:c===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:Ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Oe()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:_t().map(e=>(0,X.jsx)(j,{variant:l===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:et()})]})]})}function cn(){let e=b(D.me.getMe,{host:H}),t=ft(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,J.useState)(!0),[n,r]=(0,J.useState)(`per-user`),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(Z),[c,l]=(0,J.useState)(Z),[u,d]=(0,J.useState)(Kt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(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:Ke()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(j,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(j,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{size:`sm`,children:`Small`}),(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{size:`lg`,children:`Large`}),(0,X.jsx)(j,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(N,{})}),(0,X.jsx)(j,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(P,{children:`Default`}),(0,X.jsx)(P,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(P,{variant:`outline`,children:`Outline`}),(0,X.jsx)(P,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(V,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(R,{value:n,onValueChange:r,children:[(0,X.jsx)(M,{className:`w-56`,children:(0,X.jsx)(B,{placeholder:`Select…`})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(L,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(L,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(U,{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)(Ot,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(R,{value:o,onValueChange:s,children:[(0,X.jsx)(M,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(L,{value:Z,children:`Toutes directions`}),(0,X.jsx)(L,{value:`inbound`,children:`inbound`}),(0,X.jsx)(L,{value:`outbound`,children:`outbound`}),(0,X.jsx)(L,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(R,{value:c,onValueChange:l,children:[(0,X.jsx)(M,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(L,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(L,{value:`info`,children:`info`}),(0,X.jsx)(L,{value:`warn`,children:`warn`}),(0,X.jsx)(L,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(kt,{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)(Dt,{value:u,onChange:d})]})]})}),(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)(j,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(gt,{align:`start`,children:[(0,X.jsx)(dt,{children:`Actions`}),(0,X.jsx)(F,{}),(0,X.jsx)(I,{children:`Edit`}),(0,X.jsx)(I,{children:`Duplicate`}),(0,X.jsx)(F,{}),(0,X.jsx)(I,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(Ct,{className:`w-80`,children:[(0,X.jsxs)(vt,{children:[(0,X.jsx)(xt,{children:`Instance`}),(0,X.jsx)(St,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(bt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(yt,{className:`gap-2`,children:[(0,X.jsx)(j,{size:`sm`,children:`Save`}),(0,X.jsx)(j,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Et,{children:[(0,X.jsx)(wt,{children:(0,X.jsxs)(G,{children:[(0,X.jsx)(W,{className:`w-8`,children:(0,X.jsx)(U,{"aria-label":`select all`})}),(0,X.jsx)(W,{children:`Name`}),(0,X.jsx)(W,{children:`Mode`}),(0,X.jsx)(W,{className:`text-right`,children:`Status`}),(0,X.jsx)(W,{className:`w-8`})]})}),(0,X.jsx)(Tt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(G,{children:[(0,X.jsx)(K,{children:(0,X.jsx)(U,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(K,{className:`font-medium`,children:e.n}),(0,X.jsx)(K,{children:(0,X.jsx)(P,{variant:`secondary`,children:e.m})}),(0,X.jsx)(K,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(k,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(K,{children:(0,X.jsx)(j,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},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};
@@ -1 +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-BASu8PYC.js";import{t as C}from"./button-_UzA03A_.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-CUrvXfN_.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
+ 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-BASu8PYC.js";import{t as C}from"./button-_UzA03A_.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-D02RwoOe.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{dI as r,fI as i,pI as a,uI as o}from"./api-BASu8PYC.js";import{t as s}from"./check-BVOFzT6U.js";import{t as c}from"./chevrons-up-down-DHCh-E-T.js";import{Bt as l,Rt as u,jt as d,zt as f}from"./index-CUrvXfN_.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:i(),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:r()}):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{dI as r,fI as i,pI as a,uI as o}from"./api-BASu8PYC.js";import{t as s}from"./check-BVOFzT6U.js";import{t as c}from"./chevrons-up-down-DHCh-E-T.js";import{Bt as l,Rt as u,jt as d,zt as f}from"./index-D02RwoOe.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:i(),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:r()}):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 +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,GR as y,HO as b,Hx as ee,IO as x,Ix as te,JO as S,KO as C,KR as w,LO as ne,Lx as re,Mx as ie,Nx as ae,OO as oe,Ox as se,Px as ce,QO as le,RO as ue,Rr as de,Rx as fe,SO as T,Sx as pe,TO as E,Tx as me,UO as D,VO as O,Vx as he,WO as k,XO as A,YO as j,ZO as M,_O as N,_x as ge,ak as _e,ax as ve,bO as P,bx as ye,cx as be,dx as xe,ek as F,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 I,rk as Ie,sx as Le,t as L,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 Ye,zx as Xe}from"./api-BASu8PYC.js";import{t as Ze}from"./check-BVOFzT6U.js";import{t as Qe}from"./x-C5QQoypN.js";import{i as R,n as z,r as $e,t as et}from"./tabs-bhZ9UeCn.js";import{t as B}from"./button-_UzA03A_.js";import{$ as V,Et as H,Fn as tt,H as nt,On as rt,Pn as it,Q as U,Tn as at,X as W,Z as G,a as ot,at as st,ct as K,et as q,i as ct,lt,nt as ut,o as dt,ot as ft,q as pt,rt as mt,s as ht,tt as gt,xn as _t}from"./index-CUrvXfN_.js";import{n as vt}from"./TimeRangePicker-CB4DnrpD.js";import{t as yt}from"./FilterBar-CEm67UB9.js";import{t as bt}from"./AdvancedFilter-DFrGEtLa.js";import{t as xt}from"./DataTableShell-Blu6x63O.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=w(L.me.getMe,{host:pt})?.role===`admin`,t=w(L.deliveryTiming.getDeliveryStatus,{}),n=y(L.deliveryTiming.startDeliveryRecord),r=y(L.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:_e()}),(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)(H,{variant:`secondary`,children:Re()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:F({time:lt(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?M():le()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=w(L.deliveryTiming.listDeliverySessions,{}),n=y(L.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)(W,{value:a,onValueChange:e=>o(e),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(q,{})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:`all`,children:S()}),(0,Y.jsx)(U,{value:`active`,children:I()}),(0,Y.jsx)(U,{value:`stopped`,children:C()})]})]})}),(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?ne():ue(),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:K(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:K(e.stoppedAt)})},{header:D(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:b(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:O(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(H,{variant:`secondary`,children:I()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:C()})}],rowActions:e?e=>[{label:x(),variant:`destructive`,onSelect:()=>_([e.sessionId])}]:void 0,bulkActions:e?[{label:x(),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=w(L.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:oe()}),(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:T()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:P()}):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:de()},{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=ct(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),ne=e=>void t({search:t=>({...t,limit:e})}),oe=e=>void t({search:t=>({...t,kind:e})}),le=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ue=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),de=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),T=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,...dt(e)})}),O=e=>void t({search:t=>({...t,adv:ot(e)}),replace:!0}),k=w(L.observability.listEvents,{limit:n}),A=w(L.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 _e(){t({search:{limit:100,kind:`all`},replace:!0})}let ve=b?k?.filter(e=>e.correlationId===b):A,P=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:P,onValueChange:e=>F(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:he()}),c(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:Xe()})]}),(0,Y.jsxs)(yt,{q:f,onQChange:le,searchPlaceholder:fe(),timeRange:m,onTimeRangeChange:D,onReset:_e,canReset:N,children:[(0,Y.jsxs)(W,{value:o,onValueChange:ue,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:re()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:te()}),jt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:s,onValueChange:de,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:_()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:ce()}),Mt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:l,onValueChange:T,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:ae()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:ie()}),Nt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:d,onValueChange:E,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(q,{placeholder:Oe()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:a()}),M.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:r,onValueChange:oe,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(q,{placeholder:Ae()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:At,children:se()}),j.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:String(n),onValueChange:e=>ne(Number(e)),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(q,{})}),(0,Y.jsx)(G,{children:kt.map(e=>(0,Y.jsx)(U,{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:[me(),(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:ve,emptyHint:b?pe():Ge(),columns:[{header:ye(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:K(e.at)})},{header:qe(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(H,{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":ge(),children:`✓`})}},{header:we(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(H,{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)(H,{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)(H,{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:xe(),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:be(),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)(gt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(ut,{className:`max-w-lg`,children:[(0,Y.jsxs)(st,{children:[(0,Y.jsxs)(ft,{className:`oc-traces__meta-title`,children:[Pe(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(H,{variant:`outline`,children:ve()})]}),(0,Y.jsx)(mt,{children:De()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
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,GR as y,HO as b,Hx as ee,IO as x,Ix as te,JO as S,KO as C,KR as w,LO as ne,Lx as re,Mx as ie,Nx as ae,OO as oe,Ox as se,Px as ce,QO as le,RO as ue,Rr as de,Rx as fe,SO as T,Sx as pe,TO as E,Tx as me,UO as D,VO as O,Vx as he,WO as k,XO as A,YO as j,ZO as M,_O as N,_x as ge,ak as _e,ax as ve,bO as P,bx as ye,cx as be,dx as xe,ek as F,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 I,rk as Ie,sx as Le,t as L,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 Ye,zx as Xe}from"./api-BASu8PYC.js";import{t as Ze}from"./check-BVOFzT6U.js";import{t as Qe}from"./x-C5QQoypN.js";import{i as R,n as z,r as $e,t as et}from"./tabs-DkJ2Ivbq.js";import{t as B}from"./button-_UzA03A_.js";import{$ as V,Et as H,Fn as tt,H as nt,On as rt,Pn as it,Q as U,Tn as at,X as W,Z as G,a as ot,at as st,ct as K,et as q,i as ct,lt,nt as ut,o as dt,ot as ft,q as pt,rt as mt,s as ht,tt as gt,xn as _t}from"./index-D02RwoOe.js";import{n as vt}from"./TimeRangePicker-zbyQlb0G.js";import{t as yt}from"./FilterBar-BQxNZSAj.js";import{t as bt}from"./AdvancedFilter-oNVoBmr5.js";import{t as xt}from"./DataTableShell-BbVvH8AP.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=w(L.me.getMe,{host:pt})?.role===`admin`,t=w(L.deliveryTiming.getDeliveryStatus,{}),n=y(L.deliveryTiming.startDeliveryRecord),r=y(L.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:_e()}),(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)(H,{variant:`secondary`,children:Re()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:F({time:lt(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?M():le()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=w(L.deliveryTiming.listDeliverySessions,{}),n=y(L.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)(W,{value:a,onValueChange:e=>o(e),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(q,{})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:`all`,children:S()}),(0,Y.jsx)(U,{value:`active`,children:I()}),(0,Y.jsx)(U,{value:`stopped`,children:C()})]})]})}),(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?ne():ue(),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:K(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:K(e.stoppedAt)})},{header:D(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:b(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:O(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(H,{variant:`secondary`,children:I()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:C()})}],rowActions:e?e=>[{label:x(),variant:`destructive`,onSelect:()=>_([e.sessionId])}]:void 0,bulkActions:e?[{label:x(),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=w(L.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:oe()}),(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:T()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:P()}):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:de()},{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=ct(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),ne=e=>void t({search:t=>({...t,limit:e})}),oe=e=>void t({search:t=>({...t,kind:e})}),le=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ue=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),de=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),T=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,...dt(e)})}),O=e=>void t({search:t=>({...t,adv:ot(e)}),replace:!0}),k=w(L.observability.listEvents,{limit:n}),A=w(L.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 _e(){t({search:{limit:100,kind:`all`},replace:!0})}let ve=b?k?.filter(e=>e.correlationId===b):A,P=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:P,onValueChange:e=>F(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:he()}),c(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:Xe()})]}),(0,Y.jsxs)(yt,{q:f,onQChange:le,searchPlaceholder:fe(),timeRange:m,onTimeRangeChange:D,onReset:_e,canReset:N,children:[(0,Y.jsxs)(W,{value:o,onValueChange:ue,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:re()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:te()}),jt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:s,onValueChange:de,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:_()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:ce()}),Mt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:l,onValueChange:T,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:ae()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:ie()}),Nt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:d,onValueChange:E,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(q,{placeholder:Oe()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:a()}),M.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:r,onValueChange:oe,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(q,{placeholder:Ae()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:At,children:se()}),j.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:String(n),onValueChange:e=>ne(Number(e)),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(q,{})}),(0,Y.jsx)(G,{children:kt.map(e=>(0,Y.jsx)(U,{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:[me(),(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:ve,emptyHint:b?pe():Ge(),columns:[{header:ye(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:K(e.at)})},{header:qe(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(H,{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":ge(),children:`✓`})}},{header:we(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(H,{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)(H,{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)(H,{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:xe(),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:be(),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)(gt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(ut,{className:`max-w-lg`,children:[(0,Y.jsxs)(st,{children:[(0,Y.jsxs)(ft,{className:`oc-traces__meta-title`,children:[Pe(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(H,{variant:`outline`,children:ve()})]}),(0,Y.jsx)(mt,{children:De()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
@@ -1 +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,GR as f,KR as p,ME as m,NE as h,OE as g,Ob as _,SE as ee,Sb as v,TE as te,Tb as y,_E as b,aE as x,bE as ne,bb as S,cE as re,dE as ie,df as C,fE as ae,ff as w,gE as T,hE as E,jE as D,kE as oe,kb as O,lE as se,mE as ce,oE as le,pE as ue,pf as k,sE as de,t as A,uE as fe,vE as pe,vb as j,wE as me,wb as M,xE as he,xb as N,yE as ge,yb as P}from"./api-BASu8PYC.js";import{t as F}from"./button-_UzA03A_.js";import{$ as I,Dt as L,Et as R,Fn as _e,Ft as z,Lt as ve,Mt as ye,Nt as be,Pn as xe,Pt as Se,Q as B,U as Ce,W as we,X as V,Z as H,an as U,at as Te,c as W,et as G,l as Ee,nt as De,on as K,ot as Oe,q as ke,rt as Ae,tt as je,u as q,ut as J}from"./index-CUrvXfN_.js";import{t as Y}from"./FilterBar-CEm67UB9.js";import{t as Me}from"./DataTableShell-Blu6x63O.js";import{t as Ne}from"./DetailChips-BlVaLSpP.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let a=p(A.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=p(A.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,m=new Set((a?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),h=[...(a?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).filter(e=>!m.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 h){let t=g.get(e.instanceName)??[];t.push(e),g.set(e.instanceName,t)}return(0,Z.jsx)(je,{open:n,onOpenChange:r,children:(0,Z.jsxs)(De,{className:`oc-access`,children:[(0,Z.jsxs)(Te,{children:[(0,Z.jsx)(Oe,{children:i({user:t})}),(0,Z.jsx)(Ae,{children:O()})]}),a?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:a.inGroup?_():l()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:a===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:d()}):h.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=f(A.agents.assignAgent),s=f(A.agents.removeAgent),c=f(A.agents.setDefaultAgent),l=L();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(y(),e)}}async function d(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(M(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(K,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(R,{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)(J,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":v({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)(R,{variant:`outline`,className:`oc-access__gone`,children:N()}):null,e.outOfPool?(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:S()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":P(),title:P(),children:(0,Z.jsx)(U,{size:14,fill:`currentColor`})}):(0,Z.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":j(),title:j(),disabled:c,onClick:()=>void d(e.agentId),children:(0,Z.jsx)(U,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return C();case`user`:return w();case`admin`:return k();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=W.filter(e=>n.has(q[e])).length;return(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(ve,{asChild:!0,children:(0,Z.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?h():m({count:r})})}),(0,Z.jsxs)(be,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(z,{children:D()}),W.map(e=>{let r=q[e];return(0,Z.jsxs)(Se,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(J,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Ee[e]()})]},e)})]})]})}function Le(){let e=_e({from:`/settings/users`}),t=xe({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=p(A.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),m=p(A.me.getMe,{host:ke}),h=f(A.admin.setRole),_=f(A.admin.setUserPermissions),v=f(A.admin.startImpersonation),y=f(A.admin.deleteUser),S=f(A.admin.setUserName),C=Ce(),w=we(),D=L(),[O,k]=(0,X.useState)(null),j=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of d??[])e.add(t.role);return[...e]},[d]),M=n!==``||i!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await h(e)}catch(e){D.error(r(),e)}}async function F(e){try{await _(e)}catch(e){D.error(oe(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await C({title:ee(),description:he({user:t}),confirmWord:ne(),confirmLabel:ge(),destructive:!0}))try{await y({profileId:e._id}),D.success(b({user:t}))}catch(e){D.error(pe(),e)}}async function z(e){let t=e.email||e.name||e.userId.slice(0,8),n=await w({title:E(),label:ce({user:t}),placeholder:ue(),defaultValue:e.name??``,confirmLabel:a()});if(n!==null)try{await S({profileId:e._id,name:n}),D.success(ae())}catch(e){D.error(ie(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y,{q:n,onQChange:s,searchPlaceholder:g(),onReset:N,canReset:M,children:(0,Z.jsxs)(V,{value:i,onValueChange:l,children:[(0,Z.jsx)(I,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(B,{value:Q,children:c()}),j.map(e=>(0,Z.jsx)(B,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:u(),rows:d,emptyHint:te(),rowActions:e=>{let t=[{label:x(),onSelect:()=>k({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:T(),onSelect:()=>void z(e)}];return e.userId!==m?.userId&&t.push({label:me(),onSelect:()=>void v({profileId:e._id})},{label:o(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:fe(),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:se(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(V,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,Z.jsx)(I,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(B,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(B,{value:`user`,children:$(`user`)}),(0,Z.jsx)(B,{value:`admin`,children:$(`admin`)})]})]})},{header:re(),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:de()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),F({profileId:e._id,permissions:[...n]})}})},{header:le(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(K,{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:O?.profileId??null,userLabel:O?.label??``,open:O!==null,onOpenChange:e=>{e||k(null)}})]})}export{Le as UsersTab};
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,GR as f,KR as p,ME as m,NE as h,OE as g,Ob as _,SE as ee,Sb as v,TE as te,Tb as y,_E as b,aE as x,bE as ne,bb as S,cE as re,dE as ie,df as C,fE as ae,ff as w,gE as T,hE as E,jE as D,kE as oe,kb as O,lE as se,mE as ce,oE as le,pE as ue,pf as k,sE as de,t as A,uE as fe,vE as pe,vb as j,wE as me,wb as M,xE as he,xb as N,yE as ge,yb as P}from"./api-BASu8PYC.js";import{t as F}from"./button-_UzA03A_.js";import{$ as I,Dt as L,Et as R,Fn as _e,Ft as z,Lt as ve,Mt as ye,Nt as be,Pn as xe,Pt as Se,Q as B,U as Ce,W as we,X as V,Z as H,an as U,at as Te,c as W,et as G,l as Ee,nt as De,on as K,ot as Oe,q as ke,rt as Ae,tt as je,u as q,ut as J}from"./index-D02RwoOe.js";import{t as Y}from"./FilterBar-BQxNZSAj.js";import{t as Me}from"./DataTableShell-BbVvH8AP.js";import{t as Ne}from"./DetailChips-CEPfBJ3C.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let a=p(A.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=p(A.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,m=new Set((a?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),h=[...(a?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).filter(e=>!m.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 h){let t=g.get(e.instanceName)??[];t.push(e),g.set(e.instanceName,t)}return(0,Z.jsx)(je,{open:n,onOpenChange:r,children:(0,Z.jsxs)(De,{className:`oc-access`,children:[(0,Z.jsxs)(Te,{children:[(0,Z.jsx)(Oe,{children:i({user:t})}),(0,Z.jsx)(Ae,{children:O()})]}),a?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:a.inGroup?_():l()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:a===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:d()}):h.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=f(A.agents.assignAgent),s=f(A.agents.removeAgent),c=f(A.agents.setDefaultAgent),l=L();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(y(),e)}}async function d(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(M(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(K,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(R,{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)(J,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":v({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)(R,{variant:`outline`,className:`oc-access__gone`,children:N()}):null,e.outOfPool?(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:S()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":P(),title:P(),children:(0,Z.jsx)(U,{size:14,fill:`currentColor`})}):(0,Z.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":j(),title:j(),disabled:c,onClick:()=>void d(e.agentId),children:(0,Z.jsx)(U,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return C();case`user`:return w();case`admin`:return k();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=W.filter(e=>n.has(q[e])).length;return(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(ve,{asChild:!0,children:(0,Z.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?h():m({count:r})})}),(0,Z.jsxs)(be,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(z,{children:D()}),W.map(e=>{let r=q[e];return(0,Z.jsxs)(Se,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(J,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Ee[e]()})]},e)})]})]})}function Le(){let e=_e({from:`/settings/users`}),t=xe({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=p(A.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),m=p(A.me.getMe,{host:ke}),h=f(A.admin.setRole),_=f(A.admin.setUserPermissions),v=f(A.admin.startImpersonation),y=f(A.admin.deleteUser),S=f(A.admin.setUserName),C=Ce(),w=we(),D=L(),[O,k]=(0,X.useState)(null),j=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of d??[])e.add(t.role);return[...e]},[d]),M=n!==``||i!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await h(e)}catch(e){D.error(r(),e)}}async function F(e){try{await _(e)}catch(e){D.error(oe(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await C({title:ee(),description:he({user:t}),confirmWord:ne(),confirmLabel:ge(),destructive:!0}))try{await y({profileId:e._id}),D.success(b({user:t}))}catch(e){D.error(pe(),e)}}async function z(e){let t=e.email||e.name||e.userId.slice(0,8),n=await w({title:E(),label:ce({user:t}),placeholder:ue(),defaultValue:e.name??``,confirmLabel:a()});if(n!==null)try{await S({profileId:e._id,name:n}),D.success(ae())}catch(e){D.error(ie(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y,{q:n,onQChange:s,searchPlaceholder:g(),onReset:N,canReset:M,children:(0,Z.jsxs)(V,{value:i,onValueChange:l,children:[(0,Z.jsx)(I,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(B,{value:Q,children:c()}),j.map(e=>(0,Z.jsx)(B,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:u(),rows:d,emptyHint:te(),rowActions:e=>{let t=[{label:x(),onSelect:()=>k({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:T(),onSelect:()=>void z(e)}];return e.userId!==m?.userId&&t.push({label:me(),onSelect:()=>void v({profileId:e._id})},{label:o(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:fe(),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:se(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(V,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,Z.jsx)(I,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(B,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(B,{value:`user`,children:$(`user`)}),(0,Z.jsx)(B,{value:`admin`,children:$(`admin`)})]})]})},{header:re(),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:de()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),F({profileId:e._id,permissions:[...n]})}})},{header:le(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(K,{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:O?.profileId??null,userLabel:O?.label??``,open:O!==null,onOpenChange:e=>{e||k(null)}})]})}export{Le as UsersTab};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,At as i,Bn as a,Bt as o,Fn as s,Ft as c,GR as l,Gn as ee,Hn as u,Ht as d,In as f,It as p,Jn as m,KR as h,Kn as g,LD as _,LR as v,Ln as y,Nt as te,Ot as ne,Pt as re,Qn as b,Rn as x,Td as S,UR as ie,Un as C,Ut as w,Vn as T,Vt as ae,Wn as oe,Xn as se,Xt as ce,Yn as le,Zn as E,ar as ue,er as D,eu as de,gt as fe,ir as pe,jt as O,kt as me,nr as k,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-BASu8PYC.js";import{i as R,n as z,r as he,t as B}from"./tabs-bhZ9UeCn.js";import{t as V}from"./button-_UzA03A_.js";import{$ as H,$t as U,Et as W,Fn as ge,Jt as _e,Nn as ve,Pn as ye,Q as G,Qt as K,X as q,Xt as be,Yt as xe,Z as J,Zt as Se,en as Ce,et as Y,gn as we,nn as Te,q as Ee,ut as X}from"./index-CUrvXfN_.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>b()],[`fr-FR`,()=>w()],[`en-US`,()=>d()],[`en-GB`,()=>ae()],[`de-DE`,()=>o()],[`es-ES`,()=>L()]],Oe=[[`0.75`,()=>se()],[`1`,()=>le()],[`1.25`,()=>m()],[`1.5`,()=>j()]],$=0;function ke({instance:e}){let t=l(N.admin.upsertInstanceConfig),n=e.config??{},a={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[o,s]=(0,Z.useState)(a),[c,d]=(0,Z.useState)(`idle`),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(!1),_=ie(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}),d(`idle`)},[e._id]);let v=o.enabled!==a.enabled||o.engine!==a.engine||o.lang!==a.lang||o.rate!==a.rate||o.autoRead!==a.autoRead;async function y(){d(`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}),d(`idle`)}catch{d(`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)(W,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:o.enabled,onCheckedChange:e=>s({...o,enabled:e===!0}),"aria-label":D()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()}),(0,Q.jsxs)(q,{value:o.engine,onValueChange:e=>s({...o,engine:e}),disabled:!o.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":O(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(G,{value:`browser`,children:i()}),e.kind===`hermes`?null:(0,Q.jsx)(G,{value:`gateway`,children:me()})]})]})]}),o.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ne()}):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)(q,{value:o.lang,onValueChange:e=>s({...o,lang:e}),disabled:!o.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":r(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:De.map(([e,t])=>(0,Q.jsx)(G,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:E()}),(0,Q.jsxs)(q,{value:o.rate,onValueChange:e=>s({...o,rate:e}),disabled:!o.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":E(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:Oe.map(([e,t])=>(0,Q.jsx)(G,{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)(X,{checked:o.autoRead,onCheckedChange:e=>s({...o,autoRead:e===!0}),disabled:!o.enabled,"aria-label":g()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:g()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ee()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(V,{size:`sm`,disabled:!v||c===`saving`,onClick:()=>void y(),children:c===`saving`?S():A()}),(0,Q.jsx)(V,{variant:`outline`,size:`sm`,disabled:!o.enabled||f,onClick:()=>{let t=Number.parseFloat(o.rate)||1,n=++$;if(h(!1),U(),K(),o.engine!==`gateway`){Se(u(),{lang:be(o.lang,F()),rate:t});return}p(!0),_({instanceName:e.name,text:u()}).then(({mime:e,audioBase64:r})=>{n===$&&xe(r,e,{rate:t})}).catch(()=>{n===$&&h(!0)}).finally(()=>p(!1))},children:f?S():oe()}),(0,Q.jsx)(V,{variant:`ghost`,size:`sm`,onClick:()=>{$++,p(!1),U(),K()},children:C()})]}),c===`error`||m?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:m?fe():de()}):null]})}function Ae({stt:e}){let t=h(N.me.getMe,{host:Ee}),n=l(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:a()}),(0,Q.jsx)(W,{variant:e?`secondary`:`outline`,children:e?f():s()}),(0,Q.jsx)(W,{variant:r?`secondary`:`destructive`,children:r?c():re()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{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=h(N.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Ce(),[]),n=(0,Z.useMemo)(()=>_e(),[]),{section:r}=ge({from:`/settings/voice`}),i=ye({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ue()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(W,{variant:t?`secondary`:`destructive`,children:t?pe():M()}),(0,Q.jsx)(W,{variant:n?`secondary`:`destructive`,children:n?k():P()})]}),(0,Q.jsxs)(B,{value:r,onValueChange:e=>void i({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(he,{className:`w-full`,children:[(0,Q.jsxs)(R,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Te,{size:13,"aria-hidden":!0}),te()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(we,{size:13,"aria-hidden":!0}),a()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),x()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):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:x()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:y()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=l(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)(W,{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)(X,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":_()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:_()})]})]})}export{je as VoiceTab};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,At as i,Bn as a,Bt as o,Fn as s,Ft as c,GR as l,Gn as ee,Hn as u,Ht as d,In as f,It as p,Jn as m,KR as h,Kn as g,LD as _,LR as v,Ln as y,Nt as te,Ot as ne,Pt as re,Qn as b,Rn as x,Td as S,UR as ie,Un as C,Ut as w,Vn as T,Vt as ae,Wn as oe,Xn as se,Xt as ce,Yn as le,Zn as E,ar as ue,er as D,eu as de,gt as fe,ir as pe,jt as O,kt as me,nr as k,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-BASu8PYC.js";import{i as R,n as z,r as he,t as B}from"./tabs-DkJ2Ivbq.js";import{t as V}from"./button-_UzA03A_.js";import{$ as H,$t as U,Et as W,Fn as ge,Jt as _e,Nn as ve,Pn as ye,Q as G,Qt as K,X as q,Xt as be,Yt as xe,Z as J,Zt as Se,en as Ce,et as Y,gn as we,nn as Te,q as Ee,ut as X}from"./index-D02RwoOe.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>b()],[`fr-FR`,()=>w()],[`en-US`,()=>d()],[`en-GB`,()=>ae()],[`de-DE`,()=>o()],[`es-ES`,()=>L()]],Oe=[[`0.75`,()=>se()],[`1`,()=>le()],[`1.25`,()=>m()],[`1.5`,()=>j()]],$=0;function ke({instance:e}){let t=l(N.admin.upsertInstanceConfig),n=e.config??{},a={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[o,s]=(0,Z.useState)(a),[c,d]=(0,Z.useState)(`idle`),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(!1),_=ie(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}),d(`idle`)},[e._id]);let v=o.enabled!==a.enabled||o.engine!==a.engine||o.lang!==a.lang||o.rate!==a.rate||o.autoRead!==a.autoRead;async function y(){d(`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}),d(`idle`)}catch{d(`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)(W,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:o.enabled,onCheckedChange:e=>s({...o,enabled:e===!0}),"aria-label":D()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()}),(0,Q.jsxs)(q,{value:o.engine,onValueChange:e=>s({...o,engine:e}),disabled:!o.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":O(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(G,{value:`browser`,children:i()}),e.kind===`hermes`?null:(0,Q.jsx)(G,{value:`gateway`,children:me()})]})]})]}),o.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ne()}):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)(q,{value:o.lang,onValueChange:e=>s({...o,lang:e}),disabled:!o.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":r(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:De.map(([e,t])=>(0,Q.jsx)(G,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:E()}),(0,Q.jsxs)(q,{value:o.rate,onValueChange:e=>s({...o,rate:e}),disabled:!o.enabled,children:[(0,Q.jsx)(H,{size:`sm`,"aria-label":E(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:Oe.map(([e,t])=>(0,Q.jsx)(G,{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)(X,{checked:o.autoRead,onCheckedChange:e=>s({...o,autoRead:e===!0}),disabled:!o.enabled,"aria-label":g()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:g()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ee()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(V,{size:`sm`,disabled:!v||c===`saving`,onClick:()=>void y(),children:c===`saving`?S():A()}),(0,Q.jsx)(V,{variant:`outline`,size:`sm`,disabled:!o.enabled||f,onClick:()=>{let t=Number.parseFloat(o.rate)||1,n=++$;if(h(!1),U(),K(),o.engine!==`gateway`){Se(u(),{lang:be(o.lang,F()),rate:t});return}p(!0),_({instanceName:e.name,text:u()}).then(({mime:e,audioBase64:r})=>{n===$&&xe(r,e,{rate:t})}).catch(()=>{n===$&&h(!0)}).finally(()=>p(!1))},children:f?S():oe()}),(0,Q.jsx)(V,{variant:`ghost`,size:`sm`,onClick:()=>{$++,p(!1),U(),K()},children:C()})]}),c===`error`||m?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:m?fe():de()}):null]})}function Ae({stt:e}){let t=h(N.me.getMe,{host:Ee}),n=l(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:a()}),(0,Q.jsx)(W,{variant:e?`secondary`:`outline`,children:e?f():s()}),(0,Q.jsx)(W,{variant:r?`secondary`:`destructive`,children:r?c():re()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{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=h(N.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Ce(),[]),n=(0,Z.useMemo)(()=>_e(),[]),{section:r}=ge({from:`/settings/voice`}),i=ye({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ue()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(W,{variant:t?`secondary`:`destructive`,children:t?pe():M()}),(0,Q.jsx)(W,{variant:n?`secondary`:`destructive`,children:n?k():P()})]}),(0,Q.jsxs)(B,{value:r,onValueChange:e=>void i({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(he,{className:`w-full`,children:[(0,Q.jsxs)(R,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Te,{size:13,"aria-hidden":!0}),te()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(we,{size:13,"aria-hidden":!0}),a()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),x()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):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:x()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:y()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=l(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)(W,{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)(X,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":_()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:_()})]})]})}export{je as VoiceTab};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{dt as r,ft as i,pt as a}from"./index-CUrvXfN_.js";var o=t(e(),1),s=n(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(a),p=i(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(r,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{dt as r,ft as i,pt as a}from"./index-D02RwoOe.js";var o=t(e(),1),s=n(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(a),p=i(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(r,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};