@camstack/addon-admin-ui 1.2.397 → 1.2.399
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.
- package/dist/assets/{AddonAssetIcon-7ZvCceV6.js → AddonAssetIcon-DRk5tFmQ.js} +1 -1
- package/dist/assets/{AddonIntegrationBody-CmsA9jC5.js → AddonIntegrationBody-BokvIE2T.js} +1 -1
- package/dist/assets/Addons-eoG6yhVR.js +4 -0
- package/dist/assets/{AdminPage-eik5HL7w.js → AdminPage-LJSPjGaV.js} +1 -1
- package/dist/assets/{AdminSectionedPage-Dj5EzIqk.js → AdminSectionedPage-Dmz5o8uT.js} +1 -1
- package/dist/assets/AiProfiles-CeyoQkna.js +3 -0
- package/dist/assets/BrokerForm-UsE-opKN.js +1 -0
- package/dist/assets/Build-BJTgUvs3.js +40 -0
- package/dist/assets/{Calendars-DF3EOrCw.js → Calendars-hNy0XH9U.js} +1 -1
- package/dist/assets/Cluster-DL2F6C0r.js +1 -0
- package/dist/assets/ClusterStepModel-BMV2GNMb.js +1 -0
- package/dist/assets/CompositionEditor-D8K5gqDy.js +1 -0
- package/dist/assets/{CompositionEditorPage-BOTNyxzw.js → CompositionEditorPage-BcxlauFW.js} +1 -1
- package/dist/assets/Data-DJzLYSz8.js +1 -0
- package/dist/assets/DeviceDetail-BxQ2qayC.js +2 -0
- package/dist/assets/{DeviceDoActionFields-DPIQv0Gp.js → DeviceDoActionFields-CvF7Gep-.js} +1 -1
- package/dist/assets/{Devices-X3jFUswR.js → Devices-CLznFJt2.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-CXBuVqsj.js → EmbedPlayerPage-CZkHg-Z5.js} +1 -1
- package/dist/assets/Identity-DQuyqFAW.js +1 -0
- package/dist/assets/IntegrationDetail-ClkIqZkc.js +1 -0
- package/dist/assets/Integrations-Di2rQcGB.js +1 -0
- package/dist/assets/Integrations-tr28SRdu.js +1 -0
- package/dist/assets/Library-BoOL6cQN.js +1 -0
- package/dist/assets/Locations-ddLOQn97.js +3 -0
- package/dist/assets/{Logs-C8EFuHw0.js → Logs-DOMXl7b_.js} +1 -1
- package/dist/assets/{MotionZonesSettings-BQocc7WN.js → MotionZonesSettings-VFYF5C3z.js} +1 -1
- package/dist/assets/MyAccess-BvNfguhI.js +2 -0
- package/dist/assets/Network-xLYgrYEu.js +1 -0
- package/dist/assets/{NodeAddonsSettingsPanel-BCFsPpmx.js → NodeAddonsSettingsPanel-DNm2sNWd.js} +1 -1
- package/dist/assets/Notifications-C77viP5y.js +1 -0
- package/dist/assets/{PrivacyMaskSettings-CIOFdwm5.js → PrivacyMaskSettings-CcLxP0Q6.js} +1 -1
- package/dist/assets/Recordings-a6r7fxRd.js +1 -0
- package/dist/assets/{ScanNetworkModal-C9-sEf0w.js → ScanNetworkModal-yeTJMkLN.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-B4Xa4X5o.js → SceneMonitorEditor-DB1NGsuu.js} +1 -1
- package/dist/assets/SessionsList-JKR36vEz.js +2 -0
- package/dist/assets/{Showroom-DbgC7jrf.js → Showroom-uPs2cinU.js} +1 -1
- package/dist/assets/{System-UCSG2wyb.js → System-iyC6su3q.js} +1 -1
- package/dist/assets/{Terminal-BN5uwTST.js → Terminal-B_bk9YuG.js} +3 -3
- package/dist/assets/{Viewer-sX4O6bY5.js → Viewer-hCw4DvsX.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-D6MiVNmX.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-D4evVvwt.js} +1 -1
- package/dist/assets/{archive-C3YvN3bo.js → archive-D3wNUMUT.js} +1 -1
- package/dist/assets/{authed-media-CadypKga.js → authed-media-B-33JcKf.js} +1 -1
- package/dist/assets/{boxes-I78qynMn.js → boxes-PrddLfOG.js} +1 -1
- package/dist/assets/circle-slash-BOrPYytm.js +1 -0
- package/dist/assets/client-1JBRoe76.js +357 -0
- package/dist/assets/crop-ChT009Qt.js +1 -0
- package/dist/assets/{device-integration-icon-DqKmRTQS.js → device-integration-icon-BVEgrVH7.js} +1 -1
- package/dist/assets/device-picker-model-DD88fyzH.js +1 -0
- package/dist/assets/dist-CEvY94M_.js +357 -0
- package/dist/assets/{dist-BXnRXTui.js → dist-_pgvIUGn.js} +1 -1
- package/dist/assets/{format-size-D8E_VMta.js → format-size-CI1h5otl.js} +1 -1
- package/dist/assets/{history-GFLGqkV_.js → history-B0sqAabA.js} +1 -1
- package/dist/assets/{hostInit-iPWvYWG7.js → hostInit-D4-UgrFJ.js} +1 -1
- package/dist/assets/{index-DtcBoptX.css → index-C6r9IlW4.css} +1 -1
- package/dist/assets/index-V6k1XLI7.js +4 -0
- package/dist/assets/{layers-D5TeeKqH.js → layers-Bg1NrUAX.js} +1 -1
- package/dist/assets/{location-owned-usage-DmAH-1FL.js → location-owned-usage-CG3xos_0.js} +1 -1
- package/dist/assets/log-in-DwkWn-LJ.js +1 -0
- package/dist/assets/{mf-entry-bootstrap-0-53adc98f.js → mf-entry-bootstrap-0-0ee3f006.js} +2 -2
- package/dist/assets/{monitor-smartphone-CEvv3FjX.js → monitor-smartphone-J97h7fMI.js} +1 -1
- package/dist/assets/mount-DD88fyzH.js +1 -0
- package/dist/assets/notification-schedule-field-Bnhm4lQH.js +1 -0
- package/dist/assets/{octagon-alert-bX5m_c3-.js → octagon-alert-D1Sw5N86.js} +1 -1
- package/dist/assets/{player-overlays-mP7nvLXZ.js → player-overlays-9CMoB0XN.js} +1 -1
- package/dist/assets/remoteEntry-nN8yf3LF.js +1 -0
- package/dist/assets/{send-3vh-Sv9u.js → send-D9__QB6r.js} +1 -1
- package/dist/assets/{settings-2-CIYonoB2.js → settings-2-DEwPBiUG.js} +1 -1
- package/dist/assets/{src-BeE19PxU.js → src-Ca4gNAmP.js} +8 -8
- package/dist/assets/{use-scenes-feed-Dch15Gtk.js → use-scenes-feed-72EeOPdE.js} +1 -1
- package/dist/assets/{use-stationary-objects-CAgVm5qH.js → use-stationary-objects-BxmIxHKh.js} +1 -1
- package/dist/assets/useEventInvalidation-DD88fyzH.js +1 -0
- package/dist/assets/{useNodeUrlSelection-C2aUQ5pz.js → useNodeUrlSelection-CM809DR6.js} +1 -1
- package/dist/assets/user-round-BuAM59Jp.js +1 -0
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-D2o8TmMv.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-qbX0hoWb.js} +2 -2
- package/dist/index.html +28 -10
- package/dist/server/addon.js +9 -2
- package/package.json +1 -1
- package/dist/assets/Addons-B0lqxfjl.js +0 -4
- package/dist/assets/AiProfiles-BYQcaDzE.js +0 -3
- package/dist/assets/BrokerForm-Oa4W78DW.js +0 -1
- package/dist/assets/Build-DTkrXnV9.js +0 -40
- package/dist/assets/Cluster-9ZOqQRY0.js +0 -1
- package/dist/assets/ClusterStepModel-ZEYxPYn0.js +0 -1
- package/dist/assets/CompositionEditor-Cv06FJwk.js +0 -1
- package/dist/assets/Data-Ct8SqRSf.js +0 -1
- package/dist/assets/DeviceDetail-Dn0-0JDf.js +0 -2
- package/dist/assets/Identity-bdrVgYed.js +0 -1
- package/dist/assets/IntegrationDetail-BFt35GRb.js +0 -1
- package/dist/assets/Integrations-TPrR0bGF.js +0 -1
- package/dist/assets/Integrations-vjs0FPms.js +0 -1
- package/dist/assets/Library-Ck49o54W.js +0 -1
- package/dist/assets/Locations-aqPkrde8.js +0 -3
- package/dist/assets/MyAccess-C8p-J8wW.js +0 -2
- package/dist/assets/Network-CaDC37pB.js +0 -1
- package/dist/assets/Notifications-B2CuenV0.js +0 -1
- package/dist/assets/Recordings-1xAqwANe.js +0 -1
- package/dist/assets/SessionsList-0Ev1b1-K.js +0 -2
- package/dist/assets/circle-slash-C5FeKGvp.js +0 -1
- package/dist/assets/client-D5nV-lIF.js +0 -357
- package/dist/assets/crop-GRVPmcCZ.js +0 -1
- package/dist/assets/device-picker-model-irtdVS9Y.js +0 -1
- package/dist/assets/dist-CgEPs7ts.js +0 -357
- package/dist/assets/index-I1VJhtqM.js +0 -4
- package/dist/assets/mount-irtdVS9Y.js +0 -1
- package/dist/assets/notification-schedule-field-B_0lw5Ql.js +0 -1
- package/dist/assets/remoteEntry-P7nyMvXh.js +0 -1
- package/dist/assets/useEventInvalidation-irtdVS9Y.js +0 -1
- package/dist/assets/user-round-D2N1DqIB.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as e,Q as t,S as n,W as r,b as i,o as a,q as o,x as s,z as c}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{Y as l,ct as u,ot as d,vt as f,yt as p}from"./player-overlays-mP7nvLXZ.js";import{$c as m,Ac as h,An as g,Cr as _,Ed as v,Fc as y,Fd as b,Ff as x,Fn as S,Hd as C,Ht as w,Ic as T,In as E,Jc as D,Js as O,Kc as k,Kn as A,Mc as j,Mn as ee,Nc as M,Pc as te,Pn as ne,Qc as N,Qn as re,Uc as ie,Un as P,Ut as ae,Vc as oe,Wc as F,Ws as se,Xc as ce,Yc as le,Yd as ue,Zc as de,Zd as I,br as L,bs as fe,el as pe,fs as me,jc as he,jn as ge,kc as _e,ku as R,ms as ve,mu as ye,nl as be,qc as xe,qn as z,rf as Se,rl as Ce,rr as B,su as V,tl as we,uu as H,vs as Te,ya as U}from"./src-BeE19PxU.js";import{c as Ee,i as De,l as Oe,n as ke,o as Ae,r as je,s as Me,t as Ne,u as Pe}from"./location-owned-usage-DmAH-1FL.js";import{t as W}from"./format-size-D8E_VMta.js";import{vi as G}from"./client-D5nV-lIF.js";import{t as Fe}from"./useTranslation-Bc5yH9V9.js";import{C as Ie,O as Le}from"./index-I1VJhtqM.js";import{t as Re}from"./AdminSectionedPage-Dj5EzIqk.js";import{n as ze}from"./authed-media-CadypKga.js";var K=p(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),Be=p(`scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]);t();var Ve=[{value:`all`,label:`All`},{value:`recording`,label:`Recordings`},{value:`events`,label:`Events`}],He={recording:`bg-primary/10 text-primary`,events:`bg-violet-500/10 text-violet-400`},Ue={columnKey:`at`,dir:`desc`};function We(e){return new Date(e).toLocaleString()}function Ge(){let[e,t]=o(`all`),{data:a,isLoading:c,isError:l}=he({},{refetchOnWindowFocus:!1}),{data:u,isLoading:d,isError:f}=Te({},{refetchOnWindowFocus:!1}),{data:p}=U({isCamera:!0,projection:`slim`}),m=r(()=>{let e=new Map;for(let t of p??[])e.set(t.id,t.name);return e},[p]),h=r(()=>{let t=[...a??[],...u??[]];return(e===`all`?t:t.filter(t=>t.domain===e)).toSorted((e,t)=>t.at-e.at)},[a,u,e]),g=r(()=>{let t=[];return l&&e!==`events`&&t.push(`Recordings`),f&&e!==`recording`&&t.push(`Events`),t},[l,f,e]),_=r(()=>[{key:`at`,header:`When`,nowrap:!0,sortValue:e=>e.at,render:e=>s(`span`,{className:`text-foreground-subtle tabular-nums`,children:We(e.at)})},{key:`domain`,header:`Domain`,sortValue:e=>e.domain,render:e=>s(`span`,{className:`inline-flex rounded px-1.5 py-0.5 text-[10px] font-medium ${He[e.domain]}`,children:e.domain})},{key:`op`,header:`Operation`,sortValue:e=>e.op,render:e=>s(`span`,{className:`text-foreground`,children:e.op})},{key:`reason`,header:`Reason`,sortValue:e=>e.reason,render:e=>s(`span`,{className:`text-foreground-subtle`,children:e.reason})},{key:`device`,header:`Camera`,sortValue:e=>e.deviceId===null?`cluster`:m.get(e.deviceId)??`#${String(e.deviceId)}`,render:e=>e.deviceId===null?s(`span`,{className:`text-foreground-subtle`,children:`cluster`}):s(`span`,{className:`text-foreground`,children:m.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`items`,header:`Items`,align:`right`,nowrap:!0,sortValue:e=>e.itemsAffected,render:e=>s(`span`,{className:`tabular-nums`,children:e.itemsAffected.toLocaleString()})},{key:`bytes`,header:`Reclaimed`,align:`right`,nowrap:!0,sortValue:e=>e.bytesReclaimed,render:e=>s(`span`,{className:`tabular-nums`,children:e.bytesReclaimed>0?W(e.bytesReclaimed):`—`})}],[m]),y=c||d;return n(`div`,{className:`flex flex-col gap-4`,children:[s(`div`,{className:`flex items-center gap-1`,children:Ve.map(n=>s(`button`,{onClick:()=>t(n.value),className:`rounded px-2 py-1 text-xs font-medium ${e===n.value?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-muted`}`,children:n.label},n.value))}),y&&h.length===0?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(v,{className:`h-4 w-4 animate-spin`}),`Loading activity…`]}):h.length===0?g.length>0?s(P,{icon:R,title:`Activity could not be read`,description:`The ${g.join(` and `)} ops log did not answer. This is not "nothing happened" — retry, or check the node that owns it.`}):s(P,{icon:x,title:`No activity yet`,description:`Prune, delete and rescan operations across recordings and events show up here.`}):n(i,{children:[g.length>0&&n(`p`,{className:`flex items-center gap-1.5 text-[11px] text-amber-500`,children:[s(R,{className:`h-3 w-3 shrink-0`}),g.join(` and `),` did not answer — rows from`,` `,g.length===1?`that domain`:`those domains`,` are missing below.`]}),s(w,{columns:_,rows:h,rowKey:e=>e.id,minWidthPx:720,mobileMode:`scroll`,maxBodyHeight:ae,defaultSort:Ue})]})]})}t();function Ke(){let e=U({isCamera:!0,projection:`slim`}),t=r(()=>(e.data??[]).toSorted((e,t)=>e.name.localeCompare(t.name)),[e.data]),[i,a]=o(null),c=i??t[0]?.id??null;return!e.isLoading&&t.length===0?s(P,{icon:f,title:`No cameras`,description:`Add a camera first.`}):n(`div`,{className:`space-y-3`,children:[n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Per-camera recording & retention`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`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.`})]}),n(`div`,{className:`flex items-center gap-2`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Camera`}),s(`select`,{value:c??``,onChange:e=>a(Number(e.target.value)),className:`rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:t.map(e=>s(`option`,{value:e.id,children:e.name},e.id))})]}),c!==null&&s(re,{deviceId:c,children:s(Le,{deviceId:c,sectionFilter:e=>e.location===`top-tab`&&e.tab===`recording`})},c)]})}t();function qe({types:e}){let t=a(),i=B(),{data:c}=F({}),l=ie(),u=r(()=>l.data??[],[l.data]),{data:d}=h({},{refetchOnWindowFocus:!1}),f=r(()=>Ne(c??[],d?.locations),[c,d?.locations]),[p,m]=o(null),[g,_]=o(null),v=()=>{t.invalidateQueries({queryKey:[[`storage`,`listLocations`]]})},y=Ce({onSuccess:v}),b=oe({onSuccess:v}),x=r(()=>{let e=new Map;for(let t of c??[]){let n=e.get(t.type);n?n.push(t):e.set(t.type,[t])}return e},[c]),S=async(e,t)=>{Oe(t)&&!await i({title:`Disable "${e.displayName}"?`,message:`${Ee(t).consequence}\n\nNothing is deleted — set the location back to Read-only or Active to bring its footage back.`,confirmLabel:`Disable`,variant:`danger`})||y.mutate(Me(e,{mode:t}))},C=async e=>{if(await i({title:`Delete location "${e.displayName}"?`,message:`Removes the record; files on disk are untouched.`,confirmLabel:`Delete`,variant:`danger`}))try{await b.mutateAsync({id:e.id})}catch(t){await i({title:`Delete anyway?`,message:`${t instanceof Error?t.message:String(t)}\n\nForcing removes the record only. Anything still on that location becomes unreachable.`,confirmLabel:`Force delete`,variant:`danger`})&&b.mutate({id:e.id,force:!0})}},w=e.map(e=>u.find(t=>t.id===e)).filter(e=>e!==void 0);return n(`div`,{className:`space-y-3`,children:[w.length===0?s(`p`,{className:`text-[11px] text-foreground-subtle italic`,children:`No storage locations declared for this purpose.`}):w.map(e=>s(ke,{type:e.id,displayName:e.displayName,description:e.description,cardinality:e.cardinality,locations:x.get(e.id)??[],onAdd:e=>m(e),onEdit:e=>_(e),onDelete:e=>{C(e)},ownedBytesById:f,onSetMode:(e,t)=>{S(e,t)}},e.id)),p!==null&&s(Pe,{initialType:p,onClose:()=>m(null),onCreated:()=>{v(),m(null)}}),g!==null&&s(Ae,{location:g,onClose:()=>_(null),onSaved:()=>{v(),_(null)}})]})}t();var Je=`pipeline-analytics`;function Ye(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 Xe(){let e=a(),{nodes:t}=V(),{data:i,isLoading:o}=L({addonId:Je}),c=Ye(i),l=_({onSuccess:()=>{e.invalidateQueries({queryKey:[[`addonSettings`,`getGlobalSettings`]]})}}),u=r(()=>{let e=t.filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,c,...e])].filter(Boolean)},[t,c]);return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Post-processing node`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`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.`}),n(`div`,{className:`mt-3 flex items-center gap-2`,children:[o?s(v,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):s(`select`,{value:c,onChange:e=>{e.target.value!==c&&l.mutate({addonId:Je,patch:{postProcessingNodeId:e.target.value}})},disabled:l.isPending,className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:u.map(e=>s(`option`,{value:e,children:e===`hub`?`hub (default)`:e},e))}),l.isPending&&s(v,{className:`h-4 w-4 animate-spin text-primary`})]})]}),n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Events folder`}),s(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:`Where event crops / full frames are stored. A single folder — no collection / equal-splitting.`}),s(qe,{types:[`eventMedia`]})]})]})}t();var Ze=[[`pipelineAnalytics`]],Qe=1440*60*1e3;function $e(e,t){return t.get(e)??`Removed camera #${String(e)}`}var et=[{days:1,label:`1 day`},{days:7,label:`7 days`},{days:30,label:`30 days`},{days:90,label:`90 days`}];function tt(){let t=a(),i=B(),[c,d]=o(30),[f,p]=o(null),{data:m,isLoading:h}=ve({},{refetchOnWindowFocus:!1}),{data:g}=U({isCamera:!0,projection:`slim`}),_=r(()=>{let e=new Map;for(let t of g??[])e.set(t.id,t.name);return e},[g]),y=e(()=>{t.invalidateQueries({queryKey:Ze})},[t]),b=fe({onSuccess:y}),x=me(),S=e(async()=>{await i({title:`Prune events older than ${String(c)} day${c===1?``:`s`}?`,message:`Permanently deletes every event (motion / object / audio) older than the cutoff across all cameras, and their media. This cannot be undone.`,confirmLabel:`Prune events`,variant:`danger`})&&b.mutate({olderThanMs:Date.now()-c*Qe,reason:`retention`})},[i,b,c]),C=e(async e=>{let t=$e(e.deviceId,_);if(await i({title:`Delete all events for ${t}?`,message:`Permanently deletes ${String(e.rows)} event${e.rows===1?``:`s`} (${W(e.bytes)} of media) for this camera. This cannot be undone.`,confirmLabel:`Delete events`,variant:`danger`})){p(null);try{let n=await x.mutateAsync({deviceId:e.deviceId});y();let r=n.motion+n.object+n.audio;if(r===0&&e.bytes>0){p(`0 events deleted for ${t}. Media still listed (${W(e.bytes)}) — those blobs are not event rows; use Management → Count leftovers or Disk reconcile.`);return}p(`Deleted ${String(r)} event${r===1?``:`s`} for ${t}.`)}catch(e){p(e instanceof Error?e.message:String(e))}}},[i,x,_,y]),T=r(()=>[{key:`camera`,header:`Camera`,render:e=>s(`span`,{className:`text-foreground`,children:$e(e.deviceId,_)})},{key:`rows`,header:`Events`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:e.rows.toLocaleString()})},{key:`bytes`,header:`Media`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:W(e.bytes)})},{key:`actions`,header:``,align:`right`,render:e=>n(`button`,{onClick:()=>{C(e)},disabled:x.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:`Delete all events for this camera`,children:[s(u,{className:`h-3 w-3`}),`Delete`]})}],[_,C,x.isPending]);return h&&!m?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(v,{className:`h-4 w-4 animate-spin`}),`Loading event-store footprint…`]}):m?n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[s(l,{label:`Total events`,icon:s(I,{className:`h-3 w-3`}),footer:`across ${String(m.devices.length)} camera${m.devices.length===1?``:`s`}`,children:m.totalRows.toLocaleString()}),s(l,{label:`Event media on disk`,children:W(m.totalBytes)})]}),n(`section`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[s(`span`,{className:`text-foreground-subtle`,children:`Prune events older than`}),s(`select`,{value:c,onChange:e=>d(Number(e.target.value)),className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:et.map(e=>s(`option`,{value:e.days,children:e.label},e.days))}),n(`button`,{onClick:()=>{S()},disabled:b.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:[b.isPending?s(v,{className:`h-3 w-3 animate-spin`}):s(Be,{className:`h-3 w-3`}),`Prune now`]})]}),m.devices.length===0?s(P,{icon:I,title:`No stored events`,description:`No camera has persisted events yet.`}):s(w,{columns:T,rows:[...m.devices],rowKey:e=>e.deviceId,minWidthPx:480}),f===null?null:s(`p`,{className:f.startsWith(`Deleted `)?`text-[11px] text-foreground-subtle`:`text-[11px] text-destructive`,children:f})]}):s(P,{icon:I,title:`No event data`,description:`Pipeline analytics has not reported any event-store footprint yet.`})}function nt(){return n(`div`,{className:`flex flex-col gap-8`,children:[n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Event store`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`What the durable event store occupies, per camera, with fleet-wide prune-by-age and delete-all-events.`}),s(`div`,{className:`mt-3`,children:s(tt,{})})]}),n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Post-processing node & folders`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that writes event crops, and the storage location they land in.`}),s(`div`,{className:`mt-3`,children:s(Xe,{})})]})]})}function rt(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 it(e){return new Date(e).toLocaleString(void 0,{day:`2-digit`,month:`short`,hour:`2-digit`,minute:`2-digit`})}function at(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`${it(e)} · ${o}`}function ot(e,t){let n=e-t;if(n<=0)return`expired`;let r=Math.floor(n/6e4);if(r<60)return`in ${String(r)}m`;let i=Math.floor(r/60);return i<24?`in ${String(i)}h`:`in ${String(Math.floor(i/24))}d`}function st(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})}t();var ct=[`high`,`mid`,`low`],lt=[{value:1,label:`Real time (1×)`},{value:2,label:`2×`},{value:4,label:`4×`},{value:8,label:`8×`},{value:16,label:`16×`}],ut=10080*60*1e3;function dt(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 ft({onClose:e,onCreated:t}){let i=U({isCamera:!0,projection:`slim`}),a=r(()=>(i.data??[]).toSorted((e,t)=>e.name.localeCompare(t.name)),[i.data]),[c,l]=o(``),[u,d]=o(`high`),[f,p]=o(dt(60)),[m,h]=o(dt(0)),[_,v]=o(1),[y,b]=o(!0),[x,w]=o(``),[T,D]=o(null),O=c===``?a[0]?.id??null:c,k=new Date(f).getTime(),j=new Date(m).getTime(),M=Number.isFinite(k)&&Number.isFinite(j)&&k<j,N=te({onSuccess:()=>{t(),e()},onError:e=>D(e instanceof Error?e.message:String(e))});return s(g,{open:!0,onOpenChange:t=>!t&&e(),children:n(ee,{width:`md`,placement:`sheet-on-mobile`,scroll:`body`,children:[s(S,{children:n(E,{className:`flex items-center gap-1.5`,children:[s(C,{className:`h-3.5 w-3.5`}),`New export`]})}),n(ge,{className:`space-y-3`,children:[n(`div`,{className:`grid grid-cols-2 gap-3`,children:[n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Camera`}),s(`select`,{value:O??``,onChange:e=>l(Number(e.target.value)),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:a.map(e=>s(`option`,{value:e.id,children:e.name},e.id))})]}),n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Profile`}),s(`select`,{value:u,onChange:e=>d(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:ct.map(e=>s(`option`,{value:e,children:e},e))})]})]}),n(`div`,{className:`grid grid-cols-2 gap-3`,children:[n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`From`}),s(`input`,{type:`datetime-local`,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`})]}),n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`To`}),s(`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`})]})]}),n(`div`,{className:`grid grid-cols-2 gap-3`,children:[n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Speed`}),s(`select`,{value:_,onChange:e=>v(Number(e.target.value)),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:lt.map(e=>s(`option`,{value:e.value,children:e.label},e.value))})]}),n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Title (optional)`}),s(`input`,{type:`text`,value:x,onChange:e=>w(e.target.value),placeholder:`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`})]})]}),n(`label`,{className:`flex items-center gap-2 text-xs text-foreground cursor-pointer`,children:[s(`input`,{type:`checkbox`,checked:y,disabled:_!==1,onChange:e=>b(e.target.checked),className:`accent-primary`}),`Include audio`,_===1?``:` (real-time only)`]}),!M&&s(`p`,{className:`text-[11px] text-danger`,children:`"From" must be before "To".`}),T&&s(`p`,{className:`text-[11px] text-danger`,children:T})]}),n(ne,{children:[s(A,{variant:`outline`,size:`sm`,onClick:e,children:`Cancel`}),s(A,{size:`sm`,onClick:()=>{if(O===null||!M)return;D(null);let e=x.trim();N.mutate({deviceId:O,profile:u,fromMs:k,toMs:j,options:{includeAudio:y,maxLifeMs:ut,deleteAfterDownload:!1,..._===1?{}:{speed:_},...e.length>0?{title:e}:{}}})},disabled:O===null||!M||N.isPending,children:N.isPending?`Queuing…`:`Create export`})]})]})})}t();var pt=[[`recordingExport`]],mt={queued:{cls:`bg-muted text-foreground-subtle`,label:`queued`},rendering:{cls:`bg-primary/10 text-primary`,label:`rendering`,spin:!0},ready:{cls:`bg-success/10 text-success`,label:`ready`},failed:{cls:`bg-danger/10 text-danger`,label:`failed`},expired:{cls:`bg-muted text-foreground-subtle`,label:`expired`},deleted:{cls:`bg-muted text-foreground-subtle`,label:`deleted`}};function ht(){let{data:e,isLoading:t}=T({},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data??[]).some(e=>e.state===`queued`||e.state===`rendering`)?3e3:!1}),{map:n}=H(G.RecordingExportProgress,e=>e.exportId),{map:i}=H(G.RecordingExportCompleted,e=>e.exportId),{map:a}=H(G.RecordingExportFailed,e=>e.exportId);return{rows:r(()=>st(e??[],n,i,a),[e,n,i,a]),isLoading:t}}function gt(e){let[t,n]=o(()=>Date.now());return c(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function _t(){let t=a(),[i,c]=o(!1),l=()=>{t.invalidateQueries({queryKey:[[`recordingExport`,`listExports`]]})},f=B(),p=d().trpcClient,m=gt(6e4),{rows:h,isLoading:g}=ht(),{data:_}=U({isCamera:!0,projection:`slim`}),b=r(()=>{let e=new Map;for(let t of _??[])e.set(t.id,t.name);return e},[_]),x=e(()=>{t.invalidateQueries({queryKey:pt})},[t]),S=M({onSuccess:x}),T=y({onSuccess:x}),[E,D]=o(null),O=e(async e=>{D(e.id);try{let{url:t}=await p.recordingExport.getDownloadUrl.query({exportId:e.id}),n=await ze(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),x()}finally{D(null)}},[p,x]),k=e(async e=>{await f({title:`Cancel this export?`,message:`Stops the render. The partial file is discarded.`,confirmLabel:`Cancel export`,variant:`danger`})&&S.mutate({exportId:e.id})},[f,S]),A=e(async e=>{await f({title:`Delete this export?`,message:`Permanently removes the rendered file and its history row.`,confirmLabel:`Delete`,variant:`danger`})&&T.mutate({exportId:e.id})},[f,T]),j=r(()=>[{key:`camera`,header:`Camera`,render:e=>s(`span`,{className:`text-foreground`,children:b.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`range`,header:`Range`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:at(e.fromMs,e.toMs)})},{key:`variant`,header:`Variant`,render:e=>s(`span`,{className:`text-foreground-subtle`,children:rt(e.options)})},{key:`state`,header:`State`,render:e=>{let t=mt[e.state];return n(`span`,{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium ${t.cls}`,children:[t.spin&&s(v,{className:`h-2.5 w-2.5 animate-spin`}),t.label,e.state===`rendering`&&e.progressPct!==null&&n(`span`,{className:`tabular-nums`,children:[e.progressPct,`%`]})]})}},{key:`expiry`,header:`Expires`,nowrap:!0,render:e=>e.state===`deleted`?s(`span`,{className:`text-foreground-subtle`,children:`—`}):s(`span`,{className:`text-foreground-subtle tabular-nums`,children:ot(e.expiresAt,m)})},{key:`size`,header:`Size`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:e.fileBytes===null?`—`:W(e.fileBytes)})},{key:`actions`,header:``,align:`right`,render:e=>{let t=e.state===`ready`,r=e.state===`queued`||e.state===`rendering`,i=e.state!==`deleted`;return n(`div`,{className:`flex items-center justify-end gap-1`,children:[t&&n(`button`,{onClick:()=>{O(e)},disabled:E===e.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:`Download MP4`,children:[E===e.id?s(v,{className:`h-3 w-3 animate-spin`}):s(ue,{className:`h-3 w-3`}),`Download`]}),r&&n(`button`,{onClick:()=>{k(e)},disabled:S.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:`Cancel render`,children:[s(Se,{className:`h-3 w-3`}),`Cancel`]}),i&&s(`button`,{onClick:()=>{A(e)},disabled:T.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:`Delete export`,children:s(u,{className:`h-3 w-3`})})]})}}],[b,m,E,S.isPending,T.isPending,O,k,A]);return g&&h.length===0?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(v,{className:`h-4 w-4 animate-spin`}),`Loading exports…`]}):n(`div`,{className:`space-y-3`,children:[s(`div`,{className:`flex justify-end`,children:n(`button`,{onClick:()=>c(!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:[s(C,{className:`h-3.5 w-3.5`}),`New export`]})}),h.length===0?s(P,{icon:C,title:`No exports yet`,description:`Create one here (New export) or from a camera's timeline in the viewer. Rendered clips show up here to download or manage.`}):s(w,{columns:j,rows:h,rowKey:e=>e.id,minWidthPx:720}),i&&s(ft,{onClose:()=>c(!1),onCreated:l})]})}var vt=`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`;t();var yt=`storage-migration`,bt=new Set([`orphans`,`debug-media`,`ghost-ledger`]);function xt(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 St(){let e=z(yt);return e===`pending`?null:e===`unknown`?s(`p`,{className:`py-2 text-xs text-foreground-subtle`,children:`Could not check whether storage cleanup is installed on this hub.`}):e===`present`?s(Ct,{}):null}function Ct(){let e=B(),[t,r]=o(!1),[i,a]=o(null),c=le({},{refetchInterval:2e3}),l=c.data??null,d=l!==null&&bt.has(l.phase),f=D(),p=xe(),m=async()=>{if(await e({title:`Run storage cleanup?`,message:t?`Reclaims leftover analytics rows and files, debug stills/filmstrips, and ghost footage rows on frozen locations. Safe to re-run.`:`Reclaims leftover analytics rows and files, and ghost footage rows on frozen locations. Debug stills are left alone. Safe to re-run.`,confirmLabel:`Run cleanup`,variant:`danger`})){a(null);try{await f.mutateAsync({includeDebugMedia:t}),await c.refetch()}catch(e){a(e instanceof Error?e.message:String(e))}}},h=async()=>{if(l&&await e({title:`Cancel cleanup?`,message:`Stops after the current step. Work already done stays done.`,confirmLabel:`Cancel cleanup`,variant:`danger`}))try{await p.mutateAsync({jobId:l.jobId}),await c.refetch()}catch{}};return n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Cleanup`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`One pass over leftover analytics (database + files) and ghost footage rows on frozen locations. Does not time out — progress updates here until it finishes.`}),n(`label`,{className:`mt-3 flex items-start gap-2 text-[11px] text-foreground`,children:[s(`input`,{type:`checkbox`,checked:t,disabled:d,onChange:e=>{r(e.target.checked)},className:`mt-0.5 h-3.5 w-3.5 accent-primary`}),s(`span`,{children:`Also remove debug media (motion stills and track filmstrips)`})]}),n(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[n(`button`,{type:`button`,disabled:d||f.isPending,onClick:()=>{m()},className:vt,children:[(d||f.isPending)&&s(v,{className:`h-3 w-3 animate-spin`}),s(u,{className:`h-3 w-3`}),`Run cleanup`]}),d&&s(`button`,{type:`button`,onClick:()=>{h()},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:`Cancel`})]}),i&&s(`p`,{className:`mt-2 text-[11px] text-danger`,children:i}),l&&n(`div`,{className:`mt-3 space-y-1 rounded-md border border-border px-2.5 py-2`,children:[n(`p`,{className:`text-xs text-foreground`,children:[`Phase: `,s(`span`,{className:`font-medium`,children:l.phase}),d&&s(v,{className:`ml-2 inline h-3 w-3 animate-spin text-primary`})]}),l.detail&&s(`p`,{className:`text-[11px] text-foreground-subtle`,children:l.detail}),s(`p`,{className:`text-[11px] text-foreground-subtle`,children:xt(l)}),l.error&&s(`p`,{className:`text-[11px] text-danger`,children:l.error})]})]})}t();var wt=2e3;function Tt(){let e=B(),t=a(),r=O(),i=se(void 0,{refetchInterval:e=>e.state.data?.state===`running`?wt:!1}),o=i.data,l=o?.state===`running`,u=l||r.isPending;c(()=>{o?.state!==`done`||o.finishedAtMs===null||(t.invalidateQueries({queryKey:[[`recording`]]}),t.invalidateQueries({queryKey:[[`pipelineAnalytics`]]}))},[o?.state,o?.finishedAtMs,t]);let d=async()=>{await e({title:`Reconcile storage from disk?`,message:`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:`Reconcile`,variant:`warning`})&&(await r.mutateAsync(),await i.refetch())},f=l?o.total>0?`Reconciling ${String(o.completed)}/${String(o.total)}…`:`Reconciling…`:r.isPending?`Reconciling…`:`Reconcile from disk`;return n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Disk reconcile`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`Deletes database rows whose files are gone. Enrolled identities stay.`}),n(`div`,{className:`mt-3 flex flex-col gap-2`,children:[n(`button`,{type:`button`,onClick:()=>void d(),disabled:u,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:[u?s(v,{className:`h-3.5 w-3.5 animate-spin`}):s(b,{className:`h-3.5 w-3.5`}),f]}),o?.state===`done`?n(`p`,{className:`text-[11px] text-foreground-subtle`,children:[`Last run: `,String(o.completed),` camera(s) — dropped `,String(o.tracks),` tracks,`,` `,String(o.events),` events, `,String(o.mediaDropped),` media`,o.failed.length>0?`, ${String(o.failed.length)} failed (${o.failed.join(`, `)})`:``,`.`]}):null,o?.state===`error`&&o.error!==null?n(`p`,{className:`text-[11px] text-destructive`,children:[`Reconcile failed: `,o.error]}):null]})]})}var q=1e3,J=60*q,Y=60*J;function X(e){return e.toLocaleString(`en-US`)}function Et(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 Dt(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:`~${Et(o*t/e.filesMoved)} left`;return{counted:n,fraction:r,moved:`${W(e.bytesMoved)} moved`,rate:a,eta:s}}function Ot(e){let t=Dt(e);return[t.counted,t.moved,t.rate,t.eta].filter(e=>e!==null).join(` · `)}t();var kt=`storage-migration`,Z=[{id:`recordings`,label:`Recordings`,locationType:`recordings`},{id:`recordingsLow`,label:`Low-res recordings`,locationType:`recordingsLow`},{id:`eventMedia`,label:`Event media`,locationType:`eventMedia`}],At=new Set([`planning`,`sealing`,`pausing`,`moving`,`draining`,`verifying`,`repointing`,`refreshing`,`resuming`]);function jt(){let e=z(kt);return e===`pending`?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(v,{className:`h-4 w-4 animate-spin`}),`Checking whether storage migration is installed…`]}):e===`unknown`?s(P,{icon:R,title:`Couldn't check whether storage migration is installed`,description:`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.`}):e===`absent`?s(P,{icon:K,title:`Storage migration not installed`,description:`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.`}):s(Mt,{})}function Mt(){let e=B(),{data:t}=F({}),[i,a]=o({}),[c,l]=o({}),[u,d]=o(null),[f,p]=o(null),h=r(()=>{let e=new Map;for(let n of t??[]){let t=e.get(n.type);t?t.push(n):e.set(n.type,[n])}return e},[t]),g=r(()=>{let e=new Map;for(let n of t??[]){if(n.enabled===!1)continue;let t=e.get(n.type);t?t.push(n.id):e.set(n.type,[n.id])}let n=new Map;for(let[t,r]of e)r.length===1&&n.set(t,r[0]);return n},[t]),_=be({},{refetchInterval:2e3}),y=_.data??null,b=y!==null&&At.has(y.phase),x=r(()=>{let e={};for(let t of Z){let n=i[t.id];n&&(e[t.id]=n)}return Object.keys(e).length>0?e:void 0},[i]),S=r(()=>{let e={};for(let t of Z){if(!i[t.id])continue;let n=c[t.id]??g.get(t.locationType);n&&(e[t.id]=n)}return Object.keys(e).length>0?e:void 0},[i,c,g]),C=r(()=>({destinations:x??{},...S?{sources:S}:{}}),[x,S]),w=m(C,{enabled:!1,retry:!1}),T=we(),E=k(),D=async()=>{if(!x)return;p(null);let e=await w.refetch();if(e.error){p(e.error instanceof Error?e.error.message:String(e.error));return}d(e.data??null)},O=async()=>{if(x&&await e({title:`Start storage migration?`,message:`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:`Start migration`,variant:`danger`})){p(null);try{await T.mutateAsync(C),d(null),await _.refetch()}catch(e){p(e instanceof Error?e.message:String(e))}}},A=async()=>{if(y&&await e({title:`Cancel migration?`,message:`Stops the in-progress migration. Data already moved and verified stays at the destination; anything already repointed is not reverted.`,confirmLabel:`Cancel migration`,variant:`danger`}))try{await E.mutateAsync({jobId:y.jobId}),await _.refetch()}catch{}};return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[n(`h3`,{className:`flex items-center gap-1.5 text-sm font-semibold text-foreground`,children:[s(K,{className:`h-3.5 w-3.5`}),`Storage migration`]}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`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.`}),s(`div`,{className:`mt-3 grid grid-cols-1 gap-3 sm:grid-cols-3`,children:Z.map(e=>{let t=h.get(e.locationType)??[],r=g.get(e.locationType)??``;return n(`div`,{className:`space-y-2`,children:[s(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:e.label}),n(`div`,{className:`space-y-1`,children:[n(`label`,{htmlFor:`migration-from-${e.id}`,className:`text-[10px] text-foreground-subtle`,children:[e.label,` from`]}),s(`select`,{id:`migration-from-${e.id}`,value:c[e.id]??r,onChange:t=>{let n=t.target.value;l(t=>({...t,[e.id]:n}))},disabled:b,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground disabled:opacity-50`,children:t.map(e=>n(`option`,{value:e.id,children:[e.displayName,e.enabled===!1?` (read-only)`:``]},e.id))})]}),n(`div`,{className:`space-y-1`,children:[n(`label`,{htmlFor:`migration-dest-${e.id}`,className:`text-[10px] text-foreground-subtle`,children:[e.label,` to`]}),n(`select`,{id:`migration-dest-${e.id}`,value:i[e.id]??``,onChange:t=>{let n=t.target.value;a(t=>({...t,[e.id]:n}))},disabled:b,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground disabled:opacity-50`,children:[s(`option`,{value:``,children:`— skip —`}),t.map(e=>s(`option`,{value:e.id,children:e.displayName},e.id))]})]})]},e.id)})}),f&&s(`p`,{className:`mt-2 text-[11px] text-danger`,children:f}),n(`div`,{className:`mt-3 flex items-center gap-2`,children:[n(`button`,{type:`button`,onClick:()=>{D()},disabled:!x||w.isFetching||b,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:[w.isFetching&&s(v,{className:`h-3 w-3 animate-spin`}),`Plan`]}),n(`button`,{type:`button`,onClick:()=>{O()},disabled:!x||T.isPending||b,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:[T.isPending&&s(v,{className:`h-3 w-3 animate-spin`}),`Start migration`]})]}),u&&s(`div`,{className:`mt-3 divide-y divide-border rounded-md border border-border`,children:u.moves.length===0?s(`p`,{className:`px-2.5 py-1.5 text-[11px] text-foreground-subtle`,children:`Nothing to move — selected destinations match the current defaults.`}):u.moves.map(e=>n(`div`,{className:`px-2.5 py-1.5 text-[11px] text-foreground`,children:[e.storageClass,`: `,e.fromLocationId,` → `,e.toLocationId]},`${e.storageClass}-${e.toLocationId}`))}),y&&n(`div`,{className:`mt-4 border-t border-border pt-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[s(`h4`,{className:`text-xs font-semibold text-foreground`,children:`Migration status`}),b&&n(`button`,{type:`button`,onClick:()=>{A()},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:[s(ye,{className:`h-3 w-3`}),`Cancel`]})]}),n(`p`,{className:`mt-1 text-xs text-foreground`,children:[`Phase: `,s(`span`,{className:`font-medium`,children:y.phase}),b&&s(v,{className:`ml-2 inline h-3 w-3 animate-spin text-primary`})]}),y.error&&s(`p`,{className:`mt-1 text-[11px] text-danger`,children:y.error}),y.pausedParticipants.length>0&&n(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:[`Paused: `,y.pausedParticipants.join(`, `)]}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:y.moves.map(e=>s(Nt,{move:e},`${e.storageClass}-${e.fromLocationId}`))})]}),s(Pt,{})]}),s(Ft,{running:b}),s(Lt,{})]})}function Nt({move:e}){let t=e.progress===null?null:Dt(e.progress);return n(`div`,{className:`px-2.5 py-1.5 text-[11px]`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`span`,{className:`text-foreground`,children:[e.storageClass,`: `,e.fromLocationId,` → `,e.toLocationId]}),n(`span`,{className:`text-foreground-subtle`,children:[e.state??`pending`,e.error?` (${e.error})`:``]})]}),e.progress!==null&&n(`div`,{className:`mt-1 space-y-1`,children:[t!==null&&t.fraction!==null&&s(`div`,{className:`h-1 w-full overflow-hidden rounded bg-border`,children:s(`div`,{className:`h-full bg-primary`,style:{width:`${(t.fraction*100).toFixed(1)}%`}})}),s(`p`,{className:`text-[10px] text-foreground-subtle`,children:Ot(e.progress)})]})]})}function Pt(){let{data:e}=de({});return!e||e.length===0?null:n(`div`,{className:`mt-4 border-t border-border pt-3`,children:[s(`h4`,{className:`text-xs font-semibold text-foreground`,children:`Migration history`}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:e.map(e=>n(`div`,{className:`px-2.5 py-1.5 text-[11px] text-foreground-subtle`,children:[s(`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 Ft({running:e}){let t=B(),r=pe({},{staleTime:1/0,refetchOnWindowFocus:!1}),i=ce(),[a,c]=o(null),l=r.data??[];if(l.length===0)return null;let u=async e=>{if(await t({title:`Drain remaining ${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:`Drain remaining`,variant:`danger`})){c(null);try{await i.mutateAsync({classes:[e.storageClass]}),await r.refetch()}catch(e){c(e instanceof Error?e.message:String(e))}}};return n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[n(`div`,{className:`flex items-start justify-between gap-2`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Left on the old location`}),n(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s(`span`,{className:`text-[10px] text-foreground-subtle`,children:r.dataUpdatedAt>0?`Measured ${new Date(r.dataUpdatedAt).toLocaleTimeString()}`:`Measured — never`}),s(`button`,{type:`button`,onClick:()=>{r.refetch()},disabled:r.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:r.isFetching?`Counting…`:`Refresh`})]})]}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`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.`}),s(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:`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.`}),a&&s(`p`,{className:`mt-2 text-[11px] text-danger`,children:a}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:l.map(t=>n(`div`,{className:`flex items-center justify-between gap-2 px-2.5 py-1.5 text-[11px]`,children:[n(`span`,{className:`text-foreground`,children:[t.storageClass,`: `,t.fromLocationId,` → `,t.toLocationId,s(`span`,{className:`ml-2 text-foreground-subtle`,children:It(t)})]}),s(`button`,{type:`button`,onClick:()=>{u(t)},disabled:e||i.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:`Drain remaining`})]},`${t.storageClass}-${t.fromLocationId}`))})]})}function It(e){if(e.items===null)return`amount unknown — the archive could not be read`;let t=e.items.toLocaleString(`en-US`);return e.bytes===null?`${t} rows`:`${t} segments · ${W(e.bytes)}`}function Lt(){let{data:e}=N({},{refetchInterval:2e3}),t=(e??[]).filter(e=>e.migrationJobId===null&&e.job.state===`running`);return t.length===0?null:n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Movers running outside a migration`}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:t.map(e=>n(`div`,{className:`px-2.5 py-1.5 text-[11px]`,children:[n(`div`,{className:`text-foreground`,children:[e.lane,`: `,e.job.fromLocationId,` → `,e.job.toLocationId]}),s(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:Ot({filesMoved:e.job.filesMoved,filesTotal:e.job.filesTotal,bytesMoved:e.job.bytesMoved,startedAt:e.job.startedAt,observedAt:e.observedAt})})]},e.job.jobId))})]})}function Rt(){return n(`div`,{className:`flex flex-col gap-4`,children:[s(St,{}),s(Tt,{}),n(`section`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Move storage`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`Copy recordings, low-res recordings or event media to a new location, verify, then repoint the default. Applies to every camera.`}),s(`div`,{className:`mt-3`,children:s(jt,{})})]})]})}t();var zt=`recorder`;function Bt(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 Vt(){let e=a(),{nodes:t}=V(),{data:i,isLoading:o}=L({addonId:zt}),c=Bt(i,`recordingNodeId`,`hub`),l=_({onSuccess:()=>{e.invalidateQueries({queryKey:[[`addonSettings`,`getGlobalSettings`]]})}}),u=r(()=>{let e=t.filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,c,...e])].filter(Boolean)},[t,c]);return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Recording node`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that records (continuous & events) and serves playback. Every other node stays inert — no multi-node balancing. Takes effect on addon restart.`}),n(`div`,{className:`mt-3 flex items-center gap-2`,children:[o?s(v,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):s(`select`,{value:c,onChange:e=>{e.target.value!==c&&l.mutate({addonId:zt,patch:{recordingNodeId:e.target.value}})},disabled:l.isPending,className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:u.map(e=>s(`option`,{value:e,children:e===`hub`?`hub (default)`:e},e))}),l.isPending&&s(v,{className:`h-4 w-4 animate-spin text-primary`})]}),c!==`hub`&&n(`p`,{className:`mt-2 text-[11px] text-amber-500`,children:[`The stream-broker is hub-only — an agent recorder pulls streams from the hub over the network. The hub's RTSP restream port must be reachable from`,` `,s(`span`,{className:`font-medium`,children:c}),`. If the auto-derived host doesn't work, set the recorder's`,s(`span`,{className:`font-medium`,children:` recordingHubHostname`}),` global setting.`]})]}),n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Recordings folders`}),s(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:`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.`}),s(qe,{types:[`recordings`,`recordingsLow`]})]})]})}function Q(e){return e.locationIds!==void 0&&e.locationIds.length>0?e.locationIds:e.locationId===null?[]:[e.locationId]}function Ht(e,t){let n=Q(e);return n.length===0?`default root`:n.map(e=>t.get(e)??e).join(` + `)}function Ut(e,t,n){if(e.length===0)return null;let r=e[0];if(e.length===1&&r!==void 0)return{label:Ht(r,t),exact:!0};if(n===null)return null;let i=e.find(e=>Q(e).includes(n));return i===void 0?null:{label:Ht(i,t),exact:!1}}t();var Wt=[[`recording`]],Gt=[{value:`retention`,label:`Retention policy`},{value:`quota`,label:`Quota / disk pressure`},{value:`operator`,label:`Operator`}],Kt={ok:`bg-primary`,warn:`bg-amber-500`,critical:`bg-danger`},qt={ok:`text-foreground-subtle`,warn:`text-amber-500`,critical:`text-danger`};function $(e){return`${String(Math.round(e*100))}%`}function Jt(e){return e==null?`—`:new Date(e).toLocaleString()}function Yt(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(` + `):`default root`:e.root}function Xt(){let t=a(),i=B(),[c,d]=o(`retention`),{data:f,isLoading:p}=h({},{refetchOnWindowFocus:!1}),{data:m}=U({isCamera:!0,projection:`slim`}),{data:g}=F({}),_=r(()=>{let e=new Map;for(let t of m??[])e.set(t.id,t.name);return e},[m]),y=r(()=>{let e=new Map;for(let t of g??[])e.set(t.id,t.displayName);return e},[g]),x=r(()=>{let e=g??[];return e.find(e=>e.type===`recordings`&&e.enabled!==!1)?.id??e.find(e=>e.type===`recordings`)?.id??null},[g]),S=r(()=>f?.locations??[],[f?.locations]),C=r(()=>Ut(S,y,x),[S,y,x]),T=r(()=>De(S),[S]),E=e(()=>{t.invalidateQueries({queryKey:Wt})},[t]),D=j({onSuccess:E}),O=_e({onSuccess:E}),k=e(async e=>{await i({title:`Prune ${_.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Applies the retention policy now (reason: ${c}). Footage beyond the policy is permanently deleted.`,confirmLabel:`Prune now`,variant:`danger`})&&D.mutate({deviceId:e.deviceId,reason:c})},[i,D,c,_]),A=e(async e=>{await i({title:`Delete all footage for ${_.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Permanently deletes ${W(e.usedBytes)} of recorded footage for this camera. This cannot be undone.`,confirmLabel:`Delete ${W(e.usedBytes)}`,variant:`danger`})&&O.mutate({deviceId:e.deviceId})},[i,O,_]),ee=r(()=>[{key:`camera`,header:`Camera`,render:e=>s(`span`,{className:`text-foreground`,children:_.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`disk`,header:`Disk`,nowrap:!0,render:()=>C===null?s(`span`,{className:`text-foreground-subtle`,children:`—`}):n(`span`,{className:C.exact?`text-foreground`:`text-foreground-subtle`,title:C.exact?`The only recordings volume on this node — this camera can only be here.`:`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&&s(`span`,{className:`ml-1 text-foreground-subtle`,children:`(default)`})]})},{key:`used`,header:`Used`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:W(e.usedBytes)})},{key:`oldest`,header:`Oldest footage`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums text-foreground-subtle`,title:`The oldest segment the ARCHIVE holds for this camera — the per-camera answer to 'is retention actually holding?'.`,children:Jt(e.oldestMs)})},{key:`actions`,header:``,align:`right`,render:e=>n(`div`,{className:`flex items-center justify-end gap-1`,children:[n(`button`,{onClick:()=>{k(e)},disabled:D.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:`Apply retention policy now`,children:[s(Be,{className:`h-3 w-3`}),`Prune`]}),n(`button`,{onClick:()=>{A(e)},disabled:O.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:`Delete all footage`,children:[s(u,{className:`h-3 w-3`}),`Delete`]})]})}],[_,C,k,A,D.isPending,O.isPending]);if(p&&!f)return n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(v,{className:`h-4 w-4 animate-spin`}),`Loading storage usage…`]});if(!f)return s(P,{icon:b,title:`No storage data`,description:`The recording node has not reported any storage usage yet.`});let M=f.devices.length;return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[s(l,{label:`Total used`,icon:s(b,{className:`h-3 w-3`}),footer:`${String(M)} camera${M===1?``:`s`} on ${f.nodeId}`,children:W(f.totalUsedBytes)}),T!==null&&T.severity!==null&&s(l,{label:`Free on recordings volumes`,icon:s(b,{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:s(`span`,{className:`tabular-nums ${qt[T.severity]}`,children:W(T.freeBytes)})}),S.map(e=>{let t=je(e),r=e.locationId??e.root??`default`;return s(l,{label:`Disk: ${Yt(e,y)}`,footer:t===null?`${W(e.usedBytes)} of recordings · volume capacity unknown`:`${W(t.freeBytes)} free of ${W(t.totalBytes)} · ${W(e.usedBytes)} recordings (${$(t.recordingsFraction)})`,children:t===null?s(`span`,{className:`tabular-nums`,children:W(e.usedBytes)}):n(`div`,{className:`flex items-center gap-2`,title:`Volume fill — everything on the disk, not only recordings. Warn at 85%, critical at 95%.`,children:[s(`div`,{className:`h-2 flex-1 overflow-hidden rounded bg-muted`,children:s(`div`,{className:`h-full rounded ${Kt[t.severity]}`,style:{width:$(t.fraction)}})}),s(`span`,{className:`tabular-nums text-xs ${qt[t.severity]}`,children:$(t.fraction)})]})},r)})]}),n(`section`,{className:`flex items-center gap-2 text-xs`,children:[s(`label`,{htmlFor:`prune-reason`,className:`text-foreground-subtle`,children:`Prune reason`}),s(`select`,{id:`prune-reason`,value:c,onChange:e=>{let t=Gt.find(t=>t.value===e.target.value);t&&d(t.value)},className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:Gt.map(e=>s(`option`,{value:e.value,children:e.label},e.value))})]}),M===0?s(P,{icon:b,title:f.devicesRead===`unavailable`?`Per-camera usage unavailable`:`No recorded footage`,description:f.devicesRead===`unavailable`?`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.`:`No camera has recorded footage on this node yet.`}):s(w,{columns:ee,rows:[...f.devices],rowKey:e=>e.deviceId,minWidthPx:480})]})}function Zt(){return n(`div`,{className:`flex flex-col gap-8`,children:[n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Footage on disk`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`What recorded footage occupies, per camera and per volume, with prune-by-policy and delete-all-footage.`}),s(`div`,{className:`mt-3`,children:s(Xt,{})})]}),n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Recording node & folders`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that records and serves playback, and the storage locations footage is written to.`}),s(`div`,{className:`mt-3`,children:s(Vt,{})})]})]})}function Qt(){let{t:e}=Fe(),t=Ie(`/recordings`,{t:e,isAdmin:!0})??{icon:C,title:e(`nav.recordings`,`Recordings`)};return s(Re,{icon:t.icon,title:t.title,subtitle:`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:`Recordings`,content:s(Zt,{})},{id:`events`,label:`Events`,content:s(nt,{})},{id:`cameras`,label:`Cameras`,content:s(Ke,{})},{id:`exports`,label:`Export`,content:s(_t,{})},{id:`activity`,label:`Activity`,content:s(Ge,{})},{id:`management`,label:`Management`,content:s(Rt,{})}]})}export{Qt as RecordingsPage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{I as e,K as t,Q as n,S as r,W 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-DhP-Lgiq.js";import{D as s,ct as c,ot as l,yt as u}from"./player-overlays-mP7nvLXZ.js";import{$l as d,An as f,Ed as p,Fn as m,Hn as h,Ht as g,Il as _,In as v,Kn as y,Mn as b,Nn as x,Nt as S,Pn as ee,Pt as C,Ql as te,Ut as w,Vt as T,Yu as E,dr as D,eu as O,fu as k,ir as ne,jd as re,mu as A,rr as j,sf as ie,ya as ae,yd as oe}from"./src-BeE19PxU.js";import{t as se}from"./octagon-alert-bX5m_c3-.js";import{R as ce,a as le,tt as ue}from"./index-I1VJhtqM.js";var de=u(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]);n();function M({id:e,title:t,icon:n,description:i,actions:a,tone:c=`default`,notice:l=null,onDismissNotice:u,children:d}){return o(T,{headingId:`access-${e}`,title:t,icon:n,actions:a,testId:`access-${e}`,children:r(`div`,{className:`${s} space-y-3`,children:[o(`div`,{className:O(`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:i}),l!==null&&o(pe,{notice:l,onDismiss:u}),d]})})}var fe={success:{icon:ie,line:`border-success/30 text-foreground`,mark:`text-success`},danger:{icon:se,line:`border-danger/40 text-danger`,mark:`text-danger`}};function pe({notice:e,onDismiss:t}){let n=fe[e.tone],i=n.icon;return r(`div`,{role:e.tone===`danger`?`alert`:`status`,className:O(`flex items-start gap-2 rounded-md border bg-surface px-3 py-2 text-[11px]`,n.line),children:[o(i,{className:O(`mt-0.5 h-3.5 w-3.5 shrink-0`,n.mark),"aria-hidden":!0}),o(`span`,{className:`min-w-0 flex-1`,children:e.message}),t!==void 0&&o(d,{type:`button`,variant:`ghost`,size:`sm`,icon:A,"aria-label":`Dismiss`,onClick:t,className:`-my-1 h-5 w-5`})]})}function N(){let{data:e}=_();return i(()=>{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 F={active:`Active`,expired:`Expired`,revoked:`Revoked`,current:`This session`},me={active:`success`,expired:`warning`,revoked:`default`,current:`info`},he={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 L({status:e}){return o(D,{variant:me[e],className:`text-[10px]`,children:F[e]})}function R({row:e,action:t}){if(!t.isAvailable(e))return null;let n=t.icon,i=t.busyId===e.id;return r(y,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>t.onRun(e),disabled:t.disabled,"aria-label":`${t.label} ${e.name}`,className:`text-danger hover:bg-danger/10`,children:[i?o(p,{className:`h-3 w-3 animate-spin`,"aria-hidden":!0}):o(n,{className:`h-3 w-3`,"aria-hidden":!0}),t.label]})}function ge(e){return[{key:`name`,header:`Name`,sortValue:e=>e.name.toLowerCase(),render:e=>r(`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:`Owner`,sortValue:e=>e.ownerName.toLowerCase(),render:e=>e.ownerName},{key:`kind`,header:`Kind / scope`,sortValue:e=>e.kind.toLowerCase(),nowrap:!1,render:e=>r(`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:`Status`,sortValue:e=>he[e.status],render:e=>o(L,{status:e.status})},{key:`created`,header:`Created`,sortValue:e=>e.createdAt,render:e=>o(`span`,{className:`text-foreground-subtle`,children:I(e.createdAt,`—`)})},{key:`lastUsed`,header:`Last used`,sortValue:e=>e.lastUsedAt,render:e=>o(`span`,{className:`text-foreground-subtle`,children:I(e.lastUsedAt,`Never`)})},{key:`expires`,header:`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:`Actions`,render:t=>e.action===null?null:o(R,{row:t,action:e.action})}].filter(e=>e!==null)}n();var z=6,_e={"current-session":`your current session`,"not-active":`already gone`};function B(e,t){return`${String(e)} ${e===1?t.one:t.many}`}function ve(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])=>`${String(t)} ${F[e].toLowerCase()}`).join(`, `)}function ye(e,t){let n=e.slice(0,z).map(e=>`• ${e.name} — ${e.ownerName}`),r=e.length>z?[`…and ${String(e.length-z)} more`]:[];return[`${B(e.length,t)} (${ve(e)}) stop working at once. This cannot be undone.`,``,...n,...r].join(`
|
|
2
|
-
`)}function V(e,t,n){let r=ne(),i=k.auth.revokeCredentials.useMutation(),[o,s]=a(null);return{run:async a=>{if(a.length===0)return!1;let o=String(a.length),c=await r({title:`Revoke ${B(a.length,t)}?`,message:ye(a,t),label:`Type ${o} to confirm`,placeholder:o,confirmLabel:`Revoke ${o}`,variant:`danger`,validate:e=>e.trim()===o?null:`Type ${o} — the number of ${t.many} selected`});if(c===null||c.trim()!==o)return!1;s(null);try{let n=await i.mutateAsync({kind:e,ids:a.map(e=>e.id),confirmCount:a.length}),r=n.skipped.map(e=>_e[e.reason]??e.reason);return s({tone:`success`,message:`Revoked ${B(n.revoked.length,t)}.`+(r.length>0?` Skipped ${String(r.length)}: ${[...new Set(r)].join(`, `)}.`:``)}),!0}catch(e){return s({tone:`danger`,message:`The revoke failed: ${e instanceof Error?e.message:`request failed`}. The list below is reloaded — check what is left.`}),!1}finally{n()}},busy:i.isPending,outcome:o,dismiss:()=>s(null)}}n();var be={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}]},xe={status:`Status`,owner:`Owner`,kind:`Kind`},Se=e=>e.status!==`current`;function H({rows:e,label:t,isLoading:n,loadError:s,emptyText:c,hideOwner:l=!1,expiresNone:u=`Never`,action:d,bulk:f}){let m=S(e,be),[_,v]=a(()=>new Set),y=i(()=>ge({hideOwner:l,expiresNone:u,action:d??null}),[l,u,d]),b=i(()=>f===void 0?()=>!1:e=>Se(e)&&f.isSelectable(e),[f]),x=i(()=>m.rows.filter(e=>_.has(e.id)&&b(e)),[m.rows,_,b]);return n?r(`div`,{className:`flex items-center gap-2 py-4 text-xs text-foreground-subtle`,children:[o(p,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}),`Loading `,t,`…`]}):s===null?r(`div`,{className:`space-y-3`,children:[o(C,{state:m.state,facets:m.facets,groups:m.groups.filter(e=>!(l&&e.id===`owner`)).map(e=>({...e,label:xe[e.id]??e.id,...e.id===`status`?{facetLabel:e=>F[e]??e}:{}})),labels:{searchPlaceholder:`Search ${t}…`,searchLabel:`Search ${t}`,facetsLabel:`Filter ${t}`,clearLabel:`Clear filters`},onSearch:m.setSearch,onToggleFacet:m.toggleFacet,onToggleGroupFacet:m.toggleGroupFacet,onClear:m.clear}),f!==void 0&&o(Ce,{bulk:f,shown:m.rows.filter(b),targets:x,onSelect:v}),o(g,{columns:y,rows:m.rows,rowKey:e=>e.id,minWidthPx:l?760:860,mobileMode:`scroll`,maxBodyHeight:w,defaultSort:{columnKey:`created`,dir:`desc`},pageSize:25,paginationLabels:{navLabel:`${t} pages`,previous:`Previous page`,next:`Next page`,range:(e,t,n)=>`${e}–${t} of ${n}`},emptyMessage:m.active?`No ${t} match the filters.`:c,rowClassName:e=>e.status===`revoked`||e.status===`expired`?`opacity-70`:void 0,...f===void 0?{}:{selection:{selected:_,onChange:v,isSelectable:b,rowLabel:e=>`Select ${e.name} (${e.ownerName})`,pageLabel:`Select every ${f.noun.one} on this page`}}})]}):o(h,{title:`Could not load ${t}`,message:s})}function Ce({bulk:e,shown:t,targets:n,onSelect:i}){let{revoke:a,noun:s}=e,l=(e.quickSelect??[]).map(e=>({...e,rows:t.filter(e.match)})).filter(e=>e.rows.length>0),u=async()=>{await a.run(n)&&i(new Set)};return r(`div`,{className:`flex flex-wrap items-center gap-2`,"data-testid":`bulk-bar`,children:[t.length>0&&r(y,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(new Set(t.map(e=>e.id))),children:[`Select all `,String(t.length),` shown`]}),l.map(e=>r(y,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(new Set(e.rows.map(e=>e.id))),children:[e.label,` (`,String(e.rows.length),`)`]},e.label)),n.length>0&&r(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:[r(`span`,{className:`text-[11px] tabular-nums text-foreground`,"aria-live":`polite`,children:[B(n.length,s),` selected`]}),r(y,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>i(new Set),children:[o(A,{className:`h-3 w-3`,"aria-hidden":!0}),`Clear selection`]}),r(y,{type:`button`,variant:`danger`,size:`sm`,disabled:a.busy,onClick:()=>void u(),children:[a.busy?o(p,{className:`h-3 w-3 animate-spin`,"aria-hidden":!0}):o(c,{className:`h-3 w-3`,"aria-hidden":!0}),`Revoke `,B(n.length,s),`…`]})]})]})}var U=(e,t)=>t===null?`—`:e.get(t)??t;function W(e,t){return e!=null&&e<=t?`expired`:`active`}function we(e,t,n){return{id:e.id,name:n.client(e.client),detail:e.ip,ownerId:e.userId,ownerName:U(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 Te(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}}function Ee(e,t,n,r,i){let a=[...new Set(e.scopes.map(e=>e.type))].toSorted();return{id:e.id,name:e.name,detail:`${e.tokenPrefix}…`,ownerId:t,ownerName:U(n,t),kind:a.length===0?`none`:a.join(` + `),scope:r,status:W(e.expiresAt,i),createdAt:e.createdAt,lastUsedAt:e.lastUsedAt??null,expiresAt:e.expiresAt??null}}function De(e,t,n){return{id:e.id,name:e.name,detail:`${e.tokenPrefix}…`,ownerId:e.createdBy,ownerName:U(t,e.createdBy),kind:`Full administrator`,scope:null,status:e.revokedAt===null?W(e.expiresAt,n):`revoked`,createdAt:e.createdAt,lastUsedAt:e.lastUsedAt,expiresAt:e.expiresAt}}var Oe={"grid-view":`Grid`,"events-view":`Events`};function ke(e,t){return e.map(e=>t.get(e)??`#${String(e)}`).join(`, `)}function Ae(e,t,n,r){let i=Oe[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:U(t,e.userId),kind:e.scope.talk===!0?`${i} + talk`:i,scope:ke(e.scope.deviceIds,n),status:W(e.expiresAt,r),createdAt:e.createdAt,lastUsedAt:e.lastUsedAt??null,expiresAt:e.expiresAt}}function G(e){return`${e.provider}\u0000${e.subject}`}function je(e,t){return{id:G(e),name:e.label??e.subject,detail:e.issuer,ownerId:e.userId,ownerName:U(t,e.userId),kind:e.provider,scope:null,status:`active`,createdAt:e.linkedAt,lastUsedAt:null,expiresAt:null}}function Me(e,t){let n=e.allowedProviders;return{id:e.id,name:e.label,detail:`${e.tokenPrefix}…`,ownerId:e.userId??null,ownerName:U(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 K=40,Ne=[{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`}],Pe=[{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`}],Fe=[{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 q(e,t){return e.find(e=>e.test.test(t))?.name??null}function Ie(e){return e.length<=K?e:`${e.slice(0,K)}…`}function J(e){if(e===null||e.trim().length===0)return{label:`Unknown device`,raw:null};let t=e.trim(),n=q(Fe,t);if(n!==null)return{label:n,raw:t};let r=q(Ne,t),i=q(Pe,t);return r!==null&&i!==null?{label:`${r} on ${i}`,raw:t}:r===null?{label:Ie(t),raw:t}:{label:r,raw:t}}var Le={password:`Password`,passkey:`Passkey`,sso:`Single sign-on`,handoff:`App hand-off`,exchange:`Session exchange`};function Y(e){return Le[e]??e}function X(e){if(e==null)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleString()}n();function Z(e,t){return e instanceof Error&&e.message.length>0?e.message:t}function Re(n){let i=l(),[s,c]=a(!1),[u,d]=a(``),[h,g]=a(null),[_,S]=a(null),C=t(null),w=e(e=>{C.current?.(e),C.current=null,c(!1),d(``),g(null),S(null)},[]),T=e(()=>new Promise(e=>{C.current?.(null),C.current=e,S(null),c(!0)}),[]),E=async()=>{g(`password`),S(null);try{let{reauthToken:e}=await i.reauthenticate({password:u});w(e)}catch(e){S(Z(e,`Password is incorrect`)),g(null)}},D=async()=>{g(`passkey`),S(null);try{let{optionsJSON:e}=await i.reauthBeginPasskey(),t=await le({optionsJSON:e}),{reauthToken:n}=await i.reauthenticate({passkeyResponse:Object.fromEntries(Object.entries(t))});w(n)}catch(e){S(Z(e,`Passkey verification failed`)),g(null)}};return{requestProof:T,dialog:o(f,{open:s,onOpenChange:e=>!e&&w(null),children:r(b,{children:[r(m,{children:[o(v,{children:`Confirm it’s you`}),r(x,{children:[n,` needs your password or a passkey, even though you are signed in.`]})]}),r(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),u.length>0&&h===null&&E()},children:[o(te,{type:`password`,autoComplete:`current-password`,placeholder:`Current password`,value:u,onChange:e=>d(e.target.value),"aria-label":`Current password`}),_!==null&&o(`p`,{role:`alert`,className:`text-xs text-danger`,children:_}),r(ee,{className:`flex flex-wrap gap-2`,children:[r(y,{type:`button`,variant:`outline`,disabled:h!==null,onClick:()=>void D(),children:[h===`passkey`?o(p,{className:`h-4 w-4 animate-spin`}):o(re,{className:`h-4 w-4`}),`Use a passkey`]}),r(y,{type:`submit`,disabled:u.length===0||h!==null,children:[h===`password`&&o(p,{className:`h-4 w-4 animate-spin`}),`Confirm`]})]})]})]})})}}n();var Q={one:`share link`,many:`share links`};function $(e){let t=j(),n=k.useUtils(),r=k.auth.listShareTokens.useQuery({owner:e}),o=N(),{data:s}=ae({isCamera:!0,projection:`slim`}),[l,u]=a(null),d=()=>void n.auth.listShareTokens.invalidate(),f=k.auth.revokeShareToken.useMutation({onSuccess:d,onError:e=>u(`Revoke failed: ${e.message}`)}),p=i(()=>{let e=new Map;for(let t of s??[])e.set(t.id,t.name);return e},[s]),m=Date.now(),h=(r.data??[]).map(e=>Ae(e,o,p,m)),g=async e=>{await t({title:`Revoke share link`,message:`Anyone holding this link to ${e.scope??e.name} loses access immediately. This cannot be undone.`,confirmLabel:`Revoke`,variant:`danger`})&&(u(null),f.mutate({id:e.id}))};return{rows:h,refresh:d,error:l,clearError:()=>u(null),isLoading:r.isLoading,loadError:r.isError?r.error?.message??`Request failed`:null,action:{label:`Revoke`,icon:c,isAvailable:()=>!0,onRun:e=>void g(e),busyId:f.isPending?f.variables?.id??null:null,disabled:f.isPending}}}function ze(){let e=$(`self`);return o(M,{notice:P(e.error),onDismissNotice:e.clearError,id:`my-share-links`,title:`Share links`,icon:E,description:`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(H,{rows:e.rows,label:`share links`,isLoading:e.isLoading,loadError:e.loadError,emptyText:`You have no share links.`,hideOwner:!0,action:e.action})})}function Be(){let{user:e}=ce();return e?.isAdmin?o(Ve,{}):null}function Ve(){let e=$(`all`),t=V(`share-link`,Q,e.refresh);return o(M,{notice:P(e.error,t.outcome),onDismissNotice:()=>{e.clearError(),t.dismiss()},id:`share-links`,title:`Share links`,icon:E,description:`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(H,{rows:e.rows,label:`share links`,isLoading:e.isLoading,loadError:e.loadError,emptyText:`No user has any share links.`,action:{...e.action,disabled:e.action.disabled||t.busy},bulk:{revoke:t,noun:Q,isSelectable:()=>!0,quickSelect:[{label:`Select expired`,match:e=>e.status===`expired`}]}})})}function He({sessions:e,isLoading:t,loadError:n,emptyText:i,onRevoke:a,revokingId:s}){return t?r(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[o(p,{className:`h-3.5 w-3.5 animate-spin`}),`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:i}):o(`ul`,{className:`divide-y divide-border rounded-md border border-border`,children:e.map(e=>o(Ue,{session:e,revoking:s===e.id,onRevoke:()=>a(e)},e.id))}):r(`div`,{className:`text-[11px] text-danger`,children:[`Could not load sessions: `,n]})}function Ue({session:e,revoking:t,onRevoke:n}){let i=J(e.client);return r(`li`,{"data-testid":`session-row`,className:`flex items-start gap-3 px-3 py-2 text-xs`,children:[o(oe,{className:`h-3.5 w-3.5 mt-0.5 shrink-0 text-foreground-subtle`}),r(`div`,{className:`flex-1 min-w-0 space-y-0.5`,children:[r(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[o(`span`,{className:`font-medium text-foreground truncate`,title:i.raw??void 0,children:i.label}),e.current&&o(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary`,children:`This device`})]}),r(`div`,{className:`flex flex-wrap gap-x-3 text-[11px] text-foreground-subtle`,children:[o(`span`,{children:Y(e.method)}),o(`span`,{className:`font-mono`,children:e.ip??`IP unknown`}),r(`span`,{children:[`Last active `,X(e.lastUsedAt)]}),r(`span`,{children:[`Expires `,X(e.expiresAt)]})]})]}),!e.current&&r(`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(p,{className:`h-3 w-3 animate-spin`}):o(ue,{className:`h-3 w-3`}),`Sign out`]})]})}export{M as _,J as a,de as b,De as c,je as d,Te as f,V as g,H as h,Re as i,Me as l,Ee as m,Be as n,Y as o,we as p,ze as r,X as s,He as t,G as u,P as v,N as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{yt as e}from"./player-overlays-mP7nvLXZ.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};
|