@camstack/addon-admin-ui 1.2.428 → 1.2.429

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 (167) hide show
  1. package/dist/assets/{AddonAssetIcon-Cs_blBpK.js → AddonAssetIcon-DR35yt0E.js} +1 -1
  2. package/dist/assets/Addons-gkGgGpTC.js +4 -0
  3. package/dist/assets/{AdminPage-DuuyDIsY.js → AdminPage-DAO24U0w.js} +1 -1
  4. package/dist/assets/AdminSectionedPage-B-qoE6ra.js +1 -0
  5. package/dist/assets/AiProfiles-BXcreqZP.js +3 -0
  6. package/dist/assets/BrokerForm-B3xs9aBj.js +1 -0
  7. package/dist/assets/Build-DeMAJfjN.js +40 -0
  8. package/dist/assets/Calendars-VPH-vy-o.js +1 -0
  9. package/dist/assets/Cluster-B-k0M79z.js +1 -0
  10. package/dist/assets/ClusterStepModel-DaAc_6nI.js +1 -0
  11. package/dist/assets/CompositionEditor-BrtLjoSu.js +1 -0
  12. package/dist/assets/{CompositionEditorPage-Acq7iapA.js → CompositionEditorPage-D51jS9td.js} +1 -1
  13. package/dist/assets/Data-IfJuKcwc.js +2 -0
  14. package/dist/assets/DeviceDetail-D1qU_p1k.js +2 -0
  15. package/dist/assets/DeviceDoActionFields-B62Nv4K7.js +1 -0
  16. package/dist/assets/Devices-Cf5Exjsk.js +1 -0
  17. package/dist/assets/{EmbedPlayerPage-RXOmf2F3.js → EmbedPlayerPage-CnEcSJ8D.js} +1 -1
  18. package/dist/assets/Identity-DNE80jdX.js +1 -0
  19. package/dist/assets/IntegrationDetail-LKbiJFU3.js +1 -0
  20. package/dist/assets/IntegrationHub-DdjWEObX.js +1 -0
  21. package/dist/assets/Integrations-CU7Ll9U_.js +1 -0
  22. package/dist/assets/Integrations-uZB2ozhn.js +1 -0
  23. package/dist/assets/Library-DSuCaXt6.js +1 -0
  24. package/dist/assets/Locations-BeaznsZS.js +3 -0
  25. package/dist/assets/{Logs-DIeXeCqI.js → Logs-cm-1R2Z4.js} +1 -1
  26. package/dist/assets/MaskShapeCanvas-CM9D4FOf.js +1 -0
  27. package/dist/assets/MotionZonesSettings-DqS8ndiK.js +1 -0
  28. package/dist/assets/MyAccess-Dxb11B6h.js +2 -0
  29. package/dist/assets/Network-BCDUHSB0.js +1 -0
  30. package/dist/assets/NodeAddonsSettingsPanel-BMat4ckt.js +1 -0
  31. package/dist/assets/Notifications-EPQiEZ1t.js +1 -0
  32. package/dist/assets/PrivacyMaskSettings-Bis0PO01.js +1 -0
  33. package/dist/assets/Recordings-BCeoXxL4.js +1 -0
  34. package/dist/assets/ScanNetworkModal-dHWFmbFe.js +1 -0
  35. package/dist/assets/SceneMonitorEditor-SFMMIopn.js +1 -0
  36. package/dist/assets/SessionsList-BRTwG3uv.js +2 -0
  37. package/dist/assets/{Showroom-W2yJvb8s.js → Showroom-Er-hes9K.js} +1 -1
  38. package/dist/assets/System-BDXxfgsq.js +1 -0
  39. package/dist/assets/{Terminal-CrFum1tE.js → Terminal-B70jnm8e.js} +4 -4
  40. package/dist/assets/{Viewer-YBzeS3RA.js → Viewer-BsGL5Dfa.js} +1 -1
  41. package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-C7iEnSHU.js +1 -0
  42. package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEHpkaJP.js +1 -0
  43. package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DdJYWyu3.js +1 -0
  44. package/dist/assets/{_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-BsvPG3BX.js → _virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-DPkvGqVU.js} +1 -1
  45. package/dist/assets/{_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DtoGixA1.js → _virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-Cb2QlpvS.js} +1 -1
  46. package/dist/assets/{_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.js-PmiLsYEK.js → _virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.js-Cyj0Xie_.js} +4 -4
  47. package/dist/assets/{addon-icons-context-D6glxUQF.js → addon-icons-context--6Hi3qRW.js} +1 -1
  48. package/dist/assets/{archive-kvflMCgL.js → archive-DtcjevJM.js} +1 -1
  49. package/dist/assets/{authed-media-CSlndmzS.js → authed-media-LCmlAEZ5.js} +1 -1
  50. package/dist/assets/{bell-off-BYnwGeiH.js → bell-off-eQBpwamg.js} +1 -1
  51. package/dist/assets/board-model-wzCmdEKJ.js +1 -0
  52. package/dist/assets/{boxes-Dx4USyB3.js → boxes-DikDfAoo.js} +1 -1
  53. package/dist/assets/circle-slash-YVgGJTpJ.js +1 -0
  54. package/dist/assets/client-DYbvGOid.js +358 -0
  55. package/dist/assets/{cloud-upload-82x5w5u8.js → cloud-upload-DI9XunFf.js} +1 -1
  56. package/dist/assets/crop-CxZbpOyK.js +1 -0
  57. package/dist/assets/{device-integration-icon-bTnWrYe0.js → device-integration-icon-D2lWVDM2.js} +1 -1
  58. package/dist/assets/device-picker-model-C4w1vbly.js +1 -0
  59. package/dist/assets/dist-CPO0KWoy.js +358 -0
  60. package/dist/assets/dist-ChQzskeX.js +1 -0
  61. package/dist/assets/{eraser-B8Awx5Sj.js → eraser-Dl5ROV0l.js} +1 -1
  62. package/dist/assets/{file-up-LqDVgVVa.js → file-up-WS3s_T9x.js} +1 -1
  63. package/dist/assets/{hard-drive-download-C24D80x2.js → hard-drive-download-B1ard6ym.js} +1 -1
  64. package/dist/assets/{history-DZsORyBG.js → history-BMhP0SFG.js} +1 -1
  65. package/dist/assets/{hostInit-D2EmEDvv.js → hostInit-FCvre9AW.js} +1 -1
  66. package/dist/assets/i18n-Vb3uBp7P.js +1 -0
  67. package/dist/assets/{icons-D5RaCH1q.js → icons-DocdgFuy.js} +1 -1
  68. package/dist/assets/index-DKqvG7BE.css +2 -0
  69. package/dist/assets/index-DvOECbab.js +4 -0
  70. package/dist/assets/{key-DLwSBrPM.js → key-B1M6i1mf.js} +1 -1
  71. package/dist/assets/{key-round-CYflkUyd.js → key-round-yCDTbIQb.js} +1 -1
  72. package/dist/assets/{layers-C1wzFfr1.js → layers-c960YTPf.js} +1 -1
  73. package/dist/assets/linked-devices-model-CB7qgVjI.js +1 -0
  74. package/dist/assets/{list-ordered-CFeS9o_w.js → list-ordered-C7hEwAd1.js} +1 -1
  75. package/dist/assets/location-owned-usage-D28vwYJT.js +1 -0
  76. package/dist/assets/{log-in-Be_RcxDr.js → log-in-DFfxcqYz.js} +1 -1
  77. package/dist/assets/{memory-stick-4BwYEagi.js → memory-stick-BBfIGrWx.js} +1 -1
  78. package/dist/assets/{message-square-plus-D7BNG3h7.js → message-square-plus-D8ZUT6rz.js} +1 -1
  79. package/dist/assets/{mf-entry-bootstrap-0-9df0d08c.js → mf-entry-bootstrap-0-3035e647.js} +2 -2
  80. package/dist/assets/{mic-off-e162Bcfu.js → mic-off-w2mFOBi3.js} +1 -1
  81. package/dist/assets/{monitor-off-CARYfHC4.js → monitor-off-DPi_gm_c.js} +1 -1
  82. package/dist/assets/{monitor-smartphone-lsNgnRRZ.js → monitor-smartphone-9Ife1Trw.js} +1 -1
  83. package/dist/assets/mount-C4w1vbly.js +1 -0
  84. package/dist/assets/notification-schedule-field-BuLfSYLZ.js +1 -0
  85. package/dist/assets/{octagon-alert-h80nyWRM.js → octagon-alert-C-jH7VH_.js} +1 -1
  86. package/dist/assets/player-overlays-D0U2dNvn.js +1 -0
  87. package/dist/assets/{recycle-0MLWppmT.js → recycle-Bbki65G2.js} +1 -1
  88. package/dist/assets/remoteEntry-DYVoozgD.js +1 -0
  89. package/dist/assets/{scan-eye-DVK8MF3K.js → scan-eye-AfIM_Dlr.js} +1 -1
  90. package/dist/assets/{scissors-Cz3GoeOd.js → scissors-CnL6g0BO.js} +1 -1
  91. package/dist/assets/{search-x-i_A-Upbe.js → search-x-eqJd3G8u.js} +1 -1
  92. package/dist/assets/{send-B5VKcNUH.js → send-B72RQ9UL.js} +1 -1
  93. package/dist/assets/{settings-2-ZQsYJ0Zb.js → settings-2-CXZ6DVRg.js} +1 -1
  94. package/dist/assets/{speaker-Cl8DZGk_.js → speaker-CcCWWecW.js} +1 -1
  95. package/dist/assets/src-CGxdJN_f.js +67 -0
  96. package/dist/assets/{timer-reset-A5ofAkBW.js → timer-reset-B9Lihcw9.js} +1 -1
  97. package/dist/assets/{ungroup-t0yDnzVf.js → ungroup-D753owNE.js} +1 -1
  98. package/dist/assets/{unlink-C1ZpCxl3.js → unlink-DzoLNfsq.js} +1 -1
  99. package/dist/assets/{usb-DmUPajSy.js → usb-CuSU-_EY.js} +1 -1
  100. package/dist/assets/{use-scenes-feed-BQlYhRMq.js → use-scenes-feed-CZjJNxfD.js} +1 -1
  101. package/dist/assets/{use-stationary-objects-BWM4vE0E.js → use-stationary-objects-BoGqWyLV.js} +1 -1
  102. package/dist/assets/useEventInvalidation-C4w1vbly.js +1 -0
  103. package/dist/assets/useNodeUrlSelection-BA6CgjTU.js +1 -0
  104. package/dist/assets/useTranslation-D3Is_4B6.js +1 -0
  105. package/dist/assets/user-round-CMg3Ndlt.js +1 -0
  106. package/dist/assets/{user-x-DRcPeM9C.js → user-x-PK8sSsso.js} +1 -1
  107. package/dist/assets/{video-tLHyNE3q.js → video-BBtESt54.js} +1 -1
  108. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DOOXjnRq.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BKfTL-9e.js} +2 -2
  109. package/dist/index.html +12 -12
  110. package/dist/server/addon.js +174 -5
  111. package/package.json +1 -1
  112. package/dist/assets/Addons-2xWF73cR.js +0 -4
  113. package/dist/assets/AdminSectionedPage-C3VHg80L.js +0 -1
  114. package/dist/assets/AiProfiles-DmHcVlS2.js +0 -3
  115. package/dist/assets/BrokerForm-Dqhjsi3Y.js +0 -1
  116. package/dist/assets/Build-CBYP1fT5.js +0 -40
  117. package/dist/assets/Calendars-C926x7b_.js +0 -1
  118. package/dist/assets/Cluster-OZlA14uV.js +0 -1
  119. package/dist/assets/ClusterStepModel-DHbwIGAW.js +0 -1
  120. package/dist/assets/CompositionEditor-vP3JcV2R.js +0 -1
  121. package/dist/assets/Data-7BoejvKA.js +0 -1
  122. package/dist/assets/DeviceDetail-ByM0856T.js +0 -2
  123. package/dist/assets/DeviceDoActionFields-BDJsvRNX.js +0 -1
  124. package/dist/assets/Devices-PIrWjfhq.js +0 -1
  125. package/dist/assets/Identity-C-tztwfa.js +0 -1
  126. package/dist/assets/IntegrationDetail-DugB7cv6.js +0 -1
  127. package/dist/assets/IntegrationHub-BePMbmC5.js +0 -1
  128. package/dist/assets/Integrations-Dj3nT9ZT.js +0 -1
  129. package/dist/assets/Integrations-OH5z-t03.js +0 -1
  130. package/dist/assets/Library-DDNti2te.js +0 -1
  131. package/dist/assets/Locations-OL9_NoSi.js +0 -3
  132. package/dist/assets/MaskShapeCanvas-Dcpby34M.js +0 -1
  133. package/dist/assets/MotionZonesSettings-CfTOerul.js +0 -1
  134. package/dist/assets/MyAccess-iJP3JQIS.js +0 -2
  135. package/dist/assets/Network-DYssxNiN.js +0 -1
  136. package/dist/assets/NodeAddonsSettingsPanel-mmtEgDbu.js +0 -1
  137. package/dist/assets/Notifications-DEcxFWp3.js +0 -1
  138. package/dist/assets/PrivacyMaskSettings-CJUKFEIs.js +0 -1
  139. package/dist/assets/Recordings-lygSYEJj.js +0 -1
  140. package/dist/assets/ScanNetworkModal-C2oJlLfj.js +0 -1
  141. package/dist/assets/SceneMonitorEditor-D1S-D2V9.js +0 -1
  142. package/dist/assets/SessionsList-CIN4GdSm.js +0 -2
  143. package/dist/assets/System-ChWpOOqN.js +0 -1
  144. package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CE2IIKhe.js +0 -1
  145. package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js +0 -1
  146. package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-DX7sYWrs.js +0 -1
  147. package/dist/assets/board-model-Bmts6hrg.js +0 -1
  148. package/dist/assets/circle-slash-D5mo-8G0.js +0 -1
  149. package/dist/assets/client-CMlUvfoK.js +0 -358
  150. package/dist/assets/crop-Dev61hIh.js +0 -1
  151. package/dist/assets/device-picker-model-DlnG_8P7.js +0 -1
  152. package/dist/assets/dist--5X8Gy0U.js +0 -1
  153. package/dist/assets/dist-Dod19ois.js +0 -358
  154. package/dist/assets/i18n-vggiB6gm.js +0 -1
  155. package/dist/assets/index-BgQGn3LX.js +0 -4
  156. package/dist/assets/index-BndCgmxf.css +0 -2
  157. package/dist/assets/linked-devices-model-CCTQ_gka.js +0 -1
  158. package/dist/assets/location-owned-usage-DSLiI6RY.js +0 -1
  159. package/dist/assets/mount-DlnG_8P7.js +0 -1
  160. package/dist/assets/notification-schedule-field-DWpT_5Vh.js +0 -1
  161. package/dist/assets/player-overlays-Cda8wso6.js +0 -1
  162. package/dist/assets/remoteEntry-V_83-NrI.js +0 -1
  163. package/dist/assets/src-eoSUZcV-.js +0 -67
  164. package/dist/assets/useEventInvalidation-DlnG_8P7.js +0 -1
  165. package/dist/assets/useNodeUrlSelection-CTxv9Em7.js +0 -1
  166. package/dist/assets/useTranslation-Bc5yH9V9.js +0 -1
  167. package/dist/assets/user-round-BTaID248.js +0 -1
