@camstack/addon-admin-ui 1.2.134 → 1.2.136

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 (112) hide show
  1. package/dist/assets/{AddLocationWizard-Cwdgmtfs.js → AddLocationWizard-mVaAkllu.js} +1 -1
  2. package/dist/assets/{AddonCollectionPage-RHQ9yvVK.js → AddonCollectionPage-CaPJcCMl.js} +1 -1
  3. package/dist/assets/{Addons-rrutEpuH.js → Addons-D2I_esyD.js} +1 -1
  4. package/dist/assets/{AdminTabs-BES2bRcj.js → AdminTabs-Deriw2hW.js} +1 -1
  5. package/dist/assets/{AiProfiles-DHmStPHk.js → AiProfiles-DpGUrbkq.js} +1 -1
  6. package/dist/assets/{BrokerForm-CDvqKRks.js → BrokerForm-BV2ENKUn.js} +1 -1
  7. package/dist/assets/{Build-Bdd6VKQq.js → Build-DIwjJX1u.js} +1 -1
  8. package/dist/assets/{Capabilities-BlBsIIKz.js → Capabilities-CUk8ImxR.js} +1 -1
  9. package/dist/assets/{CapabilityBadges-CaL2z_pA.js → CapabilityBadges-BljLOSl8.js} +1 -1
  10. package/dist/assets/{Cluster-DI4H3z9p.js → Cluster-B04Dntx1.js} +1 -1
  11. package/dist/assets/{Data-CMufz0ly.js → Data-8q9qJ1E1.js} +1 -1
  12. package/dist/assets/{DetectionIntelligence-CC2bnU1G.js → DetectionIntelligence-M69Rh2Fu.js} +1 -1
  13. package/dist/assets/{DeviceAggregateSection-DtmhOYC-.js → DeviceAggregateSection-ZEdmE1Tr.js} +1 -1
  14. package/dist/assets/{DeviceDetail-D4JyE8Q4.js → DeviceDetail-D-4CwvyO.js} +1 -1
  15. package/dist/assets/{Devices-DPoOJ28S.js → Devices-DF6jpmce.js} +1 -1
  16. package/dist/assets/{EmbedPlayerPage-DVHKytpg.js → EmbedPlayerPage-KrGElk9a.js} +1 -1
  17. package/dist/assets/Events-DoYqNSUV.js +1 -0
  18. package/dist/assets/{FormBuilder-BIcajZrR.js → FormBuilder-CsypX2wJ.js} +1 -1
  19. package/dist/assets/{Identity-I-w2MCJo.js → Identity-Cly1pkY0.js} +1 -1
  20. package/dist/assets/{IntegrationDetail-BM_A5fuC.js → IntegrationDetail-Ua-4eUiQ.js} +1 -1
  21. package/dist/assets/{Integrations-D4-yTaal.js → Integrations-BKW9f5Tq.js} +1 -1
  22. package/dist/assets/{Integrations-BPh5t296.js → Integrations-Dw_5CkVj.js} +1 -1
  23. package/dist/assets/{Locations-DMliZ_uK.js → Locations-BzyjI6El.js} +1 -1
  24. package/dist/assets/{Logs-C1gzkJh5.js → Logs-D2LjU4W5.js} +1 -1
  25. package/dist/assets/{MotionZonesSettings-D5bsz1Jg.js → MotionZonesSettings-dUd4dTsA.js} +1 -1
  26. package/dist/assets/{MyAccess-DPbKorXj.js → MyAccess-CYtGheNF.js} +1 -1
  27. package/dist/assets/{Network-Dhlj9iZg.js → Network-EIyn_EB4.js} +1 -1
  28. package/dist/assets/{NodeAddonsSettingsPanel-iExlTFdf.js → NodeAddonsSettingsPanel-Cn-rIXGF.js} +1 -1
  29. package/dist/assets/{NodeInferenceDevices-BFbIgscJ.js → NodeInferenceDevices-FBayPhvF.js} +1 -1
  30. package/dist/assets/{Notifications-D70xO34C.js → Notifications-ASnN4lfj.js} +1 -1
  31. package/dist/assets/{Pipeline-CK08_4T5.js → Pipeline-BLI2Oq15.js} +1 -1
  32. package/dist/assets/{Plates-BeruKIQC.js → Plates-C4OD82o4.js} +1 -1
  33. package/dist/assets/{PrivacyMaskSettings-CQxnmksk.js → PrivacyMaskSettings-CJwRkAjL.js} +1 -1
  34. package/dist/assets/{ProviderIcon-C8rLTyFr.js → ProviderIcon-CBNqs16I.js} +1 -1
  35. package/dist/assets/{Recordings-CIbUuuE4.js → Recordings-BZXYg9q5.js} +1 -1
  36. package/dist/assets/{ScanNetworkModal-DnZZD6cS.js → ScanNetworkModal-CHyzU4Pu.js} +1 -1
  37. package/dist/assets/{SceneMonitorEditor-CUWuIcgd.js → SceneMonitorEditor-BmK8D-Mn.js} +1 -1
  38. package/dist/assets/{Scenes-o8RqEZ0X.js → Scenes-CbxsoKAl.js} +1 -1
  39. package/dist/assets/{Settings-Bq2Ruh_W.js → Settings-B858OsRX.js} +1 -1
  40. package/dist/assets/{Showroom-D_3Y_kaA.js → Showroom-tr1EdFcT.js} +1 -1
  41. package/dist/assets/{StorageLocationsPanel-CNaSNDZz.js → StorageLocationsPanel-BiP3z_s1.js} +1 -1
  42. package/dist/assets/{Terminal-DyvxUA1l.js → Terminal-CbuRFD97.js} +1 -1
  43. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-C4P5BjZb.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DP3QHSOf.js} +1 -1
  44. package/dist/assets/{bell-off-f9cOeYHR.js → bell-off-3pzidZwL.js} +1 -1
  45. package/dist/assets/{bell-ring-BOLQ3-sn.js → bell-ring-BNMfRLHE.js} +1 -1
  46. package/dist/assets/{boxes-D67mOgyH.js → boxes-wUdab8Mw.js} +1 -1
  47. package/dist/assets/circle-check-big-DqrpEEJk.js +1 -0
  48. package/dist/assets/circle-dot-BQYpE1hW.js +1 -0
  49. package/dist/assets/{circle-x-BhSycz1t.js → circle-x-Cxto7gxg.js} +1 -1
  50. package/dist/assets/clock-DcwuYKfL.js +1 -0
  51. package/dist/assets/{copy-yEuX36Q9.js → copy-Dzoj1sL2.js} +1 -1
  52. package/dist/assets/{debounced-invalidate-C6oftOsc.js → debounced-invalidate-DS28CcfM.js} +1 -1
  53. package/dist/assets/dist-8TKoJB2v.js +349 -0
  54. package/dist/assets/{dist-B7WBVVYD.js → dist-DFSfnZbu.js} +1 -1
  55. package/dist/assets/{download-Cns2b0I4.js → download-DxszViZg.js} +1 -1
  56. package/dist/assets/{face-bbox-_inWE1us.js → face-bbox-rixxoMVN.js} +1 -1
  57. package/dist/assets/{flame-B3wdUf-B.js → flame-y-WWWoqN.js} +1 -1
  58. package/dist/assets/{hard-drive-BSubXVbL.js → hard-drive-Cx9nO3D9.js} +1 -1
  59. package/dist/assets/{hostInit-BxXzisKg.js → hostInit-M-UNOI3G.js} +1 -1
  60. package/dist/assets/index-BGfoUOZH.js +4 -0
  61. package/dist/assets/index-CJR_GTd3.css +2 -0
  62. package/dist/assets/{key-round-Hwjyfxut.js → key-round-Cf_iahkO.js} +1 -1
  63. package/dist/assets/{layers-4y_LNvsk.js → layers-D2h0nzB6.js} +1 -1
  64. package/dist/assets/{mf-entry-bootstrap-0-b0011344.js → mf-entry-bootstrap-0-7877987d.js} +2 -2
  65. package/dist/assets/{pencil-DM8jm3KB.js → pencil-BYfHIRND.js} +1 -1
  66. package/dist/assets/play-3WHdfZns.js +1 -0
  67. package/dist/assets/{player-overlays-Bx_ObCKU.js → player-overlays-CbzaJwg-.js} +1 -1
  68. package/dist/assets/plus-DybJZLlz.js +1 -0
  69. package/dist/assets/power-V-NCnOD5.js +1 -0
  70. package/dist/assets/{radio-C8kTOvFE.js → radio-CVCZPeGS.js} +1 -1
  71. package/dist/assets/{refresh-cw-CAE9U9W8.js → refresh-cw-zgZZERqO.js} +1 -1
  72. package/dist/assets/remoteEntry-C33H90bT.js +1 -0
  73. package/dist/assets/rotate-ccw-P6KpUkTu.js +1 -0
  74. package/dist/assets/rotate-cw-Bmr-g_8P.js +1 -0
  75. package/dist/assets/{send-Bepqdqz0.js → send-pS3EZzI2.js} +1 -1
  76. package/dist/assets/{server-BRZbW4kE.js → server-DxNJ1sP2.js} +1 -1
  77. package/dist/assets/{shield-Dd2SR8lz.js → shield-DdRJkqKO.js} +1 -1
  78. package/dist/assets/{shield-alert-DEZ-Rp12.js → shield-alert-CFw-3aoD.js} +1 -1
  79. package/dist/assets/{square-check-big-D1dZ8PB3.js → square-check-big-Dlho6m1g.js} +1 -1
  80. package/dist/assets/square-k5jQT1Qs.js +1 -0
  81. package/dist/assets/src-HS-Ah-dU.js +67 -0
  82. package/dist/assets/src-P91nlzf3.js +349 -0
  83. package/dist/assets/{undo-2-Dm8GwG7l.js → undo-2-L-coRO82.js} +1 -1
  84. package/dist/assets/{use-scenes-feed-Caku898Y.js → use-scenes-feed-C6jbwvBT.js} +1 -1
  85. package/dist/assets/useEventInvalidation-B3ksj3kK.js +1 -0
  86. package/dist/assets/{useNodeUrlSelection-BNegm9oW.js → useNodeUrlSelection-C8kKmEH-.js} +1 -1
  87. package/dist/assets/user-round-Ce2JWAZY.js +1 -0
  88. package/dist/assets/{video-Bj8owium.js → video-VQ0yM0l4.js} +1 -1
  89. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-CO1akns_.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DR-QYwCq.js} +2 -2
  90. package/dist/assets/{wifi-BXcW1Zsl.js → wifi-BWx65_WT.js} +1 -1
  91. package/dist/assets/{zap-Dnu811tV.js → zap-g_CScZV9.js} +1 -1
  92. package/dist/index.html +6 -6
  93. package/dist/server/addon.js +19 -24
  94. package/package.json +1 -1
  95. package/dist/assets/Events-BvGnhYlg.js +0 -1
  96. package/dist/assets/circle-check-big-BmkRuS0o.js +0 -1
  97. package/dist/assets/circle-dot-DMPqGtZX.js +0 -1
  98. package/dist/assets/clock-Cv-904ff.js +0 -1
  99. package/dist/assets/dist-BspaX-ZV.js +0 -349
  100. package/dist/assets/index-CNUAoFCi.js +0 -4
  101. package/dist/assets/index-DpyC2pdq.css +0 -2
  102. package/dist/assets/play-BwcRp88C.js +0 -1
  103. package/dist/assets/plus-BpLCw4Ck.js +0 -1
  104. package/dist/assets/power-D0XTxtP5.js +0 -1
  105. package/dist/assets/remoteEntry-DYu70_xx.js +0 -1
  106. package/dist/assets/rotate-ccw-Dd7L2QLp.js +0 -1
  107. package/dist/assets/rotate-cw-CW4nUKNY.js +0 -1
  108. package/dist/assets/square-D3ZDvwga.js +0 -1
  109. package/dist/assets/src-Baix3Xmi.js +0 -349
  110. package/dist/assets/src-DBcmPfFY.js +0 -67
  111. package/dist/assets/useEventInvalidation-stXd0-Bb.js +0 -1
  112. package/dist/assets/user-round-BxsYc8VU.js +0 -1
