@lacneu/atrium 0.55.2 → 0.55.3

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 (65) hide show
  1. package/dist/assets/AccessTab-C31jlbg9.js +1 -0
  2. package/dist/assets/{AdvancedFilter-Da3KTeHW.js → AdvancedFilter-Cqqt3aQy.js} +1 -1
  3. package/dist/assets/{AgentFilesTab-zUyuhhPC.js → AgentFilesTab-hoV2OJkH.js} +2 -2
  4. package/dist/assets/AnomaliesTab-HNlBWX4H.js +1 -0
  5. package/dist/assets/{AuditTab-DhZziBmc.js → AuditTab-BDkuGhWd.js} +1 -1
  6. package/dist/assets/{BridgeTab-CBfGV3MJ.js → BridgeTab-7Gp-lSm8.js} +1 -1
  7. package/dist/assets/{ChatDefaultsTab-CPHvONN5.js → ChatDefaultsTab-CuRfo1OD.js} +1 -1
  8. package/dist/assets/{DataTableShell-CRhep8-q.js → DataTableShell-O-bA35dG.js} +1 -1
  9. package/dist/assets/{DetailChips-DU6aRrkw.js → DetailChips-F3RMiEWW.js} +1 -1
  10. package/dist/assets/FeedbacksTab-n6fND_d8.js +1 -0
  11. package/dist/assets/{FieldLabel-Cam2yQ_L.js → FieldLabel-C2HKtml6.js} +1 -1
  12. package/dist/assets/FilesTab-ClwXf69-.js +1 -0
  13. package/dist/assets/{FilterBar-D6zZSKoR.js → FilterBar-CQBSm0gy.js} +1 -1
  14. package/dist/assets/{GroupsTab-BbXkqBwR.js → GroupsTab-By9wK7Xb.js} +1 -1
  15. package/dist/assets/InstancesTab-F8EFka-Z.js +1 -0
  16. package/dist/assets/{IntegrationsTab-gnKR_uar.js → IntegrationsTab-DyjOkGyX.js} +1 -1
  17. package/dist/assets/{KpiTab-C1faYNw_.js → KpiTab-D8YvkmYo.js} +1 -1
  18. package/dist/assets/PreferencesTab-CVf28USb.js +1 -0
  19. package/dist/assets/{PromptInjectionsTab-rzjPaDqW.js → PromptInjectionsTab-BnOXHYex.js} +2 -2
  20. package/dist/assets/RolesTab-HPXx0Dh3.js +1 -0
  21. package/dist/assets/ScheduledTab-CMFb6jsp.js +1 -0
  22. package/dist/assets/ServiceAccountsTab-CkbSZ_vx.js +1 -0
  23. package/dist/assets/{SubAgentReportsTab-DlOkF8VH.js → SubAgentReportsTab-BhJ2Xi_p.js} +1 -1
  24. package/dist/assets/ThemeShowroom-BHaHjfmV.js +1 -0
  25. package/dist/assets/{TimeRangePicker-5EYfNRUQ.js → TimeRangePicker-CV_IaaKP.js} +1 -1
  26. package/dist/assets/TracesTab-ChOCnxTO.js +1 -0
  27. package/dist/assets/UsersTab-CKat_1Zz.js +1 -0
  28. package/dist/assets/VoiceTab-Kw-KPRnH.js +1 -0
  29. package/dist/assets/{button-CJcuK3wk.js → button-CdHluvSK.js} +1 -1
  30. package/dist/assets/{card-CVCuPx_Y.js → card-AXe34vGw.js} +1 -1
  31. package/dist/assets/chevrons-up-down-BlSBNq85.js +1 -0
  32. package/dist/assets/{compatView-B7k06dFl.js → compatView-CB9xzhbT.js} +1 -1
  33. package/dist/assets/{dispatchErrorInfo-CGkgIKQB.js → dispatchErrorInfo-CkqdtQzy.js} +1 -1
  34. package/dist/assets/dist-BKXYNjW7.js +44 -0
  35. package/dist/assets/{dist-B7glRJ6t.js → dist-CchsedUP.js} +1 -1
  36. package/dist/assets/{dist-Czk9m5q_.js → dist-D06QCQPB.js} +1 -1
  37. package/dist/assets/{dist-DDmOEYQC.js → dist-x2y4VoOj.js} +1 -1
  38. package/dist/assets/{highlighted-body-OFNGDK62-CIIdpJOV.js → highlighted-body-OFNGDK62-dkUlu-Yf.js} +1 -1
  39. package/dist/assets/{index-CVElkIyB.js → index-DZcxHX-q.js} +24 -24
  40. package/dist/assets/mermaid-GHXKKRXX-DWJbe-FR.js +1 -0
  41. package/dist/assets/{pdf-DYyorNYM.js → pdf-XVS5_Y6b.js} +1 -1
  42. package/dist/assets/roleDescriptions-ReA48WUh.js +1 -0
  43. package/dist/assets/{table-HcdAROEr.js → table-BlgvNhKf.js} +1 -1
  44. package/dist/assets/{tabs--02lZ4zx.js → tabs-CXQdq7rn.js} +1 -1
  45. package/dist/assets/x-B77pQElB.js +1 -0
  46. package/dist/index.html +7 -7
  47. package/package.json +1 -1
  48. package/dist/assets/AccessTab-gIcazyyd.js +0 -1
  49. package/dist/assets/AnomaliesTab-Xzr68-lj.js +0 -1
  50. package/dist/assets/FeedbacksTab-B5AD5fns.js +0 -1
  51. package/dist/assets/FilesTab-2LXlwGbm.js +0 -1
  52. package/dist/assets/InstancesTab-efmqJkiF.js +0 -1
  53. package/dist/assets/PreferencesTab-Bntqbb3v.js +0 -1
  54. package/dist/assets/RolesTab-Dur_DWik.js +0 -1
  55. package/dist/assets/ScheduledTab-vr9ejIr6.js +0 -1
  56. package/dist/assets/ServiceAccountsTab-CDRsanZ2.js +0 -1
  57. package/dist/assets/ThemeShowroom-CIz45LkB.js +0 -1
  58. package/dist/assets/TracesTab-Drz4v12P.js +0 -1
  59. package/dist/assets/UsersTab-BM5wnZH4.js +0 -1
  60. package/dist/assets/VoiceTab-dC1OIeva.js +0 -1
  61. package/dist/assets/chevrons-up-down-QpMWDm41.js +0 -1
  62. package/dist/assets/dist-Dw05q7xL.js +0 -44
  63. package/dist/assets/mermaid-GHXKKRXX-B05YFZFp.js +0 -1
  64. package/dist/assets/roleDescriptions-5T4_7YgE.js +0 -1
  65. package/dist/assets/x-DiDC_TeC.js +0 -1
