@camera.ui/server 2.1.12 → 2.1.14-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/interface/assets/{404-BDi1TzED.js → 404-CVkDpT0X.js} +1 -1
- package/dist/interface/assets/{About-DeHiJp3n.js → About-CUgIR2xi.js} +1 -1
- package/dist/interface/assets/Automation-BYRKp0AC.js +3 -0
- package/dist/interface/assets/{AutomationImport-B3bCE-yS.js → AutomationImport-L_OzZZgi.js} +2 -2
- package/dist/interface/assets/{AutomationStore-BoWd7IW9.js → AutomationStore-DaNQqJoT.js} +2 -2
- package/dist/interface/assets/AutomationStoreDetail-Seor4Ohh.js +2 -0
- package/dist/interface/assets/Automations-BMQIkpUa.js +2 -0
- package/dist/interface/assets/Camera-3umh2Xjc.js +2 -0
- package/dist/interface/assets/{CameraConsole-C8XSUr7X.js → CameraConsole-BLlgkKDp.js} +2 -2
- package/dist/interface/assets/Cameras-DvK8E1Vk.js +651 -0
- package/dist/interface/assets/{Camview-Lp3QU0de.css → Camview-DIEa8IRE.css} +1 -1
- package/dist/interface/assets/Camview-DSO2lWxT.js +1 -0
- package/dist/interface/assets/{CertificateUpload-Cg89m_cM.js → CertificateUpload-BsnlaxRS.js} +1 -1
- package/dist/interface/assets/{Config-BDa4dy1w.js → Config-BXj83-No.js} +1 -1
- package/dist/interface/assets/{ConfigActionCameraControl-DNmRpuPG.js → ConfigActionCameraControl-BGfvT6ME.js} +1 -1
- package/dist/interface/assets/{ConfigActionDelay-Reg_tEG_.js → ConfigActionDelay-D10_C6yo.js} +1 -1
- package/dist/interface/assets/{ConfigActionHttp-CqRBOSa3.js → ConfigActionHttp-DL4jh9Wz.js} +1 -1
- package/dist/interface/assets/{ConfigActionImageInput-GWECLY4I.js → ConfigActionImageInput-DVvMUzrT.js} +1 -1
- package/dist/interface/assets/{ConfigActionMqtt-Di4ZTig8.js → ConfigActionMqtt-BqK3q4cC.js} +1 -1
- package/dist/interface/assets/ConfigActionNotification-D_H5Q68D.js +1 -0
- package/dist/interface/assets/{ConfigActionNotificationControl-B_p8dnc4.js → ConfigActionNotificationControl-BnTJl4dr.js} +1 -1
- package/dist/interface/assets/{ConfigActionOutput-B31cj20h.js → ConfigActionOutput-udY95_rH.js} +1 -1
- package/dist/interface/assets/{ConfigActionPlugin-DCUhDIiJ.js → ConfigActionPlugin-C51LrkZb.js} +1 -1
- package/dist/interface/assets/{ConfigActionSensor-De63wYQU.js → ConfigActionSensor-B2tFf8x6.js} +1 -1
- package/dist/interface/assets/{ConfigActionSnapshot-DZJDjOMT.js → ConfigActionSnapshot-BzmeByH3.js} +1 -1
- package/dist/interface/assets/{ConfigActionVariable-Q3QXVMbR.js → ConfigActionVariable-BagC3lj5.js} +1 -1
- package/dist/interface/assets/{ConfigConditionIfElse-DKonPxli.js → ConfigConditionIfElse-CQOZJ19Y.js} +1 -1
- package/dist/interface/assets/{ConfigConditionSensorState-C_J6ERzt.js → ConfigConditionSensorState-SGYpkNP5.js} +1 -1
- package/dist/interface/assets/ConfigConditionSwitch-BXR6xUN8.js +1 -0
- package/dist/interface/assets/{ConfigConditionTime-CRDI58_P.js → ConfigConditionTime-BrEhw1R9.js} +1 -1
- package/dist/interface/assets/{ConfigSensorValueInput-C3ep90ds.js → ConfigSensorValueInput-DezTWtbA.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerDetection-CbVFlyI8.js → ConfigTriggerDetection-xo0imE_3.js} +1 -1
- package/dist/interface/assets/ConfigTriggerGeofence-BmJpP4Ew.js +1 -0
- package/dist/interface/assets/{ConfigTriggerManual-7kAukUgk.js → ConfigTriggerManual-CmAdnZQK.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerMqtt-DUCZZt2j.js → ConfigTriggerMqtt-F19dhVm1.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerSchedule-lAiLdu1W.js → ConfigTriggerSchedule-BGci3Aed.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerSensor-DIhCfhcN.js → ConfigTriggerSensor-DSEDGB2X.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerSystem-DZu6Fp2j.js → ConfigTriggerSystem-DPy8Zir4.js} +1 -1
- package/dist/interface/assets/{ConfigTriggerWebhook-D3a5f6vl.js → ConfigTriggerWebhook-Dv0Kmwg8.js} +1 -1
- package/dist/interface/assets/Console-Cuh-Vc4u.js +1 -0
- package/dist/interface/assets/{CuiAutomationRunsDialog-CgzW_s6M.js → CuiAutomationRunsDialog-B1UeVC6Q.js} +1 -1
- package/dist/interface/assets/{CuiBottomSheet-C7UdIQu1.js → CuiBottomSheet-BjkDE7_9.js} +1 -1
- package/dist/interface/assets/CuiBottomSheet-C9G-NoMU.js +1 -0
- package/dist/interface/assets/CuiCameraPipCard-nrln9zp-.js +1 -0
- package/dist/interface/assets/CuiCameraRecordings-B7BhgPpP.css +1 -0
- package/dist/interface/assets/CuiCameraRecordings-HKwhFpea.js +1 -0
- package/dist/interface/assets/{CuiCameraShares-D3fAJNWF.js → CuiCameraShares-D-fhJCro.js} +1 -1
- package/dist/interface/assets/{CuiCameraTable-ApLSxeO4.js → CuiCameraTable-BTVfK-HY.js} +2 -2
- package/dist/interface/assets/CuiCameraTable-DGg4_c_u.js +1 -0
- package/dist/interface/assets/{CuiChartTable-BeEij8SL.js → CuiChartTable-DAUYP-EW.js} +1 -1
- package/dist/interface/assets/{CuiConsole-CMxpzZ51.js → CuiConsole-C7aZj4wK.js} +2 -2
- package/dist/interface/assets/{CuiDataTable-f_QVzRqq.js → CuiDataTable-1B8aaZQO.js} +1 -1
- package/dist/interface/assets/CuiLightControl-CSA1PYc8.js +1 -0
- package/dist/interface/assets/{CuiList-C3oJKyJC.js → CuiList-D-hOSNou.js} +1 -1
- package/dist/interface/assets/CuiPluginCard-D1Hkyiy4.js +2 -0
- package/dist/interface/assets/{CuiPluginCategoryChip-EJhup0nM.js → CuiPluginCategoryChip-qnn-HD6g.js} +1 -1
- package/dist/interface/assets/{CuiPluginOAuthButton-CbPU8trR.js → CuiPluginOAuthButton-CXextmBv.js} +2 -2
- package/dist/interface/assets/{CuiPluginTrustBadge-B4bxBl3A.js → CuiPluginTrustBadge-C-8MN2Qc.js} +1 -1
- package/dist/interface/assets/{CuiQRCode-CycvR5wz.js → CuiQRCode-D1qmU4qU.js} +1 -1
- package/dist/interface/assets/CuiSchema-DnHOpBg4.js +1 -0
- package/dist/interface/assets/{CuiTopNavbarItem-D4qP-WpK.js → CuiTopNavbarItem-Csb3O1-n.js} +1 -1
- package/dist/interface/assets/Faces-C0QpQxuF.js +1 -0
- package/dist/interface/assets/FirstSteps-BqZQovY7.js +1 -0
- package/dist/interface/assets/{Floorplan-Da5gt435.css → Floorplan-Bxhdg4C2.css} +1 -1
- package/dist/interface/assets/Floorplan-CW-W5ZkV.js +1 -0
- package/dist/interface/assets/Instances-VSkiqKKf.js +1 -0
- package/dist/interface/assets/{Logs-BBZMBN6a.js → Logs-DQFS2AUi.js} +2 -2
- package/dist/interface/assets/{Menu-CRLIo98F.js → Menu-COvvZ_vz.js} +1 -1
- package/dist/interface/assets/Metrics-cvbQzChA.js +9 -0
- package/dist/interface/assets/OAuthDeviceFlow-3ZC2QCAs.js +1 -0
- package/dist/interface/assets/Plugin-DjQd3Y9J.js +1 -0
- package/dist/interface/assets/{PluginConsole-D2SUwFDo.js → PluginConsole-BaUkghQD.js} +2 -2
- package/dist/interface/assets/PluginDetail-Ofj1hk2q.js +2 -0
- package/dist/interface/assets/{PluginSchema-U4q4c9ak.js → PluginSchema-f-ER7hlx.js} +1 -1
- package/dist/interface/assets/PluginSearch-Ce3S1HDv.js +1 -0
- package/dist/interface/assets/PluginSearch-D5eQsj5p.js +2 -0
- package/dist/interface/assets/{PluginUpdateProgress-DWcs6NlJ.js → PluginUpdateProgress-BfYNLvVX.js} +1 -1
- package/dist/interface/assets/Plugins-DtDN9z0k.js +1 -0
- package/dist/interface/assets/Recordings-CQGnTZFt.js +1 -0
- package/dist/interface/assets/SensorEdit-BZtiJyoI.js +1 -0
- package/dist/interface/assets/{SensorHistory-B16b4-Um.js → SensorHistory-BFkT3teu.js} +1 -1
- package/dist/interface/assets/{Sensors-BsLHVGqk.css → Sensors-CaKl4PQY.css} +1 -1
- package/dist/interface/assets/Sensors-DSR-AUqb.js +2 -0
- package/dist/interface/assets/{Settings-BOd4EPix.js → Settings-DV3JZFjc.js} +1 -1
- package/dist/interface/assets/SettingsAccount-Cd5JPsv2.js +1 -0
- package/dist/interface/assets/SettingsAccount-D4ib7Asi.js +1 -0
- package/dist/interface/assets/SettingsAppearance-BYsQmdyo.js +1 -0
- package/dist/interface/assets/{SettingsAppearance-DZGa_aiI.js → SettingsAppearance-CC6StMAi.js} +1 -1
- package/dist/interface/assets/{SettingsBackup-DyblUiF8.js → SettingsBackup-BcVFCbhB.js} +1 -1
- package/dist/interface/assets/{SettingsList-DM0yAFkS.js → SettingsList-04HiM3OT.js} +1 -1
- package/dist/interface/assets/SettingsMqtt-XaJdsYPn.js +1 -0
- package/dist/interface/assets/SettingsNotifications-CUoYMHwr.js +1 -0
- package/dist/interface/assets/{SettingsPermissions-w2ptf4wy.js → SettingsPermissions-gFDNSlTh.js} +1 -1
- package/dist/interface/assets/SettingsRecordings-Bw64UZWe.js +1 -0
- package/dist/interface/assets/SettingsRemote-BnFW-uT-.js +2 -0
- package/dist/interface/assets/{SettingsSystem-BsXkYsRC.js → SettingsSystem-Cdjg5GNY.js} +2 -2
- package/dist/interface/assets/{SettingsUsers-BSsmo6T0.js → SettingsUsers-DphPL78H.js} +1 -1
- package/dist/interface/assets/{Terminal-cU-8dVL_.js → Terminal-CrNjqzTs.js} +2 -2
- package/dist/interface/assets/{Updates-dw0MwgsN.js → Updates-V5B9LSD-.js} +1 -1
- package/dist/interface/assets/{VariableInput-JSpyezJa.js → VariableInput-n0TxKRqq.js} +1 -1
- package/dist/interface/assets/{VariableSuggestions-DZbWgsck.js → VariableSuggestions-C4LmaCAo.js} +1 -1
- package/dist/interface/assets/{VersionsHandler-C_mzsgfj.js → VersionsHandler-BPocJcb0.js} +2 -2
- package/dist/interface/assets/{VirtualSensorCreate-3mJ8c6Tl.js → VirtualSensorCreate-BPvbrzGS.js} +1 -1
- package/dist/interface/assets/Workers-DEvQNzUi.js +2 -0
- package/dist/interface/assets/{lightbulb-outline-BtraGBwO.js → alert-outline-DtiCgufF.js} +1 -1
- package/dist/interface/assets/{api-COPnjVh2.js → api-BXmkXIE8.js} +1 -1
- package/dist/interface/assets/api-DO5wBndX.css +2 -0
- package/dist/interface/assets/api-x8zXlvtm.js +4 -0
- package/dist/interface/assets/{auth-owqLfbdn.js → auth-BKJnreuu.js} +1 -1
- package/dist/interface/assets/{automations-Bql07EFx.js → automations-CVuIXlAQ.js} +1 -1
- package/dist/interface/assets/cameraSources-C3cl6FVD.js +1 -0
- package/dist/interface/assets/cloudHandoff-BZvvihwX.js +1 -0
- package/dist/interface/assets/{config-soN-D-nC.js → config-Sw94rZxF.js} +1 -1
- package/dist/interface/assets/{flowSchema-BFZ6n5Su.js → flowSchema-BOrDqdeG.js} +1 -1
- package/dist/interface/assets/{intercomService-Bjn0OsVT.js → intercomService-CfCIMUlA.js} +1 -1
- package/dist/interface/assets/main-Jl93jEZK.js +3 -0
- package/dist/interface/assets/{main-BF8Mg561.css → main-Qqk3RyYP.css} +1 -1
- package/dist/interface/assets/{mqtt-CMdU36uB.js → mqtt-BaCMJJk_.js} +1 -1
- package/dist/interface/assets/nodeDefinitions-a8iyp3yk.js +1 -0
- package/dist/interface/assets/{notifications-C_CbT9aA.js → notifications-l-x8vA4D.js} +1 -1
- package/dist/interface/assets/{plugins-CGDE1O2F.js → plugins-GA9v-eQx.js} +1 -1
- package/dist/interface/assets/{rooms-BnJo8QbU.js → rooms-DX7PBdpP.js} +1 -1
- package/dist/interface/assets/sensorIcons-BTgouEmX.js +1 -0
- package/dist/interface/assets/{sensors-Bshdwbki.js → sensors-LJkBCaMk.js} +1 -1
- package/dist/interface/assets/{server-CaRDiFTF.js → server-dOx3q8o1.js} +1 -1
- package/dist/interface/assets/theme-DgrclY58.js +1 -0
- package/dist/interface/assets/types-CSWXRySW.js +1 -0
- package/dist/interface/assets/{types-Dwu7_YVv.js → types-D19FOdYo.js} +1 -1
- package/dist/interface/assets/types-Yq0FH8fa.js +1 -0
- package/dist/interface/assets/ungrouped-B_u9a5wm.js +1 -0
- package/dist/interface/assets/{ungrouped-uv64nr5n.css → ungrouped-DTYy_Pud.css} +1 -1
- package/dist/interface/assets/{updates-DelnBMM3.js → updates-BVN6uGXy.js} +1 -1
- package/dist/interface/assets/{useAppVersion-DeQeb6UF.js → useAppVersion-BUDIkitU.js} +1 -1
- package/dist/interface/assets/useBackupRestore-CnSZNCC8.js +1 -0
- package/dist/interface/assets/{useCameraOptions-DgMpN00_.js → useCameraOptions-Cgb4eV2d.js} +1 -1
- package/dist/interface/assets/{useLogsSocket-BKPqNCOv.js → useLogsSocket-CGKtL049.js} +1 -1
- package/dist/interface/assets/{useNavLayout-BJhl8UVM.js → useNavLayout-Dcngcb73.js} +1 -1
- package/dist/interface/assets/{usePermissions-Eyt2t6_8.js → usePermissions-zJF4LCPm.js} +1 -1
- package/dist/interface/assets/{usePluginUpdates-wfckuNy_.js → usePluginUpdates-DP--lRxm.js} +1 -1
- package/dist/interface/assets/{usePushRegistration-jcfB8ujf.js → usePushRegistration-BhPBp28J.js} +1 -1
- package/dist/interface/assets/{useServerRestart-XnqHaTb7.js → useServerRestart-BpCDYbPH.js} +1 -1
- package/dist/interface/assets/{useStreamStatus-8bE5h_fQ.js → useStreamStatus-BoVMk6KT.js} +1 -1
- package/dist/interface/assets/{useTabSwipe-DxZfseQO.js → useTabSwipe--t-Qqa31.js} +1 -1
- package/dist/interface/assets/{useUpdateChannel-CjxdE3h1.js → useUpdateChannel-DAuhU-__.js} +1 -1
- package/dist/interface/assets/{useUpdatesSocket-DFt7_yr8.js → useUpdatesSocket-C-j3b3tU.js} +1 -1
- package/dist/interface/assets/{useUserOptions-DStio0f5.js → useUserOptions-CcLVC73O.js} +1 -1
- package/dist/interface/assets/vendor-cameraui-phsC2Mmi.js +2326 -0
- package/dist/interface/assets/vendor-core-C0ZWoGJD.js +1 -0
- package/dist/interface/assets/{vendor-primevue-DXXRO7Z5.js → vendor-primevue-nPess0JU.js} +76 -76
- package/dist/interface/assets/vendor-zod-CJ7LAMqQ.js +99 -0
- package/dist/interface/ha/404-PedrGUiq.js +60 -0
- package/dist/interface/ha/About-l5fkBqG7.js +55 -0
- package/dist/interface/ha/Automation-CaSlGjT4.js +2015 -0
- package/dist/interface/ha/AutomationImport-BNavtjDq.js +206 -0
- package/dist/interface/ha/AutomationStore-BVSW8TVt.js +335 -0
- package/dist/interface/ha/AutomationStoreDetail-DHZwlpz0.js +122 -0
- package/dist/interface/ha/Automations-CZ2jvH6d.js +437 -0
- package/dist/interface/ha/Camera-CggUrrPm.js +625 -0
- package/dist/interface/ha/CameraConsole-DpzF48TF.js +52 -0
- package/dist/interface/ha/Cameras-K-kQF5tG.js +1970 -0
- package/dist/interface/ha/Camview-zJVP7JwZ.js +1337 -0
- package/dist/interface/ha/CertificateUpload-DbBQ87OT.js +117 -0
- package/dist/interface/ha/Config-Bsud2DYI.js +356 -0
- package/dist/interface/ha/ConfigActionCameraControl-Czkfw_NO.js +152 -0
- package/dist/interface/ha/ConfigActionDelay-BHug57u7.js +61 -0
- package/dist/interface/ha/ConfigActionHttp-LfbxbfgG.js +134 -0
- package/dist/interface/ha/ConfigActionImageInput-Ce2GJzCm.js +171 -0
- package/dist/interface/ha/ConfigActionMqtt-KmCGcNZb.js +81 -0
- package/dist/interface/ha/ConfigActionNotification-DUMY_3IT.js +199 -0
- package/dist/interface/ha/ConfigActionNotificationControl-B9Z2i5WR.js +111 -0
- package/dist/interface/ha/ConfigActionOutput-CX-ZQjcs.js +98 -0
- package/dist/interface/ha/ConfigActionPlugin-y5PuPwdk.js +172 -0
- package/dist/interface/ha/ConfigActionSensor-CC39Rpxi.js +139 -0
- package/dist/interface/ha/ConfigActionSnapshot-CWyhx6rk.js +48 -0
- package/dist/interface/ha/ConfigActionVariable-BNRLCthd.js +88 -0
- package/dist/interface/ha/ConfigConditionIfElse-BayS5_Dr.js +124 -0
- package/dist/interface/ha/ConfigConditionSensorState-DLXNqL-R.js +192 -0
- package/dist/interface/ha/ConfigConditionSwitch-BBesQgWi.js +128 -0
- package/dist/interface/ha/ConfigConditionTime-aD8mk2aa.js +95 -0
- package/dist/interface/ha/ConfigSensorValueInput-5JzesEuD.js +169 -0
- package/dist/interface/ha/ConfigTriggerDetection--BcjPuyh.js +241 -0
- package/dist/interface/ha/ConfigTriggerGeofence-BZi5a2Yv.js +4896 -0
- package/dist/interface/ha/ConfigTriggerManual-ConxhgNx.js +14 -0
- package/dist/interface/ha/ConfigTriggerMqtt-B6C9injX.js +134 -0
- package/dist/interface/ha/ConfigTriggerSchedule-Vv5iNKL3.js +72 -0
- package/dist/interface/ha/ConfigTriggerSensor-beixHfSD.js +73 -0
- package/dist/interface/ha/ConfigTriggerSystem-BHDpn485.js +188 -0
- package/dist/interface/ha/ConfigTriggerWebhook-D9cuCU_p.js +94 -0
- package/dist/interface/ha/Console-CbQnrt6X.js +348 -0
- package/dist/interface/ha/CuiAutomationRunsDialog-CckgCRNS.js +130 -0
- package/dist/interface/ha/CuiBottomSheet-juhGdTsO.js +270 -0
- package/dist/interface/ha/CuiCameraRecordings-CLzZiXhk.js +552 -0
- package/dist/interface/ha/CuiCameraShares-Dzx1jZGE.js +121 -0
- package/dist/interface/ha/CuiCameraTable-ug0ik9N-.js +153 -0
- package/dist/interface/ha/CuiChartTable-7EnAA-WG.js +6784 -0
- package/dist/interface/ha/CuiConsole-DOnyBSL7.js +244 -0
- package/dist/interface/ha/CuiDataTable-Cx9GBqsV.js +8725 -0
- package/dist/interface/ha/CuiList-C45psxFZ.js +57 -0
- package/dist/interface/ha/CuiMarkdownContent-D7sCtnNQ.js +4716 -0
- package/dist/interface/ha/CuiPluginCard-ChLIfOms.js +769 -0
- package/dist/interface/ha/CuiPluginOAuthButton-B6vPOEx2.js +105 -0
- package/dist/interface/ha/CuiPluginTrustBadge-BvPV93D0.js +123 -0
- package/dist/interface/ha/CuiQRCode-Djr3z54t.js +86 -0
- package/dist/interface/ha/CuiSchema-dl7TXv-k.js +963 -0
- package/dist/interface/ha/CuiTopNavbarItem-BXoda5eM.js +141 -0
- package/dist/interface/ha/Faces-DnqWMGWW.js +1281 -0
- package/dist/interface/ha/FirstSteps-CFawb017.js +251 -0
- package/dist/interface/ha/Floorplan-Mv-Ootly.js +3677 -0
- package/dist/interface/ha/Instances-DJjZ3btI.js +680 -0
- package/dist/interface/ha/Logs-CLFhW1xq.js +418 -0
- package/dist/interface/ha/Menu-D7QTRqMJ.js +161 -0
- package/dist/interface/ha/Metrics-CCvFtezL.js +1330 -0
- package/dist/interface/ha/OAuthDeviceFlow-4YupTNsK.js +112 -0
- package/dist/interface/ha/Plugin-BHU0yhBa.js +1404 -0
- package/dist/interface/ha/PluginConsole-CNrLuFQM.js +56 -0
- package/dist/interface/ha/PluginDetail-Bm3X-xN4.js +230 -0
- package/dist/interface/ha/PluginSearch-C0be8cYD.js +475 -0
- package/dist/interface/ha/PluginUpdateProgress-DVvgYMLG.js +34 -0
- package/dist/interface/ha/Plugins-R-uz0Se-.js +705 -0
- package/dist/interface/ha/Recordings-DAwbihs8.js +1463 -0
- package/dist/interface/ha/SensorEdit-BxE1cRLR.js +1460 -0
- package/dist/interface/ha/SensorHistory-DUGlH2pU.js +54 -0
- package/dist/interface/ha/Sensors-Cax5RlPH.js +1358 -0
- package/dist/interface/ha/Settings-DKtlCoyz.js +218 -0
- package/dist/interface/ha/SettingsAccount-2e_Vjpev.js +970 -0
- package/dist/interface/ha/SettingsAppearance-DCm60FhX.js +220 -0
- package/dist/interface/ha/SettingsBackup-CiM_nNWt.js +556 -0
- package/dist/interface/ha/SettingsList-D4D3cmLo.js +40 -0
- package/dist/interface/ha/SettingsMqtt-CID4L0PD.js +526 -0
- package/dist/interface/ha/SettingsNotifications-DGJkhm8T.js +529 -0
- package/dist/interface/ha/SettingsPermissions-Cd0rtgli.js +84 -0
- package/dist/interface/ha/SettingsRecordings-pR4L0wgy.js +151 -0
- package/dist/interface/ha/SettingsRemote-CYg-LSQK.js +1810 -0
- package/dist/interface/ha/SettingsSystem-BeYJN1Ut.js +376 -0
- package/dist/interface/ha/SettingsUsers-F4CZggSR.js +379 -0
- package/dist/interface/ha/Terminal-iQahUx9P.js +631 -0
- package/dist/interface/ha/Updates-ClQ77p-o.js +356 -0
- package/dist/interface/ha/VariableInput-BOHBmNff.js +52 -0
- package/dist/interface/ha/VariableSuggestions-BE06z6SW.js +201 -0
- package/dist/interface/ha/VersionsHandler-Cx9u0oj8.js +211 -0
- package/dist/interface/ha/VirtualSensorCreate-CvSzLo4N.js +101 -0
- package/dist/interface/ha/Workers-CEJtdSu-.js +765 -0
- package/dist/interface/ha/accordion-BT2wHwK8.js +577 -0
- package/dist/interface/ha/account-B1xL2wxD.js +19 -0
- package/dist/interface/ha/ace-Dh61T4RV.js +13238 -0
- package/dist/interface/ha/ace.config-HyzcNHkM.js +1429 -0
- package/dist/interface/ha/alert-circle-CLRn5GAd.js +19 -0
- package/dist/interface/ha/alert-outline-CGTMAqXf.js +75 -0
- package/dist/interface/ha/api-BmNBy1ay.js +29 -0
- package/dist/interface/ha/api-CWJkvtnM.js +60866 -0
- package/dist/interface/ha/arrow-left-DkvcResi.js +19 -0
- package/dist/interface/ha/auth-X6tkVYJs.js +271 -0
- package/dist/interface/ha/autocomplete-L_jK3s3m.js +1373 -0
- package/dist/interface/ha/automationBlueprint-D1TiCF7R.js +249 -0
- package/dist/interface/ha/back-filled-Cxzg5vQg.js +20 -0
- package/dist/interface/ha/base-D_LAf3cS.js +26 -0
- package/dist/interface/ha/base-c1lsE5TW.js +125 -0
- package/dist/interface/ha/bell-ring-xrXdzNHW.js +19 -0
- package/dist/interface/ha/brain-DyOOk3m3.js +19 -0
- package/dist/interface/ha/browser-Bxx7joo_.js +1227 -0
- package/dist/interface/ha/browserconfig.xml +11 -0
- package/dist/interface/ha/button-BlYuI0Q7.js +406 -0
- package/dist/interface/ha/cameraui-cards.js +190 -0
- package/dist/interface/ha/cards-CNOyNWMA.js +13316 -0
- package/dist/interface/ha/cctv-Bz6BH0ns.js +19 -0
- package/dist/interface/ha/check-circle-D_wDxrLs.js +19 -0
- package/dist/interface/ha/chevron-down-P5MtUhJO.js +19 -0
- package/dist/interface/ha/chip-DxGABeun.js +149 -0
- package/dist/interface/ha/clock-outline-JxApewmA.js +19 -0
- package/dist/interface/ha/close-Eq3txTBS.js +19 -0
- package/dist/interface/ha/close-circle-C2nTtN_-.js +19 -0
- package/dist/interface/ha/config-E4Jkelkr.js +116 -0
- package/dist/interface/ha/content-copy-DpPXKtKE.js +19 -0
- package/dist/interface/ha/copy-C48Ur26H.js +22 -0
- package/dist/interface/ha/datepicker-BuvKhBWJ.js +3236 -0
- package/dist/interface/ha/definitions-E-sY7Cxg.js +23 -0
- package/dist/interface/ha/delete-D-m8mqly.js +19 -0
- package/dist/interface/ha/dist-B7lgvbyI.js +279 -0
- package/dist/interface/ha/dist-Ca9_5rzq.js +3457 -0
- package/dist/interface/ha/divider-jkWvVbPJ.js +110 -0
- package/dist/interface/ha/download-Cnr7IQKX.js +19 -0
- package/dist/interface/ha/esm-1sIZN4t7.js +6 -0
- package/dist/interface/ha/esm-6hnPZcZr.js +15 -0
- package/dist/interface/ha/esm-B72ViJ7F.js +5 -0
- package/dist/interface/ha/esm-BGlkcEes.js +156 -0
- package/dist/interface/ha/esm-BKPZuThK.js +5 -0
- package/dist/interface/ha/esm-BMx7MsZ_.js +15 -0
- package/dist/interface/ha/esm-CChFtwcx.js +21 -0
- package/dist/interface/ha/esm-CMTmAdHP.js +5 -0
- package/dist/interface/ha/esm-CkoEL9YX.js +7 -0
- package/dist/interface/ha/esm-CvxDASXR.js +23 -0
- package/dist/interface/ha/esm-Demxl4zQ.js +5 -0
- package/dist/interface/ha/esm-DiBhi9zp.js +5 -0
- package/dist/interface/ha/esm-XFPB9fYb.js +15 -0
- package/dist/interface/ha/eventLabels-B4C1_4vT.js +42 -0
- package/dist/interface/ha/eye-off-AdumIw0H.js +33 -0
- package/dist/interface/ha/eye-off-outline-DO3xfiua.js +19 -0
- package/dist/interface/ha/fonts/InterVariable.woff2 +0 -0
- package/dist/interface/ha/history-BoZc8mgf.js +19 -0
- package/dist/interface/ha/home-am0tRTsk.js +19 -0
- package/dist/interface/ha/information-outline-DIdNxPCN.js +19 -0
- package/dist/interface/ha/inputicon-6-vaPLbw.js +324 -0
- package/dist/interface/ha/inputnumber-B1Buq8Nc.js +1033 -0
- package/dist/interface/ha/inputtext-DGIESrd0.js +257 -0
- package/dist/interface/ha/intercomService-jB2mTgsn.js +1406 -0
- package/dist/interface/ha/message-C8U_kMBA.js +244 -0
- package/dist/interface/ha/minus-DKa9TXat.js +19 -0
- package/dist/interface/ha/minus-QyTgaT70.js +46 -0
- package/dist/interface/ha/mqtt-BmDCmG9h.js +56 -0
- package/dist/interface/ha/multiselect-BbgV_fPx.js +1492 -0
- package/dist/interface/ha/native-BaNeloQn.js +35 -0
- package/dist/interface/ha/native-C8PbNqsJ.js +29 -0
- package/dist/interface/ha/notifications-B51yvrGL.js +159 -0
- package/dist/interface/ha/og-share.png +0 -0
- package/dist/interface/ha/pencil-outline-BqfTDXIh.js +19 -0
- package/dist/interface/ha/pinia-3D39Do4a.js +6934 -0
- package/dist/interface/ha/platformLabels-C3d1PLg-.js +27 -0
- package/dist/interface/ha/plugin-DAGqBiG_.js +38 -0
- package/dist/interface/ha/plugins-dkWbXWVM.js +592 -0
- package/dist/interface/ha/plus-CNdrByQb.js +46 -0
- package/dist/interface/ha/plus-d_caPq5l.js +19 -0
- package/dist/interface/ha/progressbar-CIoPoMSe.js +95 -0
- package/dist/interface/ha/protocol-BB4jdtUC-K1r3LFCq.js +706 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-1136x640.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-1334x750.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-1792x828.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2048x1536.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2160x1620.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2208x1242.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2224x1668.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2388x1668.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2436x1125.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2532x1170.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2556x1179.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2688x1242.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2732x2048.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2778x1284.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-dark-2796x1290.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-1136x640.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-1334x750.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-1792x828.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2048x1536.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2160x1620.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2208x1242.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2224x1668.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2388x1668.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2436x1125.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2532x1170.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2556x1179.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2688x1242.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2732x2048.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2778x1284.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-landscape-light-2796x1290.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-1125x2436.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-1170x2532.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-1179x2556.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-1242x2208.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-1242x2688.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-1284x2778.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-1290x2796.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-1536x2048.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-1620x2160.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-1668x2224.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-1668x2388.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-2048x2732.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-640x1136.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-750x1334.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-dark-828x1792.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-1125x2436.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-1170x2532.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-1179x2556.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-1242x2208.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-1242x2688.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-1284x2778.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-1290x2796.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-1536x2048.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-1620x2160.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-1668x2224.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-1668x2388.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-2048x2732.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-640x1136.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-750x1334.png +0 -0
- package/dist/interface/ha/pwa/apple-splash-portrait-light-828x1792.png +0 -0
- package/dist/interface/ha/pwa/apple-touch-icon-180x180.png +0 -0
- package/dist/interface/ha/pwa/favicon-16.ico +0 -0
- package/dist/interface/ha/pwa/favicon-32.ico +0 -0
- package/dist/interface/ha/pwa/favicon-48.ico +0 -0
- package/dist/interface/ha/pwa/favicon-64.ico +0 -0
- package/dist/interface/ha/pwa/logo.svg +1 -0
- package/dist/interface/ha/pwa/maskable-icon-1240x600.png +0 -0
- package/dist/interface/ha/pwa/maskable-icon-512x512.png +0 -0
- package/dist/interface/ha/pwa/maskable-icon-620x300.png +0 -0
- package/dist/interface/ha/pwa/pwa-1024x1024.png +0 -0
- package/dist/interface/ha/pwa/pwa-120x120.png +0 -0
- package/dist/interface/ha/pwa/pwa-144x144.png +0 -0
- package/dist/interface/ha/pwa/pwa-152x152.png +0 -0
- package/dist/interface/ha/pwa/pwa-167x167.png +0 -0
- package/dist/interface/ha/pwa/pwa-180x180.png +0 -0
- package/dist/interface/ha/pwa/pwa-192x192.png +0 -0
- package/dist/interface/ha/pwa/pwa-24x24.png +0 -0
- package/dist/interface/ha/pwa/pwa-300x300.png +0 -0
- package/dist/interface/ha/pwa/pwa-36x36.png +0 -0
- package/dist/interface/ha/pwa/pwa-48x48.png +0 -0
- package/dist/interface/ha/pwa/pwa-50x50.png +0 -0
- package/dist/interface/ha/pwa/pwa-64x64.png +0 -0
- package/dist/interface/ha/pwa/pwa-72x72.png +0 -0
- package/dist/interface/ha/pwa/pwa-88x88.png +0 -0
- package/dist/interface/ha/pwa/pwa-96x96.png +0 -0
- package/dist/interface/ha/radar-C7lI26j4.js +19 -0
- package/dist/interface/ha/refresh-BIhepekY.js +19 -0
- package/dist/interface/ha/ring-resize-VS4MSeBv.js +16 -0
- package/dist/interface/ha/ripple-BilzxWfY.js +2928 -0
- package/dist/interface/ha/robots.txt +2 -0
- package/dist/interface/ha/rolldown-runtime-CEFd7nDs.js +30 -0
- package/dist/interface/ha/rooms-B-FUXQ1p.js +45 -0
- package/dist/interface/ha/round-alt-arrow-left-bold-CWEg-ZLF.js +37 -0
- package/dist/interface/ha/runtime-core.esm-bundler-D8slQ3BU.js +3295 -0
- package/dist/interface/ha/search-CoOsbgeb.js +19 -0
- package/dist/interface/ha/select-DjWkRqsI.js +1382 -0
- package/dist/interface/ha/server-CKJKoFfg.js +239 -0
- package/dist/interface/ha/settings-EKkSQLzv.js +22 -0
- package/dist/interface/ha/source-branch-CZwSOrQA.js +19 -0
- package/dist/interface/ha/speeddial-Dv9txWte.js +682 -0
- package/dist/interface/ha/spinner-D6iUldg9.js +46 -0
- package/dist/interface/ha/synapse-CGrlyQDE.js +35 -0
- package/dist/interface/ha/tag-CXgC9OZ6.js +95 -0
- package/dist/interface/ha/textarea-DvLkfUX7.js +130 -0
- package/dist/interface/ha/tooltip-BIrD_hC8.js +277 -0
- package/dist/interface/ha/trash-2-C4zSCZfs.js +23 -0
- package/dist/interface/ha/trash-can-outline-DCqsCOd2.js +19 -0
- package/dist/interface/ha/trash-fill-BPsrwR8X.js +21 -0
- package/dist/interface/ha/types-C7MzwoQR.js +28 -0
- package/dist/interface/ha/types-J_J0HKlK.js +1032 -0
- package/dist/interface/ha/ungrouped-BpaM88Y-.js +1116 -0
- package/dist/interface/ha/updates-BdVmkKAa.js +341 -0
- package/dist/interface/ha/upload-2xJkVPZE.js +19 -0
- package/dist/interface/ha/upload-wQHBRZX_.js +23 -0
- package/dist/interface/ha/useAppVersion-DzDaOsKc.js +22 -0
- package/dist/interface/ha/useLogsSocket-CWUE-KXV.js +59 -0
- package/dist/interface/ha/useNavLayout-BqpyvD2F.js +125 -0
- package/dist/interface/ha/usePermissions-BIUeW4ef.js +72 -0
- package/dist/interface/ha/useServerRestart-0c4gA1fG.js +23 -0
- package/dist/interface/ha/useTabSwipe-C8LdKw23.js +45 -0
- package/dist/interface/ha/useUpdateChannel-CHVLthZB.js +22 -0
- package/dist/interface/ha/useUpdatesSocket-CaxEs511.js +34 -0
- package/dist/interface/ha/useUserOptions-Rk_71WAK.js +15 -0
- package/dist/interface/ha/utils-DYtBrGDz.js +7 -0
- package/dist/interface/ha/virtualscroller-s_gNqN5p.js +996 -0
- package/dist/interface/ha/vue-flow-background-B0Vu4-8M.js +6840 -0
- package/dist/interface/ha/vue-i18n-Dcb07o5U.js +2409 -0
- package/dist/interface/ha/web-0Kyq65na.js +78 -0
- package/dist/interface/ha/web-B7Dt2zZN.js +340 -0
- package/dist/interface/ha/web-BNdrPSpb.js +102 -0
- package/dist/interface/ha/web-BPBZBCtX.js +8 -0
- package/dist/interface/ha/web-BjKL51lK-qwJdIpM1.js +221 -0
- package/dist/interface/ha/web-C01i9qI1.js +57 -0
- package/dist/interface/ha/web-CH3JeXWa.js +211 -0
- package/dist/interface/ha/web-Cpm1-DVe.js +33 -0
- package/dist/interface/ha/web-DqRMXrnx.js +31 -0
- package/dist/interface/ha/web-DtVT7WYt.js +17 -0
- package/dist/interface/ha/web-DxJQZCiR.js +59 -0
- package/dist/interface/ha/web-I7Urp4AE.js +46 -0
- package/dist/interface/ha/web-aSaPk7kr.js +57 -0
- package/dist/interface/ha/web-pMey9p3Y.js +79 -0
- package/dist/interface/ha/xterm-B6xA6E5i.js +14833 -0
- package/dist/interface/ha/zoom-in-CNVB9H3D.js +41 -0
- package/dist/interface/index.html +29 -29
- package/dist/interface/sw.js +1 -1
- package/dist/server/package.json +9 -9
- package/dist/server/requirements.txt +3 -3
- package/dist/server/src/_camera_ui_tools/camera_ui_rpc/client.py +9 -6
- package/dist/server/src/_camera_ui_tools/camera_ui_rpc/types.py +2 -2
- package/dist/server/src/_camera_ui_tools/camera_ui_sdk/__init__.py +4 -2
- package/dist/server/src/_camera_ui_tools/camera_ui_sdk/camera/config.py +8 -0
- package/dist/server/src/_camera_ui_tools/camera_ui_sdk/camera/device.py +4 -3
- package/dist/server/src/_camera_ui_tools/camera_ui_sdk/internal/__init__.py +6 -0
- package/dist/server/src/_camera_ui_tools/camera_ui_sdk/internal/sensor_rpc.py +17 -6
- package/dist/server/src/_camera_ui_tools/camera_ui_sdk/manager/__init__.py +24 -70
- package/dist/server/src/_camera_ui_tools/camera_ui_sdk/plugin/interfaces.py +46 -19
- package/dist/server/src/_camera_ui_tools/camera_ui_sdk/sensor/__init__.py +2 -0
- package/dist/server/src/_camera_ui_tools/camera_ui_sdk/sensor/base.py +65 -8
- package/dist/server/src/api/database/index.d.ts +1 -1
- package/dist/server/src/api/database/index.js +4 -32
- package/dist/server/src/api/database/index.js.map +1 -1
- package/dist/server/src/api/database/migrations/v2-1-18.d.ts +3 -0
- package/dist/server/src/api/database/migrations/v2-1-18.js +24 -0
- package/dist/server/src/api/database/migrations/v2-1-18.js.map +1 -0
- package/dist/server/src/api/database/record-schemas.d.ts +1 -0
- package/dist/server/src/api/database/types.d.ts +4 -3
- package/dist/server/src/api/schemas/cameras.schema.d.ts +53 -15
- package/dist/server/src/api/schemas/cameras.schema.js +5 -1
- package/dist/server/src/api/schemas/cameras.schema.js.map +1 -1
- package/dist/server/src/api/schemas/users.schema.d.ts +7 -0
- package/dist/server/src/api/schemas/users.schema.js +1 -1
- package/dist/server/src/api/schemas/users.schema.js.map +1 -1
- package/dist/server/src/api/services/cameras.service.js +14 -21
- package/dist/server/src/api/services/cameras.service.js.map +1 -1
- package/dist/server/src/api/services/sensors.service.d.ts +3 -3
- package/dist/server/src/api/services/sensors.service.js +3 -24
- package/dist/server/src/api/services/sensors.service.js.map +1 -1
- package/dist/server/src/api/utils/regex.d.ts +2 -0
- package/dist/server/src/api/utils/regex.js +2 -0
- package/dist/server/src/api/utils/regex.js.map +1 -1
- package/dist/server/src/api/websocket/nsp/sensors.d.ts +3 -1
- package/dist/server/src/api/websocket/nsp/sensors.js +13 -3
- package/dist/server/src/api/websocket/nsp/sensors.js.map +1 -1
- package/dist/server/src/camera/decoder/debug/detection-record.d.ts +3 -1
- package/dist/server/src/camera/decoder/debug/detection-record.js +6 -2
- package/dist/server/src/camera/decoder/debug/detection-record.js.map +1 -1
- package/dist/server/src/camera/decoder/detection-coordinator.d.ts +2 -0
- package/dist/server/src/camera/decoder/detection-coordinator.js +44 -25
- package/dist/server/src/camera/decoder/detection-coordinator.js.map +1 -1
- package/dist/server/src/camera/decoder/detection-pipeline.d.ts +3 -1
- package/dist/server/src/camera/decoder/detection-pipeline.js +3 -22
- package/dist/server/src/camera/decoder/detection-pipeline.js.map +1 -1
- package/dist/server/src/camera/decoder/event-manager.d.ts +4 -3
- package/dist/server/src/camera/decoder/event-manager.js +17 -5
- package/dist/server/src/camera/decoder/event-manager.js.map +1 -1
- package/dist/server/src/camera/decoder/event-thumbnailer.d.ts +3 -0
- package/dist/server/src/camera/decoder/event-thumbnailer.js +13 -8
- package/dist/server/src/camera/decoder/event-thumbnailer.js.map +1 -1
- package/dist/server/src/camera/decoder/event-trace.d.ts +58 -0
- package/dist/server/src/camera/decoder/event-trace.js +118 -0
- package/dist/server/src/camera/decoder/event-trace.js.map +1 -0
- package/dist/server/src/camera/decoder/nvr-sink.d.ts +2 -0
- package/dist/server/src/camera/decoder/nvr-sink.js.map +1 -1
- package/dist/server/src/camera/decoder/reconnect-backoff.js +1 -1
- package/dist/server/src/camera/decoder/reconnect-backoff.js.map +1 -1
- package/dist/server/src/camera/decoder/sources/analysis-source.d.ts +1 -0
- package/dist/server/src/camera/decoder/sources/buffered-source.d.ts +7 -1
- package/dist/server/src/camera/decoder/sources/buffered-source.js +27 -15
- package/dist/server/src/camera/decoder/sources/buffered-source.js.map +1 -1
- package/dist/server/src/camera/decoder/sources/frame-handle.d.ts +2 -1
- package/dist/server/src/camera/decoder/sources/frame-handle.js +5 -3
- package/dist/server/src/camera/decoder/sources/frame-handle.js.map +1 -1
- package/dist/server/src/camera/decoder/sources/frame-source.d.ts +1 -0
- package/dist/server/src/camera/decoder/sources/frame-source.js +7 -2
- package/dist/server/src/camera/decoder/sources/frame-source.js.map +1 -1
- package/dist/server/src/camera/decoder/sources/rtp-index.d.ts +9 -0
- package/dist/server/src/camera/decoder/sources/rtp-index.js +24 -0
- package/dist/server/src/camera/decoder/sources/rtp-index.js.map +1 -0
- package/dist/server/src/camera/decoder/worker.js +1 -0
- package/dist/server/src/camera/decoder/worker.js.map +1 -1
- package/dist/server/src/go2rtc/types.d.ts +1 -1
- package/dist/server/src/go2rtc/types.js +1 -1
- package/dist/server/src/go2rtc/types.js.map +1 -1
- package/dist/server/src/plugins/runtime/node/child.js +1 -0
- package/dist/server/src/plugins/runtime/node/child.js.map +1 -1
- package/dist/server/src/plugins/runtime/node/proxy/cameraDevice.js +3 -0
- package/dist/server/src/plugins/runtime/node/proxy/cameraDevice.js.map +1 -1
- package/dist/server/src/plugins/runtime/node/proxy/sensorManager.d.ts +2 -5
- package/dist/server/src/plugins/runtime/node/proxy/sensorManager.js +95 -24
- package/dist/server/src/plugins/runtime/node/proxy/sensorManager.js.map +1 -1
- package/dist/server/src/plugins/runtime/python/child.py +1 -0
- package/dist/server/src/plugins/runtime/python/proxy/camera_device.py +9 -0
- package/dist/server/src/plugins/runtime/python/proxy/sensor.py +2 -1
- package/dist/server/src/plugins/runtime/python/proxy/sensor_manager.py +185 -88
- package/dist/server/src/plugins/runtime/python/typings.py +18 -0
- package/dist/server/src/rpc/interfaces/sensor.d.ts +19 -4
- package/dist/server/src/sensors/discovery.d.ts +1 -1
- package/dist/server/src/sensors/discovery.js +10 -19
- package/dist/server/src/sensors/discovery.js.map +1 -1
- package/dist/server/src/sensors/registry.d.ts +6 -2
- package/dist/server/src/sensors/registry.js +75 -6
- package/dist/server/src/sensors/registry.js.map +1 -1
- package/dist/server/src/utils/camera.d.ts +12 -2
- package/dist/server/src/utils/camera.js +27 -1
- package/dist/server/src/utils/camera.js.map +1 -1
- package/dist/server/src/workers/pairing.js +17 -8
- package/dist/server/src/workers/pairing.js.map +1 -1
- package/package.json +9 -9
- package/dist/interface/assets/Automation-4HPAjq1i.js +0 -3
- package/dist/interface/assets/AutomationStoreDetail-C2ntfGP-.js +0 -2
- package/dist/interface/assets/Automations-CUUq9dxs.js +0 -2
- package/dist/interface/assets/Camera-DmrRrgqQ.js +0 -2
- package/dist/interface/assets/Cameras-B-aQUuPk.js +0 -652
- package/dist/interface/assets/Camview-B-W5jpCR.js +0 -1
- package/dist/interface/assets/ConfigActionNotification-Bq28CjsJ.js +0 -1
- package/dist/interface/assets/ConfigConditionSwitch-DYAlj5no.js +0 -1
- package/dist/interface/assets/ConfigTriggerGeofence-ClKyzb-x.js +0 -1
- package/dist/interface/assets/Console-ctbGFtCH.js +0 -1
- package/dist/interface/assets/CuiBottomSheet-Bo1wUyiN.js +0 -1
- package/dist/interface/assets/CuiCameraPipCard-BEAE44of.js +0 -1
- package/dist/interface/assets/CuiCameraRecordings-BzbwSK8-.css +0 -1
- package/dist/interface/assets/CuiCameraRecordings-C1evIMhc.js +0 -1
- package/dist/interface/assets/CuiCameraTable-BAjQ8h5H.js +0 -1
- package/dist/interface/assets/CuiLightControl-9OhT9YYt.js +0 -1
- package/dist/interface/assets/CuiPluginCard-DQgVasi7.js +0 -2
- package/dist/interface/assets/CuiSchema-juKEra_J.js +0 -1
- package/dist/interface/assets/Faces-Ce3mKYc7.js +0 -1
- package/dist/interface/assets/FirstSteps-BBLzX2bl.js +0 -1
- package/dist/interface/assets/Floorplan-B7BVj65t.js +0 -1
- package/dist/interface/assets/Instances-4VxGT2fm.js +0 -1
- package/dist/interface/assets/Metrics-DudHV8Ov.js +0 -9
- package/dist/interface/assets/OAuthDeviceFlow-Z3Cesvs9.js +0 -1
- package/dist/interface/assets/Plugin-DwadariU.js +0 -1
- package/dist/interface/assets/PluginDetail-C_XghvQz.js +0 -2
- package/dist/interface/assets/PluginSearch-11dsxfvW.js +0 -1
- package/dist/interface/assets/PluginSearch-DgQOryM2.js +0 -2
- package/dist/interface/assets/Plugins-QheVcYZB.js +0 -1
- package/dist/interface/assets/Recordings-DwPnYsd6.js +0 -1
- package/dist/interface/assets/SensorEdit-C9Ejdxaz.js +0 -1
- package/dist/interface/assets/Sensors-D4tY50d4.js +0 -2
- package/dist/interface/assets/SettingsAccount-DMvvar8D.js +0 -1
- package/dist/interface/assets/SettingsAccount-DYCCnjWY.js +0 -1
- package/dist/interface/assets/SettingsAppearance-vLBhLEag.js +0 -1
- package/dist/interface/assets/SettingsMqtt-Cj9ywnP2.js +0 -1
- package/dist/interface/assets/SettingsNotifications-flx3W4Uo.js +0 -1
- package/dist/interface/assets/SettingsRecordings-D3b6y2SX.js +0 -1
- package/dist/interface/assets/SettingsRemote-o01wgKPR.js +0 -2
- package/dist/interface/assets/Workers-CdaYj6Ap.js +0 -2
- package/dist/interface/assets/alert-outline-KxFvd3i6.js +0 -1
- package/dist/interface/assets/api-2VPaKkqc.js +0 -2
- package/dist/interface/assets/api-CEbDxsSY.css +0 -2
- package/dist/interface/assets/cameras.schema-CnSdfqqj.js +0 -1
- package/dist/interface/assets/cloudHandoff-B1z5dyPD.js +0 -1
- package/dist/interface/assets/main-BfL5CDS8.js +0 -3
- package/dist/interface/assets/nodeDefinitions-D6zhuw60.js +0 -1
- package/dist/interface/assets/sensorIcons-FPxm3pDg.js +0 -1
- package/dist/interface/assets/theme-CRQoJiuY.js +0 -1
- package/dist/interface/assets/types-BHgaZSm2.js +0 -1
- package/dist/interface/assets/types-CQpPteyx.js +0 -1
- package/dist/interface/assets/ungrouped-BbOtmmDD.js +0 -1
- package/dist/interface/assets/useBackupRestore-CT1PYJDW.js +0 -1
- package/dist/interface/assets/vendor-cameraui-ZyqPntQ7.js +0 -2326
- package/dist/interface/assets/vendor-core-DN-bpg68.js +0 -1
- package/dist/interface/assets/vendor-zod-B0ZFM2Pr.js +0 -127
|
@@ -0,0 +1,3457 @@
|
|
|
1
|
+
import { D as e, I as t, Ot as n, _t as r, bt as i, ft as a, l as o, ot as s, wt as c, xt as l, yt as u } from "./runtime-core.esm-bundler-D8slQ3BU.js";
|
|
2
|
+
import { M as d, R as f, W as p, t as m } from "./protocol-BB4jdtUC-K1r3LFCq.js";
|
|
3
|
+
//#region node_modules/@camera.ui/sdk/dist/plugin/api.js
|
|
4
|
+
var h;
|
|
5
|
+
(function(e) {
|
|
6
|
+
e.FINISH_LAUNCHING = "finishLaunching", e.SHUTDOWN = "shutdown";
|
|
7
|
+
})(h ||= {});
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region node_modules/@camera.ui/sdk/dist/plugin/contract.js
|
|
10
|
+
var g;
|
|
11
|
+
(function(e) {
|
|
12
|
+
e.Hub = "hub", e.SensorProvider = "sensorProvider", e.CameraController = "cameraController", e.CameraAndSensorProvider = "cameraAndSensorProvider";
|
|
13
|
+
})(g ||= {});
|
|
14
|
+
var _;
|
|
15
|
+
(function(e) {
|
|
16
|
+
e.MotionDetection = "MotionDetection", e.ObjectDetection = "ObjectDetection", e.AudioDetection = "AudioDetection", e.FaceDetection = "FaceDetection", e.LicensePlateDetection = "LicensePlateDetection", e.ClassifierDetection = "ClassifierDetection", e.ClipDetection = "ClipDetection", e.DiscoveryProvider = "DiscoveryProvider", e.SensorDiscovery = "SensorDiscovery", e.NVR = "NVR", e.Notifier = "Notifier", e.OAuthCapable = "OAuthCapable", e.OAuthDeviceFlow = "OAuthDeviceFlow", e.OAuthAuthCodeFlow = "OAuthAuthCodeFlow", e.OAuthClientCredentials = "OAuthClientCredentials";
|
|
17
|
+
})(_ ||= {});
|
|
18
|
+
var v;
|
|
19
|
+
(function(e) {
|
|
20
|
+
e.PublishNotifications = "publishNotifications";
|
|
21
|
+
})(v ||= {});
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/base.js
|
|
24
|
+
var y;
|
|
25
|
+
(function(e) {
|
|
26
|
+
e.Motion = "motion", e.Object = "object", e.Audio = "audio", e.Face = "face", e.LicensePlate = "licensePlate", e.Classifier = "classifier", e.Clip = "clip", e.ObjectAssist = "objectAssist", e.Contact = "contact", e.Temperature = "temperature", e.Humidity = "humidity", e.Occupancy = "occupancy", e.Smoke = "smoke", e.Leak = "leak", e.Gas = "gas", e.CarbonMonoxide = "carbonMonoxide", e.Heat = "heat", e.Cold = "cold", e.Vibration = "vibration", e.Tamper = "tamper", e.Problem = "problem", e.Power = "power", e.Illuminance = "illuminance", e.CarbonDioxide = "carbonDioxide", e.Light = "light", e.Siren = "siren", e.Switch = "switch", e.Lock = "lock", e.PTZ = "ptz", e.SecuritySystem = "securitySystem", e.Garage = "garage", e.Doorbell = "doorbell", e.Battery = "battery";
|
|
27
|
+
})(y ||= {});
|
|
28
|
+
var b;
|
|
29
|
+
(function(e) {
|
|
30
|
+
e.Sensor = "sensor", e.Control = "control", e.Trigger = "trigger", e.Info = "info";
|
|
31
|
+
})(b ||= {});
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region node_modules/@camera.ui/sdk/dist/plugin/helper.js
|
|
34
|
+
function x(e, t) {
|
|
35
|
+
return e.interfaces.includes(t);
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region node_modules/@camera.ui/sdk/dist/plugin/notifier.js
|
|
39
|
+
var S;
|
|
40
|
+
(function(e) {
|
|
41
|
+
e.Info = "info", e.Warn = "warn", e.Error = "error", e.Critical = "critical";
|
|
42
|
+
})(S ||= {});
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/meta.js
|
|
45
|
+
var C;
|
|
46
|
+
(function(e) {
|
|
47
|
+
e.Binary = "binary", e.Measurement = "measurement", e.Switch = "switch", e.Light = "light", e.Siren = "siren", e.Lock = "lock", e.Cover = "cover", e.Alarm = "alarm";
|
|
48
|
+
})(C ||= {});
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/audio.js
|
|
51
|
+
var ee = [
|
|
52
|
+
"doorbell",
|
|
53
|
+
"glass_break",
|
|
54
|
+
"siren",
|
|
55
|
+
"speaking",
|
|
56
|
+
"gunshot",
|
|
57
|
+
"dog_bark",
|
|
58
|
+
"baby_cry",
|
|
59
|
+
"alarm",
|
|
60
|
+
"scream",
|
|
61
|
+
"cat",
|
|
62
|
+
"car_alarm",
|
|
63
|
+
"smoke_alarm"
|
|
64
|
+
], w;
|
|
65
|
+
(function(e) {
|
|
66
|
+
e.Detected = "detected", e.Detections = "detections", e.Decibels = "decibels", e.LastTriggered = "lastTriggered";
|
|
67
|
+
})(w ||= {}), y.Audio, b.Sensor, w.Detected, w.Detections, w.Decibels, w.LastTriggered;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/battery.js
|
|
70
|
+
var te;
|
|
71
|
+
(function(e) {
|
|
72
|
+
e.LowBattery = "lowBattery", e.Charging = "charging";
|
|
73
|
+
})(te ||= {});
|
|
74
|
+
var T;
|
|
75
|
+
(function(e) {
|
|
76
|
+
e.Level = "level", e.Charging = "charging", e.Low = "low";
|
|
77
|
+
})(T ||= {});
|
|
78
|
+
var E;
|
|
79
|
+
(function(e) {
|
|
80
|
+
e.NotChargeable = "NOT_CHARGEABLE", e.NotCharging = "NOT_CHARGING", e.Charging = "CHARGING", e.Full = "FULL";
|
|
81
|
+
})(E ||= {}), y.Battery, b.Info, T.Level, T.Charging, E.NotChargeable, E.NotCharging, E.Charging, E.Full, T.Low, T.Charging, te.Charging, T.Low, te.LowBattery, C.Measurement, T.Level, T.Level;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/carbonDioxide.js
|
|
84
|
+
var D;
|
|
85
|
+
(function(e) {
|
|
86
|
+
e.Current = "current";
|
|
87
|
+
})(D ||= {}), y.CarbonDioxide, b.Info, D.Current, D.Current, C.Measurement, D.Current, D.Current;
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/carbonMonoxide.js
|
|
90
|
+
var O;
|
|
91
|
+
(function(e) {
|
|
92
|
+
e.Detected = "detected";
|
|
93
|
+
})(O ||= {}), y.CarbonMonoxide, b.Sensor, O.Detected, O.Detected, O.Detected, C.Binary, O.Detected, O.Detected;
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/classifier.js
|
|
96
|
+
var k;
|
|
97
|
+
(function(e) {
|
|
98
|
+
e.Detected = "detected", e.Detections = "detections", e.Labels = "labels";
|
|
99
|
+
})(k ||= {}), y.Classifier, b.Sensor, k.Detected, k.Detections, k.Labels, y.Clip, b.Sensor;
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/cold.js
|
|
102
|
+
var A;
|
|
103
|
+
(function(e) {
|
|
104
|
+
e.Detected = "detected";
|
|
105
|
+
})(A ||= {}), y.Cold, b.Sensor, A.Detected, A.Detected, A.Detected, C.Binary, A.Detected, A.Detected;
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/contact.js
|
|
108
|
+
var j;
|
|
109
|
+
(function(e) {
|
|
110
|
+
e.Detected = "detected";
|
|
111
|
+
})(j ||= {}), y.Contact, b.Sensor, j.Detected, j.Detected, j.Detected, C.Binary, j.Detected, j.Detected;
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/detection.js
|
|
114
|
+
var ne = [
|
|
115
|
+
"person",
|
|
116
|
+
"vehicle",
|
|
117
|
+
"animal"
|
|
118
|
+
], re = [
|
|
119
|
+
"motion",
|
|
120
|
+
...ne,
|
|
121
|
+
"audio"
|
|
122
|
+
], ie = ["face", "license_plate"], M;
|
|
123
|
+
(function(e) {
|
|
124
|
+
e.Ring = "ring";
|
|
125
|
+
})(M ||= {}), y.Doorbell, b.Trigger, M.Ring, M.Ring, M.Ring, C.Binary, M.Ring, M.Ring;
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/face.js
|
|
128
|
+
var N;
|
|
129
|
+
(function(e) {
|
|
130
|
+
e.Detected = "detected", e.Detections = "detections", e.Identities = "identities";
|
|
131
|
+
})(N ||= {}), y.Face, b.Sensor, N.Detected, N.Detections, N.Identities;
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/garage.js
|
|
134
|
+
var P;
|
|
135
|
+
(function(e) {
|
|
136
|
+
e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e[e.Opening = 2] = "Opening", e[e.Closing = 3] = "Closing", e[e.Stopped = 4] = "Stopped";
|
|
137
|
+
})(P ||= {});
|
|
138
|
+
var F;
|
|
139
|
+
(function(e) {
|
|
140
|
+
e.CurrentState = "currentState", e.TargetState = "targetState", e.ObstructionDetected = "obstructionDetected";
|
|
141
|
+
})(F ||= {}), y.Garage, b.Control, F.CurrentState, P.Open, P.Closed, P.Opening, P.Closing, P.Stopped, F.TargetState, P.Open, P.Closed, F.ObstructionDetected, F.CurrentState, F.CurrentState, F.TargetState, C.Cover, F.CurrentState, F.TargetState, P.Open, P.Closed, P.Opening, P.Closing, P.Stopped;
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/gas.js
|
|
144
|
+
var ae;
|
|
145
|
+
(function(e) {
|
|
146
|
+
e.Detected = "detected";
|
|
147
|
+
})(ae ||= {}), y.Gas, b.Sensor, ae.Detected, ae.Detected, ae.Detected, C.Binary, ae.Detected, ae.Detected;
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/heat.js
|
|
150
|
+
var oe;
|
|
151
|
+
(function(e) {
|
|
152
|
+
e.Detected = "detected";
|
|
153
|
+
})(oe ||= {}), y.Heat, b.Sensor, oe.Detected, oe.Detected, oe.Detected, C.Binary, oe.Detected, oe.Detected;
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/humidity.js
|
|
156
|
+
var se;
|
|
157
|
+
(function(e) {
|
|
158
|
+
e.Current = "current";
|
|
159
|
+
})(se ||= {}), y.Humidity, b.Info, se.Current, se.Current, C.Measurement, se.Current, se.Current;
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/illuminance.js
|
|
162
|
+
var I;
|
|
163
|
+
(function(e) {
|
|
164
|
+
e.Current = "current";
|
|
165
|
+
})(I ||= {}), y.Illuminance, b.Info, I.Current, I.Current, C.Measurement, I.Current, I.Current;
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/leak.js
|
|
168
|
+
var L;
|
|
169
|
+
(function(e) {
|
|
170
|
+
e.Detected = "detected";
|
|
171
|
+
})(L ||= {}), y.Leak, b.Sensor, L.Detected, L.Detected, L.Detected, C.Binary, L.Detected, L.Detected;
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/licensePlate.js
|
|
174
|
+
var ce;
|
|
175
|
+
(function(e) {
|
|
176
|
+
e.Detected = "detected", e.Detections = "detections", e.Plates = "plates";
|
|
177
|
+
})(ce ||= {}), y.LicensePlate, b.Sensor, ce.Detected, ce.Detections, ce.Plates;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/light.js
|
|
180
|
+
var le;
|
|
181
|
+
(function(e) {
|
|
182
|
+
e.Brightness = "brightness";
|
|
183
|
+
})(le ||= {});
|
|
184
|
+
var R;
|
|
185
|
+
(function(e) {
|
|
186
|
+
e.On = "on", e.Brightness = "brightness";
|
|
187
|
+
})(R ||= {}), y.Light, b.Control, R.On, R.Brightness, R.On, R.Brightness, le.Brightness, R.On, R.Brightness, le.Brightness, C.Light, R.On, R.On;
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/lock.js
|
|
190
|
+
var ue;
|
|
191
|
+
(function(e) {
|
|
192
|
+
e[e.Secured = 0] = "Secured", e[e.Unsecured = 1] = "Unsecured", e[e.Unknown = 2] = "Unknown";
|
|
193
|
+
})(ue ||= {});
|
|
194
|
+
var z;
|
|
195
|
+
(function(e) {
|
|
196
|
+
e.CurrentState = "currentState", e.TargetState = "targetState";
|
|
197
|
+
})(z ||= {}), y.Lock, b.Control, z.CurrentState, ue.Secured, ue.Unsecured, ue.Unknown, z.TargetState, ue.Secured, ue.Unsecured, z.CurrentState, z.CurrentState, z.TargetState, C.Lock, z.CurrentState, z.TargetState, ue.Secured, ue.Unsecured;
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/motion.js
|
|
200
|
+
var de;
|
|
201
|
+
(function(e) {
|
|
202
|
+
e.Detected = "detected", e.Detections = "detections", e.Blocked = "blocked", e.LastTriggered = "lastTriggered";
|
|
203
|
+
})(de ||= {}), y.Motion, b.Sensor, de.Detected, de.Detections, de.Blocked, de.LastTriggered;
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/object.js
|
|
206
|
+
var fe;
|
|
207
|
+
(function(e) {
|
|
208
|
+
e.Detected = "detected", e.Detections = "detections", e.Labels = "labels", e.StaticDetections = "staticDetections";
|
|
209
|
+
})(fe ||= {}), y.Object, b.Sensor, fe.Detected, fe.Detections, fe.Labels, fe.StaticDetections, y.ObjectAssist, b.Sensor;
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/occupancy.js
|
|
212
|
+
var pe;
|
|
213
|
+
(function(e) {
|
|
214
|
+
e.Detected = "detected";
|
|
215
|
+
})(pe ||= {}), y.Occupancy, b.Sensor, pe.Detected, pe.Detected, pe.Detected, C.Binary, pe.Detected, pe.Detected;
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/power.js
|
|
218
|
+
var me;
|
|
219
|
+
(function(e) {
|
|
220
|
+
e.Detected = "detected";
|
|
221
|
+
})(me ||= {}), y.Power, b.Sensor, me.Detected, me.Detected, me.Detected, C.Binary, me.Detected, me.Detected;
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/problem.js
|
|
224
|
+
var he;
|
|
225
|
+
(function(e) {
|
|
226
|
+
e.Detected = "detected";
|
|
227
|
+
})(he ||= {}), y.Problem, b.Sensor, he.Detected, he.Detected, he.Detected, C.Binary, he.Detected, he.Detected;
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/ptz.js
|
|
230
|
+
var ge;
|
|
231
|
+
(function(e) {
|
|
232
|
+
e.Pan = "pan", e.Tilt = "tilt", e.Zoom = "zoom", e.Presets = "presets", e.Home = "home", e.RelativeMove = "relativeMove", e.AbsolutePosition = "absolutePosition", e.VelocityControl = "velocityControl";
|
|
233
|
+
})(ge ||= {});
|
|
234
|
+
var B;
|
|
235
|
+
(function(e) {
|
|
236
|
+
e.Position = "position", e.Moving = "moving", e.Presets = "presets", e.Velocity = "velocity", e.TargetPreset = "targetPreset", e.RelativeMove = "relativeMove", e.Home = "home";
|
|
237
|
+
})(B ||= {}), y.PTZ, b.Control, B.Position, B.Moving, B.Presets, B.Velocity, B.TargetPreset, B.RelativeMove, B.Home;
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/securitySystem.js
|
|
240
|
+
var V;
|
|
241
|
+
(function(e) {
|
|
242
|
+
e[e.StayArm = 0] = "StayArm", e[e.AwayArm = 1] = "AwayArm", e[e.NightArm = 2] = "NightArm", e[e.Disarmed = 3] = "Disarmed", e[e.AlarmTriggered = 4] = "AlarmTriggered";
|
|
243
|
+
})(V ||= {});
|
|
244
|
+
var H;
|
|
245
|
+
(function(e) {
|
|
246
|
+
e.CurrentState = "currentState", e.TargetState = "targetState";
|
|
247
|
+
})(H ||= {}), y.SecuritySystem, b.Control, H.CurrentState, V.StayArm, V.AwayArm, V.NightArm, V.Disarmed, V.AlarmTriggered, H.TargetState, V.StayArm, V.AwayArm, V.NightArm, V.Disarmed, H.CurrentState, H.CurrentState, H.TargetState, C.Alarm, H.CurrentState, H.TargetState, V.StayArm, V.AwayArm, V.NightArm, V.Disarmed, V.AlarmTriggered;
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/siren.js
|
|
250
|
+
var _e;
|
|
251
|
+
(function(e) {
|
|
252
|
+
e.Volume = "volume";
|
|
253
|
+
})(_e ||= {});
|
|
254
|
+
var U;
|
|
255
|
+
(function(e) {
|
|
256
|
+
e.Active = "active", e.Volume = "volume";
|
|
257
|
+
})(U ||= {}), y.Siren, b.Control, U.Active, U.Volume, U.Active, U.Volume, _e.Volume, U.Active, U.Volume, _e.Volume, C.Siren, U.Active, U.Active;
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/smoke.js
|
|
260
|
+
var W;
|
|
261
|
+
(function(e) {
|
|
262
|
+
e.Detected = "detected";
|
|
263
|
+
})(W ||= {}), y.Smoke, b.Sensor, W.Detected, W.Detected, W.Detected, C.Binary, W.Detected, W.Detected;
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/switch.js
|
|
266
|
+
var ve;
|
|
267
|
+
(function(e) {
|
|
268
|
+
e.On = "on";
|
|
269
|
+
})(ve ||= {}), y.Switch, b.Control, ve.On, ve.On, ve.On, C.Switch, ve.On, ve.On;
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/tamper.js
|
|
272
|
+
var ye;
|
|
273
|
+
(function(e) {
|
|
274
|
+
e.Detected = "detected";
|
|
275
|
+
})(ye ||= {}), y.Tamper, b.Sensor, ye.Detected, ye.Detected, ye.Detected, C.Binary, ye.Detected, ye.Detected;
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/temperature.js
|
|
278
|
+
var be;
|
|
279
|
+
(function(e) {
|
|
280
|
+
e.Current = "current";
|
|
281
|
+
})(be ||= {}), y.Temperature, b.Info, be.Current, be.Current, C.Measurement, be.Current, be.Current;
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region node_modules/@camera.ui/sdk/dist/sensor/vibration.js
|
|
284
|
+
var xe;
|
|
285
|
+
(function(e) {
|
|
286
|
+
e.Detected = "detected";
|
|
287
|
+
})(xe ||= {}), y.Vibration, b.Sensor, xe.Detected, xe.Detected, xe.Detected, C.Binary, xe.Detected, xe.Detected;
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region node_modules/@camera.ui/browser/dist/index.js
|
|
290
|
+
function Se(e = {}) {
|
|
291
|
+
let { releaseDelay: t = 1e3, onRelease: n } = e, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
292
|
+
function a(e) {
|
|
293
|
+
let t = i.get(e);
|
|
294
|
+
t && (clearTimeout(t), i.delete(e));
|
|
295
|
+
}
|
|
296
|
+
function o(e) {
|
|
297
|
+
let t = r.get(e);
|
|
298
|
+
if (t) {
|
|
299
|
+
try {
|
|
300
|
+
n?.(e, t.value);
|
|
301
|
+
} catch {}
|
|
302
|
+
r.delete(e);
|
|
303
|
+
}
|
|
304
|
+
i.delete(e);
|
|
305
|
+
}
|
|
306
|
+
function s(e, t) {
|
|
307
|
+
a(e);
|
|
308
|
+
let n = r.get(e);
|
|
309
|
+
if (n) return n.refCount++, n.value;
|
|
310
|
+
let i = t();
|
|
311
|
+
return r.set(e, {
|
|
312
|
+
value: i,
|
|
313
|
+
refCount: 1
|
|
314
|
+
}), i;
|
|
315
|
+
}
|
|
316
|
+
function c(e) {
|
|
317
|
+
let n = r.get(e);
|
|
318
|
+
if (n && (n.refCount--, n.refCount <= 0)) {
|
|
319
|
+
let n = setTimeout(() => {
|
|
320
|
+
let t = r.get(e);
|
|
321
|
+
t && t.refCount <= 0 ? o(e) : i.delete(e);
|
|
322
|
+
}, t);
|
|
323
|
+
i.set(e, n);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
function l(e) {
|
|
327
|
+
return r.get(e)?.value;
|
|
328
|
+
}
|
|
329
|
+
function u(e) {
|
|
330
|
+
return r.has(e);
|
|
331
|
+
}
|
|
332
|
+
function d(e) {
|
|
333
|
+
a(e), o(e);
|
|
334
|
+
}
|
|
335
|
+
function f() {
|
|
336
|
+
for (let e of i.keys()) a(e);
|
|
337
|
+
for (let e of r.keys()) o(e);
|
|
338
|
+
}
|
|
339
|
+
function p(e) {
|
|
340
|
+
return r.get(e)?.refCount ?? 0;
|
|
341
|
+
}
|
|
342
|
+
function m(e) {
|
|
343
|
+
for (let [t, n] of r) e(n.value, t);
|
|
344
|
+
}
|
|
345
|
+
return {
|
|
346
|
+
acquire: s,
|
|
347
|
+
release: c,
|
|
348
|
+
get: l,
|
|
349
|
+
has: u,
|
|
350
|
+
forceRelease: d,
|
|
351
|
+
clear: f,
|
|
352
|
+
getRefCount: p,
|
|
353
|
+
forEachValue: m
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
function G() {
|
|
357
|
+
let t = e(bn);
|
|
358
|
+
if (!t) throw Error("[camera.ui] useCameraUi() called without CameraUiPlugin installed. Make sure to call app.use(createCameraUiPlugin({ ... })) before using this composable.");
|
|
359
|
+
return t;
|
|
360
|
+
}
|
|
361
|
+
function Ce(e) {
|
|
362
|
+
return e.replace(/ /g, "_").toLowerCase();
|
|
363
|
+
}
|
|
364
|
+
function we(e, t) {
|
|
365
|
+
return `cui_${Ce(e)}_${Ce(t)}`;
|
|
366
|
+
}
|
|
367
|
+
var K = class {
|
|
368
|
+
static coreManagerNamespaces() {
|
|
369
|
+
return {
|
|
370
|
+
coreManagerSubject: "coreManager.subscriber",
|
|
371
|
+
coreManagerRpc: "coreManager.rpc"
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
static deviceManagerNamespaces() {
|
|
375
|
+
return {
|
|
376
|
+
deviceManagerSubject: "deviceManager.subscriber",
|
|
377
|
+
deviceManagerRpc: "deviceManager.rpc"
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
static sensorDiscoveryNamespaces() {
|
|
381
|
+
return { sensorDiscoverySubject: "sensorDiscovery.subscriber" };
|
|
382
|
+
}
|
|
383
|
+
static discoveryManagerNamespaces() {
|
|
384
|
+
return {
|
|
385
|
+
discoveryManagerSubject: "discoveryManager.subscriber",
|
|
386
|
+
discoveryManagerRpc: "discoveryManager.rpc"
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
static pluginNamespaces(e) {
|
|
390
|
+
return {
|
|
391
|
+
pluginDeviceManagerSubject: `plugin.${e}.deviceManager.subscriber`,
|
|
392
|
+
pluginChildRpc: `plugin.${e}.child.rpc`,
|
|
393
|
+
pluginChild: `plugin.${e}.child`,
|
|
394
|
+
pluginStorageRpc: `plugin.${e}.storage.rpc`,
|
|
395
|
+
pluginConfigStoreRpc: `plugin.${e}.configstore.rpc`
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
static pluginFileServeRpc(e) {
|
|
399
|
+
return `plugin.${e}.fileserve.rpc`;
|
|
400
|
+
}
|
|
401
|
+
static cameraNamespaces(e) {
|
|
402
|
+
return {
|
|
403
|
+
cameraSubject: `camera.${e}.subscriber`,
|
|
404
|
+
cameraControllerRpc: `camera.${e}.controller.rpc`
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
static frameWorkerNamespaces(e) {
|
|
408
|
+
return {
|
|
409
|
+
frameWorkerChildRpc: `camera.${e}.frameWorker.child.rpc`,
|
|
410
|
+
frameWorkerChild: `camera.${e}.frameWorker.child`
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
static pluginCameraNamespaces(e, t) {
|
|
414
|
+
return {
|
|
415
|
+
cameraInterfacesRpc: `plugin.${e}.camera.${t}.cameraInterfaces.rpc`,
|
|
416
|
+
cameraStorageRpc: `plugin.${e}.camera.${t}.cameraStorage.rpc`,
|
|
417
|
+
cameraImplRpc: `plugin.${e}.camera.${t}.impl.rpc`
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
static pluginSensorNamespaces(e, t) {
|
|
421
|
+
return { sensorStorageRpc: `plugin.${e}.sensor.${t}.storage.rpc` };
|
|
422
|
+
}
|
|
423
|
+
static sensorRegistryNamespaces() {
|
|
424
|
+
return {
|
|
425
|
+
sensorsSubject: "sensors.subject",
|
|
426
|
+
sensorsRpc: "sensors.rpc"
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
static sensorCameraViewNamespaces(e) {
|
|
430
|
+
return { sensorWriteSubject: `camera.${e}.sensors.writes` };
|
|
431
|
+
}
|
|
432
|
+
static sensorEventNamespaces(e) {
|
|
433
|
+
return { sensorSubject: `sensor.${e}.subject` };
|
|
434
|
+
}
|
|
435
|
+
static sensorProviderNamespaces(e, t) {
|
|
436
|
+
return { sensorRpc: `plugin.${e}.sensor.${t}.rpc` };
|
|
437
|
+
}
|
|
438
|
+
static frameWorkerDetectionNamespaces(e) {
|
|
439
|
+
return { detectionRpc: `camera.${e}.frameWorker.detection.rpc` };
|
|
440
|
+
}
|
|
441
|
+
static detectionEventNamespaces(e) {
|
|
442
|
+
return { detectionEventSubject: `camera.${e}.events.subject` };
|
|
443
|
+
}
|
|
444
|
+
static terminalManagerNamespaces() {
|
|
445
|
+
return {
|
|
446
|
+
terminalManagerSubject: "terminalManager.subscriber",
|
|
447
|
+
terminalManagerRpc: "terminalManager.rpc"
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
static downloadManagerNamespaces() {
|
|
451
|
+
return { downloadManagerRpc: "downloadManager.rpc" };
|
|
452
|
+
}
|
|
453
|
+
static notificationManagerNamespaces() {
|
|
454
|
+
return { notificationsPublishSubject: "notifications.publish" };
|
|
455
|
+
}
|
|
456
|
+
static workerAgentRpc(e) {
|
|
457
|
+
return `worker.${e}.rpc`;
|
|
458
|
+
}
|
|
459
|
+
static workerManagerRpc() {
|
|
460
|
+
return "workers.manager.rpc";
|
|
461
|
+
}
|
|
462
|
+
static workerSync(e) {
|
|
463
|
+
return `worker.${e}.sync`;
|
|
464
|
+
}
|
|
465
|
+
static workerDisconnect() {
|
|
466
|
+
return "workers.disconnect";
|
|
467
|
+
}
|
|
468
|
+
static workerLogs() {
|
|
469
|
+
return "workers.logs";
|
|
470
|
+
}
|
|
471
|
+
}, Te = 3, Ee = 3e4;
|
|
472
|
+
async function q(e, t, n = {}) {
|
|
473
|
+
let r = n.maxRetries ?? Te, i = n.awaitConnect ?? !0, a = n.connectTimeoutMs ?? Ee, o = n.retryDelayMs ?? De, s = n.shouldRetry ?? Oe, c = n.signal, l;
|
|
474
|
+
for (let n = 0; n <= r; n++) {
|
|
475
|
+
if (c?.aborted) throw je();
|
|
476
|
+
let u = e.value;
|
|
477
|
+
if (!u) {
|
|
478
|
+
if (!i) throw Error("rpc: not connected");
|
|
479
|
+
u = await ke(e, a, c);
|
|
480
|
+
}
|
|
481
|
+
try {
|
|
482
|
+
return await t(u);
|
|
483
|
+
} catch (e) {
|
|
484
|
+
if (l = e, n >= r || !s(e, n)) throw e;
|
|
485
|
+
await Ae(o(n), c);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
throw l ?? /* @__PURE__ */ Error("rpc: max retries exceeded");
|
|
489
|
+
}
|
|
490
|
+
function De(e) {
|
|
491
|
+
return Math.min(100 * 2 ** e, 1e3);
|
|
492
|
+
}
|
|
493
|
+
function Oe(e) {
|
|
494
|
+
if (!(e instanceof Error)) return !1;
|
|
495
|
+
let t = e.code;
|
|
496
|
+
if (t === "TIMEOUT" || t === "CONNECTION_CLOSED") return !0;
|
|
497
|
+
let n = e.message.toLowerCase();
|
|
498
|
+
return !!(n.includes("not connected") || n.includes("connection closed") || n.includes("no responders") || n.includes("connection refused") || n.includes("socket") || n.includes("timed out") || n.includes("timeout"));
|
|
499
|
+
}
|
|
500
|
+
async function ke(e, t, n) {
|
|
501
|
+
return e.value ? e.value : new Promise((r, i) => {
|
|
502
|
+
let a = setTimeout(() => {
|
|
503
|
+
c(), n?.removeEventListener("abort", o), i(/* @__PURE__ */ Error("rpc: connect timeout"));
|
|
504
|
+
}, t), o = () => {
|
|
505
|
+
clearTimeout(a), c(), i(je());
|
|
506
|
+
};
|
|
507
|
+
n?.addEventListener("abort", o, { once: !0 });
|
|
508
|
+
let c = s(e, (e) => {
|
|
509
|
+
e && (clearTimeout(a), c(), n?.removeEventListener("abort", o), r(e));
|
|
510
|
+
});
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
async function Ae(e, t) {
|
|
514
|
+
return new Promise((n, r) => {
|
|
515
|
+
if (t?.aborted) {
|
|
516
|
+
r(je());
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
let i = setTimeout(() => {
|
|
520
|
+
t?.removeEventListener("abort", a), n();
|
|
521
|
+
}, e), a = () => {
|
|
522
|
+
clearTimeout(i), r(je());
|
|
523
|
+
};
|
|
524
|
+
t?.addEventListener("abort", a, { once: !0 });
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
function je() {
|
|
528
|
+
if (typeof DOMException < "u") return new DOMException("Aborted", "AbortError");
|
|
529
|
+
let e = /* @__PURE__ */ Error("Aborted");
|
|
530
|
+
return e.name = "AbortError", e;
|
|
531
|
+
}
|
|
532
|
+
var Me = 5e3, Ne = /* @__PURE__ */ new Map(), Pe = /* @__PURE__ */ new Map(), Fe = /* @__PURE__ */ new Map(), Ie = /* @__PURE__ */ new Map();
|
|
533
|
+
function Le(e) {
|
|
534
|
+
Ie.get(e)?.forEach((e) => e());
|
|
535
|
+
}
|
|
536
|
+
function Re(e) {
|
|
537
|
+
setTimeout(() => URL.revokeObjectURL(e), Me);
|
|
538
|
+
}
|
|
539
|
+
function ze(e, t, n) {
|
|
540
|
+
let r = Fe.get(e);
|
|
541
|
+
r && (Re(r), Fe.delete(e)), Ne.set(e, t), n !== void 0 && Pe.set(e, n), Le(e);
|
|
542
|
+
}
|
|
543
|
+
function Be(e) {
|
|
544
|
+
return Ne.get(e);
|
|
545
|
+
}
|
|
546
|
+
function Ve(e, t) {
|
|
547
|
+
return Ie.has(e) || Ie.set(e, /* @__PURE__ */ new Set()), Ie.get(e).add(t), () => {
|
|
548
|
+
Ie.get(e)?.delete(t);
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
function He(e) {
|
|
552
|
+
let t = Ne.get(e);
|
|
553
|
+
if (!t) return;
|
|
554
|
+
let n = Fe.get(e);
|
|
555
|
+
return n || (n = URL.createObjectURL(new Blob([t], { type: "image/jpeg" })), Fe.set(e, n)), n;
|
|
556
|
+
}
|
|
557
|
+
function Ue() {
|
|
558
|
+
for (let e of Fe.values()) URL.revokeObjectURL(e);
|
|
559
|
+
Fe.clear(), Ne.clear(), Pe.clear();
|
|
560
|
+
}
|
|
561
|
+
function We(e) {
|
|
562
|
+
let t = G(), { isConnected: r } = t, i = Ke(), a = c(), u = l(!1), f = l(!1), p = o(() => {
|
|
563
|
+
if (!a.value) return;
|
|
564
|
+
let t = n(e);
|
|
565
|
+
return He(typeof t == "string" ? t : t._id);
|
|
566
|
+
}), m = o(() => {
|
|
567
|
+
if (!a.value) return;
|
|
568
|
+
let t = n(e), r = typeof t == "string" ? t : t._id;
|
|
569
|
+
return Pe.get(r);
|
|
570
|
+
});
|
|
571
|
+
function h(e) {
|
|
572
|
+
Ie.has(e) || Ie.set(e, /* @__PURE__ */ new Set());
|
|
573
|
+
let t = () => {
|
|
574
|
+
a.value = Ne.get(e);
|
|
575
|
+
};
|
|
576
|
+
return Ie.get(e).add(t), () => {
|
|
577
|
+
Ie.get(e)?.delete(t);
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
let g, _, v;
|
|
581
|
+
async function y(t) {
|
|
582
|
+
if (_ !== t && v !== t) {
|
|
583
|
+
v = t;
|
|
584
|
+
try {
|
|
585
|
+
if (!await Ye(i, t)) return;
|
|
586
|
+
let r = n(e);
|
|
587
|
+
if ((typeof r == "string" ? r : r._id) !== t || _ === t) {
|
|
588
|
+
Xe(t);
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
b(), _ = t;
|
|
592
|
+
} catch {} finally {
|
|
593
|
+
v = void 0;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
function b() {
|
|
598
|
+
_ &&= (Xe(_), void 0);
|
|
599
|
+
}
|
|
600
|
+
async function x(e, t = !1) {
|
|
601
|
+
if (!r.value || !e) return;
|
|
602
|
+
let n = t ? void 0 : Ne.get(e);
|
|
603
|
+
if (n) {
|
|
604
|
+
a.value = n, f.value = !0;
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
u.value = !0;
|
|
608
|
+
try {
|
|
609
|
+
let t = await Ye(i, e);
|
|
610
|
+
try {
|
|
611
|
+
if (t) {
|
|
612
|
+
let n = await t.fetchSnapshot();
|
|
613
|
+
n && (ze(e, n), a.value = n);
|
|
614
|
+
}
|
|
615
|
+
} finally {
|
|
616
|
+
t && Xe(e);
|
|
617
|
+
}
|
|
618
|
+
} catch {} finally {
|
|
619
|
+
u.value = !1, f.value = !0;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
function S(e) {
|
|
623
|
+
return typeof e == "object" && e?.disabled === !0;
|
|
624
|
+
}
|
|
625
|
+
async function C() {
|
|
626
|
+
let t = n(e), o = typeof t == "string" ? t : t._id;
|
|
627
|
+
if (!(!o || !r.value) && !S(t)) {
|
|
628
|
+
u.value = !0;
|
|
629
|
+
try {
|
|
630
|
+
let e = await Ye(i, o);
|
|
631
|
+
try {
|
|
632
|
+
if (e) {
|
|
633
|
+
let t = await e.fetchSnapshot(void 0, !0);
|
|
634
|
+
t && (ze(o, t), a.value = t);
|
|
635
|
+
}
|
|
636
|
+
} finally {
|
|
637
|
+
e && Xe(o);
|
|
638
|
+
}
|
|
639
|
+
} catch {} finally {
|
|
640
|
+
u.value = !1, f.value = !0;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
s([
|
|
645
|
+
r,
|
|
646
|
+
() => n(e),
|
|
647
|
+
() => S(n(e))
|
|
648
|
+
], async ([e, t, n]) => {
|
|
649
|
+
g?.(), g = void 0;
|
|
650
|
+
let r = typeof t == "string" ? t : t._id;
|
|
651
|
+
e && r && !n ? (g = h(r), await y(r), await x(r)) : r ? (b(), a.value = Ne.get(r), f.value = !0) : (b(), a.value = void 0);
|
|
652
|
+
}, { immediate: !0 });
|
|
653
|
+
let ee = () => {
|
|
654
|
+
let t = n(e);
|
|
655
|
+
if (S(t)) return;
|
|
656
|
+
let r = typeof t == "string" ? t : t._id;
|
|
657
|
+
r && x(r, !0);
|
|
658
|
+
};
|
|
659
|
+
return t.on("reconnected", ee), d(() => {
|
|
660
|
+
t.off("reconnected", ee), g?.(), b();
|
|
661
|
+
}), {
|
|
662
|
+
snapshot: a,
|
|
663
|
+
snapshotSrc: p,
|
|
664
|
+
snapshotTimestamp: m,
|
|
665
|
+
isLoading: o(() => u.value || !f.value),
|
|
666
|
+
refresh: C
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
async function Ge(e, t) {
|
|
670
|
+
let n = K.cameraNamespaces(t._id), r = K.sensorRegistryNamespaces(), i = "rpc" in e && "value" in e.rpc ? e : void 0, a = i ? i.rpc : c(e), s, u, d = c(t), f = l(!1), p = l(!1), m = c(Be(t._id)), h = l(!1), g = l({}), _ = Ve(t._id, () => {
|
|
671
|
+
m.value = Be(t._id);
|
|
672
|
+
}), v = o(() => d.value.name), b = o(() => d.value.room), x = o(() => d.value.nativeId), S = o(() => d.value.disabled), C = o(() => d.value.detectionSettings?.snooze ?? !1), ee = o(() => d.value.isCloud), w = o(() => JSON.parse(JSON.stringify(d.value.sources)).map((e) => ({
|
|
673
|
+
...e,
|
|
674
|
+
snapshot: async (t) => ae(e._id, t),
|
|
675
|
+
probeStream: async (t, n = !1) => oe(e._id, t, n)
|
|
676
|
+
}))), te = o(() => w.value.find((e) => e.role === "high-resolution")), T = o(() => w.value.find((e) => e.role === "mid-resolution")), E = o(() => w.value.find((e) => e.role === "low-resolution")), D = o(() => te.value ?? T.value ?? E.value), O = o(() => w.value.find((e) => e.role === "snapshot") ?? w.value.find((e) => e.useForSnapshot)), k = o(() => {
|
|
677
|
+
let e = /* @__PURE__ */ new Set();
|
|
678
|
+
for (let t of Object.values(g.value)) e.add(t.type);
|
|
679
|
+
return e;
|
|
680
|
+
}), A = o(() => Array.from(k.value)), j = o(() => k.value.has(y.Light)), ne = o(() => k.value.has(y.Siren)), re = o(() => k.value.has(y.Doorbell)), ie = o(() => k.value.has(y.Battery)), M = o(() => k.value.has(y.Audio)), N = o(() => k.value.has(y.Motion)), P = o(() => k.value.has(y.Object)), F = o(() => k.value.has(y.PTZ));
|
|
681
|
+
async function ae(e, r) {
|
|
682
|
+
h.value = !0;
|
|
683
|
+
try {
|
|
684
|
+
try {
|
|
685
|
+
let i = await q(a, (t) => t.createProxy(n.cameraControllerRpc).snapshotWithMeta(e, r));
|
|
686
|
+
return i && i.data.byteLength > 0 ? (ze(t._id, i.data, Date.now() - i.ageMs), i.data) : void 0;
|
|
687
|
+
} catch {
|
|
688
|
+
let i = await q(a, (t) => t.createProxy(n.cameraControllerRpc).snapshot(e, r));
|
|
689
|
+
if (i && i.byteLength > 0) return ze(t._id, i, r ? Date.now() : void 0), i;
|
|
690
|
+
}
|
|
691
|
+
} finally {
|
|
692
|
+
h.value = !1;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
async function oe(e, t, r = !1) {
|
|
696
|
+
return q(a, (i) => i.createProxy(n.cameraControllerRpc).probeStream(e, t, r));
|
|
697
|
+
}
|
|
698
|
+
async function se(e) {
|
|
699
|
+
return q(a, (t) => t.createProxy(n.cameraControllerRpc).streamUrl(e));
|
|
700
|
+
}
|
|
701
|
+
async function I() {
|
|
702
|
+
let e = await q(a, (e) => e.createProxy(n.cameraControllerRpc).refreshStates());
|
|
703
|
+
d.value = e.camera, f.value = e.cameraState, p.value = e.frameWorkerState, g.value = e.sensorStates;
|
|
704
|
+
}
|
|
705
|
+
async function L(e) {
|
|
706
|
+
switch (e.type) {
|
|
707
|
+
case "removed":
|
|
708
|
+
await R();
|
|
709
|
+
break;
|
|
710
|
+
case "updated":
|
|
711
|
+
d.value = e.data;
|
|
712
|
+
break;
|
|
713
|
+
case "cameraState":
|
|
714
|
+
f.value = e.data;
|
|
715
|
+
break;
|
|
716
|
+
case "frameWorkerState":
|
|
717
|
+
p.value = e.data;
|
|
718
|
+
break;
|
|
719
|
+
case "snapshot:updated": ze(t._id, e.data.snapshot, Date.now());
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
function ce(e) {
|
|
723
|
+
if (e.type === "sensor:added") {
|
|
724
|
+
let n = e.data;
|
|
725
|
+
if (!n.sensor.assignedCameraIds.includes(t._id) || !n.sensor.connected) return;
|
|
726
|
+
g.value = {
|
|
727
|
+
...g.value,
|
|
728
|
+
[n.sensor.id]: n.state
|
|
729
|
+
};
|
|
730
|
+
} else if (e.type === "sensor:deleted") {
|
|
731
|
+
let t = e.data, n = { ...g.value };
|
|
732
|
+
delete n[t.sensorId], g.value = n;
|
|
733
|
+
} else if (e.type === "sensor:connected:changed") {
|
|
734
|
+
let t = e.data;
|
|
735
|
+
if (t.connected) I().catch(() => {});
|
|
736
|
+
else {
|
|
737
|
+
let e = { ...g.value };
|
|
738
|
+
delete e[t.sensorId], g.value = e;
|
|
739
|
+
}
|
|
740
|
+
} else if (e.type === "sensor:assignment:changed") {
|
|
741
|
+
let n = e.data;
|
|
742
|
+
if (n.cameraId !== t._id) return;
|
|
743
|
+
if (n.assigned) I().catch(() => {});
|
|
744
|
+
else {
|
|
745
|
+
let e = { ...g.value };
|
|
746
|
+
delete e[n.sensorId], g.value = e;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
async function le() {
|
|
751
|
+
s?.(), u?.(), s = await q(a, (e) => e.subscribe(n.cameraSubject, L)), u = await q(a, (e) => e.subscribe(r.sensorsSubject, ce)), await I();
|
|
752
|
+
}
|
|
753
|
+
async function R() {
|
|
754
|
+
s?.(), s = void 0, u?.(), u = void 0, _();
|
|
755
|
+
}
|
|
756
|
+
async function ue(e, t) {
|
|
757
|
+
let n = w.value.find((e) => e.useForSnapshot), r = w.value.find((e) => e.role === "snapshot"), i = e ?? r?._id ?? n?._id ?? E.value?._id ?? T.value?._id ?? te.value?._id ?? D.value?._id;
|
|
758
|
+
return i ? ae(i, t) : Promise.resolve(void 0);
|
|
759
|
+
}
|
|
760
|
+
async function z(e, t, n = !1) {
|
|
761
|
+
let r = e ?? D.value?._id;
|
|
762
|
+
return r ? oe(r, t, n) : Promise.resolve(void 0);
|
|
763
|
+
}
|
|
764
|
+
return await le(), {
|
|
765
|
+
id: t._id,
|
|
766
|
+
name: v,
|
|
767
|
+
room: b,
|
|
768
|
+
nativeId: x,
|
|
769
|
+
disabled: S,
|
|
770
|
+
snooze: C,
|
|
771
|
+
isCloud: ee,
|
|
772
|
+
connected: f,
|
|
773
|
+
frameWorkerConnected: p,
|
|
774
|
+
sources: w,
|
|
775
|
+
streamSource: D,
|
|
776
|
+
snapshotSource: O,
|
|
777
|
+
highResolutionSource: te,
|
|
778
|
+
midResolutionSource: T,
|
|
779
|
+
lowResolutionSource: E,
|
|
780
|
+
capabilities: A,
|
|
781
|
+
hasLight: j,
|
|
782
|
+
hasSiren: ne,
|
|
783
|
+
hasDoorbell: re,
|
|
784
|
+
hasBattery: ie,
|
|
785
|
+
hasAudioSensor: M,
|
|
786
|
+
hasMotionSensor: N,
|
|
787
|
+
hasObjectSensor: P,
|
|
788
|
+
hasPtz: F,
|
|
789
|
+
camera: d,
|
|
790
|
+
snapshot: m,
|
|
791
|
+
snapshotLoading: h,
|
|
792
|
+
fetchSnapshot: ue,
|
|
793
|
+
probeStream: z,
|
|
794
|
+
streamUrl: se,
|
|
795
|
+
refreshStates: I,
|
|
796
|
+
reconnect: le,
|
|
797
|
+
close: R
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
function Ke() {
|
|
801
|
+
let e = G(), t = K.deviceManagerNamespaces();
|
|
802
|
+
async function n(n) {
|
|
803
|
+
let r = await q(e.rpc, (e) => e.createProxy(t.deviceManagerRpc).getCamera(n, "@camera.ui/browser"));
|
|
804
|
+
if (r) return Ge(e, r);
|
|
805
|
+
}
|
|
806
|
+
return { getCamera: n };
|
|
807
|
+
}
|
|
808
|
+
var J = Se({
|
|
809
|
+
releaseDelay: 1e3,
|
|
810
|
+
onRelease: (e, t) => t.close()
|
|
811
|
+
}), qe = /* @__PURE__ */ new Map();
|
|
812
|
+
function Je() {
|
|
813
|
+
J.clear(), qe.clear();
|
|
814
|
+
}
|
|
815
|
+
async function Ye(e, t) {
|
|
816
|
+
if (J.has(t)) return J.acquire(t, () => {
|
|
817
|
+
throw Error("Should not create - already cached");
|
|
818
|
+
});
|
|
819
|
+
let n = qe.get(t);
|
|
820
|
+
if (n) {
|
|
821
|
+
let e = await n;
|
|
822
|
+
return e ? J.acquire(t, () => e) : void 0;
|
|
823
|
+
}
|
|
824
|
+
let r = e.getCamera(t);
|
|
825
|
+
qe.set(t, r);
|
|
826
|
+
try {
|
|
827
|
+
let e = await r;
|
|
828
|
+
return e ? J.acquire(t, () => e) : void 0;
|
|
829
|
+
} finally {
|
|
830
|
+
qe.delete(t);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
function Xe(e) {
|
|
834
|
+
J.release(e);
|
|
835
|
+
}
|
|
836
|
+
function Ze() {
|
|
837
|
+
J.forEachValue((e) => {
|
|
838
|
+
e.reconnect().catch(() => {});
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
function Qe(e) {
|
|
842
|
+
let { isConnected: t } = G(), r = Ke(), i = c(), a = l(!1), u = l(!1), f = l(), p;
|
|
843
|
+
async function m(o) {
|
|
844
|
+
if (!t.value || !o) return;
|
|
845
|
+
if (p && p !== o && (J.release(p), i.value = void 0, p = void 0), J.has(o)) {
|
|
846
|
+
let e = J.acquire(o, () => {
|
|
847
|
+
throw Error("Should not create - already cached");
|
|
848
|
+
});
|
|
849
|
+
p = o, i.value = e, u.value = !0;
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
let s = qe.get(o);
|
|
853
|
+
if (s) {
|
|
854
|
+
a.value = !0;
|
|
855
|
+
try {
|
|
856
|
+
let t = await s;
|
|
857
|
+
if (t && J.has(o) && n(e) === o) {
|
|
858
|
+
let e = J.acquire(o, () => t);
|
|
859
|
+
p = o, i.value = e;
|
|
860
|
+
}
|
|
861
|
+
} catch (e) {
|
|
862
|
+
f.value = e instanceof Error ? e : Error(String(e));
|
|
863
|
+
} finally {
|
|
864
|
+
a.value = !1, u.value = !0;
|
|
865
|
+
}
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
a.value = !0, f.value = void 0;
|
|
869
|
+
let c = r.getCamera(o);
|
|
870
|
+
qe.set(o, c);
|
|
871
|
+
try {
|
|
872
|
+
let t = await c;
|
|
873
|
+
if (t) {
|
|
874
|
+
if (J.acquire(o, () => t), n(e) !== o) {
|
|
875
|
+
J.release(o);
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
p = o, i.value = t;
|
|
879
|
+
}
|
|
880
|
+
} catch (e) {
|
|
881
|
+
f.value = e instanceof Error ? e : Error(String(e));
|
|
882
|
+
} finally {
|
|
883
|
+
qe.delete(o), a.value = !1, u.value = !0;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
async function h() {
|
|
887
|
+
let t = n(e);
|
|
888
|
+
t && (p &&= (J.getRefCount(p) <= 1 ? J.forceRelease(p) : J.release(p), i.value = void 0, void 0), await m(t));
|
|
889
|
+
}
|
|
890
|
+
return s([t, () => n(e)], async ([e, t]) => {
|
|
891
|
+
e && t ? await m(t) : !e && p && (J.release(p), i.value = void 0, p = void 0);
|
|
892
|
+
}, { immediate: !0 }), d(() => {
|
|
893
|
+
p &&= (J.release(p), i.value = void 0, void 0);
|
|
894
|
+
}), {
|
|
895
|
+
camera: i,
|
|
896
|
+
isLoading: o(() => a.value || !u.value),
|
|
897
|
+
error: f,
|
|
898
|
+
refresh: h
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
var $e = 2e3, et = 3e4, Y = Se({ releaseDelay: 1e3 }), tt = /* @__PURE__ */ new Map(), nt = /* @__PURE__ */ new Set(), rt = /* @__PURE__ */ new Map(), it = /* @__PURE__ */ new Map(), at = /* @__PURE__ */ new Map(), ot, st;
|
|
902
|
+
function ct() {
|
|
903
|
+
Y.clear(), tt.clear();
|
|
904
|
+
for (let e of nt) try {
|
|
905
|
+
e();
|
|
906
|
+
} catch {}
|
|
907
|
+
}
|
|
908
|
+
function lt(e) {
|
|
909
|
+
for (let t of [...rt.get(e) ?? []]) t();
|
|
910
|
+
}
|
|
911
|
+
function ut(e) {
|
|
912
|
+
let t = it.get(e);
|
|
913
|
+
t && clearTimeout(t), it.delete(e), at.delete(e);
|
|
914
|
+
}
|
|
915
|
+
function dt(e) {
|
|
916
|
+
if (it.has(e)) return;
|
|
917
|
+
let t = at.get(e) ?? 0;
|
|
918
|
+
at.set(e, t + 1);
|
|
919
|
+
let n = setTimeout(() => {
|
|
920
|
+
it.delete(e), lt(e);
|
|
921
|
+
}, Math.min($e * 2 ** t, et));
|
|
922
|
+
it.set(e, n);
|
|
923
|
+
}
|
|
924
|
+
function ft(e) {
|
|
925
|
+
if (e?.type !== "pluginStatusChanged") return;
|
|
926
|
+
let { pluginName: t, running: n } = e.data;
|
|
927
|
+
n || Y.forceRelease(t), ut(t), lt(t);
|
|
928
|
+
}
|
|
929
|
+
async function pt(e) {
|
|
930
|
+
let t = e.value;
|
|
931
|
+
if (!(!t || t === ot)) {
|
|
932
|
+
st?.(), st = void 0, ot = t;
|
|
933
|
+
try {
|
|
934
|
+
st = await t.subscribe(K.coreManagerNamespaces().coreManagerSubject, ft);
|
|
935
|
+
} catch {
|
|
936
|
+
ot = void 0;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
function mt(e) {
|
|
941
|
+
let { rpc: t, isConnected: r } = G(), i = c(), a = l(), u = l(!1), f = l(!1), p = l(), m, h;
|
|
942
|
+
function g(e) {
|
|
943
|
+
if (Y.has(e)) return Y.acquire(e, () => {
|
|
944
|
+
throw Error("Should not create - already cached");
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
function _(e) {
|
|
948
|
+
Y.release(e);
|
|
949
|
+
}
|
|
950
|
+
function v(e) {
|
|
951
|
+
if (h === e) return;
|
|
952
|
+
h && y(h);
|
|
953
|
+
let t = rt.get(e) ?? /* @__PURE__ */ new Set();
|
|
954
|
+
t.add(b), rt.set(e, t), h = e;
|
|
955
|
+
}
|
|
956
|
+
function y(e) {
|
|
957
|
+
let t = rt.get(e);
|
|
958
|
+
t && (t.delete(b), t.size === 0 && (rt.delete(e), ut(e))), h === e && (h = void 0);
|
|
959
|
+
}
|
|
960
|
+
function b() {
|
|
961
|
+
let t = n(e);
|
|
962
|
+
t && C(t, !0);
|
|
963
|
+
}
|
|
964
|
+
function x(e) {
|
|
965
|
+
m &&= (_(m), void 0), i.value = void 0, a.value = void 0, dt(e);
|
|
966
|
+
}
|
|
967
|
+
function S(e, t) {
|
|
968
|
+
m = e, i.value = t.proxy, a.value = t.contract, p.value = void 0, ut(e);
|
|
969
|
+
}
|
|
970
|
+
async function C(o, s = !1) {
|
|
971
|
+
if (!r.value || !o) return;
|
|
972
|
+
if (m && m !== o && (y(m), _(m), i.value = void 0, a.value = void 0, m = void 0), v(o), pt(t), m === o && !Y.has(o)) m = void 0, i.value = void 0, a.value = void 0;
|
|
973
|
+
else if (m === o && i.value) return;
|
|
974
|
+
let c = g(o);
|
|
975
|
+
if (c) {
|
|
976
|
+
S(o, c), f.value = !0;
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
979
|
+
let l = tt.get(o);
|
|
980
|
+
if (l) {
|
|
981
|
+
s || (u.value = !0);
|
|
982
|
+
try {
|
|
983
|
+
let t = await l;
|
|
984
|
+
if (n(e) !== o) return;
|
|
985
|
+
if (t) {
|
|
986
|
+
let e = g(o);
|
|
987
|
+
e && S(o, e);
|
|
988
|
+
} else x(o);
|
|
989
|
+
} catch (e) {
|
|
990
|
+
s || (p.value = e instanceof Error ? e : Error(String(e))), x(o);
|
|
991
|
+
} finally {
|
|
992
|
+
s || (u.value = !1), f.value = !0;
|
|
993
|
+
}
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
996
|
+
s || (u.value = !0, p.value = void 0);
|
|
997
|
+
let d = q(t, async (e) => {
|
|
998
|
+
let t = K.coreManagerNamespaces(), n = await e.createProxy(t.coreManagerRpc).getPlugin(o);
|
|
999
|
+
if (!n) throw Error(`Plugin "${o}" not found`);
|
|
1000
|
+
if (n.running === !1) return;
|
|
1001
|
+
let r = K.pluginNamespaces(n.id);
|
|
1002
|
+
return {
|
|
1003
|
+
proxy: e.createProxy(r.pluginChildRpc),
|
|
1004
|
+
contract: n.contract
|
|
1005
|
+
};
|
|
1006
|
+
});
|
|
1007
|
+
tt.set(o, d);
|
|
1008
|
+
try {
|
|
1009
|
+
let t = await d;
|
|
1010
|
+
if (t) {
|
|
1011
|
+
if (Y.acquire(o, () => t), n(e) !== o) {
|
|
1012
|
+
Y.release(o);
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
S(o, t);
|
|
1016
|
+
} else n(e) === o && x(o);
|
|
1017
|
+
} catch (e) {
|
|
1018
|
+
s || (p.value = e instanceof Error ? e : Error(String(e))), x(o);
|
|
1019
|
+
} finally {
|
|
1020
|
+
tt.delete(o), s || (u.value = !1), f.value = !0;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
async function ee() {
|
|
1024
|
+
let t = n(e);
|
|
1025
|
+
t && (m &&= (Y.getRefCount(m) <= 1 ? Y.forceRelease(m) : Y.release(m), i.value = void 0, a.value = void 0, void 0), await C(t));
|
|
1026
|
+
}
|
|
1027
|
+
let w = () => {
|
|
1028
|
+
m &&= (i.value = void 0, a.value = void 0, void 0);
|
|
1029
|
+
};
|
|
1030
|
+
return nt.add(w), s([
|
|
1031
|
+
r,
|
|
1032
|
+
() => n(e),
|
|
1033
|
+
t
|
|
1034
|
+
], async ([e, t, n], r) => {
|
|
1035
|
+
let o = r?.[2];
|
|
1036
|
+
m && o && o !== n && (_(m), i.value = void 0, a.value = void 0, m = void 0), e && t && n ? await C(t) : (!e || !n) && m && (y(m), _(m), i.value = void 0, a.value = void 0, m = void 0);
|
|
1037
|
+
}, { immediate: !0 }), d(() => {
|
|
1038
|
+
nt.delete(w), y(n(e)), m &&= (y(m), _(m), i.value = void 0, a.value = void 0, void 0);
|
|
1039
|
+
}), {
|
|
1040
|
+
plugin: i,
|
|
1041
|
+
contract: a,
|
|
1042
|
+
isLoading: o(() => u.value || !f.value),
|
|
1043
|
+
error: p,
|
|
1044
|
+
refresh: ee
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
function ht(e) {
|
|
1048
|
+
if (e) return typeof e == "string" ? e : e.id;
|
|
1049
|
+
}
|
|
1050
|
+
function X(e) {
|
|
1051
|
+
return (t) => t.type === e;
|
|
1052
|
+
}
|
|
1053
|
+
var gt = X(y.Light), _t = X(y.Siren), vt = X(y.Battery), yt = X(y.Doorbell), bt = X(y.Contact);
|
|
1054
|
+
y.Motion, y.Object, y.Audio, y.Face, y.LicensePlate, y.Classifier, y.PTZ;
|
|
1055
|
+
var xt = X(y.Switch), St = X(y.Lock), Ct = X(y.SecuritySystem), wt = X(y.Temperature), Tt = X(y.Humidity), Et = X(y.Occupancy), Dt = X(y.Smoke), Ot = X(y.Leak);
|
|
1056
|
+
y.Gas, y.CarbonMonoxide, y.Heat, y.Cold, y.Vibration, y.Tamper, y.Problem, y.Power, y.Illuminance, y.CarbonDioxide;
|
|
1057
|
+
var kt = X(y.Garage);
|
|
1058
|
+
function At(e, t, n) {
|
|
1059
|
+
let r = l(t.displayName ?? e.displayName ?? e.name), i = l(t.capabilities ?? e.capabilities ?? []), a = l([...e.assignedCameraIds]), o = l(e.exposed), s = l(e.connected), c = u({ ...t.properties }), d = [];
|
|
1060
|
+
return {
|
|
1061
|
+
id: e.id,
|
|
1062
|
+
type: e.type,
|
|
1063
|
+
name: e.name,
|
|
1064
|
+
displayName: r,
|
|
1065
|
+
nativeId: e.nativeId,
|
|
1066
|
+
pluginId: e.pluginId,
|
|
1067
|
+
assignedCameraIds: a,
|
|
1068
|
+
exposed: o,
|
|
1069
|
+
connected: s,
|
|
1070
|
+
capabilities: i,
|
|
1071
|
+
properties: c,
|
|
1072
|
+
getProperty(e) {
|
|
1073
|
+
return c[e];
|
|
1074
|
+
},
|
|
1075
|
+
async setProperty(t, r) {
|
|
1076
|
+
let i = `plugin.${e.pluginId}.sensor.${e.id}.rpc`;
|
|
1077
|
+
await q(n, (e) => e.createProxy(i).updateValue(t, r));
|
|
1078
|
+
},
|
|
1079
|
+
async setDisplayName(t) {
|
|
1080
|
+
let r = K.sensorRegistryNamespaces();
|
|
1081
|
+
await q(n, (n) => n.createProxy(r.sensorsRpc).setDisplayName(e.id, t));
|
|
1082
|
+
},
|
|
1083
|
+
hasCapability(e) {
|
|
1084
|
+
return i.value.includes(e);
|
|
1085
|
+
},
|
|
1086
|
+
onCapabilitiesChanged(e) {
|
|
1087
|
+
return d.push(e), () => {
|
|
1088
|
+
let t = d.indexOf(e);
|
|
1089
|
+
t !== -1 && d.splice(t, 1);
|
|
1090
|
+
};
|
|
1091
|
+
},
|
|
1092
|
+
_notifyCapabilitiesChanged() {
|
|
1093
|
+
for (let e of d) e(i.value);
|
|
1094
|
+
}
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
function jt(e) {
|
|
1098
|
+
let { sensorsSubject: t, sensorsRpc: n } = K.sensorRegistryNamespaces(), r = "rpc" in e && "value" in e.rpc ? e : void 0, i = r ? r.rpc : c(e), a = c(/* @__PURE__ */ new Map()), s, u = /* @__PURE__ */ new Map(), d = l(!1), f;
|
|
1099
|
+
function p(e, t) {
|
|
1100
|
+
let n = a.value.get(e);
|
|
1101
|
+
if (n) {
|
|
1102
|
+
if (t.type === "property:changed") {
|
|
1103
|
+
let e = t.data;
|
|
1104
|
+
n.properties[e.property] = e.value;
|
|
1105
|
+
} else if (t.type === "sensor:displayName:changed") {
|
|
1106
|
+
let e = t.data;
|
|
1107
|
+
n.displayName.value = e.displayName;
|
|
1108
|
+
} else if (t.type === "sensor:capabilities:changed") {
|
|
1109
|
+
let e = t.data;
|
|
1110
|
+
n.capabilities.value = e.capabilities, n._notifyCapabilitiesChanged();
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
async function m(e) {
|
|
1115
|
+
if (u.has(e)) return;
|
|
1116
|
+
let t = K.sensorEventNamespaces(e), n = await q(i, (n) => n.subscribe(t.sensorSubject, (t) => p(e, t)));
|
|
1117
|
+
u.set(e, n);
|
|
1118
|
+
}
|
|
1119
|
+
function h(e) {
|
|
1120
|
+
let t = u.get(e);
|
|
1121
|
+
t && (t(), u.delete(e));
|
|
1122
|
+
}
|
|
1123
|
+
function g(e) {
|
|
1124
|
+
if (e.type === "sensor:added") {
|
|
1125
|
+
let t = e.data;
|
|
1126
|
+
if (a.value.has(t.sensor.id)) return;
|
|
1127
|
+
let n = At(t.sensor, t.state, i), r = new Map(a.value);
|
|
1128
|
+
r.set(t.sensor.id, n), a.value = r, m(t.sensor.id);
|
|
1129
|
+
} else if (e.type === "sensor:deleted") {
|
|
1130
|
+
let t = e.data;
|
|
1131
|
+
h(t.sensorId);
|
|
1132
|
+
let n = new Map(a.value);
|
|
1133
|
+
n.delete(t.sensorId), a.value = n;
|
|
1134
|
+
} else if (e.type === "sensor:connected:changed") {
|
|
1135
|
+
let t = e.data, n = a.value.get(t.sensorId);
|
|
1136
|
+
n && (n.connected.value = t.connected);
|
|
1137
|
+
} else if (e.type === "sensor:assignment:changed") {
|
|
1138
|
+
let t = e.data, n = a.value.get(t.sensorId);
|
|
1139
|
+
if (!n) return;
|
|
1140
|
+
let r = new Set(n.assignedCameraIds.value);
|
|
1141
|
+
t.assigned ? r.add(t.cameraId) : r.delete(t.cameraId), n.assignedCameraIds.value = [...r];
|
|
1142
|
+
} else if (e.type === "sensor:exposed:changed") {
|
|
1143
|
+
let t = e.data, n = a.value.get(t.sensorId);
|
|
1144
|
+
n && (n.exposed.value = t.exposed);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
async function _() {
|
|
1148
|
+
s?.(), s = void 0;
|
|
1149
|
+
for (let e of u.values()) e();
|
|
1150
|
+
u.clear(), a.value = /* @__PURE__ */ new Map();
|
|
1151
|
+
let e = [];
|
|
1152
|
+
s = await q(i, (n) => n.subscribe(t, (t) => {
|
|
1153
|
+
e ? e.push(t) : g(t);
|
|
1154
|
+
}));
|
|
1155
|
+
let [r, o] = await q(i, async (e) => {
|
|
1156
|
+
let t = e.createProxy(n);
|
|
1157
|
+
return Promise.all([t.getSensors(), t.getSensorStates()]);
|
|
1158
|
+
}), c = /* @__PURE__ */ new Map();
|
|
1159
|
+
for (let e of r) {
|
|
1160
|
+
let t = At(e, o[e.id] ?? {
|
|
1161
|
+
properties: {},
|
|
1162
|
+
capabilities: [],
|
|
1163
|
+
type: e.type
|
|
1164
|
+
}, i);
|
|
1165
|
+
c.set(e.id, t);
|
|
1166
|
+
}
|
|
1167
|
+
a.value = c;
|
|
1168
|
+
for (let e of c.keys()) await m(e);
|
|
1169
|
+
let l = e;
|
|
1170
|
+
e = void 0;
|
|
1171
|
+
for (let e of l) g(e);
|
|
1172
|
+
d.value = !0;
|
|
1173
|
+
}
|
|
1174
|
+
function v() {
|
|
1175
|
+
let e = _().finally(() => {
|
|
1176
|
+
f === e && (f = void 0);
|
|
1177
|
+
});
|
|
1178
|
+
return f = e, e;
|
|
1179
|
+
}
|
|
1180
|
+
async function y() {
|
|
1181
|
+
if (!d.value) return f || v(), f;
|
|
1182
|
+
}
|
|
1183
|
+
async function b() {
|
|
1184
|
+
if (d.value = !1, f) {
|
|
1185
|
+
let e = f.catch(() => {}).then(() => _()).finally(() => {
|
|
1186
|
+
f === e && (f = void 0);
|
|
1187
|
+
});
|
|
1188
|
+
return f = e, e;
|
|
1189
|
+
}
|
|
1190
|
+
return v();
|
|
1191
|
+
}
|
|
1192
|
+
function x() {
|
|
1193
|
+
s?.(), s = void 0;
|
|
1194
|
+
for (let e of u.values()) e();
|
|
1195
|
+
u.clear(), a.value.clear(), d.value = !1, f = void 0;
|
|
1196
|
+
}
|
|
1197
|
+
let S = o(() => Array.from(a.value.values()));
|
|
1198
|
+
return {
|
|
1199
|
+
sensors: S,
|
|
1200
|
+
isInitialized: o(() => d.value),
|
|
1201
|
+
getSensor(e) {
|
|
1202
|
+
return a.value.get(e);
|
|
1203
|
+
},
|
|
1204
|
+
getSensorsByType(e) {
|
|
1205
|
+
return S.value.filter((t) => t.type === e);
|
|
1206
|
+
},
|
|
1207
|
+
hasSensorType(e) {
|
|
1208
|
+
return S.value.some((t) => t.type === e);
|
|
1209
|
+
},
|
|
1210
|
+
async setDisplayName(e, t) {
|
|
1211
|
+
await q(i, (r) => r.createProxy(n).setDisplayName(e, t));
|
|
1212
|
+
},
|
|
1213
|
+
ensureInitialized: y,
|
|
1214
|
+
reconnect: b,
|
|
1215
|
+
close: x
|
|
1216
|
+
};
|
|
1217
|
+
}
|
|
1218
|
+
var Mt = Se({
|
|
1219
|
+
releaseDelay: 1e3,
|
|
1220
|
+
onRelease: (e, t) => t.manager.close()
|
|
1221
|
+
});
|
|
1222
|
+
function Nt() {
|
|
1223
|
+
Mt.clear();
|
|
1224
|
+
}
|
|
1225
|
+
function Pt() {
|
|
1226
|
+
Mt.forEachValue((e) => {
|
|
1227
|
+
e.initPromise = e.manager.reconnect();
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
var Ft = "sensors";
|
|
1231
|
+
function It(e) {
|
|
1232
|
+
return Mt.acquire(Ft, () => ({ manager: jt(e) }));
|
|
1233
|
+
}
|
|
1234
|
+
function Lt() {
|
|
1235
|
+
Mt.release(Ft);
|
|
1236
|
+
}
|
|
1237
|
+
function Rt() {
|
|
1238
|
+
return {
|
|
1239
|
+
acquired: !1,
|
|
1240
|
+
cachedManager: void 0
|
|
1241
|
+
};
|
|
1242
|
+
}
|
|
1243
|
+
function zt(e, t) {
|
|
1244
|
+
return e.sensors.value.filter((e) => e.assignedCameraIds.value.includes(t));
|
|
1245
|
+
}
|
|
1246
|
+
async function Bt(e, t, n, r, i) {
|
|
1247
|
+
if (!(!t.rpc.value || !n)) {
|
|
1248
|
+
r.value = !0, i.value = void 0;
|
|
1249
|
+
try {
|
|
1250
|
+
let n = It(t);
|
|
1251
|
+
return e.acquired = !0, e.cachedManager = n.manager, n.initPromise ||= n.manager.ensureInitialized(), await n.initPromise, n.manager;
|
|
1252
|
+
} catch (e) {
|
|
1253
|
+
i.value = e instanceof Error ? e : Error(String(e));
|
|
1254
|
+
return;
|
|
1255
|
+
} finally {
|
|
1256
|
+
r.value = !1;
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
function Vt(e) {
|
|
1261
|
+
e.acquired && (Lt(), e.acquired = !1, e.cachedManager = void 0);
|
|
1262
|
+
}
|
|
1263
|
+
function Ht(e) {
|
|
1264
|
+
let t = G(), { isConnected: r } = t, i = c([]), a = c(), u = l(!1), f = l(!1), p = l(), m = Rt();
|
|
1265
|
+
s([r, () => ht(n(e))], async ([e, n]) => {
|
|
1266
|
+
if (e && n) {
|
|
1267
|
+
let r = await Bt(m, t, e, u, p);
|
|
1268
|
+
a.value = r, i.value = r ? zt(r, n) : [], f.value = !0;
|
|
1269
|
+
} else Vt(m), i.value = [], a.value = void 0;
|
|
1270
|
+
}, { immediate: !0 });
|
|
1271
|
+
let h = o(() => {
|
|
1272
|
+
if (!a.value) return [];
|
|
1273
|
+
let t = ht(n(e));
|
|
1274
|
+
return t ? zt(a.value, t) : [];
|
|
1275
|
+
});
|
|
1276
|
+
return d(() => {
|
|
1277
|
+
Vt(m), i.value = [];
|
|
1278
|
+
}), {
|
|
1279
|
+
sensors: h,
|
|
1280
|
+
isLoading: o(() => u.value || !f.value),
|
|
1281
|
+
error: p
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
function Ut() {
|
|
1285
|
+
let e = G(), { isConnected: t } = e, n = c(), r = l(!1), i = l(!1), a = l(), u = Rt();
|
|
1286
|
+
s([t], async ([t]) => {
|
|
1287
|
+
t ? (n.value = await Bt(u, e, t, r, a), i.value = !0) : (Vt(u), n.value = void 0);
|
|
1288
|
+
}, { immediate: !0 });
|
|
1289
|
+
let f = o(() => n.value?.sensors.value ?? []);
|
|
1290
|
+
return d(() => {
|
|
1291
|
+
Vt(u);
|
|
1292
|
+
}), {
|
|
1293
|
+
sensors: f,
|
|
1294
|
+
isLoading: o(() => r.value || !i.value),
|
|
1295
|
+
error: a
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
function Wt(e, t, n) {
|
|
1299
|
+
let r = e.filter((e) => e.type === t);
|
|
1300
|
+
if (n) {
|
|
1301
|
+
let e = r.find((e) => e.pluginId === n);
|
|
1302
|
+
if (e) return e;
|
|
1303
|
+
}
|
|
1304
|
+
return r[0];
|
|
1305
|
+
}
|
|
1306
|
+
function Gt(e, t, r) {
|
|
1307
|
+
let i = G(), { isConnected: a } = i, u = c(), f = c(), p = l(!1), m = l(!1), h = l(), g = Rt();
|
|
1308
|
+
return s([
|
|
1309
|
+
a,
|
|
1310
|
+
() => ht(n(e)),
|
|
1311
|
+
() => n(r)
|
|
1312
|
+
], async ([e, n, r]) => {
|
|
1313
|
+
if (e && n) {
|
|
1314
|
+
let a = await Bt(g, i, e, p, h);
|
|
1315
|
+
f.value = a, u.value = a ? Wt(zt(a, n), t, r) : void 0, m.value = !0;
|
|
1316
|
+
} else Vt(g), u.value = void 0;
|
|
1317
|
+
}, { immediate: !0 }), s(() => {
|
|
1318
|
+
if (!f.value) return;
|
|
1319
|
+
let i = ht(n(e));
|
|
1320
|
+
if (i) return Wt(zt(f.value, i), t, n(r))?.id;
|
|
1321
|
+
}, () => {
|
|
1322
|
+
if (f.value) {
|
|
1323
|
+
let i = ht(n(e));
|
|
1324
|
+
u.value = i ? Wt(zt(f.value, i), t, n(r)) : void 0;
|
|
1325
|
+
}
|
|
1326
|
+
}), d(() => {
|
|
1327
|
+
Vt(g), u.value = void 0;
|
|
1328
|
+
}), {
|
|
1329
|
+
sensor: u,
|
|
1330
|
+
isLoading: o(() => p.value || !m.value),
|
|
1331
|
+
error: h
|
|
1332
|
+
};
|
|
1333
|
+
}
|
|
1334
|
+
function Kt(e, t) {
|
|
1335
|
+
return Gt(e, y.Motion, t);
|
|
1336
|
+
}
|
|
1337
|
+
function qt(e, t) {
|
|
1338
|
+
return Gt(e, y.Object, t);
|
|
1339
|
+
}
|
|
1340
|
+
function Jt(e, t) {
|
|
1341
|
+
return Gt(e, y.Face, t);
|
|
1342
|
+
}
|
|
1343
|
+
function Yt(e, t) {
|
|
1344
|
+
return Gt(e, y.LicensePlate, t);
|
|
1345
|
+
}
|
|
1346
|
+
function Xt(e) {
|
|
1347
|
+
return Gt(e, y.PTZ);
|
|
1348
|
+
}
|
|
1349
|
+
function Zt(e) {
|
|
1350
|
+
let t = G(), { isConnected: r } = t, i = c([]), a = c(), u = l(!1), f = l(!1), p = l(), m = Rt();
|
|
1351
|
+
s([r, () => ht(n(e))], async ([e, n]) => {
|
|
1352
|
+
if (e && n) {
|
|
1353
|
+
let r = await Bt(m, t, e, u, p);
|
|
1354
|
+
a.value = r, i.value = r ? zt(r, n).filter((e) => e.type === y.Classifier) : [], f.value = !0;
|
|
1355
|
+
} else Vt(m), i.value = [], a.value = void 0;
|
|
1356
|
+
}, { immediate: !0 });
|
|
1357
|
+
let h = o(() => {
|
|
1358
|
+
if (!a.value) return [];
|
|
1359
|
+
let t = ht(n(e));
|
|
1360
|
+
return t ? zt(a.value, t).filter((e) => e.type === y.Classifier) : [];
|
|
1361
|
+
});
|
|
1362
|
+
return d(() => {
|
|
1363
|
+
Vt(m), i.value = [];
|
|
1364
|
+
}), {
|
|
1365
|
+
sensors: h,
|
|
1366
|
+
isLoading: o(() => u.value || !f.value),
|
|
1367
|
+
error: p
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
var Qt = /* @__PURE__ */ new Map();
|
|
1371
|
+
function $t() {
|
|
1372
|
+
Qt.clear();
|
|
1373
|
+
}
|
|
1374
|
+
async function en(e, t) {
|
|
1375
|
+
let n = Qt.get(t);
|
|
1376
|
+
if (n) return n;
|
|
1377
|
+
let r = K.coreManagerNamespaces(), i = await q(e, (e) => e.createProxy(r.coreManagerRpc).getPlugin(t));
|
|
1378
|
+
if (i) return Qt.set(t, i.id), i.id;
|
|
1379
|
+
}
|
|
1380
|
+
function tn(e) {
|
|
1381
|
+
let t = c(), n = l(!1), r = l();
|
|
1382
|
+
async function i() {
|
|
1383
|
+
n.value = !0, r.value = void 0;
|
|
1384
|
+
try {
|
|
1385
|
+
return t.value = await e.getConfig(), t.value;
|
|
1386
|
+
} catch (e) {
|
|
1387
|
+
r.value = e instanceof Error ? e : Error(String(e));
|
|
1388
|
+
return;
|
|
1389
|
+
} finally {
|
|
1390
|
+
n.value = !1;
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
async function a(t, a) {
|
|
1394
|
+
n.value = !0, r.value = void 0;
|
|
1395
|
+
try {
|
|
1396
|
+
await e.setValue(t, a), await i();
|
|
1397
|
+
} catch (e) {
|
|
1398
|
+
throw r.value = e instanceof Error ? e : Error(String(e)), e;
|
|
1399
|
+
} finally {
|
|
1400
|
+
n.value = !1;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
async function o(t) {
|
|
1404
|
+
n.value = !0, r.value = void 0;
|
|
1405
|
+
try {
|
|
1406
|
+
await e.setConfig(t), await i();
|
|
1407
|
+
} catch (e) {
|
|
1408
|
+
throw r.value = e instanceof Error ? e : Error(String(e)), e;
|
|
1409
|
+
} finally {
|
|
1410
|
+
n.value = !1;
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
async function s(t, a) {
|
|
1414
|
+
n.value = !0, r.value = void 0;
|
|
1415
|
+
try {
|
|
1416
|
+
let n = await e.submitValue(t, a);
|
|
1417
|
+
return (!n?.toast || n.toast.type !== "error") && await i(), n;
|
|
1418
|
+
} catch (e) {
|
|
1419
|
+
throw r.value = e instanceof Error ? e : Error(String(e)), e;
|
|
1420
|
+
} finally {
|
|
1421
|
+
n.value = !1;
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
return {
|
|
1425
|
+
proxy: e,
|
|
1426
|
+
config: t,
|
|
1427
|
+
isLoading: n,
|
|
1428
|
+
error: r,
|
|
1429
|
+
getConfig: i,
|
|
1430
|
+
setValue: a,
|
|
1431
|
+
setConfig: o,
|
|
1432
|
+
submitValue: s
|
|
1433
|
+
};
|
|
1434
|
+
}
|
|
1435
|
+
var nn = Se({ releaseDelay: 1e3 });
|
|
1436
|
+
function rn(e) {
|
|
1437
|
+
return `plugin:${e}`;
|
|
1438
|
+
}
|
|
1439
|
+
function an(e, t) {
|
|
1440
|
+
return `plugin:${e}:camera:${t}`;
|
|
1441
|
+
}
|
|
1442
|
+
function on(e, t) {
|
|
1443
|
+
return `plugin:${e}:sensor:${t}`;
|
|
1444
|
+
}
|
|
1445
|
+
function sn(e, t) {
|
|
1446
|
+
return nn.acquire(e, () => tn(t()));
|
|
1447
|
+
}
|
|
1448
|
+
function cn(e) {
|
|
1449
|
+
nn.release(e);
|
|
1450
|
+
}
|
|
1451
|
+
function ln() {
|
|
1452
|
+
nn.clear(), $t();
|
|
1453
|
+
}
|
|
1454
|
+
function un() {
|
|
1455
|
+
return {
|
|
1456
|
+
currentStorageKey: void 0,
|
|
1457
|
+
cachedStorage: void 0
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1460
|
+
function dn(e, t, n) {
|
|
1461
|
+
e.currentStorageKey &&= (cn(e.currentStorageKey), void 0), t.value = !1, e.cachedStorage = void 0, n.value = void 0;
|
|
1462
|
+
}
|
|
1463
|
+
var fn = [
|
|
1464
|
+
2e3,
|
|
1465
|
+
5e3,
|
|
1466
|
+
1e4,
|
|
1467
|
+
15e3
|
|
1468
|
+
];
|
|
1469
|
+
function pn(e) {
|
|
1470
|
+
return new Promise((t) => setTimeout(t, e));
|
|
1471
|
+
}
|
|
1472
|
+
function mn(e, t, n, r) {
|
|
1473
|
+
let i, a;
|
|
1474
|
+
function o() {
|
|
1475
|
+
if (!i || a !== e.cachedStorage) {
|
|
1476
|
+
a = e.cachedStorage;
|
|
1477
|
+
let t = s().finally(() => {
|
|
1478
|
+
i === t && (i = void 0, a = void 0);
|
|
1479
|
+
});
|
|
1480
|
+
i = t;
|
|
1481
|
+
}
|
|
1482
|
+
return i;
|
|
1483
|
+
}
|
|
1484
|
+
async function s() {
|
|
1485
|
+
let i = e.cachedStorage;
|
|
1486
|
+
if (i) {
|
|
1487
|
+
n.value = !0;
|
|
1488
|
+
try {
|
|
1489
|
+
let n = await i.getConfig();
|
|
1490
|
+
for (let t of fn) {
|
|
1491
|
+
if (!i.error.value || e.cachedStorage !== i || (await pn(t), e.cachedStorage !== i)) break;
|
|
1492
|
+
n = await i.getConfig();
|
|
1493
|
+
}
|
|
1494
|
+
return e.cachedStorage === i ? (t.value = i.config.value, r.value = i.error.value, n) : n;
|
|
1495
|
+
} finally {
|
|
1496
|
+
n.value = !1;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
async function c(i, a) {
|
|
1501
|
+
let o = e.cachedStorage;
|
|
1502
|
+
if (!o) throw Error("Storage not connected");
|
|
1503
|
+
n.value = !0, r.value = void 0;
|
|
1504
|
+
try {
|
|
1505
|
+
await o.setValue(i, a), e.cachedStorage === o && (t.value = o.config.value);
|
|
1506
|
+
} catch (e) {
|
|
1507
|
+
throw r.value = e instanceof Error ? e : Error(String(e)), e;
|
|
1508
|
+
} finally {
|
|
1509
|
+
n.value = !1;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
async function l(i) {
|
|
1513
|
+
let a = e.cachedStorage;
|
|
1514
|
+
if (!a) throw Error("Storage not connected");
|
|
1515
|
+
n.value = !0, r.value = void 0;
|
|
1516
|
+
try {
|
|
1517
|
+
await a.setConfig(i), e.cachedStorage === a && (t.value = a.config.value);
|
|
1518
|
+
} catch (e) {
|
|
1519
|
+
throw r.value = e instanceof Error ? e : Error(String(e)), e;
|
|
1520
|
+
} finally {
|
|
1521
|
+
n.value = !1;
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
async function u(i, a) {
|
|
1525
|
+
let o = e.cachedStorage;
|
|
1526
|
+
if (!o) throw Error("Storage not connected");
|
|
1527
|
+
n.value = !0, r.value = void 0;
|
|
1528
|
+
try {
|
|
1529
|
+
let n = await o.submitValue(i, a);
|
|
1530
|
+
return e.cachedStorage === o && (t.value = o.config.value), n;
|
|
1531
|
+
} catch (e) {
|
|
1532
|
+
throw r.value = e instanceof Error ? e : Error(String(e)), e;
|
|
1533
|
+
} finally {
|
|
1534
|
+
n.value = !1;
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
return {
|
|
1538
|
+
getConfig: o,
|
|
1539
|
+
setValue: c,
|
|
1540
|
+
setConfig: l,
|
|
1541
|
+
submitValue: u
|
|
1542
|
+
};
|
|
1543
|
+
}
|
|
1544
|
+
function hn(e) {
|
|
1545
|
+
let { rpc: t, isConnected: r } = G(), i = c(), a = l(!1), u = l(!1), f = l(), p = l(!1), m = un(), h = mn(m, i, a, f);
|
|
1546
|
+
async function g(e) {
|
|
1547
|
+
if (!t.value || !r.value) return !1;
|
|
1548
|
+
try {
|
|
1549
|
+
let n = await en(t, e);
|
|
1550
|
+
if (!n) throw Error(`Plugin "${e}" not found`);
|
|
1551
|
+
let r = rn(n);
|
|
1552
|
+
return m.currentStorageKey && m.currentStorageKey !== r && cn(m.currentStorageKey), m.currentStorageKey = r, m.cachedStorage = sn(r, () => {
|
|
1553
|
+
let e = K.pluginNamespaces(n);
|
|
1554
|
+
return t.value.createProxy(e.pluginStorageRpc);
|
|
1555
|
+
}), p.value = !0, !0;
|
|
1556
|
+
} catch (e) {
|
|
1557
|
+
return f.value = e instanceof Error ? e : Error(String(e)), p.value = !1, !1;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
async function _() {
|
|
1561
|
+
if (!m.cachedStorage) {
|
|
1562
|
+
let t = n(e);
|
|
1563
|
+
if (!t || !await g(t)) return;
|
|
1564
|
+
}
|
|
1565
|
+
return h.getConfig();
|
|
1566
|
+
}
|
|
1567
|
+
return s([r, () => n(e)], async ([e, t]) => {
|
|
1568
|
+
e && t ? (await g(t), h.getConfig()) : dn(m, p, i), u.value = !0;
|
|
1569
|
+
}, { immediate: !0 }), d(() => dn(m, p, i)), {
|
|
1570
|
+
config: i,
|
|
1571
|
+
isLoading: o(() => a.value || !u.value),
|
|
1572
|
+
error: f,
|
|
1573
|
+
isConnected: p,
|
|
1574
|
+
getConfig: _,
|
|
1575
|
+
setValue: h.setValue,
|
|
1576
|
+
setConfig: h.setConfig,
|
|
1577
|
+
submitValue: h.submitValue
|
|
1578
|
+
};
|
|
1579
|
+
}
|
|
1580
|
+
function gn(e, t) {
|
|
1581
|
+
let { rpc: r, isConnected: i } = G(), a = c(), u = l(!1), f = l(!1), p = l(), m = l(!1), h = un(), g = mn(h, a, u, p);
|
|
1582
|
+
async function _(e, t) {
|
|
1583
|
+
if (!r.value || !i.value) return !1;
|
|
1584
|
+
try {
|
|
1585
|
+
let n = await en(r, t);
|
|
1586
|
+
if (!n) throw Error(`Plugin "${t}" not found`);
|
|
1587
|
+
let i = an(n, e);
|
|
1588
|
+
return h.currentStorageKey && h.currentStorageKey !== i && cn(h.currentStorageKey), h.currentStorageKey = i, h.cachedStorage = sn(i, () => {
|
|
1589
|
+
let t = K.pluginCameraNamespaces(n, e);
|
|
1590
|
+
return r.value.createProxy(t.cameraStorageRpc);
|
|
1591
|
+
}), m.value = !0, !0;
|
|
1592
|
+
} catch (e) {
|
|
1593
|
+
return p.value = e instanceof Error ? e : Error(String(e)), m.value = !1, !1;
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
async function v() {
|
|
1597
|
+
let r = ht(n(e)), i = n(t);
|
|
1598
|
+
if (!(!r || !i) && !(!h.cachedStorage && !await _(r, i))) return g.getConfig();
|
|
1599
|
+
}
|
|
1600
|
+
return s([
|
|
1601
|
+
i,
|
|
1602
|
+
() => ht(n(e)),
|
|
1603
|
+
() => n(t)
|
|
1604
|
+
], async ([e, t, n]) => {
|
|
1605
|
+
e && t && n ? (await _(t, n), g.getConfig()) : dn(h, m, a), f.value = !0;
|
|
1606
|
+
}, { immediate: !0 }), d(() => dn(h, m, a)), {
|
|
1607
|
+
config: a,
|
|
1608
|
+
isLoading: o(() => u.value || !f.value),
|
|
1609
|
+
error: p,
|
|
1610
|
+
isConnected: m,
|
|
1611
|
+
getConfig: v,
|
|
1612
|
+
setValue: g.setValue,
|
|
1613
|
+
setConfig: g.setConfig,
|
|
1614
|
+
submitValue: g.submitValue
|
|
1615
|
+
};
|
|
1616
|
+
}
|
|
1617
|
+
function _n(e, t) {
|
|
1618
|
+
let { rpc: r, isConnected: i } = G(), a = c(), u = l(!1), f = l(!1), p = l(), m = l(!1), h = un(), g = mn(h, a, u, p);
|
|
1619
|
+
function _(e, t) {
|
|
1620
|
+
if (!r.value || !i.value) return !1;
|
|
1621
|
+
try {
|
|
1622
|
+
let n = on(t, e);
|
|
1623
|
+
return h.currentStorageKey && h.currentStorageKey !== n && cn(h.currentStorageKey), h.currentStorageKey = n, h.cachedStorage = sn(n, () => {
|
|
1624
|
+
let n = K.pluginSensorNamespaces(t, e);
|
|
1625
|
+
return r.value.createProxy(n.sensorStorageRpc);
|
|
1626
|
+
}), m.value = !0, !0;
|
|
1627
|
+
} catch (e) {
|
|
1628
|
+
return p.value = e instanceof Error ? e : Error(String(e)), m.value = !1, !1;
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
async function v() {
|
|
1632
|
+
let r = n(e), i = n(t);
|
|
1633
|
+
if (!(!r || !i) && !(!h.cachedStorage && !_(r, i))) return g.getConfig();
|
|
1634
|
+
}
|
|
1635
|
+
return s([
|
|
1636
|
+
i,
|
|
1637
|
+
() => n(e),
|
|
1638
|
+
() => n(t)
|
|
1639
|
+
], ([e, t, n]) => {
|
|
1640
|
+
e && t && n ? (_(t, n), g.getConfig()) : dn(h, m, a), f.value = !0;
|
|
1641
|
+
}, { immediate: !0 }), d(() => dn(h, m, a)), {
|
|
1642
|
+
config: a,
|
|
1643
|
+
isLoading: o(() => u.value || !f.value),
|
|
1644
|
+
error: p,
|
|
1645
|
+
isConnected: m,
|
|
1646
|
+
getConfig: v,
|
|
1647
|
+
setValue: g.setValue,
|
|
1648
|
+
setConfig: g.setConfig,
|
|
1649
|
+
submitValue: g.submitValue
|
|
1650
|
+
};
|
|
1651
|
+
}
|
|
1652
|
+
function vn() {
|
|
1653
|
+
ct(), Je(), ln(), Nt(), Ue();
|
|
1654
|
+
}
|
|
1655
|
+
function yn() {
|
|
1656
|
+
ct(), Ze(), Pt();
|
|
1657
|
+
}
|
|
1658
|
+
var bn = Symbol("camera-ui"), xn = new m("plugin");
|
|
1659
|
+
function Sn(e) {
|
|
1660
|
+
return "rpc" in e && "isConnected" in e;
|
|
1661
|
+
}
|
|
1662
|
+
var Cn = 4e3;
|
|
1663
|
+
function wn(e) {
|
|
1664
|
+
let { natsTransport: t, target: n, wsTransport: a } = e, s = t.getClient() !== null, u = t.getClient(), d = null, f = !1, p = c(t.getClient() ?? void 0), m = l(t.getClient()?.isConnected ?? !1), h = l(void 0), g = o(() => n.value?.endpoint.url), _ = o(() => n.value?.tokens.access), v = o(() => {
|
|
1665
|
+
let e = n.value;
|
|
1666
|
+
if (e?.tokens.proxySession) return { session: e.tokens.proxySession };
|
|
1667
|
+
}), y = /* @__PURE__ */ new Map();
|
|
1668
|
+
function b(e, t) {
|
|
1669
|
+
let n = y.get(e);
|
|
1670
|
+
n || (n = /* @__PURE__ */ new Set(), y.set(e, n)), n.add(t);
|
|
1671
|
+
}
|
|
1672
|
+
function x(e, t) {
|
|
1673
|
+
y.get(e)?.delete(t);
|
|
1674
|
+
}
|
|
1675
|
+
function S(e) {
|
|
1676
|
+
let t = y.get(e);
|
|
1677
|
+
if (t) for (let e of t) try {
|
|
1678
|
+
e();
|
|
1679
|
+
} catch (e) {
|
|
1680
|
+
xn.warn("context listener threw:", e);
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
return t.subscribeClient((e) => {
|
|
1684
|
+
if (e) {
|
|
1685
|
+
d !== null && (clearTimeout(d), d = null);
|
|
1686
|
+
let t = m.value, n = e !== u;
|
|
1687
|
+
u = e, p.value = e, m.value = !0, h.value = void 0, !t || n ? (yn(), s && S("reconnected"), s = !0) : f && s && S("reconnected"), f = !1;
|
|
1688
|
+
} else {
|
|
1689
|
+
if (f = !0, p.value = void 0, d !== null || !m.value) return;
|
|
1690
|
+
d = setTimeout(() => {
|
|
1691
|
+
d = null, m.value = !1, S("disconnected");
|
|
1692
|
+
}, Cn);
|
|
1693
|
+
}
|
|
1694
|
+
}), t.on("auth-error", (e) => {
|
|
1695
|
+
h.value = Error(e.message ?? "auth-error");
|
|
1696
|
+
}), t.on("down", (e) => {
|
|
1697
|
+
h.value ||= Error(e.reason);
|
|
1698
|
+
}), t.on("up", () => {
|
|
1699
|
+
h.value = void 0;
|
|
1700
|
+
}), r({
|
|
1701
|
+
rpc: p,
|
|
1702
|
+
target: i(n),
|
|
1703
|
+
isConnected: i(m),
|
|
1704
|
+
endpoint: g,
|
|
1705
|
+
token: _,
|
|
1706
|
+
extraProxyQuery: v,
|
|
1707
|
+
error: i(h),
|
|
1708
|
+
wsTransport: a,
|
|
1709
|
+
on: b,
|
|
1710
|
+
off: x
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
function Tn(e) {
|
|
1714
|
+
return { install(t) {
|
|
1715
|
+
let n = Sn(e) ? e : wn(e);
|
|
1716
|
+
t.provide(bn, n);
|
|
1717
|
+
} };
|
|
1718
|
+
}
|
|
1719
|
+
var En = {
|
|
1720
|
+
standbyTimeout: 5e3,
|
|
1721
|
+
activityTimeout: 5e3
|
|
1722
|
+
};
|
|
1723
|
+
function Dn(e) {
|
|
1724
|
+
let { initialMode: t = "always-on", config: n = {}, onStreamStart: r, onStreamStop: i, isStreamPlaying: a } = e, o = {
|
|
1725
|
+
...En,
|
|
1726
|
+
...n
|
|
1727
|
+
}, s = l(t), c = l(!1), u = l(!1), d, f;
|
|
1728
|
+
function p() {
|
|
1729
|
+
d &&= (clearTimeout(d), void 0);
|
|
1730
|
+
}
|
|
1731
|
+
function m() {
|
|
1732
|
+
f &&= (clearTimeout(f), void 0);
|
|
1733
|
+
}
|
|
1734
|
+
function h() {
|
|
1735
|
+
p(), m();
|
|
1736
|
+
}
|
|
1737
|
+
function g() {
|
|
1738
|
+
c.value || (c.value = !0, i());
|
|
1739
|
+
}
|
|
1740
|
+
function _() {
|
|
1741
|
+
c.value && (c.value = !1, r());
|
|
1742
|
+
}
|
|
1743
|
+
function v() {
|
|
1744
|
+
switch (h(), s.value) {
|
|
1745
|
+
case "always-on":
|
|
1746
|
+
c.value = !1, a() || r();
|
|
1747
|
+
break;
|
|
1748
|
+
case "standby":
|
|
1749
|
+
c.value || (a() || r(), y());
|
|
1750
|
+
break;
|
|
1751
|
+
case "activity": u.value ? (c.value = !1, a() || r()) : d = setTimeout(() => {
|
|
1752
|
+
s.value === "activity" && !u.value && g();
|
|
1753
|
+
}, o.activityTimeout);
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
function y() {
|
|
1757
|
+
m(), f = setTimeout(() => {
|
|
1758
|
+
s.value === "standby" && g();
|
|
1759
|
+
}, o.standbyTimeout);
|
|
1760
|
+
}
|
|
1761
|
+
function b(e) {
|
|
1762
|
+
s.value !== e && (s.value = e, v());
|
|
1763
|
+
}
|
|
1764
|
+
function x(e) {
|
|
1765
|
+
s.value === "activity" && (e ? (u.value = !0, p(), (c.value || !a()) && _()) : (u.value = !1, p(), d = setTimeout(() => {
|
|
1766
|
+
u.value || g();
|
|
1767
|
+
}, o.activityTimeout)));
|
|
1768
|
+
}
|
|
1769
|
+
function S() {
|
|
1770
|
+
if (c.value) switch (_(), s.value) {
|
|
1771
|
+
case "standby":
|
|
1772
|
+
y();
|
|
1773
|
+
break;
|
|
1774
|
+
case "activity": p(), u.value || (d = setTimeout(() => {
|
|
1775
|
+
g();
|
|
1776
|
+
}, o.activityTimeout));
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
function C() {
|
|
1780
|
+
s.value === "standby" && !c.value && y();
|
|
1781
|
+
}
|
|
1782
|
+
function ee() {
|
|
1783
|
+
h();
|
|
1784
|
+
}
|
|
1785
|
+
return {
|
|
1786
|
+
mode: s,
|
|
1787
|
+
inStandby: c,
|
|
1788
|
+
hasActivity: u,
|
|
1789
|
+
setMode: b,
|
|
1790
|
+
reportActivity: x,
|
|
1791
|
+
resumeFromStandby: S,
|
|
1792
|
+
resetIdleTimer: C,
|
|
1793
|
+
dispose: ee
|
|
1794
|
+
};
|
|
1795
|
+
}
|
|
1796
|
+
var On = 3e4, kn = new m("TabVisibility"), An = l(typeof document > "u" || document.visibilityState === "visible"), jn = null, Mn = /* @__PURE__ */ new Set(), Nn = /* @__PURE__ */ new Set(), Pn = /* @__PURE__ */ new Set(), Fn = !1;
|
|
1797
|
+
function In(e) {
|
|
1798
|
+
kn.debug(`paused listener fired (delay ${e.delayMs}ms reached)`);
|
|
1799
|
+
try {
|
|
1800
|
+
e.cb();
|
|
1801
|
+
} catch (e) {
|
|
1802
|
+
kn.error("onTabPaused listener threw:", e);
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
function Ln(e) {
|
|
1806
|
+
kn.debug(`paused listener scheduled in ${e.delayMs}ms`), e.timer = setTimeout(() => {
|
|
1807
|
+
if (e.timer = null, An.value) {
|
|
1808
|
+
kn.debug("paused listener skipped — tab visible before delay");
|
|
1809
|
+
return;
|
|
1810
|
+
}
|
|
1811
|
+
In(e);
|
|
1812
|
+
}, e.delayMs);
|
|
1813
|
+
}
|
|
1814
|
+
function Rn() {
|
|
1815
|
+
for (let e of Nn) e.timer !== null && (clearTimeout(e.timer), e.timer = null);
|
|
1816
|
+
}
|
|
1817
|
+
function zn() {
|
|
1818
|
+
Fn || typeof document > "u" || (Fn = !0, document.addEventListener("visibilitychange", () => {
|
|
1819
|
+
let e = document.visibilityState === "visible";
|
|
1820
|
+
if (!e && An.value) {
|
|
1821
|
+
An.value = !1, jn = Date.now(), kn.debug(`tab → hidden (hidden=${Mn.size} paused=${Nn.size})`);
|
|
1822
|
+
for (let e of Mn) try {
|
|
1823
|
+
e.cb();
|
|
1824
|
+
} catch (e) {
|
|
1825
|
+
kn.error("onTabHidden listener threw:", e);
|
|
1826
|
+
}
|
|
1827
|
+
for (let e of Nn) Ln(e);
|
|
1828
|
+
} else if (e && !An.value) {
|
|
1829
|
+
Rn();
|
|
1830
|
+
let e = jn == null ? 0 : Date.now() - jn;
|
|
1831
|
+
jn = null, An.value = !0, kn.debug(`tab → visible (hiddenMs=${e}, visible-listeners=${Pn.size})`);
|
|
1832
|
+
for (let { cb: t } of Pn) try {
|
|
1833
|
+
t({ hiddenMs: e });
|
|
1834
|
+
} catch (e) {
|
|
1835
|
+
kn.error("onTabVisible listener threw:", e);
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
}));
|
|
1839
|
+
}
|
|
1840
|
+
function Bn() {
|
|
1841
|
+
zn();
|
|
1842
|
+
let e = o(() => An.value);
|
|
1843
|
+
function t(e) {
|
|
1844
|
+
let t = { cb: e };
|
|
1845
|
+
Mn.add(t);
|
|
1846
|
+
let n = () => {
|
|
1847
|
+
Mn.delete(t);
|
|
1848
|
+
};
|
|
1849
|
+
return d(n), n;
|
|
1850
|
+
}
|
|
1851
|
+
function n(e, t = {}) {
|
|
1852
|
+
let n = {
|
|
1853
|
+
cb: e,
|
|
1854
|
+
delayMs: t.delayMs ?? On,
|
|
1855
|
+
timer: null
|
|
1856
|
+
};
|
|
1857
|
+
Nn.add(n);
|
|
1858
|
+
let r = () => {
|
|
1859
|
+
n.timer !== null && (clearTimeout(n.timer), n.timer = null), Nn.delete(n);
|
|
1860
|
+
};
|
|
1861
|
+
return d(r), r;
|
|
1862
|
+
}
|
|
1863
|
+
function r(e) {
|
|
1864
|
+
let t = { cb: e };
|
|
1865
|
+
Pn.add(t);
|
|
1866
|
+
let n = () => {
|
|
1867
|
+
Pn.delete(t);
|
|
1868
|
+
};
|
|
1869
|
+
return d(n), n;
|
|
1870
|
+
}
|
|
1871
|
+
return {
|
|
1872
|
+
isVisible: e,
|
|
1873
|
+
onTabHidden: t,
|
|
1874
|
+
onTabPaused: n,
|
|
1875
|
+
onTabVisible: r
|
|
1876
|
+
};
|
|
1877
|
+
}
|
|
1878
|
+
var Z = {
|
|
1879
|
+
WEBRTC: {
|
|
1880
|
+
RECONNECT_DELAY: 1e3,
|
|
1881
|
+
CONNECT_TIMEOUT: 1e4,
|
|
1882
|
+
WS_CONNECT_TIMEOUT: 5e3,
|
|
1883
|
+
ICE_SERVERS: [{ urls: "stun:stun.l.google.com:19302" }]
|
|
1884
|
+
},
|
|
1885
|
+
MSE: {
|
|
1886
|
+
BUFFER_SIZE: 2097152,
|
|
1887
|
+
BUFFER_WINDOW: 5
|
|
1888
|
+
},
|
|
1889
|
+
CODECS: {
|
|
1890
|
+
DEFAULT: [
|
|
1891
|
+
"avc1.640029",
|
|
1892
|
+
"avc1.64002A",
|
|
1893
|
+
"avc1.640033",
|
|
1894
|
+
"hvc1.1.6.L153.B0",
|
|
1895
|
+
"mp4a.40.2",
|
|
1896
|
+
"mp4a.40.5",
|
|
1897
|
+
"flac",
|
|
1898
|
+
"opus"
|
|
1899
|
+
],
|
|
1900
|
+
WEBRTC_VIDEO: [
|
|
1901
|
+
"H264",
|
|
1902
|
+
"VP8",
|
|
1903
|
+
"VP9"
|
|
1904
|
+
],
|
|
1905
|
+
WEBRTC_AUDIO: [
|
|
1906
|
+
"opus",
|
|
1907
|
+
"G722",
|
|
1908
|
+
"PCMU",
|
|
1909
|
+
"PCMA"
|
|
1910
|
+
]
|
|
1911
|
+
}
|
|
1912
|
+
}, Vn = "hvc1.1.6.L153.B0";
|
|
1913
|
+
function Hn() {
|
|
1914
|
+
return navigator.userAgent.match(/version\/(\d+)/i);
|
|
1915
|
+
}
|
|
1916
|
+
function Un() {
|
|
1917
|
+
let e = [...Z.CODECS.DEFAULT], t = Hn();
|
|
1918
|
+
if (t?.[1]) {
|
|
1919
|
+
let n = parseInt(t[1], 10);
|
|
1920
|
+
if (n < 13) {
|
|
1921
|
+
let t = e.indexOf("mp4a.40.2");
|
|
1922
|
+
t > -1 && e.splice(t);
|
|
1923
|
+
} else if (n < 14) {
|
|
1924
|
+
let t = e.indexOf("flac");
|
|
1925
|
+
t > -1 && e.splice(t);
|
|
1926
|
+
} else {
|
|
1927
|
+
let t = e.indexOf("opus");
|
|
1928
|
+
t > -1 && e.splice(t);
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
return e;
|
|
1932
|
+
}
|
|
1933
|
+
function Wn(e, t) {
|
|
1934
|
+
return e.filter((e) => t(`video/mp4; codecs="${e}"`)).join(",");
|
|
1935
|
+
}
|
|
1936
|
+
function Gn(e) {
|
|
1937
|
+
return Z.CODECS.WEBRTC_AUDIO.includes(e);
|
|
1938
|
+
}
|
|
1939
|
+
function Kn(e) {
|
|
1940
|
+
return Z.CODECS.WEBRTC_VIDEO.includes(e) ? !0 : e === "H265" && Zn();
|
|
1941
|
+
}
|
|
1942
|
+
var qn, Jn;
|
|
1943
|
+
function Yn(e) {
|
|
1944
|
+
if (e === "auto") return Yn("webrtc") || Yn("mse");
|
|
1945
|
+
if (e === "mse") return qn === void 0 && (qn = !!er()?.isTypeSupported(`video/mp4; codecs="${Vn}"`)), qn;
|
|
1946
|
+
if (Jn === void 0) try {
|
|
1947
|
+
Jn = !!(RTCRtpReceiver?.getCapabilities("video")?.codecs)?.some((e) => e.mimeType.toLowerCase().includes("h265") || e.mimeType.toLowerCase().includes("hevc"));
|
|
1948
|
+
} catch {
|
|
1949
|
+
Jn = !1;
|
|
1950
|
+
}
|
|
1951
|
+
return Jn;
|
|
1952
|
+
}
|
|
1953
|
+
function Xn(e) {
|
|
1954
|
+
e === "mse" ? qn = !1 : Jn = !1;
|
|
1955
|
+
}
|
|
1956
|
+
function Zn() {
|
|
1957
|
+
return Yn("webrtc");
|
|
1958
|
+
}
|
|
1959
|
+
function Qn(e) {
|
|
1960
|
+
let t = e.audio.filter((e) => e.direction === "sendonly"), n = e.video.filter((e) => e.direction === "sendonly"), r = t.length === 0 || t.some((e) => Gn(e.codec)), i = n.length === 0 || n.some((e) => Kn(e.codec)), a = [];
|
|
1961
|
+
return r || a.push(...t.map((e) => e.codec)), i || a.push(...n.map((e) => e.codec)), {
|
|
1962
|
+
compatible: r && i,
|
|
1963
|
+
audioCompatible: r,
|
|
1964
|
+
videoCompatible: i,
|
|
1965
|
+
incompatibleCodecs: a
|
|
1966
|
+
};
|
|
1967
|
+
}
|
|
1968
|
+
function $n() {
|
|
1969
|
+
return "ManagedMediaSource" in window;
|
|
1970
|
+
}
|
|
1971
|
+
function er() {
|
|
1972
|
+
if ($n()) return window.ManagedMediaSource;
|
|
1973
|
+
if ("MediaSource" in window) return window.MediaSource;
|
|
1974
|
+
}
|
|
1975
|
+
function tr(e, t) {
|
|
1976
|
+
return new Promise((n, r) => {
|
|
1977
|
+
if (t.aborted) {
|
|
1978
|
+
r(new DOMException("Aborted", "AbortError"));
|
|
1979
|
+
return;
|
|
1980
|
+
}
|
|
1981
|
+
let i = setTimeout(n, e);
|
|
1982
|
+
t.addEventListener("abort", () => {
|
|
1983
|
+
clearTimeout(i), r(new DOMException("Aborted", "AbortError"));
|
|
1984
|
+
}, { once: !0 });
|
|
1985
|
+
});
|
|
1986
|
+
}
|
|
1987
|
+
function nr(e) {
|
|
1988
|
+
let { videoElement: t, onReady: n, onFirstData: r, onError: i, signal: a } = e, o = null, s = null, c = null, l = !1, u = !1, d = new Uint8Array(Z.MSE.BUFFER_SIZE), f = 0, p = [], m = Un();
|
|
1989
|
+
function h() {
|
|
1990
|
+
if (a.aborted) return;
|
|
1991
|
+
let e = er();
|
|
1992
|
+
if (!e) {
|
|
1993
|
+
i(/* @__PURE__ */ Error("MediaSource not supported"));
|
|
1994
|
+
return;
|
|
1995
|
+
}
|
|
1996
|
+
o = new e();
|
|
1997
|
+
let n = $n(), r = t.src;
|
|
1998
|
+
return o.addEventListener("sourceopen", () => {
|
|
1999
|
+
a.aborted || !n && r && r.startsWith("blob:") && r !== t.src && URL.revokeObjectURL(r);
|
|
2000
|
+
}, { once: !0 }), n ? (t.disableRemotePlayback = !0, t.srcObject = o) : (c = URL.createObjectURL(o), t.src = c, t.srcObject = null), Wn(m, e.isTypeSupported.bind(e));
|
|
2001
|
+
}
|
|
2002
|
+
function g(e) {
|
|
2003
|
+
if (a.aborted || !o) return;
|
|
2004
|
+
if (o.readyState !== "open") {
|
|
2005
|
+
o.addEventListener("sourceopen", () => {
|
|
2006
|
+
a.aborted || g(e);
|
|
2007
|
+
}, { once: !0 });
|
|
2008
|
+
return;
|
|
2009
|
+
}
|
|
2010
|
+
f = 0, d = new Uint8Array(Z.MSE.BUFFER_SIZE);
|
|
2011
|
+
let t = er();
|
|
2012
|
+
if (t && !t.isTypeSupported(e)) {
|
|
2013
|
+
i(/* @__PURE__ */ Error(`MIME type not supported: ${e}`));
|
|
2014
|
+
return;
|
|
2015
|
+
}
|
|
2016
|
+
try {
|
|
2017
|
+
if (s = o.addSourceBuffer(e), s.mode = "segments", s.addEventListener("updateend", _), l = !0, p.length > 0) {
|
|
2018
|
+
for (let e of p) v(e);
|
|
2019
|
+
p.length = 0;
|
|
2020
|
+
}
|
|
2021
|
+
n();
|
|
2022
|
+
} catch (e) {
|
|
2023
|
+
i(e instanceof Error ? e : Error(String(e)));
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
function _() {
|
|
2027
|
+
if (!(a.aborted || !s || !o)) {
|
|
2028
|
+
if (!s.updating && f > 0) try {
|
|
2029
|
+
let e = d.slice(0, f);
|
|
2030
|
+
s.appendBuffer(e), f = 0;
|
|
2031
|
+
} catch (e) {
|
|
2032
|
+
y(e) || i(e instanceof Error ? e : Error(String(e)));
|
|
2033
|
+
}
|
|
2034
|
+
if (!s.updating && s.buffered?.length) {
|
|
2035
|
+
let e = s.buffered.end(s.buffered.length - 1), n = e - Z.MSE.BUFFER_WINDOW, i = s.buffered.start(0);
|
|
2036
|
+
if (u || (u = !0, r()), n > i) try {
|
|
2037
|
+
s.remove(i, n), o.setLiveSeekableRange(n, e);
|
|
2038
|
+
} catch {}
|
|
2039
|
+
t.currentTime < n && (t.currentTime = n);
|
|
2040
|
+
let a = e - t.currentTime;
|
|
2041
|
+
a > 1 ? t.playbackRate = 1.1 : a < .1 ? t.playbackRate = .9 : t.playbackRate = 1;
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
function v(e) {
|
|
2046
|
+
if (!a.aborted) {
|
|
2047
|
+
if (!s) {
|
|
2048
|
+
p.push(e);
|
|
2049
|
+
return;
|
|
2050
|
+
}
|
|
2051
|
+
if (o?.readyState === "closed") {
|
|
2052
|
+
i(/* @__PURE__ */ Error("MediaSource closed"));
|
|
2053
|
+
return;
|
|
2054
|
+
}
|
|
2055
|
+
if (s.updating || f > 0) {
|
|
2056
|
+
let t = new Uint8Array(e);
|
|
2057
|
+
if (f + t.byteLength > d.byteLength) {
|
|
2058
|
+
f = 0, i(/* @__PURE__ */ Error("MSE pending buffer overflow"));
|
|
2059
|
+
return;
|
|
2060
|
+
}
|
|
2061
|
+
d.set(t, f), f += t.byteLength;
|
|
2062
|
+
} else try {
|
|
2063
|
+
s.appendBuffer(e);
|
|
2064
|
+
} catch (t) {
|
|
2065
|
+
if (y(t)) {
|
|
2066
|
+
let t = new Uint8Array(e);
|
|
2067
|
+
t.byteLength <= d.byteLength && (d.set(t, 0), f = t.byteLength);
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
function y(e) {
|
|
2073
|
+
if (e?.name !== "QuotaExceededError" || !s || s.updating || !s.buffered?.length) return !1;
|
|
2074
|
+
try {
|
|
2075
|
+
let e = s.buffered.start(0), t = s.buffered.end(s.buffered.length - 1), n = Math.max(e + 1, t - Z.MSE.BUFFER_WINDOW);
|
|
2076
|
+
return n <= e ? !1 : (s.remove(e, n), !0);
|
|
2077
|
+
} catch {
|
|
2078
|
+
return !1;
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
function b() {
|
|
2082
|
+
if (s) {
|
|
2083
|
+
if (s.removeEventListener("updateend", _), o?.readyState === "open") try {
|
|
2084
|
+
o.removeSourceBuffer(s);
|
|
2085
|
+
} catch {}
|
|
2086
|
+
s = null;
|
|
2087
|
+
}
|
|
2088
|
+
if (o?.readyState === "open") try {
|
|
2089
|
+
o.endOfStream();
|
|
2090
|
+
} catch {}
|
|
2091
|
+
o = null, c &&= (URL.revokeObjectURL(c), null), l = !1, u = !1, f = 0, p.length = 0;
|
|
2092
|
+
}
|
|
2093
|
+
return a.addEventListener("abort", b, { once: !0 }), {
|
|
2094
|
+
get mediaSource() {
|
|
2095
|
+
return o;
|
|
2096
|
+
},
|
|
2097
|
+
get sourceBuffer() {
|
|
2098
|
+
return s;
|
|
2099
|
+
},
|
|
2100
|
+
get isReady() {
|
|
2101
|
+
return l;
|
|
2102
|
+
},
|
|
2103
|
+
setup: h,
|
|
2104
|
+
initializeBuffer: g,
|
|
2105
|
+
appendBuffer: v,
|
|
2106
|
+
close: b
|
|
2107
|
+
};
|
|
2108
|
+
}
|
|
2109
|
+
async function rr(e) {
|
|
2110
|
+
try {
|
|
2111
|
+
await e.play();
|
|
2112
|
+
} catch {
|
|
2113
|
+
e.muted || (e.muted = !0, await rr(e));
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
function ir(e, t, n) {
|
|
2117
|
+
let r = new RTCPeerConnection({
|
|
2118
|
+
bundlePolicy: "max-bundle",
|
|
2119
|
+
iceServers: [...Z.WEBRTC.ICE_SERVERS]
|
|
2120
|
+
});
|
|
2121
|
+
return r.onicecandidate = (r) => {
|
|
2122
|
+
if (e.aborted || n && r.candidate?.protocol === "udp") return;
|
|
2123
|
+
let i = r.candidate?.toJSON().candidate ?? "";
|
|
2124
|
+
i && t(i);
|
|
2125
|
+
}, r;
|
|
2126
|
+
}
|
|
2127
|
+
async function ar(e, t, n) {
|
|
2128
|
+
t.aborted || !e || await e.setRemoteDescription({
|
|
2129
|
+
type: "answer",
|
|
2130
|
+
sdp: n
|
|
2131
|
+
});
|
|
2132
|
+
}
|
|
2133
|
+
async function or(e, t, n, r) {
|
|
2134
|
+
t.aborted || !e || r && n.includes(" udp ") || await e.addIceCandidate({
|
|
2135
|
+
candidate: n,
|
|
2136
|
+
sdpMid: "0"
|
|
2137
|
+
});
|
|
2138
|
+
}
|
|
2139
|
+
async function sr(e, t, n) {
|
|
2140
|
+
if (!(t.aborted || !e)) try {
|
|
2141
|
+
await e.sender.replaceTrack(n);
|
|
2142
|
+
} catch {}
|
|
2143
|
+
}
|
|
2144
|
+
function cr(e) {
|
|
2145
|
+
e.micTransceiver &&= (e.micTransceiver.sender.replaceTrack(null).catch(() => {}), null), e.pc &&= (e.pc.getTransceivers().forEach((e) => e.sender?.track?.stop()), e.pc.close(), null), e.isConnected = !1;
|
|
2146
|
+
}
|
|
2147
|
+
function lr(e) {
|
|
2148
|
+
let { mode: t, onConnected: n, onDisconnected: r, onFailed: i, onCandidate: a, signal: o } = e, s = {
|
|
2149
|
+
pc: null,
|
|
2150
|
+
micTransceiver: null,
|
|
2151
|
+
isConnected: !1
|
|
2152
|
+
}, c = t === "webrtc/tcp";
|
|
2153
|
+
function l() {
|
|
2154
|
+
let e = ir(o, a, c);
|
|
2155
|
+
return e.onconnectionstatechange = () => {
|
|
2156
|
+
if (o.aborted) return;
|
|
2157
|
+
let t = e.connectionState;
|
|
2158
|
+
if (t === "connected") {
|
|
2159
|
+
s.isConnected = !0;
|
|
2160
|
+
let t = new MediaStream(e.getTransceivers().filter((e) => e.currentDirection === "recvonly").map((e) => e.receiver.track));
|
|
2161
|
+
n(t);
|
|
2162
|
+
} else t === "failed" ? (s.isConnected = !1, i()) : t === "disconnected" && (s.isConnected = !1, r());
|
|
2163
|
+
}, e.addTransceiver("video", { direction: "recvonly" }), e.addTransceiver("audio", { direction: "recvonly" }), s.micTransceiver = e.addTransceiver("audio", { direction: "sendonly" }), e;
|
|
2164
|
+
}
|
|
2165
|
+
async function u() {
|
|
2166
|
+
if (o.aborted) return;
|
|
2167
|
+
s.pc = l();
|
|
2168
|
+
let e = await s.pc.createOffer();
|
|
2169
|
+
return await s.pc.setLocalDescription(e), e.sdp;
|
|
2170
|
+
}
|
|
2171
|
+
function d() {
|
|
2172
|
+
cr(s);
|
|
2173
|
+
}
|
|
2174
|
+
return o.addEventListener("abort", d, { once: !0 }), {
|
|
2175
|
+
get pc() {
|
|
2176
|
+
return s.pc;
|
|
2177
|
+
},
|
|
2178
|
+
get micTransceiver() {
|
|
2179
|
+
return s.micTransceiver;
|
|
2180
|
+
},
|
|
2181
|
+
get isConnected() {
|
|
2182
|
+
return s.isConnected;
|
|
2183
|
+
},
|
|
2184
|
+
createOffer: u,
|
|
2185
|
+
handleAnswer: (e) => ar(s.pc, o, e),
|
|
2186
|
+
handleCandidate: (e) => or(s.pc, o, e, c),
|
|
2187
|
+
setMicrophoneTrack: (e) => sr(s.micTransceiver, o, e),
|
|
2188
|
+
close: d
|
|
2189
|
+
};
|
|
2190
|
+
}
|
|
2191
|
+
function ur(e) {
|
|
2192
|
+
let { onConnected: t, onDisconnected: n, onCandidate: r, signal: i } = e, a = {
|
|
2193
|
+
pc: null,
|
|
2194
|
+
micTransceiver: null,
|
|
2195
|
+
isConnected: !1
|
|
2196
|
+
};
|
|
2197
|
+
function o() {
|
|
2198
|
+
let e = ir(i, r, !1);
|
|
2199
|
+
return e.onconnectionstatechange = () => {
|
|
2200
|
+
if (i.aborted) return;
|
|
2201
|
+
let r = e.connectionState;
|
|
2202
|
+
r === "connected" ? (a.isConnected = !0, t()) : (r === "disconnected" || r === "failed") && (a.isConnected = !1, n());
|
|
2203
|
+
}, a.micTransceiver = e.addTransceiver("audio", { direction: "sendonly" }), e;
|
|
2204
|
+
}
|
|
2205
|
+
async function s() {
|
|
2206
|
+
if (i.aborted) return;
|
|
2207
|
+
a.pc = o();
|
|
2208
|
+
let e = await a.pc.createOffer();
|
|
2209
|
+
return await a.pc.setLocalDescription(e), e.sdp;
|
|
2210
|
+
}
|
|
2211
|
+
function c() {
|
|
2212
|
+
cr(a);
|
|
2213
|
+
}
|
|
2214
|
+
return i.addEventListener("abort", c, { once: !0 }), {
|
|
2215
|
+
get isConnected() {
|
|
2216
|
+
return a.isConnected;
|
|
2217
|
+
},
|
|
2218
|
+
createOffer: s,
|
|
2219
|
+
handleAnswer: (e) => ar(a.pc, i, e),
|
|
2220
|
+
handleCandidate: (e) => or(a.pc, i, e, !1),
|
|
2221
|
+
setMicrophoneTrack: (e) => sr(a.micTransceiver, i, e),
|
|
2222
|
+
close: c
|
|
2223
|
+
};
|
|
2224
|
+
}
|
|
2225
|
+
async function dr(e, t) {
|
|
2226
|
+
switch (t.type) {
|
|
2227
|
+
case "webrtc/answer":
|
|
2228
|
+
await e.handleAnswer(t.value);
|
|
2229
|
+
break;
|
|
2230
|
+
case "webrtc/candidate": t.value && await e.handleCandidate(t.value);
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
var Q = new m("StreamConnection"), fr = class {
|
|
2234
|
+
status;
|
|
2235
|
+
activeMode;
|
|
2236
|
+
requestedMode;
|
|
2237
|
+
activeResolution;
|
|
2238
|
+
requestedResolution;
|
|
2239
|
+
degradedFrom;
|
|
2240
|
+
degradeReason;
|
|
2241
|
+
source;
|
|
2242
|
+
hasVideo;
|
|
2243
|
+
hasAudio;
|
|
2244
|
+
hasBackchannel;
|
|
2245
|
+
isPlaying;
|
|
2246
|
+
error;
|
|
2247
|
+
probeInfo;
|
|
2248
|
+
muted;
|
|
2249
|
+
paused;
|
|
2250
|
+
nativeWidth;
|
|
2251
|
+
nativeHeight;
|
|
2252
|
+
camera;
|
|
2253
|
+
videoElement;
|
|
2254
|
+
containerElement;
|
|
2255
|
+
target;
|
|
2256
|
+
isReady;
|
|
2257
|
+
triedSourceIds = /* @__PURE__ */ new Set();
|
|
2258
|
+
options;
|
|
2259
|
+
wsTransport;
|
|
2260
|
+
scope = a(!0);
|
|
2261
|
+
connectionGeneration = 0;
|
|
2262
|
+
abortController = new AbortController();
|
|
2263
|
+
probedSourceId;
|
|
2264
|
+
wasPausedByVisibility = !1;
|
|
2265
|
+
wsHandle;
|
|
2266
|
+
webrtcHandler;
|
|
2267
|
+
mseHandler;
|
|
2268
|
+
firstFrameCallbackId;
|
|
2269
|
+
backchannelHandler;
|
|
2270
|
+
pendingMicTrack = null;
|
|
2271
|
+
lastMediaStream = null;
|
|
2272
|
+
stopWatchers = [];
|
|
2273
|
+
mseMonitorInterval;
|
|
2274
|
+
offTabVisible;
|
|
2275
|
+
offTabPaused;
|
|
2276
|
+
onVideoPauseBound;
|
|
2277
|
+
onVideoPlayBound;
|
|
2278
|
+
onVideoResizeBound;
|
|
2279
|
+
startWsConnectTimeout;
|
|
2280
|
+
stopWsConnectTimeout;
|
|
2281
|
+
startConnectTimeout;
|
|
2282
|
+
stopConnectTimeout;
|
|
2283
|
+
startMseConnectTimeout;
|
|
2284
|
+
stopMseConnectTimeout;
|
|
2285
|
+
startReconnectTimeout;
|
|
2286
|
+
stopReconnectTimeout;
|
|
2287
|
+
constructor(e) {
|
|
2288
|
+
this.options = e;
|
|
2289
|
+
let t = G();
|
|
2290
|
+
if (!t.wsTransport) throw Error("[camera.ui] StreamConnection requires a wsTransport on CameraUiContext — pass `wsTransport` to createCameraUiPlugin.");
|
|
2291
|
+
this.target = t.target, this.wsTransport = t.wsTransport;
|
|
2292
|
+
let { autoStart: r = !0 } = e;
|
|
2293
|
+
this.status = l("idle"), this.activeMode = l("webrtc"), this.activeResolution = l("low-resolution"), this.degradedFrom = l(null), this.degradeReason = l(null), this.source = c(), this.hasVideo = l(!1), this.hasAudio = l(!1), this.hasBackchannel = l(!1), this.isPlaying = l(!1), this.error = l(), this.probeInfo = c(), this.muted = l(!0), this.paused = l(!1), this.nativeWidth = l(0), this.nativeHeight = l(0), this.requestedMode = l(n(e.mode) ?? "auto"), this.requestedResolution = l(n(e.resolution) ?? "high-resolution"), this.camera = o(() => n(e.camera)), this.videoElement = o(() => n(e.videoElement)), this.containerElement = o(() => n(e.containerElement)), this.isReady = o(() => !!this.camera.value && !!this.videoElement.value && !!this.target.value), this.scope.run(() => {
|
|
2294
|
+
let { onTabPaused: e, onTabVisible: t } = Bn(), n = f(() => {
|
|
2295
|
+
this.wsHandle?.readyState === WebSocket.CONNECTING && (this.disconnectWebSocket(), !this.abortController.signal.aborted && this.status.value !== "closed" && this.restart());
|
|
2296
|
+
}, Z.WEBRTC.WS_CONNECT_TIMEOUT, { immediate: !1 }), i = f(() => {
|
|
2297
|
+
this.webrtcHandler && !this.webrtcHandler.isConnected ? this.requestedMode.value === "auto" ? (this.webrtcHandler.close(), this.webrtcHandler = void 0, this.activeMode.value = "mse", this.mseHandler?.isReady ? this.status.value = "connected" : this.startMSE()) : (this.markSourceUndecodable(), this.restart()) : this.status.value === "connected" && !this.isPlaying.value && !this.abortController.signal.aborted && this.handleNoFramesWhileConnected();
|
|
2298
|
+
}, Z.WEBRTC.CONNECT_TIMEOUT, { immediate: !1 }), a = f(() => {
|
|
2299
|
+
this.abortController.signal.aborted || this.status.value === "connected" || this.status.value === "closed" || this.mseHandler && !this.mseHandler.isReady && (this.markSourceUndecodable(), this.restart());
|
|
2300
|
+
}, Z.WEBRTC.CONNECT_TIMEOUT, { immediate: !1 }), o = f(() => {
|
|
2301
|
+
this.abortController.signal.aborted || this.restart();
|
|
2302
|
+
}, Z.WEBRTC.RECONNECT_DELAY, { immediate: !1 });
|
|
2303
|
+
this.startWsConnectTimeout = n.start, this.stopWsConnectTimeout = n.stop, this.startConnectTimeout = i.start, this.stopConnectTimeout = i.stop, this.startMseConnectTimeout = a.start, this.stopMseConnectTimeout = a.stop, this.startReconnectTimeout = o.start, this.stopReconnectTimeout = o.stop, this.setupWatchers(), this.offTabPaused = e(() => {
|
|
2304
|
+
if (Q.debug(`onTabPaused fired — status=${this.status.value}, isReady=${this.isReady.value}, target=${!!this.target.value}`), this.status.value === "idle" || this.status.value === "closed") {
|
|
2305
|
+
Q.debug(`onTabPaused — already in ${this.status.value}, skipping stop()`);
|
|
2306
|
+
return;
|
|
2307
|
+
}
|
|
2308
|
+
this.wasPausedByVisibility = !0, this.stop(), Q.debug("onTabPaused — stop() done, wasPausedByVisibility=true");
|
|
2309
|
+
}), this.offTabVisible = t(() => {
|
|
2310
|
+
if (Q.debug(`onTabVisible fired — wasPausedByVisibility=${this.wasPausedByVisibility}, status=${this.status.value}, isReady=${this.isReady.value}, target=${!!this.target.value}`), !this.wasPausedByVisibility) {
|
|
2311
|
+
Q.debug("onTabVisible — not paused by visibility, no-op");
|
|
2312
|
+
return;
|
|
2313
|
+
}
|
|
2314
|
+
this.wasPausedByVisibility = !1, this.startWhenReady();
|
|
2315
|
+
}), r && p(this.isReady, () => {
|
|
2316
|
+
(this.status.value === "idle" || this.status.value === "closed") && this.start();
|
|
2317
|
+
}, { immediate: !0 });
|
|
2318
|
+
});
|
|
2319
|
+
}
|
|
2320
|
+
async start() {
|
|
2321
|
+
if (Q.debug(`start() called — status=${this.status.value}, isReady=${this.isReady.value}`), this.status.value !== "idle" && this.status.value !== "closed") {
|
|
2322
|
+
Q.debug(`start() — skipped, status is ${this.status.value}`);
|
|
2323
|
+
return;
|
|
2324
|
+
}
|
|
2325
|
+
if (!this.isReady.value) {
|
|
2326
|
+
Q.debug("start() — skipped, isReady=false");
|
|
2327
|
+
return;
|
|
2328
|
+
}
|
|
2329
|
+
this.cleanup(), this.abortController = new AbortController();
|
|
2330
|
+
let e = ++this.connectionGeneration;
|
|
2331
|
+
this.triedSourceIds.clear(), this.status.value = "connecting", this.error.value = void 0, this.isPlaying.value = !1;
|
|
2332
|
+
try {
|
|
2333
|
+
let t = this.initializeSource();
|
|
2334
|
+
if (t === "unsupported") {
|
|
2335
|
+
Q.debug("start() — no source with a playable codec"), this.setUnsupported();
|
|
2336
|
+
return;
|
|
2337
|
+
}
|
|
2338
|
+
if (!t) {
|
|
2339
|
+
Q.debug("start() — no streaming source available"), this.error.value = /* @__PURE__ */ Error("No streaming source available"), this.status.value = "error";
|
|
2340
|
+
return;
|
|
2341
|
+
}
|
|
2342
|
+
for (let t = 0; t < 3; t++) {
|
|
2343
|
+
let t = this.source.value?._id, n = await this.probeStream();
|
|
2344
|
+
if (e !== this.connectionGeneration) {
|
|
2345
|
+
Q.debug("start() — generation stale after probe, aborting");
|
|
2346
|
+
return;
|
|
2347
|
+
}
|
|
2348
|
+
n && t && this.probeSaysUnplayable(n) && this.triedSourceIds.add(t);
|
|
2349
|
+
let r = this.initializeSource();
|
|
2350
|
+
if (r === "unsupported") {
|
|
2351
|
+
this.setUnsupported();
|
|
2352
|
+
return;
|
|
2353
|
+
}
|
|
2354
|
+
if (!r) {
|
|
2355
|
+
this.error.value = /* @__PURE__ */ Error("No streaming source available"), this.status.value = "error";
|
|
2356
|
+
return;
|
|
2357
|
+
}
|
|
2358
|
+
if (!n || this.source.value?._id === t) break;
|
|
2359
|
+
}
|
|
2360
|
+
Q.debug("start() — connecting WebSocket"), this.connectWebSocket();
|
|
2361
|
+
} catch (t) {
|
|
2362
|
+
if (e !== this.connectionGeneration) return;
|
|
2363
|
+
Q.debug("start() — error:", t), this.error.value = t instanceof Error ? t : Error(String(t)), this.status.value = "error";
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
stop() {
|
|
2367
|
+
if (this.status.value === "closed") {
|
|
2368
|
+
Q.debug("stop() — already closed, no-op");
|
|
2369
|
+
return;
|
|
2370
|
+
}
|
|
2371
|
+
Q.debug(`stop() — was ${this.status.value}, transitioning to closed`), ++this.connectionGeneration, this.status.value = "closed", this.cleanup();
|
|
2372
|
+
}
|
|
2373
|
+
async setMode(e) {
|
|
2374
|
+
if (this.requestedMode.value !== e) {
|
|
2375
|
+
if (this.requestedMode.value = e, this.activeMode.value = e === "auto" ? "webrtc" : e, this.status.value === "unsupported") {
|
|
2376
|
+
this.stop(), await this.start();
|
|
2377
|
+
return;
|
|
2378
|
+
}
|
|
2379
|
+
this.status.value === "connected" && await this.restart();
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
async setResolution(e) {
|
|
2383
|
+
if (this.requestedResolution.value === e) return;
|
|
2384
|
+
if (this.requestedResolution.value = e, this.status.value === "unsupported") {
|
|
2385
|
+
this.stop(), await this.start();
|
|
2386
|
+
return;
|
|
2387
|
+
}
|
|
2388
|
+
let t = this.getSourceForResolution(e);
|
|
2389
|
+
t && t !== "unsupported" && t.source._id !== this.source.value?._id && (this.source.value = t.source, this.activeResolution.value = t.effectiveResolution, this.degradedFrom.value = t.degradedFrom, this.degradeReason.value = t.degradedFrom ? "codec" : null, this.status.value === "connected" && await this.restart());
|
|
2390
|
+
}
|
|
2391
|
+
async setMicrophone(e) {
|
|
2392
|
+
if (this.webrtcHandler) {
|
|
2393
|
+
await this.webrtcHandler.setMicrophoneTrack(e);
|
|
2394
|
+
return;
|
|
2395
|
+
}
|
|
2396
|
+
this.activeMode.value === "mse" && this.hasBackchannel.value && (this.pendingMicTrack = e, e && !this.backchannelHandler ? await this.startBackchannel() : !e && this.backchannelHandler ? this.closeBackchannel() : this.backchannelHandler?.isConnected && await this.backchannelHandler.setMicrophoneTrack(e));
|
|
2397
|
+
}
|
|
2398
|
+
setMuted(e) {
|
|
2399
|
+
this.muted.value = e;
|
|
2400
|
+
let t = this.videoElement.value;
|
|
2401
|
+
t && (t.muted = e);
|
|
2402
|
+
}
|
|
2403
|
+
async play() {
|
|
2404
|
+
this.paused.value = !1;
|
|
2405
|
+
let e = this.videoElement.value;
|
|
2406
|
+
if (e) try {
|
|
2407
|
+
await e.play();
|
|
2408
|
+
} catch {
|
|
2409
|
+
if (!e.muted) {
|
|
2410
|
+
e.muted = !0, this.muted.value = !0;
|
|
2411
|
+
try {
|
|
2412
|
+
await e.play();
|
|
2413
|
+
} catch {}
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
pause() {
|
|
2418
|
+
this.paused.value = !0;
|
|
2419
|
+
let e = this.videoElement.value;
|
|
2420
|
+
e && e.pause();
|
|
2421
|
+
}
|
|
2422
|
+
destroy() {
|
|
2423
|
+
for (let e of this.stopWatchers) e();
|
|
2424
|
+
this.stopWatchers = [], this.offTabVisible?.(), this.offTabVisible = void 0, this.offTabPaused?.(), this.offTabPaused = void 0;
|
|
2425
|
+
let e = this.videoElement.value;
|
|
2426
|
+
e && (this.onVideoPauseBound && e.removeEventListener("pause", this.onVideoPauseBound), this.onVideoPlayBound && e.removeEventListener("play", this.onVideoPlayBound), this.onVideoResizeBound && e.removeEventListener("resize", this.onVideoResizeBound)), this.stop(), this.scope.stop();
|
|
2427
|
+
}
|
|
2428
|
+
async restart() {
|
|
2429
|
+
this.status.value = "reconnecting", this.isPlaying.value = !1, this.cleanup(), this.abortController = new AbortController();
|
|
2430
|
+
let e = ++this.connectionGeneration;
|
|
2431
|
+
try {
|
|
2432
|
+
await tr(1e3, this.abortController.signal);
|
|
2433
|
+
} catch {
|
|
2434
|
+
return;
|
|
2435
|
+
}
|
|
2436
|
+
if (e === this.connectionGeneration) {
|
|
2437
|
+
if (!this.isReady.value) {
|
|
2438
|
+
this.status.value = "idle";
|
|
2439
|
+
return;
|
|
2440
|
+
}
|
|
2441
|
+
try {
|
|
2442
|
+
let e = this.initializeSource();
|
|
2443
|
+
if (e === "unsupported") {
|
|
2444
|
+
this.setUnsupported();
|
|
2445
|
+
return;
|
|
2446
|
+
}
|
|
2447
|
+
if (!e) {
|
|
2448
|
+
this.error.value = /* @__PURE__ */ Error("No streaming source available"), this.status.value = "error";
|
|
2449
|
+
return;
|
|
2450
|
+
}
|
|
2451
|
+
this.connectWebSocket();
|
|
2452
|
+
} catch (t) {
|
|
2453
|
+
if (e !== this.connectionGeneration) return;
|
|
2454
|
+
this.error.value = t instanceof Error ? t : Error(String(t)), this.status.value = "error";
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
startWhenReady() {
|
|
2459
|
+
if (this.isReady.value) {
|
|
2460
|
+
Q.debug("startWhenReady — already ready, calling start() now"), this.start();
|
|
2461
|
+
return;
|
|
2462
|
+
}
|
|
2463
|
+
Q.debug(`startWhenReady — not ready (camera=${!!this.camera.value}, video=${!!this.videoElement.value}, target=${!!this.target.value}), watching isReady`);
|
|
2464
|
+
let e = s(this.isReady, (t) => {
|
|
2465
|
+
t && (Q.debug("startWhenReady — isReady → true, calling start()"), e(), this.start());
|
|
2466
|
+
});
|
|
2467
|
+
this.stopWatchers.push(e);
|
|
2468
|
+
}
|
|
2469
|
+
setupWatchers() {
|
|
2470
|
+
let e = s(() => this.target.value?.endpoint.url ?? null, (e, t) => {
|
|
2471
|
+
!e || !t || e === t || this.status.value !== "idle" && this.status.value !== "closed" && this.restart();
|
|
2472
|
+
});
|
|
2473
|
+
this.stopWatchers.push(e);
|
|
2474
|
+
let t = s(() => this.camera.value?.sources.value, () => {
|
|
2475
|
+
this.status.value === "unsupported" && (this.stop(), this.start());
|
|
2476
|
+
});
|
|
2477
|
+
this.stopWatchers.push(t);
|
|
2478
|
+
let r = s(() => n(this.options.mode), (e) => {
|
|
2479
|
+
e !== void 0 && e !== this.requestedMode.value && this.setMode(e);
|
|
2480
|
+
});
|
|
2481
|
+
this.stopWatchers.push(r);
|
|
2482
|
+
let i = s(() => n(this.options.resolution), (e) => {
|
|
2483
|
+
e !== void 0 && e !== this.requestedResolution.value && this.setResolution(e);
|
|
2484
|
+
});
|
|
2485
|
+
this.stopWatchers.push(i);
|
|
2486
|
+
let a = s(this.videoElement, (e, t) => {
|
|
2487
|
+
t && (this.onVideoPauseBound && t.removeEventListener("pause", this.onVideoPauseBound), this.onVideoPlayBound && t.removeEventListener("play", this.onVideoPlayBound), this.onVideoResizeBound && t.removeEventListener("resize", this.onVideoResizeBound)), e && (this.onVideoPauseBound = () => {
|
|
2488
|
+
this.paused.value || e.play().catch(() => {});
|
|
2489
|
+
}, this.onVideoPlayBound = () => {
|
|
2490
|
+
this.paused.value = !1;
|
|
2491
|
+
}, this.onVideoResizeBound = () => {
|
|
2492
|
+
e.videoWidth > 0 && e.videoHeight > 0 && (this.nativeWidth.value = e.videoWidth, this.nativeHeight.value = e.videoHeight);
|
|
2493
|
+
}, e.addEventListener("pause", this.onVideoPauseBound), e.addEventListener("play", this.onVideoPlayBound), e.addEventListener("resize", this.onVideoResizeBound), e.videoWidth > 0 && e.videoHeight > 0 && (this.nativeWidth.value = e.videoWidth, this.nativeHeight.value = e.videoHeight));
|
|
2494
|
+
}, { immediate: !0 });
|
|
2495
|
+
this.stopWatchers.push(a);
|
|
2496
|
+
let o = s(this.activeMode, (e) => {
|
|
2497
|
+
this.stopMseMonitor(), e === "mse" && (this.mseMonitorInterval = setInterval(() => this.monitorMseBuffer(), 1e3));
|
|
2498
|
+
}, { immediate: !0 });
|
|
2499
|
+
this.stopWatchers.push(o);
|
|
2500
|
+
let c = s([
|
|
2501
|
+
this.camera,
|
|
2502
|
+
this.videoElement,
|
|
2503
|
+
() => this.target.value
|
|
2504
|
+
], ([e, t, n], [r, i]) => {
|
|
2505
|
+
if (e !== r) this.status.value === "connected" ? e && t && n && this.restart() : this.status.value === "unsupported" && e && t && n && (this.stop(), this.start());
|
|
2506
|
+
else if (t !== i && t) {
|
|
2507
|
+
if (t.srcObject instanceof MediaStream) {
|
|
2508
|
+
let e = t.srcObject;
|
|
2509
|
+
if (e.active && e.getTracks().some((e) => e.readyState === "live")) {
|
|
2510
|
+
rr(t), this.lastMediaStream = e;
|
|
2511
|
+
return;
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2514
|
+
if (this.status.value === "connected" && this.activeMode.value !== "mse") {
|
|
2515
|
+
let e = this.lastMediaStream;
|
|
2516
|
+
e?.active && e.getTracks().some((e) => e.readyState === "live") ? (t.srcObject = e, rr(t)) : this.restart();
|
|
2517
|
+
} else if (this.status.value === "connected" && this.activeMode.value === "mse") this.restart();
|
|
2518
|
+
else if (this.status.value === "connecting" || this.status.value === "reconnecting") {
|
|
2519
|
+
let e = s(() => this.isPlaying.value, (t) => {
|
|
2520
|
+
let n = this.videoElement.value;
|
|
2521
|
+
t && n?.srcObject instanceof MediaStream ? (rr(n), e()) : t && n && !n.srcObject && this.lastMediaStream?.active && (n.srcObject = this.lastMediaStream, rr(n), e());
|
|
2522
|
+
}, { immediate: !0 });
|
|
2523
|
+
this.stopWatchers.push(e);
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
});
|
|
2527
|
+
this.stopWatchers.push(c);
|
|
2528
|
+
}
|
|
2529
|
+
isSourcePlayable(e) {
|
|
2530
|
+
if (this.triedSourceIds.has(e._id)) return !1;
|
|
2531
|
+
if (e.videoCodec !== "H265") return !0;
|
|
2532
|
+
let t = this.requestedMode.value;
|
|
2533
|
+
return Yn(t === "auto" ? "auto" : t === "mse" ? "mse" : "webrtc");
|
|
2534
|
+
}
|
|
2535
|
+
getSourceForResolution(e) {
|
|
2536
|
+
let t = this.camera.value;
|
|
2537
|
+
if (!t) return;
|
|
2538
|
+
let n = [
|
|
2539
|
+
"high-resolution",
|
|
2540
|
+
"mid-resolution",
|
|
2541
|
+
"low-resolution"
|
|
2542
|
+
], r = Math.max(0, n.indexOf(e)), i = !1;
|
|
2543
|
+
for (let a = r; a < n.length; a++) {
|
|
2544
|
+
let r = t.sources.value.find((e) => e.role === n[a]);
|
|
2545
|
+
if (r) {
|
|
2546
|
+
if (!this.isSourcePlayable(r)) {
|
|
2547
|
+
i = !0;
|
|
2548
|
+
continue;
|
|
2549
|
+
}
|
|
2550
|
+
return {
|
|
2551
|
+
source: r,
|
|
2552
|
+
effectiveResolution: n[a],
|
|
2553
|
+
degradedFrom: i ? e : null
|
|
2554
|
+
};
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
let a = t.streamSource.value;
|
|
2558
|
+
if (a && this.isSourcePlayable(a)) return {
|
|
2559
|
+
source: a,
|
|
2560
|
+
effectiveResolution: a.role ?? "low-resolution",
|
|
2561
|
+
degradedFrom: i ? e : null
|
|
2562
|
+
};
|
|
2563
|
+
if (i || a) return "unsupported";
|
|
2564
|
+
}
|
|
2565
|
+
initializeSource() {
|
|
2566
|
+
let e = this.getSourceForResolution(this.requestedResolution.value);
|
|
2567
|
+
return e ? e === "unsupported" ? "unsupported" : (this.source.value = e.source, this.activeResolution.value = e.effectiveResolution, this.degradedFrom.value = e.degradedFrom, this.degradeReason.value = e.degradedFrom ? "codec" : null, this.probedSourceId && this.probedSourceId !== e.source._id && (this.probeInfo.value = void 0, this.probedSourceId = void 0, this.hasVideo.value = !1, this.hasAudio.value = !1, this.hasBackchannel.value = !1), !0) : !1;
|
|
2568
|
+
}
|
|
2569
|
+
setUnsupported() {
|
|
2570
|
+
let e = this.camera.value?.sources.value.find((e) => e.videoCodec)?.videoCodec ?? "H265";
|
|
2571
|
+
this.error.value = /* @__PURE__ */ Error(`${e} cannot be played on this device`), this.status.value = "unsupported";
|
|
2572
|
+
}
|
|
2573
|
+
probeSaysUnplayable(e) {
|
|
2574
|
+
let t = e.video.filter((e) => e.direction === "sendonly");
|
|
2575
|
+
if (!t.length || !t.every((e) => e.codec === "H265")) return !1;
|
|
2576
|
+
let n = this.requestedMode.value;
|
|
2577
|
+
return !Yn(n === "auto" ? "auto" : n === "mse" ? "mse" : "webrtc");
|
|
2578
|
+
}
|
|
2579
|
+
sourceLikelyH265() {
|
|
2580
|
+
let e = this.source.value;
|
|
2581
|
+
if (!e) return !1;
|
|
2582
|
+
if (e.videoCodec === "H265") return !0;
|
|
2583
|
+
if (e.videoCodec !== void 0) return !1;
|
|
2584
|
+
let t = this.probeInfo.value?.video.filter((e) => e.direction === "sendonly") ?? [];
|
|
2585
|
+
return t.length > 0 && t.every((e) => e.codec === "H265");
|
|
2586
|
+
}
|
|
2587
|
+
markSourceUndecodable() {
|
|
2588
|
+
let e = this.source.value;
|
|
2589
|
+
!e || !this.sourceLikelyH265() || this.triedSourceIds.add(e._id);
|
|
2590
|
+
}
|
|
2591
|
+
handleNoFramesWhileConnected() {
|
|
2592
|
+
if (this.sourceLikelyH265() && Xn(this.activeMode.value === "mse" ? "mse" : "webrtc"), this.requestedMode.value === "auto" && this.activeMode.value !== "mse") {
|
|
2593
|
+
this.webrtcHandler?.close(), this.webrtcHandler = void 0, this.activeMode.value = "mse", this.status.value = "reconnecting", this.startMSE();
|
|
2594
|
+
return;
|
|
2595
|
+
}
|
|
2596
|
+
this.markSourceUndecodable(), this.restart();
|
|
2597
|
+
}
|
|
2598
|
+
async probeStream() {
|
|
2599
|
+
let e = this.camera.value, t = this.source.value;
|
|
2600
|
+
if (!(!e || !t || this.abortController.signal.aborted)) try {
|
|
2601
|
+
let n = await e.probeStream(t._id, {
|
|
2602
|
+
video: !0,
|
|
2603
|
+
audio: ["pcma", "opus"],
|
|
2604
|
+
microphone: !0
|
|
2605
|
+
});
|
|
2606
|
+
return n && !this.abortController.signal.aborted && (this.probeInfo.value = n, this.probedSourceId = t._id, this.hasBackchannel.value = n.audio.some((e) => e.direction === "recvonly"), this.hasAudio.value = n.audio.filter((e) => e.direction === "sendonly").length > 0, this.hasVideo.value = n.video.filter((e) => e.direction === "sendonly").length > 0), n;
|
|
2607
|
+
} catch {
|
|
2608
|
+
return;
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
connectWebSocket() {
|
|
2612
|
+
this.disconnectWebSocket();
|
|
2613
|
+
let e = this.camera.value;
|
|
2614
|
+
if (this.abortController.signal.aborted || !e || !this.source.value || !this.target.value) return;
|
|
2615
|
+
let t = this.source.value.name ?? this.source.value.role ?? this.source.value._id, n = we(e.name.value, t);
|
|
2616
|
+
this.startWsConnectTimeout(), this.wsHandle = this.wsTransport.open({
|
|
2617
|
+
path: "/api/go2rtc",
|
|
2618
|
+
query: { src: n },
|
|
2619
|
+
binaryType: "arraybuffer"
|
|
2620
|
+
}), this.wsHandle.on("open", () => this.handleWsOpen()), this.wsHandle.on("close", () => this.handleWsClose()), this.wsHandle.on("message", (e) => this.handleWsMessage(e)), this.wsHandle.on("error", () => {});
|
|
2621
|
+
}
|
|
2622
|
+
disconnectWebSocket() {
|
|
2623
|
+
this.stopWsConnectTimeout(), this.wsHandle &&= (this.wsHandle.dispose(), void 0);
|
|
2624
|
+
}
|
|
2625
|
+
sendWsMessage(e) {
|
|
2626
|
+
this.wsHandle?.readyState === WebSocket.OPEN && this.wsHandle.send(JSON.stringify(e));
|
|
2627
|
+
}
|
|
2628
|
+
handleWsOpen() {
|
|
2629
|
+
if (this.abortController.signal.aborted) return;
|
|
2630
|
+
this.stopWsConnectTimeout(), this.status.value = "connecting";
|
|
2631
|
+
let e = this.requestedMode.value;
|
|
2632
|
+
e === "auto" ? this.startAutoMode() : e === "webrtc" || e === "webrtc/tcp" ? this.startWebRTC(e) : e === "mse" && this.startMSE();
|
|
2633
|
+
}
|
|
2634
|
+
handleWsClose() {
|
|
2635
|
+
this.status.value !== "closed" && !this.abortController.signal.aborted && this.startReconnectTimeout();
|
|
2636
|
+
}
|
|
2637
|
+
handleWsMessage(e) {
|
|
2638
|
+
if (!this.abortController.signal.aborted) {
|
|
2639
|
+
if (typeof e.data == "string") {
|
|
2640
|
+
let t;
|
|
2641
|
+
try {
|
|
2642
|
+
t = JSON.parse(e.data);
|
|
2643
|
+
} catch {
|
|
2644
|
+
return;
|
|
2645
|
+
}
|
|
2646
|
+
this.handleMessage(t);
|
|
2647
|
+
} else this.mseHandler && (this.mseHandler.appendBuffer(e.data), this.handleFirstFrame());
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2650
|
+
handleMessage(e) {
|
|
2651
|
+
switch (e.type) {
|
|
2652
|
+
case "webrtc/answer":
|
|
2653
|
+
case "webrtc/candidate":
|
|
2654
|
+
this.webrtcHandler ? dr(this.webrtcHandler, e) : this.backchannelHandler && dr(this.backchannelHandler, e);
|
|
2655
|
+
break;
|
|
2656
|
+
case "mse":
|
|
2657
|
+
this.mseHandler && typeof e.value == "string" && this.mseHandler.initializeBuffer(e.value);
|
|
2658
|
+
break;
|
|
2659
|
+
case "error": this.requestedMode.value !== "auto" && (this.error.value = Error(e.value), this.status.value = "error");
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
async startWebRTC(e) {
|
|
2663
|
+
if (this.abortController.signal.aborted) return;
|
|
2664
|
+
this.startConnectTimeout(), this.webrtcHandler = lr({
|
|
2665
|
+
mode: e,
|
|
2666
|
+
signal: this.abortController.signal,
|
|
2667
|
+
onConnected: (e) => this.handleWebRTCConnected(e),
|
|
2668
|
+
onDisconnected: () => this.handleWebRTCDisconnected(),
|
|
2669
|
+
onFailed: () => this.handleWebRTCFailed(),
|
|
2670
|
+
onCandidate: (e) => this.sendWsMessage({
|
|
2671
|
+
type: "webrtc/candidate",
|
|
2672
|
+
value: e
|
|
2673
|
+
})
|
|
2674
|
+
});
|
|
2675
|
+
let t = await this.webrtcHandler.createOffer();
|
|
2676
|
+
t && !this.abortController.signal.aborted && this.sendWsMessage({
|
|
2677
|
+
type: "webrtc/offer",
|
|
2678
|
+
value: t
|
|
2679
|
+
});
|
|
2680
|
+
}
|
|
2681
|
+
handleWebRTCConnected(e) {
|
|
2682
|
+
if (this.abortController.signal.aborted) return;
|
|
2683
|
+
let t = this.videoElement.value;
|
|
2684
|
+
if (t) {
|
|
2685
|
+
if (this.hasVideo.value && e.getVideoTracks().length === 0) {
|
|
2686
|
+
this.handleWebRTCFailed();
|
|
2687
|
+
return;
|
|
2688
|
+
}
|
|
2689
|
+
this.activeMode.value = this.requestedMode.value === "auto" ? "webrtc" : this.requestedMode.value, this.lastMediaStream = e, t.srcObject = e, t.muted = this.muted.value, rr(t), this.status.value = "connected", this.handleFirstFrameWebRTC(e), this.requestedMode.value === "auto" && this.mseHandler && (this.mseHandler.close(), this.mseHandler = void 0, this.stopMseConnectTimeout(), this.sendWsMessage({ type: "mse/stop" }));
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
handleWebRTCDisconnected() {
|
|
2693
|
+
this.status.value !== "closed" && !this.abortController.signal.aborted && (this.status.value = "reconnecting", this.requestedMode.value === "auto" && this.mseHandler?.isReady ? (this.webrtcHandler?.close(), this.webrtcHandler = void 0, this.activeMode.value = "mse", this.status.value = "connected") : this.restart());
|
|
2694
|
+
}
|
|
2695
|
+
handleWebRTCFailed() {
|
|
2696
|
+
this.abortController.signal.aborted || (this.stopConnectTimeout(), this.requestedMode.value === "auto" ? (this.webrtcHandler?.close(), this.webrtcHandler = void 0, this.activeMode.value = "mse", this.mseHandler?.isReady ? this.status.value = "connected" : this.startMSE()) : (this.error.value = /* @__PURE__ */ Error("WebRTC connection failed"), this.status.value = "error"));
|
|
2697
|
+
}
|
|
2698
|
+
startMSE() {
|
|
2699
|
+
if (this.mseHandler) return;
|
|
2700
|
+
let e = this.videoElement.value;
|
|
2701
|
+
if (this.abortController.signal.aborted || !e) return;
|
|
2702
|
+
this.mseHandler = nr({
|
|
2703
|
+
videoElement: e,
|
|
2704
|
+
signal: this.abortController.signal,
|
|
2705
|
+
onReady: () => this.handleMSEReady(),
|
|
2706
|
+
onFirstData: () => this.handleMSEFirstData(),
|
|
2707
|
+
onError: (e) => {
|
|
2708
|
+
this.requestedMode.value === "auto" ? this.activeMode.value === "mse" && this.status.value === "connected" && (Q.debug("MSE error while active in auto mode — restarting:", e), this.restart()) : (this.error.value = e, this.status.value = "error");
|
|
2709
|
+
}
|
|
2710
|
+
});
|
|
2711
|
+
let t = this.mseHandler.setup();
|
|
2712
|
+
t && (this.sendWsMessage({
|
|
2713
|
+
type: "mse",
|
|
2714
|
+
value: t
|
|
2715
|
+
}), this.startMseConnectTimeout());
|
|
2716
|
+
}
|
|
2717
|
+
handleMSEReady() {
|
|
2718
|
+
this.abortController.signal.aborted || (this.stopMseConnectTimeout(), this.requestedMode.value === "auto" && this.webrtcHandler?.isConnected || (this.activeMode.value = "mse", this.status.value = "connected"));
|
|
2719
|
+
}
|
|
2720
|
+
handleMSEFirstData() {
|
|
2721
|
+
if (this.abortController.signal.aborted) return;
|
|
2722
|
+
let e = this.videoElement.value;
|
|
2723
|
+
e && rr(e);
|
|
2724
|
+
}
|
|
2725
|
+
async startAutoMode() {
|
|
2726
|
+
if (this.abortController.signal.aborted) return;
|
|
2727
|
+
let e = this.probeInfo.value ?? await this.probeStream();
|
|
2728
|
+
if (e && !Qn(e).compatible) {
|
|
2729
|
+
this.activeMode.value = "mse", this.startMSE();
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
this.startMSE(), this.startWebRTC("webrtc");
|
|
2733
|
+
}
|
|
2734
|
+
handleFirstFrame() {
|
|
2735
|
+
!this.isPlaying.value && !this.abortController.signal.aborted && (this.stopConnectTimeout(), this.isPlaying.value = !0);
|
|
2736
|
+
}
|
|
2737
|
+
monitorMseBuffer() {
|
|
2738
|
+
let e = this.videoElement.value;
|
|
2739
|
+
if (!(!e || this.activeMode.value !== "mse" || !this.isPlaying.value) && e.buffered.length > 0) {
|
|
2740
|
+
let t = e.buffered.end(e.buffered.length - 1);
|
|
2741
|
+
t - e.currentTime > 1 && (e.currentTime = t);
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
stopMseMonitor() {
|
|
2745
|
+
this.mseMonitorInterval !== void 0 && (clearInterval(this.mseMonitorInterval), this.mseMonitorInterval = void 0);
|
|
2746
|
+
}
|
|
2747
|
+
handleFirstFrameWebRTC(e) {
|
|
2748
|
+
let t = this.videoElement.value;
|
|
2749
|
+
if (this.isPlaying.value || this.abortController.signal.aborted || !t) return;
|
|
2750
|
+
if (!e.getVideoTracks()[0]) {
|
|
2751
|
+
this.handleFirstFrame();
|
|
2752
|
+
return;
|
|
2753
|
+
}
|
|
2754
|
+
let n = t;
|
|
2755
|
+
if (typeof n.requestVideoFrameCallback == "function") this.firstFrameCallbackId = n.requestVideoFrameCallback(() => {
|
|
2756
|
+
this.abortController.signal.aborted || this.handleFirstFrame();
|
|
2757
|
+
});
|
|
2758
|
+
else {
|
|
2759
|
+
let e = () => {
|
|
2760
|
+
this.abortController.signal.aborted || (t.readyState >= 2 && t.videoWidth > 0 ? this.handleFirstFrame() : this.firstFrameCallbackId = requestAnimationFrame(e));
|
|
2761
|
+
};
|
|
2762
|
+
this.firstFrameCallbackId = requestAnimationFrame(e);
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
cleanup() {
|
|
2766
|
+
this.abortController.abort(), this.stopConnectTimeout(), this.stopWsConnectTimeout(), this.stopMseConnectTimeout(), this.stopReconnectTimeout(), this.stopMseMonitor(), this.lastMediaStream = null, this.webrtcHandler?.close(), this.webrtcHandler = void 0, this.mseHandler?.close(), this.mseHandler = void 0, this.closeBackchannel(), this.disconnectWebSocket();
|
|
2767
|
+
let e = this.videoElement.value;
|
|
2768
|
+
this.firstFrameCallbackId !== void 0 && (e && "cancelVideoFrameCallback" in e ? e.cancelVideoFrameCallback(this.firstFrameCallbackId) : cancelAnimationFrame(this.firstFrameCallbackId), this.firstFrameCallbackId = void 0), e && (e.style.display = "", e.pause(), e.srcObject = null, e.removeAttribute("src"), e.load());
|
|
2769
|
+
}
|
|
2770
|
+
async startBackchannel() {
|
|
2771
|
+
if (this.abortController.signal.aborted || !this.wsHandle || this.wsHandle.readyState !== WebSocket.OPEN) return;
|
|
2772
|
+
this.backchannelHandler = ur({
|
|
2773
|
+
signal: this.abortController.signal,
|
|
2774
|
+
onCandidate: (e) => this.sendWsMessage({
|
|
2775
|
+
type: "webrtc/candidate",
|
|
2776
|
+
value: e
|
|
2777
|
+
}),
|
|
2778
|
+
onConnected: async () => {
|
|
2779
|
+
this.pendingMicTrack && this.backchannelHandler && await this.backchannelHandler.setMicrophoneTrack(this.pendingMicTrack);
|
|
2780
|
+
},
|
|
2781
|
+
onDisconnected: () => {
|
|
2782
|
+
this.backchannelHandler = void 0;
|
|
2783
|
+
}
|
|
2784
|
+
});
|
|
2785
|
+
let e = await this.backchannelHandler.createOffer();
|
|
2786
|
+
e && !this.abortController.signal.aborted && this.sendWsMessage({
|
|
2787
|
+
type: "webrtc/offer",
|
|
2788
|
+
value: e
|
|
2789
|
+
});
|
|
2790
|
+
}
|
|
2791
|
+
closeBackchannel() {
|
|
2792
|
+
this.backchannelHandler?.close(), this.backchannelHandler = void 0, this.pendingMicTrack = null;
|
|
2793
|
+
}
|
|
2794
|
+
};
|
|
2795
|
+
function pr(e) {
|
|
2796
|
+
return new fr(e);
|
|
2797
|
+
}
|
|
2798
|
+
var mr = class {
|
|
2799
|
+
streams = /* @__PURE__ */ new Map();
|
|
2800
|
+
releaseTimers = /* @__PURE__ */ new Map();
|
|
2801
|
+
releaseDelay;
|
|
2802
|
+
DEFAULT_RELEASE_DELAY = 2e3;
|
|
2803
|
+
constructor(e = {}) {
|
|
2804
|
+
this.releaseDelay = e.releaseDelay ?? this.DEFAULT_RELEASE_DELAY;
|
|
2805
|
+
}
|
|
2806
|
+
has(e) {
|
|
2807
|
+
return this.streams.has(e);
|
|
2808
|
+
}
|
|
2809
|
+
getRefCount(e) {
|
|
2810
|
+
return this.streams.get(e)?.refCount ?? 0;
|
|
2811
|
+
}
|
|
2812
|
+
get(e) {
|
|
2813
|
+
return this.streams.get(e);
|
|
2814
|
+
}
|
|
2815
|
+
acquire(e, t) {
|
|
2816
|
+
this.cancelRelease(e);
|
|
2817
|
+
let n = this.streams.get(e);
|
|
2818
|
+
if (n) return n.refCount++, t && n.consumerContainerRefs.add(t), n;
|
|
2819
|
+
}
|
|
2820
|
+
register(e, t, n, r, i, a) {
|
|
2821
|
+
this.cancelRelease(e);
|
|
2822
|
+
let o = {
|
|
2823
|
+
stream: t,
|
|
2824
|
+
videoElementRef: n,
|
|
2825
|
+
cameraDeviceRef: r,
|
|
2826
|
+
containerElementRef: i,
|
|
2827
|
+
consumerContainerRefs: /* @__PURE__ */ new Set([i]),
|
|
2828
|
+
sharedVideoElement: a,
|
|
2829
|
+
mediaStream: null,
|
|
2830
|
+
refCount: 1
|
|
2831
|
+
};
|
|
2832
|
+
return this.streams.set(e, o), o;
|
|
2833
|
+
}
|
|
2834
|
+
updateContainerElement(e, t) {
|
|
2835
|
+
let n = this.streams.get(e);
|
|
2836
|
+
n && (n.containerElementRef.value = t);
|
|
2837
|
+
}
|
|
2838
|
+
updateSharedVideoElement(e, t) {
|
|
2839
|
+
let n = this.streams.get(e);
|
|
2840
|
+
n && (n.sharedVideoElement = t);
|
|
2841
|
+
}
|
|
2842
|
+
updateMediaStream(e, t) {
|
|
2843
|
+
let n = this.streams.get(e);
|
|
2844
|
+
n && (n.mediaStream = t);
|
|
2845
|
+
}
|
|
2846
|
+
release(e, t, n) {
|
|
2847
|
+
let r = this.streams.get(e);
|
|
2848
|
+
if (r) {
|
|
2849
|
+
if (r.refCount--, n) {
|
|
2850
|
+
r.consumerContainerRefs.delete(n);
|
|
2851
|
+
let e = r.sharedVideoElement, t = n.value, i = e?.parentElement ?? null;
|
|
2852
|
+
if (r.refCount > 0 && e && (i === t || i === null || !i.isConnected)) {
|
|
2853
|
+
let n = this.pickVisibleConsumer(r, t);
|
|
2854
|
+
n && (r.containerElementRef = n.ref, e.parentElement !== n.el && (n.el.appendChild(e), e.play().catch(() => {})));
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
if (r.refCount <= 0) {
|
|
2858
|
+
let t = setTimeout(() => {
|
|
2859
|
+
this.doRelease(e);
|
|
2860
|
+
}, this.releaseDelay);
|
|
2861
|
+
this.releaseTimers.set(e, t);
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2865
|
+
forceRelease(e) {
|
|
2866
|
+
this.cancelRelease(e), this.doRelease(e);
|
|
2867
|
+
}
|
|
2868
|
+
clear() {
|
|
2869
|
+
for (let e of this.releaseTimers.values()) clearTimeout(e);
|
|
2870
|
+
this.releaseTimers.clear();
|
|
2871
|
+
for (let [e, t] of this.streams) hr(t.stream), this.streams.delete(e);
|
|
2872
|
+
}
|
|
2873
|
+
getDebugInfo() {
|
|
2874
|
+
return Array.from(this.streams.entries()).map(([e, t]) => ({
|
|
2875
|
+
cameraName: e,
|
|
2876
|
+
refCount: t.refCount,
|
|
2877
|
+
mode: t.stream.activeMode.value,
|
|
2878
|
+
resolution: t.stream.activeResolution.value
|
|
2879
|
+
}));
|
|
2880
|
+
}
|
|
2881
|
+
pickVisibleConsumer(e, t) {
|
|
2882
|
+
let n;
|
|
2883
|
+
for (let r of e.consumerContainerRefs) {
|
|
2884
|
+
let e = r.value;
|
|
2885
|
+
if (!(!e || e === t || !e.isConnected)) {
|
|
2886
|
+
if (e.checkVisibility?.() ?? e.offsetParent !== null) return {
|
|
2887
|
+
ref: r,
|
|
2888
|
+
el: e
|
|
2889
|
+
};
|
|
2890
|
+
n ??= {
|
|
2891
|
+
ref: r,
|
|
2892
|
+
el: e
|
|
2893
|
+
};
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
return n;
|
|
2897
|
+
}
|
|
2898
|
+
cancelRelease(e) {
|
|
2899
|
+
let t = this.releaseTimers.get(e);
|
|
2900
|
+
t && (clearTimeout(t), this.releaseTimers.delete(e));
|
|
2901
|
+
}
|
|
2902
|
+
doRelease(e) {
|
|
2903
|
+
let t = this.streams.get(e);
|
|
2904
|
+
t && (t.refCount <= 0 && (hr(t.stream), this.streams.delete(e)), this.releaseTimers.delete(e));
|
|
2905
|
+
}
|
|
2906
|
+
};
|
|
2907
|
+
function hr(e) {
|
|
2908
|
+
let t = e;
|
|
2909
|
+
typeof t.destroy == "function" ? t.destroy() : t.stop();
|
|
2910
|
+
}
|
|
2911
|
+
var $ = new mr(), gr = /* @__PURE__ */ new WeakMap(), _r = null;
|
|
2912
|
+
function vr(e) {
|
|
2913
|
+
_r = e;
|
|
2914
|
+
}
|
|
2915
|
+
var yr = [], br = c(null);
|
|
2916
|
+
function xr() {
|
|
2917
|
+
br.value = yr[yr.length - 1] ?? null;
|
|
2918
|
+
}
|
|
2919
|
+
function Sr() {
|
|
2920
|
+
return o(() => br.value);
|
|
2921
|
+
}
|
|
2922
|
+
function Cr(e, t = {}) {
|
|
2923
|
+
let r = t.mode ?? "fit", i = l(!1), a = c(null);
|
|
2924
|
+
s(() => n(e), (e) => {
|
|
2925
|
+
a.value = e ?? null;
|
|
2926
|
+
}, { immediate: !0 });
|
|
2927
|
+
function u(e) {
|
|
2928
|
+
e.key === "Escape" && i.value && p();
|
|
2929
|
+
}
|
|
2930
|
+
async function f() {
|
|
2931
|
+
let e = a.value;
|
|
2932
|
+
if (!e || i.value) return;
|
|
2933
|
+
let t = document.createElement("div");
|
|
2934
|
+
t.className = `cui-fullscreen cui-fullscreen-${r}`, wr(t, r);
|
|
2935
|
+
let n = {
|
|
2936
|
+
wrapper: t,
|
|
2937
|
+
parent: e.parentElement,
|
|
2938
|
+
next: e.nextSibling,
|
|
2939
|
+
bodyOverflow: document.body.style.overflow,
|
|
2940
|
+
htmlOverflow: document.documentElement.style.overflow
|
|
2941
|
+
};
|
|
2942
|
+
gr.set(e, n), e.setAttribute("data-cui-fullscreen", r), (_r ?? document.body).appendChild(t), t.appendChild(e), document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden", document.addEventListener("keydown", u), yr.push(t), xr(), i.value = !0;
|
|
2943
|
+
}
|
|
2944
|
+
async function p() {
|
|
2945
|
+
let e = a.value;
|
|
2946
|
+
if (!e || !i.value) return;
|
|
2947
|
+
let t = gr.get(e);
|
|
2948
|
+
if (!t) return;
|
|
2949
|
+
gr.delete(e), e.removeAttribute("data-cui-fullscreen"), t.parent && (t.next && t.next.parentNode === t.parent ? t.parent.insertBefore(e, t.next) : t.parent.appendChild(e)), t.wrapper.remove(), document.body.style.overflow = t.bodyOverflow, document.documentElement.style.overflow = t.htmlOverflow, document.removeEventListener("keydown", u);
|
|
2950
|
+
let n = yr.indexOf(t.wrapper);
|
|
2951
|
+
n !== -1 && yr.splice(n, 1), xr(), i.value = !1;
|
|
2952
|
+
}
|
|
2953
|
+
async function m() {
|
|
2954
|
+
i.value ? await p() : await f();
|
|
2955
|
+
}
|
|
2956
|
+
return d(() => {
|
|
2957
|
+
i.value && a.value && p(), document.removeEventListener("keydown", u);
|
|
2958
|
+
}), {
|
|
2959
|
+
isFullscreen: o(() => i.value),
|
|
2960
|
+
isSupported: o(() => !0),
|
|
2961
|
+
enter: f,
|
|
2962
|
+
exit: p,
|
|
2963
|
+
toggle: m
|
|
2964
|
+
};
|
|
2965
|
+
}
|
|
2966
|
+
function wr(e, t) {
|
|
2967
|
+
let n = {
|
|
2968
|
+
position: "fixed",
|
|
2969
|
+
top: "0",
|
|
2970
|
+
right: "0",
|
|
2971
|
+
bottom: "0",
|
|
2972
|
+
left: "0",
|
|
2973
|
+
zIndex: "2147483647",
|
|
2974
|
+
margin: "0",
|
|
2975
|
+
background: "black",
|
|
2976
|
+
paddingTop: "env(safe-area-inset-top)",
|
|
2977
|
+
paddingRight: "env(safe-area-inset-right)",
|
|
2978
|
+
paddingBottom: "env(safe-area-inset-bottom)",
|
|
2979
|
+
paddingLeft: "env(safe-area-inset-left)",
|
|
2980
|
+
boxSizing: "border-box"
|
|
2981
|
+
};
|
|
2982
|
+
t === "fit" ? Object.assign(e.style, n, {
|
|
2983
|
+
display: "flex",
|
|
2984
|
+
alignItems: "center",
|
|
2985
|
+
justifyContent: "center",
|
|
2986
|
+
overflow: "hidden"
|
|
2987
|
+
}) : Object.assign(e.style, n, {
|
|
2988
|
+
display: "block",
|
|
2989
|
+
overflowY: "auto",
|
|
2990
|
+
overflowX: "hidden",
|
|
2991
|
+
WebkitOverflowScrolling: "touch",
|
|
2992
|
+
overscrollBehavior: "contain"
|
|
2993
|
+
});
|
|
2994
|
+
}
|
|
2995
|
+
var Tr = 75, Er = 500, Dr = 0, Or = 0;
|
|
2996
|
+
function kr() {
|
|
2997
|
+
let e = performance.now();
|
|
2998
|
+
e - Or > Er && (Dr = 0);
|
|
2999
|
+
let t = Dr * Tr;
|
|
3000
|
+
return Dr++, Or = e, t;
|
|
3001
|
+
}
|
|
3002
|
+
function Ar(e) {
|
|
3003
|
+
return !e || !e.isConnected ? !1 : e.checkVisibility?.() ?? e.offsetParent !== null;
|
|
3004
|
+
}
|
|
3005
|
+
function jr(e) {
|
|
3006
|
+
let { activityConfig: r, autoStart: i = !0, isolated: a = !1 } = e, u = () => n(i), f = e.startDelay ?? kr(), p = [], { isConnected: m } = G(), h = o(() => n(e.camera)), g = o(() => typeof h.value == "string"), _ = o(() => {
|
|
3007
|
+
let e = h.value;
|
|
3008
|
+
return typeof e == "string" ? e : e.name.value;
|
|
3009
|
+
}), { camera: v, isLoading: y } = Qe(o(() => g.value ? _.value : "")), b = o(() => g.value && y.value), x = o(() => g.value ? v.value : h.value), S, C, ee, w = c(), te = c(), T = c(), E = c(), D = c(), O = c(), k = l(!1), A = l(!1), j = l(!1), ne = l(0), re = l(0), ie = l(!1), M = l(f <= 0);
|
|
3010
|
+
f > 0 && (S = setTimeout(() => {
|
|
3011
|
+
M.value = !0;
|
|
3012
|
+
}, f)), s(x, (e) => {
|
|
3013
|
+
O.value = e;
|
|
3014
|
+
}, { immediate: !0 });
|
|
3015
|
+
let N = o(() => O.value?.disabled.value === !0), P = o(() => D.value?.status.value ?? "idle"), F = o(() => D.value?.isPlaying.value ?? !1), ae = o(() => D.value?.activeMode.value ?? "webrtc"), oe = o(() => D.value?.activeResolution.value ?? "low-resolution"), se = o(() => D.value?.degradedFrom.value ?? null), I = o(() => P.value === "unsupported"), L = o(() => D.value?.hasAudio.value ?? !1), ce = o(() => D.value?.hasBackchannel.value ?? !1), le = o(() => D.value?.error.value), R = o(() => P.value === "reconnecting"), ue = o(() => b.value || !F.value && P.value !== "error" && P.value !== "unsupported"), z = o(() => L.value && P.value === "connected"), de = o(() => !!(typeof navigator < "u" && navigator.mediaDevices) && ce.value), fe = o(() => D.value?.muted.value ?? !0), pe = o(() => D.value?.paused.value ?? !1), me = o(() => typeof document < "u" && document.pictureInPictureEnabled && !!T.value), he = o(() => T.value), ge = o(() => te.value ?? w.value), B = Dn({
|
|
3016
|
+
initialMode: n(e.activityMode) ?? "always-on",
|
|
3017
|
+
config: r,
|
|
3018
|
+
onStreamStart: () => {
|
|
3019
|
+
N.value || D.value?.start();
|
|
3020
|
+
},
|
|
3021
|
+
onStreamStop: () => {
|
|
3022
|
+
if (k.value) {
|
|
3023
|
+
let e = ee ?? _.value;
|
|
3024
|
+
if (e && $.getRefCount(e) > 1) return;
|
|
3025
|
+
}
|
|
3026
|
+
D.value?.stop();
|
|
3027
|
+
},
|
|
3028
|
+
isStreamPlaying: () => F.value
|
|
3029
|
+
}), { isFullscreen: V, toggle: H } = Cr(ge);
|
|
3030
|
+
function _e() {
|
|
3031
|
+
return C = pr({
|
|
3032
|
+
camera: O,
|
|
3033
|
+
videoElement: E,
|
|
3034
|
+
containerElement: w,
|
|
3035
|
+
mode: o(() => n(e.mode) ?? "auto"),
|
|
3036
|
+
resolution: o(() => n(e.resolution) ?? "high-resolution"),
|
|
3037
|
+
autoStart: !1
|
|
3038
|
+
}), C;
|
|
3039
|
+
}
|
|
3040
|
+
let U = _e();
|
|
3041
|
+
function W() {
|
|
3042
|
+
let e = document.createElement("video");
|
|
3043
|
+
return e.autoplay = !0, e.playsInline = !0, e.muted = !0, e.disablePictureInPicture = !1, e.preload = "auto", e.poster = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=", e.style.position = "absolute", e.style.width = "100%", e.style.height = "100%", e.style.inset = "0", e.style.objectFit = "fill", e;
|
|
3044
|
+
}
|
|
3045
|
+
function ve(e, t) {
|
|
3046
|
+
e.parentElement && e.parentElement !== t && e.parentElement.removeChild(e), e.parentElement !== t && t.appendChild(e);
|
|
3047
|
+
}
|
|
3048
|
+
function ye() {
|
|
3049
|
+
if (a) return;
|
|
3050
|
+
let e = w.value, t = T.value;
|
|
3051
|
+
if (!e || !t || t.parentElement === e || !Ar(e) || Ar(t.parentElement)) return;
|
|
3052
|
+
ve(t, e), t.play().catch(() => {});
|
|
3053
|
+
let n = _.value, r = n ? $.get(n) : void 0;
|
|
3054
|
+
r && (r.containerElementRef = w);
|
|
3055
|
+
}
|
|
3056
|
+
function be() {
|
|
3057
|
+
ie.value = !0;
|
|
3058
|
+
}
|
|
3059
|
+
function xe() {
|
|
3060
|
+
ie.value = !1;
|
|
3061
|
+
}
|
|
3062
|
+
function Se() {
|
|
3063
|
+
if (A.value) return;
|
|
3064
|
+
let e = w.value, t = x.value;
|
|
3065
|
+
if (!e || !t || !m.value) return;
|
|
3066
|
+
A.value = !0, k.value = !1, D.value = U;
|
|
3067
|
+
let n = W();
|
|
3068
|
+
T.value = n, E.value = n, u() && M.value && B.mode.value === "always-on" && !N.value && U.start();
|
|
3069
|
+
}
|
|
3070
|
+
function Ce() {
|
|
3071
|
+
if (A.value) return;
|
|
3072
|
+
if (a) {
|
|
3073
|
+
Se();
|
|
3074
|
+
return;
|
|
3075
|
+
}
|
|
3076
|
+
let e = w.value, t = _.value, n = x.value;
|
|
3077
|
+
if (!e || !t || !m.value) return;
|
|
3078
|
+
let r = $.acquire(t, w);
|
|
3079
|
+
if (r) {
|
|
3080
|
+
A.value = !0, ee = t, k.value = !0, D.value = r.stream, n && r.cameraDeviceRef && (r.cameraDeviceRef.value = n);
|
|
3081
|
+
let i = r.sharedVideoElement;
|
|
3082
|
+
i || (i = W(), r.sharedVideoElement = i, $.updateSharedVideoElement(t, i)), r.mediaStream?.active && (i.srcObject = r.mediaStream), e && (r.containerElementRef = w), T.value = i, r.videoElementRef.value = i, Te(r.stream, i, t), u() && M.value && B.mode.value === "always-on" && !N.value && (r.stream.activeMode.value === "mse" ? i.play().catch(() => {}) : we(r, i, t));
|
|
3083
|
+
} else if (n) {
|
|
3084
|
+
A.value = !0, ee = t, k.value = !1, D.value = U;
|
|
3085
|
+
let e = W();
|
|
3086
|
+
T.value = e, E.value = e, $.register(t, U, E, O, w, e), u() && M.value && B.mode.value === "always-on" && !N.value && U.start();
|
|
3087
|
+
let n = s(() => U.isPlaying.value, (n) => {
|
|
3088
|
+
n && e.srcObject instanceof MediaStream && $.updateMediaStream(t, e.srcObject);
|
|
3089
|
+
}, { immediate: !0 });
|
|
3090
|
+
p.push(n);
|
|
3091
|
+
let r = s(() => U.status.value, (n) => {
|
|
3092
|
+
n === "connected" && e.srcObject instanceof MediaStream && $.updateMediaStream(t, e.srcObject);
|
|
3093
|
+
});
|
|
3094
|
+
p.push(r);
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
function we(e, t, n) {
|
|
3098
|
+
if (!e) return;
|
|
3099
|
+
let r = e.stream, i = r.activeMode.value, a = r.status.value, o = e.mediaStream?.active && e.mediaStream.getTracks().some((e) => e.readyState === "live");
|
|
3100
|
+
i === "mse" ? ($.updateMediaStream(n, null), r.restart()) : o && e.mediaStream ? (t.srcObject = e.mediaStream, t.play().catch(() => {})) : a === "idle" || a === "closed" ? (r.start(), K(r, t, n)) : (a === "connected" && r.restart(), K(r, t, n));
|
|
3101
|
+
}
|
|
3102
|
+
function K(e, t, n) {
|
|
3103
|
+
let r = s([() => e.isPlaying.value, () => e.status.value], ([e, i]) => {
|
|
3104
|
+
if (i === "connected" || e) {
|
|
3105
|
+
let e = $.get(n)?.mediaStream;
|
|
3106
|
+
e?.active && e.getTracks().some((e) => e.readyState === "live") ? (t.srcObject = e, t.play().catch(() => {}), r()) : t.srcObject instanceof MediaStream && ($.updateMediaStream(n, t.srcObject), t.play().catch(() => {}), r());
|
|
3107
|
+
}
|
|
3108
|
+
}, { immediate: !0 });
|
|
3109
|
+
p.push(r);
|
|
3110
|
+
}
|
|
3111
|
+
function Te(e, t, n) {
|
|
3112
|
+
let r = e.status.value !== "connected", i = s(() => e.status.value, (e) => {
|
|
3113
|
+
e === "reconnecting" || e === "connecting" ? r = !0 : e === "connected" && r && (r = !1, setTimeout(() => {
|
|
3114
|
+
t.srcObject instanceof MediaStream && ($.updateMediaStream(n, t.srcObject), t.play().catch(() => {}));
|
|
3115
|
+
}, 100));
|
|
3116
|
+
}, { immediate: !0 });
|
|
3117
|
+
p.push(i);
|
|
3118
|
+
let a = s(() => e.isPlaying.value, (r) => {
|
|
3119
|
+
r && e.activeMode.value !== "mse" && t.srcObject instanceof MediaStream && ($.updateMediaStream(n, t.srcObject), t.play().catch(() => {}));
|
|
3120
|
+
}, { immediate: !0 });
|
|
3121
|
+
p.push(a);
|
|
3122
|
+
}
|
|
3123
|
+
async function Ee() {
|
|
3124
|
+
N.value || (B.inStandby.value ? B.resumeFromStandby() : await D.value?.start());
|
|
3125
|
+
}
|
|
3126
|
+
function q() {
|
|
3127
|
+
D.value?.stop();
|
|
3128
|
+
}
|
|
3129
|
+
async function De() {
|
|
3130
|
+
await D.value?.restart();
|
|
3131
|
+
}
|
|
3132
|
+
function Oe() {
|
|
3133
|
+
N.value || B.resumeFromStandby();
|
|
3134
|
+
}
|
|
3135
|
+
async function ke(e) {
|
|
3136
|
+
let t = _.value;
|
|
3137
|
+
t && $.updateMediaStream(t, null), await D.value?.setMode(e);
|
|
3138
|
+
}
|
|
3139
|
+
async function Ae(e) {
|
|
3140
|
+
await D.value?.setResolution(e);
|
|
3141
|
+
}
|
|
3142
|
+
async function je(e) {
|
|
3143
|
+
await D.value?.setMicrophone(e);
|
|
3144
|
+
}
|
|
3145
|
+
function Me(e) {
|
|
3146
|
+
B.setMode(e);
|
|
3147
|
+
}
|
|
3148
|
+
function Ne(e) {
|
|
3149
|
+
B.reportActivity(e);
|
|
3150
|
+
}
|
|
3151
|
+
function Pe(e) {
|
|
3152
|
+
D.value?.setMuted(e);
|
|
3153
|
+
let t = T.value;
|
|
3154
|
+
t && (t.muted = e);
|
|
3155
|
+
}
|
|
3156
|
+
async function Fe() {
|
|
3157
|
+
await D.value?.play();
|
|
3158
|
+
}
|
|
3159
|
+
function Ie() {
|
|
3160
|
+
D.value?.pause();
|
|
3161
|
+
}
|
|
3162
|
+
function Le() {
|
|
3163
|
+
document.pictureInPictureElement ? document.exitPictureInPicture() : document.pictureInPictureEnabled && T.value && T.value.requestPictureInPicture();
|
|
3164
|
+
}
|
|
3165
|
+
function Re() {
|
|
3166
|
+
let e = T.value;
|
|
3167
|
+
if (!e || e.videoWidth === 0) return null;
|
|
3168
|
+
let t = document.createElement("canvas");
|
|
3169
|
+
return t.width = e.videoWidth, t.height = e.videoHeight, t.getContext("2d")?.drawImage(e, 0, 0), t.toDataURL("image/png");
|
|
3170
|
+
}
|
|
3171
|
+
function ze() {
|
|
3172
|
+
if (j.value) return;
|
|
3173
|
+
j.value = !0, S &&= (clearTimeout(S), void 0), D.value?.setMuted(!0);
|
|
3174
|
+
let e = T.value;
|
|
3175
|
+
e && (e.muted = !0);
|
|
3176
|
+
for (let e of p) e();
|
|
3177
|
+
if (p.length = 0, a) C?.destroy();
|
|
3178
|
+
else {
|
|
3179
|
+
let e = ee, t = T.value;
|
|
3180
|
+
e && A.value && $.release(e, t, w), (!A.value || D.value !== U) && C?.destroy();
|
|
3181
|
+
}
|
|
3182
|
+
B.dispose();
|
|
3183
|
+
}
|
|
3184
|
+
function Be(t) {
|
|
3185
|
+
let r = n(e.canvasStyle), i = n(e.canvasClass);
|
|
3186
|
+
if (r) {
|
|
3187
|
+
if (typeof r == "string") t.style.cssText += ";" + r;
|
|
3188
|
+
else if (Array.isArray(r)) for (let e of r) typeof e == "string" ? t.style.cssText += ";" + e : e && Object.assign(t.style, e);
|
|
3189
|
+
else Object.assign(t.style, r);
|
|
3190
|
+
}
|
|
3191
|
+
if (i) {
|
|
3192
|
+
if (typeof i == "string") t.className = i;
|
|
3193
|
+
else if (Array.isArray(i)) t.className = i.filter(Boolean).join(" ");
|
|
3194
|
+
else for (let [e, n] of Object.entries(i)) t.classList.toggle(e, !!n);
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
if (!a && typeof IntersectionObserver < "u") {
|
|
3198
|
+
let e, t = s(w, (t) => {
|
|
3199
|
+
e?.disconnect(), e = void 0, t && (e = new IntersectionObserver((e) => {
|
|
3200
|
+
e.some((e) => e.isIntersecting) && ye();
|
|
3201
|
+
}), e.observe(t));
|
|
3202
|
+
}, { immediate: !0 });
|
|
3203
|
+
p.push(() => {
|
|
3204
|
+
t(), e?.disconnect();
|
|
3205
|
+
});
|
|
3206
|
+
}
|
|
3207
|
+
if (e.canvasStyle !== void 0 || e.canvasClass !== void 0) {
|
|
3208
|
+
let e, t = s(w, (t) => {
|
|
3209
|
+
if (e?.(), e = void 0, !t) return;
|
|
3210
|
+
Array.from(t.querySelectorAll("canvas")).forEach((e) => {
|
|
3211
|
+
Be(e);
|
|
3212
|
+
});
|
|
3213
|
+
let n = new MutationObserver((e) => {
|
|
3214
|
+
for (let t of e) Array.from(t.addedNodes).forEach((e) => {
|
|
3215
|
+
e instanceof HTMLCanvasElement ? Be(e) : e instanceof HTMLElement && Array.from(e.querySelectorAll("canvas")).forEach((e) => Be(e));
|
|
3216
|
+
});
|
|
3217
|
+
});
|
|
3218
|
+
n.observe(t, {
|
|
3219
|
+
childList: !0,
|
|
3220
|
+
subtree: !0
|
|
3221
|
+
}), e = () => n.disconnect();
|
|
3222
|
+
}, { immediate: !0 });
|
|
3223
|
+
p.push(() => {
|
|
3224
|
+
t(), e?.();
|
|
3225
|
+
});
|
|
3226
|
+
}
|
|
3227
|
+
if (e.videoStyle !== void 0 || e.videoClass !== void 0) {
|
|
3228
|
+
let t = s([
|
|
3229
|
+
T,
|
|
3230
|
+
() => n(e.videoStyle),
|
|
3231
|
+
() => n(e.videoClass)
|
|
3232
|
+
], ([e, t, n]) => {
|
|
3233
|
+
if (e) {
|
|
3234
|
+
if (t) {
|
|
3235
|
+
if (typeof t == "string") e.style.cssText += ";" + t;
|
|
3236
|
+
else if (Array.isArray(t)) for (let n of t) typeof n == "string" ? e.style.cssText += ";" + n : n && Object.assign(e.style, n);
|
|
3237
|
+
else Object.assign(e.style, t);
|
|
3238
|
+
}
|
|
3239
|
+
if (n) {
|
|
3240
|
+
if (typeof n == "string") e.className = n;
|
|
3241
|
+
else if (Array.isArray(n)) e.className = n.filter(Boolean).join(" ");
|
|
3242
|
+
else for (let [t, r] of Object.entries(n)) e.classList.toggle(t, r);
|
|
3243
|
+
}
|
|
3244
|
+
}
|
|
3245
|
+
}, { immediate: !0 });
|
|
3246
|
+
p.push(t);
|
|
3247
|
+
}
|
|
3248
|
+
let Ve = s([() => D.value?.nativeWidth.value, () => D.value?.nativeHeight.value], ([e, t]) => {
|
|
3249
|
+
e && e > 0 && (ne.value = e), t && t > 0 && (re.value = t);
|
|
3250
|
+
});
|
|
3251
|
+
p.push(Ve);
|
|
3252
|
+
let He = s(T, (e, t) => {
|
|
3253
|
+
t && (t.removeEventListener("enterpictureinpicture", be), t.removeEventListener("leavepictureinpicture", xe)), e && (e.addEventListener("enterpictureinpicture", be), e.addEventListener("leavepictureinpicture", xe));
|
|
3254
|
+
}, { immediate: !0 });
|
|
3255
|
+
return p.push(He), s([w, T], ([e, t]) => {
|
|
3256
|
+
e && t && ve(t, e);
|
|
3257
|
+
}, { immediate: !0 }), s(() => n(e.activityMode), (e) => {
|
|
3258
|
+
e && e !== B.mode.value && B.setMode(e);
|
|
3259
|
+
}), s([
|
|
3260
|
+
w,
|
|
3261
|
+
x,
|
|
3262
|
+
m,
|
|
3263
|
+
M
|
|
3264
|
+
], () => {
|
|
3265
|
+
A.value ? M.value && u() && B.mode.value === "always-on" && !F.value && P.value === "idle" && !N.value && D.value?.start() : Ce();
|
|
3266
|
+
}, { immediate: !0 }), s(N, (e, t) => {
|
|
3267
|
+
A.value && (!t && e ? D.value?.stop() : t && !e && u() && D.value?.restart());
|
|
3268
|
+
}), t(ze), d(ze), {
|
|
3269
|
+
status: P,
|
|
3270
|
+
isPlaying: F,
|
|
3271
|
+
activeMode: ae,
|
|
3272
|
+
activeResolution: oe,
|
|
3273
|
+
degradedFrom: se,
|
|
3274
|
+
unsupported: I,
|
|
3275
|
+
hasAudio: L,
|
|
3276
|
+
hasBackchannel: ce,
|
|
3277
|
+
error: le,
|
|
3278
|
+
isReconnecting: R,
|
|
3279
|
+
activityMode: B.mode,
|
|
3280
|
+
inStandby: B.inStandby,
|
|
3281
|
+
hasActivity: B.hasActivity,
|
|
3282
|
+
isBusy: ue,
|
|
3283
|
+
hasSound: z,
|
|
3284
|
+
hasIntercom: de,
|
|
3285
|
+
videoElement: T,
|
|
3286
|
+
containerElement: w,
|
|
3287
|
+
fullscreenElement: te,
|
|
3288
|
+
renderElement: he,
|
|
3289
|
+
stream: D,
|
|
3290
|
+
muted: fe,
|
|
3291
|
+
paused: pe,
|
|
3292
|
+
nativeWidth: ne,
|
|
3293
|
+
nativeHeight: re,
|
|
3294
|
+
isPip: ie,
|
|
3295
|
+
supportsPip: me,
|
|
3296
|
+
isFullscreen: V,
|
|
3297
|
+
start: Ee,
|
|
3298
|
+
stop: q,
|
|
3299
|
+
restart: De,
|
|
3300
|
+
resumeFromStandby: Oe,
|
|
3301
|
+
setMode: ke,
|
|
3302
|
+
setResolution: Ae,
|
|
3303
|
+
setMicrophone: je,
|
|
3304
|
+
setActivityMode: Me,
|
|
3305
|
+
reportActivity: Ne,
|
|
3306
|
+
setMuted: Pe,
|
|
3307
|
+
play: Fe,
|
|
3308
|
+
pause: Ie,
|
|
3309
|
+
togglePip: Le,
|
|
3310
|
+
isCameraDisabled: N,
|
|
3311
|
+
toggleFullscreen: H,
|
|
3312
|
+
captureScreenshot: Re
|
|
3313
|
+
};
|
|
3314
|
+
}
|
|
3315
|
+
function Mr() {
|
|
3316
|
+
let e = G(), t = K.coreManagerNamespaces(), n = (e) => e.createProxy(t.coreManagerRpc);
|
|
3317
|
+
return {
|
|
3318
|
+
getFFmpegPath: () => q(e.rpc, (e) => n(e).getFFmpegPath()),
|
|
3319
|
+
getServerAddresses: () => q(e.rpc, (e) => n(e).getServerAddresses()),
|
|
3320
|
+
getPluginsByInterface: (t) => q(e.rpc, (e) => n(e).getPluginsByInterface(t)),
|
|
3321
|
+
getCloudServerId: () => q(e.rpc, (e) => n(e).getCloudServerId())
|
|
3322
|
+
};
|
|
3323
|
+
}
|
|
3324
|
+
var Nr = 1500, Pr = 3e4, Fr = /* @__PURE__ */ new Map();
|
|
3325
|
+
function Ir(e) {
|
|
3326
|
+
let t = G(), n = l({ status: "disconnected" }), r = l(null), i = null, a = (n) => q(t.rpc, async (r) => {
|
|
3327
|
+
let i = await en(t.rpc, e);
|
|
3328
|
+
if (!i) throw Error(`Plugin "${e}" not found`);
|
|
3329
|
+
return n(r.createProxy(K.pluginNamespaces(i).pluginChildRpc));
|
|
3330
|
+
});
|
|
3331
|
+
async function o() {
|
|
3332
|
+
n.value = await a((e) => e.getOAuthState()), r.value ||= await a((e) => e.getOAuthMetadata());
|
|
3333
|
+
}
|
|
3334
|
+
function c(e) {
|
|
3335
|
+
i && clearInterval(i), i = setInterval(() => {
|
|
3336
|
+
o().catch(() => void 0);
|
|
3337
|
+
}, e);
|
|
3338
|
+
}
|
|
3339
|
+
return s(() => n.value.status, (e) => {
|
|
3340
|
+
c(e === "awaiting_user" || e === "polling" ? Nr : Pr);
|
|
3341
|
+
}, { immediate: !0 }), o().catch(() => void 0), {
|
|
3342
|
+
state: n,
|
|
3343
|
+
metadata: r,
|
|
3344
|
+
call: a,
|
|
3345
|
+
refresh: o
|
|
3346
|
+
};
|
|
3347
|
+
}
|
|
3348
|
+
function Lr(e) {
|
|
3349
|
+
Fr.has(e) || Fr.set(e, Ir(e));
|
|
3350
|
+
let { state: t, metadata: n, call: r, refresh: i } = Fr.get(e);
|
|
3351
|
+
async function a(e) {
|
|
3352
|
+
t.value = await r((t) => t.startDeviceFlow(e));
|
|
3353
|
+
}
|
|
3354
|
+
async function o(e) {
|
|
3355
|
+
t.value = await r((t) => t.startAuthCodeFlow(e));
|
|
3356
|
+
}
|
|
3357
|
+
async function s() {
|
|
3358
|
+
(t.value.status === "awaiting_user" || t.value.status === "polling") && await r((e) => e.cancelDeviceFlow?.() ?? e.cancelAuthCodeFlow?.() ?? Promise.resolve()), await i();
|
|
3359
|
+
}
|
|
3360
|
+
async function c() {
|
|
3361
|
+
await r((e) => e.disconnect()), await i();
|
|
3362
|
+
}
|
|
3363
|
+
return {
|
|
3364
|
+
state: t,
|
|
3365
|
+
metadata: n,
|
|
3366
|
+
startDeviceFlow: a,
|
|
3367
|
+
startAuthCodeFlow: o,
|
|
3368
|
+
cancel: s,
|
|
3369
|
+
disconnect: c,
|
|
3370
|
+
refresh: i
|
|
3371
|
+
};
|
|
3372
|
+
}
|
|
3373
|
+
function Rr() {
|
|
3374
|
+
let e = G(), { rpc: t, isConnected: n } = e, r = K.terminalManagerNamespaces(), a = c(), o = l(!1), s = l(!1), u = l(), f = l({
|
|
3375
|
+
cols: 80,
|
|
3376
|
+
rows: 24
|
|
3377
|
+
}), p, m, h = 0, g = (e) => e.createProxy(r.terminalManagerRpc);
|
|
3378
|
+
async function _(e) {
|
|
3379
|
+
if (!(s.value || o.value)) {
|
|
3380
|
+
s.value = !0, u.value = void 0, m = e;
|
|
3381
|
+
try {
|
|
3382
|
+
let n = await q(t, (t) => g(t).createSession({
|
|
3383
|
+
cols: e?.cols ?? 80,
|
|
3384
|
+
rows: e?.rows ?? 24,
|
|
3385
|
+
cwd: e?.cwd,
|
|
3386
|
+
shell: e?.shell,
|
|
3387
|
+
env: e?.env
|
|
3388
|
+
}));
|
|
3389
|
+
a.value = n.sessionId, f.value = n.dimensions, o.value = !0, p = new AbortController();
|
|
3390
|
+
let r = ++h;
|
|
3391
|
+
v(n.sessionId, e, r);
|
|
3392
|
+
} catch (t) {
|
|
3393
|
+
u.value = t instanceof Error ? t : Error(String(t)), e?.onError?.(u.value);
|
|
3394
|
+
} finally {
|
|
3395
|
+
s.value = !1;
|
|
3396
|
+
}
|
|
3397
|
+
}
|
|
3398
|
+
}
|
|
3399
|
+
async function v(e, n, r) {
|
|
3400
|
+
try {
|
|
3401
|
+
let i = t.value;
|
|
3402
|
+
if (!i) return;
|
|
3403
|
+
for await (let t of g(i).generateOutput(e)) {
|
|
3404
|
+
if (r !== h || p?.signal.aborted) break;
|
|
3405
|
+
n?.onData?.(t);
|
|
3406
|
+
}
|
|
3407
|
+
} catch (e) {
|
|
3408
|
+
r === h && !p?.signal.aborted && (u.value = e instanceof Error ? e : Error(String(e)), n?.onError?.(u.value));
|
|
3409
|
+
} finally {
|
|
3410
|
+
r === h && !p?.signal.aborted && (o.value = !1, n?.onClose?.());
|
|
3411
|
+
}
|
|
3412
|
+
}
|
|
3413
|
+
async function y(e) {
|
|
3414
|
+
if (!(!a.value || !o.value)) try {
|
|
3415
|
+
await q(t, (t) => g(t).writeInput(a.value, e));
|
|
3416
|
+
} catch (e) {
|
|
3417
|
+
u.value = e instanceof Error ? e : Error(String(e)), m?.onError?.(u.value);
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
async function b(e) {
|
|
3421
|
+
if (!(!a.value || !o.value)) try {
|
|
3422
|
+
await q(t, (t) => g(t).resize(a.value, e)), f.value = e;
|
|
3423
|
+
} catch (e) {
|
|
3424
|
+
u.value = e instanceof Error ? e : Error(String(e)), m?.onError?.(u.value);
|
|
3425
|
+
}
|
|
3426
|
+
}
|
|
3427
|
+
async function x() {
|
|
3428
|
+
if (p?.abort(), h++, a.value) try {
|
|
3429
|
+
await q(t, (e) => g(e).closeSession(a.value), {
|
|
3430
|
+
awaitConnect: !1,
|
|
3431
|
+
maxRetries: 0
|
|
3432
|
+
});
|
|
3433
|
+
} catch {}
|
|
3434
|
+
a.value = void 0, o.value = !1, m = void 0;
|
|
3435
|
+
}
|
|
3436
|
+
function S() {
|
|
3437
|
+
if (!a.value && !o.value) return;
|
|
3438
|
+
let e = m;
|
|
3439
|
+
p?.abort(), h++, a.value = void 0, o.value = !1, m = void 0, e?.onClose?.(), e && _(e);
|
|
3440
|
+
}
|
|
3441
|
+
return e.on("reconnected", S), d(() => {
|
|
3442
|
+
e.off("reconnected", S), x();
|
|
3443
|
+
}), {
|
|
3444
|
+
sessionId: i(a),
|
|
3445
|
+
isConnected: i(o),
|
|
3446
|
+
isConnecting: i(s),
|
|
3447
|
+
isClientConnected: i(n),
|
|
3448
|
+
error: i(u),
|
|
3449
|
+
dimensions: i(f),
|
|
3450
|
+
connect: _,
|
|
3451
|
+
write: y,
|
|
3452
|
+
resize: b,
|
|
3453
|
+
close: x
|
|
3454
|
+
};
|
|
3455
|
+
}
|
|
3456
|
+
//#endregion
|
|
3457
|
+
export { F as $, qt as A, be as B, Zt as C, Yt as D, Jt as E, Ht as F, V as G, W as H, We as I, pe as J, ge as K, Bn as L, mt as M, hn as N, Kt as O, _n as P, se as Q, Rr as R, G as S, Cr as T, U, ve as V, H as W, R as X, z as Y, L as Z, vr as _, kt as a, T as at, gn as b, gt as c, ee as ct, Ct as d, b as dt, M as et, _t as f, y as ft, vn as g, wt as h, yt as i, j as it, Xt as j, Lr as k, St as l, S as lt, xt as m, vt as n, re as nt, Tt as o, E as ot, Dt as p, _ as pt, B as q, bt as r, ne as rt, Ot as s, w as st, Tn as t, ie as tt, Et as u, x as ut, Ut as v, Mr as w, jr as x, Qe as y, Sr as z };
|