@lacneu/atrium 0.55.4 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/assets/AccessTab-CSh3tcHp.js +1 -0
  2. package/dist/assets/{AdvancedFilter-gE4hTfw8.js → AdvancedFilter-CcMolhzz.js} +1 -1
  3. package/dist/assets/AgentFilesTab-DD7nQPIs.js +3 -0
  4. package/dist/assets/AnomaliesTab-CGUn5M38.js +1 -0
  5. package/dist/assets/AuditTab-BAmXWdpn.js +1 -0
  6. package/dist/assets/BridgeTab-B6u6wsyS.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-T-SjwUiO.js +1 -0
  8. package/dist/assets/{DataTableShell-CcVtwrRQ.js → DataTableShell-DKcU9E8v.js} +1 -1
  9. package/dist/assets/{DetailChips-CN8LrgGO.js → DetailChips-BHFRTi5X.js} +1 -1
  10. package/dist/assets/FeedbacksTab-BTNSHMXX.js +1 -0
  11. package/dist/assets/{FieldLabel-elWVqmbc.js → FieldLabel-BhXlfWG6.js} +1 -1
  12. package/dist/assets/FilesTab-CQ9OQmvl.js +1 -0
  13. package/dist/assets/{FilterBar-CGBz7_qR.js → FilterBar-BVzupjQK.js} +1 -1
  14. package/dist/assets/GroupsTab-DQ1ql751.js +1 -0
  15. package/dist/assets/InstancesTab-DnDS69jL.js +1 -0
  16. package/dist/assets/IntegrationsTab-x8aaAzQY.js +1 -0
  17. package/dist/assets/KpiTab-CSduQ5s8.js +1 -0
  18. package/dist/assets/PreferencesTab-DylL7Q2H.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-DbjWSlzY.js +4 -0
  20. package/dist/assets/RolesTab-Bx3akDip.js +1 -0
  21. package/dist/assets/ScheduledTab-nsdy0Bh_.js +1 -0
  22. package/dist/assets/ServiceAccountsTab-D8rsyxJF.js +1 -0
  23. package/dist/assets/SubAgentReportsTab-CSj0Hba1.js +1 -0
  24. package/dist/assets/ThemeShowroom-BwmvZBXd.js +1 -0
  25. package/dist/assets/{TimeRangePicker-CxfILbJE.js → TimeRangePicker-0VkTfHt_.js} +1 -1
  26. package/dist/assets/TracesTab-QD7eyy39.js +1 -0
  27. package/dist/assets/UsersTab-C0eniehN.js +1 -0
  28. package/dist/assets/VoiceTab-BRfeYXDu.js +1 -0
  29. package/dist/assets/{button-CdHluvSK.js → button-B49JSqzm.js} +1 -1
  30. package/dist/assets/{card-AXe34vGw.js → card-eKiPt2Wc.js} +1 -1
  31. package/dist/assets/chevrons-up-down-CWDbG1Cy.js +1 -0
  32. package/dist/assets/{compatView-CB9xzhbT.js → compatView-C1X2zgFr.js} +1 -1
  33. package/dist/assets/dispatchErrorInfo-DdP7JU_7.js +1 -0
  34. package/dist/assets/{dist-CchsedUP.js → dist-BINM1nJo.js} +1 -1
  35. package/dist/assets/{dist-x2y4VoOj.js → dist-C0sZxuDo.js} +1 -1
  36. package/dist/assets/{dist-BKXYNjW7.js → dist-CjH9Ohdx.js} +5 -5
  37. package/dist/assets/{dist-D06QCQPB.js → dist-DCbB4klt.js} +1 -1
  38. package/dist/assets/{highlighted-body-OFNGDK62-DNCL1qt_.js → highlighted-body-OFNGDK62-CwsFUg2x.js} +1 -1
  39. package/dist/assets/index-CAAremuB.css +2 -0
  40. package/dist/assets/index-DnuEILeM.js +238 -0
  41. package/dist/assets/mermaid-GHXKKRXX-d9fLQ_Fe.js +1 -0
  42. package/dist/assets/{pdf-BlJTUgBI.js → pdf-BZLyWd4d.js} +1 -1
  43. package/dist/assets/roleDescriptions-C6Gqx97s.js +1 -0
  44. package/dist/assets/{table-BlgvNhKf.js → table-COx9FvKU.js} +1 -1
  45. package/dist/assets/{tabs-BHnM2BeW.js → tabs-BFg7qw3e.js} +1 -1
  46. package/dist/assets/x-DYJkW-kP.js +1 -0
  47. package/dist/index.html +8 -8
  48. package/package.json +1 -1
  49. package/dist/assets/AccessTab-BlAZu92G.js +0 -1
  50. package/dist/assets/AgentFilesTab-DXmwR5XT.js +0 -3
  51. package/dist/assets/AnomaliesTab-BcuZ6-OT.js +0 -1
  52. package/dist/assets/AuditTab-C-XOYh_i.js +0 -1
  53. package/dist/assets/BridgeTab-DJMBid3T.js +0 -1
  54. package/dist/assets/ChatDefaultsTab-BVfKA1sx.js +0 -1
  55. package/dist/assets/FeedbacksTab-1CFUrJgw.js +0 -1
  56. package/dist/assets/FilesTab-DMG5NM2r.js +0 -1
  57. package/dist/assets/GroupsTab-4IxYHQdJ.js +0 -1
  58. package/dist/assets/InstancesTab-CBZ2j5zg.js +0 -1
  59. package/dist/assets/IntegrationsTab-D6160dRg.js +0 -1
  60. package/dist/assets/KpiTab-ChT2wJK3.js +0 -1
  61. package/dist/assets/PreferencesTab-G29WsO8x.js +0 -1
  62. package/dist/assets/PromptInjectionsTab-B3zdXItl.js +0 -4
  63. package/dist/assets/RolesTab-DfTKsa9B.js +0 -1
  64. package/dist/assets/ScheduledTab-CwWrkY40.js +0 -1
  65. package/dist/assets/ServiceAccountsTab-DgxZwEZb.js +0 -1
  66. package/dist/assets/SubAgentReportsTab-BdMPMN8f.js +0 -1
  67. package/dist/assets/ThemeShowroom-CqkJyig0.js +0 -1
  68. package/dist/assets/TracesTab-ru8pnxnK.js +0 -1
  69. package/dist/assets/UsersTab-DrEOcHMC.js +0 -1
  70. package/dist/assets/VoiceTab-Bfv15iGQ.js +0 -1
  71. package/dist/assets/chevrons-up-down-BlSBNq85.js +0 -1
  72. package/dist/assets/dispatchErrorInfo-CkqdtQzy.js +0 -1
  73. package/dist/assets/index-C6zNVqw_.css +0 -2
  74. package/dist/assets/index-CnNzzVmB.js +0 -238
  75. package/dist/assets/mermaid-GHXKKRXX-C_oANOwV.js +0 -1
  76. package/dist/assets/roleDescriptions-ReA48WUh.js +0 -1
  77. package/dist/assets/x-B77pQElB.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$A as r,AA as i,Aj as a,BA as o,Bj as s,CA as c,CP as l,Cj as u,D as d,DA as f,Dj as p,E as m,EA as h,Ej as g,FA as _,FP as v,Fa as ee,Fj as te,GA as y,HA as b,IA as ne,Ia as x,Ij as re,JA as ie,KA as ae,LA as oe,La as S,Lj as se,MA as ce,MP as le,Mj as ue,NA as de,Nj as fe,OA as pe,Oj as me,PA as he,PP as C,Pa as ge,Pj as _e,QA as ve,RA as w,Rj as ye,SA as T,SP as be,Sj as xe,TA as Se,Tj as Ce,UA as we,VA as Te,WA as Ee,XA as De,YA as Oe,ZA as ke,_j as Ae,aj as je,bA as Me,bj as Ne,cj as Pe,dj as Fe,ej as Ie,fj as Le,gj as Re,hj as ze,ij as Be,jA as Ve,jj as He,kA as Ue,kj as We,lj as Ge,mj as Ke,n as qe,nj as Je,oj as Ye,pj as Xe,qA as Ze,rj as E,sj as Qe,tj as $e,uj as et,vA as tt,vj as nt,wA as rt,wP as it,wj as at,xA as ot,xj as st,yA as ct,yj as lt,zA as ut,zj as dt}from"./dist-CjH9Ohdx.js";import{n as D}from"./dist-C0sZxuDo.js";import{t as O}from"./x-DYJkW-kP.js";import{t as k}from"./button-B49JSqzm.js";import{C as A,S as j,T as M,Xt as ft,Yt as N,at as pt,bt as mt,ct as ht,dt as P,ft as F,lt as I,m as L,ot as gt,st as R,ut as _t,w as z,wt as B,x as V,yt as vt}from"./index-DnuEILeM.js";import{t as yt}from"./localePickerView-C2RmOS86.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-eKiPt2Wc.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-COx9FvKU.js";import{t as kt}from"./TimeRangePicker-0VkTfHt_.js";import{t as At}from"./FilterBar-BVzupjQK.js";import{t as jt}from"./AdvancedFilter-CcMolhzz.js";var G=d(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),K=t(e(),1),Mt=.1,Nt=[248,248,248],Pt=[24,24,24];function Ft(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function It(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return It(e,t,n)>=Mt}function Lt(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function Rt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var zt=12*1024*1024,Bt=480,Vt=160,Ht=.92;async function Ut(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Te());if(e.size>zt)throw Error(o());let{source:n,width:r,height:i,cleanup:a}=await Wt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Bt/r,Vt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(w());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Ft(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(w());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);q(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Ht)??await Y(f,`image/png`);if(!h)throw Error(oe());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(ut())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Gt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Q={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function $({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?it():e===`dark`?l():be()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:qe(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(D,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":S(),title:S(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=v(m.charts.listMyCharts),r=C(m.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ue()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:He()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:a(),subtitle:We(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?me():n.via===`owner`?p():g({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ce()}):null]})}function Qt(){let e=C(m.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1);async function d(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(E())}}}async function f(){if(o(null),c(!1),t.trim()===``){o($e());return}let a;try{a=JSON.parse(r)}catch{o(E());return}u(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{u(!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:Fe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:et()})]}),(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:Ge()}),(0,X.jsx)(F,{value:t,onChange:e=>n(e.target.value),placeholder:Pe(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Qe()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:Ye(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),je(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:l,onClick:()=>void f(),children:Be()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Je()}):null]})]})}function $t({chart:e}){let t=le(m.charts.setChartLogo),n=C(m.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ut(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function 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`?ie():Ze()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),t?y():ae(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:we()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Ee()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Oe()}),(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:b()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=v(m.me.getMe,{host:B}),n=C(m.charts.addChartDomain),r=C(m.charts.removeChartDomain),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.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:ne()}),(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:ce()}):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":Ve({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(O,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(F,{value:i,onChange:e=>a(e.target.value),placeholder:he(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:de()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:_()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=C(m.charts.updateChart),n=C(m.charts.deleteChart),[r,a]=(0,K.useState)(!1),[o,s]=(0,K.useState)(e.name),[c,l]=(0,K.useState)(()=>tn(e.tokens)),[u,d]=(0,K.useState)(e.tokens.bpm??0),[p,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(!1);function te(){s(e.name),l(tn(e.tokens)),d(e.tokens.bpm??0),g(null),a(!0)}async function y(){if(e.chartId===void 0)return;g(null);let n;try{n=JSON.parse(c)}catch{g(E());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}v(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),a(!1)}catch(e){g(e instanceof Error?e.message:String(e))}finally{v(!1)}}async function b(){if(e.chartId!==void 0&&window.confirm(h()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:te,children:ke()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void b(),children:De()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:pe()}),(0,X.jsx)(F,{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:x()}),(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":x()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?ee():`${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:f()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),p?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:p}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:_,onClick:()=>void y(),children:i()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>a(!1),children:Ue()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=v(m.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:Ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:r()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ve()}):(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=C(m.charts.addChartToGroupPool),r=C(m.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(P,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?Ae():e.kind===`custom`&&e.scope===`personal`?T():nt()}),e.isGlobalDefault?(0,X.jsx)(P,{variant:`default`,children:Re()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ke()}),(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":Le({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(V,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(z,{size:`sm`,className:`w-56`,children:(0,X.jsx)(M,{placeholder:Xe()})}),(0,X.jsx)(j,{children:s.map(e=>(0,X.jsx)(A,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ze()}):null]})]})}function on({chart:e}){let t=C(m.charts.promoteChartToCommon),n=C(m.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(h()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(P,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?ot():T()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:c({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Me()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:ct()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=C(m.admin.setDefaultThemeMode),i=C(m.admin.setDefaultLocale),o=C(m.charts.setDefaultChart),c=v(m.charts.listChartsAdmin),l=v(m.groups.listGroups,{}),d=e??`system`,f=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:_e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:fe()})]}),(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:at()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:u()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:a()}),mt.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(c??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({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:xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:st()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:l??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:lt()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:rt()})]}),(()=>{let e=(c??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:tt()}):(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:s()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:dt()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:d===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:se()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:f===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:re()})]})]})}function cn(){let e=v(m.me.getMe,{host:B}),t=vt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:te()}),(0,X.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(k,{variant:`outline`,children:`Outline`}),(0,X.jsx)(k,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(k,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(k,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,children:`Small`}),(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{size:`lg`,children:`Large`}),(0,X.jsx)(k,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(N,{})}),(0,X.jsx)(k,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(P,{children:`Default`}),(0,X.jsx)(P,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(P,{variant:`outline`,children:`Outline`}),(0,X.jsx)(P,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)($,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(F,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(V,{value:n,onValueChange:r,children:[(0,X.jsx)(z,{className:`w-56`,children:(0,X.jsx)(M,{placeholder:`Select…`})}),(0,X.jsxs)(j,{children:[(0,X.jsx)(A,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(A,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(L,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)($,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(V,{value:o,onValueChange:s,children:[(0,X.jsx)(z,{size:`sm`,children:(0,X.jsx)(M,{})}),(0,X.jsxs)(j,{children:[(0,X.jsx)(A,{value:Z,children:`Toutes directions`}),(0,X.jsx)(A,{value:`inbound`,children:`inbound`}),(0,X.jsx)(A,{value:`outbound`,children:`outbound`}),(0,X.jsx)(A,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(V,{value:c,onValueChange:l,children:[(0,X.jsx)(z,{size:`sm`,children:(0,X.jsx)(M,{})}),(0,X.jsxs)(j,{children:[(0,X.jsx)(A,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(A,{value:`info`,children:`info`}),(0,X.jsx)(A,{value:`warn`,children:`warn`}),(0,X.jsx)(A,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(kt,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(pt,{children:[(0,X.jsx)(_t,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(gt,{align:`start`,children:[(0,X.jsx)(ht,{children:`Actions`}),(0,X.jsx)(I,{}),(0,X.jsx)(R,{children:`Edit`}),(0,X.jsx)(R,{children:`Duplicate`}),(0,X.jsx)(I,{}),(0,X.jsx)(R,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Tt,{className:`w-80`,children:[(0,X.jsxs)(bt,{children:[(0,X.jsx)(Ct,{children:`Instance`}),(0,X.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(xt,{className:`gap-2`,children:[(0,X.jsx)(k,{size:`sm`,children:`Save`}),(0,X.jsx)(k,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)($,{title:`Table`,children:(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Et,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(L,{"aria-label":`select all`})}),(0,X.jsx)(H,{children:`Name`}),(0,X.jsx)(H,{children:`Mode`}),(0,X.jsx)(H,{className:`text-right`,children:`Status`}),(0,X.jsx)(H,{className:`w-8`})]})}),(0,X.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(U,{children:[(0,X.jsx)(W,{children:(0,X.jsx)(L,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(P,{variant:`secondary`,children:e.m})}),(0,X.jsx)(W,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(D,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},e.n))})]})}),(0,X.jsx)($,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{_r as r,ah as i,ch as a,dh as o,fh as s,gr as c,hh as l,hr as u,ih as d,lh as f,mh as p,mr as m,oh as h,ph as g,pr as _,rh as v,sh as y,uh as b,vr as x,yr as S}from"./dist-BKXYNjW7.js";import{t as C}from"./button-CdHluvSK.js";import{Dt as w,Et as T,Ot as E,Qt as D,Rt as O,Tt as k,ft as A,rt as j}from"./index-CnNzzVmB.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:p(),from:`now-15m`},{label:g(),from:`now-30m`},{label:s(),from:`now-1h`},{label:o(),from:`now-3h`},{label:b(),from:`now-6h`},{label:f(),from:`now-12h`},{label:a(),from:`now-24h`},{label:y(),from:`now-2d`},{label:h(),from:`now-7d`},{label:i(),from:`now-30d`},{label:d(),from:`now-90d`},{label:v(),from:`now-520w`}];function L(e){return j(e,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function R(e){if(e.kind===`relative`){let t=I.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${L(e.from)} → ${L(e.to)}`}function z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function B(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function V(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var H=n();function U(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=F(e);return e.kind===`absolute`?{from:t,to:n}:{from:W(t),to:W(n)}},[e,t])}function W(e){return Math.floor(e/6e4)*6e4}function G({value:e,onChange:t}){let[n,i]=(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 h(t){if(t){let t=F(e);d(z(t.from)),p(z(t.to)),o(``)}i(t)}function g(e){t({kind:`relative`,from:e,to:`now`}),i(!1)}function v(){let e=B(l),n=B(f);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),i(!1))}let y=(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]),b=B(l)!==null&&B(f)!==null;return(0,H.jsxs)(w,{open:n,onOpenChange:h,children:[(0,H.jsx)(E,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(D,{}),R(e)]})}),(0,H.jsx)(T,{children:(0,H.jsx)(k,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:S()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:x()}),(0,H.jsx)(A,{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:r()}),(0,H.jsx)(A,{type:`datetime-local`,value:f,onChange:e=>p(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!b,onClick:v,children:c()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(O,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(A,{value:a,onChange:e=>o(e.target.value),placeholder:u(),"aria-label":m()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:y.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:_()}):y.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{Ah as r,Ar as i,Ch as a,Dh as o,Eh as s,Fr as c,Ir as l,Mh as u,Mr as d,Nr as f,Oh as p,Pr as m,Sh as h,Th as g,bh as _,jh as v,jr as y,kh as b,wh as x,xh as S}from"./dist-CjH9Ohdx.js";import{t as C}from"./button-B49JSqzm.js";import{Dt as w,Et as T,Ot as E,Qt as D,Rt as O,Tt as k,ft as A,rt as j}from"./index-DnuEILeM.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:u(),from:`now-5m`},{label:v(),from:`now-15m`},{label:r(),from:`now-30m`},{label:b(),from:`now-1h`},{label:p(),from:`now-3h`},{label:o(),from:`now-6h`},{label:s(),from:`now-12h`},{label:g(),from:`now-24h`},{label:x(),from:`now-2d`},{label:a(),from:`now-7d`},{label:h(),from:`now-30d`},{label:S(),from:`now-90d`},{label:_(),from:`now-520w`}];function L(e){return j(e,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function R(e){if(e.kind===`relative`){let t=I.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${L(e.from)} → ${L(e.to)}`}function z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function B(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function V(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var H=n();function U(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=F(e);return e.kind===`absolute`?{from:t,to:n}:{from:W(t),to:W(n)}},[e,t])}function W(e){return Math.floor(e/6e4)*6e4}function G({value:e,onChange:t}){let[n,r]=(0,M.useState)(!1),[a,o]=(0,M.useState)(``),s=F(e),[u,p]=(0,M.useState)(()=>z(s.from)),[h,g]=(0,M.useState)(()=>z(s.to));function _(t){if(t){let t=F(e);p(z(t.from)),g(z(t.to)),o(``)}r(t)}function v(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function b(){let e=B(u),n=B(h);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let x=(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]),S=B(u)!==null&&B(h)!==null;return(0,H.jsxs)(w,{open:n,onOpenChange:_,children:[(0,H.jsx)(E,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(D,{}),R(e)]})}),(0,H.jsx)(T,{children:(0,H.jsx)(k,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:l()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:c()}),(0,H.jsx)(A,{type:`datetime-local`,value:u,onChange:e=>p(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:m()}),(0,H.jsx)(A,{type:`datetime-local`,value:h,onChange:e=>g(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!S,onClick:b,children:f()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(O,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(A,{value:a,onChange:e=>o(e.target.value),placeholder:d(),"aria-label":y()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:x.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:i()}):x.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:()=>v(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,AT as i,Av as a,BT as o,Cv as s,D as c,DT as l,Dv as u,E as d,ET as f,Ev as p,FP as m,FT as h,Fv as g,GT as _,HT as v,IT as y,Iv as b,JT as x,KT as S,LT as C,Lv as w,MT as T,Mn as E,Mv as ee,NT as te,Nn as ne,Nv as re,OT as ie,Ov as ae,PP as D,PT as oe,Pv as se,RT as O,Sv as ce,Tv as le,UT as ue,VT as k,WT as A,XT as j,YT as M,_T as N,_v as de,av as fe,bT as pe,bv as me,cT as P,cv as he,dT as F,dv as ge,ev as _e,fT as ve,fv as ye,gT as be,gv as xe,hT as Se,hv as Ce,iv as we,jT as Te,jn as Ee,jv as De,kT as Oe,kv as ke,lT as Ae,lv as je,mT as Me,mv as Ne,nv as Pe,ov as Fe,pT as Ie,pv as Le,qT as Re,rv as ze,sT as Be,sv as Ve,tv as He,uT as Ue,uv as We,vT as Ge,vv as Ke,wv as qe,xT as Je,xv as Ye,yT as Xe,yv as Ze,zT as Qe}from"./dist-CjH9Ohdx.js";import{n as $e}from"./dist-C0sZxuDo.js";import{t as et}from"./x-DYJkW-kP.js";import{i as I,n as L,r as tt,t as nt}from"./tabs-BFg7qw3e.js";import{t as R}from"./button-B49JSqzm.js";import{C as z,Jt as rt,M as it,S as B,T as V,Zt as at,_t as ot,a as st,dt as H,ht as ct,i as lt,it as ut,mt as dt,nn as ft,o as pt,pt as mt,qt as ht,rn as gt,rt as U,s as _t,vt,w as W,wt as yt,x as G}from"./index-DnuEILeM.js";import{n as K}from"./TimeRangePicker-0VkTfHt_.js";import{t as bt}from"./FilterBar-BVzupjQK.js";import{t as xt}from"./AdvancedFilter-CcMolhzz.js";import{t as St}from"./DataTableShell-DKcU9E8v.js";var Ct=c(`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`}]]),wt=c(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=e=>e===null?`-`:String(Math.round(e));function Tt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?Te():n===`agent`?`${i()} - ${r}`:e}function Et(){let e=m(d.me.getMe,{host:yt})?.role===`admin`,t=m(d.deliveryTiming.getDeliveryStatus,{}),n=D(d.deliveryTiming.startDeliveryRecord),r=D(d.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,J.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:j()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:M()})]}),e?(0,J.jsx)(R,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?Re():x()}):null]}),c?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(H,{variant:`secondary`,children:S()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:_({time:ut(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?v():ue()})}),i?(0,J.jsx)(Dt,{isAdmin:e}):null]})}function Dt({isAdmin:e}){let t=m(d.deliveryTiming.listDeliverySessions,{}),n=D(d.deliveryTiming.deleteDeliverySessions),[r,i]=(0,q.useState)(``),[a,s]=(0,q.useState)(`all`),[c,u]=(0,q.useState)(Y),[f,p]=(0,q.useState)(null),{from:g,to:_}=K(c),v=c.to===`now`?1/0:_,b=r.trim()!==``||a!==`all`||c!==Y,x=()=>{i(``),s(`all`),u(Y)},S=(0,q.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(a===`all`||(a===`active`?t.active:!t.active))&&t.startedAt>=g&&t.startedAt<=v).map(e=>({...e,_id:e.sessionId}))},[t,r,a,g,v]),w=e=>{let t=new Set((S??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),f!==null&&r.includes(f)&&p(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(bt,{q:r,onQChange:i,searchPlaceholder:o(),timeRange:c,onTimeRangeChange:u,onReset:x,canReset:b,children:(0,J.jsxs)(G,{value:a,onValueChange:e=>s(e),children:[(0,J.jsx)(W,{size:`sm`,className:`w-36`,children:(0,J.jsx)(V,{})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(z,{value:`all`,children:Qe()}),(0,J.jsx)(z,{value:`active`,children:O()}),(0,J.jsx)(z,{value:`stopped`,children:C()})]})]})}),(0,J.jsx)(St,{title:k(),rows:S,emptyHint:P(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(R,{variant:`ghost`,size:`icon`,"aria-label":f===e.sessionId?ie():Oe(),onClick:()=>p(t=>t===e.sessionId?null:e.sessionId),children:f===e.sessionId?(0,J.jsx)(Ct,{size:15,"aria-hidden":!0}):(0,J.jsx)(rt,{size:15,"aria-hidden":!0})})},{header:y(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:U(e.startedAt)})},{header:h(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,J.jsx)(`span`,{className:`tabular-nums`,children:U(e.stoppedAt)})},{header:oe(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:te(),sort:e=>e.startedBy,cell:e=>Tt(e.startedBy)},{header:T(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(H,{variant:`secondary`,children:O()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:C()})}],rowActions:e?e=>[{label:l(),variant:`destructive`,onSelect:()=>w([e.sessionId])}]:void 0,bulkActions:e?[{label:l(),variant:`destructive`,onSelect:e=>w(e)}]:void 0,isExpanded:e=>e.sessionId===f,renderExpanded:e=>(0,J.jsx)(Ot,{sessionId:e.sessionId})})]})}function Ot({sessionId:e}){let t=m(d.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.jsx)(kt,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(it(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function kt({report:e,copied:t,onCopy:n}){if(!e)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:f()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:A()});let r=e.segments,i=(e,t)=>(0,J.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,J.jsx)(`td`,{className:`py-1`,children:e}),(0,J.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,J.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,Be()]}),(0,J.jsxs)(R,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)($e,{size:13,"aria-hidden":!0}):(0,J.jsx)(at,{size:13,"aria-hidden":!0}),t?Ae():Ue()]})]}),(0,J.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,J.jsx)(`th`,{className:`py-1 font-medium`,children:Xe()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ge()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:N()})]})}),(0,J.jsxs)(`tbody`,{children:[i(be(),r.bridge),i(Se(),r.A),i(Me(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Ie()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:F()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ve()})]})}var At=[50,100,200,500],Z=`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:ne()},{value:`principalType`,label:E()},{value:`direction`,label:`direction`},{value:`roleKey`,label:Ee()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=gt({from:`/settings/traces`}),t=ft({from:`/settings/traces`}),n=e.limit,r=e.kind,i=e.statusClass??Q,o=e.principalType??Q,c=e.direction??Q,l=e.roleKey??Q,f=e.q??``,h=lt(e.from,e.to),_=(0,q.useMemo)(()=>_t(e.adv),[e.adv]),{from:v,to:y}=K(h),[x,S]=(0,q.useState)(null),[C,T]=(0,q.useState)(null),E=e=>void t({search:t=>({...t,limit:e})}),te=e=>void t({search:t=>({...t,kind:e})}),ne=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ie=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),D=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),oe=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),O=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),ue=e=>void t({search:t=>({...t,...pt(e)})}),k=e=>void t({search:t=>({...t,adv:st(e)}),replace:!0}),A=m(d.observability.listEvents,{limit:n}),j=m(d.observability.listEvents,{limit:n,kind:r===Z?void 0:r,filter:{q:f||void 0,from:v,to:y,statusClass:i===Q?void 0:i,principalType:o===Q?void 0:o,direction:c===Q?void 0:c,roleKey:l===Q?void 0:l,advanced:_.length>0?_:void 0}}),M=(0,q.useMemo)(()=>{let e=new Set;for(let t of A??[])e.add(t.kind);return[...e].sort()},[A]),N=(0,q.useMemo)(()=>{let e=new Set;for(let t of A??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[A]),P=f!==``||i!==Q||o!==Q||c!==Q||l!==Q||_.length>0||h.kind!==`relative`||h.from!==Pt.from;function F(){t({search:{limit:100,kind:`all`},replace:!0})}let _e=x?A?.filter(e=>e.correlationId===x):j,ve=e.section,be=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)(nt,{value:ve,onValueChange:e=>be(e),children:[(0,J.jsxs)(tt,{className:`w-full`,children:[(0,J.jsxs)(I,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(ht,{size:13,"aria-hidden":!0}),Je()]}),(0,J.jsxs)(I,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(wt,{size:13,"aria-hidden":!0}),pe()]})]}),(0,J.jsx)(L,{value:`latency`,children:(0,J.jsx)(Et,{})}),(0,J.jsxs)(L,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[w(),(0,J.jsx)(`strong`,{children:b()}),g(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:se()})]}),(0,J.jsxs)(bt,{q:f,onQChange:ne,searchPlaceholder:re(),timeRange:h,onTimeRangeChange:ue,onReset:F,canReset:P,children:[(0,J.jsxs)(G,{value:i,onValueChange:ie,children:[(0,J.jsx)(W,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:ee()})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(z,{value:Q,children:De()}),jt.map(e=>(0,J.jsx)(z,{value:e,children:e},e))]})]}),(0,J.jsxs)(G,{value:o,onValueChange:D,children:[(0,J.jsx)(W,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:a()})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(z,{value:Q,children:ke()}),Mt.map(e=>(0,J.jsx)(z,{value:e,children:e},e))]})]}),(0,J.jsxs)(G,{value:c,onValueChange:oe,children:[(0,J.jsx)(W,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:ae()})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(z,{value:Q,children:u()}),Nt.map(e=>(0,J.jsx)(z,{value:e,children:e},e))]})]}),(0,J.jsxs)(G,{value:l,onValueChange:O,children:[(0,J.jsx)(W,{size:`sm`,className:`w-36`,children:(0,J.jsx)(V,{placeholder:p()})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(z,{value:Q,children:le()}),N.map(e=>(0,J.jsx)(z,{value:e,children:e},e))]})]}),(0,J.jsxs)(G,{value:r,onValueChange:te,children:[(0,J.jsx)(W,{size:`sm`,className:`w-44`,children:(0,J.jsx)(V,{placeholder:qe()})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(z,{value:Z,children:s()}),M.map(e=>(0,J.jsx)(z,{value:e,children:e},e))]})]}),(0,J.jsxs)(G,{value:String(n),onValueChange:e=>E(Number(e)),children:[(0,J.jsx)(W,{size:`sm`,className:`w-28`,children:(0,J.jsx)(V,{})}),(0,J.jsx)(B,{children:At.map(e=>(0,J.jsx)(z,{value:String(e),children:ce({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Ft,seed:_,onChange:k}),x?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>S(null),title:Ye(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[me(),(0,J.jsx)(`code`,{children:$(x)})]}),(0,J.jsx)(et,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:Ze()})]})}):null,(0,J.jsx)(St,{title:Ke(),rows:_e,emptyHint:x?de():xe(),columns:[{header:Ce(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:U(e.at)})},{header:Ne(),sort:e=>e.kind,cell:e=>(0,J.jsx)(H,{variant:`secondary`,children:e.kind})},{header:Le(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,J.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,J.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":ye(),children:`✓`})}},{header:ge(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(H,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:We(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(H,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:je(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(H,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:he(),sort:e=>e.route,cell:e=>e.route?(0,J.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,J.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Ve(),sort:e=>e.status,cell:e=>e.status===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:Fe(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:fe(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:we(),onClick:()=>S(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ze(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>T(e),children:Pe()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(zt,{row:C,onClose:()=>T(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,q.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,J.jsx)(mt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(dt,{className:`max-w-lg`,children:[(0,J.jsxs)(ot,{children:[(0,J.jsxs)(vt,{className:`oc-traces__meta-title`,children:[He(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(H,{variant:`outline`,children:_e()})]}),(0,J.jsx)(ct,{children:r()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$S as r,Bu as i,CC as a,C_ as o,E as s,FP as c,MS as l,PP as u,QS as d,Ru as f,SC as p,S_ as m,TC as h,T_ as g,ZS as ee,_C as te,__ as _,aC as v,bC as y,b_ as b,cC as ne,dC as re,eC as ie,fC as ae,gC as oe,g_ as x,hC as S,h_ as C,iC as se,lC as ce,mC as le,m_ as w,nC as T,oC as E,pC as ue,p_ as D,rC as de,sC as fe,tC as pe,uC as me,vC as he,v_ as O,wC as k,w_ as A,xC as ge,x_ as j,yC as M,y_ as N,zu as P}from"./dist-CjH9Ohdx.js";import{t as F}from"./button-B49JSqzm.js";import{C as I,H as L,It as R,Lt as z,S as B,T as V,U as _e,W as ve,_t as H,at as ye,c as U,ct as be,dt as W,ht as G,l as xe,m as K,mt as Se,nn as Ce,ot as we,pt as Te,rn as Ee,st as De,u as q,ut as Oe,vt as ke,w as J,wt as Ae,x as Y}from"./index-DnuEILeM.js";import{t as je}from"./FilterBar-BVzupjQK.js";import{t as Me}from"./DataTableShell-DKcU9E8v.js";import{t as Ne}from"./DetailChips-BHFRTi5X.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=c(s.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=c(s.agents.listUserAgents,n&&e?{profileId:e}:`skip`),l=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=(a??[]).find(e=>e.isDefault)??null,d=u?`${u.instanceName}/${u.agentId}`:null,f=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),p=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!f.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}))],h=new Map;for(let e of p){let t=h.get(e.instanceName)??[];t.push(e),h.set(e.instanceName,t)}return(0,Z.jsx)(Te,{open:n,onOpenChange:r,children:(0,Z.jsxs)(Se,{className:`oc-access`,children:[(0,Z.jsxs)(H,{children:[(0,Z.jsx)(ke,{children:g({user:t})}),(0,Z.jsx)(G,{children:A()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?o():m()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:j()}):p.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:O()}):[...h.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:l,defaultKey:d},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=u(s.agents.assignAgent),c=u(s.agents.removeAgent),l=u(s.agents.setDefaultAgent),d=L();if(!e)return null;async function f(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(b(),e)}}async function p(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(N(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(z,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(W,{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)(K,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void f(e.agentId,r),"aria-label":_({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:x()}):null,e.outOfPool?(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:C()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":w(),title:w(),children:(0,Z.jsx)(R,{size:14,fill:`currentColor`})}):(0,Z.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":D(),title:D(),disabled:c,onClick:()=>void p(e.agentId),children:(0,Z.jsx)(R,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return f();case`user`:return P();case`admin`:return i();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=U.filter(e=>n.has(q[e])).length;return(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(Oe,{asChild:!0,children:(0,Z.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?h():k({count:r})})}),(0,Z.jsxs)(we,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(be,{children:a()}),U.map(e=>{let r=q[e];return(0,Z.jsxs)(De,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(K,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:xe[e]()})]},e)})]})]})}function Le(){let e=Ee({from:`/settings/users`}),t=Ce({from:`/settings/users`}),n=e.q??``,i=e.role??Q,a=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),o=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),f=c(s.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),m=c(s.me.getMe,{host:Ae}),h=u(s.admin.setRole),g=u(s.admin.setUserPermissions),_=u(s.admin.startImpersonation),b=u(s.admin.deleteUser),x=u(s.admin.setUserName),C=_e(),w=ve(),D=L(),[O,k]=(0,X.useState)(null),A=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of f??[])e.add(t.role);return[...e]},[f]),j=n!==``||i!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await h(e)}catch(e){D.error(p(),e)}}async function F(e){try{await g(e)}catch(e){D.error(ge(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await C({title:le(),description:ue({user:t}),confirmWord:ae(),confirmLabel:re(),destructive:!0}))try{await b({profileId:e._id}),D.success(ce({user:t}))}catch(e){D.error(me(),e)}}async function H(e){let t=e.email||e.name||e.userId.slice(0,8),n=await w({title:fe(),label:E({user:t}),placeholder:v(),defaultValue:e.name??``,confirmLabel:l()});if(n!==null)try{await x({profileId:e._id,name:n}),D.success(se())}catch(e){D.error(de(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(je,{q:n,onQChange:a,searchPlaceholder:y(),onReset:N,canReset:j,children:(0,Z.jsxs)(Y,{value:i,onValueChange:o,children:[(0,Z.jsx)(J,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(V,{})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(I,{value:Q,children:M()}),A.map(e=>(0,Z.jsx)(I,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:he(),rows:f,emptyHint:te(),rowActions:e=>{let t=[{label:ee(),onSelect:()=>k({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:ne(),onSelect:()=>void H(e)}];return e.userId!==m?.userId&&t.push({label:oe(),onSelect:()=>void _({profileId:e._id})},{label:S(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:T(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{children:t}),n?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:pe(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(Y,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,Z.jsx)(J,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(V,{})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(I,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(I,{value:`user`,children:$(`user`)}),(0,Z.jsx)(I,{value:`admin`,children:$(`admin`)})]})]})},{header:ie(),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:r()}):(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:d(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(z,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Pe,{profileId:O?.profileId??null,userLabel:O?.label??``,open:O!==null,onOpenChange:e=>{e||k(null)}})]})}export{Le as UsersTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ac as r,At as i,Bt as a,D as o,Dt as s,E as c,EP as l,FP as u,Ft as d,Gt as f,Ht as p,It as ee,Jt as m,K as te,Kt as h,Lt as g,MP as _,Mc as v,Mt as y,Nt as b,OP as ne,Ot as x,PP as S,Pt as C,Ql as w,Qt as T,Rt as re,Ut as ie,Vt as ae,Wt as E,Xt as oe,Yt as se,Zt as ce,_t as le,at as ue,dt as de,ft as D,gt as fe,ht as pe,it as me,jt as O,kt as k,lt as A,ot as j,qt as M,st as N,ut as P,vt as F,yt as I,zt as L}from"./dist-CjH9Ohdx.js";import{i as R,n as z,r as he,t as ge}from"./tabs-BFg7qw3e.js";import{t as B}from"./button-B49JSqzm.js";import{C as V,F as _e,I as ve,L as H,N as ye,Nt as be,P as xe,R as U,S as W,T as G,Wt as Se,dt as K,m as q,nn as Ce,rn as we,w as J,wt as Te,x as Y,z as Ee}from"./index-DnuEILeM.js";/* empty css */var X=o(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),Z=t(e(),1),Q=n(),De=[[`auto`,()=>f()],[`fr-FR`,()=>I()],[`en-US`,()=>F()],[`en-GB`,()=>le()],[`de-DE`,()=>fe()],[`es-ES`,()=>pe()]],Oe=[[`0.75`,()=>ie()],[`1`,()=>p()],[`1.25`,()=>ae()],[`1.5`,()=>a()]],$=0;function ke({instance:e}){let t=S(c.admin.upsertInstanceConfig),n=e.config??{},i={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[a,o]=(0,Z.useState)(i),[s,l]=(0,Z.useState)(`idle`),[u,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(!1),y=_(c.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{o({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),l(`idle`)},[e._id]);let b=a.enabled!==i.enabled||a.engine!==i.engine||a.lang!==i.lang||a.rate!==i.rate||a.autoRead!==i.autoRead;async function x(){l(`saving`);try{let n={...e.config??{}};n.voiceEnabled=a.enabled,a.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,a.lang===`auto`?delete n.voiceLang:n.voiceLang=a.lang;let r=Number.parseFloat(a.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,a.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),l(`idle`)}catch{l(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(K,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":M()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:M()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:N()}),(0,Q.jsxs)(Y,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":N(),children:(0,Q.jsx)(G,{})}),(0,Q.jsxs)(W,{children:[(0,Q.jsx)(V,{value:`browser`,children:j()}),e.kind===`hermes`?null:(0,Q.jsx)(V,{value:`gateway`,children:ue()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:me()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:h()}),(0,Q.jsxs)(Y,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":h(),children:(0,Q.jsx)(G,{})}),(0,Q.jsx)(W,{children:De.map(([e,t])=>(0,Q.jsx)(V,{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)(Y,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":E(),children:(0,Q.jsx)(G,{})}),(0,Q.jsx)(W,{children:Oe.map(([e,t])=>(0,Q.jsx)(V,{value:e,children:t()},e))})]})]}),a.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":L()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:L()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:re()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(B,{size:`sm`,disabled:!b||s===`saving`,onClick:()=>void x(),children:s===`saving`?w():v()}),(0,Q.jsx)(B,{variant:`outline`,size:`sm`,disabled:!a.enabled||u,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(m(!1),U(),H(),a.engine!==`gateway`){ve(d(),{lang:_e(a.lang,ne()),rate:t});return}f(!0),y({instanceName:e.name,text:d()}).then(({mime:e,audioBase64:r})=>{n===$&&xe(r,e,{rate:t})}).catch(()=>{n===$&&m(!0)}).finally(()=>f(!1))},children:u?w():g()}),(0,Q.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>{$++,f(!1),U(),H()},children:ee()})]}),s===`error`||p?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:p?te():r()}):null]})}function Ae({stt:e}){let t=u(c.me.getMe,{host:Te}),n=S(c.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:b()}),(0,Q.jsx)(K,{variant:e?`secondary`:`outline`,children:e?x():s()}),(0,Q.jsx)(K,{variant:r?`secondary`:`destructive`,children:r?de():P()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":D()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:y()})]})}function je(){let e=u(c.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Ee(),[]),n=(0,Z.useMemo)(()=>ye(),[]),{section:r}=we({from:`/settings/voice`}),a=Ce({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:T()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(K,{variant:t?`secondary`:`destructive`,children:t?ce():oe()}),(0,Q.jsx)(K,{variant:n?`secondary`:`destructive`,children:n?se():m()})]}),(0,Q.jsxs)(ge,{value:r,onValueChange:e=>void a({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(he,{className:`w-full`,children:[(0,Q.jsxs)(R,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(be,{size:13,"aria-hidden":!0}),A()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Se,{size:13,"aria-hidden":!0}),b()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(X,{size:13,"aria-hidden":!0}),O()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(z,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsx)(z,{value:`talk`,children:(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:O()}),(0,Q.jsx)(K,{variant:`outline`,children:i()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:k()})]})})]})]})}export{je as VoiceTab};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n,t as r,x as i}from"./dist-BKXYNjW7.js";e();var a=t(),o=r(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:r=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?i:`button`,{"data-slot":`button`,"data-variant":t,"data-size":r,className:n(o({variant:t,size:r,className:e})),...c})}export{o as n,s as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n,t as r,x as i}from"./dist-CjH9Ohdx.js";e();var a=t(),o=r(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:r=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?i:`button`,{"data-slot":`button`,"data-variant":t,"data-size":r,className:n(o({variant:t,size:r,className:e})),...c})}export{o as n,s as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-BKXYNjW7.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-CjH9Ohdx.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-CjH9Ohdx.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
@@ -1 +1 @@
1
- import{$s as e,Js as t,Qs as n,Ys as r,Zs as i,qt as a,sc as o}from"./dist-BKXYNjW7.js";var s=e=>typeof e==`string`?e:null;function c(e){let t=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/.exec(e);return t?{nums:[t[1],t[2],t[3]].map(e=>Number.parseInt(e,10)),pre:t[4]??null}:null}function l(e,t){let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e],i=r[e];if(t===void 0)return-1;if(i===void 0)return 1;let a=/^\d+$/.test(t)?Number.parseInt(t,10):null,o=/^\d+$/.test(i)?Number.parseInt(i,10):null;if(a!==null&&o!==null){if(a!==o)return a-o}else if(a!==null)return-1;else if(o!==null)return 1;else{let e=t<i?-1:+(t>i);if(e!==0)return e}}return 0}function u(e,t){let n=c(e),r=c(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n.nums[e]-r.nums[e];if(t!==0)return t}return n.pre===null&&r.pre===null?0:n.pre===null?1:r.pre===null?-1:l(n.pre,r.pre)}function d(e,t){if(e===null||t===null)return!1;let n=u(t,e.min);return n!==null&&n>=0}function f(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,o=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=s(e.min),n=s(e.maxValidated);t!==null&&n!==null&&(o={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:o,validatedVersions:c}}function p(e,t,n){if(e===null)return`unknown`;let{range:r}=f(n,t);return d(r,e)?r!==null&&(u(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function m(t){return t===`supported`?e():t===`beyond`?n():i()}function h(e){return e??o()}function g(e,n){return n&&n!==`openclaw`?a({provider:n}):e===null?t():r({version:e})}function _(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{h as a,g as i,_ as n,u as o,m as r,f as s,p as t};
1
+ import{dc as e,fc as t,gc as n,hc as r,mc as i,un as a,wc as o}from"./dist-CjH9Ohdx.js";var s=e=>typeof e==`string`?e:null;function c(e){let t=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/.exec(e);return t?{nums:[t[1],t[2],t[3]].map(e=>Number.parseInt(e,10)),pre:t[4]??null}:null}function l(e,t){let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e],i=r[e];if(t===void 0)return-1;if(i===void 0)return 1;let a=/^\d+$/.test(t)?Number.parseInt(t,10):null,o=/^\d+$/.test(i)?Number.parseInt(i,10):null;if(a!==null&&o!==null){if(a!==o)return a-o}else if(a!==null)return-1;else if(o!==null)return 1;else{let e=t<i?-1:+(t>i);if(e!==0)return e}}return 0}function u(e,t){let n=c(e),r=c(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n.nums[e]-r.nums[e];if(t!==0)return t}return n.pre===null&&r.pre===null?0:n.pre===null?1:r.pre===null?-1:l(n.pre,r.pre)}function d(e,t){if(e===null||t===null)return!1;let n=u(t,e.min);return n!==null&&n>=0}function f(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,o=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=s(e.min),n=s(e.maxValidated);t!==null&&n!==null&&(o={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:o,validatedVersions:c}}function p(e,t,n){if(e===null)return`unknown`;let{range:r}=f(n,t);return d(r,e)?r!==null&&(u(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function m(e){return e===`supported`?n():e===`beyond`?r():i()}function h(e){return e??o()}function g(n,r){return r&&r!==`openclaw`?a({provider:r}):n===null?e():t({version:n})}function _(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{h as a,g as i,_ as n,u as o,m as r,f as s,p as t};
@@ -0,0 +1 @@
1
+ import{Af as e,Bf as t,Df as n,Ef as r,Ff as i,Gf as a,Hf as o,If as s,Jf as c,Kf as l,Lf as u,Mf as d,Nf as f,Of as p,Pf as m,Qf as h,Rf as g,Tf as _,Uf as v,Vf as y,Wf as b,Xf as x,Yf as S,Zf as C,jf as w,kf as T,qf as E,wf as D,zf as O}from"./dist-CjH9Ohdx.js";var k={AGENT_NOT_FOUND:()=>({label:h(),hint:C()}),AUTH_TOKEN_MISMATCH:()=>({label:x(),hint:S()}),DEVICE_SIGNING_FAILED:()=>({label:c(),hint:E()}),SESSION_SCOPE_DENIED:()=>({label:l(),hint:a()}),GATEWAY_TIMEOUT:()=>({label:b(),hint:v()}),GATEWAY_DISCONNECTED:()=>({label:o(),hint:y()}),ATTACHMENT_TOO_LARGE:()=>({label:g(),hint:u()}),ATTACHMENT_REJECTED:()=>({label:s(),hint:i()}),BRIDGE_UNREACHABLE:()=>({label:t(),hint:O()}),INVALID_REQUEST:()=>({label:m(),hint:f()}),NOT_CONFIGURED:()=>({label:d(),hint:w()}),UNROUTED:()=>({label:e(),hint:T()}),UPSTREAM_ERROR:()=>({label:p(),hint:n()}),UNKNOWN:()=>({label:r(),hint:_()})};function A(e){return e?k[e]?.()??{label:e,hint:D()}:k.UNKNOWN()}export{A as t};
@@ -1,4 +1,4 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{S as r,T as i,a,c as o,d as s,f as c,h as l,i as u,l as d,m as f,o as p,s as m,u as h,v as g,y as _}from"./dist-BKXYNjW7.js";var v=t(e(),1),y=n(),b=`Dialog`,[x,S]=l(b),[C,w]=x(b),T=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),l=v.useRef(null),[u,d]=c({prop:r,defaultProp:i??!1,onChange:a,caller:b});return(0,y.jsx)(C,{scope:t,triggerRef:s,contentRef:l,contentId:h(),titleId:h(),descriptionId:h(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};T.displayName=b;var E=`DialogTrigger`,D=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=w(E,n),o=i(t,a.triggerRef);return(0,y.jsx)(_.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":q(a.open),...r,ref:o,onClick:g(e.onClick,a.onOpenToggle)})});D.displayName=E;var O=`DialogPortal`,[k,A]=x(O,{forceMount:void 0}),j=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=w(O,t);return(0,y.jsx)(k,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,y.jsx)(s,{present:n||a.open,children:(0,y.jsx)(m,{asChild:!0,container:i,children:e})}))})};j.displayName=O;var M=`DialogOverlay`,N=v.forwardRef((e,t)=>{let n=A(M,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(M,e.__scopeDialog);return a.modal?(0,y.jsx)(s,{present:r||a.open,children:(0,y.jsx)(F,{...i,ref:t})}):null});N.displayName=M;var P=r(`DialogOverlay.RemoveScroll`),F=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(M,n);return(0,y.jsx)(a,{as:P,allowPinchZoom:!0,shards:[i.contentRef],children:(0,y.jsx)(_.div,{"data-state":q(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),I=`DialogContent`,L=v.forwardRef((e,t)=>{let n=A(I,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(I,e.__scopeDialog);return(0,y.jsx)(s,{present:r||a.open,children:a.modal?(0,y.jsx)(R,{...i,ref:t}):(0,y.jsx)(z,{...i,ref:t})})});L.displayName=I;var R=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),r=v.useRef(null),a=i(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return u(e)},[]),(0,y.jsx)(B,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:g(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:g(e.onFocusOutside,e=>e.preventDefault())})}),z=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(B,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),B=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:s,...c}=e,l=w(I,n),u=v.useRef(null),f=i(t,u);return p(),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:s,children:(0,y.jsx)(d,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":q(l.open),...c,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Z,{titleId:l.titleId}),(0,y.jsx)($,{contentRef:u,descriptionId:l.descriptionId})]})]})}),V=`DialogTitle`,H=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(V,n);return(0,y.jsx)(_.h2,{id:i.titleId,...r,ref:t})});H.displayName=V;var U=`DialogDescription`,W=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(U,n);return(0,y.jsx)(_.p,{id:i.descriptionId,...r,ref:t})});W.displayName=U;var G=`DialogClose`,K=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(G,n);return(0,y.jsx)(_.button,{type:`button`,...r,ref:t,onClick:g(e.onClick,()=>i.onOpenChange(!1))})});K.displayName=G;function q(e){return e?`open`:`closed`}var J=`DialogTitleWarning`,[Y,X]=f(J,{contentName:I,titleName:V,docsSlug:`dialog`}),Z=({titleId:e})=>{let t=X(J),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{S as r,T as i,a,c as o,d as s,f as c,h as l,i as u,l as d,m as f,o as p,s as m,u as h,v as g,y as _}from"./dist-CjH9Ohdx.js";var v=t(e(),1),y=n(),b=`Dialog`,[x,S]=l(b),[C,w]=x(b),T=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),l=v.useRef(null),[u,d]=c({prop:r,defaultProp:i??!1,onChange:a,caller:b});return(0,y.jsx)(C,{scope:t,triggerRef:s,contentRef:l,contentId:h(),titleId:h(),descriptionId:h(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};T.displayName=b;var E=`DialogTrigger`,D=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=w(E,n),o=i(t,a.triggerRef);return(0,y.jsx)(_.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":q(a.open),...r,ref:o,onClick:g(e.onClick,a.onOpenToggle)})});D.displayName=E;var O=`DialogPortal`,[k,A]=x(O,{forceMount:void 0}),j=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=w(O,t);return(0,y.jsx)(k,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,y.jsx)(s,{present:n||a.open,children:(0,y.jsx)(m,{asChild:!0,container:i,children:e})}))})};j.displayName=O;var M=`DialogOverlay`,N=v.forwardRef((e,t)=>{let n=A(M,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(M,e.__scopeDialog);return a.modal?(0,y.jsx)(s,{present:r||a.open,children:(0,y.jsx)(F,{...i,ref:t})}):null});N.displayName=M;var P=r(`DialogOverlay.RemoveScroll`),F=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(M,n);return(0,y.jsx)(a,{as:P,allowPinchZoom:!0,shards:[i.contentRef],children:(0,y.jsx)(_.div,{"data-state":q(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),I=`DialogContent`,L=v.forwardRef((e,t)=>{let n=A(I,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(I,e.__scopeDialog);return(0,y.jsx)(s,{present:r||a.open,children:a.modal?(0,y.jsx)(R,{...i,ref:t}):(0,y.jsx)(z,{...i,ref:t})})});L.displayName=I;var R=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),r=v.useRef(null),a=i(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return u(e)},[]),(0,y.jsx)(B,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:g(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:g(e.onFocusOutside,e=>e.preventDefault())})}),z=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(B,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),B=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:s,...c}=e,l=w(I,n),u=v.useRef(null),f=i(t,u);return p(),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:s,children:(0,y.jsx)(d,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":q(l.open),...c,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Z,{titleId:l.titleId}),(0,y.jsx)($,{contentRef:u,descriptionId:l.descriptionId})]})]})}),V=`DialogTitle`,H=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(V,n);return(0,y.jsx)(_.h2,{id:i.titleId,...r,ref:t})});H.displayName=V;var U=`DialogDescription`,W=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(U,n);return(0,y.jsx)(_.p,{id:i.descriptionId,...r,ref:t})});W.displayName=U;var G=`DialogClose`,K=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(G,n);return(0,y.jsx)(_.button,{type:`button`,...r,ref:t,onClick:g(e.onClick,()=>i.onOpenChange(!1))})});K.displayName=G;function q(e){return e?`open`:`closed`}var J=`DialogTitleWarning`,[Y,X]=f(J,{contentName:I,titleName:V,docsSlug:`dialog`}),Z=({titleId:e})=>{let t=X(J),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2
2
 
3
3
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
4
4
 
@@ -1 +1 @@
1
- import{a as e,l as t}from"./bundle-mjs-C73ZY4La.js";import{D as n}from"./dist-BKXYNjW7.js";var r=n(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),i=t(e(),1);function a(e){let t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}export{r as n,a as t};
1
+ import{a as e,l as t}from"./bundle-mjs-C73ZY4La.js";import{D as n}from"./dist-CjH9Ohdx.js";var r=n(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),i=t(e(),1);function a(e){let t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}export{r as n,a as t};