@@ -1,4 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Devices-PIrWjfhq.js","./src-eoSUZcV-.js","./player-overlays-Cda8wso6.js","./client-CMlUvfoK.js","./__vite-browser-external-DF8Eb0aa.js","./useTranslation-Bc5yH9V9.js","./AdminPage-DuuyDIsY.js","./device-integration-icon-bTnWrYe0.js","./useEventInvalidation-DlnG_8P7.js","./Integrations-OH5z-t03.js","./i18n-vggiB6gm.js","./ScanNetworkModal-C2oJlLfj.js","./BrokerForm-Dqhjsi3Y.js","./mount-DlnG_8P7.js","./IntegrationDetail-DugB7cv6.js","./search-x-i_A-Upbe.js","./NodeAddonsSettingsPanel-mmtEgDbu.js","./addon-icons-context-D6glxUQF.js","./ClusterStepModel-DHbwIGAW.js","./video-tLHyNE3q.js","./usb-DmUPajSy.js","./crop-Dev61hIh.js","./layers-C1wzFfr1.js","./board-model-Bmts6hrg.js","./DeviceDetail-ByM0856T.js","./archive-kvflMCgL.js","./scan-eye-DVK8MF3K.js","./bell-off-BYnwGeiH.js","./boxes-Dx4USyB3.js","./circle-slash-D5mo-8G0.js","./CompositionEditor-vP3JcV2R.js","./use-stationary-objects-BWM4vE0E.js","./linked-devices-model-CCTQ_gka.js","./device-picker-model-DlnG_8P7.js","./authed-media-CSlndmzS.js","./Showroom-W2yJvb8s.js","./EmbedPlayerPage-RXOmf2F3.js","./Library-DDNti2te.js","./user-x-DRcPeM9C.js","./user-round-BTaID248.js","./AdminSectionedPage-C3VHg80L.js","./use-scenes-feed-BQlYhRMq.js","./Recordings-lygSYEJj.js","./scissors-Cz3GoeOd.js","./location-owned-usage-DSLiI6RY.js","./eraser-B8Awx5Sj.js","./hard-drive-download-C24D80x2.js","./format-size-DIxKXxtj.js","./Viewer-YBzeS3RA.js","./monitor-off-CARYfHC4.js","./Build-CBYP1fT5.js","./ungroup-t0yDnzVf.js","./DeviceDoActionFields-BDJsvRNX.js","./notification-schedule-field-DWpT_5Vh.js","./CompositionEditorPage-Acq7iapA.js","./Locations-OL9_NoSi.js","./speaker-Cl8DZGk_.js","./Addons-2xWF73cR.js","./octagon-alert-h80nyWRM.js","./useNodeUrlSelection-CTxv9Em7.js","./AiProfiles-DmHcVlS2.js","./message-square-plus-D7BNG3h7.js","./send-B5VKcNUH.js","./MyAccess-iJP3JQIS.js","./key-round-CYflkUyd.js","./monitor-smartphone-lsNgnRRZ.js","./unlink-C1ZpCxl3.js","./SessionsList-CIN4GdSm.js","./Logs-DIeXeCqI.js","./timer-reset-A5ofAkBW.js","./IntegrationHub-BePMbmC5.js","./settings-2-ZQsYJ0Zb.js","./AddonAssetIcon-Cs_blBpK.js","./addon-display-names-BkwMrExv.js","./Identity-C-tztwfa.js","./key-DLwSBrPM.js","./history-DZsORyBG.js","./Network-DYssxNiN.js","./file-up-LqDVgVVa.js","./log-in-Be_RcxDr.js","./Integrations-Dj3nT9ZT.js","./recycle-0MLWppmT.js","./Data-7BoejvKA.js","./cloud-upload-82x5w5u8.js","./System-ChWpOOqN.js","./Cluster-OZlA14uV.js","./memory-stick-4BwYEagi.js","./Terminal-CrFum1tE.js","./Terminal-kHJ-D0s7.css","./Notifications-DEcxFWp3.js","./list-ordered-CFeS9o_w.js","./Calendars-C926x7b_.js"])))=>i.map(i=>d[i]);
2
- import"./virtual_mf-exposes___mfe_internal__admin_ui_host__remoteEntry-_hash_-DnnXQRkG.js";import{a as e,o as t}from"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DOOXjnRq.js";import{t as n}from"./vite-preload-helper-kNaey6uv.js";import{A as r,B as i,D as a,E as o,I as s,J as c,K as l,L as u,M as d,N as f,O as p,P as m,Q as h,S as g,U as _,W as v,X as y,Y as b,a as x,b as S,d as C,j as w,k as T,o as E,q as D,u as O,x as k,z as A}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{Bi as j,Cr as M,Dn as N,Gn as P,Gt as F,Ir as ee,Jr as I,Kr as L,Lr as te,Nr as ne,Nt as re,Oi as ie,Pi as ae,Pn as oe,Q as R,Qi as se,Qt as z,Rn as ce,Rr as le,T as ue,Tr as de,Xt as fe,Yn as pe,Z as me,Zn as he,_i as ge,_r as _e,_t as ve,ar as ye,bi as be,bn as xe,di as Se,dn as Ce,dt as B,er as we,fn as Te,ft as Ee,ht as De,in as Oe,it as ke,ki as Ae,ln as je,nr as Me,on as Ne,ot as Pe,pi as Fe,pr as Ie,qi as Le,rt as Re,ui as ze,un as Be,ut as Ve,vi as He,wi as Ue,wn as We,wr as Ge,xr as Ke,yn as qe}from"./player-overlays-Cda8wso6.js";import{a as Je,c as Ye,d as Xe,f as Ze,i as Qe,l as $e,m as et,n as tt,o as nt,p as rt,r as it,s as at,t as ot,u as st}from"./video-tLHyNE3q.js";import{Hr as ct,Mr as lt,Xn as ut,fn as dt,lr as ft,mi as pt,mn as mt,n as ht,qr as gt,rr as _t,t as vt}from"./client-CMlUvfoK.js";import{$l as yt,$n as bt,$t as xt,Aa as St,An as Ct,Ar as wt,At as Tt,Ba as Et,Bn as Dt,Co as Ot,Cr as kt,Dn as At,Dt as jt,En as Mt,Et as Nt,Fa as Pt,Fl as Ft,G as It,Gl as Lt,Gn as Rt,Gr as zt,Hn as Bt,Hr as Vt,Jn as Ht,Kn as Ut,Kr as Wt,La as Gt,Oa as Kt,On as qt,Ot as Jt,Pa as Yt,Sn as Xt,St as Zt,Tn as Qt,Un as $t,Ur as en,V as tn,Va as nn,Wn as rn,Wr as an,Yn as on,Zl as sn,_r as cn,_u as ln,ca as un,co as dn,da as fn,du as pn,fa as mn,fr as hn,fu as gn,gn as _n,gt as vn,gu as yn,iu as bn,jn as xn,jt as Sn,ka as Cn,kn as wn,kt as Tn,l as En,lu as Dn,ma as On,mt as kn,n as An,nl as jn,ou as Mn,qn as Nn,ru as Pn,s as Fn,sa as In,sl as Ln,st as Rn,su as zn,tl as Bn,tr as Vn,tt as Hn,ua as Un,ut as Wn,uu as Gn,va as Kn,wl as qn,wn as Jn,xn as Yn}from"./src-eoSUZcV-.js";import{r as Xn,t as Zn}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-BsvPG3BX.js";import{t as Qn}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DtoGixA1.js";import{t as $n}from"./i18n-vggiB6gm.js";import{t as V}from"./useTranslation-Bc5yH9V9.js";import"./mount-DlnG_8P7.js";import{n as er,t as tr}from"./addon-icons-context-D6glxUQF.js";import{t as nr}from"./notification-schedule-field-DWpT_5Vh.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),h();var rr=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,ir=/^[\\/]{2}/;function ar(e,t){return t+e.replace(/\\/g,`/`)}var or=`popstate`;function sr(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function cr(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return dr(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:fr(t)}return mr(t,n,null,e)}function H(e,t){if(e===!1||e==null)throw Error(t)}function U(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function lr(){return Math.random().toString(36).substring(2,10)}function ur(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function dr(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?pr(t):t,state:n,key:t&&t.key||r||lr(),mask:i}}function fr({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function pr(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function mr(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=sr(e)?e:dr(h.location,e,t);n&&n(r,e),l=u()+1;let d=ur(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=sr(e)?e:dr(h.location,e,t);n&&n(r,e),l=u();let i=ur(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return hr(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(or,d),c=e,()=>{i.removeEventListener(or,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function hr(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),H(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:fr(t);return i=i.replace(/ $/,`%20`),!n&&ir.test(i)&&(i=r+i),new URL(i,r)}function gr(e,t,n=`/`){return _r(e,t,n,!1)}function _r(e,t,n,r,i){let a=W((typeof t==`string`?pr(t):t).pathname||`/`,n);if(a==null)return null;let o=i??yr(e),s=null,c=Ir(a);for(let e=0;s==null&&e<o.length;++e)s=Mr(o[e],c,r);return s}function vr(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function yr(e){let t=br(e);return Sr(t),t}function br(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;H(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=G([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(H(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),br(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Ar(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Fr(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of xr(e.path))a(e,t,!0,n)}),t}function xr(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=xr(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Sr(e){e.sort((e,t)=>e.score===t.score?jr(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Cr=/^:[\w-]+$/,wr=3,Tr=2,Er=1,Dr=10,Or=-2,kr=e=>e===`*`;function Ar(e,t){let n=e.split(`/`),r=n.length;return n.some(kr)&&(r+=Or),t&&(r+=Tr),n.filter(e=>!kr(e)).reduce((e,t)=>e+(Cr.test(t)?wr:t===``?Er:Dr),r)}function jr(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Mr(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Pr(u,l,s.matcher,s.compiledParams):Nr(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Nr({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:G([a,d.pathname]),pathnameBase:Gr(G([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=G([a,d.pathnameBase]))}return o}function Nr(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Fr(e.path,e.caseSensitive,e.end);return Pr(e,t,n,r)}function Pr(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Fr(e,t=!1,n=!0){U(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ir(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return U(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function W(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Lr(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?pr(e):e,a;return n?(n=Ur(n),a=n.startsWith(`/`)?Rr(n.substring(1),`/`):Rr(n,t)):a=t,{pathname:a,search:Kr(r),hash:qr(i)}}function Rr(e,t){let n=Wr(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function zr(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Br(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Vr(e){let t=Br(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Hr(e,t,n,r=!1){let i;typeof e==`string`?i=pr(e):(i={...e},H(!i.pathname||!i.pathname.includes(`?`),zr(`?`,`pathname`,`search`,i)),H(!i.pathname||!i.pathname.includes(`#`),zr(`#`,`pathname`,`hash`,i)),H(!i.search||!i.search.includes(`#`),zr(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Lr(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Ur=e=>e.replace(/[\\/]{2,}/g,`/`),G=e=>Ur(e.join(`/`)),Wr=e=>e.replace(/\/+$/,``),Gr=e=>Wr(e).replace(/^\/*/,`/`),Kr=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,qr=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Jr=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Yr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Xr(e){return G(e.map(e=>e.route.path).filter(Boolean))||`/`}var Zr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Qr(e,t){let n=e;if(typeof n!=`string`||!rr.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Zr)try{let e=new URL(window.location.href),r=ir.test(n)?new URL(ar(n,e.protocol)):new URL(n),a=W(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{U(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var $r=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set($r);var ei=[`GET`,...$r];new Set(ei);var ti=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function ni(e){try{return ti.includes(new URL(e).protocol)}catch{return!1}}var ri=a(null);ri.displayName=`DataRouter`;var ii=a(null);ii.displayName=`DataRouterState`;var ai=a(!1);function oi(){return u(ai)}var si=a({isTransitioning:!1});si.displayName=`ViewTransition`;var ci=a(new Map);ci.displayName=`Fetchers`;var li=a(null);li.displayName=`Await`;var K=a(null);K.displayName=`Navigation`;var ui=a(null);ui.displayName=`Location`;var q=a({outlet:null,matches:[],isDataRoute:!1});q.displayName=`Route`;var di=a(null);di.displayName=`RouteError`;var fi=`REACT_ROUTER_ERROR`,pi=`REDIRECT`,mi=`ROUTE_ERROR_RESPONSE`;function hi(e){if(e.startsWith(`${fi}:${pi}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function gi(e){if(e.startsWith(`${fi}:${mi}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Jr(t.status,t.statusText,t.data)}catch{}}function _i(e,{relative:t}={}){H(vi(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=u(K),{hash:i,pathname:a,search:o}=Di(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:G([n,a])),r.createHref({pathname:s,search:o,hash:i})}function vi(){return u(ui)!=null}function J(){return H(vi(),`useLocation() may be used only in the context of a <Router> component.`),u(ui).location}function yi(){return u(ui).navigationType}var bi=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function xi(e){u(K).static||_(e)}function Si(){let{isDataRoute:e}=u(q);return e?Ki():Ci()}function Ci(){H(vi(),`useNavigate() may be used only in the context of a <Router> component.`);let e=u(ri),{basename:t,navigator:n}=u(K),{matches:r}=u(q),{pathname:i}=J(),a=JSON.stringify(Vr(r)),o=l(!1);return xi(()=>{o.current=!0}),s((r,s={})=>{if(U(o.current,bi),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Hr(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:G([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var wi=a(null);function Ti(e){let t=u(q).outlet;return v(()=>t&&p(wi.Provider,{value:e},t),[t,e])}function Ei(){let{matches:e}=u(q);return e[e.length-1]?.params??{}}function Di(e,{relative:t}={}){let{matches:n}=u(q),{pathname:r}=J(),i=JSON.stringify(Vr(n));return v(()=>Hr(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Oi(e,t){return ki(e,t)}function ki(e,t,n){H(vi(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=u(K),{matches:i}=u(q),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Ji(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
3
-
4
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=J(),f;if(t){let e=typeof t==`string`?pr(t):t;H(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let m=f.pathname||`/`,h=m;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);h=`/`+m.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let g=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):gr(e,{pathname:h});U(l||g!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),U(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=Ii(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:G([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:G([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&_?p(ui.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},_):_}function Ai(){let e=Gi(),t=Yr(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:r},o={padding:`2px 4px`,backgroundColor:r},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=p(i,null,p(`p`,null,`💿 Hey developer 👋`),p(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,p(`code`,{style:o},`ErrorBoundary`),` or`,` `,p(`code`,{style:o},`errorElement`),` prop on your route.`)),p(i,null,p(`h2`,null,`Unexpected Application Error!`),p(`h3`,{style:{fontStyle:`italic`}},t),n?p(`pre`,{style:a},n):null,s)}var ji=p(Ai,null),Mi=class extends f{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=gi(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:p(q.Provider,{value:this.props.routeContext},p(di.Provider,{value:e,children:this.props.component}));return this.context?p(Pi,{error:e},t):t}};Mi.contextType=ai;var Ni=new WeakMap;function Pi({children:e,error:t}){let{basename:n}=u(K);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=hi(t.digest);if(e){let r=Ni.get(t);if(r)throw r;let i=Qr(e.location,n),a=i.absoluteURL||i.to;if(ni(a))throw Error(`Invalid redirect location`);if(Zr&&!Ni.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Ni.set(t,n),n}return p(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Fi({routeContext:e,match:t,children:n}){let r=u(ri);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),p(q.Provider,{value:e},n)}function Ii(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);H(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Xr(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,m=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||ji,o&&(s<0&&c===0?(Ji(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,m=null):s===c&&(d=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?f:d?m:n.route.Component?p(n.route.Component,null):n.route.element?n.route.element:e,p(Fi,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?p(Mi,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function Li(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ri(e){let t=u(ri);return H(t,Li(e)),t}function zi(e){let t=u(ii);return H(t,Li(e)),t}function Bi(e){let t=u(q);return H(t,Li(e)),t}function Vi(e){let t=Bi(e),n=t.matches[t.matches.length-1];return H(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Hi(){return Vi(`useRouteId`)}function Ui(){let e=zi(`useNavigation`);return v(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Wi(){let{matches:e,loaderData:t}=zi(`useMatches`);return v(()=>e.map(e=>vr(e,t)),[e,t])}function Gi(){let e=u(di),t=zi(`useRouteError`),n=Vi(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ki(){let{router:e}=Ri(`useNavigate`),t=Vi(`useNavigate`),n=l(!1);return xi(()=>{n.current=!0}),s(async(r,i={})=>{U(n.current,bi),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var qi={};function Ji(e,t,n){!t&&!qi[e]&&(qi[e]=!0,U(!1,n))}d(Yi);function Yi({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return ki(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Y({to:e,replace:t,state:n,relative:r}){H(vi(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=u(K);U(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=u(q),{pathname:o}=J(),s=Si(),c=Hr(e,Vr(a),o,r===`path`),l=JSON.stringify(c);return A(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function X(e){H(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Xi({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){H(!vi(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=v(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=pr(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:m=`default`,mask:h}=n,g=v(()=>{let e=W(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:m,mask:h},navigationType:r}},[s,l,u,d,f,m,r,h]);return U(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:p(K.Provider,{value:c},p(ui.Provider,{children:t,value:g}))}function Zi({children:e,location:t}){return Oi(Qi(e),t)}function Qi(e,t=[]){let n=[];return o.forEach(e,(e,a)=>{if(!r(e))return;let o=[...t,a];if(e.type===i){n.push.apply(n,Qi(e.props.children,o));return}H(e.type===X,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),H(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let s={id:e.props.id||o.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(s.children=Qi(e.props.children,o)),n.push(s)}),n}var $i=`get`,ea=`application/x-www-form-urlencoded`;function ta(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function na(e){return ta(e)&&e.tagName.toLowerCase()===`button`}function ra(e){return ta(e)&&e.tagName.toLowerCase()===`form`}function ia(e){return ta(e)&&e.tagName.toLowerCase()===`input`}function aa(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oa(e,t){return e.button===0&&(!t||t===`_self`)&&!aa(e)}function sa(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function ca(e,t){let n=sa(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var la=null;function ua(){if(la===null)try{new FormData(document.createElement(`form`),0),la=!1}catch{la=!0}return la}var da=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function fa(e){return e!=null&&!da.has(e)?(U(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ea}"`),null):e}function pa(e,t){let n,r,i,a,o;if(ra(e)){let o=e.getAttribute(`action`);r=o?W(o,t):null,n=e.getAttribute(`method`)||$i,i=fa(e.getAttribute(`enctype`))||ea,a=new FormData(e)}else if(na(e)||ia(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?W(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||$i,i=fa(e.getAttribute(`formenctype`))||fa(o.getAttribute(`enctype`))||ea,a=new FormData(o,e),!ua()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(ta(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=$i,r=null,i=ea,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ma={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},ha=/[&><\u2028\u2029]/g;function ga(e){return e.replace(ha,e=>ma[e])}function _a(e,t){if(e===!1||e==null)throw Error(t)}function va(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&W(i.pathname,t)===`/`?i.pathname=`${Wr(t)}/_root.${r}`:i.pathname=`${Wr(i.pathname)}.${r}`,i}async function ya(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[],import.meta.url);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ba(e){return e!=null&&typeof e.page==`string`}function xa(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Sa(e,t,n){return Da((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ya(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(xa).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Ca(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function wa(e,t,{includeHydrateFallback:n}={}){return Ta(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Ta(e){return[...new Set(e)]}function Ea(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Da(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!ba(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Ea(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Oa(){let e=u(ri);return _a(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function ka(){let e=u(ii);return _a(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Aa=a(void 0);Aa.displayName=`FrameworkContext`;function ja(){let e=u(Aa);return _a(e,`You must render this element inside a <HydratedRouter> element`),e}function Ma(e,t){let n=u(Aa),[r,i]=D(!1),[a,o]=D(!1),{onFocus:s,onBlur:c,onMouseEnter:d,onMouseLeave:f,onTouchStart:p}=t,m=l(null);A(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return m.current&&e.observe(m.current),()=>{e.disconnect()}}},[e]),A(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let h=()=>{i(!0)},g=()=>{i(!1),o(!1)};return n?e===`intent`?[a,m,{onFocus:Na(s,h),onBlur:Na(c,g),onMouseEnter:Na(d,h),onMouseLeave:Na(f,g),onTouchStart:Na(p,h)}]:[a,m,{}]:[!1,m,{}]}function Na(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Pa({page:e,...t}){let n=oi(),{nonce:r}=ja(),{router:i}=Oa(),a=v(()=>gr(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),p(n?Ia:La,{page:e,matches:a,...t})):null}function Fa(e){let{manifest:t,routeModules:n}=ja(),[r,i]=D([]);return A(()=>{let r=!1;return Sa(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ia({page:e,matches:t,...n}){let r=J(),{future:a}=ja(),{basename:o}=Oa();return p(i,null,v(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=va(e,o,a.v8_trailingSlashAwareDataRequests,`rsc`),i=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:s.push(e.route.id);return i&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.v8_trailingSlashAwareDataRequests,e,r,t]).map(e=>p(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function La({page:e,matches:t,...n}){let r=J(),{future:a,manifest:o,routeModules:s}=ja(),{basename:c}=Oa(),{loaderData:l,matches:u}=ka(),d=v(()=>Ca(e,t,u,o,r,`data`),[e,t,u,o,r]),f=v(()=>Ca(e,t,u,o,r,`assets`),[e,t,u,o,r]),m=v(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,i=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:n.add(e.route.id))}),n.size===0)return[];let u=va(e,c,a.v8_trailingSlashAwareDataRequests,`data`);return i&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,a.v8_trailingSlashAwareDataRequests,l,r,o,d,t,e,s]),h=v(()=>wa(f,o),[f,o]),g=Fa(f);return p(i,null,m.map(e=>p(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),h.map(e=>p(`link`,{key:e,rel:`modulepreload`,href:e,...n})),g.map(({key:e,link:t})=>p(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ra(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var za=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{za&&(window.__reactRouterVersion=`7.18.0`)}catch{}function Ba({basename:e,children:t,useTransitions:n,window:r}){let i=l();i.current??=cr({window:r,v5Compat:!0});let a=i.current,[o,c]=D({action:a.action,location:a.location}),u=s(e=>{n===!1?c(e):m(()=>c(e))},[n]);return _(()=>a.listen(u),[a,u]),p(Xi,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Va({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=D({action:n.action,location:n.location}),o=s(e=>{r===!1?a(e):m(()=>a(e))},[r]);return _(()=>n.listen(o),[n,o]),p(Xi,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Va.displayName=`unstable_HistoryRouter`;var Ha=T(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:a,replace:o,mask:s,state:c,target:l,to:d,preventScrollReset:f,viewTransition:m,defaultShouldRevalidate:h,...g},_){let{basename:v,navigator:y,useTransitions:b}=u(K),x=typeof d==`string`&&rr.test(d),S=Qr(d,v);d=S.to;let C=_i(d,{relative:r}),w=J(),T=null;if(s){let e=Hr(s,[],w.mask?w.mask.pathname:`/`,!0);v!==`/`&&(e.pathname=e.pathname===`/`?v:G([v,e.pathname])),T=y.createHref(e)}let[E,D,O]=Ma(n,g),k=Ya(d,{replace:o,mask:s,state:c,target:l,preventScrollReset:f,relative:r,viewTransition:m,defaultShouldRevalidate:h,useTransitions:b});function A(t){e&&e(t),t.defaultPrevented||k(t)}let j=!(S.isExternal||a),M=p(`a`,{...g,...O,href:(j?T:void 0)||S.absoluteURL||C,onClick:j?A:e,ref:Ra(_,D),target:l,"data-discover":!x&&t===`render`?`true`:void 0});return E&&!x?p(i,null,M,p(Pa,{page:C})):M});Ha.displayName=`Link`;var Ua=T(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let d=Di(a,{relative:c.relative}),f=J(),m=u(ii),{navigator:h,basename:g}=u(K),_=m!=null&&oo(d)&&o===!0,v=h.encodeLocation?h.encodeLocation(d).pathname:d.pathname,y=f.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(y=y.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&g&&(b=W(b,g)||b);let x=v!==`/`&&v.endsWith(`/`)?v.length-1:v.length,S=y===v||!r&&y.startsWith(v)&&y.charAt(x)===`/`,C=b!=null&&(b===v||!r&&b.startsWith(v)&&b.charAt(v.length)===`/`),w={isActive:S,isPending:C,isTransitioning:_},T=S?e:void 0,E;E=typeof n==`function`?n(w):[n,S?`active`:null,C?`pending`:null,_?`transitioning`:null].filter(Boolean).join(` `);let D=typeof i==`function`?i(w):i;return p(Ha,{...c,"aria-current":T,className:E,ref:l,style:D,to:a,viewTransition:o},typeof s==`function`?s(w):s)});Ua.displayName=`NavLink`;var Wa=T(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=$i,action:s,onSubmit:c,relative:l,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:h,...g},_)=>{let{useTransitions:v}=u(K),y=$a(),b=eo(s,{relative:l}),x=o.toLowerCase()===`get`?`get`:`post`,S=typeof s==`string`&&rr.test(s);return p(`form`,{ref:_,method:x,action:b,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,u=()=>y(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:h});v&&n!==!1?m(()=>u()):u()},...g,"data-discover":!S&&e===`render`?`true`:void 0})});Wa.displayName=`Form`;function Ga({getKey:e,storageKey:t,...n}){let r=u(Aa),{basename:i}=u(K),a=J(),o=Wi();io({getKey:e,storageKey:t});let s=v(()=>{if(!r||!e)return null;let t=ro(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),p(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${ga(JSON.stringify(t||to))}, ${ga(JSON.stringify(s))})`}})}Ga.displayName=`ScrollRestoration`;function Ka(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qa(e){let t=u(ri);return H(t,Ka(e)),t}function Ja(e){let t=u(ii);return H(t,Ka(e)),t}function Ya(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=Si(),f=J(),p=Di(e,{relative:o});return s(s=>{if(oa(s,t)){s.preventDefault();let t=n===void 0?fr(f)===fr(p):n,h=()=>d(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:l});u?m(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,o,c,l,u])}function Xa(e){U(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=l(sa(e)),n=l(!1),r=J(),i=v(()=>ca(r.search,n.current?null:t.current),[r.search]),a=Si();return[i,s((e,t)=>{let r=sa(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Za=0,Qa=()=>`__${String(++Za)}__`;function $a(){let{router:e}=qa(`useSubmit`),{basename:t}=u(K),n=Hi(),r=e.fetch,i=e.navigate;return s(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=pa(e,t);a.navigate===!1?await r(a.fetcherKey||Qa(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function eo(e,{relative:t}={}){let{basename:n}=u(K),r=u(q);H(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Di(e||`.`,{relative:t})},o=J();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:G([n,a.pathname])),fr(a)}var to=`react-router-scroll-positions`,no={};function ro(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:W(e.pathname,n)||e.pathname},t)),i??=e.key,i}function io({getKey:e,storageKey:t}={}){let{router:n}=qa(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Ja(`useScrollRestoration`),{basename:a}=u(K),o=J(),c=Wi(),l=Ui();A(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),ao(s(()=>{if(l.state===`idle`){let t=ro(o,c,a,e);no[t]=window.scrollY}try{sessionStorage.setItem(t||to,JSON.stringify(no))}catch(e){U(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,o,c,t])),typeof document<`u`&&(_(()=>{try{let e=sessionStorage.getItem(t||to);e&&(no=JSON.parse(e))}catch{}},[t]),_(()=>{let t=n?.enableScrollRestoration(no,()=>window.scrollY,e?(t,n)=>ro(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),_(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{U(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function ao(e,t){let{capture:n}=t||{};A(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function oo(e,{relative:t}={}){let n=u(si);H(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=qa(`useViewTransitionState`),i=Di(e,{relative:t});if(!n.isTransitioning)return!1;let a=W(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=W(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Nr(i.pathname,o)!=null||Nr(i.pathname,a)!=null}var so={streaming:{icon:ot,label:`Streaming`},detection:{icon:ee,label:`Detection`},recording:{icon:ze,label:`Recording`},audio:{icon:pe,label:`Audio`},snapshot:{icon:Ue,label:`Snapshot`},motion:{icon:Ve,label:`Motion`},ptz:{icon:je,label:`PTZ`},webrtc:{icon:xe,label:`WebRTC`},onvif:{icon:Oe,label:`ONVIF`},analytics:{icon:I,label:`Analytics`},"battery-operated":{icon:j,label:`Battery`},"native-snapshot":{icon:Ue,label:`Native Snapshot`},"pan-tilt-zoom":{icon:je,label:`PTZ`},"two-way-audio":{icon:pe,label:`Two-way Audio`},"doorbell-button":{icon:ae,label:`Doorbell`},rebootable:{icon:qe,label:`Rebootable`},"vacuum-has-map":{icon:Je,label:`Map`},"vacuum-has-ai":{icon:fe,label:`AI Obstacle`},"mower-has-map":{icon:Je,label:`Map`},"mower-has-targeted-mowing":{icon:M,label:`Targeted Mowing`}},co=ie;function lo({capabilities:e,showLabels:t=!1}){return k(`div`,{className:`flex items-center gap-1 flex-wrap`,children:e.map(e=>{let n=so[e],r=n?.icon??co,i=n?.label??e;return g(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] text-foreground-subtle`,title:i,children:[k(r,{className:`h-3 w-3`}),t&&k(`span`,{children:i})]},e)})})}h();var uo={amcrest:{icon:rt,color:`#3b82f6`,label:`Amcrest`},hikvision:{icon:Be,color:`#a855f7`,label:`Hikvision`},reolink:{icon:xe,color:`#06b6d4`,label:`Reolink`},homeassistant:{icon:_e,color:`#22d3ee`,label:`Home Assistant`},rtsp:{icon:De,color:`#78716c`,label:`RTSP`},onvif:{icon:De,color:`#78716c`,label:`ONVIF`}},fo={sm:`h-4 w-4`,md:`h-5 w-5`,lg:`h-6 w-6`},po={sm:`h-7 w-7`,md:`h-8 w-8`,lg:`h-10 w-10`};function mo(e){let t=e.toLowerCase();return t.startsWith(`provider-`)?t.slice(9):t}function ho(e){return uo[mo(e)]??{icon:rt,color:`#78716c`,label:e}}function go({type:e,size:t=`md`,showLabel:n}){let r=ho(e),i=r.icon,[a,o]=D(!1),s=er(e);return g(`div`,{className:`flex items-center gap-2`,children:[k(`div`,{className:`flex items-center justify-center rounded-lg ${po[t]}`,style:{backgroundColor:`${r.color}15`},children:a||!s?k(i,{className:fo[t],style:{color:r.color}}):k(`img`,{src:s,alt:r.label,className:fo[t],onError:()=>o(!0)})}),n&&k(`span`,{className:`text-xs font-medium text-foreground-subtle`,children:r.label})]})}function Z({label:e,value:t,layout:n=`inline`}){return n===`stacked`?g(`div`,{className:`min-w-0 flex flex-col gap-0.5 px-0.5`,children:[k(`span`,{className:`text-[11px] text-foreground-subtle`,children:e}),k(`div`,{className:`min-w-0 text-[11px] text-foreground`,children:t})]}):g(`div`,{className:`${ue} flex items-start gap-2 sm:gap-3`,children:[k(`span`,{className:`w-20 sm:w-28 flex-shrink-0 text-[11px] text-foreground-subtle`,children:e}),k(`div`,{className:`flex-1 min-w-0 text-[11px] text-foreground`,children:t})]})}h();function _o({deviceId:e,initialName:t,label:n=`Name`,layout:r=`inline`,onError:i,onSaved:a,onCancel:o}){let{t:s}=V(),c=E(),[u,d]=D(!1),[f,p]=D(t),[m,h]=D(!1),_=l(null);A(()=>{u||p(t)},[t,u]),A(()=>{u&&_.current?.focus()},[u]);let v=Yt({onSuccess:()=>{c.invalidateQueries({queryKey:[[`deviceManager`,`getDevice`]]}),c.invalidateQueries({queryKey:[[`deviceManager`,`listAll`]]}),c.invalidateQueries({queryKey:[[`deviceManager`,`getDeviceAggregate`]]})}}),y=async()=>{let n=f.trim();if(n.length===0||n===t){d(!1),p(t),a?.();return}h(!0);try{await v.mutateAsync({deviceId:e,name:n}),d(!1),a?.()}catch(e){i?.(e instanceof Error?e.message:String(e))}finally{h(!1)}},b=()=>{p(t),d(!1),o?.()};return u?k(Z,{label:n,layout:r,value:g(`div`,{className:`flex items-center gap-1`,children:[k(`input`,{ref:_,type:`text`,value:f,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`?y():e.key===`Escape`&&b()},disabled:m,className:`flex-1 min-w-0 px-1.5 py-0.5 text-[11px] bg-background border border-border rounded focus:outline-none focus:border-primary`}),k(`button`,{type:`button`,onClick:()=>void y(),disabled:m,className:`p-0.5 rounded hover:bg-success/10 text-success disabled:opacity-50`,"aria-label":s(`inlineEdit.save`),children:k(be,{className:`h-3 w-3`})}),k(`button`,{type:`button`,onClick:b,disabled:m,className:`p-0.5 rounded hover:bg-danger/10 text-danger disabled:opacity-50`,"aria-label":s(`inlineEdit.cancel`),children:k(B,{className:`h-3 w-3`})})]})}):k(Z,{label:n,layout:r,value:g(`div`,{className:`flex items-center gap-2 group`,children:[k(`span`,{className:`truncate`,children:t}),k(`button`,{type:`button`,onClick:()=>d(!0),className:`p-0.5 rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,"aria-label":s(`inlineEdit.editName`),children:k(oe,{className:`h-3.5 w-3.5`})})]})})}h();function vo({deviceId:e,initialLocation:t,label:n=`Location`,layout:r=`inline`,onError:i,onSaved:a,onCancel:o}){let{t:s}=V(),c=E(),[u,d]=D(!1),[f,p]=D(t??``),[m,h]=D(!1),_=l(null),{data:y}=Kn(void 0,{enabled:u}),b=y??[];A(()=>{u||p(t??``)},[t,u]),A(()=>{u&&_.current?.focus()},[u]);let x=St({onSuccess:()=>{c.invalidateQueries({queryKey:[[`deviceManager`,`getDevice`]]}),c.invalidateQueries({queryKey:[[`deviceManager`,`listAll`]]}),c.invalidateQueries({queryKey:[[`deviceManager`,`getDeviceAggregate`]]}),c.invalidateQueries({queryKey:[[`deviceManager`,`listLocations`]]})}}),S=v(()=>{let e=f.trim().toLowerCase();return e.length===0?b:b.filter(t=>t.toLowerCase()!==e&&t.toLowerCase().includes(e))},[b,f]),C=f.trim().length>0&&!b.some(e=>e.toLowerCase()===f.trim().toLowerCase()),w=async n=>{let r=(n??f).trim(),o=r.length===0?null:r;if(o===(t??null)){d(!1),a?.();return}h(!0);try{await x.mutateAsync({deviceId:e,location:o}),d(!1),a?.()}catch(e){i?.(e instanceof Error?e.message:String(e))}finally{h(!1)}},T=()=>{p(t??``),d(!1),o?.()};return u?k(Z,{label:n,layout:r,value:g(`div`,{className:`relative`,children:[g(`div`,{className:`flex items-center gap-1`,children:[k(`input`,{ref:_,type:`text`,value:f,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`?w():e.key===`Escape`&&T()},disabled:m,placeholder:s(`shared.locationRow.roomAreaOrLeaveEmpty`,`Room / area (or leave empty to clear)`),className:`flex-1 min-w-0 px-1.5 py-0.5 text-[11px] bg-background border border-border rounded focus:outline-none focus:border-primary`}),k(`button`,{type:`button`,onClick:()=>void w(),disabled:m,className:`p-0.5 rounded hover:bg-success/10 text-success disabled:opacity-50`,"aria-label":s(`inlineEdit.save`),children:k(be,{className:`h-3 w-3`})}),k(`button`,{type:`button`,onClick:T,disabled:m,className:`p-0.5 rounded hover:bg-danger/10 text-danger disabled:opacity-50`,"aria-label":s(`inlineEdit.cancel`),children:k(B,{className:`h-3 w-3`})})]}),(S.length>0||C)&&g(`div`,{className:`absolute z-10 left-0 right-0 mt-0.5 max-h-40 overflow-y-auto rounded-md border border-border bg-surface shadow-md`,children:[S.map(e=>g(`button`,{type:`button`,onClick:()=>{p(e),w(e)},className:`w-full flex items-center gap-2 px-2 py-1 text-left text-[11px] hover:bg-surface-hover`,children:[k(we,{className:`h-3 w-3 text-foreground-subtle flex-shrink-0`}),k(`span`,{className:`truncate`,children:e})]},e)),C&&g(`button`,{type:`button`,onClick:()=>void w(),className:`w-full flex items-center gap-2 px-2 py-1 text-left text-[11px] hover:bg-surface-hover border-t border-border`,children:[k(`span`,{className:`text-foreground-subtle`,children:s(`shared.locationRow.create`,`Create`)}),g(`span`,{className:`font-medium truncate`,children:[`"`,f.trim(),`"`]})]})]})]})}):k(Z,{label:n,layout:r,value:g(`div`,{className:`flex items-center gap-2 group`,children:[t?k(`span`,{className:`truncate`,children:t}):k(`span`,{className:`italic text-foreground-subtle`,children:`unset`}),k(`button`,{type:`button`,onClick:()=>d(!0),className:`p-0.5 rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors`,"aria-label":s(`inlineEdit.editLocation`),children:k(oe,{className:`h-3.5 w-3.5`})})]})})}h();function yo(e){return On({addonId:e,projection:`slim`})}function bo(e){return Un({deviceId:e},{enabled:Number.isFinite(e)})}var xo=3e4,So=2e3;function Co(e){let t=l(0);return t.current===0&&(t.current=Date.now()),un({parentDeviceId:e},{enabled:Number.isFinite(e),staleTime:0,refetchOnMount:`always`,refetchInterval:e=>{let n=e.state.data;return n&&n.length>0||Date.now()-t.current>=xo?!1:So}})}h();function wo({deviceId:e}){let{t}=V(),n=E(),{data:r}=bo(e),{data:i}=Co(e),[a,o]=D(null),s=Pt({onSuccess:()=>{o(null),n.invalidateQueries({queryKey:[[`deviceManager`]]})},onError:e=>{o(`Could not change primary child: ${e.message}`)}});if(r==null||String(r.type??``)!==lt.Container)return null;let c=(i??[]).map(e=>({id:e.id,stableId:e.stableId,type:e.type,name:e.name,...e.sourceInfo?{sourceInfo:{id:e.sourceInfo.id}}:{}}));if(c.length<=1)return null;let l=vn(c,typeof r.linkDeviceId==`number`?r.linkDeviceId:null,typeof r.primaryChildEntityId==`string`?r.primaryChildEntityId:null),u=l===null?c[0].id:l.id;return g(S,{children:[k(Z,{label:t(`shared.primaryChildRow.primaryChild`,`Primary child`),value:k(kn,{childrenList:c,selectedId:u,onSetPrimary:t=>s.mutate({deviceId:e,primaryChildEntityId:t}),disabled:s.isPending})}),a!==null&&k(`p`,{role:`alert`,className:`px-3 sm:px-4 py-1.5 text-[11px] text-danger`,children:a})]})}h();var To=[`manufacturer`,`model`,`hardware`,`firmware`,`serialNumber`,`uid`,`mac`,`itemNo`];function Eo(e){return e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase())}function Do(e){return e==null?`—`:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e)}function Oo(){let{t:e}=V(),t=Nn(),n=Ht(),{data:r}=Un({deviceId:t??0},{enabled:t!==null}),{data:i}=In({deviceId:t??0},{enabled:t!==null}),a=r??n??null,[o,s]=D(`identity`);if(t===null||!a)return null;let c=String(a.stableId??``),l=String(a.name??``),u=String(a.type??``),d=String(a.addonId??``),f=a.features??[],p=new Set([`device-status`,`feature-probe`,`device-ops`]),m=(i?.entries??[]).filter(e=>e.kind===`native`&&!p.has(e.capName)).map(e=>e.capName),h=f.length>0?f:m,_=a.location??null,v=a.metadata??null,y=v!==null&&Object.keys(v).length>0;return g(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[g(`div`,{className:`border-b border-border px-3 sm:px-4 py-2 flex items-center justify-between gap-3`,children:[k(`h2`,{className:`text-[11px] font-semibold text-foreground uppercase tracking-wider`,children:e(`overviewAdapters.deviceInfoAdapter.deviceInfo`,`Device Info`)}),y&&g(`div`,{className:`flex items-center gap-1 rounded-md bg-surface-hover p-0.5`,children:[k(ko,{active:o===`identity`,onClick:()=>s(`identity`),label:e(`overviewAdapters.deviceInfoAdapter.identity`,`Identity`)}),k(ko,{active:o===`hardware`,onClick:()=>s(`hardware`),label:e(`overviewAdapters.deviceInfoAdapter.hardware`,`Hardware`)})]})]}),(!y||o===`identity`)&&g(`div`,{className:`divide-y divide-border`,children:[k(Z,{label:`ID`,value:g(`span`,{className:`font-mono text-[11px] text-foreground`,children:[`#${t}`,g(`span`,{className:`ml-1.5 text-foreground-subtle`,children:[`(`,c,`)`]})]})}),k(_o,{deviceId:t,initialName:l}),k(vo,{deviceId:t,initialLocation:_}),k(wo,{deviceId:t}),k(Z,{label:e(`overviewAdapters.deviceInfoAdapter.type`,`Type`),value:u}),k(Z,{label:e(`overviewAdapters.deviceInfoAdapter.provider`,`Provider`),value:k(go,{type:d,size:`sm`,showLabel:!0})}),k(Z,{label:e(`overviewAdapters.deviceInfoAdapter.capabilities`,`Capabilities`),value:h.length>0?k(lo,{capabilities:h,showLabels:!0}):k(`span`,{className:`text-[11px] text-foreground-subtle`,children:e(`overviewAdapters.deviceInfoAdapter.none`,`None`)})})]}),y&&o===`hardware`&&k(Ao,{metadata:v})]})}function ko({active:e,onClick:t,label:n}){return k(`button`,{type:`button`,onClick:t,className:`px-2 py-0.5 rounded text-[10px] font-medium transition-colors ${e?`bg-surface text-foreground shadow-sm`:`text-foreground-subtle hover:text-foreground`}`,children:n})}function Ao({metadata:e}){let{t}=V(),n=To.filter(t=>t in e),r=Object.keys(e).filter(e=>!To.includes(e)).toSorted(),i=[...n,...r];return g(`div`,{children:[k(`div`,{className:`px-3 sm:px-4 py-1.5 text-[10px] text-foreground-subtle border-b border-border bg-surface-subtle/40`,children:t(`overviewAdapters.deviceInfoAdapter.autoPopulatedByTheDriver`,`Auto-populated by the driver on every connect. Read-only.`)}),k(`div`,{className:`divide-y divide-border`,children:i.map(t=>k(Z,{label:Eo(t),value:k(`span`,{className:`font-mono text-[11px] text-foreground break-all`,children:Do(e[t])})},t))})]})}function jo(e){return e.hubReachable?e.authOk===!1?{kind:`auth-expired`}:{kind:`cluster-degraded`,offlineAgents:e.offlineAgents,offlineAgentIds:e.offlineAgentIds}:{kind:`hub-unreachable`}}function Mo(e){switch(e.kind){case`connected`:return null;case`reconnecting`:return{severity:`warning`,message:`Reconnecting…`,i18nKey:`connection.reconnecting`,showSpinner:!0};case`cluster-degraded`:{let t=e.offlineAgentIds??[];return t.length>0?{severity:`warning`,message:`Cluster degraded — ${t.length===1?`node ${t[0]}`:`nodes ${t.join(`, `)}`} not responding. Hub is online, live link re-establishing…`,i18nKey:`connection.degradedNodes`,i18nParams:{nodes:t.join(`, `),count:t.length},showSpinner:!0}:e.offlineAgents!==null&&e.offlineAgents>0?{severity:`warning`,message:`Cluster degraded — ${e.offlineAgents} cluster node${e.offlineAgents===1?``:`s`} offline. Hub is online, live link re-establishing…`,i18nKey:`connection.degradedCount`,i18nParams:{count:e.offlineAgents},showSpinner:!0}:{severity:`warning`,message:`Live connection interrupted — hub is online (a cluster node may be unresponsive), re-establishing…`,i18nKey:`connection.degraded`,showSpinner:!0}}case`hub-unreachable`:return{severity:`danger`,message:`Server unreachable — reconnecting…`,i18nKey:`connection.disconnected`,showSpinner:!0};case`auth-expired`:return{severity:`danger`,message:`Session expired — please sign in again.`,i18nKey:`connection.sessionExpired`,showSpinner:!1,action:`sign-in`}}}var No=4e3,Po=5e3;function Fo(e){if(typeof e!=`object`||!e)return{offline:null,offlineIds:null,ok:null};let t={...e},n=typeof t.ok==`boolean`?t.ok:null,r=t.agents;if(typeof r!=`object`||!r)return{offline:null,offlineIds:null,ok:n};let i={...r},a=i.offline,o=typeof a==`number`?a:null,s=i.offlineIds;return{offline:o,offlineIds:Array.isArray(s)?s.filter(e=>typeof e==`string`):null,ok:n}}async function Io(e,t,n,r){let i=new AbortController,a=setTimeout(()=>i.abort(),n);try{return await e(t,{method:`GET`,signal:i.signal,credentials:`omit`,...r===void 0?{}:{headers:r}})}finally{clearTimeout(a)}}async function Lo(e){let t=e.fetchFn??fetch,n=e.timeoutMs??No,r=e.origin.replace(/\/+$/,``),i;try{i=await Io(t,`${r}/health`,n)}catch{return{hubReachable:!1,authOk:`unknown`,offlineAgents:null,offlineAgentIds:null}}if(!i.ok)return{hubReachable:!1,authOk:`unknown`,offlineAgents:null,offlineAgentIds:null};let a=null,o=e.getToken();if(o!==null&&o!==``)try{let e=await Io(t,`${r}/health/details`,n,{Authorization:`Bearer ${o}`});e.ok&&(a=await e.json())}catch{}let s;try{s=Fo(a??await i.json())}catch{s={offline:null,offlineIds:null,ok:null}}if(s.ok===!1)return{hubReachable:!1,authOk:`unknown`,offlineAgents:null,offlineAgentIds:null};let c=e.getToken(),l=`unknown`;if(c!==null&&c!==``)try{let e=await Io(t,`${r}/trpc/auth.me`,n,{Authorization:`Bearer ${c}`});e.status===401||e.status===403?l=!1:e.ok&&(l=!0)}catch{l=`unknown`}return{hubReachable:!0,authOk:l,offlineAgents:s.offline,offlineAgentIds:s.offlineIds}}var Ro={kind:`connected`},zo={kind:`reconnecting`};function Bo(e){let t=e.probeIntervalMs??Po,n=new Set,r=Ro,i=0,a=!1,o=null;function s(e){if(r!==e){r=e;for(let e of n)e()}}function c(){a=!1,o!==null&&(clearTimeout(o),o=null)}function l(){let n=i;e.probe().then(e=>{n!==i||!a||(s(jo(e)),o=setTimeout(l,t))},()=>{n!==i||!a||(s({kind:`hub-unreachable`}),o=setTimeout(l,t))})}function u(e){if(i+=1,e===`connected`){c(),s(Ro);return}if(e===`connecting`){c(),s(zo);return}(r.kind===`connected`||r.kind===`reconnecting`)&&s(zo),o!==null&&(clearTimeout(o),o=null),a=!0,l()}return{getSnapshot:()=>r,subscribe:e=>(n.add(e),()=>{n.delete(e)}),onSdkConnectionState:u,dispose:()=>{i+=1,c(),n.clear()}}}var Vo=null;function Ho(){return Vo===null&&(Vo=Bo({probe:()=>Lo({origin:me(),getToken:()=>localStorage.getItem(`camstack_admin_token`)})})),Vo}function Uo(e){Ho().onSdkConnectionState(e)}var Wo=null,Go=0;function Q(){if(!Wo){let e=Go;Wo=Sn({serverUrl:me(),token:localStorage.getItem(`camstack_admin_token`)??void 0,onConnectionChange:t=>{e===Go&&Uo(t)}})}return Wo}function Ko(){let e=Wo;Wo=null,Go+=1,e?.close()}var qo=`camstack_admin_token`,Jo=`camstack_admin_refresh`,Yo=`camstack_admin_token_expires`;function Xo(e){try{let t=localStorage.getItem(e);return t!==null&&t.length>0?t:null}catch{return null}}function Zo(e,t){try{t===null?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}function Qo(){let e=Xo(qo);if(e===null)return null;let t=Xo(Jo),n=Number(Xo(Yo));return{token:e,...t===null?{}:{refreshToken:t},...Number.isFinite(n)&&n>0?{expiresAt:n}:{}}}function $o(e){Zo(qo,e.token),Zo(Jo,e.refreshToken??null),Zo(Yo,e.expiresAt===void 0?null:String(e.expiresAt))}function es(){Zo(qo,null),Zo(Jo,null),Zo(Yo,null)}function ts(e){let t=e.get(`token`);if(t===null||t.length===0)return null;let n=e.get(`refreshToken`),r=Number(e.get(`expiresAt`));return{token:t,...n!==null&&n.length>0?{refreshToken:n}:{},...Number.isFinite(r)&&r>0?{expiresAt:r}:{}}}async function ns(e){await fetch(R(`/api/auth/session`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({token:e})}).catch(()=>{})}var rs=new Set;function is(e){return rs.add(e),()=>rs.delete(e)}var as=null;function os(){return as===null&&(as=new Tt({refresh:async e=>{let t=Qo();if(t?.refreshToken!==void 0&&t.refreshToken!==e&&(t.expiresAt??0)>Date.now()+6e4)return t;let n=await Q().refreshSession(e);return{token:n.token,refreshToken:n.refreshToken,expiresAt:n.expiresAt}},onTokens:e=>{$o(e),Q().setToken(e.token),ns(e.token)},onExpired:()=>{es();for(let e of rs)e()}})),as}function ss(e){$o(e),os().adopt(e)}var cs=512;function ls(e){if(!e||e.length>cs)return null;let t=ct(e);return t===null?!e.startsWith(`/`)||e.startsWith(`//`)||e.includes(`\\`)||e.includes(`://`)||e.includes(`..`)||e===`/login`||e.startsWith(`/login?`)||e.startsWith(`/login/`)?null:{kind:`path`,path:e}:{kind:`app-callback`,url:t}}var us=/^[A-Za-z0-9_-]{43,128}$/,ds=/^[A-Za-z0-9._~-]{1,256}$/;function fs(e){let{codeChallenge:t,state:n}=e;return!t||!us.test(t)||(e.codeChallengeMethod??`S256`)!==`S256`||!n||!ds.test(n)?null:{codeChallenge:t,state:n,purpose:e.purpose===`step-up`?`step-up`:`new-session`}}var ps=`camstack:login-app-handoff`;function ms(e){if(!e)return null;try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=e=>{let n=Reflect.get(t,e);return typeof n==`string`?n:null};return fs({codeChallenge:n(`codeChallenge`),state:n(`state`),purpose:n(`purpose`)})}catch{return null}}function hs(e,t=Date.now()){e!==null&&Ds(ps,JSON.stringify(e),ms,t)}function gs(e=Date.now()){return Os(ps,ms,e)}function _s(e,t,n){return`${e}?${`code=${encodeURIComponent(t)}`}${n===void 0?``:`&state=${encodeURIComponent(n)}`}`}function vs(e,t=Date.now()){return js(t)??ls(e)}var ys=2048;function bs(e){return!e||e.length>ys||!e.startsWith(`/`)||e.startsWith(`//`)||e.includes(`\\`)||e.includes(`://`)||e.includes(`..`)||e===`/login`||e.startsWith(`/login?`)||e.startsWith(`/login/`)?null:e}function xs(e,t=Date.now()){Ds(Ts,e,bs,t)}function Ss(e=Date.now()){return Os(Ts,bs,e)}function Cs(e,t=Date.now()){return Ss(t)??bs(e)}var ws=`camstack:login-redirect`,Ts=`camstack:login-next`,Es=10*6e4;function Ds(e,t,n,r){let i=ks();if(!i||!n(t))return;let a={raw:t??``,at:r};try{i.setItem(e,JSON.stringify(a))}catch{}}function Os(e,t,n){let r=ks();if(!r)return null;let i=null;try{i=r.getItem(e),r.removeItem(e)}catch{return null}if(!i)return null;try{let e=JSON.parse(i);if(typeof e!=`object`||!e)return null;let r=Reflect.get(e,`at`),a=Reflect.get(e,`raw`);return typeof r!=`number`||typeof a!=`string`||n-r>Es?null:t(a)}catch{return null}}function ks(){if(typeof window>`u`)return null;try{return window.sessionStorage}catch{return null}}function As(e,t=Date.now()){Ds(ws,e,ls,t)}function js(e=Date.now()){return Os(ws,ls,e)}function Ms(e){try{let t=e.split(`.`);if(t.length<2||!t[1])return null;let n=JSON.parse(atob(t[1]));return{id:String(n.userId??``),username:String(n.username??`unknown`),isAdmin:!!n.isAdmin,exp:Number(n.exp??0),scopes:Ns(n.scopes)}}catch{return null}}function Ns(e){return ht(e)}function Ps(e){let t=Ms(e);return t?t.exp*1e3<Date.now():!0}h();var Fs=`changeme`;function Is(e){return{token:e.token,...e.refreshToken===void 0?{}:{refreshToken:e.refreshToken},...e.expiresAt===void 0?{}:{expiresAt:e.expiresAt}}}async function Ls(e,t){if(await ns(e),t.kind===`path`){window.location.replace(R(t.path));return}try{Ko();let e=gs();if(e===null)throw Error(`The app sent no PKCE challenge and state`);let{code:n}=await Q().trpcClient.auth.createHandoffCode.mutate({purpose:e.purpose,codeChallenge:e.codeChallenge,state:e.state});window.location.replace(_s(t.url,n,e.state))}catch{window.location.replace(R(`/`))}}async function Rs(e,t){await ns(e),window.location.replace(R(t))}var zs=a(null);function Bs({children:e}){let[t,n]=D(null),[r,i]=D(!0),[a,o]=D(!1);A(()=>{if(typeof window<`u`&&window.location.hash.startsWith(`#token=`)){let e=new URLSearchParams(window.location.hash.slice(1)),t=ts(e),n=t?.token??null;if(t!==null&&n!==null){ss(t);let r=js();if(r){Ls(n,r);return}let i=Ss()??bs(e.get(`next`));if(i){Rs(n,i);return}window.history.replaceState({},``,R(`/`))}}c()},[]);let c=async()=>{let e=Qo();if(e===null){i(!1);return}let t=e.token;if(e.refreshToken!==void 0){let n=os();n.adopt(e),await n.ensureFresh();let r=Qo();if(r===null){i(!1);return}t=r.token}if(Ps(t)){es(),i(!1);return}let r=Ms(t);if(!r){es(),i(!1);return}ns(t),Q().trpcClient.system.info.query().then(()=>n(r)).catch(e=>{let t=e?.data?.code;t===`UNAUTHORIZED`||t===`FORBIDDEN`?(os().stop(),es(),Ko()):n(r)}).finally(()=>i(!1))};A(()=>is(()=>{Ko(),n(null),o(!1)}),[]);let l=s(async(e,t)=>{let r=await Q().login(e,t,{refreshable:!0}),i=r.secondFactors??(r.requiresTotp===!0?[`totp`]:[]);if(i.length>0)return{kind:`second-factor`,challengeToken:r.token,factors:i};let a=r.token;return ss(Is(r)),await ns(a),Ko(),n(Ms(a)),o(t===Fs),{kind:`ok`}},[]),u=s(async(e,t)=>{let r=await Q().loginVerifyTotp(e,t,{refreshable:!0}),i=r.token;ss(Is(r)),await ns(i),Ko(),n(Ms(i)),o(!1)},[]),d=s(async(e,t)=>{ss({token:e,...t}),await ns(e),Ko(),n(Ms(e)),o(!1)},[]),f=s(()=>{Q().logout().catch(()=>{}),os().stop(),es(),fetch(R(`/api/auth/session`),{method:`DELETE`}).catch(()=>{}),Ko(),n(null),o(!1)},[]),p=s(()=>{o(!1)},[]);return k(zs.Provider,{value:{user:t,loading:r,mustChangePassword:a,login:l,verifyTotp:u,finalizePasskeyLogin:d,logout:f,clearMustChangePassword:p},children:e})}function Vs(){let e=u(zs);if(!e)throw Error(`useAuth must be used within AuthProvider`);return e}h();function Hs(e,t){for(let n of e)for(let e of n.fields){if(!(`key`in e)||e.key!==t)continue;if(e.type===`button`||e.type===`separator`||e.type===`info`)return!0;let r=e.immediate;return r===!0?!0:r===!1?!1:n.immediate===!0}return!1}function Us({schema:e,serverValues:t,onImmediateSave:n,onDeferredSave:r}){let[i,a]=D({}),[o,c]=D({}),[u,d]=D(!1),f=l(null),p=e?.sections??[],m=Object.keys(i).length>0,h=v(()=>({...t,...o,...i}),[t,o,i]);A(()=>{if(m||Object.keys(o).length>0){d(!0);return}f.current&&clearTimeout(f.current),f.current=setTimeout(()=>d(!1),500)},[m,o]),A(()=>()=>{f.current&&clearTimeout(f.current)},[]);let g=s(()=>{d(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>d(!1),2e3)},[]),_=s(e=>{g();let r={},o={},s={...t,...i};for(let[t,n]of Object.entries(e))s[t]!==n&&(Hs(p,t)?r[t]=n:o[t]=n);Object.keys(r).length>0&&n(r),a(e=>{let t={...e};for(let e of Object.keys(r))delete t[e];for(let[e,n]of Object.entries(o))t[e]=n;return t})},[g,t,i,p,n]),y=s(e=>{let t={},n={};for(let[r,a]of Object.entries(i))e.includes(r)?t[r]=a:n[r]=a;if(a(n),Object.keys(t).length===0)return;let o=Object.keys(t),s=r(t);if(s===void 0||typeof s.then!=`function`)return;c(e=>({...e,...t}));let l=()=>c(e=>{let t={...e};for(let e of o)delete t[e];return t});s.then(l,()=>{l(),a(e=>{let n={...e};for(let e of o)e in n||(n[e]=t[e]);return n})})},[i,r]),b=s(e=>{a(t=>{let n={...t};for(let t of e)delete n[t];return n})},[]),x=s(()=>{a({})},[]);return{values:h,pendingKeys:Object.keys(i),hasPendingEdits:m,editingPaused:u,handleChange:_,handleSave:y,handleDiscard:b,resetAll:x}}function Ws(e){return e>=8}h();function Gs(e){if(typeof e!=`object`||!e)return;let t=Reflect.get(e,`windows`);if(!(!Array.isArray(t)||t.length===0))return e}function Ks(e){return e.type===`multiselect`}function qs(e){let t=e.suggestions;return t===void 0||t.length===0?[]:t.map(e=>({value:e,label:e}))}function Js(e){return e.map(e=>({value:e.value,label:e.label,...e.description===void 0?{}:{description:e.description},...e.iconId===void 0?{}:{iconId:e.iconId}}))}function Ys(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Xs({field:e,values:t,onChange:n,disabled:r,translationFn:i,onTestField:a,externalProbe:o,allFields:s,onAction:c}){let{t:l}=V();if(e.type===`tags`){if(!Xt(e,t,s))return null;let a=e.creatable!==!1;return k(Vn,{mode:`multi`,options:qs(e),value:Ys(t[e.key]),onChange:t=>n(e.key,t),disabled:r===!0||e.disabled===!0,creatable:a,...e.createLabel===void 0?{}:{createLabel:e.createLabel},...e.maxTags===void 0?{}:{maxItems:e.maxTags},label:Qs(e.label,i),description:e.description===void 0?void 0:Qs(e.description,i),placeholder:e.placeholder??l(`formBuilder.formBuilder.searchOrAdd`,`Search or add…`),testId:`config-tags-${e.key}`})}if(e.type===`schedule`){if(!Xt(e,t,s))return null;let r=Qs(e.label,i),a=e.description===void 0?void 0:Qs(e.description,i),o=e.mode===`times`?`times`:`windows`;return g(`div`,{className:`space-y-1`,"data-testid":`config-schedule-${e.key}`,children:[r!==void 0&&k(`label`,{className:`block text-[11px] font-medium text-foreground-subtle`,children:r}),a!==void 0&&k(`p`,{className:`text-[10px] text-foreground-subtle`,children:a}),k(nr,{mode:o,value:Gs(t[e.key]),onChange:t=>n(e.key,t)})]})}return Ks(e)&&(Ws(e.options.length)||e.creatable===!0)?Xt(e,t,s)?k(Vn,{mode:`multi`,options:Js(e.options),value:Ys(t[e.key]),onChange:t=>n(e.key,t),disabled:r===!0||e.disabled===!0,creatable:e.creatable===!0,...e.createLabel===void 0?{}:{createLabel:e.createLabel},...e.maxItems===void 0?{}:{maxItems:e.maxItems},label:Qs(e.label,i),description:e.description===void 0?void 0:Qs(e.description,i),placeholder:e.placeholder??l(`formBuilder.formBuilder.searchToAdd`,`Search to add…`),testId:`config-multiselect-${e.key}`,listboxId:`msel-${e.key}`}):null:k(Yn,{field:e,values:t,onChange:n,disabled:r,translationFn:i,onTestField:a,externalProbe:o,allFields:s,onAction:c})}function Zs(e){return/^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)+$/.test(e)}function Qs(e,t){if(e!==void 0)return t&&Zs(e)?t(e):e}function $s({section:e,values:t,onChange:n,disabled:r,translationFn:i,onTestField:a,probeResults:o,onAction:s}){let[c,l]=D(e.defaultCollapsed??!1),u=e.style===`accordion`;if(e.fields.reduce((n,r)=>n+ +!!Xt(r,t,e.fields),0)===0)return null;let d=e.fields,f=e.columns??2,p=f===1?`grid-cols-1`:f===3?`grid-cols-1 @[480px]:grid-cols-2 @[880px]:grid-cols-3`:f===4?`grid-cols-1 @[480px]:grid-cols-2 @[1140px]:grid-cols-4`:`grid-cols-1 @[480px]:grid-cols-2`,m=e.fields.length===1&&e.fields[0]?.type===`widget`?e.fields[0]:void 0,h=m!==void 0||!e.title&&!e.description;return g(`div`,{className:`@container rounded-lg border border-border bg-surface p-3`,style:{containerType:`inline-size`},"data-settings-section":e.id,children:[!h&&g(`div`,{className:[`flex items-center justify-between mb-2`,u?`cursor-pointer`:``].join(` `),onClick:u?()=>l(e=>!e):void 0,children:[g(`div`,{children:[e.title&&k(`h3`,{className:`text-[11px] font-semibold text-foreground-subtle uppercase tracking-wider`,children:Qs(e.title,i)}),e.description&&k(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:Qs(e.description,i)})]}),u&&k(`span`,{className:`text-foreground-subtle text-xs ml-2`,children:c?`▸`:`▾`})]}),!(c&&!h)&&(m===void 0?k(S,{children:k(`div`,{className:`grid ${p} gap-x-3 gap-y-2.5`,children:d.map(c=>k(Xs,{field:c,values:t,onChange:n,disabled:r,translationFn:i,onTestField:a,externalProbe:o?.[c.key],allFields:e.fields,onAction:s},c.key))})}):k(Yn,{field:m,values:t,onChange:n,disabled:r,translationFn:i,onTestField:a,externalProbe:o?.[m.key],allFields:e.fields,onAction:s},m.key))]})}function ec({schema:e,values:t,onChange:n,disabled:r,translationFn:i,onTestField:a,probeResults:o,onClearProbe:s,onAction:c,visibilityContext:l}){let u=l?{...l,...t}:t,d=(e,r)=>{n({...t,[e]:r}),s?.(e)};return k(`div`,{className:`space-y-4`,children:e.sections.map((e,t)=>k($s,{section:e,values:u,onChange:d,disabled:r,translationFn:i,onTestField:a,probeResults:o,onAction:c},`${e.id}-${t}`))})}function tc({pendingCount:e,onSave:t,onDiscard:n,saving:r=!1,saveLabel:i=`Save`,discardLabel:a=`Discard`}){let{t:o}=V();return e<=0?null:g(`div`,{className:`sticky bottom-0 -mb-3 flex items-center justify-between gap-3 rounded-lg border border-primary/40 bg-primary/5 px-3 py-2 shadow-sm z-10`,children:[g(`span`,{className:`text-xs text-foreground`,children:[e,` unsaved change`,e===1?``:`s`]}),g(`div`,{className:`flex items-center gap-2`,children:[k(`button`,{type:`button`,onClick:n,disabled:r,className:`inline-flex items-center rounded-md border border-border px-2.5 py-1 text-xs text-foreground-subtle hover:bg-surface-hover disabled:opacity-50`,children:a}),k(`button`,{type:`button`,onClick:t,disabled:r,className:`inline-flex items-center rounded-md bg-primary px-3 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:r?o(`formBuilder.formSaveBar.saving`,`Saving…`):i})]})]})}function nc({tabs:e,activeId:t,onChange:n,countByTab:r,pendingByTab:i}){return e.length===0?null:k(`div`,{className:`flex flex-wrap items-center gap-1 border-b border-border shrink-0`,children:e.map(e=>{let a=e.id===t,o=r?.get(e.id)??0,s=i?.get(e.id)??0;return g(`button`,{type:`button`,onClick:()=>n(e.id),className:`relative shrink-0 px-3 py-1.5 text-xs font-medium rounded-t-md transition-colors -mb-px border-b-2 whitespace-nowrap ${a?`text-primary border-primary bg-primary/5`:`text-foreground-subtle border-transparent hover:text-foreground hover:bg-surface-hover`}`,children:[e.label,o>0&&g(`span`,{className:`ml-1.5 text-[10px] opacity-60`,children:[`(`,o,`)`]}),s>0&&k(`span`,{className:`ml-1.5 inline-flex h-1.5 w-1.5 rounded-full bg-primary`})]},e.id)})})}h();function rc({schema:e,values:t,pendingKeys:n,onChange:r,onAction:i,onSave:a,onDiscard:o,disabled:s,activeSubTab:c,onSubTabChange:u,flattenTabs:d=!1,visibilityContext:f}){let p=e.tabs??[],m=v(()=>{let t=new Map;for(let n of e.sections){let e=n.tab??`general`,r=t.get(e)??[];r.push(n),t.set(e,r)}return t},[e.sections]),h=new Set(p.map(e=>e.id)),_=[...p,...[...m.keys()].filter(e=>!h.has(e)).map(e=>({id:e,label:e,icon:`wrench`,order:100}))],y=_[0]?.id??`general`,[b,x]=D(y),S=u!==void 0,C=new Set(_.map(e=>e.id)),w=l(new Set);for(let e of C)w.current.add(e);let T=w.current,E=(e=>e&&(C.has(e)||T.has(e))?e:y)(S?c:b),O=e=>{S?u(e):x(e)},A=m.get(E)??[],j={sections:A.length<=1?A.length===1?[{...A[0],title:``}]:A:A.every(e=>!e.title)?[{...A[0],title:``,fields:A.flatMap(e=>e.fields)}]:A},M=k(tc,{pendingCount:n.length,onSave:()=>a(n),onDiscard:()=>o(n),saving:s});if(d||_.length<=1)return g(`div`,{className:`flex flex-col gap-3`,children:[k(ec,{schema:e,values:t,onChange:r,onAction:i,disabled:s,visibilityContext:f}),M]});let N=new Map,P=new Map;for(let[e,t]of m){N.set(e,t.length);let r=new Set,i=e=>{for(let t of e)if(`key`in t&&typeof t.key==`string`&&r.add(t.key),t.type===`group`)i(t.fields);else if(t.type===`sub-tabs`)for(let e of t.tabs)i(e.fields)};for(let e of t)i(e.fields);let a=n.filter(e=>r.has(e)).length;a>0&&P.set(e,a)}return g(`div`,{className:`flex flex-col gap-3`,children:[k(nc,{tabs:_.map(e=>({id:e.id,label:e.label})),activeId:E,onChange:O,countByTab:N,pendingByTab:P}),k(tn,{tabKey:E,children:k(ec,{schema:j,values:t,onChange:r,onAction:i,disabled:s,visibilityContext:f})}),M]})}var ic=`device-export`,ac=`export`,oc=`Export`;function sc(e){return e.type===`separator`||e.type===`info`||e.type===`object-array`||e.type===`widget`||e.type===`addon-action-button`||e.type===`device-action-button`?!1:e.type===`group`?e.fields.some(sc):e.type===`sub-tabs`?e.tabs.some(e=>e.fields.some(sc)):e.writerCapName===ic}function cc(e){return e.tab===`export`?!0:e.fields.some(sc)}var lc=`host/extensions-panel`;function uc(e){return e.type===`widget`?e.widgetId===lc:e.type===`group`?e.fields.some(uc):e.type===`sub-tabs`?e.tabs.some(e=>e.fields.some(uc)):!1}function dc(e){return e.fields.some(uc)}function fc(e,t){return!t&&e!==void 0&&ut.includes(e)}function pc(e){return e.location!==`top-tab`&&!cc(e)&&!dc(e)}function mc(e,t,n,r){return!r||fc(t,n)?!0:(e??[]).some(pc)}function hc(e,t){for(let n of e){if(n.type===`group`){hc(n.fields,t);continue}if(n.type===`sub-tabs`){for(let e of n.tabs)hc(e.fields,t);continue}if(!(`value`in n))continue;let e=n.value===void 0?n.default:n.value;e!==void 0&&(t[n.key]=e)}}function gc(e){let t={};for(let n of e)hc(n.fields,t);return t}h();function _c(e,t){return t&&t===`admin`?e:!0}function vc(e){if(!e)return null;let t={sections:[...e.sections].toSorted((e,t)=>{let n=e.tab??`general`,r=t.tab??`general`;return n===r?cc(e)&&cc(t)?e.id.localeCompare(t.id):(e.order??0)-(t.order??0):n.localeCompare(r)})};return e.tabs?{...t,tabs:e.tabs}:t}function yc(e){return e.type===`separator`||e.type===`info`||e.type===`button`||e.type===`widget`||e.type===`addon-action-button`||e.type===`device-action-button`}function bc(e){return e.key}function xc(e){if(!yc(e))return e.value}function Sc(e){return yc(e)?null:e}function Cc(e,t){for(let n of e)if(t(n),n.type===`group`)Cc(n.fields,t);else if(n.type===`sub-tabs`)for(let e of n.tabs)Cc(e.fields,t)}function wc(e){if(!e)return{};let t={};for(let n of e.sections)Cc(n.fields,e=>{let n=bc(e);n!==null&&(t[n]=xc(e))});return t}function Tc(e,t){if(!e)return null;let n=null;for(let r of e.sections)if(Cc(r.fields,e=>{if(n!==null||bc(e)!==t)return;let r=Sc(e);r&&r.writerCapName&&r.writerAddonId&&(n={capName:r.writerCapName,addonId:r.writerAddonId})}),n!==null)break;return n}function Ec(e){return{...e,fields:e.fields.map(Dc)}}function Dc(e){return e.type===`separator`||e.type===`info`||e.type===`button`||e.type===`object-array`?e:{...e,readonlyField:!0}}function Oc(e,t){return e&&{...e,sections:e.sections.map(e=>({...e,fields:e.fields.map(e=>{let n=Sc(e);return n?_c(t,n.minRole)?e:Dc(e):e})}))}}function kc({deviceId:e,sectionFilter:t,activeSubTab:n,onSubTabChange:r,flattenSubTabs:i,subTabGrouping:a}){let{t:o}=V(),c=E(),{user:u}=Vs(),d=u?.isAdmin===!0,f=l(!1),{data:p,isLoading:m}=fn({deviceId:e},{refetchInterval:()=>f.current?!1:2500,enabled:Number.isFinite(e)}),{data:h}=Un({deviceId:e},{enabled:Number.isFinite(e)}),_=p?.settings??null,y=p?.live??null,b=v(()=>{if(!_&&!y)return null;let e=_?.sections??[],n=(y?.sections??[]).map(Ec),r=[...e,...n],i=t?r.filter(t):r.filter(pc);if(i.length===0)return null;if(a){let e=i.map(e=>({...e,tab:a.groupOf(e)})),t=new Set(e.map(e=>e.tab)),n=a.tabs.filter(e=>t.has(e.id));return n.length>0?{tabs:n,sections:e}:{sections:e}}let o=new Set;for(let e of i)o.add(e.tab??`general`);let s=[..._?.tabs??[],...(y?.tabs??[]).filter(e=>!(_?.tabs??[]).some(t=>t.id===e.id))].filter(e=>o.has(e.id));return s.length>0?{tabs:s,sections:i}:{sections:i}},[_,y,t,a]),x=v(()=>gc([..._?.sections??[],...y?.sections??[]]),[_,y]),S=v(()=>vc(b),[b]),C=v(()=>Oc(S,d),[S,d]),w=v(()=>wc(C),[C]),T=jn(),D=Bn(),O=Et(),A=Kt(),j=nn({onSuccess:()=>{c.invalidateQueries({queryKey:[[`deviceManager`,`getDeviceAggregate`]]})}}),M={isPending:j.isPending,mutate:t=>{j.mutate({deviceId:e,changes:[...t]})}},N=Us({schema:C,serverValues:w,onImmediateSave:s(e=>{let t=Object.entries(e).map(([e,t])=>{let n=Tc(C,e);return n?{writerCapName:n.capName,writerAddonId:n.addonId,key:e,value:t}:null}).filter(e=>e!==null);t.length>0&&M.mutate(t)},[C,M]),onDeferredSave:s(async t=>{let n=Object.entries(t).map(([e,t])=>{let n=Tc(C,e);return n?{writerCapName:n.capName,writerAddonId:n.addonId,key:e,value:t}:null}).filter(e=>e!==null);if(n.length!==0)try{let t=await j.mutateAsync({deviceId:e,changes:n});if(t.failures.length>0)throw Error(t.failures.map(e=>e.error).join(`; `))}finally{await c.invalidateQueries({queryKey:[[`deviceManager`,`getDeviceAggregate`]]})}},[C,j,e,c])}),{values:P,pendingKeys:F,handleChange:ee,handleSave:I,handleDiscard:L}=N;if(f.current=N.editingPaused,m)return g(`div`,{className:`flex items-center justify-center py-12 text-foreground-subtle`,children:[k(ye,{className:`h-4 w-4 animate-spin mr-2`}),k(`span`,{className:`text-xs`,children:o(`device.deviceAggregateSection.loadingDeviceAggregate`,`Loading device aggregate…`)})]});if(!C||C.sections.length===0)return k(`div`,{className:`text-xs text-foreground-subtle italic py-4 text-center`,children:o(`device.deviceAggregateSection.noAggregateContributionsForThis`,`No aggregate contributions for this device.`)});async function te(t,n,r){if(t===`regenerate-rtsp-token`){let t=[`rtspUrl:`,`regenerateToken:`].find(e=>n.startsWith(e));if(!t)throw Error(`regenerate-rtsp-token: unrecognised key "${n}" (expected "rtspUrl:<streamId>" or "regenerateToken:<streamId>")`);let r=n.slice(t.length);if(!r)throw Error(`regenerate-rtsp-token: key "${n}" has no streamId after prefix`);let i=pt(e,r);await T.mutateAsync({brokerId:i}),c.invalidateQueries({queryKey:[[`deviceManager`,`getDeviceAggregate`]]});return}if(t===`test-probe`){if(!h)return{status:`error`,error:`Device metadata not loaded yet`};try{return await O.mutateAsync({addonId:h.addonId,type:h.type,key:n,value:r})}catch(e){return{status:`error`,error:e instanceof Error?e.message:String(e)}}}if(t===`refresh-probe`){if(!n.startsWith(`probedInfo:`))throw Error(`refresh-probe: unrecognised key "${n}" (expected "probedInfo:<streamId>")`);let t=n.slice(11);if(!t)throw Error(`refresh-probe: key "${n}" has no streamId after prefix`);let r=pt(e,t),i=await D.mutateAsync({brokerId:r});return c.invalidateQueries({queryKey:[[`deviceManager`,`getDeviceAggregate`]]}),i}if(t===`device-custom-action`){let t=await A.mutateAsync({deviceId:e,action:n,input:r});return c.invalidateQueries({queryKey:[[`deviceManager`,`getDeviceAggregate`]]}),t}throw Error(`[device-aggregate] unknown action "${t}"`)}return k(rc,{schema:C,values:P,pendingKeys:F,onChange:ee,onAction:te,onSave:I,onDiscard:L,disabled:M.isPending,activeSubTab:n,onSubTabChange:r,flattenTabs:i,visibilityContext:x})}var Ac=`w-full min-w-0 px-1.5 py-0.5 text-[11px] bg-background border border-border rounded focus:outline-none focus:border-primary disabled:opacity-50 disabled:cursor-not-allowed`,jc=0,Mc=10;function Nc(e){if(e.trim()===``)return``;let t=Number.parseInt(e,10);return Number.isFinite(t)?String(t<jc?jc:t>Mc?Mc:t):``}function Pc({value:e,onChange:t,disabled:n=!1,placeholder:r,className:i,id:a,"aria-label":o}){return k(`input`,{type:`number`,min:jc,max:Mc,step:1,id:a,className:i??Ac,"aria-label":o,placeholder:r,value:e,onChange:e=>{t(Nc(e.target.value))},disabled:n})}function Fc({deviceName:e,value:t,inheritedIcon:n,inheritedLabel:r,disabled:i,onChange:a}){let{t:o}=V(),s={trigger:o(`deviceDisplay.pickIcon`,{name:e}),panel:o(`deviceDisplay.iconFor`,{name:e}),searchPlaceholder:o(`deviceDisplay.iconSearchPlaceholder`),clear:r,noMatches:o(`deviceDisplay.iconNoMatches`)};return g(`div`,{className:`flex items-center gap-2`,children:[k(yt,{value:t===``?null:t,onPick:e=>a(e??``),categoryLabel:e=>o(`deviceDisplay.iconCategory.${e}`,{defaultValue:_t(e)}),fallbackGlyph:n,labels:s,disabled:i}),k(`span`,{className:`text-[11px] text-foreground-subtle`,children:t===``?r:t})]})}h();var Ic=`w-full min-w-0 px-1.5 py-0.5 text-[11px] bg-background border border-border rounded focus:outline-none focus:border-primary disabled:opacity-50`,Lc={icon:``,label:``,unit:``,precision:``,hidden:!1};function Rc(e){return{icon:e?.icon??``,label:e?.label??``,unit:e?.unit??``,precision:e?.precision===void 0?``:String(e.precision),hidden:e?.hidden===!0}}function zc(e){if(typeof e!=`object`||!e)return;let t=e.unit;return typeof t==`string`?t:void 0}function Bc(e){if(e.trim()===``)return;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:void 0}function Vc(e,t){let n=Bc(e.precision),r={...e.icon===``?{}:{icon:e.icon},...e.label.trim()===``?{}:{label:e.label.trim()},...e.unit===``?{}:{unit:e.unit},...n===void 0?{}:{precision:n},...e.hidden?{hidden:!0}:{},...t?.perCap===void 0?{}:{perCap:t.perCap}};return Object.keys(r).length===0?null:r}function Hc({deviceId:e}){zn();let{t}=V(),n=Pe(),r=E(),{data:i}=Un({deviceId:e},{enabled:e>0}),a=typeof i?.role==`string`&&i.role.length>0?i.role:null,o=a===null?void 0:Zt[a],s=o?.kind===`numeric`,c=String(i?.type??``),l=a!==null||i?.parentDeviceId!==null&&i?.parentDeviceId!==void 0,u=Fn(n.trpcClient,e,a??``),d=o?.kind===`numeric`?o.canonicalUnit:void 0,f=zc(u)??d,p=f===void 0?void 0:ft(f)??f,m=p===void 0?void 0:dt(p),[h,_]=D(null),v=h??Rc(i?.display),y=Cn({onSuccess:()=>{r.invalidateQueries({queryKey:[[`deviceManager`]]})}}),{data:b}=mn({},{staleTime:6e4,enabled:a!==null}),x=Gt({onSuccess:()=>{r.invalidateQueries({queryKey:[[`deviceManager`]]})}});if(i==null)return null;let C=e=>{_({...v,...e})},w=()=>{y.mutate({deviceId:e,display:Vc(v,i.display)})},T=()=>{_(Lc),y.mutate({deviceId:e,display:null})},O=()=>{if(a===null)return;let e=Bc(v.precision),t={...v.icon===``?{}:{icon:v.icon},...v.unit===``?{}:{unit:v.unit},...e===void 0?{}:{precision:e}},n={...b?.defaults,[a]:t};x.mutate({defaults:n})},A=a===null?void 0:b?.defaults[a]?.icon,j=A===void 0?void 0:Mn(A),M=a===null?pn(c):Dn(a),N={icon:j??M.icon,label:j===void 0?M.label:String(A)},P=a===null&&c===lt.Container?t(`deviceDisplay.inheritedContainer`):j===void 0?t(`deviceDisplay.inherited`,{name:N.label}):t(`deviceDisplay.inheritedRoleDefault`,{icon:N.label,role:M.label}),F=typeof i.name==`string`?i.name:`#${String(e)}`,ee=a===null?``:Dn(a).label;return g(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[k(`div`,{className:`border-b border-border px-3 sm:px-4 py-2`,children:k(`h2`,{className:`text-[11px] font-semibold text-foreground uppercase tracking-wider`,children:t(`deviceDisplay.title`)})}),g(`div`,{className:`divide-y divide-border`,children:[k(Z,{label:t(`deviceDisplay.icon`),value:k(Fc,{deviceName:F,value:v.icon,inheritedIcon:N.icon,inheritedLabel:P,disabled:y.isPending,onChange:e=>C({icon:e})})}),l&&k(Z,{label:t(`deviceDisplay.label`),value:k(`input`,{type:`text`,className:Ic,"aria-label":t(`deviceDisplay.label`),placeholder:a===null?F:ee,value:v.label,onChange:e=>C({label:e.target.value})})}),s&&g(S,{children:[k(Z,{label:t(`deviceDisplay.unit`),value:k(En,{dimension:m,value:v.unit,onChange:e=>C({unit:e}),disabled:y.isPending,"aria-label":t(`deviceDisplay.unit`),inheritLabel:t(`deviceDisplay.unitSource`,{unit:p===void 0?``:` (${p})`}),emptyReason:t(`deviceDisplay.unitSource`,{unit:``})})}),k(Z,{label:t(`deviceDisplay.precision`),value:k(Pc,{"aria-label":t(`deviceDisplay.precision`),placeholder:t(`deviceDisplay.precisionInherit`),value:v.precision,onChange:e=>C({precision:e}),disabled:y.isPending})})]}),k(Z,{label:t(`deviceDisplay.hidden`),value:g(`label`,{className:`flex items-center gap-2`,children:[k(`input`,{type:`checkbox`,checked:v.hidden,onChange:e=>C({hidden:e.target.checked})}),k(`span`,{className:`text-[11px] text-foreground`,children:t(`deviceDisplay.hideFromLists`)})]})})]}),g(`div`,{className:`border-t border-border px-3 sm:px-4 py-2 flex flex-wrap items-center gap-2`,children:[k(`button`,{type:`button`,className:`rounded bg-primary px-3 py-1 text-[11px] font-medium text-primary-foreground disabled:opacity-50`,onClick:w,disabled:y.isPending,children:t(`common.save`)}),k(`button`,{type:`button`,className:`rounded border border-border px-3 py-1 text-[11px] text-foreground-subtle`,onClick:T,disabled:y.isPending,children:t(`common.reset`)}),a!==null&&k(`button`,{type:`button`,className:`rounded border border-border px-3 py-1 text-[11px] text-foreground-subtle`,onClick:O,disabled:x.isPending,title:t(`deviceDisplay.setRoleDefaultTitle`,{role:ee}),children:t(`deviceDisplay.setRoleDefault`,{role:ee})})]})]})}h();function Uc({deviceId:e,onClose:t}){let{t:n}=V(),[r,i]=D(`info`),{data:a}=Un({deviceId:e},{enabled:e>0});return k(Qt,{open:!0,onOpenChange:e=>!e&&t(),children:g(At,{width:`lg`,scroll:`body`,children:[g(Ct,{children:[k(xn,{children:typeof a?.name==`string`&&a.name.length>0?a.name:`#${String(e)}`}),g(qt,{children:[n(`deviceQuickDetail.description`,{defaultValue:`Device info, display and export — same surfaces as the detail page.`}),` `,k(Ha,{to:`/devices/${String(e)}`,className:`text-primary hover:underline`,onClick:t,children:n(`deviceQuickDetail.openFull`,{defaultValue:`Open full detail`})})]})]}),k(`div`,{className:`mt-3 flex items-center gap-1 rounded-md bg-surface-hover p-0.5 w-fit`,children:[[`info`,n(`deviceQuickDetail.tabInfo`,{defaultValue:`Device info`})],[`display`,n(`deviceQuickDetail.tabDisplay`,{defaultValue:`Display`})],[`export`,n(`deviceQuickDetail.tabExport`,{defaultValue:`Export`})]].map(([e,t])=>k(`button`,{type:`button`,onClick:()=>i(e),className:`px-2.5 py-1 rounded text-[11px] font-medium transition-colors ${r===e?`bg-surface text-foreground shadow-sm`:`text-foreground-subtle hover:text-foreground`}`,children:t},e))}),k(Mt,{className:`mt-3`,children:g(Ut,{deviceId:e,device:a??void 0,children:[r===`info`&&k(Oo,{}),r===`display`&&k(Hc,{deviceId:e}),r===`export`&&k(kc,{deviceId:e,sectionFilter:cc})]})})]})})}function Wc({children:e}){let[t,n]=D(null),r=s(e=>n(e),[]),i=s(()=>n(null),[]);return g(Rn,{open:r,children:[e,t===null?null:k(Uc,{deviceId:t,onClose:i})]})}h();function Gc({tabs:e,active:t,onChange:n}){return k(`div`,{className:`flex rounded-lg border border-border bg-surface p-0.5 gap-0.5`,children:e.map(e=>k(`button`,{type:`button`,onClick:()=>n(e.id),className:[`flex-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors`,t===e.id?`bg-primary/12 text-primary`:`text-foreground-subtle hover:text-foreground hover:bg-surface-hover`].join(` `),children:e.label},e.id))})}function Kc(e){let t=e.formats;if(!t)return``;let n=Object.values(t).filter(e=>e!==void 0&&e.sizeMB>0).map(e=>e.sizeMB);if(n.length===0)return``;let r=Math.min(...n),i=Math.max(...n);return r===i?`${r} MB`:`${r}-${i} MB`}function qc(e){return`${e.inputSize.width}x${e.inputSize.height}`}function Jc(e){return e.formats?Object.keys(e.formats).filter(t=>e.formats[t]!==void 0):[]}function Yc({entry:e,selected:t,onSelect:n,disabled:r}){let i=Kc(e),a=qc(e),o=Jc(e);return g(`button`,{type:`button`,onClick:n,disabled:r,className:[`w-full text-left rounded-lg border p-3 transition-all`,t?`border-primary bg-primary/5 ring-1 ring-primary/30`:`border-border bg-background hover:border-foreground-subtle/40 hover:bg-surface-hover/50`,r?`opacity-50 cursor-not-allowed`:`cursor-pointer`].join(` `),children:[k(`div`,{className:`flex items-start justify-between gap-2`,children:g(`div`,{className:`flex-1 min-w-0`,children:[g(`div`,{className:`flex items-center gap-2`,children:[k(`span`,{className:`text-xs font-semibold text-foreground truncate`,children:e.name}),t&&k(be,{className:`h-3.5 w-3.5 text-primary shrink-0`})]}),k(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5 line-clamp-2`,children:e.description})]})}),g(`div`,{className:`flex items-center gap-3 mt-2 flex-wrap`,children:[g(`span`,{className:`inline-flex items-center gap-1 text-[10px] text-foreground-subtle`,children:[k(I,{className:`h-3 w-3`}),a]}),i&&k(`span`,{className:`text-[10px] text-foreground-subtle`,children:i}),o.length>0&&k(`div`,{className:`flex gap-1`,children:o.map(e=>k(`span`,{className:`text-[9px] uppercase rounded bg-surface border border-border px-1 py-0.5 text-foreground-subtle font-mono`,children:e},e))}),e.labels.length>0&&g(`span`,{className:`text-[10px] text-foreground-subtle`,children:[e.labels.length,` label`,e.labels.length===1?``:`s`]})]})]})}function Xc({field:e,value:t,onChange:n,disabled:r}){let{t:i}=V(),a=e.catalog??[],o=a.length>0,s=gt(a).length>0,c=e.allowCustomPath!==!1||e.allowCustom===!0,l=[...o?[{id:`catalog`,label:i(`formBuilder.modelSelector.models`,`Models ({{length}})`,{length:a.length})}]:[],...c?[{id:`custom`,label:i(`formBuilder.modelSelector.customPath`,`Custom Path`)}]:[]],[u,d]=D(o?`catalog`:`custom`),f=t==null?``:String(t);return g(`div`,{className:`space-y-3`,children:[l.length>1&&k(Gc,{tabs:l,active:u,onChange:d}),u===`catalog`&&o&&s&&k(_n,{catalog:a,value:f,onChange:e=>n(e),disabled:r||e.disabled}),u===`catalog`&&o&&!s&&k(`div`,{className:`space-y-1.5 max-h-[320px] overflow-y-auto pr-1`,children:a.filter(e=>e.legacy!==!0).map(t=>k(Yc,{entry:t,selected:f===t.id,onSelect:()=>n(t.id),disabled:r||e.disabled},t.id))}),u===`catalog`&&!o&&g(`div`,{className:`rounded-md border border-info/30 bg-info/5 px-3 py-2 flex items-start gap-2`,children:[k(Ie,{className:`h-3.5 w-3.5 text-info shrink-0 mt-0.5`}),k(`p`,{className:`text-[11px] text-foreground-subtle leading-relaxed`,children:i(`formBuilder.modelSelector.noPredefinedModelsAvailableUse`,`No predefined models available. Use the Custom Path tab to specify a model file path or URL.`)})]}),u===`custom`&&c&&g(`div`,{className:`space-y-2`,children:[k(`input`,{type:`text`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none disabled:opacity-50`,placeholder:i(`formBuilder.modelSelector.enterPathLikeDataModels`,`Enter path like /data/models/custom.onnx or https://...`),value:f,disabled:r||e.disabled,onChange:e=>n(e.target.value)}),e.acceptFormats&&e.acceptFormats.length>0&&g(`p`,{className:`text-[10px] text-foreground-subtle`,children:[i(`formBuilder.modelSelector.acceptedFormats`,`Accepted formats:`),` `,e.acceptFormats.join(`, `)]})]}),(e.compatibilityNote||e.conversionGuideUrl)&&g(`div`,{className:`flex items-start justify-between gap-3 pt-1`,children:[e.compatibilityNote&&g(`p`,{className:`flex items-start gap-1 text-[10px] text-foreground-subtle`,children:[k(Ie,{className:`h-3 w-3 mt-0.5 shrink-0`}),e.compatibilityNote]}),e.conversionGuideUrl&&g(`a`,{href:e.conversionGuideUrl,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1 text-[11px] text-primary hover:underline shrink-0`,children:[i(`formBuilder.modelSelector.howToConvertYourModel`,`How to convert your model`),k(le,{className:`h-3 w-3`})]})]})]})}function Zc({to:e}){let{search:t}=J();return k(Y,{to:`${e}${t}`,replace:!0})}h();var Qc=`Only an admin can reveal a stored secret.`;function $c(e){if(typeof e!=`object`||!e)return null;let t=Reflect.get(e,`data`);if(typeof t!=`object`||!t)return null;let n=Reflect.get(t,`code`);return typeof n==`string`?n:null}function el(e){let t=$c(e);if(t===`FORBIDDEN`||t===`UNAUTHORIZED`)return Qc;let n=e instanceof Error?e.message:String(e);return n.length>0?`Could not reveal: ${n}`:`Could not reveal the stored value.`}function tl({children:e}){let t=Ot();return k(Lt,{reveal:s(async e=>{try{return(await t.mutateAsync({ref:e})).value}catch(e){throw Error(el(e))}},[t]),children:e})}h();function nl(){let e=Pe(),t=E(),[n,r]=D(()=>e.isConnected()?`connected`:`disconnected`),i=l(!1),[a,o]=D(0),[s,c]=D([]);A(()=>e.subscribeConnectionEvents(e=>{r(t=>(t!==`connected`&&e===`connected`&&i.current&&o(e=>e+1),e!==`connected`&&(i.current=!0),e))}),[e]),A(()=>{a!==0&&t.invalidateQueries({queryKey:[[`addons`,`getLastRestart`]]})},[a,t]);let{data:u}=kt(void 0,{enabled:n===`connected`&&a>0,staleTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}),d=l(null);return A(()=>{if(u==null||u.requestedAt===d.current)return;d.current=u.requestedAt;let e=il(u);c(t=>[...t,e]);let t=window.setTimeout(()=>{c(t=>t.filter(t=>t.id!==e.id))},6e3);return()=>window.clearTimeout(t)},[u]),k(S,{children:s.length>0&&k(rl,{toasts:s})})}function rl({toasts:e}){return k(`div`,{className:`fixed top-[calc(env(safe-area-inset-top)+1rem)] right-[calc(env(safe-area-inset-right)+1rem)] z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none`,children:e.map(e=>g(`div`,{className:`pointer-events-auto flex items-start gap-2 px-3 py-2.5 rounded-md border border-green-500/30 bg-green-500/10 shadow-lg backdrop-blur-sm`,children:[k(Se,{className:`w-4 h-4 shrink-0 mt-0.5 text-green-400`}),g(`div`,{children:[k(`div`,{className:`text-[11px] font-semibold text-foreground`,children:e.title}),k(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:e.message})]})]},e.id))})}function il(e){let t=`restart-${e.requestedAt}`;if(e.kind===`framework-update`&&e.packageName!==void 0&&e.toVersion!==void 0){let n=e.fromVersion===void 0?`v${e.toVersion}`:`v${e.fromVersion} → v${e.toVersion}`;return{id:t,title:$n.t(`system.reconnectOverlay.frameworkUpdated`,`Framework updated`),message:$n.t(`system.reconnectOverlay.isNow`,`{{packageName}} is now {{fromTo}}.`,{packageName:e.packageName,fromTo:n})}}return{id:t,title:$n.t(`system.reconnectOverlay.serverRestarted`,`Server restarted`),message:e.requestedBy===void 0?$n.t(`system.reconnectOverlay.manualRestartCompleted`,`Manual restart completed.`):$n.t(`system.reconnectOverlay.manualRestartByCompleted`,`Manual restart by {{requestedBy}} completed.`,{requestedBy:e.requestedBy})}}var al=`/system/settings`,ol=[{path:`/system/secrets`,tab:`secrets`},{path:`/system/capabilities`,tab:`capabilities`}];function sl(e,t=``){let n=new URLSearchParams(t);return n.delete(`tab`),n.set(`tab`,e),`${al}?${n.toString()}`}function cl({tab:e}){let{search:t,hash:n}=J();return k(Y,{to:`${sl(e,t)}${n}`,replace:!0})}h();var ll={info:{bg:`bg-info/10`,border:`border-info/30`,icon:Ie},warning:{bg:`bg-warning/10`,border:`border-warning/30`,icon:re},critical:{bg:`bg-danger/10`,border:`border-danger/30`,icon:Fe}};function ul({toast:e,onDismiss:t}){let n=ll[e.severity]??ll.info,r=n.icon;return A(()=>{let n=e.duration??5e3;if(n<=0)return;let r=setTimeout(()=>t(e.id),n);return()=>clearTimeout(r)},[e.id,e.duration,t]),g(`div`,{className:`flex items-start gap-3 px-4 py-3 rounded-lg border ${n.border} ${n.bg} shadow-lg backdrop-blur-sm animate-in slide-in-from-right-5 fade-in duration-200`,children:[k(r,{className:`h-4 w-4 shrink-0 mt-0.5 text-foreground-subtle`}),g(`div`,{className:`flex-1 min-w-0`,children:[k(`div`,{className:`text-xs font-semibold text-foreground`,children:e.title}),k(`div`,{className:`text-[11px] text-foreground-subtle mt-0.5`,children:e.message})]}),k(`button`,{type:`button`,onClick:()=>t(e.id),className:`shrink-0 p-0.5 rounded hover:bg-surface-hover transition-colors`,children:k(B,{className:`h-3.5 w-3.5 text-foreground-subtle`})})]})}function dl(){let[e,t]=D([]),n=s(e=>{t(t=>t.filter(t=>t.id!==e))},[]);return qn(void 0,{onData:e=>{let n=e,r=`toast-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;t(e=>[...e,{...n,id:r,timestamp:Date.now()}])}}),e.length===0?null:k(`div`,{className:`fixed bottom-[calc(env(safe-area-inset-bottom)+1rem)] right-[calc(env(safe-area-inset-right)+1rem)] z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none`,children:e.map(e=>k(`div`,{className:`pointer-events-auto`,children:k(ul,{toast:e,onDismiss:n})},e.id))})}h();function fl(e){if(typeof e!=`object`||!e)return;let{data:t}=e;return t?.code}function pl(e,t){let n=fl(e);return n===`UNAUTHORIZED`||n===`FORBIDDEN`?!0:/UNAUTHORIZED|FORBIDDEN/.test(t)}function ml(e,t,n){let[r,i]=D(!1),[a,o]=D(null);return A(()=>{if(i(!1),o(null),!t){i(!0);return}let r=!1;return e.init().catch(()=>void 0),e.awaitConnected().then(()=>{r||i(!0)},e=>{if(r)return;let t=e instanceof Error?e.message:String(e);if(pl(e,t)){n();return}o(t),i(!0)}),()=>{r=!0}},[e,t,n]),{bootReady:r,bootError:a}}h();var hl=3e4;function gl(e){let t=l(e);t.current=e,A(()=>{let e=null,n=()=>{if(document.visibilityState===`hidden`){e=Date.now();return}if(document.visibilityState===`visible`&&e!==null){let n=Date.now()-e;e=null,n>=hl&&t.current()}},r=()=>{t.current()},i=e=>{e.persisted&&t.current()};return document.addEventListener(`visibilitychange`,n),window.addEventListener(`online`,r),window.addEventListener(`pageshow`,i),()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`online`,r),window.removeEventListener(`pageshow`,i)}},[])}h();function _l(e){let t=new Set,n=new Set,r=e=>e.page.remoteName.includes(e.addonId.replace(/[^a-zA-Z0-9]+/g,`_`)),i=[...e.filter(r),...e.filter(e=>!r(e))],a=[];for(let e of i){let r=`${e.addonId}::${e.page.id}`;t.has(r)||n.has(e.page.path)||(t.add(r),n.add(e.page.path),a.push({id:e.page.id,addonId:e.addonId,label:e.page.label,icon:e.page.icon,path:e.page.path,remoteName:e.page.remoteName,bundle:e.page.bundle,bundleUrl:e.bundleUrl,...e.page.section===void 0?{}:{section:e.page.section},...e.page.sectionLabel===void 0?{}:{sectionLabel:e.page.sectionLabel}}))}return a}var vl=new Map,yl=new Map,bl=new Set;function xl(e){return!e||typeof e!=`object`?!1:typeof e.default==`function`}async function Sl(n,r){let i=vl.get(n);if(i)return i;let a=yl.get(n);if(a)return a;bl.has(n)||(Rt(),t([{name:n,entry:R(r),type:`module`}],{force:!1}),bl.add(n));let o=e(`${n}/page`).then(e=>{if(!xl(e))throw Error(`Addon page remote ${n} (${r}) does not expose a default React component on './page'`);return vl.set(n,e.default),yl.delete(n),e.default}).catch(e=>{throw yl.delete(n),e});return yl.set(n,o),o}function Cl(){let{t:e}=V(),{pagePath:t}=Ei(),n=Si(),r=Pe(),{data:i}=hn(void 0),a=v(()=>i?_l(i):void 0,[i]),o=a?.find(e=>e.path===`/addon/${t}`),s=o?.remoteName,c=o?.bundleUrl,[l,u]=D(null),[d,f]=D(null);return A(()=>{if(!s||!c)return;f(null);let e=vl.get(s);if(e){u(()=>e);return}u(null);let t=!1;return Sl(s,c).then(e=>{t||u(()=>e)}).catch(e=>{t||f(`Failed to load addon page: ${e instanceof Error?e.message:String(e)}`)}),()=>{t=!0}},[s,c]),a?o?d?k(`div`,{className:`flex items-center justify-center h-full text-danger text-sm`,children:d}):l?k(l,{trpc:r.trpcClient,theme:{isDark:document.documentElement.classList.contains(`dark`)},navigate:e=>{n(e.startsWith(`/`)?e:`/${e}`)}}):k(`div`,{className:`flex items-center justify-center h-full`,children:k(`div`,{className:`animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full`})}):k(`div`,{className:`flex items-center justify-center h-full text-foreground-subtle`,children:e(`layouts.addonPageLoader.addonPageNotFound`,`Addon page not found`)}):k(`div`,{className:`flex items-center justify-center h-full`,children:k(`div`,{className:`animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full`})})}Xn();var wl=/\p{Mn}/gu;function Tl(e){return e.normalize(`NFD`).replace(wl,``).toLowerCase().trim()}var El=[`device`,`page`,`integration`],Dl=0,Ol=1,kl=2,Al=3,jl=4,Ml=5,Nl=6,Pl=7;function Fl(e,t,n,r){return n.includes(r)?Dl:e===r?Ol:e.startsWith(r)?kl:e.split(/\s+/).some(e=>e.startsWith(r))?Al:e.includes(r)?jl:t.some(e=>e.includes(r))?Ml:null}function Il(e,t){let n=0;for(let r=0;r<e.length&&n<t.length;r++)e[r]===t[n]&&n++;return n===t.length}function Ll(e){return e<4?0:e<=7?1:e<=12?2:3}function Rl(e,t,n){if(e===t)return 0;if(n<=0||Math.abs(e.length-t.length)>n)return null;let r=t.length,i=Array(r+1).fill(0),a=Array.from({length:r+1},(e,t)=>t),o=Array(r+1).fill(0);for(let s=1;s<=e.length;s++){o[0]=s;let c=s,l=e[s-1];for(let n=1;n<=r;n++){let r=t[n-1],u=l===r?0:1,d=Math.min((a[n]??1/0)+1,o[n-1]+1,(a[n-1]??1/0)+u);s>1&&n>1&&l===t[n-2]&&e[s-2]===r&&(d=Math.min(d,(i[n-2]??1/0)+1)),o[n]=d,d<c&&(c=d)}if(c>n)return null;let u=i;i=a,a=o,o=u}let s=a[r]??1/0;return s<=n?s:null}function zl(e,t){if(Il(e,t))return Nl;let n=Ll(t.length);if(n>0){for(let r of e.split(/\s+/))if(Rl(r,t,n)!==null)return Pl}return null}function Bl(e,t,n=200){let r=Tl(t);if(r.length===0)return{groups:[],totalMatched:0,truncated:!1};let i=new Map;for(let t of e){let e=Tl(t.label),n=Fl(e,(t.keywords??[]).map(Tl),(t.identifiers??[]).map(Tl),r)??zl(e,r);if(n===null)continue;let a=i.get(t.domain)??[];a.push({item:t,rank:n}),i.set(t.domain,a)}let a=0;for(let e of i.values())a+=e.length;let o=n,s=[];for(let e of El){let t=i.get(e);if(!t||t.length===0||o<=0)continue;t.sort((e,t)=>e.rank-t.rank||e.item.label.localeCompare(t.item.label));let n=t.slice(0,o).map(e=>e.item);o-=n.length,s.push({domain:e,items:n})}return{groups:s,totalMatched:a,truncated:a>n}}function Vl(e){return e.flatMap(e=>e.items)}function Hl(e){let t=new Map;for(let n of e)t.set(n.id,n.name);let n=new Map;for(let r of e){let e=r.parentDeviceId;e!==null&&e!==r.id&&n.set(r.id,t.get(e)??`#${String(e)}`)}return n}function Ul(e,t){return e.filter(e=>!e.adminOnly||t)}function Wl({t:e,isAdmin:t}){let n=Ul([{label:e(`nav.devices`,`Devices`),icon:Ue,path:`/devices`},{label:e(`nav.integrations`),icon:N,path:`/integrations`},{label:e(`nav.build`,`Build-your-self`),icon:Ke,path:`/build`,adminOnly:!0},{label:e(`nav.locations`,`Locations`),icon:we,path:`/locations`,adminOnly:!0},{label:e(`nav.viewer`,`Viewer`),icon:Qe,path:`/live`}],t),r=Ul([{label:e(`nav.library`,`Library`),icon:at,path:`/library`,adminOnly:!0,keywords:[`People`,`Vehicles`,`Events`,`Scenes`,`plates`,`faces`,`detection-intelligence`]},{label:e(`nav.recordings`,`Recordings`),icon:ne,path:`/recordings`,adminOnly:!0}],t),i=Ul([{label:e(`nav.nodes`,`Nodes`),icon:ce,path:`/system/nodes`,adminOnly:!0},{label:e(`nav.pipeline`,`Pipeline`),icon:$e,path:`/system/pipeline`},{label:e(`system.addons`),icon:We,path:`/system/addons`,adminOnly:!0},{label:e(`system.ai`,`AI`),icon:fe,path:`/system/ai`,adminOnly:!0}],t),a=Ul([{label:e(`system.identity`,`Identity & Access`),icon:Me,path:`/system/identity`,adminOnly:!0},{label:e(`system.network`,`Network`),icon:Ye,path:`/system/network`,adminOnly:!0},{label:e(`system.integrations`,`Connectivity`),icon:N,path:`/system/integrations`,adminOnly:!0},{label:e(`system.data`,`Data`),icon:L,path:`/system/data`,adminOnly:!0},{label:e(`system.notifications`,`Notifications`),icon:ae,path:`/system/notifications`,adminOnly:!0},{label:e(`system.calendars`,`Calendars`),icon:et,path:`/system/calendars`,adminOnly:!0},{label:e(`system.systemNav`,`System`),icon:je,path:al,adminOnly:!0},{label:e(`system.logs`,`Logs`),icon:Te,path:`/system/logs`,adminOnly:!0},{label:e(`system.terminal`,`Terminal`),icon:tt,path:`/system/terminal`,adminOnly:!0}],t);return[{key:`top`,label:null,items:n},{key:`detection`,label:e(`nav.detectionSection`,`Detection`),items:r},{key:`cluster`,label:e(`nav.clusterSection`,`Cluster`),items:i},{key:`administration`,label:e(`system.title`,`Administration`),items:a}]}var Gl={gauge:de,puzzle:We,bot:Ae,cpu:I,terminal:tt,box:ie,boxes:ie,monitor:Qe,wrench:Ee,activity:se,plug:N,"graduation-cap":Ge};function Kl(e){return Gl[e]??We}function ql(e,t){for(let n of Wl(t))for(let t of n.items)if(t.path===e)return{icon:t.icon,title:t.label,path:t.path};return null}var Jl=` · `;function Yl(e,t,n,r){let i=[`#${t}`];return r!==void 0&&i.push(r),e.stableId.length>0&&e.stableId!==n&&i.push(e.stableId),i.push(e.type),e.disabled&&i.push(`disabled`),i.join(Jl)}function Xl(e,t=null){let n=Hl(e),r=Hn(t);return e.map(e=>{let t=String(e.id),i=e.name||e.stableId||`#${t}`,a=n.get(e.id),o=r(e),s=o.kind===`resolved`?o.integration.name:``;return{key:`device:${t}`,domain:`device`,label:i,subtitle:Yl(e,t,i,a),identifiers:[t,`#${t}`],keywords:[e.stableId,e.addonId,e.location??``,a??``,s].filter(e=>e.length>0),path:`/devices/${t}`,icon:Gn(e.type).icon}})}function Zl(e){return e.map(e=>({key:`integration:${e.id}`,domain:`integration`,label:e.name||e.addonId,subtitle:e.enabled?e.addonId:`${e.addonId} · disabled`,keywords:[e.addonId,e.processState],path:`/integrations/${e.id}`}))}function Ql(e,t,n){let r=e.section?.trim();return r?t[r]??e.sectionLabel?.trim()??r:n}function $l(e,t,n){let r=e.flatMap(e=>e.items.map(t=>({key:`page:${t.path}`,domain:`page`,label:t.label,subtitle:e.label??void 0,path:t.path,icon:t.icon,...t.keywords!==void 0&&t.keywords.length>0?{keywords:t.keywords}:{}}))),i={detection:n.detection,cluster:n.cluster,administration:n.administration},a=t.map(e=>({key:`page:addon:${e.addonId}:${e.id}`,domain:`page`,label:e.label,subtitle:Ql(e,i,n.ungrouped),keywords:[e.addonId],path:e.path,icon:Kl(e.icon)}));return[...r,...a]}h();var eu={device:{label:`Devices`,icon:Ue},page:{label:`Pages`,icon:Xe},integration:{label:`Integrations`,icon:N}};function tu({groups:e,activeKey:t,query:n,totalMatched:r,truncated:i,onSelect:a,onHover:o}){let{t:s}=V(),c=l(null);if(A(()=>{t&&(c.current?.querySelector(`[data-key="${CSS.escape(t)}"]`))?.scrollIntoView({block:`nearest`})},[t]),n.trim().length===0)return null;if(e.length===0)return g(`div`,{className:`px-3 py-4 text-center text-[12px] text-foreground-subtle`,children:[`No results for “`,n,`”`]});let u=e.reduce((e,t)=>e+t.items.length,0);return g(S,{children:[k(`div`,{ref:c,role:`listbox`,className:`max-h-[60vh] overflow-y-auto py-1`,children:e.map(e=>{let n=eu[e.domain],r=n.icon;return g(`div`,{className:`px-1 py-1`,children:[g(`div`,{className:`sticky top-0 z-10 flex items-center gap-1.5 bg-surface px-2 py-1 text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60`,children:[k(r,{className:`h-3 w-3`}),n.label]}),e.items.map(e=>{let r=e.icon??n.icon,i=e.key===t;return g(`button`,{type:`button`,role:`option`,"aria-selected":i,"data-key":e.key,onMouseEnter:()=>o(e),onClick:()=>a(e),className:`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-[12px] transition-colors ${i?`bg-primary/12 text-primary`:`text-foreground hover:bg-surface-hover`}`,children:[k(r,{className:`h-3.5 w-3.5 shrink-0 ${i?`text-primary`:`text-foreground-subtle`}`}),g(`span`,{className:`flex-1 min-w-0`,children:[k(`span`,{className:`block truncate font-medium`,children:e.label}),e.subtitle&&k(`span`,{className:`block truncate text-[10px] text-foreground-subtle`,children:e.subtitle})]})]},e.key)})]},e.domain)})}),i&&k(`div`,{className:`border-t border-border px-3 py-1.5 text-center text-[10px] text-foreground-subtle`,children:s(`search.truncatedResults`,`Showing first {{shown}} of {{total}} — refine your search.`,{shown:u,total:r})})]})}h();function nu({navSections:e,addonPages:t,compact:n,onNavigated:r}){let{t:i}=V(),a=Si(),o=l(null),c=l(null),u=l(null),[d,f]=D(null),[p,m]=D(``),[h,_]=D(0),[y,b]=D(!1),{data:x}=On({projection:`slim`}),{data:S}=dn(void 0),C=v(()=>{let n={detection:i(`nav.detectionSection`,`Detection`),cluster:i(`nav.clusterSection`,`Cluster`),administration:i(`system.title`,`Administration`),ungrouped:i(`nav.addonPages`,`Addon Pages`)};return[...Xl(x??[],S??null),...$l(e,t,n),...Zl(S??[])]},[x,S,e,t,i]),{groups:w,totalMatched:T,truncated:E}=v(()=>Bl(C,p),[C,p]),O=v(()=>Vl(w),[w]);A(()=>{_(0)},[p,C]),A(()=>{y&&o.current?.focus()},[y]);let j=s(()=>{b(!1),m(``),_(0)},[]),M=s(e=>{a(e.path),j(),o.current?.blur(),r?.()},[a,j,r]);A(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),b(!0))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),A(()=>{if(!y)return;function e(e){if(!(e.target instanceof Node))return;let t=c.current?.contains(e.target)===!0,n=u.current?.contains(e.target)===!0;!t&&!n&&b(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[y]);let N=y&&p.trim().length>0;A(()=>{if(!N){f(null);return}let e=()=>{let e=o.current?.getBoundingClientRect();e&&f({left:e.left,top:e.bottom+4,width:e.width})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[N]);let P=O[h]?.key??null,F=i(`search.placeholder`,`Search devices, pages, integrations…`),ee=g(`div`,{className:`relative`,children:[k(Ce,{className:`pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-foreground-subtle`}),k(`input`,{ref:o,type:`text`,value:p,placeholder:F,"aria-label":F,role:`combobox`,"aria-expanded":y&&p.trim().length>0,"aria-controls":`global-search-results`,onChange:e=>{m(e.target.value),b(!0)},onFocus:()=>b(!0),onKeyDown:e=>{if(e.key===`ArrowDown`)e.preventDefault(),O.length>0&&_(e=>(e+1)%O.length);else if(e.key===`ArrowUp`)e.preventDefault(),O.length>0&&_(e=>(e-1+O.length)%O.length);else if(e.key===`Enter`){e.preventDefault();let t=O[h];t&&M(t)}else e.key===`Escape`&&(e.preventDefault(),j(),o.current?.blur())},className:`w-full rounded-md border border-border bg-surface py-1.5 pl-7 pr-6 text-[12px] text-foreground placeholder:text-foreground-subtle/70 focus:outline-none focus:ring-1 focus:ring-primary/50`}),p.length>0&&k(`button`,{type:`button`,"aria-label":i(`search.globalSearch.clearSearch`,`Clear search`),onClick:()=>{m(``),o.current?.focus()},className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground`,children:k(B,{className:`h-3 w-3`})}),N&&d!==null&&Zn(k(`div`,{ref:u,id:`global-search-results`,className:`fixed z-50 w-max max-w-[26rem] rounded-lg border border-border bg-surface shadow-xl`,style:{left:d.left,top:d.top,minWidth:d.width},children:k(tu,{groups:w,activeKey:P,query:p,totalMatched:T,truncated:E,onSelect:M,onHover:e=>{let t=O.findIndex(t=>t.key===e.key);t>=0&&_(t)}})}),document.body)]});return n?k(`div`,{ref:c,className:`px-1.5 pb-1.5`,children:y?k(`div`,{className:`fixed z-50 w-max min-w-72 max-w-[26rem]`,style:{left:`calc(env(safe-area-inset-left) + 3.5rem)`,top:`calc(env(safe-area-inset-top) + 3.5rem)`},children:ee}):k(`button`,{type:`button`,onClick:()=>b(!0),"aria-label":F,title:F,className:`flex w-full items-center justify-center rounded-md px-0 py-2 text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors`,children:k(Ce,{className:`h-3.5 w-3.5 shrink-0`})})}):k(`div`,{ref:c,className:`px-2 pb-2`,children:ee})}var ru=/^(\d{1,3}\.){3}\d{1,3}$/;function iu(e){let t=e.startsWith(`[`)&&e.endsWith(`]`)?e.slice(1,-1):e;return!!(ru.test(t)||t.includes(`:`))}function au(e,t){return!t||iu(e)?!1:e===t||e.endsWith(`.${t}`)}h();var ou=`auth-webauthn/passkey-enrollment`,su=`camstack_passkey_prompt_dismissed:`,cu=720*60*60*1e3;function lu(e){try{let t=localStorage.getItem(`${su}${e}`);if(!t)return!1;let n=Number(t);return Number.isFinite(n)?Date.now()-n<cu:!1}catch{return!1}}function uu(e){try{localStorage.setItem(`${su}${e}`,String(Date.now()))}catch{}}function du(){let{user:e}=Vs(),{t}=V(),n=Pe(),r=rn(ou),[i,a]=D(!1),[o,c]=D(!1),l=v(()=>e?lu(e.id):!0,[e]),u=ln.auth.listLoginMethods.useQuery().data?.find(e=>e.kind===`passkey`),d=u!==void 0&&au(window.location.hostname,u.rpId),f=e!==null&&d&&r!=null&&!l,p=x({queryKey:[`auth`,`listOwnPasskeys`],queryFn:()=>n.listOwnPasskeys(),enabled:f,staleTime:6e4}),m=s(()=>{e&&uu(e.id),a(!0),c(!1)},[e]),h=s(()=>{c(!1),p.refetch()},[p]);return!f||i||p.data===void 0||p.data.length>0?null:g(`div`,{className:`shrink-0 border-b border-primary/20 bg-primary/5`,children:[g(`div`,{className:`flex items-center gap-2.5 px-3 py-2 text-xs text-foreground`,children:[k(st,{className:`h-4 w-4 text-primary shrink-0`}),k(`span`,{className:`flex-1 min-w-0`,children:t(`passkeyPrompt.message`,`Save a passkey for faster sign-in?`)}),k(`button`,{onClick:()=>c(e=>!e),className:`rounded bg-primary px-2.5 py-1 text-[11px] font-semibold text-primary-foreground hover:bg-primary/90`,children:t(`passkeyPrompt.enrollNow`,`Enroll now`)}),k(`button`,{onClick:m,className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,children:t(`passkeyPrompt.notNow`,`Not now`)}),k(`button`,{onClick:m,"aria-label":t(`passkeyPrompt.notNow`,`Not now`),className:`p-1 rounded text-foreground-subtle hover:text-foreground`,children:k(B,{className:`h-3.5 w-3.5`})})]}),o&&k(`div`,{className:`px-3 pb-3`,children:g(`div`,{className:`max-w-xl`,children:[k(Jn,{widgetId:ou,host:`dashboard`}),k(`div`,{className:`mt-2 flex justify-end`,children:k(`button`,{onClick:h,className:`rounded border border-border px-2.5 py-1 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,children:t(`common.close`,`Close`)})})]})})]})}var fu=6e4;function pu(){let e=Ln(void 0,{staleTime:fu});return{info:e.data?.serverName??null,isLoading:e.isLoading}}h();var mu=`system-config`,hu=`hub`,gu=`camstack_server_name_prompt_dismissed`;function _u(){try{return sessionStorage.getItem(gu)===`1`}catch{return!1}}function vu(){try{sessionStorage.setItem(gu,`1`)}catch{}}function yu(e){return e.isAdmin&&e.info!==null&&e.info.isDefault&&!e.dismissed}function bu(){let{user:e}=Vs(),{info:t}=pu(),[n,r]=D(_u);return yu({isAdmin:e?.isAdmin===!0,info:t,dismissed:n})?k(xu,{suggestion:t?.name??``,onLater:()=>{vu(),r(!0)}}):null}function xu({suggestion:e,onLater:t}){let{t:n}=V(),r=E(),i=cn(),[a,o]=D(e),[c,u]=D(null),d=l(null);A(()=>d.current?.focus(),[]);let f=s(async()=>{let e=mt.safeParse(a);if(!e.success){u(e.error.issues[0]?.message??n(`serverName.invalid`,`Not a valid name`));return}u(null);try{await i.mutateAsync({addonId:mu,nodeId:hu,patch:{name:e.data}}),await r.invalidateQueries({queryKey:[[`system`,`info`]]}),await r.invalidateQueries({queryKey:[[`addonSettings`]]})}catch(e){u(e instanceof Error&&e.message.length>0?e.message:`Could not save`)}},[r,i,n,a]);return k(Qt,{open:!0,onOpenChange:e=>!e&&t(),children:k(At,{children:g(`form`,{onSubmit:e=>{e.preventDefault(),i.isPending||f()},children:[g(Ct,{children:[k(xn,{children:n(`serverName.title`,`Name this server`)}),k(qt,{children:n(`serverName.description`,`Pick a name for this hub. It shows in the admin UI and on the apps’ sign-in screen. You can change it later in System settings.`)})]}),k(Mt,{children:k(It,{label:n(`serverName.label`,`Server name`),...c===null?{}:{error:c},children:k(sn,{ref:d,value:a,maxLength:48,onChange:e=>o(e.target.value),state:c===null?`default`:`error`,"aria-label":n(`serverName.label`,`Server name`)})})}),g(wn,{children:[k(Dt,{type:`button`,variant:`ghost`,onClick:t,disabled:i.isPending,children:n(`serverName.later`,`Later`)}),g(Dt,{type:`submit`,disabled:i.isPending||a.trim().length===0,children:[i.isPending&&k(ye,{className:`h-4 w-4 animate-spin`}),n(`common.save`,`Save`)]})]})]})})})}h(),Xn();var Su={info:Ie,success:Se,warning:re,error:Fe},Cu={info:`text-info`,success:`text-success`,warning:`text-warning`,error:`text-danger`},wu={active:`border-l-info`,"in-progress":`border-l-warning`,completed:`border-l-success`,failed:`border-l-danger`,dismissed:`border-l-foreground-subtle/30`};function Tu(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${String(n)}m ago`;let r=Math.floor(n/60);if(r<24)return`${String(r)}h ago`;let i=Math.floor(r/24);return`${String(i)}d ago`}function Eu(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Du(e){return typeof e==`string`&&e.length>0?e:void 0}function Ou(e){if(Eu(e.metadata)){let t=Du(e.metadata.nodeId)??Du(e.metadata.agentId);if(t!==void 0)return t}let t=e.source;if(t!==void 0&&!(t.type!==`node`&&t.type!==`agent`))return Du(t.id)}function ku({alert:e,onMarkRead:t,onDismiss:n}){let{t:r}=V(),i=e.severity in Su?e.severity:`info`,a=e.status in wu?e.status:`active`,o=Su[i],s=Cu[i],c=wu[a],{nodes:l}=gn(),u=Ou(e),d=u===void 0?void 0:l.find(e=>e.id===u),f=u===void 0?void 0:d?.name??u;return g(`div`,{className:`flex items-start gap-2.5 px-3 py-2.5 border-l-2 ${c} ${e.read?`opacity-60`:``} hover:bg-surface-hover transition-colors`,children:[k(o,{className:`h-3.5 w-3.5 shrink-0 mt-0.5 ${s}`}),g(`div`,{className:`flex-1 min-w-0`,children:[g(`div`,{className:`flex items-center gap-1.5`,children:[k(`span`,{className:`text-[11px] font-semibold ${e.read?`text-foreground-subtle`:`text-foreground`}`,children:e.title}),!e.read&&k(`span`,{className:`h-1.5 w-1.5 rounded-full bg-primary shrink-0`})]}),f!==void 0&&k(`div`,{className:`text-foreground-subtle text-[10px] mt-0.5 truncate`,children:f}),k(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5 line-clamp-2`,children:e.message}),e.status===`in-progress`&&e.progress!==void 0&&g(`div`,{className:`mt-1.5 flex items-center gap-2`,children:[k(`div`,{className:`flex-1 h-1 bg-surface-hover rounded-full overflow-hidden`,children:k(`div`,{className:`h-full bg-primary rounded-full transition-all duration-300`,style:{width:`${String(Math.min(100,Math.max(0,e.progress)))}%`}})}),g(`span`,{className:`text-[9px] text-foreground-subtle font-mono shrink-0`,children:[String(Math.round(e.progress)),`%`]})]}),k(`div`,{className:`text-[9px] text-foreground-subtle/60 mt-1`,children:Tu(e.updatedAt)})]}),g(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:[!e.read&&k(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(e.id)},className:`p-1 rounded hover:bg-surface-hover transition-colors`,title:r(`ui.alertBell.markAsRead`,`Mark as read`),children:k(be,{className:`h-3 w-3 text-foreground-subtle`})}),e.status!==`in-progress`&&k(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),n(e.id)},className:`p-1 rounded hover:bg-surface-hover transition-colors`,title:r(`ui.alertBell.dismiss`,`Dismiss`),children:k(B,{className:`h-3 w-3 text-foreground-subtle`})})]})]})}function Au({variant:e=`icon`,compact:t=!1}={}){let{t:n}=V(),[r,i]=D(!1),[a,o]=D(!1),c=l(null),u=l(null),d=E(),{data:f=0}=en(void 0,{refetchInterval:3e4}),{data:p=[],isLoading:m}=an({limit:50},{enabled:r}),h=a?p:p.filter(e=>!e.read),_=p.filter(e=>e.read).length,v=()=>{d.invalidateQueries({queryKey:[[`alerts`]]})},y=Wt({onSuccess:v}),b=zt({onSuccess:v}),x=Vt({onSuccess:v});yn(`alert.created`,()=>{d.invalidateQueries({queryKey:[[`alerts`]]})}),yn(`alert.updated`,()=>{d.invalidateQueries({queryKey:[[`alerts`]]})}),A(()=>{if(!r)return;let e=e=>{let t=e.target;c.current&&!c.current.contains(t)&&u.current&&!u.current.contains(t)&&i(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[r]);let S=s(e=>{y.mutate({alertId:e})},[y]),C=s(e=>{e&&x.mutate({alertId:e})},[x]),w=s(()=>{b.mutate(void 0),i(!1)},[b]),T=h.filter(e=>e.status===`in-progress`),O=h.filter(e=>e.status!==`in-progress`),[j,M]=D({}),N=s(()=>{let e=u.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=Math.min(320,n-16),a=t.left;a+i>n-8&&(a=n-8-i),a<8&&(a=8);let o=r-t.bottom,s=t.top,c={position:`fixed`,left:a,width:i,zIndex:9999};o>=s?(c.top=t.bottom+4,c.maxHeight=Math.max(160,o-8-4)):(c.bottom=r-t.top+4,c.maxHeight=Math.max(160,s-8-4)),M(c)},[]);return A(()=>{if(!r)return;N();let e=()=>N();return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[r,N]),g(`div`,{children:[e===`sidebar`?g(`button`,{ref:u,type:`button`,onClick:()=>i(!r),className:`flex w-full items-center gap-2.5 rounded-md ${t?`justify-center px-0 py-2`:`px-2.5 py-1.5`} text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors`,title:t?`Alerts${f>0?` (${f})`:``}`:void 0,children:[g(`span`,{className:`relative inline-flex shrink-0`,children:[k(Te,{className:`h-3.5 w-3.5`}),t&&f>0&&k(`span`,{className:`absolute -top-1 -right-1 h-2 w-2 rounded-full bg-primary`})]}),!t&&k(`span`,{className:`flex-1 text-left`,children:n(`ui.alertBell.alerts`,`Alerts`)}),!t&&f>0&&k(`span`,{className:`flex items-center justify-center h-4 min-w-4 px-1 rounded-full bg-primary text-primary-foreground text-[9px] font-bold leading-none`,children:f>99?`99+`:String(f)})]}):g(`button`,{ref:u,type:`button`,onClick:()=>i(!r),className:`relative p-1.5 rounded-md hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors`,"aria-label":n(`ui.alertBell.alerts`,`Alerts`),children:[k(Te,{className:`h-4.5 w-4.5`}),f>0&&k(`span`,{className:`absolute -top-0.5 -right-0.5 flex items-center justify-center h-4 min-w-4 px-0.5 rounded-full bg-primary text-primary-foreground text-[9px] font-bold leading-none`,children:f>99?`99+`:String(f)})]}),r&&Zn(g(`div`,{ref:c,style:j,className:`bg-surface border border-border rounded-lg shadow-xl flex flex-col overflow-hidden`,children:[g(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border shrink-0`,children:[k(`span`,{className:`text-[12px] font-semibold text-foreground`,children:n(`ui.alertBell.alerts`,`Alerts`)}),g(`div`,{className:`flex items-center gap-2`,children:[_>0&&g(`label`,{className:`flex items-center gap-1 text-[10px] text-foreground-subtle cursor-pointer select-none`,children:[k(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked),className:`h-3 w-3 rounded border-border accent-primary cursor-pointer`}),n(`ui.alertBell.showRead`,`Show read`)]}),f>0&&g(`button`,{type:`button`,onClick:w,className:`flex items-center gap-1 text-[10px] text-primary hover:text-primary/80 transition-colors`,children:[k(Ze,{className:`h-3 w-3`}),n(`ui.alertBell.markAllRead`,`Mark all read`)]})]})]}),g(`div`,{className:`flex-1 overflow-y-auto`,children:[m&&k(`div`,{className:`flex items-center justify-center py-8`,children:k(ye,{className:`h-4 w-4 animate-spin text-foreground-subtle`})}),!m&&h.length===0&&g(`div`,{className:`flex flex-col items-center justify-center py-8 text-foreground-subtle`,children:[k(Te,{className:`h-6 w-6 mb-2 opacity-40`}),k(`span`,{className:`text-[11px]`,children:p.length>0?n(`ui.alertBell.noUnreadAlerts`,`No unread alerts`):n(`ui.alertBell.noAlerts`,`No alerts`)}),p.length>0&&!a&&g(`button`,{type:`button`,onClick:()=>o(!0),className:`text-[10px] text-primary mt-1 hover:underline`,children:[`Show `,_,` read alert`,_===1?``:`s`]})]}),T.length>0&&g(`div`,{className:`border-b border-border`,children:[k(`div`,{className:`px-3 py-1.5 bg-surface-hover/50`,children:k(`span`,{className:`text-[9px] font-semibold uppercase tracking-widest text-foreground-subtle/60`,children:n(`ui.alertBell.inProgress`,`In Progress`)})}),T.map(e=>k(ku,{alert:e,onMarkRead:S,onDismiss:C},e.id))]}),O.map(e=>k(ku,{alert:e,onMarkRead:S,onDismiss:C},e.id))]})]}),document.body)]})}h();function ju(){let e=Ho();return c(e.subscribe,e.getSnapshot,e.getSnapshot)}var Mu=[`detection`,`cluster`,`administration`];function Nu(e){return Mu.includes(e)}function Pu(e){let t=new Map,n=new Map,r=[];for(let i of e){let e=i.section?.trim();if(e===void 0||e.length===0){r.push(i);continue}if(Nu(e)){let n=t.get(e)??[];n.push(i),t.set(e,n);continue}let a=n.get(e);a?a.pages.push(i):n.set(e,{label:i.sectionLabel?.trim()||e,pages:[i]})}return{known:t,custom:[...n.entries()].map(([e,t])=>({id:e,label:t.label,pages:t.pages})),ungrouped:r}}var Fu=`camstack:last-path`,Iu=512,Lu=[`/login`,`/change-password`,`/access-denied`,`/logout`];function Ru(e){return!e.startsWith(`/`)||e.startsWith(`//`)||e.length>Iu?!1:!Lu.some(t=>e===t||e.startsWith(t+`/`))}function zu(e){if(!(typeof window>`u`)&&Ru(e))try{window.localStorage.setItem(Fu,e)}catch{}}function Bu(){if(typeof window>`u`)return null;try{let e=window.localStorage.getItem(Fu);return e===null?null:Ru(e)?e:null}catch{return null}}h();var Vu=a(!0);function Hu(e){return e===`/addon`||e.startsWith(`/addon/`)}function Uu(e,t,n){let r=[...e.filter(e=>e!==t),t];return r.length<=n?r:r.slice(r.length-n)}function Wu({maxCached:e=6}){let t=Ti(),n=J(),r=yi(),i=u(q),a=n.pathname,o=Hu(a),s=l(new Map),c=l([]);if(o){s.current.set(a,{key:a,outlet:t,location:n,navigationType:r,routeContext:i});let o=Uu(c.current,a,e),l=new Set(o);for(let e of s.current.keys())l.has(e)||s.current.delete(e);c.current=o}return g(S,{children:[c.current.map(e=>{let t=s.current.get(e);if(t?.outlet==null)return null;let n=o&&e===a;return k(`div`,{className:n?`h-full min-h-0`:void 0,style:n?void 0:{display:`none`},hidden:!n,"aria-hidden":!n,children:k(Vu.Provider,{value:n,children:k(ui.Provider,{value:{location:t.location,navigationType:t.navigationType},children:k(q.Provider,{value:t.routeContext,children:t.outlet})})})},e)}),!o&&t!=null?k(`div`,{className:`h-full min-h-0`,children:t},a):null]})}h();var Gu={dark:P,light:F,system:Qe};function Ku(){return k(`div`,{className:`flex h-full min-h-[50vh] items-center justify-center`,children:k(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary/30 border-t-primary`})})}function qu(){let e=J(),t=Si(),{user:n,logout:r}=Vs(),i=jt(),{t:a}=V(),o=bn(),s=Pn(),{info:c}=pu();A(()=>{document.title=c===null?`CamStack Admin`:`${c.name} \u00b7 CamStack Admin`},[c]);let u=Mo(ju()),[d,f]=D(!1);A(()=>{zu(e.pathname+e.search)},[e.pathname,e.search]);let[p,m]=D(()=>typeof window>`u`?!1:window.localStorage.getItem(`camstack:sidebar-collapsed`)===`1`);A(()=>{typeof window>`u`||window.localStorage.setItem(`camstack:sidebar-collapsed`,p?`1`:`0`)},[p]);let[h]=D(()=>{if(typeof window>`u`)return new Set;try{let e=window.localStorage.getItem(`camstack:sidebar-collapsed-groups`);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}});A(()=>{typeof window>`u`||window.localStorage.setItem(`camstack:sidebar-collapsed-groups`,JSON.stringify([...h]))},[h]),A(()=>{s&&window.localStorage.getItem(`camstack:sidebar-collapsed`)===null&&m(!0)},[s]);let{data:_=[]}=wt({nodeId:`hub`},{refetchInterval:3e4}),b=_.length,x=E(),C=l(Date.now()),{data:w}=hn(void 0,{staleTime:0,refetchOnMount:`always`,refetchInterval:e=>{let t=e.state.data;return t&&t.length>0||Date.now()-C.current>=3e4?!1:2e3}}),T=v(()=>w&&n?.isAdmin?_l(w):[],[w,n?.isAdmin]),O=v(()=>Pu(T),[T]),j=O.known.get(`detection`)??[],M=O.known.get(`cluster`)??[],N=O.known.get(`administration`)??[];yn(`addon.page-ready`,()=>{x.invalidateQueries({queryKey:[[`addonPages`,`listPages`]]})});let P=()=>{r(),t(`/login`)},F=t=>!!(e.pathname===t||e.pathname.startsWith(t+`/`)),ee=[`/system/pipeline`,`/live`,`/addon/osd-manager`,`/build`].some(t=>e.pathname===t||e.pathname.startsWith(t+`/`)),I=n?.isAdmin===!0,L=v(()=>Wl({t:a,isAdmin:I}),[a,I]),te=L[0]?.items??[],ne=L[1]?.items??[],re=L[2]?.items??[],ie=L[3]?.items??[],ae=i?.mode??`system`,oe={dark:a(`theme.dark`),light:a(`theme.light`),system:a(`theme.system`)},z=p&&!o,ce=(e,t=`md`)=>`flex w-full items-center gap-2.5 rounded-md ${z?`justify-center px-0 py-2`:`px-2.5 py-1.5`} ${t===`lg`?`text-[13px] font-medium`:`text-[12px]`} transition-all ${e?t===`lg`?`bg-primary/12 text-primary shadow-sm shadow-primary/5`:`bg-primary/12 text-primary`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,le=(e,t)=>e===0?null:z?k(`div`,{className:`pt-3 mb-1 mx-2 border-t border-border/60`},`sep-${t}`):k(`div`,{className:`pt-4 pb-1.5 px-2.5`,children:k(`span`,{className:`text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60`,children:t})},`hdr-${t}`),ue=e=>{let n=F(e.path),r=Kl(e.icon);return g(`button`,{onClick:()=>{t(e.path),f(!1)},className:ce(n),title:z?e.label:void 0,children:[k(r,{className:`h-3.5 w-3.5 shrink-0 ${n?`text-primary`:``}`}),!z&&e.label]},`${e.addonId}::${e.id}`)},de=e=>{let n=e.icon,r=F(e.path),i=e.path===`/system/addons`;return g(`button`,{"data-testid":`nav-${e.path.replace(/^\//,``).replace(/\//g,`-`)}`,onClick:()=>{t(e.path),f(!1)},className:ce(r),title:z?e.label:void 0,children:[k(n,{className:`h-3.5 w-3.5 shrink-0 ${r?`text-primary`:``}`}),!z&&g(S,{children:[k(`span`,{className:`flex-1 text-left`,children:e.label}),i&&b>0&&k(`span`,{className:`ml-auto rounded-full bg-primary px-1.5 py-0.5 text-[9px] font-bold text-primary-foreground leading-none`,children:b})]}),z&&i&&b>0&&k(`span`,{className:`absolute mt-[-14px] ml-3 h-2 w-2 rounded-full bg-primary`})]},e.path)},fe=g(S,{children:[g(`div`,{className:`flex h-14 items-center border-b border-border ${z?`justify-center px-1`:`pl-3 pr-4 gap-2`}`,children:[!z&&k(`img`,{src:i?.resolvedMode===`light`?R(`/brand/logo-horizontal-light.svg`):R(`/brand/logo-horizontal-dark.svg`),alt:a(`layouts.appLayout.camstackAdmin`,`CamStack Admin`),className:`h-9 flex-1 min-w-0`}),!o&&k(`button`,{onClick:()=>m(e=>!e),className:`p-1.5 rounded-md hover:bg-surface-hover text-foreground-subtle transition-colors flex-shrink-0 ${z?``:`mr-2`}`,"aria-label":p?a(`layouts.appLayout.expandSidebar`,`Expand sidebar`):a(`layouts.appLayout.collapseSidebar`,`Collapse sidebar`),title:p?a(`layouts.appLayout.expandSidebar`,`Expand sidebar`):a(`layouts.appLayout.collapseSidebar`,`Collapse sidebar`),children:k(p?ge:He,{className:`h-4 w-4`})})]}),!z&&c!==null&&k(`div`,{"data-testid":`sidebar-server-name`,title:c.name,className:`truncate border-b border-border px-3 py-1.5 text-xs font-medium text-foreground-muted`,children:c.name}),k(`div`,{className:`border-b border-border pt-2`,children:k(nu,{navSections:L,addonPages:T,compact:z,onNavigated:()=>f(!1)})}),g(`nav`,{className:`flex-1 overflow-y-auto py-3 ${z?`px-1.5`:`px-2`} space-y-0.5`,children:[te.map(e=>de(e)),le(ne.length+j.length,a(`nav.detectionSection`,`Detection`)),ne.map(e=>de(e)),j.map(e=>ue(e)),le(re.length+M.length,a(`nav.clusterSection`,`Cluster`)),re.map(e=>de(e)),M.map(e=>ue(e)),le(ie.length+N.length,a(`system.title`,`Administration`)),ie.map(e=>de(e)),N.map(e=>ue(e)),O.custom.map(e=>g(`div`,{className:`contents`,children:[le(e.pages.length,e.label),e.pages.map(e=>ue(e))]},`custom-${e.id}`)),le(O.ungrouped.length,a(`nav.addonPages`,`Addon Pages`)),O.ungrouped.map(e=>ue(e))]}),g(`div`,{className:`border-t border-border ${z?`p-1.5`:`p-2`} space-y-0.5`,children:[g(`button`,{onClick:()=>i?.toggleMode(),className:ce(!1),title:z?oe[ae]:void 0,children:[(()=>{let e=Gu[ae];return k(e,{className:`h-3.5 w-3.5 shrink-0`})})(),!z&&k(`span`,{children:oe[ae]})]}),k(Au,{variant:`sidebar`,compact:z}),g(`button`,{type:`button`,onClick:()=>t(`/system/my-access`),className:ce(F(`/system/my-access`)),title:z?a(`system.myAccess`,`My access`):void 0,children:[k(Ne,{className:`h-3.5 w-3.5 shrink-0`}),!z&&k(`span`,{className:`truncate`,children:a(`system.myAccess`,`My access`)})]}),g(`button`,{onClick:P,className:ce(!1).replace(`hover:text-foreground`,`hover:text-danger`),title:z?n?.username??a(`layouts.appLayout.logout`,`Logout`):void 0,children:[k(nt,{className:`h-3.5 w-3.5 shrink-0`}),!z&&k(`span`,{className:`truncate`,children:n?.username??a(`layouts.appLayout.user`,`User`)})]}),k(`div`,{className:`pt-1 text-[10px] text-foreground-disabled select-none ${z?`text-center`:`px-2`}`,title:a(`layouts.appLayout.adminUiV`,`admin-ui v{{__APP_VERSION__}}`,{__APP_VERSION__:`1.2.428`}),children:z?`1.2.428`:`v1.2.428`})]})]});return g(`div`,{className:`flex h-dvh overflow-hidden bg-background text-foreground pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]`,children:[!o&&k(`aside`,{className:`flex flex-col border-r border-border bg-surface/80 backdrop-blur-sm shrink-0 transition-[width] duration-150 ease-out ${z?`w-12`:`w-48`}`,children:fe}),o&&k(xt,{open:d,onClose:()=>f(!1),width:`w-64`,children:fe}),g(`div`,{className:`flex flex-1 flex-col min-w-0`,children:[u!==null&&g(`div`,{className:`flex items-center justify-center gap-2 px-3 py-2 text-[12px] font-medium shrink-0 ${u.severity===`danger`?`bg-danger/90 text-white`:`bg-warning/15 text-warning border-b border-warning/30`}`,children:[u.severity===`danger`?k(ve,{className:`h-3.5 w-3.5`}):k(se,{className:`h-3.5 w-3.5`}),k(`span`,{children:a(u.i18nKey,{defaultValue:u.message,...u.i18nParams})}),u.action===`sign-in`&&k(`button`,{onClick:()=>r(),className:`ml-2 rounded border border-white/40 px-2 py-0.5 text-[11px] font-semibold hover:bg-white/10`,children:a(`connection.signIn`,`Sign in`)}),u.showSpinner&&k(ye,{className:`h-3.5 w-3.5 animate-spin`})]}),k(du,{}),k(bu,{}),o&&g(`header`,{className:`flex items-center h-12 border-b border-border px-3 shrink-0 bg-surface/80 backdrop-blur-sm`,children:[k(`button`,{onClick:()=>f(!0),className:`p-1.5 -ml-1.5 rounded-md hover:bg-surface-hover text-foreground-muted transition-colors`,"aria-label":a(`layouts.appLayout.openMenu`,`Open menu`),children:k(he,{className:`h-5 w-5`})}),k(`div`,{className:`flex-1 flex justify-center`,children:k(`img`,{src:i?.resolvedMode===`light`?R(`/brand/logo-horizontal-light.svg`):R(`/brand/logo-horizontal-dark.svg`),alt:a(`layouts.appLayout.camstack`,`CamStack`),className:`h-7`})}),k(Au,{})]}),k(`main`,{className:`relative flex-1 min-h-0 overscroll-contain bg-background ${ee?`overflow-hidden`:`overflow-auto`}`,children:k(y,{fallback:k(Ku,{}),children:k(Wu,{})})})]})]})}function $({children:e,requireAdmin:t}){let{t:n}=V(),{user:r,loading:i,mustChangePassword:a}=Vs(),o=J();return i?k(`div`,{className:`flex h-screen items-center justify-center bg-background text-foreground-subtle`,children:n(`layouts.protectedRoute.loading`,`Loading...`)}):r?a&&o.pathname!==`/change-password`?k(Y,{to:`/change-password`,replace:!0}):t&&!r.isAdmin?k(Y,{to:`/access-denied`,replace:!0}):k(S,{children:e}):k(Y,{to:`/login`,replace:!0,state:{from:o.pathname+o.search}})}var Ju=`customize`,Yu=`main`,Xu=`advanced`,Zu=`/build/compositions/new`,Qu=`/build/compositions/:blockId`,$u=`/build?tab=custom-device`;function ed(e){return`/devices/${e}?tab=${Ju}`}function td(e){return`${ed(e)}&sub=${Xu}`}function nd(e){return`/build/compositions/${encodeURIComponent(e)}`}var rd=`integration`,id=`section`,ad=[rd,id],od={connectivity:{path:`/system/integrations`,tab:null},remoteAccess:{path:`/system/network`,tab:`remote-access`},mesh:{path:`/system/network`,tab:`mesh`},turn:{path:`/system/network`,tab:`turn`},authentication:{path:`/system/identity`,tab:`authentication`},access:{path:`/system/identity`,tab:`access`},logging:{path:`/system/logs`,tab:`destinations`}},sd=`settings`,cd=`activity`;function ld(e,t={}){let{path:n,tab:r}=od[e],i=new URLSearchParams;r!==null&&i.set(`tab`,r),t.integration!==void 0&&i.set(rd,t.integration),t.section!==void 0&&i.set(id,t.section);let a=i.toString();return a.length>0?`${n}?${a}`:n}function ud(e){let{ids:t,requested:n,answered:r,legacyGroup:i=null,groupFirst:a={}}=e;if(n!==null&&t.includes(n))return{selectedId:n,staleId:null};let o=n!==null&&r?n:null,s=i===null?void 0:a[i];return s!==void 0&&t.includes(s)?{selectedId:s,staleId:o}:{selectedId:t[0]??null,staleId:o}}function dd(e,t,n=null,r=null){let i=new URLSearchParams(e);return i.set(rd,t),r===null?i.delete(id):i.set(id,r),n!==null&&i.delete(n),i}function fd(e){return e===`/admin`||e===`/admin/`?`/`:e.startsWith(`/admin/`)?e.slice(6):e}function pd(){let{t:e}=V(),t=Si();return g(`div`,{className:`flex flex-col items-center justify-center text-foreground py-16 px-4`,children:[k(`div`,{className:`flex h-16 w-16 items-center justify-center rounded-2xl bg-danger/10 mb-4`,children:k(it,{className:`h-8 w-8 text-danger`})}),k(`h1`,{className:`text-xl font-bold`,children:e(`accessDenied.accessDenied`,`Access Denied`)}),k(`p`,{className:`mt-2 text-sm text-foreground-subtle`,children:e(`accessDenied.youDonTHavePermission`,`You don't have permission to access this page.`)}),k(`button`,{onClick:()=>t(`/devices`),className:`mt-6 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg transition-all`,children:e(`accessDenied.goToDevices`,`Go to Devices`)})]})}h();var md=8;function hd(){let{t:e}=V(),{user:t,mustChangePassword:n,clearMustChangePassword:r,logout:i}=Vs(),a=jt(),o=Si(),[s,c]=D(``),[l,u]=D(``),[d,f]=D(!1),[p,m]=D(``),h=Ft({onSuccess:()=>{r(),o(`/devices`,{replace:!0})},onError:e=>{m(e instanceof Error?e.message:`Could not change password`)}});return k(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:g(`div`,{className:`w-full max-w-sm`,children:[k(`div`,{className:`flex justify-center mb-8`,children:k(`img`,{src:a?.resolvedMode===`light`?R(`/brand/logo-horizontal-light.svg`):R(`/brand/logo-horizontal-dark.svg`),alt:e(`changePassword.camstackAdmin`,`CamStack Admin`),className:`h-12`})}),g(`form`,{onSubmit:async e=>{if(e.preventDefault(),m(``),!t){m(`Not signed in`);return}if(s.length<md){m(`Password must be at least ${md} characters`);return}if(s!==l){m(`The two passwords do not match`);return}if(s===`changeme`){m(`Choose a password different from the seed default`);return}h.mutate({id:t.id,newPassword:s})},className:`space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10`,children:[g(`div`,{className:`space-y-1`,children:[k(`h1`,{className:`text-sm font-semibold text-foreground`,children:e(`changePassword.setANewPassword`,`Set a new password`)}),k(`p`,{className:`text-xs text-foreground-subtle`,children:n?e(`changePassword.youMustRotateTheSeed`,`You must rotate the seed password before continuing.`):e(`changePassword.chooseANewPasswordFor`,`Choose a new password for your account.`)})]}),p&&k(`div`,{className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:p}),g(`div`,{className:`space-y-1.5`,children:[k(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:e(`changePassword.newPassword`,`New password`)}),g(`div`,{className:`relative`,children:[k(`input`,{"data-testid":`change-password-new`,type:d?`text`:`password`,value:s,onChange:e=>c(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`,autoFocus:!0}),k(`button`,{type:`button`,onClick:()=>f(!d),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground transition-colors`,tabIndex:-1,children:k(d?te:ee,{className:`h-4 w-4`})})]})]}),g(`div`,{className:`space-y-1.5`,children:[k(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:e(`changePassword.confirmNewPassword`,`Confirm new password`)}),k(`input`,{"data-testid":`change-password-confirm`,type:d?`text`:`password`,value:l,onChange:e=>u(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`})]}),k(`button`,{"data-testid":`change-password-submit`,type:`submit`,disabled:h.isPending||!s||!l,className:`w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg hover:shadow-primary/30 disabled:opacity-50 disabled:shadow-none transition-all`,children:h.isPending?e(`changePassword.saving`,`Saving…`):e(`changePassword.saveAndContinue`,`Save and continue`)}),n&&k(`button`,{type:`button`,onClick:()=>{i(),o(`/login`,{replace:!0})},className:`w-full text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:e(`changePassword.signOutInstead`,`Sign out instead`)})]})]})})}function gd(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function _d(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function vd(){return window?.PublicKeyCredential!==void 0&&typeof window.PublicKeyCredential==`function`}function yd(e){let{id:t}=e;return{...e,id:_d(t),transports:e.transports}}function bd(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}var xd=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.name=r??n.name,this.code=t}},Sd=new class{createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},Cd=[`cross-platform`,`platform`];function wd(e){if(e&&!(Cd.indexOf(e)<0))return e}function Td(){if(!vd())return new Promise(e=>e(!1));let e=window.PublicKeyCredential;return e.isConditionalMediationAvailable===void 0?new Promise(e=>e(!1)):e.isConditionalMediationAvailable()}function Ed({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new xd({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new xd({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!bd(t))return new xd({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new xd({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new xd({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function Dd(e){let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!vd())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(yd));let a={...t,challenge:_d(t.challenge),allowCredentials:i},o={};if(n){if(!await Td())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=Sd.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw Ed({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=gd(u.userHandle)),{id:c,rawId:gd(l),response:{authenticatorData:gd(u.authenticatorData),clientDataJSON:gd(u.clientDataJSON),signature:gd(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:wd(s.authenticatorAttachment)}}h();async function Od(e){let t=await Dd({optionsJSON:e});return Object.fromEntries(Object.entries(t))}function kd({method:e,challengeToken:t,onComplete:n,onSecondFactor:r,onError:i}){let[a,o]=D(!1),[s,c]=D(null),l=async()=>{c(null),o(!0);try{let e=Q();if(t){let r=await Od((await e.loginBeginPasskey(t)).optionsJSON),i=await e.loginVerifyPasskey(t,r,{refreshable:!0});n(i.token,i);return}let a=await Od((await e.passkeyLoginBegin()).optionsJSON),o=await e.passkeyLoginFinish(a,{refreshable:!0}),s=o.secondFactors??(o.requiresTotp===!0?[`totp`]:[]);if(s.length>0){if(r)r({challengeToken:o.token,factors:s});else{let e=`Additional verification is required — sign in with your password to continue.`;c(e),i?.(e)}return}n(o.token,o)}catch(e){let n=t?`Passkey verification failed`:`Passkey sign-in failed`,r=e instanceof Error?e.message:n;c(r),i?.(r)}finally{o(!1)}};return g(`div`,{className:`space-y-2`,children:[g(`button`,{type:`button`,"data-testid":t?`login-passkey`:`login-passkey-direct`,onClick:()=>void l(),disabled:a,className:`w-full flex items-center justify-center gap-2 rounded-lg border border-border bg-surface px-4 py-2.5 text-sm font-medium text-foreground hover:bg-surface-hover disabled:opacity-50 transition-colors`,children:[a?k(ye,{className:`h-4 w-4 animate-spin text-primary`}):k(st,{className:`h-4 w-4 text-primary`}),e.label]}),s&&k(`div`,{className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:s})]})}var Ad=()=>window.location.hostname;function jd(e,t=Ad){return vd()&&au(t(),e.rpId)}function Md(e,t=Ad){let n=e.filter(e=>e.kind===`passkey`&&e.stage===`second-factor`).filter(e=>jd(e,t));return{passkeyMethods:n,widgetMethods:n.length>0?[]:e.filter(e=>e.kind===`widget`&&e.stage===`second-factor`)}}function Nd(e,t){let n=e.includes(`passkey`),r=t.passkeyMethods.length>0||t.widgetMethods.length>0,i=e.includes(`totp`);return n&&!r&&!i}function Pd(e){let t=e.onComplete,n=e.onSecondFactor;return typeof t==`function`?{onComplete:t,onSecondFactor:typeof n==`function`?n:void 0}:null}function Fd({methods:e,widgetConfig:t,onRedirect:n}){let{t:r}=V();zn();let i=e.filter(e=>e.kind!==`passkey`||jd(e));return i.length===0?null:g(`div`,{className:`mt-6 space-y-3`,children:[g(`div`,{className:`flex items-center gap-3`,children:[k(`div`,{className:`h-px flex-1 bg-border`}),k(`span`,{className:`text-[10px] uppercase tracking-wider text-foreground-subtle`,children:r(`login.primaryLoginMethods.orContinueWith`,`Or continue with`)}),k(`div`,{className:`h-px flex-1 bg-border`})]}),k(`div`,{className:`space-y-2`,children:i.map(e=>{if(e.kind===`redirect`){let t=(e.icon===void 0?void 0:Mn(e.icon))??Ne;return g(`a`,{href:e.startUrl,onClick:t=>{n?.(e)===!0&&t.preventDefault()},className:`flex items-center justify-center gap-2 w-full rounded-lg border border-border bg-surface px-4 py-2.5 text-sm font-medium text-foreground hover:bg-surface-hover transition-colors`,children:[k(t,{className:`h-4 w-4 text-primary`}),e.label]},e.id)}if(e.kind===`passkey`){let n=Pd(t);return n?k(kd,{method:e,onComplete:n.onComplete,onSecondFactor:n.onSecondFactor},e.id):null}return k(Id,{method:e,config:t},e.id)})})]})}function Id({method:e,config:t}){let{t:n}=V(),r=$t(e.remote,e.bundleUrl);return r===null?g(`div`,{className:`flex items-center justify-center gap-2 rounded-lg border border-border bg-background px-4 py-2.5 text-xs text-foreground-subtle`,children:[k(ye,{className:`h-3.5 w-3.5 animate-spin`}),n(`common.loading`,`Loading…`)]}):r===void 0?g(`div`,{"data-testid":`login-method-load-error`,className:`flex items-center justify-center gap-2 rounded-lg border border-danger/20 bg-danger/10 px-4 py-2.5 text-xs text-danger`,children:[k(Fe,{className:`h-3.5 w-3.5 shrink-0`}),`A sign-in method could not be loaded — reload the page to retry.`]}):k(r,{instanceId:e.id,host:`dashboard`,config:t})}function Ld(e){return e===`totp`||e===`passkey`}function Rd(e){if(!e.startsWith(`#`))return null;let t=new URLSearchParams(e.slice(1)),n=t.get(`challenge`);if(n!==null){if(n.length===0)return null;let e=(t.get(`factors`)??``).split(`,`).filter(Ld);return e.length===0?null:{kind:`challenge`,challengeToken:n,factors:e}}let r=t.get(`error`);return r===`sso-not-linked`||r===`sso-state`?{kind:`error`,code:r,provider:t.get(`provider`)}:null}function zd(e,t){switch(e){case`sso-not-linked`:return`This ${t??`sign-in`} account is not linked to a CamStack user. Sign in normally and link it from your profile.`;case`sso-state`:return`That sign-in could not be finished here — it was started in another browser, or already used. Start it again from this page.`}}var Bd={expired:`The link request expired or was already used. Press Link again.`,provider:`The sign-in finished at a different provider than the one you chose. Press Link again.`,session:`The sign-in did not finish in the browser session that started it. Sign in to CamStack here and press Link again.`,conflict:`That sign-in account is already linked to another CamStack user.`,state:`The sign-in could not be matched to this browser, or was already used. Press Link again.`};function Vd(e){let t=new URLSearchParams(e),n=t.get(`linked`);if(n!==null&&n.length>0)return{kind:`linked`,provider:n};let r=t.get(`linkError`);return r===null?null:{kind:`error`,message:Bd[r]??`Linking the sign-in account failed. Try again.`}}var Hd=`camstack:sso-return`,Ud=`camstack:sso-ack`,Wd=`/sso-complete`,Gd=1500,Kd=520,qd=680;function Jd(e){if(!e.startsWith(`#`))return null;let t=new URLSearchParams(e.slice(1)),n=t.get(`return`);t.delete(`return`);let r=t.toString();return n===`login`?r.length>0?{target:n,fragment:r}:null:n===`profile`&&r.length>0?{target:n,query:r}:null}function Yd(e){return e.target===`login`?`/login#${e.fragment}`:`/system/my-access?${e.query}`}function Xd(e){let t=new URL(e,`http://placeholder.invalid`);return t.searchParams.set(`popup`,`1`),/^[a-z][a-z0-9+.-]*:/i.test(e)?t.toString():`${t.pathname}${t.search}${t.hash}`}function Zd(e=window){let t=Math.max(0,Math.round(e.screenX+(e.outerWidth-Kd)/2)),n=Math.max(0,Math.round(e.screenY+(e.outerHeight-qd)/2));return[`popup=yes`,`width=${Kd}`,`height=${qd}`,`left=${t}`,`top=${n}`,`toolbar=no`,`menubar=no`,`location=no`,`status=no`,`resizable=yes`,`scrollbars=yes`].join(`,`)}function Qd(e){try{return window.open(e??`about:blank`,`camstack-sso`,Zd())??null}catch{return null}}function $d(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.target===`login`?typeof t.fragment==`string`:t.target===`profile`?typeof t.query==`string`:!1}function ef(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`camstack:sso-return`&&$d(t.completion)}function tf(e,t,n){return t===null||e.source!==t||e.origin!==n?null:ef(e.data)?e.data.completion:null}var nf=`camstack-sso`,rf=`camstack:sso-done`;function af(e,t){return e.target===`profile`?{target:`profile`,query:e.query}:t?{target:`login`}:null}function of(e){if(typeof e!=`object`||!e)return null;let t=e;if(t.type!==`camstack:sso-done`)return null;let n=Object.keys(t).sort().join(`,`);return t.target===`login`&&n===`target,type`?{target:`login`}:t.target===`profile`&&typeof t.query==`string`&&n===`query,target,type`?{target:`profile`,query:t.query}:null}function sf(e){return typeof e==`object`&&!!e&&e.type===`camstack:sso-done-ack`}function cf(e){try{let t=e.location.origin;return typeof t==`string`?t:null}catch{return null}}function lf(){if(typeof BroadcastChannel>`u`)return null;try{let e=new BroadcastChannel(nf);return{post:t=>e.postMessage(t),subscribe:t=>{let n=e=>t(e.data);return e.addEventListener(`message`,n),()=>e.removeEventListener(`message`,n)},close:()=>e.close()}}catch{return null}}var uf=500;function df(e,t,n=window,r={}){let i=n.location.origin,a=r.channel===void 0?lf():null,o=r.channel===void 0?a:r.channel,s=r.setInterval??((e,t)=>window.setInterval(e,t)),c=r.clearInterval??(e=>window.clearInterval(e)),l=!1,u=!1,d=r=>{let a=tf(r,e,i);a===null||l||(l=!0,n.removeEventListener(`message`,d),e.postMessage({type:Ud},i),t.onReturn(a))};n.addEventListener(`message`,d);let f=o?.subscribe(e=>{let n=of(e);n===null||l||(l=!0,o.post({type:`camstack:sso-done-ack`}),t.onDone?.(n))})??null,p=s(()=>{u||!e.closed||(u=!0,c(p),t.onClosed?.())},uf);return()=>{n.removeEventListener(`message`,d),f?.(),a?.close(),c(p)}}function ff(e,t,n){if(t===null||e.source!==t||e.origin!==n)return!1;let r=e.data;return typeof r==`object`&&!!r&&r.type===`camstack:sso-ack`}function pf(e,t){return new Promise(n=>{let r=!1,i=t(()=>{r||(r=!0,i(),n(!0))});e.setTimeout(()=>{r||(r=!0,i(),n(!1))},Gd)})}function mf(e,t,n){let r=pf(n,e=>{let r=r=>{ff(r,t,n.origin)&&e()};return n.addEventListener(`message`,r),()=>n.removeEventListener(`message`,r)});try{let r={type:Hd,completion:e};t.postMessage(r,n.origin)}catch{}return r}function hf(e,t,n){let r=pf(n,e=>t.subscribe(t=>{sf(t)&&e()}));return t.post({type:rf,...e}),r}async function gf(e,t){let n=t.opener!==null&&!t.opener.closed?t.opener:null;if(n!==null&&cf(n)===t.origin&&await mf(e,n,t)){t.close();return}let r=e.target===`login`?new URLSearchParams(e.fragment).get(`token`):null,i=r!==null&&r.length>0,a=af(e,i);if(a!==null&&t.channel!==null&&(r!==null&&i&&await t.persistSession(r),await hf(a,t.channel,t))){t.close();return}if(n!==null&&e.target===`profile`){let n=Vd(`?${e.query}`);if(n?.kind===`error`){t.showResult({kind:`link-error`,message:n.message});return}t.close();return}t.continueAt(Yd(e))}function _f(e,t){return(t.length>0&&e.startsWith(t)?e.slice(t.length):e).replace(/\/+$/,``)===Wd}var vf=`Done — you can close this window.`,yf=500,bf=`camstack_admin_token`;async function xf(e,t=``){try{let n=ts(new URLSearchParams(t));n!==null&&n.token===e?$o(n):localStorage.setItem(bf,e)}catch{}await fetch(R(`/api/auth/session`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({token:e})}).catch(()=>{})}function Sf(){try{let e=localStorage.getItem(bf);return e!==null&&e.length>0?e:null}catch{return null}}function Cf(e){let t=Jd(window.location.hash);window.history.replaceState(null,``,window.location.pathname);let n=n=>e.render(k(wf,{completion:t,result:n}));if(n(null),t===null)return;let r=lf();gf(t,{opener:window.opener,origin:window.location.origin,channel:r,addEventListener:(e,t)=>window.addEventListener(e,t),removeEventListener:(e,t)=>window.removeEventListener(e,t),close:()=>{window.close(),window.setTimeout(()=>n({kind:`done`,message:vf}),yf)},continueAt:e=>window.location.replace(R(e)),persistSession:e=>xf(e,t.target===`login`?t.fragment:``),showResult:n,setTimeout:(e,t)=>window.setTimeout(e,t)})}function wf({completion:e,result:t}){let{t:n}=V();return k(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:k(`div`,{className:`flex flex-col items-center gap-3 text-sm text-foreground-subtle`,children:e===null?k(`a`,{className:`text-primary underline`,href:R(`/login`),children:n(`ssoComplete.nothingToFinishHereGo`,`Nothing to finish here — go to sign-in`)}):t===null?g(`span`,{className:`flex items-center gap-3`,children:[k(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary/30 border-t-primary`}),n(`ssoComplete.finishingSignIn`,`Finishing sign-in…`)]}):g(S,{children:[k(`span`,{"data-testid":`sso-complete-result`,className:t.kind===`link-error`?`text-danger`:`text-foreground`,children:t.message}),k(`button`,{type:`button`,className:`rounded-md border border-border px-3 py-1.5 text-foreground hover:bg-surface-hover`,onClick:()=>window.close(),children:n(`ssoComplete.closeThisWindow`,`Close this window`)})]})})})}h();function Tf(e){if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`message`),n=Reflect.get(e,`data`);return(typeof n==`object`&&n?Reflect.get(n,`code`):void 0)===`FORBIDDEN`||typeof t==`string`&&/sign in again first/i.test(t)}function Ef(){let e=new URLSearchParams(window.location.search);return fs({codeChallenge:e.get(`code_challenge`),codeChallengeMethod:e.get(`code_challenge_method`),state:e.get(`state`),purpose:e.get(`purpose`)})}function Df(){let{t:e}=V(),{login:t,verifyTotp:n,finalizePasskeyLogin:r,user:i}=Vs(),{i18n:a}=V(),o=jt(),s=Si(),c=J(),u=new URLSearchParams(window.location.search).get(`next`);A(()=>{xs(u)},[u]);let d=new URLSearchParams(window.location.search).get(`redirect`);A(()=>{As(d)},[d]);let f=Ef();A(()=>{hs(f)},[f?.codeChallenge,f?.state,f?.purpose]);let p=c.state?.from??Bu()??`/devices`,[m,h]=D(``),[_,v]=D(``),[y,b]=D(!1),[x,C]=D(``),[w,T]=D(!1),[E,O]=D(`credentials`),[j,M]=D(``),[N,P]=D([]),[F,I]=D(``),[L,ne]=D(void 0),[re,ie]=D(`sso-not-linked`),ae=(ln.auth.listLoginMethods.useQuery().data??[]).filter(e=>e.kind!==`device-certificate`),oe=ln.auth.getServerName.useQuery().data,se=ae.filter(e=>e.stage===`primary`),ce=Md(ae);A(()=>{let e=Rd(window.location.hash);if(e!==null){if(window.history.replaceState({},``,window.location.pathname+window.location.search),e.kind===`challenge`){M(e.challengeToken),P(e.factors),I(``),O(`second-factor`);return}ie(e.code),ne(e.provider)}},[]);let le=L==null?null:ae.find(e=>e.id===L&&`label`in e)?.label??null,ue=x||(L===void 0?``:zd(re,le)),{passkeyMethods:de,widgetMethods:fe}=ce,pe=l(!1),me=async()=>{if(pe.current)return;pe.current=!0;let e=vs(d);if(e?.kind===`app-callback`){await _e(e.url);return}else if(e){window.location.assign(R(e.path));return}let t=Cs(u);t?window.location.assign(R(t)):s(p,{replace:!0})},[he,ge]=D(null),_e=async e=>{ge({callbackBase:e,mintedUrl:null,failed:!1});try{let t=Ef()??gs();if(t===null)throw Error(`The app sent no PKCE challenge and state`);let{code:n}=await Q().trpcClient.auth.createHandoffCode.mutate({purpose:t.purpose,codeChallenge:t.codeChallenge,state:t.state}),r=_s(e,n,t.state);ge({callbackBase:e,mintedUrl:r,failed:!1}),window.location.assign(r)}catch(t){if(Tf(t)){pe.current=!1,ge(null),C(`Sign in again to confirm it is you.`);return}ge({callbackBase:e,mintedUrl:null,failed:!0})}},ve=i!==null,[ye,be]=D(!1);A(()=>{!ve||!d&&!u||ye||(be(!0),me())},[ve,d,u,ye]);let xe=async e=>{e.preventDefault(),C(``),ne(void 0),T(!0);try{let e=await t(m,_);if(e.kind===`second-factor`){M(e.challengeToken),P(e.factors),O(`second-factor`);return}_===`changeme`?s(`/change-password`,{replace:!0}):await me()}catch(e){C(e instanceof Error?e.message:`Login failed`)}finally{T(!1)}},Se=async e=>{e.preventDefault(),C(``),T(!0);try{await n(j,F.trim()),await me()}catch(e){C(e instanceof Error?e.message:`TOTP verification failed`),I(``)}finally{T(!1)}},Ce=async(e,t)=>{try{await r(e,t),await me()}catch(e){C(e instanceof Error?e.message:`Passkey sign-in failed`)}},B=l(null);A(()=>()=>B.current?.(),[]);let we=async e=>{if(e.target!==`login`)return;let t=ts(new URLSearchParams(e.fragment));if(t!==null){try{await r(t.token,t),await me()}catch(e){C(e instanceof Error?e.message:`Sign-in failed`)}return}let n=Rd(`#${e.fragment}`);if(n!==null){if(n.kind===`challenge`){Ee({challengeToken:n.challengeToken,factors:n.factors});return}ie(n.code),ne(n.provider)}},Te=e=>{if(ls(d)?.kind===`app-callback`)return!1;let t=Qd(R(Xd(e.startUrl)));return t===null?!1:(C(``),ne(void 0),B.current?.(),B.current=df(t,{onReturn:e=>{B.current?.(),B.current=null,we(e)},onDone:e=>{if(B.current?.(),B.current=null,e.target!==`login`)return;let t=Sf()===null?null:Qo();t!==null&&we({target:`login`,fragment:new URLSearchParams({token:t.token,...t.refreshToken===void 0?{}:{refreshToken:t.refreshToken},...t.expiresAt===void 0?{}:{expiresAt:String(t.expiresAt)}}).toString()})}}),!0)},Ee=e=>{let t=e.factors.filter(e=>e===`totp`||e===`passkey`);M(e.challengeToken),P(t),I(``),C(``),O(`second-factor`)};return he===null?k(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:g(`div`,{className:`w-full max-w-sm`,children:[k(`div`,{className:`flex justify-center mb-8`,children:k(`img`,{src:o?.resolvedMode===`light`?R(`/brand/logo-horizontal-light.svg`):R(`/brand/logo-horizontal-dark.svg`),alt:e(`login.camstackAdmin`,`CamStack Admin`),className:`h-12`})}),oe!==void 0&&!oe.isDefault&&g(`p`,{"data-testid":`login-server-name`,className:`-mt-4 mb-6 text-center text-sm text-foreground-muted`,children:[`Sign in to `,k(`span`,{className:`font-semibold text-foreground`,children:oe.name})]}),E===`credentials`?g(`form`,{onSubmit:xe,className:`space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10`,children:[ue&&k(`div`,{"data-testid":`login-error`,className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:ue}),g(`div`,{className:`space-y-1.5`,children:[k(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:e(`login.username`,`Username`)}),k(`input`,{"data-testid":`login-username`,type:`text`,placeholder:e(`login.username`,`Username`),value:m,onChange:e=>h(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`,autoFocus:!0})]}),g(`div`,{className:`space-y-1.5`,children:[k(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:e(`login.password`,`Password`)}),g(`div`,{className:`relative`,children:[k(`input`,{"data-testid":`login-password`,type:y?`text`:`password`,placeholder:e(`login.password`,`Password`),value:_,onChange:e=>v(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`}),k(`button`,{type:`button`,onClick:()=>b(!y),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground transition-colors`,tabIndex:-1,children:k(y?te:ee,{className:`h-4 w-4`})})]})]}),k(`button`,{"data-testid":`login-submit`,type:`submit`,disabled:w||!m||!_,className:`w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg hover:shadow-primary/30 disabled:opacity-50 disabled:shadow-none transition-all`,children:w?g(`span`,{className:`flex items-center justify-center gap-2`,children:[k(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground/30 border-t-primary-foreground`}),e(`login.loggingIn`,`Logging in...`)]}):e(`login.logIn`,`Log in`)})]}):g(`div`,{className:`space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10`,children:[g(`div`,{className:`flex items-center gap-2 pb-1 border-b border-border`,children:[k(z,{className:`h-4 w-4 text-primary`}),k(`div`,{className:`text-sm font-medium text-foreground`,children:e(`login.twoFactorAuthentication`,`Two-factor authentication`)})]}),k(`p`,{className:`text-xs text-foreground-subtle`,children:m?g(S,{children:[`Finish signing in as `,k(`span`,{className:`font-mono text-foreground`,children:m}),`.`]}):e(`login.finishSigningIn`,`Finish signing in.`)}),x&&k(`div`,{className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:x}),N.includes(`passkey`)&&de.map(e=>k(kd,{method:e,challengeToken:j,onComplete:Ce},e.id)),N.includes(`passkey`)&&fe.map(e=>k(Id,{method:e,config:{challengeToken:j,onComplete:Ce}},e.id)),Nd(N,ce)&&k(`div`,{className:`rounded-md border border-border bg-background px-3 py-2 text-xs text-foreground-subtle`,children:e(`login.passkeyVerificationIsnTAvailable`,`Passkey verification isn't available on this address. Open the hub via its domain URL to complete sign-in.`)}),N.includes(`passkey`)&&N.includes(`totp`)&&g(`div`,{className:`flex items-center gap-3`,children:[k(`div`,{className:`h-px flex-1 bg-border`}),k(`span`,{className:`text-[10px] uppercase tracking-wider text-foreground-subtle`,children:`or`}),k(`div`,{className:`h-px flex-1 bg-border`})]}),N.includes(`totp`)&&g(`form`,{onSubmit:Se,className:`space-y-4`,children:[g(`div`,{className:`space-y-1.5`,children:[k(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:e(`login.authenticationCode`,`Authentication code`)}),k(`input`,{"data-testid":`login-totp`,type:`text`,inputMode:`numeric`,autoComplete:`one-time-code`,placeholder:`123456`,value:F,onChange:e=>I(e.target.value.replace(/\D/g,``).slice(0,6)),className:`w-full rounded-lg border border-border bg-background px-3 py-3 text-center text-2xl font-mono tracking-widest text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`,autoFocus:!0})]}),k(`button`,{"data-testid":`login-totp-submit`,type:`submit`,disabled:w||F.length!==6,className:`w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg hover:shadow-primary/30 disabled:opacity-50 disabled:shadow-none transition-all`,children:w?g(`span`,{className:`flex items-center justify-center gap-2`,children:[k(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground/30 border-t-primary-foreground`}),e(`login.verifying`,`Verifying...`)]}):e(`login.verifyAndSignIn`,`Verify and sign in`)})]}),g(`button`,{type:`button`,onClick:()=>{O(`credentials`),M(``),P([]),I(``),C(``)},className:`w-full flex items-center justify-center gap-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:[k(Le,{className:`h-3 w-3`}),e(`login.backToUsernamePassword`,`Back to username + password`)]})]}),E===`credentials`&&k(Fd,{methods:se,widgetConfig:{onComplete:Ce,onSecondFactor:Ee,locale:a.language},onRedirect:Te}),g(`p`,{className:`mt-6 text-center text-[10px] text-foreground-subtle/50`,children:[`CamStack v`,`1.2.428`]})]})}):k(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:g(`div`,{className:`w-full max-w-sm rounded-xl border border-border bg-surface p-6 text-center space-y-4`,children:[k(`h1`,{className:`text-sm font-semibold text-foreground`,children:e(`login.returningToTheApp`,`Returning to the app…`)}),he.failed?g(S,{children:[k(`p`,{className:`text-xs text-danger`,children:e(`login.couldNotPrepareTheSign`,`Could not prepare the sign-in handoff. You are logged in — retry below.`)}),k(`button`,{onClick:()=>void _e(he.callbackBase),className:`inline-flex rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90`,children:e(`common.retry`,`Retry`)})]}):he.mintedUrl===null?k(`p`,{className:`text-xs text-foreground-subtle`,children:e(`login.preparingAOneTimeSign`,`Preparing a one-time sign-in code…`)}):g(S,{children:[k(`p`,{className:`text-xs text-foreground-subtle`,children:e(`login.ifTheAppDoesNot`,`If the app does not open automatically, tap below (the code expires in 60s).`)}),k(`a`,{href:he.mintedUrl,className:`inline-flex rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90`,children:e(`login.openCamstack`,`Open CamStack`)})]})]})})}h();function Of(){let{pathname:e,search:t,hash:n}=J();return k(Y,{to:`${fd(e)}${t}${n}`,replace:!0})}function kf(){return k(Y,{to:Bu()??`/devices`,replace:!0})}var Af=w(()=>n(()=>import(`./Devices-PIrWjfhq.js`).then(e=>({default:e.DevicesPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url)),jf=w(()=>n(()=>import(`./Integrations-OH5z-t03.js`).then(e=>({default:e.IntegrationsPage})),__vite__mapDeps([9,1,2,3,4,10,5,6,11,12,13,7,8]),import.meta.url)),Mf=w(()=>n(()=>import(`./IntegrationDetail-DugB7cv6.js`).then(e=>({default:e.IntegrationDetailPage})),__vite__mapDeps([14,1,2,3,4,15,5,16,11,12,13,7,17]),import.meta.url)),Nf=w(()=>n(()=>import(`./ClusterStepModel-DHbwIGAW.js`).then(e=>e.r).then(e=>({default:e.PipelinePage})),__vite__mapDeps([18,1,2,3,4,19,20,21,22,5,16,23,8]),import.meta.url)),Pf=w(()=>n(()=>import(`./DeviceDetail-ByM0856T.js`).then(e=>({default:e.DeviceDetailPage})),__vite__mapDeps([24,1,2,3,4,25,26,27,28,19,29,22,5,30,31,32,33,18,20,21,16,23,8,34,13]),import.meta.url)),Ff=w(()=>n(()=>import(`./Showroom-W2yJvb8s.js`).then(e=>({default:e.ShowroomPage})),__vite__mapDeps([35,1,2,3,4]),import.meta.url)),If=w(()=>n(()=>import(`./EmbedPlayerPage-RXOmf2F3.js`).then(e=>({default:e.EmbedPlayerPage})),__vite__mapDeps([36,1,2,3,4,5]),import.meta.url)),Lf=w(()=>n(()=>import(`./Library-DDNti2te.js`).then(e=>({default:e.LibraryPage})),__vite__mapDeps([37,1,2,3,4,10,5,38,19,21,39,40,31,41,34,13]),import.meta.url)),Rf=w(()=>n(()=>import(`./Recordings-lygSYEJj.js`).then(e=>({default:e.RecordingsPage})),__vite__mapDeps([42,1,2,3,4,43,5,40,44,25,45,46,47,34,13]),import.meta.url)),zf=w(()=>n(()=>import(`./Viewer-YBzeS3RA.js`).then(e=>({default:e.ViewerPage})),__vite__mapDeps([48,2,3,4,49,5,13,1]),import.meta.url)),Bf=w(()=>n(()=>import(`./Build-CBYP1fT5.js`).then(e=>({default:e.BuildPage})),__vite__mapDeps([50,1,2,3,4,10,5,28,51,19,40,30,52,53]),import.meta.url)),Vf=w(()=>n(()=>import(`./CompositionEditorPage-Acq7iapA.js`).then(e=>({default:e.CompositionEditorPage})),__vite__mapDeps([54,1,2,3,4,28,5,6,30]),import.meta.url)),Hf=w(()=>n(()=>import(`./Locations-OL9_NoSi.js`).then(e=>({default:e.LocationsPage})),__vite__mapDeps([55,1,2,3,4,28,56,39,5,40,32,33]),import.meta.url)),Uf=w(()=>n(()=>import(`./Addons-2xWF73cR.js`).then(e=>({default:e.AddonsPage})),__vite__mapDeps([57,1,2,3,4,19,58,5,6,16,59,13]),import.meta.url)),Wf=w(()=>n(()=>import(`./AiProfiles-DmHcVlS2.js`).then(e=>({default:e.AiProfilesPage})),__vite__mapDeps([60,1,2,3,4,10,5,61,62,6,40,13]),import.meta.url)),Gf=w(()=>n(()=>import(`./MyAccess-iJP3JQIS.js`).then(e=>({default:e.MyAccessPage})),__vite__mapDeps([63,1,2,3,4,19,64,65,66,5,6,67,10,58,13]),import.meta.url)),Kf=w(()=>n(()=>import(`./Logs-DIeXeCqI.js`).then(e=>({default:e.LogsPage})),__vite__mapDeps([68,1,2,3,4,69,22,5,6,40,70,71,16,72,17,13,73]),import.meta.url)),qf=w(()=>n(()=>import(`./Identity-C-tztwfa.js`).then(e=>({default:e.IdentityPage})),__vite__mapDeps([74,1,2,3,4,10,5,75,19,76,64,65,66,6,40,70,71,16,72,17,13,67,58,73]),import.meta.url)),Jf=w(()=>n(()=>import(`./Network-DYssxNiN.js`).then(e=>({default:e.NetworkPage})),__vite__mapDeps([77,1,2,3,4,28,19,78,79,5,6,40,70,71,16,72,17,13,73]),import.meta.url)),Yf=w(()=>n(()=>import(`./Integrations-Dj3nT9ZT.js`).then(e=>({default:e.IntegrationsPage})),__vite__mapDeps([80,1,2,3,4,10,5,19,79,65,81,40,70,71,6,16,72,17,13,12]),import.meta.url)),Xf=w(()=>n(()=>import(`./Data-7BoejvKA.js`).then(e=>({default:e.DataPage})),__vite__mapDeps([82,1,2,3,4,10,5,83,29,46,6,40,44,25,45,47,34,13]),import.meta.url)),Zf=w(()=>n(()=>import(`./System-ChWpOOqN.js`).then(e=>({default:e.SystemPage})),__vite__mapDeps([84,1,2,3,4,10,5,64,58,6,40,16,72,17,13]),import.meta.url)),Qf=w(()=>n(()=>import(`./Cluster-OZlA14uV.js`).then(e=>({default:e.ClusterPage})),__vite__mapDeps([85,1,2,3,4,46,86,66,5,6,16,23,59,47]),import.meta.url)),$f=w(()=>n(()=>import(`./Terminal-CrFum1tE.js`).then(e=>({default:e.TerminalPage})),__vite__mapDeps([87,1,2,3,4,19,5,6,16,88]),import.meta.url)),ep=w(()=>n(()=>import(`./Notifications-DEcxFWp3.js`).then(e=>({default:e.NotificationsPage})),__vite__mapDeps([89,1,2,3,4,10,5,27,19,76,90,62,6,40,52,53,41,13,33]),import.meta.url)),tp=w(()=>n(()=>import(`./Calendars-C926x7b_.js`).then(e=>({default:e.CalendarsPage})),__vite__mapDeps([91,1,2,3,4,19,5,6]),import.meta.url)),np=new C({defaultOptions:{queries:{gcTime:0,staleTime:0,retry:!1,refetchOnWindowFocus:!1}}});Nt(np);function rp({field:e,value:t,onChange:n,disabled:r}){return k(Xc,{field:e,value:t,onChange:n,disabled:r})}var ip={"model-selector":rp};function ap({children:e}){let{t}=V(),{user:n,logout:r}=Vs(),[i,a]=D(0),o=l(n?.username??null);A(()=>{let e=n?.username??null;e!==o.current&&(o.current=e,Ko(),a(e=>e+1))},[n]);let c=v(()=>Q(),[i]),{bootReady:u,bootError:d}=ml(c,n??null,r);return gl(s(()=>{Q().reconnect(),a(e=>e+1),np.invalidateQueries()},[])),k(ke,{system:c,children:k(ln.Provider,{client:c.trpcClient,queryClient:np,children:g(Bt,{children:[k(Wn,{children:u?e:k(op,{})}),u&&k(nl,{}),d!==null&&u&&g(`div`,{className:`fixed bottom-[calc(env(safe-area-inset-bottom)+1rem)] right-[calc(env(safe-area-inset-right)+1rem)] z-50 max-w-sm rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning shadow-lg`,children:[t(`app.bootProbeFailed`,`Boot probe failed:`),` `,d,`. Retrying in background.`]})]})})})}function op(){let{t:e}=V();return k(`div`,{className:`flex min-h-screen items-center justify-center bg-background`,children:g(`div`,{className:`flex items-center gap-3 text-sm text-foreground-subtle`,children:[k(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary/30 border-t-primary`}),e(`app.connecting`,`Connecting…`)]})})}function sp(){return k(`div`,{className:`flex min-h-screen items-center justify-center bg-background`,children:k(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary/30 border-t-primary`})})}function cp(){return k(Jt,{defaultMode:`dark`,children:k(O,{client:np,children:k(Bs,{children:k(ap,{children:k(on,{children:k(tl,{children:g(bt,{renderers:ip,children:[k(Ba,{basename:Re(),children:k(Wc,{children:k(y,{fallback:k(sp,{}),children:g(Zi,{children:[k(X,{path:`/login`,element:k(Df,{})}),k(X,{path:`/admin/*`,element:k(Of,{})}),k(X,{path:`/admin`,element:k(Of,{})}),k(X,{path:`/change-password`,element:k($,{children:k(hd,{})})}),k(X,{path:`/showroom`,element:k(Ff,{})}),k(X,{path:`/embed/player`,element:k(If,{})}),g(X,{element:k($,{children:k(tr,{children:k(qu,{})})}),children:[k(X,{index:!0,element:k(kf,{})}),k(X,{path:`/access-denied`,element:k(pd,{})}),k(X,{path:`/dashboard`,element:k(Y,{to:`/devices`,replace:!0})}),k(X,{path:`/devices`,element:k(Af,{})}),k(X,{path:`/cameras`,element:k(Y,{to:`/devices`,replace:!0})}),k(X,{path:`/integrations`,element:k(jf,{})}),k(X,{path:`/integrations/:integrationId`,element:k(Mf,{})}),k(X,{path:`/system/pipeline`,element:k(Nf,{})}),k(X,{path:`/pipeline`,element:k(Y,{to:`/system/pipeline`,replace:!0})}),k(X,{path:`/live`,element:k(zf,{})}),k(X,{path:`/devices/:deviceId`,element:k(Pf,{})}),k(X,{path:`/system/logs`,element:k($,{requireAdmin:!0,children:k(Kf,{})})}),k(X,{path:`/system/addons`,element:k($,{requireAdmin:!0,children:k(Uf,{})})}),k(X,{path:`/system/ai`,element:k($,{requireAdmin:!0,children:k(Wf,{})})}),k(X,{path:`/system/settings`,element:k($,{requireAdmin:!0,children:k(Zf,{})})}),k(X,{path:`/system/nodes`,element:k($,{requireAdmin:!0,children:k(Qf,{})})}),k(X,{path:`/system/notifications`,element:k($,{requireAdmin:!0,children:k(ep,{})})}),k(X,{path:`/system/calendars`,element:k($,{requireAdmin:!0,children:k(tp,{})})}),k(X,{path:`/system/identity`,element:k($,{requireAdmin:!0,children:k(qf,{})})}),k(X,{path:`/system/my-access`,element:k(Gf,{})}),k(X,{path:`/system/network`,element:k($,{requireAdmin:!0,children:k(Jf,{})})}),k(X,{path:`/system/integrations`,element:k($,{requireAdmin:!0,children:k(Yf,{})})}),k(X,{path:`/system/data`,element:k($,{requireAdmin:!0,children:k(Xf,{})})}),k(X,{path:`/system`,element:k(Y,{to:al,replace:!0})}),k(X,{path:`/system/terminal`,element:k($,{requireAdmin:!0,children:k($f,{})})}),ol.map(e=>k(X,{path:e.path,element:k(cl,{tab:e.tab})},e.path)),k(X,{path:`/system/users`,element:k(Y,{to:`/system/identity?tab=users`,replace:!0})}),k(X,{path:`/system/api-keys`,element:k(Y,{to:`/system/identity?tab=api-keys`,replace:!0})}),k(X,{path:`/system/authentication`,element:k(Y,{to:ld(`authentication`),replace:!0})}),k(X,{path:`/system/linked-sessions`,element:k(Y,{to:`/system/identity?tab=linked-sessions`,replace:!0})}),k(X,{path:`/system/remote-access`,element:k(Y,{to:ld(`remoteAccess`),replace:!0})}),k(X,{path:`/system/turn`,element:k(Y,{to:ld(`turn`),replace:!0})}),k(X,{path:`/system/storage`,element:k(Y,{to:`/system/data?tab=storage`,replace:!0})}),k(X,{path:`/system/backup`,element:k(Y,{to:`/system/data?tab=backup`,replace:!0})}),k(X,{path:`/library`,element:k($,{requireAdmin:!0,children:k(Lf,{})})}),k(X,{path:`/retrain`,element:k(Y,{to:`/addon/training`,replace:!0})}),k(X,{path:`/recordings`,element:k($,{requireAdmin:!0,children:k(Rf,{})})}),k(X,{path:`/build`,element:k($,{requireAdmin:!0,children:k(Bf,{})})}),k(X,{path:Zu,element:k($,{requireAdmin:!0,children:k(Vf,{})})}),k(X,{path:Qu,element:k($,{requireAdmin:!0,children:k(Vf,{})})}),k(X,{path:`/locations`,element:k($,{requireAdmin:!0,children:k(Hf,{})})}),k(X,{path:`/automation`,element:k(Zc,{to:`/build`})}),k(X,{path:`/addon/:pagePath`,element:k($,{requireAdmin:!0,children:k(Cl,{})})}),k(X,{path:`*`,element:k(Y,{to:`/devices`,replace:!0})})]})]})})})}),k(dl,{})]})})})})})})})}h(),window.__camstackUiLibrary=An,window.__camstackSdk=Tn,window.__camstackTypes=vt;var lp=Qn(document.getElementById(`root`));_f(window.location.pathname,Re())?Cf(lp):lp.render(k(b,{children:k(cp,{})}));export{fc as A,bo as B,ql as C,Hc as D,el as E,tc as F,Z as G,yo as H,ec as I,Ha as J,go as K,Us as L,oc as M,cc as N,kc as O,nc as P,Xa as Q,Vs as R,pu as S,al as T,vo as U,Co as V,_o as W,Si as X,Y,Ei as Z,Yu as _,Dd as a,td as b,od as c,sd as d,ld as f,Xu as g,$u as h,Vd as i,ac as j,mc as k,rd as l,dd as m,df as n,cd as o,ud as p,lo as q,Xd as r,ad as s,Qd as t,id as u,Ju as v,Hl as w,ed as x,nd as y,Oo as z};