@lacneu/atrium 0.49.0 → 0.50.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 (67) hide show
  1. package/dist/assets/{AccessTab-C5QpmPe2.js → AccessTab-YfxJ8TyH.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-BzRzcaLe.js → AdvancedFilter-Bw_6N4Fp.js} +1 -1
  3. package/dist/assets/AgentFilesTab-BGjK8vy-.js +3 -0
  4. package/dist/assets/AnomaliesTab-ClY_uTZu.js +1 -0
  5. package/dist/assets/AuditTab-DNV2Z66C.js +1 -0
  6. package/dist/assets/BridgeTab-BDp1JcI8.js +1 -0
  7. package/dist/assets/{ChatDefaultsTab-BKky_1Av.js → ChatDefaultsTab-Cuma5jME.js} +1 -1
  8. package/dist/assets/{DataTableShell-CySP6pgB.js → DataTableShell-HZGBUlvm.js} +1 -1
  9. package/dist/assets/{DetailChips-CqgbiqUw.js → DetailChips-gFOfqX_a.js} +1 -1
  10. package/dist/assets/FeedbacksTab-BaSoBVK5.js +1 -0
  11. package/dist/assets/{FieldLabel-CyXK3G_H.js → FieldLabel-pNGSpfk-.js} +1 -1
  12. package/dist/assets/FilesTab-BxjNQ6IX.js +1 -0
  13. package/dist/assets/{FilterBar-irfwrPVv.js → FilterBar-DlPympG5.js} +1 -1
  14. package/dist/assets/{GroupsTab-KElXEjtm.js → GroupsTab-CUch1a_C.js} +1 -1
  15. package/dist/assets/InstancesTab-DRWZsjZC.js +1 -0
  16. package/dist/assets/IntegrationsTab-C7KPWF6x.js +1 -0
  17. package/dist/assets/{KpiTab-DLCBfUyr.js → KpiTab-6QaTYyCv.js} +1 -1
  18. package/dist/assets/PreferencesTab-CLEVHQTj.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-CnlX7r8C.js +4 -0
  20. package/dist/assets/RolesTab-orl-1HS-.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-CtwpNIDj.js +1 -0
  22. package/dist/assets/{SubAgentReportsTab-DmMB0i9U.js → SubAgentReportsTab-MRixaruJ.js} +1 -1
  23. package/dist/assets/ThemeShowroom-BCYOO2fm.js +1 -0
  24. package/dist/assets/{TimeRangePicker-3h2VniWx.js → TimeRangePicker-Cm5l2vkz.js} +1 -1
  25. package/dist/assets/TracesTab-BATP4Ee5.js +1 -0
  26. package/dist/assets/UsersTab-CN9dGPvE.js +1 -0
  27. package/dist/assets/{VoiceTab-CjWmW8mr.js → VoiceTab-DJyEAu0o.js} +1 -1
  28. package/dist/assets/{button-Dbs-wspp.js → button-B4Nos6AU.js} +1 -1
  29. package/dist/assets/{card-B_7M0l5O.js → card-DhM6Y5He.js} +1 -1
  30. package/dist/assets/chevrons-up-down-Du6glRFD.js +1 -0
  31. package/dist/assets/{compatView-CeYXlVzu.js → compatView-DwEzKEAD.js} +1 -1
  32. package/dist/assets/{dispatchErrorInfo-CgEoICK4.js → dispatchErrorInfo-C27wKMfE.js} +1 -1
  33. package/dist/assets/{dist-D8Kd0X5G.js → dist-BTpttlbH.js} +5 -5
  34. package/dist/assets/{dist-BC4E1wqn.js → dist-BwHHVs_B.js} +1 -1
  35. package/dist/assets/{dist-CF-vNq7s.js → dist-BzsC63K9.js} +1 -1
  36. package/dist/assets/{dist-CZwMA8Oj.js → dist-qfxevi2g.js} +1 -1
  37. package/dist/assets/{highlighted-body-OFNGDK62-DSPtdVav.js → highlighted-body-OFNGDK62-DUhXym2u.js} +1 -1
  38. package/dist/assets/{index-BH6LVgWl.css → index-CnCsAZYf.css} +1 -1
  39. package/dist/assets/index-GIhUlE6M.js +233 -0
  40. package/dist/assets/mermaid-GHXKKRXX-D_CGWBHm.js +1 -0
  41. package/dist/assets/{pdf-Dwqw551E.js → pdf-BjDyP8tM.js} +1 -1
  42. package/dist/assets/roleDescriptions-8ML7Rdme.js +1 -0
  43. package/dist/assets/{table-RDie4v3L.js → table-BBE4oFvW.js} +1 -1
  44. package/dist/assets/{tabs-uwXJdjSE.js → tabs-DlXyYN7h.js} +1 -1
  45. package/dist/assets/x-BLHWZzIt.js +1 -0
  46. package/dist/index.html +8 -8
  47. package/package.json +1 -1
  48. package/dist/assets/AgentFilesTab-DgyYp1Yu.js +0 -3
  49. package/dist/assets/AnomaliesTab-BfvM_oKR.js +0 -1
  50. package/dist/assets/AuditTab-B5U0zwjP.js +0 -1
  51. package/dist/assets/BridgeTab-BHnMaTub.js +0 -1
  52. package/dist/assets/FeedbacksTab-UO9aY9Rc.js +0 -1
  53. package/dist/assets/FilesTab-BAhDA2Oi.js +0 -1
  54. package/dist/assets/InstancesTab-CnxJKNrU.js +0 -1
  55. package/dist/assets/IntegrationsTab-C_WMMnfP.js +0 -1
  56. package/dist/assets/PreferencesTab-CsHMsOBx.js +0 -1
  57. package/dist/assets/PromptInjectionsTab-Iuv2LIWX.js +0 -4
  58. package/dist/assets/RolesTab-JyOSiabk.js +0 -1
  59. package/dist/assets/ServiceAccountsTab-C1S0vg1x.js +0 -1
  60. package/dist/assets/ThemeShowroom-DxS8vmei.js +0 -1
  61. package/dist/assets/TracesTab-DTrYQKIz.js +0 -1
  62. package/dist/assets/UsersTab-Bg8hwoUX.js +0 -1
  63. package/dist/assets/chevrons-up-down-CGy16B32.js +0 -1
  64. package/dist/assets/index-Se6baszB.js +0 -233
  65. package/dist/assets/mermaid-GHXKKRXX-C_IvlBqL.js +0 -1
  66. package/dist/assets/roleDescriptions-DuRh679l.js +0 -1
  67. package/dist/assets/x-B-jDgsYW.js +0 -1
