@lacneu/atrium 0.11.1 → 0.12.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 (66) hide show
  1. package/dist/assets/{AccessTab-CdyF1j7K.js → AccessTab-D8UBBNGu.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-0hIaeD_5.js → AdvancedFilter-C9wU8lbg.js} +1 -1
  3. package/dist/assets/AgentFilesTab-CZDbFuX0.js +3 -0
  4. package/dist/assets/AnomaliesTab-CzoAZBEE.js +1 -0
  5. package/dist/assets/{AuditTab-C-N4POzp.js → AuditTab-CyD_BHYB.js} +1 -1
  6. package/dist/assets/BridgeTab-DQkEO681.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-B2q_qkRe.js +1 -0
  8. package/dist/assets/{DataTableShell-B_P8ehdH.js → DataTableShell-D8VfZxZr.js} +1 -1
  9. package/dist/assets/{DetailChips-DccwdoeS.js → DetailChips-DxdLNn_r.js} +1 -1
  10. package/dist/assets/FeedbacksTab-BAJVQk8M.js +1 -0
  11. package/dist/assets/{FieldLabel-CtF9VFJv.js → FieldLabel-DaGmPya-.js} +1 -1
  12. package/dist/assets/FilesTab-RzCZ5Ic7.js +1 -0
  13. package/dist/assets/{FilterBar-BmFEn3qs.js → FilterBar-Bug-yc3-.js} +1 -1
  14. package/dist/assets/GroupsTab-WI49F6tb.js +1 -0
  15. package/dist/assets/InstancesTab-D8rSGcNn.js +1 -0
  16. package/dist/assets/IntegrationsTab-D8fkl8RR.js +1 -0
  17. package/dist/assets/{KpiTab-DNfNa6Oo.js → KpiTab-CwAcVJY5.js} +1 -1
  18. package/dist/assets/PreferencesTab-CiUtHErY.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-BOkRj3p5.js +2 -0
  20. package/dist/assets/RolesTab-Cod7QDoE.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-BQr8Qhip.js +1 -0
  22. package/dist/assets/ThemeShowroom-D84ERKVO.js +1 -0
  23. package/dist/assets/TimeRangePicker-o7PALjcl.js +1 -0
  24. package/dist/assets/TracesTab-B7Y0YPJ-.js +1 -0
  25. package/dist/assets/UsersTab-BpfSXNtJ.js +1 -0
  26. package/dist/assets/{button-DuXPa4Vl.js → button-Df-d2XgR.js} +1 -1
  27. package/dist/assets/{card-CWLBezSK.js → card-BQ1QjSPo.js} +1 -1
  28. package/dist/assets/chevrons-up-down-myHDPw8F.js +1 -0
  29. package/dist/assets/{compatView-6XUIK3Ob.js → compatView-D3K9Oymg.js} +1 -1
  30. package/dist/assets/{dispatchErrorInfo-Y76YNHBy.js → dispatchErrorInfo-BrKPHPKt.js} +1 -1
  31. package/dist/assets/{dist-ws-D-Lv-.js → dist-BLJMpoEo.js} +1 -1
  32. package/dist/assets/dist-CkdC5ZeW.js +5 -0
  33. package/dist/assets/{dist-ZW9rNZ8M.js → dist-DBuNQFnM.js} +1 -1
  34. package/dist/assets/{dist-DjXzB84V.js → dist-DEd3lc0Q.js} +1 -1
  35. package/dist/assets/{highlighted-body-OFNGDK62-whVEKGek.js → highlighted-body-OFNGDK62-CJons4dv.js} +1 -1
  36. package/dist/assets/{index-Bp-uQn4K.js → index-BAEW7Mtx.js} +16 -16
  37. package/dist/assets/index-Blc1YGmx.css +2 -0
  38. package/dist/assets/mermaid-GHXKKRXX-CYv9t9GJ.js +1 -0
  39. package/dist/assets/roleDescriptions-BBeVMlwf.js +1 -0
  40. package/dist/assets/{table-CoglL6L8.js → table-CZP3bqQ0.js} +1 -1
  41. package/dist/assets/x-DDXWN_r3.js +1 -0
  42. package/dist/index.html +8 -8
  43. package/package.json +1 -1
  44. package/dist/assets/AgentFilesTab-BcyT_Ep9.js +0 -3
  45. package/dist/assets/AnomaliesTab-D8uOqg5K.js +0 -1
  46. package/dist/assets/BridgeTab-DwwnrXwF.js +0 -1
  47. package/dist/assets/ChatDefaultsTab-hdfiXKvr.js +0 -1
  48. package/dist/assets/FeedbacksTab-BKfLDVev.js +0 -1
  49. package/dist/assets/FilesTab-C0sB2U_I.js +0 -1
  50. package/dist/assets/GroupsTab-SlcsoVZV.js +0 -1
  51. package/dist/assets/InstancesTab-D4d7ISJ6.js +0 -1
  52. package/dist/assets/IntegrationsTab-BCXFK88J.js +0 -1
  53. package/dist/assets/PreferencesTab-CUiAii9X.js +0 -1
  54. package/dist/assets/PromptInjectionsTab-Dncvuu7j.js +0 -2
  55. package/dist/assets/RolesTab-Cieo--3o.js +0 -1
  56. package/dist/assets/ServiceAccountsTab-DrIUUd8f.js +0 -1
  57. package/dist/assets/ThemeShowroom-BPEHKIyD.js +0 -1
  58. package/dist/assets/TimeRangePicker-BDN2rIcO.js +0 -1
  59. package/dist/assets/TracesTab-C1P-cd2o.js +0 -1
  60. package/dist/assets/UsersTab-dqn0iQJZ.js +0 -1
  61. package/dist/assets/chevrons-up-down-DGeJvEkD.js +0 -1
  62. package/dist/assets/dist-cXwNU958.js +0 -5
  63. package/dist/assets/index-BftON7pu.css +0 -2
  64. package/dist/assets/mermaid-GHXKKRXX-Dg9-NNvT.js +0 -1
  65. package/dist/assets/roleDescriptions-KrB9-er6.js +0 -1
  66. package/dist/assets/x-D96nOW2m.js +0 -1
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$m as r,Ah as i,Bm as a,Ch as o,Dh as s,Eh as c,Fm as l,Gm as u,Hm as d,Im as f,Jm as p,Km as m,Lm as ee,Mh as h,Nh as g,Nm as te,Oh as _,Ph as ne,Pm as re,Qm as ie,Rm as ae,Sh as v,Th as y,Um as b,Vm as x,Wm as S,Xm as C,Ym as w,Zm as T,_h as E,_w as D,ah as O,bh as k,ch as A,dh as j,eh as M,fh as N,gh as P,gw as F,hh as I,ih as L,jh as R,kh as z,lh as B,mh as V,nh as oe,oh as H,ph as U,qm as W,rh as G,sh as K,th as q,uh as se,uw as J,vh as ce,wh as le,xh as ue,yh as de,zm as fe}from"./dist-ws-D-Lv-.js";import{t as pe}from"./button-DuXPa4Vl.js";import{M as me}from"./index-Bp-uQn4K.js";import{t as he}from"./DataTableShell-B_P8ehdH.js";var Y=t(e(),1),X=n(),Z={altered_words:()=>ne(),incorrect:()=>g(),incoherence:()=>h(),formatting:()=>R(),latency:()=>i(),api_error:()=>z(),other:()=>_()},Q=e=>Z[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:c()}):e===!1?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:y()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:s()})}function ge({data:e,closeReason:t}){let n=e.snapshot,r=F(J.feedback.respondToFeedback),[i,a]=(0,Y.useState)(e.thread),[s,c]=(0,Y.useState)(``),[l,u]=(0,Y.useState)(!1);async function d(){let t=s.trim();if(!(!t||l)){u(!0);try{await r({feedbackId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),c(``)}finally{u(!1)}}}let f=[];try{f=n.contextJson?JSON.parse(n.contextJson):[]}catch{f=[]}return(0,X.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,X.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,X.jsx)($,{matches:n.displayedMatchesStored,sourceWasOpen:n.clientInfo?.sourceWasOpen??!1}),(0,X.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,n.messageRole,n.isRegeneration?` · ${le()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:o()}),(0,X.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,t?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:fe()}),(0,X.jsx)(`p`,{className:`oc-fbadmin__comment`,children:t})]}):null,(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:v()}),i.length>0?(0,X.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.map((e,t)=>(0,X.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,X.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?ue():k()}),(0,X.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,X.jsx)(`p`,{className:`oc-fbadmin__meta`,children:de()}),(0,X.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:ce(),value:s,maxLength:2e3,rows:3,onChange:e=>c(e.target.value.slice(0,2e3))}),(0,X.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,X.jsx)(pe,{size:`sm`,onClick:()=>void d(),disabled:!s.trim()||l,children:l?E():P()})})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:I()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||V()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:U()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||V()})]}):null,n.promptText?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:N()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,f.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:j({count:n.contextCount??f.length,truncated:n.contextTruncated?se():``})}),(0,X.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:f.map((e,t)=>(0,X.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,X.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,X.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,n.outboxAvailable?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:B()}),(0,X.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[n.outboxText??``,n.outboxStatus?`\n[status: ${n.outboxStatus}]`:``]})]}):null,n.clientInfo?.extensionsDetected&&n.clientInfo.extensionsDetected.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:A()}),(0,X.jsx)(`div`,{className:`oc-fbadmin__row`,children:n.clientInfo.extensionsDetected.map(e=>(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:K()}),(0,X.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?H({theme:n.clientInfo.theme}):null,n.runId?`run ${n.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,n.clientInfo?.plugins&&n.clientInfo.plugins.length>0?(0,X.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[O(),` `,n.clientInfo.plugins.join(`, `),(0,X.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,L()]})]}):null,n.clientInfo?.userAgent?(0,X.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function _e(){let e=D(J.feedback.listForAdmin,{}),t=F(J.feedback.readSnapshot),n=F(J.feedback.deleteFeedback),i=me(),[o,s]=(0,Y.useState)(null),[c,h]=(0,Y.useState)({});async function g(e){if(o===e._id){s(null);return}if(!c[e._id]){let n=await t({feedbackId:e._id});h(t=>({...t,[e._id]:n}))}s(e._id)}async function _(e){await i({title:l(),description:re(),confirmLabel:te(),destructive:!0})&&(await n({feedbackId:e._id}),o===e._id&&s(null))}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[G(),` `,(0,X.jsx)(`strong`,{children:oe()}),` `,q()]}),(0,X.jsx)(he,{title:M(),rows:e,emptyHint:r(),isExpanded:e=>o===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,X.jsx)(ge,{data:c[e._id],closeReason:e.userCloseReason}):null,columns:[{header:ie(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:T(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:C(),cell:e=>e.messageRole===`user`?w():p(),sort:e=>e.messageRole},{header:W(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${m({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:u(),cell:e=>(0,X.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:S(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:b(),cell:e=>e.userClosedAt==null?e.answered?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:d()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:x()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:a()}),sort:e=>e.userClosedAt==null?+!!e.answered:2}],rowActions:e=>[{label:o===e._id?ae():ee(),onSelect:()=>void g(e)},{label:f(),onSelect:()=>void _(e),variant:`destructive`}]})]})}export{_e as FeedbacksTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$S as r,Av as ee,BS as i,FS as te,GS as ne,HS as a,IS as re,JS as ie,KS as o,LC as s,LS as c,PS as l,QS as u,RS as d,US as f,VS as ae,WS as oe,XS as se,YS as ce,ZS as le,_w as ue,aC as de,cC as fe,dC as p,eC as m,fC as h,gw as pe,hC as me,iC as g,lC as he,mC as ge,nC as _,oC as _e,pC as ve,qS as v,rC as y,sC as b,tC as x,uC as S,uw as C,zC as w,zS as T}from"./dist-ws-D-Lv-.js";import{t as E}from"./button-DuXPa4Vl.js";import{$ as D,B as O,C as k,Ct as A,G as j,H as M,K as N,Q as P,S as F,U as ye,V as be,W as xe,b as I,et as L,ht as Se,j as Ce,m as we,q as Te,rt as Ee,wt as R,x as z,y as B,yt as De}from"./index-Bp-uQn4K.js";import{a as Oe,i as V,n as ke,o as H,r as U,t as Ae}from"./table-CoglL6L8.js";var W=t(e(),1),G=n(),K=`all`;function q(e){switch(e){case`image`:return g();case`audio`:return y();case`video`:return _();case`pdf`:return x();case`document`:return m();case`archive`:return r();default:return u()}}function J(){let[e,t]=(0,W.useState)(K),[n,r]=(0,W.useState)(K),[u,m]=(0,W.useState)(K),[g,_]=(0,W.useState)(K),[y,x]=(0,W.useState)(null),J=pe(C.files.softDelete),Y=Ce();function je(){t(K),r(K),m(K),_(K)}async function Me(){let e=y;if(x(null),e)try{await J({fileId:e.id}),Y.success(ae())}catch(e){Y.error(i(),e)}}let X=ue(C.files.listMine,{direction:e===K?void 0:e,chatId:n===K?void 0:n,instanceName:u===K?void 0:u,category:g===K?void 0:g}),Ne=(0,W.useMemo)(()=>new Intl.DateTimeFormat(w(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:s()});let{files:Z,facets:Q,truncated:Pe,cap:Fe}=X,$=e!==K||n!==K||u!==K||g!==K;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:me()}),(0,G.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,G.jsxs)(B,{value:e,onValueChange:t,children:[(0,G.jsx)(F,{size:`sm`,"aria-label":ge(),children:(0,G.jsx)(k,{})}),(0,G.jsxs)(I,{children:[(0,G.jsx)(z,{value:K,children:ve()}),(0,G.jsx)(z,{value:`inbound`,children:h()}),(0,G.jsx)(z,{value:`outbound`,children:p()})]})]}),(0,G.jsxs)(B,{value:n,onValueChange:r,children:[(0,G.jsx)(F,{size:`sm`,"aria-label":S(),children:(0,G.jsx)(k,{})}),(0,G.jsxs)(I,{children:[(0,G.jsx)(z,{value:K,children:he()}),Q.chats.map(e=>(0,G.jsx)(z,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,G.jsxs)(B,{value:u,onValueChange:m,children:[(0,G.jsx)(F,{size:`sm`,"aria-label":fe(),children:(0,G.jsx)(k,{})}),(0,G.jsxs)(I,{children:[(0,G.jsx)(z,{value:K,children:b()}),Q.instances.map(e=>(0,G.jsx)(z,{value:e,children:e},e))]})]}):null,(0,G.jsxs)(B,{value:g,onValueChange:_,children:[(0,G.jsx)(F,{size:`sm`,"aria-label":_e(),children:(0,G.jsx)(k,{})}),(0,G.jsxs)(I,{children:[(0,G.jsx)(z,{value:K,children:de()}),Q.categories.map(e=>(0,G.jsx)(z,{value:e,children:q(e)},e))]})]}),$?(0,G.jsxs)(E,{variant:`ghost`,size:`sm`,onClick:je,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,G.jsx)(De,{size:14,"aria-hidden":!0}),oe()]}):null]}),Z.length===0?(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:$?te():re()}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(Ae,{children:[(0,G.jsx)(Oe,{children:(0,G.jsxs)(H,{children:[(0,G.jsx)(V,{children:le()}),(0,G.jsx)(V,{children:se()}),(0,G.jsx)(V,{children:ce()}),(0,G.jsx)(V,{children:ie()}),(0,G.jsx)(V,{children:v()}),(0,G.jsx)(V,{className:`text-right`,children:o()})]})}),(0,G.jsx)(ke,{children:Z.map(e=>(0,G.jsxs)(H,{children:[(0,G.jsx)(U,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:e.filename}),(0,G.jsx)(U,{title:e.mimeType,children:q(e.category)}),(0,G.jsx)(U,{children:(0,G.jsx)(we,{variant:`secondary`,children:e.direction===`inbound`?h():p()})}),(0,G.jsx)(U,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,G.jsx)(U,{className:`whitespace-nowrap text-muted-foreground`,children:Ne.format(e.createdAt)}),(0,G.jsx)(U,{className:`text-right`,children:(0,G.jsxs)(P,{children:[(0,G.jsx)(Ee,{asChild:!0,children:(0,G.jsx)(E,{variant:`ghost`,size:`icon`,"aria-label":f(),children:(0,G.jsx)(A,{size:16})})}),(0,G.jsxs)(D,{align:`end`,children:[e.url?(0,G.jsx)(L,{asChild:!0,children:(0,G.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,G.jsx)(R,{size:14}),ne()]})}):(0,G.jsxs)(L,{disabled:!0,children:[(0,G.jsx)(R,{size:14}),c()]}),(0,G.jsxs)(L,{variant:`destructive`,onSelect:()=>x({id:e._id,filename:e.filename}),children:[(0,G.jsx)(Se,{size:14}),a()]})]})]})})]},e._id))})]}),Pe?(0,G.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:l({cap:Fe})}):null]}),(0,G.jsx)(O,{open:y!==null,onOpenChange:e=>!e&&x(null),children:(0,G.jsxs)(ye,{children:[(0,G.jsxs)(N,{children:[(0,G.jsx)(Te,{children:T()}),(0,G.jsx)(xe,{children:d()})]}),(0,G.jsxs)(j,{children:[(0,G.jsx)(M,{children:ee()}),(0,G.jsx)(be,{onClick:()=>void Me(),children:a()})]})]})})]})}export{J as FilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,$n as i,An as a,Bn as o,Cn as s,Dn as c,En as l,Fn as u,Gn as d,Hn as f,In as p,JC as m,Jn as h,Kn as g,Ln as _,Mn as v,Nn as y,On as b,Pn as x,Qn as ee,Rn as te,Sn as S,Tn as ne,Un as re,Vn as ie,Wn as ae,XC as oe,Xn as C,YC as w,Yn as se,Zn as T,_n as E,_w as D,an as ce,ar as le,bn as O,cn as ue,cr as k,dn as de,dr as fe,dw as A,er as j,fn as pe,fr as M,gn as me,gw as N,hn as he,in as ge,ir as _e,jn as ve,kn as ye,ln as be,lr as xe,mn as Se,n as P,nr as Ce,nw as F,on as we,or as Te,pn as Ee,qn as De,rn as Oe,rr as ke,rw as I,sn as L,sr as Ae,t as je,tr as Me,un as Ne,ur as Pe,uw as R,vn as Fe,wn as Ie,xn as Le,yn as Re,zn as ze}from"./dist-ws-D-Lv-.js";import{t as Be}from"./dist-ZW9rNZ8M.js";import{t as Ve}from"./x-D96nOW2m.js";import{t as z}from"./button-DuXPa4Vl.js";import{C as He,Dt as Ue,F as We,I as Ge,J as B,M as Ke,O as V,P as qe,R as Je,S as Ye,_t as H,b as Xe,dt as Ze,ft as Qe,gt as U,h as $e,j as W,m as G,ot as et,pt as tt,x as nt,y as rt,z as it}from"./index-Bp-uQn4K.js";import{t as at}from"./FilterBar-BmFEn3qs.js";import{t as ot}from"./DataTableShell-B_P8ehdH.js";import{t as K}from"./DetailChips-DccwdoeS.js";var st=A(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ct=A(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),q=A(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),lt=A(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),J=t(e(),1),Y=n(),X=`Tabs`,[ut,dt]=r(X,[tt]),ft=tt(),[pt,Z]=ut(X),mt=J.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Be(s),[d,f]=oe({prop:r,onChange:i,defaultProp:a??``,caller:X});return(0,Y.jsx)(pt,{scope:n,baseId:m(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,Y.jsx)(I.div,{dir:u,"data-orientation":o,...l,ref:t})})});mt.displayName=X;var ht=`TabsList`,gt=J.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=Z(ht,n),o=ft(n);return(0,Y.jsx)(Qe,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,Y.jsx)(I.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});gt.displayName=ht;var _t=`TabsTrigger`,vt=J.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Z(_t,n),s=ft(n),c=xt(o.baseId,r),l=St(o.baseId,r),u=r===o.value;return(0,Y.jsx)(Ze,{asChild:!0,...s,focusable:!i,active:u,children:(0,Y.jsx)(I.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:F(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:F(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:F(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});vt.displayName=_t;var yt=`TabsContent`,bt=J.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Z(yt,n),c=xt(s.baseId,r),l=St(s.baseId,r),u=r===s.value,d=J.useRef(u);return J.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,Y.jsx)(w,{present:i||u,children:({present:n})=>(0,Y.jsx)(I.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});bt.displayName=yt;function xt(e,t){return`${e}-trigger-${t}`}function St(e,t){return`${e}-content-${t}`}var Ct=mt,wt=gt,Tt=vt,Et=bt;function Dt(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function Ot(e,t){let n=e.filter(e=>e.source===`discovered`),r=t.trim().toLowerCase();return r?n.filter(e=>(e.displayName??e.agentId).toLowerCase().includes(r)||e.agentId.toLowerCase().includes(r)):n}function kt(e){let t=e.name?.trim()??``,n=e.email?.trim()??``,r=e.canonical?.trim()||`u-${e.userId.slice(0,8)}`;return t?{primary:t,secondary:n||`@${r}`}:n?{primary:n,secondary:null}:{primary:`@${r}`,secondary:null}}function At(e){switch(e){case`admin`:return y();case`user`:return v();case`pending`:return ve();default:return e}}function jt(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function Mt(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}function Nt({className:e,orientation:t=`horizontal`,...n}){return(0,Y.jsx)(Ct,{"data-slot":`tabs`,"data-orientation":t,className:P(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Pt=je(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Ft({className:e,variant:t=`default`,...n}){return(0,Y.jsx)(wt,{"data-slot":`tabs-list`,"data-variant":t,className:P(Pt({variant:t}),e),...n})}function Q({className:e,...t}){return(0,Y.jsx)(Tt,{"data-slot":`tabs-trigger`,className:P(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function $({className:e,...t}){return(0,Y.jsx)(Et,{"data-slot":`tabs-content`,className:P(`flex-1 text-sm outline-none`,e),...t})}var It={name:``,description:``};function Lt(){let e=D(R.groups.listGroups,{}),t=D(R.me.getMe,{host:et})?.role===`admin`,n=N(R.groups.createGroup),r=N(R.groups.updateGroup),a=N(R.groups.deleteGroup),o=Ke(),s=W(),[c,l]=(0,J.useState)(!1),[u,f]=(0,J.useState)(null),[p,m]=(0,J.useState)(It),[_,v]=(0,J.useState)(null),[y,b]=(0,J.useState)(``),x=(0,J.useMemo)(()=>{if(!e)return e;let t=y.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||e.members.some(e=>e.label.toLowerCase().includes(t))||e.agents.some(e=>e.toLowerCase().includes(t))||e.charts.some(e=>e.name.toLowerCase().includes(t))):e},[e,y]);function te(){f(null),m(It),l(!0)}function S(e){f(e),m({name:e.name,description:e.description??``}),l(!0)}async function ne(){try{u?await r({groupId:u._id,name:p.name,description:p.description}):await n({name:p.name,description:p.description||void 0}),m(It),f(null),l(!1)}catch(e){s.error(we(),e)}}async function re(e){if(await o({title:De({name:e.name}),description:g(),confirmWord:e.name,confirmLabel:d(),cancelLabel:i(),destructive:!0}))try{await a({groupId:e._id})}catch(e){s.error(ce(),e)}}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}),(0,Y.jsx)(at,{q:y,onQChange:b,onReset:()=>b(``),canReset:y!==``,searchPlaceholder:_e()}),(0,Y.jsx)(ot,{title:M(),rows:x,addLabel:Pe(),onAdd:t?te:void 0,emptyHint:xe(),columns:[{header:k(),cell:e=>e.name,sort:e=>e.name},{header:Ae(),cell:e=>(0,Y.jsx)(K,{icon:(0,Y.jsx)(lt,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,Y.jsx)(q,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:Te(),cell:e=>(0,Y.jsx)(K,{icon:(0,Y.jsx)(H,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:le(),cell:e=>(0,Y.jsx)(K,{icon:(0,Y.jsx)(ct,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,Y.jsx)(U,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:ke(),onSelect:()=>v({groupId:e._id,name:e.name})},...t?[{label:Ce(),onSelect:()=>S(e)},{label:Me(),variant:`destructive`,onSelect:()=>void re(e)}]:[]]}),(0,Y.jsx)($e,{open:c,onOpenChange:l,title:u?T():ee(),description:C(),canSubmit:!!p.name.trim(),onSubmit:ne,submitLabel:j(),children:(0,Y.jsxs)(`div`,{className:`oc-form`,children:[(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:se()}),(0,Y.jsx)(B,{value:p.name,onChange:e=>m({...p,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:h()}),(0,Y.jsx)(B,{value:p.description,onChange:e=>m({...p,description:e.target.value})})]})]})}),(0,Y.jsx)(Bt,{groupId:_?.groupId??null,groupName:_?.name??``,open:_!==null,onOpenChange:e=>{e||v(null)}})]})}var Rt=8;function zt({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,Y.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,Y.jsxs)(z,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,Y.jsx)(st,{size:14,"aria-hidden":!0}),p()]}),(0,Y.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":x({page:e,pages:t}),children:[e,` / `,t]}),(0,Y.jsxs)(z,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[u(),(0,Y.jsx)(Ue,{size:14,"aria-hidden":!0})]})]})}function Bt({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=D(R.groups.getGroup,n&&e?{groupId:e}:`skip`),s=D(R.groups.listAssignableInstances,n?{}:`skip`),c=D(R.groups.listAssignableUsers,n?{}:`skip`),u=N(R.groups.addMember),d=N(R.groups.removeMember),p=N(R.groups.bulkSetMembers),m=N(R.groups.setGroupManager),h=W(),[g,v]=(0,J.useState)(``),[y,x]=(0,J.useState)(``),[ee,S]=(0,J.useState)(`members`),[oe,C]=(0,J.useState)(1),[w,se]=(0,J.useState)(new Set),T=(0,J.useRef)(null),E=(0,J.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),ce=(0,J.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),le=i?.viewerIsAdmin===!0,O=(0,J.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,J.useEffect)(()=>{v(``),x(``),S(`members`),C(1),T.current=null},[n,e]),(0,J.useEffect)(()=>{C(1)},[g]),(0,J.useEffect)(()=>{n&&i&&e&&T.current!==e&&(T.current=e,se(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let k=(0,J.useMemo)(()=>c?Dt(c,g,w):[],[c,g,w]);async function fe(t,n){if(e)try{n?await d({groupId:e,userId:t}):await u({groupId:e,userId:t})}catch(e){h.error(ge(),e)}}async function A(t,n){if(e)try{await m({groupId:e,userId:t,manager:!n})}catch(e){h.error(ue(),e)}}let j=jt(k,e=>E.has(e.userId)),pe=k.filter(e=>E.has(e.userId)).length,M=Mt(k,oe,Rt);async function me(){if(!e||k.length===0)return;let t=k.map(e=>e.userId);try{await p({groupId:e,userIds:t,member:j!==`all`})}catch(e){h.error(ge(),e)}}return(0,Y.jsx)(qe,{open:n,onOpenChange:r,children:(0,Y.jsxs)(We,{className:`oc-access`,children:[(0,Y.jsxs)(Je,{children:[(0,Y.jsx)(it,{children:ae({name:t})}),(0,Y.jsx)(Ge,{children:re()})]}),(0,Y.jsxs)(Nt,{value:ee,onValueChange:S,className:`oc-access__tabs`,children:[(0,Y.jsxs)(Ft,{className:`w-full`,children:[(0,Y.jsxs)(Q,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(lt,{size:13,"aria-hidden":!0}),f(),i?(0,Y.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:E.size}):null]}),(0,Y.jsxs)(Q,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(H,{size:13,"aria-hidden":!0}),o(),i?(0,Y.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:O.size}):null]}),(0,Y.jsxs)(Q,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(ct,{size:13,"aria-hidden":!0}),Re(),i?(0,Y.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,Y.jsx)($,{value:`members`,children:c===void 0||i===void 0?(0,Y.jsx)(`p`,{className:`oc-access__hint`,children:b()}):c.length===0?(0,Y.jsx)(`p`,{className:`oc-access__hint`,children:l()}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(B,{value:g,onChange:e=>v(e.target.value),placeholder:ie(),className:`oc-access__search`}),k.length===0?(0,Y.jsx)(`p`,{className:`oc-access__hint`,children:te()}):(0,Y.jsxs)(Y.Fragment,{children:[k.length>1?(0,Y.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Y.jsx)(V,{checked:j===`all`?!0:j===`some`?`indeterminate`:!1,onCheckedChange:()=>void me(),"aria-label":_()}),(0,Y.jsx)(`span`,{className:`oc-access__label`,children:_()}),(0,Y.jsxs)(G,{variant:`outline`,className:`oc-access__count`,children:[pe,` / `,k.length]})]}):null,(0,Y.jsx)(`div`,{className:`oc-access__list`,children:M.pageItems.map(e=>{let t=E.has(e.userId),n=kt(e),r=ce.has(e.userId);return(0,Y.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Y.jsx)(V,{checked:t,onCheckedChange:()=>void fe(e.userId,t),"aria-label":a({user:n.primary})}),(0,Y.jsxs)(`span`,{className:`oc-access__who`,children:[(0,Y.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,Y.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,Y.jsx)(G,{variant:`outline`,className:`oc-access__role`,children:At(e.role)}),(0,Y.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&le?(0,Y.jsx)(z,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?be():Ne(),title:r?be():Ne(),onClick:()=>void A(e.userId,r),children:(0,Y.jsx)(q,{size:15,"aria-hidden":!0})}):t&&r?(0,Y.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":de(),title:de(),children:(0,Y.jsx)(q,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,Y.jsx)(zt,{page:M.page,pageCount:M.pageCount,onPage:C})]})]})}),(0,Y.jsx)($,{value:`agents`,children:s===void 0?(0,Y.jsx)(`p`,{className:`oc-access__hint`,children:b()}):s.length===0?(0,Y.jsx)(`p`,{className:`oc-access__hint`,children:ne()}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(B,{value:y,onChange:e=>x(e.target.value),placeholder:ze(),className:`oc-access__search`}),(0,Y.jsx)(`div`,{className:`oc-access__list`,children:s.map(t=>(0,Y.jsx)(Vt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:O,query:y},`${e}-${t._id}`))})]})}),(0,Y.jsx)($,{value:`charts`,children:(0,Y.jsx)(Ht,{groupId:e})})]})]})})}function Vt({groupId:e,instanceName:t,kind:n,assigned:r,query:i}){let a=D(R.groups.listAssignableAgents,{instanceName:t}),o=N(R.groups.assignAgentToGroup),l=N(R.groups.removeAgentFromGroup),u=N(R.groups.bulkSetGroupAgents),d=W(),[f,p]=(0,J.useState)(1);if((0,J.useEffect)(()=>{p(1)},[i]),!e)return null;let m=Ot(a?.agents??[],i),h=a?.discovery&&!a.discovery.lastPollOk;if(i.trim()&&m.length===0)return null;let g=m.filter(e=>e.presentInLastOk!==!1),v=jt(g,e=>r.has(`${t}/${e.agentId}`)),y=Mt(m,f,Rt);async function b(n,r){try{r?await l({groupId:e,instanceName:t,agentId:n}):await o({groupId:e,instanceName:t,agentId:n})}catch(e){d.error(Oe(),e)}}async function x(){if(g.length===0)return;let n=g.map(e=>e.agentId);try{await u({groupId:e,instanceName:t,agentIds:n,assigned:v!==`all`})}catch(e){d.error(Oe(),e)}}return(0,Y.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Y.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Y.jsx)(H,{size:13,"aria-hidden":!0}),(0,Y.jsx)(`span`,{children:t}),(0,Y.jsx)(G,{variant:`outline`,className:`oc-access__kind`,children:n}),h?(0,Y.jsx)(G,{variant:`outline`,className:`oc-access__stale`,children:S()}):null]}),a===void 0?(0,Y.jsx)(`p`,{className:`oc-access__hint`,children:c()}):m.length===0?(0,Y.jsx)(`p`,{className:`oc-access__hint`,children:h?s():Ie()}):(0,Y.jsxs)(Y.Fragment,{children:[g.length>1?(0,Y.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Y.jsx)(V,{checked:v===`all`?!0:v===`some`?`indeterminate`:!1,onCheckedChange:()=>void x(),"aria-label":_()}),(0,Y.jsx)(`span`,{className:`oc-access__label`,children:_()})]}):null,y.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,Y.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Y.jsx)(V,{checked:i,disabled:a&&!i,onCheckedChange:()=>void b(e.agentId,i),"aria-label":ye({name:e.displayName??e.agentId})}),(0,Y.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Y.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,Y.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":O(),title:O(),children:(0,Y.jsx)(U,{size:14,fill:`currentColor`})}):null,a?(0,Y.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:Le()}):null]},e.agentId)}),(0,Y.jsx)(zt,{page:y.page,pageCount:y.pageCount,onPage:p})]})]})}function Ht({groupId:e}){let t=D(R.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=N(R.charts.assignChartToGroup),r=N(R.charts.removeChartFromGroup),i=N(R.charts.setGroupDefaultChart),a=N(R.charts.addChartToGroupPool),o=N(R.charts.removeChartFromGroupPool),s=W();if(!e)return null;if(t===void 0)return(0,Y.jsx)(`p`,{className:`oc-access__hint`,children:b()});let{pool:c,addable:l,canManagePool:u}=t;if(c.length===0&&!u)return(0,Y.jsx)(`p`,{className:`oc-access__hint`,children:Fe()});async function d(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}async function f(t){try{await i({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}async function p(t){try{await a({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}async function m(t){try{await o({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`oc-access__list`,children:c.map(e=>(0,Y.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Y.jsx)(V,{checked:e.selected,onCheckedChange:()=>void d(e.chartKey,e.selected),"aria-label":Se({name:e.name})}),(0,Y.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,Y.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":Ee(),title:Ee(),children:(0,Y.jsx)(U,{size:14,fill:`currentColor`})}):(0,Y.jsx)(z,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void f(e.chartKey),children:pe()}):null,u?(0,Y.jsx)(z,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":he({name:e.name}),title:he({name:e.name}),onClick:()=>void m(e.chartKey),children:(0,Y.jsx)(Ve,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),u?l.length>0?(0,Y.jsxs)(rt,{value:``,onValueChange:e=>void p(e),children:[(0,Y.jsx)(Ye,{size:`sm`,className:`oc-access__search`,children:(0,Y.jsx)(He,{placeholder:me()})}),(0,Y.jsx)(Xe,{children:l.map(e=>(0,Y.jsx)(nt,{value:e.chartKey,children:e.name},e.chartKey))})]}):c.length===0?(0,Y.jsx)(`p`,{className:`oc-access__hint`,children:E()}):null:null]})}export{Lt as GroupsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$f as r,$p as i,Af as a,Ap as o,Bf as s,Bp as c,Cf as l,Cp as u,Df as d,Dp as f,Ef as p,Ep as m,Ff as h,Fp as g,Gf as _,Gp as v,Hf as y,Hp as ee,If as b,Ip as x,Jf as S,Jp as te,Kf as C,Kp as ne,Lf as re,Lp as ie,Mf as ae,Mp as oe,Nf as se,Np as ce,Of as le,Op as ue,Pf as de,Pp as fe,Qf as pe,Qp as me,Rf as he,Rp as ge,Sf as _e,Sp as w,Tf as ve,Tp as ye,Uf as T,Up as be,Vf as xe,Vp as Se,Wf as Ce,Wp as we,Xf as Te,Xp as Ee,Yf as De,Yp as Oe,Zf as ke,Zp as Ae,_p as je,_w as E,_y as D,am as Me,ap as Ne,bf as O,bp as Pe,cp as Fe,dp as k,em as Ie,ep as Le,fp as Re,gc as ze,gp as Be,gw as A,hc as Ve,hp as j,im as He,ip as Ue,jf as We,jp as Ge,kf as Ke,kp as qe,lp as Je,mp as Ye,mw as M,nm as Xe,np as Ze,op as Qe,pp as $e,qf as et,qp as tt,rm as nt,rp as rt,sp as it,tm as at,tp as ot,up as st,uw as N,vp as ct,vy as P,wf as lt,wp as ut,xf as dt,xp as ft,yf as pt,yp as mt,zf as ht,zp as gt}from"./dist-ws-D-Lv-.js";import{a as _t,c as vt}from"./FieldLabel-CtF9VFJv.js";import{t as F}from"./button-DuXPa4Vl.js";import{C as yt,F as I,I as L,J as R,M as bt,O as z,P as B,R as V,S as H,X as xt,Y as St,Z as Ct,b as U,h as wt,j as W,m as G,x as K,y as q,z as J}from"./index-Bp-uQn4K.js";import{t as Tt}from"./DataTableShell-B_P8ehdH.js";import{InstanceConfigDialog as Et}from"./BridgeTab-DwwnrXwF.js";var Y=t(e(),1),X=[`conversational`,`documentary`],Dt=new Set(X),Ot=`conversational`;function kt(e){let t=new Set((e??[]).filter(e=>Dt.has(e)));return t.size===0?[Ot]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:_t},At={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function jt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function Mt(){let e=E(N.admin.listInstances,{}),t=E(N.agents.listAllInstanceAgents,{}),n=A(N.admin.upsertInstance),r=A(N.admin.deleteInstance),a=W(),[s,l]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(Q),[f,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(null),[_,y]=(0,Y.useState)(null),[b,S]=(0,Y.useState)(null);async function C(){try{await n({instanceId:b??void 0,name:u.name,gatewayUrl:u.gatewayUrl,bridgeUrl:u.bridgeUrl||void 0,displayName:u.displayName||void 0,kind:u.kind,gatewayVersion:u.gatewayVersion||void 0,gatewayHttpUrl:u.gatewayHttpUrl||void 0,streamTransport:u.streamTransport}),d(Q),S(null),l(!1)}catch(e){a.error(nt(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[Xe(),(0,Z.jsx)(`strong`,{children:at()}),Ie()]}),(0,Z.jsx)(Tt,{title:i(),rows:e,addLabel:me(),onAdd:()=>{S(null),d(Q),l(!0)},emptyHint:Ae(),columns:[{header:Ee(),cell:e=>e.name,sort:e=>e.name},{header:Oe(),cell:e=>(0,Z.jsx)(G,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:te(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:tt(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:Me(),cell:e=>{let n=(t?.[e.name]??[]).filter(e=>e.presentInLastOk!==!1&&e.enabled);if(n.length===0)return(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let r=t=>e.defaultAgentId===t;return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[...n].sort((e,t)=>Number(r(t.agentId))-Number(r(e.agentId))).map(e=>(0,Z.jsxs)(G,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?O():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:be(),onSelect:()=>{S(e._id),d(jt(e)),l(!0)}},{label:He(),onSelect:()=>p(e.name)},{label:ue(),onSelect:()=>y(e)},{label:ne(),onSelect:()=>h(e)},{label:v(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:v(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(wt,{open:s,onOpenChange:l,title:b?ee():we(),description:c(),canSubmit:!!(u.name&&u.gatewayUrl),onSubmit:C,submitLabel:gt(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:ge(),children:[(0,Z.jsx)(R,{value:u.name,disabled:b!==null,onChange:e=>d({...u,name:e.target.value})}),b?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Se()}):null]}),(0,Z.jsx)($,{label:ie(),children:(0,Z.jsxs)(q,{value:u.kind,onValueChange:e=>d({...u,kind:e}),children:[(0,Z.jsx)(H,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsxs)(U,{children:[(0,Z.jsx)(K,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(K,{value:`hermes`,children:`Hermes`})]})]})}),(0,Z.jsx)($,{label:x(),children:(0,Z.jsx)(R,{value:u.gatewayUrl,onChange:e=>d({...u,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:g(),children:(0,Z.jsx)(R,{value:u.bridgeUrl,placeholder:fe(),onChange:e=>d({...u,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:ce(),children:(0,Z.jsx)(R,{value:u.displayName,onChange:e=>d({...u,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:ze(),children:[(0,Z.jsxs)(q,{value:u.streamTransport,onValueChange:e=>d({...u,streamTransport:e}),children:[(0,Z.jsx)(H,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(U,{children:vt.map(e=>(0,Z.jsx)(K,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Ve()})]}),(0,Z.jsx)($,{label:oe(),children:(0,Z.jsx)(R,{value:u.gatewayVersion,placeholder:Ge(),onChange:e=>d({...u,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:o(),children:(0,Z.jsx)(R,{value:u.gatewayHttpUrl,placeholder:qe(),onChange:e=>d({...u,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Ht,{instanceName:f,open:f!==null,onOpenChange:e=>{e||p(null)}}),m?(0,Z.jsx)(Et,{instance:m,onClose:()=>h(null)},m._id):null,_?(0,Z.jsx)(Nt,{instance:_,onClose:()=>y(null)},_._id):null]})}function Nt({instance:e,onClose:t}){let n=E(N.instanceSecrets.listInstanceSecretStatus,{}),r=At[e.kind??`openclaw`],i=(0,Y.useMemo)(()=>{let t={};for(let r of n??[])r.instanceId===e._id&&(t[r.field]=r.updatedAt);return t},[n,e._id]);return(0,Z.jsx)(B,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(I,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(J,{children:f({instance:e.displayName??e.name})}),(0,Z.jsx)(L,{children:m()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(It,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Ft,{instance:e})}),(0,Z.jsx)(Pt,{instance:e})]})})}function Pt({instance:e}){let t=M(N.instanceSync.forceInstanceSync),n=W(),[i,a]=(0,Y.useState)(!1);async function o(){if(!i){a(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(Qe());break;case`no_agents`:n.success(Ue());break;case`no_bridge_url`:n.error(rt());break;case`deploy_misconfigured`:n.error(Ze());break;case`unauthorized`:n.error(Le());break;case`not_served`:n.error(r());break;default:n.error(ot());break}}catch(e){n.error(Ne(),e)}finally{a(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:pe()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(F,{size:`sm`,variant:`outline`,onClick:()=>void o(),disabled:i,children:i?it():Fe()})})]})}function Ft({instance:e}){let t=E(N.bridgeAuth.listBridgeAuthStatus,{}),n=M(N.bridgeAuth.mintBridgeSecret),r=A(N.bridgeAuth.revokeBridgeSecret),i=W(),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)(!1),d=(t??[]).find(t=>t.instanceId===e._id),f=d!==void 0;async function p(){if(!a){o(!0);try{c((await n({instanceId:e._id})).plaintext),u(!1)}catch(e){i.error(_(),e)}finally{o(!1)}}}async function m(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(C())}catch(e){i.error(_(),e)}finally{o(!1)}}}async function h(){if(s)try{await navigator.clipboard.writeText(s),u(!0)}catch{}}return(0,Z.jsxs)($,{label:ke(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Te()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(G,{variant:f?`outline`:`secondary`,children:f?`${w()} · ${d.prefix}…${d.lastFour}`:ft()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{size:`sm`,onClick:()=>void p(),disabled:a,children:f?S():De()}),f?(0,Z.jsx)(F,{size:`sm`,variant:`destructive`,onClick:()=>void m(),disabled:a,children:et()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:Ce()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>void h(),children:l?P():D()})]}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),u(!1)},children:T()})]}):null]})}function It({instanceId:e,field:t,updatedAt:n}){let r=M(N.instanceSecrets.setInstanceSecret),i=A(N.instanceSecrets.clearInstanceSecret),a=M(N.deviceIdentity.generateDeviceIdentity),o=W(),[s,c]=(0,Y.useState)(``),[l,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(!1),g=n!==null,_=t===`deviceIdentity`,v=t===`token`?ye():t===`deviceIdentity`?ut():u();async function y(){if(!(!s.trim()||l)){d(!0);try{await r({instanceId:e,field:t,plaintext:s}),c(``),p(null),h(!1),o.success(Be())}catch(e){o.error(j(),e)}finally{d(!1)}}}async function ee(){if(!l){d(!0);try{await i({instanceId:e,field:t}),p(null),h(!1),o.success(Ye())}catch(e){o.error(j(),e)}finally{d(!1)}}}async function b(){if(!l){d(!0);try{p(await a({instanceId:e})),h(!1),o.success(k())}catch(e){o.error(Je(),e)}finally{d(!1)}}}let x=f?`openclaw devices approve ${f.id}`:``;async function S(){if(x)try{await navigator.clipboard.writeText(x),h(!0)}catch{}}return(0,Z.jsxs)($,{label:v,children:[_?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Re()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(G,{variant:g?`outline`:`secondary`,children:g?w():ft()}),(0,Z.jsx)(R,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:s,placeholder:g?mt():Pe(),onChange:e=>c(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{size:`sm`,onClick:()=>void y(),disabled:l||s.trim().length===0,children:ct()}),_?(0,Z.jsx)(F,{size:`sm`,variant:`outline`,onClick:()=>void b(),disabled:l,children:$e()}):null,g?(0,Z.jsx)(F,{size:`sm`,variant:`destructive`,onClick:()=>void ee(),disabled:l,children:je()}):null]})]}),f?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:k()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:st()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:x}),(0,Z.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>void S(),children:m?P():D()})]}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,onClick:()=>{p(null),h(!1)},children:T()})]}):null]})}var Lt={conversational:h,documentary:se},Rt={conversational:de,documentary:ae},zt=e=>(Lt[e]??(()=>e))(),Bt=e=>(Rt[e]??(()=>``))();function Vt({agentId:e,types:t,onToggle:n}){return(0,Z.jsxs)(`div`,{className:`oc-agentcard__types`,children:[(0,Z.jsx)(`span`,{className:`oc-agentcard__types-label`,children:ht()}),t.map(e=>(0,Z.jsx)(G,{variant:`secondary`,className:`oc-agenttype__chip`,title:Bt(e),children:zt(e)},e)),(0,Z.jsxs)(St,{children:[(0,Z.jsx)(Ct,{asChild:!0,children:(0,Z.jsx)(F,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:he()})}),(0,Z.jsxs)(xt,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:re()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:b()}),(0,Z.jsx)(`div`,{className:`oc-agenttypes-pop__list`,children:X.map(r=>{let i=`agtype-${e}-${r}`;return(0,Z.jsxs)(`div`,{className:`oc-agenttypes-pop__item`,children:[(0,Z.jsx)(z,{id:i,checked:t.includes(r),onCheckedChange:()=>n(r)}),(0,Z.jsxs)(`label`,{htmlFor:i,className:`oc-agenttypes-pop__text`,children:[(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__name`,children:zt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Bt(r)})]})]},r)})})]})]})]})}function Ht({instanceName:e,open:t,onOpenChange:n}){let r=E(N.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=A(N.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(N.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(N.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),o=A(N.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(N.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(N.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),c=A(N.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(N.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=kt(r);e.setQuery(N.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),u=A(N.agents.removeInstanceAgent),f=bt(),m=W();async function h(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){m.error(s(),e)}}async function g(t){if(e)try{await o({instanceName:e,agentId:t})}catch(e){m.error(s(),e)}}async function _(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await c({instanceName:e,agentId:t,types:i})}catch(e){m.error(s(),e)}}async function v(t,n){if(e&&await f({title:Ke({name:n}),description:le(),confirmLabel:d(),destructive:!0}))try{await u({instanceName:e,agentId:t}),m.success(p())}catch(e){m.error(s(),e)}}return(0,Z.jsx)(B,{open:t,onOpenChange:n,children:(0,Z.jsxs)(I,{className:`oc-access`,children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(J,{children:y({name:e??``})}),(0,Z.jsx)(L,{children:xe()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:ve()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?lt():r.discovery.lastPollOk?l():_e({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:dt()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(e=>{let t=e.presentInLastOk===!1,n=r.defaultAgentId===e.agentId,i=e.displayName??e.agentId,o=e.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(e.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(z,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void h(e.agentId,t===!0)}),(0,Z.jsxs)(`span`,{className:`oc-agentcard__name`,title:i,children:[e.emoji?`${e.emoji} `:``,i]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,t?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:pt()}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void v(e.agentId,i),children:a()})]}):n?(0,Z.jsx)(G,{variant:`default`,children:O()}):(0,Z.jsx)(F,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void g(e.agentId),children:We()})]}),e.enabled?(0,Z.jsx)(Vt,{agentId:e.agentId,types:o,onToggle:t=>void _(e.agentId,t,o)}):null]},e.agentId)})})]})]})})}function $({label:e,children:t}){return(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}export{Mt as InstancesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,Bh as ee,Cg as i,Dg as a,Eg as o,Fh as s,Gh as c,Hh as l,Ih as u,Jh as d,Kh as f,Lh as te,Qh as ne,Rh as re,Sg as p,Tg as ie,Uh as ae,Vh as oe,Wh as se,Xh as ce,Yh as le,Zh as m,_g as h,_w as g,ag as _,bg as v,cg as y,dg as b,eg as x,fg as S,gg as C,gw as w,hg as T,ig as E,lg as D,mg as O,ng as k,og as A,pg as j,qh as M,rg as N,sg as ue,tg as P,ug as F,uw as I,vg as L,wg as R,xg as z,yg as B,zh as V}from"./dist-ws-D-Lv-.js";import{C as H,J as U,O as W,S as G,b as K,m as q,x as de,y as fe}from"./index-Bp-uQn4K.js";import{t as pe}from"./DataTableShell-B_P8ehdH.js";var J=t(e(),1),Y=n();function me(){let e=g(I.integrations.status.status,{}),t=w(I.admin.setIntegrationConfig),[n,H]=(0,J.useState)(null);if((0,J.useEffect)(()=>{e&&n===null&&H(e.config)},[e,n]),!e||!n)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:a()});let W=n,G=(e,t,n)=>H({...W,[e]:{...W[e],[t]:n}}),K=(e,n)=>void t({[e]:n});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[o(),` `,(0,Y.jsx)(`strong`,{children:ie()}),` `,R()]}),(0,Y.jsxs)(X,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,Y.jsx)(q,{variant:`secondary`,children:i()}):(0,Y.jsx)(q,{variant:`outline`,children:p()}):(0,Y.jsx)(q,{variant:`outline`,children:z()}),note:B(),children:[(0,Y.jsx)(Z,{label:h(),children:(0,Y.jsx)(U,{value:W.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>G(`langfuse`,`host`,e.target.value),onBlur:()=>K(`langfuse`,{host:W.langfuse.host??``})})}),(0,Y.jsx)(Q,{label:j(),checked:W.langfuse.enabled??!0,onChange:e=>{G(`langfuse`,`enabled`,e),K(`langfuse`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,Y.jsx)(q,{variant:`secondary`,children:i()}):(0,Y.jsx)(q,{variant:`outline`,children:p()}):(0,Y.jsx)(q,{variant:`outline`,children:z()}),note:L(),children:[(0,Y.jsx)(Z,{label:C(),children:(0,Y.jsx)(U,{value:W.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>G(`opik`,`baseUrl`,e.target.value),onBlur:()=>K(`opik`,{baseUrl:W.opik.baseUrl??``})})}),(0,Y.jsx)(Z,{label:T(),children:(0,Y.jsx)(U,{value:W.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||O(),onChange:e=>G(`opik`,`workspace`,e.target.value),onBlur:()=>K(`opik`,{workspace:W.opik.workspace??``})})}),(0,Y.jsx)(Q,{label:j(),checked:W.opik.enabled??!0,onChange:e=>{G(`opik`,`enabled`,e),K(`opik`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:S(),status:(0,Y.jsx)(q,{variant:`outline`,children:v()}),note:b(),children:[(0,Y.jsx)(Z,{label:F(),children:(0,Y.jsx)($,{value:W.tts.auto??`off`,options:[[`off`,D()],[`always`,y()],[`inbound`,ue()],[`tagged`,A()]],onChange:e=>{G(`tts`,`auto`,e),K(`tts`,{auto:e})}})}),(0,Y.jsx)(Z,{label:_(),children:(0,Y.jsx)($,{value:W.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,E()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{G(`tts`,`provider`,e),K(`tts`,{provider:e})}})}),(0,Y.jsx)(Z,{label:N(),children:(0,Y.jsx)(U,{value:W.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>G(`tts`,`model`,e.target.value),onBlur:()=>K(`tts`,{model:W.tts.model??``})})}),(0,Y.jsx)(Z,{label:k(),children:(0,Y.jsx)(U,{value:W.tts.voice??``,placeholder:P(),onChange:e=>G(`tts`,`voice`,e.target.value),onBlur:()=>K(`tts`,{voice:W.tts.voice??``})})})]}),(0,Y.jsxs)(X,{title:x(),status:(0,Y.jsx)(q,{variant:`outline`,children:v()}),note:e.secrets.openai?r():ne(),children:[(0,Y.jsx)(Q,{label:m(),checked:W.talk.enabled??!1,onChange:e=>{G(`talk`,`enabled`,e),K(`talk`,{enabled:e})}}),(0,Y.jsx)(Z,{label:ce(),children:(0,Y.jsx)($,{value:W.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{G(`talk`,`realtimeProvider`,e),K(`talk`,{realtimeProvider:e})}})}),(0,Y.jsx)(Z,{label:le(),children:(0,Y.jsx)(U,{value:W.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>G(`talk`,`realtimeModel`,e.target.value),onBlur:()=>K(`talk`,{realtimeModel:W.talk.realtimeModel??``})})}),(0,Y.jsx)(Z,{label:k(),children:(0,Y.jsx)(U,{value:W.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>G(`talk`,`voice`,e.target.value),onBlur:()=>K(`talk`,{voice:W.talk.voice??``})})}),(0,Y.jsx)(Z,{label:d(),children:(0,Y.jsx)($,{value:W.talk.transport??`webrtc`,options:[[`webrtc`,M()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{G(`talk`,`transport`,e),K(`talk`,{transport:e})}})}),(0,Y.jsx)(Z,{label:f(),children:(0,Y.jsx)(U,{value:W.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>G(`talk`,`speechLocale`,e.target.value),onBlur:()=>K(`talk`,{speechLocale:W.talk.speechLocale??``})})}),(0,Y.jsx)(Q,{label:c(),checked:W.talk.interruptOnSpeech??!0,onChange:e=>{G(`talk`,`interruptOnSpeech`,e),K(`talk`,{interruptOnSpeech:e})}})]}),(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:se()}),(0,Y.jsx)(q,{variant:`outline`,children:ae()})]}),(0,Y.jsxs)(`p`,{className:`oc-uipa__note`,children:[l(),(0,Y.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,Y.jsx)(pe,{title:oe(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:ee(),columns:[{header:V(),cell:e=>(0,Y.jsx)(q,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:re(),cell:e=>e.lastAt>0?new Date(e.lastAt).toLocaleString(`fr-FR`):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:te(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:u(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:s(),cell:e=>e.lastError??`—`,sort:e=>e.lastError??null}]})]})}function X({title:e,status:t,note:n,children:r}){return(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,Y.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function Z({label:e,children:t}){return(0,Y.jsxs)(`label`,{className:`oc-int__field`,children:[(0,Y.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function Q({label:e,checked:t,onChange:n}){return(0,Y.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,Y.jsx)(W,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,Y.jsx)(`span`,{children:e})]})}function $({value:e,options:t,onChange:n}){return(0,Y.jsxs)(fe,{value:e,onValueChange:n,children:[(0,Y.jsx)(G,{size:`sm`,className:`w-full`,children:(0,Y.jsx)(H,{})}),(0,Y.jsx)(K,{children:t.map(([e,t])=>(0,Y.jsx)(de,{value:e,children:t},e))})]})}export{me as IntegrationsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,Ab as i,Bb as a,CC as o,DC as s,EC as c,Fb as l,Gb as u,Hb as d,Ib as f,Jb as p,Kb as m,LC as ee,Lb as h,MC as g,Mb as _,Nb as v,OC as te,Pb as ne,Qb as re,Rb as ie,SC as ae,TC as oe,Ub as se,Vb as ce,Wb as y,Xb as le,Yb as ue,Zb as de,_C as fe,_w as b,ax as x,bC as S,cx as C,ex as w,gw as T,ix as E,jb as D,kC as O,lx as k,nx as A,ox as j,qb as M,rx as N,sx as P,tx as F,uw as I,vC as L,wC as R,xC as z,yC as B,zb as V,zp as pe}from"./dist-ws-D-Lv-.js";import{t as H}from"./button-DuXPa4Vl.js";import{C as me,J as U,O as W,S as he,b as ge,j as _e,k as ve,ot as G,x as K,y as ye}from"./index-Bp-uQn4K.js";var q=t(e(),1),J=[{id:`messages`,label:()=>k()},{id:`composer`,label:()=>C()},{id:`sidebar`,label:()=>P()},{id:`other`,label:()=>j()}],Y={showSource:{category:`messages`,label:()=>x(),help:()=>E()},showReport:{category:`messages`,label:()=>N(),help:()=>A()},copyAssistant:{category:`messages`,label:()=>F()},copyUser:{category:`messages`,label:()=>w()},showDelete:{category:`messages`,label:()=>r()},showTools:{category:`messages`,label:()=>re(),help:()=>de()},voiceInput:{category:`composer`,label:()=>le(),help:()=>ue()},showChatAge:{category:`sidebar`,label:()=>p(),help:()=>M()},showChatProvider:{category:`sidebar`,label:()=>m(),help:()=>u()}};function X(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function be(e,t){let n=X(t.trim()),r=new Map(J.map(e=>[e.id,e.label()])),i=new Map(J.map(e=>[e.id,[]]));for(let t of e){let e=Y[t],a=e?.category??`other`;n&&!X(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return J.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var xe=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`],Se={voiceInput:`voiceInput`};function Ce(e){return xe.includes(e)}function Z(e){return e===`admin`}function we(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Q(e){return e===`on`?!0:e===`off`?!1:null}function Te(e){return Ce(e)?Se[e]:void 0}var $=n(),Ee={voiceInput:()=>ne()};function De({prefKey:e,ui:t}){let n=T(I.admin.setUiPrefDefault),r=T(I.admin.setFeatureEnabled),a=Te(e),o=a?Ee[e]?.():void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,$.jsx)(`span`,{className:`oc-prefs__gov-label`,children:ie()}),(0,$.jsxs)(ye,{value:we(t.defaults[e]),onValueChange:t=>void n({key:e,value:Q(t)}),children:[(0,$.jsx)(he,{size:`sm`,className:`w-36`,children:(0,$.jsx)(me,{})}),(0,$.jsxs)(ge,{children:[(0,$.jsx)(K,{value:`on`,children:_()}),(0,$.jsx)(K,{value:`off`,children:D()}),(0,$.jsx)(K,{value:`inherit`,children:i()})]})]}),a?(0,$.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,$.jsx)(W,{checked:t.featuresEnabled[a]===!0,onCheckedChange:e=>void r({key:a,enabled:e===!0}),"aria-label":h()}),h()]}):null]}),o?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:o}):null]})}function Oe(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=b(I.me.getMe,{host:G}),o=i?.ui,s=Z(i?.role)&&n,c=T(I.me.setUiPref).withOptimisticUpdate(ve),u=(0,q.useMemo)(()=>o?be(Object.keys(o.effective),e):[],[o,e]);return o?(0,$.jsxs)(`div`,{className:`oc-prefs-panel`,children:[Z(i?.role)?(0,$.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,$.jsx)(W,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":V()}),V()]}):null,s?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:f()}),(0,$.jsx)(`p`,{children:l()}),(0,$.jsx)(`p`,{children:v()})]}):null,(0,$.jsx)(U,{value:e,onChange:e=>t(e.target.value),placeholder:y(),"aria-label":y(),className:`mb-2`}),u.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:se()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:u.map(e=>(0,$.jsxs)(`div`,{className:`oc-prefs__group`,children:[(0,$.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Y[e],n=t?t.label():e,r=t?.help?.(),i=o.locked[e],l=o.effective[e],u=o.userOverrides[e]!==void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${u&&!i?` is-overridden`:``}`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,$.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,$.jsx)(`span`,{className:`oc-prefs__lock`,children:d()}):u?null:(0,$.jsx)(`span`,{className:`oc-prefs__def`,children:ce()})]}),r?(0,$.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,$.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&u?(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void c({key:e,value:null}),children:a()}):null,(0,$.jsx)(W,{checked:l,disabled:i,onCheckedChange:t=>void c({key:e,value:t===!0}),"aria-label":n})]}),s?(0,$.jsx)(De,{prefKey:e,ui:o}):null]},e)})]},e.id))})]}):(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:ee()})}function ke(){let e=b(I.me.getMe,{host:G}),t=T(I.me.setLocale),n=T(I.me.setMyName),r=_e(),i=e?.locale??`default`,a=e?.name??``,[l,u]=(0,q.useState)(null),d=l??a,f=d.trim()!==a.trim();async function p(){try{await n({name:d}),u(null),r.success(oe())}catch(e){r.error(R(),e)}}return(0,$.jsxs)(`div`,{className:`oc-appearance`,children:[(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:O()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:te()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(U,{className:`max-w-xs`,value:d,maxLength:120,placeholder:s(),onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f&&(e.preventDefault(),p())}}),(0,$.jsx)(H,{size:`sm`,disabled:!f,onClick:()=>void p(),children:pe()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:c()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:o()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:ae()})]}),(0,$.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`,`default`].map(e=>(0,$.jsx)(H,{variant:i===e?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e==="default"?null:e}),children:e===`fr`?L():e===`en`?fe():g()},e))}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:z()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:S()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:B()})]}),(0,$.jsx)(Oe,{})]})]})}export{ke as PreferencesTab};
@@ -1,2 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$s as r,Js as i,Qs as a,Xs as o,Ys as s,Zs as c,_w as l,ac as u,bc as d,cc as f,dc as p,ec as m,fc as h,gw as g,ic as _,lc as v,nc as y,oc as b,qs as x,rc as S,sc as C,tc as w,uc as T,uw as E,yc as D}from"./dist-ws-D-Lv-.js";import{d as O,f as k,i as A,l as j,n as M,r as N,t as P,u as F}from"./FieldLabel-CtF9VFJv.js";import{t as I}from"./button-DuXPa4Vl.js";import{C as L,O as R,S as z,b as B,j as V,x as H,y as U}from"./index-Bp-uQn4K.js";/* empty css */var W=t(e(),1),G=n(),K={media_delivery:{label:C,help:b},documentary_fetch:{label:u,help:_},inbound_files:{label:S,help:y}},q={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
2
- - gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`},J={outboundDir:s,references:i,files:x};function Y(){let e=l(E.admin.listInstances,{}),[t,n]=(0,W.useState)(null);if(e===void 0)return(0,G.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,G.jsx)(`div`,{className:`oc-injtab`,children:(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:m()})});let r=e.find(e=>e._id===t)??e[0];return(0,G.jsxs)(`div`,{className:`oc-injtab`,children:[(0,G.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,G.jsx)(M,{label:h(),help:p()}),(0,G.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,G.jsx)(`span`,{children:w()}),(0,G.jsxs)(U,{value:r._id,onValueChange:e=>n(e),children:[(0,G.jsx)(z,{size:`sm`,className:`min-w-44`,children:(0,G.jsx)(L,{})}),(0,G.jsx)(B,{children:e.map(e=>(0,G.jsx)(H,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,G.jsx)(X,{instance:r},r._id)]})}function X({instance:e}){let t=g(E.admin.upsertInstanceConfig),n=V(),r=e.config??{},[i,a]=(0,W.useState)(()=>A(r)),[o,s]=(0,W.useState)(!1),c=i.promptInjections,l=(e,t)=>a({...i,promptInjections:{...c,[e]:{...c[e],...t}}});async function u(){s(!0);try{await t({instanceId:e._id,config:N(i,r)})}catch(e){n.error(D(),e)}finally{s(!1)}}return(0,G.jsxs)(`div`,{className:`oc-injtab__body`,children:[F.map(e=>(0,G.jsx)(Z,{injKey:e,def:j[e],i18n:K[e],row:c[e]??{enabled:!0,template:j[e].defaultTemplate},onChange:t=>l(e,t)},e)),(0,G.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,G.jsx)(I,{size:`sm`,onClick:()=>void u(),disabled:o,children:d()})})]})}function Z({injKey:e,def:t,i18n:n,row:i,onChange:s}){let[l,u]=(0,W.useState)(!1),d=i.template.trim()!==t.defaultTemplate,p=t.togglable&&!i.enabled,m=Object.fromEntries(t.placeholders.map(e=>[e,q[e]??`{${e}}`])),h=O(e,i),g=h?k(h,m):``;return(0,G.jsxs)(`section`,{className:`oc-injcard`,children:[(0,G.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,G.jsxs)(`label`,{className:`oc-field--row`,children:[(0,G.jsx)(R,{checked:i.enabled,onCheckedChange:e=>s({enabled:e===!0})}),(0,G.jsx)(M,{label:n.label(),help:n.help()})]}):(0,G.jsx)(M,{label:n.label(),help:n.help()}),d&&(0,G.jsx)(`span`,{className:`oc-injection__badge`,children:v()})]}),(0,G.jsx)(`textarea`,{className:`oc-injcard__text`,value:i.template,disabled:p,rows:8,spellCheck:!1,onChange:e=>s({template:e.target.value})}),(0,G.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,G.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:f()}),t.placeholders.map(e=>(0,G.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,G.jsx)(`code`,{children:`{${e}}`}),(0,G.jsx)(P,{text:(J[e]??(()=>e))()})]},e))]}),(0,G.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,G.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>u(e=>!e),children:l?a():r()}),d&&(0,G.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>s({template:t.defaultTemplate}),children:T()})]})]}),l&&(0,G.jsx)(`div`,{className:`oc-injcard__preview`,children:g?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:g}),(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:c()})]}):(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:o()})})]})}export{Y as PromptInjectionsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$d as r,Ad as i,Bd as ee,Fd as a,Gd as o,Hd as te,Id as ne,Jd as s,Kd as c,Ld as l,Md as u,Nd as d,Od as f,Pd as p,Qd as m,Rd as h,Sd as g,Ud as _,Vd as v,Wd as y,Xd as b,Yd as x,Zd as S,_d as re,_w as ie,bd as C,ef as w,gd as T,gw as E,hd as D,jd as O,kd as k,md as A,nf as j,qd as M,rf as N,tf as P,uw as F,vd as I,xd as L,yd as R,zd as ae}from"./dist-ws-D-Lv-.js";import{t as z}from"./button-DuXPa4Vl.js";import{J as B,M as V,O as H,h as U,j as W,m as G,xt as K}from"./index-Bp-uQn4K.js";import{t as q}from"./roleDescriptions-KrB9-er6.js";var J=t(e(),1),Y=n(),X=[{group:()=>N(),keys:[{key:`traces.read`,label:()=>m()},{key:`traces.read.content`,label:()=>S(),phi:!0},{key:`traces.write`,label:()=>b()}]},{group:()=>j(),keys:[{key:`kpi.read`,label:()=>m()},{key:`kpi.write`,label:()=>b()}]},{group:()=>P(),keys:[{key:`openclaw.query`,label:()=>x()},{key:`anomalies.read`,label:()=>s()},{key:`anomalies.report`,label:()=>M()}]},{group:()=>w(),keys:[{key:`chats.read`,label:()=>m()},{key:`selfheal`,label:()=>o()}]},{group:()=>r(),keys:[{key:`admin.manage`,label:()=>c()}]}],oe=X.flatMap(e=>e.keys.map(e=>e.key));function Z(e){return e.includes(`*`)}var Q={key:``,name:``,description:``};function $(){let e=ie(F.apiKeys.listRoles,{}),t=E(F.apiKeys.createRole),n=E(F.apiKeys.ensureRolesSeeded),r=E(F.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(F.apiKeys.listRoles,{});r&&e.setQuery(F.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),o=V(),s=W(),[c,m]=(0,J.useState)(!1),[b,x]=(0,J.useState)(Q),[S,w]=(0,J.useState)(new Set);(0,J.useEffect)(()=>{n({}).catch(e=>{s.error(_(),e)})},[n,s]);let j=e??[];async function M(e,t){if(Z(e.permissions)||S.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await o({title:te({name:e.name}),description:v(),confirmLabel:ee()}))){w(t=>new Set(t).add(e._id));try{await r({roleId:e._id,permissions:n})}catch(e){s.error(ae(),e)}finally{w(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function N(){try{await t({key:b.key,name:b.name,description:b.description||void 0,permissions:[]}),x(Q),m(!1)}catch(e){s.error(h(),e)}}let P=e===void 0,$=!P&&j.length===0;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[l(),` `,(0,Y.jsx)(`code`,{children:`admin`}),` `,ne(),` `,(0,Y.jsx)(`code`,{children:`traces.read.content`}),` `,a()]}),(0,Y.jsxs)(`div`,{className:`oc-dt`,children:[(0,Y.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,Y.jsx)(`h2`,{className:`oc-dt__title`,children:p()}),(0,Y.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,Y.jsx)(z,{size:`sm`,onClick:()=>{x(Q),m(!0)},children:d()})})]}),P?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):$?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:O()}):(0,Y.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,Y.jsxs)(`table`,{className:`oc-matrix`,children:[(0,Y.jsxs)(`thead`,{children:[(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:i()}),X.map(e=>(0,Y.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,Y.jsx)(`tr`,{children:X.flatMap(e=>e.keys.map(e=>(0,Y.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?y({key:e.key}):e.key,children:[e.label(),e.phi?(0,Y.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,Y.jsx)(`tbody`,{children:j.map(e=>{let t=Z(e.permissions),n=S.has(e._id);return(0,Y.jsxs)(`tr`,{children:[(0,Y.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,Y.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,Y.jsx)(`span`,{children:e.name}),(0,Y.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,Y.jsxs)(G,{variant:`outline`,className:`gap-1`,children:[(0,Y.jsx)(K,{}),` `,k()]}):(0,Y.jsx)(G,{variant:`secondary`,children:f()})]}),q(e)?(0,Y.jsx)(`p`,{className:`oc-matrix__roledesc`,children:q(e)}):null]}),oe.map(r=>(0,Y.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,Y.jsx)(H,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?g():n?L():r,onCheckedChange:()=>void M(e,r)})},r))]},e.key)})})]})})]}),(0,Y.jsx)(U,{open:c,onOpenChange:m,title:C(),description:R(),canSubmit:!!(b.key&&b.name),onSubmit:N,submitLabel:I(),children:(0,Y.jsxs)(`div`,{className:`oc-form`,children:[(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:re()}),(0,Y.jsx)(B,{value:b.key,placeholder:T(),onChange:e=>x({...b,key:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:D()}),(0,Y.jsx)(B,{value:b.name,onChange:e=>x({...b,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:A()}),(0,Y.jsx)(B,{value:b.description,onChange:e=>x({...b,description:e.target.value})})]})]})})]})}export{$ as RolesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$y as r,Ay as i,By as ee,Cb as a,Cy as o,Db as te,Dy as s,Eb as ne,Ey as c,Fy as re,Gy as ie,Hy as ae,Iy as oe,Jy as se,Ky as ce,Ly as le,My as l,Ny as ue,Ob as de,Oy as u,Py as fe,Qy as pe,Ry as me,Sb as he,Sy as d,Tb as ge,Ty as f,Uy as _e,Vy as ve,Wy as ye,Xy as be,Yy as xe,Zy as Se,_b as Ce,_w as p,_y as we,ab as Te,bb as Ee,by as m,cb as De,db as Oe,dy as ke,eb as Ae,fb as je,fy as h,gb as Me,gw as g,gy as _,hb as Ne,hy as v,ib as Pe,jy as y,kb as Fe,ky as b,lb as Ie,ly as x,mb as Le,mw as Re,my as S,nb as ze,ob as Be,pb as Ve,py as C,qy as He,rb as Ue,sb as We,tb as Ge,ub as Ke,uw as w,uy as T,vb as qe,vy as E,wb as D,wy as O,xb as Je,xy as k,yb as Ye,yy as A,zy as Xe}from"./dist-ws-D-Lv-.js";import{n as j}from"./dist-DjXzB84V.js";import{i as Ze}from"./dist-ZW9rNZ8M.js";import{t as M}from"./button-DuXPa4Vl.js";import{C as N,Dt as Qe,F as P,I as F,J as I,L,M as $e,Ot as et,P as R,R as z,S as B,Tt as V,b as H,h as tt,j as nt,kt as rt,m as U,x as W,y as G,z as K}from"./index-Bp-uQn4K.js";import{t as it}from"./FilterBar-BmFEn3qs.js";import{t as at}from"./DataTableShell-B_P8ehdH.js";import{t as ot}from"./roleDescriptions-KrB9-er6.js";var q=t(e(),1),J=n(),st=[{value:`never`,label:()=>v(),days:null},{value:`30`,label:()=>S(),days:30},{value:`90`,label:()=>C(),days:90}],ct=720*60*60*1e3,Y=`__all__`,X={name:``,roleKey:``,description:``};function Z(){let e=rt({from:`/settings/serviceAccounts`}),t=et({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??Y,[o,s]=(0,q.useState)(Y),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,status:e===Y?void 0:e})}),u=p(w.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===Y?void 0:o,disabled:i===Y?void 0:i===`disabled`}}),d=p(w.apiKeys.listKeys,{}),f=p(w.apiKeys.listRoles,{}),we=g(w.apiKeys.createServiceAccount),m=g(w.apiKeys.updateServiceAccount),ke=g(w.apiKeys.deleteServiceAccount),h=Re(w.apiKeys.mintApiKey),_=g(w.apiKeys.revokeApiKey),v=$e(),y=nt(),b=n!==``||o!==Y||i!==Y;function x(){s(Y),t({search:{},replace:!0})}let[S,C]=(0,q.useState)(!1),[T,E]=(0,q.useState)(X),[O,k]=(0,q.useState)(null),[A,j]=(0,q.useState)(new Set),[P,F]=(0,q.useState)(null),L=(0,q.useRef)(!1),[R,z]=(0,q.useState)(new Set),[V,K]=(0,q.useState)({}),[ct,Z]=(0,q.useState)(null),Q=(0,q.useMemo)(()=>{let e=new Map;for(let t of d??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[d]);function $(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{O?(await m({serviceAccountId:O,name:T.name,roleKey:T.roleKey,description:T.description}),y.success(He())):await we({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(X),k(null),C(!1)}catch(e){y.error(O?se():xe(),e)}}function ft(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),k(e._id),C(!0)}async function pt(e){if(L.current)return;L.current=!0;let t=V[e._id]??`never`,n=st.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;F(e._id);try{let t=await h({serviceAccountId:e._id,expiresAt:r});Z({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(ce(),e)}finally{L.current=!1,F(null)}}async function mt(e){if(await v({title:ie(),description:(0,J.jsxs)(J.Fragment,{children:[ye(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,_e(),` `,(0,J.jsx)(`strong`,{children:ae()}),` `,ve()]}),confirmWord:e.name,confirmLabel:ee(),destructive:!0}))try{await ke({serviceAccountId:e._id}),y.success(Xe(),e.name)}catch(e){y.error(me(),e)}}async function ht(e){if(await v({title:le(),description:(0,J.jsxs)(J.Fragment,{children:[oe(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,re()]}),confirmLabel:fe(),destructive:!0})&&!R.has(e._id)){z(t=>new Set(t).add(e._id));try{await _({keyId:e._id})}catch(e){y.error(ue(),e)}finally{z(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}),(0,J.jsxs)(it,{q:n,onQChange:c,searchPlaceholder:de(),onReset:x,canReset:b,children:[(0,J.jsxs)(G,{value:o,onValueChange:s,children:[(0,J.jsx)(B,{size:`sm`,className:`w-40`,children:(0,J.jsx)(N,{placeholder:te()})}),(0,J.jsxs)(H,{children:[(0,J.jsx)(W,{value:Y,children:ne()}),(f??[]).map(e=>(0,J.jsx)(W,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(G,{value:i,onValueChange:l,children:[(0,J.jsx)(B,{size:`sm`,className:`w-36`,children:(0,J.jsx)(N,{})}),(0,J.jsxs)(H,{children:[(0,J.jsx)(W,{value:Y,children:ge()}),(0,J.jsx)(W,{value:`active`,children:D()}),(0,J.jsx)(W,{value:`disabled`,children:a()})]})]})]}),(0,J.jsx)(at,{title:he(),rows:u,addLabel:Je(),onAdd:()=>{E(X),k(null),C(!0)},emptyHint:Ee(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,J.jsx)(lt,{account:e,keys:Q.get(e._id)??[],onRevoke:ht,revoking:R}),rowActions:e=>[{label:Me(),onSelect:()=>ft(e)},{label:Ye(),onSelect:()=>void pt(e)},{label:A.has(e._id)?qe():Ce(),onSelect:()=>$(e._id)},{label:Ne(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?Le():Ve(),onClick:()=>$(e._id),children:A.has(e._id)?(0,J.jsx)(Ze,{}):(0,J.jsx)(Qe,{})})},{header:je(),sort:e=>e.name,cell:e=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{children:e.name}),e.description?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Oe(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(U,{variant:`secondary`,children:e.roleKey})},{header:Ke(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(U,{variant:`destructive`,children:a()}):(0,J.jsx)(U,{variant:`outline`,children:D()})},{header:Ie(),cell:e=>(0,J.jsxs)(G,{value:V[e._id]??`never`,onValueChange:t=>K(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(B,{size:`sm`,className:`w-32`,children:(0,J.jsx)(N,{})}),(0,J.jsx)(H,{children:st.map(e=>(0,J.jsx)(W,{value:e.value,children:e.label()},e.value))})]})},{header:De(),sort:e=>(Q.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Q.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,J.jsx)(`span`,{className:`oc-sa__keycount`,children:P===e._id?We():Be({count:t})})}}]}),(0,J.jsx)(tt,{open:S,onOpenChange:e=>{C(e),e||k(null)},title:O?Te():ze(),description:O?Pe():Ge(),canSubmit:!!(T.name&&T.roleKey),onSubmit:dt,submitLabel:O?Ue():Ae(),children:(0,J.jsxs)(`div`,{className:`oc-form`,children:[(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:r()}),(0,J.jsx)(I,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:pe()}),(0,J.jsxs)(G,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,J.jsx)(B,{className:`w-full`,children:(0,J.jsx)(N,{placeholder:Se()})}),(0,J.jsx)(H,{children:(f??[]).map(e=>(0,J.jsxs)(W,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(f??[]).find(e=>e.key===T.roleKey),t=e?ot(e):null;return t?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:be()}),(0,J.jsx)(I,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,J.jsx)(ut,{minted:ct,onClose:()=>Z(null)})]})}function lt({account:e,keys:t,onRevoke:n,revoking:r}){return(0,J.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,J.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[l(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:i()}),(0,J.jsx)(`th`,{children:b()}),(0,J.jsx)(`th`,{children:u()}),(0,J.jsx)(`th`,{children:s()}),(0,J.jsx)(`th`,{children:c()}),(0,J.jsx)(`th`,{children:f()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(U,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:Q(t.createdAt)}),(0,J.jsx)(`td`,{className:$(t.lastUsedAt)?`oc-sa__stale`:``,children:dt(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:ft(t.expiresAt)}),(0,J.jsx)(`td`,{children:pt(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,J.jsx)(M,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?O():o()})})]},t._id))})]})]})}function ut({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(R,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(P,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(z,{children:[(0,J.jsx)(K,{children:d()}),(0,J.jsx)(F,{children:k({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:m()}),(0,J.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,J.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,J.jsxs)(M,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":A(),children:[n?(0,J.jsx)(j,{}):(0,J.jsx)(V,{}),n?E():we()]})]}),(0,J.jsx)(L,{children:(0,J.jsx)(M,{onClick:()=>{r(!1),t()},children:_()})})]}):null})}function Q(e){return new Date(e).toLocaleString(`fr-FR`)}function $(e){return e===null?!1:Date.now()-e>ct}function dt(e){return e===null?h():new Date(e).toLocaleString(`fr-FR`)}function ft(e){return e===null?`—`:new Date(e).toLocaleDateString(`fr-FR`)}function pt(e){return e.disabled?(0,J.jsx)(U,{variant:`destructive`,children:ke()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(U,{variant:`outline`,children:T()}):(0,J.jsx)(U,{variant:`outline`,children:x()})}export{Z as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$x as r,AS as i,Ax as a,Bx as o,CS as s,Cx as c,DS as l,Dx as u,ES as d,Ex as f,FC as p,Fx as m,Gx as h,Hx as g,Ix as ee,Jx as te,Kx as ne,Lx as re,MS as ie,Mx as ae,NC as oe,Nx as se,OS as ce,Ox as le,PC as ue,Px as de,Qx as fe,Rx as pe,SS as _,Sx as me,TS as he,Tx as ge,Ux as _e,Vx as ve,Wx as ye,Xx as be,Yx as v,Zx as xe,_C as Se,_S as Ce,_w as y,_x as we,aS as Te,bS as Ee,bx as De,cS as Oe,dS as ke,dw as Ae,dx as je,eS as Me,fS as Ne,fx as Pe,gS as Fe,gw as b,gx as Ie,hS as Le,hx as Re,iS as ze,jS as Be,jx as Ve,kS as He,kx as Ue,lS as We,mS as Ge,mw as Ke,mx as x,n as qe,nS as Je,oS as Ye,pS as Xe,px as Ze,qx as Qe,rS as $e,sS as et,tS as tt,uS as nt,uw as S,ux as rt,vC as it,vS as at,vx as C,wS as ot,wx as st,xS as ct,xx as lt,yS as ut,yx as dt,zx as ft}from"./dist-ws-D-Lv-.js";import{n as w}from"./dist-DjXzB84V.js";import{t as pt}from"./TimeRangePicker-BDN2rIcO.js";import{t as T}from"./x-D96nOW2m.js";import{t as E}from"./button-DuXPa4Vl.js";import{$ as mt,C as D,Ct as O,J as k,O as A,Q as ht,S as j,at as gt,b as M,et as N,it as _t,m as P,nt as F,ot as I,rt as vt,tt as yt,x as L,y as R}from"./index-Bp-uQn4K.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-CWLBezSK.js";import{a as Et,i as z,n as Dt,o as B,r as V,t as Ot}from"./table-CoglL6L8.js";import{t as kt}from"./FilterBar-BmFEn3qs.js";import{t as At}from"./AdvancedFilter-0hIaeD_5.js";var H=Ae(`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`}]]),U=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 W(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(se());if(e.size>Rt)throw Error(ae());let{source:n,width:r,height:i,cleanup:o}=await Ut(e);try{let o=e.type===`image/svg+xml`,s=Math.min(zt/r,Bt/i,o?1/0:1),c=Math.max(1,Math.round(r*s)),l=Math.max(1,Math.round(i*s)),u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)throw Error(a());d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(n,0,0,c,l);let f=Pt(d.getImageData(0,0,c,l).data,c,l)??{x:0,y:0,width:c,height:l},p=document.createElement(`canvas`);p.width=f.width,p.height=f.height;let m=p.getContext(`2d`);if(!m)throw Error(a());if(m.drawImage(u,f.x,f.y,f.width,f.height,0,0,f.width,f.height),t.variantFor){let e=m.getImageData(0,0,f.width,f.height);W(e.data,f.width,f.height)?It(e.data,t.variantFor===`dark`?Mt:Nt):Lt(e.data),m.putImageData(e,0,0)}let h=W(m.getImageData(0,0,f.width,f.height).data,f.width,f.height),g=await K(p,`image/webp`,Vt)??await K(p,`image/png`);if(!g)throw Error(Ue());return{blob:g,hasAlpha:h}}finally{o()}}async function Ut(e){if(e.type===`image/svg+xml`)return G(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 G(e)}async function G(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(Ve())),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 K(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var q=n(),J=`__all__`,Y={kind:`relative`,from:`now-24h`,to:`now`},X=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Z({title:e,description:t,children:n}){return(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,q.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,q.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Wt(e){return e===`light`?p():e===`dark`?ue():oe()}var Gt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Kt({tokens:e,mode:t}){let n=e.colors[t];return(0,q.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Gt.map(e=>{let t=n[e];return(0,q.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Q({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a}){return(0,q.jsxs)(`button`,{type:`button`,className:qe(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,q.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,q.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,q.jsx)(w,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,q.jsx)(Kt,{tokens:r,mode:i}):(0,q.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,q.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,q.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]})}function qt({selectedKey:e,resolvedMode:t}){let n=y(S.charts.listMyCharts),r=b(S.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h2`,{className:`oc-show__title`,children:ot()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:s()})]}),(0,q.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,q.jsx)(Q,{selected:e===null,title:_(),subtitle:ct(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?Ee():n.via===`owner`?ut():at({group:n.via.group});return(0,q.jsx)(Q,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key)},n.key)})]}),n!==void 0&&n.length===0?(0,q.jsx)(`p`,{className:`oc-show__desc`,children:Ce()}):null]})}function Jt(){let e=b(S.charts.importChart),[t,n]=(0,U.useState)(``),[i,a]=(0,U.useState)(``),[o,s]=(0,U.useState)(null),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.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(v())}}}async function p(){if(s(null),l(!1),t.trim()===``){s(Qe());return}let r;try{r=JSON.parse(i)}catch{s(v());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,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h2`,{className:`oc-show__title`,children:$e()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:Je()})]}),(0,q.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,q.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,q.jsx)(`span`,{className:`oc-chart-import__label`,children:tt()}),(0,q.jsx)(k,{value:t,onChange:e=>n(e.target.value),placeholder:Me(),maxLength:60})]}),(0,q.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,q.jsx)(`span`,{className:`oc-chart-import__label`,children:r()}),(0,q.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:i,onChange:e=>a(e.target.value),placeholder:fe(),rows:8,spellCheck:!1})]}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(E,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,q.jsx)(H,{className:`size-4`}),xe(),(0,q.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void f(e)})]})}),(0,q.jsx)(E,{size:`sm`,disabled:u,onClick:()=>void p(),children:be()})]}),o?(0,q.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,q.jsx)(`p`,{className:`oc-chart-import__ok`,children:te()}):null]})]})}function Yt({chart:e}){let t=Ke(S.charts.setChartLogo),n=b(S.charts.removeChartLogo),[r,i]=(0,U.useState)(!1),[a,s]=(0,U.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,q.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,q.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?o():ft()}),(0,q.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,q.jsx)(`img`,{src:t,alt:``}):null}),(0,q.jsx)(E,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,q.jsx)(H,{className:`size-4`}),t?re():pe(),(0,q.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,q.jsx)(E,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:m()}):null,t?(0,q.jsx)(E,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:ee()}):null]})}return(0,q.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,q.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ve()}),(0,q.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,q.jsx)(p,{mode:`light`}),(0,q.jsx)(p,{mode:`dark`})]}),r?(0,q.jsx)(`span`,{className:`oc-show__desc`,children:de()}):null,a?(0,q.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function $({chart:e}){let t=y(S.me.getMe,{host:I}),n=b(S.charts.addChartDomain),r=b(S.charts.removeChartDomain),[i,a]=(0,U.useState)(``),[o,s]=(0,U.useState)(null),[l,d]=(0,U.useState)(!1);if(t?.role!==`admin`)return null;let p=e.domains??[];async function m(){let t=i.trim();if(t!==``){s(null),d(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{d(!1)}}}async function h(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,q.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,q.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:le()}),(0,q.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,q.jsx)(`div`,{className:`oc-chart-avail__groups`,children:p.length===0?(0,q.jsx)(`span`,{className:`oc-show__desc`,children:st()}):p.map(e=>(0,q.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,q.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":c({domain:e}),onClick:()=>void h(e),children:(0,q.jsx)(T,{className:`size-3`})})]},e))}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(k,{value:i,onChange:e=>a(e.target.value),placeholder:f(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&m()}}),(0,q.jsx)(E,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void m(),children:ge()})]}),(0,q.jsx)(`span`,{className:`oc-show__desc`,children:u()}),o?(0,q.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function Xt({chart:e}){let t=b(S.charts.updateChart),n=b(S.charts.deleteChart),[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(e.name),[s,c]=(0,U.useState)(()=>JSON.stringify(e.tokens,null,2)),[l,u]=(0,U.useState)(null),[d,f]=(0,U.useState)(!1);function p(){o(e.name),c(JSON.stringify(e.tokens,null,2)),u(null),i(!0)}async function m(){if(e.chartId===void 0)return;u(null);let n;try{n=JSON.parse(s)}catch{u(v());return}f(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){u(e instanceof Error?e.message:String(e))}finally{f(!1)}}async function h(){if(e.chartId!==void 0&&window.confirm(C()))try{await n({chartId:e.chartId})}catch{}}return(0,q.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,q.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,q.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,q.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(E,{variant:`outline`,size:`sm`,onClick:p,children:_e()}),(0,q.jsx)(E,{variant:`ghost`,size:`sm`,onClick:()=>void h(),children:g()})]})})]}),r?(0,q.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,q.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,q.jsx)(`span`,{className:`oc-chart-import__label`,children:De()}),(0,q.jsx)(k,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,q.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,q.jsx)(`span`,{className:`oc-chart-import__label`,children:dt()}),(0,q.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),l?(0,q.jsx)(`p`,{className:`oc-chart-import__error`,children:l}):null,(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(E,{size:`sm`,disabled:d,onClick:()=>void m(),children:me()}),(0,q.jsx)(E,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:lt()})]})]}):null,(0,q.jsx)(Yt,{chart:e}),(0,q.jsx)($,{chart:e})]})}function Zt(){let e=y(S.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h2`,{className:`oc-show__title`,children:ne()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:h()})]}),e!==void 0&&t.length===0?(0,q.jsx)(`p`,{className:`oc-show__desc`,children:ye()}):(0,q.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,q.jsx)(Xt,{chart:e},e.key))})]})}function Qt({chart:e,groups:t}){let n=b(S.charts.addChartToGroupPool),r=b(S.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,q.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,q.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,q.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,q.jsx)(P,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?We():e.kind===`custom`&&e.scope===`personal`?x():nt()}),e.isGlobalDefault?(0,q.jsx)(P,{variant:`default`,children:Oe()}):null]}),(0,q.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,q.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ye()}),(a??[]).map(e=>(0,q.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,q.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ze({group:e.name}),onClick:()=>void l(e.groupId),children:(0,q.jsx)(T,{className:`size-3`})})]},e.groupId)),s.length>0?(0,q.jsxs)(R,{value:``,onValueChange:e=>void c(e),children:[(0,q.jsx)(j,{size:`sm`,className:`w-56`,children:(0,q.jsx)(D,{placeholder:Te()})}),(0,q.jsx)(M,{children:s.map(e=>(0,q.jsx)(L,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,q.jsx)(`span`,{className:`oc-show__desc`,children:et()}):null]})]})}function $t({chart:e}){let t=b(S.charts.promoteChartToCommon),n=b(S.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(C()))try{await n({chartId:e.chartId})}catch{}}return(0,q.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,q.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,q.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,q.jsx)(P,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Ze():x()}),e.ownerLabel?(0,q.jsx)(`span`,{className:`oc-show__desc`,children:Re({owner:e.ownerLabel})}):null]}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,q.jsx)(E,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Pe()}):null,(0,q.jsx)(E,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:je()})]})]})}function en({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=b(S.admin.setDefaultThemeMode),a=b(S.admin.setDefaultLocale),o=b(S.charts.setDefaultChart),s=y(S.charts.listChartsAdmin),c=y(S.groups.listGroups,{}),l=e??`system`,u=t??`fr`;return(0,q.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h2`,{className:`oc-show__title`,children:d()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:he()})]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:Fe()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:Le()})]}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(E,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:_()}),gt.map(e=>(0,q.jsx)(E,{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,q.jsx)(E,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key))]})]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:Ge()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:Xe()})]}),(0,q.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,q.jsx)(Qt,{chart:e,groups:c??[]},e.key))})]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:Ne()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:ke()})]}),(0,q.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,q.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,q.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,q.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,q.jsx)($,{chart:e})]},e.key))})]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:we()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:Ie()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,q.jsx)(`p`,{className:`oc-show__desc`,children:rt()}):(0,q.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,q.jsx)($t,{chart:e},e.key))})})()]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:ie()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:Be()})]}),(0,q.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,q.jsx)(E,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Wt(e)},e))})]}),(0,q.jsxs)(`section`,{className:`oc-show__section`,children:[(0,q.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,q.jsx)(`h3`,{className:`oc-show__title`,children:i()}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:He()})]}),(0,q.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,q.jsx)(E,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e}),children:e===`fr`?it():Se()},e))}),(0,q.jsx)(`p`,{className:`oc-show__desc`,children:ce()})]})]})}function tn(){let e=y(S.me.getMe,{host:I}),t=_t(e?.resolvedThemeMode);return(0,q.jsxs)(`div`,{className:`oc-appearance`,children:[(0,q.jsx)(qt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,q.jsx)(Jt,{}),(0,q.jsx)(Zt,{}),e?.role===`admin`?(0,q.jsx)(en,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function nn(){let[e,t]=(0,U.useState)(!0),[n,r]=(0,U.useState)(`per-user`),[i,a]=(0,U.useState)(``),[o,s]=(0,U.useState)(J),[c,u]=(0,U.useState)(J),[d,f]=(0,U.useState)(Y),p=i!==``||o!==J||c!==J;function m(){a(``),s(J),u(J),f(Y)}return(0,q.jsxs)(`div`,{className:`oc-show`,children:[(0,q.jsx)(tn,{}),(0,q.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,q.jsx)(`summary`,{className:`oc-show__title`,children:l()}),(0,q.jsxs)(Z,{title:`Buttons`,description:`Variants`,children:[(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(E,{children:`Default`}),(0,q.jsx)(E,{variant:`secondary`,children:`Secondary`}),(0,q.jsx)(E,{variant:`outline`,children:`Outline`}),(0,q.jsx)(E,{variant:`ghost`,children:`Ghost`}),(0,q.jsx)(E,{variant:`destructive`,children:`Destructive`}),(0,q.jsx)(E,{variant:`link`,children:`Link`})]}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(E,{size:`sm`,children:`Small`}),(0,q.jsx)(E,{children:`Default`}),(0,q.jsx)(E,{size:`lg`,children:`Large`}),(0,q.jsx)(E,{size:`icon`,"aria-label":`more`,children:(0,q.jsx)(O,{})}),(0,q.jsx)(E,{disabled:!0,children:`Disabled`})]})]}),(0,q.jsx)(Z,{title:`Badges`,children:(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(P,{children:`Default`}),(0,q.jsx)(P,{variant:`secondary`,children:`Secondary`}),(0,q.jsx)(P,{variant:`outline`,children:`Outline`}),(0,q.jsx)(P,{variant:`destructive`,children:`Destructive`})]})}),(0,q.jsx)(Z,{title:`Inputs & selection`,children:(0,q.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,q.jsx)(k,{placeholder:`Text input…`}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsxs)(R,{value:n,onValueChange:r,children:[(0,q.jsx)(j,{className:`w-56`,children:(0,q.jsx)(D,{placeholder:`Select…`})}),(0,q.jsxs)(M,{children:[(0,q.jsx)(L,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,q.jsx)(L,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,q.jsxs)(`label`,{className:`oc-show__check`,children:[(0,q.jsx)(A,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,q.jsx)(Z,{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,q.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,q.jsxs)(kt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:d,onTimeRangeChange:f,onReset:m,canReset:p,children:[(0,q.jsxs)(R,{value:o,onValueChange:s,children:[(0,q.jsx)(j,{size:`sm`,children:(0,q.jsx)(D,{})}),(0,q.jsxs)(M,{children:[(0,q.jsx)(L,{value:J,children:`Toutes directions`}),(0,q.jsx)(L,{value:`inbound`,children:`inbound`}),(0,q.jsx)(L,{value:`outbound`,children:`outbound`}),(0,q.jsx)(L,{value:`internal`,children:`internal`})]})]}),(0,q.jsxs)(R,{value:c,onValueChange:u,children:[(0,q.jsx)(j,{size:`sm`,children:(0,q.jsx)(D,{})}),(0,q.jsxs)(M,{children:[(0,q.jsx)(L,{value:J,children:`Toutes sévérités`}),(0,q.jsx)(L,{value:`info`,children:`info`}),(0,q.jsx)(L,{value:`warn`,children:`warn`}),(0,q.jsx)(L,{value:`critical`,children:`critical`})]})]})]}),(0,q.jsx)(At,{fields:X,onChange:()=>{}}),(0,q.jsxs)(`div`,{className:`oc-show__row`,children:[(0,q.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,q.jsx)(pt,{value:d,onChange:f})]})]})}),(0,q.jsx)(Z,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,q.jsxs)(ht,{children:[(0,q.jsx)(vt,{asChild:!0,children:(0,q.jsx)(E,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,q.jsx)(O,{})})}),(0,q.jsxs)(mt,{align:`start`,children:[(0,q.jsx)(yt,{children:`Actions`}),(0,q.jsx)(F,{}),(0,q.jsx)(N,{children:`Edit`}),(0,q.jsx)(N,{children:`Duplicate`}),(0,q.jsx)(F,{}),(0,q.jsx)(N,{variant:`destructive`,children:`Delete`})]})]})}),(0,q.jsx)(Z,{title:`Card`,children:(0,q.jsxs)(Tt,{className:`w-80`,children:[(0,q.jsxs)(bt,{children:[(0,q.jsx)(Ct,{children:`Instance`}),(0,q.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,q.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,q.jsxs)(xt,{className:`gap-2`,children:[(0,q.jsx)(E,{size:`sm`,children:`Save`}),(0,q.jsx)(E,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,q.jsx)(Z,{title:`Table`,children:(0,q.jsxs)(Ot,{children:[(0,q.jsx)(Et,{children:(0,q.jsxs)(B,{children:[(0,q.jsx)(z,{className:`w-8`,children:(0,q.jsx)(A,{"aria-label":`select all`})}),(0,q.jsx)(z,{children:`Name`}),(0,q.jsx)(z,{children:`Mode`}),(0,q.jsx)(z,{className:`text-right`,children:`Status`}),(0,q.jsx)(z,{className:`w-8`})]})}),(0,q.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,q.jsxs)(B,{children:[(0,q.jsx)(V,{children:(0,q.jsx)(A,{"aria-label":`select ${e.n}`})}),(0,q.jsx)(V,{className:`font-medium`,children:e.n}),(0,q.jsx)(V,{children:(0,q.jsx)(P,{variant:`secondary`,children:e.m})}),(0,q.jsx)(V,{className:`text-right`,children:(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,q.jsx)(w,{className:`size-3.5`}),` `,e.s]})}),(0,q.jsx)(V,{children:(0,q.jsx)(E,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,q.jsx)(O,{})})})]},e.n))})]})}),(0,q.jsx)(Z,{title:`App fragments`,description:`Chat-specific components`,children:(0,q.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,q.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,q.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,q.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,q.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,q.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,q.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,q.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,q.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,q.jsx)(`span`,{className:`oc-run-status__dot`}),(0,q.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{nn as ThemeShowroom};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$o as r,Go as i,Jo as a,Ko as o,Qo as s,Xo as c,Yo as l,Zo as u,dw as d,es as f,ns as p,qo as m,ts as h}from"./dist-ws-D-Lv-.js";import{t as g}from"./button-DuXPa4Vl.js";import{J as _,ct as v,lt as y,st as b,ut as x,vt as S}from"./index-Bp-uQn4K.js";var C=d(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),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:p(),from:`now-5m`},{label:h(),from:`now-15m`},{label:f(),from:`now-30m`},{label:r(),from:`now-1h`},{label:s(),from:`now-3h`},{label:u(),from:`now-6h`},{label:c(),from:`now-12h`},{label:l(),from:`now-24h`},{label:a(),from:`now-2d`},{label:m(),from:`now-7d`},{label:o(),from:`now-30d`},{label:i(),from:`now-90d`}];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)(y,{open:n,onOpenChange:d,children:[(0,P.jsx)(x,{asChild:!0,children:(0,P.jsxs)(g,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,P.jsx)(C,{}),A(e)]})}),(0,P.jsx)(v,{children:(0,P.jsx)(b,{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)(_,{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)(_,{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)(S,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,P.jsx)(_,{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 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$g as r,Al as i,Bl as a,Cl as o,Dl as s,El as c,Fl as l,Gg as u,Gl as d,Hg as f,Hl as p,Il as m,Jg as h,Jl as g,Kg as _,Kl as v,Ll as ee,Ml as te,Nl as ne,Ol as re,Pl as ie,Qg as y,Rl as ae,Sl as oe,Tl as se,Ug as b,Ul as ce,Vg as x,Vl as le,Wg as ue,Wl as de,Xg as fe,Xl as pe,Yg as S,Yl as me,Zg as C,Zl as he,_l as ge,_w as w,a_ as T,bl as _e,c_ as E,d_ as D,e_ as O,f_ as k,gl as ve,gw as A,hl as j,i_ as M,jl as ye,kl as be,l_ as N,ml as P,n_ as F,o_ as I,pl as L,qg as R,ql as xe,r_ as z,s_ as Se,t_ as Ce,u_ as we,uw as B,vl as Te,wl as Ee,xl as De,yl as Oe,zl as ke}from"./dist-ws-D-Lv-.js";import{n as Ae}from"./dist-DjXzB84V.js";import{n as je}from"./TimeRangePicker-BDN2rIcO.js";import{t as Me}from"./x-D96nOW2m.js";import{t as V}from"./button-DuXPa4Vl.js";import{A as Ne,C as H,F as Pe,I as Fe,Ot as Ie,P as Le,R as Re,S as U,Tt as ze,a as Be,b as W,i as Ve,kt as He,m as G,o as Ue,ot as We,r as Ge,x as K,y as q,z as Ke}from"./index-Bp-uQn4K.js";import{t as qe}from"./FilterBar-BmFEn3qs.js";import{t as Je}from"./AdvancedFilter-0hIaeD_5.js";import{t as Ye}from"./DataTableShell-B_P8ehdH.js";var J=t(e(),1),Y=n(),X=e=>e===null?`—`:String(Math.round(e));function Xe(){let e=w(B.me.getMe,{host:We})?.role===`admin`,t=w(B.deliveryTiming.getDeliveryStatus,{}),n=A(B.deliveryTiming.startDeliveryRecord),r=A(B.deliveryTiming.stopDeliveryRecord),i=A(B.deliveryTiming.deleteDeliverySessions),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)(new Set),[d,f]=(0,J.useState)(!1),[p,m]=(0,J.useState)(!1),h=w(B.deliveryTiming.listDeliverySessions,a?{}:`skip`),g=w(B.deliveryTiming.getDeliveryReport,a?{sessionId:s??void 0}:`skip`),v=t?.recording??!1,ee=async()=>{f(!0);try{v?await r({}):await n({})}finally{f(!1)}},te=()=>{g&&navigator.clipboard?.writeText(Ne(g)).then(()=>{m(!0),window.setTimeout(()=>m(!1),1200)}).catch(()=>{})},ne=e=>u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),re=async()=>{let e=[...l];if(e.length!==0){f(!0);try{await i({sessionIds:e}),s!==null&&l.has(s)&&c(null),u(new Set)}finally{f(!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:k()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:D()})]}),e?(0,Y.jsx)(V,{variant:v?`destructive`:`default`,size:`sm`,disabled:d||t===void 0,onClick:()=>void ee(),children:v?N():we()}):null]}),v?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(G,{variant:`secondary`,children:E()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:Se({time:new Date(t.startedAt).toLocaleTimeString()})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(V,{variant:`outline`,size:`sm`,onClick:()=>o(e=>!e),children:a?T():I()})}),a?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ze,{sessions:h,selected:s,checked:l,isAdmin:e,onSelect:c,onToggleCheck:ne}),e&&l.size>0?(0,Y.jsx)(`div`,{children:(0,Y.jsx)(V,{variant:`destructive`,size:`sm`,disabled:d,onClick:()=>void re(),children:_({n:l.size})})}):null,(0,Y.jsx)(Qe,{report:g,copied:p,onCopy:te})]}):null]})}function Ze({sessions:e,selected:t,checked:n,isAdmin:r,onSelect:i,onToggleCheck:a}){return e?e.length===0?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:ue()}),(0,Y.jsx)(`ul`,{className:`flex flex-col`,children:e.map(e=>{let o=t===e.sessionId,s=new Date(e.startedAt).toLocaleString();return(0,Y.jsxs)(`li`,{className:`flex items-center gap-2 border-t border-border py-1 text-sm first:border-t-0`,children:[r?(0,Y.jsx)(`input`,{type:`checkbox`,"aria-label":`${b()} — ${s}`,checked:n.has(e.sessionId),onChange:()=>a(e.sessionId)}):null,(0,Y.jsx)(`button`,{type:`button`,"aria-pressed":o,className:`flex-1 truncate text-left ${o?`font-medium`:`text-muted-foreground`}`,onClick:()=>i(o?null:e.sessionId),children:s}),e.active?(0,Y.jsx)(G,{variant:`secondary`,children:f()}):null]},e.sessionId)})})]}):null}function Qe({report:e,copied:t,onCopy:n}){if(!e)return null;if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:M()});let i=e.segments,a=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,Y.jsxs)(Y.Fragment,{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,` `,x()]}),(0,Y.jsxs)(V,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ae,{size:13,"aria-hidden":!0}):(0,Y.jsx)(ze,{size:13,"aria-hidden":!0}),t?R():h()]})]}),(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:z()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:F()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ce()})]})}),(0,Y.jsxs)(`tbody`,{children:[a(O(),i.bridge),a(r(),i.A),a(y(),i.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:C()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:fe()})]})}var $e=[50,100,200,500],Z=`all`,Q=`__all__`,et=[`2xx`,`4xx`,`5xx`],tt=[`user`,`service`,`system`],nt=[`inbound`,`outbound`,`internal`],rt={kind:`relative`,from:`now-30d`,to:`now`},it=[{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 at(){let e=He({from:`/settings/traces`}),t=Ie({from:`/settings/traces`}),n=e.limit,r=e.kind,u=e.statusClass??Q,f=e.principalType??Q,h=e.direction??Q,_=e.roleKey??Q,y=e.q??``,b=Ge(e.from,e.to),x=(0,J.useMemo)(()=>Ue(e.adv),[e.adv]),{from:ue,to:fe}=je(b),[S,C]=(0,J.useState)(null),[T,E]=(0,J.useState)(null),D=e=>void t({search:t=>({...t,limit:e})}),O=e=>void t({search:t=>({...t,kind:e})}),k=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),A=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),j=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),M=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),N=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),P=e=>void t({search:t=>({...t,...Be(e)})}),F=e=>void t({search:t=>({...t,adv:Ve(e)}),replace:!0}),I=w(B.observability.listEvents,{limit:n}),L=w(B.observability.listEvents,{limit:n,kind:r===Z?void 0:r,filter:{q:y||void 0,from:ue,to:fe,statusClass:u===Q?void 0:u,principalType:f===Q?void 0:f,direction:h===Q?void 0:h,roleKey:_===Q?void 0:_,advanced:x.length>0?x:void 0}}),R=(0,J.useMemo)(()=>{let e=new Set;for(let t of I??[])e.add(t.kind);return[...e].sort()},[I]),z=(0,J.useMemo)(()=>{let e=new Set;for(let t of I??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[I]),Se=y!==``||u!==Q||f!==Q||h!==Q||_!==Q||x.length>0||b.kind!==`relative`||b.from!==rt.from;function Ce(){t({search:{limit:100,kind:`all`},replace:!0})}let we=S?I?.filter(e=>e.correlationId===S):L;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Xe,{}),(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[he(),(0,Y.jsx)(`strong`,{children:pe()}),me(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:g()})]}),(0,Y.jsxs)(qe,{q:y,onQChange:k,searchPlaceholder:xe(),timeRange:b,onTimeRangeChange:P,onReset:Ce,canReset:Se,children:[(0,Y.jsxs)(q,{value:u,onValueChange:A,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:v()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:d()}),et.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:f,onValueChange:j,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:de()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:ce()}),tt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:h,onValueChange:M,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:p()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:le()}),nt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:_,onValueChange:N,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(H,{placeholder:a()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:ke()}),z.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:r,onValueChange:O,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(H,{placeholder:ae()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Z,children:ee()}),R.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:String(n),onValueChange:e=>D(Number(e)),children:[(0,Y.jsx)(U,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(H,{})}),(0,Y.jsx)(W,{children:$e.map(e=>(0,Y.jsx)(K,{value:String(e),children:m({count:e})},e))})]})]}),(0,Y.jsx)(Je,{fields:it,seed:x,onChange:F}),S?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>C(null),title:l(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[ie(),(0,Y.jsx)(`code`,{children:$(S)})]}),(0,Y.jsx)(Me,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:ne()})]})}):null,(0,Y.jsx)(Ye,{title:te(),rows:we,emptyHint:S?ye():i(),columns:[{header:be(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:re(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(G,{variant:`secondary`,children:e.kind})},{header:s(),sort:e=>st(e)??null,cell:e=>{let t=st(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":c(),children:`✓`})}},{header:se(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(G,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Ee(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(G,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:o(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(G,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:oe(),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 ${ot(e.status)}`,children:e.status})},{header:_e(),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:Oe(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:Te(),onClick:()=>C(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ge(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(V,{variant:`outline`,size:`sm`,onClick:()=>E(e),children:ve()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(ct,{row:T,onClose:()=>E(null)})]})}function ot(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 st(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 ct({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)(Le,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(Pe,{className:`max-w-lg`,children:[(0,Y.jsxs)(Re,{children:[(0,Y.jsxs)(Ke,{className:`oc-traces__meta-title`,children:[j(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(G,{variant:`outline`,children:P()})]}),(0,Y.jsx)(Fe,{children:L()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{at as TracesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ac as r,Am as i,Bc as a,Cm as o,Dm as s,Em as c,Fc as l,Ic as u,Lc as d,Mc as f,Mm as p,Nc as m,Oc as h,Om as ee,Pc as g,Rc as _,Sm as v,Tm as te,_m as ne,_w as y,am as re,bm as b,cm as x,dm as S,fm as C,gm as w,gw as T,hm as ie,im as ae,jc as E,jm as D,kc as O,km as oe,lm as se,mm as ce,om as le,pm as ue,sm as de,um as fe,uw as k,vm as pe,wm as me,xm as he,ym as ge,zc as A,zp as j}from"./dist-ws-D-Lv-.js";import{t as M}from"./button-DuXPa4Vl.js";import{$ as N,C as P,F,I,M as L,N as _e,O as R,Ot as ve,P as z,Q as ye,R as be,S as B,_t as V,b as H,d as U,et as xe,f as Se,gt as W,j as G,kt as Ce,m as K,ot as we,p as q,rt as Te,tt as Ee,x as J,y as Y,z as De}from"./index-Bp-uQn4K.js";import{t as Oe}from"./FilterBar-BmFEn3qs.js";import{t as ke}from"./DataTableShell-B_P8ehdH.js";import{t as Ae}from"./DetailChips-DccwdoeS.js";var X=t(e(),1),Z=n();function je({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=y(k.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=y(k.agents.listUserAgents,n&&e?{profileId:e}:`skip`),s=new Set((o??[]).map(e=>`${e.instanceName}/${e.agentId}`)),c=(o??[]).find(e=>e.isDefault)??null,l=c?`${c.instanceName}/${c.agentId}`:null,f=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),p=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).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,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)(z,{open:n,onOpenChange:r,children:(0,Z.jsxs)(F,{className:`oc-access`,children:[(0,Z.jsxs)(be,{children:[(0,Z.jsx)(De,{children:a({user:t})}),(0,Z.jsx)(I,{children:A()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?_():d()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:u()}):p.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:m()}):[...h.entries()].map(([t,n])=>(0,Z.jsx)(Q,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:s,defaultKey:l},t))})]})})}function Q({profileId:e,instanceName:t,kind:n,agents:i,assigned:a,defaultKey:o}){let s=T(k.agents.assignAgent),c=T(k.agents.removeAgent),u=T(k.agents.setDefaultAgent),d=G();if(!e)return null;async function p(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await s({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(l(),e)}}async function m(n){try{await u({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(g(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(V,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n})]}),i.map(e=>{let n=`${t}/${e.agentId}`,i=a.has(n),s=o===n,c=e.state===`deleted`;return(0,Z.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Z.jsx)(R,{checked:i,disabled:c&&!i,onCheckedChange:()=>void p(e.agentId,i),"aria-label":f({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,c?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:E()}):null,e.outOfPool?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:r()}):null,i?s?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":O(),title:O(),children:(0,Z.jsx)(W,{size:14,fill:`currentColor`})}):(0,Z.jsx)(M,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":h(),title:h(),onClick:()=>void m(e.agentId),children:(0,Z.jsx)(W,{size:14})}):null]},e.agentId)})]})}var $=`__all__`;function Me({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)(Te,{asChild:!0,children:(0,Z.jsx)(M,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?p():D({count:r})})}),(0,Z.jsxs)(N,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(Ee,{children:i()}),U.map(e=>{let r=q[e];return(0,Z.jsxs)(xe,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(R,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Se[e]??e})]},e)})]})]})}function Ne(){let e=Ce({from:`/settings/users`}),t=ve({from:`/settings/users`}),n=e.q??``,r=e.role??$,i=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),a=e=>void t({search:t=>({...t,role:e===$?void 0:e})}),l=y(k.admin.listUsers,{filter:{q:n||void 0,role:r===$?void 0:r},withAgents:!0}),u=y(k.me.getMe,{host:we}),d=T(k.admin.setRole),f=T(k.admin.setUserPermissions),p=T(k.admin.startImpersonation),m=T(k.admin.deleteUser),h=T(k.admin.setUserName),g=L(),_=_e(),E=G(),[D,O]=(0,X.useState)(null),A=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of l??[])e.add(t.role);return[...e]},[l]),M=n!==``||r!==$;function N(){t({search:{},replace:!0})}async function F(e){try{await d(e)}catch(e){E.error(oe(),e)}}async function I(e){try{await f(e)}catch(e){E.error(ee(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await g({title:he(),description:b({user:t}),confirmWord:ge(),confirmLabel:pe(),destructive:!0}))try{await m({profileId:e._id}),E.success(w({user:t}))}catch(e){E.error(ne(),e)}}async function z(e){let t=e.email||e.name||e.userId.slice(0,8),n=await _({title:ce(),label:ue({user:t}),placeholder:C(),defaultValue:e.name??``,confirmLabel:j()});if(n!==null)try{await h({profileId:e._id,name:n}),E.success(S())}catch(e){E.error(fe(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Oe,{q:n,onQChange:i,searchPlaceholder:s(),onReset:N,canReset:M,children:(0,Z.jsxs)(Y,{value:r,onValueChange:a,children:[(0,Z.jsx)(B,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(P,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(J,{value:$,children:c()}),A.map(e=>(0,Z.jsx)(J,{value:e,children:e},e))]})]})}),(0,Z.jsx)(ke,{title:te(),rows:l,emptyHint:me(),rowActions:e=>{let t=[{label:ae(),onSelect:()=>O({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:ie(),onSelect:()=>void z(e)}];return e.userId!==u?.userId&&t.push({label:o(),onSelect:()=>void p({profileId:e._id})},{label:v(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:se(),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:x(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(Y,{value:e.role,onValueChange:t=>void F({profileId:e._id,role:t}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(P,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(J,{value:`pending`,children:`pending`}),(0,Z.jsx)(J,{value:`user`,children:`user`}),(0,Z.jsx)(J,{value:`admin`,children:`admin`})]})]})},{header:de(),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:le()}):(0,Z.jsx)(Me,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),I({profileId:e._id,permissions:[...n]})}})},{header:re(),cell:e=>(0,Z.jsx)(Ae,{icon:(0,Z.jsx)(V,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(je,{profileId:D?.profileId??null,userLabel:D?.label??``,open:D!==null,onOpenChange:e=>{e||O(null)}})]})}export{Ne as UsersTab};
@@ -1 +0,0 @@
1
- import{dw as e}from"./dist-ws-D-Lv-.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,5 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,GC as i,HC as a,JC as o,KC as s,QC as c,UC as l,WC as u,XC as d,YC as f,lw as p,nw as m,ow as ee,qC as h,rw as g}from"./dist-ws-D-Lv-.js";var _=t(e(),1),v=n(),y=`Dialog`,[b,x]=r(y),[S,C]=b(y),w=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=_.useRef(null),l=_.useRef(null),[u,f]=d({prop:r,defaultProp:i??!1,onChange:a,caller:y});return(0,v.jsx)(S,{scope:t,triggerRef:c,contentRef:l,contentId:o(),titleId:o(),descriptionId:o(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),modal:s,children:n})};w.displayName=y;var T=`DialogTrigger`,E=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=C(T,n),a=p(t,i.triggerRef);return(0,v.jsx)(g.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":K(i.open),...r,ref:a,onClick:m(e.onClick,i.onOpenToggle)})});E.displayName=T;var D=`DialogPortal`,[O,k]=b(D,{forceMount:void 0}),A=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=C(D,t);return(0,v.jsx)(O,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,v.jsx)(f,{present:n||o.open,children:(0,v.jsx)(i,{asChild:!0,container:a,children:e})}))})};A.displayName=D;var j=`DialogOverlay`,M=_.forwardRef((e,t)=>{let n=k(j,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=C(j,e.__scopeDialog);return a.modal?(0,v.jsx)(f,{present:r||a.open,children:(0,v.jsx)(P,{...i,ref:t})}):null});M.displayName=j;var N=ee(`DialogOverlay.RemoveScroll`),P=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=C(j,n);return(0,v.jsx)(l,{as:N,allowPinchZoom:!0,shards:[i.contentRef],children:(0,v.jsx)(g.div,{"data-state":K(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),F=`DialogContent`,I=_.forwardRef((e,t)=>{let n=k(F,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=C(F,e.__scopeDialog);return(0,v.jsx)(f,{present:r||a.open,children:a.modal?(0,v.jsx)(L,{...i,ref:t}):(0,v.jsx)(R,{...i,ref:t})})});I.displayName=F;var L=_.forwardRef((e,t)=>{let n=C(F,e.__scopeDialog),r=_.useRef(null),i=p(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return a(e)},[]),(0,v.jsx)(z,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:m(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:m(e.onFocusOutside,e=>e.preventDefault())})}),R=_.forwardRef((e,t)=>{let n=C(F,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,v.jsx)(z,{...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()}})}),z=_.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,c=C(F,n),l=_.useRef(null),d=p(t,l);return u(),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,v.jsx)(h,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":K(c.open),...o,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(X,{titleId:c.titleId}),(0,v.jsx)(Q,{contentRef:l,descriptionId:c.descriptionId})]})]})}),B=`DialogTitle`,V=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=C(B,n);return(0,v.jsx)(g.h2,{id:i.titleId,...r,ref:t})});V.displayName=B;var H=`DialogDescription`,U=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=C(H,n);return(0,v.jsx)(g.p,{id:i.descriptionId,...r,ref:t})});U.displayName=H;var W=`DialogClose`,G=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=C(W,n);return(0,v.jsx)(g.button,{type:`button`,...r,ref:t,onClick:m(e.onClick,()=>i.onOpenChange(!1))})});G.displayName=W;function K(e){return e?`open`:`closed`}var q=`DialogTitleWarning`,[J,Y]=c(q,{contentName:F,titleName:B,docsSlug:`dialog`}),X=({titleId:e})=>{let t=Y(q),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2
-
3
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
4
-
5
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return _.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Z=`DialogDescriptionWarning`,Q=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Y(Z).contentName}}.`;return _.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},$=w,te=E,ne=A,re=M,ie=I,ae=V,oe=U,se=G;export{ne as a,te as c,re as i,J as l,ie as n,$ as o,oe as r,ae as s,se as t,x as u};