@camstack/addon-admin-ui 1.2.438 → 1.2.440

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 (136) hide show
  1. package/dist/assets/{AddonAssetIcon-n8Qr5_Kp.js → AddonAssetIcon-DoCqXzAv.js} +1 -1
  2. package/dist/assets/Addons-CrSVEbe3.js +4 -0
  3. package/dist/assets/{AdminPage-D2JwPYR7.js → AdminPage-KGO_m_yt.js} +1 -1
  4. package/dist/assets/{AdminSectionedPage-5tMwz6Be.js → AdminSectionedPage-BiMhPKOP.js} +1 -1
  5. package/dist/assets/AiProfiles-D8mKo1K9.js +3 -0
  6. package/dist/assets/{BrokerForm-Dbt1v9HX.js → BrokerForm-yx58WRgh.js} +1 -1
  7. package/dist/assets/{Build-Bv-SRt3z.js → Build-BArewEF3.js} +5 -5
  8. package/dist/assets/{Calendars-CPdNc3AH.js → Calendars-BdN8ZQmv.js} +1 -1
  9. package/dist/assets/{Cluster-iOH_2qVx.js → Cluster-Bn5YZafT.js} +1 -1
  10. package/dist/assets/{ClusterStepModel-vvtitbie.js → ClusterStepModel-DPmlzTfm.js} +1 -1
  11. package/dist/assets/CompositionEditor-BhL25d6e.js +1 -0
  12. package/dist/assets/CompositionEditorPage-BwqVkeY-.js +1 -0
  13. package/dist/assets/Data-BvY-zVHv.js +2 -0
  14. package/dist/assets/DeviceDetail-g2esa6u-.js +2 -0
  15. package/dist/assets/{DeviceDoActionFields-CBs8E-hd.js → DeviceDoActionFields-C6f9gioM.js} +1 -1
  16. package/dist/assets/Devices-CtivG8K9.js +1 -0
  17. package/dist/assets/{EmbedPlayerPage-OppPi2oS.js → EmbedPlayerPage-BD-Z7zz-.js} +1 -1
  18. package/dist/assets/Identity-BQNP0wku.js +1 -0
  19. package/dist/assets/IntegrationDetail-CzEG-I4B.js +1 -0
  20. package/dist/assets/IntegrationHub-tqxee2Rm.js +1 -0
  21. package/dist/assets/Integrations-C7Ptcn3c.js +1 -0
  22. package/dist/assets/Integrations-GZm_SrQK.js +1 -0
  23. package/dist/assets/Library-ToUHY4O3.js +1 -0
  24. package/dist/assets/Locations-CPFCvUKd.js +3 -0
  25. package/dist/assets/{Logs-BppneNXQ.js → Logs-Ds6SPC6o.js} +1 -1
  26. package/dist/assets/{MaskShapeCanvas-Bwqusno0.js → MaskShapeCanvas-BoY32Qvt.js} +1 -1
  27. package/dist/assets/{MotionZonesSettings-CZbGV_dv.js → MotionZonesSettings-DBW4jTEr.js} +1 -1
  28. package/dist/assets/{MyAccess-7TTQLj-6.js → MyAccess-2mSUBp14.js} +1 -1
  29. package/dist/assets/{Network-D4qKoubf.js → Network-BddKO6B1.js} +1 -1
  30. package/dist/assets/{NodeAddonsSettingsPanel-DOLEqwOJ.js → NodeAddonsSettingsPanel-CIISQuIL.js} +1 -1
  31. package/dist/assets/Notifications-DWJcnXvV.js +1 -0
  32. package/dist/assets/{PrivacyMaskSettings-CTKUYU5o.js → PrivacyMaskSettings-z8P3R0fA.js} +1 -1
  33. package/dist/assets/Recordings-g1Jxg_Lr.js +1 -0
  34. package/dist/assets/{ScanNetworkModal-O2KH9u3g.js → ScanNetworkModal-D7N2aC7y.js} +1 -1
  35. package/dist/assets/{SceneMonitorEditor-CG4pADlP.js → SceneMonitorEditor-CyjEekEM.js} +1 -1
  36. package/dist/assets/SessionsList-bmTxxIOE.js +2 -0
  37. package/dist/assets/{Showroom-BXD3terh.js → Showroom-PlFtcQrL.js} +1 -1
  38. package/dist/assets/{System-CHwXBdVd.js → System-DxszqVYV.js} +1 -1
  39. package/dist/assets/{Terminal-D2WVII9y.js → Terminal-BMG2w8DZ.js} +3 -3
  40. package/dist/assets/{Viewer-BdY4QQPs.js → Viewer-CRLD_tt7.js} +1 -1
  41. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-D8hkm2kB.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-GapjKGVe.js} +1 -1
  42. package/dist/assets/{addon-icons-context-Drfj1y7k.js → addon-icons-context-BrgGsfoE.js} +1 -1
  43. package/dist/assets/{archive-Bcg0gLgY.js → archive-Dx-auPAN.js} +1 -1
  44. package/dist/assets/{authed-media-CFsHrcXx.js → authed-media-MhMmWNH3.js} +1 -1
  45. package/dist/assets/{bell-off-BnByNJjy.js → bell-off-BQQTURVF.js} +1 -1
  46. package/dist/assets/{board-model-D8m2YmcS.js → board-model-Bdetmchn.js} +1 -1
  47. package/dist/assets/{boxes-V2c7jrxe.js → boxes-BIK98bHo.js} +1 -1
  48. package/dist/assets/circle-slash-DKE4hxbW.js +1 -0
  49. package/dist/assets/client-Cy6wyTLQ.js +358 -0
  50. package/dist/assets/{cloud-upload-aziKggfg.js → cloud-upload-FvK6xW2I.js} +1 -1
  51. package/dist/assets/crop-7vsE3Qcd.js +1 -0
  52. package/dist/assets/{device-integration-icon-Bd49r785.js → device-integration-icon-ClmWzwM_.js} +1 -1
  53. package/dist/assets/device-picker-model-DVvq9nYp.js +1 -0
  54. package/dist/assets/dist-BPMeH1J4.js +358 -0
  55. package/dist/assets/dist-CEnfZ10I.js +1 -0
  56. package/dist/assets/{eraser-CsYhDDbY.js → eraser-CUAqtnBD.js} +1 -1
  57. package/dist/assets/{hard-drive-download-CWqd_JKb.js → hard-drive-download-XGtks2vE.js} +1 -1
  58. package/dist/assets/{history-DOf9zSG-.js → history-DqvhlzWX.js} +1 -1
  59. package/dist/assets/{hostInit-C_3liyhx.js → hostInit-DzBGXsvZ.js} +1 -1
  60. package/dist/assets/i18n-B1bxeya5.js +1 -0
  61. package/dist/assets/{icons-BrAHwVJD.js → icons-DNRi-jSy.js} +1 -1
  62. package/dist/assets/index-CN7xsFJi.css +2 -0
  63. package/dist/assets/index-yoPG03d0.js +4 -0
  64. package/dist/assets/{key-D0VHbthb.js → key-bw9xhRgT.js} +1 -1
  65. package/dist/assets/{key-round-CasJ848Z.js → key-round-BngMS2dZ.js} +1 -1
  66. package/dist/assets/{layers-CFb4zoU6.js → layers-CIl8QXpN.js} +1 -1
  67. package/dist/assets/{linked-devices-model-B7EZaQcp.js → linked-devices-model-CclOXMLj.js} +1 -1
  68. package/dist/assets/{list-ordered-B14sQnH2.js → list-ordered-_52_xrQ7.js} +1 -1
  69. package/dist/assets/location-owned-usage-5eb6nny3.js +1 -0
  70. package/dist/assets/{log-in-UZRiT8Rq.js → log-in-DH9Lu6bJ.js} +1 -1
  71. package/dist/assets/{memory-stick-l6hXPEuG.js → memory-stick-CzaP6KiN.js} +1 -1
  72. package/dist/assets/{message-square-plus-C3grB9GT.js → message-square-plus-vMywres_.js} +1 -1
  73. package/dist/assets/{mf-entry-bootstrap-0-aa799d5d.js → mf-entry-bootstrap-0-54468006.js} +2 -2
  74. package/dist/assets/{mic-off-wol-RBiS.js → mic-off-Da09u2hl.js} +1 -1
  75. package/dist/assets/{monitor-off-BUehkWHc.js → monitor-off-jOOWdiSg.js} +1 -1
  76. package/dist/assets/{monitor-smartphone-CCDiXDn-.js → monitor-smartphone-D_W4zyWO.js} +1 -1
  77. package/dist/assets/mount-DVvq9nYp.js +1 -0
  78. package/dist/assets/notification-schedule-field-LytDFkpQ.js +1 -0
  79. package/dist/assets/{player-overlays-Db_o1Zm2.js → player-overlays-CCZE3o8q.js} +1 -1
  80. package/dist/assets/{recycle-BVxTT0po.js → recycle-BVcCaHVd.js} +1 -1
  81. package/dist/assets/remoteEntry-BOaeaEWk.js +1 -0
  82. package/dist/assets/{scan-eye-C5EKCLMY.js → scan-eye-CHwWv39K.js} +1 -1
  83. package/dist/assets/{scissors-DjP6Unuk.js → scissors-BrUBwnKn.js} +1 -1
  84. package/dist/assets/{search-x-gjRI7PKB.js → search-x-BcR2pidC.js} +1 -1
  85. package/dist/assets/{send-CV6GWVOX.js → send-8R5TbxHN.js} +1 -1
  86. package/dist/assets/{settings-2--KyzHb5N.js → settings-2-C4PaSGfb.js} +1 -1
  87. package/dist/assets/{speaker-CnmwOCLp.js → speaker-CBRM7GNH.js} +1 -1
  88. package/dist/assets/src-Cw4W7OtK.js +67 -0
  89. package/dist/assets/{timer-reset-nORqwwje.js → timer-reset-DlfKkTg_.js} +1 -1
  90. package/dist/assets/{ungroup-BQTGGbbf.js → ungroup-BzlNECzG.js} +1 -1
  91. package/dist/assets/{unlink-669jprEf.js → unlink-HIuzqEig.js} +1 -1
  92. package/dist/assets/{usb-BT4hzhxS.js → usb-DqboQtO8.js} +1 -1
  93. package/dist/assets/{use-scenes-feed-CAUwbJgh.js → use-scenes-feed-Cnl4Is6T.js} +1 -1
  94. package/dist/assets/{use-stationary-objects-CwdwiqSu.js → use-stationary-objects-DmFWTPK0.js} +1 -1
  95. package/dist/assets/useEventInvalidation-DVvq9nYp.js +1 -0
  96. package/dist/assets/{useNodeUrlSelection-2GpIyOt_.js → useNodeUrlSelection-CSh6gqLc.js} +1 -1
  97. package/dist/assets/user-round-C4K7vDWN.js +1 -0
  98. package/dist/assets/{user-x-Drhirj9Y.js → user-x-ciro8k7Z.js} +1 -1
  99. package/dist/assets/{video-Dzs93Xor.js → video-BJUj4GaK.js} +1 -1
  100. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-CVZRr77d.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-CwjeQPZx.js} +2 -2
  101. package/dist/index.html +11 -11
  102. package/dist/server/addon.js +324 -37
  103. package/package.json +1 -1
  104. package/dist/assets/Addons-Dtpom4zF.js +0 -4
  105. package/dist/assets/AiProfiles-CrkwNINl.js +0 -3
  106. package/dist/assets/CompositionEditor-BP-AGI3Y.js +0 -1
  107. package/dist/assets/CompositionEditorPage-BRatBKGt.js +0 -1
  108. package/dist/assets/Data-Bk8YwGJK.js +0 -2
  109. package/dist/assets/DeviceDetail-BtiSYWZr.js +0 -2
  110. package/dist/assets/Devices-Bgd8Iyo4.js +0 -1
  111. package/dist/assets/Identity-BlDv0gjH.js +0 -1
  112. package/dist/assets/IntegrationDetail-CLiGGiDO.js +0 -1
  113. package/dist/assets/IntegrationHub-elusTiRh.js +0 -1
  114. package/dist/assets/Integrations-BX33zgRF.js +0 -1
  115. package/dist/assets/Integrations-DlLfaKrk.js +0 -1
  116. package/dist/assets/Library-CGx2d-jp.js +0 -1
  117. package/dist/assets/Locations-CFU7VvDI.js +0 -3
  118. package/dist/assets/Notifications--kvb7ubW.js +0 -1
  119. package/dist/assets/Recordings-C3Ikd7pB.js +0 -1
  120. package/dist/assets/SessionsList-DCXslvk3.js +0 -2
  121. package/dist/assets/circle-slash-B_FzZotu.js +0 -1
  122. package/dist/assets/client-CUuI767h.js +0 -358
  123. package/dist/assets/crop-DzZyuK_f.js +0 -1
  124. package/dist/assets/device-picker-model-BQdOI8yn.js +0 -1
  125. package/dist/assets/dist-DsAwO6-i.js +0 -358
  126. package/dist/assets/dist-t-gGaOd0.js +0 -1
  127. package/dist/assets/i18n-RHwbGLC0.js +0 -1
  128. package/dist/assets/index-DrWxDgY9.js +0 -4
  129. package/dist/assets/index-M0Q7O5pF.css +0 -2
  130. package/dist/assets/location-owned-usage-CEUpeKPu.js +0 -1
  131. package/dist/assets/mount-BQdOI8yn.js +0 -1
  132. package/dist/assets/notification-schedule-field-3QjzRWF0.js +0 -1
  133. package/dist/assets/remoteEntry-CavKhY-Z.js +0 -1
  134. package/dist/assets/src-BpDNu6in.js +0 -67
  135. package/dist/assets/useEventInvalidation-BQdOI8yn.js +0 -1
  136. package/dist/assets/user-round-NWWWc7PC.js +0 -1