@@ -0,0 +1 @@
1
+ import{Fy as e,Iy as t,Ly as n,Py as r,Ry as i}from"./dist-BTpttlbH.js";var a={pending:i,user:n,admin:t,observer:e,agent:r};function o(e){if(e.builtin){let t=a[e.key];if(t)return t()}return e.description}export{o as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-D8Kd0X5G.js";e();var r=t();function i({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:n(`w-full caption-bottom text-sm`,e),...t})})}function a({className:e,...t}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:n(`[&_tr]:border-b`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:n(`[&_tr:last-child]:border-0`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:n(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:n(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:n(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}export{a,c as i,o as n,s as o,l as r,i as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-BTpttlbH.js";e();var r=t();function i({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:n(`w-full caption-bottom text-sm`,e),...t})})}function a({className:e,...t}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:n(`[&_tr]:border-b`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:n(`[&_tr:last-child]:border-0`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:n(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:n(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:n(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}export{a,c as i,o as n,s as o,l as r,i as t};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{d as r,f as i,h as a,n as o,t as s,u as c,v as l,y as u}from"./dist-D8Kd0X5G.js";import{t as d}from"./dist-BC4E1wqn.js";import{Dt as f,Et as p,Ot as m}from"./index-Se6baszB.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[m]),b=m(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=i({prop:r,onChange:a,defaultProp:o??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:c(),value:h,onValueChange:v,orientation:s,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":s,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(f,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(u.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=S(E,n),s=b(n),c=A(o.baseId,r),d=j(o.baseId,r),f=r===o.value;return(0,g.jsx)(p,{asChild:!0,...s,focusable:!i,active:f,children:(0,g.jsx)(u.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:l(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:l(e.onFocus,()=>{let e=o.activationMode!==`manual`;!f&&!i&&e&&o.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,forceMount:a,children:o,...s}=e,c=S(O,n),l=A(c.baseId,i),d=j(c.baseId,i),f=i===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(r,{present:a||f,children:({present:n})=>(0,g.jsx)(u.div,{"data-state":f?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:o(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=s(`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 R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:o(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:o(`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 B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:o(`flex-1 text-sm outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{d as r,f as i,h as a,n as o,t as s,u as c,v as l,y as u}from"./dist-BTpttlbH.js";import{t as d}from"./dist-BwHHVs_B.js";import{Dt as f,Et as p,Ot as m}from"./index-GIhUlE6M.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[m]),b=m(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=i({prop:r,onChange:a,defaultProp:o??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:c(),value:h,onValueChange:v,orientation:s,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":s,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(f,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(u.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=S(E,n),s=b(n),c=A(o.baseId,r),d=j(o.baseId,r),f=r===o.value;return(0,g.jsx)(p,{asChild:!0,...s,focusable:!i,active:f,children:(0,g.jsx)(u.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:l(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:l(e.onFocus,()=>{let e=o.activationMode!==`manual`;!f&&!i&&e&&o.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,forceMount:a,children:o,...s}=e,c=S(O,n),l=A(c.baseId,i),d=j(c.baseId,i),f=i===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(r,{present:a||f,children:({present:n})=>(0,g.jsx)(u.div,{"data-state":f?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:o(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=s(`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 R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:o(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:o(`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 B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:o(`flex-1 text-sm outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-BTpttlbH.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
package/dist/index.html CHANGED
@@ -53,15 +53,15 @@
53
53
  document.documentElement.dataset.motion = "static";
54
54
  })();
55
55
  </script>
56
- <script type="module" crossorigin src="/assets/index-Se6baszB.js"></script>
56
+ <script type="module" crossorigin src="/assets/index-GIhUlE6M.js"></script>
57
57
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
58
- <link rel="modulepreload" crossorigin href="/assets/dist-D8Kd0X5G.js">
59
- <link rel="modulepreload" crossorigin href="/assets/dist-BC4E1wqn.js">
60
- <link rel="modulepreload" crossorigin href="/assets/dist-CZwMA8Oj.js">
61
- <link rel="modulepreload" crossorigin href="/assets/dist-CF-vNq7s.js">
62
- <link rel="modulepreload" crossorigin href="/assets/x-B-jDgsYW.js">
63
- <link rel="modulepreload" crossorigin href="/assets/button-Dbs-wspp.js">
64
- <link rel="stylesheet" crossorigin href="/assets/index-BH6LVgWl.css">
58
+ <link rel="modulepreload" crossorigin href="/assets/dist-BTpttlbH.js">
59
+ <link rel="modulepreload" crossorigin href="/assets/dist-BwHHVs_B.js">
60
+ <link rel="modulepreload" crossorigin href="/assets/dist-qfxevi2g.js">
61
+ <link rel="modulepreload" crossorigin href="/assets/dist-BzsC63K9.js">
62
+ <link rel="modulepreload" crossorigin href="/assets/x-BLHWZzIt.js">
63
+ <link rel="modulepreload" crossorigin href="/assets/button-B4Nos6AU.js">
64
+ <link rel="stylesheet" crossorigin href="/assets/index-CnCsAZYf.css">
65
65
  </head>
66
66
  <body>
67
67
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacneu/atrium",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "Atrium — public, self-hostable, Convex-backed web chat UI for AI agent gateways (OpenClaw today, Hermes next). Ships an origin-agnostic static bundle (Convex URL injected at runtime via /config.json).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,3 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ac as r,Ar as i,Bc as a,Br as o,Cc as s,Cr as c,Dc as l,Dr as u,E as d,Ec as f,Er as p,Fc as m,Fr as h,HE as g,Hr as _,Ic as v,Ir as y,Lc as b,Lr as x,Mc as S,Mr as C,Nc as w,Nr as T,Oc as E,Or as D,Pc as ee,Pr as O,Rc as te,Rr as ne,Sc as k,Sl as re,Sr as A,Tc as j,Tr as M,Vc as N,Vr as P,_c as F,bc as ie,cM as I,dr as L,fM as R,fc as ae,fr as z,gc as B,hM as V,hc as oe,hr as se,jc as ce,jr as H,kc as le,kr as U,lr as ue,mM as de,mc as fe,mr as pe,oM as W,pc as me,pr as he,ur as ge,vc as _e,wc as ve,wl as G,wr as ye,xc as be,yc as xe,zc as Se,zr as Ce}from"./dist-D8Kd0X5G.js";import{t as K}from"./button-Dbs-wspp.js";import{At as q,C as we,G as Te,H as Ee,J as De,K as Oe,S as ke,U as Ae,W as je,Y as Me,b as Ne,ct as Pe,dt as Fe,ft as Ie,ht as Le,mt as Re,q as ze,ut as Be,w as Ve,x as He,xt as Ue,y as We,z as J}from"./index-Se6baszB.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{i as qe}from"./compatView-CeYXlVzu.js";/* empty css */var Y=t(e(),1),X=2e4,Je=6e4;function Ye(e){return typeof e!=`number`||e<=0?0:Math.round(e/X*100)}function Xe(e){return e<=0?0:Math.round(e/Je*100)}function Z(e,t){let n=(typeof e==`number`&&e>0?e:0)/1e3;return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(n)}function Ze(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var Qe=3;function $e(e,t){let n=new Map;for(let t of e.split(`
2
- `))n.set(t,(n.get(t)??0)+1);for(let e of t.split(`
3
- `))n.set(e,(n.get(e)??0)-1);let r=0,i=0,a=[],o=[];for(let[e,t]of n)t<0?(r+=-t,a.length<Qe&&a.push(e)):t>0&&(i+=t,o.length<Qe&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function et(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var Q=n(),$=e=>`${e.instanceName}::${e.agentId}`;function tt(){let e=V(d.me.getMe,{host:Ue}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),i=V(d.admin.listInstances,e!==void 0&&t?{}:`skip`),[o,s]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!t||!i||i.length===0||(!o||!i.some(e=>e.name===o))&&s(i[0].name)},[t,i,o]);let c=V(d.agents.listAgentsForInstance,t&&o?{instanceName:o}:`skip`),l=V(d.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),u=(0,Y.useMemo)(()=>{if(e!==void 0){if(t)return o===null||c===void 0?i!==void 0&&i.length===0?[]:void 0:c.agents.map(e=>({instanceName:o,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(l!==void 0)return l.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,o,c,i,l]),[f,p]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!u||u.length===0||(!f||!u.some(e=>$(e)===f))&&p($(u[0]))},[u,f]);let h=u?.find(e=>$(e)===f)??null,g=R(d.agentFiles.listAgentFiles),[_,y]=(0,Y.useState)({status:`idle`}),C=h?.instanceName??null,T=h?.agentId??null,E=V(d.compat.forInstance,n&&C!==null?{instanceName:C}:`skip`),D=n&&C!==null?We(E,`agentFiles`):null,O=D===null?!1:D===`loading`?null:D.blocked,k=(0,Y.useCallback)(async()=>{if(!(C===null||T===null)){y({status:`loading`});try{y({status:`done`,files:(await g({instanceName:C,agentId:T})).files})}catch{y({status:`error`})}}},[g,C,T]);(0,Y.useEffect)(()=>{O===!1&&k()},[k,O]);let[A,j]=(0,Y.useState)(null),M=V(d.agentFileCuration.listCurations,t&&C!==null&&T!==null?{instanceName:C,agentId:T}:`skip`),P=V(d.agentFileCuration.curationSettings,t&&C!==null?{instanceName:C}:`skip`),F=R(d.agentFileCuration.requestCuration),[ie,L]=(0,Y.useState)(null),[ae,z]=(0,Y.useState)(null),{toast:B}=J(),oe=(0,Y.useMemo)(()=>{let e=new Map;for(let t of M??[])e.has(t.name)||e.set(t.name,t);return e},[M]),se=(0,Y.useCallback)(async e=>{if(!(C===null||T===null)){L(e);try{let t=await F({instanceName:C,agentId:T,name:e,trigger:`manual`});t.ok?B({title:Ce(),variant:`success`}):B({title:ne({reason:t.reason??`unknown`}),variant:`error`})}catch{B({title:x(),variant:`error`})}finally{L(null)}}},[F,C,T,B]),H=I(),U=(0,Y.useMemo)(()=>new Intl.NumberFormat(H,{maximumFractionDigits:0}),[H]);return e===void 0||u===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:W()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:N()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(i?.length??0)>1?(0,Q.jsxs)(Ne,{value:o??``,onValueChange:e=>s(e),children:[(0,Q.jsx)(we,{size:`sm`,"aria-label":a(),children:(0,Q.jsx)(Ve,{})}),(0,Q.jsx)(He,{children:(i??[]).map(e=>(0,Q.jsx)(ke,{value:e.name,children:e.name},e.name))})]}):null,u.length>0?(0,Q.jsxs)(Ne,{value:f??``,onValueChange:e=>p(e),children:[(0,Q.jsx)(we,{size:`sm`,"aria-label":Se(),children:(0,Q.jsx)(Ve,{})}),(0,Q.jsx)(He,{children:u.map(e=>(0,Q.jsx)(ke,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:te()})]}),h===null?null:D===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:W()}):D!==null&&D.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(q,{size:14,"aria-hidden":!0}),` `,qe(D.gatewayVersion,D.provider)]}):_.status===`loading`||_.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:W()}):_.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[v(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void k(),children:re()})]}):_.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:_.files.map(e=>{let n=Ye(e.size),i=n>=80;return(0,Q.jsxs)(`div`,{className:`oc-afiles__row`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__name`,title:e.name,children:e.name}),e.missing?(0,Q.jsx)(Pe,{variant:`outline`,children:m()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:ee({size:Z(e.size,H)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${i?` is-warn`:``}`,"aria-hidden":!0,children:(0,Q.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,Q.jsx)(`span`,{className:`oc-afiles__pct`,children:w({pct:U.format(n)})}),i?(0,Q.jsx)(q,{size:14,className:`oc-afiles__warn`,"aria-label":S()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>j(e),children:t?r():le()}),t&&!e.missing?(0,Q.jsx)(nt,{curatable:Ke.includes(e.name),size:e.size??0,budget:P?.budgetChars??null,enabled:P?.enabled??!1,curation:oe.get(e.name)??null,inFlight:ie===e.name,onCurate:()=>void se(e.name),onReview:e=>z(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:ce({used:Z(Ze(_.files),H),total:Z(Je,H),pct:U.format(Xe(Ze(_.files)))})})]}),A&&h?(0,Q.jsx)(rt,{instanceName:h.instanceName,agentId:h.agentId,name:A.name,isAdmin:t,onClose:()=>j(null),onSaved:()=>void k()}):null,ae?(0,Q.jsx)(it,{curationId:ae,onClose:()=>z(null),onApplied:()=>{z(null),k()}}):null]})}function nt({curatable:e,size:t,budget:n,enabled:r,curation:i,inFlight:a,onCurate:s,onReview:c}){return i?.status===`proposed`?(0,Q.jsx)(K,{variant:`default`,size:`sm`,className:`oc-afiles__curate`,onClick:()=>c(i._id),children:P()}):a||i?.status===`dispatched`||i?.status===`applying`?(0,Q.jsx)(Pe,{variant:`outline`,className:`oc-afiles__curate-status`,children:o()}):e&&r&&n!==null&&Ge(t,n)?(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__curate`,onClick:s,children:_()}):null}function rt({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:a}){let o=R(d.agentFiles.getAgentFile),c=R(d.agentFiles.setAgentFile),u=J(),[p,m]=(0,Y.useState)(null),[h,_]=(0,Y.useState)(!1),[v,y]=(0,Y.useState)(``),[b,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)(!1),[w,T]=(0,Y.useState)(!1),[D,ee]=(0,Y.useState)(!1),O=(0,Y.useCallback)(async r=>{_(!1);try{let i=await o({instanceName:e,agentId:t,name:n});m({content:i.content,updatedAtMs:i.updatedAtMs}),r||y(i.content),T(!1)}catch{_(!0)}},[o,e,t,n]);(0,Y.useEffect)(()=>{O(!1)},[O]);async function te(){if(p!==null){C(!0),ee(!1);try{await c({instanceName:e,agentId:t,name:n,content:v,baseUpdatedAtMs:p.updatedAtMs??void 0}),u.success(k({name:n})),a(),await O(!1)}catch(e){et(e)?T(!0):ee(!0)}finally{C(!1)}}}let ne=p!==null&&v!==p.content,A=(0,Y.useMemo)(()=>p===null?null:$e(p.content,v),[p,v]),M=v.length>X,N=I(),P=(0,Y.useMemo)(()=>new Intl.NumberFormat(N),[N]);return(0,Q.jsx)(Be,{open:!0,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(Fe,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(Le,{children:E({name:n})}),(0,Q.jsxs)(Ie,{children:[l({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,f()]})]})]}),h?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[ie(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void O(!1),children:re()})]}):p===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:W()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:v,readOnly:!r,spellCheck:!1,onChange:e=>y(e.target.value),"aria-label":E({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:j()}),w?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[xe(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void O(!0),children:_e()})]}):null,D?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:be()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${M?` is-over`:``}`,children:ve({count:P.format(v.length),max:P.format(X)})}),r?(0,Q.jsx)(K,{size:`sm`,disabled:!ne||S||w,onClick:()=>x(!0),children:S?G():s()}):null]})]}),(0,Q.jsx)(Ee,{open:b,onOpenChange:x,children:(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(De,{children:[(0,Q.jsx)(Me,{children:F({name:n})}),(0,Q.jsx)(Oe,{children:B({agent:t})})]}),A?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:oe({added:A.added,removed:A.removed})}),A.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:fe()}),A.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,A.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:me()}),A.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(je,{children:g()}),(0,Q.jsx)(Ae,{onClick:()=>void te(),children:ae()})]})]})})]})})}function it({curationId:e,onClose:t,onApplied:n}){let r=V(d.agentFileCuration.getProposal,{curationId:e}),a=R(d.agentFileCuration.approveCuration),o=de(d.agentFileCuration.rejectCuration),{toast:s}=J(),[l,f]=(0,Y.useState)(null),[m,g]=(0,Y.useState)(!1),[_,v]=(0,Y.useState)(``),b=I(),S=(0,Y.useMemo)(()=>r?$e(r.beforeContent,r.proposedContent):null,[r]);async function w(){f(`approve`);try{let t=await a({curationId:e});t.ok?(s({title:y(),variant:`success`}),n()):s({title:t.reason===`conflict`?O():T({reason:t.reason??`unknown`}),variant:`error`})}catch{s({title:x(),variant:`error`})}finally{f(null)}}async function E(n){f(`reject`);try{let r=_.trim();(await o({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?s({title:n?ge():h(),variant:`success`}):s({title:i(),variant:`error`}),t()}catch{s({title:x(),variant:`error`})}finally{f(null)}}return(0,Q.jsx)(Be,{open:!0,onOpenChange:e=>e?void 0:t(),children:(0,Q.jsxs)(Fe,{className:`oc-afiles__review`,children:[(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(Le,{children:r?C({name:r.name}):W()}),(0,Q.jsx)(Ie,{children:H()})]}),r===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:W()}):r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[U({before:Z(r.beforeSize,b),after:Z(r.proposedSize,b)}),r.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(q,{size:13,"aria-hidden":!0}),` `,D()]}):null]}),S?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:u({added:S.added,removed:S.removed})}):null,r.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:ue({feedback:r.feedback})}):null,S&&S.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:A()}),(0,Q.jsx)(`ul`,{children:S.sampleRemoved.map((e,t)=>(0,Q.jsx)(`li`,{children:e||`\xA0`},t))})]}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__review-panes oc-afiles__review-panes--2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:c()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.beforeContent})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:p()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.proposedContent})]})]})]}),m?(0,Q.jsxs)(`div`,{className:`oc-afiles__reject-form`,children:[(0,Q.jsx)(`label`,{className:`oc-afiles__review-label`,htmlFor:`curation-reject-comment`,children:se()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:pe(),value:_,onChange:e=>v(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`ghost`,onClick:()=>g(!1),disabled:l!==null,children:he()}),(0,Q.jsx)(K,{variant:`outline`,onClick:()=>void E(!1),disabled:l!==null,children:l===`reject`?G():z()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void E(!0),disabled:l!==null,children:l===`reject`?G():L()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`outline`,onClick:()=>g(!0),disabled:l!==null||r==null,children:M()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void w(),disabled:l!==null||r==null,children:l===`approve`?G():ye()})]})]})})}export{tt as AgentFilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$v as r,Av as i,Bv as ee,E as a,Fv as o,Gv as te,Hv as ne,Iv as s,Jv as re,Kv as c,Lv as l,Mv as u,Nv as d,Pv as f,Qv as ie,Rv as p,Sy as m,Uv as ae,Vv as oe,Wv as se,Xv as ce,Yv as h,Zv as g,_y as le,ay as ue,by as _,cy as de,dy as fe,ey as pe,fy as me,gy as he,hM as v,hy as ge,iy as _e,jv as y,ly as ve,mM as ye,my as b,ny as x,oy as S,py as C,qv as w,ry as T,sy as E,ty as D,uy as O,vy as k,xy as A,yy as j,zv as M}from"./dist-D8Kd0X5G.js";import{B as N,C as P,S as F,Xt as be,Yt as I,a as xe,b as L,ct as R,dt as z,et as Se,ht as B,mt as V,r as Ce,ut as H,w as U,x as W,xt as we,z as Te}from"./index-Se6baszB.js";import{n as Ee}from"./TimeRangePicker-3h2VniWx.js";import{t as De}from"./FilterBar-irfwrPVv.js";import{t as Oe}from"./DataTableShell-CySP6pgB.js";import{t as G}from"./dispatchErrorInfo-CgEoICK4.js";var K=t(e(),1),q=n(),J=`__all__`,ke=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function Ae(e){return e===`open`?m():e===`acknowledged`?A():_()}var je=[`info`,`warn`,`critical`],Me=[`detector`,`agent`,`user`],Ne={kind:`relative`,from:`now-30d`,to:`now`},Pe=200,Y=`all`;function X(){let e=be({from:`/settings/anomalies`}),t=I({from:`/settings/anomalies`}),n=e.q??``,i=e.status===Y?J:e.status,o=e.severity??J,s=e.kind??J,[l,u]=(0,K.useState)(J),d=Ce(e.from,e.to),{from:f,to:m}=Ee(d),_=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),y=e=>void t({search:t=>({...t,status:e===J?Y:e})}),A=e=>void t({search:t=>({...t,severity:e===J?void 0:e})}),z=e=>void t({search:t=>({...t,kind:e===J?void 0:e})}),B=e=>void t({search:t=>({...t,...xe(e)})}),V=N(),H=Te(),G=ye(a.anomalies.resolveAnomaly),X=(v(a.me.getMe,{host:we})?.permissions??[]).includes(`admin.manage`),Z=v(a.anomalies.listAnomalies,{limit:Pe,filter:{q:n||void 0,from:f,to:m,anomalyStatus:i===J?void 0:i,severity:o===J?void 0:o,source:l===J?void 0:l,kind:s===J?void 0:s}}),Q=(0,K.useMemo)(()=>{let e=new Set;for(let t of Z??[])e.add(t.kind);return[...e].sort()},[Z]),ze=n!==``||i!==`open`||o!==J||l!==J||s!==J||d.kind!==`relative`||d.from!==Ne.from;function Be(){u(J),t({search:{status:`open`},replace:!0})}async function Ve(e){if(await V({title:j(),description:(0,q.jsxs)(q.Fragment,{children:[k(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,le(),` `,(0,q.jsx)(`strong`,{children:he()}),`.`,` `,ge()]}),confirmLabel:b()}))try{await G({anomalyId:e._id,status:`resolved`}),H.success(C(),e.kind)}catch(e){H.error(me(),e)}}async function He(e){try{await G({anomalyId:e._id,status:`acknowledged`}),H.success(fe(),e.kind)}catch(e){H.error(O(),e)}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`oc-admin__hint`,children:[ve(),` `,(0,q.jsx)(`strong`,{children:de()}),` `,E(),` `,(0,q.jsx)(`strong`,{children:S()}),` `,ue(),` `,(0,q.jsx)(`strong`,{children:_e()}),` `,T(),` `,(0,q.jsx)(`span`,{className:`oc-filter__window`,children:x()})]}),(0,q.jsxs)(De,{q:n,onQChange:_,searchPlaceholder:D(),timeRange:d,onTimeRangeChange:B,onReset:Be,canReset:ze,children:[(0,q.jsxs)(L,{value:i,onValueChange:y,children:[(0,q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,q.jsx)(U,{})}),(0,q.jsxs)(W,{children:[(0,q.jsx)(F,{value:J,children:pe()}),ke.map(e=>(0,q.jsx)(F,{value:e.value,children:Ae(e.value)},e.value))]})]}),(0,q.jsxs)(L,{value:o,onValueChange:A,children:[(0,q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,q.jsx)(U,{placeholder:r()})}),(0,q.jsxs)(W,{children:[(0,q.jsx)(F,{value:J,children:ie()}),je.map(e=>(0,q.jsx)(F,{value:e,children:e},e))]})]}),(0,q.jsxs)(L,{value:l,onValueChange:u,children:[(0,q.jsx)(P,{size:`sm`,className:`w-32`,children:(0,q.jsx)(U,{placeholder:g()})}),(0,q.jsxs)(W,{children:[(0,q.jsx)(F,{value:J,children:ce()}),Me.map(e=>(0,q.jsx)(F,{value:e,children:e},e))]})]}),(0,q.jsxs)(L,{value:s,onValueChange:z,children:[(0,q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,q.jsx)(U,{placeholder:h()})}),(0,q.jsxs)(W,{children:[(0,q.jsx)(F,{value:J,children:re()}),Q.map(e=>(0,q.jsx)(F,{value:e,children:e},e))]})]})]}),(0,q.jsx)(Oe,{title:w(),rows:Z,emptyHint:i===`open`?c():te(),rowActions:e=>X&&e.status===`open`?[{label:se(),onSelect:()=>void Ve(e)},{label:ae(),onSelect:()=>void He(e)}]:[],columns:[{header:ne(),cell:e=>(0,q.jsx)(`span`,{className:`oc-traces__time`,children:Se(e.at)}),sort:e=>e.at},{header:h(),cell:e=>(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:r(),cell:e=>(0,q.jsx)(Le,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:oe(),cell:e=>(0,q.jsx)($,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:g(),cell:e=>(0,q.jsx)(R,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:ee(),cell:e=>(0,q.jsxs)(`div`,{className:`oc-anomaly__msgcell`,children:[(0,q.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),(0,q.jsx)(Ie,{row:e})]}),sort:e=>e.message},{header:M(),cell:e=>(0,q.jsx)(Fe,{row:e}),sort:e=>e.evidence??null},{header:p(),cell:e=>e.correlationId?(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:Re(e.correlationId)}):(0,q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function Z(e){if(e.kind!==`openclaw.dispatch_failures`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{dominantCode:t.dominantCode,sampleCorrelationId:t.sampleCorrelationId}}catch{return{}}}function Q(e){if(e.kind!==`subagent.failure`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{failedCount:t.failedCount,totalCount:t.totalCount,errorCategories:t.errorCategories}}catch{return{}}}function Fe({row:e}){let t=I();if(e.kind===`subagent.failure`){let n=Q(e);return(0,q.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,q.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,l()]}):null]})}let n=Z(e);if(!n.dominantCode)return(0,q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=G(n.dominantCode),i=n.sampleCorrelationId;return(0,q.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,q.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,q.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,q.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,l()]}):null]})}function Ie({row:e}){let[t,n]=(0,K.useState)(!1),r=v(a.anomalies.getAnomalyAttachments,t?{anomalyId:e._id}:`skip`);return!e.attachments||e.attachments.length===0?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>n(!0),children:[s(),e.attachments.length>1?` (${e.attachments.length})`:``]}),(0,q.jsx)(H,{open:t,onOpenChange:n,children:(0,q.jsxs)(z,{className:`oc-anomaly__attachments-dialog`,children:[(0,q.jsx)(V,{children:(0,q.jsx)(B,{children:o()})}),r===void 0?(0,q.jsx)(`p`,{className:`oc-traces__muted`,children:f()}):r.length===0?(0,q.jsx)(`p`,{className:`oc-traces__muted`,children:d()}):(0,q.jsx)(`div`,{className:`oc-anomaly__attachments`,children:r.map(e=>(0,q.jsxs)(`section`,{className:`oc-anomaly__attachment`,children:[(0,q.jsx)(`h4`,{className:`oc-anomaly__attachment-name`,children:(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e.name})}),(0,q.jsx)(`pre`,{className:`oc-anomaly__attachment-content`,children:e.content})]},e.name))})]})})]})}function Le({severity:e}){return(0,q.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function $({status:e}){return e===`open`?(0,q.jsx)(R,{variant:`destructive`,children:u()}):e===`acknowledged`?(0,q.jsx)(R,{variant:`secondary`,children:y()}):(0,q.jsx)(R,{variant:`outline`,children:i()})}function Re(e){return e.length>8?e.slice(0,8):e}export{X as AnomaliesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cb as r,Db as i,E as a,Eb as o,Sb as s,Sn as c,Tb as l,_b as u,_n as d,bb as f,bn as p,gb as m,hM as h,hb as g,mb as _,pb as v,vb as y,vn as b,wb as x,xb as S,xn as C,yb as w,yn as T}from"./dist-D8Kd0X5G.js";import{C as E,S as D,Xt as O,Yt as k,a as A,b as j,et as M,i as N,o as P,r as F,t as I,w as L,x as R}from"./index-Se6baszB.js";import{n as ee}from"./TimeRangePicker-3h2VniWx.js";import{t as z}from"./FilterBar-irfwrPVv.js";import{t as B}from"./AdvancedFilter-BzRzcaLe.js";import{t as V}from"./DataTableShell-CySP6pgB.js";var H=t(e(),1),U=n(),W={kind:`relative`,from:I,to:`now`},G=`__all__`,K=[{value:`action`,label:c()},{value:`realLabel`,label:C()},{value:`targetLabel`,label:p()},{value:`impersonated`,label:T()},{value:`resource`,label:b()},{value:`resourceId`,label:d()}];function q(){let e=O({from:`/settings/audit`}),t=k({from:`/settings/audit`}),n=e.q??``,c=e.action??G,d=e.impersonated??G,p=e.resource??G,b=F(e.from,e.to),C=(0,H.useMemo)(()=>P(e.adv),[e.adv]),{from:T,to:I}=ee(b),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,action:e===G?void 0:e})}),Y=e=>void t({search:t=>({...t,impersonated:e===G?void 0:e})}),X=e=>void t({search:t=>({...t,resource:e===G?void 0:e})}),Z=e=>void t({search:t=>({...t,...A(e)})}),Q=e=>void t({search:t=>({...t,adv:N(e)}),replace:!0}),$=h(a.admin.listAudit,{filter:{q:n||void 0,from:T,to:I,action:c===G?void 0:c,resource:p===G?void 0:p,impersonated:d===G?void 0:d===`yes`,advanced:C.length>0?C:void 0}}),te=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.action);return[...e].sort()},[$]),ne=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])t.resource&&e.add(t.resource);return[...e].sort()},[$]),re=n!==``||c!==G||d!==G||p!==G||C.length>0||b.kind!==`relative`||b.from!==W.from;function ie(){t({search:{},replace:!0})}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`oc-admin__hint`,children:[i(),` `,(0,U.jsx)(`span`,{className:`oc-filter__window`,children:o()})]}),(0,U.jsxs)(z,{q:n,onQChange:q,searchPlaceholder:l(),timeRange:b,onTimeRangeChange:Z,onReset:ie,canReset:re,children:[(0,U.jsxs)(j,{value:c,onValueChange:J,children:[(0,U.jsx)(E,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:x()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(D,{value:G,children:r()}),te.map(e=>(0,U.jsx)(D,{value:e,children:e},e))]})]}),(0,U.jsxs)(j,{value:d,onValueChange:Y,children:[(0,U.jsx)(E,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(D,{value:G,children:s()}),(0,U.jsx)(D,{value:`yes`,children:S()}),(0,U.jsx)(D,{value:`no`,children:f()})]})]}),(0,U.jsxs)(j,{value:p,onValueChange:X,children:[(0,U.jsx)(E,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:w()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(D,{value:G,children:y()}),ne.map(e=>(0,U.jsx)(D,{value:e,children:e},e))]})]})]}),(0,U.jsx)(B,{fields:K,seed:C,onChange:Q}),(0,U.jsx)(V,{title:u(),rows:$,emptyHint:m(),columns:[{header:g(),cell:e=>M(e.at),sort:e=>e.at},{header:x(),cell:e=>e.action,sort:e=>e.action},{header:_(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:v(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:w(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`,sort:e=>e.resource??null}]})]})}export{q as AuditTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$s as r,Ag as i,Ah as a,Bh as o,Bt as s,Cg as c,Ch as l,D as u,Dg as d,Dh as f,E as p,Eg as m,Eh as h,Fh as g,Gh as ee,Gs as _,Hh as te,Ht as v,Ih as ne,Jh as re,Js as y,Kh as ie,Ks as b,Kt as x,Lh as ae,Mh as oe,Nh as S,Og as se,Oh as ce,Ph as le,Qs as ue,Rh as de,Sg as fe,Sh as pe,Tg as me,Th as he,Uh as ge,Us as _e,Ut as ve,Vh as ye,Vt as be,Wh as xe,Ws as Se,Xs as C,Yh as Ce,Ys as we,Zs as Te,_g as Ee,_h as De,ah as Oe,bh as ke,ch as Ae,dh as je,ec as Me,eh as Ne,fM as Pe,fh as Fe,gh as Ie,hM as w,hh as Le,ih as Re,jg as ze,jh as Be,kh as Ve,lh as He,mM as Ue,mh as T,nh as We,oh as Ge,ph as Ke,qh as qe,qs as Je,rh as Ye,sh as Xe,tc as Ze,th as E,uh as Qe,vg as $e,vh as et,wg as tt,wh as nt,xg as rt,xh as it,yh as at,zh as ot,zs as st,zt as ct}from"./dist-D8Kd0X5G.js";import{i as D,r as lt}from"./dist-BC4E1wqn.js";import{t as ut}from"./chevrons-up-down-CGy16B32.js";import{i as dt,n as O,o as ft,r as pt,s as mt}from"./FieldLabel-CyXK3G_H.js";import{i as ht,n as gt,r as _t,t as vt}from"./tabs-uwXJdjSE.js";import{t as k}from"./button-Dbs-wspp.js";import{At as A,C as j,Kt as yt,Nt as bt,Q as xt,S as M,X as St,Xt as Ct,Yt as wt,Z as Tt,b as N,ct as P,dt as Et,et as F,ft as Dt,ht as Ot,lt as I,m as kt,mt as At,p as jt,qt as L,tt as R,ut as Mt,w as z,x as B,xt as Nt,z as Pt,zt as Ft}from"./index-Se6baszB.js";import{r as It}from"./locales-CPjguROj.js";import{a as V,i as H,n as Lt,o as U,r as W,t as Rt}from"./table-RDie4v3L.js";import{t as zt}from"./FilterBar-irfwrPVv.js";import{a as Bt,n as Vt,o as Ht,r as Ut,s as Wt,t as Gt}from"./compatView-CeYXlVzu.js";import{t as G}from"./dispatchErrorInfo-CgEoICK4.js";var Kt=u(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),qt=u(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),K=t(e(),1);function Jt(e){return e.filter(e=>e.state===`error`)}function Yt(e){return e.reachable&&Jt(e.targets).length===0}function Xt(e){return e.state===`error`&&e.lastErrorCode!==null}function Zt(e){return!!e.lastDownstreamRejectCode}function q(e){return e.kind??`openclaw`}function Qt(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function $t(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,q(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(q(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return Qt(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>q(e)===r)}))}function J(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var Y=`__all__`,en={q:``,state:Y,instance:Y,version:Y},X={connected:0,error:1,idle:2};function tn(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function nn(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function Z(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function rn(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function an(e,t,n){switch(e){case`state`:return(X[t.state]??99)-(X[n.state]??99);case`instance`:return Z(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return Z(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return Ht(e,r)??Z(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return Z(t.targetLabel,n.targetLabel)}}function on(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=rn(t.key,e),a=rn(t.key,r);return i&&a?0:i?1:a?-1:n*an(t.key,e,r)})}function sn(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(X[e]??99)-(X[t]??99))}function cn(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>Z(e.label,t.label))}function ln(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>Ht(e,t)??Z(e,t))}var Q=n();function un({connections:e,displayByInstance:t}){let[n,r]=(0,K.useState)(en),[i,a]=(0,K.useState)(null),o=(0,K.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount+(e.downstreamRejectCount??0),attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),s=(0,K.useMemo)(()=>sn(o),[o]),c=(0,K.useMemo)(()=>cn(o),[o]),l=(0,K.useMemo)(()=>ln(o),[o]),u=(0,K.useMemo)(()=>on(nn(o,n),i),[o,n,i]);function d(e){a(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:et()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(zt,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:Le(),onReset:()=>r(en),canReset:tn(n),children:[(0,Q.jsxs)(N,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(z,{placeholder:Ke()})}),(0,Q.jsxs)(B,{children:[(0,Q.jsx)(M,{value:Y,children:T()}),s.map(e=>(0,Q.jsx)(M,{value:e,children:fn(e)},e))]})]}),(0,Q.jsxs)(N,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(z,{placeholder:Fe()})}),(0,Q.jsxs)(B,{children:[(0,Q.jsx)(M,{value:Y,children:T()}),c.map(e=>(0,Q.jsx)(M,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(N,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(z,{placeholder:je()})}),(0,Q.jsxs)(B,{children:[(0,Q.jsx)(M,{value:Y,children:T()}),l.map(e=>(0,Q.jsx)(M,{value:e,children:e},e))]})]})]}),u.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Qe()}):(0,Q.jsxs)(Rt,{className:`oc-conn__table`,children:[(0,Q.jsx)(V,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)($,{label:He(),sortKey:`target`,sort:i,onSort:d}),(0,Q.jsx)($,{label:Ae(),sortKey:`state`,sort:i,onSort:d}),(0,Q.jsx)($,{label:Xe(),sortKey:`instance`,sort:i,onSort:d}),(0,Q.jsx)($,{label:Ge(),sortKey:`host`,sort:i,onSort:d}),(0,Q.jsx)($,{label:Oe(),sortKey:`version`,sort:i,onSort:d}),(0,Q.jsx)(H,{children:Re()}),(0,Q.jsx)($,{label:Ye(),sortKey:`lastOk`,sort:i,onSort:d})]})}),(0,Q.jsx)(Lt,{children:u.map(e=>(0,Q.jsx)(dn,{r:e},e._id))})]})]})}function $({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Q.jsx)(H,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Q.jsx)(lt,{size:13,"aria-hidden":!0}):(0,Q.jsx)(D,{size:13,"aria-hidden":!0}):(0,Q.jsx)(ut,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function dn({r:e}){let t=Xt(e)?G(e.lastErrorCode):null,n=Zt(e)?G(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(K.Fragment,{children:[(0,Q.jsxs)(U,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(W,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(W,{children:(0,Q.jsx)(pn,{state:e.state})}),(0,Q.jsx)(W,{children:e.instanceLabel?(0,Q.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(W,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(W,{children:e.gatewayVersion?(0,Q.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(W,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:De({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(W,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:R(e.lastOkAt)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(U,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(W,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Q.jsx)(`strong`,{children:t.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${R(e.lastErrorAt)}`:``,(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[Ie({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${R(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function fn(e){return e===`connected`?We():e===`error`?E():Ne()}function pn({state:e}){return e===`connected`?(0,Q.jsx)(P,{variant:`secondary`,children:We()}):e===`error`?(0,Q.jsx)(P,{variant:`destructive`,children:E()}):(0,Q.jsx)(P,{variant:`outline`,children:Ne()})}function mn(){return w(p.bridgeHealth.getBridgeHealth,{})}function hn(){let e=mn(),t=w(p.compat.getBridgeCompat,{}),n=w(p.me.getMe,{host:Nt})?.role===`admin`,r=w(p.admin.listInstances,n?{}:`skip`),i=w(p.agents.usageForInstances,n?{}:`skip`),a=wt(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),c=$t(e?e.targets:[],t?t.targets:[],r??[]),{section:l}=Ct({from:`/settings/bridge`}),u=wt({from:`/settings/bridge`}),d=t?.compat??null,f=t===void 0?`loading`:t===null?`nodata`:`ready`,m=d!==null&&Vt(d,`hermes`)&&!c.some(e=>e.key===`hermes`);return(0,Q.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Q.jsx)(gn,{health:e,compat:t,onSeeAnomalies:o}),(0,Q.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:g()}),i&&i.length>0?(0,Q.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Q.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:le()}),(0,Q.jsxs)(Rt,{children:[(0,Q.jsx)(V,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)(H,{children:ve()}),(0,Q.jsx)(H,{children:v()}),(0,Q.jsx)(H,{children:be()}),(0,Q.jsx)(H,{children:s()}),(0,Q.jsx)(H,{children:ct()})]})}),(0,Q.jsx)(Lt,{children:i.flatMap(e=>{let t=kt(e.usage,Date.now());return t?t.windows.map((t,n)=>(0,Q.jsxs)(U,{children:[(0,Q.jsx)(W,{className:`font-medium`,children:n===0?e.instanceName:``}),(0,Q.jsx)(W,{children:t.provider}),(0,Q.jsx)(W,{children:t.label}),(0,Q.jsx)(W,{children:(0,Q.jsxs)(P,{variant:t.percentLeft<=10?`destructive`:t.percentLeft<=25?`outline`:`secondary`,children:[t.percentLeft,`%`]})}),(0,Q.jsx)(W,{className:`text-muted-foreground`,children:t.resetText??`—`})]},`${e.instanceName}:${t.provider}:${t.label}`)):[]})})]})]}):null,c.length>0?(0,Q.jsxs)(vt,{value:c.some(e=>e.key===l)?l:c[0]?.key??`openclaw`,onValueChange:e=>void u({search:{section:e},replace:!0}),children:[(0,Q.jsx)(_t,{className:`w-full`,children:c.map(e=>(0,Q.jsxs)(ht,{value:e.key,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(bt,{size:13,"aria-hidden":!0}),J(e.key)]},e.key))}),c.map(e=>(0,Q.jsx)(gt,{value:e.key,children:(0,Q.jsx)(_n,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:d,compatStatus:f,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null})},e.key))]}):null,m?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:st()}):null]})}function gn({health:e,compat:t,onSeeAnomalies:n}){let i=t!=null&&t.buildVersion!=null&&t.bridgeVersion!=null&&t.buildVersion!==t.bridgeVersion,a=t?.buildRevision&&t.buildRevision!==`unknown`?t.buildRevision.slice(0,7):null,o=t&&t!==null?(0,Q.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:Bt(t.bridgeVersion)}),a?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsxs)(`code`,{className:`oc-traces__mono`,title:r(),children:[`(`,a,`)`]})]}):null,i?(0,Q.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,ue({build:t.buildVersion??`?`})]}):null,` · `,Te(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?C():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:f()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:h()});let s=Jt(e.targets),c=!e.reachable,u=Yt(e),d=u?`ok`:`error`,p=F(e.checkedAt),m=e.startedAt==null?null:F(e.startedAt);return(0,Q.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${d}`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:u?(0,Q.jsx)(yt,{size:22}):c?(0,Q.jsx)(qt,{size:22}):(0,Q.jsx)(A,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:u?he():c?nt():l({count:s.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Kt,{size:12,"aria-hidden":!0}),` `,pe({time:p})]}),m?(0,Q.jsx)(`span`,{children:it({time:m})}):null,o]}),c?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:G(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:ke()})]})}function _n({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a,protocol:o}){let s=r?Wt(r,e):null,c=new Map;for(let e of n)c.set(e.name,e.displayName??e.name);let l=[],u=new Set;for(let n of t){if(!n.instanceName||u.has(n.instanceName))continue;u.add(n.instanceName);let t=n.gatewayVersion??null;l.push({instanceName:n.instanceName,displayName:c.get(n.instanceName)??n.instanceName,version:t,state:Gt(t,e,r)})}let d=l.map(e=>e.state),f=d.includes(`beyond`)?`beyond`:d.length>0&&d.every(e=>e===`supported`)?`supported`:null,[p,m]=(0,K.useState)(!1);return(0,Q.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Q.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Q.jsx)(bt,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:J(e)}),f?(0,Q.jsx)(P,{variant:f===`beyond`?`destructive`:`secondary`,children:Ut(f)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:Ze()}),(0,Q.jsx)(yn,{providerName:J(e),support:s,compatStatus:i,compatReachable:a,manifest:r,instanceRows:l}),o?(0,Q.jsx)(vn,{protocol:o}):null,(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":p,onClick:()=>m(e=>!e),children:[p?(0,Q.jsx)(D,{size:13,"aria-hidden":!0}):(0,Q.jsx)(L,{size:13,"aria-hidden":!0}),at({count:t.length})]}),p?(0,Q.jsx)(un,{connections:t,displayByInstance:c}):null]})}function vn({protocol:e}){let[t,n]=(0,K.useState)(!1),r=e.coverage,i=e.drift??[];return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`h4`,{className:`oc-bridge-provider__sub`,children:[S(),i.length>0?(0,Q.jsx)(P,{variant:`destructive`,children:Be({count:i.length})}):(0,Q.jsx)(P,{variant:`secondary`,children:oe()})]}),(0,Q.jsxs)(`p`,{className:`oc-admin__hint`,children:[a({version:e.vendoredVersion}),r?` · `+Ve({handled:r.handled,ignored:r.ignored,gaps:r.gaps}):null]}),i.length>0?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:i.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.shape}),` × `,e.count]},e.shape))}):null,r&&r.gapList.length>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[t?(0,Q.jsx)(D,{size:13,"aria-hidden":!0}):(0,Q.jsx)(L,{size:13,"aria-hidden":!0}),ce({count:r.gapList.length})]}),t?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:r.gapList.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e})},e))}):null]}):null]})}function yn({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i,providerName:a}){return t===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Me()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:we()}),r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:x({provider:a})}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:Je({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:C()}),e?(0,Q.jsx)(Cn,{versions:e.validatedVersions}):null]}),i.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:_e()}):(0,Q.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Q.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:Bt(e.version)}),(0,Q.jsx)(P,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:Ut(e.state)})]},e.instanceName))})]})}function bn({instance:e,onClose:t}){return(0,Q.jsx)(Mt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(Et,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(At,{children:[(0,Q.jsx)(Ot,{children:ze({instance:e.displayName??e.name})}),(0,Q.jsx)(Dt,{children:i()})]}),(0,Q.jsx)(Sn,{instance:e,onClose:t})]})})}function xn({label:e,result:t}){return t?t.checked?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Q.jsx)(yt,{"aria-hidden":!0}):(0,Q.jsx)(A,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?ot():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,de()]}):null}function Sn({instance:e,onClose:t}){let n=Ue(p.admin.upsertInstanceConfig),r=Pe(p.bridge.validateMediaPaths),i=Pt(),a=It(e.config?.contentLocale,void 0),[s,l]=(0,K.useState)(()=>dt(e.config??{},a)),[u,f]=(0,K.useState)(!1),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),y=s.inboundMediaMode===`shared-fs`,b=s.mediaMode===`shared-fs`,x=y||b;async function oe(){g(!0),v(null);try{v(await r({instanceName:e.name,inboundMediaMode:s.inboundMediaMode,mediaMode:s.mediaMode}))}catch(e){i.error(ge(),e)}finally{g(!1)}}async function S(){f(!0);try{let r=e.config??{};await n({instanceId:e._id,config:pt(s,r,a)}),t()}catch(e){i.error(c(),e)}finally{f(!1)}}return(0,Q.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Q.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:se(),help:fe()}),(0,Q.jsxs)(N,{value:s.mediaMode,onValueChange:e=>l({...s,mediaMode:e}),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(z,{})}),(0,Q.jsx)(B,{children:mt.map(e=>(0,Q.jsx)(M,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:d(),help:rt()}),(0,Q.jsxs)(N,{value:s.inboundMediaMode,onValueChange:e=>l({...s,inboundMediaMode:e}),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(z,{})}),(0,Q.jsx)(B,{children:ft.map(e=>(0,Q.jsx)(M,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:m(),help:$e()}),(0,Q.jsx)(I,{type:`number`,min:1,max:4096,className:`w-full`,value:s.mediaMaxMb,onChange:e=>l({...s,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),x&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[y&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:Ce(),help:re()}),(0,Q.jsx)(I,{className:`w-full`,spellCheck:!1,value:s.inboundAgentMount,onChange:e=>l({...s,inboundAgentMount:e.target.value})})]}),b&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:qe(),help:ie()}),(0,Q.jsx)(I,{className:`w-full`,spellCheck:!1,value:s.outboundAgentMount,onChange:e=>l({...s,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(jt,{checked:s.rehydration,onCheckedChange:e=>l({...s,rehydration:e===!0})}),(0,Q.jsx)(O,{label:me(),help:Ee()})]}),x&&_!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:_.reachable?!_.inbound&&!_.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(A,{"aria-hidden":!0}),ne({reason:_.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xn,{label:ye(),result:_.inbound}),(0,Q.jsx)(xn,{label:o(),result:_.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:te()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(A,{"aria-hidden":!0}),ae()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[x&&(0,Q.jsxs)(k,{variant:`outline`,size:`sm`,onClick:()=>void oe(),disabled:h,children:[h?(0,Q.jsx)(Ft,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,h?xe():ee()]}),(0,Q.jsx)(k,{size:`sm`,onClick:()=>void S(),disabled:u,children:tt()})]})]})})}function Cn({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(St,{children:[(0,Q.jsx)(xt,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?b():_({count:e.length}),(0,Q.jsx)(D,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(Tt,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:Se()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(P,{variant:`secondary`,children:e},e))})]})]})}export{hn as BridgeTab,bn as InstanceConfigDialog};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$S as r,AC as i,BC as a,CC as o,DC as s,E as c,EC as l,FC as u,GS as d,HC as f,HS as p,IC as m,JS as h,Jr as ee,KS as g,Kr as _,LC as te,MC as ne,NC as re,OC as ie,PC as v,QS as y,RC as b,SC as x,TC as S,UC as C,US as w,VC as T,WS as E,XS as D,YS as O,ZS as k,_C as A,aC as j,bC as M,cC as N,dC as P,eC as F,fC as I,gC as L,hC as R,hM as z,iC as B,jC as V,kC as ae,lC as H,mC as U,mM as W,nC as G,oC as K,pC as q,qS as J,rC as oe,sC as se,tC as ce,uC as le,vC as ue,wC as de,xC as fe,yC as pe,zC as me}from"./dist-D8Kd0X5G.js";import{t as he}from"./button-Dbs-wspp.js";import{B as ge,et as _e}from"./index-Se6baszB.js";import{t as Y}from"./DataTableShell-CySP6pgB.js";var X=t(e(),1),Z=n(),ve={altered_words:()=>C(),incorrect:()=>f(),incoherence:()=>T(),formatting:()=>a(),latency:()=>me(),api_error:()=>b(),other:()=>te()},Q=e=>ve[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:u()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:v()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:m()})}function ye({data:e,closeReason:t}){let n=e.snapshot,r=W(c.feedback.respondToFeedback),[a,u]=(0,X.useState)(e.thread),[d,f]=(0,X.useState)(``),[p,m]=(0,X.useState)(!1);async function g(){let t=d.trim();if(!(!t||p)){m(!0);try{await r({feedbackId:e._id,text:t}),u(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),f(``)}finally{m(!1)}}}let _=[];try{_=n.contextJson?JSON.parse(n.contextJson):[]}catch{_=[]}return(0,Z.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Z.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,Z.jsx)($,{matches:n.displayedMatchesStored,sourceWasOpen:n.clientInfo?.sourceWasOpen??!1}),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,n.messageRole,n.isRegeneration?` · ${re()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ne()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,t?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:h()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:t})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:V()}),a.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:a.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Z.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?i():e.authorRole===`agent`?e.authorLabel??ee():ae()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:ie()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:s(),value:d,maxLength:2e3,rows:3,onChange:e=>f(e.target.value.slice(0,2e3))}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Z.jsx)(he,{size:`sm`,onClick:()=>void g(),disabled:!d.trim()||p,children:p?l():S()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:de()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||o()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:x()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||o()})]}):null,n.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:fe()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,_.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:M({count:n.contextCount??_.length,truncated:n.contextTruncated?pe():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:_.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,n.outboxAvailable?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ue()}),(0,Z.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,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:A()}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,children:n.clientInfo.extensionsDetected.map(e=>(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:L()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?R({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,Z.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[U(),` `,n.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,q()]})]}):null,n.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function be(){let e=z(c.feedback.listForAdmin,{}),t=W(c.feedback.readSnapshot),n=W(c.feedback.deleteFeedback),i=ge(),[a,o]=(0,X.useState)(null),[s,l]=(0,X.useState)({});async function u(e){if(a===e._id){o(null);return}if(!s[e._id]){let n=await t({feedbackId:e._id});l(t=>({...t,[e._id]:n}))}o(e._id)}async function f(e){await i({title:E(),description:w(),confirmLabel:p(),destructive:!0})&&(await n({feedbackId:e._id}),a===e._id&&o(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[I(),` `,(0,Z.jsx)(`strong`,{children:P()}),` `,le()]}),(0,Z.jsx)(Y,{title:H(),rows:e,emptyHint:N(),isExpanded:e=>a===e._id&&!!s[e._id],renderExpanded:e=>s[e._id]?(0,Z.jsx)(ye,{data:s[e._id],closeReason:e.userCloseReason}):null,columns:[{header:se(),cell:e=>_e(e.at),sort:e=>e.at},{header:K(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:j(),cell:e=>e.messageRole===`user`?B():oe(),sort:e=>e.messageRole},{header:G(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${ce({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:F(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:r(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:y(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:k()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:D()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:_()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:O()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:a===e._id?J():g(),onSelect:()=>void u(e)},{label:d(),onSelect:()=>void f(e),variant:`destructive`}]})]})}export{be as FeedbacksTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Aj as ee,Bj as te,Cj as r,Dj as i,E as a,Ej as o,Fj as s,HE as ne,Ij as c,Lj as l,Mj as re,Nj as u,Oj as d,Pj as f,Qr as p,Rj as ie,Sj as ae,Tj as m,Zr as oe,_j as se,aj as ce,bj as le,cM as ue,cj as de,dj as fe,fj as pe,gj as me,hM as he,hj as ge,jj as _e,kj as h,lj as ve,mM as ye,mj as be,oM as xe,oj as Se,pj as g,sj as _,uj as v,vj as y,wj as b,xj as x,yj as S,zj as C}from"./dist-D8Kd0X5G.js";import{t as w}from"./button-Dbs-wspp.js";import{C as T,Ft as E,G as D,H as O,Ht as k,J as A,K as j,S as M,U as Ce,Ut as N,W as we,Y as Te,b as P,ct as F,it as I,jt as Ee,nt as De,p as Oe,q as ke,rt as Ae,st as je,w as L,x as R,z as Me}from"./index-Se6baszB.js";import{a as Ne,i as z,n as Pe,o as B,r as V,t as Fe}from"./table-RDie4v3L.js";var H=t(e(),1),U=n(),W=`all`;function G(e){switch(e){case`image`:return h();case`audio`:return d();case`video`:return i();case`pdf`:return o();case`document`:return m();case`archive`:return b();default:return r()}}function K(){let[e,t]=(0,H.useState)(W),[n,r]=(0,H.useState)(W),[i,o]=(0,H.useState)(W),[d,m]=(0,H.useState)(W),[h,b]=(0,H.useState)(!1),[K,q]=(0,H.useState)(null),J=ye(a.files.softDelete),Y=Me();function Ie(){t(W),r(W),o(W),m(W)}async function Le(){let e=K;if(q(null),e)try{await J({fileId:e.id}),Y.success(pe())}catch(e){Y.error(fe(),e)}}let X=he(a.files.listMine,{direction:e===W?void 0:e,chatId:n===W?void 0:n,instanceName:i===W?void 0:i,category:d===W?void 0:d,includeAutoGenerated:h||void 0}),Re=(0,H.useMemo)(()=>new Intl.DateTimeFormat(ue(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:xe()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==W||n!==W||i!==W||d!==W;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:te()}),(0,U.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,U.jsxs)(P,{value:e,onValueChange:t,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":C(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:ie()}),(0,U.jsx)(M,{value:`inbound`,children:l()}),(0,U.jsx)(M,{value:`outbound`,children:c()})]})]}),(0,U.jsxs)(P,{value:n,onValueChange:r,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":s(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:f()}),Q.chats.map(e=>(0,U.jsx)(M,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,U.jsxs)(P,{value:i,onValueChange:o,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":u(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:re()}),Q.instances.map(e=>(0,U.jsx)(M,{value:e,children:e},e))]})]}):null,(0,U.jsxs)(P,{value:d,onValueChange:m,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":_e(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:ee()}),Q.categories.map(e=>(0,U.jsx)(M,{value:e,children:G(e)},e))]})]}),(0,U.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,U.jsx)(Oe,{checked:h,onCheckedChange:e=>b(e===!0),"aria-label":p()}),(0,U.jsx)(`span`,{children:p()})]}),$?(0,U.jsxs)(w,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,U.jsx)(E,{size:14,"aria-hidden":!0}),ge()]}):null]}),Z.length===0?(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:$?Se():_()}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Fe,{children:[(0,U.jsx)(Ne,{children:(0,U.jsxs)(B,{children:[(0,U.jsx)(z,{children:ae()}),(0,U.jsx)(z,{children:x()}),(0,U.jsx)(z,{children:le()}),(0,U.jsx)(z,{children:S()}),(0,U.jsx)(z,{children:y()}),(0,U.jsx)(z,{className:`text-right`,children:se()})]})}),(0,U.jsx)(Pe,{children:Z.map(e=>(0,U.jsxs)(B,{children:[(0,U.jsxs)(V,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:[e.filename,e.origin===`pasted`?(0,U.jsx)(F,{variant:`outline`,style:{marginLeft:6},children:oe()}):null]}),(0,U.jsx)(V,{title:e.mimeType,children:G(e.category)}),(0,U.jsx)(V,{children:(0,U.jsx)(F,{variant:`secondary`,children:e.direction===`inbound`?l():c()})}),(0,U.jsx)(V,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,U.jsx)(V,{className:`whitespace-nowrap text-muted-foreground`,children:Re.format(e.createdAt)}),(0,U.jsx)(V,{className:`text-right`,children:(0,U.jsxs)(De,{children:[(0,U.jsx)(je,{asChild:!0,children:(0,U.jsx)(w,{variant:`ghost`,size:`icon`,"aria-label":be(),children:(0,U.jsx)(k,{size:16})})}),(0,U.jsxs)(Ae,{align:`end`,children:[e.url?(0,U.jsx)(I,{asChild:!0,children:(0,U.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,U.jsx)(N,{size:14}),me()]})}):(0,U.jsxs)(I,{disabled:!0,children:[(0,U.jsx)(N,{size:14}),de()]}),(0,U.jsxs)(I,{variant:`destructive`,onSelect:()=>q({id:e._id,filename:e.filename}),children:[(0,U.jsx)(Ee,{size:14}),g()]})]})]})})]},e._id))})]}),ze?(0,U.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:ce({cap:Be})}):null]}),(0,U.jsx)(O,{open:K!==null,onOpenChange:e=>!e&&q(null),children:(0,U.jsxs)(D,{children:[(0,U.jsxs)(A,{children:[(0,U.jsx)(Te,{children:v()}),(0,U.jsx)(j,{children:ve()})]}),(0,U.jsxs)(ke,{children:[(0,U.jsx)(we,{children:ne()}),(0,U.jsx)(Ce,{onClick:()=>void Le(),children:g()})]})]})})]})}export{K as FilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,$i as i,$x as a,Ab as o,Ax as s,Bb as c,Bx as l,Cx as u,Dx as d,E as f,Ex as p,FD as m,Fb as h,Fx as g,Gb as _,Gx as v,Hb as y,Hx as b,Ib as x,Ix as S,Jb as ee,Jt as C,Jx as w,Kb as T,Kx as E,Lb as te,Lx as ne,Mb as re,Mx as ie,Nb as ae,Nx as oe,Ob as se,Ox as ce,PD as le,Pb as ue,Px as de,Qb as fe,Qi as pe,Qx as me,Rb as he,Rx as ge,Sx as _e,Tx as ve,Ub as ye,Ux as be,Vb as xe,Vx as Se,Wb as Ce,Wx as we,Xb as Te,Xt as Ee,Xx as De,Yb as D,Yt as Oe,Yx as ke,Zb as Ae,Zi as je,Zx as Me,_x as Ne,aS as Pe,ax as Fe,bg as Ie,bx as O,cS as Le,cx as Re,dS as ze,dx as Be,eS as k,ea as Ve,ex as A,fM as j,fS as He,fx as Ue,gx as We,hM as M,hx as Ge,iS as Ke,ix as qe,jb as Je,jx as Ye,kb as Xe,kx as Ze,lS as Qe,lx as $e,mM as N,mS as et,mx as tt,nS as nt,nx as rt,oS as it,ox as at,pS as ot,px as st,qb as ct,qx as lt,rS as ut,rx as dt,sS as ft,sx as pt,tS as mt,tx as ht,uS as gt,ux as _t,vx as vt,wx as yt,xx as bt,yg as xt,yx as St,zb as Ct,zx as wt}from"./dist-D8Kd0X5G.js";import{a as Tt,c as Et}from"./FieldLabel-CyXK3G_H.js";import{t as P}from"./button-Dbs-wspp.js";import{B as Dt,C as F,Q as Ot,S as I,X as kt,Z as At,b as L,ct as R,dt as z,ft as B,ht as V,lt as H,mt as U,p as W,u as jt,ut as G,w as K,x as q,z as J}from"./index-Se6baszB.js";import{t as Mt}from"./DataTableShell-CySP6pgB.js";import{InstanceConfigDialog as Nt}from"./BridgeTab-BHnMaTub.js";var Y=t(e(),1),X=[`conversational`,`documentary`,`summarizer`,`curator`],Pt=new Set(X),Ft=`conversational`;function It(e){let t=new Set((e??[]).filter(e=>Pt.has(e)));return t.size===0?[Ft]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,transport:`ws`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:Tt},Lt={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Rt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,transport:e.transport??`ws`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function zt(){let e=M(f.admin.listInstances,{}),t=M(f.agents.listAllInstanceAgents,{}),n=N(f.admin.upsertInstance),r=N(f.admin.deleteInstance),i=J(),[o,s]=(0,Y.useState)(!1),[c,u]=(0,Y.useState)(Q),[d,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(null);async function S(){try{await n({instanceId:y??void 0,name:c.name,gatewayUrl:c.gatewayUrl,bridgeUrl:c.bridgeUrl||void 0,displayName:c.displayName||void 0,kind:c.kind,transport:c.kind===`hermes`?c.transport:void 0,gatewayVersion:c.gatewayVersion||void 0,gatewayHttpUrl:c.gatewayHttpUrl||void 0,streamTransport:c.streamTransport}),u(Q),x(null),s(!1)}catch(e){i.error(He(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[ze(),(0,Z.jsx)(`strong`,{children:gt()}),Qe()]}),(0,Z.jsx)(Mt,{title:Le(),rows:e,addLabel:ft(),onAdd:()=>{x(null),u(Q),s(!0)},emptyHint:it(),columns:[{header:Pe(),cell:e=>e.name,sort:e=>e.name},{header:Ke(),cell:e=>(0,Z.jsx)(R,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:ut(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:nt(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:et(),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)(R,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?Xe():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:me(),onSelect:()=>{x(e._id),u(Rt(e)),s(!0)}},{label:ot(),onSelect:()=>p(e.name)},{label:ne(),onSelect:()=>_(e)},{label:mt(),onSelect:()=>h(e)},{label:k(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:k(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(jt,{open:o,onOpenChange:s,title:y?Me():a(),description:ke(),canSubmit:!!(c.name&&c.gatewayUrl),onSubmit:S,submitLabel:w(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:lt(),children:[(0,Z.jsx)(H,{value:c.name,disabled:y!==null,onChange:e=>u({...c,name:e.target.value})}),y?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:De()}):null]}),(0,Z.jsx)($,{label:E(),children:(0,Z.jsxs)(L,{value:c.kind,onValueChange:e=>u({...c,kind:e}),children:[(0,Z.jsx)(F,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(K,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(I,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(I,{value:`hermes`,children:`Hermes`})]})]})}),c.kind===`hermes`?(0,Z.jsx)($,{label:Ee(),children:(0,Z.jsxs)(L,{value:c.transport,onValueChange:e=>u({...c,transport:e}),children:[(0,Z.jsx)(F,{size:`sm`,className:`w-56`,children:(0,Z.jsx)(K,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(I,{value:`ws`,children:Oe()}),(0,Z.jsx)(I,{value:`rest`,children:C()})]})]})}):null,(0,Z.jsx)($,{label:v(),children:(0,Z.jsx)(H,{value:c.gatewayUrl,onChange:e=>u({...c,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:we(),children:(0,Z.jsx)(H,{value:c.bridgeUrl,placeholder:be(),onChange:e=>u({...c,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:b(),children:(0,Z.jsx)(H,{value:c.displayName,onChange:e=>u({...c,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:Ie(),children:[(0,Z.jsxs)(L,{value:c.streamTransport,onValueChange:e=>u({...c,streamTransport:e}),children:[(0,Z.jsx)(F,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(K,{})}),(0,Z.jsx)(q,{children:Et.map(e=>(0,Z.jsx)(I,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:xt()})]}),(0,Z.jsx)($,{label:Se(),children:(0,Z.jsx)(H,{value:c.gatewayVersion,placeholder:l(),onChange:e=>u({...c,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:wt(),children:(0,Z.jsx)(H,{value:c.gatewayHttpUrl,placeholder:ge(),onChange:e=>u({...c,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Yt,{instanceName:d,open:d!==null,onOpenChange:e=>{e||p(null)}}),m?(0,Z.jsx)(Nt,{instance:m,onClose:()=>h(null)},m._id):null,g?(0,Z.jsx)(Bt,{instance:g,onClose:()=>_(null)},g._id):null]})}function Bt({instance:e,onClose:t}){let n=M(f.instanceSecrets.listInstanceSecretStatus,{}),r=Lt[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)(G,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(z,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(U,{children:[(0,Z.jsx)(V,{children:S({instance:e.displayName??e.name})}),(0,Z.jsx)(B,{children:g()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Ut,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Ht,{instance:e})}),(0,Z.jsx)(Vt,{instance:e})]})})}function Vt({instance:e}){let t=j(f.instanceSync.forceInstanceSync),n=J(),[r,i]=(0,Y.useState)(!1);async function a(){if(!r){i(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(Ge());break;case`no_agents`:n.success(st());break;case`no_bridge_url`:n.error(Ue());break;case`deploy_misconfigured`:n.error(Be());break;case`unauthorized`:n.error($e());break;case`not_served`:n.error(Re());break;default:n.error(_t());break}}catch(e){n.error(tt(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:pt()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(P,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?We():Ne()})})]})}function Ht({instance:e}){let t=M(f.bridgeAuth.listBridgeAuthStatus,{}),n=j(f.bridgeAuth.mintBridgeSecret),i=N(f.bridgeAuth.revokeBridgeSecret),a=J(),[o,c]=(0,Y.useState)(!1),[l,u]=(0,Y.useState)(null),[d,p]=(0,Y.useState)(!1),h=(t??[]).find(t=>t.instanceId===e._id),g=h!==void 0;async function _(){if(!o){c(!0);try{u((await n({instanceId:e._id})).plaintext),p(!1)}catch(e){a.error(A(),e)}finally{c(!1)}}}async function v(){if(!o){c(!0);try{await i({instanceId:e._id}),u(null),a.success(ht())}catch(e){a.error(A(),e)}finally{c(!1)}}}async function y(){if(l)try{await navigator.clipboard.writeText(l),p(!0)}catch{}}return(0,Z.jsxs)($,{label:at(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(R,{variant:g?`outline`:`secondary`,children:g?`${Ye()} · ${h.prefix}…${h.lastFour}`:s()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(P,{size:`sm`,onClick:()=>void _(),disabled:o,children:g?dt():qe()}),g?(0,Z.jsx)(P,{size:`sm`,variant:`destructive`,onClick:()=>void v(),disabled:o,children:rt()}):null]})]}),l?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:r()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:l}),(0,Z.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void y(),children:d?m():le()})]}),(0,Z.jsx)(P,{size:`sm`,variant:`ghost`,onClick:()=>{u(null),p(!1)},children:fe()})]}):null]})}function Ut({instanceId:e,field:t,updatedAt:n}){let r=j(f.instanceSecrets.setInstanceSecret),i=N(f.instanceSecrets.clearInstanceSecret),a=j(f.deviceIdentity.generateDeviceIdentity),o=J(),[c,l]=(0,Y.useState)(``),[h,g]=(0,Y.useState)(!1),[_,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(!1),x=n!==null,S=t===`deviceIdentity`,ee=t===`token`?de():t===`deviceIdentity`?oe():ie();async function C(){if(!(!c.trim()||h)){g(!0);try{await r({instanceId:e,field:t,plaintext:c}),l(``),v(null),b(!1),o.success(ve())}catch(e){o.error(yt(),e)}finally{g(!1)}}}async function w(){if(!h){g(!0);try{await i({instanceId:e,field:t}),v(null),b(!1),o.success(u())}catch(e){o.error(yt(),e)}finally{g(!1)}}}async function T(){if(!h){g(!0);try{v(await a({instanceId:e})),b(!1),o.success(O())}catch(e){o.error(vt(),e)}finally{g(!1)}}}let E=_?`openclaw devices approve ${_.id}`:``;async function te(){if(E)try{await navigator.clipboard.writeText(E),b(!0)}catch{}}return(0,Z.jsxs)($,{label:ee,children:[S?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:bt()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(R,{variant:x?`outline`:`secondary`,children:x?Ye():s()}),(0,Z.jsx)(H,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:c,placeholder:x?ce():Ze(),onChange:e=>l(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(P,{size:`sm`,onClick:()=>void C(),disabled:h||c.trim().length===0,children:d()}),S?(0,Z.jsx)(P,{size:`sm`,variant:`outline`,onClick:()=>void T(),disabled:h,children:_e()}):null,x?(0,Z.jsx)(P,{size:`sm`,variant:`destructive`,onClick:()=>void w(),disabled:h,children:p()}):null]})]}),_?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:O()}),(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:E}),(0,Z.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void te(),children:y?m():le()})]}),(0,Z.jsx)(P,{size:`sm`,variant:`ghost`,onClick:()=>{v(null),b(!1)},children:fe()})]}):null]})}var Wt={conversational:Ce,documentary:y,summarizer:Ve,curator:pe},Gt={conversational:ye,documentary:xe,summarizer:i,curator:je},Kt=e=>(Wt[e]??(()=>e))(),qt=e=>(Gt[e]??(()=>``))();function Jt({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:ee()}),t.map(e=>(0,Z.jsx)(R,{variant:`secondary`,className:`oc-agenttype__chip`,title:qt(e),children:Kt(e)},e)),(0,Z.jsxs)(kt,{children:[(0,Z.jsx)(Ot,{asChild:!0,children:(0,Z.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:ct()})}),(0,Z.jsxs)(At,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:T()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:_()}),(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)(W,{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:Kt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:qt(r)})]})]},r)})})]})]})]})}function Yt({instanceName:e,open:t,onOpenChange:n}){let r=M(f.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=N(f.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(f.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(f.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=N(f.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(f.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(f.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),s=N(f.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(f.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=It(r);e.setQuery(f.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),l=N(f.agents.removeInstanceAgent),u=Dt(),d=J();async function p(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){d.error(D(),e)}}async function m(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){d.error(D(),e)}}async function g(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await s({instanceName:e,agentId:t,types:i})}catch(e){d.error(D(),e)}}async function _(t,n){if(e&&await u({title:he({name:n}),description:te(),confirmLabel:x(),destructive:!0}))try{await l({instanceName:e,agentId:t}),d.success(h())}catch(e){d.error(D(),e)}}return(0,Z.jsx)(G,{open:t,onOpenChange:n,children:(0,Z.jsxs)(z,{className:`oc-access`,children:[(0,Z.jsxs)(U,{children:[(0,Z.jsx)(V,{children:Ae({name:e??``})}),(0,Z.jsx)(B,{children:Te()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:ue()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?ae():r.discovery.lastPollOk?re():Je({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:o()}):(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,a=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)(W,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void p(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)(R,{variant:`outline`,className:`oc-access__gone`,children:se()}),(0,Z.jsx)(P,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void _(e.agentId,i),children:Ct()})]}):n?(0,Z.jsx)(R,{variant:`default`,children:Xe()}):(0,Z.jsx)(P,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void m(e.agentId),children:c()})]}),e.enabled?(0,Z.jsx)(Jt,{agentId:e.agentId,types:a,onToggle:t=>void g(e.agentId,t,a)}):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{zt as InstancesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,E as i,GC as a,JC as o,KC as s,QC as c,WC as l,XC as u,YC as d,ZC as f,_o as p,bo as m,ew as h,fM as g,go as _,hM as v,ho as y,mM as b,mo as x,nw as S,po as C,qC as w,rw as T,tw as E,vo as D,xo as O,yo as k}from"./dist-D8Kd0X5G.js";import{t as A}from"./button-Dbs-wspp.js";import{ct as j,lt as M,p as N}from"./index-Se6baszB.js";var P=t(e(),1),F=n();function I(){let e=v(i.integrations.status.status,{}),t=b(i.admin.setIntegrationConfig),[n,p]=(0,P.useState)(null);if((0,P.useEffect)(()=>{e&&n===null&&p(e.config)},[e,n]),!e||!n)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:T()});let g=n,_=(e,t,n)=>p({...g,[e]:{...g[e],[t]:n}}),y=(e,n)=>void t({[e]:n});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[S(),` `,(0,F.jsx)(`strong`,{children:E()}),` `,h()]}),(0,F.jsxs)(L,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,F.jsx)(j,{variant:`secondary`,children:r()}):(0,F.jsx)(j,{variant:`outline`,children:c()}):(0,F.jsx)(j,{variant:`outline`,children:f()}),note:u(),children:[(0,F.jsx)(R,{label:o(),children:(0,F.jsx)(M,{value:g.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>_(`langfuse`,`host`,e.target.value),onBlur:()=>y(`langfuse`,{host:g.langfuse.host??``})})}),(0,F.jsx)(z,{label:l(),checked:g.langfuse.enabled??!0,onChange:e=>{_(`langfuse`,`enabled`,e),y(`langfuse`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,F.jsx)(j,{variant:`secondary`,children:r()}):(0,F.jsx)(j,{variant:`outline`,children:c()}):(0,F.jsx)(j,{variant:`outline`,children:f()}),note:d(),children:[(0,F.jsx)(R,{label:w(),children:(0,F.jsx)(M,{value:g.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>_(`opik`,`baseUrl`,e.target.value),onBlur:()=>y(`opik`,{baseUrl:g.opik.baseUrl??``})})}),(0,F.jsx)(R,{label:s(),children:(0,F.jsx)(M,{value:g.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||a(),onChange:e=>_(`opik`,`workspace`,e.target.value),onBlur:()=>y(`opik`,{workspace:g.opik.workspace??``})})}),(0,F.jsx)(z,{label:l(),checked:g.opik.enabled??!0,onChange:e=>{_(`opik`,`enabled`,e),y(`opik`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,F.jsx)(j,{variant:`secondary`,children:r()}):(0,F.jsx)(j,{variant:`outline`,children:c()}):(0,F.jsx)(j,{variant:`outline`,children:O()}),note:m(),children:[(0,F.jsx)(R,{label:k(),children:(0,F.jsx)(M,{value:g.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>_(`otlp`,`endpoint`,e.target.value),onBlur:()=>y(`otlp`,{endpoint:g.otlp.endpoint??``})})}),(0,F.jsx)(B,{headersSet:e.otlp.headersSet}),(0,F.jsx)(z,{label:l(),checked:g.otlp.enabled??!0,onChange:e=>{_(`otlp`,`enabled`,e),y(`otlp`,{enabled:e})}})]})]})}function L({title:e,status:t,note:n,children:r}){return(0,F.jsxs)(`section`,{className:`oc-int__section`,children:[(0,F.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,F.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,F.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function R({label:e,children:t}){return(0,F.jsxs)(`label`,{className:`oc-int__field`,children:[(0,F.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function z({label:e,checked:t,onChange:n}){return(0,F.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,F.jsx)(N,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,F.jsx)(`span`,{children:e})]})}function B({headersSet:e}){let t=g(i.integrations.otlpSecret.setOtlpHeaders),n=b(i.integrations.otlpSecret.clearOtlpHeaders),[r,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(null),[c,l]=(0,P.useState)(!1),u=async()=>{l(!0),s(null);try{await t({headersJson:r}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}};return(0,F.jsxs)(R,{label:D(),children:[(0,F.jsx)(M,{value:r,placeholder:e?p():_(),onChange:e=>a(e.target.value)}),(0,F.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,F.jsx)(A,{size:`sm`,disabled:c||r.trim().length===0,onClick:()=>void u(),children:y()}),e?(0,F.jsx)(A,{variant:`ghost`,size:`sm`,disabled:c,onClick:()=>void n({}),children:x()}):null]}),o?(0,F.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:o}):null,(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:C()})]})}export{I as IntegrationsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$O as r,A as i,Ak as a,Ck as o,Dk as s,E as c,Ek as l,F as u,G as d,Gj as ee,Hj as te,I as ne,JO as re,Jj as ie,Jx as ae,Kj as oe,L as se,M as ce,Mk as le,N as f,Nk as p,Ok as ue,P as de,Pk as fe,QO as pe,Qj as me,Sk as he,Tk as ge,Uj as _e,Wj as m,X as h,XO as g,Xj as _,YO as v,Yj as y,Z as b,ZO as x,Zj as S,_k as C,ak as w,bk as T,ck as E,dk as D,ek as O,fk as k,gk as A,hM as j,hk as M,ik as N,j as P,jk as F,kk as I,lk as ve,mM as L,mk as ye,n as R,nk as z,oM as be,ok as B,pk as xe,qO as Se,qj as Ce,rk as we,sk as Te,tM as Ee,tk as V,uk as De,vk as Oe,wk as ke,xk as Ae,yk as je}from"./dist-D8Kd0X5G.js";import{t as H}from"./button-Dbs-wspp.js";import{A as Me,C as Ne,S as U,b as Pe,bt as Fe,ct as W,lt as G,p as K,vt as Ie,w as Le,x as Re,xt as q,yt as ze,z as Be}from"./index-Se6baszB.js";import{t as Ve}from"./localePickerView-C2RmOS86.js";var J=t(e(),1),Y=n();function He({className:e,checked:t,onCheckedChange:n,disabled:r,...i}){return(0,Y.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"data-state":t?`checked`:`unchecked`,disabled:r,onClick:()=>n(!t),className:R(`peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent transition-colors outline-none`,`focus-visible:ring-2 focus-visible:ring-ring/50`,`disabled:cursor-not-allowed disabled:opacity-50`,t?`bg-primary`:`bg-input`,e),...i,children:(0,Y.jsx)(`span`,{className:R(`pointer-events-none block size-4 rounded-full bg-background shadow transition-transform`,t?`translate-x-[18px]`:`translate-x-[2px]`)})})}var X=[{id:`messages`,label:()=>fe()},{id:`composer`,label:()=>p()},{id:`sidebar`,label:()=>le()},{id:`notifications`,label:()=>xe()},{id:`other`,label:()=>F()}],Z={showSource:{category:`messages`,label:()=>a(),help:()=>I()},showReport:{category:`messages`,label:()=>ue(),help:()=>s()},copyAssistant:{category:`messages`,label:()=>l()},copyUser:{category:`messages`,label:()=>ge()},showDelete:{category:`messages`,label:()=>ke()},showTools:{category:`messages`,label:()=>o(),help:()=>he()},voiceInput:{category:`composer`,label:()=>Ae(),help:()=>T()},showUsage:{category:`composer`,label:()=>je(),help:()=>Oe()},autoReadAloud:{category:`composer`,label:()=>b(),help:()=>h()},showChatAge:{category:`sidebar`,label:()=>C(),help:()=>A()},showChatProvider:{category:`sidebar`,label:()=>M(),help:()=>ye()},notifSound:{category:`notifications`,label:()=>k(),help:()=>D()},notifSystem:{category:`notifications`,label:()=>De(),help:()=>ve()},replySound:{category:`notifications`,label:()=>E(),help:()=>Te()}};function Q(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function Ue(e,t){let n=Q(t.trim()),r=new Map(X.map(e=>[e.id,e.label()])),i=new Map(X.map(e=>[e.id,[]]));for(let t of e){let e=Z[t],a=e?.category??`other`;n&&!Q(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return X.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var We=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`,`showUsage`,`autoReadAloud`,`notifSound`,`notifSystem`,`replySound`],Ge={voiceInput:`voiceInput`};function Ke(e){return We.includes(e)}function $(e){return e===`admin`}function qe(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Je(e){return e===`on`?!0:e===`off`?!1:null}function Ye(e){return Ke(e)?Ge[e]:void 0}var Xe={voiceInput:()=>x()};function Ze({prefKey:e,ui:t}){let n=L(c.admin.setUiPrefDefault),r=L(c.admin.setFeatureEnabled),i=Ye(e),a=i?Xe[e]?.():void 0;return(0,Y.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,Y.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,Y.jsx)(`span`,{className:`oc-prefs__gov-label`,children:V()}),(0,Y.jsxs)(Pe,{value:qe(t.defaults[e]),onValueChange:t=>void n({key:e,value:Je(t)}),children:[(0,Y.jsx)(Ne,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(Le,{})}),(0,Y.jsxs)(Re,{children:[(0,Y.jsx)(U,{value:`on`,children:v()}),(0,Y.jsx)(U,{value:`off`,children:re()}),(0,Y.jsx)(U,{value:`inherit`,children:Se()})]})]}),i?(0,Y.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,Y.jsx)(K,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":O()}),O()]}):null]}),a?(0,Y.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function Qe({current:e,enabled:t}){let n=L(c.me.setDictationShortcut),[r,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{if(!r)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){a(!1);return}let t=ze(e);if(t===null){[`Shift`,`Control`,`Meta`,`Alt`].includes(e.key)||(s(!0),window.setTimeout(()=>s(!1),1800));return}a(!1),n({shortcut:t})};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[r,n]),(0,Y.jsxs)(`div`,{className:`oc-prefs__row${t?``:` is-locked`}`,children:[(0,Y.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,Y.jsxs)(`span`,{className:`oc-prefs__label`,children:[se(),e?(0,Y.jsx)(W,{variant:`secondary`,children:Fe(e,Ie())}):null]}),(0,Y.jsx)(`span`,{className:`oc-prefs__help`,children:o?de():r?u():ne()})]}),(0,Y.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[e&&!r?(0,Y.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void n({shortcut:null}),children:i()}):null,(0,Y.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,disabled:!t,"aria-pressed":r,onClick:()=>a(e=>!e),children:r?P():e?ce():f()})]})]})}function $e(){let[e,t]=(0,J.useState)(``),[n,i]=(0,J.useState)(!1),a=j(c.me.getMe,{host:q}),o=a?.ui,s=$(a?.role)&&n,l=L(c.me.setUiPref).withOptimisticUpdate(Me),u=(0,J.useMemo)(()=>o?Ue(Object.keys(o.effective),e):[],[o,e]);return o?(0,Y.jsxs)(`div`,{className:`oc-prefs-panel`,children:[$(a?.role)?(0,Y.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,Y.jsx)(K,{checked:n,onCheckedChange:e=>i(e===!0),"aria-label":z()}),z()]}):null,s?(0,Y.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,Y.jsx)(`p`,{children:r()}),(0,Y.jsx)(`p`,{children:pe()}),(0,Y.jsx)(`p`,{children:g()})]}):null,(0,Y.jsx)(G,{value:e,onChange:e=>t(e.target.value),placeholder:B(),"aria-label":B(),className:`mb-2`}),u.length===0?(0,Y.jsx)(`div`,{className:`oc-prefs__empty`,children:w()}):(0,Y.jsx)(`div`,{className:`oc-prefs`,children:u.map(e=>(0,Y.jsxs)(`section`,{className:`oc-prefs__card`,children:[(0,Y.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Z[e],n=t?t.label():e,r=t?.help?.(),i=o.locked[e],a=o.effective[e],c=o.userOverrides[e]!==void 0;return(0,Y.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}`,children:[(0,Y.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,Y.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,Y.jsx)(W,{variant:`outline`,children:N()}):c?(0,Y.jsx)(W,{variant:`secondary`,children:d()}):null]}),r?(0,Y.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,Y.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&c?(0,Y.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void l({key:e,value:null}),children:we()}):null,(0,Y.jsx)(He,{checked:a,disabled:i,onCheckedChange:t=>{e===`notifSystem`&&t&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission(),l({key:e,value:t})},"aria-label":n})]}),s?(0,Y.jsx)(Ze,{prefKey:e,ui:o}):null]},e)})]},e.id))}),(0,Y.jsx)(Qe,{current:a?.dictationShortcut??null,enabled:o.effective.voiceInput===!0})]}):(0,Y.jsx)(`div`,{className:`oc-prefs__empty`,children:be()})}function et(){let e=j(c.me.getMe,{host:q}),t=L(c.me.setLocale),n=L(c.me.setMyName),r=Be(),i=e?.locale??`default`,a=e?.name??``,[o,s]=(0,J.useState)(null),l=o??a,u=l.trim()!==a.trim();async function d(){try{await n({name:l}),s(null),r.success(ie())}catch(e){r.error(Ce(),e)}}return(0,Y.jsxs)(`div`,{className:`oc-appearance`,children:[(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:me()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:S()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(G,{className:`max-w-xs`,value:l,maxLength:120,placeholder:_(),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u&&(e.preventDefault(),d())}}),(0,Y.jsx)(H,{size:`sm`,disabled:!u,onClick:()=>void d(),children:ae()})]}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:y()})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:oe()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ee()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[Ve().map(e=>(0,Y.jsx)(H,{variant:i===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,Y.jsx)(H,{variant:i==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:Ee()})]}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:m()})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:_e()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:te()})]}),(0,Y.jsx)($e,{})]})]})}export{et as PreferencesTab};
@@ -1,4 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,$t as i,Cg as a,E as o,Qh as s,Qt as c,Zh as l,Zt as u,_r as d,aa as f,ag as p,br as m,cg as h,dg as g,eg as _,fg as v,gg as y,gr as b,hM as x,hg as S,ia as C,ig as w,lg as T,mM as ee,mg as E,na as D,ng as te,og as ne,pg as re,ra as ie,rg as ae,sg as O,ta as k,tg as A,ug as j,vr as M,wg as N,xr as P,yr as F}from"./dist-D8Kd0X5G.js";import{d as I,f as L,i as R,l as z,n as B,r as V,t as H,u as U}from"./FieldLabel-CyXK3G_H.js";import{t as W}from"./button-Dbs-wspp.js";import{C as G,S as K,b as q,p as J,w as Y,x as X,xt as oe,z as se}from"./index-Se6baszB.js";import{r as Z,t as ce}from"./locales-CPjguROj.js";import{t as le}from"./localePickerView-C2RmOS86.js";/* empty css */var Q=t(e(),1),$=n(),ue={media_delivery:{label:g,help:j},documentary_fetch:{label:T,help:h},inbound_files:{label:O,help:ne},history_summary:{label:f,help:C},file_curation:{label:P,help:m}},de={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
2
- - gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`,previous_summary:`Projet Alpha : budget 40 000 EUR ; choix du serveur en cours.`,new_messages:`Utilisateur : Compare OVH et Scaleway.
3
- Assistant : Comparaison en cours.`,max_chars:`6000`,file_name:`MEMORY.md`,budget_chars:`20000`,feedback:`Trop de suppressions dans la section des liens, garde-les.`,content:`# Memory index
4
- - [Fait 1](fait-1.md) - note du projet`},fe={outboundDir:r,references:s,files:l,previous_summary:ie,new_messages:D,max_chars:k,file_name:F,budget_chars:M,feedback:d,content:b};function pe(){let e=x(o.admin.listInstances,{}),[t,n]=(0,Q.useState)(null);if(e===void 0)return(0,$.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,$.jsx)(`div`,{className:`oc-injtab`,children:(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:w()})});let r=e.find(e=>e._id===t)??e[0];return(0,$.jsxs)(`div`,{className:`oc-injtab`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,$.jsx)(B,{label:y(),help:S()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:p()}),(0,$.jsxs)(q,{value:r._id,onValueChange:e=>n(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(Y,{})}),(0,$.jsx)(X,{children:e.map(e=>(0,$.jsx)(K,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(me,{instance:r},r._id)]})}function me({instance:e}){let t=ee(o.admin.upsertInstanceConfig),n=se(),r=x(o.me.getMe,{host:oe}),s=e.config??{},l=Z(e.config?.contentLocale,r?.defaultLocale??void 0),[d,f]=(0,Q.useState)(()=>R(s,l));(0,Q.useEffect)(()=>{f(R(s,l))},[l,e._id]);let[p,m]=(0,Q.useState)(!1),h=d.promptInjections,g=(e,t)=>f({...d,promptInjections:{...h,[e]:{...h[e],...t}}});async function _(){m(!0);try{await t({instanceId:e._id,config:V(d,s,l)})}catch(e){n.error(a(),e)}finally{m(!1)}}async function v(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(a(),e)}}let y=e.config?.contentLocale??`default`,b=ce[Z(void 0,r?.defaultLocale??void 0)];return(0,$.jsxs)(`div`,{className:`oc-injtab__body`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__content-locale`,children:[(0,$.jsx)(`span`,{children:i()}),(0,$.jsxs)(q,{value:y,onValueChange:e=>void v(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(Y,{})}),(0,$.jsxs)(X,{children:[(0,$.jsx)(K,{value:`default`,children:u({locale:b})}),le().map(e=>(0,$.jsx)(K,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:c()})]}),U.map(e=>(0,$.jsx)(he,{injKey:e,def:z[e],i18n:ue[e],row:h[e]??{enabled:!0,template:z[e].defaultTemplate[l]},contentLocale:l,onChange:t=>g(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(W,{size:`sm`,onClick:()=>void _(),disabled:p,children:N()})})]})}function he({injKey:e,def:t,i18n:n,row:r,contentLocale:i,onChange:a}){let[o,s]=(0,Q.useState)(!1),c=r.template.trim()!==t.defaultTemplate[i],l=t.togglable&&!r.enabled,u=Object.fromEntries(t.placeholders.map(e=>[e,de[e]??`{${e}}`])),d=I(e,r,i),f=d?L(d,u):``;return(0,$.jsxs)(`section`,{className:`oc-injcard`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,$.jsxs)(`label`,{className:`oc-field--row`,children:[(0,$.jsx)(J,{checked:r.enabled,onCheckedChange:e=>a({enabled:e===!0})}),(0,$.jsx)(B,{label:n.label(),help:n.help()})]}):(0,$.jsx)(B,{label:n.label(),help:n.help()}),c&&(0,$.jsx)(`span`,{className:`oc-injection__badge`,children:re()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:l,rows:8,spellCheck:!1,onChange:e=>a({template:e.target.value})}),(0,$.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:v()}),t.placeholders.map(e=>(0,$.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,$.jsx)(`code`,{children:`{${e}}`}),(0,$.jsx)(H,{text:(fe[e]??(()=>e))()})]},e))]}),(0,$.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,$.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>s(e=>!e),children:o?te():ae()}),c&&(0,$.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>a({template:t.defaultTemplate[i]}),children:E()})]})]}),o&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:f?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:f}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:A()})]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:_()})})]})}export{pe as PromptInjectionsTab};
@@ -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 a,Cy as o,Dy as ee,E as s,Ey as c,Gr as l,Gy as u,Hy as d,Jy as f,Ky as p,Ly as m,Oy as h,Qy as g,Ry as te,Ty as ne,Uy as re,Vy as ie,Wy as _,Xy as v,Yy as y,Zy as b,ab as x,cb as S,db as C,eb as w,fb as T,hM as E,ib as D,jy as O,ky as k,lb as A,mM as j,nb as M,ob as N,qy as P,rb as F,sb as I,tb as L,ub as R,wy as z,zy as ae}from"./dist-D8Kd0X5G.js";import{t as B}from"./button-Dbs-wspp.js";import{B as V,Rt as H,ct as U,lt as W,p as G,u as K,z as q}from"./index-Se6baszB.js";import{t as J}from"./roleDescriptions-DuRh679l.js";var Y=t(e(),1),X=n(),Z=[{group:()=>T(),keys:[{key:`traces.read`,label:()=>I()},{key:`traces.read.content`,label:()=>N(),phi:!0},{key:`traces.write`,label:()=>x()}]},{group:()=>C(),keys:[{key:`kpi.read`,label:()=>I()},{key:`kpi.write`,label:()=>x()}]},{group:()=>R(),keys:[{key:`openclaw.query`,label:()=>D()},{key:`anomalies.read`,label:()=>F()},{key:`anomalies.report`,label:()=>M()}]},{group:()=>A(),keys:[{key:`chats.read`,label:()=>I()},{key:`selfheal`,label:()=>w()},{key:`feedback.respond`,label:()=>l()}]},{group:()=>S(),keys:[{key:`admin.manage`,label:()=>L()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=E(s.apiKeys.listRoles,{}),t=j(s.apiKeys.createRole),n=j(s.apiKeys.ensureRolesSeeded),l=j(s.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(s.apiKeys.listRoles,{});r&&e.setQuery(s.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),x=V(),S=q(),[C,w]=(0,Y.useState)(!1),[T,D]=(0,Y.useState)($),[A,M]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{S.error(g(),e)})},[n,S]);let N=e??[];async function F(e,t){if(Q(e.permissions)||A.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await x({title:b({name:e.name}),description:v(),confirmLabel:y()}))){M(t=>new Set(t).add(e._id));try{await l({roleId:e._id,permissions:n})}catch(e){S.error(f(),e)}finally{M(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function I(){try{await t({key:T.key,name:T.name,description:T.description||void 0,permissions:[]}),D($),w(!1)}catch(e){S.error(P(),e)}}let L=e===void 0,R=!L&&N.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[p(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,u(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,_()]}),(0,X.jsxs)(`div`,{className:`oc-dt`,children:[(0,X.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,X.jsx)(`h2`,{className:`oc-dt__title`,children:re()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{D($),w(!0)},children:d()})})]}),L?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:ie()}):R?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,X.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,X.jsxs)(`table`,{className:`oc-matrix`,children:[(0,X.jsxs)(`thead`,{children:[(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:ae()}),Z.map(e=>(0,X.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,X.jsx)(`tr`,{children:Z.flatMap(e=>e.keys.map(e=>(0,X.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?r({key:e.key}):e.key,children:[e.label(),e.phi?(0,X.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,X.jsx)(`tbody`,{children:N.map(e=>{let t=Q(e.permissions),n=A.has(e._id);return(0,X.jsxs)(`tr`,{children:[(0,X.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,X.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,X.jsx)(`span`,{children:e.name}),(0,X.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,X.jsxs)(U,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(H,{}),` `,te()]}):(0,X.jsx)(U,{variant:`secondary`,children:m()})]}),J(e)?(0,X.jsx)(`p`,{className:`oc-matrix__roledesc`,children:J(e)}):null]}),oe.map(r=>(0,X.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,X.jsx)(G,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?O():n?i():r,onCheckedChange:()=>void F(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(K,{open:C,onOpenChange:w,title:k(),description:h(),canSubmit:!!(T.key&&T.name),onSubmit:I,submitLabel:ee(),children:(0,X.jsxs)(`div`,{className:`oc-form`,children:[(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:c()}),(0,X.jsx)(W,{value:T.key,placeholder:ne(),onChange:e=>D({...T,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:z()}),(0,X.jsx)(W,{value:T.name,onChange:e=>D({...T,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:o()}),(0,X.jsx)(W,{value:T.description,onChange:e=>D({...T,description:e.target.value})})]})]})})]})}export{se as RolesTab};
@@ -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,AO as ee,BD as a,BO as te,CO as ne,DD as o,DO as re,E as s,ED as c,EO as ie,FD as l,FO as ae,GD as u,GO as oe,HD as d,HO as se,ID as f,IO as ce,JD as p,KD as m,KO as le,LD as h,LO as ue,MD as g,MO as de,ND as _,NO as fe,OD as v,OO as pe,PD as y,PO as me,QD as he,RD as ge,RO as _e,SO as ve,TO as ye,UD as be,UO as xe,VD as b,VO as x,WD as S,WO as Se,XD as Ce,YD as C,ZD as we,_O as Te,aO as Ee,bO as De,cO as Oe,dO as ke,eO as Ae,fM as je,fO as Me,gO as Ne,hM as w,hO as Pe,iO as Fe,jD as T,jO as Ie,kD as E,kO as Le,lO as Re,mM as D,mO as ze,nO as Be,oO as Ve,pO as He,qD as O,rO as Ue,sO as We,tO as Ge,uO as Ke,vO as qe,wO as Je,xO as Ye,yO as Xe,zD as k,zO as Ze}from"./dist-D8Kd0X5G.js";import{n as A}from"./dist-CF-vNq7s.js";import{i as Qe}from"./dist-BC4E1wqn.js";import{t as j}from"./button-Dbs-wspp.js";import{$ as M,B as $e,C as N,S as P,Wt as F,Xt as et,Yt as tt,b as I,ct as L,dt as R,et as z,ft as B,ht as V,lt as H,mt as nt,pt as rt,qt as it,u as at,ut as U,w as W,x as G,z as ot}from"./index-Se6baszB.js";import{t as st}from"./FilterBar-irfwrPVv.js";import{t as ct}from"./DataTableShell-CySP6pgB.js";import{t as lt}from"./roleDescriptions-DuRh679l.js";var K=t(e(),1),q=n(),J=[{value:`never`,label:()=>g(),days:null},{value:`30`,label:()=>T(),days:30},{value:`90`,label:()=>i(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=et({from:`/settings/serviceAccounts`}),t=tt({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??X,[a,o]=(0,K.useState)(X),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),u=w(s.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===X?void 0:a,disabled:i===X?void 0:i===`disabled`}}),d=w(s.apiKeys.listKeys,{}),f=w(s.apiKeys.listRoles,{}),p=D(s.apiKeys.createServiceAccount),m=D(s.apiKeys.updateServiceAccount),h=D(s.apiKeys.deleteServiceAccount),g=je(s.apiKeys.mintApiKey),_=D(s.apiKeys.revokeApiKey),v=$e(),y=ot(),ge=n!==``||a!==X||i!==X;function be(){o(X),t({search:{},replace:!0})}let[b,S]=(0,K.useState)(!1),[C,T]=(0,K.useState)(Z),[E,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(new Set),[M,F]=(0,K.useState)(null),R=(0,K.useRef)(!1),[z,B]=(0,K.useState)(new Set),[V,nt]=(0,K.useState)({}),[rt,U]=(0,K.useState)(null),Y=(0,K.useMemo)(()=>{let e=new Map;for(let t of d??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[d]);function Q(e){A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{E?(await m({serviceAccountId:E,name:C.name,roleKey:C.roleKey,description:C.description}),y.success(Ke())):await p({name:C.name,roleKey:C.roleKey,description:C.description||void 0}),T(Z),O(null),S(!1)}catch(e){y.error(E?ke():Me(),e)}}function pt(e){T({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),S(!0)}async function mt(e){if(R.current)return;R.current=!0;let t=V[e._id]??`never`,n=J.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;F(e._id);try{let t=await g({serviceAccountId:e._id,expiresAt:r});U({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(Re(),e)}finally{R.current=!1,F(null)}}async function $(e){if(await v({title:Oe(),description:(0,q.jsxs)(q.Fragment,{children:[We(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Ve(),` `,(0,q.jsx)(`strong`,{children:Ee()}),` `,Fe()]}),confirmWord:e.name,confirmLabel:Ue(),destructive:!0}))try{await h({serviceAccountId:e._id}),y.success(Be(),e.name)}catch(e){y.error(Ge(),e)}}async function ht(e){if(await v({title:Ae(),description:(0,q.jsxs)(q.Fragment,{children:[r(),` `,(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,he()]}),confirmLabel:we(),destructive:!0})&&!z.has(e._id)){B(t=>new Set(t).add(e._id));try{await _({keyId:e._id})}catch(e){y.error(Ce(),e)}finally{B(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:le()}),(0,q.jsxs)(st,{q:n,onQChange:c,searchPlaceholder:oe(),onReset:be,canReset:ge,children:[(0,q.jsxs)(I,{value:a,onValueChange:o,children:[(0,q.jsx)(N,{size:`sm`,className:`w-40`,children:(0,q.jsx)(W,{placeholder:Se()})}),(0,q.jsxs)(G,{children:[(0,q.jsx)(P,{value:X,children:xe()}),(f??[]).map(e=>(0,q.jsx)(P,{value:e.key,children:e.key},e._id))]})]}),(0,q.jsxs)(I,{value:i,onValueChange:l,children:[(0,q.jsx)(N,{size:`sm`,className:`w-36`,children:(0,q.jsx)(W,{})}),(0,q.jsxs)(G,{children:[(0,q.jsx)(P,{value:X,children:se()}),(0,q.jsx)(P,{value:`active`,children:x()}),(0,q.jsx)(P,{value:`disabled`,children:te()})]})]})]}),(0,q.jsx)(ct,{title:Ze(),rows:u,addLabel:_e(),onAdd:()=>{T(Z),O(null),S(!0)},emptyHint:ue(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,q.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:z}),rowActions:e=>[{label:fe(),onSelect:()=>pt(e)},{label:ce(),onSelect:()=>void mt(e)},{label:k.has(e._id)?ae():me(),onSelect:()=>Q(e._id)},{label:de(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,q.jsx)(j,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?Ie():ee(),onClick:()=>Q(e._id),children:k.has(e._id)?(0,q.jsx)(Qe,{}):(0,q.jsx)(it,{})})},{header:Le(),sort:e=>e.name,cell:e=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`span`,{children:e.name}),e.description?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:pe(),sort:e=>e.roleKey,cell:e=>(0,q.jsx)(L,{variant:`secondary`,children:e.roleKey})},{header:re(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,q.jsx)(L,{variant:`destructive`,children:te()}):(0,q.jsx)(L,{variant:`outline`,children:x()})},{header:ie(),cell:e=>(0,q.jsxs)(I,{value:V[e._id]??`never`,onValueChange:t=>nt(n=>({...n,[e._id]:t})),children:[(0,q.jsx)(N,{size:`sm`,className:`w-32`,children:(0,q.jsx)(W,{})}),(0,q.jsx)(G,{children:J.map(e=>(0,q.jsx)(P,{value:e.value,children:e.label()},e.value))})]})},{header:ye(),sort:e=>(Y.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Y.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,q.jsx)(`span`,{className:`oc-sa__keycount`,children:M===e._id?Je():ne({count:t})})}}]}),(0,q.jsx)(at,{open:b,onOpenChange:e=>{S(e),e||O(null)},title:E?ve():Xe(),description:E?Ye():qe(),canSubmit:!!(C.name&&C.roleKey),onSubmit:ft,submitLabel:E?De():Te(),children:(0,q.jsxs)(`div`,{className:`oc-form`,children:[(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Ne()}),(0,q.jsx)(H,{value:C.name,onChange:e=>T({...C,name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Pe()}),(0,q.jsxs)(I,{value:C.roleKey||void 0,onValueChange:e=>T({...C,roleKey:e}),children:[(0,q.jsx)(N,{className:`w-full`,children:(0,q.jsx)(W,{placeholder:ze()})}),(0,q.jsx)(G,{children:(f??[]).map(e=>(0,q.jsxs)(P,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(f??[]).find(e=>e.key===C.roleKey),t=e?lt(e):null;return t?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:He()}),(0,q.jsx)(H,{value:C.description,onChange:e=>T({...C,description:e.target.value})})]})]})}),(0,q.jsx)(dt,{minted:rt,onClose:()=>U(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,q.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,q.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[C(),` `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):(0,q.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:O()}),(0,q.jsx)(`th`,{children:m()}),(0,q.jsx)(`th`,{children:u()}),(0,q.jsx)(`th`,{children:S()}),(0,q.jsx)(`th`,{children:be()}),(0,q.jsx)(`th`,{children:d()}),(0,q.jsx)(`th`,{})]})}),(0,q.jsx)(`tbody`,{children:t.map(t=>(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{children:(0,q.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,q.jsx)(`td`,{children:(0,q.jsx)(L,{variant:`secondary`,children:e.roleKey})}),(0,q.jsx)(`td`,{children:z(t.createdAt)}),(0,q.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,q.jsx)(`td`,{children:mt(t.expiresAt)}),(0,q.jsx)(`td`,{children:$(t)}),(0,q.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,q.jsx)(j,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?b():a()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,K.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,q.jsx)(U,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,q.jsxs)(R,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,q.jsxs)(nt,{children:[(0,q.jsx)(V,{children:k()}),(0,q.jsx)(B,{children:ge({name:e.accountName})})]}),(0,q.jsx)(`div`,{className:`oc-sa__minted-warning`,children:h()}),(0,q.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,q.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,q.jsxs)(j,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":f(),children:[n?(0,q.jsx)(A,{}):(0,q.jsx)(F,{}),n?l():y()]})]}),(0,q.jsx)(rt,{children:(0,q.jsx)(j,{onClick:()=>{r(!1),t()},children:_()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?E():z(e)}function mt(e){return e===null?`—`:M(e)}function $(e){return e.disabled?(0,q.jsx)(L,{variant:`destructive`,children:v()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,q.jsx)(L,{variant:`outline`,children:o()}):(0,q.jsx)(L,{variant:`outline`,children:c()})}export{Q as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$A as r,$k as i,AA as a,BA as o,Bk as s,CA as c,D as l,DA as u,E as d,EA as f,FA as p,Fk as m,GA as h,Gk as g,HA as _,Hk as v,IA as y,Ik as ee,JA as te,Jk as ne,KA as re,Kk as ie,LA as ae,Lk as oe,MA as se,NA as ce,OA as le,PA as ue,QA as de,Qk as fe,RA as pe,Rk as me,SA as he,TA as ge,UA as _e,Uk as b,VA as ve,Vk as ye,WA as be,Wk as xe,XA as Se,Xk as Ce,YA as we,Yk as Te,ZA as Ee,Zk as De,_A as Oe,aA as ke,bA as x,cA as Ae,ca as S,dA as je,eA as Me,ej as Ne,fA as Pe,fM as Fe,gA as Ie,hA as Le,hM as C,iA as Re,iM as ze,jA as Be,kA as Ve,lA as He,la as w,mA as Ue,mM as T,n as We,nA as Ge,nM as Ke,nj as qe,oA as Je,oa as Ye,pA as Xe,qA as E,qk as Ze,rA as Qe,rM as $e,rj as et,sA as tt,sa as nt,tA as D,tj as rt,uA as it,vA as at,wA as ot,xA as st,yA as ct,zA as lt,zk as O}from"./dist-D8Kd0X5G.js";import{n as k}from"./dist-CF-vNq7s.js";import{t as A}from"./x-B-jDgsYW.js";import{t as j}from"./button-Dbs-wspp.js";import{C as M,Ht as N,S as P,Ut as ut,_t as dt,at as ft,b as F,ct as I,gt as pt,it as L,lt as R,nt as mt,ot as z,p as B,rt as ht,st as gt,w as V,x as H,xt as U}from"./index-Se6baszB.js";import{t as _t}from"./localePickerView-C2RmOS86.js";import{a as vt,i as yt,n as bt,o as xt,r as St,t as Ct}from"./card-B_7M0l5O.js";import{a as wt,i as W,n as Tt,o as G,r as K,t as Et}from"./table-RDie4v3L.js";import{t as Dt}from"./TimeRangePicker-3h2VniWx.js";import{t as Ot}from"./FilterBar-irfwrPVv.js";import{t as kt}from"./AdvancedFilter-BzRzcaLe.js";var q=l(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),J=t(e(),1),At=.1,jt=[248,248,248],Mt=[24,24,24];function Nt(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function Pt(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function Y(e,t,n){return Pt(e,t,n)>=At}function Ft(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function It(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var Lt=12*1024*1024,Rt=480,zt=160,Bt=.92;async function Vt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Re());if(e.size>Lt)throw Error(Qe());let{source:n,width:r,height:i,cleanup:a}=await Ht(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Rt/r,zt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(D());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Nt(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(D());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);Y(e.data,d.width,d.height)?Ft(e.data,t.variantFor===`dark`?jt:Mt):It(e.data),p.putImageData(e,0,0)}let m=Y(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Ut(f,`image/webp`,Bt)??await Ut(f,`image/png`);if(!h)throw Error(Me());return{blob:h,hasAlpha:m}}finally{a()}}async function Ht(e){if(e.type===`image/svg+xml`)return X(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 X(e)}async function X(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(Ge())),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 Ut(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var Z=n();function Wt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Q=`__all__`,Gt={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function $({title:e,description:t,children:n}){return(0,Z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Z.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,Z.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?ze():e===`dark`?$e():Ke()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,Z.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,Z.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,Z.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,Z.jsxs)(`button`,{type:`button`,className:We(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,Z.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,Z.jsx)(k,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,Z.jsx)(Yt,{tokens:r,mode:i}):(0,Z.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,Z.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,Z.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,Z.jsx)(j,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":w(),title:w(),children:(0,Z.jsx)(ut,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=C(d.charts.listMyCharts),r=T(d.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,Z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Z.jsx)(`h2`,{className:`oc-show__title`,children:we()}),(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:te()})]}),(0,Z.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,Z.jsx)(Xt,{selected:e===null,title:E(),subtitle:re(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?h():n.via===`owner`?be():_e({group:n.via.group});return(0,Z.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Wt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:_()}):null]})}function Qt(){let e=T(d.charts.importChart),[t,n]=(0,J.useState)(``),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(null),[s,l]=(0,J.useState)(!1),[p,m]=(0,J.useState)(!1);async function h(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),l(!1);try{i(await t.text())}catch{o(x())}}}async function g(){if(o(null),l(!1),t.trim()===``){o(at());return}let a;try{a=JSON.parse(r)}catch{o(x());return}m(!0);try{await e({name:t.trim(),tokens:a}),l(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{m(!1)}}return(0,Z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Z.jsx)(`h2`,{className:`oc-show__title`,children:le()}),(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:u()})]}),(0,Z.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,Z.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-import__label`,children:f()}),(0,Z.jsx)(R,{value:t,onChange:e=>n(e.target.value),placeholder:ge(),maxLength:60})]}),(0,Z.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-import__label`,children:ot()}),(0,Z.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:c(),rows:8,spellCheck:!1})]}),(0,Z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Z.jsx)(j,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Z.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Z.jsx)(q,{className:`size-4`}),he(),(0,Z.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void h(e)})]})}),(0,Z.jsx)(j,{size:`sm`,disabled:p,onClick:()=>void g(),children:st()})]}),a?(0,Z.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,Z.jsx)(`p`,{className:`oc-chart-import__ok`,children:ct()}):null]})]})}function $t({chart:e}){let t=Fe(d.charts.setChartLogo),n=T(d.charts.removeChartLogo),[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Vt(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function f(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function p({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,Z.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?je():it()}),(0,Z.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,Z.jsx)(`img`,{src:t,alt:``}):null}),(0,Z.jsx)(j,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Z.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Z.jsx)(q,{className:`size-4`}),t?Ae():He(),(0,Z.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,Z.jsx)(j,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:Je()}):null,t?(0,Z.jsx)(j,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:tt()}):null]})}return(0,Z.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Pe()}),(0,Z.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,Z.jsx)(p,{mode:`light`}),(0,Z.jsx)(p,{mode:`dark`})]}),r?(0,Z.jsx)(`span`,{className:`oc-show__desc`,children:ke()}):null,a?(0,Z.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=C(d.me.getMe,{host:U}),n=T(d.charts.addChartDomain),r=T(d.charts.removeChartDomain),[a,o]=(0,J.useState)(``),[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)(!1);if(t?.role!==`admin`)return null;let f=e.domains??[];async function p(){let t=a.trim();if(t!==``){c(null),u(!0);try{await n({chartKey:e.key,domain:t}),o(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function m(t){c(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,Z.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:i()}),(0,Z.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,Z.jsx)(`div`,{className:`oc-chart-avail__groups`,children:f.length===0?(0,Z.jsx)(`span`,{className:`oc-show__desc`,children:Te()}):f.map(e=>(0,Z.jsxs)(I,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,Z.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ne({domain:e}),onClick:()=>void m(e),children:(0,Z.jsx)(A,{className:`size-3`})})]},e))}),(0,Z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Z.jsx)(R,{value:a,onChange:e=>o(e.target.value),placeholder:De(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&p()}}),(0,Z.jsx)(j,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void p(),children:Ce()})]}),(0,Z.jsx)(`span`,{className:`oc-show__desc`,children:fe()}),s?(0,Z.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=T(d.charts.updateChart),n=T(d.charts.deleteChart),[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(e.name),[s,c]=(0,J.useState)(()=>tn(e.tokens)),[l,u]=(0,J.useState)(e.tokens.bpm??0),[f,p]=(0,J.useState)(null),[m,h]=(0,J.useState)(!1);function _(){o(e.name),c(tn(e.tokens)),u(e.tokens.bpm??0),p(null),i(!0)}async function v(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(s)}catch{p(x());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}h(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{h(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(b()))try{await n({chartId:e.chartId})}catch{}}return(0,Z.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,Z.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,Z.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(j,{variant:`outline`,size:`sm`,onClick:_,children:Ue()}),(0,Z.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:Xe()})]})})]}),r?(0,Z.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,Z.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-import__label`,children:g()}),(0,Z.jsx)(R,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,Z.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-import__label`,children:S()}),(0,Z.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,Z.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":S()}),(0,Z.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?nt():`${l} BPM`})]}),(0,Z.jsx)(`span`,{className:`oc-show__desc`,children:Ye()})]}),(0,Z.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-import__label`,children:xe()}),(0,Z.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),f?(0,Z.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,Z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Z.jsx)(j,{size:`sm`,disabled:m,onClick:()=>void v(),children:Ze()}),(0,Z.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:ie()})]})]}):null,(0,Z.jsx)($t,{chart:e}),(0,Z.jsx)(en,{chart:e})]})}function rn(){let e=C(d.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,Z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Z.jsx)(`h2`,{className:`oc-show__title`,children:Oe()}),(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:Ie()})]}),e!==void 0&&t.length===0?(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:Le()}):(0,Z.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,Z.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=T(d.charts.addChartToGroupPool),r=T(d.charts.removeChartFromGroupPool),i=e.restrictedToGroups,o=e.poolGroups,s=new Set((o??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,Z.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Z.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Z.jsx)(I,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?ue():e.kind===`custom`&&e.scope===`personal`?O():p()}),e.isGlobalDefault?(0,Z.jsx)(I,{variant:`default`,children:ce()}):null]}),(0,Z.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Be()}),(o??[]).map(e=>(0,Z.jsxs)(I,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,Z.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ve({group:e.name}),onClick:()=>void u(e.groupId),children:(0,Z.jsx)(A,{className:`size-3`})})]},e.groupId)),c.length>0?(0,Z.jsxs)(F,{value:``,onValueChange:e=>void l(e),children:[(0,Z.jsx)(M,{size:`sm`,className:`w-56`,children:(0,Z.jsx)(V,{placeholder:a()})}),(0,Z.jsx)(H,{children:c.map(e=>(0,Z.jsx)(P,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,Z.jsx)(`span`,{className:`oc-show__desc`,children:se()}):null]})]})}function on({chart:e}){let t=T(d.charts.promoteChartToCommon),n=T(d.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(b()))try{await n({chartId:e.chartId})}catch{}}return(0,Z.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Z.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Z.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Z.jsx)(I,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?me():O()}),e.ownerLabel?(0,Z.jsx)(`span`,{className:`oc-show__desc`,children:s({owner:e.ownerLabel})}):null]}),(0,Z.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,Z.jsx)(j,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:oe()}):null,(0,Z.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:ee()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let i=T(d.admin.setDefaultThemeMode),a=T(d.admin.setDefaultLocale),s=T(d.charts.setDefaultChart),c=C(d.charts.listChartsAdmin),l=C(d.groups.listGroups,{}),u=e??`system`,f=t??`fr`;return(0,Z.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Z.jsx)(`h2`,{className:`oc-show__title`,children:Ee()}),(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:Se()})]}),(0,Z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Z.jsx)(`h3`,{className:`oc-show__title`,children:ve()}),(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:o()})]}),(0,Z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Z.jsx)(j,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void s({name:null}),children:E()}),dt.map(e=>(0,Z.jsx)(j,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void s({name:e.key}),children:e.name},e.key)),(c??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,Z.jsx)(j,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void s({name:e.key}),children:e.name},e.key))]})]}),(0,Z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Z.jsx)(`h3`,{className:`oc-show__title`,children:lt()}),(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:pe()})]}),(0,Z.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,Z.jsx)(an,{chart:e,groups:l??[]},e.key))})]}),(0,Z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Z.jsx)(`h3`,{className:`oc-show__title`,children:ae()}),(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:y()})]}),(0,Z.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,Z.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Z.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,Z.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,Z.jsx)(en,{chart:e})]},e.key))})]}),(0,Z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Z.jsx)(`h3`,{className:`oc-show__title`,children:v()}),(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]}),(()=>{let e=(c??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:m()}):(0,Z.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,Z.jsx)(on,{chart:e},e.key))})})()]}),(0,Z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Z.jsx)(`h3`,{className:`oc-show__title`,children:et()}),(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:qe()})]}),(0,Z.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,Z.jsx)(j,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>void i({mode:e}),children:qt(e)},e))})]}),(0,Z.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Z.jsx)(`h3`,{className:`oc-show__title`,children:rt()}),(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:Ne()})]}),(0,Z.jsx)(`div`,{className:`oc-show__row`,children:_t().map(e=>(0,Z.jsx)(j,{variant:f===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,Z.jsx)(`p`,{className:`oc-show__desc`,children:r()})]})]})}function cn(){let e=C(d.me.getMe,{host:U}),t=pt(e?.resolvedThemeMode);return(0,Z.jsxs)(`div`,{className:`oc-appearance`,children:[(0,Z.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,Z.jsx)(Qt,{}),(0,Z.jsx)(rn,{}),e?.role===`admin`?(0,Z.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,J.useState)(!0),[n,r]=(0,J.useState)(`per-user`),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(Q),[c,l]=(0,J.useState)(Q),[u,d]=(0,J.useState)(Gt),f=i!==``||o!==Q||c!==Q;function p(){a(``),s(Q),l(Q),d(Gt)}return(0,Z.jsxs)(`div`,{className:`oc-show`,children:[(0,Z.jsx)(cn,{}),(0,Z.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,Z.jsx)(`summary`,{className:`oc-show__title`,children:de()}),(0,Z.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,Z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Z.jsx)(j,{children:`Default`}),(0,Z.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,Z.jsx)(j,{variant:`outline`,children:`Outline`}),(0,Z.jsx)(j,{variant:`ghost`,children:`Ghost`}),(0,Z.jsx)(j,{variant:`destructive`,children:`Destructive`}),(0,Z.jsx)(j,{variant:`link`,children:`Link`})]}),(0,Z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Z.jsx)(j,{size:`sm`,children:`Small`}),(0,Z.jsx)(j,{children:`Default`}),(0,Z.jsx)(j,{size:`lg`,children:`Large`}),(0,Z.jsx)(j,{size:`icon`,"aria-label":`more`,children:(0,Z.jsx)(N,{})}),(0,Z.jsx)(j,{disabled:!0,children:`Disabled`})]})]}),(0,Z.jsx)($,{title:`Badges`,children:(0,Z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Z.jsx)(I,{children:`Default`}),(0,Z.jsx)(I,{variant:`secondary`,children:`Secondary`}),(0,Z.jsx)(I,{variant:`outline`,children:`Outline`}),(0,Z.jsx)(I,{variant:`destructive`,children:`Destructive`})]})}),(0,Z.jsx)($,{title:`Inputs & selection`,children:(0,Z.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Z.jsx)(R,{placeholder:`Text input…`}),(0,Z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Z.jsxs)(F,{value:n,onValueChange:r,children:[(0,Z.jsx)(M,{className:`w-56`,children:(0,Z.jsx)(V,{placeholder:`Select…`})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(P,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,Z.jsx)(P,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,Z.jsxs)(`label`,{className:`oc-show__check`,children:[(0,Z.jsx)(B,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,Z.jsx)($,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,Z.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Z.jsxs)(Ot,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,Z.jsxs)(F,{value:o,onValueChange:s,children:[(0,Z.jsx)(M,{size:`sm`,children:(0,Z.jsx)(V,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(P,{value:Q,children:`Toutes directions`}),(0,Z.jsx)(P,{value:`inbound`,children:`inbound`}),(0,Z.jsx)(P,{value:`outbound`,children:`outbound`}),(0,Z.jsx)(P,{value:`internal`,children:`internal`})]})]}),(0,Z.jsxs)(F,{value:c,onValueChange:l,children:[(0,Z.jsx)(M,{size:`sm`,children:(0,Z.jsx)(V,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(P,{value:Q,children:`Toutes sévérités`}),(0,Z.jsx)(P,{value:`info`,children:`info`}),(0,Z.jsx)(P,{value:`warn`,children:`warn`}),(0,Z.jsx)(P,{value:`critical`,children:`critical`})]})]})]}),(0,Z.jsx)(kt,{fields:Kt,onChange:()=>{}}),(0,Z.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Z.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,Z.jsx)(Dt,{value:u,onChange:d})]})]})}),(0,Z.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,Z.jsxs)(mt,{children:[(0,Z.jsx)(gt,{asChild:!0,children:(0,Z.jsx)(j,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,Z.jsx)(N,{})})}),(0,Z.jsxs)(ht,{align:`start`,children:[(0,Z.jsx)(ft,{children:`Actions`}),(0,Z.jsx)(z,{}),(0,Z.jsx)(L,{children:`Edit`}),(0,Z.jsx)(L,{children:`Duplicate`}),(0,Z.jsx)(z,{}),(0,Z.jsx)(L,{variant:`destructive`,children:`Delete`})]})]})}),(0,Z.jsx)($,{title:`Card`,children:(0,Z.jsxs)(Ct,{className:`w-80`,children:[(0,Z.jsxs)(vt,{children:[(0,Z.jsx)(xt,{children:`Instance`}),(0,Z.jsx)(St,{children:`Non-secret metadata only.`})]}),(0,Z.jsx)(bt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,Z.jsxs)(yt,{className:`gap-2`,children:[(0,Z.jsx)(j,{size:`sm`,children:`Save`}),(0,Z.jsx)(j,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,Z.jsx)($,{title:`Table`,children:(0,Z.jsxs)(Et,{children:[(0,Z.jsx)(wt,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(W,{className:`w-8`,children:(0,Z.jsx)(B,{"aria-label":`select all`})}),(0,Z.jsx)(W,{children:`Name`}),(0,Z.jsx)(W,{children:`Mode`}),(0,Z.jsx)(W,{className:`text-right`,children:`Status`}),(0,Z.jsx)(W,{className:`w-8`})]})}),(0,Z.jsx)(Tt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,Z.jsxs)(G,{children:[(0,Z.jsx)(K,{children:(0,Z.jsx)(B,{"aria-label":`select ${e.n}`})}),(0,Z.jsx)(K,{className:`font-medium`,children:e.n}),(0,Z.jsx)(K,{children:(0,Z.jsx)(I,{variant:`secondary`,children:e.m})}),(0,Z.jsx)(K,{className:`text-right`,children:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,Z.jsx)(k,{className:`size-3.5`}),` `,e.s]})}),(0,Z.jsx)(K,{children:(0,Z.jsx)(j,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,Z.jsx)(N,{})})})]},e.n))})]})}),(0,Z.jsx)($,{title:`App fragments`,description:`Chat-specific components`,children:(0,Z.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Z.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,Z.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,Z.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,Z.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,Z.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,Z.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,Z.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,Z.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,Z.jsx)(`span`,{className:`oc-run-status__dot`}),(0,Z.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,$w as i,A_ as a,Aw as o,B_ as s,C_ as c,Cw as l,D as u,D_ as d,Dw as f,E as p,E_ as m,Ew as h,F_ as g,Fw as _,G_ as ee,Gw as v,H_ as y,Hw as b,I_ as te,Iw as ne,J_ as re,Jw as x,K_ as ie,Kw as S,L_ as ae,M_ as oe,Mw as C,N_ as se,Nw as w,O_ as ce,Ow as le,P_ as ue,Pw as T,Q_ as de,Qw as E,R_ as fe,S_ as pe,Sw as D,T_ as me,Tw as O,U_ as he,Uw as ge,V_ as _e,Vw as ve,W_ as ye,Ww as be,X_ as xe,Xw as k,Y_ as Se,Yw as A,Z_ as Ce,Zw as j,aT as M,b_ as we,cT as Te,dT as Ee,eT as De,ev as Oe,gn as ke,hM as N,hn as P,iT as F,j_ as Ae,jw as I,k_ as je,kw as Me,lT as Ne,mM as L,mn as Pe,nT as Fe,nv as Ie,oT as Le,q_ as Re,qw as ze,rT as Be,sT as Ve,tT as He,tv as Ue,uT as We,v_ as Ge,w_ as Ke,ww as qe,x_ as Je,y_ as Ye,z_ as Xe}from"./dist-D8Kd0X5G.js";import{n as Ze}from"./dist-CF-vNq7s.js";import{t as Qe}from"./x-B-jDgsYW.js";import{i as R,n as z,r as $e,t as et}from"./tabs-uwXJdjSE.js";import{t as B}from"./button-Dbs-wspp.js";import{Bt as tt,C as V,S as H,Vt as nt,Wt as rt,Xt as it,Yt as at,a as ot,b as U,ct as W,dt as st,et as G,ft as ct,ht as lt,i as ut,j as dt,mt as ft,o as pt,r as mt,tt as ht,ut as gt,w as K,x as q,xt as _t}from"./index-Se6baszB.js";import{n as vt}from"./TimeRangePicker-3h2VniWx.js";import{t as yt}from"./FilterBar-irfwrPVv.js";import{t as bt}from"./AdvancedFilter-BzRzcaLe.js";import{t as xt}from"./DataTableShell-CySP6pgB.js";var St=u(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=u(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?S():n===`agent`?`${v()} - ${r}`:e}function Tt(){let e=N(p.me.getMe,{host:_t})?.role===`admin`,t=N(p.deliveryTiming.getDeliveryStatus,{}),n=L(p.deliveryTiming.startDeliveryRecord),r=L(p.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:Ee()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:We()})]}),e?(0,Y.jsx)(B,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?Te():Ne()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(W,{variant:`secondary`,children:Ve()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:Le({time:ht(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?Be():F()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=N(p.deliveryTiming.listDeliverySessions,{}),n=L(p.deliveryTiming.deleteDeliverySessions),[r,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(`all`),[c,u]=(0,J.useState)(X),[d,f]=(0,J.useState)(null),{from:m,to:h}=vt(c),g=c.to===`now`?1/0:h,_=r.trim()!==``||o!==`all`||c!==X,ee=()=>{a(``),s(`all`),u(X)},v=(0,J.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(o===`all`||(o===`active`?t.active:!t.active))&&t.startedAt>=m&&t.startedAt<=g).map(e=>({...e,_id:e.sessionId}))},[t,r,o,m,g]),y=e=>{let t=new Set((v??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),d!==null&&r.includes(d)&&f(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(yt,{q:r,onQChange:a,searchPlaceholder:He(),timeRange:c,onTimeRangeChange:u,onReset:ee,canReset:_,children:(0,Y.jsxs)(U,{value:o,onValueChange:e=>s(e),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:`all`,children:De()}),(0,Y.jsx)(H,{value:`active`,children:i()}),(0,Y.jsx)(H,{value:`stopped`,children:E()})]})]})}),(0,Y.jsx)(xt,{title:Fe(),rows:v,emptyHint:l(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?ge():be(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(nt,{size:15,"aria-hidden":!0})})},{header:j(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:G(e.startedAt)})},{header:k(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:G(e.stoppedAt)})},{header:A(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:x(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:ze(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(W,{variant:`secondary`,children:i()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:E()})}],rowActions:e?e=>[{label:b(),variant:`destructive`,onSelect:()=>y([e.sessionId])}]:void 0,bulkActions:e?[{label:b(),variant:`destructive`,onSelect:e=>y(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=N(p.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(dt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ve()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:M()});let r=e.segments,i=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,D()]}),(0,Y.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Y.jsx)(rt,{size:13,"aria-hidden":!0}),t?qe():O()]})]}),(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:T()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:w()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:C()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(I(),r.bridge),i(o(),r.A),i(Me(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:le()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:f()})]})}var kt=[50,100,200,500],At=`all`,Q=`__all__`,jt=[`2xx`,`4xx`,`5xx`],Mt=[`user`,`service`,`system`],Nt=[`inbound`,`outbound`,`internal`],Pt={kind:`relative`,from:`now-30d`,to:`now`},Ft=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:ke()},{value:`principalType`,label:P()},{value:`direction`,label:`direction`},{value:`roleKey`,label:Pe()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=it({from:`/settings/traces`}),t=at({from:`/settings/traces`}),n=e.limit,i=e.kind,o=e.statusClass??Q,l=e.principalType??Q,u=e.direction??Q,f=e.roleKey??Q,h=e.q??``,v=mt(e.from,e.to),b=(0,J.useMemo)(()=>pt(e.adv),[e.adv]),{from:x,to:S}=vt(v),[C,w]=(0,J.useState)(null),[le,T]=(0,J.useState)(null),E=e=>void t({search:t=>({...t,limit:e})}),D=e=>void t({search:t=>({...t,kind:e})}),O=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ge=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),ve=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),be=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),A=e=>void t({search:t=>({...t,...ot(e)})}),j=e=>void t({search:t=>({...t,adv:ut(e)}),replace:!0}),M=N(p.observability.listEvents,{limit:n}),we=N(p.observability.listEvents,{limit:n,kind:i===At?void 0:i,filter:{q:h||void 0,from:x,to:S,statusClass:o===Q?void 0:o,principalType:l===Q?void 0:l,direction:u===Q?void 0:u,roleKey:f===Q?void 0:f,advanced:b.length>0?b:void 0}}),Te=(0,J.useMemo)(()=>{let e=new Set;for(let t of M??[])e.add(t.kind);return[...e].sort()},[M]),Ee=(0,J.useMemo)(()=>{let e=new Set;for(let t of M??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[M]),De=h!==``||o!==Q||l!==Q||u!==Q||f!==Q||b.length>0||v.kind!==`relative`||v.from!==Pt.from;function ke(){t({search:{limit:100,kind:`all`},replace:!0})}let P=C?M?.filter(e=>e.correlationId===C):we,F=e.section,I=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:F,onValueChange:e=>I(e),children:[(0,Y.jsxs)($e,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(tt,{size:13,"aria-hidden":!0}),ne()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),_()]})]}),(0,Y.jsx)(z,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ie(),(0,Y.jsx)(`strong`,{children:Ue()}),Oe(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:r()})]}),(0,Y.jsxs)(yt,{q:h,onQChange:O,searchPlaceholder:de(),timeRange:v,onTimeRangeChange:A,onReset:ke,canReset:De,children:[(0,Y.jsxs)(U,{value:o,onValueChange:ge,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:Ce()})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:Q,children:xe()}),jt.map(e=>(0,Y.jsx)(H,{value:e,children:e},e))]})]}),(0,Y.jsxs)(U,{value:l,onValueChange:ve,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:Se()})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:Q,children:re()}),Mt.map(e=>(0,Y.jsx)(H,{value:e,children:e},e))]})]}),(0,Y.jsxs)(U,{value:u,onValueChange:be,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:Re()})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:Q,children:ie()}),Nt.map(e=>(0,Y.jsx)(H,{value:e,children:e},e))]})]}),(0,Y.jsxs)(U,{value:f,onValueChange:k,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{placeholder:ee()})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:Q,children:ye()}),Ee.map(e=>(0,Y.jsx)(H,{value:e,children:e},e))]})]}),(0,Y.jsxs)(U,{value:i,onValueChange:D,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(K,{placeholder:he()})}),(0,Y.jsxs)(q,{children:[(0,Y.jsx)(H,{value:At,children:y()}),Te.map(e=>(0,Y.jsx)(H,{value:e,children:e},e))]})]}),(0,Y.jsxs)(U,{value:String(n),onValueChange:e=>E(Number(e)),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(K,{})}),(0,Y.jsx)(q,{children:kt.map(e=>(0,Y.jsx)(H,{value:String(e),children:_e({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:b,onChange:j}),C?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>w(null),title:s(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[Xe(),(0,Y.jsx)(`code`,{children:$(C)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:fe()})]})}):null,(0,Y.jsx)(xt,{title:ae(),rows:P,emptyHint:C?te():g(),columns:[{header:ue(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:G(e.at)})},{header:se(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(W,{variant:`secondary`,children:e.kind})},{header:oe(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":Ae(),children:`✓`})}},{header:a(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(W,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:je(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(W,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:ce(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(W,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:d(),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:m(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:me(),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:Ke(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:c(),onClick:()=>w(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:pe(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>T(e),children:Je()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:le,onClose:()=>T(null)})]})]})}function Lt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Rt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(gt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(st,{className:`max-w-lg`,children:[(0,Y.jsxs)(ft,{children:[(0,Y.jsxs)(lt,{className:`oc-traces__meta-title`,children:[we(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(W,{variant:`outline`,children:Ye()})]}),(0,Y.jsx)(ct,{children:Ge()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AS as r,BS as i,Bg as a,CS as o,DS as s,E as c,ES as l,FS as u,Fg as d,Hg as f,IS as p,Ig as m,Jx as h,LS as ee,Lg as g,MS as _,Mg as v,NS as te,Ng as y,OS as b,PS as ne,Pg as x,RS as re,Rg as S,SS as ie,TS as ae,Ug as C,VS as w,Vg as T,Wg as E,_S as oe,bS as se,du as D,fu as O,gS as ce,hM as k,hS as le,jS as ue,kS as de,mM as A,mS as fe,pS as pe,uu as j,vS as me,wS as he,xS as ge,yS as _e,zS as M,zg as N}from"./dist-D8Kd0X5G.js";import{t as P}from"./button-Dbs-wspp.js";import{B as F,C as I,Mt as L,Nt as R,S as z,V as ve,Xt as ye,Yt as be,at as B,b as V,c as xe,ct as H,dt as Se,ft as Ce,ht as we,it as Te,l as U,mt as Ee,nt as De,p as W,rt as Oe,s as G,st as ke,ut as Ae,w as K,x as q,xt as J,z as Y}from"./index-Se6baszB.js";import{t as je}from"./FilterBar-irfwrPVv.js";import{t as Me}from"./DataTableShell-CySP6pgB.js";import{t as Ne}from"./DetailChips-CqgbiqUw.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=k(c.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=k(c.agents.listUserAgents,n&&e?{profileId:e}:`skip`),s=new Set((o??[]).map(e=>`${e.instanceName}/${e.agentId}`)),l=(o??[]).find(e=>e.isDefault)??null,u=l?`${l.instanceName}/${l.agentId}`:null,d=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),p=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).filter(e=>!d.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],m=new Map;for(let e of p){let t=m.get(e.instanceName)??[];t.push(e),m.set(e.instanceName,t)}return(0,Z.jsx)(Ae,{open:n,onOpenChange:r,children:(0,Z.jsxs)(Se,{className:`oc-access`,children:[(0,Z.jsxs)(Ee,{children:[(0,Z.jsx)(we,{children:E({user:t})}),(0,Z.jsx)(Ce,{children:C()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?f():T()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:a()}):p.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:g()}):[...m.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:s,defaultKey:u},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=A(c.agents.assignAgent),s=A(c.agents.removeAgent),l=A(c.agents.setDefaultAgent),u=Y();if(!e)return null;async function f(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(N(),e)}}async function p(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(S(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(R,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(H,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,Z.jsx)(W,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void f(e.agentId,r),"aria-label":m({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Z.jsx)(H,{variant:`outline`,className:`oc-access__gone`,children:d()}):null,e.outOfPool?(0,Z.jsx)(H,{variant:`outline`,className:`oc-access__gone`,children:x()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":y(),title:y(),children:(0,Z.jsx)(L,{size:14,fill:`currentColor`})}):(0,Z.jsx)(P,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":v(),title:v(),disabled:c,onClick:()=>void p(e.agentId),children:(0,Z.jsx)(L,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return j();case`user`:return D();case`admin`:return O();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=G.filter(e=>n.has(U[e])).length;return(0,Z.jsxs)(De,{children:[(0,Z.jsx)(ke,{asChild:!0,children:(0,Z.jsx)(P,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?w():i({count:r})})}),(0,Z.jsxs)(Oe,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(B,{children:M()}),G.map(e=>{let r=U[e];return(0,Z.jsxs)(Te,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(W,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:xe[e]()})]},e)})]})]})}function Le(){let e=ye({from:`/settings/users`}),t=be({from:`/settings/users`}),n=e.q??``,i=e.role??Q,a=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),d=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),f=k(c.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),m=k(c.me.getMe,{host:J}),g=A(c.admin.setRole),v=A(c.admin.setUserPermissions),y=A(c.admin.startImpersonation),x=A(c.admin.deleteUser),S=A(c.admin.setUserName),C=F(),w=ve(),T=Y(),[E,D]=(0,X.useState)(null),O=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of f??[])e.add(t.role);return[...e]},[f]),j=n!==``||i!==Q;function M(){t({search:{},replace:!0})}async function N(e){try{await g(e)}catch(e){T.error(re(),e)}}async function P(e){try{await v(e)}catch(e){T.error(ee(),e)}}async function L(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await C({title:r(),description:de({user:t}),confirmWord:b(),confirmLabel:s(),destructive:!0}))try{await x({profileId:e._id}),T.success(ae({user:t}))}catch(e){T.error(l(),e)}}async function B(e){let t=e.email||e.name||e.userId.slice(0,8),n=await w({title:o(),label:ie({user:t}),placeholder:ge(),defaultValue:e.name??``,confirmLabel:h()});if(n!==null)try{await S({profileId:e._id,name:n}),T.success(se())}catch(e){T.error(_e(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(je,{q:n,onQChange:a,searchPlaceholder:p(),onReset:M,canReset:j,children:(0,Z.jsxs)(V,{value:i,onValueChange:d,children:[(0,Z.jsx)(I,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(K,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(z,{value:Q,children:u()}),O.map(e=>(0,Z.jsx)(z,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:ne(),rows:f,emptyHint:te(),rowActions:e=>{let t=[{label:pe(),onSelect:()=>D({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:he(),onSelect:()=>void B(e)}];return e.userId!==m?.userId&&t.push({label:_(),onSelect:()=>void y({profileId:e._id})},{label:ue(),variant:`destructive`,onSelect:()=>void L(e)}),t},columns:[{header:me(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{children:t}),n?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:oe(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(V,{value:e.role,onValueChange:t=>void N({profileId:e._id,role:t}),children:[(0,Z.jsx)(I,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(K,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(z,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(z,{value:`user`,children:$(`user`)}),(0,Z.jsx)(z,{value:`admin`,children:$(`admin`)})]})]})},{header:ce(),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)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),P({profileId:e._id,permissions:[...n]})}})},{header:fe(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(R,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Pe,{profileId:E?.profileId??null,userLabel:E?.label??``,open:E!==null,onOpenChange:e=>{e||D(null)}})]})}export{Le as UsersTab};
@@ -1 +0,0 @@
1
- import{D as e}from"./dist-D8Kd0X5G.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};