@camstack/addon-admin-ui 1.2.298 → 1.2.300

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/assets/{AddonCollectionPage-Df7TFa8c.js → AddonCollectionPage-Cr-KfwvP.js} +1 -1
  2. package/dist/assets/{Addons-BL0l83HX.js → Addons-DoAs_KfP.js} +1 -1
  3. package/dist/assets/{AdminTabs-_3rYGvff.js → AdminTabs-nO86C-du.js} +1 -1
  4. package/dist/assets/{AiProfiles-Cb_Zmt2e.js → AiProfiles-DZuK8h7D.js} +1 -1
  5. package/dist/assets/{BrokerForm-O4qx5NOl.js → BrokerForm-MOPaJ62m.js} +1 -1
  6. package/dist/assets/Build-fVZjJtBq.js +32 -0
  7. package/dist/assets/{Capabilities-BhWA9I3U.js → Capabilities-5vhoPQFd.js} +1 -1
  8. package/dist/assets/{CapabilityBadges-E822NR6-.js → CapabilityBadges-CJnsp_LH.js} +1 -1
  9. package/dist/assets/{Cluster-CytT6oOR.js → Cluster-BsbJ3J5p.js} +2 -2
  10. package/dist/assets/CompositionEditor-DbDCjW1s.js +1 -0
  11. package/dist/assets/{CompositionEditorPage-D-Pr98e9.js → CompositionEditorPage-BfvnF5_n.js} +1 -1
  12. package/dist/assets/{Data-C_5nuknP.js → Data-DqV6ClEA.js} +1 -1
  13. package/dist/assets/{DetectionIntelligence-Ddu_ubPT.js → DetectionIntelligence-XPzIfD-8.js} +1 -1
  14. package/dist/assets/{DeviceAggregateSection-kHgMnzdV.js → DeviceAggregateSection-CG9OIoVb.js} +1 -1
  15. package/dist/assets/DeviceDetail-BfbO3V0b.js +2 -0
  16. package/dist/assets/{Devices-CkDDnlUY.js → Devices-Dq_iXMXN.js} +1 -1
  17. package/dist/assets/{EmbedPlayerPage-4bKTeu-8.js → EmbedPlayerPage-CY5PDgte.js} +1 -1
  18. package/dist/assets/Events-BeWVGaev.js +1 -0
  19. package/dist/assets/{FormBuilder-DFkvqrJD.js → FormBuilder-B8jus43Y.js} +1 -1
  20. package/dist/assets/{Identity-Bs0HMUZv.js → Identity-DaJyz-ig.js} +1 -1
  21. package/dist/assets/IntegrationDetail-mee6rfl4.js +1 -0
  22. package/dist/assets/Integrations-DTrUecHI.js +1 -0
  23. package/dist/assets/{Integrations-D5LYSgWQ.js → Integrations-e_CGcE53.js} +1 -1
  24. package/dist/assets/Locations-naeoUiMl.js +3 -0
  25. package/dist/assets/{Logs-CdSMPoxV.js → Logs-DHvS0ZG4.js} +1 -1
  26. package/dist/assets/{ModelLicenses-GuvIn1gk.js → ModelLicenses-CHF6ETO5.js} +1 -1
  27. package/dist/assets/{MotionZonesSettings-C5cymw6R.js → MotionZonesSettings-DveHRZ1M.js} +1 -1
  28. package/dist/assets/{MyAccess-DKvcVvYi.js → MyAccess-ZmbQ_xfb.js} +1 -1
  29. package/dist/assets/{Network-DO7j65It.js → Network-C4frL_HE.js} +1 -1
  30. package/dist/assets/{NodeAddonsSettingsPanel-Bj_BK8BK.js → NodeAddonsSettingsPanel-11F3P0IK.js} +1 -1
  31. package/dist/assets/{NodeInferenceDevices-DEF7iUIy.js → NodeInferenceDevices-B7lbdDTW.js} +1 -1
  32. package/dist/assets/Notifications-DRLYWjDS.js +1 -0
  33. package/dist/assets/{Pipeline-C3rd2o0z.js → Pipeline-qSnWQmZ4.js} +1 -1
  34. package/dist/assets/{Plates-KK9Jucpy.js → Plates-B0u-1Qcz.js} +1 -1
  35. package/dist/assets/{PrivacyMaskSettings-DLWoWKa1.js → PrivacyMaskSettings-CWYULq-y.js} +1 -1
  36. package/dist/assets/{ProviderIcon-B95H0OGs.js → ProviderIcon-DAp_lMDw.js} +1 -1
  37. package/dist/assets/{Recordings-BIMt47G_.js → Recordings-fNBcOSUc.js} +1 -1
  38. package/dist/assets/{ScanNetworkModal-C745HgYN.js → ScanNetworkModal-xnOiLGgg.js} +1 -1
  39. package/dist/assets/{SceneMonitorEditor-DEFeKrQi.js → SceneMonitorEditor-gDpt6iKo.js} +1 -1
  40. package/dist/assets/{Scenes-31t1OF8h.js → Scenes-DDAmEqU9.js} +1 -1
  41. package/dist/assets/{Settings-rfP-ZvI0.js → Settings-Dv_5fVj2.js} +1 -1
  42. package/dist/assets/{Showroom-Df8NV8QK.js → Showroom-B7D-nKLt.js} +1 -1
  43. package/dist/assets/{StorageLocationsPanel-DGsk0Ute.js → StorageLocationsPanel-BZ5j8c1h.js} +1 -1
  44. package/dist/assets/{Terminal-CDJOGeqz.js → Terminal-DR0RmRD6.js} +1 -1
  45. package/dist/assets/{Viewer-BjRST1rI.js → Viewer-Cg7A1w4F.js} +1 -1
  46. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-C4tT4btJ.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-TK7cnRbq.js} +1 -1
  47. package/dist/assets/{archive-TrxiLNcl.js → archive-CCEAH2-E.js} +1 -1
  48. package/dist/assets/{authed-media-CH1U0Z7I.js → authed-media-ClZ80rNx.js} +1 -1
  49. package/dist/assets/{boxes-BAiYOams.js → boxes-BdtZgTjz.js} +1 -1
  50. package/dist/assets/circle-slash-CgvI8iSv.js +1 -0
  51. package/dist/assets/{debounced-invalidate-BDeU9yPQ.js → debounced-invalidate-C2eb-Tqo.js} +1 -1
  52. package/dist/assets/{device-integration-icon-CHkYoY0a.js → device-integration-icon-Ck2Y2lL5.js} +1 -1
  53. package/dist/assets/device-picker-model-qVKFWw6-.js +1 -0
  54. package/dist/assets/dist-BXj5mC45.js +349 -0
  55. package/dist/assets/{dist-a0ex8Xy3.js → dist-Cjkv3uUk.js} +1 -1
  56. package/dist/assets/{face-bbox-BO4f9HS4.js → face-bbox-Co5b1ky_.js} +1 -1
  57. package/dist/assets/{hard-drive-download-DMTgloj5.js → hard-drive-download-ep0y7LyP.js} +1 -1
  58. package/dist/assets/{hostInit-DImvGASf.js → hostInit-BoAo3PhF.js} +1 -1
  59. package/dist/assets/{index-CgXPc-AV.js → index-C_wdx2NZ.js} +3 -3
  60. package/dist/assets/index-egLHRpbu.css +2 -0
  61. package/dist/assets/{layers-eROspUmA.js → layers-BU-FWaJU.js} +1 -1
  62. package/dist/assets/{location-owned-usage-sOE3xLhc.js → location-owned-usage-C3ej6Pj6.js} +1 -1
  63. package/dist/assets/{mf-entry-bootstrap-0-84890b2e.js → mf-entry-bootstrap-0-50975fe6.js} +2 -2
  64. package/dist/assets/{player-overlays-o54P23P2.js → player-overlays-CjhGPGRH.js} +1 -1
  65. package/dist/assets/remoteEntry-C2_I-Of1.js +1 -0
  66. package/dist/assets/{send-D0d5eZ61.js → send-CEk5WYNt.js} +1 -1
  67. package/dist/assets/{settings-2-Dqj-Whfr.js → settings-2-MB6Thalh.js} +1 -1
  68. package/dist/assets/{square-check-big-CC2dU6RF.js → square-check-big-ZL-AwzeA.js} +1 -1
  69. package/dist/assets/src-BiDz1hgC.js +67 -0
  70. package/dist/assets/src-bXB9J58r.js +349 -0
  71. package/dist/assets/{use-scenes-feed-R-GEBDBU.js → use-scenes-feed-CwP86V7k.js} +1 -1
  72. package/dist/assets/{use-stationary-objects-CO4PdIFG.js → use-stationary-objects-eBMDdhXW.js} +1 -1
  73. package/dist/assets/{useDevice-BU0imY9B.js → useDevice-CGj-WKTC.js} +1 -1
  74. package/dist/assets/useEventInvalidation-BaNmc7Ke.js +1 -0
  75. package/dist/assets/{useNodeUrlSelection-Dlf0CWPU.js → useNodeUrlSelection-DMCMMjaf.js} +1 -1
  76. package/dist/assets/user-round-CqtnExEW.js +1 -0
  77. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DAaE-Myc.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-Dt6rtuC7.js} +2 -2
  78. package/dist/index.html +6 -6
  79. package/dist/server/addon.js +235 -102
  80. package/package.json +1 -1
  81. package/dist/assets/Build-CNQhG6ma.js +0 -32
  82. package/dist/assets/CompositionEditor-BhWVT7RV.js +0 -1
  83. package/dist/assets/DeviceDetail-BZJKkllF.js +0 -2
  84. package/dist/assets/Events-DoN_tLnP.js +0 -1
  85. package/dist/assets/IntegrationDetail-Cr5-tJiw.js +0 -1
  86. package/dist/assets/Integrations-D5hX1u4b.js +0 -1
  87. package/dist/assets/Locations-NysPu2nw.js +0 -3
  88. package/dist/assets/Notifications-R4TlE5EH.js +0 -1
  89. package/dist/assets/circle-slash-Di12V3ul.js +0 -1
  90. package/dist/assets/dist-3HV5hQQl.js +0 -349
  91. package/dist/assets/index-DOZUgTMC.css +0 -2
  92. package/dist/assets/remoteEntry-nDKnWQvr.js +0 -1
  93. package/dist/assets/src-C36-vO5A.js +0 -349
  94. package/dist/assets/src-f3OJiuN1.js +0 -67
  95. package/dist/assets/useEventInvalidation-BxCnrh5u.js +0 -1
  96. package/dist/assets/user-round-CXdkrmGZ.js +0 -1
@@ -0,0 +1,349 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./__vite-browser-external-Cc3gW-QT.js","./rolldown-runtime-Cyuzqnbw.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{t}from"./vite-preload-helper-kNaey6uv.js";import{A as n,C as r,D as i,E as a,F as o,I as s,M as c,N as l,O as u,P as d,S as f,T as p,_ as m,a as ee,b as h,c as te,d as ne,f as re,g,h as ie,i as ae,j as _,k as oe,l as se,m as v,n as ce,o as le,p as y,r as ue,s as de,t as fe,u as pe,v as b,w as me,x as he,y as x}from"./__vite-browser-external-Cc3gW-QT.js";var ge=function(e){return e.SystemBoot=`system.boot`,e.SystemAddonsReady=`system.addons-ready`,e.SystemRestarting=`system.restarting`,e.SystemRestartCompleted=`system.restart-completed`,e.SystemTlsCertChanged=`system.tls-cert-changed`,e.UpdateAvailable=`update.available`,e.SystemReadyState=`system.ready-state`,e.AddonStarted=`addon.started`,e.AddonStopped=`addon.stopped`,e.AddonRestarted=`addon.restarted`,e.AddonUpdated=`addon.updated`,e.AddonInstalled=`addon.installed`,e.AddonUninstalled=`addon.uninstalled`,e.AddonCrashed=`addon.crashed`,e.AddonRunnerFailed=`addon.runner-failed`,e.AddonError=`addon.error`,e.AddonPageReady=`addon.page-ready`,e.AddonWidgetReady=`addon.widget-ready`,e.AddonLoadFailed=`addon.load-failed`,e.AddonLoadRecovered=`addon.load-recovered`,e.AddonRetryScheduled=`addon.retry-scheduled`,e.SystemLivenessFailed=`system.liveness-failed`,e.SystemLivenessRecovered=`system.liveness-recovered`,e.AddonRetryAttempting=`addon.retry-attempting`,e.DeviceRegistered=`device.registered`,e.DeviceUnregistered=`device.unregistered`,e.DeviceEnabled=`device.enabled`,e.DeviceDisabled=`device.disabled`,e.DeviceSettingsUpdated=`device.settings-updated`,e.DeviceBindingsChanged=`device.bindings-changed`,e.DeviceMetaChanged=`device.meta-changed`,e.DeviceSourceInfoChanged=`device.source-info-changed`,e.DeviceStreamsRegistered=`device.streams-registered`,e.DeviceProvisioned=`device.provisioned`,e.DeviceReady=`device.ready`,e.IntegrationEnabled=`integration.enabled`,e.IntegrationDisabled=`integration.disabled`,e.IntegrationDeleted=`integration.deleted`,e.BrokerStatusChanged=`broker.status-changed`,e.BrokerMessage=`broker.message`,e.ProviderStarted=`provider.started`,e.ProviderStopped=`provider.stopped`,e.ProcessCrashed=`process.crashed`,e.ProcessRestartScheduled=`process.restart_scheduled`,e.ProcessRestarted=`process.restarted`,e.StorageLocationsChanged=`storage.locations-changed`,e.RecordingStarted=`recording.started`,e.RecordingStopped=`recording.stopped`,e.RecordingError=`recording.error`,e.RecordingHealthDegraded=`recording.health.degraded`,e.RecordingStorageCritical=`recording.storage.critical`,e.RecordingSegmentWritten=`recording.segment.written`,e.RecordingPolicyFallback=`recording.policy.fallback`,e.RecordingRetentionCompleted=`recording.retention.completed`,e.RecordingExportProgress=`recording.export.progress`,e.RecordingExportCompleted=`recording.export.completed`,e.RecordingExportFailed=`recording.export.failed`,e.DetectionEvent=`detection.event`,e.SessionTrackNew=`session.track.new`,e.SessionTrackExpired=`session.track.expired`,e.BenchmarkProgress=`benchmark.progress`,e.PlatformProbePhase=`platform-probe.phase`,e.PipelineProgress=`pipeline.progress`,e.PipelineTrace=`pipeline.trace`,e.PipelineInferenceResult=`pipeline.inference-result`,e.PipelineCameraAssigned=`pipeline.camera-assigned`,e.PipelineCameraUnassigned=`pipeline.camera-unassigned`,e.PipelineNodeInferenceUnavailable=`pipeline.node-inference-unavailable`,e.PipelineDetectionBlind=`pipeline.detection-blind`,e.PipelineCameraUpdated=`pipeline.camera-updated`,e.PipelineIngestOwnerChanged=`pipeline.ingest-owner-changed`,e.PipelineRunnerLoadSnapshot=`pipeline.runner-load-snapshot`,e.PipelineCameraMetricsSnapshot=`pipeline.camera-metrics-snapshot`,e.StreamBrokerMetricsSnapshot=`stream-broker.metrics-snapshot`,e.StreamBrokerOnCamStreamDemand=`stream-broker.onCamStreamDemand`,e.StreamBrokerOnCamStreamIdle=`stream-broker.onCamStreamIdle`,e.StreamBrokerOnRequestStreamSourceRefresh=`stream-broker.onRequestStreamSourceRefresh`,e.StreamParamsChanged=`stream-params.changed`,e.DeviceStateChanged=`device.state-changed`,e.DeviceNativeShadowChanged=`device.native-shadow-changed`,e.ZoneAnalyticsOccupancyChanged=`zone-analytics.occupancy-changed`,e.BatteryOnStatusChanged=`battery.onStatusChanged`,e.NetworkLinkOnStatusChanged=`network-link.onStatusChanged`,e.BatteryOnWakeStarted=`battery.onWakeStarted`,e.DoorbellOnPressed=`doorbell.onPressed`,e.EventEmitted=`event-emitter.event`,e.PipelineEngineMetricsSnapshot=`pipeline.engine-metrics-snapshot`,e.PipelineEngineProvisioning=`pipeline.engine-provisioning`,e.ClusterTopologySnapshot=`cluster.topology-snapshot`,e.MetricsNodeResourcesSnapshot=`metrics.node-resources-snapshot`,e.MetricsNodeProcessesSnapshot=`metrics.node-processes-snapshot`,e.CapabilityBindingChanged=`capability.binding-changed`,e.ModelDownloadProgress=`model.download.progress`,e.AgentRegistered=`agent.registered`,e.AgentUnregistered=`agent.unregistered`,e.AgentOnline=`agent.online`,e.AgentOffline=`agent.offline`,e.WorkerOnline=`worker.online`,e.WorkerOffline=`worker.offline`,e.AgentTaskDispatched=`agent.task.dispatched`,e.AgentTaskAssigned=`agent.task.assigned`,e.AgentTrpcConnected=`agent.trpc.connected`,e.AgentWsConnected=`agent.ws.connected`,e.AgentWsDisconnected=`agent.ws.disconnected`,e.AgentBackupActivated=`agent.backup.activated`,e.OrchestrationSettingsUpdated=`orchestration.settings-updated`,e.PipelineAgentHwaccelChanged=`pipeline.agent-hwaccel-changed`,e.MotionAnalysis=`detection.motion-analysis`,e.MotionZonesRaw=`detection.motion-zones-raw`,e.MotionOnMotionChanged=`motion.on-motion-changed`,e.DetectionResult=`detection.result`,e.DetectionRaw=`detection.raw`,e.DetectionCameraNative=`detection.camera-native`,e.PipelineAudioInferenceResult=`pipeline.audio-inference-result`,e.DetectionPhaseTransition=`detection.phase-transition`,e.ProviderMotion=`provider.motion`,e.ProviderDetection=`provider.detection`,e.EnrichmentEmbeddingStored=`enrichment.embedding.stored`,e.EnrichmentSceneStateChanged=`enrichment.scene.state-changed`,e.EnrichmentActivitySummary=`enrichment.activity.summary`,e.PipelineAnalyticsTrackLifecycle=`pipeline-analytics.track-lifecycle`,e.PipelineAnalyticsTrackStarted=`pipeline-analytics.track-started`,e.PipelineAnalyticsTrackEnded=`pipeline-analytics.track-ended`,e.PipelineAnalyticsDetectionEvent=`pipeline-analytics.detection-event`,e.PipelineAnalyticsFrameTracked=`pipeline-analytics.frame-tracked`,e.PipelineAnalyticsStationaryChanged=`pipeline-analytics.stationary-changed`,e.PipelineAnalyticsPackageDelivered=`pipeline-analytics.package-delivered`,e.PipelineAnalyticsPackagePickedUp=`pipeline-analytics.package-picked-up`,e.PipelineAnalyticsFaceGalleryChanged=`pipeline-analytics.face-gallery-changed`,e.PipelineAnalyticsPlateGalleryChanged=`pipeline-analytics.plate-gallery-changed`,e.CameraStreamsProfileSlotsChanged=`camera-streams.onProfileSlotsChanged`,e.StreamOnline=`stream.online`,e.StreamOffline=`stream.offline`,e.NetworkTunnelStarted=`network.tunnel.started`,e.NetworkTunnelStopped=`network.tunnel.stopped`,e.LocalNetworkChanged=`network.local.changed`,e.MeshNetworkChanged=`network.mesh.changed`,e.BackupCompleted=`backup.completed`,e.BackupRunCompleted=`backup.run-completed`,e.BackupRestored=`backup.restored`,e.NotificationDispatched=`notification.dispatched`,e.NotificationFailed=`notification.failed`,e.DeviceUpdated=`device.updated`,e.DeviceOnline=`device.online`,e.DeviceOffline=`device.offline`,e.DeviceAwake=`device.awake`,e.DeviceSleeping=`device.sleeping`,e.RetentionCleanup=`retention.cleanup`,e.AddonsBulkUpdateProgress=`addons.bulk-update-progress`,e.AddonsJobProgress=`addons.job-progress`,e.AddonsJobLog=`addons.job-log`,e.AccessoriesChildVisibilityChanged=`accessories.onChildVisibilityChanged`,e.AccessoriesChanged=`accessories.onAccessoriesChanged`,e.ModelConvertProgress=`model-convert.progress`,e}({}),_e=new Set([`device.native-shadow-changed`]);function ve(e){return _e.has(e)}function ye(){let e=Object.values(ge).filter(e=>typeof e==`string`);return[...new Set(e)].filter(e=>!ve(e)).toSorted()}var be=[`f32le`,`pcmu`,`pcma`];function xe(e){return typeof e==`string`&&be.includes(e)}function Se(e){return e===`f32le`?4:1}function Ce(e,t){if(t===`f32le`){let t=new Uint8Array(e.byteLength);return t.set(e),t}let n=t===`pcmu`?Ee:De,r=new Float32Array(e.length);for(let t=0;t<e.length;t++)r[t]=n[e[t]];return new Uint8Array(r.buffer)}function we(){let e=new Float32Array(256);for(let t=0;t<256;t++){let n=~t&255,r=n&128?-1:1,i=n>>4&7;e[t]=r*((8*(n&15)+132<<i)-132)/32768}return e}function Te(){let e=new Float32Array(256);for(let t=0;t<256;t++){let n=t^85,r=n&128?1:-1,i=n>>4&7,a=n&15;e[t]=r*(i===0?16*a+8:16*a+264<<i-1)/32768}return e}var Ee=we(),De=Te(),Oe=[{id:`overview`,label:`Overview`,icon:`layout-dashboard`,order:-10},{id:`general`,label:`General`,icon:`settings`,order:0},{id:`image`,label:`Image`,icon:`image`,order:5},{id:`light`,label:`Light`,icon:`lightbulb`,order:7},{id:`motion`,label:`Motion`,icon:`activity`,order:10},{id:`audio`,label:`Audio`,icon:`mic`,order:12},{id:`alarms`,label:`Alarms`,icon:`bell-ring`,order:13},{id:`snapshot`,label:`Snapshot`,icon:`camera`,order:15},{id:`osd`,label:`OSD`,icon:`type`,order:18},{id:`stream-broker`,label:`Stream Broker`,icon:`radio`,order:20},{id:`streaming`,label:`Streaming`,icon:`video`,order:35},{id:`ptz`,label:`PTZ`,icon:`move`,order:40},{id:`navigation`,label:`Navigation`,icon:`compass`,order:41},{id:`consumables`,label:`Consumables`,icon:`recycle`,order:44},{id:`pipeline`,label:`Detection Pipeline`,icon:`cpu`,order:39},{id:`detection-pipeline`,label:`Detection pipeline`,icon:`cpu`,order:39},{id:`zones`,label:`Detection`,icon:`shapes`,order:38},{id:`analytics`,label:`Analytics`,icon:`activity`,order:37},{id:`live-stats`,label:`Live Stats`,icon:`activity`,order:39},{id:`recording`,label:`Recording`,icon:`circle-dot`,order:40},{id:`engine`,label:`Inference Engine`,icon:`zap`,order:41},{id:`scheduler`,label:`Scheduler`,icon:`list-checks`,order:42},{id:`decoder`,label:`Decoder`,icon:`film`,order:43},{id:`notifications`,label:`Notifications`,icon:`bell`,order:50},{id:`network`,label:`Network`,icon:`globe`,order:60},{id:`storage`,label:`Storage`,icon:`hard-drive`,order:70},{id:`advanced`,label:`Advanced`,icon:`wrench`,order:100}],ke=Object.fromEntries(Oe.map(e=>[e.id,e]));function Ae(e){return e.type===`separator`||e.type===`info`||e.type===`qr-code`||e.type===`button`||e.type===`object-array`||e.type===`widget`||e.type===`addon-action-button`||e.type===`device-action-button`}function je(e){let t=new Map;if(typeof e!=`object`||!e)return t;let n=e.sections;if(!Array.isArray(n))return t;for(let e of n)typeof e==`object`&&e&&Me(e.fields,t);return t}function Me(e,t){if(Array.isArray(e))for(let n of e){if(typeof n!=`object`||!n)continue;let e=n.type;if(e===`group`){Me(n.fields,t);continue}if(e===`sub-tabs`){let e=n.tabs;if(Array.isArray(e))for(let n of e)typeof n==`object`&&n&&Me(n.fields,t);continue}let r=n.key;typeof r!=`string`||r.length===0||`value`in n&&t.set(r,{value:n.value,default:n.default})}}function Ne(e){let t=new Map;for(let[n,r]of je(e))t.set(n,r.value??r.default);return t}function Pe(e,t){let n=je(e).get(t);return n===void 0?void 0:n.value??n.default}function Fe(e,t){return{...e.tabs?{tabs:[...e.tabs]}:{},sections:e.sections.map(e=>({...e,fields:e.fields.map(e=>Ie(e,t))}))}}function Ie(e,t){if(Ae(e))return e;if(e.type===`group`){let n=e.fields.map(e=>Ie(e,t));return{...e,fields:n}}if(e.type===`sub-tabs`){let n=e.tabs.map(e=>({...e,fields:e.fields.map(e=>Ie(e,t))}));return{...e,tabs:n}}let n=e.key,r=Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0,i=e.default;if(e.multiple){let t=Array.isArray(r)?r:r==null?[]:[r],n=e.multiple.itemDefault===void 0?i===void 0?Le(e)===`string`?``:null:i:e.multiple.itemDefault,a=Math.max(e.multiple.min,t.length),o=[];for(let e=0;e<a;e++)o.push(e<t.length?t[e]:n);return{...e,value:o}}let a=r===void 0?i===void 0?null:i:r,o=e.type===`textarea`&&e.isJson&&typeof a==`object`&&a?JSON.stringify(a,null,2):a;return{...e,value:o}}function Le(e){switch(e.type){case`text`:case`textarea`:case`password`:case`color`:case`probe`:case`timezone`:case`datetime`:return`string`;case`number`:case`slider`:return`number`;case`boolean`:return`boolean`;default:return`other`}}function Re(e,t){return e.category===t}function ze(e,t,n){return{id:typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2),timestamp:new Date,source:t,category:e,data:n}}function Be(e,t){let n=t.ts??Date.now();e.emit(ze(`system.ready-state`,{type:`capability`,id:t.capName,nodeId:t.sourceNodeId},{capName:t.capName,scope:t.scope,state:t.state,generation:t.generation,sourceNodeId:t.sourceNodeId,ts:n}))}function Ve(e){let t=async()=>{let t=(await e.read())[e.key];if(t===void 0)return e.fallback;let n=e.schema.safeParse(t);return n.success?n.data:(e.onParseError?.(e.key,n.error),e.fallback)},n=async t=>{let n=e.schema.parse(t);await e.write({[e.key]:n})};return{get:t,set:n,update:async e=>{await n(e(await t()))}}}function He(e){if(e==null||e===``)return`hub`;let t=e.indexOf(`/`);if(t<0)return e;let n=e.slice(0,t);return n===``?`hub`:n}function Ue(e,t){return`${e}@${He(t)}`}function We(e,t,n){return e[Ue(t,n)]}function Ge(e,t,n){let r={};for(let[i,a]of Object.entries(e))r[t.has(i)?Ue(i,n):i]=a;return r}function Ke(e,t,n){let r={};for(let[n,i]of Object.entries(e))n.includes(`@`)||t.has(n)||(r[n]=i);for(let i of t){let t=We(e,i,n);t!==void 0&&(r[i]=t)}return r}var qe=class{_ctx=null;_config;_readinessGeneration=typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2,14);_registeredCapNames=[];settingsStoreReady=!1;defaults;constructor(e){this.defaults=e,this._config={...e}}get autoEmitReadiness(){return!0}get ctx(){if(!this._ctx)throw Error(`${this.constructor.name}: ctx accessed before initialize()`);return this._ctx}get ctxIfReady(){return this._ctx}get config(){return this._config}async initialize(e){this._ctx=e,await this.resolveConfig();let t=await this.onInitialize();this.emitLifecycle(ge.AddonStarted);let n=Xe(t),r=n&&`providers`in n&&n.providers?n.providers:[];return this._registeredCapNames=r.map(e=>e.capability.name),n}postBrokerStart(){this.autoEmitReadiness&&this._registeredCapNames.length>0&&this.emitReadinessForProviders(`ready`)}async onHubReachable(){}async shutdown(){this.emitLifecycle(ge.AddonStopped),this.autoEmitReadiness&&this.emitReadinessForProviders(`down`),await this.onShutdown();for(let e of this._subscriptions)e();this._subscriptions=[],this._ctx=null}async onShutdown(){}async onConfigChanged(){}field(e){return e}schema(e){return e}globalSettingsSchema(e){return null}deviceSettingsSchema(){return null}integrationSettingSections(){return[]}async getGlobalSettings(e,t,n){let r=this.globalSettingsSchema(t);if(!r)return{sections:[]};let i=await this.resolveGlobalStore(n,t);return Fe(r,e?{...i,...e}:i)}async getIntegrationSettings(e){let t=this.integrationSettingSections();if(t.length===0)return null;let n=this.globalSettingsSchema();if(!n)throw Error(`${this.constructor.name}: integrationSettingSections() names [${t.join(`, `)}] but globalSettingsSchema() returns null.`);let r=new Map(n.sections.map(e=>[e.id,e])),i=[];for(let e of t){let t=r.get(e);if(!t)throw Error(`${this.constructor.name}: integrationSettingSections() names unknown section "${e}". Known sections: [${[...r.keys()].join(`, `)}].`);let n=Je(t.fields);n.length!==0&&i.push({...t,fields:n})}if(i.length===0)return null;let a=await this.resolveGlobalStore(e);return Fe({...n,sections:i},a)}async resolveGlobalStore(e,t){let n=await this._ctx?.settings?.readAddonStore()??{},r=this.perNodeKeys(t),i=He(e??this._ctx?.kernel?.localNodeId);return r.size>0?Ke(n,r,i):n}async readStoredGlobalKey(e){let t=this._ctx?.settings?.readAddonStoreResult;if(t===void 0)return{kind:`unreadable`,reason:`three-way-read-unavailable`};let n;try{n=await t.call(this._ctx?.settings)}catch(e){return{kind:`unreadable`,reason:`store-read-failed`,error:e instanceof Error?e.message:String(e)}}return n.kind===`failed`?{kind:`unreadable`,reason:`store-read-failed`,error:n.error}:n.kind===`missing`||!Object.prototype.hasOwnProperty.call(n.value,e)?{kind:`absent`}:{kind:`present`,value:n.value[e]}}async updateGlobalSettings(e,t){let n=this.perNodeKeys(),r=He(this._ctx?.kernel?.localNodeId),i=He(t??this._ctx?.kernel?.localNodeId),a=e,o=n.size>0?Ge(a,n,i):a;await this._ctx?.settings?.writeAddonStore(o),i===r&&(await this.resolveConfig(),await this.onConfigChanged(),this.emitLifecycle(ge.AddonUpdated,{level:`global`}),this.maybeAutoRestart(e,this.globalSettingsSchema()))}_perNodeKeysCache=new Map;perNodeKeys(e){let t=e??``,n=this._perNodeKeysCache.get(t);if(n)return n;let r=this.globalSettingsSchema(e),i=new Set(r?r.sections.flatMap(e=>Ye(e.fields)):[]);return this._perNodeKeysCache.set(t,i),i}maybeAutoRestart(e,t){if(!t)return;let n=new Set;for(let e of t.sections)for(let t of e.fields)t.type===`separator`||t.type===`info`||t.requiresRestart&&n.add(t.key);if(n.size===0||!Object.keys(e).some(e=>n.has(e)))return;let r=this._ctx;if(!r)return;let i=r.id;setImmediate(()=>{r.api.addons?.restartAddon?.mutate({addonId:i}).then(()=>{r.logger.info(`addon auto-restart triggered by restart-required setting change`,{meta:{changedFields:Object.keys(e).filter(e=>n.has(e))}})}).catch(e=>{r.logger.error(`addon auto-restart failed`,{meta:{error:e instanceof Error?e.message:String(e)}})})})}async getDeviceSettings(e){let t=this.deviceSettingsSchema();return t?Fe(t,await this._ctx?.settings?.readDeviceStore(e)??{}):{sections:[]}}async updateDeviceSettings(e,t){await this._ctx?.settings?.writeDeviceStore(e,t)}_subscriptions=[];watchCapability(e,t){let n=new Set(Array.isArray(e)?e:[e]);this.subscribe({category:`system.ready-state`},e=>{let r=e.data;if(typeof r.capName!=`string`||!n.has(r.capName)||r.scope?.type!==`node`)return;let i=r.scope.nodeId;if(typeof i!=`string`||i.length===0)return;let a=r.capName;r.state===`down`?t.onDown?.(i,a):r.state===`ready`&&t.onReady?.(i,a)})}subscribe(e,t){let n=this.ctx.eventBus.subscribe(e,t);this._subscriptions.push(n)}emitLifecycle(e,t){try{let n=this._ctx;if(!n)return;n.eventBus.emit({id:`${n.id}-${Date.now()}`,timestamp:new Date,source:{type:`addon`,id:n.id,nodeId:n.kernel.localNodeId??`hub`},category:e,data:{addonId:n.id,...t}})}catch{}}emitReadinessForProviders(e){let t=this._ctx;if(!t||this._registeredCapNames.length===0)return;let n=t.kernel?.localNodeId??`hub`,r=n.includes(`/`)?n.split(`/`)[0]:n;for(let n of this._registeredCapNames)try{Be(t.eventBus,{capName:n,scope:{type:`node`,nodeId:r},state:e,generation:this._readinessGeneration,sourceNodeId:r})}catch{}}async resolveModelsDir(){let{join:n}=await t(async()=>{let{join:t}=await import(`./__vite-browser-external-Cc3gW-QT.js`).then(t=>e(t.t(),1));return{join:t}},__vite__mapDeps([0,1]),import.meta.url),{promises:r}=await t(async()=>{let{promises:t}=await import(`./__vite-browser-external-Cc3gW-QT.js`).then(t=>e(t.t(),1));return{promises:t}},__vite__mapDeps([0,1]),import.meta.url),i=n(this.ctx.nodeDataDir,`models`);return await r.mkdir(i,{recursive:!0}),i}get capabilities(){return this.ctx.capabilities??null}async resolveConfig(){let e=await this.readAddonStoreWithRetry(),t=this.perNodeKeys(),n=He(this._ctx?.kernel?.localNodeId),r={...this.defaults};for(let i of Object.keys(this.defaults)){let a=t.has(i)?We(e,i,n):e[i];if(a!=null){let e=typeof this.defaults[i];typeof a===e&&(r[i]=a)}}this._config=r}state(e,t,n){return Ve({key:e,schema:t,fallback:n,read:()=>this.readAddonStoreWithRetry(),write:async e=>{await this._ctx?.settings?.writeAddonStore(e)},onParseError:(e,t)=>this._ctx?.logger?.warn?.(`durable-state: stored "${e}" failed validation — using fallback`,{meta:{addonId:this._ctx?.id,key:e,error:String(t)}})})}deviceState(e,t,n,r){return Ve({key:t,schema:n,fallback:r,read:async()=>await this._ctx?.settings?.readDeviceStore(e)??{},write:async t=>{await this._ctx?.settings?.writeDeviceStore(e,t)},onParseError:(t,n)=>this._ctx?.logger?.warn?.(`durable-state: stored device ${e} "${t}" failed validation — using fallback`,{meta:{addonId:this._ctx?.id,deviceId:e,key:t,error:String(n)}})})}async readAddonStoreWithRetry(){let e=this._ctx?.settings;if(!e)return{};let t=[150,350,600,900],n;for(let r=0;r<=t.length;r++)try{let t=await e.readAddonStore()??{};return this.settingsStoreReady=!0,t}catch(e){n=e;let i=e instanceof Error?e.message:String(e);if(!(i.includes(`SqliteSettingsBackend not initialized`)||i.includes(`provider not available`)))throw e;if(r===t.length)break;await new Promise(e=>setTimeout(e,t[r]))}return this.settingsStoreReady=!1,this._ctx?.logger?.warn?.(`readAddonStore: settings-store unavailable after retries — using defaults`,{meta:{error:n instanceof Error?n.message:String(n)}}),{}}};function Je(e){let t=[];for(let n of e){if(n.type===`group`){let e=Je(n.fields);e.length>0&&t.push({...n,fields:e});continue}if(n.type===`sub-tabs`){let e=n.tabs.map(e=>({...e,fields:Je(e.fields)})).filter(e=>e.fields.length>0);e.length>0&&t.push({...n,tabs:e});continue}`perNode`in n&&n.perNode===!0||t.push(n)}return t}function Ye(e){let t=[];for(let n of e){if(n.type===`group`){t.push(...Ye(n.fields));continue}if(n.type===`sub-tabs`){for(let e of n.tabs)t.push(...Ye(e.fields));continue}`perNode`in n&&n.perNode===!0&&t.push(n.key)}return t}function Xe(e){if(e!=null)return Array.isArray(e)?{providers:e}:e}var Ze=class{disposers=[];disposed=!1;onError;constructor(e={}){this.onError=e.onError??((e,t)=>{console.error(`[DisposerChain] disposer #${t} threw`,e)})}add(e){if(this.disposed){try{let t=e();t&&typeof t.then==`function`&&t.catch(e=>this.onError(e,-1))}catch(e){this.onError(e,-1)}return()=>void 0}return this.disposers.push(e),()=>{let t=this.disposers.indexOf(e);t>=0&&this.disposers.splice(t,1)}}get isDisposed(){return this.disposed}get size(){return this.disposers.length}async dispose(){if(this.disposed)return;this.disposed=!0;let e=this.disposers.slice().toReversed();this.disposers=[];for(let t=0;t<e.length;t++){let n=e[t];try{let e=n();e&&typeof e.then==`function`&&await e}catch(n){this.onError(n,e.length-1-t)}}}},Qe=`x-camstack-dataplane-secret`,$e=[`grid-view`,`events-view`],et=3e4,tt=64,nt=15e3,rt=256*1024,it=u({url:c().min(1),hostNodeId:c().min(1),expiresAtMs:i().int().nonnegative(),declaredBytes:i().int().nonnegative().nullable()}),S=y([`high`,`mid`,`low`]),at=[`high`,`mid`,`low`],ot=d([S,p(`auto`)]),st=y([`pull-rtsp`,`pull-rtmp`,`pull-http`,`pull-flv`,`pull-rfc4571`,`push-annexb`,`derived`]),ct=u({width:i().int().positive(),height:i().int().positive()}),lt=u({camStreamId:c().min(1),deviceId:i().int().nonnegative(),kind:st,url:c().optional(),codec:c().optional(),resolution:ct.optional(),fps:i().positive().optional(),label:c().optional(),deviceFeatures:b(c()).optional(),autoEligible:x().optional(),profileHint:S.optional(),metadata:_(c(),o()).optional()}),ut=y([`unassigned`,`idle`,`connecting`,`streaming`,`error`]),dt=u({deviceId:i().int().nonnegative(),profile:S,brokerId:c(),sourceCamStreamId:c().nullable(),status:ut,resolution:ct.optional(),codec:c().optional(),preBufferSec:i().nonnegative().optional(),errorMessage:c().optional()});function ft(e,t){return`${e}/${t}`}function pt(e,t){return`${e}/${t}`}function mt(e){let t=e.indexOf(`/`);if(t<=0)return null;let n=e.slice(0,t),r=e.slice(t+1);if(!/^\d+$/.test(n))return null;let i=S.safeParse(r);return i.success?{deviceId:Number(n),profile:i.data}:null}function ht(e,t){let n=[...e].filter(e=>t===void 0||e.deviceId===t).toSorted((e,t)=>at.indexOf(e.profile)-at.indexOf(t.profile)),r=new Set,i=[];for(let e of n){let t=e.sourceCamStreamId;t!==null&&(r.has(t)||(r.add(t),i.push(e)))}return i}var gt=u({id:c(),label:c(),protocol:y([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:c().optional(),resolution:u({width:i(),height:i()}).readonly().optional(),fps:i().optional(),bitrate:i().optional(),codec:c().optional(),profileHint:S.optional()}),_t=u({type:c(),url:c(),videoCodec:c().optional(),audioCodec:c().optional(),metadata:_(c(),o()).readonly().optional()}),vt=u({type:y([`video`,`audio`]),data:v(Uint8Array),pts:i(),dts:i(),keyframe:x(),codec:c()}),yt=u({data:v(Uint8Array),width:i(),height:i(),format:y([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),timestamp:i()}),C=u({shmId:c(),slot:i().int().nonnegative(),seq:i().int().nonnegative(),width:i().int().positive(),height:i().int().positive(),format:y([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),pts:i(),byteLength:i().int().nonnegative(),nodeId:c(),slotCount:i().int().positive()}),bt=y([`rgb`,`bgr`,`yuv420`,`gray`]),xt=u({brokerId:c(),format:bt,maxFps:i().positive().optional(),tag:c().optional()}),St=u({subscriptionId:c(),maxFps:i().nonnegative()}),Ct=y(be),wt=u({data:v(Uint8Array),sampleRate:i().int().positive(),channels:i().int().positive(),timestamp:i(),format:Ct.optional()}),Tt=u({brokerId:c(),tag:c().optional(),accept:b(Ct).readonly().optional()}),Et=u({subscriptionId:c()}),Dt=y([`idle`,`connecting`,`streaming`,`error`,`stopped`]),Ot=u({status:Dt,inputFps:i(),decodeFps:i(),encodedSubscribers:i(),decodedSubscribers:i(),uptimeMs:i(),bitrateKbps:i(),idrIntervalMs:i(),codec:c().optional(),totalBytes:i(),packetCount:i(),rtspClients:i(),pipeClients:i(),preBufferSec:i(),preBufferMs:i(),preBufferPackets:i(),decoderNodeId:c().nullable(),audio:u({codec:c(),sampleRate:i(),channels:i(),supported:x()}).nullable().optional(),audioMuted:x().optional(),audioMutedDropped:i().optional()}),kt=u({profile:S,brokerId:c(),url:c(),mutedUrl:c(),enabled:x(),codec:c().optional(),resolution:ct.optional()}),At=class extends Error{capName;scope;waitedMs;constructor(e,t,n){super(`Timed out waiting for ${e} (${Mt(t)}) to become ready after ${n}ms`),this.name=`ReadinessTimeoutError`,this.capName=e,this.scope=t,this.waitedMs=n}};function jt(e,t){return`${e}|${Mt(t)}`}function Mt(e){switch(e.type){case`global`:return`global`;case`node`:return`node:${e.nodeId}`;case`device`:return`device:${e.deviceId}`}}function Nt(e){switch(e){case`starting`:return 0;case`ready`:return 1;case`down`:return 2}}function Pt(e,t){return e.type===t.type?e.type===`global`||t.type===`global`?!0:e.type===`node`&&t.type===`node`?e.nodeId===t.nodeId:e.type===`device`&&t.type===`device`?e.deviceId===t.deviceId:!1:!1}var Ft=class{bus;sourceNodeId;logger;now;generation;verboseDeviceScopeLogs;snapshot=new Map;subscriptions=new Set;unsubscribeBus;unsubscribeAgentOffline;constructor(e){if(this.bus=e.eventBus,this.sourceNodeId=e.sourceNodeId,this.logger=e.logger,this.now=e.now??(()=>Date.now()),this.generation=e.generation??It(),this.verboseDeviceScopeLogs=e.verboseDeviceScopeLogs??!1,this.unsubscribeBus=this.bus.subscribe({category:`system.ready-state`},e=>this.ingest(e.data)),this.unsubscribeAgentOffline=this.bus.subscribe({category:`agent.offline`},e=>this.synthesizeDownForNode(e.data.agentId)),typeof this.bus.getRecent==`function`)try{let e=this.bus.getRecent({category:`system.ready-state`});for(let t of e)this.ingest(t.data)}catch{}}close(){this.unsubscribeBus(),this.unsubscribeAgentOffline(),this.subscriptions.clear()}get(e,t){return this.snapshot.get(jt(e,t))??null}getSnapshotForTransport(){return Array.from(this.snapshot.values())}hydrate(e){let t=this.now(),n=0;for(let r of e){let e=jt(r.capName,r.scope),i=this.snapshot.get(e)??null,a,o;if(i!==null){if(this.isLocallyAuthoritative(i))continue;let e=i.generation===r.generation;if(e&&Nt(r.state)<=Nt(i.state))continue;a=!e&&r.state===`ready`?i.epoch+1:i.epoch,o=Math.max(0,t-i.lastChange)}else a=1,o=0;let s={capName:r.capName,scope:r.scope,state:r.state,generation:r.generation,epoch:a,lastChange:t,sourceNodeId:r.sourceNodeId};this.snapshot.set(e,s),n++,this.logPerRecord(r.scope,`readiness: ${r.capName} (${Mt(r.scope)}) → ${r.state} (hydrated${i===null?``:` update`}, gen=${r.generation.slice(0,6)})`);let c={capName:r.capName,scope:r.scope,state:r.state,epoch:a,generation:r.generation,sourceNodeId:`hydrated`,ts:t,durationInPrevState:o};for(let e of this.subscriptions)if(e.capName===r.capName&&Pt(e.scope,r.scope))try{e.handler(c)}catch(e){this.logger?.warn(`readiness hydrate handler threw for ${r.capName}: ${e.message??String(e)}`)}}return n}logPerRecord(e,t){if(this.logger){if(e.type===`device`){if(!this.verboseDeviceScopeLogs)return;this.logger.debug(t,{tags:{deviceId:e.deviceId}});return}this.logger.debug(t)}}isLocallyAuthoritative(e){return e.scope.type===`node`?e.scope.nodeId===this.sourceNodeId:e.sourceNodeId===this.sourceNodeId}getAll(){return new Map(this.snapshot)}emitReady(e,t){this.emitTransition(e,t,`ready`)}emitStarting(e,t){this.emitTransition(e,t,`starting`)}emitDown(e,t){this.emitTransition(e,t,`down`)}awaitReady(e,t,n={}){let r=n.timeoutMs??1/0,i=this.now();return this.get(e,t)?.state===`ready`?Promise.resolve():n.signal?.aborted?Promise.reject(n.signal.reason??Error(`aborted`)):new Promise((a,o)=>{let s=!1,c=this.onReadyState(e,t,e=>{e.state===`ready`&&(s||(s=!0,f(),a()))}),l=Number.isFinite(r)?setTimeout(()=>{s||(s=!0,f(),o(new At(e,t,this.now()-i)))},r):null,u=setInterval(()=>{s||this.logger?.warn(`readiness: still awaiting ${e} (${Mt(t)}) after ${this.now()-i}ms`)},3e4);typeof u.unref==`function`&&u.unref();let d=()=>{s||(s=!0,f(),o(n.signal?.reason??Error(`aborted`)))};n.signal?.addEventListener(`abort`,d,{once:!0});function f(){c(),l!==null&&clearTimeout(l),clearInterval(u),n.signal?.removeEventListener(`abort`,d)}})}onReadyState(e,t,n){let r={capName:e,scope:t,handler:n};this.subscriptions.add(r);let i=this.get(e,t);return i!==null&&queueMicrotask(()=>{this.subscriptions.has(r)&&n({capName:e,scope:t,state:i.state,epoch:i.epoch,generation:i.generation,sourceNodeId:this.sourceNodeId,ts:i.lastChange,durationInPrevState:0})}),()=>{this.subscriptions.delete(r)}}emitTransition(e,t,n){let r=this.now();this.bus.emit(ze(`system.ready-state`,{type:`capability`,id:e,nodeId:this.sourceNodeId},{capName:e,scope:t,state:n,generation:this.generation,sourceNodeId:this.sourceNodeId,ts:r}))}ingest(e){if(typeof e?.capName!=`string`||e.state!==`ready`&&e.state!==`starting`&&e.state!==`down`||typeof e.generation!=`string`||e.scope?.type!==`global`&&e.scope?.type!==`node`&&e.scope?.type!==`device`)return;let t=jt(e.capName,e.scope),n=this.snapshot.get(t)??null,r=this.now(),i;if(i=n===null?+(e.state===`ready`):n.generation!==e.generation&&e.state===`ready`?n.epoch+1:n.epoch,n!==null&&n.generation===e.generation&&n.state===e.state)return;let a=n===null?0:Math.max(0,r-n.lastChange),o={capName:e.capName,scope:e.scope,state:e.state,generation:e.generation,epoch:i,lastChange:r,sourceNodeId:e.sourceNodeId};this.snapshot.set(t,o);let s={capName:e.capName,scope:e.scope,state:e.state,epoch:i,generation:e.generation,sourceNodeId:e.sourceNodeId,ts:e.ts,durationInPrevState:a};this.logPerRecord(e.scope,`readiness: ${e.capName} (${Mt(e.scope)}) → ${e.state} epoch=${i} gen=${e.generation.slice(0,6)} (prev ${a}ms)`);for(let t of this.subscriptions)if(t.capName===e.capName&&Pt(t.scope,e.scope))try{t.handler(s)}catch(t){this.logger?.warn(`readiness handler threw for ${e.capName}: ${t.message??String(t)}`)}}synthesizeDownForNode(e){let t=this.now();for(let[n,r]of this.snapshot){if(r.state===`down`||!(r.scope.type===`node`&&r.scope.nodeId===e||r.scope.type===`device`&&r.sourceNodeId===e))continue;let i=Math.max(0,t-r.lastChange),a={...r,state:`down`,lastChange:t};this.snapshot.set(n,a);let o={capName:r.capName,scope:r.scope,state:`down`,epoch:r.epoch,generation:r.generation,sourceNodeId:this.sourceNodeId,ts:t,durationInPrevState:i};this.logPerRecord(r.scope,`readiness: ${r.capName} (${Mt(r.scope)}) → down (synthesized from agent.offline ${e})`);for(let e of this.subscriptions)if(e.capName===r.capName&&Pt(e.scope,r.scope))try{e.handler(o)}catch(e){this.logger?.warn(`readiness handler threw during agent.offline demux for ${r.capName}: ${e.message??String(e)}`)}}}};function It(){return typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2,14)}function Lt(e,t){for(let{capName:n,scope:r}of t)e.emitDown(n,r)}var Rt=`__camstackNodePin`;function zt(e){return{context:{[Rt]:Bt(e)}}}function Bt(e){let t=e.split(`/`)[0];return t===void 0||t.length===0?e:t}function Vt(e){if(typeof e!=`object`||!e)return;let t=Reflect.get(e,Rt);return typeof t==`string`?t:void 0}u({field:c().min(1),on:p(`advance`)});var Ht=`session`;function Ut(e){return e.mount?e.mount:e.deviceNative===!0?{kind:`device-native`}:e.scope===`device`&&e.kind===`wrapper`?{kind:`device-scoped`}:e.mode===`collection`?{kind:`collection`}:{kind:`singleton`}}var Wt=`provider`,Gt=u({id:c(),title:c(),description:c().optional(),style:y([`card`,`accordion`]).optional(),defaultCollapsed:x().optional(),columns:d([p(1),p(2),p(3),p(4)]).optional(),tab:c().optional(),location:y([`settings`,`top-tab`]).optional(),order:i().optional(),fields:b(m())}),Kt=u({tabs:b(u({id:c(),label:c(),icon:c(),order:i().optional()})).optional(),sections:b(Gt)}).nullable(),qt={getDeviceSettingsContribution:{input:u({deviceId:i()}),output:Kt,kind:`query`,auth:`protected`},getDeviceLiveContribution:{input:u({deviceId:i()}),output:Kt,kind:`query`,auth:`protected`},applyDeviceSettingsPatch:{input:u({deviceId:i(),patch:_(c(),o())}),output:u({success:p(!0)}),kind:`mutation`,auth:`admin`}},Jt={getStatus:{input:u({deviceId:i()}),output:o().nullable(),kind:`query`,auth:`protected`}};function Yt(e){let t=e.methods;return e.exposesDeviceSettings&&(t={...qt,...t}),e.status&&(t={...Jt,...t}),t}function w(e,t,n){return{input:e,output:t,kind:n?.kind??`query`,...n?.auth===void 0?{}:{auth:n.auth},...n?.access===void 0?{}:{access:n.access},...n?.caller===void 0?{}:{caller:n.caller},timeoutMs:n?.timeoutMs}}function Xt(e,t,n){return{...w(e,t,n),systemOnly:!0}}function Zt(e,t,n){return{...w(e,t,n),providerOptional:!0}}function Qt(e){return{data:e}}function $t(e){return e?.deviceConfig!==void 0}var en=u({staticDir:c()}),tn=u({version:c()}),nn={name:`admin-ui`,scope:`system`,mode:`singleton`,internal:!0,methods:{getStaticDir:w(g(),en,{auth:`admin`}),getVersion:w(g(),tn,{auth:`admin`})}};function rn(e){return e}function an(e,t,n){return{input:e,output:t,kind:n?.kind??`query`,auth:n?.auth??`protected`,scope:n?.scope??{kind:`system`},...n?.caller?{caller:`required`}:{}}}function on(e,t,n){return{input:e,output:t,kind:n?.kind??`query`,auth:n?.auth??`protected`,scope:{kind:`device`,...n?.deviceTypes?{deviceTypes:n.deviceTypes}:{}}}}function sn(e){let t={};for(let[n,r]of Object.entries(e))t[n]={kind:r.kind,auth:r.auth,scope:r.scope,...r.caller===`required`?{caller:`required`}:{}};return t}var cn=256,ln=u({staticDir:c()}),un=u({version:c()}),dn={name:`viewer-ui`,scope:`system`,mode:`singleton`,internal:!0,methods:{getStaticDir:w(g(),ln,{auth:`admin`}),getVersion:w(g(),un,{auth:`admin`})}},fn=u({id:c(),label:c(),protocol:y([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:c().optional(),resolution:u({width:i(),height:i()}).optional(),fps:i().optional(),bitrate:i().optional(),codec:c().optional(),profileHint:S.optional(),sdp:c().optional()}),pn=u({key:c(),value:o()}),mn=u({source:c(),data:_(c(),o())}),hn={name:`device-ops`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{getStreamSources:w(u({deviceId:i()}),b(fn)),getConfigEntries:w(u({deviceId:i()}),b(pn)),setConfig:w(u({deviceId:i(),values:_(c(),o())}),g(),{kind:`mutation`,auth:`admin`}),runAction:w(u({deviceId:i(),action:c().min(1),input:o()}),o(),{kind:`mutation`}),removeDevice:w(u({deviceId:i()}),g(),{kind:`mutation`,auth:`admin`}),getSettingsSchema:w(u({deviceId:i()}),o().nullable()),getRawState:w(u({deviceId:i()}),mn.nullable(),{auth:`protected`})}},gn=`device.state-changed`;function _n(e){let t=new Map,n=new Map,r=null,i=(e,t)=>`${e}:${t}`,a=()=>{r||e.live?.onEvent&&(r=e.live.onEvent.subscribe({category:gn},{onData:e=>{let r=e.data;if(!r||typeof r.deviceId!=`number`||typeof r.capName!=`string`)return;let a=i(r.deviceId,r.capName);t.set(a,r.slice);let o=n.get(a);if(o)for(let e of o)try{e(r.slice)}catch{}}}))},o=()=>{r&&(n.size>0||(r.unsubscribe(),r=null))};return{read(e,n){return t.get(i(e,n))},async refresh(r,a){let o=await e.deviceState.getCapSlice.query({deviceId:r,capName:a}),s=i(r,a);t.set(s,o??void 0);let c=n.get(s);if(c)for(let e of c)try{e(o??void 0)}catch{}},watch(e,t,r){let s=i(e,t),c=n.get(s);return c||(c=new Set,n.set(s,c)),c.add(r),a(),()=>{c.delete(r),c.size===0&&n.delete(s),o()}},async write(t,n,r){await e.deviceState.setCapSlice.mutate({deviceId:t,capName:n,slice:r})}}}function vn(e){let{eventBus:t,api:n}=e,r=new Map,i=new Map,a=null,o=(e,t)=>`${e}:${t}`,s=(e,t,n)=>{let a=o(e,t);r.set(a,n);let s=i.get(a);if(s)for(let e of s)try{e(n)}catch{}},c=()=>{a||=t.subscribe({category:gn},e=>{let t=e.data;if(typeof t!=`object`||!t)return;let n=Reflect.get(t,`deviceId`),r=Reflect.get(t,`capName`);typeof n!=`number`||typeof r!=`string`||s(n,r,Reflect.get(t,`slice`))})},l=()=>{a!==null&&(i.size>0||(a(),a=null))};return{read(e,t){return r.get(o(e,t))},async refresh(e,t){s(e,t,await n.deviceState.getCapSlice.query({deviceId:e,capName:t})??void 0)},watch(e,t,n){let r=o(e,t),a=i.get(r);return a||(a=new Set,i.set(r,a)),a.add(n),c(),()=>{a.delete(n),a.size===0&&i.delete(r),l()}},async write(e,t,r){await n.deviceState.setCapSlice.mutate({deviceId:e,capName:t,slice:r})}}}function yn(e,t,n){let r=(e,t)=>`${e}:${t}`;return{read(t,n){return e.get(t)?.get(n)},async refresh(){},watch(e,n,i){let a=r(e,n),o=t.get(a);return o||(o=new Set,t.set(a,o)),o.add(i),()=>{o.delete(i),o.size===0&&t.delete(a)}},async write(e,t,r){if(!n)throw Error(`createMirrorSource: write requires an api reference — pass it as the third argument when constructing the source`);await n.deviceState.setCapSlice.mutate({deviceId:e,capName:t,slice:r})}}}function T(e,t,n){let r=bn(e)?e:_n(e);return{get value(){return r.read(t,n)},refresh(){return r.refresh(t,n)},subscribe(e){let i=r.watch(t,n,t=>{try{e(t)}catch{}});try{e(r.read(t,n))}catch{}return r.read(t,n)===void 0&&r.refresh(t,n).catch(()=>void 0),i},async set(e){await r.write(t,n,e)},async patch(e){let i={...r.read(t,n),...e};await r.write(t,n,i)}}}function bn(e){return typeof e.read==`function`&&typeof e.watch==`function`}function xn(e,t,n){let r=e,i=n?.stateSource??_n(e);function a(e,n){let r=typeof e==`object`&&e?e:{};return n===void 0?{...r,deviceId:t.deviceId}:{...r,deviceId:t.deviceId,nodeId:n}}function o(e,t,n,i,a){let o=r[e]?.[t];if(!o)throw Error(`DeviceProxy: api has no '${e}.${t}'`);let s=o;return n===`mutation`?s.mutate(i):n===`subscription`?s.subscribe(i,a):s.query(i)}function s(e,n,r,i,s,c){return o(n,r,i,a(s,t.entries.find(t=>t.capName===e)?.providerNodeId),c)}function c(e,t,n,r,i){return o(e,t,n,a(r,void 0),i)}return{deviceId:t.deviceId,binding:t,state:{airQualitySensor:T(i,t.deviceId,`air-quality-sensor`),alarmPanel:T(i,t.deviceId,`alarm-panel`),ambientLightSensor:T(i,t.deviceId,`ambient-light-sensor`),audioMetrics:T(i,t.deviceId,`audio-metrics`),automationControl:T(i,t.deviceId,`automation-control`),battery:T(i,t.deviceId,`battery`),binary:T(i,t.deviceId,`binary`),brightness:T(i,t.deviceId,`brightness`),cameraStreams:T(i,t.deviceId,`camera-streams`),carbonMonoxide:T(i,t.deviceId,`carbon-monoxide`),climateControl:T(i,t.deviceId,`climate-control`),color:T(i,t.deviceId,`color`),connectivity:T(i,t.deviceId,`connectivity`),consumables:T(i,t.deviceId,`consumables`),contact:T(i,t.deviceId,`contact`),control:T(i,t.deviceId,`control`),cover:T(i,t.deviceId,`cover`),dayNight:T(i,t.deviceId,`day-night`),deviceDiscovery:T(i,t.deviceId,`device-discovery`),deviceStatus:T(i,t.deviceId,`device-status`),doorbell:T(i,t.deviceId,`doorbell`),enumSensor:T(i,t.deviceId,`enum-sensor`),eventEmitter:T(i,t.deviceId,`event-emitter`),fanControl:T(i,t.deviceId,`fan-control`),featureProbe:T(i,t.deviceId,`feature-probe`),flood:T(i,t.deviceId,`flood`),gas:T(i,t.deviceId,`gas`),humidifier:T(i,t.deviceId,`humidifier`),humiditySensor:T(i,t.deviceId,`humidity-sensor`),image:T(i,t.deviceId,`image`),imageSettings:T(i,t.deviceId,`image-settings`),intercom:T(i,t.deviceId,`intercom`),lawnMowerControl:T(i,t.deviceId,`lawn-mower-control`),lockControl:T(i,t.deviceId,`lock-control`),mediaPlayer:T(i,t.deviceId,`media-player`),motion:T(i,t.deviceId,`motion`),motionTrigger:T(i,t.deviceId,`motion-trigger`),motionZones:T(i,t.deviceId,`motion-zones`),nativeObjectDetection:T(i,t.deviceId,`native-object-detection`),navigation:T(i,t.deviceId,`navigation`),networkLink:T(i,t.deviceId,`network-link`),notifier:T(i,t.deviceId,`notifier`),numericSensor:T(i,t.deviceId,`numeric-sensor`),petFeeder:T(i,t.deviceId,`pet-feeder`),powerMeter:T(i,t.deviceId,`power-meter`),presence:T(i,t.deviceId,`presence`),pressureSensor:T(i,t.deviceId,`pressure-sensor`),privacyMask:T(i,t.deviceId,`privacy-mask`),ptzAutotrack:T(i,t.deviceId,`ptz-autotrack`),recordingOnboard:T(i,t.deviceId,`recording-onboard`),recordingSignal:T(i,t.deviceId,`recording-signal`),sceneMonitor:T(i,t.deviceId,`scene-monitor`),scriptRunner:T(i,t.deviceId,`script-runner`),smoke:T(i,t.deviceId,`smoke`),streamCatalog:T(i,t.deviceId,`stream-catalog`),streamParams:T(i,t.deviceId,`stream-params`),streamSignals:T(i,t.deviceId,`stream-signals`),switch:T(i,t.deviceId,`switch`),tamper:T(i,t.deviceId,`tamper`),temperatureSensor:T(i,t.deviceId,`temperature-sensor`),update:T(i,t.deviceId,`update`),vacuumControl:T(i,t.deviceId,`vacuum-control`),valve:T(i,t.deviceId,`valve`),vibration:T(i,t.deviceId,`vibration`),waterHeater:T(i,t.deviceId,`water-heater`),weather:T(i,t.deviceId,`weather`),zoneAnalytics:T(i,t.deviceId,`zone-analytics`),zoneRules:T(i,t.deviceId,`zone-rules`),zones:T(i,t.deviceId,`zones`)},accessories:{setChildHidden:e=>s(`accessories`,`accessories`,`setChildHidden`,`mutation`,e),getStatus:e=>s(`accessories`,`accessories`,`getStatus`,`query`,e)},airQualitySensor:{getStatus:e=>s(`air-quality-sensor`,`airQualitySensor`,`getStatus`,`query`,e)},alarmPanel:{arm:e=>s(`alarm-panel`,`alarmPanel`,`arm`,`mutation`,e),disarm:e=>s(`alarm-panel`,`alarmPanel`,`disarm`,`mutation`,e),trigger:e=>s(`alarm-panel`,`alarmPanel`,`trigger`,`mutation`,e),getStatus:e=>s(`alarm-panel`,`alarmPanel`,`getStatus`,`query`,e)},ambientLightSensor:{getStatus:e=>s(`ambient-light-sensor`,`ambientLightSensor`,`getStatus`,`query`,e)},audioAnalysis:{resolveDeviceSettings:e=>s(`audio-analysis`,`audioAnalysis`,`resolveDeviceSettings`,`query`,e),getDeviceSettingsContribution:e=>s(`audio-analysis`,`audioAnalysis`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>s(`audio-analysis`,`audioAnalysis`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>s(`audio-analysis`,`audioAnalysis`,`applyDeviceSettingsPatch`,`mutation`,e)},audioMetrics:{getCurrentSnapshot:e=>s(`audio-metrics`,`audioMetrics`,`getCurrentSnapshot`,`query`,e),getHistory:e=>s(`audio-metrics`,`audioMetrics`,`getHistory`,`query`,e)},automationControl:{enable:e=>s(`automation-control`,`automationControl`,`enable`,`mutation`,e),disable:e=>s(`automation-control`,`automationControl`,`disable`,`mutation`,e),trigger:e=>s(`automation-control`,`automationControl`,`trigger`,`mutation`,e),getStatus:e=>s(`automation-control`,`automationControl`,`getStatus`,`query`,e)},battery:{wakeForStream:e=>s(`battery`,`battery`,`wakeForStream`,`mutation`,e),getStatus:e=>s(`battery`,`battery`,`getStatus`,`query`,e)},binary:{getStatus:e=>s(`binary`,`binary`,`getStatus`,`query`,e)},brightness:{setBrightness:e=>s(`brightness`,`brightness`,`setBrightness`,`mutation`,e),getStatus:e=>s(`brightness`,`brightness`,`getStatus`,`query`,e)},button:{press:e=>s(`button`,`button`,`press`,`mutation`,e)},cameraCredentials:{getCredentials:e=>s(`camera-credentials`,`cameraCredentials`,`getCredentials`,`query`,e),getStatus:e=>s(`camera-credentials`,`cameraCredentials`,`getStatus`,`query`,e)},cameraGridLayout:{getLayout:e=>s(`camera-grid-layout`,`cameraGridLayout`,`getLayout`,`query`,e),saveLayout:e=>s(`camera-grid-layout`,`cameraGridLayout`,`saveLayout`,`mutation`,e),getDeviceSettingsContribution:e=>s(`camera-grid-layout`,`cameraGridLayout`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>s(`camera-grid-layout`,`cameraGridLayout`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>s(`camera-grid-layout`,`cameraGridLayout`,`applyDeviceSettingsPatch`,`mutation`,e)},cameraPipelineConfig:{getDeviceSettingsContribution:e=>s(`camera-pipeline-config`,`cameraPipelineConfig`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>s(`camera-pipeline-config`,`cameraPipelineConfig`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>s(`camera-pipeline-config`,`cameraPipelineConfig`,`applyDeviceSettingsPatch`,`mutation`,e)},cameraStreams:{getCameraStreams:e=>s(`camera-streams`,`cameraStreams`,`getCameraStreams`,`query`,e),getBrokerStreams:e=>s(`camera-streams`,`cameraStreams`,`getBrokerStreams`,`query`,e),getRtspEntries:e=>s(`camera-streams`,`cameraStreams`,`getRtspEntries`,`query`,e),getProfileRtspEntries:e=>s(`camera-streams`,`cameraStreams`,`getProfileRtspEntries`,`query`,e),pickStream:e=>s(`camera-streams`,`cameraStreams`,`pickStream`,`query`,e)},carbonMonoxide:{getStatus:e=>s(`carbon-monoxide`,`carbonMonoxide`,`getStatus`,`query`,e)},climateControl:{setMode:e=>s(`climate-control`,`climateControl`,`setMode`,`mutation`,e),setFanMode:e=>s(`climate-control`,`climateControl`,`setFanMode`,`mutation`,e),setPreset:e=>s(`climate-control`,`climateControl`,`setPreset`,`mutation`,e),setTarget:e=>s(`climate-control`,`climateControl`,`setTarget`,`mutation`,e),setTargetRange:e=>s(`climate-control`,`climateControl`,`setTargetRange`,`mutation`,e),setTargetHumidity:e=>s(`climate-control`,`climateControl`,`setTargetHumidity`,`mutation`,e),setSwingVertical:e=>s(`climate-control`,`climateControl`,`setSwingVertical`,`mutation`,e),setSwingHorizontal:e=>s(`climate-control`,`climateControl`,`setSwingHorizontal`,`mutation`,e),getStatus:e=>s(`climate-control`,`climateControl`,`getStatus`,`query`,e)},color:{setColor:e=>s(`color`,`color`,`setColor`,`mutation`,e),getStatus:e=>s(`color`,`color`,`getStatus`,`query`,e)},connectivity:{getStatus:e=>s(`connectivity`,`connectivity`,`getStatus`,`query`,e)},consumables:{reset:e=>s(`consumables`,`consumables`,`reset`,`mutation`,e),getStatus:e=>s(`consumables`,`consumables`,`getStatus`,`query`,e)},contact:{getStatus:e=>s(`contact`,`contact`,`getStatus`,`query`,e)},control:{setValue:e=>s(`control`,`control`,`setValue`,`mutation`,e),getStatus:e=>s(`control`,`control`,`getStatus`,`query`,e)},cover:{open:e=>s(`cover`,`cover`,`open`,`mutation`,e),close:e=>s(`cover`,`cover`,`close`,`mutation`,e),stop:e=>s(`cover`,`cover`,`stop`,`mutation`,e),setPosition:e=>s(`cover`,`cover`,`setPosition`,`mutation`,e),setTiltPosition:e=>s(`cover`,`cover`,`setTiltPosition`,`mutation`,e),getStatus:e=>s(`cover`,`cover`,`getStatus`,`query`,e)},dayNight:{getOptions:e=>s(`day-night`,`dayNight`,`getOptions`,`query`,e),setSettings:e=>s(`day-night`,`dayNight`,`setSettings`,`mutation`,e),getStatus:e=>s(`day-night`,`dayNight`,`getStatus`,`query`,e)},detectionPipeline:{getDeviceSettingsContribution:e=>s(`detection-pipeline`,`detectionPipeline`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>s(`detection-pipeline`,`detectionPipeline`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>s(`detection-pipeline`,`detectionPipeline`,`applyDeviceSettingsPatch`,`mutation`,e)},deviceAdminLink:{getAdminLink:e=>s(`device-admin-link`,`deviceAdminLink`,`getAdminLink`,`query`,e)},deviceDiscovery:{listDiscovered:e=>s(`device-discovery`,`deviceDiscovery`,`listDiscovered`,`query`,e),refreshDiscovery:e=>s(`device-discovery`,`deviceDiscovery`,`refreshDiscovery`,`mutation`,e),adoptDevice:e=>s(`device-discovery`,`deviceDiscovery`,`adoptDevice`,`mutation`,e),releaseDevice:e=>s(`device-discovery`,`deviceDiscovery`,`releaseDevice`,`mutation`,e),getStatus:e=>s(`device-discovery`,`deviceDiscovery`,`getStatus`,`query`,e)},deviceExtension:{listSources:e=>s(`device-extension`,`deviceExtension`,`listSources`,`query`,e),listSlots:e=>s(`device-extension`,`deviceExtension`,`listSlots`,`query`,e),listCandidates:e=>s(`device-extension`,`deviceExtension`,`listCandidates`,`query`,e),setSlot:e=>s(`device-extension`,`deviceExtension`,`setSlot`,`mutation`,e)},deviceOps:{getStreamSources:e=>s(`device-ops`,`deviceOps`,`getStreamSources`,`query`,e),getConfigEntries:e=>s(`device-ops`,`deviceOps`,`getConfigEntries`,`query`,e),setConfig:e=>s(`device-ops`,`deviceOps`,`setConfig`,`mutation`,e),runAction:e=>s(`device-ops`,`deviceOps`,`runAction`,`mutation`,e),removeDevice:e=>s(`device-ops`,`deviceOps`,`removeDevice`,`mutation`,e),getSettingsSchema:e=>s(`device-ops`,`deviceOps`,`getSettingsSchema`,`query`,e),getRawState:e=>s(`device-ops`,`deviceOps`,`getRawState`,`query`,e)},deviceStatus:{getStatus:e=>s(`device-status`,`deviceStatus`,`getStatus`,`query`,e)},doorbell:{getStatus:e=>s(`doorbell`,`doorbell`,`getStatus`,`query`,e)},enumSensor:{getStatus:e=>s(`enum-sensor`,`enumSensor`,`getStatus`,`query`,e)},eventEmitter:{getStatus:e=>s(`event-emitter`,`eventEmitter`,`getStatus`,`query`,e)},fanControl:{setPercentage:e=>s(`fan-control`,`fanControl`,`setPercentage`,`mutation`,e),setPreset:e=>s(`fan-control`,`fanControl`,`setPreset`,`mutation`,e),setDirection:e=>s(`fan-control`,`fanControl`,`setDirection`,`mutation`,e),setOscillating:e=>s(`fan-control`,`fanControl`,`setOscillating`,`mutation`,e),getStatus:e=>s(`fan-control`,`fanControl`,`getStatus`,`query`,e)},featureProbe:{getStatus:e=>s(`feature-probe`,`featureProbe`,`getStatus`,`query`,e)},flood:{getStatus:e=>s(`flood`,`flood`,`getStatus`,`query`,e)},gas:{getStatus:e=>s(`gas`,`gas`,`getStatus`,`query`,e)},humidifier:{setOn:e=>s(`humidifier`,`humidifier`,`setOn`,`mutation`,e),setTargetHumidity:e=>s(`humidifier`,`humidifier`,`setTargetHumidity`,`mutation`,e),setMode:e=>s(`humidifier`,`humidifier`,`setMode`,`mutation`,e),getStatus:e=>s(`humidifier`,`humidifier`,`getStatus`,`query`,e)},humiditySensor:{getStatus:e=>s(`humidity-sensor`,`humiditySensor`,`getStatus`,`query`,e)},image:{getStatus:e=>s(`image`,`image`,`getStatus`,`query`,e)},imageSettings:{getOptions:e=>s(`image-settings`,`imageSettings`,`getOptions`,`query`,e),setSettings:e=>s(`image-settings`,`imageSettings`,`setSettings`,`mutation`,e),getStatus:e=>s(`image-settings`,`imageSettings`,`getStatus`,`query`,e)},intercom:{startSession:e=>s(`intercom`,`intercom`,`startSession`,`mutation`,e),handleAnswer:e=>s(`intercom`,`intercom`,`handleAnswer`,`mutation`,e),stopSession:e=>s(`intercom`,`intercom`,`stopSession`,`mutation`,e),startTalkSession:e=>s(`intercom`,`intercom`,`startTalkSession`,`mutation`,e),pushTalkAudio:e=>s(`intercom`,`intercom`,`pushTalkAudio`,`mutation`,e),endTalkSession:e=>s(`intercom`,`intercom`,`endTalkSession`,`mutation`,e),getStatus:e=>s(`intercom`,`intercom`,`getStatus`,`query`,e)},lawnMowerControl:{startMowing:e=>s(`lawn-mower-control`,`lawnMowerControl`,`startMowing`,`mutation`,e),pause:e=>s(`lawn-mower-control`,`lawnMowerControl`,`pause`,`mutation`,e),dock:e=>s(`lawn-mower-control`,`lawnMowerControl`,`dock`,`mutation`,e),getStatus:e=>s(`lawn-mower-control`,`lawnMowerControl`,`getStatus`,`query`,e)},lockControl:{lock:e=>s(`lock-control`,`lockControl`,`lock`,`mutation`,e),unlock:e=>s(`lock-control`,`lockControl`,`unlock`,`mutation`,e),open:e=>s(`lock-control`,`lockControl`,`open`,`mutation`,e),getStatus:e=>s(`lock-control`,`lockControl`,`getStatus`,`query`,e)},mediaPlayer:{play:e=>s(`media-player`,`mediaPlayer`,`play`,`mutation`,e),pause:e=>s(`media-player`,`mediaPlayer`,`pause`,`mutation`,e),stop:e=>s(`media-player`,`mediaPlayer`,`stop`,`mutation`,e),next:e=>s(`media-player`,`mediaPlayer`,`next`,`mutation`,e),previous:e=>s(`media-player`,`mediaPlayer`,`previous`,`mutation`,e),seek:e=>s(`media-player`,`mediaPlayer`,`seek`,`mutation`,e),setVolume:e=>s(`media-player`,`mediaPlayer`,`setVolume`,`mutation`,e),setMute:e=>s(`media-player`,`mediaPlayer`,`setMute`,`mutation`,e),setShuffle:e=>s(`media-player`,`mediaPlayer`,`setShuffle`,`mutation`,e),setRepeat:e=>s(`media-player`,`mediaPlayer`,`setRepeat`,`mutation`,e),selectSource:e=>s(`media-player`,`mediaPlayer`,`selectSource`,`mutation`,e),playMedia:e=>s(`media-player`,`mediaPlayer`,`playMedia`,`mutation`,e),getStatus:e=>s(`media-player`,`mediaPlayer`,`getStatus`,`query`,e)},motion:{isDetected:e=>s(`motion`,`motion`,`isDetected`,`query`,e),getStatus:e=>s(`motion`,`motion`,`getStatus`,`query`,e)},motionDetection:{analyze:e=>s(`motion-detection`,`motionDetection`,`analyze`,`mutation`,e),removeCamera:e=>s(`motion-detection`,`motionDetection`,`removeCamera`,`mutation`,e),reset:e=>s(`motion-detection`,`motionDetection`,`reset`,`mutation`,e),getDeviceSettingsContribution:e=>s(`motion-detection`,`motionDetection`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>s(`motion-detection`,`motionDetection`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>s(`motion-detection`,`motionDetection`,`applyDeviceSettingsPatch`,`mutation`,e)},motionTrigger:{setMotionTrigger:e=>s(`motion-trigger`,`motionTrigger`,`setMotionTrigger`,`mutation`,e),getStatus:e=>s(`motion-trigger`,`motionTrigger`,`getStatus`,`query`,e)},motionZones:{getOptions:e=>s(`motion-zones`,`motionZones`,`getOptions`,`query`,e),setZone:e=>s(`motion-zones`,`motionZones`,`setZone`,`mutation`,e),getStatus:e=>s(`motion-zones`,`motionZones`,`getStatus`,`query`,e)},nativeObjectDetection:{getOptions:e=>s(`native-object-detection`,`nativeObjectDetection`,`getOptions`,`query`,e),setSettings:e=>s(`native-object-detection`,`nativeObjectDetection`,`setSettings`,`mutation`,e),setEnabled:e=>s(`native-object-detection`,`nativeObjectDetection`,`setEnabled`,`mutation`,e),getStatus:e=>s(`native-object-detection`,`nativeObjectDetection`,`getStatus`,`query`,e)},navigation:{move:e=>s(`navigation`,`navigation`,`move`,`mutation`,e),stop:e=>s(`navigation`,`navigation`,`stop`,`mutation`,e),goToPoint:e=>s(`navigation`,`navigation`,`goToPoint`,`mutation`,e),listActions:e=>s(`navigation`,`navigation`,`listActions`,`query`,e),runAction:e=>s(`navigation`,`navigation`,`runAction`,`mutation`,e),playSound:e=>s(`navigation`,`navigation`,`playSound`,`mutation`,e),setLightOn:e=>s(`navigation`,`navigation`,`setLightOn`,`mutation`,e),setLightMode:e=>s(`navigation`,`navigation`,`setLightMode`,`mutation`,e),setLightLevel:e=>s(`navigation`,`navigation`,`setLightLevel`,`mutation`,e),getFeatures:e=>s(`navigation`,`navigation`,`getFeatures`,`query`,e),getStatus:e=>s(`navigation`,`navigation`,`getStatus`,`query`,e)},networkLink:{getStatus:e=>s(`network-link`,`networkLink`,`getStatus`,`query`,e)},notifier:{send:e=>s(`notifier`,`notifier`,`send`,`mutation`,e),cancel:e=>s(`notifier`,`notifier`,`cancel`,`mutation`,e),getStatus:e=>s(`notifier`,`notifier`,`getStatus`,`query`,e)},numericSensor:{getStatus:e=>s(`numeric-sensor`,`numericSensor`,`getStatus`,`query`,e)},osd:{setOverlay:e=>s(`osd`,`osd`,`setOverlay`,`mutation`,e),getStatus:e=>s(`osd`,`osd`,`getStatus`,`query`,e)},petFeeder:{feed:e=>s(`pet-feeder`,`petFeeder`,`feed`,`mutation`,e),cancelFeed:e=>s(`pet-feeder`,`petFeeder`,`cancelFeed`,`mutation`,e),resetDesiccant:e=>s(`pet-feeder`,`petFeeder`,`resetDesiccant`,`mutation`,e),markFoodReplenished:e=>s(`pet-feeder`,`petFeeder`,`markFoodReplenished`,`mutation`,e),callPet:e=>s(`pet-feeder`,`petFeeder`,`callPet`,`mutation`,e),playSound:e=>s(`pet-feeder`,`petFeeder`,`playSound`,`mutation`,e),setChildLock:e=>s(`pet-feeder`,`petFeeder`,`setChildLock`,`mutation`,e),setIndicatorLight:e=>s(`pet-feeder`,`petFeeder`,`setIndicatorLight`,`mutation`,e),setFeedSound:e=>s(`pet-feeder`,`petFeeder`,`setFeedSound`,`mutation`,e),setVolume:e=>s(`pet-feeder`,`petFeeder`,`setVolume`,`mutation`,e),getStatus:e=>s(`pet-feeder`,`petFeeder`,`getStatus`,`query`,e)},pipelineAnalytics:{getActiveTracks:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getActiveTracks`,`query`,e),getTrack:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getTrack`,`query`,e),listTracks:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listTracks`,`query`,e),listRecentTracks:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listRecentTracks`,`query`,e),clearTracks:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`clearTracks`,`mutation`,e),getMotionEvents:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getMotionEvents`,`query`,e),getObjectEvents:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getObjectEvents`,`query`,e),getAudioEvents:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getAudioEvents`,`query`,e),listEventKinds:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listEventKinds`,`query`,e),listEventKindsBatch:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listEventKindsBatch`,`query`,e),getSensorEvents:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getSensorEvents`,`query`,e),getKeyEvents:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getKeyEvents`,`query`,e),getKeyEventsBatch:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getKeyEventsBatch`,`query`,e),readLongTermSeries:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`readLongTermSeries`,`query`,e),getEventDensity:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getEventDensity`,`query`,e),getEventDensityBatch:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getEventDensityBatch`,`query`,e),pruneEventsBefore:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`pruneEventsBefore`,`mutation`,e),pruneTracksBefore:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`pruneTracksBefore`,`mutation`,e),wipeAllAnalytics:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`wipeAllAnalytics`,`mutation`,e),reconcileFromDisk:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`reconcileFromDisk`,`mutation`,e),deleteTracks:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`deleteTracks`,`mutation`,e),setTrackFlags:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`setTrackFlags`,`mutation`,e),listArchivedDebugNotes:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listArchivedDebugNotes`,`query`,e),setTrackRelation:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`setTrackRelation`,`mutation`,e),clearTrackRelation:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`clearTrackRelation`,`mutation`,e),setTrackPurity:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`setTrackPurity`,`mutation`,e),listTrackRelations:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listTrackRelations`,`query`,e),listBirthDecisions:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listBirthDecisions`,`query`,e),getEventStoreFootprint:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getEventStoreFootprint`,`query`,e),getEventMediaFootprintByKind:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getEventMediaFootprintByKind`,`query`,e),pruneEvents:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`pruneEvents`,`mutation`,e),deleteDeviceEvents:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`deleteDeviceEvents`,`mutation`,e),pauseForStorageMigration:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`pauseForStorageMigration`,`mutation`,e),resumeForStorageMigration:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`resumeForStorageMigration`,`mutation`,e),refreshStorageLocationsForMigration:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`refreshStorageLocationsForMigration`,`mutation`,e),startStorageMigrationMove:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`startStorageMigrationMove`,`mutation`,e),getStorageMigrationMoveStatus:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getStorageMigrationMoveStatus`,`query`,e),cancelStorageMigrationMove:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`cancelStorageMigrationMove`,`mutation`,e),relocateMedia:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`relocateMedia`,`mutation`,e),countUnstampedEventMedia:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`countUnstampedEventMedia`,`query`,e),countRelocatableMedia:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`countRelocatableMedia`,`query`,e),listRelocateMediaJobs:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listRelocateMediaJobs`,`query`,e),cancelRelocateMedia:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`cancelRelocateMedia`,`mutation`,e),listOpsLog:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listOpsLog`,`query`,e),reclaimDebugMedia:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`reclaimDebugMedia`,`mutation`,e),getMediaReclaimStatus:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getMediaReclaimStatus`,`query`,e),getTrainingExportSummary:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getTrainingExportSummary`,`query`,e),getTrainingExportUrl:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getTrainingExportUrl`,`query`,e),listRetrainStaging:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listRetrainStaging`,`query`,e),listRetrainFrames:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listRetrainFrames`,`query`,e),selectRetrainFrames:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`selectRetrainFrames`,`mutation`,e),deselectRetrainFrame:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`deselectRetrainFrame`,`mutation`,e),getRetrainFrameImage:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getRetrainFrameImage`,`query`,e),proposeRetrainAnnotations:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`proposeRetrainAnnotations`,`mutation`,e),listRetrainAnnotations:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listRetrainAnnotations`,`query`,e),saveRetrainAnnotations:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`saveRetrainAnnotations`,`mutation`,e),completeRetrainTrack:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`completeRetrainTrack`,`mutation`,e),restageRetrainTrack:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`restageRetrainTrack`,`mutation`,e),getRetrainExportUrl:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getRetrainExportUrl`,`query`,e),getEventMedia:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getEventMedia`,`query`,e),getTrackMedia:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getTrackMedia`,`query`,e),listTrackMedia:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listTrackMedia`,`query`,e),listEventMedia:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listEventMedia`,`query`,e),ownersWithMedia:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`ownersWithMedia`,`query`,e),searchObjectEvents:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`searchObjectEvents`,`query`,e),wipeObjectEmbeddings:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`wipeObjectEmbeddings`,`mutation`,e),rebuildObjectEmbeddings:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`rebuildObjectEmbeddings`,`mutation`,e),getObjectEmbeddingRebuildStatus:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getObjectEmbeddingRebuildStatus`,`query`,e),getDeviceSettingsContribution:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`applyDeviceSettingsPatch`,`mutation`,e)},powerMeter:{getStatus:e=>s(`power-meter`,`powerMeter`,`getStatus`,`query`,e)},presence:{getStatus:e=>s(`presence`,`presence`,`getStatus`,`query`,e)},pressureSensor:{getStatus:e=>s(`pressure-sensor`,`pressureSensor`,`getStatus`,`query`,e)},privacyMask:{getOptions:e=>s(`privacy-mask`,`privacyMask`,`getOptions`,`query`,e),setMask:e=>s(`privacy-mask`,`privacyMask`,`setMask`,`mutation`,e),setAudioEnabled:e=>s(`privacy-mask`,`privacyMask`,`setAudioEnabled`,`mutation`,e),getStatus:e=>s(`privacy-mask`,`privacyMask`,`getStatus`,`query`,e)},ptz:{move:e=>s(`ptz`,`ptz`,`move`,`mutation`,e),continuousMove:e=>s(`ptz`,`ptz`,`continuousMove`,`mutation`,e),stop:e=>s(`ptz`,`ptz`,`stop`,`mutation`,e),getPresets:e=>s(`ptz`,`ptz`,`getPresets`,`query`,e),goToPreset:e=>s(`ptz`,`ptz`,`goToPreset`,`mutation`,e),savePreset:e=>s(`ptz`,`ptz`,`savePreset`,`mutation`,e),deletePreset:e=>s(`ptz`,`ptz`,`deletePreset`,`mutation`,e),getOptions:e=>s(`ptz`,`ptz`,`getOptions`,`query`,e),goHome:e=>s(`ptz`,`ptz`,`goHome`,`mutation`,e),getHomePreset:e=>s(`ptz`,`ptz`,`getHomePreset`,`query`,e),setHomePreset:e=>s(`ptz`,`ptz`,`setHomePreset`,`mutation`,e),captureHomeHere:e=>s(`ptz`,`ptz`,`captureHomeHere`,`mutation`,e),getHomeReturn:e=>s(`ptz`,`ptz`,`getHomeReturn`,`query`,e),setHomeReturn:e=>s(`ptz`,`ptz`,`setHomeReturn`,`mutation`,e),getPosition:e=>s(`ptz`,`ptz`,`getPosition`,`query`,e),setAutofocus:e=>s(`ptz`,`ptz`,`setAutofocus`,`mutation`,e),getStatus:e=>s(`ptz`,`ptz`,`getStatus`,`query`,e)},ptzAutotrack:{getStatus:e=>s(`ptz-autotrack`,`ptzAutotrack`,`getStatus`,`query`,e),setEnabled:e=>s(`ptz-autotrack`,`ptzAutotrack`,`setEnabled`,`mutation`,e),getSettings:e=>s(`ptz-autotrack`,`ptzAutotrack`,`getSettings`,`query`,e),setSettings:e=>s(`ptz-autotrack`,`ptzAutotrack`,`setSettings`,`mutation`,e)},reboot:{reboot:e=>s(`reboot`,`reboot`,`reboot`,`mutation`,e)},recording:{listSources:e=>s(`recording`,`recording`,`listSources`,`query`,e),getAvailability:e=>s(`recording`,`recording`,`getAvailability`,`query`,e),getDaysWithRecordings:e=>s(`recording`,`recording`,`getDaysWithRecordings`,`query`,e),getPlayback:e=>s(`recording`,`recording`,`getPlayback`,`query`,e),getPlaybackOptions:e=>s(`recording`,`recording`,`getPlaybackOptions`,`query`,e)},recordingOnboard:{getOptions:e=>s(`recording-onboard`,`recordingOnboard`,`getOptions`,`query`,e),setSettings:e=>s(`recording-onboard`,`recordingOnboard`,`setSettings`,`mutation`,e),getStatus:e=>s(`recording-onboard`,`recordingOnboard`,`getStatus`,`query`,e)},recordingSignal:{getStatus:e=>s(`recording-signal`,`recordingSignal`,`getStatus`,`query`,e)},sceneMonitor:{listScenes:e=>s(`scene-monitor`,`sceneMonitor`,`listScenes`,`query`,e),listScenesBatch:e=>s(`scene-monitor`,`sceneMonitor`,`listScenesBatch`,`query`,e),createScene:e=>s(`scene-monitor`,`sceneMonitor`,`createScene`,`mutation`,e),updateScene:e=>s(`scene-monitor`,`sceneMonitor`,`updateScene`,`mutation`,e),deleteScene:e=>s(`scene-monitor`,`sceneMonitor`,`deleteScene`,`mutation`,e),captureReference:e=>s(`scene-monitor`,`sceneMonitor`,`captureReference`,`mutation`,e),deleteReference:e=>s(`scene-monitor`,`sceneMonitor`,`deleteReference`,`mutation`,e),recheckNow:e=>s(`scene-monitor`,`sceneMonitor`,`recheckNow`,`mutation`,e),resetScene:e=>s(`scene-monitor`,`sceneMonitor`,`resetScene`,`mutation`,e),getStatus:e=>s(`scene-monitor`,`sceneMonitor`,`getStatus`,`query`,e)},scriptRunner:{run:e=>s(`script-runner`,`scriptRunner`,`run`,`mutation`,e),stop:e=>s(`script-runner`,`scriptRunner`,`stop`,`mutation`,e),getStatus:e=>s(`script-runner`,`scriptRunner`,`getStatus`,`query`,e)},smoke:{getStatus:e=>s(`smoke`,`smoke`,`getStatus`,`query`,e)},snapshot:{getSnapshot:e=>s(`snapshot`,`snapshot`,`getSnapshot`,`query`,e),invalidateCache:e=>s(`snapshot`,`snapshot`,`invalidateCache`,`mutation`,e),getSnapshotOverview:e=>s(`snapshot`,`snapshot`,`getSnapshotOverview`,`query`,e),getDebugState:e=>s(`snapshot`,`snapshot`,`getDebugState`,`query`,e),getSnapshotLinks:e=>s(`snapshot`,`snapshot`,`getSnapshotLinks`,`query`,e),getStatus:e=>s(`snapshot`,`snapshot`,`getStatus`,`query`,e),getDeviceSettingsContribution:e=>s(`snapshot`,`snapshot`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>s(`snapshot`,`snapshot`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>s(`snapshot`,`snapshot`,`applyDeviceSettingsPatch`,`mutation`,e)},streamCatalog:{getCatalog:e=>s(`stream-catalog`,`streamCatalog`,`getCatalog`,`query`,e)},streamParams:{getOptions:e=>s(`stream-params`,`streamParams`,`getOptions`,`query`,e),setProfile:e=>s(`stream-params`,`streamParams`,`setProfile`,`mutation`,e),getConfigSchema:e=>s(`stream-params`,`streamParams`,`getConfigSchema`,`query`,e),getStatus:e=>s(`stream-params`,`streamParams`,`getStatus`,`query`,e)},streamSignals:{listSignals:e=>s(`stream-signals`,`streamSignals`,`listSignals`,`query`,e)},switch:{setState:e=>s(`switch`,`switch`,`setState`,`mutation`,e),getStatus:e=>s(`switch`,`switch`,`getStatus`,`query`,e)},tamper:{getStatus:e=>s(`tamper`,`tamper`,`getStatus`,`query`,e)},temperatureSensor:{getStatus:e=>s(`temperature-sensor`,`temperatureSensor`,`getStatus`,`query`,e)},update:{installUpdate:e=>s(`update`,`update`,`installUpdate`,`mutation`,e),getStatus:e=>s(`update`,`update`,`getStatus`,`query`,e)},vacuumControl:{start:e=>s(`vacuum-control`,`vacuumControl`,`start`,`mutation`,e),pause:e=>s(`vacuum-control`,`vacuumControl`,`pause`,`mutation`,e),stop:e=>s(`vacuum-control`,`vacuumControl`,`stop`,`mutation`,e),returnToBase:e=>s(`vacuum-control`,`vacuumControl`,`returnToBase`,`mutation`,e),locate:e=>s(`vacuum-control`,`vacuumControl`,`locate`,`mutation`,e),setFanSpeed:e=>s(`vacuum-control`,`vacuumControl`,`setFanSpeed`,`mutation`,e),getStatus:e=>s(`vacuum-control`,`vacuumControl`,`getStatus`,`query`,e)},valve:{open:e=>s(`valve`,`valve`,`open`,`mutation`,e),close:e=>s(`valve`,`valve`,`close`,`mutation`,e),stop:e=>s(`valve`,`valve`,`stop`,`mutation`,e),setPosition:e=>s(`valve`,`valve`,`setPosition`,`mutation`,e),getStatus:e=>s(`valve`,`valve`,`getStatus`,`query`,e)},vibration:{getStatus:e=>s(`vibration`,`vibration`,`getStatus`,`query`,e)},videoclips:{listClips:e=>s(`videoclips`,`videoclips`,`listClips`,`query`,e),listSources:e=>s(`videoclips`,`videoclips`,`listSources`,`query`,e),getClipPlayback:e=>s(`videoclips`,`videoclips`,`getClipPlayback`,`query`,e),readClipBytes:e=>s(`videoclips`,`videoclips`,`readClipBytes`,`query`,e),offerClipBytes:e=>s(`videoclips`,`videoclips`,`offerClipBytes`,`query`,e),dialClipStream:e=>s(`videoclips`,`videoclips`,`dialClipStream`,`query`,e),getPlaybackOptions:e=>s(`videoclips`,`videoclips`,`getPlaybackOptions`,`query`,e)},waterHeater:{setTargetTemp:e=>s(`water-heater`,`waterHeater`,`setTargetTemp`,`mutation`,e),setOperationMode:e=>s(`water-heater`,`waterHeater`,`setOperationMode`,`mutation`,e),setAway:e=>s(`water-heater`,`waterHeater`,`setAway`,`mutation`,e),getStatus:e=>s(`water-heater`,`waterHeater`,`getStatus`,`query`,e)},weather:{getStatus:e=>s(`weather`,`weather`,`getStatus`,`query`,e)},webrtcSession:{listStreams:e=>s(`webrtc-session`,`webrtcSession`,`listStreams`,`query`,e),createSession:e=>s(`webrtc-session`,`webrtcSession`,`createSession`,`mutation`,e),handleOffer:e=>s(`webrtc-session`,`webrtcSession`,`handleOffer`,`mutation`,e),handleAnswer:e=>s(`webrtc-session`,`webrtcSession`,`handleAnswer`,`mutation`,e),addIceCandidate:e=>s(`webrtc-session`,`webrtcSession`,`addIceCandidate`,`mutation`,e),getIceCandidates:e=>s(`webrtc-session`,`webrtcSession`,`getIceCandidates`,`query`,e),closeSession:e=>s(`webrtc-session`,`webrtcSession`,`closeSession`,`mutation`,e),hasAdaptiveBitrate:e=>s(`webrtc-session`,`webrtcSession`,`hasAdaptiveBitrate`,`query`,e),getSessionState:e=>s(`webrtc-session`,`webrtcSession`,`getSessionState`,`query`,e),getSessionDebug:e=>s(`webrtc-session`,`webrtcSession`,`getSessionDebug`,`query`,e)},zoneAnalytics:{getCurrentSnapshot:e=>s(`zone-analytics`,`zoneAnalytics`,`getCurrentSnapshot`,`query`,e),getCurrentSnapshotBatch:e=>s(`zone-analytics`,`zoneAnalytics`,`getCurrentSnapshotBatch`,`query`,e),getZoneHistory:e=>s(`zone-analytics`,`zoneAnalytics`,`getZoneHistory`,`query`,e),getCameraHistory:e=>s(`zone-analytics`,`zoneAnalytics`,`getCameraHistory`,`query`,e),getUnzonedHistory:e=>s(`zone-analytics`,`zoneAnalytics`,`getUnzonedHistory`,`query`,e)},zoneRules:{listRules:e=>s(`zone-rules`,`zoneRules`,`listRules`,`query`,e),setRules:e=>s(`zone-rules`,`zoneRules`,`setRules`,`mutation`,e)},zones:{listZones:e=>s(`zones`,`zones`,`listZones`,`query`,e),addZone:e=>s(`zones`,`zones`,`addZone`,`mutation`,e),removeZone:e=>s(`zones`,`zones`,`removeZone`,`mutation`,e),updateZone:e=>s(`zones`,`zones`,`updateZone`,`mutation`,e)},addonSettings:{getDeviceSettings:e=>c(`addonSettings`,`getDeviceSettings`,`query`,e),updateDeviceSettings:e=>c(`addonSettings`,`updateDeviceSettings`,`mutation`,e)},audioAnalyzer:{detachDevice:e=>c(`audioAnalyzer`,`detachDevice`,`mutation`,e)},deviceAdoption:{getStatus:e=>c(`deviceAdoption`,`getStatus`,`query`,e)},deviceExport:{getDeviceSettingsContribution:e=>c(`deviceExport`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`deviceExport`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`deviceExport`,`applyDeviceSettingsPatch`,`mutation`,e)},deviceManager:{loadConfig:e=>c(`deviceManager`,`loadConfig`,`query`,e),loadRuntimeState:e=>c(`deviceManager`,`loadRuntimeState`,`query`,e),loadMeta:e=>c(`deviceManager`,`loadMeta`,`query`,e),setName:e=>c(`deviceManager`,`setName`,`mutation`,e),setLocation:e=>c(`deviceManager`,`setLocation`,`mutation`,e),setType:e=>c(`deviceManager`,`setType`,`mutation`,e),setIntegrationId:e=>c(`deviceManager`,`setIntegrationId`,`mutation`,e),setLinkDeviceId:e=>c(`deviceManager`,`setLinkDeviceId`,`mutation`,e),setPrimaryChildEntityId:e=>c(`deviceManager`,`setPrimaryChildEntityId`,`mutation`,e),setChildLayout:e=>c(`deviceManager`,`setChildLayout`,`mutation`,e),setDisplay:e=>c(`deviceManager`,`setDisplay`,`mutation`,e),getWireableFields:e=>c(`deviceManager`,`getWireableFields`,`query`,e),setRole:e=>c(`deviceManager`,`setRole`,`mutation`,e),applyInitialMeta:e=>c(`deviceManager`,`applyInitialMeta`,`mutation`,e),setMetadata:e=>c(`deviceManager`,`setMetadata`,`mutation`,e),setDisabled:e=>c(`deviceManager`,`setDisabled`,`mutation`,e),getDevice:e=>c(`deviceManager`,`getDevice`,`query`,e),getLinkedDevices:e=>c(`deviceManager`,`getLinkedDevices`,`query`,e),getStreamSources:e=>c(`deviceManager`,`getStreamSources`,`query`,e),getConfigSchema:e=>c(`deviceManager`,`getConfigSchema`,`query`,e),getSettingsSchema:e=>c(`deviceManager`,`getSettingsSchema`,`query`,e),updateConfig:e=>c(`deviceManager`,`updateConfig`,`mutation`,e),enable:e=>c(`deviceManager`,`enable`,`mutation`,e),disable:e=>c(`deviceManager`,`disable`,`mutation`,e),remove:e=>c(`deviceManager`,`remove`,`mutation`,e),getStreamProfileMap:e=>c(`deviceManager`,`getStreamProfileMap`,`query`,e),setStreamProfileMap:e=>c(`deviceManager`,`setStreamProfileMap`,`mutation`,e),probeStreams:e=>c(`deviceManager`,`probeStreams`,`mutation`,e),getBindings:e=>c(`deviceManager`,`getBindings`,`query`,e),setWrapperActive:e=>c(`deviceManager`,`setWrapperActive`,`mutation`,e),getWrapperActivation:e=>c(`deviceManager`,`getWrapperActivation`,`query`,e),getDeviceSettingsAggregate:e=>c(`deviceManager`,`getDeviceSettingsAggregate`,`query`,e),getDeviceLiveInfoAggregate:e=>c(`deviceManager`,`getDeviceLiveInfoAggregate`,`query`,e),getDeviceAggregate:e=>c(`deviceManager`,`getDeviceAggregate`,`query`,e),runDeviceAction:e=>c(`deviceManager`,`runDeviceAction`,`mutation`,e),updateDeviceField:e=>c(`deviceManager`,`updateDeviceField`,`mutation`,e),updateDeviceFieldsBatch:e=>c(`deviceManager`,`updateDeviceFieldsBatch`,`mutation`,e),testField:e=>c(`deviceManager`,`testField`,`mutation`,e),getDeviceStatusAggregate:e=>c(`deviceManager`,`getDeviceStatusAggregate`,`query`,e)},deviceState:{getSnapshot:e=>c(`deviceState`,`getSnapshot`,`query`,e),getCapSlice:e=>c(`deviceState`,`getCapSlice`,`query`,e),setCapSlice:e=>c(`deviceState`,`setCapSlice`,`mutation`,e),claimFields:e=>c(`deviceState`,`claimFields`,`mutation`,e),patchOwnedFields:e=>c(`deviceState`,`patchOwnedFields`,`mutation`,e),releaseClaim:e=>c(`deviceState`,`releaseClaim`,`mutation`,e),getNativeCapSlice:e=>c(`deviceState`,`getNativeCapSlice`,`query`,e)},faceGallery:{listRecentFaces:e=>c(`faceGallery`,`listRecentFaces`,`query`,e),getFaceByTrack:e=>c(`faceGallery`,`getFaceByTrack`,`query`,e)},networkQuality:{getDeviceStats:e=>c(`networkQuality`,`getDeviceStats`,`query`,e),reportClientStats:e=>c(`networkQuality`,`reportClientStats`,`mutation`,e)},notificationRules:{setDeviceMuted:e=>c(`notificationRules`,`setDeviceMuted`,`mutation`,e)},osdManager:{getDeviceOsd:e=>c(`osdManager`,`getDeviceOsd`,`query`,e),getSourceCatalog:e=>c(`osdManager`,`getSourceCatalog`,`query`,e),setSlotBinding:e=>c(`osdManager`,`setSlotBinding`,`mutation`,e),clearSlotBinding:e=>c(`osdManager`,`clearSlotBinding`,`mutation`,e),previewSlot:e=>c(`osdManager`,`previewSlot`,`mutation`,e),renderDevice:e=>c(`osdManager`,`renderDevice`,`mutation`,e)},pipelineExecutor:{runPipeline:e=>c(`pipelineExecutor`,`runPipeline`,`mutation`,e),runPipelineBatch:e=>c(`pipelineExecutor`,`runPipelineBatch`,`mutation`,e)},pipelineOrchestrator:{assignPipeline:e=>c(`pipelineOrchestrator`,`assignPipeline`,`mutation`,e),unassignPipeline:e=>c(`pipelineOrchestrator`,`unassignPipeline`,`mutation`,e),setPipelineDevicePin:e=>c(`pipelineOrchestrator`,`setPipelineDevicePin`,`mutation`,e),getPipelineDevicePin:e=>c(`pipelineOrchestrator`,`getPipelineDevicePin`,`query`,e),getPipelineAssignment:e=>c(`pipelineOrchestrator`,`getPipelineAssignment`,`query`,e),getCameraMetrics:e=>c(`pipelineOrchestrator`,`getCameraMetrics`,`query`,e),assignAudio:e=>c(`pipelineOrchestrator`,`assignAudio`,`mutation`,e),unassignAudio:e=>c(`pipelineOrchestrator`,`unassignAudio`,`mutation`,e),getAudioAssignment:e=>c(`pipelineOrchestrator`,`getAudioAssignment`,`query`,e),getCameraSettings:e=>c(`pipelineOrchestrator`,`getCameraSettings`,`query`,e),setCameraStepToggle:e=>c(`pipelineOrchestrator`,`setCameraStepToggle`,`mutation`,e),getCameraStepOverrides:e=>c(`pipelineOrchestrator`,`getCameraStepOverrides`,`query`,e),setCameraStepOverride:e=>c(`pipelineOrchestrator`,`setCameraStepOverride`,`mutation`,e),setCameraPipelineForAgent:e=>c(`pipelineOrchestrator`,`setCameraPipelineForAgent`,`mutation`,e),resolvePipeline:e=>c(`pipelineOrchestrator`,`resolvePipeline`,`query`,e),getCameraSwitches:e=>c(`pipelineOrchestrator`,`getCameraSwitches`,`query`,e),setCameraSwitch:e=>c(`pipelineOrchestrator`,`setCameraSwitch`,`mutation`,e),getCameraStatus:e=>c(`pipelineOrchestrator`,`getCameraStatus`,`query`,e),getDeviceSettingsContribution:e=>c(`pipelineOrchestrator`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`pipelineOrchestrator`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`pipelineOrchestrator`,`applyDeviceSettingsPatch`,`mutation`,e)},pipelineRunner:{detachCamera:e=>c(`pipelineRunner`,`detachCamera`,`mutation`,e),getCameraMetrics:e=>c(`pipelineRunner`,`getCameraMetrics`,`query`,e),requestOccupancyBurst:e=>c(`pipelineRunner`,`requestOccupancyBurst`,`mutation`,e),runDetailSubtree:e=>c(`pipelineRunner`,`runDetailSubtree`,`mutation`,e),parkTrackFrame:e=>c(`pipelineRunner`,`parkTrackFrame`,`mutation`,e),getParkedTrackFrame:e=>c(`pipelineRunner`,`getParkedTrackFrame`,`query`,e),releaseParkedTrackFrames:e=>c(`pipelineRunner`,`releaseParkedTrackFrames`,`mutation`,e)},plateGallery:{listPlates:e=>c(`plateGallery`,`listPlates`,`query`,e),getPlateByTrack:e=>c(`plateGallery`,`getPlateByTrack`,`query`,e)},recordingArchive:{getDeviceConfig:e=>c(`recordingArchive`,`getDeviceConfig`,`query`,e),locateSegment:e=>c(`recordingArchive`,`locateSegment`,`query`,e),readSegmentBytes:e=>c(`recordingArchive`,`readSegmentBytes`,`query`,e),readGopBytes:e=>c(`recordingArchive`,`readGopBytes`,`query`,e),readWindowBytes:e=>c(`recordingArchive`,`readWindowBytes`,`query`,e),setDeviceConfig:e=>c(`recordingArchive`,`setDeviceConfig`,`mutation`,e),rescanStorage:e=>c(`recordingArchive`,`rescanStorage`,`mutation`,e),pruneFootage:e=>c(`recordingArchive`,`pruneFootage`,`mutation`,e),deleteFootprint:e=>c(`recordingArchive`,`deleteFootprint`,`mutation`,e),renderGif:e=>c(`recordingArchive`,`renderGif`,`mutation`,e),renderClip:e=>c(`recordingArchive`,`renderClip`,`mutation`,e),getStatus:e=>c(`recordingArchive`,`getStatus`,`query`,e),getDeviceSettingsContribution:e=>c(`recordingArchive`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`recordingArchive`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`recordingArchive`,`applyDeviceSettingsPatch`,`mutation`,e)},recordingExport:{listExports:e=>c(`recordingExport`,`listExports`,`query`,e)},streamBroker:{reportStreamSignal:e=>c(`streamBroker`,`reportStreamSignal`,`mutation`,e),publishCameraStream:e=>c(`streamBroker`,`publishCameraStream`,`mutation`,e),retractCameraStream:e=>c(`streamBroker`,`retractCameraStream`,`mutation`,e),assignProfile:e=>c(`streamBroker`,`assignProfile`,`mutation`,e),unassignProfile:e=>c(`streamBroker`,`unassignProfile`,`mutation`,e),forgetDeviceHardware:e=>c(`streamBroker`,`forgetDeviceHardware`,`mutation`,e),renderPreBufferClip:e=>c(`streamBroker`,`renderPreBufferClip`,`mutation`,e),produceEventMedia:e=>c(`streamBroker`,`produceEventMedia`,`mutation`,e),restartProfile:e=>c(`streamBroker`,`restartProfile`,`mutation`,e),getDeviceAudioMute:e=>c(`streamBroker`,`getDeviceAudioMute`,`query`,e),setDeviceAudioMute:e=>c(`streamBroker`,`setDeviceAudioMute`,`mutation`,e),getDeviceSettingsContribution:e=>c(`streamBroker`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`streamBroker`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`streamBroker`,`applyDeviceSettingsPatch`,`mutation`,e)}}}var Sn=new Set(`accessories.air-quality-sensor.alarm-panel.ambient-light-sensor.audio-analysis.audio-metrics.automation-control.battery.binary.brightness.button.camera-credentials.camera-grid-layout.camera-pipeline-config.camera-streams.carbon-monoxide.climate-control.color.connectivity.consumables.contact.control.cover.day-night.detection-pipeline.device-admin-link.device-discovery.device-extension.device-ops.device-status.doorbell.enum-sensor.event-emitter.fan-control.feature-probe.flood.gas.humidifier.humidity-sensor.image.image-settings.intercom.lawn-mower-control.lock-control.media-player.motion.motion-detection.motion-trigger.motion-zones.native-object-detection.navigation.network-link.notifier.numeric-sensor.osd.pet-feeder.pipeline-analytics.power-meter.presence.pressure-sensor.privacy-mask.ptz.ptz-autotrack.reboot.recording.recording-onboard.recording-signal.scene-monitor.script-runner.smoke.snapshot.stream-catalog.stream-params.stream-signals.switch.tamper.temperature-sensor.update.vacuum-control.valve.vibration.videoclips.water-heater.weather.webrtc-session.zone-analytics.zone-rules.zones`.split(`.`));function Cn(e){return Sn.has(e)}var wn=[15e3,6e4,5*6e4,15*6e4,30*6e4,60*6e4,90*6e4];function Tn(e){return JSON.parse(e)}function En(e){return typeof e!=`object`||!e||Array.isArray(e)?null:{...e}}function Dn(e){return Array.isArray(e)?e:[]}function On(e,t=``){return typeof e==`string`?e:t}function kn(e,t=0){return typeof e==`number`?e:t}function An(e,t=!1){return typeof e==`boolean`?e:t}function jn(e){try{return En(Tn(e))}catch{return null}}function Mn(e){try{let t=Tn(e);return Array.isArray(t)?t:null}catch{return null}}function Nn(e){return new Promise(t=>setTimeout(t,Math.max(0,e)))}function Pn(e,t){return t.aborted?Promise.resolve():new Promise(n=>{let r=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},Math.max(0,e)),i=()=>{clearTimeout(r),t.removeEventListener(`abort`,i),n()};t.addEventListener(`abort`,i,{once:!0})})}var E=function(e){return e.Camera=`camera`,e.Hub=`hub`,e.Light=`light`,e.Siren=`siren`,e.Switch=`switch`,e.Sensor=`sensor`,e.Thermostat=`thermostat`,e.Climate=`climate`,e.Button=`button`,e.EventEmitter=`event-emitter`,e.Update=`update`,e.Generic=`generic`,e.Notifier=`notifier`,e.Script=`script`,e.Automation=`automation`,e.Lock=`lock`,e.Cover=`cover`,e.Valve=`valve`,e.Humidifier=`humidifier`,e.WaterHeater=`water-heater`,e.Fan=`fan`,e.MediaPlayer=`media-player`,e.AlarmPanel=`alarm-panel`,e.Control=`control`,e.Presence=`presence`,e.Weather=`weather`,e.Vacuum=`vacuum`,e.LawnMower=`lawn-mower`,e.Container=`container`,e.Image=`image`,e.PetFeeder=`pet-feeder`,e}({}),Fn=function(e){return e.BatteryOperated=`battery-operated`,e.Rebootable=`rebootable`,e.Resyncable=`resyncable`,e.NativeSnapshot=`native-snapshot`,e.DoorbellButton=`doorbell-button`,e.TwoWayAudio=`two-way-audio`,e.PanTiltZoom=`pan-tilt-zoom`,e.PtzAutotrack=`ptz-autotrack`,e.MotionTrigger=`motion-trigger`,e.LightColorRgb=`light-color-rgb`,e.LightColorHsv=`light-color-hsv`,e.LightColorMired=`light-color-mired`,e.ClimateDualSetpoint=`climate-dual-setpoint`,e.ClimateHumidity=`climate-humidity`,e.ClimateFanMode=`climate-fan-mode`,e.ClimatePreset=`climate-preset`,e.ClimateSwingVertical=`climate-swing-vertical`,e.ClimateSwingHorizontal=`climate-swing-horizontal`,e.CoverPositionable=`cover-positionable`,e.CoverTilt=`cover-tilt`,e.ValvePositionable=`valve-positionable`,e.FanSpeed=`fan-speed`,e.FanPreset=`fan-preset`,e.FanDirection=`fan-direction`,e.FanOscillating=`fan-oscillating`,e.LockPinRequired=`lock-pin-required`,e.LockOpen=`lock-open`,e.MediaPlayerSeek=`media-player-seek`,e.MediaPlayerVolume=`media-player-volume`,e.MediaPlayerMute=`media-player-mute`,e.MediaPlayerShuffle=`media-player-shuffle`,e.MediaPlayerRepeat=`media-player-repeat`,e.MediaPlayerSelectSource=`media-player-select-source`,e.MediaPlayerPlayMedia=`media-player-play-media`,e.MediaPlayerNext=`media-player-next`,e.MediaPlayerPrevious=`media-player-previous`,e.MediaPlayerStop=`media-player-stop`,e.AlarmPinRequired=`alarm-pin-required`,e.PresenceGps=`presence-gps`,e.NotifierImage=`notifier-image`,e.NotifierPriority=`notifier-priority`,e.NotifierData=`notifier-data`,e.NotifierActions=`notifier-actions`,e.NotifierRecipients=`notifier-recipients`,e.ScriptVariables=`script-variables`,e.AutomationSkipCondition=`automation-skip-condition`,e.VacuumHasMap=`vacuum-has-map`,e.VacuumHasAi=`vacuum-has-ai`,e.MowerHasMap=`mower-has-map`,e.MowerHasTargetedMowing=`mower-has-targeted-mowing`,e}({}),In=function(e){return e.ChargingDC=`charging-dc`,e.ChargingSolar=`charging-solar`,e.NotCharging=`not-charging`,e}({}),D=function(e){return e.Siren=`siren`,e.Floodlight=`floodlight`,e.Spotlight=`spotlight`,e.PirSensor=`pir-sensor`,e.Chime=`chime`,e.Autotrack=`autotrack`,e.Nightvision=`nightvision`,e.PrivacyMask=`privacy-mask`,e.Doorbell=`doorbell`,e.BinaryHelper=`binary-helper`,e.MotionSensor=`motion-sensor`,e.ContactSensor=`contact-sensor`,e.LeakSensor=`leak-sensor`,e.SmokeSensor=`smoke-sensor`,e.COSensor=`co-sensor`,e.GasSensor=`gas-sensor`,e.TamperSensor=`tamper-sensor`,e.VibrationSensor=`vibration-sensor`,e.ConnectivitySensor=`connectivity-sensor`,e.SoundSensor=`sound-sensor`,e.BinarySensor=`binary-sensor`,e.TemperatureSensor=`temperature-sensor`,e.HumiditySensor=`humidity-sensor`,e.AmbientLightSensor=`ambient-light-sensor`,e.PressureSensor=`pressure-sensor`,e.WindSensor=`wind-sensor`,e.RainSensor=`rain-sensor`,e.UvSensor=`uv-sensor`,e.SolarRadiationSensor=`solar-radiation-sensor`,e.SoilMoistureSensor=`soil-moisture-sensor`,e.PowerSensor=`power-sensor`,e.EnergySensor=`energy-sensor`,e.VoltageSensor=`voltage-sensor`,e.CurrentSensor=`current-sensor`,e.AirQualitySensor=`air-quality-sensor`,e.BatterySensor=`battery-sensor`,e.NumericSensor=`numeric-sensor`,e.EnumSensor=`enum-sensor`,e.DateTimeSensor=`datetime-sensor`,e.GenericSensor=`generic-sensor`,e.NumericControl=`numeric-control`,e.SelectControl=`select-control`,e.TextControl=`text-control`,e.DateTimeControl=`datetime-control`,e.MobilePushNotifier=`mobile-push-notifier`,e.MessagingNotifier=`messaging-notifier`,e.EmailNotifier=`email-notifier`,e.GenericNotifier=`generic-notifier`,e}({});function Ln(e){return e instanceof Error?e.message:typeof e==`string`?e:String(e)}var Rn=fe(),zn={opus:`libopus`,aac:`aac`,pcmu:`pcm_mulaw`,pcma:`pcm_alaw`},Bn={aac:{kind:`encode`,codec:`aac`,bitrateKbps:128,sampleRateHz:48e3,channels:1},opus:{kind:`encode`,codec:`opus`,bitrateKbps:64,sampleRateHz:48e3,channels:1},pcmu:{kind:`encode`,codec:`pcmu`,sampleRateHz:8e3,channels:1}};function Vn(e){return[`-hide_banner`,`-loglevel`,e]}function Hn(e){return!e||e===`none`||e===`copy`}function Un(e,t){let n=[];if(Hn(t)||n.push(`-hwaccel`,String(t)),e.extraArgs?.length&&n.push(...e.extraArgs),e.decodeThreadCount!==void 0&&e.decodeThreadCount>0&&n.push(`-threads`,String(e.decodeThreadCount)),e.analyzeDurationUs!==void 0&&n.push(`-analyzeduration`,String(e.analyzeDurationUs)),e.probeSizeBytes!==void 0&&n.push(`-probesize`,String(e.probeSizeBytes)),e.lowDelay===!0&&n.push(`-flags`,`low_delay`),e.useWallclockTimestamps===!0&&n.push(`-use_wallclock_as_timestamps`,`1`),e.fflags?.length)for(let t of e.fflags)n.push(`-fflags`,t);if(e.rtspTransport&&n.push(`-rtsp_transport`,e.rtspTransport),e.rawVideo!==void 0){let t=e.rawVideo;n.push(`-f`,`rawvideo`,`-pix_fmt`,t.pixelFormat,`-video_size`,`${String(t.width)}x${String(t.height)}`,`-framerate`,String(t.framerate))}return n.push(`-i`,e.url),n}function Wn(e){let t=e.filterGraph;return t?{video:`[${t.videoOutLabel}]`,audio:t.audioOutLabel?`[${t.audioOutLabel}]`:`0:a:0?`}:e.extraInputs?.length?{video:`0:v:0`,audio:`0:a:0?`}:{video:null,audio:null}}function Gn(e,t,n,r){if(n){if(e)throw Error(`FfmpegInvocation: video.scale cannot be combined with a filter graph — scale inside the graph instead (the -vf would feed an output the graph already feeds)`);if(t.some(e=>e===`-vf`))throw Error(`FfmpegInvocation: outputArgs carries a -vf while a filter graph feeds the same output — fold the filter into the graph`);return[]}if(t.some(e=>e===`-vf`))return[];if(!e)return r.length>0?[`-vf`,r]:[];let i=r.length>0?`,${r}`:``;return e.mode===`exact`?[`-vf`,`scale=${e.width}:${e.height}${i}`]:[`-vf`,`scale='min(${e.width},iw)':'min(${e.height},ih)':force_original_aspect_ratio=decrease:force_divisible_by=2${i}`]}function Kn(e,t){return e===void 0||!Hn(t)?``:`format=nv12,hwupload`}function qn(e){let t=e.bitrateKbps;if(t===void 0)return[];let n=e.rateControl??{kind:`cap`,vbvSeconds:2},r=Math.max(1,Math.round(t*n.vbvSeconds));return[...n.kind===`cbr`?[`-b:v`,`${t}k`]:[],`-maxrate`,`${t}k`,`-bufsize`,`${r}k`]}function Jn(e,t,n,r){if(e.kind===`raw`){if(n&&e.filter!==void 0)throw Error(`FfmpegInvocation: video.filter cannot be combined with a filter graph — fold the filter into the graph`);return[...e.filter===void 0?[]:[`-vf`,e.filter],`-c:v`,`rawvideo`,`-pix_fmt`,e.pixelFormat,...e.fps===void 0?[]:[`-r`,String(e.fps)]]}if(e.kind===`copy`){if(n)throw Error("FfmpegInvocation: a filter graph produces a NEW picture, so video.kind must be `encode`");return[`-c:v`,`copy`,...e.bitstreamFilter?[`-bsf:v`,e.bitstreamFilter]:[]]}let i=r===void 0?``:Kn(r.device,r.decodeHwAccel);if(r!==void 0&&n)throw Error(`FfmpegInvocation: a hardware encode fed by a filter graph must upload INSIDE the graph — hwEncodeDevice cannot be combined with filterGraph`);let a=[...Gn(e.scale,t,n,i),`-c:v`,e.encoder];return e.preset!==void 0&&a.push(`-preset`,e.preset),e.tune!==void 0&&a.push(`-tune`,e.tune),e.singleSlicePerFrame===!0&&e.encoder===`libx264`&&a.push(`-x264-params`,`sliced-threads=0`),e.profile!==void 0&&a.push(`-profile:v`,e.profile),e.level!==void 0&&a.push(`-level`,e.level),e.pixelFormat!==void 0&&a.push(`-pix_fmt`,e.pixelFormat),e.fps!==void 0&&a.push(`-r`,String(e.fps)),e.gopFrames!==void 0&&a.push(`-g`,String(e.gopFrames)),e.forceKeyFramesSeconds!==void 0&&a.push(`-force_key_frames`,`expr:gte(t,n_forced*${e.forceKeyFramesSeconds})`),e.bf!==void 0&&a.push(`-bf`,String(e.bf)),a.push(...qn(e)),e.bitstreamFilter!==void 0&&a.push(`-bsf:v`,e.bitstreamFilter),a}function Yn(e){if(e.kind===`none`)return[`-an`];if(e.kind===`copy`)return[`-c:a`,`copy`];let t=[];return e.filter!==void 0&&t.push(`-af`,e.filter),t.push(`-c:a`,zn[e.codec]),e.application!==void 0&&t.push(`-application`,e.application),e.frameDurationMs!==void 0&&t.push(`-frame_duration`,String(e.frameDurationMs)),e.globalHeader===!0&&t.push(`-flags`,`+global_header`),e.sampleRateHz!==void 0&&t.push(`-ar`,String(e.sampleRateHz)),e.bitrateKbps!==void 0&&t.push(`-b:a`,`${e.bitrateKbps}k`),e.vbvBufferKbits!==void 0&&t.push(`-bufsize`,`${e.vbvBufferKbits}k`),e.channels!==void 0&&t.push(`-ac`,String(e.channels)),t}function Xn(e){let t=[];return e.payloadType!==void 0&&t.push(`-payload_type`,String(e.payloadType)),e.ssrc!==void 0&&t.push(`-ssrc`,String(e.ssrc)),e.sdpFile!==void 0&&t.push(`-sdp_file`,e.sdpFile),t.push(`-f`,`rtp`,e.url),t}function Zn(e){return e.kind===`stdout`&&(e.container===`h264`||e.container===`hevc`)}var Qn=`+frag_keyframe+empty_moov+default_base_moof`;function $n(e){return e.kind===`rtsp-listen`?[`-f`,`rtsp`,`-rtsp_transport`,`tcp`,`-rtsp_flags`,`listen`,e.url]:e.kind===`rtp-outputs`?[]:e.container===`mp4`?tr(e):[`-f`,e.container,`pipe:1`]}var er=.9;function tr(e){return[`-movflags`,Qn,`-min_frag_duration`,String(Math.max(0,Math.round(e.fragmentMs*er*1e3))),`-f`,`mp4`,`pipe:1`]}function nr(e){return[`-map`,`0:a:0?`,...Yn(e.codec===`pcma`?{kind:`encode`,codec:`pcma`,sampleRateHz:8e3,channels:1}:Bn[e.codec]),...Xn({url:e.rtpUrl,sdpFile:e.sdpFile})]}function rr(e){return e.hwEncodeDevice===void 0?void 0:{device:e.hwEncodeDevice,decodeHwAccel:e.decodeHwAccel}}function ir(e){let t=e.filterGraph??null,n=[...Vn(e.logLevel),...e.hwEncodeDevice===void 0?[]:[`-vaapi_device`,e.hwEncodeDevice.renderNode],...Un(e.input,e.decodeHwAccel),...(e.extraInputs??[]).flatMap(t=>Un(t,e.decodeHwAccel)),...t?[`-filter_complex`,t.graph]:[]],r=[...e.threadCount>0?[`-threads`,String(e.threadCount)]:[],...e.filterThreadCount!==void 0&&e.filterThreadCount>0?[`-filter_threads`,String(e.filterThreadCount)]:[]],i=Wn(e),a=i.video?[`-map`,i.video]:[],o=i.audio?[`-map`,i.audio]:[];if(e.sink.kind===`rtp-outputs`){let a=e.sink.video?[`-an`,`-map`,i.video??`0:v:0`,...Jn(e.video,e.outputArgs,t,rr(e)),...r,...e.outputArgs,...Xn(e.sink.video)]:[],o=e.sink.audio?[`-vn`,`-map`,i.audio??`0:a:0?`,...Yn(e.audio),...Xn(e.sink.audio)]:[];return[...n,...a,...o]}let s=Zn(e.sink)||e.audio.kind===`none`,c=Zn(e.sink)?[`-an`]:Yn(e.audio);return[...n,...a,...Jn(e.video,e.outputArgs,t,rr(e)),...r,...s?[]:o,...c,...e.outputArgs,...$n(e.sink),...e.audioSidecar?nr(e.audioSidecar):[]]}var ar={videotoolbox:{h264:`h264_videotoolbox`,h265:`hevc_videotoolbox`},vaapi:{h264:`h264_vaapi`,h265:`hevc_vaapi`},qsv:{h264:`h264_qsv`,h265:`hevc_qsv`},cuda:{h264:`h264_nvenc`,h265:`hevc_nvenc`},nvdec:{h264:`h264_nvenc`,h265:`hevc_nvenc`},amf:{h264:`h264_amf`,h265:`hevc_amf`}};function or(e,t,n){let r=e===`h264`?`libx264`:`libx265`;if(!n||t===null||Hn(t)||t===`auto`)return r;let i=ar[t.toLowerCase()];return i?e===`h264`?i.h264:i.h265:r}function sr(e){return e===`passthrough`?{kind:`none`}:e.codec===`copy`?{kind:`copy`}:{kind:`encode`,codec:e.codec,...e.bitrateKbps===void 0?{}:{bitrateKbps:e.bitrateKbps},...e.sampleRateHz===void 0?{}:{sampleRateHz:e.sampleRateHz},...e.channels===void 0?{}:{channels:e.channels}}}function cr(e){let t=e.profile.video,n=t.codec===`copy`||e.forceReencode!==!0&&t.codec===e.sourceCodec,r=t.width!==void 0&&t.height!==void 0?{mode:`fit`,width:t.width,height:t.height}:null,i=t.codec===`h265`?`h265`:`h264`,a=n?{kind:`copy`,...e.bitstreamFilter===void 0?{}:{bitstreamFilter:e.bitstreamFilter}}:{kind:`encode`,encoder:or(i,e.decodeHwAccel,e.hardwareEncoders===!0),scale:r,...t.preset===void 0?{}:{preset:t.preset},...t.tune===void 0?{}:{tune:t.tune},...t.singleSlicePerFrame===void 0?{}:{singleSlicePerFrame:t.singleSlicePerFrame},...t.profile===void 0?{}:{profile:t.profile},...t.level===void 0?{}:{level:t.level},...e.pixelFormat===void 0?{}:{pixelFormat:e.pixelFormat},...t.fps===void 0?{}:{fps:t.fps},...t.gopFrames===void 0?{}:{gopFrames:t.gopFrames},...e.forceKeyFramesSeconds===void 0?{}:{forceKeyFramesSeconds:e.forceKeyFramesSeconds},...t.bf===void 0?{}:{bf:t.bf},...t.bitrateKbps===void 0?{}:{bitrateKbps:t.bitrateKbps},...e.rateControl===void 0?{}:{rateControl:e.rateControl},...e.bitstreamFilter===void 0?{}:{bitstreamFilter:e.bitstreamFilter}};return{logLevel:e.logLevel??`error`,decodeHwAccel:e.decodeHwAccel,input:{url:e.sourceUrl,rtspTransport:`tcp`,fflags:[`+discardcorrupt`],...e.profile.inputArgs?.length?{extraArgs:e.profile.inputArgs}:{}},video:a,audio:sr(e.profile.audio),threadCount:e.threadCount??0,outputArgs:e.profile.outputArgs??[],sink:e.sink,...e.audioSidecar===void 0?{}:{audioSidecar:e.audioSidecar}}}var lr=16*1024*1024,ur=8,dr=16,fr=class{maxUnitBytes;buffer=new Uint8Array;unitStart=0;cursor=0;state=`init`;nextSequence=0;faultReason=null;interstitial=new Set;constructor(e={}){this.maxUnitBytes=e.maxUnitBytes??lr}get fault(){return this.faultReason}get pendingBytes(){return this.buffer.length-this.unitStart}get discardedInterstitialTypes(){return[...this.interstitial]}push(e){return this.faultReason!==null||e.length===0?[]:(this.append(e),this.pendingBytes>this.maxUnitBytes?this.fail(`a single fMP4 unit exceeded ${this.maxUnitBytes} bytes — this stream is not fragmented`):this.drainBoxes())}append(e){if(this.buffer.length===0){this.buffer=e.slice();return}let t=new Uint8Array(this.buffer.length+e.length);t.set(this.buffer,0),t.set(e,this.buffer.length),this.buffer=t}drainBoxes(){let e=[];for(;;){let t=this.readHeader();if(this.faultReason!==null)return e;if(t===null||this.cursor+t.totalBytes>this.buffer.length)break;let n=this.cursor,r=n+t.totalBytes;this.cursor=r;let i=this.consumeBox(t.type,n,r);if(this.faultReason!==null)return e;i!==null&&e.push(i)}return this.compact(),e}consumeBox(e,t,n){if(this.state===`init`){if(e!==`moof`)return null;if(t===this.unitStart)return this.fail(`a moof arrived before any initialisation box — there is no ftyp/moov to send`),null;let n=this.emit(`init`,this.unitStart,t);return this.unitStart=t,this.state=`fragment`,n}if(this.state===`idle`)return e===`moof`?(this.unitStart=t,this.state=`fragment`,null):(this.interstitial.add(e),this.unitStart=n,null);if(e!==`mdat`)return null;let r=this.emit(`fragment`,this.unitStart,n);return this.unitStart=n,this.state=`idle`,r}readHeader(){let e=this.buffer.length-this.cursor;if(e<ur)return null;let t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=t.getUint32(this.cursor),r=String.fromCharCode(this.buffer[this.cursor+4]??0,this.buffer[this.cursor+5]??0,this.buffer[this.cursor+6]??0,this.buffer[this.cursor+7]??0);if(n===0)return this.fail(`box "${r}" declares size 0 (to EOF) — an unbounded box cannot be fragmented`),null;if(n===1){if(e<dr)return null;let n=t.getBigUint64(this.cursor+ur);return n>BigInt(this.maxUnitBytes)?(this.fail(`box "${r}" declares ${n} bytes, over the ${this.maxUnitBytes} byte bound`),null):{type:r,totalBytes:Number(n)}}return n<ur?(this.fail(`box "${r}" declares an impossible size of ${n} bytes`),null):{type:r,totalBytes:n}}emit(e,t,n){let r=this.nextSequence;return this.nextSequence+=1,{kind:e,data:this.buffer.slice(t,n),sequence:r}}compact(){this.unitStart!==0&&(this.buffer=this.buffer.slice(this.unitStart),this.cursor-=this.unitStart,this.unitStart=0)}fail(e){return this.faultReason=e,this.buffer=new Uint8Array,this.unitStart=0,this.cursor=0,[]}};function pr(e){let t=JSON.stringify(e,mr);return(0,Rn.createHash)(`sha256`).update(t??``).digest(`hex`)}function mr(e,t){if(t&&typeof t==`object`&&!Array.isArray(t)){let e=t,n={};for(let t of Object.keys(e).toSorted())n[t]=e[t];return n}return t}var hr=`8.1.2-5`,gr=`https://github.com/jellyfin/jellyfin-ffmpeg/releases/download/v${hr}`;function _r(e){return`${gr}/jellyfin-ffmpeg_${hr}_portable_${e}-gpl.tar.xz`}_r(`linux64`),_r(`linuxarm64`),_r(`macarm64`),_r(`mac64`);var vr=`CAMSTACK_FFMPEG_PATH`,yr={contact:`entryOpen`,binary:`on`,switch:`on`,motion:`detected`,flood:`flooded`,gas:`detected`,smoke:`detected`,"carbon-monoxide":`detected`,vibration:`detected`,tamper:`tampered`},br={contact:`lastChangedAt`,binary:`lastChangedAt`,switch:`lastChangedAt`,motion:`lastDetectedAt`,flood:`lastChangedAt`,gas:`lastChangedAt`,smoke:`lastChangedAt`,"carbon-monoxide":`lastChangedAt`,vibration:`lastChangedAt`,tamper:`lastChangedAt`},xr=Object.keys(yr),Sr=[`sensor`,`switch`,`control`];function Cr(e){return Object.prototype.hasOwnProperty.call(yr,e)}function wr(e,t){let n=yr[e];if(n===void 0)return null;let r=t[n];return typeof r==`boolean`?r:null}function Tr(e,t){let n=br[e];if(n===void 0)return null;let r=t[n];return typeof r!=`number`||!Number.isFinite(r)||r<=0?null:r}var Er=3e4;function Dr(e){let t=e.changedAt,n=Math.max(e.startedAtMs,e.nowMs-e.firstSightingFreshnessMs),r=e.priorLevel===void 0&&e.level&&t!==null&&Number.isFinite(t)&&t>=n,i=e.priorLevel===!1&&e.level&&t!==null&&Number.isFinite(t);return(r||i)&&t!==null?{kind:`rise`,timestamp:t}:{kind:`none`,nextPriorLevel:e.level}}function Or(e){let t=wr(e.capName,e.slice);return t===null?{edge:`none`,value:null,reason:Cr(e.capName)?`non-boolean-value`:`unknown-cap`}:Dr({level:t,changedAt:Tr(e.capName,e.slice),priorLevel:e.prior,startedAtMs:e.startedAtMs,nowMs:e.nowMs,firstSightingFreshnessMs:e.firstSightingFreshnessMs}).kind===`rise`?{edge:`rising`,value:!0}:e.prior===void 0?t?{edge:`none`,value:t,reason:`baseline-seeded-stale-active`}:{edge:`none`,value:t,reason:`baseline-seeded-inactive`}:e.prior===t?{edge:`none`,value:t,reason:`no-change`}:t?{edge:`none`,value:t,reason:`missing-timestamp`}:{edge:`none`,value:t,reason:`falling-edge`}}var O=class extends Error{position;constructor(e,t){super(e),this.name=`ExpressionParseError`,this.position=t}},k=class extends Error{constructor(e){super(e),this.name=`ExpressionEvalError`}};function kr(e){return e===`rose`||e===`count`}function A(e,t,n){if(typeof e!=`number`||!Number.isFinite(e))throw new k(`${t}: argument ${n+1} must be a finite number`);return e}function Ar(e,t,n){if(typeof e!=`string`)throw new k(`${t}: argument ${n+1} must be a string`);return e}function j(e,t){if(!Number.isFinite(e))throw new k(`${t}: produced a non-finite result`);return e}function jr(e,t){return e.map((e,n)=>A(e,t,n))}function Mr(e,t,n){if(typeof e!=`boolean`)throw new k(`${t}: argument ${n+1} must be a boolean`);return e}var Nr=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;function Pr(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;if(typeof e!=`string`)return null;let t=e.trim();if(!Nr.test(t))return null;let n=Number(t);return Number.isFinite(n)?n:null}var Fr=2e3;function Ir(e,t,n,r,i,a){let o=Mr(e,`rose`,0),s=typeof t==`number`&&Number.isFinite(t)?t:null,c=n===void 0?Fr:A(n,`rose`,2);if(c<0)throw new k(`rose: debounce must be a non-negative finite number`);let l=Dr({level:o,changedAt:s,priorLevel:r.priorLevel,startedAtMs:a.startedAtMs,nowMs:a.nowMs,firstSightingFreshnessMs:Er});return r.priorLevel=l.kind===`rise`?!0:l.nextPriorLevel,l.kind===`none`||i.acceptedEdgeAt!==null&&l.timestamp-i.acceptedEdgeAt<c?a.currentOutput:(i.acceptedEdgeAt=l.timestamp,l.timestamp)}function Lr(e,t,n){let r=typeof n==`number`&&Number.isFinite(n)&&n>=0?n:0;return e===null?(t.primed=!0,r):typeof e!=`number`||!Number.isFinite(e)?r:t.primed?t.highWater!==null&&e<=t.highWater?r:(t.highWater=e,r+1):(t.primed=!0,t.highWater=e,r)}var Rr=1/0,zr={min:{minArgs:1,maxArgs:Rr,apply:e=>j(Math.min(...jr(e,`min`)),`min`)},max:{minArgs:1,maxArgs:Rr,apply:e=>j(Math.max(...jr(e,`max`)),`max`)},abs:{minArgs:1,maxArgs:1,apply:e=>j(Math.abs(A(e[0],`abs`,0)),`abs`)},floor:{minArgs:1,maxArgs:1,apply:e=>j(Math.floor(A(e[0],`floor`,0)),`floor`)},ceil:{minArgs:1,maxArgs:1,apply:e=>j(Math.ceil(A(e[0],`ceil`,0)),`ceil`)},sqrt:{minArgs:1,maxArgs:1,apply:e=>j(Math.sqrt(A(e[0],`sqrt`,0)),`sqrt`)},round:{minArgs:1,maxArgs:2,apply:e=>{let t=A(e[0],`round`,0),n=e.length>1?Math.trunc(A(e[1],`round`,1)):0;if(n<0||n>100)throw new k(`round: digits must be between 0 and 100`);let r=10**n;return j(Math.round(t*r)/r,`round`)}},pow:{minArgs:2,maxArgs:2,apply:e=>j(A(e[0],`pow`,0)**A(e[1],`pow`,1),`pow`)},clamp:{minArgs:3,maxArgs:3,apply:e=>{let t=A(e[0],`clamp`,0),n=A(e[1],`clamp`,1),r=A(e[2],`clamp`,2);if(n>r)throw new k(`clamp: lower bound is greater than upper bound`);return j(Math.min(r,Math.max(n,t)),`clamp`)}},avg:{minArgs:1,maxArgs:Rr,apply:e=>{let t=jr(e,`avg`);return j(t.reduce((e,t)=>e+t,0)/t.length,`avg`)}},sum:{minArgs:1,maxArgs:Rr,apply:e=>j(jr(e,`sum`).reduce((e,t)=>e+t,0),`sum`)},coalesce:{minArgs:1,maxArgs:Rr,apply:e=>{for(let t of e)if(t!==null)return t;return null}},age:{minArgs:2,maxArgs:2,apply:e=>j(A(e[0],`age`,0)-A(e[1],`age`,1),`age`)},convert:{minArgs:3,maxArgs:3,apply:(e,t)=>{let n=A(e[0],`convert`,0),r=Ar(e[1],`convert`,1).trim(),i=Ar(e[2],`convert`,2).trim();if(t.convert){let e=t.convert(n,r,i);if(e===null)throw new k(`convert: cannot convert '${r}' to '${i}'`);return j(e,`convert`)}if(r===i)return n;throw new k(`convert: unit conversion table not installed`)}},any:{minArgs:1,maxArgs:Rr,apply:e=>e.map((e,t)=>Mr(e,`any`,t)).some(e=>e)},all:{minArgs:1,maxArgs:Rr,apply:e=>e.map((e,t)=>Mr(e,`all`,t)).every(e=>e)},within:{minArgs:2,maxArgs:2,apply:(e,t)=>{let n=A(e[1],`within`,1);if(n<0)throw new k(`within: the window must not be negative`);let r=e[0];if(r===null)return!1;let i=A(r,`within`,0),a=t.now;if(a===void 0||!Number.isFinite(a))throw new k(`within: no clock was supplied to this evaluation`);let o=a-i<=n;return o&&t.noteDeadline?.(i+n+1),o}},number:{minArgs:1,maxArgs:1,apply:e=>Pr(e[0])},latest:{minArgs:1,maxArgs:Rr,apply:e=>{let t=e.flatMap((e,t)=>e===null?[]:[A(e,`latest`,t)]);return t.length===0?null:j(Math.max(...t),`latest`)}},rose:{minArgs:2,maxArgs:3,apply:()=>{throw new k(`rose: stateful evaluation context is required`)}},count:{minArgs:1,maxArgs:1,apply:()=>{throw new k(`count: stateful evaluation context is required`)}}},Br=Object.freeze(Object.assign(Object.create(null),zr)),Vr=new Set(Object.keys(zr)),Hr=2048,Ur=256,Wr=4096,Gr=32,Kr=16,qr=256,Jr=/^[A-Za-z_][A-Za-z0-9_]*$/,Yr=new Set([`now`,`true`,`false`,`null`]),Xr=new Set([`true`,`false`,`null`]);function Zr(e){return e>=`0`&&e<=`9`}function Qr(e){return e>=`A`&&e<=`Z`||e>=`a`&&e<=`z`||e===`_`}function $r(e){return Qr(e)||Zr(e)}function ei(e){return e===` `||e===` `||e===`
3
+ `||e===`\r`||e===`\f`||e===`\v`}function ti(e){if(e.length>2048)throw new O(`expression too long (${e.length} > ${Hr} chars)`,0);let t=[],n=0,r=e.length;for(;n<r;){let i=e[n];if(ei(i)){n+=1;continue}if(Zr(i)){let i=n;for(;n<r&&Zr(e[n]);)n+=1;if(n<r&&e[n]===`.`){if(n+1>=r||!Zr(e[n+1]))throw new O(`malformed number: decimal point needs a digit`,n);for(n+=1;n<r&&Zr(e[n]);)n+=1}let a=e.slice(i,n),o=Number(a);if(!Number.isFinite(o))throw new O(`malformed number: '${a}'`,i);t.push({type:`number`,value:o,pos:i});continue}if(i===`'`||i===`"`){let a=i,o=n;n+=1;let s=``,c=!1;for(;n<r;){let t=e[n];if(t===`\\`){let t=n+1<r?e[n+1]:``;if(t===`\\`||t===`'`||t===`"`){s+=t,n+=2;continue}throw new O(`invalid string escape: '\\${t}'`,n)}if(t===a){c=!0,n+=1;break}s+=t,n+=1}if(!c)throw new O(`unterminated string literal`,o);t.push({type:`string`,value:s,pos:o});continue}if(Qr(i)){let i=n;for(;n<r&&$r(e[n]);)n+=1;let a=e.slice(i,n);Xr.has(a)?t.push({type:`keyword`,keyword:ni(a),pos:i}):t.push({type:`identifier`,name:a,pos:i});continue}let a=n+1<r?e.slice(n,n+2):``;if(a===`<=`||a===`>=`||a===`==`||a===`!=`||a===`&&`||a===`||`){t.push({type:`punct`,punct:a,pos:n}),n+=2;continue}if(ri(i)){t.push({type:`punct`,punct:i,pos:n}),n+=1;continue}throw new O(`unexpected character '${i}'`,n)}return t.push({type:`eof`,pos:r}),t}function ni(e){return e===`true`?`true`:e===`false`?`false`:`null`}function ri(e){return e===`(`||e===`)`||e===`,`||e===`?`||e===`:`||e===`+`||e===`-`||e===`*`||e===`/`||e===`%`||e===`!`||e===`<`||e===`>`}var ii={"||":1,"&&":2,"==":3,"!=":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6};function ai(e){return e===`&&`||e===`||`}function oi(e){return e===`+`||e===`-`||e===`*`||e===`/`||e===`%`||e===`==`||e===`!=`||e===`<`||e===`<=`||e===`>`||e===`>=`}var si=class{tokens;pos=0;nodeCount=0;identifiers=new Set;callees=new Set;constructor(e){this.tokens=e}parse(){let e=this.parseTernary(),t=this.peek();if(t.type!==`eof`)throw new O(`unexpected trailing input`,t.pos);return{ast:e,identifiers:this.identifiers,callees:this.callees,nodeCount:this.nodeCount}}peek(){return this.tokens[this.pos]}next(){return this.tokens[this.pos++]}expectPunct(e){let t=this.peek();if(t.type!==`punct`||t.punct!==e)throw new O(`expected '${e}'`,t.pos);this.pos+=1}matchPunct(e){let t=this.peek();return t.type===`punct`&&t.punct===e?(this.pos+=1,!0):!1}countNode(){if(this.nodeCount+=1,this.nodeCount>256)throw new O(`expression too complex`,this.peek().pos)}parseTernary(){let e=this.parseBinary(1);if(this.matchPunct(`?`)){let t=this.parseTernary();this.expectPunct(`:`);let n=this.parseTernary();return this.countNode(),{kind:`conditional`,test:e,consequent:t,alternate:n}}return e}parseBinary(e){let t=this.parseUnary();for(;;){let n=this.peek();if(n.type!==`punct`)break;let r=ii[n.punct];if(r===void 0||r<e)break;let i=n.punct;this.pos+=1;let a=this.parseBinary(r+1);if(this.countNode(),ai(i))t={kind:`logical`,op:i,left:t,right:a};else if(oi(i))t={kind:`binary`,op:i,left:t,right:a};else throw new O(`unexpected operator '${i}'`,n.pos)}return t}parseUnary(){let e=this.peek();if(e.type===`punct`&&(e.punct===`!`||e.punct===`-`)){let t=e.punct;this.pos+=1;let n=this.parseUnary();return this.countNode(),{kind:`unary`,op:t,operand:n}}return this.parsePrimary()}parsePrimary(){let e=this.next();switch(e.type){case`number`:return this.countNode(),{kind:`literal`,value:e.value};case`string`:return this.countNode(),{kind:`literal`,value:e.value};case`keyword`:return this.countNode(),{kind:`literal`,value:e.keyword===`null`?null:e.keyword===`true`};case`identifier`:{let t=this.peek();return t.type===`punct`&&t.punct===`(`?this.parseCall(e.name,e.pos):(this.identifiers.add(e.name),this.countNode(),{kind:`identifier`,name:e.name})}case`punct`:if(e.punct===`(`){let e=this.parseTernary();return this.expectPunct(`)`),e}throw new O(`unexpected token '${e.punct}'`,e.pos);case`eof`:throw new O(`unexpected end of expression`,e.pos)}}parseCall(e,t){if(!Vr.has(e))throw new O(`unknown function '${e}'`,t);this.expectPunct(`(`);let n=[];if(!this.matchPunct(`)`))for(;;){if(n.push(this.parseTernary()),n.length>16)throw new O(`too many arguments to '${e}'`,t);if(!this.matchPunct(`,`)){this.expectPunct(`)`);break}}return this.callees.add(e),this.countNode(),{kind:`call`,callee:e,args:n}}};function ci(e){return new si(ti(e)).parse()}var li=new Map;function ui(e){let t=li.get(e);if(t!==void 0)return li.delete(e),li.set(e,t),t;let n;try{n={ok:!0,parsed:ci(e)}}catch(e){n={ok:!1,error:e instanceof O?e.message:String(e)}}if(li.set(e,n),li.size>256){let e=li.keys().next().value;e!==void 0&&li.delete(e)}return n}function di(e){let t=ui(e);if(t.ok)return t.parsed;throw new O(t.error)}function fi(e){return ui(e)}var pi=Object.freeze({});function mi(e){let t=Object.create(null);for(let n of Object.keys(e))Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function hi(e){return typeof e==`number`&&Number.isFinite(e)}function gi(e){return!!e}function _i(e,t){if(!Number.isFinite(e))throw new k(`${t} produced a non-finite result`);return e}function vi(e){if(e.steps+=1,e.steps>e.maxSteps)throw new k(`expression evaluation step budget exceeded`)}function M(e,t){return`${e}/${t}`}function N(e,t,n){switch(vi(t),e.kind){case`literal`:return e.value;case`identifier`:if(!(e.name in t.scope))throw new k(`unknown identifier: ${e.name}`);return t.scope[e.name];case`unary`:return yi(e.op,N(e.operand,t,M(n,`operand`)));case`binary`:return bi(e.op,N(e.left,t,M(n,`left`)),N(e.right,t,M(n,`right`)));case`logical`:{let r=N(e.left,t,M(n,`left`));return e.op===`&&`?gi(r)?N(e.right,t,M(n,`right`)):r:gi(r)?r:N(e.right,t,M(n,`right`))}case`conditional`:return gi(N(e.test,t,M(n,`test`)))?N(e.consequent,t,M(n,`consequent`)):N(e.alternate,t,M(n,`alternate`));case`call`:{let r=e.args.map((e,r)=>N(e,t,M(n,`arg:${r}`)));return xi(e.callee,r,n,t)}}}function yi(e,t){if(e===`!`)return!gi(t);if(!hi(t))throw new k(`unary "-" requires a finite number`);return _i(-t,`unary "-"`)}function bi(e,t,n){switch(e){case`==`:return t===n;case`!=`:return t!==n;case`+`:if(typeof t==`string`&&typeof n==`string`)return t+n;if(hi(t)&&hi(n))return _i(t+n,`"+"`);throw new k(`"+" requires two numbers or two strings`);case`-`:case`*`:case`/`:case`%`:if(!hi(t)||!hi(n))throw new k(`"${e}" requires two finite numbers`);return _i(e===`-`?t-n:e===`*`?t*n:e===`/`?t/n:t%n,`"${e}"`);case`<`:case`<=`:case`>`:case`>=`:if(hi(t)&&hi(n)||typeof t==`string`&&typeof n==`string`)return e===`<`?t<n:e===`<=`?t<=n:e===`>`?t>n:t>=n;throw new k(`"${e}" requires two numbers or two strings`)}}function xi(e,t,n,r){if(!Object.prototype.hasOwnProperty.call(Br,e))throw new k(`unknown function: ${e}`);let i=Br[e];if(t.length<i.minArgs||t.length>i.maxArgs)throw new k(`${e}: wrong number of arguments (${t.length})`);if(kr(e)){if(r.invokeStateful===void 0)throw new k(`${e}: stateful evaluation context is required`);return r.invokeStateful({name:e,path:n,args:t})}return i.apply(t,r.hooks)}function Si(e,t,n){return N(e,{scope:t,hooks:n?.hooks??pi,maxSteps:n?.maxSteps??4096,...n?.invokeStateful===void 0?{}:{invokeStateful:n.invokeStateful},steps:0},`root`)}function Ci(){return{calls:new Map,acceptedEdgeAt:null}}function wi(e){return{calls:new Map([...e.calls].map(([e,t])=>[e,{...t}])),acceptedEdgeAt:e.acceptedEdgeAt}}function Ti(e,t,n){let r=t.calls.get(e.path);switch(e.name){case`rose`:{let i=r?.kind===`rose`?r:{kind:`rose`};t.calls.set(e.path,i);let a=n.currentOutput===null||typeof n.currentOutput==`number`&&Number.isFinite(n.currentOutput)?n.currentOutput:null;return Ir(e.args[0],e.args[1],e.args[2],i,t,{currentOutput:a,startedAtMs:n.startedAtMs,nowMs:n.nowMs})}case`count`:{let i=r?.kind===`count`?r:{kind:`count`,highWater:null,primed:!1};return t.calls.set(e.path,i),Lr(e.args[0],i,n.currentOutput)}}}var Ei=`now`;function Di(e){if(e===null)return null;if(typeof e==`string`||typeof e==`boolean`)return e;if(typeof e==`number`)return Number.isFinite(e)?e:void 0}function Oi(e){let t=Object.keys(e.bindings);if(t.length>32)return`too many bindings (${t.length} > 32)`;for(let e of t){if(!Jr.test(e))return`invalid binding name '${e}'`;if(Yr.has(e))return`binding name '${e}' is reserved`;if(Vr.has(e))return`binding name '${e}' shadows a builtin function`}let n=fi(e.expr);if(!n.ok)return n.error;let r=new Set(t);for(let e of n.parsed.identifiers)if(e!==`now`&&!r.has(e))return`expression references unbound identifier '${e}'`;return null}function ki(e,t,n,r){let i=fi(e);if(!i.ok)return{ok:!1,error:i.error};let a=mi({...t,now:n}),o={...r?.hooks,now:n};try{return{ok:!0,value:Si(i.parsed.ast,a,{...r,hooks:o})}}catch(e){return{ok:!1,error:e instanceof k?e.message:String(e)}}}var Ai=`composer`,ji=`customize:`,Mi=`composed-`,Ni=16,Pi=32,Fi=2e4,Ii=u({addonId:c().min(1),stableId:c().min(1)}),Li=u({source:Ii,cap:c().min(1),fieldPath:c().min(1)}),Ri=Li.extend({kind:p(`from`)}),zi=u({kind:p(`literal`),value:d([c(),i(),x(),ie()])}),Bi=f(`kind`,[Ri,zi]),Vi=u({kind:p(`expression`),expr:c().min(1).max(Hr),bindings:_(c().regex(Jr),Bi)}).superRefine((e,t)=>{let n=Oi(e);n!==null&&t.addIssue({code:`custom`,message:n,path:[`expr`]})}),Hi=u({kind:p(`code`),code:c().min(1).max(Fi)}),Ui=f(`kind`,[Ri,Vi,Hi]),Wi=u({kind:p(`forward`),source:Ii,cap:c().min(1),method:c().min(1)}),Gi=f(`kind`,[Wi,Hi]),Ki=/^[a-z0-9][a-z0-9-]{0,47}$/,qi=16,Ji=`items`,Yi=u({label:c().min(1).max(80),fields:_(c().min(1),Ui)}),Xi=u({kind:p(`fields`),cap:c().min(1),enabled:x().optional(),fields:_(c().min(1),Ui).refine(e=>Object.keys(e).length<=32,{message:`at most 32 fields per capability`}),items:_(c().regex(Ki),Yi).refine(e=>Object.keys(e).length<=16,{message:`at most 16 items`}).optional(),commands:_(c().min(1),Gi).optional()}),Zi=u({kind:p(`passthrough`),cap:c().min(1),enabled:x().optional(),source:Ii}),Qi=f(`kind`,[Xi,Zi]);function $i(e){return e.enabled!==!1}var ea=u({kind:p(`new`),type:y(E),role:y(D).optional()}),ta=u({kind:p(`existing`),device:Ii}),na=f(`kind`,[ea,ta]),ra=u({target:na,features:b(Qi).min(1).max(16)}).superRefine((e,t)=>{let n=new Set;e.features.forEach((e,r)=>{n.has(e.cap)&&t.addIssue({code:`custom`,message:`capability \`${e.cap}\` is composed twice — one feature per capability`,path:[`features`,r,`cap`]}),n.add(e.cap)})});function P(e){return`${e.addonId}/${e.stableId}`}function ia(e,t){return`${P(e)}#${t}`}function aa(e){return`${ia(e.source,e.cap)}.${e.fieldPath}`}function oa(e){return`${Mi}${e}`}function sa(e){return{addonId:Ai,stableId:oa(e)}}function ca(e){switch(e.kind){case`from`:return[{source:e.source,cap:e.cap,fieldPath:e.fieldPath}];case`expression`:return Object.values(e.bindings).flatMap(e=>e.kind===`from`?[{source:e.source,cap:e.cap,fieldPath:e.fieldPath}]:[]);case`code`:return[]}}function la(e,t,n){return`${e}[${t}].${n}`}function ua(e,t=Ji){return[...Object.entries(e.fields).map(([e,t])=>({fieldPath:e,source:t})),...Object.entries(e.items??{}).flatMap(([e,n])=>Object.entries(n.fields).map(([n,r])=>({fieldPath:la(t,e,n),source:r})))]}function da(e){return ua(e).map(e=>e.source)}var fa=function(e){return e.Addon=`addon`,e.Core=`core`,e.Device=`device`,e.Provider=`provider`,e.System=`system`,e}({}),pa=[`track`,`face`,`identity`,`plate`,`vehicle`,`scene`,`motion`,`object`,`audio`,`mosaic`],ma=new Set(pa),ha=/^\d+$/;function ga(e){return ma.has(e)}function _a(e){let t=e.split(`:`);if(t.length!==3&&t.length!==4)return null;let[n,r,i,a]=t;return n===void 0||!ga(n)||r===void 0||r.length===0||i===void 0||i.length===0?null:a===void 0?{ownerType:n,ownerId:r,fileKind:i}:ha.test(a)?{ownerType:n,ownerId:r,fileKind:i,timestampMs:Number(a)}:null}function va(e){let t=`${e.ownerType}:${e.ownerId}:${e.fileKind}`;return e.timestampMs===void 0?t:`${t}:${e.timestampMs}`}var ya=[`motion`,`object`,`audio`],ba=y(ya),xa=[...ya,`track`],Sa=y(xa),Ca=new Set(ya);function wa(e){return Ca.has(e)}function Ta(e,t){return{id:e,getRoutes:()=>t,invoke:async e=>{let n=Ea(t,e.method,e.path);if(!n)return{status:404,headers:{},redirectUrl:null,body:{error:`No route matches ${e.method} ${e.path}`}};let r={status:200,headers:{},redirectUrl:null},i=Oa(r),a={params:{...e.params,...n.params},query:e.query,body:e.body,headers:e.headers,...e.user?{user:e.user}:{},...e.scopedToken===void 0?{}:{scopedToken:e.scopedToken}};return await n.route.handler(a,i),r}}}function Ea(e,t,n){let r=t.toUpperCase();for(let t of e){if(t.method!==r)continue;let e=Da(t.path,n);if(e!==null)return{route:t,params:e}}return null}function Da(e,t){let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean);if(n.length!==r.length)return null;let i={};for(let e=0;e<n.length;e++){let t=n[e],a=r[e];if(t.startsWith(`:`))i[t.slice(1)]=a;else if(t!==a)return null}return i}function Oa(e){let t={status(n){return e.status=n,t},code(n){return e.status=n,t},send(t){e.body=t},redirect(t){e.redirectUrl=t,e.status===200&&(e.status=302)},header(n,r){return e.headers[n.toLowerCase()]=r,t},type(n){return e.contentType=n,t}};return t}var ka=u({codec:y([`h264`,`h265`,`copy`]),profile:y([`baseline`,`main`,`high`]).optional(),level:c().optional(),width:i().int().positive().optional(),height:i().int().positive().optional(),fps:i().positive().optional(),bitrateKbps:i().int().positive().optional(),gopFrames:i().int().positive().optional(),bf:i().int().min(0).optional(),preset:y([`ultrafast`,`superfast`,`veryfast`,`faster`,`fast`,`medium`]).optional(),tune:y([`zerolatency`,`film`,`animation`]).optional(),singleSlicePerFrame:x().optional()}),Aa=d([p(`passthrough`),u({codec:y([`opus`,`aac`,`pcmu`,`pcma`,`copy`]),bitrateKbps:i().int().positive().optional(),sampleRateHz:i().int().positive().optional(),channels:d([p(1),p(2)]).optional()})]),ja=u({video:ka,audio:Aa,inputArgs:b(c()).optional(),outputArgs:b(c()).optional()});function Ma(e){let t=e.codec?.toLowerCase().replace(/[.\s-]/g,``),n={codec:t===`h265`||t===`hevc`?`h265`:`h264`,...e.resolution?.width===void 0?{}:{width:e.resolution.width},...e.resolution?.height===void 0?{}:{height:e.resolution.height},...e.fps===void 0?{}:{fps:e.fps}};if(!(n.width===void 0&&n.height===void 0&&n.fps===void 0))return{video:n,audio:`passthrough`}}function Na(e,t,n){let r=e>=n;return r===t>=n?r?e-t:t-e:r?-1:1}function Pa(e){let t=e.toLowerCase().replace(/[.\s-]/g,``);return t===`hevc`||t===`hvc1`||t===`hev1`?`h265`:t===`avc`||t===`avc1`?`h264`:t}function Fa(e,t){if(t.length===0)return!0;if(e===void 0)return!1;let n=Pa(e);return t.some(e=>Pa(e)===n)}function Ia(e,t){for(let n=0;n<t.length;n+=1)if(e.startsWith(t[n]))return n;return t.length}function La(e,t){let n=e.filter(e=>t.allowTranscode||Fa(e.codec,t.acceptCodecs));if(n.length===0)return null;let r=t.targetHeight,i=n.map(e=>({candidate:e,transcodes:!Fa(e.codec,t.acceptCodecs),provider:Ia(e.camStreamId,t.preferredProviders),height:e.height??0}));i.sort((e,n)=>e.transcodes===n.transcodes?e.provider===n.provider?r===void 0?t.resolutionPreference===`highest`?n.height-e.height:e.height-n.height:Na(e.height,n.height,r):e.provider-n.provider:e.transcodes?1:-1);let a=i[0];return a===void 0?null:{candidate:a.candidate,transcodes:a.transcodes}}var Ra={video:{codec:`h264`,profile:`baseline`,level:`3.1`,width:1280,height:720,fps:25,bitrateKbps:2500,gopFrames:25,bf:0,preset:`veryfast`,tune:`zerolatency`},audio:`passthrough`},za={...Ra,video:{...Ra.video,bitrateKbps:3e3,gopFrames:30,preset:`ultrafast`},audio:`passthrough`},Ba={...Ra,audio:{codec:`opus`},video:{...Ra.video,singleSlicePerFrame:!0}},Va={kind:`cbr`,vbvSeconds:1},Ha={kind:`cap`,vbvSeconds:2},Ua=360,Wa=400,Ga=24,Ka={kind:`encode`,codec:`opus`,bitrateKbps:24,channels:1,application:`lowdelay`,globalHeader:!0,filter:`aresample=async=1000:first_pts=0`},qa=96,Ja=4;function Ya(e){let t=e.now??(()=>Date.now()),n=null,r=-1/0;return{read(){return t()-r<e.ttlMs?n:void 0},write(e){n=e,r=t()}}}function Xa(e){return!e||e===`none`||e===`copy`}async function Za(e){let t=e.override;if(t!=null&&t!==``)return Xa(t)?null:t;let n=e.cache?.read();if(n!==void 0)return n;let r;try{r=await e.readDecoderBackend()}catch(t){let n=await e.readKernelPreferred().catch(()=>[]);return e.onFallback({reason:`decoder-unreadable`,kernelPreferred:n,error:t instanceof Error?t.message:String(t)}),e.cache?.write(null),null}if(r===``){let t=await e.readKernelPreferred().catch(()=>[]);return e.onFallback({reason:`decoder-unprobed`,kernelPreferred:t}),e.cache?.write(null),null}let i=Xa(r)?null:r;return e.cache?.write(i),i}function Qa(e){return String(Math.round(e*1e3)/1e3)}function $a(e,t){return!Number.isFinite(t)||t<=0?e:e/t}function eo(e){let t=e.speed>0?e.speed:1;return t===1?`[0:v]fps=${Qa(e.fps)},scale=${e.maxWidth}:-2:flags=lanczos,split[a][b];[a]palettegen=stats_mode=diff[p];[b][p]paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle`:`[0:v]fps=${Qa(e.fps/t)},setpts=PTS/${t},fps=${Qa(e.fps)},scale=${e.maxWidth}:-2:flags=lanczos,split[a][b];[a]palettegen=stats_mode=diff[p];[b][p]paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle`}function to(e){return[`-y`,`-v`,`error`,`-f`,`mp4`,`-i`,e.input??`pipe:0`,`-filter_complex`,eo(e),`-loop`,`0`,`-f`,`gif`,`pipe:1`]}function no(e){return{transport:e.publishLocally===!0?`push`:`dial`}}var ro=`\0unset`;function io(e){return{codec:e.codec,profile:e.profile??ro,level:e.level??ro,width:e.width??-1,height:e.height??-1,fps:e.fps??-1,bitrateKbps:e.bitrateKbps??-1,gopFrames:e.gopFrames??-1,bf:e.bf??-1,preset:e.preset??ro,tune:e.tune??ro,singleSlicePerFrame:e.singleSlicePerFrame===void 0?ro:String(e.singleSlicePerFrame)}}function ao(e){return e===`passthrough`?{codec:`passthrough`}:{codec:e.codec,bitrateKbps:e.bitrateKbps??-1,sampleRateHz:e.sampleRateHz??-1,channels:e.channels??-1}}function oo(e,t=no(e)){return{deviceId:e.deviceId,source:e.source.kind===`profile`?`profile:${e.source.profile}`:`cam-stream:${e.source.camStreamId}`,transport:t.transport,fragmentMs:t.fragmentMs??-1,video:io(e.encode.video),audio:ao(e.encode.audio),rateControl:e.rateControl??`relaxed`,bitstreamFilter:e.bitstreamFilter??ro,pixelFormat:e.pixelFormat??ro,decodeHwAccel:e.decodeHwAccel??ro}}function so(e,t=no(e)){return`egress:${pr(oo(e,t))}`}function co(e){let t=null;return()=>{if(t!==null)return t;let n=e();return t=n,n.catch(()=>{t===n&&(t=null)}),n}}var lo=y([`singleton`,`device`,`widget`]),uo=u({capName:c(),kind:lo,deviceId:i().optional(),reachable:x(),latencyMs:i(),error:c().optional()}),fo=u({addonId:c(),caps:b(uo).readonly(),widgets:b(uo).readonly()}),po=u({nodeId:c(),addons:b(fo).readonly()}),mo=u({ok:x(),degraded:x(),checkedAt:c(),nodes:b(po).readonly(),summary:u({total:i(),reachable:i(),unreachable:i()})}),ho=`hub-only`;function go(e){return{placement:e.execution?.placement??`hub-only`,group:e.execution?.group}}function _o(e){let t=go(e).placement;return t===`any-node`||t===`agent-only`}function vo(e){return go(e).placement===`agent-only`}function yo(e){return go(e).group}function bo(e,t){return e.execution?.group??t}function xo(e){return go(e).placement}function So(e){return e.execution?.isolate===!0}var Co=y([`running`,`done`,`failed`,`cancelled`]),wo=y([`adopted`,`already-adopted`,`failed`,`cancelled`]),To=u({childNativeId:c(),outcome:wo,parentDeviceId:i().int().nonnegative().nullable(),accessoryCount:i().int().nonnegative(),error:c().nullable()}),Eo=u({jobId:c(),addonId:c(),integrationId:c(),state:Co,total:i().int().nonnegative(),processed:i().int().nonnegative(),adopted:i().int().nonnegative(),alreadyAdopted:i().int().nonnegative(),failed:i().int().nonnegative(),accessoriesCreated:i().int().nonnegative(),currentChildNativeId:c().nullable(),results:b(To).readonly(),startedAt:i(),finishedAt:i().nullable(),error:c().nullable()}),Do={cleanupIntervalMs:3600*1e3,detectionEventsDays:30,audioLevelsDays:7,snapshotsDays:14},Oo=y([`stream-broker`,`object-detection`,`privacy-mask`,`device-audio`,`broker-audio`,`audio-analysis`,`event-saving`,`recording`,`notifications`]),ko=[`stream-broker`,`object-detection`,`privacy-mask`,`device-audio`,`broker-audio`,`audio-analysis`,`event-saving`,`recording`,`notifications`],Ao=f(`kind`,[u({kind:p(`device-disabled`)}),u({kind:p(`wrapper-binding`),capName:c()}),u({kind:p(`recording-config`)}),u({kind:p(`notification-mute`)}),u({kind:p(`camera-audio`),capName:c()}),u({kind:p(`camera-mask`),capName:c()}),u({kind:p(`broker-audio-mute`)})]),jo=y([`no-provider`,`source-unreachable`,`device-disabled`]),Mo=y([`no-privacy-zones`]),No=u({id:Oo,label:c(),costWhenOff:c(),available:x(),unavailableReason:jo.optional(),warning:Mo.optional(),enabled:x(),authority:Ao}),Po=u({deviceId:i().int(),switches:b(No).readonly(),fetchedAt:i()}),Fo=`detection-pipeline`,Io=`audio-analysis`,Lo=`privacy-mask`,Ro=`pipeline-analytics`,zo=[`motion-detection`,Fo,Io,Ro,`scene-monitor`],Bo={"stream-broker":{id:`stream-broker`,label:`Camera`,costWhenOff:`Off: the whole camera stops. No live view, no recording, no detection and no notifications — its streams are released and nothing dials it again until you turn it back on.`,authority:{kind:`device-disabled`},countsAsSwitchedOff:!0},"object-detection":{id:`object-detection`,label:`Object detection & tracking`,costWhenOff:`Off: nothing is detected or tracked on this camera, so it produces no events — and with no events there are no object notifications and no event-triggered recording. Live view and continuous recording are unaffected.`,authority:{kind:`wrapper-binding`,capName:Fo},countsAsSwitchedOff:!0},"privacy-mask":{id:`privacy-mask`,label:`Privacy mask`,costWhenOff:`On: the zones you drew on this camera are blacked out by the camera itself — live view, playback, exports and detection all see the black boxes, and nothing behind them was ever recorded. Off: the camera captures the whole frame, and your zones are kept for when you turn it back on.`,authority:{kind:`camera-mask`,capName:Lo},countsAsSwitchedOff:!1},"device-audio":{id:`device-audio`,label:`Camera microphone`,costWhenOff:`Off: the camera captures no sound at all. Live view and recordings become silent video, and audio detection and classification have nothing left to analyse — turning them back on will not recover it. The picture, motion and object detection are unaffected, and two-way talk still works. Applies at the camera, so every consumer sees the same silence.`,authority:{kind:`camera-audio`,capName:Lo},countsAsSwitchedOff:!0},"broker-audio":{id:`broker-audio`,label:`Audio distribution`,costWhenOff:`Off: this server distributes no sound for this camera — live view is silent and everything recorded while it is off is silent FOREVER, even after you turn it back on. Audio detection and classification also have nothing to analyse. The camera keeps capturing sound, so nothing about the camera changes and turning this back on is instant, with no interruption to the picture.`,authority:{kind:`broker-audio-mute`},countsAsSwitchedOff:!0},"audio-analysis":{id:`audio-analysis`,label:`Audio detection & classification`,costWhenOff:`Off: no audio is decoded or classified for this camera. Tracks carry no audio labels and no audio-triggered rule can fire. Audio recorded alongside video is unaffected.`,authority:{kind:`wrapper-binding`,capName:Io},countsAsSwitchedOff:!0},"event-saving":{id:`event-saving`,label:`Event saving`,costWhenOff:`Off: nothing about this camera is written to its history — no tracks, no events and no event snapshots or clips. Detection keeps running and live boxes still appear, so the camera looks busy while its timeline stays empty, and anything that fires ON an event (notification rules, event-triggered recording) has nothing to fire on. Continuous recording is unaffected, and history already written is kept.`,authority:{kind:`wrapper-binding`,capName:Ro},countsAsSwitchedOff:!0},recording:{id:`recording`,label:`Recording`,costWhenOff:`Off: nothing new is written to disk. Footage already recorded stays, but retention keeps deleting it — so this camera’s history shrinks and is not replaced. Your recording schedule is kept and resumes when you turn it back on.`,authority:{kind:`recording-config`},countsAsSwitchedOff:!0},notifications:{id:`notifications`,label:`Notifications`,costWhenOff:`Off: this camera never notifies anyone, on any rule, with no expiry. Detection, events and recording carry on exactly as before — you simply stop being told about them.`,authority:{kind:`notification-mute`},countsAsSwitchedOff:!0}};function Vo(e,t){switch(e.authority.kind){case`device-disabled`:return{available:!0,enabled:!t.deviceDisabled};case`wrapper-binding`:{let n=e.authority.capName;return t.bindableCapNames===null||t.activeWrapperCapNames===null?{available:!1,enabled:!0,unavailableReason:`source-unreachable`}:t.bindableCapNames.includes(n)?{available:!0,enabled:t.activeWrapperCapNames.includes(n)}:{available:!1,enabled:!0,unavailableReason:`no-provider`}}case`recording-config`:return t.recordingEnabled===null?{available:!1,enabled:!0,unavailableReason:`source-unreachable`}:{available:!0,enabled:t.recordingEnabled};case`notification-mute`:return t.notificationsMuted===null?{available:!1,enabled:!0,unavailableReason:`source-unreachable`}:{available:!0,enabled:!t.notificationsMuted};case`camera-audio`:{let e=t.deviceAudio;return e===null?{available:!1,enabled:!0,unavailableReason:t.deviceDisabled?`device-disabled`:`source-unreachable`}:e.supported?e.enabled===null?{available:!1,enabled:!0,unavailableReason:`source-unreachable`}:{available:!0,enabled:e.enabled}:{available:!1,enabled:!0,unavailableReason:`no-provider`}}case`camera-mask`:{let e=t.privacyMask;return e===null?{available:!1,enabled:!1,unavailableReason:t.deviceDisabled?`device-disabled`:`source-unreachable`}:e.supported?e.configuredRegions===null||e.enabled===null?{available:!1,enabled:!1,unavailableReason:`source-unreachable`}:e.configuredRegions===0?{available:!0,enabled:e.enabled,warning:`no-privacy-zones`}:{available:!0,enabled:e.enabled}:{available:!1,enabled:!1,unavailableReason:`no-provider`}}case`broker-audio-mute`:{let e=t.brokerAudio;return e===null?{available:!1,enabled:!0,unavailableReason:`source-unreachable`}:{available:!0,enabled:!e.muted}}}}function Ho(e){return ko.map(t=>{let n=Bo[t],r=Vo(n,e);return{id:n.id,label:n.label,costWhenOff:n.costWhenOff,available:r.available,...r.unavailableReason===void 0?{}:{unavailableReason:r.unavailableReason},...r.warning===void 0?{}:{warning:r.warning},enabled:r.enabled,authority:n.authority}})}function Uo(e){return e.filter(e=>Bo[e.id].countsAsSwitchedOff&&e.available&&!e.enabled).map(e=>e.id)}function Wo(e){let t=[],n=[];for(let r of ko){let i=Bo[r];if(!i.countsAsSwitchedOff)continue;let a=Vo(i,e);a.unavailableReason===`source-unreachable`?n.push(r):a.available&&!a.enabled&&t.push(r)}return{switchedOff:t,unreadable:n}}var Go=`__camstack_redacted__`;function Ko(e){return e.type===`password`?!0:`secret`in e&&e.secret===!0}function qo(e){let t=new Set;for(let n of Xo(e))for(let e of Zo(n))Qo(e,t);return t}function Jo(e){for(let t of Xo(e))if(Zo(t).length>0)return!0;return!1}function Yo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Xo(e){if(!Yo(e))return[];let t=e.sections;return Array.isArray(t)?t:[]}function Zo(e){if(!Yo(e))return[];let t=e.fields;return Array.isArray(t)?t:[]}function Qo(e,t){if(!Yo(e))return;let n=e.type,r=e.key;if((n===`password`||e.secret===!0)&&typeof r==`string`&&r.length>0&&t.add(r),n===`group`){for(let n of Zo(e))Qo(n,t);return}if(n===`sub-tabs`){let n=e.tabs;if(!Array.isArray(n))return;for(let e of n)for(let n of Zo(e))Qo(n,t)}}var $o=3e4,es=500,ts=6e4,ns=y([`confirmed`,`suppressed`,`exhausted-fallback`]),rs=u({id:c(),at:i().int(),deviceId:i().int(),sourceTrackId:c(),className:c(),verdict:ns,reason:c().nullable(),attempts:i().int(),deferredForMs:i().int(),decidedOnCoastedFrame:x(),birthEvidenceAvailable:x(),decidedByBirthEvidence:x(),bestScore:i().nullable(),appliedMinConfidence:i().nullable(),firstSeen:i().int().nullable(),motionOnsetAt:i().int().nullable(),birthLatencyMs:i().int().nullable(),birthIndexInBurst:i().int().nullable()}),is=u({deviceId:i().int().optional(),since:i().int().optional(),verdict:ns.optional(),limit:i().int().min(1).max(5e3).optional()}),as=5e3,os=200,ss=u({id:c(),note:c(),deviceId:i().int(),sourceTrackId:c(),archivedAt:i().int(),trackStartedAt:i().int().nullable(),trackClass:c().nullable(),trackLabel:c().nullable()}),cs=u({deviceId:i().int().optional(),limit:i().int().min(1).max(1e3).optional()}),ls=2e4,us=5e3,ds=500,fs=y([`same-subject`,`different-subjects`]),ps=y([`before`,`after`]),ms=y([`mixed`,`not-a-subject`]),hs=u({id:c(),deviceId:i().int(),leftTrackId:c(),rightTrackId:c(),leftSide:ps.nullable(),rightSide:ps.nullable(),relation:fs,presence:p(`continuous`).nullable(),leftStartedAt:i().int().nullable(),rightStartedAt:i().int().nullable(),createdAt:i().int(),updatedAt:i().int(),author:c().nullable()}),gs=u({id:c(),deviceId:i().int(),sourceTrackId:c(),purity:ms,switchAtMs:i().int().nullable(),startedAt:i().int().nullable(),createdAt:i().int(),updatedAt:i().int(),author:c().nullable()}),_s=u({deviceId:i().int(),trackId:c().min(1),otherTrackId:c().min(1),relation:fs,presence:p(`continuous`).optional(),trackSide:ps.optional(),otherSide:ps.optional()}),vs=u({deviceId:i().int(),trackId:c().min(1),otherTrackId:c().min(1)}),ys=u({cleared:x()}),bs=u({deviceId:i().int(),trackId:c().min(1),purity:y([`pure`,`mixed`,`not-a-subject`]),switchAtMs:i().int().optional()}),xs=u({purity:gs.nullable()}),Ss=u({deviceId:i().int(),trackId:c().optional(),since:i().int().optional(),until:i().int().optional(),limit:i().int().min(1).max(5e3).optional()}),Cs=u({relations:b(hs).readonly(),purities:b(gs).readonly(),truncated:x()}),ws=y([`unknown-track`,`cross-device`,`self-relation`,`contradiction`,`switch-outside-track`,`switch-needs-mixed`]),Ts={high:`High`,mid:`Mid`,low:`Low`};function Es(e){return Ts[e]??e.charAt(0).toUpperCase()+e.slice(1)}function Ds(e){return(e.width??0)*(e.height??0)}function Os(e){if(e.length===0)return[];let t=e.map((e,t)=>({s:e,i:t,px:Ds(e.metadata??{})})).toSorted((e,t)=>t.px-e.px),n=Array.from({length:e.length});for(let e=0;e<t.length;e++){let{s:r,i}=t[e],a;a=e===0?`high`:e===t.length-1?`low`:`mid`,n[i]={...r,quality:a}}return n}function ks(e){let t=e.height??0,n=e.width??0;return t>=1080||n>=1920?`high`:t>=480||n>=640?`mid`:`low`}function As(e){let t=e.protocols.find(e=>e.type===`rtsp`&&e.url)??e.protocols.find(e=>e.url),n=t?.type,r=n===`rtsp`?`rtsp`:n===`http`||n===`flv`?`http-mjpeg`:`custom`;return{id:e.id,label:e.label??e.id,protocol:r,url:t?.url,profileHint:e.quality}}function F(e){return typeof e==`string`}function js(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ms(e){return F(e)&&e.trim()?{url:e}:js(e)&&F(e.url)&&e.url.trim()?{url:e.url,label:F(e.label)?e.label:void 0}:null}function Ns(e){let t=F(e.snapshot_url)?e.snapshot_url:void 0;if(Array.isArray(e.streams)){let n=[];for(let t of e.streams){let e=Ms(t);e&&n.push(e)}return{streams:n,snapshot_url:t}}let n=[],r=F(e.main_stream_url)?e.main_stream_url:void 0;r&&n.push({url:r,label:F(e.main_stream_name)?e.main_stream_name:void 0});let i=F(e.sub_stream_url)?e.sub_stream_url:void 0;i&&n.push({url:i,label:F(e.sub_stream_name)?e.sub_stream_name:void 0});let a=F(e.third_stream_url)?e.third_stream_url:void 0;return a&&n.push({url:a,label:F(e.third_stream_name)?e.third_stream_name:void 0}),{streams:n,snapshot_url:t}}function Ps(e){if(e.length===0)return{};let t=Os(e),n={},r=t.find(e=>e.quality===`high`),i=t.find(e=>e.quality===`mid`),a=t.find(e=>e.quality===`low`);r&&(n.high=r.id),i&&(n.mid=i.id),a&&(n.low=a.id);let o=r??i??a??t[0];return o&&(n.high||=o.id,n.mid||=o.id,n.low||=o.id),n}var Fs={streaming:!0,notifications:!0,objectDetection:!1,remoteAccess:!0,agentCluster:!1,smartHome:!0,recordings:!0,backup:!0,repl:!0},Is={debug:0,info:1,warn:2,error:3};function Ls(e,t){return Is[e]<=Is[t]}var Rs=y([`recording`,`events`]),zs=y([`prune`,`manual-delete`,`rescan`,`retention-run`,`relocate`,`orphan-audit`]),Bs=y([`retention`,`quota`,`manual`,`operator`,`maintenance`,`orphaned-device`]),Vs=u({id:c(),at:i(),domain:Rs,op:zs,reason:Bs,deviceId:i().nullable(),nodeId:c(),itemsAffected:i(),bytesReclaimed:i(),detail:c().nullable(),actor:c()}),Hs=u({deviceId:i().optional(),limit:i().int().min(1).max(1e3).optional()}),Us=500,Ws=200,Gs=u({id:c(),name:c(),category:c().optional(),description:c().optional(),icon:c().optional()}),Ks=[`person`,`vehicle`,`animal`,`package`],qs=[`person`,`vehicle`,`animal`];function Js(e){return qs.some(t=>t===e)}var Ys=u({mapping:_(c(),y(Ks)),preserveOriginal:x()}),Xs={preMs:5e3,postMs:1e4},Zs=i().int().min(0).max(6),Qs=/^([01]\d|2[0-3]):[0-5]\d$/,$s=y([`off`,`events`,`continuous`,`on-device-decision`]),ec=y(qs),tc=e=>new Set(e).size===e.length,nc=16,rc=-30,ic=u({motion:x().optional(),audioThresholdDbfs:i().optional(),objectClasses:b(ec).min(1).refine(tc,{message:`objectClasses must not repeat a class`}).optional(),sensorDeviceIds:b(i().int().positive()).min(1).max(16).refine(tc,{message:`sensorDeviceIds must not repeat a device`}).optional()}),ac=y([`continuous`,`events`]),oc=ic,sc=y([`on`,`muted`]),cc=u({days:b(Zs),start:c().regex(Qs),end:c().regex(Qs),mode:ac,audio:sc.optional(),triggers:oc.optional(),preBufferSec:i().min(0).optional(),postBufferSec:i().min(0).optional()}),lc={postBufferSec:30};function uc(e){let t=[],n=e.bands.map((e,n)=>{if(e.preBufferSec===void 0)return e;t.push(n);let{preBufferSec:r,...i}=e;return i});return t.length===0?{config:e,strippedBands:t}:{config:{...e,bands:n},strippedBands:t}}var dc=lc.postBufferSec*1e3,fc=u({maxAgeDays:i().min(0).optional(),maxSizeGb:i().min(0).optional()}),pc=u({enabled:x(),mode:$s.optional(),profiles:b(S).optional(),segmentSeconds:i().int().positive().optional(),bands:b(cc).default([]),deviceDecision:x().optional(),retention:fc.optional()}).strict().refine(e=>e.deviceDecision!==!0||e.bands.length===0,{message:`deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands`,path:[`bands`]});function mc(e){return e.enabled?e.deviceDecision===!0?`on-device-decision`:e.bands.length===0?`off`:e.bands.some(e=>e.mode===`continuous`)?`continuous`:`events`:`off`}var hc=[`high`,`low`];function gc(e,t){if(t!==void 0&&t.length>0){let n=e.filter(e=>t.includes(e));return n.length>0?n:[...e]}let n=e.filter(e=>hc.includes(e));return n.length>0?n:[...e]}var _c=[`motion`,`audioThresholdDbfs`,`objectClasses`,`sensorDeviceIds`];function vc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function yc(e){return vc(e)&&vc(e.triggers)&&e.triggers.deviceSignal===!0}function bc(e){let t=e.triggers;return vc(t)?_c.some(e=>t[e]!==void 0):!1}function xc(e){let t=e.triggers;if(!vc(t))return e;let{deviceSignal:n,...r}=t;return{...e,triggers:r}}function Sc(e){let t={value:e,migrated:!1,strippedOnly:!1};if(!vc(e)||!Array.isArray(e.bands)||!e.bands.some(yc))return t;let n=[];for(let t of e.bands){if(!yc(t)||!vc(t)){n.push(t);continue}bc(t)&&n.push(xc(t))}if(n.length>0)return{value:{...e,bands:n},migrated:!1,strippedOnly:!0};let{mode:r,...i}=e;return{value:{...i,bands:[],deviceDecision:!0},migrated:!0,strippedOnly:!1}}var Cc=y([`queued`,`running`,`done`,`failed`,`cancelled`]),wc=u({jobId:c(),state:Cc,fromLocationId:c(),toLocationId:c(),deviceId:i().nullable(),entities:b(c()),filesMoved:i().int(),bytesMoved:i().int(),filesTotal:i().int().nullable(),rowsReconciled:i().int().nonnegative().optional(),rowsForgotten:i().int().nonnegative().optional(),startedAt:i(),finishedAt:i().nullable(),error:c().nullable()}),Tc=y([`recordings`,`recordingsLow`]),Ec=u({fromLocationId:c(),toLocationId:c(),entities:b(y([`segments`])).optional(),footageClass:Tc.optional(),deviceId:i().int().optional(),profiles:b(c()).optional(),throttleMbps:i().min(1).max(1e3).optional(),sinceMs:i().int().optional()}),I=u({leaseId:c().min(1)}),Dc=Ec.extend({leaseId:c().min(1)}),Oc=y([`move`,`seal`,`gallery`]),kc=u({toLocationId:c(),fromLocationId:c().optional(),throttleMbps:i().min(1).max(1e3).optional(),mode:Oc.optional()}),Ac=u({present:x(),rows:i().int().nonnegative().nullable()}),jc=u({media:Ac,retrainFrames:Ac,anyPresent:x(),total:i().int().nonnegative().nullable()}).nullable(),Mc=kc.extend({leaseId:c().min(1)}),Nc=y([`recordings`,`recordingsLow`,`eventMedia`,`backups`,`galleryMedia`]),Pc=u({recordings:c().min(1).optional(),recordingsLow:c().min(1).optional(),eventMedia:c().min(1).optional(),backups:c().min(1).optional(),galleryMedia:c().min(1).optional()}).refine(e=>Object.keys(e).length>0,{message:`select at least one storage class`}),Fc=u({recordings:c().min(1).optional(),recordingsLow:c().min(1).optional(),eventMedia:c().min(1).optional(),backups:c().min(1).optional(),galleryMedia:c().min(1).optional()}).optional(),Ic=y([`blocking`,`nonBlocking`]),Lc=u({destinations:Pc,sources:Fc,throttleMbps:i().min(1).max(1e3).optional(),mode:Ic.optional()}),Rc=y([`planning`,`sealing`,`pausing`,`moving`,`draining`,`verifying`,`repointing`,`refreshing`,`resuming`,`done`,`failed`,`cancelled`]),zc=y([`pipeline`,`recorder`,`analytics`]),Bc=u({filesMoved:i().int().nonnegative(),filesTotal:i().int().nonnegative().nullable(),bytesMoved:i().int().nonnegative(),rowsReconciled:i().int().nonnegative().optional(),startedAt:i(),observedAt:i()}),Vc=u({storageClass:Nc,fromLocationId:c(),toLocationId:c(),freezeSource:x().optional(),moverJobId:c().nullable(),state:Cc.nullable(),error:c().nullable(),progress:Bc.nullable()}),Hc=u({jobId:c(),phase:Rc,mode:Ic,destinations:Pc,sources:Fc,throttleMbps:i(),moves:b(Vc),pauseLeaseId:c().nullable(),pausedParticipants:b(zc),repointed:x(),cancelRequested:x(),startedAt:i(),updatedAt:i(),finishedAt:i().nullable(),error:c().nullable()}),Uc=y([`sharesDeviceWithSource`,`deviceIdentityUnknown`,`unstampedEventMediaRows`,`blockingOnly`,`noMover`]),Wc=u({code:Uc,storageClass:Nc,message:c()}),Gc=u({destinations:Pc,sources:Fc,mode:Ic,moves:b(u({storageClass:Nc,fromLocationId:c(),toLocationId:c(),freezeSource:x().optional()})),findings:b(Wc)}),Kc=y([`footage`,`media`]),qc=u({lane:Kc,job:wc,migrationJobId:c().nullable(),observedAt:i()}),Jc=u({storageClass:Nc,fromLocationId:c(),toLocationId:c(),items:i().int().nonnegative().nullable(),bytes:i().int().nonnegative().nullable()}),Yc=u({classes:b(Nc).min(1),throttleMbps:i().min(1).max(1e3).optional()}),Xc=u({fromLocationId:c().min(1),footageClass:Tc.optional()}),Zc=u({segments:i().int().nonnegative(),bytes:i().int().nonnegative()}).nullable(),Qc=u({locationId:c().min(1),apply:x().optional(),deviceId:i().int().positive().optional(),profiles:b(c().min(1)).optional()}),$c=y([`location-unknown`,`source-writable`,`no-ledger`,`archive-unreadable`,`anchor-absent`,`anchor-unreadable`,`anchor-moved`]),el=y([`live-tail`,`listing-error`,`path-mismatch`,`durable-refused`]),tl=u({"live-tail":i().int().nonnegative(),"listing-error":i().int().nonnegative(),"path-mismatch":i().int().nonnegative(),"durable-refused":i().int().nonnegative()}),nl=u({deviceId:i().int(),hoursWalked:i().int().nonnegative(),hoursMissing:i().int().nonnegative(),ghostSegments:i().int().nonnegative(),ghostBytes:i().int().nonnegative(),forgottenSegments:i().int().nonnegative(),orphanFiles:i().int().nonnegative()}),rl=u({locationId:c(),applied:x(),refused:$c.nullable(),archiveSegments:i().int().nonnegative().nullable(),archiveBytes:i().int().nonnegative().nullable(),hoursClaimed:i().int().nonnegative(),hoursWalked:i().int().nonnegative(),hoursMissing:i().int().nonnegative(),listings:i().int().nonnegative(),segmentsClaimed:i().int().nonnegative(),ghostSegments:i().int().nonnegative(),ghostBytes:i().int().nonnegative(),ghostHoursWhole:i().int().nonnegative(),forgottenSegments:i().int().nonnegative(),forgottenBytes:i().int().nonnegative(),orphanFiles:i().int().nonnegative(),orphanSample:b(c()).readonly(),hoursSkipped:i().int().nonnegative(),skippedByReason:tl,bounded:x(),byDevice:b(nl).readonly()}),il=u({rows:i().int().nonnegative()}).nullable(),al=u({toLocationId:c().min(1),fromLocationId:c().optional(),mode:Oc.optional()}),ol=y([`orphans`,`debug-media`,`ghost-ledger`,`done`,`failed`,`cancelled`]),sl=u({includeDebugMedia:x().optional()}),cl=u({jobId:c(),phase:ol,includeDebugMedia:x(),orphansReclaimed:i().int().nonnegative(),orphanBytesReclaimed:i().int().nonnegative(),debugMediaReclaimed:i().int().nonnegative(),debugMediaBytesReclaimed:i().int().nonnegative(),ghostsForgotten:i().int().nonnegative(),ghostBytesForgotten:i().int().nonnegative(),detail:c().nullable(),cancelRequested:x(),startedAt:i(),updatedAt:i(),finishedAt:i().nullable(),error:c().nullable()}),ll=u({jobId:c().optional()}),ul=[`face`,`plate`],dl=[`face`,`plate`,`clip`,`custom`],fl=[`active`,`readonly`,`drain`,`disabled`],pl=y(fl),ml=y([`normal`,`never`,`drain`]),hl=`readOnly`;function gl(e){return e===`active`}function _l(e){return e!==`disabled`}function vl(e){switch(e){case`active`:return`normal`;case`drain`:return`drain`;case`readonly`:case`disabled`:return`never`}}function yl(e){return e.mode===void 0&&(e.config.readOnly===!0||e.enabled===!1)?`readonly`:null}function bl(e){return(xl(e.mode)?e.mode:void 0)??yl(e)??`active`}function xl(e){return fl.some(t=>t===e)}function Sl(e){return gl(bl(e))}function Cl(e){return _l(bl(e))}function wl(e){return vl(bl(e))}function Tl(e){if(!(`readOnly`in e))return e;let t={...e};return delete t[hl],t}function El(e,t){return{...e,mode:t,enabled:gl(t),config:Tl(e.config)}}var Dl=c().regex(/^[a-z][a-zA-Z0-9-]*$/),L=u({id:c().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),type:c(),displayName:c().min(1),providerId:c().min(1),config:_(c(),o()),nodeId:c().optional(),isSystem:x().default(!1),enabled:x().optional(),mode:pl.optional(),capacity:u({totalBytes:i(),availableBytes:i()}).nullable().optional(),owned:u({bytes:i().int().nonnegative(),measuredAtMs:i().int().nonnegative()}).optional(),createdAt:i(),updatedAt:i()}),Ol=u({isDefault:x().optional()});function kl(e){return Sl({...e,config:e.config??{}})}var Al=1024**3;function jl(e){return Math.floor(e*Al)}var Ml=u({locationId:c(),startedAtMs:i(),startBytes:i(),bytesRemaining:i(),drained:x(),estimatedEmptyAtMs:i().nullable()}),R=d([Dl,c().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),Nl=y([`local-path`,`cap-mediated`]),Pl=`local-path`,Fl=u({id:c().regex(/^[a-z][a-zA-Z0-9-]*$/,{message:`id must start with a lowercase letter and contain only letters, digits, or hyphens`}),displayName:c().min(1,{message:`displayName must not be empty`}),description:c().optional(),cardinality:y([`single`,`multi`]),access:Nl.optional(),defaultsTo:c().optional(),defaultRoot:y([`data`,`media`,`backup`]).optional()}),Il=u({inputFps:i(),outputFps:i(),avgDecodeTimeMs:i(),droppedFrames:i(),lagMs:i().optional(),effectiveFps:i().optional(),adaptiveFps:i().optional()}),Ll=u({codec:c(),maxFps:i().default(0),outputFormat:y([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]).default(`jpeg`),scale:i().default(1),width:i().optional(),height:i().optional(),deviceId:i().int().nonnegative().optional(),tag:c().optional(),frameSink:y([`callback`,`shm`]).default(`callback`),debug:x().optional()}),Rl={offsetHours:1,startMonth:3,startWeekIndex:5,startWeekday:`Sunday`,startHour:2,endMonth:10,endWeekIndex:5,endWeekday:`Sunday`,endHour:3},zl={offsetHours:1,startMonth:3,startWeekIndex:2,startWeekday:`Sunday`,startHour:2,endMonth:11,endWeekIndex:1,endWeekday:`Sunday`,endHour:2},Bl=[{id:`UTC`,label:`UTC (UTC+0)`,region:`Universal`,stdOffsetMinutes:0,dst:null},{id:`Europe/London`,label:`Europe/London (UTC+0 / BST)`,region:`Europe`,stdOffsetMinutes:0,dst:Rl},{id:`Europe/Rome`,label:`Europe/Rome (UTC+1 / CEST)`,region:`Europe`,stdOffsetMinutes:60,dst:Rl},{id:`Europe/Paris`,label:`Europe/Paris (UTC+1 / CEST)`,region:`Europe`,stdOffsetMinutes:60,dst:Rl},{id:`Europe/Berlin`,label:`Europe/Berlin (UTC+1 / CEST)`,region:`Europe`,stdOffsetMinutes:60,dst:Rl},{id:`Europe/Madrid`,label:`Europe/Madrid (UTC+1 / CEST)`,region:`Europe`,stdOffsetMinutes:60,dst:Rl},{id:`Europe/Amsterdam`,label:`Europe/Amsterdam (UTC+1 / CEST)`,region:`Europe`,stdOffsetMinutes:60,dst:Rl},{id:`Europe/Istanbul`,label:`Europe/Istanbul (UTC+3)`,region:`Europe`,stdOffsetMinutes:180,dst:null},{id:`America/New_York`,label:`America/New York (UTC−5 / EDT)`,region:`Americas`,stdOffsetMinutes:-300,dst:zl},{id:`America/Chicago`,label:`America/Chicago (UTC−6 / CDT)`,region:`Americas`,stdOffsetMinutes:-360,dst:zl},{id:`America/Denver`,label:`America/Denver (UTC−7 / MDT)`,region:`Americas`,stdOffsetMinutes:-420,dst:zl},{id:`America/Los_Angeles`,label:`America/Los Angeles (UTC−8 / PDT)`,region:`Americas`,stdOffsetMinutes:-480,dst:zl},{id:`America/Sao_Paulo`,label:`America/Sao Paulo (UTC−3)`,region:`Americas`,stdOffsetMinutes:-180,dst:null},{id:`Asia/Dubai`,label:`Asia/Dubai (UTC+4)`,region:`Asia`,stdOffsetMinutes:240,dst:null},{id:`Asia/Kolkata`,label:`Asia/Kolkata (UTC+5:30)`,region:`Asia`,stdOffsetMinutes:330,dst:null},{id:`Asia/Singapore`,label:`Asia/Singapore (UTC+8)`,region:`Asia`,stdOffsetMinutes:480,dst:null},{id:`Asia/Shanghai`,label:`Asia/Shanghai (UTC+8)`,region:`Asia`,stdOffsetMinutes:480,dst:null},{id:`Asia/Tokyo`,label:`Asia/Tokyo (UTC+9)`,region:`Asia`,stdOffsetMinutes:540,dst:null},{id:`Australia/Sydney`,label:`Australia/Sydney (UTC+10 / AEDT)`,region:`Oceania`,stdOffsetMinutes:600,dst:{offsetHours:1,startMonth:10,startWeekIndex:1,startWeekday:`Sunday`,startHour:2,endMonth:4,endWeekIndex:1,endWeekday:`Sunday`,endHour:3}}];function Vl(e){return Bl.find(t=>t.id===e)}var Hl=y([`info`,`warn`,`error`]),Ul=u({name:c().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/,`a channel name is dotted lower-kebab, e.g. area.thing`),description:c().min(1),defaultLevel:Hl,perDevice:x()}),Wl=u({channel:c().min(1),armedUntilMs:i(),deviceIds:b(i().int()).readonly().nullable()}),Gl=class{descriptor;on=!1;devices=null;level;closesAtMs=0;constructor(e){this.descriptor=e,this.level=e.defaultLevel}get armedUntilMs(){return this.on?this.closesAtMs:0}wants(e){return this.on?this.devices===null||this.devices.has(e):!1}log(e,t,n){if(!this.on)return;let r={...n.tags,logChannel:this.descriptor.name},i={...n,tags:r};this.level===`error`?e.error(t,i):this.level===`warn`?e.warn(t,i):e.info(t,i)}arm(e){let t=e.deviceIds;this.devices=t===null||t.length===0?null:new Set(t),this.closesAtMs=e.armedUntilMs,this.on=!0}disarm(){this.on=!1,this.devices=null,this.closesAtMs=0}},Kl=class{gates=new Map;declare(e){let t=Ul.parse(e);if(this.gates.get(t.name)!==void 0)throw Error(`log channel "${t.name}" is already declared in this process — two declarations of one name is a programming error, not a merge`);let n=new Gl(t);return this.gates.set(t.name,n),n}list(){return[...this.gates.values()].map(e=>e.descriptor).sort((e,t)=>e.name.localeCompare(t.name))}gate(e){return this.gates.get(e)}apply(e,t){let n=new Map,r=[];for(let i of e)if(!(i.armedUntilMs<=t)){if(!this.gates.has(i.channel)){r.push(i.channel);continue}n.set(i.channel,i)}for(let[e,t]of this.gates){let r=n.get(e);r===void 0?t.disarm():t.arm(r)}return r}tick(e){let t=[];for(let[n,r]of this.gates)r.on&&r.armedUntilMs<=e&&(r.disarm(),t.push(n));return t}armed(){let e=[];for(let[t,n]of this.gates)n.on&&e.push({channel:t,armedUntilMs:n.armedUntilMs,deviceIds:null});return e}},ql=null;function Jl(){return ql??=new Kl,ql}function Yl(e){return Jl().declare(e)}function Xl(){ql=null}var Zl=5e3;function Ql(e,t={}){let n=Jl(),r=t.now??Date.now,i=t.tickMs??5e3,a=setInterval(()=>{let t=n.tick(r());for(let n of t)e.info(`log channel window closed`,{tags:{logChannel:n},meta:{channel:n}})},i);return a.unref?.(),{list:()=>n.list(),apply:t=>{let i=n.apply(t.windows,r()),a=n.armed();return e.info(`log channels applied`,{meta:{armed:a.map(e=>e.channel),unknown:i,declared:n.list().length}}),{armed:a.length,unknown:i}},stop:()=>{clearInterval(a)}}}var $l=16,eu=1024,tu=`other`;function nu(e,t,n){return n===void 0?`${e}${t}`:`${e}${t}${n}`}var ru=class{maxKeys;maxReasons;counters=new Map;refused=0;constructor(e=eu,t=16){this.maxKeys=e,this.maxReasons=t}get keysRefused(){return this.refused}get size(){return this.counters.size}note(e,t){if(!Number.isInteger(e.deviceId)||e.deviceId<=0)return;let n=nu(e.deviceId,e.family,e.variant),r=this.counters.get(n);if(r===void 0){if(this.counters.size>=this.maxKeys){this.refused+=1;return}r={deviceId:e.deviceId,family:e.family,variant:e.variant,sinceMs:t,attempts:0,succeeded:0,reasons:new Map},this.counters.set(n,r)}if(r.attempts+=1,e.reason===void 0){r.succeeded+=1;return}let i=r.reasons.has(e.reason)||r.reasons.size<this.maxReasons?e.reason:tu;r.reasons.set(i,(r.reasons.get(i)??0)+1)}snapshot(e){let t=[];for(let n of this.counters.values())t.push({deviceId:n.deviceId,family:n.family,...n.variant===void 0?{}:{variant:n.variant},sinceMs:n.sinceMs,atMs:e,attempts:n.attempts,succeeded:n.succeeded,reasons:[...n.reasons.entries()].map(([e,t])=>({reason:e,count:t})).toSorted((e,t)=>t.count-e.count)});return t}clear(){this.counters.clear()}};function iu(e){return e.attempts<=0?null:(e.attempts-e.succeeded)/e.attempts}var au=`__unattributed__`,ou=`__root__`;function su(e){return e.addonId===null?e.classification===`root`?{key:ou,kind:`root`}:{key:au,kind:`unattributed`}:{key:e.addonId,kind:`addon`}}function cu(e){return Math.round(e*10)/10}function lu(e,t){let n=new Map;for(let t of e){let{key:e,kind:r}=su(t),i=n.get(e)??{kind:r,main:0,gc:0,lifetime:0,memory:0,count:0,splitKnown:!0},a=t.cpuMainPercent!==null&&t.cpuGcPercent!==null;n.set(e,{kind:i.kind,main:i.main+(t.cpuMainPercent??0),gc:i.gc+(t.cpuGcPercent??0),lifetime:i.lifetime+t.cpuPercent,memory:i.memory+t.memoryRssBytes,count:i.count+1,splitKnown:i.splitKnown&&a})}return[...n.entries()].map(([e,n])=>{let r=n.splitKnown?cu(n.main):null,i=n.splitKnown?cu(n.gc):null,a=cu(n.lifetime);return{key:e,kind:n.kind,point:{atMs:t,samples:1,cpuMainPercent:r,cpuMainPercentMin:r,cpuGcPercent:i,cpuGcPercentMin:i,cpuLifetimePercent:a,cpuLifetimePercentMin:a,memoryRssBytes:n.memory,memoryRssBytesMin:n.memory,processCount:n.count,processCountMin:n.count}}})}function uu(e,t){return e===null||t===null?null:e<t?e:t}function du(e,t){return e===null||t===null?null:e>t?e:t}function fu(e,t,n){return{atMs:n,samples:e.samples+t.samples,cpuMainPercent:du(e.cpuMainPercent,t.cpuMainPercent),cpuMainPercentMin:uu(e.cpuMainPercentMin,t.cpuMainPercentMin),cpuGcPercent:du(e.cpuGcPercent,t.cpuGcPercent),cpuGcPercentMin:uu(e.cpuGcPercentMin,t.cpuGcPercentMin),cpuLifetimePercent:Math.max(e.cpuLifetimePercent,t.cpuLifetimePercent),cpuLifetimePercentMin:Math.min(e.cpuLifetimePercentMin,t.cpuLifetimePercentMin),memoryRssBytes:Math.max(e.memoryRssBytes,t.memoryRssBytes),memoryRssBytesMin:Math.min(e.memoryRssBytesMin,t.memoryRssBytesMin),processCount:Math.max(e.processCount,t.processCount),processCountMin:Math.min(e.processCountMin,t.processCountMin)}}function pu(e,t,n){if(n<=0||t<=0||e<=0)return Math.max(t,1);let r=e/n;return r<=t?t:Math.ceil(r/t)*t}function mu(e,t,n){if(t<=0||e.length===0)return e;let r=new Map;for(let i of e){let e=n+Math.floor((i.atMs-n)/t)*t,a=r.get(e);r.set(e,a===void 0?{...i,atMs:e}:fu(a,i,e))}return[...r.values()].toSorted((e,t)=>e.atMs-t.atMs)}function hu(e,t,n,r={}){if(e.length===0)return null;let i=`${n}/`,a=e=>({brokerId:e.brokerId,profileId:e.brokerId.startsWith(i)?e.brokerId.slice(i.length):e.brokerId,url:e.url,mutedUrl:e.mutedUrl,enabled:e.enabled,...e.codec===void 0?{}:{codec:e.codec},...e.resolution===void 0?{}:{resolution:e.resolution}});if(t!==`auto`){let n=e.find(e=>e.enabled&&e.url.length>0&&(e.profile===t||e.brokerId===`${i}${t}`));if(n)return a(n)}let o=e.filter(e=>e.enabled&&e.url.length>0);if(o.length===0)return null;let s=r.targetResolution;if(s){let e=o.filter(e=>e.resolution!==void 0);if(e.length>0){let t=gu(e,s);if(t)return a(t)}}return a(o[0])}function gu(e,t){let n=t.width*t.height;return[...e.flatMap(e=>e.resolution===void 0?[]:[{entry:e,pixels:e.resolution.width*e.resolution.height}])].sort((e,t)=>Na(e.pixels,t.pixels,n))[0]?.entry}var _u=1,vu=96,yu={upperHs:[0,32],upperV:[32,40],upperGrad:[40,48],lowerHs:[48,80],lowerV:[80,88],lowerGrad:[88,96]},bu=!1,xu=[`motion`,`objects`,`discarded`,`stationary`],Su=[`motion`,`objects`,`stationary`],Cu={borderWidth:2,dashed:!0,dashPattern:[6,4],opacity:1,borderRadius:2};function wu(e){return!Number.isFinite(e)||e<=0?`0 s`:e<6e4?`${String(Math.round(e/1e3))} s`:e<36e5?`${String(Math.round(e/6e4))} min`:`${String(Math.round(e/36e5))} h`}var Tu=[`onnx`,`coreml`,`openvino`,`tflite`,`pt`],Eu={yolo26:`YOLO26`,yolov9:`YOLOv9`};function Du(e){return Eu[e]??e.toUpperCase()}var Ou=/\s*@\s*\d+\s*(?:[x×]\s*\d+)?/gi;function ku(e,t){let n=Du(e),r=t.replace(RegExp(`^${n}\\s+`,`i`),``).replace(Ou,``).trim();return r.length>0?r:t}function Au(e,t){let n=[];return t===`fast`&&n.push(`Fast`),n.push(e===`int8`?`Int8`:`Standard`),n.join(` · `)}function ju(e){return Tu.filter(t=>e.formats[t]!==void 0)}function Mu(e){let t=Tu.map(t=>e.formats[t]?.sizeMB).filter(e=>typeof e==`number`);return t.length>0?Math.min(...t):0}var Nu=[`t`,`n`,`s`,`m`,`c`,`l`,`x`],Pu=[`fp32`,`int8`];function Fu(e){let t=new Map;for(let n of e){if(n.legacy===!0||n.group===void 0)continue;let{family:e,tier:r}=n.group,i=t.get(e)??new Map,a=i.get(r)??[];a.push(n),i.set(r,a),t.set(e,i)}let n=[];for(let[e,r]of t){let t=[];for(let[n,i]of r){let r=i.map(e=>{let t=e.group?.precision??`fp32`,n=e.group?.optimization??`standard`;return{modelId:e.id,precision:t,optimization:n,resolution:e.group?.resolution,label:Au(t,n),formats:ju(e),sizeMB:Mu(e)}}).toSorted((e,t)=>e.resolution===t.resolution?e.optimization===t.optimization?Pu.indexOf(e.precision)-Pu.indexOf(t.precision):e.optimization===`fast`?1:-1:(t.resolution??1/0)-(e.resolution??1/0)),a=r.find(e=>e.precision===`fp32`&&e.optimization===`standard`)??r[0];if(a===void 0)continue;let o=i.find(e=>e.id===a.modelId);t.push({tier:n,label:o?ku(e,o.name):n.toUpperCase(),baseModelId:a.modelId,options:r})}t.sort((e,t)=>{let n=Nu.indexOf(e.tier),r=Nu.indexOf(t.tier);return n!==-1&&r!==-1?n-r:n===-1?r===-1?e.tier.localeCompare(t.tier):1:-1}),n.push({family:e,label:Du(e),tiers:t})}return n.sort((e,t)=>e.family.localeCompare(t.family)),n}function Iu(e,t){let n=t.precision??`fp32`,r=t.optimization??`standard`,i=e.filter(e=>e.group!==void 0&&e.group.family===t.family&&e.group.tier===t.tier&&(e.group.precision??`fp32`)===n&&(e.group.optimization??`standard`)===r);return t.resolution===void 0?i.toSorted((e,t)=>(t.group?.resolution??1/0)-(e.group?.resolution??1/0))[0]?.id??null:i.find(e=>e.group?.resolution===t.resolution)?.id??null}function Lu(e,t){let n=e.find(e=>e.id===t);return n?.group===void 0?null:{family:n.group.family,tier:n.group.tier,precision:n.group.precision??`fp32`,optimization:n.group.optimization??`standard`,resolution:n.group.resolution}}var Ru=/^object-clip(-[a-z0-9][a-z0-9-]*)?$/,zu=u({textModelId:c().min(1),embeddingDim:i().int().positive(),vectorIndex:c().regex(Ru),tokenizerFile:c().min(1),contextLength:i().int().positive(),padId:i().int().nonnegative(),searchMinScore:i().min(0).max(1)}),Bu=[`loose`,`balanced`,`strict`],Vu=y(Bu),Hu={loose:1,balanced:1.25,strict:1.5};function Uu(e,t){if(t.minScore!==void 0)return t.minScore;let n=Hu[t.strictness??`loose`];return Math.min(1,Math.round(e.searchMinScore*n*1e3)/1e3)}var Wu=[`onnx`,`coreml`,`openvino`,`tflite`,`pt`,`gguf`],Gu=u({url:c(),sizeMB:i(),isDirectory:x().optional(),files:b(c()).readonly().optional(),runtimes:b(y([`python`])).readonly().optional()}),Ku=u({url:c(),filename:c(),sizeMB:i()}),qu=u({onnx:Gu.optional(),coreml:Gu.optional(),openvino:Gu.optional(),tflite:Gu.optional(),pt:Gu.optional(),gguf:Gu.optional()}),Ju=u({family:c(),tier:c(),precision:y([`fp32`,`int8`]).optional(),optimization:y([`standard`,`fast`]).optional(),resolution:i().int().positive().optional()}),Yu=[`camstack`,`frigate`,`scrypted`,`custom`],Xu=y(Yu);function Zu(e){if(e.provider!==void 0)return e.provider;let t=`${e.id} ${e.description??``}`;return/scrypted/i.test(t)?`scrypted`:/frigate/i.test(t)?`frigate`:`custom`}var Qu=[`camstack-hf`,`third-party`,`built-in`],$u=n(e=>typeof e==`string`?{weights:e}:e,u({weights:c().min(1),code:c().min(1).optional(),data:u({name:c().min(1),terms:c().min(1),url:c().url().optional()}).optional(),upstream:u({name:c().min(1),url:c().url()}).optional(),url:c().url().optional(),attribution:c().min(1).optional(),modifications:c().min(1).optional(),hosting:y(Qu).optional(),nonCommercial:x().optional()})),ed=u({id:c(),name:c(),description:c(),formats:qu,inputSize:u({width:i(),height:i()}),inputChannels:i().int().positive().optional(),labels:b(Gs).readonly(),inputLayout:y([`nchw`,`nhwc`]).optional(),inputNormalization:y([`zero-one`,`imagenet`,`none`,`scrfd`]).optional(),outputProbabilities:x().optional(),preprocessMode:y([`letterbox`,`resize`]).optional(),postprocessor:h().optional(),defaultConfidence:i().min(0).max(1).optional(),faceAlignment:x().optional(),extraFiles:b(Ku).readonly().optional(),legacy:x().optional(),metrics:u({map50:i().optional(),p95LatencyMs:_(c(),i()).optional()}).optional(),license:$u.optional(),group:Ju.optional(),provider:Xu.optional(),classMap:Ys.optional(),clip:zu.optional()}),td=f(`format`,[u({format:p(`openvino`),precisions:b(y([`fp16`,`int8`])).min(1).readonly()}),u({format:p(`coreml`)})]),nd=u({id:c().regex(/^[a-zA-Z0-9._-]+$/),name:c(),labels:b(Gs).readonly(),inputSize:u({width:i(),height:i()}),inputLayout:y([`nchw`,`nhwc`]).optional(),inputNormalization:y([`zero-one`,`imagenet`,`none`,`scrfd`]).optional(),preprocessMode:y([`letterbox`,`resize`]).optional(),outputFormat:y([`yolo`,`ssd`,`embedding`,`classification`,`ocr`,`segmentation`]),faceAlignment:x().optional(),classMap:Ys.optional()}),rd=u({format:y(Wu),precision:y([`fp16`,`int8`]).optional(),sizeMB:i(),validated:x(),files:b(c()).readonly()}),id=u({entry:ed,artifacts:b(rd).readonly()});function ad(e){switch(e.toUpperCase()){case`GET`:case`HEAD`:case`OPTIONS`:return`view`;case`POST`:case`PUT`:case`PATCH`:return`create`;default:return`delete`}}function od(e,t){return e.some(e=>e.type===`category`&&e.target===`device`&&e.access.includes(t))}function sd(e,t,n){return e.some(e=>e.type===`addon`&&e.target===t&&e.access.includes(n))}function cd(e){let t=e.kind;if(t===void 0)return{kind:`session`};if(t!==`sso-bridge`)return{kind:`not-a-credential`,reason:`bridge token kind=${String(t)}`};let n=e.provider;return n===`oauth-access`?{kind:`integration`,provider:`oauth-access`}:{kind:`not-a-credential`,reason:`bridge token provider=${String(n)}`}}function ld(e){let{principal:t}=e;if(t.kind===`not-a-credential`)return{allowed:!1,reason:t.reason};if(t.kind===`session`)return{allowed:!0};let n=ad(e.method);return sd(e.scopes,e.addonId,n)?{allowed:!0}:{allowed:!1,reason:`integration token holds no addon:${e.addonId}[${n}] grant`}}var ud=u({kind:p(`field`).optional(),sourceKey:c(),cap:c(),fieldPath:c()}),dd=u({kind:p(`literal`),value:d([c(),i(),x(),ie()])}),fd=u({kind:p(`global`),sourceStableId:c(),cap:c(),fieldPath:c()}),pd=d([ud,dd,fd]),md=u({expr:c().min(1).max(Hr),bindings:_(c().regex(Jr),pd)}).superRefine((e,t)=>{let n=Oi(e);n!==null&&t.addIssue({code:`custom`,message:n,path:[`expr`]})}),hd=3,gd=32,_d=y([`eq`,`ne`,`gt`,`gte`,`lt`,`lte`,`contains`,`in`]),vd=u({kind:p(`condition`),deviceId:i().int().nonnegative(),cap:c().min(1),fieldPath:c().min(1),operator:_d,value:d([c(),i(),x(),b(d([c(),i()]))])}),yd=u({kind:p(`expression`),expr:c().min(1).max(Hr),bindings:_(c().regex(Jr),pd)}).superRefine((e,t)=>{let n=Oi(e);n!==null&&t.addIssue({code:`custom`,message:n,path:[`expr`]})}),bd=me(()=>f(`kind`,[u({kind:p(`all`),children:b(bd)}),u({kind:p(`any`),children:b(bd)}),u({kind:p(`not`),child:bd}),vd,yd])),xd=f(`kind`,[u({kind:p(`device-state`),deviceId:i().int().nonnegative(),cap:c().min(1),fieldPath:c().min(1),becomes:d([c(),i(),x()]).optional(),edge:x().optional(),forMs:i().int().min(0).max(864e5).optional(),debounceMs:i().int().min(0).max(6e5).optional()}),u({kind:p(`device-event`),category:c().min(1),deviceId:i().int().nonnegative().optional()}),u({kind:p(`schedule`),cron:c().min(1).max(120)}),u({kind:p(`manual`)})]),Sd=f(`kind`,[u({kind:p(`wait`),seconds:i().min(0).max(300)}),u({kind:p(`cap`),deviceId:d([i().int(),u({$var:c().min(1)})]),cap:c().min(1),method:c().min(1),args:_(c(),o()).optional()}),u({kind:p(`code`),code:c().min(1).max(2e4)})]),Cd=u({triggers:b(xd),conditions:bd.optional(),actions:b(Sd)});function wd(e){if(e.kind===`condition`||e.kind===`expression`)return 1;if(e.kind===`not`)return 1+wd(e.child);let t=e.children;if(t.length===0)return 1;let n=0;for(let e of t){let t=wd(e);t>n&&(n=t)}return 1+n}function Td(e){if(e.kind===`condition`||e.kind===`expression`)return 1;if(e.kind===`not`)return Td(e.child);let t=0;for(let n of e.children)t+=Td(n);return t}function Ed(e){return e.kind===`condition`||e.kind===`expression`?!1:e.kind===`not`?Ed(e.child):e.children.length===0?!0:e.children.some(Ed)}function Dd(e){if(e.triggers.length===0)return`an automation needs at least one trigger — without one nothing can start a run`;if(e.actions.length===0)return`an automation needs at least one action — a rule that does nothing is not a rule`;let t=e.conditions;if(t!==void 0){if(Ed(t))return`a condition group is empty — group existing rows instead of leaving a container to fill`;let e=wd(t);if(e>3)return`conditions nest ${e} levels deep — the limit is 3. "not (any of …)" is the same as "all of (not …)", which is one level shallower`;let n=Td(t);if(n>32)return`conditions use ${n} leaves — the limit is 32`}return null}var Od=15e3;function z(e){return JSON.stringify(e)}function kd(e,t){switch(e.kind){case`all`:return`allOf([\n${e.children.map(e=>`${t} () => ${kd(e,`${t} `)}`).join(`,
4
+ `)}\n${t}])`;case`any`:return`anyOf([\n${e.children.map(e=>`${t} () => ${kd(e,`${t} `)}`).join(`,
5
+ `)}\n${t}])`;case`not`:return`notOf(() => ${kd(e.child,t)})`;case`condition`:return`leaf(${z(e.deviceId)}, ${z(e.cap)}, ${z(e.fieldPath)}, ${z(e.operator)}, ${z(e.value)})`;case`expression`:return`exprLeaf(${z(e.expr)}, ${z(e.bindings)})`}}function Ad(e,t){switch(e.kind){case`schedule`:return` // trigger ${t}: schedule — armed to the next minute boundary and
6
+ // RE-ARMED from the wall clock every tick, so it cannot drift the way a
7
+ // setInterval(24h) does. No cron library: a block cannot resolve one.
8
+ {
9
+ let timer: ReturnType<typeof setTimeout> | undefined
10
+ const arm = (): void => {
11
+ timer = setTimeout(() => {
12
+ if (cronMatches(${z(e.cron)}, new Date())) {
13
+ void run({ kind: 'schedule', at: Date.now() })
14
+ }
15
+ arm()
16
+ }, nextMinuteBoundary())
17
+ }
18
+ arm()
19
+ disposers.push(() => { if (timer !== undefined) clearTimeout(timer) })
20
+ }`;case`device-event`:return` // trigger ${t}: device event
21
+ disposers.push(
22
+ ctx.eventBus.subscribe(
23
+ { category: ${z(e.category)}${e.deviceId===void 0?``:`, deviceId: ${z(e.deviceId)}`} },
24
+ (event) => {
25
+ void run({
26
+ kind: 'device-event',
27
+ at: Date.now(),
28
+ deviceId: event.deviceId,
29
+ category: ${z(e.category)},
30
+ })
31
+ },
32
+ ),
33
+ )`;case`device-state`:{let n=e.becomes===void 0?`undefined`:z(e.becomes);return` // trigger ${t}: device state — the mirror is the authority, the
34
+ // event only WAKES the evaluation, so a dropped event delays and never loses.
35
+ {
36
+ let previous: unknown = undefined
37
+ let debounce: ReturnType<typeof setTimeout> | undefined
38
+ let heldSince: number | undefined
39
+ const check = async (): Promise<void> => {
40
+ const value = await readField(${z(e.deviceId)}, ${z(e.cap)}, ${z(e.fieldPath)})
41
+ const want = ${n}
42
+ const matches = want === undefined ? value !== previous : value === want
43
+ const changed = value !== previous
44
+ previous = value
45
+ if (!matches) { heldSince = undefined; return }
46
+ if (${e.edge===!0?`true`:`false`} && !changed) return
47
+ const forMs = ${z(e.forMs??0)}
48
+ if (forMs > 0) {
49
+ if (heldSince === undefined) { heldSince = Date.now(); return }
50
+ if (Date.now() - heldSince < forMs) return
51
+ }
52
+ heldSince = undefined
53
+ void run({
54
+ kind: 'device-state',
55
+ at: Date.now(),
56
+ deviceId: ${z(e.deviceId)},
57
+ cap: ${z(e.cap)},
58
+ field: ${z(e.fieldPath)},
59
+ to: value,
60
+ })
61
+ }
62
+ const wake = (): void => {
63
+ if (debounce !== undefined) clearTimeout(debounce)
64
+ debounce = setTimeout(() => { void check() }, ${z(e.debounceMs??0)})
65
+ }
66
+ disposers.push(
67
+ ctx.eventBus.subscribe({ category: 'device.state-changed', deviceId: ${z(e.deviceId)} }, wake),
68
+ )
69
+ const reconcile = setInterval(() => { void check() }, RECONCILE_MS)
70
+ disposers.push(() => clearInterval(reconcile))
71
+ }`}case`manual`:return` // trigger ${t}: manual — fired by automation-control.trigger
72
+ // ("Run actions"), which runs the THEN half with an EMPTY vars bag.`}}function jd(e,t){switch(e.kind){case`wait`:return` case ${t}: await sleep(${z(e.seconds*1e3)}); break`;case`cap`:return` case ${t}: {
73
+ const deviceId = ${typeof e.deviceId==`number`?z(e.deviceId):`resolveTarget(vars, ${z(e.deviceId.$var)})`}
74
+ await actuate(deviceId, ${z(e.cap)}, ${z(e.method)}, ${z(e.args??{})}, vars)
75
+ break
76
+ }`;case`code`:return` case ${t}: {
77
+ // inline code action — a fragment of THIS block, bundled by esbuild
78
+ await (async () => {
79
+ ${e.code.split(`
80
+ `).map(e=>` ${e}`).join(`
81
+ `)}
82
+ })()
83
+ break
84
+ }`}}function Md(e){let t=Dd(e.recipe);if(t!==null)throw Error(`cannot generate an automation from an invalid recipe: ${t}`);let{name:n,recipe:r}=e,i=r.conditions===void 0?`true`:`await ${kd(r.conditions,` `)}`;return`import type { AddonContext } from '@camstack/types'
85
+ import { evaluateExpressionSource, toExpressionValue } from '@camstack/types'
86
+
87
+ /**
88
+ * ${n}
89
+ *
90
+ * GENERATED FROM A RECIPE — do not edit by hand. Editing this file makes it a
91
+ * script: the visual editor reads AUTOMATION_RECIPE below, and hand edits are
92
+ * lost the next time the recipe is saved. Use "Eject to code" to take ownership
93
+ * of it permanently (one way).
94
+ */
95
+
96
+ const AUTOMATION_RECIPE = ${JSON.stringify(r,null,2)} as const
97
+
98
+ const RECONCILE_MS = ${Od}
99
+
100
+ /** A cap is named \`alarm-panel\`; \`ctx.api\` is keyed by the ROUTER name,
101
+ * \`alarmPanel\`. Indexing ctx.api with the cap name yields undefined and every
102
+ * action throws, so the conversion is not cosmetic. */
103
+ function capToRouterKey(cap: string): string {
104
+ return cap.replace(/-([a-z0-9])/g, (_m, c: string) => c.toUpperCase())
105
+ }
106
+
107
+ /** Ms until the top of the next minute. Recomputed every tick so a long-lived
108
+ * schedule cannot accumulate drift. */
109
+ function nextMinuteBoundary(): number {
110
+ const now = Date.now()
111
+ return 60_000 - (now % 60_000)
112
+ }
113
+
114
+ /** Does \`when\` satisfy a 5-field cron expression (min hour dom mon dow)?
115
+ * Supports wildcards, step syntax, ranges, comma lists and plain numbers —
116
+ * the subset an operator can author, and nothing that needs a library. */
117
+ function cronMatches(expr: string, when: Date): boolean {
118
+ const fields = expr.trim().split(/\\s+/)
119
+ if (fields.length !== 5) return false
120
+ const actual = [
121
+ when.getMinutes(),
122
+ when.getHours(),
123
+ when.getDate(),
124
+ when.getMonth() + 1,
125
+ when.getDay(),
126
+ ]
127
+ return fields.every((field, i) => matchField(field, actual[i]!))
128
+ }
129
+
130
+ function matchField(field: string, value: number): boolean {
131
+ for (const part of field.split(',')) {
132
+ const [range, stepRaw] = part.split('/')
133
+ const step = stepRaw === undefined ? 1 : Number.parseInt(stepRaw, 10)
134
+ if (!Number.isFinite(step) || step < 1) continue
135
+ if (range === '*') {
136
+ if (value % step === 0) return true
137
+ continue
138
+ }
139
+ const bounds = range!.split('-')
140
+ const lo = Number.parseInt(bounds[0]!, 10)
141
+ const hi = bounds[1] === undefined ? lo : Number.parseInt(bounds[1], 10)
142
+ if (!Number.isFinite(lo) || !Number.isFinite(hi)) continue
143
+ if (value >= lo && value <= hi && (value - lo) % step === 0) return true
144
+ }
145
+ return false
146
+ }
147
+
148
+ export default function block(ctx: AddonContext) {
149
+ const disposers: Array<() => void> = []
150
+ const sleep = (ms: number): Promise<void> => new Promise((r) => setTimeout(r, ms))
151
+
152
+ /** Read one cap field off the state mirror. Returns undefined when the device,
153
+ * the cap or the field cannot be resolved — the caller decides what that
154
+ * means, and it always logs. */
155
+ async function readField(
156
+ deviceId: number,
157
+ cap: string,
158
+ fieldPath: string,
159
+ ): Promise<unknown> {
160
+ try {
161
+ const slice = await ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap })
162
+ let cursor: unknown = slice
163
+ for (const part of fieldPath.split('.')) {
164
+ if (cursor === null || typeof cursor !== 'object') return undefined
165
+ cursor = (cursor as Record<string, unknown>)[part]
166
+ }
167
+ return cursor
168
+ } catch {
169
+ return undefined
170
+ }
171
+ }
172
+
173
+ function compare(actual: unknown, operator: string, expected: unknown): boolean {
174
+ switch (operator) {
175
+ case 'eq': return actual === expected
176
+ case 'ne': return actual !== expected
177
+ case 'gt': return typeof actual === 'number' && typeof expected === 'number' && actual > expected
178
+ case 'gte': return typeof actual === 'number' && typeof expected === 'number' && actual >= expected
179
+ case 'lt': return typeof actual === 'number' && typeof expected === 'number' && actual < expected
180
+ case 'lte': return typeof actual === 'number' && typeof expected === 'number' && actual <= expected
181
+ case 'contains': return typeof actual === 'string' && typeof expected === 'string' && actual.includes(expected)
182
+ case 'in': return Array.isArray(expected) && expected.some((v) => v === actual)
183
+ default: return false
184
+ }
185
+ }
186
+
187
+ /** A leaf whose device or cap is currently unresolvable is FALSE and logs.
188
+ * It never throws the pass away, and it never counts as true. */
189
+ async function leaf(
190
+ deviceId: number,
191
+ cap: string,
192
+ fieldPath: string,
193
+ operator: string,
194
+ expected: unknown,
195
+ ): Promise<boolean> {
196
+ const actual = await readField(deviceId, cap, fieldPath)
197
+ if (actual === undefined) {
198
+ ctx.logger.warn('condition leaf unresolvable — treated as false', {
199
+ tags: { deviceId },
200
+ cap,
201
+ fieldPath,
202
+ })
203
+ return false
204
+ }
205
+ return compare(actual, operator, expected)
206
+ }
207
+
208
+ /** The expression leaf goes through the bounded engine — parsed AST, no
209
+ * member access, no loops, hard step/node limits. Never inline JS. */
210
+ async function exprLeaf(
211
+ expr: string,
212
+ bindings: Record<string, { kind?: string; cap?: string; fieldPath?: string; value?: unknown; sourceStableId?: string }>,
213
+ ): Promise<boolean> {
214
+ const values: Record<string, string | number | boolean | null> = {}
215
+ for (const [alias, binding] of Object.entries(bindings)) {
216
+ if (binding.kind === 'literal') {
217
+ values[alias] = toExpressionValue(binding.value) ?? null
218
+ continue
219
+ }
220
+ const deviceId = await stableIdToDeviceId(binding.sourceStableId)
221
+ if (deviceId === undefined) {
222
+ ctx.logger.warn('condition leaf unresolvable — treated as false', {
223
+ tags: { deviceId: -1 },
224
+ binding: alias,
225
+ })
226
+ return false
227
+ }
228
+ const raw = await readField(deviceId, binding.cap ?? '', binding.fieldPath ?? '')
229
+ values[alias] = toExpressionValue(raw) ?? null
230
+ }
231
+ const result = evaluateExpressionSource(expr, values, Date.now())
232
+ if (!result.ok) {
233
+ ctx.logger.warn('expression leaf failed — treated as false', { expr, error: result.error })
234
+ return false
235
+ }
236
+ return result.value === true
237
+ }
238
+
239
+ async function stableIdToDeviceId(stableId: string | undefined): Promise<number | undefined> {
240
+ if (stableId === undefined) return undefined
241
+ try {
242
+ const all = await ctx.api.deviceManager.listAll.query({})
243
+ const hit = all.devices.find((d: { stableId?: string; id: number }) => d.stableId === stableId)
244
+ return hit?.id
245
+ } catch {
246
+ return undefined
247
+ }
248
+ }
249
+
250
+ async function allOf(children: Array<() => Promise<boolean>>): Promise<boolean> {
251
+ for (const c of children) { if (!(await c())) return false }
252
+ return true
253
+ }
254
+ async function anyOf(children: Array<() => Promise<boolean>>): Promise<boolean> {
255
+ for (const c of children) { if (await c()) return true }
256
+ return false
257
+ }
258
+ async function notOf(child: () => Promise<boolean>): Promise<boolean> {
259
+ return !(await child())
260
+ }
261
+
262
+ /** A {$var} action target, resolved from the run's bag BEFORE dispatch — the
263
+ * action runner only ever sees a number. */
264
+ function resolveTarget(vars: Record<string, unknown>, name: string): number {
265
+ const raw = vars[name]
266
+ if (typeof raw === 'number') return raw
267
+ throw new Error('action target var "' + name + '" is not a device id')
268
+ }
269
+
270
+ /** Substitute {{vars.x}} slots. Substitution only — never evaluation. */
271
+ function substitute(value: unknown, vars: Record<string, unknown>): unknown {
272
+ if (typeof value !== 'string') return value
273
+ return value.replace(/\\{\\{\\s*vars\\.([A-Za-z_][A-Za-z0-9_]*)\\s*\\}\\}/g, (_m, key: string) => {
274
+ const v = vars[key]
275
+ if (v === undefined) {
276
+ ctx.logger.warn('template referenced a var that was never set', { var: key })
277
+ return ''
278
+ }
279
+ return String(v)
280
+ })
281
+ }
282
+
283
+ async function actuate(
284
+ deviceId: number,
285
+ cap: string,
286
+ method: string,
287
+ args: Record<string, unknown>,
288
+ vars: Record<string, unknown>,
289
+ ): Promise<void> {
290
+ const resolved: Record<string, unknown> = {}
291
+ for (const [k, v] of Object.entries(args)) resolved[k] = substitute(v, vars)
292
+ const client: unknown = Reflect.get(ctx.api, capToRouterKey(cap))
293
+ const proc: unknown =
294
+ typeof client === 'object' && client !== null ? Reflect.get(client, method) : undefined
295
+ const mutate: unknown =
296
+ typeof proc === 'object' && proc !== null ? Reflect.get(proc, 'mutate') : undefined
297
+ if (typeof mutate !== 'function') {
298
+ throw new Error('no such device method: ' + cap + '.' + method)
299
+ }
300
+ await mutate({ ...resolved, deviceId })
301
+ }
302
+
303
+ async function evaluateConditions(): Promise<boolean> {
304
+ return ${i}
305
+ }
306
+
307
+ /** The THEN half. Stops at the first failure — continuing past a failed step
308
+ * executes an intent the operator never expressed. */
309
+ async function runActions(vars: Record<string, unknown>): Promise<void> {
310
+ for (let step = 0; step < ${r.actions.length}; step += 1) {
311
+ try {
312
+ switch (step) {
313
+ ${r.actions.map((e,t)=>jd(e,t)).join(`
314
+ `)}
315
+ }
316
+ } catch (err: unknown) {
317
+ ctx.logger.warn('action failed — stopping the sequence', {
318
+ step,
319
+ error: err instanceof Error ? err.message : String(err),
320
+ })
321
+ return
322
+ }
323
+ }
324
+ }
325
+
326
+ async function run(trigger: Record<string, unknown>): Promise<void> {
327
+ const vars: Record<string, unknown> = { ...trigger }
328
+ const passed = await evaluateConditions()
329
+ if (!passed) {
330
+ ctx.logger.debug('automation did not run — conditions were false', { trigger })
331
+ return
332
+ }
333
+ ctx.logger.info('automation running', { trigger })
334
+ await runActions(vars)
335
+ }
336
+
337
+ ${r.triggers.map((e,t)=>Ad(e,t)).join(`
338
+
339
+ `)}
340
+
341
+ return () => {
342
+ for (const dispose of disposers) dispose()
343
+ }
344
+ }
345
+ `}var Nd=u({id:c(),label:c(),icon:c(),path:c(),remoteName:c(),bundle:c(),section:c().optional(),sectionLabel:c().optional()}),Pd=u({addonId:c(),page:Nd,bundleUrl:c()}),Fd={name:`addon-pages`,scope:`system`,mode:`singleton`,methods:{listPages:w(g(),b(Pd).readonly())}},Id=u({id:c(),label:c(),icon:c(),path:c(),remoteName:c(),bundle:c(),section:c().optional(),sectionLabel:c().optional()}),Ld={name:`addon-pages-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listPages:w(g(),b(Id).readonly(),{auth:`admin`})}},Rd=u({method:y([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`]),path:c(),access:y([`public`,`authenticated`,`admin`]).optional(),description:c().optional()}),zd=u({method:c(),path:c(),params:_(c(),c()),query:_(c(),c()),body:o(),headers:_(c(),c()),user:u({id:c(),username:c(),isAdmin:x()}).optional(),scopedToken:o().optional()}),Bd=u({status:i().int(),headers:_(c(),c()),redirectUrl:c().nullable(),body:o().optional(),contentType:c().optional()}),Vd={name:`addon-routes`,scope:`system`,mode:`collection`,internal:!0,methods:{getRoutes:w(g(),b(Rd)),invoke:w(zd,Bd,{kind:`mutation`})},mount:{kind:`skip`}},Hd=u({id:c(),label:c(),icon:c(),order:i().optional()}),Ud=u({id:c(),title:c(),description:c().optional(),style:y([`card`,`accordion`]).optional(),defaultCollapsed:x().optional(),columns:d([p(1),p(2),p(3),p(4)]).optional(),tab:c().optional(),location:y([`settings`,`top-tab`]).optional(),order:i().optional(),fields:b(m())}),Wd=u({tabs:b(Hd).optional(),sections:b(Ud)}),Gd=_(c(),o()),Kd=u({success:p(!0)}),qd={name:`addon-settings`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{getGlobalSettings:w(u({addonId:c(),nodeId:c().optional(),overlay:_(c(),o()).optional(),cap:c().optional()}),Wd.nullable()),updateGlobalSettings:w(u({addonId:c(),nodeId:c().optional(),patch:Gd}),Kd,{kind:`mutation`,auth:`admin`}),getIntegrationSettings:w(u({addonId:c(),nodeId:c().optional()}),Wd.nullable()),getDeviceSettings:w(u({addonId:c(),deviceId:i(),nodeId:c().optional()}),Wd.nullable()),updateDeviceSettings:w(u({addonId:c(),deviceId:i(),nodeId:c().optional(),patch:Gd}),Kd,{kind:`mutation`,auth:`admin`})}},Jd=y([`device-tab`,`dashboard`,`integration-detail`]),Yd=y([`xs`,`sm`,`md`,`lg`,`xl`]),Xd=u({remoteName:c(),exposedModule:c(),componentKey:c().optional()}),Zd=u({tab:c(),subTab:c().optional(),label:c(),order:i().optional(),kind:p(`remote`),remote:Xd,stableId:c(),description:c().optional(),icon:c().optional(),bundle:c(),hosts:b(Jd).readonly(),requires:u({deviceContext:x().default(!1),integrationContext:x().default(!1)}),preAuth:x().optional().default(!1),defaultSize:Yd.default(`md`),allowedSizes:b(Yd).readonly().default([`sm`,`md`,`lg`]),defaultColumns:i().int().min(1).max(12).default(6),defaultRows:i().int().min(1).max(12).default(1)}),Qd={name:`addon-widgets-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listWidgets:w(g(),b(Zd).readonly(),{auth:`admin`})}},$d=Zd.extend({addonId:c(),bundleUrl:c()}),ef={name:`addon-widgets`,scope:`system`,mode:`singleton`,methods:{listWidgets:w(g(),b($d).readonly())}},tf=y([`info`,`success`,`warning`,`error`]),nf=y([`active`,`in-progress`,`completed`,`failed`,`dismissed`]),rf=u({type:c(),id:c()}),af=u({id:c(),category:c(),severity:tf,title:c(),message:c(),status:nf,progress:i().optional(),read:x(),createdAt:i(),updatedAt:i(),source:rf.optional(),metadata:_(c(),o()).optional()}),of={name:`alerts`,scope:`system`,mode:`singleton`,methods:{emit:w(af,g(),{kind:`mutation`}),update:w(u({alertId:c(),patch:af.partial()}),g(),{kind:`mutation`}),list:w(u({unreadOnly:x().optional(),limit:i().optional()}).optional(),b(af).readonly()),getUnreadCount:w(g(),i()),markRead:w(u({alertId:c()}),g(),{kind:`mutation`}),markAllRead:w(g(),g(),{kind:`mutation`}),dismiss:w(u({alertId:c()}),g(),{kind:`mutation`})}},sf={name:`audio-analysis`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[E.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:w(u({deviceId:i()}),h())},events:{onAudioLevel:Qt(u({deviceId:i(),rms:i(),dbfs:i()}))}},cf=y([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),lf=u({data:h(),format:cf,width:i(),height:i(),timestamp:i()}),uf=u({x:i(),y:i(),w:i(),h:i()}),df=u({class:c(),originalClass:c(),score:i(),bbox:uf}),ff=u({data:v(Uint8Array),sampleRate:i(),channels:i(),timestamp:i(),deviceId:i().optional()}),pf=u({rms:i(),dbfs:i()}),mf=u({className:c(),originalClass:c().optional(),score:i()}),hf=[`superseded`,`error`,`timeout`,`disposed`],gf=f(`state`,[u({state:p(`classified`)}),u({state:p(`not-classified`),reason:y(hf)})]),_f=u({level:pf,classification:u({labels:b(mf).readonly(),inferenceMs:i()}).optional(),classifyOutcome:gf,timestamp:i()}),vf=u({minConfidence:i().min(0).max(1).default(.3),allowedClasses:b(c()).default([])}),yf=u({deviceId:i(),brokerId:c(),ingestNodeId:c(),settings:vf}),bf=u({attached:x(),replaced:x()}),xf=u({detached:x()}),Sf=u({labels:b(mf).readonly(),rawLabels:b(mf).readonly().optional(),inferenceMs:i()}),Cf=[{value:`auto`,label:`Auto (platform default)`},{value:`apple-soundanalysis`,label:`Apple SoundAnalysis (macOS 12+)`},{value:`yamnet-onnx`,label:`YAMNet ONNX (cross-platform)`}],wf={audioBackend:`auto`,probedBestAudioBackend:``},Tf={name:`audio-analyzer`,scope:`system`,mode:`singleton`,methods:{analyseChunk:w(u({chunk:ff,settings:vf}),_f.nullable(),{kind:`mutation`}),classify:w(ff,Sf,{timeoutMs:3e4}),attachDevice:w(yf,bf,{kind:`mutation`}),detachDevice:w(u({deviceId:i()}),xf,{kind:`mutation`}),isReady:w(g(),x()),dispose:w(g(),g(),{kind:`mutation`}),reprobeAudioEngine:w(g(),u({backend:c()}),{kind:`mutation`,auth:`admin`})}},Ef=y([`f32le`,`s16le`]),Df=u({codec:c(),canDecode:x(),canEncode:x(),label:c().optional()}),Of=u({codec:c(),sourceSampleRate:i().int().positive(),sourceChannels:i().int().positive(),extraData:v(Uint8Array).optional(),targetSampleRate:i().int().positive(),targetChannels:i().int().positive(),targetFormat:Ef.optional(),idleMs:i().int().positive().optional(),tag:c().optional()}),kf=u({codec:c(),sourceSampleRate:i().int().positive(),sourceChannels:i().int().positive(),sourceFormat:Ef.optional(),targetSampleRate:i().int().positive(),targetChannels:i().int().positive(),bitrateKbps:i().int().positive().optional(),idleMs:i().int().positive().optional(),tag:c().optional()}),Af=u({data:v(Uint8Array),sampleRate:i().int().positive(),channels:i().int().positive(),format:Ef,pts:i()}),jf=u({data:v(Uint8Array),codec:c(),pts:i(),frameComplete:x()}),Mf=u({sessionId:c(),kind:y([`decode`,`encode`]),codec:c(),sourceSampleRate:i(),sourceChannels:i(),targetSampleRate:i(),targetChannels:i(),format:Ef,tag:c().optional(),createdAtMs:i(),lastActivityMs:i(),framesIn:i(),framesOut:i()}),Nf={name:`audio-codec`,scope:`system`,mode:`singleton`,preferredProvider:`decoder-nodeav`,methods:{listSupportedCodecs:w(g(),b(Df).readonly()),canHandle:w(u({codec:c(),kind:y([`decode`,`encode`])}),x()),createDecodeSession:w(Of,u({sessionId:c(),nodeId:c()}),{kind:`mutation`}),createEncodeSession:w(kf,u({sessionId:c(),nodeId:c()}),{kind:`mutation`}),closeSession:w(u({sessionId:c(),nodeId:c().optional()}),g(),{kind:`mutation`}),pushEncodedFrame:w(u({sessionId:c(),nodeId:c().optional(),data:v(Uint8Array),pts:i().optional()}),g(),{kind:`mutation`}),pullPcm:w(u({sessionId:c(),nodeId:c().optional(),maxCount:i().int().positive().default(8)}),b(Af)),pushPcm:w(u({sessionId:c(),nodeId:c().optional(),data:v(Uint8Array),pts:i().optional()}),g(),{kind:`mutation`}),pullEncoded:w(u({sessionId:c(),nodeId:c().optional(),maxCount:i().int().positive().default(8)}),b(jf)),flushEncode:w(u({sessionId:c(),nodeId:c().optional()}),b(jf),{kind:`mutation`}),listActiveSessions:w(g(),b(Mf).readonly())}},Pf=u({userId:c(),username:c(),email:c().optional(),displayName:c().optional(),isAdmin:x().default(!1)}),Ff={name:`auth-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{validateCredentials:w(u({username:c(),password:c()}),Pf.nullable(),{kind:`mutation`}),getLoginUrl:w(u({state:c()}),c()),handleCallback:w(_(c(),c()),Pf,{kind:`mutation`}),validateToken:w(u({token:c()}),Pf.nullable())},mount:{kind:`skip`}},If=`.backup-snapshot`,Lf=`.backup-snapshot-partial`,Rf=30*6e4,zf=u({databases:b(u({livePath:c()}))}),Bf=u({name:c(),rows:i().int().nonnegative()}),Vf=u({livePath:c(),snapshotPath:c(),sizeBytes:i().int().nonnegative(),pageCount:i().int().nonnegative(),pageSize:i().int().positive(),tables:b(Bf),copyMs:i().nonnegative(),verifyMs:i().nonnegative(),takenAt:i()}),Hf=Vf.extend({livePath:c(),snapshotPath:c()}),Uf={name:`database-snapshot`,scope:`system`,mode:`singleton`,internal:!0,methods:{listDatabases:w(u({}),zf,{auth:`admin`}),writeSnapshot:w(u({}),Vf,{kind:`mutation`,auth:`admin`,timeoutMs:Rf})}},Wf=u({subId:c(),displayName:c(),description:c().optional(),kind:c(),triggerSupported:x(),restoreSupported:x()}).extend({id:c(),addonId:c(),enabled:x(),retentionCount:i(),label:c().optional(),lastSuccessAt:i().optional(),lastSuccessSizeBytes:i().optional(),cron:c().optional(),nextRunAt:i().optional(),lastAttemptAt:i().optional(),lastError:c().optional()}),Gf=u({id:c(),filename:c(),createdAt:i(),sizeBytes:i(),label:c().optional(),locations:b(c()).readonly()}),Kf=u({id:c(),destinationId:c().optional(),label:c().optional(),createdAt:i(),sizeBytes:i(),locations:b(c()).optional()}),qf=u({path:c(),kind:y([`file`,`dir`,`symlink`]),sizeBytes:i(),mtime:i()}),Jf=u({archiveVersion:p(1),createdAt:i(),dataDir:c(),locations:b(c()),entries:b(qf),totalBytes:i(),totalFiles:i(),sqliteSnapshots:b(Hf).optional()}),Yf=u({name:c(),sizeBytes:i(),fileCount:i(),present:x()}),Xf=y([`queued`,`running`,`succeeded`,`failed`,`cancelled`]),Zf=y([`queued`,`building`,`uploading`,`done`]),Qf=u({id:c(),state:Xf,phase:Zf,destinationIds:b(c()).readonly(),label:c().optional(),requestedAt:i(),startedAt:i().optional(),finishedAt:i().optional(),stagedBytes:i(),archiveSizeBytes:i().optional(),uploadedBytes:i(),completedDestinationIds:b(c()).readonly(),failedDestinationIds:b(c()).readonly(),error:c().optional(),queuePosition:i().int().min(1).optional()}),$f=u({runId:c(),queued:x(),joined:x(),cancelled:x(),entries:b(Kf).readonly()}),ep=u({id:c(),label:c(),cron:c(),enabled:x(),locationIds:b(c()).readonly(),retentionCount:i().int().min(1).max(1e3),dataSources:b(c()).readonly().optional(),lastAttemptAt:i().optional(),lastSuccessAt:i().optional(),lastError:c().optional(),nextRunAt:i().optional()}),tp={name:`backup`,scope:`system`,mode:`singleton`,methods:{listDestinations:w(g(),b(Wf).readonly(),{auth:`admin`}),trigger:w(u({destinations:b(c()).optional(),locations:b(c()).optional(),label:c().optional(),retentionCount:i().int().min(1).max(1e3).optional()}).optional(),$f,{kind:`mutation`,auth:`admin`}),listRuns:w(g(),b(Qf).readonly(),{auth:`admin`}),cancel:w(u({runId:c()}),u({cancelled:x()}),{kind:`mutation`,auth:`admin`}),list:w(g(),b(Kf).readonly(),{auth:`admin`}),listLocations:w(g(),b(Yf).readonly(),{auth:`admin`}),getEntries:w(u({destinationId:c(),backupId:c()}),Jf.nullable(),{auth:`admin`}),restore:w(u({destinationId:c(),backupId:c(),locations:b(c()).optional()}),g(),{kind:`mutation`,auth:`admin`}),delete:w(u({destinationId:c(),backupId:c()}),g(),{kind:`mutation`,auth:`admin`}),listArchives:w(u({destinationId:c()}),b(Gf).readonly(),{auth:`admin`}),upsertDestinationPolicy:w(u({locationId:c(),enabled:x(),retentionCount:i().int().min(1).max(1e3),label:c().optional()}),g(),{kind:`mutation`,auth:`admin`}),previewSchedule:w(u({cron:c(),count:i().int().min(1).max(20).optional()}),u({ok:x(),error:c().optional(),nextRuns:b(i()).readonly()})),listSchedules:w(g(),b(ep).readonly(),{auth:`admin`}),upsertSchedule:w(u({id:c().optional(),label:c(),cron:c(),enabled:x(),locationIds:b(c()).readonly(),retentionCount:i().int().min(1).max(1e3),dataSources:b(c()).readonly().optional()}),ep,{kind:`mutation`,auth:`admin`}),deleteSchedule:w(u({id:c()}),g(),{kind:`mutation`,auth:`admin`})}},np=y([`connected`,`disconnected`,`connecting`,`auth-failed`,`unreachable`,`error`]),rp=u({id:c(),addonId:c(),name:c(),kind:c(),status:np,info:_(c(),o()),lastCheckedAt:i().nullable(),error:c().nullable()}),ip=u({brokerCount:i().int().nonnegative(),connectedCount:i().int().nonnegative()}),ap=u({addonId:c(),kinds:b(u({kind:c(),label:c()}))}),op=u({kind:c().optional()}),sp=u({id:c()}),cp=u({kind:c().min(1),name:c().min(1),id:c().min(1).optional(),settings:_(c(),o())}),lp=u({id:c()}),up=u({id:c()}),dp=f(`ok`,[u({ok:p(!0),latencyMs:i().nonnegative()}),u({ok:p(!1),error:c()})]),fp=_(c(),o()),pp=u({kind:c()}),mp=u({kind:c(),settings:fp}),hp=f(`ok`,[u({ok:p(!0),latencyMs:i().nonnegative().optional()}).strict(),u({ok:p(!1),error:c()})]),gp=o().nullable(),_p=u({brokerId:c(),target:_(c(),o()),payload:o().optional()}),vp=u({brokerId:c(),filter:_(c(),o())}),yp=u({subscriptionId:c()}),bp=u({brokerId:c(),subscriptionId:c()}),xp=u({brokerId:c(),key:c()}),Sp={name:`broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:ip,kind:`poll`},methods:{list:w(op,b(rp)),get:w(sp,rp.nullable()),listProviders:w(g(),b(ap),{auth:`admin`}),add:w(cp,lp,{kind:`mutation`,auth:`admin`}),remove:w(up,g(),{kind:`mutation`,auth:`admin`}),testConnection:w(sp,dp,{kind:`mutation`,auth:`admin`}),getSettings:w(sp,fp.nullable(),{auth:`admin`}),setSettings:w(u({id:c(),settings:fp}),g(),{kind:`mutation`,auth:`admin`}),getBrokerConfig:w(sp,fp.nullable(),{auth:`admin`}),getSettingsSchema:w(pp,gp,{auth:`admin`}),testSettings:w(mp,hp,{kind:`mutation`,auth:`admin`}),publish:w(_p,o(),{kind:`mutation`,auth:`admin`}),subscribe:w(vp,yp,{kind:`mutation`,auth:`admin`}),unsubscribe:w(bp,g(),{kind:`mutation`,auth:`admin`}),getState:w(xp,o().nullable(),{auth:`admin`}),getStatus:w(g(),ip)}},Cp={name:`camera-pipeline-config`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[E.Camera],exposesDeviceSettings:!0,methods:{}},wp=y([`webrtc`,`hls`,`mjpeg`,`rtsp`]),Tp=y([`mp4`,`gif`]),Ep=u({kind:Tp,handle:c(),nodeId:c(),mime:c(),bytes:i().int(),width:i().int(),height:i().int()}),Dp=u({fromTs:i(),toTs:i(),packets:i().int()}),Op=u({media:b(Ep).readonly(),coverage:Dp,profile:S,video:y([`copy`,`encode`])}),kp=u({brokerId:c(),url:c(),mutedUrl:c(),enabled:x(),codec:c().optional(),resolution:u({width:i().int().positive(),height:i().int().positive()}).optional()}),Ap=u({sessionId:c(),remoteAddr:c(),userAgent:c().nullish(),playing:x(),muted:x(),connectedAt:i(),lastRtpAt:i(),bytesSent:i()}),jp=u({tag:c(),subscribedAt:i(),maxFps:i(),framesDelivered:i(),framesDropped:i()}),Mp=u({tag:c(),subscribedAt:i(),chunksDelivered:i()}),Np=y([`alexa`,`homekit`,`webrtc-browser`,`webrtc-mobile`,`webrtc-whep`,`rtsp-listen`,`derived-broker`,`recording`,`pipeline`,`snapshot`,`warmup`,`unknown`]),Pp=u({kind:Np,label:c().optional(),media:y([`audio`,`video`,`both`]).optional(),targetCodec:c().optional(),transport:y([`passthrough`,`repacketize`,`transcode`]).optional(),remoteAddr:c().optional(),userAgent:c().optional(),userId:c().optional(),sessionId:c().optional(),extra:_(c(),c()).optional()}).readonly(),Fp=u({id:c(),channel:y([`annexb`,`rtp`]),attribution:Pp,subscribedAt:i(),packetsDelivered:i()}),Ip=u({rtsp:b(Ap).readonly(),decoded:b(jp).readonly(),audio:b(Mp).readonly(),encoded:b(Fp).readonly(),pipeClients:i(),encodedSubscribers:i()}),Lp=y([`reconnecting`,`sleeping`,`offline`,`disabled`,`waking`]),Rp=y([`h264`,`h265`,`copy`]),zp=y([`aac`,`opus`,`pcmu`,`copy`,`none`]),Bp=u({deviceId:i().int().nonnegative(),video:Rp,audio:zp.optional(),profile:S.optional(),targetResolution:u({width:i().int().positive(),height:i().int().positive()}).optional(),outputArgs:b(c()).optional(),audioEgress:x().optional(),hostname:c().optional(),tag:c().optional()}),Vp=u({url:c(),sentryUrl:c().nullable().optional(),videoCodec:y([`H264`,`H265`]),audioCodec:c(),resolution:u({width:i().int().positive(),height:i().int().positive()}),transcoded:x(),encoder:c(),pipelineKey:c()}),Hp=ja.omit({inputArgs:!0,outputArgs:!0}),Up=y([`tight`,`relaxed`]),Wp=u({deviceId:i().int().nonnegative(),source:f(`kind`,[u({kind:p(`profile`),profile:S}),u({kind:p(`cam-stream`),camStreamId:c().min(1)})]),encode:Hp,rateControl:Up.optional(),bitstreamFilter:y([`dump_extra`,`h264_mp4toannexb`,`hevc_mp4toannexb`]).optional(),publishLocally:x().optional(),pixelFormat:y([`yuv420p`,`nv12`]).optional(),decodeHwAccel:y([`auto`,`none`,`videotoolbox`,`vaapi`,`qsv`,`cuda`]).optional(),hostname:c().optional(),tag:c().optional()}),Gp=u({url:c(),pipelineKey:c(),videoCodec:y([`H264`,`H265`]),resolution:u({width:i().int().positive(),height:i().int().positive()}),transcoded:x(),encoder:c(),decodeHwAccel:c().nullable(),camStreamId:c().nullable()}),Kp={name:`stream-broker`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{reportStreamSignal:w(u({deviceId:i().int().nonnegative(),code:c().min(1),at:i().optional()}),u({accepted:x(),reason:y([`woke`,`hold-extended`,`not-enabled`,`no-consumer`,`unknown-code`])}),{kind:`mutation`}),publishCameraStream:w(u({deviceId:i().int().nonnegative(),camStreamId:c().min(1),kind:st,url:c().optional(),codec:c().optional(),resolution:ct.optional(),fps:i().positive().optional(),label:c().optional(),deviceFeatures:b(c()).optional(),autoEligible:x().optional(),profileHint:S.optional(),metadata:_(c(),o()).optional(),sourceCamStreamId:c().min(1).optional(),encodeProfile:ja.optional()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),retractCameraStream:w(u({deviceId:i().int().nonnegative(),camStreamId:c().min(1)}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),assignProfile:w(u({deviceId:i().int().nonnegative(),profile:S,camStreamId:c().min(1)}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),unassignProfile:w(u({deviceId:i().int().nonnegative(),profile:S}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),forgetDeviceHardware:w(u({deviceId:i().int().nonnegative()}),u({derivedStreamsDeleted:b(c()).readonly(),assignmentsPurged:x(),probeSnapshotsDropped:i().int().nonnegative(),rtspTokenRowsDeleted:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),renderPreBufferClip:w(u({deviceId:i(),profile:S.optional(),aroundMs:i(),preRollSec:i().min(0).max(20).default(3),postRollSec:i().min(0).max(20).default(5),format:y([`gif`,`mp4`]).default(`gif`),maxWidth:i().int().min(120).max(1920).default(480),fps:i().int().min(1).max(15).default(5),speed:i().min(1).max(8).default(2)}),u({base64:c(),mime:c(),bytes:i().int(),profile:S,durationMs:i()}),{kind:`mutation`,auth:`admin`}),produceEventMedia:w(u({deviceId:i(),profile:S.optional(),aroundMs:i(),preSeconds:i().min(0).max(20).default(4),postSeconds:i().min(0).max(20).default(6),kinds:b(Tp).min(1).default([`mp4`]),gifMaxWidth:i().int().min(120).max(1280).default(640),gifFps:i().int().min(1).max(15).default(12),gifSpeed:i().min(1).max(8).default(4),speed:i().min(1).max(8).default(4)}),Op,{kind:`mutation`,auth:`admin`}),fetchEventMedia:w(u({handle:c()}),u({base64:c(),mime:c(),bytes:i().int()}).nullable(),{kind:`mutation`,auth:`admin`}),listAllCameraStreams:w(g(),b(lt).readonly()),listAllProfileSlots:w(g(),b(dt).readonly()),getBrokerStats:w(u({brokerId:c()}),Ot),probeStream:w(u({brokerId:c()}),u({probed:x(),summary:c()}),{kind:`mutation`,auth:`admin`}),listClients:w(u({brokerId:c()}),Ip),killClient:w(u({brokerId:c(),channel:y([`rtsp`,`decoded`,`audio`]),handle:c()}),u({killed:x()}),{kind:`mutation`,auth:`admin`}),restartProfile:w(u({deviceId:i().int().nonnegative(),profile:S}),u({success:x()}),{kind:`mutation`,auth:`admin`}),getStreamUrl:w(u({streamId:c(),format:wp}),u({url:c()})),getStreamWithCodec:w(Bp,Vp,{kind:`mutation`,auth:`admin`}),releaseStreamWithCodec:w(u({pipelineKey:c()}),u({released:x(),refcount:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),acquireEgressTranscode:w(Wp,Gp,{kind:`mutation`,auth:`admin`}),releaseEgressTranscode:w(u({pipelineKey:c()}),u({released:x(),refcount:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),subscribeAudioChunks:w(Tt,Et,{kind:`mutation`}),pullAudioChunks:w(u({subscriptionId:c(),maxCount:i().int().positive().default(8)}),b(wt).readonly()),unsubscribeAudioChunks:w(u({subscriptionId:c()}),u({released:x()}),{kind:`mutation`}),subscribeFrames:w(xt,St,{kind:`mutation`}),pullFrameHandles:w(u({subscriptionId:c(),maxCount:i().int().positive().default(4)}),b(C).readonly()),unsubscribeFrames:w(u({subscriptionId:c()}),u({released:x()}),{kind:`mutation`}),setPreBufferDuration:w(u({brokerId:c(),seconds:i().min(0).max(30)}),g(),{kind:`mutation`,auth:`admin`}),getPreBufferInfo:w(u({brokerId:c()}),u({configuredSec:i(),bufferedMs:i(),packetCount:i()})),getRtspPort:w(g(),i()),getAllRtspEntries:w(u({hostname:c().optional()}),b(kp).readonly()),getRtspEntry:w(u({brokerId:c(),hostname:c().optional()}),kp.nullable()),regenerateRtspToken:w(u({brokerId:c()}),c().nullable(),{kind:`mutation`,auth:`admin`}),setRtspEnabled:w(u({brokerId:c(),enabled:x()}),g(),{kind:`mutation`,auth:`admin`}),isRtspEnabled:w(u({brokerId:c()}),x()),getDeviceAudioMute:w(u({deviceId:i().int()}),u({muted:x(),appliedBrokers:i().int().nonnegative()})),setDeviceAudioMute:w(u({deviceId:i().int(),muted:x()}),u({muted:x(),appliedBrokers:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`})},events:{onCamStreamDemand:Qt(u({deviceId:i().int().nonnegative(),camStreamId:c(),profile:S})),onCamStreamIdle:Qt(u({deviceId:i().int().nonnegative(),camStreamId:c()})),onRequestStreamSourceRefresh:Qt(u({deviceId:i().int().nonnegative(),camStreamId:c(),brokerId:c()}))}},qp=y([`h264`,`h265`,`hevc`,`av1`,`mjpeg`,`vp8`,`vp9`]),Jp=u({acceptCodecs:b(qp).readonly().optional(),minHeight:i().int().positive().optional(),maxHeight:i().int().positive().optional(),minWidth:i().int().positive().optional(),excludeDerived:x().optional(),requireSiblingCodec:b(qp).readonly().optional(),allowTranscode:x().optional(),requireProfileBound:x().optional()}).readonly(),Yp=u({preferredProviders:b(c()).readonly().optional(),resolutionPreference:y([`highest`,`lowest`]).optional(),targetHeight:i().int().positive().optional()}).readonly(),Xp=u({camStreamId:c(),codec:c().optional(),resolution:ct.optional(),transcodes:x(),reason:c(),profile:S.optional(),brokerId:c().optional(),url:c().optional(),fps:i().positive().optional(),fpsSource:y([`published`,`measured`]).optional()}),Zp={name:`camera-streams`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[E.Camera],methods:{getCameraStreams:w(u({deviceId:i().int().nonnegative()}),b(lt).readonly()),getBrokerStreams:w(u({deviceId:i().int().nonnegative()}),b(dt).readonly()),getRtspEntries:w(u({deviceId:i().int().nonnegative(),hostname:c().optional()}),b(kp).readonly()),getProfileRtspEntries:w(u({deviceId:i().int().nonnegative(),hostname:c().optional()}),b(kt).readonly()),pickStream:w(u({deviceId:i().int().nonnegative(),requirements:Jp,preferences:Yp.optional()}),Xp.nullable())},events:{onCamStreamsChanged:Qt(u({deviceId:i().int().nonnegative(),camStreams:b(lt).readonly()})),onProfileSlotsChanged:Qt(u({deviceId:i().int().nonnegative(),profileSlots:b(dt).readonly()}))},runtimeState:u({online:x(),slotStatuses:u({high:ut.optional(),mid:ut.optional(),low:ut.optional()}),slotErrors:u({high:c().optional(),mid:c().optional(),low:c().optional()}),lastChangedAt:i()}),durability:`session`};function Qp(e){let t=Ut(e).kind;return t===`collection`?!0:t===`skip`&&e.mode===`collection`}function $p(e){let t=e._def;return e.constructor?.name===`ZodVoid`||t?.type===`void`||t?.typeName===`ZodVoid`}function em(e){let t=e._def;return e.constructor?.name===`ZodObject`||t?.type===`object`||t?.typeName===`ZodObject`}function tm(e){let t=e;for(let e=0;e<8&&t!=null;e+=1){let e=t._def,n=t.constructor?.name;if(n===`ZodArray`||e?.type===`array`)return!0;if(!(n===`ZodReadonly`||e?.type===`readonly`||n===`ZodOptional`||e?.type===`optional`||n===`ZodNullable`||e?.type===`nullable`||n===`ZodDefault`||e?.type==="default")||e?.innerType==null)return!1;t=e.innerType}return!1}function nm(e,t){if(e===void 0||e.mode!==`collection`)return!1;let n=Yt(e)[t];return n!==void 0&&n.kind!==`subscription`&&tm(n.output)}function rm(e){let t=e.loose;return typeof t==`function`?t.call(e):e}function im(e){if(!(typeof e!=`object`||!e)){for(let t of Object.values(e))if(typeof t==`object`&&t){let e=t.addonId;if(typeof e==`string`)return e}}}function am(e){if(e===null||typeof e!=`object`&&typeof e!=`function`)return!1;let t=e.shape??sm(e._def?.shape);return typeof t==`object`&&!!t&&Object.prototype.hasOwnProperty.call(t,`addonId`)}function om(e){if(e===null||typeof e!=`object`&&typeof e!=`function`)return!1;let t=e.shape??sm(e._def?.shape);if(typeof t!=`object`||!t)return!1;let n=t.deviceId;if(n==null)return!1;let r=n._def;return n.constructor?.name===`ZodNumber`||r?.type===`number`||r?.typeName===`ZodNumber`}function sm(e){return typeof e==`function`?e():e}function cm(e,t){return t.auth===void 0?e.internal===!0?`admin`:`protected`:t.auth}function lm(e){return e===`public`?`public`:e===`admin`||e===`superAdmin`?`admin`:`protected`}function um(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function dm(e){let t=e;for(;t instanceof de||t instanceof pe||t instanceof ee;)t=t.unwrap();return t}function fm(e){let t=dm(e);return t instanceof le?{kind:`enum`,enumValues:t.options}:t instanceof te?{kind:`number`}:t instanceof ne?{kind:`string`}:t instanceof ae?{kind:`boolean`}:null}function pm(e,t=``){let n=dm(e);if(!(n instanceof se))return[];let r=[],i=n.shape;for(let[e,n]of Object.entries(i)){let i=t?`${t}.${e}`:e,a=dm(n);if(a instanceof se){r.push(...pm(a,i));continue}let o=fm(n);o&&r.push({path:i,kind:o.kind,...o.enumValues?{enumValues:o.enumValues}:{}})}return r}function mm(e){return pm(e.itemSchema).filter(t=>t.path!==e.keyField).map(e=>({...e,item:!0}))}function hm(e,t){let n=e;for(let e of t.split(`.`)){let t=dm(n);if(!(t instanceof se))return null;let r=t.shape[e];if(!(r instanceof re))return null;n=r}return n}function gm(e,t){let n=pm(e).find(e=>e.path===t);if(n===void 0)return null;let r=hm(e,t);return r===null?null:{path:t,kind:n.kind,nullable:r.safeParse(null).success,required:!r.safeParse(void 0).success,...n.enumValues===void 0?{}:{enumValues:n.enumValues}}}function _m(e){return new Map(pm(e).filter(e=>!e.path.includes(`.`)).flatMap(t=>{let n=gm(e,t.path);return n===null?[]:[[t.path,n]]}))}function vm(e){let t=dm(e);return t instanceof se?Object.entries(t.shape).flatMap(([e,t])=>t instanceof re&&!t.safeParse(void 0).success?[e]:[]):[]}function ym(e,t){let n=t.split(`.`);return n.slice(0,-1).flatMap((t,r)=>{let i=n.slice(0,r+1).join(`.`),a=hm(e,i);return a!==null&&a.safeParse(void 0).success?[i]:[]})}var bm={"doorbell.onPressed":ge.DoorbellOnPressed},xm=bm,Sm=u({featureIndex:i().int().nonnegative(),cap:c(),eventName:c(),category:y(ge),stateField:c(),fieldKey:c()});function Cm(e,t,n){return{code:e,path:t,message:n}}function wm(e){return e.issues.map(e=>`${e.path.length===0?`payload`:e.path.join(`.`)}: ${e.message}`).join(`; `)}function Tm(e,t,n){if(t.mode===`replace`)return{problems:[],events:[]};let r=[],i=[];for(let[a,o]of Object.entries(e.events??{})){let s=o.fromState;if(s===void 0)continue;let c=`features[${t.featureIndex}].fields.${s.field}`,l=e.runtimeState?gm(e.runtimeState,s.field):null;if(l===null){r.push(Cm(`unknown-field`,c,`\`${e.name}.${a}\` derives from missing state field \`${s.field}\``));continue}if(l.kind!==`number`){r.push(Cm(`kind-mismatch`,c,`\`${e.name}.${a}\` needs a numeric state field; \`${s.field}\` is ${l.kind}`));continue}let u=`${e.name}.${a}`,d=xm[u];if(d===void 0){r.push(Cm(`not-composable`,`features[${t.featureIndex}].cap`,`\`${u}\` has no explicit composition event-category mapping`));continue}let f=o.data.safeParse({deviceId:1,timestamp:1});if(!f.success){r.push(Cm(`not-composable`,`features[${t.featureIndex}].cap`,`\`${u}\` cannot be derived from { deviceId, timestamp }: ${wm(f.error)}`));continue}let p=n.find(n=>n.featureIndex===t.featureIndex&&n.cap===e.name&&n.path===s.field&&n.item===void 0);if(p===void 0){r.push(Cm(`unknown-field`,c,`\`${u}\` derives from \`${s.field}\`, but that field is not composed`));continue}i.push({featureIndex:t.featureIndex,cap:e.name,eventName:a,category:d,stateField:s.field,fieldKey:`${p.cap}.${p.path}`})}return{problems:r,events:i}}var Em=y([`reserved-variant`,`unknown-capability`,`not-composable`,`wrong-device-type`,`has-commands`,`unknown-field`,`nested-field`,`missing-field`,`kind-mismatch`,`may-be-null`,`source-missing`,`source-unreadable`,`source-capability-missing`,`source-field-unknown`,`expression-invalid`,`cycle`,`duplicate-target`,`not-item-array`,`item-field-reserved`,`target-missing`,`target-unreadable`,`not-replaceable`]),Dm=u({code:Em,path:c(),message:c()}),Om=y([`string`,`number`,`boolean`,`enum`]),km=y([`null`,`offline`,`unknown`,`release`]),Am=y([`derived`,`clock`,`constant`,`accumulator`]),jm=u({arrayPath:c(),key:c(),label:c()}),Mm=u({cap:c(),path:c(),item:jm.optional(),featureIndex:i().int().nonnegative(),kind:Om,nullable:x(),required:x(),unavailable:km,role:Am,source:Ui,reads:b(Li)});function Nm(e){let t=e.item===void 0?e.path:la(e.item.arrayPath,e.item.key,e.path);return`${e.cap}.${t}`}var Pm=y([`new`,`add`,`replace`]),Fm=u({featureIndex:i().int().nonnegative(),cap:c(),mode:Pm}),Im=u({ok:x(),problems:b(Dm),fields:b(Mm),features:b(Fm),events:b(Sm)}),Lm=y([`stopped`,`starting`,`running`,`degraded`,`failed`]),Rm=y([`fresh`,`stale`,`unavailable`]),zm=u({cap:c(),path:c(),item:jm.optional(),state:Rm,value:d([c(),i(),x(),ie()]),reason:c().optional()}),Bm=u({blockId:c(),deviceId:i().nullable(),status:Lm,reason:c().optional(),fields:b(zm)}),Vm=Ai,Hm=u({id:c().min(1),name:c().min(1).max(120),enabled:x(),updatedAt:i(),composition:ra}),Um=u({id:c().min(1),name:c().nullable(),error:c()}),Wm=u({integrationId:c().nullable(),storeLoaded:x(),blocks:b(Hm),restartBlockIds:b(c()),unreadableBlocks:b(Um)}),Gm=u({blockId:c(),status:Lm,reason:c().optional()}),Km=u({blocks:b(Gm),acted:x()}),qm={name:`composer`,scope:`system`,mode:`singleton`,internal:!0,methods:{applyBlocks:w(Wm,Km,{kind:`mutation`,auth:`admin`}),getStates:w(u({blockIds:b(c())}),u({states:b(Bm)}),{auth:`admin`})}};function B(e,t,n){return{code:e,path:t,message:n}}function V(...e){return{problems:e,fields:[],features:[],events:[]}}function Jm(e){let t=e.item===void 0?`fields`:`items.${e.item.key}.fields`;return`features[${e.featureIndex}].${t}.${e.path}`}var H={kind:`fixed`,result:[`number`]},Ym={kind:`fixed`,result:[`boolean`]},Xm=Object.freeze({min:H,max:H,abs:H,floor:H,ceil:H,sqrt:H,round:H,pow:H,clamp:H,avg:H,sum:H,age:H,convert:H,coalesce:{kind:`coalesce`},any:Ym,all:Ym,within:Ym,latest:{kind:`fixed`,result:[`number`,`null`]},number:{kind:`fixed`,result:[`number`,`null`]},rose:{kind:`fixed`,result:[`number`,`null`]},count:H}),Zm=class extends Error{};function Qm(e){return e===null?`null`:typeof e==`number`?`number`:typeof e==`string`?`string`:`boolean`}function $m(e){return new Set([e])}function eh(...e){return new Set(e.flatMap(e=>[...e]))}function th(e){return new Set([...e].filter(e=>e!==`null`))}function nh(e,t,n){if(e===`+`){let e=[...t,...n];return e.every(e=>e===`string`)?$m(`string`):e.every(e=>e===`number`)?$m(`number`):new Set([`number`,`string`])}return $m(e===`-`||e===`*`||e===`/`||e===`%`?`number`:`boolean`)}function rh(e){return e.minArgs===e.maxArgs?`exactly ${e.minArgs}`:e.maxArgs===1/0?`at least ${e.minArgs}`:`${e.minArgs}–${e.maxArgs}`}function ih(e,t){let n=Br[e];if(n!==void 0&&(t.length<n.minArgs||t.length>n.maxArgs))throw new Zm(`${e}: wrong number of arguments (${t.length}); expected ${rh(n)}`);let r=Xm[e];if(r===void 0)throw new Zm(`no result-kind rule for builtin '${e}'`);if(r.kind===`fixed`)return new Set(r.result);let i=eh(...t.map(th));return t.every(e=>e.has(`null`))?eh(i,$m(`null`)):i}function ah(e,t){switch(e.kind){case`literal`:return $m(Qm(e.value));case`identifier`:{if(e.name===`now`)return $m(`number`);let n=t.get(e.name);if(n===void 0)throw new Zm(`unbound identifier '${e.name}'`);return n}case`unary`:return $m(e.op===`!`?`boolean`:`number`);case`binary`:return nh(e.op,ah(e.left,t),ah(e.right,t));case`logical`:return eh(ah(e.left,t),ah(e.right,t));case`conditional`:return eh(ah(e.consequent,t),ah(e.alternate,t));case`call`:return ih(e.callee,e.args.map(e=>ah(e,t)))}}function oh(e,t){switch(e.kind){case`literal`:case`identifier`:return!1;case`unary`:return oh(e.operand,t);case`binary`:case`logical`:return oh(e.left,t)||oh(e.right,t);case`conditional`:return oh(e.test,t)||oh(e.consequent,t)||oh(e.alternate,t);case`call`:return e.callee===t||e.args.some(e=>oh(e,t))}}function sh(e,t){let n=fi(e);return n.ok&&oh(n.parsed.ast,t)}function ch(e){let t=fi(e.expr);if(!t.ok)return{ok:!1,error:t.error};try{return{ok:!0,kinds:ah(t.parsed.ast,e.bindingKinds)}}catch(e){if(e instanceof Zm)return{ok:!1,error:e.message};throw e}}function lh(e,t){let n=t(e.cap),r=n?.runtimeState??n?.status?.schema;if(n===null||r===void 0)return{ok:!1,code:`source-field-unknown`,message:`no capability \`${e.cap}\` with state to read`};let i=gm(r,e.fieldPath);if(i===null)return{ok:!1,code:`source-field-unknown`,message:`\`${e.cap}\` has no field \`${e.fieldPath}\``};let a=i.kind===`enum`?`string`:i.kind;return{ok:!0,kinds:new Set(i.nullable?[a,`null`]:[a])}}function uh(e,t){if(e.kind===`from`)return lh(e,t);if(e.kind===`code`)return{ok:!1,code:`reserved-variant`,message:`code fields arrive in slice 4`};let n=new Map;for(let[r,i]of Object.entries(e.bindings)){if(i.kind===`literal`){n.set(r,new Set([Qm(i.value)]));continue}let e=lh(i,t);if(!e.ok)return{...e,message:`binding \`${r}\`: ${e.message}`};n.set(r,e.kinds)}let r=ch({expr:e.expr,bindingKinds:n});return r.ok?{ok:!0,kinds:r.kinds}:{ok:!1,code:`expression-invalid`,message:r.error}}function dh(e,t,n,r){let i=t.kind===`enum`?`string`:t.kind,a=[...n].filter(e=>e!==`null`&&e!==i),o=[];return a.length>0&&o.push(B(`kind-mismatch`,r,`\`${e}.${t.path}\` is a ${t.kind}; this source can produce ${a.join(` or `)}`)),n.has(`null`)&&!t.nullable&&o.push(B(`may-be-null`,r,`\`${e}.${t.path}\` cannot be null and this source can produce null — wrap it in coalesce(…) or pick a non-null source`)),o}function fh(e){if(e.kind!==`expression`)return null;let t=fi(e.expr);if(!t.ok)return null;let n=t.parsed.ast;return n.kind===`literal`&&typeof n.value==`string`?n.value:null}function ph(e,t,n,r){if(t.kind!==`enum`||t.enumValues===void 0)return null;let i=fh(n);if(i===null||t.enumValues.includes(i))return null;let a=t.enumValues.map(e=>`\`${e}\``).join(`, `);return B(`kind-mismatch`,r,`\`${e}.${t.path}\` accepts only ${a}; this source is the literal \`${i}\``)}function mh(e){if(e.kind!==`expression`)return`derived`;if(sh(e.expr,`count`))return`accumulator`;if(ca(e).length>0)return`derived`;let t=fi(e.expr);return t.ok&&t.parsed.identifiers.has(`now`)?`clock`:`constant`}function hh(e,t,n,r,i){return n===`replace`&&(t===`derived`||t===`accumulator`)?{ok:!0,unavailable:`release`}:n===`new`||t!==`derived`?{ok:!0,unavailable:e.nullable?`null`:`offline`}:e.nullable?{ok:!0,unavailable:`null`}:e.enumValues?.includes(`unknown`)===!0?{ok:!0,unavailable:`unknown`}:{ok:!1,problem:B(`not-replaceable`,i,`\`${r}.${e.path}\` reads a source but can say neither null nor 'unknown', and an ADDED capability has no native reading to fall back to (D393, D663)`)}}var gh={resettable:!1};function _h(e){return new Set([e.keyField,...e.labelField===void 0?[]:[e.labelField],...Object.keys(gh)])}function vh(e,t,n){let r=gm(e.itemSchema,t);return r===null||!r.required?!1:ym(e.itemSchema,t).every(e=>n.some(t=>t.startsWith(`${e}.`)))}function yh({capName:e,itemArray:t,reserved:n},r,i){let a=Object.keys(r.fields);return pm(t.itemSchema).flatMap(o=>{if(n.has(o.path)||o.path in r.fields||!vh(t,o.path,a))return[];let s=gm(t.itemSchema,o.path);return s===null||s.nullable?[]:[B(`missing-field`,`${i}.fields.${o.path}`,`\`${e}.${t.path}[].${o.path}\` is required and has no source`)]})}function bh(e,t){let{capName:n,itemArray:r,featureIndex:i,lookupCap:a}=e,{key:o,label:s,path:c,source:l}=t,u=`features[${i}].items.${o}.fields.${c}`;if(e.reserved.has(c))return V(B(`item-field-reserved`,u,`\`${n}.${r.path}[].${c}\` is set by the composer itself — it takes no source`));let d=gm(r.itemSchema,c);if(d===null)return V(B(`unknown-field`,u,`a \`${n}\` item has no field \`${c}\``));let f=uh(l,a);if(!f.ok)return V(B(f.code,u,f.message));let p=mh(l),m=hh(d,p,e.mode,n,u);if(!m.ok)return V(m.problem);let ee={cap:n,path:c,item:{arrayPath:r.path,key:o,label:s},featureIndex:i,kind:d.kind,nullable:d.nullable,required:d.required,unavailable:m.unavailable,role:p,source:l,reads:[...ca(l)]},h=ph(n,d,l,u);return{problems:[...dh(n,d,f.kinds,u),...h===null?[]:[h]],fields:[ee],features:[],events:[]}}function xh(e,t,n,r,i=`new`){let a=`features[${n}].items`,o=e.status?.itemArray;if(o===void 0)return V(B(`not-item-array`,a,`\`${e.name}\` has no item array — it takes no \`items\``));if(o.path!==`items`)return V(B(`not-item-array`,a,`\`${e.name}\`'s item array is at \`${o.path}\`, not \`${Ji}\` — not composable yet`));let s={capName:e.name,itemArray:o,reserved:_h(o),featureIndex:n,lookupCap:r,mode:i},c=Object.entries(t.items??{}).flatMap(([e,t])=>[{problems:yh(s,t,`${a}.${e}`),fields:[],features:[],events:[]},...Object.entries(t.fields).map(([n,r])=>bh(s,{key:e,label:t.label,path:n,source:r}))]);return{problems:c.flatMap(e=>e.problems),fields:c.flatMap(e=>e.fields),features:[],events:[]}}var Sh=class extends Error{};function Ch(e){return new Set(e.composition.features.flatMap(e=>!$i(e)||e.kind!==`fields`?[]:ua(e).map(({fieldPath:t})=>`${e.cap}.${t}`)))}function wh(e,t,n){if(P(n.source)!==P(e.target))return!0;let r=`${n.cap}.${n.fieldPath}`;return t.has(r)&&e.replaced?.has(r)!==!0}function Th(e){let t=Ch(e);return e.composition.features.flatMap(n=>!$i(n)||n.kind!==`fields`?[]:ua(n).map(({fieldPath:r,source:i})=>[aa({source:e.target,cap:n.cap,fieldPath:r}),ca(i).filter(n=>wh(e,t,n)).map(aa)]))}function Eh(e,t){let n=P(e.target),r=new Map;for(let i of t){if(i.blockId===e.blockId)continue;let t=P(i.target);if(t===n)throw new Sh(`block \`${i.blockId}\` and block \`${e.blockId}\` both target device \`${t}\` — one composition per device; delete or edit the existing one`);let a=r.get(t);if(a!==void 0)throw new Sh(`two stored compositions (\`${a.blockId}\`, \`${i.blockId}\`) both target device \`${t}\` — refusing to build the field graph`);r.set(t,i)}return[...r.values(),e]}function Dh(e,t){let n=Eh(e,t).flatMap(Th);return new Map(n)}function Oh(e,t){let n=Dh(e,t),r=new Map,i=new Map,a=(e,t)=>{let o=r.get(e);if(o!==`done`){if(o===`visiting`){let n=[...t.slice(t.indexOf(e)),e],r=[...new Set(n)].toSorted().join(`|`);i.has(r)||i.set(r,{path:n});return}r.set(e,`visiting`);for(let r of n.get(e)??[])a(r,[...t,e]);r.set(e,`done`)}};for(let e of n.keys())a(e,[]);return[...i.values()]}function kh(e){let t=new Map,n=new Map,r=new Set,i=[],a=[],o=s=>{t.set(s,t.size),n.set(s,t.get(s)??0),i.push(s),r.add(s);for(let i of e.get(s)??[])t.has(i)?r.has(i)&&n.set(s,Math.min(n.get(s)??0,t.get(i)??0)):(o(i),n.set(s,Math.min(n.get(s)??0,n.get(i)??0)));if(n.get(s)!==t.get(s))return;let c=[];for(let e=i.pop();e!==void 0&&(r.delete(e),c.push(e),e!==s);e=i.pop());a.push(c)};for(let n of e.keys())t.has(n)||o(n);return a}function Ah(e,t,n){let r=new Map,i=[e];for(let a=0;a<i.length;a+=1){let o=i[a];if(o===void 0)break;for(let a of n.get(o)??[]){if(a===e){let t=[];for(let n=o;n!==void 0&&n!==e;n=r.get(n))t.push(n);return[e,...t.reverse(),e]}!t.has(a)||r.has(a)||(r.set(a,o),i.push(a))}}return[e,e]}function jh(e,t){let n=Dh(e,t),r=`${P(e.target)}#`;return kh(n).flatMap(e=>{let t=e.find(e=>e.startsWith(r));if(t===void 0)return[];let i=new Set(e),a=e.length===1&&(n.get(t)??[]).includes(t);return e.length===1&&!a?[]:[{path:Ah(t,i,n),component:i}]})}function Mh(e){let t=new Map(e.map(e=>[e.name,e]));return e=>t.get(e)??null}var Nh=new Set([`device-status`,`feature-probe`]),Ph={addonId:Ai,stableId:`${Mi}(unsaved)`},Fh=`(unsaved)`;function Ih(e,t,n){let r=n(e.cap);if(r===null)return B(`unknown-capability`,`${t}.cap`,`no capability is named \`${e.cap}\``);if(Nh.has(r.name))return B(`not-composable`,`${t}.cap`,`\`${r.name}\` is registered by every device itself — it cannot be composed`);let i=r.runtimeState;return r.scope!==`device`||i===void 0?B(`not-composable`,`${t}.cap`,`\`${r.name}\` has no per-device state to compose`):{def:r,state:i,fields:_m(i)}}function Lh({def:e,state:t,fields:n},r,i,a){let o=[];e.deviceTypes!==void 0&&!e.deviceTypes.includes(a)&&o.push(B(`wrong-device-type`,`${i}.cap`,`\`${e.name}\` is not offered on a \`${a}\` device (it allows ${e.deviceTypes.join(`, `)})`));let s=Object.entries(e.methods).filter(([t,n])=>n.systemOnly!==!0&&e.composedMethods?.[t]===void 0).map(([e])=>`\`${e}\``);s.length>0&&o.push(B(`has-commands`,`${i}.cap`,`\`${e.name}\` has ${s.join(`, `)}, which a composed device cannot serve until commands arrive (slice 3)`));let c=r.items===void 0?null:e.status?.itemArray?.path??null;for(let a of vm(t))a!==c&&(n.has(a)?a in r.fields||o.push(B(`missing-field`,`${i}.fields.${a}`,`\`${e.name}.${a}\` is required and has no source`)):o.push(B(`not-composable`,`${i}.fields`,`\`${e.name}.${a}\` is not a scalar — nested fields arrive in a later slice`)));return o}function Rh({def:e,fields:t},n,r,i){let{featureIndex:a,path:o,source:s}=n,c=`features[${a}].fields.${o}`;if(o.includes(`.`))return V(B(`nested-field`,c,`\`${o}\` is nested — nested fields arrive in a later slice`));let l=t.get(o);if(l===void 0)return V(B(`unknown-field`,c,`\`${e.name}\` has no field \`${o}\``));let u=uh(s,i);if(!u.ok)return V(B(u.code,c,u.message));let d=mh(s),f=hh(l,d,r,e.name,c);if(!f.ok)return V(f.problem);let p={cap:e.name,path:o,featureIndex:a,kind:l.kind,nullable:l.nullable,required:l.required,unavailable:f.unavailable,role:d,source:s,reads:[...ca(s)]},m=ph(e.name,l,s,c);return{problems:[...dh(e.name,l,u.kinds,c),...m===null?[]:[m]],fields:[p],features:[],events:[]}}function zh(e,t,n,r){let i=`features[${t}]`,a=Ih(e,i,r);if(`code`in a)return V(a);let o=n.mode===`replace`?[]:[...Lh(a,e,i,n.deviceType)];e.commands!==void 0&&Object.keys(e.commands).length>0&&o.push(B(`reserved-variant`,`${i}.commands`,"commands (`forward`) arrive in slice 3"));let s=Object.entries(e.fields).map(([e,i])=>Rh(a,{featureIndex:t,path:e,source:i},n.mode,r)),c=e.items===void 0?[]:[xh(a.def,e,t,r,n.mode)],l=[...s,...c],u=l.flatMap(e=>e.fields),d={featureIndex:t,cap:a.def.name,mode:n.mode},f=Tm(a.def,d,u);return{problems:[...o,...l.flatMap(e=>e.problems),...f.problems],fields:u,features:[d],events:f.events}}function Bh(e,t){let n=e.nativeCaps.get(t);return n!==void 0&&n!==`composer`}function Vh(e,t){if(e.target.kind===`new`)return{kind:`new`,type:e.target.type};let n=P(e.target.device);return t===void 0?B(`target-unreadable`,`target`,`target device \`${n}\` was not read — the save is refused rather than stored unchecked`):t.kind===`absent`?B(`target-missing`,`target`,`target device \`${n}\` does not exist`):t.kind===`unreadable`?B(`target-unreadable`,`target`,`could not read target device \`${n}\` (${t.error}) — the save is refused rather than stored unchecked`):{kind:`existing`,found:t}}function Hh(e,t){return e.kind===`new`?{mode:`new`,deviceType:e.type}:{mode:Bh(e.found,t)?`replace`:`add`,deviceType:e.found.type}}function Uh(e,t,n){let r=Vh(e,n);if(`code`in r)return V(r);let i=e.features.map((e,n)=>{let i=e.kind===`passthrough`?V(B(`reserved-variant`,`features[${n}]`,`whole-capability passthrough of \`${e.cap}\` arrives in slice 3`)):zh(e,n,Hh(r,e.cap),t);return $i(e)?i:{problems:i.problems,fields:[],features:[],events:[]}});return{problems:i.flatMap(e=>e.problems),fields:i.flatMap(e=>e.fields),features:i.flatMap(e=>e.features),events:i.flatMap(e=>e.events)}}function Wh(e){let t=e.features.flatMap(e=>$i(e)&&e.kind===`fields`?da(e).flatMap(ca).map(e=>e.source):[]);return[...new Map(t.map(e=>[P(e),e])).values()]}function Gh(e,t,n){return{ref:e.target.kind===`existing`?e.target.device:t.self??Ph,native:e.target.kind===`existing`&&t.target?.kind===`found`?t.target:null,replaced:Kh(n)}}function Kh(e){let t=new Set(e.features.filter(e=>e.mode===`replace`).map(e=>e.featureIndex));return new Set(e.fields.filter(e=>t.has(e.featureIndex)).map(Nm))}function qh(e,t,n,r){let i=`${e.cap}.${e.fieldPath}`;return n.some(e=>Nm(e)===i&&!r.replaced.has(i))?[]:r.native===null?[B(`source-field-unknown`,t,`this device has no composed field \`${e.cap}.${e.fieldPath}\``)]:Bh(r.native,e.cap)?[]:[B(`source-capability-missing`,t,`the target device (device ${r.native.deviceId}) has no native \`${e.cap}\``)]}function Jh(e,t,n){let r=P(n.ref);return e.flatMap(i=>i.reads.flatMap(a=>{let o=Jm(i),s=P(a.source);if(s===r)return qh(a,o,e,n);let c=t.sources.get(s);return c===void 0||c.kind===`unreadable`?[B(`source-unreadable`,o,`could not read source \`${s}\` (${c===void 0?`it was not read`:c.error}) — the save is refused rather than stored unchecked`)]:c.kind===`absent`?[B(`source-missing`,o,`source \`${s}\` does not exist`)]:c.caps.has(a.cap)?[]:[B(`source-capability-missing`,o,`source \`${s}\` (device ${c.deviceId}) has no \`${a.cap}\``)]}))}function Yh(e,t){let n=`${t}#`;if(!e.startsWith(n))return null;let r=e.slice(n.length),i=r.indexOf(`.`);return i===-1?null:{cap:r.slice(0,i),fieldPath:r.slice(i+1)}}function Xh(e,t,n){for(let r of e){let e=Yh(r,t);if(e===null)continue;let i=`${e.cap}.${e.fieldPath}`,a=n.find(e=>Nm(e)===i);if(a!==void 0)return Jm(a)}return`features`}function Zh(e,t){for(let[n,r]of t)if(e.some(e=>e.startsWith(`${n}#`)))return{key:n,error:r};return null}function Qh(e,t,n,r){let i={blockId:t.blockId??`(unsaved)`,target:r.ref,composition:e,replaced:r.replaced},a=P(i.target),o=t.unreadTargets??new Map;try{return jh(i,t.peers).map(e=>{let t=Xh(e.path,a,n),r=Zh([...e.component],o);return r===null?B(`cycle`,t,`a field reads itself: ${e.path.join(` → `)}`):B(`cycle`,t,`possible cycle through \`${r.key}\` — its state could not be read (${r.error}): ${e.path.join(` → `)}`)})}catch(e){if(e instanceof Sh)return[B(`duplicate-target`,`features`,e.message)];throw e}}function $h(e,t){let n=Uh(e,t.lookupCap,t.target??void 0),r=Gh(e,t,n),i=Qh(e,t,n.fields,r),a=[...n.problems,...Jh(n.fields,t,r),...i];return{ok:a.length===0,problems:a,fields:[...n.fields],features:[...n.features],events:[...n.events]}}var eg=u({path:c(),kind:Om,nullable:x(),required:x(),enumValues:b(c()).optional()}),tg=u({cap:c(),fields:b(eg),itemArray:u({path:c(),keyField:c()}).optional()}),ng=u({caps:b(tg)});function rg(e,t){if(Nh.has(e.name))return[`not-composable`];let n=e.runtimeState;if(e.scope!==`device`||n===void 0)return[`not-composable`];let r=[];e.deviceTypes!==void 0&&!e.deviceTypes.includes(t)&&r.push(`wrong-device-type`),Object.entries(e.methods).filter(([t,n])=>n.systemOnly!==!0&&e.composedMethods?.[t]===void 0).length>0&&r.push(`has-commands`);let i=_m(n),a=e.status?.itemArray?.path??null;return vm(n).some(e=>e!==a&&!i.has(e))&&r.push(`not-composable`),Tm(e,{featureIndex:0,cap:e.name,mode:`new`},[]).problems.some(e=>e.code===`not-composable`)&&!r.includes(`not-composable`)&&r.push(`not-composable`),r}function ig(e,t){return e.filter(e=>rg(e,t).length===0).map(e=>{let t=e.runtimeState,n=t===void 0?[]:[..._m(t).values()],r=e.status?.itemArray;return{cap:e.name,fields:n.map(e=>({path:e.path,kind:e.kind,nullable:e.nullable,required:e.required,...e.enumValues===void 0?{}:{enumValues:[...e.enumValues]}})),...r===void 0?{}:{itemArray:{path:r.path,keyField:r.keyField}}}}).toSorted((e,t)=>e.cap.localeCompare(t.cap))}var ag=`core-block-`,og=`core-blocks`;function sg(e){return`${ag}${e}`}function cg(e){if(!e.startsWith(`core-block-`))return null;let t=e.slice(11);return t.length>0?t:null}var lg=d([p(`hub`),c().min(1)]),ug=y([`stopped`,`starting`,`running`,`degraded`,`failed`]),dg=u({name:c().min(1).max(120),code:c().max(2e5),enabled:x(),placement:lg,integrationId:c().optional()}),fg=f(`kind`,[u({kind:p(`code`)}),u({kind:p(`recipe`),recipe:Cd}),u({kind:p(`composition`),composition:ra})]),pg=u({name:c().min(1).max(120).optional(),enabled:x(),composition:ra}),U=dg.extend({id:c(),createdAt:i(),updatedAt:i(),createdBy:c(),status:ug,lastError:c().optional(),lastChangedAt:i(),source:fg.optional()});function mg(e){return e.source?.kind??`code`}function hg(e){return e.source?.kind===`composition`?e.source.composition:null}var gg=f(`kind`,[u({kind:p(`answered`),state:Bm.nullable()}),u({kind:p(`unreachable`),error:c()})]),_g=u({block:U,state:gg}),vg=u({state:p(`not-loaded`),reason:c()}),yg=f(`state`,[u({state:p(`loaded`),views:b(_g)}),vg]),bg=f(`state`,[u({state:p(`loaded`),view:_g.nullable()}),vg]),xg=f(`state`,[u({state:p(`loaded`),view:_g.nullable()}),vg]),Sg=u({ok:x(),error:c().optional(),line:i().optional(),column:i().optional()}),Cg={name:`core-blocks`,scope:`system`,mode:`singleton`,methods:{list:w(u({}),u({blocks:b(U)}),{auth:`admin`}),get:w(u({blockId:c()}),u({block:U.nullable()}),{auth:`admin`}),create:w(u({block:dg}),u({block:U}),{kind:`mutation`,auth:`admin`,caller:`required`}),update:w(u({blockId:c(),block:dg.partial()}),u({block:U}),{kind:`mutation`,auth:`admin`,caller:`required`}),delete:w(u({blockId:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),setEnabled:w(u({blockId:c(),enabled:x()}),u({block:U}),{kind:`mutation`,auth:`admin`}),restart:w(u({blockId:c()}),u({block:U}),{kind:`mutation`,auth:`admin`}),compile:w(u({code:c()}),Sg,{kind:`mutation`,auth:`admin`}),getTypeDefs:w(u({}),u({libs:b(u({filePath:c(),content:c()}))}),{auth:`admin`}),createComposition:w(u({block:pg}),u({block:U}),{kind:`mutation`,auth:`admin`,caller:`required`}),updateComposition:w(u({blockId:c(),expectedUpdatedAt:i(),block:pg.partial()}),u({block:U}),{kind:`mutation`,auth:`admin`,caller:`required`}),getComposition:w(u({blockId:c()}),bg,{auth:`admin`}),listCompositions:w(u({}),yg,{auth:`admin`}),getCustomization:w(u({addonId:c().min(1),stableId:c().min(1)}),xg,{auth:`admin`}),listComposableCaps:w(u({deviceType:y(E)}),ng,{auth:`admin`}),validateComposition:w(u({composition:ra,blockId:c().optional()}),Im,{kind:`mutation`,auth:`admin`,access:`view`})}},wg=u({stepId:c(),entry:ed}),Tg={name:`custom-model-registry`,scope:`system`,mode:`collection`,internal:!0,methods:{listModels:w(g(),b(wg).readonly(),{auth:`admin`})}},W=u({where:_(c(),o()).optional(),whereIn:_(c(),b(o())).optional(),whereBetween:_(c(),l([o(),o()])).optional(),whereNot:_(c(),o()).optional(),whereNotIn:_(c(),b(o())).optional(),orderBy:u({field:c(),direction:y([`asc`,`desc`])}).optional(),limit:i().optional(),offset:i().optional()}),Eg=u({where:_(c(),o()).optional(),whereIn:_(c(),b(o())).optional(),whereBetween:_(c(),l([o(),o()])).optional(),whereNot:_(c(),o()).optional(),whereNotIn:_(c(),b(o())).optional()}),Dg=u({as:c().min(1),field:c().min(1),op:y([`sum`,`min`,`max`])}),Og=u({count:i().int(),values:_(c(),i().nullable())}),kg=u({id:c(),data:_(c(),o())}),Ag=u({id:c().optional(),data:_(c(),o())}),jg=u({name:c(),type:y([`TEXT`,`INTEGER`,`REAL`,`JSON`,`BOOLEAN`]),primaryKey:x().optional(),notNull:x().optional(),unique:x().optional(),defaultValue:d([c(),i(),x()]).optional()}),Mg=u({name:c(),columns:b(c()).readonly(),unique:x().optional()}),Ng={name:`settings-store`,scope:`system`,mode:`singleton`,methods:{get:w(u({namespace:c().optional(),collection:c(),key:c()}),o(),{auth:`admin`}),set:w(u({namespace:c().optional(),collection:c(),key:c(),value:o()}),g(),{kind:`mutation`,auth:`admin`}),query:w(u({namespace:c().optional(),collection:c(),filter:W.optional(),columns:b(c()).readonly().optional()}),b(kg).readonly(),{auth:`admin`}),upsert:w(u({namespace:c().optional(),collection:c(),conflict:b(c()).readonly(),record:Ag}),u({id:d([c(),i()])}),{kind:`mutation`,auth:`admin`}),insert:w(u({namespace:c().optional(),collection:c(),record:u({id:c().optional(),data:_(c(),o())})}),u({id:d([c(),i()])}),{kind:`mutation`,auth:`admin`}),insertMany:w(u({namespace:c().optional(),collection:c(),records:b(Ag).readonly()}),u({inserted:i().int()}),{kind:`mutation`,auth:`admin`}),update:w(u({namespace:c().optional(),collection:c(),id:c(),data:_(c(),o())}),g(),{kind:`mutation`,auth:`admin`}),delete:w(u({namespace:c().optional(),collection:c(),key:c()}),g(),{kind:`mutation`,auth:`admin`}),deleteWhere:w(u({namespace:c().optional(),collection:c(),filter:Eg}),u({deleted:i().int()}),{kind:`mutation`,auth:`admin`}),updateWhere:w(u({namespace:c().optional(),collection:c(),filter:Eg,data:_(c(),o())}),u({updated:i().int()}),{kind:`mutation`,auth:`admin`}),count:w(u({namespace:c().optional(),collection:c(),filter:W.optional()}),i(),{auth:`admin`}),aggregate:w(u({namespace:c().optional(),collection:c(),fields:b(Dg).readonly(),filter:W.optional()}),Og,{auth:`admin`}),histogram:w(u({namespace:c().optional(),collection:c(),field:c(),bucketSize:i().int().positive(),origin:i().int(),filter:W.optional()}),b(u({bucket:i().int(),count:i().int()})).readonly(),{auth:`admin`}),isEmpty:w(u({namespace:c().optional(),collection:c()}),x(),{auth:`admin`}),declareCollection:w(u({namespace:c().optional(),collection:c(),columns:b(jg).readonly(),indexes:b(Mg).readonly().optional()}),g(),{kind:`mutation`,auth:`admin`})}},Pg=u({engineId:c(),kind:y([`relational`,`vector`]),displayName:c()}),Fg={name:`data-store-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getEngineInfo:w(g(),Pg,{auth:`admin`}),get:w(u({namespace:c().optional(),collection:c(),key:c()}),o(),{auth:`admin`}),set:w(u({namespace:c().optional(),collection:c(),key:c(),value:o()}),g(),{kind:`mutation`,auth:`admin`}),query:w(u({namespace:c().optional(),collection:c(),filter:W.optional(),columns:b(c()).readonly().optional()}),b(kg).readonly(),{auth:`admin`}),insert:w(u({namespace:c().optional(),collection:c(),record:u({id:c().optional(),data:_(c(),o())})}),u({id:d([c(),i()])}),{kind:`mutation`,auth:`admin`}),upsert:w(u({namespace:c().optional(),collection:c(),conflict:b(c()).readonly(),record:Ag}),u({id:d([c(),i()])}),{kind:`mutation`,auth:`admin`}),insertMany:w(u({namespace:c().optional(),collection:c(),records:b(Ag).readonly()}),u({inserted:i().int()}),{kind:`mutation`,auth:`admin`}),update:w(u({namespace:c().optional(),collection:c(),id:c(),data:_(c(),o())}),g(),{kind:`mutation`,auth:`admin`}),delete:w(u({namespace:c().optional(),collection:c(),key:c()}),g(),{kind:`mutation`,auth:`admin`}),deleteWhere:w(u({namespace:c().optional(),collection:c(),filter:Eg}),u({deleted:i().int()}),{kind:`mutation`,auth:`admin`}),updateWhere:w(u({namespace:c().optional(),collection:c(),filter:Eg,data:_(c(),o())}),u({updated:i().int()}),{kind:`mutation`,auth:`admin`}),count:w(u({namespace:c().optional(),collection:c(),filter:W.optional()}),i(),{auth:`admin`}),aggregate:w(u({namespace:c().optional(),collection:c(),fields:b(Dg).readonly(),filter:W.optional()}),Og,{auth:`admin`}),histogram:w(u({namespace:c().optional(),collection:c(),field:c(),bucketSize:i().int().positive(),origin:i().int(),filter:W.optional()}),b(u({bucket:i().int(),count:i().int()})).readonly(),{auth:`admin`}),isEmpty:w(u({namespace:c().optional(),collection:c()}),x(),{auth:`admin`}),declareCollection:w(u({namespace:c().optional(),collection:c(),columns:b(jg).readonly(),indexes:b(Mg).readonly().optional()}),g(),{kind:`mutation`,auth:`admin`})}},Ig=[{value:`auto`,label:`Auto (defer to probed best)`},{value:`none`,label:`Off (software)`},{value:`videotoolbox`,label:`VideoToolbox (macOS)`},{value:`cuda`,label:`CUDA (NVIDIA)`},{value:`nvdec`,label:`NVDEC (NVIDIA legacy)`},{value:`vaapi`,label:`VAAPI (Linux Intel/AMD)`},{value:`qsv`,label:`QuickSync (Intel)`},{value:`d3d11va`,label:`D3D11VA (Windows)`},{value:`dxva2`,label:`DXVA2 (Windows legacy)`},{value:`amf`,label:`AMF (AMD)`},{value:`vdpau`,label:`VDPAU (Linux NVIDIA legacy)`},{value:`drm`,label:`DRM (Linux generic)`}],Lg={hwaccel:`auto`,probedBestHwaccel:``},Rg=u({sessionId:c(),slotCount:i().int(),slotByteLength:i().int(),segmentBytes:i().int(),budgetMb:i().int(),framesWritten:i().int(),getFrameHits:i().int(),getFrameMisses:i().int()}),zg={name:`decoder`,scope:`system`,mode:`singleton`,preferredProvider:`decoder-nodeav`,methods:{supportsCodec:w(u({codec:c()}),x()),getInfo:w(g(),u({id:c(),name:c(),isPullMode:x().optional(),priority:i().optional(),hwaccel:c().optional(),probedBestHwaccel:c().optional()})),createSession:w(Ll,u({sessionId:c(),nodeId:c()})),destroySession:w(u({sessionId:c()}),g()),pushPacket:w(u({sessionId:c(),packet:vt}),g()),openStream:w(u({sessionId:c(),url:c()}),g()),pullFrames:w(u({sessionId:c(),maxCount:i().default(1),waitMs:i().optional()}),b(yt)),pullHandles:w(u({sessionId:c(),maxCount:i().default(1),waitMs:i().optional()}),b(C)),getFrame:w(u({handle:C}),yt.nullable()),getShmStats:w(u({sessionId:c()}),Rg.nullable()),updateConfig:w(u({sessionId:c(),config:Ll.partial()}),g()),getStats:w(u({sessionId:c()}),Il),listActiveSessions:w(g(),b(u({sessionId:c(),codec:c(),outputFormat:c(),createdAtMs:i()})).readonly()),reprobeHwaccel:w(g(),u({backend:c()}),{kind:`mutation`,auth:`admin`})}},Bg={name:`detection-pipeline`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[E.Camera],exposesDeviceSettings:!0,methods:{}},Vg=y([`device`,`integration`]),Hg=u({url:c(),label:c(),target:Vg,host:c()}),Ug={name:`device-admin-link`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{getAdminLink:w(u({deviceId:i().int().nonnegative()}),Hg.nullable(),{auth:`admin`})}},Wg=[`password`,`passwd`,`pwd`,`pass`,`user`,`username`,`usr`,`login`,`token`,`access_token`,`auth`,`authorization`,`apikey`,`api_key`,`secret`,`credential`,`credentials`,`session`,`sessionid`,`key`],Gg=/[a-z][a-z0-9+.-]*:\/\/[^/\s:@'"]+:[^/\s:@'"]+@/i,Kg=/^[a-zA-Z0-9._-]+$/,qg=/^\[[0-9a-fA-F:.]+\]$/;function Jg(e){return e===`https`?443:80}function Yg(e){let t=e.host.trim();if(t.length===0)return{ok:!1,reason:`empty-host`};if(t.includes(`@`))return{ok:!1,reason:`host-carries-userinfo`};if(!Kg.test(t)&&!qg.test(t))return{ok:!1,reason:`host-not-plain`};if(e.port!==null&&(!Number.isInteger(e.port)||e.port<1||e.port>65535))return{ok:!1,reason:`port-out-of-range`};if(!e.path.startsWith(`/`))return{ok:!1,reason:`path-not-absolute`};let n=e.query??{};for(let e of Object.keys(n))if(Wg.includes(e.toLowerCase()))return{ok:!1,reason:`credential-query-key`};let r=e.port===null||e.port===Jg(e.scheme)?t:`${t}:${String(e.port)}`,i=new URLSearchParams;for(let[e,t]of Object.entries(n))i.append(e,t);let a=i.size>0?`?${i.toString()}`:``,o=`${e.scheme}://${r}${e.path}${a}`;return Gg.test(o)?{ok:!1,reason:`userinfo-in-result`}:{ok:!0,url:o}}function Xg(e){let t=e.trim();if(t.length===0)return{ok:!1,reason:`empty`};let n;try{n=new URL(t)}catch{return{ok:!1,reason:`unparseable`}}if(n.username!==``||n.password!==``)return{ok:!1,reason:`base-carries-userinfo`};if(n.protocol!==`http:`&&n.protocol!==`https:`)return{ok:!1,reason:`scheme-not-http`};let r=n.protocol===`https:`?`https`:`http`,i=n.port===``?null:Number(n.port),a=n.pathname===`/`?``:n.pathname.replace(/\/+$/,``);return{ok:!0,host:n.hostname,port:i,scheme:r,basePath:a}}var Zg=u({id:c(),system:c(),uniqueId:c().optional(),raw:_(c(),o()).optional()});function Qg(e){return{id:e.stableId,system:e.addonId}}function $g(e,t){let n={...e};for(let[r,i]of Object.entries(t))if(i!==void 0){if(r===`raw`&&typeof i==`object`&&i){n.raw={...e.raw,...i};continue}n[r]=i}return n}function e_(e){if(e==null)return;let t=e.trim();if(t===``)return;let n=t.toLowerCase();return n===`°c`||n===`c`||n===`celsius`?`°C`:n===`°f`||n===`f`||n===`fahrenheit`?`°F`:n===`k`||n===`kelvin`?`K`:n===`%`||n===`percent`||n===`percentage`?`%`:n===`lx`||n===`lux`?`lx`:n===`hpa`||n===`hectopascal`?`hPa`:n===`kpa`?`kPa`:n===`pa`?`Pa`:n===`mbar`||n===`millibar`?`mbar`:n===`w`||n===`watt`?`W`:n===`kw`||n===`kilowatt`?`kW`:n===`wh`||n===`watt-hour`?`Wh`:n===`kwh`||n===`kilowatt-hour`?`kWh`:n===`v`||n===`volt`?`V`:n===`a`||n===`amp`||n===`ampere`?`A`:n===`ma`||n===`milliampere`?`mA`:n===`va`?`VA`:n===`ppm`?`ppm`:n===`ppb`?`ppb`:n===`µg/m³`||n===`ug/m3`||n===`µg/m3`?`µg/m³`:n===`km/h`||n===`kph`?`km/h`:n===`mph`?`mph`:n===`m/s`?`m/s`:n===`m`?`m`:n===`km`?`km`:n===`kg`?`kg`:n===`g`?`g`:t}var t_=`sourceInfo`;function n_(e){if(!e)return null;let t=e[t_];if(!t)return null;let n=Zg.safeParse(t);return n.success?n.data:null}var r_=y([`online`,`sleeping`,`offline`,`unknown`]),i_=me(()=>u({childNativeId:c(),name:c(),type:y(E),status:r_,metadata:u({model:c().optional(),serialNumber:c().optional(),uid:c().optional(),rtspChannel:i().int().nonnegative().optional(),isBattery:x().optional(),isDoorbell:x().optional(),isMultifocal:x().optional(),externalLocation:c().optional(),manufacturer:c().optional(),integration:c().optional()}).default({}),alreadyAdopted:x(),adoptedDeviceId:i().int().nonnegative().nullable(),capabilities:b(c()).readonly().optional(),features:b(c()).readonly().optional(),sourceInfo:Zg.optional(),children:b(i_).readonly().optional()})),a_=u({discovered:b(i_),lastDiscoveryAt:i().int().nonnegative().nullable(),lastError:c().nullable()}),o_={name:`device-discovery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Hub],status:{schema:a_,kind:`poll`},runtimeState:a_.extend({lastFetchedAt:i().int().nonnegative()}),durability:`session`,methods:{listDiscovered:w(u({deviceId:i().int().nonnegative()}),b(i_).readonly()),refreshDiscovery:w(u({deviceId:i().int().nonnegative()}),b(i_).readonly(),{kind:`mutation`,auth:`admin`}),adoptDevice:w(u({deviceId:i().int().nonnegative(),childNativeId:c(),name:c().optional()}),u({deviceId:i().int().nonnegative(),stableId:c()}),{kind:`mutation`,auth:`admin`}),releaseDevice:w(u({deviceId:i().int().nonnegative(),childDeviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`admin`})}},s_=u({id:c(),label:c(),isDefault:x().optional()}),c_=u({search:c().optional(),area:c().optional(),manufacturer:c().optional(),adoptedOnly:x().optional(),unadoptedOnly:x().optional()}),l_=u({integrationId:c(),page:i().int().positive().default(1),pageSize:i().int().positive().max(2e4).default(50),filter:c().optional(),filterText:c_.optional()}),u_=u({candidates:b(i_).readonly(),totalCount:i().int().nonnegative(),page:i().int().positive(),pageSize:i().int().positive()}),d_=u({integrationId:c(),childNativeId:c()}),f_=u({lastDiscoveryAt:i().int().nonnegative().nullable(),candidateCount:i().int().nonnegative(),adoptedCount:i().int().nonnegative(),lastError:c().nullable()}),p_=u({name:c().min(1).optional(),hiddenChildIds:b(c()).optional()}),m_=u({integrationId:c(),childNativeIds:b(c()).min(1),filter:c().optional(),importLocations:x().optional(),perCandidate:_(c(),p_).optional()}),h_=u({adopted:b(u({childNativeId:c(),parentDeviceId:i().int().nonnegative(),accessoryDeviceIds:b(i().int().nonnegative()).readonly()})).readonly()}),g_=u({integrationId:c(),camDeviceId:i().int().nonnegative()}),__=u({camDeviceId:i().int().nonnegative(),resetToSource:x().optional()}),v_=u({changed:x(),rebuiltChildren:i().int().nonnegative(),removedChildren:i().int().nonnegative().optional()}),y_={name:`device-adoption`,scope:`system`,mode:`singleton`,status:{schema:f_,kind:`poll`},methods:{listCandidateFilters:w(u({integrationId:c()}),u({filters:b(s_)}),{auth:`admin`}),listCandidates:w(l_,u_,{auth:`admin`}),getCandidate:w(d_,i_.nullable(),{auth:`admin`}),refresh:w(u({integrationId:c()}),f_,{kind:`mutation`,auth:`admin`}),adopt:w(m_,h_,{kind:`mutation`,auth:`admin`}),release:w(g_,g(),{kind:`mutation`,auth:`admin`}),resync:w(__,v_,{kind:`mutation`,auth:`admin`})}},b_=y([`unlinked`,`linked`,`error`]),x_=u({label:c(),value:c(),secret:x().optional()}),S_=u({qr:c().optional(),fields:b(x_).readonly().optional(),note:c().optional()}),C_=u({linkState:b_,exposedDeviceCount:i(),error:c().optional(),setup:S_.optional()}),w_=c(),T_=u({deviceId:c(),exposedAs:c().optional(),capabilities:b(c()).optional()}),E_=u({deviceId:c(),capabilities:b(c()).optional()}),D_=u({deviceId:c()}),O_={name:`device-export`,scope:`system`,mode:`collection`,providerKind:`device-export`,status:{schema:C_,kind:`poll`},exposesDeviceSettings:!0,methods:{getStatus:w(g(),C_),listSupportedDeviceKinds:w(g(),b(w_)),listExposedDevices:w(g(),b(T_)),exposeDevice:w(E_,g(),{kind:`mutation`,auth:`admin`}),unexposeDevice:w(D_,g(),{kind:`mutation`,auth:`admin`})}},k_=[`map-pin`,`house`,`door-open`,`sofa`,`utensils`,`bed-double`,`bath`,`briefcase`,`car`,`circle-parking`,`route`,`trees`,`umbrella`,`waves-ladder`,`fence`,`package`,`warehouse`,`store`,`sun`,`radar`],A_=`map-pin`,j_=y(k_),M_=u({locationKey:c(),icon:j_});function N_(e){return e.trim().toLowerCase()}function P_(e){let t=j_.safeParse(e);return t.success?t.data:A_}var F_=400,I_=u({locationKey:c(),description:c()}),L_=u({zoneKey:c(),label:c(),icon:j_.nullable(),locationKeys:b(c())});function R_(e){return e.trim().toLowerCase()}var z_=u({connected:x(),deviceCount:i(),error:c().optional()}),B_=u({externalId:c(),name:c(),type:c(),metadata:_(c(),o()).optional()}),V_=u({stableId:c(),type:y(E),suggestedName:c(),prefilledConfig:_(c(),o()),sourceInfo:Zg.optional(),alreadyOnboarded:x().optional(),onboardedDeviceId:i().optional(),onboardedName:c().optional()}),H_=u({id:i(),stableId:c(),addonId:c(),type:c(),name:c(),parentDeviceId:i().nullable(),online:x(),features:b(c()),config:_(c(),o()),sourceInfo:Zg.optional()}),U_=u({status:y([`ok`,`error`]),labels:b(c()).optional(),error:c().optional()}),W_=o(),G_={name:`device-provider`,scope:`system`,mode:`collection`,methods:{start:w(g(),g(),{kind:`mutation`}),stop:w(g(),g(),{kind:`mutation`}),getStatus:w(g(),z_),getDevices:w(g(),b(u({id:c(),name:c(),type:c()}))),reloadDevice:w(u({stableId:c()}),u({deviceId:i()}),{kind:`mutation`,timeoutMs:3*6e4}),supportsDiscovery:w(u({}),x()),discoverDevices:w(u({params:_(c(),o()).optional()}),b(V_),{kind:`mutation`,auth:`admin`}),getDiscoveryParamsSchema:w(u({}),W_),getManualCreationType:w(u({}),u({deviceType:y(E).nullable()})),adoptDiscoveredDevice:w(u({candidate:V_}),H_,{kind:`mutation`,auth:`admin`}),supportsManualCreation:w(u({}),x()),getChildCreationSchema:w(u({type:y(E)}),W_),createDevice:w(u({type:y(E),config:_(c(),o())}),H_,{kind:`mutation`,auth:`admin`}),testCreationField:w(u({type:y(E),key:c(),value:o(),formValues:_(c(),o()).optional()}),U_,{kind:`mutation`,auth:`admin`})}},K_=u({childKey:c(),section:c(),order:i().optional(),collapsed:x().optional()}),q_=u({unit:c().min(1).optional(),precision:i().int().min(0).max(10).optional()}),J_=u({icon:c().min(1).optional(),label:c().min(1).optional(),unit:c().min(1).optional(),precision:i().int().min(0).max(10).optional(),hidden:x().optional(),perCap:_(c(),q_).optional()}),Y_=u({unit:c().min(1).optional(),precision:i().int().min(0).max(10).optional(),icon:c().min(1).optional()}),X_=u({id:i(),stableId:c(),addonId:c(),type:y(E),name:c(),location:c().nullable(),disabled:x(),parentDeviceId:i().nullable(),role:c().nullable().optional(),online:x(),probed:x().optional(),features:b(c()),isCamera:x(),config:_(c(),o()),metadata:_(c(),o()).nullable().optional(),sourceInfo:Zg.optional(),integrationId:c().optional(),linkDeviceId:i().nullable().optional(),primaryChildEntityId:c().nullable().optional(),childLayout:b(K_).readonly().optional(),display:J_.optional()}),Z_=u({key:c(),value:o(),description:c().optional()}),Q_=y([`manual`]),$_=u({deviceId:i(),name:c(),location:c().nullable(),features:b(c()),producesTrackedEvents:x().optional()}),ev=u({deviceIds:b(i().int().positive()),trackedDeviceIds:b(i().int().positive()).optional()}),tv={id:`linked-devices`,label:`Linked devices`,description:`Companion devices of this camera: their controls appear with it, and the ones you opt in produce tracked events on it.`,shape:`association`,hostDeviceTypes:[E.Camera],sourceCaps:`any`,cardinality:`many`,value:ev},nv=u({deviceId:i(),mode:Q_,devices:b($_)}),rv=u({deviceId:i(),entries:b(u({capName:c(),kind:y([`native`,`wrapped`]),providerAddonId:c(),providerNodeId:c(),nativeAddonId:c()}))}),iv=f(`kind`,[u({kind:p(`value`),wrapperAddonId:c().nullable()}),u({kind:p(`missing`)}),u({kind:p(`failed`),error:c()})]),av=u({id:i(),stableId:c(),type:c(),name:c(),location:c().nullable(),disabled:x(),parentDeviceId:i().nullable(),role:c().nullable().optional()}),ov=u({id:i(),stableId:c(),addonId:c(),type:c(),name:c(),userNamed:x().optional(),location:c().nullable(),disabled:x(),parentDeviceId:i().nullable(),metadata:_(c(),o()).nullable().optional(),sourceInfo:Zg.optional(),integrationId:c().optional(),linkDeviceId:i().nullable().optional(),primaryChildEntityId:c().nullable().optional(),childLayout:b(K_).readonly().optional(),role:c().nullable().optional(),display:J_.optional()}),sv=o().nullable(),cv=u({streamId:c(),width:i().optional(),height:i().optional(),codec:c().optional(),fps:i().optional(),bitrateKbps:i().optional()}),lv=u({addonId:c(),stableId:c(),id:i(),type:c(),name:c(),location:c().nullable().optional(),disabled:x().optional(),parentDeviceId:i().nullable(),role:c().nullable().optional(),features:b(c()).optional(),config:_(c(),o())}),uv=u({deviceId:i()}),dv=u({deviceId:i(),data:_(c(),o())}),fv=y([`off`,`on`,`not-offered`,`unreachable`]),pv=u({deviceId:i(),switchId:Oo,outcome:fv,detail:c().optional()}),mv=u({sourceId:i(),targetId:i(),switches:b(pv).readonly(),sourceStillLive:b(Oo).readonly(),swapped:x()}),hv={name:`device-manager`,scope:`system`,mode:`singleton`,extensionSlots:[tv],methods:{allocateDeviceId:w(u({addonId:c(),stableId:c()}),u({id:i()}),{kind:`mutation`}),migrateDevice:w(u({sourceId:i(),targetId:i()}),mv,{kind:`mutation`,auth:`admin`,timeoutMs:12*6e4}),registerDevice:w(lv,g(),{kind:`mutation`}),removeDevice:w(uv,g(),{kind:`mutation`}),persistConfig:w(dv,g(),{kind:`mutation`,auth:`admin`}),loadConfig:w(u({deviceId:i()}),_(c(),o()),{auth:`admin`}),loadRuntimeState:w(u({deviceId:i()}),_(c(),o()),{auth:`admin`}),loadMeta:w(u({deviceId:i()}),ov.nullable()),setName:w(u({deviceId:i(),name:c()}),g(),{kind:`mutation`,auth:`admin`}),setLocation:w(u({deviceId:i(),location:c().nullable()}),g(),{kind:`mutation`,auth:`admin`}),setType:w(u({deviceId:i(),type:y(E)}),g(),{kind:`mutation`,auth:`admin`}),setIntegrationId:w(u({deviceId:i(),integrationId:c()}),g(),{kind:`mutation`,auth:`admin`}),setLinkDeviceId:w(u({deviceId:i(),linkDeviceId:i().nullable()}),g(),{kind:`mutation`,auth:`admin`}),setPrimaryChildEntityId:w(u({deviceId:i(),primaryChildEntityId:c().nullable()}),g(),{kind:`mutation`,auth:`admin`}),setChildLayout:w(u({deviceId:i(),childLayout:b(K_).readonly()}),g(),{kind:`mutation`,auth:`admin`}),setDisplay:w(u({deviceId:i(),display:J_.nullable()}),g(),{kind:`mutation`,auth:`admin`}),getRoleDisplayDefaults:w(u({}),u({defaults:_(c(),Y_)}),{kind:`query`}),setRoleDisplayDefaults:w(u({defaults:_(c(),Y_)}),g(),{kind:`mutation`,auth:`admin`}),getWireableFields:w(u({deviceId:i(),includeSynthesizable:x().optional()}),u({caps:b(u({cap:c(),fields:b(u({path:c(),kind:y([`string`,`number`,`boolean`,`enum`]),enumValues:b(c()).optional(),item:x().optional()})).readonly(),itemArray:u({path:c(),keyField:c()}).optional()})).readonly()}),{kind:`query`}),setRole:w(u({deviceId:i(),role:c().nullable()}),g(),{kind:`mutation`,auth:`admin`}),applyInitialMeta:w(u({deviceId:i(),name:c().optional(),location:c().nullable().optional(),type:y(E).optional(),integrationId:c().optional(),linkDeviceId:i().nullable().optional(),role:c().nullable().optional()}),g(),{kind:`mutation`,auth:`admin`}),setMetadata:w(u({deviceId:i(),patch:_(c(),o())}),g(),{kind:`mutation`,auth:`admin`}),listLocations:w(g(),b(c())),addLocation:w(u({name:c()}),g(),{kind:`mutation`,auth:`admin`}),removeLocation:w(u({name:c(),cascade:x().optional()}),g(),{kind:`mutation`,auth:`admin`}),renameLocation:w(u({from:c(),to:c()}),u({moved:i()}),{kind:`mutation`,auth:`admin`}),listLocationIcons:w(g(),b(M_)),setLocationIcon:w(u({location:c(),icon:j_.nullable()}),g(),{kind:`mutation`,auth:`admin`}),listLocationDescriptions:w(g(),b(I_)),setLocationDescription:w(u({location:c(),description:c().max(400).nullable()}),g(),{kind:`mutation`,auth:`admin`}),listSiteZones:w(g(),b(L_)),setSiteZone:w(u({name:c(),icon:j_.nullable().optional()}),g(),{kind:`mutation`,auth:`admin`}),removeSiteZone:w(u({name:c()}),g(),{kind:`mutation`,auth:`admin`}),renameSiteZone:w(u({from:c(),to:c()}),g(),{kind:`mutation`,auth:`admin`}),setLocationZone:w(u({location:c(),zone:c().nullable()}),g(),{kind:`mutation`,auth:`admin`}),setDisabled:w(u({deviceId:i(),disabled:x()}),g(),{kind:`mutation`,auth:`admin`}),listPersistedByAddon:w(u({addonId:c()}),b(av)),listAll:w(u({addonId:c().optional(),projection:y([`full`,`slim`]).optional(),isCamera:x().optional(),deviceIds:b(i()).optional()}),b(X_)),getDevice:w(u({deviceId:i()}),X_.nullable()),getChildren:w(u({parentDeviceId:i()}),b(X_)),getChildrenBatch:w(u({parentDeviceIds:b(i()).max(256)}),_(c(),b(X_))),getLinkedDevices:w(u({deviceId:i()}),u({mode:Q_,devices:b($_)})),getLinkedDevicesBatch:w(u({deviceIds:b(i())}),b(nv)),getStreamSources:w(u({deviceId:i()}),b(gt)),getConfigSchema:w(u({deviceId:i()}),b(Z_)),getSettingsSchema:w(u({deviceId:i()}),sv),updateConfig:w(u({deviceId:i(),values:_(c(),o())}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),enable:w(u({deviceId:i()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),disable:w(u({deviceId:i()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),remove:w(u({deviceId:i()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),removeByIntegration:w(u({integrationId:c()}),u({removed:i()}),{kind:`mutation`,auth:`admin`}),getStreamProfileMap:w(u({deviceId:i()}),_(c(),c().nullable())),setStreamProfileMap:w(u({deviceId:i(),profileMap:_(c(),c().nullable())}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),probeStreams:w(u({deviceId:i()}),b(cv),{kind:`mutation`,auth:`admin`}),getBindings:w(u({deviceId:i()}),rv),getBindingsBatch:w(u({deviceIds:b(i())}),b(rv)),getAllBindings:w(u({}),b(rv)),listDeviceIdsByCaps:w(u({capNames:b(c().min(1)).min(1).max(16)}),b(i())),setWrapperActive:w(u({deviceId:i(),capName:c(),wrapperAddonId:c(),active:x()}),g(),{kind:`mutation`,auth:`admin`}),getWrapperActivation:w(u({deviceId:i(),capName:c().min(1)}),iv),listWrappersForCap:w(u({capName:c()}),b(c())),listBindableCapsForDeviceType:w(u({deviceType:c()}),b(u({capName:c(),wrappers:b(c())}))),getDeviceSettingsAggregate:w(u({deviceId:i()}),Wd.nullable()),getDeviceLiveInfoAggregate:w(u({deviceId:i()}),Wd.nullable()),getDeviceAggregate:w(u({deviceId:i()}),u({settings:Wd.nullable(),live:Wd.nullable()})),runDeviceAction:w(u({deviceId:i().int().nonnegative(),action:c().min(1),input:o()}),o(),{kind:`mutation`}),updateDeviceField:w(u({deviceId:i(),writerCapName:c(),writerAddonId:c(),key:c(),value:o()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),updateDeviceFieldsBatch:w(u({deviceId:i(),changes:b(u({writerCapName:c(),writerAddonId:c(),key:c(),value:o()}))}),u({success:p(!0),failures:b(u({writerCapName:c(),writerAddonId:c(),error:c()}))}),{kind:`mutation`,auth:`admin`}),discoverDevices:w(u({addonId:c()}),b(V_),{kind:`mutation`,auth:`admin`}),adoptDevice:w(u({addonId:c(),candidate:V_,integrationId:c().optional()}),H_,{kind:`mutation`,auth:`admin`}),getCreationSchema:w(u({addonId:c(),type:y(E)}),o().nullable()),createDevice:w(u({addonId:c(),type:y(E),config:_(c(),o()),integrationId:c().optional()}),H_,{kind:`mutation`,auth:`admin`}),testCreationField:w(u({addonId:c(),type:y(E),key:c(),value:o(),formValues:_(c(),o()).optional()}),U_,{kind:`mutation`,auth:`admin`}),adoptionListCandidateFilters:w(u({addonId:c(),integrationId:c()}),u({filters:b(s_)}),{auth:`admin`}),adoptionListCandidates:w(l_.extend({addonId:c()}),u_,{auth:`admin`}),adoptionRefresh:w(u({addonId:c(),integrationId:c()}),f_,{kind:`mutation`,auth:`admin`}),adoptionAdopt:w(m_.extend({addonId:c()}),h_,{kind:`mutation`,auth:`admin`}),adoptionRelease:w(g_.extend({addonId:c()}),g(),{kind:`mutation`,auth:`admin`}),adoptionStartJob:w(m_.extend({addonId:c()}),u({jobId:c()}),{kind:`mutation`,auth:`admin`}),adoptionListJobs:w(u({addonId:c(),integrationId:c().optional()}),b(Eo).readonly(),{auth:`admin`}),adoptionCancelJob:w(u({jobId:c()}),u({cancelled:x()}),{kind:`mutation`,auth:`admin`}),adoptionResync:w(__,v_,{kind:`mutation`,auth:`admin`}),discoveryProviders:w(u({}),u({providers:b(u({addonId:c(),label:c()})).readonly()}),{auth:`admin`}),discoverAllProviders:w(u({}),u({groups:b(u({addonId:c(),label:c(),candidates:b(V_).readonly(),error:c().nullable()})).readonly()}),{kind:`mutation`,auth:`admin`}),discoverProvider:w(u({addonId:c(),params:_(c(),o()).optional()}),u({candidates:b(V_).readonly()}),{kind:`mutation`,auth:`admin`}),providerCreationType:w(u({addonId:c()}),u({deviceType:y(E).nullable()}),{auth:`admin`}),providerDiscoveryParamsSchema:w(u({addonId:c()}),o(),{auth:`admin`}),testField:w(u({deviceId:i(),key:c(),value:o()}),U_,{kind:`mutation`,auth:`admin`}),getDeviceStatusAggregate:w(u({deviceId:i(),caps:b(c()).readonly().optional()}),_(c(),o().nullable())),getDeviceStatusAggregateBatch:w(u({deviceIds:b(i()).readonly(),caps:b(c()).readonly().optional()}),_(c(),_(c(),o().nullable())))}},gv=[`linked-devices`],_v=y(gv),vv={"linked-devices":{descriptor:tv,declaringCap:`device-manager`,hostDeviceTypes:[E.Camera]}},yv=f(`slot`,[ev.extend({slot:p(`linked-devices`)})]),bv=[E.Camera],xv=`:`,Sv=`listSlots`,Cv=f(`state`,[u({state:p(`ok`)}),u({state:p(`unreachable`),reason:c()})]),wv=u({source:c(),label:c(),addonId:c().optional(),availability:Cv}),Tv=y([`ok`,`missing`,`foreign`,`unavailable`]),Ev=u({deviceId:i().int(),name:c().nullable(),health:Tv,detail:c().optional()}),Dv=u({state:y([`active`,`inactive`,`unknown`]),authority:c(),detail:c().optional()}),Ov=u({state:p(`ok`),slotRef:c(),slot:_v,authority:c(),activation:Dv.nullable(),value:yv,sources:b(Ev),impliedSources:b(Ev).optional()}),kv=u({state:p(`unreachable`),addonId:c(),reason:c()}),Av=f(`state`,[Ov,kv]);function jv(e,t){return{state:`unreachable`,addonId:e,reason:t}}var Mv=u({deviceId:i().int(),name:c(),type:c(),location:c().nullable(),parentName:c().nullable(),suggested:x(),reason:c().nullable()}),Nv=u({candidates:b(Mv)}),Pv=u({applied:p(!0),reload:y([`none`,`host`,`parent`])}),Fv=u({deviceId:i().int(),slotRef:c().min(1)}),Iv=Fv.extend({value:yv}),Lv={name:`device-extension`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:bv,deviceConfig:{ui:{kind:`widget`,widgetId:`host/extensions-panel`,tab:`general`,label:`Extensions`,order:72}},methods:{listSources:w(u({deviceId:i().int()}),b(wv)),listSlots:w(u({deviceId:i().int()}),b(Av)),listCandidates:w(Fv,Nv),setSlot:w(Iv,Pv,{kind:`mutation`,auth:`admin`})}},Rv=y([`replace`,`add`]),zv=f(`ok`,[u({ok:p(!0),changed:x()}),u({ok:p(!1),code:y([`owned-by-other`,`not-claimed`,`field-not-claimed`,`invalid-slice`,`unknown-device`,`row-unreadable`,`migration-in-flight`]),message:c()})]),Bv=u({deviceId:i(),capName:c(),owner:c().min(1),mode:Rv,fields:b(c().min(1)).min(1)}),Vv=f(`state`,[u({state:p(`loaded`),claims:b(Bv)}),u({state:p(`not-loaded`),reason:c()})]),Hv={name:`device-state`,scope:`system`,mode:`singleton`,methods:{getSnapshot:w(u({deviceId:i()}),_(c(),_(c(),o()))),getCapSlice:w(u({deviceId:i(),capName:c()}),_(c(),o()).nullable()),getAllSnapshots:w(u({}),_(c(),_(c(),_(c(),o())))),setCapSlice:w(u({deviceId:i(),capName:c(),slice:_(c(),o())}),g(),{kind:`mutation`}),claimFields:w(u({deviceId:i(),capName:c(),owner:c().min(1),mode:Rv,fields:b(c().min(1)).min(1),values:_(c(),o())}),zv,{kind:`mutation`,auth:`admin`}),patchOwnedFields:w(u({deviceId:i(),capName:c(),owner:c().min(1),values:_(c(),o())}),zv,{kind:`mutation`,auth:`admin`}),releaseClaim:w(u({deviceId:i(),capName:c(),owner:c().min(1)}),zv,{kind:`mutation`,auth:`admin`}),listClaims:w(u({ownerPrefix:c().optional()}),Vv,{auth:`admin`}),getNativeCapSlice:w(u({deviceId:i(),capName:c()}),_(c(),o()).nullable(),{auth:`admin`})},events:{onChanged:Qt(u({deviceId:i(),capName:c(),slice:_(c(),o())}))}},Uv=u({embedding:b(i()),inferenceMs:i()}),Wv=y([`image`,`text`]),Gv=u({modelId:c(),tower:Wv,nodeId:c(),crashes:i(),windowMs:i(),sinceMs:i(),lastReason:c()}),Kv=u({modelId:c(),tower:Wv,nodeId:c(),attempts:i(),sinceMs:i(),lastReason:c()}),qv=u({modelId:c(),embeddingDim:i(),ready:x(),nodeId:c().optional(),failedModels:b(Gv).optional(),failedRequirements:b(Kv).optional()}),Jv=`embedding-model-failed`,Yv=`embedding-requirements-unavailable`,Xv=`embedding-requirements-failed`,Zv=y([Jv,Yv,Xv]);function Qv(e,t){return`[${e} model=${t.modelId} tower=${t.tower} node=${t.nodeId}]`}function $v(e){return Error(`${Qv(Jv,e)} ${e.modelId} (${e.tower} tower) crashed ${String(e.crashes)} times in ${String(Math.round(e.windowMs/1e3))}s on ${e.nodeId} — ${e.lastReason}. Cleared by embeddingEncoder.resetFailedModels({ modelId: "${e.modelId}", nodeId: "${e.nodeId}" }) or a model change.`)}function ey(e,t){return Error(`${Qv(Yv,e)} ${e.modelId} (${e.tower} tower) on ${e.nodeId}: ${t}`)}function ty(e){return Error(`${Qv(Xv,e)} ${e.modelId} (${e.tower} tower) on ${e.nodeId}: requirements can never be met — ${String(e.attempts)} attempts, last: ${e.lastReason}. Cleared by embeddingEncoder.resetFailedModels({ modelId: "${e.modelId}", nodeId: "${e.nodeId}" }) or a model change.`)}var ny=RegExp(`\\[(${Jv}|${Yv}|${Xv}) model=([^\\s\\]]+) tower=(image|text) node=([^\\s\\]]+)\\]`);function ry(e){let t=e instanceof Error?e.message:String(e),n=ny.exec(t);if(n===null)return null;let r=Zv.safeParse(n[1]),i=Wv.safeParse(n[3]);return!r.success||!i.success||n[2]===void 0||n[4]===void 0?null:{code:r.data,modelId:n[2],tower:i.data,nodeId:n[4]}}function iy(e){return ay(e)!==null}function ay(e){let t=ry(e);if(t===null||t.code!==`embedding-model-failed`)return null;let{modelId:n,tower:r,nodeId:i}=t;return{modelId:n,tower:r,nodeId:i}}var oy={name:`embedding-encoder`,scope:`system`,mode:`collection`,internal:!0,methods:{encode:w(u({crop:v(Uint8Array),width:i(),height:i()}),Uv,{auth:`admin`}),encodeText:w(u({text:c(),modelId:c().min(1).optional()}),Uv,{auth:`admin`}),getInfo:w(g(),qv,{auth:`admin`}),resetFailedModels:w(u({modelId:c().min(1).optional()}),u({cleared:b(c()),nodeId:c()}),{kind:`mutation`,auth:`admin`})}},sy=u({reason:c(),count:i().int().nonnegative()}),cy=u({family:c(),deviceId:i().int().positive(),variant:c().optional(),sinceMs:i(),atMs:i(),attempts:i().int().nonnegative(),succeeded:i().int().nonnegative(),reasons:b(sy).readonly()}),ly={name:`failure-contribution`,scope:`system`,mode:`collection`,internal:!0,methods:{list:w(g(),b(cy).readonly())},mount:{kind:`skip`}},uy=u({name:c(),path:c()}),dy=u({path:c(),entries:b(uy).readonly(),freeBytes:i(),totalBytes:i()}),fy={name:`filesystem-browse`,scope:`system`,mode:`singleton`,internal:!0,methods:{listAllowedRoots:w(g(),b(c()).readonly(),{auth:`admin`}),browse:w(u({path:c()}),dy,{auth:`admin`}),createDir:w(u({path:c()}),u({path:c()}),{kind:`mutation`,auth:`admin`})}},py=6e5,my=60*6e4,hy=u({inputTokens:i(),outputTokens:i()}),gy=y([`timeout`,`rate-limited`,`auth`,`refusal`,`bad-request`,`unavailable`,`no-profile`,`budget-exceeded`,`adapter-error`]),_y=u({ok:p(!0),text:c(),model:c(),usage:hy,truncated:x(),latencyMs:i()}),vy=y([`guardrail`,`model`]),yy=u({ok:p(!1),code:gy,message:c(),retryAfterMs:i().optional(),refusalSource:vy.optional()}),by=f(`ok`,[_y,yy]),xy=u({bytes:v(Uint8Array),mimeType:c()}),Sy=u({enabled:x().default(!1),maxAttempts:i().int().min(1).max(5).default(1)}),Cy={totalMs:6e4,connectMs:1e4,firstTokenMs:12e4,idleMs:6e4},wy=u({addonId:c().optional(),profileId:c().optional(),consumer:c(),system:c().optional(),prompt:c(),jsonSchema:_(c(),o()).optional(),maxTokens:i().int().positive().optional(),temperature:i().optional(),topP:i().min(0).max(1).optional(),topK:i().int().positive().optional(),timeoutMs:i().int().positive().optional(),retry:Sy.optional(),requestId:c().optional()}),Ty=u({url:c(),filename:c(),sizeBytes:i(),sha256:c().optional()}),Ey=f(`kind`,[u({kind:p(`catalog`),catalogId:c()}),u({kind:p(`url`),url:c(),sha256:c().optional(),label:c().optional(),sizeBytes:i().optional(),extraFiles:b(Ty).optional()}),u({kind:p(`path`),path:c()})]),Dy=u({nodeId:c(),engine:y([`llama-cpp`]),model:Ey,contextSize:i().int().default(4096),gpuLayers:i().int().default(0),threads:i().int().optional(),parallel:i().int().default(1),batchSize:i().int().positive().optional(),ubatchSize:i().int().positive().optional(),flashAttention:x().default(!1),mlock:x().default(!1),noMmap:x().default(!1),cacheTypeK:y([`f32`,`f16`,`q8_0`,`q5_1`,`q5_0`,`q4_1`,`q4_0`]).optional(),cacheTypeV:y([`f32`,`f16`,`q8_0`,`q5_1`,`q5_0`,`q4_1`,`q4_0`]).optional(),extraArgs:b(c()).default([]),autoStart:x().default(!1),idleStopMinutes:i().int().default(30)}),Oy=u({phase:y([`downloading`,`verifying`]),file:c(),fileIndex:i().int(),fileCount:i().int(),downloadedBytes:i(),totalBytes:i().optional()}),ky=u({nodeId:c(),state:y([`stopped`,`downloading`,`starting`,`ready`,`crashed`,`failed`]),pid:i().optional(),port:i().optional(),modelPath:c().optional(),modelId:c().optional(),downloadProgress:i().min(0).max(1).optional(),download:Oy.optional(),lastError:c().optional(),crashesInWindow:i(),memoryBytes:i().optional(),vramBytes:i().optional()}),Ay=u({file:c(),sizeBytes:i(),catalogId:c().optional(),installedAt:i().optional(),path:c().optional()}),jy=u({nodeId:c(),modelsBytes:i(),freeBytes:i().optional()}),My=wy.extend({images:b(xy).optional(),runtime:Dy,timeoutMs:i().int().positive().optional()}),Ny=y([`deviceNotEligible`,`appleIntelligenceNotEnabled`,`modelNotReady`,`osTooOld`,`helperMissing`,`helperCrashed`]),Py=f(`state`,[u({state:p(`available`),osVersion:c(),contextSize:i().int().positive(),languages:b(c()),imageInput:x()}),u({state:p(`unavailable`),reason:Ny,osVersion:c().nullable(),detail:c()}),u({state:p(`unsupported-platform`),platform:c()}),u({state:p(`unknown`),error:c()})]),Fy=wy.extend({images:b(xy).optional(),timeoutMs:i().int().positive().optional()}),Iy=u({requestId:c()}),Ly={name:`llm-runtime`,scope:`system`,mode:`singleton`,internal:!0,methods:{complete:w(My,by,{kind:`mutation`,auth:`admin`,timeoutMs:py}),ensureStarted:w(u({runtime:Dy}),ky,{kind:`mutation`,auth:`admin`,timeoutMs:py}),stop:w(u({}),g(),{kind:`mutation`,auth:`admin`}),status:w(u({}),ky,{auth:`admin`}),installModel:w(u({model:Ey}),g(),{kind:`mutation`,auth:`admin`,timeoutMs:my}),deleteModel:w(u({file:c()}),g(),{kind:`mutation`,auth:`admin`}),listLocalModels:w(u({}),b(Ay),{auth:`admin`}),getDiskUsage:w(u({}),jy,{auth:`admin`}),cancel:w(Iy,g(),{kind:`mutation`,auth:`admin`}),appleAvailability:w(u({}),Py,{auth:`admin`}),completeApple:w(Fy,by,{kind:`mutation`,auth:`admin`,timeoutMs:py})}},Ry=y([`openai-compatible`,`openai`,`anthropic`,`google`,`managed-local`,`apple-foundation`]),zy=u({id:c(),name:c(),kind:Ry,addonId:c(),enabled:x(),model:c(),baseUrl:c().optional(),apiKey:c().optional(),supportsVision:x(),temperature:i().min(0).max(2).optional(),topP:i().min(0).max(1).optional(),topK:i().int().positive().optional(),maxTokens:i().int().positive().optional(),contextLength:i().int().positive().optional(),systemPrompt:c().optional(),timeoutMs:i().int().positive().default(6e4),connectTimeoutMs:i().int().positive().default(1e4),firstTokenTimeoutMs:i().int().positive().default(12e4),idleTimeoutMs:i().int().positive().default(6e4),retry:Sy.default({enabled:!1,maxAttempts:1}),toolsEnabled:x().default(!1),extraHeaders:_(c(),c()).optional(),runtime:Dy.optional(),appleFoundation:u({nodeId:c()}).optional()}),By=o(),Vy=u({kind:Ry,label:c(),icon:c(),addonId:c(),configSchema:By}),Hy=d([u({consumer:c()}),u({purpose:y([`text`,`vision`])})]),Uy=u({selector:Hy,profileId:c()}),Wy=u({day:c(),consumer:c(),profileId:c(),calls:i(),okCalls:i(),errorCalls:i(),inputTokens:i(),outputTokens:i(),avgLatencyMs:i()}),Gy=u({id:c(),label:c(),family:c(),purpose:y([`text`,`vision`]),url:c(),sha256:c(),sizeBytes:i(),quantization:c(),minRamBytes:i(),contextSizeDefault:i().int(),mmprojUrl:c().optional()}),Ky=f(`ok`,[u({ok:p(!0),model:Ey,label:c(),repo:c(),quantization:c(),purpose:y([`text`,`vision`]),totalBytes:i(),extraFilenames:b(c())}),u({ok:p(!1),code:c(),message:c(),candidates:b(c()).optional(),requiredBytes:i().optional()})]),qy=u({nodeId:c(),reachable:x(),status:ky.optional(),disk:jy.optional(),error:c().optional(),apple:Py.optional()}),Jy=wy.extend({images:b(xy).min(1)}),Yy=u({addonId:c(),profileId:c()}),Xy={name:`llm`,scope:`system`,mode:`collection`,internal:!1,providerKind:`ai`,nodeIdMode:`data`,methods:{generate:w(wy,by,{kind:`mutation`,timeoutMs:py}),generateVision:w(Jy,by,{kind:`mutation`,timeoutMs:py}),cancel:w(u({addonId:c().optional(),requestId:c()}),g(),{kind:`mutation`}),listProfileKinds:w(u({}),b(Vy)),listProfiles:w(u({}),b(zy)),upsertProfile:w(u({profile:zy}),zy,{kind:`mutation`,auth:`admin`}),deleteProfile:w(Yy,g(),{kind:`mutation`,auth:`admin`}),testProfile:w(Yy,by,{kind:`mutation`,auth:`admin`,timeoutMs:py}),listModels:w(Yy,b(c())),getDefaults:w(u({}),b(Uy)),setDefault:w(u({selector:Hy,profileId:c().nullable()}),g(),{kind:`mutation`,auth:`admin`}),getUsage:w(u({since:i().optional(),until:i().optional(),consumer:c().optional(),profileId:c().optional()}),b(Wy)),listModelCatalog:w(u({}),b(Gy)),listRuntimeNodes:w(u({}),b(qy)),listNodeModels:w(u({nodeId:c()}),b(Ay)),resolveModelRef:w(u({ref:c(),maxBytes:i().positive().optional()}),Ky,{kind:`mutation`,auth:`admin`}),installModel:w(u({nodeId:c(),model:Ey}),g(),{kind:`mutation`,auth:`admin`}),deleteModel:w(u({nodeId:c(),file:c()}),g(),{kind:`mutation`,auth:`admin`}),getRuntimeStatus:w(Yy,ky),startRuntime:w(Yy,ky,{kind:`mutation`,auth:`admin`}),stopRuntime:w(Yy,g(),{kind:`mutation`,auth:`admin`})}},Zy=[`decode`,`transcode`,`recording`,`streaming`,`detection`],Qy=[`measured`,`accounted`,`unattributable`],$y=u({role:y(Zy),deviceId:i().int().positive().nullable(),attribution:y(Qy),unit:c(),pid:i().int().positive().optional(),startedAtMs:i().optional(),cpuSeconds:i().optional(),rssBytes:i().optional()}),eb={name:`load-contribution`,scope:`system`,mode:`collection`,internal:!0,methods:{list:w(g(),b($y).readonly())},mount:{kind:`skip`}},tb=u({armed:i().int().min(0),unknown:b(c()).readonly()}),nb={name:`log-channels`,scope:`system`,mode:`collection`,internal:!0,methods:{list:w(g(),b(Ul).readonly()),apply:w(u({windows:b(Wl).readonly()}),tb,{kind:`mutation`})},mount:{kind:`skip`}},rb=y([`debug`,`info`,`warn`,`error`]),ib=u({timestamp:he(),level:rb,scope:b(c()),message:c(),meta:_(c(),o()).optional(),tags:_(c(),c()).optional()}),ab={name:`log-destination`,scope:`system`,mode:`collection`,internal:!0,methods:{write:w(ib,g(),{kind:`mutation`}),query:w(u({scope:b(c()).optional(),level:rb.optional(),since:he().optional(),until:he().optional(),limit:i().optional(),tags:_(c(),c()).optional()}),b(ib).readonly())},mount:{kind:`skip`}},ob=y([`primary`,`second-factor`]),sb=u({kind:p(`redirect`),id:c(),label:c(),icon:c().optional(),startUrl:c(),stage:ob}),cb=u({kind:p(`widget`),id:c(),addonId:c(),bundle:c(),remote:Xd,stage:ob}),lb=u({kind:p(`passkey`),id:c(),label:c(),stage:ob,rpId:c(),origin:c().nullable()}),ub=f(`kind`,[sb,cb,lb]),db={name:`login-method`,scope:`system`,mode:`collection`,internal:!0,methods:{getLoginMethods:w(g(),b(ub).readonly())},mount:{kind:`skip`}},fb=u({total:i(),user:i(),system:i(),irq:i(),nice:i(),loadAvg:l([i(),i(),i()]),cores:i()}),pb=u({percent:i(),totalBytes:i(),usedBytes:i(),availableBytes:i(),swapUsedBytes:i(),swapTotalBytes:i()}),mb=u({readBytes:i(),writeBytes:i(),readOps:i(),writeOps:i(),timestampMs:i()}),hb=u({rxBytes:i(),txBytes:i(),rxPackets:i(),txPackets:i(),rxErrors:i(),txErrors:i(),timestampMs:i()}),gb=u({utilization:i(),model:c(),memoryUsedBytes:i(),memoryTotalBytes:i(),temperature:i().nullable()}),_b=u({openFds:i(),threadCount:i(),activeHandles:i(),activeRequests:i()}),vb=u({avg10:i(),avg60:i(),avg300:i()}),yb=u({some:vb,full:vb.nullable()}),bb=u({cpu:fb,memory:pb,gpu:gb.nullable(),network:hb,disk:mb,pressure:u({cpu:yb.nullable(),memory:yb.nullable(),io:yb.nullable()}),process:_b,cpuTemperature:i().nullable(),timestampMs:i()}),xb=u({path:c(),totalBytes:i(),usedBytes:i(),availableBytes:i(),percent:i()}),Sb=u({pid:i(),cpu:i(),memory:i(),privateBytes:i().optional(),sharedBytes:i().optional()}),Cb=u({addonId:c(),nodeId:c(),role:y([`hub`,`worker`]),pid:i(),state:y([`starting`,`running`,`stopping`,`stopped`,`crashed`]),uptimeSec:i()}),wb=u({pid:i(),ppid:i(),pgid:i(),classification:y([`root`,`managed`,`system`]),addonId:c().nullable(),nodeId:c().nullable(),command:c(),cpuPercent:i(),memoryRssBytes:i(),cpuMainPercent:i().nullable(),cpuGcPercent:i().nullable(),threadCount:i().nullable(),uptimeSec:i()}),Tb=u({source:y([`cgroup-v2`,`cgroup-v1`]),currentBytes:i(),limitBytes:i().nullable(),anonBytes:i().nullable(),fileBytes:i().nullable(),shmemBytes:i().nullable(),slabBytes:i().nullable(),gpuShmemBytes:i().nullable()}).extend({atMs:i()}),Eb=u({atMs:i(),samples:i().int(),cpuMainPercent:i().nullable(),cpuMainPercentMin:i().nullable(),cpuGcPercent:i().nullable(),cpuGcPercentMin:i().nullable(),cpuLifetimePercent:i(),cpuLifetimePercentMin:i(),memoryRssBytes:i(),memoryRssBytesMin:i(),processCount:i().int(),processCountMin:i().int()}),Db=u({key:c(),kind:y([`addon`,`root`,`unattributed`]),points:b(Eb).readonly()}),Ob=u({nodeId:c(),series:b(Db).readonly(),containerMemory:b(Tb).readonly(),bucketMs:i(),retainedSamples:i(),oldestAtMs:i().nullable(),cadenceMs:i(),durable:x()}),kb=u({forNodeId:c(),sinceMs:i().optional(),maxPoints:i().int().positive().optional()}),Ab=u({cpuPercent:i(),memoryPercent:i(),memoryUsedMB:i(),memoryTotalMB:i(),diskPercent:i().optional(),temperature:i().optional(),gpuPercent:i().optional(),gpuMemoryPercent:i().optional()}),jb={name:`metrics-provider`,scope:`system`,mode:`singleton`,methods:{collectSnapshot:w(g(),bb),getCached:w(g(),bb.nullable()),getCurrent:w(g(),Ab),getDiskSpace:w(u({dirPath:c()}),xb),getGpuInfo:w(g(),gb.nullable()),getCpuTemperature:w(g(),i().nullable()),getProcessStats:w(u({pids:b(i())}),b(Sb)),listAddonInstances:w(g(),b(Cb).readonly()),getAddonStats:w(u({addonId:c()}),Sb.nullable()),listNodeProcesses:w(g(),b(wb).readonly()),getLoadSeries:w(kb,Ob)}},Mb=u({sourceUrl:c(),metadata:nd,targets:b(td).min(1).readonly(),calibrationRef:c().optional(),sessionId:c().optional()}),Nb={name:`model-convert`,scope:`system`,mode:`singleton`,internal:!0,methods:{convert:w(Mb,id,{kind:`mutation`,auth:`admin`,timeoutMs:6e5})}},Pb=u({nodeId:c(),modelId:c(),format:y(Wu),entry:ed}),Fb=u({ok:x(),sha256:c(),bytes:i(),path:c()}),Ib={name:`model-distributor`,scope:`system`,mode:`singleton`,internal:!0,methods:{distributeModel:w(Pb,Fb,{kind:`mutation`,auth:`admin`})}},Lb=u({bbox:uf,pixelCount:i(),intensity:i()}),Rb=u({detected:x(),regionCount:i(),regions:b(Lb).readonly(),rawRegions:b(Lb).readonly(),frameWidth:i(),frameHeight:i(),analysisMs:i()}),zb={name:`motion-detection`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[E.Camera],exposesDeviceSettings:!0,methods:{analyze:w(u({deviceId:i(),frame:lf.optional(),frameHandle:C.optional()}),Rb,{kind:`mutation`}),removeCamera:w(u({deviceId:i()}),g(),{kind:`mutation`}),reset:w(g(),g(),{kind:`mutation`})},events:{onMotion:{data:u({deviceId:i(),detected:x(),regionCount:i()})}}},Bb=y([`external`,`embedded`]),Vb=y([`connected`,`disconnected`,`auth-failed`,`unreachable`,`tls-error`]),Hb=u({id:c(),name:c(),url:c(),kind:Bb,status:Vb,latencyMs:i().nullable(),error:c().optional(),connectedClients:i().int().nonnegative().optional(),lastCheckedAt:i().optional()}),Ub=u({url:c(),username:c().optional(),password:c().optional(),clientIdPrefix:c().optional()}),Wb=u({name:c().min(1),url:c().regex(/^(mqtt|mqtts|ws|wss):\/\//,`URL must start with mqtt(s):// or ws(s)://`),username:c().optional(),password:c().optional(),clientIdPrefix:c().optional()}),Gb=u({id:c()}),Kb=u({id:c()}),qb=f(`ok`,[u({ok:p(!0),latencyMs:i()}),u({ok:p(!1),error:c()})]),Jb=u({port:i().int().min(1).max(65535).default(1883),allowAnonymous:x().default(!1),username:c().optional(),password:c().optional()}),Yb=u({id:c(),url:c()}),Xb=u({brokerCount:i(),embeddedRunning:x()}),Zb={name:`mqtt-broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:Xb,kind:`poll`},methods:{listBrokers:w(g(),b(Hb)),getBrokerConfig:w(Kb,Ub,{auth:`admin`}),addBroker:w(Wb,Gb,{kind:`mutation`,auth:`admin`}),removeBroker:w(Kb,g(),{kind:`mutation`,auth:`admin`}),testConnection:w(Kb,qb,{kind:`mutation`,auth:`admin`}),startEmbeddedBroker:w(Jb,Yb,{kind:`mutation`,auth:`admin`}),stopEmbeddedBroker:w(Kb,g(),{kind:`mutation`,auth:`admin`}),getStatus:w(g(),Xb)}},Qb=u({url:c(),hostname:c(),port:i(),protocol:y([`http`,`https`])}),$b=u({connected:x(),endpoint:Qb.nullable(),error:c().optional()}),ex=Qb.extend({id:c(),label:c(),mode:c().optional(),sourcePort:i().optional()}),tx={name:`network-access`,scope:`system`,mode:`collection`,providerKind:`ingress`,methods:{start:w(g(),Qb,{kind:`mutation`}),stop:w(g(),g(),{kind:`mutation`}),getEndpoint:w(g(),Qb.nullable()),getStatus:w(g(),$b),listEndpoints:w(g(),b(ex).readonly())}},nx=y([`image`,`video`,`gif`,`audio`,`icon`]),rx=u({mediaType:nx,url:c().optional(),bytes:v(Uint8Array).optional(),mime:c().optional(),name:c().optional()}).refine(e=>e.url!==void 0||e.bytes!==void 0,{message:"Attachment requires either `url` or `bytes`"}),ix=y([`text`,`markdown`,`html`]),ax=y([`acknowledge`,`dismiss`,`silence`,`snooze`,`view`,`play`,`open`,`close`,`lock`,`unlock`,`arm`,`arm-home`,`arm-away`,`arm-night`,`disarm`,`light`,`alert`,`camera`]),ox=u({id:c(),label:c(),url:c().optional(),icon:ax.optional(),destructive:x().optional(),mode:y([`navigate`,`background`]).optional()}),sx=u({body:c(),title:c().optional(),format:ix.default(`text`),priority:i().int().min(1).max(5).default(3),level:c().optional(),attachments:b(rx).optional(),clickUrl:c().optional(),actions:b(ox).optional(),sound:c().optional(),ttl:i().optional(),tag:c().optional(),deviceId:i().optional(),eventId:c().optional(),metadata:_(c(),o()).optional()}),cx=u({id:c(),label:c(),ordinal:i().int().min(1).max(5).nullable(),flags:u({critical:x().optional(),silent:x().optional(),noPush:x().optional()}).optional(),requires:b(c()).optional(),description:c().optional()}),lx=u({attachments:u({mediaTypes:b(nx),mode:y([`url`,`bytes`,`both`]),max:i().int().nonnegative(),maxBytes:i().int().positive().optional()}),actions:i().int().nonnegative(),actionIcons:x().optional(),levels:b(cx),format:b(ix),clickUrl:x(),sound:x(),ttl:x(),bodyMaxLen:i().int().positive()}),ux=o(),dx=u({kind:c(),label:c(),icon:c(),addonId:c(),iconUrl:c().optional(),iconMediaType:c().optional(),configSchema:ux,destinationKeys:b(c()).optional(),supportsDiscovery:x(),caps:lx}),fx=u({id:c(),name:c(),kind:c(),addonId:c(),enabled:x(),config:_(c(),o())}),px=u({kind:c(),suggestedName:c(),config:_(c(),o())}),mx=u({level:c(),format:ix,attachmentsSent:i().int().nonnegative(),actionsSent:i().int().nonnegative(),truncated:x(),dropped:b(c())}),hx=u({success:x(),error:c().optional(),renderedAs:mx.optional()}),gx=hx,_x={name:`notification-output`,scope:`system`,mode:`collection`,methods:{listTargetKinds:w(u({}),b(dx)),listTargets:w(u({}),b(fx),{auth:`admin`}),discoverTargets:w(u({kind:c(),config:_(c(),o()).optional()}),b(px),{auth:`admin`}),send:w(u({targetId:c(),notification:sx}),hx,{kind:`mutation`,auth:`admin`}),testTarget:w(u({targetId:c(),sample:sx.optional()}),gx,{kind:`mutation`,auth:`admin`}),upsertTarget:w(u({target:fx}),fx,{kind:`mutation`,auth:`admin`}),deleteTarget:w(u({targetId:c()}),g(),{kind:`mutation`,auth:`admin`}),setTargetEnabled:w(u({targetId:c(),enabled:x()}),g(),{kind:`mutation`,auth:`admin`})}},vx=[{id:`person`,name:`Person`},{id:`bicycle`,name:`Bicycle`},{id:`car`,name:`Car`},{id:`motorcycle`,name:`Motorcycle`},{id:`airplane`,name:`Airplane`},{id:`bus`,name:`Bus`},{id:`train`,name:`Train`},{id:`truck`,name:`Truck`},{id:`boat`,name:`Boat`},{id:`traffic light`,name:`Traffic Light`},{id:`fire hydrant`,name:`Fire Hydrant`},{id:`stop sign`,name:`Stop Sign`},{id:`parking meter`,name:`Parking Meter`},{id:`bench`,name:`Bench`},{id:`bird`,name:`Bird`},{id:`cat`,name:`Cat`},{id:`dog`,name:`Dog`},{id:`horse`,name:`Horse`},{id:`sheep`,name:`Sheep`},{id:`cow`,name:`Cow`},{id:`elephant`,name:`Elephant`},{id:`bear`,name:`Bear`},{id:`zebra`,name:`Zebra`},{id:`giraffe`,name:`Giraffe`},{id:`backpack`,name:`Backpack`},{id:`umbrella`,name:`Umbrella`},{id:`handbag`,name:`Handbag`},{id:`tie`,name:`Tie`},{id:`suitcase`,name:`Suitcase`},{id:`frisbee`,name:`Frisbee`},{id:`skis`,name:`Skis`},{id:`snowboard`,name:`Snowboard`},{id:`sports ball`,name:`Sports Ball`},{id:`kite`,name:`Kite`},{id:`baseball bat`,name:`Baseball Bat`},{id:`baseball glove`,name:`Baseball Glove`},{id:`skateboard`,name:`Skateboard`},{id:`surfboard`,name:`Surfboard`},{id:`tennis racket`,name:`Tennis Racket`},{id:`bottle`,name:`Bottle`},{id:`wine glass`,name:`Wine Glass`},{id:`cup`,name:`Cup`},{id:`fork`,name:`Fork`},{id:`knife`,name:`Knife`},{id:`spoon`,name:`Spoon`},{id:`bowl`,name:`Bowl`},{id:`banana`,name:`Banana`},{id:`apple`,name:`Apple`},{id:`sandwich`,name:`Sandwich`},{id:`orange`,name:`Orange`},{id:`broccoli`,name:`Broccoli`},{id:`carrot`,name:`Carrot`},{id:`hot dog`,name:`Hot Dog`},{id:`pizza`,name:`Pizza`},{id:`donut`,name:`Donut`},{id:`cake`,name:`Cake`},{id:`chair`,name:`Chair`},{id:`couch`,name:`Couch`},{id:`potted plant`,name:`Potted Plant`},{id:`bed`,name:`Bed`},{id:`dining table`,name:`Dining Table`},{id:`toilet`,name:`Toilet`},{id:`tv`,name:`TV`},{id:`laptop`,name:`Laptop`},{id:`mouse`,name:`Mouse`},{id:`remote`,name:`Remote`},{id:`keyboard`,name:`Keyboard`},{id:`cell phone`,name:`Cell Phone`},{id:`microwave`,name:`Microwave`},{id:`oven`,name:`Oven`},{id:`toaster`,name:`Toaster`},{id:`sink`,name:`Sink`},{id:`refrigerator`,name:`Refrigerator`},{id:`book`,name:`Book`},{id:`clock`,name:`Clock`},{id:`vase`,name:`Vase`},{id:`scissors`,name:`Scissors`},{id:`teddy bear`,name:`Teddy Bear`},{id:`hair drier`,name:`Hair Drier`},{id:`toothbrush`,name:`Toothbrush`}],yx=[{id:`person`,name:`Person`},{id:`vehicle`,name:`Vehicle`},{id:`animal`,name:`Animal`},{id:`package`,name:`Package`}],bx=new Set(yx.map(e=>e.id));function xx(e){return bx.has(e.trim().toLowerCase())}var Sx={mapping:{person:`person`,bicycle:`vehicle`,car:`vehicle`,motorcycle:`vehicle`,airplane:`vehicle`,bus:`vehicle`,train:`vehicle`,truck:`vehicle`,boat:`vehicle`,bird:`animal`,cat:`animal`,dog:`animal`,horse:`animal`,sheep:`animal`,cow:`animal`,elephant:`animal`,bear:`animal`,zebra:`animal`,giraffe:`animal`,suitcase:`package`,backpack:`package`,handbag:`package`},preserveOriginal:!1},Cx=[{id:`speech`,name:`Speech`},{id:`scream`,name:`Scream / Shout`},{id:`crying`,name:`Crying / Baby`},{id:`laughter`,name:`Laughter`},{id:`music`,name:`Music`},{id:`dog`,name:`Dog`},{id:`cat`,name:`Cat`},{id:`bird`,name:`Bird`},{id:`animal`,name:`Animal (other)`},{id:`alarm`,name:`Alarm / Siren`},{id:`doorbell`,name:`Doorbell / Knock`},{id:`glass_breaking`,name:`Glass Breaking`},{id:`gunshot`,name:`Gunshot / Explosion`},{id:`vehicle`,name:`Vehicle`},{id:`siren`,name:`Emergency Siren`},{id:`fire`,name:`Fire / Smoke`},{id:`water`,name:`Water`},{id:`wind`,name:`Wind / Weather`},{id:`door`,name:`Door`},{id:`footsteps`,name:`Footsteps`},{id:`crowd`,name:`Crowd / Chatter`},{id:`telephone`,name:`Telephone`},{id:`engine`,name:`Engine / Motor`},{id:`tools`,name:`Tools / Construction`},{id:`silence`,name:`Silence`}],wx={mapping:{Speech:`speech`,"Child speech, kid speaking":`speech`,Conversation:`speech`,"Narration, monologue":`speech`,Babbling:`speech`,Whispering:`speech`,"Speech synthesizer":`speech`,Humming:`speech`,Rapping:`speech`,Singing:`speech`,Choir:`speech`,"Child singing":`speech`,Shout:`scream`,Bellow:`scream`,Yell:`scream`,Screaming:`scream`,"Children shouting":`scream`,Whoop:`scream`,"Crying, sobbing":`crying`,"Baby cry, infant cry":`crying`,Whimper:`crying`,"Wail, moan":`crying`,Groan:`crying`,Laughter:`laughter`,"Baby laughter":`laughter`,Giggle:`laughter`,Snicker:`laughter`,"Belly laugh":`laughter`,"Chuckle, chortle":`laughter`,Music:`music`,"Musical instrument":`music`,Guitar:`music`,Piano:`music`,Drum:`music`,"Drum kit":`music`,"Violin, fiddle":`music`,Flute:`music`,Saxophone:`music`,Trumpet:`music`,Synthesizer:`music`,"Pop music":`music`,"Rock music":`music`,"Hip hop music":`music`,"Classical music":`music`,Jazz:`music`,"Electronic music":`music`,"Background music":`music`,Dog:`dog`,Bark:`dog`,Yip:`dog`,Howl:`dog`,"Bow-wow":`dog`,Growling:`dog`,"Whimper (dog)":`dog`,Cat:`cat`,Purr:`cat`,Meow:`cat`,Hiss:`cat`,Caterwaul:`cat`,Bird:`bird`,"Bird vocalization, bird call, bird song":`bird`,"Chirp, tweet":`bird`,Squawk:`bird`,Crow:`bird`,Owl:`bird`,"Pigeon, dove":`bird`,Animal:`animal`,"Domestic animals, pets":`animal`,"Livestock, farm animals, working animals":`animal`,Horse:`animal`,"Cattle, bovinae":`animal`,Pig:`animal`,Sheep:`animal`,Goat:`animal`,Frog:`animal`,Insect:`animal`,Cricket:`animal`,Alarm:`alarm`,"Alarm clock":`alarm`,"Smoke detector, smoke alarm":`alarm`,"Fire alarm":`alarm`,Buzzer:`alarm`,"Civil defense siren":`alarm`,"Car alarm":`alarm`,Siren:`siren`,"Police car (siren)":`siren`,"Ambulance (siren)":`siren`,"Fire engine, fire truck (siren)":`siren`,"Emergency vehicle":`siren`,Foghorn:`siren`,Doorbell:`doorbell`,"Ding-dong":`doorbell`,Knock:`doorbell`,Tap:`doorbell`,Glass:`glass_breaking`,Shatter:`glass_breaking`,"Chink, clink":`glass_breaking`,"Gunshot, gunfire":`gunshot`,"Machine gun":`gunshot`,Explosion:`gunshot`,Fireworks:`gunshot`,Firecracker:`gunshot`,"Artillery fire":`gunshot`,"Cap gun":`gunshot`,Boom:`gunshot`,Vehicle:`vehicle`,Car:`vehicle`,Truck:`vehicle`,Bus:`vehicle`,Motorcycle:`vehicle`,"Car passing by":`vehicle`,"Vehicle horn, car horn, honking":`vehicle`,"Traffic noise, roadway noise":`vehicle`,Train:`vehicle`,Aircraft:`vehicle`,Helicopter:`vehicle`,Bicycle:`vehicle`,Skateboard:`vehicle`,Fire:`fire`,Crackle:`fire`,Water:`water`,Rain:`water`,Raindrop:`water`,"Rain on surface":`water`,Stream:`water`,Waterfall:`water`,Ocean:`water`,"Waves, surf":`water`,"Splash, splatter":`water`,Wind:`wind`,Thunderstorm:`wind`,Thunder:`wind`,"Wind noise (microphone)":`wind`,"Rustling leaves":`wind`,Door:`door`,"Sliding door":`door`,Slam:`door`,"Cupboard open or close":`door`,"Walk, footsteps":`footsteps`,Run:`footsteps`,Shuffle:`footsteps`,Crowd:`crowd`,Chatter:`crowd`,Cheering:`crowd`,Applause:`crowd`,"Children playing":`crowd`,"Hubbub, speech noise, speech babble":`crowd`,Telephone:`telephone`,"Telephone bell ringing":`telephone`,Ringtone:`telephone`,"Telephone dialing, DTMF":`telephone`,"Busy signal":`telephone`,Engine:`engine`,"Engine starting":`engine`,Idling:`engine`,"Accelerating, revving, vroom":`engine`,"Light engine (high frequency)":`engine`,"Medium engine (mid frequency)":`engine`,"Heavy engine (low frequency)":`engine`,"Lawn mower":`engine`,Chainsaw:`engine`,Hammer:`tools`,Jackhammer:`tools`,Sawing:`tools`,"Power tool":`tools`,Drill:`tools`,Sanding:`tools`,Silence:`silence`},preserveOriginal:!1},Tx={mapping:{speech:`speech`,child_speech:`speech`,conversation:`speech`,whispering:`speech`,singing:`speech`,humming:`speech`,shout:`scream`,yell:`scream`,screaming:`scream`,crying:`crying`,baby_crying:`crying`,sobbing:`crying`,laughter:`laughter`,baby_laughter:`laughter`,giggling:`laughter`,music:`music`,guitar:`music`,piano:`music`,drums:`music`,dog_bark:`dog`,dog_bow_wow:`dog`,dog_growling:`dog`,dog_howl:`dog`,cat_meow:`cat`,cat_purr:`cat`,cat_hiss:`cat`,bird:`bird`,bird_chirp:`bird`,bird_squawk:`bird`,animal:`animal`,horse:`animal`,cow_moo:`animal`,insect:`animal`,alarm:`alarm`,smoke_alarm:`alarm`,fire_alarm:`alarm`,car_alarm:`alarm`,siren:`siren`,police_siren:`siren`,ambulance_siren:`siren`,doorbell:`doorbell`,door_knock:`doorbell`,knocking:`doorbell`,glass_breaking:`glass_breaking`,glass_shatter:`glass_breaking`,gunshot:`gunshot`,explosion:`gunshot`,fireworks:`gunshot`,car:`vehicle`,truck:`vehicle`,motorcycle:`vehicle`,car_horn:`vehicle`,vehicle_horn:`vehicle`,traffic:`vehicle`,fire:`fire`,fire_crackle:`fire`,water:`water`,rain:`water`,ocean:`water`,splash:`water`,wind:`wind`,thunder:`wind`,thunderstorm:`wind`,door:`door`,door_slam:`door`,sliding_door:`door`,footsteps:`footsteps`,walking:`footsteps`,running:`footsteps`,crowd:`crowd`,chatter:`crowd`,cheering:`crowd`,applause:`crowd`,telephone_ring:`telephone`,ringtone:`telephone`,engine:`engine`,engine_starting:`engine`,lawn_mower:`engine`,chainsaw:`engine`,hammer:`tools`,jackhammer:`tools`,drill:`tools`,power_tool:`tools`,silence:`silence`},preserveOriginal:!1},Ex=new Map;for(let[e,t]of Object.entries(wx.mapping))Ex.set(e.toLowerCase(),t);for(let[e,t]of Object.entries(Tx.mapping))Ex.set(e.toLowerCase(),t);function Dx(e){return Ex.get(e.toLowerCase())??null}function Ox(){return Cx.map(e=>e.id)}var G={motion:`#f59e0b`,audio:`#06b6d4`,person:`#22c55e`,vehicle:`#3b82f6`,animal:`#f97316`,package:`#a855f7`,sensor:`#8b5cf6`,control:`#10b981`,genericDetection:`#64748b`},kx=`#22ff55`,Ax={car:`#f59e0b`,truck:`#d97706`,bus:`#b45309`,motorcycle:`#eab308`,bicycle:`#ca8a04`,airplane:`#60a5fa`,boat:`#2563eb`,train:`#1d4ed8`,bird:`#14b8a6`,dog:`#84cc16`,cat:`#f97316`,horse:`#a16207`,sheep:`#a3a3a3`,cow:`#78716c`,elephant:`#6b7280`,bear:`#7c2d12`,zebra:`#404040`,giraffe:`#d4a373`};function jx(e){return e.split(/[-_ ]/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var Mx=new Map;function Nx(e,t,n,r,i){Mx.set(e,{kind:e,parentKind:null,level:`macro`,category:t,color:n,iconId:r,labelKey:`eventKind.${e}`,label:i})}function K(e,t,n,r,i,a){Mx.set(e,{kind:e,parentKind:t,level:`sub`,category:n,color:r,iconId:i,labelKey:`eventKind.${e}`,label:a})}Nx(`motion`,`motion`,G.motion,`motion`,`Motion`),Nx(`audio`,`audio`,G.audio,`audio`,`Audio`),Nx(`person`,`detection`,G.person,`person`,`Person`),Nx(`vehicle`,`detection`,G.vehicle,`vehicle`,`Vehicle`),Nx(`animal`,`detection`,G.animal,`animal`,`Animal`),Nx(`package`,`package`,G.package,`package`,`Package`),Nx(`sensor`,`sensor`,G.sensor,`sensor`,`Sensor`),Nx(`control`,`control`,G.control,`control`,`Control`);for(let[e,t]of Object.entries(Sx.mapping))t!==`vehicle`&&t!==`animal`||Mx.has(e)||K(e,t,`detection`,Ax[e]??G.genericDetection,e,jx(e));K(`package-delivered`,`package`,`package`,G.package,`package`,`Package delivered`),K(`package-picked-up`,`package`,`package`,G.package,`package`,`Package picked up`),K(`contact`,`sensor`,`sensor`,`#f59e0b`,`door`,`Contact`),K(`motion-sensor`,`sensor`,`sensor`,G.sensor,`pir`,`Motion sensor`),K(`smoke`,`sensor`,`sensor`,`#ef4444`,`smoke`,`Smoke`),K(`flood`,`sensor`,`sensor`,`#3b82f6`,`water`,`Water leak`),K(`gas`,`sensor`,`sensor`,`#ef4444`,`gas`,`Gas`),K(`carbon-monoxide`,`sensor`,`sensor`,`#dc2626`,`smoke`,`Carbon monoxide`),K(`vibration`,`sensor`,`sensor`,`#eab308`,`vibration`,`Vibration`),K(`tamper`,`sensor`,`sensor`,`#f97316`,`tamper`,`Tamper`),K(`presence`,`sensor`,`sensor`,`#22c55e`,`presence`,`Presence`),K(`enum-sensor`,`sensor`,`sensor`,G.sensor,`generic`,`Sensor state`),K(`device-event`,`sensor`,`sensor`,`#10b981`,`button`,`Device event`),K(`lock`,`control`,`control`,`#0ea5e9`,`lock`,`Lock`),K(`cover`,`control`,`control`,`#0ea5e9`,`door`,`Cover`),K(`switch`,`control`,`control`,G.control,`switch`,`Switch`),K(`siren`,`control`,`control`,`#dc2626`,`siren`,`Siren`),K(`button`,`control`,`control`,`#10b981`,`button`,`Button`),K(`doorbell`,`control`,`control`,`#a855f7`,`doorbell`,`Doorbell`);for(let e of Cx){let t=`audio-${e.id}`;Mx.has(t)||K(t,`audio`,`audio`,G.audio,t,e.name)}var Px=Object.freeze(Object.fromEntries(Mx));function Fx(e){return Px[e]}function Ix(e){return Px[e]?.color??`#22ff55`}function Lx(e){let t=[];for(let n of Object.values(Px))n.parentKind===e&&t.push(n);return t}var Rx=u({kind:c(),label:c(),parentKind:c().nullable()}),zx=u({videoClasses:b(Rx),audioKinds:b(Rx),labels:b(Rx)});function Bx(e,t,n){return{kind:e,label:t,parentKind:n}}function Vx(){let e=Object.values(Px);return{videoClasses:e.filter(e=>e.category===`detection`).map(e=>Bx(e.kind,e.label,e.parentKind)),audioKinds:e.filter(e=>e.category===`audio`&&e.level===`sub`).map(e=>Bx(e.kind,e.label,e.parentKind)),labels:e.filter(e=>e.category===`sensor`||e.category===`control`).map(e=>Bx(e.kind,e.label,e.parentKind))}}var Hx=Object.freeze(Vx()),Ux=y([`disarmed`,`armed_home`,`armed_away`,`armed_night`,`armed_vacation`,`armed_custom_bypass`,`arming`,`disarming`,`pending`,`triggered`]),q=y([`home`,`away`,`night`,`vacation`,`custom_bypass`]),Wx=u({state:Ux,availableModes:b(q),requiresCode:x(),lastChangedAt:i()}),Gx={name:`alarm-panel`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.AlarmPanel],methods:{arm:w(u({deviceId:i().int().nonnegative(),mode:q,code:c().min(1).optional()}),g(),{kind:`mutation`,auth:`protected`}),disarm:w(u({deviceId:i().int().nonnegative(),code:c().min(1).optional()}),g(),{kind:`mutation`,auth:`protected`}),trigger:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:Wx,kind:`push`},runtimeState:Wx,durability:`restored`,volatileStateFields:[`lastChangedAt`]},Kx=u({x:i(),y:i()}),qx=u({kind:p(`rect`),x:i(),y:i(),width:i(),height:i()}),Jx=u({kind:p(`polygon`),points:b(Kx)}),Yx=u({kind:p(`grid`),gridWidth:i(),gridHeight:i(),cells:b(x())}),Xx=u({kind:p(`line`),points:b(Kx)}),Zx=f(`kind`,[qx,Jx,Yx,Xx]),Qx=y([`rect`,`polygon`,`grid`,`line`]),$x=u({min:i(),max:i()}),eS=u({width:i(),height:i()}),tS=y([`immediate`,`track-end`,`device-event`,`package-event`,`system-event`]),nS=y(`device-online.device-offline.device-disabled.device-enabled.device-battery-low.device-battery-normal.device-consumable-low.device-consumable-normal.device-tank-low.device-tank-full.device-tank-normal.stream-online.stream-offline.node-online.node-offline.node-inference-unavailable.detection-blind.addon-crash-loop.addon-update-available.server-update-available.wrapper-update-available.alarm-triggered.alarm-armed.alarm-disarmed.alarm-arming.alarm-arm-refused.alarm-pending.alarm-rearmed.alarm-sensor-bypass.alarm-check-failed.addon-updated.server-updated.export-completed.backup-completed.camera-online.camera-offline.camera-disabled.camera-enabled`.split(`.`)),rS=new Set([`camera-online`,`camera-offline`,`camera-disabled`,`camera-enabled`]),iS=nS.options.filter(e=>!rS.has(e)),aS=[`alarm-arm-refused`,`alarm-check-failed`,`alarm-arming`,`alarm-armed`,`alarm-pending`,`alarm-triggered`,`alarm-rearmed`,`alarm-sensor-bypass`,`alarm-disarmed`],oS=[`device-battery-low`,`device-battery-normal`,`device-consumable-low`,`device-consumable-normal`],sS=[`device-consumable-low`,`device-consumable-normal`],cS=[`device-tank-low`,`device-tank-full`,`device-tank-normal`],lS=15,uS=95,dS=u({kinds:b(nS).min(1),deviceIds:b(i().int()).min(1).optional(),deviceTypes:b(c().min(1)).min(1).optional(),excludeDeviceIds:b(i().int()).min(1).optional(),nodeIds:b(c().min(1)).min(1).optional(),packageNames:b(c().min(1)).min(1).optional(),consumableLowPercent:i().int().min(1).max(95).optional()});function fS(e){return e.consumableLowPercent??15}var pS=1,mS=1440,hS=[10,30,60],gS=u({days:b(i().int().min(0).max(6)).min(1),startMinute:i().int().min(0).max(1439),endMinute:i().int().min(0).max(1439)}),_S=u({windows:b(gS).min(1),timezone:c().optional(),invert:x().optional()}),vS=y([`instant`,`summary`]),yS=y([`rule`,`section`]),bS=f(`mode`,[u({mode:p(`instant`)}),u({mode:p(`summary`),schedule:_S,split:yS.optional()})]),xS=u({values:b(c().min(1)),maxDistance:i().int().min(0).max(3).default(1)}),SS=u({zoneId:c().optional(),className:c().optional(),op:y([`became-occupied`,`became-free`,`>=`,`<=`]).default(`became-occupied`),count:i().int().min(0).default(1),sustainSeconds:i().int().min(0).max(3600).default(15)}),CS=-96,wS=u({labels:b(c().min(1)).min(1).optional(),dbThreshold:i().min(-96).max(0).optional(),hitPercent:i().int().min(1).max(100).default(60),samplingSeconds:i().int().min(1).max(300).default(10),confirmHits:i().int().min(1).max(20).optional(),confirmWindowSec:i().int().min(1).max(60).optional()}),TS=y([`enter`,`exit`,`any`]),ES=y([`raised`,`cleared`]),DS=u({ids:b(c().min(1)).min(1),match:y([`any`,`all`]).optional()}),OS=f(`kind`,[u({kind:p(`wait`),seconds:i().min(0).max(300)}),u({kind:p(`cap`),deviceId:i().int(),cap:c().min(1),method:c().min(1),args:_(c(),o()).optional()})]),kS=u({name:c().min(1).max(120),enabled:x(),minDelaySec:i().int().min(0).max(86400).optional(),actions:b(OS).min(1)}),AS=u({id:c().min(1).max(64),label:c().min(1).max(40),sequence:c().min(1).max(120),icon:ax.optional(),destructive:x().optional()}),jS=u({onTrigger:b(kS).optional(),buttons:b(AS).max(8).optional()}),MS=u({deviceId:i().int(),states:b(c().min(1)).min(1)}),NS=u({sceneId:c().min(1),deviceId:i().int().optional(),requiredState:y([`matched`,`diverged`]),latched:x().optional()}),PS=u({deviceState:MS.optional(),scene:NS.optional(),devices:b(i()).optional(),devicesExclude:b(i()).min(1).optional(),classes:b(c().min(1)).optional(),classesExclude:b(c().min(1)).optional(),minConfidence:i().min(0).max(1).optional(),zones:DS.optional(),zonesExclude:b(c().min(1)).optional(),crossing:TS.optional(),labelEquals:b(c().min(1)).optional(),identities:b(c().min(1)).optional(),plates:xS.optional(),identitiesExclude:b(c().min(1)).optional(),minImportance:i().min(0).max(1).optional(),minDwellSeconds:i().min(0).optional(),source:y([`pipeline`,`onboard`,`sensor`,`audio`,`any`]).optional(),minLabelConfidence:i().min(0).max(1).optional(),eventTypeTokens:b(c().min(1)).optional(),sensorKinds:b(c().min(1)).optional(),sensorTransition:ES.optional(),packagePhase:y([`delivered`,`picked-up`,`both`]).optional(),systemEvent:dS.optional(),customZones:b(Jx).optional(),occupancy:SS.optional(),audio:wS.optional()}),FS=u({targetId:c().min(1),params:_(c(),o()).optional()}),IS=y([`cropped`,`full`,`boxed`]),LS=y([`mosaic`,`each`]),RS=4,zS=6,BS=u({attach:y([`best`,`best-matching`,`keyFrame`,`none`]).default(`best`),frame:IS.optional(),zoneCrop:x().optional(),gif:x().optional(),clip:x().optional(),clipPreRollSec:i().int().min(0).max(30).optional(),clipPostRollSec:i().int().min(0).max(30).optional(),clipSpeed:i().min(1).max(8).optional(),profile:S.optional(),linkedCameras:LS.optional()}),VS=y([`shared`,`per-class`]),HS=u({cooldownSec:i().int().min(0).max(86400).default(60),scope:y([`rule`,`rule-device`]).default(`rule-device`),granularity:VS.optional()}),US=1e3,WS=2e4,GS=8e3,KS=448,qS=u({op:y([`>=`,`>`,`<=`,`<`,`==`]),count:i().int().min(0).max(1e3)}),JS=u({enabled:x().default(!1),profileId:c().optional(),prompt:c().max(1e3).optional(),expect:qS.optional(),timeoutMs:i().int().min(US).max(WS).default(GS),onTimeout:y([`fire`,`suppress`]).default(`fire`),maxImagePx:i().int().min(64).max(2048).default(448)}),YS=u({name:c().min(1).max(200),enabled:x().default(!0),delivery:tS,conditions:PS.default({}),schedule:_S.optional(),systemEventDelivery:bS.optional(),targets:b(FS),targetUsers:b(c()).optional(),media:BS.default({attach:`best`}),throttle:HS.default({cooldownSec:60,scope:`rule-device`}),template:u({title:c().max(500).optional(),body:c().max(2e3).optional()}).optional(),priority:i().int().min(1).max(5).default(3),ownerUserId:c().optional(),snoozeAllowGlobal:x().optional(),snoozeOptions:b(i().int().min(1).max(mS)).max(4).optional(),actions:jS.optional(),confirm:JS.optional(),waitForEnhancement:x().optional(),groupIdleSec:i().int().min(0).max(600).optional()}),XS=YS.partial().extend({disabledTargetIds:b(c()).optional(),enabled:x().optional(),conditions:PS.optional(),media:BS.optional(),throttle:HS.optional(),priority:i().int().min(1).max(5).optional()}),ZS=[`template`,`schedule`,`targetUsers`,`snoozeOptions`,`snoozeAllowGlobal`,`waitForEnhancement`,`actions`,`confirm`,`groupIdleSec`],QS=y(ZS),$S=u({ruleId:c(),patch:XS,clear:b(QS).optional()}),eC=YS.extend({id:c(),createdBy:c(),createdAt:i(),updatedAt:i(),disabledTargetIds:b(c()).default([])}),tC=u({id:c(),status:y([`read`,`unavailable`]),items:i().int().nonnegative(),reason:c().optional()}),nC=u({section:c().optional(),title:c(),text:c(),count:i().int().nonnegative()}),rC=u({empty:x(),count:i().int().nonnegative(),text:c(),sections:b(tC),dropped:_(c(),i().int().nonnegative()),excludedGroups:b(c()),split:yS.optional(),rows:b(nC).optional()}),iC=u({recordId:c(),recordKind:y([`object-event`,`track`,`device-event`,`package-event`,`system-event`]),deviceId:i(),timestamp:i(),wouldFire:x(),failedCondition:c().optional(),className:c().optional(),label:c().optional()}),aC=y([`detection`,`sensor`,`occupancy`,`sound`,`device-events`,`system`,`alarm`,`mixed`]),oC=y([`detection`,`sensor`,`occupancy`,`sound`,`system`]),sC=y([`rule`,`timelapse`,`summary`]),cC=y([`title`,`body`,`previewText`,`captionText`]),lC=y([`subject`,`place`,`time`,`rule`,`occupancy`,`sound`,`sensor`,`system`,`digest`,`ai`]),uC=u({name:c().regex(/^\w+$/),label:c(),description:c().optional(),example:c(),group:lC,families:b(sC).min(1),fields:b(cC).optional(),kinds:b(oC).optional(),deliveries:b(tS).optional(),systemEventKinds:b(nS).optional(),systemEventDeliveries:b(vS).optional(),dynamic:u({prefix:p(`count_`),from:p(`classes`)}).optional()}),dC=u({family:sC,field:cC,kind:aC.optional(),delivery:tS.optional(),systemEventKinds:b(nS).optional(),systemEventDelivery:vS.optional()}),fC=u({context:dC,template:u({title:c().max(500).optional(),body:c().max(2e3).optional()})}),pC=u({title:c().nullable(),body:c().nullable(),unknown:b(c())}),mC=u({id:c(),group:y([`scope`,`class`,`zones`,`quality`,`label`,`schedule`,`device`,`package`,`occupancy`,`audio`,`system`]),label:c(),valueType:y([`deviceIdList`,`deviceIdExcludeList`,`stringList`,`number01`,`number`,`sourceSelect`,`zoneSelection`,`zoneIdList`,`schedule`,`plateMatcher`,`packagePhase`,`crossingSelect`,`sensorTransition`,`polygonDraw`,`occupancy`,`audio`,`deviceState`,`scene`,`systemEvent`]),operator:y([`in`,`notIn`,`anyOf`,`allOf`,`gte`,`fuzzyIn`,`withinSchedule`]),appliesTo:b(tS),phase:c(),description:c().optional(),options:b(u({value:c(),label:c(),hint:c().optional()})).readonly().optional()}),hC=[{id:`systemEvent`,group:`system`,label:`System event`,valueType:`systemEvent`,options:[{value:`device-online`,label:`Device online`},{value:`device-offline`,label:`Device offline`},{value:`device-disabled`,label:`Device switched off`},{value:`device-enabled`,label:`Device switched on`},{value:`stream-online`,label:`Stream online`},{value:`stream-offline`,label:`Stream offline`},{value:`node-online`,label:`Node online`},{value:`node-offline`,label:`Node offline`},{value:`node-inference-unavailable`,label:`Node has no usable inference device`},{value:`detection-blind`,label:`Camera detecting nothing`},{value:`addon-crash-loop`,label:`Addon stopped after repeated crashes`},{value:`addon-update-available`,label:`Addon update available`},{value:`server-update-available`,label:`Server update available`},{value:`wrapper-update-available`,label:`Container / app update available`},{value:`addon-updated`,label:`Addons updated`},{value:`server-updated`,label:`Server updated`},{value:`device-battery-low`,label:`Battery low`},{value:`device-battery-normal`,label:`Battery back to normal`},{value:`device-consumable-low`,label:`Consumable low`},{value:`device-consumable-normal`,label:`Consumable replaced`},{value:`device-tank-low`,label:`Tank low (water, detergent)`},{value:`device-tank-full`,label:`Tank full (dirty water, dust)`},{value:`device-tank-normal`,label:`Tank back to normal`},{value:`export-completed`,label:`Export completed`},{value:`backup-completed`,label:`Backup completed`},{value:`alarm-arm-refused`,label:`Alarm arm refused`},{value:`alarm-check-failed`,label:`Alarm check failed (armed anyway)`},{value:`alarm-arming`,label:`Alarm arming (exit delay)`},{value:`alarm-armed`,label:`Alarm armed`},{value:`alarm-pending`,label:`Alarm entry delay started`},{value:`alarm-triggered`,label:`Alarm triggered`},{value:`alarm-rearmed`,label:`Alarm re-armed after siren`},{value:`alarm-sensor-bypass`,label:`Alarm sensor bypass`},{value:`alarm-disarmed`,label:`Alarm disarmed`}],operator:`in`,appliesTo:[`system-event`],phase:`P1`,description:`Infrastructure and update events. Device liveness covers EVERY device type — narrow it by device type (cameras only, say) and/or by device, node events by node id, and addon updates by package name.`},{id:`devices`,group:`scope`,label:`Devices`,valueType:`deviceIdList`,operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P1`,description:`Restrict the rule to these devices; absent = all devices. A sensor event matches either the SENSOR that fired or the camera it is attributed to, so a rule may name either one.`},{id:`devicesExclude`,group:`scope`,label:`Excluded devices`,valueType:`deviceIdExcludeList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P1`,description:`Every device except these. Judged on the same device ids as Devices: a sensor event is excluded by the SENSOR that fired or by the camera it is attributed to.`},{id:`classes`,group:`class`,label:`Object classes`,valueType:`stringList`,operator:`in`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`,description:`Any overlap with the detection class set passes.`},{id:`classesExclude`,group:`class`,label:`Excluded classes`,valueType:`stringList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`},{id:`minConfidence`,group:`quality`,label:`Minimum confidence`,valueType:`number01`,operator:`gte`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`},{id:`zones`,group:`zones`,label:`Zones`,valueType:`zoneSelection`,operator:`anyOf`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`,description:`The zones the subject must be in (included) or never in (excluded).`},{id:`zonesExclude`,group:`zones`,label:`Excluded zones`,valueType:`zoneIdList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`},{id:`crossing`,group:`zones`,label:`Zone crossing`,valueType:`crossingSelect`,options:[{value:``,label:`Entering`,hint:`Entries and ordinary movement; never an exit.`},{value:`exit`,label:`Leaving`,hint:`Only an exit from a zone.`},{value:`any`,label:`Entering or leaving`,hint:`Entries, exits and ordinary movement.`}],operator:`in`,appliesTo:[`immediate`],phase:`P1`,description:`Which way the subject crosses the zone.`},{id:`labelEquals`,group:`label`,label:`Label equals`,valueType:`stringList`,operator:`in`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Exact match on the collapsed label (identity / plate / subclass).`},{id:`identities`,group:`label`,label:`Known faces`,valueType:`stringList`,operator:`in`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Only recognised people. Selecting NOBODY means every identity in the face gallery; selecting some narrows to those. Matched on the gallery id, so renaming a person does not break the rule. On immediate delivery the name is not known yet when the notification is enqueued — see the rule’s "wait for recognition" switch.`},{id:`plates`,group:`label`,label:`Known plates`,valueType:`plateMatcher`,operator:`fuzzyIn`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Only vehicles whose plate was read. Selecting NO plate means any readable plate; listed plates are matched Levenshtein-tolerantly, because OCR noise makes an exact match useless.`},{id:`identitiesExclude`,group:`label`,label:`Excluded faces`,valueType:`stringList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Veto by identity (mirror of Known faces, same gallery ids). A subject nobody recognised passes — there is nothing to exclude.`},{id:`minLabelConfidence`,group:`label`,label:`Minimum label confidence`,valueType:`number01`,operator:`gte`,appliesTo:[`track-end`],phase:`P1`,description:`Best identity/plate recognition match confidence [0,1] for the label the track carries at close (peak assigned-identity cosine / peak plate OCR score; the higher of the two when both were read). Distinct from detection confidence. Fails closed for a track that ended un-recognized.`},{id:`minImportance`,group:`quality`,label:`Minimum importance`,valueType:`number01`,operator:`gte`,appliesTo:[`track-end`],phase:`P1`,description:`Server-computed key-event importance [0,1]; track-end rules only (importance is scored at close). Fails when the record has none.`},{id:`minDwellSeconds`,group:`quality`,label:`Minimum dwell (seconds)`,valueType:`number`,operator:`gte`,appliesTo:[`track-end`],phase:`P1`,description:`Track lifespan in seconds (lastSeen − firstSeen); track-end rules only.`},{id:`source`,group:`scope`,label:`Detection source`,valueType:`sourceSelect`,options:[{value:`any`,label:`Any source`},{value:`pipeline`,label:`Pipeline`},{value:`onboard`,label:`Onboard (camera)`},{value:`sensor`,label:`Sensor`},{value:`audio`,label:`Audio marker`}],operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P1`,description:`pipeline / onboard / sensor / audio; a record with no stamped source counts as pipeline.`},{id:`deviceState`,group:`scope`,label:`Device state`,valueType:`deviceState`,operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P2`,description:`Only fire while another device is in one of the chosen states — the alarm armed, a switch on, a contact closed. A state that cannot be read does NOT fire.`},{id:`scene`,group:`scope`,label:`Scene state`,valueType:`scene`,operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P3`,description:`Only fire while a scene is matched or diverged.`},{id:`sensorKinds`,group:`device`,label:`Sensor kinds`,valueType:`stringList`,operator:`in`,appliesTo:[`device-event`],phase:`P1`,description:`Sensor/control taxonomy kinds (doorbell / contact / button / …) matched against the persisted device event.`},{id:`eventTypeTokens`,group:`device`,label:`Event-type tokens`,valueType:`stringList`,operator:`in`,appliesTo:[`device-event`],phase:`P1`,description:`Raw device event-type tokens (e.g. doorbell press / press_long) from the event-emitter slice; absent on doorbell-pulse / passive sensors.`},{id:`sensorTransition`,group:`device`,label:`Notify when`,valueType:`sensorTransition`,options:[{value:``,label:`It triggers and when it clears`,hint:`Every change: water detected, and back to dry.`},{value:`raised`,label:`Only when it triggers`,hint:`Water detected, smoke, a contact opening — never the return to normal.`},{value:`cleared`,label:`Only when it clears`,hint:`Back to dry, smoke gone, a contact closing — never the alert itself.`}],operator:`in`,appliesTo:[`device-event`],phase:`P2`,description:`Fire on one edge of a boolean sensor. Offered only when every chosen sensor kind raises and clears; a reading that cannot be placed still notifies.`},{id:`packagePhase`,group:`package`,label:`Package phase`,valueType:`packagePhase`,options:[{value:`delivered`,label:`Delivered`},{value:`picked-up`,label:`Picked up`},{value:`both`,label:`Both`}],operator:`in`,appliesTo:[`package-event`],phase:`P1`,description:`Delivered / picked-up / both.`},{id:`occupancy`,group:`occupancy`,label:`Occupancy`,valueType:`occupancy`,operator:`anyOf`,appliesTo:[`device-event`],phase:`P1`,description:`ZoneAnalytics occupancy edge (optionally zone/class-scoped): count crosses the threshold and holds for sustainSeconds. Fail-closed on a missing snapshot.`},{id:`audio`,group:`audio`,label:`Sound`,valueType:`audio`,operator:`anyOf`,appliesTo:[`immediate`],phase:`P2`,description:`Fires when at least hitPercent% of the samples in a samplingSeconds window are hits — a hit clears the dBFS floor AND carries one of the chosen sounds. Both filters are optional and independent, but naming NEITHER never matches: every sample would be a hit, so the engine refuses rather than notifying on silence. dBFS is negative-going (0 = full scale, -96 = silence).`},{id:`customZones`,group:`zones`,label:`Custom zones`,valueType:`polygonDraw`,operator:`anyOf`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`,description:`User-drawn polygons; a detection whose bbox overlaps any polygon matches.`},{id:`schedule`,group:`schedule`,label:`Schedule`,valueType:`schedule`,operator:`withinSchedule`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`,`system-event`],phase:`P1`,description:`Weekly activation windows (invertible); absent = always active.`}],gC=y([`pending`,`sent`,`dead`]),_C=y([`object-event`,`track-end`,`device-event`,`package-event`,`system-event`]),vC=u({className:c(),label:c().optional(),confidence:i().optional(),zones:b(c()),timestamp:i(),systemEvent:u({kind:nS,subject:c(),title:c(),body:c(),data:_(c(),o())}).optional()}),yC=u({id:c(),ruleId:c(),ruleName:c(),delivery:tS,targetId:c(),deviceId:i(),recordKind:_C,recordId:c(),trackId:c().optional(),status:gC,attempts:i().int(),createdAt:i(),updatedAt:i(),error:c().optional(),subject:vC,artifactIds:b(c().min(1)).optional()}),bC=100,xC=500,SC=u({ruleId:c().optional(),deviceId:i().optional(),status:gC.optional(),since:i().optional(),until:i().optional(),limit:i().int().min(1).max(500).default(100)}),CC=u({ruleId:c(),lastAt:i(),status:gC,deviceId:i()}),wC=u({runs:b(CC),horizonMs:i().nonnegative().nullable()}),TC=y([`rule`,`device`,`all`]),EC=u({scope:TC,ruleId:c().optional(),deviceId:i().int().optional(),classes:b(c().min(1)).min(1).optional(),durationMinutes:i().int().min(1).max(mS),global:x().optional(),summary:x().optional()}),DC=u({id:c(),userId:c(),scope:TC,ruleId:c().optional(),deviceId:i().int().optional(),classes:b(c().min(1)).min(1).optional(),startedAt:i(),expiresAt:i(),global:x(),summary:x(),digestSentAt:i().optional()}),OC=u({snoozeId:c(),targetId:c(),ruleId:c(),ruleName:c(),deviceId:i().int(),count:i().int(),firstAt:i(),lastAt:i()}),kC=600,AC=3600,jC=200,MC=i().int().min(0).max(600),NC=i().int().min(0).max(AC),PC=e=>new Set(e.map(e=>e.mode)).size===e.length,FC=u({mode:q,exitDelaySec:MC.optional(),entryDelaySec:MC.optional(),triggeredDurationSec:NC.optional()}),IC=b(FC).max(8).refine(PC,{message:`modeDelays: at most one entry per arm mode`}),LC=u({mode:q,exitDelaySec:MC.nullable().optional(),entryDelaySec:MC.nullable().optional(),triggeredDurationSec:NC.nullable().optional()}),RC=b(LC).max(8).refine(PC,{message:`modeDelays: at most one edit per arm mode`}),zC=u({mode:q,deviceId:i().int().positive(),nonBlocking:x()}),BC=b(u({mode:q,deviceIds:b(i().int()).max(200)})).max(8).refine(PC,{message:`nonBlocking: at most one list per arm mode`}),VC=u({exitDelaySec:MC,entryDelaySec:MC,triggeredDurationSec:NC,announceArm:x().optional(),announceTargets:b(c().min(1)).max(16),nonBlocking:BC.default([]),modeDelays:IC.default([])}),HC=VC.extend({nonBlocking:BC,modeDelays:RC,nonBlockingEdit:zC}).partial().refine(e=>e.nonBlocking===void 0||e.nonBlockingEdit===void 0,{message:`nonBlocking and nonBlockingEdit are exclusive — send the whole lists or one edit`}),UC=y([`muted`,`detection-off`,`offline`]),WC=u({deviceId:i().int(),reason:UC}),GC=u({mode:q,ruleCount:i().int().min(0),allDevices:x(),deviceIds:b(i().int()),allDevicesExcept:b(i().int()).default([]),skippedDevices:b(WC).default([])}),KC=u({deviceId:i().int(),name:c(),state:c(),blocking:x()}),qC=u({deviceId:i().int(),name:c(),phase:y([`open`,`closed`])}),JC=u({mode:q,devices:b(KC),unknown:b(i().int())}),YC=u({state:Ux,targetMode:q.nullable(),availableModes:b(q),openings:b(JC),exclusions:b(qC)}),XC=u({deviceId:i().int().nullable(),settings:VC,coverage:b(GC),live:YC.optional()}),ZC=500,QC=y([`open`,`closed`,`unknown`,`not-opening`]),$C=u({deviceId:i().int().positive(),reading:QC,state:c().nullable(),unknownWhy:y([`read-failed`,`unknown-word`]).nullable(),online:x().nullable()}),ew=u({deviceIds:b(i().int().positive()).max(500)}),tw=u({sensors:b($C),readAt:i().int().nonnegative()}),nw=60,rw=u({deviceId:i().int().nonnegative().optional(),seconds:i().min(0).max(60),profile:S.optional(),ruleId:c(),ruleName:c(),reason:y([`window`,`occupancy`])}),iw=u({rulesLoaded:x(),asks:b(rw).readonly()}),aw={name:`notification-rules`,scope:`system`,mode:`singleton`,methods:{listRules:w(u({}),u({rules:b(eC)}),{auth:`admin`}),getRule:w(u({ruleId:c()}),u({rule:eC.nullable()}),{auth:`admin`}),createRule:w(u({rule:YS}),u({rule:eC}),{kind:`mutation`,auth:`admin`,caller:`required`}),updateRule:w($S,u({rule:eC}),{kind:`mutation`,auth:`admin`,caller:`required`}),deleteRule:w(u({ruleId:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),setRuleEnabled:w(u({ruleId:c(),enabled:x()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),getClipRetentionAsks:w(u({}),iw,{auth:`admin`}),listDeviceMutes:w(u({}),u({mutedDeviceIds:b(i().int()).readonly()}),{auth:`admin`}),setDeviceMuted:w(u({deviceId:i().int(),muted:x()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),testRule:w(u({rule:YS,lookbackMinutes:i().int().min(1).max(1440).default(60)}),u({results:b(iC)}),{kind:`mutation`,auth:`admin`}),previewStateSummary:w(u({rule:YS}),rC,{kind:`mutation`,auth:`admin`,access:`view`}),getConditionCatalog:w(u({}),u({catalog:b(mC),taxonomy:zx.optional()})),getTemplateCatalog:w(u({}),u({vars:b(uC)})),previewTemplate:w(fC,pC,{kind:`mutation`,access:`view`}),getHistory:w(u({filter:SC.default({limit:100})}),u({entries:b(yC)}),{auth:`admin`}),getRuleLastRuns:w(u({}),wC,{auth:`admin`}),resolveArtifactUrl:w(u({artifactId:c().min(1)}),u({url:c().nullable()}),{auth:`admin`}),listSnoozes:w(u({}),u({snoozes:b(DC)}),{caller:`required`}),createSnooze:w(u({snooze:EC}),u({snooze:DC}),{kind:`mutation`,caller:`required`}),cancelSnooze:w(u({snoozeId:c()}),u({success:p(!0)}),{kind:`mutation`,caller:`required`}),getAlarmConfig:w(u({}),XC,{auth:`admin`}),setAlarmConfig:w(u({patch:HC}),XC,{kind:`mutation`,auth:`admin`}),getAlarmSensors:w(ew,tw,{auth:`admin`})}},ow=y([`view`,`create`,`delete`]),sw=d([p(`*`),b(c())]),cw=_(c(),d([p(`*`),b(c())])),lw=y([`device`,`system`]),uw=f(`kind`,[u({kind:p(`all`)}),u({kind:p(`ids`),ids:b(i().int()).min(1)}),u({kind:p(`types`),types:b(y(E)).min(1)}),u({kind:p(`locations`),locations:b(c().min(1)).min(1)})]),dw=u({type:p(`device`),selector:uw,access:b(ow).min(1),includeLinked:x().optional()});function fw(e){if(typeof e!=`object`||!e||Array.isArray(e)||Reflect.get(e,`type`)!==`device`||Reflect.get(e,`selector`)!==void 0)return e;let t=Reflect.get(e,`targets`);return Array.isArray(t)?{type:`device`,selector:{kind:`ids`,ids:t.map(e=>typeof e==`string`?Number(e):e).filter(e=>typeof e==`number`&&Number.isInteger(e))},access:Reflect.get(e,`access`)}:e}var J=n(fw,f(`type`,[u({type:p(`category`),target:lw,access:b(ow).min(1)}),u({type:p(`capability`),target:c(),access:b(ow).min(1)}),u({type:p(`addon`),target:c(),access:b(ow).min(1)}),dw])),pw=u({id:c(),username:c(),passwordHash:c(),isAdmin:x().default(!1),allowedProviders:sw,allowedDevices:cw,scopes:b(J).default([]),createdAt:i(),updatedAt:i()}),mw=u({id:c(),label:c(),isAdmin:x().default(!1),allowedProviders:sw,allowedDevices:cw,tokenHash:c(),tokenPrefix:c(),createdAt:i(),lastUsedAt:i().optional()}),hw=u({id:c(),userId:c(),name:c(),tokenHash:c(),tokenPrefix:c(),scopes:b(J),expiresAt:i().nullish(),lastUsedAt:i().nullish(),createdAt:i()}),gw=u({integrationId:c(),displayName:c(),requestedScopes:b(J),allowedRedirectPrefixes:b(c()).min(1),allowedPrivateHostPaths:b(c()).optional(),requiresPkce:x().optional(),hubUrl:c().optional(),refreshTokenTtlSec:d([i().int().positive(),p(`never`)]).optional()}),_w={name:`oauth-integration`,scope:`system`,mode:`collection`,internal:!0,methods:{getDescriptor:w(g(),gw,{auth:`admin`})}},vw=f(`kind`,[u({kind:p(`camera`)}),u({kind:p(`sensor`),deviceId:i().int().positive()})]),yw=Object.freeze({kind:`camera`});function bw(e){if(e===void 0)return{triggeredBy:yw,malformed:!1};let t=vw.safeParse(e);return t.success?{triggeredBy:t.data,malformed:!1}:{triggeredBy:yw,malformed:!0}}var xw=`cameraSensors`,Sw=8,Cw=u({addonId:c().min(1),stableId:c().min(1)});function ww(e){return`${e.addonId}/${e.stableId}`}var Tw=y([`in-addition`,`confirm`,`replace`]),Ew=`in-addition`,Dw=Cw.extend({mode:Tw.default(Ew)}),Ow=u({sensors:b(Dw).min(1).max(8)}).superRefine((e,t)=>{let n=new Set;e.sensors.forEach((e,r)=>{let i=ww(e);n.has(i)&&t.addIssue({code:`custom`,path:[`sensors`,r],message:`duplicate camera sensor ${i}`}),n.add(i)})}),kw={addonId:c(),stableId:c(),mode:Tw.default(Ew)},Aw=f(`state`,[u({...kw,state:p(`ready`),deviceId:i(),name:c(),caps:b(c()).readonly()}),u({...kw,state:p(`offline`),deviceId:i(),name:c(),reason:y([`offline`,`disabled`])}),u({...kw,state:p(`missing`),reason:c()}),u({...kw,state:p(`unsupported`),deviceId:i(),name:c(),reason:c()}),u({...kw,state:p(`unreadable`),reason:c()})]),jw=y([`onboard-not-listed`,`no-active-detection`]),Mw=y([`always`,`when-confirmed`,`never`]),Nw=y([`provider-not-split`]),Pw=u({detected:x(),atMs:i()}),Fw=f(`state`,[u({state:p(`not-configured`),cameraLevel:Pw.optional()}),u({state:p(`unreadable`),reason:c(),cameraLevel:Pw.optional()}),u({state:p(`configured`),cameraLevel:Pw.optional(),sensors:b(Aw).readonly(),cameraMotion:Mw.optional(),notForwarded:jw.optional(),notEnforced:Nw.optional()})]),Iw=Object.freeze({state:`unreadable`,reason:`camera sensor mappings not loaded`}),Lw=[`owner-not-ready`,`store-read-failed`,`three-way-read-unavailable`,`invalid-stored`,`not-cluster-scoped`],Rw=[{stepId:`face-embedding`,label:`Face recognition model`,defaultModelId:`auraface-r100`,indexName:`the enrolled face gallery`,options:[{id:`auraface-r100`,label:`AuraFace R100`},{id:`arcface-r100`,label:`ArcFace (ResNet34)`},{id:`inception-resnet-v1`,label:`Inception ResNet V1`}]},{stepId:`clip-embedding`,label:`Semantic search model`,defaultModelId:`mobileclip-s1`,indexName:`the object semantic-search index`,options:[{id:`mobileclip-s1`,label:`MobileCLIP S1`},{id:`mobileclip-s2`,label:`MobileCLIP S2`},{id:`siglip2-b16-224`,label:`SigLIP2 B/16 (Apache-2.0)`}]}],zw=`cluster-step-models`;function Bw(e){return`clusterModel:${e}`}function Vw(e){return Rw.some(t=>t.stepId===e)}var Hw=Object.freeze(Object.fromEntries(Rw.map(e=>[e.stepId,e.defaultModelId])));function Uw(e){return e==null||e===``?{kind:`absent`}:typeof e==`string`?{kind:`chosen`,modelId:e}:{kind:`invalid`,value:e}}function Ww(e){let t=[];for(let n of Rw){let r=Uw(e[Bw(n.stepId)]);r.kind===`invalid`&&t.push({stepId:n.stepId,value:r.value})}return t}function Gw(e){let t={};for(let n of Rw){let r=Uw(e[Bw(n.stepId)]);t[n.stepId]=r.kind===`chosen`?r.modelId:n.defaultModelId}return t}function Kw(e){return typeof e==`object`&&!!e&&`key`in e}function qw(e){return e===null?Hw:Gw(Xw(e,Yw()))}function Jw(e){return e===null?[]:Ww(Xw(e,Yw()))}function Yw(){return new Set(Rw.map(e=>Bw(e.stepId)))}function Xw(e,t){let n={};for(let r of e.sections)for(let e of r.fields)!Kw(e)||typeof e.key!=`string`||t.has(e.key)&&(n[e.key]=e.value);return n}function Zw(e,t){let n=Rw.find(t=>t.stepId===e);if(n===void 0)return null;let r=t[e];return r!==void 0&&r!==``?r:n.defaultModelId}var Qw=24,$w=[{stepId:`face-embedding`,key:`minLandmarkFaceSize`,label:`Min face size for recognition (detection px)`,description:`Refuse to embed a face smaller than this IN THE DETECTION FRAME. Applies to every node — the enrolled gallery is one index, and two admission floors would fill it from two policies. 0 disables the gate.`,type:`slider`,min:0,max:64,step:2,default:24}];function eT(e,t){return`clusterStepSetting:${e}:${t}`}function tT(e){return $w.filter(t=>t.stepId===e)}var nT=i().finite();function rT(e){let t={};for(let n of $w){let r=nT.safeParse(e[eT(n.stepId,n.key)]),i=r.success?r.data:n.default,a=t[n.stepId]??{};t[n.stepId]={...a,[n.key]:i}}return t}var iT=rT({});function aT(e){return e===null?iT:rT(Xw(e,new Set($w.map(e=>eT(e.stepId,e.key)))))}function oT(e,t,n){let r=n[e];return r===void 0||Object.keys(r).length===0?t===void 0?void 0:{...t}:t===void 0?{...r}:{...t,...r}}var sT=y([`new`,`entered`,`left`,`moving`,`idle`]),cT=y([`motion`,`object`,`audio`]),lT=f(`kind`,[qx,Jx]),uT=y([`motion`,`audio`,`person`,`vehicle`,`animal`,`door`,`pir`,`smoke`,`water`,`button`,`package`,`generic`]),dT=y([`motion`,`audio`,`detection`,`sensor`,`control`,`custom`,`package`]),fT=y([`macro`,`sub`]),pT=u({kind:c(),labelKey:c(),label:c(),color:c(),iconId:c(),icon:uT,category:dT,parentKind:c().nullable(),level:fT,source:u({capName:c(),deviceId:i()})}),mT=u({deviceId:i(),kinds:b(pT).readonly()}),hT=u({id:c(),deviceId:i(),sourceDeviceId:i(),kind:c(),value:_(c(),o()).nullable(),timestamp:i()}),gT=u({x:i(),y:i(),timestamp:i(),bbox:uf,source:y([`frame`,`recovery`]).optional(),score:i().optional()}),_T=u({timestamp:i(),position:gT,mediaId:i().int()}),vT=u({minX:i(),minY:i(),maxX:i(),maxY:i()}),yT=y([`full`,`slim`]),bT=u({label:c(),peakScore:i(),count:i(),firstAt:i(),lastAt:i()}),xT=y([`pipeline`,`onboard`,`sensor`,`audio`]),ST=y([`none`,`staging`,`trained`]),CT=500,wT={markForTrain:x().optional(),debug:x().optional(),debugNote:c().max(500).optional(),favourited:x().optional()},TT={retrainStatus:ST.optional()},ET=u(wT),DT=u({trackId:c(),markForTrain:x(),debug:x(),debugNote:c(),favourited:x(),retrainStatus:ST}),OT=d([p(1),p(2)]),kT=u({stepId:c(),modelId:c().optional(),decidedAt:i(),identityId:c().optional()}),AT={label:c().optional(),labelScore:i().optional(),labelMeta:kT.optional(),subLabel:c().optional(),subLabelScore:i().optional(),subLabelMeta:kT.optional()},jT=u({deviceId:i(),tracks:i().int(),files:i().int(),bytes:i().int()}),MT=u({generatedAt:i(),trackCount:i().int(),fileCount:i().int(),byteCount:i().int(),truncated:x(),devices:b(jT).readonly()}),NT=u({trackId:c(),deviceId:i(),className:c(),...AT,producingDeviceName:c().optional(),source:xT.optional(),firstSeen:i(),lastSeen:i(),positions:b(gT).readonly(),snapshots:b(_T).readonly(),zonesVisited:b(c()).readonly(),zoneNames:b(c()).readonly().optional(),classes:b(c()).readonly().optional(),totalDistance:i(),state:sT,active:x(),importance:i().optional(),bestEventId:c().optional(),importanceReason:c().optional(),audioLabels:b(bT).readonly().optional(),envelope:vT.optional(),hasFace:x().optional(),hasEmbeddedFace:x().optional(),hasRider:x().optional(),previewMissReason:c().optional(),modelId:c().optional(),frameWidth:i().optional(),frameHeight:i().optional(),...wT,...TT}),PT={id:i().int(),deviceId:i(),timestamp:i()},FT=u({...PT,kind:p(`motion`),regionCount:i(),regions:b(u({bbox:uf,pixelCount:i(),intensity:i()})).readonly().optional(),frameWidth:i().optional(),frameHeight:i().optional(),mediaUrl:c().optional(),triggeredBy:vw.optional(),durationMs:i().nullable().optional(),edges:b(i()).readonly().optional()}),IT=y([`pipeline`,`onboard`]),LT=y([`enter`,`exit`]),RT=u({direction:LT,zoneId:c(),zoneName:c().optional()}),zT=u({zoneId:c(),zoneName:c().optional(),overlapPct:i()}),BT=u({...PT,kind:p(`object`),source:IT.optional(),frameId:c().optional(),idempotencyKey:c().optional(),trackId:c().optional(),className:c(),...AT,confidence:i().optional(),bbox:uf.optional(),zones:b(c()).readonly().optional(),zoneOverlaps:b(zT).readonly().optional(),spawnRefused:c().optional(),state:sT.optional(),zoneCrossing:RT.optional(),frameWidth:i().optional(),frameHeight:i().optional(),mediaId:i().int().optional(),keyFrameMediaId:i().int().optional(),mediaUrl:c().optional(),observedAt:i().optional(),importance:i().optional()}),VT=u({...PT,kind:p(`audio`),rms:i(),dbfs:i(),classification:u({className:c(),originalClass:c().optional(),score:i()}).optional(),classifyOutcome:gf.optional(),mediaUrl:c().optional()}),HT=y([`crop`,`thumbnail`,`snapshot`,`firstFrame`,`lastFrame`,`fullFrame`,`fullFrameBoxed`,`faceCrop`,`plateCrop`,`keyFrame`,`keyFrameSmall`,`thumbnailSmall`,`confirmationCrop`,`debugCrop`,`sceneFrame`,`lastSceneFrame`]),UT=u({mediaId:i().int(),kind:HT,sizeBytes:i(),timestamp:i()}),WT=UT.extend({url:c(),base64:c()}),GT=WT.omit({base64:!0}),KT=y([`person`,`vehicle`,`animal`,`package`,`face`,`plate`]),qT=y([`subject`,`model_error`]),JT=y([`operator`,`assist`]),YT=u({x:i(),y:i(),w:i(),h:i()}),XT=u({id:c(),trackId:c(),deviceId:i(),mediaKey:c(),bbox:YT,macroClass:KT,label:c().optional(),subLabel:c().optional(),kind:qT,source:JT,assistModelId:c().optional(),assistScore:i().optional(),exportedInBatch:c().optional(),createdAt:i()}),ZT=XT.omit({id:!0,trackId:!0,deviceId:!0,mediaKey:!0,createdAt:!0,exportedInBatch:!0}),QT=u({trackId:c(),deviceId:i(),className:c(),label:c().optional(),firstSeen:i(),lastSeen:i(),frameCount:i().int(),annotationCount:i().int()}),$T=u({mediaId:i().int(),kind:HT,timestamp:i(),sizeBytes:i().int(),copied:x()}),eE=u({frameId:c(),deviceId:i(),trackId:c(),sourceMediaId:i().int(),sourceKind:HT,sizeBytes:i().int(),width:i().int(),height:i().int(),copiedAt:i()}),tE=y([`source-missing`,`unreadable-image`,`write-failed`]),nE=u({copied:b(eE).readonly(),refused:b(u({sourceMediaId:i().int(),reason:tE})).readonly()}),rE=u({candidates:b($T).readonly(),copies:b(eE).readonly(),autoPickMediaId:i().int().optional()}),iE=f(`kind`,[u({kind:p(`package`),zone:YT.optional()}),u({kind:p(`objects`),modelId:c(),minScore:i().optional()})]),aE=f(`kind`,[u({kind:p(`proposed`),modelId:c(),stepId:c(),minScore:i(),proposals:b(ZT).readonly(),belowThreshold:i().int()}),u({kind:p(`refused`),reason:c(),detail:c().optional()})]),oE=u({trackId:c(),retrainStatus:ST,changed:x(),reason:y([`unknown-track`,`no-frames-copied`,`not-staging`,`not-trained`,`unchanged`]).optional()}),sE=1e3,cE=5e3,lE=u({deviceId:i(),since:i().optional(),until:i().optional(),limit:i().int().min(1).max(cE).default(sE),projection:y([`full`,`slim`]).optional()}),uE=lE.extend({classFilter:c().optional()}),dE=u({deviceIds:b(i()),since:i().optional(),until:i().optional(),limit:i().int().min(1).max(1e3).default(200),cursor:c().optional(),projection:yT.optional(),includeStationary:x().optional(),classes:b(c()).optional(),excludeSources:b(xT).optional()}),fE=u({tracks:b(NT).readonly(),nextCursor:c().nullable()}),pE=50,mE=200,hE=u({deviceId:i(),since:i(),until:i(),limit:i().int().min(1).max(mE).default(pE),minImportance:i().min(0).max(1).optional(),classFilter:c().optional()}),gE=u({id:c(),trackId:c(),timestamp:i(),className:c(),...AT,importance:i(),bestEventId:c(),windowMs:i().optional(),...wT,...TT}),_E=u({deviceIds:b(i()).min(1).max(200),since:i(),until:i(),limit:i().int().min(1).max(mE).default(pE),minImportance:i().min(0).max(1).optional(),classFilter:c().optional()}),vE=u({deviceId:i(),events:b(gE).readonly()}),yE=u({bucketStart:i(),motion:i().int(),object:i().int(),audio:i().int(),audioDbfs:i().optional()}),bE=200,xE=u({deviceId:i(),read:y([`read`,`unreadable`]),buckets:b(yE).readonly()}),SE=u({trackId:c(),className:c(),confidence:i(),bbox:uf,zones:b(c()).readonly(),state:sT}),CE=a({id:c(),kind:y([`first-level`,`detail`]),macroClass:c(),score:i(),bbox:u({x:i(),y:i(),width:i(),height:i()}),labels:b(a({label:c(),score:i()})).readonly(),parentId:c().optional()}),wE=BT.extend({score:i()}),TE=u({text:c(),deviceId:i().optional(),since:i().optional(),until:i().optional(),classFilter:c().optional(),limit:i().default(50),minScore:i().min(0).max(1).optional(),strictness:Vu.optional(),modelId:c().min(1).optional()}),EE=u({tracks:i().int(),events:i().int(),media:i().int(),faces:i().int(),plates:i().int(),embeddings:i().int()}),DE=u({mediaDropped:i().int(),tracks:i().int(),events:i().int()}),OE=u({deviceId:i(),rows:i().int(),bytes:i().int()}),kE=u({totalRows:i().int(),totalBytes:i().int(),devices:b(OE).readonly()}),AE=u({kind:HT,rows:i().int(),bytes:i().int()}),jE=u({totalRows:i().int(),totalBytes:i().int(),kinds:b(AE).readonly(),unaccountedRows:i().int(),unaccountedBytes:i().int()}),ME=u({motion:i().int(),object:i().int(),audio:i().int()}),NE=u({deviceId:i().optional(),since:i().optional(),until:i().optional(),maxTracks:i().int().positive().optional(),executeOnNodeId:c().optional(),pacingMs:i().int().nonnegative().optional(),force:x().optional()}),PE=u({deleted:i(),failedIndexes:b(c()).optional()}),FE=y([`stores-unavailable`,...Lw,`method-unavailable`,`read-failed`,`reads-disagree`,`not-a-clip-model`,`force-requires-max-tracks`]),IE=u({started:x(),alreadyRunning:x(),refusal:FE.optional(),modelId:c().optional(),index:c().optional()}),LE=u({running:x(),scanned:i(),rebuilt:i(),missingKeyFrame:i(),missingEvent:i(),missingBbox:i(),boxSource:u({subjectBox:i(),positions:i(),event:i(),refused:i()}),alreadyInSpace:i(),force:x().nullable(),forcedInSpace:i(),notRunnable:i(),noCapableNode:i(),failed:i(),complete:x().nullable(),startedAtMs:i().nullable(),finishedAtMs:i().nullable(),error:c().nullable(),modelId:c().nullable(),index:c().nullable()}),RE=u({started:x(),alreadyRunning:x()}),zE=u({mode:y([`report`,`reclaim`]).default(`report`),scopes:b(y([`motion-still`,`track-filmstrip`])).min(1).optional(),deviceIds:b(i().int()).min(1).optional(),restart:x().optional(),pageSize:i().int().min(50).max(5e3).optional(),maxRowsPerDevice:i().int().min(1).max(5e5).optional(),maxReclaimPerDevice:i().int().min(1).max(5e5).optional(),maxBytesPerRun:i().int().min(1).optional(),budgetMinutes:i().int().min(1).max(720).optional(),throttleBytesPerSec:i().int().min(64*1024).optional(),graceMinutes:i().int().min(1).max(10080).optional()}),BE=u({running:x(),mode:y([`report`,`reclaim`]).nullable(),totalExamined:i(),totalEligible:i(),totalReclaimed:i(),totalBytesReclaimed:i(),totalRefused:i(),devicesDone:i(),complete:x().nullable(),startedAtMs:i().nullable(),finishedAtMs:i().nullable(),error:c().nullable()}),VE=y([`motion`,`audio-dbfs`,`battery`,`occupancy`]),HE=`|`;function UE(e,t){let n=e??``;return t===void 0?n:`${n}|${t}`}function WE(e){let t=e.indexOf(`|`);return t<0?{zoneId:e}:{zoneId:e.slice(0,t),className:e.slice(t+1)}}var GE=u({scope:c(),bucketStart:i().int(),samples:i().int().nonnegative(),sum:i(),min:i(),max:i()}),KE={name:`pipeline-analytics`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[E.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:w(u({deviceId:i()}),b(NT).readonly()),getTrack:w(u({deviceId:i(),trackId:c()}),NT.nullable()),listTracks:w(u({deviceId:i(),since:i().optional(),until:i().optional(),limit:i().optional(),zone:lT.optional(),projection:yT.optional(),includeStationary:x().optional(),classes:b(c()).optional(),excludeSources:b(xT).optional()}),b(NT).readonly()),listRecentTracks:w(dE,fE),clearTracks:w(u({deviceId:i()}),g(),{kind:`mutation`,auth:`admin`}),getMotionEvents:w(lE,b(FT).readonly()),getObjectEvents:w(uE,b(BT).readonly()),getAudioEvents:w(lE,b(VT).readonly()),listEventKinds:w(u({deviceId:i()}),b(pT).readonly()),listEventKindsBatch:w(u({deviceIds:b(i()).min(1).max(200)}),b(mT).readonly()),getSensorEvents:w(u({deviceId:i(),since:i().optional(),until:i().optional(),kinds:b(c()).optional(),limit:i().int().min(1).max(cE).default(sE)}),b(hT).readonly()),getKeyEvents:w(hE,b(gE).readonly()),getKeyEventsBatch:w(_E,b(vE).readonly()),readLongTermSeries:w(u({deviceId:i(),series:VE,scope:c().optional(),from:i(),to:i(),limit:i().int().positive().optional()}),b(GE).readonly()),getEventDensity:w(u({deviceId:i(),since:i(),until:i(),bucketMs:i().int().positive()}),b(yE).readonly()),getEventDensityBatch:w(u({deviceIds:b(i()).min(1).max(200),since:i(),until:i(),bucketMs:i().int().positive()}),b(xE).readonly()),pruneEventsBefore:w(u({deviceId:i(),cutoffMs:i()}),u({motion:i().int(),object:i().int(),audio:i().int()}),{kind:`mutation`,auth:`admin`}),pruneTracksBefore:w(u({deviceId:i(),cutoffMs:i()}),EE,{kind:`mutation`,auth:`admin`}),wipeAllAnalytics:w(u({deviceId:i()}),EE,{kind:`mutation`,auth:`admin`}),reconcileFromDisk:w(u({deviceId:i()}),DE,{kind:`mutation`,auth:`admin`}),deleteTracks:w(u({deviceId:i(),trackIds:b(c()).min(1)}),u({deleted:i().int(),failed:b(c()).readonly(),sparedMediaIds:b(i().int()).readonly().optional()}),{kind:`mutation`,auth:`admin`}),setTrackFlags:w(u({deviceId:i(),trackId:c(),flags:ET}),DT,{kind:`mutation`}),listArchivedDebugNotes:w(cs,b(ss).readonly(),{kind:`query`}),setTrackRelation:w(_s,hs,{kind:`mutation`}),clearTrackRelation:w(vs,ys,{kind:`mutation`}),setTrackPurity:w(bs,xs,{kind:`mutation`}),listTrackRelations:w(Ss,Cs,{kind:`query`}),listBirthDecisions:w(is,b(rs).readonly(),{kind:`query`}),getEventStoreFootprint:w(u({}),kE,{kind:`query`,auth:`admin`}),getEventMediaFootprintByKind:w(u({deviceId:i().int().optional()}),jE,{kind:`query`,auth:`admin`}),pruneEvents:w(u({olderThanMs:i(),reason:Bs.optional()}),ME,{kind:`mutation`,auth:`admin`}),deleteDeviceEvents:w(u({deviceId:i()}),ME,{kind:`mutation`,auth:`admin`}),pauseForStorageMigration:w(I,u({paused:p(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:w(I,u({resumed:p(!0)}),{kind:`mutation`,auth:`admin`}),refreshStorageLocationsForMigration:w(I,u({refreshed:p(!0)}),{kind:`mutation`,auth:`admin`}),startStorageMigrationMove:w(Mc,u({jobId:c()}),{kind:`mutation`,auth:`admin`}),getStorageMigrationMoveStatus:w(u({jobId:c()}),wc.nullable(),{auth:`admin`}),cancelStorageMigrationMove:w(u({jobId:c()}),u({cancelled:x()}),{kind:`mutation`,auth:`admin`}),relocateMedia:w(kc,u({jobId:c()}),{kind:`mutation`,auth:`admin`}),countUnstampedEventMedia:w(u({}),jc,{auth:`admin`}),countRelocatableMedia:w(al,il,{kind:`query`,auth:`admin`}),listRelocateMediaJobs:w(u({}),b(wc).readonly(),{kind:`query`,auth:`admin`}),cancelRelocateMedia:w(u({jobId:c()}),u({cancelled:x()}),{kind:`mutation`,auth:`admin`}),listOpsLog:w(Hs,b(Vs).readonly(),{kind:`query`,auth:`admin`}),reclaimDebugMedia:w(zE,RE,{kind:`mutation`,auth:`admin`}),getMediaReclaimStatus:w(u({}),BE,{kind:`query`,auth:`admin`}),getTrainingExportSummary:w(u({deviceIds:b(i()).optional()}),MT,{kind:`query`,auth:`admin`}),getTrainingExportUrl:w(u({deviceIds:b(i()).optional()}),u({url:c()}),{kind:`query`,auth:`admin`}),listRetrainStaging:w(u({deviceIds:b(i()).optional(),limit:i().int().min(1).max(500).optional()}),b(QT).readonly(),{kind:`query`,auth:`admin`}),listRetrainFrames:w(u({trackId:c()}),rE,{kind:`query`,auth:`admin`}),selectRetrainFrames:w(u({deviceId:i(),trackId:c(),mediaIds:b(i().int()).min(1)}),nE,{kind:`mutation`,auth:`admin`}),deselectRetrainFrame:w(u({deviceId:i(),trackId:c(),frameId:c()}),u({removed:x(),removedAnnotations:i().int()}),{kind:`mutation`,auth:`admin`}),getRetrainFrameImage:w(u({frameId:c()}),u({base64:c(),width:i().int(),height:i().int()}),{kind:`query`,auth:`admin`}),proposeRetrainAnnotations:w(u({deviceId:i(),trackId:c(),frameId:c(),subject:iE,nodeId:c().optional()}),aE,{kind:`mutation`,auth:`admin`}),listRetrainAnnotations:w(u({trackId:c()}),b(XT).readonly(),{kind:`query`,auth:`admin`}),saveRetrainAnnotations:w(u({deviceId:i(),trackId:c(),frameId:c(),annotations:b(ZT)}),b(XT).readonly(),{kind:`mutation`,auth:`admin`}),completeRetrainTrack:w(u({deviceId:i(),trackId:c()}),oE,{kind:`mutation`,auth:`admin`}),restageRetrainTrack:w(u({deviceId:i(),trackId:c()}),oE,{kind:`mutation`,auth:`admin`}),getRetrainExportUrl:w(u({deviceIds:b(i()).optional()}),u({url:c()}),{kind:`query`,auth:`admin`}),getEventMedia:w(u({ownerType:ba,eventId:i().int(),kind:HT.optional(),deviceId:i()}),b(WT).readonly()),getTrackMedia:w(u({trackId:c(),kinds:b(HT).optional(),deviceId:i()}),b(WT).readonly()),listTrackMedia:w(u({trackId:c(),deviceId:i()}),b(GT).readonly()),listEventMedia:w(u({ownerType:ba,eventId:i().int(),deviceId:i()}),b(GT).readonly()),ownersWithMedia:w(u({deviceId:i(),ownerKind:Sa,ownerIds:b(c()).max(5e3)}),b(c()).readonly()),searchObjectEvents:w(TE,b(wE).readonly(),{caller:`required`}),wipeObjectEmbeddings:w(u({}),PE,{kind:`mutation`,auth:`admin`}),rebuildObjectEmbeddings:w(NE,IE,{kind:`mutation`,auth:`admin`}),getObjectEmbeddingRebuildStatus:w(u({}),LE)},events:{onFrameTracked:{data:u({deviceId:i(),timestamp:i(),frameWidth:i(),frameHeight:i(),detections:b(CE).readonly()})},onTrackStarted:{data:u({deviceId:i(),trackId:c(),className:c()})},onTrackEnded:{data:u({deviceId:i(),trackId:c(),className:c(),durationMs:i()})},onDetectionEvent:{data:u({deviceId:i(),kind:cT,eventId:c(),timestamp:i()})}}},qE=u({handle:C,cropFrameSpace:u({x:i(),y:i(),w:i(),h:i()})});u({crop:u({left:i(),top:i(),width:i().positive(),height:i().positive()}).optional(),content:u({width:i().int().positive(),height:i().int().positive()}),fit:y([`stretch`,`contain`]),format:y([`rgb`,`gray`,`jpeg`])});var JE=u({registryId:c().min(1),id:c().min(1),width:i().int().positive(),height:i().int().positive(),format:y([`rgb`,`gray`]),timestamp:i(),capturedAt:i().optional()}),YE=y([`onnx`,`coreml`,`openvino`,`tflite`,`pt`,`gguf`]),XE=y([`detector`,`cropper`,`classifier`,`refiner`,`audio-classifier`]),Y=u({runtime:p(`python`),backend:c(),format:YE,device:c().optional()}),ZE=u({deviceKey:c().nullable(),runtime:c(),batchMode:c(),windowMs:i(),maxBatchSize:i(),concurrency:i(),numWorkers:i()}),QE=u({engine:Y,devices:b(u({id:c(),label:c(),description:c().optional()})).readonly(),defaultDevice:c()}),$E=me(()=>u({addonId:c(),addonName:c(),slot:XE,inputClasses:b(c()).readonly(),outputClasses:b(c()).readonly(),enabled:x(),modelId:c(),children:b($E).readonly(),group:c().optional(),settings:_(c(),o()).optional()})),eD=me(()=>u({addonId:c(),enabled:x(),modelId:c(),children:b(eD).readonly(),settings:_(c(),o()).optional()})),tD=u({id:c(),name:c(),createdAt:c(),updatedAt:c(),engine:Y,steps:b(eD).readonly()}),nD=u({id:c(),name:c(),formats:_(c(),u({downloaded:x(),sizeMB:i()})),group:Ju.optional(),legacy:x().optional(),provider:Xu.optional(),defaultConfidence:i().optional()}),rD=h(),iD=u({id:c(),name:c(),slot:XE,inputClasses:b(c()).readonly(),outputClasses:b(c()).readonly(),childSlots:b(XE).readonly(),models:b(nD).readonly(),defaultModelId:c(),defaultModelIdByFormat:_(c(),c()).optional(),enabledByDefault:x().optional(),backfillIntoExistingOverrides:x().optional(),defaultConfidence:i(),group:c().optional(),configSchema:b(rD).readonly().optional()}),aD=u({id:XE,label:c(),priority:i(),parentSlot:XE.nullable(),addons:b(iD).readonly()}),oD=u({availableEngines:b(QE).readonly(),selectedEngine:Y,slots:b(aD).readonly()}),sD=u({runtimeId:y([`onnx`,`openvino`,`coreml`,`edgetpu`]).nullable(),device:c().nullable(),state:y([`idle`,`installing`,`verifying`,`ready`,`failed`]),progress:i().optional(),error:c().optional(),nextRetryAt:i().optional(),configIssues:b(c()).optional()}),cD=me(()=>u({addonId:c(),modelId:c().optional(),enabled:x().default(!0),children:b(cD).optional(),settings:_(c(),o()).optional(),jumpDeviceKey:c().optional()})),lD=u({addonId:c(),chosen:c(),running:c(),format:c()}),uD=u({addonId:c(),kind:y([`unknown-addon`,`no-format-build`,`unknown-device`]),detail:c()}),dD=u({ok:x(),issues:b(uD).readonly(),substitutions:b(lD).readonly(),format:c()}),fD=u({filename:c(),stepIds:b(c()).readonly().optional()}),pD=u({base64:c(),filename:c()}),mD=u({filename:c(),sizeKb:i()}),hD=u({base64:c()}),gD=u({id:c(),name:c(),description:c(),available:x(),rawLabels:b(c()).readonly().optional()}),_D=u({activeBackend:c(),availableBackends:b(gD).readonly(),sampleRate:i(),chunkDurationMs:i()}),vD=u({filePath:c(),sizeMB:i(),durationMs:i()}),yD=u({success:x(),error:c().optional(),frame:h().optional()}),bD=h(),xD=h(),SD=h(),CD=h(),wD=h(),TD=h(),ED={name:`pipeline-executor`,scope:`system`,mode:`singleton`,methods:{getAvailableEngines:w(g(),b(Y)),getSelectedEngine:w(g(),Y),getDefaultSteps:w(Y,b($E)),getEngineProvisioning:w(u({nodeId:c()}),sD),getVideoPipelineSteps:w(g(),_(c(),u({modelId:c(),settings:_(c(),o()).readonly()}))),setVideoPipelineSteps:w(u({steps:_(c(),u({modelId:c(),settings:_(c(),o()).readonly()}))}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),clearDeviceOverrides:w(u({nodeId:c()}),u({success:p(!0),clearedDevices:i()}),{kind:`mutation`,auth:`admin`}),getInferenceDeviceHealth:w(u({nodeId:c()}),u({unhealthy:b(u({deviceKey:c(),state:y([`failed`,`backoff`]),since:i(),deaths:i(),lastError:c()})).readonly()})),rearmInferenceDevice:w(u({nodeId:c(),deviceKey:c()}),u({rearmed:x()}),{kind:`mutation`,auth:`admin`}),getSchema:w(g(),oD),getGlobalSteps:w(g(),b($E).readonly().nullable()),getGlobalPipelineConfig:w(g(),bD),getOrchestratorConfigSchema:w(g(),xD),validatePipeline:w(u({steps:b(cD),deviceKey:c().optional()}),dD),listTemplates:w(g(),b(tD).readonly()),saveTemplate:w(u({name:c(),steps:b(eD).readonly(),engine:Y}),tD,{kind:`mutation`}),updateTemplate:w(u({id:c(),name:c().optional(),steps:b(eD).readonly().optional()}),tD,{kind:`mutation`}),deleteTemplate:w(u({id:c()}),g(),{kind:`mutation`}),getCapabilities:w(g(),CD),getAddonModels:w(u({addonId:c()}),wD),downloadModel:w(u({addonId:c(),modelId:c(),format:YE}),vD,{kind:`mutation`}),deleteModel:w(u({addonId:c(),modelId:c(),format:YE}),u({success:p(!0)}),{kind:`mutation`}),runPipeline:w(u({steps:b(cD).min(1),frame:lf.optional(),frameRef:JE.optional(),frameHandle:C.optional(),imageBase64:c().optional(),image:v(Uint8Array).optional(),referenceImage:c().optional(),deviceId:i().optional(),sessionId:c().optional(),plane:y([`full`,`frame`]).optional(),deviceKey:c().optional(),nativeCropRef:qE.optional(),replay:p(!0).optional()}),TD,{kind:`mutation`}),runPipelineBatch:w(u({steps:b(cD).min(1),frames:b(lf).min(1).max(255),deviceId:i().optional(),sessionId:c().optional(),frameId:i().int().nonnegative().optional(),deviceKey:c().optional()}),u({results:b(TD).readonly()}),{kind:`mutation`}),cacheFrameInPool:w(u({data:v(Uint8Array),width:i().int().positive(),height:i().int().positive(),format:y([`rgb`,`bgr`,`gray`])}),u({frameId:i(),width:i(),height:i()}),{kind:`mutation`}),inferCached:w(u({stepId:c(),frameId:i().int(),modelId:c().min(1)}),_(c(),o()),{kind:`mutation`}),uncacheFrame:w(u({frameId:i().int()}),g(),{kind:`mutation`}),getEffectiveTuning:w(u({deviceKey:c().optional()}),ZE),listLoadedEngines:w(g(),b(u({engineKey:c(),engine:Y,modelsLoaded:b(c()).readonly(),inUseByCameras:b(i()).readonly(),kind:y([`runtime`,`device-pool`]),poolPid:i().nullable(),idleMs:i().nullable(),idleTtlMs:i().nullable()})).readonly()),spinEngine:w(u({engine:Y}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),killEngine:w(u({engine:Y,force:x().optional()}),u({success:x(),reason:c().optional()}),{kind:`mutation`,auth:`admin`}),listReferenceImages:w(g(),b(fD).readonly()),getReferenceImage:w(u({filename:c()}),pD.nullable()),getReferenceAudioFiles:w(g(),b(mD).readonly()),getReferenceAudio:w(u({filename:c()}),hD.nullable()),getAudioCapabilities:w(g(),_D),runAudioTest:w(u({addonId:c(),modelId:c(),filename:c().optional(),settings:_(c(),o()).optional()}),yD,{kind:`mutation`}),getDetectionConfigSchema:w(g(),SD)}},DD=u({activeCameras:i(),throttledCameras:i(),avgInferenceTimeMs:i(),queueDepth:i()}),OD=u({detectionMode:y([`disabled`,`always-on`,`on-motion`]),configuredFps:i(),actualFps:i(),queueDepth:i(),avgInferenceTimeMs:i(),droppedFrames:i(),phase:y([`idle`,`watching`,`active`])}),kD=OD.extend({deviceId:i()}),AD=y([`polygon`,`tripwire`]),jD=u({x:i(),y:i()}),MD=u({id:c(),name:c(),kind:AD.default(`polygon`),polygon:b(jD).readonly(),color:c().default(`#3b82f6`)}),ND={name:`zones`,scope:`device`,mode:`singleton`,deviceTypes:[E.Camera],methods:{listZones:w(u({deviceId:i()}),b(MD).readonly()),addZone:w(u({deviceId:i(),zone:MD}),g(),{kind:`mutation`,auth:`admin`}),removeZone:w(u({deviceId:i(),zoneId:c()}),g(),{kind:`mutation`,auth:`admin`}),updateZone:w(u({deviceId:i(),zone:MD}),g(),{kind:`mutation`,auth:`admin`})},runtimeState:u({zones:b(MD).readonly()}),durability:`restored`},PD=u({x:i(),y:i(),w:i(),h:i()}),FD=u({bytes:v(Uint8Array).optional(),jpeg:c().optional(),jpegBytes:v(Uint8Array).optional(),width:i().int().positive(),height:i().int().positive(),tier:y([`native`,`ram-fullframe`]).optional()}),ID=y([`keyFrame`,`thumbnail`]),LD=y([`handle-gone`,`encode-failed`]),RD=f(`parked`,[u({parked:p(!0),nodeId:c(),width:i().int().positive(),height:i().int().positive(),bytes:i().int().nonnegative(),replaced:x()}),u({parked:p(!1),nodeId:c(),reason:LD,handleAgeMs:i().nullable(),detail:c().optional()})]),zD=u({jpeg:c().optional(),jpegBytes:v(Uint8Array).optional(),width:i().int().positive(),height:i().int().positive(),timestamp:i(),parkedAt:i()}),BD=u({bbox:PD,className:c()}),VD=u({stepId:c(),className:c(),score:i(),bbox:PD.optional(),embedding:c().optional(),embeddingMagnitude:i().optional(),embeddingModelId:c().optional(),label:c().optional(),labelTier:d([p(1),p(2)]).optional(),labelModelId:c().optional(),alignedCropJpeg:c().optional(),nativeFaceShortSidePx:i().optional(),landmarks:b(u({x:i(),y:i()})).optional()}),HD=y([`unknown-step`,`model-not-servable`,`unreadable-frame`,`execution-failed`]),UD=f(`kind`,[u({kind:p(`ran`),nodeId:c(),modelId:c(),details:b(VD)}),u({kind:p(`refused`),nodeId:c(),reason:HD,detail:c()})]),WD={min:0,max:6e4,default:3e4,step:500},GD={min:0,max:6e5,default:12e4,step:5e3},KD={min:5e3,max:6e5,default:9e4,step:5e3},qD={min:1,max:30,default:4,step:1},JD={min:1,max:30,default:10,step:1},YD={min:0,max:300,default:300,step:5},XD={min:1,max:10,default:4,step:1},ZD={min:0,max:30,default:12,step:1},QD=y([`onboard`,`analyzer`,`device-activity`]),$D=b(QD),eO={analyzer:`Frame-diff Analyzer (motion addon)`,onboard:`Camera sensors`,"device-activity":`Device activity (the device says it is working)`};function tO(e){let t=QD.safeParse(e);return t.success?eO[t.data]:e}var nO=[`analyzer`,`onboard`,`device-activity`],rO=n(e=>Array.isArray(e)&&e.length>1?e.slice(0,1):e,b(IT).max(1)),iO=u({deviceId:i(),detected:x(),source:QD.default(`analyzer`),regions:b(Lb).readonly().optional()}),aO=f(`kind`,[u({kind:p(`local-broker`)}),u({kind:p(`remote-restream`),ownerNodeId:c(),ownerReachableHost:c().optional(),hubHostnameOverride:c().optional()})]).describe(`Per-camera frame-source mode for the runner (P2c)`),oO=u({modelId:c().optional(),settings:_(c(),o()).optional()}),sO=u({deviceKey:c(),weight:i().positive().default(1),maxSessions:i().int().positive().nullable().default(null),steps:_(c(),oO).optional()}),cO=u({deviceId:i(),detectionMode:y([`disabled`,`always-on`,`on-motion`]).default(`on-motion`),audioMode:y([`disabled`,`always-on`,`on-motion`]).default(`always-on`),motionCooldownMs:i().min(WD.min).default(WD.default),maxSessionHoldMs:i().min(GD.min).max(GD.max).optional(),audioMotionWindowMs:i().min(KD.min).max(KD.max).optional(),motionFps:i().min(qD.min).max(qD.max).default(qD.default),detectionFps:i().min(JD.min).max(JD.max).default(JD.default),motionStreamId:c(),detectionStreamId:c(),audioStreamPick:ot.optional(),motionSources:$D.default([`analyzer`]),detectionSources:rO.default([`pipeline`]),pipelineEnabled:x().default(!0),steps:b(cD).readonly().optional(),audio:u({modelId:c().optional(),enabled:x()}).nullable().optional(),zones:b(MD).readonly().default([]),onboardMotionDrivesAnalyzer:x().default(!0),preRollInferenceEnabled:x().default(!0),preRollInferenceFrames:i().min(ZD.min).max(ZD.max).default(ZD.default),occupancyRecheckEnabled:x().default(!0),occupancyRecheckSec:i().min(YD.min).max(YD.max).default(YD.default),occupancyRecheckFrames:i().min(XD.min).max(XD.max).default(XD.default),frameSource:aO.default({kind:`local-broker`}),deviceKey:c().optional(),inferenceDevices:b(sO).readonly().optional()}),lO=[{key:`motionSources`,type:`multiselect`,label:`Motion Sources`,default:[`analyzer`],options:nO.map(e=>e===`onboard`?{value:e,label:eO[e],description:`The camera's own motion, plus any sensor attached to it`}:{value:e,label:eO[e]})},{key:`detectionSources`,type:`multiselect`,label:`Detection Sources`,default:[`pipeline`],options:[{value:`pipeline`,label:`This node (ML root step on decoded frames)`},{value:`onboard`,label:`Camera onboard AI (replaces the root step when picked alone)`}]},{key:`motionFps`,type:`slider`,label:`Motion FPS (analyzer)`,min:qD.min,max:qD.max,step:qD.step,default:qD.default,showValue:!0,unit:`fps`,nullable:!0,nullLabel:`Default`,showWhen:{field:`motionSources`,includes:`analyzer`}},{key:`detectionFps`,type:`slider`,label:`Detection FPS`,min:JD.min,max:JD.max,step:JD.step,default:JD.default,showValue:!0,unit:`fps`,nullable:!0,nullLabel:`Default`},{key:`motionCooldownMs`,type:`slider`,label:`Motion Cooldown`,description:`Time without a fresh motion event before the active phase ends. Applies to all motion sources — every motion event re-arms the timer.`,min:WD.min,max:WD.max,step:WD.step,default:WD.default,showValue:!0,unit:`s`,displayScale:1e3,nullable:!0,nullLabel:`Default`},{key:`maxSessionHoldMs`,type:`slider`,label:`Max session hold`,description:`Upper bound on how long detection keeps running past the motion cooldown while a subject is still moving in-frame but no longer triggering motion. Prevents the detection box from stopping on a slow-moving subject. Set to 0 to disable.`,min:GD.min,max:GD.max,step:GD.step,default:GD.default,showValue:!0,unit:`s`,displayScale:1e3,nullable:!0,nullLabel:`Default`},{key:`audioMotionWindowMs`,type:`slider`,label:`Audio window after motion`,description:`How long audio keeps being analysed after the last motion event. Each new motion event extends the window without restarting the audio stream.`,min:KD.min,max:KD.max,step:KD.step,default:KD.default,showValue:!0,unit:`s`,displayScale:1e3,nullable:!0,nullLabel:`Default`,showWhen:{field:`audioMode`,equals:`on-motion`}},{key:`onboardMotionDrivesAnalyzer`,type:`boolean`,label:`Run motion analyzer on onboard motion`,description:`When onboard motion is detected, temporarily start the frame-diff analyzer to emit zone results. Stops after the motion cooldown window.`,default:!0,showWhen:{field:`motionSources`,includes:`onboard`}},{key:`preRollInferenceEnabled`,type:`boolean`,style:`checkbox`,label:`Detect in the pre-roll`,description:`Run detection over the few seconds of footage the camera had already buffered when motion fired, so a subject that was in view before the trigger is found at the moment it appeared rather than seconds later. The burst is bounded and never delays live detection.`,default:!0},{key:`preRollInferenceFrames`,type:`slider`,label:`Pre-roll frames`,description:`How many frames of buffered history may be detected on, per session. Higher samples the history more densely; 0 disables the pass.`,min:ZD.min,max:ZD.max,step:ZD.step,default:ZD.default,showValue:!0,showWhen:{field:`preRollInferenceEnabled`,equals:!0}},{key:`occupancyRecheckEnabled`,type:`boolean`,style:`checkbox`,label:`Occupancy re-check`,description:`Periodically re-sample a few frames during the watching phase, so objects that are simply parked are still counted (motion gating alone loses them after a restart). On by default at a wide interval; turn it off on cameras where the extra decoder re-dial is expensive.`,default:!0},{key:`occupancyRecheckSec`,type:`slider`,label:`Occupancy re-check interval`,description:`How often (in seconds) the runner re-samples a few frames to confirm the scene is truly empty during the watching phase.`,min:YD.min,max:YD.max,step:YD.step,default:YD.default,showValue:!0,unit:`s`,showWhen:{field:`occupancyRecheckEnabled`,equals:!0}},{key:`occupancyRecheckFrames`,type:`slider`,label:`Occupancy re-check frames`,description:`Number of frames sampled per occupancy re-check burst.`,min:XD.min,max:XD.max,step:XD.step,default:XD.default,showValue:!0,showWhen:{field:`occupancyRecheckEnabled`,equals:!0}}],uO=u({nodeId:c(),attachedCameras:i(),activeCameras:i(),avgInferenceFps:i(),avgInferenceTimeMs:i(),queueDepthTotal:i(),devices:b(u({deviceKey:c(),backend:c(),attachedCameras:i(),queueDepthTotal:i()})).default([]),hardware:u({hasGpu:x(),inferenceBackend:c().optional(),cpuCores:i().optional()}),motionSliceWriter:p(`orchestrator`).optional()}),dO=u({framesDecoded:i(),framesAdmitted:i(),framesDroppedPixelFree:i(),viewsMaterialized:i(),viewsSkipped:i(),workerToRunnerBytes:i(),runnerToPoolRawBytes:i(),runnerToPoolJpegBytes:i(),onDemandFullFrameRequests:i(),onDemandCropRequests:i(),nativeHits:i(),nativeMisses:i(),tileHits:i(),tileMisses:i(),fallbackHits:i(),fallbackMisses:i(),retainedWritesAvoided:i(),residentRefs:i(),residentBytes:i(),releases:i(),evictions:i(),staleMisses:i()}),fO=u({node:dO,cameras:b(dO.extend({deviceId:i()}))}),pO=u({nodeId:c(),activeCameras:i(),throttledCameras:i(),avgInferenceTimeMs:i(),queueDepth:i(),frameLazy:fO.optional()}),mO=y([`not-attached`,`battery-asleep`,`not-watching`,`already-bursting`]),hO={name:`pipeline-runner`,scope:`system`,mode:`singleton`,methods:{attachCamera:w(cO,u({success:p(!0)}),{kind:`mutation`}),detachCamera:w(u({deviceId:i()}),u({success:p(!0)}),{kind:`mutation`}),reportMotion:w(iO,u({success:p(!0)}),{kind:`mutation`}),getLocalLoad:w(g(),uO),getLocalMetrics:w(g(),pO),getCameraMetrics:w(u({deviceId:i()}),OD.nullable()),getAllCameraMetrics:w(g(),b(kD).readonly()),getLocalCameras:w(g(),b(i()).readonly()),requestOccupancyBurst:w(u({deviceId:i(),frames:i().int().positive().optional(),reason:c()}),u({started:x(),refusedBecause:mO.optional()}),{auth:`admin`,kind:`mutation`}),getNativeCrop:w(u({handle:C,bbox:PD,maxWidth:i().int().positive().optional(),acceptJpegBytes:x().optional(),encodeJpeg:x().optional()}),FD.nullable()),runDetailSubtree:w(u({deviceId:i(),frameHandle:C.optional(),frameJpeg:c().optional(),cropJpeg:c().optional(),parent:BD,steps:b(c()).optional()}),u({details:b(VD)}).nullable(),{kind:`mutation`}),runStatelessStep:w(u({stepId:c(),modelId:c(),frameJpeg:c(),bbox:PD,className:c(),sourceDeviceId:i()}),UD,{kind:`mutation`}),parkTrackFrame:w(u({deviceId:i(),trackId:c(),kind:ID,handle:C,bbox:PD,maxWidth:i().int().positive().optional(),timestamp:i()}),RD,{kind:`mutation`}),getParkedTrackFrame:w(u({deviceId:i(),trackId:c(),kind:ID,acceptJpegBytes:x().optional()}),zD.nullable()),releaseParkedTrackFrames:w(u({deviceId:i(),trackId:c()}),u({released:i().int().nonnegative()}),{kind:`mutation`})}},gO=u({engine:Y.optional(),steps:b(cD).readonly(),audio:u({engine:Y.optional(),modelId:c().optional(),enabled:x(),settings:_(c(),o()).readonly().optional()}).nullable().optional()}),_O=u({id:c(),name:c(),description:c().optional(),config:gO,createdAt:c(),updatedAt:c()}),vO=u({modelId:c().optional(),settings:_(c(),o()).optional(),jumpDeviceKey:c().optional()}),yO=u({maxCameras:i().int().nonnegative().nullable().default(null),detectWeight:i().positive().optional(),detect:x().optional(),decode:x().optional(),audio:x().optional(),ingest:x().optional(),decodeBudgetMb:i().int().min(1024).max(65536).optional(),maxLiveDecodeWorkers:i().int().min(1).max(32).optional(),reachableHost:c().optional(),inferenceDevices:_(c(),u({enabled:x(),weight:i().positive().optional(),maxSessions:i().int().positive().optional(),steps:_(c(),vO).optional()})).optional()}),bO=u({steps:b(cD).readonly(),audio:u({modelId:c(),enabled:x()}).nullable()}),xO=u({modelId:c().optional(),settings:_(c(),o()).readonly().optional()}),SO=u({pinnedAgentNodeId:c().optional(),stepToggles:_(c(),x()).optional(),stepOverridesByDevice:_(c(),_(c(),_(c(),xO))).optional(),pipelineByAgent:_(c(),bO).optional()}),CO=u({deviceId:i(),agentNodeId:c(),pinned:x(),reason:y([`manual`,`capacity`,`hardware-affinity`,`failover`,`rebalance`]),assignedAt:i()}),wO=u({nodeId:c(),online:x(),load:uO,score:i(),decodeHwaccel:c().nullable()}),TO=u({totalAgents:i(),onlineAgents:i(),totalCameras:i(),attachedCameras:i(),activeCameras:i(),avgInferenceTimeMs:i(),queueDepth:i()}),EO=_(c(),c()),DO=u({ownerNodeId:c(),reachableHost:c().optional(),configIssue:c().optional()}),OO=u({camStreamId:c(),codec:c(),width:i(),height:i(),fps:i(),kind:c()}),kO=u({streams:b(OO).readonly()}),AO=u({detectionNodeId:c().nullable(),decoderNodeId:c().nullable(),audioNodeId:c().nullable(),sourceNodeId:c().nullable(),pinned:u({detection:x(),decoder:x(),audio:x()}),reasons:u({detection:c().optional(),decoder:c().optional(),audio:c().optional()})}),jO=u({profile:c(),status:c(),codec:c(),width:i(),height:i(),subscribers:i(),inFps:i(),outFps:i()}),MO=u({profiles:b(jO).readonly(),webrtcSessions:i(),rtspRestream:x()}),NO=u({framesWritten:i(),getFrameHits:i(),getFrameMisses:i(),budgetMb:i()}),PO=u({nodeId:c(),formats:b(c()).readonly(),sessionCount:i(),shm:NO}),FO=u({enabled:x(),fps:i()}),IO=y([`idle`,`installing`,`verifying`,`ready`,`failed`]),LO=u({state:IO,error:c().optional()}),RO=y([`idle`,`watching`,`active`]),zO=u({nodeId:c(),engine:u({backend:c(),device:c()}),phase:RO,configuredFps:i(),actualFps:i(),queueDepth:i(),avgInferenceMs:i(),provisioning:LO}),BO=u({nodeId:c(),enabled:x()}),VO=$s,HO=u({mode:VO,active:x(),storageBytes:i()}),UO=y([`source`,`broker`,`detection`,`recording`,`switches`]),WO=y([`timeout`,`error`,`partial`]),GO=u({stage:UO,reason:WO,elapsedMs:i()}),KO=u({state:y([`idle`,`running`,`done`,`error`]),total:i().int().nonnegative(),completed:i().int().nonnegative(),currentDeviceId:i().int().nullable(),failed:b(i().int()).readonly(),mediaDropped:i().int().nonnegative(),tracks:i().int().nonnegative(),events:i().int().nonnegative(),startedAtMs:i().int().nullable(),finishedAtMs:i().int().nullable(),error:c().nullable()}),qO=u({deviceId:i(),assignment:AO,source:kO,broker:MO.nullable(),decoder:PO.nullable(),motion:FO.nullable(),detection:zO.nullable(),audio:BO.nullable(),recording:HO.nullable(),switchedOff:b(Oo).readonly(),cameraSensors:Fw.optional(),degraded:b(GO).readonly(),fetchedAt:i()}),JO=[`disabled`,`unavailable`,`cannot-host-camera-root`,`accelerator-preferred`],YO=y(JO),XO=u({key:c(),backend:c(),device:c(),format:y(Wu),available:x(),enabled:x(),weight:i(),maxSessions:i().nullable(),defaultModelId:c(),steps:_(c(),vO).optional(),exclusion:YO.nullable()}),ZO=f(`kind`,[u({kind:p(`stored`),modelId:c()}),u({kind:p(`absent`),defaultModelId:c()}),u({kind:p(`unreadable`),reason:y(Lw),error:c().optional()})]),QO=u({nodeId:c(),reachable:x(),devices:b(XO).readonly()}),$O=u({deviceId:i().int().nonnegative(),config:Ow.nullable()}),ek=y([`unknown-camera`,`out-of-range`,`no-burst-producer`,`already-looked`]),tk=u({deviceId:i().int().nonnegative(),afterMs:i().finite(),reason:c()}),nk=u({scheduled:x(),dueInMs:i().optional(),refusedBecause:ek.optional()}),rk={name:`pipeline-orchestrator`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,exposesDeviceSettings:!0,methods:{requestOccupancyLook:w(tk,nk,{kind:`mutation`,auth:`admin`}),pauseForStorageMigration:w(I,u({paused:p(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:w(I,u({resumed:p(!0)}),{kind:`mutation`,auth:`admin`}),assignPipeline:w(u({deviceId:i(),agentNodeId:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),unassignPipeline:w(u({deviceId:i()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),setPipelineDevicePin:w(u({deviceId:i(),deviceKey:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),getPipelineDevicePin:w(u({deviceId:i()}),u({deviceKey:c().nullable()})),rebalance:w(g(),u({migrated:i(),skipped:b(u({deviceId:i(),targetNodeId:c(),reason:c()})).default([])}),{kind:`mutation`,auth:`admin`}),getPipelineAssignments:w(g(),b(CO).readonly()),getPipelineAssignment:w(u({deviceId:i()}),CO.nullable()),getAgentLoad:w(g(),b(wO).readonly()),getClusterModelChoice:w(u({stepId:c()}),ZO),getGlobalMetrics:w(g(),TO),getCameraMetrics:w(u({deviceId:i()}),OD.nullable()),getCapabilityBindings:w(u({nodeId:c()}),EO),setCapabilityBinding:w(u({nodeId:c(),capName:c(),addonId:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),getIngestOwner:w(g(),DO),assignAudio:w(u({deviceId:i(),nodeId:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),unassignAudio:w(u({deviceId:i()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),getAudioAssignment:w(u({deviceId:i()}),u({nodeId:c(),pinned:x(),assignedAt:i()}).nullable()),getAudioNodeLoad:w(g(),b(u({nodeId:c(),deviceCount:i()}))),getAudioAssignments:w(g(),b(u({deviceId:i(),nodeId:c(),pinned:x(),assignedAt:i()}))),getAgentSettings:w(u({agentNodeId:c()}),yO.nullable()),listAgentSettings:w(g(),b(u({nodeId:c(),settings:yO})).readonly()),removeAgentSettings:w(u({agentNodeId:c()}),u({success:x(),removed:x()}),{kind:`mutation`,auth:`admin`}),setAgentMaxCameras:w(u({agentNodeId:c(),maxCameras:i().int().nonnegative().nullable()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),setAgentDetectWeight:w(u({agentNodeId:c(),detectWeight:i().positive().nullable()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),setAgentCapabilities:w(u({agentNodeId:c(),detect:x().nullable().optional(),audio:x().nullable().optional(),ingest:x().nullable().optional()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),setAgentDecodeLimits:w(u({agentNodeId:c(),decodeBudgetMb:i().int().min(1024).max(65536).nullable().optional(),maxLiveDecodeWorkers:i().int().min(1).max(32).nullable().optional()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),setAgentReachableHost:w(u({agentNodeId:c(),reachableHost:c().nullable()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),setAgentInferenceDevices:w(u({agentNodeId:c(),inferenceDevices:_(c(),u({enabled:x(),weight:i().positive().optional(),maxSessions:i().int().positive().optional(),steps:_(c(),vO).optional()}))}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),getNodeInferenceDevices:w(u({nodeId:c()}),QO),resetNodePipelineDefaults:w(u({agentNodeId:c()}),u({success:p(!0),effectiveModelId:c().nullable(),clearedCameraOverrides:i()}),{kind:`mutation`,auth:`admin`}),getCameraSettings:w(u({deviceId:i()}),SO.nullable()),setCameraStepToggle:w(u({deviceId:i(),addonId:c(),enabled:x().nullable()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),getCameraStepOverrides:w(u({deviceId:i()}),_(c(),_(c(),_(c(),xO))).nullable()),setCameraStepOverride:w(u({deviceId:i(),agentNodeId:c(),deviceKey:c(),addonId:c(),patch:xO.nullable()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),setCameraPipelineForAgent:w(u({deviceId:i(),agentNodeId:c(),pipeline:bO.nullable()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),resolvePipeline:w(u({deviceId:i(),agentNodeId:c().optional()}),gO),getCameraSwitches:w(u({deviceId:i()}),Po),setCameraSwitch:w(u({deviceId:i(),switchId:Oo,enabled:x()}),Po,{kind:`mutation`,auth:`admin`}),getCameraStatus:w(u({deviceId:i()}),qO),getCameraStatuses:w(u({deviceIds:b(i()).optional()}),b(qO).readonly()),setCameraSensors:w($O,u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),reconcileFromDisk:w(g(),KO,{kind:`mutation`,auth:`admin`}),getReconcileFromDiskStatus:w(g(),KO,{auth:`admin`}),listTemplates:w(g(),b(_O).readonly()),saveTemplate:w(u({name:c(),description:c().optional(),config:gO}),_O,{kind:`mutation`,auth:`admin`}),updateTemplate:w(u({id:c(),name:c().optional(),description:c().optional(),config:gO.optional()}),_O,{kind:`mutation`,auth:`admin`}),deleteTemplate:w(u({id:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`})}},ik={motion:`motion`,audio:`audio`,person:`person`,vehicle:`vehicle`,animal:`animal`,package:`package`,door:`door`,pir:`pir`,smoke:`smoke`,water:`water`,button:`button`,generic:`generic`,gas:`smoke`,vibration:`generic`,tamper:`generic`,presence:`person`,lock:`generic`,siren:`generic`,switch:`generic`,doorbell:`button`};function ak(e){return ik[e]??`generic`}var ok={contact:`contact`,motion:`motion-sensor`,smoke:`smoke`,flood:`flood`,gas:`gas`,"carbon-monoxide":`carbon-monoxide`,vibration:`vibration`,tamper:`tamper`,presence:`presence`,"enum-sensor":`enum-sensor`,"event-emitter":`device-event`,"lock-control":`lock`,cover:`cover`,switch:`switch`,button:`button`,doorbell:`doorbell`};function sk(e,t){let n=Px[t];if(n===void 0)throw Error(`EVENT_KIND_BY_CAP: cap '${e}' maps to unknown taxonomy kind '${t}'`);return{...n,icon:ak(n.iconId)}}var ck=Object.freeze(Object.fromEntries(Object.entries(ok).map(([e,t])=>[e,sk(e,t)]))),lk=Object.keys(ok);function uk(e,t){let n=Px[e];return n===void 0?null:{kind:n.kind,labelKey:n.labelKey,label:n.label,color:n.color,iconId:n.iconId,icon:ak(n.iconId),category:n.category,parentKind:n.parentKind,level:n.level,source:{capName:t.capName,deviceId:t.deviceId}}}var dk=y([`workspace`,`baked`,`data-root`]),fk=y([`idle`,`checking`,`staging`,`pending-restart`,`awaiting-confirmation`]),pk=y([`in-sync`,`behind-patch`,`behind-series`,`ahead`,`unknown`]),mk=u({state:pk,seedVersion:c().nullable(),contractVersion:c().nullable(),contractSource:y([`registry`,`running`]).nullable(),message:c()}),hk=y([`docker`,`electron`,`native`,`contradictory`,`unknown`]),gk=u({fact:y([`dockerenv-file`,`proc-1-cgroup`,`platform`,`electron-app-version-env`]),mode:y([`observed`,`declared`]),holds:x(),detail:c()}),_k=u({kind:hk,evidence:b(gk),currentVersion:c().nullable()}),vk=u({fromVersion:c(),toVersion:c().nullable(),atMs:i(),reason:c()}),yk=u({packageName:c(),runningVersion:c().nullable(),nodeRuntimeVersion:c().nullable(),activeVersion:c().nullable(),installedVersion:c().nullable().optional(),restartRequired:x().optional(),previousVersion:c().nullable(),seedVersion:c().nullable(),latestVersion:c().nullable(),updateAvailable:x(),bootMode:dk,updateState:fk,pendingVersion:c().nullable(),rolledBack:vk.nullable(),stateFileCorrupt:x(),lastCheckedAtMs:i().nullable(),imageContract:mk.optional(),wrapper:_k.optional()}),bk=u({packageName:c(),runningVersion:c().nullable(),latestVersion:c().nullable(),updateAvailable:x(),checkedAtMs:i(),error:c().nullable(),pendingVersion:c().nullable().optional(),restartRequired:x().optional()}),xk=y([`staged`,`restart-scheduled`,`already-current`,`refused`,`failed`]),Sk=u({accepted:x(),targetVersion:c().nullable(),restarting:x(),message:c(),outcome:xk.optional(),reason:c().nullable().optional(),error:c().nullable().optional()}),Ck={name:`server-management`,scope:`system`,mode:`singleton`,methods:{getServerPackageStatus:w(g(),yk,{auth:`admin`}),checkServerUpdate:w(g(),bk,{kind:`mutation`,auth:`admin`}),applyServerUpdate:w(u({version:c().optional()}),Sk,{kind:`mutation`,auth:`admin`,timeoutMs:16*6e4}),rollbackServerUpdate:w(g(),Sk,{kind:`mutation`,auth:`admin`}),restartServer:w(g(),Sk,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},wk=r(),Tk=u({to:d([wk,b(wk).min(1)]),cc:b(wk).optional(),bcc:b(wk).optional(),from:c().optional(),replyTo:c().optional(),subject:c(),text:c(),html:c().optional()}),Ek=u({messageId:c(),accepted:b(wk).default([]),rejected:b(wk).default([])}),Dk=u({ready:x(),host:c(),error:c().optional(),lastVerifiedAt:i().optional()}),Ok={name:`smtp-provider`,scope:`system`,mode:`collection`,internal:!0,providerKind:`email`,methods:{sendEmail:w(Tk,Ek,{kind:`mutation`,auth:`admin`,access:`create`}),verify:w(g(),Dk,{kind:`mutation`,auth:`admin`,access:`view`}),getStatus:w(g(),Dk,{auth:`admin`})}},kk=u({base64:c(),contentType:c()}),Ak=u({lastCapturedAt:i().nullable(),cacheAgeMs:i().nullable(),lastBytes:i().nullable(),lastStreamId:c().nullable()}),jk={name:`snapshot`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[E.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:w(u({deviceId:i(),streamId:c().optional(),force:x().optional()}),kk.nullable()),invalidateCache:w(u({deviceId:i()}),g(),{kind:`mutation`,auth:`admin`}),getSnapshotOverview:Xt(u({deviceIds:b(i()).min(1).max(200)}),b(u({deviceId:i(),lastCapturedAt:i().nullable(),cacheAgeMs:i().nullable(),etag:c().nullable()}))),getDebugState:Xt(u({deviceId:i()}),u({battery:u({sleeping:x(),lastUpdated:i(),lastContactAt:i().optional()}).nullable(),state:u({isBattery:x(),reason:y([`disabled`,`offline`,`sleeping`,`unreachable`,`waking`]).nullable()}),frame:u({capturedAt:i().nullable(),ageMs:i().nullable()}),waking:x()})),getSnapshotLinks:Xt(u({targets:b(u({deviceId:i(),width:i().int().positive().optional()})).min(1).max(200)}),b(u({deviceId:i(),url:c().nullable(),capturedAt:i().nullable(),ageMs:i().nullable(),expiresAt:i().nullable(),width:i().nullable(),neverCaptured:x(),sleeping:x(),stateReason:y([`disabled`,`offline`,`sleeping`,`unreachable`,`waking`]).nullable(),battery:x()})))},status:{schema:Ak,kind:`poll`}},Mk=u({userId:c(),username:c(),isAdmin:x(),provider:c(),email:c().optional(),displayName:c().optional(),hubUrl:c().optional(),scopes:b(J).optional(),redirectUri:c().optional(),integrationId:c().optional(),jti:c().optional(),codeChallenge:c().optional(),sessionId:c().optional(),refreshTtl:d([i().int().positive(),p(`never`)]).optional()}),Nk={name:`sso-bridge`,scope:`system`,mode:`singleton`,internal:!0,methods:{signBridgeToken:w(u({claims:Mk,ttlSec:d([i().int().positive(),p(`never`)]).optional()}),u({token:c()}),{auth:`admin`}),verifyBridgeToken:w(u({token:c()}),Mk.nullable(),{auth:`admin`})}},Pk=f(`shouldSaveDiskSpace`,[u({providerId:c().min(1),displayName:c().min(1),configSchema:o(),nodeLocal:x(),shouldSaveDiskSpace:p(!0),minFreePercent:i().min(0).max(100)}),u({providerId:c().min(1),displayName:c().min(1),configSchema:o(),nodeLocal:x(),shouldSaveDiskSpace:p(!1),minFreePercent:p(null)})]),Fk={name:`storage`,scope:`system`,mode:`singleton`,methods:{resolve:w(u({location:R,relativePath:c()}),c(),{auth:`admin`}),write:w(u({location:R,relativePath:c(),data:v(Uint8Array)}),g(),{kind:`mutation`,auth:`admin`}),read:w(u({location:R,relativePath:c()}),v(Uint8Array),{auth:`admin`}),exists:w(u({location:R,relativePath:c()}),x(),{auth:`admin`}),list:w(u({location:R,prefix:c().optional()}),b(c()).readonly(),{auth:`admin`}),delete:w(u({location:R,relativePath:c()}),g(),{kind:`mutation`,auth:`admin`}),getAvailableSpace:w(u({location:R}),i().nullable()),beginUpload:w(u({location:R,relativePath:c(),sizeBytes:i().optional()}),u({uploadId:c()}),{kind:`mutation`,auth:`admin`}),writeChunk:w(u({uploadId:c(),offset:i(),data:v(Uint8Array)}),g(),{kind:`mutation`,auth:`admin`}),finalizeUpload:w(u({uploadId:c()}),g(),{kind:`mutation`,auth:`admin`}),abortUpload:w(u({uploadId:c()}),g(),{kind:`mutation`,auth:`admin`}),beginDownload:w(u({location:R,relativePath:c()}),u({downloadId:c(),sizeBytes:i()}),{kind:`mutation`,auth:`admin`}),readChunk:w(u({downloadId:c(),offset:i(),length:i()}),v(Uint8Array),{auth:`admin`}),endDownload:w(u({downloadId:c()}),g(),{kind:`mutation`,auth:`admin`}),listLocations:w(u({type:Dl.optional()}),b(L).readonly()),listLocationDeclarations:w(g(),b(Fl).readonly()),upsertLocation:w(L.omit({createdAt:!0,updatedAt:!0}),L,{kind:`mutation`,auth:`admin`}),deleteLocation:w(u({id:c(),force:x().optional()}),g(),{kind:`mutation`,auth:`admin`}),listDrainProgress:w(g(),b(Ml).readonly()),testLocation:w(u({id:c()}),u({ok:x(),error:c().optional()}),{auth:`admin`}),listProviders:w(g(),b(Pk).readonly()),testConfig:w(u({providerId:c(),locationId:c().optional(),config:_(c(),o())}),u({ok:x(),error:c().optional()}),{auth:`admin`})}},Ik=u({bytes:i().int().nonnegative()}),Lk=u({reclaimedBytes:i().int().nonnegative(),exhausted:x()}),Rk={name:`storage-evictable`,scope:`system`,mode:`collection`,internal:!0,methods:{getEvictableUsage:w(u({locationId:c()}),Ik,{auth:`admin`}),evict:w(u({locationId:c(),targetBytes:i().int().positive()}),Lk,{kind:`mutation`,auth:`admin`})}},zk={name:`storage-migration`,scope:`system`,mode:`singleton`,methods:{plan:w(Lc,Gc,{auth:`admin`}),start:w(Lc,u({jobId:c()}),{kind:`mutation`,auth:`admin`}),status:w(u({jobId:c().optional()}),Hc.nullable(),{auth:`admin`}),cancel:w(u({jobId:c()}),u({cancelled:x()}),{kind:`mutation`,auth:`admin`}),movers:w(u({}),b(qc).readonly(),{auth:`admin`}),residue:w(u({}),b(Jc).readonly(),{auth:`admin`}),drain:w(Yc,u({jobId:c()}),{kind:`mutation`,auth:`admin`}),cleanupStart:w(sl,u({jobId:c()}),{kind:`mutation`,auth:`admin`}),cleanupStatus:w(ll,cl.nullable(),{auth:`admin`}),cleanupCancel:w(u({jobId:c()}),u({cancelled:x()}),{kind:`mutation`,auth:`admin`}),history:w(u({}),b(Hc).readonly(),{auth:`admin`})}},Bk=u({locationId:c(),ownedBytes:i().int().nonnegative(),measuredAtMs:i().int().nonnegative()}),Vk={name:`storage-occupancy`,scope:`system`,mode:`collection`,internal:!0,methods:{getOccupancy:w(u({locationIds:b(c()).readonly()}),b(Bk).readonly(),{auth:`admin`})}},Hk=f(`shouldSaveDiskSpace`,[u({providerId:c().min(1),displayName:c().min(1),configSchema:o(),nodeLocal:x(),shouldSaveDiskSpace:p(!0),minFreePercent:i().min(0).max(100)}),u({providerId:c().min(1),displayName:c().min(1),configSchema:o(),nodeLocal:x(),shouldSaveDiskSpace:p(!1),minFreePercent:p(null)})]),Uk=u({ok:x(),error:c().optional()}),Wk=u({location:L,relativePath:c(),sizeBytes:i().optional()}),Gk=u({uploadId:c()}),Kk=u({uploadId:c(),offset:i(),data:v(Uint8Array)}),qk=u({uploadId:c()}),Jk=u({uploadId:c()}),Yk=u({location:L,relativePath:c()}),Xk=u({downloadId:c(),sizeBytes:i()}),Zk=u({downloadId:c(),offset:i(),length:i()}),Qk=u({downloadId:c()}),$k={name:`storage-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getProviderInfo:w(g(),Hk,{auth:`admin`}),testLocation:w(u({config:_(c(),o())}),Uk,{auth:`admin`}),resolve:w(u({location:L,relativePath:c()}),c(),{auth:`admin`}),write:w(u({location:L,relativePath:c(),data:v(Uint8Array)}),g(),{kind:`mutation`,auth:`admin`}),read:w(u({location:L,relativePath:c()}),v(Uint8Array),{auth:`admin`}),exists:w(u({location:L,relativePath:c()}),x(),{auth:`admin`}),list:w(u({location:L,prefix:c().optional()}),b(c()).readonly(),{auth:`admin`}),delete:w(u({location:L,relativePath:c()}),g(),{kind:`mutation`,auth:`admin`}),getAvailableSpace:w(u({location:L}),i().nullable(),{auth:`admin`}),beginUpload:w(Wk,Gk,{kind:`mutation`,auth:`admin`}),writeChunk:w(Kk,g(),{kind:`mutation`,auth:`admin`}),finalizeUpload:w(qk,g(),{kind:`mutation`,auth:`admin`}),abortUpload:w(Jk,g(),{kind:`mutation`,auth:`admin`}),beginDownload:w(Yk,Xk,{kind:`mutation`,auth:`admin`}),readChunk:w(Zk,v(Uint8Array),{auth:`admin`}),endDownload:w(Qk,g(),{kind:`mutation`,auth:`admin`})}},eA=u({code:c().min(1),label:c().min(1),recommended:x()}),tA=u({signals:b(eA),lastFetchedAt:i()}),nA={name:`stream-signals`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:Object.values(E),runtimeState:tA,durability:`session`,methods:{listSignals:w(g(),b(eA).readonly())}},rA=o().nullable(),iA=_(c(),o()),aA=u({sessionId:c(),profileId:c(),label:c(),cols:i().int().positive(),rows:i().int().positive(),startedAt:i()}),oA=u({profileId:c(),label:c(),description:c().optional(),executable:c().optional(),args:b(c()).readonly().optional(),cwd:c().optional(),environment:b(c()).readonly().optional(),settingsSchema:rA.optional()}),sA=u({instanceId:c(),cameraStableId:c(),nodeId:c(),profileId:c(),profileLabel:c(),name:c(),enabled:x(),executable:c(),args:b(c()).readonly(),cwd:c(),environment:b(c()).readonly(),profileSettings:iA}),cA=u({stableId:c(),nodeId:c(),profileId:c(),profileLabel:c(),name:c(),adoptable:x()}),lA=f(`kind`,[u({seq:i().int().positive(),kind:p(`data`),data:c()}),u({seq:i().int().positive(),kind:p(`exit`),exitCode:i().int(),signal:i().int().optional()})]),uA=u({cursor:i().int().nonnegative(),reset:x(),snapshot:c().optional(),events:b(lA).readonly()}),dA={name:`terminal-session`,scope:`system`,mode:`singleton`,methods:{listProfiles:w(g(),b(oA).readonly(),{auth:`admin`}),listInstances:w(g(),b(sA).readonly(),{auth:`admin`}),createInstance:w(u({targetNodeId:c().min(1),profileId:c().min(1),name:c().trim().min(1).max(160).optional(),executable:c().max(1024).optional(),args:b(c().max(2048)).max(64).optional(),cwd:c().max(1024).optional(),environment:b(c().max(4096)).max(64).optional(),profileSettings:iA.optional()}),sA,{kind:`mutation`,auth:`admin`}),updateInstance:w(u({instanceId:c().min(1),name:c().trim().min(1).max(160).optional(),executable:c().max(1024).optional(),args:b(c().max(2048)).max(64).optional(),cwd:c().max(1024).optional(),environment:b(c().max(4096)).max(64).optional(),profileSettings:iA.optional()}),sA,{kind:`mutation`,auth:`admin`}),deleteInstance:w(u({instanceId:c().min(1)}),g(),{kind:`mutation`,auth:`admin`}),setInstanceEnabled:w(u({instanceId:c().min(1),enabled:x()}),sA,{kind:`mutation`,auth:`admin`}),listLegacyCameras:w(g(),b(cA).readonly(),{auth:`admin`}),adoptLegacyMonitor:w(u({stableId:c().min(1),name:c().trim().min(1).max(160).optional()}),sA,{kind:`mutation`,auth:`admin`}),listSessions:w(g(),b(aA).readonly(),{auth:`admin`}),openSession:w(u({profileId:c(),cols:i().int().positive(),rows:i().int().positive(),executable:c().max(1024).optional(),args:b(c().max(2048)).max(64).optional(),cwd:c().max(1024).optional(),environment:b(c().max(4096)).max(64).optional()}),aA,{kind:`mutation`,auth:`admin`}),resize:w(u({sessionId:c(),cols:i().int().positive(),rows:i().int().positive()}),g(),{kind:`mutation`,auth:`admin`}),pullOutput:w(u({sessionId:c(),afterSeq:i().int().nonnegative(),waitMs:i().int().min(0).max(2e3).default(0),waitForOutput:x().optional()}),uA,{kind:`mutation`,auth:`admin`,timeoutMs:15e3}),writeInput:w(u({sessionId:c(),data:c().max(64*1024)}),g(),{kind:`mutation`,auth:`admin`}),close:w(u({sessionId:c()}),g(),{kind:`mutation`,auth:`admin`})}},fA=u({urls:d([c(),b(c())]),username:c().optional(),credential:c().optional()}),pA={name:`turn-provider`,scope:`system`,mode:`collection`,methods:{getTurnServers:w(g(),b(fA).readonly())}},mA=u({credentialId:c(),label:c(),createdAt:i(),lastUsedAt:i().nullable(),transports:b(c()).default([])}),hA={name:`user-passkeys`,scope:`system`,mode:`collection`,internal:!0,methods:{beginRegistration:w(u({userId:c(),username:c()}),u({optionsJSON:_(c(),o())}),{kind:`mutation`,auth:`admin`,access:`create`}),finishRegistration:w(u({userId:c(),response:_(c(),o()),label:c()}),u({success:p(!0),credentialId:c()}),{kind:`mutation`,auth:`admin`,access:`create`}),beginAuthentication:w(u({userId:c().optional()}),u({optionsJSON:_(c(),o())}),{kind:`mutation`,access:`view`,auth:`admin`}),finishAuthentication:w(u({userId:c(),response:_(c(),o())}),u({verified:x()}),{kind:`mutation`,access:`view`,auth:`admin`}),beginDiscoverableAuthentication:w(u({}),u({optionsJSON:_(c(),o())}),{kind:`mutation`,access:`view`,auth:`admin`}),finishDiscoverableAuthentication:w(u({response:_(c(),o())}),u({verified:x(),userId:c().nullable()}),{kind:`mutation`,access:`view`,auth:`admin`}),listPasskeys:w(u({userId:c()}),b(mA),{auth:`admin`}),removePasskey:w(u({userId:c(),credentialId:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getSecondFactorPreference:w(u({userId:c()}),u({enabled:x()}),{auth:`admin`}),setSecondFactorPreference:w(u({userId:c(),enabled:x()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`,access:`create`})}},gA=y([`cosine`,`dot`,`euclidean`]),_A=_(c(),d([c(),i(),x()])),vA=u({equals:_(c(),d([c(),i(),x()])).optional(),between:_(c(),l([i(),i()])).optional()}),yA=u({id:c(),vector:c(),metadata:_A}),bA=u({id:c(),score:i(),metadata:_A}),xA=u({index:c(),dim:i().int().positive(),metric:gA.default(`cosine`)}),SA=u({index:c(),items:b(yA)}),CA=u({upserted:i(),rejected:i()}),wA=u({index:c(),vector:c(),topK:i().int().positive(),minScore:i().optional(),filter:vA.optional()}),TA=u({matches:b(bA),scanned:i(),truncated:x(),effectiveTopK:i().int().positive()}),EA=u({index:c(),ids:b(c())}),DA=u({index:c(),filter:vA}),OA=u({deleted:i()}),kA=u({index:c(),ids:b(c())}),AA=u({items:b(u({id:c(),metadata:_A}))}),jA=u({index:c(),ids:b(c())}),MA=u({items:b(u({id:c(),vector:c(),metadata:_A}))}),NA=u({index:c(),cursor:i().int().nonnegative().default(0),limit:i().int().positive()}),PA=u({items:b(u({id:c(),metadata:_A})),nextCursor:i().int().nonnegative().nullable()}),FA=`vector-index-dim-conflict`;function IA(e,t,n){return Error(`[${FA}] vector-store: index "${e}" is declared with dim ${String(t)}; refusing to redeclare as ${String(n)}`)}function LA(e){return(e instanceof Error?e.message:String(e)).includes(`[${FA}]`)}var RA=u({index:c()}),zA=u({backend:c(),count:i(),dim:i(),metric:gA,bytes:i().optional(),exact:x()}),BA={name:`vector-store`,scope:`system`,mode:`singleton`,internal:!0,methods:{declareIndex:w(xA,g(),{kind:`mutation`,auth:`admin`}),upsert:w(SA,CA,{kind:`mutation`,auth:`admin`}),query:w(wA,TA,{auth:`admin`}),getByIds:w(kA,AA,{auth:`admin`}),fetchByIds:w(jA,MA,{auth:`admin`}),scan:w(NA,PA,{auth:`admin`}),deleteByIds:w(EA,OA,{kind:`mutation`,auth:`admin`}),deleteByFilter:w(DA,OA,{kind:`mutation`,auth:`admin`}),stats:w(RA,zA,{auth:`admin`})}},VA=24,HA=3,UA=y([`queue-full`,`camera-backoff`,`sleeping`,`camera-refused`,`no-keyframe`,`decode-failed`,`no-catalog-row`,`unsupported`,`unknown-device`,`uid-missing`]),WA=y([`deferred`,`final`]),GA=`x-camstack-reason`,KA=500;function qA(e){let t=e.replace(/[\u2013\u2014\u2212]/g,`-`).replace(/[\u2018\u2019\u201b]/g,`'`).replace(/[\u201c\u201d]/g,`"`).replace(/\u2026/g,`...`).replace(/[\u00a0\u2007\u202f]/g,` `),n=``;for(let e of t){let t=e.codePointAt(0)??0;t<32||t===127?n+=` `:t>255?n+=`?`:n+=e}return n.slice(0,500).trim()}var JA=`x-camstack-reason-code`,YA=`x-camstack-disposition`,XA=`x-camstack-clip-transport`,ZA=u({id:c(),source:c(),kind:y([`motion`,`object`,`audio`,`native`]),timeRange:u({startMs:i(),endMs:i()}),labels:b(c()).max(3).optional(),thumbnail:c().optional(),stillAtMs:i().optional(),eventIds:b(c()).optional(),eventCount:i().int().nonnegative().optional(),holes:b(u({startMs:i(),endMs:i()})).optional(),thumbnailMint:c().optional(),thumbnailUnavailable:u({reason:y([`sleeping`,`camera-refused`,`no-keyframe`,`unsupported`])}).optional(),catalogAsOf:i().optional(),nativeTypes:b(c()).optional(),behaviours:b(c()).optional(),streams:u({sub:u({id:c(),bytes:i().optional()}).optional(),main:u({id:c(),bytes:i().optional()}).optional()}).optional(),supportSub:x().optional(),playable:x().optional(),unplayableReason:c().optional(),inProgress:x().optional()}),QA=u({playbackUrl:c(),format:y([`hls`,`mp4`]).optional(),served:S.optional(),playbackEndpoints:b(c()).optional(),token:c().optional()}),$A=y([`authorised`]),ej=50*1024*1024,tj=500*1024*1024,nj=u({base64:c(),contentType:c(),name:c(),bytes:i().int().nonnegative(),served:S,durationMs:i().positive().optional()}),rj=u({ticket:it,contentType:c(),name:c(),served:S,durationMs:i().positive().optional()}),ij=y([`opus`,`pcmu`,`none`]),aj=y([`not-requested`,`unsupported-ask`]),oj=u({url:c().min(1),expiresAtMs:i(),transport:p(`forward-only`),served:S,servedAudio:ij,audioReason:aj.optional()}),sj=[.25,.5,1,1.5,2,4,8],cj=[.25,.5,1,1.5,2,4],lj=[.25,.5,1],uj=u({transport:y([`stream`,`file`]),seek:y([`forward`,`free`]),stepBack:x(),scrub:x(),rates:b(i().positive()).min(1).readonly()}),dj=u({state:y([`ok`,`sleeping`,`unreachable`,`no-storage`,`index-empty`]),reason:c().optional(),catalogAsOf:i().optional()}),fj=u({source:c(),label:c(),addonId:c().optional(),availability:dj}),pj={name:`videoclips`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:[E.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/clips-browser`,tab:`recording`,topTab:!0,label:`Clips`,order:100}},methods:{listClips:w(u({deviceId:i(),since:i(),until:i(),limit:i().int().positive().optional(),provider:c().min(1)}),b(ZA).readonly(),{kind:`query`,auth:`protected`}),listSources:w(u({deviceId:i()}),b(fj).readonly(),{kind:`query`,auth:`protected`}),getClipPlayback:w(u({deviceId:i(),clipId:c(),profile:S.optional()}),QA,{kind:`query`,auth:`protected`}),readClipBytes:Zt(u({deviceId:i(),clipId:c().min(1),provider:c().min(1),profile:S.optional(),maxBytes:i().int().positive().optional(),wake:$A.optional()}),nj,{kind:`query`,auth:`protected`}),offerClipBytes:Zt(u({deviceId:i(),clipId:c().min(1),provider:c().min(1),profile:S.optional(),maxBytes:i().int().positive().optional(),wake:$A.optional()}),rj,{kind:`query`,auth:`protected`}),dialClipStream:Zt(u({deviceId:i(),clipId:c().min(1),provider:c().min(1),profile:S.optional(),audio:ij.optional()}),oj,{kind:`query`,auth:`protected`}),getPlaybackOptions:Zt(u({deviceId:i(),provider:c().min(1)}),uj,{kind:`query`,auth:`protected`})}},mj={stream:{transport:`stream`,seek:`forward`,stepBack:!1,scrub:!1,rates:cj},realtimeStream:{transport:`stream`,seek:`forward`,stepBack:!1,scrub:!1,rates:lj},file:{transport:`file`,seek:`free`,stepBack:!0,scrub:!0,rates:sj}},hj=u({viewportWidth:i().int().positive().optional(),viewportHeight:i().int().positive().optional(),devicePixelRatio:i().positive().optional(),downlinkMbps:i().nonnegative().optional(),prefersTier:c().optional()}).partial(),gj=f(`kind`,[u({kind:p(`adaptive`)}),u({kind:p(`profile`),profile:S}),u({kind:p(`cam-stream`),camStreamId:c().min(1)})]),_j=u({id:c(),label:c(),target:gj,codec:c().nullable(),resolution:u({width:i(),height:i()}).nullable(),status:y([`idle`,`connecting`,`streaming`,`error`,`stopped`]).nullable(),inputFps:i().nullable(),decodeFps:i().nullable(),bitrateKbps:i().nullable()}),vj=u({cause:y([`loss`,`stall`,`healthy`]),tier:S.nullable(),forcedTranscodeDown:x(),lossRatio:i().nullable(),clientKbps:i().nullable(),stalledForMs:i().nullable(),serverSending:x().nullable(),at:i(),causeDetail:c().optional()}),yj=[`stall-building`,`delivery`,`no-evidence`,`warming`,`cooldown`,`capacity`,`try-unclean`,`try-backoff`,`trial`,`suspended`],bj=[`delivery`,`loss`,`rtt`,`shared-telemetry`],xj=u({code:c(),nextTier:S,deliveryRatio:i().nullable(),deliveryWindowMs:i().nullable(),climbDeliveryRatio:i(),capacityKbps:i().nullable(),probeKbps:i().nullable(),nextTierKbps:i().nullable(),capacityMargin:i(),neededKbps:i().nullable(),tryBlockedBy:c().nullable(),tryDeliveryRatio:i().optional(),tryMaxLossRatio:i().optional(),retryInMs:i().nullable(),lastRevert:u({tier:S,deliveryRatio:i().nullable(),stalled:x(),at:i()}).nullable(),trialForMs:i().nullable(),trialMs:i().nullable(),healthyForMs:i().nullable(),requiredHealthyMs:i().nullable(),since:i(),summary:c()}),Sj=u({tier:S,failures:i().int().nonnegative()}),Cj=u({sessionId:c(),alive:x(),observedAt:i(),brokerId:c().nullable(),camStreamId:c().nullable(),sourceKind:y([`native`,`derived`,`unknown`]),adaptive:x(),servedTier:S.nullable(),ingestNodeId:c().nullable(),ingestIsRemote:x().nullable(),sourceCodec:c().nullable(),negotiatedCodec:c().nullable(),egressLeg:y([`copy`,`transcode`,`unknown`]),brokerStatus:c().nullable(),brokerCodec:c().nullable(),brokerBitrateKbps:i().nullable(),brokerInputFps:i().nullable(),brokerUptimeMs:i().nullable(),rtpPacketsSent:i().nullable(),trackMode:y([`live`,`recorded`]).nullable(),lastDecision:vj.nullable(),tierFailures:b(Sj),upgradeCount:i().nullable(),climbHold:xj.nullable().optional()}),wj={name:`webrtc-session`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,preferredProvider:`stream-broker`,deviceTypes:[E.Camera],methods:{listStreams:w(u({deviceId:i().int().nonnegative()}),b(_j)),createSession:w(u({deviceId:i().int().nonnegative(),target:gj,hints:hj.optional(),relayOnly:x().optional(),consumerAttribution:Pp.optional()}),u({sessionId:c(),sdpOffer:c()}),{kind:`mutation`}),handleOffer:w(u({deviceId:i().int().nonnegative(),target:gj.optional(),sdpOffer:c(),sessionId:c().optional(),relayOnly:x().optional(),nonTrickle:x().optional(),disableTurn:x().optional(),disableIpv6:x().optional(),consumerAttribution:Pp.optional(),hints:hj.optional()}),u({sessionId:c(),sdpAnswer:c()}),{kind:`mutation`}),handleAnswer:w(u({deviceId:i().int().nonnegative(),sessionId:c(),sdpAnswer:c()}),g(),{kind:`mutation`}),addIceCandidate:w(u({deviceId:i().int().nonnegative(),sessionId:c(),candidate:c(),sdpMid:c().nullable().optional(),sdpMLineIndex:i().int().nullable().optional()}),g(),{kind:`mutation`}),getIceCandidates:w(u({deviceId:i().int().nonnegative(),sessionId:c()}),u({candidates:b(u({candidate:c(),sdpMid:c().nullable(),sdpMLineIndex:i().int().nullable()})),done:x()}),{kind:`query`}),closeSession:w(u({deviceId:i().int().nonnegative(),sessionId:c()}),g(),{kind:`mutation`}),hasAdaptiveBitrate:w(u({deviceId:i().int().nonnegative(),profile:S}),x()),getSessionState:w(u({deviceId:i().int().nonnegative(),sessionId:c()}),u({pendingRenegotiation:u({target:gj,epoch:i()}).nullable(),alive:x()})),getSessionDebug:w(u({deviceId:i().int().nonnegative(),sessionId:c()}),Cj,{kind:`query`})},mount:{kind:`server-provided`}},Tj=u({childDeviceIds:b(i()).readonly(),hiddenChildIds:b(i()).readonly()}),Ej={name:`accessories`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera,E.Hub,E.Switch,E.Light,E.Sensor,E.Thermostat,E.Cover,E.Lock,E.Fan,E.MediaPlayer,E.AlarmPanel,E.Generic],methods:{setChildHidden:w(u({deviceId:i().int().nonnegative(),childDeviceId:i().int().nonnegative(),hidden:x()}),g(),{kind:`mutation`,auth:`admin`})},events:{onAccessoriesChanged:{data:u({deviceId:i(),childDeviceIds:b(i()).readonly(),hiddenChildIds:b(i()).readonly()})},onChildVisibilityChanged:{data:u({deviceId:i(),childDeviceId:i(),hidden:x()})}},status:{schema:Tj,kind:`command-driven`}},Dj=y([`install`,`update`,`uninstall`,`restart`]),Oj=y([`queued`,`fetching`,`staged`,`validating`,`applying`,`restarting`,`applied`,`done`,`failed`,`skipped`]),kj=y([`framework`,`addon`]),Aj=u({tsMs:i(),nodeId:c(),packageName:c(),phase:Oj,message:c()}),jj=u({taskId:c(),nodeId:c(),packageName:c(),fromVersion:c().nullable(),toVersion:c(),target:kj,phase:Oj,stagedPath:c().nullable(),attempts:i(),steps:b(Aj),error:c().nullable(),startedAtMs:i().nullable(),finishedAtMs:i().nullable()}),Mj=y([`running`,`completed`,`failed`,`partially-failed`,`cancelled`]),Nj=y([`single`,`bulk`,`cluster`]),Pj=u({jobId:c(),kind:Dj,createdAtMs:i(),createdBy:c(),scope:Nj,tasks:b(jj),state:Mj,schemaVersion:p(1)}),Fj=y([`debug`,`info`,`warn`,`error`]),Ij=y([`off`,`latest`,`beta`]),Lj=y([`off`,`latest`,`beta`,`inherit`]),Rj=u({id:c(),name:c().optional(),version:c().optional(),description:c().optional(),icon:c().optional(),color:c().optional(),capabilities:b(o()).readonly().optional(),packageName:c(),packageVersion:c(),packageDisplayName:c().optional(),bundle:u({displayName:c(),description:c().optional(),icon:c().optional()}).optional(),protected:x().optional(),removable:x().optional()}),zj=u({pid:i().optional(),mode:c(),state:c()}),Bj=u({phase:y([`pending`,`healthy`,`failed`]),retryCount:i(),firstFailureAt:i().nullable(),lastAttemptAt:i().nullable(),lastError:u({message:c(),stack:c().optional()}).nullable(),nextRetryAt:i().nullable(),alertEmitted:x(),retrying:x(),inGracePeriod:x()}),Vj=u({manifest:Rj,declaration:o().optional(),source:c(),installSource:c().optional(),process:zj.optional(),hasBackup:x().optional(),health:Bj.nullable().optional()}),Hj=u({name:c(),version:c(),dir:c(),installSource:c().optional()}),Uj=u({name:c(),currentVersion:c(),latestVersion:c(),category:y([`addon`,`core`]),requiresRestart:x(),isSystem:x()}),Wj=u({version:c(),publishedAt:c(),deprecated:c().optional(),distTags:b(c()).readonly()}),Gj=u({name:c(),version:c(),description:c(),keywords:b(c()).readonly(),publishedAt:c(),author:c(),installed:x(),installedVersion:c().optional()}),Kj=u({channel:Ij,intervalSeconds:i(),updateCheckIntervalSeconds:i()}),qj=Lj,Jj=o(),Yj=o(),Xj=o(),Zj=y([`queued`,`updating`,`done`,`done-pending-restart`,`failed`]),Qj=u({name:c(),isSystem:x(),fromVersion:c(),toVersion:c(),status:Zj,error:c().optional(),startedAtMs:i().optional(),completedAtMs:i().optional()}),$j=y([`regular`,`system`,`restarting`,`finalizing`]);u({id:c(),nodeId:c(),startedAtMs:i(),completedAtMs:i().optional(),total:i(),completed:i(),failed:i(),current:c().nullable(),phase:$j,cancelled:x(),items:b(Qj).readonly()});var eM=u({packageName:c(),currentVersion:c(),latestVersion:c().nullable(),hasUpdate:x(),description:c().optional(),buildId:c().nullable()}),tM=u({timestamp:c(),level:c(),message:c(),scope:c().optional()}),nM=o(),rM=u({addonId:c().min(1),action:c().min(1),input:o()}),iM={name:`addons`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{list:w(g(),b(Vj).readonly()),getLogs:w(u({addonId:c(),limit:i().min(1).max(500).default(100),level:Fj.optional()}),b(nM)),listPackages:w(g(),b(Hj).readonly()),installPackage:w(u({packageName:c(),version:c().optional()}),Yj,{kind:`mutation`,auth:`admin`}),installFromWorkspace:w(u({packageName:c()}),Yj,{kind:`mutation`,auth:`admin`}),isWorkspaceAvailable:w(g(),x()),listWorkspacePackages:w(g(),b(o()).readonly()),uninstallPackage:w(u({packageName:c()}),o(),{kind:`mutation`,auth:`admin`}),reloadPackages:w(g(),Xj,{kind:`mutation`,auth:`admin`}),searchAvailable:w(u({query:c().optional()}),b(Gj)),listUpdates:w(u({nodeId:c().optional()}),b(Uj).readonly(),{auth:`admin`}),updatePackage:w(u({name:c().min(1),version:c().optional(),nodeId:c().optional()}),o(),{kind:`mutation`,auth:`admin`}),rollbackPackage:w(u({name:c().min(1)}),u({rolledBackTo:c().nullable()}),{kind:`mutation`,auth:`admin`}),forceRefresh:w(u({nodeId:c().optional()}),o(),{kind:`mutation`,auth:`admin`}),restartServer:w(u({confirm:p(!0)}),o(),{kind:`mutation`,auth:`admin`}),getLastRestart:w(g(),u({kind:y([`framework-update`,`manual`,`system`,`framework-bulk-update`]),packageName:c().optional(),fromVersion:c().optional(),toVersion:c().optional(),requestedBy:c().optional(),requestedAt:i()}).nullable(),{auth:`admin`}),listFrameworkPackages:w(g(),b(eM).readonly(),{auth:`admin`}),listCapabilityProviders:w(u({capName:c().min(1)}),b(u({addonId:c(),mode:y([`singleton`,`collection`]),isActive:x()})).readonly()),setCapabilityProviderEnabled:w(u({capName:c().min(1),addonId:c().min(1),enabled:x()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),getVersions:w(u({name:c()}),b(Wj).readonly()),restartAddon:w(u({addonId:c()}),Jj,{kind:`mutation`,auth:`admin`}),retryLoad:w(u({packageName:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),getAutoUpdateSettings:w(g(),Kj,{auth:`admin`}),setAutoUpdateSettings:w(u({channel:Ij,intervalSeconds:i().min(300).max(86400).optional(),updateCheckIntervalSeconds:i().min(900).max(604800).optional()}),o(),{kind:`mutation`,auth:`admin`}),getAddonAutoUpdate:w(u({addonId:c()}),qj,{auth:`admin`}),setAddonAutoUpdate:w(u({addonId:c(),channel:Lj}),o(),{kind:`mutation`,auth:`admin`}),applyAutoUpdateToAll:w(u({channel:Ij}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),custom:w(rM,o(),{kind:`mutation`}),startJob:w(u({kind:y([`install`,`update`,`uninstall`,`restart`]),targets:b(u({name:c().min(1),version:c().min(1)})).min(1),nodeIds:b(c()).optional()}),u({jobId:c()}),{kind:`mutation`,auth:`admin`}),getJob:w(u({jobId:c()}),Pj.nullable(),{auth:`admin`}),listJobs:w(u({activeOnly:x().optional()}),b(Pj),{auth:`admin`}),cancelJob:w(u({jobId:c()}),u({cancelled:x()}),{kind:`mutation`,auth:`admin`}),onAddonLogs:w(u({addonId:c(),level:Fj.optional()}),tM,{kind:`subscription`})},mount:{kind:`server-provided`}},aM=u({co2Ppm:i().min(0).optional(),vocPpb:i().min(0).optional(),pm25:i().min(0).optional(),pm10:i().min(0).optional(),aqi:i().optional(),lastFetchedAt:i(),unit:c().optional(),precision:i().int().min(0).max(10).optional()}),oM={name:`air-quality-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:aM,kind:`push`},runtimeState:aM,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},sM=u({lux:i().min(0),lastFetchedAt:i(),unit:c().optional(),precision:i().int().min(0).max(10).optional()}),cM={name:`ambient-light-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:sM,kind:`push`},runtimeState:sM,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},lM=u({className:c(),hits:i().int().nonnegative(),avgScore:i().min(0).max(1),peakScore:i().min(0).max(1)}),uM=u({ts:i().int(),windowSec:i().int().positive(),level:u({rms:i(),dbfs:i()}),peakDbfs:i(),avgDbfs:i(),current:u({className:c(),score:i().min(0).max(1),timestamp:i().int()}).nullable(),byClass:b(lM).readonly()}),dM=u({ts:i().int(),dbfs:i().nullable(),peakDbfs:i(),avgDbfs:i(),topClass:c().nullable(),topScore:i().min(0).max(1).nullable()}),fM=u({points:b(dM).readonly(),effectiveSampleEveryMs:i().int().positive(),windowMsActual:i().int().nonnegative()}),pM={name:`audio-metrics`,scope:`device`,mode:`singleton`,deviceTypes:[E.Camera],methods:{getCurrentSnapshot:w(u({deviceId:i()}),uM.nullable()),getHistory:w(u({deviceId:i(),windowSec:i().int().positive().optional(),sampleEveryMs:i().int().positive().optional()}),fM)},runtimeState:uM,durability:`session`},mM=u({enabled:x(),isRunning:x(),lastTriggeredAt:i(),lastError:c().nullable(),lastChangedAt:i()}),hM={name:`automation-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Automation],methods:{enable:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`admin`}),disable:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`admin`}),trigger:w(u({deviceId:i().int().nonnegative(),skipCondition:x().optional()}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:mM,kind:`push`},runtimeState:mM,durability:`session`},gM=u({percentage:i().min(0).max(100).nullable(),charging:y([`dc`,`solar`,`none`,`unknown`]),sleeping:x(),lastUpdated:i(),lastContactAt:i().optional(),binary:x().optional()}),_M={name:`battery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera,E.Sensor,E.Button,E.Switch,E.PetFeeder,E.Container],methods:{wakeForStream:w(u({deviceId:i(),timeoutMs:i().int().min(500).max(3e4).default(8e3)}),u({awoke:x(),durationMs:i()}),{kind:`mutation`})},composedMethods:{wakeForStream:{kind:`answer`,value:{awoke:!1,durationMs:0}}},events:{onStatusChanged:{data:u({deviceId:i(),status:gM})}},status:{schema:gM,kind:`push`,empty:{percentage:null,charging:`unknown`,sleeping:!1,lastUpdated:0}},runtimeState:gM,durability:`restored`,volatileStateFields:[`lastUpdated`]},vM=u({on:x(),lastChangedAt:i()}),yM={name:`binary`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:vM,kind:`push`},runtimeState:vM,durability:`restored`,volatileStateFields:[`lastChangedAt`]},bM=u({percentage:i().min(0).max(100),lastChangedAt:i()}),xM={name:`brightness`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Light],methods:{setBrightness:w(u({deviceId:i().int().nonnegative(),percentage:i().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`})},events:{onBrightnessChanged:{data:u({deviceId:i(),percentage:i().min(0).max(100),lastChangedAt:i()})}},status:{schema:bM,kind:`command-driven`},runtimeState:bM,durability:`session`},SM={name:`button`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Button],methods:{press:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`})}},CM=u({host:c(),port:i().int().positive().optional(),onvifPort:i().int().positive().optional(),rtspPort:i().int().positive().optional(),https:x().optional(),username:c().optional(),password:c().optional(),onvifProfile:c().optional()}),wM=u({host:c(),port:i().int().positive().nullable(),onvifPort:i().int().positive().nullable(),rtspPort:i().int().positive().nullable(),https:x().nullable(),hasUsername:x(),hasPassword:x(),onvifProfile:c().nullable()}),TM={name:`camera-credentials`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],methods:{getCredentials:w(u({deviceId:i()}),CM.nullable(),{kind:`query`,auth:`admin`})},status:{schema:wM,kind:`command-driven`}},EM=u({x:i().min(0).max(1),y:i().min(0).max(1),width:i().gt(0).max(1),height:i().gt(0).max(1)}),DM=u({deviceId:i().int().positive(),source:EM,cell:EM}),OM=u({profile:y([`high`,`mid`,`low`]),offered:x(),missingSources:b(i().int().positive()),canvas:c(),published:x()}),kM=u({instanceId:c(),deviceId:i().int().nonnegative(),name:c(),fps:i().int(),cells:b(DM),profiles:b(OM)}),AM=u({deviceId:i().int().nonnegative(),name:c().min(1).max(160).optional(),fps:i().int().min(1).max(60).optional(),publishedProfiles:b(y([`high`,`mid`,`low`])).max(3).optional(),cells:b(DM).max(16)}),jM={name:`camera-grid-layout`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],exposesDeviceSettings:!0,methods:{getLayout:w(u({deviceId:i().int().nonnegative()}),kM.nullable(),{auth:`admin`}),saveLayout:w(AM,kM,{kind:`mutation`,auth:`admin`})}},MM=u({detected:x(),lastChangedAt:i()}),NM={name:`carbon-monoxide`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:MM,kind:`push`},runtimeState:MM,durability:`restored`,volatileStateFields:[`lastChangedAt`]},PM=y([`off`,`heat`,`cool`,`auto`,`heat_cool`,`fan_only`,`dry`]),FM=u({mode:PM,availableModes:b(PM),fanMode:c(),availableFanModes:b(c()),preset:c(),availablePresets:b(c()),target:i().nullable(),targetHigh:i().nullable(),targetLow:i().nullable(),targetHumidity:i().min(0).max(100).nullable(),currentTemp:i().nullable(),currentHumidity:i().min(0).max(100).nullable(),swingVertical:x().nullable(),swingHorizontal:x().nullable(),lastFetchedAt:i()}),IM={name:`climate-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Thermostat,E.Climate],methods:{setMode:w(u({deviceId:i().int().nonnegative(),mode:PM}),g(),{kind:`mutation`,auth:`protected`}),setFanMode:w(u({deviceId:i().int().nonnegative(),fanMode:c().min(1)}),g(),{kind:`mutation`,auth:`protected`}),setPreset:w(u({deviceId:i().int().nonnegative(),preset:c().min(1)}),g(),{kind:`mutation`,auth:`protected`}),setTarget:w(u({deviceId:i().int().nonnegative(),target:i()}),g(),{kind:`mutation`,auth:`protected`}),setTargetRange:w(u({deviceId:i().int().nonnegative(),targetLow:i(),targetHigh:i()}),g(),{kind:`mutation`,auth:`protected`}),setTargetHumidity:w(u({deviceId:i().int().nonnegative(),targetHumidity:i().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`}),setSwingVertical:w(u({deviceId:i().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`}),setSwingHorizontal:w(u({deviceId:i().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:FM,kind:`push`},runtimeState:FM,durability:`session`},LM=u({r:i().int().min(0).max(255),g:i().int().min(0).max(255),b:i().int().min(0).max(255)}),RM=u({h:i().min(0).max(360),s:i().min(0).max(100),v:i().min(0).max(100)}),zM=f(`mode`,[u({mode:p(`rgb`),rgb:LM}),u({mode:p(`hsv`),hsv:RM}),u({mode:p(`mired`),mireds:i().int().min(50).max(1e3)})]),BM=u({mode:y([`rgb`,`hsv`,`mired`]),rgb:LM.optional(),hsv:RM.optional(),mireds:i().int().optional(),lastChangedAt:i()}),VM={name:`color`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Light],methods:{setColor:w(u({deviceId:i().int().nonnegative(),color:zM}),g(),{kind:`mutation`,auth:`protected`})},events:{onColorChanged:{data:u({deviceId:i(),mode:y([`rgb`,`hsv`,`mired`]),rgb:LM.optional(),hsv:RM.optional(),mireds:i().int().optional(),lastChangedAt:i()})}},status:{schema:BM,kind:`command-driven`},runtimeState:BM,durability:`session`},HM=2e4,UM=f(`outcome`,[u({outcome:p(`validated`),latencyMs:i().nonnegative().optional(),detail:c().optional()}).strict(),u({outcome:p(`rejected`),error:c()}).strict(),u({outcome:p(`inconclusive`),error:c()}).strict()]),WM=u({settings:_(c(),o())}),GM=u({label:c()}),KM={name:`connection-test`,scope:`system`,mode:`collection`,methods:{testSettings:w(WM,UM,{kind:`mutation`,auth:`admin`}),describeTest:w(g(),GM,{auth:`admin`})}},qM=u({connected:x(),lastChangedAt:i()}),JM={name:`connectivity`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:qM,kind:`push`},runtimeState:qM,durability:`restored`,volatileStateFields:[`lastChangedAt`]},YM=y([`days`,`hours`,`cycles`]),XM=u({value:i().min(0).nullable(),unit:YM}),ZM=u({key:c().min(1),label:c().min(1),level:i().min(0).max(100).nullable(),status:y([`ok`,`replace`]).nullable(),lastResetAt:i().nullable(),resettable:x(),remaining:XM.optional()}),QM=u({items:b(ZM),lastChangedAt:i()}),$M={name:`consumables`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:Object.values(E),deviceConfig:{ui:{kind:`widget`,widgetId:`host/consumables-panel`,tab:`consumables`,topTab:!0,label:`Consumables`,order:5}},methods:{reset:w(u({deviceId:i().int().nonnegative(),key:c().min(1)}),g(),{kind:`mutation`,auth:`admin`})},composedMethods:{reset:{kind:`refuse`,reason:`a composed consumable is not resettable until commands (forward) arrive — slice 3`}},status:{schema:QM,kind:`push`,empty:{items:[],lastChangedAt:0},itemArray:{path:`items`,keyField:`key`,labelField:`label`,itemSchema:ZM,emptyItem:{key:``,label:``,level:null,status:null,lastResetAt:null,resettable:!1}}},runtimeState:QM.extend({lastFetchedAt:i()}),durability:`restored`,volatileStateFields:[`lastChangedAt`,`lastFetchedAt`]},eN=u({entryOpen:x(),lastChangedAt:i()}),tN={name:`contact`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:eN,kind:`push`},runtimeState:eN,durability:`restored`,volatileStateFields:[`lastChangedAt`]},nN=y([`numeric`,`select`,`text`,`datetime`]),rN=u({kind:nN,value:d([i(),c()]),options:b(c()),lastChangedAt:i(),unit:c().optional(),min:i().optional(),max:i().optional(),step:i().optional(),precision:i().int().min(0).max(10).optional(),format:y([`date`,`time`,`datetime`]).optional()}),iN=f(`kind`,[u({kind:p(`numeric`),value:i()}),u({kind:p(`select`),value:c().min(1)}),u({kind:p(`text`),value:c()}),u({kind:p(`datetime`),value:c().min(1)})]),aN={name:`control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Control],methods:{setValue:w(u({deviceId:i().int().nonnegative(),control:iN}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:rN,kind:`push`},runtimeState:rN,durability:`session`},oN=y([`open`,`opening`,`closing`,`closed`,`stopped`]),sN=u({state:oN,position:i().min(0).max(100).nullable(),tiltPosition:i().min(0).max(100).nullable(),lastChangedAt:i()}),cN={name:`cover`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Cover],methods:{open:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),close:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),stop:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),setPosition:w(u({deviceId:i().int().nonnegative(),position:i().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`}),setTiltPosition:w(u({deviceId:i().int().nonnegative(),tiltPosition:i().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:sN,kind:`push`},runtimeState:sN,durability:`restored`,volatileStateFields:[`lastChangedAt`]},lN=y([`auto`,`day`,`night`,`schedule`]),uN=u({min:i(),max:i(),step:i()}),dN=u({mode:lN,sensitivity:i().optional(),switchDelaySec:i().optional(),lastFetchedAt:i()}),fN=u({modes:b(lN),supportsSensitivity:x(),sensitivity:uN.optional(),supportsSwitchDelay:x(),switchDelaySec:uN.optional()}),pN=u({mode:lN.optional(),sensitivity:i().optional(),switchDelaySec:i().optional()}),mN={name:`day-night`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`day-night`,tab:`image`}},methods:{getOptions:w(u({deviceId:i()}),fN),setSettings:w(u({deviceId:i(),settings:pN}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:dN,kind:`poll`},runtimeState:dN,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},hN=u({online:x(),lastChangedAt:i()}),gN={name:`device-status`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onStatusChanged:{data:u({deviceId:i(),status:hN})}},status:{schema:hN,kind:`push`},runtimeState:hN,durability:`restored`,volatileStateFields:[`lastChangedAt`]},_N=u({lastPressedAt:i().nullable(),pressCountSinceStart:i()}),vN=u({deviceId:i(),timestamp:i()}),yN={name:`doorbell`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Button,E.Camera],methods:{},events:{onPressed:{data:vN,fromState:{field:`lastPressedAt`,on:`advance`}}},status:{schema:_N,kind:`push`},runtimeState:_N,durability:`restored`},bN=y([`date`,`time`,`datetime`]),xN=u({value:c(),format:bN.optional(),lastFetchedAt:i()}),SN={name:`enum-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:xN,kind:`push`},runtimeState:xN,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},CN=u({deviceId:i(),eventType:c(),data:_(c(),o()).nullable(),timestamp:i(),seq:i()}),wN=u({eventTypes:b(c()),lastEvent:CN.nullable(),eventCountSinceStart:i()}),TN={name:`event-emitter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.EventEmitter],methods:{},events:{onEvent:{data:CN}},status:{schema:wN,kind:`push`},runtimeState:wN,durability:`session`},EN=u({id:c(),name:c(),sampleCount:i().int().nonnegative(),coverMediaId:i().int().optional(),coverBase64:c().optional()}),DN=u({id:c(),source:y([`detected`,`photo`]),addedAt:i().int(),deviceId:i().int().optional(),base64:c().optional()}),ON=u({sampleId:c(),enrolledAt:i().int(),deviceId:i().int().optional(),source:y([`detected`,`photo`]),mediaId:i().int().optional(),comparable:x(),selfMean:i().nullable(),bestForeign:u({identityId:c(),name:c(),score:i()}).optional(),suspicion:i()}),kN=u({identityId:c(),name:c(),modelId:c(),totalSamples:i().int(),comparableSamples:i().int(),flagged:i().int(),flagThreshold:i(),rows:b(ON).readonly()}),AN=u({faceId:c(),deviceId:i().int(),trackId:c(),timestamp:i().int(),recognizedIdentityId:c().optional(),identityName:c().optional(),assigned:x(),base64:c().optional(),cropUrl:c().optional(),faceBbox:uf.optional(),keyFrameMediaId:i().int().optional(),bestMatchScore:i().optional(),nativeFaceShortSidePx:i().optional(),suggestedIdentityId:c().optional(),suggestedMatchScore:i().optional()}),jN=y([`unassigned`,`recognized`,`identified`,`all`]),MN=y([`timestamp`,`suggestionConfidence`]),NN=y([`asc`,`desc`]),PN=u({faceIds:b(c()).readonly(),representativeFaceId:c(),size:i().int(),cohesion:i()}),FN=u({mediaId:i().int(),kind:c(),url:c(),sizeBytes:i(),timestamp:i()}),IN={name:`face-gallery`,scope:`system`,mode:`singleton`,methods:{listIdentities:w(u({includeCrops:x().optional()}).optional(),b(EN).readonly()),createIdentity:w(u({name:c().min(1)}),EN,{kind:`mutation`,auth:`admin`}),renameIdentity:w(u({id:c(),name:c().min(1)}),g(),{kind:`mutation`,auth:`admin`}),deleteIdentity:w(u({id:c()}),g(),{kind:`mutation`,auth:`admin`}),listIdentitySamples:w(u({identityId:c()}),b(DN).readonly()),auditIdentitySamples:w(u({identityId:c().min(1)}),kN,{auth:`admin`}),removeSample:w(u({identityId:c(),sampleId:c()}),g(),{kind:`mutation`,auth:`admin`}),listRecentFaces:w(u({deviceId:i().int().optional(),deviceIds:b(i().int()).optional(),limit:i().int().positive().optional(),filter:jN.optional(),since:i().int().optional(),until:i().int().optional(),sortBy:MN.optional(),sortDirection:NN.optional(),includeCrops:x().optional()}).optional(),b(AN).readonly()),getFaceByTrack:w(u({deviceId:i().int(),trackId:c()}),AN.nullable()),getFaceMedia:w(u({faceId:c()}),b(FN).readonly()),assignFace:w(u({faceId:c(),identityId:c()}),g(),{kind:`mutation`,auth:`admin`}),unassignFace:w(u({faceId:c()}),g(),{kind:`mutation`,auth:`admin`}),deleteFace:w(u({faceId:c()}),g(),{kind:`mutation`,auth:`admin`}),assignFaces:w(u({faceIds:b(c()).min(1),identityId:c()}),u({assigned:i().int(),failed:b(c()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignFaces:w(u({faceIds:b(c()).min(1)}),u({unassigned:i().int(),failed:b(c()).readonly()}),{kind:`mutation`,auth:`admin`}),suggestFaceClusters:w(u({threshold:i().min(0).max(1).optional(),minClusterSize:i().int().min(2).optional(),maxClusters:i().int().positive().optional(),limit:i().int().positive().optional(),maxFacesScanned:i().int().positive().optional()}).optional(),b(PN).readonly())}},LN=y([`forward`,`reverse`]),RN=u({percentage:i().min(0).max(100).nullable(),percentageStep:i().positive().optional(),preset:c(),availablePresets:b(c()),direction:LN.nullable(),oscillating:x().nullable(),lastChangedAt:i()}),zN={name:`fan-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Fan],methods:{setPercentage:w(u({deviceId:i().int().nonnegative(),percentage:i().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`}),setPreset:w(u({deviceId:i().int().nonnegative(),preset:c().min(1)}),g(),{kind:`mutation`,auth:`protected`}),setDirection:w(u({deviceId:i().int().nonnegative(),direction:LN}),g(),{kind:`mutation`,auth:`protected`}),setOscillating:w(u({deviceId:i().int().nonnegative(),oscillating:x()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:RN,kind:`push`},runtimeState:RN,durability:`session`},BN=u({flags:_(c(),o()),deviceType:c().nullable(),model:c().nullable(),channelCount:i().nullable(),lastProbedAt:i(),lastFetchedAt:i()}),VN={name:`feature-probe`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onProbeChanged:{data:u({deviceId:i(),status:BN})}},status:{schema:BN,kind:`push`},runtimeState:BN,durability:`session`},HN=u({flooded:x(),lastChangedAt:i()}),UN={name:`flood`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:HN,kind:`push`},runtimeState:HN,durability:`restored`,volatileStateFields:[`lastChangedAt`]},WN=u({detected:x(),lastChangedAt:i()}),GN={name:`gas`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:WN,kind:`push`},runtimeState:WN,durability:`restored`,volatileStateFields:[`lastChangedAt`]},KN=u({on:x(),currentHumidity:i().min(0).max(100).nullable(),targetHumidity:i().min(0).max(100).nullable(),mode:c().nullable(),availableModes:b(c()),action:c().nullable(),minHumidity:i().nullable(),maxHumidity:i().nullable(),lastChangedAt:i()}),qN={name:`humidifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Humidifier],methods:{setOn:w(u({deviceId:i().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`}),setTargetHumidity:w(u({deviceId:i().int().nonnegative(),humidity:i().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`}),setMode:w(u({deviceId:i().int().nonnegative(),mode:c().min(1)}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:KN,kind:`push`},runtimeState:KN,durability:`session`},JN=u({percent:i().min(0).max(100),lastFetchedAt:i(),unit:c().optional(),precision:i().int().min(0).max(10).optional()}),YN={name:`humidity-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor,E.Thermostat],methods:{},status:{schema:JN,kind:`push`},runtimeState:JN,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},XN=u({url:c().nullable(),lastUpdated:i().nullable()}),ZN={name:`image`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Image],methods:{},status:{schema:XN,kind:`push`},runtimeState:XN,durability:`session`},QN=y([`0`,`90`,`180`,`270`]),$N=y([`auto`,`manual`]),eP=y([`auto`,`manual`]),tP=y([`off`,`blc`,`wdr`,`hlc`]),nP=u({min:i(),max:i(),step:i()}),rP=u({brightness:i().optional(),contrast:i().optional(),saturation:i().optional(),sharpness:i().optional(),mirror:x().optional(),flip:x().optional(),rotate:QN.optional(),whiteBalance:$N.optional(),warmth:i().optional(),exposureMode:eP.optional(),backlightMode:tP.optional(),lastFetchedAt:i()}),iP=u({supportsBrightness:x(),brightness:nP.optional(),supportsContrast:x(),contrast:nP.optional(),supportsSaturation:x(),saturation:nP.optional(),supportsSharpness:x(),sharpness:nP.optional(),supportsMirror:x(),supportsFlip:x(),rotateOptions:b(QN),whiteBalanceModes:b($N),supportsWarmth:x(),warmth:nP.optional(),exposureModes:b(eP),backlightModes:b(tP)}),aP=u({brightness:i().optional(),contrast:i().optional(),saturation:i().optional(),sharpness:i().optional(),mirror:x().optional(),flip:x().optional(),rotate:QN.optional(),whiteBalance:$N.optional(),warmth:i().optional(),exposureMode:eP.optional(),backlightMode:tP.optional()}),oP={name:`image-settings`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`image-settings`,tab:`image`}},methods:{getOptions:w(u({deviceId:i()}),iP),setSettings:w(u({deviceId:i(),settings:aP}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:rP,kind:`poll`},runtimeState:rP,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},sP=u({id:c(),addonId:c(),name:c(),enabled:x(),info:_(c(),o()).readonly(),createdAt:i(),updatedAt:i(),processState:c()}),cP=u({id:c(),addonId:c(),name:c(),enabled:x(),info:_(c(),o()).readonly(),createdAt:i(),updatedAt:i()}),lP=u({addonId:c(),name:c(),description:c(),iconUrl:c().nullable(),color:c(),instanceMode:c(),mode:y([`standalone`,`account`,`broker`]),discoveryMode:c(),kind:y([`device-adoption`,`device-provider`]),brokerKind:c().nullable(),supportsLocationImport:x(),canTest:x(),existingInstances:b(u({id:c(),name:c()})),canAdd:x()}),uP=y([`validated`,`rejected`,`inconclusive`,`unsupported`]),dP=u({success:x(),error:c().optional(),status:uP.optional(),testedBy:c().nullable().optional(),latencyMs:i().nonnegative().optional(),detail:c().optional()}),fP=u({addonId:c(),name:c(),enabled:x().optional(),info:_(c(),o()).optional(),settings:_(c(),o()).optional(),skipRestart:x().optional()}),pP=u({id:c(),name:c().optional(),enabled:x().optional(),info:_(c(),o()).optional()}),mP=u({success:x(),deletedId:c()}),hP={name:`integrations`,scope:`system`,mode:`singleton`,methods:{list:w(g(),b(sP)),get:w(u({id:c()}),sP),getByAddonId:w(u({addonId:c()}),cP.nullable()),create:w(fP,cP,{kind:`mutation`,auth:`admin`}),update:w(pP,cP,{kind:`mutation`,auth:`admin`}),delete:w(u({id:c()}),mP,{kind:`mutation`,auth:`admin`}),getSettings:w(u({id:c()}),_(c(),o()),{auth:`admin`}),setSettings:w(u({id:c(),settings:_(c(),o())}),u({success:x()}),{kind:`mutation`,auth:`admin`}),getAvailableTypes:w(g(),b(lP),{auth:`admin`}),testConnection:w(u({addonId:c(),settings:_(c(),o())}),dP,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},gP=u({codecs:b(c()),sampleRate:i(),duplex:y([`half`,`full`]),maxBacklogMs:i()}),_P=u({talking:x(),lastSessionAt:i().nullable(),ability:gP.nullable()}),vP=y([`opus`,`s16le`,`g711ulaw`,`g711alaw`]),yP={name:`intercom`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],methods:{startSession:w(u({deviceId:i()}),u({sessionId:c(),sdpOffer:c()}),{kind:`mutation`,auth:`protected`}),handleAnswer:w(u({deviceId:i(),sessionId:c(),sdpAnswer:c()}),g(),{kind:`mutation`,auth:`protected`}),stopSession:w(u({deviceId:i(),sessionId:c()}),g(),{kind:`mutation`,auth:`protected`}),startTalkSession:w(u({deviceId:i()}),u({sessionId:c()}),{kind:`mutation`,auth:`protected`}),pushTalkAudio:w(u({deviceId:i(),audioBase64:c(),codec:vP.optional(),sampleRate:i().int().positive().optional(),channels:i().int().positive().optional(),sequenceNumber:i().int()}),u({accepted:x()}),{kind:`mutation`,auth:`protected`}),endTalkSession:w(u({deviceId:i()}),g(),{kind:`mutation`,auth:`protected`})},events:{onStatusChanged:{data:u({deviceId:i(),status:_P})}},status:{schema:_P,kind:`command-driven`},runtimeState:_P,durability:`session`},bP=y([`idle`,`mowing`,`paused`,`docked`,`error`]),xP=y([`info`,`warning`,`error`]),SP=u({activity:bP,batteryLevel:i().min(0).max(100).nullable(),progressPercent:i().min(0).max(100).nullable(),currentCode:i().nullable(),currentCodeLabel:c().nullable(),severity:xP,lastChangedAt:i()}),CP={name:`lawn-mower-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.LawnMower],methods:{startMowing:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),pause:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),dock:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:SP,kind:`push`},runtimeState:SP,durability:`session`},wP=y([`lan`,`wifi`,`docker`,`vpn`,`loopback`,`other`]),TP=u({name:c(),family:y([`IPv4`,`IPv6`]),address:c(),cidr:c(),netmask:c(),internal:x(),mac:c(),kind:wP,preferred:x(),plausible:x(),plausibleReason:c()}),EP=u({interfaces:b(TP).readonly(),probedAt:i()}),DP=TP.nullable(),OP=u({label:c(),baseUrl:c(),kind:y([`lan-ipv4`,`lan-ipv6`,`public`,`loopback`]),interfaceKind:y([`lan`,`wifi`,`docker`,`vpn`,`other`,`loopback`,`public`]),plausible:x(),plausibleReason:c(),priority:i()}),kP=y([`server-config`,`server-env`,`caller-hint`,`default`]),AP=u({port:i().int().min(1).max(65535),source:kP}),jP=u({endpoints:b(OP).readonly(),localPort:AP}),MP=u({baseUrl:c().nullable(),resolved:c().nullable()}),NP=u({baseUrls:b(c()).readonly(),resolved:b(c()).readonly()}),PP=u({addresses:b(c()).readonly()}),FP=u({mode:y([`generated`,`uploaded`,`disabled`]),leafFingerprintSha256:c().nullable(),caFingerprintSha256:c().nullable(),validTo:c().nullable(),sans:b(c()),caCertPem:c().nullable(),reissueError:c().nullable(),restartRequired:x()}),IP={name:`local-network`,scope:`system`,mode:`singleton`,methods:{list:w(g(),EP),getPreferred:w(g(),DP),getConnectionEndpoints:w(u({port:i().int().min(1).max(65535).optional(),includeLoopback:x().optional(),ipv4Only:x().optional(),scheme:y([`http`,`https`]).optional()}),jP),getNotificationEndpoint:w(g(),MP),setNotificationEndpoint:w(u({baseUrl:c().nullable()}),MP,{kind:`mutation`}),getViewerEndpoints:w(g(),NP),setViewerEndpoints:w(u({baseUrls:b(c()).readonly()}),NP,{kind:`mutation`}),getAllowedAddresses:w(g(),PP),setAllowedAddresses:w(PP,u({success:p(!0)}),{kind:`mutation`}),resetAllowlistToBestMatch:w(g(),PP,{kind:`mutation`}),getTlsStatus:w(g(),FP),regenerateCertificate:w(u({reason:c().optional()}),FP,{kind:`mutation`,auth:`admin`}),uploadCertificate:w(u({certPem:c().min(1),keyPem:c().min(1),caPem:c().optional()}),FP,{kind:`mutation`,auth:`admin`}),downloadCa:w(g(),u({pem:c()})),revertToGeneratedCertificate:w(g(),FP,{kind:`mutation`,auth:`admin`})},mount:{kind:`hub-only`}},LP=y([`locked`,`unlocked`,`locking`,`unlocking`,`jammed`]),RP=u({state:LP,lastChangedAt:i()}),zP={name:`lock-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Lock],methods:{lock:w(u({deviceId:i().int().nonnegative(),code:c().min(1).optional()}),g(),{kind:`mutation`,auth:`protected`}),unlock:w(u({deviceId:i().int().nonnegative(),code:c().min(1).optional()}),g(),{kind:`mutation`,auth:`protected`}),open:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:RP,kind:`push`},runtimeState:RP,durability:`restored`,volatileStateFields:[`lastChangedAt`]},BP=y([`off`,`on`,`idle`,`playing`,`paused`,`buffering`,`standby`]),VP=y([`off`,`all`,`one`]),HP=u({type:c(),title:c(),artist:c().optional(),album:c().optional(),imageUrl:c().optional()}),UP=u({state:BP,volumeLevel:i().min(0).max(100).nullable(),isMuted:x().nullable(),source:c(),availableSources:b(c()),currentMedia:HP.nullable(),positionMs:i().int().nonnegative().nullable(),durationMs:i().int().nonnegative().nullable(),shuffle:x().nullable(),repeat:VP.nullable(),lastChangedAt:i()}),WP={name:`media-player`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.MediaPlayer],methods:{play:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),pause:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),stop:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),next:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),previous:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),seek:w(u({deviceId:i().int().nonnegative(),positionMs:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),setVolume:w(u({deviceId:i().int().nonnegative(),volumeLevel:i().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`}),setMute:w(u({deviceId:i().int().nonnegative(),muted:x()}),g(),{kind:`mutation`,auth:`protected`}),setShuffle:w(u({deviceId:i().int().nonnegative(),shuffle:x()}),g(),{kind:`mutation`,auth:`protected`}),setRepeat:w(u({deviceId:i().int().nonnegative(),repeat:VP}),g(),{kind:`mutation`,auth:`protected`}),selectSource:w(u({deviceId:i().int().nonnegative(),source:c().min(1)}),g(),{kind:`mutation`,auth:`protected`}),playMedia:w(u({deviceId:i().int().nonnegative(),mediaId:c().min(1),mediaType:c().min(1)}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:UP,kind:`push`},runtimeState:UP,durability:`session`},GP=u({id:c(),label:c(),scope:y([`mesh`,`public`]),url:c(),hostname:c(),port:i(),protocol:y([`http`,`https`])}),KP=u({id:c(),hostname:c(),magicDns:c(),addresses:b(c()).readonly(),os:c().optional(),online:x(),lastSeenMs:i(),isSelf:x(),connection:y([`direct`,`relay`,`idle`]),relay:c().nullable(),lastHandshakeMs:i(),rxBytes:i(),txBytes:i(),tags:b(c()).readonly(),exitNodeOption:x(),advertisedRoutes:b(c()).readonly(),userLogin:c().nullable(),keyExpiry:i().nullable()}),qP=u({joined:x(),meshIp:c(),magicDnsHostname:c(),peerCount:i(),endpoints:b(GP).readonly(),error:c().optional(),tenantName:c(),magicDnsSuffix:c(),userLogin:c().nullable(),controlPlaneUrl:c(),keyExpiry:i().nullable(),daemonSocket:c().optional(),daemonCliPath:c().optional()}),JP={name:`mesh-network`,scope:`system`,mode:`collection`,providerKind:`mesh`,methods:{getStatus:w(g(),qP),join:w(u({authKey:c().min(8),hostname:c().optional()}),u({joined:p(!0)}),{kind:`mutation`}),startLogin:w(u({hostname:c().optional()}),u({loginUrl:c()}),{kind:`mutation`}),leave:w(g(),u({left:p(!0)}),{kind:`mutation`}),logout:w(g(),u({loggedOut:p(!0)}),{kind:`mutation`}),listPeers:w(g(),u({peers:b(KP).readonly()})),testConnection:w(u({authKey:c().optional()}),u({ok:x(),tenant:c().optional(),daemonVersion:c().optional(),error:c().optional()}),{kind:`mutation`})}},YP=15e3,XP=u({detected:x(),lastDetectedAt:i().nullable(),autoClearAfterMs:i().nullable()}),ZP=u({deviceId:i(),detected:x(),timestamp:i(),source:QD,regions:b(Lb).readonly().optional(),triggeredBy:vw.optional()}),QP={name:`motion`,scope:`device`,mode:`singleton`,deviceNative:!0,deviceTypes:[E.Camera,E.Sensor],methods:{isDetected:w(u({deviceId:i()}),x())},events:{onMotionChanged:{data:ZP}},status:{schema:XP,kind:`push`},runtimeState:XP,durability:`session`},$P=u({enabled:x(),lastChangedAt:i()}),eF=$P.extend({lastFetchedAt:i()}),tF={name:`motion-trigger`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Light,E.Siren,E.Switch],methods:{setMotionTrigger:w(u({deviceId:i().int().nonnegative(),enabled:x()}),g(),{kind:`mutation`,auth:`admin`})},events:{onMotionTriggerChanged:{data:u({deviceId:i(),enabled:x(),lastChangedAt:i()})}},status:{schema:$P,kind:`command-driven`},runtimeState:eF,durability:`session`},nF=u({id:i(),enabled:x(),shape:Yx}),rF=u({enabled:x(),sensitivity:i(),regions:b(nF),lastFetchedAt:i()}),iF=u({maxRegions:i(),supportedShapes:b(Qx),grid:eS,sensitivity:u({min:i(),max:i(),step:i()})}),aF=u({enabled:x().optional(),sensitivity:i().optional(),regions:b(nF).optional()}),oF={name:`motion-zones`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/motion-zones-grid`,tab:`motion`,label:`Motion Zones`}},methods:{getOptions:w(u({deviceId:i()}),iF),setZone:w(u({deviceId:i(),patch:aF}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:rF,kind:`poll`},runtimeState:rF,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},sF=y([`person`,`vehicle`,`animal`,`face`,`package`,`other`]),cF=u({class:sF,timestamp:i(),confidence:i().min(0).max(1).optional()}),lF=u({lastByClass:oe(sF,cF.nullable()),supportedClasses:b(sF).readonly(),enabled:x()}),uF=y([`boxed`,`while-streaming`,`flag-only`]),dF=u({supportedClasses:b(sF).readonly(),geometry:uF}),fF=u({enabled:x().optional()}),pF=lF.extend({lastFetchedAt:i()}),mF={name:`native-object-detection`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],methods:{getOptions:w(u({deviceId:i()}),dF),setSettings:w(u({deviceId:i(),settings:fF}),g(),{kind:`mutation`,auth:`admin`}),setEnabled:w(u({deviceId:i(),enabled:x()}),g(),{kind:`mutation`,auth:`admin`})},events:{onDetected:{data:u({deviceId:i(),detection:cF})}},status:{schema:lF,kind:`push`},runtimeState:pF,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},hF=u({pan:i().min(-1).max(1).optional(),tilt:i().min(-1).max(1).optional(),speed:i().min(0).max(1).optional()}),gF=y([`goHome`,`locate`,`spotClean`,`findPet`,`personFollow`,`stop`,`startClean`,`pauseClean`,`dockWash`,`autoEmpty`,`flashOn`,`flashOff`]),_F=y([`action`,`sound`]),vF=u({id:c(),kind:_F,label:c(),icon:c(),soundId:i().int().optional(),enabled:x()}),yF=[{id:`startClean`,kind:`action`,label:`Start cleaning`,icon:`play`,enabled:!0},{id:`pauseClean`,kind:`action`,label:`Pause cleaning`,icon:`pause`,enabled:!0},{id:`stop`,kind:`action`,label:`Stop`,icon:`hand`,enabled:!0},{id:`goHome`,kind:`action`,label:`Return to dock`,icon:`home`,enabled:!0},{id:`locate`,kind:`action`,label:`Locate`,icon:`bell`,enabled:!0},{id:`spotClean`,kind:`action`,label:`Spot clean here`,icon:`crosshair`,enabled:!0},{id:`findPet`,kind:`action`,label:`Find pet`,icon:`paw-print`,enabled:!0},{id:`personFollow`,kind:`action`,label:`Follow me`,icon:`footprints`,enabled:!0},{id:`dockWash`,kind:`action`,label:`Wash mop`,icon:`droplets`,enabled:!0},{id:`autoEmpty`,kind:`action`,label:`Empty dustbin`,icon:`trash-2`,enabled:!0},{id:`flashOn`,kind:`action`,label:`Flash on`,icon:`flashlight`,enabled:!0},{id:`flashOff`,kind:`action`,label:`Flash off`,icon:`flashlight-off`,enabled:!0},{id:`sound:meow`,kind:`sound`,label:`Meow`,icon:`cat`,soundId:684,enabled:!0},{id:`sound:bark`,kind:`sound`,label:`Woof`,icon:`dog`,soundId:685,enabled:!0},{id:`sound:footsteps`,kind:`sound`,label:`Footsteps`,icon:`footprints`,soundId:686,enabled:!0},{id:`sound:purring`,kind:`sound`,label:`Purring`,icon:`cat`,soundId:687,enabled:!0},{id:`sound:tickTock`,kind:`sound`,label:`Tick-tock`,icon:`clock`,soundId:688,enabled:!0}],bF=u({x:i(),y:i()}),xF=u({move:x(),stop:x(),goToPoint:x(),runAction:x(),playSound:x(),light:x(),lightMode:x()}),SF=y([`auto`,`manual`]),CF=40,wF=100,TF=y([`idle`,`cleaning`,`spot`,`following`,`goto`,`returning`,`paused`,`unknown`]),EF=u({mode:TF,following:x(),flash:x(),lightMode:SF,lightLevel:i().min(40).max(100),lastChangedAt:i()}),DF=EF.extend({lastFetchedAt:i()}),OF={name:`navigation`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/navigation-panel`,tab:`navigation`,topTab:!0,label:`Navigation`,order:0}},methods:{move:w(hF.extend({deviceId:i()}),g(),{kind:`mutation`}),stop:w(u({deviceId:i()}),g(),{kind:`mutation`}),goToPoint:w(bF.extend({deviceId:i()}),g(),{kind:`mutation`}),listActions:w(u({deviceId:i()}),b(vF)),runAction:w(u({deviceId:i(),actionId:gF}),g(),{kind:`mutation`}),playSound:w(u({deviceId:i(),soundId:i().int()}),g(),{kind:`mutation`}),setLightOn:w(u({deviceId:i(),on:x()}),g(),{kind:`mutation`}),setLightMode:w(u({deviceId:i(),mode:SF,level:i().min(40).max(100).optional()}),g(),{kind:`mutation`}),setLightLevel:w(u({deviceId:i(),level:i().min(40).max(100)}),g(),{kind:`mutation`}),getFeatures:w(u({deviceId:i()}),xF)},events:{onStatusChanged:{data:u({deviceId:i(),status:EF})}},status:{schema:EF,kind:`push`},runtimeState:DF,durability:`session`},kF=[`wifi`,`ethernet`,`cellular`,`unknown`],AF=u({type:y(kF),signalPercent:i().min(0).max(100).nullable(),rssiDbm:i().optional(),ssid:c().optional(),lastUpdated:i()}),jF={type:`unknown`,signalPercent:null,lastUpdated:0};function MF(e,t){return e===void 0||!Number.isFinite(e)||t<=0||e<0||e>t?null:Math.round(e/t*100)}function NF(e){return e===void 0||!Number.isFinite(e)||e>0?null:Math.round((Math.min(-50,Math.max(-100,e))+100)*2)}var PF={name:`network-link`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera,E.Sensor,E.Button,E.Switch,E.Light,E.Lock,E.Siren],methods:{},events:{onStatusChanged:{data:u({deviceId:i(),status:AF})}},status:{schema:AF,kind:`push`,empty:jF},runtimeState:AF,durability:`restored`,volatileStateFields:[`lastUpdated`]},FF=u({nominalBitrateKbps:i(),observedBitrateKbps:i(),peakBitrateKbps:i(),packetLossPercent:i(),lastUpdated:i()}),IF=u({rttMs:i(),jitterMs:i(),estimatedBandwidthKbps:i(),packetLossPercent:i().min(0).max(100),downlinkMbps:i().optional(),downlinkAgeMs:i().optional(),lastUpdated:i()}),LF=u({deviceId:i(),streams:_(c(),FF),client:IF.optional()}),RF={name:`network-quality`,scope:`system`,mode:`singleton`,methods:{getDeviceStats:w(u({deviceId:i()}),LF.nullable()),getAllStats:w(g(),b(LF).readonly()),reportClientStats:w(u({deviceId:i(),rttMs:i().min(0).max(6e4),jitterMs:i().min(0).max(1e4),estimatedBandwidthKbps:i().min(0).max(1e6),packetLossPercent:i().min(0).max(100),downlinkMbps:i().min(0).max(1e5).optional(),downlinkAgeMs:i().min(0).max(864e5).optional()}),g(),{kind:`mutation`})},mount:{kind:`server-provided`}},zF=u({addonId:c(),capabilities:b(c()).readonly(),status:c()}),BF=u({pid:i(),name:c(),state:c(),cpuPercent:i(),memoryRss:i(),uptimeSeconds:i(),services:b(zF).readonly(),groupId:c().optional()}),VF=u({id:c(),status:c(),cpuPercent:i(),memoryRss:i()}),HF=u({category:c(),total:i(),healthy:i(),addons:b(VF).readonly()}),UF=u({name:c(),version:c()}),WF=u({id:c(),name:c(),hostname:c(),platform:c(),arch:c(),cpuModel:c().nullable(),cpuCores:i(),memoryMB:i(),engines:b(c()).readonly(),isHub:x(),isOnline:x(),cpuPercent:i(),memoryPercent:i(),uptime:i(),lastSeen:c(),localIps:b(c()).readonly(),addons:b(u({id:c(),capabilities:b(c()).readonly(),status:c()})).readonly(),processes:b(BF).readonly(),categories:b(HF).readonly(),rootPackage:UF.nullable()}),GF=u({callerAddonId:c(),providerAddonId:c(),capName:c(),callsPerMin:i(),lastCallAtMs:i()}),KF=u({nodeId:c(),name:c(),version:c(),status:c(),synced:x()}),qF=u({hubVersion:c(),nodes:b(KF)}),JF=u({nodeId:c(),addonId:c()}),YF=u({id:c(),status:c(),version:c().optional(),packageName:c().optional()}),XF=u({success:x()}),ZF=u({success:x(),reason:c().optional()}),QF=u({restarted:b(c()).readonly(),failed:b(c()).readonly()}),$F=u({nodeId:c(),name:c()}),eI=u({id:c(),name:c(),isHub:x(),isOnline:x()}),tI=u({nodes:b(eI).readonly(),complete:x()}),nI={name:`nodes`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{topology:w(g(),b(WF).readonly(),{auth:`admin`}),directory:w(g(),tI,{auth:`admin`}),deployAddon:w(JF,XF,{kind:`mutation`,auth:`admin`}),undeployAddon:w(JF,XF,{kind:`mutation`,auth:`admin`}),restartAddon:w(JF,XF,{kind:`mutation`,auth:`admin`}),restartProcess:w(u({nodeId:c(),processName:c()}),ZF,{kind:`mutation`,auth:`admin`}),restartNode:w(u({nodeId:c()}),QF,{kind:`mutation`,auth:`admin`}),shutdownNode:w(u({nodeId:c()}),XF,{kind:`mutation`,auth:`admin`}),renameNode:w(u({nodeId:c(),name:c().min(1).max(64)}),$F,{kind:`mutation`,auth:`admin`}),clusterAddonStatus:w(g(),_(c(),qF),{auth:`admin`}),getCapUsageGraph:w(u({windowSeconds:i().int().positive().max(300).default(60)}),b(GF).readonly(),{auth:`admin`}),getNodeAddons:w(u({nodeId:c()}),b(YF).readonly(),{auth:`admin`}),setProcessLogLevel:w(u({nodeId:c(),level:c()}),XF,{kind:`mutation`,auth:`admin`}),executeQuery:w(u({nodeId:c(),addonId:c(),queryName:c(),params:_(c(),o()).optional()}),o(),{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},rI=y([`min`,`low`,`normal`,`high`]),iI=u({id:c().min(1),title:c().min(1),uri:s().optional(),destructive:x().optional()}),aI=u({image:x(),priority:x(),data:x(),actions:x(),recipients:x()}),oI=u({lastSentAt:i(),lastError:c().nullable(),queueDepth:i().int().nonnegative(),supports:aI}),sI=u({deviceId:i().int().nonnegative(),title:c().optional(),body:c().min(1),image:c().optional(),priority:rI.optional(),channel:c().optional(),recipients:b(c()).optional(),actions:b(iI).optional(),data:_(c(),o()).optional()}),cI=u({notificationId:c(),acceptedAt:i()}),lI={name:`notifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Notifier],methods:{send:w(sI,cI,{kind:`mutation`,auth:`admin`}),cancel:w(u({deviceId:i().int().nonnegative(),notificationId:c().min(1)}),g(),{kind:`mutation`,auth:`admin`})},events:{onSent:{data:u({deviceId:i(),notificationId:c(),success:x(),error:c().nullable(),acceptedAt:i()})}},status:{schema:oI,kind:`command-driven`},runtimeState:oI,durability:`session`},uI=u({value:i(),unit:c().optional(),precision:i().int().min(0).max(10).optional(),lastFetchedAt:i()}),dI={name:`numeric-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:uI,kind:`push`},runtimeState:uI,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},fI=y([`text`,`timestamp`,`watermark`]),pI=y([`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`custom`]),mI=u({id:c(),kind:fI,enabled:x(),text:c().optional(),position:pI.optional(),availablePositions:b(pI).readonly(),readOnly:x().optional()}),hI=u({overlays:b(mI).readonly()}),gI=u({enabled:x().optional(),text:c().optional(),position:pI.optional()}).partial(),_I={name:`osd`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],methods:{setOverlay:w(u({deviceId:i(),overlayId:c(),patch:gI}),g(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:u({deviceId:i(),status:hI})}},status:{schema:hI,kind:`command-driven`},settings:{bindings:[{kind:`array`,statusPath:`overlays`,idField:`id`,method:`setOverlay`,idArg:`overlayId`,patchArg:`patch`,sectionId:`osd`,sectionTitle:`Video overlays`,itemFields:{enabled:{label:e=>`${String(e.id)} enabled`,kind:`boolean`},text:{label:e=>`${String(e.id)} text`,kind:`text`,when:e=>e.kind!==`timestamp`&&!e.readOnly},position:{label:e=>`${String(e.id)} position`,kind:`select`,options:e=>e.availablePositions??[],when:e=>Array.isArray(e.availablePositions)&&e.availablePositions.length>0}}}]}},vI=f(`kind`,[u({kind:p(`static`),text:c().max(64)}),u({kind:p(`clock`),pattern:c().min(1).max(32).default(`HH:mm`),timezone:c().min(1).max(64).optional()}),u({kind:p(`device-state`),deviceId:i().int().optional(),capName:c().min(1).max(64),valuePath:c().min(1).max(64)}),u({kind:p(`latest-recognition`),recognition:y([`person`,`plate`])})]),yI=u({enabled:x().default(!0),source:vI,template:c().max(96).default("${value}"),maxCharacters:i().int().min(4).max(64).optional(),maxDecimals:i().int().min(0).max(4).default(1),unitLabel:c().max(8).optional(),valueMap:_(c(),c()).optional(),schedule:_S.optional(),conditions:PS.optional(),fallbackText:c().max(64).default(``)}),bI=u({slotId:c(),kind:fI,readOnly:x(),cameraEnabled:x(),cameraText:c().optional(),binding:yI.nullable()}),xI=y([`written`,`unchanged`,`gated`,`unreadable`,`disabled`,`unbound`,`failed`]),SI=u({slotId:c(),outcome:xI,text:c(),reason:c().optional()}),CI=y([`number`,`boolean`,`string`,`enum`]),wI=u({deviceId:i().int(),deviceName:c(),capName:c(),valuePath:c(),label:c(),valueType:CI,enumValues:b(c()).readonly().optional()}),TI={name:`osd-manager`,scope:`system`,mode:`singleton`,methods:{getDeviceOsd:w(u({deviceId:i().int()}),u({supported:x(),slots:b(bI)}),{auth:`admin`}),getSourceCatalog:w(u({deviceId:i().int()}),u({sources:b(wI)}),{auth:`admin`}),getConditionSupport:w(u({}),u({supported:b(c()),catalog:b(mC)}),{auth:`admin`}),setSlotBinding:w(u({deviceId:i().int(),slotId:c().min(1),binding:yI}),u({slot:bI,render:SI}),{kind:`mutation`,auth:`admin`}),clearSlotBinding:w(u({deviceId:i().int(),slotId:c().min(1)}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`}),copyDeviceConfiguration:w(u({sourceDeviceId:i().int(),targetDeviceId:i().int()}),u({copied:i().int().nonnegative(),skipped:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),previewSlot:w(u({deviceId:i().int(),slotId:c().min(1),binding:yI.optional()}),SI,{kind:`mutation`,auth:`admin`}),renderDevice:w(u({deviceId:i().int()}),u({results:b(SI)}),{kind:`mutation`,auth:`admin`})}},EI=4,DI=200,OI=y([`normal`,`offline`,`on_batteries`]),kI=i().int().min(4).max(200),AI=u({foodLevel:i().nullable(),food1:i().nullable(),food2:i().nullable(),lowFood:x(),batteryPower:i().min(0).max(100).nullable(),desiccantLeftDays:i().nullable(),feeding:x(),status:OI.nullable(),error:c().nullable(),errorCode:i().nullable(),isDualHopper:x(),childLock:x(),indicatorLight:x(),feedSound:x(),volume:i(),lastFetchedAt:i()}),jI={name:`pet-feeder`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.PetFeeder],methods:{feed:w(u({deviceId:i().int().nonnegative(),grams:kI.optional(),hopper1:kI.optional(),hopper2:kI.optional()}),g(),{kind:`mutation`,auth:`protected`}),cancelFeed:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),resetDesiccant:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),markFoodReplenished:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),callPet:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),playSound:w(u({deviceId:i().int().nonnegative(),soundId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),setChildLock:w(u({deviceId:i().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`}),setIndicatorLight:w(u({deviceId:i().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`}),setFeedSound:w(u({deviceId:i().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`}),setVolume:w(u({deviceId:i().int().nonnegative(),level:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:AI,kind:`poll`},runtimeState:AI,durability:`session`},MI=u({id:c(),name:c(),sampleCount:i().int().nonnegative(),coverMediaId:i().int().optional(),coverBase64:c().optional()}),NI=u({id:c(),text:c(),score:i(),addedAt:i().int(),deviceId:i().int().optional(),base64:c().optional()}),PI=u({plateId:c(),deviceId:i().int(),trackId:c(),timestamp:i().int(),text:c(),score:i(),corrected:x(),recognizedVehicleId:c().optional(),vehicleName:c().optional(),assigned:x(),plateBbox:uf.optional(),keyFrameMediaId:i().int().optional(),base64:c().optional(),cropUrl:c().optional()}),FI=u({mediaId:i().int(),kind:c(),url:c(),sizeBytes:i(),timestamp:i()}),II=u({plateIds:b(c()).readonly(),representativePlateId:c(),representativeText:c(),size:i().int(),cohesion:i()}),LI={name:`plate-gallery`,scope:`system`,mode:`singleton`,methods:{listPlates:w(u({deviceId:i().int().optional(),limit:i().int().positive().optional(),includeCrops:x().optional()}).optional(),b(PI).readonly()),getPlateByTrack:w(u({deviceId:i().int(),trackId:c()}),PI.nullable()),getPlateMedia:w(u({plateId:c()}),b(FI).readonly()),searchPlates:w(u({text:c().min(1),maxDistance:i().int().min(0).optional(),limit:i().int().positive().optional(),includeCrops:x().optional()}),b(PI).readonly()),suggestPlateClusters:w(u({maxDistance:i().int().min(0).optional(),minClusterSize:i().int().min(2).optional(),limit:i().int().positive().optional()}).optional(),b(II).readonly()),correctPlateText:w(u({plateId:c(),text:c().min(1)}),g(),{kind:`mutation`,auth:`admin`}),deletePlate:w(u({plateId:c()}),g(),{kind:`mutation`,auth:`admin`}),listVehicles:w(u({includeCrops:x().optional()}).optional(),b(MI).readonly()),createVehicle:w(u({name:c().min(1)}),MI,{kind:`mutation`,auth:`admin`}),renameVehicle:w(u({id:c(),name:c().min(1)}),g(),{kind:`mutation`,auth:`admin`}),deleteVehicle:w(u({id:c()}),g(),{kind:`mutation`,auth:`admin`}),listVehicleSamples:w(u({vehicleId:c()}),b(NI).readonly()),removeVehicleSample:w(u({vehicleId:c(),sampleId:c()}),g(),{kind:`mutation`,auth:`admin`}),assignPlate:w(u({plateId:c(),vehicleId:c()}),g(),{kind:`mutation`,auth:`admin`}),unassignPlate:w(u({plateId:c()}),g(),{kind:`mutation`,auth:`admin`}),assignPlates:w(u({plateIds:b(c()).min(1),vehicleId:c()}),u({assigned:i().int(),failed:b(c()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignPlates:w(u({plateIds:b(c()).min(1)}),u({unassigned:i().int(),failed:b(c()).readonly()}),{kind:`mutation`,auth:`admin`})}},RI=y(Wu),zI=y([`videotoolbox`,`cuda`,`nvdec`,`vaapi`,`qsv`,`d3d11va`,`dxva2`,`amf`,`vdpau`,`drm`,`coreml`,`tensorrt`,`openvino`,`directml`,`webgpu`,`none`]).nullable().optional(),BI=u({preferred:b(c()).readonly(),rationale:c()}),VI=y([`h264_videotoolbox`,`hevc_videotoolbox`,`h264_vaapi`,`hevc_vaapi`,`h264_nvenc`,`hevc_nvenc`,`h264_qsv`,`hevc_qsv`,`h264_amf`,`hevc_amf`,`libx264`,`libx265`]);u({encoders:b(u({encoder:VI,codec:y([`H264`,`H265`]),family:y([`videotoolbox`,`vaapi`,`nvenc`,`qsv`,`amf`,`software`]),available:x(),reason:c().optional()})).readonly(),defaultH264:VI,defaultH265:VI,probedAt:i()}),u({methods:b(c()).readonly(),probedAt:i()});var HI=y([`darwin`,`linux`,`win32`]),UI=y([`arm64`,`x64`]),WI=u({type:y([`nvidia`,`amd`,`intel`,`apple`]),name:c(),memoryMB:i().optional()}),GI=u({type:y([`apple-ane`,`intel-npu`])}),KI=u({type:p(`coral-edgetpu`),bus:c().optional()}),qI=u({platform:HI,arch:UI,cpuModel:c(),cpuCores:i(),totalRAM_MB:i(),availableRAM_MB:i(),gpu:WI.nullable(),npu:GI.nullable(),coral:KI.nullable().optional()}),JI=u({runtime:p(`python`),backend:c(),format:y([`onnx`,`coreml`,`openvino`,`tflite`]),score:i(),reason:c(),available:x()}),YI=u({key:c(),backend:c(),device:c(),format:RI,runtime:p(`python`),score:i(),available:x()}),XI=u({hardware:qI,scores:b(JI).readonly(),bestScore:JI,pythonPath:c().nullable(),devices:b(YI).readonly()}),ZI=u({modelId:c(),name:c(),minRAM_MB:i(),accuracyScore:i(),formats:b(c()).readonly()}),QI=u({modelId:c(),runtime:p(`python`),backend:c(),format:RI,reason:c()}),$I={name:`platform-probe`,scope:`system`,mode:`singleton`,methods:{getCapabilities:w(g(),XI),getHardware:w(g(),qI),resolveInferenceConfig:w(u({requirements:b(ZI).readonly()}),QI),resolveHwAccel:w(u({prefer:zI}),BI)}},eL=u({watts:i().optional(),kwhTotal:i().optional(),volts:i().optional(),amps:i().optional(),va:i().optional(),powerFactor:i().min(0).max(1).optional(),lastFetchedAt:i(),unit:c().optional(),precision:i().int().min(0).max(10).optional()}),tL={name:`power-meter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:eL,kind:`push`},runtimeState:eL,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},nL=u({latitude:i().min(-90).max(90),longitude:i().min(-180).max(180),accuracyMeters:i().nonnegative()}),rL=u({state:c(),location:c().nullable(),gps:nL.nullable(),batteryPercent:i().min(0).max(100).nullable(),lastChangedAt:i()}),iL={name:`presence`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Presence],methods:{},status:{schema:rL,kind:`push`},runtimeState:rL,durability:`restored`,volatileStateFields:[`lastChangedAt`]},aL=u({hpa:i(),lastFetchedAt:i(),unit:c().optional(),precision:i().int().min(0).max(10).optional()}),oL={name:`pressure-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:aL,kind:`push`},runtimeState:aL,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},sL=f(`kind`,[qx,Jx]),cL=u({id:i(),enabled:x(),shape:sL}),lL=u({enabled:x(),regions:b(cL).nullable(),audioEnabled:x().nullable(),lastFetchedAt:i()}),uL=u({maxRegions:i(),supportedShapes:b(Qx),polygonVertices:$x.optional(),supportsAudioMute:x()}),dL=u({enabled:x().optional(),regions:b(cL).optional()}),fL={name:`privacy-mask`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/privacy-mask-grid`,tab:`image`,label:`Privacy Mask`}},methods:{getOptions:w(u({deviceId:i()}),uL),setMask:w(u({deviceId:i(),patch:dL}),g(),{kind:`mutation`,auth:`admin`}),setAudioEnabled:w(u({deviceId:i(),enabled:x()}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:lL,kind:`poll`},runtimeState:lL,durability:`restored`,volatileStateFields:[`lastFetchedAt`]};function pL(e){return e.length===0?null:e.some(e=>e.audioEnabled)}var mL=y([`home`,`day-mode`,`night-mode`,`day-night-auto`,`set-limits`,`save-limits`,`reboot`,`osd-menu`]),hL=u({id:c(),name:c(),fn:mL.nullable(),writable:x()}),gL=u({pan:i().nullable(),tilt:i().nullable(),zoom:i().nullable()}),_L=u({pan:i().optional(),tilt:i().optional(),zoom:i().optional(),speed:i().optional()}),vL=gL.extend({autofocus:x()}),yL=u({hasPan:x(),hasTilt:x(),hasZoom:x(),supportsPresets:x(),maxPresets:i().optional(),hasAutofocus:x(),speedSteps:i().int().positive().nullable(),moveImpulseMs:i().int().positive().nullable()}),bL=u({presetId:c().nullable(),source:y([`operator`,`firmware`,`native`,`none`])}),xL=u({enabled:x(),seconds:i().int()}),SL={name:`ptz`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-panel`,tab:`ptz`,topTab:!0,label:`PTZ`,order:0}},methods:{move:w(_L.extend({deviceId:i()}),g(),{kind:`mutation`}),continuousMove:w(_L.extend({deviceId:i()}),g(),{kind:`mutation`}),stop:w(u({deviceId:i()}),g(),{kind:`mutation`}),getPresets:w(u({deviceId:i()}),b(hL)),goToPreset:w(u({deviceId:i(),presetId:c()}),g(),{kind:`mutation`}),savePreset:w(u({deviceId:i(),presetId:c(),name:c()}),g(),{kind:`mutation`,auth:`admin`}),deletePreset:w(u({deviceId:i(),presetId:c()}),g(),{kind:`mutation`,auth:`admin`}),getOptions:w(u({deviceId:i()}),yL),goHome:w(u({deviceId:i()}),g(),{kind:`mutation`}),getHomePreset:w(u({deviceId:i()}),bL),setHomePreset:w(u({deviceId:i(),presetId:c().nullable()}),g(),{kind:`mutation`,auth:`admin`}),captureHomeHere:w(u({deviceId:i()}),g(),{kind:`mutation`,auth:`admin`}),getHomeReturn:w(u({deviceId:i()}),xL.nullable()),setHomeReturn:w(u({deviceId:i(),enabled:x(),seconds:i().int().min(0).max(3600)}),g(),{kind:`mutation`,auth:`admin`}),getPosition:w(u({deviceId:i()}),gL),setAutofocus:w(u({deviceId:i(),enabled:x()}),g(),{kind:`mutation`})},status:{schema:vL,kind:`command-driven`}},CL=u({targetType:c().describe(`Vendor target string (people/vehicle/pet); empty = camera default`),stopDelaySeconds:i().int().min(0).max(300),disappearDelaySeconds:i().int().min(0).max(300)}),wL=u({value:c(),label:c()}),TL=u({enabled:x(),lastChangedAt:i(),currentSettings:CL.nullable(),supportedTargetTypes:b(wL)}),EL=TL.extend({lastFetchedAt:i()}),DL={name:`ptz-autotrack`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!1,deviceTypes:[E.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-autotrack`,tab:`ptz`,topTab:!0,label:`Auto-Tracking`,order:5}},methods:{getStatus:w(u({deviceId:i()}),TL),setEnabled:w(u({deviceId:i(),enabled:x()}),g(),{kind:`mutation`}),getSettings:w(u({deviceId:i()}),CL.nullable()),setSettings:w(u({deviceId:i(),settings:CL.partial()}),g(),{kind:`mutation`})},events:{onStatusChanged:{data:u({deviceId:i(),status:TL})}},status:{schema:TL,kind:`command-driven`},runtimeState:EL,durability:`session`},OL={name:`reboot`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera,E.Sensor,E.Switch],methods:{reboot:w(u({deviceId:i().int().nonnegative()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`})}},kL=`camstack`,AL=`recorder`,jL=u({profile:c(),startMs:i(),endMs:i()}),ML=y([`read`,`unreadable`]),NL=u({deviceId:i(),read:ML,ranges:b(jL),profilesWithFootage:b(c())}),PL=u({deviceId:i(),read:ML,days:b(i())}),FL=u({deviceId:i(),localMasterPath:c().nullable(),playbackUrl:c().nullable(),playbackEndpoints:b(c())}),IL=u({state:y([`ok`,`sleeping`,`unreachable`,`no-storage`,`index-empty`]),reason:c().optional(),coverageAsOf:i().optional()}),LL=u({source:c(),label:c(),addonId:c().optional(),availability:IL}),RL=u({transport:y([`archive`,`stream`,`realtime`]),coverage:y([`continuous`,`sparse`]),seek:y([`free`,`forward`,`segment`]),stepBack:x(),scrub:x(),rates:b(i().positive()).min(1).readonly(),exclusive:x()}),zL=f(`kind`,[u({kind:p(`hls`),manifest:FL}),u({kind:p(`clip`),source:c(),clipId:c(),startsAtMs:i()}),u({kind:p(`none`),reason:c()})]),BL={name:`recording`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:[E.Camera],methods:{listSources:w(u({deviceId:i()}),b(LL).readonly(),{kind:`query`,auth:`protected`}),getAvailability:w(u({deviceId:i(),provider:c().min(1),fromMs:i(),toMs:i(),profile:c().optional()}),NL,{kind:`query`,auth:`protected`}),getDaysWithRecordings:w(u({deviceId:i(),provider:c().min(1),fromMs:i(),toMs:i(),tzOffsetMinutes:i()}),PL,{kind:`query`,auth:`protected`}),getPlayback:w(u({deviceId:i(),provider:c().min(1),fromMs:i(),toMs:i(),profile:S.optional()}),zL,{kind:`query`,auth:`protected`}),getPlaybackOptions:w(u({deviceId:i(),provider:c().min(1)}),RL,{kind:`query`,auth:`protected`})}},VL=u({deviceId:i(),enabled:x(),activeMode:$s,nodeId:c(),storageBytes:i()}),HL=200,UL=u({deviceId:i(),read:y([`read`,`unreadable`]),ranges:b(jL).readonly(),profilesWithFootage:b(c()).readonly()}),WL=u({deviceId:i(),read:y([`read`,`unreadable`]),days:b(i()).readonly()}),GL=u({deviceId:i(),usedBytes:i(),oldestMs:i().nullable().optional(),segments:i().optional(),residentBytes:i().optional(),residentOldestMs:i().nullable().optional()}),KL=u({locationId:c().nullable(),locationIds:b(c()).optional(),root:c().optional(),usedBytes:i(),availableBytes:i().nullable(),totalBytes:i().nullable()}),qL=u({nodeId:c(),totalUsedBytes:i(),devices:b(GL),devicesRead:y([`archive`,`unavailable`]).optional(),complete:x().optional(),locations:b(KL).optional()}),JL=u({deviceId:i(),profile:c(),fromLocationId:c(),toLocationId:c(),bytes:i(),files:i().int()}),YL=y([`unassigned`,`target-not-writable`,`below-threshold`,`no-headroom`]),XL=u({deviceId:i(),profile:c(),fromLocationId:c(),toLocationId:c().nullable(),bytes:i(),reason:YL}),ZL=u({moves:b(JL),skipped:b(XL),bytesToMove:i(),jobIds:b(c())}),QL=u({throttleMbps:i().min(1).max(1e3).optional(),minMoveGb:i().min(0).optional()}),$L=u({deviceId:i().int(),profile:c(),locationId:c()}),eR=u({deviceId:i().int(),locationId:c()}),tR=u({assignments:b($L),pins:b(eR),defaultLocations:_(c(),c())}),nR=u({deviceId:i().int(),locationId:c().nullable()}),rR=f(`kind`,[u({kind:p(`segment`),startMs:i(),durMs:i(),bytes:i()}),u({kind:p(`gap`),nearestEdgeMs:i().nullable(),prevEndMs:i().nullable().optional()})]),iR=u({data:v(Uint8Array)}),aR=u({data:v(Uint8Array),gopStartMs:i(),gopDurMs:i()}),oR=f(`kind`,[u({kind:p(`ok`),data:v(Uint8Array),gopStartMs:i(),gopDurMs:i(),reachesRequestedEnd:x()}),u({kind:p(`spans-multiple-segments`),segmentEndMs:i()})]),sR={name:`recording-archive`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,status:{schema:VL,kind:`command-driven`},methods:{getAvailabilityBatch:w(u({deviceIds:b(i()).min(1).max(200),fromMs:i(),toMs:i()}),b(UL).readonly(),{kind:`query`,auth:`protected`}),getDaysWithRecordingsBatch:w(u({deviceIds:b(i()).min(1).max(200),fromMs:i(),toMs:i(),tzOffsetMinutes:i()}),b(WL).readonly(),{kind:`query`,auth:`protected`}),getStorageUsage:w(u({}),qL,{kind:`query`,auth:`admin`}),getDeviceConfig:w(u({deviceId:i()}),pc,{kind:`query`,auth:`protected`}),locateSegment:w(u({deviceId:i(),profile:c(),epochMs:i()}),rR,{kind:`query`,auth:`admin`}),readSegmentBytes:w(u({deviceId:i(),profile:c(),startMs:i()}),iR,{kind:`query`,auth:`admin`}),readGopBytes:w(u({deviceId:i(),profile:c(),startMs:i(),epochMs:i()}),aR,{kind:`query`,auth:`admin`}),readWindowBytes:w(u({deviceId:i(),profile:c(),startMs:i(),fromMs:i(),toMs:i()}),oR,{kind:`query`,auth:`admin`}),setDeviceConfig:w(u({deviceId:i(),config:pc}),pc,{kind:`mutation`,auth:`admin`}),rescanStorage:w(u({deviceId:i()}),VL,{kind:`mutation`,auth:`admin`}),pruneFootage:w(u({deviceId:i(),reason:Bs.optional()}),u({floorMs:i().nullable(),deletedBuckets:i().int(),reclaimedBytes:i().int()}),{kind:`mutation`,auth:`admin`}),deleteFootprint:w(u({deviceId:i(),fromMs:i().optional(),toMs:i().optional()}),u({deletedBuckets:i().int(),reclaimedBytes:i().int()}),{kind:`mutation`,auth:`admin`}),listOpsLog:w(Hs,b(Vs).readonly(),{kind:`query`,auth:`admin`}),renderGif:w(u({deviceId:i(),aroundMs:i(),preRollSec:i().min(0).max(30).default(2),postRollSec:i().min(0).max(30).default(5),maxWidth:i().int().min(120).max(1280).default(480),fps:i().int().min(1).max(15).default(5)}),u({gifBase64:c(),fromMs:i(),toMs:i()}),{kind:`mutation`,auth:`admin`}),renderClip:w(u({deviceId:i(),aroundMs:i(),preRollSec:i().min(0).max(30).default(3),postRollSec:i().min(0).max(30).default(7),maxWidth:i().int().min(160).max(1920).default(640)}),u({clipBase64:c(),mime:c(),fromMs:i(),toMs:i(),bytes:i().int()}),{kind:`mutation`,auth:`admin`}),pauseForStorageMigration:w(I,u({paused:p(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:w(I,u({resumed:p(!0)}),{kind:`mutation`,auth:`admin`}),refreshStorageLocationsForMigration:w(I,u({refreshed:p(!0)}),{kind:`mutation`,auth:`admin`}),startStorageMigrationMove:w(Dc,u({jobId:c()}),{kind:`mutation`,auth:`admin`}),getStorageMigrationMoveStatus:w(u({jobId:c()}),wc.nullable(),{auth:`admin`}),cancelStorageMigrationMove:w(u({jobId:c()}),u({cancelled:x()}),{kind:`mutation`,auth:`admin`}),relocateFootage:w(Ec,u({jobId:c()}),{kind:`mutation`,auth:`admin`}),listRelocateJobs:w(u({}),b(wc).readonly(),{kind:`query`,auth:`admin`}),getRelocateResidue:w(Xc,Zc,{kind:`query`,auth:`admin`}),reconcileLedgerAgainstDisk:w(Qc,rl,{kind:`mutation`,auth:`admin`}),cancelRelocateJob:w(u({jobId:c()}),u({cancelled:x()}),{kind:`mutation`,auth:`admin`}),planStorageRebalance:w(QL,ZL,{kind:`query`,auth:`admin`}),startStorageRebalance:w(QL,ZL,{kind:`mutation`,auth:`admin`}),getPlacement:w(u({}),tR,{kind:`query`,auth:`admin`}),setDevicePlacement:w(nR,u({ok:p(!0)}),{kind:`mutation`,auth:`admin`})}},cR=i().min(.25).max(32),lR=u({fromSec:i().nonnegative(),toSec:i().nonnegative()}).refine(e=>e.toSec>e.fromSec,{message:`dense range must have toSec > fromSec`}),uR=200,dR=u({everyMs:i().int().positive(),ranges:b(lR).min(1).max(200)}),fR=u({everyMs:i().int().positive(),outputFps:i().int().min(1).max(60).optional(),dense:dR.optional()}).superRefine((e,t)=>{e.dense!==void 0&&e.dense.everyMs>=e.everyMs&&t.addIssue({code:ce.custom,message:`dense.everyMs must be strictly smaller than the base everyMs`,path:[`dense`,`everyMs`]})}),pR=u({speed:cR.optional(),timelapse:fR.optional(),includeAudio:x(),maxLifeMs:i().int().positive(),deleteAfterDownload:x(),title:c().max(200).optional(),notifyTargetIds:b(c().min(1)).max(20).optional()}).superRefine((e,t)=>{e.speed!==void 0&&e.timelapse!==void 0&&t.addIssue({code:ce.custom,message:`speed and timelapse are mutually exclusive`,path:[`timelapse`]})}),mR=y([`queued`,`rendering`,`ready`,`failed`,`expired`,`deleted`]),hR=u({kind:p(`footage`),deviceId:i(),profiles:b(c()).min(1),fromMs:i(),toMs:i()}),gR=u({kind:p(`clip`),deviceId:i(),provider:c().min(1),source:c().min(1),sourceLabel:c().min(1),clipId:c().min(1),catalogWindow:u({sinceMs:i(),untilMs:i()}),profile:y([`high`,`mid`,`low`]),wake:$A.optional()}),_R=f(`kind`,[hR,gR]),vR=u({id:c(),deviceId:i(),profile:c(),fromMs:i(),toMs:i(),subject:_R.optional(),options:pR,state:mR,progressPct:i().nullable(),fileBytes:i().nullable(),expiresAt:i(),deleteAfterDownload:x(),downloadedAt:i().nullable(),createdAt:i(),createdBy:c(),error:c().nullable()}),yR=y([`catalog-miss`,`catalog-unreachable`,`no-file-for-window`,`clip-in-progress`,`unsupported-option`,`sleeping`,`camera-refused`,`fetch-failed`,`too-large-to-transfer`,`wake-expired`]);function bR(e,t){return t.length>0?`${e}: ${t}`:e}function xR(e){if(e===null)return null;let t=e.split(`:`,1)[0]??``,n=yR.safeParse(t.trim());return n.success?n.data:null}var SR=u({url:c(),endpoints:b(c())}),CR=50*1024*1024,wR=u({base64:c(),contentType:c(),name:c(),bytes:i().int().nonnegative()});function TR(e){return e.profiles!==void 0&&e.profiles.length>0?[...e.profiles]:typeof e.profile==`string`&&e.profile.length>0?[e.profile]:[]}var ER=u({deviceId:i(),profile:c().optional(),profiles:b(c()).min(1).optional(),fromMs:i().optional(),toMs:i().optional(),subject:_R.optional(),options:pR}).superRefine((e,t)=>{if(e.subject?.kind===`clip`){e.subject.deviceId!==e.deviceId&&t.addIssue({code:ce.custom,message:`subject.deviceId (${e.subject.deviceId}) must equal deviceId (${e.deviceId}) — the top-level field is what per-device scope enforcement reads`,path:[`subject`,`deviceId`]}),(e.fromMs!==void 0||e.toMs!==void 0)&&t.addIssue({code:ce.custom,message:`a clip export asks for no time range: the camera chose the boundaries and they are read from the catalog row`,path:[`fromMs`]});return}e.subject?.kind===`footage`&&e.subject.deviceId!==e.deviceId&&t.addIssue({code:ce.custom,message:`subject.deviceId (${e.subject.deviceId}) must equal deviceId (${e.deviceId})`,path:[`subject`,`deviceId`]});let n=e.subject?.kind===`footage`?e.subject.fromMs:e.fromMs,r=e.subject?.kind===`footage`?e.subject.toMs:e.toMs;(typeof n!=`number`||typeof r!=`number`)&&t.addIssue({code:ce.custom,message:`a footage export needs fromMs and toMs`,path:[`fromMs`]}),(e.subject?.kind===`footage`?[...e.subject.profiles]:TR(e)).length<1&&t.addIssue({code:ce.custom,message:`pass profiles[] (min 1) or legacy profile`,path:[`profiles`]})});function DR(e){if(e.subject!==void 0)return e.subject;let t=TR(e);if(typeof e.fromMs!=`number`||typeof e.toMs!=`number`)throw Error(`recording-export: a footage export needs fromMs and toMs`);return{kind:`footage`,deviceId:e.deviceId,profiles:t,fromMs:e.fromMs,toMs:e.toMs}}function OR(e){return e.subject===void 0?{kind:`footage`,deviceId:e.deviceId,profiles:[e.profile],fromMs:e.fromMs,toMs:e.toMs}:e.subject}var kR={name:`recording-export`,scope:`system`,mode:`singleton`,methods:{createExport:w(ER,vR,{kind:`mutation`,auth:`protected`}),listExports:w(u({deviceId:i().optional()}),b(vR),{kind:`query`,auth:`protected`}),getExport:w(u({exportId:c()}),vR,{kind:`query`,auth:`protected`}),cancelExport:w(u({exportId:c()}),vR,{kind:`mutation`,auth:`protected`}),deleteExport:w(u({exportId:c()}),vR,{kind:`mutation`,auth:`protected`}),getDownloadUrl:w(u({exportId:c()}),SR,{kind:`query`,auth:`protected`}),readExportBytes:w(u({exportId:c()}),wR,{kind:`query`,auth:`protected`})}},AR=y([`continuous`,`motion`,`person`,`vehicle`,`animal`,`lineCrossing`,`intrusion`,`loitering`,`alarmInput`]),jR=u({trigger:AR,day:i().int().min(0).max(6),startMinute:i().int().min(0).max(1439),endMinute:i().int().min(1).max(1440)}),MR=u({id:c(),label:c().optional(),status:y([`ok`,`unformatted`,`error`,`offline`,`unknown`]),capacityMb:i().nullable(),freeMb:i().nullable(),writable:x().optional()}),NR=f(`kind`,[u({kind:p(`present`),volumes:b(MR)}),u({kind:p(`absent`),reason:c()}),u({kind:p(`unknown`),reason:c()})]),PR=u({id:c(),enabled:x(),isVideo:x(),codec:c().nullable(),resolution:c().nullable(),overwriteWhenFull:x().nullable()}),FR=u({storage:NR,tracks:b(PR),primaryTrackId:c().nullable(),enabled:x().nullable(),overwriteWhenFull:x().nullable(),preRecordSec:i().nullable(),postRecordSec:i().nullable(),segmentMinutes:i().nullable(),windows:b(jR),unreadableWindows:i(),recordingToNowhere:x(),lastFetchedAt:i()}),IR=u({min:i(),max:i(),step:i()}),LR=u({values:b(i()).min(1),sentinel:u({value:i(),meaning:y([`no-limit`,`disabled`])}).optional()}),RR=u({readable:x(),writable:x(),reason:c().optional()}),zR=u({support:RR,granularityMinutes:i(),triggers:b(AR),supportsOverlappingTriggers:x()}),BR=u({enabled:RR,overwriteWhenFull:RR,preRecordSec:RR,preRecordSecRange:IR.optional(),preRecordSecAllowed:LR.optional(),postRecordSec:RR,postRecordSecRange:IR.optional(),postRecordSecAllowed:LR.optional(),segmentMinutes:RR,segmentMinutesRange:IR.optional(),segmentMinutesAllowed:LR.optional(),schedule:zR}),VR=u({enabled:x().optional(),overwriteWhenFull:x().optional(),preRecordSec:i().optional(),postRecordSec:i().optional(),segmentMinutes:i().optional(),windows:b(jR).optional()}),HR={name:`recording-onboard`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`recording-onboard`,tab:`recording`}},methods:{getOptions:w(u({deviceId:i()}),BR),setSettings:w(u({deviceId:i(),settings:VR}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:FR,kind:`poll`},runtimeState:FR,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},UR=1440,WR=7,GR=24,KR=168,qR=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`];function JR(e,t){if(t.enabled!==void 0&&!e.enabled.writable)return YR(`the master recording switch`,e.enabled.reason);if(t.overwriteWhenFull!==void 0&&!e.overwriteWhenFull.writable)return YR(`overwrite-when-full`,e.overwriteWhenFull.reason);let n=XR(`pre-record seconds`,t.preRecordSec,e.preRecordSec,e.preRecordSecRange,e.preRecordSecAllowed);if(n)return n;let r=XR(`post-record seconds`,t.postRecordSec,e.postRecordSec,e.postRecordSecRange,e.postRecordSecAllowed);if(r)return r;let i=XR(`segment length (minutes)`,t.segmentMinutes,e.segmentMinutes,e.segmentMinutesRange,e.segmentMinutesAllowed);if(i)return i;if(t.windows!==void 0){let n=ZR(e,t.windows);if(n)return n}return null}function YR(e,t){return t?`this camera cannot change ${e}: ${t}`:`this camera cannot change ${e}`}function XR(e,t,n,r,i){if(t===void 0)return null;if(!n.writable)return YR(e,n.reason);if(!Number.isFinite(t))return`${e} must be a number, got ${String(t)}`;if(i){if(i.values.includes(t))return null;let n=e=>i.sentinel!==void 0&&e===i.sentinel.value?i.sentinel.meaning===`no-limit`?`no limit`:`off`:String(e);return`this camera accepts ${e} only as ${i.values.map(n).join(`, `)}; ${n(t)} is not one of them`}return r?t<r.min||t>r.max?`this camera accepts ${e} between ${String(r.min)} and ${String(r.max)}; ${String(t)} is outside that`:r.step>0&&(t-r.min)%r.step!==0?`this camera accepts ${e} in steps of ${String(r.step)} from ${String(r.min)}; ${String(t)} is not one of them`:null:null}function ZR(e,t){let n=e.schedule;if(!n.support.writable)return YR(`the recording schedule`,n.support.reason);let r=new Set(n.triggers);for(let e of t){if(!r.has(e.trigger)){let t=n.triggers.length>0?n.triggers.join(`, `):`none`;return`this camera cannot record on "${e.trigger}"; it records on: ${t}`}if(e.endMinute<=e.startMinute)return`a window on ${$R(e.day)} ends at or before it starts (${String(e.startMinute)} → ${String(e.endMinute)})`;let t=n.granularityMinutes;if(t>1&&(e.startMinute%t!==0||e.endMinute%t!==0))return`this camera's schedule only moves in ${String(t)}-minute steps; the ${$R(e.day)} window ${ez(e.startMinute)}–${ez(e.endMinute)} is not aligned to them`}if(!n.supportsOverlappingTriggers){let e=QR(t);if(e)return`this camera stores one trigger per time range, so "${e.a.trigger}" and "${e.b.trigger}" cannot both cover ${$R(e.a.day)} ${ez(Math.max(e.a.startMinute,e.b.startMinute))}–${ez(Math.min(e.a.endMinute,e.b.endMinute))}`}return null}function QR(e){for(let t=0;t<e.length;t+=1)for(let n=t+1;n<e.length;n+=1){let r=e[t],i=e[n];if(!(!r||!i)&&r.day===i.day&&r.trigger!==i.trigger&&r.startMinute<i.endMinute&&i.startMinute<r.endMinute)return{a:r,b:i}}return null}function $R(e){return qR[e]??`day ${String(e)}`}function ez(e){let t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`}function tz(e,t){return e*24+t}function nz(e){if(e.length===0)return!0;let t=e[0];for(let n of e)if(n!==t)return!1;return!0}function rz(e,t){if(e.length!==168)return[];let n=[];for(let r=0;r<7;r+=1){let i=null;for(let a=0;a<=24;a+=1){let o=a<24&&e[tz(r,a)]===`1`;o&&i===null?i=a:!o&&i!==null&&(n.push({trigger:t,day:r,startMinute:i*60,endMinute:a*60}),i=null)}}return n}function iz(e,t){let n=Array(168).fill(`0`);for(let r of e){if(r.trigger!==t||r.day<0||r.day>=7)continue;let e=Math.floor(r.startMinute/60),i=Math.ceil(r.endMinute/60);for(let t=e;t<i&&t<24;t+=1)n[tz(r.day,t)]=`1`}return n.join(``)}function az(e){let t=/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/.exec(e.trim());if(!t)return null;let n=Number(t[1]),r=Number(t[2]);if(!Number.isInteger(n)||!Number.isInteger(r)||r>59)return null;let i=n*60+r;return i>1440?null:i}function oz(e){if(e>=1440)return`24:00`;let t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}:00`}function sz(e){let t=e.trim().toLowerCase(),n=qR.findIndex(e=>e.toLowerCase()===t);return n>=0?n:null}function cz(e,t){let n=[];for(let[r,i]of Object.entries(e)){if(i===void 0||typeof i!=`number`&&typeof i!=`boolean`&&typeof i!=`string`)continue;let e=t===null?void 0:t[r],a=typeof e==`number`||typeof e==`boolean`||typeof e==`string`?e:null;a!==i&&n.push({field:r,asked:i,stored:a})}return n}var lz=u({active:x(),reason:c(),lastChangedAt:i()}),uz=lz.extend({lastFetchedAt:i()}),dz={name:`recording-signal`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],methods:{getStatus:w(u({deviceId:i()}),lz)},status:{schema:lz,kind:`push`,empty:{active:!1,reason:`unknown`,lastChangedAt:0}},runtimeState:uz,durability:`session`},fz=[{capName:`recording`,sourceId:`camstack`,addonId:`recorder`}];function pz(e,t){for(let n of fz)if(n.capName===e&&n.sourceId===t)return n.addonId;return null}var mz=c(),hz=[`day`,`ir`,`night`,`dawn`,`dusk`],gz=y([`skip`,`judge-anyway`]),_z=`__diverged__`,vz=y([`matched`,`diverged`,`unknown`]),yz=y([`no-reference-for-condition`,`view-shifted`,`no-vision-profile`,`encoder-model-changed`,`no-snapshot`]),bz=u({embedding:b(i()),modelId:c(),condition:mz,capturedAt:i(),thumbnailMediaId:i().int().optional(),anchorEmbedding:b(i()).optional()}),xz=u({id:c(),label:c(),references:b(bz),textPrompts:b(c()).optional(),referenceCount:i(),currentlyMatched:x()}),Sz=f(`mode`,[u({mode:p(`similarity`),threshold:i().min(0).max(1),hysteresisCount:i().int().positive()}),u({mode:p(`llm`),prompt:c(),profileId:c().optional(),hysteresisCount:i().int().positive()})]),Cz=60,wz=120,Tz=60,Ez=.85,Dz=`skip`,Oz=8e3,kz=448,Az=!0,jz=u({enabled:x().default(!1),prompt:c().min(1).max(1e3),profileId:c().optional(),timeoutMs:i().int().min(1e3).max(2e4).default(Oz),maxImagePx:i().int().min(64).max(2048).default(448),onTimeout:y([`flip`,`hold`]).default(`hold`)}),Mz=u({id:c(),label:c(),roi:qx,enabled:x(),triggerMode:y([`periodic`,`on-motion`,`both`]),checkIntervalSec:i().optional(),check:Sz,states:b(xz),currentStateId:c().nullable(),lastCheckedAt:i().nullable(),lastConfidence:i().nullable(),currentCondition:mz.nullable(),availability:y([`ok`,`unavailable`]),unavailableReason:c().nullable(),baselineStateId:c().nullable(),emit:y([`latched`,`live`]).default(`latched`),verdict:vz,latched:x(),armedAt:i(),divergedAt:i().nullable(),restoredAt:i().nullable(),quietSeconds:i().int().min(0).max(3600).default(60),minObservationSpacingSec:i().int().min(0).max(3600).default(120),confirm:jz.optional(),anchorThreshold:i().min(0).max(1).default(Ez),autoRestore:x().default(!1),onUncoveredCondition:gz.default(Dz),suspendedCondition:mz.nullable().default(null),unavailable:yz.nullable(),coveredConditions:b(mz)}),Nz=u({monitors:b(Mz),lastFetchedAt:i()}),Pz=u({deviceId:i(),status:Nz.nullable()}),Fz={name:`scene-monitor`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[E.Camera],methods:{listScenes:w(u({deviceId:i()}),Nz),listScenesBatch:w(u({deviceIds:b(i()).min(1).max(200)}),b(Pz).readonly()),createScene:w(u({deviceId:i(),label:c(),roi:qx,check:Sz,triggerMode:y([`periodic`,`on-motion`,`both`]).optional(),checkIntervalSec:i().optional()}),Mz,{kind:`mutation`,auth:`admin`}),updateScene:w(u({deviceId:i(),monitorId:c(),patch:u({label:c().optional(),roi:qx.optional(),enabled:x().optional(),triggerMode:y([`periodic`,`on-motion`,`both`]).optional(),checkIntervalSec:i().optional(),check:Sz.optional(),emit:y([`latched`,`live`]).optional(),quietSeconds:i().int().min(0).max(3600).optional(),minObservationSpacingSec:i().int().min(0).max(3600).optional(),anchorThreshold:i().min(0).max(1).optional(),autoRestore:x().optional(),onUncoveredCondition:gz.optional(),confirm:jz.nullable().optional()})}),g(),{kind:`mutation`,auth:`admin`}),deleteScene:w(u({deviceId:i(),monitorId:c()}),g(),{kind:`mutation`,auth:`admin`}),captureReference:w(u({deviceId:i(),monitorId:c(),stateId:c().optional(),label:c().optional(),condition:mz.optional()}),u({stateId:c(),referenceCount:i()}),{kind:`mutation`,auth:`admin`}),deleteReference:w(u({deviceId:i(),monitorId:c(),stateId:c(),index:i()}),g(),{kind:`mutation`,auth:`admin`}),recheckNow:w(u({deviceId:i(),monitorId:c()}),g(),{kind:`mutation`,auth:`admin`}),resetScene:w(u({deviceId:i(),monitorId:c(),recapture:x().optional()}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:Nz,kind:`push`},runtimeState:Nz,durability:`session`},Iz=y([`include`,`exclude`]),Lz=u({id:c(),name:c().optional(),zoneIds:b(c()).min(1).readonly(),mode:Iz,classFilter:b(c()).readonly().optional(),overlapThreshold:i().min(0).max(1).optional(),bboxInclusionPct:i().min(0).max(100).optional(),preferMask:x().optional(),enabled:x().default(!0)}),Rz=b(Lz).readonly(),zz=u({isRunning:x(),lastRunAt:i(),lastRunSuccess:x().nullable(),lastError:c().nullable(),lastChangedAt:i()}),Bz={name:`script-runner`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Script],methods:{run:w(u({deviceId:i().int().nonnegative(),variables:_(c(),o()).optional()}),g(),{kind:`mutation`,auth:`admin`}),stop:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:zz,kind:`push`},runtimeState:zz,durability:`session`},Vz=u({detected:x(),lastChangedAt:i()}),Hz={name:`smoke`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:Vz,kind:`push`},runtimeState:Vz,durability:`restored`,volatileStateFields:[`lastChangedAt`]},Uz=u({camStreamId:c().min(1),kind:st,url:c().optional(),codec:c().optional(),resolution:ct.optional(),fps:i().positive().optional(),label:c().optional(),deviceFeatures:b(c()).optional(),autoEligible:x().optional(),profileHint:S.optional(),metadata:_(c(),o()).optional()}),Wz=u({descriptors:b(Uz),lastFetchedAt:i()}),Gz={name:`stream-catalog`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],methods:{getCatalog:w(u({deviceId:i().int().nonnegative()}),b(Uz).readonly())},runtimeState:Wz,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},Kz=y([`main`,`sub`,`ext`]),qz=u({width:i(),height:i(),codec:y([`h264`,`h265`]),framerate:i(),bitrate:i(),bitrateMode:y([`vbr`,`cbr`]).optional(),encoderProfile:y([`high`,`main`,`baseline`]).optional(),gop:i().optional(),audio:x().optional()}),Jz=u({main:qz.optional(),sub:qz.optional(),ext:qz.optional(),lastFetchedAt:i()}),Yz=u({resolutions:b(u({width:i(),height:i()})),codecs:b(y([`h264`,`h265`])),framerates:b(i()),bitrates:b(i()),bitrateRange:l([i(),i()]).optional(),supportsBitrateMode:x(),supportsEncoderProfile:x(),supportsGop:x(),gop:u({min:i(),max:i(),step:i()}).optional()}),Xz=u({main:Yz.optional(),sub:Yz.optional(),ext:Yz.optional()}),Zz=u({width:i().optional(),height:i().optional(),codec:y([`h264`,`h265`]).optional(),framerate:i().optional(),bitrate:i().optional(),bitrateMode:y([`vbr`,`cbr`]).optional(),encoderProfile:y([`high`,`main`,`baseline`]).optional(),gop:i().optional()}),Qz={name:`stream-params`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`stream-params`,tab:`streaming`}},methods:{getOptions:w(u({deviceId:i()}),Xz),setProfile:w(u({deviceId:i(),profile:Kz,patch:Zz}),g(),{kind:`mutation`,auth:`admin`}),getConfigSchema:w(u({deviceId:i()}),o().nullable())},status:{schema:Jz,kind:`poll`},runtimeState:Jz,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},$z=[{profile:`main`,prefix:`streamMain`,label:`Main stream`},{profile:`sub`,prefix:`streamSub`,label:`Sub stream`},{profile:`ext`,prefix:`streamExt`,label:`Third stream`}];function eB(e,t,n){let r=[];if(t.resolutions.length>0){let i=t.resolutions.map(e=>({value:`${String(e.width)}x${String(e.height)}`,label:`${String(e.width)}×${String(e.height)}`})),a=n?`${String(n.width)}x${String(n.height)}`:void 0;a&&!i.some(e=>e.value===a)&&i.unshift({value:a,label:`${a.replace(`x`,`×`)} (current)`}),r.push({type:`select`,key:`${e.prefix}_resolution`,label:`Resolution`,options:i,default:a??i[0]?.value??``})}if(t.codecs.length>0&&r.push({type:`select`,key:`${e.prefix}_codec`,label:`Codec`,options:t.codecs.map(e=>({value:e,label:e===`h264`?`H.264`:`H.265`})),default:n?.codec??t.codecs[0]}),t.framerates.length>0){let i=t.framerates.map(e=>({value:String(e),label:`${String(e)} fps`})),a=n?.framerate;a!==void 0&&!t.framerates.includes(a)&&i.unshift({value:String(a),label:`${String(a)} fps (current)`}),r.push({type:`select`,key:`${e.prefix}_framerate`,label:`Frame rate`,options:i,default:a===void 0?i[0]?.value??``:String(a)})}if(t.bitrates.length>0){let i=t.bitrates.map(e=>({value:String(e),label:`${String(e)} kbps`})),a=n?.bitrate;a!==void 0&&!t.bitrates.includes(a)&&i.unshift({value:String(a),label:`${String(a)} kbps (current)`}),r.push({type:`select`,key:`${e.prefix}_bitrate`,label:`Bitrate`,options:i,default:a===void 0?i[0]?.value??``:String(a)})}else{let i=t.bitrateRange;r.push({type:`number`,key:`${e.prefix}_bitrate`,label:`Bitrate`,unit:`kbps`,...i?{min:i[0],max:i[1]}:{},default:n?.bitrate??i?.[0]??0})}if(t.supportsBitrateMode&&r.push({type:`select`,key:`${e.prefix}_bitrateMode`,label:`Bitrate mode`,options:[{value:`vbr`,label:`VBR (variable)`},{value:`cbr`,label:`CBR (constant)`}],default:n?.bitrateMode??`vbr`}),t.supportsEncoderProfile&&r.push({type:`select`,key:`${e.prefix}_encoderProfile`,label:`Encoder profile`,options:[{value:`baseline`,label:`Baseline`},{value:`main`,label:`Main`},{value:`high`,label:`High`}],default:n?.encoderProfile??`main`}),t.supportsGop){let i=t.gop;if(i){let t=[];for(let e=i.min;e<=i.max;e+=i.step)t.push({value:String(e),label:`${String(e)} s`});let a=n?.gop;a!==void 0&&!t.some(e=>e.value===String(a))&&t.unshift({value:String(a),label:`${String(a)} s (current)`}),r.push({type:`select`,key:`${e.prefix}_gop`,label:`I-frame interval (GOP)`,options:t,default:a===void 0?t[0]?.value??``:String(a)})}else r.push({type:`number`,key:`${e.prefix}_gop`,label:`I-frame interval (GOP)`,unit:`s`,min:1,default:n?.gop??1})}return r.length===0?null:{id:`stream-${e.profile}`,tab:`streaming`,title:e.label,description:`Encoder parameters pushed to the camera. Option lists are read live from the camera — fields the firmware doesn't expose are hidden.`,columns:2,fields:r}}function tB(e,t){let n=[];for(let r of $z){let i=e[r.profile];if(!i)continue;let a=eB(r,i,t?.[r.profile]);a&&n.push(a)}return n.length===0?null:{sections:n}}function nB(e,t){let n={},r=!1,i=`${t}_resolution`;if(i in e&&typeof e[i]==`string`){let[t,a]=e[i].split(`x`).map(Number);Number.isFinite(t)&&Number.isFinite(a)&&(n.width=t,n.height=a,r=!0)}let a=`${t}_codec`;a in e&&(e[a]===`h264`||e[a]===`h265`)&&(n.codec=e[a],r=!0);let o=`${t}_framerate`;if(o in e){let t=Number(e[o]);Number.isFinite(t)&&(n.framerate=t,r=!0)}let s=`${t}_bitrate`;if(s in e){let t=Number(e[s]);Number.isFinite(t)&&(n.bitrate=t,r=!0)}let c=`${t}_bitrateMode`;c in e&&(e[c]===`vbr`||e[c]===`cbr`)&&(n.bitrateMode=e[c],r=!0);let l=`${t}_encoderProfile`;l in e&&(e[l]===`high`||e[l]===`main`||e[l]===`baseline`)&&(n.encoderProfile=e[l],r=!0);let u=`${t}_gop`;if(u in e){let t=Number(e[u]);Number.isFinite(t)&&(n.gop=t,r=!0)}return r?n:null}var rB=u({on:x(),lastChangedAt:i()}),iB={name:`switch`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Switch,E.Siren,E.Light],methods:{setState:w(u({deviceId:i(),on:x()}),g(),{kind:`mutation`,auth:`protected`})},events:{onStateChanged:{data:u({deviceId:i(),on:x(),lastChangedAt:i()})}},status:{schema:rB,kind:`command-driven`},runtimeState:rB,durability:`restored`,volatileStateFields:[`lastChangedAt`],settings:{bindings:[{kind:`scalar`,statusPath:`on`,method:`setState`,valueArg:`on`,field:{label:`On`,kind:`boolean`}}]}},aB=u({streaming:x(),notifications:x(),objectDetection:x(),remoteAccess:x(),agentCluster:x(),smartHome:x(),recordings:x(),backup:x(),repl:x()}),oB=u({status:p(`ok`),uptime:i()}),sB=u({name:c(),address:c(),family:c(),internal:x()}),cB=y([`operator-set`,`derived-from-ip`]),lB=u({latitude:i().min(-90).max(90),longitude:i().min(-180).max(180),source:cB,updatedAt:i(),label:c().optional()}),uB=u({location:lB.nullable(),derivationAttemptedAt:i().nullable(),derivationError:c().nullable()}),dB=u({latitude:i().min(-90).max(90),longitude:i().min(-180).max(180)}).nullable(),fB=y([`http`,`ws`,`mesh`,`unknown`]),pB=u({http:i(),ws:i(),mesh:i(),unknown:i()}),mB=u({plane:fB,procedure:c(),userAgent:c(),ip:c(),principal:c(),calls:i(),subscriptions:i(),perMin:i()}),hB=u({procedure:c(),calls:i(),planes:pB,subscriptions:i(),perMin:i()}),gB=u({armed:x(),elapsedMs:i(),windowMs:i(),armedUntilMs:i(),httpRequests:i(),batchedRequests:i(),procedureCalls:i(),planes:pB,planesExplainTotal:x(),wsConnections:i(),wsMessages:i(),subscriptions:i(),subscriptionStops:i(),distinctGroups:i(),unattributedCalls:i(),procedures:b(hB).readonly(),groups:b(mB).readonly()}),_B=gB.extend({persisted:x()}),vB=y([`debug`,`info`,`warn`,`error`]),yB=y([`request-census`]),bB=y([`cluster`,`node`,`component`]),xB=y([`default`,`cluster`,`node`,`component`]),SB=u({scope:bB,nodeId:c().nullable(),component:c().nullable(),level:vB.nullable()}),CB=u({level:vB,levelSource:xB}),wB=u({layers:b(SB).readonly()}),TB=u({id:yB,armed:x(),armedUntilMs:i(),remainingMs:i(),persisted:x()}),EB=u({id:yB,armMs:i().int().min(0),reportEveryMs:i().int().positive().optional()}),DB=u({channel:c(),armed:x(),armedUntilMs:i(),remainingMs:i(),deviceIds:b(i().int()).readonly().nullable()}),OB=u({channel:c().min(1),armMs:i().int().min(0),deviceIds:b(i().int()).readonly().nullable().optional()}),kB=u({level:vB.nullable().optional(),diagnostics:b(EB).readonly().optional(),channels:b(OB).readonly().optional(),opsLogRetentionDays:i().int().min(0).max(3650).optional()}),AB=$y.extend({addonId:c()}),jB=cy.extend({addonId:c()}),MB=u({scopeNodeId:c().optional(),scopeComponent:c().optional()}),NB=u({scopeNodeId:c().optional(),scopeComponent:c().optional(),patch:kB}),PB=u({scopeNodeId:c().nullable(),scopeComponent:c().nullable(),effective:CB,explicit:wB,activeWindows:b(TB).readonly(),channels:b(Ul).readonly(),activeChannels:b(DB).readonly(),opsLogRetentionDays:i().int().min(0),persisted:x()}),FB={name:`system`,scope:`system`,mode:`singleton`,methods:{info:w(g(),aB),health:w(g(),oB),featureFlags:w(g(),aB),networkAddresses:w(g(),b(sB).readonly()),getRetentionConfig:w(g(),o().nullable(),{auth:`admin`}),setRetentionConfig:w(_(c(),o()),ie(),{kind:`mutation`,auth:`admin`}),forceRetentionCleanup:w(g(),g(),{kind:`mutation`,auth:`admin`}),getSiteLocation:w(g(),uB),setSiteLocation:w(dB,uB,{kind:`mutation`,auth:`admin`}),detectSiteLocation:w(g(),uB,{kind:`mutation`,auth:`admin`}),getRequestCensus:w(g(),_B,{auth:`admin`}),getLoadContributions:w(g(),b(AB).readonly(),{auth:`admin`}),getFailureContributions:w(g(),b(jB).readonly(),{auth:`admin`}),getLoggingSettings:w(MB,PB,{auth:`admin`}),setLoggingSettings:w(NB,PB,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},IB=u({tampered:x(),lastChangedAt:i()}),LB={name:`tamper`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:IB,kind:`push`},runtimeState:IB,durability:`restored`,volatileStateFields:[`lastChangedAt`]},RB=u({celsius:i(),lastFetchedAt:i(),unit:c().optional(),precision:i().int().min(0).max(10).optional()}),zB={name:`temperature-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor,E.Thermostat],methods:{},status:{schema:RB,kind:`push`},runtimeState:RB,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},BB=u({title:c(),message:c(),severity:y([`info`,`warning`,`critical`]),duration:i().optional(),action:u({label:c(),url:c()}).optional()}),VB={name:`toast`,scope:`system`,mode:`singleton`,methods:{onToast:w(g(),BB,{kind:`subscription`})},mount:{kind:`server-provided`}},HB=u({currentVersion:c().nullable(),availableVersion:c().nullable(),updatable:x(),state:c().nullable(),inProgress:x()}),UB={name:`update`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Update],methods:{installUpdate:w(g(),g(),{kind:`mutation`,auth:`admin`})},status:{schema:HB,kind:`poll`},runtimeState:HB,durability:`session`},WB=u({id:c(),username:c(),isAdmin:x().default(!1),allowedProviders:d([b(c()),p(`*`)]),allowedDevices:_(c(),d([b(c()),p(`*`)])),scopes:b(J).default([]),totpEnabled:x().default(!1),createdAt:i(),updatedAt:i()}),GB=u({username:c(),password:c().min(6),isAdmin:x().default(!1),allowedProviders:d([b(c()),p(`*`)]).optional(),allowedDevices:_(c(),d([b(c()),p(`*`)])).optional(),scopes:b(J).optional()}),KB=u({id:c(),isAdmin:x().optional(),allowedProviders:d([b(c()),p(`*`)]).optional(),allowedDevices:_(c(),d([b(c()),p(`*`)])).optional(),scopes:b(J).optional()}),qB=u({id:c(),label:c(),isAdmin:x().default(!1),allowedProviders:d([b(c()),p(`*`)]).optional(),allowedDevices:_(c(),d([b(c()),p(`*`)])).optional(),tokenPrefix:c(),createdAt:i(),lastUsedAt:i().optional()}),JB=u({label:c(),isAdmin:x().default(!1),allowedProviders:d([b(c()),p(`*`)]).optional(),allowedDevices:_(c(),d([b(c()),p(`*`)])).optional()}),YB=u({token:c(),record:qB}),XB=u({id:c(),userId:c(),name:c(),tokenPrefix:c(),scopes:b(J),expiresAt:i().nullish(),lastUsedAt:i().nullish(),createdAt:i()}),ZB=u({userId:c(),name:c(),scopes:b(J),expiresAt:i().optional()}),QB=u({token:c(),record:XB}),$B=u({id:c(),userId:c(),username:c(),integrationId:c(),scopes:b(J),createdAt:i(),lastUsedAt:i(),revokedAt:i().nullable()}),eV=u({secret:c(),otpauthUrl:c()}),tV=u({enabled:x(),confirmedAt:i().nullable()}),nV={name:`user-management`,scope:`system`,mode:`singleton`,methods:{listUsers:w(g(),b(WB),{auth:`admin`}),createUser:w(GB,WB,{kind:`mutation`,auth:`admin`,access:`create`}),updateUser:w(KB,u({success:p(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),deleteUser:w(u({id:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),resetPassword:w(u({id:c(),newPassword:c().min(6)}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),setUserScopes:w(u({userId:c(),scopes:b(J)}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),validateCredentials:w(u({username:c(),password:c()}),WB.extend({passwordHash:c()}).nullable(),{kind:`mutation`,access:`view`}),listApiKeys:w(g(),b(qB),{auth:`admin`}),createApiKey:w(JB,YB,{kind:`mutation`,auth:`admin`,access:`create`}),revokeApiKey:w(u({id:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateApiKey:w(u({token:c()}),qB.nullable(),{kind:`mutation`,access:`view`}),createScopedToken:w(ZB,QB,{kind:`mutation`,auth:`admin`,access:`create`}),revokeScopedToken:w(u({id:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateScopedToken:w(u({token:c()}),XB.nullable(),{access:`view`}),listScopedTokens:w(u({userId:c()}),b(XB),{auth:`admin`}),setupTotp:w(u({userId:c()}),eV,{kind:`mutation`,auth:`admin`,access:`create`}),confirmTotp:w(u({userId:c(),code:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),disableTotp:w(u({userId:c()}),u({success:p(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getTotpStatus:w(u({userId:c()}),tV,{auth:`admin`}),verifyTotp:w(u({userId:c(),code:c()}),u({valid:x()}),{kind:`mutation`,access:`view`}),oauthIssueCode:w(u({integrationId:c(),userId:c(),username:c(),scopes:b(J),redirectUri:c(),hubUrl:c(),codeChallenge:c().optional(),refreshTtlSec:d([i().int().positive(),p(`never`)]).optional()}),u({code:c()}),{kind:`mutation`,access:`create`}),oauthExchangeCode:w(u({code:c(),redirectUri:c(),codeVerifier:c().optional()}),u({accessToken:c(),refreshToken:c(),expiresIn:i()}).nullable(),{kind:`mutation`,access:`view`}),oauthRefresh:w(u({refreshToken:c()}),u({accessToken:c(),refreshToken:c(),expiresIn:i()}).nullable(),{kind:`mutation`,access:`view`}),oauthVerifyAccessToken:w(u({token:c()}),u({userId:c(),username:c(),scopes:b(J)}).nullable(),{access:`view`}),listOauthSessions:w(g(),b($B),{auth:`admin`}),revokeOauthSession:w(u({id:c()}),u({success:x()}),{kind:`mutation`,auth:`admin`,access:`delete`})}},rV=y([`idle`,`cleaning`,`paused`,`returning`,`docked`,`drying`,`error`]),iV=u({level:i().min(0).max(100).nullable(),status:y([`ok`,`low`,`full`]).nullable()}),aV=u({state:rV,batteryLevel:i().min(0).max(100).nullable(),fanSpeed:c().nullable(),availableFanSpeeds:b(c()),cleanWater:iV.nullable(),dirtyWater:iV.nullable(),detergent:iV.nullable(),dustBin:iV.nullable(),progressPercent:i().min(0).max(100).nullable(),errorCode:i().nullable(),errorLabel:c().nullable(),lastChangedAt:i()}),oV={name:`vacuum-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Vacuum],methods:{start:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),pause:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),stop:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),returnToBase:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),locate:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),setFanSpeed:w(u({deviceId:i().int().nonnegative(),speed:c().min(1)}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:aV,kind:`push`},runtimeState:aV,durability:`session`},sV=y([`open`,`opening`,`closing`,`closed`,`stopped`]),cV=u({state:sV,position:i().min(0).max(100).nullable(),lastChangedAt:i()}),lV={name:`valve`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Valve],methods:{open:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),close:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),stop:w(u({deviceId:i().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),setPosition:w(u({deviceId:i().int().nonnegative(),position:i().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:cV,kind:`push`},runtimeState:cV,durability:`session`},uV=u({detected:x(),lastChangedAt:i()}),dV={name:`vibration`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Sensor],methods:{},status:{schema:uV,kind:`push`},runtimeState:uV,durability:`restored`,volatileStateFields:[`lastChangedAt`]},fV=u({currentTemp:i().nullable(),targetTemp:i().nullable(),operationMode:c().nullable(),availableModes:b(c()),away:x().nullable(),minTemp:i().nullable(),maxTemp:i().nullable(),lastChangedAt:i()}),pV={name:`water-heater`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.WaterHeater],methods:{setTargetTemp:w(u({deviceId:i().int().nonnegative(),temp:i().finite()}),g(),{kind:`mutation`,auth:`protected`}),setOperationMode:w(u({deviceId:i().int().nonnegative(),mode:c().min(1)}),g(),{kind:`mutation`,auth:`protected`}),setAway:w(u({deviceId:i().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:fV,kind:`push`},runtimeState:fV,durability:`session`},mV=u({condition:c().nullable(),temperature:i().nullable(),temperatureUnit:c().nullable(),humidity:i().min(0).max(100).nullable(),pressure:i().nullable(),pressureUnit:c().nullable(),windSpeed:i().nullable(),windSpeedUnit:c().nullable(),windBearing:i().nullable(),lastFetchedAt:i()}),hV={name:`weather`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[E.Weather],methods:{},status:{schema:mV,kind:`push`},runtimeState:mV,durability:`session`},gV=u({totalObjects:i().int().nonnegative(),byClass:_(c(),i().int().nonnegative()),standingObjects:i().int().nonnegative().optional(),transientObjects:i().int().nonnegative().optional()}),_V=gV.extend({zoneId:c(),zoneName:c(),trackIds:b(c()).readonly()}),vV=u({id:c(),className:c(),bbox:u({x:i(),y:i(),w:i(),h:i()}),frameWidth:i().int().nonnegative(),frameHeight:i().int().nonnegative(),firstSeenAt:i().int(),becameStationaryAt:i().int(),lastConfirmedAt:i().int(),label:c().optional(),keyFrameMediaId:i().int().optional()}),yV=u({ts:i().int(),frameWidth:i().int().nonnegative(),frameHeight:i().int().nonnegative(),zones:b(_V).readonly(),frame:gV,unzoned:gV,stationaryObjects:b(vV).readonly().optional()}),bV=u({deviceId:i(),read:y([`read`,`unreadable`]),snapshot:yV.nullable()}),xV=y([`minute`,`5min`,`hour`]),SV=u({from:i().int(),to:i().int(),resolution:xV}),CV=u({ts:i().int(),count:i().int().nonnegative()}),wV={name:`zone-analytics`,scope:`device`,mode:`singleton`,deviceTypes:[E.Camera],methods:{getCurrentSnapshot:w(u({deviceId:i()}),yV.nullable()),getCurrentSnapshotBatch:w(u({deviceIds:b(i()).min(1).max(200)}),b(bV).readonly()),getZoneHistory:w(u({deviceId:i(),zoneId:c(),className:c().optional()}).extend(SV.shape),b(CV).readonly()),getCameraHistory:w(u({deviceId:i(),className:c().optional()}).extend(SV.shape),b(CV).readonly()),getUnzonedHistory:w(u({deviceId:i(),className:c().optional()}).extend(SV.shape),b(CV).readonly())},runtimeState:yV,durability:`session`},TV=y([`motion`,`detection`,`package`]),EV={name:`zone-rules`,scope:`device`,mode:`singleton`,deviceTypes:[E.Camera],methods:{listRules:w(u({deviceId:i(),stage:TV}),b(Lz).readonly()),setRules:w(u({deviceId:i(),stage:TV,rules:b(Lz).readonly()}),g(),{kind:`mutation`,auth:`admin`})},runtimeState:u({motion:b(Lz).readonly(),detection:b(Lz).readonly(),package:b(Lz).readonly()}),durability:`restored`},DV=[`decoder`,`motion-detection`,`pipeline-executor`,`audio-analyzer`,`pipeline-analytics`,`notification-output`],OV=[...DV,`pipeline-orchestrator`,`pipeline-runner`];function kV(e,t){return t.slot===e}function AV(e,t){return{slot:e,list:async e=>{let n=await t.list(e);if(n===null)return null;let r=n.value;return{...n,value:r}},set:async(n,r)=>{if(!kV(e,r))throw Error(`device-extension: a "${r.slot}" value was sent to slot "${e}" — refused`);return await t.set(n,r)},candidates:e=>t.candidates(e)}}function jV(e,t){return`${e}:${t}`}function MV(e){let{source:t,label:n,slots:r,hostTypeOf:i,logger:a}=e,o=(e,t)=>t!==null&&vv[e].hostDeviceTypes.some(e=>e===t),s=async(e,n)=>{let a=`${t}:`,s=n.startsWith(a)?r.find(e=>e.slot===n.slice(a.length)):void 0;if(s===void 0)throw Error(`device-extension: "${n}" is not a slot of "${t}" — it serves ${r.map(e=>jV(t,e.slot)).join(`, `)||`(none)`}`);let c=await i(e);if(!o(s.slot,c))throw Error(`device-extension: slot "${s.slot}" is not offered on device ${e} (type ${c??`unknown`}; offered on ${vv[s.slot].hostDeviceTypes.join(`, `)})`);return s};return{listSources:async()=>[{source:t,label:n,availability:{state:`ok`}}],listSlots:async e=>{let n=await i(e.deviceId),a=[];for(let i of r){if(!o(i.slot,n))continue;let r=await i.list(e.deviceId);r!==null&&a.push({state:`ok`,slotRef:jV(t,i.slot),slot:i.slot,authority:r.authority,activation:r.activation,value:r.value,sources:[...r.sources],...r.impliedSources===void 0?{}:{impliedSources:[...r.impliedSources]}})}return a},listCandidates:async e=>({candidates:[...await(await s(e.deviceId,e.slotRef)).candidates(e.deviceId)]}),setSlot:async e=>{let t=await(await s(e.deviceId,e.slotRef)).set(e.deviceId,e.value);return a.info(`device-extension: slot written`,{tags:{deviceId:e.deviceId},meta:{slotRef:e.slotRef,reload:t.reload}}),t}}}var NV={"°C":{dimension:`temperature`,factor:1,offset:0},"°F":{dimension:`temperature`,factor:5/9,offset:-160/9},K:{dimension:`temperature`,factor:1,offset:-273.15},hPa:{dimension:`pressure`,factor:1,offset:0},kPa:{dimension:`pressure`,factor:10,offset:0},Pa:{dimension:`pressure`,factor:.01,offset:0},mbar:{dimension:`pressure`,factor:1,offset:0},bar:{dimension:`pressure`,factor:1e3,offset:0},inHg:{dimension:`pressure`,factor:33.8639,offset:0},mmHg:{dimension:`pressure`,factor:1.33322,offset:0},psi:{dimension:`pressure`,factor:68.9476,offset:0},"m/s":{dimension:`speed`,factor:1,offset:0},"km/h":{dimension:`speed`,factor:1/3.6,offset:0},mph:{dimension:`speed`,factor:.44704,offset:0},kn:{dimension:`speed`,factor:.514444,offset:0},"mm/h":{dimension:`precipitation-rate`,factor:1,offset:0},"in/h":{dimension:`precipitation-rate`,factor:25.4,offset:0},m:{dimension:`length`,factor:1,offset:0},mm:{dimension:`length`,factor:.001,offset:0},cm:{dimension:`length`,factor:.01,offset:0},km:{dimension:`length`,factor:1e3,offset:0},in:{dimension:`length`,factor:.0254,offset:0},ft:{dimension:`length`,factor:.3048,offset:0},mi:{dimension:`length`,factor:1609.344,offset:0},lx:{dimension:`illuminance`,factor:1,offset:0},"W/m²":{dimension:`irradiance`,factor:1,offset:0},W:{dimension:`power`,factor:1,offset:0},kW:{dimension:`power`,factor:1e3,offset:0},VA:{dimension:`apparent-power`,factor:1,offset:0},Wh:{dimension:`energy`,factor:1,offset:0},kWh:{dimension:`energy`,factor:1e3,offset:0},MWh:{dimension:`energy`,factor:1e6,offset:0},V:{dimension:`voltage`,factor:1,offset:0},mV:{dimension:`voltage`,factor:.001,offset:0},A:{dimension:`current`,factor:1,offset:0},mA:{dimension:`current`,factor:.001,offset:0},ppm:{dimension:`concentration-volume`,factor:1,offset:0},ppb:{dimension:`concentration-volume`,factor:.001,offset:0},"µg/m³":{dimension:`concentration-mass`,factor:1,offset:0},"mg/m³":{dimension:`concentration-mass`,factor:1e3,offset:0},kg:{dimension:`mass`,factor:1,offset:0},g:{dimension:`mass`,factor:.001,offset:0},lb:{dimension:`mass`,factor:.453592,offset:0},oz:{dimension:`mass`,factor:.0283495,offset:0},"%":{dimension:`percentage`,factor:1,offset:0}},PV=class extends Error{from;to;reason;constructor(e,t,n){super(`[units] cannot convert '${e}' → '${t}': ${n}`),this.name=`UnitConversionError`,this.from=e,this.to=t,this.reason=n}};function FV(e){return Object.hasOwn(NV,e)?NV[e]:void 0}function IV(e){return FV(e)?.dimension}function LV(e,t){return e*t.factor+t.offset}function RV(e,t){return(e-t.offset)/t.factor}function zV(e,t,n){if(t===n)return e;let r=FV(t);if(!r)throw new PV(t,n,`unknown-from`);let i=FV(n);if(!i)throw new PV(t,n,`unknown-to`);if(r.dimension!==i.dimension)throw new PV(t,n,`cross-dimension`);return RV(LV(e,r),i)}function BV(e,t,n){if(t===n)return e;let r=FV(t);if(!r)return;let i=FV(n);if(i&&r.dimension===i.dimension)return RV(LV(e,r),i)}function VV(e,t){if(e===t)return!0;let n=IV(e);return n===void 0?!1:n===IV(t)}function HV(e){let t=[];for(let[n,r]of Object.entries(NV))r.dimension===e&&t.push(n);return t}function UV(e){return`${P(e.source)} ${e.cap}.${e.fieldPath}`}function WV(e){return e.fatal||e.confirmed===!0}function GV(e,t){return e.state===`unavailable`?{state:`unavailable`,value:null,reason:`${UV(t)}: ${e.reason}`,fatal:e.fatal,confirmed:WV(e)}:{state:e.state,value:e.value,reason:e.state===`stale`?`${UV(t)}: ${e.reason}`:null,deadline:null}}function KV(e,t,n,r){let i={},a=[],o=null,s=null;for(let[n,r]of Object.entries(e.bindings)){if(r.kind===`literal`){i[n]=r.value;continue}let e=t(r);if(e.state===`unavailable`){let t={state:`unavailable`,value:null,reason:`binding \`${n}\` (${UV(r)}): ${e.reason}`,fatal:e.fatal,confirmed:WV(e)};if(e.fatal){o=t;break}(s===null||t.confirmed&&!s.confirmed)&&(s=t);continue}i[n]=e.value,e.state===`stale`&&a.push(`\`${n}\`: ${e.reason}`)}let c=o??s;if(c!==null)return r!==void 0&&r.currentOutput!==void 0&&sh(e.expr,`count`)?{state:`stale`,value:Lr(null,{kind:`count`,highWater:null,primed:!1},r.currentOutput),reason:`${c.reason}; holding the last accumulator value`,deadline:null}:c;let l=[],u=ki(e.expr,i,n,{hooks:{noteDeadline:e=>l.push(e),convert:(e,t,n)=>BV(e,e_(t)??t,e_(n)??n)??null},...r===void 0?{}:{invokeStateful:e=>Ti(r.callPathPrefix===void 0?e:{...e,path:`${r.callPathPrefix}@${e.path}`},r.expressionMemory,{currentOutput:r.currentOutput,startedAtMs:r.startedAtMs,nowMs:n})}});return u.ok?{state:a.length>0?`stale`:`fresh`,value:u.value,reason:a.length>0?a.join(`; `):null,deadline:l.length>0?Math.min(...l):null}:{state:`unavailable`,value:null,reason:`the expression failed: ${u.error}`,fatal:!1,confirmed:!0}}function qV(e){let{source:t}=e;switch(t.kind){case`from`:return GV(e.read(t),t);case`expression`:return KV(t,e.read,e.now,e.stateful);case`code`:return{state:`unavailable`,value:null,reason:`code fields are not runnable in the composer — they arrive in slice 4`,fatal:!0,confirmed:!0}}}var JV=3e5,YV=[{addonId:`provider-homeassistant`,stableId:`sensor.living_room_temperature`},{addonId:`provider-homeassistant`,stableId:`sensor.sofa_temperature`},{addonId:`provider-homeassistant`,stableId:`sensor.window_temperature`}],XV=[{addonId:`provider-homeassistant`,stableId:`binary_sensor.living_room_motion`},{addonId:`provider-homeassistant`,stableId:`binary_sensor.living_room_presence`}];function ZV(e,t,n){return{kind:`from`,source:e,cap:t,fieldPath:n}}function QV(e,t,n,r){return Object.fromEntries(t.map((t,i)=>[`${e}${i+1}`,ZV(t,n,r)]))}function $V(e){let t=QV(`t`,e.temperatureSources,`temperature-sensor`,`celsius`),n=QV(`f`,e.temperatureSources,`temperature-sensor`,`lastFetchedAt`),r=QV(`d`,e.motionSources,`motion`,`detected`),i=QV(`m`,e.motionSources,`motion`,`lastDetectedAt`),a=Object.keys(i).map(t=>`within(${t}, ${e.occupancyWindowMs})`);return ra.parse({target:{kind:`new`,type:E.Sensor},features:[{kind:`fields`,cap:`temperature-sensor`,fields:{celsius:{kind:`expression`,expr:`round(avg(${Object.keys(t).join(`, `)}), 1)`,bindings:t},lastFetchedAt:{kind:`expression`,expr:`max(${Object.keys(n).join(`, `)})`,bindings:n}}},{kind:`fields`,cap:`binary`,fields:{on:{kind:`expression`,expr:`any(${[...Object.keys(r),...a].join(`, `)})`,bindings:{...r,...i}},lastChangedAt:{kind:`expression`,expr:`now`,bindings:{}}}}]})}var eH=`8dec3b512fda40cbb8cd121c7a99f890`,tH=`provider-homeassistant`;function nH(e){let t={addonId:tH,stableId:`ha:${e}:dev:${eH}`},n=e=>({addonId:tH,stableId:`${t.stableId}-${e}`});return{feeder:t,desiccantDays:n(`sensor.freshelement_3_desiccant_days_remaining`),batteryStatus:n(`sensor.freshelement_3_battery_status`),batteryCharging:n(`binary_sensor.freshelement_3_battery`)}}function rH(e){let t={d:ZV(e.desiccantDays,`enum-sensor`,`value`)};return ra.parse({target:{kind:`existing`,device:e.feeder},features:[{kind:`fields`,cap:`consumables`,fields:{lastChangedAt:{kind:`expression`,expr:`now`,bindings:{}},lastFetchedAt:{kind:`expression`,expr:`now`,bindings:{}}},items:{desiccant:{label:`Desiccant`,fields:{"remaining.value":{kind:`expression`,expr:`number(d)`,bindings:t},"remaining.unit":{kind:`expression`,expr:`"days"`,bindings:{}},status:{kind:`expression`,expr:`number(d) == null ? null : (number(d) <= 0 ? "replace" : "ok")`,bindings:t}}}}},{kind:`fields`,cap:`battery`,fields:{percentage:{kind:`expression`,expr:`s == "low" ? 15 : (s == "normal" ? 100 : null)`,bindings:{s:ZV(e.batteryStatus,`enum-sensor`,`value`)}},binary:{kind:`expression`,expr:`true`,bindings:{}},charging:{kind:`expression`,expr:`c ? "dc" : "unknown"`,bindings:{c:ZV(e.batteryCharging,`binary`,`on`)}},sleeping:{kind:`expression`,expr:`false`,bindings:{}},lastUpdated:{kind:`expression`,expr:`now`,bindings:{}}}}]})}var iH=2e3;function aH(e,t){return Object.keys(yr).filter(e=>Object.hasOwn(br,e)&&t.includes(e)).toSorted().flatMap(t=>{let n=yr[t],r=br[t];return n===void 0||r===void 0?[]:[{source:e,cap:t,activeField:n,changedAtField:r}]})}function oH(e){let t=[...e.sources].toSorted((e,t)=>`${e.source.addonId}/${e.source.stableId}#${e.cap}`.localeCompare(`${t.source.addonId}/${t.source.stableId}#${t.cap}`));if(t.length===0)throw Error(`doorbell composition needs at least one source`);let n={};return t.forEach((e,t)=>{n[`active${t}`]={kind:`from`,source:e.source,cap:e.cap,fieldPath:e.activeField},n[`changed${t}`]={kind:`from`,source:e.source,cap:e.cap,fieldPath:e.changedAtField}}),{kind:`fields`,cap:`doorbell`,enabled:e.enabled,fields:{lastPressedAt:{kind:`expression`,expr:`latest(${t.map((e,t)=>`rose(active${t}, changed${t}, ${iH})`).join(`, `)})`,bindings:n},pressCountSinceStart:{kind:`expression`,expr:`count(lastPressedAt)`,bindings:{lastPressedAt:{kind:`from`,source:{addonId:e.camera.addonId,stableId:e.camera.stableId},cap:`doorbell`,fieldPath:`lastPressedAt`}}}}}}var sH=[{cap:`alarm-panel`,field:`state`},{cap:`cover`,field:`state`},{cap:`presence`,field:`state`},{cap:`lock-control`,field:`state`},{cap:`contact`,field:`entryOpen`,booleanWords:[`open`,`closed`]},{cap:`switch`,field:`on`,booleanWords:[`on`,`off`]},{cap:`binary`,field:`on`,booleanWords:[`on`,`off`]}];function cH(e){for(let t of sH){let n=e[t.cap];if(typeof n!=`object`||!n)continue;let r=n[t.field];if(typeof r==`string`&&r.length>0)return r;if(typeof r==`boolean`&&t.booleanWords!==void 0)return r?t.booleanWords[0]:t.booleanWords[1]}}function lH(e,t=[]){for(let n of sH){let r=e[n.cap];if(typeof r!=`object`||!r)continue;if(n.booleanWords!==void 0)return[...n.booleanWords];if(n.cap===`alarm-panel`)return[...t];let i=r[n.field];return typeof i==`string`?[i]:[]}return[]}var uH=`camstack/camstack-models`,dH=`https://huggingface.co/${uH}/resolve/main`,fH=`30d`,pH={"features.streaming":!0,"features.notifications":!0,"features.objectDetection":!1,"features.remoteAccess":!0,"features.agentCluster":!1,"features.smartHome":!0,"features.recordings":!0,"features.backup":!0,"features.repl":!0,"retention.detectionEventsDays":30,"retention.audioLevelsDays":7,"logging.level":`info`,"logging.retentionDays":30,"eventBus.ringBufferSize":1e4,"storage.provider":`sqlite-storage`,"storage.locations":{data:`camstack-data/data`,media:`camstack-data/media`,recordings:`camstack-data/recordings`,cache:`/tmp/camstack-cache`,logs:`camstack-data/logs`,models:`camstack-data/models`},providers:[],"ffmpeg.hwAccel":`auto`,"ffmpeg.threadCount":0,"auth.tokenExpiry":`30d`},X={Siren:D.Siren,Floodlight:D.Floodlight,Spotlight:D.Spotlight,PirSensor:D.PirSensor,Chime:D.Chime,Autotrack:D.Autotrack,Nightvision:D.Nightvision,PrivacyMask:D.PrivacyMask},mH={[X.Siren]:`Siren`,[X.Floodlight]:`Floodlight`,[X.Spotlight]:`Spotlight`,[X.PirSensor]:`PIR`,[X.Chime]:`Chime`,[X.Autotrack]:`Autotracking`,[X.Nightvision]:`Night Vision`,[X.PrivacyMask]:`Privacy Mask`};function hH(e,t,n){let r=`${e}:${t}`;return typeof n==`number`?`${r}:${n}`:r}var gH=class e{schema;data;persistFn;constructor(e,t,n){this.schema=e,this.data=t,this.persistFn=n}static fromSchema(t,n,r={},i){let a=t.safeParse(r);if(a.success)return new e(t,a.data,n);let o=new Set;for(let e of a.error.issues){let t=e.path[0];typeof t==`string`&&o.add(t)}let s={...r};for(let e of o)delete s[e];let c=t.safeParse(s);return i?.({droppedKeys:[...o],issues:a.error.issues}),c.success?(n(c.data).catch(()=>{}),new e(t,c.data,n)):new e(t,t.parse({}),n)}get values(){return this.data}get(e){return this.data[e]}async set(e,t){let n=this.schema.parse({...this.data,[e]:t});this.data=n,await this.persistFn(this.data)}async setAll(e){let t=this.schema.parse({...this.data,...e});this.data=t,await this.persistFn(this.data)}async deleteKey(e){let{[e]:t,...n}=this.data,r=this.schema.parse(n);this.data=r,await this.persistFn(this.data)}entries(){let e=this.schema.shape;return Object.entries(e).map(([e,t])=>({key:e,schema:t,value:this.data[e],description:t.description}))}},_H=class e{writer;onWriteFailed;pendingWrites=new Set;failedWrites=new Set;slices;schemas=new Map;listeners=new Set;capListeners=new Map;constructor(e,t,n){this.writer=t,this.onWriteFailed=n,this.slices=new Map;for(let[t,n]of Object.entries(e))n&&typeof n==`object`&&!Array.isArray(n)&&this.slices.set(t,{...n})}static fromInitial(t,n,r){return new e(t,n,r)}installCapSchema(e,t){let n=this.schemas.get(e);if(n){if(n!==t)throw Error(`[DeviceRuntimeState] capability "${e}" registered a different runtime-state schema; each cap must declare ONE shape across every provider`);return}this.schemas.set(e,t);let r=this.slices.get(e);if(r){let n=t.safeParse(r);n.success?this.slices.set(e,n.data):this.slices.delete(e)}}getCapState(e){let t=this.slices.get(e);if(t)return Object.freeze({...t})}getCapField(e,t){return this.slices.get(e)?.[t]}setCapState(e,t){this.applyCapWrite(e,t,!1)}patchCapState(e,t){this.applyCapWrite(e,t,!0)}applyCapWrite(e,t,n){let r=this.schemas.get(e);if(!r)throw Error(`[DeviceRuntimeState] no schema registered for cap "${e}" — did the device register it via ctx.registerNativeCap before writing?`);let i=this.slices.get(e)??{},a=n?{...i,...t}:{...t},o=r.parse(a);if(vH(i,o)&&!this.failedWrites.has(e))return;this.slices.set(e,o),this.fireListeners([e]);let s=this.writer(e,{...o}).then(()=>{this.failedWrites.delete(e)}).catch(t=>{this.failedWrites.add(e),this.onWriteFailed?.(e,t instanceof Error?t.message:String(t))});this.pendingWrites.add(s),s.finally(()=>{this.pendingWrites.delete(s)})}fireListeners(e){let t=this.snapshot();for(let n of this.listeners)try{n(e,t)}catch{}for(let t of e){let e=this.capListeners.get(t);if(!e)continue;let n=this.getCapState(t);for(let t of e)try{t(n)}catch{}}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}subscribeCap(e,t){let n=this.capListeners.get(e);n||(n=new Set,this.capListeners.set(e,n));let r=e=>{t(e)};return n.add(r),()=>{let t=this.capListeners.get(e);t&&(t.delete(r),t.size===0&&this.capListeners.delete(e))}}snapshot(){let e={};for(let[t,n]of this.slices)e[t]=Object.freeze({...n});return Object.freeze(e)}async flush(){if(this.pendingWrites.size===0)return;let e=[...this.pendingWrites];await Promise.allSettled(e)}};function vH(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}var yH={airQualitySensor:oM,alarmPanel:Gx,ambientLightSensor:cM,audioMetrics:pM,automationControl:hM,battery:_M,binary:yM,brightness:xM,cameraStreams:Zp,carbonMonoxide:NM,climateControl:IM,color:VM,connectivity:JM,consumables:$M,contact:tN,control:aN,cover:cN,dayNight:mN,deviceDiscovery:o_,deviceStatus:gN,doorbell:yN,enumSensor:SN,eventEmitter:TN,fanControl:zN,featureProbe:VN,flood:UN,gas:GN,humidifier:qN,humiditySensor:YN,image:ZN,imageSettings:oP,intercom:yP,lawnMowerControl:CP,lockControl:zP,mediaPlayer:WP,motion:QP,motionTrigger:tF,motionZones:oF,nativeObjectDetection:mF,navigation:OF,networkLink:PF,notifier:lI,numericSensor:dI,petFeeder:jI,powerMeter:tL,presence:iL,pressureSensor:oL,privacyMask:fL,ptzAutotrack:DL,recordingOnboard:HR,recordingSignal:dz,sceneMonitor:Fz,scriptRunner:Bz,smoke:Hz,streamCatalog:Gz,streamParams:Qz,streamSignals:nA,switch:iB,tamper:LB,temperatureSensor:zB,update:UB,vacuumControl:oV,valve:lV,vibration:dV,waterHeater:pV,weather:hV,zoneAnalytics:wV,zoneRules:EV,zones:ND},bH=class{id;stableId;type;name;parentDeviceId;role;get online(){return this.runtimeState.getCapState(`device-status`)?.online??!1}set online(e){this.markOnline(e)}get state(){if(!this._stateProxyCache){let e={},t={get:(t,n)=>{let r=n;if(r in e)return e[r];let i=yH[r];if(!i)return;let a=this.sliceProxy(i);return e[r]=a,a}};this._stateProxyCache=new Proxy(e,t)}return this._stateProxyCache}_stateProxyCache;config;runtimeState;ctx;location;disabled;_sourceInfoCache=null;constructor(e,t,n){if(this.ctx=e,this.id=e.id,this.stableId=e.stableId,this.type=n.type,!e.deviceMeta)throw Error(`BaseDevice constructor: ctx.deviceMeta is required (id=${e.id} stableId=${e.stableId})`);this.name=e.deviceMeta.name,this.location=e.deviceMeta.location,this.disabled=e.deviceMeta.disabled,this.role=n.role,this.parentDeviceId=e.parentDeviceId;let r=e.persistedConfig??{};this.config=gH.fromSchema(t,t=>e.persistConfig(t),r,({droppedKeys:t,issues:n})=>{e.logger.warn(`Device config recovery: dropping invalid persisted fields`,{tags:{deviceId:e.id,stableId:e.stableId},meta:{droppedKeys:[...t],firstIssue:n[0]?.message??null}})});let i=null,a=async(t,n)=>{i||=e.fetchDevice(e.id),await(await i).deviceState.setCapSlice({capName:t,slice:n})},o=e.initialRuntimeState??{},s=(t,n)=>{e.logger.warn(`runtime-state write refused by the hub — the slice is not mirrored; it is re-sent on the next write`,{tags:{deviceId:e.id},meta:{cap:t,error:n}})};this.runtimeState=_H.fromInitial(o,a,s),e.bindRuntimeState?.(this.runtimeState),e.registerNativeCap?.(gN,{});let c={online:!0,lastChangedAt:Date.now()};this.runtimeState.setCapState(`device-status`,c),e.registerNativeCap?.(VN,{}),this.runtimeState.setCapState(`feature-probe`,{flags:{},deviceType:null,model:null,channelCount:null,lastProbedAt:0,lastFetchedAt:0})}deviceActions=new Map;registerDeviceAction(e,t,n){this.deviceActions.set(e,{spec:t,handler:n})}async runDeviceAction(e,t){let n=this.deviceActions.get(e);if(!n)throw Error(`unknown device action "${e}" on device ${this.id}`);let r=n.spec.input.parse(t);return n.handler(r)}async removeDevice(){}markOnline(e){if(this.online===e)return;let t={online:e,lastChangedAt:Date.now()};this.runtimeState.setCapState(`device-status`,t)}get sourceInfo(){if(this._sourceInfoCache)return this._sourceInfoCache;let e=n_(this.ctx.deviceMeta.metadata)??Qg({stableId:this.stableId,addonId:this.ctx.deviceMeta.addonId});return this._sourceInfoCache=Object.freeze({...e}),this._sourceInfoCache}get sourceId(){return this.sourceInfo.id}async updateSourceInfo(e){let t=$g(this.sourceInfo,e);this._sourceInfoCache=Object.freeze({...t});let n=this.ctx.api?.deviceManager?.setMetadata;if(n)try{await n.mutate({deviceId:this.id,patch:{[t_]:t}})}catch{}this.ctx.eventBus.emit(ze(`device.source-info-changed`,{type:`device`,id:this.stableId},{deviceId:this.id,sourceInfo:t}))}async refreshFeatures(){let e=this.ctx.api?.deviceManager?.registerDevice;if(e)try{await e.mutate({addonId:this.ctx.deviceMeta.addonId,stableId:this.stableId,id:this.id,type:this.type,name:this.name,parentDeviceId:this.parentDeviceId,features:[...this.features],config:{}})}catch{}}getCapSlice(e){return this.runtimeState.getCapState(e.name)??null}setCapSlice(e,t){this.runtimeState.setCapState(e.name,t)}sliceProxy(e){return new Proxy({},{get:(t,n)=>this.runtimeState.getCapState(e.name)?.[n],set:(t,n,r)=>(this.runtimeState.patchCapState(e.name,{[n]:r}),!0),has:(t,n)=>{let r=this.runtimeState.getCapState(e.name);return r?n in r:!1},ownKeys:()=>{let t=this.runtimeState.getCapState(e.name);return t?Object.keys(t):[]},getOwnPropertyDescriptor:(t,n)=>{let r=this.runtimeState.getCapState(e.name);if(!(!r||!(n in r)))return{configurable:!0,enumerable:!0,value:r[n]}}})}getSettingsUISchema(){return{sections:[]}}async applySettingsPatch(e){await this.config.setAll(e)}async onProbe(){let e=this.runtimeState.getCapState(`feature-probe`)??{flags:{},deviceType:null,model:null,channelCount:null,lastProbedAt:0,lastFetchedAt:0};this.runtimeState.setCapState(`feature-probe`,{...e,lastProbedAt:Date.now()})}async onActivate(){}async reprobe(){this._kernelReprobe?await this._kernelReprobe():await this.onProbe()}_kernelReprobe;getAccessoryChildren(){return[]}getProbeFlags(){return this.runtimeState.getCapState(`feature-probe`)?.flags??{}}hasProbed(){return(this.runtimeState.getCapState(`feature-probe`)?.lastProbedAt??0)>0}},xH=[1e4,3e4,9e4],SH=4;function CH(e,t){return new Promise(n=>{if(t.aborted){n();return}let r=()=>{clearTimeout(i),n()},i=setTimeout(()=>{t.removeEventListener(`abort`,r),n()},e);i.unref?.(),t.addEventListener(`abort`,r,{once:!0})})}async function wH(e,t,n){let r=[...e],i=Math.max(1,Math.min(t,r.length));await Promise.all(Array.from({length:i},async()=>{for(;;){let e=r.shift();if(e===void 0)return;await n(e)}}))}var TH=class{#e;#t;#n;#r;#i;#a;#o=new AbortController;constructor(e){this.#e=e.logger,this.#t=e.attempt,this.#n=e.onPermanentFailure,this.#r=e.delaysMs??xH,this.#i=e.concurrency??4,this.#a=e.now??Date.now}cancel(){this.#o.abort()}async run(e){let t=e.map(e=>({saved:e.saved,lastError:e.error,attempts:1}));for(let e=0;e<this.#r.length&&!(t.length===0||this.#o.signal.aborted||(await CH(this.#r[e]??0,this.#o.signal),this.#o.signal.aborted));e+=1)t=await this.#s(t,e);if(this.#o.signal.aborted)return[];let n=t.map(e=>({deviceId:e.saved.id,stableId:e.saved.stableId,type:String(e.saved.type),attempts:e.attempts,lastError:e.lastError,failedAt:this.#a()}));for(let e of n)this.#n(e);return n}async#s(e,t){let n=[],r=e.filter(e=>e.saved.parentDeviceId===null),i=e.filter(e=>e.saved.parentDeviceId!==null);for(let e of[r,i])await wH(e,this.#i,async e=>{if(this.#o.signal.aborted){n.push(e);return}let r=e.attempts+1;try{await this.#t(e.saved),this.#e.info(`Device restored on retry`,{tags:{deviceId:e.saved.id,stableId:e.saved.stableId},meta:{attempt:r}})}catch(i){let a=i instanceof Error?i.message:String(i),o=this.#r.length-(t+1);this.#e.warn(`Device restore retry failed`,{tags:{deviceId:e.saved.id,stableId:e.saved.stableId},meta:{attempt:r,remainingRetries:o,error:a}}),n.push({saved:e.saved,lastError:a,attempts:r})}});return n}};function EH(e,t){let n={};for(let t of e.config.entries())n[t.key]=t.value;return{id:e.id,stableId:e.stableId,addonId:t,type:String(e.type),name:e.name,parentDeviceId:e.parentDeviceId,online:e.online,features:[...e.features],config:n,sourceInfo:e.sourceInfo}}var DH=class extends qe{async onInitialize(){return this.ctx.logger.info(`${this.providerName} Provider initialized`),[{capability:G_,provider:this}]}async onShutdown(){this._restoreShuttingDown=!0,this.cancelRestoreRetries();let e=await this.ctx.kernel.devices?.getAll()??[];for(let t of e)try{await this.ctx.kernel.devices?.decommission(t.id)}catch(e){this.ctx.logger.warn(`${this.providerName}: decommission failed`,{tags:{deviceId:t.id,stableId:t.stableId},meta:{error:e instanceof Error?e.message:String(e)}})}this.ctx.logger.info(`${this.providerName} Provider shut down`,{meta:{decommissionedCount:e.length}})}async start(){}async stop(){}async getStatus(){let e=await this.ctx.kernel.devices?.getAll()??[],t=this.restoreFailureSummary();return t===null?{connected:!0,deviceCount:e.length}:{connected:!0,deviceCount:e.length,error:t}}async getDevices(){return(await this.ctx.kernel.devices?.getAll()??[]).map(e=>({id:e.stableId,name:e.name,type:String(e.type)}))}async supportsDiscovery(){return!1}async discoverDevices(e){return[]}async getDiscoveryParamsSchema(){return null}async getManualCreationType(){return await this.supportsManualCreation()?{deviceType:Object.values(E).find(e=>this.deviceClasses[e]!==void 0)??null}:{deviceType:null}}async adoptDiscoveredDevice(e){throw Error(`${this.providerName} provider does not support discovery-based adoption`)}async supportsManualCreation(){return!0}async getChildCreationSchema(e){return this.onGetCreationSchema(e.type)}async createDevice(e){let t=await this.onCreateDevice(e.type,e.config),n=this.deviceClasses[t.meta.type];if(!n)throw Error(`${this.providerName} provider: no device class registered for type "${t.meta.type}" — add it to the deviceClasses map`);let r=this.generateStableId(t.meta.type,t.config),i=await this.ctx.kernel.devices.create(r,n,t.config,null,t.meta);if(t.onAfterCreate)try{await t.onAfterCreate(i)}catch(e){this.ctx.logger.warn(`createDevice: onAfterCreate hook threw — device is already registered`,{tags:{deviceId:i.id,stableId:r},meta:{error:e instanceof Error?e.message:String(e)}})}return this.toSummary(i)}generateStableId(e,t){return`${this.addonId}-${Date.now()}`}async testCreationField(e){return{status:`ok`,labels:[`probe not implemented`]}}async restoreDevices(e){this._restoreShuttingDown=!1;let t=await this.onRestoreDevices(e);if(e.length===0)return;if(t&&t.failedCount>0){this.ctx.logger.warn(`Restored ${t.restoredCount}/${e.length} ${this.providerName} device(s) — ${t.failedCount} failed, bounded retry scheduled`);return}let n=t?t.restoredCount:e.length;this.ctx.logger.info(`Restored ${n} ${this.providerName} device(s)`)}restoreRetryDelaysMs=xH;restoreRetryConcurrency=4;_restoreRetrySchedulers=[];_restoreRetryCompletion=null;_restoreShuttingDown=!1;_permanentRestoreFailures=new Map;get restoreRetryCompletion(){return this._restoreRetryCompletion}get permanentRestoreFailures(){return[...this._permanentRestoreFailures.values()]}restoreFailureSummary(){if(this._permanentRestoreFailures.size===0)return null;let e=[...this._permanentRestoreFailures.keys()].join(`, `);return`${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${e}) — restart the ${this.providerName} provider to retry`}quarantineConfiglessTopLevelRestores=!0;isUnrestorableShell(e){if(!this.quarantineConfiglessTopLevelRestores||e.parentDeviceId!==null)return!1;let t=e.config;return t===void 0?!1:Object.keys(t).length===0}quarantineShell(e){this._permanentRestoreFailures.set(e.id,{deviceId:e.id,stableId:e.stableId,type:e.type,attempts:0,lastError:`persisted row has no configuration`,failedAt:Date.now()}),this.ctx.logger.error(`Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.`,{tags:{deviceId:e.id,stableId:e.stableId},meta:{type:e.type,provider:this.providerName}})}cancelRestoreRetries(){for(let e of this._restoreRetrySchedulers)e.cancel();this._restoreRetrySchedulers=[]}recordPermanentRestoreFailure(e){this._permanentRestoreFailures.set(e.deviceId,e),this.ctx.logger.error(`Device restore permanently failed — its capabilities will not register until the provider restarts`,{tags:{deviceId:e.deviceId,stableId:e.stableId},meta:{type:e.type,attempts:e.attempts,error:e.lastError}})}scheduleRestoreRetries(e,t){if(this._restoreShuttingDown){this.ctx.logger.info(`Restore retries not scheduled — the provider is shutting down`,{meta:{rows:e.length,deviceIds:e.map(e=>e.saved.id)}});return}let n=new TH({logger:this.ctx.logger,delaysMs:this.restoreRetryDelaysMs,concurrency:this.restoreRetryConcurrency,attempt:t,onPermanentFailure:e=>this.recordPermanentRestoreFailure(e)});this._restoreRetrySchedulers=[...this._restoreRetrySchedulers,n];let r=n.run(e).then(()=>void 0).catch(e=>{this.ctx.logger.error(`Restore retry scheduler crashed`,{meta:{error:e instanceof Error?e.message:String(e)}})}),i=this._restoreRetryCompletion;this._restoreRetryCompletion=i===null?r:Promise.all([i,r]).then(()=>void 0)}async restoreWithBoundedRetry(e,t){let n=[];for(let r of e){if(this.isUnrestorableShell(r)){this.quarantineShell(r);continue}try{await t(r)}catch(e){let t=e instanceof Error?e.message:String(e);this.ctx.logger.warn(`Failed to restore device — bounded retry scheduled`,{tags:{deviceId:r.id,stableId:r.stableId},meta:{type:r.type,attempt:1,error:t}}),n.push({saved:r,error:t})}}n.length>0&&this.scheduleRestoreRetries(n,t)}async reloadDevice(e){let{stableId:t}=e,n=this.ctx.kernel.devices;if(!n)throw Error(`${this.providerName}: kernel.devices unavailable — cannot reload`);let r=(await n.getAll()).find(e=>e.stableId===t);r&&await n.decommission(r.id);let{id:i}=await this.ctx.api.deviceManager.allocateDeviceId.mutate({addonId:this.addonId,stableId:t}),a=await this.ctx.api.deviceManager.loadMeta.query({deviceId:i});if(a===null)throw Error(`${this.providerName}: no persisted meta for "${t}" (id ${i}) — cannot reload`);let o=Object.values(E).find(e=>e===a.type),s=o===void 0?void 0:this.deviceClasses[o];if(!s)throw Error(`${this.providerName}: no device class for type "${a.type}" — "${t}" is an accessory child; reload its parent instead`);await n.create(t,s,{},a.parentDeviceId??null);let c=await this.ctx.api.deviceManager.listPersistedByAddon.query({addonId:this.addonId});for(let e of c){if(e.parentDeviceId!==i)continue;let t=Object.values(E).find(t=>t===e.type),r=t===void 0?void 0:this.deviceClasses[t];if(r)try{await n.create(e.stableId,r,{},i)}catch(t){this.ctx.logger.warn(`reloadDevice: failed to re-create first-class child`,{tags:{deviceId:e.id,stableId:e.stableId},meta:{parentDeviceId:i,error:t instanceof Error?t.message:String(t)}})}}return this.ctx.logger.info(`device reloaded in place from persisted rows`,{tags:{deviceId:i},meta:{stableId:t,type:a.type}}),{deviceId:i}}async healSavedConfig(e,t){}async onRestoreDevices(e){let t=new Set,n=[],r=new Set((await this.ctx.kernel.devices.getAll()).map(e=>e.stableId)),i=async n=>{if(t.has(n.id))return;if(r.has(n.stableId)){this.ctx.logger.debug(`Restore row already live — not dialled again`,{tags:{deviceId:n.id,stableId:n.stableId}}),t.add(n.id);return}let i=this.deviceClasses[n.type];if(!i)throw Error(`no device class registered for type "${n.type}"`);if(n.parentDeviceId!==null&&!t.has(n.parentDeviceId))throw Error(`parent device ${n.parentDeviceId} not restored`);await this.healSavedConfig(n,e);try{await this.ctx.kernel.devices.create(n.stableId,i,{},n.parentDeviceId)}catch(e){if(!(await this.ctx.kernel.devices.getAll()).some(e=>e.stableId===n.stableId))throw e;this.ctx.logger.debug(`Restore row came to life during its own dial — kept`,{tags:{deviceId:n.id,stableId:n.stableId}})}t.add(n.id)},a=e.filter(e=>e.parentDeviceId===null),o=async e=>{if(!this.deviceClasses[e.type]){this.ctx.logger.warn(`No device class registered for restored type — skipping`,{tags:{deviceId:e.id,stableId:e.stableId},meta:{type:e.type}});return}if(this.isUnrestorableShell(e)){this.quarantineShell(e);return}try{await i(e)}catch(t){let r=t instanceof Error?t.message:String(t);this.ctx.logger.warn(`Failed to restore device — bounded retry scheduled`,{tags:{deviceId:e.id,stableId:e.stableId},meta:{type:e.type,attempt:1,error:r}}),n.push({saved:e,error:r})}};await Promise.all(a.map(e=>o(e)));let s=new Set(n.map(e=>e.saved.id)),c=e.filter(e=>e.parentDeviceId!==null);for(let e of c)if(this.deviceClasses[e.type]&&e.parentDeviceId!==null){if(t.has(e.parentDeviceId)){try{await i(e)}catch(t){let r=t instanceof Error?t.message:String(t);this.ctx.logger.warn(`Failed to restore hub-adopted child — bounded retry scheduled`,{tags:{deviceId:e.id,stableId:e.stableId,parentDeviceId:e.parentDeviceId},meta:{type:e.type,attempt:1,error:r}}),n.push({saved:e,error:r})}continue}if(s.has(e.parentDeviceId)){this.ctx.logger.warn(`Hub-adopted child deferred — parent failed initial restore`,{tags:{deviceId:e.id,stableId:e.stableId,parentDeviceId:e.parentDeviceId},meta:{type:e.type}}),n.push({saved:e,error:`parent device ${e.parentDeviceId} not restored`});continue}}return n.length>0&&this.scheduleRestoreRetries(n,i),{restoredCount:t.size,failedCount:n.length}}toSummary(e){return EH(e,this.addonId)}},OH=360*6e4;function kH(e){let t=e.status;if(!t)return`sleeping`;if(t.sleeping!==!0)return`awake`;let n=t.lastContactAt;if(typeof n!=`number`||n<=0)return`sleeping`;let r=e.unreachableAfterMs??216e5;return e.nowMs-n>r?`unreachable`:`sleeping`}function AH(e){return e===`unreachable`}var jH=[`media-player`,`alarm-panel`,`thermostat`,`climate`,`humidifier`,`water-heater`,`lock`,`cover`,`valve`,`fan`,`vacuum`,`lawn-mower`,`light`,`switch`,`siren`,`button`,`control`,`notifier`,`script`,`automation`,`update`,`presence`,`weather`,`image`,`sensor`],MH=[`contact-sensor`,`motion-sensor`,`occupancy-sensor`,`smoke-sensor`,`co-sensor`,`gas-sensor`,`leak-sensor`,`vibration-sensor`,`tamper-sensor`,`sound-sensor`];function NH(e){if(e===void 0)return MH.length;let t=MH.indexOf(e);return t===-1?MH.length:t}function PH(e){let t=jH.indexOf(e);return t===-1?jH.length:t}function FH(e,t){let n=e=>e.toLowerCase().replace(/[-_\s]+/g,` `).trim();return n(e)===n(t)}function IH(e,t,n){if(t!=null){let n=e.find(e=>e.stableId===t)??e.find(e=>e.entityId!==void 0&&e.entityId===t);if(n!==void 0)return n}let r=e=>n!==void 0&&n.length>0&&e.name!==void 0&&FH(e.name,n)?0:1;return[...e].toSorted((e,t)=>NH(e.role)-NH(t.role)||r(e)-r(t)||PH(e.type)-PH(t.type))[0]??null}function LH(e,t,n,r,i){if(r.has(e))return;let a=t.get(e);if(!a)return;if(a.type!==E.Container){i.add(e);return}let o=new Set(r);o.add(e);let s=IH((n.get(e)??[]).map(e=>({id:e.id,stableId:e.stableId,type:e.type,...e.role!==void 0&&e.role!==null?{role:e.role}:{},...e.name===void 0?{}:{name:e.name}})),t.get(e)?.primaryChildEntityId,t.get(e)?.name);s!==null&&LH(s.id,t,n,o,i)}function RH(e){let{selfId:t,selfLocation:n,candidates:r}=e;if(n===null||n.length===0)return[];let i=new Map(r.map(e=>[e.id,e])),a=new Map;for(let e of r){if(e.parentDeviceId===null)continue;let t=a.get(e.parentDeviceId);t?t.push(e):a.set(e.parentDeviceId,[e])}let o=new Set,s=e=>LH(e,i,a,new Set,o);for(let e of r){if(e.type===E.Container||e.location!==n||e.parentDeviceId===t)continue;let r=e.parentDeviceId===null?void 0:i.get(e.parentDeviceId);if(r!==void 0&&r.type===E.Container){s(r.id);continue}o.add(e.id)}return o.delete(t),[...o]}var zH=`fixed`;function BH(e){let t=e??`hub`;return t.includes(`/`)?t.split(`/`)[0]??`hub`:t}var VH=32,HH=class{ports;constructor(e){let t=e.addonId;if(typeof t!=`string`||t.length===0)throw Error(`DeclaredDevices: addonId must be the declaring addon's id, got ${JSON.stringify(t)}. On an addon context it is \`ctx.id\` — there is no \`ctx.addonId\`.`);this.ports=e}async reconcile(e){if((e.placement??`hub`)===`hub`){let e=BH(this.ports.localNodeId);if(e!==`hub`)return this.ports.logger.info(`declared devices are hub-owned — skipping on this node`,{meta:{nodeId:e,rawNodeId:this.ports.localNodeId??null}}),{integrationId:null,devices:[],removed:[],owned:!1}}let t=e.integrationId??await this.ensureIntegration(e.integrationName),n=await this.readIndex(),r=await this.readLiveByStableId(),i=[];for(let a of e.devices){let e=await this.applyDeclaration(a,t,n,r);e!==null&&i.push(e)}return{integrationId:t,devices:i,removed:await this.sweepWithdrawn(e.devices,t,n),owned:!0}}async ensureIntegration(e){let t=await this.ports.getIntegration(this.ports.addonId);if(t===null){let t=await this.ports.createIntegration({addonId:this.ports.addonId,name:e,info:{[zH]:!0}});return this.ports.logger.info(`declared a fixed integration`,{meta:{integrationId:t.id,name:e}}),t.id}return t.info?.fixed!==!0&&(await this.ports.updateIntegration({id:t.id,info:{[zH]:!0}}),this.ports.logger.info("re-asserted `fixed` on a declared integration",{meta:{integrationId:t.id}})),t.id}async readIndex(){let e=await this.ports.listOwnDevices();return new Map(e.map(e=>[e.stableId,e]))}async readLiveByStableId(){try{let e=await this.ports.devices.getAll();return new Map(e.map(e=>[e.stableId,e]))}catch(e){return this.ports.logger.warn(`could not read live devices — falling back to adopt-by-row`,{meta:{error:e instanceof Error?e.message:String(e)}}),new Map}}async applyDeclaration(e,t,n,r){try{let i=r.get(e.stableId);if(i!==void 0)return{stableId:e.stableId,deviceId:i.id,device:i,created:!1};let a=n.get(e.stableId);if(a===void 0&&(a=(await this.readIndex()).get(e.stableId),a!==void 0&&this.ports.logger.warn(`device index disagreed with itself — adopting instead of re-creating`,{tags:{deviceId:a.id},meta:{stableId:e.stableId,addonId:this.ports.addonId}})),a!==void 0){let n=await this.ports.devices.create(e.stableId,e.DeviceClass,{},null,void 0);return this.ports.logger.info(`declared device adopted`,{tags:{deviceId:n.id},meta:{stableId:e.stableId,integrationId:t}}),{stableId:e.stableId,deviceId:n.id,device:n,created:!1}}let o=await this.ports.devices.create(e.stableId,e.DeviceClass,e.config??{},null,{type:e.type,name:e.name,integrationId:t,...e.role===void 0?{}:{role:e.role}});return this.ports.logger.info(`declared device created`,{tags:{deviceId:o.id},meta:{stableId:e.stableId,integrationId:t}}),{stableId:e.stableId,deviceId:o.id,device:o,created:!0}}catch(t){return this.ports.logger.warn(`a declared device could not be brought up`,{meta:{stableId:e.stableId,error:t instanceof Error?t.message:String(t)}}),null}}async sweepWithdrawn(e,t,n){let r=new Set(e.map(e=>e.stableId)),i=[...n.values()].filter(e=>e.integrationId===t&&!r.has(e.stableId));if(i.length===0)return[];if(i.length>32)return this.ports.logger.warn(`withdrawal sweep exceeded its bound — removing nothing`,{meta:{integrationId:t,candidates:i.length,bound:32}}),[];let a=[];for(let e of i)try{await this.ports.devices.remove(e.id),a.push(e.id),this.ports.logger.info(`declared device removed — its declaration was withdrawn`,{tags:{deviceId:e.id},meta:{stableId:e.stableId,integrationId:t}})}catch(t){this.ports.logger.warn(`a withdrawn declared device could not be removed`,{tags:{deviceId:e.id},meta:{stableId:e.stableId,error:t instanceof Error?t.message:String(t)}})}return a}},UH={[E.Cover]:`cover`,[E.Valve]:`valve`,[E.Humidifier]:`humidifier`,[E.WaterHeater]:`water-heater`,[E.Camera]:`dummy`,[E.Hub]:`dummy`,[E.Switch]:`switch`,[E.Siren]:`switch`,[E.Light]:`light`,[E.Fan]:`fan`,[E.Sensor]:`sensor`,[E.Thermostat]:`thermostat`,[E.Climate]:`climate`,[E.Button]:`button`,[E.EventEmitter]:`dummy`,[E.Update]:`update`,[E.Generic]:`dummy`,[E.Notifier]:`dummy`,[E.Script]:`script`,[E.Automation]:`automation`,[E.Lock]:`lock`,[E.MediaPlayer]:`media-player`,[E.AlarmPanel]:`alarm`,[E.Control]:`control`,[E.Presence]:`sensor`,[E.Weather]:`weather`,[E.Vacuum]:`vacuum`,[E.LawnMower]:`lawn-mower`,[E.Container]:`dummy`,[E.Image]:`image`,[E.PetFeeder]:`pet-feeder`},WH=new Set(Object.values(E));function GH(e){return WH.has(e)?UH[e]:null}var KH=`motion-trigger`;function qH(e){return e.includes(KH)}var JH=[`temperature-sensor`,`humidity-sensor`,`ambient-light-sensor`,`numeric-sensor`,`enum-sensor`];function YH(e){let t=new Set(e.features);switch(e.type){case E.Cover:return{kind:`cover`};case E.Valve:return{kind:`valve`};case E.Lock:return{kind:`lock`};case E.AlarmPanel:return{kind:`alarm`};case E.Light:return t.has(`brightness`)?{kind:`brightness`}:{kind:`switch`};case E.Switch:case E.Siren:return{kind:`switch`};case E.Sensor:case E.Presence:{let e=JH.find(e=>t.has(e));return e?{kind:`sensor`,sensorFeature:e}:{kind:`none`}}default:return{kind:`none`}}}var XH={"temperature-sensor":{capKey:`temperatureSensor`,field:`celsius`,fallbackUnit:`°C`},"humidity-sensor":{capKey:`humiditySensor`,field:`percent`,fallbackUnit:`%`},"ambient-light-sensor":{capKey:`ambientLightSensor`,field:`lux`,fallbackUnit:`lx`},"numeric-sensor":{capKey:`numericSensor`,field:`value`}};function ZH(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function QH(e,t){if(!ZH(e))return null;let n=e[t];if(!ZH(n))return null;let r=n.mutate;return typeof r==`function`?r:null}function $H(e,t){return!e||e.length===0?!1:e.includes(t.when.hasFeature)}var eU={id:`battery`,label:`Battery-operated camera`,when:{hasFeature:Fn.BatteryOperated},defaults:{audioMode:`disabled`,detectionMode:`on-motion`},settings:{}},tU=[eU];function nU(e){for(let t of tU)if($H(e,t))return t;return null}var rU=[`device`,`lighting`,`sensing`,`place`,`life`],iU=[{key:`camera`,group:`device`,synonyms:[`telecamera`,`videocamera`,`camera`,`cam`]},{key:`network`,group:`device`,synonyms:[`rete`,`network`,`lan`]},{key:`toggle-left`,group:`device`,synonyms:[`interruttore`,`switch`,`toggle`]},{key:`toggle-right`,group:`device`,synonyms:[`interruttore`,`switch`,`toggle`,`acceso`]},{key:`circle-dot`,group:`device`,synonyms:[`pulsante`,`bottone`,`button`,`dot`]},{key:`refresh-cw`,group:`device`,synonyms:[`aggiorna`,`ricarica`,`refresh`,`reload`,`ciclo`]},{key:`box`,group:`device`,synonyms:[`scatola`,`box`,`contenitore`]},{key:`scroll-text`,group:`device`,synonyms:[`registro`,`log`,`testo`]},{key:`workflow`,group:`device`,synonyms:[`automazione`,`flusso`,`workflow`,`scenario`]},{key:`lock`,group:`device`,synonyms:[`serratura`,`chiave`,`lucchetto`,`chiuso`,`locked`]},{key:`lock-open`,group:`device`,synonyms:[`serratura`,`aperta`,`sbloccato`,`unlocked`]},{key:`blinds`,group:`device`,synonyms:[`tapparella`,`persiana`,`serranda`,`avvolgibile`,`shutter`,`blind`,`veneziana`]},{key:`air-vent`,group:`device`,synonyms:[`bocchetta`,`aria`,`ventilazione`,`condizionatore`,`vent`]},{key:`monitor-play`,group:`device`,synonyms:[`schermo`,`riproduzione`,`player`,`display`]},{key:`sliders-horizontal`,group:`device`,synonyms:[`regolazione`,`cursori`,`impostazioni`,`slider`]},{key:`map-pin`,group:`device`,synonyms:[`posizione`,`luogo`,`mappa`,`pin`]},{key:`bot`,group:`device`,synonyms:[`robot`,`aspirapolvere`,`bot`]},{key:`tractor`,group:`device`,synonyms:[`trattore`,`tosaerba`,`giardino`]},{key:`image`,group:`device`,synonyms:[`immagine`,`foto`,`snapshot`]},{key:`bone`,group:`device`,synonyms:[`osso`,`cane`]},{key:`door-closed`,group:`device`,synonyms:[`porta`,`chiusa`,`contatto`]},{key:`door-open`,group:`device`,synonyms:[`porta`,`aperta`,`contatto`,`ingresso`,`uscita`]},{key:`crosshair`,group:`device`,synonyms:[`mirino`,`puntamento`,`centro`]},{key:`eye`,group:`device`,synonyms:[`occhio`,`visibile`,`visto`]},{key:`eye-off`,group:`device`,synonyms:[`privacy`,`nascosto`,`oscurato`,`mascherato`,`invisibile`]},{key:`smartphone`,group:`device`,synonyms:[`telefono`,`cellulare`,`smartphone`]},{key:`phone`,group:`device`,synonyms:[`telefono`,`chiamata`]},{key:`tablet`,group:`device`,synonyms:[`tablet`,`ipad`]},{key:`laptop`,group:`device`,synonyms:[`portatile`,`laptop`,`notebook`]},{key:`monitor`,group:`device`,synonyms:[`monitor`,`schermo`]},{key:`tv`,group:`device`,synonyms:[`televisore`,`tv`]},{key:`speaker`,group:`device`,synonyms:[`altoparlante`,`cassa`,`speaker`]},{key:`printer`,group:`device`,synonyms:[`stampante`]},{key:`projector`,group:`device`,synonyms:[`proiettore`]},{key:`gamepad-2`,group:`device`,synonyms:[`console`,`gioco`,`joystick`]},{key:`radio`,group:`device`,synonyms:[`radio`]},{key:`router`,group:`device`,synonyms:[`router`,`modem`]},{key:`bluetooth`,group:`device`,synonyms:[`bluetooth`]},{key:`cpu`,group:`device`,synonyms:[`processore`,`cpu`,`chip`,`dispositivo`]},{key:`hard-drive`,group:`device`,synonyms:[`disco`,`hdd`,`archiviazione`,`storage`]},{key:`server`,group:`device`,synonyms:[`server`,`nas`]},{key:`mic`,group:`device`,synonyms:[`microfono`,`audio`]},{key:`mic-off`,group:`device`,synonyms:[`microfono`,`spento`,`muto`]},{key:`video`,group:`device`,synonyms:[`video`]},{key:`video-off`,group:`device`,synonyms:[`video`,`spento`]},{key:`music`,group:`device`,synonyms:[`musica`]},{key:`plug`,group:`device`,synonyms:[`presa`,`spina`,`plug`]},{key:`plug-zap`,group:`device`,synonyms:[`presa`,`alimentata`]},{key:`power`,group:`device`,synonyms:[`accensione`,`alimentazione`,`power`]},{key:`power-off`,group:`device`,synonyms:[`spegnimento`,`spento`]},{key:`cable`,group:`device`,synonyms:[`cavo`]},{key:`battery`,group:`device`,synonyms:[`batteria`]},{key:`battery-charging`,group:`device`,synonyms:[`batteria`,`carica`,`ricarica`]},{key:`battery-full`,group:`device`,synonyms:[`batteria`,`carica`,`piena`]},{key:`battery-low`,group:`device`,synonyms:[`batteria`,`scarica`]},{key:`key`,group:`device`,synonyms:[`chiave`]},{key:`key-round`,group:`device`,synonyms:[`chiave`,`tonda`]},{key:`mailbox`,group:`device`,synonyms:[`cassetta`,`postale`,`posta`]},{key:`package`,group:`device`,synonyms:[`pacco`,`consegna`]},{key:`shield`,group:`device`,synonyms:[`scudo`,`protezione`,`sicurezza`,`allarme`]},{key:`shield-check`,group:`device`,synonyms:[`protetto`,`sicuro`,`armato`]},{key:`shield-off`,group:`device`,synonyms:[`protezione`,`disattivata`,`disarmato`]},{key:`briefcase`,group:`device`,synonyms:[`ufficio`,`lavoro`,`valigetta`,`studio`]},{key:`lightbulb`,group:`lighting`,synonyms:[`luce`,`lampadina`,`lampada`,`light`]},{key:`lamp`,group:`lighting`,synonyms:[`lampada`,`abatjour`]},{key:`lamp-ceiling`,group:`lighting`,synonyms:[`plafoniera`,`lampadario`,`luce`,`soffitto`]},{key:`lamp-desk`,group:`lighting`,synonyms:[`lampada`,`scrivania`,`abatjour`]},{key:`lamp-floor`,group:`lighting`,synonyms:[`piantana`,`lampada`,`terra`]},{key:`flashlight`,group:`lighting`,synonyms:[`faretto`,`torcia`,`spot`,`faro`]},{key:`heater`,group:`lighting`,synonyms:[`riscaldamento`,`termosifone`,`stufa`,`calore`]},{key:`snowflake`,group:`lighting`,synonyms:[`freddo`,`raffrescamento`,`aria`,`condizionata`,`neve`]},{key:`thermometer-sun`,group:`lighting`,synonyms:[`caldo`,`temperatura`,`alta`]},{key:`thermometer-snowflake`,group:`lighting`,synonyms:[`freddo`,`temperatura`,`bassa`]},{key:`refrigerator`,group:`lighting`,synonyms:[`frigorifero`,`frigo`]},{key:`microwave`,group:`lighting`,synonyms:[`microonde`,`forno`]},{key:`washing-machine`,group:`lighting`,synonyms:[`lavatrice`,`lavastoviglie`,`asciugatrice`]},{key:`cooking-pot`,group:`lighting`,synonyms:[`pentola`,`cucina`,`fornello`]},{key:`utensils`,group:`lighting`,synonyms:[`cucina`,`posate`,`sala`,`pranzo`]},{key:`thermometer`,group:`sensing`,synonyms:[`temperatura`,`termometro`,`termostato`]},{key:`droplets`,group:`sensing`,synonyms:[`umidita`,`acqua`,`allagamento`,`perdita`]},{key:`droplet`,group:`sensing`,synonyms:[`goccia`,`acqua`,`perdita`,`allagamento`]},{key:`gauge`,group:`sensing`,synonyms:[`misura`,`livello`,`pressione`,`indicatore`]},{key:`gauge2`,group:`sensing`,synonyms:[`misura`,`livello`,`pressione`,`indicatore`],aliasOf:`gauge`},{key:`sun`,group:`sensing`,synonyms:[`sole`,`luminosita`,`giorno`,`esterno`]},{key:`sun-medium`,group:`sensing`,synonyms:[`sole`,`luminosita`]},{key:`sunrise`,group:`sensing`,synonyms:[`alba`]},{key:`moon`,group:`sensing`,synonyms:[`notte`,`luna`,`notturna`,`nightvision`]},{key:`wind`,group:`sensing`,synonyms:[`vento`,`aria`,`gas`,`monossido`,`co`]},{key:`cloud`,group:`sensing`,synonyms:[`nuvola`,`nuvoloso`]},{key:`cloud-rain`,group:`sensing`,synonyms:[`pioggia`]},{key:`cloud-sun`,group:`sensing`,synonyms:[`variabile`,`sole`,`nuvole`]},{key:`waves`,group:`sensing`,synonyms:[`onde`,`acqua`,`vibrazione`]},{key:`sprout`,group:`sensing`,synonyms:[`irrigazione`,`pianta`,`germoglio`,`orto`]},{key:`leaf`,group:`sensing`,synonyms:[`foglia`,`pianta`,`verde`]},{key:`flower`,group:`sensing`,synonyms:[`fiore`,`pianta`]},{key:`zap`,group:`sensing`,synonyms:[`energia`,`corrente`,`consumo`,`watt`,`elettricita`]},{key:`flame`,group:`sensing`,synonyms:[`fiamma`,`gas`,`fuoco`,`incendio`]},{key:`bell`,group:`sensing`,synonyms:[`campanello`,`suoneria`,`notifica`,`bell`,`chime`]},{key:`bell-ring`,group:`sensing`,synonyms:[`campanello`,`suona`,`doorbell`,`notifica`]},{key:`bell-off`,group:`sensing`,synonyms:[`silenzioso`,`notifiche`,`disattivate`,`muto`]},{key:`siren`,group:`sensing`,synonyms:[`sirena`,`allarme`]},{key:`radar`,group:`sensing`,synonyms:[`movimento`,`presenza`,`pir`,`rilevamento`,`radar`]},{key:`activity`,group:`sensing`,synonyms:[`attivita`,`sensore`,`generico`]},{key:`hash`,group:`sensing`,synonyms:[`numero`,`contatore`,`valore`]},{key:`clock`,group:`sensing`,synonyms:[`orologio`,`ora`,`tempo`]},{key:`timer`,group:`sensing`,synonyms:[`timer`,`conto`,`rovescia`]},{key:`calendar`,group:`sensing`,synonyms:[`calendario`,`data`,`pianificazione`]},{key:`pipette`,group:`sensing`,synonyms:[`qualita`,`aria`,`misura`,`campione`]},{key:`fan`,group:`sensing`,synonyms:[`ventilatore`,`ventola`,`aria`]},{key:`bath`,group:`sensing`,synonyms:[`bagno`,`vasca`,`doccia`]},{key:`footprints`,group:`sensing`,synonyms:[`movimento`,`passi`,`presenza`,`motion`]},{key:`alarm-smoke`,group:`sensing`,synonyms:[`fumo`,`antincendio`,`rilevatore`]},{key:`shield-alert`,group:`sensing`,synonyms:[`manomissione`,`allarme`,`tamper`,`avviso`]},{key:`vibrate`,group:`sensing`,synonyms:[`vibrazione`,`urto`,`tamper`]},{key:`wifi`,group:`sensing`,synonyms:[`wifi`,`rete`,`segnale`]},{key:`wifi-off`,group:`sensing`,synonyms:[`wifi`,`assente`,`offline`,`disconnesso`]},{key:`volume-2`,group:`sensing`,synonyms:[`volume`,`audio`,`altoparlante`,`suono`]},{key:`volume-x`,group:`sensing`,synonyms:[`muto`,`silenziato`,`volume`,`spento`]},{key:`heart`,group:`sensing`,synonyms:[`cuore`,`preferito`,`salute`]},{key:`heart-pulse`,group:`sensing`,synonyms:[`battito`,`salute`,`monitoraggio`]},{key:`star`,group:`sensing`,synonyms:[`preferito`,`stella`,`importante`]},{key:`sparkles`,group:`sensing`,synonyms:[`automatico`,`intelligente`,`ai`,`scena`]},{key:`house`,group:`place`,synonyms:[`casa`,`abitazione`,`home`]},{key:`sofa`,group:`place`,synonyms:[`salone`,`soggiorno`,`divano`,`living`]},{key:`bed-double`,group:`place`,synonyms:[`camera`,`letto`,`matrimoniale`]},{key:`bed`,group:`place`,synonyms:[`cameretta`,`letto`,`singolo`]},{key:`warehouse`,group:`place`,synonyms:[`magazzino`,`capanno`,`deposito`,`cantina`]},{key:`trees`,group:`place`,synonyms:[`giardino`,`alberi`,`esterno`,`parco`]},{key:`tree-pine`,group:`place`,synonyms:[`albero`,`pino`,`giardino`]},{key:`fence`,group:`place`,synonyms:[`recinto`,`cancello`,`staccionata`,`perimetro`]},{key:`store`,group:`place`,synonyms:[`negozio`,`ingresso`,`vetrina`]},{key:`building`,group:`place`,synonyms:[`edificio`,`palazzo`]},{key:`building-2`,group:`place`,synonyms:[`edificio`,`uffici`,`condominio`]},{key:`mountain`,group:`place`,synonyms:[`montagna`,`esterno`,`panorama`]},{key:`umbrella`,group:`place`,synonyms:[`tenda`,`markise`,`ombrellone`,`pergola`,`veranda`]},{key:`dumbbell`,group:`place`,synonyms:[`palestra`,`attrezzi`]},{key:`wrench`,group:`place`,synonyms:[`officina`,`manutenzione`,`attrezzi`,`utenze`]},{key:`hammer`,group:`place`,synonyms:[`officina`,`martello`,`lavori`]},{key:`drill`,group:`place`,synonyms:[`officina`,`trapano`,`lavori`]},{key:`waves-ladder`,group:`place`,synonyms:[`piscina`,`vasca`]},{key:`circle-parking`,group:`place`,synonyms:[`parcheggio`,`posto`,`auto`,`garage`]},{key:`route`,group:`place`,synonyms:[`percorso`,`strada`,`vialetto`,`tragitto`]},{key:`car`,group:`life`,synonyms:[`auto`,`macchina`,`veicolo`,`parcheggio`]},{key:`bike`,group:`life`,synonyms:[`bicicletta`,`bici`,`moto`]},{key:`bus`,group:`life`,synonyms:[`autobus`,`pullman`]},{key:`truck`,group:`life`,synonyms:[`camion`,`furgone`,`consegna`]},{key:`plane`,group:`life`,synonyms:[`aereo`]},{key:`train-front`,group:`life`,synonyms:[`treno`]},{key:`sailboat`,group:`life`,synonyms:[`barca`,`imbarcazione`]},{key:`dog`,group:`life`,synonyms:[`cane`,`animale`]},{key:`cat`,group:`life`,synonyms:[`gatto`,`animale`]},{key:`bird`,group:`life`,synonyms:[`uccello`,`animale`]},{key:`paw-print`,group:`life`,synonyms:[`animale`,`zampa`,`pet`]},{key:`baby`,group:`life`,synonyms:[`neonato`,`bimbo`,`cameretta`,`babymonitor`]},{key:`user`,group:`life`,synonyms:[`persona`,`utente`]},{key:`users`,group:`life`,synonyms:[`persone`,`gruppo`,`famiglia`]},{key:`person-standing`,group:`life`,synonyms:[`persona`,`piedi`,`presenza`]}],aU=iU.map(e=>e.key),oU=iU.filter(e=>e.aliasOf===void 0).map(e=>e.key),sU=new Map(iU.map(e=>[e.key,e]));function cU(e){return typeof e==`string`&&sU.has(e)}function lU(e){return sU.get(e)}function uU(e){return iU.filter(t=>t.group===e)}function dU(e){return e.normalize(`NFD`).replace(/\p{Diacritic}/gu,``).toLowerCase().replace(/[_-]+/g,` `).trim()}function fU(e,t){let n=0;for(let r of t)if(r===e[n]&&(n+=1),n===e.length)return!0;return e.length===0}function pU(e,t){return t===e?100:t.startsWith(e)?80:t.split(` `).some(t=>t.startsWith(e))?60:t.includes(e)?40:fU(e,t)?15:0}function mU(e,t){let n=dU(e);if(n.length===0)return iU.filter(e=>e.aliasOf===void 0).map(e=>({entry:e,score:0}));let r=[];for(let e of iU){if(e.aliasOf!==void 0)continue;let i=[dU(e.key),...e.synonyms.map(dU),...(t?.get(e.key)??[]).map(dU)],a=0;for(let[e,t]of i.entries()){let r=pU(n,t);if(r===0)continue;let i=e===0?r+1:r;i>a&&(a=i)}a>0&&r.push({entry:e,score:a})}return r.sort((e,t)=>t.score-e.score)}function hU(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function gU(e,t){let n=t.split(`.`),r=e;for(let e of n){if(!hU(r))return;r=r[e]}return r}function _U(e,t,n){let r=t.indexOf(`.`);if(r===-1)return{...e,[t]:n};let i=t.slice(0,r),a=t.slice(r+1),o=e[i],s=hU(o)?o:{};return{...e,[i]:_U(s,a,n)}}var vU=3e4,yU=3,bU=1e4;async function xU(e,t,n){let r,i=new Promise((e,i)=>{r=setTimeout(()=>i(Error(`${n} timed out after ${String(t)}ms`)),t)});try{return await Promise.race([e,i])}finally{r!==void 0&&clearTimeout(r)}}function SU(e){let t=e.intervalMs??3e4,n=e.failuresToOffline??3,r=e.probeTimeoutMs??1e4,i=e.runImmediately??!0,a=!1,o=!1,s=0,c,l=async()=>{if(!a&&!o&&!(e.isEnabled&&!e.isEnabled())){o=!0;try{let t=await xU(Promise.resolve().then(e.probe),r,`reachability probe`);if(a)return;t?(s=0,e.setOnline(!0)):u(`probe resolved unreachable`)}catch(e){if(a)return;u(e instanceof Error?e.message:`probe threw`)}finally{o=!1}}},u=t=>{s+=1,e.logger?.debug(`reachability probe failed`,{reason:t,consecutiveFailures:s,failuresToOffline:n}),s>=n&&e.setOnline(!1)};return c=setInterval(()=>{l()},t),typeof c==`object`&&c&&`unref`in c&&c.unref(),i&&l(),{stop:()=>{a||(a=!0,c!==void 0&&clearInterval(c),c=void 0)}}}var CU=`lastFetchedAt`,wU=6e4,TU=10*6e4;function EU(e){let{runtimeState:t,cap:n,ownDeviceId:r,refresh:i,staleMs:a,empty:o,logger:s}=e,c=e.refreshMissCooldownMs??6e4,l=e.staleRead??`await-refresh`,u=0,d=null,f=()=>{let e=t.getCapState(n.name)?.[CU];return typeof e==`number`?e:0},p=e=>{u=Date.now()+c,s?.warn(`${n.name}: refresh did not land — serving the last slice and not re-reading the camera for ${String(c)}ms`,{tags:{deviceId:r},meta:{cooldownMs:c,error:e===void 0?null:e instanceof Error?e.message:String(e)}})},m=async e=>{try{await i()}catch(e){throw p(e),e}if(f()>e){u!==0&&(u=0,s?.info(`${n.name}: refresh landed again — resuming normal polling`,{tags:{deviceId:r}}));return}p(void 0)},ee=e=>{let t=d;if(t!==null)return t;let n=m(e).catch(()=>void 0).finally(()=>{d=null});return d=n,n},h=async()=>{let e=t.getCapState(n.name),r=f();if(e&&Date.now()-r<=a){u=0;return}if(!(Date.now()<u)){if(l===`serve-and-revalidate`){if(d!==null)return;if(e&&r>0){ee(r);return}await ee(r);return}await m(r)}},te=()=>{let e=t.getCapState(n.name);if(!e)return o();let{[CU]:r,...i}=e;return i};return{ensureFresh:h,getStatus:async({deviceId:e})=>{if(e!==r)throw Error(`${n.name}: deviceId mismatch, expected ${r}, got ${e}`);return await h(),te()}}}var DU=`device.state-changed`,OU=`capability.binding-changed`,kU=`device.registered`,AU=`device.unregistered`,jU=`device.updated`,MU=class{api;stateMirror=new Map;bindings=new Map;devices=new Map;handleListeners=new Map;globalStateListeners=new Set;capListeners=new Map;deviceListeners=new Map;addedListeners=new Set;removedListeners=new Set;pendingWaits=new Set;stateSource;bridges=[];initialized=!1;initPromise=null;constructor(e){this.api=e,this.stateSource=yn(this.stateMirror,this.handleListeners,this.api)}async init(e=15e3){if(!this.initialized){if(this.initPromise)return this.initPromise;this.initPromise=(async()=>{let t=(t,n)=>Number.isFinite(e)?new Promise((r,i)=>{let a=setTimeout(()=>i(Error(`SystemMirror.init: '${n}' timed out after ${e}ms`)),e);t.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e)})}):t,[n,r,i]=await Promise.all([t(this.api.deviceManager.getAllBindings.query({}),`deviceManager.getAllBindings`),t(this.api.deviceState.getAllSnapshots.query({}),`deviceState.getAllSnapshots`),t(this.api.deviceManager.listAll.query({}),`deviceManager.listAll`)]);for(let e of n)this.bindings.set(e.deviceId,e);for(let[e,t]of Object.entries(r)){let n=Number(e);if(!Number.isFinite(n))continue;let r=new Map;for(let[e,n]of Object.entries(t))r.set(e,n);this.stateMirror.set(n,r)}for(let e of i)this.devices.set(e.id,e);try{this.subscribeBus()}catch{}this.initialized=!0})();try{await this.initPromise}finally{this.initPromise=null}}}isReady(){return this.initialized}async awaitReady(){if(!this.initialized)return this.initPromise?this.initPromise:this.init()}dispose(){for(let e of this.bridges)try{e.unsubscribe()}catch{}this.bridges=[],this.handleListeners.clear(),this.globalStateListeners.clear(),this.capListeners.clear(),this.deviceListeners.clear(),this.addedListeners.clear(),this.removedListeners.clear(),this.pendingWaits.clear(),this.initialized=!1}getDeviceById(e){let t=this.bindings.get(e);return t?xn(this.api,t,{stateSource:this.stateSource}):null}getDeviceByName(e){for(let t of this.devices.values())if(t.name===e)return this.getDeviceById(t.id);return null}getDeviceByStableId(e){for(let t of this.devices.values())if(t.stableId===e)return this.getDeviceById(t.id);return null}getDevicesByAddon(e){return this.query({addonId:e})}getDevicesByType(e){return this.query({type:e})}getDeviceInfo(e){return this.devices.get(e)??null}getAllDevices(){let e=[];for(let t of this.bindings.keys()){let n=this.getDeviceById(t);n&&e.push(n)}return e}filterByCap(e){return this.query({caps:e})}query(e={}){let t=[];for(let[n,r]of this.bindings){let i=this.devices.get(n);if(e.id!==void 0&&!NU(n,e.id)||e.stableId!==void 0&&(!i||!NU(i.stableId,e.stableId))||e.addonId!==void 0&&(!i||!NU(i.addonId,e.addonId))||e.type!==void 0&&(!i||!NU(i.type,e.type)))continue;if(e.caps!==void 0){let t=PU(e.caps),n=new Set(r.entries.map(e=>e.capName));if(!t.every(e=>n.has(e)))continue}if(e.anyCap!==void 0){let t=PU(e.anyCap),n=new Set(r.entries.map(e=>e.capName));if(!t.some(e=>n.has(e)))continue}if(e.name!==void 0&&(!i||!FU(i.name,e.name))||e.online!==void 0&&(!i||i.online!==e.online))continue;if(e.parentDeviceId!==void 0){if(!i)continue;let t=e.parentDeviceId;if((i.parentDeviceId??null)!==t)continue}if(e.feature!==void 0&&(!i||!PU(e.feature).every(e=>i.features.includes(e)))||e.isCamera!==void 0&&(!i||i.isCamera!==e.isCamera))continue;let a=this.getDeviceById(n);if(a){if(e.where&&i){if(!e.where(i,a))continue}else if(e.where&&!i)continue;t.push(a)}}return t}whereState(e,t){let n=[];for(let[r,i]of this.stateMirror){let a=i.get(e);if(!a||!t(a,r))continue;let o=this.getDeviceById(r);o&&n.push(o)}return n}mapState(e,t){let n=[];for(let[r,i]of this.stateMirror){let a=i.get(e);a&&n.push(t(a,r))}return n}findState(e,t){for(let[n,r]of this.stateMirror){let i=r.get(e);if(i&&t(i,n))return this.getDeviceById(n)}return null}countByCap(e){let t=0;for(let n of this.bindings.values())n.entries.some(t=>t.capName===e)&&t++;return t}countByState(e,t){let n=0;for(let[r,i]of this.stateMirror){let a=i.get(e);a&&t(a,r)&&n++}return n}listen(e){return this.globalStateListeners.add(e),()=>{this.globalStateListeners.delete(e)}}listenCap(e,t){let n=this.capListeners.get(e);return n||(n=new Set,this.capListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.capListeners.delete(e)}}listenDevice(e,t){let n=this.deviceListeners.get(e);return n||(n=new Set,this.deviceListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.deviceListeners.delete(e)}}onDeviceAdded(e){return this.addedListeners.add(e),()=>{this.addedListeners.delete(e)}}onDeviceRemoved(e){return this.removedListeners.add(e),()=>{this.removedListeners.delete(e)}}waitForState(e,t,n,r=3e4){return new Promise((i,a)=>{let o=(()=>{let r=this.stateMirror.get(e)?.get(t);return r&&n(r)?r:null})();if(o){i(o);return}let s=null,c=this.listenDevice(e,(e,r,a)=>{r===t&&a&&n(a)&&(s&&clearTimeout(s),c(),i(a))});Number.isFinite(r)&&(s=setTimeout(()=>{c(),a(Error(`waitForState timed out after ${r}ms (deviceId=${e}, capName=${t})`))},r))})}waitForDevice(e,t=3e4){return new Promise((n,r)=>{let i=this.getDeviceById(e);if(i){n(i);return}let a=null,o=this.onDeviceAdded(t=>{if(t!==e)return;let r=this.getDeviceById(t);r&&(a&&clearTimeout(a),o(),n(r))});Number.isFinite(t)&&(a=setTimeout(()=>{o(),r(Error(`waitForDevice timed out after ${t}ms (deviceId=${e})`))},t))})}async forEachCap(e,t){for(let n of this.filterByCap(e))await t(n)}async invokeCap(e,t,n,r={}){let i=this.filterByCap(e),a=Math.max(1,r.parallelism??i.length),o=[];for(let r=0;r<i.length;r+=a){let s=i.slice(r,r+a),c=await Promise.allSettled(s.map(async r=>{let i=r[e];if(!i||typeof i[t]!=`function`)throw Error(`device '${r.deviceId}' does not expose '${e}.${t}'`);return await i[t](n)}));for(let e=0;e<c.length;e++){let t=s[e],n=c[e];n.status===`fulfilled`?o.push({deviceId:t.deviceId,ok:!0,result:n.value}):o.push({deviceId:t.deviceId,ok:!1,error:n.reason})}}return o}summary(){let e={},t={},n={},r=0,i=0;for(let t of this.bindings.values())for(let n of t.entries)e[n.capName]=(e[n.capName]??0)+1;for(let e of this.devices.values())t[e.addonId]=(t[e.addonId]??0)+1,n[e.type]=(n[e.type]??0)+1,e.online?r++:i++;return{totalDevices:this.bindings.size,online:r,offline:i,byCap:e,byAddon:t,byType:n,statedDevices:this.stateMirror.size}}dump(e){let t=e=>{let t=this.devices.get(e)??null,n=this.bindings.get(e)??null,r={},i=this.stateMirror.get(e);if(i)for(let[e,t]of i)r[e]={...t};return{deviceId:e,info:t,binding:n?{...n,entries:n.entries.map(e=>({...e}))}:null,state:r}};if(e!==void 0)return t(e);let n=[];for(let e of this.bindings.keys())n.push(t(e));return n}getRawMirror(){return this.stateMirror}getSystemState(){let e=new Map;for(let[t,n]of this.stateMirror){let r=new Map;for(let[e,t]of n)r.set(e,{...t});e.set(t,r)}return e}subscribeBus(){if(!this.api.live?.onEvent)return;let e=this.api.live.onEvent;this.bridges.push(e.subscribe({category:DU},{onData:e=>{let t=e.data;!t||typeof t.deviceId!=`number`||typeof t.capName!=`string`||this.applyStateUpdate(t.deviceId,t.capName,t.slice)}})),this.bridges.push(e.subscribe({category:OU},{onData:e=>{let t=e.data,n=typeof t?.deviceId==`number`?t.deviceId:t?.source?.type===`device`&&typeof t.source.id==`number`?t.source.id:null;n!==null&&this.refreshBinding(n)}})),this.bridges.push(e.subscribe({category:kU},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.refreshDeviceMetadata(t.deviceId,`added`)}})),this.bridges.push(e.subscribe({category:AU},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.applyDeviceRemoval(t.deviceId)}})),this.bridges.push(e.subscribe({category:jU},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.refreshDeviceMetadata(t.deviceId,`updated`)}}))}applyStateUpdate(e,t,n){let r=this.stateMirror.get(e);r||(r=new Map,this.stateMirror.set(e,r)),n===void 0?r.delete(t):r.set(t,n);let i=`${e}:${t}`,a=this.handleListeners.get(i);if(a)for(let e of a)try{e(n)}catch{}for(let r of this.globalStateListeners)try{r(e,t,n)}catch{}let o=this.capListeners.get(t);if(o)for(let t of o)try{t(e,n)}catch{}let s=this.deviceListeners.get(e);if(s)for(let r of s)try{r(e,t,n)}catch{}}applyDeviceRemoval(e){let t=this.devices.get(e)??null;this.bindings.delete(e),this.devices.delete(e),this.stateMirror.delete(e);for(let n of this.removedListeners)try{n(e,t)}catch{}}async refreshBinding(e){try{let t=await this.api.deviceManager.getBindings.query({deviceId:e});if(t.entries.length>0){this.bindings.set(e,t);return}if(await this.api.deviceManager.getDevice.query({deviceId:e})===null){this.applyDeviceRemoval(e);return}this.bindings.set(e,t)}catch{}}async refreshDeviceMetadata(e,t){try{let n=await this.api.deviceManager.getDevice.query({deviceId:e});if(!n)return;let r=!this.devices.has(e);if(this.devices.set(e,n),t===`added`&&r){await this.refreshBinding(e);for(let t of this.addedListeners)try{t(e,n)}catch{}}}catch{}}};function NU(e,t){return Array.isArray(t)?t.includes(e):e===t}function PU(e){return Array.isArray(e)?e:[e]}function FU(e,t){return typeof t==`string`?e===t:t instanceof RegExp?t.test(e):`exact`in t?e===t.exact:`contains`in t?e.toLowerCase().includes(t.contains.toLowerCase()):!1}function IU(e){return e.def}function LU(e){return e}function RU(e,t=`Configuration`,n=`main`){return{sections:[{id:n,title:t,fields:e.map(e=>zU(e.key,e.schema,e.description))}]}}function zU(e,t,n){let r=WU(t),i=GU(t),a={key:e,label:n??KU(e),description:n,default:i};return r instanceof ne?BU(e,a):r instanceof te?VU(r,a):r instanceof ae?{...a,type:`boolean`}:r instanceof le?UU(r,a):r instanceof ue||r instanceof se?{...a,type:`textarea`,rows:6,isJson:!0}:{...a,type:`text`}}function BU(e,t){let n=e.toLowerCase();return n.includes(`password`)||n.includes(`secret`)||n.includes(`token`)||n.includes(`apikey`)||n.includes(`api_key`)?{...t,type:`password`,showToggle:!0}:{...t,type:`text`}}function VU(e,t){let n=LU(e),r=n.minValue,i=n.maxValue,a=r!=null&&isFinite(r)?r:void 0,o=i!=null&&isFinite(i)?i:void 0,s=HU(e);return{...t,type:`number`,...a===void 0?{}:{min:a},...o===void 0?{}:{max:o},...s===void 0?{}:{step:s}}}function HU(e){let t=IU(e).checks??[];for(let e of t)if(e._zod?.def?.check===`multiple_of`&&e._zod.def.value!==void 0)return e._zod.def.value}function UU(e,t){let n=e.options.map(e=>String(e));return{...t,type:`select`,options:n.map(e=>({label:KU(e),value:e}))}}function WU(e){return e instanceof ee||e instanceof pe||e instanceof de?WU(IU(e).innerType):e}function GU(e){if(e instanceof ee)return IU(e).defaultValue}function KU(e){return e.replace(/([A-Z])/g,` $1`).replace(/[_-]/g,` `).replace(/^\w/,e=>e.toUpperCase()).trim()}var qU=`accessories.air-quality-sensor.alarm-panel.ambient-light-sensor.automation-control.battery.binary.brightness.broker.camera-credentials.carbon-monoxide.climate-control.color.connectivity.consumables.contact.control.cover.day-night.device-adoption.device-discovery.device-export.device-status.doorbell.enum-sensor.event-emitter.fan-control.feature-probe.flood.gas.humidifier.humidity-sensor.image.image-settings.intercom.lawn-mower-control.lock-control.media-player.motion.motion-trigger.motion-zones.mqtt-broker.native-object-detection.navigation.network-link.notifier.numeric-sensor.osd.pet-feeder.power-meter.presence.pressure-sensor.privacy-mask.ptz.ptz-autotrack.recording-archive.recording-onboard.recording-signal.scene-monitor.script-runner.smoke.snapshot.stream-params.switch.tamper.temperature-sensor.update.vacuum-control.valve.vibration.water-heater.weather`.split(`.`),JU={accessories:`accessories`,addonPages:`addon-pages`,addonPagesSource:`addon-pages-source`,addonRoutes:`addon-routes`,addonSettings:`addon-settings`,addonWidgets:`addon-widgets`,addonWidgetsSource:`addon-widgets-source`,addons:`addons`,adminUi:`admin-ui`,airQualitySensor:`air-quality-sensor`,alarmPanel:`alarm-panel`,alerts:`alerts`,ambientLightSensor:`ambient-light-sensor`,audioAnalysis:`audio-analysis`,audioAnalyzer:`audio-analyzer`,audioCodec:`audio-codec`,audioMetrics:`audio-metrics`,authProvider:`auth-provider`,automationControl:`automation-control`,backup:`backup`,battery:`battery`,binary:`binary`,brightness:`brightness`,broker:`broker`,button:`button`,cameraCredentials:`camera-credentials`,cameraGridLayout:`camera-grid-layout`,cameraPipelineConfig:`camera-pipeline-config`,cameraStreams:`camera-streams`,carbonMonoxide:`carbon-monoxide`,climateControl:`climate-control`,color:`color`,composer:`composer`,connectionTest:`connection-test`,connectivity:`connectivity`,consumables:`consumables`,contact:`contact`,control:`control`,coreBlocks:`core-blocks`,cover:`cover`,customModelRegistry:`custom-model-registry`,dataStoreProvider:`data-store-provider`,databaseSnapshot:`database-snapshot`,dayNight:`day-night`,decoder:`decoder`,detectionPipeline:`detection-pipeline`,deviceAdminLink:`device-admin-link`,deviceAdoption:`device-adoption`,deviceDiscovery:`device-discovery`,deviceExport:`device-export`,deviceExtension:`device-extension`,deviceManager:`device-manager`,deviceOps:`device-ops`,deviceProvider:`device-provider`,deviceState:`device-state`,deviceStatus:`device-status`,doorbell:`doorbell`,embeddingEncoder:`embedding-encoder`,enumSensor:`enum-sensor`,eventEmitter:`event-emitter`,faceGallery:`face-gallery`,failureContribution:`failure-contribution`,fanControl:`fan-control`,featureProbe:`feature-probe`,filesystemBrowse:`filesystem-browse`,flood:`flood`,gas:`gas`,humidifier:`humidifier`,humiditySensor:`humidity-sensor`,image:`image`,imageSettings:`image-settings`,integrations:`integrations`,intercom:`intercom`,lawnMowerControl:`lawn-mower-control`,llm:`llm`,llmRuntime:`llm-runtime`,loadContribution:`load-contribution`,localNetwork:`local-network`,lockControl:`lock-control`,logChannels:`log-channels`,logDestination:`log-destination`,loginMethod:`login-method`,mediaPlayer:`media-player`,meshNetwork:`mesh-network`,metricsProvider:`metrics-provider`,modelConvert:`model-convert`,modelDistributor:`model-distributor`,motion:`motion`,motionDetection:`motion-detection`,motionTrigger:`motion-trigger`,motionZones:`motion-zones`,mqttBroker:`mqtt-broker`,nativeObjectDetection:`native-object-detection`,navigation:`navigation`,networkAccess:`network-access`,networkLink:`network-link`,networkQuality:`network-quality`,nodes:`nodes`,notificationOutput:`notification-output`,notificationRules:`notification-rules`,notifier:`notifier`,numericSensor:`numeric-sensor`,oauthIntegration:`oauth-integration`,osd:`osd`,osdManager:`osd-manager`,petFeeder:`pet-feeder`,pipelineAnalytics:`pipeline-analytics`,pipelineExecutor:`pipeline-executor`,pipelineOrchestrator:`pipeline-orchestrator`,pipelineRunner:`pipeline-runner`,plateGallery:`plate-gallery`,platformProbe:`platform-probe`,powerMeter:`power-meter`,presence:`presence`,pressureSensor:`pressure-sensor`,privacyMask:`privacy-mask`,ptz:`ptz`,ptzAutotrack:`ptz-autotrack`,reboot:`reboot`,recording:`recording`,recordingArchive:`recording-archive`,recordingExport:`recording-export`,recordingOnboard:`recording-onboard`,recordingSignal:`recording-signal`,sceneMonitor:`scene-monitor`,scriptRunner:`script-runner`,serverManagement:`server-management`,settingsStore:`settings-store`,smoke:`smoke`,smtpProvider:`smtp-provider`,snapshot:`snapshot`,ssoBridge:`sso-bridge`,storage:`storage`,storageEvictable:`storage-evictable`,storageMigration:`storage-migration`,storageOccupancy:`storage-occupancy`,storageProvider:`storage-provider`,streamBroker:`stream-broker`,streamCatalog:`stream-catalog`,streamParams:`stream-params`,streamSignals:`stream-signals`,switch:`switch`,system:`system`,tamper:`tamper`,temperatureSensor:`temperature-sensor`,terminalSession:`terminal-session`,toast:`toast`,turnProvider:`turn-provider`,update:`update`,userManagement:`user-management`,userPasskeys:`user-passkeys`,vacuumControl:`vacuum-control`,valve:`valve`,vectorStore:`vector-store`,vibration:`vibration`,videoclips:`videoclips`,viewerUi:`viewer-ui`,waterHeater:`water-heater`,weather:`weather`,webrtcSession:`webrtc-session`,zoneAnalytics:`zone-analytics`,zoneRules:`zone-rules`,zones:`zones`},YU=[{key:`accessories`,name:`accessories`},{key:`addonPages`,name:`addon-pages`},{key:`addonPagesSource`,name:`addon-pages-source`},{key:`addonRoutes`,name:`addon-routes`},{key:`addonSettings`,name:`addon-settings`},{key:`addonWidgets`,name:`addon-widgets`},{key:`addonWidgetsSource`,name:`addon-widgets-source`},{key:`addons`,name:`addons`},{key:`adminUi`,name:`admin-ui`},{key:`airQualitySensor`,name:`air-quality-sensor`},{key:`alarmPanel`,name:`alarm-panel`},{key:`alerts`,name:`alerts`},{key:`ambientLightSensor`,name:`ambient-light-sensor`},{key:`audioAnalysis`,name:`audio-analysis`},{key:`audioAnalyzer`,name:`audio-analyzer`},{key:`audioCodec`,name:`audio-codec`},{key:`audioMetrics`,name:`audio-metrics`},{key:`authProvider`,name:`auth-provider`},{key:`automationControl`,name:`automation-control`},{key:`backup`,name:`backup`},{key:`battery`,name:`battery`},{key:`binary`,name:`binary`},{key:`brightness`,name:`brightness`},{key:`broker`,name:`broker`},{key:`button`,name:`button`},{key:`cameraCredentials`,name:`camera-credentials`},{key:`cameraGridLayout`,name:`camera-grid-layout`},{key:`cameraPipelineConfig`,name:`camera-pipeline-config`},{key:`cameraStreams`,name:`camera-streams`},{key:`carbonMonoxide`,name:`carbon-monoxide`},{key:`climateControl`,name:`climate-control`},{key:`color`,name:`color`},{key:`composer`,name:`composer`},{key:`connectionTest`,name:`connection-test`},{key:`connectivity`,name:`connectivity`},{key:`consumables`,name:`consumables`},{key:`contact`,name:`contact`},{key:`control`,name:`control`},{key:`coreBlocks`,name:`core-blocks`},{key:`cover`,name:`cover`},{key:`customModelRegistry`,name:`custom-model-registry`},{key:`dataStoreProvider`,name:`data-store-provider`},{key:`databaseSnapshot`,name:`database-snapshot`},{key:`dayNight`,name:`day-night`},{key:`decoder`,name:`decoder`},{key:`detectionPipeline`,name:`detection-pipeline`},{key:`deviceAdminLink`,name:`device-admin-link`},{key:`deviceAdoption`,name:`device-adoption`},{key:`deviceDiscovery`,name:`device-discovery`},{key:`deviceExport`,name:`device-export`},{key:`deviceExtension`,name:`device-extension`},{key:`deviceManager`,name:`device-manager`},{key:`deviceOps`,name:`device-ops`},{key:`deviceProvider`,name:`device-provider`},{key:`deviceState`,name:`device-state`},{key:`deviceStatus`,name:`device-status`},{key:`doorbell`,name:`doorbell`},{key:`embeddingEncoder`,name:`embedding-encoder`},{key:`enumSensor`,name:`enum-sensor`},{key:`eventEmitter`,name:`event-emitter`},{key:`faceGallery`,name:`face-gallery`},{key:`failureContribution`,name:`failure-contribution`},{key:`fanControl`,name:`fan-control`},{key:`featureProbe`,name:`feature-probe`},{key:`filesystemBrowse`,name:`filesystem-browse`},{key:`flood`,name:`flood`},{key:`gas`,name:`gas`},{key:`humidifier`,name:`humidifier`},{key:`humiditySensor`,name:`humidity-sensor`},{key:`image`,name:`image`},{key:`imageSettings`,name:`image-settings`},{key:`integrations`,name:`integrations`},{key:`intercom`,name:`intercom`},{key:`lawnMowerControl`,name:`lawn-mower-control`},{key:`llm`,name:`llm`},{key:`llmRuntime`,name:`llm-runtime`},{key:`loadContribution`,name:`load-contribution`},{key:`localNetwork`,name:`local-network`},{key:`lockControl`,name:`lock-control`},{key:`logChannels`,name:`log-channels`},{key:`logDestination`,name:`log-destination`},{key:`loginMethod`,name:`login-method`},{key:`mediaPlayer`,name:`media-player`},{key:`meshNetwork`,name:`mesh-network`},{key:`metricsProvider`,name:`metrics-provider`},{key:`modelConvert`,name:`model-convert`},{key:`modelDistributor`,name:`model-distributor`},{key:`motion`,name:`motion`},{key:`motionDetection`,name:`motion-detection`},{key:`motionTrigger`,name:`motion-trigger`},{key:`motionZones`,name:`motion-zones`},{key:`mqttBroker`,name:`mqtt-broker`},{key:`nativeObjectDetection`,name:`native-object-detection`},{key:`navigation`,name:`navigation`},{key:`networkAccess`,name:`network-access`},{key:`networkLink`,name:`network-link`},{key:`networkQuality`,name:`network-quality`},{key:`nodes`,name:`nodes`},{key:`notificationOutput`,name:`notification-output`},{key:`notificationRules`,name:`notification-rules`},{key:`notifier`,name:`notifier`},{key:`numericSensor`,name:`numeric-sensor`},{key:`oauthIntegration`,name:`oauth-integration`},{key:`osd`,name:`osd`},{key:`osdManager`,name:`osd-manager`},{key:`petFeeder`,name:`pet-feeder`},{key:`pipelineAnalytics`,name:`pipeline-analytics`},{key:`pipelineExecutor`,name:`pipeline-executor`},{key:`pipelineOrchestrator`,name:`pipeline-orchestrator`},{key:`pipelineRunner`,name:`pipeline-runner`},{key:`plateGallery`,name:`plate-gallery`},{key:`platformProbe`,name:`platform-probe`},{key:`powerMeter`,name:`power-meter`},{key:`presence`,name:`presence`},{key:`pressureSensor`,name:`pressure-sensor`},{key:`privacyMask`,name:`privacy-mask`},{key:`ptz`,name:`ptz`},{key:`ptzAutotrack`,name:`ptz-autotrack`},{key:`reboot`,name:`reboot`},{key:`recording`,name:`recording`},{key:`recordingArchive`,name:`recording-archive`},{key:`recordingExport`,name:`recording-export`},{key:`recordingOnboard`,name:`recording-onboard`},{key:`recordingSignal`,name:`recording-signal`},{key:`sceneMonitor`,name:`scene-monitor`},{key:`scriptRunner`,name:`script-runner`},{key:`serverManagement`,name:`server-management`},{key:`settingsStore`,name:`settings-store`},{key:`smoke`,name:`smoke`},{key:`smtpProvider`,name:`smtp-provider`},{key:`snapshot`,name:`snapshot`},{key:`ssoBridge`,name:`sso-bridge`},{key:`storage`,name:`storage`},{key:`storageEvictable`,name:`storage-evictable`},{key:`storageMigration`,name:`storage-migration`},{key:`storageOccupancy`,name:`storage-occupancy`},{key:`storageProvider`,name:`storage-provider`},{key:`streamBroker`,name:`stream-broker`},{key:`streamCatalog`,name:`stream-catalog`},{key:`streamParams`,name:`stream-params`},{key:`streamSignals`,name:`stream-signals`},{key:`switch`,name:`switch`},{key:`system`,name:`system`},{key:`tamper`,name:`tamper`},{key:`temperatureSensor`,name:`temperature-sensor`},{key:`terminalSession`,name:`terminal-session`},{key:`toast`,name:`toast`},{key:`turnProvider`,name:`turn-provider`},{key:`update`,name:`update`},{key:`userManagement`,name:`user-management`},{key:`userPasskeys`,name:`user-passkeys`},{key:`vacuumControl`,name:`vacuum-control`},{key:`valve`,name:`valve`},{key:`vectorStore`,name:`vector-store`},{key:`vibration`,name:`vibration`},{key:`videoclips`,name:`videoclips`},{key:`viewerUi`,name:`viewer-ui`},{key:`waterHeater`,name:`water-heater`},{key:`weather`,name:`weather`},{key:`webrtcSession`,name:`webrtc-session`},{key:`zoneAnalytics`,name:`zone-analytics`},{key:`zoneRules`,name:`zone-rules`},{key:`zones`,name:`zones`}],XU=[Ej,Fd,Ld,Vd,qd,ef,Qd,iM,nn,oM,Gx,of,cM,sf,Tf,Nf,pM,Ff,hM,tp,_M,yM,xM,Sp,SM,TM,jM,Cp,Zp,NM,IM,VM,qm,KM,JM,$M,tN,aN,Cg,cN,Tg,Fg,Uf,mN,zg,Bg,Ug,y_,o_,O_,Lv,hv,hn,G_,Hv,gN,yN,oy,SN,TN,IN,ly,zN,VN,fy,UN,GN,qN,YN,ZN,oP,hP,yP,CP,Xy,Ly,eb,IP,zP,nb,ab,db,WP,JP,jb,Nb,Ib,QP,zb,tF,oF,Zb,mF,OF,tx,PF,RF,nI,_x,aw,lI,dI,_w,_I,TI,jI,KE,ED,rk,hO,LI,$I,tL,iL,oL,fL,SL,DL,OL,BL,sR,kR,HR,dz,Fz,Bz,Ck,Ng,Hz,Ok,jk,Nk,Fk,Rk,zk,Vk,$k,Kp,Gz,Qz,nA,iB,FB,LB,zB,dA,VB,pA,UB,nV,hA,oV,lV,BA,dV,pj,dn,pV,hV,wj,wV,EV,ND],ZU=Object.freeze({"accessories.getStatus":{capName:`accessories`,capScope:`device`,addonId:null,access:`view`},"accessories.setChildHidden":{capName:`accessories`,capScope:`device`,addonId:null,access:`create`},"addonPages.listPages":{capName:`addon-pages`,capScope:`system`,addonId:null,access:`view`},"addonPagesSource.listPages":{capName:`addon-pages-source`,capScope:`system`,addonId:null,access:`view`},"addonRoutes.getRoutes":{capName:`addon-routes`,capScope:`system`,addonId:null,access:`view`},"addonRoutes.invoke":{capName:`addon-routes`,capScope:`system`,addonId:null,access:`create`},"addons.applyAutoUpdateToAll":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.cancelJob":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.custom":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.forceRefresh":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.getAddonAutoUpdate":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getAutoUpdateSettings":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getJob":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getLastRestart":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getLogs":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getVersions":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.installFromWorkspace":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.installPackage":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.isWorkspaceAvailable":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.list":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listCapabilityProviders":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listFrameworkPackages":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listJobs":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listPackages":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listUpdates":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listWorkspacePackages":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.onAddonLogs":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.reloadPackages":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.restartAddon":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.restartServer":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.retryLoad":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.rollbackPackage":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.searchAvailable":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.setAddonAutoUpdate":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.setAutoUpdateSettings":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.setCapabilityProviderEnabled":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.startJob":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.uninstallPackage":{capName:`addons`,capScope:`system`,addonId:null,access:`delete`},"addons.updatePackage":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addonSettings.getDeviceSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`view`},"addonSettings.getGlobalSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`view`},"addonSettings.getIntegrationSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`view`},"addonSettings.updateDeviceSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`create`},"addonSettings.updateGlobalSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`create`},"addonWidgets.listWidgets":{capName:`addon-widgets`,capScope:`system`,addonId:null,access:`view`},"addonWidgetsSource.listWidgets":{capName:`addon-widgets-source`,capScope:`system`,addonId:null,access:`view`},"adminUi.getStaticDir":{capName:`admin-ui`,capScope:`system`,addonId:null,access:`view`},"adminUi.getVersion":{capName:`admin-ui`,capScope:`system`,addonId:null,access:`view`},"airQualitySensor.getStatus":{capName:`air-quality-sensor`,capScope:`device`,addonId:null,access:`view`},"alarmPanel.arm":{capName:`alarm-panel`,capScope:`device`,addonId:null,access:`create`},"alarmPanel.disarm":{capName:`alarm-panel`,capScope:`device`,addonId:null,access:`create`},"alarmPanel.getStatus":{capName:`alarm-panel`,capScope:`device`,addonId:null,access:`view`},"alarmPanel.trigger":{capName:`alarm-panel`,capScope:`device`,addonId:null,access:`create`},"alerts.dismiss":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.emit":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.getUnreadCount":{capName:`alerts`,capScope:`system`,addonId:null,access:`view`},"alerts.list":{capName:`alerts`,capScope:`system`,addonId:null,access:`view`},"alerts.markAllRead":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.markRead":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.update":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"ambientLightSensor.getStatus":{capName:`ambient-light-sensor`,capScope:`device`,addonId:null,access:`view`},"audioAnalysis.applyDeviceSettingsPatch":{capName:`audio-analysis`,capScope:`device`,addonId:null,access:`create`},"audioAnalysis.getDeviceLiveContribution":{capName:`audio-analysis`,capScope:`device`,addonId:null,access:`view`},"audioAnalysis.getDeviceSettingsContribution":{capName:`audio-analysis`,capScope:`device`,addonId:null,access:`view`},"audioAnalysis.resolveDeviceSettings":{capName:`audio-analysis`,capScope:`device`,addonId:null,access:`view`},"audioAnalyzer.analyseChunk":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`create`},"audioAnalyzer.attachDevice":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`create`},"audioAnalyzer.classify":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`view`},"audioAnalyzer.detachDevice":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`create`},"audioAnalyzer.dispose":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`create`},"audioAnalyzer.isReady":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`view`},"audioAnalyzer.reprobeAudioEngine":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`create`},"audioCodec.canHandle":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.closeSession":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.createDecodeSession":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.createEncodeSession":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.flushEncode":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.listActiveSessions":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.listSupportedCodecs":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.pullEncoded":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.pullPcm":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.pushEncodedFrame":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.pushPcm":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioMetrics.getCurrentSnapshot":{capName:`audio-metrics`,capScope:`device`,addonId:null,access:`view`},"audioMetrics.getHistory":{capName:`audio-metrics`,capScope:`device`,addonId:null,access:`view`},"authProvider.getLoginUrl":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`view`},"authProvider.handleCallback":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`create`},"authProvider.validateCredentials":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`create`},"authProvider.validateToken":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`view`},"automationControl.disable":{capName:`automation-control`,capScope:`device`,addonId:null,access:`create`},"automationControl.enable":{capName:`automation-control`,capScope:`device`,addonId:null,access:`create`},"automationControl.getStatus":{capName:`automation-control`,capScope:`device`,addonId:null,access:`view`},"automationControl.trigger":{capName:`automation-control`,capScope:`device`,addonId:null,access:`create`},"backup.cancel":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"backup.delete":{capName:`backup`,capScope:`system`,addonId:null,access:`delete`},"backup.deleteSchedule":{capName:`backup`,capScope:`system`,addonId:null,access:`delete`},"backup.getEntries":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.list":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listArchives":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listDestinations":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listLocations":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listRuns":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listSchedules":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.previewSchedule":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.restore":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"backup.trigger":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"backup.upsertDestinationPolicy":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"backup.upsertSchedule":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"battery.getStatus":{capName:`battery`,capScope:`device`,addonId:null,access:`view`},"battery.wakeForStream":{capName:`battery`,capScope:`device`,addonId:null,access:`create`},"binary.getStatus":{capName:`binary`,capScope:`device`,addonId:null,access:`view`},"brightness.getStatus":{capName:`brightness`,capScope:`device`,addonId:null,access:`view`},"brightness.setBrightness":{capName:`brightness`,capScope:`device`,addonId:null,access:`create`},"broker.add":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.get":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getBrokerConfig":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getSettings":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getSettingsSchema":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getState":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getStatus":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.list":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.listProviders":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.publish":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.remove":{capName:`broker`,capScope:`system`,addonId:null,access:`delete`},"broker.setSettings":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.subscribe":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.testConnection":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.testSettings":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.unsubscribe":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"button.press":{capName:`button`,capScope:`device`,addonId:null,access:`create`},"cameraCredentials.getCredentials":{capName:`camera-credentials`,capScope:`device`,addonId:null,access:`view`},"cameraCredentials.getStatus":{capName:`camera-credentials`,capScope:`device`,addonId:null,access:`view`},"cameraGridLayout.applyDeviceSettingsPatch":{capName:`camera-grid-layout`,capScope:`device`,addonId:null,access:`create`},"cameraGridLayout.getDeviceLiveContribution":{capName:`camera-grid-layout`,capScope:`device`,addonId:null,access:`view`},"cameraGridLayout.getDeviceSettingsContribution":{capName:`camera-grid-layout`,capScope:`device`,addonId:null,access:`view`},"cameraGridLayout.getLayout":{capName:`camera-grid-layout`,capScope:`device`,addonId:null,access:`view`},"cameraGridLayout.saveLayout":{capName:`camera-grid-layout`,capScope:`device`,addonId:null,access:`create`},"cameraPipelineConfig.applyDeviceSettingsPatch":{capName:`camera-pipeline-config`,capScope:`device`,addonId:null,access:`create`},"cameraPipelineConfig.getDeviceLiveContribution":{capName:`camera-pipeline-config`,capScope:`device`,addonId:null,access:`view`},"cameraPipelineConfig.getDeviceSettingsContribution":{capName:`camera-pipeline-config`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getBrokerStreams":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getCameraStreams":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getProfileRtspEntries":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getRtspEntries":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.pickStream":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"carbonMonoxide.getStatus":{capName:`carbon-monoxide`,capScope:`device`,addonId:null,access:`view`},"climateControl.getStatus":{capName:`climate-control`,capScope:`device`,addonId:null,access:`view`},"climateControl.setFanMode":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setMode":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setPreset":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setSwingHorizontal":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setSwingVertical":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setTarget":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setTargetHumidity":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setTargetRange":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"color.getStatus":{capName:`color`,capScope:`device`,addonId:null,access:`view`},"color.setColor":{capName:`color`,capScope:`device`,addonId:null,access:`create`},"composer.applyBlocks":{capName:`composer`,capScope:`system`,addonId:null,access:`create`},"composer.getStates":{capName:`composer`,capScope:`system`,addonId:null,access:`view`},"connectionTest.describeTest":{capName:`connection-test`,capScope:`system`,addonId:null,access:`view`},"connectionTest.testSettings":{capName:`connection-test`,capScope:`system`,addonId:null,access:`create`},"connectivity.getStatus":{capName:`connectivity`,capScope:`device`,addonId:null,access:`view`},"consumables.getStatus":{capName:`consumables`,capScope:`device`,addonId:null,access:`view`},"consumables.reset":{capName:`consumables`,capScope:`device`,addonId:null,access:`delete`},"contact.getStatus":{capName:`contact`,capScope:`device`,addonId:null,access:`view`},"control.getStatus":{capName:`control`,capScope:`device`,addonId:null,access:`view`},"control.setValue":{capName:`control`,capScope:`device`,addonId:null,access:`create`},"coreBlocks.compile":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.create":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.createComposition":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.delete":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`delete`},"coreBlocks.get":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.getComposition":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.getCustomization":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.getTypeDefs":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.list":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.listComposableCaps":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.listCompositions":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.restart":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.setEnabled":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.update":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.updateComposition":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.validateComposition":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"cover.close":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.getStatus":{capName:`cover`,capScope:`device`,addonId:null,access:`view`},"cover.open":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.setPosition":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.setTiltPosition":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.stop":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"customModelRegistry.listModels":{capName:`custom-model-registry`,capScope:`system`,addonId:null,access:`view`},"databaseSnapshot.listDatabases":{capName:`database-snapshot`,capScope:`system`,addonId:null,access:`view`},"databaseSnapshot.writeSnapshot":{capName:`database-snapshot`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.aggregate":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.count":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.declareCollection":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.delete":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`delete`},"dataStoreProvider.deleteWhere":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`delete`},"dataStoreProvider.get":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.getEngineInfo":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.histogram":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.insert":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.insertMany":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.isEmpty":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.query":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.set":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.update":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.updateWhere":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.upsert":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dayNight.getOptions":{capName:`day-night`,capScope:`device`,addonId:null,access:`view`},"dayNight.getStatus":{capName:`day-night`,capScope:`device`,addonId:null,access:`view`},"dayNight.setSettings":{capName:`day-night`,capScope:`device`,addonId:null,access:`create`},"decoder.createSession":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.destroySession":{capName:`decoder`,capScope:`system`,addonId:null,access:`delete`},"decoder.getFrame":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.getInfo":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.getShmStats":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.getStats":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.listActiveSessions":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.openStream":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.pullFrames":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.pullHandles":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.pushPacket":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.reprobeHwaccel":{capName:`decoder`,capScope:`system`,addonId:null,access:`create`},"decoder.supportsCodec":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.updateConfig":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"detectionPipeline.applyDeviceSettingsPatch":{capName:`detection-pipeline`,capScope:`device`,addonId:null,access:`create`},"detectionPipeline.getDeviceLiveContribution":{capName:`detection-pipeline`,capScope:`device`,addonId:null,access:`view`},"detectionPipeline.getDeviceSettingsContribution":{capName:`detection-pipeline`,capScope:`device`,addonId:null,access:`view`},"deviceAdminLink.getAdminLink":{capName:`device-admin-link`,capScope:`device`,addonId:null,access:`view`},"deviceAdoption.adopt":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.getCandidate":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.getStatus":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.listCandidateFilters":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.listCandidates":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.refresh":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.release":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.resync":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceDiscovery.adoptDevice":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceDiscovery.getStatus":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`view`},"deviceDiscovery.listDiscovered":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`view`},"deviceDiscovery.refreshDiscovery":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceDiscovery.releaseDevice":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceExport.applyDeviceSettingsPatch":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceExport.exposeDevice":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceExport.getDeviceLiveContribution":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.getDeviceSettingsContribution":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.getStatus":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.listExposedDevices":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.listSupportedDeviceKinds":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.unexposeDevice":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceExtension.listCandidates":{capName:`device-extension`,capScope:`device`,addonId:null,access:`view`},"deviceExtension.listSlots":{capName:`device-extension`,capScope:`device`,addonId:null,access:`view`},"deviceExtension.listSources":{capName:`device-extension`,capScope:`device`,addonId:null,access:`view`},"deviceExtension.setSlot":{capName:`device-extension`,capScope:`device`,addonId:null,access:`create`},"deviceManager.addLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionAdopt":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionCancelJob":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionListCandidateFilters":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionListCandidates":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionListJobs":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionRefresh":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionRelease":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionResync":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionStartJob":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.allocateDeviceId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.applyInitialMeta":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.createDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.disable":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverAllProviders":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverDevices":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverProvider":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoveryProviders":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.enable":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.getAllBindings":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getBindings":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getBindingsBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getChildren":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getChildrenBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getConfigSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getCreationSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceLiveInfoAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceSettingsAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceStatusAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceStatusAggregateBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getLinkedDevices":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getLinkedDevicesBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getRoleDisplayDefaults":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getSettingsSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getStreamProfileMap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getStreamSources":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getWireableFields":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getWrapperActivation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listAll":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listBindableCapsForDeviceType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listDeviceIdsByCaps":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listLocationDescriptions":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listLocationIcons":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listLocations":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listPersistedByAddon":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listSiteZones":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listWrappersForCap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadMeta":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadRuntimeState":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.migrateDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.persistConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.probeStreams":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.providerCreationType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.providerDiscoveryParamsSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.registerDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.remove":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeByIntegration":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeSiteZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.renameLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.renameSiteZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.runDeviceAction":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setChildLayout":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setDisabled":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setDisplay":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setIntegrationId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLinkDeviceId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocationDescription":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocationIcon":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocationZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setMetadata":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setName":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setPrimaryChildEntityId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setRole":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setRoleDisplayDefaults":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setSiteZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setStreamProfileMap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setWrapperActive":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.testCreationField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.testField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateDeviceField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateDeviceFieldsBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceOps.getConfigEntries":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getRawState":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getSettingsSchema":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getStreamSources":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.removeDevice":{capName:`device-ops`,capScope:`device`,addonId:null,access:`delete`},"deviceOps.runAction":{capName:`device-ops`,capScope:`device`,addonId:null,access:`create`},"deviceOps.setConfig":{capName:`device-ops`,capScope:`device`,addonId:null,access:`create`},"deviceProvider.adoptDiscoveredDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.createDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.discoverDevices":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.getChildCreationSchema":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getDevices":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getDiscoveryParamsSchema":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getManualCreationType":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getStatus":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.reloadDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.start":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.stop":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.supportsDiscovery":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.supportsManualCreation":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.testCreationField":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceState.claimFields":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceState.getAllSnapshots":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getNativeCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getSnapshot":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.listClaims":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.patchOwnedFields":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceState.releaseClaim":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceState.setCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceStatus.getStatus":{capName:`device-status`,capScope:`device`,addonId:null,access:`view`},"doorbell.getStatus":{capName:`doorbell`,capScope:`device`,addonId:null,access:`view`},"embeddingEncoder.encode":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.encodeText":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.getInfo":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.resetFailedModels":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`delete`},"enumSensor.getStatus":{capName:`enum-sensor`,capScope:`device`,addonId:null,access:`view`},"eventEmitter.getStatus":{capName:`event-emitter`,capScope:`device`,addonId:null,access:`view`},"faceGallery.assignFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.assignFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.auditIdentitySamples":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.createIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.deleteFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.deleteIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.getFaceByTrack":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.getFaceMedia":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listIdentities":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listIdentitySamples":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listRecentFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.removeSample":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.renameIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.suggestFaceClusters":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.unassignFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.unassignFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"failureContribution.list":{capName:`failure-contribution`,capScope:`system`,addonId:null,access:`view`},"fanControl.getStatus":{capName:`fan-control`,capScope:`device`,addonId:null,access:`view`},"fanControl.setDirection":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setOscillating":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setPercentage":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setPreset":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"featureProbe.getStatus":{capName:`feature-probe`,capScope:`device`,addonId:null,access:`view`},"filesystemBrowse.browse":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`view`},"filesystemBrowse.createDir":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`create`},"filesystemBrowse.listAllowedRoots":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`view`},"flood.getStatus":{capName:`flood`,capScope:`device`,addonId:null,access:`view`},"gas.getStatus":{capName:`gas`,capScope:`device`,addonId:null,access:`view`},"humidifier.getStatus":{capName:`humidifier`,capScope:`device`,addonId:null,access:`view`},"humidifier.setMode":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humidifier.setOn":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humidifier.setTargetHumidity":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humiditySensor.getStatus":{capName:`humidity-sensor`,capScope:`device`,addonId:null,access:`view`},"image.getStatus":{capName:`image`,capScope:`device`,addonId:null,access:`view`},"imageSettings.getOptions":{capName:`image-settings`,capScope:`device`,addonId:null,access:`view`},"imageSettings.getStatus":{capName:`image-settings`,capScope:`device`,addonId:null,access:`view`},"imageSettings.setSettings":{capName:`image-settings`,capScope:`device`,addonId:null,access:`create`},"integrations.create":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.delete":{capName:`integrations`,capScope:`system`,addonId:null,access:`delete`},"integrations.get":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getAvailableTypes":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getByAddonId":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getSettings":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.list":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.setSettings":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.testConnection":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.update":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"intercom.endTalkSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.getStatus":{capName:`intercom`,capScope:`device`,addonId:null,access:`view`},"intercom.handleAnswer":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.pushTalkAudio":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.startSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.startTalkSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.stopSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"lawnMowerControl.dock":{capName:`lawn-mower-control`,capScope:`device`,addonId:null,access:`create`},"lawnMowerControl.getStatus":{capName:`lawn-mower-control`,capScope:`device`,addonId:null,access:`view`},"lawnMowerControl.pause":{capName:`lawn-mower-control`,capScope:`device`,addonId:null,access:`create`},"lawnMowerControl.startMowing":{capName:`lawn-mower-control`,capScope:`device`,addonId:null,access:`create`},"llm.cancel":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.deleteModel":{capName:`llm`,capScope:`system`,addonId:null,access:`delete`},"llm.deleteProfile":{capName:`llm`,capScope:`system`,addonId:null,access:`delete`},"llm.generate":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.generateVision":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.getDefaults":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.getRuntimeStatus":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.getUsage":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.installModel":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.listModelCatalog":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.listModels":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.listNodeModels":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.listProfileKinds":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.listProfiles":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.listRuntimeNodes":{capName:`llm`,capScope:`system`,addonId:null,access:`view`},"llm.resolveModelRef":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.setDefault":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.startRuntime":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.stopRuntime":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.testProfile":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llm.upsertProfile":{capName:`llm`,capScope:`system`,addonId:null,access:`create`},"llmRuntime.appleAvailability":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`view`},"llmRuntime.cancel":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`create`},"llmRuntime.complete":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`create`},"llmRuntime.completeApple":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`create`},"llmRuntime.deleteModel":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`delete`},"llmRuntime.ensureStarted":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`create`},"llmRuntime.getDiskUsage":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`view`},"llmRuntime.installModel":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`create`},"llmRuntime.listLocalModels":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`view`},"llmRuntime.status":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`view`},"llmRuntime.stop":{capName:`llm-runtime`,capScope:`system`,addonId:null,access:`create`},"loadContribution.list":{capName:`load-contribution`,capScope:`system`,addonId:null,access:`view`},"localNetwork.downloadCa":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getAllowedAddresses":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getConnectionEndpoints":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getNotificationEndpoint":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getPreferred":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getTlsStatus":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getViewerEndpoints":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.list":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.regenerateCertificate":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"localNetwork.resetAllowlistToBestMatch":{capName:`local-network`,capScope:`system`,addonId:null,access:`delete`},"localNetwork.revertToGeneratedCertificate":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"localNetwork.setAllowedAddresses":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"localNetwork.setNotificationEndpoint":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"localNetwork.setViewerEndpoints":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"localNetwork.uploadCertificate":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"lockControl.getStatus":{capName:`lock-control`,capScope:`device`,addonId:null,access:`view`},"lockControl.lock":{capName:`lock-control`,capScope:`device`,addonId:null,access:`create`},"lockControl.open":{capName:`lock-control`,capScope:`device`,addonId:null,access:`create`},"lockControl.unlock":{capName:`lock-control`,capScope:`device`,addonId:null,access:`create`},"logChannels.apply":{capName:`log-channels`,capScope:`system`,addonId:null,access:`create`},"logChannels.list":{capName:`log-channels`,capScope:`system`,addonId:null,access:`view`},"logDestination.query":{capName:`log-destination`,capScope:`system`,addonId:null,access:`view`},"logDestination.write":{capName:`log-destination`,capScope:`system`,addonId:null,access:`create`},"loginMethod.getLoginMethods":{capName:`login-method`,capScope:`system`,addonId:null,access:`view`},"mediaPlayer.getStatus":{capName:`media-player`,capScope:`device`,addonId:null,access:`view`},"mediaPlayer.next":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.pause":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.play":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.playMedia":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.previous":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.seek":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.selectSource":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setMute":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setRepeat":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setShuffle":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setVolume":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.stop":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"meshNetwork.getStatus":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`view`},"meshNetwork.join":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.leave":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.listPeers":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`view`},"meshNetwork.logout":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.startLogin":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.testConnection":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"metricsProvider.collectSnapshot":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getAddonStats":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getCached":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getCpuTemperature":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getCurrent":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getDiskSpace":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getGpuInfo":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getLoadSeries":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getProcessStats":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.listAddonInstances":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.listNodeProcesses":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"modelConvert.convert":{capName:`model-convert`,capScope:`system`,addonId:null,access:`create`},"modelDistributor.distributeModel":{capName:`model-distributor`,capScope:`system`,addonId:null,access:`create`},"motion.getStatus":{capName:`motion`,capScope:`device`,addonId:null,access:`view`},"motion.isDetected":{capName:`motion`,capScope:`device`,addonId:null,access:`view`},"motionDetection.analyze":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`create`},"motionDetection.applyDeviceSettingsPatch":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`create`},"motionDetection.getDeviceLiveContribution":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`view`},"motionDetection.getDeviceSettingsContribution":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`view`},"motionDetection.removeCamera":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`delete`},"motionDetection.reset":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`delete`},"motionTrigger.getStatus":{capName:`motion-trigger`,capScope:`device`,addonId:null,access:`view`},"motionTrigger.setMotionTrigger":{capName:`motion-trigger`,capScope:`device`,addonId:null,access:`create`},"motionZones.getOptions":{capName:`motion-zones`,capScope:`device`,addonId:null,access:`view`},"motionZones.getStatus":{capName:`motion-zones`,capScope:`device`,addonId:null,access:`view`},"motionZones.setZone":{capName:`motion-zones`,capScope:`device`,addonId:null,access:`create`},"mqttBroker.addBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"mqttBroker.getBrokerConfig":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`view`},"mqttBroker.getStatus":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`view`},"mqttBroker.listBrokers":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`view`},"mqttBroker.removeBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`delete`},"mqttBroker.startEmbeddedBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"mqttBroker.stopEmbeddedBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"mqttBroker.testConnection":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"nativeObjectDetection.getOptions":{capName:`native-object-detection`,capScope:`device`,addonId:null,access:`view`},"nativeObjectDetection.getStatus":{capName:`native-object-detection`,capScope:`device`,addonId:null,access:`view`},"nativeObjectDetection.setEnabled":{capName:`native-object-detection`,capScope:`device`,addonId:null,access:`create`},"nativeObjectDetection.setSettings":{capName:`native-object-detection`,capScope:`device`,addonId:null,access:`create`},"navigation.getFeatures":{capName:`navigation`,capScope:`device`,addonId:null,access:`view`},"navigation.getStatus":{capName:`navigation`,capScope:`device`,addonId:null,access:`view`},"navigation.goToPoint":{capName:`navigation`,capScope:`device`,addonId:null,access:`create`},"navigation.listActions":{capName:`navigation`,capScope:`device`,addonId:null,access:`view`},"navigation.move":{capName:`navigation`,capScope:`device`,addonId:null,access:`create`},"navigation.playSound":{capName:`navigation`,capScope:`device`,addonId:null,access:`create`},"navigation.runAction":{capName:`navigation`,capScope:`device`,addonId:null,access:`create`},"navigation.setLightLevel":{capName:`navigation`,capScope:`device`,addonId:null,access:`create`},"navigation.setLightMode":{capName:`navigation`,capScope:`device`,addonId:null,access:`create`},"navigation.setLightOn":{capName:`navigation`,capScope:`device`,addonId:null,access:`create`},"navigation.stop":{capName:`navigation`,capScope:`device`,addonId:null,access:`create`},"networkAccess.getEndpoint":{capName:`network-access`,capScope:`system`,addonId:null,access:`view`},"networkAccess.getStatus":{capName:`network-access`,capScope:`system`,addonId:null,access:`view`},"networkAccess.listEndpoints":{capName:`network-access`,capScope:`system`,addonId:null,access:`view`},"networkAccess.start":{capName:`network-access`,capScope:`system`,addonId:null,access:`create`},"networkAccess.stop":{capName:`network-access`,capScope:`system`,addonId:null,access:`create`},"networkLink.getStatus":{capName:`network-link`,capScope:`device`,addonId:null,access:`view`},"networkQuality.getAllStats":{capName:`network-quality`,capScope:`system`,addonId:null,access:`view`},"networkQuality.getDeviceStats":{capName:`network-quality`,capScope:`system`,addonId:null,access:`view`},"networkQuality.reportClientStats":{capName:`network-quality`,capScope:`system`,addonId:null,access:`create`},"nodes.clusterAddonStatus":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.deployAddon":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.directory":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.executeQuery":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.getCapUsageGraph":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.getNodeAddons":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.renameNode":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.restartAddon":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.restartNode":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.restartProcess":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.setProcessLogLevel":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.shutdownNode":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.topology":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.undeployAddon":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"notificationOutput.deleteTarget":{capName:`notification-output`,capScope:`system`,addonId:null,access:`delete`},"notificationOutput.discoverTargets":{capName:`notification-output`,capScope:`system`,addonId:null,access:`view`},"notificationOutput.listTargetKinds":{capName:`notification-output`,capScope:`system`,addonId:null,access:`view`},"notificationOutput.listTargets":{capName:`notification-output`,capScope:`system`,addonId:null,access:`view`},"notificationOutput.send":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"notificationOutput.setTargetEnabled":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"notificationOutput.testTarget":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"notificationOutput.upsertTarget":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"notificationRules.cancelSnooze":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.createRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.createSnooze":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.deleteRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`delete`},"notificationRules.getAlarmConfig":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getAlarmSensors":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getClipRetentionAsks":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getConditionCatalog":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getHistory":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getRuleLastRuns":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getTemplateCatalog":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.listDeviceMutes":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.listRules":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.listSnoozes":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.previewStateSummary":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.previewTemplate":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.resolveArtifactUrl":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.setAlarmConfig":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.setDeviceMuted":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.setRuleEnabled":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.testRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.updateRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notifier.cancel":{capName:`notifier`,capScope:`device`,addonId:null,access:`create`},"notifier.getStatus":{capName:`notifier`,capScope:`device`,addonId:null,access:`view`},"notifier.send":{capName:`notifier`,capScope:`device`,addonId:null,access:`create`},"numericSensor.getStatus":{capName:`numeric-sensor`,capScope:`device`,addonId:null,access:`view`},"oauthIntegration.getDescriptor":{capName:`oauth-integration`,capScope:`system`,addonId:null,access:`view`},"osd.getStatus":{capName:`osd`,capScope:`device`,addonId:null,access:`view`},"osd.setOverlay":{capName:`osd`,capScope:`device`,addonId:null,access:`create`},"osdManager.clearSlotBinding":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`delete`},"osdManager.copyDeviceConfiguration":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`create`},"osdManager.getConditionSupport":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`view`},"osdManager.getDeviceOsd":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`view`},"osdManager.getSourceCatalog":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`view`},"osdManager.previewSlot":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`create`},"osdManager.renderDevice":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`create`},"osdManager.setSlotBinding":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`create`},"petFeeder.callPet":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.cancelFeed":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.feed":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.getStatus":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`view`},"petFeeder.markFoodReplenished":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.playSound":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.resetDesiccant":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`delete`},"petFeeder.setChildLock":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.setFeedSound":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.setIndicatorLight":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"petFeeder.setVolume":{capName:`pet-feeder`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.applyDeviceSettingsPatch":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.cancelRelocateMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.cancelStorageMigrationMove":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.clearTrackRelation":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.clearTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.completeRetrainTrack":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.countRelocatableMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.countUnstampedEventMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.deleteDeviceEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.deleteTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.deselectRetrainFrame":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.getActiveTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getAudioEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getDeviceLiveContribution":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getDeviceSettingsContribution":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getEventDensity":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getEventDensityBatch":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getEventMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getEventMediaFootprintByKind":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getEventStoreFootprint":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getKeyEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getKeyEventsBatch":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getMediaReclaimStatus":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getMotionEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getObjectEmbeddingRebuildStatus":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getObjectEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getRetrainExportUrl":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getRetrainFrameImage":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getSensorEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getStorageMigrationMoveStatus":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrack":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrackMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrainingExportSummary":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrainingExportUrl":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listArchivedDebugNotes":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listBirthDecisions":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listEventKinds":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listEventKindsBatch":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listEventMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listOpsLog":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRecentTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRelocateMediaJobs":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainAnnotations":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainFrames":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainStaging":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTrackMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTrackRelations":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.ownersWithMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.pauseForStorageMigration":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.proposeRetrainAnnotations":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.pruneEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.pruneEventsBefore":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.pruneTracksBefore":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.readLongTermSeries":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.rebuildObjectEmbeddings":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.reclaimDebugMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.reconcileFromDisk":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.refreshStorageLocationsForMigration":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.relocateMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.restageRetrainTrack":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.resumeForStorageMigration":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.saveRetrainAnnotations":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.searchObjectEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.selectRetrainFrames":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.setTrackFlags":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.setTrackPurity":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.setTrackRelation":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.startStorageMigrationMove":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.wipeAllAnalytics":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.wipeObjectEmbeddings":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineExecutor.cacheFrameInPool":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.clearDeviceOverrides":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.deleteModel":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.deleteTemplate":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.downloadModel":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.getAddonModels":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getAudioCapabilities":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getAvailableEngines":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getCapabilities":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getDefaultSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getDetectionConfigSchema":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getEffectiveTuning":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getEngineProvisioning":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getGlobalPipelineConfig":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getGlobalSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getInferenceDeviceHealth":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getOrchestratorConfigSchema":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getReferenceAudio":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getReferenceAudioFiles":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getReferenceImage":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getSchema":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getSelectedEngine":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getVideoPipelineSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.inferCached":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.killEngine":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.listLoadedEngines":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.listReferenceImages":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.listTemplates":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.rearmInferenceDevice":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.runAudioTest":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.runPipeline":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.runPipelineBatch":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.saveTemplate":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.setVideoPipelineSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.spinEngine":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.uncacheFrame":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.updateTemplate":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.validatePipeline":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.applyDeviceSettingsPatch":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.assignAudio":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.assignPipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.deleteTemplate":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.getAgentLoad":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAgentSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAudioAssignment":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAudioAssignments":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAudioNodeLoad":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraMetrics":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraStatus":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraStatuses":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraStepOverrides":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraSwitches":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCapabilityBindings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getClusterModelChoice":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getDeviceLiveContribution":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getDeviceSettingsContribution":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getGlobalMetrics":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getIngestOwner":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getNodeInferenceDevices":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getPipelineAssignment":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getPipelineAssignments":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getPipelineDevicePin":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getReconcileFromDiskStatus":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.listAgentSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.listTemplates":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.pauseForStorageMigration":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.rebalance":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.reconcileFromDisk":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.removeAgentSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.requestOccupancyLook":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.resetNodePipelineDefaults":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.resolvePipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.resumeForStorageMigration":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.saveTemplate":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentCapabilities":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentDecodeLimits":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentDetectWeight":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentInferenceDevices":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentMaxCameras":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentReachableHost":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraPipelineForAgent":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraSensors":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraStepOverride":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraStepToggle":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraSwitch":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCapabilityBinding":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setPipelineDevicePin":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.unassignAudio":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.unassignPipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.updateTemplate":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.attachCamera":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.detachCamera":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.getAllCameraMetrics":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getCameraMetrics":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getLocalCameras":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getLocalLoad":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getLocalMetrics":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getNativeCrop":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getParkedTrackFrame":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.parkTrackFrame":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.releaseParkedTrackFrames":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.reportMotion":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.requestOccupancyBurst":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.runDetailSubtree":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.runStatelessStep":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"plateGallery.assignPlate":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.assignPlates":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.correctPlateText":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.createVehicle":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.deletePlate":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`delete`},"plateGallery.deleteVehicle":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`delete`},"plateGallery.getPlateByTrack":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.getPlateMedia":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.listPlates":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.listVehicles":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.listVehicleSamples":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.removeVehicleSample":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`delete`},"plateGallery.renameVehicle":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.searchPlates":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.suggestPlateClusters":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.unassignPlate":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.unassignPlates":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"platformProbe.getCapabilities":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"platformProbe.getHardware":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"platformProbe.resolveHwAccel":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"platformProbe.resolveInferenceConfig":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"powerMeter.getStatus":{capName:`power-meter`,capScope:`device`,addonId:null,access:`view`},"presence.getStatus":{capName:`presence`,capScope:`device`,addonId:null,access:`view`},"pressureSensor.getStatus":{capName:`pressure-sensor`,capScope:`device`,addonId:null,access:`view`},"privacyMask.getOptions":{capName:`privacy-mask`,capScope:`device`,addonId:null,access:`view`},"privacyMask.getStatus":{capName:`privacy-mask`,capScope:`device`,addonId:null,access:`view`},"privacyMask.setAudioEnabled":{capName:`privacy-mask`,capScope:`device`,addonId:null,access:`create`},"privacyMask.setMask":{capName:`privacy-mask`,capScope:`device`,addonId:null,access:`create`},"ptz.captureHomeHere":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.continuousMove":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.deletePreset":{capName:`ptz`,capScope:`device`,addonId:null,access:`delete`},"ptz.getHomePreset":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.getHomeReturn":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.getOptions":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.getPosition":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.getPresets":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.getStatus":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.goHome":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.goToPreset":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.move":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.savePreset":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.setAutofocus":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.setHomePreset":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.setHomeReturn":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.stop":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptzAutotrack.getSettings":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`view`},"ptzAutotrack.getStatus":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`view`},"ptzAutotrack.setEnabled":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`create`},"ptzAutotrack.setSettings":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`create`},"reboot.reboot":{capName:`reboot`,capScope:`device`,addonId:null,access:`create`},"recording.getAvailability":{capName:`recording`,capScope:`device`,addonId:null,access:`view`},"recording.getDaysWithRecordings":{capName:`recording`,capScope:`device`,addonId:null,access:`view`},"recording.getPlayback":{capName:`recording`,capScope:`device`,addonId:null,access:`view`},"recording.getPlaybackOptions":{capName:`recording`,capScope:`device`,addonId:null,access:`view`},"recording.listSources":{capName:`recording`,capScope:`device`,addonId:null,access:`view`},"recordingArchive.applyDeviceSettingsPatch":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.cancelRelocateJob":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.cancelStorageMigrationMove":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.deleteFootprint":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`delete`},"recordingArchive.getAvailabilityBatch":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.getDaysWithRecordingsBatch":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.getDeviceConfig":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.getDeviceLiveContribution":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.getDeviceSettingsContribution":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.getPlacement":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.getRelocateResidue":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.getStatus":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.getStorageMigrationMoveStatus":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.getStorageUsage":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.listOpsLog":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.listRelocateJobs":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.locateSegment":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.pauseForStorageMigration":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.planStorageRebalance":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.pruneFootage":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.readGopBytes":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.readSegmentBytes":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.readWindowBytes":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`view`},"recordingArchive.reconcileLedgerAgainstDisk":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.refreshStorageLocationsForMigration":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.relocateFootage":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.renderClip":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.renderGif":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.rescanStorage":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.resumeForStorageMigration":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.setDeviceConfig":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.setDevicePlacement":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.startStorageMigrationMove":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingArchive.startStorageRebalance":{capName:`recording-archive`,capScope:`system`,addonId:null,access:`create`},"recordingExport.cancelExport":{capName:`recording-export`,capScope:`system`,addonId:null,access:`create`},"recordingExport.createExport":{capName:`recording-export`,capScope:`system`,addonId:null,access:`create`},"recordingExport.deleteExport":{capName:`recording-export`,capScope:`system`,addonId:null,access:`delete`},"recordingExport.getDownloadUrl":{capName:`recording-export`,capScope:`system`,addonId:null,access:`view`},"recordingExport.getExport":{capName:`recording-export`,capScope:`system`,addonId:null,access:`view`},"recordingExport.listExports":{capName:`recording-export`,capScope:`system`,addonId:null,access:`view`},"recordingExport.readExportBytes":{capName:`recording-export`,capScope:`system`,addonId:null,access:`view`},"recordingOnboard.getOptions":{capName:`recording-onboard`,capScope:`device`,addonId:null,access:`view`},"recordingOnboard.getStatus":{capName:`recording-onboard`,capScope:`device`,addonId:null,access:`view`},"recordingOnboard.setSettings":{capName:`recording-onboard`,capScope:`device`,addonId:null,access:`create`},"recordingSignal.getStatus":{capName:`recording-signal`,capScope:`device`,addonId:null,access:`view`},"sceneMonitor.captureReference":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`create`},"sceneMonitor.createScene":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`create`},"sceneMonitor.deleteReference":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`delete`},"sceneMonitor.deleteScene":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`delete`},"sceneMonitor.getStatus":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`view`},"sceneMonitor.listScenes":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`view`},"sceneMonitor.listScenesBatch":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`view`},"sceneMonitor.recheckNow":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`create`},"sceneMonitor.resetScene":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`delete`},"sceneMonitor.updateScene":{capName:`scene-monitor`,capScope:`device`,addonId:null,access:`create`},"scriptRunner.getStatus":{capName:`script-runner`,capScope:`device`,addonId:null,access:`view`},"scriptRunner.run":{capName:`script-runner`,capScope:`device`,addonId:null,access:`create`},"scriptRunner.stop":{capName:`script-runner`,capScope:`device`,addonId:null,access:`create`},"serverManagement.applyServerUpdate":{capName:`server-management`,capScope:`system`,addonId:null,access:`create`},"serverManagement.checkServerUpdate":{capName:`server-management`,capScope:`system`,addonId:null,access:`create`},"serverManagement.getServerPackageStatus":{capName:`server-management`,capScope:`system`,addonId:null,access:`view`},"serverManagement.restartServer":{capName:`server-management`,capScope:`system`,addonId:null,access:`create`},"serverManagement.rollbackServerUpdate":{capName:`server-management`,capScope:`system`,addonId:null,access:`create`},"settingsStore.aggregate":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.count":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.declareCollection":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.delete":{capName:`settings-store`,capScope:`system`,addonId:null,access:`delete`},"settingsStore.deleteWhere":{capName:`settings-store`,capScope:`system`,addonId:null,access:`delete`},"settingsStore.get":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.histogram":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.insert":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.insertMany":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.isEmpty":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.query":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.set":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.update":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.updateWhere":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.upsert":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"smoke.getStatus":{capName:`smoke`,capScope:`device`,addonId:null,access:`view`},"smtpProvider.getStatus":{capName:`smtp-provider`,capScope:`system`,addonId:null,access:`view`},"smtpProvider.sendEmail":{capName:`smtp-provider`,capScope:`system`,addonId:null,access:`create`},"smtpProvider.verify":{capName:`smtp-provider`,capScope:`system`,addonId:null,access:`view`},"snapshot.applyDeviceSettingsPatch":{capName:`snapshot`,capScope:`device`,addonId:null,access:`create`},"snapshot.getDebugState":{capName:`snapshot`,capScope:`device`,addonId:null,access:`view`},"snapshot.getDeviceLiveContribution":{capName:`snapshot`,capScope:`device`,addonId:null,access:`view`},"snapshot.getDeviceSettingsContribution":{capName:`snapshot`,capScope:`device`,addonId:null,access:`view`},"snapshot.getSnapshot":{capName:`snapshot`,capScope:`device`,addonId:null,access:`view`},"snapshot.getSnapshotLinks":{capName:`snapshot`,capScope:`device`,addonId:null,access:`view`},"snapshot.getSnapshotOverview":{capName:`snapshot`,capScope:`device`,addonId:null,access:`view`},"snapshot.getStatus":{capName:`snapshot`,capScope:`device`,addonId:null,access:`view`},"snapshot.invalidateCache":{capName:`snapshot`,capScope:`device`,addonId:null,access:`create`},"ssoBridge.signBridgeToken":{capName:`sso-bridge`,capScope:`system`,addonId:null,access:`view`},"ssoBridge.verifyBridgeToken":{capName:`sso-bridge`,capScope:`system`,addonId:null,access:`view`},"storage.abortUpload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.beginDownload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.beginUpload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.delete":{capName:`storage`,capScope:`system`,addonId:null,access:`delete`},"storage.deleteLocation":{capName:`storage`,capScope:`system`,addonId:null,access:`delete`},"storage.endDownload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.exists":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.finalizeUpload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.getAvailableSpace":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.list":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.listDrainProgress":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.listLocationDeclarations":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.listLocations":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.listProviders":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.read":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.readChunk":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.resolve":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.testConfig":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.testLocation":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.upsertLocation":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.write":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.writeChunk":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storageEvictable.evict":{capName:`storage-evictable`,capScope:`system`,addonId:null,access:`create`},"storageEvictable.getEvictableUsage":{capName:`storage-evictable`,capScope:`system`,addonId:null,access:`view`},"storageMigration.cancel":{capName:`storage-migration`,capScope:`system`,addonId:null,access:`create`},"storageMigration.cleanupCancel":{capName:`storage-migration`,capScope:`system`,addonId:null,access:`create`},"storageMigration.cleanupStart":{capName:`storage-migration`,capScope:`system`,addonId:null,access:`create`},"storageMigration.cleanupStatus":{capName:`storage-migration`,capScope:`system`,addonId:null,access:`view`},"storageMigration.drain":{capName:`storage-migration`,capScope:`system`,addonId:null,access:`create`},"storageMigration.history":{capName:`storage-migration`,capScope:`system`,addonId:null,access:`view`},"storageMigration.movers":{capName:`storage-migration`,capScope:`system`,addonId:null,access:`view`},"storageMigration.plan":{capName:`storage-migration`,capScope:`system`,addonId:null,access:`view`},"storageMigration.residue":{capName:`storage-migration`,capScope:`system`,addonId:null,access:`view`},"storageMigration.start":{capName:`storage-migration`,capScope:`system`,addonId:null,access:`create`},"storageMigration.status":{capName:`storage-migration`,capScope:`system`,addonId:null,access:`view`},"storageOccupancy.getOccupancy":{capName:`storage-occupancy`,capScope:`system`,addonId:null,access:`view`},"storageProvider.abortUpload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.beginDownload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.beginUpload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.delete":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`delete`},"storageProvider.endDownload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.exists":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.finalizeUpload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.getAvailableSpace":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.getProviderInfo":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.list":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.read":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.readChunk":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.resolve":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.testLocation":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.write":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.writeChunk":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"streamBroker.acquireEgressTranscode":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.applyDeviceSettingsPatch":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.assignProfile":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.fetchEventMedia":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.forgetDeviceHardware":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`delete`},"streamBroker.getAllRtspEntries":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getBrokerStats":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getDeviceAudioMute":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getDeviceLiveContribution":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getDeviceSettingsContribution":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getPreBufferInfo":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getRtspEntry":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getRtspPort":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getStreamUrl":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getStreamWithCodec":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.isRtspEnabled":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.killClient":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.listAllCameraStreams":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.listAllProfileSlots":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.listClients":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.probeStream":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.produceEventMedia":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.publishCameraStream":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.pullAudioChunks":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.pullFrameHandles":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.regenerateRtspToken":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.releaseEgressTranscode":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.releaseStreamWithCodec":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.renderPreBufferClip":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.reportStreamSignal":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.restartProfile":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.retractCameraStream":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.setDeviceAudioMute":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.setPreBufferDuration":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.setRtspEnabled":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.subscribeAudioChunks":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.subscribeFrames":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.unassignProfile":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.unsubscribeAudioChunks":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.unsubscribeFrames":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamCatalog.getCatalog":{capName:`stream-catalog`,capScope:`device`,addonId:null,access:`view`},"streamParams.getConfigSchema":{capName:`stream-params`,capScope:`device`,addonId:null,access:`view`},"streamParams.getOptions":{capName:`stream-params`,capScope:`device`,addonId:null,access:`view`},"streamParams.getStatus":{capName:`stream-params`,capScope:`device`,addonId:null,access:`view`},"streamParams.setProfile":{capName:`stream-params`,capScope:`device`,addonId:null,access:`create`},"streamSignals.listSignals":{capName:`stream-signals`,capScope:`device`,addonId:null,access:`view`},"switch.getStatus":{capName:`switch`,capScope:`device`,addonId:null,access:`view`},"switch.setState":{capName:`switch`,capScope:`device`,addonId:null,access:`create`},"system.detectSiteLocation":{capName:`system`,capScope:`system`,addonId:null,access:`create`},"system.featureFlags":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.forceRetentionCleanup":{capName:`system`,capScope:`system`,addonId:null,access:`create`},"system.getFailureContributions":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.getLoadContributions":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.getLoggingSettings":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.getRequestCensus":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.getRetentionConfig":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.getSiteLocation":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.health":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.info":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.networkAddresses":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.setLoggingSettings":{capName:`system`,capScope:`system`,addonId:null,access:`create`},"system.setRetentionConfig":{capName:`system`,capScope:`system`,addonId:null,access:`create`},"system.setSiteLocation":{capName:`system`,capScope:`system`,addonId:null,access:`create`},"tamper.getStatus":{capName:`tamper`,capScope:`device`,addonId:null,access:`view`},"temperatureSensor.getStatus":{capName:`temperature-sensor`,capScope:`device`,addonId:null,access:`view`},"terminalSession.adoptLegacyMonitor":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"terminalSession.close":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"terminalSession.createInstance":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"terminalSession.deleteInstance":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`delete`},"terminalSession.listInstances":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`view`},"terminalSession.listLegacyCameras":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`view`},"terminalSession.listProfiles":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`view`},"terminalSession.listSessions":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`view`},"terminalSession.openSession":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"terminalSession.pullOutput":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"terminalSession.resize":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"terminalSession.setInstanceEnabled":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"terminalSession.updateInstance":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"terminalSession.writeInput":{capName:`terminal-session`,capScope:`system`,addonId:null,access:`create`},"toast.onToast":{capName:`toast`,capScope:`system`,addonId:null,access:`view`},"turnProvider.getTurnServers":{capName:`turn-provider`,capScope:`system`,addonId:null,access:`view`},"update.getStatus":{capName:`update`,capScope:`device`,addonId:null,access:`view`},"update.installUpdate":{capName:`update`,capScope:`device`,addonId:null,access:`create`},"userManagement.confirmTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.createApiKey":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.createScopedToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.createUser":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.deleteUser":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.disableTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.getTotpStatus":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listApiKeys":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listOauthSessions":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listScopedTokens":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listUsers":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.oauthExchangeCode":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.oauthIssueCode":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.oauthRefresh":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.oauthVerifyAccessToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.resetPassword":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.revokeApiKey":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.revokeOauthSession":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.revokeScopedToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.setupTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.setUserScopes":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.updateUser":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.validateApiKey":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.validateCredentials":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.validateScopedToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.verifyTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.beginAuthentication":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.beginDiscoverableAuthentication":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.beginRegistration":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`create`},"userPasskeys.finishAuthentication":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.finishDiscoverableAuthentication":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.finishRegistration":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`create`},"userPasskeys.getSecondFactorPreference":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.listPasskeys":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.removePasskey":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`delete`},"userPasskeys.setSecondFactorPreference":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`create`},"vacuumControl.getStatus":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`view`},"vacuumControl.locate":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.pause":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.returnToBase":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.setFanSpeed":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.start":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.stop":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"valve.close":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"valve.getStatus":{capName:`valve`,capScope:`device`,addonId:null,access:`view`},"valve.open":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"valve.setPosition":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"valve.stop":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"vectorStore.declareIndex":{capName:`vector-store`,capScope:`system`,addonId:null,access:`create`},"vectorStore.deleteByFilter":{capName:`vector-store`,capScope:`system`,addonId:null,access:`delete`},"vectorStore.deleteByIds":{capName:`vector-store`,capScope:`system`,addonId:null,access:`delete`},"vectorStore.fetchByIds":{capName:`vector-store`,capScope:`system`,addonId:null,access:`view`},"vectorStore.getByIds":{capName:`vector-store`,capScope:`system`,addonId:null,access:`view`},"vectorStore.query":{capName:`vector-store`,capScope:`system`,addonId:null,access:`view`},"vectorStore.scan":{capName:`vector-store`,capScope:`system`,addonId:null,access:`view`},"vectorStore.stats":{capName:`vector-store`,capScope:`system`,addonId:null,access:`view`},"vectorStore.upsert":{capName:`vector-store`,capScope:`system`,addonId:null,access:`create`},"vibration.getStatus":{capName:`vibration`,capScope:`device`,addonId:null,access:`view`},"videoclips.dialClipStream":{capName:`videoclips`,capScope:`device`,addonId:null,access:`view`},"videoclips.getClipPlayback":{capName:`videoclips`,capScope:`device`,addonId:null,access:`view`},"videoclips.getPlaybackOptions":{capName:`videoclips`,capScope:`device`,addonId:null,access:`view`},"videoclips.listClips":{capName:`videoclips`,capScope:`device`,addonId:null,access:`view`},"videoclips.listSources":{capName:`videoclips`,capScope:`device`,addonId:null,access:`view`},"videoclips.offerClipBytes":{capName:`videoclips`,capScope:`device`,addonId:null,access:`view`},"videoclips.readClipBytes":{capName:`videoclips`,capScope:`device`,addonId:null,access:`view`},"viewerUi.getStaticDir":{capName:`viewer-ui`,capScope:`system`,addonId:null,access:`view`},"viewerUi.getVersion":{capName:`viewer-ui`,capScope:`system`,addonId:null,access:`view`},"waterHeater.getStatus":{capName:`water-heater`,capScope:`device`,addonId:null,access:`view`},"waterHeater.setAway":{capName:`water-heater`,capScope:`device`,addonId:null,access:`create`},"waterHeater.setOperationMode":{capName:`water-heater`,capScope:`device`,addonId:null,access:`create`},"waterHeater.setTargetTemp":{capName:`water-heater`,capScope:`device`,addonId:null,access:`create`},"weather.getStatus":{capName:`weather`,capScope:`device`,addonId:null,access:`view`},"webrtcSession.addIceCandidate":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.closeSession":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.createSession":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.getIceCandidates":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"webrtcSession.getSessionDebug":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"webrtcSession.getSessionState":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"webrtcSession.handleAnswer":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.handleOffer":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.hasAdaptiveBitrate":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"webrtcSession.listStreams":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getCameraHistory":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getCurrentSnapshot":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getCurrentSnapshotBatch":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getUnzonedHistory":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getZoneHistory":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneRules.listRules":{capName:`zone-rules`,capScope:`device`,addonId:null,access:`view`},"zoneRules.setRules":{capName:`zone-rules`,capScope:`device`,addonId:null,access:`create`},"zones.addZone":{capName:`zones`,capScope:`device`,addonId:null,access:`create`},"zones.listZones":{capName:`zones`,capScope:`device`,addonId:null,access:`view`},"zones.removeZone":{capName:`zones`,capScope:`device`,addonId:null,access:`delete`},"zones.updateZone":{capName:`zones`,capScope:`device`,addonId:null,access:`create`}}),QU=`accessories.addon-pages.addon-pages-source.addon-routes.addon-settings.addon-widgets.addon-widgets-source.addons.admin-ui.air-quality-sensor.alarm-panel.alerts.ambient-light-sensor.audio-analysis.audio-analyzer.audio-codec.audio-metrics.auth-provider.automation-control.backup.battery.binary.brightness.broker.button.camera-credentials.camera-grid-layout.camera-pipeline-config.camera-streams.carbon-monoxide.climate-control.color.composer.connection-test.connectivity.consumables.contact.control.core-blocks.cover.custom-model-registry.data-store-provider.database-snapshot.day-night.decoder.detection-pipeline.device-admin-link.device-adoption.device-discovery.device-export.device-extension.device-manager.device-ops.device-provider.device-state.device-status.doorbell.embedding-encoder.enum-sensor.event-emitter.face-gallery.failure-contribution.fan-control.feature-probe.filesystem-browse.flood.gas.humidifier.humidity-sensor.image.image-settings.integrations.intercom.lawn-mower-control.llm.llm-runtime.load-contribution.local-network.lock-control.log-channels.log-destination.login-method.media-player.mesh-network.metrics-provider.model-convert.model-distributor.motion.motion-detection.motion-trigger.motion-zones.mqtt-broker.native-object-detection.navigation.network-access.network-link.network-quality.nodes.notification-output.notification-rules.notifier.numeric-sensor.oauth-integration.osd.osd-manager.pet-feeder.pipeline-analytics.pipeline-executor.pipeline-orchestrator.pipeline-runner.plate-gallery.platform-probe.power-meter.presence.pressure-sensor.privacy-mask.ptz.ptz-autotrack.reboot.recording.recording-archive.recording-export.recording-onboard.recording-signal.scene-monitor.script-runner.server-management.settings-store.smoke.smtp-provider.snapshot.sso-bridge.storage.storage-evictable.storage-migration.storage-occupancy.storage-provider.stream-broker.stream-catalog.stream-params.stream-signals.switch.system.tamper.temperature-sensor.terminal-session.toast.turn-provider.update.user-management.user-passkeys.vacuum-control.valve.vector-store.vibration.videoclips.viewer-ui.water-heater.weather.webrtc-session.zone-analytics.zone-rules.zones`.split(`.`),$U=`accessories.air-quality-sensor.alarm-panel.ambient-light-sensor.audio-analysis.audio-metrics.automation-control.battery.binary.brightness.button.camera-credentials.camera-grid-layout.camera-pipeline-config.camera-streams.carbon-monoxide.climate-control.color.connectivity.consumables.contact.control.cover.day-night.detection-pipeline.device-admin-link.device-discovery.device-extension.device-ops.device-status.doorbell.enum-sensor.event-emitter.fan-control.feature-probe.flood.gas.humidifier.humidity-sensor.image.image-settings.intercom.lawn-mower-control.lock-control.media-player.motion.motion-detection.motion-trigger.motion-zones.native-object-detection.navigation.network-link.notifier.numeric-sensor.osd.pet-feeder.pipeline-analytics.power-meter.presence.pressure-sensor.privacy-mask.ptz.ptz-autotrack.reboot.recording.recording-onboard.recording-signal.scene-monitor.script-runner.smoke.snapshot.stream-catalog.stream-params.stream-signals.switch.tamper.temperature-sensor.update.vacuum-control.valve.vibration.videoclips.water-heater.weather.webrtc-session.zone-analytics.zone-rules.zones`.split(`.`),eW=`addon-pages.addon-pages-source.addon-routes.addon-settings.addon-widgets.addon-widgets-source.addons.admin-ui.alerts.audio-analyzer.audio-codec.auth-provider.backup.broker.composer.connection-test.core-blocks.custom-model-registry.data-store-provider.database-snapshot.decoder.device-adoption.device-export.device-manager.device-provider.device-state.embedding-encoder.face-gallery.failure-contribution.filesystem-browse.integrations.llm.llm-runtime.load-contribution.local-network.log-channels.log-destination.login-method.mesh-network.metrics-provider.model-convert.model-distributor.mqtt-broker.network-access.network-quality.nodes.notification-output.notification-rules.oauth-integration.osd-manager.pipeline-executor.pipeline-orchestrator.pipeline-runner.plate-gallery.platform-probe.recording-archive.recording-export.server-management.settings-store.smtp-provider.sso-bridge.storage.storage-evictable.storage-migration.storage-occupancy.storage-provider.stream-broker.system.terminal-session.toast.turn-provider.user-management.user-passkeys.vector-store.viewer-ui`.split(`.`),tW=Object.freeze({"accessories.setChildHidden":[{name:`childDeviceId`,form:`single`,optional:!1},{name:`deviceId`,form:`single`,optional:!1}],"addonSettings.getDeviceSettings":[{name:`deviceId`,form:`single`,optional:!1}],"addonSettings.updateDeviceSettings":[{name:`deviceId`,form:`single`,optional:!1}],"alarmPanel.arm":[{name:`deviceId`,form:`single`,optional:!1}],"alarmPanel.disarm":[{name:`deviceId`,form:`single`,optional:!1}],"alarmPanel.trigger":[{name:`deviceId`,form:`single`,optional:!1}],"audioAnalysis.resolveDeviceSettings":[{name:`deviceId`,form:`single`,optional:!1}],"audioAnalyzer.attachDevice":[{name:`deviceId`,form:`single`,optional:!1}],"audioAnalyzer.classify":[{name:`deviceId`,form:`single`,optional:!0}],"audioAnalyzer.detachDevice":[{name:`deviceId`,form:`single`,optional:!1}],"audioMetrics.getCurrentSnapshot":[{name:`deviceId`,form:`single`,optional:!1}],"audioMetrics.getHistory":[{name:`deviceId`,form:`single`,optional:!1}],"automationControl.disable":[{name:`deviceId`,form:`single`,optional:!1}],"automationControl.enable":[{name:`deviceId`,form:`single`,optional:!1}],"automationControl.trigger":[{name:`deviceId`,form:`single`,optional:!1}],"battery.wakeForStream":[{name:`deviceId`,form:`single`,optional:!1}],"brightness.setBrightness":[{name:`deviceId`,form:`single`,optional:!1}],"button.press":[{name:`deviceId`,form:`single`,optional:!1}],"cameraCredentials.getCredentials":[{name:`deviceId`,form:`single`,optional:!1}],"cameraGridLayout.getLayout":[{name:`deviceId`,form:`single`,optional:!1}],"cameraGridLayout.saveLayout":[{name:`cells`,form:`object-array`,optional:!1,itemField:`deviceId`},{name:`deviceId`,form:`single`,optional:!1}],"cameraStreams.getBrokerStreams":[{name:`deviceId`,form:`single`,optional:!1}],"cameraStreams.getCameraStreams":[{name:`deviceId`,form:`single`,optional:!1}],"cameraStreams.getProfileRtspEntries":[{name:`deviceId`,form:`single`,optional:!1}],"cameraStreams.getRtspEntries":[{name:`deviceId`,form:`single`,optional:!1}],"cameraStreams.pickStream":[{name:`deviceId`,form:`single`,optional:!1}],"climateControl.setFanMode":[{name:`deviceId`,form:`single`,optional:!1}],"climateControl.setMode":[{name:`deviceId`,form:`single`,optional:!1}],"climateControl.setPreset":[{name:`deviceId`,form:`single`,optional:!1}],"climateControl.setSwingHorizontal":[{name:`deviceId`,form:`single`,optional:!1}],"climateControl.setSwingVertical":[{name:`deviceId`,form:`single`,optional:!1}],"climateControl.setTarget":[{name:`deviceId`,form:`single`,optional:!1}],"climateControl.setTargetHumidity":[{name:`deviceId`,form:`single`,optional:!1}],"climateControl.setTargetRange":[{name:`deviceId`,form:`single`,optional:!1}],"color.setColor":[{name:`deviceId`,form:`single`,optional:!1}],"consumables.reset":[{name:`deviceId`,form:`single`,optional:!1}],"control.setValue":[{name:`deviceId`,form:`single`,optional:!1}],"cover.close":[{name:`deviceId`,form:`single`,optional:!1}],"cover.open":[{name:`deviceId`,form:`single`,optional:!1}],"cover.setPosition":[{name:`deviceId`,form:`single`,optional:!1}],"cover.setTiltPosition":[{name:`deviceId`,form:`single`,optional:!1}],"cover.stop":[{name:`deviceId`,form:`single`,optional:!1}],"dayNight.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"dayNight.setSettings":[{name:`deviceId`,form:`single`,optional:!1}],"decoder.createSession":[{name:`deviceId`,form:`single`,optional:!0}],"deviceAdminLink.getAdminLink":[{name:`deviceId`,form:`single`,optional:!1}],"deviceAdoption.release":[{name:`camDeviceId`,form:`single`,optional:!1}],"deviceAdoption.resync":[{name:`camDeviceId`,form:`single`,optional:!1}],"deviceDiscovery.adoptDevice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceDiscovery.listDiscovered":[{name:`deviceId`,form:`single`,optional:!1}],"deviceDiscovery.refreshDiscovery":[{name:`deviceId`,form:`single`,optional:!1}],"deviceDiscovery.releaseDevice":[{name:`childDeviceId`,form:`single`,optional:!1},{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.listCandidates":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.listSlots":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.listSources":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.setSlot":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.adoptionRelease":[{name:`camDeviceId`,form:`single`,optional:!1}],"deviceManager.adoptionResync":[{name:`camDeviceId`,form:`single`,optional:!1}],"deviceManager.applyInitialMeta":[{name:`deviceId`,form:`single`,optional:!1},{name:`linkDeviceId`,form:`single`,optional:!0}],"deviceManager.disable":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.enable":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getBindings":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getBindingsBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"deviceManager.getChildren":[{name:`parentDeviceId`,form:`single`,optional:!1}],"deviceManager.getChildrenBatch":[{name:`parentDeviceIds`,form:`array`,optional:!1}],"deviceManager.getConfigSchema":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDevice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceLiveInfoAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceSettingsAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceStatusAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceStatusAggregateBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"deviceManager.getLinkedDevices":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getLinkedDevicesBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"deviceManager.getSettingsSchema":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getStreamProfileMap":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getStreamSources":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getWireableFields":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getWrapperActivation":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.listAll":[{name:`deviceIds`,form:`array`,optional:!0}],"deviceManager.loadConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.loadMeta":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.loadRuntimeState":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.persistConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.probeStreams":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.registerDevice":[{name:`parentDeviceId`,form:`single`,optional:!0}],"deviceManager.remove":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.removeDevice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.runDeviceAction":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setChildLayout":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setDisabled":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setDisplay":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setIntegrationId":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setLinkDeviceId":[{name:`deviceId`,form:`single`,optional:!1},{name:`linkDeviceId`,form:`single`,optional:!0}],"deviceManager.setLocation":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setMetadata":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setName":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setPrimaryChildEntityId":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setRole":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setStreamProfileMap":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setType":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setWrapperActive":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.testField":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.updateConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.updateDeviceField":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.updateDeviceFieldsBatch":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getConfigEntries":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getRawState":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getSettingsSchema":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getStreamSources":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.removeDevice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.runAction":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.setConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.claimFields":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.getCapSlice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.getNativeCapSlice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.getSnapshot":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.patchOwnedFields":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.releaseClaim":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.setCapSlice":[{name:`deviceId`,form:`single`,optional:!1}],"faceGallery.getFaceByTrack":[{name:`deviceId`,form:`single`,optional:!1}],"faceGallery.listRecentFaces":[{name:`deviceId`,form:`single`,optional:!0},{name:`deviceIds`,form:`array`,optional:!0}],"fanControl.setDirection":[{name:`deviceId`,form:`single`,optional:!1}],"fanControl.setOscillating":[{name:`deviceId`,form:`single`,optional:!1}],"fanControl.setPercentage":[{name:`deviceId`,form:`single`,optional:!1}],"fanControl.setPreset":[{name:`deviceId`,form:`single`,optional:!1}],"humidifier.setMode":[{name:`deviceId`,form:`single`,optional:!1}],"humidifier.setOn":[{name:`deviceId`,form:`single`,optional:!1}],"humidifier.setTargetHumidity":[{name:`deviceId`,form:`single`,optional:!1}],"imageSettings.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"imageSettings.setSettings":[{name:`deviceId`,form:`single`,optional:!1}],"intercom.endTalkSession":[{name:`deviceId`,form:`single`,optional:!1}],"intercom.handleAnswer":[{name:`deviceId`,form:`single`,optional:!1}],"intercom.pushTalkAudio":[{name:`deviceId`,form:`single`,optional:!1}],"intercom.startSession":[{name:`deviceId`,form:`single`,optional:!1}],"intercom.startTalkSession":[{name:`deviceId`,form:`single`,optional:!1}],"intercom.stopSession":[{name:`deviceId`,form:`single`,optional:!1}],"lawnMowerControl.dock":[{name:`deviceId`,form:`single`,optional:!1}],"lawnMowerControl.pause":[{name:`deviceId`,form:`single`,optional:!1}],"lawnMowerControl.startMowing":[{name:`deviceId`,form:`single`,optional:!1}],"lockControl.lock":[{name:`deviceId`,form:`single`,optional:!1}],"lockControl.open":[{name:`deviceId`,form:`single`,optional:!1}],"lockControl.unlock":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.next":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.pause":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.play":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.playMedia":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.previous":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.seek":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.selectSource":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.setMute":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.setRepeat":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.setShuffle":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.setVolume":[{name:`deviceId`,form:`single`,optional:!1}],"mediaPlayer.stop":[{name:`deviceId`,form:`single`,optional:!1}],"motion.isDetected":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.analyze":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.removeCamera":[{name:`deviceId`,form:`single`,optional:!1}],"motionTrigger.setMotionTrigger":[{name:`deviceId`,form:`single`,optional:!1}],"motionZones.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"motionZones.setZone":[{name:`deviceId`,form:`single`,optional:!1}],"nativeObjectDetection.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"nativeObjectDetection.setEnabled":[{name:`deviceId`,form:`single`,optional:!1}],"nativeObjectDetection.setSettings":[{name:`deviceId`,form:`single`,optional:!1}],"navigation.getFeatures":[{name:`deviceId`,form:`single`,optional:!1}],"navigation.goToPoint":[{name:`deviceId`,form:`single`,optional:!1}],"navigation.listActions":[{name:`deviceId`,form:`single`,optional:!1}],"navigation.move":[{name:`deviceId`,form:`single`,optional:!1}],"navigation.playSound":[{name:`deviceId`,form:`single`,optional:!1}],"navigation.runAction":[{name:`deviceId`,form:`single`,optional:!1}],"navigation.setLightLevel":[{name:`deviceId`,form:`single`,optional:!1}],"navigation.setLightMode":[{name:`deviceId`,form:`single`,optional:!1}],"navigation.setLightOn":[{name:`deviceId`,form:`single`,optional:!1}],"navigation.stop":[{name:`deviceId`,form:`single`,optional:!1}],"networkQuality.getDeviceStats":[{name:`deviceId`,form:`single`,optional:!1}],"networkQuality.reportClientStats":[{name:`deviceId`,form:`single`,optional:!1}],"notificationRules.getAlarmSensors":[{name:`deviceIds`,form:`array`,optional:!1}],"notificationRules.setDeviceMuted":[{name:`deviceId`,form:`single`,optional:!1}],"notifier.cancel":[{name:`deviceId`,form:`single`,optional:!1}],"notifier.send":[{name:`deviceId`,form:`single`,optional:!1}],"osd.setOverlay":[{name:`deviceId`,form:`single`,optional:!1}],"osdManager.clearSlotBinding":[{name:`deviceId`,form:`single`,optional:!1}],"osdManager.copyDeviceConfiguration":[{name:`sourceDeviceId`,form:`single`,optional:!1},{name:`targetDeviceId`,form:`single`,optional:!1}],"osdManager.getDeviceOsd":[{name:`deviceId`,form:`single`,optional:!1}],"osdManager.getSourceCatalog":[{name:`deviceId`,form:`single`,optional:!1}],"osdManager.previewSlot":[{name:`deviceId`,form:`single`,optional:!1}],"osdManager.renderDevice":[{name:`deviceId`,form:`single`,optional:!1}],"osdManager.setSlotBinding":[{name:`deviceId`,form:`single`,optional:!1}],"petFeeder.callPet":[{name:`deviceId`,form:`single`,optional:!1}],"petFeeder.cancelFeed":[{name:`deviceId`,form:`single`,optional:!1}],"petFeeder.feed":[{name:`deviceId`,form:`single`,optional:!1}],"petFeeder.markFoodReplenished":[{name:`deviceId`,form:`single`,optional:!1}],"petFeeder.playSound":[{name:`deviceId`,form:`single`,optional:!1}],"petFeeder.resetDesiccant":[{name:`deviceId`,form:`single`,optional:!1}],"petFeeder.setChildLock":[{name:`deviceId`,form:`single`,optional:!1}],"petFeeder.setFeedSound":[{name:`deviceId`,form:`single`,optional:!1}],"petFeeder.setIndicatorLight":[{name:`deviceId`,form:`single`,optional:!1}],"petFeeder.setVolume":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.clearTrackRelation":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.clearTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.completeRetrainTrack":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.deleteDeviceEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.deleteTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.deselectRetrainFrame":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getActiveTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getAudioEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getEventDensity":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getEventDensityBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.getEventMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getEventMediaFootprintByKind":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.getKeyEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getKeyEventsBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.getMotionEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getObjectEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getRetrainExportUrl":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.getSensorEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getTrack":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getTrackMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getTrainingExportSummary":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.getTrainingExportUrl":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.listArchivedDebugNotes":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.listBirthDecisions":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.listEventKinds":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listEventKindsBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.listEventMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listOpsLog":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.listRecentTracks":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.listRetrainStaging":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.listTrackMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listTrackRelations":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.ownersWithMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.proposeRetrainAnnotations":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.pruneEventsBefore":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.pruneTracksBefore":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.readLongTermSeries":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.rebuildObjectEmbeddings":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.reclaimDebugMedia":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.reconcileFromDisk":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.restageRetrainTrack":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.saveRetrainAnnotations":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.searchObjectEvents":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.selectRetrainFrames":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.setTrackFlags":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.setTrackPurity":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.setTrackRelation":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.wipeAllAnalytics":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineExecutor.runPipeline":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineExecutor.runPipelineBatch":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineOrchestrator.assignAudio":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.assignPipeline":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getAudioAssignment":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getCameraMetrics":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getCameraSettings":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getCameraStatus":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getCameraStatuses":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineOrchestrator.getCameraStepOverrides":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getCameraSwitches":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getPipelineAssignment":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getPipelineDevicePin":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.requestOccupancyLook":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.resolvePipeline":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraPipelineForAgent":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraSensors":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraStepOverride":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraStepToggle":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraSwitch":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setPipelineDevicePin":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.unassignAudio":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.unassignPipeline":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineRunner.attachCamera":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineRunner.detachCamera":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineRunner.getCameraMetrics":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineRunner.getParkedTrackFrame":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineRunner.parkTrackFrame":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineRunner.releaseParkedTrackFrames":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineRunner.reportMotion":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineRunner.requestOccupancyBurst":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineRunner.runDetailSubtree":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineRunner.runStatelessStep":[{name:`sourceDeviceId`,form:`single`,optional:!1}],"plateGallery.getPlateByTrack":[{name:`deviceId`,form:`single`,optional:!1}],"plateGallery.listPlates":[{name:`deviceId`,form:`single`,optional:!0}],"privacyMask.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"privacyMask.setAudioEnabled":[{name:`deviceId`,form:`single`,optional:!1}],"privacyMask.setMask":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.captureHomeHere":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.continuousMove":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.deletePreset":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.getHomePreset":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.getHomeReturn":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.getPosition":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.getPresets":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.goHome":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.goToPreset":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.move":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.savePreset":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.setAutofocus":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.setHomePreset":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.setHomeReturn":[{name:`deviceId`,form:`single`,optional:!1}],"ptz.stop":[{name:`deviceId`,form:`single`,optional:!1}],"ptzAutotrack.getSettings":[{name:`deviceId`,form:`single`,optional:!1}],"ptzAutotrack.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"ptzAutotrack.setEnabled":[{name:`deviceId`,form:`single`,optional:!1}],"ptzAutotrack.setSettings":[{name:`deviceId`,form:`single`,optional:!1}],"reboot.reboot":[{name:`deviceId`,form:`single`,optional:!1}],"recording.getAvailability":[{name:`deviceId`,form:`single`,optional:!1}],"recording.getDaysWithRecordings":[{name:`deviceId`,form:`single`,optional:!1}],"recording.getPlayback":[{name:`deviceId`,form:`single`,optional:!1}],"recording.getPlaybackOptions":[{name:`deviceId`,form:`single`,optional:!1}],"recording.listSources":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.deleteFootprint":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.getAvailabilityBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"recordingArchive.getDaysWithRecordingsBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"recordingArchive.getDeviceConfig":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.listOpsLog":[{name:`deviceId`,form:`single`,optional:!0}],"recordingArchive.locateSegment":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.pruneFootage":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.readGopBytes":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.readSegmentBytes":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.readWindowBytes":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.reconcileLedgerAgainstDisk":[{name:`deviceId`,form:`single`,optional:!0}],"recordingArchive.relocateFootage":[{name:`deviceId`,form:`single`,optional:!0}],"recordingArchive.renderClip":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.renderGif":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.rescanStorage":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.setDeviceConfig":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.setDevicePlacement":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.startStorageMigrationMove":[{name:`deviceId`,form:`single`,optional:!0}],"recordingExport.createExport":[{name:`deviceId`,form:`single`,optional:!1}],"recordingExport.listExports":[{name:`deviceId`,form:`single`,optional:!0}],"recordingOnboard.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"recordingOnboard.setSettings":[{name:`deviceId`,form:`single`,optional:!1}],"recordingSignal.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"sceneMonitor.captureReference":[{name:`deviceId`,form:`single`,optional:!1}],"sceneMonitor.createScene":[{name:`deviceId`,form:`single`,optional:!1}],"sceneMonitor.deleteReference":[{name:`deviceId`,form:`single`,optional:!1}],"sceneMonitor.deleteScene":[{name:`deviceId`,form:`single`,optional:!1}],"sceneMonitor.listScenes":[{name:`deviceId`,form:`single`,optional:!1}],"sceneMonitor.listScenesBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"sceneMonitor.recheckNow":[{name:`deviceId`,form:`single`,optional:!1}],"sceneMonitor.resetScene":[{name:`deviceId`,form:`single`,optional:!1}],"sceneMonitor.updateScene":[{name:`deviceId`,form:`single`,optional:!1}],"scriptRunner.run":[{name:`deviceId`,form:`single`,optional:!1}],"scriptRunner.stop":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.getDebugState":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.getSnapshot":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.getSnapshotLinks":[{name:`targets`,form:`object-array`,optional:!1,itemField:`deviceId`}],"snapshot.getSnapshotOverview":[{name:`deviceIds`,form:`array`,optional:!1}],"snapshot.invalidateCache":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.acquireEgressTranscode":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.assignProfile":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.forgetDeviceHardware":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.getDeviceAudioMute":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.getStreamWithCodec":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.produceEventMedia":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.publishCameraStream":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.renderPreBufferClip":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.reportStreamSignal":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.restartProfile":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.retractCameraStream":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.setDeviceAudioMute":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.unassignProfile":[{name:`deviceId`,form:`single`,optional:!1}],"streamCatalog.getCatalog":[{name:`deviceId`,form:`single`,optional:!1}],"streamParams.getConfigSchema":[{name:`deviceId`,form:`single`,optional:!1}],"streamParams.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"streamParams.setProfile":[{name:`deviceId`,form:`single`,optional:!1}],"switch.setState":[{name:`deviceId`,form:`single`,optional:!1}],"vacuumControl.locate":[{name:`deviceId`,form:`single`,optional:!1}],"vacuumControl.pause":[{name:`deviceId`,form:`single`,optional:!1}],"vacuumControl.returnToBase":[{name:`deviceId`,form:`single`,optional:!1}],"vacuumControl.setFanSpeed":[{name:`deviceId`,form:`single`,optional:!1}],"vacuumControl.start":[{name:`deviceId`,form:`single`,optional:!1}],"vacuumControl.stop":[{name:`deviceId`,form:`single`,optional:!1}],"valve.close":[{name:`deviceId`,form:`single`,optional:!1}],"valve.open":[{name:`deviceId`,form:`single`,optional:!1}],"valve.setPosition":[{name:`deviceId`,form:`single`,optional:!1}],"valve.stop":[{name:`deviceId`,form:`single`,optional:!1}],"videoclips.dialClipStream":[{name:`deviceId`,form:`single`,optional:!1}],"videoclips.getClipPlayback":[{name:`deviceId`,form:`single`,optional:!1}],"videoclips.getPlaybackOptions":[{name:`deviceId`,form:`single`,optional:!1}],"videoclips.listClips":[{name:`deviceId`,form:`single`,optional:!1}],"videoclips.listSources":[{name:`deviceId`,form:`single`,optional:!1}],"videoclips.offerClipBytes":[{name:`deviceId`,form:`single`,optional:!1}],"videoclips.readClipBytes":[{name:`deviceId`,form:`single`,optional:!1}],"waterHeater.setAway":[{name:`deviceId`,form:`single`,optional:!1}],"waterHeater.setOperationMode":[{name:`deviceId`,form:`single`,optional:!1}],"waterHeater.setTargetTemp":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.addIceCandidate":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.closeSession":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.createSession":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.getIceCandidates":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.getSessionDebug":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.getSessionState":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.handleAnswer":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.handleOffer":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.hasAdaptiveBitrate":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.listStreams":[{name:`deviceId`,form:`single`,optional:!1}],"zoneAnalytics.getCameraHistory":[{name:`deviceId`,form:`single`,optional:!1}],"zoneAnalytics.getCurrentSnapshot":[{name:`deviceId`,form:`single`,optional:!1}],"zoneAnalytics.getCurrentSnapshotBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"zoneAnalytics.getUnzonedHistory":[{name:`deviceId`,form:`single`,optional:!1}],"zoneAnalytics.getZoneHistory":[{name:`deviceId`,form:`single`,optional:!1}],"zoneRules.listRules":[{name:`deviceId`,form:`single`,optional:!1}],"zoneRules.setRules":[{name:`deviceId`,form:`single`,optional:!1}],"zones.addZone":[{name:`deviceId`,form:`single`,optional:!1}],"zones.listZones":[{name:`deviceId`,form:`single`,optional:!1}],"zones.removeZone":[{name:`deviceId`,form:`single`,optional:!1}],"zones.updateZone":[{name:`deviceId`,form:`single`,optional:!1}]}),nW=`addonSettings.getDeviceSettings,addonSettings.updateDeviceSettings,audioAnalyzer.attachDevice,audioAnalyzer.classify,audioAnalyzer.detachDevice,decoder.createSession,deviceAdoption.release,deviceAdoption.resync,deviceManager.adoptionRelease,deviceManager.adoptionResync,deviceManager.applyInitialMeta,deviceManager.disable,deviceManager.enable,deviceManager.getBindings,deviceManager.getBindingsBatch,deviceManager.getChildren,deviceManager.getChildrenBatch,deviceManager.getConfigSchema,deviceManager.getDevice,deviceManager.getDeviceAggregate,deviceManager.getDeviceLiveInfoAggregate,deviceManager.getDeviceSettingsAggregate,deviceManager.getDeviceStatusAggregate,deviceManager.getDeviceStatusAggregateBatch,deviceManager.getLinkedDevices,deviceManager.getLinkedDevicesBatch,deviceManager.getSettingsSchema,deviceManager.getStreamProfileMap,deviceManager.getStreamSources,deviceManager.getWireableFields,deviceManager.getWrapperActivation,deviceManager.listAll,deviceManager.loadConfig,deviceManager.loadMeta,deviceManager.loadRuntimeState,deviceManager.persistConfig,deviceManager.probeStreams,deviceManager.registerDevice,deviceManager.remove,deviceManager.removeDevice,deviceManager.runDeviceAction,deviceManager.setChildLayout,deviceManager.setDisabled,deviceManager.setDisplay,deviceManager.setIntegrationId,deviceManager.setLinkDeviceId,deviceManager.setLocation,deviceManager.setMetadata,deviceManager.setName,deviceManager.setPrimaryChildEntityId,deviceManager.setRole,deviceManager.setStreamProfileMap,deviceManager.setType,deviceManager.setWrapperActive,deviceManager.testField,deviceManager.updateConfig,deviceManager.updateDeviceField,deviceManager.updateDeviceFieldsBatch,deviceState.claimFields,deviceState.getCapSlice,deviceState.getNativeCapSlice,deviceState.getSnapshot,deviceState.patchOwnedFields,deviceState.releaseClaim,deviceState.setCapSlice,faceGallery.getFaceByTrack,faceGallery.listRecentFaces,networkQuality.getDeviceStats,networkQuality.reportClientStats,notificationRules.getAlarmSensors,notificationRules.setDeviceMuted,osdManager.clearSlotBinding,osdManager.copyDeviceConfiguration,osdManager.getDeviceOsd,osdManager.getSourceCatalog,osdManager.previewSlot,osdManager.renderDevice,osdManager.setSlotBinding,pipelineExecutor.runPipeline,pipelineExecutor.runPipelineBatch,pipelineOrchestrator.assignAudio,pipelineOrchestrator.assignPipeline,pipelineOrchestrator.getAudioAssignment,pipelineOrchestrator.getCameraMetrics,pipelineOrchestrator.getCameraSettings,pipelineOrchestrator.getCameraStatus,pipelineOrchestrator.getCameraStatuses,pipelineOrchestrator.getCameraStepOverrides,pipelineOrchestrator.getCameraSwitches,pipelineOrchestrator.getPipelineAssignment,pipelineOrchestrator.getPipelineDevicePin,pipelineOrchestrator.requestOccupancyLook,pipelineOrchestrator.resolvePipeline,pipelineOrchestrator.setCameraPipelineForAgent,pipelineOrchestrator.setCameraSensors,pipelineOrchestrator.setCameraStepOverride,pipelineOrchestrator.setCameraStepToggle,pipelineOrchestrator.setCameraSwitch,pipelineOrchestrator.setPipelineDevicePin,pipelineOrchestrator.unassignAudio,pipelineOrchestrator.unassignPipeline,pipelineRunner.attachCamera,pipelineRunner.detachCamera,pipelineRunner.getCameraMetrics,pipelineRunner.getParkedTrackFrame,pipelineRunner.parkTrackFrame,pipelineRunner.releaseParkedTrackFrames,pipelineRunner.reportMotion,pipelineRunner.requestOccupancyBurst,pipelineRunner.runDetailSubtree,pipelineRunner.runStatelessStep,plateGallery.getPlateByTrack,plateGallery.listPlates,recordingArchive.deleteFootprint,recordingArchive.getAvailabilityBatch,recordingArchive.getDaysWithRecordingsBatch,recordingArchive.getDeviceConfig,recordingArchive.listOpsLog,recordingArchive.locateSegment,recordingArchive.pruneFootage,recordingArchive.readGopBytes,recordingArchive.readSegmentBytes,recordingArchive.readWindowBytes,recordingArchive.reconcileLedgerAgainstDisk,recordingArchive.relocateFootage,recordingArchive.renderClip,recordingArchive.renderGif,recordingArchive.rescanStorage,recordingArchive.setDeviceConfig,recordingArchive.setDevicePlacement,recordingArchive.startStorageMigrationMove,recordingExport.createExport,recordingExport.listExports,streamBroker.acquireEgressTranscode,streamBroker.assignProfile,streamBroker.forgetDeviceHardware,streamBroker.getDeviceAudioMute,streamBroker.getStreamWithCodec,streamBroker.produceEventMedia,streamBroker.publishCameraStream,streamBroker.renderPreBufferClip,streamBroker.reportStreamSignal,streamBroker.restartProfile,streamBroker.retractCameraStream,streamBroker.setDeviceAudioMute,streamBroker.unassignProfile`.split(`,`),rW=Object.freeze({broker:`broker`,"device-export":`device-export`,llm:`ai`,"mesh-network":`mesh`,"mqtt-broker":`broker`,"network-access":`ingress`,"smtp-provider":`email`}),iW=[`broker`,`device-export`,`llm`,`mesh-network`,`mqtt-broker`,`network-access`,`smtp-provider`];function aW(e){let t=[];for(let[n,r]of Object.entries(rW))r===e&&t.push(n);return t}var oW={"air-quality-sensor":{durability:`restored`,volatileFields:[`lastFetchedAt`]},"alarm-panel":{durability:`restored`,volatileFields:[`lastChangedAt`]},"ambient-light-sensor":{durability:`restored`,volatileFields:[`lastFetchedAt`]},"audio-metrics":{durability:`session`,volatileFields:[]},"automation-control":{durability:`session`,volatileFields:[]},battery:{durability:`restored`,volatileFields:[`lastUpdated`]},binary:{durability:`restored`,volatileFields:[`lastChangedAt`]},brightness:{durability:`session`,volatileFields:[]},"camera-streams":{durability:`session`,volatileFields:[]},"carbon-monoxide":{durability:`restored`,volatileFields:[`lastChangedAt`]},"climate-control":{durability:`session`,volatileFields:[]},color:{durability:`session`,volatileFields:[]},connectivity:{durability:`restored`,volatileFields:[`lastChangedAt`]},consumables:{durability:`restored`,volatileFields:[`lastChangedAt`,`lastFetchedAt`]},contact:{durability:`restored`,volatileFields:[`lastChangedAt`]},control:{durability:`session`,volatileFields:[]},cover:{durability:`restored`,volatileFields:[`lastChangedAt`]},"day-night":{durability:`restored`,volatileFields:[`lastFetchedAt`]},"device-discovery":{durability:`session`,volatileFields:[]},"device-status":{durability:`restored`,volatileFields:[`lastChangedAt`]},doorbell:{durability:`restored`,volatileFields:[]},"enum-sensor":{durability:`restored`,volatileFields:[`lastFetchedAt`]},"event-emitter":{durability:`session`,volatileFields:[]},"fan-control":{durability:`session`,volatileFields:[]},"feature-probe":{durability:`session`,volatileFields:[]},flood:{durability:`restored`,volatileFields:[`lastChangedAt`]},gas:{durability:`restored`,volatileFields:[`lastChangedAt`]},humidifier:{durability:`session`,volatileFields:[]},"humidity-sensor":{durability:`restored`,volatileFields:[`lastFetchedAt`]},image:{durability:`session`,volatileFields:[]},"image-settings":{durability:`restored`,volatileFields:[`lastFetchedAt`]},intercom:{durability:`session`,volatileFields:[]},"lawn-mower-control":{durability:`session`,volatileFields:[]},"lock-control":{durability:`restored`,volatileFields:[`lastChangedAt`]},"media-player":{durability:`session`,volatileFields:[]},motion:{durability:`session`,volatileFields:[]},"motion-trigger":{durability:`session`,volatileFields:[]},"motion-zones":{durability:`restored`,volatileFields:[`lastFetchedAt`]},"native-object-detection":{durability:`restored`,volatileFields:[`lastFetchedAt`]},navigation:{durability:`session`,volatileFields:[]},"network-link":{durability:`restored`,volatileFields:[`lastUpdated`]},notifier:{durability:`session`,volatileFields:[]},"numeric-sensor":{durability:`restored`,volatileFields:[`lastFetchedAt`]},"pet-feeder":{durability:`session`,volatileFields:[]},"power-meter":{durability:`restored`,volatileFields:[`lastFetchedAt`]},presence:{durability:`restored`,volatileFields:[`lastChangedAt`]},"pressure-sensor":{durability:`restored`,volatileFields:[`lastFetchedAt`]},"privacy-mask":{durability:`restored`,volatileFields:[`lastFetchedAt`]},"ptz-autotrack":{durability:`session`,volatileFields:[]},"recording-onboard":{durability:`restored`,volatileFields:[`lastFetchedAt`]},"recording-signal":{durability:`session`,volatileFields:[]},"scene-monitor":{durability:`session`,volatileFields:[]},"script-runner":{durability:`session`,volatileFields:[]},smoke:{durability:`restored`,volatileFields:[`lastChangedAt`]},"stream-catalog":{durability:`restored`,volatileFields:[`lastFetchedAt`]},"stream-params":{durability:`restored`,volatileFields:[`lastFetchedAt`]},"stream-signals":{durability:`session`,volatileFields:[]},switch:{durability:`restored`,volatileFields:[`lastChangedAt`]},tamper:{durability:`restored`,volatileFields:[`lastChangedAt`]},"temperature-sensor":{durability:`restored`,volatileFields:[`lastFetchedAt`]},update:{durability:`session`,volatileFields:[]},"vacuum-control":{durability:`session`,volatileFields:[]},valve:{durability:`session`,volatileFields:[]},vibration:{durability:`restored`,volatileFields:[`lastChangedAt`]},"water-heater":{durability:`session`,volatileFields:[]},weather:{durability:`session`,volatileFields:[]},"zone-analytics":{durability:`session`,volatileFields:[]},"zone-rules":{durability:`restored`,volatileFields:[]},zones:{durability:`restored`,volatileFields:[]}};function sW(e){return oW[e]??cW}var cW={durability:`session`,volatileFields:[]};function lW(e){return sW(e).durability===`restored`}var uW=`air-quality-sensor.alarm-panel.ambient-light-sensor.battery.binary.carbon-monoxide.connectivity.consumables.contact.cover.day-night.device-status.doorbell.enum-sensor.flood.gas.humidity-sensor.image-settings.lock-control.motion-zones.native-object-detection.network-link.numeric-sensor.power-meter.presence.pressure-sensor.privacy-mask.recording-onboard.smoke.stream-catalog.stream-params.switch.tamper.temperature-sensor.vibration.zone-rules.zones`.split(`.`),dW=[{id:`camera-viewer`,label:`Camera viewer`,description:"Read-only over every device — live streams, recordings, motion events, battery state. Pair with a `device` grant (an `ids` / `types` / `locations` selector) to restrict to specific cameras.",rows:[{type:`category`,target:`device`,access:[`view`]}]},{id:`camera-operator`,label:`Camera operator`,description:"Everything `camera-viewer` does plus live control of every granted camera — PTZ movement, intercom talk-back and on-demand snapshots. Cannot delete devices, and grants nothing on system-scope caps (recording control, users, addons).",rows:[{type:`category`,target:`device`,access:[`view`,`create`]}]},{id:`full-management`,label:`Full management`,description:`Complete device + system control short of admin: view/create/delete on every device and every system capability. Use for a trusted operator who manages the whole deployment but should not hold the admin bypass.`,rows:[{type:`category`,target:`device`,access:[`view`,`create`,`delete`]},{type:`category`,target:`system`,access:[`view`,`create`,`delete`]}]},{id:`cli-deployer`,label:`CLI deployer`,description:"Push addons to the hub and tail their logs. Used by the `camstack` CLI on dev machines. No delete access — a stolen token cannot uninstall.",rows:[{type:`capability`,target:`addons`,access:[`view`,`create`]}]},{id:`event-listener`,label:`Event listener`,description:`Subscribe to motion / audio events. Used by webhook bridges and Home Assistant integrations.`,rows:[{type:`capability`,target:`motion-detection`,access:[`view`]},{type:`capability`,target:`audio-analysis`,access:[`view`]}]}];function fW(e){let t=e;function n(e,n,r,i,a){let o=t[e]?.[n];if(!o)throw Error(`SystemProxy: api has no '${e}.${n}'`);let s=o;return r===`mutation`?s.mutate(i):r===`subscription`?s.subscribe(i,a):s.query(i)}return{addonPages:{listPages:e=>n(`addonPages`,`listPages`,`query`,e)},addons:{list:e=>n(`addons`,`list`,`query`,e),getLogs:e=>n(`addons`,`getLogs`,`query`,e),listPackages:e=>n(`addons`,`listPackages`,`query`,e),installPackage:e=>n(`addons`,`installPackage`,`mutation`,e),installFromWorkspace:e=>n(`addons`,`installFromWorkspace`,`mutation`,e),isWorkspaceAvailable:e=>n(`addons`,`isWorkspaceAvailable`,`query`,e),listWorkspacePackages:e=>n(`addons`,`listWorkspacePackages`,`query`,e),uninstallPackage:e=>n(`addons`,`uninstallPackage`,`mutation`,e),reloadPackages:e=>n(`addons`,`reloadPackages`,`mutation`,e),searchAvailable:e=>n(`addons`,`searchAvailable`,`query`,e),listUpdates:e=>n(`addons`,`listUpdates`,`query`,e),updatePackage:e=>n(`addons`,`updatePackage`,`mutation`,e),rollbackPackage:e=>n(`addons`,`rollbackPackage`,`mutation`,e),forceRefresh:e=>n(`addons`,`forceRefresh`,`mutation`,e),restartServer:e=>n(`addons`,`restartServer`,`mutation`,e),getLastRestart:e=>n(`addons`,`getLastRestart`,`query`,e),listFrameworkPackages:e=>n(`addons`,`listFrameworkPackages`,`query`,e),listCapabilityProviders:e=>n(`addons`,`listCapabilityProviders`,`query`,e),setCapabilityProviderEnabled:e=>n(`addons`,`setCapabilityProviderEnabled`,`mutation`,e),getVersions:e=>n(`addons`,`getVersions`,`query`,e),restartAddon:e=>n(`addons`,`restartAddon`,`mutation`,e),retryLoad:e=>n(`addons`,`retryLoad`,`mutation`,e),getAutoUpdateSettings:e=>n(`addons`,`getAutoUpdateSettings`,`query`,e),setAutoUpdateSettings:e=>n(`addons`,`setAutoUpdateSettings`,`mutation`,e),getAddonAutoUpdate:e=>n(`addons`,`getAddonAutoUpdate`,`query`,e),setAddonAutoUpdate:e=>n(`addons`,`setAddonAutoUpdate`,`mutation`,e),applyAutoUpdateToAll:e=>n(`addons`,`applyAutoUpdateToAll`,`mutation`,e),custom:e=>n(`addons`,`custom`,`mutation`,e),startJob:e=>n(`addons`,`startJob`,`mutation`,e),getJob:e=>n(`addons`,`getJob`,`query`,e),listJobs:e=>n(`addons`,`listJobs`,`query`,e),cancelJob:e=>n(`addons`,`cancelJob`,`mutation`,e),onAddonLogs:(e,t)=>n(`addons`,`onAddonLogs`,`subscription`,e,t)},addonSettings:{getGlobalSettings:e=>n(`addonSettings`,`getGlobalSettings`,`query`,e),updateGlobalSettings:e=>n(`addonSettings`,`updateGlobalSettings`,`mutation`,e),getIntegrationSettings:e=>n(`addonSettings`,`getIntegrationSettings`,`query`,e)},addonWidgets:{listWidgets:e=>n(`addonWidgets`,`listWidgets`,`query`,e)},alerts:{emit:e=>n(`alerts`,`emit`,`mutation`,e),update:e=>n(`alerts`,`update`,`mutation`,e),list:e=>n(`alerts`,`list`,`query`,e),getUnreadCount:e=>n(`alerts`,`getUnreadCount`,`query`,e),markRead:e=>n(`alerts`,`markRead`,`mutation`,e),markAllRead:e=>n(`alerts`,`markAllRead`,`mutation`,e),dismiss:e=>n(`alerts`,`dismiss`,`mutation`,e)},audioAnalyzer:{analyseChunk:e=>n(`audioAnalyzer`,`analyseChunk`,`mutation`,e),classify:e=>n(`audioAnalyzer`,`classify`,`query`,e),attachDevice:e=>n(`audioAnalyzer`,`attachDevice`,`mutation`,e),isReady:e=>n(`audioAnalyzer`,`isReady`,`query`,e),dispose:e=>n(`audioAnalyzer`,`dispose`,`mutation`,e),reprobeAudioEngine:e=>n(`audioAnalyzer`,`reprobeAudioEngine`,`mutation`,e)},audioCodec:{listSupportedCodecs:e=>n(`audioCodec`,`listSupportedCodecs`,`query`,e),canHandle:e=>n(`audioCodec`,`canHandle`,`query`,e),createDecodeSession:e=>n(`audioCodec`,`createDecodeSession`,`mutation`,e),createEncodeSession:e=>n(`audioCodec`,`createEncodeSession`,`mutation`,e),closeSession:e=>n(`audioCodec`,`closeSession`,`mutation`,e),pushEncodedFrame:e=>n(`audioCodec`,`pushEncodedFrame`,`mutation`,e),pullPcm:e=>n(`audioCodec`,`pullPcm`,`query`,e),pushPcm:e=>n(`audioCodec`,`pushPcm`,`mutation`,e),pullEncoded:e=>n(`audioCodec`,`pullEncoded`,`query`,e),flushEncode:e=>n(`audioCodec`,`flushEncode`,`mutation`,e),listActiveSessions:e=>n(`audioCodec`,`listActiveSessions`,`query`,e)},backup:{listDestinations:e=>n(`backup`,`listDestinations`,`query`,e),trigger:e=>n(`backup`,`trigger`,`mutation`,e),listRuns:e=>n(`backup`,`listRuns`,`query`,e),cancel:e=>n(`backup`,`cancel`,`mutation`,e),list:e=>n(`backup`,`list`,`query`,e),listLocations:e=>n(`backup`,`listLocations`,`query`,e),getEntries:e=>n(`backup`,`getEntries`,`query`,e),restore:e=>n(`backup`,`restore`,`mutation`,e),delete:e=>n(`backup`,`delete`,`mutation`,e),listArchives:e=>n(`backup`,`listArchives`,`query`,e),upsertDestinationPolicy:e=>n(`backup`,`upsertDestinationPolicy`,`mutation`,e),previewSchedule:e=>n(`backup`,`previewSchedule`,`query`,e),listSchedules:e=>n(`backup`,`listSchedules`,`query`,e),upsertSchedule:e=>n(`backup`,`upsertSchedule`,`mutation`,e),deleteSchedule:e=>n(`backup`,`deleteSchedule`,`mutation`,e)},broker:{list:e=>n(`broker`,`list`,`query`,e),get:e=>n(`broker`,`get`,`query`,e),listProviders:e=>n(`broker`,`listProviders`,`query`,e),add:e=>n(`broker`,`add`,`mutation`,e),remove:e=>n(`broker`,`remove`,`mutation`,e),testConnection:e=>n(`broker`,`testConnection`,`mutation`,e),getSettings:e=>n(`broker`,`getSettings`,`query`,e),setSettings:e=>n(`broker`,`setSettings`,`mutation`,e),getBrokerConfig:e=>n(`broker`,`getBrokerConfig`,`query`,e),getSettingsSchema:e=>n(`broker`,`getSettingsSchema`,`query`,e),testSettings:e=>n(`broker`,`testSettings`,`mutation`,e),publish:e=>n(`broker`,`publish`,`mutation`,e),subscribe:e=>n(`broker`,`subscribe`,`mutation`,e),unsubscribe:e=>n(`broker`,`unsubscribe`,`mutation`,e),getState:e=>n(`broker`,`getState`,`query`,e),getStatus:e=>n(`broker`,`getStatus`,`query`,e)},connectionTest:{testSettings:e=>n(`connectionTest`,`testSettings`,`mutation`,e),describeTest:e=>n(`connectionTest`,`describeTest`,`query`,e)},coreBlocks:{list:e=>n(`coreBlocks`,`list`,`query`,e),get:e=>n(`coreBlocks`,`get`,`query`,e),create:e=>n(`coreBlocks`,`create`,`mutation`,e),update:e=>n(`coreBlocks`,`update`,`mutation`,e),delete:e=>n(`coreBlocks`,`delete`,`mutation`,e),setEnabled:e=>n(`coreBlocks`,`setEnabled`,`mutation`,e),restart:e=>n(`coreBlocks`,`restart`,`mutation`,e),compile:e=>n(`coreBlocks`,`compile`,`mutation`,e),getTypeDefs:e=>n(`coreBlocks`,`getTypeDefs`,`query`,e),createComposition:e=>n(`coreBlocks`,`createComposition`,`mutation`,e),updateComposition:e=>n(`coreBlocks`,`updateComposition`,`mutation`,e),getComposition:e=>n(`coreBlocks`,`getComposition`,`query`,e),listCompositions:e=>n(`coreBlocks`,`listCompositions`,`query`,e),getCustomization:e=>n(`coreBlocks`,`getCustomization`,`query`,e),listComposableCaps:e=>n(`coreBlocks`,`listComposableCaps`,`query`,e),validateComposition:e=>n(`coreBlocks`,`validateComposition`,`mutation`,e)},decoder:{supportsCodec:e=>n(`decoder`,`supportsCodec`,`query`,e),getInfo:e=>n(`decoder`,`getInfo`,`query`,e),createSession:e=>n(`decoder`,`createSession`,`query`,e),destroySession:e=>n(`decoder`,`destroySession`,`query`,e),pushPacket:e=>n(`decoder`,`pushPacket`,`query`,e),openStream:e=>n(`decoder`,`openStream`,`query`,e),pullFrames:e=>n(`decoder`,`pullFrames`,`query`,e),pullHandles:e=>n(`decoder`,`pullHandles`,`query`,e),getFrame:e=>n(`decoder`,`getFrame`,`query`,e),getShmStats:e=>n(`decoder`,`getShmStats`,`query`,e),updateConfig:e=>n(`decoder`,`updateConfig`,`query`,e),getStats:e=>n(`decoder`,`getStats`,`query`,e),listActiveSessions:e=>n(`decoder`,`listActiveSessions`,`query`,e),reprobeHwaccel:e=>n(`decoder`,`reprobeHwaccel`,`mutation`,e)},deviceAdoption:{listCandidateFilters:e=>n(`deviceAdoption`,`listCandidateFilters`,`query`,e),listCandidates:e=>n(`deviceAdoption`,`listCandidates`,`query`,e),getCandidate:e=>n(`deviceAdoption`,`getCandidate`,`query`,e),refresh:e=>n(`deviceAdoption`,`refresh`,`mutation`,e),adopt:e=>n(`deviceAdoption`,`adopt`,`mutation`,e),release:e=>n(`deviceAdoption`,`release`,`mutation`,e),resync:e=>n(`deviceAdoption`,`resync`,`mutation`,e)},deviceExport:{getStatus:e=>n(`deviceExport`,`getStatus`,`query`,e),listSupportedDeviceKinds:e=>n(`deviceExport`,`listSupportedDeviceKinds`,`query`,e),listExposedDevices:e=>n(`deviceExport`,`listExposedDevices`,`query`,e),exposeDevice:e=>n(`deviceExport`,`exposeDevice`,`mutation`,e),unexposeDevice:e=>n(`deviceExport`,`unexposeDevice`,`mutation`,e)},deviceManager:{allocateDeviceId:e=>n(`deviceManager`,`allocateDeviceId`,`mutation`,e),migrateDevice:e=>n(`deviceManager`,`migrateDevice`,`mutation`,e),registerDevice:e=>n(`deviceManager`,`registerDevice`,`mutation`,e),removeDevice:e=>n(`deviceManager`,`removeDevice`,`mutation`,e),persistConfig:e=>n(`deviceManager`,`persistConfig`,`mutation`,e),getRoleDisplayDefaults:e=>n(`deviceManager`,`getRoleDisplayDefaults`,`query`,e),setRoleDisplayDefaults:e=>n(`deviceManager`,`setRoleDisplayDefaults`,`mutation`,e),listLocations:e=>n(`deviceManager`,`listLocations`,`query`,e),addLocation:e=>n(`deviceManager`,`addLocation`,`mutation`,e),removeLocation:e=>n(`deviceManager`,`removeLocation`,`mutation`,e),renameLocation:e=>n(`deviceManager`,`renameLocation`,`mutation`,e),listLocationIcons:e=>n(`deviceManager`,`listLocationIcons`,`query`,e),setLocationIcon:e=>n(`deviceManager`,`setLocationIcon`,`mutation`,e),listLocationDescriptions:e=>n(`deviceManager`,`listLocationDescriptions`,`query`,e),setLocationDescription:e=>n(`deviceManager`,`setLocationDescription`,`mutation`,e),listSiteZones:e=>n(`deviceManager`,`listSiteZones`,`query`,e),setSiteZone:e=>n(`deviceManager`,`setSiteZone`,`mutation`,e),removeSiteZone:e=>n(`deviceManager`,`removeSiteZone`,`mutation`,e),renameSiteZone:e=>n(`deviceManager`,`renameSiteZone`,`mutation`,e),setLocationZone:e=>n(`deviceManager`,`setLocationZone`,`mutation`,e),listPersistedByAddon:e=>n(`deviceManager`,`listPersistedByAddon`,`query`,e),listAll:e=>n(`deviceManager`,`listAll`,`query`,e),getChildren:e=>n(`deviceManager`,`getChildren`,`query`,e),getChildrenBatch:e=>n(`deviceManager`,`getChildrenBatch`,`query`,e),getLinkedDevicesBatch:e=>n(`deviceManager`,`getLinkedDevicesBatch`,`query`,e),removeByIntegration:e=>n(`deviceManager`,`removeByIntegration`,`mutation`,e),getBindingsBatch:e=>n(`deviceManager`,`getBindingsBatch`,`query`,e),getAllBindings:e=>n(`deviceManager`,`getAllBindings`,`query`,e),listDeviceIdsByCaps:e=>n(`deviceManager`,`listDeviceIdsByCaps`,`query`,e),listWrappersForCap:e=>n(`deviceManager`,`listWrappersForCap`,`query`,e),listBindableCapsForDeviceType:e=>n(`deviceManager`,`listBindableCapsForDeviceType`,`query`,e),discoverDevices:e=>n(`deviceManager`,`discoverDevices`,`mutation`,e),adoptDevice:e=>n(`deviceManager`,`adoptDevice`,`mutation`,e),getCreationSchema:e=>n(`deviceManager`,`getCreationSchema`,`query`,e),createDevice:e=>n(`deviceManager`,`createDevice`,`mutation`,e),testCreationField:e=>n(`deviceManager`,`testCreationField`,`mutation`,e),adoptionListCandidateFilters:e=>n(`deviceManager`,`adoptionListCandidateFilters`,`query`,e),adoptionListCandidates:e=>n(`deviceManager`,`adoptionListCandidates`,`query`,e),adoptionRefresh:e=>n(`deviceManager`,`adoptionRefresh`,`mutation`,e),adoptionAdopt:e=>n(`deviceManager`,`adoptionAdopt`,`mutation`,e),adoptionRelease:e=>n(`deviceManager`,`adoptionRelease`,`mutation`,e),adoptionStartJob:e=>n(`deviceManager`,`adoptionStartJob`,`mutation`,e),adoptionListJobs:e=>n(`deviceManager`,`adoptionListJobs`,`query`,e),adoptionCancelJob:e=>n(`deviceManager`,`adoptionCancelJob`,`mutation`,e),adoptionResync:e=>n(`deviceManager`,`adoptionResync`,`mutation`,e),discoveryProviders:e=>n(`deviceManager`,`discoveryProviders`,`query`,e),discoverAllProviders:e=>n(`deviceManager`,`discoverAllProviders`,`mutation`,e),discoverProvider:e=>n(`deviceManager`,`discoverProvider`,`mutation`,e),providerCreationType:e=>n(`deviceManager`,`providerCreationType`,`query`,e),providerDiscoveryParamsSchema:e=>n(`deviceManager`,`providerDiscoveryParamsSchema`,`query`,e),getDeviceStatusAggregateBatch:e=>n(`deviceManager`,`getDeviceStatusAggregateBatch`,`query`,e)},deviceProvider:{start:e=>n(`deviceProvider`,`start`,`mutation`,e),stop:e=>n(`deviceProvider`,`stop`,`mutation`,e),getStatus:e=>n(`deviceProvider`,`getStatus`,`query`,e),getDevices:e=>n(`deviceProvider`,`getDevices`,`query`,e),reloadDevice:e=>n(`deviceProvider`,`reloadDevice`,`mutation`,e),supportsDiscovery:e=>n(`deviceProvider`,`supportsDiscovery`,`query`,e),discoverDevices:e=>n(`deviceProvider`,`discoverDevices`,`mutation`,e),getDiscoveryParamsSchema:e=>n(`deviceProvider`,`getDiscoveryParamsSchema`,`query`,e),getManualCreationType:e=>n(`deviceProvider`,`getManualCreationType`,`query`,e),adoptDiscoveredDevice:e=>n(`deviceProvider`,`adoptDiscoveredDevice`,`mutation`,e),supportsManualCreation:e=>n(`deviceProvider`,`supportsManualCreation`,`query`,e),getChildCreationSchema:e=>n(`deviceProvider`,`getChildCreationSchema`,`query`,e),createDevice:e=>n(`deviceProvider`,`createDevice`,`mutation`,e),testCreationField:e=>n(`deviceProvider`,`testCreationField`,`mutation`,e)},deviceState:{getAllSnapshots:e=>n(`deviceState`,`getAllSnapshots`,`query`,e),listClaims:e=>n(`deviceState`,`listClaims`,`query`,e)},faceGallery:{listIdentities:e=>n(`faceGallery`,`listIdentities`,`query`,e),createIdentity:e=>n(`faceGallery`,`createIdentity`,`mutation`,e),renameIdentity:e=>n(`faceGallery`,`renameIdentity`,`mutation`,e),deleteIdentity:e=>n(`faceGallery`,`deleteIdentity`,`mutation`,e),listIdentitySamples:e=>n(`faceGallery`,`listIdentitySamples`,`query`,e),auditIdentitySamples:e=>n(`faceGallery`,`auditIdentitySamples`,`query`,e),removeSample:e=>n(`faceGallery`,`removeSample`,`mutation`,e),getFaceMedia:e=>n(`faceGallery`,`getFaceMedia`,`query`,e),assignFace:e=>n(`faceGallery`,`assignFace`,`mutation`,e),unassignFace:e=>n(`faceGallery`,`unassignFace`,`mutation`,e),deleteFace:e=>n(`faceGallery`,`deleteFace`,`mutation`,e),assignFaces:e=>n(`faceGallery`,`assignFaces`,`mutation`,e),unassignFaces:e=>n(`faceGallery`,`unassignFaces`,`mutation`,e),suggestFaceClusters:e=>n(`faceGallery`,`suggestFaceClusters`,`query`,e)},integrations:{list:e=>n(`integrations`,`list`,`query`,e),get:e=>n(`integrations`,`get`,`query`,e),getByAddonId:e=>n(`integrations`,`getByAddonId`,`query`,e),create:e=>n(`integrations`,`create`,`mutation`,e),update:e=>n(`integrations`,`update`,`mutation`,e),delete:e=>n(`integrations`,`delete`,`mutation`,e),getSettings:e=>n(`integrations`,`getSettings`,`query`,e),setSettings:e=>n(`integrations`,`setSettings`,`mutation`,e),getAvailableTypes:e=>n(`integrations`,`getAvailableTypes`,`query`,e),testConnection:e=>n(`integrations`,`testConnection`,`mutation`,e)},llm:{generate:e=>n(`llm`,`generate`,`mutation`,e),generateVision:e=>n(`llm`,`generateVision`,`mutation`,e),cancel:e=>n(`llm`,`cancel`,`mutation`,e),listProfileKinds:e=>n(`llm`,`listProfileKinds`,`query`,e),listProfiles:e=>n(`llm`,`listProfiles`,`query`,e),upsertProfile:e=>n(`llm`,`upsertProfile`,`mutation`,e),deleteProfile:e=>n(`llm`,`deleteProfile`,`mutation`,e),testProfile:e=>n(`llm`,`testProfile`,`mutation`,e),listModels:e=>n(`llm`,`listModels`,`query`,e),getDefaults:e=>n(`llm`,`getDefaults`,`query`,e),setDefault:e=>n(`llm`,`setDefault`,`mutation`,e),getUsage:e=>n(`llm`,`getUsage`,`query`,e),listModelCatalog:e=>n(`llm`,`listModelCatalog`,`query`,e),listRuntimeNodes:e=>n(`llm`,`listRuntimeNodes`,`query`,e),listNodeModels:e=>n(`llm`,`listNodeModels`,`query`,e),resolveModelRef:e=>n(`llm`,`resolveModelRef`,`mutation`,e),installModel:e=>n(`llm`,`installModel`,`mutation`,e),deleteModel:e=>n(`llm`,`deleteModel`,`mutation`,e),getRuntimeStatus:e=>n(`llm`,`getRuntimeStatus`,`query`,e),startRuntime:e=>n(`llm`,`startRuntime`,`mutation`,e),stopRuntime:e=>n(`llm`,`stopRuntime`,`mutation`,e)},localNetwork:{list:e=>n(`localNetwork`,`list`,`query`,e),getPreferred:e=>n(`localNetwork`,`getPreferred`,`query`,e),getConnectionEndpoints:e=>n(`localNetwork`,`getConnectionEndpoints`,`query`,e),getNotificationEndpoint:e=>n(`localNetwork`,`getNotificationEndpoint`,`query`,e),setNotificationEndpoint:e=>n(`localNetwork`,`setNotificationEndpoint`,`mutation`,e),getViewerEndpoints:e=>n(`localNetwork`,`getViewerEndpoints`,`query`,e),setViewerEndpoints:e=>n(`localNetwork`,`setViewerEndpoints`,`mutation`,e),getAllowedAddresses:e=>n(`localNetwork`,`getAllowedAddresses`,`query`,e),setAllowedAddresses:e=>n(`localNetwork`,`setAllowedAddresses`,`mutation`,e),resetAllowlistToBestMatch:e=>n(`localNetwork`,`resetAllowlistToBestMatch`,`mutation`,e),getTlsStatus:e=>n(`localNetwork`,`getTlsStatus`,`query`,e),regenerateCertificate:e=>n(`localNetwork`,`regenerateCertificate`,`mutation`,e),uploadCertificate:e=>n(`localNetwork`,`uploadCertificate`,`mutation`,e),downloadCa:e=>n(`localNetwork`,`downloadCa`,`query`,e),revertToGeneratedCertificate:e=>n(`localNetwork`,`revertToGeneratedCertificate`,`mutation`,e)},meshNetwork:{getStatus:e=>n(`meshNetwork`,`getStatus`,`query`,e),join:e=>n(`meshNetwork`,`join`,`mutation`,e),startLogin:e=>n(`meshNetwork`,`startLogin`,`mutation`,e),leave:e=>n(`meshNetwork`,`leave`,`mutation`,e),logout:e=>n(`meshNetwork`,`logout`,`mutation`,e),listPeers:e=>n(`meshNetwork`,`listPeers`,`query`,e),testConnection:e=>n(`meshNetwork`,`testConnection`,`mutation`,e)},metricsProvider:{collectSnapshot:e=>n(`metricsProvider`,`collectSnapshot`,`query`,e),getCached:e=>n(`metricsProvider`,`getCached`,`query`,e),getCurrent:e=>n(`metricsProvider`,`getCurrent`,`query`,e),getDiskSpace:e=>n(`metricsProvider`,`getDiskSpace`,`query`,e),getGpuInfo:e=>n(`metricsProvider`,`getGpuInfo`,`query`,e),getCpuTemperature:e=>n(`metricsProvider`,`getCpuTemperature`,`query`,e),getProcessStats:e=>n(`metricsProvider`,`getProcessStats`,`query`,e),listAddonInstances:e=>n(`metricsProvider`,`listAddonInstances`,`query`,e),getAddonStats:e=>n(`metricsProvider`,`getAddonStats`,`query`,e),listNodeProcesses:e=>n(`metricsProvider`,`listNodeProcesses`,`query`,e),getLoadSeries:e=>n(`metricsProvider`,`getLoadSeries`,`query`,e)},mqttBroker:{listBrokers:e=>n(`mqttBroker`,`listBrokers`,`query`,e),getBrokerConfig:e=>n(`mqttBroker`,`getBrokerConfig`,`query`,e),addBroker:e=>n(`mqttBroker`,`addBroker`,`mutation`,e),removeBroker:e=>n(`mqttBroker`,`removeBroker`,`mutation`,e),testConnection:e=>n(`mqttBroker`,`testConnection`,`mutation`,e),startEmbeddedBroker:e=>n(`mqttBroker`,`startEmbeddedBroker`,`mutation`,e),stopEmbeddedBroker:e=>n(`mqttBroker`,`stopEmbeddedBroker`,`mutation`,e),getStatus:e=>n(`mqttBroker`,`getStatus`,`query`,e)},networkAccess:{start:e=>n(`networkAccess`,`start`,`mutation`,e),stop:e=>n(`networkAccess`,`stop`,`mutation`,e),getEndpoint:e=>n(`networkAccess`,`getEndpoint`,`query`,e),getStatus:e=>n(`networkAccess`,`getStatus`,`query`,e),listEndpoints:e=>n(`networkAccess`,`listEndpoints`,`query`,e)},networkQuality:{getAllStats:e=>n(`networkQuality`,`getAllStats`,`query`,e)},nodes:{topology:e=>n(`nodes`,`topology`,`query`,e),directory:e=>n(`nodes`,`directory`,`query`,e),deployAddon:e=>n(`nodes`,`deployAddon`,`mutation`,e),undeployAddon:e=>n(`nodes`,`undeployAddon`,`mutation`,e),restartAddon:e=>n(`nodes`,`restartAddon`,`mutation`,e),restartProcess:e=>n(`nodes`,`restartProcess`,`mutation`,e),restartNode:e=>n(`nodes`,`restartNode`,`mutation`,e),shutdownNode:e=>n(`nodes`,`shutdownNode`,`mutation`,e),renameNode:e=>n(`nodes`,`renameNode`,`mutation`,e),clusterAddonStatus:e=>n(`nodes`,`clusterAddonStatus`,`query`,e),getCapUsageGraph:e=>n(`nodes`,`getCapUsageGraph`,`query`,e),getNodeAddons:e=>n(`nodes`,`getNodeAddons`,`query`,e),setProcessLogLevel:e=>n(`nodes`,`setProcessLogLevel`,`mutation`,e),executeQuery:e=>n(`nodes`,`executeQuery`,`mutation`,e)},notificationOutput:{listTargetKinds:e=>n(`notificationOutput`,`listTargetKinds`,`query`,e),listTargets:e=>n(`notificationOutput`,`listTargets`,`query`,e),discoverTargets:e=>n(`notificationOutput`,`discoverTargets`,`query`,e),send:e=>n(`notificationOutput`,`send`,`mutation`,e),testTarget:e=>n(`notificationOutput`,`testTarget`,`mutation`,e),upsertTarget:e=>n(`notificationOutput`,`upsertTarget`,`mutation`,e),deleteTarget:e=>n(`notificationOutput`,`deleteTarget`,`mutation`,e),setTargetEnabled:e=>n(`notificationOutput`,`setTargetEnabled`,`mutation`,e)},notificationRules:{listRules:e=>n(`notificationRules`,`listRules`,`query`,e),getRule:e=>n(`notificationRules`,`getRule`,`query`,e),createRule:e=>n(`notificationRules`,`createRule`,`mutation`,e),updateRule:e=>n(`notificationRules`,`updateRule`,`mutation`,e),deleteRule:e=>n(`notificationRules`,`deleteRule`,`mutation`,e),setRuleEnabled:e=>n(`notificationRules`,`setRuleEnabled`,`mutation`,e),getClipRetentionAsks:e=>n(`notificationRules`,`getClipRetentionAsks`,`query`,e),listDeviceMutes:e=>n(`notificationRules`,`listDeviceMutes`,`query`,e),testRule:e=>n(`notificationRules`,`testRule`,`mutation`,e),previewStateSummary:e=>n(`notificationRules`,`previewStateSummary`,`mutation`,e),getConditionCatalog:e=>n(`notificationRules`,`getConditionCatalog`,`query`,e),getTemplateCatalog:e=>n(`notificationRules`,`getTemplateCatalog`,`query`,e),previewTemplate:e=>n(`notificationRules`,`previewTemplate`,`mutation`,e),getHistory:e=>n(`notificationRules`,`getHistory`,`query`,e),getRuleLastRuns:e=>n(`notificationRules`,`getRuleLastRuns`,`query`,e),resolveArtifactUrl:e=>n(`notificationRules`,`resolveArtifactUrl`,`query`,e),listSnoozes:e=>n(`notificationRules`,`listSnoozes`,`query`,e),createSnooze:e=>n(`notificationRules`,`createSnooze`,`mutation`,e),cancelSnooze:e=>n(`notificationRules`,`cancelSnooze`,`mutation`,e),getAlarmConfig:e=>n(`notificationRules`,`getAlarmConfig`,`query`,e),setAlarmConfig:e=>n(`notificationRules`,`setAlarmConfig`,`mutation`,e),getAlarmSensors:e=>n(`notificationRules`,`getAlarmSensors`,`query`,e)},osdManager:{getConditionSupport:e=>n(`osdManager`,`getConditionSupport`,`query`,e),copyDeviceConfiguration:e=>n(`osdManager`,`copyDeviceConfiguration`,`mutation`,e)},pipelineExecutor:{getAvailableEngines:e=>n(`pipelineExecutor`,`getAvailableEngines`,`query`,e),getSelectedEngine:e=>n(`pipelineExecutor`,`getSelectedEngine`,`query`,e),getDefaultSteps:e=>n(`pipelineExecutor`,`getDefaultSteps`,`query`,e),getEngineProvisioning:e=>n(`pipelineExecutor`,`getEngineProvisioning`,`query`,e),getVideoPipelineSteps:e=>n(`pipelineExecutor`,`getVideoPipelineSteps`,`query`,e),setVideoPipelineSteps:e=>n(`pipelineExecutor`,`setVideoPipelineSteps`,`mutation`,e),clearDeviceOverrides:e=>n(`pipelineExecutor`,`clearDeviceOverrides`,`mutation`,e),getInferenceDeviceHealth:e=>n(`pipelineExecutor`,`getInferenceDeviceHealth`,`query`,e),rearmInferenceDevice:e=>n(`pipelineExecutor`,`rearmInferenceDevice`,`mutation`,e),getSchema:e=>n(`pipelineExecutor`,`getSchema`,`query`,e),getGlobalSteps:e=>n(`pipelineExecutor`,`getGlobalSteps`,`query`,e),getGlobalPipelineConfig:e=>n(`pipelineExecutor`,`getGlobalPipelineConfig`,`query`,e),getOrchestratorConfigSchema:e=>n(`pipelineExecutor`,`getOrchestratorConfigSchema`,`query`,e),validatePipeline:e=>n(`pipelineExecutor`,`validatePipeline`,`query`,e),listTemplates:e=>n(`pipelineExecutor`,`listTemplates`,`query`,e),saveTemplate:e=>n(`pipelineExecutor`,`saveTemplate`,`mutation`,e),updateTemplate:e=>n(`pipelineExecutor`,`updateTemplate`,`mutation`,e),deleteTemplate:e=>n(`pipelineExecutor`,`deleteTemplate`,`mutation`,e),getCapabilities:e=>n(`pipelineExecutor`,`getCapabilities`,`query`,e),getAddonModels:e=>n(`pipelineExecutor`,`getAddonModels`,`query`,e),downloadModel:e=>n(`pipelineExecutor`,`downloadModel`,`mutation`,e),deleteModel:e=>n(`pipelineExecutor`,`deleteModel`,`mutation`,e),cacheFrameInPool:e=>n(`pipelineExecutor`,`cacheFrameInPool`,`mutation`,e),inferCached:e=>n(`pipelineExecutor`,`inferCached`,`mutation`,e),uncacheFrame:e=>n(`pipelineExecutor`,`uncacheFrame`,`mutation`,e),getEffectiveTuning:e=>n(`pipelineExecutor`,`getEffectiveTuning`,`query`,e),listLoadedEngines:e=>n(`pipelineExecutor`,`listLoadedEngines`,`query`,e),spinEngine:e=>n(`pipelineExecutor`,`spinEngine`,`mutation`,e),killEngine:e=>n(`pipelineExecutor`,`killEngine`,`mutation`,e),listReferenceImages:e=>n(`pipelineExecutor`,`listReferenceImages`,`query`,e),getReferenceImage:e=>n(`pipelineExecutor`,`getReferenceImage`,`query`,e),getReferenceAudioFiles:e=>n(`pipelineExecutor`,`getReferenceAudioFiles`,`query`,e),getReferenceAudio:e=>n(`pipelineExecutor`,`getReferenceAudio`,`query`,e),getAudioCapabilities:e=>n(`pipelineExecutor`,`getAudioCapabilities`,`query`,e),runAudioTest:e=>n(`pipelineExecutor`,`runAudioTest`,`mutation`,e),getDetectionConfigSchema:e=>n(`pipelineExecutor`,`getDetectionConfigSchema`,`query`,e)},pipelineOrchestrator:{requestOccupancyLook:e=>n(`pipelineOrchestrator`,`requestOccupancyLook`,`mutation`,e),pauseForStorageMigration:e=>n(`pipelineOrchestrator`,`pauseForStorageMigration`,`mutation`,e),resumeForStorageMigration:e=>n(`pipelineOrchestrator`,`resumeForStorageMigration`,`mutation`,e),rebalance:e=>n(`pipelineOrchestrator`,`rebalance`,`mutation`,e),getPipelineAssignments:e=>n(`pipelineOrchestrator`,`getPipelineAssignments`,`query`,e),getAgentLoad:e=>n(`pipelineOrchestrator`,`getAgentLoad`,`query`,e),getClusterModelChoice:e=>n(`pipelineOrchestrator`,`getClusterModelChoice`,`query`,e),getGlobalMetrics:e=>n(`pipelineOrchestrator`,`getGlobalMetrics`,`query`,e),getCapabilityBindings:e=>n(`pipelineOrchestrator`,`getCapabilityBindings`,`query`,e),setCapabilityBinding:e=>n(`pipelineOrchestrator`,`setCapabilityBinding`,`mutation`,e),getIngestOwner:e=>n(`pipelineOrchestrator`,`getIngestOwner`,`query`,e),getAudioNodeLoad:e=>n(`pipelineOrchestrator`,`getAudioNodeLoad`,`query`,e),getAudioAssignments:e=>n(`pipelineOrchestrator`,`getAudioAssignments`,`query`,e),getAgentSettings:e=>n(`pipelineOrchestrator`,`getAgentSettings`,`query`,e),listAgentSettings:e=>n(`pipelineOrchestrator`,`listAgentSettings`,`query`,e),removeAgentSettings:e=>n(`pipelineOrchestrator`,`removeAgentSettings`,`mutation`,e),setAgentMaxCameras:e=>n(`pipelineOrchestrator`,`setAgentMaxCameras`,`mutation`,e),setAgentDetectWeight:e=>n(`pipelineOrchestrator`,`setAgentDetectWeight`,`mutation`,e),setAgentCapabilities:e=>n(`pipelineOrchestrator`,`setAgentCapabilities`,`mutation`,e),setAgentDecodeLimits:e=>n(`pipelineOrchestrator`,`setAgentDecodeLimits`,`mutation`,e),setAgentReachableHost:e=>n(`pipelineOrchestrator`,`setAgentReachableHost`,`mutation`,e),setAgentInferenceDevices:e=>n(`pipelineOrchestrator`,`setAgentInferenceDevices`,`mutation`,e),getNodeInferenceDevices:e=>n(`pipelineOrchestrator`,`getNodeInferenceDevices`,`query`,e),resetNodePipelineDefaults:e=>n(`pipelineOrchestrator`,`resetNodePipelineDefaults`,`mutation`,e),getCameraStatuses:e=>n(`pipelineOrchestrator`,`getCameraStatuses`,`query`,e),setCameraSensors:e=>n(`pipelineOrchestrator`,`setCameraSensors`,`mutation`,e),reconcileFromDisk:e=>n(`pipelineOrchestrator`,`reconcileFromDisk`,`mutation`,e),getReconcileFromDiskStatus:e=>n(`pipelineOrchestrator`,`getReconcileFromDiskStatus`,`query`,e),listTemplates:e=>n(`pipelineOrchestrator`,`listTemplates`,`query`,e),saveTemplate:e=>n(`pipelineOrchestrator`,`saveTemplate`,`mutation`,e),updateTemplate:e=>n(`pipelineOrchestrator`,`updateTemplate`,`mutation`,e),deleteTemplate:e=>n(`pipelineOrchestrator`,`deleteTemplate`,`mutation`,e)},pipelineRunner:{attachCamera:e=>n(`pipelineRunner`,`attachCamera`,`mutation`,e),reportMotion:e=>n(`pipelineRunner`,`reportMotion`,`mutation`,e),getLocalLoad:e=>n(`pipelineRunner`,`getLocalLoad`,`query`,e),getLocalMetrics:e=>n(`pipelineRunner`,`getLocalMetrics`,`query`,e),getAllCameraMetrics:e=>n(`pipelineRunner`,`getAllCameraMetrics`,`query`,e),getLocalCameras:e=>n(`pipelineRunner`,`getLocalCameras`,`query`,e),getNativeCrop:e=>n(`pipelineRunner`,`getNativeCrop`,`query`,e),runStatelessStep:e=>n(`pipelineRunner`,`runStatelessStep`,`mutation`,e)},plateGallery:{getPlateMedia:e=>n(`plateGallery`,`getPlateMedia`,`query`,e),searchPlates:e=>n(`plateGallery`,`searchPlates`,`query`,e),suggestPlateClusters:e=>n(`plateGallery`,`suggestPlateClusters`,`query`,e),correctPlateText:e=>n(`plateGallery`,`correctPlateText`,`mutation`,e),deletePlate:e=>n(`plateGallery`,`deletePlate`,`mutation`,e),listVehicles:e=>n(`plateGallery`,`listVehicles`,`query`,e),createVehicle:e=>n(`plateGallery`,`createVehicle`,`mutation`,e),renameVehicle:e=>n(`plateGallery`,`renameVehicle`,`mutation`,e),deleteVehicle:e=>n(`plateGallery`,`deleteVehicle`,`mutation`,e),listVehicleSamples:e=>n(`plateGallery`,`listVehicleSamples`,`query`,e),removeVehicleSample:e=>n(`plateGallery`,`removeVehicleSample`,`mutation`,e),assignPlate:e=>n(`plateGallery`,`assignPlate`,`mutation`,e),unassignPlate:e=>n(`plateGallery`,`unassignPlate`,`mutation`,e),assignPlates:e=>n(`plateGallery`,`assignPlates`,`mutation`,e),unassignPlates:e=>n(`plateGallery`,`unassignPlates`,`mutation`,e)},recordingArchive:{getAvailabilityBatch:e=>n(`recordingArchive`,`getAvailabilityBatch`,`query`,e),getDaysWithRecordingsBatch:e=>n(`recordingArchive`,`getDaysWithRecordingsBatch`,`query`,e),getStorageUsage:e=>n(`recordingArchive`,`getStorageUsage`,`query`,e),listOpsLog:e=>n(`recordingArchive`,`listOpsLog`,`query`,e),pauseForStorageMigration:e=>n(`recordingArchive`,`pauseForStorageMigration`,`mutation`,e),resumeForStorageMigration:e=>n(`recordingArchive`,`resumeForStorageMigration`,`mutation`,e),refreshStorageLocationsForMigration:e=>n(`recordingArchive`,`refreshStorageLocationsForMigration`,`mutation`,e),startStorageMigrationMove:e=>n(`recordingArchive`,`startStorageMigrationMove`,`mutation`,e),getStorageMigrationMoveStatus:e=>n(`recordingArchive`,`getStorageMigrationMoveStatus`,`query`,e),cancelStorageMigrationMove:e=>n(`recordingArchive`,`cancelStorageMigrationMove`,`mutation`,e),relocateFootage:e=>n(`recordingArchive`,`relocateFootage`,`mutation`,e),listRelocateJobs:e=>n(`recordingArchive`,`listRelocateJobs`,`query`,e),getRelocateResidue:e=>n(`recordingArchive`,`getRelocateResidue`,`query`,e),reconcileLedgerAgainstDisk:e=>n(`recordingArchive`,`reconcileLedgerAgainstDisk`,`mutation`,e),cancelRelocateJob:e=>n(`recordingArchive`,`cancelRelocateJob`,`mutation`,e),planStorageRebalance:e=>n(`recordingArchive`,`planStorageRebalance`,`query`,e),startStorageRebalance:e=>n(`recordingArchive`,`startStorageRebalance`,`mutation`,e),getPlacement:e=>n(`recordingArchive`,`getPlacement`,`query`,e),setDevicePlacement:e=>n(`recordingArchive`,`setDevicePlacement`,`mutation`,e)},recordingExport:{createExport:e=>n(`recordingExport`,`createExport`,`mutation`,e),getExport:e=>n(`recordingExport`,`getExport`,`query`,e),cancelExport:e=>n(`recordingExport`,`cancelExport`,`mutation`,e),deleteExport:e=>n(`recordingExport`,`deleteExport`,`mutation`,e),getDownloadUrl:e=>n(`recordingExport`,`getDownloadUrl`,`query`,e),readExportBytes:e=>n(`recordingExport`,`readExportBytes`,`query`,e)},serverManagement:{getServerPackageStatus:e=>n(`serverManagement`,`getServerPackageStatus`,`query`,e),checkServerUpdate:e=>n(`serverManagement`,`checkServerUpdate`,`mutation`,e),applyServerUpdate:e=>n(`serverManagement`,`applyServerUpdate`,`mutation`,e),rollbackServerUpdate:e=>n(`serverManagement`,`rollbackServerUpdate`,`mutation`,e),restartServer:e=>n(`serverManagement`,`restartServer`,`mutation`,e)},settingsStore:{get:e=>n(`settingsStore`,`get`,`query`,e),set:e=>n(`settingsStore`,`set`,`mutation`,e),query:e=>n(`settingsStore`,`query`,`query`,e),upsert:e=>n(`settingsStore`,`upsert`,`mutation`,e),insert:e=>n(`settingsStore`,`insert`,`mutation`,e),insertMany:e=>n(`settingsStore`,`insertMany`,`mutation`,e),update:e=>n(`settingsStore`,`update`,`mutation`,e),delete:e=>n(`settingsStore`,`delete`,`mutation`,e),deleteWhere:e=>n(`settingsStore`,`deleteWhere`,`mutation`,e),updateWhere:e=>n(`settingsStore`,`updateWhere`,`mutation`,e),count:e=>n(`settingsStore`,`count`,`query`,e),aggregate:e=>n(`settingsStore`,`aggregate`,`query`,e),histogram:e=>n(`settingsStore`,`histogram`,`query`,e),isEmpty:e=>n(`settingsStore`,`isEmpty`,`query`,e),declareCollection:e=>n(`settingsStore`,`declareCollection`,`mutation`,e)},storage:{resolve:e=>n(`storage`,`resolve`,`query`,e),write:e=>n(`storage`,`write`,`mutation`,e),read:e=>n(`storage`,`read`,`query`,e),exists:e=>n(`storage`,`exists`,`query`,e),list:e=>n(`storage`,`list`,`query`,e),delete:e=>n(`storage`,`delete`,`mutation`,e),getAvailableSpace:e=>n(`storage`,`getAvailableSpace`,`query`,e),beginUpload:e=>n(`storage`,`beginUpload`,`mutation`,e),writeChunk:e=>n(`storage`,`writeChunk`,`mutation`,e),finalizeUpload:e=>n(`storage`,`finalizeUpload`,`mutation`,e),abortUpload:e=>n(`storage`,`abortUpload`,`mutation`,e),beginDownload:e=>n(`storage`,`beginDownload`,`mutation`,e),readChunk:e=>n(`storage`,`readChunk`,`query`,e),endDownload:e=>n(`storage`,`endDownload`,`mutation`,e),listLocations:e=>n(`storage`,`listLocations`,`query`,e),listLocationDeclarations:e=>n(`storage`,`listLocationDeclarations`,`query`,e),upsertLocation:e=>n(`storage`,`upsertLocation`,`mutation`,e),deleteLocation:e=>n(`storage`,`deleteLocation`,`mutation`,e),listDrainProgress:e=>n(`storage`,`listDrainProgress`,`query`,e),testLocation:e=>n(`storage`,`testLocation`,`query`,e),listProviders:e=>n(`storage`,`listProviders`,`query`,e),testConfig:e=>n(`storage`,`testConfig`,`query`,e)},storageMigration:{plan:e=>n(`storageMigration`,`plan`,`query`,e),start:e=>n(`storageMigration`,`start`,`mutation`,e),status:e=>n(`storageMigration`,`status`,`query`,e),cancel:e=>n(`storageMigration`,`cancel`,`mutation`,e),movers:e=>n(`storageMigration`,`movers`,`query`,e),residue:e=>n(`storageMigration`,`residue`,`query`,e),drain:e=>n(`storageMigration`,`drain`,`mutation`,e),cleanupStart:e=>n(`storageMigration`,`cleanupStart`,`mutation`,e),cleanupStatus:e=>n(`storageMigration`,`cleanupStatus`,`query`,e),cleanupCancel:e=>n(`storageMigration`,`cleanupCancel`,`mutation`,e),history:e=>n(`storageMigration`,`history`,`query`,e)},streamBroker:{fetchEventMedia:e=>n(`streamBroker`,`fetchEventMedia`,`mutation`,e),listAllCameraStreams:e=>n(`streamBroker`,`listAllCameraStreams`,`query`,e),listAllProfileSlots:e=>n(`streamBroker`,`listAllProfileSlots`,`query`,e),getBrokerStats:e=>n(`streamBroker`,`getBrokerStats`,`query`,e),probeStream:e=>n(`streamBroker`,`probeStream`,`mutation`,e),listClients:e=>n(`streamBroker`,`listClients`,`query`,e),killClient:e=>n(`streamBroker`,`killClient`,`mutation`,e),getStreamUrl:e=>n(`streamBroker`,`getStreamUrl`,`query`,e),getStreamWithCodec:e=>n(`streamBroker`,`getStreamWithCodec`,`mutation`,e),releaseStreamWithCodec:e=>n(`streamBroker`,`releaseStreamWithCodec`,`mutation`,e),acquireEgressTranscode:e=>n(`streamBroker`,`acquireEgressTranscode`,`mutation`,e),releaseEgressTranscode:e=>n(`streamBroker`,`releaseEgressTranscode`,`mutation`,e),subscribeAudioChunks:e=>n(`streamBroker`,`subscribeAudioChunks`,`mutation`,e),pullAudioChunks:e=>n(`streamBroker`,`pullAudioChunks`,`query`,e),unsubscribeAudioChunks:e=>n(`streamBroker`,`unsubscribeAudioChunks`,`mutation`,e),subscribeFrames:e=>n(`streamBroker`,`subscribeFrames`,`mutation`,e),pullFrameHandles:e=>n(`streamBroker`,`pullFrameHandles`,`query`,e),unsubscribeFrames:e=>n(`streamBroker`,`unsubscribeFrames`,`mutation`,e),setPreBufferDuration:e=>n(`streamBroker`,`setPreBufferDuration`,`mutation`,e),getPreBufferInfo:e=>n(`streamBroker`,`getPreBufferInfo`,`query`,e),getRtspPort:e=>n(`streamBroker`,`getRtspPort`,`query`,e),getAllRtspEntries:e=>n(`streamBroker`,`getAllRtspEntries`,`query`,e),getRtspEntry:e=>n(`streamBroker`,`getRtspEntry`,`query`,e),regenerateRtspToken:e=>n(`streamBroker`,`regenerateRtspToken`,`mutation`,e),setRtspEnabled:e=>n(`streamBroker`,`setRtspEnabled`,`mutation`,e),isRtspEnabled:e=>n(`streamBroker`,`isRtspEnabled`,`query`,e)},system:{info:e=>n(`system`,`info`,`query`,e),health:e=>n(`system`,`health`,`query`,e),featureFlags:e=>n(`system`,`featureFlags`,`query`,e),networkAddresses:e=>n(`system`,`networkAddresses`,`query`,e),getRetentionConfig:e=>n(`system`,`getRetentionConfig`,`query`,e),setRetentionConfig:e=>n(`system`,`setRetentionConfig`,`mutation`,e),forceRetentionCleanup:e=>n(`system`,`forceRetentionCleanup`,`mutation`,e),getSiteLocation:e=>n(`system`,`getSiteLocation`,`query`,e),setSiteLocation:e=>n(`system`,`setSiteLocation`,`mutation`,e),detectSiteLocation:e=>n(`system`,`detectSiteLocation`,`mutation`,e),getRequestCensus:e=>n(`system`,`getRequestCensus`,`query`,e),getLoadContributions:e=>n(`system`,`getLoadContributions`,`query`,e),getFailureContributions:e=>n(`system`,`getFailureContributions`,`query`,e),getLoggingSettings:e=>n(`system`,`getLoggingSettings`,`query`,e),setLoggingSettings:e=>n(`system`,`setLoggingSettings`,`mutation`,e)},terminalSession:{listProfiles:e=>n(`terminalSession`,`listProfiles`,`query`,e),listInstances:e=>n(`terminalSession`,`listInstances`,`query`,e),createInstance:e=>n(`terminalSession`,`createInstance`,`mutation`,e),updateInstance:e=>n(`terminalSession`,`updateInstance`,`mutation`,e),deleteInstance:e=>n(`terminalSession`,`deleteInstance`,`mutation`,e),setInstanceEnabled:e=>n(`terminalSession`,`setInstanceEnabled`,`mutation`,e),listLegacyCameras:e=>n(`terminalSession`,`listLegacyCameras`,`query`,e),adoptLegacyMonitor:e=>n(`terminalSession`,`adoptLegacyMonitor`,`mutation`,e),listSessions:e=>n(`terminalSession`,`listSessions`,`query`,e),openSession:e=>n(`terminalSession`,`openSession`,`mutation`,e),resize:e=>n(`terminalSession`,`resize`,`mutation`,e),pullOutput:e=>n(`terminalSession`,`pullOutput`,`mutation`,e),writeInput:e=>n(`terminalSession`,`writeInput`,`mutation`,e),close:e=>n(`terminalSession`,`close`,`mutation`,e)},toast:{onToast:(e,t)=>n(`toast`,`onToast`,`subscription`,e,t)},turnProvider:{getTurnServers:e=>n(`turnProvider`,`getTurnServers`,`query`,e)},userManagement:{listUsers:e=>n(`userManagement`,`listUsers`,`query`,e),createUser:e=>n(`userManagement`,`createUser`,`mutation`,e),updateUser:e=>n(`userManagement`,`updateUser`,`mutation`,e),deleteUser:e=>n(`userManagement`,`deleteUser`,`mutation`,e),resetPassword:e=>n(`userManagement`,`resetPassword`,`mutation`,e),setUserScopes:e=>n(`userManagement`,`setUserScopes`,`mutation`,e),validateCredentials:e=>n(`userManagement`,`validateCredentials`,`mutation`,e),listApiKeys:e=>n(`userManagement`,`listApiKeys`,`query`,e),createApiKey:e=>n(`userManagement`,`createApiKey`,`mutation`,e),revokeApiKey:e=>n(`userManagement`,`revokeApiKey`,`mutation`,e),validateApiKey:e=>n(`userManagement`,`validateApiKey`,`mutation`,e),createScopedToken:e=>n(`userManagement`,`createScopedToken`,`mutation`,e),revokeScopedToken:e=>n(`userManagement`,`revokeScopedToken`,`mutation`,e),validateScopedToken:e=>n(`userManagement`,`validateScopedToken`,`query`,e),listScopedTokens:e=>n(`userManagement`,`listScopedTokens`,`query`,e),setupTotp:e=>n(`userManagement`,`setupTotp`,`mutation`,e),confirmTotp:e=>n(`userManagement`,`confirmTotp`,`mutation`,e),disableTotp:e=>n(`userManagement`,`disableTotp`,`mutation`,e),getTotpStatus:e=>n(`userManagement`,`getTotpStatus`,`query`,e),verifyTotp:e=>n(`userManagement`,`verifyTotp`,`mutation`,e),oauthIssueCode:e=>n(`userManagement`,`oauthIssueCode`,`mutation`,e),oauthExchangeCode:e=>n(`userManagement`,`oauthExchangeCode`,`mutation`,e),oauthRefresh:e=>n(`userManagement`,`oauthRefresh`,`mutation`,e),oauthVerifyAccessToken:e=>n(`userManagement`,`oauthVerifyAccessToken`,`query`,e),listOauthSessions:e=>n(`userManagement`,`listOauthSessions`,`query`,e),revokeOauthSession:e=>n(`userManagement`,`revokeOauthSession`,`mutation`,e)}}}var pW=`2026-09-11T00:00:00.000Z`,mW=Date.parse(pW),hW={PCMU:20*Math.log10(4),PCMA:20*Math.log10(8)};function gW(e,t){return t+hW[e]}function _W(e){return!Number.isFinite(e)||e<=0?`unknown`:e>=mW?`itu`:`pre-itu`}var vW=`audio-`;function yW(e){return e.startsWith(vW)?e.slice(6):e}function bW(e){return e.startsWith(vW)?e:`${vW}${e}`}var xW=-96,SW=0,CW=3,wW=Math.round(gW(`PCMU`,-55)),TW=1,EW=100,DW=1,OW=300,kW=2,AW=5,jW=1,MW=20,NW=1,PW=60,FW={hitPercent:60,samplingSeconds:10};function IW(e){return e??FW}function LW(e){return e===void 0?null:e.labels!==void 0&&e.labels.length>0?`label`:e.dbThreshold===void 0?null:`level`}function RW(e){return e===void 0?!1:e.dbThreshold===void 0&&(e.labels===void 0||e.labels.length===0)}function zW(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,Math.round(e))):t}function BW(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function VW(e,t){let n=IW(e),r=BW(t,`labels`)?t.labels:n.labels,i=BW(t,`dbThreshold`)?t.dbThreshold:n.dbThreshold,a=r!==void 0&&r.length>0,o=t.mode??(BW(t,`labels`)&&a?`label`:BW(t,`dbThreshold`)&&i!==void 0?`level`:a?`label`:i===void 0?null:`level`),s=o===`label`&&a?r:void 0,c=o===`level`?i??(t.mode===`level`?wW:void 0):void 0;return{...s===void 0?{}:{labels:[...s]},...c===void 0?{}:{dbThreshold:zW(c,-96,0)},hitPercent:zW(t.hitPercent??n.hitPercent,1,100),samplingSeconds:zW(t.samplingSeconds??n.samplingSeconds,1,300),...(()=>{let e=BW(t,`confirmHits`)?t.confirmHits:n.confirmHits,r=BW(t,`confirmWindowSec`)?t.confirmWindowSec:n.confirmWindowSec;return{...e===void 0?{}:{confirmHits:zW(e,1,20)},...r===void 0?{}:{confirmWindowSec:zW(r,1,60)}}})()}}function HW(e,t){let n=e?.audioKinds??[],r=n.length>0?n.map(e=>{let t=yW(e.kind);return{value:t,label:e.label,iconId:bW(t),unknown:!1}}):Cx.map(e=>({value:e.id,label:e.name,iconId:bW(e.id),unknown:!1})),i=new Set(r.map(e=>e.value)),a=[];for(let e of t??[]){let t=yW(e);i.has(t)||a.includes(t)||(a.push(t),r.push({value:t,label:t,iconId:bW(t),unknown:!0}))}return{choices:r,unknownLabels:a}}function UW(e,t){let n=yW(t);return(e??[]).some(e=>yW(e)===n)}function WW(e,t){let n=yW(t),r=e??[];if(UW(r,n)){let e=r.filter(e=>yW(e)!==n);return e.length>0?e:void 0}return[...r,n]}var GW=new Set([`classes`,`classesExclude`]),KW=new Set([`sensorKinds`]),qW=new Set([`occupancy`]);function JW(e){return{value:e.kind,label:e.label}}function YW(e){let t=[],n=new Map,r=(e,r)=>{let i=n.get(e);if(i!==void 0)return i;let a={fallbackLabel:r,options:[]};return n.set(e,a),t.push(e),a};for(let t of e){let e=t.parentKind??t.kind,n=r(e,t.parentKind===null?t.label:e);n.options.push(JW(t)),t.parentKind===null&&(n.fallbackLabel=t.label)}return t.flatMap(e=>{let t=n.get(e);return t===void 0?[]:[{key:e,fallbackLabel:t.fallbackLabel,options:t.options}]})}function XW(e){let t=[],n=new Map;for(let r of e){let e=r.parentKind??`other`,i=n.get(e);i===void 0?(n.set(e,[JW(r)]),t.push(e)):i.push(JW(r))}return t.flatMap(e=>{let t=n.get(e);return t===void 0?[]:[{key:e,fallbackLabel:e,options:t}]})}function ZW(e,t){if(!t)return null;if(GW.has(e)){let e=YW(t.videoClasses);return t.audioKinds.length>0&&e.push({key:`audio`,fallbackLabel:`Audio`,options:t.audioKinds.map(JW)}),e.length>0?{groups:e}:null}if(qW.has(e)){let e=t.videoClasses.filter(e=>e.parentKind===null).map(JW);return e.length>0?{groups:[{key:`macro`,fallbackLabel:`Classes`,options:e}]}:null}if(KW.has(e)){let e=XW(t.labels);return e.length>0?{groups:e}:null}return null}var QW=`audio`;function $W(e){let t=ZW(`classes`,e);if(t===null)return null;let n=t.groups.filter(e=>e.key!==QW);return n.length>0?{groups:n}:null}function eG(e){return e.trim().toLowerCase().startsWith(`${QW}-`)}function tG(e){let t=new Set;for(let n of e.groups)for(let e of n.options)t.add(e.value);return t}var nG=[`devices`,`classes`],rG=new Set(nG);function iG(e){return rG.has(e)}function aG(e){return e.replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/(\*\*|__)(.*?)\1/g,`$2`).replace(/(\*|_)(.*?)\1/g,`$2`).replace(/`([^`]*)`/g,`$1`).replace(/^\s{0,3}#{1,6}\s*/gm,``).replace(/^\s{0,3}>\s?/gm,``).replace(/^\s{0,3}[-*+]\s+/gm,``).replace(/^\s{0,3}\d+\.\s+/gm,``).trim()}var oG=[[/&nbsp;/g,` `],[/&amp;/g,`&`],[/&lt;/g,`<`],[/&gt;/g,`>`],[/&quot;/g,`"`],[/&#39;/g,`'`]];function sG(e){let t=e.replace(/<\s*br\s*\/?\s*>/gi,`
346
+ `).replace(/<\s*\/\s*(p|div|li|h[1-6])\s*>/gi,`
347
+ `).replace(/<[^>]+>/g,``);for(let[e,n]of oG)t=t.replace(e,n);return t.replace(/\n{3,}/g,`
348
+
349
+ `).trim()}var cG=[[/&/g,`&amp;`],[/</g,`&lt;`],[/>/g,`&gt;`],[/"/g,`&quot;`],[/'/g,`&#39;`]];function lG(e){let t=e;for(let[e,n]of cG)t=t.replace(e,n);return t}function uG(e){return lG(e).replace(/\n/g,`<br>`)}function dG(e){return lG(e).replace(/(\*\*|__)(.*?)\1/g,`<b>$2</b>`).replace(/(\*|_)(.*?)\1/g,`<i>$2</i>`).replace(/`([^`]*)`/g,`<code>$1</code>`).replace(/\[([^\]]*)\]\(([^)]*)\)/g,`<a href="$2">$1</a>`).replace(/\n/g,`<br>`)}var fG={text:[`text`,`markdown`,`html`],markdown:[`markdown`,`html`,`text`],html:[`html`,`text`,`markdown`]};function pG(e,t){for(let n of fG[e]??fG.text)if(t.includes(n))return n;return t[0]??`text`}function mG(e,t,n){if(t===n)return e;if(n===`text`){if(t===`markdown`)return aG(e);if(t===`html`)return sG(e)}if(n===`html`){if(t===`text`)return uG(e);if(t===`markdown`)return dG(e)}if(n===`markdown`){if(t===`text`)return e;if(t===`html`)return sG(e)}return e}function hG(e){return{id:e.id,ordinal:e.ordinal,...e.flags?{flags:e.flags}:{},...e.requires?{requires:e.requires}:{}}}function gG(e,t){if(e.length===0)return null;if(t.level!==void 0){let n=e.find(e=>e.id===t.level);if(n)return hG(n)}let n=e.filter(e=>e.ordinal!==null);if(n.length===0)return hG(e[0]);let r=t.priority;return hG([...n].sort((e,t)=>{let n=Math.abs((e.ordinal??0)-r),i=Math.abs((t.ordinal??0)-r);return n===i?(t.ordinal??0)-(e.ordinal??0):n-i})[0])}function _G(e,t){if(!Number.isFinite(t)||t<=0||e.length<=t)return[e];let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function vG(e,t){let n=[],r=t.format,i=pG(r,e.format);i!==r&&n.push(`format`);let a=mG(t.body,r,i),o=gG(e.levels,t),s=t.attachments??[],c=[];for(let t of s){if(!e.attachments.mediaTypes.includes(t.mediaType)){n.push(`attachment:${t.mediaType}`);continue}if(e.attachments.mode===`url`&&t.url===void 0){n.push(`attachment:noUrl`);continue}if(t.bytes!==void 0&&e.attachments.maxBytes!==void 0&&t.bytes.length>e.attachments.maxBytes){n.push(`attachment:maxBytes`);continue}if(c.length>=e.attachments.max){n.push(`attachment:max`);continue}let r=e.attachments.mode===`bytes`&&t.bytes===void 0&&t.url!==void 0;c.push({mediaType:t.mediaType,...t.url===void 0?{}:{url:t.url},...t.bytes===void 0?{}:{bytes:t.bytes},...t.mime===void 0?{}:{mime:t.mime},...t.name===void 0?{}:{name:t.name},needsFetch:r})}let l=t.actions??[],u=l.slice(0,Math.max(0,e.actions));l.length>u.length&&n.push(`actions`);let d=e.actionIcons===!0;!d&&u.some(e=>e.icon!==void 0)&&n.push(`actionIcons`);let f=d?u:u.map(({icon:e,...t})=>t),p=null;t.clickUrl!==void 0&&(e.clickUrl?p=t.clickUrl:n.push(`clickUrl`));let m=null;t.sound!==void 0&&(e.sound?m=t.sound:n.push(`sound`));let ee=null;t.ttl!==void 0&&(e.ttl?ee=t.ttl:n.push(`ttl`));let h=t.tag??null,te=_G(a,e.bodyMaxLen),ne=te.length>1,re={level:o?.id??``,format:i,attachmentsSent:c.length,actionsSent:f.length,truncated:ne,dropped:n};return{body:te[0]??``,...t.title===void 0?{}:{title:t.title},format:i,level:o,attachments:c,actions:f,clickUrl:p,sound:m,ttl:ee,tag:h,bodyParts:te,renderedAs:re}}var yG=[`deviceIds`,`deviceTypes`,`nodeIds`,`packageNames`,`consumableLowPercent`];function bG(e,t){switch(t){case`deviceIds`:return e.startsWith(`device-`)||e.startsWith(`stream-`)||e===`detection-blind`||e===`alarm-triggered`;case`deviceTypes`:return e.startsWith(`device-`)||e===`detection-blind`;case`nodeIds`:return e.startsWith(`node-`)||e===`addon-crash-loop`||e===`addon-update-available`||e===`addon-updated`||e===`server-update-available`||e===`wrapper-update-available`||e===`server-updated`;case`packageNames`:return e.endsWith(`update-available`)||e===`addon-updated`||e===`server-updated`;case`consumableLowPercent`:return sS.includes(e)}}function xG(e,t){return e.some(e=>bG(e,t))}var SG=[`device-events`,`system`,`alarm`];function CG(e){return SG.some(t=>t===e)}var wG={"device-online":`device-events`,"device-offline":`device-events`,"device-disabled":`device-events`,"device-enabled":`device-events`,"device-battery-low":`device-events`,"device-battery-normal":`device-events`,"device-consumable-low":`device-events`,"device-consumable-normal":`device-events`,"device-tank-low":`device-events`,"device-tank-full":`device-events`,"device-tank-normal":`device-events`,"stream-online":`device-events`,"stream-offline":`device-events`,"detection-blind":`device-events`,"node-online":`system`,"node-offline":`system`,"node-inference-unavailable":`system`,"addon-crash-loop":`system`,"addon-update-available":`system`,"addon-updated":`system`,"server-update-available":`system`,"server-updated":`system`,"wrapper-update-available":`system`,"backup-completed":`system`,"export-completed":`system`,"alarm-triggered":`alarm`,"alarm-armed":`alarm`,"alarm-disarmed":`alarm`,"alarm-arming":`alarm`,"alarm-arm-refused":`alarm`,"alarm-pending":`alarm`,"alarm-rearmed":`alarm`,"alarm-sensor-bypass":`alarm`,"alarm-check-failed":`alarm`,"camera-online":null,"camera-offline":null,"camera-disabled":null,"camera-enabled":null},TG=new Map(Object.entries(wG)),EG=[...yG,`excludeDeviceIds`],DG={"device-events":[`deviceIds`,`excludeDeviceIds`,`deviceTypes`,`consumableLowPercent`],system:[`nodeIds`,`packageNames`],alarm:[`deviceIds`]},OG=[{id:`device-state`,family:`device-events`,label:`Device state`,kinds:[`device-offline`,`device-online`,`device-disabled`,`device-enabled`]},{id:`streams`,family:`device-events`,label:`Streams`,kinds:[`stream-offline`,`stream-online`]},{id:`battery`,family:`device-events`,label:`Battery`,kinds:[`device-battery-low`,`device-battery-normal`]},{id:`consumables`,family:`device-events`,label:`Consumables`,kinds:[`device-consumable-low`,`device-consumable-normal`]},{id:`tanks`,family:`device-events`,label:`Tanks`,kinds:[`device-tank-low`,`device-tank-full`,`device-tank-normal`]},{id:`detection-blind`,family:`device-events`,label:`Detecting nothing`,kinds:[`detection-blind`]},{id:`nodes`,family:`system`,label:`Nodes`,kinds:[`node-offline`,`node-online`,`node-inference-unavailable`]},{id:`addons`,family:`system`,label:`Addons`,kinds:[`addon-crash-loop`,`addon-update-available`,`addon-updated`]},{id:`updates`,family:`system`,label:`Server & container updates`,kinds:[`server-update-available`,`server-updated`,`wrapper-update-available`]},{id:`backups-exports`,family:`system`,label:`Backups & exports`,kinds:[`backup-completed`,`export-completed`]},{id:`alarm`,family:`alarm`,label:`Alarm`,kinds:aS}];function kG(e){return OG.filter(t=>t.family===e).flatMap(e=>e.kinds)}function AG(e){if(typeof e!=`object`||!e||!(`kinds`in e))return;let t=e.kinds;if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}function jG(e){let t=new Set;for(let n of e){let e=TG.get(n);if(e==null)return{kind:`mixed`};t.add(e)}let[n]=[...t];return t.size===1&&n!==void 0?{kind:`family`,family:n}:{kind:`mixed`}}function MG(e){if(e===void 0||e.kinds.length===0)return[{code:`no-kinds`}];let t=[],n=new Set;for(let r of e.kinds){let e=wG[r];e===null?t.push({code:`legacy-kind`,kind:r}):n.add(e)}let r=SG.filter(e=>n.has(e));r.length>1&&t.push({code:`mixed-families`,families:r});let[i]=r;if(r.length!==1||i===void 0)return t;let a=DG[i];for(let n of EG)e[n]!==void 0&&!a.includes(n)&&t.push({code:`filter-outside-family`,filter:n,family:i});return t}function NG(e){switch(e.code){case`no-kinds`:return`a system-event rule needs at least one event kind`;case`legacy-kind`:return`'${e.kind}' is a legacy kind and cannot be authored`;case`mixed-families`:return`event kinds span ${e.families.join(` + `)} — one rule per family`;case`filter-outside-family`:return`filter '${e.filter}' is not allowed on a ${e.family} rule`}}var PG=[`device-events`,`system`,`alarm`,`mixed`];function FG(e){return PG.some(t=>t===e)}function IG(e){return CG(e)?e:void 0}var LG=`An occupancy edge is not a sensor event: it carries no sensor kind, so this condition can never match one.`,RG=`An occupancy edge carries no device event-type token — that comes from an event-emitter slice, which a count crossing has none of.`,zG=`An occupancy edge is a count crossing, not a sensor reading: it has no raise or clear, so this choice could never narrow it.`,BG=`An occupancy edge is always produced by the pipeline, so any other source can never match and “pipeline” narrows nothing.`,VG=`A confirmed sound window is always stamped as an audio subject, so any other source can never match.`,HG=`A sound rule fires on what the camera HEARD. Its subject carries no detection, so this condition can never match one — name the sounds in the Sound condition instead.`,UG=`A sound window’s evidence is a percentage of samples, not a detector score, so a confidence threshold can never be satisfied.`,WG=`A sound has no position in the frame, so a zone or a drawn polygon can never match it.`,GG=[{kind:`detection`,label:`Conditions`,excluded:{audio:`A detection rule fires on what the camera SAW. Sounds are a Sound rule of their own — adding one here turned the rule into a sound rule and dropped every detection condition.`},editable:!0,carriesMedia:!0,carriesSubjectCrop:!0},{kind:`sensor`,label:`Conditions`,excluded:{},editable:!0,carriesMedia:!0,carriesSubjectCrop:!0,blurb:`A doorbell press or a linked sensor changing state. The picture comes from the camera the sensor is attributed to.`},{kind:`occupancy`,label:`Occupancy`,discriminator:`occupancy`,excluded:{sensorKinds:LG,eventTypeTokens:RG,sensorTransition:zG,source:BG},editable:!0,carriesMedia:!0,carriesSubjectCrop:!0,blurb:`Fires when the count in a camera frame or a zone crosses your threshold and holds. Pick the camera first — the zone list is that camera’s.`},{kind:`sound`,label:`Sound`,discriminator:`audio`,excluded:{classes:HG,classesExclude:HG,minConfidence:UG,zones:WG,zonesExclude:WG,customZones:WG,crossing:WG,labelEquals:HG,identities:HG,identitiesExclude:HG,plates:HG,source:VG},editable:!0,carriesMedia:!0,carriesSubjectCrop:!1,blurb:`Fires on a confirmed sampling window of audio, never on a picture. Name the sounds and/or keep a level threshold — with neither it can never match.`,mediaBlurb:`A sound owns no frame, so the picture is a photograph of the camera taken at the moment of the match — the whole scene, never a crop. The GIF and the clip are cut around the same instant, from the camera.`},{kind:`device-events`,label:`Device events`,discriminator:`systemEvent`,excluded:{},editable:!0,carriesMedia:!1,carriesSubjectCrop:!1,blurb:`A device or its stream going away or coming back, switched off or on, a battery or consumable running low, a camera detecting nothing. There is no frame to attach.`},{kind:`system`,label:`System events`,discriminator:`systemEvent`,excluded:{},editable:!0,carriesMedia:!1,carriesSubjectCrop:!1,blurb:`The installation itself: a node leaving, an addon crash-looping, an update available or installed, a backup or an export finishing.`},{kind:`alarm`,label:`Alarm`,discriminator:`systemEvent`,excluded:{},editable:!0,carriesMedia:!1,carriesSubjectCrop:!1,blurb:`The alarm panel: refused, arming, armed, entry delay, triggered, re-armed, sensor bypass, disarmed.`,mediaBlurb:`An alarm set off by a rule arrives with THAT rule's pictures, combined into one notification. This rule adds none of its own.`},{kind:`mixed`,label:`To recreate`,discriminator:`systemEvent`,excluded:{},editable:!1,carriesMedia:!1,carriesSubjectCrop:!1,blurb:`This rule mixes events from more than one family (device events, system, alarm). It keeps firing as it is, but it can no longer be edited: create one rule per family, then delete this one.`}];function KG(e){return GG.find(t=>t.kind===e)??GG[0]}function qG(e){return GG.filter(t=>t.discriminator===e).map(e=>e.kind)}var JG=`system-event`;function YG(e){return e===JG}function XG(e){switch(e){case`sensor`:return lk;case`detection`:case`occupancy`:return[`detection-pipeline`];case`sound`:return[`audio-metrics`];case`device-events`:case`system`:case`alarm`:case`mixed`:return null}}var ZG=`camera-streams`;function QG(e){let t=XG(e);return t===null?null:e===`sensor`?[t,[ZG]]:[t]}function $G(e){return YG(e.delivery)?eK(e.conditions.systemEvent):e.conditions.occupancy!==void 0&&e.delivery===`device-event`?`occupancy`:e.conditions.audio!==void 0&&e.delivery===`immediate`?`sound`:e.delivery===`device-event`?`sensor`:`detection`}function eK(e){let t=jG(AG(e)??[]);return t.kind===`family`?t.family:`mixed`}function tK(e,t,n){let r=KG(n);return e.id===r.discriminator?!0:e.appliesTo.includes(t)?r.excluded[e.id]===void 0:!1}function nK(e,t){let n=KG(t);return e===n.discriminator?null:n.excluded[e]??null}function rK(e,t){let n=KG(t),r=[];for(let[t,i]of Object.entries(e)){if(i===void 0||Array.isArray(i)&&i.length===0)continue;let e=n.excluded[t];e!==void 0&&r.push({conditionId:t,reason:e})}return r}var iK=[{key:`all`,label:`All rules`,blurb:`Every notification rule, whatever its trigger. Each rule picks a trigger, matches conditions and fans out to one or more delivery targets.`,newRuleLabel:`New rule`,emptyHint:`No notification rules yet. Create one to be told what your cameras see.`,creatable:!0},{key:`detection`,label:`Detections`,blurb:`Rules driven by what the cameras SEE — detections, tracks and package events.`,newRuleLabel:`New detection rule`,emptyHint:`No detection rules yet. Create one to be told what your cameras see.`,creatable:!0},{key:`sensor`,label:`Sensors`,blurb:`Rules driven by a device or sensor CHANGING STATE — a doorbell press, a linked sensor opening or closing. The picture comes from the camera the sensor is attributed to.`,newRuleLabel:`New sensor rule`,emptyHint:`No sensor rules yet. Create one to be told when a doorbell is pressed or a linked sensor changes.`,creatable:!0},{key:`audio`,label:`Sound`,blurb:`Rules on what the cameras HEAR: a sustained window of sound loud enough, or classified as one of the sounds you name. A sound rule fires only on a confirmed sampling window, never on a picture.`,newRuleLabel:`New sound rule`,emptyHint:`No sound rules yet. A new sound rule opens on the sound condition already filled in with a level threshold, so you only have to name the sounds and the targets.`,creatable:!0},{key:`occupancy`,label:`Occupancy`,blurb:`Rules on how many objects are in a camera frame or a zone, and for how long: "the driveway became occupied", "the garden emptied".`,newRuleLabel:`New occupancy rule`,emptyHint:`No occupancy rules yet. A new occupancy rule opens on the occupancy condition; pick the camera first, then the zone and the count.`,creatable:!0},{key:`device-events`,label:`Device events`,blurb:`Rules about your devices: offline or back, switched off or on, a stream dropping, a battery or consumable running low, a camera detecting nothing.`,newRuleLabel:`New device-event rule`,emptyHint:`No device-event rules yet. These tell you when a device drops, a battery runs low or a camera goes blind.`,creatable:!0},{key:`system`,label:`System events`,blurb:`Rules about the installation: a node leaving the cluster, an addon crash-looping, an update available or installed, a backup or export finishing.`,newRuleLabel:`New system rule`,emptyHint:`No system rules yet. These tell you when a node leaves, an update lands or a backup finishes.`,creatable:!0},{key:`alarm`,label:`Alarm`,blurb:`Rules about the alarm panel: arming, armed, triggered, disarmed, and the refusals in between.`,newRuleLabel:`New alarm rule`,emptyHint:`No alarm rules yet. These tell you when the alarm arms, goes off or is disarmed.`,creatable:!0},{key:`mixed`,label:`To recreate`,blurb:`System rules authored before the three families existed. Each mixes families, keeps firing as it is, and can only be read or deleted: recreate it as one rule per family.`,newRuleLabel:`New rule`,emptyHint:`Nothing to recreate.`,creatable:!1}];function aK(e){return iK.find(t=>t.key===e)??iK[0]}function oK(e){return iK.find(t=>t.key===e)?.key}function sK(e){return e.conditions.audio!==void 0}function cK(e){return e.conditions.occupancy!==void 0}function lK(e,t){return t===`all`?!0:YG(e.delivery)?$G(e)===t:t===`audio`?sK(e):t===`occupancy`?cK(e):t===`sensor`?e.delivery===`device-event`&&!cK(e):t===`detection`?!sK(e)&&!cK(e)&&e.delivery!==`device-event`:!1}function uK(e){return YG(e.delivery)?eK(e.conditions.systemEvent):sK(e)?`audio`:cK(e)?`occupancy`:e.delivery===`device-event`?`sensor`:`detection`}var dK={op:`became-occupied`,count:1,sustainSeconds:15},fK={hitPercent:FW.hitPercent,samplingSeconds:FW.samplingSeconds,dbThreshold:wW};function pK(e){switch(e){case`device-events`:return{delivery:JG,conditions:{systemEvent:{kinds:[`device-offline`,`device-online`]}}};case`system`:return{delivery:JG,conditions:{systemEvent:{kinds:[`node-offline`,`node-online`]}}};case`alarm`:return{delivery:JG,conditions:{systemEvent:{kinds:[`alarm-triggered`]}}};case`audio`:return{delivery:`immediate`,conditions:{audio:fK}};case`occupancy`:return{delivery:`device-event`,conditions:{occupancy:dK}};case`sensor`:return{delivery:`device-event`,conditions:{}};default:return{delivery:`immediate`,conditions:{source:`pipeline`}}}}function mK(e){return pK(e).delivery}var hK=[`rule`,`devices`,`conditions`,`notification`,`actions`,`advanced`],gK={rule:`Rule`,devices:`Cameras`,conditions:`Conditions`,notification:`Notification`,actions:`Actions`,advanced:`Advanced`};function _K(e){let t=KG(e),n=[];for(let r of hK)r===`devices`&&FG(e)||n.push({key:r,label:r===`conditions`?t.label:gK[r]});return n}var vK={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6},yK=new Map;function bK(e){let t=yK.get(e);if(t!==void 0)return t;let n;try{n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,weekday:`short`,hour:`numeric`,minute:`numeric`,hourCycle:`h23`})}catch{n=null}return yK.set(e,n),n}function xK(e,t){let n=new Date(e),r=t===void 0?null:bK(t);if(r!==null)try{let e=r.formatToParts(n),t,i,a;for(let n of e)n.type===`weekday`?t=n.value:n.type===`hour`?i=Number(n.value):n.type===`minute`&&(a=Number(n.value));let o=t===void 0?void 0:vK[t];if(o!==void 0&&i!==void 0&&a!==void 0)return{day:o,minute:i*60+a}}catch{}return{day:n.getDay(),minute:n.getHours()*60+n.getMinutes()}}function SK(e,t){if(e===void 0)return!0;let{day:n,minute:r}=xK(t,e.timezone),i=(n+6)%7,a=!1;for(let t of e.windows)if(t.startMinute<=t.endMinute){if(t.days.includes(n)&&r>=t.startMinute&&r<t.endMinute){a=!0;break}}else if(t.days.includes(n)&&r>=t.startMinute||t.days.includes(i)&&r<t.endMinute){a=!0;break}return e.invert===!0?!a:a}var CK=`armed_`,wK=`alarm-panel`,TK=`trigger`,EK=[`contact`,`cover`,`lock`];function DK(e){return(e.conditions.deviceState?.states??[]).some(e=>e.trim().toLowerCase().startsWith(CK))?!0:(e.onTrigger??[]).some(e=>e.enabled&&e.actions.some(e=>e.kind===`cap`&&e.cap===wK&&e.method===TK))}function OK(e){let t=e.trim().toLowerCase();return EK.some(e=>e===t)}function kK(e){let t=e.conditions.sensorKinds??[];return e.conditions.sensorTransition!==`cleared`||t.length===0||!t.every(OK)?!1:DK(e)}var AK=`This rule belongs to the alarm, and an alarm rule fires only when an opening OPENS. Set to “only when it clears”, it can never fire.`,jK=[`exitDelaySec`,`entryDelaySec`,`triggeredDurationSec`];function MK(e,t){return e===void 0?{value:t,source:`default`}:{value:e,source:`mode`}}function NK(e,t){let n=(e.modeDelays??[]).find(e=>e.mode===t),r=MK(n?.exitDelaySec,e.exitDelaySec),i=MK(n?.entryDelaySec,e.entryDelaySec),a=MK(n?.triggeredDurationSec,e.triggeredDurationSec);return{exitDelaySec:r.value,entryDelaySec:i.value,triggeredDurationSec:a.value,source:{exitDelaySec:r.source,entryDelaySec:i.source,triggeredDurationSec:a.source}}}function PK(e,t){return t===void 0?e:t===null?void 0:t}function FK(e,t){let n=e.map(e=>({...e}));for(let e of t){let t=n.findIndex(t=>t.mode===e.mode),r=t>=0?n[t]??{mode:e.mode}:{mode:e.mode},i={mode:e.mode},a=PK(r.exitDelaySec,e.exitDelaySec),o=PK(r.entryDelaySec,e.entryDelaySec),s=PK(r.triggeredDurationSec,e.triggeredDurationSec);a!==void 0&&(i.exitDelaySec=a),o!==void 0&&(i.entryDelaySec=o),s!==void 0&&(i.triggeredDurationSec=s),t>=0?n[t]=i:n.push(i)}return n.filter(e=>e.exitDelaySec!==void 0||e.entryDelaySec!==void 0||e.triggeredDurationSec!==void 0)}function IK(e,t){let n=e.map(e=>({mode:e.mode,deviceIds:[...e.deviceIds]})),r=n.findIndex(e=>e.mode===t.mode),i=r>=0?n[r]?.deviceIds??[]:[],a=i.includes(t.deviceId);if(t.nonBlocking===a)return{kind:`applied`,lists:n,changed:!1};if(t.nonBlocking){if(i.length>=200)return{kind:`refused`,reason:`list-full`,mode:t.mode,max:200};let e={mode:t.mode,deviceIds:[...i,t.deviceId]};r>=0?n[r]=e:n.push(e)}else{let e={mode:t.mode,deviceIds:i.filter(e=>e!==t.deviceId)};r>=0&&(n[r]=e)}return{kind:`applied`,lists:n.filter(e=>e.deviceIds.length>0),changed:!0}}function LK(e,t){let n=new Set(e),r=new Set(t);return n.size===r.size&&[...n].every(e=>r.has(e))}function RK(e){let t=new Map;for(let n of e)n.deviceIds.length>0&&t.set(n.mode,new Set(n.deviceIds));return t}function zK(e,t){let n=RK(e),r=RK(t);if(n.size!==r.size)return!1;for(let[e,t]of n){let n=r.get(e);if(n===void 0||!LK([...t],[...n]))return!1}return!0}function BK(e,t){if(e!==void 0)switch(t){case`exitDelaySec`:return e.exitDelaySec;case`entryDelaySec`:return e.entryDelaySec;case`triggeredDurationSec`:return e.triggeredDurationSec}}function VK(e,t){switch(t){case`exitDelaySec`:return e.exitDelaySec;case`entryDelaySec`:return e.entryDelaySec;case`triggeredDurationSec`:return e.triggeredDurationSec}}function HK(e,t){if(e.exitDelaySec!==void 0&&e.exitDelaySec!==t.exitDelaySec||e.entryDelaySec!==void 0&&e.entryDelaySec!==t.entryDelaySec||e.triggeredDurationSec!==void 0&&e.triggeredDurationSec!==t.triggeredDurationSec||e.announceTargets!==void 0&&!LK(e.announceTargets,t.announceTargets)||e.nonBlocking!==void 0&&!zK(e.nonBlocking,t.nonBlocking??[]))return!1;for(let n of e.modeDelays??[]){let e=(t.modeDelays??[]).find(e=>e.mode===n.mode);for(let t of jK){let r=VK(n,t);if(r===void 0)continue;let i=BK(e,t);if(r===null?i!==void 0:i!==r)return!1}}if(e.nonBlockingEdit!==void 0){let n=e.nonBlockingEdit;if(((t.nonBlocking??[]).find(e=>e.mode===n.mode)?.deviceIds.includes(n.deviceId)??!1)!==n.nonBlocking)return!1}return!0}var UK=Object.freeze(Object.fromEntries(Object.entries(ck).flatMap(([e,t])=>{let n=yr[e];return n===void 0||t.category!==`sensor`?[]:[[t.kind,n]]}))),WK=Object.freeze(Object.keys(UK));function GK(e){return e.trim().toLowerCase()}function KK(e,t){if(t===null)return;let n=UK[GK(e)];if(n===void 0)return;let r=Object.entries(t).find(([e])=>e===n)?.[1];return typeof r==`boolean`?r:void 0}function qK(e){return e===void 0||e.length===0?!1:e.every(e=>WK.includes(GK(e)))}var JK=`Only a sensor that raises and clears (water, smoke, gas, CO, vibration, tamper, motion, contact) can fire on one edge. Pick only such sensor kinds, or the rule fires on every change.`,YK=[`body`],Z=[`title`,`body`],XK=[`device-battery-low`,`device-battery-normal`],ZK=[`device-consumable-low`,`device-consumable-normal`],QK=[`device-tank-low`,`device-tank-full`,`device-tank-normal`],$K=[`addon-update-available`,`server-update-available`,`wrapper-update-available`],eq=[`addon-update-available`,`server-update-available`],tq=[`alarm-triggered`,`alarm-armed`,`alarm-disarmed`,`alarm-arming`,`alarm-arm-refused`,`alarm-pending`,`alarm-rearmed`,`alarm-sensor-bypass`,`alarm-check-failed`],nq=[`alarm-triggered`],rq=[`device-online`,`device-offline`,`device-disabled`,`device-enabled`,...XK,...ZK,...QK,`stream-online`,`stream-offline`,`detection-blind`,...tq],iq=[...kG(`device-events`),...kG(`system`)],aq=[{name:`summaryDevices`,label:`Summary: devices offline / switched off`,example:`Garage — offline since 07:12`,kinds:[`device-offline`,`device-online`,`device-disabled`,`device-enabled`]},{name:`summaryStreams`,label:`Summary: streams offline`,example:`Ingresso (high) — since 06:40`,kinds:[`stream-offline`,`stream-online`]},{name:`summaryBattery`,label:`Summary: low batteries`,example:`Sensore porta — 8 %`,kinds:XK},{name:`summaryConsumables`,label:`Summary: consumables`,example:`Robot — filter 10 %`,kinds:ZK},{name:`summaryTanks`,label:`Summary: tanks`,example:`Robot — clean water low`,kinds:QK},{name:`summaryDetection`,label:`Summary: cameras detecting nothing`,example:`Ingresso — since 05:10`,kinds:[`detection-blind`]},{name:`summaryNodes`,label:`Summary: nodes`,example:`little-unraid — offline since 03:00`,kinds:[`node-offline`,`node-online`,`node-inference-unavailable`]},{name:`summaryAddons`,label:`Summary: addons`,example:`@camstack/addon-recorder 1.2.3 → 1.2.4`,kinds:[`addon-crash-loop`,`addon-update-available`,`addon-updated`]},{name:`summaryUpdates`,label:`Summary: server & container updates`,example:`server 1.2.377 → 1.2.378`,kinds:[`server-update-available`,`server-updated`,`wrapper-update-available`]}],oq=[{name:`summaryText`,label:`Summary: every section`,description:`One block per section with something to report, one line per item.`,example:`Batterie scariche: Sensore porta — 8 %`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...iq],systemEventDeliveries:[`summary`]},{name:`summaryCount`,label:`Summary: items reported`,example:`3`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...iq],systemEventDeliveries:[`summary`]},{name:`summarySection`,label:`Summary: this section`,description:`The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.`,example:`Batterie scariche`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...iq],systemEventDeliveries:[`summary`]},...aq.map(e=>({name:e.name,label:e.label,example:e.example,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...e.kinds],systemEventDeliveries:[`summary`]}))],sq=[{name:`camera`,label:`Camera`,example:`Ingresso`,group:`subject`,families:[`rule`,`timelapse`],systemEventKinds:[...rq,`export-completed`]},{name:`class`,label:`Detected class`,description:`The counted class on an occupancy row (e.g. "person"); the detected class elsewhere.`,example:`person`,group:`subject`,families:[`rule`],fields:[...Z],kinds:[`detection`,`sensor`,`sound`,`occupancy`,`system`],systemEventKinds:[...nq]},{name:`label`,label:`Name or plate`,description:`Recognised person or read plate; empty otherwise.`,example:`Mario`,group:`subject`,families:[`rule`],fields:[...Z],kinds:[`detection`,`system`],systemEventKinds:[...nq]},{name:`subject`,label:`Subject sentence`,description:`Composed in the notification language, e.g. "person (Mario)".`,example:`persona (Mario)`,group:`subject`,families:[`rule`],fields:[...Z],kinds:[`detection`,`sensor`,`sound`,`occupancy`]},{name:`confidence`,label:`Confidence`,example:`87%`,group:`subject`,families:[`rule`],fields:[...Z],kinds:[`detection`,`system`],systemEventKinds:[...nq]},{name:`count`,label:`Count`,description:`Occupancy count, subjects in a grouped notification, or the event count of a system notice.`,example:`3`,group:`subject`,families:[`rule`],fields:[...Z],kinds:[`detection`,`occupancy`,`system`],systemEventKinds:[`addon-crash-loop`,...eq,`addon-updated`]},{name:`detectionSummary`,label:`Detection summary`,description:`Class composition, e.g. "2 persons and 1 car".`,example:`2 persone e 1 auto`,group:`subject`,families:[`rule`,`timelapse`,`summary`],fields:[...Z],kinds:[`detection`]},{name:`zones`,label:`Zones`,example:`Cancello, Vialetto`,group:`place`,families:[`rule`],fields:[...Z],kinds:[`detection`,`system`],systemEventKinds:[...nq]},{name:`zone`,label:`Zone`,example:`Cancello`,group:`place`,families:[`rule`],fields:[...Z],kinds:[`detection`,`occupancy`,`system`],systemEventKinds:[...nq]},{name:`inZones`,label:`"in <zones>" fragment`,description:`Leading space included; empty when no zone.`,example:` in Cancello`,group:`place`,families:[`rule`],fields:[...Z],kinds:[`detection`,`system`],systemEventKinds:[...nq]},{name:`scope`,label:`Occupancy scope`,example:`Cancello`,group:`place`,families:[`rule`],fields:[...Z],kinds:[`occupancy`]},{name:`time`,label:`Time`,description:`Hours and minutes, in the notification language.`,example:`20:05`,group:`time`,families:[`rule`,`timelapse`,`summary`],fields:[...Z]},{name:`rule`,label:`Rule name`,example:`Ingresso notte`,group:`rule`,families:[`rule`,`timelapse`,`summary`]},{name:`from`,label:`Window start`,example:`07:00`,group:`time`,families:[`timelapse`,`summary`]},{name:`to`,label:`Window end`,example:`08:00`,group:`time`,families:[`timelapse`,`summary`]},{name:`capacity`,label:`Capacity`,example:`2`,group:`occupancy`,families:[`rule`],fields:[...Z],kinds:[`occupancy`]},{name:`op`,label:`Occupied / free`,example:`occupata`,group:`occupancy`,families:[`rule`],fields:[...Z],kinds:[`occupancy`]},{name:`sounds`,label:`Sounds heard`,example:`abbaio, clacson`,group:`sound`,families:[`rule`],fields:[...Z],kinds:[`sound`]},{name:`hitPercent`,label:`Share of the window`,description:`Level mode only: percentage of samples above the threshold.`,example:`42`,group:`sound`,families:[`rule`],fields:[...Z],kinds:[`sound`]},{name:`db`,label:`Peak level (dBFS)`,example:`-18`,group:`sound`,families:[`rule`],fields:[...Z],kinds:[`sound`]},{name:`eventType`,label:`Event type`,description:`Raw device event token, e.g. "press" or "open"; empty when the device sends none.`,example:`press`,group:`sensor`,families:[`rule`],fields:[...Z],kinds:[`sensor`]},{name:`ai`,label:`AI sentence`,description:`Where the AI description goes; appended on its own line when absent.`,example:`Una persona lascia un pacco.`,group:`ai`,families:[`rule`,`summary`],fields:[...YK],kinds:[`detection`,`occupancy`]},{name:`eventKind`,label:`Event kind`,example:`device-offline`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventDeliveries:[`instant`]},{name:`deviceName`,label:`Device`,example:`Ingresso`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...rq]},{name:`deviceId`,label:`Device id`,example:`617`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...rq,`export-completed`]},{name:`percentage`,label:`Percentage`,example:`15`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...XK,...ZK]},{name:`item`,label:`Consumable`,example:`Filtro`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...ZK]},{name:`tank`,label:`Tank`,description:`Which tank: clean water, dirty water, detergent or dust bin.`,example:`clean water`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...QK]},{name:`profile`,label:`Stream profile`,example:`high`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`stream-online`,`stream-offline`]},{name:`node`,label:`Node`,example:`hub`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`node-online`,`node-offline`,`node-inference-unavailable`,`addon-crash-loop`,...$K,`addon-updated`,`server-updated`]},{name:`nodeId`,label:`Node id`,example:`hub`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`node-online`,`node-offline`,`node-inference-unavailable`,`addon-crash-loop`,...$K,`server-updated`]},{name:`devices`,label:`Devices`,description:`node-inference-unavailable: the affected cameras, comma-joined. Alarm arm / refusal: HOW MANY devices are armed (or open).`,example:`Ingresso, Garage`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`node-inference-unavailable`,`alarm-armed`,`alarm-arm-refused`]},{name:`addons`,label:`Addons`,example:`stream-broker`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`addon-crash-loop`]},{name:`minutes`,label:`Minutes`,example:`12`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`detection-blind`]},{name:`package`,label:`Package`,example:`@camstack/addon-recorder`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...$K,`addon-updated`,`server-updated`]},{name:`packageName`,label:`Package`,example:`@camstack/addon-recorder`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...eq,`server-updated`]},{name:`nodes`,label:`Nodes`,description:"Comma-joined node ids, when an update spans more than one — the single-node case names it through {{nodeId}} instead. `incomingFromUpdateAvailable` (event-intake.ts) fills `nodes` from ONE shared textParams object for both addon- and server-update-available, exactly like packageName/currentVersion/latestVersion/count — only the shipped TEXT (system.server-update-available.body.onNodes) reads it today, but the var is real on both kinds.",example:`hub, little-unraid`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...eq]},{name:`currentVersion`,label:`Current version`,example:`1.2.377`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...$K]},{name:`latestVersion`,label:`Latest version`,example:`1.2.378`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...$K]},{name:`list`,label:`Updated packages`,description:"One line per package. `incomingFromUpdateAvailable` fills it for addon-/server-update-available too (the SAME shared textParams object as `nodes`) — `system.addon-update-available.body` reads it; `incomingFromAddonUpdates` fills it again, independently, for the completed `addon-updated` event.",example:`recorder, notifiers`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...eq,`addon-updated`]},{name:`fromVersion`,label:`From version`,example:`1.2.377`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`server-updated`]},{name:`toVersion`,label:`To version`,example:`1.2.378`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`server-updated`]},{name:`destinationsOk`,label:`Destinations ok`,example:`2`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`backup-completed`]},{name:`destinationsTotal`,label:`Destinations`,example:`2`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`backup-completed`]},{name:`destinationsFailed`,label:`Destinations failed`,example:`0`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`backup-completed`]},{name:`sizeMB`,label:`Size (MB)`,example:`412`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`backup-completed`]},{name:`backupId`,label:`Backup id`,example:`bk-20260924`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`backup-completed`]},{name:`title`,label:`Export title`,example:`Ingresso 08:00`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`export-completed`]},{name:`exportId`,label:`Export id`,example:`exp-20260924`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`export-completed`]},{name:`bytes`,label:`Export size (bytes)`,example:`10485760`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`export-completed`]},{name:`mode`,label:`Alarm mode`,example:`away`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`alarm-armed`,`alarm-arming`,`alarm-arm-refused`,`alarm-pending`,`alarm-rearmed`,`alarm-check-failed`]},{name:`seconds`,label:`Seconds`,description:`Arming: the exit delay left. Pending: the entry delay left to disarm.`,example:`30`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`alarm-arming`,`alarm-pending`]},{name:`rules`,label:`Covering rules`,description:`How many enabled rules the armed mode gates.`,example:`2`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`alarm-armed`]},{name:`names`,label:`Device names`,description:`Armed: the devices armed. Arming: the devices this mode cannot arm. Refusal: the open sensors.`,example:`Ingresso, Garage`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`alarm-armed`,`alarm-arming`,`alarm-arm-refused`]},{name:`skippedNames`,label:`Skipped devices`,description:`Devices the mode names but cannot arm (muted, detection off, offline).`,example:`Garage`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`alarm-armed`]},{name:`bypassedNames`,label:`Bypassed sensors`,description:`Sensors the operator armed around because they were open.`,example:`Finestra veranda`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[`alarm-armed`,`alarm-arming`]},{name:`coverage`,label:`Coverage %`,example:`96`,group:`digest`,families:[`timelapse`],fields:[...Z]},{name:`events`,label:`Events`,example:`4`,group:`digest`,families:[`timelapse`,`summary`],fields:[...Z]},{name:`detections`,label:`Detections`,example:`7`,group:`digest`,families:[`timelapse`,`summary`],fields:[...Z]},{name:`count_person`,label:`Count of one class`,description:`count_<class>, e.g. count_person, count_car.`,example:`3`,group:`digest`,families:[`timelapse`,`summary`],fields:[...Z],dynamic:{prefix:`count_`,from:`classes`}},{name:`cameras`,label:`Cameras`,example:`3`,group:`digest`,families:[`summary`],fields:[...Z]},{name:`matched`,label:`Matched events`,example:`12`,group:`digest`,families:[`summary`],fields:[...Z]},{name:`shown`,label:`Events shown`,example:`9`,group:`digest`,families:[`summary`],fields:[...Z]},{name:`total`,label:`Events total`,example:`12`,group:`digest`,families:[`summary`],fields:[...Z]},...oq],cq=[`device-tank-low`,`device-tank-full`,`device-tank-normal`];function lq(){return sq.filter(e=>!uq(e)).map(e=>e.systemEventKinds===void 0?e:{...e,systemEventKinds:e.systemEventKinds.filter(e=>!cq.includes(e))})}function uq(e){return e.systemEventDeliveries!==void 0&&!e.systemEventDeliveries.includes(`instant`)}function dq(e,t){if(!FG(t.kind))return!0;let n=t.systemEventDelivery??`instant`;return(e.systemEventDeliveries??(e.systemEventKinds===void 0?[n]:[`instant`])).includes(n)}var fq={previewText:[`camera`,`rule`,`from`,`to`],captionText:[`rule`,`from`,`to`]};function pq(e,t){return e===void 0||t===void 0||e.includes(t)}function mq(e,t){return e===void 0||t===void 0||e.some(e=>e===t)?!0:FG(t)&&e.includes(`system`)}function hq(e,t){if(!FG(t.kind)||e.systemEventKinds===void 0)return!0;let n=e.systemEventKinds,r=t.systemEventKinds??[];if(r.length>0)return r.some(e=>n.includes(e));let i=t.kind===void 0?void 0:IG(t.kind);if(i===void 0)return!0;let a=kG(i);return n.some(e=>a.includes(e))}function gq(e){if(e.field===`previewText`||e.field===`captionText`){let t=fq[e.field];return sq.filter(n=>n.families.includes(e.family)&&t.includes(n.name)&&n.dynamic===void 0)}return sq.filter(t=>t.families.includes(e.family)&&pq(t.fields,e.field)&&mq(t.kinds,e.kind)&&pq(t.deliveries,e.delivery)&&hq(t,e)&&dq(t,e))}function _q(e,t){return gq(t).some(t=>t.dynamic===void 0?t.name===e:e.startsWith(t.dynamic.prefix)&&e.length>t.dynamic.prefix.length)}var vq=[`device-events`,`system`];function yq(e){if(!YG(e.delivery))return null;let t=e.systemEventDelivery;return t?.mode===`summary`?t.schedule:null}function bq(e){let t=e.systemEventDelivery;return t?.mode===`summary`?t.split??`rule`:`rule`}function xq(e){return yq(e)!==null}function Sq(e){return(e?.onTrigger?.length??0)>0||(e?.buttons?.length??0)>0}function Cq(e){if(e.systemEventDelivery?.mode!==`summary`)return[];if(!YG(e.delivery))return[{code:`not-a-system-rule`,delivery:e.delivery}];let t=[],n=jG(e.conditions.systemEvent?.kinds??[]),r=n.kind===`family`?n.family:`mixed`;(r===`mixed`||!vq.includes(r))&&t.push({code:`family-not-summarisable`,family:r});let i=e.systemEventDelivery.schedule.windows;return i.length===0&&t.push({code:`empty-schedule`}),i.forEach((e,n)=>{(e.days.length===0||e.startMinute===e.endMinute)&&t.push({code:`degenerate-window`,index:n})}),e.schedule!==void 0&&t.push({code:`schedule-beside-summary`}),Sq(e.actions)&&t.push({code:`actions-beside-summary`}),t}function wq(e){switch(e.code){case`not-a-system-rule`:return`a '${e.delivery}' rule has no summary delivery — only device-events and system rules do`;case`family-not-summarisable`:return e.family===`alarm`?`an alarm rule cannot be a scheduled summary — the alarm stays instant`:`a ${e.family} rule cannot be a scheduled summary — only device-events and system rules`;case`degenerate-window`:return`send time ${String(e.index+1)} has no day, or starts and ends on the same minute — it never closes, so nothing would be sent`;case`empty-schedule`:return`a summary rule needs at least one send time — its schedule has no window`;case`schedule-beside-summary`:return`a summary rule is sent on its summary schedule — remove the active-hours schedule`;case`actions-beside-summary`:return`a summary rule never matches an event, so its actions would never run — remove them`}}var Tq=1440;function Eq(e,t){return{windows:e.map(e=>{let t=(e.minute+Tq-1)%Tq;return{days:(e.minute===0?e.days.map(e=>(e+6)%7):[...e.days]).toSorted((e,t)=>e-t),startMinute:t,endMinute:e.minute}}),...t===void 0?{}:{timezone:t}}}function Dq(e){if(e.invert===!0)return null;let t=[];for(let n of e.windows){if((n.endMinute-n.startMinute+Tq)%Tq!==1)return null;let e=n.endMinute===0?n.days.map(e=>(e+1)%7):n.days;t.push({days:e.toSorted((e,t)=>e-t),minute:n.endMinute})}return t}var Oq=/\{\{\s*summary(?:Text|Devices|Streams|Battery|Consumables|Tanks|Detection|Nodes|Addons|Updates)\s*\}\}/;function kq(e){return e===void 0||e.trim().length===0?!0:Oq.test(e)}function Aq(e){return e.map(e=>({id:e.id,name:e.name,type:e.isHub?`hub`:`agent`,location:e.isOnline?`online`:`offline`,...e.name===e.id?{}:{detail:e.id}}))}var jq=`@camstack/server`,Mq=[jq,`@camstack/system`,`camstack-wrapper`],Nq={"@camstack/server":`server`,"@camstack/system":`framework`,"camstack-wrapper":`wrapper`};function Pq(e){return Mq.some(t=>t===e)}function Fq(e){let t=new Map(e.map(e=>[e.name,e.version])),n=Mq.map(e=>{let n=t.get(e);return{id:e,name:e,type:Nq[e],location:null,...n===void 0?{}:{detail:n}}}),r=e.filter(e=>!Pq(e.name)).map(e=>({id:e.name,name:e.name,type:`addon`,location:null,detail:e.version})).sort((e,t)=>e.name.localeCompare(t.name));return[...n,...r]}var Iq=`disarmed.armed_home.armed_away.armed_night.armed_vacation.armed_custom_bypass.arming.disarming.pending.triggered.open.opening.closing.closed.stopped.locked.unlocked.locking.unlocking.jammed.on.off.home.not_home.matched.diverged.unknown.latched.live`.split(`.`),Lq={disarmed:{en:`Disarmed`,it:`Disinserito`},armed_home:{en:`Armed (home)`,it:`Inserito (in casa)`},armed_away:{en:`Armed (away)`,it:`Inserito (fuori casa)`},armed_night:{en:`Armed (night)`,it:`Inserito (notte)`},armed_vacation:{en:`Armed (vacation)`,it:`Inserito (vacanza)`},armed_custom_bypass:{en:`Armed (custom)`,it:`Inserito (personalizzato)`},arming:{en:`Arming`,it:`In inserimento`},disarming:{en:`Disarming`,it:`In disinserimento`},pending:{en:`Pending (entry delay)`,it:`In attesa (ritardo ingresso)`},triggered:{en:`Triggered`,it:`In allarme`},open:{en:`Open`,it:`Aperto`},opening:{en:`Opening`,it:`In apertura`},closing:{en:`Closing`,it:`In chiusura`},closed:{en:`Closed`,it:`Chiuso`},stopped:{en:`Stopped`,it:`Fermo`},locked:{en:`Locked`,it:`Bloccata`},unlocked:{en:`Unlocked`,it:`Sbloccata`},locking:{en:`Locking`,it:`In blocco`},unlocking:{en:`Unlocking`,it:`In sblocco`},jammed:{en:`Jammed`,it:`Inceppata`},on:{en:`On`,it:`Acceso`},off:{en:`Off`,it:`Spento`},home:{en:`Home`,it:`In casa`},not_home:{en:`Away`,it:`Fuori casa`},matched:{en:`Matched (as captured)`,it:`Corrisponde (come acquisita)`},diverged:{en:`Diverged (changed)`,it:`Diversa (cambiata)`},unknown:{en:`Cannot judge`,it:`Non valutabile`},latched:{en:`Latched`,it:`Memorizzato`},live:{en:`Live`,it:`In tempo reale`}},Rq=new Set(Iq);function zq(e){return Rq.has(e)}function Bq(e,t){return zq(e)?Lq[e][t]:e}var Vq=u({title:c().max(500).optional(),body:c().max(2e3).optional()}),Hq=c().min(1).max(200),Uq=b(i()).min(1),Wq=i().int().min(2).max(3600),Gq=i().int().min(1).max(60),Kq=b(FS).min(1),qq=i().int().min(1).max(5),Jq=.1,Yq=i().min(Jq).max(3600),Xq=i().min(0).max(60),Zq=c().max(200),Qq=y([`image`,`gif`]),$q=b(c().min(1).max(40)).max(20),eJ=u({name:Hq,enabled:x().default(!0),deviceIds:Uq,schedule:_S,cadenceSec:Wq.default(15),framerate:Gq.default(10),denseCadenceSec:Yq.optional(),minDwellSec:Xq.optional(),targets:Kq,template:Vq.optional(),previewText:Zq.optional(),previewMode:Qq.default(`image`),reportClasses:$q.optional(),priority:qq.default(3)}),tJ=`Timelapse {{camera}}`,nJ=u({name:Hq.optional(),enabled:x().optional(),deviceIds:Uq.optional(),schedule:_S.optional(),cadenceSec:Wq.optional(),framerate:Gq.optional(),denseCadenceSec:Yq.optional(),minDwellSec:Xq.optional(),targets:Kq.optional(),template:Vq.nullable().optional(),previewText:Zq.optional(),previewMode:Qq.optional(),reportClasses:$q.optional(),priority:qq.optional()}),rJ=eJ.extend({id:c(),ownerUserId:c().optional(),lastGeneratedAt:i().optional(),generatedByDevice:_(c(),i()).optional(),createdBy:c(),createdAt:i(),updatedAt:i()});function iJ(e){let t=e.denseCadenceSec;if(t!==void 0&&t>=e.cadenceSec)throw Error(`denseCadenceSec (${t}s) must be strictly smaller than cadenceSec (${e.cadenceSec}s) — a dense cadence that is not denser renders a uniform timelapse`)}function aJ(e,t){let n=e.generatedByDevice;return n===void 0?e.lastGeneratedAt??0:n[String(t)]??0}function oJ(e){return e.some(e=>e!==`analyzer`)}async function sJ(e,t){let n;try{n=await e.getCapSlice.query({deviceId:t,capName:`motion`})}catch(e){let n=e instanceof Error?e.message:String(e);throw Error(`motion state of device ${t} is unreadable: ${n}`,{cause:e})}let r=n?.detected;if(typeof r!=`boolean`)throw Error(`motion state of device ${t} is not published yet (unknown)`);return r}var cJ=ZP.omit({triggeredBy:!0});function lJ(e,t){return ze(ge.ProviderMotion,e,t)}function uJ(e,t){return!!e.formats[t]}function dJ(e,t,n){if(t!=null){let r=e.find(e=>e.id===t);if(r!==void 0&&uJ(r,n))return!0}return e.some(e=>e.legacy!==!0&&uJ(e,n))}var fJ=`detail-crop`,pJ=`detailCropPaddingRatio`,mJ=`detailCropSquare`,hJ=u({paddingRatio:i().min(0).max(4),square:x()}),gJ={paddingRatio:.15,square:!1};function _J(e){let t=hJ.shape.paddingRatio.safeParse(e[pJ]),n=hJ.shape.square.safeParse(e[mJ]);return{paddingRatio:t.success?t.data:gJ.paddingRatio,square:n.success?n.data:gJ.square}}function vJ(e){return typeof e==`object`&&!!e&&`key`in e}function yJ(e){if(e===null)return gJ;let t={};for(let n of e.sections)for(let e of n.fields)!vJ(e)||typeof e.key!=`string`||(e.key===`detailCropPaddingRatio`||e.key===`detailCropSquare`)&&(t[e.key]=e.value);return _J(t)}var bJ=Object.freeze({x:0,y:0,w:1,h:1}),xJ={min:0,max:1,step:.05,default:gJ.paddingRatio};function SJ(e,t,n,r){let i=r.paddingRatio*e.w,a=r.paddingRatio*e.h,o={x:e.x-i,y:e.y-a,w:e.w+2*i,h:e.h+2*a};return r.square?TJ(CJ(o,t,n),t,n):wJ(o,t,n)}function CJ(e,t,n){let r=Math.min(Math.max(e.w,e.h),Math.min(t,n)),i=e.x+e.w/2,a=e.y+e.h/2;return{x:i-r/2,y:a-r/2,w:r,h:r}}function wJ(e,t,n){let r=Math.max(0,e.x),i=Math.max(0,e.y),a=Math.min(t,e.x+e.w),o=Math.min(n,e.y+e.h);return{x:r,y:i,w:Math.max(0,a-r),h:Math.max(0,o-i)}}function TJ(e,t,n){let r=Math.max(0,Math.min(e.w,t)),i=Math.max(0,Math.min(e.h,n));return{x:Math.min(Math.max(0,e.x),Math.max(0,t-r)),y:Math.min(Math.max(0,e.y),Math.max(0,n-i)),w:r,h:i}}var EJ=`native-lease`,DJ=`nativeLeaseHoldFrames`,OJ=`nativeLeaseBudgetMb`,kJ=`nativeLeaseActivityMs`,AJ=`nativeLeaseAdmission`,jJ=`nativeTileBudgetMb`,MJ=`nativeSceneBudgetMb`,NJ=y([`all`,`inferred`]),PJ=u({holdFrames:i().int().min(1).max(64),budgetMb:i().int().min(0).max(4096),activityMs:i().int().min(0).max(12e4),admission:NJ,tileBudgetMb:i().int().min(0).max(1024),sceneBudgetMb:i().int().min(0).max(1024)}),Q={holdFrames:8,budgetMb:1024,activityMs:15e3,tileBudgetMb:64,sceneBudgetMb:48,admission:`inferred`},FJ={min:1,max:64,step:1,default:Q.holdFrames},IJ={min:0,max:4096,step:64,default:Q.budgetMb},LJ={min:0,max:12e4,step:1e3,default:Q.activityMs},RJ={min:0,max:1024,step:16,default:Q.tileBudgetMb},zJ={min:0,max:1024,step:16,default:Q.sceneBudgetMb},BJ={options:[{value:`all`,label:`Every delivered frame`},{value:`inferred`,label:`Only frames sent to inference`}],default:Q.admission};function VJ(e,t){let n=PJ.shape[e].safeParse(t);return n.success?n.data===Q[e]?null:n.data:null}function HJ(e){let t=NJ.safeParse(e);return t.success?t.data===Q.admission?null:t.data:null}function UJ(e){let t=VJ(`holdFrames`,e[DJ]),n=VJ(`budgetMb`,e[OJ]),r=VJ(`activityMs`,e[kJ]),i=HJ(e[AJ]),a=VJ(`tileBudgetMb`,e[jJ]),o=VJ(`sceneBudgetMb`,e[MJ]);return{...t===null?{}:{holdFrames:t},...n===null?{}:{budgetMb:n},...r===null?{}:{activityMs:r},...i===null?{}:{admission:i},...a===null?{}:{tileBudgetMb:a},...o===null?{}:{sceneBudgetMb:o}}}function WJ(e){return typeof e==`object`&&!!e&&`key`in e}var GJ=[DJ,OJ,kJ,AJ,jJ,MJ];function KJ(e){if(e===null)return{};let t={};for(let n of e.sections)for(let e of n.fields)!WJ(e)||typeof e.key!=`string`||GJ.includes(e.key)&&(t[e.key]=e.value);return UJ(t)}var qJ=[{id:`viewer`,label:`View`,description:`Watch live and recorded video, browse events and read device state. Cannot change anything.`,deviceAccess:[`view`],systemAccess:[`view`]},{id:`operator`,label:`Operate`,description:`Everything View does, plus acting on a device: PTZ, lights, sirens, locks, and snoozing notifications. Cannot delete.`,deviceAccess:[`view`,`create`],systemAccess:[`view`,`create`]},{id:`manager`,label:`Full management`,description:`Everything Operate does, plus deleting devices, recordings and events. Short of admin — no user or cluster administration.`,deviceAccess:[`view`,`create`,`delete`],systemAccess:[`view`,`create`,`delete`]}];function JJ(e){let t=qJ.find(t=>t.id===e);if(!t)throw Error(`Unknown access role '${e}'`);return t}function YJ(e){let t=JJ(e.roleId);return[{type:`device`,selector:e.selector,access:[...t.deviceAccess],includeLinked:e.includeLinked},{type:`category`,target:`system`,access:[...t.systemAccess]}]}function XJ(e,t){if(e.length!==t.length)return!1;let n=new Set(e);return t.every(e=>n.has(e))}function ZJ(e){if(e.length!==2)return null;let t=e.filter(e=>e.type===`device`),n=e.filter(e=>e.type===`category`&&e.target===`system`);if(t.length!==1||n.length!==1)return null;let[r]=t,[i]=n;if(r===void 0||i===void 0||r.type!==`device`||r.includeLinked===void 0)return null;let a=qJ.find(e=>XJ(e.deviceAccess,r.access)&&XJ(e.systemAccess,i.access));return a?{roleId:a.id,selector:r.selector,includeLinked:r.includeLinked}:null}var QJ=8;function $J(e,t){switch(e.kind){case`all`:return!0;case`ids`:return e.ids.includes(t.id);case`types`:return e.types.some(e=>String(e)===t.type);case`locations`:return t.location!==null&&e.locations.includes(t.location)}}function eY(e,t){return e.some(e=>e.type===`category`&&e.target===`device`&&e.access.includes(t))}function tY(e,t){return e.filter(e=>e.type===`device`&&e.access.includes(t))}function nY(e,t){return e.includeLinked??t===`view`}function rY(e,t){let n=[],r=e;for(let e=0;e<QJ;e++){let e=r===null?null:t.get(r)?.parentDeviceId??null;if(e===null||e===r)break;n.push(e),r=e}return n}function iY(e,t,n){if(eY(e,n))return new Set(t.map(e=>e.id));let r=new Map;for(let e of t)r.set(e.id,e);let i=tY(e,n),a=new Set;for(let e of t)for(let t of i){if($J(t.selector,e)){a.add(e.id);break}if(nY(t,n)&&rY(e.id,r).some(e=>{let n=r.get(e);return n!==void 0&&$J(t.selector,n)})){a.add(e.id);break}}return a}function aY(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=J.safeParse(n);e.success&&t.push(e.data)}return t}var oY=[`view`,`create`,`delete`];function sY(e,t,n,r){return r?{all:!0,deviceCount:t.length}:{all:eY(e,n)||tY(e,n).some(e=>e.selector.kind===`all`),deviceCount:iY(e,t,n).size}}function cY(e){let t=[];for(let n of e)n.type===`capability`&&t.push({name:n.target,access:n.access});return t}function lY(e){let t=[];for(let n of e)n.type===`addon`&&t.push({name:n.target,access:n.access});return t}function uY(e,t,n){let r={view:sY(e,t,`view`,n),create:sY(e,t,`create`,n),delete:sY(e,t,`delete`,n)},i=n?oY:oY.filter(t=>e.some(e=>e.type===`category`&&e.target===`system`&&e.access.includes(t)));return{isAdmin:n,allDevicesViewable:r.view.all,viewableDeviceCount:r.view.deviceCount,device:r,system:i,capabilities:cY(e),addons:lY(e)}}var dY={camera:{type:`camera`,label:`Camera`,icon:`camera`}};function fY(e,t){let n=e.length,r=t.length;if(n===0)return r;if(r===0)return n;let i=Array.from({length:r+1},(e,t)=>t),a=Array.from({length:r+1},()=>0);for(let o=1;o<=n;o++){a[0]=o;let n=i[0]??0;for(let s=1;s<=r;s++){let r=i[s]??0,c=a[s-1]??0,l=e.charCodeAt(o-1)===t.charCodeAt(s-1)?0:1;a[s]=Math.min(r+1,c+1,n+l),n=r}for(let e=0;e<=r;e++)i[e]=a[e]??0}return i[r]??0}function pY(e,t){let n=e.trim().toLowerCase(),r=t.trim().toLowerCase();return n===r?1:n.length===0||r.length===0?0:1-fY(n,r)/Math.max(n.length,r.length)}function mY(e,t,n=.8){let r=null,i=0;for(let a of t){let t=pY(e,a);t>=n&&t>i&&(r=a,i=t)}return r}var hY=`addon:`;function gY(e){return e.startsWith(hY)?e.slice(6):e}function _Y(e,t){return gY(e)===gY(t)}function vY(e){return{runId:e.runId,state:e.state,startedAtMs:e.startedAtMs,finishedAtMs:e.finishedAtMs,progress:e.progress,result:e.result,error:e.error}}var yY=class{opts;runs=new Map;now;constructor(e){this.opts=e,this.now=e.now??Date.now}get runningCount(){let e=0;for(let t of this.runs.values())t.state===`running`&&(e+=1);return e}start(e,t){let n=this.runs.get(e);if(n!==void 0&&n.state===`running`)throw Error(`run '${e}' is already running`);if(this.runningCount>=this.opts.maxConcurrent)throw Error(`busy: ${this.runningCount}/${this.opts.maxConcurrent} run(s) already in progress — wait for one to finish or abort it`);let r={runId:e,state:`running`,startedAtMs:this.now(),finishedAtMs:null,progress:null,result:null,error:null,controller:new AbortController};this.runs.delete(e),this.runs.set(e,r);let i={signal:r.controller.signal,report:e=>{r.progress=e}},a=e=>{e.error===void 0?(r.state=r.controller.signal.aborted?`aborted`:`done`,r.result=e.result??null):(r.state=`failed`,r.error=e.error),r.finishedAtMs=this.now(),this.prune(),this.opts.onSettled?.(vY(r))},o;try{o=t(i)}catch(e){o=Promise.reject(e)}return o.then(e=>a({result:e}),e=>a({error:e instanceof Error?e.message:String(e)})),vY(r)}status(e){let t=this.runs.get(e);return t===void 0?null:vY(t)}list(){let e=[...this.runs.values()],t=e.filter(e=>e.state===`running`).toSorted((e,t)=>t.startedAtMs-e.startedAtMs),n=e.filter(e=>e.state!==`running`).toSorted((e,t)=>(t.finishedAtMs??0)-(e.finishedAtMs??0));return[...t,...n].map(vY)}abort(e){let t=this.runs.get(e);return t===void 0||t.state!==`running`?!1:(t.controller.abort(),!0)}abortAll(){for(let e of this.runs.values())e.state===`running`&&e.controller.abort()}prune(){let e=[...this.runs.values()].filter(e=>e.state!==`running`).toSorted((e,t)=>(e.finishedAtMs??0)-(t.finishedAtMs??0)),t=e.length-this.opts.keepFinished;for(let n=0;n<t;n++){let t=e[n];t!==void 0&&this.runs.delete(t.runId)}}};function bY(e,t){if(e.length!==t.length)return 0;let n=0,r=0,i=0;for(let a=0;a<e.length;a++)n+=e[a]*t[a],r+=e[a]*e[a],i+=t[a]*t[a];let a=Math.sqrt(r)*Math.sqrt(i);return a===0?0:n/a}var xY=class{elementId;cache={};listeners=new Set;loaded=!1;getBackend;constructor(e,t){this.elementId=e,this.getBackend=typeof t==`function`?t:()=>t}async ensureLoaded(){if(this.loaded)return;let e=this.getBackend();if(!e)throw Error(`ElementConfigStore(${this.elementId}): settings backend not available`);let t=await e.query({collection:`config`,filter:{where:{id:this.elementId},limit:1}});t.length>0&&(this.cache=t[0].data??{}),this.loaded=!0}getAll(){return{...this.cache}}get(e){let t=e.split(`.`),n=this.cache;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n))return;n=Reflect.get(n,e)}return n}async set(e,t){await this.ensureLoaded(),SY(this.cache,e,t),await this.persist(),this.notifyListeners()}async setAll(e){await this.ensureLoaded(),this.cache={...e},await this.persist(),this.notifyListeners()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}async load(){await this.ensureLoaded()}async loadDefaults(e){await this.ensureLoaded(),Object.keys(this.cache).length===0&&(this.cache={...e},await this.persist())}async persist(){let e=this.getBackend();if(!e)throw Error(`ElementConfigStore(${this.elementId}): settings backend not available — cannot persist config`);await e.set({collection:`config`,key:this.elementId,value:this.cache})}notifyListeners(){let e=this.getAll();for(let t of this.listeners)try{t(e)}catch{}}};function SY(e,t,n){let r=t.split(`.`),i=e;for(let e=0;e<r.length-1;e++){let t=r[e],n=i[t];if(typeof n!=`object`||!n||Array.isArray(n)){let e={};i[t]=e,i=e}else i=n}i[r[r.length-1]]=n}function CY(e,t){return`https://huggingface.co/${e}/resolve/main/${t}`}var wY=[/^user$/i,/^usr$/i,/^username$/i,/^password$/i,/^pwd$/i,/^pass$/i,/^passwd$/i,/^secret$/i,/^token$/i,/^auth$/i,/^auth[_-]?token$/i,/^bearer$/i,/^api[_-]?key$/i,/^access[_-]?token$/i,/^refresh[_-]?token$/i];function TY(e){return wY.some(t=>t.test(e))}function EY(e){try{let t=new URL(e),n=!1;(t.username||t.password)&&(t.username=``,t.password=``,n=!0);for(let e of Array.from(t.searchParams.keys()))TY(e)&&(t.searchParams.set(e,`***`),n=!0);return n?t.toString():e}catch{return e}}var $=1024*1024,DY={sampleIntervalMs:6e4,baselineSettleSamples:5,baselineSampleCount:3,restartMultiple:4,floorBytes:1024*$,ceilingBytes:3072*$,cooldownMs:30*6e4,maxRestartsPerWindow:6,restartWindowMs:1440*6e4};function OY(e){let t=(t,n,r)=>{let i=e[t];if(i===void 0)return n;let a=Number(i);return Number.isFinite(a)&&a>=r?a:n},n=DY;return{sampleIntervalMs:t(`CAMSTACK_POOL_MEM_INTERVAL_MS`,n.sampleIntervalMs,5e3),baselineSettleSamples:n.baselineSettleSamples,baselineSampleCount:n.baselineSampleCount,restartMultiple:t(`CAMSTACK_POOL_MEM_MULTIPLE`,n.restartMultiple,1.5),floorBytes:t(`CAMSTACK_POOL_MEM_FLOOR_MB`,n.floorBytes/$,128)*$,ceilingBytes:t(`CAMSTACK_POOL_MEM_CEILING_MB`,n.ceilingBytes/$,256)*$,cooldownMs:t(`CAMSTACK_POOL_MEM_COOLDOWN_MS`,n.cooldownMs,6e4),maxRestartsPerWindow:t(`CAMSTACK_POOL_MEM_MAX_RESTARTS`,n.maxRestartsPerWindow,1),restartWindowMs:t(`CAMSTACK_POOL_MEM_RESTART_WINDOW_MS`,n.restartWindowMs,6e4)}}function kY(e){let t=t=>{let n=e.match(RegExp(`^${t}:\\s+(\\d+)\\s*kB`,`m`));return n?Number(n[1])*1024:null},n=t(`VmRSS`);if(n===null)return null;let r=e.match(/^Threads:\s+(\d+)/m);return{rssBytes:n,vmBytes:t(`VmSize`)??0,hwmBytes:t(`VmHWM`)??0,swapBytes:t(`VmSwap`)??0,threads:r?Number(r[1]):0}}function AY(){return{settleSeen:0,baselineWindow:[],baselineBytes:null,restartsAt:[],lastRestartAt:null}}function jY(e){let t=[...e].sort((e,t)=>e-t);return t[Math.floor(t.length/2)]}function MY(e,t,n){if(e.baselineBytes!==null)return e;if(e.settleSeen<n.baselineSettleSamples)return{...e,settleSeen:e.settleSeen+1};let r=[...e.baselineWindow,t];return r.length<n.baselineSampleCount?{...e,baselineWindow:r}:{...e,baselineWindow:r,baselineBytes:jY(r)}}function NY(e,t){return e===null?t.ceilingBytes:Math.min(t.ceilingBytes,Math.max(t.floorBytes,t.restartMultiple*e))}function PY(e,t,n){return e.filter(e=>t-e<n.restartWindowMs)}function FY(e,t,n,r){let i=MY(e,t,r),a=NY(i.baselineBytes,r);if(t<=a)return{state:i,action:i.baselineBytes===null?`baseline-pending`:`ok`,baselineBytes:i.baselineBytes,thresholdBytes:a};let o=PY(i.restartsAt,n,r),s={...i,restartsAt:o};return o.length>=r.maxRestartsPerWindow?{state:s,action:`exhausted`,baselineBytes:i.baselineBytes,thresholdBytes:a}:s.lastRestartAt!==null&&n-s.lastRestartAt<r.cooldownMs?{state:s,action:`cooldown`,baselineBytes:i.baselineBytes,thresholdBytes:a}:{state:s,action:`restart`,baselineBytes:i.baselineBytes,thresholdBytes:a}}function IY(e,t){return{...AY(),restartsAt:[...e.restartsAt,t],lastRestartAt:t}}function LY(e){return{...AY(),restartsAt:e.restartsAt,lastRestartAt:e.lastRestartAt}}function RY(e){if(e.length===0)return null;let t=e[0];for(let n of e)n.rssBytes/n.thresholdBytes>t.rssBytes/t.thresholdBytes&&(t=n);return t.key}var zY=class{pools=new Map;timer=null;sweeping=!1;stopped=!1;opts;now;setTimer;clearTimer;constructor(e){this.opts=e,this.now=e.now??(()=>Date.now()),this.setTimer=e.setTimer??((e,t)=>setTimeout(e,t)),this.clearTimer=e.clearTimer??(e=>clearTimeout(e))}start(){this.timer||this.stopped||this.arm()}stop(){this.stopped=!0,this.timer&&=(this.clearTimer(this.timer),null)}arm(){let e=this.setTimer(()=>{this.sweep().finally(()=>{this.stopped||this.arm()})},this.opts.policy.sampleIntervalMs);typeof e.unref==`function`&&e.unref(),this.timer=e}async sweep(){if(!this.sweeping){this.sweeping=!0;try{await this.doSweep()}catch(e){this.opts.log.warn(`pool memory sweep failed`,{meta:{error:e instanceof Error?e.message:String(e)}})}finally{this.sweeping=!1}}}async doSweep(){let e=this.now(),t=await this.opts.sample(),n=[],r=new Map;for(let i of t){let t=this.pools.get(i.key),a=t?.state??AY();t&&t.pids.length>0&&!BY(t.pids,i.pids)&&(this.opts.log.warn(`pool process changed outside the watchdog — re-baselining`,{meta:{poolKey:i.key,previousPids:t.pids,pids:i.pids}}),a=LY(a));let o=FY(a,i.rssBytes,e,this.opts.policy);this.pools.set(i.key,{state:o.state,pids:i.pids}),r.set(i.key,o),this.opts.log.info(`pool memory`,{meta:{poolKey:i.key,pids:i.pids,rssMb:Math.round(i.rssBytes/$),baselineMb:o.baselineBytes===null?null:Math.round(o.baselineBytes/$),thresholdMb:Math.round(o.thresholdBytes/$),action:o.action,...i.meta}}),o.action===`restart`?n.push({key:i.key,rssBytes:i.rssBytes,thresholdBytes:o.thresholdBytes}):o.action===`cooldown`?this.opts.log.warn(`pool over memory threshold but inside restart cooldown`,{meta:{poolKey:i.key,rssMb:Math.round(i.rssBytes/$),thresholdMb:Math.round(o.thresholdBytes/$),cooldownMs:this.opts.policy.cooldownMs}}):o.action===`exhausted`&&this.opts.log.error(`pool memory watchdog gave up — restart budget exhausted, pool leaks faster than restarts can pay for; needs a heap profile (py-spy / tracemalloc)`,{meta:{poolKey:i.key,rssMb:Math.round(i.rssBytes/$),thresholdMb:Math.round(o.thresholdBytes/$),maxRestartsPerWindow:this.opts.policy.maxRestartsPerWindow,restartWindowMs:this.opts.policy.restartWindowMs}})}for(let e of[...this.pools.keys()])t.some(t=>t.key===e)||this.pools.delete(e);let i=RY(n);if(i===null)return;let a=n.find(e=>e.key===i),o=r.get(i),s=this.pools.get(i),c=s.state.restartsAt.length+1;this.opts.log.warn(`pool memory watchdog restarting pool — RSS over threshold`,{meta:{poolKey:i,pids:s.pids,rssMb:Math.round(a.rssBytes/$),thresholdMb:Math.round(a.thresholdBytes/$),baselineMb:o.baselineBytes===null?null:Math.round(o.baselineBytes/$),restartsInWindow:c,deferredCandidates:n.filter(e=>e.key!==i).map(e=>e.key)}});try{await this.opts.restart(i),this.pools.set(i,{state:IY(s.state,this.now()),pids:[]})}catch(e){this.opts.log.error(`pool memory watchdog restart failed`,{meta:{poolKey:i,error:e instanceof Error?e.message:String(e)}})}}};function BY(e,t){if(e.length!==t.length)return!1;let n=[...e].sort((e,t)=>e-t),r=[...t].sort((e,t)=>e-t);return n.every((e,t)=>e===r[t])}function VY(e,t,n){let r=t*n;if(r<=0||e.length===0)return Array.from({length:Math.max(0,r)}).fill(!1);let i=Array.from({length:r}).fill(!1);for(let r=0;r<n;r++)for(let a=0;a<t;a++){let o=(a+.5)/t,s=(r+.5)/n;for(let n of e)if(o>=n.x&&o<=n.x+n.w&&s>=n.y&&s<=n.y+n.h){i[r*t+a]=!0;break}}return i}function HY(e,t,n,r){if(t<=0||n<=0||r<=0)return[];let i=t*n,a=Array.from({length:i}).fill(!1),o=Math.min(e.length,i);for(let t=0;t<o;t++)a[t]=e[t]===!0;let s=[],c=[];for(let e=0;e<=n;e++){let r=[];if(e<n){let n=-1;for(let i=0;i<=t;i++){let o=i<t&&a[e*t+i]===!0;o&&n===-1?n=i:!o&&n!==-1&&(r.push({colStart:n,colEnd:i-1}),n=-1)}}let i=new Set,o=[];for(let t of c){let n=r.findIndex(e=>e.colStart===t.colStart&&e.colEnd===t.colEnd);n>=0?(o.push(t),i.add(n)):s.push({...t,rowEnd:e-1})}for(let t=0;t<r.length;t++)if(!i.has(t)){let n=r[t];o.push({colStart:n.colStart,colEnd:n.colEnd,rowStart:e})}c.length=0;for(let e of o)c.push(e)}if(s.length===0)return[];let l=s.slice().toSorted((e,t)=>{let n=(e.colEnd-e.colStart+1)*(e.rowEnd-e.rowStart+1);return(t.colEnd-t.colStart+1)*(t.rowEnd-t.rowStart+1)-n});return(r>0?l.slice(0,r):l).map(e=>({x:e.colStart/t,y:e.rowStart/n,w:(e.colEnd-e.colStart+1)/t,h:(e.rowEnd-e.rowStart+1)/n}))}var UY=class{capacity;items;head=0;tail=0;count=0;constructor(e){this.capacity=e,this.items=Array.from({length:e})}get size(){return this.count}push(e){this.items[this.tail]=e,this.tail=(this.tail+1)%this.capacity,this.count<this.capacity?this.count++:this.head=(this.head+1)%this.capacity}drain(e){let t=[],n=Math.min(e,this.count);for(let e=0;e<n;e++)t.push(this.items[this.head]),this.items[this.head]=void 0,this.head=(this.head+1)%this.capacity;return this.count-=n,t}};async function WY(e,t){let n=performance.now();try{return{output:t===void 0?await e():await KY(e(),t),durationMs:GY(performance.now()-n),ok:!0}}catch(e){return{output:void 0,durationMs:GY(performance.now()-n),ok:!1,error:Ln(e)}}}function GY(e){return Math.round(e*100)/100}function KY(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>r(Error(`Inference timeout after ${t}ms`)),t);e.then(e=>{clearTimeout(i),n(e)}).catch(e=>{clearTimeout(i),r(e)})})}var qY={openvino:`openvino`,edgetpu:`tflite`,coreml:`coreml`,onnx:`onnx`,cpu:`onnx`,cuda:`onnx`};function JY(e){return qY[e]??`onnx`}var YY={onnx:`onnx`,coreml:`coreml`,openvino:`openvino`,tflite:`tflite`,pytorch:`pt`},XY={coreml:`coreml_inference.py`,pytorch:`pytorch_inference.py`,openvino:`openvino_inference.py`};function ZY(e){return YY[e]}function QY(e){return XY[e]}function $Y(e){return e===`coreml`||e===`pytorch`||e===`openvino`}function eX(e){let t=e instanceof Float32Array?e:Float32Array.from(e),n=new Uint8Array(t.length*4),r=new DataView(n.buffer);for(let e=0;e<t.length;e+=1)r.setFloat32(e*4,t[e]??0,!0);return Buffer.from(n).toString(`base64`)}function tX(e){let t=Buffer.from(e,`base64`);if(t.byteLength%4!=0)throw Error(`decodeVectorBase64: ${t.byteLength} bytes is not a whole number of Float32 values`);let n=new Float32Array(t.byteLength/4);for(let e=0;e<n.length;e+=1)n[e]=t.readFloatLE(e*4);return n}function nX(e){return Math.floor(Buffer.from(e,`base64`).byteLength/4)}function rX(e,t,n,r,i){if(n.length===0||t.length===0)return{passed:e,excluded:[]};let a=n.filter(e=>e.enabled!==!1),o=a.filter(e=>e.mode===`include`),s=a.filter(e=>e.mode===`exclude`),c=o.length>0,l=new Map(t.map(e=>[e.id,e])),u=[],d=[];for(let t of e){let e=r(t),n=i?.(t),a=o.some(t=>iX(t,e,n,l)),f=s.some(t=>iX(t,e,n,l));c?a&&!f?u.push(t):d.push(t):f?d.push(t):u.push(t)}return{passed:u,excluded:d}}function iX(e,t,n,r){if(e.classFilter&&e.classFilter.length>0&&n!==void 0&&!e.classFilter.includes(n))return!1;for(let n of e.zoneIds){let e=r.get(n);if(e&&aX(t,e.polygon))return!0}return!1}function aX(e,t){if(t.length<3)return!1;let n=!1,{x:r,y:i}=e;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a];o.y>i!=s.y>i&&r<(s.x-o.x)*(i-o.y)/(s.y-o.y||2**-52)+o.x&&(n=!n)}return n}function oX(e,t,n){let r={};for(let i of Object.keys(n))r[i]=n=>e.addons.custom.mutate({addonId:t,action:i,input:n});return r}var sX={value:`auto`,label:`Auto`},cX={value:`cpu`,label:`CPU`},lX={value:`usb`,label:`Coral USB`},uX=[{id:`onnx`,supports:()=>!0,devices:e=>{if(!e)return[cX];let t=[cX];return e.gpu?.type===`nvidia`&&t.push({value:`cuda`,label:`CUDA`}),e.npu?.type===`apple-ane`&&t.push({value:`coreml`,label:`CoreML EP`}),t},defaultDevice:`cpu`},{id:`openvino`,supports:e=>e?.arch===`x64`&&e.platform!==`darwin`&&e.gpu?.type===`intel`,devices:e=>{if(!e)return[sX];let t=[sX,cX];return e.gpu?.type===`intel`&&t.push({value:`gpu`,label:`GPU`}),e.npu?.type===`intel-npu`&&t.push({value:`npu`,label:`NPU`}),t},defaultDevice:`auto`},{id:`coreml`,supports:e=>e?.platform===`darwin`,devices:e=>{let t={value:`all`,label:`All (ANE + GPU + CPU)`};if(!e)return[t];let n=[t];return e.npu?.type===`apple-ane`&&n.push({value:`ane`,label:`Apple Neural Engine`}),n.push({value:`gpu`,label:`GPU`},cX),n},defaultDevice:`all`},{id:`edgetpu`,supports:e=>e?.coral!=null,devices:()=>[lX],defaultDevice:`usb`}];function dX(e){let t=uX.find(t=>t.id===e);if(!t)throw Error(`Unknown runtime: ${e}`);return t}function fX(e){return uX.filter(t=>t.supports(e)).map(e=>e.id)}function pX(e,t){return dX(e).devices(t)}function mX(e){return dX(e).defaultDevice}function hX(e){return e===`edgetpu`?`tflite`:ZY(e)}function gX(e){let t=[];if(e.platform===`darwin`&&e.arch===`arm64`&&t.push({runtime:`python`,backend:`coreml`,format:`coreml`,score:95,reason:`Apple Neural Engine (Python CoreML)`,available:!0}),e.gpu?.type===`nvidia`&&t.push({runtime:`python`,backend:`cuda`,format:`onnx`,score:85,reason:`NVIDIA CUDA (Python ONNX Runtime)`,available:!0}),e.gpu?.type===`intel`){let n=e.npu?.type===`intel-npu`?90:80;t.push({runtime:`python`,backend:`openvino`,format:`openvino`,score:n,reason:`Intel OpenVINO`,available:!0})}e.coral!=null&&t.push({runtime:`python`,backend:`edgetpu`,format:`tflite`,score:70,reason:`Coral Edge TPU (Python LiteRT)`,available:!0}),t.push({runtime:`python`,backend:`cpu`,format:`onnx`,score:50,reason:`CPU (Python ONNX Runtime)`,available:!0});let n=t.toSorted((e,t)=>t.score-e.score);return{scores:n,best:n.find(e=>e.available)??n[n.length-1]}}var _X={cuda:`gpu`,edgetpu:`usb`,coreml:`all`,cpu:`cpu`};function vX(e,t,n,r){return{key:e===`cpu`?`cpu`:`${e}:${t}`,backend:e,device:t,format:n,runtime:`python`,score:r,available:!0}}function yX(e){let{scores:t}=gX(e),n=[];for(let r of t){if(r.backend===`openvino`){e.npu?.type===`intel-npu`&&n.push(vX(`openvino`,`npu`,r.format,r.score+2)),e.gpu?.type===`intel`&&n.push(vX(`openvino`,`gpu`,r.format,r.score));continue}if(r.backend===`edgetpu`){let t=Math.max(1,e.coral?.count??1);for(let e=0;e<t;e++){let t=e===0?`usb`:`usb:${e}`;n.push(vX(`edgetpu`,t,r.format,r.score))}continue}let t=_X[r.backend]??r.backend;n.push(vX(r.backend,t,r.format,r.score))}return n}export{mH as ACCESSORY_LABEL,qJ as ACCESS_ROLES,Ba as ALEXA_EGRESS_PROFILE,XU as ALL_CAPABILITY_DEFINITIONS,vu as APPEARANCE_BIN_COUNT,yu as APPEARANCE_BLOCKS,_u as APPEARANCE_DESCRIPTOR_VERSION,bu as APPEARANCE_RESOLVES_AMBIGUITY_DEFAULT,Tx as APPLE_SA_TO_MACRO,os as ARCHIVED_DEBUG_NOTES_DEFAULT_LIMIT,Io as AUDIO_ANALYSIS_CAP_NAME,Cf as AUDIO_BACKEND_CHOICES,be as AUDIO_CHUNK_FORMATS,Cx as AUDIO_MACRO_LABELS,hf as AUDIO_NOT_CLASSIFIED_REASONS,Bn as AUDIO_PRESETS,pW as AUDIO_SCALE_EPOCH_ISO,mW as AUDIO_SCALE_EPOCH_MS,Tj as AccessoriesStatusSchema,X as AccessoryKind,Wb as AddBrokerInputSchema,qj as AddonAutoUpdateSchema,Vj as AddonListItemSchema,Id as AddonPageDeclarationSchema,Pd as AddonPageInfoSchema,Vg as AdminLinkTargetEnum,m_ as AdoptionAdoptInputSchema,h_ as AdoptionAdoptResultSchema,To as AdoptionCandidateResultSchema,s_ as AdoptionFilterSchema,d_ as AdoptionGetCandidateInputSchema,Eo as AdoptionJobSchema,Co as AdoptionJobStateSchema,l_ as AdoptionListCandidatesInputSchema,u_ as AdoptionListCandidatesOutputSchema,wo as AdoptionOutcomeSchema,g_ as AdoptionReleaseInputSchema,f_ as AdoptionStatusSchema,wO as AgentLoadSummarySchema,aM as AirQualitySensorStatusSchema,q as AlarmArmModeSchema,Wx as AlarmPanelStatusSchema,Ux as AlarmStateSchema,af as AlertSchema,tf as AlertSeveritySchema,rf as AlertSourceSchema,nf as AlertStatusSchema,sM as AmbientLightSensorStatusSchema,VE as AnalyticsLtsSeriesSchema,mw as ApiKeyRecordSchema,qB as ApiKeySummarySchema,Py as AppleFmAvailabilitySchema,Ny as AppleFmUnavailableReasonSchema,qf as ArchiveEntrySchema,Jf as ArchiveManifestSchema,Hf as ArchiveSqliteSnapshotSchema,cs as ArchivedDebugNoteQueryInputSchema,ss as ArchivedDebugNoteSchema,nx as AttachmentMediaTypeSchema,rx as AttachmentSchema,_f as AudioAnalysisResultSchema,vf as AudioAnalysisSettingsSchema,yf as AudioAttachDeviceInputSchema,bf as AudioAttachDeviceResultSchema,Ct as AudioChunkFormatSchema,ff as AudioChunkInputSchema,lM as AudioClassSummarySchema,mf as AudioClassificationLabelSchema,Sf as AudioClassificationResultSchema,gf as AudioClassifyOutcomeSchema,Df as AudioCodecInfoSchema,Of as AudioDecodeSessionConfigSchema,xf as AudioDetachDeviceResultSchema,Aa as AudioEncodeSchema,kf as AudioEncodeSessionConfigSchema,jf as AudioEncodedChunkSchema,VT as AudioEventSchema,pf as AudioLevelSchema,dM as AudioMetricsHistoryPointSchema,fM as AudioMetricsHistorySchema,uM as AudioMetricsSnapshotSchema,Af as AudioPcmChunkSchema,ot as AudioStreamPickSchema,Pf as AuthResultSchema,Kj as AutoUpdateSettingsSchema,Sd as AutomationActionSchema,_d as AutomationConditionOperatorSchema,bd as AutomationConditionSchema,mM as AutomationControlStatusSchema,Cd as AutomationRecipeSchema,xd as AutomationTriggerSchema,lP as AvailableIntegrationTypeSchema,Nh as BASE_DEVICE_CAPS,Ra as BASE_LIVE_EGRESS_PROFILE,eU as BATTERY_DEVICE_PROFILE,OH as BATTERY_UNREACHABLE_AFTER_MS,es as BIRTH_DECISION_DEFAULT_LIMIT,wn as BOOT_RECOVERY_BACKOFF_MS,Xm as BUILTIN_RESULT_KINDS,yY as BackgroundRunRegistry,tP as BacklightModeSchema,Wf as BackupDestinationInfoSchema,Kf as BackupEntrySchema,Zf as BackupRunPhaseSchema,Qf as BackupRunSchema,Xf as BackupRunStateSchema,$f as BackupTriggerResultSchema,qe as BaseAddon,bH as BaseDevice,DH as BaseDeviceProvider,gM as BatteryStatusSchema,vM as BinaryStatusSchema,is as BirthDecisionQueryInputSchema,rs as BirthDecisionRecordSchema,ns as BirthDecisionVerdictSchema,uf as BoundingBoxSchema,bM as BrightnessStatusSchema,cp as BrokerAddInputSchema,Mp as BrokerAudioClientSchema,Ip as BrokerClientsSchema,Ub as BrokerConnectionDetailsSchema,Pp as BrokerConsumerAttributionSchema,Np as BrokerConsumerKindSchema,jp as BrokerDecodedClientSchema,Fp as BrokerEncodedClientSchema,xp as BrokerGetStateInputSchema,Hb as BrokerInfoSchema,ap as BrokerProviderInfoSchema,_p as BrokerPublishInputSchema,ip as BrokerRegistryStatusSchema,Ap as BrokerRtspClientSchema,Ot as BrokerStatsSchema,np as BrokerStatusEnum,Dt as BrokerStatusSchema,vp as BrokerSubscribeInputSchema,yp as BrokerSubscribeResultSchema,dp as BrokerTestConnectionResultSchema,bp as BrokerUnsubscribeInputSchema,Ag as BulkRecordSchema,Iw as CAMERA_SENSORS_NOT_LOADED,xw as CAMERA_SENSORS_SETTINGS_KEY,Bo as CAMERA_SWITCH_CATALOG,ko as CAMERA_SWITCH_ORDER,yw as CAMERA_TRIGGER,at as CAM_PROFILE_ORDER,JU as CAPABILITY_NAMES,YU as CAPABILITY_ROUTER_KEYS,qU as CAP_NAMES_WITH_STATUS,Rt as CAP_NODE_PIN_CONTEXT_KEY,rW as CAP_PROVIDER_KIND_MAP,Ks as CLASS_MAP_MACRO_TARGETS,sj as CLIP_BROKER_PACED_RATES,mj as CLIP_PLAYBACK_OPTIONS,lj as CLIP_REALTIME_SOURCE_RATES,KA as CLIP_REASON_HEADER_MAX,Bu as CLIP_SEARCH_STRICTNESS,YA as CLIP_STILL_DISPOSITION_HEADER,JA as CLIP_STILL_REASON_CODE_HEADER,GA as CLIP_STILL_REASON_HEADER,cj as CLIP_STREAM_SOURCE_RATES,XA as CLIP_STREAM_TRANSPORT_HEADER,Hu as CLIP_STRICTNESS_FACTOR,Ru as CLIP_VECTOR_INDEX_PATTERN,Lw as CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS,Rw as CLUSTER_MODEL_SCOPED_STEPS,zw as CLUSTER_MODEL_SECTION_ID,$w as CLUSTER_STEP_SETTING_FIELDS,vx as COCO_80_LABELS,Sx as COCO_TO_MACRO,Mi as COMPOSED_DEVICE_STABLE_ID_PREFIX,gh as COMPOSED_ITEM_FIXED_FIELDS,Ai as COMPOSER_ADDON_ID,Vm as COMPOSER_RUNNER_ID,bm as COMPOSITION_EVENT_CATEGORY,Ji as COMPOSITION_ITEM_ARRAY_PATH,Ki as COMPOSITION_ITEM_KEY_RE,HM as CONNECTION_TEST_TIMEOUT_MS,jH as CONTAINER_CHILD_PRIORITY,og as CORE_BLOCKS_ADDON_ID,ag as CORE_BLOCK_ADDON_PREFIX,ji as CUSTOMIZATION_BLOCK_NAME_PREFIX,S as CamProfileSchema,Uz as CamStreamDescriptorSchema,st as CamStreamKindSchema,ct as CamStreamResolutionSchema,AO as CameraAssignmentStatusSchema,BO as CameraAudioStatusSchema,jO as CameraBrokerProfileSchema,MO as CameraBrokerStatusSchema,CM as CameraCredentialsSchema,wM as CameraCredentialsStatusSchema,NO as CameraDecoderShmSchema,PO as CameraDecoderStatusSchema,RO as CameraDetectionPhaseSchema,LO as CameraDetectionProvisioningSchema,IO as CameraDetectionProvisioningStateSchema,zO as CameraDetectionStatusSchema,OD as CameraMetricsSchema,kD as CameraMetricsWithDeviceIdSchema,FO as CameraMotionStatusSchema,bV as CameraOccupancySnapshotForDeviceSchema,Mw as CameraOwnMotionSchema,Pw as CameraRawLevelSchema,VO as CameraRecordingModeSchema,HO as CameraRecordingStatusSchema,Aw as CameraSensorAttachmentSchema,Dw as CameraSensorEntrySchema,Tw as CameraSensorModeSchema,Cw as CameraSensorRefSchema,Ow as CameraSensorsConfigSchema,Nw as CameraSensorsNotEnforcedSchema,jw as CameraSensorsNotForwardedSchema,Fw as CameraSensorsStatusSchema,kO as CameraSourceStatusSchema,OO as CameraSourceStreamSchema,WO as CameraStatusDegradationReasonSchema,GO as CameraStatusDegradationSchema,qO as CameraStatusSchema,UO as CameraStatusStageSchema,lt as CameraStreamSchema,Ao as CameraSwitchAuthoritySchema,Po as CameraSwitchGroupSchema,Oo as CameraSwitchIdSchema,No as CameraSwitchSchema,jo as CameraSwitchUnavailableReasonSchema,Mo as CameraSwitchWarningSchema,c_ as CandidateQueryFilterSchema,lw as CapScopeSchema,EO as CapabilityBindingsSchema,MM as CarbonMonoxideStatusSchema,In as ChargingStatus,zv as ClaimOutcomeSchema,Vv as ClaimsListingSchema,vs as ClearTrackRelationInputSchema,ys as ClearTrackRelationResultSchema,IF as ClientNetworkStatsSchema,FM as ClimateControlStatusSchema,rj as ClipBytesOfferSchema,nj as ClipBytesSchema,yR as ClipExportFailureSchema,zu as ClipModelMetaSchema,uj as ClipPlaybackOptionsSchema,QA as ClipPlaybackSchema,ZA as ClipSchema,Vu as ClipSearchStrictnessSchema,dj as ClipSourceAvailabilitySchema,fj as ClipSourceSchema,WA as ClipStillDispositionSchema,UA as ClipStillRefusalCodeSchema,aj as ClipStreamAudioReasonSchema,ij as ClipStreamAudioSchema,oj as ClipStreamDialSchema,$A as ClipWakeSchema,KF as ClusterAddonNodeDeploymentSchema,qF as ClusterAddonStatusEntrySchema,ZO as ClusterModelChoiceSchema,jg as CollectionColumnSchema,Mg as CollectionIndexSchema,BM as ColorStatusSchema,ng as ComposableCapabilitiesSchema,tg as ComposableCapabilitySchema,eg as ComposableFieldSchema,Wm as ComposerApplyInputSchema,Km as ComposerApplyResultSchema,Hm as ComposerBlockSchema,Gm as ComposerBlockVerdictSchema,Um as ComposerUnreadableBlockSchema,Bi as CompositionBindingSchema,pg as CompositionBlockInputSchema,Bm as CompositionBlockStateSchema,Hi as CompositionCodeSourceSchema,Gi as CompositionCommandTargetSchema,xg as CompositionCustomizationReadSchema,Sm as CompositionEventPlanSchema,ta as CompositionExistingTargetSchema,Vi as CompositionExpressionSourceSchema,Pm as CompositionFeatureModeSchema,Fm as CompositionFeaturePlanSchema,Qi as CompositionFeatureSchema,jm as CompositionFieldItemSchema,Om as CompositionFieldKindSchema,Mm as CompositionFieldPlanSchema,Li as CompositionFieldReadSchema,Am as CompositionFieldRoleSchema,Ui as CompositionFieldSourceSchema,Rm as CompositionFieldStateKindSchema,zm as CompositionFieldStateSchema,Xi as CompositionFieldsFeatureSchema,Wi as CompositionForwardCommandSchema,Ri as CompositionFromSourceSchema,bg as CompositionGetReadSchema,Sh as CompositionGraphError,Yi as CompositionItemEntrySchema,yg as CompositionListReadSchema,zi as CompositionLiteralBindingSchema,ea as CompositionNewTargetSchema,Zi as CompositionPassthroughFeatureSchema,Em as CompositionProblemCodeSchema,Dm as CompositionProblemSchema,Lm as CompositionRunStatusSchema,ra as CompositionSchema,Ii as CompositionSourceRefSchema,gg as CompositionStateReadSchema,na as CompositionTargetSchema,km as CompositionUnavailableModeSchema,Im as CompositionValidationSchema,_g as CompositionViewSchema,Z_ as ConfigEntrySchema,Ud as ConfigSectionWithValuesSchema,Hd as ConfigTabDeclarationSchema,GM as ConnectionTestDescriptorSchema,WM as ConnectionTestInputSchema,UM as ConnectionTestOutcomeSchema,qM as ConnectivityStatusSchema,ZM as ConsumableItemSchema,XM as ConsumableRemainingSchema,YM as ConsumableRemainingUnitSchema,QM as ConsumablesStatusSchema,eN as ContactStatusSchema,nN as ControlKindSchema,rN as ControlStatusSchema,rd as ConvertArtifactSchema,id as ConvertResultSchema,td as ConvertTargetSchema,Sg as CoreBlockCompileResultSchema,dg as CoreBlockInputSchema,lg as CoreBlockPlacementSchema,U as CoreBlockSchema,fg as CoreBlockSourceSchema,ug as CoreBlockStatusSchema,oN as CoverStateSchema,sN as CoverStatusSchema,JB as CreateApiKeyInputSchema,YB as CreateApiKeyResultSchema,fP as CreateIntegrationInputSchema,ZB as CreateScopedTokenInputSchema,QB as CreateScopedTokenResultSchema,GB as CreateUserInputSchema,rM as CustomActionInputSchema,wg as CustomModelDescriptorSchema,Lf as DATABASE_SNAPSHOT_PARTIAL_SUFFIX,If as DATABASE_SNAPSHOT_SUFFIX,Rf as DATABASE_SNAPSHOT_TIMEOUT_MS,Qe as DATAPLANE_SECRET_HEADER,WR as DAYS_PER_WEEK,qR as DAY_NAMES,VH as DECLARED_DEVICE_SWEEP_LIMIT,zH as DECLARED_INTEGRATION_FIXED_KEY,ho as DEFAULT_ADDON_PLACEMENT,wf as DEFAULT_AUDIO_ANALYZER_CONFIG,Ew as DEFAULT_CAMERA_SENSOR_MODE,Hw as DEFAULT_CLUSTER_STEP_MODELS,iT as DEFAULT_CLUSTER_STEP_SETTINGS,Lg as DEFAULT_DECODER_HWACCEL_CONFIG,gJ as DEFAULT_DETAIL_CROP_CONVENTION,lc as DEFAULT_EVENTS_BAND_BUFFER_SEC,kx as DEFAULT_EVENT_COLOR,Fs as DEFAULT_FEATURES,Er as DEFAULT_FIRST_SIGHTING_FRESHNESS_MS,Qw as DEFAULT_MIN_LANDMARK_FACE_SIZE_PX,Q as DEFAULT_NATIVE_LEASE_SETTINGS,Su as DEFAULT_OVERLAY_LAYERS,DY as DEFAULT_POOL_MEMORY_POLICY,hc as DEFAULT_RECORDING_PROFILES,Do as DEFAULT_RETENTION,Ht as DEFAULT_RUNTIME_STATE_DURABILITY,tJ as DEFAULT_TIMELAPSE_PREVIEW_TEXT,fH as DEFAULT_TOKEN_EXPIRY,zo as DERIVED_CAMERA_SILENCED_CAP_NAMES,xJ as DETAIL_CROP_PADDING_FIELD,pJ as DETAIL_CROP_PADDING_KEY,fJ as DETAIL_CROP_SECTION_ID,mJ as DETAIL_CROP_SQUARE_KEY,bx as DETECTION_MACRO_CLASSES,Fo as DETECTION_PIPELINE_CAP_NAME,qY as DEVICE_BACKEND_TO_FORMAT,$U as DEVICE_CAP_NAMES,cn as DEVICE_CHILDREN_BATCH_MAX,tU as DEVICE_PROFILES,SH as DEVICE_RESTORE_RETRY_CONCURRENCY,xH as DEVICE_RESTORE_RETRY_DELAYS_MS,Sn as DEVICE_SCOPED_CAPS,qt as DEVICE_SETTINGS_CONTRIBUTION_METHODS,sH as DEVICE_STATE_READERS,Jt as DEVICE_STATUS_METHOD,UH as DEVICE_TYPE_CONTROL_KIND,dY as DEVICE_TYPE_INFO,rU as DISPLAY_ICON_GROUPS,aU as DISPLAY_ICON_KEYS,oU as DISPLAY_ICON_OFFERED_KEYS,iU as DISPLAY_ICON_VOCABULARY,iH as DOORBELL_RISE_DEBOUNCE_MS,Pg as DataStoreEngineInfoSchema,Vf as DatabaseSnapshotResultSchema,Bf as DatabaseSnapshotTableSchema,zf as DatabaseSnapshotTargetsSchema,lN as DayNightModeSchema,fN as DayNightOptionsSchema,pN as DayNightSettingsPatchSchema,dN as DayNightStatusSchema,HH as DeclaredDevices,wt as DecodedAudioChunkSchema,yt as DecodedFrameSchema,Ll as DecoderSessionConfigSchema,Il as DecoderStatsSchema,mP as DeleteIntegrationResultSchema,hJ as DetailCropConventionSchema,Ys as DetectionCatalogClassMapSchema,IT as DetectionSourceSchema,rO as DetectionSourcesSchema,Hg as DeviceAdminLinkSchema,xP as DeviceCodeSeveritySchema,gH as DeviceConfig,a_ as DeviceDiscoveryStatusSchema,E_ as DeviceExportExposeInputSchema,C_ as DeviceExportStatusSchema,D_ as DeviceExportUnexposeInputSchema,Fn as DeviceFeature,X_ as DeviceInfoSchema,LF as DeviceNetworkStatsSchema,TH as DeviceRestoreRetryScheduler,D as DeviceRole,_H as DeviceRuntimeState,uw as DeviceSelectorSchema,hN as DeviceStatusSchema,E as DeviceType,yB as DiagnosticIdSchema,EB as DiagnosticWindowPatchSchema,TB as DiagnosticWindowSchema,i_ as DiscoveredChildDeviceSchema,r_ as DiscoveredChildStatusSchema,B_ as DiscoveredDeviceSchema,px as DiscoveredTargetSchema,KO as DiskReconcileJobSchema,Ze as DisposerChain,vN as DoorbellPressEventSchema,_N as DoorbellStatusSchema,Jv as EMBEDDING_MODEL_FAILED,Xv as EMBEDDING_REQUIREMENTS_FAILED,Yv as EMBEDDING_REQUIREMENTS_UNAVAILABLE,lk as EVENTFUL_CAP_NAMES,bE as EVENT_DENSITY_BATCH_MAX,ck as EVENT_KIND_BY_CAP,ya as EVENT_OWNER_TYPES,Xs as EVENT_PAD_MS,Px as EVENT_TAXONOMY,uR as EXPORT_DENSE_MAX_RANGES,Br as EXPRESSION_BUILTINS,Vr as EXPRESSION_BUILTIN_NAMES,qr as EXPRESSION_COMPILE_CACHE_CAPACITY,Jr as EXPRESSION_IDENTIFIER_RE,Ei as EXPRESSION_INJECTED_NOW,bv as EXTENSION_HOST_DEVICE_TYPES,vv as EXTENSION_SLOTS,gv as EXTENSION_SLOT_IDS,Sv as EXTENSION_SLOT_LISTING_METHOD,xv as EXTENSION_SLOT_REF_SEPARATOR,ZE as EffectiveTuningSchema,Hp as EgressEncodeSchema,Up as EgressRateControlSchema,Wp as EgressTranscodeRequestSchema,Gp as EgressTranscodeSchema,xY as ElementConfigStore,Gv as EmbeddingFailedModelSchema,Kv as EmbeddingFailedRequirementSchema,qv as EmbeddingInfoSchema,Zv as EmbeddingRefusalCodeSchema,Uv as EmbeddingResultSchema,Wv as EmbeddingTowerSchema,ja as EncodeProfileSchema,vt as EncodedPacketSchema,$d as EnrichedWidgetMetadataSchema,bN as EnumSensorDateTimeFormatSchema,xN as EnumSensorStatusSchema,ge as EventCategory,yE as EventDensityBucketSchema,xE as EventDensityForDeviceSchema,wN as EventEmitterStatusSchema,CN as EventFireSchema,dT as EventKindCategorySchema,pT as EventKindDescriptorSchema,uT as EventKindIconSchema,cT as EventKindSchema,mT as EventKindsForDeviceSchema,Ep as EventMediaArtifactSchema,Dp as EventMediaCoverageSchema,Tp as EventMediaKindSchema,Op as EventMediaProductionSchema,ba as EventOwnerTypeSchema,fa as EventSourceType,wR as ExportBytesSchema,gR as ExportClipSubjectSchema,lR as ExportDenseRangeSchema,dR as ExportDenseSchema,SR as ExportDownloadSchema,hR as ExportFootageSubjectSchema,pR as ExportOptionsSchema,vR as ExportRecordSchema,x_ as ExportSetupFieldSchema,S_ as ExportSetupSchema,cR as ExportSpeedSchema,mR as ExportStateSchema,_R as ExportSubjectSchema,fR as ExportTimelapseSchema,T_ as ExposedDeviceSchema,eP as ExposureModeSchema,pd as ExpressionBindingSourceSchema,k as ExpressionEvalError,ud as ExpressionFieldBindingSchema,fd as ExpressionGlobalBindingSchema,dd as ExpressionLiteralBindingSchema,O as ExpressionParseError,md as ExpressionSourceSchema,Mv as ExtensionCandidateSchema,Nv as ExtensionCandidatesSchema,Pv as ExtensionSetResultSchema,Iv as ExtensionSetSlotInputSchema,Dv as ExtensionSlotActivationSchema,_v as ExtensionSlotIdSchema,Fv as ExtensionSlotRefInputSchema,Av as ExtensionSlotRowSchema,Ev as ExtensionSlotSourceSchema,Ov as ExtensionSlotStateSchema,kv as ExtensionSlotUnreachableSchema,yv as ExtensionSlotValueSchema,Cv as ExtensionSourceAvailabilitySchema,Tv as ExtensionSourceHealthSchema,wv as ExtensionSourceSchema,tH as FEEDER_EXAMPLE_ADDON_ID,eH as FEEDER_EXAMPLE_HA_DEVICE_ID,vr as FFMPEG_PATH_ENV,qs as FIRST_LEVEL_MACRO_CLASSES,bJ as FULL_IMAGE_BBOX,cy as FailureContributionSchema,ru as FailureCounters,sy as FailureReasonCountSchema,RN as FanControlStatusSchema,LN as FanDirectionSchema,aB as FeatureManifestSchema,BN as FeatureProbeStatusSchema,Rv as FieldClaimModeSchema,Bv as FieldClaimSchema,HN as FloodStatusSchema,fr as Fmp4BoxSplitter,bt as FrameHandleFormatSchema,C as FrameHandleSchema,lf as FrameInputSchema,dO as FrameLazyCountersSchema,fO as FrameLazyMetricsSchema,hW as G711_SCALE_CORRECTION_DB,WN as GasStatusSchema,MB as GetLoggingSettingsInputSchema,Bp as GetStreamWithCodecInputSchema,TO as GlobalMetricsSchema,AM as GridLayoutPatchSchema,kM as GridLayoutViewSchema,Ka as HAP_AUDIO_BASE,Ga as HAP_AUDIO_BITRATE_KBPS,qa as HAP_AUDIO_VBV_KBITS,Ja as HAP_KEYFRAME_INTERVAL_SEC,dH as HF_BASE_URL,uH as HF_REPO,GR as HOURS_PER_DAY,Ig as HWACCEL_OPTIONS,oB as HealthStatusSchema,Ky as HfModelResolutionSchema,CV as HistoryPointSchema,xV as HistoryResolutionEnum,KN as HumidifierStatusSchema,JN as HumiditySensorStatusSchema,PM as HvacModeSchema,JO as INFERENCE_DEVICE_EXCLUSION_REASONS,mk as ImageContractSchema,pk as ImageContractStateSchema,QN as ImageRotateSchema,iP as ImageSettingsOptionsSchema,aP as ImageSettingsPatchSchema,rP as ImageSettingsStatusSchema,XN as ImageStatusSchema,YO as InferenceDeviceExclusionReasonSchema,DO as IngestOwnerSchema,Hj as InstalledPackageSchema,cP as IntegrationLiteSchema,sP as IntegrationWithStateSchema,gP as IntercomAbilitySchema,_P as IntercomStatusSchema,QU as KNOWN_CAP_NAMES,gE as KeyEventSchema,hl as LEGACY_READ_ONLY_CONFIG_KEY,tv as LINKED_DEVICES_SLOT,Qy as LOAD_CONTRIBUTION_ATTRIBUTIONS,Zy as LOAD_CONTRIBUTION_ROLES,F_ as LOCATION_DESCRIPTION_MAX,A_ as LOCATION_ICON_FALLBACK,k_ as LOCATION_ICON_IDS,Zl as LOG_CHANNEL_TICK_MS,Is as LOG_LEVEL_RANK,HE as LTS_SCOPE_CLASS_SEPARATOR,kT as LabelAttributionSchema,Gs as LabelDefinitionSchema,OT as LabelTierSchema,bP as LawnMowerActivitySchema,SP as LawnMowerControlStatusSchema,nl as LedgerWalkDeviceReportSchema,Qc as LedgerWalkInputSchema,$c as LedgerWalkRefusalSchema,rl as LedgerWalkReportSchema,tl as LedgerWalkSkipCountsSchema,el as LedgerWalkSkipReasonSchema,Ol as LegacyStorageLocationDefaultSchema,$_ as LinkedDeviceSchema,Q_ as LinkedDevicesModeSchema,ev as LinkedDevicesSlotValueSchema,Ss as ListTrackRelationsInputSchema,Cs as ListTrackRelationsResultSchema,Uy as LlmDefaultSchema,Hy as LlmDefaultSelectorSchema,Oy as LlmDownloadProgressSchema,gy as LlmErrorCodeSchema,wy as LlmGenerateBaseInputSchema,yy as LlmGenerateErrSchema,_y as LlmGenerateOkSchema,by as LlmGenerateResultSchema,xy as LlmImageSchema,Ay as LlmNodeModelSchema,Vy as LlmProfileKindDescriptorSchema,Ry as LlmProfileKindSchema,zy as LlmProfileSchema,vy as LlmRefusalSourceSchema,Sy as LlmRetryPolicySchema,Fy as LlmRuntimeAppleCompleteInputSchema,Iy as LlmRuntimeCancelInputSchema,My as LlmRuntimeCompleteInputSchema,jy as LlmRuntimeDiskUsageSchema,qy as LlmRuntimeNodeSchema,ky as LlmRuntimeStatusSchema,Cy as LlmTimeoutDefaults,Wy as LlmUsageRollupSchema,hy as LlmUsageSchema,$y as LoadContributionSchema,rR as LocateSegmentResultSchema,I_ as LocationDescriptionAssignmentSchema,M_ as LocationIconAssignmentSchema,j_ as LocationIconIdSchema,Yf as LocationStatSchema,RP as LockControlStatusSchema,LP as LockStateSchema,tb as LogChannelApplyResultSchema,Ul as LogChannelDescriptorSchema,Gl as LogChannelGate,Hl as LogChannelLevelSchema,Kl as LogChannelRegistry,OB as LogChannelWindowPatchSchema,Wl as LogChannelWindowSchema,DB as LogChannelWindowStateSchema,ib as LogEntrySchema,rb as LogLevelSchema,tM as LogStreamEntrySchema,CB as LoggingEffectiveSchema,wB as LoggingExplicitSchema,SB as LoggingLevelLayerSchema,xB as LoggingLevelSourceSchema,bB as LoggingScopeKindSchema,kB as LoggingSettingsPatchSchema,PB as LoggingSettingsStateSchema,ub as LoginMethodContributionSchema,ob as LoginStageEnum,GE as LtsBucketSchema,yx as MACRO_LABELS,as as MAX_ARCHIVED_DEBUG_NOTES,$o as MAX_BIRTH_DECISION_RECORDS,ts as MAX_BIRTH_LATENCY_PROXY_MS,Sw as MAX_CAMERA_SENSORS,VA as MAX_CLIP_EVENT_IDS,HA as MAX_CLIP_LABELS,Fi as MAX_COMPOSITION_CODE_LENGTH,Ni as MAX_COMPOSITION_FEATURES,Pi as MAX_COMPOSITION_FIELDS_PER_FEATURE,qi as MAX_COMPOSITION_ITEMS,hd as MAX_CONDITION_DEPTH,gd as MAX_CONDITION_LEAVES,Ur as MAX_EXPRESSION_AST_NODES,Gr as MAX_EXPRESSION_BINDINGS,Kr as MAX_EXPRESSION_CALL_ARGS,Wr as MAX_EXPRESSION_EVAL_STEPS,Hr as MAX_EXPRESSION_SOURCE_LENGTH,eu as MAX_KEYS,$l as MAX_REASONS_PER_KEY,nc as MAX_SENSOR_TRIGGER_DEVICES,CT as MAX_TRACK_DEBUG_NOTE_LEN,us as MAX_TRACK_PURITIES,ls as MAX_TRACK_RELATIONS,pa as MEDIA_OWNER_TYPES,xa as MEDIA_PRESENCE_OWNER_KINDS,ZU as METHOD_ACCESS_MAP,tW as METHOD_DEVICE_SELECTORS,UR as MINUTES_PER_DAY,Wu as MODEL_FORMATS,Qu as MODEL_HOSTING,Yu as MODEL_PROVIDER_IDS,YP as MOTION_CLOSE_AFTER_MS,eO as MOTION_SOURCE_LABELS,KH as MOTION_TRIGGER_FEATURE,Gy as ManagedModelCatalogEntrySchema,Ty as ManagedModelExtraFileSchema,Ey as ManagedModelRefSchema,Dy as ManagedRuntimeConfigSchema,eS as MaskGridDimsSchema,Yx as MaskGridShapeSchema,Xx as MaskLineShapeSchema,Kx as MaskPointSchema,Jx as MaskPolygonShapeSchema,$x as MaskPolygonVerticesSchema,qx as MaskRectShapeSchema,Qx as MaskShapeKindSchema,Zx as MaskShapeSchema,GT as MediaFileInfoSchema,HT as MediaFileKindEnum,UT as MediaFileRefSchema,WT as MediaFileSchema,VP as MediaPlayerRepeatSchema,BP as MediaPlayerStateSchema,UP as MediaPlayerStatusSchema,Sa as MediaPresenceOwnerKindSchema,Oc as MediaRelocateModeSchema,KP as MeshPeerSchema,qP as MeshStatusSchema,ow as MethodAccessSchema,mv as MigrateDeviceResultSchema,fv as MigrateSwitchOutcomeSchema,pv as MigrateSwitchReportSchema,ed as ModelCatalogEntrySchema,Mb as ModelConvertInputSchema,nd as ModelConvertMetadataSchema,Pb as ModelDistributeInputSchema,Fb as ModelDistributeResultSchema,Ku as ModelExtraFileSchema,Gu as ModelFormatEntrySchema,qu as ModelFormatsSchema,$u as ModelLicenseSchema,Xu as ModelProviderIdSchema,lD as ModelSubstitutionSchema,Ju as ModelVariantGroupSchema,Rb as MotionAnalysisResultSchema,FT as MotionEventSchema,ZP as MotionOnMotionChangedDataSchema,Lb as MotionRegionSchema,QD as MotionSourceEnum,$D as MotionSourcesSchema,XP as MotionStatusSchema,eF as MotionTriggerRuntimeStateSchema,$P as MotionTriggerStatusSchema,vw as MotionTriggeredBySchema,iF as MotionZoneOptionsSchema,aF as MotionZonePatchSchema,nF as MotionZoneRegionSchema,rF as MotionZoneStatusSchema,Xb as MqttBrokerStatusSchema,Eg as MutationFilterSchema,LJ as NATIVE_LEASE_ACTIVITY_FIELD,kJ as NATIVE_LEASE_ACTIVITY_KEY,BJ as NATIVE_LEASE_ADMISSION_FIELD,AJ as NATIVE_LEASE_ADMISSION_KEY,IJ as NATIVE_LEASE_BUDGET_FIELD,OJ as NATIVE_LEASE_BUDGET_KEY,FJ as NATIVE_LEASE_HOLD_FIELD,DJ as NATIVE_LEASE_HOLD_KEY,zJ as NATIVE_LEASE_SCENE_BUDGET_FIELD,MJ as NATIVE_LEASE_SCENE_BUDGET_KEY,EJ as NATIVE_LEASE_SECTION_ID,RJ as NATIVE_LEASE_TILE_BUDGET_FIELD,jJ as NATIVE_LEASE_TILE_BUDGET_KEY,yF as NAVIGATION_ACTION_CATALOG,wF as NAVIGATION_LIGHT_LEVEL_MAX,CF as NAVIGATION_LIGHT_LEVEL_MIN,jK as NC_ALARM_DELAY_FIELDS,kC as NC_ALARM_DELAY_MAX_SEC,jC as NC_ALARM_NONBLOCKING_MAX,EK as NC_ALARM_OPENING_EVENT_KINDS,ZC as NC_ALARM_SENSORS_MAX,aS as NC_ALARM_SYSTEM_EVENT_KINDS,AC as NC_ALARM_TRIGGERED_MAX_SEC,kW as NC_AUDIO_CONFIRM_HITS_DEFAULT,MW as NC_AUDIO_CONFIRM_HITS_MAX,jW as NC_AUDIO_CONFIRM_HITS_MIN,PW as NC_AUDIO_CONFIRM_WINDOW_MAX_SEC,NW as NC_AUDIO_CONFIRM_WINDOW_MIN_SEC,AW as NC_AUDIO_CONFIRM_WINDOW_SEC_DEFAULT,CS as NC_AUDIO_DBFS_FLOOR,SW as NC_AUDIO_DB_MAX,xW as NC_AUDIO_DB_MIN,wW as NC_AUDIO_DB_OFFERED,CW as NC_AUDIO_DB_STEP,FW as NC_AUDIO_DEFAULTS,EW as NC_AUDIO_HIT_PERCENT_MAX,TW as NC_AUDIO_HIT_PERCENT_MIN,OW as NC_AUDIO_SAMPLING_MAX_SEC,DW as NC_AUDIO_SAMPLING_MIN_SEC,fK as NC_AUDIO_SEED,iS as NC_AUTHORABLE_SYSTEM_EVENT_KINDS,nG as NC_BASE_CONDITION_KEYS,oS as NC_BATTERY_CONSUMABLE_SYSTEM_EVENT_KINDS,ZG as NC_CAMERA_SCOPE_CAP_NAME,zS as NC_CLIP_POST_ROLL_DEFAULT_SEC,RS as NC_CLIP_PRE_ROLL_DEFAULT_SEC,nw as NC_CLIP_RETENTION_MAX_SEC,hC as NC_CONDITION_CATALOG,KS as NC_CONFIRM_DEFAULT_MAX_IMAGE_PX,GS as NC_CONFIRM_DEFAULT_TIMEOUT_MS,WS as NC_CONFIRM_MAX_TIMEOUT_MS,US as NC_CONFIRM_MIN_TIMEOUT_MS,lS as NC_CONSUMABLE_LOW_PERCENT_DEFAULT,uS as NC_CONSUMABLE_LOW_PERCENT_MAX,sS as NC_CONSUMABLE_SYSTEM_EVENT_KINDS,hS as NC_DEFAULT_SNOOZE_MINUTES,bC as NC_HISTORY_LIMIT_DEFAULT,xC as NC_HISTORY_LIMIT_MAX,pS as NC_MAX_PER_TRACK_IMMEDIATE,dK as NC_OCCUPANCY_DEFAULTS,ZS as NC_RULE_CLEARABLE_KEYS,hK as NC_RULE_EDITOR_SECTION_ORDER,GG as NC_RULE_KIND_SPECS,iK as NC_RULE_SECTIONS,UK as NC_SENSOR_RAISED_FIELD_BY_KIND,WK as NC_SENSOR_TRANSITION_KINDS,AK as NC_SENSOR_TRANSITION_NEVER_FIRES_WARNING,JK as NC_SENSOR_TRANSITION_UNSUPPORTED_REASON,jq as NC_SERVER_PACKAGE_NAME,mS as NC_SNOOZE_MAX_MINUTES,JG as NC_SYSTEM_DELIVERY,EG as NC_SYSTEM_EVENT_CONDITION_FILTER_KEYS,SG as NC_SYSTEM_EVENT_FAMILIES,wG as NC_SYSTEM_EVENT_FAMILY,DG as NC_SYSTEM_EVENT_FAMILY_FILTERS,yG as NC_SYSTEM_EVENT_FILTER_KEYS,OG as NC_SYSTEM_EVENT_KIND_GROUP_SPECS,vq as NC_SYSTEM_EVENT_SUMMARY_FAMILIES,PG as NC_SYSTEM_RULE_KINDS,cS as NC_TANK_SYSTEM_EVENT_KINDS,Hx as NC_TAXONOMY,cq as NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS,sq as NC_TEMPLATE_VARS,Mq as NC_UPDATE_EVENT_PACKAGE_NAMES,kF as NETWORK_LINK_TYPES,jF as NETWORK_LINK_UNKNOWN,PD as NativeCropBboxSchema,qE as NativeCropRefSchema,FD as NativeCropResultSchema,cF as NativeDetectionSchema,NJ as NativeLeaseAdmissionSchema,PJ as NativeLeaseSettingsSchema,sF as NativeObjectClassEnum,dF as NativeObjectDetectionOptionsSchema,pF as NativeObjectDetectionRuntimeStateSchema,fF as NativeObjectDetectionSettingsPatchSchema,lF as NativeObjectDetectionStatusSchema,uF as NativeObjectGeometryEnum,vF as NavigationActionEntrySchema,gF as NavigationActionIdSchema,_F as NavigationEntryKindSchema,xF as NavigationFeaturesSchema,SF as NavigationLightModeSchema,TF as NavigationModeSchema,hF as NavigationMoveCommandSchema,bF as NavigationPointSchema,DF as NavigationRuntimeStateSchema,EF as NavigationStatusSchema,XC as NcAlarmConfigSchema,GC as NcAlarmModeCoverageSchema,LC as NcAlarmModeDelaysEditSchema,FC as NcAlarmModeDelaysSchema,zC as NcAlarmNonBlockingEditSchema,QC as NcAlarmSensorReadingSchema,$C as NcAlarmSensorStateSchema,ew as NcAlarmSensorsInputSchema,tw as NcAlarmSensorsSchema,HC as NcAlarmSettingsPatchSchema,VC as NcAlarmSettingsSchema,UC as NcAlarmSkipReasonSchema,WC as NcAlarmSkippedDeviceSchema,wS as NcAudioConditionSchema,rw as NcClipRetentionAskSchema,iw as NcClipRetentionPlanSchema,mC as NcConditionDescriptorSchema,PS as NcConditionsSchema,qS as NcConfirmExpectSchema,JS as NcConfirmSchema,TS as NcCrossingSchema,tS as NcDeliverySchema,MS as NcDeviceStateConditionSchema,yC as NcHistoryEntrySchema,SC as NcHistoryFilterSchema,_C as NcHistoryRecordKindSchema,gC as NcHistoryStatusSchema,vC as NcHistorySubjectSchema,LS as NcLinkedCameraModeSchema,IS as NcMediaFrameSchema,BS as NcMediaPolicySchema,SS as NcOccupancyConditionSchema,xS as NcPlateMatcherSchema,OS as NcRuleActionSchema,kS as NcRuleActionSequenceSchema,jS as NcRuleActionsSchema,QS as NcRuleClearableKeySchema,YS as NcRuleInputSchema,aC as NcRuleKindSchema,CC as NcRuleLastRunSchema,wC as NcRuleLastRunsSchema,AS as NcRuleNotificationButtonSchema,XS as NcRulePatchSchema,eC as NcRuleSchema,FS as NcRuleTargetSchema,$S as NcRuleUpdateInputSchema,NS as NcSceneConditionSchema,_S as NcScheduleSchema,gS as NcScheduleWindowSchema,ES as NcSensorTransitionSchema,EC as NcSnoozeInputSchema,DC as NcSnoozeSchema,TC as NcSnoozeScopeSchema,OC as NcSnoozeSuppressedSchema,nC as NcStateSummaryPreviewRowSchema,rC as NcStateSummaryPreviewSchema,tC as NcStateSummaryPreviewSectionSchema,yS as NcStateSummarySplitSchema,dS as NcSystemEventConditionSchema,vS as NcSystemEventDeliveryModeSchema,bS as NcSystemEventDeliverySchema,nS as NcSystemEventKindSchema,Rx as NcTaxonomyEntrySchema,zx as NcTaxonomySchema,sC as NcTemplateFamilySchema,cC as NcTemplateFieldSchema,fC as NcTemplatePreviewInputSchema,pC as NcTemplatePreviewSchema,dC as NcTemplateVarContextSchema,uC as NcTemplateVarDescriptorSchema,lC as NcTemplateVarGroupSchema,oC as NcTemplateVarKindSchema,iC as NcTestResultSchema,VS as NcThrottleGranularitySchema,HS as NcThrottleSchema,DS as NcZoneConditionSchema,$b as NetworkAccessStatusSchema,sB as NetworkAddressSchema,Qb as NetworkEndpointSchema,AF as NetworkLinkStatusSchema,eI as NodeDirectoryEntrySchema,tI as NodeDirectorySchema,ax as NotificationActionIconSchema,ox as NotificationActionSchema,ix as NotificationFormatSchema,sx as NotificationSchema,oI as NotifierStatusSchema,uI as NumericSensorStatusSchema,TU as OPERATOR_WRITTEN_STALE_MS,Ws as OPS_LOG_DEFAULT_LIMIT,Us as OPS_LOG_RING_DEFAULT_MAX,tu as OVERFLOW_REASON,xu as OVERLAY_LAYERS,_e as OWNER_ONLY_EVENT_CATEGORIES,gw as OauthIntegrationDescriptorSchema,BT as ObjectEventSchema,mO as OccupancyBurstRefusalSchema,nk as OccupancyLookAnswerSchema,ek as OccupancyLookRefusalSchema,tk as OccupancyLookRequestSchema,RR as OnboardFieldSupportSchema,PR as OnboardRecordTrackSchema,zR as OnboardScheduleSupportSchema,NR as OnboardStorageSchema,MR as OnboardStorageVolumeSchema,Rs as OpsLogDomainSchema,Vs as OpsLogEntrySchema,zs as OpsLogOpSchema,Hs as OpsLogQueryInputSchema,Bs as OpsLogReasonSchema,DD as OrchestratorMetricsSchema,fI as OsdOverlayKindEnum,gI as OsdOverlayPatchSchema,mI as OsdOverlaySchema,pI as OsdPositionEnum,xI as OsdRenderOutcomeEnum,SI as OsdRenderResultSchema,yI as OsdSlotBindingSchema,bI as OsdSlotViewSchema,wI as OsdSourceOptionSchema,vI as OsdSourceSchema,CI as OsdSourceValueTypeEnum,hI as OsdStatusSchema,rt as PEER_BYTES_CHUNK_BYTES,tt as PEER_BYTES_MAX_OUTSTANDING,nt as PEER_BYTES_STALL_MS,et as PEER_BYTES_TICKET_TTL_MS,Fh as PENDING_BLOCK_ID,DI as PET_FEEDER_MANUAL_FEED_MAX,EI as PET_FEEDER_MANUAL_FEED_MIN,Ro as PIPELINE_ANALYTICS_CAP_NAME,DV as PIPELINE_FLOW_CAPABILITY_NAMES,OV as PIPELINE_OWNER_CAPABILITY_NAMES,Lo as PRIVACY_MASK_CAP_NAME,iW as PROVIDER_KIND_CAP_NAMES,Wt as PROVIDER_PIN_FIELD,XY as PYTHON_SCRIPT,Uj as PackageUpdateSchema,Wj as PackageVersionInfoSchema,LD as ParkRefusalSchema,RD as ParkTrackFrameResultSchema,ID as ParkedFrameKindSchema,zD as ParkedTrackFrameSchema,lb as PasskeyLoginMethodSchema,mA as PasskeySummarySchema,Ef as PcmSampleFormatSchema,it as PeerBytesTicketSchema,gV as PerScopeBreakdownSchema,AI as PetFeederStatusSchema,Yp as PickStreamPreferencesSchema,Jp as PickStreamRequirementsSchema,Xp as PickedCamStreamSchema,CO as PipelineAssignmentSchema,$E as PipelineDefaultStepSchema,Y as PipelineEngineChoiceSchema,TD as PipelineRunResultBridge,cD as PipelineStepInputSchema,uD as PipelineValidationIssueSchema,dD as PipelineValidationResultSchema,Lp as PlaceholderReasonSchema,jD as PolygonPointSchema,zY as PoolMemoryWatchdog,eL as PowerMeterStatusSchema,rL as PresenceStatusSchema,aL as PressureSensorStatusSchema,uL as PrivacyMaskOptionsSchema,dL as PrivacyMaskPatchSchema,cL as PrivacyMaskRegionSchema,sL as PrivacyMaskShapeSchema,lL as PrivacyMaskStatusSchema,kt as ProfileRtspEntrySchema,dt as ProfileSlotSchema,ut as ProfileSlotStatusSchema,cJ as ProviderMotionDataSchema,z_ as ProviderStatusSchema,EL as PtzAutotrackRuntimeStateSchema,CL as PtzAutotrackSettingsSchema,TL as PtzAutotrackStatusSchema,wL as PtzAutotrackTargetOptionSchema,bL as PtzHomePresetSchema,xL as PtzHomeReturnSchema,_L as PtzMoveCommandSchema,yL as PtzOptionsSchema,gL as PtzPositionSchema,mL as PtzPresetFunctionSchema,hL as PtzPresetSchema,vL as PtzStatusSchema,W as QueryFilterSchema,Ha as RATE_CONTROL_RELAXED,Va as RATE_CONTROL_TIGHT,yU as REACHABILITY_FAILURES_TO_OFFLINE,vU as REACHABILITY_POLL_INTERVAL_MS,bU as REACHABILITY_PROBE_TIMEOUT_MS,dl as RECOGNITION_TYPES,rc as RECORDING_AUDIO_TRIGGER_OFFERED_DBFS,CR as RECORDING_EXPORT_MAX_READ_BYTES,kL as RECORDING_SOURCE_CAMSTACK,AL as RECORDING_SOURCE_CAMSTACK_ADDON,HL as RECORDING_TIMELINE_BATCH_MAX,Go as REDACTED_SECRET,Yr as RESERVED_BINDING_NAMES,fz as RESERVED_COLLECTION_SOURCES,uW as RESTORED_CAP_NAMES,XV as ROOM_EXAMPLE_MOTION_SOURCES,YV as ROOM_EXAMPLE_TEMPERATURE_SOURCES,JV as ROOM_OCCUPANCY_WINDOW_MS,ou as ROOT_BUCKET_KEY,pH as RUNTIME_DEFAULTS,oW as RUNTIME_STATE_POLICY,wU as RUNTIME_STATE_REFRESH_MISS_COOLDOWN_MS,YY as RUNTIME_TO_FORMAT,mn as RawStateResultSchema,aR as ReadGopBytesResultSchema,iR as ReadSegmentBytesResultSchema,oR as ReadWindowBytesResultSchema,Ft as ReadinessRegistry,At as ReadinessTimeoutError,FE as RebuildObjectEmbeddingsRefusalSchema,fE as RecentTracksPageSchema,dE as RecentTracksQueryInput,AR as RecordTriggerSchema,jR as RecordWindowSchema,UL as RecordingAvailabilityForDeviceSchema,NL as RecordingAvailabilitySchema,sc as RecordingBandAudioSchema,ac as RecordingBandModeSchema,cc as RecordingBandSchema,oc as RecordingBandTriggersSchema,pc as RecordingConfigSchema,WL as RecordingDaysForDeviceSchema,PL as RecordingDaysSchema,GL as RecordingDeviceUsageSchema,KL as RecordingLocationUsageSchema,FL as RecordingManifestSchema,ec as RecordingObjectTriggerClassSchema,BR as RecordingOnboardOptionsSchema,VR as RecordingOnboardPatchSchema,FR as RecordingOnboardStatusSchema,zL as RecordingPlaybackSchema,jL as RecordingRangeSchema,ML as RecordingReadSchema,QL as RecordingRebalanceInputSchema,JL as RecordingRebalanceMoveSchema,ZL as RecordingRebalancePlanSchema,YL as RecordingRebalanceSkipReasonSchema,XL as RecordingRebalanceSkipSchema,fc as RecordingRetentionSchema,uz as RecordingSignalRuntimeStateSchema,lz as RecordingSignalStatusSchema,IL as RecordingSourceAvailabilitySchema,RL as RecordingSourceOptionsSchema,LL as RecordingSourceSchema,VL as RecordingStatusSchema,$s as RecordingStorageModeSchema,qL as RecordingStorageUsageSchema,ic as RecordingTriggersSchema,Zs as RecordingWeekdaySchema,sb as RedirectLoginMethodSchema,al as RelocatableMediaCountInputSchema,il as RelocatableMediaCountSchema,Tc as RelocateFootageClassSchema,Ec as RelocateFootageInputSchema,wc as RelocateJobSchema,Cc as RelocateJobStateSchema,kc as RelocateMediaInputSchema,Xc as RelocateResidueInputSchema,Zc as RelocateResidueSchema,mx as RenderedAsSchema,iO as ReportMotionInputSchema,jB as ReportedFailureContributionSchema,AB as ReportedLoadContributionSchema,mB as RequestCensusGroupSchema,hB as RequestCensusProcedureSchema,gB as RequestCensusSnapshotSchema,_B as RequestCensusStatusSchema,ZT as RetrainAnnotationDraftSchema,qT as RetrainAnnotationKindSchema,XT as RetrainAnnotationSchema,JT as RetrainAnnotationSourceSchema,aE as RetrainAssistResultSchema,iE as RetrainAssistSubjectSchema,tE as RetrainCopyRefusalSchema,$T as RetrainFrameCandidateSchema,rE as RetrainFrameListSchema,eE as RetrainFrameSchema,nE as RetrainFrameSelectionSchema,KT as RetrainMacroClassSchema,ST as RetrainStatusSchema,QT as RetrainTrackSchema,oE as RetrainTransitionResultSchema,UY as RingBuffer,Vp as RtpSourceSchema,kp as RtspRestreamEntrySchema,cO as RunnerCameraConfigSchema,lO as RunnerCameraDeviceUIFields,aO as RunnerFrameSourceSchema,sO as RunnerInferenceDeviceSchema,oO as RunnerJumpStepProvisioningSchema,uO as RunnerLocalLoadSchema,pO as RunnerLocalMetricsSchema,hz as SCENE_CONDITIONS,kz as SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX,Oz as SCENE_CONFIRM_DEFAULT_TIMEOUT_MS,Ez as SCENE_DEFAULT_ANCHOR_THRESHOLD,Tz as SCENE_DEFAULT_CHECK_INTERVAL_SEC,wz as SCENE_DEFAULT_OBSERVATION_SPACING_SEC,Cz as SCENE_DEFAULT_QUIET_SECONDS,Dz as SCENE_DEFAULT_UNCOVERED_POLICY,_z as SCENE_DIVERGED,Az as SCENE_RESET_RECAPTURES,dW as SCOPE_PRESETS,JH as SENSOR_FEATURES,XH as SENSOR_MAP,$e as SHARE_VIEW_KINDS,xr as SOURCE_CAPS,yr as SOURCE_CAP_ACTIVE_FIELD,br as SOURCE_CAP_CHANGED_AT_FIELD,Sr as SOURCE_DEVICE_TYPES,t_ as SOURCE_INFO_METADATA_KEY,Lq as STATE_LABELS,Iq as STATE_LABEL_KEYS,Cu as STATIONARY_OVERLAY_STYLE,Pl as STORAGE_ACCESS_FALLBACK,Al as STORAGE_BYTES_PER_GB,fl as STORAGE_LOCATION_MODES,$z as STREAM_PROFILE_META,Ts as STREAM_QUALITY_LABELS,ul as SUB_DETECTION_TYPES,eW as SYSTEM_CAP_NAMES,nW as SYSTEM_SCOPE_DEVICE_METHODS,Sz as SceneCheckSchema,mz as SceneConditionSchema,jz as SceneConfirmSchema,Mz as SceneMonitorSchema,xz as SceneMonitorStateSchema,Pz as SceneMonitorStatusForDeviceSchema,Nz as SceneMonitorStatusSchema,bz as SceneReferenceSchema,yz as SceneUnavailableSchema,gz as SceneUncoveredPolicySchema,vz as SceneVerdictSchema,hw as ScopedTokenSchema,XB as ScopedTokenSummarySchema,wE as ScoredObjectEventSchema,zz as ScriptRunnerStatusSchema,Gj as SearchResultSchema,Tk as SendEmailInputSchema,Ek as SendEmailResultSchema,hx as SendResultSchema,hT as SensorEventSchema,dk as ServerBootModeSchema,yk as ServerPackageStatusSchema,vk as ServerRollbackInfoSchema,Sk as ServerUpdateActionResultSchema,bk as ServerUpdateCheckResultSchema,xk as ServerUpdateOutcomeSchema,fk as ServerUpdateStateSchema,$O as SetCameraSensorsInputSchema,NB as SetLoggingSettingsInputSchema,dB as SetSiteLocationInputSchema,bs as SetTrackPurityInputSchema,xs as SetTrackPurityResultSchema,_s as SetTrackRelationInputSchema,Gd as SettingsPatchSchema,kg as SettingsRecordSchema,Wd as SettingsSchemaWithValuesSchema,Kd as SettingsUpdateResultSchema,Rg as ShmRingStatsSchema,lB as SiteLocationSchema,cB as SiteLocationSourceSchema,uB as SiteLocationStatusSchema,L_ as SiteZoneSchema,Vz as SmokeStatusSchema,Dk as SmtpStatusSchema,kk as SnapshotImageSchema,Zg as SourceInfoSchema,df as SpatialDetectionSchema,Mk as SsoBridgeClaimsSchema,Jb as StartEmbeddedInputSchema,vV as StationaryObjectSchema,Jk as StorageAbortUploadInputSchema,Nl as StorageAccessSchema,Yk as StorageBeginDownloadInputSchema,Xk as StorageBeginDownloadResultSchema,Wk as StorageBeginUploadInputSchema,Gk as StorageBeginUploadResultSchema,sl as StorageCleanupInputSchema,cl as StorageCleanupJobSchema,ol as StorageCleanupPhaseSchema,ll as StorageCleanupStatusInputSchema,Ml as StorageDrainProgressSchema,Qk as StorageEndDownloadInputSchema,ml as StorageEvictionPolicySchema,qk as StorageFinalizeUploadInputSchema,Fl as StorageLocationDeclarationSchema,pl as StorageLocationModeSchema,R as StorageLocationRefSchema,L as StorageLocationSchema,Dl as StorageLocationTypeSchema,Nc as StorageMigrationClassSchema,Pc as StorageMigrationDestinationsSchema,Yc as StorageMigrationDrainInputSchema,Uc as StorageMigrationFindingCodeSchema,Wc as StorageMigrationFindingSchema,Dc as StorageMigrationFootageMoveInputSchema,Lc as StorageMigrationInputSchema,Hc as StorageMigrationJobSchema,Kc as StorageMigrationLaneSchema,I as StorageMigrationLeaseInputSchema,Mc as StorageMigrationMediaMoveInputSchema,Ic as StorageMigrationModeSchema,Bc as StorageMigrationMoveProgressSchema,Vc as StorageMigrationMoveSchema,qc as StorageMigrationMoverSchema,zc as StorageMigrationParticipantSchema,Rc as StorageMigrationPhaseSchema,Gc as StorageMigrationPlanSchema,Jc as StorageMigrationResidueSchema,Fc as StorageMigrationSourcesSchema,Bk as StorageOccupancyReportSchema,Hk as StorageProviderInfoSchema,Zk as StorageReadChunkInputSchema,Uk as StorageTestLocationResultSchema,Kk as StorageWriteChunkInputSchema,qp as StreamCodecSchema,wp as StreamFormatSchema,FF as StreamNetworkStatsSchema,Xz as StreamParamsOptionsSchema,Jz as StreamParamsStatusSchema,qz as StreamProfileConfigSchema,Yz as StreamProfileOptionsSchema,Zz as StreamProfilePatchSchema,Kz as StreamProfileSchema,eA as StreamSignalSchema,tA as StreamSignalsStatusSchema,gt as StreamSourceEntrySchema,_t as StreamSourceSchema,Tt as SubscribeAudioChunksInputSchema,Et as SubscribeAudioChunksResultSchema,xt as SubscribeFramesInputSchema,St as SubscribeFramesResultSchema,rB as SwitchStatusSchema,Ab as SystemMetricsSchema,MU as SystemMirror,G as TAXONOMY_COLORS,Jq as TIMELAPSE_DENSE_FLOOR_SEC,Bl as TIMEZONES,ds as TRACK_RELATIONS_DEFAULT_LIMIT,Wa as TRANSCODE_DOWN_MAX_BITRATE_KBPS,Ua as TRANSCODE_DOWN_MAX_HEIGHT,IB as TamperStatusSchema,iV as TankStatusSchema,lx as TargetKindCapsSchema,cx as TargetKindLevelSchema,dx as TargetKindSchema,fx as TargetSchema,RB as TemperatureSensorStatusSchema,sA as TerminalInstanceInfoSchema,cA as TerminalLegacyCameraSchema,uA as TerminalOutputBatchSchema,lA as TerminalOutputEventSchema,oA as TerminalProfileInfoSchema,aA as TerminalSessionInfoSchema,dP as TestConnectionResultSchema,uP as TestConnectionStatusEnum,gx as TestResultSchema,eJ as TimelapseRuleInputSchema,nJ as TimelapseRulePatchSchema,rJ as TimelapseRuleSchema,Vq as TimelapseTemplateSchema,BB as ToastSchema,J as TokenScopeSchema,WF as TopologyNodeSchema,BF as TopologyProcessSchema,zF as TopologyServiceSchema,EE as TrackCascadeCountsSchema,vT as TrackEnvelopeSchema,ET as TrackFlagsPatchSchema,DT as TrackFlagsSchema,yT as TrackProjectionSchema,gs as TrackPuritySchema,ms as TrackPurityValueSchema,fs as TrackRelationKindSchema,ws as TrackRelationRefusalSchema,hs as TrackRelationSchema,NT as TrackSchema,ps as TrackSideSchema,xT as TrackSourceSchema,sT as TrackStateSchema,lT as TrackZoneFilterSchema,SE as TrackedDetectionSchema,jT as TrainingExportDeviceTotalsSchema,MT as TrainingExportSummarySchema,pB as TransportPlaneCountsSchema,fB as TransportPlaneSchema,fA as TurnServerSchema,au as UNATTRIBUTED_BUCKET_KEY,NV as UNIT_TABLE,rp as UnifiedBrokerInfoSchema,PV as UnitConversionError,jc as UnstampedEventMediaCountSchema,Ac as UnstampedRowsSchema,pP as UpdateIntegrationInputSchema,HB as UpdateStatusSchema,KB as UpdateUserInputSchema,pw as UserRecordSchema,WB as UserSummarySchema,FA as VECTOR_INDEX_DIM_CONFLICT,tj as VIDEOCLIPS_MAX_OFFER_BYTES,ej as VIDEOCLIPS_MAX_READ_BYTES,dc as VISIT_MERGE_GAP_MS,aV as VacuumControlStatusSchema,rV as VacuumStateSchema,sV as ValveStateSchema,cV as ValveStatusSchema,xA as VectorDeclareIndexInputSchema,DA as VectorDeleteByFilterInputSchema,EA as VectorDeleteInputSchema,OA as VectorDeleteResultSchema,vA as VectorFilterSchema,kA as VectorGetInputSchema,AA as VectorGetResultSchema,yA as VectorItemSchema,bA as VectorMatchSchema,_A as VectorMetadataSchema,gA as VectorMetricSchema,wA as VectorQueryInputSchema,TA as VectorQueryResultSchema,RA as VectorStatsInputSchema,zA as VectorStatsResultSchema,SA as VectorUpsertInputSchema,CA as VectorUpsertResultSchema,uV as VibrationStatusSchema,ka as VideoEncodeSchema,yj as WEBRTC_CLIMB_HOLD_CODES,za as WEBRTC_EGRESS_PROFILE,bj as WEBRTC_TRY_BLOCKERS,KR as WEEKLY_MASK_LENGTH,Oe as WELL_KNOWN_TABS,ke as WELL_KNOWN_TAB_MAP,fV as WaterHeaterStatusSchema,mV as WeatherStatusSchema,xj as WebrtcClimbHoldSchema,vj as WebrtcLadderDecisionSchema,Cj as WebrtcSessionDebugSchema,_j as WebrtcStreamChoiceSchema,gj as WebrtcStreamTargetSchema,Sj as WebrtcTierFailureSchema,$N as WhiteBalanceModeSchema,Jd as WidgetHostEnum,cb as WidgetLoginMethodSchema,Zd as WidgetMetadataSchema,Xd as WidgetRemoteSchema,Yd as WidgetSizeEnum,iv as WrapperActivationReadSchema,gk as WrapperEvidenceSchema,_k as WrapperIdentitySchema,hk as WrapperKindSchema,wx as YAMNET_TO_MACRO,LT as ZoneCrossingDirectionSchema,RT as ZoneCrossingSchema,AD as ZoneKindEnum,Iz as ZoneRuleModeEnum,Lz as ZoneRuleSchema,TV as ZoneRuleStageEnum,Rz as ZoneRulesArraySchema,MD as ZoneSchema,_V as ZoneScopeBreakdownSchema,Xl as __resetLogChannelRegistryForTests,Ej as accessoriesCapability,hH as accessoryStableId,Fd as addonPagesCapability,Ld as addonPagesSourceCapability,Vd as addonRoutesCapability,qd as addonSettingsCapability,ef as addonWidgetsCapability,Qd as addonWidgetsSourceCapability,iM as addonsCapability,nn as adminUiCapability,oM as airQualitySensorCapability,Gx as alarmPanelCapability,HK as alarmPatchLanded,of as alertsCapability,cM as ambientLightSensorCapability,FK as applyModeDelaysEdits,IK as applyNonBlockingEdit,An as asBoolean,Dn as asJsonArray,En as asJsonObject,kn as asNumber,On as asString,iJ as assertTimelapseCadences,sf as audioAnalysisCapability,Tf as audioAnalyzerCapability,Se as audioChunkBytesPerSample,Nf as audioCodecCapability,RW as audioIsFailClosed,bW as audioKindId,HW as audioLabelChoices,pM as audioMetricsCapability,LW as audioModeOf,IW as audioOrDefaults,sr as audioPlanFromEncodeProfile,_W as audioScaleEraOf,Ff as authProviderCapability,Ps as autoAssignProfiles,hM as automationControlCapability,tp as backupCapability,gY as bareAddonId,_M as batteryCapability,mY as bestLocationMatch,yM as binaryCapability,oX as bindAddonActions,xM as brightnessCapability,Sp as brokerCapability,Ta as buildAddonRouteProvider,Yn as buildAudioArgs,Mh as buildCapabilityLookup,Yg as buildDeviceAdminUrl,oH as buildDoorbellCompositionFeature,uk as buildEventKindDescriptor,ir as buildFfmpegArgs,Un as buildInputArgs,Fu as buildModelVariantGroups,Vx as buildNcTaxonomy,YJ as buildRoleScopes,tB as buildStreamParamsConfigSchema,Jn as buildVideoArgs,rg as builtCapabilityBlockers,SM as buttonCapability,TM as cameraCredentialsCapability,jM as cameraGridLayoutCapability,oJ as cameraOwnsMotionViaSensor,Cp as cameraPipelineConfigCapability,ww as cameraSensorRefKey,Zp as cameraStreamsCapability,VV as canConvertUnit,oo as canonicalEgressPlan,NM as carbonMonoxideCapability,HY as cellsToRects,cd as classifyBearerPrincipal,ks as classifyStream,Os as classifyStreams,IM as climateControlCapability,bR as clipExportFailure,xR as clipExportFailureOf,qA as clipReasonHeaderValue,wi as cloneStatefulExpressionMemory,Bw as clusterModelSettingKey,tT as clusterStepSettingFieldsFor,eT as clusterStepSettingKey,Fa as codecIsAccepted,je as collectHydratedFieldEntries,Ne as collectHydratedFieldValues,qo as collectSecretConfigKeys,VM as colorCapability,Ix as colorForKind,IY as commitWatchdogRestart,Na as compareToTarget,di as compileExpression,fi as compileExpressionSafe,Wo as composeSwitchedOff,sa as composedDeviceRef,oa as composedDeviceStableId,qm as composerCapability,Dh as compositionEdges,$i as compositionFeatureEnabled,Nm as compositionFieldKey,la as compositionItemFieldPath,aa as compositionReadKey,ia as compositionSliceKey,P as compositionSourceKey,Wh as compositionSourceRefs,wd as conditionDepth,nK as conditionExclusionReason,tK as conditionVisibleForKind,KM as connectionTestCapability,JM as connectivityCapability,fS as consumableLowPercentOf,$M as consumablesCapability,tN as contactCapability,aN as controlCapability,zV as convertUnit,sg as coreBlockAddonId,hg as coreBlockComposition,cg as coreBlockIdFromAddonId,mg as coreBlockSourceKind,Cg as coreBlocksCapability,bY as cosineSimilarity,Td as countConditionLeaves,cN as coverCapability,MV as createDeviceExtensionProvider,xn as createDeviceProxy,Ve as createDurableState,ze as createEvent,vn as createEventBusSliceSource,mi as createExpressionScope,Ya as createHwAccelCache,_n as createLazyTrpcSource,Ql as createLogChannelsProvider,yn as createMirrorSource,EU as createRuntimeStateBridge,T as createSliceHandle,Ci as createStatefulExpressionMemory,fW as createSystemProxy,an as customAction,Tg as customModelRegistryCapability,Fg as dataStoreProviderCapability,Uf as databaseSnapshotCapability,mN as dayNightCapability,sz as dayOfWeekToIndex,BH as declarationOwnerNodeId,Yl as declareLogChannel,tX as decodeVectorBase64,zg as decoderCapability,mK as defaultDeliveryForSection,mX as defaultDeviceFor,rn as defineCustomActions,AV as defineExtensionSlotProvider,kH as deriveBatteryPresence,Ho as deriveCameraSwitches,SJ as deriveDetailCropRect,mc as deriveRecordingMode,ig as describeComposableCaps,sn as describeCustomActions,Lu as describeModelVariant,cz as describeOnboardClamp,JR as describeOnboardRefusal,gm as describeStateField,wq as describeSystemEventDeliveryProblem,NG as describeSystemEventFamilyProblem,_m as describeTopLevelStateFields,ZJ as detectAccessRole,Bg as detectionPipelineCapability,Ug as deviceAdminLinkCapability,y_ as deviceAdoptionCapability,JY as deviceBackendToFormat,on as deviceCustomAction,o_ as deviceDiscoveryCapability,O_ as deviceExportCapability,Lv as deviceExtensionCapability,hv as deviceManagerCapability,$H as deviceMatchesProfile,hn as deviceOpsCapability,G_ as deviceProviderCapability,$J as deviceSelectorMatches,Hv as deviceStateCapability,gN as deviceStatusCapability,lU as displayIconEntry,uU as displayIconsInGroup,yN as doorbellCapability,aH as doorbellFeatureSources,rK as droppedConditionsForKind,so as egressTranscodeSharingKey,no as egressTransportFromRequest,oy as embeddingEncoderCapability,$v as embeddingModelFailedError,ay as embeddingModelFailedOf,ry as embeddingRefusalOf,ty as embeddingRequirementsFailedError,ey as embeddingRequirementsUnavailableError,Lt as emitDownForOwnedCaps,Be as emitReadiness,Qp as emitsCollectionSelector,Ma as encodeProfileFromStreamShape,eX as encodeVectorBase64,SN as enumSensorCapability,yX as enumerateInferenceDevices,mm as enumerateItemArrayFields,pm as enumerateSchemaFields,Ln as errMsg,Si as evaluateAst,qV as evaluateCompositionField,Lr as evaluateCount,ki as evaluateExpressionSource,FY as evaluatePoolMemory,Ir as evaluateRose,Or as evaluateSensorEdge,Dr as evaluateSensorLevelEdge,Ti as evaluateStatefulExpressionCall,rX as evaluateZoneRules,Qt as event,TN as eventEmitterCapability,vl as evictionPolicyForMode,wl as evictionPolicyOfLocation,Ce as expandAudioChunkToF32le,Yt as expandCapMethods,LH as expandContainer,OR as exportSubjectOf,sh as expressionContainsBuiltinCall,jV as extensionSlotRef,im as extractNestedAddonId,n_ as extractSourceInfoFromMetadata,IN as faceGalleryCapability,ly as failureContributionCapability,iu as failureRate,zN as fanControlCapability,ua as featureFieldEntries,VN as featureProbeCapability,da as featureSources,rH as feederCustomizationExample,nH as feederExampleSources,Qa as ffmpegRate,ca as fieldReads,fy as filesystemBrowseCapability,jh as findCandidateCycles,Oh as findCompositionCycles,Vl as findTimezone,UN as floodCapability,lu as foldSnapshotByFunction,ZY as formatForRuntime,va as formatMediaOwnerKey,ez as formatMinutes,wu as formatParkedFor,GN as gasCapability,jl as gbToBytes,Md as generateAutomationBlock,Ox as getAudioMacroClassIds,gU as getByPath,aW as getCapsByProviderKind,Jl as getLogChannelRegistry,Fx as getTaxonomyEntry,$a as gifDeriveSpeed,eo as gifFilterComplex,to as gifFromMp4Args,qH as hasMotionTrigger,CY as hfModelUrl,sG as htmlToText,qN as humidifierCapability,YN as humiditySensorCapability,Fe as hydrateSchema,ZN as imageCapability,oP as imageSettingsCapability,ch as inferExpressionKinds,Zu as inferModelProvider,AY as initialPoolMemoryState,hP as integrationsCapability,yP as intercomCapability,Uw as interpretStoredClusterModel,Ww as invalidClusterStepModelEntries,cr as invocationFromEncodeProfile,vo as isAgentOnlyPlacement,tm as isArrayOutputSchema,xe as isAudioChunkFormat,eG as isAudioClassName,UW as isAudioLabelSelected,sK as isAudioRule,iG as isBaseConditionKey,AH as isBatteryPresenceFault,Vw as isClusterScopedStep,nm as isCollectionArrayMethod,_o as isDeployableToAgent,xx as isDetectionMacroClass,$t as isDeviceConfigCap,Cn as isDeviceScopedCap,cU as isDisplayIconKey,iy as isEmbeddingModelFailed,Re as isEvent,wa as isEventOwnerType,Js as isFirstLevelMacroClass,uq as isHeldBackTemplateVar,So as isIsolatedBuiltin,_q as isKnownTemplateVar,kl as isLocationEnabled,ga as isMediaOwnerType,ZH as isNode,em as isObjectInput,cK as isOccupancyRule,ve as isOwnerOnlyEventCategory,lW as isRestoredCap,_Y as isSameAddonId,SK as isScheduleActive,Ko as isSecretConfigField,Hn as isSoftwareDecode,Cr as isSourceCap,zq as isStateLabelKey,kr as isStatefulBuiltin,xl as isStorageLocationMode,YG as isSystemDelivery,CG as isSystemEventFamily,xq as isSystemEventSummaryRule,FG as isSystemRuleKind,LA as isVectorIndexDimConflict,$p as isVoidInput,gW as ituDbfsFromPreEpoch,Dj as jobKindSchema,um as kebabToCamel,Qm as kindOfValue,qG as kindsForDiscriminator,tG as knownValues,CP as lawnMowerControlCapability,RH as legacyAutoLinkIds,yl as legacyModeOf,Pj as lifecycleJobSchema,Nj as lifecycleJobScopeSchema,Mj as lifecycleJobStateSchema,jj as lifecycleTaskSchema,Xy as llmCapability,Ly as llmRuntimeCapability,eb as loadContributionCapability,IP as localNetworkCapability,N_ as locationIconKey,pY as locationSimilarity,zP as lockControlCapability,Vn as logBannerArgs,nb as logChannelsCapability,ab as logDestinationCapability,Ls as logLevelAtMost,db as loginMethodCapability,rm as looseSchema,ft as makeProfileBrokerId,pt as makeSourceBrokerId,Dx as mapAudioLabelToMacro,dG as markdownToHtmlLite,aG as markdownToText,EY as maskUrlCredentials,Cl as mayReadLocation,Sl as mayWriteToLocation,WP as mediaPlayerCapability,co as memoizePinnedFfmpeg,$g as mergeSourceInfo,JP as meshNetworkCapability,w as method,ad as methodAccessForHttpMethod,jb as metricsProviderCapability,Sc as migrateLegacyDeviceSignalConfig,oz as minutesToTimeOfDay,_l as modeMayRead,gl as modeMayWrite,Nb as modelConvertCapability,Ib as modelDistributorCapability,hX as modelFormatForRuntime,QP as motionCapability,zb as motionDetectionCapability,tO as motionSourceLabel,tF as motionTriggerCapability,oF as motionZonesCapability,Zb as mqttBrokerCapability,mF as nativeObjectDetectionCapability,OF as navigationCapability,tx as networkAccessCapability,PF as networkLinkCapability,RF as networkQualityCapability,Aq as nodePickerItems,zt as nodePin,nI as nodesCapability,Xe as normalizeAddonInitResult,yW as normalizeAudioLabel,He as normalizeNodeId,aY as normalizeTokenScopes,e_ as normalizeUnit,_x as notificationOutputCapability,aw as notificationRulesCapability,lI as notifierCapability,dI as numericSensorCapability,_w as oauthIntegrationCapability,am as objectInputDeclaresAddonId,om as objectInputDeclaresRequiredDeviceId,UE as occupancyScope,ym as optionalAncestors,Zt as optionalMethod,_I as osdCapability,TI as osdManagerCapability,oT as overlayClusterStepSettings,Fq as packagePickerItems,Xg as parseAdminBase,Ns as parseCameraStreamConfig,ci as parseExpression,Mn as parseJsonArray,jn as parseJsonObject,Tn as parseJsonUnknown,_a as parseMediaOwnerKey,WE as parseOccupancyScope,kY as parseProcStatus,mt as parseProfileBrokerId,oK as parseRuleSection,nB as parseStreamParamsFormPatch,VW as patchAudio,jI as petFeederCapability,YH as pickAccessoryControl,qw as pickClusterStepModels,aT as pickClusterStepSettings,yJ as pickDetailCropConvention,Jw as pickInvalidClusterStepModels,KJ as pickNativeLeaseOverride,hu as pickPreferredRtspEntry,RY as pickRestartCandidate,or as pickVideoEncoder,ZW as pickerForCondition,$W as pickerForRuleClasses,KE as pipelineAnalyticsCapability,ED as pipelineExecutorCapability,rk as pipelineOrchestratorCapability,hO as pipelineRunnerCapability,Uh as planComposition,Tm as planCompositionEvents,xh as planItems,LI as plateGalleryCapability,$I as platformProbeCapability,NY as poolMemoryThreshold,tL as powerMeterCapability,vG as prepareNotification,iL as presenceCapability,oL as pressureSensorCapability,ld as principalMayReachAddon,fL as privacyMaskCapability,lm as procedureAuthKey,lJ as providerMotionEvent,DL as ptzAutotrackCapability,SL as ptzCapability,ye as publicEventCategories,QY as pythonScriptForBackend,La as rankStreams,Gw as readClusterStepModels,rT as readClusterStepSettings,_J as readDetailCropConvention,cH as readDeviceStateFrom,sJ as readHubMotionDetected,bw as readMotionTriggeredBy,UJ as readNativeLeaseOverride,Vt as readNodePin,aJ as readTimelapseGeneratedAt,jt as readinessKey,OL as rebootCapability,sR as recordingArchiveCapability,BL as recordingCapability,kR as recordingExportCapability,HR as recordingOnboardCapability,dz as recordingSignalCapability,VY as rectsToCells,mu as reducePoints,Kh as replacedFieldKeys,vm as requiredTopLevelKeys,$Y as requiresPython,pz as reservedSourceOwner,LY as resetPoolBaseline,go as resolveAddonExecution,yo as resolveAddonGroup,xo as resolveAddonPlacement,pu as resolveBucketMs,Ut as resolveCapMount,Uu as resolveClipSearchMinScore,Zw as resolveClusterStepModelId,IH as resolveContainerPrimaryChild,DR as resolveCreateExportSubject,GH as resolveDeviceControlKind,nU as resolveDeviceProfile,Za as resolveEgressDecodeHwAccel,TR as resolveExportProfiles,pG as resolveFormat,Pe as resolveHydratedFieldValue,P_ as resolveLocationIcon,bl as resolveLocationMode,cm as resolveMethodAuth,NK as resolveModeDelays,QH as resolveMutate,OY as resolvePoolMemoryPolicy,gc as resolveRecordingProfiles,bo as resolveRunnerId,Wn as resolveStreamMaps,Iu as resolveVariantModelId,iY as resolveViewableDeviceIds,JJ as roleSpec,$V as roomCompositionExample,DK as ruleBelongsToAlarm,XG as ruleDeviceCompatCapNames,QG as ruleDeviceCompatCapQueries,_K as ruleEditorSectionsForKind,$G as ruleKindOf,KG as ruleKindSpec,lK as ruleMatchesSection,aK as ruleSection,uK as ruleSectionOf,pK as ruleSeedForSection,WY as runInferenceStep,pX as runtimeDevices,sW as runtimeStatePolicyFor,Fz as sceneMonitorCapability,Eq as scheduleForSendTimes,Jo as schemaDeclaresAnyField,nY as scopeInherits,Mt as scopeKey,sd as scopesAllowAddon,od as scopesAllowDeviceCap,gX as scoreRuntimes,Bz as scriptRunnerCapability,mU as searchDisplayIcons,ht as selectAssignedProfileSlots,Dq as sendTimesOfSchedule,KK as sensorRaisedOf,kK as sensorTransitionNeverFires,qK as sensorTransitionOffered,lq as servedTemplateVars,Ck as serverManagementCapability,_U as setByPath,Ng as settingsStoreCapability,MF as signalPercentFromBars,NF as signalPercentFromRssi,R_ as siteZoneKey,Nn as sleep,Pn as sleepCancellable,wr as sliceActiveValue,Tr as sliceChangedAt,Hz as smokeCapability,Ok as smtpProviderCapability,jk as snapshotCapability,Nk as ssoBridgeCapability,SU as startReachabilityPoll,Bq as stateLabel,lH as stateVocabularyFor,dJ as stepModelRunsOnFormat,Fk as storageCapability,Rk as storageEvictableCapability,zk as storageMigrationCapability,Vk as storageOccupancyCapability,$k as storageProviderCapability,Kp as streamBrokerCapability,Gz as streamCatalogCapability,Qz as streamParamsCapability,Ds as streamPixels,Es as streamQualityLabel,nA as streamSignalsCapability,uc as stripRetiredBandPreBufferSec,Tl as strippedOfLegacyReadOnly,Lx as subKindsOf,pL as summarisePrivacyAudio,uY as summarizeEffectiveScope,fX as supportedRuntimes,iB as switchCapability,Uo as switchedOffIds,Qg as synthesizeSourceInfo,FB as systemCapability,Cq as systemEventDeliveryProblems,jG as systemEventFamilyOf,MG as systemEventFamilyProblems,bG as systemEventFilterApplies,xG as systemEventFilterAppliesToAnyKind,AG as systemEventKindNamesOf,kG as systemEventKindsOfFamily,yq as systemEventSummaryScheduleOf,bq as systemEventSummarySplitOf,IG as systemFamilyOfKind,eK as systemRuleKindOf,LB as tamperCapability,Aj as taskLogEntrySchema,Oj as taskPhaseSchema,kj as taskTargetSchema,zB as temperatureSensorCapability,kq as templateCarriesSummary,dq as templateVarDeliveryApplies,mq as templateVarKindApplies,hq as templateVarSystemEventApplies,gq as templateVarsFor,dA as terminalSessionCapability,uG as textToHtml,az as timeOfDayToMinutes,EH as toDeviceSummary,Di as toExpressionValue,Bt as toNodeId,As as toStreamSourceEntry,VB as toastCapability,WW as toggleAudioLabel,ti as tokenize,mG as transcodeBody,BV as tryConvertUnit,pA as turnProviderCapability,IV as unitDimension,HV as unitsForDimension,jv as unreachableExtensionSlotRow,dm as unwrapSchema,UB as updateCapability,nV as userManagementCapability,hA as userPasskeysCapability,oV as vacuumControlCapability,$h as validateComposition,Oi as validateExpressionSource,Dd as validateRecipeBounds,lV as valveCapability,nX as vectorDimFromBase64,IA as vectorIndexDimConflictError,BA as vectorStoreCapability,dV as vibrationCapability,pj as videoclipsCapability,dn as viewerUiCapability,pV as waterHeaterCapability,hV as weatherCapability,hj as webrtcClientHintsSchema,wj as webrtcSessionCapability,tz as weeklyMaskIndex,nz as weeklyMaskIsUniform,rz as weeklyMaskToWindows,iz as windowsToWeeklyMask,fo as wiringAddonHealthSchema,mo as wiringHealthSnapshotSchema,po as wiringNodeHealthSchema,lo as wiringProbeKindSchema,uo as wiringProbeResultSchema,El as withLocationMode,RU as zodEntriesToConfigUI,wV as zoneAnalyticsCapability,EV as zoneRulesCapability,ND as zonesCapability};