@lacneu/atrium 0.102.0 → 0.103.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/assets/AccessTab-gaTBs3lV.js +1 -0
  2. package/dist/assets/{AdminSettings-B8n1yLsD.js → AdminSettings-CMjix9zl.js} +1 -1
  3. package/dist/assets/{AdvancedFilter-Bb66m5kb.js → AdvancedFilter-5BMuHHt6.js} +1 -1
  4. package/dist/assets/AgentFilesTab-D3tMMo2R.js +3 -0
  5. package/dist/assets/AnomaliesTab-CdFgsRwT.js +1 -0
  6. package/dist/assets/AuditTab-Yw1LvjgD.js +1 -0
  7. package/dist/assets/BridgeTab-CBE4zTQ1.js +1 -0
  8. package/dist/assets/ChatDefaultsTab-CIX9WUCl.js +1 -0
  9. package/dist/assets/{ConfirmDialog-BXcki0Ee.js → ConfirmDialog-Dy8WCeAF.js} +1 -1
  10. package/dist/assets/{DataTableShell-DRFFBx_j.js → DataTableShell-2_QPZexc.js} +1 -1
  11. package/dist/assets/DeletedChatsTab-Fzk38aqT.js +1 -0
  12. package/dist/assets/{DetailChips-Cv1sxdhU.js → DetailChips-DaliQU_Q.js} +1 -1
  13. package/dist/assets/{EntitySheet-B2B48bss.js → EntitySheet-D-JZB54h.js} +1 -1
  14. package/dist/assets/FeedbacksTab-DWmslsAt.js +1 -0
  15. package/dist/assets/{FieldLabel-Tea3wyVe.js → FieldLabel-D63ry-fi.js} +1 -1
  16. package/dist/assets/FilesTab-DzHfzOnQ.js +1 -0
  17. package/dist/assets/{FilterBar-DTVwlDpF.js → FilterBar-Bynn2H7k.js} +1 -1
  18. package/dist/assets/GroupsTab-hxsjfQDc.js +1 -0
  19. package/dist/assets/InstancesTab-DsJ_BBfc.js +1 -0
  20. package/dist/assets/IntegrationsTab-Cf3lTCzz.js +1 -0
  21. package/dist/assets/KnobRow-3my9jz_H.js +1 -0
  22. package/dist/assets/KpiTab-C6dn6jVl.js +1 -0
  23. package/dist/assets/PreferencesTab-DiDi7mpY.js +1 -0
  24. package/dist/assets/ProjectPage-DDto6xkD.js +1 -0
  25. package/dist/assets/PromptInjectionsTab-D3drsS9C.js +4 -0
  26. package/dist/assets/RolesTab-DDYieLTF.js +1 -0
  27. package/dist/assets/ScheduledTab-D-yTTYHC.js +1 -0
  28. package/dist/assets/ServiceAccountsTab-fJYmH0eU.js +1 -0
  29. package/dist/assets/SubAgentReportsTab-GXHpWbrW.js +1 -0
  30. package/dist/assets/ThemeShowroom-uU3PL_6V.js +1 -0
  31. package/dist/assets/{TimeRangePicker-D3PJq1H8.js → TimeRangePicker-DzJYDik_.js} +1 -1
  32. package/dist/assets/{TimezoneCombobox-CPTpWNQm.js → TimezoneCombobox-BY91kPSf.js} +1 -1
  33. package/dist/assets/TracesTab-C7zX1NUU.js +1 -0
  34. package/dist/assets/TrashTab-BVZJggvr.js +1 -0
  35. package/dist/assets/UsersTab-HdsTBYR0.js +1 -0
  36. package/dist/assets/VoiceTab-CnZ-twTR.js +1 -0
  37. package/dist/assets/{alert-dialog-BoEv1f8g.js → alert-dialog-DRrmbZYC.js} +1 -1
  38. package/dist/assets/{api-DSJJn0d7.js → api-CUskDNHD.js} +5 -5
  39. package/dist/assets/{badge-C4po8DQ1.js → badge-TiMZiv59.js} +1 -1
  40. package/dist/assets/{button-Dio0PVrp.js → button-CbHyzXCb.js} +1 -1
  41. package/dist/assets/capabilities-CASxhKEd.js +1 -0
  42. package/dist/assets/{card-CerX9wDn.js → card-vUc-7TYj.js} +1 -1
  43. package/dist/assets/check-Da8rPJKX.js +1 -0
  44. package/dist/assets/{checkbox-CsI4ggnp.js → checkbox-Czxm5pNj.js} +1 -1
  45. package/dist/assets/chevron-left-DxPC6E1S.js +1 -0
  46. package/dist/assets/chevron-right-BjOti-z8.js +1 -0
  47. package/dist/assets/chevron-up-DfOJb3vW.js +1 -0
  48. package/dist/assets/chevrons-up-down-Bp7zuoEk.js +1 -0
  49. package/dist/assets/{compatView--1YlftIc.js → compatView-Dj1HQXxr.js} +1 -1
  50. package/dist/assets/confTabs-BzReq467.css +1 -0
  51. package/dist/assets/convexApi-BPSJUy2j.js +1 -0
  52. package/dist/assets/{copy-BaUCUMp2.js → copy-C1_4Ewod.js} +1 -1
  53. package/dist/assets/{cronDescribe-CAuRX7uW.js → cronDescribe-BC0AcJer.js} +1 -1
  54. package/dist/assets/{deliveryRecorder-C7NQZrrH.js → deliveryRecorder-CGhwQ1sg.js} +1 -1
  55. package/dist/assets/{dialog-BfrsWZiD.js → dialog-DpoEg_Ex.js} +1 -1
  56. package/dist/assets/dispatchErrorInfo-BOJ5cTZo.js +1 -0
  57. package/dist/assets/{dist-ClkJChBn.js → dist-BmXC8pZv.js} +1 -1
  58. package/dist/assets/{dist-D7doQlva.js → dist-BqsRl4o3.js} +1 -1
  59. package/dist/assets/{dist-D-RIDSJc.js → dist-CHsekWGV.js} +1 -1
  60. package/dist/assets/{dist-Cw3aN_jM.js → dist-Cv-LvOB4.js} +1 -1
  61. package/dist/assets/{dist-CkbybbG7.js → dist-DQawXTf-.js} +1 -1
  62. package/dist/assets/{dist-ChrIV8UV.js → dist-HZSdA3kh.js} +1 -1
  63. package/dist/assets/{download-DWgC7zCa.js → download-Do4pcXOL.js} +1 -1
  64. package/dist/assets/{dropdown-menu-DHMOOlaP.js → dropdown-menu-BWxfj48Z.js} +1 -1
  65. package/dist/assets/{eye-B-ipuYEd.js → eye-yUMVb9gl.js} +1 -1
  66. package/dist/assets/{format-DGKgJf2p.js → format-zM-c-1S6.js} +1 -1
  67. package/dist/assets/{groupManageView-BMBqgRhV.js → groupManageView-DY6vPM1h.js} +1 -1
  68. package/dist/assets/index-B7hQ_j0i.js +158 -0
  69. package/dist/assets/index-D8Eob_Mc.css +1 -0
  70. package/dist/assets/{input-BSpTsBA6.js → input-DCbMcJYs.js} +1 -1
  71. package/dist/assets/{list-eSch39T9.js → list-DIWFv1eJ.js} +1 -1
  72. package/dist/assets/loader-circle-BO0Lx5va.js +1 -0
  73. package/dist/assets/{lock-0lxfSnTE.js → lock-X9ZGk2P9.js} +1 -1
  74. package/dist/assets/{pencil-aUWxuLhy.js → pencil-1kZxxbnV.js} +1 -1
  75. package/dist/assets/plus-CSOLqt7C.js +1 -0
  76. package/dist/assets/{popover-DBaIbsBr.js → popover-DiT_Oo6e.js} +1 -1
  77. package/dist/assets/roleDescriptions-CmJBKAaf.js +1 -0
  78. package/dist/assets/rotate-ccw-C-v_7YX7.js +1 -0
  79. package/dist/assets/{search-BK6bzZNi.js → search-D9Un2NMX.js} +1 -1
  80. package/dist/assets/searchSchemas-Dm-Qg010.js +55 -0
  81. package/dist/assets/{select-qM3ZfTHx.js → select-DCBGpD8v.js} +1 -1
  82. package/dist/assets/{server-DLnWqkX-.js → server-BSDuYUUF.js} +1 -1
  83. package/dist/assets/{speech-CrNma2Ue.js → speech-CfxX6OY3.js} +1 -1
  84. package/dist/assets/{star-CM6J2w_J.js → star-DjK6DoNA.js} +1 -1
  85. package/dist/assets/switch-Dt_I92ZY.js +1 -0
  86. package/dist/assets/{table-D2SJC960.js → table-GXZ7yFCE.js} +1 -1
  87. package/dist/assets/{tabs-mZfLmn2f.js → tabs-dQ50HGoj.js} +1 -1
  88. package/dist/assets/{toast-xNFwDnUy.js → toast-C8rSAMgh.js} +1 -1
  89. package/dist/assets/{tooltip-v_AyOWn6.js → tooltip-D3qNpGhD.js} +1 -1
  90. package/dist/assets/{trash-2-B4WSfc7G.js → trash-2-8oRd823U.js} +1 -1
  91. package/dist/assets/trashPage-CoBMe_r-.js +1 -0
  92. package/dist/assets/{trashView-Ct0Xw-a9.js → trashView-CIgTWQjI.js} +1 -1
  93. package/dist/assets/{triangle-alert-BkDa-x8g.js → triangle-alert-DQoWKyu_.js} +1 -1
  94. package/dist/assets/{usageView-C9Y6E0Zu.js → usageView-B0Wg081i.js} +1 -1
  95. package/dist/assets/{useChart-CKFEN42T.js → useChart-xKc_wRHf.js} +1 -1
  96. package/dist/assets/{useFontScale-ByBFat3y.js → useFontScale-C03nea0B.js} +1 -1
  97. package/dist/assets/{useStartNewChat-BszDHUjD.js → useStartNewChat-B66bn5hT.js} +2 -2
  98. package/dist/assets/{use_paginated_query-CQj09xXv.js → use_paginated_query-BatXdmTn.js} +1 -1
  99. package/dist/assets/{users-BJqaWlH1.js → users-DHMAZ7v8.js} +1 -1
  100. package/dist/assets/x-6-84PEVq.js +1 -0
  101. package/dist/index.html +57 -57
  102. package/package.json +2 -2
  103. package/dist/assets/AccessTab-JmFp20Kp.js +0 -1
  104. package/dist/assets/AgentFilesTab-C3CUT4Ep.js +0 -3
  105. package/dist/assets/AnomaliesTab-BQ2Bu98W.js +0 -1
  106. package/dist/assets/AuditTab-BV-XydO_.js +0 -1
  107. package/dist/assets/BridgeTab-D4RFq-Rb.js +0 -1
  108. package/dist/assets/ChatDefaultsTab-D0d9yEow.js +0 -1
  109. package/dist/assets/DeletedChatsTab-COYSFkNf.js +0 -1
  110. package/dist/assets/FeedbacksTab-6URuFdfg.js +0 -1
  111. package/dist/assets/FilesTab-esMtHJXt.js +0 -1
  112. package/dist/assets/GroupsTab-Io16XZHz.js +0 -1
  113. package/dist/assets/InstancesTab-BevtM68H.js +0 -1
  114. package/dist/assets/IntegrationsTab-DMY6VTUC.js +0 -1
  115. package/dist/assets/KnobRow-BsOT2O6U.js +0 -1
  116. package/dist/assets/KpiTab-KPPcgUxA.js +0 -1
  117. package/dist/assets/PreferencesTab-DJ9p401L.js +0 -1
  118. package/dist/assets/ProjectPage-BxEF71jN.js +0 -1
  119. package/dist/assets/PromptInjectionsTab-Vdb1lF36.js +0 -4
  120. package/dist/assets/RolesTab-DU0g4d-R.js +0 -1
  121. package/dist/assets/ScheduledTab-B6gWc0HN.js +0 -1
  122. package/dist/assets/ServiceAccountsTab-Dmb_LH0V.js +0 -1
  123. package/dist/assets/SubAgentReportsTab-D9rclslo.js +0 -1
  124. package/dist/assets/ThemeShowroom-N4qzUtlq.js +0 -1
  125. package/dist/assets/TracesTab-DiAkOmei.js +0 -1
  126. package/dist/assets/TrashTab-BMSJ7ANC.js +0 -1
  127. package/dist/assets/UsersTab-BQaLsUCK.js +0 -1
  128. package/dist/assets/VoiceTab-BSh-05Ze.js +0 -1
  129. package/dist/assets/capabilities-BTqhMVxR.js +0 -1
  130. package/dist/assets/check-DmQzfrws.js +0 -1
  131. package/dist/assets/chevron-left-DQ9FCoo_.js +0 -1
  132. package/dist/assets/chevron-right-C_b_y922.js +0 -1
  133. package/dist/assets/chevron-up-Dsqj2Oaj.js +0 -1
  134. package/dist/assets/chevrons-up-down-Pva00Np5.js +0 -1
  135. package/dist/assets/confTabs-CCBW5ofF.css +0 -1
  136. package/dist/assets/convexApi-CyScjgcq.js +0 -1
  137. package/dist/assets/dispatchErrorInfo-Bb7JyJFO.js +0 -1
  138. package/dist/assets/index-D6RuTaB7.css +0 -1
  139. package/dist/assets/index-DQC7YnEQ.js +0 -158
  140. package/dist/assets/loader-circle-BNhIFGdg.js +0 -1
  141. package/dist/assets/plus-Djbdyc2E.js +0 -1
  142. package/dist/assets/roleDescriptions-x3mUxTcX.js +0 -1
  143. package/dist/assets/rotate-ccw-BD-9XzMC.js +0 -1
  144. package/dist/assets/searchSchemas-CS2ZgsHC.js +0 -64
  145. package/dist/assets/trashPage-WtAhGCt7.js +0 -1
  146. package/dist/assets/x-CK8d5DC1.js +0 -1
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$q as r,AJ as i,Aq as a,BJ as o,BX as s,CJ as c,CY as l,Cq as u,Dq as ee,E as d,EJ as f,Eq as p,FJ as te,Fq as m,HJ as ne,HX as h,IJ as re,Iq as ie,LJ as g,Lq as ae,MJ as oe,Mq as se,NJ as ce,Nq as le,Oq as ue,PJ as de,Pq as fe,Qq as pe,Rq as me,SJ as he,SY as ge,Sq as _e,Tq as ve,UJ as ye,VJ as be,WJ as xe,XX as Se,Xq as _,Yq as Ce,Zq as we,_J as Te,_Y as Ee,aJ as v,bJ as De,bY as Oe,cJ as ke,dY as Ae,eJ as je,fY as Me,gJ as Ne,gY as Pe,gq as Fe,hJ as Ie,hY as Le,iJ as Re,jJ as ze,jq as Be,kJ as Ve,kq as He,lJ as Ue,lY as We,mY as Ge,nJ as Ke,oJ as y,pY as qe,qX as b,rJ as Je,sJ as Ye,t as x,tJ as S,uJ as Xe,uY as Ze,vJ as Qe,vY as $e,wJ as et,wY as tt,wq as nt,xJ as rt,xY as it,yJ as at,yY as ot,zJ as st,zq as ct}from"./api-DSJJn0d7.js";import{t as C}from"./chevron-left-DQ9FCoo_.js";import{t as w}from"./chevron-right-C_b_y922.js";import{t as lt}from"./list-eSch39T9.js";import{t as ut}from"./loader-circle-BNhIFGdg.js";import{a as dt,i as ft,n as pt,r as mt,t as ht}from"./cronDescribe-CAuRX7uW.js";import{t as gt}from"./pencil-aUWxuLhy.js";import{t as _t}from"./rotate-ccw-BD-9XzMC.js";import{t as vt}from"./trash-2-B4WSfc7G.js";import{a as T,i as E,n as D,r as O,t as k}from"./select-qM3ZfTHx.js";import{a as yt,c as bt,i as xt,n as St,o as Ct,r as wt,s as Tt,t as Et}from"./alert-dialog-BoEv1f8g.js";import{n as A,r as j,t as M}from"./popover-DBaIbsBr.js";import{t as N}from"./button-Dio0PVrp.js";import{t as Dt}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{r as Ot}from"./toast-xNFwDnUy.js";import{t as P}from"./badge-C4po8DQ1.js";import{a as kt,i as At,n as jt,o as Mt,r as Nt,t as Pt}from"./dialog-BfrsWZiD.js";import{t as Ft}from"./appHost-CH3EGcJw.js";import{a as It,i as F,n as Lt,o as Rt,r as I,t as zt}from"./table-D2SJC960.js";import{t as Bt}from"./FilterBar-DTVwlDpF.js";/* empty css */import{a as Vt,c as L,i as R,l as Ht,n as Ut,o as z,r as Wt,s as Gt,t as Kt,u as B}from"./TimezoneCombobox-CPTpWNQm.js";var qt=d(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Jt=d(`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`}]]),V=t(e(),1),H=n();function U(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function Yt({value:e,onChange:t}){let n=Ht(e),r=(0,V.useMemo)(()=>new Date,[]),[i,a]=(0,V.useState)(()=>({year:n?.year??r.getFullYear(),month:n?.month??r.getMonth()})),[o,s]=(0,V.useState)(!1),c=(0,V.useMemo)(()=>U(h()),[]),l=(0,V.useMemo)(()=>new Intl.DateTimeFormat(h(),{month:`long`,year:`numeric`}),[]),u=(0,V.useMemo)(()=>new Intl.DateTimeFormat(h(),{dateStyle:`medium`,timeStyle:`short`}),[]),ee=L(i.year,i.month),d=n?.hour??9,f=n?.minute??0,p=(e,n,r,i,a)=>t(B(e,n,r,i,a)),te=(e,t,n)=>{a({year:e,month:t}),p(e,t,n,d,f)},m=e=>{let t=new Date(i.year,i.month+e,1);a({year:t.getFullYear(),month:t.getMonth()})},ne=n===null?Ue():u.format(new Date(n.year,n.month,n.day,n.hour,n.minute));return(0,H.jsxs)(M,{modal:!0,open:o,onOpenChange:s,children:[(0,H.jsx)(j,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,className:`oc-dtp__trigger`,"aria-label":Xe(),children:[(0,H.jsx)(qt,{size:14,"aria-hidden":!0,className:`oc-dtp__icon`}),(0,H.jsx)(`span`,{className:n===null?`oc-dtp__placeholder`:void 0,children:ne})]})}),(0,H.jsxs)(A,{align:`start`,className:`oc-dtp__pop`,children:[(0,H.jsxs)(`div`,{className:`oc-dtp__head`,children:[(0,H.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":ke(),onClick:()=>m(-1),children:(0,H.jsx)(C,{size:15,"aria-hidden":!0})}),(0,H.jsx)(`span`,{className:`oc-dtp__month`,children:l.format(new Date(i.year,i.month,1))}),(0,H.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":Ye(),onClick:()=>m(1),children:(0,H.jsx)(w,{size:15,"aria-hidden":!0})})]}),(0,H.jsxs)(`div`,{className:`oc-dtp__grid`,children:[c.map((e,t)=>(0,H.jsx)(`span`,{className:`oc-dtp__wd`,children:e},t)),ee.map((e,t)=>{let i=n!==null&&n.year===e.year&&n.month===e.month&&n.day===e.day,a=r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,H.jsx)(`button`,{type:`button`,className:`oc-dtp__day`+(e.inMonth?``:` oc-dtp__day--out`)+(i?` oc-dtp__day--sel`:``)+(a&&!i?` oc-dtp__day--today`:``),onClick:()=>te(e.year,e.month,e.day),children:e.day},t)})]}),(0,H.jsxs)(`div`,{className:`oc-dtp__time`,children:[(0,H.jsxs)(k,{value:String(d),onValueChange:e=>p(i.year,i.month,n?.day??r.getDate(),Number(e),f),children:[(0,H.jsx)(E,{size:`sm`,"aria-label":y(),children:(0,H.jsx)(T,{})}),(0,H.jsx)(D,{className:`oc-dtp__timeopts`,children:Array.from({length:24},(e,t)=>(0,H.jsx)(O,{value:String(t),children:String(t).padStart(2,`0`)},t))})]}),(0,H.jsx)(`span`,{className:`oc-dtp__colon`,children:`:`}),(0,H.jsxs)(k,{value:String(f),onValueChange:e=>p(i.year,i.month,n?.day??r.getDate(),d,Number(e)),children:[(0,H.jsx)(E,{size:`sm`,"aria-label":v(),children:(0,H.jsx)(T,{})}),(0,H.jsx)(D,{className:`oc-dtp__timeopts`,children:Array.from({length:60},(e,t)=>(0,H.jsx)(O,{value:String(t),children:String(t).padStart(2,`0`)},t))})]})]})]})]})}function W(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function Xt(e,t,n){let r=e=>String(e).padStart(2,`0`);return`${e}-${r(t+1)}-${r(n)}`}function Zt(e){let t=new Map;for(let n of e){let e=W(n.atMs),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}for(let e of t.values())e.sort((e,t)=>e.atMs-t.atMs);return t}function Qt(e,t,n){let r=new Map,i=new Date(t,n+1,0).getDate();for(let a=1;a<=i;a++){let i=e.get(Xt(t,n,a));i!==void 0&&i.length>0&&r.set(a,i.length)}return r}function $t(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function en(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()+42);return{startMs:r.getTime(),endMs:i.getTime()}}function tn(e){return{startMs:new Date(e,0,1).getTime(),endMs:new Date(e+1,0,1).getTime()}}var G=3;function nn({events:e,mode:t,cursor:n,onModeChange:i,onCursorChange:a,onEventClick:o,footnote:s}){let c=h(),l=(0,V.useMemo)(()=>Zt(e),[e]),u=(0,V.useMemo)(()=>$t(c),[c]),ee=(0,V.useMemo)(()=>new Intl.DateTimeFormat(c,{month:`long`,year:`numeric`}),[c]),d=(0,V.useMemo)(()=>new Intl.DateTimeFormat(c,{month:`long`}),[c]),f=(0,V.useMemo)(()=>new Intl.DateTimeFormat(c,{hour:`2-digit`,minute:`2-digit`}),[c]),p=new Date,te=e=>{if(t===`year`){a({year:n.year+e,month:n.month});return}let r=new Date(n.year,n.month+e,1);a({year:r.getFullYear(),month:r.getMonth()})},m=t===`year`?String(n.year):ee.format(new Date(n.year,n.month,1));return(0,H.jsxs)(`div`,{className:`oc-cal`,children:[(0,H.jsxs)(`div`,{className:`oc-cal__head`,children:[(0,H.jsxs)(`div`,{className:`oc-cal__nav`,children:[(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,"aria-label":pe(),onClick:()=>te(-1),children:(0,H.jsx)(C,{})}),(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,"aria-label":we(),onClick:()=>te(1),children:(0,H.jsx)(w,{})}),(0,H.jsx)(N,{variant:`ghost`,size:`sm`,onClick:()=>a({year:p.getFullYear(),month:p.getMonth()}),children:r()})]}),(0,H.jsx)(`span`,{className:`oc-cal__title`,children:m}),(0,H.jsxs)(`div`,{className:`oc-cal__modes`,role:`group`,children:[(0,H.jsx)(N,{variant:t===`month`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`month`,onClick:()=>i(`month`),children:S()}),(0,H.jsx)(N,{variant:t===`year`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`year`,onClick:()=>i(`year`),children:je()})]})]}),t===`month`?(0,H.jsx)(rn,{cursor:n,byDay:l,weekdays:u,timeFmt:f,now:p,onEventClick:o}):(0,H.jsx)(an,{year:n.year,byDay:l,monthShortFmt:d,now:p,onOpenMonth:e=>{a({year:n.year,month:e}),i(`month`)}}),s?(0,H.jsx)(`p`,{className:`oc-cal__footnote`,children:s}):null]})}function rn({cursor:e,byDay:t,weekdays:n,timeFmt:r,now:i,onEventClick:a}){let o=L(e.year,e.month);return(0,H.jsxs)(`div`,{className:`oc-cal__month`,children:[n.map((e,t)=>(0,H.jsx)(`span`,{className:`oc-cal__wd`,children:e},t)),o.map((e,n)=>{let o=t.get(Xt(e.year,e.month,e.day))??[],s=i.getFullYear()===e.year&&i.getMonth()===e.month&&i.getDate()===e.day;return(0,H.jsxs)(`div`,{className:`oc-cal__day`+(e.inMonth?``:` oc-cal__day--out`)+(s?` oc-cal__day--today`:``),children:[(0,H.jsx)(`span`,{className:`oc-cal__daynum`,children:e.day}),o.slice(0,G).map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`oc-cal__event`+(e.muted?` oc-cal__event--muted`:``)+(e.exact?` oc-cal__event--exact`:``),style:e.color?{"--cal-ev":e.color}:void 0,title:`${r.format(e.atMs)} ${e.title}`,onClick:a?()=>a(e):void 0,children:[(0,H.jsx)(`span`,{className:`oc-cal__evdot`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`oc-cal__evtime`,children:r.format(e.atMs)}),(0,H.jsx)(`span`,{className:`oc-cal__evtitle`,children:e.title})]},e.id)),o.length>G?(0,H.jsx)(`span`,{className:`oc-cal__more`,children:_({count:o.length-G})}):null]},n)})]})}function an({year:e,byDay:t,monthShortFmt:n,now:r,onOpenMonth:i}){return(0,H.jsx)(`div`,{className:`oc-cal__year`,children:Array.from({length:12},(a,o)=>{let s=Qt(t,e,o),c=L(e,o);return(0,H.jsxs)(`button`,{type:`button`,className:`oc-cal__mini`,onClick:()=>i(o),children:[(0,H.jsx)(`span`,{className:`oc-cal__mininame`,children:n.format(new Date(e,o,1))}),(0,H.jsx)(`span`,{className:`oc-cal__minigrid`,"aria-hidden":!0,children:c.map((e,t)=>{let n=e.inMonth?s.get(e.day)??0:0,i=e.inMonth&&r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,H.jsx)(`span`,{className:`oc-cal__minidot`+(e.inMonth?``:` is-out`)+(n===1?` has-one`:``)+(n>1?` has-many`:``)+(i?` is-today`:``)},t)})})]},o)})})}var on={h:36e5,min:6e4,s:1e3,ms:1};function sn(e){if(e===null)return null;let t=e.trim(),n=/^every\s+(\d+(?:\.\d+)?)(h|min|s|ms)$/.exec(t);if(n!==null){let e=Number(n[1])*on[n[2]];return Number.isFinite(e)&&e>0?{kind:`every`,everyMs:e}:null}let r=/^(?:cron\s+)?([\d*,/-]+(?:\s+[\d*,/-]+){4})(?:\s*\(([^)]+)\))?$/.exec(t);if(r!==null)return{kind:`cron`,expr:r[1],tz:r[2]??null};let i=Date.parse(t);return Number.isFinite(i)?{kind:`at`,atMs:i}:null}function K(e,t,n){let r=new Set;for(let i of e.split(`,`)){let e=i,a=1,o=/^(.+)\/(\d{1,3})$/.exec(i);if(o!==null&&(e=o[1],a=Number(o[2]),a<1))return null;let s,c;if(e===`*`)s=t,c=n;else{let r=/^(\d{1,3})(?:-(\d{1,3}))?$/.exec(e);if(r===null||(s=Number(r[1]),c=r[2]===void 0?s:Number(r[2]),r[2]===void 0&&o!==null&&(c=n),s<t||c>n||s>c))return null}for(let e=s;e<=c;e+=a)r.add(e)}return r.size>0?[...r].sort((e,t)=>e-t):null}function q(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let n=K(t[0],0,59),r=K(t[1],0,23),i=K(t[2],1,31),a=K(t[3],1,12),o=K(t[4],0,7);if(!n||!r||!i||!a||!o)return null;let s=new Set(o.map(e=>e%7));return{minutes:n,hours:r,dom:new Set(i),months:new Set(a),dow:s,domRestricted:t[2]!==`*`,dowRestricted:t[4]!==`*`}}var cn=new Map;function J(e){let t=cn.get(e);if(t!==void 0)return t;let n=null;try{n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{n=null}return cn.set(e,n),n}function Y(e,t){if(t!==null){let n=J(t);if(n!==null){let t={};for(let r of n.formatToParts(e))r.type!==`literal`&&(t[r.type]=Number(r.value));return{y:t.year,mo:t.month-1,d:t.day,h:t.hour===24?0:t.hour,mi:t.minute}}}let n=new Date(e);return{y:n.getFullYear(),mo:n.getMonth(),d:n.getDate(),h:n.getHours(),mi:n.getMinutes()}}function X(e,t,n,r,i,a){if(a===null||J(a)===null)return new Date(e,t,n,r,i).getTime();let o=Date.UTC(e,t,n,r,i),s=e=>{let t=Y(e,a);return Date.UTC(t.y,t.mo,t.d,t.h,t.mi)-e},c=s(o),l=o-c,u=s(l);return u!==c&&(l=o-u),l}function Z(e,t,n,r){let i=new Map,a=(e,t)=>{e<n||e>=r||i.set(e,t||(i.get(e)??!1))};if(e?.kind===`at`)a(e.atMs,!0);else if(e?.kind===`every`){if(t!==null){let i=e.everyMs,o=Math.ceil((n-t)/i);for(let e=t+o*i,n=0;e<r&&n<400;e+=i,n++)a(e,e===t)}}else if(e?.kind===`cron`){let t=q(e.expr);if(t!==null&&t.hours.length*t.minutes.length<=400){let i=0,o=n-864e5;for(;o<r+864e5&&i<400;){let s=Y(o,e.tz);if(t.months.has(s.mo+1)){let o=new Date(Date.UTC(s.y,s.mo,s.d)).getUTCDay(),c=t.dom.has(s.d),l=t.dow.has(o);if(t.domRestricted&&t.dowRestricted?c||l:c&&l)for(let o of t.hours)for(let c of t.minutes){if(i>=400)break;let t=X(s.y,s.mo,s.d,o,c,e.tz);t>=n&&t<r&&(a(t,!1),i++)}}o=X(s.y,s.mo,s.d,12,0,e.tz)+864e5}}}return t!==null&&a(t,!0),[...i.entries()].map(([e,t])=>({atMs:e,exact:t})).sort((e,t)=>e.atMs-t.atMs).slice(0,400)}var Q=`crons`;function ln(e,t){return`${e}\u0000${t}`}function un(e,t,n){let r=[],i=new Map;for(let a of e){let{job:e}=a;if(e.id===null)continue;let o=ln(a.instanceName,e.id);i.set(o,a);let s=z(e)!==`active`,c=Z(s?null:sn(e.schedule),e.nextRunAtMs,t,n);for(let t of c)r.push({id:`${o}:${t.atMs}`,sourceId:Q,itemId:o,atMs:t.atMs,title:e.name??e.id,muted:s,exact:t.exact})}return{events:r,byItemId:i}}var $={minutes:6e4,hours:36e5,days:864e5};function dn(e){return e?.data?.code??`unknown`}function fn({status:e}){switch(Gt(e)){case`ok`:return(0,H.jsx)(P,{variant:`secondary`,children:c()});case`error`:return(0,H.jsx)(P,{variant:`destructive`,children:rt()});case`running`:return(0,H.jsx)(P,{variant:`outline`,children:De()});case`other`:return(0,H.jsx)(P,{variant:`outline`,children:e});case`none`:return(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}}function pn(){let e=b(x.scheduled.listMyCrons),t=b(x.scheduled.getCronDetail),n=b(x.scheduled.listCronRuns),r=b(x.scheduled.updateCron),d=b(x.scheduled.removeCron),pe=b(x.scheduled.runCronNow),_=Ot(),we=Se(x.me.getMe,{host:Ft})?.timezone,[v,ke]=(0,V.useState)(null),[je,Ue]=(0,V.useState)(!1),[y,Ye]=(0,V.useState)(!1),[S,Xe]=(0,V.useState)(null),[C,w]=(0,V.useState)(null),[A,j]=(0,V.useState)(null),[M,L]=(0,V.useState)(null),[Ht,Gt]=(0,V.useState)(!1),[B,U]=(0,V.useState)(Ut),[W,Xt]=(0,V.useState)(()=>new URLSearchParams(window.location.search).get(`job`)===null&&localStorage.getItem(`oc.sched.view`)===`calendar`?`calendar`:`list`),Zt=e=>{localStorage.setItem(`oc.sched.view`,e),Xt(e)},[Qt,$t]=(0,V.useState)(`month`),[G,rn]=(0,V.useState)(()=>{let e=new Date;return{year:e.getFullYear(),month:e.getMonth()}}),an=(0,V.useMemo)(()=>{let e=[];for(let t of v??[]){if(!t.supported||t.error!==null)continue;let n=t.kind===`openclaw`&&t.manageSupported;for(let r of t.jobs)Vt(r,B)&&e.push({instanceName:t.instanceName,canEdit:n,job:r})}return e},[v,B]),on=(0,V.useMemo)(()=>Qt===`year`?tn(G.year):en(G.year,G.month),[Qt,G]),sn=(0,V.useMemo)(()=>un(an,on.startMs,on.endMs),[an,on]),K=e=>{let t=sn.byItemId.get(e.itemId);t===void 0||!t.canEdit||t.job.id===null||pn(t.instanceName,t.job)},q=(0,V.useCallback)(async()=>{Ue(!0),Ye(!1);try{ke(await e({}))}catch{Ye(!0)}finally{Ue(!1)}},[e]);(0,V.useEffect)(()=>{q()},[q]);let cn=(0,V.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),J=(0,V.useRef)(null);(0,V.useEffect)(()=>{v!==null&&J.current!==null&&J.current.scrollIntoView({block:`center`})},[v]);let Y=(0,V.useMemo)(()=>new Intl.DateTimeFormat(h(),{dateStyle:`medium`,timeStyle:`short`}),[]),X=async(e,t,n)=>{Xe(e);try{await t(),_.success(n),await q()}catch(e){_.toast({variant:`error`,title:g({code:dn(e)})})}finally{Xe(null)}},Z=(0,V.useRef)(0),Q=(0,V.useRef)(0),ln=async(e,t)=>{if(t.id===null)return;let r=++Z.current;j({name:t.name??t.id,entries:null});try{let i=await n({instanceName:e,jobId:t.id,limit:20});if(r!==Z.current)return;j({name:t.name??t.id,entries:i})}catch(e){if(r!==Z.current)return;j(null),_.toast({variant:`error`,title:g({code:dn(e)})})}},pn=async(e,n)=>{if(n.id===null)return;let r=++Q.current;L({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%$.days===0?(s=String(e/$.days),c=`days`):e%$.hours===0?(s=String(e/$.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/$.minutes))),c=`minutes`))}if(r!==Q.current)return;L(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!==Q.current)return;L(null),_.toast({variant:`error`,title:g({code:dn(e)})})}},mn=async()=>{if(M===null)return;let e={};if(M.nameDirty&&M.name.trim()===``||M.messageDirty&&M.hasMessage&&M.message.trim()===``){_.toast({variant:`error`,title:_e()});return}if(M.nameDirty&&M.name.trim()!==``&&(e.name=M.name.trim()),M.scheduleDirty){if(M.scheduleKind===`cron`&&M.cronExpr.trim()!==``)e.schedule={kind:`cron`,expr:M.cronExpr.trim(),...M.tz.trim()===``?{}:{tz:M.tz.trim()}};else if(M.scheduleKind===`every`){let t=Number(M.everyValue);Number.isFinite(t)&&t>=1&&(e.schedule={kind:`every`,everyMs:Math.round(t*$[M.everyUnit])})}else if(M.scheduleKind===`at`&&M.at!==``){let t=Date.parse(M.at);Number.isFinite(t)&&(e.schedule={kind:`at`,at:new Date(t).toISOString()})}}if(M.scheduleDirty&&e.schedule===void 0){_.toast({variant:`error`,title:u()});return}if(M.messageDirty&&M.hasMessage&&M.message.trim()!==``&&(e.message=M.message.trim()),Object.keys(e).length===0){L(null);return}let t=Q.current;Gt(!0);try{await r({instanceName:M.instanceName,jobId:M.jobId,patch:e}),_.success(ie()),t===Q.current&&L(null),await q()}catch(e){_.toast({variant:`error`,title:g({code:dn(e)})})}finally{Gt(!1)}},hn=v?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,H.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:tt()}),(0,H.jsxs)(`div`,{className:`oc-sched__viewtoggle`,role:`group`,"aria-label":Re(),children:[(0,H.jsx)(N,{variant:W===`list`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":Je(),title:Je(),"aria-pressed":W===`list`,onClick:()=>Zt(`list`),children:(0,H.jsx)(lt,{})}),(0,H.jsx)(N,{variant:W===`calendar`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":Ke(),title:Ke(),"aria-pressed":W===`calendar`,onClick:()=>Zt(`calendar`),children:(0,H.jsx)(qt,{})})]}),(0,H.jsxs)(N,{variant:`ghost`,size:`sm`,onClick:()=>void q(),disabled:je,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,H.jsx)(_t,{size:14,"aria-hidden":!0}),l()]})]}),v!==null&&hn>0?(0,H.jsxs)(Bt,{q:B.q,onQChange:e=>U(t=>({...t,q:e})),searchPlaceholder:Qe(),onReset:()=>U(Ut),canReset:Wt(B),children:[(0,H.jsxs)(k,{value:B.state,onValueChange:e=>U(t=>({...t,state:e})),children:[(0,H.jsx)(E,{size:`sm`,className:`w-40`,children:(0,H.jsx)(T,{})}),(0,H.jsxs)(D,{children:[(0,H.jsx)(O,{value:`all`,children:Te()}),(0,H.jsx)(O,{value:`active`,children:Ze()}),(0,H.jsx)(O,{value:`paused`,children:Ae()}),(0,H.jsx)(O,{value:`auto-disabled`,children:We()})]})]}),(0,H.jsxs)(k,{value:B.result,onValueChange:e=>U(t=>({...t,result:e})),children:[(0,H.jsx)(E,{size:`sm`,className:`w-40`,children:(0,H.jsx)(T,{})}),(0,H.jsxs)(D,{children:[(0,H.jsx)(O,{value:`all`,children:Ne()}),(0,H.jsx)(O,{value:`ok`,children:c()}),(0,H.jsx)(O,{value:`error`,children:rt()}),(0,H.jsx)(O,{value:`running`,children:De()}),(0,H.jsx)(O,{value:`none`,children:at()})]})]})]}):null,v===null?(0,H.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":je,children:y?ge():s()}):W===`calendar`?(0,H.jsxs)(H.Fragment,{children:[y?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:ge()}):null,v.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:it()}):(0,H.jsx)(nn,{events:sn.events,mode:Qt,cursor:G,onModeChange:$t,onCursorChange:rn,onEventClick:K,footnote:Ce()})]}):(0,H.jsxs)(H.Fragment,{children:[y?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:ge()}):null,v.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:it()}):null,v.map(e=>{let t=e.jobs.filter(e=>Vt(e,B)),n=Wt(B)&&e.jobs.length>0&&t.length===0;return(0,H.jsxs)(`section`,{style:{marginBottom:20},children:[v.length>1||e.error||!e.supported?(0,H.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,H.jsx)(P,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:ot({code:e.error})}):e.jobs.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:$e()}):n?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:Ie()}):(0,H.jsxs)(zt,{children:[(0,H.jsx)(It,{children:(0,H.jsxs)(Rt,{children:[(0,H.jsx)(F,{children:Ee()}),(0,H.jsx)(F,{children:Pe()}),(0,H.jsx)(F,{children:Le()}),(0,H.jsx)(F,{children:Ge()}),(0,H.jsx)(F,{children:qe()}),(0,H.jsx)(F,{children:et()}),(0,H.jsx)(F,{children:ct()})]})}),(0,H.jsx)(Lt,{children:t.map((t,n)=>{let i=`${e.instanceName}:${t.id??n}`,a=S===i,s=e.manageSupported,c=e.kind===`openclaw`&&s;return(0,H.jsxs)(Rt,{ref:t.id!==null&&t.id===cn?J:void 0,"data-state":t.id!==null&&t.id===cn?`selected`:void 0,children:[(0,H.jsx)(I,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??Me()}),(0,H.jsx)(I,{children:(0,H.jsx)(P,{variant:`secondary`,children:t.agentId})}),(0,H.jsxs)(I,{className:`whitespace-nowrap`,children:[(0,H.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=ht(t.schedule),n=e===null?null:pt(e);return n===null?null:(0,H.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,H.jsx)(I,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:Y.format(t.nextRunAtMs)}),(0,H.jsx)(I,{children:z(t)===`auto-disabled`?(0,H.jsx)(P,{variant:`destructive`,title:`${t.autoDisabledReason??``}${t.autoDisabledAtMs===null?``:` · ${Y.format(t.autoDisabledAtMs)}`}`,children:We()}):z(t)===`active`?(0,H.jsx)(P,{variant:`secondary`,children:Ze()}):z(t)===`paused`?(0,H.jsx)(P,{variant:`outline`,children:Ae()}):(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,H.jsxs)(I,{children:[(0,H.jsx)(fn,{status:t.lastRunStatus}),t.lastDelivered===!1?(0,H.jsx)(P,{variant:`destructive`,title:t.lastDeliveryError??xe(),children:he()}):null]}),(0,H.jsx)(I,{className:`whitespace-nowrap`,children:t.id===null?(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):a?(0,H.jsx)(ut,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,H.jsxs)(`span`,{className:`oc-cronactions`,children:[c?(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,title:ne(),"aria-label":ne(),disabled:S!==null,onClick:()=>void X(i,async()=>{let n=await pe({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},re()),children:(0,H.jsx)(mt,{size:14,"aria-hidden":!0})}):null,c&&t.enabled!==null?(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,title:R(t)===`pause`?be():o(),"aria-label":R(t)===`pause`?be():o(),disabled:S!==null,onClick:()=>void X(i,()=>r({instanceName:e.instanceName,jobId:t.id,patch:{enabled:R(t)===`resume`}}),R(t)===`pause`?te():de()),children:R(t)===`pause`?(0,H.jsx)(dt,{size:14,"aria-hidden":!0}):(0,H.jsx)(ft,{size:14,"aria-hidden":!0})}):null,c?(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,title:me(),"aria-label":me(),disabled:S!==null,onClick:()=>void pn(e.instanceName,t),children:(0,H.jsx)(gt,{size:14,"aria-hidden":!0})}):null,c?(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,title:ae(),"aria-label":ae(),disabled:S!==null,onClick:()=>void ln(e.instanceName,t),children:(0,H.jsx)(Jt,{size:14,"aria-hidden":!0})}):null,s?(0,H.jsx)(N,{variant:`ghost`,size:`icon-sm`,title:st(),"aria-label":st(),disabled:S!==null,onClick:()=>w({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,H.jsx)(vt,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()})]},e.instanceName)}),hn>0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:Fe()}):null]}),(0,H.jsx)(Et,{open:C!==null,onOpenChange:e=>{e||w(null)},children:(0,H.jsxs)(xt,{children:[(0,H.jsxs)(Tt,{children:[(0,H.jsx)(bt,{children:oe()}),(0,H.jsx)(yt,{children:ze({name:C?.name??``})})]}),(0,H.jsxs)(Ct,{children:[(0,H.jsx)(wt,{children:i()}),(0,H.jsx)(St,{onClick:()=>{let e=C;w(null),e!==null&&X(`${e.instanceName}:${e.jobId}`,()=>d({instanceName:e.instanceName,jobId:e.jobId}),ce())},children:Ve()})]})]})}),(0,H.jsx)(Pt,{open:A!==null,onOpenChange:e=>{e||(Z.current++,j(null))},children:(0,H.jsxs)(jt,{style:{maxWidth:640},children:[(0,H.jsx)(kt,{children:(0,H.jsx)(Mt,{children:m({name:A?.name??``})})}),A?.entries===null?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):A!==null&&A.entries.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}):A===null?null:(0,H.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:A.entries.map((e,t)=>(0,H.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,H.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[(0,H.jsx)(fn,{status:e.status}),(0,H.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?Y.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,H.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,H.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,H.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error}),e.delivered===!1?(0,H.jsxs)(`div`,{className:`oc-cronpanel__run-undelivered`,children:[f({channel:e.deliveryChannel??`—`}),e.deliveryError===null?null:(0,H.jsx)(`span`,{className:`oc-cronpanel__plain`,children:e.deliveryError})]}):null]},t))})]})}),(0,H.jsx)(Pt,{open:M!==null,onOpenChange:e=>{e||(Q.current++,L(null))},children:(0,H.jsxs)(jt,{className:`oc-cronedit`,children:[(0,H.jsxs)(kt,{children:[(0,H.jsx)(Mt,{children:le()}),(0,H.jsx)(Nt,{children:se()})]}),M===null?null:M.loading?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,H.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,H.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,H.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Ee()}),(0,H.jsx)(Dt,{value:M.name,maxLength:200,onChange:e=>L({...M,name:e.target.value,nameDirty:!0})})]}),(0,H.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,H.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Be()}),(0,H.jsxs)(k,{value:M.scheduleKind,onValueChange:e=>L({...M,scheduleKind:e,scheduleDirty:!0}),children:[(0,H.jsx)(E,{children:(0,H.jsx)(T,{})}),(0,H.jsxs)(D,{children:[(0,H.jsx)(O,{value:`cron`,children:a()}),(0,H.jsx)(O,{value:`every`,children:He()}),(0,H.jsx)(O,{value:`at`,children:ue()})]})]}),M.scheduleKind===`cron`?(0,H.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,H.jsx)(Dt,{value:M.cronExpr,onChange:e=>L({...M,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,H.jsx)(Kt,{value:M.tz,onChange:e=>L({...M,tz:e,scheduleDirty:!0}),fallbackTz:we??void 0})]}):M.scheduleKind===`every`?(0,H.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,H.jsx)(Dt,{type:`number`,min:1,value:M.everyValue,onChange:e=>L({...M,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,H.jsxs)(k,{value:M.everyUnit,onValueChange:e=>L({...M,everyUnit:e,scheduleDirty:!0}),children:[(0,H.jsx)(E,{style:{maxWidth:160},children:(0,H.jsx)(T,{})}),(0,H.jsxs)(D,{children:[(0,H.jsx)(O,{value:`minutes`,children:ee()}),(0,H.jsx)(O,{value:`hours`,children:p()}),(0,H.jsx)(O,{value:`days`,children:ve()})]})]})]}):(0,H.jsx)(Yt,{value:M.at,onChange:e=>L({...M,at:e,scheduleDirty:!0})})]}),M.hasMessage?(0,H.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,H.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:ye()}),(0,H.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:M.message,onChange:e=>L({...M,message:e.target.value,messageDirty:!0})})]}):null]}),(0,H.jsxs)(At,{children:[(0,H.jsx)(N,{variant:`ghost`,onClick:()=>L(null),children:i()}),(0,H.jsxs)(N,{onClick:()=>void mn(),disabled:M===null||M.loading||Ht,children:[Ht?(0,H.jsx)(ut,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,nt()]})]})]})})]})}export{pn as ScheduledTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$U as r,$W as i,AW as ee,BU as a,BW as te,CW as ne,DW as re,EW as ie,FW as ae,GU as o,GW as oe,HU as se,HW as ce,IW as le,JU as ue,JW as de,KU as fe,KW as pe,LU as s,LW as me,MW as he,NW as ge,OW as _e,PW as ve,QU as c,QW as l,RU as u,RW as ye,SW as be,TW as xe,UU as d,UW as Se,VU as f,VW as Ce,WU as p,WW as we,XU as m,XW as Te,XX as h,YU as g,YW as Ee,YX as _,ZU as v,ZW as y,_W as De,aW as b,bW as Oe,cW as ke,dW as Ae,eG as je,eW as x,fW as Me,gW as Ne,hW as Pe,iW as S,jW as Fe,kW as Ie,lW as Le,mW as Re,nG as ze,nW as C,oW as w,pW as Be,qU as T,qW as Ve,qX as He,rG as Ue,rW as E,sW as We,t as D,tG as Ge,tW as O,uW as Ke,vW as qe,wW as Je,xW as Ye,yW as Xe,zU as k,zW as Ze}from"./api-DSJJn0d7.js";import{n as Qe,t as $e}from"./useNavigate-D3GIoxyW.js";import{t as A}from"./check-DmQzfrws.js";import{r as et}from"./dist-ClkJChBn.js";import{t as tt}from"./chevron-right-C_b_y922.js";import{t as j}from"./copy-BaUCUMp2.js";import{a as M,i as N,n as P,r as F,t as I}from"./select-qM3ZfTHx.js";import{t as L}from"./button-Dio0PVrp.js";import{t as R}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{r as nt}from"./toast-xNFwDnUy.js";import{t as z}from"./badge-C4po8DQ1.js";import{n as B,t as V}from"./format-DGKgJf2p.js";import{a as H,i as U,n as W,o as G,r as K,t as q}from"./dialog-BfrsWZiD.js";import{n as rt}from"./ConfirmDialog-BXcki0Ee.js";import{t as it}from"./EntitySheet-B2B48bss.js";import{t as at}from"./FilterBar-DTVwlDpF.js";import{t as ot}from"./DataTableShell-DRFFBx_j.js";import{t as st}from"./roleDescriptions-x3mUxTcX.js";var J=t(e(),1),Y=n(),ct=[{value:`never`,label:()=>d(),days:null},{value:`30`,label:()=>se(),days:30},{value:`90`,label:()=>f(),days:90}],X=720*60*60*1e3,Z=`__all__`,Q={name:``,roleKey:``,description:``};function $(){let e=Qe({from:`/settings/serviceAccounts`}),t=$e({from:`/settings/serviceAccounts`}),n=e.q??``,r=e.status??Z,[a,o]=(0,J.useState)(Z),se=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ue=e=>void t({search:t=>({...t,status:e===Z?void 0:e})}),fe=h(D.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===Z?void 0:a,disabled:r===Z?void 0:r===`disabled`}}),s=h(D.apiKeys.listKeys,{}),c=h(D.apiKeys.listRoles,{}),u=_(D.apiKeys.createServiceAccount),d=_(D.apiKeys.updateServiceAccount),f=_(D.apiKeys.deleteServiceAccount),p=He(D.apiKeys.mintApiKey),m=_(D.apiKeys.revokeApiKey),g=rt(),v=nt(),b=n!==``||a!==Z||r!==Z;function x(){o(Z),t({search:{},replace:!0})}let[S,C]=(0,J.useState)(!1),[w,T]=(0,J.useState)(Q),[E,O]=(0,J.useState)(null),[k,A]=(0,J.useState)(new Set),[j,B]=(0,J.useState)(null),V=(0,J.useRef)(!1),[H,U]=(0,J.useState)(new Set),[W,G]=(0,J.useState)({}),[K,q]=(0,J.useState)(null),X=(0,J.useMemo)(()=>{let e=new Map;for(let t of s??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[s]);function $(e){A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{E?(await d({serviceAccountId:E,name:w.name,roleKey:w.roleKey,description:w.description}),v.success(Ye())):await u({name:w.name,roleKey:w.roleKey,description:w.description||void 0}),T(Q),O(null),C(!1)}catch(e){v.error(E?be():ne(),e)}}function ft(e){T({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),C(!0)}async function pt(e){if(V.current)return;V.current=!0;let t=W[e._id]??`never`,n=ct.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;B(e._id);try{let t=await p({serviceAccountId:e._id,expiresAt:r});q({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){v.error(Oe(),e)}finally{V.current=!1,B(null)}}async function mt(e){if(await g({title:Xe(),description:(0,Y.jsxs)(Y.Fragment,{children:[qe(),` `,(0,Y.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,De(),` `,(0,Y.jsx)(`strong`,{children:Ne()}),` `,Pe()]}),confirmWord:e.name,confirmLabel:Re(),destructive:!0}))try{await f({serviceAccountId:e._id}),v.success(Be(),e.name)}catch(e){v.error(Me(),e)}}async function ht(e){if(await g({title:Ae(),description:(0,Y.jsxs)(Y.Fragment,{children:[Ke(),` `,(0,Y.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Le()]}),confirmLabel:ke(),destructive:!0})&&!H.has(e._id)){U(t=>new Set(t).add(e._id));try{await m({keyId:e._id})}catch(e){v.error(We(),e)}finally{U(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ue()}),(0,Y.jsxs)(at,{q:n,onQChange:se,searchPlaceholder:ze(),onReset:x,canReset:b,children:[(0,Y.jsxs)(I,{value:a,onValueChange:o,children:[(0,Y.jsx)(N,{size:`sm`,className:`w-40`,children:(0,Y.jsx)(M,{placeholder:Ge()})}),(0,Y.jsxs)(P,{children:[(0,Y.jsx)(F,{value:Z,children:je()}),(c??[]).map(e=>(0,Y.jsx)(F,{value:e.key,children:e.key},e._id))]})]}),(0,Y.jsxs)(I,{value:r,onValueChange:ue,children:[(0,Y.jsx)(N,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(M,{})}),(0,Y.jsxs)(P,{children:[(0,Y.jsx)(F,{value:Z,children:i()}),(0,Y.jsx)(F,{value:`active`,children:l()}),(0,Y.jsx)(F,{value:`disabled`,children:y()})]})]})]}),(0,Y.jsx)(ot,{title:Te(),rows:fe,addLabel:Ee(),onAdd:()=>{T(Q),O(null),C(!0)},emptyHint:de(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,Y.jsx)(lt,{account:e,keys:X.get(e._id)??[],onRevoke:ht,revoking:H}),rowActions:e=>[...(e.managedBy??null)===null?[{label:we(),onSelect:()=>ft(e)},{label:Ve(),onSelect:()=>void pt(e)}]:[],{label:k.has(e._id)?pe():oe(),onSelect:()=>$(e._id)},...(e.managedBy??null)===null?[{label:Se(),variant:`destructive`,onSelect:()=>void mt(e)}]:[]],columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(L,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?ce():Ce(),onClick:()=>$(e._id),children:k.has(e._id)?(0,Y.jsx)(et,{}):(0,Y.jsx)(tt,{})})},{header:te(),sort:e=>e.name,cell:e=>(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{children:e.name}),e.description?(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Ze(),sort:e=>e.roleKey,cell:e=>(0,Y.jsx)(z,{variant:`secondary`,children:e.roleKey})},{header:ye(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,Y.jsx)(z,{variant:`destructive`,children:y()}):(0,Y.jsx)(z,{variant:`outline`,children:l()})},{header:me(),cell:e=>(0,Y.jsxs)(I,{value:W[e._id]??`never`,onValueChange:t=>G(n=>({...n,[e._id]:t})),children:[(0,Y.jsx)(N,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(M,{})}),(0,Y.jsx)(P,{children:ct.map(e=>(0,Y.jsx)(F,{value:e.value,children:e.label()},e.value))})]})},{header:le(),sort:e=>(X.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(X.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,Y.jsx)(`span`,{className:`oc-sa__keycount`,children:j===e._id?ae():ve({count:t})})}}]}),(0,Y.jsx)(it,{open:S,onOpenChange:e=>{C(e),e||O(null)},title:E?ge():ee(),description:E?he():Ie(),canSubmit:!!(w.name&&w.roleKey),onSubmit:dt,submitLabel:E?Fe():_e(),children:(0,Y.jsxs)(`div`,{className:`oc-form`,children:[(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:re()}),(0,Y.jsx)(R,{value:w.name,onChange:e=>T({...w,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:ie()}),(0,Y.jsxs)(I,{value:w.roleKey||void 0,onValueChange:e=>T({...w,roleKey:e}),children:[(0,Y.jsx)(N,{className:`w-full`,children:(0,Y.jsx)(M,{placeholder:xe()})}),(0,Y.jsx)(P,{children:(c??[]).map(e=>(0,Y.jsxs)(F,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(c??[]).find(e=>e.key===w.roleKey),t=e?st(e):null;return t?(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:Je()}),(0,Y.jsx)(R,{value:w.description,onChange:e=>T({...w,description:e.target.value})})]})]})}),(0,Y.jsx)(ut,{minted:K,onClose:()=>q(null)})]})}function lt({account:e,keys:t,onRevoke:n,revoking:i}){return(0,Y.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,Y.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[w(),` `,(0,Y.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,Y.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{children:S()}),(0,Y.jsx)(`th`,{children:E()}),(0,Y.jsx)(`th`,{children:C()}),(0,Y.jsx)(`th`,{children:O()}),(0,Y.jsx)(`th`,{children:x()}),(0,Y.jsx)(`th`,{children:r()}),(0,Y.jsx)(`th`,{})]})}),(0,Y.jsx)(`tbody`,{children:t.map(t=>(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:(0,Y.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,Y.jsx)(`td`,{children:(0,Y.jsx)(z,{variant:`secondary`,children:e.roleKey})}),(0,Y.jsx)(`td`,{children:B(t.createdAt)}),(0,Y.jsx)(`td`,{className:dt(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,Y.jsx)(`td`,{children:pt(t.expiresAt)}),(0,Y.jsx)(`td`,{children:mt(t)}),(0,Y.jsx)(`td`,{className:`text-right`,children:!t.disabled&&(e.managedBy??null)===null?(0,Y.jsx)(L,{variant:`destructive`,size:`sm`,disabled:i.has(t._id),onClick:()=>n(t),children:i.has(t._id)?c():v()}):null})]},t._id))})]})]})}function ut({minted:e,onClose:t}){let[n,r]=(0,J.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,Y.jsx)(q,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,Y.jsxs)(W,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,Y.jsxs)(H,{children:[(0,Y.jsx)(G,{children:m()}),(0,Y.jsx)(K,{children:g({name:e.accountName})})]}),(0,Y.jsx)(`div`,{className:`oc-sa__minted-warning`,children:ue()}),(0,Y.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Y.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,Y.jsxs)(L,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":T(),children:[n?(0,Y.jsx)(A,{}):(0,Y.jsx)(j,{}),n?fe():o()]})]}),(0,Y.jsx)(U,{children:(0,Y.jsx)(L,{onClick:()=>{r(!1),t()},children:p()})})]}):null})}function dt(e){return e!==null&&Date.now()-e>X}function ft(e){return e===null?a():B(e)}function pt(e){return e===null?`—`:V(e)}function mt(e){return e.disabled?(0,Y.jsx)(z,{variant:`destructive`,children:k()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,Y.jsx)(z,{variant:`outline`,children:u()}):(0,Y.jsx)(z,{variant:`outline`,children:s()})}export{$ as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$m as r,Am as i,Bm as a,Cm as o,Dm as s,Em as c,Fm as l,Gm as u,Hm as d,Im as f,Jm as p,Km as m,Lm as h,Mm as g,Nm as _,Om as v,Pm as y,Qm as b,Rm as x,Sm as S,Tm as C,Um as w,Vm as T,Wm as E,XX as D,Xm as O,YX as k,Ym as A,Zm as j,ah as M,eh as N,ih as P,jm as F,km as I,nh as ee,qm as L,rh as R,t as z,th as B,wm as V,xm as H,zm as U}from"./api-DSJJn0d7.js";import{t as W}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{n as G}from"./format-DGKgJf2p.js";import{n as K}from"./ConfirmDialog-BXcki0Ee.js";import{t as q}from"./DataTableShell-DRFFBx_j.js";var J=t(e(),1),Y=n(),X={hung:()=>d(),wrong_result:()=>T(),error:()=>a(),other:()=>U()},Z=e=>(e&&X[e]?.())??e??`—`;function Q(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function $({data:e}){let t=e.snapshot,n=k(z.subAgentReports.respondToReport),[r,a]=(0,J.useState)(e.thread),[o,u]=(0,J.useState)(``),[d,p]=(0,J.useState)(!1);async function m(){let t=o.trim();if(!(!t||d)){p(!0);try{await n({reportId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),u(``)}finally{p(!1)}}}return(0,Y.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,Y.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Z(e.category),` · `,x({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:h()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:f()}),r.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:r.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?l():y()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:_()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:g(),value:o,maxLength:2e3,rows:3,onChange:e=>u(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void m(),disabled:!o.trim()||d,children:d?i():F()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[I({count:t.children.length}),t.childrenTruncated?` ${v()}`:``,t.textTruncated?` ${s()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${c()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:C()}),(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:V()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function te(){let e=D(z.subAgentReports.listForAdmin,{}),t=k(z.subAgentReports.readReport),n=k(z.subAgentReports.deleteReport),i=K(),[a,s]=(0,J.useState)(null),[c,l]=(0,J.useState)({});async function d(e){if(a===e._id){s(null);return}if(!c[e._id]){let n=await t({reportId:e._id});l(t=>({...t,[e._id]:n}))}s(e._id)}async function f(e){await i({title:o(),description:S(),confirmLabel:H(),destructive:!0})&&(await n({reportId:e._id}),a===e._id&&s(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[R(),` `,(0,Y.jsx)(`strong`,{children:ee()}),` `,B()]}),(0,Y.jsx)(q,{title:M(),rows:e,emptyHint:P(),isExpanded:e=>a===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Y.jsx)($,{data:c[e._id]}):null,columns:[{header:N(),cell:e=>G(e.at),sort:e=>e.at},{header:r(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:b(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:j(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${p({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:O(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:A(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:L()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:m()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:a===e._id?E():u(),onSelect:()=>void d(e)},{label:w(),onSelect:()=>void f(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$G as r,$K as i,AK as a,BK as o,CK as s,DK as c,EK as l,FK as u,GG as d,GK as f,HK as p,IK as m,IX as h,JG as g,JK as ee,KG as _,KK as v,LK as te,LX as ne,MK as re,NK as ie,OK as ae,PK as oe,QG as y,QK as se,RK as ce,RX as le,SK as ue,TK as de,UK as fe,VK as pe,WG as me,WK as he,XG as ge,XK as _e,XX as b,YG as ve,YK as ye,YX as x,ZG as be,ZK as xe,_K as Se,_m as Ce,aK as we,aq as Te,bK as Ee,bm as S,cK as De,cq as Oe,dK as ke,dq as Ae,eK as je,eq as Me,fK as Ne,fq as Pe,gK as Fe,hK as Ie,iK as Le,iq as Re,jK as ze,kK as C,lK as Be,lq as Ve,mK as He,nK as Ue,nq as w,oK as We,oq as Ge,pK as Ke,qG as qe,qK as Je,qX as Ye,r as Xe,rK as Ze,rq as Qe,sK as $e,sq as et,t as T,tK as tt,tq as nt,uK as E,uq as rt,vK as it,vm as at,wK as ot,xK as st,yK as ct,ym as D,zK as lt}from"./api-DSJJn0d7.js";import{t as O}from"./check-DmQzfrws.js";import{c as ut,g as k,i as dt,n as ft,r as A,s as j,t as pt}from"./dropdown-menu-DHMOOlaP.js";import{t as mt}from"./download-DWgC7zCa.js";import{t as M}from"./checkbox-CsI4ggnp.js";import{i as N,n as ht,r as gt}from"./useChart-CKFEN42T.js";import{t as P}from"./x-CK8d5DC1.js";import{a as F,i as I,n as L,r as R,t as z}from"./select-qM3ZfTHx.js";import{t as B}from"./button-Dio0PVrp.js";import{t as V}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{t as H}from"./badge-C4po8DQ1.js";import{t as U}from"./appHost-CH3EGcJw.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-CerX9wDn.js";import{a as wt,i as W,n as Tt,o as G,r as K,t as Et}from"./table-D2SJC960.js";import{t as Dt}from"./TimeRangePicker-D3PJq1H8.js";import{t as Ot}from"./FilterBar-DTVwlDpF.js";import{t as kt}from"./AdvancedFilter-Bb66m5kb.js";var q=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 J(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(Ke());if(e.size>Lt)throw Error(Ne());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(E());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(E());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);J(e.data,d.width,d.height)?Ft(e.data,t.variantFor===`dark`?jt:Mt):It(e.data),p.putImageData(e,0,0)}let m=J(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Bt)??await Y(f,`image/png`);if(!h)throw Error(Be());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(ke())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Wt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Gt={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function 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 qt(e){return e===`light`?le():e===`dark`?ne():h()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:Xe(`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)(O,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(B,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":S(),title:S(),children:(0,X.jsx)(mt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=b(T.charts.listMyCharts),r=x(T.charts.setMyChart);async function a(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:Qe()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:w(),subtitle:nt(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?Me():n.via===`owner`?i():se({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void a(n.key),onExport:()=>Wt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:xe()}):null]})}function Qt(){let e=x(T.charts.importChart),[t,n]=(0,q.useState)(``),[r,i]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[l,d]=(0,q.useState)(!1),[f,p]=(0,q.useState)(!1);async function h(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),d(!1);try{let e=await t.text();i(e)}catch{s(C())}}}async function g(){if(s(null),d(!1),t.trim()===``){s(c());return}let a;try{a=JSON.parse(r)}catch{s(C());return}p(!0);try{await e({name:t.trim(),tokens:a}),d(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{p(!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:te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:m()})]}),(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:u()}),(0,X.jsx)(V,{value:t,onChange:e=>n(e.target.value),placeholder:oe(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ie()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:re(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(N,{className:`size-4`}),ze(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void h(e)})]})}),(0,X.jsx)(B,{size:`sm`,disabled:f,onClick:()=>void g(),children:a()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,l?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:ae()}):null]})]})}function $t({chart:e}){let t=Ye(T.charts.setChartLogo),n=x(T.charts.removeChartLogo),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Vt(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Ee():ct()}),(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)(B,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(N,{className:`size-4`}),t?Se():it(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(B,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:Ie()}):null,t?(0,X.jsx)(B,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Fe()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:st()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(f,{mode:`light`}),(0,X.jsx)(f,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:He()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=b(T.me.getMe,{host:U}),n=x(T.charts.addChartDomain),r=x(T.charts.removeChartDomain),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:De()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Le()}):u.map(e=>(0,X.jsxs)(H,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ze({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(P,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(V,{value:i,onChange:e=>a(e.target.value),placeholder:We(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(B,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:we()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:$e()}),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 tn({chart:e}){let t=x(T.charts.updateChart),n=x(T.charts.deleteChart),[i,a]=(0,q.useState)(!1),[o,c]=(0,q.useState)(e.name),[l,u]=(0,q.useState)(()=>$(e.tokens)),[d,f]=(0,q.useState)(e.tokens.bpm??0),[p,m]=(0,q.useState)(null),[h,g]=(0,q.useState)(!1);function ee(){c(e.name),u($(e.tokens)),f(e.tokens.bpm??0),m(null),a(!0)}async function _(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(l)}catch{m(C());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;d>0?e.bpm=d:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),a(!1)}catch(e){m(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function v(){if(e.chartId!==void 0&&window.confirm(y()))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:i?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(B,{variant:`outline`,size:`sm`,onClick:ee,children:s()}),(0,X.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>void v(),children:ue()})]})})]}),i?(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:je()}),(0,X.jsx)(V,{value:o,onChange:e=>c(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:d,onChange:e=>f(Number(e.target.value)),"aria-label":D()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:d===0?at():`${d} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ce()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:r()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:l,onChange:e=>u(e.target.value),rows:10,spellCheck:!1})]}),p?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:p}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{size:`sm`,disabled:h,onClick:()=>void _(),children:Ue()}),(0,X.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>a(!1),children:tt()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function nn(){let e=b(T.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:l()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:de()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ot()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(tn,{chart:e},e.key))})]})}function rn({chart:e,groups:t}){let n=x(T.charts.addChartToGroupPool),r=x(T.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,s=new Set((a??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,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)(H,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?fe():e.kind===`custom`&&e.scope===`personal`?g():he()}),e.isGlobalDefault?(0,X.jsx)(H,{variant:`default`,children:p()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:o()}),(a??[]).map(e=>(0,X.jsxs)(H,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ce({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(P,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(z,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(I,{size:`sm`,className:`w-56`,children:(0,X.jsx)(F,{placeholder:lt()})}),(0,X.jsx)(L,{children:c.map(e=>(0,X.jsx)(R,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:pe()}):null]})]})}function an({chart:e}){let t=x(T.charts.promoteChartToCommon),n=x(T.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(y()))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)(H,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?qe():g()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ve({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:_()}):null,(0,X.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:d()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=x(T.admin.setDefaultThemeMode),i=x(T.admin.setDefaultLocale),a=x(T.charts.setDefaultChart),o=b(T.charts.listChartsAdmin),s=b(T.groups.listGroups,{}),c=e??`system`,l=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:Ge()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Te()})]}),(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:_e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:w()}),gt.map(e=>(0,X.jsx)(B,{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)(B,{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:ee()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Je()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(rn,{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:v()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:f()})]}),(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)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ge()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:me()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(an,{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:Pe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(B,{variant:c===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:rt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:_t().map(e=>(0,X.jsx)(B,{variant:l===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:Oe()})]})]})}function sn(){let e=b(T.me.getMe,{host:U}),t=ht(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(nn,{}),e?.role===`admin`?(0,X.jsx)(on,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function cn(){let[e,t]=(0,q.useState)(!0),[n,r]=(0,q.useState)(`per-user`),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(Z),[c,l]=(0,q.useState)(Z),[u,d]=(0,q.useState)(Gt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Gt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(sn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:et()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{children:`Default`}),(0,X.jsx)(B,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(B,{variant:`outline`,children:`Outline`}),(0,X.jsx)(B,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(B,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(B,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(B,{size:`sm`,children:`Small`}),(0,X.jsx)(B,{children:`Default`}),(0,X.jsx)(B,{size:`lg`,children:`Large`}),(0,X.jsx)(B,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(k,{})}),(0,X.jsx)(B,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(H,{children:`Default`}),(0,X.jsx)(H,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(H,{variant:`outline`,children:`Outline`}),(0,X.jsx)(H,{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)(V,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(z,{value:n,onValueChange:r,children:[(0,X.jsx)(I,{className:`w-56`,children:(0,X.jsx)(F,{placeholder:`Select…`})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(R,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(R,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(M,{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)(z,{value:o,onValueChange:s,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(F,{})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(R,{value:Z,children:`Toutes directions`}),(0,X.jsx)(R,{value:`inbound`,children:`inbound`}),(0,X.jsx)(R,{value:`outbound`,children:`outbound`}),(0,X.jsx)(R,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(z,{value:c,onValueChange:l,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(F,{})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(R,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(R,{value:`info`,children:`info`}),(0,X.jsx)(R,{value:`warn`,children:`warn`}),(0,X.jsx)(R,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(kt,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(Dt,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(pt,{children:[(0,X.jsx)(ut,{asChild:!0,children:(0,X.jsx)(B,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(k,{})})}),(0,X.jsxs)(ft,{align:`start`,children:[(0,X.jsx)(dt,{children:`Actions`}),(0,X.jsx)(j,{}),(0,X.jsx)(A,{children:`Edit`}),(0,X.jsx)(A,{children:`Duplicate`}),(0,X.jsx)(j,{}),(0,X.jsx)(A,{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)(B,{size:`sm`,children:`Save`}),(0,X.jsx)(B,{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)(M,{"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)(M,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(K,{className:`font-medium`,children:e.n}),(0,X.jsx)(K,{children:(0,X.jsx)(H,{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)(O,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(K,{children:(0,X.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(k,{})})})]},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{cn as ThemeShowroom};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$j as r,Aj as i,Az as a,Bj as o,Bz as s,Cj as c,Dj as l,Dz as u,E as d,Ej as f,Ez as p,Fj as m,Fz as h,Gj as g,Gu as _,Gz as v,Hj as y,Hz as b,Ij as x,Iz as S,Jj as ee,Jz as C,Kj as te,Ku as w,Kz as T,Lj as ne,Lz as E,Mj as re,Mz as ie,Nj as ae,Nz as oe,Oj as se,Oz as D,Pj as ce,Pz as O,Qj as le,Rj as ue,Rz as de,Sj as fe,Tj as pe,Tz as k,Uj as me,Uz as A,Vj as he,Vz as j,Wj as ge,Wz as M,XX as N,Xj as _e,YX as P,Yj as ve,Yz as ye,Zj as be,_z as xe,aM as Se,bz as Ce,cz as we,dz as Te,eM as Ee,fz as De,gz as Oe,hz as F,iM as ke,jj as Ae,jz as je,kj as Me,kz as Ne,lz as Pe,mz as Fe,nM as Ie,oz as Le,pz as Re,qj as ze,qu as Be,qz as Ve,rM as He,sz as Ue,t as I,tM as We,uz as Ge,vz as Ke,wj as qe,yz as Je,zj as Ye,zz as Xe}from"./api-DSJJn0d7.js";import{n as Ze,t as Qe}from"./useNavigate-D3GIoxyW.js";import{t as $e}from"./check-DmQzfrws.js";import{t as et}from"./copy-BaUCUMp2.js";import{n as tt,t as nt}from"./eye-B-ipuYEd.js";import{o as rt,r as it}from"./deliveryRecorder-C7NQZrrH.js";import{t as at}from"./x-CK8d5DC1.js";import{a as L,i as R,n as z,r as B,t as V}from"./select-qM3ZfTHx.js";import{i as H,n as U,r as ot,t as st}from"./tabs-mZfLmn2f.js";import{t as W}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{t as G}from"./badge-C4po8DQ1.js";import{a as ct,n as K}from"./format-DGKgJf2p.js";import{a as lt,n as ut,o as dt,r as ft,t as pt}from"./dialog-BfrsWZiD.js";import{c as mt,o as ht,s as gt,u as _t}from"./searchSchemas-CS2ZgsHC.js";import{t as vt}from"./appHost-CH3EGcJw.js";import{n as yt}from"./TimeRangePicker-D3PJq1H8.js";import{t as bt}from"./FilterBar-DTVwlDpF.js";import{t as xt}from"./AdvancedFilter-Bb66m5kb.js";import{t as St}from"./DataTableShell-DRFFBx_j.js";var Ct=d(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=e=>e===null?`-`:String(Math.round(e));function 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`?a():n===`agent`?`${Ne()} - ${r}`:e}function Tt(){let e=N(I.me.getMe,{host:vt})?.role===`admin`,t=N(I.deliveryTiming.getDeliveryStatus,{}),n=P(I.deliveryTiming.startDeliveryRecord),r=P(I.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,J.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:ye()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:C()})]}),e?(0,J.jsx)(W,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?T():Ve()}):null]}),c?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(G,{variant:`secondary`,children:v()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:M({time:ct(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?j():b()})}),i?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=N(I.deliveryTiming.listDeliverySessions,{}),n=P(I.deliveryTiming.deleteDeliverySessions),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(`all`),[c,l]=(0,q.useState)(Y),[d,f]=(0,q.useState)(null),{from:m,to:g}=yt(c),_=c.to===`now`?1/0:g,v=r.trim()!==``||a!==`all`||c!==Y,y=()=>{i(``),o(`all`),l(Y)},b=(0,q.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(a===`all`||(a===`active`?t.active:!t.active))&&t.startedAt>=m&&t.startedAt<=_).map(e=>({...e,_id:e.sessionId}))},[t,r,a,m,_]),x=e=>{let t=new Set((b??[]).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,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(bt,{q:r,onQChange:i,searchPlaceholder:Xe(),timeRange:c,onTimeRangeChange:l,onReset:y,canReset:v,children:(0,J.jsxs)(V,{value:a,onValueChange:e=>o(e),children:[(0,J.jsx)(R,{size:`sm`,className:`w-36`,children:(0,J.jsx)(L,{})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:`all`,children:de()}),(0,J.jsx)(B,{value:`active`,children:E()}),(0,J.jsx)(B,{value:`stopped`,children:S()})]})]})}),(0,J.jsx)(St,{title:s(),rows:b,emptyHint:Ue(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(W,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?u():D(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,J.jsx)(tt,{size:15,"aria-hidden":!0}):(0,J.jsx)(nt,{size:15,"aria-hidden":!0})})},{header:h(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:K(e.startedAt)})},{header:O(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,J.jsx)(`span`,{className:`tabular-nums`,children:K(e.stoppedAt)})},{header:oe(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:ie(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:je(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(G,{variant:`secondary`,children:E()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:S()})}],rowActions:e?e=>[{label:p(),variant:`destructive`,onSelect:()=>x([e.sessionId])}]:void 0,bulkActions:e?[{label:p(),variant:`destructive`,onSelect:e=>x(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,J.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=N(I.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(it(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:k()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:A()});let r=e.segments,i=(e,t)=>(0,J.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,J.jsx)(`td`,{className:`py-1`,children:e}),(0,J.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,J.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,Le()]}),(0,J.jsxs)(W,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)($e,{size:13,"aria-hidden":!0}):(0,J.jsx)(et,{size:13,"aria-hidden":!0}),t?we():Pe()]})]}),(0,J.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,J.jsx)(`th`,{className:`py-1 font-medium`,children:Ke()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:xe()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Oe()})]})}),(0,J.jsxs)(`tbody`,{children:[i(F(),r.bridge),i(Fe(),r.A),i(Re(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:De()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Ge()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Te()})]})}var kt=[50,100,200,500],Z=`all`,Q=`__all__`,At=[`2xx`,`4xx`,`5xx`],jt=[`user`,`service`,`system`],Mt=[`inbound`,`outbound`,`internal`],Nt={kind:`relative`,from:`now-30d`,to:`now`},Pt=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:Be()},{value:`principalType`,label:w()},{value:`direction`,label:`direction`},{value:`roleKey`,label:_()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=Ze({from:`/settings/traces`}),t=Qe({from:`/settings/traces`}),n=e.limit,a=e.kind,s=e.statusClass??Q,c=e.principalType??Q,u=e.direction??Q,d=e.roleKey??Q,p=e.q??``,h=e.correlationId,_=ht(e.from,e.to),v=(0,q.useMemo)(()=>_t(e.adv),[e.adv]),{from:b,to:S}=yt(_),[C,w]=(0,q.useState)(null),[T,E]=(0,q.useState)(null),ie=e=>void t({search:t=>({...t,limit:e})}),oe=e=>void t({search:t=>({...t,kind:e})}),D=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),O=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),de=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),fe=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),A=e=>void t({search:t=>({...t,...mt(e)})}),j=e=>void t({search:t=>({...t,adv:gt(e)}),replace:!0}),M=N(I.observability.listEvents,{limit:n}),P=N(I.observability.listEvents,{limit:n,kind:a===Z?void 0:a,...h?{correlationId:h}:{},filter:{q:p||void 0,from:b,to:S,statusClass:s===Q?void 0:s,principalType:c===Q?void 0:c,direction:u===Q?void 0:u,roleKey:d===Q?void 0:d,advanced:v.length>0?v:void 0}}),ye=(0,q.useMemo)(()=>{let e=new Set;for(let t of M??[])e.add(t.kind);return[...e].sort()},[M]),xe=(0,q.useMemo)(()=>{let e=new Set;for(let t of M??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[M]),we=p!==``||s!==Q||c!==Q||u!==Q||d!==Q||v.length>0||_.kind!==`relative`||_.from!==Nt.from;function Te(){t({search:{limit:100,kind:`all`},replace:!0})}let De=C?M?.filter(e=>e.correlationId===C):P,Oe=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)(st,{value:Oe,onValueChange:e=>F(e),children:[(0,J.jsxs)(ot,{className:`w-full`,children:[(0,J.jsxs)(H,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(rt,{size:13,"aria-hidden":!0}),Ce()]}),(0,J.jsxs)(H,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),Je()]})]}),(0,J.jsx)(U,{value:`latency`,children:(0,J.jsx)(Tt,{})}),(0,J.jsxs)(U,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[Se(),(0,J.jsx)(`strong`,{children:ke()}),He(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:Ie()})]}),(0,J.jsxs)(bt,{q:p,onQChange:D,searchPlaceholder:We(),timeRange:_,onTimeRangeChange:A,onReset:Te,canReset:we,children:[(0,J.jsxs)(V,{value:s,onValueChange:O,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:Ee()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:r()}),At.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:c,onValueChange:de,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:le()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:be()}),jt.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:u,onValueChange:fe,children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(L,{placeholder:_e()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:ve()}),Mt.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:d,onValueChange:k,children:[(0,J.jsx)(R,{size:`sm`,className:`w-36`,children:(0,J.jsx)(L,{placeholder:ee()})}),(0,J.jsxs)(z,{children:[(0,J.jsx)(B,{value:Q,children:ze()}),xe.map(e=>(0,J.jsx)(B,{value:e,children:e},e))]})]}),(0,J.jsx)(`input`,{list:`oc-trace-kinds`,className:`oc-input oc-input--sm w-44`,value:a===Z?``:a,placeholder:te(),"aria-label":te(),onChange:e=>{let t=e.target.value.trim();oe(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:ye.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(V,{value:String(n),onValueChange:e=>ie(Number(e)),children:[(0,J.jsx)(R,{size:`sm`,className:`w-28`,children:(0,J.jsx)(L,{})}),(0,J.jsx)(z,{children:kt.map(e=>(0,J.jsx)(B,{value:String(e),children:g({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:v,onChange:j}),C?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>w(null),title:ge(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[me(),(0,J.jsx)(`code`,{children:$(C)})]}),(0,J.jsx)(at,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:y()})]})}):null,(0,J.jsx)(St,{title:he(),rows:De,emptyHint:C?o():Ye(),columns:[{header:ue(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:K(e.at)})},{header:ne(),sort:e=>e.kind,cell:e=>(0,J.jsx)(G,{variant:`secondary`,children:e.kind})},{header:x(),sort:e=>Lt(e)??null,cell:e=>{let t=Lt(e);return t?(0,J.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,J.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":m(),children:`✓`})}},{header:ce(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(G,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ae(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(G,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:re(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(G,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Ae(),sort:e=>e.route,cell:e=>e.route?(0,J.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,J.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:i(),sort:e=>e.status,cell:e=>e.status===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsx)(`span`,{className:`oc-traces__status ${It(e.status)}`,children:e.status})},{header:Me(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:se(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:l(),onClick:()=>w(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:f(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>E(e),children:pe()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:T,onClose:()=>E(null)})]})]})}function It(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 Lt(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 Rt({row:e,onClose:t}){let n=(0,q.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,J.jsx)(pt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(ut,{className:`max-w-lg`,children:[(0,J.jsxs)(lt,{children:[(0,J.jsxs)(dt,{className:`oc-traces__meta-title`,children:[qe(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(G,{variant:`outline`,children:c()})]}),(0,J.jsx)(ft,{children:fe()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{Ft as TracesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AE as r,CE as i,DE as a,E as o,EE as s,HX as c,IE as l,LE as u,ME as d,NE as f,OE as p,SE as m,TE as h,XX as g,YX as _,_E as v,bE as y,jE as b,kE as x,t as S,vE as C,wE as w,xE as T,xj as E,yE as D}from"./api-DSJJn0d7.js";import{t as O}from"./use_paginated_query-CQj09xXv.js";import{t as k}from"./trash-2-B4WSfc7G.js";import{t as A}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{r as j}from"./toast-xNFwDnUy.js";import{n as M}from"./format-DGKgJf2p.js";import{n as N}from"./ConfirmDialog-BXcki0Ee.js";import{r as P}from"./fileMetaView-Ci5C4w9Q.js";import{r as F}from"./trashView-Ct0Xw-a9.js";import{n as I,t as L}from"./trashPage-WtAhGCt7.js";var R=o(`scan-search`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]),z=t(e(),1);function B(e,t){let n=e.find(e=>e.status===`running`&&!e.stale)??null,r=e.find(e=>e.mode===`dryRun`&&e.status===`done`)??null,i=e.find(e=>e.mode===`apply`&&(e.status===`done`||e.status===`refused`)&&(r===null||e.startedAt>r.startedAt))??null,a=null;return n===null?r===null||i!==null?a=`no_report`:r.applicableUntil===null||r.applicableUntil<=t?a=`expired`:r.mirrorMissing>0?a=`mirror`:r.orphans.count===0&&(a=`nothing`):a=`running`,{running:n,report:r,lastApply:i,applyBlock:a}}var V=n();function H(){let e=g(S.blobSweep.listBlobSweeps,{}),t=g(S.blobQuarantine.quarantineSettings,{}),n=_(S.blobSweep.startBlobSweep),o=N(),{toast:l}=j(),[u,O]=(0,z.useState)(!1),F=c(),I=e=>P(e,F),L=B(e??[],Date.now()),H=L.report,U=async e=>{O(!0);try{await e()}catch(e){l({title:v(),description:e.message,variant:`error`})}finally{O(!1)}},W=()=>U(()=>n({mode:`dryRun`})),G=async()=>{H!==null&&await o({title:T({count:H.orphans.count}),description:y({size:I(H.orphans.bytes)}),confirmLabel:m(),destructive:!0})&&await U(()=>n({mode:`apply`,confirms:H._id}))};return(0,V.jsxs)(`section`,{className:`oc-trash__body`,"aria-labelledby":`oc-blobsweep-title`,children:[(0,V.jsxs)(`div`,{className:`oc-trash__head`,children:[(0,V.jsx)(`h3`,{id:`oc-blobsweep-title`,className:`oc-trash__heading`,children:f()}),(0,V.jsxs)(`div`,{className:`oc-trash__actions`,children:[(0,V.jsxs)(A,{variant:`outline`,size:`sm`,disabled:u||L.running!==null,onClick:()=>void W(),children:[(0,V.jsx)(R,{}),` `,b()]}),(0,V.jsxs)(A,{variant:`ghost`,size:`sm`,className:`text-destructive`,disabled:u||L.applyBlock!==null,onClick:()=>void G(),children:[(0,V.jsx)(k,{}),` `,m()]})]})]}),(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:d({days:H?.minAgeDays??7,quarantine:t?.days??7})}),e===void 0?(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:E()}):null,L.running===null?null:(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:r({scanned:L.running.blobsScanned})}),e!==void 0&&H===null&&L.running===null?(0,V.jsx)(`p`,{className:`oc-trash__empty`,children:x()}):null,H===null?null:(0,V.jsxs)(`div`,{className:`oc-trash__hint`,children:[(0,V.jsx)(`p`,{children:p({date:M(H.finishedAt??H.startedAt),count:H.orphans.count,size:I(H.orphans.bytes),scanned:H.blobsScanned})}),(0,V.jsxs)(`ul`,{children:[(0,V.jsx)(`li`,{children:a({count:H.byOrigin.upload?.count??0,size:I(H.byOrigin.upload?.bytes??0)})}),(0,V.jsx)(`li`,{children:s({count:H.byOrigin.unregistered?.count??0,size:I(H.byOrigin.unregistered?.bytes??0)})})]}),H.importing>0?(0,V.jsx)(`p`,{children:h({count:H.importing})}):null,H.mirrorMissing>0?(0,V.jsx)(`p`,{className:`text-destructive`,children:w({count:H.mirrorMissing})}):null,L.applyBlock===`expired`?(0,V.jsx)(`p`,{children:i()}):null]}),L.lastApply===null?null:(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:L.lastApply.status===`refused`?C({date:M(L.lastApply.finishedAt??L.lastApply.startedAt)}):D({date:M(L.lastApply.finishedAt??L.lastApply.startedAt),count:L.lastApply.deleted.count,size:I(L.lastApply.deleted.bytes)})})]})}function U(){let{results:e,status:t,loadMore:n}=O(S.trash.adminListTrash,{},{initialNumItems:50}),r=F(),i=_(S.trash.adminRestoreChat),a=_(S.trash.adminPurgeChat);return(0,V.jsxs)(`div`,{className:`oc-trash__body`,children:[(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:u({days:r})}),t===`LoadingFirstPage`?(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:E()}):e.length===0?(0,V.jsx)(`p`,{className:`oc-trash__empty`,children:l()}):(0,V.jsx)(L,{items:e,onRestore:e=>i({chatId:e}),onPurge:e=>a({chatId:e})}),(0,V.jsx)(I,{status:t,loadMore:n}),(0,V.jsx)(H,{})]})}export{U as TrashTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$I as r,AI as i,BA as a,BI as o,FA as s,FI as c,GI as l,HA as u,HI as d,IA as f,II as p,JI as m,KI as ee,LA as h,LI as te,MA as g,MI as ne,NA as _,NI as re,PA as v,PI as ie,QI as ae,Qb as y,RA as b,RI as oe,UA as x,UI as se,VA as S,VI as ce,WI as le,XI as ue,XX as C,Xb as w,YI as de,YX as T,ZI as fe,Zb as E,eL as pe,jA as D,jI as me,kI as he,nL as O,qI as ge,rL as k,t as A,tL as j,uI as _e,zA as M,zI as ve}from"./api-DSJJn0d7.js";import{n as ye,t as be}from"./useNavigate-D3GIoxyW.js";import{c as N,i as P,n as F,r as xe,t as Se}from"./dropdown-menu-DHMOOlaP.js";import{t as I}from"./checkbox-CsI4ggnp.js";import{t as L}from"./server-DLnWqkX-.js";import{t as R}from"./star-CM6J2w_J.js";import{a as z,i as B,n as V,r as H,t as U}from"./select-qM3ZfTHx.js";import{t as W}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{r as G}from"./toast-xNFwDnUy.js";import{t as K}from"./badge-C4po8DQ1.js";import{a as Ce,n as we,o as Te,r as Ee,t as De}from"./dialog-BfrsWZiD.js";import{t as Oe}from"./appHost-CH3EGcJw.js";import{n as ke,r as Ae}from"./ConfirmDialog-BXcki0Ee.js";import{a as q}from"./groupManageView-BMBqgRhV.js";import{a as je,o as J,t as Y}from"./AdminSettings-B8n1yLsD.js";import{t as Me}from"./FilterBar-DTVwlDpF.js";import{t as Ne}from"./DataTableShell-DRFFBx_j.js";import{t as Pe}from"./DetailChips-Cv1sxdhU.js";var X=t(e(),1),Z=n();function Fe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=C(A.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=C(A.agents.listUserAgents,n&&e?{profileId:e}:`skip`),s=new Set((o??[]).map(e=>`${e.instanceName}/${e.agentId}`)),c=(o??[]).find(e=>e.isDefault)??null,l=c?`${c.instanceName}/${c.agentId}`:null,d=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),p=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).filter(e=>!d.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],m=new Map;for(let e of p){let t=m.get(e.instanceName)??[];t.push(e),m.set(e.instanceName,t)}return(0,Z.jsx)(De,{open:n,onOpenChange:r,children:(0,Z.jsxs)(we,{className:`oc-access`,children:[(0,Z.jsxs)(Ce,{children:[(0,Z.jsx)(Te,{children:x({user:t})}),(0,Z.jsx)(Ee,{children:u()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?S():a()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:M()}):p.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:f()}):[...m.entries()].map(([t,n])=>(0,Z.jsx)(Ie,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:s,defaultKey:l},t))})]})})}function Ie({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=T(A.agents.assignAgent),c=T(A.agents.removeAgent),l=T(A.agents.setDefaultAgent),u=G();if(!e)return null;async function d(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(b(),q(e))}}async function f(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(h(),q(e))}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(L,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,c=e.state===`deleted`,l=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${l?` is-disabled`:``}`,children:[(0,Z.jsx)(I,{checked:r,disabled:(c||l)&&!r,onCheckedChange:()=>void d(e.agentId,r),"aria-label":s({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,c?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:v()}):null,e.outOfPool?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:_()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":g(),title:g(),children:(0,Z.jsx)(R,{size:14,fill:`currentColor`})}):(0,Z.jsx)(W,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":D(),title:D(),disabled:l,onClick:()=>void f(e.agentId),children:(0,Z.jsx)(R,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return w();case`user`:return E();case`admin`:return y();default:return e}}function Le({granted:e,onToggle:t}){let n=new Set(e),r=Y.filter(e=>n.has(J[e])).length;return(0,Z.jsxs)(Se,{children:[(0,Z.jsx)(N,{asChild:!0,children:(0,Z.jsx)(W,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?k():O({count:r})})}),(0,Z.jsxs)(F,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(P,{children:j()}),Y.map(e=>{let r=J[e];return(0,Z.jsxs)(xe,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(I,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:je[e]()})]},e)})]})]})}function Re(){let e=ye({from:`/settings/users`}),t=be({from:`/settings/users`}),n=e.q??``,a=e.role??Q,s=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),u=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),f=C(A.admin.listUsers,{filter:{q:n||void 0,role:a===Q?void 0:a},withAgents:!0}),h=C(A.me.getMe,{host:Oe}),g=T(A.admin.setRole),_=T(A.admin.setUserPermissions),v=T(A.admin.startImpersonation),y=T(A.admin.deleteUser),b=T(A.admin.setUserName),x=ke(),S=Ae(),w=G(),[E,D]=(0,X.useState)(null),O=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of f??[])e.add(t.role);return[...e]},[f]),k=n!==``||a!==Q;function j(){t({search:{},replace:!0})}async function M(e){try{await g(e)}catch(e){w.error(pe(),e)}}async function N(e){try{await _(e)}catch(e){w.error(r(),e)}}async function P(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await x({title:ee(),description:l({user:t}),confirmWord:le(),confirmLabel:se(),destructive:!0}))try{await y({profileId:e._id}),w.success(ce({user:t}))}catch(e){w.error(d(),e)}}async function F(e){let t=e.email||e.name||e.userId.slice(0,8),n=await S({title:ve(),label:oe({user:t}),placeholder:te(),defaultValue:e.name??``,confirmLabel:_e()});if(n!==null)try{await b({profileId:e._id,name:n}),w.success(p())}catch(e){w.error(c(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Me,{q:n,onQChange:s,searchPlaceholder:ae(),onReset:j,canReset:k,children:(0,Z.jsxs)(U,{value:a,onValueChange:u,children:[(0,Z.jsx)(B,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:Q,children:fe()}),O.map(e=>(0,Z.jsx)(H,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Ne,{title:ue(),rows:f,emptyHint:de(),rowActions:e=>{let t=[{label:he(),onSelect:()=>D({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:o(),onSelect:()=>void F(e)}];return e.userId!==h?.userId&&t.push({label:m(),onSelect:()=>void v({profileId:e._id})},{label:ge(),variant:`destructive`,onSelect:()=>void P(e)}),t},columns:[{header:ie(),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)(U,{value:e.role,onValueChange:t=>void M({profileId:e._id,role:t}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(H,{value:`user`,children:$(`user`)}),(0,Z.jsx)(H,{value:`admin`,children:$(`admin`)})]})]})},{header:ne(),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:me()}):(0,Z.jsx)(Le,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),N({profileId:e._id,permissions:[...n]})}})},{header:i(),cell:e=>(0,Z.jsx)(Pe,{icon:(0,Z.jsx)(L,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Fe,{profileId:E?.profileId??null,userLabel:E?.label??``,open:E!==null,onOpenChange:e=>{e||D(null)}})]})}export{Re as UsersTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$l as r,Ac as i,BX as a,Fc as o,Gc as s,Gl as c,HX as ee,Hc as l,Hl as u,Ic as d,Jl as f,Kl as p,Lc as m,M_ as h,Mc as te,Nc as g,P_ as ne,Qc as _,Ql as v,Rc as y,Uc as re,Ul as ie,Vc as ae,Vl as oe,Wc as se,Wl as b,XX as x,Xl as ce,YX as S,Yl as le,Zl as ue,au as C,cu as de,du as w,eu as T,iu as fe,jc as pe,lu as me,nu as he,ou as E,qX as ge,ql as D,ru as O,ry as k,sR as A,su as j,t as M,tu as N,uu as P,vc as F}from"./api-DSJJn0d7.js";import{n as I,t as L}from"./useNavigate-D3GIoxyW.js";import{d as _e,f as ve,i as ye,l as R,n as be,o as z,r as xe,s as B,t as Se,u as Ce}from"./speech-CrNma2Ue.js";import{t as V}from"./checkbox-CsI4ggnp.js";import{a as H,i as U,n as W,r as G,t as K}from"./select-qM3ZfTHx.js";import{i as q,n as J,r as we,t as Te}from"./tabs-mZfLmn2f.js";import{t as Y}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{t as X}from"./badge-C4po8DQ1.js";import{t as Ee}from"./appHost-CH3EGcJw.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>fe()],[`fr-FR`,()=>s()],[`en-US`,()=>se()],[`en-GB`,()=>re()],[`de-DE`,()=>l()],[`es-ES`,()=>ae()]],Oe=[[`0.75`,()=>he()],[`1`,()=>N()],[`1.25`,()=>T()],[`1.5`,()=>r()]],$=0;function ke({instance:e}){let t=S(M.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),[s,c]=(0,Z.useState)(`idle`),[l,u]=(0,Z.useState)(!1),[d,p]=(0,Z.useState)(!1),m=ge(M.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}),c(`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 y(){c(`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}),c(`idle`)}catch{c(`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)(X,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(V,{checked:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":E()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:E()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:g()}),(0,Q.jsxs)(K,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(U,{size:`sm`,"aria-label":g(),children:(0,Q.jsx)(H,{})}),(0,Q.jsxs)(W,{children:[(0,Q.jsx)(G,{value:`browser`,children:te()}),e.kind===`hermes`?null:(0,Q.jsx)(G,{value:`gateway`,children:pe()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:i()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:C()}),(0,Q.jsxs)(K,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(U,{size:`sm`,"aria-label":C(),children:(0,Q.jsx)(H,{})}),(0,Q.jsx)(W,{children:De.map(([e,t])=>(0,Q.jsx)(G,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()}),(0,Q.jsxs)(K,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(U,{size:`sm`,"aria-label":O(),children:(0,Q.jsx)(H,{})}),(0,Q.jsx)(W,{children:Oe.map(([e,t])=>(0,Q.jsx)(G,{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)(V,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":v()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:v()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ue()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(Y,{size:`sm`,disabled:!_||s===`saving`,onClick:()=>void y(),children:s===`saving`?k():ne()}),(0,Q.jsx)(Y,{variant:`outline`,size:`sm`,disabled:!a.enabled||l,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(p(!1),B(),z(),a.engine!==`gateway`){ye(f(),{lang:xe(a.lang,ee()),rate:t});return}u(!0),m({instanceName:e.name,text:f()}).then(({mime:e,audioBase64:r})=>{n===$&&be(r,e,{rate:t})}).catch(()=>{n===$&&p(!0)}).finally(()=>u(!1))},children:l?k():ce()}),(0,Q.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>{$++,u(!1),B(),z()},children:le()})]}),s===`error`||d?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:d?F():h()}):null]})}function Ae({stt:e}){let t=x(M.me.getMe,{host:Ee}),n=S(M.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:p()}),(0,Q.jsx)(X,{variant:e?`secondary`:`outline`,children:e?u():oe()}),(0,Q.jsx)(X,{variant:r?`secondary`:`destructive`,children:r?m():d()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(V,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":y()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:y()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:c()})]})}function je(){let e=x(M.admin.listInstances,{}),t=(0,Z.useMemo)(()=>R(),[]),n=(0,Z.useMemo)(()=>Se(),[]),{section:r}=I({from:`/settings/voice`}),i=L({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:w()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(X,{variant:t?`secondary`:`destructive`,children:t?P():me()}),(0,Q.jsx)(X,{variant:n?`secondary`:`destructive`,children:n?de():j()})]}),(0,Q.jsxs)(Te,{value:r,onValueChange:e=>void i({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(we,{className:`w-full`,children:[(0,Q.jsxs)(q,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ce,{size:13,"aria-hidden":!0}),o()]}),(0,Q.jsxs)(q,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(_e,{size:13,"aria-hidden":!0}),p()]}),(0,Q.jsxs)(q,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),b()]})]}),(0,Q.jsx)(J,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:D()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(J,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(J,{value:`talk`,children:[(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsx)(`header`,{className:`oc-voice__cardhead`,children:(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:b()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ie()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:D()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=S(M.admin.upsertInstanceConfig),n=e.config??{},r=n.talkEnabled===!0,i=e.kind===`hermes`;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)(X,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:_()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(V,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":A()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:A()})]})]})}export{je as VoiceTab};
@@ -1 +0,0 @@
1
- var e=new Set([`knobThinkingLevel`,`knobModel`,`knobFastMode`,`knobUnset`,`agentFiles`,`sessionCompact`,`configDefaults`,`subagents`,`inboundAttachments`,`talk`,`cronList`,`cronManage`,`permissionModes`,`knowledgePolicy`,`inlineWidgets`,`followUpModes`,`discardPendingInput`]),t=new Set([`knobThinkingLevel`,`knobModel`]);function n(n,r){return e.has(r)?n==null?t.has(r):n[r]===!0:!1}function r(e,t){return{model:e(`knobModel`)&&t.hasModels,thinking:e(`knobThinkingLevel`)&&t.hasLevels,speed:e(`knobFastMode`),reset:e(`knobUnset`)}}function i(e,t){return e===void 0?`loading`:e===null?{blocked:!n(null,t),gatewayVersion:null,provider:null}:{blocked:!n(e.capabilities,t),gatewayVersion:e.gatewayVersion,provider:e.provider}}export{i as n,r,n as t};
@@ -1 +0,0 @@
1
- import{E as e}from"./api-DSJJn0d7.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
@@ -1 +0,0 @@
1
- import{E as e}from"./api-DSJJn0d7.js";var t=e(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);export{t};
@@ -1 +0,0 @@
1
- import{E as e}from"./api-DSJJn0d7.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
@@ -1 +0,0 @@
1
- import{E as e}from"./api-DSJJn0d7.js";var t=e(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);export{t};
@@ -1 +0,0 @@
1
- import{E as e}from"./api-DSJJn0d7.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
@@ -1 +0,0 @@
1
- .oc-afiles{flex-direction:column;gap:.75rem;display:flex}.oc-afiles__picker{flex-wrap:wrap;align-items:center;gap:.5rem;display:flex}.oc-afiles__list{border:1px solid var(--border);border-radius:var(--radius);flex-direction:column;display:flex;overflow:hidden}.oc-afiles__row{border-bottom:1px solid var(--border);align-items:center;gap:.75rem;padding:.5rem .75rem;font-size:.85rem;display:flex}.oc-afiles__row:last-child{border-bottom:none}.oc-afiles__name{text-overflow:ellipsis;white-space:nowrap;flex:0 0 10rem;font-weight:500;overflow:hidden}.oc-afiles__size{text-align:right;color:var(--muted-foreground);font-variant-numeric:tabular-nums;flex:0 0 4.5rem}.oc-afiles__gauge{background:var(--muted);border-radius:999px;flex:6rem;height:.375rem;overflow:hidden}.oc-afiles__gauge-fill{border-radius:inherit;background:var(--primary);height:100%;display:block}.oc-afiles__gauge.is-warn .oc-afiles__gauge-fill{background:var(--destructive)}.oc-afiles__pct{text-align:right;color:var(--muted-foreground);font-variant-numeric:tabular-nums;flex:0 0 3rem}.oc-afiles__warn{color:var(--destructive);flex:none}.oc-afiles__warn-slot{flex:none;width:14px}.oc-afiles__open{margin-left:auto}.oc-afiles__budget{color:var(--muted-foreground);font-size:.8rem}.oc-afiles__error,.oc-cdefaults__error{color:var(--destructive);align-items:center;gap:.5rem;font-size:.85rem;display:flex}[data-slot=dialog-content].oc-afiles__editor{flex-direction:column;width:calc(100vw - 2rem);max-width:72rem;height:calc(100vh - 2rem);max-height:none;display:flex}.oc-afiles__source{resize:none;min-height:0;font-family:var(--font-mono,ui-monospace, monospace);border:1px solid var(--border);border-radius:var(--radius);background:var(--background);color:var(--foreground);flex:auto;padding:.75rem;font-size:.8rem;line-height:1.5}.oc-afiles__source:focus-visible{outline:2px solid var(--ring);outline-offset:-1px}.oc-afiles__hint{color:var(--muted-foreground);font-size:.75rem}.oc-afiles__editor-foot{justify-content:space-between;align-items:center;gap:.75rem;display:flex}.oc-afiles__count{color:var(--muted-foreground);font-variant-numeric:tabular-nums;font-size:.8rem}.oc-afiles__count.is-over{color:var(--destructive);font-weight:600}.oc-afiles__diff{flex-direction:column;gap:.5rem;max-height:14rem;display:flex;overflow-y:auto}.oc-afiles__diff-counts{font-size:.85rem;font-weight:500}.oc-afiles__diff-block{flex-direction:column;gap:.125rem;display:flex}.oc-afiles__diff-label{color:var(--muted-foreground);font-size:.75rem}.oc-afiles__diff-line{border-radius:calc(var(--radius) / 2);white-space:pre-wrap;word-break:break-word;padding:.125rem .375rem;font-size:.75rem}.oc-afiles__diff-line.is-add{background:color-mix(in oklab, var(--primary) 12%, transparent)}.oc-afiles__diff-line.is-del{background:color-mix(in oklab, var(--destructive) 12%, transparent);text-decoration:line-through}.oc-cdefaults{flex-direction:column;gap:.75rem;max-width:36rem;display:flex}.oc-cdefaults__row{border-bottom:1px solid var(--border);flex-direction:column;gap:.375rem;padding:.625rem 0;display:flex}.oc-cdefaults__label{font-size:.85rem;font-weight:500}.oc-cdefaults__help,.oc-cdefaults__note{color:var(--muted-foreground);margin:0;font-size:.75rem}.oc-cdefaults__actions{justify-content:flex-end;display:flex}.oc-voice__support{flex-wrap:wrap;gap:.5rem;margin-bottom:1rem;display:flex}.oc-voice__card{border:1px solid var(--border);border-radius:var(--radius);background:var(--card);flex-direction:column;gap:.6rem;margin-bottom:.9rem;padding:.9rem 1rem;display:flex}.oc-voice__cardhead{align-items:center;gap:.6rem;display:flex}.oc-voice__instance{font-weight:600}.oc-voice__row{align-items:center;gap:.75rem;display:flex}.oc-voice__row .oc-cdefaults__label{min-width:10rem}.oc-cronactions{gap:2px;display:inline-flex}.oc-cronactions button{color:var(--muted-foreground);transition:background .14s,color .14s}.oc-cronactions button:hover:not(:disabled){background:color-mix(in srgb, var(--voice) 16%, transparent);color:color-mix(in srgb, var(--voice) 55%, var(--foreground))}.oc-cronactions button:last-child:hover:not(:disabled){background:color-mix(in srgb, var(--destructive) 14%, transparent);color:var(--destructive)}@media (prefers-reduced-motion:reduce){.oc-cronactions button{transition:none}}.oc-cronedit .oc-cronedit__textarea,.oc-cronedit input,.oc-cronedit [data-slot=select-trigger],.oc-tzcombo__trigger,.oc-dtp__trigger{border-color:color-mix(in srgb, var(--voice) 22%, var(--border))}.oc-cronedit input:focus-visible,.oc-cronedit .oc-cronedit__textarea:focus-visible,.oc-tzcombo__search:focus-visible{border-color:color-mix(in srgb, var(--voice) 55%, var(--border));box-shadow:0 0 0 3px color-mix(in srgb, var(--voice) 22%, transparent);outline:none}.oc-tzcombo__trigger{border:1px solid var(--border);background:var(--background);min-width:140px;height:2.25rem;color:var(--foreground);cursor:pointer;border-radius:.6rem;flex:0 200px;justify-content:space-between;align-items:center;gap:.4rem;padding:0 .6rem;font-size:.85rem;display:inline-flex}.oc-tzcombo__value{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.oc-tzcombo__chev{color:var(--muted-foreground);flex:none}.oc-tzcombo__pop{width:min(300px, var(--radix-popover-content-available-width,300px));max-height:min(340px, var(--radix-popover-content-available-height,340px));flex-direction:column;display:flex}.oc-tzcombo__search{flex:none;width:calc(100% - .8rem);margin:.4rem}.oc-tzcombo__list{flex:auto;min-height:0;padding:0 .25rem .35rem;overflow-y:auto}.oc-tzcombo__opt{width:100%;color:var(--foreground);text-align:left;cursor:pointer;background:0 0;border:none;border-radius:.45rem;align-items:center;gap:.4rem;padding:.35rem .45rem;font-size:.82rem;display:flex}.oc-tzcombo__opt:hover,.oc-tzcombo__opt[aria-selected=true]{background:color-mix(in srgb, var(--voice) 14%, transparent)}.oc-tzcombo__check{color:var(--voice);flex:none}.oc-tzcombo__empty{color:var(--muted-foreground);padding:.5rem;font-size:.82rem}.oc-dtp__trigger{border:1px solid var(--border);background:var(--background);width:100%;height:2.25rem;color:var(--foreground);cursor:pointer;border-radius:.6rem;align-items:center;gap:.45rem;padding:0 .7rem;font-size:.85rem;display:inline-flex}.oc-dtp__icon,.oc-dtp__placeholder{color:var(--muted-foreground)}.oc-dtp__pop{width:300px}.oc-dtp__head{justify-content:space-between;align-items:center;margin-bottom:.5rem;display:flex}.oc-dtp__month{text-transform:capitalize;font-size:.85rem;font-weight:600}.oc-dtp__nav{width:26px;height:26px;color:var(--muted-foreground);cursor:pointer;background:0 0;border:none;border-radius:.45rem;justify-content:center;align-items:center;display:inline-flex}.oc-dtp__nav:hover{background:color-mix(in srgb, var(--voice) 14%, transparent);color:var(--foreground)}.oc-dtp__grid{grid-template-columns:repeat(7,1fr);gap:2px;display:grid}.oc-dtp__wd{text-align:center;color:var(--muted-foreground);padding-bottom:.2rem;font-size:.68rem;font-weight:600}.oc-dtp__day{height:2rem;color:var(--foreground);cursor:pointer;background:0 0;border:none;border-radius:.45rem;font-size:.8rem}.oc-dtp__day:hover{background:color-mix(in srgb, var(--voice) 14%, transparent)}.oc-dtp__day--out{color:var(--muted-foreground);opacity:.5}.oc-dtp__day--today{box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--voice) 45%, var(--border))}.oc-dtp__day--sel{background:var(--voice);color:var(--voice-foreground,white);font-weight:600}.oc-dtp__day--sel:hover{background:color-mix(in srgb, var(--voice) 85%, black)}.oc-dtp__time{border-top:1px solid var(--border);align-items:center;gap:.35rem;margin-top:.6rem;padding-top:.6rem;display:flex}.oc-dtp__time [data-slot=select-trigger]{width:4.5rem}.oc-dtp__colon{color:var(--muted-foreground);font-weight:700}.oc-dtp__timeopts{max-height:220px}.oc-sched__viewtoggle{border:1px solid var(--border);border-radius:calc(var(--radius) - 2px);flex:none;gap:2px;padding:2px;display:inline-flex}.oc-cal{flex-direction:column;gap:10px;display:flex}.oc-cal__head{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.oc-cal__nav{align-items:center;gap:2px;display:inline-flex}.oc-cal__title{text-align:center;text-transform:capitalize;flex:1;min-width:0;font-size:.95rem;font-weight:600}.oc-cal__modes{border:1px solid var(--border);border-radius:calc(var(--radius) - 2px);gap:2px;padding:2px;display:inline-flex}.oc-cal__footnote{color:var(--muted-foreground);margin:0;font-size:.75rem}.oc-cal__month{border:1px solid var(--border);border-radius:var(--radius);background:var(--border);grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;display:grid;overflow:hidden}.oc-cal__wd{background:var(--card);text-transform:uppercase;color:var(--muted-foreground);text-align:center;padding:4px 6px;font-size:.68rem;font-weight:600}.oc-cal__day{background:var(--background);flex-direction:column;gap:2px;min-width:0;min-height:84px;padding:4px;display:flex}.oc-cal__day--out{opacity:.45}.oc-cal__day--today .oc-cal__daynum{background:color-mix(in srgb, var(--voice) 80%, var(--foreground));color:var(--background)}.oc-cal__daynum{color:var(--muted-foreground);border-radius:999px;justify-content:center;align-self:flex-start;align-items:center;min-width:18px;height:18px;padding:0 4px;font-size:.72rem;font-weight:600;display:inline-flex}.oc-cal__event{background:color-mix(in srgb, var(--cal-ev,var(--voice)) 12%, transparent);width:100%;min-width:0;color:var(--foreground);cursor:pointer;text-align:left;border:none;border-radius:5px;align-items:center;gap:4px;padding:1px 4px;font-size:.7rem;display:flex}.oc-cal__event:hover{background:color-mix(in srgb, var(--cal-ev,var(--voice)) 22%, transparent)}.oc-cal__event--muted{opacity:.55}.oc-cal__evdot{border:1.5px solid color-mix(in srgb, var(--cal-ev,var(--voice)) 80%, var(--foreground));background:0 0;border-radius:999px;flex:none;width:6px;height:6px}.oc-cal__event--exact .oc-cal__evdot{background:color-mix(in srgb, var(--cal-ev,var(--voice)) 80%, var(--foreground))}.oc-cal__evtime{font-variant-numeric:tabular-nums;color:var(--muted-foreground);flex:none}.oc-cal__evtitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.oc-cal__more{color:var(--muted-foreground);padding-left:4px;font-size:.68rem}.oc-cal__year{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;display:grid}.oc-cal__mini{border:1px solid var(--border);border-radius:var(--radius);background:var(--card);cursor:pointer;text-align:left;flex-direction:column;gap:6px;padding:8px;transition:border-color .14s,background .14s;display:flex}.oc-cal__mini:hover{border-color:color-mix(in srgb, var(--voice) 35%, var(--border));background:color-mix(in srgb, var(--voice) 6%, var(--card))}@media (prefers-reduced-motion:reduce){.oc-cal__mini{transition:none}}.oc-cal__mininame{text-transform:capitalize;color:var(--foreground);font-size:.78rem;font-weight:600}.oc-cal__minigrid{grid-template-columns:repeat(7,1fr);gap:3px;display:grid}.oc-cal__minidot{background:color-mix(in srgb, var(--muted-foreground) 18%, transparent);border-radius:999px;justify-self:center;width:7px;height:7px}.oc-cal__minidot.is-out{background:0 0}.oc-cal__minidot.has-one{background:color-mix(in srgb, var(--voice) 55%, transparent)}.oc-cal__minidot.has-many{background:color-mix(in srgb, var(--voice) 90%, var(--foreground))}.oc-cal__minidot.is-today{outline:1.5px solid color-mix(in srgb, var(--voice) 80%, var(--foreground));outline-offset:1px}
@@ -1 +0,0 @@
1
- import"./api-DSJJn0d7.js";
@@ -1 +0,0 @@
1
- import{$S as e,BS as t,GS as n,HS as ee,IS as r,JS as i,KS as a,LS as o,Ms as s,QS as c,Qa as l,RS as u,SC as d,US as f,VS as p,WS as m,XS as h,YS as g,ZS as _,Za as v,_C as y,aC as b,bC as x,cC as S,co as C,dC as w,do as T,eC as E,eo as te,fC as D,fo as O,gC as k,hC as A,iC as j,io as M,js as N,lC as P,lo as F,mC as I,mo as L,nC as R,oC as z,pC as B,po as V,qS as H,rC as U,ro as W,sC as G,so as K,tC as q,to as J,uC as Y,uo as X,vC as Z,xC as Q,yC as ne,zS as re}from"./api-DSJJn0d7.js";var $={AGENT_NOT_FOUND:()=>({label:d(),hint:Q()}),AUTH_TOKEN_MISMATCH:()=>({label:x(),hint:ne()}),DEVICE_SIGNING_FAILED:()=>({label:Z(),hint:y()}),SESSION_SCOPE_DENIED:()=>({label:k(),hint:A()}),GATEWAY_TIMEOUT:()=>({label:I(),hint:B()}),GATEWAY_DISCONNECTED:()=>({label:D(),hint:w()}),GATEWAY_RESTARTING:()=>({label:Y(),hint:P()}),CONNECTION_SATURATED:()=>({label:S(),hint:G()}),DISPATCH_STALLED:()=>({label:s(),hint:N()}),ATTACHMENT_TOO_LARGE:()=>({label:j(),hint:U()}),ATTACHMENT_REJECTED:()=>({label:R(),hint:q()}),BRIDGE_UNREACHABLE:()=>({label:z(),hint:b()}),INVALID_REQUEST:()=>({label:E(),hint:e()}),chat_request_conflict:()=>({label:c(),hint:_()}),NOT_CONFIGURED:()=>({label:h(),hint:g()}),UNROUTED:()=>({label:i(),hint:H()}),message_too_large:()=>({label:l(),hint:v()}),gateway_media_unavailable:()=>({label:X(),hint:F()}),subagent_reply_pending:()=>({label:J(),hint:te()}),attachment_name_too_long:()=>({label:M(),hint:W()}),attachment_path_refused:()=>({label:L(),hint:V()}),attachment_staging_failed:()=>({label:O(),hint:T()}),attachment_cleanup_unconfirmed:()=>({label:C(),hint:K()}),provider_auth_revoked:e=>({label:m(),hint:f({agentId:e.agentId??`<agentId>`,provider:e.provider??`<provider>`})}),provider_permission_denied:e=>({label:ee(),hint:p({agentId:e.agentId??`<agentId>`,provider:e.provider??`<provider>`})}),provider_auth_failed:e=>({label:t(),hint:re({agentId:e.agentId??`<agentId>`,provider:e.provider??`<provider>`})}),UPSTREAM_ERROR:()=>({label:a(),hint:n()}),UNKNOWN:()=>({label:u(),hint:o()})};function ie(e,t={}){return e?$[e]?.(t)??{label:e,hint:r()}:$.UNKNOWN(t)}export{ie as t};