@@ -0,0 +1 @@
1
+ import{$y as e,Qy as t,Xy as n,Zy as r,eb as i}from"./dist-BKXYNjW7.js";var a={pending:i,user:e,admin:t,observer:r,agent:n};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-Dw05q7xL.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-BKXYNjW7.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-Dw05q7xL.js";import{t as d}from"./dist-Czk9m5q_.js";import{At as f,jt as p,kt as m}from"./index-CVElkIyB.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[p]),b=p(),[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)(m,{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-BKXYNjW7.js";import{t as d}from"./dist-D06QCQPB.js";import{At as f,jt as p,kt as m}from"./index-DZcxHX-q.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[p]),b=p(),[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)(m,{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-BKXYNjW7.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
@@ -62,14 +62,14 @@
62
62
  document.documentElement.dataset.motion = "static";
63
63
  })();
64
64
  </script>
65
- <script type="module" crossorigin src="/assets/index-CVElkIyB.js"></script>
65
+ <script type="module" crossorigin src="/assets/index-DZcxHX-q.js"></script>
66
66
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
67
- <link rel="modulepreload" crossorigin href="/assets/dist-Dw05q7xL.js">
68
- <link rel="modulepreload" crossorigin href="/assets/dist-Czk9m5q_.js">
69
- <link rel="modulepreload" crossorigin href="/assets/dist-B7glRJ6t.js">
70
- <link rel="modulepreload" crossorigin href="/assets/dist-DDmOEYQC.js">
71
- <link rel="modulepreload" crossorigin href="/assets/x-DiDC_TeC.js">
72
- <link rel="modulepreload" crossorigin href="/assets/button-CJcuK3wk.js">
67
+ <link rel="modulepreload" crossorigin href="/assets/dist-BKXYNjW7.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/dist-D06QCQPB.js">
69
+ <link rel="modulepreload" crossorigin href="/assets/dist-CchsedUP.js">
70
+ <link rel="modulepreload" crossorigin href="/assets/dist-x2y4VoOj.js">
71
+ <link rel="modulepreload" crossorigin href="/assets/x-B77pQElB.js">
72
+ <link rel="modulepreload" crossorigin href="/assets/button-CdHluvSK.js">
73
73
  <link rel="stylesheet" crossorigin href="/assets/index-C6zNVqw_.css">
74
74
  </head>
75
75
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacneu/atrium",
3
- "version": "0.55.2",
3
+ "version": "0.55.3",
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 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{E as r,_P as i,_d as a,ad as o,cP as s,cd as c,dd as l,fd as u,gd as d,hd as f,id as p,ld as m,md as h,od as g,pd as _,rd as v,sd as y,ud as b}from"./dist-Dw05q7xL.js";import{C as x,S,T as C,dt as w,w as T,x as E}from"./index-CVElkIyB.js";var D=t(e(),1);function O(e){return e===`user`?y():e===`all`?g():o({group:e.group})}function k(e){return e===`common`?p():e===`owner`?v():o({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=i(r.admin.listUsers,{}),[t,n]=(0,D.useState)(``),o=i(r.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:a()}),(0,A.jsxs)(E,{value:t,onValueChange:n,children:[(0,A.jsx)(T,{size:`sm`,"aria-label":d(),children:(0,A.jsx)(C,{placeholder:d()})}),(0,A.jsx)(S,{children:(e??[]).map(e=>(0,A.jsx)(x,{value:e.userId,children:j(e)},e._id))})]}),t===``?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):o===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,A.jsxs)(`div`,{className:`oc-introspect`,children:[(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:h()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:o.user.label}),(0,A.jsx)(w,{variant:`secondary`,children:o.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:_()}),o.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:o.groups.map(e=>(0,A.jsx)(w,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:u()}),o.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:o.agents.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,A.jsx)(w,{variant:`default`,children:c()}):null,(0,A.jsx)(w,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(w,{variant:`secondary`,children:e.state})]},`${e.instanceName} ${e.agentId}`))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:l()}),o.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:o.charts.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,A.jsx)(w,{variant:`outline`,children:k(e.via)})]},e.key))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:b()}),o.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:o.permissions.map(e=>(0,A.jsx)(w,{variant:`secondary`,children:e},e))})]})]})]})}export{M as AccessTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$v as r,Ay as i,By as a,Cy as ee,Dy as o,E as s,Ey as te,Fy as ne,Iy as c,Jv as l,Ly as u,My as d,Ny as re,Oy as ie,Py as ae,Qv as f,Ry as p,Sy as oe,Ty as se,Xv as m,Yv as h,Zv as g,_P as _,_y as v,ay as ce,by as le,cy as ue,dy as y,ey as b,fy as de,gP as fe,gy as pe,hy as x,iy as me,jy as he,ky as ge,ly as _e,my as ve,ny as S,oy as C,py as w,ry as T,sy as E,ty as D,uy as O,vy as k,wy as A,xy as j,yy as M,zy as N}from"./dist-Dw05q7xL.js";import{C as P,H as F,S as I,T as L,U as ye,_t as R,dt as z,i as be,mt as B,nn as V,o as xe,pt as H,rn as Se,rt as Ce,vt as U,w as W,wt as we,x as G}from"./index-CVElkIyB.js";import{n as Te}from"./TimeRangePicker-5EYfNRUQ.js";import{t as Ee}from"./FilterBar-D6zZSKoR.js";import{t as De}from"./DataTableShell-CRhep8-q.js";import{t as K}from"./dispatchErrorInfo-CGkgIKQB.js";var q=t(e(),1),J=n(),Y=`__all__`,Oe=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function ke(e){return e===`open`?a():e===`acknowledged`?N():p()}var Ae=[`info`,`warn`,`critical`],je=[`detector`,`agent`,`user`],Me={kind:`relative`,from:`now-30d`,to:`now`},Ne=200,X=`all`;function Z(){let e=Se({from:`/settings/anomalies`}),t=V({from:`/settings/anomalies`}),n=e.q??``,r=e.status===X?Y:e.status,a=e.severity??Y,l=e.kind??Y,[f,p]=(0,q.useState)(Y),m=be(e.from,e.to),{from:h,to:g}=Te(m),b=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),D=e=>void t({search:t=>({...t,status:e===Y?X:e})}),N=e=>void t({search:t=>({...t,severity:e===Y?void 0:e})}),R=e=>void t({search:t=>({...t,kind:e===Y?void 0:e})}),B=e=>void t({search:t=>({...t,...xe(e)})}),H=ye(),U=F(),K=fe(s.anomalies.resolveAnomaly),Z=(_(s.me.getMe,{host:we})?.permissions??[]).includes(`admin.manage`),Q=_(s.anomalies.listAnomalies,{limit:Ne,filter:{q:n||void 0,from:h,to:g,anomalyStatus:r===Y?void 0:r,severity:a===Y?void 0:a,source:f===Y?void 0:f,kind:l===Y?void 0:l}}),$=(0,q.useMemo)(()=>{let e=new Set;for(let t of Q??[])e.add(t.kind);return[...e].sort()},[Q]),ze=n!==``||r!==`open`||a!==Y||f!==Y||l!==Y||m.kind!==`relative`||m.from!==Me.from;function Be(){p(Y),t({search:{status:`open`},replace:!0})}async function Ve(e){if(await H({title:u(),description:(0,J.jsxs)(J.Fragment,{children:[c(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,ne(),` `,(0,J.jsx)(`strong`,{children:ae()}),`.`,` `,re()]}),confirmLabel:d()}))try{await K({anomalyId:e._id,status:`resolved`}),U.success(he(),e.kind)}catch(e){U.error(i(),e)}}async function He(e){try{await K({anomalyId:e._id,status:`acknowledged`}),U.success(ge(),e.kind)}catch(e){U.error(ie(),e)}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[o(),` `,(0,J.jsx)(`strong`,{children:te()}),` `,se(),` `,(0,J.jsx)(`strong`,{children:A()}),` `,ee(),` `,(0,J.jsx)(`strong`,{children:oe()}),` `,j(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:le()})]}),(0,J.jsxs)(Ee,{q:n,onQChange:b,searchPlaceholder:M(),timeRange:m,onTimeRangeChange:B,onReset:Be,canReset:ze,children:[(0,J.jsxs)(G,{value:r,onValueChange:D,children:[(0,J.jsx)(W,{size:`sm`,className:`w-36`,children:(0,J.jsx)(L,{})}),(0,J.jsxs)(I,{children:[(0,J.jsx)(P,{value:Y,children:k()}),Oe.map(e=>(0,J.jsx)(P,{value:e.value,children:ke(e.value)},e.value))]})]}),(0,J.jsxs)(G,{value:a,onValueChange:N,children:[(0,J.jsx)(W,{size:`sm`,className:`w-36`,children:(0,J.jsx)(L,{placeholder:v()})}),(0,J.jsxs)(I,{children:[(0,J.jsx)(P,{value:Y,children:pe()}),Ae.map(e=>(0,J.jsx)(P,{value:e,children:e},e))]})]}),(0,J.jsxs)(G,{value:f,onValueChange:p,children:[(0,J.jsx)(W,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:x()})}),(0,J.jsxs)(I,{children:[(0,J.jsx)(P,{value:Y,children:ve()}),je.map(e=>(0,J.jsx)(P,{value:e,children:e},e))]})]}),(0,J.jsxs)(G,{value:l,onValueChange:R,children:[(0,J.jsx)(W,{size:`sm`,className:`w-36`,children:(0,J.jsx)(L,{placeholder:w()})}),(0,J.jsxs)(I,{children:[(0,J.jsx)(P,{value:Y,children:de()}),$.map(e=>(0,J.jsx)(P,{value:e,children:e},e))]})]})]}),(0,J.jsx)(De,{title:y(),rows:Q,emptyHint:r===`open`?O():_e(),rowActions:e=>Z&&e.status===`open`?[{label:ue(),onSelect:()=>void Ve(e)},{label:E(),onSelect:()=>void He(e)}]:[],columns:[{header:C(),cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:Ce(e.at)}),sort:e=>e.at},{header:w(),cell:e=>(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:v(),cell:e=>(0,J.jsx)(Ie,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:ce(),cell:e=>(0,J.jsx)(Le,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:x(),cell:e=>(0,J.jsx)(z,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:me(),cell:e=>(0,J.jsxs)(`div`,{className:`oc-anomaly__msgcell`,children:[(0,J.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),(0,J.jsx)(Fe,{row:e})]}),sort:e=>e.message},{header:T(),cell:e=>(0,J.jsx)(Pe,{row:e}),sort:e=>e.evidence??null},{header:S(),cell:e=>e.correlationId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:Re(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function Q(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 $(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 Pe({row:e}){let t=V();if(e.kind===`subagent.failure`){let n=$(e);return(0,J.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,J.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,J.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,D()]}):null]})}let n=Q(e);if(!n.dominantCode)return(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=K(n.dominantCode),i=n.sampleCorrelationId;return(0,J.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,J.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,J.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,J.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,J.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,D()]}):null]})}function Fe({row:e}){let[t,n]=(0,q.useState)(!1),i=_(s.anomalies.getAnomalyAttachments,t?{anomalyId:e._id}:`skip`);return!e.attachments||e.attachments.length===0?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>n(!0),children:[b(),e.attachments.length>1?` (${e.attachments.length})`:``]}),(0,J.jsx)(H,{open:t,onOpenChange:n,children:(0,J.jsxs)(B,{className:`oc-anomaly__attachments-dialog`,children:[(0,J.jsx)(R,{children:(0,J.jsx)(U,{children:r()})}),i===void 0?(0,J.jsx)(`p`,{className:`oc-traces__muted`,children:f()}):i.length===0?(0,J.jsx)(`p`,{className:`oc-traces__muted`,children:g()}):(0,J.jsx)(`div`,{className:`oc-anomaly__attachments`,children:i.map(e=>(0,J.jsxs)(`section`,{className:`oc-anomaly__attachment`,children:[(0,J.jsx)(`h4`,{className:`oc-anomaly__attachment-name`,children:(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.name})}),(0,J.jsx)(`pre`,{className:`oc-anomaly__attachment-content`,children:e.content})]},e.name))})]})})]})}function Ie({severity:e}){return(0,J.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function Le({status:e}){return e===`open`?(0,J.jsx)(z,{variant:`destructive`,children:m()}):e===`acknowledged`?(0,J.jsx)(z,{variant:`secondary`,children:h()}):(0,J.jsx)(z,{variant:`outline`,children:l()})}function Re(e){return e.length>8?e.slice(0,8):e}export{Z as AnomaliesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,AC as i,BC as a,CC as o,DC as s,E as c,EC as l,FC as u,GC as d,HC as f,IC as p,JC as m,KC as ee,LC as te,MC as h,NC as g,OC as _,PC as v,QC as y,RC as ne,SC as b,TC as x,UC as re,VC as ie,WC as S,XC as C,YC as w,ZC as T,_C as E,_P as D,ai as O,aw as k,bC as A,cw as j,dC as M,ew as N,fC as P,gC as F,gP as I,hC as L,iw as R,jC as z,kC as B,lC as V,lw as H,mC as U,nw as W,ow as G,pC as ae,qC as K,ri as q,rw as J,sw as oe,tw as se,uC as ce,uw as le,vC as ue,wC as de,xC as fe,yC as pe,zC as me}from"./dist-Dw05q7xL.js";import{t as he}from"./button-CJcuK3wk.js";import{U as ge,rt as _e}from"./index-CVElkIyB.js";import{t as Y}from"./DataTableShell-CRhep8-q.js";var X=t(e(),1),Z=n(),ve={altered_words:()=>le(),incorrect:()=>H(),incoherence:()=>j(),formatting:()=>oe(),latency:()=>G(),api_error:()=>k(),other:()=>R()},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:W()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:se()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:J()})}function ye({data:e,closeReason:t}){let n=e.snapshot,i=I(c.feedback.respondToFeedback),[o,s]=(0,X.useState)(e.thread),[l,h]=(0,X.useState)(``),[g,_]=(0,X.useState)(!1);async function b(){let t=l.trim();if(!(!t||g)){_(!0);try{await i({feedbackId:e._id,text:t}),s(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),h(``)}finally{_(!1)}}}let x=[];try{x=n.contextJson?JSON.parse(n.contextJson):[]}catch{x=[]}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?` · ${N()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:r()}),(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:L()}),(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:y()}),o.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:o.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`?T():e.authorRole===`agent`?e.authorLabel??O():C()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:w()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:m(),value:l,maxLength:2e3,rows:3,onChange:e=>h(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 b(),disabled:!l.trim()||g,children:g?K():ee()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:d()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||S()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:re()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||S()})]}):null,n.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:f()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,x.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ie({count:n.contextCount??x.length,truncated:n.contextTruncated?a():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:x.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:me()}),(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:ne()}),(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:te()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?p({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:[` `,v()]})]}):null,n.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function be(){let e=D(c.feedback.listForAdmin,{}),t=I(c.feedback.readSnapshot),n=I(c.feedback.deleteFeedback),r=ge(),[a,u]=(0,X.useState)(null),[d,f]=(0,X.useState)({});async function p(e){if(a===e._id){u(null);return}if(!d[e._id]){let n=await t({feedbackId:e._id});f(t=>({...t,[e._id]:n}))}u(e._id)}async function m(e){await r({title:M(),description:ce(),confirmLabel:V(),destructive:!0})&&(await n({feedbackId:e._id}),a===e._id&&u(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[g(),` `,(0,Z.jsx)(`strong`,{children:h()}),` `,z()]}),(0,Z.jsx)(Y,{title:i(),rows:e,emptyHint:B(),isExpanded:e=>a===e._id&&!!d[e._id],renderExpanded:e=>d[e._id]?(0,Z.jsx)(ye,{data:d[e._id],closeReason:e.userCloseReason}):null,columns:[{header:_(),cell:e=>_e(e.at),sort:e=>e.at},{header:s(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:l(),cell:e=>e.messageRole===`user`?x():de(),sort:e=>e.messageRole},{header:o(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${b({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:fe(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:A(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:pe(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:ue()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:E()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:q()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:F()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:a===e._id?U():ae(),onSelect:()=>void p(e)},{label:P(),onSelect:()=>void m(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{AN as ee,CN as r,DN as i,E as a,EN as te,FN as o,MN as s,NN as ne,ON as re,PN as ie,SN as c,TN as ae,_N as oe,_P as se,aN as ce,bN as l,cN as u,cP as le,ci as ue,dN as d,eN as f,fN as p,gN as m,gP as h,hN as de,iN as fe,jN as g,kN as pe,lD as me,lN as he,li as _,mN as ge,nN as _e,oN as ve,pN as ye,rN as be,sN as xe,tN as v,uN as y,uP as b,vN as x,wN as S,xN as C,yN as w}from"./dist-Dw05q7xL.js";import{t as T}from"./button-CJcuK3wk.js";import{C as E,Ft as D,G as O,H as k,J as A,K as j,Q as M,S as N,T as P,X as Se,Xt as F,Y as Ce,Yt as we,Z as Te,at as Ee,dt as I,m as De,ot as Oe,q as ke,st as L,ut as Ae,w as R,x as z,zt as je}from"./index-CVElkIyB.js";import{a as Me,i as B,n as Ne,o as V,r as H,t as Pe}from"./table-HcdAROEr.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return S();case`audio`:return r();case`video`:return c();case`pdf`:return C();case`document`:return l();case`archive`:return w();default:return x()}}function q(){let[e,t]=(0,U.useState)(G),[n,r]=(0,U.useState)(G),[c,l]=(0,U.useState)(G),[x,S]=(0,U.useState)(G),[C,w]=(0,U.useState)(!1),[q,J]=(0,U.useState)(null),Fe=h(a.files.softDelete),Y=k();function Ie(){t(G),r(G),l(G),S(G)}async function Le(){let e=q;if(J(null),e)try{await Fe({fileId:e.id}),Y.success(xe())}catch(e){Y.error(ve(),e)}}let X=se(a.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:c===G?void 0:c,category:x===G?void 0:x,includeAutoGenerated:C||void 0}),Re=(0,U.useMemo)(()=>new Intl.DateTimeFormat(b(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:le()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==G||n!==G||c!==G||x!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:o()}),(0,W.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,W.jsxs)(z,{value:e,onValueChange:t,children:[(0,W.jsx)(R,{size:`sm`,"aria-label":ie(),children:(0,W.jsx)(P,{})}),(0,W.jsxs)(N,{children:[(0,W.jsx)(E,{value:G,children:ne()}),(0,W.jsx)(E,{value:`inbound`,children:s()}),(0,W.jsx)(E,{value:`outbound`,children:g()})]})]}),(0,W.jsxs)(z,{value:n,onValueChange:r,children:[(0,W.jsx)(R,{size:`sm`,"aria-label":ee(),children:(0,W.jsx)(P,{})}),(0,W.jsxs)(N,{children:[(0,W.jsx)(E,{value:G,children:pe()}),Q.chats.map(e=>(0,W.jsx)(E,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,W.jsxs)(z,{value:c,onValueChange:l,children:[(0,W.jsx)(R,{size:`sm`,"aria-label":re(),children:(0,W.jsx)(P,{})}),(0,W.jsxs)(N,{children:[(0,W.jsx)(E,{value:G,children:i()}),Q.instances.map(e=>(0,W.jsx)(E,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(z,{value:x,onValueChange:S,children:[(0,W.jsx)(R,{size:`sm`,"aria-label":te(),children:(0,W.jsx)(P,{})}),(0,W.jsxs)(N,{children:[(0,W.jsx)(E,{value:G,children:ae()}),Q.categories.map(e=>(0,W.jsx)(E,{value:e,children:K(e)},e))]})]}),(0,W.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,W.jsx)(De,{checked:C,onCheckedChange:e=>w(e===!0),"aria-label":_()}),(0,W.jsx)(`span`,{children:_()})]}),$?(0,W.jsxs)(T,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,W.jsx)(je,{size:14,"aria-hidden":!0}),y()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?v():_e()}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Pe,{children:[(0,W.jsx)(Me,{children:(0,W.jsxs)(V,{children:[(0,W.jsx)(B,{children:oe()}),(0,W.jsx)(B,{children:m()}),(0,W.jsx)(B,{children:de()}),(0,W.jsx)(B,{children:ge()}),(0,W.jsx)(B,{children:ye()}),(0,W.jsx)(B,{className:`text-right`,children:p()})]})}),(0,W.jsx)(Ne,{children:Z.map(e=>(0,W.jsxs)(V,{children:[(0,W.jsxs)(H,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:[e.filename,e.origin===`pasted`?(0,W.jsx)(I,{variant:`outline`,style:{marginLeft:6},children:ue()}):null]}),(0,W.jsx)(H,{title:e.mimeType,children:K(e.category)}),(0,W.jsx)(H,{children:(0,W.jsx)(I,{variant:`secondary`,children:e.direction===`inbound`?s():g()})}),(0,W.jsx)(H,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,W.jsx)(H,{className:`whitespace-nowrap text-muted-foreground`,children:Re.format(e.createdAt)}),(0,W.jsx)(H,{className:`text-right`,children:(0,W.jsxs)(Ee,{children:[(0,W.jsx)(Ae,{asChild:!0,children:(0,W.jsx)(T,{variant:`ghost`,size:`icon`,"aria-label":he(),children:(0,W.jsx)(we,{size:16})})}),(0,W.jsxs)(Oe,{align:`end`,children:[e.url?(0,W.jsx)(L,{asChild:!0,children:(0,W.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,W.jsx)(F,{size:14}),d()]})}):(0,W.jsxs)(L,{disabled:!0,children:[(0,W.jsx)(F,{size:14}),be()]}),(0,W.jsxs)(L,{variant:`destructive`,onSelect:()=>J({id:e._id,filename:e.filename}),children:[(0,W.jsx)(D,{size:14}),u()]})]})]})})]},e._id))})]}),ze?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:f({cap:Be})}):null]}),(0,W.jsx)(O,{open:q!==null,onOpenChange:e=>!e&&J(null),children:(0,W.jsxs)(A,{children:[(0,W.jsxs)(Te,{children:[(0,W.jsx)(M,{children:ce()}),(0,W.jsx)(Ce,{children:fe()})]}),(0,W.jsxs)(Se,{children:[(0,W.jsx)(ke,{children:me()}),(0,W.jsx)(j,{onClick:()=>void Le(),children:u()})]})]})})]})}export{q 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,$x as i,AS as a,Ax as o,Bx as s,CS as c,Cx as l,DS as u,Dx as d,E as f,ES as p,Ex as m,FS as h,Fx as g,Gx as _,Hx as v,Ix as y,Jb as b,Jt as x,Jx as S,Kb as C,Kx as ee,Lg as te,Lx as ne,MS as re,Mx as w,NS as T,Nx as ie,OS as ae,Ox as oe,PS as se,Px as ce,Qb as le,Qx as E,Rg as ue,Rx as de,SS as fe,Sx as pe,TS as me,Tx as he,Ux as ge,Vx as D,Wx as _e,Xb as ve,Xt as ye,Xx as be,Yb as xe,Yt as Se,Yx as Ce,Zb as we,Zx as O,_P as k,_S as Te,_x as Ee,aS as De,ax as Oe,bS as ke,bx as Ae,cS as je,ca as Me,cx as Ne,dS as Pe,da as Fe,dx as Ie,eS as Le,ex as Re,fS as ze,fx as Be,gP as A,gS as Ve,gx as j,hS as He,iS as Ue,ix as We,jS as Ge,jx as Ke,kS as qe,kx as Je,lS as Ye,la as Xe,lx as Ze,mP as M,mS as Qe,mx as $e,nO as et,nS as tt,nx as nt,oS as rt,ox as it,pS as at,px as ot,qb as N,qx as st,rS as ct,rx as lt,sS as ut,sx as dt,tO as P,tS as ft,tx as pt,uS as mt,ua as ht,ux as gt,vS as _t,vx as vt,wS as yt,wx as bt,xS as F,xx as I,yS as xt,yx as L,zx as St}from"./dist-Dw05q7xL.js";import{a as Ct,c as wt}from"./FieldLabel-Cam2yQ_L.js";import{t as R}from"./button-CJcuK3wk.js";import{$ as Tt,C as z,H as B,S as V,T as H,U as Et,_t as U,d as Dt,dt as W,et as Ot,ft as G,ht as K,m as kt,mt as At,pt as jt,tt as Mt,vt as Nt,w as q,x as J}from"./index-CVElkIyB.js";import{t as Pt}from"./DataTableShell-CRhep8-q.js";import{InstanceConfigDialog as Ft}from"./BridgeTab-CBfGV3MJ.js";var Y=t(e(),1),X=[`conversational`,`documentary`,`summarizer`,`curator`],It=new Set(X),Lt=`conversational`;function Rt(e){let t=new Set((e??[]).filter(e=>It.has(e)));return t.size===0?[Lt]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,transport:`ws`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:Ct},zt={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Bt(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 Vt(){let e=k(f.admin.listInstances,{}),t=k(f.agents.listAllInstanceAgents,{}),n=A(f.admin.upsertInstance),r=A(f.admin.deleteInstance),i=B(),[o,s]=(0,Y.useState)(!1),[l,d]=(0,Y.useState)(Q),[m,g]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(null),[S,C]=(0,Y.useState)(null);async function ee(){try{await n({instanceId:S??void 0,name:l.name,gatewayUrl:l.gatewayUrl,bridgeUrl:l.bridgeUrl||void 0,displayName:l.displayName||void 0,kind:l.kind,transport:l.kind===`hermes`?l.transport:void 0,gatewayVersion:l.gatewayVersion||void 0,gatewayHttpUrl:l.gatewayHttpUrl||void 0,streamTransport:l.streamTransport}),d(Q),C(null),s(!1)}catch(e){i.error(T(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[re(),(0,Z.jsx)(`strong`,{children:Ge()}),a()]}),(0,Z.jsx)(Pt,{title:qe(),rows:e,addLabel:ae(),onAdd:()=>{C(null),d(Q),s(!0)},emptyHint:u(),columns:[{header:p(),cell:e=>e.name,sort:e=>e.name},{header:me(),cell:e=>(0,Z.jsx)(W,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:yt(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:c(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:h(),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)(W,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?N():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:xt(),onSelect:()=>{C(e._id),d(Bt(e)),s(!0)}},{label:se(),onSelect:()=>g(e.name)},{label:Ue(),onSelect:()=>b(e)},{label:fe(),onSelect:()=>v(e)},{label:F(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:F(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(Dt,{open:o,onOpenChange:s,title:S?_t():ke(),description:Ve(),canSubmit:!!(l.name&&l.gatewayUrl),onSubmit:ee,submitLabel:He(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:Qe(),children:[(0,Z.jsx)(G,{value:l.name,disabled:S!==null,onChange:e=>d({...l,name:e.target.value})}),S?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Te()}):null]}),(0,Z.jsx)($,{label:at(),children:(0,Z.jsxs)(J,{value:l.kind,onValueChange:e=>d({...l,kind:e}),children:[(0,Z.jsx)(q,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(H,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(z,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(z,{value:`hermes`,children:`Hermes`})]})]})}),l.kind===`hermes`?(0,Z.jsx)($,{label:ye(),children:(0,Z.jsxs)(J,{value:l.transport,onValueChange:e=>d({...l,transport:e}),children:[(0,Z.jsx)(q,{size:`sm`,className:`w-56`,children:(0,Z.jsx)(H,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(z,{value:`ws`,children:Se()}),(0,Z.jsx)(z,{value:`rest`,children:x()})]})]})}):null,(0,Z.jsx)($,{label:ze(),children:(0,Z.jsx)(G,{value:l.gatewayUrl,onChange:e=>d({...l,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:Pe(),children:(0,Z.jsx)(G,{value:l.bridgeUrl,placeholder:mt(),onChange:e=>d({...l,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:Ye(),children:(0,Z.jsx)(G,{value:l.displayName,onChange:e=>d({...l,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:ue(),children:[(0,Z.jsxs)(J,{value:l.streamTransport,onValueChange:e=>d({...l,streamTransport:e}),children:[(0,Z.jsx)(q,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(H,{})}),(0,Z.jsx)(V,{children:wt.map(e=>(0,Z.jsx)(z,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:te()})]}),(0,Z.jsx)($,{label:je(),children:(0,Z.jsx)(G,{value:l.gatewayVersion,placeholder:ut(),onChange:e=>d({...l,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:rt(),children:(0,Z.jsx)(G,{value:l.gatewayHttpUrl,placeholder:De(),onChange:e=>d({...l,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Zt,{instanceName:m,open:m!==null,onOpenChange:e=>{e||g(null)}}),_?(0,Z.jsx)(Ft,{instance:_,onClose:()=>v(null)},_._id):null,y?(0,Z.jsx)(Ht,{instance:y,onClose:()=>b(null)},y._id):null]})}function Ht({instance:e,onClose:t}){let n=k(f.instanceSecrets.listInstanceSecretStatus,{}),r=zt[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)(jt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(At,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(U,{children:[(0,Z.jsx)(Nt,{children:ct({instance:e.displayName??e.name})}),(0,Z.jsx)(K,{children:tt()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Gt,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Wt,{instance:e})}),(0,Z.jsx)(Ut,{instance:e})]})})}function Ut({instance:e}){let t=M(f.instanceSync.forceInstanceSync),n=B(),[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(y());break;case`no_agents`:n.success(ce());break;case`no_bridge_url`:n.error(ie());break;case`deploy_misconfigured`:n.error(w());break;case`unauthorized`:n.error(o());break;case`not_served`:n.error(Je());break;default:n.error(Ke());break}}catch(e){n.error(g(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:oe()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(R,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?ne():de()})})]})}function Wt({instance:e}){let t=k(f.bridgeAuth.listBridgeAuthStatus,{}),n=M(f.bridgeAuth.mintBridgeSecret),r=A(f.bridgeAuth.revokeBridgeSecret),i=B(),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(null),[u,p]=(0,Y.useState)(!1),h=(t??[]).find(t=>t.instanceId===e._id),g=h!==void 0;async function _(){if(!a){o(!0);try{c((await n({instanceId:e._id})).plaintext),p(!1)}catch(e){i.error(I(),e)}finally{o(!1)}}}async function v(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(pe())}catch(e){i.error(I(),e)}finally{o(!1)}}}async function y(){if(s)try{await navigator.clipboard.writeText(s),p(!0)}catch{}}return(0,Z.jsxs)($,{label:d(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:m()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(W,{variant:g?`outline`:`secondary`,children:g?`${E()} · ${h.prefix}…${h.lastFour}`:O()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(R,{size:`sm`,onClick:()=>void _(),disabled:a,children:g?bt():he()}),g?(0,Z.jsx)(R,{size:`sm`,variant:`destructive`,onClick:()=>void v(),disabled:a,children:l()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:Ae()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>void y(),children:u?et():P()})]}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),p(!1)},children:L()})]}):null]})}function Gt({instanceId:e,field:t,updatedAt:n}){let r=M(f.instanceSecrets.setInstanceSecret),a=A(f.instanceSecrets.clearInstanceSecret),o=M(f.deviceIdentity.generateDeviceIdentity),c=B(),[l,u]=(0,Y.useState)(``),[d,p]=(0,Y.useState)(!1),[m,h]=(0,Y.useState)(null),[g,y]=(0,Y.useState)(!1),b=n!==null,x=t===`deviceIdentity`,C=t===`token`?ft():t===`deviceIdentity`?Le():i();async function te(){if(!(!l.trim()||d)){p(!0);try{await r({instanceId:e,field:t,plaintext:l}),u(``),h(null),y(!1),c.success(ee())}catch(e){c.error(_(),e)}finally{p(!1)}}}async function ne(){if(!d){p(!0);try{await a({instanceId:e,field:t}),h(null),y(!1),c.success(_e())}catch(e){c.error(_(),e)}finally{p(!1)}}}async function re(){if(!d){p(!0);try{h(await o({instanceId:e})),y(!1),c.success(D())}catch(e){c.error(St(),e)}finally{p(!1)}}}let w=m?`openclaw devices approve ${m.id}`:``;async function T(){if(w)try{await navigator.clipboard.writeText(w),y(!0)}catch{}}return(0,Z.jsxs)($,{label:C,children:[x?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(W,{variant:b?`outline`:`secondary`,children:b?E():O()}),(0,Z.jsx)(G,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:l,placeholder:b?Ce():be(),onChange:e=>u(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(R,{size:`sm`,onClick:()=>void te(),disabled:d||l.trim().length===0,children:S()}),x?(0,Z.jsx)(R,{size:`sm`,variant:`outline`,onClick:()=>void re(),disabled:d,children:ge()}):null,b?(0,Z.jsx)(R,{size:`sm`,variant:`destructive`,onClick:()=>void ne(),disabled:d,children:st()}):null]})]}),m?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:D()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:s()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:w}),(0,Z.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>void T(),children:g?et():P()})]}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,onClick:()=>{h(null),y(!1)},children:L()})]}):null]})}var Kt={conversational:Ne,documentary:it,summarizer:Fe,curator:Xe},qt={conversational:dt,documentary:Oe,summarizer:ht,curator:Me},Jt=e=>(Kt[e]??(()=>e))(),Yt=e=>(qt[e]??(()=>``))();function Xt({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:Be()}),t.map(e=>(0,Z.jsx)(W,{variant:`secondary`,className:`oc-agenttype__chip`,title:Yt(e),children:Jt(e)},e)),(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(Mt,{asChild:!0,children:(0,Z.jsx)(R,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:Ie()})}),(0,Z.jsxs)(Ot,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:gt()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:Ze()}),(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)(kt,{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:Jt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Yt(r)})]})]},r)})})]})]})]})}function Zt({instanceName:e,open:t,onOpenChange:n}){let i=k(f.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),a=A(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)})}),o=A(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=A(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=Rt(r);e.setQuery(f.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),c=A(f.agents.setAgentDescription).withOptimisticUpdate((e,{instanceName:t,agentId:n,description:r})=>{let i=e.getQuery(f.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=r.trim();e.setQuery(f.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,description:a.length===0?null:a}:e)})}),l=A(f.agents.removeInstanceAgent),u=Et(),d=B();async function p(t,n){if(e)try{await a({instanceName:e,agentId:t,enabled:n})}catch(e){d.error(j(),e)}}async function m(t){if(e)try{await o({instanceName:e,agentId:t})}catch(e){d.error(j(),e)}}async function h(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(j(),e)}}async function g(t,n){if(e&&await u({title:nt({name:n}),description:pt(),confirmLabel:Re(),destructive:!0}))try{await l({instanceName:e,agentId:t}),d.success(r())}catch(e){d.error(j(),e)}}return(0,Z.jsx)(jt,{open:t,onOpenChange:n,children:(0,Z.jsxs)(At,{className:`oc-access`,children:[(0,Z.jsxs)(U,{children:[(0,Z.jsx)(Nt,{children:vt({name:e??``})}),(0,Z.jsx)(K,{children:Ee()})]}),i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:le()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:i.discovery===null?we():i.discovery.lastPollOk?ve():xe({error:i.discovery.error??`?`})}),i.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:b()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i.agents.map(t=>{let n=t.presentInLastOk===!1,r=i.defaultAgentId===t.agentId,a=t.displayName??t.agentId,o=t.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(t.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(kt,{checked:t.enabled,disabled:n,"aria-label":a,onCheckedChange:e=>void p(t.agentId,e===!0)}),(0,Z.jsxs)(`span`,{className:`oc-agentcard__name`,title:a,children:[t.emoji?`${t.emoji} `:``,a]}),t.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:t.model}):null,n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:C()}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void g(t.agentId,a),children:lt()})]}):r?(0,Z.jsx)(W,{variant:`default`,children:N()}):(0,Z.jsx)(R,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!t.enabled,onClick:()=>void m(t.agentId),children:We()})]}),t.enabled?(0,Z.jsx)(Xt,{agentId:t.agentId,types:o,onToggle:e=>void h(t.agentId,e,o)}):null,t.enabled?(0,Z.jsx)(Qt,{value:t.description??``,onSave:async n=>{if(e)try{await c({instanceName:e,agentId:t.agentId,description:n})}catch(e){d.error(j(),e)}}}):null]},t.agentId)})})]})]})})}function Qt({value:e,onSave:t}){let[n,r]=(0,Y.useState)(e);(0,Y.useEffect)(()=>{r(e)},[e]);let i=()=>{n.trim()!==e.trim()&&t(n)};return(0,Z.jsx)(G,{className:`oc-agentcard__desc`,value:n,maxLength:280,placeholder:$e(),"aria-label":ot(),onChange:e=>r(e.target.value),onBlur:i,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i())}})}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{Vt as InstancesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$N as r,$k as i,A as a,Ak as o,BN as s,Bk as c,Ck as l,Dk as u,E as d,Ek as f,F as p,Fk as ee,G as te,GN as ne,Gk as re,HN as ie,Hk as ae,I as oe,Ik as se,JN as ce,Jk as le,KN as ue,Kk as de,L as fe,LN as pe,Lk as me,M as he,Mk as ge,N as _e,Nk as m,Ok as h,P as g,Pk as _,QN as v,Qk as y,RN as b,Rk as x,Sk as S,Tk as C,UN as w,Uk as T,VN as E,Vk as D,WN as O,Wk as k,X as A,XN as j,Xk as M,YN as N,Yk as P,Z as F,ZN as I,Zk as ve,_P as L,_k as ye,bk as be,cP as xe,eP as Se,gP as R,gk as Ce,hS as we,hk as Te,j as Ee,jk as De,kk as Oe,mk as ke,n as z,qN as Ae,qk as je,rP as Me,vk as Ne,wk as Pe,xk as B,yk as Fe,zN as Ie,zk as Le}from"./dist-Dw05q7xL.js";import{t as V}from"./button-CJcuK3wk.js";import{C as H,Ct as Re,H as ze,S as Be,St as Ve,T as He,dt as U,ft as W,j as Ue,m as G,t as We,w as Ge,wt as K,x as Ke,xt as qe}from"./index-CVElkIyB.js";import{t as Je}from"./localePickerView-C2RmOS86.js";var q=t(e(),1),J=n();function Ye({className:e,checked:t,onCheckedChange:n,disabled:r,...i}){return(0,J.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"data-state":t?`checked`:`unchecked`,disabled:r,onClick:()=>n(!t),className:z(`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,J.jsx)(`span`,{className:z(`pointer-events-none block size-4 rounded-full bg-background shadow transition-transform`,t?`translate-x-[18px]`:`translate-x-[2px]`)})})}var Y=[{id:`messages`,label:()=>i()},{id:`composer`,label:()=>y()},{id:`sidebar`,label:()=>ve()},{id:`notifications`,label:()=>_()},{id:`other`,label:()=>M()}],X={showSource:{category:`messages`,label:()=>P(),help:()=>le()},showReport:{category:`messages`,label:()=>je(),help:()=>de()},copyAssistant:{category:`messages`,label:()=>re()},copyUser:{category:`messages`,label:()=>k()},showDelete:{category:`messages`,label:()=>T()},showTools:{category:`messages`,label:()=>ae(),help:()=>D()},voiceInput:{category:`composer`,label:()=>c(),help:()=>Le()},showUsage:{category:`composer`,label:()=>x(),help:()=>me()},autoReadAloud:{category:`composer`,label:()=>F(),help:()=>A()},showChatAge:{category:`sidebar`,label:()=>se(),help:()=>ee()},notifSound:{category:`notifications`,label:()=>m(),help:()=>ge()},notifSystem:{category:`notifications`,label:()=>De(),help:()=>o()},replySound:{category:`notifications`,label:()=>Oe(),help:()=>h()}};function Z(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function Q(e,t){let n=Z(t.trim()),r=new Map(Y.map(e=>[e.id,e.label()])),i=new Map(Y.map(e=>[e.id,[]]));for(let t of e){let e=X[t],a=e?.category??`other`;n&&!Z(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return Y.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var Xe=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showUsage`,`autoReadAloud`,`notifSound`,`notifSystem`,`replySound`],Ze={voiceInput:`voiceInput`};function Qe(e){return Xe.includes(e)}function $(e){return e===`admin`}function $e(e){return e===!0?`on`:e===!1?`off`:`inherit`}function et(e){return e===`on`?!0:e===`off`?!1:null}function tt(e){return Qe(e)?Ze[e]:void 0}var nt={voiceInput:()=>Ne()};function rt({prefKey:e,ui:t}){let n=R(d.admin.setUiPrefDefault),r=R(d.admin.setFeatureEnabled),i=tt(e),a=i?nt[e]?.():void 0;return(0,J.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,J.jsx)(`span`,{className:`oc-prefs__gov-label`,children:S()}),(0,J.jsxs)(Ke,{value:$e(t.defaults[e]),onValueChange:t=>void n({key:e,value:et(t)}),children:[(0,J.jsx)(Ge,{size:`sm`,className:`w-36`,children:(0,J.jsx)(He,{})}),(0,J.jsxs)(Be,{children:[(0,J.jsx)(H,{value:`on`,children:Ce()}),(0,J.jsx)(H,{value:`off`,children:Te()}),(0,J.jsx)(H,{value:`inherit`,children:ke()})]})]}),i?(0,J.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,J.jsx)(G,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":B()}),B()]}):null]}),a?(0,J.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function it({current:e,enabled:t}){let n=R(d.me.setDictationShortcut),[r,i]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1);return(0,q.useEffect)(()=>{if(!r)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){i(!1);return}let t=Ve(e);if(t===null){[`Shift`,`Control`,`Meta`,`Alt`].includes(e.key)||(s(!0),window.setTimeout(()=>s(!1),1800));return}i(!1),n({shortcut:t})};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[r,n]),(0,J.jsxs)(`div`,{className:`oc-prefs__row${t?``:` is-locked`}`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,J.jsxs)(`span`,{className:`oc-prefs__label`,children:[fe(),e?(0,J.jsx)(U,{variant:`secondary`,children:Re(e,qe())}):null]}),(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:o?g():r?p():oe()})]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[e&&!r?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void n({shortcut:null}),children:a()}):null,(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,disabled:!t,"aria-pressed":r,onClick:()=>i(e=>!e),children:r?Ee():e?he():_e()})]})]})}function at(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=L(d.me.getMe,{host:K}),a=i?.ui,o=$(i?.role)&&n,s=R(d.me.setUiPref).withOptimisticUpdate(Ue),c=(0,q.useMemo)(()=>a?Q(Object.keys(a.effective),e):[],[a,e]);return a?(0,J.jsxs)(`div`,{className:`oc-prefs-panel`,children:[$(i?.role)?(0,J.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,J.jsx)(G,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":l()}),l()]}):null,o?(0,J.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,J.jsx)(`p`,{children:be()}),(0,J.jsx)(`p`,{children:Fe()}),(0,J.jsx)(`p`,{children:ye()})]}):null,(0,J.jsx)(W,{value:e,onChange:e=>t(e.target.value),placeholder:u(),"aria-label":u(),className:`mb-2`}),c.length===0?(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:f()}):(0,J.jsx)(`div`,{className:`oc-prefs`,children:c.map(e=>(0,J.jsxs)(`section`,{className:`oc-prefs__card`,children:[(0,J.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=X[e],n=t?t.label():e,r=t?.help?.(),i=a.locked[e],c=a.effective[e],l=a.userOverrides[e]!==void 0;return(0,J.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,J.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,J.jsx)(U,{variant:`outline`,children:C()}):l?(0,J.jsx)(U,{variant:`secondary`,children:te()}):null]}),r?(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&l?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void s({key:e,value:null}),children:Pe()}):null,(0,J.jsx)(Ye,{checked:c,disabled:i,onCheckedChange:t=>{e===`notifSystem`&&t&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission(),s({key:e,value:t})},"aria-label":n})]}),o?(0,J.jsx)(rt,{prefKey:e,ui:a}):null]},e)})]},e.id))}),(0,J.jsx)(it,{current:i?.dictationShortcut??null,enabled:a.effective.voiceInput===!0})]}):(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:xe()})}var ot={sm:()=>ie(),md:()=>E(),lg:()=>s(),xl:()=>Ie()};function st(){let e=L(d.me.getMe,{host:K}),t=R(d.me.setLocale),n=R(d.me.setFontScale).withOptimisticUpdate((e,{scale:t})=>{let n=e.getQuery(d.me.getMe,{host:K});n&&e.setQuery(d.me.getMe,{host:K},{...n,fontScale:t,resolvedFontScale:t??`md`})}),i=R(d.me.setMyName),a=ze(),o=e?.locale??`default`,s=e?.name??``,[c,l]=(0,q.useState)(null),u=c??s,f=u.trim()!==s.trim();async function p(){try{await i({name:u}),l(null),a.success(j())}catch(e){a.error(N(),e)}}return(0,J.jsxs)(`div`,{className:`oc-appearance`,children:[(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:Se()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:r()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(W,{className:`max-w-xs`,value:u,maxLength:120,placeholder:v(),onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f&&(e.preventDefault(),p())}}),(0,J.jsx)(V,{size:`sm`,disabled:!f,onClick:()=>void p(),children:we()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:I()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:ce()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[Je().map(e=>(0,J.jsx)(V,{variant:o===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,J.jsx)(V,{variant:o==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:Me()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:ue()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:ne()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:O()})]}),(0,J.jsx)(`div`,{className:`oc-show__row`,children:We.map(t=>(0,J.jsx)(V,{variant:(e?.fontScale??`md`)===t?`default`:`outline`,size:`sm`,onClick:()=>void n({scale:t}),children:ot[t]()},t))}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:w()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:b()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:pe()})]}),(0,J.jsx)(at,{})]})]})}export{st as PreferencesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ab as r,Cb as i,Db as a,E as o,Eb as s,Gy as ee,Hy as c,Jy as l,Ky as u,Ob as d,Sb as f,Tb as p,Uy as m,Vy as h,Wy as te,Yy as g,_P as _,_b as v,ab as y,bb as b,cb as ne,db as re,fb as ie,gP as x,gb as ae,hb as S,ib as C,kb as w,lb as T,mb as E,nb as D,ni as O,ob as k,pb as A,qy as j,rb as M,sb as N,tb as P,ub as F,vb as I,wb as L,xb as R,yb as z}from"./dist-Dw05q7xL.js";import{t as B}from"./button-CJcuK3wk.js";import{Gt as V,H,U,d as W,dt as G,ft as K,m as q}from"./index-CVElkIyB.js";import{t as J}from"./roleDescriptions-5T4_7YgE.js";var Y=t(e(),1),X=n(),Z=[{group:()=>r(),keys:[{key:`traces.read`,label:()=>p()},{key:`traces.read.content`,label:()=>L(),phi:!0},{key:`traces.write`,label:()=>i()}]},{group:()=>w(),keys:[{key:`kpi.read`,label:()=>p()},{key:`kpi.write`,label:()=>i()}]},{group:()=>d(),keys:[{key:`openclaw.query`,label:()=>f()},{key:`anomalies.read`,label:()=>R()},{key:`anomalies.report`,label:()=>b()}]},{group:()=>a(),keys:[{key:`chats.read`,label:()=>p()},{key:`selfheal`,label:()=>I()},{key:`feedback.respond`,label:()=>O()}]},{group:()=>s(),keys:[{key:`admin.manage`,label:()=>z()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=_(o.apiKeys.listRoles,{}),t=x(o.apiKeys.createRole),n=x(o.apiKeys.ensureRolesSeeded),r=x(o.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(o.apiKeys.listRoles,{});r&&e.setQuery(o.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),i=U(),a=H(),[s,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)($),[b,w]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{a.error(ae(),e)})},[n,a]);let O=e??[];async function I(e,t){if(Q(e.permissions)||b.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await i({title:S({name:e.name}),description:E(),confirmLabel:A()}))){w(t=>new Set(t).add(e._id));try{await r({roleId:e._id,permissions:n})}catch(e){a.error(ie(),e)}finally{w(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function L(){try{await t({key:f.key,name:f.name,description:f.description||void 0,permissions:[]}),p($),d(!1)}catch(e){a.error(re(),e)}}let R=e===void 0,z=!R&&O.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[F(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,T(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,ne()]}),(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:N()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{p($),d(!0)},children:k()})})]}),R?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):z?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):(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:M()}),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?v({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:O.map(e=>{let t=Q(e.permissions),n=b.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)(G,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(V,{}),` `,D()]}):(0,X.jsx)(G,{variant:`secondary`,children:P()})]}),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)(q,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?g():n?l():r,onCheckedChange:()=>void I(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(W,{open:s,onOpenChange:d,title:j(),description:u(),canSubmit:!!(f.key&&f.name),onSubmit:L,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:te()}),(0,X.jsx)(K,{value:f.key,placeholder:m(),onChange:e=>p({...f,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:c()}),(0,X.jsx)(K,{value:f.name,onChange:e=>p({...f,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:h()}),(0,X.jsx)(K,{value:f.description,onChange:e=>p({...f,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{BM as r,Bj as i,D as a,E as o,Ej as s,Fj as c,GM as ee,Gj as te,HM as ne,Hj as re,Ij as ie,JM as ae,Jj as oe,KM as se,Kj as l,Lj as ce,Mj as le,Nj as ue,Pj as de,QM as fe,RM as pe,Rj as me,UM as he,Uj as ge,VM as _e,Vj as ve,WM as ye,Wj as be,XM as u,YM as xe,ZM as Se,_M as d,aM as Ce,bM as f,cM as we,cP as p,dM as Te,fM as Ee,hM as m,iM as De,jj as Oe,lM as ke,mM as Ae,mP as h,pM as je,qM as Me,qj as Ne,sM as Pe,uM as Fe,uP as Ie,vM as Le,xM as Re,yM as ze,zM as Be,zj as Ve}from"./dist-Dw05q7xL.js";import{t as g}from"./button-CJcuK3wk.js";import{B as He,C as _,Ft as Ue,G as We,H as Ge,Ht as Ke,J as qe,K as Je,Kt as Ye,Mt as Xe,Q as Ze,S as v,T as y,Ut as Qe,V as $e,Vt as et,X as tt,Y as nt,Z as rt,_t as b,dt as x,ft as S,gt as it,ht as at,mt as C,pt as w,q as ot,vt as T,w as E,x as D,zt as st}from"./index-CVElkIyB.js";import{a as ct,i as O,n as lt,o as k,r as A,t as ut}from"./table-HcdAROEr.js";var dt=a(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),j=t(e(),1),M=n(),N={minutes:6e4,hours:36e5,days:864e5};function P(e){return e?.data?.code??`unknown`}function F(){let e=h(o.scheduled.listMyCrons),t=h(o.scheduled.getCronDetail),n=h(o.scheduled.listCronRuns),a=h(o.scheduled.updateCron),F=h(o.scheduled.removeCron),ft=h(o.scheduled.runCronNow),I=Ge(),[L,pt]=(0,j.useState)(null),[R,z]=(0,j.useState)(!1),[B,mt]=(0,j.useState)(!1),[V,ht]=(0,j.useState)(null),[H,U]=(0,j.useState)(null),[W,G]=(0,j.useState)(null),[K,q]=(0,j.useState)(null),[gt,J]=(0,j.useState)(!1),Y=(0,j.useCallback)(async()=>{z(!0),mt(!1);try{pt(await e({}))}catch{mt(!0)}finally{z(!1)}},[e]);(0,j.useEffect)(()=>{Y()},[Y]);let _t=(0,j.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),X=(0,j.useRef)(null);(0,j.useEffect)(()=>{L!==null&&X.current!==null&&X.current.scrollIntoView({block:`center`})},[L]);let vt=(0,j.useMemo)(()=>new Intl.DateTimeFormat(Ie(),{dateStyle:`medium`,timeStyle:`short`}),[]),Z=async(e,t,n)=>{ht(e);try{await t(),I.success(n),await Y()}catch(e){I.toast({variant:`error`,title:m({code:P(e)})})}finally{ht(null)}},Q=(0,j.useRef)(0),$=(0,j.useRef)(0),yt=async(e,t)=>{if(t.id===null)return;let r=++Q.current;G({name:t.name??t.id,entries:null});try{let i=await n({instanceName:e,jobId:t.id,limit:20});if(r!==Q.current)return;G({name:t.name??t.id,entries:i})}catch(e){if(r!==Q.current)return;G(null),I.toast({variant:`error`,title:m({code:P(e)})})}},bt=async(e,n)=>{if(n.id===null)return;let r=++$.current;q({instanceName:e,jobId:n.id,loading:!0,name:n.name??``,scheduleKind:`cron`,cronExpr:``,tz:``,everyValue:`1`,everyUnit:`hours`,at:``,message:``,hasMessage:!1,scheduleDirty:!1,messageDirty:!1,nameDirty:!1});try{let i=(await t({instanceName:e,jobId:n.id})).job,a=i.scheduleKind===`every`||i.scheduleKind===`at`?i.scheduleKind:`cron`,o=``;if(a===`at`&&i.scheduleExpr!==null){let e=Date.parse(i.scheduleExpr);Number.isFinite(e)&&(o=new Date(e-new Date(e).getTimezoneOffset()*6e4).toISOString().slice(0,16))}let s=`1`,c=`hours`;if(a===`every`&&i.scheduleExpr!==null){let e=Number(i.scheduleExpr);Number.isFinite(e)&&e>0&&(e%N.days===0?(s=String(e/N.days),c=`days`):e%N.hours===0?(s=String(e/N.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/N.minutes))),c=`minutes`))}if(r!==$.current)return;q(e=>e===null||e.jobId!==n.id?e:{...e,loading:!1,name:i.name??e.name,scheduleKind:a,cronExpr:a===`cron`?i.scheduleExpr??``:``,tz:i.tz??``,everyValue:s,everyUnit:c,at:o,message:i.message??``,hasMessage:i.message!==null&&!i.messageTruncated})}catch(e){if(r!==$.current)return;q(null),I.toast({variant:`error`,title:m({code:P(e)})})}},xt=async()=>{if(K===null)return;let e={};if(K.nameDirty&&K.name.trim()===``||K.messageDirty&&K.hasMessage&&K.message.trim()===``){I.toast({variant:`error`,title:Oe()});return}if(K.nameDirty&&K.name.trim()!==``&&(e.name=K.name.trim()),K.scheduleDirty){if(K.scheduleKind===`cron`&&K.cronExpr.trim()!==``)e.schedule={kind:`cron`,expr:K.cronExpr.trim(),...K.tz.trim()===``?{}:{tz:K.tz.trim()}};else if(K.scheduleKind===`every`){let t=Number(K.everyValue);Number.isFinite(t)&&t>=1&&(e.schedule={kind:`every`,everyMs:Math.round(t*N[K.everyUnit])})}else if(K.scheduleKind===`at`&&K.at!==``){let t=Date.parse(K.at);Number.isFinite(t)&&(e.schedule={kind:`at`,at:new Date(t).toISOString()})}}if(K.scheduleDirty&&e.schedule===void 0){I.toast({variant:`error`,title:le()});return}if(K.messageDirty&&K.hasMessage&&K.message.trim()!==``&&(e.message=K.message.trim()),Object.keys(e).length===0){q(null);return}let t=$.current;J(!0);try{await a({instanceName:K.instanceName,jobId:K.jobId,patch:e}),I.success(te()),t===$.current&&q(null),await Y()}catch(e){I.toast({variant:`error`,title:m({code:P(e)})})}finally{J(!1)}},St=L?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,M.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:fe()}),(0,M.jsxs)(g,{variant:`ghost`,size:`sm`,onClick:()=>void Y(),disabled:R,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,M.jsx)(st,{size:14,"aria-hidden":!0}),Se()]})]}),L===null?(0,M.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":R,children:B?u():p()}):(0,M.jsxs)(M.Fragment,{children:[B?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):null,L.length===0?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:xe()}):null,L.map(e=>(0,M.jsxs)(`section`,{style:{marginBottom:20},children:[L.length>1||e.error||!e.supported?(0,M.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,M.jsx)(x,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:Me({code:e.error})}):e.jobs.length===0?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:se()}):(0,M.jsxs)(ut,{children:[(0,M.jsx)(ct,{children:(0,M.jsxs)(k,{children:[(0,M.jsx)(O,{children:ee()}),(0,M.jsx)(O,{children:ye()}),(0,M.jsx)(O,{children:he()}),(0,M.jsx)(O,{children:ne()}),(0,M.jsx)(O,{children:_e()}),(0,M.jsx)(O,{children:oe()})]})}),(0,M.jsx)(lt,{children:e.jobs.map((t,n)=>{let i=`${e.instanceName}:${t.id??n}`,o=V===i,s=e.manageSupported,c=e.kind===`openclaw`&&s;return(0,M.jsxs)(k,{ref:t.id!==null&&t.id===_t?X:void 0,"data-state":t.id!==null&&t.id===_t?`selected`:void 0,children:[(0,M.jsx)(A,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??r()}),(0,M.jsx)(A,{children:(0,M.jsx)(x,{variant:`secondary`,children:t.agentId})}),(0,M.jsxs)(A,{className:`whitespace-nowrap`,children:[(0,M.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=He(t.schedule),n=e===null?null:$e(e);return n===null?null:(0,M.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,M.jsx)(A,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:vt.format(t.nextRunAtMs)}),(0,M.jsxs)(A,{children:[t.enabled===!0?(0,M.jsx)(x,{variant:`secondary`,children:pe()}):t.enabled===!1?(0,M.jsx)(x,{variant:`outline`,children:Be()}):(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}),t.lastRunStatus?(0,M.jsx)(`span`,{className:`text-muted-foreground`,style:{marginLeft:8,fontSize:`0.8rem`},children:t.lastRunStatus}):null]}),(0,M.jsx)(A,{className:`whitespace-nowrap`,children:t.id===null?(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):o?(0,M.jsx)(Ye,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,M.jsxs)(`span`,{style:{display:`inline-flex`,gap:2},children:[c?(0,M.jsx)(g,{variant:`ghost`,size:`icon-sm`,title:f(),"aria-label":f(),disabled:V!==null,onClick:()=>void Z(i,async()=>{let n=await ft({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},Ae()),children:(0,M.jsx)(Xe,{size:14,"aria-hidden":!0})}):null,c&&t.enabled!==null?(0,M.jsx)(g,{variant:`ghost`,size:`icon-sm`,title:t.enabled?ze():Le(),"aria-label":t.enabled?ze():Le(),disabled:V!==null,onClick:()=>void Z(i,()=>a({instanceName:e.instanceName,jobId:t.id,patch:{enabled:!t.enabled}}),t.enabled?je():Ee()),children:t.enabled?(0,M.jsx)(Qe,{size:14,"aria-hidden":!0}):(0,M.jsx)(et,{size:14,"aria-hidden":!0})}):null,c?(0,M.jsx)(g,{variant:`ghost`,size:`icon-sm`,title:Ne(),"aria-label":Ne(),disabled:V!==null,onClick:()=>void bt(e.instanceName,t),children:(0,M.jsx)(Ke,{size:14,"aria-hidden":!0})}):null,c?(0,M.jsx)(g,{variant:`ghost`,size:`icon-sm`,title:l(),"aria-label":l(),disabled:V!==null,onClick:()=>void yt(e.instanceName,t),children:(0,M.jsx)(dt,{size:14,"aria-hidden":!0})}):null,s?(0,M.jsx)(g,{variant:`ghost`,size:`icon-sm`,title:d(),"aria-label":d(),disabled:V!==null,onClick:()=>U({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,M.jsx)(Ue,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:ae()})]},e.instanceName)),St>0?(0,M.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:s()}):null]}),(0,M.jsx)(We,{open:H!==null,onOpenChange:e=>{e||U(null)},children:(0,M.jsxs)(qe,{children:[(0,M.jsxs)(rt,{children:[(0,M.jsx)(Ze,{children:Fe()}),(0,M.jsx)(nt,{children:ke({name:H?.name??``})})]}),(0,M.jsxs)(tt,{children:[(0,M.jsx)(ot,{children:we()}),(0,M.jsx)(Je,{onClick:()=>{let e=H;U(null),e!==null&&Z(`${e.instanceName}:${e.jobId}`,()=>F({instanceName:e.instanceName,jobId:e.jobId}),Te())},children:Pe()})]})]})}),(0,M.jsx)(w,{open:W!==null,onOpenChange:e=>{e||(Q.current++,G(null))},children:(0,M.jsxs)(C,{style:{maxWidth:640},children:[(0,M.jsx)(b,{children:(0,M.jsx)(T,{children:be({name:W?.name??``})})}),W?.entries===null?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):W!==null&&W.entries.length===0?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:ge()}):W===null?null:(0,M.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:W.entries.map((e,t)=>(0,M.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,M.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[e.status===`ok`?(0,M.jsx)(x,{variant:`secondary`,children:Ce()}):e.status===`error`?(0,M.jsx)(x,{variant:`destructive`,children:De()}):(0,M.jsx)(x,{variant:`outline`,children:e.status??`—`}),(0,M.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?vt.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,M.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,M.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,M.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error})]},t))})]})}),(0,M.jsx)(w,{open:K!==null,onOpenChange:e=>{e||($.current++,q(null))},children:(0,M.jsxs)(C,{children:[(0,M.jsxs)(b,{children:[(0,M.jsx)(T,{children:re()}),(0,M.jsx)(at,{children:ve()})]}),K===null?null:K.loading?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,M.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,M.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:ee()}),(0,M.jsx)(S,{value:K.name,maxLength:200,onChange:e=>q({...K,name:e.target.value,nameDirty:!0})})]}),(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,M.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:i()}),(0,M.jsxs)(D,{value:K.scheduleKind,onValueChange:e=>q({...K,scheduleKind:e,scheduleDirty:!0}),children:[(0,M.jsx)(E,{children:(0,M.jsx)(y,{})}),(0,M.jsxs)(v,{children:[(0,M.jsx)(_,{value:`cron`,children:Ve()}),(0,M.jsx)(_,{value:`every`,children:me()}),(0,M.jsx)(_,{value:`at`,children:ce()})]})]}),K.scheduleKind===`cron`?(0,M.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,M.jsx)(S,{value:K.cronExpr,onChange:e=>q({...K,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,M.jsx)(S,{value:K.tz,onChange:e=>q({...K,tz:e.target.value,scheduleDirty:!0}),placeholder:`America/Toronto`,style:{maxWidth:180}})]}):K.scheduleKind===`every`?(0,M.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,M.jsx)(S,{type:`number`,min:1,value:K.everyValue,onChange:e=>q({...K,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,M.jsxs)(D,{value:K.everyUnit,onValueChange:e=>q({...K,everyUnit:e,scheduleDirty:!0}),children:[(0,M.jsx)(E,{style:{maxWidth:160},children:(0,M.jsx)(y,{})}),(0,M.jsxs)(v,{children:[(0,M.jsx)(_,{value:`minutes`,children:ie()}),(0,M.jsx)(_,{value:`hours`,children:c()}),(0,M.jsx)(_,{value:`days`,children:de()})]})]})]}):(0,M.jsx)(S,{type:`datetime-local`,value:K.at,onChange:e=>q({...K,at:e.target.value,scheduleDirty:!0})})]}),K.hasMessage?(0,M.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,M.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Re()}),(0,M.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:K.message,onChange:e=>q({...K,message:e.target.value,messageDirty:!0})})]}):null]}),(0,M.jsxs)(it,{children:[(0,M.jsx)(g,{variant:`ghost`,onClick:()=>q(null),children:we()}),(0,M.jsxs)(g,{onClick:()=>void xt(),disabled:K===null||K.loading||gt,children:[gt?(0,M.jsx)(Ye,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,ue()]})]})]})})]})}export{F as ScheduledTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$D as r,$O as i,AO as ee,BO as te,CO as ne,DO as re,E as a,EO as ie,FO as ae,GO as oe,HO as se,IO as ce,JD as o,JO as le,KO as ue,LO as de,MO as fe,NO as pe,OO as me,PO as he,QD as s,QO as ge,RO as _e,SO as ve,TO as ye,UO as be,VO as xe,WO as Se,XD as Ce,XO as we,YD as Te,YO as Ee,ZD as De,ZO as Oe,_O as ke,_P as c,aO as l,ak as Ae,bO as je,cO as u,ck as d,dO as f,dk as Me,eO as p,ek as Ne,fO as m,fk as Pe,gO as h,gP as g,hO as _,iO as v,ik as Fe,jO as Ie,kO as Le,lO as y,lk as Re,mO as b,mP as ze,nO as x,nk as Be,oO as S,ok as Ve,pO as C,pk as He,qD as w,qO as Ue,rO as T,rk as We,sO as E,sk as D,tO as O,tk as Ge,uO as k,uk as Ke,vO as qe,wO as Je,xO as Ye,yO as Xe,zO as Ze}from"./dist-Dw05q7xL.js";import{n as A}from"./dist-DDmOEYQC.js";import{i as Qe}from"./dist-Czk9m5q_.js";import{t as j}from"./button-CJcuK3wk.js";import{C as M,H as $e,S as N,T as P,U as et,Zt as F,_t as I,d as tt,dt as L,en as nt,ft as R,gt as z,ht as B,mt as V,nn as rt,nt as H,pt as it,rn as at,rt as U,vt as W,w as G,x as K}from"./index-CVElkIyB.js";import{t as ot}from"./FilterBar-D6zZSKoR.js";import{t as st}from"./DataTableShell-CRhep8-q.js";import{t as ct}from"./roleDescriptions-5T4_7YgE.js";var q=t(e(),1),J=n(),lt=[{value:`never`,label:()=>r(),days:null},{value:`30`,label:()=>s(),days:30},{value:`90`,label:()=>De(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=at({from:`/settings/serviceAccounts`}),t=rt({from:`/settings/serviceAccounts`}),n=e.q??``,r=e.status??X,[o,s]=(0,q.useState)(X),Ce=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),Te=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),De=c(a.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===X?void 0:o,disabled:r===X?void 0:r===`disabled`}}),l=c(a.apiKeys.listKeys,{}),u=c(a.apiKeys.listRoles,{}),f=g(a.apiKeys.createServiceAccount),p=g(a.apiKeys.updateServiceAccount),m=g(a.apiKeys.deleteServiceAccount),h=ze(a.apiKeys.mintApiKey),_=g(a.apiKeys.revokeApiKey),v=et(),y=$e(),b=n!==``||o!==X||r!==X;function x(){s(X),t({search:{},replace:!0})}let[S,C]=(0,q.useState)(!1),[w,T]=(0,q.useState)(Z),[E,O]=(0,q.useState)(null),[k,A]=(0,q.useState)(new Set),[F,I]=(0,q.useState)(null),z=(0,q.useRef)(!1),[B,V]=(0,q.useState)(new Set),[H,it]=(0,q.useState)({}),[U,W]=(0,q.useState)(null),Y=(0,q.useMemo)(()=>{let e=new Map;for(let t of l??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[l]);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 p({serviceAccountId:E,name:w.name,roleKey:w.roleKey,description:w.description}),y.success(Ie())):await f({name:w.name,roleKey:w.roleKey,description:w.description||void 0}),T(Z),O(null),C(!1)}catch(e){y.error(E?fe():pe(),e)}}function pt(e){T({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),C(!0)}async function mt(e){if(z.current)return;z.current=!0;let t=H[e._id]??`never`,n=lt.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;I(e._id);try{let t=await h({serviceAccountId:e._id,expiresAt:r});W({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(ee(),e)}finally{z.current=!1,I(null)}}async function $(e){if(await v({title:Le(),description:(0,J.jsxs)(J.Fragment,{children:[me(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,re(),` `,(0,J.jsx)(`strong`,{children:ie()}),` `,ye()]}),confirmWord:e.name,confirmLabel:Je(),destructive:!0}))try{await m({serviceAccountId:e._id}),y.success(ne(),e.name)}catch(e){y.error(ve(),e)}}async function ht(e){if(await v({title:Ye(),description:(0,J.jsxs)(J.Fragment,{children:[je(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Xe()]}),confirmLabel:qe(),destructive:!0})&&!B.has(e._id)){V(t=>new Set(t).add(e._id));try{await _({keyId:e._id})}catch(e){y.error(ke(),e)}finally{V(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:He()}),(0,J.jsxs)(ot,{q:n,onQChange:Ce,searchPlaceholder:Pe(),onReset:x,canReset:b,children:[(0,J.jsxs)(K,{value:o,onValueChange:s,children:[(0,J.jsx)(G,{size:`sm`,className:`w-40`,children:(0,J.jsx)(P,{placeholder:Me()})}),(0,J.jsxs)(N,{children:[(0,J.jsx)(M,{value:X,children:Ke()}),(u??[]).map(e=>(0,J.jsx)(M,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(K,{value:r,onValueChange:Te,children:[(0,J.jsx)(G,{size:`sm`,className:`w-36`,children:(0,J.jsx)(P,{})}),(0,J.jsxs)(N,{children:[(0,J.jsx)(M,{value:X,children:Re()}),(0,J.jsx)(M,{value:`active`,children:d()}),(0,J.jsx)(M,{value:`disabled`,children:D()})]})]})]}),(0,J.jsx)(st,{title:Ve(),rows:De,addLabel:Ae(),onAdd:()=>{T(Z),O(null),C(!0)},emptyHint:Fe(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,J.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:B}),rowActions:e=>[{label:Ne(),onSelect:()=>pt(e)},{label:We(),onSelect:()=>void mt(e)},{label:k.has(e._id)?Be():Ge(),onSelect:()=>Q(e._id)},{label:i(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(j,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?ge():Oe(),onClick:()=>Q(e._id),children:k.has(e._id)?(0,J.jsx)(Qe,{}):(0,J.jsx)(nt,{})})},{header:we(),sort:e=>e.name,cell:e=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{children:e.name}),e.description?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Ee(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(L,{variant:`secondary`,children:e.roleKey})},{header:le(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(L,{variant:`destructive`,children:D()}):(0,J.jsx)(L,{variant:`outline`,children:d()})},{header:Ue(),cell:e=>(0,J.jsxs)(K,{value:H[e._id]??`never`,onValueChange:t=>it(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(G,{size:`sm`,className:`w-32`,children:(0,J.jsx)(P,{})}),(0,J.jsx)(N,{children:lt.map(e=>(0,J.jsx)(M,{value:e.value,children:e.label()},e.value))})]})},{header:ue(),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,J.jsx)(`span`,{className:`oc-sa__keycount`,children:F===e._id?oe():Se({count:t})})}}]}),(0,J.jsx)(tt,{open:S,onOpenChange:e=>{C(e),e||O(null)},title:E?be():te(),description:E?se():Ze(),canSubmit:!!(w.name&&w.roleKey),onSubmit:ft,submitLabel:E?xe():_e(),children:(0,J.jsxs)(`div`,{className:`oc-form`,children:[(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:de()}),(0,J.jsx)(R,{value:w.name,onChange:e=>T({...w,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:ce()}),(0,J.jsxs)(K,{value:w.roleKey||void 0,onValueChange:e=>T({...w,roleKey:e}),children:[(0,J.jsx)(G,{className:`w-full`,children:(0,J.jsx)(P,{placeholder:ae()})}),(0,J.jsx)(N,{children:(u??[]).map(e=>(0,J.jsxs)(M,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(u??[]).find(e=>e.key===w.roleKey),t=e?ct(e):null;return t?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:he()}),(0,J.jsx)(R,{value:w.description,onChange:e=>T({...w,description:e.target.value})})]})]})}),(0,J.jsx)(dt,{minted:U,onClose:()=>W(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,J.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,J.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[h(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:b()}),(0,J.jsx)(`th`,{children:C()}),(0,J.jsx)(`th`,{children:m()}),(0,J.jsx)(`th`,{children:f()}),(0,J.jsx)(`th`,{children:k()}),(0,J.jsx)(`th`,{children:y()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(L,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:U(t.createdAt)}),(0,J.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:mt(t.expiresAt)}),(0,J.jsx)(`td`,{children:$(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,J.jsx)(j,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?u():E()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(it,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(V,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(I,{children:[(0,J.jsx)(W,{children:S()}),(0,J.jsx)(B,{children:l({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:v()}),(0,J.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,J.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,J.jsxs)(j,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":T(),children:[n?(0,J.jsx)(A,{}):(0,J.jsx)(F,{}),n?x():O()]})]}),(0,J.jsx)(z,{children:(0,J.jsx)(j,{onClick:()=>{r(!1),t()},children:p()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?Ce():U(e)}function mt(e){return e===null?`—`:H(e)}function $(e){return e.disabled?(0,J.jsx)(L,{variant:`destructive`,children:Te()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(L,{variant:`outline`,children:o()}):(0,J.jsx)(L,{variant:`outline`,children:w()})}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,AA as i,BA as a,CA as o,D as s,DA as c,E as l,EA as u,FA as d,GA as f,HA as p,IA as m,JA as h,KA as g,LA as _,MA as v,NA as ee,OA as y,PA as te,QA as ne,RA as re,SA as ie,Sj as ae,TA as oe,UA as se,VA as ce,WA as le,XA as ue,YA as de,ZA as fe,_A as pe,_P as b,_a as me,_j as he,aA as ge,aP as _e,aj as ve,bA as x,ba as S,bj as ye,cA as C,cj as be,dA as xe,dj as Se,eA as Ce,ej as we,fA as Te,fj as w,gA as Ee,gP as T,gj as De,hA as Oe,hj as ke,iA as E,iP as Ae,ij as je,jA as Me,kA as Ne,lA as Pe,lj as Fe,mA as Ie,mP as Le,mj as Re,n as ze,nA as Be,nj as Ve,oA as He,oP as Ue,oj as We,pA as Ge,pj as Ke,qA as qe,rA as Je,rj as Ye,sA as Xe,sj as Ze,tA as Qe,tj as $e,uA as et,uj as tt,vA as nt,va as rt,vj as it,wA as at,xA as ot,xj as st,yA as ct,ya as D,yj as lt,zA as O}from"./dist-Dw05q7xL.js";import{n as k}from"./dist-DDmOEYQC.js";import{t as A}from"./x-DiDC_TeC.js";import{t as j}from"./button-CJcuK3wk.js";import{C as M,S as N,T as P,Xt as ut,Yt as F,at as dt,bt as ft,ct as pt,dt as I,ft as L,lt as R,m as z,ot as mt,st as B,ut as ht,w as V,wt as H,x as U,yt as gt}from"./index-CVElkIyB.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-CVCuPx_Y.js";import{a as wt,i as W,n as Tt,o as G,r as K,t as Et}from"./table-HcdAROEr.js";import{t as Dt}from"./TimeRangePicker-5EYfNRUQ.js";import{t as Ot}from"./FilterBar-D6zZSKoR.js";import{t as kt}from"./AdvancedFilter-Da3KTeHW.js";var q=s(`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(o());if(e.size>Lt)throw Error(ie());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(x());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(x());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);Y(e.data,d.width,d.height)?Ft(e.data,t.variantFor===`dark`?jt:Mt):It(e.data),p.putImageData(e,0,0)}let m=Y(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Wt(f,`image/webp`,Bt)??await Wt(f,`image/png`);if(!h)throw Error(ct());return{blob:h,hasAlpha:m}}finally{a()}}async function Ht(e){if(e.type===`image/svg+xml`)return Ut(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return Ut(e)}async function Ut(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(ot())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Wt(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Gt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Kt={kind:`relative`,from:`now-24h`,to:`now`},qt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Jt(e){return e===`light`?Ue():e===`dark`?_e():Ae()}var Yt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Xt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Yt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Zt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:ze(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(k,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Xt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(j,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":S(),title:S(),children:(0,X.jsx)(ut,{className:`size-4`})}):null]})}function Qt({selectedKey:e,resolvedMode:t}){let n=b(l.charts.listMyCharts),r=T(l.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Re()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ke()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Zt,{selected:e===null,title:w(),subtitle:Se(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?tt():n.via===`owner`?Fe():be({group:n.via.group});return(0,X.jsx)(Zt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ze()}):null]})}function $t(){let e=T(l.charts.importChart),[t,n]=(0,J.useState)(``),[r,i]=(0,J.useState)(``),[o,s]=(0,J.useState)(null),[c,u]=(0,J.useState)(!1),[d,m]=(0,J.useState)(!1);async function h(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),u(!1);try{i(await t.text())}catch{s(O())}}}async function v(){if(s(null),u(!1),t.trim()===``){s(_());return}let a;try{a=JSON.parse(r)}catch{s(O());return}m(!0);try{await e({name:t.trim(),tokens:a}),u(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{m(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:qe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:g()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:f()}),(0,X.jsx)(L,{value:t,onChange:e=>n(e.target.value),placeholder:le(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:se()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:p(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(q,{className:`size-4`}),ce(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void h(e)})]})}),(0,X.jsx)(j,{size:`sm`,disabled:d,onClick:()=>void v(),children:a()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:re()}):null]})]})}function en({chart:e}){let t=Le(l.charts.setChartLogo),n=T(l.charts.removeChartLogo),[r,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(null),d=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function f(n,r,i){if(e.chartId!==void 0){s(null),a(!0);try{let{blob:a,hasAlpha:o}=await Vt(r,i?{variantFor:i}:{}),s=await a.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function p(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await f(e,n)}async function m(t){if(e.chartId!==void 0){s(null),a(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}async function h(e){let t=d(e===`light`?`dark`:`light`);if(t){s(null),a(!0);try{await f(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}function g({mode:e}){let t=d(e),n=d(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?i():Ne()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(j,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(q,{className:`size-4`}),t?c():y(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void p(e,t)})]})}),!t&&n?(0,X.jsx)(j,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void h(e),children:oe()}):null,t?(0,X.jsx)(j,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void m(e),children:u()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Me()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(g,{mode:`light`}),(0,X.jsx)(g,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:at()}):null,o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})}function tn({chart:e}){let t=b(l.me.getMe,{host:H}),n=T(l.charts.addChartDomain),r=T(l.charts.removeChartDomain),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(null),[c,u]=(0,J.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function f(){let t=i.trim();if(t!==``){s(null),u(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function p(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:nt()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:d.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ie()}):d.map(e=>(0,X.jsxs)(I,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ge({domain:e}),onClick:()=>void p(e),children:(0,X.jsx)(A,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(L,{value:i,onChange:e=>a(e.target.value),placeholder:Ee(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&f()}}),(0,X.jsx)(j,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void f(),children:Oe()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:pe()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=T(l.charts.updateChart),n=T(l.charts.deleteChart),[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(e.name),[s,c]=(0,J.useState)(()=>$(e.tokens)),[u,d]=(0,J.useState)(e.tokens.bpm??0),[f,p]=(0,J.useState)(null),[m,h]=(0,J.useState)(!1);function g(){o(e.name),c($(e.tokens)),d(e.tokens.bpm??0),p(null),i(!0)}async function _(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(s)}catch{p(O());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u: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(C()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(j,{variant:`outline`,size:`sm`,onClick:g,children:ee()}),(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:v()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:et()}),(0,X.jsx)(L,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:D()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>d(Number(e.target.value)),"aria-label":D()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?rt():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:me()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Pe()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{size:`sm`,disabled:m,onClick:()=>void _(),children:Te()}),(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:xe()})]})]}):null,(0,X.jsx)(en,{chart:e}),(0,X.jsx)(tn,{chart:e})]})}function rn(){let e=b(l.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:m()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:d()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:te()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=T(l.charts.addChartToGroupPool),i=T(l.charts.removeChartFromGroupPool),a=e.restrictedToGroups,o=e.poolGroups,s=new Set((o??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function u(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function d(t){try{await i({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(I,{variant:a?`secondary`:`outline`,className:`oc-chart-avail__state`,children:a?r():e.kind===`custom`&&e.scope===`personal`?E():we()}),e.isGlobalDefault?(0,X.jsx)(I,{variant:`default`,children:ne()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ue()}),(o??[]).map(e=>(0,X.jsxs)(I,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":h({group:e.name}),onClick:()=>void d(e.groupId),children:(0,X.jsx)(A,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(U,{value:``,onValueChange:e=>void u(e),children:[(0,X.jsx)(V,{size:`sm`,className:`w-56`,children:(0,X.jsx)(P,{placeholder:de()})}),(0,X.jsx)(N,{children:c.map(e=>(0,X.jsx)(M,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:fe()}):null]})]})}function on({chart:e}){let t=T(l.charts.promoteChartToCommon),n=T(l.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(C()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(I,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Je():E()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ge({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(j,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Be()}):null,(0,X.jsx)(j,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Qe()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=T(l.admin.setDefaultThemeMode),i=T(l.admin.setDefaultLocale),a=T(l.charts.setDefaultChart),o=b(l.charts.listChartsAdmin),s=b(l.groups.listGroups,{}),c=e??`system`,u=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:De()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ke()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:We()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ve()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:w()}),ft.map(e=>(0,X.jsx)(j,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(o??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(j,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:je()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ye()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:s??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:$e()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(tn,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:He()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ce()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(on,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ae()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:st()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(j,{variant:c===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Jt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:lt()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:_t().map(e=>(0,X.jsx)(j,{variant:u===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:it()})]})]})}function cn(){let e=b(l.me.getMe,{host:H}),t=gt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Qt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)($t,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,J.useState)(!0),[n,r]=(0,J.useState)(`per-user`),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(Z),[c,l]=(0,J.useState)(Z),[u,d]=(0,J.useState)(Kt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Kt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:he()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(j,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(j,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{size:`sm`,children:`Small`}),(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{size:`lg`,children:`Large`}),(0,X.jsx)(j,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(F,{})}),(0,X.jsx)(j,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(I,{children:`Default`}),(0,X.jsx)(I,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(I,{variant:`outline`,children:`Outline`}),(0,X.jsx)(I,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(L,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(U,{value:n,onValueChange:r,children:[(0,X.jsx)(V,{className:`w-56`,children:(0,X.jsx)(P,{placeholder:`Select…`})}),(0,X.jsxs)(N,{children:[(0,X.jsx)(M,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(M,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(z,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(Ot,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(U,{value:o,onValueChange:s,children:[(0,X.jsx)(V,{size:`sm`,children:(0,X.jsx)(P,{})}),(0,X.jsxs)(N,{children:[(0,X.jsx)(M,{value:Z,children:`Toutes directions`}),(0,X.jsx)(M,{value:`inbound`,children:`inbound`}),(0,X.jsx)(M,{value:`outbound`,children:`outbound`}),(0,X.jsx)(M,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(U,{value:c,onValueChange:l,children:[(0,X.jsx)(V,{size:`sm`,children:(0,X.jsx)(P,{})}),(0,X.jsxs)(N,{children:[(0,X.jsx)(M,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(M,{value:`info`,children:`info`}),(0,X.jsx)(M,{value:`warn`,children:`warn`}),(0,X.jsx)(M,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(kt,{fields:qt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(Dt,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(dt,{children:[(0,X.jsx)(ht,{asChild:!0,children:(0,X.jsx)(j,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(F,{})})}),(0,X.jsxs)(mt,{align:`start`,children:[(0,X.jsx)(pt,{children:`Actions`}),(0,X.jsx)(R,{}),(0,X.jsx)(B,{children:`Edit`}),(0,X.jsx)(B,{children:`Duplicate`}),(0,X.jsx)(R,{}),(0,X.jsx)(B,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(Ct,{className:`w-80`,children:[(0,X.jsxs)(vt,{children:[(0,X.jsx)(xt,{children:`Instance`}),(0,X.jsx)(St,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(bt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(yt,{className:`gap-2`,children:[(0,X.jsx)(j,{size:`sm`,children:`Save`}),(0,X.jsx)(j,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Et,{children:[(0,X.jsx)(wt,{children:(0,X.jsxs)(G,{children:[(0,X.jsx)(W,{className:`w-8`,children:(0,X.jsx)(z,{"aria-label":`select all`})}),(0,X.jsx)(W,{children:`Name`}),(0,X.jsx)(W,{children:`Mode`}),(0,X.jsx)(W,{className:`text-right`,children:`Status`}),(0,X.jsx)(W,{className:`w-8`})]})}),(0,X.jsx)(Tt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(G,{children:[(0,X.jsx)(K,{children:(0,X.jsx)(z,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(K,{className:`font-medium`,children:e.n}),(0,X.jsx)(K,{children:(0,X.jsx)(I,{variant:`secondary`,children:e.m})}),(0,X.jsx)(K,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(k,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(K,{children:(0,X.jsx)(j,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(F,{})})})]},e.n))})]})}),(0,X.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,$w as i,AT as a,B_ as o,CT as s,D as c,DT as l,E as u,ET as d,G_ as f,Gw as p,H_ as m,I_ as h,J_ as g,Jw as _,K_ as v,Kw as y,L_ as b,MT as x,OT as S,Q_ as ee,Qw as C,R_ as te,ST as ne,TT as re,U_ as ie,Uw as ae,V_ as oe,W_ as se,Ww as w,X_ as ce,Xw as T,Y_ as le,Yw as E,Z_ as ue,Zw as de,_P as D,_T as O,_v as fe,av as pe,bT as k,bv as me,cT as A,cv as he,dT as j,dv as ge,eT as M,ev as _e,fT as ve,fv as ye,gP as N,gT as be,gn as P,gv as xe,hT as F,hn as Se,hv as Ce,iv as we,jT as Te,kT as Ee,lT as I,lv as De,mT as Oe,mn as ke,mv as Ae,nT as je,nv as Me,ov as Ne,pT as Pe,pv as Fe,q_ as Ie,qw as Le,rT as Re,rv as ze,sv as Be,tT as Ve,tv as He,uT as Ue,uv as We,vT as Ge,vv as Ke,wT as qe,xT as Je,yT as L,yv as Ye,z_ as Xe}from"./dist-Dw05q7xL.js";import{n as Ze}from"./dist-DDmOEYQC.js";import{t as Qe}from"./x-DiDC_TeC.js";import{i as R,n as z,r as $e,t as et}from"./tabs--02lZ4zx.js";import{t as B}from"./button-CJcuK3wk.js";import{C as V,Jt as tt,M as nt,S as H,T as U,Zt as rt,_t as it,a as at,dt as W,ht as ot,i as st,it as ct,mt as lt,nn as ut,o as dt,pt as ft,qt as pt,rn as mt,rt as G,s as ht,vt as gt,w as K,wt as _t,x as q}from"./index-CVElkIyB.js";import{n as vt}from"./TimeRangePicker-5EYfNRUQ.js";import{t as yt}from"./FilterBar-D6zZSKoR.js";import{t as bt}from"./AdvancedFilter-Da3KTeHW.js";import{t as xt}from"./DataTableShell-CRhep8-q.js";var St=c(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=c(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),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`?Pe():n===`agent`?`${ve()} - ${r}`:e}function Tt(){let e=D(u.me.getMe,{host:_t})?.role===`admin`,t=D(u.deliveryTiming.getDeliveryStatus,{}),n=N(u.deliveryTiming.startDeliveryRecord),r=N(u.deliveryTiming.stopDeliveryRecord),[i,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!1),d=t?.recording??!1,f=async()=>{c(!0);try{d?await r({}):await n({})}finally{c(!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:x()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Te()})]}),e?(0,Y.jsx)(B,{variant:d?`destructive`:`default`,size:`sm`,disabled:s||t===void 0,onClick:()=>void f(),children:d?Ee():a()}):null]}),d?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(W,{variant:`secondary`,children:S()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:l({time:ct(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>o(e=>!e),children:i?qe():re()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=D(u.deliveryTiming.listDeliverySessions,{}),n=N(u.deliveryTiming.deleteDeliverySessions),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(`all`),[c,l]=(0,J.useState)(X),[d,f]=(0,J.useState)(null),{from:p,to:m}=vt(c),h=c.to===`now`?1/0:m,g=r.trim()!==``||a!==`all`||c!==X,_=()=>{i(``),o(`all`),l(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))&&(a===`all`||(a===`active`?t.active:!t.active))&&t.startedAt>=p&&t.startedAt<=h).map(e=>({...e,_id:e.sessionId}))},[t,r,a,p,h]),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:i,searchPlaceholder:ne(),timeRange:c,onTimeRangeChange:l,onReset:_,canReset:g,children:(0,Y.jsxs)(q,{value:a,onValueChange:e=>o(e),children:[(0,Y.jsx)(K,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(U,{})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:`all`,children:Je()}),(0,Y.jsx)(V,{value:`active`,children:k()}),(0,Y.jsx)(V,{value:`stopped`,children:L()})]})]})}),(0,Y.jsx)(xt,{title:s(),rows:v,emptyHint:w(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?Ue():j(),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)(tt,{size:15,"aria-hidden":!0})})},{header:Ge(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:G(e.startedAt)})},{header:O(),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:be(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:F(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:Oe(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(W,{variant:`secondary`,children:k()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:L()})}],rowActions:e?e=>[{label:I(),variant:`destructive`,onSelect:()=>y([e.sessionId])}]:void 0,bulkActions:e?[{label:I(),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=D(u.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(nt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:A()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:d()});let r=e.segments,a=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,ae()]}),(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?p():y()]})]}),(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:Ve()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:M()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:i()})]})}),(0,Y.jsxs)(`tbody`,{children:[a(C(),r.bridge),a(de(),r.A),a(T(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:E()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Le()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:_()})]})}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:P()},{value:`principalType`,label:Se()},{value:`direction`,label:`direction`},{value:`roleKey`,label:ke()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=mt({from:`/settings/traces`}),t=ut({from:`/settings/traces`}),n=e.limit,i=e.kind,a=e.statusClass??Q,s=e.principalType??Q,c=e.direction??Q,l=e.roleKey??Q,d=e.q??``,p=st(e.from,e.to),h=(0,J.useMemo)(()=>ht(e.adv),[e.adv]),{from:_,to:y}=vt(p),[b,x]=(0,J.useState)(null),[S,C]=(0,J.useState)(null),te=e=>void t({search:t=>({...t,limit:e})}),ne=e=>void t({search:t=>({...t,kind:e})}),re=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ae=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),w=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),T=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),E=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),de=e=>void t({search:t=>({...t,...dt(e)})}),O=e=>void t({search:t=>({...t,adv:at(e)}),replace:!0}),k=D(u.observability.listEvents,{limit:n}),A=D(u.observability.listEvents,{limit:n,kind:i===At?void 0:i,filter:{q:d||void 0,from:_,to:y,statusClass:a===Q?void 0:a,principalType:s===Q?void 0:s,direction:c===Q?void 0:c,roleKey:l===Q?void 0:l,advanced:h.length>0?h:void 0}}),j=(0,J.useMemo)(()=>{let e=new Set;for(let t of k??[])e.add(t.kind);return[...e].sort()},[k]),M=(0,J.useMemo)(()=>{let e=new Set;for(let t of k??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[k]),ve=d!==``||a!==Q||s!==Q||c!==Q||l!==Q||h.length>0||p.kind!==`relative`||p.from!==Pt.from;function N(){t({search:{limit:100,kind:`all`},replace:!0})}let be=b?k?.filter(e=>e.correlationId===b):A,P=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:P,onValueChange:e=>F(e),children:[(0,Y.jsxs)($e,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(pt,{size:13,"aria-hidden":!0}),Re()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),je()]})]}),(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:[me(),(0,Y.jsx)(`strong`,{children:Ye()}),Ke(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:fe()})]}),(0,Y.jsxs)(yt,{q:d,onQChange:re,searchPlaceholder:xe(),timeRange:p,onTimeRangeChange:de,onReset:N,canReset:ve,children:[(0,Y.jsxs)(q,{value:a,onValueChange:ae,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(U,{placeholder:Ce()})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:Q,children:Ae()}),jt.map(e=>(0,Y.jsx)(V,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:s,onValueChange:w,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(U,{placeholder:Fe()})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:Q,children:ye()}),Mt.map(e=>(0,Y.jsx)(V,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:c,onValueChange:T,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(U,{placeholder:ge()})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:Q,children:We()}),Nt.map(e=>(0,Y.jsx)(V,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:l,onValueChange:E,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(U,{placeholder:De()})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:Q,children:he()}),M.map(e=>(0,Y.jsx)(V,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:i,onValueChange:ne,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(U,{placeholder:Be()})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:At,children:Ne()}),j.map(e=>(0,Y.jsx)(V,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:String(n),onValueChange:e=>te(Number(e)),children:[(0,Y.jsx)(K,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(U,{})}),(0,Y.jsx)(H,{children:kt.map(e=>(0,Y.jsx)(V,{value:String(e),children:pe({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:h,onChange:O}),b?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>x(null),title:we(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[ze(),(0,Y.jsx)(`code`,{children:$(b)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:Me()})]})}):null,(0,Y.jsx)(xt,{title:He(),rows:be,emptyHint:b?_e():r(),columns:[{header:ee(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:G(e.at)})},{header:ue(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(W,{variant:`secondary`,children:e.kind})},{header:ce(),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":le(),children:`✓`})}},{header:g(),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:Ie(),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:v(),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:f(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:se(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:ie(),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:m(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:oe(),onClick:()=>x(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:o(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:Xe()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:S,onClose:()=>C(null)})]})]})}function Lt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Rt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(ft,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(lt,{className:`max-w-lg`,children:[(0,Y.jsxs)(it,{children:[(0,Y.jsxs)(gt,{className:`oc-traces__meta-title`,children:[te(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(W,{variant:`outline`,children:b()})]}),(0,Y.jsx)(ot,{children:h()})]}),(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{$S as r,$g as i,BS as a,Cu as o,E as s,FS as c,GS as l,HS as u,IS as d,JS as f,KS as p,LS as ee,PS as te,QS as ne,Qg as m,RS as re,Su as h,US as ie,VS as ae,WS as g,XS as _,Xg as v,YS as oe,ZS as se,Zg as y,_P as b,aC as ce,a_ as x,cC as S,c_ as C,eC as le,e_ as w,gP as T,hS as ue,iC as de,i_ as E,nC as fe,n_ as D,oC as O,o_ as k,qS as pe,rC as me,r_ as A,sC as j,s_ as M,tC as he,t_ as N,xu as P,zS as ge}from"./dist-Dw05q7xL.js";import{t as F}from"./button-CJcuK3wk.js";import{C as I,H as L,It as R,Lt as z,S as B,T as V,U as _e,W as ve,_t as H,at as ye,c as U,ct as be,dt as W,ht as xe,l as Se,m as G,mt as Ce,nn as we,ot as Te,pt as Ee,rn as De,st as Oe,u as K,ut as ke,vt as Ae,w as q,wt as je,x as J}from"./index-CVElkIyB.js";import{t as Y}from"./FilterBar-D6zZSKoR.js";import{t as Me}from"./DataTableShell-CRhep8-q.js";import{t as Ne}from"./DetailChips-DU6aRrkw.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=b(s.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=b(s.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),c=(a??[]).find(e=>e.isDefault)??null,l=c?`${c.instanceName}/${c.agentId}`:null,u=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),d=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!u.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}))],f=new Map;for(let e of d){let t=f.get(e.instanceName)??[];t.push(e),f.set(e.instanceName,t)}return(0,Z.jsx)(Ee,{open:n,onOpenChange:r,children:(0,Z.jsxs)(Ce,{className:`oc-access`,children:[(0,Z.jsxs)(H,{children:[(0,Z.jsx)(Ae,{children:C({user:t})}),(0,Z.jsx)(xe,{children:M()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?k():x()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:E()}):d.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:N()}):[...f.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:l},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:a,defaultKey:o}){let c=T(s.agents.assignAgent),l=T(s.agents.removeAgent),u=T(s.agents.setDefaultAgent),d=L();if(!e)return null;async function f(n,r){try{r?await l({profileId:e,instanceName:t,agentId:n}):await c({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(A(),e)}}async function p(n){try{await u({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(D(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(z,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=a.has(n),s=o===n,c=e.state===`deleted`,l=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${l?` is-disabled`:``}`,children:[(0,Z.jsx)(G,{checked:r,disabled:(c||l)&&!r,onCheckedChange:()=>void f(e.agentId,r),"aria-label":w({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,c?(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:i()}):null,e.outOfPool?(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:m()}):null,r?s?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":y(),title:y(),children:(0,Z.jsx)(R,{size:14,fill:`currentColor`})}):(0,Z.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":v(),title:v(),disabled:l,onClick:()=>void p(e.agentId),children:(0,Z.jsx)(R,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return P();case`user`:return h();case`admin`:return o();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=U.filter(e=>n.has(K[e])).length;return(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(ke,{asChild:!0,children:(0,Z.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?S():j({count:r})})}),(0,Z.jsxs)(Te,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(be,{children:O()}),U.map(e=>{let r=K[e];return(0,Z.jsxs)(Oe,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(G,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Se[e]()})]},e)})]})]})}function Le(){let e=De({from:`/settings/users`}),t=we({from:`/settings/users`}),n=e.q??``,i=e.role??Q,o=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),m=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),h=b(s.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),v=b(s.me.getMe,{host:je}),y=T(s.admin.setRole),x=T(s.admin.setUserPermissions),S=T(s.admin.startImpersonation),C=T(s.admin.deleteUser),w=T(s.admin.setUserName),E=_e(),D=ve(),O=L(),[k,A]=(0,X.useState)(null),j=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of h??[])e.add(t.role);return[...e]},[h]),M=n!==``||i!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await y(e)}catch(e){O.error(ce(),e)}}async function F(e){try{await x(e)}catch(e){O.error(de(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await E({title:se(),description:_({user:t}),confirmWord:oe(),confirmLabel:f(),destructive:!0}))try{await C({profileId:e._id}),O.success(p({user:t}))}catch(e){O.error(pe(),e)}}async function H(e){let t=e.email||e.name||e.userId.slice(0,8),n=await D({title:g(),label:ie({user:t}),placeholder:u(),defaultValue:e.name??``,confirmLabel:ue()});if(n!==null)try{await w({profileId:e._id,name:n}),O.success(ae())}catch(e){O.error(a(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y,{q:n,onQChange:o,searchPlaceholder:me(),onReset:N,canReset:M,children:(0,Z.jsxs)(J,{value:i,onValueChange:m,children:[(0,Z.jsx)(q,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(V,{})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(I,{value:Q,children:fe()}),j.map(e=>(0,Z.jsx)(I,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:he(),rows:h,emptyHint:le(),rowActions:e=>{let t=[{label:te(),onSelect:()=>A({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:l(),onSelect:()=>void H(e)}];return e.userId!==v?.userId&&t.push({label:r(),onSelect:()=>void S({profileId:e._id})},{label:ne(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:ge(),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:re(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(J,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,Z.jsx)(q,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(V,{})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(I,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(I,{value:`user`,children:$(`user`)}),(0,Z.jsx)(I,{value:`admin`,children:$(`admin`)})]})]})},{header:ee(),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:d()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),F({profileId:e._id,permissions:[...n]})}})},{header:c(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(z,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Pe,{profileId:k?.profileId??null,userLabel:k?.label??``,open:k!==null,onOpenChange:e=>{e||A(null)}})]})}export{Le as UsersTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,At as i,Ct as a,D as o,Dt as s,E as c,Et as l,Fl as u,Ft as d,H as ee,J as f,K as p,Mt as m,Nt as h,Ot as g,Pt as _,Q as v,St as y,Tt as te,U as ne,V as re,W as b,Y as x,_P as S,_t as C,bt as w,cP as T,dt as ie,et as ae,ft as oe,gP as E,gt as D,hc as se,ht as ce,jt as le,k as ue,kt as O,mP as de,mt as k,nt as fe,pc as pe,pt as me,q as A,tt as j,uP as M,ut as N,vt as P,wt as F,xt as I,yt as L}from"./dist-Dw05q7xL.js";import{i as R,n as z,r as he,t as ge}from"./tabs--02lZ4zx.js";import{t as B}from"./button-CJcuK3wk.js";import{C as V,F as _e,I as ve,L as H,N as ye,Nt as be,P as xe,R as U,S as W,T as G,Wt as Se,dt as K,m as q,nn as Ce,rn as we,w as J,wt as Te,x as Y,z as Ee}from"./index-CVElkIyB.js";/* empty css */var X=o(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),Z=t(e(),1),Q=n(),De=[[`auto`,()=>g()],[`fr-FR`,()=>fe()],[`en-US`,()=>j()],[`en-GB`,()=>ae()],[`de-DE`,()=>r()],[`es-ES`,()=>v()]],Oe=[[`0.75`,()=>l()],[`1`,()=>te()],[`1.25`,()=>F()],[`1.5`,()=>a()]],$=0;function ke({instance:e}){let t=E(c.admin.upsertInstanceConfig),n=e.config??{},r={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[a,o]=(0,Z.useState)(r),[l,d]=(0,Z.useState)(`idle`),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(!1),g=de(c.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{o({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),d(`idle`)},[e._id]);let _=a.enabled!==r.enabled||a.engine!==r.engine||a.lang!==r.lang||a.rate!==r.rate||a.autoRead!==r.autoRead;async function v(){d(`saving`);try{let n={...e.config??{}};n.voiceEnabled=a.enabled,a.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,a.lang===`auto`?delete n.voiceLang:n.voiceLang=a.lang;let r=Number.parseFloat(a.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,a.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),d(`idle`)}catch{d(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(K,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":i()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:i()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:b()}),(0,Q.jsxs)(Y,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":b(),children:(0,Q.jsx)(G,{})}),(0,Q.jsxs)(W,{children:[(0,Q.jsx)(V,{value:`browser`,children:ne()}),e.kind===`hermes`?null:(0,Q.jsx)(V,{value:`gateway`,children:ee()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:re()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()}),(0,Q.jsxs)(Y,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":O(),children:(0,Q.jsx)(G,{})}),(0,Q.jsx)(W,{children:De.map(([e,t])=>(0,Q.jsx)(V,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()}),(0,Q.jsxs)(Y,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":s(),children:(0,Q.jsx)(G,{})}),(0,Q.jsx)(W,{children:Oe.map(([e,t])=>(0,Q.jsx)(V,{value:e,children:t()},e))})]})]}),a.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":y()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:y()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:I()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(B,{size:`sm`,disabled:!_||l===`saving`,onClick:()=>void v(),children:l===`saving`?u():se()}),(0,Q.jsx)(B,{variant:`outline`,size:`sm`,disabled:!a.enabled||f,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(h(!1),U(),H(),a.engine!==`gateway`){ve(P(),{lang:_e(a.lang,M()),rate:t});return}p(!0),g({instanceName:e.name,text:P()}).then(({mime:e,audioBase64:r})=>{n===$&&xe(r,e,{rate:t})}).catch(()=>{n===$&&h(!0)}).finally(()=>p(!1))},children:f?u():w()}),(0,Q.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>{$++,p(!1),U(),H()},children:L()})]}),l===`error`||m?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:m?ue():pe()}):null]})}function Ae({stt:e}){let t=S(c.me.getMe,{host:Te}),n=E(c.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:D()}),(0,Q.jsx)(K,{variant:e?`secondary`:`outline`,children:e?ie():N()}),(0,Q.jsx)(K,{variant:r?`secondary`:`destructive`,children:r?f():A()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":x()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:x()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ce()})]})}function je(){let e=S(c.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Ee(),[]),n=(0,Z.useMemo)(()=>ye(),[]),{section:r}=we({from:`/settings/voice`}),i=Ce({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:d()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(K,{variant:t?`secondary`:`destructive`,children:t?_():h()}),(0,Q.jsx)(K,{variant:n?`secondary`:`destructive`,children:n?m():le()})]}),(0,Q.jsxs)(ge,{value:r,onValueChange:e=>void i({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(he,{className:`w-full`,children:[(0,Q.jsxs)(R,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(be,{size:13,"aria-hidden":!0}),p()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Se,{size:13,"aria-hidden":!0}),D()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(X,{size:13,"aria-hidden":!0}),k()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(z,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsx)(z,{value:`talk`,children:(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:k()}),(0,Q.jsx)(K,{variant:`outline`,children:me()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:oe()})]})})]})]})}export{je as VoiceTab};
@@ -1 +0,0 @@
1
- import{D as e}from"./dist-Dw05q7xL.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};