@@ -1 +1 @@
1
- import{J as e}from"./index-CNUAoFCi.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]);export{t};
1
+ import{J as e}from"./index-BGfoUOZH.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]);export{t};
@@ -1 +1 @@
1
- import{K as e,Q as t,S as n,W as r,q as i,x as a,z 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{B as s,H as c,J as l,L as u,R as d,z as f}from"./index-CNUAoFCi.js";var p=l(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]);t();var m={fromMs:null,toMs:null},h=36e5,g=24*h;function _(e,t){switch(e){case`24h`:return{fromMs:t-g,toMs:null};case`7d`:return{fromMs:t-7*g,toMs:null};case`30d`:return{fromMs:t-30*g,toMs:null};case`all`:return m}}function v(e){return e.fromMs!==null||e.toMs!==null}function y(e,t){return v(t)?e.filter(e=>!(t.fromMs!==null&&e.timestamp<t.fromMs||t.toMs!==null&&e.timestamp>t.toMs)):[...e]}function b(e,t){return t.size===0?[...e]:e.filter(e=>t.has(e.deviceId))}function x(e){let t=new Set,n=[];for(let r of e)t.has(r.deviceId)||(t.add(r.deviceId),n.push(r.deviceId));return n}function S(e){if(!e)return null;let t=Date.parse(`${e}T00:00:00`);return Number.isNaN(t)?null:t}function C(e){if(!e)return null;let t=Date.parse(`${e}T23:59:59.999`);return Number.isNaN(t)?null:t}function w(e,t){if(!Number.isFinite(e)||e<=0)return`—`;let n=t-e;return n<6e4?`just now`:n<h?`${String(Math.floor(n/6e4))}m ago`:n<g?`${String(Math.floor(n/h))}h ago`:n<7*g?`${String(Math.floor(n/g))}d ago`:new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function T(e){return!Number.isFinite(e)||e<=0?`—`:new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function E(e){return!Number.isFinite(e)||e<=0?`—`:new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function D(e,t,n){let[a,s]=i(1);o(()=>{s(1)},[n]);let c=e.length,l=Math.max(1,Math.ceil(c/t)),u=Math.min(a,l);return o(()=>{u!==a&&s(u)},[u,a]),{page:u,setPage:s,pageItems:r(()=>{let n=(u-1)*t;return e.slice(n,n+t)},[e,u,t]),totalPages:l,totalItems:c,pageSize:t}}var O=2;function k(e,t){if(t<=1)return[{kind:`page`,n:1}];if(t<=7){let e=[];for(let n=1;n<=t;n++)e.push({kind:`page`,n});return e}let n=[],r=Math.max(2,e-O),i=Math.min(t-1,e+O);n.push({kind:`page`,n:1}),r>2&&n.push({kind:`ellipsis`,side:`left`});for(let e=r;e<=i;e++)n.push({kind:`page`,n:e});return i<t-1&&n.push({kind:`ellipsis`,side:`right`}),n.push({kind:`page`,n:t}),n}function A({currentPage:e,totalItems:t,pageSize:r,onPageChange:i,itemNoun:o=`items`}){if(t<=r)return null;let s=Math.ceil(t/r),c=(e-1)*r+1,l=Math.min(e*r,t),f=k(e,s),p=`inline-flex h-7 min-w-7 items-center justify-center rounded-md px-2 text-[11px] transition-colors disabled:opacity-40`;return n(`div`,{className:`flex items-center justify-between gap-4 flex-wrap pt-2 text-[11px] text-foreground-subtle`,children:[n(`span`,{children:[`Showing `,c,`–`,l,` of `,t,` `,o]}),n(`div`,{className:`flex items-center gap-1`,children:[a(`button`,{type:`button`,className:`${p} hover:bg-surface-hover`,onClick:()=>i(e-1),disabled:e<=1,"aria-label":`Previous page`,children:a(d,{className:`h-3.5 w-3.5`})}),f.map(t=>t.kind===`ellipsis`?a(`span`,{className:`px-1 opacity-60`,children:`…`},`ellipsis-${t.side}`):a(`button`,{type:`button`,className:`${p} ${t.n===e?`bg-primary/12 text-primary font-medium`:`hover:bg-surface-hover hover:text-foreground`}`,onClick:()=>i(t.n),"aria-current":t.n===e?`page`:void 0,children:t.n},t.n)),a(`button`,{type:`button`,className:`${p} hover:bg-surface-hover`,onClick:()=>i(e+1),disabled:e>=s,"aria-label":`Next page`,children:a(u,{className:`h-3.5 w-3.5`})})]})]})}t();function j({cameras:t,selected:r,onChange:l}){let[u,d]=i(!1),p=e(null);o(()=>{if(!u)return;function e(e){p.current&&e.target instanceof Node&&!p.current.contains(e.target)&&d(!1)}function t(e){e.key===`Escape`&&d(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[u]);function m(e){let t=new Set(r);t.has(e)?t.delete(e):t.add(e),l(t)}let h=r.size,g=h===0?`All cameras`:h===1?t.find(e=>r.has(e.id))?.name??`1 camera`:`${String(h)} cameras`;return n(`div`,{ref:p,className:`relative`,children:[n(`button`,{type:`button`,onClick:()=>d(e=>!e),disabled:t.length===0,className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs transition-colors disabled:opacity-40 ${h>0?`border-primary/40 bg-primary/8 text-primary`:`border-border text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:[a(c,{className:`h-3.5 w-3.5`}),a(`span`,{className:`max-w-[10rem] truncate`,children:g}),a(f,{className:`h-3 w-3 opacity-70`})]}),u&&n(`div`,{className:`absolute left-0 z-30 mt-1 max-h-64 w-[min(15rem,calc(100vw-1.5rem))] overflow-y-auto rounded-md border border-border bg-surface p-1 shadow-lg shadow-black/30`,children:[h>0&&a(`button`,{type:`button`,onClick:()=>l(new Set),className:`mb-1 w-full rounded px-2 py-1 text-left text-[11px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,children:`Clear selection`}),t.map(e=>{let t=r.has(e.id);return n(`button`,{type:`button`,onClick:()=>m(e.id),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs transition-colors ${t?`bg-primary/10 text-primary`:`text-foreground hover:bg-surface-hover`}`,children:[a(`span`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border ${t?`border-primary bg-primary text-white`:`border-border`}`,children:t&&a(s,{className:`h-2.5 w-2.5`})}),a(`span`,{className:`truncate`,children:e.name})]},e.id)})]})]})}t();var M=[{label:`24h`,value:`24h`},{label:`7d`,value:`7d`},{label:`30d`,value:`30d`},{label:`All`,value:`all`}];function N({onChange:e}){let[t,r]=i(`all`),[o,s]=i(``),[c,l]=i(``);function u(t){r(t),s(``),l(``),e(_(t,Date.now()))}function d(t,n){r(`custom`),s(t),l(n),e({fromMs:S(t),toMs:C(n)})}let f=`rounded-md border border-border bg-surface px-2 py-1.5 text-[11px] text-foreground outline-none focus:border-primary [color-scheme:light] dark:[color-scheme:dark]`;return n(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[a(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:M.map(e=>a(`button`,{type:`button`,onClick:()=>u(e.value),className:`rounded px-2.5 py-1 text-[11px] transition-colors ${t===e.value?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:e.label},e.value))}),n(`div`,{className:`flex items-center gap-1`,children:[a(`input`,{type:`date`,"aria-label":`From date`,value:o,max:c||void 0,onChange:e=>d(e.target.value,c),className:`${f} ${t===`custom`&&o?`border-primary/50`:``}`}),a(`span`,{className:`text-[11px] text-foreground-subtle`,children:`→`}),a(`input`,{type:`date`,"aria-label":`To date`,value:c,min:o||void 0,onChange:e=>d(o,e.target.value),className:`${f} ${t===`custom`&&c?`border-primary/50`:``}`})]})]})}t();var P=2.6;function F({src:e,alt:t,className:r,overlay:s,fit:c=`contain`}){let[l,u]=i(!1),[d,f]=i(`50% 50%`);o(()=>{u(!1),f(`50% 50%`)},[e]);function p(e){if(!l){let t=e.currentTarget.getBoundingClientRect(),n=(e.clientX-t.left)/t.width*100,r=(e.clientY-t.top)/t.height*100;f(`${String(n)}% ${String(r)}%`)}u(e=>!e)}let m=c===`natural`;return a(`div`,{className:`relative overflow-hidden bg-background ${r??``}`,onClick:p,children:n(`div`,{className:`relative select-none transition-transform duration-200 ease-out ${m?`w-full`:`h-full w-full`} ${l?`cursor-zoom-out`:`cursor-zoom-in`}`,style:{transformOrigin:d,transform:l?`scale(${String(P)})`:`scale(1)`},children:[a(`img`,{src:e,alt:t,draggable:!1,className:m?`block h-auto w-full object-contain`:`h-full w-full object-contain`}),s]})})}function I(e){let{delayMs:t,invalidate:n,setTimeoutFn:r=setTimeout,clearTimeoutFn:i=clearTimeout}=e,a;function o(){a===void 0&&(a=r(()=>{a=void 0,n()},t))}function s(){a!==void 0&&(i(a),a=void 0)}return{trigger:o,cancel:s}}export{A as a,x as c,T as d,w as f,j as i,b as l,p as m,F as n,D as o,E as p,N as r,m as s,I as t,y as u};
1
+ import{K as e,Q as t,S as n,W as r,q as i,x as a,z 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{B as s,H as c,J as l,L as u,R as d,z as f}from"./index-BGfoUOZH.js";var p=l(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]);t();var m={fromMs:null,toMs:null},h=36e5,g=24*h;function _(e,t){switch(e){case`24h`:return{fromMs:t-g,toMs:null};case`7d`:return{fromMs:t-7*g,toMs:null};case`30d`:return{fromMs:t-30*g,toMs:null};case`all`:return m}}function v(e){return e.fromMs!==null||e.toMs!==null}function y(e,t){return v(t)?e.filter(e=>!(t.fromMs!==null&&e.timestamp<t.fromMs||t.toMs!==null&&e.timestamp>t.toMs)):[...e]}function b(e,t){return t.size===0?[...e]:e.filter(e=>t.has(e.deviceId))}function x(e){let t=new Set,n=[];for(let r of e)t.has(r.deviceId)||(t.add(r.deviceId),n.push(r.deviceId));return n}function S(e){if(!e)return null;let t=Date.parse(`${e}T00:00:00`);return Number.isNaN(t)?null:t}function C(e){if(!e)return null;let t=Date.parse(`${e}T23:59:59.999`);return Number.isNaN(t)?null:t}function w(e,t){if(!Number.isFinite(e)||e<=0)return`—`;let n=t-e;return n<6e4?`just now`:n<h?`${String(Math.floor(n/6e4))}m ago`:n<g?`${String(Math.floor(n/h))}h ago`:n<7*g?`${String(Math.floor(n/g))}d ago`:new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function T(e){return!Number.isFinite(e)||e<=0?`—`:new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function E(e){return!Number.isFinite(e)||e<=0?`—`:new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function D(e,t,n){let[a,s]=i(1);o(()=>{s(1)},[n]);let c=e.length,l=Math.max(1,Math.ceil(c/t)),u=Math.min(a,l);return o(()=>{u!==a&&s(u)},[u,a]),{page:u,setPage:s,pageItems:r(()=>{let n=(u-1)*t;return e.slice(n,n+t)},[e,u,t]),totalPages:l,totalItems:c,pageSize:t}}var O=2;function k(e,t){if(t<=1)return[{kind:`page`,n:1}];if(t<=7){let e=[];for(let n=1;n<=t;n++)e.push({kind:`page`,n});return e}let n=[],r=Math.max(2,e-O),i=Math.min(t-1,e+O);n.push({kind:`page`,n:1}),r>2&&n.push({kind:`ellipsis`,side:`left`});for(let e=r;e<=i;e++)n.push({kind:`page`,n:e});return i<t-1&&n.push({kind:`ellipsis`,side:`right`}),n.push({kind:`page`,n:t}),n}function A({currentPage:e,totalItems:t,pageSize:r,onPageChange:i,itemNoun:o=`items`}){if(t<=r)return null;let s=Math.ceil(t/r),c=(e-1)*r+1,l=Math.min(e*r,t),f=k(e,s),p=`inline-flex h-7 min-w-7 items-center justify-center rounded-md px-2 text-[11px] transition-colors disabled:opacity-40`;return n(`div`,{className:`flex items-center justify-between gap-4 flex-wrap pt-2 text-[11px] text-foreground-subtle`,children:[n(`span`,{children:[`Showing `,c,`–`,l,` of `,t,` `,o]}),n(`div`,{className:`flex items-center gap-1`,children:[a(`button`,{type:`button`,className:`${p} hover:bg-surface-hover`,onClick:()=>i(e-1),disabled:e<=1,"aria-label":`Previous page`,children:a(d,{className:`h-3.5 w-3.5`})}),f.map(t=>t.kind===`ellipsis`?a(`span`,{className:`px-1 opacity-60`,children:`…`},`ellipsis-${t.side}`):a(`button`,{type:`button`,className:`${p} ${t.n===e?`bg-primary/12 text-primary font-medium`:`hover:bg-surface-hover hover:text-foreground`}`,onClick:()=>i(t.n),"aria-current":t.n===e?`page`:void 0,children:t.n},t.n)),a(`button`,{type:`button`,className:`${p} hover:bg-surface-hover`,onClick:()=>i(e+1),disabled:e>=s,"aria-label":`Next page`,children:a(u,{className:`h-3.5 w-3.5`})})]})]})}t();function j({cameras:t,selected:r,onChange:l}){let[u,d]=i(!1),p=e(null);o(()=>{if(!u)return;function e(e){p.current&&e.target instanceof Node&&!p.current.contains(e.target)&&d(!1)}function t(e){e.key===`Escape`&&d(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[u]);function m(e){let t=new Set(r);t.has(e)?t.delete(e):t.add(e),l(t)}let h=r.size,g=h===0?`All cameras`:h===1?t.find(e=>r.has(e.id))?.name??`1 camera`:`${String(h)} cameras`;return n(`div`,{ref:p,className:`relative`,children:[n(`button`,{type:`button`,onClick:()=>d(e=>!e),disabled:t.length===0,className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs transition-colors disabled:opacity-40 ${h>0?`border-primary/40 bg-primary/8 text-primary`:`border-border text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:[a(c,{className:`h-3.5 w-3.5`}),a(`span`,{className:`max-w-[10rem] truncate`,children:g}),a(f,{className:`h-3 w-3 opacity-70`})]}),u&&n(`div`,{className:`absolute left-0 z-30 mt-1 max-h-64 w-[min(15rem,calc(100vw-1.5rem))] overflow-y-auto rounded-md border border-border bg-surface p-1 shadow-lg shadow-black/30`,children:[h>0&&a(`button`,{type:`button`,onClick:()=>l(new Set),className:`mb-1 w-full rounded px-2 py-1 text-left text-[11px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground`,children:`Clear selection`}),t.map(e=>{let t=r.has(e.id);return n(`button`,{type:`button`,onClick:()=>m(e.id),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs transition-colors ${t?`bg-primary/10 text-primary`:`text-foreground hover:bg-surface-hover`}`,children:[a(`span`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border ${t?`border-primary bg-primary text-white`:`border-border`}`,children:t&&a(s,{className:`h-2.5 w-2.5`})}),a(`span`,{className:`truncate`,children:e.name})]},e.id)})]})]})}t();var M=[{label:`24h`,value:`24h`},{label:`7d`,value:`7d`},{label:`30d`,value:`30d`},{label:`All`,value:`all`}];function N({onChange:e}){let[t,r]=i(`all`),[o,s]=i(``),[c,l]=i(``);function u(t){r(t),s(``),l(``),e(_(t,Date.now()))}function d(t,n){r(`custom`),s(t),l(n),e({fromMs:S(t),toMs:C(n)})}let f=`rounded-md border border-border bg-surface px-2 py-1.5 text-[11px] text-foreground outline-none focus:border-primary [color-scheme:light] dark:[color-scheme:dark]`;return n(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[a(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:M.map(e=>a(`button`,{type:`button`,onClick:()=>u(e.value),className:`rounded px-2.5 py-1 text-[11px] transition-colors ${t===e.value?`bg-primary/12 text-primary font-medium`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,children:e.label},e.value))}),n(`div`,{className:`flex items-center gap-1`,children:[a(`input`,{type:`date`,"aria-label":`From date`,value:o,max:c||void 0,onChange:e=>d(e.target.value,c),className:`${f} ${t===`custom`&&o?`border-primary/50`:``}`}),a(`span`,{className:`text-[11px] text-foreground-subtle`,children:`→`}),a(`input`,{type:`date`,"aria-label":`To date`,value:c,min:o||void 0,onChange:e=>d(o,e.target.value),className:`${f} ${t===`custom`&&c?`border-primary/50`:``}`})]})]})}t();var P=2.6;function F({src:e,alt:t,className:r,overlay:s,fit:c=`contain`}){let[l,u]=i(!1),[d,f]=i(`50% 50%`);o(()=>{u(!1),f(`50% 50%`)},[e]);function p(e){if(!l){let t=e.currentTarget.getBoundingClientRect(),n=(e.clientX-t.left)/t.width*100,r=(e.clientY-t.top)/t.height*100;f(`${String(n)}% ${String(r)}%`)}u(e=>!e)}let m=c===`natural`;return a(`div`,{className:`relative overflow-hidden bg-background ${r??``}`,onClick:p,children:n(`div`,{className:`relative select-none transition-transform duration-200 ease-out ${m?`w-full`:`h-full w-full`} ${l?`cursor-zoom-out`:`cursor-zoom-in`}`,style:{transformOrigin:d,transform:l?`scale(${String(P)})`:`scale(1)`},children:[a(`img`,{src:e,alt:t,draggable:!1,className:m?`block h-auto w-full object-contain`:`h-full w-full object-contain`}),s]})})}function I(e){let{delayMs:t,invalidate:n,setTimeoutFn:r=setTimeout,clearTimeoutFn:i=clearTimeout}=e,a;function o(){a===void 0&&(a=r(()=>{a=void 0,n()},t))}function s(){a!==void 0&&(i(a),a=void 0)}return{trigger:o,cancel:s}}export{A as a,x as c,T as d,w as f,j as i,b as l,p as m,F as n,D as o,E as p,N as r,m as s,I as t,y as u};