@@ -1 +0,0 @@
1
- import{$ as e,B as t,G as n,J as r,L as i,S as a,b as o,o as s,x as c}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEHpkaJP.js";import{Ei as l,Fr as u,It as d,Jr as f,Nt as p,Wr as m,Y as h,dt as g,ea as _,or as v,ot as y,si as b,xr as x}from"./player-overlays-Db_o1Zm2.js";import{Oi as S}from"./client-CUuI767h.js";import{n as C,t as w}from"./scissors-DjP6Unuk.js";import{$c as T,An as E,Fc as D,Gs as O,Ic as k,Kc as A,Kt as j,Lc as M,Mc as N,Mn as P,Nc as ee,Nn as F,On as te,Pc as ne,Pn as re,Qc as ie,Rc as ae,Un as oe,Vn as I,Wc as se,Wn as L,Xc as ce,Yc as le,Yn as ue,Ys as de,Zc as fe,_r as pe,al as me,br as he,bs as ge,el as _e,er as R,fs as ve,il as ye,kn as be,ms as xe,nl as Se,ol as Ce,qc as z,qt as we,rl as Te,tl as Ee,va as B,vs as De,vu as Oe,xu as V,zc as ke}from"./src-BpDNu6in.js";import{t as H}from"./i18n-RHwbGLC0.js";import{t as U}from"./useTranslation-D3Is_4B6.js";import{A as Ae,X as je,w as Me}from"./index-DrWxDgY9.js";import{t as Ne}from"./AdminSectionedPage-5tMwz6Be.js";import{n as Pe}from"./authed-media-CFsHrcXx.js";import{t as W}from"./format-size-DIxKXxtj.js";import{c as Fe,i as Ie,l as Le,n as Re,o as ze,r as Be,s as Ve,t as He,u as Ue}from"./location-owned-usage-CEUpeKPu.js";e();var We=[{value:`all`,labelKey:`common.all`},{value:`recording`,labelKey:`recordings.activitySection.domainRecordings`},{value:`events`,labelKey:`common.events`}],Ge={recording:`bg-primary/10 text-primary`,events:`bg-violet-500/10 text-violet-400`},Ke={columnKey:`at`,dir:`desc`};function qe(e){return new Date(e).toLocaleString()}function Je(){let{t:e,i18n:t}=U(),[i,s]=r(`all`),{data:l,isLoading:u,isError:d}=ne({},{refetchOnWindowFocus:!1}),{data:f,isLoading:m,isError:h}=De({},{refetchOnWindowFocus:!1}),{data:g}=B({isCamera:!0,projection:`slim`}),y=n(()=>{let e=new Map;for(let t of g??[])e.set(t.id,t.name);return e},[g]),b=n(()=>{let e=[...l??[],...f??[]];return(i===`all`?e:e.filter(e=>e.domain===i)).toSorted((e,t)=>t.at-e.at)},[l,f,i]),x=n(()=>{let t=[];return d&&i!==`events`&&t.push(e(`recordings.activitySection.domainRecordings`)),h&&i!==`recording`&&t.push(e(`common.events`)),t},[d,h,i,e]),S=n(()=>new Intl.ListFormat(t.language,{type:`conjunction`}).format(x),[x,t.language]),C=n(()=>[{key:`at`,header:e(`recordings.activitySection.when`,`When`),nowrap:!0,sortValue:e=>e.at,render:e=>c(`span`,{className:`text-foreground-subtle tabular-nums`,children:qe(e.at)})},{key:`domain`,header:e(`recordings.activitySection.domain`,`Domain`),sortValue:e=>e.domain,render:e=>c(`span`,{className:`inline-flex rounded px-1.5 py-0.5 text-[10px] font-medium ${Ge[e.domain]}`,children:e.domain})},{key:`op`,header:e(`recordings.activitySection.operation`,`Operation`),sortValue:e=>e.op,render:e=>c(`span`,{className:`text-foreground`,children:e.op})},{key:`reason`,header:e(`recordings.activitySection.reason`,`Reason`),sortValue:e=>e.reason,render:e=>c(`span`,{className:`text-foreground-subtle`,children:e.reason})},{key:`device`,header:e(`recordings.activitySection.camera`,`Camera`),sortValue:e=>e.deviceId===null?`cluster`:y.get(e.deviceId)??`#${String(e.deviceId)}`,render:t=>t.deviceId===null?c(`span`,{className:`text-foreground-subtle`,children:e(`common.cluster`)}):c(`span`,{className:`text-foreground`,children:y.get(t.deviceId)??`#${String(t.deviceId)}`})},{key:`items`,header:e(`recordings.activitySection.items`,`Items`),align:`right`,nowrap:!0,sortValue:e=>e.itemsAffected,render:e=>c(`span`,{className:`tabular-nums`,children:e.itemsAffected.toLocaleString()})},{key:`bytes`,header:e(`recordings.activitySection.reclaimed`,`Reclaimed`),align:`right`,nowrap:!0,sortValue:e=>e.bytesReclaimed,render:e=>c(`span`,{className:`tabular-nums`,children:e.bytesReclaimed>0?W(e.bytesReclaimed):`—`})}],[y,e]),w=u||m;return a(`div`,{className:`flex flex-col gap-4`,children:[c(`div`,{className:`flex items-center gap-1`,children:We.map(t=>c(`button`,{onClick:()=>s(t.value),className:`rounded px-2 py-1 text-xs font-medium ${i===t.value?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-muted`}`,children:e(t.labelKey)},t.value))}),w&&b.length===0?a(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[c(v,{className:`h-4 w-4 animate-spin`}),e(`recordings.activitySection.loadingActivity`,`Loading activity…`)]}):b.length===0?x.length>0?c(I,{icon:p,title:e(`recordings.activitySection.activityCouldNotBeRead`,`Activity could not be read`),description:e(`recordings.activitySection.theOpsLogDidNot`,`The {{value1}} ops log did not answer. This is not "nothing happened" — retry, or check the node that owns it.`,{value1:S})}):c(I,{icon:_,title:e(`recordings.activitySection.noActivityYet`,`No activity yet`),description:e(`recordings.activitySection.pruneDeleteAndRescanOperations`,`Prune, delete and rescan operations across recordings and events show up here.`)}):a(o,{children:[x.length>0&&a(`p`,{className:`flex items-center gap-1.5 text-[11px] text-amber-500`,children:[c(p,{className:`h-3 w-3 shrink-0`}),e(`recordings.activitySection.domainsMissing`,{count:x.length,names:S})]}),c(j,{columns:C,rows:b,rowKey:e=>e.id,minWidthPx:720,maxBodyHeight:we,defaultSort:Ke})]})]})}e();function Ye(){let{t:e}=U(),t=B({isCamera:!0,projection:`slim`}),i=n(()=>(t.data??[]).toSorted((e,t)=>e.name.localeCompare(t.name)),[t.data]),[o,s]=r(null),u=o??i[0]?.id??null;return!t.isLoading&&i.length===0?c(I,{icon:l,title:e(`recordings.cameraRecordingSettingsSection.noCameras`,`No cameras`),description:e(`recordings.cameraRecordingSettingsSection.addACameraFirst`,`Add a camera first.`)}):a(`div`,{className:`space-y-3`,children:[a(`div`,{children:[c(`h2`,{className:`text-sm font-semibold text-foreground`,children:e(`recordings.cameraRecordingSettingsSection.perCameraRecordingRetention`,`Per-camera recording & retention`)}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:e(`recordings.cameraRecordingSettingsSection.recordingModeScheduleBandsAnd`,`Recording mode, schedule bands and the retention policy for one camera — the same controls as the camera's own Recording tab. Retention is one policy over footage and analytics; per-camera event deletion lives on the Events tab.`)})]}),a(`div`,{className:`flex items-center gap-2`,children:[c(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:e(`recordings.cameraRecordingSettingsSection.camera`,`Camera`)}),c(`select`,{value:u??``,onChange:e=>s(Number(e.target.value)),className:`rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:i.map(e=>c(`option`,{value:e.id,children:e.name},e.id))})]}),u!==null&&c(ue,{deviceId:u,children:c(Ae,{deviceId:u,sectionFilter:e=>e.location===`top-tab`&&e.tab===`recording`})},u)]})}e();function Xe({types:e}){let{t}=U(),i=s(),o=R(),{data:l}=z({}),u=A(),d=n(()=>u.data??[],[u.data]),{data:f}=ee({},{refetchOnWindowFocus:!1}),p=n(()=>He(l??[],f?.locations),[l,f?.locations]),[m,h]=r(null),[g,_]=r(null),v=()=>{i.invalidateQueries({queryKey:[[`storage`,`listLocations`]]})},y=Ce({onSuccess:v}),b=se({onSuccess:v}),x=n(()=>{let e=new Map;for(let t of l??[]){let n=e.get(t.type);n?n.push(t):e.set(t.type,[t])}return e},[l]),S=async(e,n)=>{Le(n)&&!await o({title:t(`pipeline.storageLocationsPanel.disable`,`Disable "{{displayName}}"?`,{displayName:e.displayName}),message:t(`pipeline.storageLocationsPanel.nothingIsDeletedSetThe`,`{{consequence}} Nothing is deleted — set the location back to Read-only or Active to bring its footage back.`,{consequence:Fe(n).consequence}),confirmLabel:t(`common.disable`,`Disable`),variant:`danger`})||y.mutate(Ve(e,{mode:n}))},C=async e=>{if(await o({title:t(`pipeline.storageLocationsPanel.deleteLocation`,`Delete location "{{displayName}}"?`,{displayName:e.displayName}),message:t(`pipeline.storageLocationsPanel.removesTheRecordFilesOn`,`Removes the record; files on disk are untouched.`),confirmLabel:t(`common.delete`,`Delete`),variant:`danger`}))try{await b.mutateAsync({id:e.id})}catch(n){await o({title:t(`pipeline.storageLocationsPanel.deleteAnyway`,`Delete anyway?`),message:t(`pipeline.storageLocationsPanel.forcingNote`,{error:n instanceof Error?n.message:String(n)}),confirmLabel:t(`pipeline.storageLocationsPanel.forceDelete`,`Force delete`),variant:`danger`})&&b.mutate({id:e.id,force:!0})}},w=e.map(e=>d.find(t=>t.id===e)).filter(e=>e!==void 0);return a(`div`,{className:`space-y-3`,children:[w.length===0?c(`p`,{className:`text-[11px] text-foreground-subtle italic`,children:t(`pipeline.storageLocationsPanel.noStorageLocationsDeclaredFor`,`No storage locations declared for this purpose.`)}):w.map(e=>c(Re,{type:e.id,displayName:e.displayName,description:e.description,cardinality:e.cardinality,locations:x.get(e.id)??[],onAdd:e=>h(e),onEdit:e=>_(e),onDelete:e=>{C(e)},ownedBytesById:p,onSetMode:(e,t)=>{S(e,t)}},e.id)),m!==null&&c(Ue,{initialType:m,onClose:()=>h(null),onCreated:()=>{v(),h(null)}}),g!==null&&c(ze,{location:g,onClose:()=>_(null),onSaved:()=>{v(),_(null)}})]})}e();var Ze=`pipeline-analytics`;function Qe(e){for(let t of e?.sections??[])for(let e of t.fields??[])if(e.key===`postProcessingNodeId`&&typeof e.value==`string`)return e.value;return`hub`}function $e(){let{t:e}=U(),t=s(),{nodes:r}=Oe(),{data:i,isLoading:o}=pe({addonId:Ze}),l=Qe(i),u=he({onSuccess:()=>{t.invalidateQueries({queryKey:[[`addonSettings`,`getGlobalSettings`]]})}}),d=n(()=>{let e=r.filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,l,...e])].filter(Boolean)},[r,l]);return a(`div`,{className:`flex flex-col gap-6`,children:[a(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[c(`h3`,{className:`text-sm font-semibold text-foreground`,children:e(`pipeline.clusterEventsTab.postProcessingNode`,`Post-processing node`)}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:e(`pipeline.clusterEventsTab.theSingleNodeThatRuns`,`The single node that runs detection post-processing (events, media, audio & motion). Every other node stays inert — no multi-node balancing. Takes effect on addon restart.`)}),a(`div`,{className:`mt-3 flex items-center gap-2`,children:[o?c(v,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):c(`select`,{value:l,onChange:e=>{e.target.value!==l&&u.mutate({addonId:Ze,patch:{postProcessingNodeId:e.target.value}})},disabled:u.isPending,className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:d.map(t=>c(`option`,{value:t,children:t===`hub`?e(`pipeline.clusterEventsTab.hubDefault`,`hub (default)`):t},t))}),u.isPending&&c(v,{className:`h-4 w-4 animate-spin text-primary`})]})]}),a(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[c(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:e(`pipeline.clusterEventsTab.eventsFolder`,`Events folder`)}),c(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:e(`pipeline.clusterEventsTab.whereEventCropsFullFrames`,`Where event crops / full frames are stored. A single folder — no collection / equal-splitting.`)}),c(Xe,{types:[`eventMedia`]})]})]})}e();var et=[[`pipelineAnalytics`]],tt=1440*60*1e3;function G(e,t){return t.get(e)??H.t(`recordings.eventsManagementSection.removedCamera`,{id:String(e)})}var nt=[{days:1},{days:7},{days:30},{days:90}];function rt(){let{t:e}=U(),t=s(),o=R(),[l,u]=r(30),[p,m]=r(null),{data:g,isLoading:_}=xe({},{refetchOnWindowFocus:!1}),{data:y}=B({isCamera:!0,projection:`slim`}),b=n(()=>{let e=new Map;for(let t of y??[])e.set(t.id,t.name);return e},[y]),x=i(()=>{t.invalidateQueries({queryKey:et})},[t]),S=ge({onSuccess:x}),C=ve(),T=i(async()=>{await o({title:e(`recordings.eventsManagementSection.pruneTitle`,{count:l}),message:e(`recordings.eventsManagementSection.permanentlyDeletesEveryEventMotion`,`Permanently deletes every event (motion / object / audio) older than the cutoff across all cameras, and their media. This cannot be undone.`),confirmLabel:e(`recordings.eventsManagementSection.pruneEvents`,`Prune events`),variant:`danger`})&&S.mutate({olderThanMs:Date.now()-l*tt,reason:`retention`})},[o,S,l,e]),E=i(async t=>{let n=G(t.deviceId,b);if(await o({title:e(`recordings.eventsManagementSection.deleteAllEventsFor`,`Delete all events for {{label}}?`,{label:n}),message:e(`recordings.eventsManagementSection.deleteRowsMessage`,{count:t.rows,size:W(t.bytes)}),confirmLabel:e(`recordings.eventsManagementSection.deleteEvents`,`Delete events`),variant:`danger`})){m(null);try{let e=await C.mutateAsync({deviceId:t.deviceId});x();let r=e.motion+e.object+e.audio;if(r===0&&t.bytes>0){m(`0 events deleted for ${n}. Media still listed (${W(t.bytes)}) — those blobs are not event rows; use Management → Count leftovers or Disk reconcile.`);return}m(`Deleted ${String(r)} event${r===1?``:`s`} for ${n}.`)}catch(e){m(e instanceof Error?e.message:String(e))}}},[o,C,b,x,e]),D=n(()=>[{key:`camera`,header:e(`recordings.eventsManagementSection.camera`,`Camera`),render:e=>c(`span`,{className:`text-foreground`,children:G(e.deviceId,b)})},{key:`rows`,header:e(`recordings.eventsManagementSection.events`,`Events`),align:`right`,nowrap:!0,render:e=>c(`span`,{className:`tabular-nums`,children:e.rows.toLocaleString()})},{key:`bytes`,header:e(`recordings.eventsManagementSection.media`,`Media`),align:`right`,nowrap:!0,render:e=>c(`span`,{className:`tabular-nums`,children:W(e.bytes)})},{key:`actions`,header:``,align:`right`,render:t=>a(`button`,{onClick:()=>{E(t)},disabled:C.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10 disabled:opacity-50`,title:e(`recordings.eventsManagementSection.deleteAllEventsForThis`,`Delete all events for this camera`),children:[c(d,{className:`h-3 w-3`}),e(`common.delete`,`Delete`)]})}],[b,E,C.isPending,e]);return _&&!g?a(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[c(v,{className:`h-4 w-4 animate-spin`}),e(`recordings.eventsManagementSection.loadingEventStoreFootprint`,`Loading event-store footprint…`)]}):g?a(`div`,{className:`flex flex-col gap-6`,children:[a(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[c(h,{label:e(`recordings.eventsManagementSection.totalEvents`,`Total events`),icon:c(f,{className:`h-3 w-3`}),footer:`across ${String(g.devices.length)} camera${g.devices.length===1?``:`s`}`,children:g.totalRows.toLocaleString()}),c(h,{label:e(`recordings.eventsManagementSection.eventMediaOnDisk`,`Event media on disk`),children:W(g.totalBytes)})]}),a(`section`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[c(`span`,{className:`text-foreground-subtle`,children:e(`recordings.eventsManagementSection.pruneEventsOlderThan`,`Prune events older than`)}),c(`select`,{value:l,onChange:e=>u(Number(e.target.value)),className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:nt.map(t=>c(`option`,{value:t.days,children:e(`recordings.eventsManagementSection.ageDays`,{count:t.days})},t.days))}),a(`button`,{onClick:()=>{T()},disabled:S.isPending,className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs font-medium text-foreground-subtle hover:bg-warning/10 hover:text-warning disabled:opacity-50`,children:[S.isPending?c(v,{className:`h-3 w-3 animate-spin`}):c(w,{className:`h-3 w-3`}),e(`recordings.eventsManagementSection.pruneNow`,`Prune now`)]})]}),g.devices.length===0?c(I,{icon:f,title:e(`recordings.eventsManagementSection.noStoredEvents`,`No stored events`),description:e(`recordings.eventsManagementSection.noCameraHasPersistedEvents`,`No camera has persisted events yet.`)}):c(j,{columns:D,rows:[...g.devices],rowKey:e=>e.deviceId,minWidthPx:480}),p===null?null:c(`p`,{className:p.startsWith(`Deleted `)?`text-[11px] text-foreground-subtle`:`text-[11px] text-destructive`,children:p})]}):c(I,{icon:f,title:e(`recordings.eventsManagementSection.noEventData`,`No event data`),description:e(`recordings.eventsManagementSection.pipelineAnalyticsHasNotReported`,`Pipeline analytics has not reported any event-store footprint yet.`)})}function it(){let{t:e}=U();return a(`div`,{className:`flex flex-col gap-8`,children:[a(`div`,{children:[c(`h2`,{className:`text-sm font-semibold text-foreground`,children:e(`recordings.eventsSection.eventStore`,`Event store`)}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:e(`recordings.eventsSection.whatTheDurableEventStore`,`What the durable event store occupies, per camera, with fleet-wide prune-by-age and delete-all-events.`)}),c(`div`,{className:`mt-3`,children:c(rt,{})})]}),a(`div`,{children:[c(`h2`,{className:`text-sm font-semibold text-foreground`,children:e(`recordings.eventsSection.postProcessingNodeFolders`,`Post-processing node & folders`)}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:e(`recordings.eventsSection.theSingleNodeThatWrites`,`The single node that writes event crops, and the storage location they land in.`)}),c(`div`,{className:`mt-3`,children:c($e,{})})]})]})}function at(e){let t=[];return e.timelapse?t.push(`timelapse ${String(e.timelapse.everyMs/1e3)}s`):(t.push(`${String(e.speed??1)}×`),e.includeAudio&&t.push(`+ audio`)),t.join(` `)}function ot(e){return new Date(e).toLocaleString(void 0,{day:`2-digit`,month:`short`,hour:`2-digit`,minute:`2-digit`})}function st(e,t){let n=Math.max(0,Math.round((t-e)/1e3)),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=r>0?`${String(r)}:${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`:`${String(i)}:${String(a).padStart(2,`0`)}`;return`${ot(e)} · ${o}`}function ct(e,t){let n=e-t;if(n<=0)return H.t(`helpers.exportFormat.expired`);let r=Math.floor(n/6e4);if(r<60)return H.t(`helpers.exportFormat.inMinutes`,{n:String(r)});let i=Math.floor(r/60);return i<24?H.t(`helpers.exportFormat.inHours`,{n:String(i)}):H.t(`helpers.exportFormat.inDays`,{n:String(Math.floor(i/24))})}function lt(e,t,n,r){return e.map(e=>{if(e.state===`expired`||e.state===`deleted`)return e;let i=r.get(e.id);if(i)return{...e,state:`failed`,error:i.error,progressPct:null};let a=n.get(e.id);if(a)return{...e,state:`ready`,fileBytes:a.fileBytes,progressPct:100};let o=t.get(e.id);return o&&(e.state===`queued`||e.state===`rendering`)?{...e,state:`rendering`,progressPct:o.progressPct}:e})}e();var ut=[`high`,`mid`,`low`],dt=[{value:1,labelKey:`recordings.newExportModal.speedRealTime`},{value:2,labelKey:null},{value:4,labelKey:null},{value:8,labelKey:null},{value:16,labelKey:null}],ft=10080*60*1e3;function K(e){let t=new Date(Date.now()-e*6e4),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function pt({onClose:e,onCreated:t}){let{t:i}=U(),o=B({isCamera:!0,projection:`slim`}),s=n(()=>(o.data??[]).toSorted((e,t)=>e.name.localeCompare(t.name)),[o.data]),[l,d]=r(``),[f,p]=r(`high`),[m,h]=r(K(60)),[g,_]=r(K(0)),[v,y]=r(1),[b,x]=r(!0),[S,C]=r(``),[w,T]=r(null),D=l===``?s[0]?.id??null:l,O=new Date(m).getTime(),k=new Date(g).getTime(),A=Number.isFinite(O)&&Number.isFinite(k)&&O<k,j=M({onSuccess:()=>{t(),e()},onError:e=>T(e instanceof Error?e.message:String(e))});return c(te,{open:!0,onOpenChange:t=>!t&&e(),children:a(E,{width:`md`,placement:`sheet-on-mobile`,scroll:`body`,children:[c(F,{children:a(re,{className:`flex items-center gap-1.5`,children:[c(u,{className:`h-3.5 w-3.5`}),i(`recordings.newExportModal.newExport`,`New export`)]})}),a(be,{className:`space-y-3`,children:[a(`div`,{className:`grid grid-cols-2 gap-3`,children:[a(`div`,{className:`space-y-1`,children:[c(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:i(`recordings.newExportModal.camera`,`Camera`)}),c(`select`,{value:D??``,onChange:e=>d(Number(e.target.value)),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:s.map(e=>c(`option`,{value:e.id,children:e.name},e.id))})]}),a(`div`,{className:`space-y-1`,children:[c(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:i(`recordings.newExportModal.profile`,`Profile`)}),c(`select`,{value:f,onChange:e=>p(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:ut.map(e=>c(`option`,{value:e,children:e},e))})]})]}),a(`div`,{className:`grid grid-cols-2 gap-3`,children:[a(`div`,{className:`space-y-1`,children:[c(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:i(`recordings.newExportModal.from`,`From`)}),c(`input`,{type:`datetime-local`,value:m,onChange:e=>h(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`})]}),a(`div`,{className:`space-y-1`,children:[c(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:i(`recordings.newExportModal.to`,`To`)}),c(`input`,{type:`datetime-local`,value:g,onChange:e=>_(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`})]})]}),a(`div`,{className:`grid grid-cols-2 gap-3`,children:[a(`div`,{className:`space-y-1`,children:[c(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:i(`recordings.newExportModal.speed`,`Speed`)}),c(`select`,{value:v,onChange:e=>y(Number(e.target.value)),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:dt.map(e=>c(`option`,{value:e.value,children:e.labelKey===null?`${e.value}×`:i(e.labelKey)},e.value))})]}),a(`div`,{className:`space-y-1`,children:[c(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:i(`recordings.newExportModal.titleOptional`,`Title (optional)`)}),c(`input`,{type:`text`,value:S,onChange:e=>C(e.target.value),placeholder:i(`recordings.newExportModal.eGCourierAtThe`,`e.g. courier at the gate`),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle`})]})]}),a(`label`,{className:`flex items-center gap-2 text-xs text-foreground cursor-pointer`,children:[c(`input`,{type:`checkbox`,checked:b,disabled:v!==1,onChange:e=>x(e.target.checked),className:`accent-primary`}),i(v===1?`recordings.newExportModal.includeAudio`:`recordings.newExportModal.includeAudioRealtimeOnly`)]}),!A&&c(`p`,{className:`text-[11px] text-danger`,children:i(`recordings.newExportModal.fromMustBeBeforeTo`,`"From" must be before "To".`)}),w&&c(`p`,{className:`text-[11px] text-danger`,children:w})]}),a(P,{children:[c(oe,{variant:`outline`,size:`sm`,onClick:e,children:i(`common.cancel`,`Cancel`)}),c(oe,{size:`sm`,onClick:()=>{if(D===null||!A)return;T(null);let e=S.trim();j.mutate({deviceId:D,profile:f,fromMs:O,toMs:k,options:{includeAudio:b,maxLifeMs:ft,deleteAfterDownload:!1,...v===1?{}:{speed:v},...e.length>0?{title:e}:{}}})},disabled:D===null||!A||j.isPending,children:j.isPending?i(`recordings.newExportModal.queuing`,`Queuing…`):i(`recordings.newExportModal.createExport`,`Create export`)})]})]})})}e();var mt=[[`recordingExport`]],ht={queued:{cls:`bg-muted text-foreground-subtle`,labelKey:`recordings.exportsSection.queued`},rendering:{cls:`bg-primary/10 text-primary`,labelKey:`recordings.exportsSection.rendering`,spin:!0},ready:{cls:`bg-success/10 text-success`,labelKey:`recordings.exportsSection.ready`},failed:{cls:`bg-danger/10 text-danger`,labelKey:`recordings.exportsSection.failed`},expired:{cls:`bg-muted text-foreground-subtle`,labelKey:`recordings.exportsSection.expired`},deleted:{cls:`bg-muted text-foreground-subtle`,labelKey:`recordings.exportsSection.deleted`}};function gt(){let{data:e,isLoading:t}=ke({},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data??[]).some(e=>e.state===`queued`||e.state===`rendering`)?3e3:!1}),{map:r}=V(S.RecordingExportProgress,e=>e.exportId),{map:i}=V(S.RecordingExportCompleted,e=>e.exportId),{map:a}=V(S.RecordingExportFailed,e=>e.exportId);return{rows:n(()=>lt(e??[],r,i,a),[e,r,i,a]),isLoading:t}}function _t(e){let[n,i]=r(()=>Date.now());return t(()=>{let t=setInterval(()=>i(Date.now()),e);return()=>clearInterval(t)},[e]),n}function vt(){let{t:e}=U(),t=s(),[o,l]=r(!1),f=()=>{t.invalidateQueries({queryKey:[[`recordingExport`,`listExports`]]})},p=R(),h=y().trpcClient,g=_t(6e4),{rows:_,isLoading:x}=gt(),{data:S}=B({isCamera:!0,projection:`slim`}),C=n(()=>{let e=new Map;for(let t of S??[])e.set(t.id,t.name);return e},[S]),w=i(()=>{t.invalidateQueries({queryKey:mt})},[t]),T=k({onSuccess:w}),E=ae({onSuccess:w}),[D,O]=r(null),A=i(async e=>{O(e.id);try{let{url:t}=await h.recordingExport.getDownloadUrl.query({exportId:e.id}),n=await Pe(t),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${e.options.title??e.id}.mp4`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r),w()}finally{O(null)}},[h,w]),M=i(async t=>{await p({title:e(`recordings.exportsSection.cancelThisExport`,`Cancel this export?`),message:e(`recordings.exportsSection.stopsTheRenderThePartial`,`Stops the render. The partial file is discarded.`),confirmLabel:e(`recordings.exportsSection.cancelExport`,`Cancel export`),variant:`danger`})&&T.mutate({exportId:t.id})},[p,T,e]),N=i(async t=>{await p({title:e(`recordings.exportsSection.deleteThisExport`,`Delete this export?`),message:e(`recordings.exportsSection.permanentlyRemovesTheRenderedFile`,`Permanently removes the rendered file and its history row.`),confirmLabel:e(`common.delete`,`Delete`),variant:`danger`})&&E.mutate({exportId:t.id})},[p,E,e]),P=n(()=>[{key:`camera`,header:e(`recordings.exportsSection.camera`,`Camera`),render:e=>c(`span`,{className:`text-foreground`,children:C.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`range`,header:e(`recordings.exportsSection.range`,`Range`),nowrap:!0,render:e=>c(`span`,{className:`tabular-nums`,children:st(e.fromMs,e.toMs)})},{key:`variant`,header:e(`recordings.exportsSection.variant`,`Variant`),render:e=>c(`span`,{className:`text-foreground-subtle`,children:at(e.options)})},{key:`state`,header:e(`recordings.exportsSection.state`,`State`),render:t=>{let n=ht[t.state];return a(`span`,{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium ${n.cls}`,children:[n.spin&&c(v,{className:`h-2.5 w-2.5 animate-spin`}),e(n.labelKey),t.state===`rendering`&&t.progressPct!==null&&a(`span`,{className:`tabular-nums`,children:[t.progressPct,`%`]})]})}},{key:`expiry`,header:e(`recordings.exportsSection.expires`,`Expires`),nowrap:!0,render:e=>e.state===`deleted`?c(`span`,{className:`text-foreground-subtle`,children:`—`}):c(`span`,{className:`text-foreground-subtle tabular-nums`,children:ct(e.expiresAt,g)})},{key:`size`,header:e(`recordings.exportsSection.size`,`Size`),align:`right`,nowrap:!0,render:e=>c(`span`,{className:`tabular-nums`,children:e.fileBytes===null?`—`:W(e.fileBytes)})},{key:`actions`,header:``,align:`right`,render:t=>{let n=t.state===`ready`,r=t.state===`queued`||t.state===`rendering`,i=t.state!==`deleted`;return a(`div`,{className:`flex items-center justify-end gap-1`,children:[n&&a(`button`,{onClick:()=>{A(t)},disabled:D===t.id,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-primary/10 hover:text-foreground disabled:opacity-50`,title:e(`recordings.exportsSection.downloadMp4`,`Download MP4`),children:[D===t.id?c(v,{className:`h-3 w-3 animate-spin`}):c(m,{className:`h-3 w-3`}),e(`recordings.exportsSection.download`,`Download`)]}),r&&a(`button`,{onClick:()=>{M(t)},disabled:T.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-amber-500/10 hover:text-amber-500 disabled:opacity-50`,title:e(`recordings.exportsSection.cancelRender`,`Cancel render`),children:[c(b,{className:`h-3 w-3`}),e(`common.cancel`,`Cancel`)]}),i&&c(`button`,{onClick:()=>{N(t)},disabled:E.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10 disabled:opacity-50`,title:e(`recordings.exportsSection.deleteExport`,`Delete export`),children:c(d,{className:`h-3 w-3`})})]})}}],[C,g,D,T.isPending,E.isPending,A,M,N,e]);return x&&_.length===0?a(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[c(v,{className:`h-4 w-4 animate-spin`}),e(`recordings.exportsSection.loadingExports`,`Loading exports…`)]}):a(`div`,{className:`space-y-3`,children:[c(`div`,{className:`flex justify-end`,children:a(`button`,{onClick:()=>l(!0),className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground`,children:[c(u,{className:`h-3.5 w-3.5`}),e(`recordings.exportsSection.newExport`,`New export`)]})}),_.length===0?c(I,{icon:u,title:e(`recordings.exportsSection.noExportsYet`,`No exports yet`),description:e(`recordings.exportsSection.createOneHereNewExport`,`Create one here (New export) or from a camera's timeline in the viewer. Rendered clips show up here to download or manage.`)}):c(j,{columns:P,rows:_,rowKey:e=>e.id,minWidthPx:720}),o&&c(pt,{onClose:()=>l(!1),onCreated:f})]})}var yt=`inline-flex w-fit items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[11px] font-medium border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`;e();var bt=`storage-migration`,xt=new Set([`orphans`,`debug-media`,`ghost-ledger`]);function St(e){return[`${e.orphansReclaimed} orphan rows (${W(e.orphanBytesReclaimed)})`,e.includeDebugMedia?`${e.debugMediaReclaimed} debug files (${W(e.debugMediaBytesReclaimed)})`:null,`${e.ghostsForgotten} ghost rows (${W(e.ghostBytesForgotten)})`].filter(e=>e!==null).join(` · `)}function Ct(){let{t:e}=U(),t=L(bt);return t===`pending`?null:t===`unknown`?c(`p`,{className:`py-2 text-xs text-foreground-subtle`,children:e(`recordings.cleanupSection.couldNotCheckWhetherStorage`,`Could not check whether storage cleanup is installed on this hub.`)}):t===`present`?c(wt,{}):null}function wt(){let{t:e}=U(),t=R(),[n,i]=r(!1),[o,s]=r(null),l=ie({},{refetchInterval:2e3}),u=l.data??null,f=u!==null&&xt.has(u.phase),p=fe(),m=ce(),h=async()=>{if(await t({title:e(`recordings.cleanupSection.runStorageCleanup`,`Run storage cleanup?`),message:n?e(`recordings.cleanupSection.reclaimsLeftoverAnalyticsRowsAnd`,`Reclaims leftover analytics rows and files, debug stills/filmstrips, and ghost footage rows on frozen locations. Safe to re-run.`):e(`recordings.cleanupSection.reclaimsLeftoverAnalyticsRowsAnd2`,`Reclaims leftover analytics rows and files, and ghost footage rows on frozen locations. Debug stills are left alone. Safe to re-run.`),confirmLabel:e(`recordings.cleanupSection.runCleanup`,`Run cleanup`),variant:`danger`})){s(null);try{await p.mutateAsync({includeDebugMedia:n}),await l.refetch()}catch(e){s(e instanceof Error?e.message:String(e))}}},g=async()=>{if(u&&await t({title:e(`recordings.cleanupSection.cancelCleanup`,`Cancel cleanup?`),message:e(`recordings.cleanupSection.stopsAfterTheCurrentStep`,`Stops after the current step. Work already done stays done.`),confirmLabel:e(`recordings.cleanupSection.cancelCleanup2`,`Cancel cleanup`),variant:`danger`}))try{await m.mutateAsync({jobId:u.jobId}),await l.refetch()}catch{}};return a(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[c(`h2`,{className:`text-sm font-semibold text-foreground`,children:e(`recordings.cleanupSection.cleanup`,`Cleanup`)}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:e(`recordings.cleanupSection.onePassOverLeftoverAnalytics`,`One pass over leftover analytics (database + files) and ghost footage rows on frozen locations. Does not time out — progress updates here until it finishes.`)}),a(`label`,{className:`mt-3 flex items-start gap-2 text-[11px] text-foreground`,children:[c(`input`,{type:`checkbox`,checked:n,disabled:f,onChange:e=>{i(e.target.checked)},className:`mt-0.5 h-3.5 w-3.5 accent-primary`}),c(`span`,{children:e(`recordings.cleanupSection.alsoRemoveDebugMediaMotion`,`Also remove debug media (motion stills and track filmstrips)`)})]}),a(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[a(`button`,{type:`button`,disabled:f||p.isPending,onClick:()=>{h()},className:yt,children:[(f||p.isPending)&&c(v,{className:`h-3 w-3 animate-spin`}),c(d,{className:`h-3 w-3`}),e(`recordings.cleanupSection.runCleanup`,`Run cleanup`)]}),f&&c(`button`,{type:`button`,onClick:()=>{g()},className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10`,children:e(`common.cancel`,`Cancel`)})]}),o&&c(`p`,{className:`mt-2 text-[11px] text-danger`,children:o}),u&&a(`div`,{className:`mt-3 space-y-1 rounded-md border border-border px-2.5 py-2`,children:[a(`p`,{className:`text-xs text-foreground`,children:[e(`recordings.cleanupSection.phase`,`Phase:`),` `,c(`span`,{className:`font-medium`,children:u.phase}),f&&c(v,{className:`ml-2 inline h-3 w-3 animate-spin text-primary`})]}),u.detail&&c(`p`,{className:`text-[11px] text-foreground-subtle`,children:u.detail}),c(`p`,{className:`text-[11px] text-foreground-subtle`,children:St(u)}),u.error&&c(`p`,{className:`text-[11px] text-danger`,children:u.error})]})]})}e();var Tt=2e3;function Et(){let{t:e}=U(),n=R(),r=s(),i=de(),o=O(void 0,{refetchInterval:e=>e.state.data?.state===`running`?Tt:!1}),l=o.data,u=l?.state===`running`,d=u||i.isPending;t(()=>{l?.state!==`done`||l.finishedAtMs===null||(r.invalidateQueries({queryKey:[[`recording`]]}),r.invalidateQueries({queryKey:[[`pipelineAnalytics`]]}))},[l?.state,l?.finishedAtMs,r]);let f=async()=>{await n({title:e(`recordings.diskReconcileSection.reconcileStorageFromDisk`,`Reconcile storage from disk?`),message:e(`recordings.diskReconcileSection.makesTheDatabaseMatchThe`,`Makes the database match the filesystem: recordings index, tracks, events and media whose files are gone. Favourited tracks without files are deleted. Snapshot-less motion/audio events are deleted. Enrolled identities stay. This cannot be undone.`),confirmLabel:e(`recordings.diskReconcileSection.reconcile`,`Reconcile`),variant:`warning`})&&(await i.mutateAsync(),await o.refetch())},p=u?l.total>0?`Reconciling ${String(l.completed)}/${String(l.total)}…`:`Reconciling…`:i.isPending?`Reconciling…`:`Reconcile from disk`;return a(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[c(`h3`,{className:`text-sm font-semibold text-foreground`,children:e(`recordings.diskReconcileSection.diskReconcile`,`Disk reconcile`)}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:e(`recordings.diskReconcileSection.deletesDatabaseRowsWhoseFiles`,`Deletes database rows whose files are gone. Enrolled identities stay.`)}),a(`div`,{className:`mt-3 flex flex-col gap-2`,children:[a(`button`,{type:`button`,onClick:()=>void f(),disabled:d,className:`inline-flex w-fit items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[11px] font-medium border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`,children:[d?c(v,{className:`h-3.5 w-3.5 animate-spin`}):c(x,{className:`h-3.5 w-3.5`}),p]}),l?.state===`done`?a(`p`,{className:`text-[11px] text-foreground-subtle`,children:[e(`recordings.diskReconcileSection.lastRun`,`Last run:`),` `,e(`recordings.diskReconcileSection.summary`,{completed:String(l.completed),tracks:String(l.tracks),events:String(l.events),media:String(l.mediaDropped)}),l.failed.length>0?e(`recordings.diskReconcileSection.failed`,`, {{value1}} failed ({{value2}})`,{value1:String(l.failed.length),value2:l.failed.join(`, `)}):``,`.`]}):null,l?.state===`error`&&l.error!==null?a(`p`,{className:`text-[11px] text-destructive`,children:[e(`recordings.diskReconcileSection.reconcileFailed`,`Reconcile failed:`),` `,l.error]}):null]})]})}var q=1e3,J=60*q,Y=60*J;function X(e){return e.toLocaleString(`en-US`)}function Dt(e){if(!Number.isFinite(e)||e<0)return`—`;if(e>=Y){let t=Math.floor(e/Y),n=Math.round(e%Y/J);return`${t.toString()}h ${n.toString()}m`}if(e>=J){let t=Math.floor(e/J),n=Math.round(e%J/q);return`${t.toString()}m ${n.toString()}s`}return`${Math.max(0,Math.round(e/q)).toString()}s`}function Ot(e){let t=Math.max(0,e.observedAt-e.startedAt),n=e.filesTotal===null?`${X(e.filesMoved)} files`:`${X(e.filesMoved)} / ${X(e.filesTotal)} files`,r=e.filesTotal===null||e.filesTotal===0?null:Math.min(1,e.filesMoved/e.filesTotal),i=t>0&&e.filesMoved>0,a=i?`${W(e.bytesMoved/t*q)}/s`:null,o=e.filesTotal===null?null:e.filesTotal-e.filesMoved,s=!i||o===null||o<=0?null:`~${Dt(o*t/e.filesMoved)} left`;return{counted:n,fraction:r,moved:`${W(e.bytesMoved)} moved`,rate:a,eta:s}}function kt(e){let t=Ot(e);return[t.counted,t.moved,t.rate,t.eta].filter(e=>e!==null).join(` · `)}e();var At=`storage-migration`,Z=[{id:`recordings`,labelKey:`recordings.storageMigrationSection.classRecordings`,locationType:`recordings`},{id:`recordingsLow`,labelKey:`recordings.storageMigrationSection.classRecordingsLow`,locationType:`recordingsLow`},{id:`eventMedia`,labelKey:`recordings.storageMigrationSection.classEventMedia`,locationType:`eventMedia`}],jt=new Set([`planning`,`sealing`,`pausing`,`moving`,`draining`,`verifying`,`repointing`,`refreshing`,`resuming`]);function Mt(){let{t:e}=U(),t=L(At);return t===`pending`?a(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[c(v,{className:`h-4 w-4 animate-spin`}),e(`migration.storageMigrationSection.checkingWhetherStorageMigrationIs`,`Checking whether storage migration is installed…`)]}):t===`unknown`?c(I,{icon:p,title:e(`migration.storageMigrationSection.couldnTCheckWhetherStorage`,`Couldn't check whether storage migration is installed`),description:e(`migration.storageMigrationSection.theCapabilityRegistryDidNot`,`The capability registry did not answer, so this panel has nothing to report either way — it is not a statement that the capability is missing. Reload to ask again.`)}):t===`absent`?c(I,{icon:C,title:e(`migration.storageMigrationSection.storageMigrationNotInstalled`,`Storage migration not installed`),description:e(`migration.storageMigrationSection.theCapabilityRegistryAnsweredNo`,`The capability registry answered: no addon in this cluster provides storage-migration. Once one is deployed, this panel moves recordings, low-res recordings and event media to new storage locations in one coordinated, verified operation.`)}):c(Nt,{})}function Nt(){let{t:e}=U(),t=R(),{data:i}=z({}),[o,s]=r({}),[l,u]=r({}),[d,f]=r(null),[p,m]=r(null),h=n(()=>{let e=new Map;for(let t of i??[]){let n=e.get(t.type);n?n.push(t):e.set(t.type,[t])}return e},[i]),_=n(()=>{let e=new Map;for(let t of i??[]){if(t.enabled===!1)continue;let n=e.get(t.type);n?n.push(t.id):e.set(t.type,[t.id])}let t=new Map;for(let[n,r]of e)r.length===1&&t.set(n,r[0]);return t},[i]),y=me({},{refetchInterval:2e3}),b=y.data??null,x=b!==null&&jt.has(b.phase),S=n(()=>{let e={};for(let t of Z){let n=o[t.id];n&&(e[t.id]=n)}return Object.keys(e).length>0?e:void 0},[o]),w=n(()=>{let e={};for(let t of Z){if(!o[t.id])continue;let n=l[t.id]??_.get(t.locationType);n&&(e[t.id]=n)}return Object.keys(e).length>0?e:void 0},[o,l,_]),T=n(()=>({destinations:S??{},...w?{sources:w}:{}}),[S,w]),E=Se(T,{enabled:!1,retry:!1}),D=ye(),O=le(),k=async()=>{if(!S)return;m(null);let e=await E.refetch();if(e.error){m(e.error instanceof Error?e.error.message:String(e.error));return}f(e.data??null)},A=async()=>{if(S&&await t({title:e(`migration.storageMigrationSection.startStorageMigration`,`Start storage migration?`),message:e(`migration.storageMigrationSection.copiesTheSelectedClassesFrom`,`Copies the selected classes from the chosen source to the destination, verifies, then either makes the destination the default (if the source was) or disables the source. Safe to re-run if interrupted.`),confirmLabel:e(`migration.storageMigrationSection.startMigration`,`Start migration`),variant:`danger`})){m(null);try{await D.mutateAsync(T),f(null),await y.refetch()}catch(e){m(e instanceof Error?e.message:String(e))}}},j=async()=>{if(b&&await t({title:e(`migration.storageMigrationSection.cancelMigration`,`Cancel migration?`),message:e(`migration.storageMigrationSection.stopsTheInProgressMigration`,`Stops the in-progress migration. Data already moved and verified stays at the destination; anything already repointed is not reverted.`),confirmLabel:e(`migration.storageMigrationSection.cancelMigration2`,`Cancel migration`),variant:`danger`}))try{await O.mutateAsync({jobId:b.jobId}),await y.refetch()}catch{}};return a(`div`,{className:`flex flex-col gap-6`,children:[a(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[a(`h3`,{className:`flex items-center gap-1.5 text-sm font-semibold text-foreground`,children:[c(C,{className:`h-3.5 w-3.5`}),e(`migration.storageMigrationSection.storageMigration`,`Storage migration`)]}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:e(`migration.storageMigrationSection.moveRecordingsLowResRecordings`,`Move recordings, low-res recordings and/or event media from one location to another: copies via the recorder / pipeline-analytics movers, verifies, then either repoints the default (when the source was the default) or disables the source (when it was not). Skip a class with an empty destination.`)}),c(`div`,{className:`mt-3 grid grid-cols-1 gap-3 sm:grid-cols-3`,children:Z.map(t=>{let n=h.get(t.locationType)??[],r=_.get(t.locationType)??``;return a(`div`,{className:`space-y-2`,children:[c(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:e(t.labelKey)}),a(`div`,{className:`space-y-1`,children:[c(`label`,{htmlFor:`migration-from-${t.id}`,className:`text-[10px] text-foreground-subtle`,children:e(`recordings.storageMigrationSection.classFrom`,{label:e(t.labelKey)})}),c(`select`,{id:`migration-from-${t.id}`,value:l[t.id]??r,onChange:e=>{let n=e.target.value;u(e=>({...e,[t.id]:n}))},disabled:x,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground disabled:opacity-50`,children:n.map(t=>a(`option`,{value:t.id,children:[t.displayName,t.enabled===!1?` (${e(`recordings.storageMigrationSection.readOnly`)})`:``]},t.id))})]}),a(`div`,{className:`space-y-1`,children:[c(`label`,{htmlFor:`migration-dest-${t.id}`,className:`text-[10px] text-foreground-subtle`,children:e(`recordings.storageMigrationSection.classTo`,{label:e(t.labelKey)})}),a(`select`,{id:`migration-dest-${t.id}`,value:o[t.id]??``,onChange:e=>{let n=e.target.value;s(e=>({...e,[t.id]:n}))},disabled:x,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground disabled:opacity-50`,children:[c(`option`,{value:``,children:e(`migration.storageMigrationSection.skip`,`— skip —`)}),n.map(e=>c(`option`,{value:e.id,children:e.displayName},e.id))]})]})]},t.id)})}),p&&c(`p`,{className:`mt-2 text-[11px] text-danger`,children:p}),a(`div`,{className:`mt-3 flex items-center gap-2`,children:[a(`button`,{type:`button`,onClick:()=>{k()},disabled:!S||E.isFetching||x,className:`inline-flex items-center gap-1.5 rounded border border-border px-2.5 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover disabled:opacity-50`,children:[E.isFetching&&c(v,{className:`h-3 w-3 animate-spin`}),e(`migration.storageMigrationSection.plan`,`Plan`)]}),a(`button`,{type:`button`,onClick:()=>{A()},disabled:!S||D.isPending||x,className:`inline-flex items-center gap-1.5 rounded bg-primary px-2.5 py-1.5 text-xs font-medium text-primary-foreground disabled:opacity-50`,children:[D.isPending&&c(v,{className:`h-3 w-3 animate-spin`}),e(`migration.storageMigrationSection.startMigration`,`Start migration`)]})]}),d&&c(`div`,{className:`mt-3 divide-y divide-border rounded-md border border-border`,children:d.moves.length===0?c(`p`,{className:`px-2.5 py-1.5 text-[11px] text-foreground-subtle`,children:e(`migration.storageMigrationSection.nothingToMoveSelectedDestinations`,`Nothing to move — selected destinations match the current defaults.`)}):d.moves.map(e=>a(`div`,{className:`px-2.5 py-1.5 text-[11px] text-foreground`,children:[e.storageClass,`: `,e.fromLocationId,` → `,e.toLocationId]},`${e.storageClass}-${e.toLocationId}`))}),b&&a(`div`,{className:`mt-4 border-t border-border pt-3`,children:[a(`div`,{className:`flex items-center justify-between`,children:[c(`h4`,{className:`text-xs font-semibold text-foreground`,children:e(`migration.storageMigrationSection.migrationStatus`,`Migration status`)}),x&&a(`button`,{type:`button`,onClick:()=>{j()},className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10`,children:[c(g,{className:`h-3 w-3`}),e(`common.cancel`,`Cancel`)]})]}),a(`p`,{className:`mt-1 text-xs text-foreground`,children:[e(`migration.storageMigrationSection.phase`,`Phase:`),` `,c(`span`,{className:`font-medium`,children:b.phase}),x&&c(v,{className:`ml-2 inline h-3 w-3 animate-spin text-primary`})]}),b.error&&c(`p`,{className:`mt-1 text-[11px] text-danger`,children:b.error}),b.pausedParticipants.length>0&&a(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:[e(`migration.storageMigrationSection.paused`,`Paused:`),` `,b.pausedParticipants.join(`, `)]}),c(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:b.moves.map(e=>c(Pt,{move:e},`${e.storageClass}-${e.fromLocationId}`))})]}),c(Ft,{})]}),c(It,{running:x}),c(Rt,{})]})}function Pt({move:e}){let{t}=U(),n=e.progress===null?null:Ot(e.progress);return a(`div`,{className:`px-2.5 py-1.5 text-[11px]`,children:[a(`div`,{className:`flex items-center justify-between`,children:[a(`span`,{className:`text-foreground`,children:[e.storageClass,`: `,e.fromLocationId,` → `,e.toLocationId]}),a(`span`,{className:`text-foreground-subtle`,children:[e.state??t(`common.pending`),e.error?` (${e.error})`:``]})]}),e.progress!==null&&a(`div`,{className:`mt-1 space-y-1`,children:[n!==null&&n.fraction!==null&&c(`div`,{className:`h-1 w-full overflow-hidden rounded bg-border`,children:c(`div`,{className:`h-full bg-primary`,style:{width:`${(n.fraction*100).toFixed(1)}%`}})}),c(`p`,{className:`text-[10px] text-foreground-subtle`,children:kt(e.progress)})]})]})}function Ft(){let{t:e}=U(),{data:t}=_e({});return!t||t.length===0?null:a(`div`,{className:`mt-4 border-t border-border pt-3`,children:[c(`h4`,{className:`text-xs font-semibold text-foreground`,children:e(`migration.storageMigrationSection.migrationHistory`,`Migration history`)}),c(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:t.map(e=>a(`div`,{className:`px-2.5 py-1.5 text-[11px] text-foreground-subtle`,children:[c(`span`,{className:`font-medium text-foreground`,children:e.phase}),` · `,Object.entries(e.destinations).filter(e=>typeof e[1]==`string`).map(([e,t])=>`${e} → ${t}`).join(`, `),` · `,new Date(e.startedAt).toLocaleString()]},e.jobId))})]})}function It({running:e}){let{t}=U(),n=R(),i=Te({},{staleTime:1/0,refetchOnWindowFocus:!1}),o=T(),[s,l]=r(null),u=i.data??[];if(u.length===0)return null;let d=async e=>{if(await n({title:t(`migration.storageMigrationSection.drainRemaining`,`Drain remaining {{storageClass}}?`,{storageClass:e.storageClass}),message:`Moves what is still on ${e.fromLocationId} to ${e.toLocationId}. Nothing is paused and no default is changed — this is the second half of a migration, run on its own. It is resumable: cancelling leaves everything readable from both locations.`,confirmLabel:t(`migration.storageMigrationSection.drainRemaining2`,`Drain remaining`),variant:`danger`})){l(null);try{await o.mutateAsync({classes:[e.storageClass]}),await i.refetch()}catch(e){l(e instanceof Error?e.message:String(e))}}};return a(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[a(`div`,{className:`flex items-start justify-between gap-2`,children:[c(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(`migration.storageMigrationSection.leftOnTheOldLocation`,`Left on the old location`)}),a(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c(`span`,{className:`text-[10px] text-foreground-subtle`,children:i.dataUpdatedAt>0?t(`migration.storageMigrationSection.measured`,`Measured {{value1}}`,{value1:new Date(i.dataUpdatedAt).toLocaleTimeString()}):t(`migration.storageMigrationSection.measuredNever`,`Measured — never`)}),c(`button`,{type:`button`,onClick:()=>{i.refetch()},disabled:i.isFetching,className:`rounded border border-border px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-surface-hover hover:text-foreground disabled:opacity-50`,children:i.isFetching?t(`migration.storageMigrationSection.counting`,`Counting…`):t(`common.refresh`,`Refresh`)})]})]}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:t(`migration.storageMigrationSection.aMigrationRepointsFirstAnd`,`A migration repoints first and drains behind. If the drain was cancelled, failed, or was interrupted by a restart, the data below is still on the source — readable, but not where the defaults now point. Draining moves it; it changes no default and pauses nothing.`)}),c(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:t(`migration.storageMigrationSection.thisCountIsTakenOn`,`This count is taken on demand: measuring it walks the whole media collection, so it is not refreshed on a timer. Press Refresh after a drain finishes.`)}),s&&c(`p`,{className:`mt-2 text-[11px] text-danger`,children:s}),c(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:u.map(n=>a(`div`,{className:`flex items-center justify-between gap-2 px-2.5 py-1.5 text-[11px]`,children:[a(`span`,{className:`text-foreground`,children:[n.storageClass,`: `,n.fromLocationId,` → `,n.toLocationId,c(`span`,{className:`ml-2 text-foreground-subtle`,children:Lt(n)})]}),c(`button`,{type:`button`,onClick:()=>{d(n)},disabled:e||o.isPending,className:`shrink-0 rounded border border-border px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-surface-hover hover:text-foreground disabled:opacity-50`,children:t(`migration.storageMigrationSection.drainRemaining2`,`Drain remaining`)})]},`${n.storageClass}-${n.fromLocationId}`))})]})}function Lt(e){if(e.items===null)return H.t(`recordings.storageMigrationSection.residueUnknown`);let t=e.items.toLocaleString(`en-US`);return e.bytes===null?H.t(`recordings.storageMigrationSection.residueRows`,{count:e.items,items:t}):H.t(`recordings.storageMigrationSection.residueSegments`,{count:e.items,items:t,size:W(e.bytes)})}function Rt(){let{t:e}=U(),{data:t}=Ee({},{refetchInterval:2e3}),n=(t??[]).filter(e=>e.migrationJobId===null&&e.job.state===`running`);return n.length===0?null:a(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[c(`h3`,{className:`text-sm font-semibold text-foreground`,children:e(`migration.storageMigrationSection.moversRunningOutsideAMigration`,`Movers running outside a migration`)}),c(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:n.map(e=>a(`div`,{className:`px-2.5 py-1.5 text-[11px]`,children:[a(`div`,{className:`text-foreground`,children:[e.lane,`: `,e.job.fromLocationId,` → `,e.job.toLocationId]}),c(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:kt({filesMoved:e.job.filesMoved,filesTotal:e.job.filesTotal,bytesMoved:e.job.bytesMoved,startedAt:e.job.startedAt,observedAt:e.observedAt})})]},e.job.jobId))})]})}function zt(){let{t:e}=U();return a(`div`,{className:`flex flex-col gap-4`,children:[c(Ct,{}),c(Et,{}),a(`section`,{children:[c(`h2`,{className:`text-sm font-semibold text-foreground`,children:e(`recordings.recordingsManagementSection.moveStorage`,`Move storage`)}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:e(`recordings.recordingsManagementSection.copyRecordingsLowResRecordings`,`Copy recordings, low-res recordings or event media to a new location, verify, then repoint the default. Applies to every camera.`)}),c(`div`,{className:`mt-3`,children:c(Mt,{})})]})]})}e();var Bt=`recorder`;function Vt(e,t,n){for(let n of e?.sections??[])for(let e of n.fields??[])if(e.key===t&&typeof e.value==`string`)return e.value;return n}function Ht(){let{t:e}=U(),t=s(),{nodes:r}=Oe(),{data:i,isLoading:o}=pe({addonId:Bt}),l=Vt(i,`recordingNodeId`,`hub`),u=he({onSuccess:()=>{t.invalidateQueries({queryKey:[[`addonSettings`,`getGlobalSettings`]]})}}),d=n(()=>{let e=r.filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,l,...e])].filter(Boolean)},[r,l]);return a(`div`,{className:`flex flex-col gap-6`,children:[a(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[c(`h3`,{className:`text-sm font-semibold text-foreground`,children:e(`pipeline.clusterRecordingTab.recordingNode`,`Recording node`)}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:e(`pipeline.clusterRecordingTab.theSingleNodeThatRecords`,`The single node that records (continuous & events) and serves playback. Every other node stays inert — no multi-node balancing. Takes effect on addon restart.`)}),a(`div`,{className:`mt-3 flex items-center gap-2`,children:[o?c(v,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):c(`select`,{value:l,onChange:e=>{e.target.value!==l&&u.mutate({addonId:Bt,patch:{recordingNodeId:e.target.value}})},disabled:u.isPending,className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:d.map(t=>c(`option`,{value:t,children:t===`hub`?e(`pipeline.clusterRecordingTab.hubDefault`,`hub (default)`):t},t))}),u.isPending&&c(v,{className:`h-4 w-4 animate-spin text-primary`})]}),l!==`hub`&&c(`p`,{className:`mt-2 text-[11px] text-amber-500`,children:c(je,{i18nKey:`pipeline.clusterRecordingTab.hubOnlyNote`,values:{node:l},components:{b:c(`span`,{className:`font-medium`})}})})]}),a(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[c(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:e(`pipeline.clusterRecordingTab.recordingsFolders`,`Recordings folders`)}),c(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:e(`pipeline.clusterRecordingTab.whereRecordingsAreStoredMulti`,`Where recordings are stored. Multi-location collections — segments are split across the locations of a type. Add a location to grow capacity; mark one default per type.`)}),c(Xe,{types:[`recordings`,`recordingsLow`]})]})]})}function Ut(e){return e.locationIds!==void 0&&e.locationIds.length>0?e.locationIds:e.locationId===null?[]:[e.locationId]}function Q(e,t){let n=Ut(e);return n.length===0?H.t(`helpers.cameraDisk.defaultRoot`):n.map(e=>t.get(e)??e).join(` + `)}function Wt(e,t,n){if(e.length===0)return null;let r=e[0];if(e.length===1&&r!==void 0)return{label:Q(r,t),exact:!0};if(n===null)return null;let i=e.find(e=>Ut(e).includes(n));return i===void 0?null:{label:Q(i,t),exact:!1}}e();var Gt=[[`recording`]],Kt=[{value:`retention`,labelKey:`recordings.storageSection.pruneRetention`},{value:`quota`,labelKey:`recordings.storageSection.pruneQuota`},{value:`operator`,labelKey:`recordings.storageSection.pruneOperator`}],qt={ok:`bg-primary`,warn:`bg-amber-500`,critical:`bg-danger`},Jt={ok:`text-foreground-subtle`,warn:`text-amber-500`,critical:`text-danger`};function $(e){return`${String(Math.round(e*100))}%`}function Yt(e){return e==null?`—`:new Date(e).toLocaleString()}function Xt(e,t){let n=e.locationIds??(e.locationId===null?[]:[e.locationId]),r=n.map(e=>t.get(e)).filter(e=>e!==void 0);return r.length>0?r.join(` + `):e.root===void 0?n.length>0?n.join(` + `):H.t(`recordings.storageSection.defaultRoot`):e.root}function Zt(){let{t:e}=U(),t=s(),o=R(),[l,u]=r(`retention`),{data:f,isLoading:p}=ee({},{refetchOnWindowFocus:!1}),{data:m}=B({isCamera:!0,projection:`slim`}),{data:g}=z({}),_=n(()=>{let e=new Map;for(let t of m??[])e.set(t.id,t.name);return e},[m]),y=n(()=>{let e=new Map;for(let t of g??[])e.set(t.id,t.displayName);return e},[g]),b=n(()=>{let e=g??[];return e.find(e=>e.type===`recordings`&&e.enabled!==!1)?.id??e.find(e=>e.type===`recordings`)?.id??null},[g]),S=n(()=>f?.locations??[],[f?.locations]),C=n(()=>Wt(S,y,b),[S,y,b]),T=n(()=>Ie(S),[S]),E=i(()=>{t.invalidateQueries({queryKey:Gt})},[t]),O=D({onSuccess:E}),k=N({onSuccess:E}),A=i(async t=>{await o({title:e(`recordings.storageSection.prune`,`Prune {{label}}?`,{label:_.get(t.deviceId)??`#${String(t.deviceId)}`}),message:e(`recordings.storageSection.appliesTheRetentionPolicyNow`,`Applies the retention policy now (reason: {{reason}}). Footage beyond the policy is permanently deleted.`,{reason:l}),confirmLabel:e(`recordings.storageSection.pruneNow`,`Prune now`),variant:`danger`})&&O.mutate({deviceId:t.deviceId,reason:l})},[o,O,l,_,e]),M=i(async t=>{await o({title:e(`recordings.storageSection.deleteAllFootageFor`,`Delete all footage for {{label}}?`,{label:_.get(t.deviceId)??`#${String(t.deviceId)}`}),message:e(`recordings.storageSection.permanentlyDeletesOfRecordedFootage`,`Permanently deletes {{value1}} of recorded footage for this camera. This cannot be undone.`,{value1:W(t.usedBytes)}),confirmLabel:e(`recordings.storageSection.delete`,`Delete {{value1}}`,{value1:W(t.usedBytes)}),variant:`danger`})&&k.mutate({deviceId:t.deviceId})},[o,k,_,e]),P=n(()=>[{key:`camera`,header:e(`recordings.storageSection.camera`,`Camera`),render:e=>c(`span`,{className:`text-foreground`,children:_.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`disk`,header:e(`recordings.storageSection.disk`,`Disk`),nowrap:!0,render:()=>C===null?c(`span`,{className:`text-foreground-subtle`,children:`—`}):a(`span`,{className:C.exact?`text-foreground`:`text-foreground-subtle`,title:C.exact?e(`recordings.storageSection.theOnlyRecordingsVolumeOn`,`The only recordings volume on this node — this camera can only be here.`):e(`recordings.storageSection.theRecordingsDefaultThisNode`,`The recordings DEFAULT. This node has several recordings volumes and the per-camera placement is not reported by recording.getStorageUsage, so this is where footage lands by default rather than a per-camera fact.`),children:[C.label,!C.exact&&c(`span`,{className:`ml-1 text-foreground-subtle`,children:e(`recordings.storageSection.default`,`(default)`)})]})},{key:`used`,header:e(`recordings.storageSection.used`,`Used`),align:`right`,nowrap:!0,render:e=>c(`span`,{className:`tabular-nums`,children:W(e.usedBytes)})},{key:`oldest`,header:e(`recordings.storageSection.oldestFootage`,`Oldest footage`),align:`right`,nowrap:!0,render:t=>c(`span`,{className:`tabular-nums text-foreground-subtle`,title:e(`recordings.storageSection.theOldestSegmentTheArchive`,`The oldest segment the ARCHIVE holds for this camera — the per-camera answer to 'is retention actually holding?'.`),children:Yt(t.oldestMs)})},{key:`actions`,header:``,align:`right`,render:t=>a(`div`,{className:`flex items-center justify-end gap-1`,children:[a(`button`,{onClick:()=>{A(t)},disabled:O.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-amber-500/10 hover:text-amber-500 disabled:opacity-50`,title:e(`recordings.storageSection.applyRetentionPolicyNow`,`Apply retention policy now`),children:[c(w,{className:`h-3 w-3`}),e(`recordings.storageSection.prune2`,`Prune`)]}),a(`button`,{onClick:()=>{M(t)},disabled:k.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10 disabled:opacity-50`,title:e(`recordings.storageSection.deleteAllFootage`,`Delete all footage`),children:[c(d,{className:`h-3 w-3`}),e(`common.delete`,`Delete`)]})]})}],[_,C,A,M,O.isPending,k.isPending,e]);if(p&&!f)return a(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[c(v,{className:`h-4 w-4 animate-spin`}),e(`recordings.storageSection.loadingStorageUsage`,`Loading storage usage…`)]});if(!f)return c(I,{icon:x,title:e(`recordings.storageSection.noStorageData`,`No storage data`),description:e(`recordings.storageSection.theRecordingNodeHasNot`,`The recording node has not reported any storage usage yet.`)});let F=f.devices.length;return a(`div`,{className:`flex flex-col gap-6`,children:[a(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[c(h,{label:e(`recordings.storageSection.totalUsed`,`Total used`),icon:c(x,{className:`h-3 w-3`}),footer:`${String(F)} camera${F===1?``:`s`} on ${f.nodeId}`,children:W(f.totalUsedBytes)}),T!==null&&T.severity!==null&&c(h,{label:e(`recordings.storageSection.freeOnRecordingsVolumes`,`Free on recordings volumes`),icon:c(x,{className:`h-3 w-3`}),footer:`across ${String(T.knownVolumes)} volume${T.knownVolumes===1?``:`s`} of ${W(T.totalBytes)}`+(T.unknownVolumes>0?` · ${String(T.unknownVolumes)} did not report capacity`:``),children:c(`span`,{className:`tabular-nums ${Jt[T.severity]}`,children:W(T.freeBytes)})}),S.map(t=>{let n=Be(t),r=t.locationId??t.root??`default`;return c(h,{label:e(`recordings.storageSection.disk2`,`Disk: {{label}}`,{label:Xt(t,y)}),footer:n===null?`${W(t.usedBytes)} of recordings · volume capacity unknown`:`${W(n.freeBytes)} free of ${W(n.totalBytes)} · ${W(t.usedBytes)} recordings (${$(n.recordingsFraction)})`,children:n===null?c(`span`,{className:`tabular-nums`,children:W(t.usedBytes)}):a(`div`,{className:`flex items-center gap-2`,title:e(`recordings.storageSection.volumeFillEverythingOnThe`,`Volume fill — everything on the disk, not only recordings. Warn at 85%, critical at 95%.`),children:[c(`div`,{className:`h-2 flex-1 overflow-hidden rounded bg-muted`,children:c(`div`,{className:`h-full rounded ${qt[n.severity]}`,style:{width:$(n.fraction)}})}),c(`span`,{className:`tabular-nums text-xs ${Jt[n.severity]}`,children:$(n.fraction)})]})},r)})]}),a(`section`,{className:`flex items-center gap-2 text-xs`,children:[c(`label`,{htmlFor:`prune-reason`,className:`text-foreground-subtle`,children:e(`recordings.storageSection.pruneReason`,`Prune reason`)}),c(`select`,{id:`prune-reason`,value:l,onChange:e=>{let t=Kt.find(t=>t.value===e.target.value);t&&u(t.value)},className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:Kt.map(t=>c(`option`,{value:t.value,children:e(t.labelKey)},t.value))})]}),F===0?c(I,{icon:x,title:f.devicesRead===`unavailable`?e(`recordings.storageSection.perCameraUsageUnavailable`,`Per-camera usage unavailable`):e(`recordings.storageSection.noRecordedFootage`,`No recorded footage`),description:f.devicesRead===`unavailable`?e(`recordings.storageSection.thisRecordingNodeHasNo`,`This recording node has no footage ledger, so it refused to answer the per-camera table rather than report what it happens to hold in memory. The disk totals above are unaffected.`):e(`recordings.storageSection.noCameraHasRecordedFootage`,`No camera has recorded footage on this node yet.`)}):c(j,{columns:P,rows:[...f.devices],rowKey:e=>e.deviceId,minWidthPx:480})]})}function Qt(){let{t:e}=U();return a(`div`,{className:`flex flex-col gap-8`,children:[a(`div`,{children:[c(`h2`,{className:`text-sm font-semibold text-foreground`,children:e(`recordings.recordingsStorageSection.footageOnDisk`,`Footage on disk`)}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:e(`recordings.recordingsStorageSection.whatRecordedFootageOccupiesPer`,`What recorded footage occupies, per camera and per volume, with prune-by-policy and delete-all-footage.`)}),c(`div`,{className:`mt-3`,children:c(Zt,{})})]}),a(`div`,{children:[c(`h2`,{className:`text-sm font-semibold text-foreground`,children:e(`recordings.recordingsStorageSection.recordingNodeFolders`,`Recording node & folders`)}),c(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:e(`recordings.recordingsStorageSection.theSingleNodeThatRecords`,`The single node that records and serves playback, and the storage locations footage is written to.`)}),c(`div`,{className:`mt-3`,children:c(Ht,{})})]})]})}function $t(){let{t:e}=U(),t=Me(`/recordings`,{t:e,isAdmin:!0})??{icon:u,title:e(`nav.recordings`,`Recordings`)};return c(Ne,{icon:t.icon,title:t.title,subtitle:e(`recordings.recordedFootageAndTheDurable`,`Recorded footage and the durable event store — what each occupies, where it is written, and the operations that move or reconcile both.`),defaultSection:`storage`,sectionsLabel:`${t.title} sections`,sections:[{id:`storage`,label:e(`recordings.recordings`,`Recordings`),content:c(Qt,{})},{id:`events`,label:e(`recordings.events`,`Events`),content:c(it,{})},{id:`cameras`,label:e(`recordings.cameras`,`Cameras`),content:c(Ye,{})},{id:`exports`,label:e(`recordings.export`,`Export`),content:c(vt,{})},{id:`activity`,label:e(`recordings.activity`,`Activity`),content:c(Je,{})},{id:`management`,label:e(`recordings.management`,`Management`),content:c(zt,{})}]})}export{$t as RecordingsPage};
@@ -1,2 +0,0 @@
1
- import{$ as e,G as t,J as n,L as r,S as i,q as a,x as o}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEHpkaJP.js";import{D as s,It as c,dt as l,ln as u,or as d,ot as f,pi as p}from"./player-overlays-Db_o1Zm2.js";import{a as m,i as h,s as g}from"./video-Dzs93Xor.js";import{t as _}from"./key-round-CasJ848Z.js";import{An as v,Bl as y,Bn as b,Cu as x,It as S,Kt as ee,Lt as C,Mn as w,Nn as T,On as E,Pn as D,Un as O,Wt as te,cr as ne,du as k,er as re,iu as ie,jn as ae,qt as oe,ru as se,tr as A,va as ce}from"./src-BpDNu6in.js";import{t as j}from"./i18n-RHwbGLC0.js";import{t as M}from"./useTranslation-D3Is_4B6.js";import{B as le,a as ue,o as de}from"./index-DrWxDgY9.js";e();function N({id:e,title:t,icon:n,description:r,actions:a,tone:c=`default`,notice:l=null,onDismissNotice:u,children:d}){return o(te,{headingId:`access-${e}`,title:t,icon:n,actions:a,testId:`access-${e}`,children:i(`div`,{className:`${s} space-y-3`,children:[o(`div`,{className:k(`text-[11px] leading-relaxed`,c===`danger`?`rounded-md border border-danger/30 bg-danger/5 px-3 py-2 text-foreground`:`text-foreground-subtle`),children:r}),l!==null&&o(pe,{notice:l,onDismiss:u}),d]})})}var fe={success:{icon:p,line:`border-success/30 text-foreground`,mark:`text-success`},danger:{icon:h,line:`border-danger/40 text-danger`,mark:`text-danger`}};function pe({notice:e,onDismiss:t}){let{t:n}=M(),r=fe[e.tone],a=r.icon;return i(`div`,{role:e.tone===`danger`?`alert`:`status`,className:k(`flex items-start gap-2 rounded-md border bg-surface px-3 py-2 text-[11px]`,r.line),children:[o(a,{className:k(`mt-0.5 h-3.5 w-3.5 shrink-0`,r.mark),"aria-hidden":!0}),o(`span`,{className:`min-w-0 flex-1`,children:e.message}),t!==void 0&&o(ie,{type:`button`,variant:`ghost`,size:`sm`,icon:l,"aria-label":n(`access.accessSection.dismiss`,`Dismiss`),onClick:t,className:`-my-1 h-5 w-5`})]})}function me(){let{data:e}=y();return t(()=>{let t=new Map;for(let n of e??[])t.set(n.id,n.username);return t},[e])}function P(e,t=null){return e===null?t:{tone:`danger`,message:e}}var he={active:`access.credentialColumns.statusActive`,expired:`access.credentialColumns.statusExpired`,revoked:`access.credentialColumns.statusRevoked`,current:`access.credentialColumns.statusCurrent`};function F(e){return j.t(he[e])}var ge={active:`success`,expired:`warning`,revoked:`default`,current:`info`},_e={current:0,active:1,expired:2,revoked:3};function I(e,t){if(e===null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?`—`:n.toLocaleString()}function ve({status:e}){return o(ne,{variant:ge[e],className:`text-[10px]`,children:F(e)})}function ye({row:e,action:t}){if(!t.isAvailable(e))return null;let n=t.icon,r=t.busyId===e.id;return i(O,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>t.onRun(e),disabled:t.disabled,"aria-label":j.t(`access.credentialColumns.actionOn`,{action:t.label,name:e.name}),className:t.tone===`neutral`?void 0:`text-danger hover:bg-danger/10`,children:[r?o(d,{className:`h-3 w-3 animate-spin`,"aria-hidden":!0}):o(n,{className:`h-3 w-3`,"aria-hidden":!0}),t.label]})}function be(e){return[{key:`name`,header:j.t(`access.credentialColumns.name`,`Name`),sortValue:e=>e.name.toLowerCase(),render:e=>i(`div`,{className:`min-w-0 max-w-[18rem]`,children:[o(`div`,{className:`truncate font-medium text-foreground`,title:e.name,children:e.name}),e.detail!==null&&o(`div`,{className:`truncate font-mono text-[10px] text-foreground-subtle`,title:e.detail,children:e.detail})]})},e.hideOwner?null:{key:`owner`,header:j.t(`access.credentialColumns.owner`,`Owner`),sortValue:e=>e.ownerName.toLowerCase(),render:e=>e.ownerName},{key:`kind`,header:j.t(`access.credentialColumns.kindScope`,`Kind / scope`),sortValue:e=>e.kind.toLowerCase(),nowrap:!1,render:e=>i(`div`,{className:`min-w-[8rem] max-w-[16rem]`,children:[o(`div`,{className:`text-foreground`,children:e.kind}),e.scope!==null&&o(`div`,{className:`line-clamp-2 text-[10px] text-foreground-subtle`,title:e.scope,children:e.scope})]})},{key:`status`,header:j.t(`access.credentialColumns.status`,`Status`),sortValue:e=>_e[e.status],render:e=>o(ve,{status:e.status})},{key:`created`,header:j.t(`access.credentialColumns.created`,`Created`),sortValue:e=>e.createdAt,render:e=>o(`span`,{className:`text-foreground-subtle`,children:I(e.createdAt,`—`)})},{key:`lastUsed`,header:j.t(`access.credentialColumns.lastUsed`,`Last used`),sortValue:e=>e.lastUsedAt,render:e=>o(`span`,{className:`text-foreground-subtle`,children:I(e.lastUsedAt,j.t(`access.credentialColumns.never`))})},{key:`expires`,header:j.t(`access.credentialColumns.expires`,`Expires`),sortValue:e=>e.expiresAt,render:t=>o(`span`,{className:`text-foreground-subtle`,children:I(t.expiresAt,e.expiresNone)})},e.action===null?null:{key:`actions`,header:``,align:`right`,notSortableReason:j.t(`access.credentialColumns.actionsHeader`),render:t=>o(`div`,{className:`flex items-center justify-end gap-1`,children:[...e.extraActions??[],e.action].map(e=>e===null?null:o(ye,{row:t,action:e},e.label))})}].filter(e=>e!==null)}e();var L=6,xe={"current-session":`access.bulk.skipCurrentSession`,"not-active":`access.bulk.skipNotActive`};function R(e){let t=xe[e];return t===void 0?e:j.t(t)}function z(e,t){return j.t(t.key,{count:e})}function B(e,t){return j.t(`access.bulk.countOf`,{count:e,noun:z(e,t)})}function Se(e){let t=new Map;for(let n of e)t.set(n.status,(t.get(n.status)??0)+1);return[...t.entries()].map(([e,t])=>j.t(`access.bulk.statusCount`,{count:t,status:F(e).toLowerCase()})).join(`, `)}function Ce(e,t){let n=e.slice(0,L).map(e=>`• ${e.name} — ${e.ownerName}`),r=e.length>L?[j.t(`access.bulk.previewMore`,{count:e.length-L})]:[];return[j.t(`access.bulk.previewIntro`,{what:B(e.length,t),breakdown:Se(e)}),``,...n,...r].join(`
2
- `)}async function V(e,t,n){let r=String(t.length),i=await e({title:j.t(`access.bulk.confirmTitle`,{what:B(t.length,n)}),message:Ce(t,n),label:j.t(`access.bulk.confirmLabel`,{expected:r}),placeholder:r,confirmLabel:j.t(`access.bulk.confirmButton`,{expected:r}),variant:`danger`,validate:e=>e.trim()===r?null:j.t(`access.bulk.confirmMismatch`,{expected:r,noun:z(2,n)})});return i!==null&&i.trim()===r}function H(e,t,r){let i=A(),a=x.auth.revokeCredentials.useMutation(),[o,s]=n(null);return{run:async n=>{if(n.length===0||!await V(i,n,t))return!1;s(null);try{let r=await a.mutateAsync({kind:e,ids:n.map(e=>e.id),confirmCount:n.length}),i=r.skipped.map(e=>R(e.reason));return s({tone:`success`,message:i.length>0?j.t(`access.bulk.revokedSkipped`,{what:B(r.revoked.length,t),count:i.length,reasons:[...new Set(i)].join(`, `)}):j.t(`access.bulk.revoked`,{what:B(r.revoked.length,t)})}),!0}catch(e){return s({tone:`danger`,message:j.t(`access.bulk.revokeFailed`,{error:e instanceof Error?e.message:j.t(`access.bulk.requestFailed`)})}),!1}finally{r()}},busy:a.isPending,outcome:o,dismiss:()=>s(null)}}function we(e,t){let r=A(),i=x.auth.revokeCredentials.useMutation(),[a,o]=n(null);return{run:async n=>{if(n.length===0||!await V(r,n,e))return!1;o(null);let a=n.filter(e=>e.kind===`Scoped`).map(e=>e.id),s=n.filter(e=>e.kind===`Admin`).map(e=>e.id);try{let t=[],n=[];if(a.length>0){let e=await i.mutateAsync({kind:`scoped-token`,ids:a,confirmCount:a.length});t.push(...e.revoked),n.push(...e.skipped)}if(s.length>0){let e=await i.mutateAsync({kind:`admin-token`,ids:s,confirmCount:s.length});t.push(...e.revoked),n.push(...e.skipped)}let r=n.map(e=>R(e.reason));return o({tone:`success`,message:r.length>0?j.t(`access.bulk.revokedSkipped`,{what:B(t.length,e),count:r.length,reasons:[...new Set(r)].join(`, `)}):j.t(`access.bulk.revoked`,{what:B(t.length,e)})}),!0}catch(e){return o({tone:`danger`,message:j.t(`access.bulk.revokeFailed`,{error:e instanceof Error?e.message:j.t(`access.bulk.requestFailed`)})}),!1}finally{t()}},busy:i.isPending,outcome:a,dismiss:()=>o(null)}}function Te(e,t,r){let i=A(),[a,o]=n(!1),[s,c]=n(null);return{run:async n=>{if(n.length===0||!await V(i,n,e))return!1;c(null),o(!0);let a=[],s=0;for(let e of n)try{await t(e.id),s+=1}catch(t){a.push(`${e.name}: ${t instanceof Error?t.message:j.t(`access.bulk.requestFailed`)}`)}return o(!1),r(),a.length===0?(c({tone:`success`,message:j.t(`access.bulk.revoked`,{what:B(s,e)})}),!0):(c({tone:`danger`,message:j.t(a.length>3?`access.bulk.eachPartialMore`:`access.bulk.eachPartial`,{what:B(s,e),count:a.length,details:a.slice(0,3).join(`; `)})}),s>0)},busy:a,outcome:s,dismiss:()=>c(null)}}e();var Ee={searchText:e=>[e.name,e.detail??``,e.ownerName,e.kind,e.scope??``],facetGroups:[{id:`status`,value:e=>e.status},{id:`owner`,value:e=>e.ownerName},{id:`kind`,value:e=>e.kind}]},U={status:`access.credentialTable.groupStatus`,owner:`access.credentialTable.groupOwner`,kind:`access.credentialTable.groupKind`},De=e=>e.status!==`current`,Oe=[`active`,`current`];function W({rows:e,label:r,isLoading:a,loadError:s,emptyText:c,hideOwner:l=!1,expiresNone:u,action:f,extraActions:p,bulk:m,defaultStatus:h=Oe}){let{t:g}=M(),[_]=n(()=>h.length===0?{search:``,facets:[]}:{search:``,facets:[],groups:{status:[...h]}}),v=S(e,Ee,_),[y,x]=n(()=>new Set),w=u??g(`access.credentialColumns.never`),T=t(()=>be({hideOwner:l,expiresNone:w,action:f??null,...p===void 0?{}:{extraActions:p}}),[l,w,f,p,g]),E=t(()=>m===void 0?()=>!1:e=>De(e)&&m.isSelectable(e),[m]),D=t(()=>v.rows.filter(e=>y.has(e.id)&&E(e)),[v.rows,y,E]);return a?i(`div`,{className:`flex items-center gap-2 py-4 text-xs text-foreground-subtle`,children:[o(d,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}),g(`access.credentialTable.loading`,{label:r})]}):s===null?i(`div`,{className:`space-y-3`,children:[o(C,{state:v.state,facets:v.facets,groups:v.groups.filter(e=>!(l&&e.id===`owner`)).map(e=>({...e,label:U[e.id]===void 0?e.id:g(U[e.id]),...e.id===`status`?{facetLabel:e=>F(e)}:{}})),labels:{searchPlaceholder:g(`access.credentialTable.searchPlaceholder`,{label:r}),searchLabel:g(`access.credentialTable.searchLabel`,{label:r}),facetsLabel:g(`access.credentialTable.facetsLabel`,{label:r}),clearLabel:g(`access.credentialTable.clearFilters`)},onSearch:v.setSearch,onToggleFacet:v.toggleFacet,onToggleGroupFacet:v.toggleGroupFacet,onClear:v.clear}),m!==void 0&&o(ke,{bulk:m,shown:v.rows.filter(E),targets:D,onSelect:x}),o(ee,{columns:T,rows:v.rows,rowKey:e=>e.id,minWidthPx:l?760:860,maxBodyHeight:oe,defaultSort:{columnKey:`created`,dir:`desc`},pageSize:25,paginationLabels:{navLabel:g(`access.credentialTable.pagesLabel`,{label:r}),previous:g(`access.credentialTable.previousPage`),next:g(`access.credentialTable.nextPage`),range:(e,t,n)=>g(`access.credentialTable.range`,{from:e,to:t,total:n})},emptyMessage:v.active?g(`access.credentialTable.noMatchTheFilters`,`No {{label}} match the filters.`,{label:r}):c,rowClassName:e=>e.status===`revoked`||e.status===`expired`?`opacity-70`:void 0,...m===void 0?{}:{selection:{selected:y,onChange:x,isSelectable:E,rowLabel:e=>g(`access.credentialTable.rowLabel`,{name:e.name,owner:e.ownerName}),pageLabel:g(`access.credentialTable.pageLabel`,{noun:z(1,m.noun)})}}})]}):o(b,{title:g(`access.credentialTable.couldNotLoad`,`Could not load {{label}}`,{label:r}),message:s})}function ke({bulk:e,shown:t,targets:n,onSelect:r}){let{t:a}=M(),{revoke:s,noun:u}=e,f=(e.quickSelect??[]).map(e=>({...e,rows:t.filter(e.match)})).filter(e=>e.rows.length>0),p=async()=>{await s.run(n)&&r(new Set)};return i(`div`,{className:`flex flex-wrap items-center gap-2`,"data-testid":`bulk-bar`,children:[t.length>0&&o(O,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>r(new Set(t.map(e=>e.id))),children:a(`access.credentialTable.selectAllShown`,{count:t.length})}),f.map(e=>i(O,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>r(new Set(e.rows.map(e=>e.id))),children:[e.label,` (`,String(e.rows.length),`)`]},e.label)),n.length>0&&i(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:[o(`span`,{className:`text-[11px] tabular-nums text-foreground`,"aria-live":`polite`,children:a(`access.credentialTable.selectedLabel`,{what:B(n.length,u)})}),i(O,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>r(new Set),children:[o(l,{className:`h-3 w-3`,"aria-hidden":!0}),a(`access.credentialTable.clearSelection`,`Clear selection`)]}),i(O,{type:`button`,variant:`danger`,size:`sm`,disabled:s.busy,onClick:()=>void p(),children:[s.busy?o(d,{className:`h-3 w-3 animate-spin`,"aria-hidden":!0}):o(c,{className:`h-3 w-3`,"aria-hidden":!0}),a(`access.credentialTable.revoke`,{what:B(n.length,u)})]})]})]})}var G=(e,t)=>t===null?`—`:e.get(t)??t;function K(e,t){return e!=null&&e<=t?`expired`:`active`}function Ae(e,t,n){return{id:e.id,name:n.client(e.client),detail:e.ip,ownerId:e.userId,ownerName:G(t,e.userId),kind:n.method(e.method),scope:null,status:e.current?`current`:`active`,createdAt:e.createdAt,lastUsedAt:e.lastUsedAt,expiresAt:e.expiresAt}}function je(e,t){return{id:e.id,name:e.integrationId,detail:null,ownerId:e.userId,ownerName:e.username,kind:e.integrationId,scope:t,status:e.revokedAt===null?`active`:`revoked`,createdAt:e.createdAt,lastUsedAt:e.lastUsedAt,expiresAt:null}}var Me=`Scoped`,q=`Admin`;function Ne(e,t,n,r,i){return{id:e.id,name:e.name,detail:`${e.tokenPrefix}…`,ownerId:t,ownerName:G(n,t),kind:Me,scope:r,status:K(e.expiresAt,i),createdAt:e.createdAt,lastUsedAt:e.lastUsedAt??null,expiresAt:e.expiresAt??null}}function Pe(e,t,n){return{id:e.id,name:e.name,detail:`${e.tokenPrefix}…`,ownerId:e.createdBy,ownerName:G(t,e.createdBy),kind:q,scope:`Full administrator`,status:e.revokedAt===null?K(e.expiresAt,n):`revoked`,createdAt:e.createdAt,lastUsedAt:e.lastUsedAt,expiresAt:e.expiresAt}}var Fe={"grid-view":`Grid`,"events-view":`Events`};function Ie(e,t){return e.map(e=>t.get(e)??`#${String(e)}`).join(`, `)}function Le(e,t,n,r){let i=Fe[e.scope.kind];return{id:e.id,name:`${i} · ${String(e.scope.deviceIds.length)} camera${e.scope.deviceIds.length===1?``:`s`}`,detail:`${e.tokenPrefix}…`,ownerId:e.userId,ownerName:G(t,e.userId),kind:e.scope.talk===!0?`${i} + talk`:i,scope:Ie(e.scope.deviceIds,n),status:K(e.expiresAt,r),createdAt:e.createdAt,lastUsedAt:e.lastUsedAt??null,expiresAt:e.expiresAt}}function J(e){return`${e.provider}\u0000${e.subject}`}function Re(e,t){return{id:J(e),name:e.label??e.subject,detail:e.issuer,ownerId:e.userId,ownerName:G(t,e.userId),kind:e.provider,scope:null,status:`active`,createdAt:e.linkedAt,lastUsedAt:null,expiresAt:null}}function ze(e,t){let n=e.allowedProviders;return{id:e.id,name:e.label,detail:`${e.tokenPrefix}…`,ownerId:e.userId??null,ownerName:G(t,e.userId??null),kind:e.isAdmin===!0?`Admin`:`Regular`,scope:n===void 0||n===`*`?`All providers`:n.join(`, `)||`All providers`,status:`active`,createdAt:e.createdAt??null,lastUsedAt:e.lastUsedAt??null,expiresAt:null}}var Y=40,Be=[{test:/Electron\//,name:`CamStack desktop`},{test:/Edg(e|A|iOS)?\//,name:`Edge`},{test:/OPR\/|Opera/,name:`Opera`},{test:/Firefox\/|FxiOS\//,name:`Firefox`},{test:/Chrome\/|CriOS\//,name:`Chrome`},{test:/Version\/[\d.]+.*Safari\//,name:`Safari`}],Ve=[{test:/iPhone/,name:`iPhone`},{test:/iPad/,name:`iPad`},{test:/Android/,name:`Android`},{test:/Mac OS X|Macintosh/,name:`macOS`},{test:/Windows/,name:`Windows`},{test:/CrOS/,name:`ChromeOS`},{test:/Linux/,name:`Linux`}],He=[{test:/CFNetwork\/.*Darwin\//,name:`CamStack app on iOS`},{test:/^okhttp\//i,name:`CamStack app on Android`},{test:/^(node|undici)\b/i,name:`Script (Node.js)`},{test:/^curl\//i,name:`curl`}];function X(e,t){return e.find(e=>e.test.test(t))?.name??null}function Ue(e){return e.length<=Y?e:`${e.slice(0,Y)}…`}function Z(e){if(e===null||e.trim().length===0)return{label:j.t(`helpers.sessionClient.unknownDevice`),raw:null};let t=e.trim(),n=X(He,t);if(n!==null)return{label:n,raw:t};let r=X(Be,t),i=X(Ve,t);return r!==null&&i!==null?{label:j.t(`helpers.sessionClient.browserOnSystem`,{browser:r,system:i}),raw:t}:r===null?{label:Ue(t),raw:t}:{label:r,raw:t}}var We={password:`helpers.sessionClient.method.password`,passkey:`helpers.sessionClient.method.passkey`,sso:`helpers.sessionClient.method.sso`,handoff:`helpers.sessionClient.method.handoff`,exchange:`helpers.sessionClient.method.exchange`};function Q(e){let t=We[e];return t===void 0?e:j.t(t)}function $(e){if(e==null)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleString()}e();function Ge(e,t){return e instanceof Error&&e.message.length>0?e.message:t}function Ke(e){let{t}=M(),s=f(),[c,l]=n(!1),[u,p]=n(``),[m,h]=n(null),[g,y]=n(null),b=a(null),x=r(e=>{b.current?.(e),b.current=null,l(!1),p(``),h(null),y(null)},[]),S=r(()=>new Promise(e=>{b.current?.(null),b.current=e,y(null),l(!0)}),[]),ee=async()=>{h(`password`),y(null);try{let{reauthToken:e}=await s.reauthenticate({password:u});x(e)}catch(e){y(Ge(e,`Password is incorrect`)),h(null)}},C=async()=>{h(`passkey`),y(null);try{let{optionsJSON:e}=await s.reauthBeginPasskey();if(!ue(e))throw Error(`passkey authentication options missing challenge`);let t=await de({optionsJSON:e}),{reauthToken:n}=await s.reauthenticate({passkeyResponse:Object.fromEntries(Object.entries(t))});x(n)}catch(e){y(Ge(e,`Passkey verification failed`)),h(null)}};return{requestProof:S,dialog:o(E,{open:c,onOpenChange:e=>!e&&x(null),children:i(v,{children:[i(T,{children:[o(D,{children:t(`auth.reauthDialog.confirmItSYou`,`Confirm it’s you`)}),o(ae,{children:t(`auth.reauthDialog.needsPassword`,{action:e})})]}),i(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),u.length>0&&m===null&&ee()},children:[o(se,{type:`password`,autoComplete:`current-password`,placeholder:t(`auth.reauthDialog.currentPassword`,`Current password`),value:u,onChange:e=>p(e.target.value),"aria-label":t(`auth.reauthDialog.currentPassword`,`Current password`)}),g!==null&&o(`p`,{role:`alert`,className:`text-xs text-danger`,children:g}),i(w,{className:`flex flex-wrap gap-2`,children:[i(O,{type:`button`,variant:`outline`,disabled:m!==null,onClick:()=>void C(),children:[m===`passkey`?o(d,{className:`h-4 w-4 animate-spin`}):o(_,{className:`h-4 w-4`}),t(`auth.reauthDialog.useAPasskey`,`Use a passkey`)]}),i(O,{type:`submit`,disabled:u.length===0||m!==null,children:[m===`password`&&o(d,{className:`h-4 w-4 animate-spin`}),t(`common.confirm`,`Confirm`)]})]})]})]})})}}e();var qe={key:`access.nouns.shareLink`};function Je(e){let{t:r}=M(),i=re(),a=x.useUtils(),o=x.auth.listShareTokens.useQuery({owner:e}),s=me(),{data:l}=ce({isCamera:!0,projection:`slim`}),[u,d]=n(null),f=()=>void a.auth.listShareTokens.invalidate(),p=x.auth.revokeShareToken.useMutation({onSuccess:f,onError:e=>d(`Revoke failed: ${e.message}`)}),m=t(()=>{let e=new Map;for(let t of l??[])e.set(t.id,t.name);return e},[l]),h=Date.now(),g=(o.data??[]).map(e=>Le(e,s,m,h)),_=async e=>{await i({title:r(`users.shareLinksSection.revokeShareLink`,`Revoke share link`),message:r(`users.shareLinksSection.anyoneHoldingThisLinkTo`,`Anyone holding this link to {{value1}} loses access immediately. This cannot be undone.`,{value1:e.scope??e.name}),confirmLabel:r(`users.shareLinksSection.revoke`,`Revoke`),variant:`danger`})&&(d(null),p.mutate({id:e.id}))};return{rows:g,refresh:f,error:u,clearError:()=>d(null),isLoading:o.isLoading,loadError:o.isError?o.error?.message??`Request failed`:null,action:{label:r(`users.shareLinksSection.revoke`,`Revoke`),icon:c,isAvailable:()=>!0,onRun:e=>void _(e),busyId:p.isPending?p.variables?.id??null:null,disabled:p.isPending}}}function Ye(){let{t:e}=M(),t=Je(`self`);return o(N,{notice:P(t.error),onDismissNotice:t.clearError,id:`my-share-links`,title:e(`users.shareLinksSection.shareLinks`,`Share links`),icon:u,description:e(`users.shareLinksSection.viewOnlyLinksYouCreated`,`View-only links you created in the viewer app to share a grid or the events of some cameras. Revoking a link stops it working everywhere it was sent.`),children:o(W,{rows:t.rows,label:e(`users.shareLinksSection.shareLinks2`,`share links`),isLoading:t.isLoading,loadError:t.loadError,emptyText:`You have no share links.`,hideOwner:!0,action:t.action})})}function Xe(){let{user:e}=le();return e?.isAdmin?o(Ze,{}):null}function Ze(){let{t:e}=M(),t=Je(`all`),n=H(`share-link`,qe,t.refresh);return o(N,{notice:P(t.error,n.outcome),onDismissNotice:()=>{t.clearError(),n.dismiss()},id:`share-links`,title:e(`users.shareLinksSection.shareLinks`,`Share links`),icon:u,description:e(`users.shareLinksSection.everyUserSViewOnly`,`Every user's view-only share links. Revoking one stops it working for whoever it was sent to — a revoked link is deleted and cannot be restored.`),children:o(W,{rows:t.rows,label:e(`users.shareLinksSection.shareLinks2`,`share links`),isLoading:t.isLoading,loadError:t.loadError,emptyText:`No user has any share links.`,action:{...t.action,disabled:t.action.disabled||n.busy},bulk:{revoke:n,noun:qe,isSelectable:()=>!0,quickSelect:[{label:e(`users.shareLinksSection.selectExpired`,`Select expired`),match:e=>e.status===`expired`}]}})})}var Qe=864e5,$e={qr:`QR (by an admin)`,self:`Self-enrolled`},et={ios:`iOS`,android:`Android`,web:`Web`,other:`Other`};function tt(e){return e.status===`revoked`}function nt(e){return e.status!==`revoked`}function rt(e,t=`—`){if(e===null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:n.toLocaleString()}function it(e,t){return e===null||Number.isNaN(e)?null:Math.floor((e-t)/Qe)}function at(e,t){let n=it(e,t);return n===null?`unknown`:n<0?`expired`:n<30?`soon`:`ok`}function ot(e,t){let n=it(e,t);return n===null?j.t(`helpers.certificateModel.unknown`):n===0?j.t(`helpers.certificateModel.today`):n>0?j.t(`helpers.certificateModel.inDays`,{count:n}):j.t(`helpers.certificateModel.daysAgo`,{count:-n})}function st(e){if(e===null)return null;let t=Date.parse(e);return Number.isNaN(t)?null:t}function ct(e){return e===null||e.length===0?`—`:e.length<=17?e:`${e.slice(0,8)}…${e.slice(-8)}`}function lt(e){return e.length<=10?e:`${e.slice(0,10)}…`}function ut(e){if(!e.online)return{allowed:!1,reason:j.t(`helpers.certificateModel.nodeOffline`)};if(e.isHub&&e.https.kind===`served`){if(e.https.status.mode===`uploaded`)return{allowed:!1,reason:j.t(`helpers.certificateModel.uploadedCert`)};if(e.https.status.mode===`disabled`)return{allowed:!1,reason:j.t(`helpers.certificateModel.tlsDisabled`)}}return{allowed:!0,reason:null}}var dt={prepare:`helpers.certificateModel.stage.prepare`,issue:`helpers.certificateModel.stage.issue`,install:`helpers.certificateModel.stage.install`,reconnect:`helpers.certificateModel.stage.reconnect`,confirm:`helpers.certificateModel.stage.confirm`};function ft(e){if(e.ok)return{tone:`success`,message:j.t(`helpers.certificateModel.renewed`,{nodeId:e.nodeId,serial:lt(e.newSerial)})};let t=e.keptPreviousLeaf?j.t(`helpers.certificateModel.keptPrevious`):j.t(`helpers.certificateModel.maybeNoCert`);return{tone:`danger`,message:j.t(`helpers.certificateModel.renewalFailed`,{nodeId:e.nodeId,stage:j.t(dt[e.stage]),reason:e.reason,kept:t})}}function pt(e,t){let n=Math.max(0,e-t),r=Math.ceil(n/1e3),i=Math.floor(r/60),a=r%60;return{expired:n===0,label:`${String(i)}:${String(a).padStart(2,`0`)}`}}var mt=11;function ht(e,t){let n=e.slice(0,mt);return t===null?n:`${n} · ${t}`}function gt(e){return{id:e.id,name:e.deviceName,detail:ht(e.fingerprint,e.lastUsedFrom),ownerId:e.userId,ownerName:e.username??e.userId,kind:et[e.platform],scope:$e[e.enrolledVia],status:e.status,createdAt:e.issuedAt,lastUsedAt:e.lastUsedAt,expiresAt:e.expiresAt}}function _t(e,t){return{id:e.id,name:e.deviceName,detail:null,ownerId:null,ownerName:t,kind:et[e.platform],scope:null,status:e.status,createdAt:e.issuedAt,lastUsedAt:e.lastUsedAt,expiresAt:e.expiresAt}}function vt({sessions:e,isLoading:t,loadError:n,emptyText:r,onRevoke:a,revokingId:s}){let{t:c}=M();return t?i(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[o(d,{className:`h-3.5 w-3.5 animate-spin`}),c(`auth.sessionsList.loadingSessions`,`Loading sessions…`)]}):n===null?e.length===0?o(`div`,{className:`rounded border border-dashed border-border px-3 py-4 text-xs text-foreground-subtle text-center`,children:r}):o(`ul`,{className:`divide-y divide-border rounded-md border border-border`,children:e.map(e=>o(yt,{session:e,revoking:s===e.id,onRevoke:()=>a(e)},e.id))}):i(`div`,{className:`text-[11px] text-danger`,children:[c(`auth.sessionsList.couldNotLoadSessions`,`Could not load sessions:`),` `,n]})}function yt({session:e,revoking:t,onRevoke:n}){let{t:r}=M(),a=Z(e.client);return i(`li`,{"data-testid":`session-row`,className:`flex items-start gap-3 px-3 py-2 text-xs`,children:[o(m,{className:`h-3.5 w-3.5 mt-0.5 shrink-0 text-foreground-subtle`}),i(`div`,{className:`flex-1 min-w-0 space-y-0.5`,children:[i(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[o(`span`,{className:`font-medium text-foreground truncate`,title:a.raw??void 0,children:a.label}),e.current&&o(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary`,children:r(`auth.sessionsList.thisDevice`,`This device`)})]}),i(`div`,{className:`flex flex-wrap gap-x-3 text-[11px] text-foreground-subtle`,children:[o(`span`,{children:Q(e.method)}),o(`span`,{className:`font-mono`,children:e.ip??r(`auth.sessionsList.ipUnknown`,`IP unknown`)}),o(`span`,{children:r(`auth.sessionsList.lastActive`,{when:$(e.lastUsedAt)})}),o(`span`,{children:r(`auth.sessionsList.expires`,{when:$(e.expiresAt)})})]})]}),!e.current&&i(`button`,{onClick:n,disabled:t,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] text-danger hover:bg-danger/10 disabled:opacity-50`,children:[t?o(d,{className:`h-3 w-3 animate-spin`}):o(g,{className:`h-3 w-3`}),r(`auth.sessionsList.signOut`,`Sign out`)]})]})}export{H as A,ze as C,Ae as D,je as E,me as F,we as M,N,Ne as O,P,Pe as S,Re as T,Ke as _,nt as a,$ as b,ot as c,rt as d,ut as f,Ye as g,Xe as h,tt as i,Te as j,W as k,ft as l,lt as m,gt as n,pt as o,ct as p,_t as r,st as s,vt as t,at as u,Z as v,J as w,q as x,Q as y};
@@ -1 +0,0 @@
1
- import{ta as e}from"./player-overlays-Db_o1Zm2.js";var t=e(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]);export{t};