@lacneu/atrium 0.21.0 → 0.23.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 (69) hide show
  1. package/dist/assets/{AccessTab-BpmHOH2b.js → AccessTab-D0FPRjwL.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-BOBkqtk6.js → AdvancedFilter-CtaYuy-W.js} +1 -1
  3. package/dist/assets/AgentFilesTab-BnrDFGg2.js +3 -0
  4. package/dist/assets/AnomaliesTab-DbJTYrA3.js +1 -0
  5. package/dist/assets/{AuditTab-CGfU9rSl.js → AuditTab-CeHLEJ6L.js} +1 -1
  6. package/dist/assets/BridgeTab-DNaXjHu5.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-BhhumrcM.js +1 -0
  8. package/dist/assets/{DataTableShell-DRaoMzdi.js → DataTableShell-VIRQvS8e.js} +1 -1
  9. package/dist/assets/{DetailChips-BJRTpKvv.js → DetailChips-YKc12Z-i.js} +1 -1
  10. package/dist/assets/FeedbacksTab-BLyfs_L4.js +1 -0
  11. package/dist/assets/{FieldLabel-DG-U2yJD.js → FieldLabel-BYZOkwDx.js} +2 -2
  12. package/dist/assets/FilesTab-DYGvOehC.js +1 -0
  13. package/dist/assets/{FilterBar-BBJk4kP8.js → FilterBar-DWv8wqqC.js} +1 -1
  14. package/dist/assets/GroupsTab-BOkc2jks.js +1 -0
  15. package/dist/assets/InstancesTab-WCkAX_gl.js +1 -0
  16. package/dist/assets/IntegrationsTab-Bwd59JJJ.js +1 -0
  17. package/dist/assets/{KpiTab-B3XVJcNt.js → KpiTab-flOR56nE.js} +1 -1
  18. package/dist/assets/PreferencesTab-Ddm8m8BL.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-CuooI8Zy.js +3 -0
  20. package/dist/assets/RolesTab-BnF_qq0d.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-DAeKxzUx.js +1 -0
  22. package/dist/assets/{SubAgentReportsTab-CzaVSPFb.js → SubAgentReportsTab-24-Vy2sZ.js} +1 -1
  23. package/dist/assets/ThemeShowroom-CaoO1IiG.js +1 -0
  24. package/dist/assets/{TimeRangePicker-CAhWZBEI.js → TimeRangePicker-CPM9eoXo.js} +1 -1
  25. package/dist/assets/TracesTab-C9cfYiBZ.js +1 -0
  26. package/dist/assets/UsersTab-CtD0iELd.js +1 -0
  27. package/dist/assets/button-9c1aLUeO.js +1 -0
  28. package/dist/assets/{card-4N7N5yEr.js → card-DNbBWwxH.js} +1 -1
  29. package/dist/assets/chevrons-up-down-D_kGoxSO.js +1 -0
  30. package/dist/assets/{compatView-5hziRv_l.js → compatView-DI9WOWM-.js} +1 -1
  31. package/dist/assets/{dispatchErrorInfo-DsgZO0if.js → dispatchErrorInfo-DO5jqFw-.js} +1 -1
  32. package/dist/assets/dist-BMI7wyIc.js +1 -0
  33. package/dist/assets/{dist-C_wXViAC.js → dist-DM5LkQcA.js} +1 -1
  34. package/dist/assets/dist-DsBcH2-2.js +44 -0
  35. package/dist/assets/{dist-BN_-yUvA.js → dist-bcnGL3nu.js} +1 -1
  36. package/dist/assets/{highlighted-body-OFNGDK62-ClkcrmUm.js → highlighted-body-OFNGDK62-BVpyilpM.js} +1 -1
  37. package/dist/assets/{index-Baso9Ryo.css → index-CZJySt8-.css} +1 -1
  38. package/dist/assets/index-DsOZBPOX.js +227 -0
  39. package/dist/assets/mermaid-GHXKKRXX-Bf3eJ2-p.js +1 -0
  40. package/dist/assets/roleDescriptions-eZmrq1l0.js +1 -0
  41. package/dist/assets/{table-CEVcfIlY.js → table-C2kpo1_K.js} +1 -1
  42. package/dist/assets/{tabs-DTsAt8vZ.js → tabs-D7vYdFs6.js} +1 -1
  43. package/dist/assets/x-CyUGhZ48.js +1 -0
  44. package/dist/index.html +8 -8
  45. package/package.json +1 -1
  46. package/dist/assets/AgentFilesTab-A7KIKZuy.js +0 -3
  47. package/dist/assets/AnomaliesTab-D1oMEdo7.js +0 -1
  48. package/dist/assets/BridgeTab-wIiXQVx4.js +0 -1
  49. package/dist/assets/ChatDefaultsTab-BiAi9i7q.js +0 -1
  50. package/dist/assets/FeedbacksTab-DXt9vggG.js +0 -1
  51. package/dist/assets/FilesTab-D6N2e-YF.js +0 -1
  52. package/dist/assets/GroupsTab-Bd8LlkxI.js +0 -1
  53. package/dist/assets/InstancesTab-0V2J2Qtq.js +0 -1
  54. package/dist/assets/IntegrationsTab-pGZl_dNY.js +0 -1
  55. package/dist/assets/PreferencesTab-Cj6tC2ZE.js +0 -1
  56. package/dist/assets/PromptInjectionsTab-_BUqUmC6.js +0 -3
  57. package/dist/assets/RolesTab-PbMAqWrZ.js +0 -1
  58. package/dist/assets/ServiceAccountsTab-Bau7cms3.js +0 -1
  59. package/dist/assets/ThemeShowroom-COaylZ2W.js +0 -1
  60. package/dist/assets/TracesTab-B0uGrcLJ.js +0 -1
  61. package/dist/assets/UsersTab-C6Ulyvwq.js +0 -1
  62. package/dist/assets/button-CoB18od4.js +0 -1
  63. package/dist/assets/chevrons-up-down-CaKfHJNA.js +0 -1
  64. package/dist/assets/dist-B-U7A_Kp.js +0 -44
  65. package/dist/assets/dist-BNEZtSYw.js +0 -1
  66. package/dist/assets/index-B6IXWbc8.js +0 -227
  67. package/dist/assets/mermaid-GHXKKRXX-BnwtjR3q.js +0 -1
  68. package/dist/assets/roleDescriptions-C3lIPjqc.js +0 -1
  69. package/dist/assets/x-Dl0sHEar.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$T as r,AE as i,AT as a,BT as o,CE as s,CT as c,DE as l,DT as u,EE as d,ET as f,FD as p,FT as m,G as h,GT as ee,HT as g,ID as _,IT as v,JT as y,K as te,KT as ne,LD as re,LT as ie,ME as ae,MT as b,NE as oe,NT as se,OE as ce,OT as le,PE as ue,PT as de,QT as fe,RT as pe,SE as me,ST as he,TE as ge,TT as _e,UT as ve,VT as ye,W as be,WT as xe,XT as Se,YT as Ce,ZT as x,_E as we,_T as Te,aE as Ee,bD as De,bE as Oe,bT as S,cE as ke,dE as Ae,eE as je,fE as Me,fO as C,fT as Ne,gE as Pe,gO as Fe,gT as w,hE as Ie,hT as Le,iE as Re,jE as ze,jT as Be,kE as Ve,kT as He,lE as Ue,mE as We,mT as Ge,n as Ke,nE as qe,oE as Je,pE as Ye,pO as Xe,pT as Ze,q as T,qT as Qe,rE as $e,sE as et,tE as tt,uE as nt,vE as rt,vO as E,vT as it,wE as D,wT as at,xE as ot,xT as st,yD as ct,yE as lt,yO as O,yT as ut,zT as dt}from"./dist-DsBcH2-2.js";import{n as k}from"./dist-DM5LkQcA.js";import{t as A}from"./x-CyUGhZ48.js";import{t as j}from"./button-9c1aLUeO.js";import{C as M,Et as ft,G as pt,J as N,K as P,S as F,Tt as I,W as mt,X as L,Y as ht,Z as R,_ as z,at as gt,b as B,it as _t,ot as V,q as vt,x as H,y as U}from"./index-DsOZBPOX.js";import{a as yt,i as bt,n as xt,o as St,r as Ct,t as wt}from"./card-DNbBWwxH.js";import{a as Tt,i as W,n as Et,o as G,r as K,t as Dt}from"./table-C2kpo1_K.js";import{t as Ot}from"./TimeRangePicker-CPM9eoXo.js";import{t as kt}from"./FilterBar-DWv8wqqC.js";import{t as At}from"./AdvancedFilter-CtaYuy-W.js";var q=Xe(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),J=t(e(),1),jt=.1,Mt=[248,248,248],Nt=[24,24,24];function Pt(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function Ft(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function Y(e,t,n){return Ft(e,t,n)>=jt}function It(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function Lt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var Rt=12*1024*1024,zt=480,Bt=160,Vt=.92;async function Ht(e,t={}){if(!e.type.startsWith(`image/`))throw Error(m());if(e.size>Rt)throw Error(de());let{source:n,width:r,height:i,cleanup:a}=await Ut(e);try{let a=e.type===`image/svg+xml`,o=Math.min(zt/r,Bt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(b());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Pt(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(b());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);Y(e.data,d.width,d.height)?It(e.data,t.variantFor===`dark`?Mt:Nt):Lt(e.data),p.putImageData(e,0,0)}let m=Y(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Gt(f,`image/webp`,Vt)??await Gt(f,`image/png`);if(!h)throw Error(Be());return{blob:h,hasAlpha:m}}finally{a()}}async function Ut(e){if(e.type===`image/svg+xml`)return Wt(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 Wt(e)}async function Wt(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(se())),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 Gt(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Kt(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__`,qt={kind:`relative`,from:`now-24h`,to:`now`},Jt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Yt(e){return e===`light`?re():e===`dark`?_():p()}var Xt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Zt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Xt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Qt({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:Ke(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(k,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Zt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(j,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":T(),title:T(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function $t({selectedKey:e,resolvedMode:t}){let n=O(C.charts.listMyCharts),r=E(C.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:d()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ge()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Qt,{selected:e===null,title:D(),subtitle:s(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?me():n.via===`owner`?ot():Oe({group:n.via.group});return(0,X.jsx)(Qt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Kt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:lt()}):null]})}function en(){let e=E(C.charts.importChart),[t,n]=(0,J.useState)(``),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(!1);async function f(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{a(await t.text())}catch{s(x())}}}async function p(){if(s(null),l(!1),t.trim()===``){s(Ce());return}let r;try{r=JSON.parse(i)}catch{s(x());return}d(!0);try{await e({name:t.trim(),tokens:r}),l(!0),n(``),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{d(!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:Ee()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Re()})]}),(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:$e()}),(0,X.jsx)(R,{value:t,onChange:e=>n(e.target.value),placeholder:qe(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:tt()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:i,onChange:e=>a(e.target.value),placeholder:je(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(q,{className:`size-4`}),r(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void f(e)})]})}),(0,X.jsx)(j,{size:`sm`,disabled:u,onClick:()=>void p(),children:fe()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Se()}):null]})]})}function tn({chart:e}){let t=Fe(C.charts.setChartLogo),n=E(C.charts.removeChartLogo),[r,i]=(0,J.useState)(!1),[a,s]=(0,J.useState)(null),c=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function l(n,r,a){if(e.chartId!==void 0){s(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ht(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await l(e,n)}async function d(t){if(e.chartId!==void 0){s(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function f(e){let t=c(e===`light`?`dark`:`light`);if(t){s(null),i(!0);try{await l(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function p({mode:e}){let t=c(e),n=c(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`?g():ye()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(j,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(q,{className:`size-4`}),t?dt():o(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,X.jsx)(j,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:ie()}):null,t?(0,X.jsx)(j,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:pe()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ve()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(p,{mode:`light`}),(0,X.jsx)(p,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:v()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function nn({chart:e}){let t=O(C.me.getMe,{host:V}),n=E(C.charts.addChartDomain),r=E(C.charts.removeChartDomain),[i,o]=(0,J.useState)(``),[s,c]=(0,J.useState)(null),[l,d]=(0,J.useState)(!1);if(t?.role!==`admin`)return null;let p=e.domains??[];async function m(){let t=i.trim();if(t!==``){c(null),d(!0);try{await n({chartKey:e.key,domain:t}),o(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{d(!1)}}}async function h(t){c(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:a()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:p.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:f()}):p.map(e=>(0,X.jsxs)(L,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":_e({domain:e}),onClick:()=>void h(e),children:(0,X.jsx)(A,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(R,{value:i,onChange:e=>o(e.target.value),placeholder:le(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&m()}}),(0,X.jsx)(j,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void m(),children:u()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:He()}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function rn({chart:e}){let t=E(C.charts.updateChart),n=E(C.charts.deleteChart),[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(e.name),[s,l]=(0,J.useState)(()=>$(e.tokens)),[u,d]=(0,J.useState)(e.tokens.bpm??0),[f,p]=(0,J.useState)(null),[m,g]=(0,J.useState)(!1);function _(){o(e.name),l($(e.tokens)),d(e.tokens.bpm??0),p(null),i(!0)}async function v(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(s)}catch{p(x());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(S()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(j,{variant:`outline`,size:`sm`,onClick:_,children:ee()}),(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:xe()})]})})]}),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:he()}),(0,X.jsx)(R,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:te()}),(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":te()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?h():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:be()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:st()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{size:`sm`,disabled:m,onClick:()=>void v(),children:at()}),(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:c()})]})]}):null,(0,X.jsx)(tn,{chart:e}),(0,X.jsx)(nn,{chart:e})]})}function an(){let e=O(C.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:y()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Qe()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ne()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(rn,{chart:e},e.key))})]})}function on({chart:e,groups:t}){let n=E(C.charts.addChartToGroupPool),r=E(C.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)(L,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?Ae():e.kind===`custom`&&e.scope===`personal`?w():Me()}),e.isGlobalDefault?(0,X.jsx)(L,{variant:`default`,children:nt()}):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)(L,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Je({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(A,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(U,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(F,{size:`sm`,className:`w-56`,children:(0,X.jsx)(M,{placeholder:et()})}),(0,X.jsx)(B,{children:s.map(e=>(0,X.jsx)(H,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ue()}):null]})]})}function sn({chart:e}){let t=E(C.charts.promoteChartToCommon),n=E(C.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(S()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(L,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Le():w()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Te({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(j,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Ge()}):null,(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Ze()})]})]})}function cn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=E(C.admin.setDefaultThemeMode),a=E(C.admin.setDefaultLocale),o=E(C.charts.setDefaultChart),s=O(C.charts.listChartsAdmin),c=O(C.groups.listGroups,{}),u=e??`system`,d=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:ce()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:l()})]}),(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:rt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:we()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:D()}),gt.map(e=>(0,X.jsx)(j,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(j,{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:Pe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ie()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(on,{chart:e,groups:c??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:We()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ye()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).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)(nn,{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:ut()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:it()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ne()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(sn,{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:ue()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:oe()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(j,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Yt(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:ae()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ze()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,X.jsx)(j,{variant:d===e?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e}),children:e===`fr`?De():ct()},e))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:i()})]})]})}function ln(){let e=O(C.me.getMe,{host:V}),t=_t(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)($t,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(en,{}),(0,X.jsx)(an,{}),e?.role===`admin`?(0,X.jsx)(cn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function un(){let[e,t]=(0,J.useState)(!0),[n,r]=(0,J.useState)(`per-user`),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(Z),[c,l]=(0,J.useState)(Z),[u,d]=(0,J.useState)(qt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(qt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(ln,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:Ve()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(j,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(j,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{size:`sm`,children:`Small`}),(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{size:`lg`,children:`Large`}),(0,X.jsx)(j,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(I,{})}),(0,X.jsx)(j,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(L,{children:`Default`}),(0,X.jsx)(L,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(L,{variant:`outline`,children:`Outline`}),(0,X.jsx)(L,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(R,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(U,{value:n,onValueChange:r,children:[(0,X.jsx)(F,{className:`w-56`,children:(0,X.jsx)(M,{placeholder:`Select…`})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(H,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(H,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(z,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(kt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(U,{value:o,onValueChange:s,children:[(0,X.jsx)(F,{size:`sm`,children:(0,X.jsx)(M,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(H,{value:Z,children:`Toutes directions`}),(0,X.jsx)(H,{value:`inbound`,children:`inbound`}),(0,X.jsx)(H,{value:`outbound`,children:`outbound`}),(0,X.jsx)(H,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(U,{value:c,onValueChange:l,children:[(0,X.jsx)(F,{size:`sm`,children:(0,X.jsx)(M,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(H,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(H,{value:`info`,children:`info`}),(0,X.jsx)(H,{value:`warn`,children:`warn`}),(0,X.jsx)(H,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(At,{fields:Jt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(Ot,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(mt,{children:[(0,X.jsx)(ht,{asChild:!0,children:(0,X.jsx)(j,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(I,{})})}),(0,X.jsxs)(pt,{align:`start`,children:[(0,X.jsx)(vt,{children:`Actions`}),(0,X.jsx)(N,{}),(0,X.jsx)(P,{children:`Edit`}),(0,X.jsx)(P,{children:`Duplicate`}),(0,X.jsx)(N,{}),(0,X.jsx)(P,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(wt,{className:`w-80`,children:[(0,X.jsxs)(yt,{children:[(0,X.jsx)(St,{children:`Instance`}),(0,X.jsx)(Ct,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(xt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(bt,{className:`gap-2`,children:[(0,X.jsx)(j,{size:`sm`,children:`Save`}),(0,X.jsx)(j,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Dt,{children:[(0,X.jsx)(Tt,{children:(0,X.jsxs)(G,{children:[(0,X.jsx)(W,{className:`w-8`,children:(0,X.jsx)(z,{"aria-label":`select all`})}),(0,X.jsx)(W,{children:`Name`}),(0,X.jsx)(W,{children:`Mode`}),(0,X.jsx)(W,{className:`text-right`,children:`Status`}),(0,X.jsx)(W,{className:`w-8`})]})}),(0,X.jsx)(Et,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(G,{children:[(0,X.jsx)(K,{children:(0,X.jsx)(z,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(K,{className:`font-medium`,children:e.n}),(0,X.jsx)(K,{children:(0,X.jsx)(L,{variant:`secondary`,children:e.m})}),(0,X.jsx)(K,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(k,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(K,{children:(0,X.jsx)(j,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(I,{})})})]},e.n))})]})}),(0,X.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{un as ThemeShowroom};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cu as r,Su as i,Tu as a,_u as o,bu as s,gu as c,hu as l,mu as u,pu as d,vu as f,wu as p,xu as m,yu as h}from"./dist-B-U7A_Kp.js";import{t as g}from"./button-CoB18od4.js";import{Ot as _,Z as v,ct as y,lt as b,st as x,ut as S,vt as C}from"./index-B6IXWbc8.js";var w=t(e(),1),T={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function E(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=T[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function D(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:E(e.from,t)??t-T.h,to:E(e.to,t)??t}}var O=[{label:a(),from:`now-5m`},{label:p(),from:`now-15m`},{label:r(),from:`now-30m`},{label:i(),from:`now-1h`},{label:m(),from:`now-3h`},{label:s(),from:`now-6h`},{label:h(),from:`now-12h`},{label:f(),from:`now-24h`},{label:o(),from:`now-2d`},{label:c(),from:`now-7d`},{label:l(),from:`now-30d`},{label:u(),from:`now-90d`},{label:d(),from:`now-520w`}];function k(e){return new Date(e).toLocaleString(`fr-FR`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function A(e){if(e.kind===`relative`){let t=O.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${k(e.from)} → ${k(e.to)}`}function j(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 M(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function N(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var P=n();function F(e){let[t,n]=(0,w.useState)(0);return(0,w.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,w.useMemo)(()=>{let{from:t,to:n}=D(e);return e.kind===`absolute`?{from:t,to:n}:{from:I(t),to:I(n)}},[e,t])}function I(e){return Math.floor(e/6e4)*6e4}function L({value:e,onChange:t}){let[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(``),o=D(e),[s,c]=(0,w.useState)(()=>j(o.from)),[l,u]=(0,w.useState)(()=>j(o.to));function d(t){if(t){let t=D(e);c(j(t.from)),u(j(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=M(s),n=M(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,w.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?O:O.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),h=M(s)!==null&&M(l)!==null;return(0,P.jsxs)(b,{open:n,onOpenChange:d,children:[(0,P.jsx)(S,{asChild:!0,children:(0,P.jsxs)(g,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,P.jsx)(_,{}),A(e)]})}),(0,P.jsx)(y,{children:(0,P.jsx)(x,{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,P.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,P.jsx)(`div`,{className:`oc-timerange__section-title`,children:`Plage absolue`}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`De`}),(0,P.jsx)(v,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`À`}),(0,P.jsx)(v,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,P.jsx)(g,{size:`sm`,className:`oc-timerange__apply`,disabled:!h,onClick:p,children:`Appliquer`})]}),(0,P.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,P.jsx)(C,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,P.jsx)(v,{value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher une plage`,"aria-label":`Rechercher une plage relative`})]}),(0,P.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,P.jsx)(`li`,{className:`oc-timerange__empty`,children:`Aucune plage.`}):m.map(t=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>f(t.from),children:t.label})},t.from))})]})]})})})]})}export{F as n,N as r,L as t};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cu as r,Du as i,Eu as a,Ou as o,Su as s,Tu as c,_u as l,bu as u,ku as d,vu as f,wu as p,xu as m,yu as h}from"./dist-DsBcH2-2.js";import{t as g}from"./button-9c1aLUeO.js";import{Ot as _,Z as v,ct as y,lt as b,st as x,ut as S,vt as C}from"./index-DsOZBPOX.js";var w=t(e(),1),T={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function E(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=T[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function D(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:E(e.from,t)??t-T.h,to:E(e.to,t)??t}}var O=[{label:d(),from:`now-5m`},{label:o(),from:`now-15m`},{label:i(),from:`now-30m`},{label:a(),from:`now-1h`},{label:c(),from:`now-3h`},{label:p(),from:`now-6h`},{label:r(),from:`now-12h`},{label:s(),from:`now-24h`},{label:m(),from:`now-2d`},{label:u(),from:`now-7d`},{label:h(),from:`now-30d`},{label:f(),from:`now-90d`},{label:l(),from:`now-520w`}];function k(e){return new Date(e).toLocaleString(`fr-FR`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function A(e){if(e.kind===`relative`){let t=O.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${k(e.from)} → ${k(e.to)}`}function j(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 M(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function N(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var P=n();function F(e){let[t,n]=(0,w.useState)(0);return(0,w.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,w.useMemo)(()=>{let{from:t,to:n}=D(e);return e.kind===`absolute`?{from:t,to:n}:{from:I(t),to:I(n)}},[e,t])}function I(e){return Math.floor(e/6e4)*6e4}function L({value:e,onChange:t}){let[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(``),o=D(e),[s,c]=(0,w.useState)(()=>j(o.from)),[l,u]=(0,w.useState)(()=>j(o.to));function d(t){if(t){let t=D(e);c(j(t.from)),u(j(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=M(s),n=M(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,w.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?O:O.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),h=M(s)!==null&&M(l)!==null;return(0,P.jsxs)(b,{open:n,onOpenChange:d,children:[(0,P.jsx)(S,{asChild:!0,children:(0,P.jsxs)(g,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,P.jsx)(_,{}),A(e)]})}),(0,P.jsx)(y,{children:(0,P.jsx)(x,{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,P.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,P.jsx)(`div`,{className:`oc-timerange__section-title`,children:`Plage absolue`}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`De`}),(0,P.jsx)(v,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`À`}),(0,P.jsx)(v,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,P.jsx)(g,{size:`sm`,className:`oc-timerange__apply`,disabled:!h,onClick:p,children:`Appliquer`})]}),(0,P.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,P.jsx)(C,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,P.jsx)(v,{value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher une plage`,"aria-label":`Rechercher une plage relative`})]}),(0,P.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,P.jsx)(`li`,{className:`oc-timerange__empty`,children:`Aucune plage.`}):m.map(t=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>f(t.from),children:t.label})},t.from))})]})]})})})]})}export{F as n,N as r,L as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,$f as i,Ab as a,Cb as o,Cp as s,Db as c,Eb as l,Fb as u,Gb as d,Gf as f,Hb as p,Hf as m,Ib as h,Jb as ee,Jf as g,Kb as _,Kf as v,Mb as y,Nb as b,Ob as x,Pb as S,Qb as C,Qf as te,Sb as ne,Sp as re,Tb as ie,Tp as ae,Ub as oe,Uf as se,Vb as ce,Vf as w,Wb as T,Wf as le,Xb as E,Xf as ue,Yb as D,Yf as de,Zb as O,Zf as fe,_p as pe,ap as me,ax as k,bp as he,cp as ge,cx as A,dp as _e,dx as j,ep as ve,ex as M,fO as N,fp as ye,gp as be,hp as xe,ip as Se,ix as Ce,jb as P,kb as F,lp as we,lx as Te,mp as Ee,np as De,nx as Oe,op as ke,ox as Ae,pO as I,pp as je,qb as Me,qf as Ne,rp as Pe,rx as Fe,sp as Ie,sx as Le,tp as Re,tx as ze,up as Be,ux as Ve,vO as L,vp as He,wb as Ue,wp as We,xp as Ge,yO as R,yp as Ke}from"./dist-DsBcH2-2.js";import{n as qe}from"./dist-DM5LkQcA.js";import{t as Je}from"./x-CyUGhZ48.js";import{i as z,n as B,r as Ye,t as Xe}from"./tabs-D7vYdFs6.js";import{t as V}from"./button-9c1aLUeO.js";import{$ as Ze,C as H,Ct as Qe,Dt as $e,Mt as et,Q as tt,S as U,X as W,a as nt,b as G,et as rt,i as it,jt as at,k as ot,nt as st,o as ct,ot as lt,r as ut,rt as dt,wt as ft,x as K,y as q}from"./index-DsOZBPOX.js";import{n as pt}from"./TimeRangePicker-CPM9eoXo.js";import{t as mt}from"./FilterBar-DWv8wqqC.js";import{t as ht}from"./AdvancedFilter-CtaYuy-W.js";import{t as gt}from"./DataTableShell-VIRQvS8e.js";var _t=I(`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`}]]),vt=I(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function yt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?_():n===`agent`?`${d()} - ${r}`:e}function bt(){let e=R(N.me.getMe,{host:lt})?.role===`admin`,t=R(N.deliveryTiming.getDeliveryStatus,{}),n=L(N.deliveryTiming.startDeliveryRecord),r=L(N.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:j()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ve()})]}),e?(0,Y.jsx)(V,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?A():Te()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(W,{variant:`secondary`,children:Le()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:Ae({time:new Date(t.startedAt).toLocaleTimeString()})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(V,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?Fe():Ce()})}),i?(0,Y.jsx)(xt,{isAdmin:e}):null]})}function xt({isAdmin:e}){let t=R(N.deliveryTiming.listDeliverySessions,{}),n=L(N.deliveryTiming.deleteDeliverySessions),[i,a]=(0,J.useState)(``),[s,c]=(0,J.useState)(`all`),[l,u]=(0,J.useState)(X),[d,f]=(0,J.useState)(null),{from:m,to:h}=pt(l),g=l.to===`now`?1/0:h,_=i.trim()!==``||s!==`all`||l!==X,v=()=>{a(``),c(`all`),u(X)},y=(0,J.useMemo)(()=>{if(t===void 0)return;let e=i.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(s===`all`||(s===`active`?t.active:!t.active))&&t.startedAt>=m&&t.startedAt<=g).map(e=>({...e,_id:e.sessionId}))},[t,i,s,m,g]),b=e=>{let t=new Set((y??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),d!==null&&r.includes(d)&&f(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(mt,{q:i,onQChange:a,searchPlaceholder:ze(),timeRange:l,onTimeRangeChange:u,onReset:v,canReset:_,children:(0,Y.jsxs)(q,{value:s,onValueChange:e=>c(e),children:[(0,Y.jsx)(U,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(H,{})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:`all`,children:M()}),(0,Y.jsx)(K,{value:`active`,children:r()}),(0,Y.jsx)(K,{value:`stopped`,children:C()})]})]})}),(0,Y.jsx)(gt,{title:Oe(),rows:y,emptyHint:o(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(V,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?oe():T(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,Y.jsx)(_t,{size:15,"aria-hidden":!0}):(0,Y.jsx)(ft,{size:15,"aria-hidden":!0})})},{header:O(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.startedAt).toLocaleString()})},{header:E(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.stoppedAt).toLocaleString()})},{header:D(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:ee(),sort:e=>e.startedBy,cell:e=>yt(e.startedBy)},{header:Me(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(W,{variant:`secondary`,children:r()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:C()})}],rowActions:e?e=>[{label:p(),variant:`destructive`,onSelect:()=>b([e.sessionId])}]:void 0,bulkActions:e?[{label:p(),variant:`destructive`,onSelect:e=>b(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,Y.jsx)(St,{sessionId:e.sessionId})})]})}function St({sessionId:e}){let t=R(N.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ct,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(ot(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ct({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ce()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:k()});let r=e.segments,i=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,ne()]}),(0,Y.jsxs)(V,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(qe,{size:13,"aria-hidden":!0}):(0,Y.jsx)($e,{size:13,"aria-hidden":!0}),t?Ue():ie()]})]}),(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,Y.jsx)(`th`,{className:`py-1 font-medium`,children:S()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:b()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:y()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(P(),r.bridge),i(a(),r.A),i(F(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:x()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:c()})]})}var wt=[50,100,200,500],Tt=`all`,Q=`__all__`,Et=[`2xx`,`4xx`,`5xx`],Dt=[`user`,`service`,`system`],Ot=[`inbound`,`outbound`,`internal`],kt={kind:`relative`,from:`now-30d`,to:`now`},At=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:`latence (ms)`},{value:`principalType`,label:`principal`},{value:`direction`,label:`direction`},{value:`roleKey`,label:`rôle`},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function jt(){let e=et({from:`/settings/traces`}),t=at({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,o=e.principalType??Q,c=e.direction??Q,l=e.roleKey??Q,d=e.q??``,p=ut(e.from,e.to),m=(0,J.useMemo)(()=>ct(e.adv),[e.adv]),{from:ee,to:_}=pt(p),[y,b]=(0,J.useState)(null),[x,S]=(0,J.useState)(null),C=e=>void t({search:t=>({...t,limit:e})}),ne=e=>void t({search:t=>({...t,kind:e})}),ie=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),oe=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),se=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),ce=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),w=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),T=e=>void t({search:t=>({...t,...nt(e)})}),E=e=>void t({search:t=>({...t,adv:it(e)}),replace:!0}),D=R(N.observability.listEvents,{limit:n}),O=R(N.observability.listEvents,{limit:n,kind:r===Tt?void 0:r,filter:{q:d||void 0,from:ee,to:_,statusClass:a===Q?void 0:a,principalType:o===Q?void 0:o,direction:c===Q?void 0:c,roleKey:l===Q?void 0:l,advanced:m.length>0?m:void 0}}),k=(0,J.useMemo)(()=>{let e=new Set;for(let t of D??[])e.add(t.kind);return[...e].sort()},[D]),A=(0,J.useMemo)(()=>{let e=new Set;for(let t of D??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[D]),j=d!==``||a!==Q||o!==Q||c!==Q||l!==Q||m.length>0||p.kind!==`relative`||p.from!==kt.from;function M(){t({search:{limit:100,kind:`all`},replace:!0})}let Ce=y?D?.filter(e=>e.correlationId===y):O,[P,F]=(0,J.useState)(`events`);return(0,Y.jsxs)(Xe,{value:P,onValueChange:e=>F(e),children:[(0,Y.jsxs)(Ye,{className:`w-full`,children:[(0,Y.jsxs)(z,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Qe,{size:13,"aria-hidden":!0}),h()]}),(0,Y.jsxs)(z,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(vt,{size:13,"aria-hidden":!0}),u()]})]}),(0,Y.jsx)(B,{value:`latency`,children:(0,Y.jsx)(bt,{})}),(0,Y.jsxs)(B,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[ae(),(0,Y.jsx)(`strong`,{children:We()}),s(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:re()})]}),(0,Y.jsxs)(mt,{q:d,onQChange:ie,searchPlaceholder:Ge(),timeRange:p,onTimeRangeChange:T,onReset:M,canReset:j,children:[(0,Y.jsxs)(q,{value:a,onValueChange:oe,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:he()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:Ke()}),Et.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:o,onValueChange:se,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:He()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:pe()}),Dt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:c,onValueChange:ce,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:be()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:xe()}),Ot.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:l,onValueChange:w,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(H,{placeholder:Ee()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:je()}),A.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:r,onValueChange:ne,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(H,{placeholder:ye()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Tt,children:_e()}),k.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:String(n),onValueChange:e=>C(Number(e)),children:[(0,Y.jsx)(U,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(H,{})}),(0,Y.jsx)(G,{children:wt.map(e=>(0,Y.jsx)(K,{value:String(e),children:Be({count:e})},e))})]})]}),(0,Y.jsx)(ht,{fields:At,seed:m,onChange:E}),y?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>b(null),title:we(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[ge(),(0,Y.jsx)(`code`,{children:$(y)})]}),(0,Y.jsx)(Je,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:Ie()})]})}):null,(0,Y.jsx)(gt,{title:ke(),rows:Ce,emptyHint:y?me():Se(),columns:[{header:Pe(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:De(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(W,{variant:`secondary`,children:e.kind})},{header:Re(),sort:e=>Nt(e)??null,cell:e=>{let t=Nt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":ve(),children:`✓`})}},{header:i(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(W,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:te(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(W,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:fe(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(W,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ue(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:de(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Mt(e.status)}`,children:e.status})},{header:g(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:Ne(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:v(),onClick:()=>b(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:f(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(V,{variant:`outline`,size:`sm`,onClick:()=>S(e),children:le()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(Pt,{row:x,onClose:()=>S(null)})]})]})}function Mt(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 Nt(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 Pt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(tt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(Ze,{className:`max-w-lg`,children:[(0,Y.jsxs)(st,{children:[(0,Y.jsxs)(dt,{className:`oc-traces__meta-title`,children:[se(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(W,{variant:`outline`,children:m()})]}),(0,Y.jsx)(rt,{children:w()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{jt as TracesTab};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,B_ as i,F_ as a,G_ as o,H_ as s,I_ as c,J_ as l,K_ as u,L_ as d,M_ as ee,N_ as te,P_ as ne,Q_ as re,R_ as ie,U_ as ae,V_ as oe,W_ as se,X_ as ce,Y_ as le,Z_ as ue,af as f,av as p,cf as m,df as h,ev as de,fO as g,ff as _,if as v,iv as y,lf as b,nf as x,nv as fe,of as S,ov as C,p_ as pe,pf as w,q_ as me,rf as T,rv as E,sf as D,tf as O,tv as he,uf as k,vO as A,yO as j,z_ as ge}from"./dist-DsBcH2-2.js";import{t as M}from"./button-9c1aLUeO.js";import{$ as N,A as P,C as F,G as I,K as L,M as R,Mt as _e,Q as z,S as B,W as V,X as H,Y as ve,_ as U,_t as W,b as G,d as K,et as ye,f as be,gt as q,j as xe,jt as Se,nt as Ce,ot as we,p as J,q as Te,rt as Ee,x as Y,y as X}from"./index-DsOZBPOX.js";import{t as De}from"./FilterBar-DWv8wqqC.js";import{t as Oe}from"./DataTableShell-VIRQvS8e.js";import{t as ke}from"./DetailChips-YKc12Z-i.js";var Z=t(e(),1),Q=n();function Ae({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=j(g.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=j(g.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.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,state:e.state,outOfPool:!0}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,Q.jsx)(z,{open:n,onOpenChange:r,children:(0,Q.jsxs)(N,{className:`oc-access`,children:[(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(Ee,{children:w({user:t})}),(0,Q.jsx)(ye,{children:_()})]}),i?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?h():k()}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:b()}):u.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:S()}):[...d.entries()].map(([t,n])=>(0,Q.jsx)(je,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function je({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=A(g.agents.assignAgent),s=A(g.agents.removeAgent),c=A(g.agents.setDefaultAgent),l=P();if(!e)return null;async function u(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(m(),e)}}async function d(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(D(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(W,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(H,{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`;return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(U,{checked:r,disabled:s&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":f({name:e.displayName??e.agentId})}),(0,Q.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Q.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Q.jsx)(H,{variant:`outline`,className:`oc-access__gone`,children:v()}):null,e.outOfPool?(0,Q.jsx)(H,{variant:`outline`,className:`oc-access__gone`,children:T()}):null,r?o?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":x(),title:x(),children:(0,Q.jsx)(q,{size:14,fill:`currentColor`})}):(0,Q.jsx)(M,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":O(),title:O(),onClick:()=>void d(e.agentId),children:(0,Q.jsx)(q,{size:14})}):null]},e.agentId)})]})}var $=`__all__`;function Me({granted:e,onToggle:t}){let n=new Set(e),r=K.filter(e=>n.has(J[e])).length;return(0,Q.jsxs)(V,{children:[(0,Q.jsx)(ve,{asChild:!0,children:(0,Q.jsx)(M,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?C():p({count:r})})}),(0,Q.jsxs)(I,{align:`start`,className:`w-52`,children:[(0,Q.jsx)(Te,{children:y()}),K.map(e=>{let r=J[e];return(0,Q.jsxs)(L,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Q.jsx)(U,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Q.jsx)(`span`,{children:be[e]??e})]},e)})]})]})}function Ne(){let e=_e({from:`/settings/users`}),t=Se({from:`/settings/users`}),n=e.q??``,f=e.role??$,p=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),m=e=>void t({search:t=>({...t,role:e===$?void 0:e})}),h=j(g.admin.listUsers,{filter:{q:n||void 0,role:f===$?void 0:f},withAgents:!0}),_=j(g.me.getMe,{host:we}),v=A(g.admin.setRole),y=A(g.admin.setUserPermissions),b=A(g.admin.startImpersonation),x=A(g.admin.deleteUser),S=A(g.admin.setUserName),C=xe(),w=R(),T=P(),[D,O]=(0,Z.useState)(null),k=(0,Z.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of h??[])e.add(t.role);return[...e]},[h]),M=n!==``||f!==$;function N(){t({search:{},replace:!0})}async function I(e){try{await v(e)}catch(e){T.error(E(),e)}}async function L(e){try{await y(e)}catch(e){T.error(fe(),e)}}async function z(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await C({title:le(),description:l({user:t}),confirmWord:me(),confirmLabel:u(),destructive:!0}))try{await x({profileId:e._id}),T.success(se({user:t}))}catch(e){T.error(o(),e)}}async function V(e){let t=e.email||e.name||e.userId.slice(0,8),n=await w({title:s(),label:oe({user:t}),placeholder:i(),defaultValue:e.name??``,confirmLabel:pe()});if(n!==null)try{await S({profileId:e._id,name:n}),T.success(ge())}catch(e){T.error(ie(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(De,{q:n,onQChange:p,searchPlaceholder:he(),onReset:N,canReset:M,children:(0,Q.jsxs)(X,{value:f,onValueChange:m,children:[(0,Q.jsx)(B,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(F,{})}),(0,Q.jsxs)(G,{children:[(0,Q.jsx)(Y,{value:$,children:de()}),k.map(e=>(0,Q.jsx)(Y,{value:e,children:e},e))]})]})}),(0,Q.jsx)(Oe,{title:r(),rows:h,emptyHint:re(),rowActions:e=>{let t=[{label:ee(),onSelect:()=>O({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:ae(),onSelect:()=>void V(e)}];return e.userId!==_?.userId&&t.push({label:ue(),onSelect:()=>void b({profileId:e._id})},{label:ce(),variant:`destructive`,onSelect:()=>void z(e)}),t},columns:[{header:d(),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,Q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Q.jsx)(`span`,{children:t}),n?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:c(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Q.jsxs)(X,{value:e.role,onValueChange:t=>void I({profileId:e._id,role:t}),children:[(0,Q.jsx)(B,{size:`sm`,className:`w-28`,children:(0,Q.jsx)(F,{})}),(0,Q.jsxs)(G,{children:[(0,Q.jsx)(Y,{value:`pending`,children:`pending`}),(0,Q.jsx)(Y,{value:`user`,children:`user`}),(0,Q.jsx)(Y,{value:`admin`,children:`admin`})]})]})},{header:a(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:ne()}):(0,Q.jsx)(Me,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),L({profileId:e._id,permissions:[...n]})}})},{header:te(),cell:e=>(0,Q.jsx)(ke,{icon:(0,Q.jsx)(W,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Q.jsx)(Ae,{profileId:D?.profileId??null,userLabel:D?.label??``,open:D!==null,onOpenChange:e=>{e||O(null)}})]})}export{Ne as UsersTab};
@@ -0,0 +1 @@
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n,sO as r,t as i}from"./dist-DsBcH2-2.js";e();var a=t(),o=i(`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:i=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?r:`button`,{"data-slot":`button`,"data-variant":t,"data-size":i,className:n(o({variant:t,size:i,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-B-U7A_Kp.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-DsBcH2-2.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{pO as e}from"./dist-DsBcH2-2.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{Cr as e,Pr as t,Tr as n,br as r,wr as i,xr as a}from"./dist-B-U7A_Kp.js";var o=e=>typeof e==`string`?e:null;function s(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function c(e,t){let n=s(e),r=s(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n[e]-r[e];if(t!==0)return t}return 0}function l(e,t){if(e===null||t===null)return!1;let n=c(t,e.min);return n!==null&&n>=0}function u(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,s=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=o(e.min),n=o(e.maxValidated);t!==null&&n!==null&&(s={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:s,validatedVersions:c}}function d(e,t,n){if(e===null)return`unknown`;let{range:r}=u(n,t);return l(r,e)?r!==null&&(c(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function f(t){return t===`supported`?n():t===`beyond`?i():e()}function p(e){return e??t()}function m(e){return e===null?r():a({version:e})}function h(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{p as a,m as i,h as n,c as o,f as r,u as s,d as t};
1
+ import{Cr as e,Pr as t,Tr as n,br as r,wr as i,xr as a}from"./dist-DsBcH2-2.js";var o=e=>typeof e==`string`?e:null;function s(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function c(e,t){let n=s(e),r=s(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n[e]-r[e];if(t!==0)return t}return 0}function l(e,t){if(e===null||t===null)return!1;let n=c(t,e.min);return n!==null&&n>=0}function u(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,s=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=o(e.min),n=o(e.maxValidated);t!==null&&n!==null&&(s={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:s,validatedVersions:c}}function d(e,t,n){if(e===null)return`unknown`;let{range:r}=u(n,t);return l(r,e)?r!==null&&(c(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function f(t){return t===`supported`?n():t===`beyond`?i():e()}function p(e){return e??t()}function m(e){return e===null?r():a({version:e})}function h(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{p as a,m as i,h as n,c as o,f as r,u as s,d as t};
@@ -1 +1 @@
1
- import{$s as e,Bs as t,Gs as n,Hs as r,Is as i,Js as a,Ks as o,Ls as s,Qs as c,Rs as l,Us as u,Vs as d,Ws as f,Xs as p,Ys as m,Zs as h,ac as g,cc as _,ec as v,ic as y,lc as b,nc as x,oc as S,qs as C,rc as w,sc as T,tc as E,uc as D,zs as O}from"./dist-B-U7A_Kp.js";var k={AGENT_NOT_FOUND:()=>({label:D(),hint:b()}),AUTH_TOKEN_MISMATCH:()=>({label:_(),hint:T()}),DEVICE_SIGNING_FAILED:()=>({label:S(),hint:g()}),SESSION_SCOPE_DENIED:()=>({label:y(),hint:w()}),GATEWAY_TIMEOUT:()=>({label:x(),hint:E()}),GATEWAY_DISCONNECTED:()=>({label:v(),hint:e()}),ATTACHMENT_TOO_LARGE:()=>({label:p(),hint:m()}),ATTACHMENT_REJECTED:()=>({label:a(),hint:C()}),BRIDGE_UNREACHABLE:()=>({label:c(),hint:h()}),INVALID_REQUEST:()=>({label:o(),hint:n()}),NOT_CONFIGURED:()=>({label:f(),hint:u()}),UNROUTED:()=>({label:r(),hint:d()}),UPSTREAM_ERROR:()=>({label:t(),hint:O()}),UNKNOWN:()=>({label:l(),hint:s()})};function A(e){return e?k[e]?.()??{label:e,hint:i()}:k.UNKNOWN()}export{A as t};
1
+ import{$s as e,Bs as t,Gs as n,Hs as r,Is as i,Js as a,Ks as o,Ls as s,Qs as c,Rs as l,Us as u,Vs as d,Ws as f,Xs as p,Ys as m,Zs as h,ac as g,cc as _,ec as v,ic as y,lc as b,nc as x,oc as S,qs as C,rc as w,sc as T,tc as E,uc as D,zs as O}from"./dist-DsBcH2-2.js";var k={AGENT_NOT_FOUND:()=>({label:D(),hint:b()}),AUTH_TOKEN_MISMATCH:()=>({label:_(),hint:T()}),DEVICE_SIGNING_FAILED:()=>({label:S(),hint:g()}),SESSION_SCOPE_DENIED:()=>({label:y(),hint:w()}),GATEWAY_TIMEOUT:()=>({label:x(),hint:E()}),GATEWAY_DISCONNECTED:()=>({label:v(),hint:e()}),ATTACHMENT_TOO_LARGE:()=>({label:p(),hint:m()}),ATTACHMENT_REJECTED:()=>({label:a(),hint:C()}),BRIDGE_UNREACHABLE:()=>({label:c(),hint:h()}),INVALID_REQUEST:()=>({label:o(),hint:n()}),NOT_CONFIGURED:()=>({label:f(),hint:u()}),UNROUTED:()=>({label:r(),hint:d()}),UPSTREAM_ERROR:()=>({label:t(),hint:O()}),UNKNOWN:()=>({label:l(),hint:s()})};function A(e){return e?k[e]?.()??{label:e,hint:i()}:k.UNKNOWN()}export{A as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{cO as r,dO as i,pO as a,tO as o}from"./dist-DsBcH2-2.js";var s=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),c=a(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),l=t(e(),1),u=n();function d(e){let t=e+`CollectionProvider`,[n,a]=o(t),[s,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=l.useRef(null),i=l.useRef(new Map).current;return(0,u.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=t;let f=e+`CollectionSlot`,p=r(f),m=l.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,u.jsx)(p,{ref:i(t,c(f,n).collectionRef),children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=r(h),v=l.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,o=l.useRef(null),s=i(t,o),d=c(h,n);return l.useEffect(()=>(d.itemMap.set(o,{ref:o,...a}),()=>void d.itemMap.delete(o))),(0,u.jsx)(_,{[g]:``,ref:s,children:r})});v.displayName=h;function y(t){let n=c(e+`CollectionConsumer`,t);return l.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:d,Slot:m,ItemSlot:v},y,a]}var f=l.createContext(void 0);function p(e){let t=l.useContext(f);return e||t||`ltr`}export{s as i,d as n,c as r,p as t};
@@ -1 +1 @@
1
- import{a as e,l as t}from"./bundle-mjs-C73ZY4La.js";import{aO as n}from"./dist-B-U7A_Kp.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{pO as n}from"./dist-DsBcH2-2.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};