@camstack/addon-admin-ui 1.2.277 → 1.2.279
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AddonCollectionPage-65yIgq50.js → AddonCollectionPage-CE5125v_.js} +1 -1
- package/dist/assets/{Addons-CjKLXBV3.js → Addons-Cc4qa2u_.js} +1 -1
- package/dist/assets/{AdminTabs-Bsxd4tRa.js → AdminTabs-CyUeJtLY.js} +1 -1
- package/dist/assets/{AiProfiles-l7LHrzwT.js → AiProfiles-CLfzJ01f.js} +1 -1
- package/dist/assets/{BrokerForm-3rcdA3-f.js → BrokerForm-DOX3vG8U.js} +1 -1
- package/dist/assets/{Build-DRVkaxIT.js → Build-CqQf6Qs3.js} +1 -1
- package/dist/assets/{Capabilities-CESfvDkp.js → Capabilities-DZrUiP8_.js} +1 -1
- package/dist/assets/{CapabilityBadges-MCiRJB78.js → CapabilityBadges-BoirnZr0.js} +1 -1
- package/dist/assets/{Cluster-Dl8XeKqT.js → Cluster-DLrIAw2O.js} +1 -1
- package/dist/assets/{Data-pqJND2n4.js → Data-lj_nDlK9.js} +1 -1
- package/dist/assets/{DetectionIntelligence-CxLbtcRH.js → DetectionIntelligence-Dc0pLYIt.js} +1 -1
- package/dist/assets/{DeviceAggregateSection-BuSC-cdc.js → DeviceAggregateSection-D2Ib8v6Y.js} +1 -1
- package/dist/assets/{DeviceDetail-DeJgcjCA.js → DeviceDetail-zKpyALAI.js} +1 -1
- package/dist/assets/{Devices-B6Wzjk85.js → Devices-D446LvfW.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-rypUtfsp.js → EmbedPlayerPage-B8L0WcA5.js} +1 -1
- package/dist/assets/{Events-DMZqhcSB.js → Events-Daxo1rW8.js} +1 -1
- package/dist/assets/{FormBuilder-BkkpgbP0.js → FormBuilder-DV-wmTc9.js} +1 -1
- package/dist/assets/{Identity-CAF1wZr0.js → Identity-a74BpHv1.js} +1 -1
- package/dist/assets/{IntegrationDetail-C9zY-gd5.js → IntegrationDetail-DxhN87-R.js} +1 -1
- package/dist/assets/{Integrations-D-oa4wlE.js → Integrations-BFEgOkiM.js} +1 -1
- package/dist/assets/{Integrations-C-0BUSAM.js → Integrations-BZ1RFJcY.js} +1 -1
- package/dist/assets/{Locations-BENkzgun.js → Locations-DxrXewR-.js} +1 -1
- package/dist/assets/{Logs-HI08UKTA.js → Logs-BRxAAPl_.js} +1 -1
- package/dist/assets/{ModelLicenses-zZgTMqXO.js → ModelLicenses-BMeIg976.js} +1 -1
- package/dist/assets/{MotionZonesSettings-CTDWIbp0.js → MotionZonesSettings-BT2Ee0TE.js} +1 -1
- package/dist/assets/{MyAccess-CauYj362.js → MyAccess-f7KT9kGs.js} +1 -1
- package/dist/assets/{Network-CFX3d_W_.js → Network-DNCGVpxE.js} +1 -1
- package/dist/assets/{NodeAddonsSettingsPanel-lBWaWtyZ.js → NodeAddonsSettingsPanel-geV1GXiP.js} +1 -1
- package/dist/assets/{NodeInferenceDevices-CqSDOYod.js → NodeInferenceDevices-S8-HqU1J.js} +1 -1
- package/dist/assets/{Notifications-BVaBx5zp.js → Notifications-3CJV73pB.js} +1 -1
- package/dist/assets/{Pipeline-DLB19p4D.js → Pipeline--6ABNY-h.js} +1 -1
- package/dist/assets/{Plates-C-yOBq5k.js → Plates-DoLQwXGe.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-0zZkGNOM.js → PrivacyMaskSettings-DfnZlp-y.js} +1 -1
- package/dist/assets/{ProviderIcon-CPPKo-Ts.js → ProviderIcon-tmkHDNFz.js} +1 -1
- package/dist/assets/{Recordings-DbiWFy0T.js → Recordings-BeqRV4iY.js} +1 -1
- package/dist/assets/{ScanNetworkModal-BJrHm0qj.js → ScanNetworkModal-nY08hYOb.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-drNxXbce.js → SceneMonitorEditor-DINVM61L.js} +1 -1
- package/dist/assets/{Scenes-0xZl7nj0.js → Scenes-Bf0DudXZ.js} +1 -1
- package/dist/assets/{Settings-C-s7TZ7R.js → Settings-n02fVxxo.js} +1 -1
- package/dist/assets/{Showroom-BzLt_-OR.js → Showroom-Bq-E_ReD.js} +1 -1
- package/dist/assets/{StorageLocationsPanel-OeuRyPsr.js → StorageLocationsPanel-CwiwTQf7.js} +1 -1
- package/dist/assets/{Terminal-SFoH9jRn.js → Terminal-C_1nUhhh.js} +1 -1
- package/dist/assets/{Viewer-DyEoPMvX.js → Viewer-BptbGnUC.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DJ3Gqc8B.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-B9J_AjtC.js} +1 -1
- package/dist/assets/{archive-Dn3V52rE.js → archive-BX6oRdUb.js} +1 -1
- package/dist/assets/{authed-media-BZ_HLhjH.js → authed-media-rHi-yleq.js} +1 -1
- package/dist/assets/{boxes-C-ssGRxU.js → boxes-ZTtdYORX.js} +1 -1
- package/dist/assets/circle-slash-Cv7ZekkW.js +1 -0
- package/dist/assets/{debounced-invalidate-LQZZcUzN.js → debounced-invalidate-BlJ0Y6eY.js} +1 -1
- package/dist/assets/{dist-DcgQ6Ev-.js → dist-DgQGWpwv.js} +2 -2
- package/dist/assets/{dist-DdKUzVhB.js → dist-q3cwqCda.js} +1 -1
- package/dist/assets/{face-bbox-B5Kgf0Oj.js → face-bbox-sWGFBbL9.js} +1 -1
- package/dist/assets/{hard-drive-download-CsozppT1.js → hard-drive-download-tkymostV.js} +1 -1
- package/dist/assets/{hostInit-B4fqBDQa.js → hostInit-C4HqlvQH.js} +1 -1
- package/dist/assets/{index-DJ7rWfAu.js → index-DByN3sgJ.js} +3 -3
- package/dist/assets/{layers-YEExzxCf.js → layers-CUtjCIzl.js} +1 -1
- package/dist/assets/{location-owned-usage-DASRr9Gn.js → location-owned-usage-BeZOye5N.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-d8a20dad.js → mf-entry-bootstrap-0-cce3ce8f.js} +2 -2
- package/dist/assets/{player-overlays-DAihiFvO.js → player-overlays-B-nupL9q.js} +1 -1
- package/dist/assets/remoteEntry-I_CYNhw8.js +1 -0
- package/dist/assets/{send-s1IW1yHx.js → send-DrjP1k5U.js} +1 -1
- package/dist/assets/{settings-2-sJ1lVWl6.js → settings-2-BX-2JFal.js} +1 -1
- package/dist/assets/{square-check-big-CP5rWVEN.js → square-check-big-BsokJFdH.js} +1 -1
- package/dist/assets/src-BP6gnsKM.js +349 -0
- package/dist/assets/{src-B4JHPaAN.js → src-C7TV-5CQ.js} +3 -3
- package/dist/assets/{use-scenes-feed-BlcOIyWI.js → use-scenes-feed-DdVt030q.js} +1 -1
- package/dist/assets/{use-stationary-objects-C7CknC2f.js → use-stationary-objects-BblSeUpV.js} +1 -1
- package/dist/assets/useEventInvalidation-Ct_Pt6VZ.js +1 -0
- package/dist/assets/{useNodeUrlSelection-Bmq-ZpDy.js → useNodeUrlSelection-D0Hm_Ku1.js} +1 -1
- package/dist/assets/user-round-CbxyAAro.js +1 -0
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-9zlM_isR.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-7KSQwraq.js} +2 -2
- package/dist/index.html +5 -5
- package/dist/server/addon.js +48 -6
- package/package.json +1 -1
- package/dist/assets/circle-slash-D2ZkUEEp.js +0 -1
- package/dist/assets/remoteEntry-DY7q5PVh.js +0 -1
- package/dist/assets/src-DOeAf_sL.js +0 -349
- package/dist/assets/useEventInvalidation-vH-47C-i.js +0 -1
- package/dist/assets/user-round-CQEU9c3C.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,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{t as n}from"./vite-preload-helper-kNaey6uv.js";import{A as r,C as i,D as a,E as o,F as s,I as c,M as l,N as u,O as d,P as f,S as p,T as m,_ as ee,a as te,b as h,c as ne,d as re,f as ie,g,h as ae,i as oe,j as _,k as se,l as ce,m as v,n as le,o as ue,p as y,r as de,s as fe,t as pe,u as me,v as b,w as he,x as ge,y as x}from"./__vite-browser-external-Cc3gW-QT.js";var _e=[`f32le`,`pcmu`,`pcma`];function ve(e){return typeof e==`string`&&_e.includes(e)}function ye(e){return e===`f32le`?4:1}function be(e,t){if(t===`f32le`){let t=new Uint8Array(e.byteLength);return t.set(e),t}let n=t===`pcmu`?Ce:we,r=new Float32Array(e.length);for(let t=0;t<e.length;t++)r[t]=n[e[t]];return new Uint8Array(r.buffer)}function xe(){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 Se(){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 Ce=xe(),we=Se(),Te=[`track`,`summary`,`face`,`identity`,`plate`,`vehicle`,`scene`,`motion`,`object`,`audio`,`mosaic`],Ee=new Set(Te),De=/^\d+$/;function Oe(e){return Ee.has(e)}function ke(e){let t=e.split(`:`);if(t.length!==3&&t.length!==4)return null;let[n,r,i,a]=t;return n===void 0||!Oe(n)||r===void 0||r.length===0||i===void 0||i.length===0?null:a===void 0?{ownerType:n,ownerId:r,fileKind:i}:De.test(a)?{ownerType:n,ownerId:r,fileKind:i,timestampMs:Number(a)}:null}function Ae(e){let t=`${e.ownerType}:${e.ownerId}:${e.fileKind}`;return e.timestampMs===void 0?t:`${t}:${e.timestampMs}`}var je=[`motion`,`object`,`audio`],Me=y(je),Ne=[...je,`track`],Pe=y(Ne),Fe=new Set(je);function Ie(e){return Fe.has(e)}var Le=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.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}({}),Re=[{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}],ze=Object.fromEntries(Re.map(e=>[e.id,e]));function Be(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 Ve(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&&He(e.fields,t);return t}function He(e,t){if(Array.isArray(e))for(let n of e){if(typeof n!=`object`||!n)continue;let e=n.type;if(e===`group`){He(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&&He(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 Ue(e){let t=new Map;for(let[n,r]of Ve(e))t.set(n,r.value??r.default);return t}function We(e,t){let n=Ve(e).get(t);return n===void 0?void 0:n.value??n.default}function Ge(e,t){return{...e.tabs?{tabs:[...e.tabs]}:{},sections:e.sections.map(e=>({...e,fields:e.fields.map(e=>Ke(e,t))}))}}function Ke(e,t){if(Be(e))return e;if(e.type===`group`){let n=e.fields.map(e=>Ke(e,t));return{...e,fields:n}}if(e.type===`sub-tabs`){let n=e.tabs.map(e=>({...e,fields:e.fields.map(e=>Ke(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?qe(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 qe(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 Je(e,t){return e.category===t}function Ye(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 Xe(e,t){let n=t.ts??Date.now();e.emit(Ye(`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 Ze(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 Qe(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 $e(e,t){return`${e}@${Qe(t)}`}function et(e,t,n){return e[$e(t,n)]}function tt(e,t,n){let r={};for(let[i,a]of Object.entries(e))r[t.has(i)?$e(i,n):i]=a;return r}function nt(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=et(e,i,n);t!==void 0&&(r[i]=t)}return r}var rt=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(Le.AddonStarted);let n=ot(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(Le.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 Ge(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=it(t.fields);n.length!==0&&i.push({...t,fields:n})}if(i.length===0)return null;let a=await this.resolveGlobalStore(e);return Ge({...n,sections:i},a)}async resolveGlobalStore(e,t){let n=await this._ctx?.settings?.readAddonStore()??{},r=this.perNodeKeys(t),i=Qe(e??this._ctx?.kernel?.localNodeId);return r.size>0?nt(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=Qe(this._ctx?.kernel?.localNodeId),i=Qe(t??this._ctx?.kernel?.localNodeId),a=e,o=n.size>0?tt(a,n,i):a;await this._ctx?.settings?.writeAddonStore(o),i===r&&(await this.resolveConfig(),await this.onConfigChanged(),this.emitLifecycle(Le.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=>at(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?Ge(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{Xe(t.eventBus,{capName:n,scope:{type:`node`,nodeId:r},state:e,generation:this._readinessGeneration,sourceNodeId:r})}catch{}}async resolveModelsDir(){let{join:t}=await n(async()=>{let{join:t}=await import(`./__vite-browser-external-Cc3gW-QT.js`).then(t=>e(t.t()));return{join:t}},__vite__mapDeps([0,1]),import.meta.url),{promises:r}=await n(async()=>{let{promises:t}=await import(`./__vite-browser-external-Cc3gW-QT.js`).then(t=>e(t.t()));return{promises:t}},__vite__mapDeps([0,1]),import.meta.url),i=t(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=Qe(this._ctx?.kernel?.localNodeId),r={...this.defaults};for(let i of Object.keys(this.defaults)){let a=t.has(i)?et(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 Ze({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 Ze({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 it(e){let t=[];for(let n of e){if(n.type===`group`){let e=it(n.fields);e.length>0&&t.push({...n,fields:e});continue}if(n.type===`sub-tabs`){let e=n.tabs.map(e=>({...e,fields:it(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 at(e){let t=[];for(let n of e){if(n.type===`group`){t.push(...at(n.fields));continue}if(n.type===`sub-tabs`){for(let e of n.tabs)t.push(...at(e.fields));continue}`perNode`in n&&n.perNode===!0&&t.push(n.key)}return t}function ot(e){if(e!=null)return Array.isArray(e)?{providers:e}:e}function st(e,t){return{id:e,getRoutes:()=>t,invoke:async e=>{let n=ct(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=ut(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 ct(e,t,n){let r=t.toUpperCase();for(let t of e){if(t.method!==r)continue;let e=lt(t.path,n);if(e!==null)return{route:t,params:e}}return null}function lt(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 ut(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 dt=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)}}}},ft=d({codec:y([`h264`,`h265`,`copy`]),profile:y([`baseline`,`main`,`high`]).optional(),level:l().optional(),width:a().int().positive().optional(),height:a().int().positive().optional(),fps:a().positive().optional(),bitrateKbps:a().int().positive().optional(),gopFrames:a().int().positive().optional(),bf:a().int().min(0).optional(),preset:y([`ultrafast`,`superfast`,`veryfast`,`faster`,`fast`,`medium`]).optional(),tune:y([`zerolatency`,`film`,`animation`]).optional(),singleSlicePerFrame:x().optional()}),pt=f([m(`passthrough`),d({codec:y([`opus`,`aac`,`pcmu`,`pcma`,`copy`]),bitrateKbps:a().int().positive().optional(),sampleRateHz:a().int().positive().optional(),channels:f([m(1),m(2)]).optional()})]),mt=d({video:ft,audio:pt,inputArgs:b(l()).optional(),outputArgs:b(l()).optional()});function ht(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 gt(e,t,n){let r=e>=n;return r===t>=n?r?e-t:t-e:r?-1:1}function _t(e){let t=e.toLowerCase().replace(/[.\s-]/g,``);return t===`hevc`||t===`hvc1`||t===`hev1`?`h265`:t===`avc`||t===`avc1`?`h264`:t}function vt(e,t){if(t.length===0)return!0;if(e===void 0)return!1;let n=_t(e);return t.some(e=>_t(e)===n)}function yt(e,t){for(let n=0;n<t.length;n+=1)if(e.startsWith(t[n]))return n;return t.length}function bt(e,t){let n=e.filter(e=>t.allowTranscode||vt(e.codec,t.acceptCodecs));if(n.length===0)return null;let r=t.targetHeight,i=n.map(e=>({candidate:e,transcodes:!vt(e.codec,t.acceptCodecs),provider:yt(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:gt(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 xt={opus:`libopus`,aac:`aac`,pcmu:`pcm_mulaw`,pcma:`pcm_alaw`},St={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 Ct(e){return[`-hide_banner`,`-loglevel`,e]}function wt(e){return!e||e===`none`||e===`copy`}function Tt(e,t){let n=[];if(wt(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 Et(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 Dt(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 Ot(e,t){return e===void 0||!wt(t)?``:`format=nv12,hwupload`}function kt(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 At(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?``:Ot(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=[...Dt(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(...kt(e)),e.bitstreamFilter!==void 0&&a.push(`-bsf:v`,e.bitstreamFilter),a}function jt(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`,xt[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 Mt(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 Nt(e){return e.kind===`stdout`&&(e.container===`h264`||e.container===`hevc`)}var Pt=`+frag_keyframe+empty_moov+default_base_moof`;function Ft(e){return e.kind===`rtsp-listen`?[`-f`,`rtsp`,`-rtsp_transport`,`tcp`,`-rtsp_flags`,`listen`,e.url]:e.kind===`rtp-outputs`?[]:e.container===`mp4`?Lt(e):[`-f`,e.container,`pipe:1`]}var It=.9;function Lt(e){return[`-movflags`,Pt,`-min_frag_duration`,String(Math.max(0,Math.round(e.fragmentMs*It*1e3))),`-f`,`mp4`,`pipe:1`]}function Rt(e){return[`-map`,`0:a:0?`,...jt(e.codec===`pcma`?{kind:`encode`,codec:`pcma`,sampleRateHz:8e3,channels:1}:St[e.codec]),...Mt({url:e.rtpUrl,sdpFile:e.sdpFile})]}function zt(e){return e.hwEncodeDevice===void 0?void 0:{device:e.hwEncodeDevice,decodeHwAccel:e.decodeHwAccel}}function Bt(e){let t=e.filterGraph??null,n=[...Ct(e.logLevel),...e.hwEncodeDevice===void 0?[]:[`-vaapi_device`,e.hwEncodeDevice.renderNode],...Tt(e.input,e.decodeHwAccel),...(e.extraInputs??[]).flatMap(t=>Tt(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=Et(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`,...At(e.video,e.outputArgs,t,zt(e)),...r,...e.outputArgs,...Mt(e.sink.video)]:[],o=e.sink.audio?[`-vn`,`-map`,i.audio??`0:a:0?`,...jt(e.audio),...Mt(e.sink.audio)]:[];return[...n,...a,...o]}let s=Nt(e.sink)||e.audio.kind===`none`,c=Nt(e.sink)?[`-an`]:jt(e.audio);return[...n,...a,...At(e.video,e.outputArgs,t,zt(e)),...r,...s?[]:o,...c,...e.outputArgs,...Ft(e.sink),...e.audioSidecar?Rt(e.audioSidecar):[]]}var Vt={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 Ht(e,t,n){let r=e===`h264`?`libx264`:`libx265`;if(!n||t===null||wt(t)||t===`auto`)return r;let i=Vt[t.toLowerCase()];return i?e===`h264`?i.h264:i.h265:r}function Ut(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 Wt(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:Ht(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:Ut(e.profile.audio),threadCount:e.threadCount??0,outputArgs:e.profile.outputArgs??[],sink:e.sink,...e.audioSidecar===void 0?{}:{audioSidecar:e.audioSidecar}}}var Gt={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`},Kt={...Gt,video:{...Gt.video,bitrateKbps:3e3,gopFrames:30,preset:`ultrafast`},audio:`passthrough`},qt={...Gt,audio:{codec:`opus`},video:{...Gt.video,singleSlicePerFrame:!0}},Jt={kind:`cbr`,vbvSeconds:1},Yt={kind:`cap`,vbvSeconds:2},Xt={kind:`encode`,codec:`opus`,bitrateKbps:24,channels:1,application:`lowdelay`,globalHeader:!0,filter:`aresample=async=1000:first_pts=0`},Zt=16*1024*1024,Qt=8,$t=16,en=class{maxUnitBytes;buffer=new Uint8Array;unitStart=0;cursor=0;state=`init`;nextSequence=0;faultReason=null;interstitial=new Set;constructor(e={}){this.maxUnitBytes=e.maxUnitBytes??Zt}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<Qt)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<$t)return null;let n=t.getBigUint64(this.cursor+Qt);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<Qt?(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 tn(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 nn(e){return!e||e===`none`||e===`copy`}async function rn(e){let t=e.override;if(t!=null&&t!==``)return nn(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=nn(r)?null:r;return e.cache?.write(i),i}var an=pe();function on(e){let t=JSON.stringify(e,sn);return(0,an.createHash)(`sha256`).update(t??``).digest(`hex`)}function sn(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}function cn(e){return{transport:e.publishLocally===!0?`push`:`dial`}}var ln=`\0unset`;function un(e){return{codec:e.codec,profile:e.profile??ln,level:e.level??ln,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??ln,tune:e.tune??ln,singleSlicePerFrame:e.singleSlicePerFrame===void 0?ln:String(e.singleSlicePerFrame)}}function dn(e){return e===`passthrough`?{codec:`passthrough`}:{codec:e.codec,bitrateKbps:e.bitrateKbps??-1,sampleRateHz:e.sampleRateHz??-1,channels:e.channels??-1}}function fn(e,t=cn(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:un(e.encode.video),audio:dn(e.encode.audio),rateControl:e.rateControl??`relaxed`,bitstreamFilter:e.bitstreamFilter??ln,pixelFormat:e.pixelFormat??ln,decodeHwAccel:e.decodeHwAccel??ln}}function pn(e,t=cn(e)){return`egress:${on(fn(e,t))}`}var mn=y([`singleton`,`device`,`widget`]),hn=d({capName:l(),kind:mn,deviceId:a().optional(),reachable:x(),latencyMs:a(),error:l().optional()}),gn=d({addonId:l(),caps:b(hn).readonly(),widgets:b(hn).readonly()}),_n=d({nodeId:l(),addons:b(gn).readonly()}),vn=d({ok:x(),degraded:x(),checkedAt:l(),nodes:b(_n).readonly(),summary:d({total:a(),reachable:a(),unreachable:a()})}),yn=`hub-only`;function bn(e){return{placement:e.execution?.placement??`hub-only`,group:e.execution?.group}}function xn(e){let t=bn(e).placement;return t===`any-node`||t===`agent-only`}function Sn(e){return bn(e).placement===`agent-only`}function Cn(e){return bn(e).group}function wn(e,t){return e.execution?.group??t}function Tn(e){return bn(e).placement}function En(e){return e.execution?.isolate===!0}var Dn=`x-camstack-dataplane-secret`,On=[`grid-view`,`events-view`],kn=3e4,An=15e3,jn=256*1024,Mn=d({url:l().min(1),hostNodeId:l().min(1),expiresAtMs:a().int().nonnegative(),declaredBytes:a().int().nonnegative().nullable()}),Nn=y([`running`,`done`,`failed`,`cancelled`]),Pn=y([`adopted`,`already-adopted`,`failed`,`cancelled`]),Fn=d({childNativeId:l(),outcome:Pn,parentDeviceId:a().int().nonnegative().nullable(),accessoryCount:a().int().nonnegative(),error:l().nullable()}),In=d({jobId:l(),addonId:l(),integrationId:l(),state:Nn,total:a().int().nonnegative(),processed:a().int().nonnegative(),adopted:a().int().nonnegative(),alreadyAdopted:a().int().nonnegative(),failed:a().int().nonnegative(),accessoriesCreated:a().int().nonnegative(),currentChildNativeId:l().nullable(),results:b(Fn).readonly(),startedAt:a(),finishedAt:a().nullable(),error:l().nullable()}),Ln={cleanupIntervalMs:3600*1e3,detectionEventsDays:30,audioLevelsDays:7,snapshotsDays:14},Rn=y([`stream-broker`,`object-detection`,`privacy-mask`,`device-audio`,`broker-audio`,`audio-analysis`,`event-saving`,`recording`,`notifications`]),zn=[`stream-broker`,`object-detection`,`privacy-mask`,`device-audio`,`broker-audio`,`audio-analysis`,`event-saving`,`recording`,`notifications`],Bn=p(`kind`,[d({kind:m(`device-disabled`)}),d({kind:m(`wrapper-binding`),capName:l()}),d({kind:m(`recording-config`)}),d({kind:m(`notification-mute`)}),d({kind:m(`camera-audio`),capName:l()}),d({kind:m(`camera-mask`),capName:l()}),d({kind:m(`broker-audio-mute`)})]),Vn=y([`no-provider`,`source-unreachable`,`device-disabled`]),Hn=y([`no-privacy-zones`]),Un=d({id:Rn,label:l(),costWhenOff:l(),available:x(),unavailableReason:Vn.optional(),warning:Hn.optional(),enabled:x(),authority:Bn}),Wn=d({deviceId:a().int(),switches:b(Un).readonly(),fetchedAt:a()}),Gn=`detection-pipeline`,Kn=`audio-analysis`,qn=`privacy-mask`,Jn=`pipeline-analytics`,Yn=[`motion-detection`,Gn,Kn,Jn,`scene-monitor`],Xn={"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:Gn},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:qn},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:qn},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:Kn},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:Jn},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 Zn(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 Qn(e){return zn.map(t=>{let n=Xn[t],r=Zn(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 $n(e){return e.filter(e=>Xn[e.id].countsAsSwitchedOff&&e.available&&!e.enabled).map(e=>e.id)}function er(e){let t=[],n=[];for(let r of zn){let i=Xn[r];if(!i.countsAsSwitchedOff)continue;let a=Zn(i,e);a.unavailableReason===`source-unreachable`?n.push(r):a.available&&!a.enabled&&t.push(r)}return{switchedOff:t,unreadable:n}}var tr=`__camstack_redacted__`;function nr(e){return e.type===`password`?!0:`secret`in e&&e.secret===!0}function rr(e){let t=new Set;for(let n of or(e))for(let e of sr(n))cr(e,t);return t}function ir(e){for(let t of or(e))if(sr(t).length>0)return!0;return!1}function ar(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function or(e){if(!ar(e))return[];let t=e.sections;return Array.isArray(t)?t:[]}function sr(e){if(!ar(e))return[];let t=e.fields;return Array.isArray(t)?t:[]}function cr(e,t){if(!ar(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 sr(e))cr(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 sr(e))cr(n,t)}}var lr=3e4,ur=6e4,dr=y([`confirmed`,`suppressed`,`exhausted-fallback`]),fr=d({id:l(),at:a().int(),deviceId:a().int(),sourceTrackId:l(),className:l(),verdict:dr,reason:l().nullable(),attempts:a().int(),deferredForMs:a().int(),decidedOnCoastedFrame:x(),birthEvidenceAvailable:x(),decidedByBirthEvidence:x(),bestScore:a().nullable(),appliedMinConfidence:a().nullable(),firstSeen:a().int().nullable(),motionOnsetAt:a().int().nullable(),birthLatencyMs:a().int().nullable(),birthIndexInBurst:a().int().nullable()}),pr=d({deviceId:a().int().optional(),since:a().int().optional(),verdict:dr.optional(),limit:a().int().min(1).max(5e3).optional()}),mr=5e3,hr=d({id:l(),note:l(),deviceId:a().int(),sourceTrackId:l(),archivedAt:a().int(),trackStartedAt:a().int().nullable(),trackClass:l().nullable(),trackLabel:l().nullable()}),gr=d({deviceId:a().int().optional(),limit:a().int().min(1).max(1e3).optional()}),_r={high:`High`,mid:`Mid`,low:`Low`};function vr(e){return _r[e]??e.charAt(0).toUpperCase()+e.slice(1)}function yr(e){return(e.width??0)*(e.height??0)}function br(e){if(e.length===0)return[];let t=e.map((e,t)=>({s:e,i:t,px:yr(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 xr(e){let t=e.height??0,n=e.width??0;return t>=1080||n>=1920?`high`:t>=480||n>=640?`mid`:`low`}function Sr(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 S(e){return typeof e==`string`}function Cr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function wr(e){return S(e)&&e.trim()?{url:e}:Cr(e)&&S(e.url)&&e.url.trim()?{url:e.url,label:S(e.label)?e.label:void 0}:null}function Tr(e){let t=S(e.snapshot_url)?e.snapshot_url:void 0;if(Array.isArray(e.streams)){let n=[];for(let t of e.streams){let e=wr(t);e&&n.push(e)}return{streams:n,snapshot_url:t}}let n=[],r=S(e.main_stream_url)?e.main_stream_url:void 0;r&&n.push({url:r,label:S(e.main_stream_name)?e.main_stream_name:void 0});let i=S(e.sub_stream_url)?e.sub_stream_url:void 0;i&&n.push({url:i,label:S(e.sub_stream_name)?e.sub_stream_name:void 0});let a=S(e.third_stream_url)?e.third_stream_url:void 0;return a&&n.push({url:a,label:S(e.third_stream_name)?e.third_stream_name:void 0}),{streams:n,snapshot_url:t}}function Er(e){if(e.length===0)return{};let t=br(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 Dr={streaming:!0,notifications:!0,objectDetection:!1,remoteAccess:!0,agentCluster:!1,smartHome:!0,recordings:!0,backup:!0,repl:!0},Or={debug:0,info:1,warn:2,error:3};function kr(e,t){return Or[e]<=Or[t]}var Ar=y([`recording`,`events`]),jr=y([`prune`,`manual-delete`,`rescan`,`retention-run`,`relocate`,`orphan-audit`]),Mr=y([`retention`,`quota`,`manual`,`operator`,`maintenance`,`orphaned-device`]),Nr=d({id:l(),at:a(),domain:Ar,op:jr,reason:Mr,deviceId:a().nullable(),nodeId:l(),itemsAffected:a(),bytesReclaimed:a(),detail:l().nullable(),actor:l()}),Pr=d({deviceId:a().optional(),limit:a().int().min(1).max(1e3).optional()}),C=y([`high`,`mid`,`low`]),Fr=[`high`,`mid`,`low`],Ir=f([C,m(`auto`)]),Lr=y([`pull-rtsp`,`pull-rtmp`,`pull-http`,`pull-flv`,`pull-rfc4571`,`push-annexb`,`derived`]),Rr=d({width:a().int().positive(),height:a().int().positive()}),zr=d({camStreamId:l().min(1),deviceId:a().int().nonnegative(),kind:Lr,url:l().optional(),codec:l().optional(),resolution:Rr.optional(),fps:a().positive().optional(),label:l().optional(),deviceFeatures:b(l()).optional(),autoEligible:x().optional(),profileHint:C.optional(),metadata:_(l(),s()).optional()}),Br=y([`unassigned`,`idle`,`connecting`,`streaming`,`error`]),Vr=d({deviceId:a().int().nonnegative(),profile:C,brokerId:l(),sourceCamStreamId:l().nullable(),status:Br,resolution:Rr.optional(),codec:l().optional(),preBufferSec:a().nonnegative().optional(),errorMessage:l().optional()});function Hr(e,t){return`${e}/${t}`}function Ur(e,t){return`${e}/${t}`}function Wr(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=C.safeParse(r);return i.success?{deviceId:Number(n),profile:i.data}:null}function Gr(e,t){let n=[...e].filter(e=>t===void 0||e.deviceId===t).toSorted((e,t)=>Fr.indexOf(e.profile)-Fr.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 Kr=d({id:l(),label:l(),protocol:y([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:l().optional(),resolution:d({width:a(),height:a()}).readonly().optional(),fps:a().optional(),bitrate:a().optional(),codec:l().optional(),profileHint:C.optional()}),qr=d({type:l(),url:l(),videoCodec:l().optional(),audioCodec:l().optional(),metadata:_(l(),s()).readonly().optional()}),Jr=d({type:y([`video`,`audio`]),data:v(Uint8Array),pts:a(),dts:a(),keyframe:x(),codec:l()}),Yr=d({data:v(Uint8Array),width:a(),height:a(),format:y([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),timestamp:a()}),w=d({shmId:l(),slot:a().int().nonnegative(),seq:a().int().nonnegative(),width:a().int().positive(),height:a().int().positive(),format:y([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),pts:a(),byteLength:a().int().nonnegative(),nodeId:l(),slotCount:a().int().positive()}),Xr=y([`rgb`,`bgr`,`yuv420`,`gray`]),Zr=d({brokerId:l(),format:Xr,maxFps:a().positive().optional(),tag:l().optional()}),Qr=d({subscriptionId:l(),maxFps:a().nonnegative()}),$r=y(_e),ei=d({data:v(Uint8Array),sampleRate:a().int().positive(),channels:a().int().positive(),timestamp:a(),format:$r.optional()}),ti=d({brokerId:l(),tag:l().optional(),accept:b($r).readonly().optional()}),ni=d({subscriptionId:l()}),ri=y([`idle`,`connecting`,`streaming`,`error`,`stopped`]),ii=d({status:ri,inputFps:a(),decodeFps:a(),encodedSubscribers:a(),decodedSubscribers:a(),uptimeMs:a(),bitrateKbps:a(),idrIntervalMs:a(),codec:l().optional(),totalBytes:a(),packetCount:a(),rtspClients:a(),pipeClients:a(),preBufferSec:a(),preBufferMs:a(),preBufferPackets:a(),decoderNodeId:l().nullable(),audio:d({codec:l(),sampleRate:a(),channels:a(),supported:x()}).nullable().optional(),audioMuted:x().optional(),audioMutedDropped:a().optional()}),ai=d({profile:C,brokerId:l(),url:l(),mutedUrl:l(),enabled:x(),codec:l().optional(),resolution:Rr.optional()}),oi=d({id:l(),name:l(),category:l().optional(),description:l().optional(),icon:l().optional()}),si=[`person`,`vehicle`,`animal`,`package`],ci=[`person`,`vehicle`,`animal`];function li(e){return ci.some(t=>t===e)}var ui=d({mapping:_(l(),y(si)),preserveOriginal:x()}),di={preMs:5e3,postMs:1e4},fi=a().int().min(0).max(6),pi=/^([01]\d|2[0-3]):[0-5]\d$/,mi=y([`off`,`events`,`continuous`,`on-device-decision`]),hi=y(ci),gi=e=>new Set(e).size===e.length,_i=d({motion:x().optional(),audioThresholdDbfs:a().optional(),objectClasses:b(hi).min(1).refine(gi,{message:`objectClasses must not repeat a class`}).optional(),sensorDeviceIds:b(a().int().positive()).min(1).max(16).refine(gi,{message:`sensorDeviceIds must not repeat a device`}).optional()}),vi=y([`continuous`,`events`]),yi=_i,bi=y([`on`,`muted`]),xi=d({days:b(fi),start:l().regex(pi),end:l().regex(pi),mode:vi,audio:bi.optional(),triggers:yi.optional(),preBufferSec:a().min(0).optional(),postBufferSec:a().min(0).optional()}),Si={postBufferSec:30};function Ci(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 wi=Si.postBufferSec*1e3,Ti=d({maxAgeDays:a().min(0).optional(),maxSizeGb:a().min(0).optional()}),Ei=d({enabled:x(),mode:mi.optional(),profiles:b(C).optional(),segmentSeconds:a().int().positive().optional(),bands:b(xi).default([]),deviceDecision:x().optional(),retention:Ti.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 Di(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 Oi=[`high`,`low`];function ki(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=>Oi.includes(e));return n.length>0?n:[...e]}var Ai=[`motion`,`audioThresholdDbfs`,`objectClasses`,`sensorDeviceIds`];function ji(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Mi(e){return ji(e)&&ji(e.triggers)&&e.triggers.deviceSignal===!0}function Ni(e){let t=e.triggers;return ji(t)?Ai.some(e=>t[e]!==void 0):!1}function Pi(e){let t=e.triggers;if(!ji(t))return e;let{deviceSignal:n,...r}=t;return{...e,triggers:r}}function Fi(e){let t={value:e,migrated:!1,strippedOnly:!1};if(!ji(e)||!Array.isArray(e.bands)||!e.bands.some(Mi))return t;let n=[];for(let t of e.bands){if(!Mi(t)||!ji(t)){n.push(t);continue}Ni(t)&&n.push(Pi(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 Ii=y([`queued`,`running`,`done`,`failed`,`cancelled`]),Li=d({jobId:l(),state:Ii,fromLocationId:l(),toLocationId:l(),deviceId:a().nullable(),entities:b(l()),filesMoved:a().int(),bytesMoved:a().int(),filesTotal:a().int().nullable(),rowsReconciled:a().int().nonnegative().optional(),rowsForgotten:a().int().nonnegative().optional(),startedAt:a(),finishedAt:a().nullable(),error:l().nullable()}),Ri=y([`recordings`,`recordingsLow`]),zi=d({fromLocationId:l(),toLocationId:l(),entities:b(y([`segments`])).optional(),footageClass:Ri.optional(),deviceId:a().int().optional(),profiles:b(l()).optional(),throttleMbps:a().min(1).max(1e3).optional(),sinceMs:a().int().optional()}),T=d({leaseId:l().min(1)}),Bi=zi.extend({leaseId:l().min(1)}),Vi=y([`move`,`seal`,`gallery`]),Hi=d({toLocationId:l(),fromLocationId:l().optional(),throttleMbps:a().min(1).max(1e3).optional(),mode:Vi.optional()}),Ui=d({present:x(),rows:a().int().nonnegative().nullable()}),Wi=d({media:Ui,retrainFrames:Ui,anyPresent:x(),total:a().int().nonnegative().nullable()}).nullable(),Gi=Hi.extend({leaseId:l().min(1)}),Ki=y([`recordings`,`recordingsLow`,`eventMedia`,`backups`,`galleryMedia`]),qi=d({recordings:l().min(1).optional(),recordingsLow:l().min(1).optional(),eventMedia:l().min(1).optional(),backups:l().min(1).optional(),galleryMedia:l().min(1).optional()}).refine(e=>Object.keys(e).length>0,{message:`select at least one storage class`}),Ji=d({recordings:l().min(1).optional(),recordingsLow:l().min(1).optional(),eventMedia:l().min(1).optional(),backups:l().min(1).optional(),galleryMedia:l().min(1).optional()}).optional(),Yi=y([`blocking`,`nonBlocking`]),Xi=d({destinations:qi,sources:Ji,throttleMbps:a().min(1).max(1e3).optional(),mode:Yi.optional()}),Zi=y([`planning`,`sealing`,`pausing`,`moving`,`draining`,`verifying`,`repointing`,`refreshing`,`resuming`,`done`,`failed`,`cancelled`]),Qi=y([`pipeline`,`recorder`,`analytics`]),$i=d({filesMoved:a().int().nonnegative(),filesTotal:a().int().nonnegative().nullable(),bytesMoved:a().int().nonnegative(),rowsReconciled:a().int().nonnegative().optional(),startedAt:a(),observedAt:a()}),ea=d({storageClass:Ki,fromLocationId:l(),toLocationId:l(),freezeSource:x().optional(),moverJobId:l().nullable(),state:Ii.nullable(),error:l().nullable(),progress:$i.nullable()}),ta=d({jobId:l(),phase:Zi,mode:Yi,destinations:qi,sources:Ji,throttleMbps:a(),moves:b(ea),pauseLeaseId:l().nullable(),pausedParticipants:b(Qi),repointed:x(),cancelRequested:x(),startedAt:a(),updatedAt:a(),finishedAt:a().nullable(),error:l().nullable()}),na=y([`sharesDeviceWithSource`,`deviceIdentityUnknown`,`unstampedEventMediaRows`,`blockingOnly`,`noMover`]),ra=d({code:na,storageClass:Ki,message:l()}),ia=d({destinations:qi,sources:Ji,mode:Yi,moves:b(d({storageClass:Ki,fromLocationId:l(),toLocationId:l(),freezeSource:x().optional()})),findings:b(ra)}),aa=y([`footage`,`media`]),oa=d({lane:aa,job:Li,migrationJobId:l().nullable(),observedAt:a()}),sa=d({storageClass:Ki,fromLocationId:l(),toLocationId:l(),items:a().int().nonnegative().nullable(),bytes:a().int().nonnegative().nullable()}),ca=d({classes:b(Ki).min(1),throttleMbps:a().min(1).max(1e3).optional()}),la=d({fromLocationId:l().min(1),footageClass:Ri.optional()}),ua=d({segments:a().int().nonnegative(),bytes:a().int().nonnegative()}).nullable(),da=d({locationId:l().min(1),apply:x().optional(),deviceId:a().int().positive().optional(),profiles:b(l().min(1)).optional()}),fa=y([`location-unknown`,`source-writable`,`no-ledger`,`archive-unreadable`,`anchor-absent`,`anchor-unreadable`,`anchor-moved`]),pa=y([`live-tail`,`listing-error`,`path-mismatch`,`durable-refused`]),ma=d({"live-tail":a().int().nonnegative(),"listing-error":a().int().nonnegative(),"path-mismatch":a().int().nonnegative(),"durable-refused":a().int().nonnegative()}),ha=d({deviceId:a().int(),hoursWalked:a().int().nonnegative(),hoursMissing:a().int().nonnegative(),ghostSegments:a().int().nonnegative(),ghostBytes:a().int().nonnegative(),forgottenSegments:a().int().nonnegative(),orphanFiles:a().int().nonnegative()}),ga=d({locationId:l(),applied:x(),refused:fa.nullable(),archiveSegments:a().int().nonnegative().nullable(),archiveBytes:a().int().nonnegative().nullable(),hoursClaimed:a().int().nonnegative(),hoursWalked:a().int().nonnegative(),hoursMissing:a().int().nonnegative(),listings:a().int().nonnegative(),segmentsClaimed:a().int().nonnegative(),ghostSegments:a().int().nonnegative(),ghostBytes:a().int().nonnegative(),ghostHoursWhole:a().int().nonnegative(),forgottenSegments:a().int().nonnegative(),forgottenBytes:a().int().nonnegative(),orphanFiles:a().int().nonnegative(),orphanSample:b(l()).readonly(),hoursSkipped:a().int().nonnegative(),skippedByReason:ma,bounded:x(),byDevice:b(ha).readonly()}),_a=d({rows:a().int().nonnegative()}).nullable(),va=d({toLocationId:l().min(1),fromLocationId:l().optional(),mode:Vi.optional()}),ya=y([`orphans`,`debug-media`,`ghost-ledger`,`done`,`failed`,`cancelled`]),ba=d({includeDebugMedia:x().optional()}),xa=d({jobId:l(),phase:ya,includeDebugMedia:x(),orphansReclaimed:a().int().nonnegative(),orphanBytesReclaimed:a().int().nonnegative(),debugMediaReclaimed:a().int().nonnegative(),debugMediaBytesReclaimed:a().int().nonnegative(),ghostsForgotten:a().int().nonnegative(),ghostBytesForgotten:a().int().nonnegative(),detail:l().nullable(),cancelRequested:x(),startedAt:a(),updatedAt:a(),finishedAt:a().nullable(),error:l().nullable()}),Sa=d({jobId:l().optional()}),Ca=[`face`,`plate`],wa=[`face`,`plate`,`clip`,`custom`],Ta=[`active`,`readonly`,`drain`,`disabled`],Ea=y(Ta),Da=y([`normal`,`never`,`drain`]),Oa=`readOnly`;function ka(e){return e===`active`}function Aa(e){return e!==`disabled`}function ja(e){switch(e){case`active`:return`normal`;case`drain`:return`drain`;case`readonly`:case`disabled`:return`never`}}function Ma(e){return e.mode===void 0&&(e.config.readOnly===!0||e.enabled===!1)?`readonly`:null}function Na(e){return(Pa(e.mode)?e.mode:void 0)??Ma(e)??`active`}function Pa(e){return Ta.some(t=>t===e)}function Fa(e){return ka(Na(e))}function Ia(e){return Aa(Na(e))}function La(e){return ja(Na(e))}function Ra(e){if(!(`readOnly`in e))return e;let t={...e};return delete t[Oa],t}function za(e,t){return{...e,mode:t,enabled:ka(t),config:Ra(e.config)}}var Ba=l().regex(/^[a-z][a-zA-Z0-9-]*$/),E=d({id:l().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),type:l(),displayName:l().min(1),providerId:l().min(1),config:_(l(),s()),nodeId:l().optional(),isSystem:x().default(!1),enabled:x().optional(),mode:Ea.optional(),capacity:d({totalBytes:a(),availableBytes:a()}).nullable().optional(),owned:d({bytes:a().int().nonnegative(),measuredAtMs:a().int().nonnegative()}).optional(),createdAt:a(),updatedAt:a()}),Va=d({isDefault:x().optional()});function Ha(e){return Fa({...e,config:e.config??{}})}var Ua=1024**3;function Wa(e){return Math.floor(e*Ua)}var Ga=d({locationId:l(),startedAtMs:a(),startBytes:a(),bytesRemaining:a(),drained:x(),estimatedEmptyAtMs:a().nullable()}),D=f([Ba,l().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),Ka=y([`local-path`,`cap-mediated`]),qa=`local-path`,Ja=d({id:l().regex(/^[a-z][a-zA-Z0-9-]*$/,{message:`id must start with a lowercase letter and contain only letters, digits, or hyphens`}),displayName:l().min(1,{message:`displayName must not be empty`}),description:l().optional(),cardinality:y([`single`,`multi`]),access:Ka.optional(),defaultsTo:l().optional(),defaultRoot:y([`data`,`media`,`backup`]).optional()}),Ya=d({inputFps:a(),outputFps:a(),avgDecodeTimeMs:a(),droppedFrames:a(),lagMs:a().optional(),effectiveFps:a().optional(),adaptiveFps:a().optional()}),Xa=d({codec:l(),maxFps:a().default(0),outputFormat:y([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]).default(`jpeg`),scale:a().default(1),width:a().optional(),height:a().optional(),deviceId:a().int().nonnegative().optional(),tag:l().optional(),frameSink:y([`callback`,`shm`]).default(`callback`),debug:x().optional()}),Za={offsetHours:1,startMonth:3,startWeekIndex:5,startWeekday:`Sunday`,startHour:2,endMonth:10,endWeekIndex:5,endWeekday:`Sunday`,endHour:3},Qa={offsetHours:1,startMonth:3,startWeekIndex:2,startWeekday:`Sunday`,startHour:2,endMonth:11,endWeekIndex:1,endWeekday:`Sunday`,endHour:2},$a=[{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:Za},{id:`Europe/Rome`,label:`Europe/Rome (UTC+1 / CEST)`,region:`Europe`,stdOffsetMinutes:60,dst:Za},{id:`Europe/Paris`,label:`Europe/Paris (UTC+1 / CEST)`,region:`Europe`,stdOffsetMinutes:60,dst:Za},{id:`Europe/Berlin`,label:`Europe/Berlin (UTC+1 / CEST)`,region:`Europe`,stdOffsetMinutes:60,dst:Za},{id:`Europe/Madrid`,label:`Europe/Madrid (UTC+1 / CEST)`,region:`Europe`,stdOffsetMinutes:60,dst:Za},{id:`Europe/Amsterdam`,label:`Europe/Amsterdam (UTC+1 / CEST)`,region:`Europe`,stdOffsetMinutes:60,dst:Za},{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:Qa},{id:`America/Chicago`,label:`America/Chicago (UTC−6 / CDT)`,region:`Americas`,stdOffsetMinutes:-360,dst:Qa},{id:`America/Denver`,label:`America/Denver (UTC−7 / MDT)`,region:`Americas`,stdOffsetMinutes:-420,dst:Qa},{id:`America/Los_Angeles`,label:`America/Los Angeles (UTC−8 / PDT)`,region:`Americas`,stdOffsetMinutes:-480,dst:Qa},{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 eo(e){return $a.find(t=>t.id===e)}var to=y([`info`,`warn`,`error`]),no=d({name:l().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/,`a channel name is dotted lower-kebab, e.g. area.thing`),description:l().min(1),defaultLevel:to,perDevice:x()}),ro=d({channel:l().min(1),armedUntilMs:a(),deviceIds:b(a().int()).readonly().nullable()}),io=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}},ao=class{gates=new Map;declare(e){let t=no.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 io(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}},oo=null;function so(){return oo??=new ao,oo}function co(e){return so().declare(e)}function lo(){oo=null}var uo=5e3;function fo(e,t={}){let n=so(),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 po=1024,mo=`other`;function ho(e,t,n){return n===void 0?`${e}${t}`:`${e}${t}${n}`}var go=class{maxKeys;maxReasons;counters=new Map;refused=0;constructor(e=po,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=ho(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:mo;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 _o(e){return e.attempts<=0?null:(e.attempts-e.succeeded)/e.attempts}var vo=`__unattributed__`,yo=`__root__`;function bo(e){return e.addonId===null?e.classification===`root`?{key:yo,kind:`root`}:{key:vo,kind:`unattributed`}:{key:e.addonId,kind:`addon`}}function xo(e){return Math.round(e*10)/10}function So(e,t){let n=new Map;for(let t of e){let{key:e,kind:r}=bo(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?xo(n.main):null,i=n.splitKnown?xo(n.gc):null,a=xo(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 Co(e,t){return e===null||t===null?null:e<t?e:t}function wo(e,t){return e===null||t===null?null:e>t?e:t}function To(e,t,n){return{atMs:n,samples:e.samples+t.samples,cpuMainPercent:wo(e.cpuMainPercent,t.cpuMainPercent),cpuMainPercentMin:Co(e.cpuMainPercentMin,t.cpuMainPercentMin),cpuGcPercent:wo(e.cpuGcPercent,t.cpuGcPercent),cpuGcPercentMin:Co(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 Eo(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 Do(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}:To(a,i,e))}return[...r.values()].toSorted((e,t)=>e.atMs-t.atMs)}var Oo=class extends Error{capName;scope;waitedMs;constructor(e,t,n){super(`Timed out waiting for ${e} (${Ao(t)}) to become ready after ${n}ms`),this.name=`ReadinessTimeoutError`,this.capName=e,this.scope=t,this.waitedMs=n}};function ko(e,t){return`${e}|${Ao(t)}`}function Ao(e){switch(e.type){case`global`:return`global`;case`node`:return`node:${e.nodeId}`;case`device`:return`device:${e.deviceId}`}}function jo(e){switch(e){case`starting`:return 0;case`ready`:return 1;case`down`:return 2}}function Mo(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 No=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??Po(),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(ko(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=ko(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&&jo(r.state)<=jo(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} (${Ao(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&&Mo(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 Oo(e,t,this.now()-i)))},r):null,u=setInterval(()=>{s||this.logger?.warn(`readiness: still awaiting ${e} (${Ao(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(Ye(`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=ko(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} (${Ao(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&&Mo(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} (${Ao(r.scope)}) → down (synthesized from agent.offline ${e})`);for(let e of this.subscriptions)if(e.capName===r.capName&&Mo(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 Po(){return typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2,14)}function Fo(e,t){for(let{capName:n,scope:r}of t)e.emitDown(n,r)}function Io(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=Lo(e,s);if(t)return a(t)}}return a(o[0])}function Lo(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)=>gt(e.pixels,t.pixels,n))[0]?.entry}var Ro=[`motion`,`objects`,`discarded`,`stationary`],zo=[`motion`,`objects`,`stationary`],Bo={borderWidth:2,dashed:!0,dashPattern:[6,4],opacity:1,borderRadius:2};function Vo(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 Ho=[`onnx`,`coreml`,`openvino`,`tflite`,`pt`],Uo={yolo26:`YOLO26`,yolov9:`YOLOv9`};function Wo(e){return Uo[e]??e.toUpperCase()}var Go=/\s*@\s*\d+\s*(?:[x×]\s*\d+)?/gi;function Ko(e,t){let n=Wo(e),r=t.replace(RegExp(`^${n}\\s+`,`i`),``).replace(Go,``).trim();return r.length>0?r:t}function qo(e,t){let n=[];return t===`fast`&&n.push(`Fast`),n.push(e===`int8`?`Int8`:`Standard`),n.join(` · `)}function Jo(e){return Ho.filter(t=>e.formats[t]!==void 0)}function Yo(e){let t=Ho.map(t=>e.formats[t]?.sizeMB).filter(e=>typeof e==`number`);return t.length>0?Math.min(...t):0}var Xo=[`t`,`n`,`s`,`m`,`c`,`l`,`x`],Zo=[`fp32`,`int8`];function Qo(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:qo(t,n),formats:Jo(e),sizeMB:Yo(e)}}).toSorted((e,t)=>e.resolution===t.resolution?e.optimization===t.optimization?Zo.indexOf(e.precision)-Zo.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?Ko(e,o.name):n.toUpperCase(),baseModelId:a.modelId,options:r})}t.sort((e,t)=>{let n=Xo.indexOf(e.tier),r=Xo.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:Wo(e),tiers:t})}return n.sort((e,t)=>e.family.localeCompare(t.family)),n}function $o(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 es(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 ts=/^object-clip(-[a-z0-9][a-z0-9-]*)?$/,ns=d({textModelId:l().min(1),embeddingDim:a().int().positive(),vectorIndex:l().regex(ts),tokenizerFile:l().min(1),contextLength:a().int().positive(),padId:a().int().nonnegative(),searchMinScore:a().min(0).max(1)}),rs=[`loose`,`balanced`,`strict`],is=y(rs),as={loose:1,balanced:1.25,strict:1.5};function os(e,t){if(t.minScore!==void 0)return t.minScore;let n=as[t.strictness??`loose`];return Math.min(1,Math.round(e.searchMinScore*n*1e3)/1e3)}var ss=[`onnx`,`coreml`,`openvino`,`tflite`,`pt`,`gguf`],cs=d({url:l(),sizeMB:a(),isDirectory:x().optional(),files:b(l()).readonly().optional(),runtimes:b(y([`python`])).readonly().optional()}),ls=d({url:l(),filename:l(),sizeMB:a()}),us=d({onnx:cs.optional(),coreml:cs.optional(),openvino:cs.optional(),tflite:cs.optional(),pt:cs.optional(),gguf:cs.optional()}),ds=d({family:l(),tier:l(),precision:y([`fp32`,`int8`]).optional(),optimization:y([`standard`,`fast`]).optional(),resolution:a().int().positive().optional()}),fs=[`camstack`,`frigate`,`scrypted`,`custom`],ps=y(fs);function ms(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 hs=[`camstack-hf`,`third-party`,`built-in`],gs=r(e=>typeof e==`string`?{weights:e}:e,d({weights:l().min(1),code:l().min(1).optional(),data:d({name:l().min(1),terms:l().min(1),url:l().url().optional()}).optional(),upstream:d({name:l().min(1),url:l().url()}).optional(),url:l().url().optional(),attribution:l().min(1).optional(),modifications:l().min(1).optional(),hosting:y(hs).optional(),nonCommercial:x().optional()})),_s=d({id:l(),name:l(),description:l(),formats:us,inputSize:d({width:a(),height:a()}),inputChannels:a().int().positive().optional(),labels:b(oi).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:a().min(0).max(1).optional(),faceAlignment:x().optional(),extraFiles:b(ls).readonly().optional(),legacy:x().optional(),metrics:d({map50:a().optional(),p95LatencyMs:_(l(),a()).optional()}).optional(),license:gs.optional(),group:ds.optional(),provider:ps.optional(),classMap:ui.optional(),clip:ns.optional()}),vs=p(`format`,[d({format:m(`openvino`),precisions:b(y([`fp16`,`int8`])).min(1).readonly()}),d({format:m(`coreml`)})]),ys=d({id:l().regex(/^[a-zA-Z0-9._-]+$/),name:l(),labels:b(oi).readonly(),inputSize:d({width:a(),height:a()}),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:ui.optional()}),bs=d({format:y(ss),precision:y([`fp16`,`int8`]).optional(),sizeMB:a(),validated:x(),files:b(l()).readonly()}),xs=d({entry:_s,artifacts:b(bs).readonly()});function Ss(e){switch(e.toUpperCase()){case`GET`:case`HEAD`:case`OPTIONS`:return`view`;case`POST`:case`PUT`:case`PATCH`:return`create`;default:return`delete`}}function Cs(e,t){return e.some(e=>e.type===`category`&&e.target===`device`&&e.access.includes(t))}function ws(e,t,n){return e.some(e=>e.type===`addon`&&e.target===t&&e.access.includes(n))}function Ts(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 Es(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=Ss(e.method);return ws(e.scopes,e.addonId,n)?{allowed:!0}:{allowed:!1,reason:`integration token holds no addon:${e.addonId}[${n}] grant`}}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 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 Ds(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 Os(e,t){return e.map((e,n)=>A(e,t,n))}function ks(e,t,n){if(typeof e!=`boolean`)throw new k(`${t}: argument ${n+1} must be a boolean`);return e}var As=1/0,js={min:{minArgs:1,maxArgs:As,apply:e=>j(Math.min(...Os(e,`min`)),`min`)},max:{minArgs:1,maxArgs:As,apply:e=>j(Math.max(...Os(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:As,apply:e=>{let t=Os(e,`avg`);return j(t.reduce((e,t)=>e+t,0)/t.length,`avg`)}},sum:{minArgs:1,maxArgs:As,apply:e=>j(Os(e,`sum`).reduce((e,t)=>e+t,0),`sum`)},coalesce:{minArgs:1,maxArgs:As,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=Ds(e[1],`convert`,1).trim(),i=Ds(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:As,apply:e=>e.map((e,t)=>ks(e,`any`,t)).some(e=>e)},all:{minArgs:1,maxArgs:As,apply:e=>e.map((e,t)=>ks(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}},latest:{minArgs:1,maxArgs:As,apply:e=>{let t=e.flatMap((e,t)=>e===null?[]:[A(e,`latest`,t)]);return t.length===0?null:j(Math.max(...t),`latest`)}}},Ms=Object.freeze(Object.assign(Object.create(null),js)),Ns=new Set(Object.keys(js)),Ps=2048,Fs=4096,Is=/^[A-Za-z_][A-Za-z0-9_]*$/,Ls=new Set([`now`,`true`,`false`,`null`]),Rs=new Set([`true`,`false`,`null`]);function zs(e){return e>=`0`&&e<=`9`}function Bs(e){return e>=`A`&&e<=`Z`||e>=`a`&&e<=`z`||e===`_`}function Vs(e){return Bs(e)||zs(e)}function Hs(e){return e===` `||e===` `||e===`
|
|
3
|
+
`||e===`\r`||e===`\f`||e===`\v`}function Us(e){if(e.length>2048)throw new O(`expression too long (${e.length} > ${Ps} chars)`,0);let t=[],n=0,r=e.length;for(;n<r;){let i=e[n];if(Hs(i)){n+=1;continue}if(zs(i)){let i=n;for(;n<r&&zs(e[n]);)n+=1;if(n<r&&e[n]===`.`){if(n+1>=r||!zs(e[n+1]))throw new O(`malformed number: decimal point needs a digit`,n);for(n+=1;n<r&&zs(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(Bs(i)){let i=n;for(;n<r&&Vs(e[n]);)n+=1;let a=e.slice(i,n);Rs.has(a)?t.push({type:`keyword`,keyword:Ws(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(Gs(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 Ws(e){return e===`true`?`true`:e===`false`?`false`:`null`}function Gs(e){return e===`(`||e===`)`||e===`,`||e===`?`||e===`:`||e===`+`||e===`-`||e===`*`||e===`/`||e===`%`||e===`!`||e===`<`||e===`>`}var Ks={"||":1,"&&":2,"==":3,"!=":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6};function qs(e){return e===`&&`||e===`||`}function Js(e){return e===`+`||e===`-`||e===`*`||e===`/`||e===`%`||e===`==`||e===`!=`||e===`<`||e===`<=`||e===`>`||e===`>=`}var Ys=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=Ks[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(),qs(i))t={kind:`logical`,op:i,left:t,right:a};else if(Js(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(!Ns.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 Xs(e){return new Ys(Us(e)).parse()}var Zs=new Map;function Qs(e){let t=Zs.get(e);if(t!==void 0)return Zs.delete(e),Zs.set(e,t),t;let n;try{n={ok:!0,parsed:Xs(e)}}catch(e){n={ok:!1,error:e instanceof O?e.message:String(e)}}if(Zs.set(e,n),Zs.size>256){let e=Zs.keys().next().value;e!==void 0&&Zs.delete(e)}return n}function $s(e){let t=Qs(e);if(t.ok)return t.parsed;throw new O(t.error)}function ec(e){return Qs(e)}var tc=Object.freeze({});function nc(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 rc(e){return typeof e==`number`&&Number.isFinite(e)}function ic(e){return!!e}function ac(e,t){if(!Number.isFinite(e))throw new k(`${t} produced a non-finite result`);return e}function oc(e){if(e.steps+=1,e.steps>e.maxSteps)throw new k(`expression evaluation step budget exceeded`)}function M(e,t){switch(oc(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 sc(e.op,M(e.operand,t));case`binary`:return cc(e.op,M(e.left,t),M(e.right,t));case`logical`:{let n=M(e.left,t);return e.op===`&&`?ic(n)?M(e.right,t):n:ic(n)?n:M(e.right,t)}case`conditional`:return ic(M(e.test,t))?M(e.consequent,t):M(e.alternate,t);case`call`:return lc(e.callee,e.args.map(e=>M(e,t)),t.hooks)}}function sc(e,t){if(e===`!`)return!ic(t);if(!rc(t))throw new k(`unary "-" requires a finite number`);return ac(-t,`unary "-"`)}function cc(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(rc(t)&&rc(n))return ac(t+n,`"+"`);throw new k(`"+" requires two numbers or two strings`);case`-`:case`*`:case`/`:case`%`:if(!rc(t)||!rc(n))throw new k(`"${e}" requires two finite numbers`);return ac(e===`-`?t-n:e===`*`?t*n:e===`/`?t/n:t%n,`"${e}"`);case`<`:case`<=`:case`>`:case`>=`:if(rc(t)&&rc(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 lc(e,t,n){if(!Object.prototype.hasOwnProperty.call(Ms,e))throw new k(`unknown function: ${e}`);let r=Ms[e];if(t.length<r.minArgs||t.length>r.maxArgs)throw new k(`${e}: wrong number of arguments (${t.length})`);return r.apply(t,n)}function uc(e,t,n){return M(e,{scope:t,hooks:n?.hooks??tc,maxSteps:n?.maxSteps??4096,steps:0})}function dc(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 fc(e){let t=Object.keys(e.bindings);if(t.length>32)return`too many bindings (${t.length} > 32)`;for(let e of t){if(!Is.test(e))return`invalid binding name '${e}'`;if(Ls.has(e))return`binding name '${e}' is reserved`;if(Ns.has(e))return`binding name '${e}' shadows a builtin function`}let n=ec(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 pc(e,t,n,r){let i=ec(e);if(!i.ok)return{ok:!1,error:i.error};let a=nc({...t,now:n}),o={...r?.hooks,now:n};try{return{ok:!0,value:uc(i.parsed.ast,a,{...r,hooks:o})}}catch(e){return{ok:!1,error:e instanceof k?e.message:String(e)}}}var mc=d({kind:m(`field`).optional(),sourceKey:l(),cap:l(),fieldPath:l()}),hc=d({kind:m(`literal`),value:f([l(),a(),x(),ae()])}),gc=d({kind:m(`global`),sourceStableId:l(),cap:l(),fieldPath:l()}),_c=f([mc,hc,gc]),vc=d({expr:l().min(1).max(Ps),bindings:_(l().regex(Is),_c)}).superRefine((e,t)=>{let n=fc(e);n!==null&&t.addIssue({code:`custom`,message:n,path:[`expr`]})}),yc=y([`eq`,`ne`,`gt`,`gte`,`lt`,`lte`,`contains`,`in`]),bc=d({kind:m(`condition`),deviceId:a().int().nonnegative(),cap:l().min(1),fieldPath:l().min(1),operator:yc,value:f([l(),a(),x(),b(f([l(),a()]))])}),xc=d({kind:m(`expression`),expr:l().min(1).max(Ps),bindings:_(l().regex(Is),_c)}).superRefine((e,t)=>{let n=fc(e);n!==null&&t.addIssue({code:`custom`,message:n,path:[`expr`]})}),Sc=he(()=>p(`kind`,[d({kind:m(`all`),children:b(Sc)}),d({kind:m(`any`),children:b(Sc)}),d({kind:m(`not`),child:Sc}),bc,xc])),Cc=p(`kind`,[d({kind:m(`device-state`),deviceId:a().int().nonnegative(),cap:l().min(1),fieldPath:l().min(1),becomes:f([l(),a(),x()]).optional(),edge:x().optional(),forMs:a().int().min(0).max(864e5).optional(),debounceMs:a().int().min(0).max(6e5).optional()}),d({kind:m(`device-event`),category:l().min(1),deviceId:a().int().nonnegative().optional()}),d({kind:m(`schedule`),cron:l().min(1).max(120)}),d({kind:m(`manual`)})]),wc=p(`kind`,[d({kind:m(`wait`),seconds:a().min(0).max(300)}),d({kind:m(`cap`),deviceId:f([a().int(),d({$var:l().min(1)})]),cap:l().min(1),method:l().min(1),args:_(l(),s()).optional()}),d({kind:m(`code`),code:l().min(1).max(2e4)})]),Tc=d({triggers:b(Cc),conditions:Sc.optional(),actions:b(wc)});function Ec(e){if(e.kind===`condition`||e.kind===`expression`)return 1;if(e.kind===`not`)return 1+Ec(e.child);let t=e.children;if(t.length===0)return 1;let n=0;for(let e of t){let t=Ec(e);t>n&&(n=t)}return 1+n}function Dc(e){if(e.kind===`condition`||e.kind===`expression`)return 1;if(e.kind===`not`)return Dc(e.child);let t=0;for(let n of e.children)t+=Dc(n);return t}function Oc(e){return e.kind===`condition`||e.kind===`expression`?!1:e.kind===`not`?Oc(e.child):e.children.length===0?!0:e.children.some(Oc)}function kc(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(Oc(t))return`a condition group is empty — group existing rows instead of leaving a container to fill`;let e=Ec(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=Dc(t);if(n>32)return`conditions use ${n} leaves — the limit is 32`}return null}var Ac=15e3;function N(e){return JSON.stringify(e)}function jc(e,t){switch(e.kind){case`all`:return`allOf([\n${e.children.map(e=>`${t} () => ${jc(e,`${t} `)}`).join(`,
|
|
4
|
+
`)}\n${t}])`;case`any`:return`anyOf([\n${e.children.map(e=>`${t} () => ${jc(e,`${t} `)}`).join(`,
|
|
5
|
+
`)}\n${t}])`;case`not`:return`notOf(() => ${jc(e.child,t)})`;case`condition`:return`leaf(${N(e.deviceId)}, ${N(e.cap)}, ${N(e.fieldPath)}, ${N(e.operator)}, ${N(e.value)})`;case`expression`:return`exprLeaf(${N(e.expr)}, ${N(e.bindings)})`}}function Mc(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(${N(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: ${N(e.category)}${e.deviceId===void 0?``:`, deviceId: ${N(e.deviceId)}`} },
|
|
24
|
+
(event) => {
|
|
25
|
+
void run({
|
|
26
|
+
kind: 'device-event',
|
|
27
|
+
at: Date.now(),
|
|
28
|
+
deviceId: event.deviceId,
|
|
29
|
+
category: ${N(e.category)},
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
),
|
|
33
|
+
)`;case`device-state`:{let n=e.becomes===void 0?`undefined`:N(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(${N(e.deviceId)}, ${N(e.cap)}, ${N(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 = ${N(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: ${N(e.deviceId)},
|
|
57
|
+
cap: ${N(e.cap)},
|
|
58
|
+
field: ${N(e.fieldPath)},
|
|
59
|
+
to: value,
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
const wake = (): void => {
|
|
63
|
+
if (debounce !== undefined) clearTimeout(debounce)
|
|
64
|
+
debounce = setTimeout(() => { void check() }, ${N(e.debounceMs??0)})
|
|
65
|
+
}
|
|
66
|
+
disposers.push(
|
|
67
|
+
ctx.eventBus.subscribe({ category: 'device.state-changed', deviceId: ${N(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 Nc(e,t){switch(e.kind){case`wait`:return` case ${t}: await sleep(${N(e.seconds*1e3)}); break`;case`cap`:return` case ${t}: {
|
|
73
|
+
const deviceId = ${typeof e.deviceId==`number`?N(e.deviceId):`resolveTarget(vars, ${N(e.deviceId.$var)})`}
|
|
74
|
+
await actuate(deviceId, ${N(e.cap)}, ${N(e.method)}, ${N(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 Pc(e){let t=kc(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 ${jc(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 = ${Ac}
|
|
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)=>Nc(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)=>Mc(e,t)).join(`
|
|
338
|
+
|
|
339
|
+
`)}
|
|
340
|
+
|
|
341
|
+
return () => {
|
|
342
|
+
for (const dispose of disposers) dispose()
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
`}var Fc=`__camstackNodePin`;function Ic(e){return{context:{[Fc]:Lc(e)}}}function Lc(e){let t=e.split(`/`)[0];return t===void 0||t.length===0?e:t}function Rc(e){if(typeof e!=`object`||!e)return;let t=Reflect.get(e,Fc);return typeof t==`string`?t:void 0}var zc=`session`;function Bc(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 Vc=`provider`,Hc=d({id:l(),title:l(),description:l().optional(),style:y([`card`,`accordion`]).optional(),defaultCollapsed:x().optional(),columns:f([m(1),m(2),m(3),m(4)]).optional(),tab:l().optional(),location:y([`settings`,`top-tab`]).optional(),order:a().optional(),fields:b(ee())}),Uc=d({tabs:b(d({id:l(),label:l(),icon:l(),order:a().optional()})).optional(),sections:b(Hc)}).nullable(),Wc={getDeviceSettingsContribution:{input:d({deviceId:a()}),output:Uc,kind:`query`,auth:`protected`},getDeviceLiveContribution:{input:d({deviceId:a()}),output:Uc,kind:`query`,auth:`protected`},applyDeviceSettingsPatch:{input:d({deviceId:a(),patch:_(l(),s())}),output:d({success:m(!0)}),kind:`mutation`,auth:`admin`}},Gc={getStatus:{input:d({deviceId:a()}),output:s().nullable(),kind:`query`,auth:`protected`}};function Kc(e){let t=e.methods;return e.exposesDeviceSettings&&(t={...Wc,...t}),e.status&&(t={...Gc,...t}),t}function P(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 qc(e,t,n){return{...P(e,t,n),systemOnly:!0}}function Jc(e,t,n){return{...P(e,t,n),providerOptional:!0}}function F(e){return{data:e}}function Yc(e){return e?.deviceConfig!==void 0}var Xc=d({id:l(),label:l(),icon:l(),path:l(),remoteName:l(),bundle:l(),section:l().optional(),sectionLabel:l().optional()}),Zc=d({addonId:l(),page:Xc,bundleUrl:l()}),Qc={name:`addon-pages`,scope:`system`,mode:`singleton`,methods:{listPages:P(g(),b(Zc).readonly())}},$c=d({id:l(),label:l(),icon:l(),path:l(),remoteName:l(),bundle:l(),section:l().optional(),sectionLabel:l().optional()}),el={name:`addon-pages-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listPages:P(g(),b($c).readonly(),{auth:`admin`})}},tl=d({method:y([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`]),path:l(),access:y([`public`,`authenticated`,`admin`]).optional(),description:l().optional()}),nl=d({method:l(),path:l(),params:_(l(),l()),query:_(l(),l()),body:s(),headers:_(l(),l()),user:d({id:l(),username:l(),isAdmin:x()}).optional(),scopedToken:s().optional()}),rl=d({status:a().int(),headers:_(l(),l()),redirectUrl:l().nullable(),body:s().optional(),contentType:l().optional()}),il={name:`addon-routes`,scope:`system`,mode:`collection`,internal:!0,methods:{getRoutes:P(g(),b(tl)),invoke:P(nl,rl,{kind:`mutation`})},mount:{kind:`skip`}},al=d({id:l(),label:l(),icon:l(),order:a().optional()}),ol=d({id:l(),title:l(),description:l().optional(),style:y([`card`,`accordion`]).optional(),defaultCollapsed:x().optional(),columns:f([m(1),m(2),m(3),m(4)]).optional(),tab:l().optional(),location:y([`settings`,`top-tab`]).optional(),order:a().optional(),fields:b(ee())}),I=d({tabs:b(al).optional(),sections:b(ol)}),sl=_(l(),s()),cl=d({success:m(!0)}),ll={name:`addon-settings`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{getGlobalSettings:P(d({addonId:l(),nodeId:l().optional(),overlay:_(l(),s()).optional(),cap:l().optional()}),I.nullable()),updateGlobalSettings:P(d({addonId:l(),nodeId:l().optional(),patch:sl}),cl,{kind:`mutation`,auth:`admin`}),getIntegrationSettings:P(d({addonId:l(),nodeId:l().optional()}),I.nullable()),getDeviceSettings:P(d({addonId:l(),deviceId:a(),nodeId:l().optional()}),I.nullable()),updateDeviceSettings:P(d({addonId:l(),deviceId:a(),nodeId:l().optional(),patch:sl}),cl,{kind:`mutation`,auth:`admin`})}},ul=y([`device-tab`,`dashboard`,`integration-detail`]),dl=y([`xs`,`sm`,`md`,`lg`,`xl`]),fl=d({remoteName:l(),exposedModule:l(),componentKey:l().optional()}),pl=d({tab:l(),subTab:l().optional(),label:l(),order:a().optional(),kind:m(`remote`),remote:fl,stableId:l(),description:l().optional(),icon:l().optional(),bundle:l(),hosts:b(ul).readonly(),requires:d({deviceContext:x().default(!1),integrationContext:x().default(!1)}),preAuth:x().optional().default(!1),defaultSize:dl.default(`md`),allowedSizes:b(dl).readonly().default([`sm`,`md`,`lg`]),defaultColumns:a().int().min(1).max(12).default(6),defaultRows:a().int().min(1).max(12).default(1)}),ml={name:`addon-widgets-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listWidgets:P(g(),b(pl).readonly(),{auth:`admin`})}},hl=pl.extend({addonId:l(),bundleUrl:l()}),gl={name:`addon-widgets`,scope:`system`,mode:`singleton`,methods:{listWidgets:P(g(),b(hl).readonly())}},_l=d({staticDir:l()}),vl=d({version:l()}),yl={name:`admin-ui`,scope:`system`,mode:`singleton`,internal:!0,methods:{getStaticDir:P(g(),_l,{auth:`admin`}),getVersion:P(g(),vl,{auth:`admin`})}},bl=y([`info`,`success`,`warning`,`error`]),xl=y([`active`,`in-progress`,`completed`,`failed`,`dismissed`]),Sl=d({type:l(),id:l()}),Cl=d({id:l(),category:l(),severity:bl,title:l(),message:l(),status:xl,progress:a().optional(),read:x(),createdAt:a(),updatedAt:a(),source:Sl.optional(),metadata:_(l(),s()).optional()}),wl={name:`alerts`,scope:`system`,mode:`singleton`,methods:{emit:P(Cl,g(),{kind:`mutation`}),update:P(d({alertId:l(),patch:Cl.partial()}),g(),{kind:`mutation`}),list:P(d({unreadOnly:x().optional(),limit:a().optional()}).optional(),b(Cl).readonly()),getUnreadCount:P(g(),a()),markRead:P(d({alertId:l()}),g(),{kind:`mutation`}),markAllRead:P(g(),g(),{kind:`mutation`}),dismiss:P(d({alertId:l()}),g(),{kind:`mutation`})}},L=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}({}),Tl=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}({}),El=function(e){return e.ChargingDC=`charging-dc`,e.ChargingSolar=`charging-solar`,e.NotCharging=`not-charging`,e}({}),R=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}({}),Dl={name:`audio-analysis`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[L.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:P(d({deviceId:a()}),h())},events:{onAudioLevel:F(d({deviceId:a(),rms:a(),dbfs:a()}))}},Ol=y([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),kl=d({data:h(),format:Ol,width:a(),height:a(),timestamp:a()}),z=d({x:a(),y:a(),w:a(),h:a()}),Al=d({class:l(),originalClass:l(),score:a(),bbox:z}),jl=d({data:v(Uint8Array),sampleRate:a(),channels:a(),timestamp:a(),deviceId:a().optional()}),Ml=d({rms:a(),dbfs:a()}),Nl=d({className:l(),originalClass:l().optional(),score:a()}),Pl=[`superseded`,`error`,`timeout`,`disposed`],Fl=p(`state`,[d({state:m(`classified`)}),d({state:m(`not-classified`),reason:y(Pl)})]),Il=d({level:Ml,classification:d({labels:b(Nl).readonly(),inferenceMs:a()}).optional(),classifyOutcome:Fl,timestamp:a()}),Ll=d({minConfidence:a().min(0).max(1).default(.3),allowedClasses:b(l()).default([])}),Rl=d({deviceId:a(),brokerId:l(),ingestNodeId:l(),settings:Ll}),zl=d({attached:x(),replaced:x()}),Bl=d({detached:x()}),Vl=d({labels:b(Nl).readonly(),rawLabels:b(Nl).readonly().optional(),inferenceMs:a()}),Hl=[{value:`auto`,label:`Auto (platform default)`},{value:`apple-soundanalysis`,label:`Apple SoundAnalysis (macOS 12+)`},{value:`yamnet-onnx`,label:`YAMNet ONNX (cross-platform)`}],Ul={audioBackend:`auto`,probedBestAudioBackend:``},Wl={name:`audio-analyzer`,scope:`system`,mode:`singleton`,methods:{analyseChunk:P(d({chunk:jl,settings:Ll}),Il.nullable(),{kind:`mutation`}),classify:P(jl,Vl,{timeoutMs:3e4}),attachDevice:P(Rl,zl,{kind:`mutation`}),detachDevice:P(d({deviceId:a()}),Bl,{kind:`mutation`}),isReady:P(g(),x()),dispose:P(g(),g(),{kind:`mutation`}),reprobeAudioEngine:P(g(),d({backend:l()}),{kind:`mutation`,auth:`admin`})}},Gl=y([`f32le`,`s16le`]),Kl=d({codec:l(),canDecode:x(),canEncode:x(),label:l().optional()}),ql=d({codec:l(),sourceSampleRate:a().int().positive(),sourceChannels:a().int().positive(),extraData:v(Uint8Array).optional(),targetSampleRate:a().int().positive(),targetChannels:a().int().positive(),targetFormat:Gl.optional(),idleMs:a().int().positive().optional(),tag:l().optional()}),Jl=d({codec:l(),sourceSampleRate:a().int().positive(),sourceChannels:a().int().positive(),sourceFormat:Gl.optional(),targetSampleRate:a().int().positive(),targetChannels:a().int().positive(),bitrateKbps:a().int().positive().optional(),idleMs:a().int().positive().optional(),tag:l().optional()}),Yl=d({data:v(Uint8Array),sampleRate:a().int().positive(),channels:a().int().positive(),format:Gl,pts:a()}),Xl=d({data:v(Uint8Array),codec:l(),pts:a(),frameComplete:x()}),Zl=d({sessionId:l(),kind:y([`decode`,`encode`]),codec:l(),sourceSampleRate:a(),sourceChannels:a(),targetSampleRate:a(),targetChannels:a(),format:Gl,tag:l().optional(),createdAtMs:a(),lastActivityMs:a(),framesIn:a(),framesOut:a()}),Ql={name:`audio-codec`,scope:`system`,mode:`singleton`,preferredProvider:`decoder-nodeav`,methods:{listSupportedCodecs:P(g(),b(Kl).readonly()),canHandle:P(d({codec:l(),kind:y([`decode`,`encode`])}),x()),createDecodeSession:P(ql,d({sessionId:l(),nodeId:l()}),{kind:`mutation`}),createEncodeSession:P(Jl,d({sessionId:l(),nodeId:l()}),{kind:`mutation`}),closeSession:P(d({sessionId:l(),nodeId:l().optional()}),g(),{kind:`mutation`}),pushEncodedFrame:P(d({sessionId:l(),nodeId:l().optional(),data:v(Uint8Array),pts:a().optional()}),g(),{kind:`mutation`}),pullPcm:P(d({sessionId:l(),nodeId:l().optional(),maxCount:a().int().positive().default(8)}),b(Yl)),pushPcm:P(d({sessionId:l(),nodeId:l().optional(),data:v(Uint8Array),pts:a().optional()}),g(),{kind:`mutation`}),pullEncoded:P(d({sessionId:l(),nodeId:l().optional(),maxCount:a().int().positive().default(8)}),b(Xl)),flushEncode:P(d({sessionId:l(),nodeId:l().optional()}),b(Xl),{kind:`mutation`}),listActiveSessions:P(g(),b(Zl).readonly())}},$l=d({userId:l(),username:l(),email:l().optional(),displayName:l().optional(),isAdmin:x().default(!1)}),eu={name:`auth-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{validateCredentials:P(d({username:l(),password:l()}),$l.nullable(),{kind:`mutation`}),getLoginUrl:P(d({state:l()}),l()),handleCallback:P(_(l(),l()),$l,{kind:`mutation`}),validateToken:P(d({token:l()}),$l.nullable())},mount:{kind:`skip`}},tu=d({subId:l(),displayName:l(),description:l().optional(),kind:l(),triggerSupported:x(),restoreSupported:x()}).extend({id:l(),addonId:l(),enabled:x(),retentionCount:a(),label:l().optional(),lastSuccessAt:a().optional(),lastSuccessSizeBytes:a().optional(),cron:l().optional(),nextRunAt:a().optional(),lastAttemptAt:a().optional(),lastError:l().optional()}),nu=d({id:l(),filename:l(),createdAt:a(),sizeBytes:a(),label:l().optional(),locations:b(l()).readonly()}),ru=d({id:l(),destinationId:l().optional(),label:l().optional(),createdAt:a(),sizeBytes:a(),locations:b(l()).optional()}),iu=d({path:l(),kind:y([`file`,`dir`,`symlink`]),sizeBytes:a(),mtime:a()}),au=d({archiveVersion:m(1),createdAt:a(),dataDir:l(),locations:b(l()),entries:b(iu),totalBytes:a(),totalFiles:a()}),ou=d({name:l(),sizeBytes:a(),fileCount:a(),present:x()}),su=y([`queued`,`running`,`succeeded`,`failed`,`cancelled`]),cu=y([`queued`,`building`,`uploading`,`done`]),lu=d({id:l(),state:su,phase:cu,destinationIds:b(l()).readonly(),label:l().optional(),requestedAt:a(),startedAt:a().optional(),finishedAt:a().optional(),stagedBytes:a(),archiveSizeBytes:a().optional(),uploadedBytes:a(),completedDestinationIds:b(l()).readonly(),failedDestinationIds:b(l()).readonly(),error:l().optional(),queuePosition:a().int().min(1).optional()}),uu=d({runId:l(),queued:x(),joined:x(),cancelled:x(),entries:b(ru).readonly()}),du=d({id:l(),label:l(),cron:l(),enabled:x(),locationIds:b(l()).readonly(),retentionCount:a().int().min(1).max(1e3),dataSources:b(l()).readonly().optional(),lastAttemptAt:a().optional(),lastSuccessAt:a().optional(),lastError:l().optional(),nextRunAt:a().optional()}),fu={name:`backup`,scope:`system`,mode:`singleton`,methods:{listDestinations:P(g(),b(tu).readonly(),{auth:`admin`}),trigger:P(d({destinations:b(l()).optional(),locations:b(l()).optional(),label:l().optional(),retentionCount:a().int().min(1).max(1e3).optional()}).optional(),uu,{kind:`mutation`,auth:`admin`}),listRuns:P(g(),b(lu).readonly(),{auth:`admin`}),cancel:P(d({runId:l()}),d({cancelled:x()}),{kind:`mutation`,auth:`admin`}),list:P(g(),b(ru).readonly(),{auth:`admin`}),listLocations:P(g(),b(ou).readonly(),{auth:`admin`}),getEntries:P(d({destinationId:l(),backupId:l()}),au.nullable(),{auth:`admin`}),restore:P(d({destinationId:l(),backupId:l(),locations:b(l()).optional()}),g(),{kind:`mutation`,auth:`admin`}),delete:P(d({destinationId:l(),backupId:l()}),g(),{kind:`mutation`,auth:`admin`}),listArchives:P(d({destinationId:l()}),b(nu).readonly(),{auth:`admin`}),upsertDestinationPolicy:P(d({locationId:l(),enabled:x(),retentionCount:a().int().min(1).max(1e3),label:l().optional()}),g(),{kind:`mutation`,auth:`admin`}),previewSchedule:P(d({cron:l(),count:a().int().min(1).max(20).optional()}),d({ok:x(),error:l().optional(),nextRuns:b(a()).readonly()})),listSchedules:P(g(),b(du).readonly(),{auth:`admin`}),upsertSchedule:P(d({id:l().optional(),label:l(),cron:l(),enabled:x(),locationIds:b(l()).readonly(),retentionCount:a().int().min(1).max(1e3),dataSources:b(l()).readonly().optional()}),du,{kind:`mutation`,auth:`admin`}),deleteSchedule:P(d({id:l()}),g(),{kind:`mutation`,auth:`admin`})}},pu=y([`connected`,`disconnected`,`connecting`,`auth-failed`,`unreachable`,`error`]),mu=d({id:l(),addonId:l(),name:l(),kind:l(),status:pu,info:_(l(),s()),lastCheckedAt:a().nullable(),error:l().nullable()}),hu=d({brokerCount:a().int().nonnegative(),connectedCount:a().int().nonnegative()}),gu=d({addonId:l(),kinds:b(d({kind:l(),label:l()}))}),_u=d({kind:l().optional()}),vu=d({id:l()}),yu=d({kind:l().min(1),name:l().min(1),id:l().min(1).optional(),settings:_(l(),s())}),bu=d({id:l()}),xu=d({id:l()}),Su=p(`ok`,[d({ok:m(!0),latencyMs:a().nonnegative()}),d({ok:m(!1),error:l()})]),Cu=_(l(),s()),wu=d({kind:l()}),Tu=d({kind:l(),settings:Cu}),Eu=p(`ok`,[d({ok:m(!0),latencyMs:a().nonnegative().optional()}).strict(),d({ok:m(!1),error:l()})]),Du=s().nullable(),Ou=d({brokerId:l(),target:_(l(),s()),payload:s().optional()}),ku=d({brokerId:l(),filter:_(l(),s())}),Au=d({subscriptionId:l()}),ju=d({brokerId:l(),subscriptionId:l()}),Mu=d({brokerId:l(),key:l()}),Nu={name:`broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:hu,kind:`poll`},methods:{list:P(_u,b(mu)),get:P(vu,mu.nullable()),listProviders:P(g(),b(gu),{auth:`admin`}),add:P(yu,bu,{kind:`mutation`,auth:`admin`}),remove:P(xu,g(),{kind:`mutation`,auth:`admin`}),testConnection:P(vu,Su,{kind:`mutation`,auth:`admin`}),getSettings:P(vu,Cu.nullable(),{auth:`admin`}),setSettings:P(d({id:l(),settings:Cu}),g(),{kind:`mutation`,auth:`admin`}),getBrokerConfig:P(vu,Cu.nullable(),{auth:`admin`}),getSettingsSchema:P(wu,Du,{auth:`admin`}),testSettings:P(Tu,Eu,{kind:`mutation`,auth:`admin`}),publish:P(Ou,s(),{kind:`mutation`,auth:`admin`}),subscribe:P(ku,Au,{kind:`mutation`,auth:`admin`}),unsubscribe:P(ju,g(),{kind:`mutation`,auth:`admin`}),getState:P(Mu,s().nullable(),{auth:`admin`}),getStatus:P(g(),hu)}},Pu={name:`camera-pipeline-config`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[L.Camera],exposesDeviceSettings:!0,methods:{}},Fu=y([`webrtc`,`hls`,`mjpeg`,`rtsp`]),Iu=y([`mp4`,`gif`]),Lu=d({kind:Iu,handle:l(),nodeId:l(),mime:l(),bytes:a().int(),width:a().int(),height:a().int()}),Ru=d({fromTs:a(),toTs:a(),packets:a().int()}),zu=d({media:b(Lu).readonly(),coverage:Ru,profile:C,video:y([`copy`,`encode`])}),Bu=d({brokerId:l(),url:l(),mutedUrl:l(),enabled:x(),codec:l().optional(),resolution:d({width:a().int().positive(),height:a().int().positive()}).optional()}),Vu=d({sessionId:l(),remoteAddr:l(),userAgent:l().nullish(),playing:x(),muted:x(),connectedAt:a(),lastRtpAt:a(),bytesSent:a()}),Hu=d({tag:l(),subscribedAt:a(),maxFps:a(),framesDelivered:a(),framesDropped:a()}),Uu=d({tag:l(),subscribedAt:a(),chunksDelivered:a()}),Wu=y([`alexa`,`homekit`,`webrtc-browser`,`webrtc-mobile`,`webrtc-whep`,`rtsp-listen`,`derived-broker`,`recording`,`pipeline`,`snapshot`,`warmup`,`unknown`]),Gu=d({kind:Wu,label:l().optional(),media:y([`audio`,`video`,`both`]).optional(),targetCodec:l().optional(),transport:y([`passthrough`,`repacketize`,`transcode`]).optional(),remoteAddr:l().optional(),userAgent:l().optional(),userId:l().optional(),sessionId:l().optional(),extra:_(l(),l()).optional()}).readonly(),Ku=d({id:l(),channel:y([`annexb`,`rtp`]),attribution:Gu,subscribedAt:a(),packetsDelivered:a()}),qu=d({rtsp:b(Vu).readonly(),decoded:b(Hu).readonly(),audio:b(Uu).readonly(),encoded:b(Ku).readonly(),pipeClients:a(),encodedSubscribers:a()}),Ju=y([`reconnecting`,`sleeping`,`offline`,`disabled`,`waking`]),Yu=y([`h264`,`h265`,`copy`]),Xu=y([`aac`,`opus`,`pcmu`,`copy`,`none`]),Zu=d({deviceId:a().int().nonnegative(),video:Yu,audio:Xu.optional(),profile:C.optional(),targetResolution:d({width:a().int().positive(),height:a().int().positive()}).optional(),outputArgs:b(l()).optional(),audioEgress:x().optional(),hostname:l().optional(),tag:l().optional()}),Qu=d({url:l(),sentryUrl:l().nullable().optional(),videoCodec:y([`H264`,`H265`]),audioCodec:l(),resolution:d({width:a().int().positive(),height:a().int().positive()}),transcoded:x(),encoder:l(),pipelineKey:l()}),$u=mt.omit({inputArgs:!0,outputArgs:!0}),ed=y([`tight`,`relaxed`]),td=d({deviceId:a().int().nonnegative(),source:p(`kind`,[d({kind:m(`profile`),profile:C}),d({kind:m(`cam-stream`),camStreamId:l().min(1)})]),encode:$u,rateControl:ed.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:l().optional(),tag:l().optional()}),nd=d({url:l(),pipelineKey:l(),videoCodec:y([`H264`,`H265`]),resolution:d({width:a().int().positive(),height:a().int().positive()}),transcoded:x(),encoder:l(),decodeHwAccel:l().nullable(),camStreamId:l().nullable()}),rd={name:`stream-broker`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{reportStreamSignal:P(d({deviceId:a().int().nonnegative(),code:l().min(1),at:a().optional()}),d({accepted:x(),reason:y([`woke`,`hold-extended`,`not-enabled`,`no-consumer`,`unknown-code`])}),{kind:`mutation`}),publishCameraStream:P(d({deviceId:a().int().nonnegative(),camStreamId:l().min(1),kind:Lr,url:l().optional(),codec:l().optional(),resolution:Rr.optional(),fps:a().positive().optional(),label:l().optional(),deviceFeatures:b(l()).optional(),autoEligible:x().optional(),profileHint:C.optional(),metadata:_(l(),s()).optional(),sourceCamStreamId:l().min(1).optional(),encodeProfile:mt.optional()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),retractCameraStream:P(d({deviceId:a().int().nonnegative(),camStreamId:l().min(1)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),assignProfile:P(d({deviceId:a().int().nonnegative(),profile:C,camStreamId:l().min(1)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),unassignProfile:P(d({deviceId:a().int().nonnegative(),profile:C}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),forgetDeviceHardware:P(d({deviceId:a().int().nonnegative()}),d({derivedStreamsDeleted:b(l()).readonly(),assignmentsPurged:x(),probeSnapshotsDropped:a().int().nonnegative(),rtspTokenRowsDeleted:a().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),renderPreBufferClip:P(d({deviceId:a(),profile:C.optional(),aroundMs:a(),preRollSec:a().min(0).max(20).default(3),postRollSec:a().min(0).max(20).default(5),format:y([`gif`,`mp4`]).default(`gif`),maxWidth:a().int().min(120).max(1920).default(480),fps:a().int().min(1).max(15).default(5),speed:a().min(1).max(8).default(2)}),d({base64:l(),mime:l(),bytes:a().int(),profile:C,durationMs:a()}),{kind:`mutation`,auth:`admin`}),produceEventMedia:P(d({deviceId:a(),profile:C.optional(),aroundMs:a(),preSeconds:a().min(0).max(20).default(4),postSeconds:a().min(0).max(20).default(6),kinds:b(Iu).min(1).default([`mp4`]),gifMaxWidth:a().int().min(120).max(1280).default(640),gifFps:a().int().min(1).max(15).default(12),gifSpeed:a().min(1).max(8).default(4),speed:a().min(1).max(8).default(4)}),zu,{kind:`mutation`,auth:`admin`}),fetchEventMedia:P(d({handle:l()}),d({base64:l(),mime:l(),bytes:a().int()}).nullable(),{kind:`mutation`,auth:`admin`}),listAllCameraStreams:P(g(),b(zr).readonly()),listAllProfileSlots:P(g(),b(Vr).readonly()),getBrokerStats:P(d({brokerId:l()}),ii),probeStream:P(d({brokerId:l()}),d({probed:x(),summary:l()}),{kind:`mutation`,auth:`admin`}),listClients:P(d({brokerId:l()}),qu),killClient:P(d({brokerId:l(),channel:y([`rtsp`,`decoded`,`audio`]),handle:l()}),d({killed:x()}),{kind:`mutation`,auth:`admin`}),restartProfile:P(d({deviceId:a().int().nonnegative(),profile:C}),d({success:x()}),{kind:`mutation`,auth:`admin`}),getStreamUrl:P(d({streamId:l(),format:Fu}),d({url:l()})),getStreamWithCodec:P(Zu,Qu,{kind:`mutation`,auth:`admin`}),releaseStreamWithCodec:P(d({pipelineKey:l()}),d({released:x(),refcount:a().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),acquireEgressTranscode:P(td,nd,{kind:`mutation`,auth:`admin`}),releaseEgressTranscode:P(d({pipelineKey:l()}),d({released:x(),refcount:a().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),subscribeAudioChunks:P(ti,ni,{kind:`mutation`}),pullAudioChunks:P(d({subscriptionId:l(),maxCount:a().int().positive().default(8)}),b(ei).readonly()),unsubscribeAudioChunks:P(d({subscriptionId:l()}),d({released:x()}),{kind:`mutation`}),subscribeFrames:P(Zr,Qr,{kind:`mutation`}),pullFrameHandles:P(d({subscriptionId:l(),maxCount:a().int().positive().default(4)}),b(w).readonly()),unsubscribeFrames:P(d({subscriptionId:l()}),d({released:x()}),{kind:`mutation`}),setPreBufferDuration:P(d({brokerId:l(),seconds:a().min(0).max(30)}),g(),{kind:`mutation`,auth:`admin`}),getPreBufferInfo:P(d({brokerId:l()}),d({configuredSec:a(),bufferedMs:a(),packetCount:a()})),getRtspPort:P(g(),a()),getAllRtspEntries:P(d({hostname:l().optional()}),b(Bu).readonly()),getRtspEntry:P(d({brokerId:l(),hostname:l().optional()}),Bu.nullable()),regenerateRtspToken:P(d({brokerId:l()}),l().nullable(),{kind:`mutation`,auth:`admin`}),setRtspEnabled:P(d({brokerId:l(),enabled:x()}),g(),{kind:`mutation`,auth:`admin`}),isRtspEnabled:P(d({brokerId:l()}),x()),getDeviceAudioMute:P(d({deviceId:a().int()}),d({muted:x(),appliedBrokers:a().int().nonnegative()})),setDeviceAudioMute:P(d({deviceId:a().int(),muted:x()}),d({muted:x(),appliedBrokers:a().int().nonnegative()}),{kind:`mutation`,auth:`admin`})},events:{onCamStreamDemand:F(d({deviceId:a().int().nonnegative(),camStreamId:l(),profile:C})),onCamStreamIdle:F(d({deviceId:a().int().nonnegative(),camStreamId:l()})),onRequestStreamSourceRefresh:F(d({deviceId:a().int().nonnegative(),camStreamId:l(),brokerId:l()}))}},id=y([`h264`,`h265`,`hevc`,`av1`,`mjpeg`,`vp8`,`vp9`]),ad=d({acceptCodecs:b(id).readonly().optional(),minHeight:a().int().positive().optional(),maxHeight:a().int().positive().optional(),minWidth:a().int().positive().optional(),excludeDerived:x().optional(),requireSiblingCodec:b(id).readonly().optional(),allowTranscode:x().optional(),requireProfileBound:x().optional()}).readonly(),od=d({preferredProviders:b(l()).readonly().optional(),resolutionPreference:y([`highest`,`lowest`]).optional(),targetHeight:a().int().positive().optional()}).readonly(),sd=d({camStreamId:l(),codec:l().optional(),resolution:Rr.optional(),transcodes:x(),reason:l(),profile:C.optional(),brokerId:l().optional(),url:l().optional(),fps:a().positive().optional(),fpsSource:y([`published`,`measured`]).optional()}),cd={name:`camera-streams`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[L.Camera],methods:{getCameraStreams:P(d({deviceId:a().int().nonnegative()}),b(zr).readonly()),getBrokerStreams:P(d({deviceId:a().int().nonnegative()}),b(Vr).readonly()),getRtspEntries:P(d({deviceId:a().int().nonnegative(),hostname:l().optional()}),b(Bu).readonly()),getProfileRtspEntries:P(d({deviceId:a().int().nonnegative(),hostname:l().optional()}),b(ai).readonly()),pickStream:P(d({deviceId:a().int().nonnegative(),requirements:ad,preferences:od.optional()}),sd.nullable())},events:{onCamStreamsChanged:F(d({deviceId:a().int().nonnegative(),camStreams:b(zr).readonly()})),onProfileSlotsChanged:F(d({deviceId:a().int().nonnegative(),profileSlots:b(Vr).readonly()}))},runtimeState:d({online:x(),slotStatuses:d({high:Br.optional(),mid:Br.optional(),low:Br.optional()}),slotErrors:d({high:l().optional(),mid:l().optional(),low:l().optional()}),lastChangedAt:a()}),durability:`session`};function ld(e){let t=Bc(e).kind;return t===`collection`?!0:t===`skip`&&e.mode===`collection`}function ud(e){let t=e._def;return e.constructor?.name===`ZodVoid`||t?.type===`void`||t?.typeName===`ZodVoid`}function dd(e){let t=e._def;return e.constructor?.name===`ZodObject`||t?.type===`object`||t?.typeName===`ZodObject`}function fd(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 pd(e,t){if(e===void 0||e.mode!==`collection`)return!1;let n=Kc(e)[t];return n!==void 0&&n.kind!==`subscription`&&fd(n.output)}function md(e){let t=e.loose;return typeof t==`function`?t.call(e):e}function hd(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 gd(e){if(e===null||typeof e!=`object`&&typeof e!=`function`)return!1;let t=e.shape??vd(e._def?.shape);return typeof t==`object`&&!!t&&Object.prototype.hasOwnProperty.call(t,`addonId`)}function _d(e){if(e===null||typeof e!=`object`&&typeof e!=`function`)return!1;let t=e.shape??vd(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 vd(e){return typeof e==`function`?e():e}function yd(e,t){return t.auth===void 0?e.internal===!0?`admin`:`protected`:t.auth}function bd(e){return e===`public`?`public`:e===`admin`||e===`superAdmin`?`admin`:`protected`}function xd(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}var Sd=`composer`,Cd=`composed-`,wd=2e4,Td=d({addonId:l().min(1),stableId:l().min(1)}),Ed=d({source:Td,cap:l().min(1),fieldPath:l().min(1)}),Dd=Ed.extend({kind:m(`from`)}),Od=d({kind:m(`literal`),value:f([l(),a(),x(),ae()])}),kd=p(`kind`,[Dd,Od]),Ad=d({kind:m(`expression`),expr:l().min(1).max(Ps),bindings:_(l().regex(Is),kd)}).superRefine((e,t)=>{let n=fc(e);n!==null&&t.addIssue({code:`custom`,message:n,path:[`expr`]})}),jd=d({kind:m(`code`),code:l().min(1).max(wd)}),Md=p(`kind`,[Dd,Ad,jd]),Nd=d({kind:m(`forward`),source:Td,cap:l().min(1),method:l().min(1)}),Pd=p(`kind`,[Nd,jd]),Fd=d({kind:m(`fields`),cap:l().min(1),fields:_(l().min(1),Md).refine(e=>Object.keys(e).length<=32,{message:`at most 32 fields per capability`}),commands:_(l().min(1),Pd).optional()}),Id=d({kind:m(`passthrough`),cap:l().min(1),source:Td}),Ld=p(`kind`,[Fd,Id]),Rd=d({kind:m(`new`),type:y(L),role:y(R).optional()}),zd=d({kind:m(`existing`),device:Td}),Bd=p(`kind`,[Rd,zd]),Vd=d({target:Bd,features:b(Ld).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 B(e){return`${e.addonId}/${e.stableId}`}function Hd(e,t){return`${B(e)}#${t}`}function Ud(e){return`${Hd(e.source,e.cap)}.${e.fieldPath}`}function Wd(e){return`${Cd}${e}`}function Gd(e){return{addonId:Sd,stableId:Wd(e)}}function Kd(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[]}}var qd=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`]),Jd=d({code:qd,path:l(),message:l()}),Yd=y([`string`,`number`,`boolean`,`enum`]),Xd=y([`null`,`offline`]),Zd=y([`derived`,`clock`,`constant`]),Qd=d({cap:l(),path:l(),featureIndex:a().int().nonnegative(),kind:Yd,nullable:x(),required:x(),unavailable:Xd,role:Zd,source:Md,reads:b(Ed)}),$d=d({ok:x(),problems:b(Jd),fields:b(Qd)}),ef=y([`stopped`,`starting`,`running`,`failed`]),tf=y([`fresh`,`stale`,`unavailable`]),nf=d({cap:l(),path:l(),state:tf,value:f([l(),a(),x(),ae()]),reason:l().optional()}),rf=d({blockId:l(),deviceId:a().nullable(),status:ef,reason:l().optional(),fields:b(nf)}),af=`core-block-`,of=`core-blocks`;function sf(e){return`${af}${e}`}function cf(e){if(!e.startsWith(`core-block-`))return null;let t=e.slice(11);return t.length>0?t:null}var lf=f([m(`hub`),l().min(1)]),uf=y([`stopped`,`starting`,`running`,`failed`]),df=d({name:l().min(1).max(120),code:l().max(2e5),enabled:x(),placement:lf,integrationId:l().optional()}),ff=p(`kind`,[d({kind:m(`code`)}),d({kind:m(`recipe`),recipe:Tc}),d({kind:m(`composition`),composition:Vd})]),pf=d({name:l().min(1).max(120),enabled:x(),composition:Vd}),V=df.extend({id:l(),createdAt:a(),updatedAt:a(),createdBy:l(),status:uf,lastError:l().optional(),lastChangedAt:a(),source:ff.optional()});function mf(e){return e.source?.kind??`code`}function hf(e){return e.source?.kind===`composition`?e.source.composition:null}var gf=p(`kind`,[d({kind:m(`answered`),state:rf.nullable()}),d({kind:m(`unreachable`),error:l()})]),_f=d({block:V,state:gf}),vf=d({state:m(`not-loaded`),reason:l()}),yf=p(`state`,[d({state:m(`loaded`),views:b(_f)}),vf]),bf=p(`state`,[d({state:m(`loaded`),view:_f.nullable()}),vf]),xf=d({ok:x(),error:l().optional(),line:a().optional(),column:a().optional()}),Sf={name:`core-blocks`,scope:`system`,mode:`singleton`,methods:{list:P(d({}),d({blocks:b(V)}),{auth:`admin`}),get:P(d({blockId:l()}),d({block:V.nullable()}),{auth:`admin`}),create:P(d({block:df}),d({block:V}),{kind:`mutation`,auth:`admin`,caller:`required`}),update:P(d({blockId:l(),block:df.partial()}),d({block:V}),{kind:`mutation`,auth:`admin`,caller:`required`}),delete:P(d({blockId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setEnabled:P(d({blockId:l(),enabled:x()}),d({block:V}),{kind:`mutation`,auth:`admin`}),restart:P(d({blockId:l()}),d({block:V}),{kind:`mutation`,auth:`admin`}),compile:P(d({code:l()}),xf,{kind:`mutation`,auth:`admin`}),getTypeDefs:P(d({}),d({libs:b(d({filePath:l(),content:l()}))}),{auth:`admin`}),createComposition:P(d({block:pf}),d({block:V}),{kind:`mutation`,auth:`admin`,caller:`required`}),updateComposition:P(d({blockId:l(),expectedUpdatedAt:a(),block:pf.partial()}),d({block:V}),{kind:`mutation`,auth:`admin`,caller:`required`}),getComposition:P(d({blockId:l()}),bf,{auth:`admin`}),listCompositions:P(d({}),yf,{auth:`admin`}),validateComposition:P(d({composition:Vd,blockId:l().optional()}),$d,{kind:`mutation`,auth:`admin`,access:`view`})}},Cf=Sd,wf=d({id:l().min(1),name:l().min(1).max(120),enabled:x(),updatedAt:a(),composition:Vd}),Tf=d({id:l().min(1),name:l().nullable(),error:l()}),Ef=d({integrationId:l().nullable(),storeLoaded:x(),blocks:b(wf),restartBlockIds:b(l()),unreadableBlocks:b(Tf)}),Df=d({blockId:l(),status:ef,reason:l().optional()}),Of=d({blocks:b(Df),acted:x()}),kf={name:`composer`,scope:`system`,mode:`singleton`,internal:!0,methods:{applyBlocks:P(Ef,Of,{kind:`mutation`,auth:`admin`}),getStates:P(d({blockIds:b(l())}),d({states:b(rf)}),{auth:`admin`})}};function Af(e){return e}function jf(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 Mf(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 Nf(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 Pf=d({stepId:l(),entry:_s}),Ff={name:`custom-model-registry`,scope:`system`,mode:`collection`,internal:!0,methods:{listModels:P(g(),b(Pf).readonly(),{auth:`admin`})}},H=d({where:_(l(),s()).optional(),whereIn:_(l(),b(s())).optional(),whereBetween:_(l(),u([s(),s()])).optional(),whereNot:_(l(),s()).optional(),whereNotIn:_(l(),b(s())).optional(),orderBy:d({field:l(),direction:y([`asc`,`desc`])}).optional(),limit:a().optional(),offset:a().optional()}),If=d({where:_(l(),s()).optional(),whereIn:_(l(),b(s())).optional(),whereBetween:_(l(),u([s(),s()])).optional(),whereNot:_(l(),s()).optional(),whereNotIn:_(l(),b(s())).optional()}),Lf=d({as:l().min(1),field:l().min(1),op:y([`sum`,`min`,`max`])}),Rf=d({count:a().int(),values:_(l(),a().nullable())}),zf=d({id:l(),data:_(l(),s())}),Bf=d({id:l().optional(),data:_(l(),s())}),Vf=d({name:l(),type:y([`TEXT`,`INTEGER`,`REAL`,`JSON`,`BOOLEAN`]),primaryKey:x().optional(),notNull:x().optional(),unique:x().optional(),defaultValue:f([l(),a(),x()]).optional()}),Hf=d({name:l(),columns:b(l()).readonly(),unique:x().optional()}),Uf={name:`settings-store`,scope:`system`,mode:`singleton`,methods:{get:P(d({namespace:l().optional(),collection:l(),key:l()}),s(),{auth:`admin`}),set:P(d({namespace:l().optional(),collection:l(),key:l(),value:s()}),g(),{kind:`mutation`,auth:`admin`}),query:P(d({namespace:l().optional(),collection:l(),filter:H.optional(),columns:b(l()).readonly().optional()}),b(zf).readonly(),{auth:`admin`}),upsert:P(d({namespace:l().optional(),collection:l(),conflict:b(l()).readonly(),record:Bf}),d({id:f([l(),a()])}),{kind:`mutation`,auth:`admin`}),insert:P(d({namespace:l().optional(),collection:l(),record:d({id:l().optional(),data:_(l(),s())})}),d({id:f([l(),a()])}),{kind:`mutation`,auth:`admin`}),insertMany:P(d({namespace:l().optional(),collection:l(),records:b(Bf).readonly()}),d({inserted:a().int()}),{kind:`mutation`,auth:`admin`}),update:P(d({namespace:l().optional(),collection:l(),id:l(),data:_(l(),s())}),g(),{kind:`mutation`,auth:`admin`}),delete:P(d({namespace:l().optional(),collection:l(),key:l()}),g(),{kind:`mutation`,auth:`admin`}),deleteWhere:P(d({namespace:l().optional(),collection:l(),filter:If}),d({deleted:a().int()}),{kind:`mutation`,auth:`admin`}),updateWhere:P(d({namespace:l().optional(),collection:l(),filter:If,data:_(l(),s())}),d({updated:a().int()}),{kind:`mutation`,auth:`admin`}),count:P(d({namespace:l().optional(),collection:l(),filter:H.optional()}),a(),{auth:`admin`}),aggregate:P(d({namespace:l().optional(),collection:l(),fields:b(Lf).readonly(),filter:H.optional()}),Rf,{auth:`admin`}),histogram:P(d({namespace:l().optional(),collection:l(),field:l(),bucketSize:a().int().positive(),origin:a().int(),filter:H.optional()}),b(d({bucket:a().int(),count:a().int()})).readonly(),{auth:`admin`}),isEmpty:P(d({namespace:l().optional(),collection:l()}),x(),{auth:`admin`}),declareCollection:P(d({namespace:l().optional(),collection:l(),columns:b(Vf).readonly(),indexes:b(Hf).readonly().optional()}),g(),{kind:`mutation`,auth:`admin`})}},Wf=d({engineId:l(),kind:y([`relational`,`vector`]),displayName:l()}),Gf={name:`data-store-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getEngineInfo:P(g(),Wf,{auth:`admin`}),get:P(d({namespace:l().optional(),collection:l(),key:l()}),s(),{auth:`admin`}),set:P(d({namespace:l().optional(),collection:l(),key:l(),value:s()}),g(),{kind:`mutation`,auth:`admin`}),query:P(d({namespace:l().optional(),collection:l(),filter:H.optional(),columns:b(l()).readonly().optional()}),b(zf).readonly(),{auth:`admin`}),insert:P(d({namespace:l().optional(),collection:l(),record:d({id:l().optional(),data:_(l(),s())})}),d({id:f([l(),a()])}),{kind:`mutation`,auth:`admin`}),upsert:P(d({namespace:l().optional(),collection:l(),conflict:b(l()).readonly(),record:Bf}),d({id:f([l(),a()])}),{kind:`mutation`,auth:`admin`}),insertMany:P(d({namespace:l().optional(),collection:l(),records:b(Bf).readonly()}),d({inserted:a().int()}),{kind:`mutation`,auth:`admin`}),update:P(d({namespace:l().optional(),collection:l(),id:l(),data:_(l(),s())}),g(),{kind:`mutation`,auth:`admin`}),delete:P(d({namespace:l().optional(),collection:l(),key:l()}),g(),{kind:`mutation`,auth:`admin`}),deleteWhere:P(d({namespace:l().optional(),collection:l(),filter:If}),d({deleted:a().int()}),{kind:`mutation`,auth:`admin`}),updateWhere:P(d({namespace:l().optional(),collection:l(),filter:If,data:_(l(),s())}),d({updated:a().int()}),{kind:`mutation`,auth:`admin`}),count:P(d({namespace:l().optional(),collection:l(),filter:H.optional()}),a(),{auth:`admin`}),aggregate:P(d({namespace:l().optional(),collection:l(),fields:b(Lf).readonly(),filter:H.optional()}),Rf,{auth:`admin`}),histogram:P(d({namespace:l().optional(),collection:l(),field:l(),bucketSize:a().int().positive(),origin:a().int(),filter:H.optional()}),b(d({bucket:a().int(),count:a().int()})).readonly(),{auth:`admin`}),isEmpty:P(d({namespace:l().optional(),collection:l()}),x(),{auth:`admin`}),declareCollection:P(d({namespace:l().optional(),collection:l(),columns:b(Vf).readonly(),indexes:b(Hf).readonly().optional()}),g(),{kind:`mutation`,auth:`admin`})}},Kf=[{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)`}],qf={hwaccel:`auto`,probedBestHwaccel:``},Jf=d({sessionId:l(),slotCount:a().int(),slotByteLength:a().int(),segmentBytes:a().int(),budgetMb:a().int(),framesWritten:a().int(),getFrameHits:a().int(),getFrameMisses:a().int()}),Yf={name:`decoder`,scope:`system`,mode:`singleton`,preferredProvider:`decoder-nodeav`,methods:{supportsCodec:P(d({codec:l()}),x()),getInfo:P(g(),d({id:l(),name:l(),isPullMode:x().optional(),priority:a().optional(),hwaccel:l().optional(),probedBestHwaccel:l().optional()})),createSession:P(Xa,d({sessionId:l(),nodeId:l()})),destroySession:P(d({sessionId:l()}),g()),pushPacket:P(d({sessionId:l(),packet:Jr}),g()),openStream:P(d({sessionId:l(),url:l()}),g()),pullFrames:P(d({sessionId:l(),maxCount:a().default(1),waitMs:a().optional()}),b(Yr)),pullHandles:P(d({sessionId:l(),maxCount:a().default(1),waitMs:a().optional()}),b(w)),getFrame:P(d({handle:w}),Yr.nullable()),getShmStats:P(d({sessionId:l()}),Jf.nullable()),updateConfig:P(d({sessionId:l(),config:Xa.partial()}),g()),getStats:P(d({sessionId:l()}),Ya),listActiveSessions:P(g(),b(d({sessionId:l(),codec:l(),outputFormat:l(),createdAtMs:a()})).readonly()),reprobeHwaccel:P(g(),d({backend:l()}),{kind:`mutation`,auth:`admin`})}},Xf={name:`detection-pipeline`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[L.Camera],exposesDeviceSettings:!0,methods:{}},Zf=y([`device`,`integration`]),Qf=d({url:l(),label:l(),target:Zf,host:l()}),$f={name:`device-admin-link`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{getAdminLink:P(d({deviceId:a().int().nonnegative()}),Qf.nullable(),{auth:`admin`})}},ep=[`password`,`passwd`,`pwd`,`pass`,`user`,`username`,`usr`,`login`,`token`,`access_token`,`auth`,`authorization`,`apikey`,`api_key`,`secret`,`credential`,`credentials`,`session`,`sessionid`,`key`],tp=/[a-z][a-z0-9+.-]*:\/\/[^/\s:@'"]+:[^/\s:@'"]+@/i,np=/^[a-zA-Z0-9._-]+$/,rp=/^\[[0-9a-fA-F:.]+\]$/;function ip(e){return e===`https`?443:80}function ap(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(!np.test(t)&&!rp.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(ep.includes(e.toLowerCase()))return{ok:!1,reason:`credential-query-key`};let r=e.port===null||e.port===ip(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 tp.test(o)?{ok:!1,reason:`userinfo-in-result`}:{ok:!0,url:o}}function op(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 sp=d({id:l(),system:l(),uniqueId:l().optional(),raw:_(l(),s()).optional()});function cp(e){return{id:e.stableId,system:e.addonId}}function lp(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 up(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 dp=`sourceInfo`;function fp(e){if(!e)return null;let t=e[dp];if(!t)return null;let n=sp.safeParse(t);return n.success?n.data:null}var pp=y([`online`,`sleeping`,`offline`,`unknown`]),mp=he(()=>d({childNativeId:l(),name:l(),type:y(L),status:pp,metadata:d({model:l().optional(),serialNumber:l().optional(),uid:l().optional(),rtspChannel:a().int().nonnegative().optional(),isBattery:x().optional(),isDoorbell:x().optional(),isMultifocal:x().optional(),externalLocation:l().optional(),manufacturer:l().optional(),integration:l().optional()}).default({}),alreadyAdopted:x(),adoptedDeviceId:a().int().nonnegative().nullable(),capabilities:b(l()).readonly().optional(),features:b(l()).readonly().optional(),sourceInfo:sp.optional(),children:b(mp).readonly().optional()})),hp=d({discovered:b(mp),lastDiscoveryAt:a().int().nonnegative().nullable(),lastError:l().nullable()}),gp={name:`device-discovery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Hub],status:{schema:hp,kind:`poll`},runtimeState:hp.extend({lastFetchedAt:a().int().nonnegative()}),durability:`session`,methods:{listDiscovered:P(d({deviceId:a().int().nonnegative()}),b(mp).readonly()),refreshDiscovery:P(d({deviceId:a().int().nonnegative()}),b(mp).readonly(),{kind:`mutation`,auth:`admin`}),adoptDevice:P(d({deviceId:a().int().nonnegative(),childNativeId:l(),name:l().optional()}),d({deviceId:a().int().nonnegative(),stableId:l()}),{kind:`mutation`,auth:`admin`}),releaseDevice:P(d({deviceId:a().int().nonnegative(),childDeviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`admin`})}},_p=d({id:l(),label:l(),isDefault:x().optional()}),vp=d({search:l().optional(),area:l().optional(),manufacturer:l().optional(),adoptedOnly:x().optional(),unadoptedOnly:x().optional()}),yp=d({integrationId:l(),page:a().int().positive().default(1),pageSize:a().int().positive().max(2e4).default(50),filter:l().optional(),filterText:vp.optional()}),bp=d({candidates:b(mp).readonly(),totalCount:a().int().nonnegative(),page:a().int().positive(),pageSize:a().int().positive()}),xp=d({integrationId:l(),childNativeId:l()}),Sp=d({lastDiscoveryAt:a().int().nonnegative().nullable(),candidateCount:a().int().nonnegative(),adoptedCount:a().int().nonnegative(),lastError:l().nullable()}),Cp=d({name:l().min(1).optional(),hiddenChildIds:b(l()).optional()}),wp=d({integrationId:l(),childNativeIds:b(l()).min(1),filter:l().optional(),importLocations:x().optional(),perCandidate:_(l(),Cp).optional()}),Tp=d({adopted:b(d({childNativeId:l(),parentDeviceId:a().int().nonnegative(),accessoryDeviceIds:b(a().int().nonnegative()).readonly()})).readonly()}),Ep=d({integrationId:l(),camDeviceId:a().int().nonnegative()}),Dp=d({camDeviceId:a().int().nonnegative(),resetToSource:x().optional()}),Op=d({changed:x(),rebuiltChildren:a().int().nonnegative(),removedChildren:a().int().nonnegative().optional()}),kp={name:`device-adoption`,scope:`system`,mode:`singleton`,status:{schema:Sp,kind:`poll`},methods:{listCandidateFilters:P(d({integrationId:l()}),d({filters:b(_p)}),{auth:`admin`}),listCandidates:P(yp,bp,{auth:`admin`}),getCandidate:P(xp,mp.nullable(),{auth:`admin`}),refresh:P(d({integrationId:l()}),Sp,{kind:`mutation`,auth:`admin`}),adopt:P(wp,Tp,{kind:`mutation`,auth:`admin`}),release:P(Ep,g(),{kind:`mutation`,auth:`admin`}),resync:P(Dp,Op,{kind:`mutation`,auth:`admin`})}},Ap=y([`unlinked`,`linked`,`error`]),jp=d({label:l(),value:l(),secret:x().optional()}),Mp=d({qr:l().optional(),fields:b(jp).readonly().optional(),note:l().optional()}),Np=d({linkState:Ap,exposedDeviceCount:a(),error:l().optional(),setup:Mp.optional()}),Pp=l(),Fp=d({deviceId:l(),exposedAs:l().optional(),capabilities:b(l()).optional()}),Ip=d({deviceId:l(),capabilities:b(l()).optional()}),Lp=d({deviceId:l()}),Rp={name:`device-export`,scope:`system`,mode:`collection`,providerKind:`device-export`,status:{schema:Np,kind:`poll`},exposesDeviceSettings:!0,methods:{getStatus:P(g(),Np),listSupportedDeviceKinds:P(g(),b(Pp)),listExposedDevices:P(g(),b(Fp)),exposeDevice:P(Ip,g(),{kind:`mutation`,auth:`admin`}),unexposeDevice:P(Lp,g(),{kind:`mutation`,auth:`admin`})}},zp=[`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`],Bp=`map-pin`,Vp=y(zp),Hp=d({locationKey:l(),icon:Vp});function Up(e){return e.trim().toLowerCase()}function Wp(e){let t=Vp.safeParse(e);return t.success?t.data:Bp}var Gp=d({locationKey:l(),description:l()}),Kp=d({zoneKey:l(),label:l(),icon:Vp.nullable(),locationKeys:b(l())});function qp(e){return e.trim().toLowerCase()}var Jp=d({connected:x(),deviceCount:a(),error:l().optional()}),Yp=d({externalId:l(),name:l(),type:l(),metadata:_(l(),s()).optional()}),Xp=d({stableId:l(),type:y(L),suggestedName:l(),prefilledConfig:_(l(),s()),sourceInfo:sp.optional(),alreadyOnboarded:x().optional(),onboardedDeviceId:a().optional(),onboardedName:l().optional()}),Zp=d({id:a(),stableId:l(),addonId:l(),type:l(),name:l(),parentDeviceId:a().nullable(),online:x(),features:b(l()),config:_(l(),s()),sourceInfo:sp.optional()}),Qp=d({status:y([`ok`,`error`]),labels:b(l()).optional(),error:l().optional()}),$p=s(),em={name:`device-provider`,scope:`system`,mode:`collection`,methods:{start:P(g(),g(),{kind:`mutation`}),stop:P(g(),g(),{kind:`mutation`}),getStatus:P(g(),Jp),getDevices:P(g(),b(d({id:l(),name:l(),type:l()}))),reloadDevice:P(d({stableId:l()}),d({deviceId:a()}),{kind:`mutation`,timeoutMs:3*6e4}),supportsDiscovery:P(d({}),x()),discoverDevices:P(d({params:_(l(),s()).optional()}),b(Xp),{kind:`mutation`,auth:`admin`}),getDiscoveryParamsSchema:P(d({}),$p),getManualCreationType:P(d({}),d({deviceType:y(L).nullable()})),adoptDiscoveredDevice:P(d({candidate:Xp}),Zp,{kind:`mutation`,auth:`admin`}),supportsManualCreation:P(d({}),x()),getChildCreationSchema:P(d({type:y(L)}),$p),createDevice:P(d({type:y(L),config:_(l(),s())}),Zp,{kind:`mutation`,auth:`admin`}),testCreationField:P(d({type:y(L),key:l(),value:s(),formValues:_(l(),s()).optional()}),Qp,{kind:`mutation`,auth:`admin`})}},tm=d({childKey:l(),section:l(),order:a().optional(),collapsed:x().optional()}),nm=d({unit:l().min(1).optional(),precision:a().int().min(0).max(10).optional()}),rm=d({icon:l().min(1).optional(),label:l().min(1).optional(),unit:l().min(1).optional(),precision:a().int().min(0).max(10).optional(),hidden:x().optional(),perCap:_(l(),nm).optional()}),im=d({unit:l().min(1).optional(),precision:a().int().min(0).max(10).optional(),icon:l().min(1).optional()}),am=d({id:a(),stableId:l(),addonId:l(),type:y(L),name:l(),location:l().nullable(),disabled:x(),parentDeviceId:a().nullable(),role:l().nullable().optional(),online:x(),probed:x().optional(),features:b(l()),isCamera:x(),config:_(l(),s()),metadata:_(l(),s()).nullable().optional(),sourceInfo:sp.optional(),integrationId:l().optional(),linkDeviceId:a().nullable().optional(),primaryChildEntityId:l().nullable().optional(),childLayout:b(tm).readonly().optional(),display:rm.optional()}),om=d({key:l(),value:s(),description:l().optional()}),sm=y([`manual`]),cm=d({deviceId:a(),name:l(),location:l().nullable(),features:b(l()),producesTrackedEvents:x().optional()}),lm=d({deviceIds:b(a().int().positive()),trackedDeviceIds:b(a().int().positive()).optional()}),um={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:[L.Camera],sourceCaps:`any`,cardinality:`many`,value:lm},dm=d({deviceId:a(),mode:sm,devices:b(cm)}),fm=d({deviceId:a(),entries:b(d({capName:l(),kind:y([`native`,`wrapped`]),providerAddonId:l(),providerNodeId:l(),nativeAddonId:l()}))}),pm=d({id:a(),stableId:l(),type:l(),name:l(),location:l().nullable(),disabled:x(),parentDeviceId:a().nullable(),role:l().nullable().optional()}),mm=d({id:a(),stableId:l(),addonId:l(),type:l(),name:l(),userNamed:x().optional(),location:l().nullable(),disabled:x(),parentDeviceId:a().nullable(),metadata:_(l(),s()).nullable().optional(),sourceInfo:sp.optional(),integrationId:l().optional(),linkDeviceId:a().nullable().optional(),primaryChildEntityId:l().nullable().optional(),childLayout:b(tm).readonly().optional(),role:l().nullable().optional(),display:rm.optional()}),hm=s().nullable(),gm=d({streamId:l(),width:a().optional(),height:a().optional(),codec:l().optional(),fps:a().optional(),bitrateKbps:a().optional()}),_m=d({addonId:l(),stableId:l(),id:a(),type:l(),name:l(),location:l().nullable().optional(),disabled:x().optional(),parentDeviceId:a().nullable(),role:l().nullable().optional(),features:b(l()).optional(),config:_(l(),s())}),vm=d({deviceId:a()}),ym=d({deviceId:a(),data:_(l(),s())}),bm=y([`off`,`on`,`not-offered`,`unreachable`]),xm=d({deviceId:a(),switchId:Rn,outcome:bm,detail:l().optional()}),Sm=d({sourceId:a(),targetId:a(),switches:b(xm).readonly(),sourceStillLive:b(Rn).readonly(),swapped:x()}),Cm={name:`device-manager`,scope:`system`,mode:`singleton`,extensionSlots:[um],methods:{allocateDeviceId:P(d({addonId:l(),stableId:l()}),d({id:a()}),{kind:`mutation`}),migrateDevice:P(d({sourceId:a(),targetId:a()}),Sm,{kind:`mutation`,auth:`admin`,timeoutMs:12*6e4}),registerDevice:P(_m,g(),{kind:`mutation`}),removeDevice:P(vm,g(),{kind:`mutation`}),persistConfig:P(ym,g(),{kind:`mutation`,auth:`admin`}),loadConfig:P(d({deviceId:a()}),_(l(),s()),{auth:`admin`}),loadRuntimeState:P(d({deviceId:a()}),_(l(),s()),{auth:`admin`}),loadMeta:P(d({deviceId:a()}),mm.nullable()),setName:P(d({deviceId:a(),name:l()}),g(),{kind:`mutation`,auth:`admin`}),setLocation:P(d({deviceId:a(),location:l().nullable()}),g(),{kind:`mutation`,auth:`admin`}),setType:P(d({deviceId:a(),type:y(L)}),g(),{kind:`mutation`,auth:`admin`}),setIntegrationId:P(d({deviceId:a(),integrationId:l()}),g(),{kind:`mutation`,auth:`admin`}),setLinkDeviceId:P(d({deviceId:a(),linkDeviceId:a().nullable()}),g(),{kind:`mutation`,auth:`admin`}),setPrimaryChildEntityId:P(d({deviceId:a(),primaryChildEntityId:l().nullable()}),g(),{kind:`mutation`,auth:`admin`}),setChildLayout:P(d({deviceId:a(),childLayout:b(tm).readonly()}),g(),{kind:`mutation`,auth:`admin`}),setDisplay:P(d({deviceId:a(),display:rm.nullable()}),g(),{kind:`mutation`,auth:`admin`}),getRoleDisplayDefaults:P(d({}),d({defaults:_(l(),im)}),{kind:`query`}),setRoleDisplayDefaults:P(d({defaults:_(l(),im)}),g(),{kind:`mutation`,auth:`admin`}),getWireableFields:P(d({deviceId:a(),includeSynthesizable:x().optional()}),d({caps:b(d({cap:l(),fields:b(d({path:l(),kind:y([`string`,`number`,`boolean`,`enum`]),enumValues:b(l()).optional(),item:x().optional()})).readonly(),itemArray:d({path:l(),keyField:l()}).optional()})).readonly()}),{kind:`query`}),setRole:P(d({deviceId:a(),role:l().nullable()}),g(),{kind:`mutation`,auth:`admin`}),applyInitialMeta:P(d({deviceId:a(),name:l().optional(),location:l().nullable().optional(),type:y(L).optional(),integrationId:l().optional(),linkDeviceId:a().nullable().optional(),role:l().nullable().optional()}),g(),{kind:`mutation`,auth:`admin`}),setMetadata:P(d({deviceId:a(),patch:_(l(),s())}),g(),{kind:`mutation`,auth:`admin`}),listLocations:P(g(),b(l())),addLocation:P(d({name:l()}),g(),{kind:`mutation`,auth:`admin`}),removeLocation:P(d({name:l(),cascade:x().optional()}),g(),{kind:`mutation`,auth:`admin`}),renameLocation:P(d({from:l(),to:l()}),d({moved:a()}),{kind:`mutation`,auth:`admin`}),listLocationIcons:P(g(),b(Hp)),setLocationIcon:P(d({location:l(),icon:Vp.nullable()}),g(),{kind:`mutation`,auth:`admin`}),listLocationDescriptions:P(g(),b(Gp)),setLocationDescription:P(d({location:l(),description:l().max(400).nullable()}),g(),{kind:`mutation`,auth:`admin`}),listSiteZones:P(g(),b(Kp)),setSiteZone:P(d({name:l(),icon:Vp.nullable().optional()}),g(),{kind:`mutation`,auth:`admin`}),removeSiteZone:P(d({name:l()}),g(),{kind:`mutation`,auth:`admin`}),renameSiteZone:P(d({from:l(),to:l()}),g(),{kind:`mutation`,auth:`admin`}),setLocationZone:P(d({location:l(),zone:l().nullable()}),g(),{kind:`mutation`,auth:`admin`}),setDisabled:P(d({deviceId:a(),disabled:x()}),g(),{kind:`mutation`,auth:`admin`}),listPersistedByAddon:P(d({addonId:l()}),b(pm)),listAll:P(d({addonId:l().optional(),projection:y([`full`,`slim`]).optional(),isCamera:x().optional(),deviceIds:b(a()).optional()}),b(am)),getDevice:P(d({deviceId:a()}),am.nullable()),getChildren:P(d({parentDeviceId:a()}),b(am)),getChildrenBatch:P(d({parentDeviceIds:b(a()).max(256)}),_(l(),b(am))),getLinkedDevices:P(d({deviceId:a()}),d({mode:sm,devices:b(cm)})),getLinkedDevicesBatch:P(d({deviceIds:b(a())}),b(dm)),getStreamSources:P(d({deviceId:a()}),b(Kr)),getConfigSchema:P(d({deviceId:a()}),b(om)),getSettingsSchema:P(d({deviceId:a()}),hm),updateConfig:P(d({deviceId:a(),values:_(l(),s())}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),enable:P(d({deviceId:a()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),disable:P(d({deviceId:a()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),remove:P(d({deviceId:a()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),removeByIntegration:P(d({integrationId:l()}),d({removed:a()}),{kind:`mutation`,auth:`admin`}),getStreamProfileMap:P(d({deviceId:a()}),_(l(),l().nullable())),setStreamProfileMap:P(d({deviceId:a(),profileMap:_(l(),l().nullable())}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),probeStreams:P(d({deviceId:a()}),b(gm),{kind:`mutation`,auth:`admin`}),getBindings:P(d({deviceId:a()}),fm),getBindingsBatch:P(d({deviceIds:b(a())}),b(fm)),getAllBindings:P(d({}),b(fm)),listDeviceIdsByCaps:P(d({capNames:b(l().min(1)).min(1).max(16)}),b(a())),setWrapperActive:P(d({deviceId:a(),capName:l(),wrapperAddonId:l(),active:x()}),g(),{kind:`mutation`,auth:`admin`}),listWrappersForCap:P(d({capName:l()}),b(l())),listBindableCapsForDeviceType:P(d({deviceType:l()}),b(d({capName:l(),wrappers:b(l())}))),getDeviceSettingsAggregate:P(d({deviceId:a()}),I.nullable()),getDeviceLiveInfoAggregate:P(d({deviceId:a()}),I.nullable()),getDeviceAggregate:P(d({deviceId:a()}),d({settings:I.nullable(),live:I.nullable()})),runDeviceAction:P(d({deviceId:a().int().nonnegative(),action:l().min(1),input:s()}),s(),{kind:`mutation`}),updateDeviceField:P(d({deviceId:a(),writerCapName:l(),writerAddonId:l(),key:l(),value:s()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),updateDeviceFieldsBatch:P(d({deviceId:a(),changes:b(d({writerCapName:l(),writerAddonId:l(),key:l(),value:s()}))}),d({success:m(!0),failures:b(d({writerCapName:l(),writerAddonId:l(),error:l()}))}),{kind:`mutation`,auth:`admin`}),discoverDevices:P(d({addonId:l()}),b(Xp),{kind:`mutation`,auth:`admin`}),adoptDevice:P(d({addonId:l(),candidate:Xp,integrationId:l().optional()}),Zp,{kind:`mutation`,auth:`admin`}),getCreationSchema:P(d({addonId:l(),type:y(L)}),s().nullable()),createDevice:P(d({addonId:l(),type:y(L),config:_(l(),s()),integrationId:l().optional()}),Zp,{kind:`mutation`,auth:`admin`}),testCreationField:P(d({addonId:l(),type:y(L),key:l(),value:s(),formValues:_(l(),s()).optional()}),Qp,{kind:`mutation`,auth:`admin`}),adoptionListCandidateFilters:P(d({addonId:l(),integrationId:l()}),d({filters:b(_p)}),{auth:`admin`}),adoptionListCandidates:P(yp.extend({addonId:l()}),bp,{auth:`admin`}),adoptionRefresh:P(d({addonId:l(),integrationId:l()}),Sp,{kind:`mutation`,auth:`admin`}),adoptionAdopt:P(wp.extend({addonId:l()}),Tp,{kind:`mutation`,auth:`admin`}),adoptionRelease:P(Ep.extend({addonId:l()}),g(),{kind:`mutation`,auth:`admin`}),adoptionStartJob:P(wp.extend({addonId:l()}),d({jobId:l()}),{kind:`mutation`,auth:`admin`}),adoptionListJobs:P(d({addonId:l(),integrationId:l().optional()}),b(In).readonly(),{auth:`admin`}),adoptionCancelJob:P(d({jobId:l()}),d({cancelled:x()}),{kind:`mutation`,auth:`admin`}),adoptionResync:P(Dp,Op,{kind:`mutation`,auth:`admin`}),discoveryProviders:P(d({}),d({providers:b(d({addonId:l(),label:l()})).readonly()}),{auth:`admin`}),discoverAllProviders:P(d({}),d({groups:b(d({addonId:l(),label:l(),candidates:b(Xp).readonly(),error:l().nullable()})).readonly()}),{kind:`mutation`,auth:`admin`}),discoverProvider:P(d({addonId:l(),params:_(l(),s()).optional()}),d({candidates:b(Xp).readonly()}),{kind:`mutation`,auth:`admin`}),providerCreationType:P(d({addonId:l()}),d({deviceType:y(L).nullable()}),{auth:`admin`}),providerDiscoveryParamsSchema:P(d({addonId:l()}),s(),{auth:`admin`}),testField:P(d({deviceId:a(),key:l(),value:s()}),Qp,{kind:`mutation`,auth:`admin`}),getDeviceStatusAggregate:P(d({deviceId:a(),caps:b(l()).readonly().optional()}),_(l(),s().nullable())),getDeviceStatusAggregateBatch:P(d({deviceIds:b(a()).readonly(),caps:b(l()).readonly().optional()}),_(l(),_(l(),s().nullable())))}},wm={name:`device-state`,scope:`system`,mode:`singleton`,methods:{getSnapshot:P(d({deviceId:a()}),_(l(),_(l(),s()))),getCapSlice:P(d({deviceId:a(),capName:l()}),_(l(),s()).nullable()),getAllSnapshots:P(d({}),_(l(),_(l(),_(l(),s())))),setCapSlice:P(d({deviceId:a(),capName:l(),slice:_(l(),s())}),g(),{kind:`mutation`})},events:{onChanged:F(d({deviceId:a(),capName:l(),slice:_(l(),s())}))}},Tm=d({embedding:b(a()),inferenceMs:a()}),Em=y([`image`,`text`]),Dm=d({modelId:l(),tower:Em,nodeId:l(),crashes:a(),windowMs:a(),sinceMs:a(),lastReason:l()}),Om=d({modelId:l(),tower:Em,nodeId:l(),attempts:a(),sinceMs:a(),lastReason:l()}),km=d({modelId:l(),embeddingDim:a(),ready:x(),nodeId:l().optional(),failedModels:b(Dm).optional(),failedRequirements:b(Om).optional()}),Am=`embedding-model-failed`,jm=`embedding-requirements-unavailable`,Mm=`embedding-requirements-failed`,Nm=y([Am,jm,Mm]);function Pm(e,t){return`[${e} model=${t.modelId} tower=${t.tower} node=${t.nodeId}]`}function Fm(e){return Error(`${Pm(Am,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 Im(e,t){return Error(`${Pm(jm,e)} ${e.modelId} (${e.tower} tower) on ${e.nodeId}: ${t}`)}function Lm(e){return Error(`${Pm(Mm,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 Rm=RegExp(`\\[(${Am}|${jm}|${Mm}) model=([^\\s\\]]+) tower=(image|text) node=([^\\s\\]]+)\\]`);function zm(e){let t=e instanceof Error?e.message:String(e),n=Rm.exec(t);if(n===null)return null;let r=Nm.safeParse(n[1]),i=Em.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 Bm(e){return Vm(e)!==null}function Vm(e){let t=zm(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 Hm={name:`embedding-encoder`,scope:`system`,mode:`collection`,internal:!0,methods:{encode:P(d({crop:v(Uint8Array),width:a(),height:a()}),Tm,{auth:`admin`}),encodeText:P(d({text:l(),modelId:l().min(1).optional()}),Tm,{auth:`admin`}),getInfo:P(g(),km,{auth:`admin`}),resetFailedModels:P(d({modelId:l().min(1).optional()}),d({cleared:b(l()),nodeId:l()}),{kind:`mutation`,auth:`admin`})}},Um=d({reason:l(),count:a().int().nonnegative()}),Wm=d({family:l(),deviceId:a().int().positive(),variant:l().optional(),sinceMs:a(),atMs:a(),attempts:a().int().nonnegative(),succeeded:a().int().nonnegative(),reasons:b(Um).readonly()}),Gm={name:`failure-contribution`,scope:`system`,mode:`collection`,internal:!0,methods:{list:P(g(),b(Wm).readonly())},mount:{kind:`skip`}},Km=d({name:l(),path:l()}),qm=d({path:l(),entries:b(Km).readonly(),freeBytes:a(),totalBytes:a()}),Jm={name:`filesystem-browse`,scope:`system`,mode:`singleton`,internal:!0,methods:{listAllowedRoots:P(g(),b(l()).readonly(),{auth:`admin`}),browse:P(d({path:l()}),qm,{auth:`admin`}),createDir:P(d({path:l()}),d({path:l()}),{kind:`mutation`,auth:`admin`})}},Ym=6e5,Xm=60*6e4,Zm=d({inputTokens:a(),outputTokens:a()}),Qm=y([`timeout`,`rate-limited`,`auth`,`refusal`,`bad-request`,`unavailable`,`no-profile`,`budget-exceeded`,`adapter-error`]),$m=d({ok:m(!0),text:l(),model:l(),usage:Zm,truncated:x(),latencyMs:a()}),eh=y([`guardrail`,`model`]),th=d({ok:m(!1),code:Qm,message:l(),retryAfterMs:a().optional(),refusalSource:eh.optional()}),nh=p(`ok`,[$m,th]),rh=d({bytes:v(Uint8Array),mimeType:l()}),ih=d({enabled:x().default(!1),maxAttempts:a().int().min(1).max(5).default(1)}),ah={totalMs:6e4,connectMs:1e4,firstTokenMs:12e4,idleMs:6e4},oh=d({addonId:l().optional(),profileId:l().optional(),consumer:l(),system:l().optional(),prompt:l(),jsonSchema:_(l(),s()).optional(),maxTokens:a().int().positive().optional(),temperature:a().optional(),topP:a().min(0).max(1).optional(),topK:a().int().positive().optional(),timeoutMs:a().int().positive().optional(),retry:ih.optional(),requestId:l().optional()}),sh=d({url:l(),filename:l(),sizeBytes:a(),sha256:l().optional()}),ch=p(`kind`,[d({kind:m(`catalog`),catalogId:l()}),d({kind:m(`url`),url:l(),sha256:l().optional(),label:l().optional(),sizeBytes:a().optional(),extraFiles:b(sh).optional()}),d({kind:m(`path`),path:l()})]),lh=d({nodeId:l(),engine:y([`llama-cpp`]),model:ch,contextSize:a().int().default(4096),gpuLayers:a().int().default(0),threads:a().int().optional(),parallel:a().int().default(1),batchSize:a().int().positive().optional(),ubatchSize:a().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(l()).default([]),autoStart:x().default(!1),idleStopMinutes:a().int().default(30)}),uh=d({phase:y([`downloading`,`verifying`]),file:l(),fileIndex:a().int(),fileCount:a().int(),downloadedBytes:a(),totalBytes:a().optional()}),dh=d({nodeId:l(),state:y([`stopped`,`downloading`,`starting`,`ready`,`crashed`,`failed`]),pid:a().optional(),port:a().optional(),modelPath:l().optional(),modelId:l().optional(),downloadProgress:a().min(0).max(1).optional(),download:uh.optional(),lastError:l().optional(),crashesInWindow:a(),memoryBytes:a().optional(),vramBytes:a().optional()}),fh=d({file:l(),sizeBytes:a(),catalogId:l().optional(),installedAt:a().optional(),path:l().optional()}),ph=d({nodeId:l(),modelsBytes:a(),freeBytes:a().optional()}),mh=oh.extend({images:b(rh).optional(),runtime:lh,timeoutMs:a().int().positive().optional()}),hh=y([`deviceNotEligible`,`appleIntelligenceNotEnabled`,`modelNotReady`,`osTooOld`,`helperMissing`,`helperCrashed`]),gh=p(`state`,[d({state:m(`available`),osVersion:l(),contextSize:a().int().positive(),languages:b(l()),imageInput:x()}),d({state:m(`unavailable`),reason:hh,osVersion:l().nullable(),detail:l()}),d({state:m(`unsupported-platform`),platform:l()}),d({state:m(`unknown`),error:l()})]),_h=oh.extend({images:b(rh).optional(),timeoutMs:a().int().positive().optional()}),vh=d({requestId:l()}),yh={name:`llm-runtime`,scope:`system`,mode:`singleton`,internal:!0,methods:{complete:P(mh,nh,{kind:`mutation`,auth:`admin`,timeoutMs:Ym}),ensureStarted:P(d({runtime:lh}),dh,{kind:`mutation`,auth:`admin`,timeoutMs:Ym}),stop:P(d({}),g(),{kind:`mutation`,auth:`admin`}),status:P(d({}),dh,{auth:`admin`}),installModel:P(d({model:ch}),g(),{kind:`mutation`,auth:`admin`,timeoutMs:Xm}),deleteModel:P(d({file:l()}),g(),{kind:`mutation`,auth:`admin`}),listLocalModels:P(d({}),b(fh),{auth:`admin`}),getDiskUsage:P(d({}),ph,{auth:`admin`}),cancel:P(vh,g(),{kind:`mutation`,auth:`admin`}),appleAvailability:P(d({}),gh,{auth:`admin`}),completeApple:P(_h,nh,{kind:`mutation`,auth:`admin`,timeoutMs:Ym})}},bh=y([`openai-compatible`,`openai`,`anthropic`,`google`,`managed-local`,`apple-foundation`]),xh=d({id:l(),name:l(),kind:bh,addonId:l(),enabled:x(),model:l(),baseUrl:l().optional(),apiKey:l().optional(),supportsVision:x(),temperature:a().min(0).max(2).optional(),topP:a().min(0).max(1).optional(),topK:a().int().positive().optional(),maxTokens:a().int().positive().optional(),contextLength:a().int().positive().optional(),systemPrompt:l().optional(),timeoutMs:a().int().positive().default(6e4),connectTimeoutMs:a().int().positive().default(1e4),firstTokenTimeoutMs:a().int().positive().default(12e4),idleTimeoutMs:a().int().positive().default(6e4),retry:ih.default({enabled:!1,maxAttempts:1}),toolsEnabled:x().default(!1),extraHeaders:_(l(),l()).optional(),runtime:lh.optional(),appleFoundation:d({nodeId:l()}).optional()}),Sh=s(),Ch=d({kind:bh,label:l(),icon:l(),addonId:l(),configSchema:Sh}),wh=f([d({consumer:l()}),d({purpose:y([`text`,`vision`])})]),Th=d({selector:wh,profileId:l()}),Eh=d({day:l(),consumer:l(),profileId:l(),calls:a(),okCalls:a(),errorCalls:a(),inputTokens:a(),outputTokens:a(),avgLatencyMs:a()}),Dh=d({id:l(),label:l(),family:l(),purpose:y([`text`,`vision`]),url:l(),sha256:l(),sizeBytes:a(),quantization:l(),minRamBytes:a(),contextSizeDefault:a().int(),mmprojUrl:l().optional()}),Oh=p(`ok`,[d({ok:m(!0),model:ch,label:l(),repo:l(),quantization:l(),purpose:y([`text`,`vision`]),totalBytes:a(),extraFilenames:b(l())}),d({ok:m(!1),code:l(),message:l(),candidates:b(l()).optional(),requiredBytes:a().optional()})]),kh=d({nodeId:l(),reachable:x(),status:dh.optional(),disk:ph.optional(),error:l().optional(),apple:gh.optional()}),Ah=oh.extend({images:b(rh).min(1)}),jh=d({addonId:l(),profileId:l()}),Mh={name:`llm`,scope:`system`,mode:`collection`,internal:!1,providerKind:`ai`,nodeIdMode:`data`,methods:{generate:P(oh,nh,{kind:`mutation`,timeoutMs:Ym}),generateVision:P(Ah,nh,{kind:`mutation`,timeoutMs:Ym}),cancel:P(d({addonId:l().optional(),requestId:l()}),g(),{kind:`mutation`}),listProfileKinds:P(d({}),b(Ch)),listProfiles:P(d({}),b(xh)),upsertProfile:P(d({profile:xh}),xh,{kind:`mutation`,auth:`admin`}),deleteProfile:P(jh,g(),{kind:`mutation`,auth:`admin`}),testProfile:P(jh,nh,{kind:`mutation`,auth:`admin`,timeoutMs:Ym}),listModels:P(jh,b(l())),getDefaults:P(d({}),b(Th)),setDefault:P(d({selector:wh,profileId:l().nullable()}),g(),{kind:`mutation`,auth:`admin`}),getUsage:P(d({since:a().optional(),until:a().optional(),consumer:l().optional(),profileId:l().optional()}),b(Eh)),listModelCatalog:P(d({}),b(Dh)),listRuntimeNodes:P(d({}),b(kh)),listNodeModels:P(d({nodeId:l()}),b(fh)),resolveModelRef:P(d({ref:l(),maxBytes:a().positive().optional()}),Oh,{kind:`mutation`,auth:`admin`}),installModel:P(d({nodeId:l(),model:ch}),g(),{kind:`mutation`,auth:`admin`}),deleteModel:P(d({nodeId:l(),file:l()}),g(),{kind:`mutation`,auth:`admin`}),getRuntimeStatus:P(jh,dh),startRuntime:P(jh,dh,{kind:`mutation`,auth:`admin`}),stopRuntime:P(jh,g(),{kind:`mutation`,auth:`admin`})}},Nh=[`decode`,`transcode`,`recording`,`streaming`,`detection`],Ph=[`measured`,`accounted`,`unattributable`],Fh=d({role:y(Nh),deviceId:a().int().positive().nullable(),attribution:y(Ph),unit:l(),pid:a().int().positive().optional(),startedAtMs:a().optional(),cpuSeconds:a().optional(),rssBytes:a().optional()}),Ih={name:`load-contribution`,scope:`system`,mode:`collection`,internal:!0,methods:{list:P(g(),b(Fh).readonly())},mount:{kind:`skip`}},Lh=d({armed:a().int().min(0),unknown:b(l()).readonly()}),Rh={name:`log-channels`,scope:`system`,mode:`collection`,internal:!0,methods:{list:P(g(),b(no).readonly()),apply:P(d({windows:b(ro).readonly()}),Lh,{kind:`mutation`})},mount:{kind:`skip`}},zh=y([`debug`,`info`,`warn`,`error`]),Bh=d({timestamp:ge(),level:zh,scope:b(l()),message:l(),meta:_(l(),s()).optional(),tags:_(l(),l()).optional()}),Vh={name:`log-destination`,scope:`system`,mode:`collection`,internal:!0,methods:{write:P(Bh,g(),{kind:`mutation`}),query:P(d({scope:b(l()).optional(),level:zh.optional(),since:ge().optional(),until:ge().optional(),limit:a().optional(),tags:_(l(),l()).optional()}),b(Bh).readonly())},mount:{kind:`skip`}},Hh=y([`primary`,`second-factor`]),Uh=d({kind:m(`redirect`),id:l(),label:l(),icon:l().optional(),startUrl:l(),stage:Hh}),Wh=d({kind:m(`widget`),id:l(),addonId:l(),bundle:l(),remote:fl,stage:Hh}),Gh=d({kind:m(`passkey`),id:l(),label:l(),stage:Hh,rpId:l(),origin:l().nullable()}),Kh=p(`kind`,[Uh,Wh,Gh]),qh={name:`login-method`,scope:`system`,mode:`collection`,internal:!0,methods:{getLoginMethods:P(g(),b(Kh).readonly())},mount:{kind:`skip`}},Jh=d({total:a(),user:a(),system:a(),irq:a(),nice:a(),loadAvg:u([a(),a(),a()]),cores:a()}),Yh=d({percent:a(),totalBytes:a(),usedBytes:a(),availableBytes:a(),swapUsedBytes:a(),swapTotalBytes:a()}),Xh=d({readBytes:a(),writeBytes:a(),readOps:a(),writeOps:a(),timestampMs:a()}),Zh=d({rxBytes:a(),txBytes:a(),rxPackets:a(),txPackets:a(),rxErrors:a(),txErrors:a(),timestampMs:a()}),Qh=d({utilization:a(),model:l(),memoryUsedBytes:a(),memoryTotalBytes:a(),temperature:a().nullable()}),$h=d({openFds:a(),threadCount:a(),activeHandles:a(),activeRequests:a()}),eg=d({avg10:a(),avg60:a(),avg300:a()}),tg=d({some:eg,full:eg.nullable()}),ng=d({cpu:Jh,memory:Yh,gpu:Qh.nullable(),network:Zh,disk:Xh,pressure:d({cpu:tg.nullable(),memory:tg.nullable(),io:tg.nullable()}),process:$h,cpuTemperature:a().nullable(),timestampMs:a()}),rg=d({path:l(),totalBytes:a(),usedBytes:a(),availableBytes:a(),percent:a()}),ig=d({pid:a(),cpu:a(),memory:a(),privateBytes:a().optional(),sharedBytes:a().optional()}),ag=d({addonId:l(),nodeId:l(),role:y([`hub`,`worker`]),pid:a(),state:y([`starting`,`running`,`stopping`,`stopped`,`crashed`]),uptimeSec:a()}),og=d({pid:a(),ppid:a(),pgid:a(),classification:y([`root`,`managed`,`system`]),addonId:l().nullable(),nodeId:l().nullable(),command:l(),cpuPercent:a(),memoryRssBytes:a(),cpuMainPercent:a().nullable(),cpuGcPercent:a().nullable(),threadCount:a().nullable(),uptimeSec:a()}),sg=d({source:y([`cgroup-v2`,`cgroup-v1`]),currentBytes:a(),limitBytes:a().nullable(),anonBytes:a().nullable(),fileBytes:a().nullable(),shmemBytes:a().nullable(),slabBytes:a().nullable(),gpuShmemBytes:a().nullable()}).extend({atMs:a()}),cg=d({atMs:a(),samples:a().int(),cpuMainPercent:a().nullable(),cpuMainPercentMin:a().nullable(),cpuGcPercent:a().nullable(),cpuGcPercentMin:a().nullable(),cpuLifetimePercent:a(),cpuLifetimePercentMin:a(),memoryRssBytes:a(),memoryRssBytesMin:a(),processCount:a().int(),processCountMin:a().int()}),lg=d({key:l(),kind:y([`addon`,`root`,`unattributed`]),points:b(cg).readonly()}),ug=d({nodeId:l(),series:b(lg).readonly(),containerMemory:b(sg).readonly(),bucketMs:a(),retainedSamples:a(),oldestAtMs:a().nullable(),cadenceMs:a(),durable:x()}),dg=d({forNodeId:l(),sinceMs:a().optional(),maxPoints:a().int().positive().optional()}),fg=d({cpuPercent:a(),memoryPercent:a(),memoryUsedMB:a(),memoryTotalMB:a(),diskPercent:a().optional(),temperature:a().optional(),gpuPercent:a().optional(),gpuMemoryPercent:a().optional()}),pg={name:`metrics-provider`,scope:`system`,mode:`singleton`,methods:{collectSnapshot:P(g(),ng),getCached:P(g(),ng.nullable()),getCurrent:P(g(),fg),getDiskSpace:P(d({dirPath:l()}),rg),getGpuInfo:P(g(),Qh.nullable()),getCpuTemperature:P(g(),a().nullable()),getProcessStats:P(d({pids:b(a())}),b(ig)),listAddonInstances:P(g(),b(ag).readonly()),getAddonStats:P(d({addonId:l()}),ig.nullable()),listNodeProcesses:P(g(),b(og).readonly()),getLoadSeries:P(dg,ug)}},mg=d({sourceUrl:l(),metadata:ys,targets:b(vs).min(1).readonly(),calibrationRef:l().optional(),sessionId:l().optional()}),hg={name:`model-convert`,scope:`system`,mode:`singleton`,internal:!0,methods:{convert:P(mg,xs,{kind:`mutation`,auth:`admin`,timeoutMs:6e5})}},gg=d({nodeId:l(),modelId:l(),format:y(ss),entry:_s}),_g=d({ok:x(),sha256:l(),bytes:a(),path:l()}),vg={name:`model-distributor`,scope:`system`,mode:`singleton`,internal:!0,methods:{distributeModel:P(gg,_g,{kind:`mutation`,auth:`admin`})}},yg=d({bbox:z,pixelCount:a(),intensity:a()}),bg=d({detected:x(),regionCount:a(),regions:b(yg).readonly(),rawRegions:b(yg).readonly(),frameWidth:a(),frameHeight:a(),analysisMs:a()}),xg={name:`motion-detection`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[L.Camera],exposesDeviceSettings:!0,methods:{analyze:P(d({deviceId:a(),frame:kl.optional(),frameHandle:w.optional()}),bg,{kind:`mutation`}),removeCamera:P(d({deviceId:a()}),g(),{kind:`mutation`}),reset:P(g(),g(),{kind:`mutation`})},events:{onMotion:{data:d({deviceId:a(),detected:x(),regionCount:a()})}}},Sg=y([`external`,`embedded`]),Cg=y([`connected`,`disconnected`,`auth-failed`,`unreachable`,`tls-error`]),wg=d({id:l(),name:l(),url:l(),kind:Sg,status:Cg,latencyMs:a().nullable(),error:l().optional(),connectedClients:a().int().nonnegative().optional(),lastCheckedAt:a().optional()}),Tg=d({url:l(),username:l().optional(),password:l().optional(),clientIdPrefix:l().optional()}),Eg=d({name:l().min(1),url:l().regex(/^(mqtt|mqtts|ws|wss):\/\//,`URL must start with mqtt(s):// or ws(s)://`),username:l().optional(),password:l().optional(),clientIdPrefix:l().optional()}),Dg=d({id:l()}),Og=d({id:l()}),kg=p(`ok`,[d({ok:m(!0),latencyMs:a()}),d({ok:m(!1),error:l()})]),Ag=d({port:a().int().min(1).max(65535).default(1883),allowAnonymous:x().default(!1),username:l().optional(),password:l().optional()}),jg=d({id:l(),url:l()}),Mg=d({brokerCount:a(),embeddedRunning:x()}),Ng={name:`mqtt-broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:Mg,kind:`poll`},methods:{listBrokers:P(g(),b(wg)),getBrokerConfig:P(Og,Tg,{auth:`admin`}),addBroker:P(Eg,Dg,{kind:`mutation`,auth:`admin`}),removeBroker:P(Og,g(),{kind:`mutation`,auth:`admin`}),testConnection:P(Og,kg,{kind:`mutation`,auth:`admin`}),startEmbeddedBroker:P(Ag,jg,{kind:`mutation`,auth:`admin`}),stopEmbeddedBroker:P(Og,g(),{kind:`mutation`,auth:`admin`}),getStatus:P(g(),Mg)}},Pg=d({url:l(),hostname:l(),port:a(),protocol:y([`http`,`https`])}),Fg=d({connected:x(),endpoint:Pg.nullable(),error:l().optional()}),Ig=Pg.extend({id:l(),label:l(),mode:l().optional(),sourcePort:a().optional()}),Lg={name:`network-access`,scope:`system`,mode:`collection`,providerKind:`ingress`,methods:{start:P(g(),Pg,{kind:`mutation`}),stop:P(g(),g(),{kind:`mutation`}),getEndpoint:P(g(),Pg.nullable()),getStatus:P(g(),Fg),listEndpoints:P(g(),b(Ig).readonly())}},Rg=y([`image`,`video`,`gif`,`audio`,`icon`]),zg=d({mediaType:Rg,url:l().optional(),bytes:v(Uint8Array).optional(),mime:l().optional(),name:l().optional()}).refine(e=>e.url!==void 0||e.bytes!==void 0,{message:"Attachment requires either `url` or `bytes`"}),Bg=y([`text`,`markdown`,`html`]),Vg=y([`acknowledge`,`dismiss`,`silence`,`snooze`,`view`,`play`,`open`,`close`,`lock`,`unlock`,`arm`,`arm-home`,`arm-away`,`arm-night`,`disarm`,`light`,`alert`,`camera`]),Hg=d({id:l(),label:l(),url:l().optional(),icon:Vg.optional(),destructive:x().optional(),mode:y([`navigate`,`background`]).optional()}),Ug=d({body:l(),title:l().optional(),format:Bg.default(`text`),priority:a().int().min(1).max(5).default(3),level:l().optional(),attachments:b(zg).optional(),clickUrl:l().optional(),actions:b(Hg).optional(),sound:l().optional(),ttl:a().optional(),tag:l().optional(),deviceId:a().optional(),eventId:l().optional(),metadata:_(l(),s()).optional()}),Wg=d({id:l(),label:l(),ordinal:a().int().min(1).max(5).nullable(),flags:d({critical:x().optional(),silent:x().optional(),noPush:x().optional()}).optional(),requires:b(l()).optional(),description:l().optional()}),Gg=d({attachments:d({mediaTypes:b(Rg),mode:y([`url`,`bytes`,`both`]),max:a().int().nonnegative(),maxBytes:a().int().positive().optional()}),actions:a().int().nonnegative(),actionIcons:x().optional(),levels:b(Wg),format:b(Bg),clickUrl:x(),sound:x(),ttl:x(),bodyMaxLen:a().int().positive()}),Kg=s(),qg=d({kind:l(),label:l(),icon:l(),addonId:l(),iconUrl:l().optional(),iconMediaType:l().optional(),configSchema:Kg,destinationKeys:b(l()).optional(),supportsDiscovery:x(),caps:Gg}),Jg=d({id:l(),name:l(),kind:l(),addonId:l(),enabled:x(),config:_(l(),s())}),Yg=d({kind:l(),suggestedName:l(),config:_(l(),s())}),Xg=d({level:l(),format:Bg,attachmentsSent:a().int().nonnegative(),actionsSent:a().int().nonnegative(),truncated:x(),dropped:b(l())}),Zg=d({success:x(),error:l().optional(),renderedAs:Xg.optional()}),Qg=Zg,$g={name:`notification-output`,scope:`system`,mode:`collection`,methods:{listTargetKinds:P(d({}),b(qg)),listTargets:P(d({}),b(Jg),{auth:`admin`}),discoverTargets:P(d({kind:l(),config:_(l(),s()).optional()}),b(Yg),{auth:`admin`}),send:P(d({targetId:l(),notification:Ug}),Zg,{kind:`mutation`,auth:`admin`}),testTarget:P(d({targetId:l(),sample:Ug.optional()}),Qg,{kind:`mutation`,auth:`admin`}),upsertTarget:P(d({target:Jg}),Jg,{kind:`mutation`,auth:`admin`}),deleteTarget:P(d({targetId:l()}),g(),{kind:`mutation`,auth:`admin`}),setTargetEnabled:P(d({targetId:l(),enabled:x()}),g(),{kind:`mutation`,auth:`admin`})}},e_=[{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`}],t_=[{id:`person`,name:`Person`},{id:`vehicle`,name:`Vehicle`},{id:`animal`,name:`Animal`},{id:`package`,name:`Package`}],n_=new Set(t_.map(e=>e.id));function r_(e){return n_.has(e.trim().toLowerCase())}var i_={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},a_=[{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`}],o_={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},s_={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},c_=new Map;for(let[e,t]of Object.entries(o_.mapping))c_.set(e.toLowerCase(),t);for(let[e,t]of Object.entries(s_.mapping))c_.set(e.toLowerCase(),t);function l_(e){return c_.get(e.toLowerCase())??null}function u_(){return a_.map(e=>e.id)}var U={motion:`#f59e0b`,audio:`#06b6d4`,person:`#22c55e`,vehicle:`#3b82f6`,animal:`#f97316`,package:`#a855f7`,sensor:`#8b5cf6`,control:`#10b981`,genericDetection:`#64748b`},d_=`#22ff55`,f_={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 p_(e){return e.split(/[-_ ]/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var m_=new Map;function h_(e,t,n,r,i){m_.set(e,{kind:e,parentKind:null,level:`macro`,category:t,color:n,iconId:r,labelKey:`eventKind.${e}`,label:i})}function W(e,t,n,r,i,a){m_.set(e,{kind:e,parentKind:t,level:`sub`,category:n,color:r,iconId:i,labelKey:`eventKind.${e}`,label:a})}h_(`motion`,`motion`,U.motion,`motion`,`Motion`),h_(`audio`,`audio`,U.audio,`audio`,`Audio`),h_(`person`,`detection`,U.person,`person`,`Person`),h_(`vehicle`,`detection`,U.vehicle,`vehicle`,`Vehicle`),h_(`animal`,`detection`,U.animal,`animal`,`Animal`),h_(`package`,`package`,U.package,`package`,`Package`),h_(`sensor`,`sensor`,U.sensor,`sensor`,`Sensor`),h_(`control`,`control`,U.control,`control`,`Control`);for(let[e,t]of Object.entries(i_.mapping))t!==`vehicle`&&t!==`animal`||m_.has(e)||W(e,t,`detection`,f_[e]??U.genericDetection,e,p_(e));W(`package-delivered`,`package`,`package`,U.package,`package`,`Package delivered`),W(`package-picked-up`,`package`,`package`,U.package,`package`,`Package picked up`),W(`contact`,`sensor`,`sensor`,`#f59e0b`,`door`,`Contact`),W(`motion-sensor`,`sensor`,`sensor`,U.sensor,`pir`,`Motion sensor`),W(`smoke`,`sensor`,`sensor`,`#ef4444`,`smoke`,`Smoke`),W(`flood`,`sensor`,`sensor`,`#3b82f6`,`water`,`Water leak`),W(`gas`,`sensor`,`sensor`,`#ef4444`,`gas`,`Gas`),W(`carbon-monoxide`,`sensor`,`sensor`,`#dc2626`,`smoke`,`Carbon monoxide`),W(`vibration`,`sensor`,`sensor`,`#eab308`,`vibration`,`Vibration`),W(`tamper`,`sensor`,`sensor`,`#f97316`,`tamper`,`Tamper`),W(`presence`,`sensor`,`sensor`,`#22c55e`,`presence`,`Presence`),W(`enum-sensor`,`sensor`,`sensor`,U.sensor,`generic`,`Sensor state`),W(`device-event`,`sensor`,`sensor`,`#10b981`,`button`,`Device event`),W(`lock`,`control`,`control`,`#0ea5e9`,`lock`,`Lock`),W(`cover`,`control`,`control`,`#0ea5e9`,`door`,`Cover`),W(`switch`,`control`,`control`,U.control,`switch`,`Switch`),W(`siren`,`control`,`control`,`#dc2626`,`siren`,`Siren`),W(`button`,`control`,`control`,`#10b981`,`button`,`Button`),W(`doorbell`,`control`,`control`,`#a855f7`,`doorbell`,`Doorbell`);for(let e of a_){let t=`audio-${e.id}`;m_.has(t)||W(t,`audio`,`audio`,U.audio,t,e.name)}var g_=Object.freeze(Object.fromEntries(m_));function __(e){return g_[e]}function v_(e){return g_[e]?.color??`#22ff55`}function y_(e){let t=[];for(let n of Object.values(g_))n.parentKind===e&&t.push(n);return t}var b_=d({kind:l(),label:l(),parentKind:l().nullable()}),x_=d({videoClasses:b(b_),audioKinds:b(b_),labels:b(b_)});function S_(e,t,n){return{kind:e,label:t,parentKind:n}}function C_(){let e=Object.values(g_);return{videoClasses:e.filter(e=>e.category===`detection`).map(e=>S_(e.kind,e.label,e.parentKind)),audioKinds:e.filter(e=>e.category===`audio`&&e.level===`sub`).map(e=>S_(e.kind,e.label,e.parentKind)),labels:e.filter(e=>e.category===`sensor`||e.category===`control`).map(e=>S_(e.kind,e.label,e.parentKind))}}var w_=Object.freeze(C_()),T_=y([`disarmed`,`armed_home`,`armed_away`,`armed_night`,`armed_vacation`,`armed_custom_bypass`,`arming`,`disarming`,`pending`,`triggered`]),E_=y([`home`,`away`,`night`,`vacation`,`custom_bypass`]),D_=d({state:T_,availableModes:b(E_),requiresCode:x(),lastChangedAt:a()}),O_={name:`alarm-panel`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.AlarmPanel],methods:{arm:P(d({deviceId:a().int().nonnegative(),mode:E_,code:l().min(1).optional()}),g(),{kind:`mutation`,auth:`protected`}),disarm:P(d({deviceId:a().int().nonnegative(),code:l().min(1).optional()}),g(),{kind:`mutation`,auth:`protected`}),trigger:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:D_,kind:`push`},runtimeState:D_,durability:`restored`,volatileStateFields:[`lastChangedAt`]},k_=d({x:a(),y:a()}),A_=d({kind:m(`rect`),x:a(),y:a(),width:a(),height:a()}),j_=d({kind:m(`polygon`),points:b(k_)}),M_=d({kind:m(`grid`),gridWidth:a(),gridHeight:a(),cells:b(x())}),N_=d({kind:m(`line`),points:b(k_)}),P_=p(`kind`,[A_,j_,M_,N_]),F_=y([`rect`,`polygon`,`grid`,`line`]),I_=d({min:a(),max:a()}),L_=d({width:a(),height:a()}),R_=y([`immediate`,`track-end`,`device-event`,`package-event`,`system-event`]),z_=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(`.`)),B_=new Set([`camera-online`,`camera-offline`,`camera-disabled`,`camera-enabled`]),V_=z_.options.filter(e=>!B_.has(e)),H_=[`alarm-arm-refused`,`alarm-check-failed`,`alarm-arming`,`alarm-armed`,`alarm-pending`,`alarm-triggered`,`alarm-rearmed`,`alarm-sensor-bypass`,`alarm-disarmed`],U_=[`device-battery-low`,`device-battery-normal`,`device-consumable-low`,`device-consumable-normal`],W_=[`device-consumable-low`,`device-consumable-normal`],G_=[`device-tank-low`,`device-tank-full`,`device-tank-normal`],K_=d({kinds:b(z_).min(1),deviceIds:b(a().int()).min(1).optional(),deviceTypes:b(l().min(1)).min(1).optional(),excludeDeviceIds:b(a().int()).min(1).optional(),nodeIds:b(l().min(1)).min(1).optional(),packageNames:b(l().min(1)).min(1).optional(),consumableLowPercent:a().int().min(1).max(95).optional()});function q_(e){return e.consumableLowPercent??15}var J_=1440,Y_=[10,30,60],X_=d({days:b(a().int().min(0).max(6)).min(1),startMinute:a().int().min(0).max(1439),endMinute:a().int().min(0).max(1439)}),Z_=d({windows:b(X_).min(1),timezone:l().optional(),invert:x().optional()}),Q_=y([`instant`,`summary`]),$_=p(`mode`,[d({mode:m(`instant`)}),d({mode:m(`summary`),schedule:Z_})]),ev=d({values:b(l().min(1)),maxDistance:a().int().min(0).max(3).default(1)}),tv=d({zoneId:l().optional(),className:l().optional(),op:y([`became-occupied`,`became-free`,`>=`,`<=`]).default(`became-occupied`),count:a().int().min(0).default(1),sustainSeconds:a().int().min(0).max(3600).default(15)}),nv=d({labels:b(l().min(1)).min(1).optional(),dbThreshold:a().min(-96).max(0).optional(),hitPercent:a().int().min(1).max(100).default(60),samplingSeconds:a().int().min(1).max(300).default(10),confirmHits:a().int().min(1).max(20).optional(),confirmWindowSec:a().int().min(1).max(60).optional()}),rv=y([`enter`,`exit`,`any`]),iv=y([`raised`,`cleared`]),av=d({ids:b(l().min(1)).min(1),match:y([`any`,`all`]).default(`any`)}),ov=p(`kind`,[d({kind:m(`wait`),seconds:a().min(0).max(300)}),d({kind:m(`cap`),deviceId:a().int(),cap:l().min(1),method:l().min(1),args:_(l(),s()).optional()})]),sv=d({name:l().min(1).max(120),enabled:x(),minDelaySec:a().int().min(0).max(86400).optional(),actions:b(ov).min(1)}),cv=d({id:l().min(1).max(64),label:l().min(1).max(40),sequence:l().min(1).max(120),icon:Vg.optional(),destructive:x().optional()}),lv=d({onTrigger:b(sv).optional(),buttons:b(cv).max(8).optional()}),uv=d({deviceId:a().int(),states:b(l().min(1)).min(1)}),dv=d({sceneId:l().min(1),deviceId:a().int().optional(),requiredState:y([`matched`,`diverged`]),latched:x().optional()}),fv=d({deviceState:uv.optional(),scene:dv.optional(),devices:b(a()).optional(),devicesExclude:b(a()).min(1).optional(),classes:b(l().min(1)).optional(),classesExclude:b(l().min(1)).optional(),minConfidence:a().min(0).max(1).optional(),zones:av.optional(),zonesExclude:b(l().min(1)).optional(),crossing:rv.optional(),labelEquals:b(l().min(1)).optional(),identities:b(l().min(1)).optional(),plates:ev.optional(),identitiesExclude:b(l().min(1)).optional(),minImportance:a().min(0).max(1).optional(),minDwellSeconds:a().min(0).optional(),source:y([`pipeline`,`onboard`,`sensor`,`audio`,`any`]).optional(),minLabelConfidence:a().min(0).max(1).optional(),eventTypeTokens:b(l().min(1)).optional(),sensorKinds:b(l().min(1)).optional(),sensorTransition:iv.optional(),packagePhase:y([`delivered`,`picked-up`,`both`]).optional(),systemEvent:K_.optional(),customZones:b(j_).optional(),occupancy:tv.optional(),audio:nv.optional()}),pv=d({targetId:l().min(1),params:_(l(),s()).optional()}),mv=y([`cropped`,`full`,`boxed`]),hv=y([`mosaic`,`each`]),gv=d({attach:y([`best`,`best-matching`,`keyFrame`,`none`]).default(`best`),frame:mv.optional(),zoneCrop:x().optional(),gif:x().optional(),clip:x().optional(),clipPreRollSec:a().int().min(0).max(30).optional(),clipPostRollSec:a().int().min(0).max(30).optional(),clipSpeed:a().min(1).max(8).optional(),profile:C.optional(),linkedCameras:hv.optional()}),_v=y([`shared`,`per-class`]),vv=d({cooldownSec:a().int().min(0).max(86400).default(60),scope:y([`rule`,`rule-device`]).default(`rule-device`),granularity:_v.optional()}),yv=1e3,bv=2e4,xv=8e3,Sv=d({op:y([`>=`,`>`,`<=`,`<`,`==`]),count:a().int().min(0).max(1e3)}),Cv=d({enabled:x().default(!1),profileId:l().optional(),prompt:l().max(1e3).optional(),expect:Sv.optional(),timeoutMs:a().int().min(yv).max(bv).default(xv),onTimeout:y([`fire`,`suppress`]).default(`fire`),maxImagePx:a().int().min(64).max(2048).default(448)}),wv=d({name:l().min(1).max(200),enabled:x().default(!0),delivery:R_,conditions:fv.default({}),schedule:Z_.optional(),systemEventDelivery:$_.optional(),targets:b(pv),targetUsers:b(l()).optional(),media:gv.default({attach:`best`}),throttle:vv.default({cooldownSec:60,scope:`rule-device`}),template:d({title:l().max(500).optional(),body:l().max(2e3).optional()}).optional(),priority:a().int().min(1).max(5).default(3),ownerUserId:l().optional(),snoozeAllowGlobal:x().optional(),snoozeOptions:b(a().int().min(1).max(J_)).max(4).optional(),actions:lv.optional(),confirm:Cv.optional(),waitForEnhancement:x().optional(),groupIdleSec:a().int().min(0).max(600).optional()}),Tv=wv.partial().extend({disabledTargetIds:b(l()).optional(),enabled:x().optional(),conditions:fv.optional(),media:gv.optional(),throttle:vv.optional(),priority:a().int().min(1).max(5).optional()}),Ev=[`template`,`schedule`,`targetUsers`,`snoozeOptions`,`snoozeAllowGlobal`,`waitForEnhancement`,`actions`,`confirm`,`groupIdleSec`],Dv=y(Ev),Ov=d({ruleId:l(),patch:Tv,clear:b(Dv).optional()}),kv=wv.extend({id:l(),createdBy:l(),createdAt:a(),updatedAt:a(),disabledTargetIds:b(l()).default([])}),Av=d({id:l(),status:y([`read`,`unavailable`]),items:a().int().nonnegative(),reason:l().optional()}),jv=d({empty:x(),count:a().int().nonnegative(),text:l(),sections:b(Av),dropped:_(l(),a().int().nonnegative()),excludedGroups:b(l())}),Mv=d({recordId:l(),recordKind:y([`object-event`,`track`,`device-event`,`package-event`,`system-event`]),deviceId:a(),timestamp:a(),wouldFire:x(),failedCondition:l().optional(),className:l().optional(),label:l().optional()}),Nv=y([`detection`,`sensor`,`occupancy`,`sound`,`device-events`,`system`,`alarm`,`mixed`]),Pv=y([`detection`,`sensor`,`occupancy`,`sound`,`system`]),Fv=y([`rule`,`timelapse`,`summary`]),Iv=y([`title`,`body`,`previewText`,`captionText`]),Lv=y([`subject`,`place`,`time`,`rule`,`occupancy`,`sound`,`sensor`,`system`,`digest`,`ai`]),Rv=d({name:l().regex(/^\w+$/),label:l(),description:l().optional(),example:l(),group:Lv,families:b(Fv).min(1),fields:b(Iv).optional(),kinds:b(Pv).optional(),deliveries:b(R_).optional(),systemEventKinds:b(z_).optional(),systemEventDeliveries:b(Q_).optional(),dynamic:d({prefix:m(`count_`),from:m(`classes`)}).optional()}),zv=d({family:Fv,field:Iv,kind:Nv.optional(),delivery:R_.optional(),systemEventKinds:b(z_).optional(),systemEventDelivery:Q_.optional()}),Bv=d({context:zv,template:d({title:l().max(500).optional(),body:l().max(2e3).optional()})}),Vv=d({title:l().nullable(),body:l().nullable(),unknown:b(l())}),Hv=d({id:l(),group:y([`scope`,`class`,`zones`,`quality`,`label`,`schedule`,`device`,`package`,`occupancy`,`audio`,`system`]),label:l(),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(R_),phase:l(),description:l().optional(),options:b(d({value:l(),label:l(),hint:l().optional()})).readonly().optional()}),Uv=[{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:`Admin zone ids; quantifier any/all over the visited set.`},{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:`Not set — entering`,hint:`Entries, and every detection that is not a crossing at all. Exits are excluded. This is what a rule without a crossing condition already does, and choosing it writes nothing to the rule.`},{value:`enter`,label:`Entered a zone`,hint:`The same matches as "not set", stated explicitly: entries and non-crossing detections pass, exits do not.`},{value:`exit`,label:`Left a zone`,hint:`ONLY an exit crossing. A detection that is not a crossing fails, so this rule cannot fire on ordinary movement — pair it with the zones the subject must have left. Also matches a tripwire crossed against its drawn direction.`},{value:`any`,label:`Entered or left`,hint:`No direction filter: entries, exits and non-crossing detections alike. This is the only choice that adds exits to what the rule already matched.`}],operator:`in`,appliesTo:[`immediate`],phase:`P1`,description:`Direction of the zone crossing: enter (the default, and what every rule authored before this did) / exit / any. An exit rule matches only crossings.`},{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 (the baseline is what we see) or diverged (it demonstrably is not) — “tell me about a person at the door, but only while the bin is still out”. A scene that cannot judge, or one this hub has not read yet, does NOT fire.`},{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.`}],Wv=y([`pending`,`sent`,`dead`]),Gv=y([`object-event`,`track-end`,`device-event`,`package-event`,`system-event`]),Kv=d({className:l(),label:l().optional(),confidence:a().optional(),zones:b(l()),timestamp:a(),systemEvent:d({kind:z_,subject:l(),title:l(),body:l(),data:_(l(),s())}).optional()}),qv=d({id:l(),ruleId:l(),ruleName:l(),delivery:R_,targetId:l(),deviceId:a(),recordKind:Gv,recordId:l(),trackId:l().optional(),status:Wv,attempts:a().int(),createdAt:a(),updatedAt:a(),error:l().optional(),subject:Kv,artifactIds:b(l().min(1)).optional()}),Jv=d({ruleId:l().optional(),deviceId:a().optional(),status:Wv.optional(),since:a().optional(),until:a().optional(),limit:a().int().min(1).max(500).default(100)}),Yv=d({ruleId:l(),lastAt:a(),status:Wv,deviceId:a()}),Xv=d({runs:b(Yv),horizonMs:a().nonnegative().nullable()}),Zv=y([`rule`,`device`,`all`]),Qv=d({scope:Zv,ruleId:l().optional(),deviceId:a().int().optional(),classes:b(l().min(1)).min(1).optional(),durationMinutes:a().int().min(1).max(J_),global:x().optional(),summary:x().optional()}),$v=d({id:l(),userId:l(),scope:Zv,ruleId:l().optional(),deviceId:a().int().optional(),classes:b(l().min(1)).min(1).optional(),startedAt:a(),expiresAt:a(),global:x(),summary:x(),digestSentAt:a().optional()}),ey=d({snoozeId:l(),targetId:l(),ruleId:l(),ruleName:l(),deviceId:a().int(),count:a().int(),firstAt:a(),lastAt:a()}),ty=b(d({mode:E_,deviceIds:b(a().int()).max(200)})).max(8).refine(e=>new Set(e.map(e=>e.mode)).size===e.length,{message:`nonBlocking: at most one list per arm mode`}),ny=d({exitDelaySec:a().int().min(0).max(600),entryDelaySec:a().int().min(0).max(600),triggeredDurationSec:a().int().min(0).max(3600),announceArm:x().optional(),announceTargets:b(l().min(1)).max(16),nonBlocking:ty.default([])}),ry=ny.extend({nonBlocking:ty}).partial(),iy=y([`muted`,`detection-off`,`offline`]),ay=d({deviceId:a().int(),reason:iy}),oy=d({mode:E_,ruleCount:a().int().min(0),allDevices:x(),deviceIds:b(a().int()),allDevicesExcept:b(a().int()).default([]),skippedDevices:b(ay).default([])}),sy=d({deviceId:a().int(),name:l(),state:l(),blocking:x()}),cy=d({deviceId:a().int(),name:l(),phase:y([`open`,`closed`])}),ly=d({mode:E_,devices:b(sy),unknown:b(a().int())}),uy=d({state:T_,targetMode:E_.nullable(),availableModes:b(E_),openings:b(ly),exclusions:b(cy)}),dy=d({deviceId:a().int().nullable(),settings:ny,coverage:b(oy),live:uy.optional()}),fy=d({deviceId:a().int().nonnegative().optional(),seconds:a().min(0).max(60),profile:C.optional(),ruleId:l(),ruleName:l(),reason:y([`window`,`occupancy`])}),py=d({rulesLoaded:x(),asks:b(fy).readonly()}),my={name:`notification-rules`,scope:`system`,mode:`singleton`,methods:{listRules:P(d({}),d({rules:b(kv)}),{auth:`admin`}),getRule:P(d({ruleId:l()}),d({rule:kv.nullable()}),{auth:`admin`}),createRule:P(d({rule:wv}),d({rule:kv}),{kind:`mutation`,auth:`admin`,caller:`required`}),updateRule:P(Ov,d({rule:kv}),{kind:`mutation`,auth:`admin`,caller:`required`}),deleteRule:P(d({ruleId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setRuleEnabled:P(d({ruleId:l(),enabled:x()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getClipRetentionAsks:P(d({}),py,{auth:`admin`}),listDeviceMutes:P(d({}),d({mutedDeviceIds:b(a().int()).readonly()}),{auth:`admin`}),setDeviceMuted:P(d({deviceId:a().int(),muted:x()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),testRule:P(d({rule:wv,lookbackMinutes:a().int().min(1).max(1440).default(60)}),d({results:b(Mv)}),{kind:`mutation`,auth:`admin`}),previewStateSummary:P(d({rule:wv}),jv,{kind:`mutation`,auth:`admin`,access:`view`}),getConditionCatalog:P(d({}),d({catalog:b(Hv),taxonomy:x_.optional()})),getTemplateCatalog:P(d({}),d({vars:b(Rv)})),previewTemplate:P(Bv,Vv,{kind:`mutation`,access:`view`}),getHistory:P(d({filter:Jv.default({limit:100})}),d({entries:b(qv)}),{auth:`admin`}),getRuleLastRuns:P(d({}),Xv,{auth:`admin`}),resolveArtifactUrl:P(d({artifactId:l().min(1)}),d({url:l().nullable()}),{auth:`admin`}),listSnoozes:P(d({}),d({snoozes:b($v)}),{caller:`required`}),createSnooze:P(d({snooze:Qv}),d({snooze:$v}),{kind:`mutation`,caller:`required`}),cancelSnooze:P(d({snoozeId:l()}),d({success:m(!0)}),{kind:`mutation`,caller:`required`}),getAlarmConfig:P(d({}),dy,{auth:`admin`}),setAlarmConfig:P(d({patch:ry}),dy,{kind:`mutation`,auth:`admin`})}},hy=y([`view`,`create`,`delete`]),gy=f([m(`*`),b(l())]),_y=_(l(),f([m(`*`),b(l())])),vy=y([`device`,`system`]),yy=p(`kind`,[d({kind:m(`all`)}),d({kind:m(`ids`),ids:b(a().int()).min(1)}),d({kind:m(`types`),types:b(y(L)).min(1)}),d({kind:m(`locations`),locations:b(l().min(1)).min(1)})]),by=d({type:m(`device`),selector:yy,access:b(hy).min(1),includeLinked:x().optional()});function xy(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 G=r(xy,p(`type`,[d({type:m(`category`),target:vy,access:b(hy).min(1)}),d({type:m(`capability`),target:l(),access:b(hy).min(1)}),d({type:m(`addon`),target:l(),access:b(hy).min(1)}),by])),Sy=d({id:l(),username:l(),passwordHash:l(),isAdmin:x().default(!1),allowedProviders:gy,allowedDevices:_y,scopes:b(G).default([]),createdAt:a(),updatedAt:a()}),Cy=d({id:l(),label:l(),isAdmin:x().default(!1),allowedProviders:gy,allowedDevices:_y,tokenHash:l(),tokenPrefix:l(),createdAt:a(),lastUsedAt:a().optional()}),wy=d({id:l(),userId:l(),name:l(),tokenHash:l(),tokenPrefix:l(),scopes:b(G),expiresAt:a().nullish(),lastUsedAt:a().nullish(),createdAt:a()}),Ty=d({integrationId:l(),displayName:l(),requestedScopes:b(G),allowedRedirectPrefixes:b(l()).min(1),allowedPrivateHostPaths:b(l()).optional(),requiresPkce:x().optional(),hubUrl:l().optional(),refreshTokenTtlSec:f([a().int().positive(),m(`never`)]).optional()}),Ey={name:`oauth-integration`,scope:`system`,mode:`collection`,internal:!0,methods:{getDescriptor:P(g(),Ty,{auth:`admin`})}},Dy=[`owner-not-ready`,`store-read-failed`,`three-way-read-unavailable`,`invalid-stored`,`not-cluster-scoped`],Oy=[{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)`}]}],ky=`cluster-step-models`;function Ay(e){return`clusterModel:${e}`}function jy(e){return Oy.some(t=>t.stepId===e)}var My=Object.freeze(Object.fromEntries(Oy.map(e=>[e.stepId,e.defaultModelId])));function Ny(e){return e==null||e===``?{kind:`absent`}:typeof e==`string`?{kind:`chosen`,modelId:e}:{kind:`invalid`,value:e}}function Py(e){let t=[];for(let n of Oy){let r=Ny(e[Ay(n.stepId)]);r.kind===`invalid`&&t.push({stepId:n.stepId,value:r.value})}return t}function Fy(e){let t={};for(let n of Oy){let r=Ny(e[Ay(n.stepId)]);t[n.stepId]=r.kind===`chosen`?r.modelId:n.defaultModelId}return t}function Iy(e){return typeof e==`object`&&!!e&&`key`in e}function Ly(e){return e===null?My:Fy(By(e,zy()))}function Ry(e){return e===null?[]:Py(By(e,zy()))}function zy(){return new Set(Oy.map(e=>Ay(e.stepId)))}function By(e,t){let n={};for(let r of e.sections)for(let e of r.fields)!Iy(e)||typeof e.key!=`string`||t.has(e.key)&&(n[e.key]=e.value);return n}function Vy(e,t){let n=Oy.find(t=>t.stepId===e);if(n===void 0)return null;let r=t[e];return r!==void 0&&r!==``?r:n.defaultModelId}var Hy=[{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 Uy(e,t){return`clusterStepSetting:${e}:${t}`}function Wy(e){return Hy.filter(t=>t.stepId===e)}var Gy=a().finite();function Ky(e){let t={};for(let n of Hy){let r=Gy.safeParse(e[Uy(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 qy=Ky({});function Jy(e){return e===null?qy:Ky(By(e,new Set(Hy.map(e=>Uy(e.stepId,e.key)))))}function Yy(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 Xy=y([`new`,`entered`,`left`,`moving`,`idle`]),Zy=y([`motion`,`object`,`audio`]),Qy=p(`kind`,[A_,j_]),$y=y([`motion`,`audio`,`person`,`vehicle`,`animal`,`door`,`pir`,`smoke`,`water`,`button`,`package`,`generic`]),eb=y([`motion`,`audio`,`detection`,`sensor`,`control`,`custom`,`package`]),tb=y([`macro`,`sub`]),nb=d({kind:l(),labelKey:l(),label:l(),color:l(),iconId:l(),icon:$y,category:eb,parentKind:l().nullable(),level:tb,source:d({capName:l(),deviceId:a()})}),rb=d({deviceId:a(),kinds:b(nb).readonly()}),ib=d({id:l(),deviceId:a(),sourceDeviceId:a(),kind:l(),value:_(l(),s()).nullable(),timestamp:a()}),ab=d({x:a(),y:a(),timestamp:a(),bbox:z,source:y([`frame`,`recovery`]).optional(),score:a().optional()}),ob=d({timestamp:a(),position:ab,mediaId:a().int()}),sb=d({minX:a(),minY:a(),maxX:a(),maxY:a()}),cb=y([`full`,`slim`]),lb=d({label:l(),peakScore:a(),count:a(),firstAt:a(),lastAt:a()}),ub=y([`pipeline`,`onboard`,`sensor`,`audio`]),db=y([`none`,`staging`,`trained`]),fb={markForTrain:x().optional(),debug:x().optional(),debugNote:l().max(500).optional(),favourited:x().optional()},pb={retrainStatus:db.optional()},mb=d(fb),hb=d({trackId:l(),markForTrain:x(),debug:x(),debugNote:l(),favourited:x(),retrainStatus:db}),gb=f([m(1),m(2)]),_b=d({stepId:l(),modelId:l().optional(),decidedAt:a(),identityId:l().optional()}),vb={label:l().optional(),labelScore:a().optional(),labelMeta:_b.optional(),subLabel:l().optional(),subLabelScore:a().optional(),subLabelMeta:_b.optional()},yb=d({deviceId:a(),tracks:a().int(),files:a().int(),bytes:a().int()}),bb=d({generatedAt:a(),trackCount:a().int(),fileCount:a().int(),byteCount:a().int(),truncated:x(),devices:b(yb).readonly()}),xb=d({trackId:l(),deviceId:a(),className:l(),...vb,producingDeviceName:l().optional(),source:ub.optional(),firstSeen:a(),lastSeen:a(),positions:b(ab).readonly(),snapshots:b(ob).readonly(),zonesVisited:b(l()).readonly(),zoneNames:b(l()).readonly().optional(),classes:b(l()).readonly().optional(),totalDistance:a(),state:Xy,active:x(),importance:a().optional(),bestEventId:l().optional(),importanceReason:l().optional(),audioLabels:b(lb).readonly().optional(),envelope:sb.optional(),hasFace:x().optional(),hasEmbeddedFace:x().optional(),hasRider:x().optional(),previewMissReason:l().optional(),modelId:l().optional(),frameWidth:a().optional(),frameHeight:a().optional(),...fb,...pb}),Sb={id:a().int(),deviceId:a(),timestamp:a()},Cb=d({...Sb,kind:m(`motion`),regionCount:a(),regions:b(d({bbox:z,pixelCount:a(),intensity:a()})).readonly().optional(),frameWidth:a().optional(),frameHeight:a().optional(),mediaUrl:l().optional(),durationMs:a().nullable().optional(),edges:b(a()).readonly().optional()}),wb=y([`pipeline`,`onboard`]),Tb=y([`enter`,`exit`]),Eb=d({direction:Tb,zoneId:l(),zoneName:l().optional()}),Db=d({zoneId:l(),zoneName:l().optional(),overlapPct:a()}),Ob=d({...Sb,kind:m(`object`),source:wb.optional(),frameId:l().optional(),idempotencyKey:l().optional(),trackId:l().optional(),className:l(),...vb,confidence:a().optional(),bbox:z.optional(),zones:b(l()).readonly().optional(),zoneOverlaps:b(Db).readonly().optional(),spawnRefused:l().optional(),state:Xy.optional(),zoneCrossing:Eb.optional(),frameWidth:a().optional(),frameHeight:a().optional(),mediaId:a().int().optional(),keyFrameMediaId:a().int().optional(),mediaUrl:l().optional(),importance:a().optional()}),kb=d({...Sb,kind:m(`audio`),rms:a(),dbfs:a(),classification:d({className:l(),originalClass:l().optional(),score:a()}).optional(),classifyOutcome:Fl.optional(),mediaUrl:l().optional()}),Ab=y([`crop`,`thumbnail`,`snapshot`,`firstFrame`,`lastFrame`,`fullFrame`,`fullFrameBoxed`,`faceCrop`,`plateCrop`,`keyFrame`,`keyFrameSmall`,`thumbnailSmall`,`confirmationCrop`,`debugCrop`,`sceneFrame`,`lastSceneFrame`]),jb=d({mediaId:a().int(),kind:Ab,sizeBytes:a(),timestamp:a()}),Mb=jb.extend({url:l(),base64:l()}),Nb=Mb.omit({base64:!0}),Pb=y([`person`,`vehicle`,`animal`,`package`,`face`,`plate`]),Fb=y([`subject`,`model_error`]),Ib=y([`operator`,`assist`]),Lb=d({x:a(),y:a(),w:a(),h:a()}),Rb=d({id:l(),trackId:l(),deviceId:a(),mediaKey:l(),bbox:Lb,macroClass:Pb,label:l().optional(),subLabel:l().optional(),kind:Fb,source:Ib,assistModelId:l().optional(),assistScore:a().optional(),exportedInBatch:l().optional(),createdAt:a()}),zb=Rb.omit({id:!0,trackId:!0,deviceId:!0,mediaKey:!0,createdAt:!0,exportedInBatch:!0}),Bb=d({trackId:l(),deviceId:a(),className:l(),label:l().optional(),firstSeen:a(),lastSeen:a(),frameCount:a().int(),annotationCount:a().int()}),Vb=d({mediaId:a().int(),kind:Ab,timestamp:a(),sizeBytes:a().int(),copied:x()}),Hb=d({frameId:l(),deviceId:a(),trackId:l(),sourceMediaId:a().int(),sourceKind:Ab,sizeBytes:a().int(),width:a().int(),height:a().int(),copiedAt:a()}),Ub=y([`source-missing`,`unreadable-image`,`write-failed`]),Wb=d({copied:b(Hb).readonly(),refused:b(d({sourceMediaId:a().int(),reason:Ub})).readonly()}),Gb=d({candidates:b(Vb).readonly(),copies:b(Hb).readonly(),autoPickMediaId:a().int().optional()}),Kb=p(`kind`,[d({kind:m(`package`),zone:Lb.optional()}),d({kind:m(`objects`),modelId:l(),minScore:a().optional()})]),qb=p(`kind`,[d({kind:m(`proposed`),modelId:l(),stepId:l(),minScore:a(),proposals:b(zb).readonly(),belowThreshold:a().int()}),d({kind:m(`refused`),reason:l(),detail:l().optional()})]),Jb=d({trackId:l(),retrainStatus:db,changed:x(),reason:y([`unknown-track`,`no-frames-copied`,`not-staging`,`not-trained`,`unchanged`]).optional()}),Yb=1e3,Xb=5e3,Zb=d({deviceId:a(),since:a().optional(),until:a().optional(),limit:a().int().min(1).max(Xb).default(Yb),projection:y([`full`,`slim`]).optional()}),Qb=Zb.extend({classFilter:l().optional()}),$b=d({deviceIds:b(a()),since:a().optional(),until:a().optional(),limit:a().int().min(1).max(1e3).default(200),cursor:l().optional(),projection:cb.optional(),includeStationary:x().optional(),classes:b(l()).optional(),excludeSources:b(ub).optional()}),ex=d({id:l(),deviceId:a(),openedAt:a(),lastActiveAt:a(),sealedAt:a().nullable(),memberCount:a().int().nonnegative(),groupShotMediaId:a().int().nullable()}),tx=d({deviceIds:b(a()).min(1),since:a().optional(),until:a().optional(),limit:a().int().min(1).max(200).default(50),classes:b(l().min(1).max(60)).max(40).optional()}),nx=d({summary:ex,members:b(d({trackId:l(),className:l().nullable(),role:y([`primary`,`sibling`,`child`]).nullable(),joinedAt:a(),label:l().optional(),subLabel:l().optional()})).readonly()}),rx=d({summary:ex,classes:b(d({className:l().nullable(),count:a().int().positive()})).readonly()}),ix=d({summaries:b(rx).readonly()}),ax=d({deviceIds:b(a()),since:a().optional(),until:a().optional(),limit:a().int().min(1).max(500).default(100),cursor:l().optional(),classes:b(l().min(1).max(60)).max(40).optional()}),ox=d({summaries:b(rx).readonly(),nextCursor:l().nullable()}),sx=d({tracks:b(xb).readonly(),nextCursor:l().nullable()}),cx=50,lx=200,ux=d({deviceId:a(),since:a(),until:a(),limit:a().int().min(1).max(lx).default(cx),minImportance:a().min(0).max(1).optional(),classFilter:l().optional()}),dx=d({id:l(),trackId:l(),timestamp:a(),className:l(),...vb,importance:a(),bestEventId:l(),windowMs:a().optional(),...fb,...pb}),fx=d({deviceIds:b(a()).min(1).max(200),since:a(),until:a(),limit:a().int().min(1).max(lx).default(cx),minImportance:a().min(0).max(1).optional(),classFilter:l().optional()}),px=d({deviceId:a(),events:b(dx).readonly()}),mx=d({bucketStart:a(),motion:a().int(),object:a().int(),audio:a().int(),audioDbfs:a().optional()}),hx=d({deviceId:a(),read:y([`read`,`unreadable`]),buckets:b(mx).readonly()}),gx=d({trackId:l(),className:l(),confidence:a(),bbox:z,zones:b(l()).readonly(),state:Xy}),_x=o({id:l(),kind:y([`first-level`,`detail`]),macroClass:l(),score:a(),bbox:d({x:a(),y:a(),width:a(),height:a()}),labels:b(o({label:l(),score:a()})).readonly(),parentId:l().optional()}),vx=Ob.extend({score:a()}),yx=d({text:l(),deviceId:a().optional(),since:a().optional(),until:a().optional(),classFilter:l().optional(),limit:a().default(50),minScore:a().min(0).max(1).optional(),strictness:is.optional(),modelId:l().min(1).optional()}),bx=d({tracks:a().int(),events:a().int(),media:a().int(),faces:a().int(),plates:a().int(),embeddings:a().int()}),xx=d({mediaDropped:a().int(),tracks:a().int(),events:a().int()}),Sx=d({deviceId:a(),rows:a().int(),bytes:a().int()}),Cx=d({totalRows:a().int(),totalBytes:a().int(),devices:b(Sx).readonly()}),wx=d({kind:Ab,rows:a().int(),bytes:a().int()}),Tx=d({totalRows:a().int(),totalBytes:a().int(),kinds:b(wx).readonly(),unaccountedRows:a().int(),unaccountedBytes:a().int()}),Ex=d({motion:a().int(),object:a().int(),audio:a().int()}),Dx=d({deviceId:a().optional(),since:a().optional(),until:a().optional(),maxTracks:a().int().positive().optional(),executeOnNodeId:l().optional(),pacingMs:a().int().nonnegative().optional(),force:x().optional()}),Ox=d({deleted:a(),failedIndexes:b(l()).optional()}),kx=y([`stores-unavailable`,...Dy,`method-unavailable`,`read-failed`,`reads-disagree`,`not-a-clip-model`,`force-requires-max-tracks`]),Ax=d({started:x(),alreadyRunning:x(),refusal:kx.optional(),modelId:l().optional(),index:l().optional()}),jx=d({running:x(),scanned:a(),rebuilt:a(),missingKeyFrame:a(),missingEvent:a(),missingBbox:a(),boxSource:d({subjectBox:a(),positions:a(),event:a(),refused:a()}),alreadyInSpace:a(),force:x().nullable(),forcedInSpace:a(),notRunnable:a(),noCapableNode:a(),failed:a(),complete:x().nullable(),startedAtMs:a().nullable(),finishedAtMs:a().nullable(),error:l().nullable(),modelId:l().nullable(),index:l().nullable()}),Mx=d({started:x(),alreadyRunning:x()}),Nx=d({mode:y([`report`,`reclaim`]).default(`report`),scopes:b(y([`motion-still`,`track-filmstrip`])).min(1).optional(),deviceIds:b(a().int()).min(1).optional(),restart:x().optional(),pageSize:a().int().min(50).max(5e3).optional(),maxRowsPerDevice:a().int().min(1).max(5e5).optional(),maxReclaimPerDevice:a().int().min(1).max(5e5).optional(),maxBytesPerRun:a().int().min(1).optional(),budgetMinutes:a().int().min(1).max(720).optional(),throttleBytesPerSec:a().int().min(64*1024).optional(),graceMinutes:a().int().min(1).max(10080).optional()}),Px=d({running:x(),mode:y([`report`,`reclaim`]).nullable(),totalExamined:a(),totalEligible:a(),totalReclaimed:a(),totalBytesReclaimed:a(),totalRefused:a(),devicesDone:a(),complete:x().nullable(),startedAtMs:a().nullable(),finishedAtMs:a().nullable(),error:l().nullable()}),Fx=y([`motion`,`audio-dbfs`,`battery`,`occupancy`]);function Ix(e,t){let n=e??``;return t===void 0?n:`${n}|${t}`}function Lx(e){let t=e.indexOf(`|`);return t<0?{zoneId:e}:{zoneId:e.slice(0,t),className:e.slice(t+1)}}var Rx=d({scope:l(),bucketStart:a().int(),samples:a().int().nonnegative(),sum:a(),min:a(),max:a()}),zx={name:`pipeline-analytics`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[L.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:P(d({deviceId:a()}),b(xb).readonly()),getTrack:P(d({deviceId:a(),trackId:l()}),xb.nullable()),listTracks:P(d({deviceId:a(),since:a().optional(),until:a().optional(),limit:a().optional(),zone:Qy.optional(),projection:cb.optional(),includeStationary:x().optional(),classes:b(l()).optional(),excludeSources:b(ub).optional()}),b(xb).readonly()),listRecentTracks:P($b,sx),listSummaries:P(tx,ix),listRecentSummaries:P(ax,ox),getSummary:P(d({id:l()}),nx.nullable()),clearTracks:P(d({deviceId:a()}),g(),{kind:`mutation`,auth:`admin`}),getMotionEvents:P(Zb,b(Cb).readonly()),getObjectEvents:P(Qb,b(Ob).readonly()),getAudioEvents:P(Zb,b(kb).readonly()),listEventKinds:P(d({deviceId:a()}),b(nb).readonly()),listEventKindsBatch:P(d({deviceIds:b(a()).min(1).max(200)}),b(rb).readonly()),getSensorEvents:P(d({deviceId:a(),since:a().optional(),until:a().optional(),kinds:b(l()).optional(),limit:a().int().min(1).max(Xb).default(Yb)}),b(ib).readonly()),getKeyEvents:P(ux,b(dx).readonly()),getKeyEventsBatch:P(fx,b(px).readonly()),readLongTermSeries:P(d({deviceId:a(),series:Fx,scope:l().optional(),from:a(),to:a(),limit:a().int().positive().optional()}),b(Rx).readonly()),getEventDensity:P(d({deviceId:a(),since:a(),until:a(),bucketMs:a().int().positive()}),b(mx).readonly()),getEventDensityBatch:P(d({deviceIds:b(a()).min(1).max(200),since:a(),until:a(),bucketMs:a().int().positive()}),b(hx).readonly()),pruneEventsBefore:P(d({deviceId:a(),cutoffMs:a()}),d({motion:a().int(),object:a().int(),audio:a().int()}),{kind:`mutation`,auth:`admin`}),pruneTracksBefore:P(d({deviceId:a(),cutoffMs:a()}),bx,{kind:`mutation`,auth:`admin`}),wipeAllAnalytics:P(d({deviceId:a()}),bx,{kind:`mutation`,auth:`admin`}),reconcileFromDisk:P(d({deviceId:a()}),xx,{kind:`mutation`,auth:`admin`}),deleteTracks:P(d({deviceId:a(),trackIds:b(l()).min(1)}),d({deleted:a().int(),failed:b(l()).readonly()}),{kind:`mutation`,auth:`admin`}),setTrackFlags:P(d({deviceId:a(),trackId:l(),flags:mb}),hb,{kind:`mutation`}),listArchivedDebugNotes:P(gr,b(hr).readonly(),{kind:`query`}),listBirthDecisions:P(pr,b(fr).readonly(),{kind:`query`}),getEventStoreFootprint:P(d({}),Cx,{kind:`query`,auth:`admin`}),getEventMediaFootprintByKind:P(d({deviceId:a().int().optional()}),Tx,{kind:`query`,auth:`admin`}),pruneEvents:P(d({olderThanMs:a(),reason:Mr.optional()}),Ex,{kind:`mutation`,auth:`admin`}),deleteDeviceEvents:P(d({deviceId:a()}),Ex,{kind:`mutation`,auth:`admin`}),pauseForStorageMigration:P(T,d({paused:m(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:P(T,d({resumed:m(!0)}),{kind:`mutation`,auth:`admin`}),refreshStorageLocationsForMigration:P(T,d({refreshed:m(!0)}),{kind:`mutation`,auth:`admin`}),startStorageMigrationMove:P(Gi,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),getStorageMigrationMoveStatus:P(d({jobId:l()}),Li.nullable(),{auth:`admin`}),cancelStorageMigrationMove:P(d({jobId:l()}),d({cancelled:x()}),{kind:`mutation`,auth:`admin`}),relocateMedia:P(Hi,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),countUnstampedEventMedia:P(d({}),Wi,{auth:`admin`}),countRelocatableMedia:P(va,_a,{kind:`query`,auth:`admin`}),listRelocateMediaJobs:P(d({}),b(Li).readonly(),{kind:`query`,auth:`admin`}),cancelRelocateMedia:P(d({jobId:l()}),d({cancelled:x()}),{kind:`mutation`,auth:`admin`}),listOpsLog:P(Pr,b(Nr).readonly(),{kind:`query`,auth:`admin`}),reclaimDebugMedia:P(Nx,Mx,{kind:`mutation`,auth:`admin`}),getMediaReclaimStatus:P(d({}),Px,{kind:`query`,auth:`admin`}),getTrainingExportSummary:P(d({deviceIds:b(a()).optional()}),bb,{kind:`query`,auth:`admin`}),getTrainingExportUrl:P(d({deviceIds:b(a()).optional()}),d({url:l()}),{kind:`query`,auth:`admin`}),listRetrainStaging:P(d({deviceIds:b(a()).optional(),limit:a().int().min(1).max(500).optional()}),b(Bb).readonly(),{kind:`query`,auth:`admin`}),listRetrainFrames:P(d({trackId:l()}),Gb,{kind:`query`,auth:`admin`}),selectRetrainFrames:P(d({deviceId:a(),trackId:l(),mediaIds:b(a().int()).min(1)}),Wb,{kind:`mutation`,auth:`admin`}),deselectRetrainFrame:P(d({deviceId:a(),trackId:l(),frameId:l()}),d({removed:x(),removedAnnotations:a().int()}),{kind:`mutation`,auth:`admin`}),getRetrainFrameImage:P(d({frameId:l()}),d({base64:l(),width:a().int(),height:a().int()}),{kind:`query`,auth:`admin`}),proposeRetrainAnnotations:P(d({deviceId:a(),trackId:l(),frameId:l(),subject:Kb,nodeId:l().optional()}),qb,{kind:`mutation`,auth:`admin`}),listRetrainAnnotations:P(d({trackId:l()}),b(Rb).readonly(),{kind:`query`,auth:`admin`}),saveRetrainAnnotations:P(d({deviceId:a(),trackId:l(),frameId:l(),annotations:b(zb)}),b(Rb).readonly(),{kind:`mutation`,auth:`admin`}),completeRetrainTrack:P(d({deviceId:a(),trackId:l()}),Jb,{kind:`mutation`,auth:`admin`}),restageRetrainTrack:P(d({deviceId:a(),trackId:l()}),Jb,{kind:`mutation`,auth:`admin`}),getRetrainExportUrl:P(d({deviceIds:b(a()).optional()}),d({url:l()}),{kind:`query`,auth:`admin`}),getEventMedia:P(d({ownerType:Me,eventId:a().int(),kind:Ab.optional(),deviceId:a()}),b(Mb).readonly()),getTrackMedia:P(d({trackId:l(),kinds:b(Ab).optional(),deviceId:a()}),b(Mb).readonly()),listTrackMedia:P(d({trackId:l(),deviceId:a()}),b(Nb).readonly()),listEventMedia:P(d({ownerType:Me,eventId:a().int(),deviceId:a()}),b(Nb).readonly()),ownersWithMedia:P(d({deviceId:a(),ownerKind:Pe,ownerIds:b(l()).max(5e3)}),b(l()).readonly()),searchObjectEvents:P(yx,b(vx).readonly(),{caller:`required`}),wipeObjectEmbeddings:P(d({}),Ox,{kind:`mutation`,auth:`admin`}),rebuildObjectEmbeddings:P(Dx,Ax,{kind:`mutation`,auth:`admin`}),getObjectEmbeddingRebuildStatus:P(d({}),jx)},events:{onFrameTracked:{data:d({deviceId:a(),timestamp:a(),frameWidth:a(),frameHeight:a(),detections:b(_x).readonly()})},onTrackStarted:{data:d({deviceId:a(),trackId:l(),className:l()})},onTrackEnded:{data:d({deviceId:a(),trackId:l(),className:l(),durationMs:a()})},onDetectionEvent:{data:d({deviceId:a(),kind:Zy,eventId:l(),timestamp:a()})}}},Bx=d({handle:w,cropFrameSpace:d({x:a(),y:a(),w:a(),h:a()})});d({crop:d({left:a(),top:a(),width:a().positive(),height:a().positive()}).optional(),content:d({width:a().int().positive(),height:a().int().positive()}),fit:y([`stretch`,`contain`]),format:y([`rgb`,`gray`,`jpeg`])});var Vx=d({registryId:l().min(1),id:l().min(1),width:a().int().positive(),height:a().int().positive(),format:y([`rgb`,`gray`]),timestamp:a(),capturedAt:a().optional()}),Hx=y([`onnx`,`coreml`,`openvino`,`tflite`,`pt`,`gguf`]),Ux=y([`detector`,`cropper`,`classifier`,`refiner`,`audio-classifier`]),K=d({runtime:m(`python`),backend:l(),format:Hx,device:l().optional()}),Wx=d({deviceKey:l().nullable(),runtime:l(),batchMode:l(),windowMs:a(),maxBatchSize:a(),concurrency:a(),numWorkers:a()}),Gx=d({engine:K,devices:b(d({id:l(),label:l(),description:l().optional()})).readonly(),defaultDevice:l()}),Kx=he(()=>d({addonId:l(),addonName:l(),slot:Ux,inputClasses:b(l()).readonly(),outputClasses:b(l()).readonly(),enabled:x(),modelId:l(),children:b(Kx).readonly(),group:l().optional(),settings:_(l(),s()).optional()})),qx=he(()=>d({addonId:l(),enabled:x(),modelId:l(),children:b(qx).readonly(),settings:_(l(),s()).optional()})),Jx=d({id:l(),name:l(),createdAt:l(),updatedAt:l(),engine:K,steps:b(qx).readonly()}),Yx=d({id:l(),name:l(),formats:_(l(),d({downloaded:x(),sizeMB:a()})),group:ds.optional(),legacy:x().optional(),provider:ps.optional(),defaultConfidence:a().optional()}),Xx=h(),Zx=d({id:l(),name:l(),slot:Ux,inputClasses:b(l()).readonly(),outputClasses:b(l()).readonly(),childSlots:b(Ux).readonly(),models:b(Yx).readonly(),defaultModelId:l(),defaultModelIdByFormat:_(l(),l()).optional(),enabledByDefault:x().optional(),backfillIntoExistingOverrides:x().optional(),defaultConfidence:a(),group:l().optional(),configSchema:b(Xx).readonly().optional()}),Qx=d({id:Ux,label:l(),priority:a(),parentSlot:Ux.nullable(),addons:b(Zx).readonly()}),$x=d({availableEngines:b(Gx).readonly(),selectedEngine:K,slots:b(Qx).readonly()}),eS=d({runtimeId:y([`onnx`,`openvino`,`coreml`,`edgetpu`]).nullable(),device:l().nullable(),state:y([`idle`,`installing`,`verifying`,`ready`,`failed`]),progress:a().optional(),error:l().optional(),nextRetryAt:a().optional(),configIssues:b(l()).optional()}),tS=he(()=>d({addonId:l(),modelId:l().optional(),enabled:x().default(!0),children:b(tS).optional(),settings:_(l(),s()).optional(),jumpDeviceKey:l().optional()})),nS=d({addonId:l(),chosen:l(),running:l(),format:l()}),rS=d({addonId:l(),kind:y([`unknown-addon`,`no-format-build`,`unknown-device`]),detail:l()}),iS=d({ok:x(),issues:b(rS).readonly(),substitutions:b(nS).readonly(),format:l()}),aS=d({filename:l(),stepIds:b(l()).readonly().optional()}),oS=d({base64:l(),filename:l()}),sS=d({filename:l(),sizeKb:a()}),cS=d({base64:l()}),lS=d({id:l(),name:l(),description:l(),available:x(),rawLabels:b(l()).readonly().optional()}),uS=d({activeBackend:l(),availableBackends:b(lS).readonly(),sampleRate:a(),chunkDurationMs:a()}),dS=d({filePath:l(),sizeMB:a(),durationMs:a()}),fS=d({success:x(),error:l().optional(),frame:h().optional()}),pS=h(),mS=h(),hS=h(),gS=h(),_S=h(),vS=h(),yS={name:`pipeline-executor`,scope:`system`,mode:`singleton`,methods:{getAvailableEngines:P(g(),b(K)),getSelectedEngine:P(g(),K),getDefaultSteps:P(K,b(Kx)),getEngineProvisioning:P(d({nodeId:l()}),eS),getVideoPipelineSteps:P(g(),_(l(),d({modelId:l(),settings:_(l(),s()).readonly()}))),setVideoPipelineSteps:P(d({steps:_(l(),d({modelId:l(),settings:_(l(),s()).readonly()}))}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),clearDeviceOverrides:P(d({nodeId:l()}),d({success:m(!0),clearedDevices:a()}),{kind:`mutation`,auth:`admin`}),getInferenceDeviceHealth:P(d({nodeId:l()}),d({unhealthy:b(d({deviceKey:l(),state:y([`failed`,`backoff`]),since:a(),deaths:a(),lastError:l()})).readonly()})),rearmInferenceDevice:P(d({nodeId:l(),deviceKey:l()}),d({rearmed:x()}),{kind:`mutation`,auth:`admin`}),getSchema:P(g(),$x),getGlobalSteps:P(g(),b(Kx).readonly().nullable()),getGlobalPipelineConfig:P(g(),pS),getOrchestratorConfigSchema:P(g(),mS),validatePipeline:P(d({steps:b(tS),deviceKey:l().optional()}),iS),listTemplates:P(g(),b(Jx).readonly()),saveTemplate:P(d({name:l(),steps:b(qx).readonly(),engine:K}),Jx,{kind:`mutation`}),updateTemplate:P(d({id:l(),name:l().optional(),steps:b(qx).readonly().optional()}),Jx,{kind:`mutation`}),deleteTemplate:P(d({id:l()}),g(),{kind:`mutation`}),getCapabilities:P(g(),gS),getAddonModels:P(d({addonId:l()}),_S),downloadModel:P(d({addonId:l(),modelId:l(),format:Hx}),dS,{kind:`mutation`}),deleteModel:P(d({addonId:l(),modelId:l(),format:Hx}),d({success:m(!0)}),{kind:`mutation`}),runPipeline:P(d({steps:b(tS).min(1),frame:kl.optional(),frameRef:Vx.optional(),frameHandle:w.optional(),imageBase64:l().optional(),image:v(Uint8Array).optional(),referenceImage:l().optional(),deviceId:a().optional(),sessionId:l().optional(),plane:y([`full`,`frame`]).optional(),deviceKey:l().optional(),nativeCropRef:Bx.optional(),replay:m(!0).optional()}),vS,{kind:`mutation`}),runPipelineBatch:P(d({steps:b(tS).min(1),frames:b(kl).min(1).max(255),deviceId:a().optional(),sessionId:l().optional(),frameId:a().int().nonnegative().optional(),deviceKey:l().optional()}),d({results:b(vS).readonly()}),{kind:`mutation`}),cacheFrameInPool:P(d({data:v(Uint8Array),width:a().int().positive(),height:a().int().positive(),format:y([`rgb`,`bgr`,`gray`])}),d({frameId:a(),width:a(),height:a()}),{kind:`mutation`}),inferCached:P(d({stepId:l(),frameId:a().int(),modelId:l().min(1)}),_(l(),s()),{kind:`mutation`}),uncacheFrame:P(d({frameId:a().int()}),g(),{kind:`mutation`}),getEffectiveTuning:P(d({deviceKey:l().optional()}),Wx),listLoadedEngines:P(g(),b(d({engineKey:l(),engine:K,modelsLoaded:b(l()).readonly(),inUseByCameras:b(a()).readonly(),kind:y([`runtime`,`device-pool`]),poolPid:a().nullable(),idleMs:a().nullable(),idleTtlMs:a().nullable()})).readonly()),spinEngine:P(d({engine:K}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),killEngine:P(d({engine:K,force:x().optional()}),d({success:x(),reason:l().optional()}),{kind:`mutation`,auth:`admin`}),listReferenceImages:P(g(),b(aS).readonly()),getReferenceImage:P(d({filename:l()}),oS.nullable()),getReferenceAudioFiles:P(g(),b(sS).readonly()),getReferenceAudio:P(d({filename:l()}),cS.nullable()),getAudioCapabilities:P(g(),uS),runAudioTest:P(d({addonId:l(),modelId:l(),filename:l().optional(),settings:_(l(),s()).optional()}),fS,{kind:`mutation`}),getDetectionConfigSchema:P(g(),hS)}},bS=d({activeCameras:a(),throttledCameras:a(),avgInferenceTimeMs:a(),queueDepth:a()}),xS=d({detectionMode:y([`disabled`,`always-on`,`on-motion`]),configuredFps:a(),actualFps:a(),queueDepth:a(),avgInferenceTimeMs:a(),droppedFrames:a(),phase:y([`idle`,`watching`,`active`])}),SS=xS.extend({deviceId:a()}),CS=y([`polygon`,`tripwire`]),wS=d({x:a(),y:a()}),TS=d({id:l(),name:l(),kind:CS.default(`polygon`),polygon:b(wS).readonly(),color:l().default(`#3b82f6`)}),ES={name:`zones`,scope:`device`,mode:`singleton`,deviceTypes:[L.Camera],methods:{listZones:P(d({deviceId:a()}),b(TS).readonly()),addZone:P(d({deviceId:a(),zone:TS}),g(),{kind:`mutation`,auth:`admin`}),removeZone:P(d({deviceId:a(),zoneId:l()}),g(),{kind:`mutation`,auth:`admin`}),updateZone:P(d({deviceId:a(),zone:TS}),g(),{kind:`mutation`,auth:`admin`})},runtimeState:d({zones:b(TS).readonly()}),durability:`restored`},DS=d({x:a(),y:a(),w:a(),h:a()}),OS=d({bytes:v(Uint8Array).optional(),jpeg:l().optional(),jpegBytes:v(Uint8Array).optional(),width:a().int().positive(),height:a().int().positive(),tier:y([`native`,`ram-fullframe`]).optional()}),kS=y([`keyFrame`,`thumbnail`]),AS=y([`handle-gone`,`encode-failed`]),jS=p(`parked`,[d({parked:m(!0),nodeId:l(),width:a().int().positive(),height:a().int().positive(),bytes:a().int().nonnegative(),replaced:x()}),d({parked:m(!1),nodeId:l(),reason:AS,handleAgeMs:a().nullable(),detail:l().optional()})]),MS=d({jpeg:l().optional(),jpegBytes:v(Uint8Array).optional(),width:a().int().positive(),height:a().int().positive(),timestamp:a(),parkedAt:a()}),NS=d({bbox:DS,className:l()}),PS=d({stepId:l(),className:l(),score:a(),bbox:DS.optional(),embedding:l().optional(),embeddingMagnitude:a().optional(),embeddingModelId:l().optional(),label:l().optional(),labelTier:f([m(1),m(2)]).optional(),labelModelId:l().optional(),alignedCropJpeg:l().optional(),nativeFaceShortSidePx:a().optional(),landmarks:b(d({x:a(),y:a()})).optional()}),FS=y([`unknown-step`,`model-not-servable`,`unreadable-frame`,`execution-failed`]),IS=p(`kind`,[d({kind:m(`ran`),nodeId:l(),modelId:l(),details:b(PS)}),d({kind:m(`refused`),nodeId:l(),reason:FS,detail:l()})]),LS={min:0,max:6e4,default:3e4,step:500},RS={min:0,max:6e5,default:12e4,step:5e3},zS={min:5e3,max:6e5,default:9e4,step:5e3},BS={min:1,max:30,default:4,step:1},VS={min:1,max:30,default:10,step:1},HS={min:0,max:300,default:300,step:5},US={min:1,max:10,default:4,step:1},WS={min:0,max:30,default:12,step:1},GS=y([`onboard`,`analyzer`,`device-activity`]),KS=b(GS),qS=r(e=>Array.isArray(e)&&e.length>1?e.slice(0,1):e,b(wb).max(1)),JS=d({deviceId:a(),detected:x(),source:GS.default(`analyzer`),regions:b(yg).readonly().optional()}),YS=p(`kind`,[d({kind:m(`local-broker`)}),d({kind:m(`remote-restream`),ownerNodeId:l(),ownerReachableHost:l().optional(),hubHostnameOverride:l().optional()})]).describe(`Per-camera frame-source mode for the runner (P2c)`),XS=d({modelId:l().optional(),settings:_(l(),s()).optional()}),ZS=d({deviceKey:l(),weight:a().positive().default(1),maxSessions:a().int().positive().nullable().default(null),steps:_(l(),XS).optional()}),QS=d({deviceId:a(),detectionMode:y([`disabled`,`always-on`,`on-motion`]).default(`on-motion`),audioMode:y([`disabled`,`always-on`,`on-motion`]).default(`always-on`),motionCooldownMs:a().min(LS.min).default(LS.default),maxSessionHoldMs:a().min(RS.min).max(RS.max).optional(),audioMotionWindowMs:a().min(zS.min).max(zS.max).optional(),motionFps:a().min(BS.min).max(BS.max).default(BS.default),detectionFps:a().min(VS.min).max(VS.max).default(VS.default),motionStreamId:l(),detectionStreamId:l(),audioStreamPick:Ir.optional(),motionSources:KS.default([`analyzer`]),detectionSources:qS.default([`pipeline`]),pipelineEnabled:x().default(!0),steps:b(tS).readonly().optional(),audio:d({modelId:l().optional(),enabled:x()}).nullable().optional(),zones:b(TS).readonly().default([]),onboardMotionDrivesAnalyzer:x().default(!0),preRollInferenceEnabled:x().default(!0),preRollInferenceFrames:a().min(WS.min).max(WS.max).default(WS.default),occupancyRecheckEnabled:x().default(!0),occupancyRecheckSec:a().min(HS.min).max(HS.max).default(HS.default),occupancyRecheckFrames:a().min(US.min).max(US.max).default(US.default),frameSource:YS.default({kind:`local-broker`}),deviceKey:l().optional(),inferenceDevices:b(ZS).readonly().optional()}),$S=[{key:`motionSources`,type:`multiselect`,label:`Motion Sources`,default:[`analyzer`],options:[{value:`analyzer`,label:`Frame-diff Analyzer (motion addon)`},{value:`onboard`,label:`Camera Onboard Sensor`},{value:`device-activity`,label:`Device activity (the device says it is working)`}]},{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:BS.min,max:BS.max,step:BS.step,default:BS.default,showValue:!0,unit:`fps`,nullable:!0,nullLabel:`Default`,showWhen:{field:`motionSources`,includes:`analyzer`}},{key:`detectionFps`,type:`slider`,label:`Detection FPS`,min:VS.min,max:VS.max,step:VS.step,default:VS.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:LS.min,max:LS.max,step:LS.step,default:LS.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:RS.min,max:RS.max,step:RS.step,default:RS.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:zS.min,max:zS.max,step:zS.step,default:zS.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:WS.min,max:WS.max,step:WS.step,default:WS.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:HS.min,max:HS.max,step:HS.step,default:HS.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:US.min,max:US.max,step:US.step,default:US.default,showValue:!0,showWhen:{field:`occupancyRecheckEnabled`,equals:!0}}],eC=d({nodeId:l(),attachedCameras:a(),activeCameras:a(),avgInferenceFps:a(),avgInferenceTimeMs:a(),queueDepthTotal:a(),devices:b(d({deviceKey:l(),backend:l(),attachedCameras:a(),queueDepthTotal:a()})).default([]),hardware:d({hasGpu:x(),inferenceBackend:l().optional(),cpuCores:a().optional()})}),tC=d({framesDecoded:a(),framesAdmitted:a(),framesDroppedPixelFree:a(),viewsMaterialized:a(),viewsSkipped:a(),workerToRunnerBytes:a(),runnerToPoolRawBytes:a(),runnerToPoolJpegBytes:a(),onDemandFullFrameRequests:a(),onDemandCropRequests:a(),nativeHits:a(),nativeMisses:a(),tileHits:a(),tileMisses:a(),fallbackHits:a(),fallbackMisses:a(),retainedWritesAvoided:a(),residentRefs:a(),residentBytes:a(),releases:a(),evictions:a(),staleMisses:a()}),nC=d({node:tC,cameras:b(tC.extend({deviceId:a()}))}),rC=d({nodeId:l(),activeCameras:a(),throttledCameras:a(),avgInferenceTimeMs:a(),queueDepth:a(),frameLazy:nC.optional()}),iC=y([`not-attached`,`battery-asleep`,`not-watching`,`already-bursting`]),aC={name:`pipeline-runner`,scope:`system`,mode:`singleton`,methods:{attachCamera:P(QS,d({success:m(!0)}),{kind:`mutation`}),detachCamera:P(d({deviceId:a()}),d({success:m(!0)}),{kind:`mutation`}),reportMotion:P(JS,d({success:m(!0)}),{kind:`mutation`}),getLocalLoad:P(g(),eC),getLocalMetrics:P(g(),rC),getCameraMetrics:P(d({deviceId:a()}),xS.nullable()),getAllCameraMetrics:P(g(),b(SS).readonly()),getLocalCameras:P(g(),b(a()).readonly()),requestOccupancyBurst:P(d({deviceId:a(),frames:a().int().positive().optional(),reason:l()}),d({started:x(),refusedBecause:iC.optional()}),{auth:`admin`,kind:`mutation`}),getNativeCrop:P(d({handle:w,bbox:DS,maxWidth:a().int().positive().optional(),acceptJpegBytes:x().optional(),encodeJpeg:x().optional()}),OS.nullable()),runDetailSubtree:P(d({deviceId:a(),frameHandle:w.optional(),frameJpeg:l().optional(),cropJpeg:l().optional(),parent:NS,steps:b(l()).optional()}),d({details:b(PS)}).nullable(),{kind:`mutation`}),runStatelessStep:P(d({stepId:l(),modelId:l(),frameJpeg:l(),bbox:DS,className:l(),sourceDeviceId:a()}),IS,{kind:`mutation`}),parkTrackFrame:P(d({deviceId:a(),trackId:l(),kind:kS,handle:w,bbox:DS,maxWidth:a().int().positive().optional(),timestamp:a()}),jS,{kind:`mutation`}),getParkedTrackFrame:P(d({deviceId:a(),trackId:l(),kind:kS,acceptJpegBytes:x().optional()}),MS.nullable()),releaseParkedTrackFrames:P(d({deviceId:a(),trackId:l()}),d({released:a().int().nonnegative()}),{kind:`mutation`})}},oC=d({engine:K.optional(),steps:b(tS).readonly(),audio:d({engine:K.optional(),modelId:l().optional(),enabled:x(),settings:_(l(),s()).readonly().optional()}).nullable().optional()}),sC=d({id:l(),name:l(),description:l().optional(),config:oC,createdAt:l(),updatedAt:l()}),cC=d({modelId:l().optional(),settings:_(l(),s()).optional(),jumpDeviceKey:l().optional()}),lC=d({maxCameras:a().int().nonnegative().nullable().default(null),detectWeight:a().positive().optional(),detect:x().optional(),decode:x().optional(),audio:x().optional(),ingest:x().optional(),decodeBudgetMb:a().int().min(1024).max(65536).optional(),maxLiveDecodeWorkers:a().int().min(1).max(32).optional(),reachableHost:l().optional(),inferenceDevices:_(l(),d({enabled:x(),weight:a().positive().optional(),maxSessions:a().int().positive().optional(),steps:_(l(),cC).optional()})).optional()}),uC=d({steps:b(tS).readonly(),audio:d({modelId:l(),enabled:x()}).nullable()}),dC=d({modelId:l().optional(),settings:_(l(),s()).readonly().optional()}),fC=d({pinnedAgentNodeId:l().optional(),stepToggles:_(l(),x()).optional(),stepOverridesByDevice:_(l(),_(l(),_(l(),dC))).optional(),pipelineByAgent:_(l(),uC).optional()}),pC=d({deviceId:a(),agentNodeId:l(),pinned:x(),reason:y([`manual`,`capacity`,`hardware-affinity`,`failover`,`rebalance`]),assignedAt:a()}),mC=d({nodeId:l(),online:x(),load:eC,score:a(),decodeHwaccel:l().nullable()}),hC=d({totalAgents:a(),onlineAgents:a(),totalCameras:a(),attachedCameras:a(),activeCameras:a(),avgInferenceTimeMs:a(),queueDepth:a()}),gC=_(l(),l()),_C=d({ownerNodeId:l(),reachableHost:l().optional(),configIssue:l().optional()}),vC=d({camStreamId:l(),codec:l(),width:a(),height:a(),fps:a(),kind:l()}),yC=d({streams:b(vC).readonly()}),bC=d({detectionNodeId:l().nullable(),decoderNodeId:l().nullable(),audioNodeId:l().nullable(),sourceNodeId:l().nullable(),pinned:d({detection:x(),decoder:x(),audio:x()}),reasons:d({detection:l().optional(),decoder:l().optional(),audio:l().optional()})}),xC=d({profile:l(),status:l(),codec:l(),width:a(),height:a(),subscribers:a(),inFps:a(),outFps:a()}),SC=d({profiles:b(xC).readonly(),webrtcSessions:a(),rtspRestream:x()}),CC=d({framesWritten:a(),getFrameHits:a(),getFrameMisses:a(),budgetMb:a()}),wC=d({nodeId:l(),formats:b(l()).readonly(),sessionCount:a(),shm:CC}),TC=d({enabled:x(),fps:a()}),EC=y([`idle`,`installing`,`verifying`,`ready`,`failed`]),DC=d({state:EC,error:l().optional()}),OC=y([`idle`,`watching`,`active`]),kC=d({nodeId:l(),engine:d({backend:l(),device:l()}),phase:OC,configuredFps:a(),actualFps:a(),queueDepth:a(),avgInferenceMs:a(),provisioning:DC}),AC=d({nodeId:l(),enabled:x()}),jC=mi,MC=d({mode:jC,active:x(),storageBytes:a()}),NC=y([`source`,`broker`,`detection`,`recording`,`switches`]),PC=y([`timeout`,`error`,`partial`]),FC=d({stage:NC,reason:PC,elapsedMs:a()}),IC=d({state:y([`idle`,`running`,`done`,`error`]),total:a().int().nonnegative(),completed:a().int().nonnegative(),currentDeviceId:a().int().nullable(),failed:b(a().int()).readonly(),mediaDropped:a().int().nonnegative(),tracks:a().int().nonnegative(),events:a().int().nonnegative(),startedAtMs:a().int().nullable(),finishedAtMs:a().int().nullable(),error:l().nullable()}),LC=d({deviceId:a(),assignment:bC,source:yC,broker:SC.nullable(),decoder:wC.nullable(),motion:TC.nullable(),detection:kC.nullable(),audio:AC.nullable(),recording:MC.nullable(),switchedOff:b(Rn).readonly(),degraded:b(FC).readonly(),fetchedAt:a()}),RC=[`disabled`,`unavailable`,`cannot-host-camera-root`,`accelerator-preferred`],zC=y(RC),BC=d({key:l(),backend:l(),device:l(),format:y(ss),available:x(),enabled:x(),weight:a(),maxSessions:a().nullable(),defaultModelId:l(),steps:_(l(),cC).optional(),exclusion:zC.nullable()}),VC=p(`kind`,[d({kind:m(`stored`),modelId:l()}),d({kind:m(`absent`),defaultModelId:l()}),d({kind:m(`unreadable`),reason:y(Dy),error:l().optional()})]),HC=d({nodeId:l(),reachable:x(),devices:b(BC).readonly()}),UC={name:`pipeline-orchestrator`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,exposesDeviceSettings:!0,methods:{pauseForStorageMigration:P(T,d({paused:m(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:P(T,d({resumed:m(!0)}),{kind:`mutation`,auth:`admin`}),assignPipeline:P(d({deviceId:a(),agentNodeId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),unassignPipeline:P(d({deviceId:a()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setPipelineDevicePin:P(d({deviceId:a(),deviceKey:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getPipelineDevicePin:P(d({deviceId:a()}),d({deviceKey:l().nullable()})),rebalance:P(g(),d({migrated:a(),skipped:b(d({deviceId:a(),targetNodeId:l(),reason:l()})).default([])}),{kind:`mutation`,auth:`admin`}),getPipelineAssignments:P(g(),b(pC).readonly()),getPipelineAssignment:P(d({deviceId:a()}),pC.nullable()),getAgentLoad:P(g(),b(mC).readonly()),getClusterModelChoice:P(d({stepId:l()}),VC),getGlobalMetrics:P(g(),hC),getCameraMetrics:P(d({deviceId:a()}),xS.nullable()),getCapabilityBindings:P(d({nodeId:l()}),gC),setCapabilityBinding:P(d({nodeId:l(),capName:l(),addonId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getIngestOwner:P(g(),_C),assignAudio:P(d({deviceId:a(),nodeId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),unassignAudio:P(d({deviceId:a()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getAudioAssignment:P(d({deviceId:a()}),d({nodeId:l(),pinned:x(),assignedAt:a()}).nullable()),getAudioNodeLoad:P(g(),b(d({nodeId:l(),deviceCount:a()}))),getAudioAssignments:P(g(),b(d({deviceId:a(),nodeId:l(),pinned:x(),assignedAt:a()}))),getAgentSettings:P(d({agentNodeId:l()}),lC.nullable()),listAgentSettings:P(g(),b(d({nodeId:l(),settings:lC})).readonly()),removeAgentSettings:P(d({agentNodeId:l()}),d({success:x(),removed:x()}),{kind:`mutation`,auth:`admin`}),setAgentMaxCameras:P(d({agentNodeId:l(),maxCameras:a().int().nonnegative().nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentDetectWeight:P(d({agentNodeId:l(),detectWeight:a().positive().nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentCapabilities:P(d({agentNodeId:l(),detect:x().nullable().optional(),audio:x().nullable().optional(),ingest:x().nullable().optional()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentDecodeLimits:P(d({agentNodeId:l(),decodeBudgetMb:a().int().min(1024).max(65536).nullable().optional(),maxLiveDecodeWorkers:a().int().min(1).max(32).nullable().optional()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentReachableHost:P(d({agentNodeId:l(),reachableHost:l().nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentInferenceDevices:P(d({agentNodeId:l(),inferenceDevices:_(l(),d({enabled:x(),weight:a().positive().optional(),maxSessions:a().int().positive().optional(),steps:_(l(),cC).optional()}))}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getNodeInferenceDevices:P(d({nodeId:l()}),HC),resetNodePipelineDefaults:P(d({agentNodeId:l()}),d({success:m(!0),effectiveModelId:l().nullable(),clearedCameraOverrides:a()}),{kind:`mutation`,auth:`admin`}),getCameraSettings:P(d({deviceId:a()}),fC.nullable()),setCameraStepToggle:P(d({deviceId:a(),addonId:l(),enabled:x().nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getCameraStepOverrides:P(d({deviceId:a()}),_(l(),_(l(),_(l(),dC))).nullable()),setCameraStepOverride:P(d({deviceId:a(),agentNodeId:l(),deviceKey:l(),addonId:l(),patch:dC.nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setCameraPipelineForAgent:P(d({deviceId:a(),agentNodeId:l(),pipeline:uC.nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),resolvePipeline:P(d({deviceId:a(),agentNodeId:l().optional()}),oC),getCameraSwitches:P(d({deviceId:a()}),Wn),setCameraSwitch:P(d({deviceId:a(),switchId:Rn,enabled:x()}),Wn,{kind:`mutation`,auth:`admin`}),getCameraStatus:P(d({deviceId:a()}),LC),getCameraStatuses:P(d({deviceIds:b(a()).optional()}),b(LC).readonly()),reconcileFromDisk:P(g(),IC,{kind:`mutation`,auth:`admin`}),getReconcileFromDiskStatus:P(g(),IC,{auth:`admin`}),listTemplates:P(g(),b(sC).readonly()),saveTemplate:P(d({name:l(),description:l().optional(),config:oC}),sC,{kind:`mutation`,auth:`admin`}),updateTemplate:P(d({id:l(),name:l().optional(),description:l().optional(),config:oC.optional()}),sC,{kind:`mutation`,auth:`admin`}),deleteTemplate:P(d({id:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`})}},WC={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 GC(e){return WC[e]??`generic`}var KC={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 qC(e,t){let n=g_[t];if(n===void 0)throw Error(`EVENT_KIND_BY_CAP: cap '${e}' maps to unknown taxonomy kind '${t}'`);return{...n,icon:GC(n.iconId)}}var JC=Object.freeze(Object.fromEntries(Object.entries(KC).map(([e,t])=>[e,qC(e,t)]))),YC=Object.keys(KC);function XC(e,t){let n=g_[e];return n===void 0?null:{kind:n.kind,labelKey:n.labelKey,label:n.label,color:n.color,iconId:n.iconId,icon:GC(n.iconId),category:n.category,parentKind:n.parentKind,level:n.level,source:{capName:t.capName,deviceId:t.deviceId}}}var ZC=y([`workspace`,`baked`,`data-root`]),QC=y([`idle`,`checking`,`staging`,`pending-restart`,`awaiting-confirmation`]),$C=y([`in-sync`,`behind-patch`,`behind-series`,`ahead`,`unknown`]),ew=d({state:$C,seedVersion:l().nullable(),contractVersion:l().nullable(),contractSource:y([`registry`,`running`]).nullable(),message:l()}),tw=y([`docker`,`electron`,`native`,`contradictory`,`unknown`]),nw=d({fact:y([`dockerenv-file`,`proc-1-cgroup`,`platform`,`electron-app-version-env`]),mode:y([`observed`,`declared`]),holds:x(),detail:l()}),rw=d({kind:tw,evidence:b(nw),currentVersion:l().nullable()}),iw=d({fromVersion:l(),toVersion:l().nullable(),atMs:a(),reason:l()}),aw=d({packageName:l(),runningVersion:l().nullable(),nodeRuntimeVersion:l().nullable(),activeVersion:l().nullable(),installedVersion:l().nullable().optional(),restartRequired:x().optional(),previousVersion:l().nullable(),seedVersion:l().nullable(),latestVersion:l().nullable(),updateAvailable:x(),bootMode:ZC,updateState:QC,pendingVersion:l().nullable(),rolledBack:iw.nullable(),stateFileCorrupt:x(),lastCheckedAtMs:a().nullable(),imageContract:ew.optional(),wrapper:rw.optional()}),ow=d({packageName:l(),runningVersion:l().nullable(),latestVersion:l().nullable(),updateAvailable:x(),checkedAtMs:a(),error:l().nullable(),pendingVersion:l().nullable().optional(),restartRequired:x().optional()}),sw=y([`staged`,`restart-scheduled`,`already-current`,`refused`,`failed`]),cw=d({accepted:x(),targetVersion:l().nullable(),restarting:x(),message:l(),outcome:sw.optional(),reason:l().nullable().optional(),error:l().nullable().optional()}),lw={name:`server-management`,scope:`system`,mode:`singleton`,methods:{getServerPackageStatus:P(g(),aw,{auth:`admin`}),checkServerUpdate:P(g(),ow,{kind:`mutation`,auth:`admin`}),applyServerUpdate:P(d({version:l().optional()}),cw,{kind:`mutation`,auth:`admin`,timeoutMs:16*6e4}),rollbackServerUpdate:P(g(),cw,{kind:`mutation`,auth:`admin`}),restartServer:P(g(),cw,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},uw=i(),dw=d({to:f([uw,b(uw).min(1)]),cc:b(uw).optional(),bcc:b(uw).optional(),from:l().optional(),replyTo:l().optional(),subject:l(),text:l(),html:l().optional()}),fw=d({messageId:l(),accepted:b(uw).default([]),rejected:b(uw).default([])}),pw=d({ready:x(),host:l(),error:l().optional(),lastVerifiedAt:a().optional()}),mw={name:`smtp-provider`,scope:`system`,mode:`collection`,internal:!0,providerKind:`email`,methods:{sendEmail:P(dw,fw,{kind:`mutation`,auth:`admin`,access:`create`}),verify:P(g(),pw,{kind:`mutation`,auth:`admin`,access:`view`}),getStatus:P(g(),pw,{auth:`admin`})}},hw=d({base64:l(),contentType:l()}),gw=d({lastCapturedAt:a().nullable(),cacheAgeMs:a().nullable(),lastBytes:a().nullable(),lastStreamId:l().nullable()}),_w={name:`snapshot`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[L.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:P(d({deviceId:a(),streamId:l().optional(),force:x().optional()}),hw.nullable()),invalidateCache:P(d({deviceId:a()}),g(),{kind:`mutation`,auth:`admin`}),getSnapshotOverview:qc(d({deviceIds:b(a()).min(1).max(200)}),b(d({deviceId:a(),lastCapturedAt:a().nullable(),cacheAgeMs:a().nullable(),etag:l().nullable()}))),getDebugState:qc(d({deviceId:a()}),d({battery:d({sleeping:x(),lastUpdated:a(),lastContactAt:a().optional()}).nullable(),state:d({isBattery:x(),reason:y([`disabled`,`offline`,`sleeping`,`unreachable`,`waking`]).nullable()}),frame:d({capturedAt:a().nullable(),ageMs:a().nullable()}),waking:x()})),getSnapshotLinks:qc(d({targets:b(d({deviceId:a(),width:a().int().positive().optional()})).min(1).max(200)}),b(d({deviceId:a(),url:l().nullable(),capturedAt:a().nullable(),ageMs:a().nullable(),expiresAt:a().nullable(),width:a().nullable(),neverCaptured:x(),sleeping:x(),stateReason:y([`disabled`,`offline`,`sleeping`,`unreachable`,`waking`]).nullable(),battery:x()})))},status:{schema:gw,kind:`poll`}},vw=d({userId:l(),username:l(),isAdmin:x(),provider:l(),email:l().optional(),displayName:l().optional(),hubUrl:l().optional(),scopes:b(G).optional(),redirectUri:l().optional(),integrationId:l().optional(),jti:l().optional(),codeChallenge:l().optional(),sessionId:l().optional(),refreshTtl:f([a().int().positive(),m(`never`)]).optional()}),yw={name:`sso-bridge`,scope:`system`,mode:`singleton`,internal:!0,methods:{signBridgeToken:P(d({claims:vw,ttlSec:f([a().int().positive(),m(`never`)]).optional()}),d({token:l()}),{auth:`admin`}),verifyBridgeToken:P(d({token:l()}),vw.nullable(),{auth:`admin`})}},bw=p(`shouldSaveDiskSpace`,[d({providerId:l().min(1),displayName:l().min(1),configSchema:s(),nodeLocal:x(),shouldSaveDiskSpace:m(!0),minFreePercent:a().min(0).max(100)}),d({providerId:l().min(1),displayName:l().min(1),configSchema:s(),nodeLocal:x(),shouldSaveDiskSpace:m(!1),minFreePercent:m(null)})]),xw={name:`storage`,scope:`system`,mode:`singleton`,methods:{resolve:P(d({location:D,relativePath:l()}),l(),{auth:`admin`}),write:P(d({location:D,relativePath:l(),data:v(Uint8Array)}),g(),{kind:`mutation`,auth:`admin`}),read:P(d({location:D,relativePath:l()}),v(Uint8Array),{auth:`admin`}),exists:P(d({location:D,relativePath:l()}),x(),{auth:`admin`}),list:P(d({location:D,prefix:l().optional()}),b(l()).readonly(),{auth:`admin`}),delete:P(d({location:D,relativePath:l()}),g(),{kind:`mutation`,auth:`admin`}),getAvailableSpace:P(d({location:D}),a().nullable()),beginUpload:P(d({location:D,relativePath:l(),sizeBytes:a().optional()}),d({uploadId:l()}),{kind:`mutation`,auth:`admin`}),writeChunk:P(d({uploadId:l(),offset:a(),data:v(Uint8Array)}),g(),{kind:`mutation`,auth:`admin`}),finalizeUpload:P(d({uploadId:l()}),g(),{kind:`mutation`,auth:`admin`}),abortUpload:P(d({uploadId:l()}),g(),{kind:`mutation`,auth:`admin`}),beginDownload:P(d({location:D,relativePath:l()}),d({downloadId:l(),sizeBytes:a()}),{kind:`mutation`,auth:`admin`}),readChunk:P(d({downloadId:l(),offset:a(),length:a()}),v(Uint8Array),{auth:`admin`}),endDownload:P(d({downloadId:l()}),g(),{kind:`mutation`,auth:`admin`}),listLocations:P(d({type:Ba.optional()}),b(E).readonly()),listLocationDeclarations:P(g(),b(Ja).readonly()),upsertLocation:P(E.omit({createdAt:!0,updatedAt:!0}),E,{kind:`mutation`,auth:`admin`}),deleteLocation:P(d({id:l(),force:x().optional()}),g(),{kind:`mutation`,auth:`admin`}),listDrainProgress:P(g(),b(Ga).readonly()),testLocation:P(d({id:l()}),d({ok:x(),error:l().optional()}),{auth:`admin`}),listProviders:P(g(),b(bw).readonly()),testConfig:P(d({providerId:l(),locationId:l().optional(),config:_(l(),s())}),d({ok:x(),error:l().optional()}),{auth:`admin`})}},Sw=d({bytes:a().int().nonnegative()}),Cw=d({reclaimedBytes:a().int().nonnegative(),exhausted:x()}),ww={name:`storage-evictable`,scope:`system`,mode:`collection`,internal:!0,methods:{getEvictableUsage:P(d({locationId:l()}),Sw,{auth:`admin`}),evict:P(d({locationId:l(),targetBytes:a().int().positive()}),Cw,{kind:`mutation`,auth:`admin`})}},Tw={name:`storage-migration`,scope:`system`,mode:`singleton`,methods:{plan:P(Xi,ia,{auth:`admin`}),start:P(Xi,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),status:P(d({jobId:l().optional()}),ta.nullable(),{auth:`admin`}),cancel:P(d({jobId:l()}),d({cancelled:x()}),{kind:`mutation`,auth:`admin`}),movers:P(d({}),b(oa).readonly(),{auth:`admin`}),residue:P(d({}),b(sa).readonly(),{auth:`admin`}),drain:P(ca,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),cleanupStart:P(ba,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),cleanupStatus:P(Sa,xa.nullable(),{auth:`admin`}),cleanupCancel:P(d({jobId:l()}),d({cancelled:x()}),{kind:`mutation`,auth:`admin`}),history:P(d({}),b(ta).readonly(),{auth:`admin`})}},Ew=d({locationId:l(),ownedBytes:a().int().nonnegative(),measuredAtMs:a().int().nonnegative()}),Dw={name:`storage-occupancy`,scope:`system`,mode:`collection`,internal:!0,methods:{getOccupancy:P(d({locationIds:b(l()).readonly()}),b(Ew).readonly(),{auth:`admin`})}},Ow=p(`shouldSaveDiskSpace`,[d({providerId:l().min(1),displayName:l().min(1),configSchema:s(),nodeLocal:x(),shouldSaveDiskSpace:m(!0),minFreePercent:a().min(0).max(100)}),d({providerId:l().min(1),displayName:l().min(1),configSchema:s(),nodeLocal:x(),shouldSaveDiskSpace:m(!1),minFreePercent:m(null)})]),kw=d({ok:x(),error:l().optional()}),Aw=d({location:E,relativePath:l(),sizeBytes:a().optional()}),jw=d({uploadId:l()}),Mw=d({uploadId:l(),offset:a(),data:v(Uint8Array)}),Nw=d({uploadId:l()}),Pw=d({uploadId:l()}),Fw=d({location:E,relativePath:l()}),Iw=d({downloadId:l(),sizeBytes:a()}),Lw=d({downloadId:l(),offset:a(),length:a()}),Rw=d({downloadId:l()}),zw={name:`storage-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getProviderInfo:P(g(),Ow,{auth:`admin`}),testLocation:P(d({config:_(l(),s())}),kw,{auth:`admin`}),resolve:P(d({location:E,relativePath:l()}),l(),{auth:`admin`}),write:P(d({location:E,relativePath:l(),data:v(Uint8Array)}),g(),{kind:`mutation`,auth:`admin`}),read:P(d({location:E,relativePath:l()}),v(Uint8Array),{auth:`admin`}),exists:P(d({location:E,relativePath:l()}),x(),{auth:`admin`}),list:P(d({location:E,prefix:l().optional()}),b(l()).readonly(),{auth:`admin`}),delete:P(d({location:E,relativePath:l()}),g(),{kind:`mutation`,auth:`admin`}),getAvailableSpace:P(d({location:E}),a().nullable(),{auth:`admin`}),beginUpload:P(Aw,jw,{kind:`mutation`,auth:`admin`}),writeChunk:P(Mw,g(),{kind:`mutation`,auth:`admin`}),finalizeUpload:P(Nw,g(),{kind:`mutation`,auth:`admin`}),abortUpload:P(Pw,g(),{kind:`mutation`,auth:`admin`}),beginDownload:P(Fw,Iw,{kind:`mutation`,auth:`admin`}),readChunk:P(Lw,v(Uint8Array),{auth:`admin`}),endDownload:P(Rw,g(),{kind:`mutation`,auth:`admin`})}},Bw=d({code:l().min(1),label:l().min(1),recommended:x()}),Vw=d({signals:b(Bw),lastFetchedAt:a()}),Hw={name:`stream-signals`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:Object.values(L),runtimeState:Vw,durability:`session`,methods:{listSignals:P(g(),b(Bw).readonly())}},Uw=s().nullable(),Ww=_(l(),s()),Gw=d({sessionId:l(),profileId:l(),label:l(),cols:a().int().positive(),rows:a().int().positive(),startedAt:a()}),Kw=d({profileId:l(),label:l(),description:l().optional(),executable:l().optional(),args:b(l()).readonly().optional(),cwd:l().optional(),environment:b(l()).readonly().optional(),settingsSchema:Uw.optional()}),qw=d({instanceId:l(),cameraStableId:l(),nodeId:l(),profileId:l(),profileLabel:l(),name:l(),enabled:x(),executable:l(),args:b(l()).readonly(),cwd:l(),environment:b(l()).readonly(),profileSettings:Ww}),Jw=d({stableId:l(),nodeId:l(),profileId:l(),profileLabel:l(),name:l(),adoptable:x()}),Yw=p(`kind`,[d({seq:a().int().positive(),kind:m(`data`),data:l()}),d({seq:a().int().positive(),kind:m(`exit`),exitCode:a().int(),signal:a().int().optional()})]),Xw=d({cursor:a().int().nonnegative(),reset:x(),snapshot:l().optional(),events:b(Yw).readonly()}),Zw={name:`terminal-session`,scope:`system`,mode:`singleton`,methods:{listProfiles:P(g(),b(Kw).readonly(),{auth:`admin`}),listInstances:P(g(),b(qw).readonly(),{auth:`admin`}),createInstance:P(d({targetNodeId:l().min(1),profileId:l().min(1),name:l().trim().min(1).max(160).optional(),executable:l().max(1024).optional(),args:b(l().max(2048)).max(64).optional(),cwd:l().max(1024).optional(),environment:b(l().max(4096)).max(64).optional(),profileSettings:Ww.optional()}),qw,{kind:`mutation`,auth:`admin`}),updateInstance:P(d({instanceId:l().min(1),name:l().trim().min(1).max(160).optional(),executable:l().max(1024).optional(),args:b(l().max(2048)).max(64).optional(),cwd:l().max(1024).optional(),environment:b(l().max(4096)).max(64).optional(),profileSettings:Ww.optional()}),qw,{kind:`mutation`,auth:`admin`}),deleteInstance:P(d({instanceId:l().min(1)}),g(),{kind:`mutation`,auth:`admin`}),setInstanceEnabled:P(d({instanceId:l().min(1),enabled:x()}),qw,{kind:`mutation`,auth:`admin`}),listLegacyCameras:P(g(),b(Jw).readonly(),{auth:`admin`}),adoptLegacyMonitor:P(d({stableId:l().min(1),name:l().trim().min(1).max(160).optional()}),qw,{kind:`mutation`,auth:`admin`}),listSessions:P(g(),b(Gw).readonly(),{auth:`admin`}),openSession:P(d({profileId:l(),cols:a().int().positive(),rows:a().int().positive(),executable:l().max(1024).optional(),args:b(l().max(2048)).max(64).optional(),cwd:l().max(1024).optional(),environment:b(l().max(4096)).max(64).optional()}),Gw,{kind:`mutation`,auth:`admin`}),resize:P(d({sessionId:l(),cols:a().int().positive(),rows:a().int().positive()}),g(),{kind:`mutation`,auth:`admin`}),pullOutput:P(d({sessionId:l(),afterSeq:a().int().nonnegative(),waitMs:a().int().min(0).max(2e3).default(0),waitForOutput:x().optional()}),Xw,{kind:`mutation`,auth:`admin`,timeoutMs:15e3}),writeInput:P(d({sessionId:l(),data:l().max(64*1024)}),g(),{kind:`mutation`,auth:`admin`}),close:P(d({sessionId:l()}),g(),{kind:`mutation`,auth:`admin`})}},Qw=d({urls:f([l(),b(l())]),username:l().optional(),credential:l().optional()}),$w={name:`turn-provider`,scope:`system`,mode:`collection`,methods:{getTurnServers:P(g(),b(Qw).readonly())}},eT=d({credentialId:l(),label:l(),createdAt:a(),lastUsedAt:a().nullable(),transports:b(l()).default([])}),tT={name:`user-passkeys`,scope:`system`,mode:`collection`,internal:!0,methods:{beginRegistration:P(d({userId:l(),username:l()}),d({optionsJSON:_(l(),s())}),{kind:`mutation`,auth:`admin`,access:`create`}),finishRegistration:P(d({userId:l(),response:_(l(),s()),label:l()}),d({success:m(!0),credentialId:l()}),{kind:`mutation`,auth:`admin`,access:`create`}),beginAuthentication:P(d({userId:l().optional()}),d({optionsJSON:_(l(),s())}),{kind:`mutation`,access:`view`,auth:`admin`}),finishAuthentication:P(d({userId:l(),response:_(l(),s())}),d({verified:x()}),{kind:`mutation`,access:`view`,auth:`admin`}),beginDiscoverableAuthentication:P(d({}),d({optionsJSON:_(l(),s())}),{kind:`mutation`,access:`view`,auth:`admin`}),finishDiscoverableAuthentication:P(d({response:_(l(),s())}),d({verified:x(),userId:l().nullable()}),{kind:`mutation`,access:`view`,auth:`admin`}),listPasskeys:P(d({userId:l()}),b(eT),{auth:`admin`}),removePasskey:P(d({userId:l(),credentialId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getSecondFactorPreference:P(d({userId:l()}),d({enabled:x()}),{auth:`admin`}),setSecondFactorPreference:P(d({userId:l(),enabled:x()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`})}},nT=y([`cosine`,`dot`,`euclidean`]),rT=_(l(),f([l(),a(),x()])),iT=d({equals:_(l(),f([l(),a(),x()])).optional(),between:_(l(),u([a(),a()])).optional()}),aT=d({id:l(),vector:l(),metadata:rT}),oT=d({id:l(),score:a(),metadata:rT}),sT=d({index:l(),dim:a().int().positive(),metric:nT.default(`cosine`)}),cT=d({index:l(),items:b(aT)}),lT=d({upserted:a(),rejected:a()}),uT=d({index:l(),vector:l(),topK:a().int().positive(),minScore:a().optional(),filter:iT.optional()}),dT=d({matches:b(oT),scanned:a(),truncated:x(),effectiveTopK:a().int().positive()}),fT=d({index:l(),ids:b(l())}),pT=d({index:l(),filter:iT}),mT=d({deleted:a()}),hT=d({index:l(),ids:b(l())}),gT=d({items:b(d({id:l(),metadata:rT}))}),_T=d({index:l(),ids:b(l())}),vT=d({items:b(d({id:l(),vector:l(),metadata:rT}))}),yT=d({index:l(),cursor:a().int().nonnegative().default(0),limit:a().int().positive()}),bT=d({items:b(d({id:l(),metadata:rT})),nextCursor:a().int().nonnegative().nullable()}),xT=`vector-index-dim-conflict`;function ST(e,t,n){return Error(`[${xT}] vector-store: index "${e}" is declared with dim ${String(t)}; refusing to redeclare as ${String(n)}`)}function CT(e){return(e instanceof Error?e.message:String(e)).includes(`[${xT}]`)}var wT=d({index:l()}),TT=d({backend:l(),count:a(),dim:a(),metric:nT,bytes:a().optional(),exact:x()}),ET={name:`vector-store`,scope:`system`,mode:`singleton`,internal:!0,methods:{declareIndex:P(sT,g(),{kind:`mutation`,auth:`admin`}),upsert:P(cT,lT,{kind:`mutation`,auth:`admin`}),query:P(uT,dT,{auth:`admin`}),getByIds:P(hT,gT,{auth:`admin`}),fetchByIds:P(_T,vT,{auth:`admin`}),scan:P(yT,bT,{auth:`admin`}),deleteByIds:P(fT,mT,{kind:`mutation`,auth:`admin`}),deleteByFilter:P(pT,mT,{kind:`mutation`,auth:`admin`}),stats:P(wT,TT,{auth:`admin`})}},DT=y([`queue-full`,`camera-backoff`,`sleeping`,`camera-refused`,`no-keyframe`,`decode-failed`,`no-catalog-row`,`unsupported`,`unknown-device`,`uid-missing`]),OT=y([`deferred`,`final`]),kT=`x-camstack-reason`;function AT(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 jT=`x-camstack-reason-code`,MT=`x-camstack-disposition`,NT=`x-camstack-clip-transport`,PT=d({id:l(),source:l(),kind:y([`motion`,`object`,`audio`,`native`]),timeRange:d({startMs:a(),endMs:a()}),labels:b(l()).max(3).optional(),thumbnail:l().optional(),stillAtMs:a().optional(),eventIds:b(l()).optional(),eventCount:a().int().nonnegative().optional(),holes:b(d({startMs:a(),endMs:a()})).optional(),thumbnailMint:l().optional(),thumbnailUnavailable:d({reason:y([`sleeping`,`camera-refused`,`no-keyframe`,`unsupported`])}).optional(),catalogAsOf:a().optional(),nativeTypes:b(l()).optional(),behaviours:b(l()).optional(),streams:d({sub:d({id:l(),bytes:a().optional()}).optional(),main:d({id:l(),bytes:a().optional()}).optional()}).optional(),supportSub:x().optional(),playable:x().optional(),unplayableReason:l().optional(),inProgress:x().optional()}),FT=d({playbackUrl:l(),format:y([`hls`,`mp4`]).optional(),served:C.optional(),playbackEndpoints:b(l()).optional(),token:l().optional()}),IT=y([`authorised`]),LT=50*1024*1024,RT=500*1024*1024,zT=d({base64:l(),contentType:l(),name:l(),bytes:a().int().nonnegative(),served:C,durationMs:a().positive().optional()}),BT=d({ticket:Mn,contentType:l(),name:l(),served:C,durationMs:a().positive().optional()}),VT=y([`opus`,`pcmu`,`none`]),HT=y([`not-requested`,`unsupported-ask`]),UT=d({url:l().min(1),expiresAtMs:a(),transport:m(`forward-only`),served:C,servedAudio:VT,audioReason:HT.optional()}),WT=[.25,.5,1,1.5,2,4,8],GT=[.25,.5,1,1.5,2,4],KT=[.25,.5,1],qT=d({transport:y([`stream`,`file`]),seek:y([`forward`,`free`]),stepBack:x(),scrub:x(),rates:b(a().positive()).min(1).readonly()}),JT=d({state:y([`ok`,`sleeping`,`unreachable`,`no-storage`,`index-empty`]),reason:l().optional(),catalogAsOf:a().optional()}),YT=d({source:l(),label:l(),addonId:l().optional(),availability:JT}),XT={name:`videoclips`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:[L.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/clips-browser`,tab:`recording`,topTab:!0,label:`Clips`,order:100}},methods:{listClips:P(d({deviceId:a(),since:a(),until:a(),limit:a().int().positive().optional(),provider:l().min(1)}),b(PT).readonly(),{kind:`query`,auth:`protected`}),listSources:P(d({deviceId:a()}),b(YT).readonly(),{kind:`query`,auth:`protected`}),getClipPlayback:P(d({deviceId:a(),clipId:l(),profile:C.optional()}),FT,{kind:`query`,auth:`protected`}),readClipBytes:Jc(d({deviceId:a(),clipId:l().min(1),provider:l().min(1),profile:C.optional(),maxBytes:a().int().positive().optional(),wake:IT.optional()}),zT,{kind:`query`,auth:`protected`}),offerClipBytes:Jc(d({deviceId:a(),clipId:l().min(1),provider:l().min(1),profile:C.optional(),maxBytes:a().int().positive().optional(),wake:IT.optional()}),BT,{kind:`query`,auth:`protected`}),dialClipStream:Jc(d({deviceId:a(),clipId:l().min(1),provider:l().min(1),profile:C.optional(),audio:VT.optional()}),UT,{kind:`query`,auth:`protected`}),getPlaybackOptions:Jc(d({deviceId:a(),provider:l().min(1)}),qT,{kind:`query`,auth:`protected`})}},ZT={stream:{transport:`stream`,seek:`forward`,stepBack:!1,scrub:!1,rates:GT},realtimeStream:{transport:`stream`,seek:`forward`,stepBack:!1,scrub:!1,rates:KT},file:{transport:`file`,seek:`free`,stepBack:!0,scrub:!0,rates:WT}},QT={contact:`entryOpen`,binary:`on`,switch:`on`,motion:`detected`,flood:`flooded`,gas:`detected`,smoke:`detected`,"carbon-monoxide":`detected`,vibration:`detected`,tamper:`tampered`},$T={contact:`lastChangedAt`,binary:`lastChangedAt`,switch:`lastChangedAt`,motion:`lastDetectedAt`,flood:`lastChangedAt`,gas:`lastChangedAt`,smoke:`lastChangedAt`,"carbon-monoxide":`lastChangedAt`,vibration:`lastChangedAt`,tamper:`lastChangedAt`},eE=Object.keys(QT),tE=[`sensor`,`switch`,`control`];function nE(e){return Object.prototype.hasOwnProperty.call(QT,e)}function rE(e,t){let n=QT[e];if(n===void 0)return null;let r=t[n];return typeof r==`boolean`?r:null}function iE(e,t){let n=$T[e];if(n===void 0)return null;let r=t[n];return typeof r!=`number`||!Number.isFinite(r)||r<=0?null:r}var aE=3e4;function oE(e){let t=rE(e.capName,e.slice);if(t===null)return{edge:`none`,value:null,reason:nE(e.capName)?`non-boolean-value`:`unknown-cap`};if(e.prior===void 0){if(!t)return{edge:`none`,value:t,reason:`baseline-seeded-inactive`};let n=iE(e.capName,e.slice),r=Math.max(e.startedAtMs,e.nowMs-e.firstSightingFreshnessMs);return n===null||n<r?{edge:`none`,value:t,reason:`baseline-seeded-stale-active`}:{edge:`rising`,value:!0}}return e.prior===t?{edge:`none`,value:t,reason:`no-change`}:t?{edge:`rising`,value:!0}:{edge:`none`,value:t,reason:`falling-edge`}}var sE=d({lastPressedAt:a().nullable(),pressCountSinceStart:a()}),cE=d({deviceId:a(),timestamp:a()}),lE=d({deviceIds:b(a().int().positive())}),uE={id:`doorbell-source`,label:`Doorbell trigger devices`,description:`Any of these becoming active rings this camera's virtual doorbell: a binary sensor when it goes active, a switch when it turns on.`,shape:`association`,hostDeviceTypes:[L.Camera],sourceCaps:eE,cardinality:`many`,value:lE},dE={name:`doorbell`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!1,deviceTypes:[L.Button,L.Camera],extensionSlots:[uE],methods:{},events:{onPressed:{data:cE}},status:{schema:sE,kind:`push`},runtimeState:sE,durability:`restored`},fE=[`doorbell-source`,`linked-devices`],pE=y(fE),mE={"doorbell-source":{descriptor:uE,declaringCap:`doorbell`,hostDeviceTypes:[L.Camera]},"linked-devices":{descriptor:um,declaringCap:`device-manager`,hostDeviceTypes:[L.Camera]}},hE=p(`slot`,[lE.extend({slot:m(`doorbell-source`)}),lm.extend({slot:m(`linked-devices`)})]),gE=[L.Camera],_E=`listSlots`,vE=p(`state`,[d({state:m(`ok`)}),d({state:m(`unreachable`),reason:l()})]),yE=d({source:l(),label:l(),addonId:l().optional(),availability:vE}),bE=y([`ok`,`missing`,`foreign`,`unavailable`]),xE=d({deviceId:a().int(),name:l().nullable(),health:bE,detail:l().optional()}),SE=d({state:y([`active`,`inactive`,`unknown`]),authority:l(),detail:l().optional()}),CE=d({state:m(`ok`),slotRef:l(),slot:pE,authority:l(),enabled:x().nullable(),projects:l().nullable(),activation:SE.nullable(),value:hE,sources:b(xE),impliedSources:b(xE).optional()}),wE=d({state:m(`unreachable`),addonId:l(),reason:l()}),TE=p(`state`,[CE,wE]);function EE(e,t){return{state:`unreachable`,addonId:e,reason:t}}var DE=d({deviceId:a().int(),name:l(),type:l(),location:l().nullable(),parentName:l().nullable(),suggested:x(),reason:l().nullable()}),OE=d({candidates:b(DE)}),kE=d({applied:m(!0),reload:y([`none`,`host`,`parent`])}),AE=d({deviceId:a().int(),slotRef:l().min(1)}),jE=AE.extend({value:hE}),ME={name:`device-extension`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:gE,deviceConfig:{ui:{kind:`widget`,widgetId:`host/extensions-panel`,tab:`general`,label:`Extensions`,order:72}},methods:{listSources:P(d({deviceId:a().int()}),b(yE)),listSlots:P(d({deviceId:a().int()}),b(TE)),listCandidates:P(AE,OE),setSlot:P(jE,kE,{kind:`mutation`,auth:`admin`})}},NE=d({staticDir:l()}),PE=d({version:l()}),FE={name:`viewer-ui`,scope:`system`,mode:`singleton`,internal:!0,methods:{getStaticDir:P(g(),NE,{auth:`admin`}),getVersion:P(g(),PE,{auth:`admin`})}},IE=d({viewportWidth:a().int().positive().optional(),viewportHeight:a().int().positive().optional(),devicePixelRatio:a().positive().optional(),downlinkMbps:a().nonnegative().optional(),prefersTier:l().optional()}).partial(),LE=p(`kind`,[d({kind:m(`adaptive`)}),d({kind:m(`profile`),profile:C}),d({kind:m(`cam-stream`),camStreamId:l().min(1)})]),RE=d({id:l(),label:l(),target:LE,codec:l().nullable(),resolution:d({width:a(),height:a()}).nullable(),status:y([`idle`,`connecting`,`streaming`,`error`,`stopped`]).nullable(),inputFps:a().nullable(),decodeFps:a().nullable(),bitrateKbps:a().nullable()}),zE=d({cause:y([`loss`,`stall`,`healthy`]),tier:C.nullable(),forcedTranscodeDown:x(),lossRatio:a().nullable(),clientKbps:a().nullable(),stalledForMs:a().nullable(),serverSending:x().nullable(),at:a(),causeDetail:l().optional()}),BE=[`stall-building`,`delivery`,`no-evidence`,`warming`,`cooldown`,`capacity`,`try-unclean`,`try-backoff`,`trial`,`suspended`],VE=[`delivery`,`loss`,`rtt`,`shared-telemetry`],HE=d({code:l(),nextTier:C,deliveryRatio:a().nullable(),deliveryWindowMs:a().nullable(),climbDeliveryRatio:a(),capacityKbps:a().nullable(),probeKbps:a().nullable(),nextTierKbps:a().nullable(),capacityMargin:a(),neededKbps:a().nullable(),tryBlockedBy:l().nullable(),tryDeliveryRatio:a().optional(),tryMaxLossRatio:a().optional(),retryInMs:a().nullable(),lastRevert:d({tier:C,deliveryRatio:a().nullable(),stalled:x(),at:a()}).nullable(),trialForMs:a().nullable(),trialMs:a().nullable(),healthyForMs:a().nullable(),requiredHealthyMs:a().nullable(),since:a(),summary:l()}),UE=d({tier:C,failures:a().int().nonnegative()}),WE=d({sessionId:l(),alive:x(),observedAt:a(),brokerId:l().nullable(),camStreamId:l().nullable(),sourceKind:y([`native`,`derived`,`unknown`]),adaptive:x(),servedTier:C.nullable(),ingestNodeId:l().nullable(),ingestIsRemote:x().nullable(),sourceCodec:l().nullable(),negotiatedCodec:l().nullable(),egressLeg:y([`copy`,`transcode`,`unknown`]),brokerStatus:l().nullable(),brokerCodec:l().nullable(),brokerBitrateKbps:a().nullable(),brokerInputFps:a().nullable(),brokerUptimeMs:a().nullable(),rtpPacketsSent:a().nullable(),trackMode:y([`live`,`recorded`]).nullable(),lastDecision:zE.nullable(),tierFailures:b(UE),upgradeCount:a().nullable(),climbHold:HE.nullable().optional()}),GE={name:`webrtc-session`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,preferredProvider:`stream-broker`,deviceTypes:[L.Camera],methods:{listStreams:P(d({deviceId:a().int().nonnegative()}),b(RE)),createSession:P(d({deviceId:a().int().nonnegative(),target:LE,hints:IE.optional(),relayOnly:x().optional(),consumerAttribution:Gu.optional()}),d({sessionId:l(),sdpOffer:l()}),{kind:`mutation`}),handleOffer:P(d({deviceId:a().int().nonnegative(),target:LE.optional(),sdpOffer:l(),sessionId:l().optional(),relayOnly:x().optional(),nonTrickle:x().optional(),disableTurn:x().optional(),disableIpv6:x().optional(),consumerAttribution:Gu.optional(),hints:IE.optional()}),d({sessionId:l(),sdpAnswer:l()}),{kind:`mutation`}),handleAnswer:P(d({deviceId:a().int().nonnegative(),sessionId:l(),sdpAnswer:l()}),g(),{kind:`mutation`}),addIceCandidate:P(d({deviceId:a().int().nonnegative(),sessionId:l(),candidate:l(),sdpMid:l().nullable().optional(),sdpMLineIndex:a().int().nullable().optional()}),g(),{kind:`mutation`}),getIceCandidates:P(d({deviceId:a().int().nonnegative(),sessionId:l()}),d({candidates:b(d({candidate:l(),sdpMid:l().nullable(),sdpMLineIndex:a().int().nullable()})),done:x()}),{kind:`query`}),closeSession:P(d({deviceId:a().int().nonnegative(),sessionId:l()}),g(),{kind:`mutation`}),hasAdaptiveBitrate:P(d({deviceId:a().int().nonnegative(),profile:C}),x()),getSessionState:P(d({deviceId:a().int().nonnegative(),sessionId:l()}),d({pendingRenegotiation:d({target:LE,epoch:a()}).nullable(),alive:x()})),getSessionDebug:P(d({deviceId:a().int().nonnegative(),sessionId:l()}),WE,{kind:`query`})},mount:{kind:`server-provided`}},KE=d({childDeviceIds:b(a()).readonly(),hiddenChildIds:b(a()).readonly()}),qE={name:`accessories`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera,L.Hub,L.Switch,L.Light,L.Sensor,L.Thermostat,L.Cover,L.Lock,L.Fan,L.MediaPlayer,L.AlarmPanel,L.Generic],methods:{setChildHidden:P(d({deviceId:a().int().nonnegative(),childDeviceId:a().int().nonnegative(),hidden:x()}),g(),{kind:`mutation`,auth:`admin`})},events:{onAccessoriesChanged:{data:d({deviceId:a(),childDeviceIds:b(a()).readonly(),hiddenChildIds:b(a()).readonly()})},onChildVisibilityChanged:{data:d({deviceId:a(),childDeviceId:a(),hidden:x()})}},status:{schema:KE,kind:`command-driven`}},JE=y([`install`,`update`,`uninstall`,`restart`]),YE=y([`queued`,`fetching`,`staged`,`validating`,`applying`,`restarting`,`applied`,`done`,`failed`,`skipped`]),XE=y([`framework`,`addon`]),ZE=d({tsMs:a(),nodeId:l(),packageName:l(),phase:YE,message:l()}),QE=d({taskId:l(),nodeId:l(),packageName:l(),fromVersion:l().nullable(),toVersion:l(),target:XE,phase:YE,stagedPath:l().nullable(),attempts:a(),steps:b(ZE),error:l().nullable(),startedAtMs:a().nullable(),finishedAtMs:a().nullable()}),$E=y([`running`,`completed`,`failed`,`partially-failed`,`cancelled`]),eD=y([`single`,`bulk`,`cluster`]),tD=d({jobId:l(),kind:JE,createdAtMs:a(),createdBy:l(),scope:eD,tasks:b(QE),state:$E,schemaVersion:m(1)}),nD=y([`debug`,`info`,`warn`,`error`]),rD=y([`off`,`latest`,`beta`]),iD=y([`off`,`latest`,`beta`,`inherit`]),aD=d({id:l(),name:l().optional(),version:l().optional(),description:l().optional(),icon:l().optional(),color:l().optional(),capabilities:b(s()).readonly().optional(),packageName:l(),packageVersion:l(),packageDisplayName:l().optional(),bundle:d({displayName:l(),description:l().optional(),icon:l().optional()}).optional(),protected:x().optional(),removable:x().optional()}),oD=d({pid:a().optional(),mode:l(),state:l()}),sD=d({phase:y([`pending`,`healthy`,`failed`]),retryCount:a(),firstFailureAt:a().nullable(),lastAttemptAt:a().nullable(),lastError:d({message:l(),stack:l().optional()}).nullable(),nextRetryAt:a().nullable(),alertEmitted:x(),retrying:x(),inGracePeriod:x()}),cD=d({manifest:aD,declaration:s().optional(),source:l(),installSource:l().optional(),process:oD.optional(),hasBackup:x().optional(),health:sD.nullable().optional()}),lD=d({name:l(),version:l(),dir:l(),installSource:l().optional()}),uD=d({name:l(),currentVersion:l(),latestVersion:l(),category:y([`addon`,`core`]),requiresRestart:x(),isSystem:x()}),dD=d({version:l(),publishedAt:l(),deprecated:l().optional(),distTags:b(l()).readonly()}),fD=d({name:l(),version:l(),description:l(),keywords:b(l()).readonly(),publishedAt:l(),author:l(),installed:x(),installedVersion:l().optional()}),pD=d({channel:rD,intervalSeconds:a(),updateCheckIntervalSeconds:a()}),mD=iD,hD=s(),gD=s(),_D=s(),vD=y([`queued`,`updating`,`done`,`done-pending-restart`,`failed`]),yD=d({name:l(),isSystem:x(),fromVersion:l(),toVersion:l(),status:vD,error:l().optional(),startedAtMs:a().optional(),completedAtMs:a().optional()}),bD=y([`regular`,`system`,`restarting`,`finalizing`]);d({id:l(),nodeId:l(),startedAtMs:a(),completedAtMs:a().optional(),total:a(),completed:a(),failed:a(),current:l().nullable(),phase:bD,cancelled:x(),items:b(yD).readonly()});var xD=d({packageName:l(),currentVersion:l(),latestVersion:l().nullable(),hasUpdate:x(),description:l().optional(),buildId:l().nullable()}),SD=d({timestamp:l(),level:l(),message:l(),scope:l().optional()}),CD=s(),wD=d({addonId:l().min(1),action:l().min(1),input:s()}),TD={name:`addons`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{list:P(g(),b(cD).readonly()),getLogs:P(d({addonId:l(),limit:a().min(1).max(500).default(100),level:nD.optional()}),b(CD)),listPackages:P(g(),b(lD).readonly()),installPackage:P(d({packageName:l(),version:l().optional()}),gD,{kind:`mutation`,auth:`admin`}),installFromWorkspace:P(d({packageName:l()}),gD,{kind:`mutation`,auth:`admin`}),isWorkspaceAvailable:P(g(),x()),listWorkspacePackages:P(g(),b(s()).readonly()),uninstallPackage:P(d({packageName:l()}),s(),{kind:`mutation`,auth:`admin`}),reloadPackages:P(g(),_D,{kind:`mutation`,auth:`admin`}),searchAvailable:P(d({query:l().optional()}),b(fD)),listUpdates:P(d({nodeId:l().optional()}),b(uD).readonly(),{auth:`admin`}),updatePackage:P(d({name:l().min(1),version:l().optional(),nodeId:l().optional()}),s(),{kind:`mutation`,auth:`admin`}),rollbackPackage:P(d({name:l().min(1)}),d({rolledBackTo:l().nullable()}),{kind:`mutation`,auth:`admin`}),forceRefresh:P(d({nodeId:l().optional()}),s(),{kind:`mutation`,auth:`admin`}),restartServer:P(d({confirm:m(!0)}),s(),{kind:`mutation`,auth:`admin`}),getLastRestart:P(g(),d({kind:y([`framework-update`,`manual`,`system`,`framework-bulk-update`]),packageName:l().optional(),fromVersion:l().optional(),toVersion:l().optional(),requestedBy:l().optional(),requestedAt:a()}).nullable(),{auth:`admin`}),listFrameworkPackages:P(g(),b(xD).readonly(),{auth:`admin`}),listCapabilityProviders:P(d({capName:l().min(1)}),b(d({addonId:l(),mode:y([`singleton`,`collection`]),isActive:x()})).readonly()),setCapabilityProviderEnabled:P(d({capName:l().min(1),addonId:l().min(1),enabled:x()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getVersions:P(d({name:l()}),b(dD).readonly()),restartAddon:P(d({addonId:l()}),hD,{kind:`mutation`,auth:`admin`}),retryLoad:P(d({packageName:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getAutoUpdateSettings:P(g(),pD,{auth:`admin`}),setAutoUpdateSettings:P(d({channel:rD,intervalSeconds:a().min(300).max(86400).optional(),updateCheckIntervalSeconds:a().min(900).max(604800).optional()}),s(),{kind:`mutation`,auth:`admin`}),getAddonAutoUpdate:P(d({addonId:l()}),mD,{auth:`admin`}),setAddonAutoUpdate:P(d({addonId:l(),channel:iD}),s(),{kind:`mutation`,auth:`admin`}),applyAutoUpdateToAll:P(d({channel:rD}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),custom:P(wD,s(),{kind:`mutation`}),startJob:P(d({kind:y([`install`,`update`,`uninstall`,`restart`]),targets:b(d({name:l().min(1),version:l().min(1)})).min(1),nodeIds:b(l()).optional()}),d({jobId:l()}),{kind:`mutation`,auth:`admin`}),getJob:P(d({jobId:l()}),tD.nullable(),{auth:`admin`}),listJobs:P(d({activeOnly:x().optional()}),b(tD),{auth:`admin`}),cancelJob:P(d({jobId:l()}),d({cancelled:x()}),{kind:`mutation`,auth:`admin`}),onAddonLogs:P(d({addonId:l(),level:nD.optional()}),SD,{kind:`subscription`})},mount:{kind:`server-provided`}},ED=d({co2Ppm:a().min(0).optional(),vocPpb:a().min(0).optional(),pm25:a().min(0).optional(),pm10:a().min(0).optional(),aqi:a().optional(),lastFetchedAt:a(),unit:l().optional(),precision:a().int().min(0).max(10).optional()}),DD={name:`air-quality-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:ED,kind:`push`},runtimeState:ED,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},OD=d({lux:a().min(0),lastFetchedAt:a(),unit:l().optional(),precision:a().int().min(0).max(10).optional()}),kD={name:`ambient-light-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:OD,kind:`push`},runtimeState:OD,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},AD=d({className:l(),hits:a().int().nonnegative(),avgScore:a().min(0).max(1),peakScore:a().min(0).max(1)}),jD=d({ts:a().int(),windowSec:a().int().positive(),level:d({rms:a(),dbfs:a()}),peakDbfs:a(),avgDbfs:a(),current:d({className:l(),score:a().min(0).max(1),timestamp:a().int()}).nullable(),byClass:b(AD).readonly()}),MD=d({ts:a().int(),dbfs:a().nullable(),peakDbfs:a(),avgDbfs:a(),topClass:l().nullable(),topScore:a().min(0).max(1).nullable()}),ND=d({points:b(MD).readonly(),effectiveSampleEveryMs:a().int().positive(),windowMsActual:a().int().nonnegative()}),PD={name:`audio-metrics`,scope:`device`,mode:`singleton`,deviceTypes:[L.Camera],methods:{getCurrentSnapshot:P(d({deviceId:a()}),jD.nullable()),getHistory:P(d({deviceId:a(),windowSec:a().int().positive().optional(),sampleEveryMs:a().int().positive().optional()}),ND)},runtimeState:jD,durability:`session`},FD=d({enabled:x(),isRunning:x(),lastTriggeredAt:a(),lastError:l().nullable(),lastChangedAt:a()}),ID={name:`automation-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Automation],methods:{enable:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`admin`}),disable:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`admin`}),trigger:P(d({deviceId:a().int().nonnegative(),skipCondition:x().optional()}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:FD,kind:`push`},runtimeState:FD,durability:`session`},LD=d({percentage:a().min(0).max(100).nullable(),charging:y([`dc`,`solar`,`none`,`unknown`]),sleeping:x(),lastUpdated:a(),lastContactAt:a().optional(),binary:x().optional()}),RD={name:`battery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera,L.Sensor,L.Button,L.Switch],methods:{wakeForStream:P(d({deviceId:a(),timeoutMs:a().int().min(500).max(3e4).default(8e3)}),d({awoke:x(),durationMs:a()}),{kind:`mutation`})},events:{onStatusChanged:{data:d({deviceId:a(),status:LD})}},status:{schema:LD,kind:`push`,empty:{percentage:0,charging:`unknown`,sleeping:!1,lastUpdated:0}},runtimeState:LD,durability:`restored`,volatileStateFields:[`lastUpdated`]},zD=d({on:x(),lastChangedAt:a()}),BD={name:`binary`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:zD,kind:`push`},runtimeState:zD,durability:`restored`,volatileStateFields:[`lastChangedAt`]},VD=d({percentage:a().min(0).max(100),lastChangedAt:a()}),HD={name:`brightness`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Light],methods:{setBrightness:P(d({deviceId:a().int().nonnegative(),percentage:a().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`})},events:{onBrightnessChanged:{data:d({deviceId:a(),percentage:a().min(0).max(100),lastChangedAt:a()})}},status:{schema:VD,kind:`command-driven`},runtimeState:VD,durability:`session`},UD={name:`button`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Button],methods:{press:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`})}},WD=d({host:l(),port:a().int().positive().optional(),onvifPort:a().int().positive().optional(),rtspPort:a().int().positive().optional(),https:x().optional(),username:l().optional(),password:l().optional(),onvifProfile:l().optional()}),GD=d({host:l(),port:a().int().positive().nullable(),onvifPort:a().int().positive().nullable(),rtspPort:a().int().positive().nullable(),https:x().nullable(),hasUsername:x(),hasPassword:x(),onvifProfile:l().nullable()}),KD={name:`camera-credentials`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],methods:{getCredentials:P(d({deviceId:a()}),WD.nullable(),{kind:`query`,auth:`admin`})},status:{schema:GD,kind:`command-driven`}},qD=d({x:a().min(0).max(1),y:a().min(0).max(1),width:a().gt(0).max(1),height:a().gt(0).max(1)}),JD=d({deviceId:a().int().positive(),source:qD,cell:qD}),YD=d({profile:y([`high`,`mid`,`low`]),offered:x(),missingSources:b(a().int().positive()),canvas:l(),published:x()}),XD=d({instanceId:l(),deviceId:a().int().nonnegative(),name:l(),fps:a().int(),cells:b(JD),profiles:b(YD)}),ZD=d({deviceId:a().int().nonnegative(),name:l().min(1).max(160).optional(),fps:a().int().min(1).max(60).optional(),publishedProfiles:b(y([`high`,`mid`,`low`])).max(3).optional(),cells:b(JD).max(16)}),QD={name:`camera-grid-layout`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],exposesDeviceSettings:!0,methods:{getLayout:P(d({deviceId:a().int().nonnegative()}),XD.nullable(),{auth:`admin`}),saveLayout:P(ZD,XD,{kind:`mutation`,auth:`admin`})}},$D=d({detected:x(),lastChangedAt:a()}),eO={name:`carbon-monoxide`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:$D,kind:`push`},runtimeState:$D,durability:`restored`,volatileStateFields:[`lastChangedAt`]},tO=y([`off`,`heat`,`cool`,`auto`,`heat_cool`,`fan_only`,`dry`]),nO=d({mode:tO,availableModes:b(tO),fanMode:l(),availableFanModes:b(l()),preset:l(),availablePresets:b(l()),target:a().nullable(),targetHigh:a().nullable(),targetLow:a().nullable(),targetHumidity:a().min(0).max(100).nullable(),currentTemp:a().nullable(),currentHumidity:a().min(0).max(100).nullable(),swingVertical:x().nullable(),swingHorizontal:x().nullable(),lastFetchedAt:a()}),rO={name:`climate-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Thermostat,L.Climate],methods:{setMode:P(d({deviceId:a().int().nonnegative(),mode:tO}),g(),{kind:`mutation`,auth:`protected`}),setFanMode:P(d({deviceId:a().int().nonnegative(),fanMode:l().min(1)}),g(),{kind:`mutation`,auth:`protected`}),setPreset:P(d({deviceId:a().int().nonnegative(),preset:l().min(1)}),g(),{kind:`mutation`,auth:`protected`}),setTarget:P(d({deviceId:a().int().nonnegative(),target:a()}),g(),{kind:`mutation`,auth:`protected`}),setTargetRange:P(d({deviceId:a().int().nonnegative(),targetLow:a(),targetHigh:a()}),g(),{kind:`mutation`,auth:`protected`}),setTargetHumidity:P(d({deviceId:a().int().nonnegative(),targetHumidity:a().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`}),setSwingVertical:P(d({deviceId:a().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`}),setSwingHorizontal:P(d({deviceId:a().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:nO,kind:`push`},runtimeState:nO,durability:`session`},iO=d({r:a().int().min(0).max(255),g:a().int().min(0).max(255),b:a().int().min(0).max(255)}),aO=d({h:a().min(0).max(360),s:a().min(0).max(100),v:a().min(0).max(100)}),oO=p(`mode`,[d({mode:m(`rgb`),rgb:iO}),d({mode:m(`hsv`),hsv:aO}),d({mode:m(`mired`),mireds:a().int().min(50).max(1e3)})]),sO=d({mode:y([`rgb`,`hsv`,`mired`]),rgb:iO.optional(),hsv:aO.optional(),mireds:a().int().optional(),lastChangedAt:a()}),cO={name:`color`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Light],methods:{setColor:P(d({deviceId:a().int().nonnegative(),color:oO}),g(),{kind:`mutation`,auth:`protected`})},events:{onColorChanged:{data:d({deviceId:a(),mode:y([`rgb`,`hsv`,`mired`]),rgb:iO.optional(),hsv:aO.optional(),mireds:a().int().optional(),lastChangedAt:a()})}},status:{schema:sO,kind:`command-driven`},runtimeState:sO,durability:`session`},lO=2e4,uO=p(`outcome`,[d({outcome:m(`validated`),latencyMs:a().nonnegative().optional(),detail:l().optional()}).strict(),d({outcome:m(`rejected`),error:l()}).strict(),d({outcome:m(`inconclusive`),error:l()}).strict()]),dO=d({settings:_(l(),s())}),fO=d({label:l()}),pO={name:`connection-test`,scope:`system`,mode:`collection`,methods:{testSettings:P(dO,uO,{kind:`mutation`,auth:`admin`}),describeTest:P(g(),fO,{auth:`admin`})}},mO=d({connected:x(),lastChangedAt:a()}),hO={name:`connectivity`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:mO,kind:`push`},runtimeState:mO,durability:`restored`,volatileStateFields:[`lastChangedAt`]},gO=d({key:l().min(1),label:l().min(1),level:a().min(0).max(100).nullable(),status:y([`ok`,`replace`]).nullable(),lastResetAt:a().nullable(),resettable:x()}),_O=d({items:b(gO),lastChangedAt:a()}),vO={name:`consumables`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:Object.values(L),deviceConfig:{ui:{kind:`widget`,widgetId:`host/consumables-panel`,tab:`consumables`,topTab:!0,label:`Consumables`,order:5}},methods:{reset:P(d({deviceId:a().int().nonnegative(),key:l().min(1)}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:_O,kind:`push`,empty:{items:[],lastChangedAt:0},itemArray:{path:`items`,keyField:`key`,labelField:`label`,itemSchema:gO,emptyItem:{key:``,label:``,level:null,status:null,lastResetAt:null,resettable:!1}}},runtimeState:_O.extend({lastFetchedAt:a()}),durability:`restored`,volatileStateFields:[`lastChangedAt`,`lastFetchedAt`]},yO=d({entryOpen:x(),lastChangedAt:a()}),bO={name:`contact`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:yO,kind:`push`},runtimeState:yO,durability:`restored`,volatileStateFields:[`lastChangedAt`]},xO=y([`numeric`,`select`,`text`,`datetime`]),SO=d({kind:xO,value:f([a(),l()]),options:b(l()),lastChangedAt:a(),unit:l().optional(),min:a().optional(),max:a().optional(),step:a().optional(),precision:a().int().min(0).max(10).optional(),format:y([`date`,`time`,`datetime`]).optional()}),CO=p(`kind`,[d({kind:m(`numeric`),value:a()}),d({kind:m(`select`),value:l().min(1)}),d({kind:m(`text`),value:l()}),d({kind:m(`datetime`),value:l().min(1)})]),wO={name:`control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Control],methods:{setValue:P(d({deviceId:a().int().nonnegative(),control:CO}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:SO,kind:`push`},runtimeState:SO,durability:`session`},TO=y([`open`,`opening`,`closing`,`closed`,`stopped`]),EO=d({state:TO,position:a().min(0).max(100).nullable(),tiltPosition:a().min(0).max(100).nullable(),lastChangedAt:a()}),DO={name:`cover`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Cover],methods:{open:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),close:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),stop:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),setPosition:P(d({deviceId:a().int().nonnegative(),position:a().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`}),setTiltPosition:P(d({deviceId:a().int().nonnegative(),tiltPosition:a().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:EO,kind:`push`},runtimeState:EO,durability:`restored`,volatileStateFields:[`lastChangedAt`]},OO=y([`auto`,`day`,`night`,`schedule`]),kO=d({min:a(),max:a(),step:a()}),AO=d({mode:OO,sensitivity:a().optional(),switchDelaySec:a().optional(),lastFetchedAt:a()}),jO=d({modes:b(OO),supportsSensitivity:x(),sensitivity:kO.optional(),supportsSwitchDelay:x(),switchDelaySec:kO.optional()}),MO=d({mode:OO.optional(),sensitivity:a().optional(),switchDelaySec:a().optional()}),NO={name:`day-night`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`day-night`,tab:`image`}},methods:{getOptions:P(d({deviceId:a()}),jO),setSettings:P(d({deviceId:a(),settings:MO}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:AO,kind:`poll`},runtimeState:AO,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},PO=d({id:l(),label:l(),protocol:y([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:l().optional(),resolution:d({width:a(),height:a()}).optional(),fps:a().optional(),bitrate:a().optional(),codec:l().optional(),profileHint:C.optional(),sdp:l().optional()}),FO=d({key:l(),value:s()}),IO=d({source:l(),data:_(l(),s())}),LO={name:`device-ops`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{getStreamSources:P(d({deviceId:a()}),b(PO)),getConfigEntries:P(d({deviceId:a()}),b(FO)),setConfig:P(d({deviceId:a(),values:_(l(),s())}),g(),{kind:`mutation`,auth:`admin`}),runAction:P(d({deviceId:a(),action:l().min(1),input:s()}),s(),{kind:`mutation`}),removeDevice:P(d({deviceId:a()}),g(),{kind:`mutation`,auth:`admin`}),getSettingsSchema:P(d({deviceId:a()}),s().nullable()),getRawState:P(d({deviceId:a()}),IO.nullable(),{auth:`protected`})}},RO=d({online:x(),lastChangedAt:a()}),zO={name:`device-status`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onStatusChanged:{data:d({deviceId:a(),status:RO})}},status:{schema:RO,kind:`push`},runtimeState:RO,durability:`restored`,volatileStateFields:[`lastChangedAt`]},BO=y([`date`,`time`,`datetime`]),VO=d({value:l(),format:BO.optional(),lastFetchedAt:a()}),HO={name:`enum-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:VO,kind:`push`},runtimeState:VO,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},UO=d({deviceId:a(),eventType:l(),data:_(l(),s()).nullable(),timestamp:a(),seq:a()}),WO=d({eventTypes:b(l()),lastEvent:UO.nullable(),eventCountSinceStart:a()}),GO={name:`event-emitter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.EventEmitter],methods:{},events:{onEvent:{data:UO}},status:{schema:WO,kind:`push`},runtimeState:WO,durability:`session`},KO=d({id:l(),name:l(),sampleCount:a().int().nonnegative(),coverMediaId:a().int().optional(),coverBase64:l().optional()}),qO=d({id:l(),source:y([`detected`,`photo`]),addedAt:a().int(),deviceId:a().int().optional(),base64:l().optional()}),JO=d({sampleId:l(),enrolledAt:a().int(),deviceId:a().int().optional(),source:y([`detected`,`photo`]),mediaId:a().int().optional(),comparable:x(),selfMean:a().nullable(),bestForeign:d({identityId:l(),name:l(),score:a()}).optional(),suspicion:a()}),YO=d({identityId:l(),name:l(),modelId:l(),totalSamples:a().int(),comparableSamples:a().int(),flagged:a().int(),flagThreshold:a(),rows:b(JO).readonly()}),XO=d({faceId:l(),deviceId:a().int(),trackId:l(),timestamp:a().int(),recognizedIdentityId:l().optional(),identityName:l().optional(),assigned:x(),base64:l().optional(),cropUrl:l().optional(),faceBbox:z.optional(),keyFrameMediaId:a().int().optional(),bestMatchScore:a().optional(),nativeFaceShortSidePx:a().optional(),suggestedIdentityId:l().optional(),suggestedMatchScore:a().optional()}),ZO=y([`unassigned`,`recognized`,`identified`,`all`]),QO=y([`timestamp`,`suggestionConfidence`]),$O=y([`asc`,`desc`]),ek=d({faceIds:b(l()).readonly(),representativeFaceId:l(),size:a().int(),cohesion:a()}),tk=d({mediaId:a().int(),kind:l(),url:l(),sizeBytes:a(),timestamp:a()}),nk={name:`face-gallery`,scope:`system`,mode:`singleton`,methods:{listIdentities:P(d({includeCrops:x().optional()}).optional(),b(KO).readonly()),createIdentity:P(d({name:l().min(1)}),KO,{kind:`mutation`,auth:`admin`}),renameIdentity:P(d({id:l(),name:l().min(1)}),g(),{kind:`mutation`,auth:`admin`}),deleteIdentity:P(d({id:l()}),g(),{kind:`mutation`,auth:`admin`}),listIdentitySamples:P(d({identityId:l()}),b(qO).readonly()),auditIdentitySamples:P(d({identityId:l().min(1)}),YO,{auth:`admin`}),removeSample:P(d({identityId:l(),sampleId:l()}),g(),{kind:`mutation`,auth:`admin`}),listRecentFaces:P(d({deviceId:a().int().optional(),deviceIds:b(a().int()).optional(),limit:a().int().positive().optional(),filter:ZO.optional(),since:a().int().optional(),until:a().int().optional(),sortBy:QO.optional(),sortDirection:$O.optional(),includeCrops:x().optional()}).optional(),b(XO).readonly()),getFaceByTrack:P(d({deviceId:a().int(),trackId:l()}),XO.nullable()),getFaceMedia:P(d({faceId:l()}),b(tk).readonly()),assignFace:P(d({faceId:l(),identityId:l()}),g(),{kind:`mutation`,auth:`admin`}),unassignFace:P(d({faceId:l()}),g(),{kind:`mutation`,auth:`admin`}),deleteFace:P(d({faceId:l()}),g(),{kind:`mutation`,auth:`admin`}),assignFaces:P(d({faceIds:b(l()).min(1),identityId:l()}),d({assigned:a().int(),failed:b(l()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignFaces:P(d({faceIds:b(l()).min(1)}),d({unassigned:a().int(),failed:b(l()).readonly()}),{kind:`mutation`,auth:`admin`}),suggestFaceClusters:P(d({threshold:a().min(0).max(1).optional(),minClusterSize:a().int().min(2).optional(),maxClusters:a().int().positive().optional(),limit:a().int().positive().optional(),maxFacesScanned:a().int().positive().optional()}).optional(),b(ek).readonly())}},rk=y([`forward`,`reverse`]),ik=d({percentage:a().min(0).max(100).nullable(),percentageStep:a().positive().optional(),preset:l(),availablePresets:b(l()),direction:rk.nullable(),oscillating:x().nullable(),lastChangedAt:a()}),ak={name:`fan-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Fan],methods:{setPercentage:P(d({deviceId:a().int().nonnegative(),percentage:a().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`}),setPreset:P(d({deviceId:a().int().nonnegative(),preset:l().min(1)}),g(),{kind:`mutation`,auth:`protected`}),setDirection:P(d({deviceId:a().int().nonnegative(),direction:rk}),g(),{kind:`mutation`,auth:`protected`}),setOscillating:P(d({deviceId:a().int().nonnegative(),oscillating:x()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:ik,kind:`push`},runtimeState:ik,durability:`session`},ok=d({flags:_(l(),s()),deviceType:l().nullable(),model:l().nullable(),channelCount:a().nullable(),lastProbedAt:a(),lastFetchedAt:a()}),sk={name:`feature-probe`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onProbeChanged:{data:d({deviceId:a(),status:ok})}},status:{schema:ok,kind:`push`},runtimeState:ok,durability:`session`},ck=d({flooded:x(),lastChangedAt:a()}),lk={name:`flood`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:ck,kind:`push`},runtimeState:ck,durability:`restored`,volatileStateFields:[`lastChangedAt`]},uk=d({detected:x(),lastChangedAt:a()}),dk={name:`gas`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:uk,kind:`push`},runtimeState:uk,durability:`restored`,volatileStateFields:[`lastChangedAt`]},fk=d({on:x(),currentHumidity:a().min(0).max(100).nullable(),targetHumidity:a().min(0).max(100).nullable(),mode:l().nullable(),availableModes:b(l()),action:l().nullable(),minHumidity:a().nullable(),maxHumidity:a().nullable(),lastChangedAt:a()}),pk={name:`humidifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Humidifier],methods:{setOn:P(d({deviceId:a().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`}),setTargetHumidity:P(d({deviceId:a().int().nonnegative(),humidity:a().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`}),setMode:P(d({deviceId:a().int().nonnegative(),mode:l().min(1)}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:fk,kind:`push`},runtimeState:fk,durability:`session`},mk=d({percent:a().min(0).max(100),lastFetchedAt:a(),unit:l().optional(),precision:a().int().min(0).max(10).optional()}),hk={name:`humidity-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor,L.Thermostat],methods:{},status:{schema:mk,kind:`push`},runtimeState:mk,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},gk=d({url:l().nullable(),lastUpdated:a().nullable()}),_k={name:`image`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Image],methods:{},status:{schema:gk,kind:`push`},runtimeState:gk,durability:`session`},vk=y([`0`,`90`,`180`,`270`]),yk=y([`auto`,`manual`]),bk=y([`auto`,`manual`]),xk=y([`off`,`blc`,`wdr`,`hlc`]),Sk=d({min:a(),max:a(),step:a()}),Ck=d({brightness:a().optional(),contrast:a().optional(),saturation:a().optional(),sharpness:a().optional(),mirror:x().optional(),flip:x().optional(),rotate:vk.optional(),whiteBalance:yk.optional(),warmth:a().optional(),exposureMode:bk.optional(),backlightMode:xk.optional(),lastFetchedAt:a()}),wk=d({supportsBrightness:x(),brightness:Sk.optional(),supportsContrast:x(),contrast:Sk.optional(),supportsSaturation:x(),saturation:Sk.optional(),supportsSharpness:x(),sharpness:Sk.optional(),supportsMirror:x(),supportsFlip:x(),rotateOptions:b(vk),whiteBalanceModes:b(yk),supportsWarmth:x(),warmth:Sk.optional(),exposureModes:b(bk),backlightModes:b(xk)}),Tk=d({brightness:a().optional(),contrast:a().optional(),saturation:a().optional(),sharpness:a().optional(),mirror:x().optional(),flip:x().optional(),rotate:vk.optional(),whiteBalance:yk.optional(),warmth:a().optional(),exposureMode:bk.optional(),backlightMode:xk.optional()}),Ek={name:`image-settings`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`image-settings`,tab:`image`}},methods:{getOptions:P(d({deviceId:a()}),wk),setSettings:P(d({deviceId:a(),settings:Tk}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:Ck,kind:`poll`},runtimeState:Ck,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},Dk=d({id:l(),addonId:l(),name:l(),enabled:x(),info:_(l(),s()).readonly(),createdAt:a(),updatedAt:a(),processState:l()}),Ok=d({id:l(),addonId:l(),name:l(),enabled:x(),info:_(l(),s()).readonly(),createdAt:a(),updatedAt:a()}),kk=d({addonId:l(),name:l(),description:l(),iconUrl:l().nullable(),color:l(),instanceMode:l(),mode:y([`standalone`,`account`,`broker`]),discoveryMode:l(),kind:y([`device-adoption`,`device-provider`]),brokerKind:l().nullable(),supportsLocationImport:x(),canTest:x(),existingInstances:b(d({id:l(),name:l()})),canAdd:x()}),Ak=y([`validated`,`rejected`,`inconclusive`,`unsupported`]),jk=d({success:x(),error:l().optional(),status:Ak.optional(),testedBy:l().nullable().optional(),latencyMs:a().nonnegative().optional(),detail:l().optional()}),Mk=d({addonId:l(),name:l(),enabled:x().optional(),info:_(l(),s()).optional(),settings:_(l(),s()).optional(),skipRestart:x().optional()}),Nk=d({id:l(),name:l().optional(),enabled:x().optional(),info:_(l(),s()).optional()}),Pk=d({success:x(),deletedId:l()}),Fk={name:`integrations`,scope:`system`,mode:`singleton`,methods:{list:P(g(),b(Dk)),get:P(d({id:l()}),Dk),getByAddonId:P(d({addonId:l()}),Ok.nullable()),create:P(Mk,Ok,{kind:`mutation`,auth:`admin`}),update:P(Nk,Ok,{kind:`mutation`,auth:`admin`}),delete:P(d({id:l()}),Pk,{kind:`mutation`,auth:`admin`}),getSettings:P(d({id:l()}),_(l(),s()),{auth:`admin`}),setSettings:P(d({id:l(),settings:_(l(),s())}),d({success:x()}),{kind:`mutation`,auth:`admin`}),getAvailableTypes:P(g(),b(kk),{auth:`admin`}),testConnection:P(d({addonId:l(),settings:_(l(),s())}),jk,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},Ik=d({codecs:b(l()),sampleRate:a(),duplex:y([`half`,`full`]),maxBacklogMs:a()}),Lk=d({talking:x(),lastSessionAt:a().nullable(),ability:Ik.nullable()}),Rk=y([`opus`,`s16le`,`g711ulaw`,`g711alaw`]),zk={name:`intercom`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],methods:{startSession:P(d({deviceId:a()}),d({sessionId:l(),sdpOffer:l()}),{kind:`mutation`,auth:`protected`}),handleAnswer:P(d({deviceId:a(),sessionId:l(),sdpAnswer:l()}),g(),{kind:`mutation`,auth:`protected`}),stopSession:P(d({deviceId:a(),sessionId:l()}),g(),{kind:`mutation`,auth:`protected`}),startTalkSession:P(d({deviceId:a()}),d({sessionId:l()}),{kind:`mutation`,auth:`protected`}),pushTalkAudio:P(d({deviceId:a(),audioBase64:l(),codec:Rk.optional(),sampleRate:a().int().positive().optional(),channels:a().int().positive().optional(),sequenceNumber:a().int()}),d({accepted:x()}),{kind:`mutation`,auth:`protected`}),endTalkSession:P(d({deviceId:a()}),g(),{kind:`mutation`,auth:`protected`})},events:{onStatusChanged:{data:d({deviceId:a(),status:Lk})}},status:{schema:Lk,kind:`command-driven`},runtimeState:Lk,durability:`session`},Bk=y([`idle`,`mowing`,`paused`,`docked`,`error`]),Vk=y([`info`,`warning`,`error`]),Hk=d({activity:Bk,batteryLevel:a().min(0).max(100).nullable(),progressPercent:a().min(0).max(100).nullable(),currentCode:a().nullable(),currentCodeLabel:l().nullable(),severity:Vk,lastChangedAt:a()}),Uk={name:`lawn-mower-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.LawnMower],methods:{startMowing:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),pause:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),dock:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:Hk,kind:`push`},runtimeState:Hk,durability:`session`},Wk=y([`lan`,`wifi`,`docker`,`vpn`,`loopback`,`other`]),Gk=d({name:l(),family:y([`IPv4`,`IPv6`]),address:l(),cidr:l(),netmask:l(),internal:x(),mac:l(),kind:Wk,preferred:x(),plausible:x(),plausibleReason:l()}),Kk=d({interfaces:b(Gk).readonly(),probedAt:a()}),qk=Gk.nullable(),Jk=d({label:l(),baseUrl:l(),kind:y([`lan-ipv4`,`lan-ipv6`,`public`,`loopback`]),interfaceKind:y([`lan`,`wifi`,`docker`,`vpn`,`other`,`loopback`,`public`]),plausible:x(),plausibleReason:l(),priority:a()}),Yk=y([`server-config`,`server-env`,`caller-hint`,`default`]),Xk=d({port:a().int().min(1).max(65535),source:Yk}),Zk=d({endpoints:b(Jk).readonly(),localPort:Xk}),Qk=d({baseUrl:l().nullable(),resolved:l().nullable()}),$k=d({baseUrls:b(l()).readonly(),resolved:b(l()).readonly()}),eA=d({addresses:b(l()).readonly()}),tA=d({mode:y([`generated`,`uploaded`,`disabled`]),leafFingerprintSha256:l().nullable(),caFingerprintSha256:l().nullable(),validTo:l().nullable(),sans:b(l()),caCertPem:l().nullable(),reissueError:l().nullable(),restartRequired:x()}),nA={name:`local-network`,scope:`system`,mode:`singleton`,methods:{list:P(g(),Kk),getPreferred:P(g(),qk),getConnectionEndpoints:P(d({port:a().int().min(1).max(65535).optional(),includeLoopback:x().optional(),ipv4Only:x().optional(),scheme:y([`http`,`https`]).optional()}),Zk),getNotificationEndpoint:P(g(),Qk),setNotificationEndpoint:P(d({baseUrl:l().nullable()}),Qk,{kind:`mutation`}),getViewerEndpoints:P(g(),$k),setViewerEndpoints:P(d({baseUrls:b(l()).readonly()}),$k,{kind:`mutation`}),getAllowedAddresses:P(g(),eA),setAllowedAddresses:P(eA,d({success:m(!0)}),{kind:`mutation`}),resetAllowlistToBestMatch:P(g(),eA,{kind:`mutation`}),getTlsStatus:P(g(),tA),regenerateCertificate:P(d({reason:l().optional()}),tA,{kind:`mutation`,auth:`admin`}),uploadCertificate:P(d({certPem:l().min(1),keyPem:l().min(1),caPem:l().optional()}),tA,{kind:`mutation`,auth:`admin`}),downloadCa:P(g(),d({pem:l()})),revertToGeneratedCertificate:P(g(),tA,{kind:`mutation`,auth:`admin`})},mount:{kind:`hub-only`}},rA=y([`locked`,`unlocked`,`locking`,`unlocking`,`jammed`]),iA=d({state:rA,lastChangedAt:a()}),aA={name:`lock-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Lock],methods:{lock:P(d({deviceId:a().int().nonnegative(),code:l().min(1).optional()}),g(),{kind:`mutation`,auth:`protected`}),unlock:P(d({deviceId:a().int().nonnegative(),code:l().min(1).optional()}),g(),{kind:`mutation`,auth:`protected`}),open:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:iA,kind:`push`},runtimeState:iA,durability:`restored`,volatileStateFields:[`lastChangedAt`]},oA=y([`off`,`on`,`idle`,`playing`,`paused`,`buffering`,`standby`]),sA=y([`off`,`all`,`one`]),cA=d({type:l(),title:l(),artist:l().optional(),album:l().optional(),imageUrl:l().optional()}),lA=d({state:oA,volumeLevel:a().min(0).max(100).nullable(),isMuted:x().nullable(),source:l(),availableSources:b(l()),currentMedia:cA.nullable(),positionMs:a().int().nonnegative().nullable(),durationMs:a().int().nonnegative().nullable(),shuffle:x().nullable(),repeat:sA.nullable(),lastChangedAt:a()}),uA={name:`media-player`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.MediaPlayer],methods:{play:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),pause:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),stop:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),next:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),previous:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),seek:P(d({deviceId:a().int().nonnegative(),positionMs:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),setVolume:P(d({deviceId:a().int().nonnegative(),volumeLevel:a().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`}),setMute:P(d({deviceId:a().int().nonnegative(),muted:x()}),g(),{kind:`mutation`,auth:`protected`}),setShuffle:P(d({deviceId:a().int().nonnegative(),shuffle:x()}),g(),{kind:`mutation`,auth:`protected`}),setRepeat:P(d({deviceId:a().int().nonnegative(),repeat:sA}),g(),{kind:`mutation`,auth:`protected`}),selectSource:P(d({deviceId:a().int().nonnegative(),source:l().min(1)}),g(),{kind:`mutation`,auth:`protected`}),playMedia:P(d({deviceId:a().int().nonnegative(),mediaId:l().min(1),mediaType:l().min(1)}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:lA,kind:`push`},runtimeState:lA,durability:`session`},dA=d({id:l(),label:l(),scope:y([`mesh`,`public`]),url:l(),hostname:l(),port:a(),protocol:y([`http`,`https`])}),fA=d({id:l(),hostname:l(),magicDns:l(),addresses:b(l()).readonly(),os:l().optional(),online:x(),lastSeenMs:a(),isSelf:x(),connection:y([`direct`,`relay`,`idle`]),relay:l().nullable(),lastHandshakeMs:a(),rxBytes:a(),txBytes:a(),tags:b(l()).readonly(),exitNodeOption:x(),advertisedRoutes:b(l()).readonly(),userLogin:l().nullable(),keyExpiry:a().nullable()}),pA=d({joined:x(),meshIp:l(),magicDnsHostname:l(),peerCount:a(),endpoints:b(dA).readonly(),error:l().optional(),tenantName:l(),magicDnsSuffix:l(),userLogin:l().nullable(),controlPlaneUrl:l(),keyExpiry:a().nullable(),daemonSocket:l().optional(),daemonCliPath:l().optional()}),mA={name:`mesh-network`,scope:`system`,mode:`collection`,providerKind:`mesh`,methods:{getStatus:P(g(),pA),join:P(d({authKey:l().min(8),hostname:l().optional()}),d({joined:m(!0)}),{kind:`mutation`}),startLogin:P(d({hostname:l().optional()}),d({loginUrl:l()}),{kind:`mutation`}),leave:P(g(),d({left:m(!0)}),{kind:`mutation`}),logout:P(g(),d({loggedOut:m(!0)}),{kind:`mutation`}),listPeers:P(g(),d({peers:b(fA).readonly()})),testConnection:P(d({authKey:l().optional()}),d({ok:x(),tenant:l().optional(),daemonVersion:l().optional(),error:l().optional()}),{kind:`mutation`})}},hA=15e3,gA=d({detected:x(),lastDetectedAt:a().nullable(),autoClearAfterMs:a().nullable()}),_A=d({deviceId:a(),detected:x(),timestamp:a(),source:GS,regions:b(yg).readonly().optional()}),vA={name:`motion`,scope:`device`,mode:`singleton`,deviceNative:!0,deviceTypes:[L.Camera,L.Sensor],methods:{isDetected:P(d({deviceId:a()}),x())},events:{onMotionChanged:{data:_A}},status:{schema:gA,kind:`push`},runtimeState:gA,durability:`session`},yA=d({enabled:x(),lastChangedAt:a()}),bA=yA.extend({lastFetchedAt:a()}),xA={name:`motion-trigger`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Light,L.Siren,L.Switch],methods:{setMotionTrigger:P(d({deviceId:a().int().nonnegative(),enabled:x()}),g(),{kind:`mutation`,auth:`admin`})},events:{onMotionTriggerChanged:{data:d({deviceId:a(),enabled:x(),lastChangedAt:a()})}},status:{schema:yA,kind:`command-driven`},runtimeState:bA,durability:`session`},SA=d({id:a(),enabled:x(),shape:M_}),CA=d({enabled:x(),sensitivity:a(),regions:b(SA),lastFetchedAt:a()}),wA=d({maxRegions:a(),supportedShapes:b(F_),grid:L_,sensitivity:d({min:a(),max:a(),step:a()})}),TA=d({enabled:x().optional(),sensitivity:a().optional(),regions:b(SA).optional()}),EA={name:`motion-zones`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/motion-zones-grid`,tab:`motion`,label:`Motion Zones`}},methods:{getOptions:P(d({deviceId:a()}),wA),setZone:P(d({deviceId:a(),patch:TA}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:CA,kind:`poll`},runtimeState:CA,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},DA=y([`person`,`vehicle`,`animal`,`face`,`package`,`other`]),OA=d({class:DA,timestamp:a(),confidence:a().min(0).max(1).optional()}),kA=d({lastByClass:se(DA,OA.nullable()),supportedClasses:b(DA).readonly(),enabled:x()}),AA=y([`boxed`,`while-streaming`,`flag-only`]),jA=d({supportedClasses:b(DA).readonly(),geometry:AA}),MA=d({enabled:x().optional()}),NA=kA.extend({lastFetchedAt:a()}),PA={name:`native-object-detection`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],methods:{getOptions:P(d({deviceId:a()}),jA),setSettings:P(d({deviceId:a(),settings:MA}),g(),{kind:`mutation`,auth:`admin`}),setEnabled:P(d({deviceId:a(),enabled:x()}),g(),{kind:`mutation`,auth:`admin`})},events:{onDetected:{data:d({deviceId:a(),detection:OA})}},status:{schema:kA,kind:`push`},runtimeState:NA,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},FA=d({pan:a().min(-1).max(1).optional(),tilt:a().min(-1).max(1).optional(),speed:a().min(0).max(1).optional()}),IA=y([`goHome`,`locate`,`spotClean`,`findPet`,`personFollow`,`stop`,`startClean`,`pauseClean`,`dockWash`,`autoEmpty`,`flashOn`,`flashOff`]),LA=y([`action`,`sound`]),RA=d({id:l(),kind:LA,label:l(),icon:l(),soundId:a().int().optional(),enabled:x()}),zA=[{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}],BA=d({x:a(),y:a()}),VA=d({move:x(),stop:x(),goToPoint:x(),runAction:x(),playSound:x(),light:x(),lightMode:x()}),HA=y([`auto`,`manual`]),UA=y([`idle`,`cleaning`,`spot`,`following`,`goto`,`returning`,`paused`,`unknown`]),WA=d({mode:UA,following:x(),flash:x(),lightMode:HA,lightLevel:a().min(40).max(100),lastChangedAt:a()}),GA=WA.extend({lastFetchedAt:a()}),KA={name:`navigation`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/navigation-panel`,tab:`navigation`,topTab:!0,label:`Navigation`,order:0}},methods:{move:P(FA.extend({deviceId:a()}),g(),{kind:`mutation`}),stop:P(d({deviceId:a()}),g(),{kind:`mutation`}),goToPoint:P(BA.extend({deviceId:a()}),g(),{kind:`mutation`}),listActions:P(d({deviceId:a()}),b(RA)),runAction:P(d({deviceId:a(),actionId:IA}),g(),{kind:`mutation`}),playSound:P(d({deviceId:a(),soundId:a().int()}),g(),{kind:`mutation`}),setLightOn:P(d({deviceId:a(),on:x()}),g(),{kind:`mutation`}),setLightMode:P(d({deviceId:a(),mode:HA,level:a().min(40).max(100).optional()}),g(),{kind:`mutation`}),setLightLevel:P(d({deviceId:a(),level:a().min(40).max(100)}),g(),{kind:`mutation`}),getFeatures:P(d({deviceId:a()}),VA)},events:{onStatusChanged:{data:d({deviceId:a(),status:WA})}},status:{schema:WA,kind:`push`},runtimeState:GA,durability:`session`},qA=[`wifi`,`ethernet`,`cellular`,`unknown`],JA=d({type:y(qA),signalPercent:a().min(0).max(100).nullable(),rssiDbm:a().optional(),ssid:l().optional(),lastUpdated:a()}),YA={type:`unknown`,signalPercent:null,lastUpdated:0};function XA(e,t){return e===void 0||!Number.isFinite(e)||t<=0||e<0||e>t?null:Math.round(e/t*100)}function ZA(e){return e===void 0||!Number.isFinite(e)||e>0?null:Math.round((Math.min(-50,Math.max(-100,e))+100)*2)}var QA={name:`network-link`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera,L.Sensor,L.Button,L.Switch,L.Light,L.Lock,L.Siren],methods:{},events:{onStatusChanged:{data:d({deviceId:a(),status:JA})}},status:{schema:JA,kind:`push`,empty:YA},runtimeState:JA,durability:`restored`,volatileStateFields:[`lastUpdated`]},$A=d({nominalBitrateKbps:a(),observedBitrateKbps:a(),peakBitrateKbps:a(),packetLossPercent:a(),lastUpdated:a()}),ej=d({rttMs:a(),jitterMs:a(),estimatedBandwidthKbps:a(),packetLossPercent:a().min(0).max(100),downlinkMbps:a().optional(),downlinkAgeMs:a().optional(),lastUpdated:a()}),tj=d({deviceId:a(),streams:_(l(),$A),client:ej.optional()}),nj={name:`network-quality`,scope:`system`,mode:`singleton`,methods:{getDeviceStats:P(d({deviceId:a()}),tj.nullable()),getAllStats:P(g(),b(tj).readonly()),reportClientStats:P(d({deviceId:a(),rttMs:a().min(0).max(6e4),jitterMs:a().min(0).max(1e4),estimatedBandwidthKbps:a().min(0).max(1e6),packetLossPercent:a().min(0).max(100),downlinkMbps:a().min(0).max(1e5).optional(),downlinkAgeMs:a().min(0).max(864e5).optional()}),g(),{kind:`mutation`})},mount:{kind:`server-provided`}},rj=d({addonId:l(),capabilities:b(l()).readonly(),status:l()}),ij=d({pid:a(),name:l(),state:l(),cpuPercent:a(),memoryRss:a(),uptimeSeconds:a(),services:b(rj).readonly(),groupId:l().optional()}),aj=d({id:l(),status:l(),cpuPercent:a(),memoryRss:a()}),oj=d({category:l(),total:a(),healthy:a(),addons:b(aj).readonly()}),sj=d({name:l(),version:l()}),cj=d({id:l(),name:l(),hostname:l(),platform:l(),arch:l(),cpuModel:l().nullable(),cpuCores:a(),memoryMB:a(),engines:b(l()).readonly(),isHub:x(),isOnline:x(),cpuPercent:a(),memoryPercent:a(),uptime:a(),lastSeen:l(),localIps:b(l()).readonly(),addons:b(d({id:l(),capabilities:b(l()).readonly(),status:l()})).readonly(),processes:b(ij).readonly(),categories:b(oj).readonly(),rootPackage:sj.nullable()}),lj=d({callerAddonId:l(),providerAddonId:l(),capName:l(),callsPerMin:a(),lastCallAtMs:a()}),uj=d({nodeId:l(),name:l(),version:l(),status:l(),synced:x()}),dj=d({hubVersion:l(),nodes:b(uj)}),fj=d({nodeId:l(),addonId:l()}),pj=d({id:l(),status:l(),version:l().optional(),packageName:l().optional()}),mj=d({success:x()}),hj=d({success:x(),reason:l().optional()}),gj=d({restarted:b(l()).readonly(),failed:b(l()).readonly()}),_j=d({nodeId:l(),name:l()}),vj=d({id:l(),name:l(),isHub:x(),isOnline:x()}),yj=d({nodes:b(vj).readonly(),complete:x()}),bj={name:`nodes`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{topology:P(g(),b(cj).readonly(),{auth:`admin`}),directory:P(g(),yj,{auth:`admin`}),deployAddon:P(fj,mj,{kind:`mutation`,auth:`admin`}),undeployAddon:P(fj,mj,{kind:`mutation`,auth:`admin`}),restartAddon:P(fj,mj,{kind:`mutation`,auth:`admin`}),restartProcess:P(d({nodeId:l(),processName:l()}),hj,{kind:`mutation`,auth:`admin`}),restartNode:P(d({nodeId:l()}),gj,{kind:`mutation`,auth:`admin`}),shutdownNode:P(d({nodeId:l()}),mj,{kind:`mutation`,auth:`admin`}),renameNode:P(d({nodeId:l(),name:l().min(1).max(64)}),_j,{kind:`mutation`,auth:`admin`}),clusterAddonStatus:P(g(),_(l(),dj),{auth:`admin`}),getCapUsageGraph:P(d({windowSeconds:a().int().positive().max(300).default(60)}),b(lj).readonly(),{auth:`admin`}),getNodeAddons:P(d({nodeId:l()}),b(pj).readonly(),{auth:`admin`}),setProcessLogLevel:P(d({nodeId:l(),level:l()}),mj,{kind:`mutation`,auth:`admin`}),executeQuery:P(d({nodeId:l(),addonId:l(),queryName:l(),params:_(l(),s()).optional()}),s(),{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},xj=y([`min`,`low`,`normal`,`high`]),Sj=d({id:l().min(1),title:l().min(1),uri:c().optional(),destructive:x().optional()}),Cj=d({image:x(),priority:x(),data:x(),actions:x(),recipients:x()}),wj=d({lastSentAt:a(),lastError:l().nullable(),queueDepth:a().int().nonnegative(),supports:Cj}),Tj=d({deviceId:a().int().nonnegative(),title:l().optional(),body:l().min(1),image:l().optional(),priority:xj.optional(),channel:l().optional(),recipients:b(l()).optional(),actions:b(Sj).optional(),data:_(l(),s()).optional()}),Ej=d({notificationId:l(),acceptedAt:a()}),Dj={name:`notifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Notifier],methods:{send:P(Tj,Ej,{kind:`mutation`,auth:`admin`}),cancel:P(d({deviceId:a().int().nonnegative(),notificationId:l().min(1)}),g(),{kind:`mutation`,auth:`admin`})},events:{onSent:{data:d({deviceId:a(),notificationId:l(),success:x(),error:l().nullable(),acceptedAt:a()})}},status:{schema:wj,kind:`command-driven`},runtimeState:wj,durability:`session`},Oj=d({value:a(),unit:l().optional(),precision:a().int().min(0).max(10).optional(),lastFetchedAt:a()}),kj={name:`numeric-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:Oj,kind:`push`},runtimeState:Oj,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},Aj=y([`text`,`timestamp`,`watermark`]),jj=y([`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`custom`]),Mj=d({id:l(),kind:Aj,enabled:x(),text:l().optional(),position:jj.optional(),availablePositions:b(jj).readonly(),readOnly:x().optional()}),Nj=d({overlays:b(Mj).readonly()}),Pj=d({enabled:x().optional(),text:l().optional(),position:jj.optional()}).partial(),Fj={name:`osd`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],methods:{setOverlay:P(d({deviceId:a(),overlayId:l(),patch:Pj}),g(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:d({deviceId:a(),status:Nj})}},status:{schema:Nj,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}}}]}},Ij=p(`kind`,[d({kind:m(`static`),text:l().max(64)}),d({kind:m(`clock`),pattern:l().min(1).max(32).default(`HH:mm`),timezone:l().min(1).max(64).optional()}),d({kind:m(`device-state`),deviceId:a().int().optional(),capName:l().min(1).max(64),valuePath:l().min(1).max(64)}),d({kind:m(`latest-recognition`),recognition:y([`person`,`plate`])})]),Lj=d({enabled:x().default(!0),source:Ij,template:l().max(96).default("${value}"),maxCharacters:a().int().min(4).max(64).optional(),maxDecimals:a().int().min(0).max(4).default(1),unitLabel:l().max(8).optional(),valueMap:_(l(),l()).optional(),schedule:Z_.optional(),conditions:fv.optional(),fallbackText:l().max(64).default(``)}),Rj=d({slotId:l(),kind:Aj,readOnly:x(),cameraEnabled:x(),cameraText:l().optional(),binding:Lj.nullable()}),zj=y([`written`,`unchanged`,`gated`,`unreadable`,`disabled`,`unbound`,`failed`]),Bj=d({slotId:l(),outcome:zj,text:l(),reason:l().optional()}),Vj=y([`number`,`boolean`,`string`,`enum`]),Hj=d({deviceId:a().int(),deviceName:l(),capName:l(),valuePath:l(),label:l(),valueType:Vj,enumValues:b(l()).readonly().optional()}),Uj={name:`osd-manager`,scope:`system`,mode:`singleton`,methods:{getDeviceOsd:P(d({deviceId:a().int()}),d({supported:x(),slots:b(Rj)}),{auth:`admin`}),getSourceCatalog:P(d({deviceId:a().int()}),d({sources:b(Hj)}),{auth:`admin`}),getConditionSupport:P(d({}),d({supported:b(l()),catalog:b(Hv)}),{auth:`admin`}),setSlotBinding:P(d({deviceId:a().int(),slotId:l().min(1),binding:Lj}),d({slot:Rj,render:Bj}),{kind:`mutation`,auth:`admin`}),clearSlotBinding:P(d({deviceId:a().int(),slotId:l().min(1)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),copyDeviceConfiguration:P(d({sourceDeviceId:a().int(),targetDeviceId:a().int()}),d({copied:a().int().nonnegative(),skipped:a().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),previewSlot:P(d({deviceId:a().int(),slotId:l().min(1),binding:Lj.optional()}),Bj,{kind:`mutation`,auth:`admin`}),renderDevice:P(d({deviceId:a().int()}),d({results:b(Bj)}),{kind:`mutation`,auth:`admin`})}},Wj=y([`normal`,`offline`,`on_batteries`]),Gj=a().int().min(4).max(200),Kj=d({foodLevel:a().nullable(),food1:a().nullable(),food2:a().nullable(),lowFood:x(),batteryPower:a().min(0).max(100).nullable(),desiccantLeftDays:a().nullable(),feeding:x(),status:Wj.nullable(),error:l().nullable(),errorCode:a().nullable(),isDualHopper:x(),childLock:x(),indicatorLight:x(),feedSound:x(),volume:a(),lastFetchedAt:a()}),qj={name:`pet-feeder`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.PetFeeder],methods:{feed:P(d({deviceId:a().int().nonnegative(),grams:Gj.optional(),hopper1:Gj.optional(),hopper2:Gj.optional()}),g(),{kind:`mutation`,auth:`protected`}),cancelFeed:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),resetDesiccant:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),markFoodReplenished:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),callPet:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),playSound:P(d({deviceId:a().int().nonnegative(),soundId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),setChildLock:P(d({deviceId:a().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`}),setIndicatorLight:P(d({deviceId:a().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`}),setFeedSound:P(d({deviceId:a().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`}),setVolume:P(d({deviceId:a().int().nonnegative(),level:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:Kj,kind:`poll`},runtimeState:Kj,durability:`session`},Jj=d({id:l(),name:l(),sampleCount:a().int().nonnegative(),coverMediaId:a().int().optional(),coverBase64:l().optional()}),Yj=d({id:l(),text:l(),score:a(),addedAt:a().int(),deviceId:a().int().optional(),base64:l().optional()}),Xj=d({plateId:l(),deviceId:a().int(),trackId:l(),timestamp:a().int(),text:l(),score:a(),corrected:x(),recognizedVehicleId:l().optional(),vehicleName:l().optional(),assigned:x(),plateBbox:z.optional(),keyFrameMediaId:a().int().optional(),base64:l().optional(),cropUrl:l().optional()}),Zj=d({mediaId:a().int(),kind:l(),url:l(),sizeBytes:a(),timestamp:a()}),Qj=d({plateIds:b(l()).readonly(),representativePlateId:l(),representativeText:l(),size:a().int(),cohesion:a()}),$j={name:`plate-gallery`,scope:`system`,mode:`singleton`,methods:{listPlates:P(d({deviceId:a().int().optional(),limit:a().int().positive().optional(),includeCrops:x().optional()}).optional(),b(Xj).readonly()),getPlateByTrack:P(d({deviceId:a().int(),trackId:l()}),Xj.nullable()),getPlateMedia:P(d({plateId:l()}),b(Zj).readonly()),searchPlates:P(d({text:l().min(1),maxDistance:a().int().min(0).optional(),limit:a().int().positive().optional(),includeCrops:x().optional()}),b(Xj).readonly()),suggestPlateClusters:P(d({maxDistance:a().int().min(0).optional(),minClusterSize:a().int().min(2).optional(),limit:a().int().positive().optional()}).optional(),b(Qj).readonly()),correctPlateText:P(d({plateId:l(),text:l().min(1)}),g(),{kind:`mutation`,auth:`admin`}),deletePlate:P(d({plateId:l()}),g(),{kind:`mutation`,auth:`admin`}),listVehicles:P(d({includeCrops:x().optional()}).optional(),b(Jj).readonly()),createVehicle:P(d({name:l().min(1)}),Jj,{kind:`mutation`,auth:`admin`}),renameVehicle:P(d({id:l(),name:l().min(1)}),g(),{kind:`mutation`,auth:`admin`}),deleteVehicle:P(d({id:l()}),g(),{kind:`mutation`,auth:`admin`}),listVehicleSamples:P(d({vehicleId:l()}),b(Yj).readonly()),removeVehicleSample:P(d({vehicleId:l(),sampleId:l()}),g(),{kind:`mutation`,auth:`admin`}),assignPlate:P(d({plateId:l(),vehicleId:l()}),g(),{kind:`mutation`,auth:`admin`}),unassignPlate:P(d({plateId:l()}),g(),{kind:`mutation`,auth:`admin`}),assignPlates:P(d({plateIds:b(l()).min(1),vehicleId:l()}),d({assigned:a().int(),failed:b(l()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignPlates:P(d({plateIds:b(l()).min(1)}),d({unassigned:a().int(),failed:b(l()).readonly()}),{kind:`mutation`,auth:`admin`})}},eM=y(ss),tM=y([`videotoolbox`,`cuda`,`nvdec`,`vaapi`,`qsv`,`d3d11va`,`dxva2`,`amf`,`vdpau`,`drm`,`coreml`,`tensorrt`,`openvino`,`directml`,`webgpu`,`none`]).nullable().optional(),nM=d({preferred:b(l()).readonly(),rationale:l()}),rM=y([`h264_videotoolbox`,`hevc_videotoolbox`,`h264_vaapi`,`hevc_vaapi`,`h264_nvenc`,`hevc_nvenc`,`h264_qsv`,`hevc_qsv`,`h264_amf`,`hevc_amf`,`libx264`,`libx265`]);d({encoders:b(d({encoder:rM,codec:y([`H264`,`H265`]),family:y([`videotoolbox`,`vaapi`,`nvenc`,`qsv`,`amf`,`software`]),available:x(),reason:l().optional()})).readonly(),defaultH264:rM,defaultH265:rM,probedAt:a()}),d({methods:b(l()).readonly(),probedAt:a()});var iM=y([`darwin`,`linux`,`win32`]),aM=y([`arm64`,`x64`]),oM=d({type:y([`nvidia`,`amd`,`intel`,`apple`]),name:l(),memoryMB:a().optional()}),sM=d({type:y([`apple-ane`,`intel-npu`])}),cM=d({type:m(`coral-edgetpu`),bus:l().optional()}),lM=d({platform:iM,arch:aM,cpuModel:l(),cpuCores:a(),totalRAM_MB:a(),availableRAM_MB:a(),gpu:oM.nullable(),npu:sM.nullable(),coral:cM.nullable().optional()}),uM=d({runtime:m(`python`),backend:l(),format:y([`onnx`,`coreml`,`openvino`,`tflite`]),score:a(),reason:l(),available:x()}),dM=d({key:l(),backend:l(),device:l(),format:eM,runtime:m(`python`),score:a(),available:x()}),fM=d({hardware:lM,scores:b(uM).readonly(),bestScore:uM,pythonPath:l().nullable(),devices:b(dM).readonly()}),pM=d({modelId:l(),name:l(),minRAM_MB:a(),accuracyScore:a(),formats:b(l()).readonly()}),mM=d({modelId:l(),runtime:m(`python`),backend:l(),format:eM,reason:l()}),hM={name:`platform-probe`,scope:`system`,mode:`singleton`,methods:{getCapabilities:P(g(),fM),getHardware:P(g(),lM),resolveInferenceConfig:P(d({requirements:b(pM).readonly()}),mM),resolveHwAccel:P(d({prefer:tM}),nM)}},gM=d({watts:a().optional(),kwhTotal:a().optional(),volts:a().optional(),amps:a().optional(),va:a().optional(),powerFactor:a().min(0).max(1).optional(),lastFetchedAt:a(),unit:l().optional(),precision:a().int().min(0).max(10).optional()}),_M={name:`power-meter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:gM,kind:`push`},runtimeState:gM,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},vM=d({latitude:a().min(-90).max(90),longitude:a().min(-180).max(180),accuracyMeters:a().nonnegative()}),yM=d({state:l(),location:l().nullable(),gps:vM.nullable(),batteryPercent:a().min(0).max(100).nullable(),lastChangedAt:a()}),bM={name:`presence`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Presence],methods:{},status:{schema:yM,kind:`push`},runtimeState:yM,durability:`restored`,volatileStateFields:[`lastChangedAt`]},xM=d({hpa:a(),lastFetchedAt:a(),unit:l().optional(),precision:a().int().min(0).max(10).optional()}),SM={name:`pressure-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:xM,kind:`push`},runtimeState:xM,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},CM=p(`kind`,[A_,j_]),wM=d({id:a(),enabled:x(),shape:CM}),TM=d({enabled:x(),regions:b(wM).nullable(),audioEnabled:x().nullable(),lastFetchedAt:a()}),EM=d({maxRegions:a(),supportedShapes:b(F_),polygonVertices:I_.optional(),supportsAudioMute:x()}),DM=d({enabled:x().optional(),regions:b(wM).optional()}),OM={name:`privacy-mask`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/privacy-mask-grid`,tab:`image`,label:`Privacy Mask`}},methods:{getOptions:P(d({deviceId:a()}),EM),setMask:P(d({deviceId:a(),patch:DM}),g(),{kind:`mutation`,auth:`admin`}),setAudioEnabled:P(d({deviceId:a(),enabled:x()}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:TM,kind:`poll`},runtimeState:TM,durability:`restored`,volatileStateFields:[`lastFetchedAt`]};function kM(e){return e.length===0?null:e.some(e=>e.audioEnabled)}var AM=y([`home`,`day-mode`,`night-mode`,`day-night-auto`,`set-limits`,`save-limits`,`reboot`,`osd-menu`]),jM=d({id:l(),name:l(),fn:AM.nullable(),writable:x()}),MM=d({pan:a().nullable(),tilt:a().nullable(),zoom:a().nullable()}),NM=d({pan:a().optional(),tilt:a().optional(),zoom:a().optional(),speed:a().optional()}),PM=MM.extend({autofocus:x()}),FM=d({hasPan:x(),hasTilt:x(),hasZoom:x(),supportsPresets:x(),maxPresets:a().optional(),hasAutofocus:x(),speedSteps:a().int().positive().nullable(),moveImpulseMs:a().int().positive().nullable()}),IM=d({presetId:l().nullable(),source:y([`operator`,`firmware`,`native`,`none`])}),LM=d({enabled:x(),seconds:a().int()}),RM={name:`ptz`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-panel`,tab:`ptz`,topTab:!0,label:`PTZ`,order:0}},methods:{move:P(NM.extend({deviceId:a()}),g(),{kind:`mutation`}),continuousMove:P(NM.extend({deviceId:a()}),g(),{kind:`mutation`}),stop:P(d({deviceId:a()}),g(),{kind:`mutation`}),getPresets:P(d({deviceId:a()}),b(jM)),goToPreset:P(d({deviceId:a(),presetId:l()}),g(),{kind:`mutation`}),savePreset:P(d({deviceId:a(),presetId:l(),name:l()}),g(),{kind:`mutation`,auth:`admin`}),deletePreset:P(d({deviceId:a(),presetId:l()}),g(),{kind:`mutation`,auth:`admin`}),getOptions:P(d({deviceId:a()}),FM),goHome:P(d({deviceId:a()}),g(),{kind:`mutation`}),getHomePreset:P(d({deviceId:a()}),IM),setHomePreset:P(d({deviceId:a(),presetId:l().nullable()}),g(),{kind:`mutation`,auth:`admin`}),captureHomeHere:P(d({deviceId:a()}),g(),{kind:`mutation`,auth:`admin`}),getHomeReturn:P(d({deviceId:a()}),LM.nullable()),setHomeReturn:P(d({deviceId:a(),enabled:x(),seconds:a().int().min(0).max(3600)}),g(),{kind:`mutation`,auth:`admin`}),getPosition:P(d({deviceId:a()}),MM),setAutofocus:P(d({deviceId:a(),enabled:x()}),g(),{kind:`mutation`})},status:{schema:PM,kind:`command-driven`}},zM=d({targetType:l().describe(`Vendor target string (people/vehicle/pet); empty = camera default`),stopDelaySeconds:a().int().min(0).max(300),disappearDelaySeconds:a().int().min(0).max(300)}),BM=d({value:l(),label:l()}),VM=d({enabled:x(),lastChangedAt:a(),currentSettings:zM.nullable(),supportedTargetTypes:b(BM)}),HM=VM.extend({lastFetchedAt:a()}),UM={name:`ptz-autotrack`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!1,deviceTypes:[L.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-autotrack`,tab:`ptz`,topTab:!0,label:`Auto-Tracking`,order:5}},methods:{getStatus:P(d({deviceId:a()}),VM),setEnabled:P(d({deviceId:a(),enabled:x()}),g(),{kind:`mutation`}),getSettings:P(d({deviceId:a()}),zM.nullable()),setSettings:P(d({deviceId:a(),settings:zM.partial()}),g(),{kind:`mutation`})},events:{onStatusChanged:{data:d({deviceId:a(),status:VM})}},status:{schema:VM,kind:`command-driven`},runtimeState:HM,durability:`session`},WM={name:`reboot`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera,L.Sensor,L.Switch],methods:{reboot:P(d({deviceId:a().int().nonnegative()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`})}},GM=`camstack`,KM=`recorder`,qM=d({profile:l(),startMs:a(),endMs:a()}),JM=y([`read`,`unreadable`]),YM=d({deviceId:a(),read:JM,ranges:b(qM),profilesWithFootage:b(l())}),XM=d({deviceId:a(),read:JM,days:b(a())}),ZM=d({deviceId:a(),localMasterPath:l().nullable(),playbackUrl:l().nullable(),playbackEndpoints:b(l())}),QM=d({state:y([`ok`,`sleeping`,`unreachable`,`no-storage`,`index-empty`]),reason:l().optional(),coverageAsOf:a().optional()}),$M=d({source:l(),label:l(),addonId:l().optional(),availability:QM}),eN=d({transport:y([`archive`,`stream`,`realtime`]),coverage:y([`continuous`,`sparse`]),seek:y([`free`,`forward`,`segment`]),stepBack:x(),scrub:x(),rates:b(a().positive()).min(1).readonly(),exclusive:x()}),tN=p(`kind`,[d({kind:m(`hls`),manifest:ZM}),d({kind:m(`clip`),source:l(),clipId:l(),startsAtMs:a()}),d({kind:m(`none`),reason:l()})]),nN={name:`recording`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:[L.Camera],methods:{listSources:P(d({deviceId:a()}),b($M).readonly(),{kind:`query`,auth:`protected`}),getAvailability:P(d({deviceId:a(),provider:l().min(1),fromMs:a(),toMs:a(),profile:l().optional()}),YM,{kind:`query`,auth:`protected`}),getDaysWithRecordings:P(d({deviceId:a(),provider:l().min(1),fromMs:a(),toMs:a(),tzOffsetMinutes:a()}),XM,{kind:`query`,auth:`protected`}),getPlayback:P(d({deviceId:a(),provider:l().min(1),fromMs:a(),toMs:a(),profile:C.optional()}),tN,{kind:`query`,auth:`protected`}),getPlaybackOptions:P(d({deviceId:a(),provider:l().min(1)}),eN,{kind:`query`,auth:`protected`})}},rN=d({deviceId:a(),enabled:x(),activeMode:mi,nodeId:l(),storageBytes:a()}),iN=d({deviceId:a(),read:y([`read`,`unreadable`]),ranges:b(qM).readonly(),profilesWithFootage:b(l()).readonly()}),aN=d({deviceId:a(),read:y([`read`,`unreadable`]),days:b(a()).readonly()}),oN=d({deviceId:a(),usedBytes:a(),oldestMs:a().nullable().optional(),segments:a().optional(),residentBytes:a().optional(),residentOldestMs:a().nullable().optional()}),sN=d({locationId:l().nullable(),locationIds:b(l()).optional(),root:l().optional(),usedBytes:a(),availableBytes:a().nullable(),totalBytes:a().nullable()}),cN=d({nodeId:l(),totalUsedBytes:a(),devices:b(oN),devicesRead:y([`archive`,`unavailable`]).optional(),locations:b(sN).optional()}),lN=d({deviceId:a(),profile:l(),fromLocationId:l(),toLocationId:l(),bytes:a(),files:a().int()}),uN=y([`unassigned`,`target-not-writable`,`below-threshold`,`no-headroom`]),dN=d({deviceId:a(),profile:l(),fromLocationId:l(),toLocationId:l().nullable(),bytes:a(),reason:uN}),fN=d({moves:b(lN),skipped:b(dN),bytesToMove:a(),jobIds:b(l())}),pN=d({throttleMbps:a().min(1).max(1e3).optional(),minMoveGb:a().min(0).optional()}),mN=d({deviceId:a().int(),profile:l(),locationId:l()}),hN=d({deviceId:a().int(),locationId:l()}),gN=d({assignments:b(mN),pins:b(hN),defaultLocations:_(l(),l())}),_N=d({deviceId:a().int(),locationId:l().nullable()}),vN=p(`kind`,[d({kind:m(`segment`),startMs:a(),durMs:a(),bytes:a()}),d({kind:m(`gap`),nearestEdgeMs:a().nullable(),prevEndMs:a().nullable().optional()})]),yN=d({data:v(Uint8Array)}),bN=d({data:v(Uint8Array),gopStartMs:a(),gopDurMs:a()}),xN=p(`kind`,[d({kind:m(`ok`),data:v(Uint8Array),gopStartMs:a(),gopDurMs:a(),reachesRequestedEnd:x()}),d({kind:m(`spans-multiple-segments`),segmentEndMs:a()})]),SN={name:`recording-archive`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,status:{schema:rN,kind:`command-driven`},methods:{getAvailabilityBatch:P(d({deviceIds:b(a()).min(1).max(200),fromMs:a(),toMs:a()}),b(iN).readonly(),{kind:`query`,auth:`protected`}),getDaysWithRecordingsBatch:P(d({deviceIds:b(a()).min(1).max(200),fromMs:a(),toMs:a(),tzOffsetMinutes:a()}),b(aN).readonly(),{kind:`query`,auth:`protected`}),getStorageUsage:P(d({}),cN,{kind:`query`,auth:`admin`}),getDeviceConfig:P(d({deviceId:a()}),Ei,{kind:`query`,auth:`protected`}),locateSegment:P(d({deviceId:a(),profile:l(),epochMs:a()}),vN,{kind:`query`,auth:`admin`}),readSegmentBytes:P(d({deviceId:a(),profile:l(),startMs:a()}),yN,{kind:`query`,auth:`admin`}),readGopBytes:P(d({deviceId:a(),profile:l(),startMs:a(),epochMs:a()}),bN,{kind:`query`,auth:`admin`}),readWindowBytes:P(d({deviceId:a(),profile:l(),startMs:a(),fromMs:a(),toMs:a()}),xN,{kind:`query`,auth:`admin`}),setDeviceConfig:P(d({deviceId:a(),config:Ei}),Ei,{kind:`mutation`,auth:`admin`}),rescanStorage:P(d({deviceId:a()}),rN,{kind:`mutation`,auth:`admin`}),pruneFootage:P(d({deviceId:a(),reason:Mr.optional()}),d({floorMs:a().nullable(),deletedBuckets:a().int(),reclaimedBytes:a().int()}),{kind:`mutation`,auth:`admin`}),deleteFootprint:P(d({deviceId:a(),fromMs:a().optional(),toMs:a().optional()}),d({deletedBuckets:a().int(),reclaimedBytes:a().int()}),{kind:`mutation`,auth:`admin`}),listOpsLog:P(Pr,b(Nr).readonly(),{kind:`query`,auth:`admin`}),renderGif:P(d({deviceId:a(),aroundMs:a(),preRollSec:a().min(0).max(30).default(2),postRollSec:a().min(0).max(30).default(5),maxWidth:a().int().min(120).max(1280).default(480),fps:a().int().min(1).max(15).default(5)}),d({gifBase64:l(),fromMs:a(),toMs:a()}),{kind:`mutation`,auth:`admin`}),renderClip:P(d({deviceId:a(),aroundMs:a(),preRollSec:a().min(0).max(30).default(3),postRollSec:a().min(0).max(30).default(7),maxWidth:a().int().min(160).max(1920).default(640)}),d({clipBase64:l(),mime:l(),fromMs:a(),toMs:a(),bytes:a().int()}),{kind:`mutation`,auth:`admin`}),pauseForStorageMigration:P(T,d({paused:m(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:P(T,d({resumed:m(!0)}),{kind:`mutation`,auth:`admin`}),refreshStorageLocationsForMigration:P(T,d({refreshed:m(!0)}),{kind:`mutation`,auth:`admin`}),startStorageMigrationMove:P(Bi,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),getStorageMigrationMoveStatus:P(d({jobId:l()}),Li.nullable(),{auth:`admin`}),cancelStorageMigrationMove:P(d({jobId:l()}),d({cancelled:x()}),{kind:`mutation`,auth:`admin`}),relocateFootage:P(zi,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),listRelocateJobs:P(d({}),b(Li).readonly(),{kind:`query`,auth:`admin`}),getRelocateResidue:P(la,ua,{kind:`query`,auth:`admin`}),reconcileLedgerAgainstDisk:P(da,ga,{kind:`mutation`,auth:`admin`}),cancelRelocateJob:P(d({jobId:l()}),d({cancelled:x()}),{kind:`mutation`,auth:`admin`}),planStorageRebalance:P(pN,fN,{kind:`query`,auth:`admin`}),startStorageRebalance:P(pN,fN,{kind:`mutation`,auth:`admin`}),getPlacement:P(d({}),gN,{kind:`query`,auth:`admin`}),setDevicePlacement:P(_N,d({ok:m(!0)}),{kind:`mutation`,auth:`admin`})}},CN=a().min(.25).max(32),wN=d({fromSec:a().nonnegative(),toSec:a().nonnegative()}).refine(e=>e.toSec>e.fromSec,{message:`dense range must have toSec > fromSec`}),TN=d({everyMs:a().int().positive(),ranges:b(wN).min(1).max(200)}),EN=d({everyMs:a().int().positive(),outputFps:a().int().min(1).max(60).optional(),dense:TN.optional()}).superRefine((e,t)=>{e.dense!==void 0&&e.dense.everyMs>=e.everyMs&&t.addIssue({code:le.custom,message:`dense.everyMs must be strictly smaller than the base everyMs`,path:[`dense`,`everyMs`]})}),DN=d({speed:CN.optional(),timelapse:EN.optional(),includeAudio:x(),maxLifeMs:a().int().positive(),deleteAfterDownload:x(),title:l().max(200).optional(),notifyTargetIds:b(l().min(1)).max(20).optional()}).superRefine((e,t)=>{e.speed!==void 0&&e.timelapse!==void 0&&t.addIssue({code:le.custom,message:`speed and timelapse are mutually exclusive`,path:[`timelapse`]})}),ON=y([`queued`,`rendering`,`ready`,`failed`,`expired`,`deleted`]),kN=d({kind:m(`footage`),deviceId:a(),profiles:b(l()).min(1),fromMs:a(),toMs:a()}),AN=d({kind:m(`clip`),deviceId:a(),provider:l().min(1),source:l().min(1),sourceLabel:l().min(1),clipId:l().min(1),catalogWindow:d({sinceMs:a(),untilMs:a()}),profile:y([`high`,`mid`,`low`]),wake:IT.optional()}),jN=p(`kind`,[kN,AN]),MN=d({id:l(),deviceId:a(),profile:l(),fromMs:a(),toMs:a(),subject:jN.optional(),options:DN,state:ON,progressPct:a().nullable(),fileBytes:a().nullable(),expiresAt:a(),deleteAfterDownload:x(),downloadedAt:a().nullable(),createdAt:a(),createdBy:l(),error:l().nullable()}),NN=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 PN(e,t){return t.length>0?`${e}: ${t}`:e}function FN(e){if(e===null)return null;let t=e.split(`:`,1)[0]??``,n=NN.safeParse(t.trim());return n.success?n.data:null}var IN=d({url:l(),endpoints:b(l())}),LN=50*1024*1024,RN=d({base64:l(),contentType:l(),name:l(),bytes:a().int().nonnegative()});function zN(e){return e.profiles!==void 0&&e.profiles.length>0?[...e.profiles]:typeof e.profile==`string`&&e.profile.length>0?[e.profile]:[]}var BN=d({deviceId:a(),profile:l().optional(),profiles:b(l()).min(1).optional(),fromMs:a().optional(),toMs:a().optional(),subject:jN.optional(),options:DN}).superRefine((e,t)=>{if(e.subject?.kind===`clip`){e.subject.deviceId!==e.deviceId&&t.addIssue({code:le.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:le.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:le.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:le.custom,message:`a footage export needs fromMs and toMs`,path:[`fromMs`]}),(e.subject?.kind===`footage`?[...e.subject.profiles]:zN(e)).length<1&&t.addIssue({code:le.custom,message:`pass profiles[] (min 1) or legacy profile`,path:[`profiles`]})});function VN(e){if(e.subject!==void 0)return e.subject;let t=zN(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 HN(e){return e.subject===void 0?{kind:`footage`,deviceId:e.deviceId,profiles:[e.profile],fromMs:e.fromMs,toMs:e.toMs}:e.subject}var UN={name:`recording-export`,scope:`system`,mode:`singleton`,methods:{createExport:P(BN,MN,{kind:`mutation`,auth:`protected`}),listExports:P(d({deviceId:a().optional()}),b(MN),{kind:`query`,auth:`protected`}),getExport:P(d({exportId:l()}),MN,{kind:`query`,auth:`protected`}),cancelExport:P(d({exportId:l()}),MN,{kind:`mutation`,auth:`protected`}),deleteExport:P(d({exportId:l()}),MN,{kind:`mutation`,auth:`protected`}),getDownloadUrl:P(d({exportId:l()}),IN,{kind:`query`,auth:`protected`}),readExportBytes:P(d({exportId:l()}),RN,{kind:`query`,auth:`protected`})}},WN=y([`continuous`,`motion`,`person`,`vehicle`,`animal`,`lineCrossing`,`intrusion`,`loitering`,`alarmInput`]),GN=d({trigger:WN,day:a().int().min(0).max(6),startMinute:a().int().min(0).max(1439),endMinute:a().int().min(1).max(1440)}),KN=d({id:l(),label:l().optional(),status:y([`ok`,`unformatted`,`error`,`offline`,`unknown`]),capacityMb:a().nullable(),freeMb:a().nullable(),writable:x().optional()}),qN=p(`kind`,[d({kind:m(`present`),volumes:b(KN)}),d({kind:m(`absent`),reason:l()}),d({kind:m(`unknown`),reason:l()})]),JN=d({id:l(),enabled:x(),isVideo:x(),codec:l().nullable(),resolution:l().nullable(),overwriteWhenFull:x().nullable()}),YN=d({storage:qN,tracks:b(JN),primaryTrackId:l().nullable(),enabled:x().nullable(),overwriteWhenFull:x().nullable(),preRecordSec:a().nullable(),postRecordSec:a().nullable(),segmentMinutes:a().nullable(),windows:b(GN),unreadableWindows:a(),recordingToNowhere:x(),lastFetchedAt:a()}),XN=d({min:a(),max:a(),step:a()}),ZN=d({values:b(a()).min(1),sentinel:d({value:a(),meaning:y([`no-limit`,`disabled`])}).optional()}),QN=d({readable:x(),writable:x(),reason:l().optional()}),$N=d({support:QN,granularityMinutes:a(),triggers:b(WN),supportsOverlappingTriggers:x()}),eP=d({enabled:QN,overwriteWhenFull:QN,preRecordSec:QN,preRecordSecRange:XN.optional(),preRecordSecAllowed:ZN.optional(),postRecordSec:QN,postRecordSecRange:XN.optional(),postRecordSecAllowed:ZN.optional(),segmentMinutes:QN,segmentMinutesRange:XN.optional(),segmentMinutesAllowed:ZN.optional(),schedule:$N}),tP=d({enabled:x().optional(),overwriteWhenFull:x().optional(),preRecordSec:a().optional(),postRecordSec:a().optional(),segmentMinutes:a().optional(),windows:b(GN).optional()}),nP={name:`recording-onboard`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`recording-onboard`,tab:`recording`}},methods:{getOptions:P(d({deviceId:a()}),eP),setSettings:P(d({deviceId:a(),settings:tP}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:YN,kind:`poll`},runtimeState:YN,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},rP=1440,iP=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`];function aP(e,t){if(t.enabled!==void 0&&!e.enabled.writable)return oP(`the master recording switch`,e.enabled.reason);if(t.overwriteWhenFull!==void 0&&!e.overwriteWhenFull.writable)return oP(`overwrite-when-full`,e.overwriteWhenFull.reason);let n=sP(`pre-record seconds`,t.preRecordSec,e.preRecordSec,e.preRecordSecRange,e.preRecordSecAllowed);if(n)return n;let r=sP(`post-record seconds`,t.postRecordSec,e.postRecordSec,e.postRecordSecRange,e.postRecordSecAllowed);if(r)return r;let i=sP(`segment length (minutes)`,t.segmentMinutes,e.segmentMinutes,e.segmentMinutesRange,e.segmentMinutesAllowed);if(i)return i;if(t.windows!==void 0){let n=cP(e,t.windows);if(n)return n}return null}function oP(e,t){return t?`this camera cannot change ${e}: ${t}`:`this camera cannot change ${e}`}function sP(e,t,n,r,i){if(t===void 0)return null;if(!n.writable)return oP(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 cP(e,t){let n=e.schedule;if(!n.support.writable)return oP(`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 ${uP(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 ${uP(e.day)} window ${dP(e.startMinute)}–${dP(e.endMinute)} is not aligned to them`}if(!n.supportsOverlappingTriggers){let e=lP(t);if(e)return`this camera stores one trigger per time range, so "${e.a.trigger}" and "${e.b.trigger}" cannot both cover ${uP(e.a.day)} ${dP(Math.max(e.a.startMinute,e.b.startMinute))}–${dP(Math.min(e.a.endMinute,e.b.endMinute))}`}return null}function lP(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 uP(e){return iP[e]??`day ${String(e)}`}function dP(e){let t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`}function fP(e,t){return e*24+t}function pP(e){if(e.length===0)return!0;let t=e[0];for(let n of e)if(n!==t)return!1;return!0}function mP(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[fP(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 hP(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[fP(r.day,t)]=`1`}return n.join(``)}function gP(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 _P(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 vP(e){let t=e.trim().toLowerCase(),n=iP.findIndex(e=>e.toLowerCase()===t);return n>=0?n:null}function yP(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 bP=d({active:x(),reason:l(),lastChangedAt:a()}),xP=bP.extend({lastFetchedAt:a()}),SP={name:`recording-signal`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],methods:{getStatus:P(d({deviceId:a()}),bP)},status:{schema:bP,kind:`push`,empty:{active:!1,reason:`unknown`,lastChangedAt:0}},runtimeState:xP,durability:`session`},CP=[{capName:`recording`,sourceId:`camstack`,addonId:`recorder`}];function wP(e,t){for(let n of CP)if(n.capName===e&&n.sourceId===t)return n.addonId;return null}var TP=l(),EP=[`day`,`ir`,`night`,`dawn`,`dusk`],DP=y([`skip`,`judge-anyway`]),OP=`__diverged__`,kP=y([`matched`,`diverged`,`unknown`]),AP=y([`no-reference-for-condition`,`view-shifted`,`no-vision-profile`,`encoder-model-changed`,`no-snapshot`]),jP=d({embedding:b(a()),modelId:l(),condition:TP,capturedAt:a(),thumbnailMediaId:a().int().optional(),anchorEmbedding:b(a()).optional()}),MP=d({id:l(),label:l(),references:b(jP),textPrompts:b(l()).optional(),referenceCount:a(),currentlyMatched:x()}),NP=p(`mode`,[d({mode:m(`similarity`),threshold:a().min(0).max(1),hysteresisCount:a().int().positive()}),d({mode:m(`llm`),prompt:l(),profileId:l().optional(),hysteresisCount:a().int().positive()})]),PP=.85,FP=`skip`,IP=8e3,LP=d({enabled:x().default(!1),prompt:l().min(1).max(1e3),profileId:l().optional(),timeoutMs:a().int().min(1e3).max(2e4).default(IP),maxImagePx:a().int().min(64).max(2048).default(448),onTimeout:y([`flip`,`hold`]).default(`hold`)}),RP=d({id:l(),label:l(),roi:A_,enabled:x(),triggerMode:y([`periodic`,`on-motion`,`both`]),checkIntervalSec:a().optional(),check:NP,states:b(MP),currentStateId:l().nullable(),lastCheckedAt:a().nullable(),lastConfidence:a().nullable(),currentCondition:TP.nullable(),availability:y([`ok`,`unavailable`]),unavailableReason:l().nullable(),baselineStateId:l().nullable(),emit:y([`latched`,`live`]).default(`latched`),verdict:kP,latched:x(),armedAt:a(),divergedAt:a().nullable(),restoredAt:a().nullable(),quietSeconds:a().int().min(0).max(3600).default(60),minObservationSpacingSec:a().int().min(0).max(3600).default(120),confirm:LP.optional(),anchorThreshold:a().min(0).max(1).default(PP),autoRestore:x().default(!1),onUncoveredCondition:DP.default(FP),suspendedCondition:TP.nullable().default(null),unavailable:AP.nullable(),coveredConditions:b(TP)}),zP=d({monitors:b(RP),lastFetchedAt:a()}),BP=d({deviceId:a(),status:zP.nullable()}),VP={name:`scene-monitor`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[L.Camera],methods:{listScenes:P(d({deviceId:a()}),zP),listScenesBatch:P(d({deviceIds:b(a()).min(1).max(200)}),b(BP).readonly()),createScene:P(d({deviceId:a(),label:l(),roi:A_,check:NP,triggerMode:y([`periodic`,`on-motion`,`both`]).optional(),checkIntervalSec:a().optional()}),RP,{kind:`mutation`,auth:`admin`}),updateScene:P(d({deviceId:a(),monitorId:l(),patch:d({label:l().optional(),roi:A_.optional(),enabled:x().optional(),triggerMode:y([`periodic`,`on-motion`,`both`]).optional(),checkIntervalSec:a().optional(),check:NP.optional(),emit:y([`latched`,`live`]).optional(),quietSeconds:a().int().min(0).max(3600).optional(),minObservationSpacingSec:a().int().min(0).max(3600).optional(),anchorThreshold:a().min(0).max(1).optional(),autoRestore:x().optional(),onUncoveredCondition:DP.optional(),confirm:LP.nullable().optional()})}),g(),{kind:`mutation`,auth:`admin`}),deleteScene:P(d({deviceId:a(),monitorId:l()}),g(),{kind:`mutation`,auth:`admin`}),captureReference:P(d({deviceId:a(),monitorId:l(),stateId:l().optional(),label:l().optional(),condition:TP.optional()}),d({stateId:l(),referenceCount:a()}),{kind:`mutation`,auth:`admin`}),deleteReference:P(d({deviceId:a(),monitorId:l(),stateId:l(),index:a()}),g(),{kind:`mutation`,auth:`admin`}),recheckNow:P(d({deviceId:a(),monitorId:l()}),g(),{kind:`mutation`,auth:`admin`}),resetScene:P(d({deviceId:a(),monitorId:l(),recapture:x().optional()}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:zP,kind:`push`},runtimeState:zP,durability:`session`},HP=y([`include`,`exclude`]),UP=d({id:l(),name:l().optional(),zoneIds:b(l()).min(1).readonly(),mode:HP,classFilter:b(l()).readonly().optional(),overlapThreshold:a().min(0).max(1).optional(),bboxInclusionPct:a().min(0).max(100).optional(),preferMask:x().optional(),enabled:x().default(!0)}),WP=b(UP).readonly(),GP=d({isRunning:x(),lastRunAt:a(),lastRunSuccess:x().nullable(),lastError:l().nullable(),lastChangedAt:a()}),KP={name:`script-runner`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Script],methods:{run:P(d({deviceId:a().int().nonnegative(),variables:_(l(),s()).optional()}),g(),{kind:`mutation`,auth:`admin`}),stop:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`admin`})},status:{schema:GP,kind:`push`},runtimeState:GP,durability:`session`},qP=d({detected:x(),lastChangedAt:a()}),JP={name:`smoke`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:qP,kind:`push`},runtimeState:qP,durability:`restored`,volatileStateFields:[`lastChangedAt`]},YP=d({camStreamId:l().min(1),kind:Lr,url:l().optional(),codec:l().optional(),resolution:Rr.optional(),fps:a().positive().optional(),label:l().optional(),deviceFeatures:b(l()).optional(),autoEligible:x().optional(),profileHint:C.optional(),metadata:_(l(),s()).optional()}),XP=d({descriptors:b(YP),lastFetchedAt:a()}),ZP={name:`stream-catalog`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],methods:{getCatalog:P(d({deviceId:a().int().nonnegative()}),b(YP).readonly())},runtimeState:XP,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},QP=y([`main`,`sub`,`ext`]),$P=d({width:a(),height:a(),codec:y([`h264`,`h265`]),framerate:a(),bitrate:a(),bitrateMode:y([`vbr`,`cbr`]).optional(),encoderProfile:y([`high`,`main`,`baseline`]).optional(),gop:a().optional(),audio:x().optional()}),eF=d({main:$P.optional(),sub:$P.optional(),ext:$P.optional(),lastFetchedAt:a()}),tF=d({resolutions:b(d({width:a(),height:a()})),codecs:b(y([`h264`,`h265`])),framerates:b(a()),bitrates:b(a()),bitrateRange:u([a(),a()]).optional(),supportsBitrateMode:x(),supportsEncoderProfile:x(),supportsGop:x(),gop:d({min:a(),max:a(),step:a()}).optional()}),nF=d({main:tF.optional(),sub:tF.optional(),ext:tF.optional()}),rF=d({width:a().optional(),height:a().optional(),codec:y([`h264`,`h265`]).optional(),framerate:a().optional(),bitrate:a().optional(),bitrateMode:y([`vbr`,`cbr`]).optional(),encoderProfile:y([`high`,`main`,`baseline`]).optional(),gop:a().optional()}),iF={name:`stream-params`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`stream-params`,tab:`streaming`}},methods:{getOptions:P(d({deviceId:a()}),nF),setProfile:P(d({deviceId:a(),profile:QP,patch:rF}),g(),{kind:`mutation`,auth:`admin`}),getConfigSchema:P(d({deviceId:a()}),s().nullable())},status:{schema:eF,kind:`poll`},runtimeState:eF,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},aF=[{profile:`main`,prefix:`streamMain`,label:`Main stream`},{profile:`sub`,prefix:`streamSub`,label:`Sub stream`},{profile:`ext`,prefix:`streamExt`,label:`Third stream`}];function oF(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 sF(e,t){let n=[];for(let r of aF){let i=e[r.profile];if(!i)continue;let a=oF(r,i,t?.[r.profile]);a&&n.push(a)}return n.length===0?null:{sections:n}}function cF(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 lF=d({on:x(),lastChangedAt:a()}),uF={name:`switch`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Switch,L.Siren,L.Light],methods:{setState:P(d({deviceId:a(),on:x()}),g(),{kind:`mutation`,auth:`protected`})},events:{onStateChanged:{data:d({deviceId:a(),on:x(),lastChangedAt:a()})}},status:{schema:lF,kind:`command-driven`},runtimeState:lF,durability:`restored`,volatileStateFields:[`lastChangedAt`],settings:{bindings:[{kind:`scalar`,statusPath:`on`,method:`setState`,valueArg:`on`,field:{label:`On`,kind:`boolean`}}]}},dF=d({streaming:x(),notifications:x(),objectDetection:x(),remoteAccess:x(),agentCluster:x(),smartHome:x(),recordings:x(),backup:x(),repl:x()}),fF=d({status:m(`ok`),uptime:a()}),pF=d({name:l(),address:l(),family:l(),internal:x()}),mF=y([`operator-set`,`derived-from-ip`]),hF=d({latitude:a().min(-90).max(90),longitude:a().min(-180).max(180),source:mF,updatedAt:a(),label:l().optional()}),gF=d({location:hF.nullable(),derivationAttemptedAt:a().nullable(),derivationError:l().nullable()}),_F=d({latitude:a().min(-90).max(90),longitude:a().min(-180).max(180)}).nullable(),vF=y([`http`,`ws`,`mesh`,`unknown`]),yF=d({http:a(),ws:a(),mesh:a(),unknown:a()}),bF=d({plane:vF,procedure:l(),userAgent:l(),ip:l(),principal:l(),calls:a(),subscriptions:a(),perMin:a()}),xF=d({procedure:l(),calls:a(),planes:yF,subscriptions:a(),perMin:a()}),SF=d({armed:x(),elapsedMs:a(),windowMs:a(),armedUntilMs:a(),httpRequests:a(),batchedRequests:a(),procedureCalls:a(),planes:yF,planesExplainTotal:x(),wsConnections:a(),wsMessages:a(),subscriptions:a(),subscriptionStops:a(),distinctGroups:a(),unattributedCalls:a(),procedures:b(xF).readonly(),groups:b(bF).readonly()}),CF=SF.extend({persisted:x()}),wF=y([`debug`,`info`,`warn`,`error`]),TF=y([`request-census`]),EF=y([`cluster`,`node`,`component`]),DF=y([`default`,`cluster`,`node`,`component`]),OF=d({scope:EF,nodeId:l().nullable(),component:l().nullable(),level:wF.nullable()}),kF=d({level:wF,levelSource:DF}),AF=d({layers:b(OF).readonly()}),jF=d({id:TF,armed:x(),armedUntilMs:a(),remainingMs:a(),persisted:x()}),MF=d({id:TF,armMs:a().int().min(0),reportEveryMs:a().int().positive().optional()}),NF=d({channel:l(),armed:x(),armedUntilMs:a(),remainingMs:a(),deviceIds:b(a().int()).readonly().nullable()}),PF=d({channel:l().min(1),armMs:a().int().min(0),deviceIds:b(a().int()).readonly().nullable().optional()}),FF=d({level:wF.nullable().optional(),diagnostics:b(MF).readonly().optional(),channels:b(PF).readonly().optional(),opsLogRetentionDays:a().int().min(0).max(3650).optional()}),IF=Fh.extend({addonId:l()}),LF=Wm.extend({addonId:l()}),RF=d({scopeNodeId:l().optional(),scopeComponent:l().optional()}),zF=d({scopeNodeId:l().optional(),scopeComponent:l().optional(),patch:FF}),BF=d({scopeNodeId:l().nullable(),scopeComponent:l().nullable(),effective:kF,explicit:AF,activeWindows:b(jF).readonly(),channels:b(no).readonly(),activeChannels:b(NF).readonly(),opsLogRetentionDays:a().int().min(0),persisted:x()}),VF={name:`system`,scope:`system`,mode:`singleton`,methods:{info:P(g(),dF),health:P(g(),fF),featureFlags:P(g(),dF),networkAddresses:P(g(),b(pF).readonly()),getRetentionConfig:P(g(),s().nullable(),{auth:`admin`}),setRetentionConfig:P(_(l(),s()),ae(),{kind:`mutation`,auth:`admin`}),forceRetentionCleanup:P(g(),g(),{kind:`mutation`,auth:`admin`}),getSiteLocation:P(g(),gF),setSiteLocation:P(_F,gF,{kind:`mutation`,auth:`admin`}),detectSiteLocation:P(g(),gF,{kind:`mutation`,auth:`admin`}),getRequestCensus:P(g(),CF,{auth:`admin`}),getLoadContributions:P(g(),b(IF).readonly(),{auth:`admin`}),getFailureContributions:P(g(),b(LF).readonly(),{auth:`admin`}),getLoggingSettings:P(RF,BF,{auth:`admin`}),setLoggingSettings:P(zF,BF,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},HF=d({tampered:x(),lastChangedAt:a()}),UF={name:`tamper`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:HF,kind:`push`},runtimeState:HF,durability:`restored`,volatileStateFields:[`lastChangedAt`]},WF=d({celsius:a(),lastFetchedAt:a(),unit:l().optional(),precision:a().int().min(0).max(10).optional()}),GF={name:`temperature-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor,L.Thermostat],methods:{},status:{schema:WF,kind:`push`},runtimeState:WF,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},KF=d({title:l(),message:l(),severity:y([`info`,`warning`,`critical`]),duration:a().optional(),action:d({label:l(),url:l()}).optional()}),qF={name:`toast`,scope:`system`,mode:`singleton`,methods:{onToast:P(g(),KF,{kind:`subscription`})},mount:{kind:`server-provided`}},JF=d({currentVersion:l().nullable(),availableVersion:l().nullable(),updatable:x(),state:l().nullable(),inProgress:x()}),YF={name:`update`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Update],methods:{installUpdate:P(g(),g(),{kind:`mutation`,auth:`admin`})},status:{schema:JF,kind:`poll`},runtimeState:JF,durability:`session`},XF=d({id:l(),username:l(),isAdmin:x().default(!1),allowedProviders:f([b(l()),m(`*`)]),allowedDevices:_(l(),f([b(l()),m(`*`)])),scopes:b(G).default([]),totpEnabled:x().default(!1),createdAt:a(),updatedAt:a()}),ZF=d({username:l(),password:l().min(6),isAdmin:x().default(!1),allowedProviders:f([b(l()),m(`*`)]).optional(),allowedDevices:_(l(),f([b(l()),m(`*`)])).optional(),scopes:b(G).optional()}),QF=d({id:l(),isAdmin:x().optional(),allowedProviders:f([b(l()),m(`*`)]).optional(),allowedDevices:_(l(),f([b(l()),m(`*`)])).optional(),scopes:b(G).optional()}),$F=d({id:l(),label:l(),isAdmin:x().default(!1),allowedProviders:f([b(l()),m(`*`)]).optional(),allowedDevices:_(l(),f([b(l()),m(`*`)])).optional(),tokenPrefix:l(),createdAt:a(),lastUsedAt:a().optional()}),eI=d({label:l(),isAdmin:x().default(!1),allowedProviders:f([b(l()),m(`*`)]).optional(),allowedDevices:_(l(),f([b(l()),m(`*`)])).optional()}),tI=d({token:l(),record:$F}),nI=d({id:l(),userId:l(),name:l(),tokenPrefix:l(),scopes:b(G),expiresAt:a().nullish(),lastUsedAt:a().nullish(),createdAt:a()}),rI=d({userId:l(),name:l(),scopes:b(G),expiresAt:a().optional()}),iI=d({token:l(),record:nI}),aI=d({id:l(),userId:l(),username:l(),integrationId:l(),scopes:b(G),createdAt:a(),lastUsedAt:a(),revokedAt:a().nullable()}),oI=d({secret:l(),otpauthUrl:l()}),sI=d({enabled:x(),confirmedAt:a().nullable()}),cI={name:`user-management`,scope:`system`,mode:`singleton`,methods:{listUsers:P(g(),b(XF),{auth:`admin`}),createUser:P(ZF,XF,{kind:`mutation`,auth:`admin`,access:`create`}),updateUser:P(QF,d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),deleteUser:P(d({id:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),resetPassword:P(d({id:l(),newPassword:l().min(6)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),setUserScopes:P(d({userId:l(),scopes:b(G)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),validateCredentials:P(d({username:l(),password:l()}),XF.extend({passwordHash:l()}).nullable(),{kind:`mutation`,access:`view`}),listApiKeys:P(g(),b($F),{auth:`admin`}),createApiKey:P(eI,tI,{kind:`mutation`,auth:`admin`,access:`create`}),revokeApiKey:P(d({id:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateApiKey:P(d({token:l()}),$F.nullable(),{kind:`mutation`,access:`view`}),createScopedToken:P(rI,iI,{kind:`mutation`,auth:`admin`,access:`create`}),revokeScopedToken:P(d({id:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateScopedToken:P(d({token:l()}),nI.nullable(),{access:`view`}),listScopedTokens:P(d({userId:l()}),b(nI),{auth:`admin`}),setupTotp:P(d({userId:l()}),oI,{kind:`mutation`,auth:`admin`,access:`create`}),confirmTotp:P(d({userId:l(),code:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),disableTotp:P(d({userId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getTotpStatus:P(d({userId:l()}),sI,{auth:`admin`}),verifyTotp:P(d({userId:l(),code:l()}),d({valid:x()}),{kind:`mutation`,access:`view`}),oauthIssueCode:P(d({integrationId:l(),userId:l(),username:l(),scopes:b(G),redirectUri:l(),hubUrl:l(),codeChallenge:l().optional(),refreshTtlSec:f([a().int().positive(),m(`never`)]).optional()}),d({code:l()}),{kind:`mutation`,access:`create`}),oauthExchangeCode:P(d({code:l(),redirectUri:l(),codeVerifier:l().optional()}),d({accessToken:l(),refreshToken:l(),expiresIn:a()}).nullable(),{kind:`mutation`,access:`view`}),oauthRefresh:P(d({refreshToken:l()}),d({accessToken:l(),refreshToken:l(),expiresIn:a()}).nullable(),{kind:`mutation`,access:`view`}),oauthVerifyAccessToken:P(d({token:l()}),d({userId:l(),username:l(),scopes:b(G)}).nullable(),{access:`view`}),listOauthSessions:P(g(),b(aI),{auth:`admin`}),revokeOauthSession:P(d({id:l()}),d({success:x()}),{kind:`mutation`,auth:`admin`,access:`delete`})}},lI=y([`idle`,`cleaning`,`paused`,`returning`,`docked`,`drying`,`error`]),uI=d({level:a().min(0).max(100).nullable(),status:y([`ok`,`low`,`full`]).nullable()}),dI=d({state:lI,batteryLevel:a().min(0).max(100).nullable(),fanSpeed:l().nullable(),availableFanSpeeds:b(l()),cleanWater:uI.nullable(),dirtyWater:uI.nullable(),detergent:uI.nullable(),dustBin:uI.nullable(),progressPercent:a().min(0).max(100).nullable(),errorCode:a().nullable(),errorLabel:l().nullable(),lastChangedAt:a()}),fI={name:`vacuum-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Vacuum],methods:{start:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),pause:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),stop:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),returnToBase:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),locate:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),setFanSpeed:P(d({deviceId:a().int().nonnegative(),speed:l().min(1)}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:dI,kind:`push`},runtimeState:dI,durability:`session`},pI=y([`open`,`opening`,`closing`,`closed`,`stopped`]),mI=d({state:pI,position:a().min(0).max(100).nullable(),lastChangedAt:a()}),hI={name:`valve`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Valve],methods:{open:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),close:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),stop:P(d({deviceId:a().int().nonnegative()}),g(),{kind:`mutation`,auth:`protected`}),setPosition:P(d({deviceId:a().int().nonnegative(),position:a().min(0).max(100)}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:mI,kind:`push`},runtimeState:mI,durability:`session`},gI=d({detected:x(),lastChangedAt:a()}),_I={name:`vibration`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Sensor],methods:{},status:{schema:gI,kind:`push`},runtimeState:gI,durability:`restored`,volatileStateFields:[`lastChangedAt`]},vI=d({currentTemp:a().nullable(),targetTemp:a().nullable(),operationMode:l().nullable(),availableModes:b(l()),away:x().nullable(),minTemp:a().nullable(),maxTemp:a().nullable(),lastChangedAt:a()}),yI={name:`water-heater`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.WaterHeater],methods:{setTargetTemp:P(d({deviceId:a().int().nonnegative(),temp:a().finite()}),g(),{kind:`mutation`,auth:`protected`}),setOperationMode:P(d({deviceId:a().int().nonnegative(),mode:l().min(1)}),g(),{kind:`mutation`,auth:`protected`}),setAway:P(d({deviceId:a().int().nonnegative(),on:x()}),g(),{kind:`mutation`,auth:`protected`})},status:{schema:vI,kind:`push`},runtimeState:vI,durability:`session`},bI=d({condition:l().nullable(),temperature:a().nullable(),temperatureUnit:l().nullable(),humidity:a().min(0).max(100).nullable(),pressure:a().nullable(),pressureUnit:l().nullable(),windSpeed:a().nullable(),windSpeedUnit:l().nullable(),windBearing:a().nullable(),lastFetchedAt:a()}),xI={name:`weather`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[L.Weather],methods:{},status:{schema:bI,kind:`push`},runtimeState:bI,durability:`session`},SI=d({totalObjects:a().int().nonnegative(),byClass:_(l(),a().int().nonnegative()),standingObjects:a().int().nonnegative().optional(),transientObjects:a().int().nonnegative().optional()}),CI=SI.extend({zoneId:l(),zoneName:l(),trackIds:b(l()).readonly()}),wI=d({id:l(),className:l(),bbox:d({x:a(),y:a(),w:a(),h:a()}),frameWidth:a().int().nonnegative(),frameHeight:a().int().nonnegative(),firstSeenAt:a().int(),becameStationaryAt:a().int(),lastConfirmedAt:a().int(),label:l().optional(),keyFrameMediaId:a().int().optional()}),TI=d({ts:a().int(),frameWidth:a().int().nonnegative(),frameHeight:a().int().nonnegative(),zones:b(CI).readonly(),frame:SI,unzoned:SI,stationaryObjects:b(wI).readonly().optional()}),EI=d({deviceId:a(),read:y([`read`,`unreadable`]),snapshot:TI.nullable()}),DI=y([`minute`,`5min`,`hour`]),OI=d({from:a().int(),to:a().int(),resolution:DI}),kI=d({ts:a().int(),count:a().int().nonnegative()}),AI={name:`zone-analytics`,scope:`device`,mode:`singleton`,deviceTypes:[L.Camera],methods:{getCurrentSnapshot:P(d({deviceId:a()}),TI.nullable()),getCurrentSnapshotBatch:P(d({deviceIds:b(a()).min(1).max(200)}),b(EI).readonly()),getZoneHistory:P(d({deviceId:a(),zoneId:l(),className:l().optional()}).extend(OI.shape),b(kI).readonly()),getCameraHistory:P(d({deviceId:a(),className:l().optional()}).extend(OI.shape),b(kI).readonly()),getUnzonedHistory:P(d({deviceId:a(),className:l().optional()}).extend(OI.shape),b(kI).readonly())},runtimeState:TI,durability:`session`},jI=y([`motion`,`detection`,`package`]),MI={name:`zone-rules`,scope:`device`,mode:`singleton`,deviceTypes:[L.Camera],methods:{listRules:P(d({deviceId:a(),stage:jI}),b(UP).readonly()),setRules:P(d({deviceId:a(),stage:jI,rules:b(UP).readonly()}),g(),{kind:`mutation`,auth:`admin`})},runtimeState:d({motion:b(UP).readonly(),detection:b(UP).readonly(),package:b(UP).readonly()}),durability:`restored`},NI=[`decoder`,`motion-detection`,`pipeline-executor`,`audio-analyzer`,`pipeline-analytics`,`notification-output`],PI=[...NI,`pipeline-orchestrator`,`pipeline-runner`];function FI(e,t){return t.slot===e}function II(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(!FI(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 LI(e,t){return`${e}:${t}`}function RI(e){let{source:t,label:n,slots:r,hostTypeOf:i,logger:a}=e,o=(e,t)=>t!==null&&mE[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=>LI(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 ${mE[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:LI(t,i.slot),slot:i.slot,authority:r.authority,enabled:r.enabled,projects:mE[i.slot].descriptor.projects??null,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 zI=class extends Error{};function BI(e){return e.composition.features.flatMap(t=>t.kind===`fields`?Object.entries(t.fields).map(([n,r])=>[Ud({source:e.target,cap:t.cap,fieldPath:n}),Kd(r).map(Ud)]):[])}function VI(e,t){let n=B(e.target),r=new Map;for(let e of t){let t=B(e.target);if(t!==n){if(r.has(t))throw new zI(`two stored compositions both target device \`${t}\` — refusing to build the field graph`);r.set(t,e)}}return[...r.values(),e]}function HI(e,t){let n=VI(e,t).flatMap(BI);return new Map(n)}function UI(e,t){let n=HI(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 WI(e){return`${B(e.source)} ${e.cap}.${e.fieldPath}`}function GI(e,t){return e.state===`unavailable`?{state:`unavailable`,value:null,reason:`${WI(t)}: ${e.reason}`,fatal:e.fatal}:{state:e.state,value:e.value,reason:e.state===`stale`?`${WI(t)}: ${e.reason}`:null,deadline:null}}function KI(e,t,n){let r={},i=[],a=null,o=null;for(let[n,s]of Object.entries(e.bindings)){if(s.kind===`literal`){r[n]=s.value;continue}let e=t(s);if(e.state===`unavailable`){let t={state:`unavailable`,value:null,reason:`binding \`${n}\` (${WI(s)}): ${e.reason}`,fatal:e.fatal};if(e.fatal){a=t;break}o===null&&(o=t);continue}r[n]=e.value,e.state===`stale`&&i.push(`\`${n}\`: ${e.reason}`)}if(a!==null)return a;if(o!==null)return o;let s=[],c=pc(e.expr,r,n,{hooks:{noteDeadline:e=>s.push(e)}});return c.ok?{state:i.length>0?`stale`:`fresh`,value:c.value,reason:i.length>0?i.join(`; `):null,deadline:s.length>0?Math.min(...s):null}:{state:`unavailable`,value:null,reason:`the expression failed: ${c.error}`,fatal:!1}}function qI(e){let{source:t}=e;switch(t.kind){case`from`:return GI(e.read(t),t);case`expression`:return KI(t,e.read,e.now);case`code`:return{state:`unavailable`,value:null,reason:`code fields are not runnable in the composer — they arrive in slice 4`,fatal:!0}}}var JI=3e5,YI=[{addonId:`provider-homeassistant`,stableId:`sensor.living_room_temperature`},{addonId:`provider-homeassistant`,stableId:`sensor.sofa_temperature`},{addonId:`provider-homeassistant`,stableId:`sensor.window_temperature`}],XI=[{addonId:`provider-homeassistant`,stableId:`binary_sensor.living_room_motion`},{addonId:`provider-homeassistant`,stableId:`binary_sensor.living_room_presence`}];function ZI(e,t,n){return{kind:`from`,source:e,cap:t,fieldPath:n}}function QI(e,t,n,r){return Object.fromEntries(t.map((t,i)=>[`${e}${i+1}`,ZI(t,n,r)]))}function $I(e){let t=QI(`t`,e.temperatureSources,`temperature-sensor`,`celsius`),n=QI(`f`,e.temperatureSources,`temperature-sensor`,`lastFetchedAt`),r=QI(`d`,e.motionSources,`motion`,`detected`),i=QI(`m`,e.motionSources,`motion`,`lastDetectedAt`),a=Object.keys(i).map(t=>`within(${t}, ${e.occupancyWindowMs})`);return Vd.parse({target:{kind:`new`,type:L.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 q={kind:`fixed`,result:[`number`]},eL={kind:`fixed`,result:[`boolean`]},tL=Object.freeze({min:q,max:q,abs:q,floor:q,ceil:q,sqrt:q,round:q,pow:q,clamp:q,avg:q,sum:q,age:q,convert:q,coalesce:{kind:`coalesce`},any:eL,all:eL,within:eL,latest:{kind:`fixed`,result:[`number`,`null`]}}),nL=class extends Error{};function rL(e){return e===null?`null`:typeof e==`number`?`number`:typeof e==`string`?`string`:`boolean`}function iL(e){return new Set([e])}function aL(...e){return new Set(e.flatMap(e=>[...e]))}function oL(e){return new Set([...e].filter(e=>e!==`null`))}function sL(e,t,n){if(e===`+`){let e=[...t,...n];return e.every(e=>e===`string`)?iL(`string`):e.every(e=>e===`number`)?iL(`number`):new Set([`number`,`string`])}return iL(e===`-`||e===`*`||e===`/`||e===`%`?`number`:`boolean`)}function cL(e){return e.minArgs===e.maxArgs?`exactly ${e.minArgs}`:e.maxArgs===1/0?`at least ${e.minArgs}`:`${e.minArgs}–${e.maxArgs}`}function lL(e,t){let n=Ms[e];if(n!==void 0&&(t.length<n.minArgs||t.length>n.maxArgs))throw new nL(`${e}: wrong number of arguments (${t.length}); expected ${cL(n)}`);let r=tL[e];if(r===void 0)throw new nL(`no result-kind rule for builtin '${e}'`);if(r.kind===`fixed`)return new Set(r.result);let i=aL(...t.map(oL));return t.every(e=>e.has(`null`))?aL(i,iL(`null`)):i}function uL(e,t){switch(e.kind){case`literal`:return iL(rL(e.value));case`identifier`:{if(e.name===`now`)return iL(`number`);let n=t.get(e.name);if(n===void 0)throw new nL(`unbound identifier '${e.name}'`);return n}case`unary`:return iL(e.op===`!`?`boolean`:`number`);case`binary`:return sL(e.op,uL(e.left,t),uL(e.right,t));case`logical`:return aL(uL(e.left,t),uL(e.right,t));case`conditional`:return aL(uL(e.consequent,t),uL(e.alternate,t));case`call`:return lL(e.callee,e.args.map(e=>uL(e,t)))}}function dL(e){let t=ec(e.expr);if(!t.ok)return{ok:!1,error:t.error};try{return{ok:!0,kinds:uL(t.parsed.ast,e.bindingKinds)}}catch(e){if(e instanceof nL)return{ok:!1,error:e.message};throw e}}function fL(e){let t=e;for(;t instanceof fe||t instanceof me||t instanceof te;)t=t.unwrap();return t}function pL(e){let t=fL(e);return t instanceof ue?{kind:`enum`,enumValues:t.options}:t instanceof ne?{kind:`number`}:t instanceof re?{kind:`string`}:t instanceof oe?{kind:`boolean`}:null}function mL(e,t=``){let n=fL(e);if(!(n instanceof ce))return[];let r=[],i=n.shape;for(let[e,n]of Object.entries(i)){let i=t?`${t}.${e}`:e,a=fL(n);if(a instanceof ce){r.push(...mL(a,i));continue}let o=pL(n);o&&r.push({path:i,kind:o.kind,...o.enumValues?{enumValues:o.enumValues}:{}})}return r}function hL(e){return mL(e.itemSchema).filter(t=>t.path!==e.keyField).map(e=>({...e,item:!0}))}function gL(e,t){let n=e;for(let e of t.split(`.`)){let t=fL(n);if(!(t instanceof ce))return null;let r=t.shape[e];if(!(r instanceof ie))return null;n=r}return n}function _L(e,t){let n=mL(e).find(e=>e.path===t);if(n===void 0)return null;let r=gL(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 vL(e){return new Map(mL(e).filter(e=>!e.path.includes(`.`)).flatMap(t=>{let n=_L(e,t.path);return n===null?[]:[[t.path,n]]}))}function yL(e){let t=fL(e);return t instanceof ce?Object.entries(t.shape).flatMap(([e,t])=>t instanceof ie&&!t.safeParse(void 0).success?[e]:[]):[]}function bL(e){let t=new Map(e.map(e=>[e.name,e]));return e=>t.get(e)??null}var xL=new Set([`device-status`,`feature-probe`]),SL={addonId:Sd,stableId:`${Cd}(unsaved)`};function J(e,t,n){return{code:e,path:t,message:n}}function CL(...e){return{problems:e,fields:[]}}function wL(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=_L(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 TL(e,t){if(e.kind===`from`)return wL(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([rL(i.value)]));continue}let e=wL(i,t);if(!e.ok)return{...e,message:`binding \`${r}\`: ${e.message}`};n.set(r,e.kinds)}let r=dL({expr:e.expr,bindingKinds:n});return r.ok?{ok:!0,kinds:r.kinds}:{ok:!1,code:`expression-invalid`,message:r.error}}function EL(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(J(`kind-mismatch`,r,`\`${e}.${t.path}\` is a ${t.kind}; this source can produce ${a.join(` or `)}`)),n.has(`null`)&&!t.nullable&&o.push(J(`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 DL(e){if(e.kind!==`expression`)return null;let t=ec(e.expr);if(!t.ok)return null;let n=t.parsed.ast;return n.kind===`literal`&&typeof n.value==`string`?n.value:null}function OL(e,t,n,r){if(t.kind!==`enum`||t.enumValues===void 0)return null;let i=DL(n);if(i===null||t.enumValues.includes(i))return null;let a=t.enumValues.map(e=>`\`${e}\``).join(`, `);return J(`kind-mismatch`,r,`\`${e}.${t.path}\` accepts only ${a}; this source is the literal \`${i}\``)}function kL(e){if(e.kind!==`expression`||Kd(e).length>0)return`derived`;let t=ec(e.expr);return t.ok&&t.parsed.identifiers.has(`now`)?`clock`:`constant`}function AL(e,t,n,r){let i=`features[${t}]`,a=r(e.cap);if(a===null)return CL(J(`unknown-capability`,`${i}.cap`,`no capability is named \`${e.cap}\``));if(xL.has(a.name))return CL(J(`not-composable`,`${i}.cap`,`\`${a.name}\` is registered by every device itself — it cannot be composed`));let o=a.runtimeState;if(a.scope!==`device`||o===void 0)return CL(J(`not-composable`,`${i}.cap`,`\`${a.name}\` has no per-device state to compose`));let s=[];a.deviceTypes!==void 0&&!a.deviceTypes.includes(n.type)&&s.push(J(`wrong-device-type`,`${i}.cap`,`\`${a.name}\` is not offered on a \`${n.type}\` device (it allows ${a.deviceTypes.join(`, `)})`));let c=Object.entries(a.methods).filter(([,e])=>e.systemOnly!==!0).map(([e])=>`\`${e}\``);c.length>0&&s.push(J(`has-commands`,`${i}.cap`,`\`${a.name}\` has ${c.join(`, `)}, which a composed device cannot serve until commands arrive (slice 3)`)),e.commands!==void 0&&Object.keys(e.commands).length>0&&s.push(J(`reserved-variant`,`${i}.commands`,"commands (`forward`) arrive in slice 3"));let l=vL(o);for(let t of yL(o))l.has(t)?t in e.fields||s.push(J(`missing-field`,`${i}.fields.${t}`,`\`${a.name}.${t}\` is required and has no source`)):s.push(J(`not-composable`,`${i}.fields`,`\`${a.name}.${t}\` is not a scalar — nested fields arrive in a later slice`));let u=Object.entries(e.fields).map(([e,n])=>{let o=`${i}.fields.${e}`;if(e.includes(`.`))return CL(J(`nested-field`,o,`\`${e}\` is nested — nested fields arrive in a later slice`));let s=l.get(e);if(s===void 0)return CL(J(`unknown-field`,o,`\`${a.name}\` has no field \`${e}\``));let c=TL(n,r);if(!c.ok)return CL(J(c.code,o,c.message));let u={cap:a.name,path:e,featureIndex:t,kind:s.kind,nullable:s.nullable,required:s.required,unavailable:s.nullable?`null`:`offline`,role:kL(n),source:n,reads:[...Kd(n)]},d=OL(a.name,s,n,o);return{problems:[...EL(a.name,s,c.kinds,o),...d===null?[]:[d]],fields:[u]}});return{problems:[...s,...u.flatMap(e=>e.problems)],fields:u.flatMap(e=>e.fields)}}function jL(e,t){let n=e.target;if(n.kind===`existing`)return CL(J(`reserved-variant`,`target`,`an EXISTING device as the target arrives in slice 2 — this release composes new devices only`));let r=e.features.map((e,r)=>{let i=`features[${r}]`;return e.kind===`passthrough`?CL(J(`reserved-variant`,i,`whole-capability passthrough of \`${e.cap}\` arrives in slice 3`)):AL(e,r,n,t)});return{problems:r.flatMap(e=>e.problems),fields:r.flatMap(e=>e.fields)}}function ML(e){let t=e.features.flatMap(e=>e.kind===`fields`?Object.values(e.fields).flatMap(Kd).map(e=>e.source):[]);return[...new Map(t.map(e=>[B(e),e])).values()]}function NL(e,t){let n=t.self===null?null:B(t.self);return e.flatMap(r=>r.reads.flatMap(i=>{let a=`features[${r.featureIndex}].fields.${r.path}`,o=B(i.source);if(o===n)return e.some(e=>e.cap===i.cap&&e.path===i.fieldPath)?[]:[J(`source-field-unknown`,a,`this device has no composed field \`${i.cap}.${i.fieldPath}\``)];let s=t.sources.get(o);return s===void 0||s.kind===`unreadable`?[J(`source-unreadable`,a,`could not read source \`${o}\` (${s===void 0?`it was not read`:s.error}) — the save is refused rather than stored unchecked`)]:s.kind===`absent`?[J(`source-missing`,a,`source \`${o}\` does not exist`)]:s.caps.has(i.cap)?[]:[J(`source-capability-missing`,a,`source \`${o}\` (device ${s.deviceId}) has no \`${i.cap}\``)]}))}function PL(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 FL(e,t,n){for(let r of e){let e=PL(r,t);if(e===null)continue;let i=n.find(t=>t.cap===e.cap&&t.path===e.fieldPath);if(i!==void 0)return`features[${i.featureIndex}].fields.${i.path}`}return`features`}function IL(e,t,n){let r={target:t.self??SL,composition:e},i=B(r.target);try{return UI(r,t.peers).map(e=>J(`cycle`,FL(e.path,i,n),`a field reads itself: ${e.path.join(` → `)}`))}catch(e){if(e instanceof zI)return[J(`duplicate-target`,`features`,e.message)];throw e}}function LL(e,t){let n=jL(e,t.lookupCap),r=IL(e,t,n.fields),i=[...n.problems,...NL(n.fields,t),...r];return{ok:i.length===0,problems:i,fields:[...n.fields]}}var RL=[{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 zL(e){for(let t of RL){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 BL(e,t=[]){for(let n of RL){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 VL=`camstack/camstack-models`,HL=`https://huggingface.co/${VL}/resolve/main`,UL={"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.binaryPath":`ffmpeg`,"ffmpeg.hwAccel":`auto`,"ffmpeg.threadCount":0,"auth.tokenExpiry":`30d`},Y={Siren:R.Siren,Floodlight:R.Floodlight,Spotlight:R.Spotlight,PirSensor:R.PirSensor,Chime:R.Chime,Autotrack:R.Autotrack,Nightvision:R.Nightvision,PrivacyMask:R.PrivacyMask},WL={[Y.Siren]:`Siren`,[Y.Floodlight]:`Floodlight`,[Y.Spotlight]:`Spotlight`,[Y.PirSensor]:`PIR`,[Y.Chime]:`Chime`,[Y.Autotrack]:`Autotracking`,[Y.Nightvision]:`Night Vision`,[Y.PrivacyMask]:`Privacy Mask`};function GL(e,t,n){let r=`${e}:${t}`;return typeof n==`number`?`${r}:${n}`:r}var KL=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}))}},qL=class e{writer;pendingWrites=new Set;slices;schemas=new Map;listeners=new Set;capListeners=new Map;constructor(e,t){this.writer=t,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){return new e(t,n)}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(JL(i,o))return;this.slices.set(e,o),this.fireListeners([e]);let s=this.writer(e,{...o}).catch(()=>{});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 JL(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 YL={airQualitySensor:DD,alarmPanel:O_,ambientLightSensor:kD,audioMetrics:PD,automationControl:ID,battery:RD,binary:BD,brightness:HD,cameraStreams:cd,carbonMonoxide:eO,climateControl:rO,color:cO,connectivity:hO,consumables:vO,contact:bO,control:wO,cover:DO,dayNight:NO,deviceDiscovery:gp,deviceStatus:zO,doorbell:dE,enumSensor:HO,eventEmitter:GO,fanControl:ak,featureProbe:sk,flood:lk,gas:dk,humidifier:pk,humiditySensor:hk,image:_k,imageSettings:Ek,intercom:zk,lawnMowerControl:Uk,lockControl:aA,mediaPlayer:uA,motion:vA,motionTrigger:xA,motionZones:EA,nativeObjectDetection:PA,navigation:KA,networkLink:QA,notifier:Dj,numericSensor:kj,petFeeder:qj,powerMeter:_M,presence:bM,pressureSensor:SM,privacyMask:OM,ptzAutotrack:UM,recordingOnboard:nP,recordingSignal:SP,sceneMonitor:VP,scriptRunner:KP,smoke:JP,streamCatalog:ZP,streamParams:iF,streamSignals:Hw,switch:uF,tamper:UF,temperatureSensor:GF,update:YF,vacuumControl:fI,valve:hI,vibration:_I,waterHeater:yI,weather:xI,zoneAnalytics:AI,zoneRules:MI,zones:ES},XL=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=YL[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=KL.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??{};this.runtimeState=qL.fromInitial(o,a),e.bindRuntimeState?.(this.runtimeState),e.registerNativeCap?.(zO,{});let s={online:!0,lastChangedAt:Date.now()};this.runtimeState.setCapState(`device-status`,s),e.registerNativeCap?.(sk,{}),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=fp(this.ctx.deviceMeta.metadata)??cp({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=lp(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:{[dp]:t}})}catch{}this.ctx.eventBus.emit(Ye(`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}},ZL=[1e4,3e4,9e4];function QL(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 $L(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 eR=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??ZL,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 QL(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 $L(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 tR(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 nR=class extends rt{async onInitialize(){return this.ctx.logger.info(`${this.providerName} Provider initialized`),[{capability:em,provider:this}]}async onShutdown(){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(L).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){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=ZL;restoreRetryConcurrency=4;_restoreRetryScheduler=null;_restoreRetryCompletion=null;_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(){this._restoreRetryScheduler?.cancel(),this._restoreRetryScheduler=null}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){let n=new eR({logger:this.ctx.logger,delaysMs:this.restoreRetryDelaysMs,concurrency:this.restoreRetryConcurrency,attempt:t,onPermanentFailure:e=>this.recordPermanentRestoreFailure(e)});this._restoreRetryScheduler=n,this._restoreRetryCompletion=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)}})})}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(L).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(L).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 tR(e,this.addonId)}},rR=360*6e4;function iR(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 aR(e){return e===`unreachable`}var oR=[`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`],sR=[`contact-sensor`,`motion-sensor`,`occupancy-sensor`,`smoke-sensor`,`co-sensor`,`gas-sensor`,`leak-sensor`,`vibration-sensor`,`tamper-sensor`,`sound-sensor`];function cR(e){if(e===void 0)return sR.length;let t=sR.indexOf(e);return t===-1?sR.length:t}function lR(e){let t=oR.indexOf(e);return t===-1?oR.length:t}function uR(e,t){let n=e=>e.toLowerCase().replace(/[-_\s]+/g,` `).trim();return n(e)===n(t)}function dR(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&&uR(e.name,n)?0:1;return[...e].toSorted((e,t)=>cR(e.role)-cR(t.role)||r(e)-r(t)||lR(e.type)-lR(t.type))[0]??null}function fR(e,t,n,r,i){if(r.has(e))return;let a=t.get(e);if(!a)return;if(a.type!==L.Container){i.add(e);return}let o=new Set(r);o.add(e);let s=dR((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&&fR(s.id,t,n,o,i)}function pR(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=>fR(e,i,a,new Set,o);for(let e of r){if(e.type===L.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===L.Container){s(r.id);continue}o.add(e.id)}return o.delete(t),[...o]}var mR=`fixed`;function hR(e){let t=e??`hub`;return t.includes(`/`)?t.split(`/`)[0]??`hub`:t}var gR=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=hR(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:{[mR]:!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:{[mR]:!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}},_R={[L.Cover]:`cover`,[L.Valve]:`valve`,[L.Humidifier]:`humidifier`,[L.WaterHeater]:`water-heater`,[L.Camera]:`dummy`,[L.Hub]:`dummy`,[L.Switch]:`switch`,[L.Siren]:`switch`,[L.Light]:`light`,[L.Fan]:`fan`,[L.Sensor]:`sensor`,[L.Thermostat]:`thermostat`,[L.Climate]:`climate`,[L.Button]:`button`,[L.EventEmitter]:`dummy`,[L.Update]:`update`,[L.Generic]:`dummy`,[L.Notifier]:`dummy`,[L.Script]:`script`,[L.Automation]:`automation`,[L.Lock]:`lock`,[L.MediaPlayer]:`media-player`,[L.AlarmPanel]:`alarm`,[L.Control]:`control`,[L.Presence]:`sensor`,[L.Weather]:`weather`,[L.Vacuum]:`vacuum`,[L.LawnMower]:`lawn-mower`,[L.Container]:`dummy`,[L.Image]:`image`,[L.PetFeeder]:`pet-feeder`},vR=new Set(Object.values(L));function yR(e){return vR.has(e)?_R[e]:null}var bR=`motion-trigger`;function xR(e){return e.includes(bR)}var SR=[`temperature-sensor`,`humidity-sensor`,`ambient-light-sensor`,`numeric-sensor`,`enum-sensor`];function CR(e){let t=new Set(e.features);switch(e.type){case L.Cover:return{kind:`cover`};case L.Valve:return{kind:`valve`};case L.Lock:return{kind:`lock`};case L.AlarmPanel:return{kind:`alarm`};case L.Light:return t.has(`brightness`)?{kind:`brightness`}:{kind:`switch`};case L.Switch:case L.Siren:return{kind:`switch`};case L.Sensor:case L.Presence:{let e=SR.find(e=>t.has(e));return e?{kind:`sensor`,sensorFeature:e}:{kind:`none`}}default:return{kind:`none`}}}var wR={"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 TR(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function ER(e,t){if(!TR(e))return null;let n=e[t];if(!TR(n))return null;let r=n.mutate;return typeof r==`function`?r:null}function DR(e,t){return!e||e.length===0?!1:e.includes(t.when.hasFeature)}var OR={id:`battery`,label:`Battery-operated camera`,when:{hasFeature:Tl.BatteryOperated},defaults:{audioMode:`disabled`,detectionMode:`on-motion`},settings:{}},kR=[OR];function AR(e){for(let t of kR)if(DR(e,t))return t;return null}var jR=`device.state-changed`;function MR(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:jR},{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 NR(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:jR},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 PR(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 X(e,t,n){let r=FR(e)?e:MR(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 FR(e){return typeof e.read==`function`&&typeof e.watch==`function`}var IR=[`device`,`lighting`,`sensing`,`place`,`life`],LR=[{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`]}],RR=LR.map(e=>e.key),zR=LR.filter(e=>e.aliasOf===void 0).map(e=>e.key),BR=new Map(LR.map(e=>[e.key,e]));function VR(e){return typeof e==`string`&&BR.has(e)}function HR(e){return BR.get(e)}function UR(e){return LR.filter(t=>t.group===e)}function WR(e){return e.normalize(`NFD`).replace(/\p{Diacritic}/gu,``).toLowerCase().replace(/[_-]+/g,` `).trim()}function GR(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 KR(e,t){return t===e?100:t.startsWith(e)?80:t.split(` `).some(t=>t.startsWith(e))?60:t.includes(e)?40:GR(e,t)?15:0}function qR(e,t){let n=WR(e);if(n.length===0)return LR.filter(e=>e.aliasOf===void 0).map(e=>({entry:e,score:0}));let r=[];for(let e of LR){if(e.aliasOf!==void 0)continue;let i=[WR(e.key),...e.synonyms.map(WR),...(t?.get(e.key)??[]).map(WR)],a=0;for(let[e,t]of i.entries()){let r=KR(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 JR(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function YR(e,t){let n=t.split(`.`),r=e;for(let e of n){if(!JR(r))return;r=r[e]}return r}function XR(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=JR(o)?o:{};return{...e,[i]:XR(s,a,n)}}var ZR=3e4,QR=1e4;async function $R(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 ez(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 $R(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 tz=`lastFetchedAt`,nz=6e4,rz=10*6e4;function iz(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)?.[tz];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},te=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)}},h=()=>{let e=t.getCapState(n.name);if(!e)return o();let{[tz]:r,...i}=e;return i};return{ensureFresh:te,getStatus:async({deviceId:e})=>{if(e!==r)throw Error(`${n.name}: deviceId mismatch, expected ${r}, got ${e}`);return await te(),h()}}}function az(e,t,n){let r=e,i=n?.stateSource??MR(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:X(i,t.deviceId,`air-quality-sensor`),alarmPanel:X(i,t.deviceId,`alarm-panel`),ambientLightSensor:X(i,t.deviceId,`ambient-light-sensor`),audioMetrics:X(i,t.deviceId,`audio-metrics`),automationControl:X(i,t.deviceId,`automation-control`),battery:X(i,t.deviceId,`battery`),binary:X(i,t.deviceId,`binary`),brightness:X(i,t.deviceId,`brightness`),cameraStreams:X(i,t.deviceId,`camera-streams`),carbonMonoxide:X(i,t.deviceId,`carbon-monoxide`),climateControl:X(i,t.deviceId,`climate-control`),color:X(i,t.deviceId,`color`),connectivity:X(i,t.deviceId,`connectivity`),consumables:X(i,t.deviceId,`consumables`),contact:X(i,t.deviceId,`contact`),control:X(i,t.deviceId,`control`),cover:X(i,t.deviceId,`cover`),dayNight:X(i,t.deviceId,`day-night`),deviceDiscovery:X(i,t.deviceId,`device-discovery`),deviceStatus:X(i,t.deviceId,`device-status`),doorbell:X(i,t.deviceId,`doorbell`),enumSensor:X(i,t.deviceId,`enum-sensor`),eventEmitter:X(i,t.deviceId,`event-emitter`),fanControl:X(i,t.deviceId,`fan-control`),featureProbe:X(i,t.deviceId,`feature-probe`),flood:X(i,t.deviceId,`flood`),gas:X(i,t.deviceId,`gas`),humidifier:X(i,t.deviceId,`humidifier`),humiditySensor:X(i,t.deviceId,`humidity-sensor`),image:X(i,t.deviceId,`image`),imageSettings:X(i,t.deviceId,`image-settings`),intercom:X(i,t.deviceId,`intercom`),lawnMowerControl:X(i,t.deviceId,`lawn-mower-control`),lockControl:X(i,t.deviceId,`lock-control`),mediaPlayer:X(i,t.deviceId,`media-player`),motion:X(i,t.deviceId,`motion`),motionTrigger:X(i,t.deviceId,`motion-trigger`),motionZones:X(i,t.deviceId,`motion-zones`),nativeObjectDetection:X(i,t.deviceId,`native-object-detection`),navigation:X(i,t.deviceId,`navigation`),networkLink:X(i,t.deviceId,`network-link`),notifier:X(i,t.deviceId,`notifier`),numericSensor:X(i,t.deviceId,`numeric-sensor`),petFeeder:X(i,t.deviceId,`pet-feeder`),powerMeter:X(i,t.deviceId,`power-meter`),presence:X(i,t.deviceId,`presence`),pressureSensor:X(i,t.deviceId,`pressure-sensor`),privacyMask:X(i,t.deviceId,`privacy-mask`),ptzAutotrack:X(i,t.deviceId,`ptz-autotrack`),recordingOnboard:X(i,t.deviceId,`recording-onboard`),recordingSignal:X(i,t.deviceId,`recording-signal`),sceneMonitor:X(i,t.deviceId,`scene-monitor`),scriptRunner:X(i,t.deviceId,`script-runner`),smoke:X(i,t.deviceId,`smoke`),streamCatalog:X(i,t.deviceId,`stream-catalog`),streamParams:X(i,t.deviceId,`stream-params`),streamSignals:X(i,t.deviceId,`stream-signals`),switch:X(i,t.deviceId,`switch`),tamper:X(i,t.deviceId,`tamper`),temperatureSensor:X(i,t.deviceId,`temperature-sensor`),update:X(i,t.deviceId,`update`),vacuumControl:X(i,t.deviceId,`vacuum-control`),valve:X(i,t.deviceId,`valve`),vibration:X(i,t.deviceId,`vibration`),waterHeater:X(i,t.deviceId,`water-heater`),weather:X(i,t.deviceId,`weather`),zoneAnalytics:X(i,t.deviceId,`zone-analytics`),zoneRules:X(i,t.deviceId,`zone-rules`),zones:X(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),listSummaries:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listSummaries`,`query`,e),listRecentSummaries:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`listRecentSummaries`,`query`,e),getSummary:e=>s(`pipeline-analytics`,`pipelineAnalytics`,`getSummary`,`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),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),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)},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 oz=`device.state-changed`,sz=`capability.binding-changed`,cz=`device.registered`,lz=`device.unregistered`,uz=`device.updated`,dz=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=PR(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?az(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&&!fz(n,e.id)||e.stableId!==void 0&&(!i||!fz(i.stableId,e.stableId))||e.addonId!==void 0&&(!i||!fz(i.addonId,e.addonId))||e.type!==void 0&&(!i||!fz(i.type,e.type)))continue;if(e.caps!==void 0){let t=pz(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=pz(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||!mz(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||!pz(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:oz},{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:sz},{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:cz},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.refreshDeviceMetadata(t.deviceId,`added`)}})),this.bridges.push(e.subscribe({category:lz},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.applyDeviceRemoval(t.deviceId)}})),this.bridges.push(e.subscribe({category:uz},{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 fz(e,t){return Array.isArray(t)?t.includes(e):e===t}function pz(e){return Array.isArray(e)?e:[e]}function mz(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 hz(e){return e.def}function gz(e){return e}function _z(e,t=`Configuration`,n=`main`){return{sections:[{id:n,title:t,fields:e.map(e=>vz(e.key,e.schema,e.description))}]}}function vz(e,t,n){let r=Cz(t),i=wz(t),a={key:e,label:n??Tz(e),description:n,default:i};return r instanceof re?yz(e,a):r instanceof ne?bz(r,a):r instanceof oe?{...a,type:`boolean`}:r instanceof ue?Sz(r,a):r instanceof de||r instanceof ce?{...a,type:`textarea`,rows:6,isJson:!0}:{...a,type:`text`}}function yz(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 bz(e,t){let n=gz(e),r=n.minValue,i=n.maxValue,a=r!=null&&isFinite(r)?r:void 0,o=i!=null&&isFinite(i)?i:void 0,s=xz(e);return{...t,type:`number`,...a===void 0?{}:{min:a},...o===void 0?{}:{max:o},...s===void 0?{}:{step:s}}}function xz(e){let t=hz(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 Sz(e,t){let n=e.options.map(e=>String(e));return{...t,type:`select`,options:n.map(e=>({label:Tz(e),value:e}))}}function Cz(e){return e instanceof te||e instanceof me||e instanceof fe?Cz(hz(e).innerType):e}function wz(e){if(e instanceof te)return hz(e).defaultValue}function Tz(e){return e.replace(/([A-Z])/g,` $1`).replace(/[_-]/g,` `).replace(/^\w/,e=>e.toUpperCase()).trim()}var Ez=function(e){return e.Addon=`addon`,e.Core=`core`,e.Device=`device`,e.Provider=`provider`,e.System=`system`,e}({}),Dz=`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(`.`),Oz={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`,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`},kz=[{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:`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`}],Az=[qE,Qc,el,il,ll,gl,ml,TD,yl,DD,O_,wl,kD,Dl,Wl,Ql,PD,eu,ID,fu,RD,BD,HD,Nu,UD,KD,QD,Pu,cd,eO,rO,cO,kf,pO,hO,vO,bO,wO,Sf,DO,Ff,Gf,NO,Yf,Xf,$f,kp,gp,Rp,ME,Cm,LO,em,wm,zO,dE,Hm,HO,GO,nk,Gm,ak,sk,Jm,lk,dk,pk,hk,_k,Ek,Fk,zk,Uk,Mh,yh,Ih,nA,aA,Rh,Vh,qh,uA,mA,pg,hg,vg,vA,xg,xA,EA,Ng,PA,KA,Lg,QA,nj,bj,$g,my,Dj,kj,Ey,Fj,Uj,qj,zx,yS,UC,aC,$j,hM,_M,bM,SM,OM,RM,UM,WM,nN,SN,UN,nP,SP,VP,KP,lw,Uf,JP,mw,_w,yw,xw,ww,Tw,Dw,zw,rd,ZP,iF,Hw,uF,VF,UF,GF,Zw,qF,$w,YF,cI,tT,fI,hI,ET,_I,XT,FE,yI,xI,GE,AI,MI,ES],jz=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 Mz(e){return jz.has(e)}var Nz=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.getTypeDefs":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.list":{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`},"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.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.getAllSnapshots":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getSnapshot":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"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.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.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.getSummary":{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.listRecentSummaries":{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.listSummaries":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTrackMedia":{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.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.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.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`}}),Pz=`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.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(`.`),Fz=`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(`.`),Iz=`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.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(`.`),Lz=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.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.getCapSlice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.getSnapshot":[{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.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.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.listRecentSummaries":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.listRecentTracks":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.listRetrainStaging":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.listSummaries":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.listTrackMedia":[{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.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.resolvePipeline":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraPipelineForAgent":[{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}]}),Rz=`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.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.getCapSlice,deviceState.getSnapshot,deviceState.setCapSlice,faceGallery.getFaceByTrack,faceGallery.listRecentFaces,networkQuality.getDeviceStats,networkQuality.reportClientStats,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.resolvePipeline,pipelineOrchestrator.setCameraPipelineForAgent,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(`,`),zz=Object.freeze({broker:`broker`,"device-export":`device-export`,llm:`ai`,"mesh-network":`mesh`,"mqtt-broker":`broker`,"network-access":`ingress`,"smtp-provider":`email`}),Bz=[`broker`,`device-export`,`llm`,`mesh-network`,`mqtt-broker`,`network-access`,`smtp-provider`];function Vz(e){let t=[];for(let[n,r]of Object.entries(zz))r===e&&t.push(n);return t}var Hz={"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 Uz(e){return Hz[e]??Wz}var Wz={durability:`session`,volatileFields:[]};function Gz(e){return Uz(e).durability===`restored`}var Kz=`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(`.`),qz=[{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 Jz(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),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)},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)},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:{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),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 Yz=`2026-09-11T00:00:00.000Z`,Xz=Date.parse(Yz),Zz={PCMU:20*Math.log10(4),PCMA:20*Math.log10(8)};function Qz(e,t){return t+Zz[e]}function $z(e){return!Number.isFinite(e)||e<=0?`unknown`:e>=Xz?`itu`:`pre-itu`}var eB=`audio-`;function tB(e){return e.startsWith(eB)?e.slice(6):e}function nB(e){return e.startsWith(eB)?e:`${eB}${e}`}var rB=-96,iB=Math.round(Qz(`PCMU`,-55)),aB={hitPercent:60,samplingSeconds:10};function oB(e){return e??aB}function sB(e){return e===void 0?null:e.labels!==void 0&&e.labels.length>0?`label`:e.dbThreshold===void 0?null:`level`}function cB(e){return e===void 0?!1:e.dbThreshold===void 0&&(e.labels===void 0||e.labels.length===0)}function lB(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,Math.round(e))):t}function uB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function dB(e,t){let n=oB(e),r=uB(t,`labels`)?t.labels:n.labels,i=uB(t,`dbThreshold`)?t.dbThreshold:n.dbThreshold,a=r!==void 0&&r.length>0,o=t.mode??(uB(t,`labels`)&&a?`label`:uB(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`?iB:void 0):void 0;return{...s===void 0?{}:{labels:[...s]},...c===void 0?{}:{dbThreshold:lB(c,rB,0)},hitPercent:lB(t.hitPercent??n.hitPercent,1,100),samplingSeconds:lB(t.samplingSeconds??n.samplingSeconds,1,300),...(()=>{let e=uB(t,`confirmHits`)?t.confirmHits:n.confirmHits,r=uB(t,`confirmWindowSec`)?t.confirmWindowSec:n.confirmWindowSec;return{...e===void 0?{}:{confirmHits:lB(e,1,20)},...r===void 0?{}:{confirmWindowSec:lB(r,1,60)}}})()}}function fB(e,t){let n=e?.audioKinds??[],r=n.length>0?n.map(e=>{let t=tB(e.kind);return{value:t,label:e.label,iconId:nB(t),unknown:!1}}):a_.map(e=>({value:e.id,label:e.name,iconId:nB(e.id),unknown:!1})),i=new Set(r.map(e=>e.value)),a=[];for(let e of t??[]){let t=tB(e);i.has(t)||a.includes(t)||(a.push(t),r.push({value:t,label:t,iconId:nB(t),unknown:!0}))}return{choices:r,unknownLabels:a}}function pB(e,t){let n=tB(t);return(e??[]).some(e=>tB(e)===n)}function mB(e,t){let n=tB(t),r=e??[];if(pB(r,n)){let e=r.filter(e=>tB(e)!==n);return e.length>0?e:void 0}return[...r,n]}var hB=new Set([`classes`,`classesExclude`]),gB=new Set([`sensorKinds`]),_B=new Set([`occupancy`]);function vB(e){return{value:e.kind,label:e.label}}function yB(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(vB(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 bB(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,[vB(r)]),t.push(e)):i.push(vB(r))}return t.flatMap(e=>{let t=n.get(e);return t===void 0?[]:[{key:e,fallbackLabel:e,options:t}]})}function xB(e,t){if(!t)return null;if(hB.has(e)){let e=yB(t.videoClasses);return t.audioKinds.length>0&&e.push({key:`audio`,fallbackLabel:`Audio`,options:t.audioKinds.map(vB)}),e.length>0?{groups:e}:null}if(_B.has(e)){let e=t.videoClasses.filter(e=>e.parentKind===null).map(vB);return e.length>0?{groups:[{key:`macro`,fallbackLabel:`Classes`,options:e}]}:null}if(gB.has(e)){let e=bB(t.labels);return e.length>0?{groups:e}:null}return null}function SB(e){let t=new Set;for(let n of e.groups)for(let e of n.options)t.add(e.value);return t}var CB=[`devices`,`classes`],wB=new Set(CB);function TB(e){return wB.has(e)}function EB(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 DB=[[/ /g,` `],[/&/g,`&`],[/</g,`<`],[/>/g,`>`],[/"/g,`"`],[/'/g,`'`]];function OB(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 DB)t=t.replace(e,n);return t.replace(/\n{3,}/g,`
|
|
348
|
+
|
|
349
|
+
`).trim()}var kB=[[/&/g,`&`],[/</g,`<`],[/>/g,`>`],[/"/g,`"`],[/'/g,`'`]];function AB(e){let t=e;for(let[e,n]of kB)t=t.replace(e,n);return t}function jB(e){return AB(e).replace(/\n/g,`<br>`)}function MB(e){return AB(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 NB={text:[`text`,`markdown`,`html`],markdown:[`markdown`,`html`,`text`],html:[`html`,`text`,`markdown`]};function PB(e,t){for(let n of NB[e]??NB.text)if(t.includes(n))return n;return t[0]??`text`}function FB(e,t,n){if(t===n)return e;if(n===`text`){if(t===`markdown`)return EB(e);if(t===`html`)return OB(e)}if(n===`html`){if(t===`text`)return jB(e);if(t===`markdown`)return MB(e)}if(n===`markdown`){if(t===`text`)return e;if(t===`html`)return OB(e)}return e}function IB(e){return{id:e.id,ordinal:e.ordinal,...e.flags?{flags:e.flags}:{},...e.requires?{requires:e.requires}:{}}}function LB(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 IB(n)}let n=e.filter(e=>e.ordinal!==null);if(n.length===0)return IB(e[0]);let r=t.priority;return IB([...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 RB(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 zB(e,t){let n=[],r=t.format,i=PB(r,e.format);i!==r&&n.push(`format`);let a=FB(t.body,r,i),o=LB(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 te=t.tag??null,h=RB(a,e.bodyMaxLen),ne=h.length>1,re={level:o?.id??``,format:i,attachmentsSent:c.length,actionsSent:f.length,truncated:ne,dropped:n};return{body:h[0]??``,...t.title===void 0?{}:{title:t.title},format:i,level:o,attachments:c,actions:f,clickUrl:p,sound:m,ttl:ee,tag:te,bodyParts:h,renderedAs:re}}var BB=[`deviceIds`,`deviceTypes`,`nodeIds`,`packageNames`,`consumableLowPercent`];function VB(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 W_.includes(e)}}function HB(e,t){return e.some(e=>VB(e,t))}var UB=[`device-events`,`system`,`alarm`];function WB(e){return UB.some(t=>t===e)}var GB={"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},KB=new Map(Object.entries(GB)),qB=[...BB,`excludeDeviceIds`],JB={"device-events":[`deviceIds`,`excludeDeviceIds`,`deviceTypes`,`consumableLowPercent`],system:[`nodeIds`,`packageNames`],alarm:[`deviceIds`]},YB=[{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:H_}];function XB(e){return YB.filter(t=>t.family===e).flatMap(e=>e.kinds)}function ZB(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 QB(e){let t=new Set;for(let n of e){let e=KB.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 $B(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=GB[r];e===null?t.push({code:`legacy-kind`,kind:r}):n.add(e)}let r=UB.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=JB[i];for(let n of qB)e[n]!==void 0&&!a.includes(n)&&t.push({code:`filter-outside-family`,filter:n,family:i});return t}function eV(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 tV=[`device-events`,`system`,`alarm`,`mixed`];function nV(e){return tV.some(t=>t===e)}function rV(e){return WB(e)?e:void 0}var iV=`An occupancy edge is not a sensor event: it carries no sensor kind, so this condition can never match one.`,aV=`An occupancy edge carries no device event-type token — that comes from an event-emitter slice, which a count crossing has none of.`,oV=`An occupancy edge is a count crossing, not a sensor reading: it has no raise or clear, so this choice could never narrow it.`,sV=`An occupancy edge is always produced by the pipeline, so any other source can never match and “pipeline” narrows nothing.`,cV=`A confirmed sound window is always stamped as an audio subject, so any other source can never match.`,lV=`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.`,uV=`A sound window’s evidence is a percentage of samples, not a detector score, so a confidence threshold can never be satisfied.`,dV=`A sound has no position in the frame, so a zone or a drawn polygon can never match it.`,fV=[{kind:`detection`,label:`Conditions`,excluded:{},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:iV,eventTypeTokens:aV,sensorTransition:oV,source:sV},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:lV,classesExclude:lV,minConfidence:uV,zones:dV,zonesExclude:dV,customZones:dV,crossing:dV,labelEquals:lV,identities:lV,identitiesExclude:lV,plates:lV,source:cV},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 pV(e){return fV.find(t=>t.kind===e)??fV[0]}function mV(e){return fV.filter(t=>t.discriminator===e).map(e=>e.kind)}var hV=`system-event`;function gV(e){return e===hV}function _V(e){return gV(e.delivery)?vV(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 vV(e){let t=QB(ZB(e)??[]);return t.kind===`family`?t.family:`mixed`}function yV(e,t,n){let r=pV(n);return e.id===r.discriminator?!0:e.appliesTo.includes(t)?r.excluded[e.id]===void 0:!1}function bV(e,t){let n=pV(t);return e===n.discriminator?null:n.excluded[e]??null}function xV(e,t){let n=pV(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 SV=[{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 & devices`,blurb:`Rules driven by what the cameras and sensors SEE — detections, tracks, doorbell presses and package events.`,newRuleLabel:`New detection rule`,emptyHint:`No detection rules yet. Create one to be told what your cameras see.`,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 CV(e){return SV.find(t=>t.key===e)??SV[0]}function wV(e){return SV.find(t=>t.key===e)?.key}function TV(e){return e.conditions.audio!==void 0}function EV(e){return e.conditions.occupancy!==void 0}function DV(e,t){return t===`all`?!0:gV(e.delivery)?_V(e)===t:t===`audio`?TV(e):t===`occupancy`?EV(e):t===`detection`?!TV(e)&&!EV(e):!1}function OV(e){return gV(e.delivery)?vV(e.conditions.systemEvent):TV(e)?`audio`:EV(e)?`occupancy`:`detection`}var kV={op:`became-occupied`,count:1,sustainSeconds:15},AV={hitPercent:aB.hitPercent,samplingSeconds:aB.samplingSeconds,dbThreshold:iB};function jV(e){switch(e){case`device-events`:return{delivery:hV,conditions:{systemEvent:{kinds:[`device-offline`,`device-online`]}}};case`system`:return{delivery:hV,conditions:{systemEvent:{kinds:[`node-offline`,`node-online`]}}};case`alarm`:return{delivery:hV,conditions:{systemEvent:{kinds:[`alarm-triggered`]}}};case`audio`:return{delivery:`immediate`,conditions:{audio:AV}};case`occupancy`:return{delivery:`device-event`,conditions:{occupancy:kV}};default:return{delivery:`immediate`,conditions:{}}}}function MV(e){return jV(e).delivery}var NV=[`rule`,`devices`,`conditions`,`notification`,`actions`,`advanced`],PV={rule:`Rule`,devices:`Cameras`,conditions:`Conditions`,notification:`Notification`,actions:`Actions`,advanced:`Advanced`};function FV(e){let t=pV(e),n=[];for(let r of NV)r===`devices`&&nV(e)||n.push({key:r,label:r===`conditions`?t.label:PV[r]});return n}var IV={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6},LV=new Map;function RV(e){let t=LV.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 LV.set(e,n),n}function zV(e,t){let n=new Date(e),r=t===void 0?null:RV(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:IV[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 BV(e,t){if(e===void 0)return!0;let{day:n,minute:r}=zV(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 VV=`armed_`,HV=`alarm-panel`,UV=`trigger`,WV=[`contact`,`cover`,`lock`];function GV(e){return(e.conditions.deviceState?.states??[]).some(e=>e.trim().toLowerCase().startsWith(VV))?!0:(e.onTrigger??[]).some(e=>e.enabled&&e.actions.some(e=>e.kind===`cap`&&e.cap===HV&&e.method===UV))}function KV(e){let t=e.trim().toLowerCase();return WV.some(e=>e===t)}function qV(e){let t=e.conditions.sensorKinds??[];return e.conditions.sensorTransition!==`cleared`||t.length===0||!t.every(KV)?!1:GV(e)}var JV=`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.`,YV=Object.freeze(Object.fromEntries(Object.entries(JC).flatMap(([e,t])=>{let n=QT[e];return n===void 0||t.category!==`sensor`?[]:[[t.kind,n]]}))),XV=Object.freeze(Object.keys(YV));function ZV(e){return e.trim().toLowerCase()}function QV(e,t){if(t===null)return;let n=YV[ZV(e)];if(n===void 0)return;let r=Object.entries(t).find(([e])=>e===n)?.[1];return typeof r==`boolean`?r:void 0}function $V(e){return e===void 0||e.length===0?!1:e.every(e=>XV.includes(ZV(e)))}var eH=`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.`,tH=[`body`],Z=[`title`,`body`],nH=[`device-battery-low`,`device-battery-normal`],rH=[`device-consumable-low`,`device-consumable-normal`],iH=[`device-tank-low`,`device-tank-full`,`device-tank-normal`],aH=[`addon-update-available`,`server-update-available`,`wrapper-update-available`],oH=[`addon-update-available`,`server-update-available`],sH=[`alarm-triggered`,`alarm-armed`,`alarm-disarmed`,`alarm-arming`,`alarm-arm-refused`,`alarm-pending`,`alarm-rearmed`,`alarm-sensor-bypass`,`alarm-check-failed`],cH=[`alarm-triggered`],lH=[`device-online`,`device-offline`,`device-disabled`,`device-enabled`,...nH,...rH,...iH,`stream-online`,`stream-offline`,`detection-blind`,...sH],uH=[...XB(`device-events`),...XB(`system`)],dH=[{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:nH},{name:`summaryConsumables`,label:`Summary: consumables`,example:`Robot — filter 10 %`,kinds:rH},{name:`summaryTanks`,label:`Summary: tanks`,example:`Robot — clean water low`,kinds:iH},{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`]}],fH=[{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:[...uH],systemEventDeliveries:[`summary`]},{name:`summaryCount`,label:`Summary: items reported`,example:`3`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...uH],systemEventDeliveries:[`summary`]},...dH.map(e=>({name:e.name,label:e.label,example:e.example,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...e.kinds],systemEventDeliveries:[`summary`]}))],pH=[{name:`camera`,label:`Camera`,example:`Ingresso`,group:`subject`,families:[`rule`,`timelapse`],systemEventKinds:[...lH,`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:[...cH]},{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:[...cH]},{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:[...cH]},{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`,...oH,`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:[...cH]},{name:`zone`,label:`Zone`,example:`Cancello`,group:`place`,families:[`rule`],fields:[...Z],kinds:[`detection`,`occupancy`,`system`],systemEventKinds:[...cH]},{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:[...cH]},{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:[...tH],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:[...lH]},{name:`deviceId`,label:`Device id`,example:`617`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...lH,`export-completed`]},{name:`percentage`,label:`Percentage`,example:`15`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...nH,...rH]},{name:`item`,label:`Consumable`,example:`Filtro`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...rH]},{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:[...iH]},{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`,...aH,`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`,...aH,`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:[...aH,`addon-updated`,`server-updated`]},{name:`packageName`,label:`Package`,example:`@camstack/addon-recorder`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...oH,`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:[...oH]},{name:`currentVersion`,label:`Current version`,example:`1.2.377`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...aH]},{name:`latestVersion`,label:`Latest version`,example:`1.2.378`,group:`system`,families:[`rule`],fields:[...Z],kinds:[`system`],systemEventKinds:[...aH]},{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:[...oH,`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]},...fH],mH=[`device-tank-low`,`device-tank-full`,`device-tank-normal`];function hH(){return pH.filter(e=>!gH(e)).map(e=>e.systemEventKinds===void 0?e:{...e,systemEventKinds:e.systemEventKinds.filter(e=>!mH.includes(e))})}function gH(e){return e.systemEventDeliveries!==void 0&&!e.systemEventDeliveries.includes(`instant`)}function _H(e,t){if(!nV(t.kind))return!0;let n=t.systemEventDelivery??`instant`;return(e.systemEventDeliveries??(e.systemEventKinds===void 0?[n]:[`instant`])).includes(n)}var vH={previewText:[`camera`,`rule`,`from`,`to`],captionText:[`rule`,`from`,`to`]};function yH(e,t){return e===void 0||t===void 0||e.includes(t)}function bH(e,t){return e===void 0||t===void 0||e.some(e=>e===t)?!0:nV(t)&&e.includes(`system`)}function xH(e,t){if(!nV(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:rV(t.kind);if(i===void 0)return!0;let a=XB(i);return n.some(e=>a.includes(e))}function SH(e){if(e.field===`previewText`||e.field===`captionText`){let t=vH[e.field];return pH.filter(n=>n.families.includes(e.family)&&t.includes(n.name)&&n.dynamic===void 0)}return pH.filter(t=>t.families.includes(e.family)&&yH(t.fields,e.field)&&bH(t.kinds,e.kind)&&yH(t.deliveries,e.delivery)&&xH(t,e)&&_H(t,e))}function CH(e,t){return SH(t).some(t=>t.dynamic===void 0?t.name===e:e.startsWith(t.dynamic.prefix)&&e.length>t.dynamic.prefix.length)}var wH=[`device-events`,`system`];function TH(e){if(!gV(e.delivery))return null;let t=e.systemEventDelivery;return t?.mode===`summary`?t.schedule:null}function EH(e){return TH(e)!==null}function DH(e){return(e?.onTrigger?.length??0)>0||(e?.buttons?.length??0)>0}function OH(e){if(e.systemEventDelivery?.mode!==`summary`)return[];if(!gV(e.delivery))return[{code:`not-a-system-rule`,delivery:e.delivery}];let t=[],n=QB(e.conditions.systemEvent?.kinds??[]),r=n.kind===`family`?n.family:`mixed`;(r===`mixed`||!wH.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`}),DH(e.actions)&&t.push({code:`actions-beside-summary`}),t}function kH(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 AH=1440;function jH(e,t){return{windows:e.map(e=>{let t=(e.minute+AH-1)%AH;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 MH(e){if(e.invert===!0)return null;let t=[];for(let n of e.windows){if((n.endMinute-n.startMinute+AH)%AH!==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 NH=/\{\{\s*summary(?:Text|Devices|Streams|Battery|Consumables|Tanks|Detection|Nodes|Addons|Updates)\s*\}\}/;function PH(e){return e===void 0||e.trim().length===0?!0:NH.test(e)}function FH(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 IH=`@camstack/server`,LH=[IH,`@camstack/system`,`camstack-wrapper`],RH={"@camstack/server":`server`,"@camstack/system":`framework`,"camstack-wrapper":`wrapper`};function zH(e){return LH.some(t=>t===e)}function BH(e){let t=new Map(e.map(e=>[e.name,e.version])),n=LH.map(e=>{let n=t.get(e);return{id:e,name:e,type:RH[e],location:null,...n===void 0?{}:{detail:n}}}),r=e.filter(e=>!zH(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 VH=d({title:l().max(500).optional(),body:l().max(2e3).optional()}),HH=l().min(1).max(200),UH=b(a()).min(1),WH=a().int().min(2).max(3600),GH=a().int().min(1).max(60),KH=b(pv).min(1),qH=a().int().min(1).max(5),JH=.1,YH=a().min(JH).max(3600),XH=a().min(0).max(60),ZH=l().max(200),QH=y([`image`,`gif`]),$H=b(l().min(1).max(40)).max(20),eU=d({name:HH,enabled:x().default(!0),deviceIds:UH,schedule:Z_,cadenceSec:WH.default(15),framerate:GH.default(10),denseCadenceSec:YH.optional(),minDwellSec:XH.optional(),targets:KH,template:VH.optional(),previewText:ZH.optional(),previewMode:QH.default(`image`),reportClasses:$H.optional(),priority:qH.default(3)}),tU=`Timelapse {{camera}}`,nU=d({name:HH.optional(),enabled:x().optional(),deviceIds:UH.optional(),schedule:Z_.optional(),cadenceSec:WH.optional(),framerate:GH.optional(),denseCadenceSec:YH.optional(),minDwellSec:XH.optional(),targets:KH.optional(),template:VH.nullable().optional(),previewText:ZH.optional(),previewMode:QH.optional(),reportClasses:$H.optional(),priority:qH.optional()}),rU=eU.extend({id:l(),ownerUserId:l().optional(),lastGeneratedAt:a().optional(),generatedByDevice:_(l(),a()).optional(),createdBy:l(),createdAt:a(),updatedAt:a()});function iU(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 aU(e,t){let n=e.generatedByDevice;return n===void 0?e.lastGeneratedAt??0:n[String(t)]??0}function oU(e,t){return!!e.formats[t]}function sU(e,t,n){if(t!=null){let r=e.find(e=>e.id===t);if(r!==void 0&&oU(r,n))return!0}return e.some(e=>e.legacy!==!0&&oU(e,n))}var cU=`detail-crop`,lU=`detailCropPaddingRatio`,uU=`detailCropSquare`,dU=d({paddingRatio:a().min(0).max(4),square:x()}),fU={paddingRatio:.15,square:!1};function pU(e){let t=dU.shape.paddingRatio.safeParse(e[lU]),n=dU.shape.square.safeParse(e[uU]);return{paddingRatio:t.success?t.data:fU.paddingRatio,square:n.success?n.data:fU.square}}function mU(e){return typeof e==`object`&&!!e&&`key`in e}function hU(e){if(e===null)return fU;let t={};for(let n of e.sections)for(let e of n.fields)!mU(e)||typeof e.key!=`string`||(e.key===`detailCropPaddingRatio`||e.key===`detailCropSquare`)&&(t[e.key]=e.value);return pU(t)}var gU=Object.freeze({x:0,y:0,w:1,h:1}),_U={min:0,max:1,step:.05,default:fU.paddingRatio};function vU(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?xU(yU(o,t,n),t,n):bU(o,t,n)}function yU(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 bU(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 xU(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 SU=`native-lease`,CU=`nativeLeaseHoldFrames`,wU=`nativeLeaseBudgetMb`,TU=`nativeLeaseActivityMs`,EU=`nativeLeaseAdmission`,DU=`nativeTileBudgetMb`,OU=`nativeSceneBudgetMb`,kU=y([`all`,`inferred`]),AU=d({holdFrames:a().int().min(1).max(64),budgetMb:a().int().min(0).max(4096),activityMs:a().int().min(0).max(12e4),admission:kU,tileBudgetMb:a().int().min(0).max(1024),sceneBudgetMb:a().int().min(0).max(1024)}),Q={holdFrames:8,budgetMb:1024,activityMs:15e3,tileBudgetMb:64,sceneBudgetMb:48,admission:`inferred`},jU={min:1,max:64,step:1,default:Q.holdFrames},MU={min:0,max:4096,step:64,default:Q.budgetMb},NU={min:0,max:12e4,step:1e3,default:Q.activityMs},PU={min:0,max:1024,step:16,default:Q.tileBudgetMb},FU={min:0,max:1024,step:16,default:Q.sceneBudgetMb},IU={options:[{value:`all`,label:`Every delivered frame`},{value:`inferred`,label:`Only frames sent to inference`}],default:Q.admission};function LU(e,t){let n=AU.shape[e].safeParse(t);return n.success?n.data===Q[e]?null:n.data:null}function RU(e){let t=kU.safeParse(e);return t.success?t.data===Q.admission?null:t.data:null}function zU(e){let t=LU(`holdFrames`,e[CU]),n=LU(`budgetMb`,e[wU]),r=LU(`activityMs`,e[TU]),i=RU(e[EU]),a=LU(`tileBudgetMb`,e[DU]),o=LU(`sceneBudgetMb`,e[OU]);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 BU(e){return typeof e==`object`&&!!e&&`key`in e}var VU=[CU,wU,TU,EU,DU,OU];function HU(e){if(e===null)return{};let t={};for(let n of e.sections)for(let e of n.fields)!BU(e)||typeof e.key!=`string`||VU.includes(e.key)&&(t[e.key]=e.value);return zU(t)}var UU=[{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 WU(e){let t=UU.find(t=>t.id===e);if(!t)throw Error(`Unknown access role '${e}'`);return t}function GU(e){let t=WU(e.roleId);return[{type:`device`,selector:e.selector,access:[...t.deviceAccess],includeLinked:e.includeLinked},{type:`category`,target:`system`,access:[...t.systemAccess]}]}function KU(e,t){if(e.length!==t.length)return!1;let n=new Set(e);return t.every(e=>n.has(e))}function qU(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=UU.find(e=>KU(e.deviceAccess,r.access)&&KU(e.systemAccess,i.access));return a?{roleId:a.id,selector:r.selector,includeLinked:r.includeLinked}:null}var JU=8;function YU(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 XU(e,t){return e.some(e=>e.type===`category`&&e.target===`device`&&e.access.includes(t))}function ZU(e,t){return e.filter(e=>e.type===`device`&&e.access.includes(t))}function QU(e,t){return e.includeLinked??t===`view`}function $U(e,t){let n=[],r=e;for(let e=0;e<JU;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 eW(e,t,n){if(XU(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=ZU(e,n),a=new Set;for(let e of t)for(let t of i){if(YU(t.selector,e)){a.add(e.id);break}if(QU(t,n)&&$U(e.id,r).some(e=>{let n=r.get(e);return n!==void 0&&YU(t.selector,n)})){a.add(e.id);break}}return a}function tW(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=G.safeParse(n);e.success&&t.push(e.data)}return t}var nW=[`view`,`create`,`delete`];function rW(e,t,n,r){return r?{all:!0,deviceCount:t.length}:{all:XU(e,n)||ZU(e,n).some(e=>e.selector.kind===`all`),deviceCount:eW(e,t,n).size}}function iW(e){let t=[];for(let n of e)n.type===`capability`&&t.push({name:n.target,access:n.access});return t}function aW(e){let t=[];for(let n of e)n.type===`addon`&&t.push({name:n.target,access:n.access});return t}function oW(e,t,n){let r={view:rW(e,t,`view`,n),create:rW(e,t,`create`,n),delete:rW(e,t,`delete`,n)},i=n?nW:nW.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:iW(e),addons:aW(e)}}var sW={camera:{type:`camera`,label:`Camera`,icon:`camera`}},cW={"°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}},lW=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 uW(e){return Object.hasOwn(cW,e)?cW[e]:void 0}function dW(e){return uW(e)?.dimension}function fW(e,t){return e*t.factor+t.offset}function pW(e,t){return(e-t.offset)/t.factor}function mW(e,t,n){if(t===n)return e;let r=uW(t);if(!r)throw new lW(t,n,`unknown-from`);let i=uW(n);if(!i)throw new lW(t,n,`unknown-to`);if(r.dimension!==i.dimension)throw new lW(t,n,`cross-dimension`);return pW(fW(e,r),i)}function hW(e,t,n){if(t===n)return e;let r=uW(t);if(!r)return;let i=uW(n);if(i&&r.dimension===i.dimension)return pW(fW(e,r),i)}function gW(e,t){if(e===t)return!0;let n=dW(e);return n===void 0?!1:n===dW(t)}function _W(e){let t=[];for(let[n,r]of Object.entries(cW))r.dimension===e&&t.push(n);return t}var vW=[15e3,6e4,5*6e4,15*6e4,30*6e4,60*6e4,90*6e4];function yW(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 bW(e,t){let n=e.trim().toLowerCase(),r=t.trim().toLowerCase();return n===r?1:n.length===0||r.length===0?0:1-yW(n,r)/Math.max(n.length,r.length)}function xW(e,t,n=.8){let r=null,i=0;for(let a of t){let t=bW(e,a);t>=n&&t>i&&(r=a,i=t)}return r}var SW=`addon:`;function CW(e){return e.startsWith(SW)?e.slice(6):e}function wW(e,t){return CW(e)===CW(t)}function TW(e){return{runId:e.runId,state:e.state,startedAtMs:e.startedAtMs,finishedAtMs:e.finishedAtMs,progress:e.progress,result:e.result,error:e.error}}var EW=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?.(TW(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)})),TW(r)}status(e){let t=this.runs.get(e);return t===void 0?null:TW(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(TW)}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 DW(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 OW=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(),kW(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 kW(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 AW(e){return e instanceof Error?e.message:typeof e==`string`?e:String(e)}function jW(e,t){return`https://huggingface.co/${e}/resolve/main/${t}`}function MW(e){return JSON.parse(e)}function NW(e){return typeof e!=`object`||!e||Array.isArray(e)?null:{...e}}function PW(e){return Array.isArray(e)?e:[]}function FW(e,t=``){return typeof e==`string`?e:t}function IW(e,t=0){return typeof e==`number`?e:t}function LW(e,t=!1){return typeof e==`boolean`?e:t}function RW(e){try{return NW(MW(e))}catch{return null}}function zW(e){try{let t=MW(e);return Array.isArray(t)?t:null}catch{return null}}var BW=[/^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 VW(e){return BW.some(t=>t.test(e))}function HW(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()))VW(e)&&(t.searchParams.set(e,`***`),n=!0);return n?t.toString():e}catch{return e}}var $=1024*1024,UW={sampleIntervalMs:6e4,baselineSettleSamples:5,baselineSampleCount:3,restartMultiple:4,floorBytes:1024*$,ceilingBytes:3072*$,cooldownMs:30*6e4,maxRestartsPerWindow:6,restartWindowMs:1440*6e4};function WW(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=UW;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 GW(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 KW(){return{settleSeen:0,baselineWindow:[],baselineBytes:null,restartsAt:[],lastRestartAt:null}}function qW(e){let t=[...e].sort((e,t)=>e-t);return t[Math.floor(t.length/2)]}function JW(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:qW(r)}}function YW(e,t){return e===null?t.ceilingBytes:Math.min(t.ceilingBytes,Math.max(t.floorBytes,t.restartMultiple*e))}function XW(e,t,n){return e.filter(e=>t-e<n.restartWindowMs)}function ZW(e,t,n,r){let i=JW(e,t,r),a=YW(i.baselineBytes,r);if(t<=a)return{state:i,action:i.baselineBytes===null?`baseline-pending`:`ok`,baselineBytes:i.baselineBytes,thresholdBytes:a};let o=XW(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 QW(e,t){return{...KW(),restartsAt:[...e.restartsAt,t],lastRestartAt:t}}function $W(e){return{...KW(),restartsAt:e.restartsAt,lastRestartAt:e.lastRestartAt}}function eG(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 tG=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??KW();t&&t.pids.length>0&&!nG(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=$W(a));let o=ZW(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=eG(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:QW(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 nG(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 rG(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 iG(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 aG=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 oG(e,t){let n=performance.now();try{return{output:t===void 0?await e():await cG(e(),t),durationMs:sG(performance.now()-n),ok:!0}}catch(e){return{output:void 0,durationMs:sG(performance.now()-n),ok:!1,error:AW(e)}}}function sG(e){return Math.round(e*100)/100}function cG(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 lG={openvino:`openvino`,edgetpu:`tflite`,coreml:`coreml`,onnx:`onnx`,cpu:`onnx`,cuda:`onnx`};function uG(e){return lG[e]??`onnx`}var dG={onnx:`onnx`,coreml:`coreml`,openvino:`openvino`,tflite:`tflite`,pytorch:`pt`},fG={coreml:`coreml_inference.py`,pytorch:`pytorch_inference.py`,openvino:`openvino_inference.py`};function pG(e){return dG[e]}function mG(e){return fG[e]}function hG(e){return e===`coreml`||e===`pytorch`||e===`openvino`}function gG(e){return new Promise(t=>setTimeout(t,Math.max(0,e)))}function _G(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})})}function vG(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 yG(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 bG(e){return Math.floor(Buffer.from(e,`base64`).byteLength/4)}function xG(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=>SG(t,e,n,l)),f=s.some(t=>SG(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 SG(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&&CG(t,e.polygon))return!0}return!1}function CG(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 wG(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 TG={value:`auto`,label:`Auto`},EG={value:`cpu`,label:`CPU`},DG={value:`usb`,label:`Coral USB`},OG=[{id:`onnx`,supports:()=>!0,devices:e=>{if(!e)return[EG];let t=[EG];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[TG];let t=[TG,EG];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`},EG),n},defaultDevice:`all`},{id:`edgetpu`,supports:e=>e?.coral!=null,devices:()=>[DG],defaultDevice:`usb`}];function kG(e){let t=OG.find(t=>t.id===e);if(!t)throw Error(`Unknown runtime: ${e}`);return t}function AG(e){return OG.filter(t=>t.supports(e)).map(e=>e.id)}function jG(e,t){return kG(e).devices(t)}function MG(e){return kG(e).defaultDevice}function NG(e){return e===`edgetpu`?`tflite`:pG(e)}function PG(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 FG={cuda:`gpu`,edgetpu:`usb`,coreml:`all`,cpu:`cpu`};function IG(e,t,n,r){return{key:e===`cpu`?`cpu`:`${e}:${t}`,backend:e,device:t,format:n,runtime:`python`,score:r,available:!0}}function LG(e){let{scores:t}=PG(e),n=[];for(let r of t){if(r.backend===`openvino`){e.npu?.type===`intel-npu`&&n.push(IG(`openvino`,`npu`,r.format,r.score+2)),e.gpu?.type===`intel`&&n.push(IG(`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(IG(`edgetpu`,t,r.format,r.score))}continue}let t=FG[r.backend]??r.backend;n.push(IG(r.backend,t,r.format,r.score))}return n}var RG=t({ACCESSORY_LABEL:()=>WL,ACCESS_ROLES:()=>UU,ALEXA_EGRESS_PROFILE:()=>qt,ALL_CAPABILITY_DEFINITIONS:()=>Az,APPLE_SA_TO_MACRO:()=>s_,ARCHIVED_DEBUG_NOTES_DEFAULT_LIMIT:()=>200,AUDIO_ANALYSIS_CAP_NAME:()=>Kn,AUDIO_BACKEND_CHOICES:()=>Hl,AUDIO_CHUNK_FORMATS:()=>_e,AUDIO_MACRO_LABELS:()=>a_,AUDIO_NOT_CLASSIFIED_REASONS:()=>Pl,AUDIO_PRESETS:()=>St,AUDIO_SCALE_EPOCH_ISO:()=>Yz,AUDIO_SCALE_EPOCH_MS:()=>Xz,AccessoriesStatusSchema:()=>KE,AccessoryKind:()=>Y,AddBrokerInputSchema:()=>Eg,AddonAutoUpdateSchema:()=>mD,AddonListItemSchema:()=>cD,AddonPageDeclarationSchema:()=>$c,AddonPageInfoSchema:()=>Zc,AdminLinkTargetEnum:()=>Zf,AdoptionAdoptInputSchema:()=>wp,AdoptionAdoptResultSchema:()=>Tp,AdoptionCandidateResultSchema:()=>Fn,AdoptionFilterSchema:()=>_p,AdoptionGetCandidateInputSchema:()=>xp,AdoptionJobSchema:()=>In,AdoptionJobStateSchema:()=>Nn,AdoptionListCandidatesInputSchema:()=>yp,AdoptionListCandidatesOutputSchema:()=>bp,AdoptionOutcomeSchema:()=>Pn,AdoptionReleaseInputSchema:()=>Ep,AdoptionStatusSchema:()=>Sp,AgentLoadSummarySchema:()=>mC,AirQualitySensorStatusSchema:()=>ED,AlarmArmModeSchema:()=>E_,AlarmPanelStatusSchema:()=>D_,AlarmStateSchema:()=>T_,AlertSchema:()=>Cl,AlertSeveritySchema:()=>bl,AlertSourceSchema:()=>Sl,AlertStatusSchema:()=>xl,AmbientLightSensorStatusSchema:()=>OD,AnalyticsLtsSeriesSchema:()=>Fx,ApiKeyRecordSchema:()=>Cy,ApiKeySummarySchema:()=>$F,AppleFmAvailabilitySchema:()=>gh,AppleFmUnavailableReasonSchema:()=>hh,ArchiveEntrySchema:()=>iu,ArchiveManifestSchema:()=>au,ArchivedDebugNoteQueryInputSchema:()=>gr,ArchivedDebugNoteSchema:()=>hr,AttachmentMediaTypeSchema:()=>Rg,AttachmentSchema:()=>zg,AudioAnalysisResultSchema:()=>Il,AudioAnalysisSettingsSchema:()=>Ll,AudioAttachDeviceInputSchema:()=>Rl,AudioAttachDeviceResultSchema:()=>zl,AudioChunkFormatSchema:()=>$r,AudioChunkInputSchema:()=>jl,AudioClassSummarySchema:()=>AD,AudioClassificationLabelSchema:()=>Nl,AudioClassificationResultSchema:()=>Vl,AudioClassifyOutcomeSchema:()=>Fl,AudioCodecInfoSchema:()=>Kl,AudioDecodeSessionConfigSchema:()=>ql,AudioDetachDeviceResultSchema:()=>Bl,AudioEncodeSchema:()=>pt,AudioEncodeSessionConfigSchema:()=>Jl,AudioEncodedChunkSchema:()=>Xl,AudioEventSchema:()=>kb,AudioLevelSchema:()=>Ml,AudioMetricsHistoryPointSchema:()=>MD,AudioMetricsHistorySchema:()=>ND,AudioMetricsSnapshotSchema:()=>jD,AudioPcmChunkSchema:()=>Yl,AudioStreamPickSchema:()=>Ir,AuthResultSchema:()=>$l,AutoUpdateSettingsSchema:()=>pD,AutomationActionSchema:()=>wc,AutomationConditionOperatorSchema:()=>yc,AutomationConditionSchema:()=>Sc,AutomationControlStatusSchema:()=>FD,AutomationRecipeSchema:()=>Tc,AutomationTriggerSchema:()=>Cc,AvailableIntegrationTypeSchema:()=>kk,BASE_DEVICE_CAPS:()=>xL,BASE_LIVE_EGRESS_PROFILE:()=>Gt,BATTERY_DEVICE_PROFILE:()=>OR,BATTERY_UNREACHABLE_AFTER_MS:()=>rR,BIRTH_DECISION_DEFAULT_LIMIT:()=>500,BOOT_RECOVERY_BACKOFF_MS:()=>vW,BUILTIN_RESULT_KINDS:()=>tL,BackgroundRunRegistry:()=>EW,BacklightModeSchema:()=>xk,BackupDestinationInfoSchema:()=>tu,BackupEntrySchema:()=>ru,BackupRunPhaseSchema:()=>cu,BackupRunSchema:()=>lu,BackupRunStateSchema:()=>su,BackupTriggerResultSchema:()=>uu,BaseAddon:()=>rt,BaseDevice:()=>XL,BaseDeviceProvider:()=>nR,BatteryStatusSchema:()=>LD,BinaryStatusSchema:()=>zD,BirthDecisionQueryInputSchema:()=>pr,BirthDecisionRecordSchema:()=>fr,BirthDecisionVerdictSchema:()=>dr,BoundingBoxSchema:()=>z,BrightnessStatusSchema:()=>VD,BrokerAddInputSchema:()=>yu,BrokerAudioClientSchema:()=>Uu,BrokerClientsSchema:()=>qu,BrokerConnectionDetailsSchema:()=>Tg,BrokerConsumerAttributionSchema:()=>Gu,BrokerConsumerKindSchema:()=>Wu,BrokerDecodedClientSchema:()=>Hu,BrokerEncodedClientSchema:()=>Ku,BrokerGetStateInputSchema:()=>Mu,BrokerInfoSchema:()=>wg,BrokerProviderInfoSchema:()=>gu,BrokerPublishInputSchema:()=>Ou,BrokerRegistryStatusSchema:()=>hu,BrokerRtspClientSchema:()=>Vu,BrokerStatsSchema:()=>ii,BrokerStatusEnum:()=>pu,BrokerStatusSchema:()=>ri,BrokerSubscribeInputSchema:()=>ku,BrokerSubscribeResultSchema:()=>Au,BrokerTestConnectionResultSchema:()=>Su,BrokerUnsubscribeInputSchema:()=>ju,BulkRecordSchema:()=>Bf,CAMERA_SWITCH_CATALOG:()=>Xn,CAMERA_SWITCH_ORDER:()=>zn,CAM_PROFILE_ORDER:()=>Fr,CAPABILITY_NAMES:()=>Oz,CAPABILITY_ROUTER_KEYS:()=>kz,CAP_NAMES_WITH_STATUS:()=>Dz,CAP_NODE_PIN_CONTEXT_KEY:()=>Fc,CAP_PROVIDER_KIND_MAP:()=>zz,CLASS_MAP_MACRO_TARGETS:()=>si,CLIP_BROKER_PACED_RATES:()=>WT,CLIP_PLAYBACK_OPTIONS:()=>ZT,CLIP_REALTIME_SOURCE_RATES:()=>KT,CLIP_REASON_HEADER_MAX:()=>500,CLIP_SEARCH_STRICTNESS:()=>rs,CLIP_STILL_DISPOSITION_HEADER:()=>MT,CLIP_STILL_REASON_CODE_HEADER:()=>jT,CLIP_STILL_REASON_HEADER:()=>kT,CLIP_STREAM_SOURCE_RATES:()=>GT,CLIP_STREAM_TRANSPORT_HEADER:()=>NT,CLIP_STRICTNESS_FACTOR:()=>as,CLIP_VECTOR_INDEX_PATTERN:()=>ts,CLUSTER_MODEL_CHOICE_UNREADABLE_REASONS:()=>Dy,CLUSTER_MODEL_SCOPED_STEPS:()=>Oy,CLUSTER_MODEL_SECTION_ID:()=>ky,CLUSTER_STEP_SETTING_FIELDS:()=>Hy,COCO_80_LABELS:()=>e_,COCO_TO_MACRO:()=>i_,COMPOSED_DEVICE_STABLE_ID_PREFIX:()=>Cd,COMPOSER_ADDON_ID:()=>Sd,COMPOSER_RUNNER_ID:()=>Cf,CONNECTION_TEST_TIMEOUT_MS:()=>lO,CONTAINER_CHILD_PRIORITY:()=>oR,CORE_BLOCKS_ADDON_ID:()=>of,CORE_BLOCK_ADDON_PREFIX:()=>af,CamProfileSchema:()=>C,CamStreamDescriptorSchema:()=>YP,CamStreamKindSchema:()=>Lr,CamStreamResolutionSchema:()=>Rr,CameraAssignmentStatusSchema:()=>bC,CameraAudioStatusSchema:()=>AC,CameraBrokerProfileSchema:()=>xC,CameraBrokerStatusSchema:()=>SC,CameraCredentialsSchema:()=>WD,CameraCredentialsStatusSchema:()=>GD,CameraDecoderShmSchema:()=>CC,CameraDecoderStatusSchema:()=>wC,CameraDetectionPhaseSchema:()=>OC,CameraDetectionProvisioningSchema:()=>DC,CameraDetectionProvisioningStateSchema:()=>EC,CameraDetectionStatusSchema:()=>kC,CameraMetricsSchema:()=>xS,CameraMetricsWithDeviceIdSchema:()=>SS,CameraMotionStatusSchema:()=>TC,CameraOccupancySnapshotForDeviceSchema:()=>EI,CameraRecordingModeSchema:()=>jC,CameraRecordingStatusSchema:()=>MC,CameraSourceStatusSchema:()=>yC,CameraSourceStreamSchema:()=>vC,CameraStatusDegradationReasonSchema:()=>PC,CameraStatusDegradationSchema:()=>FC,CameraStatusSchema:()=>LC,CameraStatusStageSchema:()=>NC,CameraStreamSchema:()=>zr,CameraSwitchAuthoritySchema:()=>Bn,CameraSwitchGroupSchema:()=>Wn,CameraSwitchIdSchema:()=>Rn,CameraSwitchSchema:()=>Un,CameraSwitchUnavailableReasonSchema:()=>Vn,CameraSwitchWarningSchema:()=>Hn,CandidateQueryFilterSchema:()=>vp,CapScopeSchema:()=>vy,CapabilityBindingsSchema:()=>gC,CarbonMonoxideStatusSchema:()=>$D,ChargingStatus:()=>El,ClientNetworkStatsSchema:()=>ej,ClimateControlStatusSchema:()=>nO,ClipBytesOfferSchema:()=>BT,ClipBytesSchema:()=>zT,ClipExportFailureSchema:()=>NN,ClipModelMetaSchema:()=>ns,ClipPlaybackOptionsSchema:()=>qT,ClipPlaybackSchema:()=>FT,ClipSchema:()=>PT,ClipSearchStrictnessSchema:()=>is,ClipSourceAvailabilitySchema:()=>JT,ClipSourceSchema:()=>YT,ClipStillDispositionSchema:()=>OT,ClipStillRefusalCodeSchema:()=>DT,ClipStreamAudioReasonSchema:()=>HT,ClipStreamAudioSchema:()=>VT,ClipStreamDialSchema:()=>UT,ClipWakeSchema:()=>IT,ClusterAddonNodeDeploymentSchema:()=>uj,ClusterAddonStatusEntrySchema:()=>dj,ClusterModelChoiceSchema:()=>VC,CollectionColumnSchema:()=>Vf,CollectionIndexSchema:()=>Hf,ColorStatusSchema:()=>sO,ComposerApplyInputSchema:()=>Ef,ComposerApplyResultSchema:()=>Of,ComposerBlockSchema:()=>wf,ComposerBlockVerdictSchema:()=>Df,ComposerUnreadableBlockSchema:()=>Tf,CompositionBindingSchema:()=>kd,CompositionBlockInputSchema:()=>pf,CompositionBlockStateSchema:()=>rf,CompositionCodeSourceSchema:()=>jd,CompositionCommandTargetSchema:()=>Pd,CompositionExistingTargetSchema:()=>zd,CompositionExpressionSourceSchema:()=>Ad,CompositionFeatureSchema:()=>Ld,CompositionFieldKindSchema:()=>Yd,CompositionFieldPlanSchema:()=>Qd,CompositionFieldReadSchema:()=>Ed,CompositionFieldRoleSchema:()=>Zd,CompositionFieldSourceSchema:()=>Md,CompositionFieldStateKindSchema:()=>tf,CompositionFieldStateSchema:()=>nf,CompositionFieldsFeatureSchema:()=>Fd,CompositionForwardCommandSchema:()=>Nd,CompositionFromSourceSchema:()=>Dd,CompositionGetReadSchema:()=>bf,CompositionGraphError:()=>zI,CompositionListReadSchema:()=>yf,CompositionLiteralBindingSchema:()=>Od,CompositionNewTargetSchema:()=>Rd,CompositionPassthroughFeatureSchema:()=>Id,CompositionProblemCodeSchema:()=>qd,CompositionProblemSchema:()=>Jd,CompositionRunStatusSchema:()=>ef,CompositionSchema:()=>Vd,CompositionSourceRefSchema:()=>Td,CompositionStateReadSchema:()=>gf,CompositionTargetSchema:()=>Bd,CompositionUnavailableModeSchema:()=>Xd,CompositionValidationSchema:()=>$d,CompositionViewSchema:()=>_f,ConfigEntrySchema:()=>om,ConfigSectionWithValuesSchema:()=>ol,ConfigTabDeclarationSchema:()=>al,ConnectionTestDescriptorSchema:()=>fO,ConnectionTestInputSchema:()=>dO,ConnectionTestOutcomeSchema:()=>uO,ConnectivityStatusSchema:()=>mO,ConsumableItemSchema:()=>gO,ConsumablesStatusSchema:()=>_O,ContactStatusSchema:()=>yO,ControlKindSchema:()=>xO,ControlStatusSchema:()=>SO,ConvertArtifactSchema:()=>bs,ConvertResultSchema:()=>xs,ConvertTargetSchema:()=>vs,CoreBlockCompileResultSchema:()=>xf,CoreBlockInputSchema:()=>df,CoreBlockPlacementSchema:()=>lf,CoreBlockSchema:()=>V,CoreBlockSourceSchema:()=>ff,CoreBlockStatusSchema:()=>uf,CoverStateSchema:()=>TO,CoverStatusSchema:()=>EO,CreateApiKeyInputSchema:()=>eI,CreateApiKeyResultSchema:()=>tI,CreateIntegrationInputSchema:()=>Mk,CreateScopedTokenInputSchema:()=>rI,CreateScopedTokenResultSchema:()=>iI,CreateUserInputSchema:()=>ZF,CustomActionInputSchema:()=>wD,CustomModelDescriptorSchema:()=>Pf,DATAPLANE_SECRET_HEADER:()=>Dn,DAYS_PER_WEEK:()=>7,DAY_NAMES:()=>iP,DECLARED_DEVICE_SWEEP_LIMIT:()=>32,DECLARED_INTEGRATION_FIXED_KEY:()=>mR,DEFAULT_ADDON_PLACEMENT:()=>yn,DEFAULT_AUDIO_ANALYZER_CONFIG:()=>Ul,DEFAULT_CLUSTER_STEP_MODELS:()=>My,DEFAULT_CLUSTER_STEP_SETTINGS:()=>qy,DEFAULT_DECODER_HWACCEL_CONFIG:()=>qf,DEFAULT_DETAIL_CROP_CONVENTION:()=>fU,DEFAULT_EVENTS_BAND_BUFFER_SEC:()=>Si,DEFAULT_EVENT_COLOR:()=>d_,DEFAULT_FEATURES:()=>Dr,DEFAULT_FIRST_SIGHTING_FRESHNESS_MS:()=>aE,DEFAULT_MIN_LANDMARK_FACE_SIZE_PX:()=>24,DEFAULT_NATIVE_LEASE_SETTINGS:()=>Q,DEFAULT_OVERLAY_LAYERS:()=>zo,DEFAULT_POOL_MEMORY_POLICY:()=>UW,DEFAULT_RECORDING_PROFILES:()=>Oi,DEFAULT_RETENTION:()=>Ln,DEFAULT_RUNTIME_STATE_DURABILITY:()=>zc,DEFAULT_TIMELAPSE_PREVIEW_TEXT:()=>tU,DEFAULT_TOKEN_EXPIRY:()=>`30d`,DERIVED_CAMERA_SILENCED_CAP_NAMES:()=>Yn,DETAIL_CROP_PADDING_FIELD:()=>_U,DETAIL_CROP_PADDING_KEY:()=>lU,DETAIL_CROP_SECTION_ID:()=>cU,DETAIL_CROP_SQUARE_KEY:()=>uU,DETECTION_MACRO_CLASSES:()=>n_,DETECTION_PIPELINE_CAP_NAME:()=>Gn,DEVICE_BACKEND_TO_FORMAT:()=>lG,DEVICE_CAP_NAMES:()=>Fz,DEVICE_CHILDREN_BATCH_MAX:()=>256,DEVICE_PROFILES:()=>kR,DEVICE_RESTORE_RETRY_CONCURRENCY:()=>4,DEVICE_RESTORE_RETRY_DELAYS_MS:()=>ZL,DEVICE_SCOPED_CAPS:()=>jz,DEVICE_SETTINGS_CONTRIBUTION_METHODS:()=>Wc,DEVICE_STATE_READERS:()=>RL,DEVICE_STATUS_METHOD:()=>Gc,DEVICE_TYPE_CONTROL_KIND:()=>_R,DEVICE_TYPE_INFO:()=>sW,DISPLAY_ICON_GROUPS:()=>IR,DISPLAY_ICON_KEYS:()=>RR,DISPLAY_ICON_OFFERED_KEYS:()=>zR,DISPLAY_ICON_VOCABULARY:()=>LR,DOORBELL_SOURCE_SLOT:()=>uE,DataStoreEngineInfoSchema:()=>Wf,DayNightModeSchema:()=>OO,DayNightOptionsSchema:()=>jO,DayNightSettingsPatchSchema:()=>MO,DayNightStatusSchema:()=>AO,DeclaredDevices:()=>gR,DecodedAudioChunkSchema:()=>ei,DecodedFrameSchema:()=>Yr,DecoderSessionConfigSchema:()=>Xa,DecoderStatsSchema:()=>Ya,DeleteIntegrationResultSchema:()=>Pk,DetailCropConventionSchema:()=>dU,DetectionCatalogClassMapSchema:()=>ui,DetectionSourceSchema:()=>wb,DetectionSourcesSchema:()=>qS,DeviceAdminLinkSchema:()=>Qf,DeviceCodeSeveritySchema:()=>Vk,DeviceConfig:()=>KL,DeviceDiscoveryStatusSchema:()=>hp,DeviceExportExposeInputSchema:()=>Ip,DeviceExportStatusSchema:()=>Np,DeviceExportUnexposeInputSchema:()=>Lp,DeviceFeature:()=>Tl,DeviceInfoSchema:()=>am,DeviceNetworkStatsSchema:()=>tj,DeviceRestoreRetryScheduler:()=>eR,DeviceRole:()=>R,DeviceRuntimeState:()=>qL,DeviceSelectorSchema:()=>yy,DeviceStatusSchema:()=>RO,DeviceType:()=>L,DiagnosticIdSchema:()=>TF,DiagnosticWindowPatchSchema:()=>MF,DiagnosticWindowSchema:()=>jF,DiscoveredChildDeviceSchema:()=>mp,DiscoveredChildStatusSchema:()=>pp,DiscoveredDeviceSchema:()=>Yp,DiscoveredTargetSchema:()=>Yg,DiskReconcileJobSchema:()=>IC,DisposerChain:()=>dt,DoorbellPressEventSchema:()=>cE,DoorbellSourceSlotValueSchema:()=>lE,DoorbellStatusSchema:()=>sE,EMBEDDING_MODEL_FAILED:()=>Am,EMBEDDING_REQUIREMENTS_FAILED:()=>Mm,EMBEDDING_REQUIREMENTS_UNAVAILABLE:()=>jm,EVENTFUL_CAP_NAMES:()=>YC,EVENT_DENSITY_BATCH_MAX:()=>200,EVENT_KIND_BY_CAP:()=>JC,EVENT_OWNER_TYPES:()=>je,EVENT_PAD_MS:()=>di,EVENT_TAXONOMY:()=>g_,EXPORT_DENSE_MAX_RANGES:()=>200,EXPRESSION_BUILTINS:()=>Ms,EXPRESSION_BUILTIN_NAMES:()=>Ns,EXPRESSION_COMPILE_CACHE_CAPACITY:()=>256,EXPRESSION_IDENTIFIER_RE:()=>Is,EXPRESSION_INJECTED_NOW:()=>`now`,EXTENSION_HOST_DEVICE_TYPES:()=>gE,EXTENSION_SLOTS:()=>mE,EXTENSION_SLOT_IDS:()=>fE,EXTENSION_SLOT_LISTING_METHOD:()=>_E,EXTENSION_SLOT_REF_SEPARATOR:()=>`:`,EffectiveTuningSchema:()=>Wx,EgressEncodeSchema:()=>$u,EgressRateControlSchema:()=>ed,EgressTranscodeRequestSchema:()=>td,EgressTranscodeSchema:()=>nd,ElementConfigStore:()=>OW,EmbeddingFailedModelSchema:()=>Dm,EmbeddingFailedRequirementSchema:()=>Om,EmbeddingInfoSchema:()=>km,EmbeddingRefusalCodeSchema:()=>Nm,EmbeddingResultSchema:()=>Tm,EmbeddingTowerSchema:()=>Em,EncodeProfileSchema:()=>mt,EncodedPacketSchema:()=>Jr,EnrichedWidgetMetadataSchema:()=>hl,EnumSensorDateTimeFormatSchema:()=>BO,EnumSensorStatusSchema:()=>VO,EventCategory:()=>Le,EventDensityBucketSchema:()=>mx,EventDensityForDeviceSchema:()=>hx,EventEmitterStatusSchema:()=>WO,EventFireSchema:()=>UO,EventKindCategorySchema:()=>eb,EventKindDescriptorSchema:()=>nb,EventKindIconSchema:()=>$y,EventKindSchema:()=>Zy,EventKindsForDeviceSchema:()=>rb,EventMediaArtifactSchema:()=>Lu,EventMediaCoverageSchema:()=>Ru,EventMediaKindSchema:()=>Iu,EventMediaProductionSchema:()=>zu,EventOwnerTypeSchema:()=>Me,EventSourceType:()=>Ez,ExportBytesSchema:()=>RN,ExportClipSubjectSchema:()=>AN,ExportDenseRangeSchema:()=>wN,ExportDenseSchema:()=>TN,ExportDownloadSchema:()=>IN,ExportFootageSubjectSchema:()=>kN,ExportOptionsSchema:()=>DN,ExportRecordSchema:()=>MN,ExportSetupFieldSchema:()=>jp,ExportSetupSchema:()=>Mp,ExportSpeedSchema:()=>CN,ExportStateSchema:()=>ON,ExportSubjectSchema:()=>jN,ExportTimelapseSchema:()=>EN,ExposedDeviceSchema:()=>Fp,ExposureModeSchema:()=>bk,ExpressionBindingSourceSchema:()=>_c,ExpressionEvalError:()=>k,ExpressionFieldBindingSchema:()=>mc,ExpressionGlobalBindingSchema:()=>gc,ExpressionLiteralBindingSchema:()=>hc,ExpressionParseError:()=>O,ExpressionSourceSchema:()=>vc,ExtensionCandidateSchema:()=>DE,ExtensionCandidatesSchema:()=>OE,ExtensionSetResultSchema:()=>kE,ExtensionSetSlotInputSchema:()=>jE,ExtensionSlotActivationSchema:()=>SE,ExtensionSlotIdSchema:()=>pE,ExtensionSlotRefInputSchema:()=>AE,ExtensionSlotRowSchema:()=>TE,ExtensionSlotSourceSchema:()=>xE,ExtensionSlotStateSchema:()=>CE,ExtensionSlotUnreachableSchema:()=>wE,ExtensionSlotValueSchema:()=>hE,ExtensionSourceAvailabilitySchema:()=>vE,ExtensionSourceHealthSchema:()=>bE,ExtensionSourceSchema:()=>yE,FIRST_LEVEL_MACRO_CLASSES:()=>ci,FULL_IMAGE_BBOX:()=>gU,FailureContributionSchema:()=>Wm,FailureCounters:()=>go,FailureReasonCountSchema:()=>Um,FanControlStatusSchema:()=>ik,FanDirectionSchema:()=>rk,FeatureManifestSchema:()=>dF,FeatureProbeStatusSchema:()=>ok,FloodStatusSchema:()=>ck,Fmp4BoxSplitter:()=>en,FrameHandleFormatSchema:()=>Xr,FrameHandleSchema:()=>w,FrameInputSchema:()=>kl,FrameLazyCountersSchema:()=>tC,FrameLazyMetricsSchema:()=>nC,G711_SCALE_CORRECTION_DB:()=>Zz,GasStatusSchema:()=>uk,GetLoggingSettingsInputSchema:()=>RF,GetStreamWithCodecInputSchema:()=>Zu,GlobalMetricsSchema:()=>hC,GridLayoutPatchSchema:()=>ZD,GridLayoutViewSchema:()=>XD,HAP_AUDIO_BASE:()=>Xt,HAP_AUDIO_BITRATE_KBPS:()=>24,HAP_AUDIO_VBV_KBITS:()=>96,HAP_KEYFRAME_INTERVAL_SEC:()=>4,HF_BASE_URL:()=>HL,HF_REPO:()=>VL,HOURS_PER_DAY:()=>24,HWACCEL_OPTIONS:()=>Kf,HealthStatusSchema:()=>fF,HfModelResolutionSchema:()=>Oh,HistoryPointSchema:()=>kI,HistoryResolutionEnum:()=>DI,HumidifierStatusSchema:()=>fk,HumiditySensorStatusSchema:()=>mk,HvacModeSchema:()=>tO,INFERENCE_DEVICE_EXCLUSION_REASONS:()=>RC,ImageContractSchema:()=>ew,ImageContractStateSchema:()=>$C,ImageRotateSchema:()=>vk,ImageSettingsOptionsSchema:()=>wk,ImageSettingsPatchSchema:()=>Tk,ImageSettingsStatusSchema:()=>Ck,ImageStatusSchema:()=>gk,InferenceDeviceExclusionReasonSchema:()=>zC,IngestOwnerSchema:()=>_C,InstalledPackageSchema:()=>lD,IntegrationLiteSchema:()=>Ok,IntegrationWithStateSchema:()=>Dk,IntercomAbilitySchema:()=>Ik,IntercomStatusSchema:()=>Lk,KNOWN_CAP_NAMES:()=>Pz,KeyEventSchema:()=>dx,LEGACY_READ_ONLY_CONFIG_KEY:()=>Oa,LINKED_DEVICES_SLOT:()=>um,LOAD_CONTRIBUTION_ATTRIBUTIONS:()=>Ph,LOAD_CONTRIBUTION_ROLES:()=>Nh,LOCATION_DESCRIPTION_MAX:()=>400,LOCATION_ICON_FALLBACK:()=>Bp,LOCATION_ICON_IDS:()=>zp,LOG_CHANNEL_TICK_MS:()=>uo,LOG_LEVEL_RANK:()=>Or,LTS_SCOPE_CLASS_SEPARATOR:()=>`|`,LabelAttributionSchema:()=>_b,LabelDefinitionSchema:()=>oi,LabelTierSchema:()=>gb,LawnMowerActivitySchema:()=>Bk,LawnMowerControlStatusSchema:()=>Hk,LedgerWalkDeviceReportSchema:()=>ha,LedgerWalkInputSchema:()=>da,LedgerWalkRefusalSchema:()=>fa,LedgerWalkReportSchema:()=>ga,LedgerWalkSkipCountsSchema:()=>ma,LedgerWalkSkipReasonSchema:()=>pa,LegacyStorageLocationDefaultSchema:()=>Va,LinkedDeviceSchema:()=>cm,LinkedDevicesModeSchema:()=>sm,LinkedDevicesSlotValueSchema:()=>lm,LlmDefaultSchema:()=>Th,LlmDefaultSelectorSchema:()=>wh,LlmDownloadProgressSchema:()=>uh,LlmErrorCodeSchema:()=>Qm,LlmGenerateBaseInputSchema:()=>oh,LlmGenerateErrSchema:()=>th,LlmGenerateOkSchema:()=>$m,LlmGenerateResultSchema:()=>nh,LlmImageSchema:()=>rh,LlmNodeModelSchema:()=>fh,LlmProfileKindDescriptorSchema:()=>Ch,LlmProfileKindSchema:()=>bh,LlmProfileSchema:()=>xh,LlmRefusalSourceSchema:()=>eh,LlmRetryPolicySchema:()=>ih,LlmRuntimeAppleCompleteInputSchema:()=>_h,LlmRuntimeCancelInputSchema:()=>vh,LlmRuntimeCompleteInputSchema:()=>mh,LlmRuntimeDiskUsageSchema:()=>ph,LlmRuntimeNodeSchema:()=>kh,LlmRuntimeStatusSchema:()=>dh,LlmTimeoutDefaults:()=>ah,LlmUsageRollupSchema:()=>Eh,LlmUsageSchema:()=>Zm,LoadContributionSchema:()=>Fh,LocateSegmentResultSchema:()=>vN,LocationDescriptionAssignmentSchema:()=>Gp,LocationIconAssignmentSchema:()=>Hp,LocationIconIdSchema:()=>Vp,LocationStatSchema:()=>ou,LockControlStatusSchema:()=>iA,LockStateSchema:()=>rA,LogChannelApplyResultSchema:()=>Lh,LogChannelDescriptorSchema:()=>no,LogChannelGate:()=>io,LogChannelLevelSchema:()=>to,LogChannelRegistry:()=>ao,LogChannelWindowPatchSchema:()=>PF,LogChannelWindowSchema:()=>ro,LogChannelWindowStateSchema:()=>NF,LogEntrySchema:()=>Bh,LogLevelSchema:()=>zh,LogStreamEntrySchema:()=>SD,LoggingEffectiveSchema:()=>kF,LoggingExplicitSchema:()=>AF,LoggingLevelLayerSchema:()=>OF,LoggingLevelSourceSchema:()=>DF,LoggingScopeKindSchema:()=>EF,LoggingSettingsPatchSchema:()=>FF,LoggingSettingsStateSchema:()=>BF,LoginMethodContributionSchema:()=>Kh,LoginStageEnum:()=>Hh,LtsBucketSchema:()=>Rx,MACRO_LABELS:()=>t_,MAX_ARCHIVED_DEBUG_NOTES:()=>mr,MAX_BIRTH_DECISION_RECORDS:()=>lr,MAX_BIRTH_LATENCY_PROXY_MS:()=>ur,MAX_CLIP_EVENT_IDS:()=>24,MAX_CLIP_LABELS:()=>3,MAX_COMPOSITION_CODE_LENGTH:()=>wd,MAX_COMPOSITION_FEATURES:()=>16,MAX_COMPOSITION_FIELDS_PER_FEATURE:()=>32,MAX_CONDITION_DEPTH:()=>3,MAX_CONDITION_LEAVES:()=>32,MAX_EXPRESSION_AST_NODES:()=>256,MAX_EXPRESSION_BINDINGS:()=>32,MAX_EXPRESSION_CALL_ARGS:()=>16,MAX_EXPRESSION_EVAL_STEPS:()=>Fs,MAX_EXPRESSION_SOURCE_LENGTH:()=>Ps,MAX_KEYS:()=>po,MAX_REASONS_PER_KEY:()=>16,MAX_SENSOR_TRIGGER_DEVICES:()=>16,MAX_TRACK_DEBUG_NOTE_LEN:()=>500,MEDIA_OWNER_TYPES:()=>Te,MEDIA_PRESENCE_OWNER_KINDS:()=>Ne,METHOD_ACCESS_MAP:()=>Nz,METHOD_DEVICE_SELECTORS:()=>Lz,MINUTES_PER_DAY:()=>rP,MODEL_FORMATS:()=>ss,MODEL_HOSTING:()=>hs,MODEL_PROVIDER_IDS:()=>fs,MOTION_CLOSE_AFTER_MS:()=>hA,MOTION_TRIGGER_FEATURE:()=>bR,ManagedModelCatalogEntrySchema:()=>Dh,ManagedModelExtraFileSchema:()=>sh,ManagedModelRefSchema:()=>ch,ManagedRuntimeConfigSchema:()=>lh,MaskGridDimsSchema:()=>L_,MaskGridShapeSchema:()=>M_,MaskLineShapeSchema:()=>N_,MaskPointSchema:()=>k_,MaskPolygonShapeSchema:()=>j_,MaskPolygonVerticesSchema:()=>I_,MaskRectShapeSchema:()=>A_,MaskShapeKindSchema:()=>F_,MaskShapeSchema:()=>P_,MediaFileInfoSchema:()=>Nb,MediaFileKindEnum:()=>Ab,MediaFileRefSchema:()=>jb,MediaFileSchema:()=>Mb,MediaPlayerRepeatSchema:()=>sA,MediaPlayerStateSchema:()=>oA,MediaPlayerStatusSchema:()=>lA,MediaPresenceOwnerKindSchema:()=>Pe,MediaRelocateModeSchema:()=>Vi,MeshPeerSchema:()=>fA,MeshStatusSchema:()=>pA,MethodAccessSchema:()=>hy,MigrateDeviceResultSchema:()=>Sm,MigrateSwitchOutcomeSchema:()=>bm,MigrateSwitchReportSchema:()=>xm,ModelCatalogEntrySchema:()=>_s,ModelConvertInputSchema:()=>mg,ModelConvertMetadataSchema:()=>ys,ModelDistributeInputSchema:()=>gg,ModelDistributeResultSchema:()=>_g,ModelExtraFileSchema:()=>ls,ModelFormatEntrySchema:()=>cs,ModelFormatsSchema:()=>us,ModelLicenseSchema:()=>gs,ModelProviderIdSchema:()=>ps,ModelSubstitutionSchema:()=>nS,ModelVariantGroupSchema:()=>ds,MotionAnalysisResultSchema:()=>bg,MotionEventSchema:()=>Cb,MotionOnMotionChangedDataSchema:()=>_A,MotionRegionSchema:()=>yg,MotionSourceEnum:()=>GS,MotionSourcesSchema:()=>KS,MotionStatusSchema:()=>gA,MotionTriggerRuntimeStateSchema:()=>bA,MotionTriggerStatusSchema:()=>yA,MotionZoneOptionsSchema:()=>wA,MotionZonePatchSchema:()=>TA,MotionZoneRegionSchema:()=>SA,MotionZoneStatusSchema:()=>CA,MqttBrokerStatusSchema:()=>Mg,MutationFilterSchema:()=>If,NATIVE_LEASE_ACTIVITY_FIELD:()=>NU,NATIVE_LEASE_ACTIVITY_KEY:()=>TU,NATIVE_LEASE_ADMISSION_FIELD:()=>IU,NATIVE_LEASE_ADMISSION_KEY:()=>EU,NATIVE_LEASE_BUDGET_FIELD:()=>MU,NATIVE_LEASE_BUDGET_KEY:()=>wU,NATIVE_LEASE_HOLD_FIELD:()=>jU,NATIVE_LEASE_HOLD_KEY:()=>CU,NATIVE_LEASE_SCENE_BUDGET_FIELD:()=>FU,NATIVE_LEASE_SCENE_BUDGET_KEY:()=>OU,NATIVE_LEASE_SECTION_ID:()=>SU,NATIVE_LEASE_TILE_BUDGET_FIELD:()=>PU,NATIVE_LEASE_TILE_BUDGET_KEY:()=>DU,NAVIGATION_ACTION_CATALOG:()=>zA,NAVIGATION_LIGHT_LEVEL_MAX:()=>100,NAVIGATION_LIGHT_LEVEL_MIN:()=>40,NC_ALARM_OPENING_EVENT_KINDS:()=>WV,NC_ALARM_SYSTEM_EVENT_KINDS:()=>H_,NC_AUDIO_CONFIRM_HITS_DEFAULT:()=>2,NC_AUDIO_CONFIRM_HITS_MAX:()=>20,NC_AUDIO_CONFIRM_HITS_MIN:()=>1,NC_AUDIO_CONFIRM_WINDOW_MAX_SEC:()=>60,NC_AUDIO_CONFIRM_WINDOW_MIN_SEC:()=>1,NC_AUDIO_CONFIRM_WINDOW_SEC_DEFAULT:()=>5,NC_AUDIO_DBFS_FLOOR:()=>-96,NC_AUDIO_DB_MAX:()=>0,NC_AUDIO_DB_MIN:()=>rB,NC_AUDIO_DB_OFFERED:()=>iB,NC_AUDIO_DB_STEP:()=>3,NC_AUDIO_DEFAULTS:()=>aB,NC_AUDIO_HIT_PERCENT_MAX:()=>100,NC_AUDIO_HIT_PERCENT_MIN:()=>1,NC_AUDIO_SAMPLING_MAX_SEC:()=>300,NC_AUDIO_SAMPLING_MIN_SEC:()=>1,NC_AUDIO_SEED:()=>AV,NC_AUTHORABLE_SYSTEM_EVENT_KINDS:()=>V_,NC_BASE_CONDITION_KEYS:()=>CB,NC_BATTERY_CONSUMABLE_SYSTEM_EVENT_KINDS:()=>U_,NC_CLIP_POST_ROLL_DEFAULT_SEC:()=>6,NC_CLIP_PRE_ROLL_DEFAULT_SEC:()=>4,NC_CLIP_RETENTION_MAX_SEC:()=>60,NC_CONDITION_CATALOG:()=>Uv,NC_CONFIRM_DEFAULT_MAX_IMAGE_PX:()=>448,NC_CONFIRM_DEFAULT_TIMEOUT_MS:()=>xv,NC_CONFIRM_MAX_TIMEOUT_MS:()=>bv,NC_CONFIRM_MIN_TIMEOUT_MS:()=>yv,NC_CONSUMABLE_LOW_PERCENT_DEFAULT:()=>15,NC_CONSUMABLE_LOW_PERCENT_MAX:()=>95,NC_CONSUMABLE_SYSTEM_EVENT_KINDS:()=>W_,NC_DEFAULT_SNOOZE_MINUTES:()=>Y_,NC_HISTORY_LIMIT_DEFAULT:()=>100,NC_HISTORY_LIMIT_MAX:()=>500,NC_MAX_PER_TRACK_IMMEDIATE:()=>1,NC_OCCUPANCY_DEFAULTS:()=>kV,NC_RULE_CLEARABLE_KEYS:()=>Ev,NC_RULE_EDITOR_SECTION_ORDER:()=>NV,NC_RULE_KIND_SPECS:()=>fV,NC_RULE_SECTIONS:()=>SV,NC_SENSOR_RAISED_FIELD_BY_KIND:()=>YV,NC_SENSOR_TRANSITION_KINDS:()=>XV,NC_SENSOR_TRANSITION_NEVER_FIRES_WARNING:()=>JV,NC_SENSOR_TRANSITION_UNSUPPORTED_REASON:()=>eH,NC_SERVER_PACKAGE_NAME:()=>IH,NC_SNOOZE_MAX_MINUTES:()=>J_,NC_SYSTEM_DELIVERY:()=>hV,NC_SYSTEM_EVENT_CONDITION_FILTER_KEYS:()=>qB,NC_SYSTEM_EVENT_FAMILIES:()=>UB,NC_SYSTEM_EVENT_FAMILY:()=>GB,NC_SYSTEM_EVENT_FAMILY_FILTERS:()=>JB,NC_SYSTEM_EVENT_FILTER_KEYS:()=>BB,NC_SYSTEM_EVENT_KIND_GROUP_SPECS:()=>YB,NC_SYSTEM_EVENT_SUMMARY_FAMILIES:()=>wH,NC_SYSTEM_RULE_KINDS:()=>tV,NC_TANK_SYSTEM_EVENT_KINDS:()=>G_,NC_TAXONOMY:()=>w_,NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS:()=>mH,NC_TEMPLATE_VARS:()=>pH,NC_UPDATE_EVENT_PACKAGE_NAMES:()=>LH,NETWORK_LINK_TYPES:()=>qA,NETWORK_LINK_UNKNOWN:()=>YA,NativeCropBboxSchema:()=>DS,NativeCropRefSchema:()=>Bx,NativeCropResultSchema:()=>OS,NativeDetectionSchema:()=>OA,NativeLeaseAdmissionSchema:()=>kU,NativeLeaseSettingsSchema:()=>AU,NativeObjectClassEnum:()=>DA,NativeObjectDetectionOptionsSchema:()=>jA,NativeObjectDetectionRuntimeStateSchema:()=>NA,NativeObjectDetectionSettingsPatchSchema:()=>MA,NativeObjectDetectionStatusSchema:()=>kA,NativeObjectGeometryEnum:()=>AA,NavigationActionEntrySchema:()=>RA,NavigationActionIdSchema:()=>IA,NavigationEntryKindSchema:()=>LA,NavigationFeaturesSchema:()=>VA,NavigationLightModeSchema:()=>HA,NavigationModeSchema:()=>UA,NavigationMoveCommandSchema:()=>FA,NavigationPointSchema:()=>BA,NavigationRuntimeStateSchema:()=>GA,NavigationStatusSchema:()=>WA,NcAlarmConfigSchema:()=>dy,NcAlarmModeCoverageSchema:()=>oy,NcAlarmSettingsPatchSchema:()=>ry,NcAlarmSettingsSchema:()=>ny,NcAlarmSkipReasonSchema:()=>iy,NcAlarmSkippedDeviceSchema:()=>ay,NcAudioConditionSchema:()=>nv,NcClipRetentionAskSchema:()=>fy,NcClipRetentionPlanSchema:()=>py,NcConditionDescriptorSchema:()=>Hv,NcConditionsSchema:()=>fv,NcConfirmExpectSchema:()=>Sv,NcConfirmSchema:()=>Cv,NcCrossingSchema:()=>rv,NcDeliverySchema:()=>R_,NcDeviceStateConditionSchema:()=>uv,NcHistoryEntrySchema:()=>qv,NcHistoryFilterSchema:()=>Jv,NcHistoryRecordKindSchema:()=>Gv,NcHistoryStatusSchema:()=>Wv,NcHistorySubjectSchema:()=>Kv,NcLinkedCameraModeSchema:()=>hv,NcMediaFrameSchema:()=>mv,NcMediaPolicySchema:()=>gv,NcOccupancyConditionSchema:()=>tv,NcPlateMatcherSchema:()=>ev,NcRuleActionSchema:()=>ov,NcRuleActionSequenceSchema:()=>sv,NcRuleActionsSchema:()=>lv,NcRuleClearableKeySchema:()=>Dv,NcRuleInputSchema:()=>wv,NcRuleKindSchema:()=>Nv,NcRuleLastRunSchema:()=>Yv,NcRuleLastRunsSchema:()=>Xv,NcRuleNotificationButtonSchema:()=>cv,NcRulePatchSchema:()=>Tv,NcRuleSchema:()=>kv,NcRuleTargetSchema:()=>pv,NcRuleUpdateInputSchema:()=>Ov,NcSceneConditionSchema:()=>dv,NcScheduleSchema:()=>Z_,NcScheduleWindowSchema:()=>X_,NcSensorTransitionSchema:()=>iv,NcSnoozeInputSchema:()=>Qv,NcSnoozeSchema:()=>$v,NcSnoozeScopeSchema:()=>Zv,NcSnoozeSuppressedSchema:()=>ey,NcStateSummaryPreviewSchema:()=>jv,NcStateSummaryPreviewSectionSchema:()=>Av,NcSystemEventConditionSchema:()=>K_,NcSystemEventDeliveryModeSchema:()=>Q_,NcSystemEventDeliverySchema:()=>$_,NcSystemEventKindSchema:()=>z_,NcTaxonomyEntrySchema:()=>b_,NcTaxonomySchema:()=>x_,NcTemplateFamilySchema:()=>Fv,NcTemplateFieldSchema:()=>Iv,NcTemplatePreviewInputSchema:()=>Bv,NcTemplatePreviewSchema:()=>Vv,NcTemplateVarContextSchema:()=>zv,NcTemplateVarDescriptorSchema:()=>Rv,NcTemplateVarGroupSchema:()=>Lv,NcTemplateVarKindSchema:()=>Pv,NcTestResultSchema:()=>Mv,NcThrottleGranularitySchema:()=>_v,NcThrottleSchema:()=>vv,NcZoneConditionSchema:()=>av,NetworkAccessStatusSchema:()=>Fg,NetworkAddressSchema:()=>pF,NetworkEndpointSchema:()=>Pg,NetworkLinkStatusSchema:()=>JA,NodeDirectoryEntrySchema:()=>vj,NodeDirectorySchema:()=>yj,NotificationActionIconSchema:()=>Vg,NotificationActionSchema:()=>Hg,NotificationFormatSchema:()=>Bg,NotificationSchema:()=>Ug,NotifierStatusSchema:()=>wj,NumericSensorStatusSchema:()=>Oj,OPERATOR_WRITTEN_STALE_MS:()=>rz,OPS_LOG_DEFAULT_LIMIT:()=>200,OPS_LOG_RING_DEFAULT_MAX:()=>500,OVERFLOW_REASON:()=>mo,OVERLAY_LAYERS:()=>Ro,OauthIntegrationDescriptorSchema:()=>Ty,ObjectEventSchema:()=>Ob,OccupancyBurstRefusalSchema:()=>iC,OnboardFieldSupportSchema:()=>QN,OnboardRecordTrackSchema:()=>JN,OnboardScheduleSupportSchema:()=>$N,OnboardStorageSchema:()=>qN,OnboardStorageVolumeSchema:()=>KN,OpsLogDomainSchema:()=>Ar,OpsLogEntrySchema:()=>Nr,OpsLogOpSchema:()=>jr,OpsLogQueryInputSchema:()=>Pr,OpsLogReasonSchema:()=>Mr,OrchestratorMetricsSchema:()=>bS,OsdOverlayKindEnum:()=>Aj,OsdOverlayPatchSchema:()=>Pj,OsdOverlaySchema:()=>Mj,OsdPositionEnum:()=>jj,OsdRenderOutcomeEnum:()=>zj,OsdRenderResultSchema:()=>Bj,OsdSlotBindingSchema:()=>Lj,OsdSlotViewSchema:()=>Rj,OsdSourceOptionSchema:()=>Hj,OsdSourceSchema:()=>Ij,OsdSourceValueTypeEnum:()=>Vj,OsdStatusSchema:()=>Nj,PEER_BYTES_CHUNK_BYTES:()=>jn,PEER_BYTES_MAX_OUTSTANDING:()=>64,PEER_BYTES_STALL_MS:()=>An,PEER_BYTES_TICKET_TTL_MS:()=>kn,PET_FEEDER_MANUAL_FEED_MAX:()=>200,PET_FEEDER_MANUAL_FEED_MIN:()=>4,PIPELINE_ANALYTICS_CAP_NAME:()=>Jn,PIPELINE_FLOW_CAPABILITY_NAMES:()=>NI,PIPELINE_OWNER_CAPABILITY_NAMES:()=>PI,PRIVACY_MASK_CAP_NAME:()=>qn,PROVIDER_KIND_CAP_NAMES:()=>Bz,PROVIDER_PIN_FIELD:()=>Vc,PYTHON_SCRIPT:()=>fG,PackageUpdateSchema:()=>uD,PackageVersionInfoSchema:()=>dD,ParkRefusalSchema:()=>AS,ParkTrackFrameResultSchema:()=>jS,ParkedFrameKindSchema:()=>kS,ParkedTrackFrameSchema:()=>MS,PasskeyLoginMethodSchema:()=>Gh,PasskeySummarySchema:()=>eT,PcmSampleFormatSchema:()=>Gl,PeerBytesTicketSchema:()=>Mn,PerScopeBreakdownSchema:()=>SI,PetFeederStatusSchema:()=>Kj,PickStreamPreferencesSchema:()=>od,PickStreamRequirementsSchema:()=>ad,PickedCamStreamSchema:()=>sd,PipelineAssignmentSchema:()=>pC,PipelineDefaultStepSchema:()=>Kx,PipelineEngineChoiceSchema:()=>K,PipelineRunResultBridge:()=>vS,PipelineStepInputSchema:()=>tS,PipelineValidationIssueSchema:()=>rS,PipelineValidationResultSchema:()=>iS,PlaceholderReasonSchema:()=>Ju,PolygonPointSchema:()=>wS,PoolMemoryWatchdog:()=>tG,PowerMeterStatusSchema:()=>gM,PresenceStatusSchema:()=>yM,PressureSensorStatusSchema:()=>xM,PrivacyMaskOptionsSchema:()=>EM,PrivacyMaskPatchSchema:()=>DM,PrivacyMaskRegionSchema:()=>wM,PrivacyMaskShapeSchema:()=>CM,PrivacyMaskStatusSchema:()=>TM,ProfileRtspEntrySchema:()=>ai,ProfileSlotSchema:()=>Vr,ProfileSlotStatusSchema:()=>Br,ProviderStatusSchema:()=>Jp,PtzAutotrackRuntimeStateSchema:()=>HM,PtzAutotrackSettingsSchema:()=>zM,PtzAutotrackStatusSchema:()=>VM,PtzAutotrackTargetOptionSchema:()=>BM,PtzHomePresetSchema:()=>IM,PtzHomeReturnSchema:()=>LM,PtzMoveCommandSchema:()=>NM,PtzOptionsSchema:()=>FM,PtzPositionSchema:()=>MM,PtzPresetFunctionSchema:()=>AM,PtzPresetSchema:()=>jM,PtzStatusSchema:()=>PM,QueryFilterSchema:()=>H,RATE_CONTROL_RELAXED:()=>Yt,RATE_CONTROL_TIGHT:()=>Jt,REACHABILITY_FAILURES_TO_OFFLINE:()=>3,REACHABILITY_POLL_INTERVAL_MS:()=>ZR,REACHABILITY_PROBE_TIMEOUT_MS:()=>QR,RECOGNITION_TYPES:()=>wa,RECORDING_AUDIO_TRIGGER_OFFERED_DBFS:()=>-30,RECORDING_EXPORT_MAX_READ_BYTES:()=>LN,RECORDING_SOURCE_CAMSTACK:()=>GM,RECORDING_SOURCE_CAMSTACK_ADDON:()=>KM,RECORDING_TIMELINE_BATCH_MAX:()=>200,REDACTED_SECRET:()=>tr,RESERVED_BINDING_NAMES:()=>Ls,RESERVED_COLLECTION_SOURCES:()=>CP,RESTORED_CAP_NAMES:()=>Kz,ROOM_EXAMPLE_MOTION_SOURCES:()=>XI,ROOM_EXAMPLE_TEMPERATURE_SOURCES:()=>YI,ROOM_OCCUPANCY_WINDOW_MS:()=>JI,ROOT_BUCKET_KEY:()=>yo,RUNTIME_DEFAULTS:()=>UL,RUNTIME_STATE_POLICY:()=>Hz,RUNTIME_STATE_REFRESH_MISS_COOLDOWN_MS:()=>nz,RUNTIME_TO_FORMAT:()=>dG,RawStateResultSchema:()=>IO,ReadGopBytesResultSchema:()=>bN,ReadSegmentBytesResultSchema:()=>yN,ReadWindowBytesResultSchema:()=>xN,ReadinessRegistry:()=>No,ReadinessTimeoutError:()=>Oo,RebuildObjectEmbeddingsRefusalSchema:()=>kx,RecentTracksPageSchema:()=>sx,RecentTracksQueryInput:()=>$b,RecordTriggerSchema:()=>WN,RecordWindowSchema:()=>GN,RecordingAvailabilityForDeviceSchema:()=>iN,RecordingAvailabilitySchema:()=>YM,RecordingBandAudioSchema:()=>bi,RecordingBandModeSchema:()=>vi,RecordingBandSchema:()=>xi,RecordingBandTriggersSchema:()=>yi,RecordingConfigSchema:()=>Ei,RecordingDaysForDeviceSchema:()=>aN,RecordingDaysSchema:()=>XM,RecordingDeviceUsageSchema:()=>oN,RecordingLocationUsageSchema:()=>sN,RecordingManifestSchema:()=>ZM,RecordingObjectTriggerClassSchema:()=>hi,RecordingOnboardOptionsSchema:()=>eP,RecordingOnboardPatchSchema:()=>tP,RecordingOnboardStatusSchema:()=>YN,RecordingPlaybackSchema:()=>tN,RecordingRangeSchema:()=>qM,RecordingReadSchema:()=>JM,RecordingRebalanceInputSchema:()=>pN,RecordingRebalanceMoveSchema:()=>lN,RecordingRebalancePlanSchema:()=>fN,RecordingRebalanceSkipReasonSchema:()=>uN,RecordingRebalanceSkipSchema:()=>dN,RecordingRetentionSchema:()=>Ti,RecordingSignalRuntimeStateSchema:()=>xP,RecordingSignalStatusSchema:()=>bP,RecordingSourceAvailabilitySchema:()=>QM,RecordingSourceOptionsSchema:()=>eN,RecordingSourceSchema:()=>$M,RecordingStatusSchema:()=>rN,RecordingStorageModeSchema:()=>mi,RecordingStorageUsageSchema:()=>cN,RecordingTriggersSchema:()=>_i,RecordingWeekdaySchema:()=>fi,RedirectLoginMethodSchema:()=>Uh,RelocatableMediaCountInputSchema:()=>va,RelocatableMediaCountSchema:()=>_a,RelocateFootageClassSchema:()=>Ri,RelocateFootageInputSchema:()=>zi,RelocateJobSchema:()=>Li,RelocateJobStateSchema:()=>Ii,RelocateMediaInputSchema:()=>Hi,RelocateResidueInputSchema:()=>la,RelocateResidueSchema:()=>ua,RenderedAsSchema:()=>Xg,ReportMotionInputSchema:()=>JS,ReportedFailureContributionSchema:()=>LF,ReportedLoadContributionSchema:()=>IF,RequestCensusGroupSchema:()=>bF,RequestCensusProcedureSchema:()=>xF,RequestCensusSnapshotSchema:()=>SF,RequestCensusStatusSchema:()=>CF,RetrainAnnotationDraftSchema:()=>zb,RetrainAnnotationKindSchema:()=>Fb,RetrainAnnotationSchema:()=>Rb,RetrainAnnotationSourceSchema:()=>Ib,RetrainAssistResultSchema:()=>qb,RetrainAssistSubjectSchema:()=>Kb,RetrainCopyRefusalSchema:()=>Ub,RetrainFrameCandidateSchema:()=>Vb,RetrainFrameListSchema:()=>Gb,RetrainFrameSchema:()=>Hb,RetrainFrameSelectionSchema:()=>Wb,RetrainMacroClassSchema:()=>Pb,RetrainStatusSchema:()=>db,RetrainTrackSchema:()=>Bb,RetrainTransitionResultSchema:()=>Jb,RingBuffer:()=>aG,RtpSourceSchema:()=>Qu,RtspRestreamEntrySchema:()=>Bu,RunnerCameraConfigSchema:()=>QS,RunnerCameraDeviceUIFields:()=>$S,RunnerFrameSourceSchema:()=>YS,RunnerInferenceDeviceSchema:()=>ZS,RunnerJumpStepProvisioningSchema:()=>XS,RunnerLocalLoadSchema:()=>eC,RunnerLocalMetricsSchema:()=>rC,SCENE_CONDITIONS:()=>EP,SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX:()=>448,SCENE_CONFIRM_DEFAULT_TIMEOUT_MS:()=>IP,SCENE_DEFAULT_ANCHOR_THRESHOLD:()=>PP,SCENE_DEFAULT_CHECK_INTERVAL_SEC:()=>60,SCENE_DEFAULT_OBSERVATION_SPACING_SEC:()=>120,SCENE_DEFAULT_QUIET_SECONDS:()=>60,SCENE_DEFAULT_UNCOVERED_POLICY:()=>FP,SCENE_DIVERGED:()=>OP,SCENE_RESET_RECAPTURES:()=>!0,SCOPE_PRESETS:()=>qz,SENSOR_FEATURES:()=>SR,SENSOR_MAP:()=>wR,SHARE_VIEW_KINDS:()=>On,SOURCE_CAPS:()=>eE,SOURCE_CAP_ACTIVE_FIELD:()=>QT,SOURCE_CAP_CHANGED_AT_FIELD:()=>$T,SOURCE_DEVICE_TYPES:()=>tE,SOURCE_INFO_METADATA_KEY:()=>dp,STATIONARY_OVERLAY_STYLE:()=>Bo,STORAGE_ACCESS_FALLBACK:()=>qa,STORAGE_BYTES_PER_GB:()=>Ua,STORAGE_LOCATION_MODES:()=>Ta,STREAM_PROFILE_META:()=>aF,STREAM_QUALITY_LABELS:()=>_r,SUB_DETECTION_TYPES:()=>Ca,SUMMARIES_DEFAULT_LIMIT:()=>50,SUMMARIES_MAX_LIMIT:()=>200,SYSTEM_CAP_NAMES:()=>Iz,SYSTEM_SCOPE_DEVICE_METHODS:()=>Rz,SceneCheckSchema:()=>NP,SceneConditionSchema:()=>TP,SceneConfirmSchema:()=>LP,SceneMonitorSchema:()=>RP,SceneMonitorStateSchema:()=>MP,SceneMonitorStatusForDeviceSchema:()=>BP,SceneMonitorStatusSchema:()=>zP,SceneReferenceSchema:()=>jP,SceneUnavailableSchema:()=>AP,SceneUncoveredPolicySchema:()=>DP,SceneVerdictSchema:()=>kP,ScopedTokenSchema:()=>wy,ScopedTokenSummarySchema:()=>nI,ScoredObjectEventSchema:()=>vx,ScriptRunnerStatusSchema:()=>GP,SearchResultSchema:()=>fD,SendEmailInputSchema:()=>dw,SendEmailResultSchema:()=>fw,SendResultSchema:()=>Zg,SensorEventSchema:()=>ib,ServerBootModeSchema:()=>ZC,ServerPackageStatusSchema:()=>aw,ServerRollbackInfoSchema:()=>iw,ServerUpdateActionResultSchema:()=>cw,ServerUpdateCheckResultSchema:()=>ow,ServerUpdateOutcomeSchema:()=>sw,ServerUpdateStateSchema:()=>QC,SetLoggingSettingsInputSchema:()=>zF,SetSiteLocationInputSchema:()=>_F,SettingsPatchSchema:()=>sl,SettingsRecordSchema:()=>zf,SettingsSchemaWithValuesSchema:()=>I,SettingsUpdateResultSchema:()=>cl,ShmRingStatsSchema:()=>Jf,SiteLocationSchema:()=>hF,SiteLocationSourceSchema:()=>mF,SiteLocationStatusSchema:()=>gF,SiteZoneSchema:()=>Kp,SmokeStatusSchema:()=>qP,SmtpStatusSchema:()=>pw,SnapshotImageSchema:()=>hw,SourceInfoSchema:()=>sp,SpatialDetectionSchema:()=>Al,SsoBridgeClaimsSchema:()=>vw,StartEmbeddedInputSchema:()=>Ag,StationaryObjectSchema:()=>wI,StorageAbortUploadInputSchema:()=>Pw,StorageAccessSchema:()=>Ka,StorageBeginDownloadInputSchema:()=>Fw,StorageBeginDownloadResultSchema:()=>Iw,StorageBeginUploadInputSchema:()=>Aw,StorageBeginUploadResultSchema:()=>jw,StorageCleanupInputSchema:()=>ba,StorageCleanupJobSchema:()=>xa,StorageCleanupPhaseSchema:()=>ya,StorageCleanupStatusInputSchema:()=>Sa,StorageDrainProgressSchema:()=>Ga,StorageEndDownloadInputSchema:()=>Rw,StorageEvictionPolicySchema:()=>Da,StorageFinalizeUploadInputSchema:()=>Nw,StorageLocationDeclarationSchema:()=>Ja,StorageLocationModeSchema:()=>Ea,StorageLocationRefSchema:()=>D,StorageLocationSchema:()=>E,StorageLocationTypeSchema:()=>Ba,StorageMigrationClassSchema:()=>Ki,StorageMigrationDestinationsSchema:()=>qi,StorageMigrationDrainInputSchema:()=>ca,StorageMigrationFindingCodeSchema:()=>na,StorageMigrationFindingSchema:()=>ra,StorageMigrationFootageMoveInputSchema:()=>Bi,StorageMigrationInputSchema:()=>Xi,StorageMigrationJobSchema:()=>ta,StorageMigrationLaneSchema:()=>aa,StorageMigrationLeaseInputSchema:()=>T,StorageMigrationMediaMoveInputSchema:()=>Gi,StorageMigrationModeSchema:()=>Yi,StorageMigrationMoveProgressSchema:()=>$i,StorageMigrationMoveSchema:()=>ea,StorageMigrationMoverSchema:()=>oa,StorageMigrationParticipantSchema:()=>Qi,StorageMigrationPhaseSchema:()=>Zi,StorageMigrationPlanSchema:()=>ia,StorageMigrationResidueSchema:()=>sa,StorageMigrationSourcesSchema:()=>Ji,StorageOccupancyReportSchema:()=>Ew,StorageProviderInfoSchema:()=>Ow,StorageReadChunkInputSchema:()=>Lw,StorageTestLocationResultSchema:()=>kw,StorageWriteChunkInputSchema:()=>Mw,StreamCodecSchema:()=>id,StreamFormatSchema:()=>Fu,StreamNetworkStatsSchema:()=>$A,StreamParamsOptionsSchema:()=>nF,StreamParamsStatusSchema:()=>eF,StreamProfileConfigSchema:()=>$P,StreamProfileOptionsSchema:()=>tF,StreamProfilePatchSchema:()=>rF,StreamProfileSchema:()=>QP,StreamSignalSchema:()=>Bw,StreamSignalsStatusSchema:()=>Vw,StreamSourceEntrySchema:()=>Kr,StreamSourceSchema:()=>qr,SubscribeAudioChunksInputSchema:()=>ti,SubscribeAudioChunksResultSchema:()=>ni,SubscribeFramesInputSchema:()=>Zr,SubscribeFramesResultSchema:()=>Qr,SummarySchema:()=>ex,SwitchStatusSchema:()=>lF,SystemMetricsSchema:()=>fg,SystemMirror:()=>dz,TAXONOMY_COLORS:()=>U,TIMELAPSE_DENSE_FLOOR_SEC:()=>JH,TIMEZONES:()=>$a,TRANSCODE_DOWN_MAX_BITRATE_KBPS:()=>400,TRANSCODE_DOWN_MAX_HEIGHT:()=>360,TamperStatusSchema:()=>HF,TankStatusSchema:()=>uI,TargetKindCapsSchema:()=>Gg,TargetKindLevelSchema:()=>Wg,TargetKindSchema:()=>qg,TargetSchema:()=>Jg,TemperatureSensorStatusSchema:()=>WF,TerminalInstanceInfoSchema:()=>qw,TerminalLegacyCameraSchema:()=>Jw,TerminalOutputBatchSchema:()=>Xw,TerminalOutputEventSchema:()=>Yw,TerminalProfileInfoSchema:()=>Kw,TerminalSessionInfoSchema:()=>Gw,TestConnectionResultSchema:()=>jk,TestConnectionStatusEnum:()=>Ak,TestResultSchema:()=>Qg,TimelapseRuleInputSchema:()=>eU,TimelapseRulePatchSchema:()=>nU,TimelapseRuleSchema:()=>rU,TimelapseTemplateSchema:()=>VH,ToastSchema:()=>KF,TokenScopeSchema:()=>G,TopologyNodeSchema:()=>cj,TopologyProcessSchema:()=>ij,TopologyServiceSchema:()=>rj,TrackCascadeCountsSchema:()=>bx,TrackEnvelopeSchema:()=>sb,TrackFlagsPatchSchema:()=>mb,TrackFlagsSchema:()=>hb,TrackProjectionSchema:()=>cb,TrackSchema:()=>xb,TrackSourceSchema:()=>ub,TrackStateSchema:()=>Xy,TrackZoneFilterSchema:()=>Qy,TrackedDetectionSchema:()=>gx,TrainingExportDeviceTotalsSchema:()=>yb,TrainingExportSummarySchema:()=>bb,TransportPlaneCountsSchema:()=>yF,TransportPlaneSchema:()=>vF,TurnServerSchema:()=>Qw,UNATTRIBUTED_BUCKET_KEY:()=>vo,UNIT_TABLE:()=>cW,UnifiedBrokerInfoSchema:()=>mu,UnitConversionError:()=>lW,UnstampedEventMediaCountSchema:()=>Wi,UnstampedRowsSchema:()=>Ui,UpdateIntegrationInputSchema:()=>Nk,UpdateStatusSchema:()=>JF,UpdateUserInputSchema:()=>QF,UserRecordSchema:()=>Sy,UserSummarySchema:()=>XF,VECTOR_INDEX_DIM_CONFLICT:()=>xT,VIDEOCLIPS_MAX_OFFER_BYTES:()=>RT,VIDEOCLIPS_MAX_READ_BYTES:()=>LT,VISIT_MERGE_GAP_MS:()=>wi,VacuumControlStatusSchema:()=>dI,VacuumStateSchema:()=>lI,ValveStateSchema:()=>pI,ValveStatusSchema:()=>mI,VectorDeclareIndexInputSchema:()=>sT,VectorDeleteByFilterInputSchema:()=>pT,VectorDeleteInputSchema:()=>fT,VectorDeleteResultSchema:()=>mT,VectorFilterSchema:()=>iT,VectorGetInputSchema:()=>hT,VectorGetResultSchema:()=>gT,VectorItemSchema:()=>aT,VectorMatchSchema:()=>oT,VectorMetadataSchema:()=>rT,VectorMetricSchema:()=>nT,VectorQueryInputSchema:()=>uT,VectorQueryResultSchema:()=>dT,VectorStatsInputSchema:()=>wT,VectorStatsResultSchema:()=>TT,VectorUpsertInputSchema:()=>cT,VectorUpsertResultSchema:()=>lT,VibrationStatusSchema:()=>gI,VideoEncodeSchema:()=>ft,WEBRTC_CLIMB_HOLD_CODES:()=>BE,WEBRTC_EGRESS_PROFILE:()=>Kt,WEBRTC_TRY_BLOCKERS:()=>VE,WEEKLY_MASK_LENGTH:()=>168,WELL_KNOWN_TABS:()=>Re,WELL_KNOWN_TAB_MAP:()=>ze,WaterHeaterStatusSchema:()=>vI,WeatherStatusSchema:()=>bI,WebrtcClimbHoldSchema:()=>HE,WebrtcLadderDecisionSchema:()=>zE,WebrtcSessionDebugSchema:()=>WE,WebrtcStreamChoiceSchema:()=>RE,WebrtcStreamTargetSchema:()=>LE,WebrtcTierFailureSchema:()=>UE,WhiteBalanceModeSchema:()=>yk,WidgetHostEnum:()=>ul,WidgetLoginMethodSchema:()=>Wh,WidgetMetadataSchema:()=>pl,WidgetRemoteSchema:()=>fl,WidgetSizeEnum:()=>dl,WrapperEvidenceSchema:()=>nw,WrapperIdentitySchema:()=>rw,WrapperKindSchema:()=>tw,YAMNET_TO_MACRO:()=>o_,ZoneCrossingDirectionSchema:()=>Tb,ZoneCrossingSchema:()=>Eb,ZoneKindEnum:()=>CS,ZoneRuleModeEnum:()=>HP,ZoneRuleSchema:()=>UP,ZoneRuleStageEnum:()=>jI,ZoneRulesArraySchema:()=>WP,ZoneSchema:()=>TS,ZoneScopeBreakdownSchema:()=>CI,__resetLogChannelRegistryForTests:()=>lo,accessoriesCapability:()=>qE,accessoryStableId:()=>GL,addonPagesCapability:()=>Qc,addonPagesSourceCapability:()=>el,addonRoutesCapability:()=>il,addonSettingsCapability:()=>ll,addonWidgetsCapability:()=>gl,addonWidgetsSourceCapability:()=>ml,addonsCapability:()=>TD,adminUiCapability:()=>yl,airQualitySensorCapability:()=>DD,alarmPanelCapability:()=>O_,alertsCapability:()=>wl,ambientLightSensorCapability:()=>kD,asBoolean:()=>LW,asJsonArray:()=>PW,asJsonObject:()=>NW,asNumber:()=>IW,asString:()=>FW,assertTimelapseCadences:()=>iU,audioAnalysisCapability:()=>Dl,audioAnalyzerCapability:()=>Wl,audioChunkBytesPerSample:()=>ye,audioCodecCapability:()=>Ql,audioIsFailClosed:()=>cB,audioKindId:()=>nB,audioLabelChoices:()=>fB,audioMetricsCapability:()=>PD,audioModeOf:()=>sB,audioOrDefaults:()=>oB,audioPlanFromEncodeProfile:()=>Ut,audioScaleEraOf:()=>$z,authProviderCapability:()=>eu,autoAssignProfiles:()=>Er,automationControlCapability:()=>ID,backupCapability:()=>fu,bareAddonId:()=>CW,batteryCapability:()=>RD,bestLocationMatch:()=>xW,binaryCapability:()=>BD,bindAddonActions:()=>wG,brightnessCapability:()=>HD,brokerCapability:()=>Nu,buildAddonRouteProvider:()=>st,buildAudioArgs:()=>jt,buildCapabilityLookup:()=>bL,buildDeviceAdminUrl:()=>ap,buildEventKindDescriptor:()=>XC,buildFfmpegArgs:()=>Bt,buildInputArgs:()=>Tt,buildModelVariantGroups:()=>Qo,buildNcTaxonomy:()=>C_,buildRoleScopes:()=>GU,buildStreamParamsConfigSchema:()=>sF,buildVideoArgs:()=>At,buttonCapability:()=>UD,cameraCredentialsCapability:()=>KD,cameraGridLayoutCapability:()=>QD,cameraPipelineConfigCapability:()=>Pu,cameraStreamsCapability:()=>cd,canConvertUnit:()=>gW,canonicalEgressPlan:()=>fn,carbonMonoxideCapability:()=>eO,cellsToRects:()=>iG,classifyBearerPrincipal:()=>Ts,classifyStream:()=>xr,classifyStreams:()=>br,climateControlCapability:()=>rO,clipExportFailure:()=>PN,clipExportFailureOf:()=>FN,clipReasonHeaderValue:()=>AT,clusterModelSettingKey:()=>Ay,clusterStepSettingFieldsFor:()=>Wy,clusterStepSettingKey:()=>Uy,codecIsAccepted:()=>vt,collectHydratedFieldEntries:()=>Ve,collectHydratedFieldValues:()=>Ue,collectSecretConfigKeys:()=>rr,colorCapability:()=>cO,colorForKind:()=>v_,commitWatchdogRestart:()=>QW,compareToTarget:()=>gt,compileExpression:()=>$s,compileExpressionSafe:()=>ec,composeSwitchedOff:()=>er,composedDeviceRef:()=>Gd,composedDeviceStableId:()=>Wd,composerCapability:()=>kf,compositionEdges:()=>HI,compositionReadKey:()=>Ud,compositionSliceKey:()=>Hd,compositionSourceKey:()=>B,compositionSourceRefs:()=>ML,conditionDepth:()=>Ec,conditionExclusionReason:()=>bV,conditionVisibleForKind:()=>yV,connectionTestCapability:()=>pO,connectivityCapability:()=>hO,consumableLowPercentOf:()=>q_,consumablesCapability:()=>vO,contactCapability:()=>bO,controlCapability:()=>wO,convertUnit:()=>mW,coreBlockAddonId:()=>sf,coreBlockComposition:()=>hf,coreBlockIdFromAddonId:()=>cf,coreBlockSourceKind:()=>mf,coreBlocksCapability:()=>Sf,cosineSimilarity:()=>DW,countConditionLeaves:()=>Dc,coverCapability:()=>DO,createDeviceExtensionProvider:()=>RI,createDeviceProxy:()=>az,createDurableState:()=>Ze,createEvent:()=>Ye,createEventBusSliceSource:()=>NR,createExpressionScope:()=>nc,createHwAccelCache:()=>tn,createLazyTrpcSource:()=>MR,createLogChannelsProvider:()=>fo,createMirrorSource:()=>PR,createRuntimeStateBridge:()=>iz,createSliceHandle:()=>X,createSystemProxy:()=>Jz,customAction:()=>jf,customModelRegistryCapability:()=>Ff,dataStoreProviderCapability:()=>Gf,dayNightCapability:()=>NO,dayOfWeekToIndex:()=>vP,declarationOwnerNodeId:()=>hR,declareLogChannel:()=>co,decodeVectorBase64:()=>yG,decoderCapability:()=>Yf,defaultDeliveryForSection:()=>MV,defaultDeviceFor:()=>MG,defineCustomActions:()=>Af,defineExtensionSlotProvider:()=>II,deriveBatteryPresence:()=>iR,deriveCameraSwitches:()=>Qn,deriveDetailCropRect:()=>vU,deriveRecordingMode:()=>Di,describeCustomActions:()=>Nf,describeModelVariant:()=>es,describeOnboardClamp:()=>yP,describeOnboardRefusal:()=>aP,describeStateField:()=>_L,describeSystemEventDeliveryProblem:()=>kH,describeSystemEventFamilyProblem:()=>eV,describeTopLevelStateFields:()=>vL,detectAccessRole:()=>qU,detectionPipelineCapability:()=>Xf,deviceAdminLinkCapability:()=>$f,deviceAdoptionCapability:()=>kp,deviceBackendToFormat:()=>uG,deviceCustomAction:()=>Mf,deviceDiscoveryCapability:()=>gp,deviceExportCapability:()=>Rp,deviceExtensionCapability:()=>ME,deviceManagerCapability:()=>Cm,deviceMatchesProfile:()=>DR,deviceOpsCapability:()=>LO,deviceProviderCapability:()=>em,deviceSelectorMatches:()=>YU,deviceStateCapability:()=>wm,deviceStatusCapability:()=>zO,displayIconEntry:()=>HR,displayIconsInGroup:()=>UR,doorbellCapability:()=>dE,droppedConditionsForKind:()=>xV,egressTranscodeSharingKey:()=>pn,egressTransportFromRequest:()=>cn,embeddingEncoderCapability:()=>Hm,embeddingModelFailedError:()=>Fm,embeddingModelFailedOf:()=>Vm,embeddingRefusalOf:()=>zm,embeddingRequirementsFailedError:()=>Lm,embeddingRequirementsUnavailableError:()=>Im,emitDownForOwnedCaps:()=>Fo,emitReadiness:()=>Xe,emitsCollectionSelector:()=>ld,encodeProfileFromStreamShape:()=>ht,encodeVectorBase64:()=>vG,enumSensorCapability:()=>HO,enumerateInferenceDevices:()=>LG,enumerateItemArrayFields:()=>hL,enumerateSchemaFields:()=>mL,errMsg:()=>AW,evaluateAst:()=>uc,evaluateCompositionField:()=>qI,evaluateExpressionSource:()=>pc,evaluatePoolMemory:()=>ZW,evaluateSensorEdge:()=>oE,evaluateZoneRules:()=>xG,event:()=>F,eventEmitterCapability:()=>GO,evictionPolicyForMode:()=>ja,evictionPolicyOfLocation:()=>La,expandAudioChunkToF32le:()=>be,expandCapMethods:()=>Kc,expandContainer:()=>fR,exportSubjectOf:()=>HN,extensionSlotRef:()=>LI,extractNestedAddonId:()=>hd,extractSourceInfoFromMetadata:()=>fp,faceGalleryCapability:()=>nk,failureContributionCapability:()=>Gm,failureRate:()=>_o,fanControlCapability:()=>ak,featureProbeCapability:()=>sk,fieldReads:()=>Kd,filesystemBrowseCapability:()=>Jm,findCompositionCycles:()=>UI,findTimezone:()=>eo,floodCapability:()=>lk,foldSnapshotByFunction:()=>So,formatForRuntime:()=>pG,formatMediaOwnerKey:()=>Ae,formatMinutes:()=>dP,formatParkedFor:()=>Vo,gasCapability:()=>dk,gbToBytes:()=>Wa,generateAutomationBlock:()=>Pc,getAudioMacroClassIds:()=>u_,getByPath:()=>YR,getCapsByProviderKind:()=>Vz,getLogChannelRegistry:()=>so,getTaxonomyEntry:()=>__,hasMotionTrigger:()=>xR,hfModelUrl:()=>jW,htmlToText:()=>OB,humidifierCapability:()=>pk,humiditySensorCapability:()=>hk,hydrateSchema:()=>Ge,imageCapability:()=>_k,imageSettingsCapability:()=>Ek,inferExpressionKinds:()=>dL,inferModelProvider:()=>ms,initialPoolMemoryState:()=>KW,integrationsCapability:()=>Fk,intercomCapability:()=>zk,interpretStoredClusterModel:()=>Ny,invalidClusterStepModelEntries:()=>Py,invocationFromEncodeProfile:()=>Wt,isAgentOnlyPlacement:()=>Sn,isArrayOutputSchema:()=>fd,isAudioChunkFormat:()=>ve,isAudioLabelSelected:()=>pB,isAudioRule:()=>TV,isBaseConditionKey:()=>TB,isBatteryPresenceFault:()=>aR,isClusterScopedStep:()=>jy,isCollectionArrayMethod:()=>pd,isDeployableToAgent:()=>xn,isDetectionMacroClass:()=>r_,isDeviceConfigCap:()=>Yc,isDeviceScopedCap:()=>Mz,isDisplayIconKey:()=>VR,isEmbeddingModelFailed:()=>Bm,isEvent:()=>Je,isEventOwnerType:()=>Ie,isFirstLevelMacroClass:()=>li,isHeldBackTemplateVar:()=>gH,isIsolatedBuiltin:()=>En,isKnownTemplateVar:()=>CH,isLocationEnabled:()=>Ha,isMediaOwnerType:()=>Oe,isNode:()=>TR,isObjectInput:()=>dd,isOccupancyRule:()=>EV,isRestoredCap:()=>Gz,isSameAddonId:()=>wW,isScheduleActive:()=>BV,isSecretConfigField:()=>nr,isSoftwareDecode:()=>wt,isSourceCap:()=>nE,isStorageLocationMode:()=>Pa,isSystemDelivery:()=>gV,isSystemEventFamily:()=>WB,isSystemEventSummaryRule:()=>EH,isSystemRuleKind:()=>nV,isVectorIndexDimConflict:()=>CT,isVoidInput:()=>ud,ituDbfsFromPreEpoch:()=>Qz,jobKindSchema:()=>JE,kebabToCamel:()=>xd,kindOfValue:()=>rL,kindsForDiscriminator:()=>mV,knownValues:()=>SB,lawnMowerControlCapability:()=>Uk,legacyAutoLinkIds:()=>pR,legacyModeOf:()=>Ma,lifecycleJobSchema:()=>tD,lifecycleJobScopeSchema:()=>eD,lifecycleJobStateSchema:()=>$E,lifecycleTaskSchema:()=>QE,llmCapability:()=>Mh,llmRuntimeCapability:()=>yh,loadContributionCapability:()=>Ih,localNetworkCapability:()=>nA,locationIconKey:()=>Up,locationSimilarity:()=>bW,lockControlCapability:()=>aA,logBannerArgs:()=>Ct,logChannelsCapability:()=>Rh,logDestinationCapability:()=>Vh,logLevelAtMost:()=>kr,loginMethodCapability:()=>qh,looseSchema:()=>md,makeProfileBrokerId:()=>Hr,makeSourceBrokerId:()=>Ur,mapAudioLabelToMacro:()=>l_,markdownToHtmlLite:()=>MB,markdownToText:()=>EB,maskUrlCredentials:()=>HW,mayReadLocation:()=>Ia,mayWriteToLocation:()=>Fa,mediaPlayerCapability:()=>uA,mergeSourceInfo:()=>lp,meshNetworkCapability:()=>mA,method:()=>P,methodAccessForHttpMethod:()=>Ss,metricsProviderCapability:()=>pg,migrateLegacyDeviceSignalConfig:()=>Fi,minutesToTimeOfDay:()=>_P,modeMayRead:()=>Aa,modeMayWrite:()=>ka,modelConvertCapability:()=>hg,modelDistributorCapability:()=>vg,modelFormatForRuntime:()=>NG,motionCapability:()=>vA,motionDetectionCapability:()=>xg,motionTriggerCapability:()=>xA,motionZonesCapability:()=>EA,mqttBrokerCapability:()=>Ng,nativeObjectDetectionCapability:()=>PA,navigationCapability:()=>KA,networkAccessCapability:()=>Lg,networkLinkCapability:()=>QA,networkQualityCapability:()=>nj,nodePickerItems:()=>FH,nodePin:()=>Ic,nodesCapability:()=>bj,normalizeAddonInitResult:()=>ot,normalizeAudioLabel:()=>tB,normalizeNodeId:()=>Qe,normalizeTokenScopes:()=>tW,normalizeUnit:()=>up,notificationOutputCapability:()=>$g,notificationRulesCapability:()=>my,notifierCapability:()=>Dj,numericSensorCapability:()=>kj,oauthIntegrationCapability:()=>Ey,objectInputDeclaresAddonId:()=>gd,objectInputDeclaresRequiredDeviceId:()=>_d,occupancyScope:()=>Ix,optionalMethod:()=>Jc,osdCapability:()=>Fj,osdManagerCapability:()=>Uj,overlayClusterStepSettings:()=>Yy,packagePickerItems:()=>BH,parseAdminBase:()=>op,parseCameraStreamConfig:()=>Tr,parseExpression:()=>Xs,parseJsonArray:()=>zW,parseJsonObject:()=>RW,parseJsonUnknown:()=>MW,parseMediaOwnerKey:()=>ke,parseOccupancyScope:()=>Lx,parseProcStatus:()=>GW,parseProfileBrokerId:()=>Wr,parseRuleSection:()=>wV,parseStreamParamsFormPatch:()=>cF,patchAudio:()=>dB,petFeederCapability:()=>qj,pickAccessoryControl:()=>CR,pickClusterStepModels:()=>Ly,pickClusterStepSettings:()=>Jy,pickDetailCropConvention:()=>hU,pickInvalidClusterStepModels:()=>Ry,pickNativeLeaseOverride:()=>HU,pickPreferredRtspEntry:()=>Io,pickRestartCandidate:()=>eG,pickVideoEncoder:()=>Ht,pickerForCondition:()=>xB,pipelineAnalyticsCapability:()=>zx,pipelineExecutorCapability:()=>yS,pipelineOrchestratorCapability:()=>UC,pipelineRunnerCapability:()=>aC,planComposition:()=>jL,plateGalleryCapability:()=>$j,platformProbeCapability:()=>hM,poolMemoryThreshold:()=>YW,powerMeterCapability:()=>_M,prepareNotification:()=>zB,presenceCapability:()=>bM,pressureSensorCapability:()=>SM,principalMayReachAddon:()=>Es,privacyMaskCapability:()=>OM,procedureAuthKey:()=>bd,ptzAutotrackCapability:()=>UM,ptzCapability:()=>RM,pythonScriptForBackend:()=>mG,rankStreams:()=>bt,readClusterStepModels:()=>Fy,readClusterStepSettings:()=>Ky,readDetailCropConvention:()=>pU,readDeviceStateFrom:()=>zL,readNativeLeaseOverride:()=>zU,readNodePin:()=>Rc,readTimelapseGeneratedAt:()=>aU,readinessKey:()=>ko,rebootCapability:()=>WM,recordingArchiveCapability:()=>SN,recordingCapability:()=>nN,recordingExportCapability:()=>UN,recordingOnboardCapability:()=>nP,recordingSignalCapability:()=>SP,rectsToCells:()=>rG,reducePoints:()=>Do,requiredTopLevelKeys:()=>yL,requiresPython:()=>hG,reservedSourceOwner:()=>wP,resetPoolBaseline:()=>$W,resolveAddonExecution:()=>bn,resolveAddonGroup:()=>Cn,resolveAddonPlacement:()=>Tn,resolveBucketMs:()=>Eo,resolveCapMount:()=>Bc,resolveClipSearchMinScore:()=>os,resolveClusterStepModelId:()=>Vy,resolveContainerPrimaryChild:()=>dR,resolveCreateExportSubject:()=>VN,resolveDeviceControlKind:()=>yR,resolveDeviceProfile:()=>AR,resolveEgressDecodeHwAccel:()=>rn,resolveExportProfiles:()=>zN,resolveFormat:()=>PB,resolveHydratedFieldValue:()=>We,resolveLocationIcon:()=>Wp,resolveLocationMode:()=>Na,resolveMethodAuth:()=>yd,resolveMutate:()=>ER,resolvePoolMemoryPolicy:()=>WW,resolveRecordingProfiles:()=>ki,resolveRunnerId:()=>wn,resolveStreamMaps:()=>Et,resolveVariantModelId:()=>$o,resolveViewableDeviceIds:()=>eW,roleSpec:()=>WU,roomCompositionExample:()=>$I,ruleBelongsToAlarm:()=>GV,ruleEditorSectionsForKind:()=>FV,ruleKindOf:()=>_V,ruleKindSpec:()=>pV,ruleMatchesSection:()=>DV,ruleSection:()=>CV,ruleSectionOf:()=>OV,ruleSeedForSection:()=>jV,runInferenceStep:()=>oG,runtimeDevices:()=>jG,runtimeStatePolicyFor:()=>Uz,sceneMonitorCapability:()=>VP,scheduleForSendTimes:()=>jH,schemaDeclaresAnyField:()=>ir,scopeInherits:()=>QU,scopeKey:()=>Ao,scopesAllowAddon:()=>ws,scopesAllowDeviceCap:()=>Cs,scoreRuntimes:()=>PG,scriptRunnerCapability:()=>KP,searchDisplayIcons:()=>qR,selectAssignedProfileSlots:()=>Gr,sendTimesOfSchedule:()=>MH,sensorRaisedOf:()=>QV,sensorTransitionNeverFires:()=>qV,sensorTransitionOffered:()=>$V,servedTemplateVars:()=>hH,serverManagementCapability:()=>lw,setByPath:()=>XR,settingsStoreCapability:()=>Uf,signalPercentFromBars:()=>XA,signalPercentFromRssi:()=>ZA,siteZoneKey:()=>qp,sleep:()=>gG,sleepCancellable:()=>_G,sliceActiveValue:()=>rE,sliceChangedAt:()=>iE,smokeCapability:()=>JP,smtpProviderCapability:()=>mw,snapshotCapability:()=>_w,ssoBridgeCapability:()=>yw,startReachabilityPoll:()=>ez,stateVocabularyFor:()=>BL,stepModelRunsOnFormat:()=>sU,storageCapability:()=>xw,storageEvictableCapability:()=>ww,storageMigrationCapability:()=>Tw,storageOccupancyCapability:()=>Dw,storageProviderCapability:()=>zw,streamBrokerCapability:()=>rd,streamCatalogCapability:()=>ZP,streamParamsCapability:()=>iF,streamPixels:()=>yr,streamQualityLabel:()=>vr,streamSignalsCapability:()=>Hw,stripRetiredBandPreBufferSec:()=>Ci,strippedOfLegacyReadOnly:()=>Ra,subKindsOf:()=>y_,summarisePrivacyAudio:()=>kM,summarizeEffectiveScope:()=>oW,supportedRuntimes:()=>AG,switchCapability:()=>uF,switchedOffIds:()=>$n,synthesizeSourceInfo:()=>cp,systemCapability:()=>VF,systemEventDeliveryProblems:()=>OH,systemEventFamilyOf:()=>QB,systemEventFamilyProblems:()=>$B,systemEventFilterApplies:()=>VB,systemEventFilterAppliesToAnyKind:()=>HB,systemEventKindNamesOf:()=>ZB,systemEventKindsOfFamily:()=>XB,systemEventSummaryScheduleOf:()=>TH,systemFamilyOfKind:()=>rV,systemRuleKindOf:()=>vV,tamperCapability:()=>UF,taskLogEntrySchema:()=>ZE,taskPhaseSchema:()=>YE,taskTargetSchema:()=>XE,temperatureSensorCapability:()=>GF,templateCarriesSummary:()=>PH,templateVarDeliveryApplies:()=>_H,templateVarKindApplies:()=>bH,templateVarSystemEventApplies:()=>xH,templateVarsFor:()=>SH,terminalSessionCapability:()=>Zw,textToHtml:()=>jB,timeOfDayToMinutes:()=>gP,toDeviceSummary:()=>tR,toExpressionValue:()=>dc,toNodeId:()=>Lc,toStreamSourceEntry:()=>Sr,toastCapability:()=>qF,toggleAudioLabel:()=>mB,tokenize:()=>Us,transcodeBody:()=>FB,tryConvertUnit:()=>hW,turnProviderCapability:()=>$w,unitDimension:()=>dW,unitsForDimension:()=>_W,unreachableExtensionSlotRow:()=>EE,updateCapability:()=>YF,userManagementCapability:()=>cI,userPasskeysCapability:()=>tT,vacuumControlCapability:()=>fI,validateComposition:()=>LL,validateExpressionSource:()=>fc,validateRecipeBounds:()=>kc,valveCapability:()=>hI,vectorDimFromBase64:()=>bG,vectorIndexDimConflictError:()=>ST,vectorStoreCapability:()=>ET,vibrationCapability:()=>_I,videoclipsCapability:()=>XT,viewerUiCapability:()=>FE,waterHeaterCapability:()=>yI,weatherCapability:()=>xI,webrtcClientHintsSchema:()=>IE,webrtcSessionCapability:()=>GE,weeklyMaskIndex:()=>fP,weeklyMaskIsUniform:()=>pP,weeklyMaskToWindows:()=>mP,windowsToWeeklyMask:()=>hP,wiringAddonHealthSchema:()=>gn,wiringHealthSnapshotSchema:()=>vn,wiringNodeHealthSchema:()=>_n,wiringProbeKindSchema:()=>mn,wiringProbeResultSchema:()=>hn,withLocationMode:()=>za,zodEntriesToConfigUI:()=>_z,zoneAnalyticsCapability:()=>AI,zoneRulesCapability:()=>MI,zonesCapability:()=>ES});export{rB as $,Tl as $t,$V as A,Ve as An,fE as At,pV as B,Uv as Bt,mH as C,ci as Cn,oR as Ct,bH as D,Gr as Dn,KM as Dt,_H as E,Ur as En,rN as Et,xV as F,Oy as Ft,UB as G,ah as Gt,jV as H,d_ as Ht,gV as I,Ay as It,WB as J,Wp as Jt,JB as K,zp as Kt,nV as L,Wy as Lt,qV as M,MT as Mt,kV as N,jT as Nt,xH as O,Xn as On,pA as Ot,yV as P,kT as Pt,xB as Q,hu as Qt,wV as R,Ly as Rt,PH as S,ki as Sn,pR as St,gH as T,C as Tn,BL as Tt,rV as U,g_ as Ut,DV as V,T_ as Vt,vV as W,Fg as Wt,TB as X,Fp as Xt,HB as Y,Np as Yt,SB as Z,sf as Zt,wH as _,eo as _n,qR as _t,_W as a,Dc as an,oB as at,MH as b,Ei as bn,_R as bt,UU as c,Qo as cn,mB as ct,WU as d,Bo as dn,Pz as dt,R as en,iB as et,tU as f,Vo as fn,Nz as ft,BH as g,$a as gn,IR as gt,FH as h,So as hn,az as ht,dW as i,Ec as in,sB as it,JV as j,Le as jn,QT as jt,eH as k,ze as kn,mE as kt,GU as l,es as ln,Jz as lt,rU as m,vo as mn,dz as mt,gW as n,Pc as nn,cB as nt,tW as o,kc as on,pB as ot,JH as p,yo as pn,Az as pt,YB as q,Up as qt,hW as r,Tc as rn,fB as rt,eW as s,fs as sn,dB as st,RG as t,L as tn,aB as tt,qU as u,$o as un,zz as ut,kH as v,Na as vn,MR as vt,pH as w,Fr as wn,dR as wt,OH as x,Di as xn,yR as xt,jH as y,Si as yn,X as yt,_V as z,U_ as zt};
|