@camstack/addon-admin-ui 1.2.408 → 1.2.409

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/assets/{AddonAssetIcon-BLwkjQWE.js → AddonAssetIcon-KJCtp42U.js} +1 -1
  2. package/dist/assets/{Addons-D52f_uYH.js → Addons-Cf-Dyck1.js} +1 -1
  3. package/dist/assets/{AdminPage-C3szDdOE.js → AdminPage-R4K39PzI.js} +1 -1
  4. package/dist/assets/{AdminSectionedPage-BFugqNTw.js → AdminSectionedPage-BoWdF1ZC.js} +1 -1
  5. package/dist/assets/{AiProfiles-pus6NPUK.js → AiProfiles-BP3poExj.js} +1 -1
  6. package/dist/assets/{BrokerForm-T4U4b2BE.js → BrokerForm-C1K8cn2X.js} +1 -1
  7. package/dist/assets/{Build-NHWOrbHA.js → Build-BLkaHIJM.js} +1 -1
  8. package/dist/assets/{Calendars-IYwevxka.js → Calendars-C4QYfydi.js} +1 -1
  9. package/dist/assets/{Cluster-CkYt1csf.js → Cluster-Bd-CmBSd.js} +1 -1
  10. package/dist/assets/{ClusterStepModel-GNDU-ZcJ.js → ClusterStepModel-CIfgLb6o.js} +1 -1
  11. package/dist/assets/{CompositionEditor-D5V0dwhO.js → CompositionEditor-Bx2LmaUP.js} +1 -1
  12. package/dist/assets/{CompositionEditorPage-w2YVxukx.js → CompositionEditorPage-D8jTF1c4.js} +1 -1
  13. package/dist/assets/{Data-B7_MAROG.js → Data-Czxp6lZi.js} +1 -1
  14. package/dist/assets/{DeviceDetail-DVIJu4FQ.js → DeviceDetail-B3Wc5I0m.js} +1 -1
  15. package/dist/assets/{DeviceDoActionFields-DLL7B7i4.js → DeviceDoActionFields-C1jGp-mA.js} +1 -1
  16. package/dist/assets/{Devices-CZy1-Qss.js → Devices-_dbgbucP.js} +1 -1
  17. package/dist/assets/{EmbedPlayerPage-BgAP48-B.js → EmbedPlayerPage-DGzoqqeD.js} +1 -1
  18. package/dist/assets/{Identity-BYaivH6P.js → Identity-3mHyrOOC.js} +1 -1
  19. package/dist/assets/{IntegrationDetail-D8EHfYY6.js → IntegrationDetail-DDeDSMEg.js} +1 -1
  20. package/dist/assets/{IntegrationHub-CfS3GL56.js → IntegrationHub-D-aRvLOD.js} +1 -1
  21. package/dist/assets/{Integrations-C_xqLVFS.js → Integrations-CZaPcjNr.js} +1 -1
  22. package/dist/assets/{Integrations-ByqVGp79.js → Integrations-iSBQbbQt.js} +1 -1
  23. package/dist/assets/{Library-CZKY1bUv.js → Library-Dvfx2TdY.js} +1 -1
  24. package/dist/assets/{Locations-C_OzQUT_.js → Locations-BLp4xpak.js} +1 -1
  25. package/dist/assets/{Logs-Bpno4mYD.js → Logs-CiWybGXO.js} +1 -1
  26. package/dist/assets/{MotionZonesSettings-BOjjVP-t.js → MotionZonesSettings-DhMK0JPN.js} +1 -1
  27. package/dist/assets/{MyAccess-OCN76tNA.js → MyAccess-BFtpfycT.js} +1 -1
  28. package/dist/assets/{Network-iMLTt5l9.js → Network-Bh_tfjTi.js} +1 -1
  29. package/dist/assets/{NodeAddonsSettingsPanel-BPskK6pH.js → NodeAddonsSettingsPanel-DO4Hfmpb.js} +1 -1
  30. package/dist/assets/{Notifications-Ce0pqdtL.js → Notifications-DUDKlbWb.js} +1 -1
  31. package/dist/assets/{PrivacyMaskSettings-C1VATdu_.js → PrivacyMaskSettings-Cak09YC0.js} +1 -1
  32. package/dist/assets/{Recordings-nqvEkk61.js → Recordings-BhQgjum7.js} +1 -1
  33. package/dist/assets/{ScanNetworkModal-DUVTE3Im.js → ScanNetworkModal-B2ilodO7.js} +1 -1
  34. package/dist/assets/{SceneMonitorEditor-BlcjCdA1.js → SceneMonitorEditor-CZ5solPA.js} +1 -1
  35. package/dist/assets/{SessionsList-OyXBcXmT.js → SessionsList-DPlgw82K.js} +1 -1
  36. package/dist/assets/{Showroom-DLLLqI4K.js → Showroom-Cb5NnI-I.js} +1 -1
  37. package/dist/assets/{System-QAk8r2mB.js → System-_78LWf0j.js} +1 -1
  38. package/dist/assets/{Terminal-DZBRyXl9.js → Terminal-Dpp6Pvp9.js} +1 -1
  39. package/dist/assets/{Viewer-mCav7054.js → Viewer-Bln4zwVN.js} +1 -1
  40. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-puOnSTWB.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-C2E5u9h7.js} +1 -1
  41. package/dist/assets/{archive-fkNkEIJ-.js → archive-DYTHbsU8.js} +1 -1
  42. package/dist/assets/{authed-media-D_jDcXh-.js → authed-media-D-WNx3kT.js} +1 -1
  43. package/dist/assets/{boxes-ej4N5fc9.js → boxes-2Ii8Cw-P.js} +1 -1
  44. package/dist/assets/circle-slash-O1R3fbRQ.js +1 -0
  45. package/dist/assets/{client-By2FqNgK.js → client-5au8Dz4T.js} +1 -1
  46. package/dist/assets/crop-CQKehVwH.js +1 -0
  47. package/dist/assets/{device-integration-icon-D4NuzGzW.js → device-integration-icon-7CvdEsXK.js} +1 -1
  48. package/dist/assets/device-picker-model-DFS6Au1R.js +1 -0
  49. package/dist/assets/{dist-Bb5mI3Am.js → dist-CbS8Wt77.js} +1 -1
  50. package/dist/assets/{dist-C9QeNmTL.js → dist-DX2-N4Ok.js} +1 -1
  51. package/dist/assets/{format-size-BAc5BmkA.js → format-size-ByLX8H4V.js} +1 -1
  52. package/dist/assets/{history-CMMO85U7.js → history-8a1zQ_IL.js} +1 -1
  53. package/dist/assets/{hostInit-4FORlpRs.js → hostInit-BncFFvvZ.js} +1 -1
  54. package/dist/assets/index-BOZXWZFq.js +4 -0
  55. package/dist/assets/{layers-BI_sr7Ok.js → layers-BQApB38m.js} +1 -1
  56. package/dist/assets/{location-owned-usage-CUKPTFaM.js → location-owned-usage-oH3gIpK5.js} +1 -1
  57. package/dist/assets/{log-in-iUePLZ5A.js → log-in-DQztm9HI.js} +1 -1
  58. package/dist/assets/{mf-entry-bootstrap-0-94e624f3.js → mf-entry-bootstrap-0-2047ccad.js} +2 -2
  59. package/dist/assets/{monitor-smartphone-DeLd3lKL.js → monitor-smartphone--t7IlgKO.js} +1 -1
  60. package/dist/assets/mount-DFS6Au1R.js +1 -0
  61. package/dist/assets/{notification-schedule-field-BHoZkl6T.js → notification-schedule-field-BPNXphLN.js} +1 -1
  62. package/dist/assets/{octagon-alert-BxJ0G_rQ.js → octagon-alert-D_UEMtBK.js} +1 -1
  63. package/dist/assets/{player-overlays-Dj6CBWI7.js → player-overlays-BzBTCjWR.js} +1 -1
  64. package/dist/assets/remoteEntry-CBgDnSiW.js +1 -0
  65. package/dist/assets/{send-CEOPyA1o.js → send-C5kLO34E.js} +1 -1
  66. package/dist/assets/{settings-2-DXQTAjNd.js → settings-2-CnztS9Vg.js} +1 -1
  67. package/dist/assets/{src-BCDkMFOl.js → src-DTW2ew69.js} +3 -3
  68. package/dist/assets/{use-scenes-feed-_1_N_HCP.js → use-scenes-feed-DX7Oajuk.js} +1 -1
  69. package/dist/assets/{use-stationary-objects-C1Ulq17N.js → use-stationary-objects-BDMOQ0As.js} +1 -1
  70. package/dist/assets/useEventInvalidation-DFS6Au1R.js +1 -0
  71. package/dist/assets/{useNodeUrlSelection-Bk4CO6qP.js → useNodeUrlSelection-BsOqZeMQ.js} +1 -1
  72. package/dist/assets/user-round-sBwbE8j8.js +1 -0
  73. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-z-ZK3UeO.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DDYwkDjw.js} +2 -2
  74. package/dist/index.html +7 -7
  75. package/dist/server/addon.js +12 -1
  76. package/package.json +1 -1
  77. package/dist/assets/circle-slash-DXFVqMrZ.js +0 -1
  78. package/dist/assets/crop-Cn7sv2wg.js +0 -1
  79. package/dist/assets/device-picker-model-2b49iPCj.js +0 -1
  80. package/dist/assets/index-Xfhjk8-d.js +0 -4
  81. package/dist/assets/mount-2b49iPCj.js +0 -1
  82. package/dist/assets/remoteEntry-CZ5kbYKo.js +0 -1
  83. package/dist/assets/useEventInvalidation-2b49iPCj.js +0 -1
  84. package/dist/assets/user-round-jd6Fm3Vu.js +0 -1
@@ -349,7 +349,7 @@ ${r.triggers.map((e,t)=>Om(e,t)).join(`
349
349
  for (const dispose of disposers) dispose()
350
350
  }
351
351
  }
352
- `}var jm=d({id:l(),label:l(),icon:l(),path:l(),remoteName:l(),bundle:l(),section:l().optional(),sectionLabel:l().optional()}),Mm=d({addonId:l(),page:jm,bundleUrl:l()}),Nm={name:`addon-pages`,scope:`system`,mode:`singleton`,methods:{listPages:D(v(),S(Mm).readonly())}},Pm=d({id:l(),label:l(),icon:l(),path:l(),remoteName:l(),bundle:l(),section:l().optional(),sectionLabel:l().optional()}),Fm={name:`addon-pages-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listPages:D(v(),S(Pm).readonly(),{auth:`admin`})}},Im=d({method:x([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`]),path:l(),access:x([`public`,`authenticated`,`admin`]).optional(),description:l().optional(),rateLimit:x([`auth`]).optional()}),Lm=d({method:l(),path:l(),params:y(l(),l()),query:y(l(),l()),body:o(),headers:y(l(),l()),user:d({id:l(),username:l(),isAdmin:C()}).optional(),scopedToken:o().optional()}),Rm=d({status:i().int(),headers:y(l(),l()),redirectUrl:l().nullable(),body:o().optional(),contentType:l().optional()}),zm={name:`addon-routes`,scope:`system`,mode:`collection`,internal:!0,methods:{getRoutes:D(v(),S(Im)),invoke:D(Lm,Rm,{kind:`mutation`})},mount:{kind:`skip`}},Bm=d({id:l(),label:l(),icon:l(),order:i().optional()}),Vm=d({id:l(),title:l(),description:l().optional(),style:x([`card`,`accordion`]).optional(),defaultCollapsed:C().optional(),columns:f([m(1),m(2),m(3),m(4)]).optional(),tab:l().optional(),location:x([`settings`,`top-tab`]).optional(),order:i().optional(),fields:S(h())}),Hm=d({tabs:S(Bm).optional(),sections:S(Vm)}),Um=y(l(),o()),Wm=d({success:m(!0)}),Gm={name:`addon-settings`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{getGlobalSettings:D(d({addonId:l(),nodeId:l().optional(),overlay:y(l(),o()).optional(),cap:l().optional()}),Hm.nullable()),updateGlobalSettings:D(d({addonId:l(),nodeId:l().optional(),patch:Um}),Wm,{kind:`mutation`,auth:`admin`}),getIntegrationSettings:D(d({addonId:l(),nodeId:l().optional()}),Hm.nullable()),getDeviceSettings:D(d({addonId:l(),deviceId:i(),nodeId:l().optional()}),Hm.nullable()),updateDeviceSettings:D(d({addonId:l(),deviceId:i(),nodeId:l().optional(),patch:Um}),Wm,{kind:`mutation`,auth:`admin`})}},Km=x([`device-tab`,`dashboard`,`integration-detail`]),qm=x([`xs`,`sm`,`md`,`lg`,`xl`]),Jm=d({remoteName:l(),exposedModule:l(),componentKey:l().optional()}),Ym=d({tab:l(),subTab:l().optional(),label:l(),order:i().optional(),kind:m(`remote`),remote:Jm,stableId:l(),description:l().optional(),icon:l().optional(),bundle:l(),hosts:S(Km).readonly(),requires:d({deviceContext:C().default(!1),integrationContext:C().default(!1)}),preAuth:C().optional().default(!1),defaultSize:qm.default(`md`),allowedSizes:S(qm).readonly().default([`sm`,`md`,`lg`]),defaultColumns:i().int().min(1).max(12).default(6),defaultRows:i().int().min(1).max(12).default(1)}),Xm={name:`addon-widgets-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listWidgets:D(v(),S(Ym).readonly(),{auth:`admin`})}},Zm=Ym.extend({addonId:l(),bundleUrl:l()}),Qm={name:`addon-widgets`,scope:`system`,mode:`singleton`,methods:{listWidgets:D(v(),S(Zm).readonly())}},$m=x([`info`,`success`,`warning`,`error`]),eh=x([`active`,`in-progress`,`completed`,`failed`,`dismissed`]),th=d({type:l(),id:l()}),nh=d({id:l(),category:l(),severity:$m,title:l(),message:l(),status:eh,progress:i().optional(),read:C(),createdAt:i(),updatedAt:i(),source:th.optional(),metadata:y(l(),o()).optional()}),rh={name:`alerts`,scope:`system`,mode:`singleton`,methods:{emit:D(nh,v(),{kind:`mutation`}),update:D(d({alertId:l(),patch:nh.partial()}),v(),{kind:`mutation`}),list:D(d({unreadOnly:C().optional(),limit:i().optional()}).optional(),S(nh).readonly()),getUnreadCount:D(v(),i()),markRead:D(d({alertId:l()}),v(),{kind:`mutation`}),markAllRead:D(v(),v(),{kind:`mutation`}),dismiss:D(d({alertId:l()}),v(),{kind:`mutation`})}},ih={name:`audio-analysis`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:D(d({deviceId:i()}),_())},events:{onAudioLevel:Pr(d({deviceId:i(),rms:i(),dbfs:i()}))}},ah=x([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),oh=d({data:_(),format:ah,width:i(),height:i(),timestamp:i()}),sh=d({x:i(),y:i(),w:i(),h:i()}),ch=d({class:l(),originalClass:l(),score:i(),bbox:sh}),lh=d({data:b(Uint8Array),sampleRate:i(),channels:i(),timestamp:i(),deviceId:i().optional()}),uh=d({rms:i(),dbfs:i()}),dh=d({className:l(),originalClass:l().optional(),score:i()}),fh=[`superseded`,`error`,`timeout`,`disposed`],ph=p(`state`,[d({state:m(`classified`)}),d({state:m(`not-classified`),reason:x(fh)})]),mh=d({level:uh,classification:d({labels:S(dh).readonly(),inferenceMs:i()}).optional(),classifyOutcome:ph,timestamp:i()}),hh=d({minConfidence:i().min(0).max(1).default(.3),allowedClasses:S(l()).default([])}),gh=d({deviceId:i(),brokerId:l(),ingestNodeId:l(),settings:hh}),_h=d({attached:C(),replaced:C()}),vh=d({detached:C()}),yh=d({labels:S(dh).readonly(),rawLabels:S(dh).readonly().optional(),inferenceMs:i()}),bh=[{value:`auto`,label:`Auto (platform default)`},{value:`apple-soundanalysis`,label:`Apple SoundAnalysis (macOS 12+)`},{value:`yamnet-onnx`,label:`YAMNet ONNX (cross-platform)`}],xh={audioBackend:`auto`,probedBestAudioBackend:``},Sh={name:`audio-analyzer`,scope:`system`,mode:`singleton`,methods:{analyseChunk:D(d({chunk:lh,settings:hh}),mh.nullable(),{kind:`mutation`}),classify:D(lh,yh,{timeoutMs:3e4}),attachDevice:D(gh,_h,{kind:`mutation`}),detachDevice:D(d({deviceId:i()}),vh,{kind:`mutation`}),isReady:D(v(),C()),dispose:D(v(),v(),{kind:`mutation`}),reprobeAudioEngine:D(v(),d({backend:l()}),{kind:`mutation`,auth:`admin`})}},Ch=x([`f32le`,`s16le`]),wh=d({codec:l(),canDecode:C(),canEncode:C(),label:l().optional()}),Th=d({codec:l(),sourceSampleRate:i().int().positive(),sourceChannels:i().int().positive(),extraData:b(Uint8Array).optional(),targetSampleRate:i().int().positive(),targetChannels:i().int().positive(),targetFormat:Ch.optional(),idleMs:i().int().positive().optional(),tag:l().optional()}),Eh=d({codec:l(),sourceSampleRate:i().int().positive(),sourceChannels:i().int().positive(),sourceFormat:Ch.optional(),targetSampleRate:i().int().positive(),targetChannels:i().int().positive(),bitrateKbps:i().int().positive().optional(),idleMs:i().int().positive().optional(),tag:l().optional()}),Dh=d({data:b(Uint8Array),sampleRate:i().int().positive(),channels:i().int().positive(),format:Ch,pts:i()}),Oh=d({data:b(Uint8Array),codec:l(),pts:i(),frameComplete:C()}),kh=d({sessionId:l(),kind:x([`decode`,`encode`]),codec:l(),sourceSampleRate:i(),sourceChannels:i(),targetSampleRate:i(),targetChannels:i(),format:Ch,tag:l().optional(),createdAtMs:i(),lastActivityMs:i(),framesIn:i(),framesOut:i()}),Ah={name:`audio-codec`,scope:`system`,mode:`singleton`,preferredProvider:`decoder-nodeav`,methods:{listSupportedCodecs:D(v(),S(wh).readonly()),canHandle:D(d({codec:l(),kind:x([`decode`,`encode`])}),C()),createDecodeSession:D(Th,d({sessionId:l(),nodeId:l()}),{kind:`mutation`}),createEncodeSession:D(Eh,d({sessionId:l(),nodeId:l()}),{kind:`mutation`}),closeSession:D(d({sessionId:l(),nodeId:l().optional()}),v(),{kind:`mutation`}),pushEncodedFrame:D(d({sessionId:l(),nodeId:l().optional(),data:b(Uint8Array),pts:i().optional()}),v(),{kind:`mutation`}),pullPcm:D(d({sessionId:l(),nodeId:l().optional(),maxCount:i().int().positive().default(8)}),S(Dh)),pushPcm:D(d({sessionId:l(),nodeId:l().optional(),data:b(Uint8Array),pts:i().optional()}),v(),{kind:`mutation`}),pullEncoded:D(d({sessionId:l(),nodeId:l().optional(),maxCount:i().int().positive().default(8)}),S(Oh)),flushEncode:D(d({sessionId:l(),nodeId:l().optional()}),S(Oh),{kind:`mutation`}),listActiveSessions:D(v(),S(kh).readonly())}},jh=d({userId:l(),username:l(),email:l().optional(),displayName:l().optional(),isAdmin:C().default(!1)}),Mh={name:`auth-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{validateCredentials:D(d({username:l(),password:l()}),jh.nullable(),{kind:`mutation`}),getLoginUrl:D(d({state:l()}),l()),handleCallback:D(y(l(),l()),jh,{kind:`mutation`}),validateToken:D(d({token:l()}),jh.nullable())},mount:{kind:`skip`}},Nh=`.backup-snapshot`,Ph=`.backup-snapshot-partial`,Fh=30*6e4,Ih=d({databases:S(d({livePath:l()}))}),Lh=d({name:l(),rows:i().int().nonnegative()}),Rh=d({livePath:l(),snapshotPath:l(),sizeBytes:i().int().nonnegative(),pageCount:i().int().nonnegative(),pageSize:i().int().positive(),tables:S(Lh),copyMs:i().nonnegative(),verifyMs:i().nonnegative(),takenAt:i()}),zh=Rh.extend({livePath:l(),snapshotPath:l()}),Bh={name:`database-snapshot`,scope:`system`,mode:`singleton`,internal:!0,methods:{listDatabases:D(d({}),Ih,{auth:`admin`}),writeSnapshot:D(d({}),Rh,{kind:`mutation`,auth:`admin`,timeoutMs:Fh})}},Vh=d({subId:l(),displayName:l(),description:l().optional(),kind:l(),triggerSupported:C(),restoreSupported:C()}).extend({id:l(),addonId:l(),enabled:C(),retentionCount:i(),label:l().optional(),lastSuccessAt:i().optional(),lastSuccessSizeBytes:i().optional(),cron:l().optional(),nextRunAt:i().optional(),lastAttemptAt:i().optional(),lastError:l().optional()}),Hh=d({scheme:l(),keyId:l()}),Uh=d({enabled:C(),active:d({keyId:l(),publicKey:l(),createdAt:i()}).nullable(),keys:S(d({keyId:l(),createdAt:i(),retiredAt:i().nullable()})).readonly()}),Wh=d({id:l(),filename:l(),createdAt:i(),sizeBytes:i(),label:l().optional(),locations:S(l()).readonly(),encryption:Hh.optional()}),Gh=d({id:l(),destinationId:l().optional(),label:l().optional(),createdAt:i(),sizeBytes:i(),locations:S(l()).optional(),encryption:Hh.optional()}),Kh=d({path:l(),kind:x([`file`,`dir`,`symlink`]),sizeBytes:i(),mtime:i()}),qh=d({archiveVersion:m(1),createdAt:i(),dataDir:l(),locations:S(l()),entries:S(Kh),totalBytes:i(),totalFiles:i(),sqliteSnapshots:S(zh).optional()}),Jh=d({name:l(),sizeBytes:i(),fileCount:i(),present:C()}),Yh=x([`queued`,`running`,`succeeded`,`failed`,`cancelled`]),Xh=x([`queued`,`building`,`uploading`,`done`]),Zh=d({id:l(),state:Yh,phase:Xh,destinationIds:S(l()).readonly(),label:l().optional(),requestedAt:i(),startedAt:i().optional(),finishedAt:i().optional(),stagedBytes:i(),archiveSizeBytes:i().optional(),uploadedBytes:i(),completedDestinationIds:S(l()).readonly(),failedDestinationIds:S(l()).readonly(),error:l().optional(),queuePosition:i().int().min(1).optional()}),Qh=d({runId:l(),queued:C(),joined:C(),cancelled:C(),entries:S(Gh).readonly()}),$h=d({id:l(),label:l(),cron:l(),enabled:C(),locationIds:S(l()).readonly(),retentionCount:i().int().min(1).max(1e3),dataSources:S(l()).readonly().optional(),lastAttemptAt:i().optional(),lastSuccessAt:i().optional(),lastError:l().optional(),nextRunAt:i().optional()}),eg={name:`backup`,scope:`system`,mode:`singleton`,methods:{listDestinations:D(v(),S(Vh).readonly(),{auth:`admin`}),trigger:D(d({destinations:S(l()).optional(),locations:S(l()).optional(),label:l().optional(),retentionCount:i().int().min(1).max(1e3).optional()}).optional(),Qh,{kind:`mutation`,auth:`admin`}),listRuns:D(v(),S(Zh).readonly(),{auth:`admin`}),cancel:D(d({runId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),list:D(v(),S(Gh).readonly(),{auth:`admin`}),listLocations:D(v(),S(Jh).readonly(),{auth:`admin`}),getEntries:D(d({destinationId:l(),backupId:l()}),qh.nullable(),{auth:`admin`}),restore:D(d({destinationId:l(),backupId:l(),locations:S(l()).optional(),backupSecretKey:l().optional()}),v(),{kind:`mutation`,auth:`admin`}),getEncryption:D(v(),Uh,{auth:`admin`}),setupEncryption:D(d({}),d({keyId:l(),secretKey:l(),publicKey:l(),createdAt:i(),replacedKeyId:l().nullable()}),{kind:`mutation`,auth:`admin`}),disableEncryption:D(d({}),d({disabledKeyId:l().nullable()}),{kind:`mutation`,auth:`admin`}),checkBackupKey:D(d({backupSecretKey:l()}),d({valid:C(),keyId:l().nullable(),known:C(),active:C(),error:l().optional()}),{kind:`mutation`,auth:`admin`}),delete:D(d({destinationId:l(),backupId:l()}),v(),{kind:`mutation`,auth:`admin`}),listArchives:D(d({destinationId:l()}),S(Wh).readonly(),{auth:`admin`}),upsertDestinationPolicy:D(d({locationId:l(),enabled:C(),retentionCount:i().int().min(1).max(1e3),label:l().optional()}),v(),{kind:`mutation`,auth:`admin`}),previewSchedule:D(d({cron:l(),count:i().int().min(1).max(20).optional()}),d({ok:C(),error:l().optional(),nextRuns:S(i()).readonly()})),listSchedules:D(v(),S($h).readonly(),{auth:`admin`}),upsertSchedule:D(d({id:l().optional(),label:l(),cron:l(),enabled:C(),locationIds:S(l()).readonly(),retentionCount:i().int().min(1).max(1e3),dataSources:S(l()).readonly().optional()}),$h,{kind:`mutation`,auth:`admin`}),deleteSchedule:D(d({id:l()}),v(),{kind:`mutation`,auth:`admin`})}},tg=x([`connected`,`disconnected`,`connecting`,`auth-failed`,`unreachable`,`error`]),ng=d({id:l(),addonId:l(),name:l(),kind:l(),status:tg,info:y(l(),o()),lastCheckedAt:i().nullable(),error:l().nullable()}),rg=d({brokerCount:i().int().nonnegative(),connectedCount:i().int().nonnegative()}),ig=d({addonId:l(),kinds:S(d({kind:l(),label:l(),interactiveConnectPath:l().min(1).optional(),interactiveDisconnectPath:l().min(1).optional()}))}),ag=d({kind:l().optional()}),og=d({id:l()}),sg=d({kind:l().min(1),name:l().min(1),id:l().min(1).optional(),settings:y(l(),o())}),cg=d({id:l()}),lg=d({id:l()}),ug=p(`ok`,[d({ok:m(!0),latencyMs:i().nonnegative()}),d({ok:m(!1),error:l()})]),dg=y(l(),o()),fg=d({kind:l()}),pg=d({kind:l(),settings:dg}),mg=p(`ok`,[d({ok:m(!0),latencyMs:i().nonnegative().optional()}).strict(),d({ok:m(!1),error:l()})]),hg=o().nullable(),gg=d({brokerId:l(),target:y(l(),o()),payload:o().optional()}),_g=d({brokerId:l(),filter:y(l(),o())}),vg=d({subscriptionId:l()}),yg=d({brokerId:l(),subscriptionId:l()}),bg=d({brokerId:l(),key:l()}),xg={name:`broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:rg,kind:`poll`},methods:{list:D(ag,S(ng)),get:D(og,ng.nullable()),listProviders:D(v(),S(ig),{auth:`admin`}),add:D(sg,cg,{kind:`mutation`,auth:`admin`}),remove:D(lg,v(),{kind:`mutation`,auth:`admin`}),testConnection:D(og,ug,{kind:`mutation`,auth:`admin`}),getSettings:D(og,dg.nullable(),{auth:`admin`}),setSettings:D(d({id:l(),settings:dg}),v(),{kind:`mutation`,auth:`admin`}),getBrokerConfig:D(og,dg.nullable(),{auth:`admin`}),getSettingsSchema:D(fg,hg,{auth:`admin`}),testSettings:D(pg,mg,{kind:`mutation`,auth:`admin`}),publish:D(gg,o(),{kind:`mutation`,auth:`admin`}),subscribe:D(_g,vg,{kind:`mutation`,auth:`admin`}),unsubscribe:D(yg,v(),{kind:`mutation`,auth:`admin`}),getState:D(bg,o().nullable(),{auth:`admin`}),getStatus:D(v(),rg)}},Sg={name:`camera-pipeline-config`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{}},Cg=x([`webrtc`,`hls`,`mjpeg`,`rtsp`]),wg=x([`mp4`,`gif`]),Tg=d({kind:wg,handle:l(),nodeId:l(),mime:l(),bytes:i().int(),width:i().int(),height:i().int()}),Eg=d({fromTs:i(),toTs:i(),packets:i().int()}),Dg=d({media:S(Tg).readonly(),coverage:Eg,profile:E,video:x([`copy`,`encode`])}),Og=d({brokerId:l(),url:l(),mutedUrl:l(),enabled:C(),codec:l().optional(),resolution:d({width:i().int().positive(),height:i().int().positive()}).optional()}),kg=d({sessionId:l(),remoteAddr:l(),userAgent:l().nullish(),playing:C(),muted:C(),connectedAt:i(),lastRtpAt:i(),bytesSent:i()}),Ag=d({tag:l(),subscribedAt:i(),chunksDelivered:i()}),jg=x([`alexa`,`homekit`,`webrtc-browser`,`webrtc-mobile`,`webrtc-whep`,`rtsp-listen`,`derived-broker`,`recording`,`pipeline`,`snapshot`,`warmup`,`unknown`]),Mg=d({kind:jg,label:l().optional(),media:x([`audio`,`video`,`both`]).optional(),targetCodec:l().optional(),transport:x([`passthrough`,`repacketize`,`transcode`]).optional(),remoteAddr:l().optional(),userAgent:l().optional(),userId:l().optional(),sessionId:l().optional(),extra:y(l(),l()).optional()}).readonly(),Ng=d({id:l(),channel:x([`annexb`,`rtp`]),attribution:Mg,subscribedAt:i(),packetsDelivered:i()}),Pg=d({rtsp:S(kg).readonly(),audio:S(Ag).readonly(),encoded:S(Ng).readonly(),pipeClients:i(),encodedSubscribers:i()}),Fg=x([`reconnecting`,`sleeping`,`offline`,`disabled`,`waking`]),Ig=x([`h264`,`h265`,`copy`]),Lg=x([`aac`,`opus`,`pcmu`,`copy`,`none`]),Rg=d({deviceId:i().int().nonnegative(),video:Ig,audio:Lg.optional(),profile:E.optional(),targetResolution:d({width:i().int().positive(),height:i().int().positive()}).optional(),outputArgs:S(l()).optional(),audioEgress:C().optional(),hostname:l().optional(),tag:l().optional()}),zg=d({url:l(),sentryUrl:l().nullable().optional(),videoCodec:x([`H264`,`H265`]),audioCodec:l(),resolution:d({width:i().int().positive(),height:i().int().positive()}),transcoded:C(),encoder:l(),pipelineKey:l()}),Bg=Ns.omit({inputArgs:!0,outputArgs:!0}),Vg=x([`tight`,`relaxed`]),Hg=d({deviceId:i().int().nonnegative(),source:p(`kind`,[d({kind:m(`profile`),profile:E}),d({kind:m(`cam-stream`),camStreamId:l().min(1)})]),encode:Bg,rateControl:Vg.optional(),bitstreamFilter:x([`dump_extra`,`h264_mp4toannexb`,`hevc_mp4toannexb`]).optional(),publishLocally:C().optional(),pixelFormat:x([`yuv420p`,`nv12`]).optional(),decodeHwAccel:x([`auto`,`none`,`videotoolbox`,`vaapi`,`qsv`,`cuda`]).optional(),hostname:l().optional(),tag:l().optional()}),Ug=d({url:l(),pipelineKey:l(),videoCodec:x([`H264`,`H265`]),resolution:d({width:i().int().positive(),height:i().int().positive()}),transcoded:C(),encoder:l(),decodeHwAccel:l().nullable(),camStreamId:l().nullable()}),Wg={name:`stream-broker`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{reportStreamSignal:D(d({deviceId:i().int().nonnegative(),code:l().min(1),at:i().optional()}),d({accepted:C(),reason:x([`woke`,`hold-extended`,`not-enabled`,`no-consumer`,`unknown-code`])}),{kind:`mutation`}),publishCameraStream:D(d({deviceId:i().int().nonnegative(),camStreamId:l().min(1),kind:Kn,url:l().optional(),codec:l().optional(),resolution:qn.optional(),fps:i().positive().optional(),label:l().optional(),deviceFeatures:S(l()).optional(),autoEligible:C().optional(),profileHint:E.optional(),metadata:y(l(),o()).optional(),sourceCamStreamId:l().min(1).optional(),encodeProfile:Ns.optional()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),retractCameraStream:D(d({deviceId:i().int().nonnegative(),camStreamId:l().min(1)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),assignProfile:D(d({deviceId:i().int().nonnegative(),profile:E,camStreamId:l().min(1)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),unassignProfile:D(d({deviceId:i().int().nonnegative(),profile:E}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),forgetDeviceHardware:D(d({deviceId:i().int().nonnegative()}),d({derivedStreamsDeleted:S(l()).readonly(),assignmentsPurged:C(),probeSnapshotsDropped:i().int().nonnegative(),rtspTokenRowsDeleted:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),renderPreBufferClip:D(d({deviceId:i(),profile:E.optional(),aroundMs:i(),preRollSec:i().min(0).max(20).default(3),postRollSec:i().min(0).max(20).default(5),format:x([`gif`,`mp4`]).default(`gif`),maxWidth:i().int().min(120).max(1920).default(480),fps:i().int().min(1).max(15).default(5),speed:i().min(1).max(8).default(2)}),d({base64:l(),mime:l(),bytes:i().int(),profile:E,durationMs:i()}),{kind:`mutation`,auth:`admin`}),produceEventMedia:D(d({deviceId:i(),profile:E.optional(),aroundMs:i(),preSeconds:i().min(0).max(20).default(4),postSeconds:i().min(0).max(20).default(6),kinds:S(wg).min(1).default([`mp4`]),gifMaxWidth:i().int().min(120).max(1280).default(640),gifFps:i().int().min(1).max(15).default(12),gifSpeed:i().min(1).max(8).default(4),speed:i().min(1).max(8).default(4)}),Dg,{kind:`mutation`,auth:`admin`}),fetchEventMedia:D(d({handle:l()}),d({base64:l(),mime:l(),bytes:i().int()}).nullable(),{kind:`mutation`,auth:`admin`}),listAllCameraStreams:D(v(),S(Jn).readonly()),listAllProfileSlots:D(v(),S(Xn).readonly()),getBrokerStats:D(d({brokerId:l()}),lr),probeStream:D(d({brokerId:l()}),d({probed:C(),summary:l()}),{kind:`mutation`,auth:`admin`}),listClients:D(d({brokerId:l()}),Pg),killClient:D(d({brokerId:l(),channel:x([`rtsp`,`audio`]),handle:l()}),d({killed:C()}),{kind:`mutation`,auth:`admin`}),restartProfile:D(d({deviceId:i().int().nonnegative(),profile:E}),d({success:C()}),{kind:`mutation`,auth:`admin`}),getStreamUrl:D(d({streamId:l(),format:Cg}),d({url:l()})),getStreamWithCodec:D(Rg,zg,{kind:`mutation`,auth:`admin`}),releaseStreamWithCodec:D(d({pipelineKey:l()}),d({released:C(),refcount:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),acquireEgressTranscode:D(Hg,Ug,{kind:`mutation`,auth:`admin`}),releaseEgressTranscode:D(d({pipelineKey:l()}),d({released:C(),refcount:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),subscribeAudioChunks:D(or,sr,{kind:`mutation`}),pullAudioChunks:D(d({subscriptionId:l(),maxCount:i().int().positive().default(8)}),S(ar).readonly()),unsubscribeAudioChunks:D(d({subscriptionId:l()}),d({released:C()}),{kind:`mutation`}),setPreBufferDuration:D(d({brokerId:l(),seconds:i().min(0).max(30)}),v(),{kind:`mutation`,auth:`admin`}),getPreBufferInfo:D(d({brokerId:l()}),d({configuredSec:i(),bufferedMs:i(),packetCount:i()})),getRtspPort:D(v(),i()),getAllRtspEntries:D(d({hostname:l().optional()}),S(Og).readonly()),getRtspEntry:D(d({brokerId:l(),hostname:l().optional()}),Og.nullable()),regenerateRtspToken:D(d({brokerId:l()}),l().nullable(),{kind:`mutation`,auth:`admin`}),setRtspEnabled:D(d({brokerId:l(),enabled:C()}),v(),{kind:`mutation`,auth:`admin`}),isRtspEnabled:D(d({brokerId:l()}),C()),getDeviceAudioMute:D(d({deviceId:i().int()}),d({muted:C(),appliedBrokers:i().int().nonnegative()})),setDeviceAudioMute:D(d({deviceId:i().int(),muted:C()}),d({muted:C(),appliedBrokers:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`})},events:{onCamStreamDemand:Pr(d({deviceId:i().int().nonnegative(),camStreamId:l(),profile:E})),onCamStreamIdle:Pr(d({deviceId:i().int().nonnegative(),camStreamId:l()})),onRequestStreamSourceRefresh:Pr(d({deviceId:i().int().nonnegative(),camStreamId:l(),brokerId:l()}))}},Gg=x([`h264`,`h265`,`hevc`,`av1`,`mjpeg`,`vp8`,`vp9`]),Kg=d({acceptCodecs:S(Gg).readonly().optional(),minHeight:i().int().positive().optional(),maxHeight:i().int().positive().optional(),minWidth:i().int().positive().optional(),excludeDerived:C().optional(),requireSiblingCodec:S(Gg).readonly().optional(),allowTranscode:C().optional(),requireProfileBound:C().optional()}).readonly(),qg=d({preferredProviders:S(l()).readonly().optional(),resolutionPreference:x([`highest`,`lowest`]).optional(),targetHeight:i().int().positive().optional()}).readonly(),Jg=d({camStreamId:l(),codec:l().optional(),resolution:qn.optional(),transcodes:C(),reason:l(),profile:E.optional(),brokerId:l().optional(),url:l().optional(),fps:i().positive().optional(),fpsSource:x([`published`,`measured`]).optional()}),Yg={name:`camera-streams`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],methods:{getCameraStreams:D(d({deviceId:i().int().nonnegative()}),S(Jn).readonly()),getBrokerStreams:D(d({deviceId:i().int().nonnegative()}),S(Xn).readonly()),getRtspEntries:D(d({deviceId:i().int().nonnegative(),hostname:l().optional()}),S(Og).readonly()),getProfileRtspEntries:D(d({deviceId:i().int().nonnegative(),hostname:l().optional()}),S(ur).readonly()),pickStream:D(d({deviceId:i().int().nonnegative(),requirements:Kg,preferences:qg.optional()}),Jg.nullable())},events:{onCamStreamsChanged:Pr(d({deviceId:i().int().nonnegative(),camStreams:S(Jn).readonly()})),onProfileSlotsChanged:Pr(d({deviceId:i().int().nonnegative(),profileSlots:S(Xn).readonly()}))},runtimeState:d({online:C(),slotStatuses:d({high:Yn.optional(),mid:Yn.optional(),low:Yn.optional()}),slotErrors:d({high:l().optional(),mid:l().optional(),low:l().optional()}),lastChangedAt:i()}),durability:`session`};function Xg(e){let t=Tr(e).kind;return t===`collection`?!0:t===`skip`&&e.mode===`collection`}function Zg(e){let t=e._def;return e.constructor?.name===`ZodVoid`||t?.type===`void`||t?.typeName===`ZodVoid`}function Qg(e){let t=e._def;return e.constructor?.name===`ZodObject`||t?.type===`object`||t?.typeName===`ZodObject`}function $g(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 e_(e,t){if(e===void 0||e.mode!==`collection`)return!1;let n=jr(e)[t];return n!==void 0&&n.kind!==`subscription`&&$g(n.output)}function t_(e){let t=e.loose;return typeof t==`function`?t.call(e):e}function n_(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 r_(e){if(e===null||typeof e!=`object`&&typeof e!=`function`)return!1;let t=e.shape??a_(e._def?.shape);return typeof t==`object`&&!!t&&Object.prototype.hasOwnProperty.call(t,`addonId`)}function i_(e){if(e===null||typeof e!=`object`&&typeof e!=`function`)return!1;let t=e.shape??a_(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 a_(e){return typeof e==`function`?e():e}function o_(e,t){return t.auth===void 0?e.internal===!0?`admin`:`protected`:t.auth}function s_(e){return e===`public`?`public`:e===`admin`||e===`superAdmin`?`admin`:`protected`}function c_(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function l_(e){let t=e;for(;t instanceof ue||t instanceof fe||t instanceof g;)t=t.unwrap();return t}function u_(e){let t=l_(e);return t instanceof ce?{kind:`enum`,enumValues:t.options}:t instanceof ee?{kind:`number`}:t instanceof te?{kind:`string`}:t instanceof ie?{kind:`boolean`}:null}function d_(e,t=``){let n=l_(e);if(!(n instanceof oe))return[];let r=[],i=n.shape;for(let[e,n]of Object.entries(i)){let i=t?`${t}.${e}`:e,a=l_(n);if(a instanceof oe){r.push(...d_(a,i));continue}let o=u_(n);o&&r.push({path:i,kind:o.kind,...o.enumValues?{enumValues:o.enumValues}:{}})}return r}function f_(e){return d_(e.itemSchema).filter(t=>t.path!==e.keyField).map(e=>({...e,item:!0}))}function p_(e,t){let n=e;for(let e of t.split(`.`)){let t=l_(n);if(!(t instanceof oe))return null;let r=t.shape[e];if(!(r instanceof ne))return null;n=r}return n}function m_(e,t){let n=d_(e).find(e=>e.path===t);if(n===void 0)return null;let r=p_(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 h_(e){return new Map(d_(e).filter(e=>!e.path.includes(`.`)).flatMap(t=>{let n=m_(e,t.path);return n===null?[]:[[t.path,n]]}))}function g_(e){let t=l_(e);return t instanceof oe?Object.entries(t.shape).flatMap(([e,t])=>t instanceof ne&&!t.safeParse(void 0).success?[e]:[]):[]}function __(e,t){let n=t.split(`.`);return n.slice(0,-1).flatMap((t,r)=>{let i=n.slice(0,r+1).join(`.`),a=p_(e,i);return a!==null&&a.safeParse(void 0).success?[i]:[]})}var v_={"doorbell.onPressed":he.DoorbellOnPressed},y_=v_,b_=d({featureIndex:i().int().nonnegative(),cap:l(),eventName:l(),category:x(he),stateField:l(),fieldKey:l()});function x_(e,t,n){return{code:e,path:t,message:n}}function S_(e){return e.issues.map(e=>`${e.path.length===0?`payload`:e.path.join(`.`)}: ${e.message}`).join(`; `)}function C_(e,t,n){if(t.mode===`replace`)return{problems:[],events:[]};let r=[],i=[];for(let[a,o]of Object.entries(e.events??{})){let s=o.fromState;if(s===void 0)continue;let c=`features[${t.featureIndex}].fields.${s.field}`,l=e.runtimeState?m_(e.runtimeState,s.field):null;if(l===null){r.push(x_(`unknown-field`,c,`\`${e.name}.${a}\` derives from missing state field \`${s.field}\``));continue}if(l.kind!==`number`){r.push(x_(`kind-mismatch`,c,`\`${e.name}.${a}\` needs a numeric state field; \`${s.field}\` is ${l.kind}`));continue}let u=`${e.name}.${a}`,d=y_[u];if(d===void 0){r.push(x_(`not-composable`,`features[${t.featureIndex}].cap`,`\`${u}\` has no explicit composition event-category mapping`));continue}let f=o.data.safeParse({deviceId:1,timestamp:1});if(!f.success){r.push(x_(`not-composable`,`features[${t.featureIndex}].cap`,`\`${u}\` cannot be derived from { deviceId, timestamp }: ${S_(f.error)}`));continue}let p=n.find(n=>n.featureIndex===t.featureIndex&&n.cap===e.name&&n.path===s.field&&n.item===void 0);if(p===void 0){r.push(x_(`unknown-field`,c,`\`${u}\` derives from \`${s.field}\`, but that field is not composed`));continue}i.push({featureIndex:t.featureIndex,cap:e.name,eventName:a,category:d,stateField:s.field,fieldKey:`${p.cap}.${p.path}`})}return{problems:r,events:i}}var w_=x([`reserved-variant`,`unknown-capability`,`not-composable`,`wrong-device-type`,`has-commands`,`unknown-field`,`nested-field`,`missing-field`,`kind-mismatch`,`may-be-null`,`source-missing`,`source-unreadable`,`source-capability-missing`,`source-field-unknown`,`expression-invalid`,`cycle`,`duplicate-target`,`not-item-array`,`item-field-reserved`,`target-missing`,`target-unreadable`,`not-replaceable`]),T_=d({code:w_,path:l(),message:l()}),E_=x([`string`,`number`,`boolean`,`enum`]),D_=x([`null`,`offline`,`unknown`,`release`]),O_=x([`derived`,`clock`,`constant`,`accumulator`]),k_=d({arrayPath:l(),key:l(),label:l()}),A_=d({cap:l(),path:l(),item:k_.optional(),featureIndex:i().int().nonnegative(),kind:E_,nullable:C(),required:C(),unavailable:D_,role:O_,source:Vo,reads:S(Fo)});function j_(e){let t=e.item===void 0?e.path:ss(e.item.arrayPath,e.item.key,e.path);return`${e.cap}.${t}`}var M_=x([`new`,`add`,`replace`]),N_=d({featureIndex:i().int().nonnegative(),cap:l(),mode:M_}),P_=d({ok:C(),problems:S(T_),fields:S(A_),features:S(N_),events:S(b_)}),F_=x([`stopped`,`starting`,`running`,`degraded`,`failed`]),I_=x([`fresh`,`stale`,`unavailable`]),L_=d({cap:l(),path:l(),item:k_.optional(),state:I_,value:f([l(),i(),C(),re()]),reason:l().optional()}),R_=d({blockId:l(),deviceId:i().nullable(),status:F_,reason:l().optional(),fields:S(L_)}),z_=Oo,B_=d({id:l().min(1),name:l().min(1).max(120),enabled:C(),updatedAt:i(),composition:ts}),V_=d({id:l().min(1),name:l().nullable(),error:l()}),H_=d({integrationId:l().nullable(),storeLoaded:C(),blocks:S(B_),restartBlockIds:S(l()),unreadableBlocks:S(V_)}),U_=d({blockId:l(),status:F_,reason:l().optional()}),W_=d({blocks:S(U_),acted:C()}),G_={name:`composer`,scope:`system`,mode:`singleton`,internal:!0,methods:{applyBlocks:D(H_,W_,{kind:`mutation`,auth:`admin`}),getStates:D(d({blockIds:S(l())}),d({states:S(R_)}),{auth:`admin`})}};function H(e,t,n){return{code:e,path:t,message:n}}function U(...e){return{problems:e,fields:[],features:[],events:[]}}function K_(e){let t=e.item===void 0?`fields`:`items.${e.item.key}.fields`;return`features[${e.featureIndex}].${t}.${e.path}`}var W={kind:`fixed`,result:[`number`]},q_={kind:`fixed`,result:[`boolean`]},J_=Object.freeze({min:W,max:W,abs:W,floor:W,ceil:W,sqrt:W,round:W,pow:W,clamp:W,avg:W,sum:W,age:W,convert:W,coalesce:{kind:`coalesce`},any:q_,all:q_,within:q_,latest:{kind:`fixed`,result:[`number`,`null`]},number:{kind:`fixed`,result:[`number`,`null`]},rose:{kind:`fixed`,result:[`number`,`null`]},count:W}),Y_=class extends Error{};function X_(e){return e===null?`null`:typeof e==`number`?`number`:typeof e==`string`?`string`:`boolean`}function Z_(e){return new Set([e])}function Q_(...e){return new Set(e.flatMap(e=>[...e]))}function $_(e){return new Set([...e].filter(e=>e!==`null`))}function ev(e,t,n){if(e===`+`){let e=[...t,...n];return e.every(e=>e===`string`)?Z_(`string`):e.every(e=>e===`number`)?Z_(`number`):new Set([`number`,`string`])}return Z_(e===`-`||e===`*`||e===`/`||e===`%`?`number`:`boolean`)}function tv(e){return e.minArgs===e.maxArgs?`exactly ${e.minArgs}`:e.maxArgs===1/0?`at least ${e.minArgs}`:`${e.minArgs}–${e.maxArgs}`}function nv(e,t){let n=La[e];if(n!==void 0&&(t.length<n.minArgs||t.length>n.maxArgs))throw new Y_(`${e}: wrong number of arguments (${t.length}); expected ${tv(n)}`);let r=J_[e];if(r===void 0)throw new Y_(`no result-kind rule for builtin '${e}'`);if(r.kind===`fixed`)return new Set(r.result);let i=Q_(...t.map($_));return t.every(e=>e.has(`null`))?Q_(i,Z_(`null`)):i}function rv(e,t){switch(e.kind){case`literal`:return Z_(X_(e.value));case`identifier`:{if(e.name===`now`)return Z_(`number`);let n=t.get(e.name);if(n===void 0)throw new Y_(`unbound identifier '${e.name}'`);return n}case`unary`:return Z_(e.op===`!`?`boolean`:`number`);case`binary`:return ev(e.op,rv(e.left,t),rv(e.right,t));case`logical`:return Q_(rv(e.left,t),rv(e.right,t));case`conditional`:return Q_(rv(e.consequent,t),rv(e.alternate,t));case`call`:return nv(e.callee,e.args.map(e=>rv(e,t)))}}function iv(e,t){switch(e.kind){case`literal`:case`identifier`:return!1;case`unary`:return iv(e.operand,t);case`binary`:case`logical`:return iv(e.left,t)||iv(e.right,t);case`conditional`:return iv(e.test,t)||iv(e.consequent,t)||iv(e.alternate,t);case`call`:return e.callee===t||e.args.some(e=>iv(e,t))}}function av(e,t){let n=lo(e);return n.ok&&iv(n.parsed.ast,t)}function ov(e){let t=lo(e.expr);if(!t.ok)return{ok:!1,error:t.error};try{return{ok:!0,kinds:rv(t.parsed.ast,e.bindingKinds)}}catch(e){if(e instanceof Y_)return{ok:!1,error:e.message};throw e}}function sv(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=m_(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 cv(e,t){if(e.kind===`from`)return sv(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([X_(i.value)]));continue}let e=sv(i,t);if(!e.ok)return{...e,message:`binding \`${r}\`: ${e.message}`};n.set(r,e.kinds)}let r=ov({expr:e.expr,bindingKinds:n});return r.ok?{ok:!0,kinds:r.kinds}:{ok:!1,code:`expression-invalid`,message:r.error}}function lv(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(H(`kind-mismatch`,r,`\`${e}.${t.path}\` is a ${t.kind}; this source can produce ${a.join(` or `)}`)),n.has(`null`)&&!t.nullable&&o.push(H(`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 uv(e){if(e.kind!==`expression`)return null;let t=lo(e.expr);if(!t.ok)return null;let n=t.parsed.ast;return n.kind===`literal`&&typeof n.value==`string`?n.value:null}function dv(e,t,n,r){if(t.kind!==`enum`||t.enumValues===void 0)return null;let i=uv(n);if(i===null||t.enumValues.includes(i))return null;let a=t.enumValues.map(e=>`\`${e}\``).join(`, `);return H(`kind-mismatch`,r,`\`${e}.${t.path}\` accepts only ${a}; this source is the literal \`${i}\``)}function fv(e){if(e.kind!==`expression`)return`derived`;if(av(e.expr,`count`))return`accumulator`;if(os(e).length>0)return`derived`;let t=lo(e.expr);return t.ok&&t.parsed.identifiers.has(`now`)?`clock`:`constant`}function pv(e,t,n,r,i){return n===`replace`&&(t===`derived`||t===`accumulator`)?{ok:!0,unavailable:`release`}:n===`new`||t!==`derived`?{ok:!0,unavailable:e.nullable?`null`:`offline`}:e.nullable?{ok:!0,unavailable:`null`}:e.enumValues?.includes(`unknown`)===!0?{ok:!0,unavailable:`unknown`}:{ok:!1,problem:H(`not-replaceable`,i,`\`${r}.${e.path}\` reads a source but can say neither null nor 'unknown', and an ADDED capability has no native reading to fall back to`)}}var mv={resettable:!1};function hv(e){return new Set([e.keyField,...e.labelField===void 0?[]:[e.labelField],...Object.keys(mv)])}function gv(e,t,n){let r=m_(e.itemSchema,t);return r===null||!r.required?!1:__(e.itemSchema,t).every(e=>n.some(t=>t.startsWith(`${e}.`)))}function _v({capName:e,itemArray:t,reserved:n},r,i){let a=Object.keys(r.fields);return d_(t.itemSchema).flatMap(o=>{if(n.has(o.path)||o.path in r.fields||!gv(t,o.path,a))return[];let s=m_(t.itemSchema,o.path);return s===null||s.nullable?[]:[H(`missing-field`,`${i}.fields.${o.path}`,`\`${e}.${t.path}[].${o.path}\` is required and has no source`)]})}function vv(e,t){let{capName:n,itemArray:r,featureIndex:i,lookupCap:a}=e,{key:o,label:s,path:c,source:l}=t,u=`features[${i}].items.${o}.fields.${c}`;if(e.reserved.has(c))return U(H(`item-field-reserved`,u,`\`${n}.${r.path}[].${c}\` is set by the composer itself — it takes no source`));let d=m_(r.itemSchema,c);if(d===null)return U(H(`unknown-field`,u,`a \`${n}\` item has no field \`${c}\``));let f=cv(l,a);if(!f.ok)return U(H(f.code,u,f.message));let p=fv(l),m=pv(d,p,e.mode,n,u);if(!m.ok)return U(m.problem);let h={cap:n,path:c,item:{arrayPath:r.path,key:o,label:s},featureIndex:i,kind:d.kind,nullable:d.nullable,required:d.required,unavailable:m.unavailable,role:p,source:l,reads:[...os(l)]},g=dv(n,d,l,u);return{problems:[...lv(n,d,f.kinds,u),...g===null?[]:[g]],fields:[h],features:[],events:[]}}function yv(e,t,n,r,i=`new`){let a=`features[${n}].items`,o=e.status?.itemArray;if(o===void 0)return U(H(`not-item-array`,a,`\`${e.name}\` has no item array — it takes no \`items\``));if(o.path!==`items`)return U(H(`not-item-array`,a,`\`${e.name}\`'s item array is at \`${o.path}\`, not \`${Ko}\` — not composable yet`));let s={capName:e.name,itemArray:o,reserved:hv(o),featureIndex:n,lookupCap:r,mode:i},c=Object.entries(t.items??{}).flatMap(([e,t])=>[{problems:_v(s,t,`${a}.${e}`),fields:[],features:[],events:[]},...Object.entries(t.fields).map(([n,r])=>vv(s,{key:e,label:t.label,path:n,source:r}))]);return{problems:c.flatMap(e=>e.problems),fields:c.flatMap(e=>e.fields),features:[],events:[]}}var bv=class extends Error{};function xv(e){return new Set(e.composition.features.flatMap(e=>!Zo(e)||e.kind!==`fields`?[]:cs(e).map(({fieldPath:t})=>`${e.cap}.${t}`)))}function Sv(e,t,n){if(L(n.source)!==L(e.target))return!0;let r=`${n.cap}.${n.fieldPath}`;return t.has(r)&&e.replaced?.has(r)!==!0}function Cv(e){let t=xv(e);return e.composition.features.flatMap(n=>!Zo(n)||n.kind!==`fields`?[]:cs(n).map(({fieldPath:r,source:i})=>[rs({source:e.target,cap:n.cap,fieldPath:r}),os(i).filter(n=>Sv(e,t,n)).map(rs)]))}function wv(e,t){let n=L(e.target),r=new Map;for(let i of t){if(i.blockId===e.blockId)continue;let t=L(i.target);if(t===n)throw new bv(`block \`${i.blockId}\` and block \`${e.blockId}\` both target device \`${t}\` — one composition per device; delete or edit the existing one`);let a=r.get(t);if(a!==void 0)throw new bv(`two stored compositions (\`${a.blockId}\`, \`${i.blockId}\`) both target device \`${t}\` — refusing to build the field graph`);r.set(t,i)}return[...r.values(),e]}function Tv(e,t){let n=wv(e,t).flatMap(Cv);return new Map(n)}function Ev(e,t){let n=Tv(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 Dv(e){let t=new Map,n=new Map,r=new Set,i=[],a=[],o=s=>{t.set(s,t.size),n.set(s,t.get(s)??0),i.push(s),r.add(s);for(let i of e.get(s)??[])t.has(i)?r.has(i)&&n.set(s,Math.min(n.get(s)??0,t.get(i)??0)):(o(i),n.set(s,Math.min(n.get(s)??0,n.get(i)??0)));if(n.get(s)!==t.get(s))return;let c=[];for(let e=i.pop();e!==void 0&&(r.delete(e),c.push(e),e!==s);e=i.pop());a.push(c)};for(let n of e.keys())t.has(n)||o(n);return a}function Ov(e,t,n){let r=new Map,i=[e];for(let a=0;a<i.length;a+=1){let o=i[a];if(o===void 0)break;for(let a of n.get(o)??[]){if(a===e){let t=[];for(let n=o;n!==void 0&&n!==e;n=r.get(n))t.push(n);return[e,...t.reverse(),e]}!t.has(a)||r.has(a)||(r.set(a,o),i.push(a))}}return[e,e]}function kv(e,t){let n=Tv(e,t),r=`${L(e.target)}#`;return Dv(n).flatMap(e=>{let t=e.find(e=>e.startsWith(r));if(t===void 0)return[];let i=new Set(e),a=e.length===1&&(n.get(t)??[]).includes(t);return e.length===1&&!a?[]:[{path:Ov(t,i,n),component:i}]})}function Av(e){let t=new Map(e.map(e=>[e.name,e]));return e=>t.get(e)??null}var jv=new Set([`device-status`,`feature-probe`]),Mv={addonId:Oo,stableId:`${Ao}(unsaved)`},Nv=`(unsaved)`;function Pv(e,t,n){let r=n(e.cap);if(r===null)return H(`unknown-capability`,`${t}.cap`,`no capability is named \`${e.cap}\``);if(jv.has(r.name))return H(`not-composable`,`${t}.cap`,`\`${r.name}\` is registered by every device itself — it cannot be composed`);let i=r.runtimeState;return r.scope!==`device`||i===void 0?H(`not-composable`,`${t}.cap`,`\`${r.name}\` has no per-device state to compose`):{def:r,state:i,fields:h_(i)}}function Fv({def:e,state:t,fields:n},r,i,a){let o=[];e.deviceTypes!==void 0&&!e.deviceTypes.includes(a)&&o.push(H(`wrong-device-type`,`${i}.cap`,`\`${e.name}\` is not offered on a \`${a}\` device (it allows ${e.deviceTypes.join(`, `)})`));let s=Object.entries(e.methods).filter(([t,n])=>n.systemOnly!==!0&&e.composedMethods?.[t]===void 0).map(([e])=>`\`${e}\``);s.length>0&&o.push(H(`has-commands`,`${i}.cap`,`\`${e.name}\` has ${s.join(`, `)}, which a composed device cannot serve until commands arrive (slice 3)`));let c=r.items===void 0?null:e.status?.itemArray?.path??null;for(let a of g_(t))a!==c&&(n.has(a)?a in r.fields||o.push(H(`missing-field`,`${i}.fields.${a}`,`\`${e.name}.${a}\` is required and has no source`)):o.push(H(`not-composable`,`${i}.fields`,`\`${e.name}.${a}\` is not a scalar — nested fields arrive in a later slice`)));return o}function Iv({def:e,fields:t},n,r,i){let{featureIndex:a,path:o,source:s}=n,c=`features[${a}].fields.${o}`;if(o.includes(`.`))return U(H(`nested-field`,c,`\`${o}\` is nested — nested fields arrive in a later slice`));let l=t.get(o);if(l===void 0)return U(H(`unknown-field`,c,`\`${e.name}\` has no field \`${o}\``));let u=cv(s,i);if(!u.ok)return U(H(u.code,c,u.message));let d=fv(s),f=pv(l,d,r,e.name,c);if(!f.ok)return U(f.problem);let p={cap:e.name,path:o,featureIndex:a,kind:l.kind,nullable:l.nullable,required:l.required,unavailable:f.unavailable,role:d,source:s,reads:[...os(s)]},m=dv(e.name,l,s,c);return{problems:[...lv(e.name,l,u.kinds,c),...m===null?[]:[m]],fields:[p],features:[],events:[]}}function Lv(e,t,n,r){let i=`features[${t}]`,a=Pv(e,i,r);if(`code`in a)return U(a);let o=n.mode===`replace`?[]:[...Fv(a,e,i,n.deviceType)];e.commands!==void 0&&Object.keys(e.commands).length>0&&o.push(H(`reserved-variant`,`${i}.commands`,"commands (`forward`) arrive in slice 3"));let s=Object.entries(e.fields).map(([e,i])=>Iv(a,{featureIndex:t,path:e,source:i},n.mode,r)),c=e.items===void 0?[]:[yv(a.def,e,t,r,n.mode)],l=[...s,...c],u=l.flatMap(e=>e.fields),d={featureIndex:t,cap:a.def.name,mode:n.mode},f=C_(a.def,d,u);return{problems:[...o,...l.flatMap(e=>e.problems),...f.problems],fields:u,features:[d],events:f.events}}function Rv(e,t){let n=e.nativeCaps.get(t);return n!==void 0&&n!==`composer`}function zv(e,t){if(e.target.kind===`new`)return{kind:`new`,type:e.target.type};let n=L(e.target.device);return t===void 0?H(`target-unreadable`,`target`,`target device \`${n}\` was not read — the save is refused rather than stored unchecked`):t.kind===`absent`?H(`target-missing`,`target`,`target device \`${n}\` does not exist`):t.kind===`unreadable`?H(`target-unreadable`,`target`,`could not read target device \`${n}\` (${t.error}) — the save is refused rather than stored unchecked`):{kind:`existing`,found:t}}function Bv(e,t){return e.kind===`new`?{mode:`new`,deviceType:e.type}:{mode:Rv(e.found,t)?`replace`:`add`,deviceType:e.found.type}}function Vv(e,t,n){let r=zv(e,n);if(`code`in r)return U(r);let i=e.features.map((e,n)=>{let i=e.kind===`passthrough`?U(H(`reserved-variant`,`features[${n}]`,`whole-capability passthrough of \`${e.cap}\` arrives in slice 3`)):Lv(e,n,Bv(r,e.cap),t);return Zo(e)?i:{problems:i.problems,fields:[],features:[],events:[]}});return{problems:i.flatMap(e=>e.problems),fields:i.flatMap(e=>e.fields),features:i.flatMap(e=>e.features),events:i.flatMap(e=>e.events)}}function Hv(e){let t=e.features.flatMap(e=>Zo(e)&&e.kind===`fields`?ls(e).flatMap(os).map(e=>e.source):[]);return[...new Map(t.map(e=>[L(e),e])).values()]}function Uv(e,t,n){return{ref:e.target.kind===`existing`?e.target.device:t.self??Mv,native:e.target.kind===`existing`&&t.target?.kind===`found`?t.target:null,replaced:Wv(n)}}function Wv(e){let t=new Set(e.features.filter(e=>e.mode===`replace`).map(e=>e.featureIndex));return new Set(e.fields.filter(e=>t.has(e.featureIndex)).map(j_))}function Gv(e,t,n,r){let i=`${e.cap}.${e.fieldPath}`;return n.some(e=>j_(e)===i&&!r.replaced.has(i))?[]:r.native===null?[H(`source-field-unknown`,t,`this device has no composed field \`${e.cap}.${e.fieldPath}\``)]:Rv(r.native,e.cap)?[]:[H(`source-capability-missing`,t,`the target device (device ${r.native.deviceId}) has no native \`${e.cap}\``)]}function Kv(e,t,n){let r=L(n.ref);return e.flatMap(i=>i.reads.flatMap(a=>{let o=K_(i),s=L(a.source);if(s===r)return Gv(a,o,e,n);let c=t.sources.get(s);return c===void 0||c.kind===`unreadable`?[H(`source-unreadable`,o,`could not read source \`${s}\` (${c===void 0?`it was not read`:c.error}) — the save is refused rather than stored unchecked`)]:c.kind===`absent`?[H(`source-missing`,o,`source \`${s}\` does not exist`)]:c.caps.has(a.cap)?[]:[H(`source-capability-missing`,o,`source \`${s}\` (device ${c.deviceId}) has no \`${a.cap}\``)]}))}function qv(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 Jv(e,t,n){for(let r of e){let e=qv(r,t);if(e===null)continue;let i=`${e.cap}.${e.fieldPath}`,a=n.find(e=>j_(e)===i);if(a!==void 0)return K_(a)}return`features`}function Yv(e,t){for(let[n,r]of t)if(e.some(e=>e.startsWith(`${n}#`)))return{key:n,error:r};return null}function Xv(e,t,n,r){let i={blockId:t.blockId??`(unsaved)`,target:r.ref,composition:e,replaced:r.replaced},a=L(i.target),o=t.unreadTargets??new Map;try{return kv(i,t.peers).map(e=>{let t=Jv(e.path,a,n),r=Yv([...e.component],o);return r===null?H(`cycle`,t,`a field reads itself: ${e.path.join(` → `)}`):H(`cycle`,t,`possible cycle through \`${r.key}\` — its state could not be read (${r.error}): ${e.path.join(` → `)}`)})}catch(e){if(e instanceof bv)return[H(`duplicate-target`,`features`,e.message)];throw e}}function Zv(e,t){let n=Vv(e,t.lookupCap,t.target??void 0),r=Uv(e,t,n),i=Xv(e,t,n.fields,r),a=[...n.problems,...Kv(n.fields,t,r),...i];return{ok:a.length===0,problems:a,fields:[...n.fields],features:[...n.features],events:[...n.events]}}var Qv=d({path:l(),kind:E_,nullable:C(),required:C(),enumValues:S(l()).optional()}),$v=d({cap:l(),fields:S(Qv),itemArray:d({path:l(),keyField:l()}).optional()}),ey=d({caps:S($v)});function ty(e,t){if(jv.has(e.name))return[`not-composable`];let n=e.runtimeState;if(e.scope!==`device`||n===void 0)return[`not-composable`];let r=[];e.deviceTypes!==void 0&&!e.deviceTypes.includes(t)&&r.push(`wrong-device-type`),Object.entries(e.methods).filter(([t,n])=>n.systemOnly!==!0&&e.composedMethods?.[t]===void 0).length>0&&r.push(`has-commands`);let i=h_(n),a=e.status?.itemArray?.path??null;return g_(n).some(e=>e!==a&&!i.has(e))&&r.push(`not-composable`),C_(e,{featureIndex:0,cap:e.name,mode:`new`},[]).problems.some(e=>e.code===`not-composable`)&&!r.includes(`not-composable`)&&r.push(`not-composable`),r}function ny(e,t){return e.filter(e=>ty(e,t).length===0).map(e=>{let t=e.runtimeState,n=t===void 0?[]:[...h_(t).values()],r=e.status?.itemArray;return{cap:e.name,fields:n.map(e=>({path:e.path,kind:e.kind,nullable:e.nullable,required:e.required,...e.enumValues===void 0?{}:{enumValues:[...e.enumValues]}})),...r===void 0?{}:{itemArray:{path:r.path,keyField:r.keyField}}}}).toSorted((e,t)=>e.cap.localeCompare(t.cap))}var ry=`core-block-`,iy=`core-blocks`;function ay(e){return`${ry}${e}`}function oy(e){if(!e.startsWith(`core-block-`))return null;let t=e.slice(11);return t.length>0?t:null}var sy=f([m(`hub`),l().min(1)]),cy=x([`stopped`,`starting`,`running`,`degraded`,`failed`]),ly=`main.ts`,uy=y(l().min(1).max(260),l().max(2e5)),dy=_(),fy=d({name:l().min(1).max(120),code:l().max(2e5).optional(),files:uy.optional(),entry:l().min(1).max(260).optional(),enabled:C(),placement:sy,integrationId:l().optional(),settingsSchema:dy.optional()}),py=fy.superRefine((e,t)=>{let n=e.entry??`main.ts`;if(e.files!==void 0){e.files[n]===void 0&&t.addIssue({code:`custom`,message:`files must include the entry "${n}"`,path:[`files`]});return}e.code===void 0&&t.addIssue({code:`custom`,message:`code or files is required`,path:[`code`]})});function my(e){return e!==void 0&&e.length>0?e:ly}function hy(e){let t=my(e.entry);return e.files===void 0?{files:{[t]:e.code},entry:t}:{files:{...e.files},entry:t}}function gy(e){if(e.files!==void 0){let t=my(e.entry);return{code:e.files[t]??e.code??``,files:{...e.files},entry:t}}return{code:e.code??``,...e.entry===void 0?{}:{entry:e.entry}}}var _y=p(`kind`,[d({kind:m(`code`)}),d({kind:m(`recipe`),recipe:xm}),d({kind:m(`composition`),composition:ts})]),vy=d({name:l().min(1).max(120).optional(),enabled:C(),composition:ts}),yy=d({name:l().min(1).max(120),code:l().max(2e5),files:uy.optional(),entry:l().min(1).max(260).optional(),enabled:C(),placement:sy,integrationId:l().optional(),settingsSchema:dy.optional(),id:l(),createdAt:i(),updatedAt:i(),createdBy:l(),status:cy,lastError:l().optional(),lastChangedAt:i(),source:_y.optional()});function by(e){return e.source?.kind??`code`}function xy(e){return e.source?.kind===`composition`?e.source.composition:null}var Sy=p(`kind`,[d({kind:m(`answered`),state:R_.nullable()}),d({kind:m(`unreachable`),error:l()})]),Cy=d({block:yy,state:Sy}),wy=d({state:m(`not-loaded`),reason:l()}),Ty=p(`state`,[d({state:m(`loaded`),views:S(Cy)}),wy]),Ey=p(`state`,[d({state:m(`loaded`),view:Cy.nullable()}),wy]),Dy=p(`state`,[d({state:m(`loaded`),view:Cy.nullable()}),wy]),Oy=d({ok:C(),error:l().optional(),line:i().optional(),column:i().optional()}),ky=d({code:l().optional(),files:uy.optional(),entry:l().min(1).max(260).optional()}).superRefine((e,t)=>{if(e.files!==void 0){let n=e.entry??`main.ts`;e.files[n]===void 0&&t.addIssue({code:`custom`,message:`files must include the entry "${n}"`,path:[`files`]});return}e.code===void 0&&t.addIssue({code:`custom`,message:`code or files is required`,path:[`code`]})}),Ay={name:`core-blocks`,scope:`system`,mode:`singleton`,methods:{list:D(d({}),d({blocks:S(yy)}),{auth:`admin`}),get:D(d({blockId:l()}),d({block:yy.nullable()}),{auth:`admin`}),create:D(d({block:py}),d({block:yy}),{kind:`mutation`,auth:`admin`,caller:`required`}),update:D(d({blockId:l(),block:fy.partial()}),d({block:yy}),{kind:`mutation`,auth:`admin`,caller:`required`}),delete:D(d({blockId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setEnabled:D(d({blockId:l(),enabled:C()}),d({block:yy}),{kind:`mutation`,auth:`admin`}),restart:D(d({blockId:l()}),d({block:yy}),{kind:`mutation`,auth:`admin`}),compile:D(ky,Oy,{kind:`mutation`,auth:`admin`}),getBlockSettings:D(d({blockId:l()}),Hm.nullable(),{auth:`admin`}),updateBlockSettings:D(d({blockId:l(),patch:Um}),Wm,{kind:`mutation`,auth:`admin`}),getTypeDefs:D(d({}),d({libs:S(d({filePath:l(),content:l()}))}),{auth:`admin`}),createComposition:D(d({block:vy}),d({block:yy}),{kind:`mutation`,auth:`admin`,caller:`required`}),updateComposition:D(d({blockId:l(),expectedUpdatedAt:i(),block:vy.partial()}),d({block:yy}),{kind:`mutation`,auth:`admin`,caller:`required`}),getComposition:D(d({blockId:l()}),Ey,{auth:`admin`}),listCompositions:D(d({}),Ty,{auth:`admin`}),getCustomization:D(d({addonId:l().min(1),stableId:l().min(1)}),Dy,{auth:`admin`}),listComposableCaps:D(d({deviceType:x(k)}),ey,{auth:`admin`}),validateComposition:D(d({composition:ts,blockId:l().optional()}),P_,{kind:`mutation`,auth:`admin`,access:`view`})}},jy=d({stepId:l(),entry:Gp}),My=d({path:l().min(1),bytes:i().int().nonnegative(),sha256:l().regex(/^[0-9a-f]{64}$/)}),Ny=d({addonId:l(),stepId:l().min(1),entries:S(Gp).min(1).max(4),bundle:d({ticket:En,bytes:i().int().positive(),sha256:l().regex(/^[0-9a-f]{64}$/)}),files:S(My).min(1).max(64),distribute:C()}),Py=p(`kind`,[d({kind:m(`imported`),modelIds:S(l()).readonly(),distributed:S(d({modelId:l(),nodeId:l(),format:x(yr),ok:C(),error:l().optional()})).readonly()}),d({kind:m(`refused`),reason:x([`transfer-failed`,`checksum-mismatch`,`bundle-mismatch`,`invalid-entry`,`id-taken`]),detail:l()})]),Fy={name:`custom-model-registry`,scope:`system`,mode:`collection`,internal:!0,methods:{listModels:D(v(),S(jy).readonly(),{auth:`admin`}),importModelBundle:D(Ny,Py,{kind:`mutation`,auth:`admin`,timeoutMs:30*6e4})}},Iy=d({where:y(l(),o()).optional(),whereIn:y(l(),S(o())).optional(),whereBetween:y(l(),u([o(),o()])).optional(),whereNot:y(l(),o()).optional(),whereNotIn:y(l(),S(o())).optional(),orderBy:d({field:l(),direction:x([`asc`,`desc`])}).optional(),limit:i().optional(),offset:i().optional()}),Ly=d({where:y(l(),o()).optional(),whereIn:y(l(),S(o())).optional(),whereBetween:y(l(),u([o(),o()])).optional(),whereNot:y(l(),o()).optional(),whereNotIn:y(l(),S(o())).optional()}),Ry=d({as:l().min(1),field:l().min(1),op:x([`sum`,`min`,`max`])}),zy=d({count:i().int(),values:y(l(),i().nullable())}),By=d({id:l(),data:y(l(),o())}),Vy=d({id:l().optional(),data:y(l(),o())}),Hy=d({name:l(),type:x([`TEXT`,`INTEGER`,`REAL`,`JSON`,`BOOLEAN`]),primaryKey:C().optional(),notNull:C().optional(),unique:C().optional(),defaultValue:f([l(),i(),C()]).optional()}),Uy=d({name:l(),columns:S(l()).readonly(),unique:C().optional()}),Wy={name:`settings-store`,scope:`system`,mode:`singleton`,methods:{get:D(d({namespace:l().optional(),collection:l(),key:l()}),o(),{auth:`admin`}),set:D(d({namespace:l().optional(),collection:l(),key:l(),value:o()}),v(),{kind:`mutation`,auth:`admin`}),query:D(d({namespace:l().optional(),collection:l(),filter:Iy.optional(),columns:S(l()).readonly().optional()}),S(By).readonly(),{auth:`admin`}),upsert:D(d({namespace:l().optional(),collection:l(),conflict:S(l()).readonly(),record:Vy}),d({id:f([l(),i()])}),{kind:`mutation`,auth:`admin`}),insert:D(d({namespace:l().optional(),collection:l(),record:d({id:l().optional(),data:y(l(),o())})}),d({id:f([l(),i()])}),{kind:`mutation`,auth:`admin`}),insertMany:D(d({namespace:l().optional(),collection:l(),records:S(Vy).readonly()}),d({inserted:i().int()}),{kind:`mutation`,auth:`admin`}),update:D(d({namespace:l().optional(),collection:l(),id:l(),data:y(l(),o())}),v(),{kind:`mutation`,auth:`admin`}),delete:D(d({namespace:l().optional(),collection:l(),key:l()}),v(),{kind:`mutation`,auth:`admin`}),deleteWhere:D(d({namespace:l().optional(),collection:l(),filter:Ly}),d({deleted:i().int()}),{kind:`mutation`,auth:`admin`}),updateWhere:D(d({namespace:l().optional(),collection:l(),filter:Ly,data:y(l(),o())}),d({updated:i().int()}),{kind:`mutation`,auth:`admin`}),count:D(d({namespace:l().optional(),collection:l(),filter:Iy.optional()}),i(),{auth:`admin`}),aggregate:D(d({namespace:l().optional(),collection:l(),fields:S(Ry).readonly(),filter:Iy.optional()}),zy,{auth:`admin`}),histogram:D(d({namespace:l().optional(),collection:l(),field:l(),bucketSize:i().int().positive(),origin:i().int(),filter:Iy.optional()}),S(d({bucket:i().int(),count:i().int()})).readonly(),{auth:`admin`}),isEmpty:D(d({namespace:l().optional(),collection:l()}),C(),{auth:`admin`}),declareCollection:D(d({namespace:l().optional(),collection:l(),columns:S(Hy).readonly(),indexes:S(Uy).readonly().optional()}),v(),{kind:`mutation`,auth:`admin`})}},Gy=d({engineId:l(),kind:x([`relational`,`vector`]),displayName:l()}),Ky={name:`data-store-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getEngineInfo:D(v(),Gy,{auth:`admin`}),get:D(d({namespace:l().optional(),collection:l(),key:l()}),o(),{auth:`admin`}),set:D(d({namespace:l().optional(),collection:l(),key:l(),value:o()}),v(),{kind:`mutation`,auth:`admin`}),query:D(d({namespace:l().optional(),collection:l(),filter:Iy.optional(),columns:S(l()).readonly().optional()}),S(By).readonly(),{auth:`admin`}),insert:D(d({namespace:l().optional(),collection:l(),record:d({id:l().optional(),data:y(l(),o())})}),d({id:f([l(),i()])}),{kind:`mutation`,auth:`admin`}),upsert:D(d({namespace:l().optional(),collection:l(),conflict:S(l()).readonly(),record:Vy}),d({id:f([l(),i()])}),{kind:`mutation`,auth:`admin`}),insertMany:D(d({namespace:l().optional(),collection:l(),records:S(Vy).readonly()}),d({inserted:i().int()}),{kind:`mutation`,auth:`admin`}),update:D(d({namespace:l().optional(),collection:l(),id:l(),data:y(l(),o())}),v(),{kind:`mutation`,auth:`admin`}),delete:D(d({namespace:l().optional(),collection:l(),key:l()}),v(),{kind:`mutation`,auth:`admin`}),deleteWhere:D(d({namespace:l().optional(),collection:l(),filter:Ly}),d({deleted:i().int()}),{kind:`mutation`,auth:`admin`}),updateWhere:D(d({namespace:l().optional(),collection:l(),filter:Ly,data:y(l(),o())}),d({updated:i().int()}),{kind:`mutation`,auth:`admin`}),count:D(d({namespace:l().optional(),collection:l(),filter:Iy.optional()}),i(),{auth:`admin`}),aggregate:D(d({namespace:l().optional(),collection:l(),fields:S(Ry).readonly(),filter:Iy.optional()}),zy,{auth:`admin`}),histogram:D(d({namespace:l().optional(),collection:l(),field:l(),bucketSize:i().int().positive(),origin:i().int(),filter:Iy.optional()}),S(d({bucket:i().int(),count:i().int()})).readonly(),{auth:`admin`}),isEmpty:D(d({namespace:l().optional(),collection:l()}),C(),{auth:`admin`}),declareCollection:D(d({namespace:l().optional(),collection:l(),columns:S(Hy).readonly(),indexes:S(Uy).readonly().optional()}),v(),{kind:`mutation`,auth:`admin`})}},qy=x([`key-missing`,`wrong-key`,`key-file-unreadable`,`store-unavailable`,`not-initialized`,`decrypt-failed`]),Jy=p(`state`,[d({state:m(`ready`)}),d({state:m(`locked`),reason:qy})]),Yy=p(`kind`,[d({kind:m(`value`),value:l(),version:i().int()}),d({kind:m(`missing`)}),d({kind:m(`unavailable`),reason:qy}),d({kind:m(`forbidden`)})]),Xy=y(l(),Yy),Zy=d({ref:l(),owner:l(),scope:l(),fieldPath:l(),version:i().int(),createdAt:i(),updatedAt:i(),updatedBy:l(),lastReadAt:i().nullable()}),Qy=512,$y=S(l().min(1)).max(512),eb={name:`keychain`,scope:`system`,mode:`singleton`,internal:!0,methods:{put:D(d({ref:l().min(1),value:l().min(1)}),d({ref:l(),version:i().int()}),{kind:`mutation`,auth:`admin`}),resolve:D(d({refs:$y}),Xy,{auth:`admin`}),delete:D(d({refs:$y}),d({deleted:i().int()}),{kind:`mutation`,auth:`admin`}),listMeta:D(d({}),S(Zy).readonly(),{auth:`admin`}),getState:D(d({}),Jy,{auth:`admin`})}},tb=x([`config-file`,`previous-config-file`,`platform`,`default-file`]),nb=d({kind:tb,path:l().optional(),sharesBackupWithDatabase:C()}),rb=`trigger-file`,ib=d({id:l(),at:i(),actor:l(),lockedReason:l().nullable(),archived:i().int(),archivedCollection:l().nullable(),archivedKeysCollection:l().nullable(),clearedSettingsKeys:S(l()).readonly(),acknowledgedAt:i().nullable()}),ab=d({keychain:Jy,keySource:nb.nullable(),configuredSource:nb,fingerprint:l().nullable(),activeKeyId:l().nullable(),rotationPending:C(),retiredWraps:i().int(),recoveryKeyDownloadedAt:i().nullable(),secretCount:i().int(),lastReset:ib.nullable()}),ob=x([`in-use`,`orphan`,`unknown`]),sb=Zy.extend({usage:ob}),cb=x([`put`,`delete`,`reveal`,`rotate-master-key`,`purge-retired-keys`,`download-recovery-key`,`delete-orphans`,`reset`,`acknowledge-reset`,`initialize`]),lb=d({id:l(),at:i(),action:cb,actor:l(),ref:l().nullable(),detail:l().nullable()}),ub=`RESET KEYCHAIN`,db=x([`jwt-signing-key`]),fb={name:`keychain-admin`,scope:`system`,mode:`singleton`,methods:{status:D(d({}),ab,{auth:`admin`}),listSecrets:D(d({}),S(sb).readonly(),{auth:`admin`}),listAudit:D(d({limit:i().int().min(1).max(500).optional()}),S(lb).readonly(),{auth:`admin`}),reveal:D(d({ref:l().min(1)}),d({value:l(),version:i().int()}),{kind:`mutation`,auth:`admin`,caller:`required`}),setSystemSecret:D(d({name:db,value:l().min(16)}),d({ref:l(),version:i().int()}),{kind:`mutation`,auth:`admin`,caller:`required`}),deleteOrphans:D(d({refs:S(l().min(1)).max(1e3)}),d({deleted:S(l()).readonly(),kept:S(d({ref:l(),usage:ob})).readonly()}),{kind:`mutation`,auth:`admin`,caller:`required`}),rotateMasterKey:D(d({}),d({fingerprint:l(),keySource:nb}),{kind:`mutation`,auth:`admin`,caller:`required`}),purgeRetiredKeys:D(d({}),d({purged:i().int()}),{kind:`mutation`,auth:`admin`,caller:`required`}),downloadRecoveryKey:D(d({}),d({key:l(),fingerprint:l(),keySource:nb}),{kind:`mutation`,auth:`admin`,caller:`required`}),resetKeychain:D(d({confirm:m(ub)}),d({archivedCollection:l().nullable(),archived:i().int()}),{kind:`mutation`,auth:`admin`,caller:`required`}),resetReport:D(d({}),d({reset:ib.nullable(),pendingReentry:S(Zy).readonly()}),{auth:`admin`}),acknowledgeReset:D(d({}),d({acknowledged:C()}),{kind:`mutation`,auth:`admin`,caller:`required`})}},pb=[{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)`}],mb={hwaccel:`auto`,probedBestHwaccel:``},hb={name:`decoder`,scope:`system`,mode:`singleton`,preferredProvider:`decoder-nodeav`,methods:{getInfo:D(v(),d({id:l(),name:l(),hwaccel:l().optional(),probedBestHwaccel:l().optional()})),reprobeHwaccel:D(v(),d({backend:l()}),{kind:`mutation`,auth:`admin`})}},gb={name:`detection-pipeline`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{}},_b=x([`device`,`integration`]),vb=d({url:l(),label:l(),target:_b,host:l()}),yb={name:`device-admin-link`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{getAdminLink:D(d({deviceId:i().int().nonnegative()}),vb.nullable(),{auth:`admin`})}},bb=[`password`,`passwd`,`pwd`,`pass`,`user`,`username`,`usr`,`login`,`token`,`access_token`,`auth`,`authorization`,`apikey`,`api_key`,`secret`,`credential`,`credentials`,`session`,`sessionid`,`key`],xb=/[a-z][a-z0-9+.-]*:\/\/[^/\s:@'"]+:[^/\s:@'"]+@/i,Sb=/^[a-zA-Z0-9._-]+$/,Cb=/^\[[0-9a-fA-F:.]+\]$/;function wb(e){return e===`https`?443:80}function Tb(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(!Sb.test(t)&&!Cb.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(bb.includes(e.toLowerCase()))return{ok:!1,reason:`credential-query-key`};let r=e.port===null||e.port===wb(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 xb.test(o)?{ok:!1,reason:`userinfo-in-result`}:{ok:!0,url:o}}function Eb(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 Db=d({id:l(),system:l(),uniqueId:l().optional(),raw:y(l(),o()).optional()});function Ob(e){return{id:e.stableId,system:e.addonId}}function kb(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 Ab(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 jb=`sourceInfo`;function Mb(e){if(!e)return null;let t=e[jb];if(!t)return null;let n=Db.safeParse(t);return n.success?n.data:null}var Nb=x([`online`,`sleeping`,`offline`,`unknown`]),Pb=pe(()=>d({childNativeId:l(),name:l(),type:x(k),status:Nb,metadata:d({model:l().optional(),serialNumber:l().optional(),uid:l().optional(),rtspChannel:i().int().nonnegative().optional(),isBattery:C().optional(),isDoorbell:C().optional(),isMultifocal:C().optional(),externalLocation:l().optional(),manufacturer:l().optional(),integration:l().optional()}).default({}),alreadyAdopted:C(),adoptedDeviceId:i().int().nonnegative().nullable(),capabilities:S(l()).readonly().optional(),features:S(l()).readonly().optional(),sourceInfo:Db.optional(),children:S(Pb).readonly().optional()})),Fb=d({discovered:S(Pb),lastDiscoveryAt:i().int().nonnegative().nullable(),lastError:l().nullable()}),Ib={name:`device-discovery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Hub],status:{schema:Fb,kind:`poll`},runtimeState:Fb.extend({lastFetchedAt:i().int().nonnegative()}),durability:`session`,methods:{listDiscovered:D(d({deviceId:i().int().nonnegative()}),S(Pb).readonly()),refreshDiscovery:D(d({deviceId:i().int().nonnegative()}),S(Pb).readonly(),{kind:`mutation`,auth:`admin`}),adoptDevice:D(d({deviceId:i().int().nonnegative(),childNativeId:l(),name:l().optional()}),d({deviceId:i().int().nonnegative(),stableId:l()}),{kind:`mutation`,auth:`admin`}),releaseDevice:D(d({deviceId:i().int().nonnegative(),childDeviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`admin`})}},Lb=d({id:l(),label:l(),isDefault:C().optional()}),Rb=d({search:l().optional(),area:l().optional(),manufacturer:l().optional(),adoptedOnly:C().optional(),unadoptedOnly:C().optional()}),zb=d({integrationId:l(),page:i().int().positive().default(1),pageSize:i().int().positive().max(2e4).default(50),filter:l().optional(),filterText:Rb.optional()}),Bb=d({candidates:S(Pb).readonly(),totalCount:i().int().nonnegative(),page:i().int().positive(),pageSize:i().int().positive()}),Vb=d({integrationId:l(),childNativeId:l()}),Hb=d({lastDiscoveryAt:i().int().nonnegative().nullable(),candidateCount:i().int().nonnegative(),adoptedCount:i().int().nonnegative(),lastError:l().nullable()}),Ub=d({name:l().min(1).optional(),hiddenChildIds:S(l()).optional()}),Wb=d({integrationId:l(),childNativeIds:S(l()).min(1),filter:l().optional(),importLocations:C().optional(),perCandidate:y(l(),Ub).optional()}),Gb=d({adopted:S(d({childNativeId:l(),parentDeviceId:i().int().nonnegative(),accessoryDeviceIds:S(i().int().nonnegative()).readonly()})).readonly()}),Kb=d({integrationId:l(),camDeviceId:i().int().nonnegative()}),qb=d({camDeviceId:i().int().nonnegative(),resetToSource:C().optional()}),Jb=d({changed:C(),rebuiltChildren:i().int().nonnegative(),removedChildren:i().int().nonnegative().optional()}),Yb={name:`device-adoption`,scope:`system`,mode:`singleton`,status:{schema:Hb,kind:`poll`},methods:{listCandidateFilters:D(d({integrationId:l()}),d({filters:S(Lb)}),{auth:`admin`}),listCandidates:D(zb,Bb,{auth:`admin`}),getCandidate:D(Vb,Pb.nullable(),{auth:`admin`}),refresh:D(d({integrationId:l()}),Hb,{kind:`mutation`,auth:`admin`}),adopt:D(Wb,Gb,{kind:`mutation`,auth:`admin`}),release:D(Kb,v(),{kind:`mutation`,auth:`admin`}),resync:D(qb,Jb,{kind:`mutation`,auth:`admin`})}},Xb=x([`unlinked`,`linked`,`error`]),Zb=d({label:l(),value:l(),secret:C().optional()}),Qb=d({qr:l().optional(),fields:S(Zb).readonly().optional(),note:l().optional()}),$b=d({linkState:Xb,exposedDeviceCount:i(),error:l().optional(),setup:Qb.optional()}),ex=l(),tx=d({deviceId:l(),exposedAs:l().optional(),capabilities:S(l()).optional()}),nx=d({deviceId:l(),capabilities:S(l()).optional()}),rx=d({deviceId:l()}),ix={name:`device-export`,scope:`system`,mode:`collection`,providerKind:`device-export`,status:{schema:$b,kind:`poll`},exposesDeviceSettings:!0,methods:{getStatus:D(v(),$b),listSupportedDeviceKinds:D(v(),S(ex)),listExposedDevices:D(v(),S(tx)),exposeDevice:D(nx,v(),{kind:`mutation`,auth:`admin`}),unexposeDevice:D(rx,v(),{kind:`mutation`,auth:`admin`})}},ax=[`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`],ox=`map-pin`,sx=x(ax),cx=d({locationKey:l(),icon:sx});function lx(e){return e.trim().toLowerCase()}function ux(e){let t=sx.safeParse(e);return t.success?t.data:ox}var dx=400,fx=d({locationKey:l(),description:l()}),px=d({zoneKey:l(),label:l(),icon:sx.nullable(),locationKeys:S(l())});function mx(e){return e.trim().toLowerCase()}var hx=d({connected:C(),deviceCount:i(),error:l().optional(),motionSliceWriter:m(`orchestrator`).optional()}),gx=d({externalId:l(),name:l(),type:l(),metadata:y(l(),o()).optional()}),_x=d({stableId:l(),type:x(k),suggestedName:l(),prefilledConfig:y(l(),o()),sourceInfo:Db.optional(),alreadyOnboarded:C().optional(),onboardedDeviceId:i().optional(),onboardedName:l().optional()}),vx=d({id:i(),stableId:l(),addonId:l(),type:l(),name:l(),parentDeviceId:i().nullable(),online:C(),features:S(l()),config:y(l(),o()),sourceInfo:Db.optional()}),yx=d({status:x([`ok`,`error`]),labels:S(l()).optional(),error:l().optional()}),bx=o(),xx={name:`device-provider`,scope:`system`,mode:`collection`,methods:{start:D(v(),v(),{kind:`mutation`}),stop:D(v(),v(),{kind:`mutation`}),getStatus:D(v(),hx),getDevices:D(v(),S(d({id:l(),name:l(),type:l()}))),reloadDevice:D(d({stableId:l()}),d({deviceId:i()}),{kind:`mutation`,timeoutMs:3*6e4}),supportsDiscovery:D(d({}),C()),discoverDevices:D(d({params:y(l(),o()).optional()}),S(_x),{kind:`mutation`,auth:`admin`}),getDiscoveryParamsSchema:D(d({}),bx),getManualCreationType:D(d({}),d({deviceType:x(k).nullable()})),adoptDiscoveredDevice:D(d({candidate:_x}),vx,{kind:`mutation`,auth:`admin`}),supportsManualCreation:D(d({}),C()),getChildCreationSchema:D(d({type:x(k)}),bx),createDevice:D(d({type:x(k),config:y(l(),o())}),vx,{kind:`mutation`,auth:`admin`}),testCreationField:D(d({type:x(k),key:l(),value:o(),formValues:y(l(),o()).optional()}),yx,{kind:`mutation`,auth:`admin`})}},Sx=d({childKey:l(),section:l(),order:i().optional(),collapsed:C().optional()}),Cx=d({unit:l().min(1).optional(),precision:i().int().min(0).max(10).optional()}),wx=d({icon:l().min(1).optional(),label:l().min(1).optional(),unit:l().min(1).optional(),precision:i().int().min(0).max(10).optional(),hidden:C().optional(),perCap:y(l(),Cx).optional()}),Tx=d({unit:l().min(1).optional(),precision:i().int().min(0).max(10).optional(),icon:l().min(1).optional()}),Ex=d({id:i(),stableId:l(),addonId:l(),type:x(k),name:l(),location:l().nullable(),disabled:C(),parentDeviceId:i().nullable(),role:l().nullable().optional(),online:C(),probed:C().optional(),features:S(l()),isCamera:C(),config:y(l(),o()),secretConfigPaths:S(l()).optional(),metadata:y(l(),o()).nullable().optional(),sourceInfo:Db.optional(),integrationId:l().optional(),linkDeviceId:i().nullable().optional(),primaryChildEntityId:l().nullable().optional(),childLayout:S(Sx).readonly().optional(),display:wx.optional()}),Dx=d({key:l(),value:o(),description:l().optional()}),Ox=x([`manual`]),kx=d({deviceId:i(),name:l(),location:l().nullable(),features:S(l()),producesTrackedEvents:C().optional()}),Ax=d({deviceIds:S(i().int().positive()),trackedDeviceIds:S(i().int().positive()).optional()}),jx={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:[k.Camera],sourceCaps:`any`,cardinality:`many`,value:Ax},Mx=d({deviceId:i(),mode:Ox,devices:S(kx)}),Nx=d({deviceId:i(),entries:S(d({capName:l(),kind:x([`native`,`wrapped`]),providerAddonId:l(),providerNodeId:l(),nativeAddonId:l()}))}),Px=p(`kind`,[d({kind:m(`value`),wrapperAddonId:l().nullable()}),d({kind:m(`missing`)}),d({kind:m(`failed`),error:l()})]),Fx=d({id:i(),stableId:l(),type:l(),name:l(),location:l().nullable(),disabled:C(),parentDeviceId:i().nullable(),role:l().nullable().optional()}),Ix=d({id:i(),stableId:l(),addonId:l(),type:l(),name:l(),userNamed:C().optional(),location:l().nullable(),disabled:C(),parentDeviceId:i().nullable(),metadata:y(l(),o()).nullable().optional(),sourceInfo:Db.optional(),integrationId:l().optional(),linkDeviceId:i().nullable().optional(),primaryChildEntityId:l().nullable().optional(),childLayout:S(Sx).readonly().optional(),role:l().nullable().optional(),display:wx.optional()}),Lx=o().nullable(),Rx=d({streamId:l(),width:i().optional(),height:i().optional(),codec:l().optional(),fps:i().optional(),bitrateKbps:i().optional()}),zx=d({addonId:l(),stableId:l(),id:i(),type:l(),name:l(),location:l().nullable().optional(),disabled:C().optional(),parentDeviceId:i().nullable(),role:l().nullable().optional(),features:S(l()).optional(),config:y(l(),o()),secretConfigPaths:S(l()).optional()}),Bx=d({deviceId:i()}),Vx=d({deviceId:i(),data:y(l(),o()),secretConfigPaths:S(l()).optional()}),Hx=x([`off`,`on`,`not-offered`,`unreachable`]),Ux=d({deviceId:i(),switchId:kc,outcome:Hx,detail:l().optional()}),Wx=d({sourceId:i(),targetId:i(),switches:S(Ux).readonly(),sourceStillLive:S(kc).readonly(),swapped:C()}),Gx={name:`device-manager`,scope:`system`,mode:`singleton`,extensionSlots:[jx],methods:{allocateDeviceId:D(d({addonId:l(),stableId:l()}),d({id:i()}),{kind:`mutation`}),migrateDevice:D(d({sourceId:i(),targetId:i()}),Wx,{kind:`mutation`,auth:`admin`,timeoutMs:12*6e4}),registerDevice:D(zx,v(),{kind:`mutation`}),removeDevice:D(Bx,v(),{kind:`mutation`}),persistConfig:D(Vx,v(),{kind:`mutation`,auth:`admin`}),loadConfig:D(d({deviceId:i()}),y(l(),o()),{auth:`admin`}),loadRuntimeState:D(d({deviceId:i()}),y(l(),o()),{auth:`admin`}),loadMeta:D(d({deviceId:i()}),Ix.nullable()),setName:D(d({deviceId:i(),name:l()}),v(),{kind:`mutation`,auth:`admin`}),setLocation:D(d({deviceId:i(),location:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),setType:D(d({deviceId:i(),type:x(k)}),v(),{kind:`mutation`,auth:`admin`}),setIntegrationId:D(d({deviceId:i(),integrationId:l()}),v(),{kind:`mutation`,auth:`admin`}),setLinkDeviceId:D(d({deviceId:i(),linkDeviceId:i().nullable()}),v(),{kind:`mutation`,auth:`admin`}),setPrimaryChildEntityId:D(d({deviceId:i(),primaryChildEntityId:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),setChildLayout:D(d({deviceId:i(),childLayout:S(Sx).readonly()}),v(),{kind:`mutation`,auth:`admin`}),setDisplay:D(d({deviceId:i(),display:wx.nullable()}),v(),{kind:`mutation`,auth:`admin`}),getRoleDisplayDefaults:D(d({}),d({defaults:y(l(),Tx)}),{kind:`query`}),setRoleDisplayDefaults:D(d({defaults:y(l(),Tx)}),v(),{kind:`mutation`,auth:`admin`}),getWireableFields:D(d({deviceId:i(),includeSynthesizable:C().optional()}),d({caps:S(d({cap:l(),fields:S(d({path:l(),kind:x([`string`,`number`,`boolean`,`enum`]),enumValues:S(l()).optional(),item:C().optional()})).readonly(),itemArray:d({path:l(),keyField:l()}).optional()})).readonly()}),{kind:`query`}),setRole:D(d({deviceId:i(),role:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),applyInitialMeta:D(d({deviceId:i(),name:l().optional(),location:l().nullable().optional(),type:x(k).optional(),integrationId:l().optional(),linkDeviceId:i().nullable().optional(),role:l().nullable().optional()}),v(),{kind:`mutation`,auth:`admin`}),setMetadata:D(d({deviceId:i(),patch:y(l(),o())}),v(),{kind:`mutation`,auth:`admin`}),listLocations:D(v(),S(l())),addLocation:D(d({name:l()}),v(),{kind:`mutation`,auth:`admin`}),removeLocation:D(d({name:l(),cascade:C().optional()}),v(),{kind:`mutation`,auth:`admin`}),renameLocation:D(d({from:l(),to:l()}),d({moved:i()}),{kind:`mutation`,auth:`admin`}),listLocationIcons:D(v(),S(cx)),setLocationIcon:D(d({location:l(),icon:sx.nullable()}),v(),{kind:`mutation`,auth:`admin`}),listLocationDescriptions:D(v(),S(fx)),setLocationDescription:D(d({location:l(),description:l().max(400).nullable()}),v(),{kind:`mutation`,auth:`admin`}),listSiteZones:D(v(),S(px)),setSiteZone:D(d({name:l(),icon:sx.nullable().optional()}),v(),{kind:`mutation`,auth:`admin`}),removeSiteZone:D(d({name:l()}),v(),{kind:`mutation`,auth:`admin`}),renameSiteZone:D(d({from:l(),to:l()}),v(),{kind:`mutation`,auth:`admin`}),setLocationZone:D(d({location:l(),zone:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),setDisabled:D(d({deviceId:i(),disabled:C()}),v(),{kind:`mutation`,auth:`admin`}),listPersistedByAddon:D(d({addonId:l()}),S(Fx)),listAll:D(d({addonId:l().optional(),projection:x([`full`,`slim`]).optional(),isCamera:C().optional(),deviceIds:S(i()).optional()}),S(Ex)),getDevice:D(d({deviceId:i()}),Ex.nullable()),getChildren:D(d({parentDeviceId:i()}),S(Ex)),getChildrenBatch:D(d({parentDeviceIds:S(i()).max(256)}),y(l(),S(Ex))),getLinkedDevices:D(d({deviceId:i()}),d({mode:Ox,devices:S(kx)})),getLinkedDevicesBatch:D(d({deviceIds:S(i())}),S(Mx)),getStreamSources:D(d({deviceId:i()}),S(tr)),getConfigSchema:D(d({deviceId:i()}),S(Dx)),getSettingsSchema:D(d({deviceId:i()}),Lx),updateConfig:D(d({deviceId:i(),values:y(l(),o())}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),enable:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),disable:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),remove:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),removeByIntegration:D(d({integrationId:l()}),d({removed:i()}),{kind:`mutation`,auth:`admin`}),getStreamProfileMap:D(d({deviceId:i()}),y(l(),l().nullable())),setStreamProfileMap:D(d({deviceId:i(),profileMap:y(l(),l().nullable())}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),probeStreams:D(d({deviceId:i()}),S(Rx),{kind:`mutation`,auth:`admin`}),getBindings:D(d({deviceId:i()}),Nx),getBindingsBatch:D(d({deviceIds:S(i())}),S(Nx)),getAllBindings:D(d({}),S(Nx)),listDeviceIdsByCaps:D(d({capNames:S(l().min(1)).min(1).max(16)}),S(i())),setWrapperActive:D(d({deviceId:i(),capName:l(),wrapperAddonId:l(),active:C()}),v(),{kind:`mutation`,auth:`admin`}),getWrapperActivation:D(d({deviceId:i(),capName:l().min(1)}),Px),listWrappersForCap:D(d({capName:l()}),S(l())),listBindableCapsForDeviceType:D(d({deviceType:l()}),S(d({capName:l(),wrappers:S(l())}))),getDeviceSettingsAggregate:D(d({deviceId:i()}),Hm.nullable()),getDeviceLiveInfoAggregate:D(d({deviceId:i()}),Hm.nullable()),getDeviceAggregate:D(d({deviceId:i()}),d({settings:Hm.nullable(),live:Hm.nullable()})),runDeviceAction:D(d({deviceId:i().int().nonnegative(),action:l().min(1),input:o()}),o(),{kind:`mutation`}),updateDeviceField:D(d({deviceId:i(),writerCapName:l(),writerAddonId:l(),key:l(),value:o()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),updateDeviceFieldsBatch:D(d({deviceId:i(),changes:S(d({writerCapName:l(),writerAddonId:l(),key:l(),value:o()}))}),d({success:m(!0),failures:S(d({writerCapName:l(),writerAddonId:l(),error:l()}))}),{kind:`mutation`,auth:`admin`}),discoverDevices:D(d({addonId:l()}),S(_x),{kind:`mutation`,auth:`admin`}),adoptDevice:D(d({addonId:l(),candidate:_x,integrationId:l().optional()}),vx,{kind:`mutation`,auth:`admin`}),getCreationSchema:D(d({addonId:l(),type:x(k)}),o().nullable()),createDevice:D(d({addonId:l(),type:x(k),config:y(l(),o()),integrationId:l().optional()}),vx,{kind:`mutation`,auth:`admin`}),testCreationField:D(d({addonId:l(),type:x(k),key:l(),value:o(),formValues:y(l(),o()).optional()}),yx,{kind:`mutation`,auth:`admin`}),adoptionListCandidateFilters:D(d({addonId:l(),integrationId:l()}),d({filters:S(Lb)}),{auth:`admin`}),adoptionListCandidates:D(zb.extend({addonId:l()}),Bb,{auth:`admin`}),adoptionRefresh:D(d({addonId:l(),integrationId:l()}),Hb,{kind:`mutation`,auth:`admin`}),adoptionAdopt:D(Wb.extend({addonId:l()}),Gb,{kind:`mutation`,auth:`admin`}),adoptionRelease:D(Kb.extend({addonId:l()}),v(),{kind:`mutation`,auth:`admin`}),adoptionStartJob:D(Wb.extend({addonId:l()}),d({jobId:l()}),{kind:`mutation`,auth:`admin`}),adoptionListJobs:D(d({addonId:l(),integrationId:l().optional()}),S(Dc).readonly(),{auth:`admin`}),adoptionCancelJob:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),adoptionResync:D(qb,Jb,{kind:`mutation`,auth:`admin`}),discoveryProviders:D(d({}),d({providers:S(d({addonId:l(),label:l()})).readonly()}),{auth:`admin`}),discoverAllProviders:D(d({}),d({groups:S(d({addonId:l(),label:l(),candidates:S(_x).readonly(),error:l().nullable()})).readonly()}),{kind:`mutation`,auth:`admin`}),discoverProvider:D(d({addonId:l(),params:y(l(),o()).optional()}),d({candidates:S(_x).readonly()}),{kind:`mutation`,auth:`admin`}),providerCreationType:D(d({addonId:l()}),d({deviceType:x(k).nullable()}),{auth:`admin`}),providerDiscoveryParamsSchema:D(d({addonId:l()}),o(),{auth:`admin`}),testField:D(d({deviceId:i(),key:l(),value:o()}),yx,{kind:`mutation`,auth:`admin`}),getDeviceStatusAggregate:D(d({deviceId:i(),caps:S(l()).readonly().optional()}),y(l(),o().nullable())),getDeviceStatusAggregateBatch:D(d({deviceIds:S(i()).readonly(),caps:S(l()).readonly().optional()}),y(l(),y(l(),o().nullable())))}},Kx=[`linked-devices`],qx=x(Kx),Jx={"linked-devices":{descriptor:jx,declaringCap:`device-manager`,hostDeviceTypes:[k.Camera]}},Yx=p(`slot`,[Ax.extend({slot:m(`linked-devices`)})]),Xx=[k.Camera],Zx=`:`,Qx=`listSlots`,$x=p(`state`,[d({state:m(`ok`)}),d({state:m(`unreachable`),reason:l()})]),eS=d({source:l(),label:l(),addonId:l().optional(),availability:$x}),tS=x([`ok`,`missing`,`foreign`,`unavailable`]),nS=d({deviceId:i().int(),name:l().nullable(),health:tS,detail:l().optional()}),rS=d({state:x([`active`,`inactive`,`unknown`]),authority:l(),detail:l().optional()}),iS=d({state:m(`ok`),slotRef:l(),slot:qx,authority:l(),activation:rS.nullable(),value:Yx,sources:S(nS),impliedSources:S(nS).optional()}),aS=d({state:m(`unreachable`),addonId:l(),reason:l()}),oS=p(`state`,[iS,aS]);function sS(e,t){return{state:`unreachable`,addonId:e,reason:t}}var cS=d({deviceId:i().int(),name:l(),type:l(),location:l().nullable(),parentName:l().nullable(),suggested:C(),reason:l().nullable()}),lS=d({candidates:S(cS)}),uS=d({applied:m(!0),reload:x([`none`,`host`,`parent`])}),dS=d({deviceId:i().int(),slotRef:l().min(1)}),fS=dS.extend({value:Yx}),pS={name:`device-extension`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:Xx,deviceConfig:{ui:{kind:`widget`,widgetId:`host/extensions-panel`,tab:`general`,label:`Extensions`,order:72}},methods:{listSources:D(d({deviceId:i().int()}),S(eS)),listSlots:D(d({deviceId:i().int()}),S(oS)),listCandidates:D(dS,lS),setSlot:D(fS,uS,{kind:`mutation`,auth:`admin`})}},mS=x([`replace`,`add`]),hS=p(`ok`,[d({ok:m(!0),changed:C()}),d({ok:m(!1),code:x([`owned-by-other`,`not-claimed`,`field-not-claimed`,`invalid-slice`,`unknown-device`,`row-unreadable`,`migration-in-flight`]),message:l()})]),gS=d({deviceId:i(),capName:l(),owner:l().min(1),mode:mS,fields:S(l().min(1)).min(1)}),_S=p(`state`,[d({state:m(`loaded`),claims:S(gS)}),d({state:m(`not-loaded`),reason:l()})]),vS={name:`device-state`,scope:`system`,mode:`singleton`,methods:{getSnapshot:D(d({deviceId:i()}),y(l(),y(l(),o()))),getCapSlice:D(d({deviceId:i(),capName:l()}),y(l(),o()).nullable()),getAllSnapshots:D(d({}),y(l(),y(l(),y(l(),o())))),setCapSlice:D(d({deviceId:i(),capName:l(),slice:y(l(),o())}),v(),{kind:`mutation`}),claimFields:D(d({deviceId:i(),capName:l(),owner:l().min(1),mode:mS,fields:S(l().min(1)).min(1),values:y(l(),o())}),hS,{kind:`mutation`,auth:`admin`}),patchOwnedFields:D(d({deviceId:i(),capName:l(),owner:l().min(1),values:y(l(),o())}),hS,{kind:`mutation`,auth:`admin`}),releaseClaim:D(d({deviceId:i(),capName:l(),owner:l().min(1)}),hS,{kind:`mutation`,auth:`admin`}),listClaims:D(d({ownerPrefix:l().optional()}),_S,{auth:`admin`}),getNativeCapSlice:D(d({deviceId:i(),capName:l()}),y(l(),o()).nullable(),{auth:`admin`})},events:{onChanged:Pr(d({deviceId:i(),capName:l(),slice:y(l(),o())}))}},yS=d({embedding:S(i()),inferenceMs:i()}),bS=x([`image`,`text`]),xS=d({modelId:l(),tower:bS,nodeId:l(),crashes:i(),windowMs:i(),sinceMs:i(),lastReason:l()}),SS=d({modelId:l(),tower:bS,nodeId:l(),attempts:i(),sinceMs:i(),lastReason:l()}),CS=d({modelId:l(),embeddingDim:i(),ready:C(),nodeId:l().optional(),failedModels:S(xS).optional(),failedRequirements:S(SS).optional()}),wS=`embedding-model-failed`,TS=`embedding-requirements-unavailable`,ES=`embedding-requirements-failed`,DS=x([wS,TS,ES]);function OS(e,t){return`[${e} model=${t.modelId} tower=${t.tower} node=${t.nodeId}]`}function kS(e){return Error(`${OS(wS,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 AS(e,t){return Error(`${OS(TS,e)} ${e.modelId} (${e.tower} tower) on ${e.nodeId}: ${t}`)}function jS(e){return Error(`${OS(ES,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 MS=RegExp(`\\[(${wS}|${TS}|${ES}) model=([^\\s\\]]+) tower=(image|text) node=([^\\s\\]]+)\\]`);function NS(e){let t=e instanceof Error?e.message:String(e),n=MS.exec(t);if(n===null)return null;let r=DS.safeParse(n[1]),i=bS.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 PS(e){return FS(e)!==null}function FS(e){let t=NS(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 IS={name:`embedding-encoder`,scope:`system`,mode:`collection`,internal:!0,methods:{encode:D(d({crop:b(Uint8Array),width:i(),height:i()}),yS,{auth:`admin`}),encodeText:D(d({text:l(),modelId:l().min(1).optional()}),yS,{auth:`admin`}),getInfo:D(v(),CS,{auth:`admin`}),resetFailedModels:D(d({modelId:l().min(1).optional()}),d({cleared:S(l()),nodeId:l()}),{kind:`mutation`,auth:`admin`})}},LS=d({reason:l(),count:i().int().nonnegative()}),RS=d({family:l(),deviceId:i().int().positive(),variant:l().optional(),sinceMs:i(),atMs:i(),attempts:i().int().nonnegative(),succeeded:i().int().nonnegative(),reasons:S(LS).readonly()}),zS={name:`failure-contribution`,scope:`system`,mode:`collection`,internal:!0,methods:{list:D(v(),S(RS).readonly())},mount:{kind:`skip`}},BS=d({name:l(),path:l()}),VS=d({path:l(),entries:S(BS).readonly(),freeBytes:i(),totalBytes:i()}),HS={name:`filesystem-browse`,scope:`system`,mode:`singleton`,internal:!0,methods:{listAllowedRoots:D(v(),S(l()).readonly(),{auth:`admin`}),browse:D(d({path:l()}),VS,{auth:`admin`}),createDir:D(d({path:l()}),d({path:l()}),{kind:`mutation`,auth:`admin`})}},US=`https://camstack.zentik.app`,WS=`/viewer/camstack`;function GS(e){if(e==null||e===``)return!1;try{return new URL(e).origin===US}catch{return!1}}function KS(e){let t=e.baseUrl??e.resolved;return GS(t)?{form:`app`,hubBaseUrl:e.appLinkHub??null}:{form:`hub`,hubBaseUrl:t}}function qS(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==`https:`&&t.protocol!==`http:`||t.username!==``||t.password!==``||t.hostname===``?null:t.origin}function JS(e){let t=e=>e.kind!==`public`||!e.baseUrl.startsWith(`https://`)?null:e.interfaceKind===`public`?0:e.interfaceKind===`vpn`?1:null;return e.flatMap(e=>{let n=t(e),r=qS(e.baseUrl);return n===null||r===null?[]:[{r:n,p:e.priority,origin:r}]}).toSorted((e,t)=>e.r-t.r||e.p-t.p)[0]?.origin??null}function YS(e){switch(e.kind){case`camera`:{if(!Number.isInteger(e.deviceId)||e.deviceId<=0)return null;let t=e.atMs;return{path:`/camera/${String(e.deviceId)}`,query:t!==void 0&&Number.isFinite(t)?[[`at`,String(Math.trunc(t))]]:[]}}case`events`:return{path:`/events`,query:[]};case`notifications`:return{path:`/notifications`,query:[]}}}function XS(e){return e.length===0?``:`?${e.map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join(`&`)}`}function ZS(e){let t=YS(e.destination);if(t===null)return null;let n=e.base.hubBaseUrl,r=n===null?``:n.replace(/\/+$/,``);if(e.base.form===`app`){let e=r===``?null:qS(r),n=e===null?t.query:[...t.query,[`hub`,e]];return`${US}${t.path}${XS(n)}`}return r===``||GS(r)?null:`${r}${WS}${t.path}${XS(t.query)}`}var QS=[`appConnections`,`notificationTaps`,`internal`,`publicEndpoint`],$S=[`notificationTaps`,`internal`,`publicEndpoint`];function eC(e){return e!==`appConnections`}var tC={appConnections:[],notificationTaps:null,internal:null,publicEndpoint:null},nC=/^\d{1,3}(?:\.\d{1,3}){3}$/;function rC(e){try{let t=new URL(e).hostname;return t.length>0?t:null}catch{return null}}function iC(e){return e.replace(/\/+$/,``)}function aC(e){return e.kind===`public`&&e.interfaceKind===`vpn`}function oC(e){return e.kind===`public`&&e.interfaceKind===`public`}function sC(e){return(e.kind===`lan-ipv4`||e.kind===`lan-ipv6`)&&e.plausible}function cC(e){if(e.kind!==`lan-ipv4`||!e.plausible)return!1;let t=rC(e.baseUrl);return t!==null&&nC.test(t)}function lC(e,t){return t.kind===`loopback`||t.kind===`app-link`||t.kind===`custom`||rC(t.baseUrl)===null?null:e===`internal`?cC(t)?0:sC(t)?1:aC(t)?2:null:oC(t)?0:aC(t)?1:cC(t)?2:sC(t)?3:null}var uC=new Set([`localhost`,`0.0.0.0`,`::1`,`[::1]`,`::`,`[::]`]);function dC(e){let t=e.toLowerCase();return uC.has(t)||t.endsWith(`.localhost`)?!0:/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function fC(e){let t=e.trim();if(t===``)return{ok:!1,reason:`Enter an address, e.g. https://192.168.1.50:4443.`};let n;try{n=new URL(t)}catch{return{ok:!1,reason:`Not a URL — include http:// or https://.`}}return n.protocol!==`https:`&&n.protocol!==`http:`?{ok:!1,reason:`Use an http:// or https:// address.`}:n.username!==``||n.password!==``?{ok:!1,reason:`The address must not carry a user name or password.`}:n.hostname===``?{ok:!1,reason:`The address has no host.`}:dC(n.hostname)?{ok:!1,reason:`A loopback address names whoever dials it, never this hub — use an address other machines reach.`}:n.pathname!==`/`||n.search!==``||n.hash!==``?{ok:!1,reason:`Enter only the address (scheme, host and port), without a path.`}:{ok:!0,baseUrl:n.origin}}var pC=`The public endpoint needs an https:// address: passkeys and most identity providers refuse a plain-http origin. Accept http only when sign-in and notification links never leave your own network.`;function mC(e,t,n={}){if(GS(t))return e===`notificationTaps`?{ok:!0,baseUrl:US}:{ok:!1,reason:`The CamStack app link is not a hub address — only notification taps can use it.`};let r=fC(t);return r.ok&&e===`publicEndpoint`&&r.baseUrl.startsWith(`http:`)&&n.acceptInsecureHttp!==!0?{ok:!1,reason:pC}:r}function hC(e,t){if(t===null||t===``)return null;let n=mC(e,t,{acceptInsecureHttp:!0});return n.ok?n.baseUrl:null}function gC(e,t){let n=e.flatMap(e=>{let n=lC(t,e);return n===null?[]:[{rank:n,priority:e.priority,endpoint:e}]}).toSorted((e,t)=>e.rank-t.rank||e.priority-t.priority)[0];return n===void 0?null:iC(n.endpoint.baseUrl)}function _C(e,t,n){let r=hC(t,n);if(r!==null)return{flagged:r,resolved:r,source:`flagged`};let i=gC(e,t);return{flagged:null,resolved:i,source:i===null?`none`:`auto`}}function vC(e,t){return _C(e,`internal`,t.internal)}function yC(e,t){return _C(e,`publicEndpoint`,t.publicEndpoint)}function bC(e){let t=hC(`notificationTaps`,e.notificationTaps);return t!==null&&!GS(t)?{flagged:t,resolved:t,source:`flagged`}:{flagged:null,resolved:US,source:`auto`}}function xC(e){return e.kind===`lan-ipv4`?!0:e.kind===`public`&&e.interfaceKind===`public`}function SC(e,t){let n=e.filter(xC);if(t.appConnections.length===0)return n;let r=new Set(t.appConnections),i=e.filter(e=>r.has(e.baseUrl));return i.length>0?i:n}function CC(e,t){let n=new Set(t.appConnections),r=SC(e,t),i=r.some(e=>n.has(e.baseUrl));return{flagged:t.appConnections,resolved:r.map(e=>e.baseUrl),source:r.length===0?`none`:i?`flagged`:`auto`}}function wC(e,t,n){return{appConnections:CC(e,n),notificationTaps:bC(n),internal:vC(t,n),publicEndpoint:yC(t,n)}}function TC(e){return e===null?null:rC(e)}var EC=`camstack`,DC=`_camstack._tcp.local`,OC={nodeId:`nodeId`,version:`version`,role:`role`,url:`url`},kC=`hub`,AC=6e5,jC=60*6e4,MC=d({inputTokens:i(),outputTokens:i()}),NC=x([`timeout`,`rate-limited`,`auth`,`refusal`,`bad-request`,`unavailable`,`no-profile`,`budget-exceeded`,`adapter-error`]),PC=d({ok:m(!0),text:l(),model:l(),usage:MC,truncated:C(),latencyMs:i()}),FC=x([`guardrail`,`model`]),IC=d({ok:m(!1),code:NC,message:l(),retryAfterMs:i().optional(),refusalSource:FC.optional()}),LC=p(`ok`,[PC,IC]),RC=d({bytes:b(Uint8Array),mimeType:l()}),zC=d({enabled:C().default(!1),maxAttempts:i().int().min(1).max(5).default(1)}),BC={totalMs:6e4,connectMs:1e4,firstTokenMs:12e4,idleMs:6e4},VC=d({addonId:l().optional(),profileId:l().optional(),consumer:l(),system:l().optional(),prompt:l(),jsonSchema:y(l(),o()).optional(),maxTokens:i().int().positive().optional(),temperature:i().optional(),topP:i().min(0).max(1).optional(),topK:i().int().positive().optional(),timeoutMs:i().int().positive().optional(),retry:zC.optional(),requestId:l().optional()}),HC=d({url:l(),filename:l(),sizeBytes:i(),sha256:l().optional()}),UC=p(`kind`,[d({kind:m(`catalog`),catalogId:l()}),d({kind:m(`url`),url:l(),sha256:l().optional(),label:l().optional(),sizeBytes:i().optional(),extraFiles:S(HC).optional()}),d({kind:m(`path`),path:l()})]),WC=d({nodeId:l(),engine:x([`llama-cpp`]),model:UC,contextSize:i().int().default(4096),gpuLayers:i().int().default(0),threads:i().int().optional(),parallel:i().int().default(1),batchSize:i().int().positive().optional(),ubatchSize:i().int().positive().optional(),flashAttention:C().default(!1),mlock:C().default(!1),noMmap:C().default(!1),cacheTypeK:x([`f32`,`f16`,`q8_0`,`q5_1`,`q5_0`,`q4_1`,`q4_0`]).optional(),cacheTypeV:x([`f32`,`f16`,`q8_0`,`q5_1`,`q5_0`,`q4_1`,`q4_0`]).optional(),extraArgs:S(l()).default([]),autoStart:C().default(!1),idleStopMinutes:i().int().default(30)}),GC=d({phase:x([`downloading`,`verifying`]),file:l(),fileIndex:i().int(),fileCount:i().int(),downloadedBytes:i(),totalBytes:i().optional()}),KC=d({nodeId:l(),state:x([`stopped`,`downloading`,`starting`,`ready`,`crashed`,`failed`]),pid:i().optional(),port:i().optional(),modelPath:l().optional(),modelId:l().optional(),downloadProgress:i().min(0).max(1).optional(),download:GC.optional(),lastError:l().optional(),crashesInWindow:i(),memoryBytes:i().optional(),vramBytes:i().optional()}),qC=d({file:l(),sizeBytes:i(),catalogId:l().optional(),installedAt:i().optional(),path:l().optional()}),JC=d({nodeId:l(),modelsBytes:i(),freeBytes:i().optional()}),YC=VC.extend({images:S(RC).optional(),runtime:WC,timeoutMs:i().int().positive().optional()}),XC=x([`deviceNotEligible`,`appleIntelligenceNotEnabled`,`modelNotReady`,`osTooOld`,`helperMissing`,`helperCrashed`]),ZC=p(`state`,[d({state:m(`available`),osVersion:l(),contextSize:i().int().positive(),languages:S(l()),imageInput:C()}),d({state:m(`unavailable`),reason:XC,osVersion:l().nullable(),detail:l()}),d({state:m(`unsupported-platform`),platform:l()}),d({state:m(`unknown`),error:l()})]),QC=VC.extend({images:S(RC).optional(),timeoutMs:i().int().positive().optional()}),$C=d({requestId:l()}),ew={name:`llm-runtime`,scope:`system`,mode:`singleton`,internal:!0,methods:{complete:D(YC,LC,{kind:`mutation`,auth:`admin`,timeoutMs:AC}),ensureStarted:D(d({runtime:WC}),KC,{kind:`mutation`,auth:`admin`,timeoutMs:AC}),stop:D(d({}),v(),{kind:`mutation`,auth:`admin`}),status:D(d({}),KC,{auth:`admin`}),installModel:D(d({model:UC}),v(),{kind:`mutation`,auth:`admin`,timeoutMs:jC}),deleteModel:D(d({file:l()}),v(),{kind:`mutation`,auth:`admin`}),listLocalModels:D(d({}),S(qC),{auth:`admin`}),getDiskUsage:D(d({}),JC,{auth:`admin`}),cancel:D($C,v(),{kind:`mutation`,auth:`admin`}),appleAvailability:D(d({}),ZC,{auth:`admin`}),completeApple:D(QC,LC,{kind:`mutation`,auth:`admin`,timeoutMs:AC})}},tw=x([`openai-compatible`,`openai`,`anthropic`,`google`,`managed-local`,`apple-foundation`]),nw=d({id:l(),name:l(),kind:tw,addonId:l(),enabled:C(),model:l(),baseUrl:l().optional(),apiKey:l().optional(),supportsVision:C(),temperature:i().min(0).max(2).optional(),topP:i().min(0).max(1).optional(),topK:i().int().positive().optional(),maxTokens:i().int().positive().optional(),contextLength:i().int().positive().optional(),systemPrompt:l().optional(),timeoutMs:i().int().positive().default(6e4),connectTimeoutMs:i().int().positive().default(1e4),firstTokenTimeoutMs:i().int().positive().default(12e4),idleTimeoutMs:i().int().positive().default(6e4),retry:zC.default({enabled:!1,maxAttempts:1}),toolsEnabled:C().default(!1),extraHeaders:y(l(),l()).optional(),runtime:WC.optional(),appleFoundation:d({nodeId:l()}).optional()}),rw=o(),iw=d({kind:tw,label:l(),icon:l(),addonId:l(),configSchema:rw}),aw=f([d({consumer:l()}),d({purpose:x([`text`,`vision`])})]),ow=d({selector:aw,profileId:l()}),sw=d({day:l(),consumer:l(),profileId:l(),calls:i(),okCalls:i(),errorCalls:i(),inputTokens:i(),outputTokens:i(),avgLatencyMs:i()}),cw=d({id:l(),label:l(),family:l(),purpose:x([`text`,`vision`]),url:l(),sha256:l(),sizeBytes:i(),quantization:l(),minRamBytes:i(),contextSizeDefault:i().int(),mmprojUrl:l().optional()}),lw=p(`ok`,[d({ok:m(!0),model:UC,label:l(),repo:l(),quantization:l(),purpose:x([`text`,`vision`]),totalBytes:i(),extraFilenames:S(l())}),d({ok:m(!1),code:l(),message:l(),candidates:S(l()).optional(),requiredBytes:i().optional()})]),uw=d({nodeId:l(),reachable:C(),status:KC.optional(),disk:JC.optional(),error:l().optional(),apple:ZC.optional()}),dw=VC.extend({images:S(RC).min(1)}),fw=d({addonId:l(),profileId:l()}),pw={name:`llm`,scope:`system`,mode:`collection`,internal:!1,providerKind:`ai`,nodeIdMode:`data`,methods:{generate:D(VC,LC,{kind:`mutation`,timeoutMs:AC}),generateVision:D(dw,LC,{kind:`mutation`,timeoutMs:AC}),cancel:D(d({addonId:l().optional(),requestId:l()}),v(),{kind:`mutation`}),listProfileKinds:D(d({}),S(iw)),listProfiles:D(d({}),S(nw)),upsertProfile:D(d({profile:nw}),nw,{kind:`mutation`,auth:`admin`}),deleteProfile:D(fw,v(),{kind:`mutation`,auth:`admin`}),testProfile:D(fw,LC,{kind:`mutation`,auth:`admin`,timeoutMs:AC}),listModels:D(fw,S(l())),getDefaults:D(d({}),S(ow)),setDefault:D(d({selector:aw,profileId:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),getUsage:D(d({since:i().optional(),until:i().optional(),consumer:l().optional(),profileId:l().optional()}),S(sw)),listModelCatalog:D(d({}),S(cw)),listRuntimeNodes:D(d({}),S(uw)),listNodeModels:D(d({nodeId:l()}),S(qC)),resolveModelRef:D(d({ref:l(),maxBytes:i().positive().optional()}),lw,{kind:`mutation`,auth:`admin`}),installModel:D(d({nodeId:l(),model:UC}),v(),{kind:`mutation`,auth:`admin`}),deleteModel:D(d({nodeId:l(),file:l()}),v(),{kind:`mutation`,auth:`admin`}),getRuntimeStatus:D(fw,KC),startRuntime:D(fw,KC,{kind:`mutation`,auth:`admin`}),stopRuntime:D(fw,v(),{kind:`mutation`,auth:`admin`})}},mw=[`decode`,`transcode`,`recording`,`streaming`,`detection`],hw=[`measured`,`accounted`,`unattributable`],gw=d({role:x(mw),deviceId:i().int().positive().nullable(),attribution:x(hw),unit:l(),pid:i().int().positive().optional(),startedAtMs:i().optional(),cpuSeconds:i().optional(),rssBytes:i().optional()}),_w={name:`load-contribution`,scope:`system`,mode:`collection`,internal:!0,methods:{list:D(v(),S(gw).readonly())},mount:{kind:`skip`}},vw=d({armed:i().int().min(0),unknown:S(l()).readonly()}),yw={name:`log-channels`,scope:`system`,mode:`collection`,internal:!0,methods:{list:D(v(),S(Zd).readonly()),apply:D(d({windows:S(Qd).readonly()}),vw,{kind:`mutation`})},mount:{kind:`skip`}},bw=x([`debug`,`info`,`warn`,`error`]),xw=d({timestamp:me(),level:bw,scope:S(l()),message:l(),meta:y(l(),o()).optional(),tags:y(l(),l()).optional()}),Sw={name:`log-destination`,scope:`system`,mode:`collection`,internal:!0,methods:{write:D(xw,v(),{kind:`mutation`}),query:D(d({scope:S(l()).optional(),level:bw.optional(),since:me().optional(),until:me().optional(),limit:i().optional(),tags:y(l(),l()).optional()}),S(xw).readonly())},mount:{kind:`skip`}},Cw=x([`primary`,`second-factor`]),ww=d({kind:m(`redirect`),id:l(),label:l(),icon:l().optional(),startUrl:l(),stage:Cw,linkable:C().optional()}),Tw=d({kind:m(`widget`),id:l(),addonId:l(),bundle:l(),remote:Jm,stage:Cw}),Ew=d({kind:m(`passkey`),id:l(),label:l(),stage:Cw,rpId:l(),origin:l().nullable()}),Dw=p(`kind`,[ww,Tw,Ew]),Ow={name:`login-method`,scope:`system`,mode:`collection`,internal:!0,methods:{getLoginMethods:D(v(),S(Dw).readonly())},mount:{kind:`skip`}},kw=d({total:i(),user:i(),system:i(),irq:i(),nice:i(),loadAvg:u([i(),i(),i()]),cores:i()}),Aw=d({percent:i(),totalBytes:i(),usedBytes:i(),availableBytes:i(),swapUsedBytes:i(),swapTotalBytes:i()}),jw=d({readBytes:i(),writeBytes:i(),readOps:i(),writeOps:i(),timestampMs:i()}),Mw=d({rxBytes:i(),txBytes:i(),rxPackets:i(),txPackets:i(),rxErrors:i(),txErrors:i(),timestampMs:i()}),Nw=d({utilization:i(),model:l(),memoryUsedBytes:i(),memoryTotalBytes:i(),temperature:i().nullable()}),Pw=d({openFds:i(),threadCount:i(),activeHandles:i(),activeRequests:i()}),Fw=d({avg10:i(),avg60:i(),avg300:i()}),Iw=d({some:Fw,full:Fw.nullable()}),Lw=d({cpu:kw,memory:Aw,gpu:Nw.nullable(),network:Mw,disk:jw,pressure:d({cpu:Iw.nullable(),memory:Iw.nullable(),io:Iw.nullable()}),process:Pw,cpuTemperature:i().nullable(),timestampMs:i()}),Rw=d({path:l(),totalBytes:i(),usedBytes:i(),availableBytes:i(),percent:i()}),zw=d({pid:i(),cpu:i(),memory:i(),privateBytes:i().optional(),sharedBytes:i().optional()}),Bw=d({addonId:l(),nodeId:l(),role:x([`hub`,`worker`]),pid:i(),state:x([`starting`,`running`,`stopping`,`stopped`,`crashed`]),uptimeSec:i()}),Vw=d({pid:i(),ppid:i(),pgid:i(),classification:x([`root`,`managed`,`system`]),addonId:l().nullable(),nodeId:l().nullable(),command:l(),cpuPercent:i(),memoryRssBytes:i(),cpuMainPercent:i().nullable(),cpuGcPercent:i().nullable(),threadCount:i().nullable(),uptimeSec:i()}),Hw=d({source:x([`cgroup-v2`,`cgroup-v1`]),currentBytes:i(),limitBytes:i().nullable(),anonBytes:i().nullable(),fileBytes:i().nullable(),shmemBytes:i().nullable(),slabBytes:i().nullable(),gpuShmemBytes:i().nullable()}).extend({atMs:i()}),Uw=d({atMs:i(),samples:i().int(),cpuMainPercent:i().nullable(),cpuMainPercentMin:i().nullable(),cpuGcPercent:i().nullable(),cpuGcPercentMin:i().nullable(),cpuLifetimePercent:i(),cpuLifetimePercentMin:i(),memoryRssBytes:i(),memoryRssBytesMin:i(),processCount:i().int(),processCountMin:i().int()}),Ww=d({key:l(),kind:x([`addon`,`root`,`unattributed`]),points:S(Uw).readonly()}),Gw=d({nodeId:l(),series:S(Ww).readonly(),containerMemory:S(Hw).readonly(),bucketMs:i(),retainedSamples:i(),oldestAtMs:i().nullable(),cadenceMs:i(),durable:C()}),Kw=d({forNodeId:l(),sinceMs:i().optional(),maxPoints:i().int().positive().optional()}),qw=d({cpuPercent:i(),memoryPercent:i(),memoryUsedMB:i(),memoryTotalMB:i(),diskPercent:i().optional(),temperature:i().optional(),gpuPercent:i().optional(),gpuMemoryPercent:i().optional()}),Jw={name:`metrics-provider`,scope:`system`,mode:`singleton`,methods:{collectSnapshot:D(v(),Lw),getCached:D(v(),Lw.nullable()),getCurrent:D(v(),qw),getDiskSpace:D(d({dirPath:l()}),Rw),getGpuInfo:D(v(),Nw.nullable()),getCpuTemperature:D(v(),i().nullable()),getProcessStats:D(d({pids:S(i())}),S(zw)),listAddonInstances:D(v(),S(Bw).readonly()),getAddonStats:D(d({addonId:l()}),zw.nullable()),listNodeProcesses:D(v(),S(Vw).readonly()),getLoadSeries:D(Kw,Gw)}},Yw=d({sourceUrl:l(),metadata:qp,targets:S(Kp).min(1).readonly(),calibrationRef:l().optional(),sessionId:l().optional()}),Xw={name:`model-convert`,scope:`system`,mode:`singleton`,internal:!0,methods:{convert:D(Yw,Yp,{kind:`mutation`,auth:`admin`,timeoutMs:6e5})}},Zw=d({targetNodeId:l(),modelId:l(),format:x(yr),entry:Gp}),Qw=d({ok:C(),sha256:l(),bytes:i(),path:l()}),$w={name:`model-distributor`,scope:`system`,mode:`singleton`,internal:!0,methods:{distributeModel:D(Zw,Qw,{kind:`mutation`,auth:`admin`})}},eT=d({bbox:sh,pixelCount:i(),intensity:i()}),tT=d({detected:C(),regionCount:i(),regions:S(eT).readonly(),rawRegions:S(eT).readonly(),frameWidth:i(),frameHeight:i(),analysisMs:i()}),nT={name:`motion-detection`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{analyze:D(d({deviceId:i(),frame:oh.optional(),frameHandle:rr.optional()}),tT,{kind:`mutation`}),removeCamera:D(d({deviceId:i()}),v(),{kind:`mutation`}),reset:D(v(),v(),{kind:`mutation`})},events:{onMotion:{data:d({deviceId:i(),detected:C(),regionCount:i()})}}},rT=x([`external`,`embedded`]),iT=x([`connected`,`disconnected`,`auth-failed`,`unreachable`,`tls-error`]),aT=d({id:l(),name:l(),url:l(),kind:rT,status:iT,latencyMs:i().nullable(),error:l().optional(),connectedClients:i().int().nonnegative().optional(),lastCheckedAt:i().optional()}),oT=d({url:l(),username:l().optional(),password:l().optional(),clientIdPrefix:l().optional()}),sT=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()}),cT=d({id:l()}),lT=d({id:l()}),uT=p(`ok`,[d({ok:m(!0),latencyMs:i()}),d({ok:m(!1),error:l()})]),dT=d({port:i().int().min(1).max(65535).default(1883),allowAnonymous:C().default(!1),username:l().optional(),password:l().optional()}),fT=d({id:l(),url:l()}),pT=d({brokerCount:i(),embeddedRunning:C()}),mT={name:`mqtt-broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:pT,kind:`poll`},methods:{listBrokers:D(v(),S(aT)),getBrokerConfig:D(lT,oT,{auth:`admin`}),addBroker:D(sT,cT,{kind:`mutation`,auth:`admin`}),removeBroker:D(lT,v(),{kind:`mutation`,auth:`admin`}),testConnection:D(lT,uT,{kind:`mutation`,auth:`admin`}),startEmbeddedBroker:D(dT,fT,{kind:`mutation`,auth:`admin`}),stopEmbeddedBroker:D(lT,v(),{kind:`mutation`,auth:`admin`}),getStatus:D(v(),pT)}},hT=d({url:l(),hostname:l(),port:i(),protocol:x([`http`,`https`])}),gT=d({connected:C(),endpoint:hT.nullable(),error:l().optional()}),_T=hT.extend({id:l(),label:l(),mode:l().optional(),sourcePort:i().optional()}),vT={name:`network-access`,scope:`system`,mode:`collection`,providerKind:`ingress`,methods:{start:D(v(),hT,{kind:`mutation`}),stop:D(v(),v(),{kind:`mutation`}),getEndpoint:D(v(),hT.nullable()),getStatus:D(v(),gT),listEndpoints:D(v(),S(_T).readonly())}},yT=x([`image`,`video`,`gif`,`audio`,`icon`]),bT=d({mediaType:yT,url:l().optional(),bytes:b(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`"}),xT=x([`text`,`markdown`,`html`]),ST=x([`acknowledge`,`dismiss`,`silence`,`snooze`,`view`,`play`,`open`,`close`,`lock`,`unlock`,`arm`,`arm-home`,`arm-away`,`arm-night`,`disarm`,`light`,`alert`,`camera`]),CT=d({id:l(),label:l(),url:l().optional(),icon:ST.optional(),destructive:C().optional(),mode:x([`navigate`,`background`]).optional()}),wT=d({body:l(),title:l().optional(),format:xT.default(`text`),priority:i().int().min(1).max(5).default(3),level:l().optional(),attachments:S(bT).optional(),clickUrl:l().optional(),actions:S(CT).optional(),sound:l().optional(),ttl:i().optional(),tag:l().optional(),deviceId:i().optional(),eventId:l().optional(),metadata:y(l(),o()).optional()}),TT=d({id:l(),label:l(),ordinal:i().int().min(1).max(5).nullable(),flags:d({critical:C().optional(),silent:C().optional(),noPush:C().optional()}).optional(),requires:S(l()).optional(),description:l().optional()}),ET=d({attachments:d({mediaTypes:S(yT),mode:x([`url`,`bytes`,`both`]),max:i().int().nonnegative(),maxBytes:i().int().positive().optional()}),actions:i().int().nonnegative(),actionIcons:C().optional(),levels:S(TT),format:S(xT),clickUrl:C(),sound:C(),ttl:C(),bodyMaxLen:i().int().positive()}),DT=o(),OT=d({kind:l(),label:l(),icon:l(),addonId:l(),iconUrl:l().optional(),iconMediaType:l().optional(),configSchema:DT,destinationKeys:S(l()).optional(),supportsDiscovery:C(),caps:ET}),kT=d({id:l(),name:l(),kind:l(),addonId:l(),enabled:C(),config:y(l(),o())}),AT=d({kind:l(),suggestedName:l(),config:y(l(),o())}),jT=d({level:l(),format:xT,attachmentsSent:i().int().nonnegative(),actionsSent:i().int().nonnegative(),truncated:C(),dropped:S(l())}),MT=d({success:C(),error:l().optional(),renderedAs:jT.optional()}),NT=MT,PT=d({ok:C(),resolvedUrl:l(),httpStatus:i().int().optional(),stateInstance:l().optional(),error:l().optional()}),FT={name:`notification-output`,scope:`system`,mode:`collection`,methods:{listTargetKinds:D(d({}),S(OT)),listTargets:D(d({}),S(kT),{auth:`admin`}),getTarget:D(d({targetId:l()}),kT,{auth:`admin`}),discoverTargets:D(d({kind:l(),config:y(l(),o()).optional(),targetId:l().optional()}),S(AT),{auth:`admin`}),probeTargetConfig:D(d({kind:l(),config:y(l(),o()),targetId:l().optional()}),PT,{kind:`mutation`,auth:`admin`}),send:D(d({targetId:l(),notification:wT}),MT,{kind:`mutation`,auth:`admin`}),testTarget:D(d({targetId:l(),sample:wT.optional()}),NT,{kind:`mutation`,auth:`admin`}),upsertTarget:D(d({target:kT,cloneSecretsFrom:l().optional()}),kT,{kind:`mutation`,auth:`admin`}),deleteTarget:D(d({targetId:l()}),v(),{kind:`mutation`,auth:`admin`}),setTargetEnabled:D(d({targetId:l(),enabled:C()}),v(),{kind:`mutation`,auth:`admin`})}},IT=[{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`}],LT=[{id:`person`,name:`Person`},{id:`vehicle`,name:`Vehicle`},{id:`animal`,name:`Animal`},{id:`package`,name:`Package`}],RT=new Set(LT.map(e=>e.id));function zT(e){return RT.has(e.trim().toLowerCase())}var BT={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},VT=[{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`}],HT={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},UT={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},WT=new Map;for(let[e,t]of Object.entries(HT.mapping))WT.set(e.toLowerCase(),t);for(let[e,t]of Object.entries(UT.mapping))WT.set(e.toLowerCase(),t);function GT(e){return WT.get(e.toLowerCase())??null}function KT(){return VT.map(e=>e.id)}var G={motion:`#f59e0b`,audio:`#06b6d4`,person:`#22c55e`,vehicle:`#3b82f6`,animal:`#f97316`,package:`#a855f7`,sensor:`#8b5cf6`,control:`#10b981`,genericDetection:`#64748b`},qT=`#22ff55`,JT={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 YT(e){return e.split(/[-_ ]/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var XT=new Map;function ZT(e,t,n,r,i){XT.set(e,{kind:e,parentKind:null,level:`macro`,category:t,color:n,iconId:r,labelKey:`eventKind.${e}`,label:i})}function K(e,t,n,r,i,a){XT.set(e,{kind:e,parentKind:t,level:`sub`,category:n,color:r,iconId:i,labelKey:`eventKind.${e}`,label:a})}ZT(`motion`,`motion`,G.motion,`motion`,`Motion`),ZT(`audio`,`audio`,G.audio,`audio`,`Audio`),ZT(`person`,`detection`,G.person,`person`,`Person`),ZT(`vehicle`,`detection`,G.vehicle,`vehicle`,`Vehicle`),ZT(`animal`,`detection`,G.animal,`animal`,`Animal`),ZT(`package`,`package`,G.package,`package`,`Package`),ZT(`sensor`,`sensor`,G.sensor,`sensor`,`Sensor`),ZT(`control`,`control`,G.control,`control`,`Control`);for(let[e,t]of Object.entries(BT.mapping))t!==`vehicle`&&t!==`animal`||XT.has(e)||K(e,t,`detection`,JT[e]??G.genericDetection,e,YT(e));K(`package-delivered`,`package`,`package`,G.package,`package`,`Package delivered`),K(`package-picked-up`,`package`,`package`,G.package,`package`,`Package picked up`),K(`contact`,`sensor`,`sensor`,`#f59e0b`,`door`,`Contact`),K(`motion-sensor`,`sensor`,`sensor`,G.sensor,`pir`,`Motion sensor`),K(`smoke`,`sensor`,`sensor`,`#ef4444`,`smoke`,`Smoke`),K(`flood`,`sensor`,`sensor`,`#3b82f6`,`water`,`Water leak`),K(`gas`,`sensor`,`sensor`,`#ef4444`,`gas`,`Gas`),K(`carbon-monoxide`,`sensor`,`sensor`,`#dc2626`,`smoke`,`Carbon monoxide`),K(`vibration`,`sensor`,`sensor`,`#eab308`,`vibration`,`Vibration`),K(`tamper`,`sensor`,`sensor`,`#f97316`,`tamper`,`Tamper`),K(`presence`,`sensor`,`sensor`,`#22c55e`,`presence`,`Presence`),K(`enum-sensor`,`sensor`,`sensor`,G.sensor,`generic`,`Sensor state`),K(`device-event`,`sensor`,`sensor`,`#10b981`,`button`,`Device event`),K(`lock`,`control`,`control`,`#0ea5e9`,`lock`,`Lock`),K(`cover`,`control`,`control`,`#0ea5e9`,`door`,`Cover`),K(`switch`,`control`,`control`,G.control,`switch`,`Switch`),K(`siren`,`control`,`control`,`#dc2626`,`siren`,`Siren`),K(`button`,`control`,`control`,`#10b981`,`button`,`Button`),K(`doorbell`,`control`,`control`,`#a855f7`,`doorbell`,`Doorbell`);for(let e of VT){let t=`audio-${e.id}`;XT.has(t)||K(t,`audio`,`audio`,G.audio,t,e.name)}var QT=Object.freeze(Object.fromEntries(XT));function $T(e){return QT[e]}function eE(e){return QT[e]?.color??`#22ff55`}function tE(e){let t=[];for(let n of Object.values(QT))n.parentKind===e&&t.push(n);return t}var nE=d({kind:l(),label:l(),parentKind:l().nullable()}),rE=d({videoClasses:S(nE),audioKinds:S(nE),labels:S(nE)});function iE(e,t,n){return{kind:e,label:t,parentKind:n}}function aE(){let e=Object.values(QT);return{videoClasses:e.filter(e=>e.category===`detection`).map(e=>iE(e.kind,e.label,e.parentKind)),audioKinds:e.filter(e=>e.category===`audio`&&e.level===`sub`).map(e=>iE(e.kind,e.label,e.parentKind)),labels:e.filter(e=>e.category===`sensor`||e.category===`control`).map(e=>iE(e.kind,e.label,e.parentKind))}}var oE=Object.freeze(aE()),sE=x([`disarmed`,`armed_home`,`armed_away`,`armed_night`,`armed_vacation`,`armed_custom_bypass`,`arming`,`disarming`,`pending`,`triggered`]),q=x([`home`,`away`,`night`,`vacation`,`custom_bypass`]),cE=d({state:sE,targetMode:q.nullable().optional(),availableModes:S(q),requiresCode:C(),lastChangedAt:i()}),lE={name:`alarm-panel`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.AlarmPanel],methods:{arm:D(d({deviceId:i().int().nonnegative(),mode:q,code:l().min(1).optional()}),v(),{kind:`mutation`,auth:`protected`}),disarm:D(d({deviceId:i().int().nonnegative(),code:l().min(1).optional()}),v(),{kind:`mutation`,auth:`protected`}),trigger:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:cE,kind:`push`},runtimeState:cE,durability:`restored`,volatileStateFields:[`lastChangedAt`]},uE=d({x:i(),y:i()}),dE=d({kind:m(`rect`),x:i(),y:i(),width:i(),height:i()}),fE=d({kind:m(`polygon`),points:S(uE)}),pE=d({kind:m(`grid`),gridWidth:i(),gridHeight:i(),cells:S(C())}),mE=d({kind:m(`line`),points:S(uE)}),hE=p(`kind`,[dE,fE,pE,mE]),gE=x([`rect`,`polygon`,`grid`,`line`]),_E=d({min:i(),max:i()}),vE=d({width:i(),height:i()}),yE=x([`immediate`,`track-end`,`device-event`,`package-event`,`system-event`]),bE=x(`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-restarting.node-updating.node-inference-unavailable.detection-blind.recording-stalled.recording-healthy.recording-degraded.storage-location-low.storage-location-critical.storage-location-ok.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(`.`)),xE=new Set([`camera-online`,`camera-offline`,`camera-disabled`,`camera-enabled`]),SE=bE.options.filter(e=>!xE.has(e)),CE=[`alarm-arm-refused`,`alarm-check-failed`,`alarm-arming`,`alarm-armed`,`alarm-pending`,`alarm-triggered`,`alarm-rearmed`,`alarm-sensor-bypass`,`alarm-disarmed`],wE=[`device-battery-low`,`device-battery-normal`,`device-consumable-low`,`device-consumable-normal`],TE=[`device-consumable-low`,`device-consumable-normal`],EE=[`device-tank-low`,`device-tank-full`,`device-tank-normal`],DE=15,OE=95,kE=d({kinds:S(bE).min(1),deviceIds:S(i().int()).min(1).optional(),deviceTypes:S(l().min(1)).min(1).optional(),excludeDeviceIds:S(i().int()).min(1).optional(),nodeIds:S(l().min(1)).min(1).optional(),packageNames:S(l().min(1)).min(1).optional(),consumableLowPercent:i().int().min(1).max(95).optional()});function AE(e){return e.consumableLowPercent??15}var jE=1,ME=1440,NE=[10,30,60],PE=d({days:S(i().int().min(0).max(6)).min(1),startMinute:i().int().min(0).max(1439),endMinute:i().int().min(0).max(1439)}),FE=d({windows:S(PE).min(1),timezone:l().optional(),invert:C().optional()}),IE=x([`instant`,`summary`]),LE=x([`rule`,`section`]),RE=p(`mode`,[d({mode:m(`instant`)}),d({mode:m(`summary`),schedule:FE,split:LE.optional()})]),zE=d({values:S(l().min(1)),maxDistance:i().int().min(0).max(3).default(1)}),BE=d({zoneId:l().optional(),className:l().optional(),op:x([`became-occupied`,`became-free`,`>=`,`<=`]).default(`became-occupied`),count:i().int().min(0).default(1),sustainSeconds:i().int().min(0).max(3600).default(15)}),VE=-96,HE=d({labels:S(l().min(1)).min(1).optional(),dbThreshold:i().min(-96).max(0).optional(),hitPercent:i().int().min(1).max(100).default(60),samplingSeconds:i().int().min(1).max(300).default(10),confirmHits:i().int().min(1).max(20).optional(),confirmWindowSec:i().int().min(1).max(60).optional()}),UE=x([`enter`,`exit`,`any`]),WE=x([`raised`,`cleared`]),GE=d({ids:S(l().min(1)).min(1),match:x([`any`,`all`]).optional()}),KE=p(`kind`,[d({kind:m(`wait`),seconds:i().min(0).max(300)}),d({kind:m(`cap`),deviceId:i().int(),cap:l().min(1),method:l().min(1),args:y(l(),o()).optional()})]),qE=d({id:l().min(1),name:l().min(1).max(120),minDelaySec:i().int().min(0).max(86400).optional(),actions:S(KE).min(1)}),JE=d({name:l().min(1).max(120),minDelaySec:i().int().min(0).max(86400).optional(),actions:S(KE).min(1)}),YE=p(`kind`,[d({kind:m(`sequence`),sequenceId:l().min(1)}),d({kind:m(`do`),action:KE})]),XE=S(YE).max(4),ZE=d({id:l().min(1).max(64),label:l().min(1).max(40),sequenceId:l().min(1),icon:ST.optional(),destructive:C().optional()}),QE=d({onActivation:XE.optional(),onDeactivation:XE.optional(),onTrigger:XE.optional(),onTriggerOff:XE.optional(),buttons:S(ZE).max(8).optional()}),$E=d({name:l().min(1).max(120),enabled:C(),minDelaySec:i().int().min(0).max(86400).optional(),actions:S(KE).min(1)}),eD=$E,tD=d({deviceId:i().int(),states:S(l().min(1)).min(1)}),nD=d({sceneId:l().min(1),deviceId:i().int().optional(),requiredState:x([`matched`,`diverged`]),latched:C().optional()}),rD=d({deviceState:tD.optional(),scene:nD.optional(),devices:S(i()).optional(),devicesExclude:S(i()).min(1).optional(),classes:S(l().min(1)).optional(),classesExclude:S(l().min(1)).optional(),minConfidence:i().min(0).max(1).optional(),zones:GE.optional(),zonesExclude:S(l().min(1)).optional(),crossing:UE.optional(),labelEquals:S(l().min(1)).optional(),identities:S(l().min(1)).optional(),plates:zE.optional(),identitiesExclude:S(l().min(1)).optional(),minImportance:i().min(0).max(1).optional(),minDwellSeconds:i().min(0).optional(),source:x([`pipeline`,`onboard`,`sensor`,`audio`,`any`]).optional(),minLabelConfidence:i().min(0).max(1).optional(),eventTypeTokens:S(l().min(1)).optional(),sensorKinds:S(l().min(1)).optional(),sensorTransition:WE.optional(),packagePhase:x([`delivered`,`picked-up`,`both`]).optional(),systemEvent:kE.optional(),customZones:S(fE).optional(),occupancy:BE.optional(),audio:HE.optional()}),iD=d({targetId:l().min(1),params:y(l(),o()).optional()}),aD=x([`cropped`,`full`,`boxed`]),oD=x([`mosaic`,`each`]),sD=4,cD=6,lD=d({attach:x([`best`,`best-matching`,`keyFrame`,`none`]).default(`best`),frame:aD.optional(),zoneCrop:C().optional(),gif:C().optional(),clip:C().optional(),clipPreRollSec:i().int().min(0).max(30).optional(),clipPostRollSec:i().int().min(0).max(30).optional(),clipSpeed:i().min(1).max(8).optional(),profile:E.optional(),linkedCameras:oD.optional()}),uD=x([`shared`,`per-class`]),dD=d({cooldownSec:i().int().min(0).max(86400).default(60),scope:x([`rule`,`rule-device`]).default(`rule-device`),granularity:uD.optional()}),fD=1e3,pD=2e4,mD=8e3,hD=448,gD=d({op:x([`>=`,`>`,`<=`,`<`,`==`]),count:i().int().min(0).max(1e3)}),_D=d({enabled:C().default(!1),profileId:l().optional(),prompt:l().max(1e3).optional(),expect:gD.optional(),timeoutMs:i().int().min(fD).max(pD).default(mD),onTimeout:x([`fire`,`suppress`]).default(`fire`),maxImagePx:i().int().min(64).max(2048).default(448)}),vD=5,yD=20,bD=60,xD=d({name:l().min(1).max(200),enabled:C().default(!0),delivery:yE,conditions:rD.default({}),schedule:FE.optional(),systemEventDelivery:RE.optional(),targets:S(iD),targetUsers:S(l()).optional(),media:lD.default({attach:`best`}),throttle:dD.default({cooldownSec:60,scope:`rule-device`}),template:d({title:l().max(500).optional(),body:l().max(2e3).optional()}).optional(),priority:i().int().min(1).max(5).default(3),ownerUserId:l().optional(),snoozeAllowGlobal:C().optional(),snoozeOptions:S(i().int().min(1).max(ME)).max(4).optional(),actions:QE.optional(),confirm:_D.optional(),groupingSec:i().int().min(5).max(60).optional()}),SD=xD.partial().extend({disabledTargetIds:S(l()).optional(),enabled:C().optional(),conditions:rD.optional(),media:lD.optional(),throttle:dD.optional(),priority:i().int().min(1).max(5).optional()}),CD=[`waitForEnhancement`,`groupIdleSec`];function wD(e){return CD.some(t=>t===e)}var TD=[`template`,`schedule`,`targetUsers`,`snoozeOptions`,`snoozeAllowGlobal`,`actions`,`confirm`,`groupingSec`,`waitForEnhancement`,`groupIdleSec`],ED=x(TD),DD=d({ruleId:l(),patch:SD,clear:S(ED).optional()}),OD=xD.extend({id:l(),createdBy:l(),createdAt:i(),updatedAt:i(),disabledTargetIds:S(l()).default([])}),kD=x([`device-state`,`streams`,`battery`,`consumables`,`tanks`,`detection-blind`,`nodes`,`addons`,`addon-updates`,`updates`]),AD=d({id:kD,status:x([`read`,`unavailable`]),items:i().int().nonnegative(),reason:l().optional()}),jD=d({section:kD.optional(),title:l(),text:l(),count:i().int().nonnegative()}),MD=d({empty:C(),count:i().int().nonnegative(),text:l(),sections:S(AD),dropped:y(l(),i().int().nonnegative()),excludedGroups:S(l()),split:LE.optional(),rows:S(jD).optional()}),ND=d({recordId:l(),recordKind:x([`object-event`,`track`,`device-event`,`package-event`,`system-event`]),deviceId:i(),timestamp:i(),wouldFire:C(),failedCondition:l().optional(),className:l().optional(),label:l().optional()}),PD=x([`detection`,`sensor`,`occupancy`,`sound`,`device-events`,`system`,`alarm`,`mixed`]),FD=x([`detection`,`sensor`,`occupancy`,`sound`,`system`]),ID=x([`rule`,`timelapse`,`summary`]),LD=x([`title`,`body`,`previewText`,`captionText`]),RD=x([`subject`,`place`,`time`,`rule`,`occupancy`,`sound`,`sensor`,`system`,`digest`,`ai`]),zD=d({name:l().regex(/^\w+$/),label:l(),description:l().optional(),example:l(),group:RD,families:S(ID).min(1),fields:S(LD).optional(),kinds:S(FD).optional(),deliveries:S(yE).optional(),systemEventKinds:S(bE).optional(),systemEventDeliveries:S(IE).optional(),dynamic:d({prefix:m(`count_`),from:m(`classes`)}).optional()}),BD=d({family:ID,field:LD,kind:PD.optional(),delivery:yE.optional(),systemEventKinds:S(bE).optional(),systemEventDelivery:IE.optional()}),VD=d({context:BD,template:d({title:l().max(500).optional(),body:l().max(2e3).optional()})}),HD=d({title:l().nullable(),body:l().nullable(),unknown:S(l())}),UD=d({id:l(),group:x([`scope`,`class`,`zones`,`quality`,`label`,`schedule`,`device`,`package`,`occupancy`,`audio`,`system`]),label:l(),valueType:x([`deviceIdList`,`deviceIdExcludeList`,`stringList`,`number01`,`number`,`sourceSelect`,`zoneSelection`,`zoneIdList`,`schedule`,`plateMatcher`,`packagePhase`,`crossingSelect`,`sensorTransition`,`polygonDraw`,`occupancy`,`audio`,`deviceState`,`scene`,`systemEvent`]),operator:x([`in`,`notIn`,`anyOf`,`allOf`,`gte`,`fuzzyIn`,`withinSchedule`]),appliesTo:S(yE),phase:l(),description:l().optional(),options:S(d({value:l(),label:l(),hint:l().optional()})).readonly().optional()}),WD=[{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-restarting`,label:`Node restarting`},{value:`node-updating`,label:`Node updating (restart imminent)`},{value:`node-inference-unavailable`,label:`Node has no usable inference device`},{value:`detection-blind`,label:`Camera detecting nothing`},{value:`recording-stalled`,label:`Recording stalled`},{value:`recording-healthy`,label:`Recording healthy again`},{value:`recording-degraded`,label:`Recording degraded (restart storm)`},{value:`storage-location-low`,label:`Storage location low`},{value:`storage-location-critical`,label:`Storage location critical`},{value:`storage-location-ok`,label:`Storage location ok again`},{value:`addon-crash-loop`,label:`Addon stopped after repeated crashes`},{value:`addon-update-available`,label:`Addon update available`},{value:`server-update-available`,label:`Server update available`},{value:`wrapper-update-available`,label:`Container / app update available`},{value:`addon-updated`,label:`Addons updated`},{value:`server-updated`,label:`Server updated`},{value:`device-battery-low`,label:`Battery low`},{value:`device-battery-normal`,label:`Battery back to normal`},{value:`device-consumable-low`,label:`Consumable low`},{value:`device-consumable-normal`,label:`Consumable replaced`},{value:`device-tank-low`,label:`Tank low (water, detergent)`},{value:`device-tank-full`,label:`Tank full (dirty water, dust)`},{value:`device-tank-normal`,label:`Tank back to normal`},{value:`export-completed`,label:`Export completed`},{value:`backup-completed`,label:`Backup completed`},{value:`alarm-arm-refused`,label:`Alarm arm refused`},{value:`alarm-check-failed`,label:`Alarm check failed (armed anyway)`},{value:`alarm-arming`,label:`Alarm arming (exit delay)`},{value:`alarm-armed`,label:`Alarm armed`},{value:`alarm-pending`,label:`Alarm entry delay started`},{value:`alarm-triggered`,label:`Alarm triggered`},{value:`alarm-rearmed`,label:`Alarm re-armed after siren`},{value:`alarm-sensor-bypass`,label:`Alarm sensor bypass`},{value:`alarm-disarmed`,label:`Alarm disarmed`}],operator:`in`,appliesTo:[`system-event`],phase:`P1`,description:`Infrastructure and update events. Device liveness covers EVERY device type — narrow it by device type (cameras only, say) and/or by device, node events by node id, and addon updates by package name.`},{id:`devices`,group:`scope`,label:`Devices`,valueType:`deviceIdList`,operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P1`,description:`Restrict the rule to these devices; absent = all devices. A sensor event matches either the SENSOR that fired or the camera it is attributed to, so a rule may name either one.`},{id:`devicesExclude`,group:`scope`,label:`Excluded devices`,valueType:`deviceIdExcludeList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P1`,description:`Every device except these. Judged on the same device ids as Devices: a sensor event is excluded by the SENSOR that fired or by the camera it is attributed to.`},{id:`classes`,group:`class`,label:`Object classes`,valueType:`stringList`,operator:`in`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`,description:`Any overlap with the detection class set passes.`},{id:`classesExclude`,group:`class`,label:`Excluded classes`,valueType:`stringList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`},{id:`minConfidence`,group:`quality`,label:`Minimum confidence`,valueType:`number01`,operator:`gte`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`},{id:`zones`,group:`zones`,label:`Zones`,valueType:`zoneSelection`,operator:`anyOf`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`,description:`The zones the subject must be in (included) or never in (excluded).`},{id:`zonesExclude`,group:`zones`,label:`Excluded zones`,valueType:`zoneIdList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`},{id:`crossing`,group:`zones`,label:`Zone crossing`,valueType:`crossingSelect`,options:[{value:``,label:`Entering`,hint:`Entries and ordinary movement; never an exit.`},{value:`exit`,label:`Leaving`,hint:`Only an exit from a zone.`},{value:`any`,label:`Entering or leaving`,hint:`Entries, exits and ordinary movement.`}],operator:`in`,appliesTo:[`immediate`],phase:`P1`,description:`Which way the subject crosses the zone.`},{id:`labelEquals`,group:`label`,label:`Label equals`,valueType:`stringList`,operator:`in`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Exact match on the collapsed label (identity / plate / subclass).`},{id:`identities`,group:`label`,label:`Known faces`,valueType:`stringList`,operator:`in`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Only recognised people. Selecting NOBODY means every identity in the face gallery; selecting some narrows to those. Matched on the gallery id, so renaming a person does not break the rule. On Immediate delivery the name must already be known when an event is written — choose Immediate, grouped to wait for it.`},{id:`plates`,group:`label`,label:`Known plates`,valueType:`plateMatcher`,operator:`fuzzyIn`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Only vehicles whose plate was read. Selecting NO plate means any readable plate; listed plates are matched Levenshtein-tolerantly, because OCR noise makes an exact match useless.`},{id:`identitiesExclude`,group:`label`,label:`Excluded faces`,valueType:`stringList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Veto by identity (mirror of Known faces, same gallery ids). A subject nobody recognised passes — there is nothing to exclude.`},{id:`minLabelConfidence`,group:`label`,label:`Minimum label confidence`,valueType:`number01`,operator:`gte`,appliesTo:[`track-end`],phase:`P1`,description:`Best identity/plate recognition match confidence [0,1] for the label the track carries at close (peak assigned-identity cosine / peak plate OCR score; the higher of the two when both were read). Distinct from detection confidence. Fails closed for a track that ended un-recognized.`},{id:`minImportance`,group:`quality`,label:`Minimum importance`,valueType:`number01`,operator:`gte`,appliesTo:[`track-end`],phase:`P1`,description:`Server-computed key-event importance [0,1]; track-end rules only (importance is scored at close). Fails when the record has none.`},{id:`minDwellSeconds`,group:`quality`,label:`Minimum dwell (seconds)`,valueType:`number`,operator:`gte`,appliesTo:[`track-end`],phase:`P1`,description:`Track lifespan in seconds (lastSeen − firstSeen); track-end rules only.`},{id:`source`,group:`scope`,label:`Detection source`,valueType:`sourceSelect`,options:[{value:`any`,label:`Any source`},{value:`pipeline`,label:`Pipeline`},{value:`onboard`,label:`Onboard (camera)`},{value:`sensor`,label:`Sensor`},{value:`audio`,label:`Audio marker`}],operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P1`,description:`pipeline / onboard / sensor / audio; a record with no stamped source counts as pipeline.`},{id:`deviceState`,group:`scope`,label:`Device state`,valueType:`deviceState`,operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P2`,description:`Only fire while another device is in one of the chosen states — the alarm armed, a switch on, a contact closed. A state that cannot be read does NOT fire.`},{id:`scene`,group:`scope`,label:`Scene state`,valueType:`scene`,operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P3`,description:`Only fire while a scene is matched or diverged.`},{id:`sensorKinds`,group:`device`,label:`Sensor kinds`,valueType:`stringList`,operator:`in`,appliesTo:[`device-event`],phase:`P1`,description:`Sensor/control taxonomy kinds (doorbell / contact / button / …) matched against the persisted device event.`},{id:`eventTypeTokens`,group:`device`,label:`Event-type tokens`,valueType:`stringList`,operator:`in`,appliesTo:[`device-event`],phase:`P1`,description:`Raw device event-type tokens (e.g. doorbell press / press_long) from the event-emitter slice; absent on doorbell-pulse / passive sensors.`},{id:`sensorTransition`,group:`device`,label:`Notify when`,valueType:`sensorTransition`,options:[{value:``,label:`It triggers and when it clears`,hint:`Every change: water detected, and back to dry.`},{value:`raised`,label:`Only when it triggers`,hint:`Water detected, smoke, a contact opening — never the return to normal.`},{value:`cleared`,label:`Only when it clears`,hint:`Back to dry, smoke gone, a contact closing — never the alert itself.`}],operator:`in`,appliesTo:[`device-event`],phase:`P2`,description:`Fire on one edge of a boolean sensor. Offered only when every chosen sensor kind raises and clears; a reading that cannot be placed still notifies.`},{id:`packagePhase`,group:`package`,label:`Package phase`,valueType:`packagePhase`,options:[{value:`delivered`,label:`Delivered`},{value:`picked-up`,label:`Picked up`},{value:`both`,label:`Both`}],operator:`in`,appliesTo:[`package-event`],phase:`P1`,description:`Delivered / picked-up / both.`},{id:`occupancy`,group:`occupancy`,label:`Occupancy`,valueType:`occupancy`,operator:`anyOf`,appliesTo:[`device-event`],phase:`P1`,description:`ZoneAnalytics occupancy edge (optionally zone/class-scoped): count crosses the threshold and holds for sustainSeconds. Fail-closed on a missing snapshot.`},{id:`audio`,group:`audio`,label:`Sound`,valueType:`audio`,operator:`anyOf`,appliesTo:[`immediate`],phase:`P2`,description:`Fires when at least hitPercent% of the samples in a samplingSeconds window are hits — a hit clears the dBFS floor AND carries one of the chosen sounds. Both filters are optional and independent, but naming NEITHER never matches: every sample would be a hit, so the engine refuses rather than notifying on silence. dBFS is negative-going (0 = full scale, -96 = silence).`},{id:`customZones`,group:`zones`,label:`Custom zones`,valueType:`polygonDraw`,operator:`anyOf`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`,description:`User-drawn polygons; a detection whose bbox overlaps any polygon matches.`},{id:`schedule`,group:`schedule`,label:`Schedule`,valueType:`schedule`,operator:`withinSchedule`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`,`system-event`],phase:`P1`,description:`Weekly activation windows (invertible); absent = always active.`}],GD=x([`pending`,`sent`,`dead`]),KD=x([`object-event`,`track-end`,`device-event`,`package-event`,`system-event`]),qD=d({className:l(),label:l().optional(),confidence:i().optional(),zones:S(l()),timestamp:i(),systemEvent:d({kind:bE,subject:l(),title:l(),body:l(),data:y(l(),o())}).optional()}),JD=d({id:l(),ruleId:l(),ruleName:l(),delivery:yE,targetId:l(),deviceId:i(),recordKind:KD,recordId:l(),trackId:l().optional(),status:GD,attempts:i().int(),createdAt:i(),updatedAt:i(),error:l().optional(),subject:qD,artifactIds:S(l().min(1)).optional()}),YD=100,XD=500,ZD=d({ruleId:l().optional(),deviceId:i().optional(),status:GD.optional(),since:i().optional(),until:i().optional(),limit:i().int().min(1).max(500).default(100)}),QD=d({ruleId:l(),lastAt:i(),status:GD,deviceId:i()}),$D=d({runs:S(QD),horizonMs:i().nonnegative().nullable()}),eO=x([`rule`,`device`,`all`]),tO=d({scope:eO,ruleId:l().optional(),deviceId:i().int().optional(),classes:S(l().min(1)).min(1).optional(),durationMinutes:i().int().min(1).max(ME),global:C().optional(),summary:C().optional()}),nO=d({id:l(),userId:l(),scope:eO,ruleId:l().optional(),deviceId:i().int().optional(),classes:S(l().min(1)).min(1).optional(),startedAt:i(),expiresAt:i(),global:C(),summary:C(),digestSentAt:i().optional()}),rO=d({snoozeId:l(),targetId:l(),ruleId:l(),ruleName:l(),deviceId:i().int(),count:i().int(),firstAt:i(),lastAt:i()}),iO=600,aO=3600,oO=200,sO=i().int().min(0).max(600),cO=i().int().min(0).max(aO),lO=e=>new Set(e.map(e=>e.mode)).size===e.length,uO=x([`rearmAfter`,`disableAfter`,`doNothing`]),dO=d({mode:q,exitDelaySec:sO.optional(),entryDelaySec:sO.optional(),triggeredDurationSec:cO.optional(),postTriggeredAction:uO.optional(),schedule:FE.optional(),notifyDuringEntryDelay:C().optional(),notifySensorRewatched:C().optional(),notifySensorIgnored:C().optional()}),fO=S(dO).max(8).refine(lO,{message:`modeDelays: at most one entry per arm mode`}),pO=d({mode:q,exitDelaySec:sO.nullable().optional(),entryDelaySec:sO.nullable().optional(),triggeredDurationSec:cO.nullable().optional(),postTriggeredAction:uO.nullable().optional(),schedule:FE.nullable().optional(),notifyDuringEntryDelay:C().nullable().optional(),notifySensorRewatched:C().nullable().optional(),notifySensorIgnored:C().nullable().optional()}),mO=S(pO).max(8).refine(lO,{message:`modeDelays: at most one edit per arm mode`}),hO=d({mode:q,deviceId:i().int().positive(),nonBlocking:C()}),gO=d({mode:q,deviceId:i().int().positive(),blocking:C()}),_O=d({mode:q,deviceId:i().int().positive(),secureOnArm:C()}),vO=d({mode:q,deviceIds:S(i().int()).max(200)}),yO=vO,bO=vO,xO=vO,SO=S(yO).max(8).refine(lO,{message:`nonBlocking: at most one list per arm mode`}),CO=S(bO).max(8).refine(lO,{message:`blocking: at most one list per arm mode`}),wO=S(xO).max(8).refine(lO,{message:`secureOnArmOff: at most one list per arm mode`}),TO=d({exitDelaySec:sO,entryDelaySec:sO,triggeredDurationSec:cO,postTriggeredAction:uO.optional(),announceArm:C().optional(),announceTargets:S(l().min(1)).max(16),nonBlocking:SO.default([]),blocking:CO.default([]),secureOnArmOff:wO.default([]),modeDelays:fO.default([])}),EO=d({id:l().min(1).max(64),name:l().min(1).max(64),isDefault:C()}),DO=d({activeId:l().min(1),items:S(EO).min(1)}),OO=d({name:l().min(1).max(64),cloneFromId:l().min(1).max(64).optional()}),kO=d({id:l().min(1).max(64),name:l().min(1).max(64)}),AO=d({id:l().min(1).max(64)}),jO=TO.extend({nonBlocking:SO,blocking:CO,secureOnArmOff:wO,modeDelays:mO,nonBlockingEdit:hO,blockingEdit:gO,secureOnArmEdit:_O}).partial().refine(e=>e.nonBlocking===void 0||e.nonBlockingEdit===void 0,{message:`nonBlocking and nonBlockingEdit are exclusive — send the whole lists or one edit`}).refine(e=>e.blocking===void 0||e.blockingEdit===void 0,{message:`blocking and blockingEdit are exclusive — send the whole lists or one edit`}).refine(e=>e.secureOnArmOff===void 0||e.secureOnArmEdit===void 0,{message:`secureOnArmOff and secureOnArmEdit are exclusive — send the whole lists or one edit`}),MO=x([`muted`,`detection-off`,`offline`]),NO=d({deviceId:i().int(),reason:MO}),PO=d({mode:q,ruleCount:i().int().min(0),allDevices:C(),deviceIds:S(i().int()),allDevicesExcept:S(i().int()).default([]),skippedDevices:S(NO).default([])}),FO=d({deviceId:i().int(),name:l(),state:l(),blocking:C()}),IO=d({deviceId:i().int(),name:l(),phase:x([`open`,`closed`])}),LO=d({mode:q,devices:S(FO),unknown:S(i().int())}),RO=d({state:sE,targetMode:q.nullable(),availableModes:S(q),openings:S(LO),exclusions:S(IO)}),zO=d({deviceId:i().int().nullable(),settings:TO,profiles:DO.optional(),coverage:S(PO),live:RO.optional()}),BO=500,VO=x([`open`,`closed`,`unknown`,`not-opening`]),HO=d({deviceId:i().int().positive(),reading:VO,state:l().nullable(),unknownWhy:x([`read-failed`,`unknown-word`]).nullable(),online:C().nullable(),controllable:C().default(!1)}),UO=d({deviceIds:S(i().int().positive()).max(500)}),WO=d({sensors:S(HO),readAt:i().int().nonnegative()}),GO=60,KO=d({deviceId:i().int().nonnegative().optional(),seconds:i().min(0).max(60),profile:E.optional(),ruleId:l(),ruleName:l(),reason:x([`window`,`occupancy`])}),qO=d({rulesLoaded:C(),asks:S(KO).readonly()}),JO={name:`notification-rules`,scope:`system`,mode:`singleton`,methods:{listRules:D(d({}),d({rules:S(OD)}),{auth:`admin`}),getRule:D(d({ruleId:l()}),d({rule:OD.nullable()}),{auth:`admin`}),createRule:D(d({rule:xD}),d({rule:OD}),{kind:`mutation`,auth:`admin`,caller:`required`}),updateRule:D(DD,d({rule:OD}),{kind:`mutation`,auth:`admin`,caller:`required`}),deleteRule:D(d({ruleId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setRuleEnabled:D(d({ruleId:l(),enabled:C()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),listSequences:D(d({}),d({sequences:S(qE)}),{auth:`admin`}),getSequence:D(d({sequenceId:l().min(1)}),d({sequence:qE.nullable()}),{auth:`admin`}),createSequence:D(d({sequence:JE}),d({sequence:qE}),{kind:`mutation`,auth:`admin`}),updateSequence:D(d({sequenceId:l().min(1),sequence:JE}),d({sequence:qE}),{kind:`mutation`,auth:`admin`}),deleteSequence:D(d({sequenceId:l().min(1)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getClipRetentionAsks:D(d({}),qO,{auth:`admin`}),listDeviceMutes:D(d({}),d({mutedDeviceIds:S(i().int()).readonly()}),{auth:`admin`}),setDeviceMuted:D(d({deviceId:i().int(),muted:C()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),testRule:D(d({rule:xD,lookbackMinutes:i().int().min(1).max(1440).default(60)}),d({results:S(ND)}),{kind:`mutation`,auth:`admin`}),previewStateSummary:D(d({rule:xD}),MD,{kind:`mutation`,auth:`admin`,access:`view`}),getConditionCatalog:D(d({}),d({catalog:S(UD),taxonomy:rE.optional()})),getTemplateCatalog:D(d({}),d({vars:S(zD)})),previewTemplate:D(VD,HD,{kind:`mutation`,access:`view`}),getHistory:D(d({filter:ZD.default({limit:100})}),d({entries:S(JD)}),{auth:`admin`}),getRuleLastRuns:D(d({}),$D,{auth:`admin`}),resolveArtifactUrl:D(d({artifactId:l().min(1)}),d({url:l().nullable()}),{auth:`admin`}),listSnoozes:D(d({}),d({snoozes:S(nO)}),{caller:`required`}),createSnooze:D(d({snooze:tO}),d({snooze:nO}),{kind:`mutation`,caller:`required`}),cancelSnooze:D(d({snoozeId:l()}),d({success:m(!0)}),{kind:`mutation`,caller:`required`}),getAlarmConfig:D(d({}),zO,{auth:`admin`}),setAlarmConfig:D(d({patch:jO}),zO,{kind:`mutation`,auth:`admin`}),createAlarmProfile:D(OO,zO,{kind:`mutation`,auth:`admin`}),renameAlarmProfile:D(kO,zO,{kind:`mutation`,auth:`admin`}),deleteAlarmProfile:D(AO,zO,{kind:`mutation`,auth:`admin`}),activateAlarmProfile:D(AO,zO,{kind:`mutation`,auth:`admin`}),getAlarmSensors:D(UO,WO,{auth:`admin`})}},YO=x([`view`,`create`,`delete`]),XO=f([m(`*`),S(l())]),ZO=y(l(),f([m(`*`),S(l())])),QO=x([`device`,`system`]),$O=p(`kind`,[d({kind:m(`all`)}),d({kind:m(`ids`),ids:S(i().int()).min(1)}),d({kind:m(`types`),types:S(x(k)).min(1)}),d({kind:m(`locations`),locations:S(l().min(1)).min(1)})]),ek=d({type:m(`device`),selector:$O,access:S(YO).min(1),includeLinked:C().optional()});function tk(e){if(typeof e!=`object`||!e||Array.isArray(e)||Reflect.get(e,`type`)!==`device`||Reflect.get(e,`selector`)!==void 0)return e;let t=Reflect.get(e,`targets`);return Array.isArray(t)?{type:`device`,selector:{kind:`ids`,ids:t.map(e=>typeof e==`string`?Number(e):e).filter(e=>typeof e==`number`&&Number.isInteger(e))},access:Reflect.get(e,`access`)}:e}var J=n(tk,p(`type`,[d({type:m(`category`),target:QO,access:S(YO).min(1)}),d({type:m(`capability`),target:l(),access:S(YO).min(1)}),d({type:m(`addon`),target:l(),access:S(YO).min(1)}),ek])),nk=d({id:l(),username:l(),passwordHash:l(),isAdmin:C().default(!1),allowedProviders:XO,allowedDevices:ZO,scopes:S(J).default([]),createdAt:i(),updatedAt:i()}),rk=d({id:l(),label:l(),isAdmin:C().default(!1),allowedProviders:XO,allowedDevices:ZO,tokenHash:l(),tokenPrefix:l(),createdAt:i(),lastUsedAt:i().optional()}),ik=d({id:l(),userId:l(),name:l(),tokenHash:l(),tokenPrefix:l(),scopes:S(J),expiresAt:i().nullish(),lastUsedAt:i().nullish(),createdAt:i()}),ak=d({integrationId:l(),displayName:l(),requestedScopes:S(J),allowedRedirectPrefixes:S(l()).min(1),allowedPrivateHostPaths:S(l()).optional(),requiresPkce:C().optional(),hubUrl:l().optional(),refreshTokenTtlSec:f([i().int().positive(),m(`never`)]).optional()}),ok={name:`oauth-integration`,scope:`system`,mode:`collection`,internal:!0,methods:{getDescriptor:D(v(),ak,{auth:`admin`})}},sk=o(),ck=d({id:l().min(1),displayName:l(),icon:l(),issuerUrl:l(),clientId:l(),configured:C(),formValues:y(l(),o()).optional()}),lk=d({id:l().min(1),displayName:l().min(1),icon:l().optional(),issuerUrl:l().optional(),clientId:l().optional(),clientSecret:f([l(),d({$secretClear:m(!0)})]).optional(),redirectUri:l().optional(),scopes:l().optional(),usernameClaim:x([`preferred_username`,`email`,`sub`]).optional()}),uk={name:`oidc-connections`,scope:`system`,mode:`singleton`,methods:{connectionFormSchema:D(d({}),sk,{auth:`admin`}),listConnections:D(d({}),S(ck).readonly(),{auth:`admin`}),createConnection:D(d({id:l().min(1).regex(/^[a-z0-9][a-z0-9-]{0,63}$/,`id must be a lowercase slug`),displayName:l().min(1)}),d({id:l()}),{kind:`mutation`,auth:`admin`}),updateConnection:D(lk,d({ok:m(!0)}),{kind:`mutation`,auth:`admin`}),deleteConnection:D(d({id:l().min(1)}),d({ok:m(!0)}),{kind:`mutation`,auth:`admin`})}},dk=p(`kind`,[d({kind:m(`camera`)}),d({kind:m(`sensor`),deviceId:i().int().positive()})]),fk=Object.freeze({kind:`camera`});function pk(e){if(e===void 0)return{triggeredBy:fk,malformed:!1};let t=dk.safeParse(e);return t.success?{triggeredBy:t.data,malformed:!1}:{triggeredBy:fk,malformed:!0}}var mk=`cameraSensors`,hk=8,gk=d({addonId:l().min(1),stableId:l().min(1)});function _k(e){return`${e.addonId}/${e.stableId}`}var vk=x([`in-addition`,`confirm`,`replace`]),yk=`in-addition`,bk=gk.extend({mode:vk.default(yk)}),xk=d({sensors:S(bk).min(1).max(8)}).superRefine((e,t)=>{let n=new Set;e.sensors.forEach((e,r)=>{let i=_k(e);n.has(i)&&t.addIssue({code:`custom`,path:[`sensors`,r],message:`duplicate camera sensor ${i}`}),n.add(i)})}),Sk={addonId:l(),stableId:l(),mode:vk.default(yk)},Ck=p(`state`,[d({...Sk,state:m(`ready`),deviceId:i(),name:l(),caps:S(l()).readonly()}),d({...Sk,state:m(`offline`),deviceId:i(),name:l(),reason:x([`offline`,`disabled`])}),d({...Sk,state:m(`missing`),reason:l()}),d({...Sk,state:m(`unsupported`),deviceId:i(),name:l(),reason:l()}),d({...Sk,state:m(`unreadable`),reason:l()})]),wk=x([`onboard-not-listed`,`no-active-detection`]),Tk=x([`always`,`when-confirmed`,`never`]),Ek=x([`provider-not-split`]),Dk=d({detected:C(),atMs:i()}),Ok=p(`state`,[d({state:m(`not-configured`),cameraLevel:Dk.optional()}),d({state:m(`unreadable`),reason:l(),cameraLevel:Dk.optional()}),d({state:m(`configured`),cameraLevel:Dk.optional(),sensors:S(Ck).readonly(),cameraMotion:Tk.optional(),notForwarded:wk.optional(),notEnforced:Ek.optional()})]),kk=Object.freeze({state:`unreadable`,reason:`camera sensor mappings not loaded`}),Ak=[`owner-not-ready`,`store-read-failed`,`three-way-read-unavailable`,`invalid-stored`,`not-cluster-scoped`],jk=[{stepId:`face-embedding`,label:`Face recognition model`,defaultModelId:`auraface-r100`,indexName:`the enrolled face gallery`,options:[{id:`auraface-r100`,label:`AuraFace R100`}]},{stepId:`clip-embedding`,label:`Semantic search model`,defaultModelId:`siglip2-b16-224`,indexName:`the object semantic-search index`,options:[{id:`siglip2-b16-224`,label:`SigLIP2 B/16 (Apache-2.0)`}]}],Mk=`cluster-step-models`;function Nk(e){return`clusterModel:${e}`}function Pk(e){return jk.some(t=>t.stepId===e)}var Fk=Object.freeze(Object.fromEntries(jk.map(e=>[e.stepId,e.defaultModelId])));function Ik(e){return e==null||e===``?{kind:`absent`}:typeof e==`string`?{kind:`chosen`,modelId:e}:{kind:`invalid`,value:e}}function Lk(e){let t=[];for(let n of jk){let r=Ik(e[Nk(n.stepId)]);r.kind===`invalid`&&t.push({stepId:n.stepId,value:r.value})}return t}function Rk(e){let t={};for(let n of jk){let r=Ik(e[Nk(n.stepId)]);t[n.stepId]=r.kind===`chosen`?r.modelId:n.defaultModelId}return t}function zk(e){return typeof e==`object`&&!!e&&`key`in e}function Bk(e){return e===null?Fk:Rk(Uk(e,Hk()))}function Vk(e){return e===null?[]:Lk(Uk(e,Hk()))}function Hk(){return new Set(jk.map(e=>Nk(e.stepId)))}function Uk(e,t){let n={};for(let r of e.sections)for(let e of r.fields)!zk(e)||typeof e.key!=`string`||t.has(e.key)&&(n[e.key]=e.value);return n}function Wk(e,t){let n=jk.find(t=>t.stepId===e);if(n===void 0)return null;let r=t[e];return r!==void 0&&r!==``?r:n.defaultModelId}var Gk=24,Kk=[{stepId:`face-embedding`,key:`minLandmarkFaceSize`,label:`Min face size to embed (detection-frame px)`,description:`Faces smaller than this in the small frame the detector sees are not embedded, so they can never be recognised. Below it the face cannot be aligned reliably and a bad embedding matches everyone. Same value on every node. 0 = no limit.`,type:`slider`,min:0,max:64,step:2,default:24}];function qk(e,t){return`clusterStepSetting:${e}:${t}`}function Jk(e){return Kk.filter(t=>t.stepId===e)}var Yk=i().finite();function Xk(e){let t={};for(let n of Kk){let r=Yk.safeParse(e[qk(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 Zk=Xk({});function Qk(e){return e===null?Zk:Xk(Uk(e,new Set(Kk.map(e=>qk(e.stepId,e.key)))))}function $k(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 eA=x([`new`,`entered`,`left`,`moving`,`idle`]),tA=x([`motion`,`object`,`audio`]),nA=p(`kind`,[dE,fE]),rA=x([`motion`,`audio`,`person`,`vehicle`,`animal`,`door`,`pir`,`smoke`,`water`,`button`,`package`,`generic`]),iA=x([`motion`,`audio`,`detection`,`sensor`,`control`,`custom`,`package`]),aA=x([`macro`,`sub`]),oA=d({kind:l(),labelKey:l(),label:l(),color:l(),iconId:l(),icon:rA,category:iA,parentKind:l().nullable(),level:aA,source:d({capName:l(),deviceId:i()})}),sA=d({deviceId:i(),kinds:S(oA).readonly()}),cA=d({id:l(),deviceId:i(),sourceDeviceId:i(),kind:l(),value:y(l(),o()).nullable(),timestamp:i()}),lA=d({x:i(),y:i(),timestamp:i(),bbox:sh,source:x([`frame`,`recovery`]).optional(),score:i().optional()}),uA=d({timestamp:i(),position:lA,mediaId:i().int()}),dA=d({minX:i(),minY:i(),maxX:i(),maxY:i()}),fA=x([`full`,`slim`]),pA=d({label:l(),peakScore:i(),count:i(),firstAt:i(),lastAt:i()}),mA=x([`pipeline`,`onboard`,`sensor`,`audio`]),hA=x([`none`,`staging`,`trained`]),gA=500,_A={markForTrain:C().optional(),debug:C().optional(),debugNote:l().max(500).optional(),favourited:C().optional()},vA={retrainStatus:hA.optional()},yA=d(_A),bA=d({trackId:l(),markForTrain:C(),debug:C(),debugNote:l(),favourited:C(),retrainStatus:hA}),xA=f([m(1),m(2)]),SA=d({stepId:l(),modelId:l().optional(),decidedAt:i(),identityId:l().optional()}),CA={label:l().optional(),labelScore:i().optional(),labelMeta:SA.optional(),subLabel:l().optional(),subLabelScore:i().optional(),subLabelMeta:SA.optional()},wA=d({deviceId:i(),tracks:i().int(),files:i().int(),bytes:i().int()}),TA=d({generatedAt:i(),trackCount:i().int(),fileCount:i().int(),byteCount:i().int(),truncated:C(),devices:S(wA).readonly()}),EA=d({trackId:l(),deviceId:i(),className:l(),...CA,producingDeviceName:l().optional(),source:mA.optional(),firstSeen:i(),lastSeen:i(),positions:S(lA).readonly(),snapshots:S(uA).readonly(),zonesVisited:S(l()).readonly(),zoneNames:S(l()).readonly().optional(),classes:S(l()).readonly().optional(),totalDistance:i(),state:eA,active:C(),importance:i().optional(),bestEventId:l().optional(),importanceReason:l().optional(),audioLabels:S(pA).readonly().optional(),envelope:dA.optional(),hasFace:C().optional(),hasEmbeddedFace:C().optional(),hasRider:C().optional(),previewMissReason:l().optional(),modelId:l().optional(),frameWidth:i().optional(),frameHeight:i().optional(),..._A,...vA}),DA={id:i().int(),deviceId:i(),timestamp:i()},OA=d({...DA,kind:m(`motion`),regionCount:i(),regions:S(d({bbox:sh,pixelCount:i(),intensity:i()})).readonly().optional(),frameWidth:i().optional(),frameHeight:i().optional(),mediaUrl:l().optional(),triggeredBy:dk.optional(),durationMs:i().nullable().optional(),edges:S(i()).readonly().optional()}),kA=x([`pipeline`,`onboard`]),AA=x([`enter`,`exit`]),jA=d({direction:AA,zoneId:l(),zoneName:l().optional()}),MA=d({zoneId:l(),zoneName:l().optional(),overlapPct:i()}),NA=d({...DA,kind:m(`object`),source:kA.optional(),frameId:l().optional(),idempotencyKey:l().optional(),trackId:l().optional(),className:l(),...CA,confidence:i().optional(),bbox:sh.optional(),zones:S(l()).readonly().optional(),zoneOverlaps:S(MA).readonly().optional(),spawnRefused:l().optional(),state:eA.optional(),zoneCrossing:jA.optional(),frameWidth:i().optional(),frameHeight:i().optional(),mediaId:i().int().optional(),keyFrameMediaId:i().int().optional(),mediaUrl:l().optional(),observedAt:i().optional(),importance:i().optional()}),PA=d({...DA,kind:m(`audio`),rms:i(),dbfs:i(),classification:d({className:l(),originalClass:l().optional(),score:i()}).optional(),classifyOutcome:ph.optional(),mediaUrl:l().optional()}),FA=x([`crop`,`thumbnail`,`snapshot`,`firstFrame`,`lastFrame`,`fullFrame`,`fullFrameBoxed`,`faceCrop`,`plateCrop`,`keyFrame`,`keyFrameSmall`,`thumbnailSmall`,`confirmationCrop`,`debugCrop`,`sceneFrame`,`lastSceneFrame`]),IA=d({mediaId:i().int(),kind:FA,sizeBytes:i(),timestamp:i()}),LA=IA.extend({url:l(),base64:l()}),RA=LA.omit({base64:!0}),zA=x([`person`,`vehicle`,`animal`,`package`,`face`,`plate`]),BA=x([`subject`,`model_error`]),VA=x([`operator`,`assist`,`pipeline`,`llm`]),HA=d({x:i(),y:i(),w:i(),h:i()}),UA=d({id:l(),trackId:l().optional(),deviceId:i(),mediaKey:l(),bbox:HA,macroClass:zA,label:l().optional(),subLabel:l().optional(),kind:BA,source:VA,assistModelId:l().optional(),assistScore:i().optional(),exportedInBatch:l().optional(),createdAt:i()}),WA=UA.omit({id:!0,trackId:!0,deviceId:!0,mediaKey:!0,createdAt:!0,exportedInBatch:!0}),GA=d({trackId:l(),deviceId:i(),className:l(),label:l().optional(),firstSeen:i(),lastSeen:i(),frameCount:i().int(),annotationCount:i().int()}),KA=d({mediaId:i().int(),kind:FA,timestamp:i(),sizeBytes:i().int(),copied:C()}),qA=d({bbox:HA,macroClass:zA,label:l().optional(),subLabel:l().optional(),score:i().optional(),modelId:l().optional(),trackId:l(),basis:x([`subject-box`,`position`]),deltaMs:i()}),JA=x([`track`,`recording`]),YA=d({frameId:l(),deviceId:i(),origin:JA,trackId:l().optional(),sourceMediaId:i().int().optional(),epochMs:i().optional(),sourceKind:FA,sizeBytes:i().int(),width:i().int(),height:i().int(),copiedAt:i(),capturedAt:i().optional(),complete:C(),pipelineBoxes:S(qA).readonly().optional(),collectionIds:S(l()).readonly().optional()}),XA=x([`source-missing`,`unreadable-image`,`write-failed`]),ZA=d({copied:S(YA).readonly(),refused:S(d({sourceMediaId:i().int(),reason:XA})).readonly()}),QA=d({candidates:S(KA).readonly(),copies:S(YA).readonly(),autoPickMediaId:i().int().optional()}),$A=x([`unannotated`,`annotated`,`complete`]),ej=d({workState:$A.optional(),deviceIds:S(i()).max(500).optional(),collectionId:l().optional(),classes:S(zA).optional(),page:i().int().positive().default(1),pageSize:i().int().positive().max(100).default(50)}),tj=YA.extend({workState:$A}),nj=d({frames:S(tj).readonly(),total:i().int().nonnegative(),page:i().int().positive(),pageSize:i().int().positive()}),rj=d({deviceId:i(),unannotated:i().int().nonnegative(),annotated:i().int().nonnegative(),complete:i().int().nonnegative(),pctOfCorpus:i().min(0).max(1).nullable()}),ij=d({total:i().int().nonnegative(),unannotated:i().int().nonnegative(),annotated:i().int().nonnegative(),complete:i().int().nonnegative(),cameras:S(rj).readonly()}),aj=d({deviceIds:S(i()).optional(),frameIds:S(l()).max(2e4).optional(),collectionIds:S(l()).max(200).optional(),collectionId:l().optional(),batchId:l().optional(),completeOnly:C().optional(),workState:$A.optional(),classes:S(zA).optional()}),oj=x([`frames`,`crops`]),sj=d({kind:m(`http`),method:x([`PUT`,`POST`]),url:l().url(),headers:y(l(),l()).optional()}),cj=d({batchId:l(),frames:i().int(),crops:i().int(),annotations:i().int(),missing:i().int(),bytes:i().int(),sha256:l(),status:i().int()}),lj=p(`kind`,[d({kind:m(`package`),zone:HA.optional()}),d({kind:m(`objects`),modelId:l(),minScore:i().optional()})]),uj=p(`kind`,[d({kind:m(`proposed`),modelId:l(),stepId:l(),minScore:i(),proposals:S(WA).readonly(),belowThreshold:i().int()}),d({kind:m(`refused`),reason:l(),detail:l().optional()})]),dj=d({id:l(),name:l(),createdAt:i(),frameCount:i().int()}),fj=p(`kind`,[d({kind:m(`created`),collection:dj}),d({kind:m(`refused`),reason:x([`empty-name`,`duplicate-name`])})]),pj=p(`kind`,[d({kind:m(`renamed`),collection:dj}),d({kind:m(`refused`),reason:x([`empty-name`,`duplicate-name`,`unknown-collection`])})]),mj=p(`kind`,[d({kind:m(`added`),collectionId:l(),frame:YA,reused:C()}),d({kind:m(`refused`),reason:x([`unknown-collection`,`still-unavailable`,`still-busy`,`unreadable-image`,`write-failed`]),detail:l().optional()})]),hj=d({id:l(),name:l(),model:l(),kind:l(),leavesHouse:C()}),gj=WA.extend({reason:l()}),_j=d({ref:l(),verdict:x([`confirmed`,`wrong-class`,`not-an-object`,`uncertain`]),suggestedClass:zA.optional(),reason:l()}),vj=p(`kind`,[d({kind:m(`proposed`),profileId:l(),model:l(),leftHouse:C(),proposals:S(gj).readonly(),reviews:S(_j).readonly(),rejected:i().int()}),d({kind:m(`refused`),reason:x([`unknown-frame`,`unreadable-frame`,`unknown-profile`,`profile-disabled`,`no-vision`,`cloud-not-confirmed`,`llm-error`,`malformed-answer`]),detail:l().optional()})]),yj=d({deviceIds:S(i()).readonly().optional(),collectionIds:S(l()).max(200).readonly().optional(),frameIds:S(l()).max(2e4).readonly().optional()}),bj=d({frames:i().int(),completeFrames:i().int(),completeness:i(),subjects:i().int(),modelErrors:i().int(),hardNegatives:i().int(),cells:S(d({macroClass:l(),deviceId:i(),lighting:x([`day`,`night`,`unknown`]),subjects:i().int(),frames:i().int()})).readonly(),cameras:S(d({deviceId:i(),frames:i().int(),completeFrames:i().int()})).readonly()}),xj=d({id:l(),name:l(),createdAt:i(),selection:yj,layout:oj,completeOnly:C(),frameCount:i().int(),annotationHash:l(),manifestSchema:l(),stats:bj}),Sj=d({collectionIds:S(l()).min(1),workState:x([`complete`,`annotated_or_complete`,`any_annotated`]).default(`complete`)}),Cj=p(`kind`,[d({kind:m(`resolved`),frameIds:S(l()).max(2e4).readonly(),stats:bj,annotationHash:l(),layout:oj}),d({kind:m(`refused`),reason:x([`unknown-collection`,`no-frames`]),detail:l()})]),wj=d({trackId:l(),retrainStatus:hA,changed:C(),reason:x([`unknown-track`,`no-frames-copied`,`not-staging`,`not-trained`,`unchanged`]).optional()}),Tj=1e3,Ej=5e3,Dj=d({deviceId:i(),since:i().optional(),until:i().optional(),limit:i().int().min(1).max(Ej).default(Tj),projection:x([`full`,`slim`]).optional()}),Oj=Dj.extend({classFilter:l().optional()}),kj=d({deviceIds:S(i()),since:i().optional(),until:i().optional(),limit:i().int().min(1).max(1e3).default(200),cursor:l().optional(),projection:fA.optional(),includeStationary:C().optional(),classes:S(l()).optional(),excludeSources:S(mA).optional()}),Aj=d({tracks:S(EA).readonly(),nextCursor:l().nullable()}),jj=50,Mj=200,Nj=d({deviceId:i(),since:i(),until:i(),limit:i().int().min(1).max(Mj).default(jj),minImportance:i().min(0).max(1).optional(),classFilter:l().optional()}),Pj=d({id:l(),trackId:l(),timestamp:i(),className:l(),...CA,importance:i(),bestEventId:l(),windowMs:i().optional(),audioLabels:S(pA).readonly().optional(),..._A,...vA}),Fj=d({deviceIds:S(i()).min(1).max(200),since:i(),until:i(),limit:i().int().min(1).max(Mj).default(jj),minImportance:i().min(0).max(1).optional(),classFilter:l().optional()}),Ij=d({deviceId:i(),events:S(Pj).readonly()}),Lj=d({bucketStart:i(),motion:i().int(),object:i().int(),audio:i().int(),audioDbfs:i().optional()}),Rj=200,zj=d({deviceId:i(),read:x([`read`,`unreadable`]),buckets:S(Lj).readonly()}),Bj=d({trackId:l(),className:l(),confidence:i(),bbox:sh,zones:S(l()).readonly(),state:eA}),Vj=a({id:l(),kind:x([`first-level`,`detail`]),macroClass:l(),score:i(),bbox:d({x:i(),y:i(),width:i(),height:i()}),labels:S(a({label:l(),score:i()})).readonly(),parentId:l().optional()}),Hj=NA.extend({score:i()}),Uj=d({text:l(),deviceId:i().optional(),since:i().optional(),until:i().optional(),classFilter:l().optional(),limit:i().default(50),minScore:i().min(0).max(1).optional(),strictness:Zf.optional(),modelId:l().min(1).optional()}),Wj=d({tracks:i().int(),events:i().int(),media:i().int(),faces:i().int(),plates:i().int(),embeddings:i().int()}),Gj=d({mediaDropped:i().int(),tracks:i().int(),events:i().int()}),Kj=d({deviceId:i(),rows:i().int(),bytes:i().int()}),qj=d({totalRows:i().int(),totalBytes:i().int(),devices:S(Kj).readonly()}),Jj=d({kind:FA,rows:i().int(),bytes:i().int()}),Yj=d({totalRows:i().int(),totalBytes:i().int(),kinds:S(Jj).readonly(),unaccountedRows:i().int(),unaccountedBytes:i().int()}),Xj=d({motion:i().int(),object:i().int(),audio:i().int()}),Zj=d({deviceId:i().optional(),since:i().optional(),until:i().optional(),maxTracks:i().int().positive().optional(),executeOnNodeId:l().optional(),pacingMs:i().int().nonnegative().optional(),force:C().optional()}),Qj=d({deleted:i(),failedIndexes:S(l()).optional()}),$j=x([`stores-unavailable`,...Ak,`method-unavailable`,`read-failed`,`reads-disagree`,`not-a-clip-model`,`force-requires-max-tracks`]),eM=d({started:C(),alreadyRunning:C(),refusal:$j.optional(),modelId:l().optional(),index:l().optional()}),tM=d({running:C(),scanned:i(),rebuilt:i(),missingKeyFrame:i(),missingEvent:i(),missingBbox:i(),boxSource:d({subjectBox:i(),positions:i(),event:i(),refused:i()}),alreadyInSpace:i(),force:C().nullable(),forcedInSpace:i(),notRunnable:i(),noCapableNode:i(),failed:i(),complete:C().nullable(),startedAtMs:i().nullable(),finishedAtMs:i().nullable(),error:l().nullable(),modelId:l().nullable(),index:l().nullable()}),nM=d({started:C(),alreadyRunning:C()}),rM=d({mode:x([`report`,`reclaim`]).default(`report`),scopes:S(x([`motion-still`,`track-filmstrip`])).min(1).optional(),deviceIds:S(i().int()).min(1).optional(),restart:C().optional(),pageSize:i().int().min(50).max(5e3).optional(),maxRowsPerDevice:i().int().min(1).max(5e5).optional(),maxReclaimPerDevice:i().int().min(1).max(5e5).optional(),maxBytesPerRun:i().int().min(1).optional(),budgetMinutes:i().int().min(1).max(720).optional(),throttleBytesPerSec:i().int().min(64*1024).optional(),graceMinutes:i().int().min(1).max(10080).optional()}),iM=d({running:C(),mode:x([`report`,`reclaim`]).nullable(),totalExamined:i(),totalEligible:i(),totalReclaimed:i(),totalBytesReclaimed:i(),totalRefused:i(),devicesDone:i(),complete:C().nullable(),startedAtMs:i().nullable(),finishedAtMs:i().nullable(),error:l().nullable()}),aM=x([`motion`,`audio-dbfs`,`battery`,`occupancy`]),oM=`|`;function sM(e,t){let n=e??``;return t===void 0?n:`${n}|${t}`}function cM(e){let t=e.indexOf(`|`);return t<0?{zoneId:e}:{zoneId:e.slice(0,t),className:e.slice(t+1)}}var lM=d({scope:l(),bucketStart:i().int(),samples:i().int().nonnegative(),sum:i(),min:i(),max:i()}),uM={name:`pipeline-analytics`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:D(d({deviceId:i()}),S(EA).readonly()),getTrack:D(d({deviceId:i(),trackId:l()}),EA.nullable()),listTracks:D(d({deviceId:i(),since:i().optional(),until:i().optional(),limit:i().optional(),zone:nA.optional(),projection:fA.optional(),includeStationary:C().optional(),classes:S(l()).optional(),excludeSources:S(mA).optional()}),S(EA).readonly()),listRecentTracks:D(kj,Aj),clearTracks:D(d({deviceId:i()}),v(),{kind:`mutation`,auth:`admin`}),getMotionEvents:D(Dj,S(OA).readonly()),getObjectEvents:D(Oj,S(NA).readonly()),getAudioEvents:D(Dj,S(PA).readonly()),listEventKinds:D(d({deviceId:i()}),S(oA).readonly()),listEventKindsBatch:D(d({deviceIds:S(i()).min(1).max(200)}),S(sA).readonly()),getSensorEvents:D(d({deviceId:i(),since:i().optional(),until:i().optional(),kinds:S(l()).optional(),limit:i().int().min(1).max(Ej).default(Tj)}),S(cA).readonly()),getKeyEvents:D(Nj,S(Pj).readonly()),getKeyEventsBatch:D(Fj,S(Ij).readonly()),readLongTermSeries:D(d({deviceId:i(),series:aM,scope:l().optional(),from:i(),to:i(),limit:i().int().positive().optional()}),S(lM).readonly()),getEventDensity:D(d({deviceId:i(),since:i(),until:i(),bucketMs:i().int().positive()}),S(Lj).readonly()),getEventDensityBatch:D(d({deviceIds:S(i()).min(1).max(200),since:i(),until:i(),bucketMs:i().int().positive()}),S(zj).readonly()),pruneEventsBefore:D(d({deviceId:i(),cutoffMs:i()}),d({motion:i().int(),object:i().int(),audio:i().int()}),{kind:`mutation`,auth:`admin`}),pruneTracksBefore:D(d({deviceId:i(),cutoffMs:i()}),Wj,{kind:`mutation`,auth:`admin`}),wipeAllAnalytics:D(d({deviceId:i()}),Wj,{kind:`mutation`,auth:`admin`}),reconcileFromDisk:D(d({deviceId:i()}),Gj,{kind:`mutation`,auth:`admin`}),deleteTracks:D(d({deviceId:i(),trackIds:S(l()).min(1)}),d({deleted:i().int(),failed:S(l()).readonly(),sparedMediaIds:S(i().int()).readonly().optional()}),{kind:`mutation`,auth:`admin`}),setTrackFlags:D(d({deviceId:i(),trackId:l(),flags:yA}),bA,{kind:`mutation`}),listArchivedDebugNotes:D(_l,S(gl).readonly(),{kind:`query`}),setTrackRelation:D(El,wl,{kind:`mutation`}),clearTrackRelation:D(Dl,Ol,{kind:`mutation`}),setTrackPurity:D(kl,Al,{kind:`mutation`}),listTrackRelations:D(jl,Ml,{kind:`query`}),listBirthDecisions:D(pl,S(fl).readonly(),{kind:`query`}),getEventStoreFootprint:D(d({}),qj,{kind:`query`,auth:`admin`}),getEventMediaFootprintByKind:D(d({deviceId:i().int().optional()}),Yj,{kind:`query`,auth:`admin`}),pruneEvents:D(d({olderThanMs:i(),reason:Yl.optional()}),Xj,{kind:`mutation`,auth:`admin`}),deleteDeviceEvents:D(d({deviceId:i()}),Xj,{kind:`mutation`,auth:`admin`}),pauseForStorageMigration:D(Iu,d({paused:m(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:D(Iu,d({resumed:m(!0)}),{kind:`mutation`,auth:`admin`}),refreshStorageLocationsForMigration:D(Iu,d({refreshed:m(!0)}),{kind:`mutation`,auth:`admin`}),startStorageMigrationMove:D(Hu,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),getStorageMigrationMoveStatus:D(d({jobId:l()}),Nu.nullable(),{auth:`admin`}),cancelStorageMigrationMove:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),relocateMedia:D(zu,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),countUnstampedEventMedia:D(d({}),Vu,{auth:`admin`}),countRelocatableMedia:D(hd,md,{kind:`query`,auth:`admin`}),listRelocateMediaJobs:D(d({}),S(Nu).readonly(),{kind:`query`,auth:`admin`}),cancelRelocateMedia:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),listOpsLog:D(Zl,S(Xl).readonly(),{kind:`query`,auth:`admin`}),reclaimDebugMedia:D(rM,nM,{kind:`mutation`,auth:`admin`}),getMediaReclaimStatus:D(d({}),iM,{kind:`query`,auth:`admin`}),getTrainingExportSummary:D(d({deviceIds:S(i()).optional()}),TA,{kind:`query`,auth:`admin`}),getTrainingExportUrl:D(d({deviceIds:S(i()).optional()}),d({url:l()}),{kind:`query`,auth:`admin`}),listRetrainStaging:D(d({deviceIds:S(i()).optional(),limit:i().int().min(1).max(500).optional()}),S(GA).readonly(),{kind:`query`,auth:`admin`}),listRetrainCorpusPage:D(ej,nj,{kind:`query`,auth:`admin`}),getRetrainCorpusKpi:D(d({}),ij,{kind:`query`,auth:`admin`}),listRetrainFrames:D(d({trackId:l()}),QA,{kind:`query`,auth:`admin`}),selectRetrainFrames:D(d({deviceId:i(),trackId:l(),mediaIds:S(i().int()).min(1)}),ZA,{kind:`mutation`,auth:`admin`}),deselectRetrainFrame:D(d({deviceId:i(),trackId:l().optional(),frameId:l()}),d({removed:C(),removedAnnotations:i().int()}),{kind:`mutation`,auth:`admin`}),getRetrainFrameImage:D(d({frameId:l()}),d({base64:l(),width:i().int(),height:i().int()}),{kind:`query`,auth:`admin`}),proposeRetrainAnnotations:D(d({deviceId:i(),trackId:l().optional(),frameId:l(),subject:lj,nodeId:l().optional()}),uj,{kind:`mutation`,auth:`admin`}),listRetrainAnnotations:D(d({trackId:l().optional(),frameIds:S(l()).max(2e3).optional()}),S(UA).readonly(),{kind:`query`,auth:`admin`}),saveRetrainAnnotations:D(d({deviceId:i(),trackId:l().optional(),frameId:l(),annotations:S(WA)}),S(UA).readonly(),{kind:`mutation`,auth:`admin`}),completeRetrainTrack:D(d({deviceId:i(),trackId:l()}),wj,{kind:`mutation`,auth:`admin`}),restageRetrainTrack:D(d({deviceId:i(),trackId:l()}),wj,{kind:`mutation`,auth:`admin`}),getRetrainExportUrl:D(aj.extend({layout:oj.optional()}),d({url:l()}),{kind:`query`,auth:`admin`}),setRetrainFrameComplete:D(d({deviceId:i(),trackId:l().optional(),frameId:l(),complete:C()}),YA,{kind:`mutation`,auth:`admin`}),writeRetrainArchive:D(d({filter:aj,layout:oj,target:sj}),cj,{kind:`mutation`,auth:`admin`,timeoutMs:60*6e4}),offerRetrainArchive:D(d({filter:aj,layout:oj}),d({ticket:En,frames:i().int(),annotations:i().int()}),{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),listRetrainAssistProfiles:D(d({}),S(hj).readonly(),{kind:`query`,auth:`admin`}),proposeRetrainAnnotationsWithLlm:D(d({deviceId:i(),trackId:l().optional(),frameId:l(),profileId:l(),classes:S(zA).min(1),boxes:S(d({ref:l(),bbox:HA,macroClass:zA,label:l().optional()})).max(50),allowCloud:C()}),vj,{kind:`mutation`,auth:`admin`,timeoutMs:18e4}),createRetrainCollection:D(d({name:l().max(120)}),fj,{kind:`mutation`,auth:`admin`}),listRetrainCollections:D(d({}),S(dj).readonly(),{kind:`query`,auth:`admin`}),resolveRetrainTrainingCorpus:D(Sj,Cj,{kind:`query`,auth:`admin`,timeoutMs:6e4}),renameRetrainCollection:D(d({id:l(),name:l().max(120)}),pj,{kind:`mutation`,auth:`admin`}),deleteRetrainCollection:D(d({id:l()}),d({deleted:C(),removedFrames:i().int()}),{kind:`mutation`,auth:`admin`}),addRetrainFrameFromRecording:D(d({collectionId:l(),deviceId:i(),epochMs:i()}),mj,{kind:`mutation`,auth:`admin`,timeoutMs:6e4}),addRetrainFramesToCollection:D(d({collectionId:l(),frameIds:S(l()).min(1).max(500)}),d({added:i().int(),alreadyMember:i().int(),unknownFrameIds:S(l()).readonly()}),{kind:`mutation`,auth:`admin`}),removeRetrainFrameFromCollection:D(d({collectionId:l(),frameId:l()}),d({removed:C(),deletedFrame:C()}),{kind:`mutation`,auth:`admin`}),listRetrainCollectionFrames:D(d({collectionId:l()}),S(YA).readonly(),{kind:`query`,auth:`admin`}),getEventMedia:D(d({ownerType:Ss,eventId:i().int(),kind:FA.optional(),deviceId:i()}),S(LA).readonly()),getTrackMedia:D(d({trackId:l(),kinds:S(FA).optional(),deviceId:i()}),S(LA).readonly()),listTrackMedia:D(d({trackId:l(),deviceId:i()}),S(RA).readonly()),listEventMedia:D(d({ownerType:Ss,eventId:i().int(),deviceId:i()}),S(RA).readonly()),ownersWithMedia:D(d({deviceId:i(),ownerKind:ws,ownerIds:S(l()).max(5e3)}),S(l()).readonly()),searchObjectEvents:D(Uj,S(Hj).readonly(),{caller:`required`}),wipeObjectEmbeddings:D(d({}),Qj,{kind:`mutation`,auth:`admin`}),rebuildObjectEmbeddings:D(Zj,eM,{kind:`mutation`,auth:`admin`}),getObjectEmbeddingRebuildStatus:D(d({}),tM)},events:{onFrameTracked:{data:d({deviceId:i(),timestamp:i(),frameWidth:i(),frameHeight:i(),detections:S(Vj).readonly()})},onTrackStarted:{data:d({deviceId:i(),trackId:l(),className:l()})},onTrackEnded:{data:d({deviceId:i(),trackId:l(),className:l(),durationMs:i()})},onDetectionEvent:{data:d({deviceId:i(),kind:tA,eventId:l(),timestamp:i()})}}},dM=d({stepId:l(),modelId:l(),detections:S(d({bbox:u([i(),i(),i(),i()]),score:i(),landmarks:S(d({x:i(),y:i()})).optional()})).min(1)}),fM=d({handle:rr,cropFrameSpace:d({x:i(),y:i(),w:i(),h:i()})});d({crop:d({left:i(),top:i(),width:i().positive(),height:i().positive()}).optional(),content:d({width:i().int().positive(),height:i().int().positive()}),fit:x([`stretch`,`contain`]),format:x([`rgb`,`gray`,`jpeg`])});var pM=d({registryId:l().min(1),id:l().min(1),width:i().int().positive(),height:i().int().positive(),format:x([`rgb`,`gray`]),timestamp:i(),capturedAt:i().optional()}),mM=x([`onnx`,`coreml`,`openvino`,`tflite`,`pt`,`gguf`]),hM=x([`detector`,`cropper`,`classifier`,`refiner`,`audio-classifier`]),Y=d({runtime:m(`python`),backend:l(),format:mM,device:l().optional()}),gM=d({deviceKey:l().nullable(),runtime:l(),batchMode:l(),windowMs:i(),maxBatchSize:i(),concurrency:i(),numWorkers:i()}),_M=d({engine:Y,devices:S(d({id:l(),label:l(),description:l().optional()})).readonly(),defaultDevice:l()}),vM=pe(()=>d({addonId:l(),addonName:l(),slot:hM,inputClasses:S(l()).readonly(),outputClasses:S(l()).readonly(),enabled:C(),modelId:l(),children:S(vM).readonly(),group:l().optional(),settings:y(l(),o()).optional()})),yM=d({id:l(),name:l(),formats:y(l(),Fp),group:Rp.optional(),legacy:C().optional(),provider:Bp.optional(),defaultConfidence:i().optional(),suppliesSteps:S(Wp).readonly().optional()}),bM=_(),xM=d({id:l(),name:l(),slot:hM,inputClasses:S(l()).readonly(),outputClasses:S(l()).readonly(),childSlots:S(hM).readonly(),models:S(yM).readonly(),defaultModelId:l(),defaultModelIdByFormat:y(l(),l()).optional(),enabledByDefault:C().optional(),backfillIntoExistingOverrides:C().optional(),defaultConfidence:i(),group:l().optional(),configSchema:S(bM).readonly().optional()}),SM=d({id:hM,label:l(),priority:i(),parentSlot:hM.nullable(),addons:S(xM).readonly()}),CM=d({availableEngines:S(_M).readonly(),selectedEngine:Y,slots:S(SM).readonly()}),wM=d({runtimeId:x([`onnx`,`openvino`,`coreml`,`edgetpu`]).nullable(),device:l().nullable(),state:x([`idle`,`installing`,`verifying`,`ready`,`failed`]),progress:i().optional(),error:l().optional(),nextRetryAt:i().optional(),configIssues:S(l()).optional()}),TM=pe(()=>d({addonId:l(),modelId:l().optional(),enabled:C().default(!0),children:S(TM).optional(),settings:y(l(),o()).optional(),jumpDeviceKey:l().optional()})),EM=d({addonId:l(),chosen:l(),running:l(),format:l()}),DM=d({addonId:l(),kind:x([`unknown-addon`,`no-format-build`,`unknown-device`]),detail:l()}),OM=d({ok:C(),issues:S(DM).readonly(),substitutions:S(EM).readonly(),format:l()}),kM=d({filename:l(),stepIds:S(l()).readonly().optional()}),AM=d({base64:l(),filename:l()}),jM=d({filename:l(),sizeKb:i()}),MM=d({base64:l()}),NM=d({id:l(),name:l(),description:l(),available:C(),rawLabels:S(l()).readonly().optional()}),PM=d({activeBackend:l(),availableBackends:S(NM).readonly(),sampleRate:i(),chunkDurationMs:i()}),FM=d({filePath:l(),sizeMB:i(),durationMs:i()}),IM=d({success:C(),error:l().optional(),frame:_().optional()}),LM=_(),RM=_(),zM=_(),BM=_(),VM=_(),HM=_(),UM={name:`pipeline-executor`,scope:`system`,mode:`singleton`,methods:{getAvailableEngines:D(v(),S(Y)),getSelectedEngine:D(v(),Y),getDefaultSteps:D(Y,S(vM)),getEngineProvisioning:D(d({nodeId:l()}),wM),getVideoPipelineSteps:D(v(),y(l(),d({modelId:l(),settings:y(l(),o()).readonly()}))),setVideoPipelineSteps:D(d({steps:y(l(),d({modelId:l(),settings:y(l(),o()).readonly()}))}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),clearDeviceOverrides:D(d({nodeId:l()}),d({success:m(!0),clearedDevices:i()}),{kind:`mutation`,auth:`admin`}),clearModelBoundDeviceOverrides:D(d({nodeId:l(),deviceIds:S(i()).readonly().optional(),dryRun:C()}),d({entries:S(d({deviceId:i(),keys:S(l()).readonly()})).readonly(),refused:S(d({deviceId:i(),reason:l()})).readonly()}),{kind:`mutation`,auth:`admin`}),getInferenceDeviceHealth:D(d({nodeId:l()}),d({unhealthy:S(d({deviceKey:l(),state:x([`failed`,`backoff`]),since:i(),deaths:i(),lastError:l()})).readonly()})),rearmInferenceDevice:D(d({nodeId:l(),deviceKey:l()}),d({rearmed:C()}),{kind:`mutation`,auth:`admin`}),getSchema:D(v(),CM),getGlobalSteps:D(v(),S(vM).readonly().nullable()),getGlobalPipelineConfig:D(v(),LM),getOrchestratorConfigSchema:D(v(),RM),validatePipeline:D(d({steps:S(TM),deviceKey:l().optional()}),OM),getCapabilities:D(v(),BM),getAddonModels:D(d({addonId:l()}),VM),downloadModel:D(d({addonId:l(),modelId:l(),format:mM}),FM,{kind:`mutation`}),deleteModel:D(d({addonId:l(),modelId:l(),format:mM}),d({success:m(!0)}),{kind:`mutation`}),runPipeline:D(d({steps:S(TM).min(1),frame:oh.optional(),frameRef:pM.optional(),frameHandle:rr.optional(),imageBase64:l().optional(),image:b(Uint8Array).optional(),referenceImage:l().optional(),deviceId:i().optional(),sessionId:l().optional(),plane:x([`full`,`frame`]).optional(),deviceKey:l().optional(),nativeCropRef:fM.optional(),replay:m(!0).optional(),suppliedRoot:dM.optional()}),HM,{kind:`mutation`}),runPipelineBatch:D(d({steps:S(TM).min(1),frames:S(oh).min(1).max(255),deviceId:i().optional(),sessionId:l().optional(),frameId:i().int().nonnegative().optional(),deviceKey:l().optional()}),d({results:S(HM).readonly()}),{kind:`mutation`}),cacheFrameInPool:D(d({data:b(Uint8Array),width:i().int().positive(),height:i().int().positive(),format:x([`rgb`,`bgr`,`gray`])}),d({frameId:i(),width:i(),height:i()}),{kind:`mutation`}),inferCached:D(d({stepId:l(),frameId:i().int(),modelId:l().min(1)}),y(l(),o()),{kind:`mutation`}),uncacheFrame:D(d({frameId:i().int()}),v(),{kind:`mutation`}),getEffectiveTuning:D(d({deviceKey:l().optional()}),gM),listLoadedEngines:D(v(),S(d({engineKey:l(),engine:Y,modelsLoaded:S(l()).readonly(),inUseByCameras:S(i()).readonly(),kind:x([`runtime`,`device-pool`]),poolPid:i().nullable(),idleMs:i().nullable(),idleTtlMs:i().nullable()})).readonly()),spinEngine:D(d({engine:Y}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),killEngine:D(d({engine:Y,force:C().optional()}),d({success:C(),reason:l().optional()}),{kind:`mutation`,auth:`admin`}),listReferenceImages:D(v(),S(kM).readonly()),getReferenceImage:D(d({filename:l()}),AM.nullable()),getReferenceAudioFiles:D(v(),S(jM).readonly()),getReferenceAudio:D(d({filename:l()}),MM.nullable()),getAudioCapabilities:D(v(),PM),runAudioTest:D(d({addonId:l(),modelId:l(),filename:l().optional(),settings:y(l(),o()).optional()}),IM,{kind:`mutation`}),getDetectionConfigSchema:D(v(),zM)}},WM=x(yr),GM=2,KM={min:1,max:8},qM=x([`intel-core-ultra`,`intel-n-series`,`apple-m-base`,`apple-m-pro`,`amd-phoenix`,`unknown`]),JM=x([`intel-npu`,`intel-igpu`,`amd-igpu`,`amd-npu`,`x86-cpu`,`arm-cpu`,`apple-ane`,`coral`]),YM=p(`kind`,[d({kind:m(`capacity`),sessions:i(),minSessions:i()}),d({kind:m(`tie-faster`),over:l(),recallDelta:i()}),d({kind:m(`stepped-down`),from:l(),to:l(),limitedBy:l()}),d({kind:m(`no-fit-lightest`),sessions:i(),minSessions:i()}),d({kind:m(`derived-latency`),modelId:l()}),d({kind:m(`cpu-device`)}),d({kind:m(`coral-untouched`)}),d({kind:m(`device-disabled`)}),d({kind:m(`device-unavailable`)}),d({kind:m(`node-offline`)}),d({kind:m(`no-hardware-facts`)}),d({kind:m(`no-measured-data`),hardwareClass:qM}),d({kind:m(`no-family-build`),format:WM}),d({kind:m(`kept-custom-pin`),modelId:l(),deviceKey:l()})]),XM=x([`custom-pin`]),ZM=p(`kind`,[d({kind:m(`table`)}),d({kind:m(`node-benchmark`),resultId:l(),measuredAtMs:i()})]),QM=d({modelId:l(),p50Ms:i(),fps:i(),measured:C(),source:ZM.optional(),capacitySessions:i(),personRecall:i()}),$M=d({deviceKey:l(),accelerator:JM.nullable(),enabled:C(),available:C(),chosen:QM.nullable(),kept:XM.optional(),reasons:S(YM).readonly()}),eN=d({nodeId:l(),reachable:C(),hardwareClass:qM.nullable(),cpuModel:l().nullable(),skipped:C(),acceleratorModelId:l().nullable(),devices:S($M).readonly(),reasons:S(YM).readonly()}),tN=d({stepId:l(),before:l().nullable(),after:l().nullable()}),nN=d({nodeId:l(),deviceKey:l(),madeExplicit:C(),modelPins:S(tN).readonly(),thresholds:S(d({stepId:l(),keys:S(l()).readonly()})).readonly()}),rN=d({deviceId:i(),source:x([`step-override`,`wholesale`]),nodeId:l(),deviceKey:l().nullable(),stepId:l(),modelIdBefore:l().nullable(),keys:S(l()).readonly()}),iN=d({deviceId:i(),keys:S(l()).readonly()}),aN=p(`kind`,[d({kind:m(`detector-store-cluster-wide`),skippedNodes:S(l()).readonly()}),d({kind:m(`detector-store-unreadable`),error:l()}),d({kind:m(`coral-enabled`),nodeId:l(),deviceKey:l()}),d({kind:m(`custom-pin-kept`),nodeId:l(),deviceKey:l().nullable(),deviceId:i().nullable(),modelId:l()}),d({kind:m(`custom-registry-unreadable`),error:l()})]),oN=d({headroom:i().min(.3).max(.5).default(.4),minSessionsPerDevice:i().int().min(KM.min).max(KM.max).default(2)}),sN=d({planHash:l(),family:m(`yolov9`),headroom:i(),minSessionsPerDevice:i(),cameraFps:i(),generatedAt:i(),nodes:S(eN).readonly(),nodeChanges:S(nN).readonly(),cameraClears:S(rN).readonly(),detectorStoreClears:S(iN).readonly(),warnings:S(aN).readonly()}),cN=d({planHash:l(),headroom:i().min(.3).max(.5).default(.4),minSessionsPerDevice:i().int().min(KM.min).max(KM.max).default(2)}),lN=d({phase:x([`download`,`camera-overrides`,`detector-thresholds`,`node-models`,`redispatch`]),ok:C(),detail:l()}),uN=p(`kind`,[d({kind:m(`applied`),planHash:l(),phases:S(lN).readonly()}),d({kind:m(`aborted`),phases:S(lN).readonly()}),d({kind:m(`stale`),plan:sN}),d({kind:m(`refused`),reason:x([`apply-in-progress`])})]),dN=x([`least-loaded`,`share`]),fN=`share`,pN=`sessionPlacement`;function mN(e){let t=dN.safeParse(e);return t.success?t.data:fN}var hN=d({nodes:y(l(),i().positive()).default({}),devices:y(l(),y(l(),i().positive())).default({})}),gN=d({windowMs:i().int().min(6e4).max(1440*60*1e3).default(3600*1e3)}),_N=d({deviceKey:l(),sessionsNow:i(),sessionsStarted:i(),observedShare:i().nullable()}),vN=d({nodeId:l(),sessionsNow:i(),sessionsStarted:i(),observedShare:i().nullable(),peakSessions:i(),yieldsAway:i(),devices:S(_N).readonly()}),yN=d({deviceId:i(),deviceKey:l(),reason:x([`disabled`,`absent`])}),bN=d({policy:dN,windowMs:i(),observedForMs:i(),sessionsNow:i(),clusterPeakSessions:i(),nodes:S(vN).readonly(),stalePins:S(yN).readonly()}),xN=x([`hardware`,`benchmark`]),SN=x([`no-benchmark-results`,`partial-benchmark-results`]),CN=d({headroom:i().min(.3).max(.5).default(.4),source:xN.default(`hardware`)}),wN=d({deviceKey:l(),share:i(),modelId:l().nullable(),fps:i().nullable(),measured:C(),suggestedMaxSessions:i().nullable()}),TN=d({nodeId:l(),share:i().nullable(),capacitySessions:i(),devices:S(wN).readonly(),skippedReason:l().nullable(),capacitySource:xN.nullable(),capacityFallback:SN.nullable()}),EN=d({headroom:i(),source:xN,cameraFps:i(),minSessionsPerDevice:i(),nodes:S(TN).readonly()}),DN=x([`hardware`,`benchmark`,`manual`]),ON=`benchmark`;function kN(e){return e!==`manual`}var AN=.4,jN=`shareSource`;function MN(e){if(e===`auto`)return`hardware`;let t=DN.safeParse(e);return t.success?t.data:ON}var NN=d({source:DN}),PN=d({nodes:y(l(),i()),devices:y(l(),y(l(),i()))}),FN=d({deviceKey:l(),eligible:C(),configuredPct:i(),effectivePct:i()}),IN=d({nodeId:l(),eligible:C(),configuredPct:i(),effectivePct:i(),capacitySource:xN.nullable(),capacityFallback:SN.nullable(),devices:S(FN).readonly()}),LN=d({source:DN,policy:dN,autoPending:C(),computedAt:i().nullable(),trigger:l().nullable(),nodes:S(IN).readonly(),nodeWeights:y(l(),i()),deviceWeights:y(l(),y(l(),i()))}),X={fpsPerStream:10,budgetMinutes:45,minBudgetMinutes:10,maxBudgetMinutes:120,staleAfterDays:30,settleSec:5,measureSec:20,drainTimeoutSec:120,maxModelsPerDevice:6},RN=x([`device`,`pipeline`]),zN=d({deviceKey:l().min(1),modelIds:S(l().min(1)).min(1).max(X.maxModelsPerDevice)}),BN=d({nodeId:l().min(1),devices:S(zN).min(1),phases:S(RN).min(1).default([`device`,`pipeline`]),steps:S(l().min(1)).default([]),fpsPerStream:i().int().min(1).max(30).default(X.fpsPerStream),budgetMinutes:i().int().min(X.minBudgetMinutes).max(X.maxBudgetMinutes).default(X.budgetMinutes),keepDownloadedModels:C().default(!1),acceptInsufficientHeadroom:C().default(!1)}),VN=x([`benchmark-active`,`node-offline`,`unknown-device`,`no-phase`,`insufficient-headroom`]),HN=d({kind:VN,detail:l(),overridable:C()}),UN=d({deviceId:i(),placedOnNode:C(),pinnedToNode:C()}),WN=d({deviceId:i(),reason:m(`only-frame-source`)}),GN=d({nodeId:l(),online:C(),moving:S(UN).readonly(),staying:S(WN).readonly(),estimatedDurationMs:i(),budgetMs:i(),phases:S(RN).readonly(),steps:S(l()).readonly(),devices:S(zN).readonly(),headroom:d({sessionsNow:i(),otherNodesCapacitySessions:i().nullable()}),refusals:S(HN).readonly(),canStart:C()}),KN=d({phase:x([`preparing`,`device`,`pipeline`,`cleanup`]),deviceKey:l().nullable(),modelId:l().nullable(),load:i().nullable(),cellsDone:i(),cellsTotal:i(),message:l()}),qN=x([`p95`,`drops`,`errors`,`stall`,`cpu`,`ram`,`none`]),JN=d({load:i(),pass:C(),p95Ms:i(),dropRatio:i(),fps:i(),cpuPct:i().nullable(),ramFreePct:i().nullable(),failReasons:S(l()).readonly()}),YN=d({phase:m(`device`),deviceKey:l(),modelId:l(),p50Ms:i(),p95Ms:i(),p99Ms:i(),fps:i(),kMax:i(),limitedBy:qN,warmupMs:i(),ramp:S(JN).readonly()}),XN=d({phase:m(`pipeline`),deviceKey:l(),modelId:l(),steps:S(l()).readonly(),maxSessions:i(),limitedBy:qN,stepsFired:S(l()).readonly(),warmupMs:i(),ramp:S(JN).readonly()}),ZN=p(`phase`,[YN,XN]),QN=d({pipelineVersion:l().nullable(),cpuModel:l().nullable(),ramGb:i().nullable(),os:l().nullable(),pools:y(l(),d({runtime:l(),numWorkers:i(),concurrency:i(),batchMode:l()})).default({})}),$N=d({id:l(),revision:l().nullable(),frames:i(),width:i(),height:i()}),eP=d({runId:l().min(1),devices:S(zN).min(1),phases:S(RN).min(1),steps:S(l()).default([]),fpsPerStream:i().int().min(1).max(30),deadlineAtMs:i(),settleSec:i().min(0).max(60).default(X.settleSec),measureSec:i().min(2).max(300).default(X.measureSec),keepDownloadedModels:C().default(!1)}),tP=x([`running`,`done`,`failed`,`aborted`]),nP=d({runId:l(),nodeId:l(),state:tP,progress:KN.nullable(),cells:S(ZN).readonly(),fingerprint:QN.nullable(),clip:$N.nullable(),activeCameraIds:S(i()).readonly(),deletedModels:S(l()).readonly(),error:l().nullable(),startedAtMs:i(),finishedAtMs:i().nullable()}),rP=x([`draining`,`measuring`,`restoring`,`done`,`failed`,`aborted`]),iP=x([`completed`,`operator-abort`,`deadline`,`node-lost`,`runner-lost`,`hub-restart`,`drain-timeout`,`failed`]),aP=d({runId:l(),nodeId:l(),state:rP,plan:BN,startedAtMs:i(),deadlineAtMs:i(),finishedAtMs:i().nullable(),endReason:iP.nullable(),error:l().nullable(),moved:S(i()).readonly(),staying:S(i()).readonly(),contaminated:C(),progress:KN.nullable(),resultIds:S(l()).readonly()}),oP=d({modeNodeId:l().nullable(),run:aP.nullable()}),sP=d({id:l(),runId:l(),nodeId:l(),cell:ZN,fpsPerStream:i(),fingerprint:QN.nullable(),clip:$N.nullable(),contaminated:C(),stayingCameras:S(i()).readonly(),partialRun:C(),measuredAtMs:i()}),cP=d({nodeId:l().optional(),deviceKey:l().optional()}),lP=sP.extend({standing:x([`fresh`,`stale`,`superseded`]),staleWhy:x([`age`,`runtime`,`pool-tuning`]).nullable()}),uP=d({runId:l(),nodeId:l(),startedAtMs:i(),deadlineAtMs:i(),plan:BN,moved:S(i()).readonly(),staying:S(i()).readonly()}),dP=d({nodeId:l(),reachable:C(),devices:S(d({deviceKey:l(),enabled:C(),available:C(),suggested:S(l()).readonly(),all:S(l()).readonly(),currentModelId:l().nullable()})).readonly(),steps:S(d({id:l(),name:l(),slot:l()})).readonly()}),fP=d({activeCameras:i(),throttledCameras:i(),avgInferenceTimeMs:i(),queueDepth:i()}),pP=d({detectionMode:x([`disabled`,`always-on`,`on-motion`]),configuredFps:i(),actualFps:i(),queueDepth:i(),avgInferenceTimeMs:i(),droppedFrames:i(),phase:x([`idle`,`watching`,`active`])}),mP=pP.extend({deviceId:i()}),hP=x([`polygon`,`tripwire`]),gP=d({x:i(),y:i()}),_P=d({id:l(),name:l(),kind:hP.default(`polygon`),polygon:S(gP).readonly(),color:l().default(`#3b82f6`)}),vP={name:`zones`,scope:`device`,mode:`singleton`,deviceTypes:[k.Camera],methods:{listZones:D(d({deviceId:i()}),S(_P).readonly()),addZone:D(d({deviceId:i(),zone:_P}),v(),{kind:`mutation`,auth:`admin`}),removeZone:D(d({deviceId:i(),zoneId:l()}),v(),{kind:`mutation`,auth:`admin`}),updateZone:D(d({deviceId:i(),zone:_P}),v(),{kind:`mutation`,auth:`admin`})},runtimeState:d({zones:S(_P).readonly()}),durability:`restored`},yP=d({x:i(),y:i(),w:i(),h:i()}),bP=d({bytes:b(Uint8Array).optional(),jpeg:l().optional(),jpegBytes:b(Uint8Array).optional(),width:i().int().positive(),height:i().int().positive(),tier:x([`native`,`ram-fullframe`]).optional()}),xP=x([`keyFrame`,`thumbnail`]),SP=x([`handle-gone`,`encode-failed`]),CP=p(`parked`,[d({parked:m(!0),nodeId:l(),width:i().int().positive(),height:i().int().positive(),bytes:i().int().nonnegative(),replaced:C()}),d({parked:m(!1),nodeId:l(),reason:SP,handleAgeMs:i().nullable(),detail:l().optional()})]),wP=d({jpeg:l().optional(),jpegBytes:b(Uint8Array).optional(),width:i().int().positive(),height:i().int().positive(),timestamp:i(),parkedAt:i()}),TP=d({bbox:yP,className:l()}),EP=d({stepId:l(),className:l(),score:i(),bbox:yP.optional(),embedding:l().optional(),embeddingMagnitude:i().optional(),embeddingModelId:l().optional(),label:l().optional(),labelTier:f([m(1),m(2)]).optional(),labelModelId:l().optional(),alignedCropJpeg:l().optional(),nativeFaceShortSidePx:i().optional(),landmarks:S(d({x:i(),y:i()})).optional()}),DP=x([`unknown-step`,`model-not-servable`,`unreadable-frame`,`execution-failed`]),OP=p(`kind`,[d({kind:m(`ran`),nodeId:l(),modelId:l(),details:S(EP)}),d({kind:m(`refused`),nodeId:l(),reason:DP,detail:l()})]),kP={min:0,max:6e4,default:3e4,step:500},AP={min:0,max:6e5,default:12e4,step:5e3},jP={min:5e3,max:6e5,default:9e4,step:5e3},MP={min:1,max:30,default:4,step:1},NP={min:1,max:30,default:10,step:1},PP={min:0,max:300,default:300,step:5},FP={min:1,max:10,default:4,step:1},IP={min:0,max:30,default:12,step:1},LP=x([`onboard`,`analyzer`,`device-activity`]),RP=d({source:LP,triggeredBy:dk,sensorName:l().optional()}),zP=S(LP),BP={analyzer:`Frame-diff Analyzer (motion addon)`,onboard:`Camera sensors`,"device-activity":`Device activity (the device says it is working)`};function VP(e){let t=LP.safeParse(e);return t.success?BP[t.data]:e}var HP=[`analyzer`,`onboard`,`device-activity`],UP=n(e=>Array.isArray(e)&&e.length>1?e.slice(0,1):e,S(kA).max(1)),WP=d({deviceId:i(),detected:C(),source:LP.default(`analyzer`),regions:S(eT).readonly().optional()}),GP=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)`),KP=d({modelId:l().optional(),settings:y(l(),o()).optional()}),qP=d({deviceKey:l(),weight:i().positive().default(1),maxSessions:i().int().positive().nullable().default(null),steps:y(l(),KP).optional()}),JP=d({deviceId:i(),detectionMode:x([`disabled`,`always-on`,`on-motion`]).default(`on-motion`),audioMode:x([`disabled`,`always-on`,`on-motion`]).default(`always-on`),motionCooldownMs:i().min(kP.min).default(kP.default),maxSessionHoldMs:i().min(AP.min).max(AP.max).optional(),audioMotionWindowMs:i().min(jP.min).max(jP.max).optional(),motionFps:i().min(MP.min).max(MP.max).default(MP.default),detectionFps:i().min(NP.min).max(NP.max).default(NP.default),motionStreamId:l(),detectionStreamId:l(),audioStreamPick:Gn.optional(),motionSources:zP.default([`analyzer`]),sessionTrigger:RP.optional(),detectionSources:UP.default([`pipeline`]),pipelineEnabled:C().default(!0),steps:S(TM).readonly().optional(),audio:d({modelId:l().optional(),enabled:C()}).nullable().optional(),zones:S(_P).readonly().default([]),onboardMotionDrivesAnalyzer:C().default(!0),preRollInferenceEnabled:C().default(!0),preRollInferenceFrames:i().min(IP.min).max(IP.max).default(IP.default),occupancyRecheckEnabled:C().default(!0),occupancyRecheckSec:i().min(PP.min).max(PP.max).default(PP.default),occupancyRecheckFrames:i().min(FP.min).max(FP.max).default(FP.default),frameSource:GP.default({kind:`local-broker`}),deviceKey:l().optional(),inferenceDevices:S(qP).readonly().optional()}),YP=[{key:`motionSources`,type:`multiselect`,label:`Motion Sources`,default:[`analyzer`],options:HP.map(e=>e===`onboard`?{value:e,label:BP[e],description:`The camera's own motion, plus any sensor attached to it`}:{value:e,label:BP[e]})},{key:`detectionSources`,type:`multiselect`,label:`Detection Sources`,default:[`pipeline`],options:[{value:`pipeline`,label:`This node (ML root step on decoded frames)`},{value:`onboard`,label:`Camera onboard AI (replaces the root step when picked alone)`}]},{key:`motionFps`,type:`slider`,label:`Motion FPS (analyzer)`,min:MP.min,max:MP.max,step:MP.step,default:MP.default,showValue:!0,unit:`fps`,nullable:!0,nullLabel:`Default`,showWhen:{field:`motionSources`,includes:`analyzer`}},{key:`detectionFps`,type:`slider`,label:`Detection FPS`,min:NP.min,max:NP.max,step:NP.step,default:NP.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:kP.min,max:kP.max,step:kP.step,default:kP.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:AP.min,max:AP.max,step:AP.step,default:AP.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:jP.min,max:jP.max,step:jP.step,default:jP.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:IP.min,max:IP.max,step:IP.step,default:IP.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:PP.min,max:PP.max,step:PP.step,default:PP.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:FP.min,max:FP.max,step:FP.step,default:FP.default,showValue:!0,showWhen:{field:`occupancyRecheckEnabled`,equals:!0}}],XP=d({nodeId:l(),attachedCameras:i(),activeCameras:i(),avgInferenceFps:i(),avgInferenceTimeMs:i(),queueDepthTotal:i(),devices:S(d({deviceKey:l(),backend:l(),attachedCameras:i()})).default([]),hardware:d({hasGpu:C(),inferenceBackend:l().optional(),cpuCores:i().optional()}),motionSliceWriter:m(`orchestrator`).optional()}),ZP=d({framesDecoded:i(),framesAdmitted:i(),framesDroppedPixelFree:i(),viewsMaterialized:i(),viewsSkipped:i(),workerToRunnerBytes:i(),runnerToPoolRawBytes:i(),runnerToPoolJpegBytes:i(),onDemandFullFrameRequests:i(),onDemandCropRequests:i(),nativeHits:i(),nativeMisses:i(),tileHits:i(),tileMisses:i(),fallbackHits:i(),fallbackMisses:i(),retainedWritesAvoided:i(),residentRefs:i(),residentBytes:i(),releases:i(),evictions:i(),staleMisses:i()}),QP=d({node:ZP,cameras:S(ZP.extend({deviceId:i()}))}),$P=d({nodeId:l(),activeCameras:i(),throttledCameras:i(),avgInferenceTimeMs:i(),queueDepth:i(),frameLazy:QP.optional()}),eF=x([`not-attached`,`battery-asleep`,`not-watching`,`already-bursting`]),tF={name:`pipeline-runner`,scope:`system`,mode:`singleton`,methods:{attachCamera:D(JP,d({success:m(!0)}),{kind:`mutation`}),detachCamera:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`}),reportMotion:D(WP,d({success:m(!0)}),{kind:`mutation`}),getLocalLoad:D(v(),XP),getLocalMetrics:D(v(),$P),getCameraMetrics:D(d({deviceId:i()}),pP.nullable()),getAllCameraMetrics:D(v(),S(mP).readonly()),getLocalCameras:D(v(),S(i()).readonly()),requestOccupancyBurst:D(d({deviceId:i(),frames:i().int().positive().optional(),reason:l()}),d({started:C(),refusedBecause:eF.optional()}),{auth:`admin`,kind:`mutation`}),getNativeCrop:D(d({handle:rr,bbox:yP,maxWidth:i().int().positive().optional(),acceptJpegBytes:C().optional(),encodeJpeg:C().optional()}),bP.nullable()),runDetailSubtree:D(d({deviceId:i(),frameHandle:rr.optional(),frameJpeg:l().optional(),cropJpeg:l().optional(),parent:TP,steps:S(l()).optional(),supplied:d({stepId:l(),modelId:l(),boxes:S(d({bbox:yP,score:i()})).min(1)}).optional()}),d({details:S(EP)}).nullable(),{kind:`mutation`}),runStatelessStep:D(d({stepId:l(),modelId:l(),frameJpeg:l(),bbox:yP,className:l(),sourceDeviceId:i()}),OP,{kind:`mutation`}),parkTrackFrame:D(d({deviceId:i(),trackId:l(),kind:xP,handle:rr,bbox:yP,maxWidth:i().int().positive().optional(),timestamp:i()}),CP,{kind:`mutation`}),getParkedTrackFrame:D(d({deviceId:i(),trackId:l(),kind:xP,acceptJpegBytes:C().optional()}),wP.nullable()),releaseParkedTrackFrames:D(d({deviceId:i(),trackId:l()}),d({released:i().int().nonnegative()}),{kind:`mutation`}),startNodeBench:D(eP,d({accepted:m(!0),runId:l()}),{kind:`mutation`,auth:`admin`}),getNodeBenchStatus:D(d({runId:l()}),nP.nullable(),{auth:`admin`}),abortNodeBench:D(d({runId:l()}),d({aborted:C()}),{kind:`mutation`,auth:`admin`})}},nF=d({engine:Y.optional(),steps:S(TM).readonly(),audio:d({engine:Y.optional(),modelId:l().optional(),enabled:C(),settings:y(l(),o()).readonly().optional()}).nullable().optional()}),rF=d({modelId:l().optional(),settings:y(l(),o()).optional(),jumpDeviceKey:l().optional()}),iF=d({maxCameras:i().int().nonnegative().nullable().default(null),detectWeight:i().positive().optional(),detect:C().optional(),decode:C().optional(),audio:C().optional(),ingest:C().optional(),decodeBudgetMb:i().int().min(1024).max(65536).optional(),maxLiveDecodeWorkers:i().int().min(1).max(32).optional(),reachableHost:l().optional(),color:ds.optional(),inferenceDevices:y(l(),d({enabled:C(),weight:i().positive().optional(),maxSessions:i().int().positive().optional(),steps:y(l(),rF).optional()})).optional()}),aF=d({steps:S(TM).readonly(),audio:d({modelId:l(),enabled:C()}).nullable()}),oF=d({modelId:l().optional(),settings:y(l(),o()).readonly().optional()}),sF=y(l(),y(l(),o()).readonly()),cF=d({stepToggles:y(l(),C()).optional(),stepSettings:sF.optional(),stepOverridesByDevice:y(l(),y(l(),y(l(),oF))).optional(),pipelineByAgent:y(l(),aF).optional()}),lF=d({deviceId:i(),agentNodeId:l(),pinned:C(),reason:x([`manual`,`capacity`,`hardware-affinity`,`failover`,`rebalance`]),assignedAt:i()}),uF=d({nodeId:l(),online:C(),load:XP,score:i(),decodeHwaccel:l().nullable()}),dF=d({totalAgents:i(),onlineAgents:i(),totalCameras:i(),attachedCameras:i(),activeCameras:i(),avgInferenceTimeMs:i(),queueDepth:i()}),fF=y(l(),l()),pF=d({ownerNodeId:l(),reachableHost:l().optional(),configIssue:l().optional()}),mF=d({camStreamId:l(),codec:l(),width:i(),height:i(),fps:i(),kind:l()}),hF=d({streams:S(mF).readonly()}),gF=d({detectionNodeId:l().nullable(),decoderNodeId:l().nullable(),audioNodeId:l().nullable(),sourceNodeId:l().nullable(),pinned:d({detection:C(),decoder:C(),audio:C()}),reasons:d({detection:l().optional(),decoder:l().optional(),audio:l().optional()})}),_F=d({profile:l(),status:l(),codec:l(),width:i(),height:i(),subscribers:i(),inFps:i().nullable()}),vF=d({profiles:S(_F).readonly(),webrtcSessions:i(),rtspRestream:C()}),yF=d({nodeId:l()}),bF=d({enabled:C(),fps:i()}),xF=x([`idle`,`installing`,`verifying`,`ready`,`failed`]),SF=d({state:xF,error:l().optional()}),CF=x([`idle`,`watching`,`active`]),wF=d({nodeId:l(),engine:d({backend:l(),device:l()}),phase:CF,configuredFps:i(),actualFps:i(),queueDepth:i(),avgInferenceMs:i(),provisioning:SF}),TF=d({nodeId:l(),enabled:C()}),EF=cu,DF=d({mode:EF,active:C(),storageBytes:i()}),OF=x([`source`,`broker`,`detection`,`recording`,`switches`]),kF=x([`timeout`,`error`,`partial`]),AF=d({stage:OF,reason:kF,elapsedMs:i()}),jF=d({state:x([`idle`,`running`,`done`,`error`]),total:i().int().nonnegative(),completed:i().int().nonnegative(),currentDeviceId:i().int().nullable(),failed:S(i().int()).readonly(),mediaDropped:i().int().nonnegative(),tracks:i().int().nonnegative(),events:i().int().nonnegative(),startedAtMs:i().int().nullable(),finishedAtMs:i().int().nullable(),error:l().nullable()}),MF=d({deviceId:i(),assignment:gF,source:hF,broker:vF.nullable(),decoder:yF.nullable(),motion:bF.nullable(),detection:wF.nullable(),audio:TF.nullable(),recording:DF.nullable(),switchedOff:S(kc).readonly(),cameraSensors:Ok.optional(),degraded:S(AF).readonly(),fetchedAt:i()}),NF=[`disabled`,`unavailable`,`cannot-host-camera-root`,`accelerator-preferred`],PF=x(NF),FF=d({key:l(),backend:l(),device:l(),format:x(yr),available:C(),enabled:C(),weight:i(),maxSessions:i().nullable(),defaultModelId:l(),steps:y(l(),rF).optional(),exclusion:PF.nullable()}),IF=p(`kind`,[d({kind:m(`stored`),modelId:l()}),d({kind:m(`absent`),defaultModelId:l()}),d({kind:m(`unreadable`),reason:x(Ak),error:l().optional()})]),LF=d({nodeId:l(),reachable:C(),devices:S(FF).readonly()}),RF=d({deviceId:i().int().nonnegative(),config:xk.nullable()}),zF=x([`unknown-camera`,`out-of-range`,`no-burst-producer`,`already-looked`]),BF=d({deviceId:i().int().nonnegative(),afterMs:i().finite(),reason:l()}),VF=d({scheduled:C(),dueInMs:i().optional(),refusedBecause:zF.optional()}),HF={name:`pipeline-orchestrator`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,exposesDeviceSettings:!0,methods:{requestOccupancyLook:D(BF,VF,{kind:`mutation`,auth:`admin`}),pauseForStorageMigration:D(Iu,d({paused:m(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:D(Iu,d({resumed:m(!0)}),{kind:`mutation`,auth:`admin`}),assignPipeline:D(d({deviceId:i(),agentNodeId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),unassignPipeline:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setPipelineDevicePin:D(d({deviceId:i(),deviceKey:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getPipelineDevicePin:D(d({deviceId:i()}),d({deviceKey:l().nullable()})),rebalance:D(v(),d({migrated:i(),skipped:S(d({deviceId:i(),targetNodeId:l(),reason:l()})).default([])}),{kind:`mutation`,auth:`admin`}),getPipelineAssignments:D(v(),S(lF).readonly()),getPipelineAssignment:D(d({deviceId:i()}),lF.nullable()),getAgentLoad:D(v(),S(uF).readonly()),getClusterModelChoice:D(d({stepId:l()}),IF),getGlobalMetrics:D(v(),dF),getCameraMetrics:D(d({deviceId:i()}),pP.nullable()),getCapabilityBindings:D(d({nodeId:l()}),fF),setCapabilityBinding:D(d({nodeId:l(),capName:l(),addonId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getIngestOwner:D(v(),pF),assignAudio:D(d({deviceId:i(),nodeId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),unassignAudio:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getAudioAssignment:D(d({deviceId:i()}),d({nodeId:l(),pinned:C(),assignedAt:i()}).nullable()),getAudioNodeLoad:D(v(),S(d({nodeId:l(),deviceCount:i()}))),getAudioAssignments:D(v(),S(d({deviceId:i(),nodeId:l(),pinned:C(),assignedAt:i()}))),getAgentSettings:D(d({agentNodeId:l()}),iF.nullable()),listAgentSettings:D(v(),S(d({nodeId:l(),settings:iF})).readonly()),removeAgentSettings:D(d({agentNodeId:l()}),d({success:C(),removed:C()}),{kind:`mutation`,auth:`admin`}),setAgentMaxCameras:D(d({agentNodeId:l(),maxCameras:i().int().nonnegative().nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentCapabilities:D(d({agentNodeId:l(),detect:C().nullable().optional(),audio:C().nullable().optional(),ingest:C().nullable().optional()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentDecodeLimits:D(d({agentNodeId:l(),decodeBudgetMb:i().int().min(1024).max(65536).nullable().optional(),maxLiveDecodeWorkers:i().int().min(1).max(32).nullable().optional()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentReachableHost:D(d({agentNodeId:l(),reachableHost:l().nullable().optional(),color:ds.nullable().optional()}).refine(e=>e.reachableHost!==void 0||e.color!==void 0,{message:`reachableHost or color required`}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentInferenceDevices:D(d({agentNodeId:l(),inferenceDevices:y(l(),d({enabled:C(),weight:i().positive().optional(),maxSessions:i().int().positive().optional(),steps:y(l(),rF).optional()}))}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getNodeInferenceDevices:D(d({nodeId:l()}),LF),resetNodePipelineDefaults:D(d({agentNodeId:l()}),d({success:m(!0),effectiveModelId:l().nullable(),clearedCameraOverrides:i()}),{kind:`mutation`,auth:`admin`}),planAutoTune:D(oN,sN,{auth:`admin`}),applyAutoTune:D(cN,uN,{kind:`mutation`,auth:`admin`}),setLoadBalancingShares:D(hN,d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getPlacementStats:D(gN,bN,{auth:`admin`}),suggestShares:D(CN,EN,{auth:`admin`}),getEffectiveShares:D(v(),LN,{auth:`admin`}),setShareSource:D(NN,d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getNodeBenchmarkPreflight:D(BN,GN,{auth:`admin`}),startNodeBenchmark:D(BN,p(`kind`,[d({kind:m(`started`),runId:l()}),d({kind:m(`refused`),preflight:GN})]),{kind:`mutation`,auth:`admin`}),getNodeBenchmarkStatus:D(v(),oP,{auth:`admin`}),abortNodeBenchmark:D(d({runId:l()}),d({aborted:C()}),{kind:`mutation`,auth:`admin`}),getNodeBenchmarkCandidates:D(d({nodeId:l()}),dP,{auth:`admin`}),listNodeBenchmarkResults:D(cP,S(lP).readonly(),{auth:`admin`}),deleteNodeBenchmarkResult:D(d({id:l()}),d({deleted:C()}),{kind:`mutation`,auth:`admin`}),getCameraSettings:D(d({deviceId:i()}),cF.nullable()),setCameraStepToggle:D(d({deviceId:i(),addonId:l(),enabled:C().nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getCameraStepOverrides:D(d({deviceId:i()}),y(l(),y(l(),y(l(),oF))).nullable()),setCameraStepOverride:D(d({deviceId:i(),agentNodeId:l(),deviceKey:l(),addonId:l(),patch:oF.nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setCameraStepSettings:D(d({deviceId:i(),addonId:l(),settings:y(l(),o()).nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setCameraPipelineForAgent:D(d({deviceId:i(),agentNodeId:l(),pipeline:aF.nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),resolvePipeline:D(d({deviceId:i(),agentNodeId:l().optional()}),nF),getCameraSwitches:D(d({deviceId:i()}),Fc),setCameraSwitch:D(d({deviceId:i(),switchId:kc,enabled:C()}),Fc,{kind:`mutation`,auth:`admin`}),getCameraStatus:D(d({deviceId:i()}),MF),getCameraStatuses:D(d({deviceIds:S(i()).optional()}),S(MF).readonly()),setCameraSensors:D(RF,d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),reconcileFromDisk:D(v(),jF,{kind:`mutation`,auth:`admin`}),getReconcileFromDiskStatus:D(v(),jF,{auth:`admin`})}},UF={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 WF(e){return UF[e]??`generic`}var GF={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 KF(e,t){let n=QT[t];if(n===void 0)throw Error(`EVENT_KIND_BY_CAP: cap '${e}' maps to unknown taxonomy kind '${t}'`);return{...n,icon:WF(n.iconId)}}var qF=Object.freeze(Object.fromEntries(Object.entries(GF).map(([e,t])=>[e,KF(e,t)]))),JF=Object.keys(GF);function YF(e,t){let n=QT[e];return n===void 0?null:{kind:n.kind,labelKey:n.labelKey,label:n.label,color:n.color,iconId:n.iconId,icon:WF(n.iconId),category:n.category,parentKind:n.parentKind,level:n.level,source:{capName:t.capName,deviceId:t.deviceId}}}var XF=x([`workspace`,`baked`,`data-root`]),ZF=x([`idle`,`checking`,`staging`,`pending-restart`,`awaiting-confirmation`]),QF=x([`in-sync`,`behind-patch`,`behind-series`,`ahead`,`unknown`]),$F=d({state:QF,seedVersion:l().nullable(),contractVersion:l().nullable(),contractSource:x([`registry`,`running`]).nullable(),message:l()}),eI=x([`docker`,`electron`,`native`,`contradictory`,`unknown`]),tI=d({fact:x([`dockerenv-file`,`proc-1-cgroup`,`platform`,`electron-app-version-env`]),mode:x([`observed`,`declared`]),holds:C(),detail:l()}),nI=d({kind:eI,evidence:S(tI),currentVersion:l().nullable()}),rI=d({fromVersion:l(),toVersion:l().nullable(),atMs:i(),reason:l()}),iI=d({packageName:l(),runningVersion:l().nullable(),nodeRuntimeVersion:l().nullable(),activeVersion:l().nullable(),installedVersion:l().nullable().optional(),restartRequired:C().optional(),previousVersion:l().nullable(),seedVersion:l().nullable(),latestVersion:l().nullable(),updateAvailable:C(),bootMode:XF,updateState:ZF,pendingVersion:l().nullable(),rolledBack:rI.nullable(),stateFileCorrupt:C(),lastCheckedAtMs:i().nullable(),imageContract:$F.optional(),wrapper:nI.optional()}),aI=d({packageName:l(),runningVersion:l().nullable(),latestVersion:l().nullable(),updateAvailable:C(),checkedAtMs:i(),error:l().nullable(),pendingVersion:l().nullable().optional(),restartRequired:C().optional()}),oI=x([`staged`,`restart-scheduled`,`already-current`,`refused`,`failed`]),sI=d({accepted:C(),targetVersion:l().nullable(),restarting:C(),message:l(),outcome:oI.optional(),reason:l().nullable().optional(),error:l().nullable().optional()}),cI={name:`server-management`,scope:`system`,mode:`singleton`,methods:{getServerPackageStatus:D(v(),iI,{auth:`admin`}),checkServerUpdate:D(v(),aI,{kind:`mutation`,auth:`admin`}),applyServerUpdate:D(d({version:l().optional()}),sI,{kind:`mutation`,auth:`admin`,timeoutMs:16*6e4}),rollbackServerUpdate:D(v(),sI,{kind:`mutation`,auth:`admin`}),restartServer:D(v(),sI,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},lI=r(),uI=d({to:f([lI,S(lI).min(1)]),cc:S(lI).optional(),bcc:S(lI).optional(),from:l().optional(),replyTo:l().optional(),subject:l(),text:l(),html:l().optional()}),dI=d({messageId:l(),accepted:S(lI).default([]),rejected:S(lI).default([])}),fI=d({ready:C(),host:l(),error:l().optional(),lastVerifiedAt:i().optional()}),pI={name:`smtp-provider`,scope:`system`,mode:`collection`,internal:!0,providerKind:`email`,methods:{sendEmail:D(uI,dI,{kind:`mutation`,auth:`admin`,access:`create`}),verify:D(v(),fI,{kind:`mutation`,auth:`admin`,access:`view`}),getStatus:D(v(),fI,{auth:`admin`})}},mI=d({base64:l(),contentType:l()}),hI=d({lastCapturedAt:i().nullable(),cacheAgeMs:i().nullable(),lastBytes:i().nullable(),lastStreamId:l().nullable()}),gI={name:`snapshot`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:D(d({deviceId:i(),streamId:l().optional(),force:C().optional()}),mI.nullable()),invalidateCache:D(d({deviceId:i()}),v(),{kind:`mutation`,auth:`admin`}),getSnapshotOverview:Mr(d({deviceIds:S(i()).min(1).max(200)}),S(d({deviceId:i(),lastCapturedAt:i().nullable(),cacheAgeMs:i().nullable(),etag:l().nullable()}))),getDebugState:Mr(d({deviceId:i()}),d({battery:d({sleeping:C(),lastUpdated:i(),lastContactAt:i().optional()}).nullable(),state:d({isBattery:C(),reason:x([`disabled`,`offline`,`sleeping`,`unreachable`,`waking`]).nullable()}),frame:d({capturedAt:i().nullable(),ageMs:i().nullable()}),waking:C()})),getSnapshotLinks:Mr(d({targets:S(d({deviceId:i(),width:i().int().positive().optional()})).min(1).max(200)}),S(d({deviceId:i(),url:l().nullable(),capturedAt:i().nullable(),ageMs:i().nullable(),expiresAt:i().nullable(),width:i().nullable(),neverCaptured:C(),sleeping:C(),stateReason:x([`disabled`,`offline`,`sleeping`,`unreachable`,`waking`]).nullable(),battery:C()})))},status:{schema:hI,kind:`poll`}},_I=d({userId:l(),username:l(),isAdmin:C(),provider:l(),email:l().optional(),displayName:l().optional(),hubUrl:l().optional(),scopes:S(J).optional(),redirectUri:l().optional(),integrationId:l().optional(),jti:l().optional(),codeChallenge:l().optional(),sessionId:l().optional(),refreshTtl:f([i().int().positive(),m(`never`)]).optional(),linkIntent:l().optional(),issuer:l().optional(),browserBinding:l().optional()}),vI={name:`sso-bridge`,scope:`system`,mode:`singleton`,internal:!0,methods:{signBridgeToken:D(d({claims:_I,ttlSec:f([i().int().positive(),m(`never`)]).optional()}),d({token:l()}),{auth:`admin`}),verifyBridgeToken:D(d({token:l()}),_I.nullable(),{auth:`admin`})}},yI=p(`shouldSaveDiskSpace`,[d({providerId:l().min(1),displayName:l().min(1),configSchema:o(),nodeLocal:C(),shouldSaveDiskSpace:m(!0),minFreePercent:i().min(0).max(100)}),d({providerId:l().min(1),displayName:l().min(1),configSchema:o(),nodeLocal:C(),shouldSaveDiskSpace:m(!1),minFreePercent:m(null)})]),bI={name:`storage`,scope:`system`,mode:`singleton`,methods:{resolve:D(d({location:B,relativePath:l()}),l(),{auth:`admin`}),write:D(d({location:B,relativePath:l(),data:b(Uint8Array)}),v(),{kind:`mutation`,auth:`admin`}),read:D(d({location:B,relativePath:l()}),b(Uint8Array),{auth:`admin`}),exists:D(d({location:B,relativePath:l()}),C(),{auth:`admin`}),list:D(d({location:B,prefix:l().optional()}),S(l()).readonly(),{auth:`admin`}),delete:D(d({location:B,relativePath:l()}),v(),{kind:`mutation`,auth:`admin`}),getAvailableSpace:D(d({location:B}),i().nullable()),beginUpload:D(d({location:B,relativePath:l(),sizeBytes:i().optional()}),d({uploadId:l()}),{kind:`mutation`,auth:`admin`}),writeChunk:D(d({uploadId:l(),offset:i(),data:b(Uint8Array)}),v(),{kind:`mutation`,auth:`admin`}),finalizeUpload:D(d({uploadId:l()}),v(),{kind:`mutation`,auth:`admin`}),abortUpload:D(d({uploadId:l()}),v(),{kind:`mutation`,auth:`admin`}),beginDownload:D(d({location:B,relativePath:l()}),d({downloadId:l(),sizeBytes:i()}),{kind:`mutation`,auth:`admin`}),readChunk:D(d({downloadId:l(),offset:i(),length:i()}),b(Uint8Array),{auth:`admin`}),endDownload:D(d({downloadId:l()}),v(),{kind:`mutation`,auth:`admin`}),listLocations:D(d({type:Ld.optional()}),S(z).readonly()),listLocationDeclarations:D(v(),S(Gd).readonly()),upsertLocation:D(z.omit({createdAt:!0,updatedAt:!0}),z,{kind:`mutation`,auth:`admin`}),deleteLocation:D(d({id:l(),force:C().optional()}),v(),{kind:`mutation`,auth:`admin`}),listDrainProgress:D(v(),S(Hd).readonly()),testLocation:D(d({id:l()}),d({ok:C(),error:l().optional()}),{auth:`admin`}),listProviders:D(v(),S(yI).readonly()),testConfig:D(d({providerId:l(),locationId:l().optional(),config:y(l(),o())}),d({ok:C(),error:l().optional()}),{auth:`admin`})}},xI=d({bytes:i().int().nonnegative()}),SI=d({reclaimedBytes:i().int().nonnegative(),exhausted:C()}),CI={name:`storage-evictable`,scope:`system`,mode:`collection`,internal:!0,methods:{getEvictableUsage:D(d({locationId:l()}),xI,{auth:`admin`}),evict:D(d({locationId:l(),targetBytes:i().int().positive()}),SI,{kind:`mutation`,auth:`admin`})}},wI={name:`storage-migration`,scope:`system`,mode:`singleton`,methods:{plan:D(qu,td,{auth:`admin`}),start:D(qu,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),status:D(d({jobId:l().optional()}),Qu.nullable(),{auth:`admin`}),cancel:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),movers:D(d({}),S(rd).readonly(),{auth:`admin`}),residue:D(d({}),S(id).readonly(),{auth:`admin`}),drain:D(ad,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),cleanupStart:D(_d,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),cleanupStatus:D(yd,vd.nullable(),{auth:`admin`}),cleanupCancel:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),history:D(d({}),S(Qu).readonly(),{auth:`admin`})}},TI=d({locationId:l(),ownedBytes:i().int().nonnegative(),measuredAtMs:i().int().nonnegative()}),EI={name:`storage-occupancy`,scope:`system`,mode:`collection`,internal:!0,methods:{getOccupancy:D(d({locationIds:S(l()).readonly()}),S(TI).readonly(),{auth:`admin`})}},DI=p(`shouldSaveDiskSpace`,[d({providerId:l().min(1),displayName:l().min(1),configSchema:o(),nodeLocal:C(),shouldSaveDiskSpace:m(!0),minFreePercent:i().min(0).max(100)}),d({providerId:l().min(1),displayName:l().min(1),configSchema:o(),nodeLocal:C(),shouldSaveDiskSpace:m(!1),minFreePercent:m(null)})]),OI=d({ok:C(),error:l().optional()}),kI=d({location:z,relativePath:l(),sizeBytes:i().optional()}),AI=d({uploadId:l()}),jI=d({uploadId:l(),offset:i(),data:b(Uint8Array)}),MI=d({uploadId:l()}),NI=d({uploadId:l()}),PI=d({location:z,relativePath:l()}),FI=d({downloadId:l(),sizeBytes:i()}),II=d({downloadId:l(),offset:i(),length:i()}),LI=d({downloadId:l()}),RI={name:`storage-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getProviderInfo:D(v(),DI,{auth:`admin`}),testLocation:D(d({config:y(l(),o())}),OI,{auth:`admin`}),resolve:D(d({location:z,relativePath:l()}),l(),{auth:`admin`}),write:D(d({location:z,relativePath:l(),data:b(Uint8Array)}),v(),{kind:`mutation`,auth:`admin`}),read:D(d({location:z,relativePath:l()}),b(Uint8Array),{auth:`admin`}),exists:D(d({location:z,relativePath:l()}),C(),{auth:`admin`}),list:D(d({location:z,prefix:l().optional()}),S(l()).readonly(),{auth:`admin`}),delete:D(d({location:z,relativePath:l()}),v(),{kind:`mutation`,auth:`admin`}),getAvailableSpace:D(d({location:z}),i().nullable(),{auth:`admin`}),beginUpload:D(kI,AI,{kind:`mutation`,auth:`admin`}),writeChunk:D(jI,v(),{kind:`mutation`,auth:`admin`}),finalizeUpload:D(MI,v(),{kind:`mutation`,auth:`admin`}),abortUpload:D(NI,v(),{kind:`mutation`,auth:`admin`}),beginDownload:D(PI,FI,{kind:`mutation`,auth:`admin`}),readChunk:D(II,b(Uint8Array),{auth:`admin`}),endDownload:D(LI,v(),{kind:`mutation`,auth:`admin`})}},zI=d({code:l().min(1),label:l().min(1),recommended:C()}),BI=d({signals:S(zI),lastFetchedAt:i()}),VI={name:`stream-signals`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:Object.values(k),runtimeState:BI,durability:`session`,methods:{listSignals:D(v(),S(zI).readonly())}},HI=o().nullable(),UI=y(l(),o()),WI=d({sessionId:l(),profileId:l(),label:l(),cols:i().int().positive(),rows:i().int().positive(),startedAt:i()}),GI=d({profileId:l(),label:l(),description:l().optional(),executable:l().optional(),args:S(l()).readonly().optional(),cwd:l().optional(),environment:S(l()).readonly().optional(),settingsSchema:HI.optional()}),KI=d({instanceId:l(),cameraStableId:l(),nodeId:l(),profileId:l(),profileLabel:l(),name:l(),enabled:C(),executable:l(),args:S(l()).readonly(),cwd:l(),environment:S(l()).readonly(),profileSettings:UI}),qI=d({stableId:l(),nodeId:l(),profileId:l(),profileLabel:l(),name:l(),adoptable:C()}),JI=p(`kind`,[d({seq:i().int().positive(),kind:m(`data`),data:l()}),d({seq:i().int().positive(),kind:m(`exit`),exitCode:i().int(),signal:i().int().optional()})]),YI=d({cursor:i().int().nonnegative(),reset:C(),snapshot:l().optional(),events:S(JI).readonly()}),XI={name:`terminal-session`,scope:`system`,mode:`singleton`,methods:{listProfiles:D(v(),S(GI).readonly(),{auth:`admin`}),listInstances:D(v(),S(KI).readonly(),{auth:`admin`}),createInstance:D(d({targetNodeId:l().min(1),profileId:l().min(1),name:l().trim().min(1).max(160).optional(),executable:l().max(1024).optional(),args:S(l().max(2048)).max(64).optional(),cwd:l().max(1024).optional(),environment:S(l().max(4096)).max(64).optional(),profileSettings:UI.optional()}),KI,{kind:`mutation`,auth:`admin`}),updateInstance:D(d({instanceId:l().min(1),name:l().trim().min(1).max(160).optional(),executable:l().max(1024).optional(),args:S(l().max(2048)).max(64).optional(),cwd:l().max(1024).optional(),environment:S(l().max(4096)).max(64).optional(),profileSettings:UI.optional()}),KI,{kind:`mutation`,auth:`admin`}),deleteInstance:D(d({instanceId:l().min(1)}),v(),{kind:`mutation`,auth:`admin`}),setInstanceEnabled:D(d({instanceId:l().min(1),enabled:C()}),KI,{kind:`mutation`,auth:`admin`}),listLegacyCameras:D(v(),S(qI).readonly(),{auth:`admin`}),adoptLegacyMonitor:D(d({stableId:l().min(1),name:l().trim().min(1).max(160).optional()}),KI,{kind:`mutation`,auth:`admin`}),listSessions:D(v(),S(WI).readonly(),{auth:`admin`}),openSession:D(d({profileId:l(),cols:i().int().positive(),rows:i().int().positive(),executable:l().max(1024).optional(),args:S(l().max(2048)).max(64).optional(),cwd:l().max(1024).optional(),environment:S(l().max(4096)).max(64).optional()}),WI,{kind:`mutation`,auth:`admin`}),resize:D(d({sessionId:l(),cols:i().int().positive(),rows:i().int().positive()}),v(),{kind:`mutation`,auth:`admin`}),pullOutput:D(d({sessionId:l(),afterSeq:i().int().nonnegative(),waitMs:i().int().min(0).max(2e3).default(0),waitForOutput:C().optional()}),YI,{kind:`mutation`,auth:`admin`,timeoutMs:15e3}),writeInput:D(d({sessionId:l(),data:l().max(64*1024)}),v(),{kind:`mutation`,auth:`admin`}),close:D(d({sessionId:l()}),v(),{kind:`mutation`,auth:`admin`})}},ZI=d({urls:f([l(),S(l())]),username:l().optional(),credential:l().optional()}),QI={name:`turn-provider`,scope:`system`,mode:`collection`,methods:{getTurnServers:D(v(),S(ZI).readonly())}},$I=d({credentialId:l(),label:l(),createdAt:i(),lastUsedAt:i().nullable(),transports:S(l()).default([])}),eL={name:`user-passkeys`,scope:`system`,mode:`collection`,internal:!0,methods:{beginRegistration:D(d({userId:l(),username:l()}),d({optionsJSON:y(l(),o())}),{kind:`mutation`,auth:`admin`,access:`create`}),finishRegistration:D(d({userId:l(),response:y(l(),o()),label:l()}),d({success:m(!0),credentialId:l()}),{kind:`mutation`,auth:`admin`,access:`create`}),beginAuthentication:D(d({userId:l().optional()}),d({optionsJSON:y(l(),o())}),{kind:`mutation`,access:`view`,auth:`admin`}),finishAuthentication:D(d({userId:l(),response:y(l(),o())}),d({verified:C()}),{kind:`mutation`,access:`view`,auth:`admin`}),beginDiscoverableAuthentication:D(d({}),d({optionsJSON:y(l(),o())}),{kind:`mutation`,access:`view`,auth:`admin`}),finishDiscoverableAuthentication:D(d({response:y(l(),o())}),d({verified:C(),userId:l().nullable()}),{kind:`mutation`,access:`view`,auth:`admin`}),listPasskeys:D(d({userId:l()}),S($I),{auth:`admin`}),removePasskey:D(d({userId:l(),credentialId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getSecondFactorPreference:D(d({userId:l()}),d({enabled:C()}),{auth:`admin`}),setSecondFactorPreference:D(d({userId:l(),enabled:C()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`})}},tL=x([`cosine`,`dot`,`euclidean`]),nL=y(l(),f([l(),i(),C()])),rL=d({equals:y(l(),f([l(),i(),C()])).optional(),between:y(l(),u([i(),i()])).optional()}),iL=d({id:l(),vector:l(),metadata:nL}),aL=d({id:l(),score:i(),metadata:nL}),oL=d({index:l(),dim:i().int().positive(),metric:tL.default(`cosine`)}),sL=d({index:l(),items:S(iL)}),cL=d({upserted:i(),rejected:i()}),lL=d({index:l(),vector:l(),topK:i().int().positive(),minScore:i().optional(),filter:rL.optional()}),uL=d({matches:S(aL),scanned:i(),truncated:C(),effectiveTopK:i().int().positive()}),dL=d({index:l(),ids:S(l())}),fL=d({index:l(),filter:rL}),pL=d({deleted:i()}),mL=d({index:l(),ids:S(l())}),hL=d({items:S(d({id:l(),metadata:nL}))}),gL=d({index:l(),ids:S(l())}),_L=d({items:S(d({id:l(),vector:l(),metadata:nL}))}),vL=d({index:l(),cursor:i().int().nonnegative().default(0),limit:i().int().positive()}),yL=d({items:S(d({id:l(),metadata:nL})),nextCursor:i().int().nonnegative().nullable()}),bL=`vector-index-dim-conflict`;function xL(e,t,n){return Error(`[${bL}] vector-store: index "${e}" is declared with dim ${String(t)}; refusing to redeclare as ${String(n)}`)}function SL(e){return(e instanceof Error?e.message:String(e)).includes(`[${bL}]`)}var CL=d({index:l()}),wL=d({backend:l(),count:i(),dim:i(),metric:tL,bytes:i().optional(),exact:C()}),TL={name:`vector-store`,scope:`system`,mode:`singleton`,internal:!0,methods:{declareIndex:D(oL,v(),{kind:`mutation`,auth:`admin`}),upsert:D(sL,cL,{kind:`mutation`,auth:`admin`}),query:D(lL,uL,{auth:`admin`}),getByIds:D(mL,hL,{auth:`admin`}),fetchByIds:D(gL,_L,{auth:`admin`}),scan:D(vL,yL,{auth:`admin`}),deleteByIds:D(dL,pL,{kind:`mutation`,auth:`admin`}),deleteByFilter:D(fL,pL,{kind:`mutation`,auth:`admin`}),stats:D(CL,wL,{auth:`admin`})}},EL=24,DL=3,OL=x([`queue-full`,`camera-backoff`,`sleeping`,`camera-refused`,`no-keyframe`,`decode-failed`,`no-catalog-row`,`unsupported`,`unknown-device`,`uid-missing`]),kL=x([`deferred`,`final`]),AL=`x-camstack-reason`,jL=500;function ML(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 NL=`x-camstack-reason-code`,PL=`x-camstack-disposition`,FL=`x-camstack-clip-transport`,IL=d({id:l(),source:l(),kind:x([`motion`,`object`,`audio`,`native`]),timeRange:d({startMs:i(),endMs:i()}),labels:S(l()).max(3).optional(),thumbnail:l().optional(),stillAtMs:i().optional(),eventIds:S(l()).optional(),eventCount:i().int().nonnegative().optional(),holes:S(d({startMs:i(),endMs:i()})).optional(),thumbnailMint:l().optional(),thumbnailUnavailable:d({reason:x([`sleeping`,`camera-refused`,`no-keyframe`,`unsupported`])}).optional(),catalogAsOf:i().optional(),nativeTypes:S(l()).optional(),behaviours:S(l()).optional(),streams:d({sub:d({id:l(),bytes:i().optional()}).optional(),main:d({id:l(),bytes:i().optional()}).optional()}).optional(),supportSub:C().optional(),playable:C().optional(),unplayableReason:l().optional(),inProgress:C().optional()}),LL=d({playbackUrl:l(),format:x([`hls`,`mp4`]).optional(),served:E.optional(),playbackEndpoints:S(l()).optional(),token:l().optional()}),RL=x([`authorised`]),zL=50*1024*1024,BL=500*1024*1024,VL=d({base64:l(),contentType:l(),name:l(),bytes:i().int().nonnegative(),served:E,durationMs:i().positive().optional()}),HL=d({ticket:En,contentType:l(),name:l(),served:E,durationMs:i().positive().optional()}),UL=x([`opus`,`pcmu`,`none`]),WL=x([`not-requested`,`unsupported-ask`]),GL=d({url:l().min(1),expiresAtMs:i(),transport:m(`forward-only`),served:E,servedAudio:UL,audioReason:WL.optional()}),KL=[.25,.5,1,1.5,2,4,8],qL=[.25,.5,1,1.5,2,4],JL=[.25,.5,1],YL=d({transport:x([`stream`,`file`]),seek:x([`forward`,`free`]),stepBack:C(),scrub:C(),rates:S(i().positive()).min(1).readonly()}),XL=d({state:x([`ok`,`sleeping`,`unreachable`,`no-storage`,`index-empty`]),reason:l().optional(),catalogAsOf:i().optional()}),ZL=d({source:l(),label:l(),addonId:l().optional(),availability:XL}),QL={name:`videoclips`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/clips-browser`,tab:`recording`,topTab:!0,label:`Clips`,order:100}},methods:{listClips:D(d({deviceId:i(),since:i(),until:i(),limit:i().int().positive().optional(),provider:l().min(1)}),S(IL).readonly(),{kind:`query`,auth:`protected`}),listSources:D(d({deviceId:i()}),S(ZL).readonly(),{kind:`query`,auth:`protected`}),getClipPlayback:D(d({deviceId:i(),clipId:l(),profile:E.optional()}),LL,{kind:`query`,auth:`protected`}),readClipBytes:Nr(d({deviceId:i(),clipId:l().min(1),provider:l().min(1),profile:E.optional(),maxBytes:i().int().positive().optional(),wake:RL.optional()}),VL,{kind:`query`,auth:`protected`}),offerClipBytes:Nr(d({deviceId:i(),clipId:l().min(1),provider:l().min(1),profile:E.optional(),maxBytes:i().int().positive().optional(),wake:RL.optional()}),HL,{kind:`query`,auth:`protected`}),dialClipStream:Nr(d({deviceId:i(),clipId:l().min(1),provider:l().min(1),profile:E.optional(),audio:UL.optional()}),GL,{kind:`query`,auth:`protected`}),getPlaybackOptions:Nr(d({deviceId:i(),provider:l().min(1)}),YL,{kind:`query`,auth:`protected`})}},$L={stream:{transport:`stream`,seek:`forward`,stepBack:!1,scrub:!1,rates:qL},realtimeStream:{transport:`stream`,seek:`forward`,stepBack:!1,scrub:!1,rates:JL},file:{transport:`file`,seek:`free`,stepBack:!0,scrub:!0,rates:KL}},eR=d({viewportWidth:i().int().positive().optional(),viewportHeight:i().int().positive().optional(),devicePixelRatio:i().positive().optional(),downlinkMbps:i().nonnegative().optional(),prefersTier:l().optional()}).partial(),tR=p(`kind`,[d({kind:m(`adaptive`)}),d({kind:m(`profile`),profile:E}),d({kind:m(`cam-stream`),camStreamId:l().min(1)})]),nR=d({id:l(),label:l(),target:tR,codec:l().nullable(),resolution:d({width:i(),height:i()}).nullable(),status:x([`idle`,`connecting`,`streaming`,`error`,`stopped`]).nullable(),inputFps:i().nullable(),bitrateKbps:i().nullable()}),rR=d({cause:x([`loss`,`stall`,`healthy`]),tier:E.nullable(),forcedTranscodeDown:C(),lossRatio:i().nullable(),clientKbps:i().nullable(),stalledForMs:i().nullable(),serverSending:C().nullable(),at:i(),causeDetail:l().optional()}),iR=[`stall-building`,`delivery`,`no-evidence`,`warming`,`cooldown`,`capacity`,`try-unclean`,`try-backoff`,`trial`,`suspended`],aR=[`delivery`,`loss`,`rtt`,`shared-telemetry`],oR=d({code:l(),nextTier:E,deliveryRatio:i().nullable(),deliveryWindowMs:i().nullable(),climbDeliveryRatio:i(),capacityKbps:i().nullable(),probeKbps:i().nullable(),nextTierKbps:i().nullable(),capacityMargin:i(),neededKbps:i().nullable(),tryBlockedBy:l().nullable(),tryDeliveryRatio:i().optional(),tryMaxLossRatio:i().optional(),retryInMs:i().nullable(),lastRevert:d({tier:E,deliveryRatio:i().nullable(),stalled:C(),at:i()}).nullable(),trialForMs:i().nullable(),trialMs:i().nullable(),healthyForMs:i().nullable(),requiredHealthyMs:i().nullable(),since:i(),summary:l()}),sR=d({tier:E,failures:i().int().nonnegative()}),cR=d({sessionId:l(),alive:C(),observedAt:i(),brokerId:l().nullable(),camStreamId:l().nullable(),sourceKind:x([`native`,`derived`,`unknown`]),adaptive:C(),servedTier:E.nullable(),ingestNodeId:l().nullable(),ingestIsRemote:C().nullable(),sourceCodec:l().nullable(),negotiatedCodec:l().nullable(),egressLeg:x([`copy`,`transcode`,`unknown`]),brokerStatus:l().nullable(),brokerCodec:l().nullable(),brokerBitrateKbps:i().nullable(),brokerInputFps:i().nullable(),brokerUptimeMs:i().nullable(),rtpPacketsSent:i().nullable(),trackMode:x([`live`,`recorded`]).nullable(),lastDecision:rR.nullable(),tierFailures:S(sR),upgradeCount:i().nullable(),climbHold:oR.nullable().optional()}),lR={name:`webrtc-session`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,preferredProvider:`stream-broker`,deviceTypes:[k.Camera],methods:{listStreams:D(d({deviceId:i().int().nonnegative()}),S(nR)),createSession:D(d({deviceId:i().int().nonnegative(),target:tR,hints:eR.optional(),relayOnly:C().optional(),consumerAttribution:Mg.optional()}),d({sessionId:l(),sdpOffer:l()}),{kind:`mutation`}),handleOffer:D(d({deviceId:i().int().nonnegative(),target:tR.optional(),sdpOffer:l(),sessionId:l().optional(),relayOnly:C().optional(),nonTrickle:C().optional(),disableTurn:C().optional(),disableIpv6:C().optional(),consumerAttribution:Mg.optional(),hints:eR.optional(),talkback:C().optional()}),d({sessionId:l(),sdpAnswer:l()}),{kind:`mutation`}),handleAnswer:D(d({deviceId:i().int().nonnegative(),sessionId:l(),sdpAnswer:l()}),v(),{kind:`mutation`}),addIceCandidate:D(d({deviceId:i().int().nonnegative(),sessionId:l(),candidate:l(),sdpMid:l().nullable().optional(),sdpMLineIndex:i().int().nullable().optional()}),v(),{kind:`mutation`}),getIceCandidates:D(d({deviceId:i().int().nonnegative(),sessionId:l()}),d({candidates:S(d({candidate:l(),sdpMid:l().nullable(),sdpMLineIndex:i().int().nullable()})),done:C()}),{kind:`query`}),closeSession:D(d({deviceId:i().int().nonnegative(),sessionId:l()}),v(),{kind:`mutation`}),hasAdaptiveBitrate:D(d({deviceId:i().int().nonnegative(),profile:E}),C()),getSessionState:D(d({deviceId:i().int().nonnegative(),sessionId:l()}),d({pendingRenegotiation:d({target:tR,epoch:i()}).nullable(),alive:C()})),applyDownlinkProbe:D(d({deviceId:i().int().nonnegative(),sessionId:l(),downlinkMbps:i().nonnegative()}),d({outcome:x([`switching`,`held`]),tier:E.nullable(),reason:l()}),{kind:`mutation`}),getSessionDebug:D(d({deviceId:i().int().nonnegative(),sessionId:l()}),cR,{kind:`query`})},mount:{kind:`server-provided`}},uR=d({childDeviceIds:S(i()).readonly(),hiddenChildIds:S(i()).readonly()}),dR={name:`accessories`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera,k.Hub,k.Switch,k.Light,k.Sensor,k.Thermostat,k.Cover,k.Lock,k.Fan,k.MediaPlayer,k.AlarmPanel,k.Generic],methods:{setChildHidden:D(d({deviceId:i().int().nonnegative(),childDeviceId:i().int().nonnegative(),hidden:C()}),v(),{kind:`mutation`,auth:`admin`})},events:{onAccessoriesChanged:{data:d({deviceId:i(),childDeviceIds:S(i()).readonly(),hiddenChildIds:S(i()).readonly()})},onChildVisibilityChanged:{data:d({deviceId:i(),childDeviceId:i(),hidden:C()})}},status:{schema:uR,kind:`command-driven`}},fR=x([`install`,`update`,`uninstall`,`restart`]),pR=x([`queued`,`fetching`,`staged`,`validating`,`applying`,`restarting`,`applied`,`done`,`failed`,`skipped`]),mR=x([`framework`,`addon`]),hR=d({tsMs:i(),nodeId:l(),packageName:l(),phase:pR,message:l()}),gR=d({taskId:l(),nodeId:l(),packageName:l(),fromVersion:l().nullable(),toVersion:l(),target:mR,phase:pR,stagedPath:l().nullable(),attempts:i(),steps:S(hR),error:l().nullable(),startedAtMs:i().nullable(),finishedAtMs:i().nullable()}),_R=x([`running`,`completed`,`failed`,`partially-failed`,`cancelled`]),vR=x([`single`,`bulk`,`cluster`]),yR=d({jobId:l(),kind:fR,createdAtMs:i(),createdBy:l(),scope:vR,tasks:S(gR),state:_R,schemaVersion:m(1)}),bR=x([`debug`,`info`,`warn`,`error`]),xR=x([`off`,`latest`,`beta`]),SR=x([`off`,`latest`,`beta`,`inherit`]),CR=d({id:l(),name:l().optional(),version:l().optional(),description:l().optional(),icon:l().optional(),color:l().optional(),capabilities:S(o()).readonly().optional(),packageName:l(),packageVersion:l(),packageDisplayName:l().optional(),bundle:d({displayName:l(),description:l().optional(),icon:l().optional()}).optional(),protected:C().optional(),removable:C().optional()}),wR=d({pid:i().optional(),mode:l(),state:l()}),TR=d({phase:x([`pending`,`healthy`,`failed`]),retryCount:i(),firstFailureAt:i().nullable(),lastAttemptAt:i().nullable(),lastError:d({message:l(),stack:l().optional()}).nullable(),nextRetryAt:i().nullable(),alertEmitted:C(),retrying:C(),inGracePeriod:C()}),ER=d({manifest:CR,declaration:o().optional(),source:l(),installSource:l().optional(),process:wR.optional(),hasBackup:C().optional(),health:TR.nullable().optional()}),DR=d({name:l(),version:l(),dir:l(),installSource:l().optional()}),OR=d({name:l(),currentVersion:l(),latestVersion:l(),category:x([`addon`,`core`]),requiresRestart:C(),isSystem:C()}),kR=d({version:l(),publishedAt:l(),deprecated:l().optional(),distTags:S(l()).readonly()}),AR=d({name:l(),version:l(),description:l(),keywords:S(l()).readonly(),publishedAt:l(),author:l(),installed:C(),installedVersion:l().optional()}),jR=d({channel:xR,intervalSeconds:i(),updateCheckIntervalSeconds:i()}),MR=SR,NR=o(),PR=o(),FR=o(),IR=x([`uninstalled`,`not-installed`,`refused`,`failed`,`pending-reconnect`]),LR=d({nodeId:l(),outcome:IR,error:l().optional(),addonIds:S(l()).readonly(),runnersStopped:S(l()).readonly(),warnings:S(l()).readonly()}),RR=d({success:C(),packageName:l(),results:S(LR).readonly()}),zR=d({packageName:l(),nodeId:l(),nodeName:l(),isHub:C(),isOnline:C(),version:l().nullable(),addonIds:S(l()).readonly(),source:x([`live`,`recorded`]),onHub:C()}),BR=d({installations:S(zR).readonly(),unreachable:S(d({nodeId:l(),error:l()})).readonly()}),VR=x([`queued`,`updating`,`done`,`done-pending-restart`,`failed`]),HR=d({name:l(),isSystem:C(),fromVersion:l(),toVersion:l(),status:VR,error:l().optional(),startedAtMs:i().optional(),completedAtMs:i().optional()}),UR=x([`regular`,`system`,`restarting`,`finalizing`]);d({id:l(),nodeId:l(),startedAtMs:i(),completedAtMs:i().optional(),total:i(),completed:i(),failed:i(),current:l().nullable(),phase:UR,cancelled:C(),items:S(HR).readonly()});var WR=d({packageName:l(),currentVersion:l(),latestVersion:l().nullable(),hasUpdate:C(),description:l().optional(),buildId:l().nullable()}),GR=d({timestamp:l(),level:l(),message:l(),scope:l().optional()}),KR=o(),qR=d({addonId:l().min(1),action:l().min(1),input:o()}),JR={name:`addons`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{list:D(d({nodeId:l().optional()}).optional(),S(ER).readonly()),getLogs:D(d({addonId:l(),limit:i().min(1).max(500).default(100),level:bR.optional()}),S(KR)),listPackages:D(v(),S(DR).readonly()),installPackage:D(d({packageName:l(),version:l().optional()}),PR,{kind:`mutation`,auth:`admin`}),installFromWorkspace:D(d({packageName:l()}),PR,{kind:`mutation`,auth:`admin`}),isWorkspaceAvailable:D(v(),C()),listWorkspacePackages:D(v(),S(o()).readonly()),uninstallPackage:D(d({packageName:l().min(1),nodeId:l().optional(),everywhere:C().optional()}),RR,{kind:`mutation`,auth:`admin`}),listInstallations:D(d({packageName:l().optional()}),BR,{auth:`admin`}),reloadPackages:D(v(),FR,{kind:`mutation`,auth:`admin`}),searchAvailable:D(d({query:l().optional()}),S(AR)),listUpdates:D(d({nodeId:l().optional()}),S(OR).readonly(),{auth:`admin`}),updatePackage:D(d({name:l().min(1),version:l().optional(),nodeId:l().optional()}),o(),{kind:`mutation`,auth:`admin`}),rollbackPackage:D(d({name:l().min(1)}),d({rolledBackTo:l().nullable()}),{kind:`mutation`,auth:`admin`}),forceRefresh:D(d({nodeId:l().optional()}),o(),{kind:`mutation`,auth:`admin`}),restartServer:D(d({confirm:m(!0)}),o(),{kind:`mutation`,auth:`admin`}),getLastRestart:D(v(),d({kind:x([`framework-update`,`manual`,`system`,`framework-bulk-update`]),packageName:l().optional(),fromVersion:l().optional(),toVersion:l().optional(),requestedBy:l().optional(),requestedAt:i()}).nullable(),{auth:`admin`}),listFrameworkPackages:D(v(),S(WR).readonly(),{auth:`admin`}),listCapabilityProviders:D(d({capName:l().min(1)}),S(d({addonId:l(),mode:x([`singleton`,`collection`]),isActive:C()})).readonly()),setCapabilityProviderEnabled:D(d({capName:l().min(1),addonId:l().min(1),enabled:C()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getVersions:D(d({name:l()}),S(kR).readonly()),restartAddon:D(d({addonId:l()}),NR,{kind:`mutation`,auth:`admin`}),retryLoad:D(d({packageName:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getAutoUpdateSettings:D(v(),jR,{auth:`admin`}),setAutoUpdateSettings:D(d({channel:xR,intervalSeconds:i().min(300).max(86400).optional(),updateCheckIntervalSeconds:i().min(900).max(604800).optional()}),o(),{kind:`mutation`,auth:`admin`}),getAddonAutoUpdate:D(d({addonId:l()}),MR,{auth:`admin`}),setAddonAutoUpdate:D(d({addonId:l(),channel:SR}),o(),{kind:`mutation`,auth:`admin`}),applyAutoUpdateToAll:D(d({channel:xR}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),custom:D(qR,o(),{kind:`mutation`}),startJob:D(d({kind:x([`install`,`update`,`uninstall`,`restart`]),targets:S(d({name:l().min(1),version:l().min(1)})).min(1),nodeIds:S(l()).optional()}),d({jobId:l()}),{kind:`mutation`,auth:`admin`}),getJob:D(d({jobId:l()}),yR.nullable(),{auth:`admin`}),listJobs:D(d({activeOnly:C().optional()}),S(yR),{auth:`admin`}),cancelJob:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),onAddonLogs:D(d({addonId:l(),level:bR.optional()}),GR,{kind:`subscription`})},mount:{kind:`server-provided`}},YR=d({co2Ppm:i().min(0).optional(),vocPpb:i().min(0).optional(),pm25:i().min(0).optional(),pm10:i().min(0).optional(),aqi:i().optional(),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),XR={name:`air-quality-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:YR,kind:`push`},runtimeState:YR,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},ZR=d({lux:i().min(0),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),QR={name:`ambient-light-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:ZR,kind:`push`},runtimeState:ZR,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},$R=d({className:l(),hits:i().int().nonnegative(),avgScore:i().min(0).max(1),peakScore:i().min(0).max(1)}),ez=d({ts:i().int(),windowSec:i().int().positive(),level:d({rms:i(),dbfs:i()}),peakDbfs:i(),avgDbfs:i(),current:d({className:l(),score:i().min(0).max(1),timestamp:i().int()}).nullable(),byClass:S($R).readonly()}),tz=d({ts:i().int(),dbfs:i().nullable(),peakDbfs:i(),avgDbfs:i(),topClass:l().nullable(),topScore:i().min(0).max(1).nullable()}),nz=d({points:S(tz).readonly(),effectiveSampleEveryMs:i().int().positive(),windowMsActual:i().int().nonnegative()}),rz={name:`audio-metrics`,scope:`device`,mode:`singleton`,deviceTypes:[k.Camera],methods:{getCurrentSnapshot:D(d({deviceId:i()}),ez.nullable()),getHistory:D(d({deviceId:i(),windowSec:i().int().positive().optional(),sampleEveryMs:i().int().positive().optional()}),nz)},runtimeState:ez,durability:`session`},iz=d({enabled:C(),isRunning:C(),lastTriggeredAt:i(),lastError:l().nullable(),lastChangedAt:i()}),az={name:`automation-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Automation],methods:{enable:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`admin`}),disable:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`admin`}),trigger:D(d({deviceId:i().int().nonnegative(),skipCondition:C().optional()}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:iz,kind:`push`},runtimeState:iz,durability:`session`},oz=d({percentage:i().min(0).max(100).nullable(),charging:x([`dc`,`solar`,`none`,`unknown`]),sleeping:C(),lastUpdated:i(),lastContactAt:i().optional(),binary:C().optional()}),sz={name:`battery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera,k.Sensor,k.Button,k.Switch,k.PetFeeder,k.Container],methods:{wakeForStream:D(d({deviceId:i(),timeoutMs:i().int().min(500).max(3e4).default(8e3)}),d({awoke:C(),durationMs:i()}),{kind:`mutation`})},composedMethods:{wakeForStream:{kind:`answer`,value:{awoke:!1,durationMs:0}}},events:{onStatusChanged:{data:d({deviceId:i(),status:oz})}},status:{schema:oz,kind:`push`,empty:{percentage:null,charging:`unknown`,sleeping:!1,lastUpdated:0}},runtimeState:oz,durability:`restored`,volatileStateFields:[`lastUpdated`]},cz=d({on:C(),lastChangedAt:i()}),lz={name:`binary`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:cz,kind:`push`},runtimeState:cz,durability:`restored`,volatileStateFields:[`lastChangedAt`]},uz=d({percentage:i().min(0).max(100),lastChangedAt:i()}),dz={name:`brightness`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Light],methods:{setBrightness:D(d({deviceId:i().int().nonnegative(),percentage:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`})},events:{onBrightnessChanged:{data:d({deviceId:i(),percentage:i().min(0).max(100),lastChangedAt:i()})}},status:{schema:uz,kind:`command-driven`},runtimeState:uz,durability:`session`},fz={name:`button`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Button],methods:{press:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`})}},pz=x([`ha`,`addon`]),mz=d({id:l().min(1),name:l().min(1),source:pz,enabled:C()}),hz=d({id:l().min(1),calendarId:l().min(1),title:l(),startMs:i().int(),endMs:i().int(),allDay:C().optional(),description:l().optional(),location:l().optional()}),gz=d({calendarIds:S(l().min(1)).max(64).optional(),startMs:i().int(),endMs:i().int()}),_z={name:`calendar-source`,scope:`system`,mode:`collection`,internal:!0,providerKind:`calendar`,methods:{listCalendars:D(v(),S(mz).readonly(),{auth:`admin`}),listEvents:D(gz,S(hz).readonly(),{auth:`admin`})}},vz=l().regex(/^#[0-9A-Fa-f]{6}$/,`expected #RRGGBB`),yz=mz.extend({id:l().min(1),providerAddonId:l().min(1).optional(),defaultColor:vz,color:vz,visible:C()}),bz=d({visible:C().optional(),color:vz.optional()}),xz=d({calendars:y(l(),bz)}),Sz=d({calendarId:l().min(1),visible:C().optional(),color:vz.nullable().optional()}),Cz={name:`calendars`,scope:`system`,mode:`singleton`,methods:{listCalendars:D(v(),S(yz).readonly(),{auth:`admin`}),listEvents:D(gz,S(hz).readonly(),{auth:`admin`}),getPreferences:D(d({}),xz,{auth:`admin`,caller:`required`}),setCalendarPreference:D(Sz,xz,{auth:`admin`,kind:`mutation`,caller:`required`})}},wz=d({host:l(),port:i().int().positive().optional(),onvifPort:i().int().positive().optional(),rtspPort:i().int().positive().optional(),https:C().optional(),username:l().optional(),password:l().optional(),onvifProfile:l().optional()}),Tz=d({host:l(),port:i().int().positive().nullable(),onvifPort:i().int().positive().nullable(),rtspPort:i().int().positive().nullable(),https:C().nullable(),hasUsername:C(),hasPassword:C(),onvifProfile:l().nullable()}),Ez={name:`camera-credentials`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{getCredentials:D(d({deviceId:i()}),wz.nullable(),{kind:`query`,auth:`admin`})},status:{schema:Tz,kind:`command-driven`}},Dz=d({x:i().min(0).max(1),y:i().min(0).max(1),width:i().gt(0).max(1),height:i().gt(0).max(1)}),Oz=d({deviceId:i().int().positive(),source:Dz,cell:Dz}),kz=d({profile:x([`high`,`mid`,`low`]),offered:C(),missingSources:S(i().int().positive()),canvas:l(),published:C()}),Az=d({instanceId:l(),deviceId:i().int().nonnegative(),name:l(),fps:i().int(),cells:S(Oz),profiles:S(kz)}),jz=d({deviceId:i().int().nonnegative(),name:l().min(1).max(160).optional(),fps:i().int().min(1).max(60).optional(),publishedProfiles:S(x([`high`,`mid`,`low`])).max(3).optional(),cells:S(Oz).max(16)}),Mz={name:`camera-grid-layout`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{getLayout:D(d({deviceId:i().int().nonnegative()}),Az.nullable(),{auth:`admin`}),saveLayout:D(jz,Az,{kind:`mutation`,auth:`admin`})}},Nz=d({detected:C(),lastChangedAt:i()}),Pz={name:`carbon-monoxide`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:Nz,kind:`push`},runtimeState:Nz,durability:`restored`,volatileStateFields:[`lastChangedAt`]},Fz=x([`off`,`heat`,`cool`,`auto`,`heat_cool`,`fan_only`,`dry`]),Iz=d({mode:Fz,availableModes:S(Fz),fanMode:l(),availableFanModes:S(l()),preset:l(),availablePresets:S(l()),target:i().nullable(),targetHigh:i().nullable(),targetLow:i().nullable(),targetHumidity:i().min(0).max(100).nullable(),currentTemp:i().nullable(),currentHumidity:i().min(0).max(100).nullable(),swingVertical:C().nullable(),swingHorizontal:C().nullable(),lastFetchedAt:i()}),Lz={name:`climate-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Thermostat,k.Climate],methods:{setMode:D(d({deviceId:i().int().nonnegative(),mode:Fz}),v(),{kind:`mutation`,auth:`protected`}),setFanMode:D(d({deviceId:i().int().nonnegative(),fanMode:l().min(1)}),v(),{kind:`mutation`,auth:`protected`}),setPreset:D(d({deviceId:i().int().nonnegative(),preset:l().min(1)}),v(),{kind:`mutation`,auth:`protected`}),setTarget:D(d({deviceId:i().int().nonnegative(),target:i()}),v(),{kind:`mutation`,auth:`protected`}),setTargetRange:D(d({deviceId:i().int().nonnegative(),targetLow:i(),targetHigh:i()}),v(),{kind:`mutation`,auth:`protected`}),setTargetHumidity:D(d({deviceId:i().int().nonnegative(),targetHumidity:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`}),setSwingVertical:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`}),setSwingHorizontal:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:Iz,kind:`push`},runtimeState:Iz,durability:`session`},Rz=d({r:i().int().min(0).max(255),g:i().int().min(0).max(255),b:i().int().min(0).max(255)}),zz=d({h:i().min(0).max(360),s:i().min(0).max(100),v:i().min(0).max(100)}),Bz=p(`mode`,[d({mode:m(`rgb`),rgb:Rz}),d({mode:m(`hsv`),hsv:zz}),d({mode:m(`mired`),mireds:i().int().min(50).max(1e3)})]),Vz=d({mode:x([`rgb`,`hsv`,`mired`]),rgb:Rz.optional(),hsv:zz.optional(),mireds:i().int().optional(),lastChangedAt:i()}),Hz={name:`color`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Light],methods:{setColor:D(d({deviceId:i().int().nonnegative(),color:Bz}),v(),{kind:`mutation`,auth:`protected`})},events:{onColorChanged:{data:d({deviceId:i(),mode:x([`rgb`,`hsv`,`mired`]),rgb:Rz.optional(),hsv:zz.optional(),mireds:i().int().optional(),lastChangedAt:i()})}},status:{schema:Vz,kind:`command-driven`},runtimeState:Vz,durability:`session`},Uz=2e4,Wz=p(`outcome`,[d({outcome:m(`validated`),latencyMs:i().nonnegative().optional(),detail:l().optional()}).strict(),d({outcome:m(`rejected`),error:l()}).strict(),d({outcome:m(`inconclusive`),error:l()}).strict()]),Gz=d({settings:y(l(),o())}),Kz=d({label:l()}),qz={name:`connection-test`,scope:`system`,mode:`collection`,methods:{testSettings:D(Gz,Wz,{kind:`mutation`,auth:`admin`}),describeTest:D(v(),Kz,{auth:`admin`})}},Jz=d({connected:C(),lastChangedAt:i()}),Yz={name:`connectivity`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:Jz,kind:`push`},runtimeState:Jz,durability:`restored`,volatileStateFields:[`lastChangedAt`]},Xz=x([`days`,`hours`,`cycles`]),Zz=d({value:i().min(0).nullable(),unit:Xz}),Qz=d({key:l().min(1),label:l().min(1),level:i().min(0).max(100).nullable(),status:x([`ok`,`replace`]).nullable(),lastResetAt:i().nullable(),resettable:C(),remaining:Zz.optional()}),$z=d({items:S(Qz),lastChangedAt:i()}),eB={name:`consumables`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:Object.values(k),deviceConfig:{ui:{kind:`widget`,widgetId:`host/consumables-panel`,tab:`consumables`,topTab:!0,label:`Consumables`,order:5}},methods:{reset:D(d({deviceId:i().int().nonnegative(),key:l().min(1)}),v(),{kind:`mutation`,auth:`admin`})},composedMethods:{reset:{kind:`refuse`,reason:`a composed consumable is not resettable until commands (forward) arrive — slice 3`}},status:{schema:$z,kind:`push`,empty:{items:[],lastChangedAt:0},itemArray:{path:`items`,keyField:`key`,labelField:`label`,itemSchema:Qz,emptyItem:{key:``,label:``,level:null,status:null,lastResetAt:null,resettable:!1}}},runtimeState:$z.extend({lastFetchedAt:i()}),durability:`restored`,volatileStateFields:[`lastChangedAt`,`lastFetchedAt`]},tB=d({entryOpen:C(),lastChangedAt:i()}),nB={name:`contact`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:tB,kind:`push`},runtimeState:tB,durability:`restored`,volatileStateFields:[`lastChangedAt`]},rB=x([`numeric`,`select`,`text`,`datetime`]),iB=d({kind:rB,value:f([i(),l()]),options:S(l()),lastChangedAt:i(),unit:l().optional(),min:i().optional(),max:i().optional(),step:i().optional(),precision:i().int().min(0).max(10).optional(),format:x([`date`,`time`,`datetime`]).optional()}),aB=p(`kind`,[d({kind:m(`numeric`),value:i()}),d({kind:m(`select`),value:l().min(1)}),d({kind:m(`text`),value:l()}),d({kind:m(`datetime`),value:l().min(1)})]),oB={name:`control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Control],methods:{setValue:D(d({deviceId:i().int().nonnegative(),control:aB}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:iB,kind:`push`},runtimeState:iB,durability:`session`},sB=x([`open`,`opening`,`closing`,`closed`,`stopped`]),cB=d({state:sB,position:i().min(0).max(100).nullable(),tiltPosition:i().min(0).max(100).nullable(),lastChangedAt:i()}),lB={name:`cover`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Cover],methods:{open:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),close:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),stop:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),setPosition:D(d({deviceId:i().int().nonnegative(),position:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`}),setTiltPosition:D(d({deviceId:i().int().nonnegative(),tiltPosition:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:cB,kind:`push`},runtimeState:cB,durability:`restored`,volatileStateFields:[`lastChangedAt`]},uB=x([`auto`,`day`,`night`,`schedule`]),dB=d({min:i(),max:i(),step:i()}),fB=d({mode:uB,sensitivity:i().optional(),switchDelaySec:i().optional(),lastFetchedAt:i()}),pB=d({modes:S(uB),supportsSensitivity:C(),sensitivity:dB.optional(),supportsSwitchDelay:C(),switchDelaySec:dB.optional()}),mB=d({mode:uB.optional(),sensitivity:i().optional(),switchDelaySec:i().optional()}),hB={name:`day-night`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`day-night`,tab:`image`}},methods:{getOptions:D(d({deviceId:i()}),pB),setSettings:D(d({deviceId:i(),settings:mB}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:fB,kind:`poll`},runtimeState:fB,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},gB=d({online:C(),lastChangedAt:i()}),_B={name:`device-status`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onStatusChanged:{data:d({deviceId:i(),status:gB})}},status:{schema:gB,kind:`push`},runtimeState:gB,durability:`restored`,volatileStateFields:[`lastChangedAt`]},vB=d({lastPressedAt:i().nullable(),pressCountSinceStart:i()}),yB=d({deviceId:i(),timestamp:i()}),bB={name:`doorbell`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Button,k.Camera],methods:{},events:{onPressed:{data:yB,fromState:{field:`lastPressedAt`,on:`advance`}}},status:{schema:vB,kind:`push`},runtimeState:vB,durability:`restored`},xB=x([`date`,`time`,`datetime`]),SB=d({value:l(),format:xB.optional(),lastFetchedAt:i()}),CB={name:`enum-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:SB,kind:`push`},runtimeState:SB,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},wB=d({deviceId:i(),eventType:l(),data:y(l(),o()).nullable(),timestamp:i(),seq:i()}),TB=d({eventTypes:S(l()),lastEvent:wB.nullable(),eventCountSinceStart:i()}),EB={name:`event-emitter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.EventEmitter],methods:{},events:{onEvent:{data:wB}},status:{schema:TB,kind:`push`},runtimeState:TB,durability:`session`},DB=d({id:l(),name:l(),sampleCount:i().int().nonnegative(),coverMediaId:i().int().optional(),coverBase64:l().optional()}),OB=d({id:l(),source:x([`detected`,`photo`]),addedAt:i().int(),deviceId:i().int().optional(),base64:l().optional()}),kB=d({sampleId:l(),enrolledAt:i().int(),deviceId:i().int().optional(),source:x([`detected`,`photo`]),mediaId:i().int().optional(),comparable:C(),selfMean:i().nullable(),bestForeign:d({identityId:l(),name:l(),score:i()}).optional(),suspicion:i()}),AB=d({identityId:l(),name:l(),modelId:l(),totalSamples:i().int(),comparableSamples:i().int(),flagged:i().int(),flagThreshold:i(),rows:S(kB).readonly()}),jB=d({faceId:l(),deviceId:i().int(),trackId:l(),timestamp:i().int(),recognizedIdentityId:l().optional(),identityName:l().optional(),assigned:C(),base64:l().optional(),cropUrl:l().optional(),faceBbox:sh.optional(),keyFrameMediaId:i().int().optional(),bestMatchScore:i().optional(),nativeFaceShortSidePx:i().optional(),suggestedIdentityId:l().optional(),suggestedMatchScore:i().optional()}),MB=x([`unassigned`,`recognized`,`identified`,`all`]),NB=x([`timestamp`,`suggestionConfidence`]),PB=x([`asc`,`desc`]),FB=d({faceIds:S(l()).readonly(),representativeFaceId:l(),size:i().int(),cohesion:i()}),IB=d({mediaId:i().int(),kind:l(),url:l(),sizeBytes:i(),timestamp:i()}),LB={name:`face-gallery`,scope:`system`,mode:`singleton`,methods:{listIdentities:D(d({includeCrops:C().optional()}).optional(),S(DB).readonly()),createIdentity:D(d({name:l().min(1)}),DB,{kind:`mutation`,auth:`admin`}),renameIdentity:D(d({id:l(),name:l().min(1)}),v(),{kind:`mutation`,auth:`admin`}),deleteIdentity:D(d({id:l()}),v(),{kind:`mutation`,auth:`admin`}),listIdentitySamples:D(d({identityId:l()}),S(OB).readonly()),auditIdentitySamples:D(d({identityId:l().min(1)}),AB,{auth:`admin`}),removeSample:D(d({identityId:l(),sampleId:l()}),v(),{kind:`mutation`,auth:`admin`}),listRecentFaces:D(d({deviceId:i().int().optional(),deviceIds:S(i().int()).optional(),limit:i().int().positive().optional(),filter:MB.optional(),since:i().int().optional(),until:i().int().optional(),sortBy:NB.optional(),sortDirection:PB.optional(),includeCrops:C().optional()}).optional(),S(jB).readonly()),getFaceByTrack:D(d({deviceId:i().int(),trackId:l()}),jB.nullable()),getFaceMedia:D(d({faceId:l()}),S(IB).readonly()),assignFace:D(d({faceId:l(),identityId:l()}),v(),{kind:`mutation`,auth:`admin`}),unassignFace:D(d({faceId:l()}),v(),{kind:`mutation`,auth:`admin`}),deleteFace:D(d({faceId:l()}),v(),{kind:`mutation`,auth:`admin`}),assignFaces:D(d({faceIds:S(l()).min(1),identityId:l()}),d({assigned:i().int(),failed:S(l()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignFaces:D(d({faceIds:S(l()).min(1)}),d({unassigned:i().int(),failed:S(l()).readonly()}),{kind:`mutation`,auth:`admin`}),suggestFaceClusters:D(d({threshold:i().min(0).max(1).optional(),minClusterSize:i().int().min(2).optional(),maxClusters:i().int().positive().optional(),limit:i().int().positive().optional(),maxFacesScanned:i().int().positive().optional()}).optional(),S(FB).readonly())}},RB=x([`forward`,`reverse`]),zB=d({percentage:i().min(0).max(100).nullable(),percentageStep:i().positive().optional(),preset:l(),availablePresets:S(l()),direction:RB.nullable(),oscillating:C().nullable(),lastChangedAt:i()}),BB={name:`fan-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Fan],methods:{setPercentage:D(d({deviceId:i().int().nonnegative(),percentage:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`}),setPreset:D(d({deviceId:i().int().nonnegative(),preset:l().min(1)}),v(),{kind:`mutation`,auth:`protected`}),setDirection:D(d({deviceId:i().int().nonnegative(),direction:RB}),v(),{kind:`mutation`,auth:`protected`}),setOscillating:D(d({deviceId:i().int().nonnegative(),oscillating:C()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:zB,kind:`push`},runtimeState:zB,durability:`session`},VB=d({flags:y(l(),o()),deviceType:l().nullable(),model:l().nullable(),channelCount:i().nullable(),lastProbedAt:i(),lastFetchedAt:i()}),HB={name:`feature-probe`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onProbeChanged:{data:d({deviceId:i(),status:VB})}},status:{schema:VB,kind:`push`},runtimeState:VB,durability:`session`},UB=d({flooded:C(),lastChangedAt:i()}),WB={name:`flood`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:UB,kind:`push`},runtimeState:UB,durability:`restored`,volatileStateFields:[`lastChangedAt`]},GB=d({detected:C(),lastChangedAt:i()}),KB={name:`gas`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:GB,kind:`push`},runtimeState:GB,durability:`restored`,volatileStateFields:[`lastChangedAt`]},qB=d({on:C(),currentHumidity:i().min(0).max(100).nullable(),targetHumidity:i().min(0).max(100).nullable(),mode:l().nullable(),availableModes:S(l()),action:l().nullable(),minHumidity:i().nullable(),maxHumidity:i().nullable(),lastChangedAt:i()}),JB={name:`humidifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Humidifier],methods:{setOn:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`}),setTargetHumidity:D(d({deviceId:i().int().nonnegative(),humidity:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`}),setMode:D(d({deviceId:i().int().nonnegative(),mode:l().min(1)}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:qB,kind:`push`},runtimeState:qB,durability:`session`},YB=d({percent:i().min(0).max(100),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),XB={name:`humidity-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor,k.Thermostat],methods:{},status:{schema:YB,kind:`push`},runtimeState:YB,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},ZB=d({url:l().nullable(),lastUpdated:i().nullable()}),QB={name:`image`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Image],methods:{},status:{schema:ZB,kind:`push`},runtimeState:ZB,durability:`session`},$B=x([`0`,`90`,`180`,`270`]),eV=x([`auto`,`manual`]),tV=x([`auto`,`manual`]),nV=x([`off`,`blc`,`wdr`,`hlc`]),rV=d({min:i(),max:i(),step:i()}),iV=d({brightness:i().optional(),contrast:i().optional(),saturation:i().optional(),sharpness:i().optional(),mirror:C().optional(),flip:C().optional(),rotate:$B.optional(),whiteBalance:eV.optional(),warmth:i().optional(),exposureMode:tV.optional(),backlightMode:nV.optional(),lastFetchedAt:i()}),aV=d({supportsBrightness:C(),brightness:rV.optional(),supportsContrast:C(),contrast:rV.optional(),supportsSaturation:C(),saturation:rV.optional(),supportsSharpness:C(),sharpness:rV.optional(),supportsMirror:C(),supportsFlip:C(),rotateOptions:S($B),whiteBalanceModes:S(eV),supportsWarmth:C(),warmth:rV.optional(),exposureModes:S(tV),backlightModes:S(nV)}),oV=d({brightness:i().optional(),contrast:i().optional(),saturation:i().optional(),sharpness:i().optional(),mirror:C().optional(),flip:C().optional(),rotate:$B.optional(),whiteBalance:eV.optional(),warmth:i().optional(),exposureMode:tV.optional(),backlightMode:nV.optional()}),sV={name:`image-settings`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`image-settings`,tab:`image`}},methods:{getOptions:D(d({deviceId:i()}),aV),setSettings:D(d({deviceId:i(),settings:oV}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:iV,kind:`poll`},runtimeState:iV,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},cV=d({id:l(),addonId:l(),name:l(),enabled:C(),info:y(l(),o()).readonly(),createdAt:i(),updatedAt:i(),processState:l()}),lV=d({id:l(),addonId:l(),name:l(),enabled:C(),info:y(l(),o()).readonly(),createdAt:i(),updatedAt:i()}),uV=d({addonId:l(),name:l(),description:l(),iconUrl:l().nullable(),color:l(),instanceMode:l(),mode:x([`standalone`,`account`,`broker`]),discoveryMode:l(),kind:x([`device-adoption`,`device-provider`]),brokerKind:l().nullable(),supportsLocationImport:C(),canTest:C(),existingInstances:S(d({id:l(),name:l()})),canAdd:C()}),dV=x([`validated`,`rejected`,`inconclusive`,`unsupported`]),fV=d({success:C(),error:l().optional(),status:dV.optional(),testedBy:l().nullable().optional(),latencyMs:i().nonnegative().optional(),detail:l().optional()}),pV=d({addonId:l(),name:l(),enabled:C().optional(),info:y(l(),o()).optional(),settings:y(l(),o()).optional(),secretKeys:S(l()).optional(),skipRestart:C().optional()}),mV=d({id:l(),name:l().optional(),enabled:C().optional(),info:y(l(),o()).optional()}),hV=d({success:C(),deletedId:l()}),gV={name:`integrations`,scope:`system`,mode:`singleton`,methods:{list:D(v(),S(cV)),get:D(d({id:l()}),cV),getByAddonId:D(d({addonId:l()}),lV.nullable()),create:D(pV,lV,{kind:`mutation`,auth:`admin`}),update:D(mV,lV,{kind:`mutation`,auth:`admin`}),delete:D(d({id:l()}),hV,{kind:`mutation`,auth:`admin`}),getSettings:D(d({id:l()}),y(l(),o()),{auth:`admin`}),setSettings:D(d({id:l(),settings:y(l(),o()),secretKeys:S(l()).optional()}),d({success:C()}),{kind:`mutation`,auth:`admin`}),getAvailableTypes:D(v(),S(uV),{auth:`admin`}),testConnection:D(d({addonId:l(),settings:y(l(),o())}),fV,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},_V=d({codecs:S(l()),sampleRate:i(),duplex:x([`half`,`full`]),maxBacklogMs:i()}),vV=d({talking:C(),lastSessionAt:i().nullable(),ability:_V.nullable()}),yV=x([`opus`,`s16le`,`g711ulaw`,`g711alaw`]),bV={name:`intercom`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{startSession:D(d({deviceId:i()}),d({sessionId:l(),sdpOffer:l()}),{kind:`mutation`,auth:`protected`}),handleAnswer:D(d({deviceId:i(),sessionId:l(),sdpAnswer:l()}),v(),{kind:`mutation`,auth:`protected`}),stopSession:D(d({deviceId:i(),sessionId:l()}),v(),{kind:`mutation`,auth:`protected`}),startTalkSession:D(d({deviceId:i()}),d({sessionId:l()}),{kind:`mutation`,auth:`protected`}),pushTalkAudio:D(d({deviceId:i(),audioBase64:l(),codec:yV.optional(),sampleRate:i().int().positive().optional(),channels:i().int().positive().optional(),sequenceNumber:i().int()}),d({accepted:C()}),{kind:`mutation`,auth:`protected`}),endTalkSession:D(d({deviceId:i()}),v(),{kind:`mutation`,auth:`protected`})},events:{onStatusChanged:{data:d({deviceId:i(),status:vV})}},status:{schema:vV,kind:`command-driven`},runtimeState:vV,durability:`session`},xV=x([`idle`,`mowing`,`paused`,`docked`,`error`]),SV=x([`info`,`warning`,`error`]),CV=d({activity:xV,batteryLevel:i().min(0).max(100).nullable(),progressPercent:i().min(0).max(100).nullable(),currentCode:i().nullable(),currentCodeLabel:l().nullable(),severity:SV,lastChangedAt:i()}),wV={name:`lawn-mower-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.LawnMower],methods:{startMowing:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),pause:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),dock:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:CV,kind:`push`},runtimeState:CV,durability:`session`},TV=x([`lan`,`wifi`,`docker`,`vpn`,`loopback`,`other`]),EV=d({name:l(),family:x([`IPv4`,`IPv6`]),address:l(),cidr:l(),netmask:l(),internal:C(),mac:l(),kind:TV,preferred:C(),plausible:C(),plausibleReason:l()}),DV=d({interfaces:S(EV).readonly(),probedAt:i()}),OV=EV.nullable(),kV=d({label:l(),baseUrl:l(),kind:x([`lan-ipv4`,`lan-ipv6`,`public`,`loopback`,`app-link`,`custom`]),interfaceKind:x([`lan`,`wifi`,`docker`,`vpn`,`other`,`loopback`,`public`]),plausible:C(),plausibleReason:l(),priority:i()}),AV=x([`server-config`,`server-env`,`caller-hint`,`default`]),jV=d({port:i().int().min(1).max(65535),source:AV}),MV=d({endpoints:S(kV).readonly(),localPort:jV}),NV=d({baseUrl:l().nullable(),resolved:l().nullable(),appLinkHub:l().nullable()}),PV=d({baseUrls:S(l()).readonly(),resolved:S(l()).readonly()}),FV=d({override:l().nullable(),resolved:l().nullable(),source:x([`override`,`auto`,`none`])}),IV=d({cluster:FV,browser:FV}),LV=x(QS),RV=x([`flagged`,`auto`,`none`]),zV=d({flagged:l().nullable(),resolved:l().nullable(),source:RV}),BV=d({flagged:S(l()).readonly(),resolved:S(l()).readonly(),source:RV}),VV=d({rows:S(kV.extend({detected:C(),custom:C(),flags:S(LV).readonly(),inUse:S(LV).readonly(),eligible:S(LV).readonly()})).readonly(),roles:d({appConnections:BV,notificationTaps:zV,internal:zV,publicEndpoint:zV}),appLinkHub:l().nullable()}),HV=d({addresses:S(l()).readonly()}),UV=d({mode:x([`generated`,`uploaded`,`disabled`]),leafFingerprintSha256:l().nullable(),caFingerprintSha256:l().nullable(),validTo:l().nullable(),sans:S(l()),caCertPem:l().nullable(),reissueError:l().nullable(),restartRequired:C()}),WV={name:`local-network`,scope:`system`,mode:`singleton`,methods:{list:D(v(),DV),getPreferred:D(v(),OV),getConnectionEndpoints:D(d({port:i().int().min(1).max(65535).optional(),includeLoopback:C().optional(),ipv4Only:C().optional(),scheme:x([`http`,`https`]).optional(),includeAppLink:C().optional()}),MV),getNotificationEndpoint:D(v(),NV),setNotificationEndpoint:D(d({baseUrl:l().nullable()}),NV,{kind:`mutation`}),getViewerEndpoints:D(v(),PV),setViewerEndpoints:D(d({baseUrls:S(l()).readonly()}),PV,{kind:`mutation`}),getAddresses:D(d({scheme:x([`http`,`https`]).optional()}).optional(),VV),addCustomAddress:D(d({baseUrl:l(),label:l().max(80)}),VV,{kind:`mutation`,auth:`admin`}),removeCustomAddress:D(d({baseUrl:l()}),VV,{kind:`mutation`,auth:`admin`}),setAddressRole:D(d({role:LV,baseUrl:l().nullable(),enabled:C(),acceptInsecureHttp:C().optional()}),VV,{kind:`mutation`,auth:`admin`}),getHubAddresses:D(v(),IV),getAllowedAddresses:D(v(),HV),setAllowedAddresses:D(HV,d({success:m(!0)}),{kind:`mutation`}),resetAllowlistToBestMatch:D(v(),HV,{kind:`mutation`}),getTlsStatus:D(v(),UV),regenerateCertificate:D(d({reason:l().optional()}),UV,{kind:`mutation`,auth:`admin`}),uploadCertificate:D(d({certPem:l().min(1),keyPem:l().min(1),caPem:l().optional()}),UV,{kind:`mutation`,auth:`admin`}),downloadCa:D(v(),d({pem:l()})),revertToGeneratedCertificate:D(v(),UV,{kind:`mutation`,auth:`admin`})},mount:{kind:`hub-only`}},GV=x([`locked`,`unlocked`,`locking`,`unlocking`,`jammed`]),KV=d({state:GV,lastChangedAt:i()}),qV={name:`lock-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Lock],methods:{lock:D(d({deviceId:i().int().nonnegative(),code:l().min(1).optional()}),v(),{kind:`mutation`,auth:`protected`}),unlock:D(d({deviceId:i().int().nonnegative(),code:l().min(1).optional()}),v(),{kind:`mutation`,auth:`protected`}),open:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:KV,kind:`push`},runtimeState:KV,durability:`restored`,volatileStateFields:[`lastChangedAt`]},JV=x([`off`,`on`,`idle`,`playing`,`paused`,`buffering`,`standby`]),YV=x([`off`,`all`,`one`]),XV=d({type:l(),title:l(),artist:l().optional(),album:l().optional(),imageUrl:l().optional()}),ZV=d({state:JV,volumeLevel:i().min(0).max(100).nullable(),isMuted:C().nullable(),source:l(),availableSources:S(l()),currentMedia:XV.nullable(),positionMs:i().int().nonnegative().nullable(),durationMs:i().int().nonnegative().nullable(),shuffle:C().nullable(),repeat:YV.nullable(),lastChangedAt:i()}),QV={name:`media-player`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.MediaPlayer],methods:{play:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),pause:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),stop:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),next:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),previous:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),seek:D(d({deviceId:i().int().nonnegative(),positionMs:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),setVolume:D(d({deviceId:i().int().nonnegative(),volumeLevel:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`}),setMute:D(d({deviceId:i().int().nonnegative(),muted:C()}),v(),{kind:`mutation`,auth:`protected`}),setShuffle:D(d({deviceId:i().int().nonnegative(),shuffle:C()}),v(),{kind:`mutation`,auth:`protected`}),setRepeat:D(d({deviceId:i().int().nonnegative(),repeat:YV}),v(),{kind:`mutation`,auth:`protected`}),selectSource:D(d({deviceId:i().int().nonnegative(),source:l().min(1)}),v(),{kind:`mutation`,auth:`protected`}),playMedia:D(d({deviceId:i().int().nonnegative(),mediaId:l().min(1),mediaType:l().min(1)}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:ZV,kind:`push`},runtimeState:ZV,durability:`session`},$V=d({id:l(),label:l(),scope:x([`mesh`,`public`]),url:l(),hostname:l(),port:i(),protocol:x([`http`,`https`])}),eH=d({id:l(),hostname:l(),magicDns:l(),addresses:S(l()).readonly(),os:l().optional(),online:C(),lastSeenMs:i(),isSelf:C(),connection:x([`direct`,`relay`,`idle`]),relay:l().nullable(),lastHandshakeMs:i(),rxBytes:i(),txBytes:i(),tags:S(l()).readonly(),exitNodeOption:C(),advertisedRoutes:S(l()).readonly(),userLogin:l().nullable(),keyExpiry:i().nullable()}),tH=d({joined:C(),meshIp:l(),magicDnsHostname:l(),peerCount:i(),endpoints:S($V).readonly(),error:l().optional(),tenantName:l(),magicDnsSuffix:l(),userLogin:l().nullable(),controlPlaneUrl:l(),keyExpiry:i().nullable(),daemonSocket:l().optional(),daemonCliPath:l().optional()}),nH={name:`mesh-network`,scope:`system`,mode:`collection`,providerKind:`mesh`,methods:{getStatus:D(v(),tH),join:D(d({authKey:l().min(8),hostname:l().optional()}),d({joined:m(!0)}),{kind:`mutation`}),startLogin:D(d({hostname:l().optional()}),d({loginUrl:l()}),{kind:`mutation`}),leave:D(v(),d({left:m(!0)}),{kind:`mutation`}),logout:D(v(),d({loggedOut:m(!0)}),{kind:`mutation`}),listPeers:D(v(),d({peers:S(eH).readonly()})),testConnection:D(d({authKey:l().optional()}),d({ok:C(),tenant:l().optional(),daemonVersion:l().optional(),error:l().optional()}),{kind:`mutation`})}},rH=15e3,iH=d({detected:C(),lastDetectedAt:i().nullable(),autoClearAfterMs:i().nullable()}),aH=d({deviceId:i(),detected:C(),timestamp:i(),source:LP,regions:S(eT).readonly().optional(),triggeredBy:dk.optional()}),oH={name:`motion`,scope:`device`,mode:`singleton`,deviceNative:!0,deviceTypes:[k.Camera,k.Sensor],methods:{isDetected:D(d({deviceId:i()}),C())},events:{onMotionChanged:{data:aH}},status:{schema:iH,kind:`push`},runtimeState:iH,durability:`session`},sH=d({enabled:C(),lastChangedAt:i()}),cH=sH.extend({lastFetchedAt:i()}),lH={name:`motion-trigger`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Light,k.Siren,k.Switch],methods:{setMotionTrigger:D(d({deviceId:i().int().nonnegative(),enabled:C()}),v(),{kind:`mutation`,auth:`admin`})},events:{onMotionTriggerChanged:{data:d({deviceId:i(),enabled:C(),lastChangedAt:i()})}},status:{schema:sH,kind:`command-driven`},runtimeState:cH,durability:`session`},uH=d({id:i(),enabled:C(),shape:pE}),dH=d({enabled:C(),sensitivity:i(),regions:S(uH),lastFetchedAt:i()}),fH=d({maxRegions:i(),supportedShapes:S(gE),grid:vE,sensitivity:d({min:i(),max:i(),step:i()})}),pH=d({enabled:C().optional(),sensitivity:i().optional(),regions:S(uH).optional()}),mH={name:`motion-zones`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/motion-zones-grid`,tab:`motion`,label:`Motion Zones`}},methods:{getOptions:D(d({deviceId:i()}),fH),setZone:D(d({deviceId:i(),patch:pH}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:dH,kind:`poll`},runtimeState:dH,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},hH=x([`person`,`vehicle`,`animal`,`face`,`package`,`other`]),gH=d({class:hH,timestamp:i(),confidence:i().min(0).max(1).optional()}),_H=d({lastByClass:ae(hH,gH.nullable()),supportedClasses:S(hH).readonly(),enabled:C()}),vH=x([`boxed`,`while-streaming`,`flag-only`]),yH=d({supportedClasses:S(hH).readonly(),geometry:vH}),bH=d({enabled:C().optional()}),xH=_H.extend({lastFetchedAt:i()}),SH={name:`native-object-detection`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{getOptions:D(d({deviceId:i()}),yH),setSettings:D(d({deviceId:i(),settings:bH}),v(),{kind:`mutation`,auth:`admin`}),setEnabled:D(d({deviceId:i(),enabled:C()}),v(),{kind:`mutation`,auth:`admin`})},events:{onDetected:{data:d({deviceId:i(),detection:gH})}},status:{schema:_H,kind:`push`},runtimeState:xH,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},CH=d({pan:i().min(-1).max(1).optional(),tilt:i().min(-1).max(1).optional(),speed:i().min(0).max(1).optional()}),wH=x([`goHome`,`locate`,`spotClean`,`findPet`,`personFollow`,`stop`,`startClean`,`pauseClean`,`dockWash`,`autoEmpty`,`flashOn`,`flashOff`]),TH=x([`action`,`sound`]),EH=d({id:l(),kind:TH,label:l(),icon:l(),soundId:i().int().optional(),enabled:C()}),DH=[{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}],OH=d({x:i(),y:i()}),kH=d({move:C(),stop:C(),goToPoint:C(),runAction:C(),playSound:C(),light:C(),lightMode:C()}),AH=x([`auto`,`manual`]),jH=40,MH=100,NH=x([`idle`,`cleaning`,`spot`,`following`,`goto`,`returning`,`paused`,`unknown`]),PH=d({mode:NH,following:C(),flash:C(),lightMode:AH,lightLevel:i().min(40).max(100),lastChangedAt:i()}),FH=PH.extend({lastFetchedAt:i()}),IH={name:`navigation`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/navigation-panel`,tab:`navigation`,topTab:!0,label:`Navigation`,order:0}},methods:{move:D(CH.extend({deviceId:i()}),v(),{kind:`mutation`}),stop:D(d({deviceId:i()}),v(),{kind:`mutation`}),goToPoint:D(OH.extend({deviceId:i()}),v(),{kind:`mutation`}),listActions:D(d({deviceId:i()}),S(EH)),runAction:D(d({deviceId:i(),actionId:wH}),v(),{kind:`mutation`}),playSound:D(d({deviceId:i(),soundId:i().int()}),v(),{kind:`mutation`}),setLightOn:D(d({deviceId:i(),on:C()}),v(),{kind:`mutation`}),setLightMode:D(d({deviceId:i(),mode:AH,level:i().min(40).max(100).optional()}),v(),{kind:`mutation`}),setLightLevel:D(d({deviceId:i(),level:i().min(40).max(100)}),v(),{kind:`mutation`}),getFeatures:D(d({deviceId:i()}),kH)},events:{onStatusChanged:{data:d({deviceId:i(),status:PH})}},status:{schema:PH,kind:`push`},runtimeState:FH,durability:`session`},LH=[`wifi`,`ethernet`,`cellular`,`unknown`],RH=d({type:x(LH),signalPercent:i().min(0).max(100).nullable(),rssiDbm:i().optional(),ssid:l().optional(),lastUpdated:i()}),zH={type:`unknown`,signalPercent:null,lastUpdated:0};function BH(e,t){return e===void 0||!Number.isFinite(e)||t<=0||e<0||e>t?null:Math.round(e/t*100)}function VH(e){return e===void 0||!Number.isFinite(e)||e>0?null:Math.round((Math.min(-50,Math.max(-100,e))+100)*2)}var HH={name:`network-link`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera,k.Sensor,k.Button,k.Switch,k.Light,k.Lock,k.Siren],methods:{},events:{onStatusChanged:{data:d({deviceId:i(),status:RH})}},status:{schema:RH,kind:`push`,empty:zH},runtimeState:RH,durability:`restored`,volatileStateFields:[`lastUpdated`]},UH=d({nominalBitrateKbps:i(),observedBitrateKbps:i(),peakBitrateKbps:i(),packetLossPercent:i(),lastUpdated:i()}),WH=d({rttMs:i(),jitterMs:i(),estimatedBandwidthKbps:i(),packetLossPercent:i().min(0).max(100),downlinkMbps:i().optional(),downlinkAgeMs:i().optional(),lastUpdated:i()}),GH=d({deviceId:i(),streams:y(l(),UH),client:WH.optional()}),KH={name:`network-quality`,scope:`system`,mode:`singleton`,methods:{getDeviceStats:D(d({deviceId:i()}),GH.nullable()),getAllStats:D(v(),S(GH).readonly()),reportClientStats:D(d({deviceId:i(),rttMs:i().min(0).max(6e4),jitterMs:i().min(0).max(1e4),estimatedBandwidthKbps:i().min(0).max(1e6),packetLossPercent:i().min(0).max(100),downlinkMbps:i().min(0).max(1e5).optional(),downlinkAgeMs:i().min(0).max(864e5).optional()}),v(),{kind:`mutation`})},mount:{kind:`server-provided`}},qH=d({addonId:l(),capabilities:S(l()).readonly(),status:l()}),JH=d({pid:i(),name:l(),state:l(),cpuPercent:i(),memoryRss:i(),uptimeSeconds:i(),services:S(qH).readonly(),groupId:l().optional()}),YH=d({id:l(),status:l(),cpuPercent:i(),memoryRss:i()}),XH=d({category:l(),total:i(),healthy:i(),addons:S(YH).readonly()}),ZH=d({name:l(),version:l()}),QH=d({id:l(),name:l(),hostname:l(),platform:l(),arch:l(),cpuModel:l().nullable(),cpuCores:i(),memoryMB:i(),engines:S(l()).readonly(),isHub:C(),isOnline:C(),cpuPercent:i(),memoryPercent:i(),uptime:i(),lastSeen:l(),localIps:S(l()).readonly(),addons:S(d({id:l(),capabilities:S(l()).readonly(),status:l()})).readonly(),processes:S(JH).readonly(),categories:S(XH).readonly(),rootPackage:ZH.nullable(),meshTransport:x([`tls`,`clear`]).optional()}),$H=d({callerAddonId:l(),providerAddonId:l(),capName:l(),callsPerMin:i(),lastCallAtMs:i()}),eU=d({nodeId:l(),name:l(),version:l(),status:l(),synced:C()}),tU=d({hubVersion:l(),nodes:S(eU)}),nU=d({nodeId:l(),addonId:l()}),rU=d({id:l(),status:l(),version:l().optional(),packageName:l().optional()}),iU=d({success:C()}),aU=d({success:C(),reason:l().optional()}),oU=d({restarted:S(l()).readonly(),failed:S(l()).readonly()}),sU=d({nodeId:l(),name:l()}),cU=d({id:l(),name:l(),isHub:C(),isOnline:C()}),lU=d({nodes:S(cU).readonly(),complete:C()}),uU={name:`nodes`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{topology:D(v(),S(QH).readonly(),{auth:`admin`}),directory:D(v(),lU,{auth:`admin`}),deployAddon:D(nU,iU,{kind:`mutation`,auth:`admin`}),undeployAddon:D(nU,iU,{kind:`mutation`,auth:`admin`}),restartAddon:D(nU,iU,{kind:`mutation`,auth:`admin`}),restartProcess:D(d({nodeId:l(),processName:l()}),aU,{kind:`mutation`,auth:`admin`}),restartNode:D(d({nodeId:l()}),oU,{kind:`mutation`,auth:`admin`}),shutdownNode:D(d({nodeId:l()}),iU,{kind:`mutation`,auth:`admin`}),renameNode:D(d({nodeId:l(),name:l().min(1).max(64)}),sU,{kind:`mutation`,auth:`admin`}),clusterAddonStatus:D(v(),y(l(),tU),{auth:`admin`}),getCapUsageGraph:D(d({windowSeconds:i().int().positive().max(300).default(60)}),S($H).readonly(),{auth:`admin`}),getNodeAddons:D(d({nodeId:l()}),S(rU).readonly(),{auth:`admin`}),setProcessLogLevel:D(d({nodeId:l(),level:l()}),iU,{kind:`mutation`,auth:`admin`}),executeQuery:D(d({nodeId:l(),addonId:l(),queryName:l(),params:y(l(),o()).optional()}),o(),{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},dU=x([`min`,`low`,`normal`,`high`]),fU=d({id:l().min(1),title:l().min(1),uri:s().optional(),destructive:C().optional()}),pU=d({image:C(),priority:C(),data:C(),actions:C(),recipients:C()}),mU=d({lastSentAt:i(),lastError:l().nullable(),queueDepth:i().int().nonnegative(),supports:pU}),hU=d({deviceId:i().int().nonnegative(),title:l().optional(),body:l().min(1),image:l().optional(),priority:dU.optional(),channel:l().optional(),recipients:S(l()).optional(),actions:S(fU).optional(),data:y(l(),o()).optional()}),gU=d({notificationId:l(),acceptedAt:i()}),_U={name:`notifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Notifier],methods:{send:D(hU,gU,{kind:`mutation`,auth:`admin`}),cancel:D(d({deviceId:i().int().nonnegative(),notificationId:l().min(1)}),v(),{kind:`mutation`,auth:`admin`})},events:{onSent:{data:d({deviceId:i(),notificationId:l(),success:C(),error:l().nullable(),acceptedAt:i()})}},status:{schema:mU,kind:`command-driven`},runtimeState:mU,durability:`session`},vU=d({value:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional(),lastFetchedAt:i()}),yU={name:`numeric-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:vU,kind:`push`},runtimeState:vU,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},bU=x([`text`,`timestamp`,`watermark`]),xU=x([`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`custom`]),SU=d({id:l(),kind:bU,enabled:C(),text:l().optional(),position:xU.optional(),availablePositions:S(xU).readonly(),readOnly:C().optional(),maxCharacters:i().int().positive().optional()}),CU=d({overlays:S(SU).readonly()}),wU=d({enabled:C().optional(),text:l().optional(),position:xU.optional()}).partial(),TU={name:`osd`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{setOverlay:D(d({deviceId:i(),overlayId:l(),patch:wU}),v(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:d({deviceId:i(),status:CU})}},status:{schema:CU,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}}}]}},EU=x([`value`,`unit`,`full`]),DU=x([`value+unit`,`value`,`unit`]),OU=d({containerId:i().int().optional(),deviceId:i().int()}),kU=d({alias:l().min(1).max(32).regex(/^[A-Za-z][A-Za-z0-9_-]*$/,`alias must start with a letter`),pick:OU,capName:l().min(1).max(64),valuePath:l().min(1).max(64),displayUnit:l().max(16).optional(),maxDecimals:i().int().min(0).max(4).default(1),valueMap:y(l(),l()).optional()}),AU=d({id:l().min(1).max(64),name:l().min(1).max(64),bindings:S(kU).max(32).default([]),parser:l().max(256).default(``)}),jU=p(`kind`,[d({kind:m(`none`)}),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:i().int().optional(),capName:l().min(1).max(64),valuePath:l().min(1).max(64),displayUnit:l().max(16).optional()}),d({kind:m(`latest-recognition`),recognition:x([`person`,`plate`])}),d({kind:m(`template`),templateId:l().min(1).max(64)})]),MU=d({enabled:C().default(!0),source:jU,template:l().max(96).default("${value}"),maxDecimals:i().int().min(0).max(4).default(1),valueMap:y(l(),l()).optional(),schedule:FE.optional(),conditions:rD.optional()}),NU=d({slotId:l(),kind:bU,readOnly:C(),cameraEnabled:C(),cameraText:l().optional(),binding:MU.nullable()}),PU=x([`written`,`unchanged`,`gated`,`unreadable`,`disabled`,`unbound`,`failed`]),FU=d({slotId:l(),outcome:PU,text:l(),reason:l().optional()}),IU=x([`number`,`boolean`,`string`,`enum`]),LU=d({deviceId:i().int(),deviceName:l(),capName:l(),valuePath:l(),label:l(),valueType:IU,enumValues:S(l()).readonly().optional()}),RU={name:`osd-manager`,scope:`system`,mode:`singleton`,methods:{getDeviceOsd:D(d({deviceId:i().int()}),d({supported:C(),slots:S(NU)}),{auth:`admin`}),getSourceCatalog:D(d({deviceId:i().int()}),d({sources:S(LU)}),{auth:`admin`}),getConditionSupport:D(d({}),d({supported:S(l()),catalog:S(UD)}),{auth:`admin`}),setSlotBinding:D(d({deviceId:i().int(),slotId:l().min(1),binding:MU}),d({slot:NU,render:FU}),{kind:`mutation`,auth:`admin`}),clearSlotBinding:D(d({deviceId:i().int(),slotId:l().min(1)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setSlotCameraEnabled:D(d({deviceId:i().int(),slotId:l().min(1),enabled:C()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),copyDeviceConfiguration:D(d({sourceDeviceId:i().int(),targetDeviceId:i().int()}),d({copied:i().int().nonnegative(),skipped:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),previewSlot:D(d({deviceId:i().int(),slotId:l().min(1),binding:MU.optional()}),FU,{kind:`mutation`,auth:`admin`}),renderDevice:D(d({deviceId:i().int()}),d({results:S(FU)}),{kind:`mutation`,auth:`admin`}),listTemplates:D(d({}),d({templates:S(AU)}),{auth:`admin`}),upsertTemplate:D(d({template:AU}),d({template:AU}),{kind:`mutation`,auth:`admin`}),deleteTemplate:D(d({templateId:l().min(1).max(64)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`})}},zU=4,BU=200,VU=x([`normal`,`offline`,`on_batteries`]),HU=i().int().min(4).max(200),UU=d({foodLevel:i().nullable(),food1:i().nullable(),food2:i().nullable(),lowFood:C(),batteryPower:i().min(0).max(100).nullable(),desiccantLeftDays:i().nullable(),feeding:C(),status:VU.nullable(),error:l().nullable(),errorCode:i().nullable(),isDualHopper:C(),childLock:C(),indicatorLight:C(),feedSound:C(),volume:i(),lastFetchedAt:i()}),WU={name:`pet-feeder`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.PetFeeder],methods:{feed:D(d({deviceId:i().int().nonnegative(),grams:HU.optional(),hopper1:HU.optional(),hopper2:HU.optional()}),v(),{kind:`mutation`,auth:`protected`}),cancelFeed:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),resetDesiccant:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),markFoodReplenished:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),callPet:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),playSound:D(d({deviceId:i().int().nonnegative(),soundId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),setChildLock:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`}),setIndicatorLight:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`}),setFeedSound:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`}),setVolume:D(d({deviceId:i().int().nonnegative(),level:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:UU,kind:`poll`},runtimeState:UU,durability:`session`},GU=d({id:l(),name:l(),sampleCount:i().int().nonnegative(),coverMediaId:i().int().optional(),coverBase64:l().optional()}),KU=d({id:l(),text:l(),score:i(),addedAt:i().int(),deviceId:i().int().optional(),base64:l().optional()}),qU=d({plateId:l(),deviceId:i().int(),trackId:l(),timestamp:i().int(),text:l(),score:i(),corrected:C(),recognizedVehicleId:l().optional(),vehicleName:l().optional(),assigned:C(),plateBbox:sh.optional(),keyFrameMediaId:i().int().optional(),base64:l().optional(),cropUrl:l().optional()}),JU=d({mediaId:i().int(),kind:l(),url:l(),sizeBytes:i(),timestamp:i()}),YU=d({plateIds:S(l()).readonly(),representativePlateId:l(),representativeText:l(),size:i().int(),cohesion:i()}),XU={name:`plate-gallery`,scope:`system`,mode:`singleton`,methods:{listPlates:D(d({deviceId:i().int().optional(),limit:i().int().positive().optional(),includeCrops:C().optional()}).optional(),S(qU).readonly()),getPlateByTrack:D(d({deviceId:i().int(),trackId:l()}),qU.nullable()),getPlateMedia:D(d({plateId:l()}),S(JU).readonly()),searchPlates:D(d({text:l().min(1),maxDistance:i().int().min(0).optional(),limit:i().int().positive().optional(),includeCrops:C().optional()}),S(qU).readonly()),suggestPlateClusters:D(d({maxDistance:i().int().min(0).optional(),minClusterSize:i().int().min(2).optional(),limit:i().int().positive().optional()}).optional(),S(YU).readonly()),correctPlateText:D(d({plateId:l(),text:l().min(1)}),v(),{kind:`mutation`,auth:`admin`}),deletePlate:D(d({plateId:l()}),v(),{kind:`mutation`,auth:`admin`}),listVehicles:D(d({includeCrops:C().optional()}).optional(),S(GU).readonly()),createVehicle:D(d({name:l().min(1)}),GU,{kind:`mutation`,auth:`admin`}),renameVehicle:D(d({id:l(),name:l().min(1)}),v(),{kind:`mutation`,auth:`admin`}),deleteVehicle:D(d({id:l()}),v(),{kind:`mutation`,auth:`admin`}),listVehicleSamples:D(d({vehicleId:l()}),S(KU).readonly()),removeVehicleSample:D(d({vehicleId:l(),sampleId:l()}),v(),{kind:`mutation`,auth:`admin`}),assignPlate:D(d({plateId:l(),vehicleId:l()}),v(),{kind:`mutation`,auth:`admin`}),unassignPlate:D(d({plateId:l()}),v(),{kind:`mutation`,auth:`admin`}),assignPlates:D(d({plateIds:S(l()).min(1),vehicleId:l()}),d({assigned:i().int(),failed:S(l()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignPlates:D(d({plateIds:S(l()).min(1)}),d({unassigned:i().int(),failed:S(l()).readonly()}),{kind:`mutation`,auth:`admin`})}},ZU=x(yr),QU=x([`videotoolbox`,`cuda`,`nvdec`,`vaapi`,`qsv`,`d3d11va`,`dxva2`,`amf`,`vdpau`,`drm`,`coreml`,`tensorrt`,`openvino`,`directml`,`webgpu`,`none`]).nullable().optional(),$U=d({preferred:S(l()).readonly(),rationale:l()}),eW=x([`h264_videotoolbox`,`hevc_videotoolbox`,`h264_vaapi`,`hevc_vaapi`,`h264_nvenc`,`hevc_nvenc`,`h264_qsv`,`hevc_qsv`,`h264_amf`,`hevc_amf`,`libx264`,`libx265`]);d({encoders:S(d({encoder:eW,codec:x([`H264`,`H265`]),family:x([`videotoolbox`,`vaapi`,`nvenc`,`qsv`,`amf`,`software`]),available:C(),reason:l().optional()})).readonly(),defaultH264:eW,defaultH265:eW,probedAt:i()}),d({methods:S(l()).readonly(),probedAt:i()});var tW=x([`darwin`,`linux`,`win32`]),nW=x([`arm64`,`x64`]),rW=d({type:x([`nvidia`,`amd`,`intel`,`apple`]),name:l(),memoryMB:i().optional()}),iW=d({type:x([`apple-ane`,`intel-npu`,`amd-xdna`]),name:l().optional(),generation:x([`xdna1`,`xdna2`]).optional()}),aW=d({type:m(`coral-edgetpu`),bus:l().optional()}),oW=d({platform:tW,arch:nW,cpuModel:l(),cpuCores:i(),totalRAM_MB:i(),availableRAM_MB:i(),gpu:rW.nullable(),npu:iW.nullable(),coral:aW.nullable().optional()}),sW=d({runtime:m(`python`),backend:l(),format:x([`onnx`,`coreml`,`openvino`,`tflite`]),score:i(),reason:l(),available:C()}),cW=d({key:l(),backend:l(),device:l(),format:ZU,runtime:m(`python`),score:i(),available:C()}),lW=d({hardware:oW,scores:S(sW).readonly(),bestScore:sW,pythonPath:l().nullable(),devices:S(cW).readonly()}),uW=d({modelId:l(),name:l(),minRAM_MB:i(),accuracyScore:i(),formats:S(l()).readonly()}),dW=d({modelId:l(),runtime:m(`python`),backend:l(),format:ZU,reason:l()}),fW={name:`platform-probe`,scope:`system`,mode:`singleton`,methods:{getCapabilities:D(v(),lW),getHardware:D(v(),oW),resolveInferenceConfig:D(d({requirements:S(uW).readonly()}),dW),resolveHwAccel:D(d({prefer:QU}),$U)}},pW=d({watts:i().optional(),kwhTotal:i().optional(),volts:i().optional(),amps:i().optional(),va:i().optional(),powerFactor:i().min(0).max(1).optional(),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),mW={name:`power-meter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:pW,kind:`push`},runtimeState:pW,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},hW=d({latitude:i().min(-90).max(90),longitude:i().min(-180).max(180),accuracyMeters:i().nonnegative()}),gW=d({state:l(),location:l().nullable(),gps:hW.nullable(),batteryPercent:i().min(0).max(100).nullable(),lastChangedAt:i()}),_W={name:`presence`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Presence],methods:{},status:{schema:gW,kind:`push`},runtimeState:gW,durability:`restored`,volatileStateFields:[`lastChangedAt`]},vW=d({hpa:i(),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),yW={name:`pressure-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:vW,kind:`push`},runtimeState:vW,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},bW=p(`kind`,[dE,fE]),xW=d({id:i(),enabled:C(),shape:bW}),SW=d({enabled:C(),regions:S(xW).nullable(),audioEnabled:C().nullable(),lastFetchedAt:i()}),CW=d({maxRegions:i(),supportedShapes:S(gE),polygonVertices:_E.optional(),supportsAudioMute:C()}),wW=d({enabled:C().optional(),regions:S(xW).optional()}),TW={name:`privacy-mask`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/privacy-mask-grid`,tab:`image`,label:`Privacy Mask`}},methods:{getOptions:D(d({deviceId:i()}),CW),setMask:D(d({deviceId:i(),patch:wW}),v(),{kind:`mutation`,auth:`admin`}),setAudioEnabled:D(d({deviceId:i(),enabled:C()}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:SW,kind:`poll`},runtimeState:SW,durability:`restored`,volatileStateFields:[`lastFetchedAt`]};function EW(e){return e.length===0?null:e.some(e=>e.audioEnabled)}var DW=x([`home`,`day-mode`,`night-mode`,`day-night-auto`,`set-limits`,`save-limits`,`reboot`,`osd-menu`]),OW=d({id:l(),name:l(),fn:DW.nullable(),writable:C()}),kW=d({pan:i().nullable(),tilt:i().nullable(),zoom:i().nullable()}),AW=d({pan:i().optional(),tilt:i().optional(),zoom:i().optional(),speed:i().optional()}),jW=kW.extend({autofocus:C()}),MW=d({hasPan:C(),hasTilt:C(),hasZoom:C(),supportsPresets:C(),maxPresets:i().optional(),hasAutofocus:C(),speedSteps:i().int().positive().nullable(),moveImpulseMs:i().int().positive().nullable()}),NW=d({presetId:l().nullable(),source:x([`operator`,`firmware`,`native`,`none`])}),PW=d({enabled:C(),seconds:i().int()}),FW={name:`ptz`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-panel`,tab:`ptz`,topTab:!0,label:`PTZ`,order:0}},methods:{move:D(AW.extend({deviceId:i()}),v(),{kind:`mutation`}),continuousMove:D(AW.extend({deviceId:i()}),v(),{kind:`mutation`}),stop:D(d({deviceId:i()}),v(),{kind:`mutation`}),getPresets:D(d({deviceId:i()}),S(OW)),goToPreset:D(d({deviceId:i(),presetId:l()}),v(),{kind:`mutation`}),savePreset:D(d({deviceId:i(),presetId:l(),name:l()}),v(),{kind:`mutation`,auth:`admin`}),deletePreset:D(d({deviceId:i(),presetId:l()}),v(),{kind:`mutation`,auth:`admin`}),getOptions:D(d({deviceId:i()}),MW),goHome:D(d({deviceId:i()}),v(),{kind:`mutation`}),getHomePreset:D(d({deviceId:i()}),NW),setHomePreset:D(d({deviceId:i(),presetId:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),captureHomeHere:D(d({deviceId:i()}),v(),{kind:`mutation`,auth:`admin`}),getHomeReturn:D(d({deviceId:i()}),PW.nullable()),setHomeReturn:D(d({deviceId:i(),enabled:C(),seconds:i().int().min(0).max(3600)}),v(),{kind:`mutation`,auth:`admin`}),getPosition:D(d({deviceId:i()}),kW),setAutofocus:D(d({deviceId:i(),enabled:C()}),v(),{kind:`mutation`})},status:{schema:jW,kind:`command-driven`}},IW=d({targetType:l().describe(`Vendor target string (people/vehicle/pet); empty = camera default`),stopDelaySeconds:i().int().min(0).max(300),disappearDelaySeconds:i().int().min(0).max(300)}),LW=d({value:l(),label:l()}),RW=d({enabled:C(),lastChangedAt:i(),currentSettings:IW.nullable(),supportedTargetTypes:S(LW)}),zW=RW.extend({lastFetchedAt:i()}),BW={name:`ptz-autotrack`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!1,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-autotrack`,tab:`ptz`,topTab:!0,label:`Auto-Tracking`,order:5}},methods:{getStatus:D(d({deviceId:i()}),RW),setEnabled:D(d({deviceId:i(),enabled:C()}),v(),{kind:`mutation`}),getSettings:D(d({deviceId:i()}),IW.nullable()),setSettings:D(d({deviceId:i(),settings:IW.partial()}),v(),{kind:`mutation`})},events:{onStatusChanged:{data:d({deviceId:i(),status:RW})}},status:{schema:RW,kind:`command-driven`},runtimeState:zW,durability:`session`},VW={name:`reboot`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera,k.Sensor,k.Switch],methods:{reboot:D(d({deviceId:i().int().nonnegative()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`})}},HW=`camstack`,UW=`recorder`,WW=d({profile:l(),startMs:i(),endMs:i()}),GW=x([`read`,`unreadable`]),KW=d({deviceId:i(),read:GW,ranges:S(WW),profilesWithFootage:S(l())}),qW=d({deviceId:i(),read:GW,days:S(i())}),JW=d({deviceId:i(),localMasterPath:l().nullable(),playbackUrl:l().nullable(),playbackEndpoints:S(l())}),YW=d({state:x([`ok`,`sleeping`,`unreachable`,`no-storage`,`index-empty`]),reason:l().optional(),coverageAsOf:i().optional()}),XW=d({source:l(),label:l(),addonId:l().optional(),availability:YW}),ZW=d({transport:x([`archive`,`stream`,`realtime`]),coverage:x([`continuous`,`sparse`]),seek:x([`free`,`forward`,`segment`]),stepBack:C(),scrub:C(),rates:S(i().positive()).min(1).readonly(),exclusive:C()}),QW=p(`kind`,[d({kind:m(`hls`),manifest:JW}),d({kind:m(`clip`),source:l(),clipId:l(),startsAtMs:i()}),d({kind:m(`none`),reason:l()})]),$W={name:`recording`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],methods:{listSources:D(d({deviceId:i()}),S(XW).readonly(),{kind:`query`,auth:`protected`}),getAvailability:D(d({deviceId:i(),provider:l().min(1),fromMs:i(),toMs:i(),profile:l().optional()}),KW,{kind:`query`,auth:`protected`}),getDaysWithRecordings:D(d({deviceId:i(),provider:l().min(1),fromMs:i(),toMs:i(),tzOffsetMinutes:i()}),qW,{kind:`query`,auth:`protected`}),getPlayback:D(d({deviceId:i(),provider:l().min(1),fromMs:i(),toMs:i(),profile:E.optional()}),QW,{kind:`query`,auth:`protected`}),getPlaybackOptions:D(d({deviceId:i(),provider:l().min(1)}),ZW,{kind:`query`,auth:`protected`})}},eG=d({deviceId:i(),enabled:C(),activeMode:cu,nodeId:l(),storageBytes:i()}),tG=200,nG=d({deviceId:i(),read:x([`read`,`unreadable`]),ranges:S(WW).readonly(),profilesWithFootage:S(l()).readonly()}),rG=d({deviceId:i(),read:x([`read`,`unreadable`]),days:S(i()).readonly()}),iG=d({deviceId:i(),usedBytes:i(),oldestMs:i().nullable().optional(),segments:i().optional(),residentBytes:i().optional(),residentOldestMs:i().nullable().optional()}),aG=d({locationId:l().nullable(),locationIds:S(l()).optional(),root:l().optional(),usedBytes:i(),availableBytes:i().nullable(),totalBytes:i().nullable()}),oG=d({nodeId:l(),totalUsedBytes:i(),devices:S(iG),devicesRead:x([`archive`,`unavailable`]).optional(),complete:C().optional(),locations:S(aG).optional()}),sG=d({deviceId:i(),profile:l(),fromLocationId:l(),toLocationId:l(),bytes:i(),files:i().int()}),cG=x([`unassigned`,`target-not-writable`,`below-threshold`,`no-headroom`]),lG=d({deviceId:i(),profile:l(),fromLocationId:l(),toLocationId:l().nullable(),bytes:i(),reason:cG}),uG=d({moves:S(sG),skipped:S(lG),bytesToMove:i(),jobIds:S(l())}),dG=d({throttleMbps:i().min(1).max(1e3).optional(),minMoveGb:i().min(0).optional()}),fG=d({deviceId:i().int(),profile:l(),locationId:l()}),pG=d({deviceId:i().int(),locationId:l()}),mG=d({assignments:S(fG),pins:S(pG),defaultLocations:y(l(),l())}),hG=d({deviceId:i().int(),locationId:l().nullable()}),gG=p(`kind`,[d({kind:m(`segment`),startMs:i(),durMs:i(),bytes:i()}),d({kind:m(`gap`),nearestEdgeMs:i().nullable(),prevEndMs:i().nullable().optional()})]),_G=d({data:b(Uint8Array)}),vG=d({data:b(Uint8Array),gopStartMs:i(),gopDurMs:i()}),yG=p(`kind`,[d({kind:m(`ok`),data:b(Uint8Array),gopStartMs:i(),gopDurMs:i(),reachesRequestedEnd:C()}),d({kind:m(`spans-multiple-segments`),segmentEndMs:i()})]),bG={name:`recording-archive`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,status:{schema:eG,kind:`command-driven`},methods:{getAvailabilityBatch:D(d({deviceIds:S(i()).min(1).max(200),fromMs:i(),toMs:i()}),S(nG).readonly(),{kind:`query`,auth:`protected`}),getDaysWithRecordingsBatch:D(d({deviceIds:S(i()).min(1).max(200),fromMs:i(),toMs:i(),tzOffsetMinutes:i()}),S(rG).readonly(),{kind:`query`,auth:`protected`}),getStorageUsage:D(d({}),oG,{kind:`query`,auth:`admin`}),getDeviceConfig:D(d({deviceId:i()}),Su,{kind:`query`,auth:`protected`}),locateSegment:D(d({deviceId:i(),profile:l(),epochMs:i()}),gG,{kind:`query`,auth:`admin`}),readSegmentBytes:D(d({deviceId:i(),profile:l(),startMs:i()}),_G,{kind:`query`,auth:`admin`}),readGopBytes:D(d({deviceId:i(),profile:l(),startMs:i(),epochMs:i()}),vG,{kind:`query`,auth:`admin`}),readWindowBytes:D(d({deviceId:i(),profile:l(),startMs:i(),fromMs:i(),toMs:i()}),yG,{kind:`query`,auth:`admin`}),setDeviceConfig:D(d({deviceId:i(),config:Su}),Su,{kind:`mutation`,auth:`admin`}),rescanStorage:D(d({deviceId:i()}),eG,{kind:`mutation`,auth:`admin`}),pruneFootage:D(d({deviceId:i(),reason:Yl.optional()}),d({floorMs:i().nullable(),deletedBuckets:i().int(),reclaimedBytes:i().int()}),{kind:`mutation`,auth:`admin`}),deleteFootprint:D(d({deviceId:i(),fromMs:i().optional(),toMs:i().optional()}),d({deletedBuckets:i().int(),reclaimedBytes:i().int()}),{kind:`mutation`,auth:`admin`}),listOpsLog:D(Zl,S(Xl).readonly(),{kind:`query`,auth:`admin`}),renderGif:D(d({deviceId:i(),aroundMs:i(),preRollSec:i().min(0).max(30).default(2),postRollSec:i().min(0).max(30).default(5),maxWidth:i().int().min(120).max(1280).default(480),fps:i().int().min(1).max(15).default(5)}),d({gifBase64:l(),fromMs:i(),toMs:i()}),{kind:`mutation`,auth:`admin`}),renderClip:D(d({deviceId:i(),aroundMs:i(),preRollSec:i().min(0).max(30).default(3),postRollSec:i().min(0).max(30).default(7),maxWidth:i().int().min(160).max(1920).default(640)}),d({clipBase64:l(),mime:l(),fromMs:i(),toMs:i(),bytes:i().int()}),{kind:`mutation`,auth:`admin`}),pauseForStorageMigration:D(Iu,d({paused:m(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:D(Iu,d({resumed:m(!0)}),{kind:`mutation`,auth:`admin`}),refreshStorageLocationsForMigration:D(Iu,d({refreshed:m(!0)}),{kind:`mutation`,auth:`admin`}),startStorageMigrationMove:D(Lu,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),getStorageMigrationMoveStatus:D(d({jobId:l()}),Nu.nullable(),{auth:`admin`}),cancelStorageMigrationMove:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),relocateFootage:D(Fu,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),listRelocateJobs:D(d({}),S(Nu).readonly(),{kind:`query`,auth:`admin`}),getRelocateResidue:D(od,sd,{kind:`query`,auth:`admin`}),reconcileLedgerAgainstDisk:D(cd,pd,{kind:`mutation`,auth:`admin`}),cancelRelocateJob:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),planStorageRebalance:D(dG,uG,{kind:`query`,auth:`admin`}),startStorageRebalance:D(dG,uG,{kind:`mutation`,auth:`admin`}),getPlacement:D(d({}),mG,{kind:`query`,auth:`admin`}),setDevicePlacement:D(hG,d({ok:m(!0)}),{kind:`mutation`,auth:`admin`})}},xG=i().min(.25).max(32),SG=d({fromSec:i().nonnegative(),toSec:i().nonnegative()}).refine(e=>e.toSec>e.fromSec,{message:`dense range must have toSec > fromSec`}),CG=200,wG=d({everyMs:i().int().positive(),ranges:S(SG).min(1).max(200)}),TG=d({everyMs:i().int().positive(),outputFps:i().int().min(1).max(60).optional(),dense:wG.optional()}).superRefine((e,t)=>{e.dense!==void 0&&e.dense.everyMs>=e.everyMs&&t.addIssue({code:se.custom,message:`dense.everyMs must be strictly smaller than the base everyMs`,path:[`dense`,`everyMs`]})}),EG=d({speed:xG.optional(),timelapse:TG.optional(),includeAudio:C(),maxLifeMs:i().int().positive(),deleteAfterDownload:C(),title:l().max(200).optional(),notifyTargetIds:S(l().min(1)).max(20).optional()}).superRefine((e,t)=>{e.speed!==void 0&&e.timelapse!==void 0&&t.addIssue({code:se.custom,message:`speed and timelapse are mutually exclusive`,path:[`timelapse`]})}),DG=x([`queued`,`rendering`,`ready`,`failed`,`expired`,`deleted`]),OG=d({kind:m(`footage`),deviceId:i(),profiles:S(l()).min(1),fromMs:i(),toMs:i()}),kG=d({kind:m(`clip`),deviceId:i(),provider:l().min(1),source:l().min(1),sourceLabel:l().min(1),clipId:l().min(1),catalogWindow:d({sinceMs:i(),untilMs:i()}),profile:x([`high`,`mid`,`low`]),wake:RL.optional()}),AG=p(`kind`,[OG,kG]),jG=d({id:l(),deviceId:i(),profile:l(),fromMs:i(),toMs:i(),subject:AG.optional(),options:EG,state:DG,progressPct:i().nullable(),fileBytes:i().nullable(),expiresAt:i(),deleteAfterDownload:C(),downloadedAt:i().nullable(),createdAt:i(),createdBy:l(),error:l().nullable()}),MG=x([`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 NG(e,t){return t.length>0?`${e}: ${t}`:e}function PG(e){if(e===null)return null;let t=e.split(`:`,1)[0]??``,n=MG.safeParse(t.trim());return n.success?n.data:null}var FG=d({url:l(),endpoints:S(l())}),IG=50*1024*1024,LG=d({base64:l(),contentType:l(),name:l(),bytes:i().int().nonnegative()});function RG(e){return e.profiles!==void 0&&e.profiles.length>0?[...e.profiles]:typeof e.profile==`string`&&e.profile.length>0?[e.profile]:[]}var zG=d({deviceId:i(),profile:l().optional(),profiles:S(l()).min(1).optional(),fromMs:i().optional(),toMs:i().optional(),subject:AG.optional(),options:EG}).superRefine((e,t)=>{if(e.subject?.kind===`clip`){e.subject.deviceId!==e.deviceId&&t.addIssue({code:se.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:se.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:se.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:se.custom,message:`a footage export needs fromMs and toMs`,path:[`fromMs`]}),(e.subject?.kind===`footage`?[...e.subject.profiles]:RG(e)).length<1&&t.addIssue({code:se.custom,message:`pass profiles[] (min 1) or legacy profile`,path:[`profiles`]})});function BG(e){if(e.subject!==void 0)return e.subject;let t=RG(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 VG(e){return e.subject===void 0?{kind:`footage`,deviceId:e.deviceId,profiles:[e.profile],fromMs:e.fromMs,toMs:e.toMs}:e.subject}var HG={name:`recording-export`,scope:`system`,mode:`singleton`,methods:{createExport:D(zG,jG,{kind:`mutation`,auth:`protected`}),listExports:D(d({deviceId:i().optional()}),S(jG),{kind:`query`,auth:`protected`}),getExport:D(d({exportId:l()}),jG,{kind:`query`,auth:`protected`}),cancelExport:D(d({exportId:l()}),jG,{kind:`mutation`,auth:`protected`}),deleteExport:D(d({exportId:l()}),jG,{kind:`mutation`,auth:`protected`}),getDownloadUrl:D(d({exportId:l()}),FG,{kind:`query`,auth:`protected`}),readExportBytes:D(d({exportId:l()}),LG,{kind:`query`,auth:`protected`})}},UG=x([`continuous`,`motion`,`person`,`vehicle`,`animal`,`lineCrossing`,`intrusion`,`loitering`,`alarmInput`]),WG=d({trigger:UG,day:i().int().min(0).max(6),startMinute:i().int().min(0).max(1439),endMinute:i().int().min(1).max(1440)}),GG=d({id:l(),label:l().optional(),status:x([`ok`,`unformatted`,`error`,`offline`,`unknown`]),capacityMb:i().nullable(),freeMb:i().nullable(),writable:C().optional()}),KG=p(`kind`,[d({kind:m(`present`),volumes:S(GG)}),d({kind:m(`absent`),reason:l()}),d({kind:m(`unknown`),reason:l()})]),qG=d({id:l(),enabled:C(),isVideo:C(),codec:l().nullable(),resolution:l().nullable(),overwriteWhenFull:C().nullable()}),JG=d({storage:KG,tracks:S(qG),primaryTrackId:l().nullable(),enabled:C().nullable(),overwriteWhenFull:C().nullable(),preRecordSec:i().nullable(),postRecordSec:i().nullable(),segmentMinutes:i().nullable(),windows:S(WG),unreadableWindows:i(),recordingToNowhere:C(),lastFetchedAt:i()}),YG=d({min:i(),max:i(),step:i()}),XG=d({values:S(i()).min(1),sentinel:d({value:i(),meaning:x([`no-limit`,`disabled`])}).optional()}),ZG=d({readable:C(),writable:C(),reason:l().optional()}),QG=d({support:ZG,granularityMinutes:i(),triggers:S(UG),supportsOverlappingTriggers:C()}),$G=d({enabled:ZG,overwriteWhenFull:ZG,preRecordSec:ZG,preRecordSecRange:YG.optional(),preRecordSecAllowed:XG.optional(),postRecordSec:ZG,postRecordSecRange:YG.optional(),postRecordSecAllowed:XG.optional(),segmentMinutes:ZG,segmentMinutesRange:YG.optional(),segmentMinutesAllowed:XG.optional(),schedule:QG}),eK=d({enabled:C().optional(),overwriteWhenFull:C().optional(),preRecordSec:i().optional(),postRecordSec:i().optional(),segmentMinutes:i().optional(),windows:S(WG).optional()}),tK={name:`recording-onboard`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`recording-onboard`,tab:`recording`}},methods:{getOptions:D(d({deviceId:i()}),$G),setSettings:D(d({deviceId:i(),settings:eK}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:JG,kind:`poll`},runtimeState:JG,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},nK=1440,rK=7,iK=24,aK=168,oK=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`];function sK(e,t){if(t.enabled!==void 0&&!e.enabled.writable)return cK(`the master recording switch`,e.enabled.reason);if(t.overwriteWhenFull!==void 0&&!e.overwriteWhenFull.writable)return cK(`overwrite-when-full`,e.overwriteWhenFull.reason);let n=lK(`pre-record seconds`,t.preRecordSec,e.preRecordSec,e.preRecordSecRange,e.preRecordSecAllowed);if(n)return n;let r=lK(`post-record seconds`,t.postRecordSec,e.postRecordSec,e.postRecordSecRange,e.postRecordSecAllowed);if(r)return r;let i=lK(`segment length (minutes)`,t.segmentMinutes,e.segmentMinutes,e.segmentMinutesRange,e.segmentMinutesAllowed);if(i)return i;if(t.windows!==void 0){let n=uK(e,t.windows);if(n)return n}return null}function cK(e,t){return t?`this camera cannot change ${e}: ${t}`:`this camera cannot change ${e}`}function lK(e,t,n,r,i){if(t===void 0)return null;if(!n.writable)return cK(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 uK(e,t){let n=e.schedule;if(!n.support.writable)return cK(`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 ${fK(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 ${fK(e.day)} window ${pK(e.startMinute)}–${pK(e.endMinute)} is not aligned to them`}if(!n.supportsOverlappingTriggers){let e=dK(t);if(e)return`this camera stores one trigger per time range, so "${e.a.trigger}" and "${e.b.trigger}" cannot both cover ${fK(e.a.day)} ${pK(Math.max(e.a.startMinute,e.b.startMinute))}–${pK(Math.min(e.a.endMinute,e.b.endMinute))}`}return null}function dK(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 fK(e){return oK[e]??`day ${String(e)}`}function pK(e){let t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`}function mK(e,t){return e*24+t}function hK(e){if(e.length===0)return!0;let t=e[0];for(let n of e)if(n!==t)return!1;return!0}function gK(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[mK(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 _K(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[mK(r.day,t)]=`1`}return n.join(``)}function vK(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 yK(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 bK(e){let t=e.trim().toLowerCase(),n=oK.findIndex(e=>e.toLowerCase()===t);return n>=0?n:null}function xK(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 SK=d({active:C(),reason:l(),lastChangedAt:i()}),CK=SK.extend({lastFetchedAt:i()}),wK={name:`recording-signal`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{getStatus:D(d({deviceId:i()}),SK)},status:{schema:SK,kind:`push`,empty:{active:!1,reason:`unknown`,lastChangedAt:0}},runtimeState:CK,durability:`session`},TK=[{capName:`recording`,sourceId:`camstack`,addonId:`recorder`}];function EK(e,t){for(let n of TK)if(n.capName===e&&n.sourceId===t)return n.addonId;return null}var DK=l(),OK=[`day`,`ir`,`night`,`dawn`,`dusk`],kK=x([`skip`,`judge-anyway`]),AK=`__diverged__`,jK=x([`matched`,`diverged`,`unknown`]),MK=x([`no-reference-for-condition`,`view-shifted`,`no-vision-profile`,`encoder-model-changed`,`no-snapshot`]),NK=d({embedding:S(i()),modelId:l(),condition:DK,capturedAt:i(),thumbnailMediaId:i().int().optional(),anchorEmbedding:S(i()).optional()}),PK=d({id:l(),label:l(),references:S(NK),textPrompts:S(l()).optional(),referenceCount:i(),currentlyMatched:C()}),FK=p(`mode`,[d({mode:m(`similarity`),threshold:i().min(0).max(1),hysteresisCount:i().int().positive()}),d({mode:m(`llm`),prompt:l(),profileId:l().optional(),hysteresisCount:i().int().positive()})]),IK=60,LK=120,RK=60,zK=.85,BK=`skip`,VK=8e3,HK=448,UK=!0,WK=d({enabled:C().default(!1),prompt:l().min(1).max(1e3),profileId:l().optional(),timeoutMs:i().int().min(1e3).max(2e4).default(VK),maxImagePx:i().int().min(64).max(2048).default(448),onTimeout:x([`flip`,`hold`]).default(`hold`)}),GK=d({id:l(),label:l(),roi:dE,enabled:C(),triggerMode:x([`periodic`,`on-motion`,`both`]),checkIntervalSec:i().optional(),check:FK,states:S(PK),currentStateId:l().nullable(),lastCheckedAt:i().nullable(),lastConfidence:i().nullable(),currentCondition:DK.nullable(),availability:x([`ok`,`unavailable`]),unavailableReason:l().nullable(),baselineStateId:l().nullable(),emit:x([`latched`,`live`]).default(`latched`),verdict:jK,latched:C(),armedAt:i(),divergedAt:i().nullable(),restoredAt:i().nullable(),quietSeconds:i().int().min(0).max(3600).default(60),minObservationSpacingSec:i().int().min(0).max(3600).default(120),confirm:WK.optional(),anchorThreshold:i().min(0).max(1).default(zK),autoRestore:C().default(!1),onUncoveredCondition:kK.default(BK),suspendedCondition:DK.nullable().default(null),unavailable:MK.nullable(),coveredConditions:S(DK)}),KK=d({monitors:S(GK),lastFetchedAt:i()}),qK=d({deviceId:i(),status:KK.nullable()}),JK={name:`scene-monitor`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],methods:{listScenes:D(d({deviceId:i()}),KK),listScenesBatch:D(d({deviceIds:S(i()).min(1).max(200)}),S(qK).readonly()),createScene:D(d({deviceId:i(),label:l(),roi:dE,check:FK,triggerMode:x([`periodic`,`on-motion`,`both`]).optional(),checkIntervalSec:i().optional()}),GK,{kind:`mutation`,auth:`admin`}),updateScene:D(d({deviceId:i(),monitorId:l(),patch:d({label:l().optional(),roi:dE.optional(),enabled:C().optional(),triggerMode:x([`periodic`,`on-motion`,`both`]).optional(),checkIntervalSec:i().optional(),check:FK.optional(),emit:x([`latched`,`live`]).optional(),quietSeconds:i().int().min(0).max(3600).optional(),minObservationSpacingSec:i().int().min(0).max(3600).optional(),anchorThreshold:i().min(0).max(1).optional(),autoRestore:C().optional(),onUncoveredCondition:kK.optional(),confirm:WK.nullable().optional()})}),v(),{kind:`mutation`,auth:`admin`}),deleteScene:D(d({deviceId:i(),monitorId:l()}),v(),{kind:`mutation`,auth:`admin`}),captureReference:D(d({deviceId:i(),monitorId:l(),stateId:l().optional(),label:l().optional(),condition:DK.optional()}),d({stateId:l(),referenceCount:i()}),{kind:`mutation`,auth:`admin`}),deleteReference:D(d({deviceId:i(),monitorId:l(),stateId:l(),index:i()}),v(),{kind:`mutation`,auth:`admin`}),recheckNow:D(d({deviceId:i(),monitorId:l()}),v(),{kind:`mutation`,auth:`admin`}),resetScene:D(d({deviceId:i(),monitorId:l(),recapture:C().optional()}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:KK,kind:`push`},runtimeState:KK,durability:`session`},YK=x([`include`,`exclude`]),XK=d({id:l(),name:l().optional(),zoneIds:S(l()).min(1).readonly(),mode:YK,classFilter:S(l()).readonly().optional(),overlapThreshold:i().min(0).max(1).optional(),bboxInclusionPct:i().min(0).max(100).optional(),preferMask:C().optional(),enabled:C().default(!0)}),ZK=S(XK).readonly(),QK=d({isRunning:C(),lastRunAt:i(),lastRunSuccess:C().nullable(),lastError:l().nullable(),lastChangedAt:i()}),$K={name:`script-runner`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Script],methods:{run:D(d({deviceId:i().int().nonnegative(),variables:y(l(),o()).optional()}),v(),{kind:`mutation`,auth:`admin`}),stop:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:QK,kind:`push`},runtimeState:QK,durability:`session`},eq=d({detected:C(),lastChangedAt:i()}),tq={name:`smoke`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:eq,kind:`push`},runtimeState:eq,durability:`restored`,volatileStateFields:[`lastChangedAt`]},nq=d({camStreamId:l().min(1),kind:Kn,url:l().optional(),codec:l().optional(),resolution:qn.optional(),fps:i().positive().optional(),label:l().optional(),deviceFeatures:S(l()).optional(),autoEligible:C().optional(),profileHint:E.optional(),metadata:y(l(),o()).optional()}),rq=d({descriptors:S(nq),lastFetchedAt:i()}),iq={name:`stream-catalog`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{getCatalog:D(d({deviceId:i().int().nonnegative()}),S(nq).readonly())},runtimeState:rq,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},aq=x([`main`,`sub`,`ext`]),oq=d({width:i(),height:i(),codec:x([`h264`,`h265`]),framerate:i(),bitrate:i(),bitrateMode:x([`vbr`,`cbr`]).optional(),encoderProfile:x([`high`,`main`,`baseline`]).optional(),gop:i().optional(),audio:C().optional()}),sq=d({main:oq.optional(),sub:oq.optional(),ext:oq.optional(),lastFetchedAt:i()}),cq=d({resolutions:S(d({width:i(),height:i()})),codecs:S(x([`h264`,`h265`])),framerates:S(i()),bitrates:S(i()),bitrateRange:u([i(),i()]).optional(),supportsBitrateMode:C(),supportsEncoderProfile:C(),supportsGop:C(),gop:d({min:i(),max:i(),step:i()}).optional()}),lq=d({main:cq.optional(),sub:cq.optional(),ext:cq.optional()}),uq=d({width:i().optional(),height:i().optional(),codec:x([`h264`,`h265`]).optional(),framerate:i().optional(),bitrate:i().optional(),bitrateMode:x([`vbr`,`cbr`]).optional(),encoderProfile:x([`high`,`main`,`baseline`]).optional(),gop:i().optional()}),dq={name:`stream-params`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`stream-params`,tab:`streaming`}},methods:{getOptions:D(d({deviceId:i()}),lq),setProfile:D(d({deviceId:i(),profile:aq,patch:uq}),v(),{kind:`mutation`,auth:`admin`}),getConfigSchema:D(d({deviceId:i()}),o().nullable())},status:{schema:sq,kind:`poll`},runtimeState:sq,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},fq=[{profile:`main`,prefix:`streamMain`,label:`Main stream`},{profile:`sub`,prefix:`streamSub`,label:`Sub stream`},{profile:`ext`,prefix:`streamExt`,label:`Third stream`}];function pq(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 mq(e,t){let n=[];for(let r of fq){let i=e[r.profile];if(!i)continue;let a=pq(r,i,t?.[r.profile]);a&&n.push(a)}return n.length===0?null:{sections:n}}function hq(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 gq=d({on:C(),lastChangedAt:i()}),_q={name:`switch`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Switch,k.Siren,k.Light],methods:{setState:D(d({deviceId:i(),on:C()}),v(),{kind:`mutation`,auth:`protected`})},events:{onStateChanged:{data:d({deviceId:i(),on:C(),lastChangedAt:i()})}},status:{schema:gq,kind:`command-driven`},runtimeState:gq,durability:`restored`,volatileStateFields:[`lastChangedAt`],settings:{bindings:[{kind:`scalar`,statusPath:`on`,method:`setState`,valueArg:`on`,field:{label:`On`,kind:`boolean`}}]}},vq=d({streaming:C(),notifications:C(),objectDetection:C(),remoteAccess:C(),agentCluster:C(),smartHome:C(),recordings:C(),backup:C(),repl:C()}),yq=d({status:m(`ok`),uptime:i()}),bq=d({name:l(),address:l(),family:l(),internal:C()}),xq=x([`operator-set`,`derived-from-ip`]),Sq=d({latitude:i().min(-90).max(90),longitude:i().min(-180).max(180),source:xq,updatedAt:i(),label:l().optional()}),Cq=d({location:Sq.nullable(),derivationAttemptedAt:i().nullable(),derivationError:l().nullable()}),wq=d({latitude:i().min(-90).max(90),longitude:i().min(-180).max(180)}).nullable(),Tq=x([`http`,`ws`,`mesh`,`unknown`]),Eq=d({http:i(),ws:i(),mesh:i(),unknown:i()}),Dq=d({plane:Tq,procedure:l(),userAgent:l(),ip:l(),principal:l(),calls:i(),subscriptions:i(),perMin:i()}),Oq=d({procedure:l(),calls:i(),planes:Eq,subscriptions:i(),perMin:i()}),kq=d({armed:C(),elapsedMs:i(),windowMs:i(),armedUntilMs:i(),httpRequests:i(),batchedRequests:i(),procedureCalls:i(),planes:Eq,planesExplainTotal:C(),wsConnections:i(),wsMessages:i(),subscriptions:i(),subscriptionStops:i(),distinctGroups:i(),unattributedCalls:i(),procedures:S(Oq).readonly(),groups:S(Dq).readonly()}),Aq=kq.extend({persisted:C()}),jq=x([`debug`,`info`,`warn`,`error`]),Mq=x([`request-census`]),Nq=x([`cluster`,`node`,`component`]),Pq=x([`default`,`cluster`,`node`,`component`]),Fq=d({scope:Nq,nodeId:l().nullable(),component:l().nullable(),level:jq.nullable()}),Iq=d({level:jq,levelSource:Pq}),Lq=d({layers:S(Fq).readonly()}),Rq=d({id:Mq,armed:C(),armedUntilMs:i(),remainingMs:i(),persisted:C()}),zq=d({id:Mq,armMs:i().int().min(0),reportEveryMs:i().int().positive().optional()}),Bq=d({channel:l(),armed:C(),armedUntilMs:i(),remainingMs:i(),deviceIds:S(i().int()).readonly().nullable()}),Vq=d({channel:l().min(1),armMs:i().int().min(0),deviceIds:S(i().int()).readonly().nullable().optional()}),Hq=d({level:jq.nullable().optional(),diagnostics:S(zq).readonly().optional(),channels:S(Vq).readonly().optional(),opsLogRetentionDays:i().int().min(0).max(3650).optional()}),Uq=gw.extend({addonId:l()}),Wq=RS.extend({addonId:l()}),Gq=d({scopeNodeId:l().optional(),scopeComponent:l().optional()}),Kq=d({scopeNodeId:l().optional(),scopeComponent:l().optional(),patch:Hq}),qq=d({scopeNodeId:l().nullable(),scopeComponent:l().nullable(),effective:Iq,explicit:Lq,activeWindows:S(Rq).readonly(),channels:S(Zd).readonly(),activeChannels:S(Bq).readonly(),opsLogRetentionDays:i().int().min(0),persisted:C()}),Jq={name:`system`,scope:`system`,mode:`singleton`,methods:{info:D(v(),vq),health:D(v(),yq),featureFlags:D(v(),vq),networkAddresses:D(v(),S(bq).readonly()),getRetentionConfig:D(v(),o().nullable(),{auth:`admin`}),setRetentionConfig:D(y(l(),o()),re(),{kind:`mutation`,auth:`admin`}),forceRetentionCleanup:D(v(),v(),{kind:`mutation`,auth:`admin`}),getSiteLocation:D(v(),Cq),setSiteLocation:D(wq,Cq,{kind:`mutation`,auth:`admin`}),detectSiteLocation:D(v(),Cq,{kind:`mutation`,auth:`admin`}),getRequestCensus:D(v(),Aq,{auth:`admin`}),getLoadContributions:D(v(),S(Uq).readonly(),{auth:`admin`}),getFailureContributions:D(v(),S(Wq).readonly(),{auth:`admin`}),getLoggingSettings:D(Gq,qq,{auth:`admin`}),setLoggingSettings:D(Kq,qq,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},Yq=d({tampered:C(),lastChangedAt:i()}),Xq={name:`tamper`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:Yq,kind:`push`},runtimeState:Yq,durability:`restored`,volatileStateFields:[`lastChangedAt`]},Zq=d({celsius:i(),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),Qq={name:`temperature-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor,k.Thermostat],methods:{},status:{schema:Zq,kind:`push`},runtimeState:Zq,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},$q=d({title:l(),message:l(),severity:x([`info`,`warning`,`critical`]),duration:i().optional(),action:d({label:l(),url:l()}).optional()}),eJ={name:`toast`,scope:`system`,mode:`singleton`,methods:{onToast:D(v(),$q,{kind:`subscription`})},mount:{kind:`server-provided`}},tJ=d({currentVersion:l().nullable(),availableVersion:l().nullable(),updatable:C(),state:l().nullable(),inProgress:C()}),nJ={name:`update`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Update],methods:{installUpdate:D(v(),v(),{kind:`mutation`,auth:`admin`})},status:{schema:tJ,kind:`poll`},runtimeState:tJ,durability:`session`},rJ=d({id:l(),username:l(),isAdmin:C().default(!1),allowedProviders:f([S(l()),m(`*`)]),allowedDevices:y(l(),f([S(l()),m(`*`)])),scopes:S(J).default([]),totpEnabled:C().default(!1),createdAt:i(),updatedAt:i()}),iJ=d({username:l(),password:l().min(6),isAdmin:C().default(!1),allowedProviders:f([S(l()),m(`*`)]).optional(),allowedDevices:y(l(),f([S(l()),m(`*`)])).optional(),scopes:S(J).optional()}),aJ=d({id:l(),isAdmin:C().optional(),allowedProviders:f([S(l()),m(`*`)]).optional(),allowedDevices:y(l(),f([S(l()),m(`*`)])).optional(),scopes:S(J).optional()}),oJ=d({id:l(),label:l(),isAdmin:C().default(!1),allowedProviders:f([S(l()),m(`*`)]).optional(),allowedDevices:y(l(),f([S(l()),m(`*`)])).optional(),tokenPrefix:l(),createdAt:i(),lastUsedAt:i().optional()}),sJ=d({id:l(),userId:l(),name:l(),tokenPrefix:l(),scopes:S(J),expiresAt:i().nullish(),lastUsedAt:i().nullish(),createdAt:i()}),cJ=d({userId:l(),name:l(),scopes:S(J),expiresAt:i().optional()}),lJ=d({token:l(),record:sJ}),uJ=d({id:l(),userId:l(),username:l(),integrationId:l(),scopes:S(J),createdAt:i(),lastUsedAt:i(),revokedAt:i().nullable()}),dJ=d({secret:l(),otpauthUrl:l()}),fJ=d({enabled:C(),confirmedAt:i().nullable()}),pJ=d({provider:l(),subject:l(),issuer:l(),userId:l(),label:l().optional(),linkedAt:i()}),mJ=d({provider:l().min(1),subject:l().min(1)}),hJ={name:`user-management`,scope:`system`,mode:`singleton`,methods:{listUsers:D(v(),S(rJ),{auth:`admin`}),createUser:D(iJ,rJ,{kind:`mutation`,auth:`admin`,access:`create`}),updateUser:D(aJ,d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),deleteUser:D(d({id:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),resetPassword:D(d({id:l(),newPassword:l().min(6)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),setUserScopes:D(d({userId:l(),scopes:S(J)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),validateCredentials:D(d({username:l(),password:l()}),rJ.extend({passwordHash:l()}).nullable(),{kind:`mutation`,access:`view`}),listApiKeys:D(v(),S(oJ),{auth:`admin`}),revokeApiKey:D(d({id:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),createScopedToken:D(cJ,lJ,{kind:`mutation`,auth:`admin`,access:`create`}),revokeScopedToken:D(d({id:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateScopedToken:D(d({token:l()}),sJ.nullable(),{access:`view`}),listScopedTokens:D(d({userId:l()}),S(sJ),{auth:`admin`}),setupTotp:D(d({userId:l()}),dJ,{kind:`mutation`,auth:`admin`,access:`create`}),confirmTotp:D(d({userId:l(),code:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),disableTotp:D(d({userId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getTotpStatus:D(d({userId:l()}),fJ,{auth:`admin`}),verifyTotp:D(d({userId:l(),code:l()}),d({valid:C()}),{kind:`mutation`,access:`view`}),oauthIssueCode:D(d({integrationId:l(),userId:l(),username:l(),scopes:S(J),redirectUri:l(),hubUrl:l(),codeChallenge:l().optional(),refreshTtlSec:f([i().int().positive(),m(`never`)]).optional()}),d({code:l()}),{kind:`mutation`,access:`create`}),oauthExchangeCode:D(d({code:l(),redirectUri:l(),codeVerifier:l().optional()}),d({accessToken:l(),refreshToken:l(),expiresIn:i()}).nullable(),{kind:`mutation`,access:`view`}),oauthRefresh:D(d({refreshToken:l()}),d({accessToken:l(),refreshToken:l(),expiresIn:i()}).nullable(),{kind:`mutation`,access:`view`}),oauthVerifyAccessToken:D(d({token:l()}),d({userId:l(),username:l(),scopes:S(J)}).nullable(),{access:`view`}),listExternalIdentities:D(d({userId:l()}),S(pJ),{auth:`admin`}),findUserByExternalIdentity:D(mJ,d({userId:l(),issuer:l()}).nullable(),{auth:`admin`}),unlinkExternalIdentity:D(mJ.extend({userId:l()}),d({success:C()}),{kind:`mutation`,auth:`admin`,access:`delete`}),listOauthSessions:D(v(),S(uJ),{auth:`admin`}),revokeOauthSession:D(d({id:l()}),d({success:C()}),{kind:`mutation`,auth:`admin`,access:`delete`})}},gJ=x([`idle`,`cleaning`,`paused`,`returning`,`docked`,`drying`,`error`]),_J=d({level:i().min(0).max(100).nullable(),status:x([`ok`,`low`,`full`]).nullable()}),vJ=d({state:gJ,batteryLevel:i().min(0).max(100).nullable(),fanSpeed:l().nullable(),availableFanSpeeds:S(l()),cleanWater:_J.nullable(),dirtyWater:_J.nullable(),detergent:_J.nullable(),dustBin:_J.nullable(),progressPercent:i().min(0).max(100).nullable(),errorCode:i().nullable(),errorLabel:l().nullable(),lastChangedAt:i()}),yJ={name:`vacuum-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Vacuum],methods:{start:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),pause:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),stop:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),returnToBase:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),locate:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),setFanSpeed:D(d({deviceId:i().int().nonnegative(),speed:l().min(1)}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:vJ,kind:`push`},runtimeState:vJ,durability:`session`},bJ=x([`open`,`opening`,`closing`,`closed`,`stopped`]),xJ=d({state:bJ,position:i().min(0).max(100).nullable(),lastChangedAt:i()}),SJ={name:`valve`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Valve],methods:{open:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),close:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),stop:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),setPosition:D(d({deviceId:i().int().nonnegative(),position:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:xJ,kind:`push`},runtimeState:xJ,durability:`session`},CJ=d({detected:C(),lastChangedAt:i()}),wJ={name:`vibration`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:CJ,kind:`push`},runtimeState:CJ,durability:`restored`,volatileStateFields:[`lastChangedAt`]},TJ=d({currentTemp:i().nullable(),targetTemp:i().nullable(),operationMode:l().nullable(),availableModes:S(l()),away:C().nullable(),minTemp:i().nullable(),maxTemp:i().nullable(),lastChangedAt:i()}),EJ={name:`water-heater`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.WaterHeater],methods:{setTargetTemp:D(d({deviceId:i().int().nonnegative(),temp:i().finite()}),v(),{kind:`mutation`,auth:`protected`}),setOperationMode:D(d({deviceId:i().int().nonnegative(),mode:l().min(1)}),v(),{kind:`mutation`,auth:`protected`}),setAway:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:TJ,kind:`push`},runtimeState:TJ,durability:`session`},DJ=d({condition:l().nullable(),temperature:i().nullable(),temperatureUnit:l().nullable(),humidity:i().min(0).max(100).nullable(),pressure:i().nullable(),pressureUnit:l().nullable(),windSpeed:i().nullable(),windSpeedUnit:l().nullable(),windBearing:i().nullable(),lastFetchedAt:i()}),OJ={name:`weather`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Weather],methods:{},status:{schema:DJ,kind:`push`},runtimeState:DJ,durability:`session`},kJ=d({totalObjects:i().int().nonnegative(),byClass:y(l(),i().int().nonnegative()),standingObjects:i().int().nonnegative().optional(),transientObjects:i().int().nonnegative().optional()}),AJ=kJ.extend({zoneId:l(),zoneName:l(),trackIds:S(l()).readonly()}),jJ=d({id:l(),className:l(),bbox:d({x:i(),y:i(),w:i(),h:i()}),frameWidth:i().int().nonnegative(),frameHeight:i().int().nonnegative(),firstSeenAt:i().int(),becameStationaryAt:i().int(),lastConfirmedAt:i().int(),label:l().optional(),keyFrameMediaId:i().int().optional()}),MJ=d({ts:i().int(),frameWidth:i().int().nonnegative(),frameHeight:i().int().nonnegative(),zones:S(AJ).readonly(),frame:kJ,unzoned:kJ,stationaryObjects:S(jJ).readonly().optional()}),NJ=d({deviceId:i(),read:x([`read`,`unreadable`]),snapshot:MJ.nullable()}),PJ=x([`minute`,`5min`,`hour`]),FJ=d({from:i().int(),to:i().int(),resolution:PJ}),IJ=d({ts:i().int(),count:i().int().nonnegative()}),LJ={name:`zone-analytics`,scope:`device`,mode:`singleton`,deviceTypes:[k.Camera],methods:{getCurrentSnapshot:D(d({deviceId:i()}),MJ.nullable()),getCurrentSnapshotBatch:D(d({deviceIds:S(i()).min(1).max(200)}),S(NJ).readonly()),getZoneHistory:D(d({deviceId:i(),zoneId:l(),className:l().optional()}).extend(FJ.shape),S(IJ).readonly()),getCameraHistory:D(d({deviceId:i(),className:l().optional()}).extend(FJ.shape),S(IJ).readonly()),getUnzonedHistory:D(d({deviceId:i(),className:l().optional()}).extend(FJ.shape),S(IJ).readonly())},runtimeState:MJ,durability:`session`},RJ=x([`motion`,`detection`,`package`]),zJ={name:`zone-rules`,scope:`device`,mode:`singleton`,deviceTypes:[k.Camera],methods:{listRules:D(d({deviceId:i(),stage:RJ}),S(XK).readonly()),setRules:D(d({deviceId:i(),stage:RJ,rules:S(XK).readonly()}),v(),{kind:`mutation`,auth:`admin`})},runtimeState:d({motion:S(XK).readonly(),detection:S(XK).readonly(),package:S(XK).readonly()}),durability:`restored`},BJ=d({id:l(),label:l(),usdPerHour:i().nonnegative(),vramGb:i().nonnegative()}),VJ=d({id:l(),label:l(),priceMultiplier:i().positive()}),HJ=d({gpuType:l(),region:l(),costCapUsd:i().nonnegative(),maxRuntimeSec:i().int().positive(),failedDatasetGraceHours:i().nonnegative()}),UJ=o(),WJ=d({typeId:l(),label:l(),iconAsset:l(),addonId:l(),configSchema:UJ.optional()}),GJ=d({entryId:l(),typeId:l(),name:l(),addonId:l(),configured:C()}),KJ=d({addonId:l(),entryId:l(),typeId:l(),name:l(),iconAsset:l(),kind:l(),label:l(),gpuTypes:S(BJ).readonly(),regions:S(VJ).readonly(),maxDatasetBytes:i().int().positive(),maxRuntimeSec:i().int().positive(),freeTierNote:l().optional(),dataResidencyNote:l(),configured:C(),defaults:HJ,formValues:y(l(),o()).optional()}),qJ=d({entryId:l().min(1),name:l().min(1),tokenId:l().optional(),tokenSecret:f([l(),d({$secretClear:m(!0)})]).optional(),environment:l().optional(),gpuType:l().optional(),region:l().optional(),costCapUsd:i().nonnegative().optional(),maxRuntimeSec:i().int().positive().optional(),failedDatasetGraceHours:i().nonnegative().optional()}),JJ=d({ok:C(),account:l().optional(),reason:x([`missing`,`invalid`,`forbidden`,`network`,`quota`]).optional(),detail:l().optional()}),YJ=x([`pending`,`starting`,`running`,`succeeded`,`failed`,`cancelled`,`lost`]),XJ=d({jobKey:l(),providerJobId:l().optional(),state:YJ,startedAt:i().optional(),endedAt:i().optional(),exitCode:i().int().optional(),failureReason:l().optional(),gpuType:l(),region:l().optional(),billedSeconds:i().nonnegative(),costUsd:i().nonnegative(),costIsEstimate:C(),lastFetchedAt:i()}),ZJ=d({repo:l().min(1),revision:l().regex(/^[0-9a-f]{7,64}$/)}),QJ={entryId:l().min(1),jobKey:l().uuid()},$J=d({ts:i(),text:l()}),eY={name:`training-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{describe:D(d({}),S(KJ).readonly(),{auth:`admin`}),describeTypes:D(d({}),S(WJ).readonly(),{auth:`admin`}),listEntries:D(d({}),S(GJ).readonly(),{auth:`admin`}),createEntry:D(d({typeId:l().min(1),name:l().min(1)}),d({entryId:l()}),{kind:`mutation`,auth:`admin`}),deleteEntry:D(d({entryId:l().min(1)}),d({ok:m(!0)}),{kind:`mutation`,auth:`admin`}),updateEntry:D(qJ,d({ok:m(!0)}),{kind:`mutation`,auth:`admin`}),validateCredentials:D(d({entryId:l().min(1)}),JJ,{kind:`mutation`,auth:`admin`,timeoutMs:3e4}),estimateJob:D(d({entryId:l().min(1),gpuType:l(),region:l(),datasetBytes:i().int().nonnegative(),gpuSecondsLow:i().nonnegative(),gpuSecondsHigh:i().nonnegative()}),d({usdLow:i().nonnegative(),usdHigh:i().nonnegative(),notes:S(l()).readonly()}),{auth:`admin`}),uploadDataset:D(d({...QJ,ticket:En}),d({bytes:i().int().nonnegative(),sha256:l()}),{kind:`mutation`,auth:`admin`,timeoutMs:120*6e4}),submitJob:D(d({...QJ,trainer:ZJ,jobSpecJson:l().min(2).max(64e3),gpuType:l(),region:l(),maxRuntimeSec:i().int().positive()}),XJ,{kind:`mutation`,auth:`admin`,timeoutMs:30*6e4}),getJob:D(d(QJ),XJ,{auth:`admin`,timeoutMs:6e4}),listJobEvents:D(d({...QJ,cursor:l().optional(),max:i().int().min(1).max(500)}),d({lines:S($J).readonly(),cursor:l()}),{auth:`admin`,timeoutMs:6e4}),cancelJob:D(d(QJ),d({ok:m(!0)}),{kind:`mutation`,auth:`admin`,timeoutMs:6e4}),readResult:D(d(QJ),d({found:C(),text:l().optional()}),{kind:`mutation`,auth:`admin`,timeoutMs:5*6e4}),offerArtifact:D(d({...QJ,path:x([`bundle.tar`])}),d({ticket:En}),{kind:`mutation`,auth:`admin`,timeoutMs:5*6e4}),cleanupJob:D(d(QJ),d({deleted:S(l()).readonly()}),{kind:`mutation`,auth:`admin`,timeoutMs:5*6e4}),listJobs:D(d({entryId:l().min(1).optional()}),S(XJ).readonly(),{auth:`admin`,timeoutMs:2*6e4})}},tY=d({collectionIds:S(l()).min(1),workState:x([`complete`,`annotated_or_complete`,`any_annotated`]).default(`complete`)}),nY=d({modelId:l(),label:l(),weights:l(),imgsz:i().int(),baselineOnnxUrl:l(),baselineFloors:y(l(),i()),recommended:C()}),rY=x([`quick`,`standard`,`thorough`]),iY=d({selection:tY,entryId:l().min(1),gpuType:l().min(1),region:l(),baseModelId:l().min(1),preset:rY,freeze:i().int().nonnegative().nullable(),holdoutCameras:S(i().int()).nullable()}),aY=d({holdoutCameras:S(i().int()).readonly(),holdoutLastDays:i().int().nonnegative(),holdoutSupport:y(l(),i().int()).nullable(),trainSubjects:i().int()}),oY=x([`unknown-dataset`,`unknown-provider`,`provider-not-configured`,`unknown-base-model`,`unknown-gpu`,`dataset-too-large`,`no-training-subjects`,`job-already-running`]),sY=d({refusal:d({reason:oY,detail:l()}).nullable(),warnings:S(l()).readonly(),split:aY.nullable(),estimate:d({datasetBytes:i().int(),uploadMinutesAt20Mbps:i(),gpuSecondsLow:i(),gpuSecondsHigh:i(),usdLow:i(),usdHigh:i(),notes:S(l()).readonly()}).nullable(),defaults:d({maxCostUsd:i(),maxRuntimeSec:i().int()}).nullable(),dataNotice:l()}),cY=x([`queued`,`uploading`,`submitted`,`starting`,`running`,`collecting`,`ready`,`registered`,`canary`,`failed`,`cancelling`,`cancelled`,`lost`,`expired`,`discarded`]),lY=x([`cost-cap`,`runtime-cap`,`upload-failed`,`submit-failed`,`trainer-failed`,`result-invalid`,`checksum-mismatch`,`fetch-failed`,`provider-error`,`hub-restart-during-upload`]),uY=d({epoch:i().int(),map50:i().nullable(),map50_95:i().nullable()}),dY=d({deviceIds:S(i().int()).readonly(),since:i(),previous:S(d({deviceId:i().int(),nodeId:l(),deviceKey:l(),patch:d({modelId:l().optional(),settings:y(l(),o()).readonly().optional()}).nullable()})).readonly()}),Z=d({id:l(),idempotencyKey:l(),name:l(),createdAt:i(),updatedAt:i(),state:cY,batchId:l().nullable().default(null),stage:il.nullable(),failure:d({reason:lY,stage:l().nullable(),detail:l()}).nullable(),request:iY,maxCostUsd:i().nonnegative(),maxRuntimeSec:i().int().positive(),trainer:ZJ,datasetLayout:oj,frameCount:i().int().nonnegative(),frameIds:S(l()).max(2e4).readonly(),annotationHash:l(),dataset:d({bytes:i().int(),sha256:l(),uploadedAt:i()}).nullable(),split:aY,provider:d({state:YJ.nullable(),providerJobId:l().nullable(),startedAt:i().nullable(),endedAt:i().nullable(),billedSeconds:i(),costUsd:i(),costIsEstimate:C(),lastPolledAt:i().nullable()}),progress:d({epoch:i().int().nullable(),epochs:i().int().nullable(),etaSec:i().nullable(),series:S(uY).readonly()}),logTail:S(l()).readonly(),logCursor:l().nullable(),artifacts:d({bundleBytes:i().int(),bundleSha256:l(),fetchedAt:i(),expiresAt:i()}).nullable(),cloudDatasetDeletedAt:i().nullable(),cloudCleanupDueAt:i().nullable(),registeredModelIds:S(l()).readonly(),canary:dY.nullable()}),fY=d({id:l().min(1)}),pY={name:`training`,scope:`system`,mode:`singleton`,mount:{kind:`hub-only`},methods:{listBaseModels:D(d({}),S(nY).readonly(),{auth:`admin`}),planJob:D(iY,sY,{auth:`admin`,timeoutMs:6e4}),startJob:D(iY.extend({name:l().min(1).max(120),maxCostUsd:i().positive(),maxRuntimeSec:i().int().positive(),idempotencyKey:l().min(8).max(80)}),p(`kind`,[d({kind:m(`started`),job:Z}),d({kind:m(`refused`),reason:oY,detail:l()})]),{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),startJobBatch:D(iY.omit({baseModelId:!0}).extend({baseModelIds:S(l().min(1)).min(1),name:l().min(1).max(120),maxCostUsd:i().positive(),maxRuntimeSec:i().int().positive(),idempotencyKey:l().min(8).max(80)}),p(`kind`,[d({kind:m(`started`),batchId:l(),jobs:S(Z).min(1).readonly()}),d({kind:m(`refused`),reason:oY,detail:l()})]),{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),listJobs:D(d({}),S(Z).readonly(),{auth:`admin`}),getJob:D(fY,Z.nullable(),{auth:`admin`}),cancelJob:D(fY,Z,{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),getJobResult:D(fY,rl.nullable(),{auth:`admin`}),registerResult:D(fY.extend({canaryDeviceIds:S(i().int()).readonly()}),Z,{kind:`mutation`,auth:`admin`,timeoutMs:30*6e4}),canaryResult:D(fY.extend({deviceIds:S(i().int()).min(1).readonly()}),Z,{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),rollbackCanary:D(fY,Z,{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),discardResult:D(fY,Z,{kind:`mutation`,auth:`admin`})}},mY=[`decoder`,`motion-detection`,`pipeline-executor`,`audio-analyzer`,`pipeline-analytics`,`notification-output`],hY=[...mY,`pipeline-orchestrator`,`pipeline-runner`];function gY(e,t){return t.slot===e}function _Y(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(!gY(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 vY(e,t){return`${e}:${t}`}function yY(e){let{source:t,label:n,slots:r,hostTypeOf:i,logger:a}=e,o=(e,t)=>t!==null&&Jx[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=>vY(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 ${Jx[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:vY(t,i.slot),slot:i.slot,authority:r.authority,activation:r.activation,value:r.value,sources:[...r.sources],...r.impliedSources===void 0?{}:{impliedSources:[...r.impliedSources]}})}return a},listCandidates:async e=>({candidates:[...await(await s(e.deviceId,e.slotRef)).candidates(e.deviceId)]}),setSlot:async e=>{let t=await(await s(e.deviceId,e.slotRef)).set(e.deviceId,e.value);return a.info(`device-extension: slot written`,{tags:{deviceId:e.deviceId},meta:{slotRef:e.slotRef,reload:t.reload}}),t}}}var bY={"°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}},xY=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 SY(e){return Object.hasOwn(bY,e)?bY[e]:void 0}function CY(e){return SY(e)?.dimension}function wY(e,t){return e*t.factor+t.offset}function TY(e,t){return(e-t.offset)/t.factor}function EY(e,t,n){if(t===n)return e;let r=SY(t);if(!r)throw new xY(t,n,`unknown-from`);let i=SY(n);if(!i)throw new xY(t,n,`unknown-to`);if(r.dimension!==i.dimension)throw new xY(t,n,`cross-dimension`);return TY(wY(e,r),i)}function DY(e,t,n){if(t===n)return e;let r=SY(t);if(!r)return;let i=SY(n);if(i&&r.dimension===i.dimension)return TY(wY(e,r),i)}function OY(e,t){if(e===t)return!0;let n=CY(e);return n===void 0?!1:n===CY(t)}function kY(e){let t=[];for(let[n,r]of Object.entries(bY))r.dimension===e&&t.push(n);return t}function AY(e){return`${L(e.source)} ${e.cap}.${e.fieldPath}`}function jY(e){return e.fatal||e.confirmed===!0}function MY(e,t){return e.state===`unavailable`?{state:`unavailable`,value:null,reason:`${AY(t)}: ${e.reason}`,fatal:e.fatal,confirmed:jY(e)}:{state:e.state,value:e.value,reason:e.state===`stale`?`${AY(t)}: ${e.reason}`:null,deadline:null}}function NY(e,t,n,r){let i={},a=[],o=null,s=null;for(let[n,r]of Object.entries(e.bindings)){if(r.kind===`literal`){i[n]=r.value;continue}let e=t(r);if(e.state===`unavailable`){let t={state:`unavailable`,value:null,reason:`binding \`${n}\` (${AY(r)}): ${e.reason}`,fatal:e.fatal,confirmed:jY(e)};if(e.fatal){o=t;break}(s===null||t.confirmed&&!s.confirmed)&&(s=t);continue}i[n]=e.value,e.state===`stale`&&a.push(`\`${n}\`: ${e.reason}`)}let c=o??s;if(c!==null)return r!==void 0&&r.currentOutput!==void 0&&av(e.expr,`count`)?{state:`stale`,value:Pa(null,{kind:`count`,highWater:null,primed:!1},r.currentOutput),reason:`${c.reason}; holding the last accumulator value`,deadline:null}:c;let l=[],u=Do(e.expr,i,n,{hooks:{noteDeadline:e=>l.push(e),convert:(e,t,n)=>DY(e,Ab(t)??t,Ab(n)??n)??null},...r===void 0?{}:{invokeStateful:e=>Co(r.callPathPrefix===void 0?e:{...e,path:`${r.callPathPrefix}@${e.path}`},r.expressionMemory,{currentOutput:r.currentOutput,startedAtMs:r.startedAtMs,nowMs:n})}});return u.ok?{state:a.length>0?`stale`:`fresh`,value:u.value,reason:a.length>0?a.join(`; `):null,deadline:l.length>0?Math.min(...l):null}:{state:`unavailable`,value:null,reason:`the expression failed: ${u.error}`,fatal:!1,confirmed:!0,expressionFailed:!0}}function PY(e){let{source:t}=e;switch(t.kind){case`from`:return MY(e.read(t),t);case`expression`:return NY(t,e.read,e.now,e.stateful);case`code`:return{state:`unavailable`,value:null,reason:`code fields are not runnable in the composer — they arrive in slice 4`,fatal:!0,confirmed:!0}}}var FY=3e5,IY=[{addonId:`provider-homeassistant`,stableId:`sensor.living_room_temperature`},{addonId:`provider-homeassistant`,stableId:`sensor.sofa_temperature`},{addonId:`provider-homeassistant`,stableId:`sensor.window_temperature`}],LY=[{addonId:`provider-homeassistant`,stableId:`binary_sensor.living_room_motion`},{addonId:`provider-homeassistant`,stableId:`binary_sensor.living_room_presence`}];function RY(e,t,n){return{kind:`from`,source:e,cap:t,fieldPath:n}}function zY(e,t,n,r){return Object.fromEntries(t.map((t,i)=>[`${e}${i+1}`,RY(t,n,r)]))}function BY(e){let t=zY(`t`,e.temperatureSources,`temperature-sensor`,`celsius`),n=zY(`f`,e.temperatureSources,`temperature-sensor`,`lastFetchedAt`),r=zY(`d`,e.motionSources,`motion`,`detected`),i=zY(`m`,e.motionSources,`motion`,`lastDetectedAt`),a=Object.keys(i).map(t=>`within(${t}, ${e.occupancyWindowMs})`);return ts.parse({target:{kind:`new`,type:k.Sensor,role:A.TemperatureSensor},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 VY=`8dec3b512fda40cbb8cd121c7a99f890`,HY=`provider-homeassistant`;function UY(e){let t={addonId:HY,stableId:`ha:${e}:dev:${VY}`},n=e=>({addonId:HY,stableId:`${t.stableId}-${e}`});return{feeder:t,desiccantDays:n(`sensor.freshelement_3_desiccant_days_remaining`),batteryStatus:n(`sensor.freshelement_3_battery_status`),batteryCharging:n(`binary_sensor.freshelement_3_battery`)}}function WY(e){let t={d:RY(e.desiccantDays,`enum-sensor`,`value`)};return ts.parse({target:{kind:`existing`,device:e.feeder},features:[{kind:`fields`,cap:`consumables`,fields:{lastChangedAt:{kind:`expression`,expr:`now`,bindings:{}},lastFetchedAt:{kind:`expression`,expr:`now`,bindings:{}}},items:{desiccant:{label:`Desiccant`,fields:{"remaining.value":{kind:`expression`,expr:`number(d)`,bindings:t},"remaining.unit":{kind:`expression`,expr:`"days"`,bindings:{}},status:{kind:`expression`,expr:`number(d) == null ? null : (number(d) <= 0 ? "replace" : "ok")`,bindings:t}}}}},{kind:`fields`,cap:`battery`,fields:{percentage:{kind:`expression`,expr:`s == "low" ? 15 : (s == "normal" ? 100 : null)`,bindings:{s:RY(e.batteryStatus,`enum-sensor`,`value`)}},binary:{kind:`expression`,expr:`true`,bindings:{}},charging:{kind:`expression`,expr:`c ? "dc" : "unknown"`,bindings:{c:RY(e.batteryCharging,`binary`,`on`)}},sleeping:{kind:`expression`,expr:`false`,bindings:{}},lastUpdated:{kind:`expression`,expr:`now`,bindings:{}}}}]})}var GY=2e3;function KY(e,t){return Object.keys(ha).filter(e=>Object.hasOwn(ga,e)&&t.includes(e)).toSorted().flatMap(t=>{let n=ha[t],r=ga[t];return n===void 0||r===void 0?[]:[{source:e,cap:t,activeField:n,changedAtField:r}]})}function qY(e){let t=[...e.sources].toSorted((e,t)=>`${e.source.addonId}/${e.source.stableId}#${e.cap}`.localeCompare(`${t.source.addonId}/${t.source.stableId}#${t.cap}`));if(t.length===0)throw Error(`doorbell composition needs at least one source`);let n={};return t.forEach((e,t)=>{n[`active${t}`]={kind:`from`,source:e.source,cap:e.cap,fieldPath:e.activeField},n[`changed${t}`]={kind:`from`,source:e.source,cap:e.cap,fieldPath:e.changedAtField}}),{kind:`fields`,cap:`doorbell`,enabled:e.enabled,fields:{lastPressedAt:{kind:`expression`,expr:`latest(${t.map((e,t)=>`rose(active${t}, changed${t}, ${GY})`).join(`, `)})`,bindings:n},pressCountSinceStart:{kind:`expression`,expr:`count(lastPressedAt)`,bindings:{lastPressedAt:{kind:`from`,source:{addonId:e.camera.addonId,stableId:e.camera.stableId},cap:`doorbell`,fieldPath:`lastPressedAt`}}}}}}var JY=_a.filter(e=>e!==`switch`&&e!==`motion`);function YY(e){let t=ha[e.cap];if(t===void 0||!JY.includes(e.cap))return null;let n={kind:`expression`,expr:`!v`,bindings:{v:{kind:`from`,source:e.self,cap:e.cap,fieldPath:t}}};return{kind:`fields`,cap:e.cap,fields:{[t]:n}}}function XY(e){return{kind:`expression`,expr:JSON.stringify(e),bindings:{}}}function ZY(e){if(e.from===e.to||!OY(e.from,e.to))return null;let t={kind:`expression`,expr:`convert(v, ${JSON.stringify(e.from)}, ${JSON.stringify(e.to)})`,bindings:{v:{kind:`from`,source:e.self,cap:e.cap,fieldPath:e.fieldPath}}};return{kind:`fields`,cap:e.cap,fields:{[e.fieldPath]:t,...e.unitField===null?{}:{[e.unitField]:XY(e.to)}}}}function QY(e){return tu.some(t=>t===e)}var $Y={person:`person`,baby:`person`,car:`vehicle`,motorcycle:`vehicle`,bicycle:`vehicle`,boat:`vehicle`,school_bus:`vehicle`,garbage_truck:`vehicle`,dog:`animal`,cat:`animal`,deer:`animal`,horse:`animal`,bird:`animal`,raccoon:`animal`,fox:`animal`,bear:`animal`,cow:`animal`,squirrel:`animal`,goat:`animal`,rabbit:`animal`,skunk:`animal`,kangaroo:`animal`,possum:`animal`,rodent:`animal`,package:`package`},eX={face:`attribute`,license_plate:`attribute`,amazon:`attribute`,usps:`attribute`,ups:`attribute`,fedex:`attribute`,dhl:`attribute`,an_post:`attribute`,purolator:`attribute`,postnl:`attribute`,nzpost:`attribute`,postnord:`attribute`,gls:`attribute`,dpd:`attribute`,canada_post:`attribute`,royal_mail:`attribute`,waste_bin:`no-macro`,bbq_grill:`no-macro`,robot_lawnmower:`no-macro`,umbrella:`no-macro`,baby_stroller:`no-macro`};function tX(e){let t={};for(let n of e){let e=$Y[n]??BT.mapping[n];e!==void 0&&QY(e)&&(t[n]=e)}return{mapping:t,preserveOriginal:!1}}function nX(e){let t=tX(e),n=_p(e,t);return n.length>0?{classMap:t,suppliesSteps:n}:{classMap:t}}var rX=Object.freeze({person:.5,vehicle:.5,animal:.5}),iX=Object.freeze({person:.65,vehicle:.65,animal:.65});function aX(e,t){return t===void 0?{...e===`plus`?iX:rX}:{...t}}var oX=[{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 sX(e){for(let t of oX){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 cX(e,t=[]){for(let n of oX){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 lX={Siren:A.Siren,Floodlight:A.Floodlight,Spotlight:A.Spotlight,PirSensor:A.PirSensor,Chime:A.Chime,Autotrack:A.Autotrack,Nightvision:A.Nightvision,PrivacyMask:A.PrivacyMask},uX={[lX.Siren]:`Siren`,[lX.Floodlight]:`Floodlight`,[lX.Spotlight]:`Spotlight`,[lX.PirSensor]:`PIR`,[lX.Chime]:`Chime`,[lX.Autotrack]:`Autotracking`,[lX.Nightvision]:`Night Vision`,[lX.PrivacyMask]:`Privacy Mask`};function dX(e,t,n){let r=`${e}:${t}`;return typeof n==`number`?`${r}:${n}`:r}var fX=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}))}},pX=class e{writer;onWriteFailed;pendingWrites=new Set;failedWrites=new Set;slices;schemas=new Map;listeners=new Set;capListeners=new Map;constructor(e,t,n){this.writer=t,this.onWriteFailed=n,this.slices=new Map;for(let[t,n]of Object.entries(e))n&&typeof n==`object`&&!Array.isArray(n)&&this.slices.set(t,{...n})}static fromInitial(t,n,r){return new e(t,n,r)}installCapSchema(e,t){let n=this.schemas.get(e);if(n){if(n!==t)throw Error(`[DeviceRuntimeState] capability "${e}" registered a different runtime-state schema; each cap must declare ONE shape across every provider`);return}this.schemas.set(e,t);let r=this.slices.get(e);if(r){let n=t.safeParse(r);n.success?this.slices.set(e,n.data):this.slices.delete(e)}}getCapState(e){let t=this.slices.get(e);if(t)return Object.freeze({...t})}getCapField(e,t){return this.slices.get(e)?.[t]}setCapState(e,t){this.applyCapWrite(e,t,!1)}patchCapState(e,t){this.applyCapWrite(e,t,!0)}applyCapWrite(e,t,n){let r=this.schemas.get(e);if(!r)throw Error(`[DeviceRuntimeState] no schema registered for cap "${e}" — did the device register it via ctx.registerNativeCap before writing?`);let i=this.slices.get(e)??{},a=n?{...i,...t}:{...t},o=r.parse(a);if(mX(i,o)&&!this.failedWrites.has(e))return;this.slices.set(e,o),this.fireListeners([e]);let s=this.writer(e,{...o}).then(()=>{this.failedWrites.delete(e)}).catch(t=>{this.failedWrites.add(e),this.onWriteFailed?.(e,t instanceof Error?t.message:String(t))});this.pendingWrites.add(s),s.finally(()=>{this.pendingWrites.delete(s)})}fireListeners(e){let t=this.snapshot();for(let n of this.listeners)try{n(e,t)}catch{}for(let t of e){let e=this.capListeners.get(t);if(!e)continue;let n=this.getCapState(t);for(let t of e)try{t(n)}catch{}}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}subscribeCap(e,t){let n=this.capListeners.get(e);n||(n=new Set,this.capListeners.set(e,n));let r=e=>{t(e)};return n.add(r),()=>{let t=this.capListeners.get(e);t&&(t.delete(r),t.size===0&&this.capListeners.delete(e))}}snapshot(){let e={};for(let[t,n]of this.slices)e[t]=Object.freeze({...n});return Object.freeze(e)}async flush(){if(this.pendingWrites.size===0)return;let e=[...this.pendingWrites];await Promise.allSettled(e)}};function mX(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 hX={airQualitySensor:XR,alarmPanel:lE,ambientLightSensor:QR,audioMetrics:rz,automationControl:az,battery:sz,binary:lz,brightness:dz,cameraStreams:Yg,carbonMonoxide:Pz,climateControl:Lz,color:Hz,connectivity:Yz,consumables:eB,contact:nB,control:oB,cover:lB,dayNight:hB,deviceDiscovery:Ib,deviceStatus:_B,doorbell:bB,enumSensor:CB,eventEmitter:EB,fanControl:BB,featureProbe:HB,flood:WB,gas:KB,humidifier:JB,humiditySensor:XB,image:QB,imageSettings:sV,intercom:bV,lawnMowerControl:wV,lockControl:qV,mediaPlayer:QV,motion:oH,motionTrigger:lH,motionZones:mH,nativeObjectDetection:SH,navigation:IH,networkLink:HH,notifier:_U,numericSensor:yU,petFeeder:WU,powerMeter:mW,presence:_W,pressureSensor:yW,privacyMask:TW,ptzAutotrack:BW,recordingOnboard:tK,recordingSignal:wK,sceneMonitor:JK,scriptRunner:$K,smoke:tq,streamCatalog:iq,streamParams:dq,streamSignals:VI,switch:_q,tamper:Xq,temperatureSensor:Qq,update:nJ,vacuumControl:yJ,valve:SJ,vibration:wJ,waterHeater:EJ,weather:OJ,zoneAnalytics:LJ,zoneRules:zJ,zones:vP},gX=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=hX[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??{},i=si(t);this.config=fX.fromSchema(t,t=>e.persistConfig(t,{secretConfigPaths:i}),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 a=null,o=async(t,n)=>{a||=e.fetchDevice(e.id),await(await a).deviceState.setCapSlice({capName:t,slice:n})},s=e.initialRuntimeState??{},c=(t,n)=>{e.logger.warn(`runtime-state write refused by the hub — the slice is not mirrored; it is re-sent on the next write`,{tags:{deviceId:e.id},meta:{cap:t,error:n}})};this.runtimeState=pX.fromInitial(s,o,c),e.bindRuntimeState?.(this.runtimeState),e.registerNativeCap?.(_B,{});let l={online:!0,lastChangedAt:Date.now()};this.runtimeState.setCapState(`device-status`,l),e.registerNativeCap?.(HB,{}),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=Mb(this.ctx.deviceMeta.metadata)??Ob({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=kb(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:{[jb]:t}})}catch{}this.ctx.eventBus.emit(it(`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}},_X=[1e4,3e4,9e4],vX=4;function yX(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 bX(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 xX=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??_X,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 yX(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 bX(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 SX(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 CX=class extends hn{async onInitialize(){return this.ctx.logger.info(`${this.providerName} Provider initialized`),[{capability:xx,provider:this}]}async onShutdown(){this._restoreShuttingDown=!0,this.cancelRestoreRetries();let e=await this.ctx.kernel.devices?.getAll()??[];for(let t of e)try{await this.ctx.kernel.devices?.decommission(t.id)}catch(e){this.ctx.logger.warn(`${this.providerName}: decommission failed`,{tags:{deviceId:t.id,stableId:t.stableId},meta:{error:e instanceof Error?e.message:String(e)}})}this.ctx.logger.info(`${this.providerName} Provider shut down`,{meta:{decommissionedCount:e.length}})}async start(){}async stop(){}async getStatus(){let e=await this.ctx.kernel.devices?.getAll()??[],t=this.restoreFailureSummary(),n={connected:!0,deviceCount:e.length,motionSliceWriter:`orchestrator`};return t===null?n:{...n,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(k).find(e=>this.deviceClasses[e]!==void 0)??null}:{deviceType:null}}async adoptDiscoveredDevice(e){throw Error(`${this.providerName} provider does not support discovery-based adoption`)}async supportsManualCreation(){return!0}async getChildCreationSchema(e){return this.onGetCreationSchema(e.type)}async createDevice(e){let t=await this.onCreateDevice(e.type,e.config),n=this.deviceClasses[t.meta.type];if(!n)throw Error(`${this.providerName} provider: no device class registered for type "${t.meta.type}" — add it to the deviceClasses map`);let r=this.generateStableId(t.meta.type,t.config),i=await this.ctx.kernel.devices.create(r,n,t.config,null,t.meta);if(t.onAfterCreate)try{await t.onAfterCreate(i)}catch(e){this.ctx.logger.warn(`createDevice: onAfterCreate hook threw — device is already registered`,{tags:{deviceId:i.id,stableId:r},meta:{error:e instanceof Error?e.message:String(e)}})}return this.toSummary(i)}generateStableId(e,t){return`${this.addonId}-${Date.now()}`}async testCreationField(e){return{status:`ok`,labels:[`probe not implemented`]}}async restoreDevices(e){this._restoreShuttingDown=!1;let t=await this.onRestoreDevices(e);if(e.length===0)return;if(t&&t.failedCount>0){this.ctx.logger.warn(`Restored ${t.restoredCount}/${e.length} ${this.providerName} device(s) — ${t.failedCount} failed, bounded retry scheduled`);return}let n=t?t.restoredCount:e.length;this.ctx.logger.info(`Restored ${n} ${this.providerName} device(s)`)}restoreRetryDelaysMs=_X;restoreRetryConcurrency=4;_restoreRetrySchedulers=[];_restoreRetryCompletion=null;_restoreShuttingDown=!1;_permanentRestoreFailures=new Map;get restoreRetryCompletion(){return this._restoreRetryCompletion}get permanentRestoreFailures(){return[...this._permanentRestoreFailures.values()]}restoreFailureSummary(){if(this._permanentRestoreFailures.size===0)return null;let e=[...this._permanentRestoreFailures.keys()].join(`, `);return`${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${e}) — restart the ${this.providerName} provider to retry`}quarantineConfiglessTopLevelRestores=!0;isUnrestorableShell(e){if(!this.quarantineConfiglessTopLevelRestores||e.parentDeviceId!==null)return!1;let t=e.config;return t===void 0?!1:Object.keys(t).length===0}quarantineShell(e){this._permanentRestoreFailures.set(e.id,{deviceId:e.id,stableId:e.stableId,type:e.type,attempts:0,lastError:`persisted row has no configuration`,failedAt:Date.now()}),this.ctx.logger.error(`Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.`,{tags:{deviceId:e.id,stableId:e.stableId},meta:{type:e.type,provider:this.providerName}})}cancelRestoreRetries(){for(let e of this._restoreRetrySchedulers)e.cancel();this._restoreRetrySchedulers=[]}recordPermanentRestoreFailure(e){this._permanentRestoreFailures.set(e.deviceId,e),this.ctx.logger.error(`Device restore permanently failed — its capabilities will not register until the provider restarts`,{tags:{deviceId:e.deviceId,stableId:e.stableId},meta:{type:e.type,attempts:e.attempts,error:e.lastError}})}scheduleRestoreRetries(e,t){if(this._restoreShuttingDown){this.ctx.logger.info(`Restore retries not scheduled — the provider is shutting down`,{meta:{rows:e.length,deviceIds:e.map(e=>e.saved.id)}});return}let n=new xX({logger:this.ctx.logger,delaysMs:this.restoreRetryDelaysMs,concurrency:this.restoreRetryConcurrency,attempt:t,onPermanentFailure:e=>this.recordPermanentRestoreFailure(e)});this._restoreRetrySchedulers=[...this._restoreRetrySchedulers,n];let r=n.run(e).then(()=>void 0).catch(e=>{this.ctx.logger.error(`Restore retry scheduler crashed`,{meta:{error:e instanceof Error?e.message:String(e)}})}),i=this._restoreRetryCompletion;this._restoreRetryCompletion=i===null?r:Promise.all([i,r]).then(()=>void 0)}async restoreWithBoundedRetry(e,t){let n=[];for(let r of e){if(this.isUnrestorableShell(r)){this.quarantineShell(r);continue}try{await t(r)}catch(e){let t=e instanceof Error?e.message:String(e);this.ctx.logger.warn(`Failed to restore device — bounded retry scheduled`,{tags:{deviceId:r.id,stableId:r.stableId},meta:{type:r.type,attempt:1,error:t}}),n.push({saved:r,error:t})}}n.length>0&&this.scheduleRestoreRetries(n,t)}async reloadDevice(e){let{stableId:t}=e,n=this.ctx.kernel.devices;if(!n)throw Error(`${this.providerName}: kernel.devices unavailable — cannot reload`);let r=(await n.getAll()).find(e=>e.stableId===t);r&&await n.decommission(r.id);let{id:i}=await this.ctx.api.deviceManager.allocateDeviceId.mutate({addonId:this.addonId,stableId:t}),a=await this.ctx.api.deviceManager.loadMeta.query({deviceId:i});if(a===null)throw Error(`${this.providerName}: no persisted meta for "${t}" (id ${i}) — cannot reload`);let o=Object.values(k).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(k).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 SX(e,this.addonId)}},wX=360*6e4;function TX(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 EX(e){return e===`unreachable`}var DX=[`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`],OX=[`contact-sensor`,`motion-sensor`,`occupancy-sensor`,`smoke-sensor`,`co-sensor`,`gas-sensor`,`leak-sensor`,`vibration-sensor`,`tamper-sensor`,`sound-sensor`];function kX(e){if(e===void 0)return OX.length;let t=OX.indexOf(e);return t===-1?OX.length:t}function AX(e){let t=DX.indexOf(e);return t===-1?DX.length:t}function jX(e,t){let n=e=>e.toLowerCase().replace(/[-_\s]+/g,` `).trim();return n(e)===n(t)}function MX(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&&jX(e.name,n)?0:1;return[...e].toSorted((e,t)=>kX(e.role)-kX(t.role)||r(e)-r(t)||AX(e.type)-AX(t.type))[0]??null}function NX(e,t,n,r,i){if(r.has(e))return;let a=t.get(e);if(!a)return;if(a.type!==k.Container){i.add(e);return}let o=new Set(r);o.add(e);let s=MX((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&&NX(s.id,t,n,o,i)}function PX(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=>NX(e,i,a,new Set,o);for(let e of r){if(e.type===k.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===k.Container){s(r.id);continue}o.add(e.id)}return o.delete(t),[...o]}var FX=`fixed`;function IX(e){let t=e??`hub`;return t.includes(`/`)?t.split(`/`)[0]??`hub`:t}var LX=32,RX=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=IX(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:{[FX]:!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:{[FX]:!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}};async function zX(e,t){let n=await e.api.integrations.getByAddonId.query({addonId:iy});return n==null?(e.logger.warn(`reconcileBlockDevices: Blocks integration is not ready — skipping this pass`,{meta:{blockAddonId:e.id}}),{integrationId:null,devices:[],removed:[],owned:!1}):new RX({logger:e.logger.child(`declared-devices`),addonId:e.id,devices:e.kernel.devices,localNodeId:e.kernel.localNodeId,getIntegration:async()=>{throw Error(`reconcileBlockDevices: devices hang off the Blocks integration; it never reads its own`)},createIntegration:async()=>{throw Error(`reconcileBlockDevices: devices hang off the Blocks integration; it never mints one`)},updateIntegration:async()=>{throw Error(`reconcileBlockDevices: devices hang off the Blocks integration; it never updates one`)},listOwnDevices:()=>e.api.deviceManager.listAll.query({addonId:e.id})}).reconcile({integrationId:n.id,integrationName:n.name,placement:t.placement??`hub`,devices:t.devices})}async function BX(e,t){for(let n of t.exporterAddonIds)for(let r of t.deviceIds)try{await e.api.deviceExport.exposeDevice.mutate({addonId:n,deviceId:String(r),nodeId:`hub`})}catch(t){e.logger.warn(`exposeBlockDevices: expose refused`,{tags:{deviceId:r},meta:{exporterAddonId:n,error:t instanceof Error?t.message:String(t)}})}}var VX={[k.Cover]:`cover`,[k.Valve]:`valve`,[k.Humidifier]:`humidifier`,[k.WaterHeater]:`water-heater`,[k.Camera]:`dummy`,[k.Hub]:`dummy`,[k.Switch]:`switch`,[k.Siren]:`switch`,[k.Light]:`light`,[k.Fan]:`fan`,[k.Sensor]:`sensor`,[k.Thermostat]:`thermostat`,[k.Climate]:`climate`,[k.Button]:`button`,[k.EventEmitter]:`dummy`,[k.Update]:`update`,[k.Generic]:`dummy`,[k.Notifier]:`dummy`,[k.Script]:`script`,[k.Automation]:`automation`,[k.Lock]:`lock`,[k.MediaPlayer]:`media-player`,[k.AlarmPanel]:`alarm`,[k.Control]:`control`,[k.Presence]:`sensor`,[k.Weather]:`weather`,[k.Vacuum]:`vacuum`,[k.LawnMower]:`lawn-mower`,[k.Container]:`dummy`,[k.Image]:`image`,[k.PetFeeder]:`pet-feeder`},HX=new Set(Object.values(k));function UX(e){return HX.has(e)?VX[e]:null}var WX=`motion-trigger`;function GX(e){return e.includes(WX)}var KX=[`temperature-sensor`,`humidity-sensor`,`ambient-light-sensor`,`numeric-sensor`,`enum-sensor`];function qX(e){let t=new Set(e.features);switch(e.type){case k.Cover:return{kind:`cover`};case k.Valve:return{kind:`valve`};case k.Lock:return{kind:`lock`};case k.AlarmPanel:return{kind:`alarm`};case k.Light:return t.has(`brightness`)?{kind:`brightness`}:{kind:`switch`};case k.Switch:case k.Siren:return{kind:`switch`};case k.Sensor:case k.Presence:{let e=KX.find(e=>t.has(e));return e?{kind:`sensor`,sensorFeature:e}:{kind:`none`}}default:return{kind:`none`}}}var JX={"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 YX(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function XX(e,t){if(!YX(e))return null;let n=e[t];if(!YX(n))return null;let r=n.mutate;return typeof r==`function`?r:null}var ZX=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.listInstallations":{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.checkBackupKey":{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.disableEncryption":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"backup.getEncryption":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"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.setupEncryption":{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`},"calendars.getPreferences":{capName:`calendars`,capScope:`system`,addonId:null,access:`view`},"calendars.listCalendars":{capName:`calendars`,capScope:`system`,addonId:null,access:`view`},"calendars.listEvents":{capName:`calendars`,capScope:`system`,addonId:null,access:`view`},"calendars.setCalendarPreference":{capName:`calendars`,capScope:`system`,addonId:null,access:`create`},"calendarSource.listCalendars":{capName:`calendar-source`,capScope:`system`,addonId:null,access:`view`},"calendarSource.listEvents":{capName:`calendar-source`,capScope:`system`,addonId:null,access:`view`},"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.getBlockSettings":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.getComposition":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.getCustomization":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.getTypeDefs":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.list":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.listComposableCaps":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.listCompositions":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.restart":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.setEnabled":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.update":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.updateBlockSettings":{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.importModelBundle":{capName:`custom-model-registry`,capScope:`system`,addonId:null,access:`create`},"customModelRegistry.listModels":{capName:`custom-model-registry`,capScope:`system`,addonId:null,access:`view`},"databaseSnapshot.listDatabases":{capName:`database-snapshot`,capScope:`system`,addonId:null,access:`view`},"databaseSnapshot.writeSnapshot":{capName:`database-snapshot`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.aggregate":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.count":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.declareCollection":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.delete":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`delete`},"dataStoreProvider.deleteWhere":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`delete`},"dataStoreProvider.get":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.getEngineInfo":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.histogram":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.insert":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.insertMany":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.isEmpty":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.query":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.set":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.update":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.updateWhere":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.upsert":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dayNight.getOptions":{capName:`day-night`,capScope:`device`,addonId:null,access:`view`},"dayNight.getStatus":{capName:`day-night`,capScope:`device`,addonId:null,access:`view`},"dayNight.setSettings":{capName:`day-night`,capScope:`device`,addonId:null,access:`create`},"decoder.getInfo":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.reprobeHwaccel":{capName:`decoder`,capScope:`system`,addonId:null,access:`create`},"detectionPipeline.applyDeviceSettingsPatch":{capName:`detection-pipeline`,capScope:`device`,addonId:null,access:`create`},"detectionPipeline.getDeviceLiveContribution":{capName:`detection-pipeline`,capScope:`device`,addonId:null,access:`view`},"detectionPipeline.getDeviceSettingsContribution":{capName:`detection-pipeline`,capScope:`device`,addonId:null,access:`view`},"deviceAdminLink.getAdminLink":{capName:`device-admin-link`,capScope:`device`,addonId:null,access:`view`},"deviceAdoption.adopt":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.getCandidate":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.getStatus":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.listCandidateFilters":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.listCandidates":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.refresh":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.release":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.resync":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceDiscovery.adoptDevice":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceDiscovery.getStatus":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`view`},"deviceDiscovery.listDiscovered":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`view`},"deviceDiscovery.refreshDiscovery":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceDiscovery.releaseDevice":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceExport.applyDeviceSettingsPatch":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceExport.exposeDevice":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceExport.getDeviceLiveContribution":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.getDeviceSettingsContribution":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.getStatus":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.listExposedDevices":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.listSupportedDeviceKinds":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.unexposeDevice":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceExtension.listCandidates":{capName:`device-extension`,capScope:`device`,addonId:null,access:`view`},"deviceExtension.listSlots":{capName:`device-extension`,capScope:`device`,addonId:null,access:`view`},"deviceExtension.listSources":{capName:`device-extension`,capScope:`device`,addonId:null,access:`view`},"deviceExtension.setSlot":{capName:`device-extension`,capScope:`device`,addonId:null,access:`create`},"deviceManager.addLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionAdopt":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionCancelJob":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionListCandidateFilters":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionListCandidates":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionListJobs":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionRefresh":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionRelease":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionResync":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionStartJob":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.allocateDeviceId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.applyInitialMeta":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.createDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.disable":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverAllProviders":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverDevices":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverProvider":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoveryProviders":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.enable":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.getAllBindings":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getBindings":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getBindingsBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getChildren":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getChildrenBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getConfigSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getCreationSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceLiveInfoAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceSettingsAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceStatusAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceStatusAggregateBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getLinkedDevices":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getLinkedDevicesBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getRoleDisplayDefaults":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getSettingsSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getStreamProfileMap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getStreamSources":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getWireableFields":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getWrapperActivation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listAll":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listBindableCapsForDeviceType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listDeviceIdsByCaps":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listLocationDescriptions":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listLocationIcons":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listLocations":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listPersistedByAddon":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listSiteZones":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listWrappersForCap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadMeta":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadRuntimeState":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.migrateDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.persistConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.probeStreams":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.providerCreationType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.providerDiscoveryParamsSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.registerDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.remove":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeByIntegration":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeSiteZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.renameLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.renameSiteZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.runDeviceAction":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setChildLayout":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setDisabled":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setDisplay":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setIntegrationId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLinkDeviceId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocationDescription":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocationIcon":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocationZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setMetadata":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setName":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setPrimaryChildEntityId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setRole":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setRoleDisplayDefaults":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setSiteZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setStreamProfileMap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setWrapperActive":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.testCreationField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.testField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateDeviceField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateDeviceFieldsBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceOps.getConfigEntries":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getRawState":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getSettingsSchema":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getStreamSources":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.removeDevice":{capName:`device-ops`,capScope:`device`,addonId:null,access:`delete`},"deviceOps.runAction":{capName:`device-ops`,capScope:`device`,addonId:null,access:`create`},"deviceOps.setConfig":{capName:`device-ops`,capScope:`device`,addonId:null,access:`create`},"deviceProvider.adoptDiscoveredDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.createDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.discoverDevices":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.getChildCreationSchema":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getDevices":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getDiscoveryParamsSchema":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getManualCreationType":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getStatus":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.reloadDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.start":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.stop":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.supportsDiscovery":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.supportsManualCreation":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.testCreationField":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceState.claimFields":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceState.getAllSnapshots":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getNativeCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getSnapshot":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.listClaims":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.patchOwnedFields":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceState.releaseClaim":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceState.setCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceStatus.getStatus":{capName:`device-status`,capScope:`device`,addonId:null,access:`view`},"doorbell.getStatus":{capName:`doorbell`,capScope:`device`,addonId:null,access:`view`},"embeddingEncoder.encode":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.encodeText":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.getInfo":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.resetFailedModels":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`delete`},"enumSensor.getStatus":{capName:`enum-sensor`,capScope:`device`,addonId:null,access:`view`},"eventEmitter.getStatus":{capName:`event-emitter`,capScope:`device`,addonId:null,access:`view`},"faceGallery.assignFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.assignFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.auditIdentitySamples":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.createIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.deleteFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.deleteIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.getFaceByTrack":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.getFaceMedia":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listIdentities":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listIdentitySamples":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listRecentFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.removeSample":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.renameIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.suggestFaceClusters":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.unassignFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.unassignFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"failureContribution.list":{capName:`failure-contribution`,capScope:`system`,addonId:null,access:`view`},"fanControl.getStatus":{capName:`fan-control`,capScope:`device`,addonId:null,access:`view`},"fanControl.setDirection":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setOscillating":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setPercentage":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setPreset":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"featureProbe.getStatus":{capName:`feature-probe`,capScope:`device`,addonId:null,access:`view`},"filesystemBrowse.browse":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`view`},"filesystemBrowse.createDir":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`create`},"filesystemBrowse.listAllowedRoots":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`view`},"flood.getStatus":{capName:`flood`,capScope:`device`,addonId:null,access:`view`},"gas.getStatus":{capName:`gas`,capScope:`device`,addonId:null,access:`view`},"humidifier.getStatus":{capName:`humidifier`,capScope:`device`,addonId:null,access:`view`},"humidifier.setMode":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humidifier.setOn":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humidifier.setTargetHumidity":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humiditySensor.getStatus":{capName:`humidity-sensor`,capScope:`device`,addonId:null,access:`view`},"image.getStatus":{capName:`image`,capScope:`device`,addonId:null,access:`view`},"imageSettings.getOptions":{capName:`image-settings`,capScope:`device`,addonId:null,access:`view`},"imageSettings.getStatus":{capName:`image-settings`,capScope:`device`,addonId:null,access:`view`},"imageSettings.setSettings":{capName:`image-settings`,capScope:`device`,addonId:null,access:`create`},"integrations.create":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.delete":{capName:`integrations`,capScope:`system`,addonId:null,access:`delete`},"integrations.get":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getAvailableTypes":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getByAddonId":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getSettings":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.list":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.setSettings":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.testConnection":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.update":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"intercom.endTalkSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.getStatus":{capName:`intercom`,capScope:`device`,addonId:null,access:`view`},"intercom.handleAnswer":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.pushTalkAudio":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.startSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.startTalkSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.stopSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"keychain.delete":{capName:`keychain`,capScope:`system`,addonId:null,access:`delete`},"keychain.getState":{capName:`keychain`,capScope:`system`,addonId:null,access:`view`},"keychain.listMeta":{capName:`keychain`,capScope:`system`,addonId:null,access:`view`},"keychain.put":{capName:`keychain`,capScope:`system`,addonId:null,access:`create`},"keychain.resolve":{capName:`keychain`,capScope:`system`,addonId:null,access:`view`},"keychainAdmin.acknowledgeReset":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`create`},"keychainAdmin.deleteOrphans":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`delete`},"keychainAdmin.downloadRecoveryKey":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`create`},"keychainAdmin.listAudit":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`view`},"keychainAdmin.listSecrets":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`view`},"keychainAdmin.purgeRetiredKeys":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`delete`},"keychainAdmin.resetKeychain":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`delete`},"keychainAdmin.resetReport":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`delete`},"keychainAdmin.reveal":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`create`},"keychainAdmin.rotateMasterKey":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`create`},"keychainAdmin.setSystemSecret":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`create`},"keychainAdmin.status":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`view`},"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.addCustomAddress":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"localNetwork.downloadCa":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getAddresses":{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.getHubAddresses":{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.removeCustomAddress":{capName:`local-network`,capScope:`system`,addonId:null,access:`delete`},"localNetwork.resetAllowlistToBestMatch":{capName:`local-network`,capScope:`system`,addonId:null,access:`delete`},"localNetwork.revertToGeneratedCertificate":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"localNetwork.setAddressRole":{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.getTarget":{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.probeTargetConfig":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"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.activateAlarmProfile":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.cancelSnooze":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.createAlarmProfile":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.createRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.createSequence":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.createSnooze":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.deleteAlarmProfile":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`delete`},"notificationRules.deleteRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`delete`},"notificationRules.deleteSequence":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`delete`},"notificationRules.getAlarmConfig":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getAlarmSensors":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getClipRetentionAsks":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getConditionCatalog":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getHistory":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getRuleLastRuns":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getSequence":{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.listSequences":{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.renameAlarmProfile":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"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`},"notificationRules.updateSequence":{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`},"oidcConnections.connectionFormSchema":{capName:`oidc-connections`,capScope:`system`,addonId:null,access:`view`},"oidcConnections.createConnection":{capName:`oidc-connections`,capScope:`system`,addonId:null,access:`create`},"oidcConnections.deleteConnection":{capName:`oidc-connections`,capScope:`system`,addonId:null,access:`delete`},"oidcConnections.listConnections":{capName:`oidc-connections`,capScope:`system`,addonId:null,access:`view`},"oidcConnections.updateConnection":{capName:`oidc-connections`,capScope:`system`,addonId:null,access:`create`},"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.deleteTemplate":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`delete`},"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.listTemplates":{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`},"osdManager.setSlotCameraEnabled":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`create`},"osdManager.upsertTemplate":{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.addRetrainFrameFromRecording":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.addRetrainFramesToCollection":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.applyDeviceSettingsPatch":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.cancelRelocateMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.cancelStorageMigrationMove":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.clearTrackRelation":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.clearTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.completeRetrainTrack":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.countRelocatableMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.countUnstampedEventMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.createRetrainCollection":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.deleteDeviceEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.deleteRetrainCollection":{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.getRetrainCorpusKpi":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getRetrainExportUrl":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getRetrainFrameImage":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getSensorEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getStorageMigrationMoveStatus":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrack":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrackMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrainingExportSummary":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrainingExportUrl":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listArchivedDebugNotes":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listBirthDecisions":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listEventKinds":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listEventKindsBatch":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listEventMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listOpsLog":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRecentTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRelocateMediaJobs":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainAnnotations":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainAssistProfiles":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainCollectionFrames":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainCollections":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainCorpusPage":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainFrames":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainStaging":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTrackMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTrackRelations":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.offerRetrainArchive":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"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.proposeRetrainAnnotationsWithLlm":{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.removeRetrainFrameFromCollection":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.renameRetrainCollection":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.resolveRetrainTrainingCorpus":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"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.setRetrainFrameComplete":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.setTrackFlags":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.setTrackPurity":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.setTrackRelation":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.startStorageMigrationMove":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.wipeAllAnalytics":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.wipeObjectEmbeddings":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.writeRetrainArchive":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineExecutor.cacheFrameInPool":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.clearDeviceOverrides":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.clearModelBoundDeviceOverrides":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.deleteModel":{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.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.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.validatePipeline":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.abortNodeBenchmark":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.applyAutoTune":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"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.deleteNodeBenchmarkResult":{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.getEffectiveShares":{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.getNodeBenchmarkCandidates":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getNodeBenchmarkPreflight":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getNodeBenchmarkStatus":{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.getPlacementStats":{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.listNodeBenchmarkResults":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.pauseForStorageMigration":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.planAutoTune":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.rebalance":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.reconcileFromDisk":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.removeAgentSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.requestOccupancyLook":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.resetNodePipelineDefaults":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.resolvePipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.resumeForStorageMigration":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentCapabilities":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentDecodeLimits":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentInferenceDevices":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentMaxCameras":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentReachableHost":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraPipelineForAgent":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraSensors":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraStepOverride":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraStepSettings":{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.setLoadBalancingShares":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setPipelineDevicePin":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setShareSource":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.startNodeBenchmark":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.suggestShares":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.unassignAudio":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.unassignPipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.abortNodeBench":{capName:`pipeline-runner`,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.getNodeBenchStatus":{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`},"pipelineRunner.startNodeBench":{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.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.unassignProfile":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.unsubscribeAudioChunks":{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`},"training.canaryResult":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.cancelJob":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.discardResult":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.getJob":{capName:`training`,capScope:`system`,addonId:null,access:`view`},"training.getJobResult":{capName:`training`,capScope:`system`,addonId:null,access:`view`},"training.listBaseModels":{capName:`training`,capScope:`system`,addonId:null,access:`view`},"training.listJobs":{capName:`training`,capScope:`system`,addonId:null,access:`view`},"training.planJob":{capName:`training`,capScope:`system`,addonId:null,access:`view`},"training.registerResult":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.rollbackCanary":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.startJob":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.startJobBatch":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.cancelJob":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.cleanupJob":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.createEntry":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.deleteEntry":{capName:`training-provider`,capScope:`system`,addonId:null,access:`delete`},"trainingProvider.describe":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.describeTypes":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.estimateJob":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.getJob":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.listEntries":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.listJobEvents":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.listJobs":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.offerArtifact":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.readResult":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.submitJob":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.updateEntry":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.uploadDataset":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.validateCredentials":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"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.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.findUserByExternalIdentity":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.getTotpStatus":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listApiKeys":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listExternalIdentities":{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.unlinkExternalIdentity":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.updateUser":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"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.applyDownlinkProbe":{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`}}),QX=`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.calendar-source.calendars.camera-credentials.camera-grid-layout.camera-pipeline-config.camera-streams.carbon-monoxide.climate-control.color.composer.connection-test.connectivity.consumables.contact.control.core-blocks.cover.custom-model-registry.data-store-provider.database-snapshot.day-night.decoder.detection-pipeline.device-admin-link.device-adoption.device-discovery.device-export.device-extension.device-manager.device-ops.device-provider.device-state.device-status.doorbell.embedding-encoder.enum-sensor.event-emitter.face-gallery.failure-contribution.fan-control.feature-probe.filesystem-browse.flood.gas.humidifier.humidity-sensor.image.image-settings.integrations.intercom.keychain.keychain-admin.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.oidc-connections.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.training.training-provider.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(`.`),$X=`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(`.`),eZ=`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.calendar-source.calendars.composer.connection-test.core-blocks.custom-model-registry.data-store-provider.database-snapshot.decoder.device-adoption.device-export.device-manager.device-provider.device-state.embedding-encoder.face-gallery.failure-contribution.filesystem-browse.integrations.keychain.keychain-admin.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.oidc-connections.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.training.training-provider.turn-provider.user-management.user-passkeys.vector-store.viewer-ui`.split(`.`),tZ=[{id:`switch.on`,label:`Turn on`,cap:`switch`,method:`setState`,args:{on:!0}},{id:`switch.off`,label:`Turn off`,cap:`switch`,method:`setState`,args:{on:!1}},{id:`lock.lock`,label:`Lock`,cap:`lock-control`,method:`lock`,args:{}},{id:`lock.unlock`,label:`Unlock`,cap:`lock-control`,method:`unlock`,args:{}},{id:`lock.open`,label:`Open latch`,cap:`lock-control`,method:`open`,args:{}},{id:`cover.open`,label:`Open`,cap:`cover`,method:`open`,args:{}},{id:`cover.close`,label:`Close`,cap:`cover`,method:`close`,args:{}},{id:`cover.stop`,label:`Stop`,cap:`cover`,method:`stop`,args:{}},{id:`valve.open`,label:`Open valve`,cap:`valve`,method:`open`,args:{}},{id:`valve.close`,label:`Close valve`,cap:`valve`,method:`close`,args:{}},{id:`valve.stop`,label:`Stop valve`,cap:`valve`,method:`stop`,args:{}},{id:`humidifier.on`,label:`Humidifier on`,cap:`humidifier`,method:`setOn`,args:{on:!0}},{id:`humidifier.off`,label:`Humidifier off`,cap:`humidifier`,method:`setOn`,args:{on:!1}},{id:`waterHeater.off`,label:`Water heater off`,cap:`water-heater`,method:`setOperationMode`,args:{mode:`off`}},{id:`waterHeater.awayOn`,label:`Water heater away on`,cap:`water-heater`,method:`setAway`,args:{on:!0}},{id:`waterHeater.awayOff`,label:`Water heater away off`,cap:`water-heater`,method:`setAway`,args:{on:!1}},{id:`climate.off`,label:`Climate off`,cap:`climate-control`,method:`setMode`,args:{mode:`off`}},{id:`climate.heat`,label:`Heat`,cap:`climate-control`,method:`setMode`,args:{mode:`heat`}},{id:`climate.cool`,label:`Cool`,cap:`climate-control`,method:`setMode`,args:{mode:`cool`}},{id:`climate.auto`,label:`Climate auto`,cap:`climate-control`,method:`setMode`,args:{mode:`auto`}},{id:`fan.off`,label:`Fan off`,cap:`fan-control`,method:`setPercentage`,args:{percentage:0}},{id:`fan.full`,label:`Fan full`,cap:`fan-control`,method:`setPercentage`,args:{percentage:100}},{id:`vacuum.start`,label:`Start cleaning`,cap:`vacuum-control`,method:`start`,args:{}},{id:`vacuum.pause`,label:`Pause`,cap:`vacuum-control`,method:`pause`,args:{}},{id:`vacuum.stop`,label:`Stop`,cap:`vacuum-control`,method:`stop`,args:{}},{id:`vacuum.dock`,label:`Return to base`,cap:`vacuum-control`,method:`returnToBase`,args:{}},{id:`lawnMower.start`,label:`Start mowing`,cap:`lawn-mower-control`,method:`startMowing`,args:{}},{id:`lawnMower.pause`,label:`Pause mower`,cap:`lawn-mower-control`,method:`pause`,args:{}},{id:`lawnMower.dock`,label:`Dock mower`,cap:`lawn-mower-control`,method:`dock`,args:{}},{id:`media.play`,label:`Play`,cap:`media-player`,method:`play`,args:{}},{id:`media.pause`,label:`Pause media`,cap:`media-player`,method:`pause`,args:{}},{id:`media.stop`,label:`Stop media`,cap:`media-player`,method:`stop`,args:{}},{id:`media.next`,label:`Next track`,cap:`media-player`,method:`next`,args:{}},{id:`media.previous`,label:`Previous track`,cap:`media-player`,method:`previous`,args:{}},{id:`script.run`,label:`Run script`,cap:`script-runner`,method:`run`,args:{}},{id:`script.stop`,label:`Stop script`,cap:`script-runner`,method:`stop`,args:{}},{id:`haAutomation.enable`,label:`Enable automation`,cap:`automation-control`,method:`enable`,args:{}},{id:`haAutomation.disable`,label:`Disable automation`,cap:`automation-control`,method:`disable`,args:{}},{id:`haAutomation.trigger`,label:`Trigger automation`,cap:`automation-control`,method:`trigger`,args:{}},{id:`petFeeder.feed`,label:`Feed`,cap:`pet-feeder`,method:`feed`,openArgs:[{key:`grams`,label:`Grams`,kind:`number`}]},{id:`petFeeder.callPet`,label:`Call pet`,cap:`pet-feeder`,method:`callPet`,args:{}},{id:`ptz.goHome`,label:`PTZ go home`,cap:`ptz`,method:`goHome`,args:{}},{id:`ptz.goToPreset`,label:`PTZ go to preset`,cap:`ptz`,method:`goToPreset`,openArgs:[{key:`presetId`,label:`Preset id`,kind:`string`}]},{id:`ptz.autotrackOn`,label:`Autotrack on`,cap:`ptz-autotrack`,method:`setEnabled`,args:{enabled:!0}},{id:`ptz.autotrackOff`,label:`Autotrack off`,cap:`ptz-autotrack`,method:`setEnabled`,args:{enabled:!1}},{id:`privacy.maskOn`,label:`Privacy mask on`,cap:`privacy-mask`,method:`setMask`,args:{patch:{enabled:!0}}},{id:`privacy.maskOff`,label:`Privacy mask off`,cap:`privacy-mask`,method:`setMask`,args:{patch:{enabled:!1}}},{id:`privacy.micOn`,label:`Microphone on`,cap:`privacy-mask`,method:`setAudioEnabled`,args:{enabled:!0}},{id:`privacy.micOff`,label:`Microphone off`,cap:`privacy-mask`,method:`setAudioEnabled`,args:{enabled:!1}},{id:`dayNight.auto`,label:`Day/night auto`,cap:`day-night`,method:`setSettings`,args:{settings:{mode:`auto`}}},{id:`dayNight.day`,label:`Day mode`,cap:`day-night`,method:`setSettings`,args:{settings:{mode:`day`}}},{id:`dayNight.night`,label:`Night mode`,cap:`day-night`,method:`setSettings`,args:{settings:{mode:`night`}}},{id:`reboot.reboot`,label:`Reboot device`,cap:`reboot`,method:`reboot`,args:{}},{id:`brightness.full`,label:`Brightness full`,cap:`brightness`,method:`setBrightness`,args:{percentage:100}},{id:`brightness.half`,label:`Brightness half`,cap:`brightness`,method:`setBrightness`,args:{percentage:50}},{id:`brightness.off`,label:`Brightness off`,cap:`brightness`,method:`setBrightness`,args:{percentage:0}},{id:`motionTrigger.on`,label:`Motion trigger on`,cap:`motion-trigger`,method:`setMotionTrigger`,args:{enabled:!0}},{id:`motionTrigger.off`,label:`Motion trigger off`,cap:`motion-trigger`,method:`setMotionTrigger`,args:{enabled:!1}},{id:`alarm.trigger`,label:`Trigger alarm`,cap:`alarm-panel`,method:`trigger`,args:{}},{id:`alarm.disarm`,label:`Disarm`,cap:`alarm-panel`,method:`disarm`,args:{}},{id:`alarm.arm.home`,label:`Arm home`,cap:`alarm-panel`,method:`arm`,args:{mode:`home`}},{id:`alarm.arm.away`,label:`Arm away`,cap:`alarm-panel`,method:`arm`,args:{mode:`away`}},{id:`alarm.arm.night`,label:`Arm night`,cap:`alarm-panel`,method:`arm`,args:{mode:`night`}},{id:`alarm.arm.vacation`,label:`Arm vacation`,cap:`alarm-panel`,method:`arm`,args:{mode:`vacation`}},{id:`alarm.arm.custom_bypass`,label:`Arm custom bypass`,cap:`alarm-panel`,method:`arm`,args:{mode:`custom_bypass`}},{id:`button.press`,label:`Press`,cap:`button`,method:`press`,args:{}}];function nZ(e){for(let[t,n]of Object.entries(ZX))if(n.capName===e.cap&&n.capScope===`device`&&n.access!==`view`&&t.slice(t.indexOf(`.`)+1)===e.method)return!0;return!1}function rZ(e,t){if(e===t)return!0;if(e===null||t===null)return e===t;if(typeof e!=`object`||typeof t!=`object`)return!1;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!rZ(e[n],t[n]))return!1;return!0}let n=e,r=t,i=Object.keys(n),a=Object.keys(r);if(i.length!==a.length)return!1;for(let e of i)if(!rZ(n[e],r[e]))return!1;return!0}function iZ(e,t){return rZ(e??{},t??{})}function aZ(e,t){if(e.openArgs!==void 0){let n=new Set(e.openArgs.map(e=>e.key)),r=e.args??{},i=t??{};for(let e of Object.keys(r))if(!rZ(r[e],i[e]))return!1;for(let e of Object.keys(i))if(!n.has(e)&&!(e in r))return!1;return!0}return iZ(e.args,t)}var oZ={[k.Camera]:[`ptz`,`ptz-autotrack`,`privacy-mask`,`day-night`,`reboot`,`motion-trigger`],[k.Hub]:[],[k.Light]:[`switch`,`brightness`],[k.Siren]:[`switch`,`motion-trigger`],[k.Switch]:[`switch`,`motion-trigger`],[k.Sensor]:[],[k.Thermostat]:[`climate-control`],[k.Climate]:[`climate-control`],[k.Button]:[`button`],[k.EventEmitter]:[],[k.Update]:[],[k.Generic]:[],[k.Notifier]:[],[k.Script]:[`script-runner`],[k.Automation]:[`automation-control`],[k.Lock]:[`lock-control`],[k.Cover]:[`cover`],[k.Valve]:[`valve`],[k.Humidifier]:[`humidifier`],[k.WaterHeater]:[`water-heater`],[k.Fan]:[`fan-control`,`switch`],[k.MediaPlayer]:[`media-player`],[k.AlarmPanel]:[`alarm-panel`],[k.Control]:[],[k.Presence]:[],[k.Weather]:[],[k.Vacuum]:[`vacuum-control`],[k.LawnMower]:[`lawn-mower-control`],[k.Container]:[],[k.Image]:[],[k.PetFeeder]:[`pet-feeder`]};function sZ(e){return e!==k.Container}function cZ(e){switch(e){case k.Climate:case k.Thermostat:case k.Humidifier:case k.WaterHeater:return`climate-family`;case k.Cover:case k.Valve:return`cover-family`;case k.Switch:case k.Siren:case k.Light:return`switch-family`;case k.Vacuum:case k.LawnMower:return`robot-family`;default:return e}}function lZ(e,t){return cZ(e)===cZ(t)}function uZ(e){if(e.length===0)return[];let t=new Set(e);return tZ.filter(e=>t.has(e.cap)&&nZ(e))}function dZ(e){return Object.values(k).includes(e)?uZ(oZ[e]):[]}function fZ(e){let t=e.boundCaps!==void 0&&e.boundCaps.length>0?uZ(e.boundCaps):[];return t.length>0?t:e.deviceType!==void 0&&e.deviceType.length>0?dZ(e.deviceType):[]}function pZ(e){if(e.length===0)return[];let t=null;for(let n of e){let e=fZ({boundCaps:n.boundCaps,deviceType:n.deviceType});if(t===null){t=e;continue}let r=new Set(e.map(e=>e.id));t=t.filter(e=>r.has(e.id))}return t??[]}function mZ(){return tZ.filter(nZ)}function hZ(e,t,n){for(let r of tZ)if(!(r.cap!==e||r.method!==t)&&aZ(r,n))return r;return null}function gZ(e,t,n){let r=hZ(e,t,n);return r===null?`custom:${e}.${t}`:r.id}function _Z(e,t){return!e||e.length===0?!1:e.includes(t.when.hasFeature)}var vZ={id:`battery`,label:`Battery-operated camera`,when:{hasFeature:ji.BatteryOperated},defaults:{audioMode:`disabled`,detectionMode:`on-motion`},settings:{}},yZ=[vZ];function bZ(e){for(let t of yZ)if(_Z(e,t))return t;return null}var xZ=[`device`,`lighting`,`sensing`,`place`,`life`],SZ=[{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`]}],CZ=SZ.map(e=>e.key),wZ=SZ.filter(e=>e.aliasOf===void 0).map(e=>e.key),TZ=new Map(SZ.map(e=>[e.key,e]));function EZ(e){return typeof e==`string`&&TZ.has(e)}function DZ(e,t){return typeof e==`string`&&EZ(e)?e:t}function OZ(e){return TZ.get(e)}function kZ(e){return SZ.filter(t=>t.group===e)}function AZ(e){return e.normalize(`NFD`).replace(/\p{Diacritic}/gu,``).toLowerCase().replace(/[_-]+/g,` `).trim()}function jZ(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 MZ(e,t){return t===e?100:t.startsWith(e)?80:t.split(` `).some(t=>t.startsWith(e))?60:t.includes(e)?40:jZ(e,t)?15:0}function NZ(e,t){let n=AZ(e);if(n.length===0)return SZ.filter(e=>e.aliasOf===void 0).map(e=>({entry:e,score:0}));let r=[];for(let e of SZ){if(e.aliasOf!==void 0)continue;let i=[AZ(e.key),...e.synonyms.map(AZ),...(t?.get(e.key)??[]).map(AZ)],a=0;for(let[e,t]of i.entries()){let r=MZ(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 PZ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function FZ(e,t){let n=t.split(`.`),r=e;for(let e of n){if(!PZ(r))return;r=r[e]}return r}function IZ(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=PZ(o)?o:{};return{...e,[i]:IZ(s,a,n)}}var LZ=3e4,RZ=3,zZ=1e4;async function BZ(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 VZ(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 BZ(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 HZ=`lastFetchedAt`,UZ=6e4,WZ=10*6e4;function GZ(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)?.[HZ];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)},h=e=>{let t=d;if(t!==null)return t;let n=m(e).catch(()=>void 0).finally(()=>{d=null});return d=n,n},g=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){h(r);return}await h(r);return}await m(r)}},_=()=>{let e=t.getCapState(n.name);if(!e)return o();let{[HZ]:r,...i}=e;return i};return{ensureFresh:g,getStatus:async({deviceId:e})=>{if(e!==r)throw Error(`${n.name}: deviceId mismatch, expected ${r}, got ${e}`);return await g(),_()}}}var KZ=`device.state-changed`,qZ=`capability.binding-changed`,JZ=`device.registered`,YZ=`device.unregistered`,XZ=`device.updated`,ZZ=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=di(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?pi(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&&!QZ(n,e.id)||e.stableId!==void 0&&(!i||!QZ(i.stableId,e.stableId))||e.addonId!==void 0&&(!i||!QZ(i.addonId,e.addonId))||e.type!==void 0&&(!i||!QZ(i.type,e.type)))continue;if(e.caps!==void 0){let t=$Z(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=$Z(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||!eQ(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||!$Z(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:KZ},{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:qZ},{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:JZ},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.refreshDeviceMetadata(t.deviceId,`added`)}})),this.bridges.push(e.subscribe({category:YZ},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.applyDeviceRemoval(t.deviceId)}})),this.bridges.push(e.subscribe({category:XZ},{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 QZ(e,t){return Array.isArray(t)?t.includes(e):e===t}function $Z(e){return Array.isArray(e)?e:[e]}function eQ(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 tQ(e){return e.def}function nQ(e){return e}function rQ(e,t=`Configuration`,n=`main`){return{sections:[{id:n,title:t,fields:e.map(e=>iQ(e.key,e.schema,e.description))}]}}function iQ(e,t,n){let r=lQ(t),i=uQ(t),a={key:e,label:n??dQ(e),description:n,default:i};if(r instanceof te&&oi(t))return{...a,type:`password`,showToggle:!0};if(r instanceof te)return aQ(e,a);if(r instanceof ee)return oQ(r,a);if(r instanceof ie)return{...a,type:`boolean`};if(r instanceof ce)return cQ(r,a);if(r instanceof le||r instanceof oe){let e=oi(t)||si(t).length>0;return{...a,type:`textarea`,rows:6,isJson:!0,...e?{secret:!0}:{}}}return{...a,type:`text`}}function aQ(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 oQ(e,t){let n=nQ(e),r=n.minValue,i=n.maxValue,a=r!=null&&isFinite(r)?r:void 0,o=i!=null&&isFinite(i)?i:void 0,s=sQ(e);return{...t,type:`number`,...a===void 0?{}:{min:a},...o===void 0?{}:{max:o},...s===void 0?{}:{step:s}}}function sQ(e){let t=tQ(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 cQ(e,t){let n=e.options.map(e=>String(e));return{...t,type:`select`,options:n.map(e=>({label:dQ(e),value:e}))}}function lQ(e){return e instanceof g||e instanceof fe||e instanceof ue?lQ(tQ(e).innerType):e}function uQ(e){if(e instanceof g)return tQ(e).defaultValue}function dQ(e){return e.replace(/([A-Z])/g,` $1`).replace(/[_-]/g,` `).replace(/^\w/,e=>e.toUpperCase()).trim()}var fQ=`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(`.`),pQ={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`,calendarSource:`calendar-source`,calendars:`calendars`,cameraCredentials:`camera-credentials`,cameraGridLayout:`camera-grid-layout`,cameraPipelineConfig:`camera-pipeline-config`,cameraStreams:`camera-streams`,carbonMonoxide:`carbon-monoxide`,climateControl:`climate-control`,color:`color`,composer:`composer`,connectionTest:`connection-test`,connectivity:`connectivity`,consumables:`consumables`,contact:`contact`,control:`control`,coreBlocks:`core-blocks`,cover:`cover`,customModelRegistry:`custom-model-registry`,dataStoreProvider:`data-store-provider`,databaseSnapshot:`database-snapshot`,dayNight:`day-night`,decoder:`decoder`,detectionPipeline:`detection-pipeline`,deviceAdminLink:`device-admin-link`,deviceAdoption:`device-adoption`,deviceDiscovery:`device-discovery`,deviceExport:`device-export`,deviceExtension:`device-extension`,deviceManager:`device-manager`,deviceOps:`device-ops`,deviceProvider:`device-provider`,deviceState:`device-state`,deviceStatus:`device-status`,doorbell:`doorbell`,embeddingEncoder:`embedding-encoder`,enumSensor:`enum-sensor`,eventEmitter:`event-emitter`,faceGallery:`face-gallery`,failureContribution:`failure-contribution`,fanControl:`fan-control`,featureProbe:`feature-probe`,filesystemBrowse:`filesystem-browse`,flood:`flood`,gas:`gas`,humidifier:`humidifier`,humiditySensor:`humidity-sensor`,image:`image`,imageSettings:`image-settings`,integrations:`integrations`,intercom:`intercom`,keychain:`keychain`,keychainAdmin:`keychain-admin`,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`,oidcConnections:`oidc-connections`,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`,training:`training`,trainingProvider:`training-provider`,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`},mQ=[{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:`calendarSource`,name:`calendar-source`},{key:`calendars`,name:`calendars`},{key:`cameraCredentials`,name:`camera-credentials`},{key:`cameraGridLayout`,name:`camera-grid-layout`},{key:`cameraPipelineConfig`,name:`camera-pipeline-config`},{key:`cameraStreams`,name:`camera-streams`},{key:`carbonMonoxide`,name:`carbon-monoxide`},{key:`climateControl`,name:`climate-control`},{key:`color`,name:`color`},{key:`composer`,name:`composer`},{key:`connectionTest`,name:`connection-test`},{key:`connectivity`,name:`connectivity`},{key:`consumables`,name:`consumables`},{key:`contact`,name:`contact`},{key:`control`,name:`control`},{key:`coreBlocks`,name:`core-blocks`},{key:`cover`,name:`cover`},{key:`customModelRegistry`,name:`custom-model-registry`},{key:`dataStoreProvider`,name:`data-store-provider`},{key:`databaseSnapshot`,name:`database-snapshot`},{key:`dayNight`,name:`day-night`},{key:`decoder`,name:`decoder`},{key:`detectionPipeline`,name:`detection-pipeline`},{key:`deviceAdminLink`,name:`device-admin-link`},{key:`deviceAdoption`,name:`device-adoption`},{key:`deviceDiscovery`,name:`device-discovery`},{key:`deviceExport`,name:`device-export`},{key:`deviceExtension`,name:`device-extension`},{key:`deviceManager`,name:`device-manager`},{key:`deviceOps`,name:`device-ops`},{key:`deviceProvider`,name:`device-provider`},{key:`deviceState`,name:`device-state`},{key:`deviceStatus`,name:`device-status`},{key:`doorbell`,name:`doorbell`},{key:`embeddingEncoder`,name:`embedding-encoder`},{key:`enumSensor`,name:`enum-sensor`},{key:`eventEmitter`,name:`event-emitter`},{key:`faceGallery`,name:`face-gallery`},{key:`failureContribution`,name:`failure-contribution`},{key:`fanControl`,name:`fan-control`},{key:`featureProbe`,name:`feature-probe`},{key:`filesystemBrowse`,name:`filesystem-browse`},{key:`flood`,name:`flood`},{key:`gas`,name:`gas`},{key:`humidifier`,name:`humidifier`},{key:`humiditySensor`,name:`humidity-sensor`},{key:`image`,name:`image`},{key:`imageSettings`,name:`image-settings`},{key:`integrations`,name:`integrations`},{key:`intercom`,name:`intercom`},{key:`keychain`,name:`keychain`},{key:`keychainAdmin`,name:`keychain-admin`},{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:`oidcConnections`,name:`oidc-connections`},{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:`training`,name:`training`},{key:`trainingProvider`,name:`training-provider`},{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`}],hQ=[dR,Nm,Fm,zm,Gm,Qm,Xm,JR,Rr,XR,lE,rh,QR,ih,Sh,Ah,rz,Mh,az,eg,sz,lz,dz,xg,fz,_z,Cz,Ez,Mz,Sg,Yg,Pz,Lz,Hz,G_,qz,Yz,eB,nB,oB,Ay,lB,Fy,Ky,Bh,hB,hb,gb,yb,Yb,Ib,ix,pS,Gx,Xr,xx,vS,_B,bB,IS,CB,EB,LB,zS,BB,HB,HS,WB,KB,JB,XB,QB,sV,gV,bV,eb,fb,wV,pw,ew,_w,WV,qV,yw,Sw,Ow,QV,nH,Jw,Xw,$w,oH,nT,lH,mH,mT,SH,IH,vT,HH,KH,uU,FT,JO,_U,yU,ok,uk,TU,RU,WU,uM,UM,HF,tF,XU,fW,mW,_W,yW,TW,FW,BW,VW,$W,bG,HG,tK,wK,JK,$K,cI,Wy,tq,pI,gI,vI,bI,CI,wI,EI,RI,Wg,iq,dq,VI,_q,Jq,Xq,Qq,XI,eJ,pY,eY,QI,nJ,hJ,eL,yJ,SJ,TL,wJ,QL,Kr,EJ,OJ,lR,LJ,zJ,vP],gQ=Object.freeze({"accessories.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"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}],"airQualitySensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"alarmPanel.arm":[{name:`deviceId`,form:`single`,optional:!1}],"alarmPanel.disarm":[{name:`deviceId`,form:`single`,optional:!1}],"alarmPanel.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"alarmPanel.trigger":[{name:`deviceId`,form:`single`,optional:!1}],"ambientLightSensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"audioAnalysis.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"audioAnalysis.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"audioAnalysis.getDeviceSettingsContribution":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"automationControl.trigger":[{name:`deviceId`,form:`single`,optional:!1}],"battery.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"battery.wakeForStream":[{name:`deviceId`,form:`single`,optional:!1}],"binary.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"brightness.getStatus":[{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}],"cameraCredentials.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"cameraGridLayout.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"cameraGridLayout.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"cameraGridLayout.getDeviceSettingsContribution":[{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}],"cameraPipelineConfig.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"cameraPipelineConfig.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"cameraPipelineConfig.getDeviceSettingsContribution":[{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}],"carbonMonoxide.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"climateControl.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"color.setColor":[{name:`deviceId`,form:`single`,optional:!1}],"connectivity.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"consumables.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"consumables.reset":[{name:`deviceId`,form:`single`,optional:!1}],"contact.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"control.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"control.setValue":[{name:`deviceId`,form:`single`,optional:!1}],"cover.close":[{name:`deviceId`,form:`single`,optional:!1}],"cover.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"dayNight.setSettings":[{name:`deviceId`,form:`single`,optional:!1}],"detectionPipeline.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"detectionPipeline.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"detectionPipeline.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"deviceAdminLink.getAdminLink":[{name:`deviceId`,form:`single`,optional:!1}],"deviceAdoption.getStatus":[{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.getStatus":[{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}],"deviceExport.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExport.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExport.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.listCandidates":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.listSlots":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.listSources":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.setSlot":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.adoptionRelease":[{name:`camDeviceId`,form:`single`,optional:!1}],"deviceManager.adoptionResync":[{name:`camDeviceId`,form:`single`,optional:!1}],"deviceManager.applyInitialMeta":[{name:`deviceId`,form:`single`,optional:!1},{name:`linkDeviceId`,form:`single`,optional:!0}],"deviceManager.disable":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.enable":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getBindings":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getBindingsBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"deviceManager.getChildren":[{name:`parentDeviceId`,form:`single`,optional:!1}],"deviceManager.getChildrenBatch":[{name:`parentDeviceIds`,form:`array`,optional:!1}],"deviceManager.getConfigSchema":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDevice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceLiveInfoAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceSettingsAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceStatusAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceStatusAggregateBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"deviceManager.getLinkedDevices":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getLinkedDevicesBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"deviceManager.getSettingsSchema":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getStreamProfileMap":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getStreamSources":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getWireableFields":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getWrapperActivation":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.listAll":[{name:`deviceIds`,form:`array`,optional:!0}],"deviceManager.loadConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.loadMeta":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.loadRuntimeState":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.persistConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.probeStreams":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.registerDevice":[{name:`parentDeviceId`,form:`single`,optional:!0}],"deviceManager.remove":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.removeDevice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.runDeviceAction":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setChildLayout":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setDisabled":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setDisplay":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setIntegrationId":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setLinkDeviceId":[{name:`deviceId`,form:`single`,optional:!1},{name:`linkDeviceId`,form:`single`,optional:!0}],"deviceManager.setLocation":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setMetadata":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setName":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setPrimaryChildEntityId":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setRole":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setStreamProfileMap":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setType":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setWrapperActive":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.testField":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.updateConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.updateDeviceField":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.updateDeviceFieldsBatch":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getConfigEntries":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getRawState":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getSettingsSchema":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getStreamSources":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.removeDevice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.runAction":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.setConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.claimFields":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.getCapSlice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.getNativeCapSlice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.getSnapshot":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.patchOwnedFields":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.releaseClaim":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.setCapSlice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceStatus.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"doorbell.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"enumSensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"eventEmitter.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"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}],"featureProbe.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"flood.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"gas.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"humidifier.getStatus":[{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}],"humiditySensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"image.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"imageSettings.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"imageSettings.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"imageSettings.setSettings":[{name:`deviceId`,form:`single`,optional:!1}],"intercom.endTalkSession":[{name:`deviceId`,form:`single`,optional:!1}],"intercom.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"lawnMowerControl.pause":[{name:`deviceId`,form:`single`,optional:!1}],"lawnMowerControl.startMowing":[{name:`deviceId`,form:`single`,optional:!1}],"lockControl.getStatus":[{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.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"motion.isDetected":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.analyze":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.removeCamera":[{name:`deviceId`,form:`single`,optional:!1}],"motionTrigger.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"motionTrigger.setMotionTrigger":[{name:`deviceId`,form:`single`,optional:!1}],"motionZones.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"motionZones.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"motionZones.setZone":[{name:`deviceId`,form:`single`,optional:!1}],"nativeObjectDetection.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"nativeObjectDetection.getStatus":[{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.getStatus":[{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}],"networkLink.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"networkQuality.getDeviceStats":[{name:`deviceId`,form:`single`,optional:!1}],"networkQuality.reportClientStats":[{name:`deviceId`,form:`single`,optional:!1}],"notificationRules.getAlarmSensors":[{name:`deviceIds`,form:`array`,optional:!1}],"notificationRules.setDeviceMuted":[{name:`deviceId`,form:`single`,optional:!1}],"notifier.cancel":[{name:`deviceId`,form:`single`,optional:!1}],"notifier.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"notifier.send":[{name:`deviceId`,form:`single`,optional:!1}],"numericSensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"osd.getStatus":[{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}],"osdManager.setSlotCameraEnabled":[{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.getStatus":[{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.addRetrainFrameFromRecording":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.clearTrackRelation":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.clearTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.completeRetrainTrack":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.deleteDeviceEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.deleteTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.deselectRetrainFrame":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getActiveTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getAudioEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getEventDensity":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getEventDensityBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.getEventMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getEventMediaFootprintByKind":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.getKeyEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getKeyEventsBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.getMotionEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getObjectEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getRetrainExportUrl":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.getSensorEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getTrack":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getTrackMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getTrainingExportSummary":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.getTrainingExportUrl":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.listArchivedDebugNotes":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.listBirthDecisions":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.listEventKinds":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listEventKindsBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.listEventMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listOpsLog":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.listRecentTracks":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.listRetrainCorpusPage":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.listRetrainStaging":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.listTrackMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listTrackRelations":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.ownersWithMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.proposeRetrainAnnotations":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.proposeRetrainAnnotationsWithLlm":[{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.setRetrainFrameComplete":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.setTrackFlags":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.setTrackPurity":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.setTrackRelation":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.wipeAllAnalytics":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineExecutor.clearModelBoundDeviceOverrides":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineExecutor.runPipeline":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineExecutor.runPipelineBatch":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineOrchestrator.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"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.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getPipelineAssignment":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getPipelineDevicePin":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.requestOccupancyLook":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.resolvePipeline":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraPipelineForAgent":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraSensors":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraStepOverride":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraStepSettings":[{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}],"powerMeter.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"presence.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"pressureSensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"privacyMask.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"privacyMask.getStatus":[{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.getStatus":[{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.applyDeviceSettingsPatch":[{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.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.getStatus":[{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.getStatus":[{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.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"scriptRunner.run":[{name:`deviceId`,form:`single`,optional:!1}],"scriptRunner.stop":[{name:`deviceId`,form:`single`,optional:!1}],"smoke.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.getDebugState":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.getDeviceSettingsContribution":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.invalidateCache":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.acquireEgressTranscode":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.applyDeviceSettingsPatch":[{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.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.getDeviceSettingsContribution":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"streamParams.setProfile":[{name:`deviceId`,form:`single`,optional:!1}],"switch.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"switch.setState":[{name:`deviceId`,form:`single`,optional:!1}],"tamper.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"temperatureSensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"training.canaryResult":[{name:`deviceIds`,form:`array`,optional:!1}],"update.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"vacuumControl.getStatus":[{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.getStatus":[{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}],"vibration.getStatus":[{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.getStatus":[{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}],"weather.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.addIceCandidate":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.applyDownlinkProbe":[{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}]}),_Q=`addonSettings.getDeviceSettings,addonSettings.updateDeviceSettings,audioAnalyzer.attachDevice,audioAnalyzer.classify,audioAnalyzer.detachDevice,deviceAdoption.getStatus,deviceAdoption.release,deviceAdoption.resync,deviceExport.applyDeviceSettingsPatch,deviceExport.getDeviceLiveContribution,deviceExport.getDeviceSettingsContribution,deviceManager.adoptionRelease,deviceManager.adoptionResync,deviceManager.applyInitialMeta,deviceManager.disable,deviceManager.enable,deviceManager.getBindings,deviceManager.getBindingsBatch,deviceManager.getChildren,deviceManager.getChildrenBatch,deviceManager.getConfigSchema,deviceManager.getDevice,deviceManager.getDeviceAggregate,deviceManager.getDeviceLiveInfoAggregate,deviceManager.getDeviceSettingsAggregate,deviceManager.getDeviceStatusAggregate,deviceManager.getDeviceStatusAggregateBatch,deviceManager.getLinkedDevices,deviceManager.getLinkedDevicesBatch,deviceManager.getSettingsSchema,deviceManager.getStreamProfileMap,deviceManager.getStreamSources,deviceManager.getWireableFields,deviceManager.getWrapperActivation,deviceManager.listAll,deviceManager.loadConfig,deviceManager.loadMeta,deviceManager.loadRuntimeState,deviceManager.persistConfig,deviceManager.probeStreams,deviceManager.registerDevice,deviceManager.remove,deviceManager.removeDevice,deviceManager.runDeviceAction,deviceManager.setChildLayout,deviceManager.setDisabled,deviceManager.setDisplay,deviceManager.setIntegrationId,deviceManager.setLinkDeviceId,deviceManager.setLocation,deviceManager.setMetadata,deviceManager.setName,deviceManager.setPrimaryChildEntityId,deviceManager.setRole,deviceManager.setStreamProfileMap,deviceManager.setType,deviceManager.setWrapperActive,deviceManager.testField,deviceManager.updateConfig,deviceManager.updateDeviceField,deviceManager.updateDeviceFieldsBatch,deviceState.claimFields,deviceState.getCapSlice,deviceState.getNativeCapSlice,deviceState.getSnapshot,deviceState.patchOwnedFields,deviceState.releaseClaim,deviceState.setCapSlice,faceGallery.getFaceByTrack,faceGallery.listRecentFaces,networkQuality.getDeviceStats,networkQuality.reportClientStats,notificationRules.getAlarmSensors,notificationRules.setDeviceMuted,osdManager.clearSlotBinding,osdManager.copyDeviceConfiguration,osdManager.getDeviceOsd,osdManager.getSourceCatalog,osdManager.previewSlot,osdManager.renderDevice,osdManager.setSlotBinding,osdManager.setSlotCameraEnabled,pipelineExecutor.clearModelBoundDeviceOverrides,pipelineExecutor.runPipeline,pipelineExecutor.runPipelineBatch,pipelineOrchestrator.applyDeviceSettingsPatch,pipelineOrchestrator.assignAudio,pipelineOrchestrator.assignPipeline,pipelineOrchestrator.getAudioAssignment,pipelineOrchestrator.getCameraMetrics,pipelineOrchestrator.getCameraSettings,pipelineOrchestrator.getCameraStatus,pipelineOrchestrator.getCameraStatuses,pipelineOrchestrator.getCameraStepOverrides,pipelineOrchestrator.getCameraSwitches,pipelineOrchestrator.getDeviceLiveContribution,pipelineOrchestrator.getDeviceSettingsContribution,pipelineOrchestrator.getPipelineAssignment,pipelineOrchestrator.getPipelineDevicePin,pipelineOrchestrator.requestOccupancyLook,pipelineOrchestrator.resolvePipeline,pipelineOrchestrator.setCameraPipelineForAgent,pipelineOrchestrator.setCameraSensors,pipelineOrchestrator.setCameraStepOverride,pipelineOrchestrator.setCameraStepSettings,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.applyDeviceSettingsPatch,recordingArchive.deleteFootprint,recordingArchive.getAvailabilityBatch,recordingArchive.getDaysWithRecordingsBatch,recordingArchive.getDeviceConfig,recordingArchive.getDeviceLiveContribution,recordingArchive.getDeviceSettingsContribution,recordingArchive.getStatus,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.applyDeviceSettingsPatch,streamBroker.assignProfile,streamBroker.forgetDeviceHardware,streamBroker.getDeviceAudioMute,streamBroker.getDeviceLiveContribution,streamBroker.getDeviceSettingsContribution,streamBroker.getStreamWithCodec,streamBroker.produceEventMedia,streamBroker.publishCameraStream,streamBroker.renderPreBufferClip,streamBroker.reportStreamSignal,streamBroker.restartProfile,streamBroker.retractCameraStream,streamBroker.setDeviceAudioMute,streamBroker.unassignProfile,training.canaryResult`.split(`,`),vQ=Object.freeze({broker:`broker`,"calendar-source":`calendar`,"device-export":`device-export`,llm:`ai`,"mesh-network":`mesh`,"mqtt-broker":`broker`,"network-access":`ingress`,"smtp-provider":`email`}),yQ=[`broker`,`calendar-source`,`device-export`,`llm`,`mesh-network`,`mqtt-broker`,`network-access`,`smtp-provider`];function bQ(e){let t=[];for(let[n,r]of Object.entries(vQ))r===e&&t.push(n);return t}var xQ={"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 SQ(e){return xQ[e]??CQ}var CQ={durability:`session`,volatileFields:[]};function wQ(e){return SQ(e).durability===`restored`}var TQ=`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(`.`),EQ=[{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 DQ(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),listInstallations:e=>n(`addons`,`listInstallations`,`query`,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),getEncryption:e=>n(`backup`,`getEncryption`,`query`,e),setupEncryption:e=>n(`backup`,`setupEncryption`,`mutation`,e),disableEncryption:e=>n(`backup`,`disableEncryption`,`mutation`,e),checkBackupKey:e=>n(`backup`,`checkBackupKey`,`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)},calendars:{listCalendars:e=>n(`calendars`,`listCalendars`,`query`,e),listEvents:e=>n(`calendars`,`listEvents`,`query`,e),getPreferences:e=>n(`calendars`,`getPreferences`,`query`,e),setCalendarPreference:e=>n(`calendars`,`setCalendarPreference`,`mutation`,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),getBlockSettings:e=>n(`coreBlocks`,`getBlockSettings`,`query`,e),updateBlockSettings:e=>n(`coreBlocks`,`updateBlockSettings`,`mutation`,e),getTypeDefs:e=>n(`coreBlocks`,`getTypeDefs`,`query`,e),createComposition:e=>n(`coreBlocks`,`createComposition`,`mutation`,e),updateComposition:e=>n(`coreBlocks`,`updateComposition`,`mutation`,e),getComposition:e=>n(`coreBlocks`,`getComposition`,`query`,e),listCompositions:e=>n(`coreBlocks`,`listCompositions`,`query`,e),getCustomization:e=>n(`coreBlocks`,`getCustomization`,`query`,e),listComposableCaps:e=>n(`coreBlocks`,`listComposableCaps`,`query`,e),validateComposition:e=>n(`coreBlocks`,`validateComposition`,`mutation`,e)},decoder:{getInfo:e=>n(`decoder`,`getInfo`,`query`,e),reprobeHwaccel:e=>n(`decoder`,`reprobeHwaccel`,`mutation`,e)},deviceAdoption:{listCandidateFilters:e=>n(`deviceAdoption`,`listCandidateFilters`,`query`,e),listCandidates:e=>n(`deviceAdoption`,`listCandidates`,`query`,e),getCandidate:e=>n(`deviceAdoption`,`getCandidate`,`query`,e),refresh:e=>n(`deviceAdoption`,`refresh`,`mutation`,e),adopt:e=>n(`deviceAdoption`,`adopt`,`mutation`,e),release:e=>n(`deviceAdoption`,`release`,`mutation`,e),resync:e=>n(`deviceAdoption`,`resync`,`mutation`,e)},deviceExport:{getStatus:e=>n(`deviceExport`,`getStatus`,`query`,e),listSupportedDeviceKinds:e=>n(`deviceExport`,`listSupportedDeviceKinds`,`query`,e),listExposedDevices:e=>n(`deviceExport`,`listExposedDevices`,`query`,e),exposeDevice:e=>n(`deviceExport`,`exposeDevice`,`mutation`,e),unexposeDevice:e=>n(`deviceExport`,`unexposeDevice`,`mutation`,e)},deviceManager:{allocateDeviceId:e=>n(`deviceManager`,`allocateDeviceId`,`mutation`,e),migrateDevice:e=>n(`deviceManager`,`migrateDevice`,`mutation`,e),registerDevice:e=>n(`deviceManager`,`registerDevice`,`mutation`,e),removeDevice:e=>n(`deviceManager`,`removeDevice`,`mutation`,e),persistConfig:e=>n(`deviceManager`,`persistConfig`,`mutation`,e),getRoleDisplayDefaults:e=>n(`deviceManager`,`getRoleDisplayDefaults`,`query`,e),setRoleDisplayDefaults:e=>n(`deviceManager`,`setRoleDisplayDefaults`,`mutation`,e),listLocations:e=>n(`deviceManager`,`listLocations`,`query`,e),addLocation:e=>n(`deviceManager`,`addLocation`,`mutation`,e),removeLocation:e=>n(`deviceManager`,`removeLocation`,`mutation`,e),renameLocation:e=>n(`deviceManager`,`renameLocation`,`mutation`,e),listLocationIcons:e=>n(`deviceManager`,`listLocationIcons`,`query`,e),setLocationIcon:e=>n(`deviceManager`,`setLocationIcon`,`mutation`,e),listLocationDescriptions:e=>n(`deviceManager`,`listLocationDescriptions`,`query`,e),setLocationDescription:e=>n(`deviceManager`,`setLocationDescription`,`mutation`,e),listSiteZones:e=>n(`deviceManager`,`listSiteZones`,`query`,e),setSiteZone:e=>n(`deviceManager`,`setSiteZone`,`mutation`,e),removeSiteZone:e=>n(`deviceManager`,`removeSiteZone`,`mutation`,e),renameSiteZone:e=>n(`deviceManager`,`renameSiteZone`,`mutation`,e),setLocationZone:e=>n(`deviceManager`,`setLocationZone`,`mutation`,e),listPersistedByAddon:e=>n(`deviceManager`,`listPersistedByAddon`,`query`,e),listAll:e=>n(`deviceManager`,`listAll`,`query`,e),getChildren:e=>n(`deviceManager`,`getChildren`,`query`,e),getChildrenBatch:e=>n(`deviceManager`,`getChildrenBatch`,`query`,e),getLinkedDevicesBatch:e=>n(`deviceManager`,`getLinkedDevicesBatch`,`query`,e),removeByIntegration:e=>n(`deviceManager`,`removeByIntegration`,`mutation`,e),getBindingsBatch:e=>n(`deviceManager`,`getBindingsBatch`,`query`,e),getAllBindings:e=>n(`deviceManager`,`getAllBindings`,`query`,e),listDeviceIdsByCaps:e=>n(`deviceManager`,`listDeviceIdsByCaps`,`query`,e),listWrappersForCap:e=>n(`deviceManager`,`listWrappersForCap`,`query`,e),listBindableCapsForDeviceType:e=>n(`deviceManager`,`listBindableCapsForDeviceType`,`query`,e),discoverDevices:e=>n(`deviceManager`,`discoverDevices`,`mutation`,e),adoptDevice:e=>n(`deviceManager`,`adoptDevice`,`mutation`,e),getCreationSchema:e=>n(`deviceManager`,`getCreationSchema`,`query`,e),createDevice:e=>n(`deviceManager`,`createDevice`,`mutation`,e),testCreationField:e=>n(`deviceManager`,`testCreationField`,`mutation`,e),adoptionListCandidateFilters:e=>n(`deviceManager`,`adoptionListCandidateFilters`,`query`,e),adoptionListCandidates:e=>n(`deviceManager`,`adoptionListCandidates`,`query`,e),adoptionRefresh:e=>n(`deviceManager`,`adoptionRefresh`,`mutation`,e),adoptionAdopt:e=>n(`deviceManager`,`adoptionAdopt`,`mutation`,e),adoptionRelease:e=>n(`deviceManager`,`adoptionRelease`,`mutation`,e),adoptionStartJob:e=>n(`deviceManager`,`adoptionStartJob`,`mutation`,e),adoptionListJobs:e=>n(`deviceManager`,`adoptionListJobs`,`query`,e),adoptionCancelJob:e=>n(`deviceManager`,`adoptionCancelJob`,`mutation`,e),adoptionResync:e=>n(`deviceManager`,`adoptionResync`,`mutation`,e),discoveryProviders:e=>n(`deviceManager`,`discoveryProviders`,`query`,e),discoverAllProviders:e=>n(`deviceManager`,`discoverAllProviders`,`mutation`,e),discoverProvider:e=>n(`deviceManager`,`discoverProvider`,`mutation`,e),providerCreationType:e=>n(`deviceManager`,`providerCreationType`,`query`,e),providerDiscoveryParamsSchema:e=>n(`deviceManager`,`providerDiscoveryParamsSchema`,`query`,e),getDeviceStatusAggregateBatch:e=>n(`deviceManager`,`getDeviceStatusAggregateBatch`,`query`,e)},deviceProvider:{start:e=>n(`deviceProvider`,`start`,`mutation`,e),stop:e=>n(`deviceProvider`,`stop`,`mutation`,e),getStatus:e=>n(`deviceProvider`,`getStatus`,`query`,e),getDevices:e=>n(`deviceProvider`,`getDevices`,`query`,e),reloadDevice:e=>n(`deviceProvider`,`reloadDevice`,`mutation`,e),supportsDiscovery:e=>n(`deviceProvider`,`supportsDiscovery`,`query`,e),discoverDevices:e=>n(`deviceProvider`,`discoverDevices`,`mutation`,e),getDiscoveryParamsSchema:e=>n(`deviceProvider`,`getDiscoveryParamsSchema`,`query`,e),getManualCreationType:e=>n(`deviceProvider`,`getManualCreationType`,`query`,e),adoptDiscoveredDevice:e=>n(`deviceProvider`,`adoptDiscoveredDevice`,`mutation`,e),supportsManualCreation:e=>n(`deviceProvider`,`supportsManualCreation`,`query`,e),getChildCreationSchema:e=>n(`deviceProvider`,`getChildCreationSchema`,`query`,e),createDevice:e=>n(`deviceProvider`,`createDevice`,`mutation`,e),testCreationField:e=>n(`deviceProvider`,`testCreationField`,`mutation`,e)},deviceState:{getAllSnapshots:e=>n(`deviceState`,`getAllSnapshots`,`query`,e),listClaims:e=>n(`deviceState`,`listClaims`,`query`,e)},faceGallery:{listIdentities:e=>n(`faceGallery`,`listIdentities`,`query`,e),createIdentity:e=>n(`faceGallery`,`createIdentity`,`mutation`,e),renameIdentity:e=>n(`faceGallery`,`renameIdentity`,`mutation`,e),deleteIdentity:e=>n(`faceGallery`,`deleteIdentity`,`mutation`,e),listIdentitySamples:e=>n(`faceGallery`,`listIdentitySamples`,`query`,e),auditIdentitySamples:e=>n(`faceGallery`,`auditIdentitySamples`,`query`,e),removeSample:e=>n(`faceGallery`,`removeSample`,`mutation`,e),getFaceMedia:e=>n(`faceGallery`,`getFaceMedia`,`query`,e),assignFace:e=>n(`faceGallery`,`assignFace`,`mutation`,e),unassignFace:e=>n(`faceGallery`,`unassignFace`,`mutation`,e),deleteFace:e=>n(`faceGallery`,`deleteFace`,`mutation`,e),assignFaces:e=>n(`faceGallery`,`assignFaces`,`mutation`,e),unassignFaces:e=>n(`faceGallery`,`unassignFaces`,`mutation`,e),suggestFaceClusters:e=>n(`faceGallery`,`suggestFaceClusters`,`query`,e)},integrations:{list:e=>n(`integrations`,`list`,`query`,e),get:e=>n(`integrations`,`get`,`query`,e),getByAddonId:e=>n(`integrations`,`getByAddonId`,`query`,e),create:e=>n(`integrations`,`create`,`mutation`,e),update:e=>n(`integrations`,`update`,`mutation`,e),delete:e=>n(`integrations`,`delete`,`mutation`,e),getSettings:e=>n(`integrations`,`getSettings`,`query`,e),setSettings:e=>n(`integrations`,`setSettings`,`mutation`,e),getAvailableTypes:e=>n(`integrations`,`getAvailableTypes`,`query`,e),testConnection:e=>n(`integrations`,`testConnection`,`mutation`,e)},keychainAdmin:{status:e=>n(`keychainAdmin`,`status`,`query`,e),listSecrets:e=>n(`keychainAdmin`,`listSecrets`,`query`,e),listAudit:e=>n(`keychainAdmin`,`listAudit`,`query`,e),reveal:e=>n(`keychainAdmin`,`reveal`,`mutation`,e),setSystemSecret:e=>n(`keychainAdmin`,`setSystemSecret`,`mutation`,e),deleteOrphans:e=>n(`keychainAdmin`,`deleteOrphans`,`mutation`,e),rotateMasterKey:e=>n(`keychainAdmin`,`rotateMasterKey`,`mutation`,e),purgeRetiredKeys:e=>n(`keychainAdmin`,`purgeRetiredKeys`,`mutation`,e),downloadRecoveryKey:e=>n(`keychainAdmin`,`downloadRecoveryKey`,`mutation`,e),resetKeychain:e=>n(`keychainAdmin`,`resetKeychain`,`mutation`,e),resetReport:e=>n(`keychainAdmin`,`resetReport`,`query`,e),acknowledgeReset:e=>n(`keychainAdmin`,`acknowledgeReset`,`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),getAddresses:e=>n(`localNetwork`,`getAddresses`,`query`,e),addCustomAddress:e=>n(`localNetwork`,`addCustomAddress`,`mutation`,e),removeCustomAddress:e=>n(`localNetwork`,`removeCustomAddress`,`mutation`,e),setAddressRole:e=>n(`localNetwork`,`setAddressRole`,`mutation`,e),getHubAddresses:e=>n(`localNetwork`,`getHubAddresses`,`query`,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),getTarget:e=>n(`notificationOutput`,`getTarget`,`query`,e),discoverTargets:e=>n(`notificationOutput`,`discoverTargets`,`query`,e),probeTargetConfig:e=>n(`notificationOutput`,`probeTargetConfig`,`mutation`,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),listSequences:e=>n(`notificationRules`,`listSequences`,`query`,e),getSequence:e=>n(`notificationRules`,`getSequence`,`query`,e),createSequence:e=>n(`notificationRules`,`createSequence`,`mutation`,e),updateSequence:e=>n(`notificationRules`,`updateSequence`,`mutation`,e),deleteSequence:e=>n(`notificationRules`,`deleteSequence`,`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),createAlarmProfile:e=>n(`notificationRules`,`createAlarmProfile`,`mutation`,e),renameAlarmProfile:e=>n(`notificationRules`,`renameAlarmProfile`,`mutation`,e),deleteAlarmProfile:e=>n(`notificationRules`,`deleteAlarmProfile`,`mutation`,e),activateAlarmProfile:e=>n(`notificationRules`,`activateAlarmProfile`,`mutation`,e),getAlarmSensors:e=>n(`notificationRules`,`getAlarmSensors`,`query`,e)},oidcConnections:{connectionFormSchema:e=>n(`oidcConnections`,`connectionFormSchema`,`query`,e),listConnections:e=>n(`oidcConnections`,`listConnections`,`query`,e),createConnection:e=>n(`oidcConnections`,`createConnection`,`mutation`,e),updateConnection:e=>n(`oidcConnections`,`updateConnection`,`mutation`,e),deleteConnection:e=>n(`oidcConnections`,`deleteConnection`,`mutation`,e)},osdManager:{getConditionSupport:e=>n(`osdManager`,`getConditionSupport`,`query`,e),copyDeviceConfiguration:e=>n(`osdManager`,`copyDeviceConfiguration`,`mutation`,e),listTemplates:e=>n(`osdManager`,`listTemplates`,`query`,e),upsertTemplate:e=>n(`osdManager`,`upsertTemplate`,`mutation`,e),deleteTemplate:e=>n(`osdManager`,`deleteTemplate`,`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),clearModelBoundDeviceOverrides:e=>n(`pipelineExecutor`,`clearModelBoundDeviceOverrides`,`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),getCapabilities:e=>n(`pipelineExecutor`,`getCapabilities`,`query`,e),getAddonModels:e=>n(`pipelineExecutor`,`getAddonModels`,`query`,e),downloadModel:e=>n(`pipelineExecutor`,`downloadModel`,`mutation`,e),deleteModel:e=>n(`pipelineExecutor`,`deleteModel`,`mutation`,e),cacheFrameInPool:e=>n(`pipelineExecutor`,`cacheFrameInPool`,`mutation`,e),inferCached:e=>n(`pipelineExecutor`,`inferCached`,`mutation`,e),uncacheFrame:e=>n(`pipelineExecutor`,`uncacheFrame`,`mutation`,e),getEffectiveTuning:e=>n(`pipelineExecutor`,`getEffectiveTuning`,`query`,e),listLoadedEngines:e=>n(`pipelineExecutor`,`listLoadedEngines`,`query`,e),spinEngine:e=>n(`pipelineExecutor`,`spinEngine`,`mutation`,e),killEngine:e=>n(`pipelineExecutor`,`killEngine`,`mutation`,e),listReferenceImages:e=>n(`pipelineExecutor`,`listReferenceImages`,`query`,e),getReferenceImage:e=>n(`pipelineExecutor`,`getReferenceImage`,`query`,e),getReferenceAudioFiles:e=>n(`pipelineExecutor`,`getReferenceAudioFiles`,`query`,e),getReferenceAudio:e=>n(`pipelineExecutor`,`getReferenceAudio`,`query`,e),getAudioCapabilities:e=>n(`pipelineExecutor`,`getAudioCapabilities`,`query`,e),runAudioTest:e=>n(`pipelineExecutor`,`runAudioTest`,`mutation`,e),getDetectionConfigSchema:e=>n(`pipelineExecutor`,`getDetectionConfigSchema`,`query`,e)},pipelineOrchestrator:{requestOccupancyLook:e=>n(`pipelineOrchestrator`,`requestOccupancyLook`,`mutation`,e),pauseForStorageMigration:e=>n(`pipelineOrchestrator`,`pauseForStorageMigration`,`mutation`,e),resumeForStorageMigration:e=>n(`pipelineOrchestrator`,`resumeForStorageMigration`,`mutation`,e),rebalance:e=>n(`pipelineOrchestrator`,`rebalance`,`mutation`,e),getPipelineAssignments:e=>n(`pipelineOrchestrator`,`getPipelineAssignments`,`query`,e),getAgentLoad:e=>n(`pipelineOrchestrator`,`getAgentLoad`,`query`,e),getClusterModelChoice:e=>n(`pipelineOrchestrator`,`getClusterModelChoice`,`query`,e),getGlobalMetrics:e=>n(`pipelineOrchestrator`,`getGlobalMetrics`,`query`,e),getCapabilityBindings:e=>n(`pipelineOrchestrator`,`getCapabilityBindings`,`query`,e),setCapabilityBinding:e=>n(`pipelineOrchestrator`,`setCapabilityBinding`,`mutation`,e),getIngestOwner:e=>n(`pipelineOrchestrator`,`getIngestOwner`,`query`,e),getAudioNodeLoad:e=>n(`pipelineOrchestrator`,`getAudioNodeLoad`,`query`,e),getAudioAssignments:e=>n(`pipelineOrchestrator`,`getAudioAssignments`,`query`,e),getAgentSettings:e=>n(`pipelineOrchestrator`,`getAgentSettings`,`query`,e),listAgentSettings:e=>n(`pipelineOrchestrator`,`listAgentSettings`,`query`,e),removeAgentSettings:e=>n(`pipelineOrchestrator`,`removeAgentSettings`,`mutation`,e),setAgentMaxCameras:e=>n(`pipelineOrchestrator`,`setAgentMaxCameras`,`mutation`,e),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),planAutoTune:e=>n(`pipelineOrchestrator`,`planAutoTune`,`query`,e),applyAutoTune:e=>n(`pipelineOrchestrator`,`applyAutoTune`,`mutation`,e),setLoadBalancingShares:e=>n(`pipelineOrchestrator`,`setLoadBalancingShares`,`mutation`,e),getPlacementStats:e=>n(`pipelineOrchestrator`,`getPlacementStats`,`query`,e),suggestShares:e=>n(`pipelineOrchestrator`,`suggestShares`,`query`,e),getEffectiveShares:e=>n(`pipelineOrchestrator`,`getEffectiveShares`,`query`,e),setShareSource:e=>n(`pipelineOrchestrator`,`setShareSource`,`mutation`,e),getNodeBenchmarkPreflight:e=>n(`pipelineOrchestrator`,`getNodeBenchmarkPreflight`,`query`,e),startNodeBenchmark:e=>n(`pipelineOrchestrator`,`startNodeBenchmark`,`mutation`,e),getNodeBenchmarkStatus:e=>n(`pipelineOrchestrator`,`getNodeBenchmarkStatus`,`query`,e),abortNodeBenchmark:e=>n(`pipelineOrchestrator`,`abortNodeBenchmark`,`mutation`,e),getNodeBenchmarkCandidates:e=>n(`pipelineOrchestrator`,`getNodeBenchmarkCandidates`,`query`,e),listNodeBenchmarkResults:e=>n(`pipelineOrchestrator`,`listNodeBenchmarkResults`,`query`,e),deleteNodeBenchmarkResult:e=>n(`pipelineOrchestrator`,`deleteNodeBenchmarkResult`,`mutation`,e),getCameraStatuses:e=>n(`pipelineOrchestrator`,`getCameraStatuses`,`query`,e),setCameraSensors:e=>n(`pipelineOrchestrator`,`setCameraSensors`,`mutation`,e),reconcileFromDisk:e=>n(`pipelineOrchestrator`,`reconcileFromDisk`,`mutation`,e),getReconcileFromDiskStatus:e=>n(`pipelineOrchestrator`,`getReconcileFromDiskStatus`,`query`,e)},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),startNodeBench:e=>n(`pipelineRunner`,`startNodeBench`,`mutation`,e),getNodeBenchStatus:e=>n(`pipelineRunner`,`getNodeBenchStatus`,`query`,e),abortNodeBench:e=>n(`pipelineRunner`,`abortNodeBench`,`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),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)},training:{listBaseModels:e=>n(`training`,`listBaseModels`,`query`,e),planJob:e=>n(`training`,`planJob`,`query`,e),startJob:e=>n(`training`,`startJob`,`mutation`,e),startJobBatch:e=>n(`training`,`startJobBatch`,`mutation`,e),listJobs:e=>n(`training`,`listJobs`,`query`,e),getJob:e=>n(`training`,`getJob`,`query`,e),cancelJob:e=>n(`training`,`cancelJob`,`mutation`,e),getJobResult:e=>n(`training`,`getJobResult`,`query`,e),registerResult:e=>n(`training`,`registerResult`,`mutation`,e),canaryResult:e=>n(`training`,`canaryResult`,`mutation`,e),rollbackCanary:e=>n(`training`,`rollbackCanary`,`mutation`,e),discardResult:e=>n(`training`,`discardResult`,`mutation`,e)},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),revokeApiKey:e=>n(`userManagement`,`revokeApiKey`,`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),listExternalIdentities:e=>n(`userManagement`,`listExternalIdentities`,`query`,e),findUserByExternalIdentity:e=>n(`userManagement`,`findUserByExternalIdentity`,`query`,e),unlinkExternalIdentity:e=>n(`userManagement`,`unlinkExternalIdentity`,`mutation`,e),listOauthSessions:e=>n(`userManagement`,`listOauthSessions`,`query`,e),revokeOauthSession:e=>n(`userManagement`,`revokeOauthSession`,`mutation`,e)}}}var OQ=`2026-09-11T00:00:00.000Z`,kQ=Date.parse(OQ),AQ={PCMU:20*Math.log10(4),PCMA:20*Math.log10(8)};function jQ(e,t){return t+AQ[e]}function MQ(e){return!Number.isFinite(e)||e<=0?`unknown`:e>=kQ?`itu`:`pre-itu`}var NQ=`audio-`;function PQ(e){return e.startsWith(NQ)?e.slice(6):e}function FQ(e){return e.startsWith(NQ)?e:`${NQ}${e}`}var IQ=-96,LQ=0,RQ=3,zQ=Math.round(jQ(`PCMU`,-55)),BQ=1,VQ=100,HQ=1,UQ=300,WQ=2,GQ=5,KQ=1,qQ=20,JQ=1,YQ=60,XQ={hitPercent:60,samplingSeconds:10};function ZQ(e){return e??XQ}function QQ(e){return e===void 0?null:e.labels!==void 0&&e.labels.length>0?`label`:e.dbThreshold===void 0?null:`level`}function $Q(e){return e===void 0?!1:e.dbThreshold===void 0&&(e.labels===void 0||e.labels.length===0)}function e$(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,Math.round(e))):t}function t$(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n$(e,t){let n=ZQ(e),r=t$(t,`labels`)?t.labels:n.labels,i=t$(t,`dbThreshold`)?t.dbThreshold:n.dbThreshold,a=r!==void 0&&r.length>0,o=t.mode??(t$(t,`labels`)&&a?`label`:t$(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`?zQ:void 0):void 0;return{...s===void 0?{}:{labels:[...s]},...c===void 0?{}:{dbThreshold:e$(c,-96,0)},hitPercent:e$(t.hitPercent??n.hitPercent,1,100),samplingSeconds:e$(t.samplingSeconds??n.samplingSeconds,1,300),...(()=>{let e=t$(t,`confirmHits`)?t.confirmHits:n.confirmHits,r=t$(t,`confirmWindowSec`)?t.confirmWindowSec:n.confirmWindowSec;return{...e===void 0?{}:{confirmHits:e$(e,1,20)},...r===void 0?{}:{confirmWindowSec:e$(r,1,60)}}})()}}function r$(e,t){let n=e?.audioKinds??[],r=n.length>0?n.map(e=>{let t=PQ(e.kind);return{value:t,label:e.label,iconId:FQ(t),unknown:!1}}):VT.map(e=>({value:e.id,label:e.name,iconId:FQ(e.id),unknown:!1})),i=new Set(r.map(e=>e.value)),a=[];for(let e of t??[]){let t=PQ(e);i.has(t)||a.includes(t)||(a.push(t),r.push({value:t,label:t,iconId:FQ(t),unknown:!0}))}return{choices:r,unknownLabels:a}}function i$(e,t){let n=PQ(t);return(e??[]).some(e=>PQ(e)===n)}function a$(e,t){let n=PQ(t),r=e??[];if(i$(r,n)){let e=r.filter(e=>PQ(e)!==n);return e.length>0?e:void 0}return[...r,n]}var o$=new Set([`classes`,`classesExclude`]),s$=new Set([`sensorKinds`]),c$=new Set([`occupancy`]);function l$(e){return{value:e.kind,label:e.label}}function u$(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(l$(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 d$(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,[l$(r)]),t.push(e)):i.push(l$(r))}return t.flatMap(e=>{let t=n.get(e);return t===void 0?[]:[{key:e,fallbackLabel:e,options:t}]})}function f$(e,t){if(!t)return null;if(o$.has(e)){let e=u$(t.videoClasses);return t.audioKinds.length>0&&e.push({key:`audio`,fallbackLabel:`Audio`,options:t.audioKinds.map(l$)}),e.length>0?{groups:e}:null}if(c$.has(e)){let e=t.videoClasses.filter(e=>e.parentKind===null).map(l$);return e.length>0?{groups:[{key:`macro`,fallbackLabel:`Classes`,options:e}]}:null}if(s$.has(e)){let e=d$(t.labels);return e.length>0?{groups:e}:null}return null}var p$=`audio`;function m$(e){let t=f$(`classes`,e);if(t===null)return null;let n=t.groups.filter(e=>e.key!==p$);return n.length>0?{groups:n}:null}function h$(e){return e.trim().toLowerCase().startsWith(`${p$}-`)}function g$(e){let t=new Set;for(let n of e.groups)for(let e of n.options)t.add(e.value);return t}var _$=[`devices`,`classes`],v$=new Set(_$);function y$(e){return v$.has(e)}function b$(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 x$=[[/&nbsp;/g,` `],[/&amp;/g,`&`],[/&lt;/g,`<`],[/&gt;/g,`>`],[/&quot;/g,`"`],[/&#39;/g,`'`]];function S$(e){let t=e.replace(/<\s*br\s*\/?\s*>/gi,`
352
+ `}var jm=d({id:l(),label:l(),icon:l(),path:l(),remoteName:l(),bundle:l(),section:l().optional(),sectionLabel:l().optional()}),Mm=d({addonId:l(),page:jm,bundleUrl:l()}),Nm={name:`addon-pages`,scope:`system`,mode:`singleton`,methods:{listPages:D(v(),S(Mm).readonly())}},Pm=d({id:l(),label:l(),icon:l(),path:l(),remoteName:l(),bundle:l(),section:l().optional(),sectionLabel:l().optional()}),Fm={name:`addon-pages-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listPages:D(v(),S(Pm).readonly(),{auth:`admin`})}},Im=d({method:x([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`]),path:l(),access:x([`public`,`authenticated`,`admin`]).optional(),description:l().optional(),rateLimit:x([`auth`]).optional()}),Lm=d({method:l(),path:l(),params:y(l(),l()),query:y(l(),l()),body:o(),headers:y(l(),l()),user:d({id:l(),username:l(),isAdmin:C()}).optional(),scopedToken:o().optional()}),Rm=d({status:i().int(),headers:y(l(),l()),redirectUrl:l().nullable(),body:o().optional(),contentType:l().optional()}),zm={name:`addon-routes`,scope:`system`,mode:`collection`,internal:!0,methods:{getRoutes:D(v(),S(Im)),invoke:D(Lm,Rm,{kind:`mutation`})},mount:{kind:`skip`}},Bm=d({id:l(),label:l(),icon:l(),order:i().optional()}),Vm=d({id:l(),title:l(),description:l().optional(),style:x([`card`,`accordion`]).optional(),defaultCollapsed:C().optional(),columns:f([m(1),m(2),m(3),m(4)]).optional(),tab:l().optional(),location:x([`settings`,`top-tab`]).optional(),order:i().optional(),fields:S(h())}),Hm=d({tabs:S(Bm).optional(),sections:S(Vm)}),Um=y(l(),o()),Wm=d({success:m(!0)}),Gm={name:`addon-settings`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{getGlobalSettings:D(d({addonId:l(),nodeId:l().optional(),overlay:y(l(),o()).optional(),cap:l().optional()}),Hm.nullable()),updateGlobalSettings:D(d({addonId:l(),nodeId:l().optional(),patch:Um}),Wm,{kind:`mutation`,auth:`admin`}),getIntegrationSettings:D(d({addonId:l(),nodeId:l().optional()}),Hm.nullable()),getDeviceSettings:D(d({addonId:l(),deviceId:i(),nodeId:l().optional()}),Hm.nullable()),updateDeviceSettings:D(d({addonId:l(),deviceId:i(),nodeId:l().optional(),patch:Um}),Wm,{kind:`mutation`,auth:`admin`})}},Km=x([`device-tab`,`dashboard`,`integration-detail`]),qm=x([`xs`,`sm`,`md`,`lg`,`xl`]),Jm=d({remoteName:l(),exposedModule:l(),componentKey:l().optional()}),Ym=d({tab:l(),subTab:l().optional(),label:l(),order:i().optional(),kind:m(`remote`),remote:Jm,stableId:l(),description:l().optional(),icon:l().optional(),bundle:l(),hosts:S(Km).readonly(),requires:d({deviceContext:C().default(!1),integrationContext:C().default(!1)}),preAuth:C().optional().default(!1),defaultSize:qm.default(`md`),allowedSizes:S(qm).readonly().default([`sm`,`md`,`lg`]),defaultColumns:i().int().min(1).max(12).default(6),defaultRows:i().int().min(1).max(12).default(1)}),Xm={name:`addon-widgets-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listWidgets:D(v(),S(Ym).readonly(),{auth:`admin`})}},Zm=Ym.extend({addonId:l(),bundleUrl:l()}),Qm={name:`addon-widgets`,scope:`system`,mode:`singleton`,methods:{listWidgets:D(v(),S(Zm).readonly())}},$m=x([`info`,`success`,`warning`,`error`]),eh=x([`active`,`in-progress`,`completed`,`failed`,`dismissed`]),th=d({type:l(),id:l()}),nh=d({id:l(),category:l(),severity:$m,title:l(),message:l(),status:eh,progress:i().optional(),read:C(),createdAt:i(),updatedAt:i(),source:th.optional(),metadata:y(l(),o()).optional()}),rh={name:`alerts`,scope:`system`,mode:`singleton`,methods:{emit:D(nh,v(),{kind:`mutation`}),update:D(d({alertId:l(),patch:nh.partial()}),v(),{kind:`mutation`}),list:D(d({unreadOnly:C().optional(),limit:i().optional()}).optional(),S(nh).readonly()),getUnreadCount:D(v(),i()),markRead:D(d({alertId:l()}),v(),{kind:`mutation`}),markAllRead:D(v(),v(),{kind:`mutation`}),dismiss:D(d({alertId:l()}),v(),{kind:`mutation`})}},ih={name:`audio-analysis`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:D(d({deviceId:i()}),_())},events:{onAudioLevel:Pr(d({deviceId:i(),rms:i(),dbfs:i()}))}},ah=x([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),oh=d({data:_(),format:ah,width:i(),height:i(),timestamp:i()}),sh=d({x:i(),y:i(),w:i(),h:i()}),ch=d({class:l(),originalClass:l(),score:i(),bbox:sh}),lh=d({data:b(Uint8Array),sampleRate:i(),channels:i(),timestamp:i(),deviceId:i().optional()}),uh=d({rms:i(),dbfs:i()}),dh=d({className:l(),originalClass:l().optional(),score:i()}),fh=[`superseded`,`error`,`timeout`,`disposed`],ph=p(`state`,[d({state:m(`classified`)}),d({state:m(`not-classified`),reason:x(fh)})]),mh=d({level:uh,classification:d({labels:S(dh).readonly(),inferenceMs:i()}).optional(),classifyOutcome:ph,timestamp:i()}),hh=d({minConfidence:i().min(0).max(1).default(.3),allowedClasses:S(l()).default([])}),gh=d({deviceId:i(),brokerId:l(),ingestNodeId:l(),settings:hh}),_h=d({attached:C(),replaced:C()}),vh=d({detached:C()}),yh=d({labels:S(dh).readonly(),rawLabels:S(dh).readonly().optional(),inferenceMs:i()}),bh=[{value:`auto`,label:`Auto (platform default)`},{value:`apple-soundanalysis`,label:`Apple SoundAnalysis (macOS 12+)`},{value:`yamnet-onnx`,label:`YAMNet ONNX (cross-platform)`}],xh={audioBackend:`auto`,probedBestAudioBackend:``},Sh={name:`audio-analyzer`,scope:`system`,mode:`singleton`,methods:{analyseChunk:D(d({chunk:lh,settings:hh}),mh.nullable(),{kind:`mutation`}),classify:D(lh,yh,{timeoutMs:3e4}),attachDevice:D(gh,_h,{kind:`mutation`}),detachDevice:D(d({deviceId:i()}),vh,{kind:`mutation`}),isReady:D(v(),C()),dispose:D(v(),v(),{kind:`mutation`}),reprobeAudioEngine:D(v(),d({backend:l()}),{kind:`mutation`,auth:`admin`})}},Ch=x([`f32le`,`s16le`]),wh=d({codec:l(),canDecode:C(),canEncode:C(),label:l().optional()}),Th=d({codec:l(),sourceSampleRate:i().int().positive(),sourceChannels:i().int().positive(),extraData:b(Uint8Array).optional(),targetSampleRate:i().int().positive(),targetChannels:i().int().positive(),targetFormat:Ch.optional(),idleMs:i().int().positive().optional(),tag:l().optional()}),Eh=d({codec:l(),sourceSampleRate:i().int().positive(),sourceChannels:i().int().positive(),sourceFormat:Ch.optional(),targetSampleRate:i().int().positive(),targetChannels:i().int().positive(),bitrateKbps:i().int().positive().optional(),idleMs:i().int().positive().optional(),tag:l().optional()}),Dh=d({data:b(Uint8Array),sampleRate:i().int().positive(),channels:i().int().positive(),format:Ch,pts:i()}),Oh=d({data:b(Uint8Array),codec:l(),pts:i(),frameComplete:C()}),kh=d({sessionId:l(),kind:x([`decode`,`encode`]),codec:l(),sourceSampleRate:i(),sourceChannels:i(),targetSampleRate:i(),targetChannels:i(),format:Ch,tag:l().optional(),createdAtMs:i(),lastActivityMs:i(),framesIn:i(),framesOut:i()}),Ah={name:`audio-codec`,scope:`system`,mode:`singleton`,preferredProvider:`decoder-nodeav`,methods:{listSupportedCodecs:D(v(),S(wh).readonly()),canHandle:D(d({codec:l(),kind:x([`decode`,`encode`])}),C()),createDecodeSession:D(Th,d({sessionId:l(),nodeId:l()}),{kind:`mutation`}),createEncodeSession:D(Eh,d({sessionId:l(),nodeId:l()}),{kind:`mutation`}),closeSession:D(d({sessionId:l(),nodeId:l().optional()}),v(),{kind:`mutation`}),pushEncodedFrame:D(d({sessionId:l(),nodeId:l().optional(),data:b(Uint8Array),pts:i().optional()}),v(),{kind:`mutation`}),pullPcm:D(d({sessionId:l(),nodeId:l().optional(),maxCount:i().int().positive().default(8)}),S(Dh)),pushPcm:D(d({sessionId:l(),nodeId:l().optional(),data:b(Uint8Array),pts:i().optional()}),v(),{kind:`mutation`}),pullEncoded:D(d({sessionId:l(),nodeId:l().optional(),maxCount:i().int().positive().default(8)}),S(Oh)),flushEncode:D(d({sessionId:l(),nodeId:l().optional()}),S(Oh),{kind:`mutation`}),listActiveSessions:D(v(),S(kh).readonly())}},jh=d({userId:l(),username:l(),email:l().optional(),displayName:l().optional(),isAdmin:C().default(!1)}),Mh={name:`auth-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{validateCredentials:D(d({username:l(),password:l()}),jh.nullable(),{kind:`mutation`}),getLoginUrl:D(d({state:l()}),l()),handleCallback:D(y(l(),l()),jh,{kind:`mutation`}),validateToken:D(d({token:l()}),jh.nullable())},mount:{kind:`skip`}},Nh=`.backup-snapshot`,Ph=`.backup-snapshot-partial`,Fh=30*6e4,Ih=d({databases:S(d({livePath:l()}))}),Lh=d({name:l(),rows:i().int().nonnegative()}),Rh=d({livePath:l(),snapshotPath:l(),sizeBytes:i().int().nonnegative(),pageCount:i().int().nonnegative(),pageSize:i().int().positive(),tables:S(Lh),copyMs:i().nonnegative(),verifyMs:i().nonnegative(),takenAt:i()}),zh=Rh.extend({livePath:l(),snapshotPath:l()}),Bh={name:`database-snapshot`,scope:`system`,mode:`singleton`,internal:!0,methods:{listDatabases:D(d({}),Ih,{auth:`admin`}),writeSnapshot:D(d({}),Rh,{kind:`mutation`,auth:`admin`,timeoutMs:Fh})}},Vh=d({subId:l(),displayName:l(),description:l().optional(),kind:l(),triggerSupported:C(),restoreSupported:C()}).extend({id:l(),addonId:l(),enabled:C(),retentionCount:i(),label:l().optional(),lastSuccessAt:i().optional(),lastSuccessSizeBytes:i().optional(),cron:l().optional(),nextRunAt:i().optional(),lastAttemptAt:i().optional(),lastError:l().optional()}),Hh=d({scheme:l(),keyId:l()}),Uh=d({enabled:C(),active:d({keyId:l(),publicKey:l(),createdAt:i()}).nullable(),keys:S(d({keyId:l(),createdAt:i(),retiredAt:i().nullable()})).readonly()}),Wh=d({id:l(),filename:l(),createdAt:i(),sizeBytes:i(),label:l().optional(),locations:S(l()).readonly(),encryption:Hh.optional()}),Gh=d({id:l(),destinationId:l().optional(),label:l().optional(),createdAt:i(),sizeBytes:i(),locations:S(l()).optional(),encryption:Hh.optional()}),Kh=d({path:l(),kind:x([`file`,`dir`,`symlink`]),sizeBytes:i(),mtime:i()}),qh=d({archiveVersion:m(1),createdAt:i(),dataDir:l(),locations:S(l()),entries:S(Kh),totalBytes:i(),totalFiles:i(),sqliteSnapshots:S(zh).optional()}),Jh=d({name:l(),sizeBytes:i(),fileCount:i(),present:C()}),Yh=x([`queued`,`running`,`succeeded`,`failed`,`cancelled`]),Xh=x([`queued`,`building`,`uploading`,`done`]),Zh=d({id:l(),state:Yh,phase:Xh,destinationIds:S(l()).readonly(),label:l().optional(),requestedAt:i(),startedAt:i().optional(),finishedAt:i().optional(),stagedBytes:i(),archiveSizeBytes:i().optional(),uploadedBytes:i(),completedDestinationIds:S(l()).readonly(),failedDestinationIds:S(l()).readonly(),error:l().optional(),queuePosition:i().int().min(1).optional()}),Qh=d({runId:l(),queued:C(),joined:C(),cancelled:C(),entries:S(Gh).readonly()}),$h=d({id:l(),label:l(),cron:l(),enabled:C(),locationIds:S(l()).readonly(),retentionCount:i().int().min(1).max(1e3),dataSources:S(l()).readonly().optional(),lastAttemptAt:i().optional(),lastSuccessAt:i().optional(),lastError:l().optional(),nextRunAt:i().optional()}),eg={name:`backup`,scope:`system`,mode:`singleton`,methods:{listDestinations:D(v(),S(Vh).readonly(),{auth:`admin`}),trigger:D(d({destinations:S(l()).optional(),locations:S(l()).optional(),label:l().optional(),retentionCount:i().int().min(1).max(1e3).optional()}).optional(),Qh,{kind:`mutation`,auth:`admin`}),listRuns:D(v(),S(Zh).readonly(),{auth:`admin`}),cancel:D(d({runId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),list:D(v(),S(Gh).readonly(),{auth:`admin`}),listLocations:D(v(),S(Jh).readonly(),{auth:`admin`}),getEntries:D(d({destinationId:l(),backupId:l()}),qh.nullable(),{auth:`admin`}),restore:D(d({destinationId:l(),backupId:l(),locations:S(l()).optional(),backupSecretKey:l().optional()}),v(),{kind:`mutation`,auth:`admin`}),getEncryption:D(v(),Uh,{auth:`admin`}),setupEncryption:D(d({}),d({keyId:l(),secretKey:l(),publicKey:l(),createdAt:i(),replacedKeyId:l().nullable()}),{kind:`mutation`,auth:`admin`}),disableEncryption:D(d({}),d({disabledKeyId:l().nullable()}),{kind:`mutation`,auth:`admin`}),checkBackupKey:D(d({backupSecretKey:l()}),d({valid:C(),keyId:l().nullable(),known:C(),active:C(),error:l().optional()}),{kind:`mutation`,auth:`admin`}),delete:D(d({destinationId:l(),backupId:l()}),v(),{kind:`mutation`,auth:`admin`}),listArchives:D(d({destinationId:l()}),S(Wh).readonly(),{auth:`admin`}),upsertDestinationPolicy:D(d({locationId:l(),enabled:C(),retentionCount:i().int().min(1).max(1e3),label:l().optional()}),v(),{kind:`mutation`,auth:`admin`}),previewSchedule:D(d({cron:l(),count:i().int().min(1).max(20).optional()}),d({ok:C(),error:l().optional(),nextRuns:S(i()).readonly()})),listSchedules:D(v(),S($h).readonly(),{auth:`admin`}),upsertSchedule:D(d({id:l().optional(),label:l(),cron:l(),enabled:C(),locationIds:S(l()).readonly(),retentionCount:i().int().min(1).max(1e3),dataSources:S(l()).readonly().optional()}),$h,{kind:`mutation`,auth:`admin`}),deleteSchedule:D(d({id:l()}),v(),{kind:`mutation`,auth:`admin`})}},tg=x([`connected`,`disconnected`,`connecting`,`auth-failed`,`unreachable`,`error`]),ng=d({id:l(),addonId:l(),name:l(),kind:l(),status:tg,info:y(l(),o()),lastCheckedAt:i().nullable(),error:l().nullable()}),rg=d({brokerCount:i().int().nonnegative(),connectedCount:i().int().nonnegative()}),ig=d({addonId:l(),kinds:S(d({kind:l(),label:l(),interactiveConnectPath:l().min(1).optional(),interactiveDisconnectPath:l().min(1).optional()}))}),ag=d({kind:l().optional()}),og=d({id:l()}),sg=d({kind:l().min(1),name:l().min(1),id:l().min(1).optional(),settings:y(l(),o())}),cg=d({id:l()}),lg=d({id:l()}),ug=p(`ok`,[d({ok:m(!0),latencyMs:i().nonnegative()}),d({ok:m(!1),error:l()})]),dg=y(l(),o()),fg=d({kind:l()}),pg=d({kind:l(),settings:dg}),mg=p(`ok`,[d({ok:m(!0),latencyMs:i().nonnegative().optional()}).strict(),d({ok:m(!1),error:l()})]),hg=o().nullable(),gg=d({brokerId:l(),target:y(l(),o()),payload:o().optional()}),_g=d({brokerId:l(),filter:y(l(),o())}),vg=d({subscriptionId:l()}),yg=d({brokerId:l(),subscriptionId:l()}),bg=d({brokerId:l(),key:l()}),xg={name:`broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:rg,kind:`poll`},methods:{list:D(ag,S(ng)),get:D(og,ng.nullable()),listProviders:D(v(),S(ig),{auth:`admin`}),add:D(sg,cg,{kind:`mutation`,auth:`admin`}),remove:D(lg,v(),{kind:`mutation`,auth:`admin`}),testConnection:D(og,ug,{kind:`mutation`,auth:`admin`}),getSettings:D(og,dg.nullable(),{auth:`admin`}),setSettings:D(d({id:l(),settings:dg}),v(),{kind:`mutation`,auth:`admin`}),getBrokerConfig:D(og,dg.nullable(),{auth:`admin`}),getSettingsSchema:D(fg,hg,{auth:`admin`}),testSettings:D(pg,mg,{kind:`mutation`,auth:`admin`}),publish:D(gg,o(),{kind:`mutation`,auth:`admin`}),subscribe:D(_g,vg,{kind:`mutation`,auth:`admin`}),unsubscribe:D(yg,v(),{kind:`mutation`,auth:`admin`}),getState:D(bg,o().nullable(),{auth:`admin`}),getStatus:D(v(),rg)}},Sg={name:`camera-pipeline-config`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{}},Cg=x([`webrtc`,`hls`,`mjpeg`,`rtsp`]),wg=x([`mp4`,`gif`]),Tg=d({kind:wg,handle:l(),nodeId:l(),mime:l(),bytes:i().int(),width:i().int(),height:i().int()}),Eg=d({fromTs:i(),toTs:i(),packets:i().int()}),Dg=d({media:S(Tg).readonly(),coverage:Eg,profile:E,video:x([`copy`,`encode`])}),Og=d({brokerId:l(),url:l(),mutedUrl:l(),enabled:C(),codec:l().optional(),resolution:d({width:i().int().positive(),height:i().int().positive()}).optional()}),kg=d({sessionId:l(),remoteAddr:l(),userAgent:l().nullish(),playing:C(),muted:C(),connectedAt:i(),lastRtpAt:i(),bytesSent:i()}),Ag=d({tag:l(),subscribedAt:i(),chunksDelivered:i()}),jg=x([`alexa`,`homekit`,`webrtc-browser`,`webrtc-mobile`,`webrtc-whep`,`rtsp-listen`,`derived-broker`,`recording`,`pipeline`,`snapshot`,`warmup`,`unknown`]),Mg=d({kind:jg,label:l().optional(),media:x([`audio`,`video`,`both`]).optional(),targetCodec:l().optional(),transport:x([`passthrough`,`repacketize`,`transcode`]).optional(),remoteAddr:l().optional(),userAgent:l().optional(),userId:l().optional(),sessionId:l().optional(),extra:y(l(),l()).optional()}).readonly(),Ng=d({id:l(),channel:x([`annexb`,`rtp`]),attribution:Mg,subscribedAt:i(),packetsDelivered:i()}),Pg=d({rtsp:S(kg).readonly(),audio:S(Ag).readonly(),encoded:S(Ng).readonly(),pipeClients:i(),encodedSubscribers:i()}),Fg=x([`reconnecting`,`sleeping`,`offline`,`disabled`,`waking`]),Ig=x([`h264`,`h265`,`copy`]),Lg=x([`aac`,`opus`,`pcmu`,`copy`,`none`]),Rg=d({deviceId:i().int().nonnegative(),video:Ig,audio:Lg.optional(),profile:E.optional(),targetResolution:d({width:i().int().positive(),height:i().int().positive()}).optional(),outputArgs:S(l()).optional(),audioEgress:C().optional(),hostname:l().optional(),tag:l().optional()}),zg=d({url:l(),sentryUrl:l().nullable().optional(),videoCodec:x([`H264`,`H265`]),audioCodec:l(),resolution:d({width:i().int().positive(),height:i().int().positive()}),transcoded:C(),encoder:l(),pipelineKey:l()}),Bg=Ns.omit({inputArgs:!0,outputArgs:!0}),Vg=x([`tight`,`relaxed`]),Hg=d({deviceId:i().int().nonnegative(),source:p(`kind`,[d({kind:m(`profile`),profile:E}),d({kind:m(`cam-stream`),camStreamId:l().min(1)})]),encode:Bg,rateControl:Vg.optional(),bitstreamFilter:x([`dump_extra`,`h264_mp4toannexb`,`hevc_mp4toannexb`]).optional(),publishLocally:C().optional(),pixelFormat:x([`yuv420p`,`nv12`]).optional(),decodeHwAccel:x([`auto`,`none`,`videotoolbox`,`vaapi`,`qsv`,`cuda`]).optional(),hostname:l().optional(),tag:l().optional()}),Ug=d({url:l(),pipelineKey:l(),videoCodec:x([`H264`,`H265`]),resolution:d({width:i().int().positive(),height:i().int().positive()}),transcoded:C(),encoder:l(),decodeHwAccel:l().nullable(),camStreamId:l().nullable()}),Wg={name:`stream-broker`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{reportStreamSignal:D(d({deviceId:i().int().nonnegative(),code:l().min(1),at:i().optional()}),d({accepted:C(),reason:x([`woke`,`hold-extended`,`not-enabled`,`no-consumer`,`unknown-code`])}),{kind:`mutation`}),publishCameraStream:D(d({deviceId:i().int().nonnegative(),camStreamId:l().min(1),kind:Kn,url:l().optional(),codec:l().optional(),resolution:qn.optional(),fps:i().positive().optional(),label:l().optional(),deviceFeatures:S(l()).optional(),autoEligible:C().optional(),profileHint:E.optional(),metadata:y(l(),o()).optional(),sourceCamStreamId:l().min(1).optional(),encodeProfile:Ns.optional()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),retractCameraStream:D(d({deviceId:i().int().nonnegative(),camStreamId:l().min(1)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),assignProfile:D(d({deviceId:i().int().nonnegative(),profile:E,camStreamId:l().min(1)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),unassignProfile:D(d({deviceId:i().int().nonnegative(),profile:E}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),forgetDeviceHardware:D(d({deviceId:i().int().nonnegative()}),d({derivedStreamsDeleted:S(l()).readonly(),assignmentsPurged:C(),probeSnapshotsDropped:i().int().nonnegative(),rtspTokenRowsDeleted:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),renderPreBufferClip:D(d({deviceId:i(),profile:E.optional(),aroundMs:i(),preRollSec:i().min(0).max(20).default(3),postRollSec:i().min(0).max(20).default(5),format:x([`gif`,`mp4`]).default(`gif`),maxWidth:i().int().min(120).max(1920).default(480),fps:i().int().min(1).max(15).default(5),speed:i().min(1).max(8).default(2)}),d({base64:l(),mime:l(),bytes:i().int(),profile:E,durationMs:i()}),{kind:`mutation`,auth:`admin`}),produceEventMedia:D(d({deviceId:i(),profile:E.optional(),aroundMs:i(),preSeconds:i().min(0).max(20).default(4),postSeconds:i().min(0).max(20).default(6),kinds:S(wg).min(1).default([`mp4`]),gifMaxWidth:i().int().min(120).max(1280).default(640),gifFps:i().int().min(1).max(15).default(12),gifSpeed:i().min(1).max(8).default(4),speed:i().min(1).max(8).default(4)}),Dg,{kind:`mutation`,auth:`admin`}),fetchEventMedia:D(d({handle:l()}),d({base64:l(),mime:l(),bytes:i().int()}).nullable(),{kind:`mutation`,auth:`admin`}),listAllCameraStreams:D(v(),S(Jn).readonly()),listAllProfileSlots:D(v(),S(Xn).readonly()),getBrokerStats:D(d({brokerId:l()}),lr),probeStream:D(d({brokerId:l()}),d({probed:C(),summary:l()}),{kind:`mutation`,auth:`admin`}),listClients:D(d({brokerId:l()}),Pg),killClient:D(d({brokerId:l(),channel:x([`rtsp`,`audio`]),handle:l()}),d({killed:C()}),{kind:`mutation`,auth:`admin`}),restartProfile:D(d({deviceId:i().int().nonnegative(),profile:E}),d({success:C()}),{kind:`mutation`,auth:`admin`}),getStreamUrl:D(d({streamId:l(),format:Cg}),d({url:l()})),getStreamWithCodec:D(Rg,zg,{kind:`mutation`,auth:`admin`}),releaseStreamWithCodec:D(d({pipelineKey:l()}),d({released:C(),refcount:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),acquireEgressTranscode:D(Hg,Ug,{kind:`mutation`,auth:`admin`}),releaseEgressTranscode:D(d({pipelineKey:l()}),d({released:C(),refcount:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),subscribeAudioChunks:D(or,sr,{kind:`mutation`}),pullAudioChunks:D(d({subscriptionId:l(),maxCount:i().int().positive().default(8)}),S(ar).readonly()),unsubscribeAudioChunks:D(d({subscriptionId:l()}),d({released:C()}),{kind:`mutation`}),setPreBufferDuration:D(d({brokerId:l(),seconds:i().min(0).max(30)}),v(),{kind:`mutation`,auth:`admin`}),getPreBufferInfo:D(d({brokerId:l()}),d({configuredSec:i(),bufferedMs:i(),packetCount:i()})),getRtspPort:D(v(),i()),getAllRtspEntries:D(d({hostname:l().optional()}),S(Og).readonly()),getRtspEntry:D(d({brokerId:l(),hostname:l().optional()}),Og.nullable()),regenerateRtspToken:D(d({brokerId:l()}),l().nullable(),{kind:`mutation`,auth:`admin`}),setRtspEnabled:D(d({brokerId:l(),enabled:C()}),v(),{kind:`mutation`,auth:`admin`}),isRtspEnabled:D(d({brokerId:l()}),C()),getDeviceAudioMute:D(d({deviceId:i().int()}),d({muted:C(),appliedBrokers:i().int().nonnegative()})),setDeviceAudioMute:D(d({deviceId:i().int(),muted:C()}),d({muted:C(),appliedBrokers:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`})},events:{onCamStreamDemand:Pr(d({deviceId:i().int().nonnegative(),camStreamId:l(),profile:E})),onCamStreamIdle:Pr(d({deviceId:i().int().nonnegative(),camStreamId:l()})),onRequestStreamSourceRefresh:Pr(d({deviceId:i().int().nonnegative(),camStreamId:l(),brokerId:l()}))}},Gg=x([`h264`,`h265`,`hevc`,`av1`,`mjpeg`,`vp8`,`vp9`]),Kg=d({acceptCodecs:S(Gg).readonly().optional(),minHeight:i().int().positive().optional(),maxHeight:i().int().positive().optional(),minWidth:i().int().positive().optional(),excludeDerived:C().optional(),requireSiblingCodec:S(Gg).readonly().optional(),allowTranscode:C().optional(),requireProfileBound:C().optional()}).readonly(),qg=d({preferredProviders:S(l()).readonly().optional(),resolutionPreference:x([`highest`,`lowest`]).optional(),targetHeight:i().int().positive().optional()}).readonly(),Jg=d({camStreamId:l(),codec:l().optional(),resolution:qn.optional(),transcodes:C(),reason:l(),profile:E.optional(),brokerId:l().optional(),url:l().optional(),fps:i().positive().optional(),fpsSource:x([`published`,`measured`]).optional()}),Yg={name:`camera-streams`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],methods:{getCameraStreams:D(d({deviceId:i().int().nonnegative()}),S(Jn).readonly()),getBrokerStreams:D(d({deviceId:i().int().nonnegative()}),S(Xn).readonly()),getRtspEntries:D(d({deviceId:i().int().nonnegative(),hostname:l().optional()}),S(Og).readonly()),getProfileRtspEntries:D(d({deviceId:i().int().nonnegative(),hostname:l().optional()}),S(ur).readonly()),pickStream:D(d({deviceId:i().int().nonnegative(),requirements:Kg,preferences:qg.optional()}),Jg.nullable())},events:{onCamStreamsChanged:Pr(d({deviceId:i().int().nonnegative(),camStreams:S(Jn).readonly()})),onProfileSlotsChanged:Pr(d({deviceId:i().int().nonnegative(),profileSlots:S(Xn).readonly()}))},runtimeState:d({online:C(),slotStatuses:d({high:Yn.optional(),mid:Yn.optional(),low:Yn.optional()}),slotErrors:d({high:l().optional(),mid:l().optional(),low:l().optional()}),lastChangedAt:i()}),durability:`session`};function Xg(e){let t=Tr(e).kind;return t===`collection`?!0:t===`skip`&&e.mode===`collection`}function Zg(e){let t=e._def;return e.constructor?.name===`ZodVoid`||t?.type===`void`||t?.typeName===`ZodVoid`}function Qg(e){let t=e._def;return e.constructor?.name===`ZodObject`||t?.type===`object`||t?.typeName===`ZodObject`}function $g(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 e_(e,t){if(e===void 0||e.mode!==`collection`)return!1;let n=jr(e)[t];return n!==void 0&&n.kind!==`subscription`&&$g(n.output)}function t_(e){let t=e.loose;return typeof t==`function`?t.call(e):e}function n_(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 r_(e){if(e===null||typeof e!=`object`&&typeof e!=`function`)return!1;let t=e.shape??a_(e._def?.shape);return typeof t==`object`&&!!t&&Object.prototype.hasOwnProperty.call(t,`addonId`)}function i_(e){if(e===null||typeof e!=`object`&&typeof e!=`function`)return!1;let t=e.shape??a_(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 a_(e){return typeof e==`function`?e():e}function o_(e,t){return t.auth===void 0?e.internal===!0?`admin`:`protected`:t.auth}function s_(e){return e===`public`?`public`:e===`admin`||e===`superAdmin`?`admin`:`protected`}function c_(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function l_(e){let t=e;for(;t instanceof ue||t instanceof fe||t instanceof g;)t=t.unwrap();return t}function u_(e){let t=l_(e);return t instanceof ce?{kind:`enum`,enumValues:t.options}:t instanceof ee?{kind:`number`}:t instanceof te?{kind:`string`}:t instanceof ie?{kind:`boolean`}:null}function d_(e,t=``){let n=l_(e);if(!(n instanceof oe))return[];let r=[],i=n.shape;for(let[e,n]of Object.entries(i)){let i=t?`${t}.${e}`:e,a=l_(n);if(a instanceof oe){r.push(...d_(a,i));continue}let o=u_(n);o&&r.push({path:i,kind:o.kind,...o.enumValues?{enumValues:o.enumValues}:{}})}return r}function f_(e){return d_(e.itemSchema).filter(t=>t.path!==e.keyField).map(e=>({...e,item:!0}))}function p_(e,t){let n=e;for(let e of t.split(`.`)){let t=l_(n);if(!(t instanceof oe))return null;let r=t.shape[e];if(!(r instanceof ne))return null;n=r}return n}function m_(e,t){let n=d_(e).find(e=>e.path===t);if(n===void 0)return null;let r=p_(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 h_(e){return new Map(d_(e).filter(e=>!e.path.includes(`.`)).flatMap(t=>{let n=m_(e,t.path);return n===null?[]:[[t.path,n]]}))}function g_(e){let t=l_(e);return t instanceof oe?Object.entries(t.shape).flatMap(([e,t])=>t instanceof ne&&!t.safeParse(void 0).success?[e]:[]):[]}function __(e,t){let n=t.split(`.`);return n.slice(0,-1).flatMap((t,r)=>{let i=n.slice(0,r+1).join(`.`),a=p_(e,i);return a!==null&&a.safeParse(void 0).success?[i]:[]})}var v_={"doorbell.onPressed":he.DoorbellOnPressed},y_=v_,b_=d({featureIndex:i().int().nonnegative(),cap:l(),eventName:l(),category:x(he),stateField:l(),fieldKey:l()});function x_(e,t,n){return{code:e,path:t,message:n}}function S_(e){return e.issues.map(e=>`${e.path.length===0?`payload`:e.path.join(`.`)}: ${e.message}`).join(`; `)}function C_(e,t,n){if(t.mode===`replace`)return{problems:[],events:[]};let r=[],i=[];for(let[a,o]of Object.entries(e.events??{})){let s=o.fromState;if(s===void 0)continue;let c=`features[${t.featureIndex}].fields.${s.field}`,l=e.runtimeState?m_(e.runtimeState,s.field):null;if(l===null){r.push(x_(`unknown-field`,c,`\`${e.name}.${a}\` derives from missing state field \`${s.field}\``));continue}if(l.kind!==`number`){r.push(x_(`kind-mismatch`,c,`\`${e.name}.${a}\` needs a numeric state field; \`${s.field}\` is ${l.kind}`));continue}let u=`${e.name}.${a}`,d=y_[u];if(d===void 0){r.push(x_(`not-composable`,`features[${t.featureIndex}].cap`,`\`${u}\` has no explicit composition event-category mapping`));continue}let f=o.data.safeParse({deviceId:1,timestamp:1});if(!f.success){r.push(x_(`not-composable`,`features[${t.featureIndex}].cap`,`\`${u}\` cannot be derived from { deviceId, timestamp }: ${S_(f.error)}`));continue}let p=n.find(n=>n.featureIndex===t.featureIndex&&n.cap===e.name&&n.path===s.field&&n.item===void 0);if(p===void 0){r.push(x_(`unknown-field`,c,`\`${u}\` derives from \`${s.field}\`, but that field is not composed`));continue}i.push({featureIndex:t.featureIndex,cap:e.name,eventName:a,category:d,stateField:s.field,fieldKey:`${p.cap}.${p.path}`})}return{problems:r,events:i}}var w_=x([`reserved-variant`,`unknown-capability`,`not-composable`,`wrong-device-type`,`has-commands`,`unknown-field`,`nested-field`,`missing-field`,`kind-mismatch`,`may-be-null`,`source-missing`,`source-unreadable`,`source-capability-missing`,`source-field-unknown`,`expression-invalid`,`cycle`,`duplicate-target`,`not-item-array`,`item-field-reserved`,`target-missing`,`target-unreadable`,`not-replaceable`]),T_=d({code:w_,path:l(),message:l()}),E_=x([`string`,`number`,`boolean`,`enum`]),D_=x([`null`,`offline`,`unknown`,`release`]),O_=x([`derived`,`clock`,`constant`,`accumulator`]),k_=d({arrayPath:l(),key:l(),label:l()}),A_=d({cap:l(),path:l(),item:k_.optional(),featureIndex:i().int().nonnegative(),kind:E_,nullable:C(),required:C(),unavailable:D_,role:O_,source:Vo,reads:S(Fo)});function j_(e){let t=e.item===void 0?e.path:ss(e.item.arrayPath,e.item.key,e.path);return`${e.cap}.${t}`}var M_=x([`new`,`add`,`replace`]),N_=d({featureIndex:i().int().nonnegative(),cap:l(),mode:M_}),P_=d({ok:C(),problems:S(T_),fields:S(A_),features:S(N_),events:S(b_)}),F_=x([`stopped`,`starting`,`running`,`degraded`,`failed`]),I_=x([`fresh`,`stale`,`unavailable`]),L_=d({cap:l(),path:l(),item:k_.optional(),state:I_,value:f([l(),i(),C(),re()]),reason:l().optional()}),R_=d({blockId:l(),deviceId:i().nullable(),status:F_,reason:l().optional(),fields:S(L_)}),z_=Oo,B_=d({id:l().min(1),name:l().min(1).max(120),enabled:C(),updatedAt:i(),composition:ts}),V_=d({id:l().min(1),name:l().nullable(),error:l()}),H_=d({integrationId:l().nullable(),storeLoaded:C(),blocks:S(B_),restartBlockIds:S(l()),unreadableBlocks:S(V_)}),U_=d({blockId:l(),status:F_,reason:l().optional()}),W_=d({blocks:S(U_),acted:C()}),G_={name:`composer`,scope:`system`,mode:`singleton`,internal:!0,methods:{applyBlocks:D(H_,W_,{kind:`mutation`,auth:`admin`}),getStates:D(d({blockIds:S(l())}),d({states:S(R_)}),{auth:`admin`})}};function H(e,t,n){return{code:e,path:t,message:n}}function U(...e){return{problems:e,fields:[],features:[],events:[]}}function K_(e){let t=e.item===void 0?`fields`:`items.${e.item.key}.fields`;return`features[${e.featureIndex}].${t}.${e.path}`}var W={kind:`fixed`,result:[`number`]},q_={kind:`fixed`,result:[`boolean`]},J_=Object.freeze({min:W,max:W,abs:W,floor:W,ceil:W,sqrt:W,round:W,pow:W,clamp:W,avg:W,sum:W,age:W,convert:W,coalesce:{kind:`coalesce`},any:q_,all:q_,within:q_,latest:{kind:`fixed`,result:[`number`,`null`]},number:{kind:`fixed`,result:[`number`,`null`]},rose:{kind:`fixed`,result:[`number`,`null`]},count:W}),Y_=class extends Error{};function X_(e){return e===null?`null`:typeof e==`number`?`number`:typeof e==`string`?`string`:`boolean`}function Z_(e){return new Set([e])}function Q_(...e){return new Set(e.flatMap(e=>[...e]))}function $_(e){return new Set([...e].filter(e=>e!==`null`))}function ev(e,t,n){if(e===`+`){let e=[...t,...n];return e.every(e=>e===`string`)?Z_(`string`):e.every(e=>e===`number`)?Z_(`number`):new Set([`number`,`string`])}return Z_(e===`-`||e===`*`||e===`/`||e===`%`?`number`:`boolean`)}function tv(e){return e.minArgs===e.maxArgs?`exactly ${e.minArgs}`:e.maxArgs===1/0?`at least ${e.minArgs}`:`${e.minArgs}–${e.maxArgs}`}function nv(e,t){let n=La[e];if(n!==void 0&&(t.length<n.minArgs||t.length>n.maxArgs))throw new Y_(`${e}: wrong number of arguments (${t.length}); expected ${tv(n)}`);let r=J_[e];if(r===void 0)throw new Y_(`no result-kind rule for builtin '${e}'`);if(r.kind===`fixed`)return new Set(r.result);let i=Q_(...t.map($_));return t.every(e=>e.has(`null`))?Q_(i,Z_(`null`)):i}function rv(e,t){switch(e.kind){case`literal`:return Z_(X_(e.value));case`identifier`:{if(e.name===`now`)return Z_(`number`);let n=t.get(e.name);if(n===void 0)throw new Y_(`unbound identifier '${e.name}'`);return n}case`unary`:return Z_(e.op===`!`?`boolean`:`number`);case`binary`:return ev(e.op,rv(e.left,t),rv(e.right,t));case`logical`:return Q_(rv(e.left,t),rv(e.right,t));case`conditional`:return Q_(rv(e.consequent,t),rv(e.alternate,t));case`call`:return nv(e.callee,e.args.map(e=>rv(e,t)))}}function iv(e,t){switch(e.kind){case`literal`:case`identifier`:return!1;case`unary`:return iv(e.operand,t);case`binary`:case`logical`:return iv(e.left,t)||iv(e.right,t);case`conditional`:return iv(e.test,t)||iv(e.consequent,t)||iv(e.alternate,t);case`call`:return e.callee===t||e.args.some(e=>iv(e,t))}}function av(e,t){let n=lo(e);return n.ok&&iv(n.parsed.ast,t)}function ov(e){let t=lo(e.expr);if(!t.ok)return{ok:!1,error:t.error};try{return{ok:!0,kinds:rv(t.parsed.ast,e.bindingKinds)}}catch(e){if(e instanceof Y_)return{ok:!1,error:e.message};throw e}}function sv(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=m_(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 cv(e,t){if(e.kind===`from`)return sv(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([X_(i.value)]));continue}let e=sv(i,t);if(!e.ok)return{...e,message:`binding \`${r}\`: ${e.message}`};n.set(r,e.kinds)}let r=ov({expr:e.expr,bindingKinds:n});return r.ok?{ok:!0,kinds:r.kinds}:{ok:!1,code:`expression-invalid`,message:r.error}}function lv(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(H(`kind-mismatch`,r,`\`${e}.${t.path}\` is a ${t.kind}; this source can produce ${a.join(` or `)}`)),n.has(`null`)&&!t.nullable&&o.push(H(`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 uv(e){if(e.kind!==`expression`)return null;let t=lo(e.expr);if(!t.ok)return null;let n=t.parsed.ast;return n.kind===`literal`&&typeof n.value==`string`?n.value:null}function dv(e,t,n,r){if(t.kind!==`enum`||t.enumValues===void 0)return null;let i=uv(n);if(i===null||t.enumValues.includes(i))return null;let a=t.enumValues.map(e=>`\`${e}\``).join(`, `);return H(`kind-mismatch`,r,`\`${e}.${t.path}\` accepts only ${a}; this source is the literal \`${i}\``)}function fv(e){if(e.kind!==`expression`)return`derived`;if(av(e.expr,`count`))return`accumulator`;if(os(e).length>0)return`derived`;let t=lo(e.expr);return t.ok&&t.parsed.identifiers.has(`now`)?`clock`:`constant`}function pv(e,t,n,r,i){return n===`replace`&&(t===`derived`||t===`accumulator`)?{ok:!0,unavailable:`release`}:n===`new`||t!==`derived`?{ok:!0,unavailable:e.nullable?`null`:`offline`}:e.nullable?{ok:!0,unavailable:`null`}:e.enumValues?.includes(`unknown`)===!0?{ok:!0,unavailable:`unknown`}:{ok:!1,problem:H(`not-replaceable`,i,`\`${r}.${e.path}\` reads a source but can say neither null nor 'unknown', and an ADDED capability has no native reading to fall back to`)}}var mv={resettable:!1};function hv(e){return new Set([e.keyField,...e.labelField===void 0?[]:[e.labelField],...Object.keys(mv)])}function gv(e,t,n){let r=m_(e.itemSchema,t);return r===null||!r.required?!1:__(e.itemSchema,t).every(e=>n.some(t=>t.startsWith(`${e}.`)))}function _v({capName:e,itemArray:t,reserved:n},r,i){let a=Object.keys(r.fields);return d_(t.itemSchema).flatMap(o=>{if(n.has(o.path)||o.path in r.fields||!gv(t,o.path,a))return[];let s=m_(t.itemSchema,o.path);return s===null||s.nullable?[]:[H(`missing-field`,`${i}.fields.${o.path}`,`\`${e}.${t.path}[].${o.path}\` is required and has no source`)]})}function vv(e,t){let{capName:n,itemArray:r,featureIndex:i,lookupCap:a}=e,{key:o,label:s,path:c,source:l}=t,u=`features[${i}].items.${o}.fields.${c}`;if(e.reserved.has(c))return U(H(`item-field-reserved`,u,`\`${n}.${r.path}[].${c}\` is set by the composer itself — it takes no source`));let d=m_(r.itemSchema,c);if(d===null)return U(H(`unknown-field`,u,`a \`${n}\` item has no field \`${c}\``));let f=cv(l,a);if(!f.ok)return U(H(f.code,u,f.message));let p=fv(l),m=pv(d,p,e.mode,n,u);if(!m.ok)return U(m.problem);let h={cap:n,path:c,item:{arrayPath:r.path,key:o,label:s},featureIndex:i,kind:d.kind,nullable:d.nullable,required:d.required,unavailable:m.unavailable,role:p,source:l,reads:[...os(l)]},g=dv(n,d,l,u);return{problems:[...lv(n,d,f.kinds,u),...g===null?[]:[g]],fields:[h],features:[],events:[]}}function yv(e,t,n,r,i=`new`){let a=`features[${n}].items`,o=e.status?.itemArray;if(o===void 0)return U(H(`not-item-array`,a,`\`${e.name}\` has no item array — it takes no \`items\``));if(o.path!==`items`)return U(H(`not-item-array`,a,`\`${e.name}\`'s item array is at \`${o.path}\`, not \`${Ko}\` — not composable yet`));let s={capName:e.name,itemArray:o,reserved:hv(o),featureIndex:n,lookupCap:r,mode:i},c=Object.entries(t.items??{}).flatMap(([e,t])=>[{problems:_v(s,t,`${a}.${e}`),fields:[],features:[],events:[]},...Object.entries(t.fields).map(([n,r])=>vv(s,{key:e,label:t.label,path:n,source:r}))]);return{problems:c.flatMap(e=>e.problems),fields:c.flatMap(e=>e.fields),features:[],events:[]}}var bv=class extends Error{};function xv(e){return new Set(e.composition.features.flatMap(e=>!Zo(e)||e.kind!==`fields`?[]:cs(e).map(({fieldPath:t})=>`${e.cap}.${t}`)))}function Sv(e,t,n){if(L(n.source)!==L(e.target))return!0;let r=`${n.cap}.${n.fieldPath}`;return t.has(r)&&e.replaced?.has(r)!==!0}function Cv(e){let t=xv(e);return e.composition.features.flatMap(n=>!Zo(n)||n.kind!==`fields`?[]:cs(n).map(({fieldPath:r,source:i})=>[rs({source:e.target,cap:n.cap,fieldPath:r}),os(i).filter(n=>Sv(e,t,n)).map(rs)]))}function wv(e,t){let n=L(e.target),r=new Map;for(let i of t){if(i.blockId===e.blockId)continue;let t=L(i.target);if(t===n)throw new bv(`block \`${i.blockId}\` and block \`${e.blockId}\` both target device \`${t}\` — one composition per device; delete or edit the existing one`);let a=r.get(t);if(a!==void 0)throw new bv(`two stored compositions (\`${a.blockId}\`, \`${i.blockId}\`) both target device \`${t}\` — refusing to build the field graph`);r.set(t,i)}return[...r.values(),e]}function Tv(e,t){let n=wv(e,t).flatMap(Cv);return new Map(n)}function Ev(e,t){let n=Tv(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 Dv(e){let t=new Map,n=new Map,r=new Set,i=[],a=[],o=s=>{t.set(s,t.size),n.set(s,t.get(s)??0),i.push(s),r.add(s);for(let i of e.get(s)??[])t.has(i)?r.has(i)&&n.set(s,Math.min(n.get(s)??0,t.get(i)??0)):(o(i),n.set(s,Math.min(n.get(s)??0,n.get(i)??0)));if(n.get(s)!==t.get(s))return;let c=[];for(let e=i.pop();e!==void 0&&(r.delete(e),c.push(e),e!==s);e=i.pop());a.push(c)};for(let n of e.keys())t.has(n)||o(n);return a}function Ov(e,t,n){let r=new Map,i=[e];for(let a=0;a<i.length;a+=1){let o=i[a];if(o===void 0)break;for(let a of n.get(o)??[]){if(a===e){let t=[];for(let n=o;n!==void 0&&n!==e;n=r.get(n))t.push(n);return[e,...t.reverse(),e]}!t.has(a)||r.has(a)||(r.set(a,o),i.push(a))}}return[e,e]}function kv(e,t){let n=Tv(e,t),r=`${L(e.target)}#`;return Dv(n).flatMap(e=>{let t=e.find(e=>e.startsWith(r));if(t===void 0)return[];let i=new Set(e),a=e.length===1&&(n.get(t)??[]).includes(t);return e.length===1&&!a?[]:[{path:Ov(t,i,n),component:i}]})}function Av(e){let t=new Map(e.map(e=>[e.name,e]));return e=>t.get(e)??null}var jv=new Set([`device-status`,`feature-probe`]),Mv={addonId:Oo,stableId:`${Ao}(unsaved)`},Nv=`(unsaved)`;function Pv(e,t,n){let r=n(e.cap);if(r===null)return H(`unknown-capability`,`${t}.cap`,`no capability is named \`${e.cap}\``);if(jv.has(r.name))return H(`not-composable`,`${t}.cap`,`\`${r.name}\` is registered by every device itself — it cannot be composed`);let i=r.runtimeState;return r.scope!==`device`||i===void 0?H(`not-composable`,`${t}.cap`,`\`${r.name}\` has no per-device state to compose`):{def:r,state:i,fields:h_(i)}}function Fv({def:e,state:t,fields:n},r,i,a){let o=[];e.deviceTypes!==void 0&&!e.deviceTypes.includes(a)&&o.push(H(`wrong-device-type`,`${i}.cap`,`\`${e.name}\` is not offered on a \`${a}\` device (it allows ${e.deviceTypes.join(`, `)})`));let s=Object.entries(e.methods).filter(([t,n])=>n.systemOnly!==!0&&e.composedMethods?.[t]===void 0).map(([e])=>`\`${e}\``);s.length>0&&o.push(H(`has-commands`,`${i}.cap`,`\`${e.name}\` has ${s.join(`, `)}, which a composed device cannot serve until commands arrive (slice 3)`));let c=r.items===void 0?null:e.status?.itemArray?.path??null;for(let a of g_(t))a!==c&&(n.has(a)?a in r.fields||o.push(H(`missing-field`,`${i}.fields.${a}`,`\`${e.name}.${a}\` is required and has no source`)):o.push(H(`not-composable`,`${i}.fields`,`\`${e.name}.${a}\` is not a scalar — nested fields arrive in a later slice`)));return o}function Iv({def:e,fields:t},n,r,i){let{featureIndex:a,path:o,source:s}=n,c=`features[${a}].fields.${o}`;if(o.includes(`.`))return U(H(`nested-field`,c,`\`${o}\` is nested — nested fields arrive in a later slice`));let l=t.get(o);if(l===void 0)return U(H(`unknown-field`,c,`\`${e.name}\` has no field \`${o}\``));let u=cv(s,i);if(!u.ok)return U(H(u.code,c,u.message));let d=fv(s),f=pv(l,d,r,e.name,c);if(!f.ok)return U(f.problem);let p={cap:e.name,path:o,featureIndex:a,kind:l.kind,nullable:l.nullable,required:l.required,unavailable:f.unavailable,role:d,source:s,reads:[...os(s)]},m=dv(e.name,l,s,c);return{problems:[...lv(e.name,l,u.kinds,c),...m===null?[]:[m]],fields:[p],features:[],events:[]}}function Lv(e,t,n,r){let i=`features[${t}]`,a=Pv(e,i,r);if(`code`in a)return U(a);let o=n.mode===`replace`?[]:[...Fv(a,e,i,n.deviceType)];e.commands!==void 0&&Object.keys(e.commands).length>0&&o.push(H(`reserved-variant`,`${i}.commands`,"commands (`forward`) arrive in slice 3"));let s=Object.entries(e.fields).map(([e,i])=>Iv(a,{featureIndex:t,path:e,source:i},n.mode,r)),c=e.items===void 0?[]:[yv(a.def,e,t,r,n.mode)],l=[...s,...c],u=l.flatMap(e=>e.fields),d={featureIndex:t,cap:a.def.name,mode:n.mode},f=C_(a.def,d,u);return{problems:[...o,...l.flatMap(e=>e.problems),...f.problems],fields:u,features:[d],events:f.events}}function Rv(e,t){let n=e.nativeCaps.get(t);return n!==void 0&&n!==`composer`}function zv(e,t){if(e.target.kind===`new`)return{kind:`new`,type:e.target.type};let n=L(e.target.device);return t===void 0?H(`target-unreadable`,`target`,`target device \`${n}\` was not read — the save is refused rather than stored unchecked`):t.kind===`absent`?H(`target-missing`,`target`,`target device \`${n}\` does not exist`):t.kind===`unreadable`?H(`target-unreadable`,`target`,`could not read target device \`${n}\` (${t.error}) — the save is refused rather than stored unchecked`):{kind:`existing`,found:t}}function Bv(e,t){return e.kind===`new`?{mode:`new`,deviceType:e.type}:{mode:Rv(e.found,t)?`replace`:`add`,deviceType:e.found.type}}function Vv(e,t,n){let r=zv(e,n);if(`code`in r)return U(r);let i=e.features.map((e,n)=>{let i=e.kind===`passthrough`?U(H(`reserved-variant`,`features[${n}]`,`whole-capability passthrough of \`${e.cap}\` arrives in slice 3`)):Lv(e,n,Bv(r,e.cap),t);return Zo(e)?i:{problems:i.problems,fields:[],features:[],events:[]}});return{problems:i.flatMap(e=>e.problems),fields:i.flatMap(e=>e.fields),features:i.flatMap(e=>e.features),events:i.flatMap(e=>e.events)}}function Hv(e){let t=e.features.flatMap(e=>Zo(e)&&e.kind===`fields`?ls(e).flatMap(os).map(e=>e.source):[]);return[...new Map(t.map(e=>[L(e),e])).values()]}function Uv(e,t,n){return{ref:e.target.kind===`existing`?e.target.device:t.self??Mv,native:e.target.kind===`existing`&&t.target?.kind===`found`?t.target:null,replaced:Wv(n)}}function Wv(e){let t=new Set(e.features.filter(e=>e.mode===`replace`).map(e=>e.featureIndex));return new Set(e.fields.filter(e=>t.has(e.featureIndex)).map(j_))}function Gv(e,t,n,r){let i=`${e.cap}.${e.fieldPath}`;return n.some(e=>j_(e)===i&&!r.replaced.has(i))?[]:r.native===null?[H(`source-field-unknown`,t,`this device has no composed field \`${e.cap}.${e.fieldPath}\``)]:Rv(r.native,e.cap)?[]:[H(`source-capability-missing`,t,`the target device (device ${r.native.deviceId}) has no native \`${e.cap}\``)]}function Kv(e,t,n){let r=L(n.ref);return e.flatMap(i=>i.reads.flatMap(a=>{let o=K_(i),s=L(a.source);if(s===r)return Gv(a,o,e,n);let c=t.sources.get(s);return c===void 0||c.kind===`unreadable`?[H(`source-unreadable`,o,`could not read source \`${s}\` (${c===void 0?`it was not read`:c.error}) — the save is refused rather than stored unchecked`)]:c.kind===`absent`?[H(`source-missing`,o,`source \`${s}\` does not exist`)]:c.caps.has(a.cap)?[]:[H(`source-capability-missing`,o,`source \`${s}\` (device ${c.deviceId}) has no \`${a.cap}\``)]}))}function qv(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 Jv(e,t,n){for(let r of e){let e=qv(r,t);if(e===null)continue;let i=`${e.cap}.${e.fieldPath}`,a=n.find(e=>j_(e)===i);if(a!==void 0)return K_(a)}return`features`}function Yv(e,t){for(let[n,r]of t)if(e.some(e=>e.startsWith(`${n}#`)))return{key:n,error:r};return null}function Xv(e,t,n,r){let i={blockId:t.blockId??`(unsaved)`,target:r.ref,composition:e,replaced:r.replaced},a=L(i.target),o=t.unreadTargets??new Map;try{return kv(i,t.peers).map(e=>{let t=Jv(e.path,a,n),r=Yv([...e.component],o);return r===null?H(`cycle`,t,`a field reads itself: ${e.path.join(` → `)}`):H(`cycle`,t,`possible cycle through \`${r.key}\` — its state could not be read (${r.error}): ${e.path.join(` → `)}`)})}catch(e){if(e instanceof bv)return[H(`duplicate-target`,`features`,e.message)];throw e}}function Zv(e,t){let n=Vv(e,t.lookupCap,t.target??void 0),r=Uv(e,t,n),i=Xv(e,t,n.fields,r),a=[...n.problems,...Kv(n.fields,t,r),...i];return{ok:a.length===0,problems:a,fields:[...n.fields],features:[...n.features],events:[...n.events]}}var Qv=d({path:l(),kind:E_,nullable:C(),required:C(),enumValues:S(l()).optional()}),$v=d({cap:l(),fields:S(Qv),itemArray:d({path:l(),keyField:l()}).optional()}),ey=d({caps:S($v)});function ty(e,t){if(jv.has(e.name))return[`not-composable`];let n=e.runtimeState;if(e.scope!==`device`||n===void 0)return[`not-composable`];let r=[];e.deviceTypes!==void 0&&!e.deviceTypes.includes(t)&&r.push(`wrong-device-type`),Object.entries(e.methods).filter(([t,n])=>n.systemOnly!==!0&&e.composedMethods?.[t]===void 0).length>0&&r.push(`has-commands`);let i=h_(n),a=e.status?.itemArray?.path??null;return g_(n).some(e=>e!==a&&!i.has(e))&&r.push(`not-composable`),C_(e,{featureIndex:0,cap:e.name,mode:`new`},[]).problems.some(e=>e.code===`not-composable`)&&!r.includes(`not-composable`)&&r.push(`not-composable`),r}function ny(e,t){return e.filter(e=>ty(e,t).length===0).map(e=>{let t=e.runtimeState,n=t===void 0?[]:[...h_(t).values()],r=e.status?.itemArray;return{cap:e.name,fields:n.map(e=>({path:e.path,kind:e.kind,nullable:e.nullable,required:e.required,...e.enumValues===void 0?{}:{enumValues:[...e.enumValues]}})),...r===void 0?{}:{itemArray:{path:r.path,keyField:r.keyField}}}}).toSorted((e,t)=>e.cap.localeCompare(t.cap))}var ry=`core-block-`,iy=`core-blocks`;function ay(e){return`${ry}${e}`}function oy(e){if(!e.startsWith(`core-block-`))return null;let t=e.slice(11);return t.length>0?t:null}var sy=f([m(`hub`),l().min(1)]),cy=x([`stopped`,`starting`,`running`,`degraded`,`failed`]),ly=`main.ts`,uy=y(l().min(1).max(260),l().max(2e5)),dy=_(),fy=d({name:l().min(1).max(120),code:l().max(2e5).optional(),files:uy.optional(),entry:l().min(1).max(260).optional(),enabled:C(),placement:sy,integrationId:l().optional(),settingsSchema:dy.optional()}),py=fy.superRefine((e,t)=>{let n=e.entry??`main.ts`;if(e.files!==void 0){e.files[n]===void 0&&t.addIssue({code:`custom`,message:`files must include the entry "${n}"`,path:[`files`]});return}e.code===void 0&&t.addIssue({code:`custom`,message:`code or files is required`,path:[`code`]})});function my(e){return e!==void 0&&e.length>0?e:ly}function hy(e){let t=my(e.entry);return e.files===void 0?{files:{[t]:e.code},entry:t}:{files:{...e.files},entry:t}}function gy(e){if(e.files!==void 0){let t=my(e.entry);return{code:e.files[t]??e.code??``,files:{...e.files},entry:t}}return{code:e.code??``,...e.entry===void 0?{}:{entry:e.entry}}}var _y=p(`kind`,[d({kind:m(`code`)}),d({kind:m(`recipe`),recipe:xm}),d({kind:m(`composition`),composition:ts})]),vy=d({name:l().min(1).max(120).optional(),enabled:C(),composition:ts}),yy=d({name:l().min(1).max(120),code:l().max(2e5),files:uy.optional(),entry:l().min(1).max(260).optional(),enabled:C(),placement:sy,integrationId:l().optional(),settingsSchema:dy.optional(),id:l(),createdAt:i(),updatedAt:i(),createdBy:l(),status:cy,lastError:l().optional(),lastChangedAt:i(),source:_y.optional()});function by(e){return e.source?.kind??`code`}function xy(e){return e.source?.kind===`composition`?e.source.composition:null}var Sy=p(`kind`,[d({kind:m(`answered`),state:R_.nullable()}),d({kind:m(`unreachable`),error:l()})]),Cy=d({block:yy,state:Sy}),wy=d({state:m(`not-loaded`),reason:l()}),Ty=p(`state`,[d({state:m(`loaded`),views:S(Cy)}),wy]),Ey=p(`state`,[d({state:m(`loaded`),view:Cy.nullable()}),wy]),Dy=p(`state`,[d({state:m(`loaded`),view:Cy.nullable()}),wy]),Oy=d({ok:C(),error:l().optional(),line:i().optional(),column:i().optional()}),ky=d({code:l().optional(),files:uy.optional(),entry:l().min(1).max(260).optional()}).superRefine((e,t)=>{if(e.files!==void 0){let n=e.entry??`main.ts`;e.files[n]===void 0&&t.addIssue({code:`custom`,message:`files must include the entry "${n}"`,path:[`files`]});return}e.code===void 0&&t.addIssue({code:`custom`,message:`code or files is required`,path:[`code`]})}),Ay={name:`core-blocks`,scope:`system`,mode:`singleton`,methods:{list:D(d({}),d({blocks:S(yy)}),{auth:`admin`}),get:D(d({blockId:l()}),d({block:yy.nullable()}),{auth:`admin`}),create:D(d({block:py}),d({block:yy}),{kind:`mutation`,auth:`admin`,caller:`required`}),update:D(d({blockId:l(),block:fy.partial()}),d({block:yy}),{kind:`mutation`,auth:`admin`,caller:`required`}),delete:D(d({blockId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setEnabled:D(d({blockId:l(),enabled:C()}),d({block:yy}),{kind:`mutation`,auth:`admin`}),restart:D(d({blockId:l()}),d({block:yy}),{kind:`mutation`,auth:`admin`}),compile:D(ky,Oy,{kind:`mutation`,auth:`admin`}),getBlockSettings:D(d({blockId:l()}),Hm.nullable(),{auth:`admin`}),updateBlockSettings:D(d({blockId:l(),patch:Um}),Wm,{kind:`mutation`,auth:`admin`}),getTypeDefs:D(d({}),d({libs:S(d({filePath:l(),content:l()}))}),{auth:`admin`}),createComposition:D(d({block:vy}),d({block:yy}),{kind:`mutation`,auth:`admin`,caller:`required`}),updateComposition:D(d({blockId:l(),expectedUpdatedAt:i(),block:vy.partial()}),d({block:yy}),{kind:`mutation`,auth:`admin`,caller:`required`}),getComposition:D(d({blockId:l()}),Ey,{auth:`admin`}),listCompositions:D(d({}),Ty,{auth:`admin`}),getCustomization:D(d({addonId:l().min(1),stableId:l().min(1)}),Dy,{auth:`admin`}),listComposableCaps:D(d({deviceType:x(k)}),ey,{auth:`admin`}),validateComposition:D(d({composition:ts,blockId:l().optional()}),P_,{kind:`mutation`,auth:`admin`,access:`view`})}},jy=d({stepId:l(),entry:Gp}),My=d({path:l().min(1),bytes:i().int().nonnegative(),sha256:l().regex(/^[0-9a-f]{64}$/)}),Ny=d({addonId:l(),stepId:l().min(1),entries:S(Gp).min(1).max(4),bundle:d({ticket:En,bytes:i().int().positive(),sha256:l().regex(/^[0-9a-f]{64}$/)}),files:S(My).min(1).max(64),distribute:C()}),Py=p(`kind`,[d({kind:m(`imported`),modelIds:S(l()).readonly(),distributed:S(d({modelId:l(),nodeId:l(),format:x(yr),ok:C(),error:l().optional()})).readonly()}),d({kind:m(`refused`),reason:x([`transfer-failed`,`checksum-mismatch`,`bundle-mismatch`,`invalid-entry`,`id-taken`]),detail:l()})]),Fy={name:`custom-model-registry`,scope:`system`,mode:`collection`,internal:!0,methods:{listModels:D(v(),S(jy).readonly(),{auth:`admin`}),importModelBundle:D(Ny,Py,{kind:`mutation`,auth:`admin`,timeoutMs:30*6e4})}},Iy=d({where:y(l(),o()).optional(),whereIn:y(l(),S(o())).optional(),whereBetween:y(l(),u([o(),o()])).optional(),whereNot:y(l(),o()).optional(),whereNotIn:y(l(),S(o())).optional(),orderBy:d({field:l(),direction:x([`asc`,`desc`])}).optional(),limit:i().optional(),offset:i().optional()}),Ly=d({where:y(l(),o()).optional(),whereIn:y(l(),S(o())).optional(),whereBetween:y(l(),u([o(),o()])).optional(),whereNot:y(l(),o()).optional(),whereNotIn:y(l(),S(o())).optional()}),Ry=d({as:l().min(1),field:l().min(1),op:x([`sum`,`min`,`max`])}),zy=d({count:i().int(),values:y(l(),i().nullable())}),By=d({id:l(),data:y(l(),o())}),Vy=d({id:l().optional(),data:y(l(),o())}),Hy=d({name:l(),type:x([`TEXT`,`INTEGER`,`REAL`,`JSON`,`BOOLEAN`]),primaryKey:C().optional(),notNull:C().optional(),unique:C().optional(),defaultValue:f([l(),i(),C()]).optional()}),Uy=d({name:l(),columns:S(l()).readonly(),unique:C().optional()}),Wy={name:`settings-store`,scope:`system`,mode:`singleton`,methods:{get:D(d({namespace:l().optional(),collection:l(),key:l()}),o(),{auth:`admin`}),set:D(d({namespace:l().optional(),collection:l(),key:l(),value:o()}),v(),{kind:`mutation`,auth:`admin`}),query:D(d({namespace:l().optional(),collection:l(),filter:Iy.optional(),columns:S(l()).readonly().optional()}),S(By).readonly(),{auth:`admin`}),upsert:D(d({namespace:l().optional(),collection:l(),conflict:S(l()).readonly(),record:Vy}),d({id:f([l(),i()])}),{kind:`mutation`,auth:`admin`}),insert:D(d({namespace:l().optional(),collection:l(),record:d({id:l().optional(),data:y(l(),o())})}),d({id:f([l(),i()])}),{kind:`mutation`,auth:`admin`}),insertMany:D(d({namespace:l().optional(),collection:l(),records:S(Vy).readonly()}),d({inserted:i().int()}),{kind:`mutation`,auth:`admin`}),update:D(d({namespace:l().optional(),collection:l(),id:l(),data:y(l(),o())}),v(),{kind:`mutation`,auth:`admin`}),delete:D(d({namespace:l().optional(),collection:l(),key:l()}),v(),{kind:`mutation`,auth:`admin`}),deleteWhere:D(d({namespace:l().optional(),collection:l(),filter:Ly}),d({deleted:i().int()}),{kind:`mutation`,auth:`admin`}),updateWhere:D(d({namespace:l().optional(),collection:l(),filter:Ly,data:y(l(),o())}),d({updated:i().int()}),{kind:`mutation`,auth:`admin`}),count:D(d({namespace:l().optional(),collection:l(),filter:Iy.optional()}),i(),{auth:`admin`}),aggregate:D(d({namespace:l().optional(),collection:l(),fields:S(Ry).readonly(),filter:Iy.optional()}),zy,{auth:`admin`}),histogram:D(d({namespace:l().optional(),collection:l(),field:l(),bucketSize:i().int().positive(),origin:i().int(),filter:Iy.optional()}),S(d({bucket:i().int(),count:i().int()})).readonly(),{auth:`admin`}),isEmpty:D(d({namespace:l().optional(),collection:l()}),C(),{auth:`admin`}),declareCollection:D(d({namespace:l().optional(),collection:l(),columns:S(Hy).readonly(),indexes:S(Uy).readonly().optional()}),v(),{kind:`mutation`,auth:`admin`})}},Gy=d({engineId:l(),kind:x([`relational`,`vector`]),displayName:l()}),Ky={name:`data-store-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getEngineInfo:D(v(),Gy,{auth:`admin`}),get:D(d({namespace:l().optional(),collection:l(),key:l()}),o(),{auth:`admin`}),set:D(d({namespace:l().optional(),collection:l(),key:l(),value:o()}),v(),{kind:`mutation`,auth:`admin`}),query:D(d({namespace:l().optional(),collection:l(),filter:Iy.optional(),columns:S(l()).readonly().optional()}),S(By).readonly(),{auth:`admin`}),insert:D(d({namespace:l().optional(),collection:l(),record:d({id:l().optional(),data:y(l(),o())})}),d({id:f([l(),i()])}),{kind:`mutation`,auth:`admin`}),upsert:D(d({namespace:l().optional(),collection:l(),conflict:S(l()).readonly(),record:Vy}),d({id:f([l(),i()])}),{kind:`mutation`,auth:`admin`}),insertMany:D(d({namespace:l().optional(),collection:l(),records:S(Vy).readonly()}),d({inserted:i().int()}),{kind:`mutation`,auth:`admin`}),update:D(d({namespace:l().optional(),collection:l(),id:l(),data:y(l(),o())}),v(),{kind:`mutation`,auth:`admin`}),delete:D(d({namespace:l().optional(),collection:l(),key:l()}),v(),{kind:`mutation`,auth:`admin`}),deleteWhere:D(d({namespace:l().optional(),collection:l(),filter:Ly}),d({deleted:i().int()}),{kind:`mutation`,auth:`admin`}),updateWhere:D(d({namespace:l().optional(),collection:l(),filter:Ly,data:y(l(),o())}),d({updated:i().int()}),{kind:`mutation`,auth:`admin`}),count:D(d({namespace:l().optional(),collection:l(),filter:Iy.optional()}),i(),{auth:`admin`}),aggregate:D(d({namespace:l().optional(),collection:l(),fields:S(Ry).readonly(),filter:Iy.optional()}),zy,{auth:`admin`}),histogram:D(d({namespace:l().optional(),collection:l(),field:l(),bucketSize:i().int().positive(),origin:i().int(),filter:Iy.optional()}),S(d({bucket:i().int(),count:i().int()})).readonly(),{auth:`admin`}),isEmpty:D(d({namespace:l().optional(),collection:l()}),C(),{auth:`admin`}),declareCollection:D(d({namespace:l().optional(),collection:l(),columns:S(Hy).readonly(),indexes:S(Uy).readonly().optional()}),v(),{kind:`mutation`,auth:`admin`})}},qy=x([`key-missing`,`wrong-key`,`key-file-unreadable`,`store-unavailable`,`not-initialized`,`decrypt-failed`]),Jy=p(`state`,[d({state:m(`ready`)}),d({state:m(`locked`),reason:qy})]),Yy=p(`kind`,[d({kind:m(`value`),value:l(),version:i().int()}),d({kind:m(`missing`)}),d({kind:m(`unavailable`),reason:qy}),d({kind:m(`forbidden`)})]),Xy=y(l(),Yy),Zy=d({ref:l(),owner:l(),scope:l(),fieldPath:l(),version:i().int(),createdAt:i(),updatedAt:i(),updatedBy:l(),lastReadAt:i().nullable()}),Qy=512,$y=S(l().min(1)).max(512),eb={name:`keychain`,scope:`system`,mode:`singleton`,internal:!0,methods:{put:D(d({ref:l().min(1),value:l().min(1)}),d({ref:l(),version:i().int()}),{kind:`mutation`,auth:`admin`}),resolve:D(d({refs:$y}),Xy,{auth:`admin`}),delete:D(d({refs:$y}),d({deleted:i().int()}),{kind:`mutation`,auth:`admin`}),listMeta:D(d({}),S(Zy).readonly(),{auth:`admin`}),getState:D(d({}),Jy,{auth:`admin`})}},tb=x([`config-file`,`previous-config-file`,`platform`,`default-file`]),nb=d({kind:tb,path:l().optional(),sharesBackupWithDatabase:C()}),rb=`trigger-file`,ib=d({id:l(),at:i(),actor:l(),lockedReason:l().nullable(),archived:i().int(),archivedCollection:l().nullable(),archivedKeysCollection:l().nullable(),clearedSettingsKeys:S(l()).readonly(),acknowledgedAt:i().nullable()}),ab=d({keychain:Jy,keySource:nb.nullable(),configuredSource:nb,fingerprint:l().nullable(),activeKeyId:l().nullable(),rotationPending:C(),retiredWraps:i().int(),recoveryKeyDownloadedAt:i().nullable(),secretCount:i().int(),lastReset:ib.nullable()}),ob=x([`in-use`,`orphan`,`unknown`]),sb=Zy.extend({usage:ob}),cb=x([`put`,`delete`,`reveal`,`rotate-master-key`,`purge-retired-keys`,`download-recovery-key`,`delete-orphans`,`reset`,`acknowledge-reset`,`initialize`]),lb=d({id:l(),at:i(),action:cb,actor:l(),ref:l().nullable(),detail:l().nullable()}),ub=`RESET KEYCHAIN`,db=x([`jwt-signing-key`]),fb={name:`keychain-admin`,scope:`system`,mode:`singleton`,methods:{status:D(d({}),ab,{auth:`admin`}),listSecrets:D(d({}),S(sb).readonly(),{auth:`admin`}),listAudit:D(d({limit:i().int().min(1).max(500).optional()}),S(lb).readonly(),{auth:`admin`}),reveal:D(d({ref:l().min(1)}),d({value:l(),version:i().int()}),{kind:`mutation`,auth:`admin`,caller:`required`}),setSystemSecret:D(d({name:db,value:l().min(16)}),d({ref:l(),version:i().int()}),{kind:`mutation`,auth:`admin`,caller:`required`}),deleteOrphans:D(d({refs:S(l().min(1)).max(1e3)}),d({deleted:S(l()).readonly(),kept:S(d({ref:l(),usage:ob})).readonly()}),{kind:`mutation`,auth:`admin`,caller:`required`}),rotateMasterKey:D(d({}),d({fingerprint:l(),keySource:nb}),{kind:`mutation`,auth:`admin`,caller:`required`}),purgeRetiredKeys:D(d({}),d({purged:i().int()}),{kind:`mutation`,auth:`admin`,caller:`required`}),downloadRecoveryKey:D(d({}),d({key:l(),fingerprint:l(),keySource:nb}),{kind:`mutation`,auth:`admin`,caller:`required`}),resetKeychain:D(d({confirm:m(ub)}),d({archivedCollection:l().nullable(),archived:i().int()}),{kind:`mutation`,auth:`admin`,caller:`required`}),resetReport:D(d({}),d({reset:ib.nullable(),pendingReentry:S(Zy).readonly()}),{auth:`admin`}),acknowledgeReset:D(d({}),d({acknowledged:C()}),{kind:`mutation`,auth:`admin`,caller:`required`})}},pb=[{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)`}],mb={hwaccel:`auto`,probedBestHwaccel:``},hb={name:`decoder`,scope:`system`,mode:`singleton`,preferredProvider:`decoder-nodeav`,methods:{getInfo:D(v(),d({id:l(),name:l(),hwaccel:l().optional(),probedBestHwaccel:l().optional()})),reprobeHwaccel:D(v(),d({backend:l()}),{kind:`mutation`,auth:`admin`})}},gb={name:`detection-pipeline`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{}},_b=x([`device`,`integration`]),vb=d({url:l(),label:l(),target:_b,host:l()}),yb={name:`device-admin-link`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{getAdminLink:D(d({deviceId:i().int().nonnegative()}),vb.nullable(),{auth:`admin`})}},bb=[`password`,`passwd`,`pwd`,`pass`,`user`,`username`,`usr`,`login`,`token`,`access_token`,`auth`,`authorization`,`apikey`,`api_key`,`secret`,`credential`,`credentials`,`session`,`sessionid`,`key`],xb=/[a-z][a-z0-9+.-]*:\/\/[^/\s:@'"]+:[^/\s:@'"]+@/i,Sb=/^[a-zA-Z0-9._-]+$/,Cb=/^\[[0-9a-fA-F:.]+\]$/;function wb(e){return e===`https`?443:80}function Tb(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(!Sb.test(t)&&!Cb.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(bb.includes(e.toLowerCase()))return{ok:!1,reason:`credential-query-key`};let r=e.port===null||e.port===wb(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 xb.test(o)?{ok:!1,reason:`userinfo-in-result`}:{ok:!0,url:o}}function Eb(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 Db=d({id:l(),system:l(),uniqueId:l().optional(),raw:y(l(),o()).optional()});function Ob(e){return{id:e.stableId,system:e.addonId}}function kb(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 Ab(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 jb=`sourceInfo`;function Mb(e){if(!e)return null;let t=e[jb];if(!t)return null;let n=Db.safeParse(t);return n.success?n.data:null}var Nb=x([`online`,`sleeping`,`offline`,`unknown`]),Pb=pe(()=>d({childNativeId:l(),name:l(),type:x(k),status:Nb,metadata:d({model:l().optional(),serialNumber:l().optional(),uid:l().optional(),rtspChannel:i().int().nonnegative().optional(),isBattery:C().optional(),isDoorbell:C().optional(),isMultifocal:C().optional(),externalLocation:l().optional(),manufacturer:l().optional(),integration:l().optional()}).default({}),alreadyAdopted:C(),adoptedDeviceId:i().int().nonnegative().nullable(),capabilities:S(l()).readonly().optional(),features:S(l()).readonly().optional(),sourceInfo:Db.optional(),children:S(Pb).readonly().optional()})),Fb=d({discovered:S(Pb),lastDiscoveryAt:i().int().nonnegative().nullable(),lastError:l().nullable()}),Ib={name:`device-discovery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Hub],status:{schema:Fb,kind:`poll`},runtimeState:Fb.extend({lastFetchedAt:i().int().nonnegative()}),durability:`session`,methods:{listDiscovered:D(d({deviceId:i().int().nonnegative()}),S(Pb).readonly()),refreshDiscovery:D(d({deviceId:i().int().nonnegative()}),S(Pb).readonly(),{kind:`mutation`,auth:`admin`}),adoptDevice:D(d({deviceId:i().int().nonnegative(),childNativeId:l(),name:l().optional()}),d({deviceId:i().int().nonnegative(),stableId:l()}),{kind:`mutation`,auth:`admin`}),releaseDevice:D(d({deviceId:i().int().nonnegative(),childDeviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`admin`})}},Lb=d({id:l(),label:l(),isDefault:C().optional()}),Rb=d({search:l().optional(),area:l().optional(),manufacturer:l().optional(),adoptedOnly:C().optional(),unadoptedOnly:C().optional()}),zb=d({integrationId:l(),page:i().int().positive().default(1),pageSize:i().int().positive().max(2e4).default(50),filter:l().optional(),filterText:Rb.optional()}),Bb=d({candidates:S(Pb).readonly(),totalCount:i().int().nonnegative(),page:i().int().positive(),pageSize:i().int().positive()}),Vb=d({integrationId:l(),childNativeId:l()}),Hb=d({lastDiscoveryAt:i().int().nonnegative().nullable(),candidateCount:i().int().nonnegative(),adoptedCount:i().int().nonnegative(),lastError:l().nullable()}),Ub=d({name:l().min(1).optional(),hiddenChildIds:S(l()).optional()}),Wb=d({integrationId:l(),childNativeIds:S(l()).min(1),filter:l().optional(),importLocations:C().optional(),perCandidate:y(l(),Ub).optional()}),Gb=d({adopted:S(d({childNativeId:l(),parentDeviceId:i().int().nonnegative(),accessoryDeviceIds:S(i().int().nonnegative()).readonly()})).readonly()}),Kb=d({integrationId:l(),camDeviceId:i().int().nonnegative()}),qb=d({camDeviceId:i().int().nonnegative(),resetToSource:C().optional()}),Jb=d({changed:C(),rebuiltChildren:i().int().nonnegative(),removedChildren:i().int().nonnegative().optional()}),Yb={name:`device-adoption`,scope:`system`,mode:`singleton`,status:{schema:Hb,kind:`poll`},methods:{listCandidateFilters:D(d({integrationId:l()}),d({filters:S(Lb)}),{auth:`admin`}),listCandidates:D(zb,Bb,{auth:`admin`}),getCandidate:D(Vb,Pb.nullable(),{auth:`admin`}),refresh:D(d({integrationId:l()}),Hb,{kind:`mutation`,auth:`admin`}),adopt:D(Wb,Gb,{kind:`mutation`,auth:`admin`}),release:D(Kb,v(),{kind:`mutation`,auth:`admin`}),resync:D(qb,Jb,{kind:`mutation`,auth:`admin`})}},Xb=x([`unlinked`,`linked`,`error`]),Zb=d({label:l(),value:l(),secret:C().optional()}),Qb=d({qr:l().optional(),fields:S(Zb).readonly().optional(),note:l().optional()}),$b=d({linkState:Xb,exposedDeviceCount:i(),error:l().optional(),setup:Qb.optional()}),ex=l(),tx=d({deviceId:l(),exposedAs:l().optional(),capabilities:S(l()).optional()}),nx=d({deviceId:l(),capabilities:S(l()).optional()}),rx=d({deviceId:l()}),ix={name:`device-export`,scope:`system`,mode:`collection`,providerKind:`device-export`,status:{schema:$b,kind:`poll`},exposesDeviceSettings:!0,methods:{getStatus:D(v(),$b),listSupportedDeviceKinds:D(v(),S(ex)),listExposedDevices:D(v(),S(tx)),exposeDevice:D(nx,v(),{kind:`mutation`,auth:`admin`}),unexposeDevice:D(rx,v(),{kind:`mutation`,auth:`admin`})}},ax=[`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`],ox=`map-pin`,sx=x(ax),cx=d({locationKey:l(),icon:sx});function lx(e){return e.trim().toLowerCase()}function ux(e){let t=sx.safeParse(e);return t.success?t.data:ox}var dx=400,fx=d({locationKey:l(),description:l()}),px=d({zoneKey:l(),label:l(),icon:sx.nullable(),locationKeys:S(l())});function mx(e){return e.trim().toLowerCase()}var hx=d({connected:C(),deviceCount:i(),error:l().optional(),motionSliceWriter:m(`orchestrator`).optional()}),gx=d({externalId:l(),name:l(),type:l(),metadata:y(l(),o()).optional()}),_x=d({stableId:l(),type:x(k),suggestedName:l(),prefilledConfig:y(l(),o()),sourceInfo:Db.optional(),alreadyOnboarded:C().optional(),onboardedDeviceId:i().optional(),onboardedName:l().optional()}),vx=d({id:i(),stableId:l(),addonId:l(),type:l(),name:l(),parentDeviceId:i().nullable(),online:C(),features:S(l()),config:y(l(),o()),sourceInfo:Db.optional()}),yx=d({status:x([`ok`,`error`]),labels:S(l()).optional(),error:l().optional()}),bx=o(),xx={name:`device-provider`,scope:`system`,mode:`collection`,methods:{start:D(v(),v(),{kind:`mutation`}),stop:D(v(),v(),{kind:`mutation`}),getStatus:D(v(),hx),getDevices:D(v(),S(d({id:l(),name:l(),type:l()}))),reloadDevice:D(d({stableId:l()}),d({deviceId:i()}),{kind:`mutation`,timeoutMs:3*6e4}),supportsDiscovery:D(d({}),C()),discoverDevices:D(d({params:y(l(),o()).optional()}),S(_x),{kind:`mutation`,auth:`admin`}),getDiscoveryParamsSchema:D(d({}),bx),getManualCreationType:D(d({}),d({deviceType:x(k).nullable()})),adoptDiscoveredDevice:D(d({candidate:_x}),vx,{kind:`mutation`,auth:`admin`}),supportsManualCreation:D(d({}),C()),getChildCreationSchema:D(d({type:x(k)}),bx),createDevice:D(d({type:x(k),config:y(l(),o())}),vx,{kind:`mutation`,auth:`admin`}),testCreationField:D(d({type:x(k),key:l(),value:o(),formValues:y(l(),o()).optional()}),yx,{kind:`mutation`,auth:`admin`})}},Sx=d({childKey:l(),section:l(),order:i().optional(),collapsed:C().optional()}),Cx=d({unit:l().min(1).optional(),precision:i().int().min(0).max(10).optional()}),wx=d({icon:l().min(1).optional(),label:l().min(1).optional(),unit:l().min(1).optional(),precision:i().int().min(0).max(10).optional(),hidden:C().optional(),perCap:y(l(),Cx).optional()}),Tx=d({unit:l().min(1).optional(),precision:i().int().min(0).max(10).optional(),icon:l().min(1).optional()}),Ex=d({id:i(),stableId:l(),addonId:l(),type:x(k),name:l(),location:l().nullable(),disabled:C(),parentDeviceId:i().nullable(),role:l().nullable().optional(),online:C(),probed:C().optional(),features:S(l()),isCamera:C(),config:y(l(),o()),secretConfigPaths:S(l()).optional(),metadata:y(l(),o()).nullable().optional(),sourceInfo:Db.optional(),integrationId:l().optional(),linkDeviceId:i().nullable().optional(),primaryChildEntityId:l().nullable().optional(),childLayout:S(Sx).readonly().optional(),display:wx.optional()}),Dx=d({key:l(),value:o(),description:l().optional()}),Ox=x([`manual`]),kx=d({deviceId:i(),name:l(),location:l().nullable(),features:S(l()),producesTrackedEvents:C().optional()}),Ax=d({deviceIds:S(i().int().positive()),trackedDeviceIds:S(i().int().positive()).optional()}),jx={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:[k.Camera],sourceCaps:`any`,cardinality:`many`,value:Ax},Mx=d({deviceId:i(),mode:Ox,devices:S(kx)}),Nx=d({deviceId:i(),entries:S(d({capName:l(),kind:x([`native`,`wrapped`]),providerAddonId:l(),providerNodeId:l(),nativeAddonId:l()}))}),Px=p(`kind`,[d({kind:m(`value`),wrapperAddonId:l().nullable()}),d({kind:m(`missing`)}),d({kind:m(`failed`),error:l()})]),Fx=d({id:i(),stableId:l(),type:l(),name:l(),location:l().nullable(),disabled:C(),parentDeviceId:i().nullable(),role:l().nullable().optional()}),Ix=d({id:i(),stableId:l(),addonId:l(),type:l(),name:l(),userNamed:C().optional(),location:l().nullable(),disabled:C(),parentDeviceId:i().nullable(),metadata:y(l(),o()).nullable().optional(),sourceInfo:Db.optional(),integrationId:l().optional(),linkDeviceId:i().nullable().optional(),primaryChildEntityId:l().nullable().optional(),childLayout:S(Sx).readonly().optional(),role:l().nullable().optional(),display:wx.optional()}),Lx=o().nullable(),Rx=d({streamId:l(),width:i().optional(),height:i().optional(),codec:l().optional(),fps:i().optional(),bitrateKbps:i().optional()}),zx=d({addonId:l(),stableId:l(),id:i(),type:l(),name:l(),location:l().nullable().optional(),disabled:C().optional(),parentDeviceId:i().nullable(),role:l().nullable().optional(),features:S(l()).optional(),config:y(l(),o()),secretConfigPaths:S(l()).optional()}),Bx=d({deviceId:i()}),Vx=d({deviceId:i(),data:y(l(),o()),secretConfigPaths:S(l()).optional()}),Hx=x([`off`,`on`,`not-offered`,`unreachable`]),Ux=d({deviceId:i(),switchId:kc,outcome:Hx,detail:l().optional()}),Wx=d({sourceId:i(),targetId:i(),switches:S(Ux).readonly(),sourceStillLive:S(kc).readonly(),swapped:C()}),Gx={name:`device-manager`,scope:`system`,mode:`singleton`,extensionSlots:[jx],methods:{allocateDeviceId:D(d({addonId:l(),stableId:l()}),d({id:i()}),{kind:`mutation`}),migrateDevice:D(d({sourceId:i(),targetId:i()}),Wx,{kind:`mutation`,auth:`admin`,timeoutMs:12*6e4}),registerDevice:D(zx,v(),{kind:`mutation`}),removeDevice:D(Bx,v(),{kind:`mutation`}),persistConfig:D(Vx,v(),{kind:`mutation`,auth:`admin`}),loadConfig:D(d({deviceId:i()}),y(l(),o()),{auth:`admin`}),loadRuntimeState:D(d({deviceId:i()}),y(l(),o()),{auth:`admin`}),loadMeta:D(d({deviceId:i()}),Ix.nullable()),setName:D(d({deviceId:i(),name:l()}),v(),{kind:`mutation`,auth:`admin`}),setLocation:D(d({deviceId:i(),location:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),setType:D(d({deviceId:i(),type:x(k)}),v(),{kind:`mutation`,auth:`admin`}),setIntegrationId:D(d({deviceId:i(),integrationId:l()}),v(),{kind:`mutation`,auth:`admin`}),setLinkDeviceId:D(d({deviceId:i(),linkDeviceId:i().nullable()}),v(),{kind:`mutation`,auth:`admin`}),setPrimaryChildEntityId:D(d({deviceId:i(),primaryChildEntityId:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),setChildLayout:D(d({deviceId:i(),childLayout:S(Sx).readonly()}),v(),{kind:`mutation`,auth:`admin`}),setDisplay:D(d({deviceId:i(),display:wx.nullable()}),v(),{kind:`mutation`,auth:`admin`}),getRoleDisplayDefaults:D(d({}),d({defaults:y(l(),Tx)}),{kind:`query`}),setRoleDisplayDefaults:D(d({defaults:y(l(),Tx)}),v(),{kind:`mutation`,auth:`admin`}),getWireableFields:D(d({deviceId:i(),includeSynthesizable:C().optional()}),d({caps:S(d({cap:l(),fields:S(d({path:l(),kind:x([`string`,`number`,`boolean`,`enum`]),enumValues:S(l()).optional(),item:C().optional()})).readonly(),itemArray:d({path:l(),keyField:l()}).optional()})).readonly()}),{kind:`query`}),setRole:D(d({deviceId:i(),role:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),applyInitialMeta:D(d({deviceId:i(),name:l().optional(),location:l().nullable().optional(),type:x(k).optional(),integrationId:l().optional(),linkDeviceId:i().nullable().optional(),role:l().nullable().optional()}),v(),{kind:`mutation`,auth:`admin`}),setMetadata:D(d({deviceId:i(),patch:y(l(),o())}),v(),{kind:`mutation`,auth:`admin`}),listLocations:D(v(),S(l())),addLocation:D(d({name:l()}),v(),{kind:`mutation`,auth:`admin`}),removeLocation:D(d({name:l(),cascade:C().optional()}),v(),{kind:`mutation`,auth:`admin`}),renameLocation:D(d({from:l(),to:l()}),d({moved:i()}),{kind:`mutation`,auth:`admin`}),listLocationIcons:D(v(),S(cx)),setLocationIcon:D(d({location:l(),icon:sx.nullable()}),v(),{kind:`mutation`,auth:`admin`}),listLocationDescriptions:D(v(),S(fx)),setLocationDescription:D(d({location:l(),description:l().max(400).nullable()}),v(),{kind:`mutation`,auth:`admin`}),listSiteZones:D(v(),S(px)),setSiteZone:D(d({name:l(),icon:sx.nullable().optional()}),v(),{kind:`mutation`,auth:`admin`}),removeSiteZone:D(d({name:l()}),v(),{kind:`mutation`,auth:`admin`}),renameSiteZone:D(d({from:l(),to:l()}),v(),{kind:`mutation`,auth:`admin`}),setLocationZone:D(d({location:l(),zone:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),setDisabled:D(d({deviceId:i(),disabled:C()}),v(),{kind:`mutation`,auth:`admin`}),listPersistedByAddon:D(d({addonId:l()}),S(Fx)),listAll:D(d({addonId:l().optional(),projection:x([`full`,`slim`]).optional(),isCamera:C().optional(),deviceIds:S(i()).optional()}),S(Ex)),getDevice:D(d({deviceId:i()}),Ex.nullable()),getChildren:D(d({parentDeviceId:i()}),S(Ex)),getChildrenBatch:D(d({parentDeviceIds:S(i()).max(256)}),y(l(),S(Ex))),getLinkedDevices:D(d({deviceId:i()}),d({mode:Ox,devices:S(kx)})),getLinkedDevicesBatch:D(d({deviceIds:S(i())}),S(Mx)),getStreamSources:D(d({deviceId:i()}),S(tr)),getConfigSchema:D(d({deviceId:i()}),S(Dx)),getSettingsSchema:D(d({deviceId:i()}),Lx),updateConfig:D(d({deviceId:i(),values:y(l(),o())}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),enable:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),disable:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),remove:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),removeByIntegration:D(d({integrationId:l()}),d({removed:i()}),{kind:`mutation`,auth:`admin`}),getStreamProfileMap:D(d({deviceId:i()}),y(l(),l().nullable())),setStreamProfileMap:D(d({deviceId:i(),profileMap:y(l(),l().nullable())}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),probeStreams:D(d({deviceId:i()}),S(Rx),{kind:`mutation`,auth:`admin`}),getBindings:D(d({deviceId:i()}),Nx),getBindingsBatch:D(d({deviceIds:S(i())}),S(Nx)),getAllBindings:D(d({}),S(Nx)),listDeviceIdsByCaps:D(d({capNames:S(l().min(1)).min(1).max(16)}),S(i())),setWrapperActive:D(d({deviceId:i(),capName:l(),wrapperAddonId:l(),active:C()}),v(),{kind:`mutation`,auth:`admin`}),getWrapperActivation:D(d({deviceId:i(),capName:l().min(1)}),Px),listWrappersForCap:D(d({capName:l()}),S(l())),listBindableCapsForDeviceType:D(d({deviceType:l()}),S(d({capName:l(),wrappers:S(l())}))),getDeviceSettingsAggregate:D(d({deviceId:i()}),Hm.nullable()),getDeviceLiveInfoAggregate:D(d({deviceId:i()}),Hm.nullable()),getDeviceAggregate:D(d({deviceId:i()}),d({settings:Hm.nullable(),live:Hm.nullable()})),runDeviceAction:D(d({deviceId:i().int().nonnegative(),action:l().min(1),input:o()}),o(),{kind:`mutation`}),updateDeviceField:D(d({deviceId:i(),writerCapName:l(),writerAddonId:l(),key:l(),value:o()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),updateDeviceFieldsBatch:D(d({deviceId:i(),changes:S(d({writerCapName:l(),writerAddonId:l(),key:l(),value:o()}))}),d({success:m(!0),failures:S(d({writerCapName:l(),writerAddonId:l(),error:l()}))}),{kind:`mutation`,auth:`admin`}),discoverDevices:D(d({addonId:l()}),S(_x),{kind:`mutation`,auth:`admin`}),adoptDevice:D(d({addonId:l(),candidate:_x,integrationId:l().optional()}),vx,{kind:`mutation`,auth:`admin`}),getCreationSchema:D(d({addonId:l(),type:x(k)}),o().nullable()),createDevice:D(d({addonId:l(),type:x(k),config:y(l(),o()),integrationId:l().optional()}),vx,{kind:`mutation`,auth:`admin`}),testCreationField:D(d({addonId:l(),type:x(k),key:l(),value:o(),formValues:y(l(),o()).optional()}),yx,{kind:`mutation`,auth:`admin`}),adoptionListCandidateFilters:D(d({addonId:l(),integrationId:l()}),d({filters:S(Lb)}),{auth:`admin`}),adoptionListCandidates:D(zb.extend({addonId:l()}),Bb,{auth:`admin`}),adoptionRefresh:D(d({addonId:l(),integrationId:l()}),Hb,{kind:`mutation`,auth:`admin`}),adoptionAdopt:D(Wb.extend({addonId:l()}),Gb,{kind:`mutation`,auth:`admin`}),adoptionRelease:D(Kb.extend({addonId:l()}),v(),{kind:`mutation`,auth:`admin`}),adoptionStartJob:D(Wb.extend({addonId:l()}),d({jobId:l()}),{kind:`mutation`,auth:`admin`}),adoptionListJobs:D(d({addonId:l(),integrationId:l().optional()}),S(Dc).readonly(),{auth:`admin`}),adoptionCancelJob:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),adoptionResync:D(qb,Jb,{kind:`mutation`,auth:`admin`}),discoveryProviders:D(d({}),d({providers:S(d({addonId:l(),label:l()})).readonly()}),{auth:`admin`}),discoverAllProviders:D(d({}),d({groups:S(d({addonId:l(),label:l(),candidates:S(_x).readonly(),error:l().nullable()})).readonly()}),{kind:`mutation`,auth:`admin`}),discoverProvider:D(d({addonId:l(),params:y(l(),o()).optional()}),d({candidates:S(_x).readonly()}),{kind:`mutation`,auth:`admin`}),providerCreationType:D(d({addonId:l()}),d({deviceType:x(k).nullable()}),{auth:`admin`}),providerDiscoveryParamsSchema:D(d({addonId:l()}),o(),{auth:`admin`}),testField:D(d({deviceId:i(),key:l(),value:o()}),yx,{kind:`mutation`,auth:`admin`}),getDeviceStatusAggregate:D(d({deviceId:i(),caps:S(l()).readonly().optional()}),y(l(),o().nullable())),getDeviceStatusAggregateBatch:D(d({deviceIds:S(i()).readonly(),caps:S(l()).readonly().optional()}),y(l(),y(l(),o().nullable())))}},Kx=[`linked-devices`],qx=x(Kx),Jx={"linked-devices":{descriptor:jx,declaringCap:`device-manager`,hostDeviceTypes:[k.Camera]}},Yx=p(`slot`,[Ax.extend({slot:m(`linked-devices`)})]),Xx=[k.Camera],Zx=`:`,Qx=`listSlots`,$x=p(`state`,[d({state:m(`ok`)}),d({state:m(`unreachable`),reason:l()})]),eS=d({source:l(),label:l(),addonId:l().optional(),availability:$x}),tS=x([`ok`,`missing`,`foreign`,`unavailable`]),nS=d({deviceId:i().int(),name:l().nullable(),health:tS,detail:l().optional()}),rS=d({state:x([`active`,`inactive`,`unknown`]),authority:l(),detail:l().optional()}),iS=d({state:m(`ok`),slotRef:l(),slot:qx,authority:l(),activation:rS.nullable(),value:Yx,sources:S(nS),impliedSources:S(nS).optional()}),aS=d({state:m(`unreachable`),addonId:l(),reason:l()}),oS=p(`state`,[iS,aS]);function sS(e,t){return{state:`unreachable`,addonId:e,reason:t}}var cS=d({deviceId:i().int(),name:l(),type:l(),location:l().nullable(),parentName:l().nullable(),suggested:C(),reason:l().nullable()}),lS=d({candidates:S(cS)}),uS=d({applied:m(!0),reload:x([`none`,`host`,`parent`])}),dS=d({deviceId:i().int(),slotRef:l().min(1)}),fS=dS.extend({value:Yx}),pS={name:`device-extension`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:Xx,deviceConfig:{ui:{kind:`widget`,widgetId:`host/extensions-panel`,tab:`general`,label:`Extensions`,order:72}},methods:{listSources:D(d({deviceId:i().int()}),S(eS)),listSlots:D(d({deviceId:i().int()}),S(oS)),listCandidates:D(dS,lS),setSlot:D(fS,uS,{kind:`mutation`,auth:`admin`})}},mS=x([`replace`,`add`]),hS=p(`ok`,[d({ok:m(!0),changed:C()}),d({ok:m(!1),code:x([`owned-by-other`,`not-claimed`,`field-not-claimed`,`invalid-slice`,`unknown-device`,`row-unreadable`,`migration-in-flight`]),message:l()})]),gS=d({deviceId:i(),capName:l(),owner:l().min(1),mode:mS,fields:S(l().min(1)).min(1)}),_S=p(`state`,[d({state:m(`loaded`),claims:S(gS)}),d({state:m(`not-loaded`),reason:l()})]),vS={name:`device-state`,scope:`system`,mode:`singleton`,methods:{getSnapshot:D(d({deviceId:i()}),y(l(),y(l(),o()))),getCapSlice:D(d({deviceId:i(),capName:l()}),y(l(),o()).nullable()),getAllSnapshots:D(d({}),y(l(),y(l(),y(l(),o())))),setCapSlice:D(d({deviceId:i(),capName:l(),slice:y(l(),o())}),v(),{kind:`mutation`}),claimFields:D(d({deviceId:i(),capName:l(),owner:l().min(1),mode:mS,fields:S(l().min(1)).min(1),values:y(l(),o())}),hS,{kind:`mutation`,auth:`admin`}),patchOwnedFields:D(d({deviceId:i(),capName:l(),owner:l().min(1),values:y(l(),o())}),hS,{kind:`mutation`,auth:`admin`}),releaseClaim:D(d({deviceId:i(),capName:l(),owner:l().min(1)}),hS,{kind:`mutation`,auth:`admin`}),listClaims:D(d({ownerPrefix:l().optional()}),_S,{auth:`admin`}),getNativeCapSlice:D(d({deviceId:i(),capName:l()}),y(l(),o()).nullable(),{auth:`admin`})},events:{onChanged:Pr(d({deviceId:i(),capName:l(),slice:y(l(),o())}))}},yS=d({embedding:S(i()),inferenceMs:i()}),bS=x([`image`,`text`]),xS=d({modelId:l(),tower:bS,nodeId:l(),crashes:i(),windowMs:i(),sinceMs:i(),lastReason:l()}),SS=d({modelId:l(),tower:bS,nodeId:l(),attempts:i(),sinceMs:i(),lastReason:l()}),CS=d({modelId:l(),embeddingDim:i(),ready:C(),nodeId:l().optional(),failedModels:S(xS).optional(),failedRequirements:S(SS).optional()}),wS=`embedding-model-failed`,TS=`embedding-requirements-unavailable`,ES=`embedding-requirements-failed`,DS=x([wS,TS,ES]);function OS(e,t){return`[${e} model=${t.modelId} tower=${t.tower} node=${t.nodeId}]`}function kS(e){return Error(`${OS(wS,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 AS(e,t){return Error(`${OS(TS,e)} ${e.modelId} (${e.tower} tower) on ${e.nodeId}: ${t}`)}function jS(e){return Error(`${OS(ES,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 MS=RegExp(`\\[(${wS}|${TS}|${ES}) model=([^\\s\\]]+) tower=(image|text) node=([^\\s\\]]+)\\]`);function NS(e){let t=e instanceof Error?e.message:String(e),n=MS.exec(t);if(n===null)return null;let r=DS.safeParse(n[1]),i=bS.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 PS(e){return FS(e)!==null}function FS(e){let t=NS(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 IS={name:`embedding-encoder`,scope:`system`,mode:`collection`,internal:!0,methods:{encode:D(d({crop:b(Uint8Array),width:i(),height:i()}),yS,{auth:`admin`}),encodeText:D(d({text:l(),modelId:l().min(1).optional()}),yS,{auth:`admin`}),getInfo:D(v(),CS,{auth:`admin`}),resetFailedModels:D(d({modelId:l().min(1).optional()}),d({cleared:S(l()),nodeId:l()}),{kind:`mutation`,auth:`admin`})}},LS=d({reason:l(),count:i().int().nonnegative()}),RS=d({family:l(),deviceId:i().int().positive(),variant:l().optional(),sinceMs:i(),atMs:i(),attempts:i().int().nonnegative(),succeeded:i().int().nonnegative(),reasons:S(LS).readonly()}),zS={name:`failure-contribution`,scope:`system`,mode:`collection`,internal:!0,methods:{list:D(v(),S(RS).readonly())},mount:{kind:`skip`}},BS=d({name:l(),path:l()}),VS=d({path:l(),entries:S(BS).readonly(),freeBytes:i(),totalBytes:i()}),HS={name:`filesystem-browse`,scope:`system`,mode:`singleton`,internal:!0,methods:{listAllowedRoots:D(v(),S(l()).readonly(),{auth:`admin`}),browse:D(d({path:l()}),VS,{auth:`admin`}),createDir:D(d({path:l()}),d({path:l()}),{kind:`mutation`,auth:`admin`})}},US=`https://camstack.zentik.app`,WS=`/viewer/camstack`;function GS(e){if(e==null||e===``)return!1;try{return new URL(e).origin===US}catch{return!1}}function KS(e){let t=e.baseUrl??e.resolved;return GS(t)?{form:`app`,hubBaseUrl:e.appLinkHub??null}:{form:`hub`,hubBaseUrl:t}}function qS(e){let t;try{t=new URL(e)}catch{return null}return t.protocol!==`https:`&&t.protocol!==`http:`||t.username!==``||t.password!==``||t.hostname===``?null:t.origin}function JS(e){let t=e=>e.kind!==`public`||!e.baseUrl.startsWith(`https://`)?null:e.interfaceKind===`public`?0:e.interfaceKind===`vpn`?1:null;return e.flatMap(e=>{let n=t(e),r=qS(e.baseUrl);return n===null||r===null?[]:[{r:n,p:e.priority,origin:r}]}).toSorted((e,t)=>e.r-t.r||e.p-t.p)[0]?.origin??null}function YS(e){switch(e.kind){case`camera`:{if(!Number.isInteger(e.deviceId)||e.deviceId<=0)return null;let t=e.atMs;return{path:`/camera/${String(e.deviceId)}`,query:t!==void 0&&Number.isFinite(t)?[[`at`,String(Math.trunc(t))]]:[]}}case`events`:return{path:`/events`,query:[]};case`notifications`:return{path:`/notifications`,query:[]}}}function XS(e){return e.length===0?``:`?${e.map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join(`&`)}`}function ZS(e){let t=YS(e.destination);if(t===null)return null;let n=e.base.hubBaseUrl,r=n===null?``:n.replace(/\/+$/,``);if(e.base.form===`app`){let e=r===``?null:qS(r),n=e===null?t.query:[...t.query,[`hub`,e]];return`${US}${t.path}${XS(n)}`}return r===``||GS(r)?null:`${r}${WS}${t.path}${XS(t.query)}`}var QS=[`appConnections`,`notificationTaps`,`internal`,`publicEndpoint`],$S=[`notificationTaps`,`internal`,`publicEndpoint`];function eC(e){return e!==`appConnections`}var tC={appConnections:[],notificationTaps:null,internal:null,publicEndpoint:null},nC=/^\d{1,3}(?:\.\d{1,3}){3}$/;function rC(e){try{let t=new URL(e).hostname;return t.length>0?t:null}catch{return null}}function iC(e){return e.replace(/\/+$/,``)}function aC(e){return e.kind===`public`&&e.interfaceKind===`vpn`}function oC(e){return e.kind===`public`&&e.interfaceKind===`public`}function sC(e){return(e.kind===`lan-ipv4`||e.kind===`lan-ipv6`)&&e.plausible}function cC(e){if(e.kind!==`lan-ipv4`||!e.plausible)return!1;let t=rC(e.baseUrl);return t!==null&&nC.test(t)}function lC(e,t){return t.kind===`loopback`||t.kind===`app-link`||t.kind===`custom`||rC(t.baseUrl)===null?null:e===`internal`?cC(t)?0:sC(t)?1:aC(t)?2:null:oC(t)?0:aC(t)?1:cC(t)?2:sC(t)?3:null}var uC=new Set([`localhost`,`0.0.0.0`,`::1`,`[::1]`,`::`,`[::]`]);function dC(e){let t=e.toLowerCase();return uC.has(t)||t.endsWith(`.localhost`)?!0:/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function fC(e){let t=e.trim();if(t===``)return{ok:!1,reason:`Enter an address, e.g. https://192.168.1.50:4443.`};let n;try{n=new URL(t)}catch{return{ok:!1,reason:`Not a URL — include http:// or https://.`}}return n.protocol!==`https:`&&n.protocol!==`http:`?{ok:!1,reason:`Use an http:// or https:// address.`}:n.username!==``||n.password!==``?{ok:!1,reason:`The address must not carry a user name or password.`}:n.hostname===``?{ok:!1,reason:`The address has no host.`}:dC(n.hostname)?{ok:!1,reason:`A loopback address names whoever dials it, never this hub — use an address other machines reach.`}:n.pathname!==`/`||n.search!==``||n.hash!==``?{ok:!1,reason:`Enter only the address (scheme, host and port), without a path.`}:{ok:!0,baseUrl:n.origin}}var pC=`The public endpoint needs an https:// address: passkeys and most identity providers refuse a plain-http origin. Accept http only when sign-in and notification links never leave your own network.`;function mC(e,t,n={}){if(GS(t))return e===`notificationTaps`?{ok:!0,baseUrl:US}:{ok:!1,reason:`The CamStack app link is not a hub address — only notification taps can use it.`};let r=fC(t);return r.ok&&e===`publicEndpoint`&&r.baseUrl.startsWith(`http:`)&&n.acceptInsecureHttp!==!0?{ok:!1,reason:pC}:r}function hC(e,t){if(t===null||t===``)return null;let n=mC(e,t,{acceptInsecureHttp:!0});return n.ok?n.baseUrl:null}function gC(e,t){let n=e.flatMap(e=>{let n=lC(t,e);return n===null?[]:[{rank:n,priority:e.priority,endpoint:e}]}).toSorted((e,t)=>e.rank-t.rank||e.priority-t.priority)[0];return n===void 0?null:iC(n.endpoint.baseUrl)}function _C(e,t,n){let r=hC(t,n);if(r!==null)return{flagged:r,resolved:r,source:`flagged`};let i=gC(e,t);return{flagged:null,resolved:i,source:i===null?`none`:`auto`}}function vC(e,t){return _C(e,`internal`,t.internal)}function yC(e,t){return _C(e,`publicEndpoint`,t.publicEndpoint)}function bC(e){let t=hC(`notificationTaps`,e.notificationTaps);return t!==null&&!GS(t)?{flagged:t,resolved:t,source:`flagged`}:{flagged:null,resolved:US,source:`auto`}}function xC(e){return e.kind===`lan-ipv4`?!0:e.kind===`public`&&e.interfaceKind===`public`}function SC(e,t){let n=e.filter(xC);if(t.appConnections.length===0)return n;let r=new Set(t.appConnections),i=e.filter(e=>r.has(e.baseUrl));return i.length>0?i:n}function CC(e,t){let n=new Set(t.appConnections),r=SC(e,t),i=r.some(e=>n.has(e.baseUrl));return{flagged:t.appConnections,resolved:r.map(e=>e.baseUrl),source:r.length===0?`none`:i?`flagged`:`auto`}}function wC(e,t,n){return{appConnections:CC(e,n),notificationTaps:bC(n),internal:vC(t,n),publicEndpoint:yC(t,n)}}function TC(e){return e===null?null:rC(e)}var EC=`camstack`,DC=`_camstack._tcp.local`,OC={nodeId:`nodeId`,version:`version`,role:`role`,url:`url`},kC=`hub`,AC=6e5,jC=60*6e4,MC=d({inputTokens:i(),outputTokens:i()}),NC=x([`timeout`,`rate-limited`,`auth`,`refusal`,`bad-request`,`unavailable`,`no-profile`,`budget-exceeded`,`adapter-error`]),PC=d({ok:m(!0),text:l(),model:l(),usage:MC,truncated:C(),latencyMs:i()}),FC=x([`guardrail`,`model`]),IC=d({ok:m(!1),code:NC,message:l(),retryAfterMs:i().optional(),refusalSource:FC.optional()}),LC=p(`ok`,[PC,IC]),RC=d({bytes:b(Uint8Array),mimeType:l()}),zC=d({enabled:C().default(!1),maxAttempts:i().int().min(1).max(5).default(1)}),BC={totalMs:6e4,connectMs:1e4,firstTokenMs:12e4,idleMs:6e4},VC=d({addonId:l().optional(),profileId:l().optional(),consumer:l(),system:l().optional(),prompt:l(),jsonSchema:y(l(),o()).optional(),maxTokens:i().int().positive().optional(),temperature:i().optional(),topP:i().min(0).max(1).optional(),topK:i().int().positive().optional(),timeoutMs:i().int().positive().optional(),retry:zC.optional(),requestId:l().optional()}),HC=d({url:l(),filename:l(),sizeBytes:i(),sha256:l().optional()}),UC=p(`kind`,[d({kind:m(`catalog`),catalogId:l()}),d({kind:m(`url`),url:l(),sha256:l().optional(),label:l().optional(),sizeBytes:i().optional(),extraFiles:S(HC).optional()}),d({kind:m(`path`),path:l()})]),WC=d({nodeId:l(),engine:x([`llama-cpp`]),model:UC,contextSize:i().int().default(4096),gpuLayers:i().int().default(0),threads:i().int().optional(),parallel:i().int().default(1),batchSize:i().int().positive().optional(),ubatchSize:i().int().positive().optional(),flashAttention:C().default(!1),mlock:C().default(!1),noMmap:C().default(!1),cacheTypeK:x([`f32`,`f16`,`q8_0`,`q5_1`,`q5_0`,`q4_1`,`q4_0`]).optional(),cacheTypeV:x([`f32`,`f16`,`q8_0`,`q5_1`,`q5_0`,`q4_1`,`q4_0`]).optional(),extraArgs:S(l()).default([]),autoStart:C().default(!1),idleStopMinutes:i().int().default(30)}),GC=d({phase:x([`downloading`,`verifying`]),file:l(),fileIndex:i().int(),fileCount:i().int(),downloadedBytes:i(),totalBytes:i().optional()}),KC=d({nodeId:l(),state:x([`stopped`,`downloading`,`starting`,`ready`,`crashed`,`failed`]),pid:i().optional(),port:i().optional(),modelPath:l().optional(),modelId:l().optional(),downloadProgress:i().min(0).max(1).optional(),download:GC.optional(),lastError:l().optional(),crashesInWindow:i(),memoryBytes:i().optional(),vramBytes:i().optional()}),qC=d({file:l(),sizeBytes:i(),catalogId:l().optional(),installedAt:i().optional(),path:l().optional()}),JC=d({nodeId:l(),modelsBytes:i(),freeBytes:i().optional()}),YC=VC.extend({images:S(RC).optional(),runtime:WC,timeoutMs:i().int().positive().optional()}),XC=x([`deviceNotEligible`,`appleIntelligenceNotEnabled`,`modelNotReady`,`osTooOld`,`helperMissing`,`helperCrashed`]),ZC=p(`state`,[d({state:m(`available`),osVersion:l(),contextSize:i().int().positive(),languages:S(l()),imageInput:C()}),d({state:m(`unavailable`),reason:XC,osVersion:l().nullable(),detail:l()}),d({state:m(`unsupported-platform`),platform:l()}),d({state:m(`unknown`),error:l()})]),QC=VC.extend({images:S(RC).optional(),timeoutMs:i().int().positive().optional()}),$C=d({requestId:l()}),ew={name:`llm-runtime`,scope:`system`,mode:`singleton`,internal:!0,methods:{complete:D(YC,LC,{kind:`mutation`,auth:`admin`,timeoutMs:AC}),ensureStarted:D(d({runtime:WC}),KC,{kind:`mutation`,auth:`admin`,timeoutMs:AC}),stop:D(d({}),v(),{kind:`mutation`,auth:`admin`}),status:D(d({}),KC,{auth:`admin`}),installModel:D(d({model:UC}),v(),{kind:`mutation`,auth:`admin`,timeoutMs:jC}),deleteModel:D(d({file:l()}),v(),{kind:`mutation`,auth:`admin`}),listLocalModels:D(d({}),S(qC),{auth:`admin`}),getDiskUsage:D(d({}),JC,{auth:`admin`}),cancel:D($C,v(),{kind:`mutation`,auth:`admin`}),appleAvailability:D(d({}),ZC,{auth:`admin`}),completeApple:D(QC,LC,{kind:`mutation`,auth:`admin`,timeoutMs:AC})}},tw=x([`openai-compatible`,`openai`,`anthropic`,`google`,`managed-local`,`apple-foundation`]),nw=d({id:l(),name:l(),kind:tw,addonId:l(),enabled:C(),model:l(),baseUrl:l().optional(),apiKey:l().optional(),supportsVision:C(),temperature:i().min(0).max(2).optional(),topP:i().min(0).max(1).optional(),topK:i().int().positive().optional(),maxTokens:i().int().positive().optional(),contextLength:i().int().positive().optional(),systemPrompt:l().optional(),timeoutMs:i().int().positive().default(6e4),connectTimeoutMs:i().int().positive().default(1e4),firstTokenTimeoutMs:i().int().positive().default(12e4),idleTimeoutMs:i().int().positive().default(6e4),retry:zC.default({enabled:!1,maxAttempts:1}),toolsEnabled:C().default(!1),extraHeaders:y(l(),l()).optional(),runtime:WC.optional(),appleFoundation:d({nodeId:l()}).optional()}),rw=o(),iw=d({kind:tw,label:l(),icon:l(),addonId:l(),configSchema:rw}),aw=f([d({consumer:l()}),d({purpose:x([`text`,`vision`])})]),ow=d({selector:aw,profileId:l()}),sw=d({day:l(),consumer:l(),profileId:l(),calls:i(),okCalls:i(),errorCalls:i(),inputTokens:i(),outputTokens:i(),avgLatencyMs:i()}),cw=d({id:l(),label:l(),family:l(),purpose:x([`text`,`vision`]),url:l(),sha256:l(),sizeBytes:i(),quantization:l(),minRamBytes:i(),contextSizeDefault:i().int(),mmprojUrl:l().optional()}),lw=p(`ok`,[d({ok:m(!0),model:UC,label:l(),repo:l(),quantization:l(),purpose:x([`text`,`vision`]),totalBytes:i(),extraFilenames:S(l())}),d({ok:m(!1),code:l(),message:l(),candidates:S(l()).optional(),requiredBytes:i().optional()})]),uw=d({nodeId:l(),reachable:C(),status:KC.optional(),disk:JC.optional(),error:l().optional(),apple:ZC.optional()}),dw=VC.extend({images:S(RC).min(1)}),fw=d({addonId:l(),profileId:l()}),pw={name:`llm`,scope:`system`,mode:`collection`,internal:!1,providerKind:`ai`,nodeIdMode:`data`,methods:{generate:D(VC,LC,{kind:`mutation`,timeoutMs:AC}),generateVision:D(dw,LC,{kind:`mutation`,timeoutMs:AC}),cancel:D(d({addonId:l().optional(),requestId:l()}),v(),{kind:`mutation`}),listProfileKinds:D(d({}),S(iw)),listProfiles:D(d({}),S(nw)),upsertProfile:D(d({profile:nw}),nw,{kind:`mutation`,auth:`admin`}),deleteProfile:D(fw,v(),{kind:`mutation`,auth:`admin`}),testProfile:D(fw,LC,{kind:`mutation`,auth:`admin`,timeoutMs:AC}),listModels:D(fw,S(l())),getDefaults:D(d({}),S(ow)),setDefault:D(d({selector:aw,profileId:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),getUsage:D(d({since:i().optional(),until:i().optional(),consumer:l().optional(),profileId:l().optional()}),S(sw)),listModelCatalog:D(d({}),S(cw)),listRuntimeNodes:D(d({}),S(uw)),listNodeModels:D(d({nodeId:l()}),S(qC)),resolveModelRef:D(d({ref:l(),maxBytes:i().positive().optional()}),lw,{kind:`mutation`,auth:`admin`}),installModel:D(d({nodeId:l(),model:UC}),v(),{kind:`mutation`,auth:`admin`}),deleteModel:D(d({nodeId:l(),file:l()}),v(),{kind:`mutation`,auth:`admin`}),getRuntimeStatus:D(fw,KC),startRuntime:D(fw,KC,{kind:`mutation`,auth:`admin`}),stopRuntime:D(fw,v(),{kind:`mutation`,auth:`admin`})}},mw=[`decode`,`transcode`,`recording`,`streaming`,`detection`],hw=[`measured`,`accounted`,`unattributable`],gw=d({role:x(mw),deviceId:i().int().positive().nullable(),attribution:x(hw),unit:l(),pid:i().int().positive().optional(),startedAtMs:i().optional(),cpuSeconds:i().optional(),rssBytes:i().optional()}),_w={name:`load-contribution`,scope:`system`,mode:`collection`,internal:!0,methods:{list:D(v(),S(gw).readonly())},mount:{kind:`skip`}},vw=d({armed:i().int().min(0),unknown:S(l()).readonly()}),yw={name:`log-channels`,scope:`system`,mode:`collection`,internal:!0,methods:{list:D(v(),S(Zd).readonly()),apply:D(d({windows:S(Qd).readonly()}),vw,{kind:`mutation`})},mount:{kind:`skip`}},bw=x([`debug`,`info`,`warn`,`error`]),xw=d({timestamp:me(),level:bw,scope:S(l()),message:l(),meta:y(l(),o()).optional(),tags:y(l(),l()).optional()}),Sw={name:`log-destination`,scope:`system`,mode:`collection`,internal:!0,methods:{write:D(xw,v(),{kind:`mutation`}),query:D(d({scope:S(l()).optional(),level:bw.optional(),since:me().optional(),until:me().optional(),limit:i().optional(),tags:y(l(),l()).optional()}),S(xw).readonly())},mount:{kind:`skip`}},Cw=x([`primary`,`second-factor`]),ww=d({kind:m(`redirect`),id:l(),label:l(),icon:l().optional(),startUrl:l(),stage:Cw,linkable:C().optional()}),Tw=d({kind:m(`widget`),id:l(),addonId:l(),bundle:l(),remote:Jm,stage:Cw}),Ew=d({kind:m(`passkey`),id:l(),label:l(),stage:Cw,rpId:l(),origin:l().nullable()}),Dw=p(`kind`,[ww,Tw,Ew]),Ow={name:`login-method`,scope:`system`,mode:`collection`,internal:!0,methods:{getLoginMethods:D(v(),S(Dw).readonly())},mount:{kind:`skip`}},kw=d({total:i(),user:i(),system:i(),irq:i(),nice:i(),loadAvg:u([i(),i(),i()]),cores:i()}),Aw=d({percent:i(),totalBytes:i(),usedBytes:i(),availableBytes:i(),swapUsedBytes:i(),swapTotalBytes:i()}),jw=d({readBytes:i(),writeBytes:i(),readOps:i(),writeOps:i(),timestampMs:i()}),Mw=d({rxBytes:i(),txBytes:i(),rxPackets:i(),txPackets:i(),rxErrors:i(),txErrors:i(),timestampMs:i()}),Nw=d({utilization:i(),model:l(),memoryUsedBytes:i(),memoryTotalBytes:i(),temperature:i().nullable()}),Pw=d({openFds:i(),threadCount:i(),activeHandles:i(),activeRequests:i()}),Fw=d({avg10:i(),avg60:i(),avg300:i()}),Iw=d({some:Fw,full:Fw.nullable()}),Lw=d({cpu:kw,memory:Aw,gpu:Nw.nullable(),network:Mw,disk:jw,pressure:d({cpu:Iw.nullable(),memory:Iw.nullable(),io:Iw.nullable()}),process:Pw,cpuTemperature:i().nullable(),timestampMs:i()}),Rw=d({path:l(),totalBytes:i(),usedBytes:i(),availableBytes:i(),percent:i()}),zw=d({pid:i(),cpu:i(),memory:i(),privateBytes:i().optional(),sharedBytes:i().optional()}),Bw=d({addonId:l(),nodeId:l(),role:x([`hub`,`worker`]),pid:i(),state:x([`starting`,`running`,`stopping`,`stopped`,`crashed`]),uptimeSec:i()}),Vw=d({pid:i(),ppid:i(),pgid:i(),classification:x([`root`,`managed`,`system`]),addonId:l().nullable(),nodeId:l().nullable(),command:l(),cpuPercent:i(),memoryRssBytes:i(),cpuMainPercent:i().nullable(),cpuGcPercent:i().nullable(),threadCount:i().nullable(),uptimeSec:i()}),Hw=d({source:x([`cgroup-v2`,`cgroup-v1`]),currentBytes:i(),limitBytes:i().nullable(),anonBytes:i().nullable(),fileBytes:i().nullable(),shmemBytes:i().nullable(),slabBytes:i().nullable(),gpuShmemBytes:i().nullable()}).extend({atMs:i()}),Uw=d({atMs:i(),samples:i().int(),cpuMainPercent:i().nullable(),cpuMainPercentMin:i().nullable(),cpuGcPercent:i().nullable(),cpuGcPercentMin:i().nullable(),cpuLifetimePercent:i(),cpuLifetimePercentMin:i(),memoryRssBytes:i(),memoryRssBytesMin:i(),processCount:i().int(),processCountMin:i().int()}),Ww=d({key:l(),kind:x([`addon`,`root`,`unattributed`]),points:S(Uw).readonly()}),Gw=d({nodeId:l(),series:S(Ww).readonly(),containerMemory:S(Hw).readonly(),bucketMs:i(),retainedSamples:i(),oldestAtMs:i().nullable(),cadenceMs:i(),durable:C()}),Kw=d({forNodeId:l(),sinceMs:i().optional(),maxPoints:i().int().positive().optional()}),qw=d({cpuPercent:i(),memoryPercent:i(),memoryUsedMB:i(),memoryTotalMB:i(),diskPercent:i().optional(),temperature:i().optional(),gpuPercent:i().optional(),gpuMemoryPercent:i().optional()}),Jw={name:`metrics-provider`,scope:`system`,mode:`singleton`,methods:{collectSnapshot:D(v(),Lw),getCached:D(v(),Lw.nullable()),getCurrent:D(v(),qw),getDiskSpace:D(d({dirPath:l()}),Rw),getGpuInfo:D(v(),Nw.nullable()),getCpuTemperature:D(v(),i().nullable()),getProcessStats:D(d({pids:S(i())}),S(zw)),listAddonInstances:D(v(),S(Bw).readonly()),getAddonStats:D(d({addonId:l()}),zw.nullable()),listNodeProcesses:D(v(),S(Vw).readonly()),getLoadSeries:D(Kw,Gw)}},Yw=d({sourceUrl:l(),metadata:qp,targets:S(Kp).min(1).readonly(),calibrationRef:l().optional(),sessionId:l().optional()}),Xw={name:`model-convert`,scope:`system`,mode:`singleton`,internal:!0,methods:{convert:D(Yw,Yp,{kind:`mutation`,auth:`admin`,timeoutMs:6e5})}},Zw=d({targetNodeId:l(),modelId:l(),format:x(yr),entry:Gp}),Qw=d({ok:C(),sha256:l(),bytes:i(),path:l()}),$w={name:`model-distributor`,scope:`system`,mode:`singleton`,internal:!0,methods:{distributeModel:D(Zw,Qw,{kind:`mutation`,auth:`admin`})}},eT=d({bbox:sh,pixelCount:i(),intensity:i()}),tT=d({detected:C(),regionCount:i(),regions:S(eT).readonly(),rawRegions:S(eT).readonly(),frameWidth:i(),frameHeight:i(),analysisMs:i()}),nT={name:`motion-detection`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{analyze:D(d({deviceId:i(),frame:oh.optional(),frameHandle:rr.optional()}),tT,{kind:`mutation`}),removeCamera:D(d({deviceId:i()}),v(),{kind:`mutation`}),reset:D(v(),v(),{kind:`mutation`})},events:{onMotion:{data:d({deviceId:i(),detected:C(),regionCount:i()})}}},rT=x([`external`,`embedded`]),iT=x([`connected`,`disconnected`,`auth-failed`,`unreachable`,`tls-error`]),aT=d({id:l(),name:l(),url:l(),kind:rT,status:iT,latencyMs:i().nullable(),error:l().optional(),connectedClients:i().int().nonnegative().optional(),lastCheckedAt:i().optional()}),oT=d({url:l(),username:l().optional(),password:l().optional(),clientIdPrefix:l().optional()}),sT=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()}),cT=d({id:l()}),lT=d({id:l()}),uT=p(`ok`,[d({ok:m(!0),latencyMs:i()}),d({ok:m(!1),error:l()})]),dT=d({port:i().int().min(1).max(65535).default(1883),allowAnonymous:C().default(!1),username:l().optional(),password:l().optional()}),fT=d({id:l(),url:l()}),pT=d({brokerCount:i(),embeddedRunning:C()}),mT={name:`mqtt-broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:pT,kind:`poll`},methods:{listBrokers:D(v(),S(aT)),getBrokerConfig:D(lT,oT,{auth:`admin`}),addBroker:D(sT,cT,{kind:`mutation`,auth:`admin`}),removeBroker:D(lT,v(),{kind:`mutation`,auth:`admin`}),testConnection:D(lT,uT,{kind:`mutation`,auth:`admin`}),startEmbeddedBroker:D(dT,fT,{kind:`mutation`,auth:`admin`}),stopEmbeddedBroker:D(lT,v(),{kind:`mutation`,auth:`admin`}),getStatus:D(v(),pT)}},hT=d({url:l(),hostname:l(),port:i(),protocol:x([`http`,`https`])}),gT=d({connected:C(),endpoint:hT.nullable(),error:l().optional()}),_T=hT.extend({id:l(),label:l(),mode:l().optional(),sourcePort:i().optional()}),vT={name:`network-access`,scope:`system`,mode:`collection`,providerKind:`ingress`,methods:{start:D(v(),hT,{kind:`mutation`}),stop:D(v(),v(),{kind:`mutation`}),getEndpoint:D(v(),hT.nullable()),getStatus:D(v(),gT),listEndpoints:D(v(),S(_T).readonly())}},yT=x([`image`,`video`,`gif`,`audio`,`icon`]),bT=d({mediaType:yT,url:l().optional(),bytes:b(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`"}),xT=x([`text`,`markdown`,`html`]),ST=x([`acknowledge`,`dismiss`,`silence`,`snooze`,`view`,`play`,`open`,`close`,`lock`,`unlock`,`arm`,`arm-home`,`arm-away`,`arm-night`,`disarm`,`light`,`alert`,`camera`]),CT=d({id:l(),label:l(),url:l().optional(),icon:ST.optional(),destructive:C().optional(),mode:x([`navigate`,`background`]).optional()}),wT=d({body:l(),title:l().optional(),format:xT.default(`text`),priority:i().int().min(1).max(5).default(3),level:l().optional(),attachments:S(bT).optional(),clickUrl:l().optional(),actions:S(CT).optional(),sound:l().optional(),ttl:i().optional(),tag:l().optional(),deviceId:i().optional(),eventId:l().optional(),metadata:y(l(),o()).optional()}),TT=d({id:l(),label:l(),ordinal:i().int().min(1).max(5).nullable(),flags:d({critical:C().optional(),silent:C().optional(),noPush:C().optional()}).optional(),requires:S(l()).optional(),description:l().optional()}),ET=d({attachments:d({mediaTypes:S(yT),mode:x([`url`,`bytes`,`both`]),max:i().int().nonnegative(),maxBytes:i().int().positive().optional()}),actions:i().int().nonnegative(),actionIcons:C().optional(),levels:S(TT),format:S(xT),clickUrl:C(),sound:C(),ttl:C(),bodyMaxLen:i().int().positive()}),DT=o(),OT=d({kind:l(),label:l(),icon:l(),addonId:l(),iconUrl:l().optional(),iconMediaType:l().optional(),configSchema:DT,destinationKeys:S(l()).optional(),supportsDiscovery:C(),caps:ET}),kT=d({id:l(),name:l(),kind:l(),addonId:l(),enabled:C(),config:y(l(),o())}),AT=d({kind:l(),suggestedName:l(),config:y(l(),o())}),jT=d({level:l(),format:xT,attachmentsSent:i().int().nonnegative(),actionsSent:i().int().nonnegative(),truncated:C(),dropped:S(l())}),MT=d({success:C(),error:l().optional(),renderedAs:jT.optional()}),NT=MT,PT=d({ok:C(),resolvedUrl:l(),httpStatus:i().int().optional(),stateInstance:l().optional(),error:l().optional()}),FT={name:`notification-output`,scope:`system`,mode:`collection`,methods:{listTargetKinds:D(d({}),S(OT)),listTargets:D(d({}),S(kT),{auth:`admin`}),getTarget:D(d({targetId:l()}),kT,{auth:`admin`}),discoverTargets:D(d({kind:l(),config:y(l(),o()).optional(),targetId:l().optional()}),S(AT),{auth:`admin`}),probeTargetConfig:D(d({kind:l(),config:y(l(),o()),targetId:l().optional()}),PT,{kind:`mutation`,auth:`admin`}),send:D(d({targetId:l(),notification:wT}),MT,{kind:`mutation`,auth:`admin`}),testTarget:D(d({targetId:l(),sample:wT.optional()}),NT,{kind:`mutation`,auth:`admin`}),upsertTarget:D(d({target:kT,cloneSecretsFrom:l().optional()}),kT,{kind:`mutation`,auth:`admin`}),deleteTarget:D(d({targetId:l()}),v(),{kind:`mutation`,auth:`admin`}),setTargetEnabled:D(d({targetId:l(),enabled:C()}),v(),{kind:`mutation`,auth:`admin`})}},IT=[{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`}],LT=[{id:`person`,name:`Person`},{id:`vehicle`,name:`Vehicle`},{id:`animal`,name:`Animal`},{id:`package`,name:`Package`}],RT=new Set(LT.map(e=>e.id));function zT(e){return RT.has(e.trim().toLowerCase())}var BT={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},VT=[{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`}],HT={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},UT={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},WT=new Map;for(let[e,t]of Object.entries(HT.mapping))WT.set(e.toLowerCase(),t);for(let[e,t]of Object.entries(UT.mapping))WT.set(e.toLowerCase(),t);function GT(e){return WT.get(e.toLowerCase())??null}function KT(){return VT.map(e=>e.id)}var G={motion:`#f59e0b`,audio:`#06b6d4`,person:`#22c55e`,vehicle:`#3b82f6`,animal:`#f97316`,package:`#a855f7`,sensor:`#8b5cf6`,control:`#10b981`,genericDetection:`#64748b`},qT=`#22ff55`,JT={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 YT(e){return e.split(/[-_ ]/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var XT=new Map;function ZT(e,t,n,r,i){XT.set(e,{kind:e,parentKind:null,level:`macro`,category:t,color:n,iconId:r,labelKey:`eventKind.${e}`,label:i})}function K(e,t,n,r,i,a){XT.set(e,{kind:e,parentKind:t,level:`sub`,category:n,color:r,iconId:i,labelKey:`eventKind.${e}`,label:a})}ZT(`motion`,`motion`,G.motion,`motion`,`Motion`),ZT(`audio`,`audio`,G.audio,`audio`,`Audio`),ZT(`person`,`detection`,G.person,`person`,`Person`),ZT(`vehicle`,`detection`,G.vehicle,`vehicle`,`Vehicle`),ZT(`animal`,`detection`,G.animal,`animal`,`Animal`),ZT(`package`,`package`,G.package,`package`,`Package`),ZT(`sensor`,`sensor`,G.sensor,`sensor`,`Sensor`),ZT(`control`,`control`,G.control,`control`,`Control`);for(let[e,t]of Object.entries(BT.mapping))t!==`vehicle`&&t!==`animal`||XT.has(e)||K(e,t,`detection`,JT[e]??G.genericDetection,e,YT(e));K(`package-delivered`,`package`,`package`,G.package,`package`,`Package delivered`),K(`package-picked-up`,`package`,`package`,G.package,`package`,`Package picked up`),K(`contact`,`sensor`,`sensor`,`#f59e0b`,`door`,`Contact`),K(`motion-sensor`,`sensor`,`sensor`,G.sensor,`pir`,`Motion sensor`),K(`smoke`,`sensor`,`sensor`,`#ef4444`,`smoke`,`Smoke`),K(`flood`,`sensor`,`sensor`,`#3b82f6`,`water`,`Water leak`),K(`gas`,`sensor`,`sensor`,`#ef4444`,`gas`,`Gas`),K(`carbon-monoxide`,`sensor`,`sensor`,`#dc2626`,`smoke`,`Carbon monoxide`),K(`vibration`,`sensor`,`sensor`,`#eab308`,`vibration`,`Vibration`),K(`tamper`,`sensor`,`sensor`,`#f97316`,`tamper`,`Tamper`),K(`presence`,`sensor`,`sensor`,`#22c55e`,`presence`,`Presence`),K(`enum-sensor`,`sensor`,`sensor`,G.sensor,`generic`,`Sensor state`),K(`device-event`,`sensor`,`sensor`,`#10b981`,`button`,`Device event`),K(`lock`,`control`,`control`,`#0ea5e9`,`lock`,`Lock`),K(`cover`,`control`,`control`,`#0ea5e9`,`door`,`Cover`),K(`switch`,`control`,`control`,G.control,`switch`,`Switch`),K(`siren`,`control`,`control`,`#dc2626`,`siren`,`Siren`),K(`button`,`control`,`control`,`#10b981`,`button`,`Button`),K(`doorbell`,`control`,`control`,`#a855f7`,`doorbell`,`Doorbell`);for(let e of VT){let t=`audio-${e.id}`;XT.has(t)||K(t,`audio`,`audio`,G.audio,t,e.name)}var QT=Object.freeze(Object.fromEntries(XT));function $T(e){return QT[e]}function eE(e){return QT[e]?.color??`#22ff55`}function tE(e){let t=[];for(let n of Object.values(QT))n.parentKind===e&&t.push(n);return t}var nE=d({kind:l(),label:l(),parentKind:l().nullable()}),rE=d({videoClasses:S(nE),audioKinds:S(nE),labels:S(nE)});function iE(e,t,n){return{kind:e,label:t,parentKind:n}}function aE(){let e=Object.values(QT);return{videoClasses:e.filter(e=>e.category===`detection`).map(e=>iE(e.kind,e.label,e.parentKind)),audioKinds:e.filter(e=>e.category===`audio`&&e.level===`sub`).map(e=>iE(e.kind,e.label,e.parentKind)),labels:e.filter(e=>e.category===`sensor`||e.category===`control`).map(e=>iE(e.kind,e.label,e.parentKind))}}var oE=Object.freeze(aE()),sE=x([`disarmed`,`armed_home`,`armed_away`,`armed_night`,`armed_vacation`,`armed_custom_bypass`,`arming`,`disarming`,`pending`,`triggered`]),q=x([`home`,`away`,`night`,`vacation`,`custom_bypass`]),cE=d({state:sE,targetMode:q.nullable().optional(),availableModes:S(q),requiresCode:C(),lastChangedAt:i()}),lE={name:`alarm-panel`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.AlarmPanel],methods:{arm:D(d({deviceId:i().int().nonnegative(),mode:q,code:l().min(1).optional()}),v(),{kind:`mutation`,auth:`protected`}),disarm:D(d({deviceId:i().int().nonnegative(),code:l().min(1).optional()}),v(),{kind:`mutation`,auth:`protected`}),trigger:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:cE,kind:`push`},runtimeState:cE,durability:`restored`,volatileStateFields:[`lastChangedAt`]},uE=d({x:i(),y:i()}),dE=d({kind:m(`rect`),x:i(),y:i(),width:i(),height:i()}),fE=d({kind:m(`polygon`),points:S(uE)}),pE=d({kind:m(`grid`),gridWidth:i(),gridHeight:i(),cells:S(C())}),mE=d({kind:m(`line`),points:S(uE)}),hE=p(`kind`,[dE,fE,pE,mE]),gE=x([`rect`,`polygon`,`grid`,`line`]),_E=d({min:i(),max:i()}),vE=d({width:i(),height:i()}),yE=x([`immediate`,`track-end`,`device-event`,`package-event`,`system-event`]),bE=x(`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-restarting.node-updating.node-inference-unavailable.detection-blind.recording-stalled.recording-healthy.recording-degraded.storage-location-low.storage-location-critical.storage-location-ok.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(`.`)),xE=new Set([`camera-online`,`camera-offline`,`camera-disabled`,`camera-enabled`]),SE=bE.options.filter(e=>!xE.has(e)),CE=[`alarm-arm-refused`,`alarm-check-failed`,`alarm-arming`,`alarm-armed`,`alarm-pending`,`alarm-triggered`,`alarm-rearmed`,`alarm-sensor-bypass`,`alarm-disarmed`],wE=[`device-battery-low`,`device-battery-normal`,`device-consumable-low`,`device-consumable-normal`],TE=[`device-consumable-low`,`device-consumable-normal`],EE=[`device-tank-low`,`device-tank-full`,`device-tank-normal`],DE=15,OE=95,kE=d({kinds:S(bE).min(1),deviceIds:S(i().int()).min(1).optional(),deviceTypes:S(l().min(1)).min(1).optional(),excludeDeviceIds:S(i().int()).min(1).optional(),nodeIds:S(l().min(1)).min(1).optional(),packageNames:S(l().min(1)).min(1).optional(),consumableLowPercent:i().int().min(1).max(95).optional()});function AE(e){return e.consumableLowPercent??15}var jE=1,ME=1440,NE=[10,30,60],PE=d({days:S(i().int().min(0).max(6)).min(1),startMinute:i().int().min(0).max(1439),endMinute:i().int().min(0).max(1439)}),FE=d({windows:S(PE).min(1),timezone:l().optional(),invert:C().optional()}),IE=x([`instant`,`summary`]),LE=x([`rule`,`section`]),RE=p(`mode`,[d({mode:m(`instant`)}),d({mode:m(`summary`),schedule:FE,split:LE.optional()})]),zE=d({values:S(l().min(1)),maxDistance:i().int().min(0).max(3).default(1)}),BE=d({zoneId:l().optional(),className:l().optional(),op:x([`became-occupied`,`became-free`,`>=`,`<=`]).default(`became-occupied`),count:i().int().min(0).default(1),sustainSeconds:i().int().min(0).max(3600).default(15)}),VE=-96,HE=d({labels:S(l().min(1)).min(1).optional(),dbThreshold:i().min(-96).max(0).optional(),hitPercent:i().int().min(1).max(100).default(60),samplingSeconds:i().int().min(1).max(300).default(10),confirmHits:i().int().min(1).max(20).optional(),confirmWindowSec:i().int().min(1).max(60).optional()}),UE=x([`enter`,`exit`,`any`]),WE=x([`raised`,`cleared`]),GE=d({ids:S(l().min(1)).min(1),match:x([`any`,`all`]).optional()}),KE=p(`kind`,[d({kind:m(`wait`),seconds:i().min(0).max(300)}),d({kind:m(`cap`),deviceId:i().int(),cap:l().min(1),method:l().min(1),args:y(l(),o()).optional()})]),qE=d({id:l().min(1),name:l().min(1).max(120),minDelaySec:i().int().min(0).max(86400).optional(),actions:S(KE).min(1)}),JE=d({name:l().min(1).max(120),minDelaySec:i().int().min(0).max(86400).optional(),actions:S(KE).min(1)}),YE=p(`kind`,[d({kind:m(`sequence`),sequenceId:l().min(1)}),d({kind:m(`do`),action:KE})]),XE=S(YE).max(4),ZE=d({id:l().min(1).max(64),label:l().min(1).max(40),sequenceId:l().min(1),icon:ST.optional(),destructive:C().optional()}),QE=d({onActivation:XE.optional(),onDeactivation:XE.optional(),onTrigger:XE.optional(),onTriggerOff:XE.optional(),buttons:S(ZE).max(8).optional()}),$E=d({name:l().min(1).max(120),enabled:C(),minDelaySec:i().int().min(0).max(86400).optional(),actions:S(KE).min(1)}),eD=$E,tD=d({deviceId:i().int(),states:S(l().min(1)).min(1)}),nD=d({sceneId:l().min(1),deviceId:i().int().optional(),requiredState:x([`matched`,`diverged`]),latched:C().optional()}),rD=d({deviceState:tD.optional(),scene:nD.optional(),devices:S(i()).optional(),devicesExclude:S(i()).min(1).optional(),classes:S(l().min(1)).optional(),classesExclude:S(l().min(1)).optional(),minConfidence:i().min(0).max(1).optional(),zones:GE.optional(),zonesExclude:S(l().min(1)).optional(),crossing:UE.optional(),labelEquals:S(l().min(1)).optional(),identities:S(l().min(1)).optional(),plates:zE.optional(),identitiesExclude:S(l().min(1)).optional(),minImportance:i().min(0).max(1).optional(),minDwellSeconds:i().min(0).optional(),source:x([`pipeline`,`onboard`,`sensor`,`audio`,`any`]).optional(),minLabelConfidence:i().min(0).max(1).optional(),eventTypeTokens:S(l().min(1)).optional(),sensorKinds:S(l().min(1)).optional(),sensorTransition:WE.optional(),packagePhase:x([`delivered`,`picked-up`,`both`]).optional(),systemEvent:kE.optional(),customZones:S(fE).optional(),occupancy:BE.optional(),audio:HE.optional()}),iD=d({targetId:l().min(1),params:y(l(),o()).optional()}),aD=x([`cropped`,`full`,`boxed`]),oD=x([`mosaic`,`each`]),sD=4,cD=6,lD=d({attach:x([`best`,`best-matching`,`keyFrame`,`none`]).default(`best`),frame:aD.optional(),zoneCrop:C().optional(),gif:C().optional(),clip:C().optional(),clipPreRollSec:i().int().min(0).max(30).optional(),clipPostRollSec:i().int().min(0).max(30).optional(),clipSpeed:i().min(1).max(8).optional(),profile:E.optional(),linkedCameras:oD.optional()}),uD=x([`shared`,`per-class`]),dD=d({cooldownSec:i().int().min(0).max(86400).default(60),scope:x([`rule`,`rule-device`]).default(`rule-device`),granularity:uD.optional()}),fD=1e3,pD=2e4,mD=8e3,hD=448,gD=d({op:x([`>=`,`>`,`<=`,`<`,`==`]),count:i().int().min(0).max(1e3)}),_D=d({enabled:C().default(!1),profileId:l().optional(),prompt:l().max(1e3).optional(),expect:gD.optional(),timeoutMs:i().int().min(fD).max(pD).default(mD),onTimeout:x([`fire`,`suppress`]).default(`fire`),maxImagePx:i().int().min(64).max(2048).default(448)}),vD=5,yD=20,bD=60,xD=d({name:l().min(1).max(200),enabled:C().default(!0),delivery:yE,conditions:rD.default({}),schedule:FE.optional(),systemEventDelivery:RE.optional(),targets:S(iD),targetUsers:S(l()).optional(),media:lD.default({attach:`best`}),throttle:dD.default({cooldownSec:60,scope:`rule-device`}),template:d({title:l().max(500).optional(),body:l().max(2e3).optional()}).optional(),priority:i().int().min(1).max(5).default(3),ownerUserId:l().optional(),snoozeAllowGlobal:C().optional(),snoozeOptions:S(i().int().min(1).max(ME)).max(4).optional(),actions:QE.optional(),confirm:_D.optional(),groupingSec:i().int().min(5).max(60).optional()}),SD=xD.partial().extend({disabledTargetIds:S(l()).optional(),enabled:C().optional(),conditions:rD.optional(),media:lD.optional(),throttle:dD.optional(),priority:i().int().min(1).max(5).optional()}),CD=[`waitForEnhancement`,`groupIdleSec`];function wD(e){return CD.some(t=>t===e)}var TD=[`template`,`schedule`,`targetUsers`,`snoozeOptions`,`snoozeAllowGlobal`,`actions`,`confirm`,`groupingSec`,`waitForEnhancement`,`groupIdleSec`],ED=x(TD),DD=d({ruleId:l(),patch:SD,clear:S(ED).optional()}),OD=xD.extend({id:l(),createdBy:l(),createdAt:i(),updatedAt:i(),disabledTargetIds:S(l()).default([])}),kD=x([`device-state`,`streams`,`battery`,`consumables`,`tanks`,`detection-blind`,`nodes`,`addons`,`addon-updates`,`updates`]),AD=d({id:kD,status:x([`read`,`unavailable`]),items:i().int().nonnegative(),reason:l().optional()}),jD=d({section:kD.optional(),title:l(),text:l(),count:i().int().nonnegative()}),MD=d({empty:C(),count:i().int().nonnegative(),text:l(),sections:S(AD),dropped:y(l(),i().int().nonnegative()),excludedGroups:S(l()),split:LE.optional(),rows:S(jD).optional()}),ND=d({recordId:l(),recordKind:x([`object-event`,`track`,`device-event`,`package-event`,`system-event`]),deviceId:i(),timestamp:i(),wouldFire:C(),failedCondition:l().optional(),className:l().optional(),label:l().optional()}),PD=x([`detection`,`sensor`,`occupancy`,`sound`,`device-events`,`system`,`alarm`,`mixed`]),FD=x([`detection`,`sensor`,`occupancy`,`sound`,`system`]),ID=x([`rule`,`timelapse`,`summary`]),LD=x([`title`,`body`,`previewText`,`captionText`]),RD=x([`subject`,`place`,`time`,`rule`,`occupancy`,`sound`,`sensor`,`system`,`digest`,`ai`]),zD=d({name:l().regex(/^\w+$/),label:l(),description:l().optional(),example:l(),group:RD,families:S(ID).min(1),fields:S(LD).optional(),kinds:S(FD).optional(),deliveries:S(yE).optional(),systemEventKinds:S(bE).optional(),systemEventDeliveries:S(IE).optional(),dynamic:d({prefix:m(`count_`),from:m(`classes`)}).optional()}),BD=d({family:ID,field:LD,kind:PD.optional(),delivery:yE.optional(),systemEventKinds:S(bE).optional(),systemEventDelivery:IE.optional()}),VD=d({context:BD,template:d({title:l().max(500).optional(),body:l().max(2e3).optional()})}),HD=d({title:l().nullable(),body:l().nullable(),unknown:S(l())}),UD=d({id:l(),group:x([`scope`,`class`,`zones`,`quality`,`label`,`schedule`,`device`,`package`,`occupancy`,`audio`,`system`]),label:l(),valueType:x([`deviceIdList`,`deviceIdExcludeList`,`stringList`,`number01`,`number`,`sourceSelect`,`zoneSelection`,`zoneIdList`,`schedule`,`plateMatcher`,`packagePhase`,`crossingSelect`,`sensorTransition`,`polygonDraw`,`occupancy`,`audio`,`deviceState`,`scene`,`systemEvent`]),operator:x([`in`,`notIn`,`anyOf`,`allOf`,`gte`,`fuzzyIn`,`withinSchedule`]),appliesTo:S(yE),phase:l(),description:l().optional(),options:S(d({value:l(),label:l(),hint:l().optional()})).readonly().optional()}),WD=[{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-restarting`,label:`Node restarting`},{value:`node-updating`,label:`Node updating (restart imminent)`},{value:`node-inference-unavailable`,label:`Node has no usable inference device`},{value:`detection-blind`,label:`Camera detecting nothing`},{value:`recording-stalled`,label:`Recording stalled`},{value:`recording-healthy`,label:`Recording healthy again`},{value:`recording-degraded`,label:`Recording degraded (restart storm)`},{value:`storage-location-low`,label:`Storage location low`},{value:`storage-location-critical`,label:`Storage location critical`},{value:`storage-location-ok`,label:`Storage location ok again`},{value:`addon-crash-loop`,label:`Addon stopped after repeated crashes`},{value:`addon-update-available`,label:`Addon update available`},{value:`server-update-available`,label:`Server update available`},{value:`wrapper-update-available`,label:`Container / app update available`},{value:`addon-updated`,label:`Addons updated`},{value:`server-updated`,label:`Server updated`},{value:`device-battery-low`,label:`Battery low`},{value:`device-battery-normal`,label:`Battery back to normal`},{value:`device-consumable-low`,label:`Consumable low`},{value:`device-consumable-normal`,label:`Consumable replaced`},{value:`device-tank-low`,label:`Tank low (water, detergent)`},{value:`device-tank-full`,label:`Tank full (dirty water, dust)`},{value:`device-tank-normal`,label:`Tank back to normal`},{value:`export-completed`,label:`Export completed`},{value:`backup-completed`,label:`Backup completed`},{value:`alarm-arm-refused`,label:`Alarm arm refused`},{value:`alarm-check-failed`,label:`Alarm check failed (armed anyway)`},{value:`alarm-arming`,label:`Alarm arming (exit delay)`},{value:`alarm-armed`,label:`Alarm armed`},{value:`alarm-pending`,label:`Alarm entry delay started`},{value:`alarm-triggered`,label:`Alarm triggered`},{value:`alarm-rearmed`,label:`Alarm re-armed after siren`},{value:`alarm-sensor-bypass`,label:`Alarm sensor bypass`},{value:`alarm-disarmed`,label:`Alarm disarmed`}],operator:`in`,appliesTo:[`system-event`],phase:`P1`,description:`Infrastructure and update events. Device liveness covers EVERY device type — narrow it by device type (cameras only, say) and/or by device, node events by node id, and addon updates by package name.`},{id:`devices`,group:`scope`,label:`Devices`,valueType:`deviceIdList`,operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P1`,description:`Restrict the rule to these devices; absent = all devices. A sensor event matches either the SENSOR that fired or the camera it is attributed to, so a rule may name either one.`},{id:`devicesExclude`,group:`scope`,label:`Excluded devices`,valueType:`deviceIdExcludeList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P1`,description:`Every device except these. Judged on the same device ids as Devices: a sensor event is excluded by the SENSOR that fired or by the camera it is attributed to.`},{id:`classes`,group:`class`,label:`Object classes`,valueType:`stringList`,operator:`in`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`,description:`Any overlap with the detection class set passes.`},{id:`classesExclude`,group:`class`,label:`Excluded classes`,valueType:`stringList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`},{id:`minConfidence`,group:`quality`,label:`Minimum confidence`,valueType:`number01`,operator:`gte`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`},{id:`zones`,group:`zones`,label:`Zones`,valueType:`zoneSelection`,operator:`anyOf`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`,description:`The zones the subject must be in (included) or never in (excluded).`},{id:`zonesExclude`,group:`zones`,label:`Excluded zones`,valueType:`zoneIdList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`},{id:`crossing`,group:`zones`,label:`Zone crossing`,valueType:`crossingSelect`,options:[{value:``,label:`Entering`,hint:`Entries and ordinary movement; never an exit.`},{value:`exit`,label:`Leaving`,hint:`Only an exit from a zone.`},{value:`any`,label:`Entering or leaving`,hint:`Entries, exits and ordinary movement.`}],operator:`in`,appliesTo:[`immediate`],phase:`P1`,description:`Which way the subject crosses the zone.`},{id:`labelEquals`,group:`label`,label:`Label equals`,valueType:`stringList`,operator:`in`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Exact match on the collapsed label (identity / plate / subclass).`},{id:`identities`,group:`label`,label:`Known faces`,valueType:`stringList`,operator:`in`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Only recognised people. Selecting NOBODY means every identity in the face gallery; selecting some narrows to those. Matched on the gallery id, so renaming a person does not break the rule. On Immediate delivery the name must already be known when an event is written — choose Immediate, grouped to wait for it.`},{id:`plates`,group:`label`,label:`Known plates`,valueType:`plateMatcher`,operator:`fuzzyIn`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Only vehicles whose plate was read. Selecting NO plate means any readable plate; listed plates are matched Levenshtein-tolerantly, because OCR noise makes an exact match useless.`},{id:`identitiesExclude`,group:`label`,label:`Excluded faces`,valueType:`stringList`,operator:`notIn`,appliesTo:[`immediate`,`track-end`],phase:`P1`,description:`Veto by identity (mirror of Known faces, same gallery ids). A subject nobody recognised passes — there is nothing to exclude.`},{id:`minLabelConfidence`,group:`label`,label:`Minimum label confidence`,valueType:`number01`,operator:`gte`,appliesTo:[`track-end`],phase:`P1`,description:`Best identity/plate recognition match confidence [0,1] for the label the track carries at close (peak assigned-identity cosine / peak plate OCR score; the higher of the two when both were read). Distinct from detection confidence. Fails closed for a track that ended un-recognized.`},{id:`minImportance`,group:`quality`,label:`Minimum importance`,valueType:`number01`,operator:`gte`,appliesTo:[`track-end`],phase:`P1`,description:`Server-computed key-event importance [0,1]; track-end rules only (importance is scored at close). Fails when the record has none.`},{id:`minDwellSeconds`,group:`quality`,label:`Minimum dwell (seconds)`,valueType:`number`,operator:`gte`,appliesTo:[`track-end`],phase:`P1`,description:`Track lifespan in seconds (lastSeen − firstSeen); track-end rules only.`},{id:`source`,group:`scope`,label:`Detection source`,valueType:`sourceSelect`,options:[{value:`any`,label:`Any source`},{value:`pipeline`,label:`Pipeline`},{value:`onboard`,label:`Onboard (camera)`},{value:`sensor`,label:`Sensor`},{value:`audio`,label:`Audio marker`}],operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P1`,description:`pipeline / onboard / sensor / audio; a record with no stamped source counts as pipeline.`},{id:`deviceState`,group:`scope`,label:`Device state`,valueType:`deviceState`,operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P2`,description:`Only fire while another device is in one of the chosen states — the alarm armed, a switch on, a contact closed. A state that cannot be read does NOT fire.`},{id:`scene`,group:`scope`,label:`Scene state`,valueType:`scene`,operator:`in`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`],phase:`P3`,description:`Only fire while a scene is matched or diverged.`},{id:`sensorKinds`,group:`device`,label:`Sensor kinds`,valueType:`stringList`,operator:`in`,appliesTo:[`device-event`],phase:`P1`,description:`Sensor/control taxonomy kinds (doorbell / contact / button / …) matched against the persisted device event.`},{id:`eventTypeTokens`,group:`device`,label:`Event-type tokens`,valueType:`stringList`,operator:`in`,appliesTo:[`device-event`],phase:`P1`,description:`Raw device event-type tokens (e.g. doorbell press / press_long) from the event-emitter slice; absent on doorbell-pulse / passive sensors.`},{id:`sensorTransition`,group:`device`,label:`Notify when`,valueType:`sensorTransition`,options:[{value:``,label:`It triggers and when it clears`,hint:`Every change: water detected, and back to dry.`},{value:`raised`,label:`Only when it triggers`,hint:`Water detected, smoke, a contact opening — never the return to normal.`},{value:`cleared`,label:`Only when it clears`,hint:`Back to dry, smoke gone, a contact closing — never the alert itself.`}],operator:`in`,appliesTo:[`device-event`],phase:`P2`,description:`Fire on one edge of a boolean sensor. Offered only when every chosen sensor kind raises and clears; a reading that cannot be placed still notifies.`},{id:`packagePhase`,group:`package`,label:`Package phase`,valueType:`packagePhase`,options:[{value:`delivered`,label:`Delivered`},{value:`picked-up`,label:`Picked up`},{value:`both`,label:`Both`}],operator:`in`,appliesTo:[`package-event`],phase:`P1`,description:`Delivered / picked-up / both.`},{id:`occupancy`,group:`occupancy`,label:`Occupancy`,valueType:`occupancy`,operator:`anyOf`,appliesTo:[`device-event`],phase:`P1`,description:`ZoneAnalytics occupancy edge (optionally zone/class-scoped): count crosses the threshold and holds for sustainSeconds. Fail-closed on a missing snapshot.`},{id:`audio`,group:`audio`,label:`Sound`,valueType:`audio`,operator:`anyOf`,appliesTo:[`immediate`],phase:`P2`,description:`Fires when at least hitPercent% of the samples in a samplingSeconds window are hits — a hit clears the dBFS floor AND carries one of the chosen sounds. Both filters are optional and independent, but naming NEITHER never matches: every sample would be a hit, so the engine refuses rather than notifying on silence. dBFS is negative-going (0 = full scale, -96 = silence).`},{id:`customZones`,group:`zones`,label:`Custom zones`,valueType:`polygonDraw`,operator:`anyOf`,appliesTo:[`immediate`,`track-end`,`package-event`],phase:`P1`,description:`User-drawn polygons; a detection whose bbox overlaps any polygon matches.`},{id:`schedule`,group:`schedule`,label:`Schedule`,valueType:`schedule`,operator:`withinSchedule`,appliesTo:[`immediate`,`track-end`,`device-event`,`package-event`,`system-event`],phase:`P1`,description:`Weekly activation windows (invertible); absent = always active.`}],GD=x([`pending`,`sent`,`dead`]),KD=x([`object-event`,`track-end`,`device-event`,`package-event`,`system-event`]),qD=d({className:l(),label:l().optional(),confidence:i().optional(),zones:S(l()),timestamp:i(),systemEvent:d({kind:bE,subject:l(),title:l(),body:l(),data:y(l(),o())}).optional()}),JD=d({id:l(),ruleId:l(),ruleName:l(),delivery:yE,targetId:l(),deviceId:i(),recordKind:KD,recordId:l(),trackId:l().optional(),status:GD,attempts:i().int(),createdAt:i(),updatedAt:i(),error:l().optional(),subject:qD,artifactIds:S(l().min(1)).optional()}),YD=100,XD=500,ZD=d({ruleId:l().optional(),deviceId:i().optional(),status:GD.optional(),since:i().optional(),until:i().optional(),limit:i().int().min(1).max(500).default(100)}),QD=d({ruleId:l(),lastAt:i(),status:GD,deviceId:i()}),$D=d({runs:S(QD),horizonMs:i().nonnegative().nullable()}),eO=x([`rule`,`device`,`all`]),tO=d({scope:eO,ruleId:l().optional(),deviceId:i().int().optional(),classes:S(l().min(1)).min(1).optional(),durationMinutes:i().int().min(1).max(ME),global:C().optional(),summary:C().optional()}),nO=d({id:l(),userId:l(),scope:eO,ruleId:l().optional(),deviceId:i().int().optional(),classes:S(l().min(1)).min(1).optional(),startedAt:i(),expiresAt:i(),global:C(),summary:C(),digestSentAt:i().optional()}),rO=d({snoozeId:l(),targetId:l(),ruleId:l(),ruleName:l(),deviceId:i().int(),count:i().int(),firstAt:i(),lastAt:i()}),iO=600,aO=3600,oO=200,sO=i().int().min(0).max(600),cO=i().int().min(0).max(aO),lO=e=>new Set(e.map(e=>e.mode)).size===e.length,uO=x([`rearmAfter`,`disableAfter`,`doNothing`]),dO=d({mode:q,exitDelaySec:sO.optional(),entryDelaySec:sO.optional(),triggeredDurationSec:cO.optional(),postTriggeredAction:uO.optional(),schedule:FE.optional(),notifyDuringEntryDelay:C().optional(),notifySensorRewatched:C().optional(),notifySensorIgnored:C().optional()}),fO=S(dO).max(8).refine(lO,{message:`modeDelays: at most one entry per arm mode`}),pO=d({mode:q,exitDelaySec:sO.nullable().optional(),entryDelaySec:sO.nullable().optional(),triggeredDurationSec:cO.nullable().optional(),postTriggeredAction:uO.nullable().optional(),schedule:FE.nullable().optional(),notifyDuringEntryDelay:C().nullable().optional(),notifySensorRewatched:C().nullable().optional(),notifySensorIgnored:C().nullable().optional()}),mO=S(pO).max(8).refine(lO,{message:`modeDelays: at most one edit per arm mode`}),hO=d({mode:q,deviceId:i().int().positive(),nonBlocking:C()}),gO=d({mode:q,deviceId:i().int().positive(),blocking:C()}),_O=d({mode:q,deviceId:i().int().positive(),secureOnArm:C()}),vO=d({mode:q,deviceIds:S(i().int()).max(200)}),yO=vO,bO=vO,xO=vO,SO=S(yO).max(8).refine(lO,{message:`nonBlocking: at most one list per arm mode`}),CO=S(bO).max(8).refine(lO,{message:`blocking: at most one list per arm mode`}),wO=S(xO).max(8).refine(lO,{message:`secureOnArmOff: at most one list per arm mode`}),TO=d({exitDelaySec:sO,entryDelaySec:sO,triggeredDurationSec:cO,postTriggeredAction:uO.optional(),announceArm:C().optional(),announceTargets:S(l().min(1)).max(16),nonBlocking:SO.default([]),blocking:CO.default([]),secureOnArmOff:wO.default([]),modeDelays:fO.default([])}),EO=d({id:l().min(1).max(64),name:l().min(1).max(64),isDefault:C()}),DO=d({activeId:l().min(1),items:S(EO).min(1)}),OO=d({name:l().min(1).max(64),cloneFromId:l().min(1).max(64).optional()}),kO=d({id:l().min(1).max(64),name:l().min(1).max(64)}),AO=d({id:l().min(1).max(64)}),jO=TO.extend({nonBlocking:SO,blocking:CO,secureOnArmOff:wO,modeDelays:mO,nonBlockingEdit:hO,blockingEdit:gO,secureOnArmEdit:_O}).partial().refine(e=>e.nonBlocking===void 0||e.nonBlockingEdit===void 0,{message:`nonBlocking and nonBlockingEdit are exclusive — send the whole lists or one edit`}).refine(e=>e.blocking===void 0||e.blockingEdit===void 0,{message:`blocking and blockingEdit are exclusive — send the whole lists or one edit`}).refine(e=>e.secureOnArmOff===void 0||e.secureOnArmEdit===void 0,{message:`secureOnArmOff and secureOnArmEdit are exclusive — send the whole lists or one edit`}),MO=x([`muted`,`detection-off`,`offline`]),NO=d({deviceId:i().int(),reason:MO}),PO=d({mode:q,ruleCount:i().int().min(0),allDevices:C(),deviceIds:S(i().int()),allDevicesExcept:S(i().int()).default([]),skippedDevices:S(NO).default([])}),FO=d({deviceId:i().int(),name:l(),state:l(),blocking:C()}),IO=d({deviceId:i().int(),name:l(),phase:x([`open`,`closed`])}),LO=d({mode:q,devices:S(FO),unknown:S(i().int())}),RO=d({state:sE,targetMode:q.nullable(),availableModes:S(q),openings:S(LO),exclusions:S(IO)}),zO=d({deviceId:i().int().nullable(),settings:TO,profiles:DO.optional(),coverage:S(PO),live:RO.optional()}),BO=500,VO=x([`open`,`closed`,`unknown`,`not-opening`]),HO=d({deviceId:i().int().positive(),reading:VO,state:l().nullable(),unknownWhy:x([`read-failed`,`unknown-word`]).nullable(),online:C().nullable(),controllable:C().default(!1)}),UO=d({deviceIds:S(i().int().positive()).max(500)}),WO=d({sensors:S(HO),readAt:i().int().nonnegative()}),GO=60,KO=d({deviceId:i().int().nonnegative().optional(),seconds:i().min(0).max(60),profile:E.optional(),ruleId:l(),ruleName:l(),reason:x([`window`,`occupancy`])}),qO=d({rulesLoaded:C(),asks:S(KO).readonly()}),JO={name:`notification-rules`,scope:`system`,mode:`singleton`,methods:{listRules:D(d({}),d({rules:S(OD)}),{auth:`admin`}),getRule:D(d({ruleId:l()}),d({rule:OD.nullable()}),{auth:`admin`}),createRule:D(d({rule:xD}),d({rule:OD}),{kind:`mutation`,auth:`admin`,caller:`required`}),updateRule:D(DD,d({rule:OD}),{kind:`mutation`,auth:`admin`,caller:`required`}),deleteRule:D(d({ruleId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setRuleEnabled:D(d({ruleId:l(),enabled:C()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),listSequences:D(d({}),d({sequences:S(qE)}),{auth:`admin`}),getSequence:D(d({sequenceId:l().min(1)}),d({sequence:qE.nullable()}),{auth:`admin`}),createSequence:D(d({sequence:JE}),d({sequence:qE}),{kind:`mutation`,auth:`admin`}),updateSequence:D(d({sequenceId:l().min(1),sequence:JE}),d({sequence:qE}),{kind:`mutation`,auth:`admin`}),deleteSequence:D(d({sequenceId:l().min(1)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getClipRetentionAsks:D(d({}),qO,{auth:`admin`}),listDeviceMutes:D(d({}),d({mutedDeviceIds:S(i().int()).readonly()}),{auth:`admin`}),setDeviceMuted:D(d({deviceId:i().int(),muted:C()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),testRule:D(d({rule:xD,lookbackMinutes:i().int().min(1).max(1440).default(60)}),d({results:S(ND)}),{kind:`mutation`,auth:`admin`}),previewStateSummary:D(d({rule:xD}),MD,{kind:`mutation`,auth:`admin`,access:`view`}),getConditionCatalog:D(d({}),d({catalog:S(UD),taxonomy:rE.optional()})),getTemplateCatalog:D(d({}),d({vars:S(zD)})),previewTemplate:D(VD,HD,{kind:`mutation`,access:`view`}),getHistory:D(d({filter:ZD.default({limit:100})}),d({entries:S(JD)}),{auth:`admin`}),getRuleLastRuns:D(d({}),$D,{auth:`admin`}),resolveArtifactUrl:D(d({artifactId:l().min(1)}),d({url:l().nullable()}),{auth:`admin`}),listSnoozes:D(d({}),d({snoozes:S(nO)}),{caller:`required`}),createSnooze:D(d({snooze:tO}),d({snooze:nO}),{kind:`mutation`,caller:`required`}),cancelSnooze:D(d({snoozeId:l()}),d({success:m(!0)}),{kind:`mutation`,caller:`required`}),getAlarmConfig:D(d({}),zO,{auth:`admin`}),setAlarmConfig:D(d({patch:jO}),zO,{kind:`mutation`,auth:`admin`}),createAlarmProfile:D(OO,zO,{kind:`mutation`,auth:`admin`}),renameAlarmProfile:D(kO,zO,{kind:`mutation`,auth:`admin`}),deleteAlarmProfile:D(AO,zO,{kind:`mutation`,auth:`admin`}),activateAlarmProfile:D(AO,zO,{kind:`mutation`,auth:`admin`}),getAlarmSensors:D(UO,WO,{auth:`admin`})}},YO=x([`view`,`create`,`delete`]),XO=f([m(`*`),S(l())]),ZO=y(l(),f([m(`*`),S(l())])),QO=x([`device`,`system`]),$O=p(`kind`,[d({kind:m(`all`)}),d({kind:m(`ids`),ids:S(i().int()).min(1)}),d({kind:m(`types`),types:S(x(k)).min(1)}),d({kind:m(`locations`),locations:S(l().min(1)).min(1)})]),ek=d({type:m(`device`),selector:$O,access:S(YO).min(1),includeLinked:C().optional()});function tk(e){if(typeof e!=`object`||!e||Array.isArray(e)||Reflect.get(e,`type`)!==`device`||Reflect.get(e,`selector`)!==void 0)return e;let t=Reflect.get(e,`targets`);return Array.isArray(t)?{type:`device`,selector:{kind:`ids`,ids:t.map(e=>typeof e==`string`?Number(e):e).filter(e=>typeof e==`number`&&Number.isInteger(e))},access:Reflect.get(e,`access`)}:e}var J=n(tk,p(`type`,[d({type:m(`category`),target:QO,access:S(YO).min(1)}),d({type:m(`capability`),target:l(),access:S(YO).min(1)}),d({type:m(`addon`),target:l(),access:S(YO).min(1)}),ek])),nk=d({id:l(),username:l(),passwordHash:l(),isAdmin:C().default(!1),allowedProviders:XO,allowedDevices:ZO,scopes:S(J).default([]),createdAt:i(),updatedAt:i()}),rk=d({id:l(),label:l(),isAdmin:C().default(!1),allowedProviders:XO,allowedDevices:ZO,tokenHash:l(),tokenPrefix:l(),createdAt:i(),lastUsedAt:i().optional()}),ik=d({id:l(),userId:l(),name:l(),tokenHash:l(),tokenPrefix:l(),scopes:S(J),expiresAt:i().nullish(),lastUsedAt:i().nullish(),createdAt:i()}),ak=d({integrationId:l(),displayName:l(),requestedScopes:S(J),allowedRedirectPrefixes:S(l()).min(1),allowedPrivateHostPaths:S(l()).optional(),requiresPkce:C().optional(),hubUrl:l().optional(),refreshTokenTtlSec:f([i().int().positive(),m(`never`)]).optional()}),ok={name:`oauth-integration`,scope:`system`,mode:`collection`,internal:!0,methods:{getDescriptor:D(v(),ak,{auth:`admin`})}},sk=o(),ck=d({id:l().min(1),displayName:l(),icon:l(),issuerUrl:l(),clientId:l(),configured:C(),formValues:y(l(),o()).optional()}),lk=d({id:l().min(1),displayName:l().min(1),icon:l().optional(),issuerUrl:l().optional(),clientId:l().optional(),clientSecret:f([l(),d({$secretClear:m(!0)})]).optional(),redirectUri:l().optional(),scopes:l().optional(),usernameClaim:x([`preferred_username`,`email`,`sub`]).optional()}),uk={name:`oidc-connections`,scope:`system`,mode:`singleton`,methods:{connectionFormSchema:D(d({}),sk,{auth:`admin`}),listConnections:D(d({}),S(ck).readonly(),{auth:`admin`}),createConnection:D(d({id:l().min(1).regex(/^[a-z0-9][a-z0-9-]{0,63}$/,`id must be a lowercase slug`),displayName:l().min(1)}),d({id:l()}),{kind:`mutation`,auth:`admin`}),updateConnection:D(lk,d({ok:m(!0)}),{kind:`mutation`,auth:`admin`}),deleteConnection:D(d({id:l().min(1)}),d({ok:m(!0)}),{kind:`mutation`,auth:`admin`})}},dk=p(`kind`,[d({kind:m(`camera`)}),d({kind:m(`sensor`),deviceId:i().int().positive()})]),fk=Object.freeze({kind:`camera`});function pk(e){if(e===void 0)return{triggeredBy:fk,malformed:!1};let t=dk.safeParse(e);return t.success?{triggeredBy:t.data,malformed:!1}:{triggeredBy:fk,malformed:!0}}var mk=`cameraSensors`,hk=8,gk=d({addonId:l().min(1),stableId:l().min(1)});function _k(e){return`${e.addonId}/${e.stableId}`}var vk=x([`in-addition`,`confirm`,`replace`]),yk=`in-addition`,bk=gk.extend({mode:vk.default(yk)}),xk=d({sensors:S(bk).min(1).max(8)}).superRefine((e,t)=>{let n=new Set;e.sensors.forEach((e,r)=>{let i=_k(e);n.has(i)&&t.addIssue({code:`custom`,path:[`sensors`,r],message:`duplicate camera sensor ${i}`}),n.add(i)})}),Sk={addonId:l(),stableId:l(),mode:vk.default(yk)},Ck=p(`state`,[d({...Sk,state:m(`ready`),deviceId:i(),name:l(),caps:S(l()).readonly()}),d({...Sk,state:m(`offline`),deviceId:i(),name:l(),reason:x([`offline`,`disabled`])}),d({...Sk,state:m(`missing`),reason:l()}),d({...Sk,state:m(`unsupported`),deviceId:i(),name:l(),reason:l()}),d({...Sk,state:m(`unreadable`),reason:l()})]),wk=x([`onboard-not-listed`,`no-active-detection`]),Tk=x([`always`,`when-confirmed`,`never`]),Ek=x([`provider-not-split`]),Dk=d({detected:C(),atMs:i()}),Ok=p(`state`,[d({state:m(`not-configured`),cameraLevel:Dk.optional()}),d({state:m(`unreadable`),reason:l(),cameraLevel:Dk.optional()}),d({state:m(`configured`),cameraLevel:Dk.optional(),sensors:S(Ck).readonly(),cameraMotion:Tk.optional(),notForwarded:wk.optional(),notEnforced:Ek.optional()})]),kk=Object.freeze({state:`unreadable`,reason:`camera sensor mappings not loaded`}),Ak=[`owner-not-ready`,`store-read-failed`,`three-way-read-unavailable`,`invalid-stored`,`not-cluster-scoped`],jk=[{stepId:`face-embedding`,label:`Face recognition model`,defaultModelId:`auraface-r100`,indexName:`the enrolled face gallery`,options:[{id:`auraface-r100`,label:`AuraFace R100`}]},{stepId:`clip-embedding`,label:`Semantic search model`,defaultModelId:`siglip2-b16-224`,indexName:`the object semantic-search index`,options:[{id:`siglip2-b16-224`,label:`SigLIP2 B/16 (Apache-2.0)`}]}],Mk=`cluster-step-models`;function Nk(e){return`clusterModel:${e}`}function Pk(e){return jk.some(t=>t.stepId===e)}var Fk=Object.freeze(Object.fromEntries(jk.map(e=>[e.stepId,e.defaultModelId])));function Ik(e){return e==null||e===``?{kind:`absent`}:typeof e==`string`?{kind:`chosen`,modelId:e}:{kind:`invalid`,value:e}}function Lk(e){let t=[];for(let n of jk){let r=Ik(e[Nk(n.stepId)]);r.kind===`invalid`&&t.push({stepId:n.stepId,value:r.value})}return t}function Rk(e){let t={};for(let n of jk){let r=Ik(e[Nk(n.stepId)]);t[n.stepId]=r.kind===`chosen`?r.modelId:n.defaultModelId}return t}function zk(e){return typeof e==`object`&&!!e&&`key`in e}function Bk(e){return e===null?Fk:Rk(Uk(e,Hk()))}function Vk(e){return e===null?[]:Lk(Uk(e,Hk()))}function Hk(){return new Set(jk.map(e=>Nk(e.stepId)))}function Uk(e,t){let n={};for(let r of e.sections)for(let e of r.fields)!zk(e)||typeof e.key!=`string`||t.has(e.key)&&(n[e.key]=e.value);return n}function Wk(e,t){let n=jk.find(t=>t.stepId===e);if(n===void 0)return null;let r=t[e];return r!==void 0&&r!==``?r:n.defaultModelId}var Gk=24,Kk=[{stepId:`face-embedding`,key:`minLandmarkFaceSize`,label:`Min face size to embed (detection-frame px)`,description:`Faces smaller than this in the small frame the detector sees are not embedded, so they can never be recognised. Below it the face cannot be aligned reliably and a bad embedding matches everyone. Same value on every node. 0 = no limit.`,type:`slider`,min:0,max:64,step:2,default:24}];function qk(e,t){return`clusterStepSetting:${e}:${t}`}function Jk(e){return Kk.filter(t=>t.stepId===e)}var Yk=i().finite();function Xk(e){let t={};for(let n of Kk){let r=Yk.safeParse(e[qk(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 Zk=Xk({});function Qk(e){return e===null?Zk:Xk(Uk(e,new Set(Kk.map(e=>qk(e.stepId,e.key)))))}function $k(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 eA=x([`new`,`entered`,`left`,`moving`,`idle`]),tA=x([`motion`,`object`,`audio`]),nA=p(`kind`,[dE,fE]),rA=x([`motion`,`audio`,`person`,`vehicle`,`animal`,`door`,`pir`,`smoke`,`water`,`button`,`package`,`generic`]),iA=x([`motion`,`audio`,`detection`,`sensor`,`control`,`custom`,`package`]),aA=x([`macro`,`sub`]),oA=d({kind:l(),labelKey:l(),label:l(),color:l(),iconId:l(),icon:rA,category:iA,parentKind:l().nullable(),level:aA,source:d({capName:l(),deviceId:i()})}),sA=d({deviceId:i(),kinds:S(oA).readonly()}),cA=d({id:l(),deviceId:i(),sourceDeviceId:i(),kind:l(),value:y(l(),o()).nullable(),timestamp:i()}),lA=d({x:i(),y:i(),timestamp:i(),bbox:sh,source:x([`frame`,`recovery`]).optional(),score:i().optional()}),uA=d({timestamp:i(),position:lA,mediaId:i().int()}),dA=d({minX:i(),minY:i(),maxX:i(),maxY:i()}),fA=x([`full`,`slim`]),pA=d({label:l(),peakScore:i(),count:i(),firstAt:i(),lastAt:i()}),mA=x([`pipeline`,`onboard`,`sensor`,`audio`]),hA=x([`none`,`staging`,`trained`]),gA=500,_A={markForTrain:C().optional(),debug:C().optional(),debugNote:l().max(500).optional(),favourited:C().optional()},vA={retrainStatus:hA.optional()},yA=d(_A),bA=d({trackId:l(),markForTrain:C(),debug:C(),debugNote:l(),favourited:C(),retrainStatus:hA}),xA=f([m(1),m(2)]),SA=d({stepId:l(),modelId:l().optional(),decidedAt:i(),identityId:l().optional()}),CA={label:l().optional(),labelScore:i().optional(),labelMeta:SA.optional(),subLabel:l().optional(),subLabelScore:i().optional(),subLabelMeta:SA.optional()},wA=d({deviceId:i(),tracks:i().int(),files:i().int(),bytes:i().int()}),TA=d({generatedAt:i(),trackCount:i().int(),fileCount:i().int(),byteCount:i().int(),truncated:C(),devices:S(wA).readonly()}),EA=d({trackId:l(),deviceId:i(),className:l(),...CA,producingDeviceName:l().optional(),source:mA.optional(),firstSeen:i(),lastSeen:i(),positions:S(lA).readonly(),snapshots:S(uA).readonly(),zonesVisited:S(l()).readonly(),zoneNames:S(l()).readonly().optional(),classes:S(l()).readonly().optional(),totalDistance:i(),state:eA,active:C(),importance:i().optional(),bestEventId:l().optional(),importanceReason:l().optional(),audioLabels:S(pA).readonly().optional(),envelope:dA.optional(),hasFace:C().optional(),hasEmbeddedFace:C().optional(),hasRider:C().optional(),previewMissReason:l().optional(),modelId:l().optional(),frameWidth:i().optional(),frameHeight:i().optional(),..._A,...vA}),DA={id:i().int(),deviceId:i(),timestamp:i()},OA=d({...DA,kind:m(`motion`),regionCount:i(),regions:S(d({bbox:sh,pixelCount:i(),intensity:i()})).readonly().optional(),frameWidth:i().optional(),frameHeight:i().optional(),mediaUrl:l().optional(),triggeredBy:dk.optional(),durationMs:i().nullable().optional(),edges:S(i()).readonly().optional()}),kA=x([`pipeline`,`onboard`]),AA=x([`enter`,`exit`]),jA=d({direction:AA,zoneId:l(),zoneName:l().optional()}),MA=d({zoneId:l(),zoneName:l().optional(),overlapPct:i()}),NA=d({...DA,kind:m(`object`),source:kA.optional(),frameId:l().optional(),idempotencyKey:l().optional(),trackId:l().optional(),className:l(),...CA,confidence:i().optional(),bbox:sh.optional(),zones:S(l()).readonly().optional(),zoneOverlaps:S(MA).readonly().optional(),spawnRefused:l().optional(),state:eA.optional(),zoneCrossing:jA.optional(),frameWidth:i().optional(),frameHeight:i().optional(),mediaId:i().int().optional(),keyFrameMediaId:i().int().optional(),mediaUrl:l().optional(),observedAt:i().optional(),importance:i().optional()}),PA=d({...DA,kind:m(`audio`),rms:i(),dbfs:i(),classification:d({className:l(),originalClass:l().optional(),score:i()}).optional(),classifyOutcome:ph.optional(),mediaUrl:l().optional()}),FA=x([`crop`,`thumbnail`,`snapshot`,`firstFrame`,`lastFrame`,`fullFrame`,`fullFrameBoxed`,`faceCrop`,`plateCrop`,`keyFrame`,`keyFrameSmall`,`thumbnailSmall`,`confirmationCrop`,`debugCrop`,`sceneFrame`,`lastSceneFrame`]),IA=d({mediaId:i().int(),kind:FA,sizeBytes:i(),timestamp:i()}),LA=IA.extend({url:l(),base64:l()}),RA=LA.omit({base64:!0}),zA=x([`person`,`vehicle`,`animal`,`package`,`face`,`plate`]),BA=x([`subject`,`model_error`]),VA=x([`operator`,`assist`,`pipeline`,`llm`]),HA=d({x:i(),y:i(),w:i(),h:i()}),UA=d({id:l(),trackId:l().optional(),deviceId:i(),mediaKey:l(),bbox:HA,macroClass:zA,label:l().optional(),subLabel:l().optional(),kind:BA,source:VA,assistModelId:l().optional(),assistScore:i().optional(),exportedInBatch:l().optional(),createdAt:i()}),WA=UA.omit({id:!0,trackId:!0,deviceId:!0,mediaKey:!0,createdAt:!0,exportedInBatch:!0}),GA=d({trackId:l(),deviceId:i(),className:l(),label:l().optional(),firstSeen:i(),lastSeen:i(),frameCount:i().int(),annotationCount:i().int()}),KA=d({mediaId:i().int(),kind:FA,timestamp:i(),sizeBytes:i().int(),copied:C()}),qA=d({bbox:HA,macroClass:zA,label:l().optional(),subLabel:l().optional(),score:i().optional(),modelId:l().optional(),trackId:l(),basis:x([`subject-box`,`position`]),deltaMs:i()}),JA=x([`track`,`recording`]),YA=d({frameId:l(),deviceId:i(),origin:JA,trackId:l().optional(),sourceMediaId:i().int().optional(),epochMs:i().optional(),sourceKind:FA,sizeBytes:i().int(),width:i().int(),height:i().int(),copiedAt:i(),capturedAt:i().optional(),complete:C(),pipelineBoxes:S(qA).readonly().optional(),collectionIds:S(l()).readonly().optional()}),XA=x([`source-missing`,`unreadable-image`,`write-failed`]),ZA=d({copied:S(YA).readonly(),refused:S(d({sourceMediaId:i().int(),reason:XA})).readonly()}),QA=d({candidates:S(KA).readonly(),copies:S(YA).readonly(),autoPickMediaId:i().int().optional()}),$A=x([`unannotated`,`annotated`,`complete`]),ej=d({workState:$A.optional(),deviceIds:S(i()).max(500).optional(),collectionId:l().optional(),classes:S(zA).optional(),page:i().int().positive().default(1),pageSize:i().int().positive().max(100).default(50)}),tj=YA.extend({workState:$A}),nj=d({frames:S(tj).readonly(),total:i().int().nonnegative(),page:i().int().positive(),pageSize:i().int().positive()}),rj=d({deviceId:i(),unannotated:i().int().nonnegative(),annotated:i().int().nonnegative(),complete:i().int().nonnegative(),pctOfCorpus:i().min(0).max(1).nullable()}),ij=d({total:i().int().nonnegative(),unannotated:i().int().nonnegative(),annotated:i().int().nonnegative(),complete:i().int().nonnegative(),cameras:S(rj).readonly()}),aj=d({deviceIds:S(i()).optional(),frameIds:S(l()).max(2e4).optional(),collectionIds:S(l()).max(200).optional(),collectionId:l().optional(),batchId:l().optional(),completeOnly:C().optional(),workState:$A.optional(),classes:S(zA).optional()}),oj=x([`frames`,`crops`]),sj=d({kind:m(`http`),method:x([`PUT`,`POST`]),url:l().url(),headers:y(l(),l()).optional()}),cj=d({batchId:l(),frames:i().int(),crops:i().int(),annotations:i().int(),missing:i().int(),bytes:i().int(),sha256:l(),status:i().int()}),lj=p(`kind`,[d({kind:m(`package`),zone:HA.optional()}),d({kind:m(`objects`),modelId:l(),minScore:i().optional()})]),uj=p(`kind`,[d({kind:m(`proposed`),modelId:l(),stepId:l(),minScore:i(),proposals:S(WA).readonly(),belowThreshold:i().int()}),d({kind:m(`refused`),reason:l(),detail:l().optional()})]),dj=d({id:l(),name:l(),createdAt:i(),frameCount:i().int()}),fj=p(`kind`,[d({kind:m(`created`),collection:dj}),d({kind:m(`refused`),reason:x([`empty-name`,`duplicate-name`])})]),pj=p(`kind`,[d({kind:m(`renamed`),collection:dj}),d({kind:m(`refused`),reason:x([`empty-name`,`duplicate-name`,`unknown-collection`])})]),mj=p(`kind`,[d({kind:m(`added`),collectionId:l(),frame:YA,reused:C()}),d({kind:m(`refused`),reason:x([`unknown-collection`,`still-unavailable`,`still-busy`,`unreadable-image`,`write-failed`]),detail:l().optional()})]),hj=d({id:l(),name:l(),model:l(),kind:l(),leavesHouse:C()}),gj=WA.extend({reason:l()}),_j=d({ref:l(),verdict:x([`confirmed`,`wrong-class`,`not-an-object`,`uncertain`]),suggestedClass:zA.optional(),reason:l()}),vj=p(`kind`,[d({kind:m(`proposed`),profileId:l(),model:l(),leftHouse:C(),proposals:S(gj).readonly(),reviews:S(_j).readonly(),rejected:i().int()}),d({kind:m(`refused`),reason:x([`unknown-frame`,`unreadable-frame`,`unknown-profile`,`profile-disabled`,`no-vision`,`cloud-not-confirmed`,`llm-error`,`malformed-answer`]),detail:l().optional()})]),yj=d({deviceIds:S(i()).readonly().optional(),collectionIds:S(l()).max(200).readonly().optional(),frameIds:S(l()).max(2e4).readonly().optional()}),bj=d({frames:i().int(),completeFrames:i().int(),completeness:i(),subjects:i().int(),modelErrors:i().int(),hardNegatives:i().int(),cells:S(d({macroClass:l(),deviceId:i(),lighting:x([`day`,`night`,`unknown`]),subjects:i().int(),frames:i().int()})).readonly(),cameras:S(d({deviceId:i(),frames:i().int(),completeFrames:i().int()})).readonly()}),xj=d({id:l(),name:l(),createdAt:i(),selection:yj,layout:oj,completeOnly:C(),frameCount:i().int(),annotationHash:l(),manifestSchema:l(),stats:bj}),Sj=d({collectionIds:S(l()).min(1),workState:x([`complete`,`annotated_or_complete`,`any_annotated`]).default(`complete`)}),Cj=p(`kind`,[d({kind:m(`resolved`),frameIds:S(l()).max(2e4).readonly(),stats:bj,annotationHash:l(),layout:oj}),d({kind:m(`refused`),reason:x([`unknown-collection`,`no-frames`]),detail:l()})]),wj=d({trackId:l(),retrainStatus:hA,changed:C(),reason:x([`unknown-track`,`no-frames-copied`,`not-staging`,`not-trained`,`unchanged`]).optional()}),Tj=1e3,Ej=5e3,Dj=d({deviceId:i(),since:i().optional(),until:i().optional(),limit:i().int().min(1).max(Ej).default(Tj),projection:x([`full`,`slim`]).optional()}),Oj=Dj.extend({classFilter:l().optional()}),kj=d({deviceIds:S(i()),since:i().optional(),until:i().optional(),limit:i().int().min(1).max(1e3).default(200),cursor:l().optional(),projection:fA.optional(),includeStationary:C().optional(),classes:S(l()).optional(),excludeSources:S(mA).optional()}),Aj=d({tracks:S(EA).readonly(),nextCursor:l().nullable()}),jj=50,Mj=200,Nj=d({deviceId:i(),since:i(),until:i(),limit:i().int().min(1).max(Mj).default(jj),minImportance:i().min(0).max(1).optional(),classFilter:l().optional()}),Pj=d({id:l(),trackId:l(),timestamp:i(),className:l(),...CA,importance:i(),bestEventId:l(),windowMs:i().optional(),audioLabels:S(pA).readonly().optional(),..._A,...vA}),Fj=d({deviceIds:S(i()).min(1).max(200),since:i(),until:i(),limit:i().int().min(1).max(Mj).default(jj),minImportance:i().min(0).max(1).optional(),classFilter:l().optional()}),Ij=d({deviceId:i(),events:S(Pj).readonly()}),Lj=d({bucketStart:i(),motion:i().int(),object:i().int(),audio:i().int(),audioDbfs:i().optional()}),Rj=200,zj=d({deviceId:i(),read:x([`read`,`unreadable`]),buckets:S(Lj).readonly()}),Bj=d({trackId:l(),className:l(),confidence:i(),bbox:sh,zones:S(l()).readonly(),state:eA}),Vj=a({id:l(),kind:x([`first-level`,`detail`]),macroClass:l(),score:i(),bbox:d({x:i(),y:i(),width:i(),height:i()}),labels:S(a({label:l(),score:i()})).readonly(),parentId:l().optional()}),Hj=NA.extend({score:i()}),Uj=d({text:l(),deviceId:i().optional(),since:i().optional(),until:i().optional(),classFilter:l().optional(),limit:i().default(50),minScore:i().min(0).max(1).optional(),strictness:Zf.optional(),modelId:l().min(1).optional()}),Wj=d({tracks:i().int(),events:i().int(),media:i().int(),faces:i().int(),plates:i().int(),embeddings:i().int()}),Gj=d({mediaDropped:i().int(),tracks:i().int(),events:i().int()}),Kj=d({deviceId:i(),rows:i().int(),bytes:i().int()}),qj=d({totalRows:i().int(),totalBytes:i().int(),devices:S(Kj).readonly()}),Jj=d({kind:FA,rows:i().int(),bytes:i().int()}),Yj=d({totalRows:i().int(),totalBytes:i().int(),kinds:S(Jj).readonly(),unaccountedRows:i().int(),unaccountedBytes:i().int()}),Xj=d({motion:i().int(),object:i().int(),audio:i().int()}),Zj=d({deviceId:i().optional(),since:i().optional(),until:i().optional(),maxTracks:i().int().positive().optional(),executeOnNodeId:l().optional(),pacingMs:i().int().nonnegative().optional(),force:C().optional()}),Qj=d({deleted:i(),failedIndexes:S(l()).optional()}),$j=x([`stores-unavailable`,...Ak,`method-unavailable`,`read-failed`,`reads-disagree`,`not-a-clip-model`,`force-requires-max-tracks`]),eM=d({started:C(),alreadyRunning:C(),refusal:$j.optional(),modelId:l().optional(),index:l().optional()}),tM=d({running:C(),scanned:i(),rebuilt:i(),missingKeyFrame:i(),missingEvent:i(),missingBbox:i(),boxSource:d({subjectBox:i(),positions:i(),event:i(),refused:i()}),alreadyInSpace:i(),force:C().nullable(),forcedInSpace:i(),notRunnable:i(),noCapableNode:i(),failed:i(),complete:C().nullable(),startedAtMs:i().nullable(),finishedAtMs:i().nullable(),error:l().nullable(),modelId:l().nullable(),index:l().nullable()}),nM=d({started:C(),alreadyRunning:C()}),rM=d({mode:x([`report`,`reclaim`]).default(`report`),scopes:S(x([`motion-still`,`track-filmstrip`])).min(1).optional(),deviceIds:S(i().int()).min(1).optional(),restart:C().optional(),pageSize:i().int().min(50).max(5e3).optional(),maxRowsPerDevice:i().int().min(1).max(5e5).optional(),maxReclaimPerDevice:i().int().min(1).max(5e5).optional(),maxBytesPerRun:i().int().min(1).optional(),budgetMinutes:i().int().min(1).max(720).optional(),throttleBytesPerSec:i().int().min(64*1024).optional(),graceMinutes:i().int().min(1).max(10080).optional()}),iM=d({running:C(),mode:x([`report`,`reclaim`]).nullable(),totalExamined:i(),totalEligible:i(),totalReclaimed:i(),totalBytesReclaimed:i(),totalRefused:i(),devicesDone:i(),complete:C().nullable(),startedAtMs:i().nullable(),finishedAtMs:i().nullable(),error:l().nullable()}),aM=x([`motion`,`audio-dbfs`,`battery`,`occupancy`]),oM=`|`;function sM(e,t){let n=e??``;return t===void 0?n:`${n}|${t}`}function cM(e){let t=e.indexOf(`|`);return t<0?{zoneId:e}:{zoneId:e.slice(0,t),className:e.slice(t+1)}}var lM=d({scope:l(),bucketStart:i().int(),samples:i().int().nonnegative(),sum:i(),min:i(),max:i()}),uM={name:`pipeline-analytics`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:D(d({deviceId:i()}),S(EA).readonly()),getTrack:D(d({deviceId:i(),trackId:l()}),EA.nullable()),listTracks:D(d({deviceId:i(),since:i().optional(),until:i().optional(),limit:i().optional(),zone:nA.optional(),projection:fA.optional(),includeStationary:C().optional(),classes:S(l()).optional(),excludeSources:S(mA).optional()}),S(EA).readonly()),listRecentTracks:D(kj,Aj),clearTracks:D(d({deviceId:i()}),v(),{kind:`mutation`,auth:`admin`}),getMotionEvents:D(Dj,S(OA).readonly()),getObjectEvents:D(Oj,S(NA).readonly()),getAudioEvents:D(Dj,S(PA).readonly()),listEventKinds:D(d({deviceId:i()}),S(oA).readonly()),listEventKindsBatch:D(d({deviceIds:S(i()).min(1).max(200)}),S(sA).readonly()),getSensorEvents:D(d({deviceId:i(),since:i().optional(),until:i().optional(),kinds:S(l()).optional(),limit:i().int().min(1).max(Ej).default(Tj)}),S(cA).readonly()),getKeyEvents:D(Nj,S(Pj).readonly()),getKeyEventsBatch:D(Fj,S(Ij).readonly()),readLongTermSeries:D(d({deviceId:i(),series:aM,scope:l().optional(),from:i(),to:i(),limit:i().int().positive().optional()}),S(lM).readonly()),getEventDensity:D(d({deviceId:i(),since:i(),until:i(),bucketMs:i().int().positive()}),S(Lj).readonly()),getEventDensityBatch:D(d({deviceIds:S(i()).min(1).max(200),since:i(),until:i(),bucketMs:i().int().positive()}),S(zj).readonly()),pruneEventsBefore:D(d({deviceId:i(),cutoffMs:i()}),d({motion:i().int(),object:i().int(),audio:i().int()}),{kind:`mutation`,auth:`admin`}),pruneTracksBefore:D(d({deviceId:i(),cutoffMs:i()}),Wj,{kind:`mutation`,auth:`admin`}),wipeAllAnalytics:D(d({deviceId:i()}),Wj,{kind:`mutation`,auth:`admin`}),reconcileFromDisk:D(d({deviceId:i()}),Gj,{kind:`mutation`,auth:`admin`}),deleteTracks:D(d({deviceId:i(),trackIds:S(l()).min(1)}),d({deleted:i().int(),failed:S(l()).readonly(),sparedMediaIds:S(i().int()).readonly().optional()}),{kind:`mutation`,auth:`admin`}),setTrackFlags:D(d({deviceId:i(),trackId:l(),flags:yA}),bA,{kind:`mutation`}),listArchivedDebugNotes:D(_l,S(gl).readonly(),{kind:`query`}),setTrackRelation:D(El,wl,{kind:`mutation`}),clearTrackRelation:D(Dl,Ol,{kind:`mutation`}),setTrackPurity:D(kl,Al,{kind:`mutation`}),listTrackRelations:D(jl,Ml,{kind:`query`}),listBirthDecisions:D(pl,S(fl).readonly(),{kind:`query`}),getEventStoreFootprint:D(d({}),qj,{kind:`query`,auth:`admin`}),getEventMediaFootprintByKind:D(d({deviceId:i().int().optional()}),Yj,{kind:`query`,auth:`admin`}),pruneEvents:D(d({olderThanMs:i(),reason:Yl.optional()}),Xj,{kind:`mutation`,auth:`admin`}),deleteDeviceEvents:D(d({deviceId:i()}),Xj,{kind:`mutation`,auth:`admin`}),pauseForStorageMigration:D(Iu,d({paused:m(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:D(Iu,d({resumed:m(!0)}),{kind:`mutation`,auth:`admin`}),refreshStorageLocationsForMigration:D(Iu,d({refreshed:m(!0)}),{kind:`mutation`,auth:`admin`}),startStorageMigrationMove:D(Hu,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),getStorageMigrationMoveStatus:D(d({jobId:l()}),Nu.nullable(),{auth:`admin`}),cancelStorageMigrationMove:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),relocateMedia:D(zu,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),countUnstampedEventMedia:D(d({}),Vu,{auth:`admin`}),countRelocatableMedia:D(hd,md,{kind:`query`,auth:`admin`}),listRelocateMediaJobs:D(d({}),S(Nu).readonly(),{kind:`query`,auth:`admin`}),cancelRelocateMedia:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),listOpsLog:D(Zl,S(Xl).readonly(),{kind:`query`,auth:`admin`}),reclaimDebugMedia:D(rM,nM,{kind:`mutation`,auth:`admin`}),getMediaReclaimStatus:D(d({}),iM,{kind:`query`,auth:`admin`}),getTrainingExportSummary:D(d({deviceIds:S(i()).optional()}),TA,{kind:`query`,auth:`admin`}),getTrainingExportUrl:D(d({deviceIds:S(i()).optional()}),d({url:l()}),{kind:`query`,auth:`admin`}),listRetrainStaging:D(d({deviceIds:S(i()).optional(),limit:i().int().min(1).max(500).optional()}),S(GA).readonly(),{kind:`query`,auth:`admin`}),listRetrainCorpusPage:D(ej,nj,{kind:`query`,auth:`admin`}),getRetrainCorpusKpi:D(d({}),ij,{kind:`query`,auth:`admin`}),listRetrainFrames:D(d({trackId:l()}),QA,{kind:`query`,auth:`admin`}),selectRetrainFrames:D(d({deviceId:i(),trackId:l(),mediaIds:S(i().int()).min(1)}),ZA,{kind:`mutation`,auth:`admin`}),deselectRetrainFrame:D(d({deviceId:i(),trackId:l().optional(),frameId:l()}),d({removed:C(),removedAnnotations:i().int()}),{kind:`mutation`,auth:`admin`}),getRetrainFrameImage:D(d({frameId:l()}),d({base64:l(),width:i().int(),height:i().int()}),{kind:`query`,auth:`admin`}),proposeRetrainAnnotations:D(d({deviceId:i(),trackId:l().optional(),frameId:l(),subject:lj,nodeId:l().optional()}),uj,{kind:`mutation`,auth:`admin`}),listRetrainAnnotations:D(d({trackId:l().optional(),frameIds:S(l()).max(2e3).optional()}),S(UA).readonly(),{kind:`query`,auth:`admin`}),saveRetrainAnnotations:D(d({deviceId:i(),trackId:l().optional(),frameId:l(),annotations:S(WA)}),S(UA).readonly(),{kind:`mutation`,auth:`admin`}),completeRetrainTrack:D(d({deviceId:i(),trackId:l()}),wj,{kind:`mutation`,auth:`admin`}),restageRetrainTrack:D(d({deviceId:i(),trackId:l()}),wj,{kind:`mutation`,auth:`admin`}),getRetrainExportUrl:D(aj.extend({layout:oj.optional()}),d({url:l()}),{kind:`query`,auth:`admin`}),setRetrainFrameComplete:D(d({deviceId:i(),trackId:l().optional(),frameId:l(),complete:C()}),YA,{kind:`mutation`,auth:`admin`}),writeRetrainArchive:D(d({filter:aj,layout:oj,target:sj}),cj,{kind:`mutation`,auth:`admin`,timeoutMs:60*6e4}),offerRetrainArchive:D(d({filter:aj,layout:oj}),d({ticket:En,frames:i().int(),annotations:i().int()}),{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),listRetrainAssistProfiles:D(d({}),S(hj).readonly(),{kind:`query`,auth:`admin`}),proposeRetrainAnnotationsWithLlm:D(d({deviceId:i(),trackId:l().optional(),frameId:l(),profileId:l(),classes:S(zA).min(1),boxes:S(d({ref:l(),bbox:HA,macroClass:zA,label:l().optional()})).max(50),allowCloud:C()}),vj,{kind:`mutation`,auth:`admin`,timeoutMs:18e4}),createRetrainCollection:D(d({name:l().max(120)}),fj,{kind:`mutation`,auth:`admin`}),listRetrainCollections:D(d({}),S(dj).readonly(),{kind:`query`,auth:`admin`}),resolveRetrainTrainingCorpus:D(Sj,Cj,{kind:`query`,auth:`admin`,timeoutMs:6e4}),renameRetrainCollection:D(d({id:l(),name:l().max(120)}),pj,{kind:`mutation`,auth:`admin`}),deleteRetrainCollection:D(d({id:l()}),d({deleted:C(),removedFrames:i().int()}),{kind:`mutation`,auth:`admin`}),addRetrainFrameFromRecording:D(d({collectionId:l(),deviceId:i(),epochMs:i()}),mj,{kind:`mutation`,auth:`admin`,timeoutMs:6e4}),addRetrainFramesToCollection:D(d({collectionId:l(),frameIds:S(l()).min(1).max(500)}),d({added:i().int(),alreadyMember:i().int(),unknownFrameIds:S(l()).readonly()}),{kind:`mutation`,auth:`admin`}),removeRetrainFrameFromCollection:D(d({collectionId:l(),frameId:l()}),d({removed:C(),deletedFrame:C()}),{kind:`mutation`,auth:`admin`}),listRetrainCollectionFrames:D(d({collectionId:l()}),S(YA).readonly(),{kind:`query`,auth:`admin`}),getEventMedia:D(d({ownerType:Ss,eventId:i().int(),kind:FA.optional(),deviceId:i()}),S(LA).readonly()),getTrackMedia:D(d({trackId:l(),kinds:S(FA).optional(),deviceId:i()}),S(LA).readonly()),listTrackMedia:D(d({trackId:l(),deviceId:i()}),S(RA).readonly()),listEventMedia:D(d({ownerType:Ss,eventId:i().int(),deviceId:i()}),S(RA).readonly()),ownersWithMedia:D(d({deviceId:i(),ownerKind:ws,ownerIds:S(l()).max(5e3)}),S(l()).readonly()),searchObjectEvents:D(Uj,S(Hj).readonly(),{caller:`required`}),wipeObjectEmbeddings:D(d({}),Qj,{kind:`mutation`,auth:`admin`}),rebuildObjectEmbeddings:D(Zj,eM,{kind:`mutation`,auth:`admin`}),getObjectEmbeddingRebuildStatus:D(d({}),tM)},events:{onFrameTracked:{data:d({deviceId:i(),timestamp:i(),frameWidth:i(),frameHeight:i(),detections:S(Vj).readonly()})},onTrackStarted:{data:d({deviceId:i(),trackId:l(),className:l()})},onTrackEnded:{data:d({deviceId:i(),trackId:l(),className:l(),durationMs:i()})},onDetectionEvent:{data:d({deviceId:i(),kind:tA,eventId:l(),timestamp:i()})}}},dM=d({stepId:l(),modelId:l(),detections:S(d({bbox:u([i(),i(),i(),i()]),score:i(),landmarks:S(d({x:i(),y:i()})).optional()})).min(1)}),fM=d({handle:rr,cropFrameSpace:d({x:i(),y:i(),w:i(),h:i()})});d({crop:d({left:i(),top:i(),width:i().positive(),height:i().positive()}).optional(),content:d({width:i().int().positive(),height:i().int().positive()}),fit:x([`stretch`,`contain`]),format:x([`rgb`,`gray`,`jpeg`])});var pM=d({registryId:l().min(1),id:l().min(1),width:i().int().positive(),height:i().int().positive(),format:x([`rgb`,`gray`]),timestamp:i(),capturedAt:i().optional()}),mM=x([`onnx`,`coreml`,`openvino`,`tflite`,`pt`,`gguf`]),hM=x([`detector`,`cropper`,`classifier`,`refiner`,`audio-classifier`]),Y=d({runtime:m(`python`),backend:l(),format:mM,device:l().optional()}),gM=d({deviceKey:l().nullable(),runtime:l(),batchMode:l(),windowMs:i(),maxBatchSize:i(),concurrency:i(),numWorkers:i()}),_M=d({engine:Y,devices:S(d({id:l(),label:l(),description:l().optional()})).readonly(),defaultDevice:l()}),vM=pe(()=>d({addonId:l(),addonName:l(),slot:hM,inputClasses:S(l()).readonly(),outputClasses:S(l()).readonly(),enabled:C(),modelId:l(),children:S(vM).readonly(),group:l().optional(),settings:y(l(),o()).optional()})),yM=d({id:l(),name:l(),formats:y(l(),Fp),group:Rp.optional(),legacy:C().optional(),provider:Bp.optional(),defaultConfidence:i().optional(),suppliesSteps:S(Wp).readonly().optional()}),bM=_(),xM=d({id:l(),name:l(),slot:hM,inputClasses:S(l()).readonly(),outputClasses:S(l()).readonly(),childSlots:S(hM).readonly(),models:S(yM).readonly(),defaultModelId:l(),defaultModelIdByFormat:y(l(),l()).optional(),enabledByDefault:C().optional(),backfillIntoExistingOverrides:C().optional(),defaultConfidence:i(),group:l().optional(),configSchema:S(bM).readonly().optional()}),SM=d({id:hM,label:l(),priority:i(),parentSlot:hM.nullable(),addons:S(xM).readonly()}),CM=d({availableEngines:S(_M).readonly(),selectedEngine:Y,slots:S(SM).readonly()}),wM=d({runtimeId:x([`onnx`,`openvino`,`coreml`,`edgetpu`]).nullable(),device:l().nullable(),state:x([`idle`,`installing`,`verifying`,`ready`,`failed`]),progress:i().optional(),error:l().optional(),nextRetryAt:i().optional(),configIssues:S(l()).optional()}),TM=pe(()=>d({addonId:l(),modelId:l().optional(),enabled:C().default(!0),children:S(TM).optional(),settings:y(l(),o()).optional(),jumpDeviceKey:l().optional()})),EM=d({addonId:l(),chosen:l(),running:l(),format:l()}),DM=d({addonId:l(),kind:x([`unknown-addon`,`no-format-build`,`unknown-device`]),detail:l()}),OM=d({ok:C(),issues:S(DM).readonly(),substitutions:S(EM).readonly(),format:l()}),kM=d({filename:l(),stepIds:S(l()).readonly().optional()}),AM=d({base64:l(),filename:l()}),jM=d({filename:l(),sizeKb:i()}),MM=d({base64:l()}),NM=d({id:l(),name:l(),description:l(),available:C(),rawLabels:S(l()).readonly().optional()}),PM=d({activeBackend:l(),availableBackends:S(NM).readonly(),sampleRate:i(),chunkDurationMs:i()}),FM=d({filePath:l(),sizeMB:i(),durationMs:i()}),IM=d({success:C(),error:l().optional(),frame:_().optional()}),LM=_(),RM=_(),zM=_(),BM=_(),VM=_(),HM=_(),UM={name:`pipeline-executor`,scope:`system`,mode:`singleton`,methods:{getAvailableEngines:D(v(),S(Y)),getSelectedEngine:D(v(),Y),getDefaultSteps:D(Y,S(vM)),getEngineProvisioning:D(d({nodeId:l()}),wM),getVideoPipelineSteps:D(v(),y(l(),d({modelId:l(),settings:y(l(),o()).readonly()}))),setVideoPipelineSteps:D(d({steps:y(l(),d({modelId:l(),settings:y(l(),o()).readonly()}))}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),clearDeviceOverrides:D(d({nodeId:l()}),d({success:m(!0),clearedDevices:i()}),{kind:`mutation`,auth:`admin`}),clearModelBoundDeviceOverrides:D(d({nodeId:l(),deviceIds:S(i()).readonly().optional(),dryRun:C()}),d({entries:S(d({deviceId:i(),keys:S(l()).readonly()})).readonly(),refused:S(d({deviceId:i(),reason:l()})).readonly()}),{kind:`mutation`,auth:`admin`}),getInferenceDeviceHealth:D(d({nodeId:l()}),d({unhealthy:S(d({deviceKey:l(),state:x([`failed`,`backoff`]),since:i(),deaths:i(),lastError:l()})).readonly()})),rearmInferenceDevice:D(d({nodeId:l(),deviceKey:l()}),d({rearmed:C()}),{kind:`mutation`,auth:`admin`}),getSchema:D(v(),CM),getGlobalSteps:D(v(),S(vM).readonly().nullable()),getGlobalPipelineConfig:D(v(),LM),getOrchestratorConfigSchema:D(v(),RM),validatePipeline:D(d({steps:S(TM),deviceKey:l().optional()}),OM),getCapabilities:D(v(),BM),getAddonModels:D(d({addonId:l()}),VM),downloadModel:D(d({addonId:l(),modelId:l(),format:mM}),FM,{kind:`mutation`}),deleteModel:D(d({addonId:l(),modelId:l(),format:mM}),d({success:m(!0)}),{kind:`mutation`}),runPipeline:D(d({steps:S(TM).min(1),frame:oh.optional(),frameRef:pM.optional(),frameHandle:rr.optional(),imageBase64:l().optional(),image:b(Uint8Array).optional(),referenceImage:l().optional(),deviceId:i().optional(),sessionId:l().optional(),plane:x([`full`,`frame`]).optional(),deviceKey:l().optional(),nativeCropRef:fM.optional(),replay:m(!0).optional(),suppliedRoot:dM.optional()}),HM,{kind:`mutation`}),runPipelineBatch:D(d({steps:S(TM).min(1),frames:S(oh).min(1).max(255),deviceId:i().optional(),sessionId:l().optional(),frameId:i().int().nonnegative().optional(),deviceKey:l().optional()}),d({results:S(HM).readonly()}),{kind:`mutation`}),cacheFrameInPool:D(d({data:b(Uint8Array),width:i().int().positive(),height:i().int().positive(),format:x([`rgb`,`bgr`,`gray`])}),d({frameId:i(),width:i(),height:i()}),{kind:`mutation`}),inferCached:D(d({stepId:l(),frameId:i().int(),modelId:l().min(1)}),y(l(),o()),{kind:`mutation`}),uncacheFrame:D(d({frameId:i().int()}),v(),{kind:`mutation`}),getEffectiveTuning:D(d({deviceKey:l().optional()}),gM),listLoadedEngines:D(v(),S(d({engineKey:l(),engine:Y,modelsLoaded:S(l()).readonly(),inUseByCameras:S(i()).readonly(),kind:x([`runtime`,`device-pool`]),poolPid:i().nullable(),idleMs:i().nullable(),idleTtlMs:i().nullable()})).readonly()),spinEngine:D(d({engine:Y}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),killEngine:D(d({engine:Y,force:C().optional()}),d({success:C(),reason:l().optional()}),{kind:`mutation`,auth:`admin`}),listReferenceImages:D(v(),S(kM).readonly()),getReferenceImage:D(d({filename:l()}),AM.nullable()),getReferenceAudioFiles:D(v(),S(jM).readonly()),getReferenceAudio:D(d({filename:l()}),MM.nullable()),getAudioCapabilities:D(v(),PM),runAudioTest:D(d({addonId:l(),modelId:l(),filename:l().optional(),settings:y(l(),o()).optional()}),IM,{kind:`mutation`}),getDetectionConfigSchema:D(v(),zM)}},WM=x(yr),GM=2,KM={min:1,max:8},qM=x([`intel-core-ultra`,`intel-n-series`,`apple-m-base`,`apple-m-pro`,`amd-phoenix`,`unknown`]),JM=x([`intel-npu`,`intel-igpu`,`amd-igpu`,`amd-npu`,`x86-cpu`,`arm-cpu`,`apple-ane`,`coral`]),YM=p(`kind`,[d({kind:m(`capacity`),sessions:i(),minSessions:i()}),d({kind:m(`tie-faster`),over:l(),recallDelta:i()}),d({kind:m(`stepped-down`),from:l(),to:l(),limitedBy:l()}),d({kind:m(`no-fit-lightest`),sessions:i(),minSessions:i()}),d({kind:m(`derived-latency`),modelId:l()}),d({kind:m(`cpu-device`)}),d({kind:m(`coral-untouched`)}),d({kind:m(`device-disabled`)}),d({kind:m(`device-unavailable`)}),d({kind:m(`node-offline`)}),d({kind:m(`no-hardware-facts`)}),d({kind:m(`no-measured-data`),hardwareClass:qM}),d({kind:m(`no-family-build`),format:WM}),d({kind:m(`kept-custom-pin`),modelId:l(),deviceKey:l()})]),XM=x([`custom-pin`]),ZM=p(`kind`,[d({kind:m(`table`)}),d({kind:m(`node-benchmark`),resultId:l(),measuredAtMs:i()})]),QM=d({modelId:l(),p50Ms:i(),fps:i(),measured:C(),source:ZM.optional(),capacitySessions:i(),personRecall:i()}),$M=d({deviceKey:l(),accelerator:JM.nullable(),enabled:C(),available:C(),chosen:QM.nullable(),kept:XM.optional(),reasons:S(YM).readonly()}),eN=d({nodeId:l(),reachable:C(),hardwareClass:qM.nullable(),cpuModel:l().nullable(),skipped:C(),acceleratorModelId:l().nullable(),devices:S($M).readonly(),reasons:S(YM).readonly()}),tN=d({stepId:l(),before:l().nullable(),after:l().nullable()}),nN=d({nodeId:l(),deviceKey:l(),madeExplicit:C(),modelPins:S(tN).readonly(),thresholds:S(d({stepId:l(),keys:S(l()).readonly()})).readonly()}),rN=d({deviceId:i(),source:x([`step-override`,`wholesale`]),nodeId:l(),deviceKey:l().nullable(),stepId:l(),modelIdBefore:l().nullable(),keys:S(l()).readonly()}),iN=d({deviceId:i(),keys:S(l()).readonly()}),aN=p(`kind`,[d({kind:m(`detector-store-cluster-wide`),skippedNodes:S(l()).readonly()}),d({kind:m(`detector-store-unreadable`),error:l()}),d({kind:m(`coral-enabled`),nodeId:l(),deviceKey:l()}),d({kind:m(`custom-pin-kept`),nodeId:l(),deviceKey:l().nullable(),deviceId:i().nullable(),modelId:l()}),d({kind:m(`custom-registry-unreadable`),error:l()})]),oN=d({headroom:i().min(.3).max(.5).default(.4),minSessionsPerDevice:i().int().min(KM.min).max(KM.max).default(2)}),sN=d({planHash:l(),family:m(`yolov9`),headroom:i(),minSessionsPerDevice:i(),cameraFps:i(),generatedAt:i(),nodes:S(eN).readonly(),nodeChanges:S(nN).readonly(),cameraClears:S(rN).readonly(),detectorStoreClears:S(iN).readonly(),warnings:S(aN).readonly()}),cN=d({planHash:l(),headroom:i().min(.3).max(.5).default(.4),minSessionsPerDevice:i().int().min(KM.min).max(KM.max).default(2)}),lN=d({phase:x([`download`,`camera-overrides`,`detector-thresholds`,`node-models`,`redispatch`]),ok:C(),detail:l()}),uN=p(`kind`,[d({kind:m(`applied`),planHash:l(),phases:S(lN).readonly()}),d({kind:m(`aborted`),phases:S(lN).readonly()}),d({kind:m(`stale`),plan:sN}),d({kind:m(`refused`),reason:x([`apply-in-progress`])})]),dN=x([`least-loaded`,`share`]),fN=`share`,pN=`sessionPlacement`;function mN(e){let t=dN.safeParse(e);return t.success?t.data:fN}var hN=d({nodes:y(l(),i().positive()).default({}),devices:y(l(),y(l(),i().positive())).default({})}),gN=d({windowMs:i().int().min(6e4).max(1440*60*1e3).default(3600*1e3)}),_N=d({deviceKey:l(),sessionsNow:i(),sessionsStarted:i(),observedShare:i().nullable()}),vN=d({nodeId:l(),sessionsNow:i(),sessionsStarted:i(),observedShare:i().nullable(),peakSessions:i(),yieldsAway:i(),devices:S(_N).readonly()}),yN=d({deviceId:i(),deviceKey:l(),reason:x([`disabled`,`absent`])}),bN=d({policy:dN,windowMs:i(),observedForMs:i(),sessionsNow:i(),clusterPeakSessions:i(),nodes:S(vN).readonly(),stalePins:S(yN).readonly()}),xN=x([`hardware`,`benchmark`]),SN=x([`no-benchmark-results`,`partial-benchmark-results`]),CN=d({headroom:i().min(.3).max(.5).default(.4),source:xN.default(`hardware`)}),wN=d({deviceKey:l(),share:i(),modelId:l().nullable(),fps:i().nullable(),measured:C(),suggestedMaxSessions:i().nullable()}),TN=d({nodeId:l(),share:i().nullable(),capacitySessions:i(),devices:S(wN).readonly(),skippedReason:l().nullable(),capacitySource:xN.nullable(),capacityFallback:SN.nullable()}),EN=d({headroom:i(),source:xN,cameraFps:i(),minSessionsPerDevice:i(),nodes:S(TN).readonly()}),DN=x([`hardware`,`benchmark`,`manual`]),ON=`benchmark`;function kN(e){return e!==`manual`}var AN=.4,jN=`shareSource`;function MN(e){if(e===`auto`)return`hardware`;let t=DN.safeParse(e);return t.success?t.data:ON}var NN=d({source:DN}),PN=d({nodes:y(l(),i()),devices:y(l(),y(l(),i()))}),FN=d({deviceKey:l(),eligible:C(),configuredPct:i(),effectivePct:i()}),IN=d({nodeId:l(),eligible:C(),configuredPct:i(),effectivePct:i(),capacitySource:xN.nullable(),capacityFallback:SN.nullable(),devices:S(FN).readonly()}),LN=d({source:DN,policy:dN,autoPending:C(),computedAt:i().nullable(),trigger:l().nullable(),nodes:S(IN).readonly(),nodeWeights:y(l(),i()),deviceWeights:y(l(),y(l(),i()))}),X={fpsPerStream:10,budgetMinutes:45,minBudgetMinutes:10,maxBudgetMinutes:120,staleAfterDays:30,settleSec:5,measureSec:20,drainTimeoutSec:120,maxModelsPerDevice:6},RN=x([`device`,`pipeline`]),zN=d({deviceKey:l().min(1),modelIds:S(l().min(1)).min(1).max(X.maxModelsPerDevice)}),BN=d({nodeId:l().min(1),devices:S(zN).min(1),phases:S(RN).min(1).default([`device`,`pipeline`]),steps:S(l().min(1)).default([]),fpsPerStream:i().int().min(1).max(30).default(X.fpsPerStream),budgetMinutes:i().int().min(X.minBudgetMinutes).max(X.maxBudgetMinutes).default(X.budgetMinutes),keepDownloadedModels:C().default(!1),acceptInsufficientHeadroom:C().default(!1)}),VN=x([`benchmark-active`,`node-offline`,`unknown-device`,`no-phase`,`insufficient-headroom`]),HN=d({kind:VN,detail:l(),overridable:C()}),UN=d({deviceId:i(),placedOnNode:C(),pinnedToNode:C()}),WN=d({deviceId:i(),reason:m(`only-frame-source`)}),GN=d({nodeId:l(),online:C(),moving:S(UN).readonly(),staying:S(WN).readonly(),estimatedDurationMs:i(),budgetMs:i(),phases:S(RN).readonly(),steps:S(l()).readonly(),devices:S(zN).readonly(),headroom:d({sessionsNow:i(),otherNodesCapacitySessions:i().nullable()}),refusals:S(HN).readonly(),canStart:C()}),KN=d({phase:x([`preparing`,`device`,`pipeline`,`cleanup`]),deviceKey:l().nullable(),modelId:l().nullable(),load:i().nullable(),cellsDone:i(),cellsTotal:i(),message:l()}),qN=x([`p95`,`drops`,`errors`,`stall`,`cpu`,`ram`,`none`]),JN=d({load:i(),pass:C(),p95Ms:i(),dropRatio:i(),fps:i(),cpuPct:i().nullable(),ramFreePct:i().nullable(),failReasons:S(l()).readonly()}),YN=d({phase:m(`device`),deviceKey:l(),modelId:l(),p50Ms:i(),p95Ms:i(),p99Ms:i(),fps:i(),kMax:i(),limitedBy:qN,warmupMs:i(),ramp:S(JN).readonly()}),XN=d({phase:m(`pipeline`),deviceKey:l(),modelId:l(),steps:S(l()).readonly(),maxSessions:i(),limitedBy:qN,stepsFired:S(l()).readonly(),warmupMs:i(),ramp:S(JN).readonly()}),ZN=p(`phase`,[YN,XN]),QN=d({pipelineVersion:l().nullable(),cpuModel:l().nullable(),ramGb:i().nullable(),os:l().nullable(),pools:y(l(),d({runtime:l(),numWorkers:i(),concurrency:i(),batchMode:l()})).default({})}),$N=d({id:l(),revision:l().nullable(),frames:i(),width:i(),height:i()}),eP=d({runId:l().min(1),devices:S(zN).min(1),phases:S(RN).min(1),steps:S(l()).default([]),fpsPerStream:i().int().min(1).max(30),deadlineAtMs:i(),settleSec:i().min(0).max(60).default(X.settleSec),measureSec:i().min(2).max(300).default(X.measureSec),keepDownloadedModels:C().default(!1)}),tP=x([`running`,`done`,`failed`,`aborted`]),nP=d({runId:l(),nodeId:l(),state:tP,progress:KN.nullable(),cells:S(ZN).readonly(),fingerprint:QN.nullable(),clip:$N.nullable(),activeCameraIds:S(i()).readonly(),deletedModels:S(l()).readonly(),error:l().nullable(),startedAtMs:i(),finishedAtMs:i().nullable()}),rP=x([`draining`,`measuring`,`restoring`,`done`,`failed`,`aborted`]),iP=x([`completed`,`operator-abort`,`deadline`,`node-lost`,`runner-lost`,`hub-restart`,`drain-timeout`,`failed`]),aP=d({runId:l(),nodeId:l(),state:rP,plan:BN,startedAtMs:i(),deadlineAtMs:i(),finishedAtMs:i().nullable(),endReason:iP.nullable(),error:l().nullable(),moved:S(i()).readonly(),staying:S(i()).readonly(),contaminated:C(),progress:KN.nullable(),resultIds:S(l()).readonly()}),oP=d({modeNodeId:l().nullable(),run:aP.nullable()}),sP=d({id:l(),runId:l(),nodeId:l(),cell:ZN,fpsPerStream:i(),fingerprint:QN.nullable(),clip:$N.nullable(),contaminated:C(),stayingCameras:S(i()).readonly(),partialRun:C(),measuredAtMs:i()}),cP=d({nodeId:l().optional(),deviceKey:l().optional()}),lP=sP.extend({standing:x([`fresh`,`stale`,`superseded`]),staleWhy:x([`age`,`runtime`,`pool-tuning`]).nullable()}),uP=d({runId:l(),nodeId:l(),startedAtMs:i(),deadlineAtMs:i(),plan:BN,moved:S(i()).readonly(),staying:S(i()).readonly()}),dP=d({nodeId:l(),reachable:C(),devices:S(d({deviceKey:l(),enabled:C(),available:C(),suggested:S(l()).readonly(),all:S(l()).readonly(),currentModelId:l().nullable()})).readonly(),steps:S(d({id:l(),name:l(),slot:l()})).readonly()}),fP=d({activeCameras:i(),throttledCameras:i(),avgInferenceTimeMs:i(),queueDepth:i()}),pP=d({detectionMode:x([`disabled`,`always-on`,`on-motion`]),configuredFps:i(),actualFps:i(),queueDepth:i(),avgInferenceTimeMs:i(),droppedFrames:i(),phase:x([`idle`,`watching`,`active`])}),mP=pP.extend({deviceId:i()}),hP=x([`polygon`,`tripwire`]),gP=d({x:i(),y:i()}),_P=d({id:l(),name:l(),kind:hP.default(`polygon`),polygon:S(gP).readonly(),color:l().default(`#3b82f6`)}),vP={name:`zones`,scope:`device`,mode:`singleton`,deviceTypes:[k.Camera],methods:{listZones:D(d({deviceId:i()}),S(_P).readonly()),addZone:D(d({deviceId:i(),zone:_P}),v(),{kind:`mutation`,auth:`admin`}),removeZone:D(d({deviceId:i(),zoneId:l()}),v(),{kind:`mutation`,auth:`admin`}),updateZone:D(d({deviceId:i(),zone:_P}),v(),{kind:`mutation`,auth:`admin`})},runtimeState:d({zones:S(_P).readonly()}),durability:`restored`},yP=d({x:i(),y:i(),w:i(),h:i()}),bP=d({bytes:b(Uint8Array).optional(),jpeg:l().optional(),jpegBytes:b(Uint8Array).optional(),width:i().int().positive(),height:i().int().positive(),tier:x([`native`,`ram-fullframe`]).optional()}),xP=x([`keyFrame`,`thumbnail`]),SP=x([`handle-gone`,`encode-failed`]),CP=p(`parked`,[d({parked:m(!0),nodeId:l(),width:i().int().positive(),height:i().int().positive(),bytes:i().int().nonnegative(),replaced:C()}),d({parked:m(!1),nodeId:l(),reason:SP,handleAgeMs:i().nullable(),detail:l().optional()})]),wP=d({jpeg:l().optional(),jpegBytes:b(Uint8Array).optional(),width:i().int().positive(),height:i().int().positive(),timestamp:i(),parkedAt:i()}),TP=d({bbox:yP,className:l()}),EP=d({stepId:l(),className:l(),score:i(),bbox:yP.optional(),embedding:l().optional(),embeddingMagnitude:i().optional(),embeddingModelId:l().optional(),label:l().optional(),labelTier:f([m(1),m(2)]).optional(),labelModelId:l().optional(),alignedCropJpeg:l().optional(),nativeFaceShortSidePx:i().optional(),landmarks:S(d({x:i(),y:i()})).optional()}),DP=x([`unknown-step`,`model-not-servable`,`unreadable-frame`,`execution-failed`]),OP=p(`kind`,[d({kind:m(`ran`),nodeId:l(),modelId:l(),details:S(EP)}),d({kind:m(`refused`),nodeId:l(),reason:DP,detail:l()})]),kP={min:0,max:6e4,default:3e4,step:500},AP={min:0,max:6e5,default:12e4,step:5e3},jP={min:5e3,max:6e5,default:9e4,step:5e3},MP={min:1,max:30,default:4,step:1},NP={min:1,max:30,default:10,step:1},PP={min:0,max:300,default:300,step:5},FP={min:1,max:10,default:4,step:1},IP={min:0,max:30,default:12,step:1},LP=x([`onboard`,`analyzer`,`device-activity`]),RP=d({source:LP,triggeredBy:dk,sensorName:l().optional()}),zP=S(LP),BP={analyzer:`Frame-diff Analyzer (motion addon)`,onboard:`Camera sensors`,"device-activity":`Device activity (the device says it is working)`};function VP(e){let t=LP.safeParse(e);return t.success?BP[t.data]:e}var HP=[`analyzer`,`onboard`,`device-activity`],UP=n(e=>Array.isArray(e)&&e.length>1?e.slice(0,1):e,S(kA).max(1)),WP=d({deviceId:i(),detected:C(),source:LP.default(`analyzer`),regions:S(eT).readonly().optional()}),GP=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)`),KP=d({modelId:l().optional(),settings:y(l(),o()).optional()}),qP=d({deviceKey:l(),weight:i().positive().default(1),maxSessions:i().int().positive().nullable().default(null),steps:y(l(),KP).optional()}),JP=d({deviceId:i(),detectionMode:x([`disabled`,`always-on`,`on-motion`]).default(`on-motion`),audioMode:x([`disabled`,`always-on`,`on-motion`]).default(`always-on`),motionCooldownMs:i().min(kP.min).default(kP.default),maxSessionHoldMs:i().min(AP.min).max(AP.max).optional(),audioMotionWindowMs:i().min(jP.min).max(jP.max).optional(),motionFps:i().min(MP.min).max(MP.max).default(MP.default),detectionFps:i().min(NP.min).max(NP.max).default(NP.default),motionStreamId:l(),detectionStreamId:l(),audioStreamPick:Gn.optional(),motionSources:zP.default([`analyzer`]),sessionTrigger:RP.optional(),detectionSources:UP.default([`pipeline`]),pipelineEnabled:C().default(!0),steps:S(TM).readonly().optional(),audio:d({modelId:l().optional(),enabled:C()}).nullable().optional(),zones:S(_P).readonly().default([]),onboardMotionDrivesAnalyzer:C().default(!0),preRollInferenceEnabled:C().default(!0),preRollInferenceFrames:i().min(IP.min).max(IP.max).default(IP.default),occupancyRecheckEnabled:C().default(!0),occupancyRecheckSec:i().min(PP.min).max(PP.max).default(PP.default),occupancyRecheckFrames:i().min(FP.min).max(FP.max).default(FP.default),frameSource:GP.default({kind:`local-broker`}),deviceKey:l().optional(),inferenceDevices:S(qP).readonly().optional()}),YP=[{key:`motionSources`,type:`multiselect`,label:`Motion Sources`,default:[`analyzer`],options:HP.map(e=>e===`onboard`?{value:e,label:BP[e],description:`The camera's own motion, plus any sensor attached to it`}:{value:e,label:BP[e]})},{key:`detectionSources`,type:`multiselect`,label:`Detection Sources`,default:[`pipeline`],options:[{value:`pipeline`,label:`This node (ML root step on decoded frames)`},{value:`onboard`,label:`Camera onboard AI (replaces the root step when picked alone)`}]},{key:`motionFps`,type:`slider`,label:`Motion FPS (analyzer)`,min:MP.min,max:MP.max,step:MP.step,default:MP.default,showValue:!0,unit:`fps`,nullable:!0,nullLabel:`Default`,showWhen:{field:`motionSources`,includes:`analyzer`}},{key:`detectionFps`,type:`slider`,label:`Detection FPS`,min:NP.min,max:NP.max,step:NP.step,default:NP.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:kP.min,max:kP.max,step:kP.step,default:kP.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:AP.min,max:AP.max,step:AP.step,default:AP.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:jP.min,max:jP.max,step:jP.step,default:jP.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:IP.min,max:IP.max,step:IP.step,default:IP.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:PP.min,max:PP.max,step:PP.step,default:PP.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:FP.min,max:FP.max,step:FP.step,default:FP.default,showValue:!0,showWhen:{field:`occupancyRecheckEnabled`,equals:!0}}],XP=d({nodeId:l(),attachedCameras:i(),activeCameras:i(),avgInferenceFps:i(),avgInferenceTimeMs:i(),queueDepthTotal:i(),devices:S(d({deviceKey:l(),backend:l(),attachedCameras:i()})).default([]),hardware:d({hasGpu:C(),inferenceBackend:l().optional(),cpuCores:i().optional()}),motionSliceWriter:m(`orchestrator`).optional()}),ZP=d({framesDecoded:i(),framesAdmitted:i(),framesDroppedPixelFree:i(),viewsMaterialized:i(),viewsSkipped:i(),workerToRunnerBytes:i(),runnerToPoolRawBytes:i(),runnerToPoolJpegBytes:i(),onDemandFullFrameRequests:i(),onDemandCropRequests:i(),nativeHits:i(),nativeMisses:i(),tileHits:i(),tileMisses:i(),fallbackHits:i(),fallbackMisses:i(),retainedWritesAvoided:i(),residentRefs:i(),residentBytes:i(),releases:i(),evictions:i(),staleMisses:i()}),QP=d({node:ZP,cameras:S(ZP.extend({deviceId:i()}))}),$P=d({nodeId:l(),activeCameras:i(),throttledCameras:i(),avgInferenceTimeMs:i(),queueDepth:i(),frameLazy:QP.optional()}),eF=x([`not-attached`,`battery-asleep`,`not-watching`,`already-bursting`]),tF={name:`pipeline-runner`,scope:`system`,mode:`singleton`,methods:{attachCamera:D(JP,d({success:m(!0)}),{kind:`mutation`}),detachCamera:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`}),reportMotion:D(WP,d({success:m(!0)}),{kind:`mutation`}),getLocalLoad:D(v(),XP),getLocalMetrics:D(v(),$P),getCameraMetrics:D(d({deviceId:i()}),pP.nullable()),getAllCameraMetrics:D(v(),S(mP).readonly()),getLocalCameras:D(v(),S(i()).readonly()),requestOccupancyBurst:D(d({deviceId:i(),frames:i().int().positive().optional(),reason:l()}),d({started:C(),refusedBecause:eF.optional()}),{auth:`admin`,kind:`mutation`}),getNativeCrop:D(d({handle:rr,bbox:yP,maxWidth:i().int().positive().optional(),acceptJpegBytes:C().optional(),encodeJpeg:C().optional()}),bP.nullable()),runDetailSubtree:D(d({deviceId:i(),frameHandle:rr.optional(),frameJpeg:l().optional(),cropJpeg:l().optional(),parent:TP,steps:S(l()).optional(),supplied:d({stepId:l(),modelId:l(),boxes:S(d({bbox:yP,score:i()})).min(1)}).optional()}),d({details:S(EP)}).nullable(),{kind:`mutation`}),runStatelessStep:D(d({stepId:l(),modelId:l(),frameJpeg:l(),bbox:yP,className:l(),sourceDeviceId:i()}),OP,{kind:`mutation`}),parkTrackFrame:D(d({deviceId:i(),trackId:l(),kind:xP,handle:rr,bbox:yP,maxWidth:i().int().positive().optional(),timestamp:i()}),CP,{kind:`mutation`}),getParkedTrackFrame:D(d({deviceId:i(),trackId:l(),kind:xP,acceptJpegBytes:C().optional()}),wP.nullable()),releaseParkedTrackFrames:D(d({deviceId:i(),trackId:l()}),d({released:i().int().nonnegative()}),{kind:`mutation`}),startNodeBench:D(eP,d({accepted:m(!0),runId:l()}),{kind:`mutation`,auth:`admin`}),getNodeBenchStatus:D(d({runId:l()}),nP.nullable(),{auth:`admin`}),abortNodeBench:D(d({runId:l()}),d({aborted:C()}),{kind:`mutation`,auth:`admin`})}},nF=d({engine:Y.optional(),steps:S(TM).readonly(),audio:d({engine:Y.optional(),modelId:l().optional(),enabled:C(),settings:y(l(),o()).readonly().optional()}).nullable().optional()}),rF=d({modelId:l().optional(),settings:y(l(),o()).optional(),jumpDeviceKey:l().optional()}),iF=d({maxCameras:i().int().nonnegative().nullable().default(null),detectWeight:i().positive().optional(),detect:C().optional(),decode:C().optional(),audio:C().optional(),ingest:C().optional(),decodeBudgetMb:i().int().min(1024).max(65536).optional(),maxLiveDecodeWorkers:i().int().min(1).max(32).optional(),reachableHost:l().optional(),color:ds.optional(),inferenceDevices:y(l(),d({enabled:C(),weight:i().positive().optional(),maxSessions:i().int().positive().optional(),steps:y(l(),rF).optional()})).optional()}),aF=d({steps:S(TM).readonly(),audio:d({modelId:l(),enabled:C()}).nullable()}),oF=d({modelId:l().optional(),settings:y(l(),o()).readonly().optional()}),sF=y(l(),y(l(),o()).readonly()),cF=d({stepToggles:y(l(),C()).optional(),stepSettings:sF.optional(),stepOverridesByDevice:y(l(),y(l(),y(l(),oF))).optional(),pipelineByAgent:y(l(),aF).optional()}),lF=d({deviceId:i(),agentNodeId:l(),pinned:C(),reason:x([`manual`,`capacity`,`hardware-affinity`,`failover`,`rebalance`]),assignedAt:i()}),uF=d({nodeId:l(),online:C(),load:XP,score:i(),decodeHwaccel:l().nullable()}),dF=d({totalAgents:i(),onlineAgents:i(),totalCameras:i(),attachedCameras:i(),activeCameras:i(),avgInferenceTimeMs:i(),queueDepth:i()}),fF=y(l(),l()),pF=d({ownerNodeId:l(),reachableHost:l().optional(),configIssue:l().optional()}),mF=d({camStreamId:l(),codec:l(),width:i(),height:i(),fps:i(),kind:l()}),hF=d({streams:S(mF).readonly()}),gF=d({detectionNodeId:l().nullable(),decoderNodeId:l().nullable(),audioNodeId:l().nullable(),sourceNodeId:l().nullable(),pinned:d({detection:C(),decoder:C(),audio:C()}),reasons:d({detection:l().optional(),decoder:l().optional(),audio:l().optional()})}),_F=d({profile:l(),status:l(),codec:l(),width:i(),height:i(),subscribers:i(),inFps:i().nullable()}),vF=d({profiles:S(_F).readonly(),webrtcSessions:i(),rtspRestream:C()}),yF=d({nodeId:l()}),bF=d({enabled:C(),fps:i()}),xF=x([`idle`,`installing`,`verifying`,`ready`,`failed`]),SF=d({state:xF,error:l().optional()}),CF=x([`idle`,`watching`,`active`]),wF=d({nodeId:l(),engine:d({backend:l(),device:l()}),phase:CF,configuredFps:i(),actualFps:i(),queueDepth:i(),avgInferenceMs:i(),provisioning:SF}),TF=d({nodeId:l(),enabled:C()}),EF=cu,DF=d({mode:EF,active:C(),storageBytes:i()}),OF=x([`source`,`broker`,`detection`,`recording`,`switches`]),kF=x([`timeout`,`error`,`partial`]),AF=d({stage:OF,reason:kF,elapsedMs:i()}),jF=d({state:x([`idle`,`running`,`done`,`error`]),total:i().int().nonnegative(),completed:i().int().nonnegative(),currentDeviceId:i().int().nullable(),failed:S(i().int()).readonly(),mediaDropped:i().int().nonnegative(),tracks:i().int().nonnegative(),events:i().int().nonnegative(),startedAtMs:i().int().nullable(),finishedAtMs:i().int().nullable(),error:l().nullable()}),MF=d({deviceId:i(),assignment:gF,source:hF,broker:vF.nullable(),decoder:yF.nullable(),motion:bF.nullable(),detection:wF.nullable(),audio:TF.nullable(),recording:DF.nullable(),switchedOff:S(kc).readonly(),cameraSensors:Ok.optional(),degraded:S(AF).readonly(),fetchedAt:i()}),NF=[`disabled`,`unavailable`,`cannot-host-camera-root`,`accelerator-preferred`],PF=x(NF),FF=d({key:l(),backend:l(),device:l(),format:x(yr),available:C(),enabled:C(),weight:i(),maxSessions:i().nullable(),defaultModelId:l(),steps:y(l(),rF).optional(),exclusion:PF.nullable()}),IF=p(`kind`,[d({kind:m(`stored`),modelId:l()}),d({kind:m(`absent`),defaultModelId:l()}),d({kind:m(`unreadable`),reason:x(Ak),error:l().optional()})]),LF=d({nodeId:l(),reachable:C(),devices:S(FF).readonly()}),RF=d({deviceId:i().int().nonnegative(),config:xk.nullable()}),zF=x([`unknown-camera`,`out-of-range`,`no-burst-producer`,`already-looked`]),BF=d({deviceId:i().int().nonnegative(),afterMs:i().finite(),reason:l()}),VF=d({scheduled:C(),dueInMs:i().optional(),refusedBecause:zF.optional()}),HF={name:`pipeline-orchestrator`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,exposesDeviceSettings:!0,methods:{requestOccupancyLook:D(BF,VF,{kind:`mutation`,auth:`admin`}),pauseForStorageMigration:D(Iu,d({paused:m(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:D(Iu,d({resumed:m(!0)}),{kind:`mutation`,auth:`admin`}),assignPipeline:D(d({deviceId:i(),agentNodeId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),unassignPipeline:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setPipelineDevicePin:D(d({deviceId:i(),deviceKey:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getPipelineDevicePin:D(d({deviceId:i()}),d({deviceKey:l().nullable()})),rebalance:D(v(),d({migrated:i(),skipped:S(d({deviceId:i(),targetNodeId:l(),reason:l()})).default([])}),{kind:`mutation`,auth:`admin`}),getPipelineAssignments:D(v(),S(lF).readonly()),getPipelineAssignment:D(d({deviceId:i()}),lF.nullable()),getAgentLoad:D(v(),S(uF).readonly()),getClusterModelChoice:D(d({stepId:l()}),IF),getGlobalMetrics:D(v(),dF),getCameraMetrics:D(d({deviceId:i()}),pP.nullable()),getCapabilityBindings:D(d({nodeId:l()}),fF),setCapabilityBinding:D(d({nodeId:l(),capName:l(),addonId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getIngestOwner:D(v(),pF),assignAudio:D(d({deviceId:i(),nodeId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),unassignAudio:D(d({deviceId:i()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getAudioAssignment:D(d({deviceId:i()}),d({nodeId:l(),pinned:C(),assignedAt:i()}).nullable()),getAudioNodeLoad:D(v(),S(d({nodeId:l(),deviceCount:i()}))),getAudioAssignments:D(v(),S(d({deviceId:i(),nodeId:l(),pinned:C(),assignedAt:i()}))),getAgentSettings:D(d({agentNodeId:l()}),iF.nullable()),listAgentSettings:D(v(),S(d({nodeId:l(),settings:iF})).readonly()),removeAgentSettings:D(d({agentNodeId:l()}),d({success:C(),removed:C()}),{kind:`mutation`,auth:`admin`}),setAgentMaxCameras:D(d({agentNodeId:l(),maxCameras:i().int().nonnegative().nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentCapabilities:D(d({agentNodeId:l(),detect:C().nullable().optional(),audio:C().nullable().optional(),ingest:C().nullable().optional()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentDecodeLimits:D(d({agentNodeId:l(),decodeBudgetMb:i().int().min(1024).max(65536).nullable().optional(),maxLiveDecodeWorkers:i().int().min(1).max(32).nullable().optional()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentReachableHost:D(d({agentNodeId:l(),reachableHost:l().nullable().optional(),color:ds.nullable().optional()}).refine(e=>e.reachableHost!==void 0||e.color!==void 0,{message:`reachableHost or color required`}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setAgentInferenceDevices:D(d({agentNodeId:l(),inferenceDevices:y(l(),d({enabled:C(),weight:i().positive().optional(),maxSessions:i().int().positive().optional(),steps:y(l(),rF).optional()}))}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getNodeInferenceDevices:D(d({nodeId:l()}),LF),resetNodePipelineDefaults:D(d({agentNodeId:l()}),d({success:m(!0),effectiveModelId:l().nullable(),clearedCameraOverrides:i()}),{kind:`mutation`,auth:`admin`}),planAutoTune:D(oN,sN,{auth:`admin`}),applyAutoTune:D(cN,uN,{kind:`mutation`,auth:`admin`}),setLoadBalancingShares:D(hN,d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getPlacementStats:D(gN,bN,{auth:`admin`}),suggestShares:D(CN,EN,{auth:`admin`}),getEffectiveShares:D(v(),LN,{auth:`admin`}),setShareSource:D(NN,d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getNodeBenchmarkPreflight:D(BN,GN,{auth:`admin`}),startNodeBenchmark:D(BN,p(`kind`,[d({kind:m(`started`),runId:l()}),d({kind:m(`refused`),preflight:GN})]),{kind:`mutation`,auth:`admin`}),getNodeBenchmarkStatus:D(v(),oP,{auth:`admin`}),abortNodeBenchmark:D(d({runId:l()}),d({aborted:C()}),{kind:`mutation`,auth:`admin`}),getNodeBenchmarkCandidates:D(d({nodeId:l()}),dP,{auth:`admin`}),listNodeBenchmarkResults:D(cP,S(lP).readonly(),{auth:`admin`}),deleteNodeBenchmarkResult:D(d({id:l()}),d({deleted:C()}),{kind:`mutation`,auth:`admin`}),getCameraSettings:D(d({deviceId:i()}),cF.nullable()),setCameraStepToggle:D(d({deviceId:i(),addonId:l(),enabled:C().nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getCameraStepOverrides:D(d({deviceId:i()}),y(l(),y(l(),y(l(),oF))).nullable()),setCameraStepOverride:D(d({deviceId:i(),agentNodeId:l(),deviceKey:l(),addonId:l(),patch:oF.nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setCameraStepSettings:D(d({deviceId:i(),addonId:l(),settings:y(l(),o()).nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setCameraPipelineForAgent:D(d({deviceId:i(),agentNodeId:l(),pipeline:aF.nullable()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),resolvePipeline:D(d({deviceId:i(),agentNodeId:l().optional()}),nF),getCameraSwitches:D(d({deviceId:i()}),Fc),setCameraSwitch:D(d({deviceId:i(),switchId:kc,enabled:C()}),Fc,{kind:`mutation`,auth:`admin`}),getCameraStatus:D(d({deviceId:i()}),MF),getCameraStatuses:D(d({deviceIds:S(i()).optional()}),S(MF).readonly()),setCameraSensors:D(RF,d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),reconcileFromDisk:D(v(),jF,{kind:`mutation`,auth:`admin`}),getReconcileFromDiskStatus:D(v(),jF,{auth:`admin`})}},UF={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 WF(e){return UF[e]??`generic`}var GF={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 KF(e,t){let n=QT[t];if(n===void 0)throw Error(`EVENT_KIND_BY_CAP: cap '${e}' maps to unknown taxonomy kind '${t}'`);return{...n,icon:WF(n.iconId)}}var qF=Object.freeze(Object.fromEntries(Object.entries(GF).map(([e,t])=>[e,KF(e,t)]))),JF=Object.keys(GF);function YF(e,t){let n=QT[e];return n===void 0?null:{kind:n.kind,labelKey:n.labelKey,label:n.label,color:n.color,iconId:n.iconId,icon:WF(n.iconId),category:n.category,parentKind:n.parentKind,level:n.level,source:{capName:t.capName,deviceId:t.deviceId}}}var XF=x([`workspace`,`baked`,`data-root`]),ZF=x([`idle`,`checking`,`staging`,`pending-restart`,`awaiting-confirmation`]),QF=x([`in-sync`,`behind-patch`,`behind-series`,`ahead`,`unknown`]),$F=d({state:QF,seedVersion:l().nullable(),contractVersion:l().nullable(),contractSource:x([`registry`,`running`]).nullable(),message:l()}),eI=x([`docker`,`electron`,`native`,`contradictory`,`unknown`]),tI=d({fact:x([`dockerenv-file`,`proc-1-cgroup`,`platform`,`electron-app-version-env`]),mode:x([`observed`,`declared`]),holds:C(),detail:l()}),nI=d({kind:eI,evidence:S(tI),currentVersion:l().nullable()}),rI=d({fromVersion:l(),toVersion:l().nullable(),atMs:i(),reason:l()}),iI=d({packageName:l(),runningVersion:l().nullable(),nodeRuntimeVersion:l().nullable(),activeVersion:l().nullable(),installedVersion:l().nullable().optional(),restartRequired:C().optional(),previousVersion:l().nullable(),seedVersion:l().nullable(),latestVersion:l().nullable(),updateAvailable:C(),bootMode:XF,updateState:ZF,pendingVersion:l().nullable(),rolledBack:rI.nullable(),stateFileCorrupt:C(),lastCheckedAtMs:i().nullable(),imageContract:$F.optional(),wrapper:nI.optional()}),aI=d({packageName:l(),runningVersion:l().nullable(),latestVersion:l().nullable(),updateAvailable:C(),checkedAtMs:i(),error:l().nullable(),pendingVersion:l().nullable().optional(),restartRequired:C().optional()}),oI=x([`staged`,`restart-scheduled`,`already-current`,`refused`,`failed`]),sI=d({accepted:C(),targetVersion:l().nullable(),restarting:C(),message:l(),outcome:oI.optional(),reason:l().nullable().optional(),error:l().nullable().optional()}),cI={name:`server-management`,scope:`system`,mode:`singleton`,methods:{getServerPackageStatus:D(v(),iI,{auth:`admin`}),checkServerUpdate:D(v(),aI,{kind:`mutation`,auth:`admin`}),applyServerUpdate:D(d({version:l().optional()}),sI,{kind:`mutation`,auth:`admin`,timeoutMs:16*6e4}),rollbackServerUpdate:D(v(),sI,{kind:`mutation`,auth:`admin`}),restartServer:D(v(),sI,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},lI=r(),uI=d({to:f([lI,S(lI).min(1)]),cc:S(lI).optional(),bcc:S(lI).optional(),from:l().optional(),replyTo:l().optional(),subject:l(),text:l(),html:l().optional()}),dI=d({messageId:l(),accepted:S(lI).default([]),rejected:S(lI).default([])}),fI=d({ready:C(),host:l(),error:l().optional(),lastVerifiedAt:i().optional()}),pI={name:`smtp-provider`,scope:`system`,mode:`collection`,internal:!0,providerKind:`email`,methods:{sendEmail:D(uI,dI,{kind:`mutation`,auth:`admin`,access:`create`}),verify:D(v(),fI,{kind:`mutation`,auth:`admin`,access:`view`}),getStatus:D(v(),fI,{auth:`admin`})}},mI=d({base64:l(),contentType:l()}),hI=d({lastCapturedAt:i().nullable(),cacheAgeMs:i().nullable(),lastBytes:i().nullable(),lastStreamId:l().nullable()}),gI={name:`snapshot`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:D(d({deviceId:i(),streamId:l().optional(),force:C().optional()}),mI.nullable()),invalidateCache:D(d({deviceId:i()}),v(),{kind:`mutation`,auth:`admin`}),getSnapshotOverview:Mr(d({deviceIds:S(i()).min(1).max(200)}),S(d({deviceId:i(),lastCapturedAt:i().nullable(),cacheAgeMs:i().nullable(),etag:l().nullable()}))),getDebugState:Mr(d({deviceId:i()}),d({battery:d({sleeping:C(),lastUpdated:i(),lastContactAt:i().optional()}).nullable(),state:d({isBattery:C(),reason:x([`disabled`,`offline`,`sleeping`,`unreachable`,`waking`]).nullable()}),frame:d({capturedAt:i().nullable(),ageMs:i().nullable()}),waking:C()})),getSnapshotLinks:Mr(d({targets:S(d({deviceId:i(),width:i().int().positive().optional()})).min(1).max(200)}),S(d({deviceId:i(),url:l().nullable(),capturedAt:i().nullable(),ageMs:i().nullable(),expiresAt:i().nullable(),width:i().nullable(),neverCaptured:C(),sleeping:C(),stateReason:x([`disabled`,`offline`,`sleeping`,`unreachable`,`waking`]).nullable(),battery:C()})))},status:{schema:hI,kind:`poll`}},_I=d({userId:l(),username:l(),isAdmin:C(),provider:l(),email:l().optional(),displayName:l().optional(),hubUrl:l().optional(),scopes:S(J).optional(),redirectUri:l().optional(),integrationId:l().optional(),jti:l().optional(),codeChallenge:l().optional(),sessionId:l().optional(),refreshTtl:f([i().int().positive(),m(`never`)]).optional(),linkIntent:l().optional(),issuer:l().optional(),browserBinding:l().optional()}),vI={name:`sso-bridge`,scope:`system`,mode:`singleton`,internal:!0,methods:{signBridgeToken:D(d({claims:_I,ttlSec:f([i().int().positive(),m(`never`)]).optional()}),d({token:l()}),{auth:`admin`}),verifyBridgeToken:D(d({token:l()}),_I.nullable(),{auth:`admin`})}},yI=p(`shouldSaveDiskSpace`,[d({providerId:l().min(1),displayName:l().min(1),configSchema:o(),nodeLocal:C(),shouldSaveDiskSpace:m(!0),minFreePercent:i().min(0).max(100)}),d({providerId:l().min(1),displayName:l().min(1),configSchema:o(),nodeLocal:C(),shouldSaveDiskSpace:m(!1),minFreePercent:m(null)})]),bI={name:`storage`,scope:`system`,mode:`singleton`,methods:{resolve:D(d({location:B,relativePath:l()}),l(),{auth:`admin`}),write:D(d({location:B,relativePath:l(),data:b(Uint8Array)}),v(),{kind:`mutation`,auth:`admin`}),read:D(d({location:B,relativePath:l()}),b(Uint8Array),{auth:`admin`}),exists:D(d({location:B,relativePath:l()}),C(),{auth:`admin`}),list:D(d({location:B,prefix:l().optional()}),S(l()).readonly(),{auth:`admin`}),delete:D(d({location:B,relativePath:l()}),v(),{kind:`mutation`,auth:`admin`}),getAvailableSpace:D(d({location:B}),i().nullable()),beginUpload:D(d({location:B,relativePath:l(),sizeBytes:i().optional()}),d({uploadId:l()}),{kind:`mutation`,auth:`admin`}),writeChunk:D(d({uploadId:l(),offset:i(),data:b(Uint8Array)}),v(),{kind:`mutation`,auth:`admin`}),finalizeUpload:D(d({uploadId:l()}),v(),{kind:`mutation`,auth:`admin`}),abortUpload:D(d({uploadId:l()}),v(),{kind:`mutation`,auth:`admin`}),beginDownload:D(d({location:B,relativePath:l()}),d({downloadId:l(),sizeBytes:i()}),{kind:`mutation`,auth:`admin`}),readChunk:D(d({downloadId:l(),offset:i(),length:i()}),b(Uint8Array),{auth:`admin`}),endDownload:D(d({downloadId:l()}),v(),{kind:`mutation`,auth:`admin`}),listLocations:D(d({type:Ld.optional()}),S(z).readonly()),listLocationDeclarations:D(v(),S(Gd).readonly()),upsertLocation:D(z.omit({createdAt:!0,updatedAt:!0}),z,{kind:`mutation`,auth:`admin`}),deleteLocation:D(d({id:l(),force:C().optional()}),v(),{kind:`mutation`,auth:`admin`}),listDrainProgress:D(v(),S(Hd).readonly()),testLocation:D(d({id:l()}),d({ok:C(),error:l().optional()}),{auth:`admin`}),listProviders:D(v(),S(yI).readonly()),testConfig:D(d({providerId:l(),locationId:l().optional(),config:y(l(),o())}),d({ok:C(),error:l().optional()}),{auth:`admin`})}},xI=d({bytes:i().int().nonnegative()}),SI=d({reclaimedBytes:i().int().nonnegative(),exhausted:C()}),CI={name:`storage-evictable`,scope:`system`,mode:`collection`,internal:!0,methods:{getEvictableUsage:D(d({locationId:l()}),xI,{auth:`admin`}),evict:D(d({locationId:l(),targetBytes:i().int().positive()}),SI,{kind:`mutation`,auth:`admin`})}},wI={name:`storage-migration`,scope:`system`,mode:`singleton`,methods:{plan:D(qu,td,{auth:`admin`}),start:D(qu,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),status:D(d({jobId:l().optional()}),Qu.nullable(),{auth:`admin`}),cancel:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),movers:D(d({}),S(rd).readonly(),{auth:`admin`}),residue:D(d({}),S(id).readonly(),{auth:`admin`}),drain:D(ad,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),cleanupStart:D(_d,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),cleanupStatus:D(yd,vd.nullable(),{auth:`admin`}),cleanupCancel:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),history:D(d({}),S(Qu).readonly(),{auth:`admin`})}},TI=d({locationId:l(),ownedBytes:i().int().nonnegative(),measuredAtMs:i().int().nonnegative()}),EI={name:`storage-occupancy`,scope:`system`,mode:`collection`,internal:!0,methods:{getOccupancy:D(d({locationIds:S(l()).readonly()}),S(TI).readonly(),{auth:`admin`})}},DI=p(`shouldSaveDiskSpace`,[d({providerId:l().min(1),displayName:l().min(1),configSchema:o(),nodeLocal:C(),shouldSaveDiskSpace:m(!0),minFreePercent:i().min(0).max(100)}),d({providerId:l().min(1),displayName:l().min(1),configSchema:o(),nodeLocal:C(),shouldSaveDiskSpace:m(!1),minFreePercent:m(null)})]),OI=d({ok:C(),error:l().optional()}),kI=d({location:z,relativePath:l(),sizeBytes:i().optional()}),AI=d({uploadId:l()}),jI=d({uploadId:l(),offset:i(),data:b(Uint8Array)}),MI=d({uploadId:l()}),NI=d({uploadId:l()}),PI=d({location:z,relativePath:l()}),FI=d({downloadId:l(),sizeBytes:i()}),II=d({downloadId:l(),offset:i(),length:i()}),LI=d({downloadId:l()}),RI={name:`storage-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getProviderInfo:D(v(),DI,{auth:`admin`}),testLocation:D(d({config:y(l(),o())}),OI,{auth:`admin`}),resolve:D(d({location:z,relativePath:l()}),l(),{auth:`admin`}),write:D(d({location:z,relativePath:l(),data:b(Uint8Array)}),v(),{kind:`mutation`,auth:`admin`}),read:D(d({location:z,relativePath:l()}),b(Uint8Array),{auth:`admin`}),exists:D(d({location:z,relativePath:l()}),C(),{auth:`admin`}),list:D(d({location:z,prefix:l().optional()}),S(l()).readonly(),{auth:`admin`}),delete:D(d({location:z,relativePath:l()}),v(),{kind:`mutation`,auth:`admin`}),getAvailableSpace:D(d({location:z}),i().nullable(),{auth:`admin`}),beginUpload:D(kI,AI,{kind:`mutation`,auth:`admin`}),writeChunk:D(jI,v(),{kind:`mutation`,auth:`admin`}),finalizeUpload:D(MI,v(),{kind:`mutation`,auth:`admin`}),abortUpload:D(NI,v(),{kind:`mutation`,auth:`admin`}),beginDownload:D(PI,FI,{kind:`mutation`,auth:`admin`}),readChunk:D(II,b(Uint8Array),{auth:`admin`}),endDownload:D(LI,v(),{kind:`mutation`,auth:`admin`})}},zI=d({code:l().min(1),label:l().min(1),recommended:C()}),BI=d({signals:S(zI),lastFetchedAt:i()}),VI={name:`stream-signals`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:Object.values(k),runtimeState:BI,durability:`session`,methods:{listSignals:D(v(),S(zI).readonly())}},HI=o().nullable(),UI=y(l(),o()),WI=d({sessionId:l(),profileId:l(),label:l(),cols:i().int().positive(),rows:i().int().positive(),startedAt:i()}),GI=d({profileId:l(),label:l(),description:l().optional(),executable:l().optional(),args:S(l()).readonly().optional(),cwd:l().optional(),environment:S(l()).readonly().optional(),settingsSchema:HI.optional()}),KI=d({instanceId:l(),cameraStableId:l(),nodeId:l(),profileId:l(),profileLabel:l(),name:l(),enabled:C(),executable:l(),args:S(l()).readonly(),cwd:l(),environment:S(l()).readonly(),profileSettings:UI}),qI=d({stableId:l(),nodeId:l(),profileId:l(),profileLabel:l(),name:l(),adoptable:C()}),JI=p(`kind`,[d({seq:i().int().positive(),kind:m(`data`),data:l()}),d({seq:i().int().positive(),kind:m(`exit`),exitCode:i().int(),signal:i().int().optional()})]),YI=d({cursor:i().int().nonnegative(),reset:C(),snapshot:l().optional(),events:S(JI).readonly()}),XI={name:`terminal-session`,scope:`system`,mode:`singleton`,methods:{listProfiles:D(v(),S(GI).readonly(),{auth:`admin`}),listInstances:D(v(),S(KI).readonly(),{auth:`admin`}),createInstance:D(d({targetNodeId:l().min(1),profileId:l().min(1),name:l().trim().min(1).max(160).optional(),executable:l().max(1024).optional(),args:S(l().max(2048)).max(64).optional(),cwd:l().max(1024).optional(),environment:S(l().max(4096)).max(64).optional(),profileSettings:UI.optional()}),KI,{kind:`mutation`,auth:`admin`}),updateInstance:D(d({instanceId:l().min(1),name:l().trim().min(1).max(160).optional(),executable:l().max(1024).optional(),args:S(l().max(2048)).max(64).optional(),cwd:l().max(1024).optional(),environment:S(l().max(4096)).max(64).optional(),profileSettings:UI.optional()}),KI,{kind:`mutation`,auth:`admin`}),deleteInstance:D(d({instanceId:l().min(1)}),v(),{kind:`mutation`,auth:`admin`}),setInstanceEnabled:D(d({instanceId:l().min(1),enabled:C()}),KI,{kind:`mutation`,auth:`admin`}),listLegacyCameras:D(v(),S(qI).readonly(),{auth:`admin`}),adoptLegacyMonitor:D(d({stableId:l().min(1),name:l().trim().min(1).max(160).optional()}),KI,{kind:`mutation`,auth:`admin`}),listSessions:D(v(),S(WI).readonly(),{auth:`admin`}),openSession:D(d({profileId:l(),cols:i().int().positive(),rows:i().int().positive(),executable:l().max(1024).optional(),args:S(l().max(2048)).max(64).optional(),cwd:l().max(1024).optional(),environment:S(l().max(4096)).max(64).optional()}),WI,{kind:`mutation`,auth:`admin`}),resize:D(d({sessionId:l(),cols:i().int().positive(),rows:i().int().positive()}),v(),{kind:`mutation`,auth:`admin`}),pullOutput:D(d({sessionId:l(),afterSeq:i().int().nonnegative(),waitMs:i().int().min(0).max(2e3).default(0),waitForOutput:C().optional()}),YI,{kind:`mutation`,auth:`admin`,timeoutMs:15e3}),writeInput:D(d({sessionId:l(),data:l().max(64*1024)}),v(),{kind:`mutation`,auth:`admin`}),close:D(d({sessionId:l()}),v(),{kind:`mutation`,auth:`admin`})}},ZI=d({urls:f([l(),S(l())]),username:l().optional(),credential:l().optional()}),QI={name:`turn-provider`,scope:`system`,mode:`collection`,methods:{getTurnServers:D(v(),S(ZI).readonly())}},$I=d({credentialId:l(),label:l(),createdAt:i(),lastUsedAt:i().nullable(),transports:S(l()).default([])}),eL={name:`user-passkeys`,scope:`system`,mode:`collection`,internal:!0,methods:{beginRegistration:D(d({userId:l(),username:l()}),d({optionsJSON:y(l(),o())}),{kind:`mutation`,auth:`admin`,access:`create`}),finishRegistration:D(d({userId:l(),response:y(l(),o()),label:l()}),d({success:m(!0),credentialId:l()}),{kind:`mutation`,auth:`admin`,access:`create`}),beginAuthentication:D(d({userId:l().optional()}),d({optionsJSON:y(l(),o())}),{kind:`mutation`,access:`view`,auth:`admin`}),finishAuthentication:D(d({userId:l(),response:y(l(),o())}),d({verified:C()}),{kind:`mutation`,access:`view`,auth:`admin`}),beginDiscoverableAuthentication:D(d({}),d({optionsJSON:y(l(),o())}),{kind:`mutation`,access:`view`,auth:`admin`}),finishDiscoverableAuthentication:D(d({response:y(l(),o())}),d({verified:C(),userId:l().nullable()}),{kind:`mutation`,access:`view`,auth:`admin`}),listPasskeys:D(d({userId:l()}),S($I),{auth:`admin`}),removePasskey:D(d({userId:l(),credentialId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getSecondFactorPreference:D(d({userId:l()}),d({enabled:C()}),{auth:`admin`}),setSecondFactorPreference:D(d({userId:l(),enabled:C()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`})}},tL=x([`cosine`,`dot`,`euclidean`]),nL=y(l(),f([l(),i(),C()])),rL=d({equals:y(l(),f([l(),i(),C()])).optional(),between:y(l(),u([i(),i()])).optional()}),iL=d({id:l(),vector:l(),metadata:nL}),aL=d({id:l(),score:i(),metadata:nL}),oL=d({index:l(),dim:i().int().positive(),metric:tL.default(`cosine`)}),sL=d({index:l(),items:S(iL)}),cL=d({upserted:i(),rejected:i()}),lL=d({index:l(),vector:l(),topK:i().int().positive(),minScore:i().optional(),filter:rL.optional()}),uL=d({matches:S(aL),scanned:i(),truncated:C(),effectiveTopK:i().int().positive()}),dL=d({index:l(),ids:S(l())}),fL=d({index:l(),filter:rL}),pL=d({deleted:i()}),mL=d({index:l(),ids:S(l())}),hL=d({items:S(d({id:l(),metadata:nL}))}),gL=d({index:l(),ids:S(l())}),_L=d({items:S(d({id:l(),vector:l(),metadata:nL}))}),vL=d({index:l(),cursor:i().int().nonnegative().default(0),limit:i().int().positive()}),yL=d({items:S(d({id:l(),metadata:nL})),nextCursor:i().int().nonnegative().nullable()}),bL=`vector-index-dim-conflict`;function xL(e,t,n){return Error(`[${bL}] vector-store: index "${e}" is declared with dim ${String(t)}; refusing to redeclare as ${String(n)}`)}function SL(e){return(e instanceof Error?e.message:String(e)).includes(`[${bL}]`)}var CL=d({index:l()}),wL=d({backend:l(),count:i(),dim:i(),metric:tL,bytes:i().optional(),exact:C()}),TL={name:`vector-store`,scope:`system`,mode:`singleton`,internal:!0,methods:{declareIndex:D(oL,v(),{kind:`mutation`,auth:`admin`}),upsert:D(sL,cL,{kind:`mutation`,auth:`admin`}),query:D(lL,uL,{auth:`admin`}),getByIds:D(mL,hL,{auth:`admin`}),fetchByIds:D(gL,_L,{auth:`admin`}),scan:D(vL,yL,{auth:`admin`}),deleteByIds:D(dL,pL,{kind:`mutation`,auth:`admin`}),deleteByFilter:D(fL,pL,{kind:`mutation`,auth:`admin`}),stats:D(CL,wL,{auth:`admin`})}},EL=24,DL=3,OL=x([`queue-full`,`camera-backoff`,`sleeping`,`camera-refused`,`no-keyframe`,`decode-failed`,`no-catalog-row`,`unsupported`,`unknown-device`,`uid-missing`]),kL=x([`deferred`,`final`]),AL=`x-camstack-reason`,jL=500;function ML(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 NL=`x-camstack-reason-code`,PL=`x-camstack-disposition`,FL=`x-camstack-clip-transport`,IL=d({id:l(),source:l(),kind:x([`motion`,`object`,`audio`,`native`]),timeRange:d({startMs:i(),endMs:i()}),labels:S(l()).max(3).optional(),thumbnail:l().optional(),stillAtMs:i().optional(),eventIds:S(l()).optional(),eventCount:i().int().nonnegative().optional(),holes:S(d({startMs:i(),endMs:i()})).optional(),thumbnailMint:l().optional(),thumbnailUnavailable:d({reason:x([`sleeping`,`camera-refused`,`no-keyframe`,`unsupported`])}).optional(),catalogAsOf:i().optional(),nativeTypes:S(l()).optional(),behaviours:S(l()).optional(),streams:d({sub:d({id:l(),bytes:i().optional()}).optional(),main:d({id:l(),bytes:i().optional()}).optional()}).optional(),supportSub:C().optional(),playable:C().optional(),unplayableReason:l().optional(),inProgress:C().optional()}),LL=d({playbackUrl:l(),format:x([`hls`,`mp4`]).optional(),served:E.optional(),playbackEndpoints:S(l()).optional(),token:l().optional()}),RL=x([`authorised`]),zL=50*1024*1024,BL=500*1024*1024,VL=d({base64:l(),contentType:l(),name:l(),bytes:i().int().nonnegative(),served:E,durationMs:i().positive().optional()}),HL=d({ticket:En,contentType:l(),name:l(),served:E,durationMs:i().positive().optional()}),UL=x([`opus`,`pcmu`,`none`]),WL=x([`not-requested`,`unsupported-ask`]),GL=d({url:l().min(1),expiresAtMs:i(),transport:m(`forward-only`),served:E,servedAudio:UL,audioReason:WL.optional()}),KL=[.25,.5,1,1.5,2,4,8],qL=[.25,.5,1,1.5,2,4],JL=[.25,.5,1],YL=d({transport:x([`stream`,`file`]),seek:x([`forward`,`free`]),stepBack:C(),scrub:C(),rates:S(i().positive()).min(1).readonly()}),XL=d({state:x([`ok`,`sleeping`,`unreachable`,`no-storage`,`index-empty`]),reason:l().optional(),catalogAsOf:i().optional()}),ZL=d({source:l(),label:l(),addonId:l().optional(),availability:XL}),QL={name:`videoclips`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/clips-browser`,tab:`recording`,topTab:!0,label:`Clips`,order:100}},methods:{listClips:D(d({deviceId:i(),since:i(),until:i(),limit:i().int().positive().optional(),provider:l().min(1)}),S(IL).readonly(),{kind:`query`,auth:`protected`}),listSources:D(d({deviceId:i()}),S(ZL).readonly(),{kind:`query`,auth:`protected`}),getClipPlayback:D(d({deviceId:i(),clipId:l(),profile:E.optional()}),LL,{kind:`query`,auth:`protected`}),readClipBytes:Nr(d({deviceId:i(),clipId:l().min(1),provider:l().min(1),profile:E.optional(),maxBytes:i().int().positive().optional(),wake:RL.optional()}),VL,{kind:`query`,auth:`protected`}),offerClipBytes:Nr(d({deviceId:i(),clipId:l().min(1),provider:l().min(1),profile:E.optional(),maxBytes:i().int().positive().optional(),wake:RL.optional()}),HL,{kind:`query`,auth:`protected`}),dialClipStream:Nr(d({deviceId:i(),clipId:l().min(1),provider:l().min(1),profile:E.optional(),audio:UL.optional()}),GL,{kind:`query`,auth:`protected`}),getPlaybackOptions:Nr(d({deviceId:i(),provider:l().min(1)}),YL,{kind:`query`,auth:`protected`})}},$L={stream:{transport:`stream`,seek:`forward`,stepBack:!1,scrub:!1,rates:qL},realtimeStream:{transport:`stream`,seek:`forward`,stepBack:!1,scrub:!1,rates:JL},file:{transport:`file`,seek:`free`,stepBack:!0,scrub:!0,rates:KL}},eR=d({viewportWidth:i().int().positive().optional(),viewportHeight:i().int().positive().optional(),devicePixelRatio:i().positive().optional(),downlinkMbps:i().nonnegative().optional(),prefersTier:l().optional()}).partial(),tR=p(`kind`,[d({kind:m(`adaptive`)}),d({kind:m(`profile`),profile:E}),d({kind:m(`cam-stream`),camStreamId:l().min(1)})]),nR=d({id:l(),label:l(),target:tR,codec:l().nullable(),resolution:d({width:i(),height:i()}).nullable(),status:x([`idle`,`connecting`,`streaming`,`error`,`stopped`]).nullable(),inputFps:i().nullable(),bitrateKbps:i().nullable()}),rR=d({cause:x([`loss`,`stall`,`healthy`]),tier:E.nullable(),forcedTranscodeDown:C(),lossRatio:i().nullable(),clientKbps:i().nullable(),stalledForMs:i().nullable(),serverSending:C().nullable(),at:i(),causeDetail:l().optional()}),iR=[`stall-building`,`delivery`,`no-evidence`,`warming`,`cooldown`,`capacity`,`try-unclean`,`try-backoff`,`trial`,`suspended`],aR=[`delivery`,`loss`,`rtt`,`shared-telemetry`],oR=d({code:l(),nextTier:E,deliveryRatio:i().nullable(),deliveryWindowMs:i().nullable(),climbDeliveryRatio:i(),capacityKbps:i().nullable(),probeKbps:i().nullable(),nextTierKbps:i().nullable(),capacityMargin:i(),neededKbps:i().nullable(),tryBlockedBy:l().nullable(),tryDeliveryRatio:i().optional(),tryMaxLossRatio:i().optional(),retryInMs:i().nullable(),lastRevert:d({tier:E,deliveryRatio:i().nullable(),stalled:C(),at:i()}).nullable(),trialForMs:i().nullable(),trialMs:i().nullable(),healthyForMs:i().nullable(),requiredHealthyMs:i().nullable(),since:i(),summary:l()}),sR=d({tier:E,failures:i().int().nonnegative()}),cR=d({sessionId:l(),alive:C(),observedAt:i(),brokerId:l().nullable(),camStreamId:l().nullable(),sourceKind:x([`native`,`derived`,`unknown`]),adaptive:C(),servedTier:E.nullable(),ingestNodeId:l().nullable(),ingestIsRemote:C().nullable(),sourceCodec:l().nullable(),negotiatedCodec:l().nullable(),egressLeg:x([`copy`,`transcode`,`unknown`]),brokerStatus:l().nullable(),brokerCodec:l().nullable(),brokerBitrateKbps:i().nullable(),brokerInputFps:i().nullable(),brokerUptimeMs:i().nullable(),rtpPacketsSent:i().nullable(),trackMode:x([`live`,`recorded`]).nullable(),lastDecision:rR.nullable(),tierFailures:S(sR),upgradeCount:i().nullable(),climbHold:oR.nullable().optional()}),lR={name:`webrtc-session`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,preferredProvider:`stream-broker`,deviceTypes:[k.Camera],methods:{listStreams:D(d({deviceId:i().int().nonnegative()}),S(nR)),createSession:D(d({deviceId:i().int().nonnegative(),target:tR,hints:eR.optional(),relayOnly:C().optional(),consumerAttribution:Mg.optional()}),d({sessionId:l(),sdpOffer:l()}),{kind:`mutation`}),handleOffer:D(d({deviceId:i().int().nonnegative(),target:tR.optional(),sdpOffer:l(),sessionId:l().optional(),relayOnly:C().optional(),nonTrickle:C().optional(),disableTurn:C().optional(),disableIpv6:C().optional(),consumerAttribution:Mg.optional(),hints:eR.optional(),talkback:C().optional()}),d({sessionId:l(),sdpAnswer:l()}),{kind:`mutation`}),handleAnswer:D(d({deviceId:i().int().nonnegative(),sessionId:l(),sdpAnswer:l()}),v(),{kind:`mutation`}),addIceCandidate:D(d({deviceId:i().int().nonnegative(),sessionId:l(),candidate:l(),sdpMid:l().nullable().optional(),sdpMLineIndex:i().int().nullable().optional()}),v(),{kind:`mutation`}),getIceCandidates:D(d({deviceId:i().int().nonnegative(),sessionId:l()}),d({candidates:S(d({candidate:l(),sdpMid:l().nullable(),sdpMLineIndex:i().int().nullable()})),done:C()}),{kind:`query`}),closeSession:D(d({deviceId:i().int().nonnegative(),sessionId:l()}),v(),{kind:`mutation`}),hasAdaptiveBitrate:D(d({deviceId:i().int().nonnegative(),profile:E}),C()),getSessionState:D(d({deviceId:i().int().nonnegative(),sessionId:l()}),d({pendingRenegotiation:d({target:tR,epoch:i()}).nullable(),alive:C()})),applyDownlinkProbe:D(d({deviceId:i().int().nonnegative(),sessionId:l(),downlinkMbps:i().nonnegative()}),d({outcome:x([`switching`,`held`]),tier:E.nullable(),reason:l()}),{kind:`mutation`}),getSessionDebug:D(d({deviceId:i().int().nonnegative(),sessionId:l()}),cR,{kind:`query`})},mount:{kind:`server-provided`}},uR=d({childDeviceIds:S(i()).readonly(),hiddenChildIds:S(i()).readonly()}),dR={name:`accessories`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera,k.Hub,k.Switch,k.Light,k.Sensor,k.Thermostat,k.Cover,k.Lock,k.Fan,k.MediaPlayer,k.AlarmPanel,k.Generic],methods:{setChildHidden:D(d({deviceId:i().int().nonnegative(),childDeviceId:i().int().nonnegative(),hidden:C()}),v(),{kind:`mutation`,auth:`admin`})},events:{onAccessoriesChanged:{data:d({deviceId:i(),childDeviceIds:S(i()).readonly(),hiddenChildIds:S(i()).readonly()})},onChildVisibilityChanged:{data:d({deviceId:i(),childDeviceId:i(),hidden:C()})}},status:{schema:uR,kind:`command-driven`}},fR=x([`install`,`update`,`uninstall`,`restart`]),pR=x([`queued`,`fetching`,`staged`,`validating`,`applying`,`restarting`,`applied`,`done`,`failed`,`skipped`]),mR=x([`framework`,`addon`]),hR=d({tsMs:i(),nodeId:l(),packageName:l(),phase:pR,message:l()}),gR=d({taskId:l(),nodeId:l(),packageName:l(),fromVersion:l().nullable(),toVersion:l(),target:mR,phase:pR,stagedPath:l().nullable(),attempts:i(),steps:S(hR),error:l().nullable(),startedAtMs:i().nullable(),finishedAtMs:i().nullable()}),_R=x([`running`,`completed`,`failed`,`partially-failed`,`cancelled`]),vR=x([`single`,`bulk`,`cluster`]),yR=d({jobId:l(),kind:fR,createdAtMs:i(),createdBy:l(),scope:vR,tasks:S(gR),state:_R,schemaVersion:m(1)}),bR=x([`debug`,`info`,`warn`,`error`]),xR=x([`off`,`latest`,`beta`]),SR=x([`off`,`latest`,`beta`,`inherit`]),CR=d({id:l(),name:l().optional(),version:l().optional(),description:l().optional(),icon:l().optional(),color:l().optional(),capabilities:S(o()).readonly().optional(),packageName:l(),packageVersion:l(),packageDisplayName:l().optional(),bundle:d({displayName:l(),description:l().optional(),icon:l().optional()}).optional(),protected:C().optional(),removable:C().optional()}),wR=d({pid:i().optional(),mode:l(),state:l()}),TR=d({phase:x([`pending`,`healthy`,`failed`]),retryCount:i(),firstFailureAt:i().nullable(),lastAttemptAt:i().nullable(),lastError:d({message:l(),stack:l().optional()}).nullable(),nextRetryAt:i().nullable(),alertEmitted:C(),retrying:C(),inGracePeriod:C()}),ER=d({manifest:CR,declaration:o().optional(),source:l(),installSource:l().optional(),process:wR.optional(),hasBackup:C().optional(),health:TR.nullable().optional()}),DR=d({name:l(),version:l(),dir:l(),installSource:l().optional()}),OR=d({name:l(),currentVersion:l(),latestVersion:l(),category:x([`addon`,`core`]),requiresRestart:C(),isSystem:C()}),kR=d({version:l(),publishedAt:l(),deprecated:l().optional(),distTags:S(l()).readonly()}),AR=d({name:l(),version:l(),description:l(),keywords:S(l()).readonly(),publishedAt:l(),author:l(),installed:C(),installedVersion:l().optional()}),jR=d({channel:xR,intervalSeconds:i(),updateCheckIntervalSeconds:i()}),MR=SR,NR=o(),PR=o(),FR=o(),IR=x([`uninstalled`,`not-installed`,`refused`,`failed`,`pending-reconnect`]),LR=d({nodeId:l(),outcome:IR,error:l().optional(),addonIds:S(l()).readonly(),runnersStopped:S(l()).readonly(),warnings:S(l()).readonly()}),RR=d({success:C(),packageName:l(),results:S(LR).readonly()}),zR=d({packageName:l(),nodeId:l(),nodeName:l(),isHub:C(),isOnline:C(),version:l().nullable(),addonIds:S(l()).readonly(),source:x([`live`,`recorded`]),onHub:C()}),BR=d({installations:S(zR).readonly(),unreachable:S(d({nodeId:l(),error:l()})).readonly()}),VR=x([`queued`,`updating`,`done`,`done-pending-restart`,`failed`]),HR=d({name:l(),isSystem:C(),fromVersion:l(),toVersion:l(),status:VR,error:l().optional(),startedAtMs:i().optional(),completedAtMs:i().optional()}),UR=x([`regular`,`system`,`restarting`,`finalizing`]);d({id:l(),nodeId:l(),startedAtMs:i(),completedAtMs:i().optional(),total:i(),completed:i(),failed:i(),current:l().nullable(),phase:UR,cancelled:C(),items:S(HR).readonly()});var WR=d({packageName:l(),currentVersion:l(),latestVersion:l().nullable(),hasUpdate:C(),description:l().optional(),buildId:l().nullable()}),GR=d({timestamp:l(),level:l(),message:l(),scope:l().optional()}),KR=o(),qR=d({addonId:l().min(1),action:l().min(1),input:o()}),JR={name:`addons`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{list:D(d({nodeId:l().optional()}).optional(),S(ER).readonly()),getLogs:D(d({addonId:l(),limit:i().min(1).max(500).default(100),level:bR.optional()}),S(KR)),listPackages:D(v(),S(DR).readonly()),installPackage:D(d({packageName:l(),version:l().optional()}),PR,{kind:`mutation`,auth:`admin`}),installFromWorkspace:D(d({packageName:l()}),PR,{kind:`mutation`,auth:`admin`}),isWorkspaceAvailable:D(v(),C()),listWorkspacePackages:D(v(),S(o()).readonly()),uninstallPackage:D(d({packageName:l().min(1),nodeId:l().optional(),everywhere:C().optional()}),RR,{kind:`mutation`,auth:`admin`}),listInstallations:D(d({packageName:l().optional()}),BR,{auth:`admin`}),reloadPackages:D(v(),FR,{kind:`mutation`,auth:`admin`}),searchAvailable:D(d({query:l().optional()}),S(AR)),listUpdates:D(d({nodeId:l().optional()}),S(OR).readonly(),{auth:`admin`}),updatePackage:D(d({name:l().min(1),version:l().optional(),nodeId:l().optional()}),o(),{kind:`mutation`,auth:`admin`}),rollbackPackage:D(d({name:l().min(1)}),d({rolledBackTo:l().nullable()}),{kind:`mutation`,auth:`admin`}),forceRefresh:D(d({nodeId:l().optional()}),o(),{kind:`mutation`,auth:`admin`}),restartServer:D(d({confirm:m(!0)}),o(),{kind:`mutation`,auth:`admin`}),getLastRestart:D(v(),d({kind:x([`framework-update`,`manual`,`system`,`framework-bulk-update`]),packageName:l().optional(),fromVersion:l().optional(),toVersion:l().optional(),requestedBy:l().optional(),requestedAt:i()}).nullable(),{auth:`admin`}),listFrameworkPackages:D(v(),S(WR).readonly(),{auth:`admin`}),listCapabilityProviders:D(d({capName:l().min(1)}),S(d({addonId:l(),mode:x([`singleton`,`collection`]),isActive:C()})).readonly()),setCapabilityProviderEnabled:D(d({capName:l().min(1),addonId:l().min(1),enabled:C()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getVersions:D(d({name:l()}),S(kR).readonly()),restartAddon:D(d({addonId:l()}),NR,{kind:`mutation`,auth:`admin`}),retryLoad:D(d({packageName:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),getAutoUpdateSettings:D(v(),jR,{auth:`admin`}),setAutoUpdateSettings:D(d({channel:xR,intervalSeconds:i().min(300).max(86400).optional(),updateCheckIntervalSeconds:i().min(900).max(604800).optional()}),o(),{kind:`mutation`,auth:`admin`}),getAddonAutoUpdate:D(d({addonId:l()}),MR,{auth:`admin`}),setAddonAutoUpdate:D(d({addonId:l(),channel:SR}),o(),{kind:`mutation`,auth:`admin`}),applyAutoUpdateToAll:D(d({channel:xR}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),custom:D(qR,o(),{kind:`mutation`}),startJob:D(d({kind:x([`install`,`update`,`uninstall`,`restart`]),targets:S(d({name:l().min(1),version:l().min(1)})).min(1),nodeIds:S(l()).optional()}),d({jobId:l()}),{kind:`mutation`,auth:`admin`}),getJob:D(d({jobId:l()}),yR.nullable(),{auth:`admin`}),listJobs:D(d({activeOnly:C().optional()}),S(yR),{auth:`admin`}),cancelJob:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),onAddonLogs:D(d({addonId:l(),level:bR.optional()}),GR,{kind:`subscription`})},mount:{kind:`server-provided`}},YR=d({co2Ppm:i().min(0).optional(),vocPpb:i().min(0).optional(),pm25:i().min(0).optional(),pm10:i().min(0).optional(),aqi:i().optional(),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),XR={name:`air-quality-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:YR,kind:`push`},runtimeState:YR,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},ZR=d({lux:i().min(0),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),QR={name:`ambient-light-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:ZR,kind:`push`},runtimeState:ZR,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},$R=d({className:l(),hits:i().int().nonnegative(),avgScore:i().min(0).max(1),peakScore:i().min(0).max(1)}),ez=d({ts:i().int(),windowSec:i().int().positive(),level:d({rms:i(),dbfs:i()}),peakDbfs:i(),avgDbfs:i(),current:d({className:l(),score:i().min(0).max(1),timestamp:i().int()}).nullable(),byClass:S($R).readonly()}),tz=d({ts:i().int(),dbfs:i().nullable(),peakDbfs:i(),avgDbfs:i(),topClass:l().nullable(),topScore:i().min(0).max(1).nullable()}),nz=d({points:S(tz).readonly(),effectiveSampleEveryMs:i().int().positive(),windowMsActual:i().int().nonnegative()}),rz={name:`audio-metrics`,scope:`device`,mode:`singleton`,deviceTypes:[k.Camera],methods:{getCurrentSnapshot:D(d({deviceId:i()}),ez.nullable()),getHistory:D(d({deviceId:i(),windowSec:i().int().positive().optional(),sampleEveryMs:i().int().positive().optional()}),nz)},runtimeState:ez,durability:`session`},iz=d({enabled:C(),isRunning:C(),lastTriggeredAt:i(),lastError:l().nullable(),lastChangedAt:i()}),az={name:`automation-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Automation],methods:{enable:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`admin`}),disable:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`admin`}),trigger:D(d({deviceId:i().int().nonnegative(),skipCondition:C().optional()}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:iz,kind:`push`},runtimeState:iz,durability:`session`},oz=d({percentage:i().min(0).max(100).nullable(),charging:x([`dc`,`solar`,`none`,`unknown`]),sleeping:C(),lastUpdated:i(),lastContactAt:i().optional(),lastFullRefreshAt:i().optional(),binary:C().optional()}),sz={name:`battery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera,k.Sensor,k.Button,k.Switch,k.PetFeeder,k.Container],methods:{wakeForStream:D(d({deviceId:i(),timeoutMs:i().int().min(500).max(3e4).default(8e3)}),d({awoke:C(),durationMs:i()}),{kind:`mutation`})},composedMethods:{wakeForStream:{kind:`answer`,value:{awoke:!1,durationMs:0}}},events:{onStatusChanged:{data:d({deviceId:i(),status:oz})}},status:{schema:oz,kind:`push`,empty:{percentage:null,charging:`unknown`,sleeping:!1,lastUpdated:0}},runtimeState:oz,durability:`restored`,volatileStateFields:[`lastUpdated`]},cz=d({on:C(),lastChangedAt:i()}),lz={name:`binary`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:cz,kind:`push`},runtimeState:cz,durability:`restored`,volatileStateFields:[`lastChangedAt`]},uz=d({percentage:i().min(0).max(100),lastChangedAt:i()}),dz={name:`brightness`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Light],methods:{setBrightness:D(d({deviceId:i().int().nonnegative(),percentage:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`})},events:{onBrightnessChanged:{data:d({deviceId:i(),percentage:i().min(0).max(100),lastChangedAt:i()})}},status:{schema:uz,kind:`command-driven`},runtimeState:uz,durability:`session`},fz={name:`button`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Button],methods:{press:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`})}},pz=x([`ha`,`addon`]),mz=d({id:l().min(1),name:l().min(1),source:pz,enabled:C()}),hz=d({id:l().min(1),calendarId:l().min(1),title:l(),startMs:i().int(),endMs:i().int(),allDay:C().optional(),description:l().optional(),location:l().optional()}),gz=d({calendarIds:S(l().min(1)).max(64).optional(),startMs:i().int(),endMs:i().int()}),_z={name:`calendar-source`,scope:`system`,mode:`collection`,internal:!0,providerKind:`calendar`,methods:{listCalendars:D(v(),S(mz).readonly(),{auth:`admin`}),listEvents:D(gz,S(hz).readonly(),{auth:`admin`})}},vz=l().regex(/^#[0-9A-Fa-f]{6}$/,`expected #RRGGBB`),yz=mz.extend({id:l().min(1),providerAddonId:l().min(1).optional(),defaultColor:vz,color:vz,visible:C()}),bz=d({visible:C().optional(),color:vz.optional()}),xz=d({calendars:y(l(),bz)}),Sz=d({calendarId:l().min(1),visible:C().optional(),color:vz.nullable().optional()}),Cz={name:`calendars`,scope:`system`,mode:`singleton`,methods:{listCalendars:D(v(),S(yz).readonly(),{auth:`admin`}),listEvents:D(gz,S(hz).readonly(),{auth:`admin`}),getPreferences:D(d({}),xz,{auth:`admin`,caller:`required`}),setCalendarPreference:D(Sz,xz,{auth:`admin`,kind:`mutation`,caller:`required`})}},wz=d({host:l(),port:i().int().positive().optional(),onvifPort:i().int().positive().optional(),rtspPort:i().int().positive().optional(),https:C().optional(),username:l().optional(),password:l().optional(),onvifProfile:l().optional()}),Tz=d({host:l(),port:i().int().positive().nullable(),onvifPort:i().int().positive().nullable(),rtspPort:i().int().positive().nullable(),https:C().nullable(),hasUsername:C(),hasPassword:C(),onvifProfile:l().nullable()}),Ez={name:`camera-credentials`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{getCredentials:D(d({deviceId:i()}),wz.nullable(),{kind:`query`,auth:`admin`})},status:{schema:Tz,kind:`command-driven`}},Dz=d({x:i().min(0).max(1),y:i().min(0).max(1),width:i().gt(0).max(1),height:i().gt(0).max(1)}),Oz=d({deviceId:i().int().positive(),source:Dz,cell:Dz}),kz=d({profile:x([`high`,`mid`,`low`]),offered:C(),missingSources:S(i().int().positive()),canvas:l(),published:C()}),Az=d({instanceId:l(),deviceId:i().int().nonnegative(),name:l(),fps:i().int(),cells:S(Oz),profiles:S(kz)}),jz=d({deviceId:i().int().nonnegative(),name:l().min(1).max(160).optional(),fps:i().int().min(1).max(60).optional(),publishedProfiles:S(x([`high`,`mid`,`low`])).max(3).optional(),cells:S(Oz).max(16)}),Mz={name:`camera-grid-layout`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],exposesDeviceSettings:!0,methods:{getLayout:D(d({deviceId:i().int().nonnegative()}),Az.nullable(),{auth:`admin`}),saveLayout:D(jz,Az,{kind:`mutation`,auth:`admin`})}},Nz=d({detected:C(),lastChangedAt:i()}),Pz={name:`carbon-monoxide`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:Nz,kind:`push`},runtimeState:Nz,durability:`restored`,volatileStateFields:[`lastChangedAt`]},Fz=x([`off`,`heat`,`cool`,`auto`,`heat_cool`,`fan_only`,`dry`]),Iz=d({mode:Fz,availableModes:S(Fz),fanMode:l(),availableFanModes:S(l()),preset:l(),availablePresets:S(l()),target:i().nullable(),targetHigh:i().nullable(),targetLow:i().nullable(),targetHumidity:i().min(0).max(100).nullable(),currentTemp:i().nullable(),currentHumidity:i().min(0).max(100).nullable(),swingVertical:C().nullable(),swingHorizontal:C().nullable(),lastFetchedAt:i()}),Lz={name:`climate-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Thermostat,k.Climate],methods:{setMode:D(d({deviceId:i().int().nonnegative(),mode:Fz}),v(),{kind:`mutation`,auth:`protected`}),setFanMode:D(d({deviceId:i().int().nonnegative(),fanMode:l().min(1)}),v(),{kind:`mutation`,auth:`protected`}),setPreset:D(d({deviceId:i().int().nonnegative(),preset:l().min(1)}),v(),{kind:`mutation`,auth:`protected`}),setTarget:D(d({deviceId:i().int().nonnegative(),target:i()}),v(),{kind:`mutation`,auth:`protected`}),setTargetRange:D(d({deviceId:i().int().nonnegative(),targetLow:i(),targetHigh:i()}),v(),{kind:`mutation`,auth:`protected`}),setTargetHumidity:D(d({deviceId:i().int().nonnegative(),targetHumidity:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`}),setSwingVertical:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`}),setSwingHorizontal:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:Iz,kind:`push`},runtimeState:Iz,durability:`session`},Rz=d({r:i().int().min(0).max(255),g:i().int().min(0).max(255),b:i().int().min(0).max(255)}),zz=d({h:i().min(0).max(360),s:i().min(0).max(100),v:i().min(0).max(100)}),Bz=p(`mode`,[d({mode:m(`rgb`),rgb:Rz}),d({mode:m(`hsv`),hsv:zz}),d({mode:m(`mired`),mireds:i().int().min(50).max(1e3)})]),Vz=d({mode:x([`rgb`,`hsv`,`mired`]),rgb:Rz.optional(),hsv:zz.optional(),mireds:i().int().optional(),lastChangedAt:i()}),Hz={name:`color`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Light],methods:{setColor:D(d({deviceId:i().int().nonnegative(),color:Bz}),v(),{kind:`mutation`,auth:`protected`})},events:{onColorChanged:{data:d({deviceId:i(),mode:x([`rgb`,`hsv`,`mired`]),rgb:Rz.optional(),hsv:zz.optional(),mireds:i().int().optional(),lastChangedAt:i()})}},status:{schema:Vz,kind:`command-driven`},runtimeState:Vz,durability:`session`},Uz=2e4,Wz=p(`outcome`,[d({outcome:m(`validated`),latencyMs:i().nonnegative().optional(),detail:l().optional()}).strict(),d({outcome:m(`rejected`),error:l()}).strict(),d({outcome:m(`inconclusive`),error:l()}).strict()]),Gz=d({settings:y(l(),o())}),Kz=d({label:l()}),qz={name:`connection-test`,scope:`system`,mode:`collection`,methods:{testSettings:D(Gz,Wz,{kind:`mutation`,auth:`admin`}),describeTest:D(v(),Kz,{auth:`admin`})}},Jz=d({connected:C(),lastChangedAt:i()}),Yz={name:`connectivity`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:Jz,kind:`push`},runtimeState:Jz,durability:`restored`,volatileStateFields:[`lastChangedAt`]},Xz=x([`days`,`hours`,`cycles`]),Zz=d({value:i().min(0).nullable(),unit:Xz}),Qz=d({key:l().min(1),label:l().min(1),level:i().min(0).max(100).nullable(),status:x([`ok`,`replace`]).nullable(),lastResetAt:i().nullable(),resettable:C(),remaining:Zz.optional()}),$z=d({items:S(Qz),lastChangedAt:i()}),eB={name:`consumables`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:Object.values(k),deviceConfig:{ui:{kind:`widget`,widgetId:`host/consumables-panel`,tab:`consumables`,topTab:!0,label:`Consumables`,order:5}},methods:{reset:D(d({deviceId:i().int().nonnegative(),key:l().min(1)}),v(),{kind:`mutation`,auth:`admin`})},composedMethods:{reset:{kind:`refuse`,reason:`a composed consumable is not resettable until commands (forward) arrive — slice 3`}},status:{schema:$z,kind:`push`,empty:{items:[],lastChangedAt:0},itemArray:{path:`items`,keyField:`key`,labelField:`label`,itemSchema:Qz,emptyItem:{key:``,label:``,level:null,status:null,lastResetAt:null,resettable:!1}}},runtimeState:$z.extend({lastFetchedAt:i()}),durability:`restored`,volatileStateFields:[`lastChangedAt`,`lastFetchedAt`]},tB=d({entryOpen:C(),lastChangedAt:i()}),nB={name:`contact`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:tB,kind:`push`},runtimeState:tB,durability:`restored`,volatileStateFields:[`lastChangedAt`]},rB=x([`numeric`,`select`,`text`,`datetime`]),iB=d({kind:rB,value:f([i(),l()]),options:S(l()),lastChangedAt:i(),unit:l().optional(),min:i().optional(),max:i().optional(),step:i().optional(),precision:i().int().min(0).max(10).optional(),format:x([`date`,`time`,`datetime`]).optional()}),aB=p(`kind`,[d({kind:m(`numeric`),value:i()}),d({kind:m(`select`),value:l().min(1)}),d({kind:m(`text`),value:l()}),d({kind:m(`datetime`),value:l().min(1)})]),oB={name:`control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Control],methods:{setValue:D(d({deviceId:i().int().nonnegative(),control:aB}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:iB,kind:`push`},runtimeState:iB,durability:`session`},sB=x([`open`,`opening`,`closing`,`closed`,`stopped`]),cB=d({state:sB,position:i().min(0).max(100).nullable(),tiltPosition:i().min(0).max(100).nullable(),lastChangedAt:i()}),lB={name:`cover`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Cover],methods:{open:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),close:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),stop:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),setPosition:D(d({deviceId:i().int().nonnegative(),position:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`}),setTiltPosition:D(d({deviceId:i().int().nonnegative(),tiltPosition:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:cB,kind:`push`},runtimeState:cB,durability:`restored`,volatileStateFields:[`lastChangedAt`]},uB=x([`auto`,`day`,`night`,`schedule`]),dB=d({min:i(),max:i(),step:i()}),fB=d({mode:uB,sensitivity:i().optional(),switchDelaySec:i().optional(),lastFetchedAt:i()}),pB=d({modes:S(uB),supportsSensitivity:C(),sensitivity:dB.optional(),supportsSwitchDelay:C(),switchDelaySec:dB.optional()}),mB=d({mode:uB.optional(),sensitivity:i().optional(),switchDelaySec:i().optional()}),hB={name:`day-night`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`day-night`,tab:`image`}},methods:{getOptions:D(d({deviceId:i()}),pB),setSettings:D(d({deviceId:i(),settings:mB}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:fB,kind:`poll`},runtimeState:fB,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},gB=d({online:C(),lastChangedAt:i()}),_B={name:`device-status`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onStatusChanged:{data:d({deviceId:i(),status:gB})}},status:{schema:gB,kind:`push`},runtimeState:gB,durability:`restored`,volatileStateFields:[`lastChangedAt`]},vB=d({lastPressedAt:i().nullable(),pressCountSinceStart:i()}),yB=d({deviceId:i(),timestamp:i()}),bB={name:`doorbell`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Button,k.Camera],methods:{},events:{onPressed:{data:yB,fromState:{field:`lastPressedAt`,on:`advance`}}},status:{schema:vB,kind:`push`},runtimeState:vB,durability:`restored`},xB=x([`date`,`time`,`datetime`]),SB=d({value:l(),format:xB.optional(),lastFetchedAt:i()}),CB={name:`enum-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:SB,kind:`push`},runtimeState:SB,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},wB=d({deviceId:i(),eventType:l(),data:y(l(),o()).nullable(),timestamp:i(),seq:i()}),TB=d({eventTypes:S(l()),lastEvent:wB.nullable(),eventCountSinceStart:i()}),EB={name:`event-emitter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.EventEmitter],methods:{},events:{onEvent:{data:wB}},status:{schema:TB,kind:`push`},runtimeState:TB,durability:`session`},DB=d({id:l(),name:l(),sampleCount:i().int().nonnegative(),coverMediaId:i().int().optional(),coverBase64:l().optional()}),OB=d({id:l(),source:x([`detected`,`photo`]),addedAt:i().int(),deviceId:i().int().optional(),base64:l().optional()}),kB=d({sampleId:l(),enrolledAt:i().int(),deviceId:i().int().optional(),source:x([`detected`,`photo`]),mediaId:i().int().optional(),comparable:C(),selfMean:i().nullable(),bestForeign:d({identityId:l(),name:l(),score:i()}).optional(),suspicion:i()}),AB=d({identityId:l(),name:l(),modelId:l(),totalSamples:i().int(),comparableSamples:i().int(),flagged:i().int(),flagThreshold:i(),rows:S(kB).readonly()}),jB=d({faceId:l(),deviceId:i().int(),trackId:l(),timestamp:i().int(),recognizedIdentityId:l().optional(),identityName:l().optional(),assigned:C(),base64:l().optional(),cropUrl:l().optional(),faceBbox:sh.optional(),keyFrameMediaId:i().int().optional(),bestMatchScore:i().optional(),nativeFaceShortSidePx:i().optional(),suggestedIdentityId:l().optional(),suggestedMatchScore:i().optional()}),MB=x([`unassigned`,`recognized`,`identified`,`all`]),NB=x([`timestamp`,`suggestionConfidence`]),PB=x([`asc`,`desc`]),FB=d({faceIds:S(l()).readonly(),representativeFaceId:l(),size:i().int(),cohesion:i()}),IB=d({mediaId:i().int(),kind:l(),url:l(),sizeBytes:i(),timestamp:i()}),LB={name:`face-gallery`,scope:`system`,mode:`singleton`,methods:{listIdentities:D(d({includeCrops:C().optional()}).optional(),S(DB).readonly()),createIdentity:D(d({name:l().min(1)}),DB,{kind:`mutation`,auth:`admin`}),renameIdentity:D(d({id:l(),name:l().min(1)}),v(),{kind:`mutation`,auth:`admin`}),deleteIdentity:D(d({id:l()}),v(),{kind:`mutation`,auth:`admin`}),listIdentitySamples:D(d({identityId:l()}),S(OB).readonly()),auditIdentitySamples:D(d({identityId:l().min(1)}),AB,{auth:`admin`}),removeSample:D(d({identityId:l(),sampleId:l()}),v(),{kind:`mutation`,auth:`admin`}),listRecentFaces:D(d({deviceId:i().int().optional(),deviceIds:S(i().int()).optional(),limit:i().int().positive().optional(),filter:MB.optional(),since:i().int().optional(),until:i().int().optional(),sortBy:NB.optional(),sortDirection:PB.optional(),includeCrops:C().optional()}).optional(),S(jB).readonly()),getFaceByTrack:D(d({deviceId:i().int(),trackId:l()}),jB.nullable()),getFaceMedia:D(d({faceId:l()}),S(IB).readonly()),assignFace:D(d({faceId:l(),identityId:l()}),v(),{kind:`mutation`,auth:`admin`}),unassignFace:D(d({faceId:l()}),v(),{kind:`mutation`,auth:`admin`}),deleteFace:D(d({faceId:l()}),v(),{kind:`mutation`,auth:`admin`}),assignFaces:D(d({faceIds:S(l()).min(1),identityId:l()}),d({assigned:i().int(),failed:S(l()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignFaces:D(d({faceIds:S(l()).min(1)}),d({unassigned:i().int(),failed:S(l()).readonly()}),{kind:`mutation`,auth:`admin`}),suggestFaceClusters:D(d({threshold:i().min(0).max(1).optional(),minClusterSize:i().int().min(2).optional(),maxClusters:i().int().positive().optional(),limit:i().int().positive().optional(),maxFacesScanned:i().int().positive().optional()}).optional(),S(FB).readonly())}},RB=x([`forward`,`reverse`]),zB=d({percentage:i().min(0).max(100).nullable(),percentageStep:i().positive().optional(),preset:l(),availablePresets:S(l()),direction:RB.nullable(),oscillating:C().nullable(),lastChangedAt:i()}),BB={name:`fan-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Fan],methods:{setPercentage:D(d({deviceId:i().int().nonnegative(),percentage:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`}),setPreset:D(d({deviceId:i().int().nonnegative(),preset:l().min(1)}),v(),{kind:`mutation`,auth:`protected`}),setDirection:D(d({deviceId:i().int().nonnegative(),direction:RB}),v(),{kind:`mutation`,auth:`protected`}),setOscillating:D(d({deviceId:i().int().nonnegative(),oscillating:C()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:zB,kind:`push`},runtimeState:zB,durability:`session`},VB=d({flags:y(l(),o()),deviceType:l().nullable(),model:l().nullable(),channelCount:i().nullable(),lastProbedAt:i(),lastFetchedAt:i()}),HB={name:`feature-probe`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onProbeChanged:{data:d({deviceId:i(),status:VB})}},status:{schema:VB,kind:`push`},runtimeState:VB,durability:`session`},UB=d({flooded:C(),lastChangedAt:i()}),WB={name:`flood`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:UB,kind:`push`},runtimeState:UB,durability:`restored`,volatileStateFields:[`lastChangedAt`]},GB=d({detected:C(),lastChangedAt:i()}),KB={name:`gas`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:GB,kind:`push`},runtimeState:GB,durability:`restored`,volatileStateFields:[`lastChangedAt`]},qB=d({on:C(),currentHumidity:i().min(0).max(100).nullable(),targetHumidity:i().min(0).max(100).nullable(),mode:l().nullable(),availableModes:S(l()),action:l().nullable(),minHumidity:i().nullable(),maxHumidity:i().nullable(),lastChangedAt:i()}),JB={name:`humidifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Humidifier],methods:{setOn:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`}),setTargetHumidity:D(d({deviceId:i().int().nonnegative(),humidity:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`}),setMode:D(d({deviceId:i().int().nonnegative(),mode:l().min(1)}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:qB,kind:`push`},runtimeState:qB,durability:`session`},YB=d({percent:i().min(0).max(100),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),XB={name:`humidity-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor,k.Thermostat],methods:{},status:{schema:YB,kind:`push`},runtimeState:YB,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},ZB=d({url:l().nullable(),lastUpdated:i().nullable()}),QB={name:`image`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Image],methods:{},status:{schema:ZB,kind:`push`},runtimeState:ZB,durability:`session`},$B=x([`0`,`90`,`180`,`270`]),eV=x([`auto`,`manual`]),tV=x([`auto`,`manual`]),nV=x([`off`,`blc`,`wdr`,`hlc`]),rV=d({min:i(),max:i(),step:i()}),iV=d({brightness:i().optional(),contrast:i().optional(),saturation:i().optional(),sharpness:i().optional(),mirror:C().optional(),flip:C().optional(),rotate:$B.optional(),whiteBalance:eV.optional(),warmth:i().optional(),exposureMode:tV.optional(),backlightMode:nV.optional(),lastFetchedAt:i()}),aV=d({supportsBrightness:C(),brightness:rV.optional(),supportsContrast:C(),contrast:rV.optional(),supportsSaturation:C(),saturation:rV.optional(),supportsSharpness:C(),sharpness:rV.optional(),supportsMirror:C(),supportsFlip:C(),rotateOptions:S($B),whiteBalanceModes:S(eV),supportsWarmth:C(),warmth:rV.optional(),exposureModes:S(tV),backlightModes:S(nV)}),oV=d({brightness:i().optional(),contrast:i().optional(),saturation:i().optional(),sharpness:i().optional(),mirror:C().optional(),flip:C().optional(),rotate:$B.optional(),whiteBalance:eV.optional(),warmth:i().optional(),exposureMode:tV.optional(),backlightMode:nV.optional()}),sV={name:`image-settings`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`image-settings`,tab:`image`}},methods:{getOptions:D(d({deviceId:i()}),aV),setSettings:D(d({deviceId:i(),settings:oV}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:iV,kind:`poll`},runtimeState:iV,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},cV=d({id:l(),addonId:l(),name:l(),enabled:C(),info:y(l(),o()).readonly(),createdAt:i(),updatedAt:i(),processState:l()}),lV=d({id:l(),addonId:l(),name:l(),enabled:C(),info:y(l(),o()).readonly(),createdAt:i(),updatedAt:i()}),uV=d({addonId:l(),name:l(),description:l(),iconUrl:l().nullable(),color:l(),instanceMode:l(),mode:x([`standalone`,`account`,`broker`]),discoveryMode:l(),kind:x([`device-adoption`,`device-provider`]),brokerKind:l().nullable(),supportsLocationImport:C(),canTest:C(),existingInstances:S(d({id:l(),name:l()})),canAdd:C()}),dV=x([`validated`,`rejected`,`inconclusive`,`unsupported`]),fV=d({success:C(),error:l().optional(),status:dV.optional(),testedBy:l().nullable().optional(),latencyMs:i().nonnegative().optional(),detail:l().optional()}),pV=d({addonId:l(),name:l(),enabled:C().optional(),info:y(l(),o()).optional(),settings:y(l(),o()).optional(),secretKeys:S(l()).optional(),skipRestart:C().optional()}),mV=d({id:l(),name:l().optional(),enabled:C().optional(),info:y(l(),o()).optional()}),hV=d({success:C(),deletedId:l()}),gV={name:`integrations`,scope:`system`,mode:`singleton`,methods:{list:D(v(),S(cV)),get:D(d({id:l()}),cV),getByAddonId:D(d({addonId:l()}),lV.nullable()),create:D(pV,lV,{kind:`mutation`,auth:`admin`}),update:D(mV,lV,{kind:`mutation`,auth:`admin`}),delete:D(d({id:l()}),hV,{kind:`mutation`,auth:`admin`}),getSettings:D(d({id:l()}),y(l(),o()),{auth:`admin`}),setSettings:D(d({id:l(),settings:y(l(),o()),secretKeys:S(l()).optional()}),d({success:C()}),{kind:`mutation`,auth:`admin`}),getAvailableTypes:D(v(),S(uV),{auth:`admin`}),testConnection:D(d({addonId:l(),settings:y(l(),o())}),fV,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},_V=d({codecs:S(l()),sampleRate:i(),duplex:x([`half`,`full`]),maxBacklogMs:i()}),vV=d({talking:C(),lastSessionAt:i().nullable(),ability:_V.nullable()}),yV=x([`opus`,`s16le`,`g711ulaw`,`g711alaw`]),bV={name:`intercom`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{startSession:D(d({deviceId:i()}),d({sessionId:l(),sdpOffer:l()}),{kind:`mutation`,auth:`protected`}),handleAnswer:D(d({deviceId:i(),sessionId:l(),sdpAnswer:l()}),v(),{kind:`mutation`,auth:`protected`}),stopSession:D(d({deviceId:i(),sessionId:l()}),v(),{kind:`mutation`,auth:`protected`}),startTalkSession:D(d({deviceId:i()}),d({sessionId:l()}),{kind:`mutation`,auth:`protected`}),pushTalkAudio:D(d({deviceId:i(),audioBase64:l(),codec:yV.optional(),sampleRate:i().int().positive().optional(),channels:i().int().positive().optional(),sequenceNumber:i().int()}),d({accepted:C()}),{kind:`mutation`,auth:`protected`}),endTalkSession:D(d({deviceId:i()}),v(),{kind:`mutation`,auth:`protected`})},events:{onStatusChanged:{data:d({deviceId:i(),status:vV})}},status:{schema:vV,kind:`command-driven`},runtimeState:vV,durability:`session`},xV=x([`idle`,`mowing`,`paused`,`docked`,`error`]),SV=x([`info`,`warning`,`error`]),CV=d({activity:xV,batteryLevel:i().min(0).max(100).nullable(),progressPercent:i().min(0).max(100).nullable(),currentCode:i().nullable(),currentCodeLabel:l().nullable(),severity:SV,lastChangedAt:i()}),wV={name:`lawn-mower-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.LawnMower],methods:{startMowing:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),pause:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),dock:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:CV,kind:`push`},runtimeState:CV,durability:`session`},TV=x([`lan`,`wifi`,`docker`,`vpn`,`loopback`,`other`]),EV=d({name:l(),family:x([`IPv4`,`IPv6`]),address:l(),cidr:l(),netmask:l(),internal:C(),mac:l(),kind:TV,preferred:C(),plausible:C(),plausibleReason:l()}),DV=d({interfaces:S(EV).readonly(),probedAt:i()}),OV=EV.nullable(),kV=d({label:l(),baseUrl:l(),kind:x([`lan-ipv4`,`lan-ipv6`,`public`,`loopback`,`app-link`,`custom`]),interfaceKind:x([`lan`,`wifi`,`docker`,`vpn`,`other`,`loopback`,`public`]),plausible:C(),plausibleReason:l(),priority:i()}),AV=x([`server-config`,`server-env`,`caller-hint`,`default`]),jV=d({port:i().int().min(1).max(65535),source:AV}),MV=d({endpoints:S(kV).readonly(),localPort:jV}),NV=d({baseUrl:l().nullable(),resolved:l().nullable(),appLinkHub:l().nullable()}),PV=d({baseUrls:S(l()).readonly(),resolved:S(l()).readonly()}),FV=d({override:l().nullable(),resolved:l().nullable(),source:x([`override`,`auto`,`none`])}),IV=d({cluster:FV,browser:FV}),LV=x(QS),RV=x([`flagged`,`auto`,`none`]),zV=d({flagged:l().nullable(),resolved:l().nullable(),source:RV}),BV=d({flagged:S(l()).readonly(),resolved:S(l()).readonly(),source:RV}),VV=d({rows:S(kV.extend({detected:C(),custom:C(),flags:S(LV).readonly(),inUse:S(LV).readonly(),eligible:S(LV).readonly()})).readonly(),roles:d({appConnections:BV,notificationTaps:zV,internal:zV,publicEndpoint:zV}),appLinkHub:l().nullable()}),HV=d({addresses:S(l()).readonly()}),UV=d({mode:x([`generated`,`uploaded`,`disabled`]),leafFingerprintSha256:l().nullable(),caFingerprintSha256:l().nullable(),validTo:l().nullable(),sans:S(l()),caCertPem:l().nullable(),reissueError:l().nullable(),restartRequired:C()}),WV={name:`local-network`,scope:`system`,mode:`singleton`,methods:{list:D(v(),DV),getPreferred:D(v(),OV),getConnectionEndpoints:D(d({port:i().int().min(1).max(65535).optional(),includeLoopback:C().optional(),ipv4Only:C().optional(),scheme:x([`http`,`https`]).optional(),includeAppLink:C().optional()}),MV),getNotificationEndpoint:D(v(),NV),setNotificationEndpoint:D(d({baseUrl:l().nullable()}),NV,{kind:`mutation`}),getViewerEndpoints:D(v(),PV),setViewerEndpoints:D(d({baseUrls:S(l()).readonly()}),PV,{kind:`mutation`}),getAddresses:D(d({scheme:x([`http`,`https`]).optional()}).optional(),VV),addCustomAddress:D(d({baseUrl:l(),label:l().max(80)}),VV,{kind:`mutation`,auth:`admin`}),removeCustomAddress:D(d({baseUrl:l()}),VV,{kind:`mutation`,auth:`admin`}),setAddressRole:D(d({role:LV,baseUrl:l().nullable(),enabled:C(),acceptInsecureHttp:C().optional()}),VV,{kind:`mutation`,auth:`admin`}),getHubAddresses:D(v(),IV),getAllowedAddresses:D(v(),HV),setAllowedAddresses:D(HV,d({success:m(!0)}),{kind:`mutation`}),resetAllowlistToBestMatch:D(v(),HV,{kind:`mutation`}),getTlsStatus:D(v(),UV),regenerateCertificate:D(d({reason:l().optional()}),UV,{kind:`mutation`,auth:`admin`}),uploadCertificate:D(d({certPem:l().min(1),keyPem:l().min(1),caPem:l().optional()}),UV,{kind:`mutation`,auth:`admin`}),downloadCa:D(v(),d({pem:l()})),revertToGeneratedCertificate:D(v(),UV,{kind:`mutation`,auth:`admin`})},mount:{kind:`hub-only`}},GV=x([`locked`,`unlocked`,`locking`,`unlocking`,`jammed`]),KV=d({state:GV,lastChangedAt:i()}),qV={name:`lock-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Lock],methods:{lock:D(d({deviceId:i().int().nonnegative(),code:l().min(1).optional()}),v(),{kind:`mutation`,auth:`protected`}),unlock:D(d({deviceId:i().int().nonnegative(),code:l().min(1).optional()}),v(),{kind:`mutation`,auth:`protected`}),open:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:KV,kind:`push`},runtimeState:KV,durability:`restored`,volatileStateFields:[`lastChangedAt`]},JV=x([`off`,`on`,`idle`,`playing`,`paused`,`buffering`,`standby`]),YV=x([`off`,`all`,`one`]),XV=d({type:l(),title:l(),artist:l().optional(),album:l().optional(),imageUrl:l().optional()}),ZV=d({state:JV,volumeLevel:i().min(0).max(100).nullable(),isMuted:C().nullable(),source:l(),availableSources:S(l()),currentMedia:XV.nullable(),positionMs:i().int().nonnegative().nullable(),durationMs:i().int().nonnegative().nullable(),shuffle:C().nullable(),repeat:YV.nullable(),lastChangedAt:i()}),QV={name:`media-player`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.MediaPlayer],methods:{play:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),pause:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),stop:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),next:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),previous:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),seek:D(d({deviceId:i().int().nonnegative(),positionMs:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),setVolume:D(d({deviceId:i().int().nonnegative(),volumeLevel:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`}),setMute:D(d({deviceId:i().int().nonnegative(),muted:C()}),v(),{kind:`mutation`,auth:`protected`}),setShuffle:D(d({deviceId:i().int().nonnegative(),shuffle:C()}),v(),{kind:`mutation`,auth:`protected`}),setRepeat:D(d({deviceId:i().int().nonnegative(),repeat:YV}),v(),{kind:`mutation`,auth:`protected`}),selectSource:D(d({deviceId:i().int().nonnegative(),source:l().min(1)}),v(),{kind:`mutation`,auth:`protected`}),playMedia:D(d({deviceId:i().int().nonnegative(),mediaId:l().min(1),mediaType:l().min(1)}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:ZV,kind:`push`},runtimeState:ZV,durability:`session`},$V=d({id:l(),label:l(),scope:x([`mesh`,`public`]),url:l(),hostname:l(),port:i(),protocol:x([`http`,`https`])}),eH=d({id:l(),hostname:l(),magicDns:l(),addresses:S(l()).readonly(),os:l().optional(),online:C(),lastSeenMs:i(),isSelf:C(),connection:x([`direct`,`relay`,`idle`]),relay:l().nullable(),lastHandshakeMs:i(),rxBytes:i(),txBytes:i(),tags:S(l()).readonly(),exitNodeOption:C(),advertisedRoutes:S(l()).readonly(),userLogin:l().nullable(),keyExpiry:i().nullable()}),tH=d({joined:C(),meshIp:l(),magicDnsHostname:l(),peerCount:i(),endpoints:S($V).readonly(),error:l().optional(),tenantName:l(),magicDnsSuffix:l(),userLogin:l().nullable(),controlPlaneUrl:l(),keyExpiry:i().nullable(),daemonSocket:l().optional(),daemonCliPath:l().optional()}),nH={name:`mesh-network`,scope:`system`,mode:`collection`,providerKind:`mesh`,methods:{getStatus:D(v(),tH),join:D(d({authKey:l().min(8),hostname:l().optional()}),d({joined:m(!0)}),{kind:`mutation`}),startLogin:D(d({hostname:l().optional()}),d({loginUrl:l()}),{kind:`mutation`}),leave:D(v(),d({left:m(!0)}),{kind:`mutation`}),logout:D(v(),d({loggedOut:m(!0)}),{kind:`mutation`}),listPeers:D(v(),d({peers:S(eH).readonly()})),testConnection:D(d({authKey:l().optional()}),d({ok:C(),tenant:l().optional(),daemonVersion:l().optional(),error:l().optional()}),{kind:`mutation`})}},rH=15e3,iH=d({detected:C(),lastDetectedAt:i().nullable(),autoClearAfterMs:i().nullable()}),aH=d({deviceId:i(),detected:C(),timestamp:i(),source:LP,regions:S(eT).readonly().optional(),triggeredBy:dk.optional()}),oH={name:`motion`,scope:`device`,mode:`singleton`,deviceNative:!0,deviceTypes:[k.Camera,k.Sensor],methods:{isDetected:D(d({deviceId:i()}),C())},events:{onMotionChanged:{data:aH}},status:{schema:iH,kind:`push`},runtimeState:iH,durability:`session`},sH=d({enabled:C(),lastChangedAt:i()}),cH=sH.extend({lastFetchedAt:i()}),lH={name:`motion-trigger`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Light,k.Siren,k.Switch],methods:{setMotionTrigger:D(d({deviceId:i().int().nonnegative(),enabled:C()}),v(),{kind:`mutation`,auth:`admin`})},events:{onMotionTriggerChanged:{data:d({deviceId:i(),enabled:C(),lastChangedAt:i()})}},status:{schema:sH,kind:`command-driven`},runtimeState:cH,durability:`session`},uH=d({id:i(),enabled:C(),shape:pE}),dH=d({enabled:C(),sensitivity:i(),regions:S(uH),lastFetchedAt:i()}),fH=d({maxRegions:i(),supportedShapes:S(gE),grid:vE,sensitivity:d({min:i(),max:i(),step:i()})}),pH=d({enabled:C().optional(),sensitivity:i().optional(),regions:S(uH).optional()}),mH={name:`motion-zones`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/motion-zones-grid`,tab:`motion`,label:`Motion Zones`}},methods:{getOptions:D(d({deviceId:i()}),fH),setZone:D(d({deviceId:i(),patch:pH}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:dH,kind:`poll`},runtimeState:dH,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},hH=x([`person`,`vehicle`,`animal`,`face`,`package`,`other`]),gH=d({class:hH,timestamp:i(),confidence:i().min(0).max(1).optional()}),_H=d({lastByClass:ae(hH,gH.nullable()),supportedClasses:S(hH).readonly(),enabled:C()}),vH=x([`boxed`,`while-streaming`,`flag-only`]),yH=d({supportedClasses:S(hH).readonly(),geometry:vH}),bH=d({enabled:C().optional()}),xH=_H.extend({lastFetchedAt:i()}),SH={name:`native-object-detection`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{getOptions:D(d({deviceId:i()}),yH),setSettings:D(d({deviceId:i(),settings:bH}),v(),{kind:`mutation`,auth:`admin`}),setEnabled:D(d({deviceId:i(),enabled:C()}),v(),{kind:`mutation`,auth:`admin`})},events:{onDetected:{data:d({deviceId:i(),detection:gH})}},status:{schema:_H,kind:`push`},runtimeState:xH,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},CH=d({pan:i().min(-1).max(1).optional(),tilt:i().min(-1).max(1).optional(),speed:i().min(0).max(1).optional()}),wH=x([`goHome`,`locate`,`spotClean`,`findPet`,`personFollow`,`stop`,`startClean`,`pauseClean`,`dockWash`,`autoEmpty`,`flashOn`,`flashOff`]),TH=x([`action`,`sound`]),EH=d({id:l(),kind:TH,label:l(),icon:l(),soundId:i().int().optional(),enabled:C()}),DH=[{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}],OH=d({x:i(),y:i()}),kH=d({move:C(),stop:C(),goToPoint:C(),runAction:C(),playSound:C(),light:C(),lightMode:C()}),AH=x([`auto`,`manual`]),jH=40,MH=100,NH=x([`idle`,`cleaning`,`spot`,`following`,`goto`,`returning`,`paused`,`unknown`]),PH=d({mode:NH,following:C(),flash:C(),lightMode:AH,lightLevel:i().min(40).max(100),lastChangedAt:i()}),FH=PH.extend({lastFetchedAt:i()}),IH={name:`navigation`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/navigation-panel`,tab:`navigation`,topTab:!0,label:`Navigation`,order:0}},methods:{move:D(CH.extend({deviceId:i()}),v(),{kind:`mutation`}),stop:D(d({deviceId:i()}),v(),{kind:`mutation`}),goToPoint:D(OH.extend({deviceId:i()}),v(),{kind:`mutation`}),listActions:D(d({deviceId:i()}),S(EH)),runAction:D(d({deviceId:i(),actionId:wH}),v(),{kind:`mutation`}),playSound:D(d({deviceId:i(),soundId:i().int()}),v(),{kind:`mutation`}),setLightOn:D(d({deviceId:i(),on:C()}),v(),{kind:`mutation`}),setLightMode:D(d({deviceId:i(),mode:AH,level:i().min(40).max(100).optional()}),v(),{kind:`mutation`}),setLightLevel:D(d({deviceId:i(),level:i().min(40).max(100)}),v(),{kind:`mutation`}),getFeatures:D(d({deviceId:i()}),kH)},events:{onStatusChanged:{data:d({deviceId:i(),status:PH})}},status:{schema:PH,kind:`push`},runtimeState:FH,durability:`session`},LH=[`wifi`,`ethernet`,`cellular`,`unknown`],RH=d({type:x(LH),signalPercent:i().min(0).max(100).nullable(),rssiDbm:i().optional(),ssid:l().optional(),lastUpdated:i()}),zH={type:`unknown`,signalPercent:null,lastUpdated:0};function BH(e,t){return e===void 0||!Number.isFinite(e)||t<=0||e<0||e>t?null:Math.round(e/t*100)}function VH(e){return e===void 0||!Number.isFinite(e)||e>0?null:Math.round((Math.min(-50,Math.max(-100,e))+100)*2)}var HH={name:`network-link`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera,k.Sensor,k.Button,k.Switch,k.Light,k.Lock,k.Siren],methods:{},events:{onStatusChanged:{data:d({deviceId:i(),status:RH})}},status:{schema:RH,kind:`push`,empty:zH},runtimeState:RH,durability:`restored`,volatileStateFields:[`lastUpdated`]},UH=d({nominalBitrateKbps:i(),observedBitrateKbps:i(),peakBitrateKbps:i(),packetLossPercent:i(),lastUpdated:i()}),WH=d({rttMs:i(),jitterMs:i(),estimatedBandwidthKbps:i(),packetLossPercent:i().min(0).max(100),downlinkMbps:i().optional(),downlinkAgeMs:i().optional(),lastUpdated:i()}),GH=d({deviceId:i(),streams:y(l(),UH),client:WH.optional()}),KH={name:`network-quality`,scope:`system`,mode:`singleton`,methods:{getDeviceStats:D(d({deviceId:i()}),GH.nullable()),getAllStats:D(v(),S(GH).readonly()),reportClientStats:D(d({deviceId:i(),rttMs:i().min(0).max(6e4),jitterMs:i().min(0).max(1e4),estimatedBandwidthKbps:i().min(0).max(1e6),packetLossPercent:i().min(0).max(100),downlinkMbps:i().min(0).max(1e5).optional(),downlinkAgeMs:i().min(0).max(864e5).optional()}),v(),{kind:`mutation`})},mount:{kind:`server-provided`}},qH=d({addonId:l(),capabilities:S(l()).readonly(),status:l()}),JH=d({pid:i(),name:l(),state:l(),cpuPercent:i(),memoryRss:i(),uptimeSeconds:i(),services:S(qH).readonly(),groupId:l().optional()}),YH=d({id:l(),status:l(),cpuPercent:i(),memoryRss:i()}),XH=d({category:l(),total:i(),healthy:i(),addons:S(YH).readonly()}),ZH=d({name:l(),version:l()}),QH=d({id:l(),name:l(),hostname:l(),platform:l(),arch:l(),cpuModel:l().nullable(),cpuCores:i(),memoryMB:i(),engines:S(l()).readonly(),isHub:C(),isOnline:C(),cpuPercent:i(),memoryPercent:i(),uptime:i(),lastSeen:l(),localIps:S(l()).readonly(),addons:S(d({id:l(),capabilities:S(l()).readonly(),status:l()})).readonly(),processes:S(JH).readonly(),categories:S(XH).readonly(),rootPackage:ZH.nullable(),meshTransport:x([`tls`,`clear`]).optional()}),$H=d({callerAddonId:l(),providerAddonId:l(),capName:l(),callsPerMin:i(),lastCallAtMs:i()}),eU=d({nodeId:l(),name:l(),version:l(),status:l(),synced:C()}),tU=d({hubVersion:l(),nodes:S(eU)}),nU=d({nodeId:l(),addonId:l()}),rU=d({id:l(),status:l(),version:l().optional(),packageName:l().optional()}),iU=d({success:C()}),aU=d({success:C(),reason:l().optional()}),oU=d({restarted:S(l()).readonly(),failed:S(l()).readonly()}),sU=d({nodeId:l(),name:l()}),cU=d({id:l(),name:l(),isHub:C(),isOnline:C()}),lU=d({nodes:S(cU).readonly(),complete:C()}),uU={name:`nodes`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{topology:D(v(),S(QH).readonly(),{auth:`admin`}),directory:D(v(),lU,{auth:`admin`}),deployAddon:D(nU,iU,{kind:`mutation`,auth:`admin`}),undeployAddon:D(nU,iU,{kind:`mutation`,auth:`admin`}),restartAddon:D(nU,iU,{kind:`mutation`,auth:`admin`}),restartProcess:D(d({nodeId:l(),processName:l()}),aU,{kind:`mutation`,auth:`admin`}),restartNode:D(d({nodeId:l()}),oU,{kind:`mutation`,auth:`admin`}),shutdownNode:D(d({nodeId:l()}),iU,{kind:`mutation`,auth:`admin`}),renameNode:D(d({nodeId:l(),name:l().min(1).max(64)}),sU,{kind:`mutation`,auth:`admin`}),clusterAddonStatus:D(v(),y(l(),tU),{auth:`admin`}),getCapUsageGraph:D(d({windowSeconds:i().int().positive().max(300).default(60)}),S($H).readonly(),{auth:`admin`}),getNodeAddons:D(d({nodeId:l()}),S(rU).readonly(),{auth:`admin`}),setProcessLogLevel:D(d({nodeId:l(),level:l()}),iU,{kind:`mutation`,auth:`admin`}),executeQuery:D(d({nodeId:l(),addonId:l(),queryName:l(),params:y(l(),o()).optional()}),o(),{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},dU=x([`min`,`low`,`normal`,`high`]),fU=d({id:l().min(1),title:l().min(1),uri:s().optional(),destructive:C().optional()}),pU=d({image:C(),priority:C(),data:C(),actions:C(),recipients:C()}),mU=d({lastSentAt:i(),lastError:l().nullable(),queueDepth:i().int().nonnegative(),supports:pU}),hU=d({deviceId:i().int().nonnegative(),title:l().optional(),body:l().min(1),image:l().optional(),priority:dU.optional(),channel:l().optional(),recipients:S(l()).optional(),actions:S(fU).optional(),data:y(l(),o()).optional()}),gU=d({notificationId:l(),acceptedAt:i()}),_U={name:`notifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Notifier],methods:{send:D(hU,gU,{kind:`mutation`,auth:`admin`}),cancel:D(d({deviceId:i().int().nonnegative(),notificationId:l().min(1)}),v(),{kind:`mutation`,auth:`admin`})},events:{onSent:{data:d({deviceId:i(),notificationId:l(),success:C(),error:l().nullable(),acceptedAt:i()})}},status:{schema:mU,kind:`command-driven`},runtimeState:mU,durability:`session`},vU=d({value:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional(),lastFetchedAt:i()}),yU={name:`numeric-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:vU,kind:`push`},runtimeState:vU,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},bU=x([`text`,`timestamp`,`watermark`]),xU=x([`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`custom`]),SU=d({id:l(),kind:bU,enabled:C(),text:l().optional(),position:xU.optional(),availablePositions:S(xU).readonly(),readOnly:C().optional(),maxCharacters:i().int().positive().optional()}),CU=d({overlays:S(SU).readonly()}),wU=d({enabled:C().optional(),text:l().optional(),position:xU.optional()}).partial(),TU={name:`osd`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{setOverlay:D(d({deviceId:i(),overlayId:l(),patch:wU}),v(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:d({deviceId:i(),status:CU})}},status:{schema:CU,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}}}]}},EU=x([`value`,`unit`,`full`]),DU=x([`value+unit`,`value`,`unit`]),OU=d({containerId:i().int().optional(),deviceId:i().int()}),kU=d({alias:l().min(1).max(32).regex(/^[A-Za-z][A-Za-z0-9_-]*$/,`alias must start with a letter`),pick:OU,capName:l().min(1).max(64),valuePath:l().min(1).max(64),displayUnit:l().max(16).optional(),maxDecimals:i().int().min(0).max(4).default(1),valueMap:y(l(),l()).optional()}),AU=d({id:l().min(1).max(64),name:l().min(1).max(64),bindings:S(kU).max(32).default([]),parser:l().max(256).default(``)}),jU=p(`kind`,[d({kind:m(`none`)}),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:i().int().optional(),capName:l().min(1).max(64),valuePath:l().min(1).max(64),displayUnit:l().max(16).optional()}),d({kind:m(`latest-recognition`),recognition:x([`person`,`plate`])}),d({kind:m(`template`),templateId:l().min(1).max(64)})]),MU=d({enabled:C().default(!0),source:jU,template:l().max(96).default("${value}"),maxDecimals:i().int().min(0).max(4).default(1),valueMap:y(l(),l()).optional(),schedule:FE.optional(),conditions:rD.optional()}),NU=d({slotId:l(),kind:bU,readOnly:C(),cameraEnabled:C(),cameraText:l().optional(),binding:MU.nullable()}),PU=x([`written`,`unchanged`,`gated`,`unreadable`,`disabled`,`unbound`,`failed`]),FU=d({slotId:l(),outcome:PU,text:l(),reason:l().optional()}),IU=x([`number`,`boolean`,`string`,`enum`]),LU=d({deviceId:i().int(),deviceName:l(),capName:l(),valuePath:l(),label:l(),valueType:IU,enumValues:S(l()).readonly().optional()}),RU={name:`osd-manager`,scope:`system`,mode:`singleton`,methods:{getDeviceOsd:D(d({deviceId:i().int()}),d({supported:C(),slots:S(NU)}),{auth:`admin`}),getSourceCatalog:D(d({deviceId:i().int()}),d({sources:S(LU)}),{auth:`admin`}),getConditionSupport:D(d({}),d({supported:S(l()),catalog:S(UD)}),{auth:`admin`}),setSlotBinding:D(d({deviceId:i().int(),slotId:l().min(1),binding:MU}),d({slot:NU,render:FU}),{kind:`mutation`,auth:`admin`}),clearSlotBinding:D(d({deviceId:i().int(),slotId:l().min(1)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),setSlotCameraEnabled:D(d({deviceId:i().int(),slotId:l().min(1),enabled:C()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`}),copyDeviceConfiguration:D(d({sourceDeviceId:i().int(),targetDeviceId:i().int()}),d({copied:i().int().nonnegative(),skipped:i().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),previewSlot:D(d({deviceId:i().int(),slotId:l().min(1),binding:MU.optional()}),FU,{kind:`mutation`,auth:`admin`}),renderDevice:D(d({deviceId:i().int()}),d({results:S(FU)}),{kind:`mutation`,auth:`admin`}),listTemplates:D(d({}),d({templates:S(AU)}),{auth:`admin`}),upsertTemplate:D(d({template:AU}),d({template:AU}),{kind:`mutation`,auth:`admin`}),deleteTemplate:D(d({templateId:l().min(1).max(64)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`})}},zU=4,BU=200,VU=x([`normal`,`offline`,`on_batteries`]),HU=i().int().min(4).max(200),UU=d({foodLevel:i().nullable(),food1:i().nullable(),food2:i().nullable(),lowFood:C(),batteryPower:i().min(0).max(100).nullable(),desiccantLeftDays:i().nullable(),feeding:C(),status:VU.nullable(),error:l().nullable(),errorCode:i().nullable(),isDualHopper:C(),childLock:C(),indicatorLight:C(),feedSound:C(),volume:i(),lastFetchedAt:i()}),WU={name:`pet-feeder`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.PetFeeder],methods:{feed:D(d({deviceId:i().int().nonnegative(),grams:HU.optional(),hopper1:HU.optional(),hopper2:HU.optional()}),v(),{kind:`mutation`,auth:`protected`}),cancelFeed:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),resetDesiccant:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),markFoodReplenished:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),callPet:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),playSound:D(d({deviceId:i().int().nonnegative(),soundId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),setChildLock:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`}),setIndicatorLight:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`}),setFeedSound:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`}),setVolume:D(d({deviceId:i().int().nonnegative(),level:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:UU,kind:`poll`},runtimeState:UU,durability:`session`},GU=d({id:l(),name:l(),sampleCount:i().int().nonnegative(),coverMediaId:i().int().optional(),coverBase64:l().optional()}),KU=d({id:l(),text:l(),score:i(),addedAt:i().int(),deviceId:i().int().optional(),base64:l().optional()}),qU=d({plateId:l(),deviceId:i().int(),trackId:l(),timestamp:i().int(),text:l(),score:i(),corrected:C(),recognizedVehicleId:l().optional(),vehicleName:l().optional(),assigned:C(),plateBbox:sh.optional(),keyFrameMediaId:i().int().optional(),base64:l().optional(),cropUrl:l().optional()}),JU=d({mediaId:i().int(),kind:l(),url:l(),sizeBytes:i(),timestamp:i()}),YU=d({plateIds:S(l()).readonly(),representativePlateId:l(),representativeText:l(),size:i().int(),cohesion:i()}),XU={name:`plate-gallery`,scope:`system`,mode:`singleton`,methods:{listPlates:D(d({deviceId:i().int().optional(),limit:i().int().positive().optional(),includeCrops:C().optional()}).optional(),S(qU).readonly()),getPlateByTrack:D(d({deviceId:i().int(),trackId:l()}),qU.nullable()),getPlateMedia:D(d({plateId:l()}),S(JU).readonly()),searchPlates:D(d({text:l().min(1),maxDistance:i().int().min(0).optional(),limit:i().int().positive().optional(),includeCrops:C().optional()}),S(qU).readonly()),suggestPlateClusters:D(d({maxDistance:i().int().min(0).optional(),minClusterSize:i().int().min(2).optional(),limit:i().int().positive().optional()}).optional(),S(YU).readonly()),correctPlateText:D(d({plateId:l(),text:l().min(1)}),v(),{kind:`mutation`,auth:`admin`}),deletePlate:D(d({plateId:l()}),v(),{kind:`mutation`,auth:`admin`}),listVehicles:D(d({includeCrops:C().optional()}).optional(),S(GU).readonly()),createVehicle:D(d({name:l().min(1)}),GU,{kind:`mutation`,auth:`admin`}),renameVehicle:D(d({id:l(),name:l().min(1)}),v(),{kind:`mutation`,auth:`admin`}),deleteVehicle:D(d({id:l()}),v(),{kind:`mutation`,auth:`admin`}),listVehicleSamples:D(d({vehicleId:l()}),S(KU).readonly()),removeVehicleSample:D(d({vehicleId:l(),sampleId:l()}),v(),{kind:`mutation`,auth:`admin`}),assignPlate:D(d({plateId:l(),vehicleId:l()}),v(),{kind:`mutation`,auth:`admin`}),unassignPlate:D(d({plateId:l()}),v(),{kind:`mutation`,auth:`admin`}),assignPlates:D(d({plateIds:S(l()).min(1),vehicleId:l()}),d({assigned:i().int(),failed:S(l()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignPlates:D(d({plateIds:S(l()).min(1)}),d({unassigned:i().int(),failed:S(l()).readonly()}),{kind:`mutation`,auth:`admin`})}},ZU=x(yr),QU=x([`videotoolbox`,`cuda`,`nvdec`,`vaapi`,`qsv`,`d3d11va`,`dxva2`,`amf`,`vdpau`,`drm`,`coreml`,`tensorrt`,`openvino`,`directml`,`webgpu`,`none`]).nullable().optional(),$U=d({preferred:S(l()).readonly(),rationale:l()}),eW=x([`h264_videotoolbox`,`hevc_videotoolbox`,`h264_vaapi`,`hevc_vaapi`,`h264_nvenc`,`hevc_nvenc`,`h264_qsv`,`hevc_qsv`,`h264_amf`,`hevc_amf`,`libx264`,`libx265`]);d({encoders:S(d({encoder:eW,codec:x([`H264`,`H265`]),family:x([`videotoolbox`,`vaapi`,`nvenc`,`qsv`,`amf`,`software`]),available:C(),reason:l().optional()})).readonly(),defaultH264:eW,defaultH265:eW,probedAt:i()}),d({methods:S(l()).readonly(),probedAt:i()});var tW=x([`darwin`,`linux`,`win32`]),nW=x([`arm64`,`x64`]),rW=d({type:x([`nvidia`,`amd`,`intel`,`apple`]),name:l(),memoryMB:i().optional()}),iW=d({type:x([`apple-ane`,`intel-npu`,`amd-xdna`]),name:l().optional(),generation:x([`xdna1`,`xdna2`]).optional()}),aW=d({type:m(`coral-edgetpu`),bus:l().optional()}),oW=d({platform:tW,arch:nW,cpuModel:l(),cpuCores:i(),totalRAM_MB:i(),availableRAM_MB:i(),gpu:rW.nullable(),npu:iW.nullable(),coral:aW.nullable().optional()}),sW=d({runtime:m(`python`),backend:l(),format:x([`onnx`,`coreml`,`openvino`,`tflite`]),score:i(),reason:l(),available:C()}),cW=d({key:l(),backend:l(),device:l(),format:ZU,runtime:m(`python`),score:i(),available:C()}),lW=d({hardware:oW,scores:S(sW).readonly(),bestScore:sW,pythonPath:l().nullable(),devices:S(cW).readonly()}),uW=d({modelId:l(),name:l(),minRAM_MB:i(),accuracyScore:i(),formats:S(l()).readonly()}),dW=d({modelId:l(),runtime:m(`python`),backend:l(),format:ZU,reason:l()}),fW={name:`platform-probe`,scope:`system`,mode:`singleton`,methods:{getCapabilities:D(v(),lW),getHardware:D(v(),oW),resolveInferenceConfig:D(d({requirements:S(uW).readonly()}),dW),resolveHwAccel:D(d({prefer:QU}),$U)}},pW=d({watts:i().optional(),kwhTotal:i().optional(),volts:i().optional(),amps:i().optional(),va:i().optional(),powerFactor:i().min(0).max(1).optional(),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),mW={name:`power-meter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:pW,kind:`push`},runtimeState:pW,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},hW=d({latitude:i().min(-90).max(90),longitude:i().min(-180).max(180),accuracyMeters:i().nonnegative()}),gW=d({state:l(),location:l().nullable(),gps:hW.nullable(),batteryPercent:i().min(0).max(100).nullable(),lastChangedAt:i()}),_W={name:`presence`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Presence],methods:{},status:{schema:gW,kind:`push`},runtimeState:gW,durability:`restored`,volatileStateFields:[`lastChangedAt`]},vW=d({hpa:i(),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),yW={name:`pressure-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:vW,kind:`push`},runtimeState:vW,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},bW=p(`kind`,[dE,fE]),xW=d({id:i(),enabled:C(),shape:bW}),SW=d({enabled:C(),regions:S(xW).nullable(),audioEnabled:C().nullable(),lastFetchedAt:i()}),CW=d({maxRegions:i(),supportedShapes:S(gE),polygonVertices:_E.optional(),supportsAudioMute:C()}),wW=d({enabled:C().optional(),regions:S(xW).optional()}),TW={name:`privacy-mask`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/privacy-mask-grid`,tab:`image`,label:`Privacy Mask`}},methods:{getOptions:D(d({deviceId:i()}),CW),setMask:D(d({deviceId:i(),patch:wW}),v(),{kind:`mutation`,auth:`admin`}),setAudioEnabled:D(d({deviceId:i(),enabled:C()}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:SW,kind:`poll`},runtimeState:SW,durability:`restored`,volatileStateFields:[`lastFetchedAt`]};function EW(e){return e.length===0?null:e.some(e=>e.audioEnabled)}var DW=x([`home`,`day-mode`,`night-mode`,`day-night-auto`,`set-limits`,`save-limits`,`reboot`,`osd-menu`]),OW=d({id:l(),name:l(),fn:DW.nullable(),writable:C()}),kW=d({pan:i().nullable(),tilt:i().nullable(),zoom:i().nullable()}),AW=d({pan:i().optional(),tilt:i().optional(),zoom:i().optional(),speed:i().optional()}),jW=kW.extend({autofocus:C()}),MW=d({hasPan:C(),hasTilt:C(),hasZoom:C(),supportsPresets:C(),maxPresets:i().optional(),hasAutofocus:C(),speedSteps:i().int().positive().nullable(),moveImpulseMs:i().int().positive().nullable()}),NW=d({presetId:l().nullable(),source:x([`operator`,`firmware`,`native`,`none`])}),PW=d({enabled:C(),seconds:i().int()}),FW={name:`ptz`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-panel`,tab:`ptz`,topTab:!0,label:`PTZ`,order:0}},methods:{move:D(AW.extend({deviceId:i()}),v(),{kind:`mutation`}),continuousMove:D(AW.extend({deviceId:i()}),v(),{kind:`mutation`}),stop:D(d({deviceId:i()}),v(),{kind:`mutation`}),getPresets:D(d({deviceId:i()}),S(OW)),goToPreset:D(d({deviceId:i(),presetId:l()}),v(),{kind:`mutation`}),savePreset:D(d({deviceId:i(),presetId:l(),name:l()}),v(),{kind:`mutation`,auth:`admin`}),deletePreset:D(d({deviceId:i(),presetId:l()}),v(),{kind:`mutation`,auth:`admin`}),getOptions:D(d({deviceId:i()}),MW),goHome:D(d({deviceId:i()}),v(),{kind:`mutation`}),getHomePreset:D(d({deviceId:i()}),NW),setHomePreset:D(d({deviceId:i(),presetId:l().nullable()}),v(),{kind:`mutation`,auth:`admin`}),captureHomeHere:D(d({deviceId:i()}),v(),{kind:`mutation`,auth:`admin`}),getHomeReturn:D(d({deviceId:i()}),PW.nullable()),setHomeReturn:D(d({deviceId:i(),enabled:C(),seconds:i().int().min(0).max(3600)}),v(),{kind:`mutation`,auth:`admin`}),getPosition:D(d({deviceId:i()}),kW),setAutofocus:D(d({deviceId:i(),enabled:C()}),v(),{kind:`mutation`})},status:{schema:jW,kind:`command-driven`}},IW=d({targetType:l().describe(`Vendor target string (people/vehicle/pet); empty = camera default`),stopDelaySeconds:i().int().min(0).max(300),disappearDelaySeconds:i().int().min(0).max(300)}),LW=d({value:l(),label:l()}),RW=d({enabled:C(),lastChangedAt:i(),currentSettings:IW.nullable(),supportedTargetTypes:S(LW)}),zW=RW.extend({lastFetchedAt:i()}),BW={name:`ptz-autotrack`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!1,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-autotrack`,tab:`ptz`,topTab:!0,label:`Auto-Tracking`,order:5}},methods:{getStatus:D(d({deviceId:i()}),RW),setEnabled:D(d({deviceId:i(),enabled:C()}),v(),{kind:`mutation`}),getSettings:D(d({deviceId:i()}),IW.nullable()),setSettings:D(d({deviceId:i(),settings:IW.partial()}),v(),{kind:`mutation`})},events:{onStatusChanged:{data:d({deviceId:i(),status:RW})}},status:{schema:RW,kind:`command-driven`},runtimeState:zW,durability:`session`},VW={name:`reboot`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera,k.Sensor,k.Switch],methods:{reboot:D(d({deviceId:i().int().nonnegative()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`})}},HW=`camstack`,UW=`recorder`,WW=d({profile:l(),startMs:i(),endMs:i()}),GW=x([`read`,`unreadable`]),KW=d({deviceId:i(),read:GW,ranges:S(WW),profilesWithFootage:S(l())}),qW=d({deviceId:i(),read:GW,days:S(i())}),JW=d({deviceId:i(),localMasterPath:l().nullable(),playbackUrl:l().nullable(),playbackEndpoints:S(l())}),YW=d({state:x([`ok`,`sleeping`,`unreachable`,`no-storage`,`index-empty`]),reason:l().optional(),coverageAsOf:i().optional()}),XW=d({source:l(),label:l(),addonId:l().optional(),availability:YW}),ZW=d({transport:x([`archive`,`stream`,`realtime`]),coverage:x([`continuous`,`sparse`]),seek:x([`free`,`forward`,`segment`]),stepBack:C(),scrub:C(),rates:S(i().positive()).min(1).readonly(),exclusive:C()}),QW=p(`kind`,[d({kind:m(`hls`),manifest:JW}),d({kind:m(`clip`),source:l(),clipId:l(),startsAtMs:i()}),d({kind:m(`none`),reason:l()})]),$W={name:`recording`,scope:`device`,mode:`collection`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],methods:{listSources:D(d({deviceId:i()}),S(XW).readonly(),{kind:`query`,auth:`protected`}),getAvailability:D(d({deviceId:i(),provider:l().min(1),fromMs:i(),toMs:i(),profile:l().optional()}),KW,{kind:`query`,auth:`protected`}),getDaysWithRecordings:D(d({deviceId:i(),provider:l().min(1),fromMs:i(),toMs:i(),tzOffsetMinutes:i()}),qW,{kind:`query`,auth:`protected`}),getPlayback:D(d({deviceId:i(),provider:l().min(1),fromMs:i(),toMs:i(),profile:E.optional()}),QW,{kind:`query`,auth:`protected`}),getPlaybackOptions:D(d({deviceId:i(),provider:l().min(1)}),ZW,{kind:`query`,auth:`protected`})}},eG=d({deviceId:i(),enabled:C(),activeMode:cu,nodeId:l(),storageBytes:i()}),tG=200,nG=d({deviceId:i(),read:x([`read`,`unreadable`]),ranges:S(WW).readonly(),profilesWithFootage:S(l()).readonly()}),rG=d({deviceId:i(),read:x([`read`,`unreadable`]),days:S(i()).readonly()}),iG=d({deviceId:i(),usedBytes:i(),oldestMs:i().nullable().optional(),segments:i().optional(),residentBytes:i().optional(),residentOldestMs:i().nullable().optional()}),aG=d({locationId:l().nullable(),locationIds:S(l()).optional(),root:l().optional(),usedBytes:i(),availableBytes:i().nullable(),totalBytes:i().nullable()}),oG=d({nodeId:l(),totalUsedBytes:i(),devices:S(iG),devicesRead:x([`archive`,`unavailable`]).optional(),complete:C().optional(),locations:S(aG).optional()}),sG=d({deviceId:i(),profile:l(),fromLocationId:l(),toLocationId:l(),bytes:i(),files:i().int()}),cG=x([`unassigned`,`target-not-writable`,`below-threshold`,`no-headroom`]),lG=d({deviceId:i(),profile:l(),fromLocationId:l(),toLocationId:l().nullable(),bytes:i(),reason:cG}),uG=d({moves:S(sG),skipped:S(lG),bytesToMove:i(),jobIds:S(l())}),dG=d({throttleMbps:i().min(1).max(1e3).optional(),minMoveGb:i().min(0).optional()}),fG=d({deviceId:i().int(),profile:l(),locationId:l()}),pG=d({deviceId:i().int(),locationId:l()}),mG=d({assignments:S(fG),pins:S(pG),defaultLocations:y(l(),l())}),hG=d({deviceId:i().int(),locationId:l().nullable()}),gG=p(`kind`,[d({kind:m(`segment`),startMs:i(),durMs:i(),bytes:i()}),d({kind:m(`gap`),nearestEdgeMs:i().nullable(),prevEndMs:i().nullable().optional()})]),_G=d({data:b(Uint8Array)}),vG=d({data:b(Uint8Array),gopStartMs:i(),gopDurMs:i()}),yG=p(`kind`,[d({kind:m(`ok`),data:b(Uint8Array),gopStartMs:i(),gopDurMs:i(),reachesRequestedEnd:C()}),d({kind:m(`spans-multiple-segments`),segmentEndMs:i()})]),bG={name:`recording-archive`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,status:{schema:eG,kind:`command-driven`},methods:{getAvailabilityBatch:D(d({deviceIds:S(i()).min(1).max(200),fromMs:i(),toMs:i()}),S(nG).readonly(),{kind:`query`,auth:`protected`}),getDaysWithRecordingsBatch:D(d({deviceIds:S(i()).min(1).max(200),fromMs:i(),toMs:i(),tzOffsetMinutes:i()}),S(rG).readonly(),{kind:`query`,auth:`protected`}),getStorageUsage:D(d({}),oG,{kind:`query`,auth:`admin`}),getDeviceConfig:D(d({deviceId:i()}),Su,{kind:`query`,auth:`protected`}),locateSegment:D(d({deviceId:i(),profile:l(),epochMs:i()}),gG,{kind:`query`,auth:`admin`}),readSegmentBytes:D(d({deviceId:i(),profile:l(),startMs:i()}),_G,{kind:`query`,auth:`admin`}),readGopBytes:D(d({deviceId:i(),profile:l(),startMs:i(),epochMs:i()}),vG,{kind:`query`,auth:`admin`}),readWindowBytes:D(d({deviceId:i(),profile:l(),startMs:i(),fromMs:i(),toMs:i()}),yG,{kind:`query`,auth:`admin`}),setDeviceConfig:D(d({deviceId:i(),config:Su}),Su,{kind:`mutation`,auth:`admin`}),rescanStorage:D(d({deviceId:i()}),eG,{kind:`mutation`,auth:`admin`}),pruneFootage:D(d({deviceId:i(),reason:Yl.optional()}),d({floorMs:i().nullable(),deletedBuckets:i().int(),reclaimedBytes:i().int()}),{kind:`mutation`,auth:`admin`}),deleteFootprint:D(d({deviceId:i(),fromMs:i().optional(),toMs:i().optional()}),d({deletedBuckets:i().int(),reclaimedBytes:i().int()}),{kind:`mutation`,auth:`admin`}),listOpsLog:D(Zl,S(Xl).readonly(),{kind:`query`,auth:`admin`}),renderGif:D(d({deviceId:i(),aroundMs:i(),preRollSec:i().min(0).max(30).default(2),postRollSec:i().min(0).max(30).default(5),maxWidth:i().int().min(120).max(1280).default(480),fps:i().int().min(1).max(15).default(5)}),d({gifBase64:l(),fromMs:i(),toMs:i()}),{kind:`mutation`,auth:`admin`}),renderClip:D(d({deviceId:i(),aroundMs:i(),preRollSec:i().min(0).max(30).default(3),postRollSec:i().min(0).max(30).default(7),maxWidth:i().int().min(160).max(1920).default(640)}),d({clipBase64:l(),mime:l(),fromMs:i(),toMs:i(),bytes:i().int()}),{kind:`mutation`,auth:`admin`}),pauseForStorageMigration:D(Iu,d({paused:m(!0)}),{kind:`mutation`,auth:`admin`}),resumeForStorageMigration:D(Iu,d({resumed:m(!0)}),{kind:`mutation`,auth:`admin`}),refreshStorageLocationsForMigration:D(Iu,d({refreshed:m(!0)}),{kind:`mutation`,auth:`admin`}),startStorageMigrationMove:D(Lu,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),getStorageMigrationMoveStatus:D(d({jobId:l()}),Nu.nullable(),{auth:`admin`}),cancelStorageMigrationMove:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),relocateFootage:D(Fu,d({jobId:l()}),{kind:`mutation`,auth:`admin`}),listRelocateJobs:D(d({}),S(Nu).readonly(),{kind:`query`,auth:`admin`}),getRelocateResidue:D(od,sd,{kind:`query`,auth:`admin`}),reconcileLedgerAgainstDisk:D(cd,pd,{kind:`mutation`,auth:`admin`}),cancelRelocateJob:D(d({jobId:l()}),d({cancelled:C()}),{kind:`mutation`,auth:`admin`}),planStorageRebalance:D(dG,uG,{kind:`query`,auth:`admin`}),startStorageRebalance:D(dG,uG,{kind:`mutation`,auth:`admin`}),getPlacement:D(d({}),mG,{kind:`query`,auth:`admin`}),setDevicePlacement:D(hG,d({ok:m(!0)}),{kind:`mutation`,auth:`admin`})}},xG=i().min(.25).max(32),SG=d({fromSec:i().nonnegative(),toSec:i().nonnegative()}).refine(e=>e.toSec>e.fromSec,{message:`dense range must have toSec > fromSec`}),CG=200,wG=d({everyMs:i().int().positive(),ranges:S(SG).min(1).max(200)}),TG=d({everyMs:i().int().positive(),outputFps:i().int().min(1).max(60).optional(),dense:wG.optional()}).superRefine((e,t)=>{e.dense!==void 0&&e.dense.everyMs>=e.everyMs&&t.addIssue({code:se.custom,message:`dense.everyMs must be strictly smaller than the base everyMs`,path:[`dense`,`everyMs`]})}),EG=d({speed:xG.optional(),timelapse:TG.optional(),includeAudio:C(),maxLifeMs:i().int().positive(),deleteAfterDownload:C(),title:l().max(200).optional(),notifyTargetIds:S(l().min(1)).max(20).optional()}).superRefine((e,t)=>{e.speed!==void 0&&e.timelapse!==void 0&&t.addIssue({code:se.custom,message:`speed and timelapse are mutually exclusive`,path:[`timelapse`]})}),DG=x([`queued`,`rendering`,`ready`,`failed`,`expired`,`deleted`]),OG=d({kind:m(`footage`),deviceId:i(),profiles:S(l()).min(1),fromMs:i(),toMs:i()}),kG=d({kind:m(`clip`),deviceId:i(),provider:l().min(1),source:l().min(1),sourceLabel:l().min(1),clipId:l().min(1),catalogWindow:d({sinceMs:i(),untilMs:i()}),profile:x([`high`,`mid`,`low`]),wake:RL.optional()}),AG=p(`kind`,[OG,kG]),jG=d({id:l(),deviceId:i(),profile:l(),fromMs:i(),toMs:i(),subject:AG.optional(),options:EG,state:DG,progressPct:i().nullable(),fileBytes:i().nullable(),expiresAt:i(),deleteAfterDownload:C(),downloadedAt:i().nullable(),createdAt:i(),createdBy:l(),error:l().nullable()}),MG=x([`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 NG(e,t){return t.length>0?`${e}: ${t}`:e}function PG(e){if(e===null)return null;let t=e.split(`:`,1)[0]??``,n=MG.safeParse(t.trim());return n.success?n.data:null}var FG=d({url:l(),endpoints:S(l())}),IG=50*1024*1024,LG=d({base64:l(),contentType:l(),name:l(),bytes:i().int().nonnegative()});function RG(e){return e.profiles!==void 0&&e.profiles.length>0?[...e.profiles]:typeof e.profile==`string`&&e.profile.length>0?[e.profile]:[]}var zG=d({deviceId:i(),profile:l().optional(),profiles:S(l()).min(1).optional(),fromMs:i().optional(),toMs:i().optional(),subject:AG.optional(),options:EG}).superRefine((e,t)=>{if(e.subject?.kind===`clip`){e.subject.deviceId!==e.deviceId&&t.addIssue({code:se.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:se.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:se.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:se.custom,message:`a footage export needs fromMs and toMs`,path:[`fromMs`]}),(e.subject?.kind===`footage`?[...e.subject.profiles]:RG(e)).length<1&&t.addIssue({code:se.custom,message:`pass profiles[] (min 1) or legacy profile`,path:[`profiles`]})});function BG(e){if(e.subject!==void 0)return e.subject;let t=RG(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 VG(e){return e.subject===void 0?{kind:`footage`,deviceId:e.deviceId,profiles:[e.profile],fromMs:e.fromMs,toMs:e.toMs}:e.subject}var HG={name:`recording-export`,scope:`system`,mode:`singleton`,methods:{createExport:D(zG,jG,{kind:`mutation`,auth:`protected`}),listExports:D(d({deviceId:i().optional()}),S(jG),{kind:`query`,auth:`protected`}),getExport:D(d({exportId:l()}),jG,{kind:`query`,auth:`protected`}),cancelExport:D(d({exportId:l()}),jG,{kind:`mutation`,auth:`protected`}),deleteExport:D(d({exportId:l()}),jG,{kind:`mutation`,auth:`protected`}),getDownloadUrl:D(d({exportId:l()}),FG,{kind:`query`,auth:`protected`}),readExportBytes:D(d({exportId:l()}),LG,{kind:`query`,auth:`protected`})}},UG=x([`continuous`,`motion`,`person`,`vehicle`,`animal`,`lineCrossing`,`intrusion`,`loitering`,`alarmInput`]),WG=d({trigger:UG,day:i().int().min(0).max(6),startMinute:i().int().min(0).max(1439),endMinute:i().int().min(1).max(1440)}),GG=d({id:l(),label:l().optional(),status:x([`ok`,`unformatted`,`error`,`offline`,`unknown`]),capacityMb:i().nullable(),freeMb:i().nullable(),writable:C().optional()}),KG=p(`kind`,[d({kind:m(`present`),volumes:S(GG)}),d({kind:m(`absent`),reason:l()}),d({kind:m(`unknown`),reason:l()})]),qG=d({id:l(),enabled:C(),isVideo:C(),codec:l().nullable(),resolution:l().nullable(),overwriteWhenFull:C().nullable()}),JG=d({storage:KG,tracks:S(qG),primaryTrackId:l().nullable(),enabled:C().nullable(),overwriteWhenFull:C().nullable(),preRecordSec:i().nullable(),postRecordSec:i().nullable(),segmentMinutes:i().nullable(),windows:S(WG),unreadableWindows:i(),recordingToNowhere:C(),lastFetchedAt:i()}),YG=d({min:i(),max:i(),step:i()}),XG=d({values:S(i()).min(1),sentinel:d({value:i(),meaning:x([`no-limit`,`disabled`])}).optional()}),ZG=d({readable:C(),writable:C(),reason:l().optional()}),QG=d({support:ZG,granularityMinutes:i(),triggers:S(UG),supportsOverlappingTriggers:C()}),$G=d({enabled:ZG,overwriteWhenFull:ZG,preRecordSec:ZG,preRecordSecRange:YG.optional(),preRecordSecAllowed:XG.optional(),postRecordSec:ZG,postRecordSecRange:YG.optional(),postRecordSecAllowed:XG.optional(),segmentMinutes:ZG,segmentMinutesRange:YG.optional(),segmentMinutesAllowed:XG.optional(),schedule:QG}),eK=d({enabled:C().optional(),overwriteWhenFull:C().optional(),preRecordSec:i().optional(),postRecordSec:i().optional(),segmentMinutes:i().optional(),windows:S(WG).optional()}),tK={name:`recording-onboard`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`recording-onboard`,tab:`recording`}},methods:{getOptions:D(d({deviceId:i()}),$G),setSettings:D(d({deviceId:i(),settings:eK}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:JG,kind:`poll`},runtimeState:JG,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},nK=1440,rK=7,iK=24,aK=168,oK=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`];function sK(e,t){if(t.enabled!==void 0&&!e.enabled.writable)return cK(`the master recording switch`,e.enabled.reason);if(t.overwriteWhenFull!==void 0&&!e.overwriteWhenFull.writable)return cK(`overwrite-when-full`,e.overwriteWhenFull.reason);let n=lK(`pre-record seconds`,t.preRecordSec,e.preRecordSec,e.preRecordSecRange,e.preRecordSecAllowed);if(n)return n;let r=lK(`post-record seconds`,t.postRecordSec,e.postRecordSec,e.postRecordSecRange,e.postRecordSecAllowed);if(r)return r;let i=lK(`segment length (minutes)`,t.segmentMinutes,e.segmentMinutes,e.segmentMinutesRange,e.segmentMinutesAllowed);if(i)return i;if(t.windows!==void 0){let n=uK(e,t.windows);if(n)return n}return null}function cK(e,t){return t?`this camera cannot change ${e}: ${t}`:`this camera cannot change ${e}`}function lK(e,t,n,r,i){if(t===void 0)return null;if(!n.writable)return cK(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 uK(e,t){let n=e.schedule;if(!n.support.writable)return cK(`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 ${fK(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 ${fK(e.day)} window ${pK(e.startMinute)}–${pK(e.endMinute)} is not aligned to them`}if(!n.supportsOverlappingTriggers){let e=dK(t);if(e)return`this camera stores one trigger per time range, so "${e.a.trigger}" and "${e.b.trigger}" cannot both cover ${fK(e.a.day)} ${pK(Math.max(e.a.startMinute,e.b.startMinute))}–${pK(Math.min(e.a.endMinute,e.b.endMinute))}`}return null}function dK(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 fK(e){return oK[e]??`day ${String(e)}`}function pK(e){let t=Math.floor(e/60),n=e%60;return`${String(t).padStart(2,`0`)}:${String(n).padStart(2,`0`)}`}function mK(e,t){return e*24+t}function hK(e){if(e.length===0)return!0;let t=e[0];for(let n of e)if(n!==t)return!1;return!0}function gK(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[mK(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 _K(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[mK(r.day,t)]=`1`}return n.join(``)}function vK(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 yK(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 bK(e){let t=e.trim().toLowerCase(),n=oK.findIndex(e=>e.toLowerCase()===t);return n>=0?n:null}function xK(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 SK=d({active:C(),reason:l(),lastChangedAt:i()}),CK=SK.extend({lastFetchedAt:i()}),wK={name:`recording-signal`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{getStatus:D(d({deviceId:i()}),SK)},status:{schema:SK,kind:`push`,empty:{active:!1,reason:`unknown`,lastChangedAt:0}},runtimeState:CK,durability:`session`},TK=[{capName:`recording`,sourceId:`camstack`,addonId:`recorder`}];function EK(e,t){for(let n of TK)if(n.capName===e&&n.sourceId===t)return n.addonId;return null}var DK=l(),OK=[`day`,`ir`,`night`,`dawn`,`dusk`],kK=x([`skip`,`judge-anyway`]),AK=`__diverged__`,jK=x([`matched`,`diverged`,`unknown`]),MK=x([`no-reference-for-condition`,`view-shifted`,`no-vision-profile`,`encoder-model-changed`,`no-snapshot`]),NK=d({embedding:S(i()),modelId:l(),condition:DK,capturedAt:i(),thumbnailMediaId:i().int().optional(),anchorEmbedding:S(i()).optional()}),PK=d({id:l(),label:l(),references:S(NK),textPrompts:S(l()).optional(),referenceCount:i(),currentlyMatched:C()}),FK=p(`mode`,[d({mode:m(`similarity`),threshold:i().min(0).max(1),hysteresisCount:i().int().positive()}),d({mode:m(`llm`),prompt:l(),profileId:l().optional(),hysteresisCount:i().int().positive()})]),IK=60,LK=120,RK=60,zK=.85,BK=`skip`,VK=8e3,HK=448,UK=!0,WK=d({enabled:C().default(!1),prompt:l().min(1).max(1e3),profileId:l().optional(),timeoutMs:i().int().min(1e3).max(2e4).default(VK),maxImagePx:i().int().min(64).max(2048).default(448),onTimeout:x([`flip`,`hold`]).default(`hold`)}),GK=d({id:l(),label:l(),roi:dE,enabled:C(),triggerMode:x([`periodic`,`on-motion`,`both`]),checkIntervalSec:i().optional(),check:FK,states:S(PK),currentStateId:l().nullable(),lastCheckedAt:i().nullable(),lastConfidence:i().nullable(),currentCondition:DK.nullable(),availability:x([`ok`,`unavailable`]),unavailableReason:l().nullable(),baselineStateId:l().nullable(),emit:x([`latched`,`live`]).default(`latched`),verdict:jK,latched:C(),armedAt:i(),divergedAt:i().nullable(),restoredAt:i().nullable(),quietSeconds:i().int().min(0).max(3600).default(60),minObservationSpacingSec:i().int().min(0).max(3600).default(120),confirm:WK.optional(),anchorThreshold:i().min(0).max(1).default(zK),autoRestore:C().default(!1),onUncoveredCondition:kK.default(BK),suspendedCondition:DK.nullable().default(null),unavailable:MK.nullable(),coveredConditions:S(DK)}),KK=d({monitors:S(GK),lastFetchedAt:i()}),qK=d({deviceId:i(),status:KK.nullable()}),JK={name:`scene-monitor`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[k.Camera],methods:{listScenes:D(d({deviceId:i()}),KK),listScenesBatch:D(d({deviceIds:S(i()).min(1).max(200)}),S(qK).readonly()),createScene:D(d({deviceId:i(),label:l(),roi:dE,check:FK,triggerMode:x([`periodic`,`on-motion`,`both`]).optional(),checkIntervalSec:i().optional()}),GK,{kind:`mutation`,auth:`admin`}),updateScene:D(d({deviceId:i(),monitorId:l(),patch:d({label:l().optional(),roi:dE.optional(),enabled:C().optional(),triggerMode:x([`periodic`,`on-motion`,`both`]).optional(),checkIntervalSec:i().optional(),check:FK.optional(),emit:x([`latched`,`live`]).optional(),quietSeconds:i().int().min(0).max(3600).optional(),minObservationSpacingSec:i().int().min(0).max(3600).optional(),anchorThreshold:i().min(0).max(1).optional(),autoRestore:C().optional(),onUncoveredCondition:kK.optional(),confirm:WK.nullable().optional()})}),v(),{kind:`mutation`,auth:`admin`}),deleteScene:D(d({deviceId:i(),monitorId:l()}),v(),{kind:`mutation`,auth:`admin`}),captureReference:D(d({deviceId:i(),monitorId:l(),stateId:l().optional(),label:l().optional(),condition:DK.optional()}),d({stateId:l(),referenceCount:i()}),{kind:`mutation`,auth:`admin`}),deleteReference:D(d({deviceId:i(),monitorId:l(),stateId:l(),index:i()}),v(),{kind:`mutation`,auth:`admin`}),recheckNow:D(d({deviceId:i(),monitorId:l()}),v(),{kind:`mutation`,auth:`admin`}),resetScene:D(d({deviceId:i(),monitorId:l(),recapture:C().optional()}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:KK,kind:`push`},runtimeState:KK,durability:`session`},YK=x([`include`,`exclude`]),XK=d({id:l(),name:l().optional(),zoneIds:S(l()).min(1).readonly(),mode:YK,classFilter:S(l()).readonly().optional(),overlapThreshold:i().min(0).max(1).optional(),bboxInclusionPct:i().min(0).max(100).optional(),preferMask:C().optional(),enabled:C().default(!0)}),ZK=S(XK).readonly(),QK=d({isRunning:C(),lastRunAt:i(),lastRunSuccess:C().nullable(),lastError:l().nullable(),lastChangedAt:i()}),$K={name:`script-runner`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Script],methods:{run:D(d({deviceId:i().int().nonnegative(),variables:y(l(),o()).optional()}),v(),{kind:`mutation`,auth:`admin`}),stop:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`admin`})},status:{schema:QK,kind:`push`},runtimeState:QK,durability:`session`},eq=d({detected:C(),lastChangedAt:i()}),tq={name:`smoke`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:eq,kind:`push`},runtimeState:eq,durability:`restored`,volatileStateFields:[`lastChangedAt`]},nq=d({camStreamId:l().min(1),kind:Kn,url:l().optional(),codec:l().optional(),resolution:qn.optional(),fps:i().positive().optional(),label:l().optional(),deviceFeatures:S(l()).optional(),autoEligible:C().optional(),profileHint:E.optional(),metadata:y(l(),o()).optional()}),rq=d({descriptors:S(nq),lastFetchedAt:i()}),iq={name:`stream-catalog`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],methods:{getCatalog:D(d({deviceId:i().int().nonnegative()}),S(nq).readonly())},runtimeState:rq,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},aq=x([`main`,`sub`,`ext`]),oq=d({width:i(),height:i(),codec:x([`h264`,`h265`]),framerate:i(),bitrate:i(),bitrateMode:x([`vbr`,`cbr`]).optional(),encoderProfile:x([`high`,`main`,`baseline`]).optional(),gop:i().optional(),audio:C().optional()}),sq=d({main:oq.optional(),sub:oq.optional(),ext:oq.optional(),lastFetchedAt:i()}),cq=d({resolutions:S(d({width:i(),height:i()})),codecs:S(x([`h264`,`h265`])),framerates:S(i()),bitrates:S(i()),bitrateRange:u([i(),i()]).optional(),supportsBitrateMode:C(),supportsEncoderProfile:C(),supportsGop:C(),gop:d({min:i(),max:i(),step:i()}).optional()}),lq=d({main:cq.optional(),sub:cq.optional(),ext:cq.optional()}),uq=d({width:i().optional(),height:i().optional(),codec:x([`h264`,`h265`]).optional(),framerate:i().optional(),bitrate:i().optional(),bitrateMode:x([`vbr`,`cbr`]).optional(),encoderProfile:x([`high`,`main`,`baseline`]).optional(),gop:i().optional()}),dq={name:`stream-params`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`stream-params`,tab:`streaming`}},methods:{getOptions:D(d({deviceId:i()}),lq),setProfile:D(d({deviceId:i(),profile:aq,patch:uq}),v(),{kind:`mutation`,auth:`admin`}),getConfigSchema:D(d({deviceId:i()}),o().nullable())},status:{schema:sq,kind:`poll`},runtimeState:sq,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},fq=[{profile:`main`,prefix:`streamMain`,label:`Main stream`},{profile:`sub`,prefix:`streamSub`,label:`Sub stream`},{profile:`ext`,prefix:`streamExt`,label:`Third stream`}];function pq(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 mq(e,t){let n=[];for(let r of fq){let i=e[r.profile];if(!i)continue;let a=pq(r,i,t?.[r.profile]);a&&n.push(a)}return n.length===0?null:{sections:n}}function hq(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 gq=d({on:C(),lastChangedAt:i()}),_q={name:`switch`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Switch,k.Siren,k.Light],methods:{setState:D(d({deviceId:i(),on:C()}),v(),{kind:`mutation`,auth:`protected`})},events:{onStateChanged:{data:d({deviceId:i(),on:C(),lastChangedAt:i()})}},status:{schema:gq,kind:`command-driven`},runtimeState:gq,durability:`restored`,volatileStateFields:[`lastChangedAt`],settings:{bindings:[{kind:`scalar`,statusPath:`on`,method:`setState`,valueArg:`on`,field:{label:`On`,kind:`boolean`}}]}},vq=d({streaming:C(),notifications:C(),objectDetection:C(),remoteAccess:C(),agentCluster:C(),smartHome:C(),recordings:C(),backup:C(),repl:C()}),yq=d({status:m(`ok`),uptime:i()}),bq=d({name:l(),address:l(),family:l(),internal:C()}),xq=x([`operator-set`,`derived-from-ip`]),Sq=d({latitude:i().min(-90).max(90),longitude:i().min(-180).max(180),source:xq,updatedAt:i(),label:l().optional()}),Cq=d({location:Sq.nullable(),derivationAttemptedAt:i().nullable(),derivationError:l().nullable()}),wq=d({latitude:i().min(-90).max(90),longitude:i().min(-180).max(180)}).nullable(),Tq=x([`http`,`ws`,`mesh`,`unknown`]),Eq=d({http:i(),ws:i(),mesh:i(),unknown:i()}),Dq=d({plane:Tq,procedure:l(),userAgent:l(),ip:l(),principal:l(),calls:i(),subscriptions:i(),perMin:i()}),Oq=d({procedure:l(),calls:i(),planes:Eq,subscriptions:i(),perMin:i()}),kq=d({armed:C(),elapsedMs:i(),windowMs:i(),armedUntilMs:i(),httpRequests:i(),batchedRequests:i(),procedureCalls:i(),planes:Eq,planesExplainTotal:C(),wsConnections:i(),wsMessages:i(),subscriptions:i(),subscriptionStops:i(),distinctGroups:i(),unattributedCalls:i(),procedures:S(Oq).readonly(),groups:S(Dq).readonly()}),Aq=kq.extend({persisted:C()}),jq=x([`debug`,`info`,`warn`,`error`]),Mq=x([`request-census`]),Nq=x([`cluster`,`node`,`component`]),Pq=x([`default`,`cluster`,`node`,`component`]),Fq=d({scope:Nq,nodeId:l().nullable(),component:l().nullable(),level:jq.nullable()}),Iq=d({level:jq,levelSource:Pq}),Lq=d({layers:S(Fq).readonly()}),Rq=d({id:Mq,armed:C(),armedUntilMs:i(),remainingMs:i(),persisted:C()}),zq=d({id:Mq,armMs:i().int().min(0),reportEveryMs:i().int().positive().optional()}),Bq=d({channel:l(),armed:C(),armedUntilMs:i(),remainingMs:i(),deviceIds:S(i().int()).readonly().nullable()}),Vq=d({channel:l().min(1),armMs:i().int().min(0),deviceIds:S(i().int()).readonly().nullable().optional()}),Hq=d({level:jq.nullable().optional(),diagnostics:S(zq).readonly().optional(),channels:S(Vq).readonly().optional(),opsLogRetentionDays:i().int().min(0).max(3650).optional()}),Uq=gw.extend({addonId:l()}),Wq=RS.extend({addonId:l()}),Gq=d({scopeNodeId:l().optional(),scopeComponent:l().optional()}),Kq=d({scopeNodeId:l().optional(),scopeComponent:l().optional(),patch:Hq}),qq=d({scopeNodeId:l().nullable(),scopeComponent:l().nullable(),effective:Iq,explicit:Lq,activeWindows:S(Rq).readonly(),channels:S(Zd).readonly(),activeChannels:S(Bq).readonly(),opsLogRetentionDays:i().int().min(0),persisted:C()}),Jq={name:`system`,scope:`system`,mode:`singleton`,methods:{info:D(v(),vq),health:D(v(),yq),featureFlags:D(v(),vq),networkAddresses:D(v(),S(bq).readonly()),getRetentionConfig:D(v(),o().nullable(),{auth:`admin`}),setRetentionConfig:D(y(l(),o()),re(),{kind:`mutation`,auth:`admin`}),forceRetentionCleanup:D(v(),v(),{kind:`mutation`,auth:`admin`}),getSiteLocation:D(v(),Cq),setSiteLocation:D(wq,Cq,{kind:`mutation`,auth:`admin`}),detectSiteLocation:D(v(),Cq,{kind:`mutation`,auth:`admin`}),getRequestCensus:D(v(),Aq,{auth:`admin`}),getLoadContributions:D(v(),S(Uq).readonly(),{auth:`admin`}),getFailureContributions:D(v(),S(Wq).readonly(),{auth:`admin`}),getLoggingSettings:D(Gq,qq,{auth:`admin`}),setLoggingSettings:D(Kq,qq,{kind:`mutation`,auth:`admin`})},mount:{kind:`server-provided`}},Yq=d({tampered:C(),lastChangedAt:i()}),Xq={name:`tamper`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:Yq,kind:`push`},runtimeState:Yq,durability:`restored`,volatileStateFields:[`lastChangedAt`]},Zq=d({celsius:i(),lastFetchedAt:i(),unit:l().optional(),precision:i().int().min(0).max(10).optional()}),Qq={name:`temperature-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor,k.Thermostat],methods:{},status:{schema:Zq,kind:`push`},runtimeState:Zq,durability:`restored`,volatileStateFields:[`lastFetchedAt`]},$q=d({title:l(),message:l(),severity:x([`info`,`warning`,`critical`]),duration:i().optional(),action:d({label:l(),url:l()}).optional()}),eJ={name:`toast`,scope:`system`,mode:`singleton`,methods:{onToast:D(v(),$q,{kind:`subscription`})},mount:{kind:`server-provided`}},tJ=d({currentVersion:l().nullable(),availableVersion:l().nullable(),updatable:C(),state:l().nullable(),inProgress:C()}),nJ={name:`update`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Update],methods:{installUpdate:D(v(),v(),{kind:`mutation`,auth:`admin`})},status:{schema:tJ,kind:`poll`},runtimeState:tJ,durability:`session`},rJ=d({id:l(),username:l(),isAdmin:C().default(!1),allowedProviders:f([S(l()),m(`*`)]),allowedDevices:y(l(),f([S(l()),m(`*`)])),scopes:S(J).default([]),totpEnabled:C().default(!1),createdAt:i(),updatedAt:i()}),iJ=d({username:l(),password:l().min(6),isAdmin:C().default(!1),allowedProviders:f([S(l()),m(`*`)]).optional(),allowedDevices:y(l(),f([S(l()),m(`*`)])).optional(),scopes:S(J).optional()}),aJ=d({id:l(),isAdmin:C().optional(),allowedProviders:f([S(l()),m(`*`)]).optional(),allowedDevices:y(l(),f([S(l()),m(`*`)])).optional(),scopes:S(J).optional()}),oJ=d({id:l(),label:l(),isAdmin:C().default(!1),allowedProviders:f([S(l()),m(`*`)]).optional(),allowedDevices:y(l(),f([S(l()),m(`*`)])).optional(),tokenPrefix:l(),createdAt:i(),lastUsedAt:i().optional()}),sJ=d({id:l(),userId:l(),name:l(),tokenPrefix:l(),scopes:S(J),expiresAt:i().nullish(),lastUsedAt:i().nullish(),createdAt:i()}),cJ=d({userId:l(),name:l(),scopes:S(J),expiresAt:i().optional()}),lJ=d({token:l(),record:sJ}),uJ=d({id:l(),userId:l(),username:l(),integrationId:l(),scopes:S(J),createdAt:i(),lastUsedAt:i(),revokedAt:i().nullable()}),dJ=d({secret:l(),otpauthUrl:l()}),fJ=d({enabled:C(),confirmedAt:i().nullable()}),pJ=d({provider:l(),subject:l(),issuer:l(),userId:l(),label:l().optional(),linkedAt:i()}),mJ=d({provider:l().min(1),subject:l().min(1)}),hJ={name:`user-management`,scope:`system`,mode:`singleton`,methods:{listUsers:D(v(),S(rJ),{auth:`admin`}),createUser:D(iJ,rJ,{kind:`mutation`,auth:`admin`,access:`create`}),updateUser:D(aJ,d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),deleteUser:D(d({id:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),resetPassword:D(d({id:l(),newPassword:l().min(6)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),setUserScopes:D(d({userId:l(),scopes:S(J)}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),validateCredentials:D(d({username:l(),password:l()}),rJ.extend({passwordHash:l()}).nullable(),{kind:`mutation`,access:`view`}),listApiKeys:D(v(),S(oJ),{auth:`admin`}),revokeApiKey:D(d({id:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),createScopedToken:D(cJ,lJ,{kind:`mutation`,auth:`admin`,access:`create`}),revokeScopedToken:D(d({id:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateScopedToken:D(d({token:l()}),sJ.nullable(),{access:`view`}),listScopedTokens:D(d({userId:l()}),S(sJ),{auth:`admin`}),setupTotp:D(d({userId:l()}),dJ,{kind:`mutation`,auth:`admin`,access:`create`}),confirmTotp:D(d({userId:l(),code:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),disableTotp:D(d({userId:l()}),d({success:m(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getTotpStatus:D(d({userId:l()}),fJ,{auth:`admin`}),verifyTotp:D(d({userId:l(),code:l()}),d({valid:C()}),{kind:`mutation`,access:`view`}),oauthIssueCode:D(d({integrationId:l(),userId:l(),username:l(),scopes:S(J),redirectUri:l(),hubUrl:l(),codeChallenge:l().optional(),refreshTtlSec:f([i().int().positive(),m(`never`)]).optional()}),d({code:l()}),{kind:`mutation`,access:`create`}),oauthExchangeCode:D(d({code:l(),redirectUri:l(),codeVerifier:l().optional()}),d({accessToken:l(),refreshToken:l(),expiresIn:i()}).nullable(),{kind:`mutation`,access:`view`}),oauthRefresh:D(d({refreshToken:l()}),d({accessToken:l(),refreshToken:l(),expiresIn:i()}).nullable(),{kind:`mutation`,access:`view`}),oauthVerifyAccessToken:D(d({token:l()}),d({userId:l(),username:l(),scopes:S(J)}).nullable(),{access:`view`}),listExternalIdentities:D(d({userId:l()}),S(pJ),{auth:`admin`}),findUserByExternalIdentity:D(mJ,d({userId:l(),issuer:l()}).nullable(),{auth:`admin`}),unlinkExternalIdentity:D(mJ.extend({userId:l()}),d({success:C()}),{kind:`mutation`,auth:`admin`,access:`delete`}),listOauthSessions:D(v(),S(uJ),{auth:`admin`}),revokeOauthSession:D(d({id:l()}),d({success:C()}),{kind:`mutation`,auth:`admin`,access:`delete`})}},gJ=x([`idle`,`cleaning`,`paused`,`returning`,`docked`,`drying`,`error`]),_J=d({level:i().min(0).max(100).nullable(),status:x([`ok`,`low`,`full`]).nullable()}),vJ=d({state:gJ,batteryLevel:i().min(0).max(100).nullable(),fanSpeed:l().nullable(),availableFanSpeeds:S(l()),cleanWater:_J.nullable(),dirtyWater:_J.nullable(),detergent:_J.nullable(),dustBin:_J.nullable(),progressPercent:i().min(0).max(100).nullable(),errorCode:i().nullable(),errorLabel:l().nullable(),lastChangedAt:i()}),yJ={name:`vacuum-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Vacuum],methods:{start:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),pause:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),stop:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),returnToBase:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),locate:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),setFanSpeed:D(d({deviceId:i().int().nonnegative(),speed:l().min(1)}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:vJ,kind:`push`},runtimeState:vJ,durability:`session`},bJ=x([`open`,`opening`,`closing`,`closed`,`stopped`]),xJ=d({state:bJ,position:i().min(0).max(100).nullable(),lastChangedAt:i()}),SJ={name:`valve`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Valve],methods:{open:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),close:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),stop:D(d({deviceId:i().int().nonnegative()}),v(),{kind:`mutation`,auth:`protected`}),setPosition:D(d({deviceId:i().int().nonnegative(),position:i().min(0).max(100)}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:xJ,kind:`push`},runtimeState:xJ,durability:`session`},CJ=d({detected:C(),lastChangedAt:i()}),wJ={name:`vibration`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Sensor],methods:{},status:{schema:CJ,kind:`push`},runtimeState:CJ,durability:`restored`,volatileStateFields:[`lastChangedAt`]},TJ=d({currentTemp:i().nullable(),targetTemp:i().nullable(),operationMode:l().nullable(),availableModes:S(l()),away:C().nullable(),minTemp:i().nullable(),maxTemp:i().nullable(),lastChangedAt:i()}),EJ={name:`water-heater`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.WaterHeater],methods:{setTargetTemp:D(d({deviceId:i().int().nonnegative(),temp:i().finite()}),v(),{kind:`mutation`,auth:`protected`}),setOperationMode:D(d({deviceId:i().int().nonnegative(),mode:l().min(1)}),v(),{kind:`mutation`,auth:`protected`}),setAway:D(d({deviceId:i().int().nonnegative(),on:C()}),v(),{kind:`mutation`,auth:`protected`})},status:{schema:TJ,kind:`push`},runtimeState:TJ,durability:`session`},DJ=d({condition:l().nullable(),temperature:i().nullable(),temperatureUnit:l().nullable(),humidity:i().min(0).max(100).nullable(),pressure:i().nullable(),pressureUnit:l().nullable(),windSpeed:i().nullable(),windSpeedUnit:l().nullable(),windBearing:i().nullable(),lastFetchedAt:i()}),OJ={name:`weather`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[k.Weather],methods:{},status:{schema:DJ,kind:`push`},runtimeState:DJ,durability:`session`},kJ=d({totalObjects:i().int().nonnegative(),byClass:y(l(),i().int().nonnegative()),standingObjects:i().int().nonnegative().optional(),transientObjects:i().int().nonnegative().optional()}),AJ=kJ.extend({zoneId:l(),zoneName:l(),trackIds:S(l()).readonly()}),jJ=d({id:l(),className:l(),bbox:d({x:i(),y:i(),w:i(),h:i()}),frameWidth:i().int().nonnegative(),frameHeight:i().int().nonnegative(),firstSeenAt:i().int(),becameStationaryAt:i().int(),lastConfirmedAt:i().int(),label:l().optional(),keyFrameMediaId:i().int().optional()}),MJ=d({ts:i().int(),frameWidth:i().int().nonnegative(),frameHeight:i().int().nonnegative(),zones:S(AJ).readonly(),frame:kJ,unzoned:kJ,stationaryObjects:S(jJ).readonly().optional()}),NJ=d({deviceId:i(),read:x([`read`,`unreadable`]),snapshot:MJ.nullable()}),PJ=x([`minute`,`5min`,`hour`]),FJ=d({from:i().int(),to:i().int(),resolution:PJ}),IJ=d({ts:i().int(),count:i().int().nonnegative()}),LJ={name:`zone-analytics`,scope:`device`,mode:`singleton`,deviceTypes:[k.Camera],methods:{getCurrentSnapshot:D(d({deviceId:i()}),MJ.nullable()),getCurrentSnapshotBatch:D(d({deviceIds:S(i()).min(1).max(200)}),S(NJ).readonly()),getZoneHistory:D(d({deviceId:i(),zoneId:l(),className:l().optional()}).extend(FJ.shape),S(IJ).readonly()),getCameraHistory:D(d({deviceId:i(),className:l().optional()}).extend(FJ.shape),S(IJ).readonly()),getUnzonedHistory:D(d({deviceId:i(),className:l().optional()}).extend(FJ.shape),S(IJ).readonly())},runtimeState:MJ,durability:`session`},RJ=x([`motion`,`detection`,`package`]),zJ={name:`zone-rules`,scope:`device`,mode:`singleton`,deviceTypes:[k.Camera],methods:{listRules:D(d({deviceId:i(),stage:RJ}),S(XK).readonly()),setRules:D(d({deviceId:i(),stage:RJ,rules:S(XK).readonly()}),v(),{kind:`mutation`,auth:`admin`})},runtimeState:d({motion:S(XK).readonly(),detection:S(XK).readonly(),package:S(XK).readonly()}),durability:`restored`},BJ=d({id:l(),label:l(),usdPerHour:i().nonnegative(),vramGb:i().nonnegative()}),VJ=d({id:l(),label:l(),priceMultiplier:i().positive()}),HJ=d({gpuType:l(),region:l(),costCapUsd:i().nonnegative(),maxRuntimeSec:i().int().positive(),failedDatasetGraceHours:i().nonnegative()}),UJ=o(),WJ=d({typeId:l(),label:l(),iconAsset:l(),addonId:l(),configSchema:UJ.optional()}),GJ=d({entryId:l(),typeId:l(),name:l(),addonId:l(),configured:C()}),KJ=d({addonId:l(),entryId:l(),typeId:l(),name:l(),iconAsset:l(),kind:l(),label:l(),gpuTypes:S(BJ).readonly(),regions:S(VJ).readonly(),maxDatasetBytes:i().int().positive(),maxRuntimeSec:i().int().positive(),freeTierNote:l().optional(),dataResidencyNote:l(),configured:C(),defaults:HJ,formValues:y(l(),o()).optional()}),qJ=d({entryId:l().min(1),name:l().min(1),tokenId:l().optional(),tokenSecret:f([l(),d({$secretClear:m(!0)})]).optional(),environment:l().optional(),gpuType:l().optional(),region:l().optional(),costCapUsd:i().nonnegative().optional(),maxRuntimeSec:i().int().positive().optional(),failedDatasetGraceHours:i().nonnegative().optional()}),JJ=d({ok:C(),account:l().optional(),reason:x([`missing`,`invalid`,`forbidden`,`network`,`quota`]).optional(),detail:l().optional()}),YJ=x([`pending`,`starting`,`running`,`succeeded`,`failed`,`cancelled`,`lost`]),XJ=d({jobKey:l(),providerJobId:l().optional(),state:YJ,startedAt:i().optional(),endedAt:i().optional(),exitCode:i().int().optional(),failureReason:l().optional(),gpuType:l(),region:l().optional(),billedSeconds:i().nonnegative(),costUsd:i().nonnegative(),costIsEstimate:C(),lastFetchedAt:i()}),ZJ=d({repo:l().min(1),revision:l().regex(/^[0-9a-f]{7,64}$/)}),QJ={entryId:l().min(1),jobKey:l().uuid()},$J=d({ts:i(),text:l()}),eY={name:`training-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{describe:D(d({}),S(KJ).readonly(),{auth:`admin`}),describeTypes:D(d({}),S(WJ).readonly(),{auth:`admin`}),listEntries:D(d({}),S(GJ).readonly(),{auth:`admin`}),createEntry:D(d({typeId:l().min(1),name:l().min(1)}),d({entryId:l()}),{kind:`mutation`,auth:`admin`}),deleteEntry:D(d({entryId:l().min(1)}),d({ok:m(!0)}),{kind:`mutation`,auth:`admin`}),updateEntry:D(qJ,d({ok:m(!0)}),{kind:`mutation`,auth:`admin`}),validateCredentials:D(d({entryId:l().min(1)}),JJ,{kind:`mutation`,auth:`admin`,timeoutMs:3e4}),estimateJob:D(d({entryId:l().min(1),gpuType:l(),region:l(),datasetBytes:i().int().nonnegative(),gpuSecondsLow:i().nonnegative(),gpuSecondsHigh:i().nonnegative()}),d({usdLow:i().nonnegative(),usdHigh:i().nonnegative(),notes:S(l()).readonly()}),{auth:`admin`}),uploadDataset:D(d({...QJ,ticket:En}),d({bytes:i().int().nonnegative(),sha256:l()}),{kind:`mutation`,auth:`admin`,timeoutMs:120*6e4}),submitJob:D(d({...QJ,trainer:ZJ,jobSpecJson:l().min(2).max(64e3),gpuType:l(),region:l(),maxRuntimeSec:i().int().positive()}),XJ,{kind:`mutation`,auth:`admin`,timeoutMs:30*6e4}),getJob:D(d(QJ),XJ,{auth:`admin`,timeoutMs:6e4}),listJobEvents:D(d({...QJ,cursor:l().optional(),max:i().int().min(1).max(500)}),d({lines:S($J).readonly(),cursor:l()}),{auth:`admin`,timeoutMs:6e4}),cancelJob:D(d(QJ),d({ok:m(!0)}),{kind:`mutation`,auth:`admin`,timeoutMs:6e4}),readResult:D(d(QJ),d({found:C(),text:l().optional()}),{kind:`mutation`,auth:`admin`,timeoutMs:5*6e4}),offerArtifact:D(d({...QJ,path:x([`bundle.tar`])}),d({ticket:En}),{kind:`mutation`,auth:`admin`,timeoutMs:5*6e4}),cleanupJob:D(d(QJ),d({deleted:S(l()).readonly()}),{kind:`mutation`,auth:`admin`,timeoutMs:5*6e4}),listJobs:D(d({entryId:l().min(1).optional()}),S(XJ).readonly(),{auth:`admin`,timeoutMs:2*6e4})}},tY=d({collectionIds:S(l()).min(1),workState:x([`complete`,`annotated_or_complete`,`any_annotated`]).default(`complete`)}),nY=d({modelId:l(),label:l(),weights:l(),imgsz:i().int(),baselineOnnxUrl:l(),baselineFloors:y(l(),i()),recommended:C()}),rY=x([`quick`,`standard`,`thorough`]),iY=d({selection:tY,entryId:l().min(1),gpuType:l().min(1),region:l(),baseModelId:l().min(1),preset:rY,freeze:i().int().nonnegative().nullable(),holdoutCameras:S(i().int()).nullable()}),aY=d({holdoutCameras:S(i().int()).readonly(),holdoutLastDays:i().int().nonnegative(),holdoutSupport:y(l(),i().int()).nullable(),trainSubjects:i().int()}),oY=x([`unknown-dataset`,`unknown-provider`,`provider-not-configured`,`unknown-base-model`,`unknown-gpu`,`dataset-too-large`,`no-training-subjects`,`job-already-running`]),sY=d({refusal:d({reason:oY,detail:l()}).nullable(),warnings:S(l()).readonly(),split:aY.nullable(),estimate:d({datasetBytes:i().int(),uploadMinutesAt20Mbps:i(),gpuSecondsLow:i(),gpuSecondsHigh:i(),usdLow:i(),usdHigh:i(),notes:S(l()).readonly()}).nullable(),defaults:d({maxCostUsd:i(),maxRuntimeSec:i().int()}).nullable(),dataNotice:l()}),cY=x([`queued`,`uploading`,`submitted`,`starting`,`running`,`collecting`,`ready`,`registered`,`canary`,`failed`,`cancelling`,`cancelled`,`lost`,`expired`,`discarded`]),lY=x([`cost-cap`,`runtime-cap`,`upload-failed`,`submit-failed`,`trainer-failed`,`result-invalid`,`checksum-mismatch`,`fetch-failed`,`provider-error`,`hub-restart-during-upload`]),uY=d({epoch:i().int(),map50:i().nullable(),map50_95:i().nullable()}),dY=d({deviceIds:S(i().int()).readonly(),since:i(),previous:S(d({deviceId:i().int(),nodeId:l(),deviceKey:l(),patch:d({modelId:l().optional(),settings:y(l(),o()).readonly().optional()}).nullable()})).readonly()}),Z=d({id:l(),idempotencyKey:l(),name:l(),createdAt:i(),updatedAt:i(),state:cY,batchId:l().nullable().default(null),stage:il.nullable(),failure:d({reason:lY,stage:l().nullable(),detail:l()}).nullable(),request:iY,maxCostUsd:i().nonnegative(),maxRuntimeSec:i().int().positive(),trainer:ZJ,datasetLayout:oj,frameCount:i().int().nonnegative(),frameIds:S(l()).max(2e4).readonly(),annotationHash:l(),dataset:d({bytes:i().int(),sha256:l(),uploadedAt:i()}).nullable(),split:aY,provider:d({state:YJ.nullable(),providerJobId:l().nullable(),startedAt:i().nullable(),endedAt:i().nullable(),billedSeconds:i(),costUsd:i(),costIsEstimate:C(),lastPolledAt:i().nullable()}),progress:d({epoch:i().int().nullable(),epochs:i().int().nullable(),etaSec:i().nullable(),series:S(uY).readonly()}),logTail:S(l()).readonly(),logCursor:l().nullable(),artifacts:d({bundleBytes:i().int(),bundleSha256:l(),fetchedAt:i(),expiresAt:i()}).nullable(),cloudDatasetDeletedAt:i().nullable(),cloudCleanupDueAt:i().nullable(),registeredModelIds:S(l()).readonly(),canary:dY.nullable()}),fY=d({id:l().min(1)}),pY={name:`training`,scope:`system`,mode:`singleton`,mount:{kind:`hub-only`},methods:{listBaseModels:D(d({}),S(nY).readonly(),{auth:`admin`}),planJob:D(iY,sY,{auth:`admin`,timeoutMs:6e4}),startJob:D(iY.extend({name:l().min(1).max(120),maxCostUsd:i().positive(),maxRuntimeSec:i().int().positive(),idempotencyKey:l().min(8).max(80)}),p(`kind`,[d({kind:m(`started`),job:Z}),d({kind:m(`refused`),reason:oY,detail:l()})]),{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),startJobBatch:D(iY.omit({baseModelId:!0}).extend({baseModelIds:S(l().min(1)).min(1),name:l().min(1).max(120),maxCostUsd:i().positive(),maxRuntimeSec:i().int().positive(),idempotencyKey:l().min(8).max(80)}),p(`kind`,[d({kind:m(`started`),batchId:l(),jobs:S(Z).min(1).readonly()}),d({kind:m(`refused`),reason:oY,detail:l()})]),{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),listJobs:D(d({}),S(Z).readonly(),{auth:`admin`}),getJob:D(fY,Z.nullable(),{auth:`admin`}),cancelJob:D(fY,Z,{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),getJobResult:D(fY,rl.nullable(),{auth:`admin`}),registerResult:D(fY.extend({canaryDeviceIds:S(i().int()).readonly()}),Z,{kind:`mutation`,auth:`admin`,timeoutMs:30*6e4}),canaryResult:D(fY.extend({deviceIds:S(i().int()).min(1).readonly()}),Z,{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),rollbackCanary:D(fY,Z,{kind:`mutation`,auth:`admin`,timeoutMs:12e4}),discardResult:D(fY,Z,{kind:`mutation`,auth:`admin`})}},mY=[`decoder`,`motion-detection`,`pipeline-executor`,`audio-analyzer`,`pipeline-analytics`,`notification-output`],hY=[...mY,`pipeline-orchestrator`,`pipeline-runner`];function gY(e,t){return t.slot===e}function _Y(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(!gY(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 vY(e,t){return`${e}:${t}`}function yY(e){let{source:t,label:n,slots:r,hostTypeOf:i,logger:a}=e,o=(e,t)=>t!==null&&Jx[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=>vY(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 ${Jx[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:vY(t,i.slot),slot:i.slot,authority:r.authority,activation:r.activation,value:r.value,sources:[...r.sources],...r.impliedSources===void 0?{}:{impliedSources:[...r.impliedSources]}})}return a},listCandidates:async e=>({candidates:[...await(await s(e.deviceId,e.slotRef)).candidates(e.deviceId)]}),setSlot:async e=>{let t=await(await s(e.deviceId,e.slotRef)).set(e.deviceId,e.value);return a.info(`device-extension: slot written`,{tags:{deviceId:e.deviceId},meta:{slotRef:e.slotRef,reload:t.reload}}),t}}}var bY={"°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}},xY=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 SY(e){return Object.hasOwn(bY,e)?bY[e]:void 0}function CY(e){return SY(e)?.dimension}function wY(e,t){return e*t.factor+t.offset}function TY(e,t){return(e-t.offset)/t.factor}function EY(e,t,n){if(t===n)return e;let r=SY(t);if(!r)throw new xY(t,n,`unknown-from`);let i=SY(n);if(!i)throw new xY(t,n,`unknown-to`);if(r.dimension!==i.dimension)throw new xY(t,n,`cross-dimension`);return TY(wY(e,r),i)}function DY(e,t,n){if(t===n)return e;let r=SY(t);if(!r)return;let i=SY(n);if(i&&r.dimension===i.dimension)return TY(wY(e,r),i)}function OY(e,t){if(e===t)return!0;let n=CY(e);return n===void 0?!1:n===CY(t)}function kY(e){let t=[];for(let[n,r]of Object.entries(bY))r.dimension===e&&t.push(n);return t}function AY(e){return`${L(e.source)} ${e.cap}.${e.fieldPath}`}function jY(e){return e.fatal||e.confirmed===!0}function MY(e,t){return e.state===`unavailable`?{state:`unavailable`,value:null,reason:`${AY(t)}: ${e.reason}`,fatal:e.fatal,confirmed:jY(e)}:{state:e.state,value:e.value,reason:e.state===`stale`?`${AY(t)}: ${e.reason}`:null,deadline:null}}function NY(e,t,n,r){let i={},a=[],o=null,s=null;for(let[n,r]of Object.entries(e.bindings)){if(r.kind===`literal`){i[n]=r.value;continue}let e=t(r);if(e.state===`unavailable`){let t={state:`unavailable`,value:null,reason:`binding \`${n}\` (${AY(r)}): ${e.reason}`,fatal:e.fatal,confirmed:jY(e)};if(e.fatal){o=t;break}(s===null||t.confirmed&&!s.confirmed)&&(s=t);continue}i[n]=e.value,e.state===`stale`&&a.push(`\`${n}\`: ${e.reason}`)}let c=o??s;if(c!==null)return r!==void 0&&r.currentOutput!==void 0&&av(e.expr,`count`)?{state:`stale`,value:Pa(null,{kind:`count`,highWater:null,primed:!1},r.currentOutput),reason:`${c.reason}; holding the last accumulator value`,deadline:null}:c;let l=[],u=Do(e.expr,i,n,{hooks:{noteDeadline:e=>l.push(e),convert:(e,t,n)=>DY(e,Ab(t)??t,Ab(n)??n)??null},...r===void 0?{}:{invokeStateful:e=>Co(r.callPathPrefix===void 0?e:{...e,path:`${r.callPathPrefix}@${e.path}`},r.expressionMemory,{currentOutput:r.currentOutput,startedAtMs:r.startedAtMs,nowMs:n})}});return u.ok?{state:a.length>0?`stale`:`fresh`,value:u.value,reason:a.length>0?a.join(`; `):null,deadline:l.length>0?Math.min(...l):null}:{state:`unavailable`,value:null,reason:`the expression failed: ${u.error}`,fatal:!1,confirmed:!0,expressionFailed:!0}}function PY(e){let{source:t}=e;switch(t.kind){case`from`:return MY(e.read(t),t);case`expression`:return NY(t,e.read,e.now,e.stateful);case`code`:return{state:`unavailable`,value:null,reason:`code fields are not runnable in the composer — they arrive in slice 4`,fatal:!0,confirmed:!0}}}var FY=3e5,IY=[{addonId:`provider-homeassistant`,stableId:`sensor.living_room_temperature`},{addonId:`provider-homeassistant`,stableId:`sensor.sofa_temperature`},{addonId:`provider-homeassistant`,stableId:`sensor.window_temperature`}],LY=[{addonId:`provider-homeassistant`,stableId:`binary_sensor.living_room_motion`},{addonId:`provider-homeassistant`,stableId:`binary_sensor.living_room_presence`}];function RY(e,t,n){return{kind:`from`,source:e,cap:t,fieldPath:n}}function zY(e,t,n,r){return Object.fromEntries(t.map((t,i)=>[`${e}${i+1}`,RY(t,n,r)]))}function BY(e){let t=zY(`t`,e.temperatureSources,`temperature-sensor`,`celsius`),n=zY(`f`,e.temperatureSources,`temperature-sensor`,`lastFetchedAt`),r=zY(`d`,e.motionSources,`motion`,`detected`),i=zY(`m`,e.motionSources,`motion`,`lastDetectedAt`),a=Object.keys(i).map(t=>`within(${t}, ${e.occupancyWindowMs})`);return ts.parse({target:{kind:`new`,type:k.Sensor,role:A.TemperatureSensor},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 VY=`8dec3b512fda40cbb8cd121c7a99f890`,HY=`provider-homeassistant`;function UY(e){let t={addonId:HY,stableId:`ha:${e}:dev:${VY}`},n=e=>({addonId:HY,stableId:`${t.stableId}-${e}`});return{feeder:t,desiccantDays:n(`sensor.freshelement_3_desiccant_days_remaining`),batteryStatus:n(`sensor.freshelement_3_battery_status`),batteryCharging:n(`binary_sensor.freshelement_3_battery`)}}function WY(e){let t={d:RY(e.desiccantDays,`enum-sensor`,`value`)};return ts.parse({target:{kind:`existing`,device:e.feeder},features:[{kind:`fields`,cap:`consumables`,fields:{lastChangedAt:{kind:`expression`,expr:`now`,bindings:{}},lastFetchedAt:{kind:`expression`,expr:`now`,bindings:{}}},items:{desiccant:{label:`Desiccant`,fields:{"remaining.value":{kind:`expression`,expr:`number(d)`,bindings:t},"remaining.unit":{kind:`expression`,expr:`"days"`,bindings:{}},status:{kind:`expression`,expr:`number(d) == null ? null : (number(d) <= 0 ? "replace" : "ok")`,bindings:t}}}}},{kind:`fields`,cap:`battery`,fields:{percentage:{kind:`expression`,expr:`s == "low" ? 15 : (s == "normal" ? 100 : null)`,bindings:{s:RY(e.batteryStatus,`enum-sensor`,`value`)}},binary:{kind:`expression`,expr:`true`,bindings:{}},charging:{kind:`expression`,expr:`c ? "dc" : "unknown"`,bindings:{c:RY(e.batteryCharging,`binary`,`on`)}},sleeping:{kind:`expression`,expr:`false`,bindings:{}},lastUpdated:{kind:`expression`,expr:`now`,bindings:{}}}}]})}var GY=2e3;function KY(e,t){return Object.keys(ha).filter(e=>Object.hasOwn(ga,e)&&t.includes(e)).toSorted().flatMap(t=>{let n=ha[t],r=ga[t];return n===void 0||r===void 0?[]:[{source:e,cap:t,activeField:n,changedAtField:r}]})}function qY(e){let t=[...e.sources].toSorted((e,t)=>`${e.source.addonId}/${e.source.stableId}#${e.cap}`.localeCompare(`${t.source.addonId}/${t.source.stableId}#${t.cap}`));if(t.length===0)throw Error(`doorbell composition needs at least one source`);let n={};return t.forEach((e,t)=>{n[`active${t}`]={kind:`from`,source:e.source,cap:e.cap,fieldPath:e.activeField},n[`changed${t}`]={kind:`from`,source:e.source,cap:e.cap,fieldPath:e.changedAtField}}),{kind:`fields`,cap:`doorbell`,enabled:e.enabled,fields:{lastPressedAt:{kind:`expression`,expr:`latest(${t.map((e,t)=>`rose(active${t}, changed${t}, ${GY})`).join(`, `)})`,bindings:n},pressCountSinceStart:{kind:`expression`,expr:`count(lastPressedAt)`,bindings:{lastPressedAt:{kind:`from`,source:{addonId:e.camera.addonId,stableId:e.camera.stableId},cap:`doorbell`,fieldPath:`lastPressedAt`}}}}}}var JY=_a.filter(e=>e!==`switch`&&e!==`motion`);function YY(e){let t=ha[e.cap];if(t===void 0||!JY.includes(e.cap))return null;let n={kind:`expression`,expr:`!v`,bindings:{v:{kind:`from`,source:e.self,cap:e.cap,fieldPath:t}}};return{kind:`fields`,cap:e.cap,fields:{[t]:n}}}function XY(e){return{kind:`expression`,expr:JSON.stringify(e),bindings:{}}}function ZY(e){if(e.from===e.to||!OY(e.from,e.to))return null;let t={kind:`expression`,expr:`convert(v, ${JSON.stringify(e.from)}, ${JSON.stringify(e.to)})`,bindings:{v:{kind:`from`,source:e.self,cap:e.cap,fieldPath:e.fieldPath}}};return{kind:`fields`,cap:e.cap,fields:{[e.fieldPath]:t,...e.unitField===null?{}:{[e.unitField]:XY(e.to)}}}}function QY(e){return tu.some(t=>t===e)}var $Y={person:`person`,baby:`person`,car:`vehicle`,motorcycle:`vehicle`,bicycle:`vehicle`,boat:`vehicle`,school_bus:`vehicle`,garbage_truck:`vehicle`,dog:`animal`,cat:`animal`,deer:`animal`,horse:`animal`,bird:`animal`,raccoon:`animal`,fox:`animal`,bear:`animal`,cow:`animal`,squirrel:`animal`,goat:`animal`,rabbit:`animal`,skunk:`animal`,kangaroo:`animal`,possum:`animal`,rodent:`animal`,package:`package`},eX={face:`attribute`,license_plate:`attribute`,amazon:`attribute`,usps:`attribute`,ups:`attribute`,fedex:`attribute`,dhl:`attribute`,an_post:`attribute`,purolator:`attribute`,postnl:`attribute`,nzpost:`attribute`,postnord:`attribute`,gls:`attribute`,dpd:`attribute`,canada_post:`attribute`,royal_mail:`attribute`,waste_bin:`no-macro`,bbq_grill:`no-macro`,robot_lawnmower:`no-macro`,umbrella:`no-macro`,baby_stroller:`no-macro`};function tX(e){let t={};for(let n of e){let e=$Y[n]??BT.mapping[n];e!==void 0&&QY(e)&&(t[n]=e)}return{mapping:t,preserveOriginal:!1}}function nX(e){let t=tX(e),n=_p(e,t);return n.length>0?{classMap:t,suppliesSteps:n}:{classMap:t}}var rX=Object.freeze({person:.5,vehicle:.5,animal:.5}),iX=Object.freeze({person:.65,vehicle:.65,animal:.65});function aX(e,t){return t===void 0?{...e===`plus`?iX:rX}:{...t}}var oX=[{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 sX(e){for(let t of oX){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 cX(e,t=[]){for(let n of oX){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 lX={Siren:A.Siren,Floodlight:A.Floodlight,Spotlight:A.Spotlight,PirSensor:A.PirSensor,Chime:A.Chime,Autotrack:A.Autotrack,Nightvision:A.Nightvision,PrivacyMask:A.PrivacyMask},uX={[lX.Siren]:`Siren`,[lX.Floodlight]:`Floodlight`,[lX.Spotlight]:`Spotlight`,[lX.PirSensor]:`PIR`,[lX.Chime]:`Chime`,[lX.Autotrack]:`Autotracking`,[lX.Nightvision]:`Night Vision`,[lX.PrivacyMask]:`Privacy Mask`};function dX(e,t,n){let r=`${e}:${t}`;return typeof n==`number`?`${r}:${n}`:r}var fX=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}))}},pX=class e{writer;onWriteFailed;pendingWrites=new Set;failedWrites=new Set;slices;schemas=new Map;listeners=new Set;capListeners=new Map;constructor(e,t,n){this.writer=t,this.onWriteFailed=n,this.slices=new Map;for(let[t,n]of Object.entries(e))n&&typeof n==`object`&&!Array.isArray(n)&&this.slices.set(t,{...n})}static fromInitial(t,n,r){return new e(t,n,r)}installCapSchema(e,t){let n=this.schemas.get(e);if(n){if(n!==t)throw Error(`[DeviceRuntimeState] capability "${e}" registered a different runtime-state schema; each cap must declare ONE shape across every provider`);return}this.schemas.set(e,t);let r=this.slices.get(e);if(r){let n=t.safeParse(r);n.success?this.slices.set(e,n.data):this.slices.delete(e)}}getCapState(e){let t=this.slices.get(e);if(t)return Object.freeze({...t})}getCapField(e,t){return this.slices.get(e)?.[t]}setCapState(e,t){this.applyCapWrite(e,t,!1)}patchCapState(e,t){this.applyCapWrite(e,t,!0)}applyCapWrite(e,t,n){let r=this.schemas.get(e);if(!r)throw Error(`[DeviceRuntimeState] no schema registered for cap "${e}" — did the device register it via ctx.registerNativeCap before writing?`);let i=this.slices.get(e)??{},a=n?{...i,...t}:{...t},o=r.parse(a);if(mX(i,o)&&!this.failedWrites.has(e))return;this.slices.set(e,o),this.fireListeners([e]);let s=this.writer(e,{...o}).then(()=>{this.failedWrites.delete(e)}).catch(t=>{this.failedWrites.add(e),this.onWriteFailed?.(e,t instanceof Error?t.message:String(t))});this.pendingWrites.add(s),s.finally(()=>{this.pendingWrites.delete(s)})}fireListeners(e){let t=this.snapshot();for(let n of this.listeners)try{n(e,t)}catch{}for(let t of e){let e=this.capListeners.get(t);if(!e)continue;let n=this.getCapState(t);for(let t of e)try{t(n)}catch{}}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}subscribeCap(e,t){let n=this.capListeners.get(e);n||(n=new Set,this.capListeners.set(e,n));let r=e=>{t(e)};return n.add(r),()=>{let t=this.capListeners.get(e);t&&(t.delete(r),t.size===0&&this.capListeners.delete(e))}}snapshot(){let e={};for(let[t,n]of this.slices)e[t]=Object.freeze({...n});return Object.freeze(e)}async flush(){if(this.pendingWrites.size===0)return;let e=[...this.pendingWrites];await Promise.allSettled(e)}};function mX(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 hX={airQualitySensor:XR,alarmPanel:lE,ambientLightSensor:QR,audioMetrics:rz,automationControl:az,battery:sz,binary:lz,brightness:dz,cameraStreams:Yg,carbonMonoxide:Pz,climateControl:Lz,color:Hz,connectivity:Yz,consumables:eB,contact:nB,control:oB,cover:lB,dayNight:hB,deviceDiscovery:Ib,deviceStatus:_B,doorbell:bB,enumSensor:CB,eventEmitter:EB,fanControl:BB,featureProbe:HB,flood:WB,gas:KB,humidifier:JB,humiditySensor:XB,image:QB,imageSettings:sV,intercom:bV,lawnMowerControl:wV,lockControl:qV,mediaPlayer:QV,motion:oH,motionTrigger:lH,motionZones:mH,nativeObjectDetection:SH,navigation:IH,networkLink:HH,notifier:_U,numericSensor:yU,petFeeder:WU,powerMeter:mW,presence:_W,pressureSensor:yW,privacyMask:TW,ptzAutotrack:BW,recordingOnboard:tK,recordingSignal:wK,sceneMonitor:JK,scriptRunner:$K,smoke:tq,streamCatalog:iq,streamParams:dq,streamSignals:VI,switch:_q,tamper:Xq,temperatureSensor:Qq,update:nJ,vacuumControl:yJ,valve:SJ,vibration:wJ,waterHeater:EJ,weather:OJ,zoneAnalytics:LJ,zoneRules:zJ,zones:vP},gX=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=hX[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??{},i=si(t);this.config=fX.fromSchema(t,t=>e.persistConfig(t,{secretConfigPaths:i}),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 a=null,o=async(t,n)=>{a||=e.fetchDevice(e.id),await(await a).deviceState.setCapSlice({capName:t,slice:n})},s=e.initialRuntimeState??{},c=(t,n)=>{e.logger.warn(`runtime-state write refused by the hub — the slice is not mirrored; it is re-sent on the next write`,{tags:{deviceId:e.id},meta:{cap:t,error:n}})};this.runtimeState=pX.fromInitial(s,o,c),e.bindRuntimeState?.(this.runtimeState),e.registerNativeCap?.(_B,{});let l={online:!0,lastChangedAt:Date.now()};this.runtimeState.setCapState(`device-status`,l),e.registerNativeCap?.(HB,{}),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=Mb(this.ctx.deviceMeta.metadata)??Ob({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=kb(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:{[jb]:t}})}catch{}this.ctx.eventBus.emit(it(`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}},_X=[1e4,3e4,9e4],vX=4;function yX(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 bX(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 xX=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??_X,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 yX(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 bX(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 SX(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 CX=class extends hn{async onInitialize(){return this.ctx.logger.info(`${this.providerName} Provider initialized`),[{capability:xx,provider:this}]}async onShutdown(){this._restoreShuttingDown=!0,this.cancelRestoreRetries();let e=await this.ctx.kernel.devices?.getAll()??[];for(let t of e)try{await this.ctx.kernel.devices?.decommission(t.id)}catch(e){this.ctx.logger.warn(`${this.providerName}: decommission failed`,{tags:{deviceId:t.id,stableId:t.stableId},meta:{error:e instanceof Error?e.message:String(e)}})}this.ctx.logger.info(`${this.providerName} Provider shut down`,{meta:{decommissionedCount:e.length}})}async start(){}async stop(){}async getStatus(){let e=await this.ctx.kernel.devices?.getAll()??[],t=this.restoreFailureSummary(),n={connected:!0,deviceCount:e.length,motionSliceWriter:`orchestrator`};return t===null?n:{...n,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(k).find(e=>this.deviceClasses[e]!==void 0)??null}:{deviceType:null}}async adoptDiscoveredDevice(e){throw Error(`${this.providerName} provider does not support discovery-based adoption`)}async supportsManualCreation(){return!0}async getChildCreationSchema(e){return this.onGetCreationSchema(e.type)}async createDevice(e){let t=await this.onCreateDevice(e.type,e.config),n=this.deviceClasses[t.meta.type];if(!n)throw Error(`${this.providerName} provider: no device class registered for type "${t.meta.type}" — add it to the deviceClasses map`);let r=this.generateStableId(t.meta.type,t.config),i=await this.ctx.kernel.devices.create(r,n,t.config,null,t.meta);if(t.onAfterCreate)try{await t.onAfterCreate(i)}catch(e){this.ctx.logger.warn(`createDevice: onAfterCreate hook threw — device is already registered`,{tags:{deviceId:i.id,stableId:r},meta:{error:e instanceof Error?e.message:String(e)}})}return this.toSummary(i)}generateStableId(e,t){return`${this.addonId}-${Date.now()}`}async testCreationField(e){return{status:`ok`,labels:[`probe not implemented`]}}async restoreDevices(e){this._restoreShuttingDown=!1;let t=await this.onRestoreDevices(e);if(e.length===0)return;if(t&&t.failedCount>0){this.ctx.logger.warn(`Restored ${t.restoredCount}/${e.length} ${this.providerName} device(s) — ${t.failedCount} failed, bounded retry scheduled`);return}let n=t?t.restoredCount:e.length;this.ctx.logger.info(`Restored ${n} ${this.providerName} device(s)`)}restoreRetryDelaysMs=_X;restoreRetryConcurrency=4;_restoreRetrySchedulers=[];_restoreRetryCompletion=null;_restoreShuttingDown=!1;_permanentRestoreFailures=new Map;get restoreRetryCompletion(){return this._restoreRetryCompletion}get permanentRestoreFailures(){return[...this._permanentRestoreFailures.values()]}restoreFailureSummary(){if(this._permanentRestoreFailures.size===0)return null;let e=[...this._permanentRestoreFailures.keys()].join(`, `);return`${this._permanentRestoreFailures.size} device(s) permanently failed restore (deviceIds: ${e}) — restart the ${this.providerName} provider to retry`}quarantineConfiglessTopLevelRestores=!0;isUnrestorableShell(e){if(!this.quarantineConfiglessTopLevelRestores||e.parentDeviceId!==null)return!1;let t=e.config;return t===void 0?!1:Object.keys(t).length===0}quarantineShell(e){this._permanentRestoreFailures.set(e.id,{deviceId:e.id,stableId:e.stableId,type:e.type,attempts:0,lastError:`persisted row has no configuration`,failedAt:Date.now()}),this.ctx.logger.error(`Persisted device row has NO configuration — quarantined: not restored, not retried. Remove it (deviceManager.removeDevice) or re-add the device.`,{tags:{deviceId:e.id,stableId:e.stableId},meta:{type:e.type,provider:this.providerName}})}cancelRestoreRetries(){for(let e of this._restoreRetrySchedulers)e.cancel();this._restoreRetrySchedulers=[]}recordPermanentRestoreFailure(e){this._permanentRestoreFailures.set(e.deviceId,e),this.ctx.logger.error(`Device restore permanently failed — its capabilities will not register until the provider restarts`,{tags:{deviceId:e.deviceId,stableId:e.stableId},meta:{type:e.type,attempts:e.attempts,error:e.lastError}})}scheduleRestoreRetries(e,t){if(this._restoreShuttingDown){this.ctx.logger.info(`Restore retries not scheduled — the provider is shutting down`,{meta:{rows:e.length,deviceIds:e.map(e=>e.saved.id)}});return}let n=new xX({logger:this.ctx.logger,delaysMs:this.restoreRetryDelaysMs,concurrency:this.restoreRetryConcurrency,attempt:t,onPermanentFailure:e=>this.recordPermanentRestoreFailure(e)});this._restoreRetrySchedulers=[...this._restoreRetrySchedulers,n];let r=n.run(e).then(()=>void 0).catch(e=>{this.ctx.logger.error(`Restore retry scheduler crashed`,{meta:{error:e instanceof Error?e.message:String(e)}})}),i=this._restoreRetryCompletion;this._restoreRetryCompletion=i===null?r:Promise.all([i,r]).then(()=>void 0)}async restoreWithBoundedRetry(e,t){let n=[];for(let r of e){if(this.isUnrestorableShell(r)){this.quarantineShell(r);continue}try{await t(r)}catch(e){let t=e instanceof Error?e.message:String(e);this.ctx.logger.warn(`Failed to restore device — bounded retry scheduled`,{tags:{deviceId:r.id,stableId:r.stableId},meta:{type:r.type,attempt:1,error:t}}),n.push({saved:r,error:t})}}n.length>0&&this.scheduleRestoreRetries(n,t)}async reloadDevice(e){let{stableId:t}=e,n=this.ctx.kernel.devices;if(!n)throw Error(`${this.providerName}: kernel.devices unavailable — cannot reload`);let r=(await n.getAll()).find(e=>e.stableId===t);r&&await n.decommission(r.id);let{id:i}=await this.ctx.api.deviceManager.allocateDeviceId.mutate({addonId:this.addonId,stableId:t}),a=await this.ctx.api.deviceManager.loadMeta.query({deviceId:i});if(a===null)throw Error(`${this.providerName}: no persisted meta for "${t}" (id ${i}) — cannot reload`);let o=Object.values(k).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(k).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 SX(e,this.addonId)}},wX=360*6e4;function TX(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 EX(e){return e===`unreachable`}var DX=[`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`],OX=[`contact-sensor`,`motion-sensor`,`occupancy-sensor`,`smoke-sensor`,`co-sensor`,`gas-sensor`,`leak-sensor`,`vibration-sensor`,`tamper-sensor`,`sound-sensor`];function kX(e){if(e===void 0)return OX.length;let t=OX.indexOf(e);return t===-1?OX.length:t}function AX(e){let t=DX.indexOf(e);return t===-1?DX.length:t}function jX(e,t){let n=e=>e.toLowerCase().replace(/[-_\s]+/g,` `).trim();return n(e)===n(t)}function MX(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&&jX(e.name,n)?0:1;return[...e].toSorted((e,t)=>kX(e.role)-kX(t.role)||r(e)-r(t)||AX(e.type)-AX(t.type))[0]??null}function NX(e,t,n,r,i){if(r.has(e))return;let a=t.get(e);if(!a)return;if(a.type!==k.Container){i.add(e);return}let o=new Set(r);o.add(e);let s=MX((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&&NX(s.id,t,n,o,i)}function PX(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=>NX(e,i,a,new Set,o);for(let e of r){if(e.type===k.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===k.Container){s(r.id);continue}o.add(e.id)}return o.delete(t),[...o]}var FX=`fixed`;function IX(e){let t=e??`hub`;return t.includes(`/`)?t.split(`/`)[0]??`hub`:t}var LX=32,RX=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=IX(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:{[FX]:!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:{[FX]:!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}};async function zX(e,t){let n=await e.api.integrations.getByAddonId.query({addonId:iy});return n==null?(e.logger.warn(`reconcileBlockDevices: Blocks integration is not ready — skipping this pass`,{meta:{blockAddonId:e.id}}),{integrationId:null,devices:[],removed:[],owned:!1}):new RX({logger:e.logger.child(`declared-devices`),addonId:e.id,devices:e.kernel.devices,localNodeId:e.kernel.localNodeId,getIntegration:async()=>{throw Error(`reconcileBlockDevices: devices hang off the Blocks integration; it never reads its own`)},createIntegration:async()=>{throw Error(`reconcileBlockDevices: devices hang off the Blocks integration; it never mints one`)},updateIntegration:async()=>{throw Error(`reconcileBlockDevices: devices hang off the Blocks integration; it never updates one`)},listOwnDevices:()=>e.api.deviceManager.listAll.query({addonId:e.id})}).reconcile({integrationId:n.id,integrationName:n.name,placement:t.placement??`hub`,devices:t.devices})}async function BX(e,t){for(let n of t.exporterAddonIds)for(let r of t.deviceIds)try{await e.api.deviceExport.exposeDevice.mutate({addonId:n,deviceId:String(r),nodeId:`hub`})}catch(t){e.logger.warn(`exposeBlockDevices: expose refused`,{tags:{deviceId:r},meta:{exporterAddonId:n,error:t instanceof Error?t.message:String(t)}})}}var VX={[k.Cover]:`cover`,[k.Valve]:`valve`,[k.Humidifier]:`humidifier`,[k.WaterHeater]:`water-heater`,[k.Camera]:`dummy`,[k.Hub]:`dummy`,[k.Switch]:`switch`,[k.Siren]:`switch`,[k.Light]:`light`,[k.Fan]:`fan`,[k.Sensor]:`sensor`,[k.Thermostat]:`thermostat`,[k.Climate]:`climate`,[k.Button]:`button`,[k.EventEmitter]:`dummy`,[k.Update]:`update`,[k.Generic]:`dummy`,[k.Notifier]:`dummy`,[k.Script]:`script`,[k.Automation]:`automation`,[k.Lock]:`lock`,[k.MediaPlayer]:`media-player`,[k.AlarmPanel]:`alarm`,[k.Control]:`control`,[k.Presence]:`sensor`,[k.Weather]:`weather`,[k.Vacuum]:`vacuum`,[k.LawnMower]:`lawn-mower`,[k.Container]:`dummy`,[k.Image]:`image`,[k.PetFeeder]:`pet-feeder`},HX=new Set(Object.values(k));function UX(e){return HX.has(e)?VX[e]:null}var WX=`motion-trigger`;function GX(e){return e.includes(WX)}var KX=[`temperature-sensor`,`humidity-sensor`,`ambient-light-sensor`,`numeric-sensor`,`enum-sensor`];function qX(e){let t=new Set(e.features);switch(e.type){case k.Cover:return{kind:`cover`};case k.Valve:return{kind:`valve`};case k.Lock:return{kind:`lock`};case k.AlarmPanel:return{kind:`alarm`};case k.Light:return t.has(`brightness`)?{kind:`brightness`}:{kind:`switch`};case k.Switch:case k.Siren:return{kind:`switch`};case k.Sensor:case k.Presence:{let e=KX.find(e=>t.has(e));return e?{kind:`sensor`,sensorFeature:e}:{kind:`none`}}default:return{kind:`none`}}}var JX={"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 YX(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function XX(e,t){if(!YX(e))return null;let n=e[t];if(!YX(n))return null;let r=n.mutate;return typeof r==`function`?r:null}var ZX=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.listInstallations":{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.checkBackupKey":{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.disableEncryption":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"backup.getEncryption":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"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.setupEncryption":{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`},"calendars.getPreferences":{capName:`calendars`,capScope:`system`,addonId:null,access:`view`},"calendars.listCalendars":{capName:`calendars`,capScope:`system`,addonId:null,access:`view`},"calendars.listEvents":{capName:`calendars`,capScope:`system`,addonId:null,access:`view`},"calendars.setCalendarPreference":{capName:`calendars`,capScope:`system`,addonId:null,access:`create`},"calendarSource.listCalendars":{capName:`calendar-source`,capScope:`system`,addonId:null,access:`view`},"calendarSource.listEvents":{capName:`calendar-source`,capScope:`system`,addonId:null,access:`view`},"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.getBlockSettings":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.getComposition":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.getCustomization":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.getTypeDefs":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.list":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.listComposableCaps":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.listCompositions":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`view`},"coreBlocks.restart":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.setEnabled":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.update":{capName:`core-blocks`,capScope:`system`,addonId:null,access:`create`},"coreBlocks.updateBlockSettings":{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.importModelBundle":{capName:`custom-model-registry`,capScope:`system`,addonId:null,access:`create`},"customModelRegistry.listModels":{capName:`custom-model-registry`,capScope:`system`,addonId:null,access:`view`},"databaseSnapshot.listDatabases":{capName:`database-snapshot`,capScope:`system`,addonId:null,access:`view`},"databaseSnapshot.writeSnapshot":{capName:`database-snapshot`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.aggregate":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.count":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.declareCollection":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.delete":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`delete`},"dataStoreProvider.deleteWhere":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`delete`},"dataStoreProvider.get":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.getEngineInfo":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.histogram":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.insert":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.insertMany":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.isEmpty":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.query":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`view`},"dataStoreProvider.set":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.update":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.updateWhere":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dataStoreProvider.upsert":{capName:`data-store-provider`,capScope:`system`,addonId:null,access:`create`},"dayNight.getOptions":{capName:`day-night`,capScope:`device`,addonId:null,access:`view`},"dayNight.getStatus":{capName:`day-night`,capScope:`device`,addonId:null,access:`view`},"dayNight.setSettings":{capName:`day-night`,capScope:`device`,addonId:null,access:`create`},"decoder.getInfo":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.reprobeHwaccel":{capName:`decoder`,capScope:`system`,addonId:null,access:`create`},"detectionPipeline.applyDeviceSettingsPatch":{capName:`detection-pipeline`,capScope:`device`,addonId:null,access:`create`},"detectionPipeline.getDeviceLiveContribution":{capName:`detection-pipeline`,capScope:`device`,addonId:null,access:`view`},"detectionPipeline.getDeviceSettingsContribution":{capName:`detection-pipeline`,capScope:`device`,addonId:null,access:`view`},"deviceAdminLink.getAdminLink":{capName:`device-admin-link`,capScope:`device`,addonId:null,access:`view`},"deviceAdoption.adopt":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.getCandidate":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.getStatus":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.listCandidateFilters":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.listCandidates":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.refresh":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.release":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.resync":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceDiscovery.adoptDevice":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceDiscovery.getStatus":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`view`},"deviceDiscovery.listDiscovered":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`view`},"deviceDiscovery.refreshDiscovery":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceDiscovery.releaseDevice":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceExport.applyDeviceSettingsPatch":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceExport.exposeDevice":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceExport.getDeviceLiveContribution":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.getDeviceSettingsContribution":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.getStatus":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.listExposedDevices":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.listSupportedDeviceKinds":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.unexposeDevice":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceExtension.listCandidates":{capName:`device-extension`,capScope:`device`,addonId:null,access:`view`},"deviceExtension.listSlots":{capName:`device-extension`,capScope:`device`,addonId:null,access:`view`},"deviceExtension.listSources":{capName:`device-extension`,capScope:`device`,addonId:null,access:`view`},"deviceExtension.setSlot":{capName:`device-extension`,capScope:`device`,addonId:null,access:`create`},"deviceManager.addLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionAdopt":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionCancelJob":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionListCandidateFilters":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionListCandidates":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionListJobs":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionRefresh":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionRelease":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionResync":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionStartJob":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.allocateDeviceId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.applyInitialMeta":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.createDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.disable":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverAllProviders":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverDevices":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverProvider":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoveryProviders":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.enable":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.getAllBindings":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getBindings":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getBindingsBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getChildren":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getChildrenBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getConfigSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getCreationSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceLiveInfoAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceSettingsAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceStatusAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceStatusAggregateBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getLinkedDevices":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getLinkedDevicesBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getRoleDisplayDefaults":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getSettingsSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getStreamProfileMap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getStreamSources":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getWireableFields":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getWrapperActivation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listAll":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listBindableCapsForDeviceType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listDeviceIdsByCaps":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listLocationDescriptions":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listLocationIcons":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listLocations":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listPersistedByAddon":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listSiteZones":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listWrappersForCap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadMeta":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadRuntimeState":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.migrateDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.persistConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.probeStreams":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.providerCreationType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.providerDiscoveryParamsSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.registerDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.remove":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeByIntegration":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeSiteZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.renameLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.renameSiteZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.runDeviceAction":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setChildLayout":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setDisabled":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setDisplay":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setIntegrationId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLinkDeviceId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocationDescription":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocationIcon":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocationZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setMetadata":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setName":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setPrimaryChildEntityId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setRole":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setRoleDisplayDefaults":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setSiteZone":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setStreamProfileMap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setWrapperActive":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.testCreationField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.testField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateDeviceField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateDeviceFieldsBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceOps.getConfigEntries":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getRawState":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getSettingsSchema":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getStreamSources":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.removeDevice":{capName:`device-ops`,capScope:`device`,addonId:null,access:`delete`},"deviceOps.runAction":{capName:`device-ops`,capScope:`device`,addonId:null,access:`create`},"deviceOps.setConfig":{capName:`device-ops`,capScope:`device`,addonId:null,access:`create`},"deviceProvider.adoptDiscoveredDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.createDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.discoverDevices":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.getChildCreationSchema":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getDevices":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getDiscoveryParamsSchema":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getManualCreationType":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getStatus":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.reloadDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.start":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.stop":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.supportsDiscovery":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.supportsManualCreation":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.testCreationField":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceState.claimFields":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceState.getAllSnapshots":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getNativeCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getSnapshot":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.listClaims":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.patchOwnedFields":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceState.releaseClaim":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceState.setCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"deviceStatus.getStatus":{capName:`device-status`,capScope:`device`,addonId:null,access:`view`},"doorbell.getStatus":{capName:`doorbell`,capScope:`device`,addonId:null,access:`view`},"embeddingEncoder.encode":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.encodeText":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.getInfo":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.resetFailedModels":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`delete`},"enumSensor.getStatus":{capName:`enum-sensor`,capScope:`device`,addonId:null,access:`view`},"eventEmitter.getStatus":{capName:`event-emitter`,capScope:`device`,addonId:null,access:`view`},"faceGallery.assignFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.assignFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.auditIdentitySamples":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.createIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.deleteFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.deleteIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.getFaceByTrack":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.getFaceMedia":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listIdentities":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listIdentitySamples":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listRecentFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.removeSample":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.renameIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.suggestFaceClusters":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.unassignFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.unassignFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"failureContribution.list":{capName:`failure-contribution`,capScope:`system`,addonId:null,access:`view`},"fanControl.getStatus":{capName:`fan-control`,capScope:`device`,addonId:null,access:`view`},"fanControl.setDirection":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setOscillating":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setPercentage":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setPreset":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"featureProbe.getStatus":{capName:`feature-probe`,capScope:`device`,addonId:null,access:`view`},"filesystemBrowse.browse":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`view`},"filesystemBrowse.createDir":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`create`},"filesystemBrowse.listAllowedRoots":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`view`},"flood.getStatus":{capName:`flood`,capScope:`device`,addonId:null,access:`view`},"gas.getStatus":{capName:`gas`,capScope:`device`,addonId:null,access:`view`},"humidifier.getStatus":{capName:`humidifier`,capScope:`device`,addonId:null,access:`view`},"humidifier.setMode":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humidifier.setOn":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humidifier.setTargetHumidity":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humiditySensor.getStatus":{capName:`humidity-sensor`,capScope:`device`,addonId:null,access:`view`},"image.getStatus":{capName:`image`,capScope:`device`,addonId:null,access:`view`},"imageSettings.getOptions":{capName:`image-settings`,capScope:`device`,addonId:null,access:`view`},"imageSettings.getStatus":{capName:`image-settings`,capScope:`device`,addonId:null,access:`view`},"imageSettings.setSettings":{capName:`image-settings`,capScope:`device`,addonId:null,access:`create`},"integrations.create":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.delete":{capName:`integrations`,capScope:`system`,addonId:null,access:`delete`},"integrations.get":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getAvailableTypes":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getByAddonId":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getSettings":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.list":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.setSettings":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.testConnection":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.update":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"intercom.endTalkSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.getStatus":{capName:`intercom`,capScope:`device`,addonId:null,access:`view`},"intercom.handleAnswer":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.pushTalkAudio":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.startSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.startTalkSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.stopSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"keychain.delete":{capName:`keychain`,capScope:`system`,addonId:null,access:`delete`},"keychain.getState":{capName:`keychain`,capScope:`system`,addonId:null,access:`view`},"keychain.listMeta":{capName:`keychain`,capScope:`system`,addonId:null,access:`view`},"keychain.put":{capName:`keychain`,capScope:`system`,addonId:null,access:`create`},"keychain.resolve":{capName:`keychain`,capScope:`system`,addonId:null,access:`view`},"keychainAdmin.acknowledgeReset":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`create`},"keychainAdmin.deleteOrphans":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`delete`},"keychainAdmin.downloadRecoveryKey":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`create`},"keychainAdmin.listAudit":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`view`},"keychainAdmin.listSecrets":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`view`},"keychainAdmin.purgeRetiredKeys":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`delete`},"keychainAdmin.resetKeychain":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`delete`},"keychainAdmin.resetReport":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`delete`},"keychainAdmin.reveal":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`create`},"keychainAdmin.rotateMasterKey":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`create`},"keychainAdmin.setSystemSecret":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`create`},"keychainAdmin.status":{capName:`keychain-admin`,capScope:`system`,addonId:null,access:`view`},"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.addCustomAddress":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"localNetwork.downloadCa":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getAddresses":{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.getHubAddresses":{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.removeCustomAddress":{capName:`local-network`,capScope:`system`,addonId:null,access:`delete`},"localNetwork.resetAllowlistToBestMatch":{capName:`local-network`,capScope:`system`,addonId:null,access:`delete`},"localNetwork.revertToGeneratedCertificate":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"localNetwork.setAddressRole":{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.getTarget":{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.probeTargetConfig":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"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.activateAlarmProfile":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.cancelSnooze":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.createAlarmProfile":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.createRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.createSequence":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.createSnooze":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"notificationRules.deleteAlarmProfile":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`delete`},"notificationRules.deleteRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`delete`},"notificationRules.deleteSequence":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`delete`},"notificationRules.getAlarmConfig":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getAlarmSensors":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getClipRetentionAsks":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getConditionCatalog":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getHistory":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getRule":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getRuleLastRuns":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`view`},"notificationRules.getSequence":{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.listSequences":{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.renameAlarmProfile":{capName:`notification-rules`,capScope:`system`,addonId:null,access:`create`},"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`},"notificationRules.updateSequence":{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`},"oidcConnections.connectionFormSchema":{capName:`oidc-connections`,capScope:`system`,addonId:null,access:`view`},"oidcConnections.createConnection":{capName:`oidc-connections`,capScope:`system`,addonId:null,access:`create`},"oidcConnections.deleteConnection":{capName:`oidc-connections`,capScope:`system`,addonId:null,access:`delete`},"oidcConnections.listConnections":{capName:`oidc-connections`,capScope:`system`,addonId:null,access:`view`},"oidcConnections.updateConnection":{capName:`oidc-connections`,capScope:`system`,addonId:null,access:`create`},"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.deleteTemplate":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`delete`},"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.listTemplates":{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`},"osdManager.setSlotCameraEnabled":{capName:`osd-manager`,capScope:`system`,addonId:null,access:`create`},"osdManager.upsertTemplate":{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.addRetrainFrameFromRecording":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.addRetrainFramesToCollection":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.applyDeviceSettingsPatch":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.cancelRelocateMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.cancelStorageMigrationMove":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.clearTrackRelation":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.clearTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.completeRetrainTrack":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.countRelocatableMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.countUnstampedEventMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.createRetrainCollection":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.deleteDeviceEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.deleteRetrainCollection":{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.getRetrainCorpusKpi":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getRetrainExportUrl":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getRetrainFrameImage":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getSensorEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getStorageMigrationMoveStatus":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrack":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrackMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrainingExportSummary":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrainingExportUrl":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listArchivedDebugNotes":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listBirthDecisions":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listEventKinds":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listEventKindsBatch":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listEventMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listOpsLog":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRecentTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRelocateMediaJobs":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainAnnotations":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainAssistProfiles":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainCollectionFrames":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainCollections":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainCorpusPage":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainFrames":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listRetrainStaging":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTrackMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTrackRelations":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.offerRetrainArchive":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"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.proposeRetrainAnnotationsWithLlm":{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.removeRetrainFrameFromCollection":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.renameRetrainCollection":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.resolveRetrainTrainingCorpus":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"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.setRetrainFrameComplete":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.setTrackFlags":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.setTrackPurity":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.setTrackRelation":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.startStorageMigrationMove":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.wipeAllAnalytics":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.wipeObjectEmbeddings":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.writeRetrainArchive":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineExecutor.cacheFrameInPool":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.clearDeviceOverrides":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.clearModelBoundDeviceOverrides":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.deleteModel":{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.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.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.validatePipeline":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.abortNodeBenchmark":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.applyAutoTune":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"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.deleteNodeBenchmarkResult":{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.getEffectiveShares":{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.getNodeBenchmarkCandidates":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getNodeBenchmarkPreflight":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getNodeBenchmarkStatus":{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.getPlacementStats":{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.listNodeBenchmarkResults":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.pauseForStorageMigration":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.planAutoTune":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.rebalance":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.reconcileFromDisk":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.removeAgentSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.requestOccupancyLook":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.resetNodePipelineDefaults":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.resolvePipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.resumeForStorageMigration":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentCapabilities":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentDecodeLimits":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentInferenceDevices":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentMaxCameras":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentReachableHost":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraPipelineForAgent":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraSensors":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraStepOverride":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraStepSettings":{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.setLoadBalancingShares":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setPipelineDevicePin":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setShareSource":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.startNodeBenchmark":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.suggestShares":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.unassignAudio":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.unassignPipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.abortNodeBench":{capName:`pipeline-runner`,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.getNodeBenchStatus":{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`},"pipelineRunner.startNodeBench":{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.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.unassignProfile":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.unsubscribeAudioChunks":{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`},"training.canaryResult":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.cancelJob":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.discardResult":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.getJob":{capName:`training`,capScope:`system`,addonId:null,access:`view`},"training.getJobResult":{capName:`training`,capScope:`system`,addonId:null,access:`view`},"training.listBaseModels":{capName:`training`,capScope:`system`,addonId:null,access:`view`},"training.listJobs":{capName:`training`,capScope:`system`,addonId:null,access:`view`},"training.planJob":{capName:`training`,capScope:`system`,addonId:null,access:`view`},"training.registerResult":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.rollbackCanary":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.startJob":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"training.startJobBatch":{capName:`training`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.cancelJob":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.cleanupJob":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.createEntry":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.deleteEntry":{capName:`training-provider`,capScope:`system`,addonId:null,access:`delete`},"trainingProvider.describe":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.describeTypes":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.estimateJob":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.getJob":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.listEntries":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.listJobEvents":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.listJobs":{capName:`training-provider`,capScope:`system`,addonId:null,access:`view`},"trainingProvider.offerArtifact":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.readResult":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.submitJob":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.updateEntry":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.uploadDataset":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"trainingProvider.validateCredentials":{capName:`training-provider`,capScope:`system`,addonId:null,access:`create`},"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.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.findUserByExternalIdentity":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.getTotpStatus":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listApiKeys":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listExternalIdentities":{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.unlinkExternalIdentity":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.updateUser":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"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.applyDownlinkProbe":{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`}}),QX=`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.calendar-source.calendars.camera-credentials.camera-grid-layout.camera-pipeline-config.camera-streams.carbon-monoxide.climate-control.color.composer.connection-test.connectivity.consumables.contact.control.core-blocks.cover.custom-model-registry.data-store-provider.database-snapshot.day-night.decoder.detection-pipeline.device-admin-link.device-adoption.device-discovery.device-export.device-extension.device-manager.device-ops.device-provider.device-state.device-status.doorbell.embedding-encoder.enum-sensor.event-emitter.face-gallery.failure-contribution.fan-control.feature-probe.filesystem-browse.flood.gas.humidifier.humidity-sensor.image.image-settings.integrations.intercom.keychain.keychain-admin.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.oidc-connections.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.training.training-provider.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(`.`),$X=`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(`.`),eZ=`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.calendar-source.calendars.composer.connection-test.core-blocks.custom-model-registry.data-store-provider.database-snapshot.decoder.device-adoption.device-export.device-manager.device-provider.device-state.embedding-encoder.face-gallery.failure-contribution.filesystem-browse.integrations.keychain.keychain-admin.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.oidc-connections.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.training.training-provider.turn-provider.user-management.user-passkeys.vector-store.viewer-ui`.split(`.`),tZ=[{id:`switch.on`,label:`Turn on`,cap:`switch`,method:`setState`,args:{on:!0}},{id:`switch.off`,label:`Turn off`,cap:`switch`,method:`setState`,args:{on:!1}},{id:`lock.lock`,label:`Lock`,cap:`lock-control`,method:`lock`,args:{}},{id:`lock.unlock`,label:`Unlock`,cap:`lock-control`,method:`unlock`,args:{}},{id:`lock.open`,label:`Open latch`,cap:`lock-control`,method:`open`,args:{}},{id:`cover.open`,label:`Open`,cap:`cover`,method:`open`,args:{}},{id:`cover.close`,label:`Close`,cap:`cover`,method:`close`,args:{}},{id:`cover.stop`,label:`Stop`,cap:`cover`,method:`stop`,args:{}},{id:`valve.open`,label:`Open valve`,cap:`valve`,method:`open`,args:{}},{id:`valve.close`,label:`Close valve`,cap:`valve`,method:`close`,args:{}},{id:`valve.stop`,label:`Stop valve`,cap:`valve`,method:`stop`,args:{}},{id:`humidifier.on`,label:`Humidifier on`,cap:`humidifier`,method:`setOn`,args:{on:!0}},{id:`humidifier.off`,label:`Humidifier off`,cap:`humidifier`,method:`setOn`,args:{on:!1}},{id:`waterHeater.off`,label:`Water heater off`,cap:`water-heater`,method:`setOperationMode`,args:{mode:`off`}},{id:`waterHeater.awayOn`,label:`Water heater away on`,cap:`water-heater`,method:`setAway`,args:{on:!0}},{id:`waterHeater.awayOff`,label:`Water heater away off`,cap:`water-heater`,method:`setAway`,args:{on:!1}},{id:`climate.off`,label:`Climate off`,cap:`climate-control`,method:`setMode`,args:{mode:`off`}},{id:`climate.heat`,label:`Heat`,cap:`climate-control`,method:`setMode`,args:{mode:`heat`}},{id:`climate.cool`,label:`Cool`,cap:`climate-control`,method:`setMode`,args:{mode:`cool`}},{id:`climate.auto`,label:`Climate auto`,cap:`climate-control`,method:`setMode`,args:{mode:`auto`}},{id:`fan.off`,label:`Fan off`,cap:`fan-control`,method:`setPercentage`,args:{percentage:0}},{id:`fan.full`,label:`Fan full`,cap:`fan-control`,method:`setPercentage`,args:{percentage:100}},{id:`vacuum.start`,label:`Start cleaning`,cap:`vacuum-control`,method:`start`,args:{}},{id:`vacuum.pause`,label:`Pause`,cap:`vacuum-control`,method:`pause`,args:{}},{id:`vacuum.stop`,label:`Stop`,cap:`vacuum-control`,method:`stop`,args:{}},{id:`vacuum.dock`,label:`Return to base`,cap:`vacuum-control`,method:`returnToBase`,args:{}},{id:`lawnMower.start`,label:`Start mowing`,cap:`lawn-mower-control`,method:`startMowing`,args:{}},{id:`lawnMower.pause`,label:`Pause mower`,cap:`lawn-mower-control`,method:`pause`,args:{}},{id:`lawnMower.dock`,label:`Dock mower`,cap:`lawn-mower-control`,method:`dock`,args:{}},{id:`media.play`,label:`Play`,cap:`media-player`,method:`play`,args:{}},{id:`media.pause`,label:`Pause media`,cap:`media-player`,method:`pause`,args:{}},{id:`media.stop`,label:`Stop media`,cap:`media-player`,method:`stop`,args:{}},{id:`media.next`,label:`Next track`,cap:`media-player`,method:`next`,args:{}},{id:`media.previous`,label:`Previous track`,cap:`media-player`,method:`previous`,args:{}},{id:`script.run`,label:`Run script`,cap:`script-runner`,method:`run`,args:{}},{id:`script.stop`,label:`Stop script`,cap:`script-runner`,method:`stop`,args:{}},{id:`haAutomation.enable`,label:`Enable automation`,cap:`automation-control`,method:`enable`,args:{}},{id:`haAutomation.disable`,label:`Disable automation`,cap:`automation-control`,method:`disable`,args:{}},{id:`haAutomation.trigger`,label:`Trigger automation`,cap:`automation-control`,method:`trigger`,args:{}},{id:`petFeeder.feed`,label:`Feed`,cap:`pet-feeder`,method:`feed`,openArgs:[{key:`grams`,label:`Grams`,kind:`number`}]},{id:`petFeeder.callPet`,label:`Call pet`,cap:`pet-feeder`,method:`callPet`,args:{}},{id:`ptz.goHome`,label:`PTZ go home`,cap:`ptz`,method:`goHome`,args:{}},{id:`ptz.goToPreset`,label:`PTZ go to preset`,cap:`ptz`,method:`goToPreset`,openArgs:[{key:`presetId`,label:`Preset id`,kind:`string`}]},{id:`ptz.autotrackOn`,label:`Autotrack on`,cap:`ptz-autotrack`,method:`setEnabled`,args:{enabled:!0}},{id:`ptz.autotrackOff`,label:`Autotrack off`,cap:`ptz-autotrack`,method:`setEnabled`,args:{enabled:!1}},{id:`privacy.maskOn`,label:`Privacy mask on`,cap:`privacy-mask`,method:`setMask`,args:{patch:{enabled:!0}}},{id:`privacy.maskOff`,label:`Privacy mask off`,cap:`privacy-mask`,method:`setMask`,args:{patch:{enabled:!1}}},{id:`privacy.micOn`,label:`Microphone on`,cap:`privacy-mask`,method:`setAudioEnabled`,args:{enabled:!0}},{id:`privacy.micOff`,label:`Microphone off`,cap:`privacy-mask`,method:`setAudioEnabled`,args:{enabled:!1}},{id:`dayNight.auto`,label:`Day/night auto`,cap:`day-night`,method:`setSettings`,args:{settings:{mode:`auto`}}},{id:`dayNight.day`,label:`Day mode`,cap:`day-night`,method:`setSettings`,args:{settings:{mode:`day`}}},{id:`dayNight.night`,label:`Night mode`,cap:`day-night`,method:`setSettings`,args:{settings:{mode:`night`}}},{id:`reboot.reboot`,label:`Reboot device`,cap:`reboot`,method:`reboot`,args:{}},{id:`brightness.full`,label:`Brightness full`,cap:`brightness`,method:`setBrightness`,args:{percentage:100}},{id:`brightness.half`,label:`Brightness half`,cap:`brightness`,method:`setBrightness`,args:{percentage:50}},{id:`brightness.off`,label:`Brightness off`,cap:`brightness`,method:`setBrightness`,args:{percentage:0}},{id:`motionTrigger.on`,label:`Motion trigger on`,cap:`motion-trigger`,method:`setMotionTrigger`,args:{enabled:!0}},{id:`motionTrigger.off`,label:`Motion trigger off`,cap:`motion-trigger`,method:`setMotionTrigger`,args:{enabled:!1}},{id:`alarm.trigger`,label:`Trigger alarm`,cap:`alarm-panel`,method:`trigger`,args:{}},{id:`alarm.disarm`,label:`Disarm`,cap:`alarm-panel`,method:`disarm`,args:{}},{id:`alarm.arm.home`,label:`Arm home`,cap:`alarm-panel`,method:`arm`,args:{mode:`home`}},{id:`alarm.arm.away`,label:`Arm away`,cap:`alarm-panel`,method:`arm`,args:{mode:`away`}},{id:`alarm.arm.night`,label:`Arm night`,cap:`alarm-panel`,method:`arm`,args:{mode:`night`}},{id:`alarm.arm.vacation`,label:`Arm vacation`,cap:`alarm-panel`,method:`arm`,args:{mode:`vacation`}},{id:`alarm.arm.custom_bypass`,label:`Arm custom bypass`,cap:`alarm-panel`,method:`arm`,args:{mode:`custom_bypass`}},{id:`button.press`,label:`Press`,cap:`button`,method:`press`,args:{}}];function nZ(e){for(let[t,n]of Object.entries(ZX))if(n.capName===e.cap&&n.capScope===`device`&&n.access!==`view`&&t.slice(t.indexOf(`.`)+1)===e.method)return!0;return!1}function rZ(e,t){if(e===t)return!0;if(e===null||t===null)return e===t;if(typeof e!=`object`||typeof t!=`object`)return!1;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!rZ(e[n],t[n]))return!1;return!0}let n=e,r=t,i=Object.keys(n),a=Object.keys(r);if(i.length!==a.length)return!1;for(let e of i)if(!rZ(n[e],r[e]))return!1;return!0}function iZ(e,t){return rZ(e??{},t??{})}function aZ(e,t){if(e.openArgs!==void 0){let n=new Set(e.openArgs.map(e=>e.key)),r=e.args??{},i=t??{};for(let e of Object.keys(r))if(!rZ(r[e],i[e]))return!1;for(let e of Object.keys(i))if(!n.has(e)&&!(e in r))return!1;return!0}return iZ(e.args,t)}var oZ={[k.Camera]:[`ptz`,`ptz-autotrack`,`privacy-mask`,`day-night`,`reboot`,`motion-trigger`],[k.Hub]:[],[k.Light]:[`switch`,`brightness`],[k.Siren]:[`switch`,`motion-trigger`],[k.Switch]:[`switch`,`motion-trigger`],[k.Sensor]:[],[k.Thermostat]:[`climate-control`],[k.Climate]:[`climate-control`],[k.Button]:[`button`],[k.EventEmitter]:[],[k.Update]:[],[k.Generic]:[],[k.Notifier]:[],[k.Script]:[`script-runner`],[k.Automation]:[`automation-control`],[k.Lock]:[`lock-control`],[k.Cover]:[`cover`],[k.Valve]:[`valve`],[k.Humidifier]:[`humidifier`],[k.WaterHeater]:[`water-heater`],[k.Fan]:[`fan-control`,`switch`],[k.MediaPlayer]:[`media-player`],[k.AlarmPanel]:[`alarm-panel`],[k.Control]:[],[k.Presence]:[],[k.Weather]:[],[k.Vacuum]:[`vacuum-control`],[k.LawnMower]:[`lawn-mower-control`],[k.Container]:[],[k.Image]:[],[k.PetFeeder]:[`pet-feeder`]};function sZ(e){return e!==k.Container}function cZ(e){switch(e){case k.Climate:case k.Thermostat:case k.Humidifier:case k.WaterHeater:return`climate-family`;case k.Cover:case k.Valve:return`cover-family`;case k.Switch:case k.Siren:case k.Light:return`switch-family`;case k.Vacuum:case k.LawnMower:return`robot-family`;default:return e}}function lZ(e,t){return cZ(e)===cZ(t)}function uZ(e){if(e.length===0)return[];let t=new Set(e);return tZ.filter(e=>t.has(e.cap)&&nZ(e))}function dZ(e){return Object.values(k).includes(e)?uZ(oZ[e]):[]}function fZ(e){let t=e.boundCaps!==void 0&&e.boundCaps.length>0?uZ(e.boundCaps):[];return t.length>0?t:e.deviceType!==void 0&&e.deviceType.length>0?dZ(e.deviceType):[]}function pZ(e){if(e.length===0)return[];let t=null;for(let n of e){let e=fZ({boundCaps:n.boundCaps,deviceType:n.deviceType});if(t===null){t=e;continue}let r=new Set(e.map(e=>e.id));t=t.filter(e=>r.has(e.id))}return t??[]}function mZ(){return tZ.filter(nZ)}function hZ(e,t,n){for(let r of tZ)if(!(r.cap!==e||r.method!==t)&&aZ(r,n))return r;return null}function gZ(e,t,n){let r=hZ(e,t,n);return r===null?`custom:${e}.${t}`:r.id}function _Z(e,t){return!e||e.length===0?!1:e.includes(t.when.hasFeature)}var vZ={id:`battery`,label:`Battery-operated camera`,when:{hasFeature:ji.BatteryOperated},defaults:{audioMode:`disabled`,detectionMode:`on-motion`},settings:{}},yZ=[vZ];function bZ(e){for(let t of yZ)if(_Z(e,t))return t;return null}var xZ=[`device`,`lighting`,`sensing`,`place`,`life`],SZ=[{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`]}],CZ=SZ.map(e=>e.key),wZ=SZ.filter(e=>e.aliasOf===void 0).map(e=>e.key),TZ=new Map(SZ.map(e=>[e.key,e]));function EZ(e){return typeof e==`string`&&TZ.has(e)}function DZ(e,t){return typeof e==`string`&&EZ(e)?e:t}function OZ(e){return TZ.get(e)}function kZ(e){return SZ.filter(t=>t.group===e)}function AZ(e){return e.normalize(`NFD`).replace(/\p{Diacritic}/gu,``).toLowerCase().replace(/[_-]+/g,` `).trim()}function jZ(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 MZ(e,t){return t===e?100:t.startsWith(e)?80:t.split(` `).some(t=>t.startsWith(e))?60:t.includes(e)?40:jZ(e,t)?15:0}function NZ(e,t){let n=AZ(e);if(n.length===0)return SZ.filter(e=>e.aliasOf===void 0).map(e=>({entry:e,score:0}));let r=[];for(let e of SZ){if(e.aliasOf!==void 0)continue;let i=[AZ(e.key),...e.synonyms.map(AZ),...(t?.get(e.key)??[]).map(AZ)],a=0;for(let[e,t]of i.entries()){let r=MZ(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 PZ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function FZ(e,t){let n=t.split(`.`),r=e;for(let e of n){if(!PZ(r))return;r=r[e]}return r}function IZ(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=PZ(o)?o:{};return{...e,[i]:IZ(s,a,n)}}var LZ=3e4,RZ=3,zZ=1e4;async function BZ(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 VZ(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 BZ(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 HZ=`lastFetchedAt`,UZ=6e4,WZ=10*6e4;function GZ(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)?.[HZ];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)},h=e=>{let t=d;if(t!==null)return t;let n=m(e).catch(()=>void 0).finally(()=>{d=null});return d=n,n},g=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){h(r);return}await h(r);return}await m(r)}},_=()=>{let e=t.getCapState(n.name);if(!e)return o();let{[HZ]:r,...i}=e;return i};return{ensureFresh:g,getStatus:async({deviceId:e})=>{if(e!==r)throw Error(`${n.name}: deviceId mismatch, expected ${r}, got ${e}`);return await g(),_()}}}var KZ=`device.state-changed`,qZ=`capability.binding-changed`,JZ=`device.registered`,YZ=`device.unregistered`,XZ=`device.updated`,ZZ=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=di(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?pi(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&&!QZ(n,e.id)||e.stableId!==void 0&&(!i||!QZ(i.stableId,e.stableId))||e.addonId!==void 0&&(!i||!QZ(i.addonId,e.addonId))||e.type!==void 0&&(!i||!QZ(i.type,e.type)))continue;if(e.caps!==void 0){let t=$Z(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=$Z(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||!eQ(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||!$Z(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:KZ},{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:qZ},{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:JZ},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.refreshDeviceMetadata(t.deviceId,`added`)}})),this.bridges.push(e.subscribe({category:YZ},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.applyDeviceRemoval(t.deviceId)}})),this.bridges.push(e.subscribe({category:XZ},{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 QZ(e,t){return Array.isArray(t)?t.includes(e):e===t}function $Z(e){return Array.isArray(e)?e:[e]}function eQ(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 tQ(e){return e.def}function nQ(e){return e}function rQ(e,t=`Configuration`,n=`main`){return{sections:[{id:n,title:t,fields:e.map(e=>iQ(e.key,e.schema,e.description))}]}}function iQ(e,t,n){let r=lQ(t),i=uQ(t),a={key:e,label:n??dQ(e),description:n,default:i};if(r instanceof te&&oi(t))return{...a,type:`password`,showToggle:!0};if(r instanceof te)return aQ(e,a);if(r instanceof ee)return oQ(r,a);if(r instanceof ie)return{...a,type:`boolean`};if(r instanceof ce)return cQ(r,a);if(r instanceof le||r instanceof oe){let e=oi(t)||si(t).length>0;return{...a,type:`textarea`,rows:6,isJson:!0,...e?{secret:!0}:{}}}return{...a,type:`text`}}function aQ(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 oQ(e,t){let n=nQ(e),r=n.minValue,i=n.maxValue,a=r!=null&&isFinite(r)?r:void 0,o=i!=null&&isFinite(i)?i:void 0,s=sQ(e);return{...t,type:`number`,...a===void 0?{}:{min:a},...o===void 0?{}:{max:o},...s===void 0?{}:{step:s}}}function sQ(e){let t=tQ(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 cQ(e,t){let n=e.options.map(e=>String(e));return{...t,type:`select`,options:n.map(e=>({label:dQ(e),value:e}))}}function lQ(e){return e instanceof g||e instanceof fe||e instanceof ue?lQ(tQ(e).innerType):e}function uQ(e){if(e instanceof g)return tQ(e).defaultValue}function dQ(e){return e.replace(/([A-Z])/g,` $1`).replace(/[_-]/g,` `).replace(/^\w/,e=>e.toUpperCase()).trim()}var fQ=`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(`.`),pQ={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`,calendarSource:`calendar-source`,calendars:`calendars`,cameraCredentials:`camera-credentials`,cameraGridLayout:`camera-grid-layout`,cameraPipelineConfig:`camera-pipeline-config`,cameraStreams:`camera-streams`,carbonMonoxide:`carbon-monoxide`,climateControl:`climate-control`,color:`color`,composer:`composer`,connectionTest:`connection-test`,connectivity:`connectivity`,consumables:`consumables`,contact:`contact`,control:`control`,coreBlocks:`core-blocks`,cover:`cover`,customModelRegistry:`custom-model-registry`,dataStoreProvider:`data-store-provider`,databaseSnapshot:`database-snapshot`,dayNight:`day-night`,decoder:`decoder`,detectionPipeline:`detection-pipeline`,deviceAdminLink:`device-admin-link`,deviceAdoption:`device-adoption`,deviceDiscovery:`device-discovery`,deviceExport:`device-export`,deviceExtension:`device-extension`,deviceManager:`device-manager`,deviceOps:`device-ops`,deviceProvider:`device-provider`,deviceState:`device-state`,deviceStatus:`device-status`,doorbell:`doorbell`,embeddingEncoder:`embedding-encoder`,enumSensor:`enum-sensor`,eventEmitter:`event-emitter`,faceGallery:`face-gallery`,failureContribution:`failure-contribution`,fanControl:`fan-control`,featureProbe:`feature-probe`,filesystemBrowse:`filesystem-browse`,flood:`flood`,gas:`gas`,humidifier:`humidifier`,humiditySensor:`humidity-sensor`,image:`image`,imageSettings:`image-settings`,integrations:`integrations`,intercom:`intercom`,keychain:`keychain`,keychainAdmin:`keychain-admin`,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`,oidcConnections:`oidc-connections`,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`,training:`training`,trainingProvider:`training-provider`,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`},mQ=[{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:`calendarSource`,name:`calendar-source`},{key:`calendars`,name:`calendars`},{key:`cameraCredentials`,name:`camera-credentials`},{key:`cameraGridLayout`,name:`camera-grid-layout`},{key:`cameraPipelineConfig`,name:`camera-pipeline-config`},{key:`cameraStreams`,name:`camera-streams`},{key:`carbonMonoxide`,name:`carbon-monoxide`},{key:`climateControl`,name:`climate-control`},{key:`color`,name:`color`},{key:`composer`,name:`composer`},{key:`connectionTest`,name:`connection-test`},{key:`connectivity`,name:`connectivity`},{key:`consumables`,name:`consumables`},{key:`contact`,name:`contact`},{key:`control`,name:`control`},{key:`coreBlocks`,name:`core-blocks`},{key:`cover`,name:`cover`},{key:`customModelRegistry`,name:`custom-model-registry`},{key:`dataStoreProvider`,name:`data-store-provider`},{key:`databaseSnapshot`,name:`database-snapshot`},{key:`dayNight`,name:`day-night`},{key:`decoder`,name:`decoder`},{key:`detectionPipeline`,name:`detection-pipeline`},{key:`deviceAdminLink`,name:`device-admin-link`},{key:`deviceAdoption`,name:`device-adoption`},{key:`deviceDiscovery`,name:`device-discovery`},{key:`deviceExport`,name:`device-export`},{key:`deviceExtension`,name:`device-extension`},{key:`deviceManager`,name:`device-manager`},{key:`deviceOps`,name:`device-ops`},{key:`deviceProvider`,name:`device-provider`},{key:`deviceState`,name:`device-state`},{key:`deviceStatus`,name:`device-status`},{key:`doorbell`,name:`doorbell`},{key:`embeddingEncoder`,name:`embedding-encoder`},{key:`enumSensor`,name:`enum-sensor`},{key:`eventEmitter`,name:`event-emitter`},{key:`faceGallery`,name:`face-gallery`},{key:`failureContribution`,name:`failure-contribution`},{key:`fanControl`,name:`fan-control`},{key:`featureProbe`,name:`feature-probe`},{key:`filesystemBrowse`,name:`filesystem-browse`},{key:`flood`,name:`flood`},{key:`gas`,name:`gas`},{key:`humidifier`,name:`humidifier`},{key:`humiditySensor`,name:`humidity-sensor`},{key:`image`,name:`image`},{key:`imageSettings`,name:`image-settings`},{key:`integrations`,name:`integrations`},{key:`intercom`,name:`intercom`},{key:`keychain`,name:`keychain`},{key:`keychainAdmin`,name:`keychain-admin`},{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:`oidcConnections`,name:`oidc-connections`},{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:`training`,name:`training`},{key:`trainingProvider`,name:`training-provider`},{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`}],hQ=[dR,Nm,Fm,zm,Gm,Qm,Xm,JR,Rr,XR,lE,rh,QR,ih,Sh,Ah,rz,Mh,az,eg,sz,lz,dz,xg,fz,_z,Cz,Ez,Mz,Sg,Yg,Pz,Lz,Hz,G_,qz,Yz,eB,nB,oB,Ay,lB,Fy,Ky,Bh,hB,hb,gb,yb,Yb,Ib,ix,pS,Gx,Xr,xx,vS,_B,bB,IS,CB,EB,LB,zS,BB,HB,HS,WB,KB,JB,XB,QB,sV,gV,bV,eb,fb,wV,pw,ew,_w,WV,qV,yw,Sw,Ow,QV,nH,Jw,Xw,$w,oH,nT,lH,mH,mT,SH,IH,vT,HH,KH,uU,FT,JO,_U,yU,ok,uk,TU,RU,WU,uM,UM,HF,tF,XU,fW,mW,_W,yW,TW,FW,BW,VW,$W,bG,HG,tK,wK,JK,$K,cI,Wy,tq,pI,gI,vI,bI,CI,wI,EI,RI,Wg,iq,dq,VI,_q,Jq,Xq,Qq,XI,eJ,pY,eY,QI,nJ,hJ,eL,yJ,SJ,TL,wJ,QL,Kr,EJ,OJ,lR,LJ,zJ,vP],gQ=Object.freeze({"accessories.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"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}],"airQualitySensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"alarmPanel.arm":[{name:`deviceId`,form:`single`,optional:!1}],"alarmPanel.disarm":[{name:`deviceId`,form:`single`,optional:!1}],"alarmPanel.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"alarmPanel.trigger":[{name:`deviceId`,form:`single`,optional:!1}],"ambientLightSensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"audioAnalysis.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"audioAnalysis.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"audioAnalysis.getDeviceSettingsContribution":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"automationControl.trigger":[{name:`deviceId`,form:`single`,optional:!1}],"battery.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"battery.wakeForStream":[{name:`deviceId`,form:`single`,optional:!1}],"binary.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"brightness.getStatus":[{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}],"cameraCredentials.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"cameraGridLayout.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"cameraGridLayout.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"cameraGridLayout.getDeviceSettingsContribution":[{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}],"cameraPipelineConfig.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"cameraPipelineConfig.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"cameraPipelineConfig.getDeviceSettingsContribution":[{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}],"carbonMonoxide.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"climateControl.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"color.setColor":[{name:`deviceId`,form:`single`,optional:!1}],"connectivity.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"consumables.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"consumables.reset":[{name:`deviceId`,form:`single`,optional:!1}],"contact.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"control.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"control.setValue":[{name:`deviceId`,form:`single`,optional:!1}],"cover.close":[{name:`deviceId`,form:`single`,optional:!1}],"cover.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"dayNight.setSettings":[{name:`deviceId`,form:`single`,optional:!1}],"detectionPipeline.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"detectionPipeline.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"detectionPipeline.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"deviceAdminLink.getAdminLink":[{name:`deviceId`,form:`single`,optional:!1}],"deviceAdoption.getStatus":[{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.getStatus":[{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}],"deviceExport.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExport.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExport.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.listCandidates":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.listSlots":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.listSources":[{name:`deviceId`,form:`single`,optional:!1}],"deviceExtension.setSlot":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.adoptionRelease":[{name:`camDeviceId`,form:`single`,optional:!1}],"deviceManager.adoptionResync":[{name:`camDeviceId`,form:`single`,optional:!1}],"deviceManager.applyInitialMeta":[{name:`deviceId`,form:`single`,optional:!1},{name:`linkDeviceId`,form:`single`,optional:!0}],"deviceManager.disable":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.enable":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getBindings":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getBindingsBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"deviceManager.getChildren":[{name:`parentDeviceId`,form:`single`,optional:!1}],"deviceManager.getChildrenBatch":[{name:`parentDeviceIds`,form:`array`,optional:!1}],"deviceManager.getConfigSchema":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDevice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceLiveInfoAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceSettingsAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceStatusAggregate":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getDeviceStatusAggregateBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"deviceManager.getLinkedDevices":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getLinkedDevicesBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"deviceManager.getSettingsSchema":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getStreamProfileMap":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getStreamSources":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getWireableFields":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.getWrapperActivation":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.listAll":[{name:`deviceIds`,form:`array`,optional:!0}],"deviceManager.loadConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.loadMeta":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.loadRuntimeState":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.persistConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.probeStreams":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.registerDevice":[{name:`parentDeviceId`,form:`single`,optional:!0}],"deviceManager.remove":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.removeDevice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.runDeviceAction":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setChildLayout":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setDisabled":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setDisplay":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setIntegrationId":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setLinkDeviceId":[{name:`deviceId`,form:`single`,optional:!1},{name:`linkDeviceId`,form:`single`,optional:!0}],"deviceManager.setLocation":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setMetadata":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setName":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setPrimaryChildEntityId":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setRole":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setStreamProfileMap":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setType":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.setWrapperActive":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.testField":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.updateConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.updateDeviceField":[{name:`deviceId`,form:`single`,optional:!1}],"deviceManager.updateDeviceFieldsBatch":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getConfigEntries":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getRawState":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getSettingsSchema":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.getStreamSources":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.removeDevice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.runAction":[{name:`deviceId`,form:`single`,optional:!1}],"deviceOps.setConfig":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.claimFields":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.getCapSlice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.getNativeCapSlice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.getSnapshot":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.patchOwnedFields":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.releaseClaim":[{name:`deviceId`,form:`single`,optional:!1}],"deviceState.setCapSlice":[{name:`deviceId`,form:`single`,optional:!1}],"deviceStatus.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"doorbell.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"enumSensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"eventEmitter.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"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}],"featureProbe.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"flood.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"gas.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"humidifier.getStatus":[{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}],"humiditySensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"image.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"imageSettings.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"imageSettings.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"imageSettings.setSettings":[{name:`deviceId`,form:`single`,optional:!1}],"intercom.endTalkSession":[{name:`deviceId`,form:`single`,optional:!1}],"intercom.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"lawnMowerControl.pause":[{name:`deviceId`,form:`single`,optional:!1}],"lawnMowerControl.startMowing":[{name:`deviceId`,form:`single`,optional:!1}],"lockControl.getStatus":[{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.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"motion.isDetected":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.analyze":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"motionDetection.removeCamera":[{name:`deviceId`,form:`single`,optional:!1}],"motionTrigger.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"motionTrigger.setMotionTrigger":[{name:`deviceId`,form:`single`,optional:!1}],"motionZones.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"motionZones.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"motionZones.setZone":[{name:`deviceId`,form:`single`,optional:!1}],"nativeObjectDetection.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"nativeObjectDetection.getStatus":[{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.getStatus":[{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}],"networkLink.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"networkQuality.getDeviceStats":[{name:`deviceId`,form:`single`,optional:!1}],"networkQuality.reportClientStats":[{name:`deviceId`,form:`single`,optional:!1}],"notificationRules.getAlarmSensors":[{name:`deviceIds`,form:`array`,optional:!1}],"notificationRules.setDeviceMuted":[{name:`deviceId`,form:`single`,optional:!1}],"notifier.cancel":[{name:`deviceId`,form:`single`,optional:!1}],"notifier.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"notifier.send":[{name:`deviceId`,form:`single`,optional:!1}],"numericSensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"osd.getStatus":[{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}],"osdManager.setSlotCameraEnabled":[{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.getStatus":[{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.addRetrainFrameFromRecording":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.clearTrackRelation":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.clearTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.completeRetrainTrack":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.deleteDeviceEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.deleteTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.deselectRetrainFrame":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getActiveTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getAudioEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getEventDensity":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getEventDensityBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.getEventMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getEventMediaFootprintByKind":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.getKeyEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getKeyEventsBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.getMotionEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getObjectEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getRetrainExportUrl":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.getSensorEvents":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getTrack":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getTrackMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.getTrainingExportSummary":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.getTrainingExportUrl":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.listArchivedDebugNotes":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.listBirthDecisions":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.listEventKinds":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listEventKindsBatch":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.listEventMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listOpsLog":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineAnalytics.listRecentTracks":[{name:`deviceIds`,form:`array`,optional:!1}],"pipelineAnalytics.listRetrainCorpusPage":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.listRetrainStaging":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineAnalytics.listTrackMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listTrackRelations":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.listTracks":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.ownersWithMedia":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.proposeRetrainAnnotations":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.proposeRetrainAnnotationsWithLlm":[{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.setRetrainFrameComplete":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.setTrackFlags":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.setTrackPurity":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.setTrackRelation":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineAnalytics.wipeAllAnalytics":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineExecutor.clearModelBoundDeviceOverrides":[{name:`deviceIds`,form:`array`,optional:!0}],"pipelineExecutor.runPipeline":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineExecutor.runPipelineBatch":[{name:`deviceId`,form:`single`,optional:!0}],"pipelineOrchestrator.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"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.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getPipelineAssignment":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.getPipelineDevicePin":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.requestOccupancyLook":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.resolvePipeline":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraPipelineForAgent":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraSensors":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraStepOverride":[{name:`deviceId`,form:`single`,optional:!1}],"pipelineOrchestrator.setCameraStepSettings":[{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}],"powerMeter.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"presence.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"pressureSensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"privacyMask.getOptions":[{name:`deviceId`,form:`single`,optional:!1}],"privacyMask.getStatus":[{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.getStatus":[{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.applyDeviceSettingsPatch":[{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.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.getDeviceSettingsContribution":[{name:`deviceId`,form:`single`,optional:!1}],"recordingArchive.getStatus":[{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.getStatus":[{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.getStatus":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"scriptRunner.run":[{name:`deviceId`,form:`single`,optional:!1}],"scriptRunner.stop":[{name:`deviceId`,form:`single`,optional:!1}],"smoke.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.applyDeviceSettingsPatch":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.getDebugState":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.getDeviceSettingsContribution":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"snapshot.invalidateCache":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.acquireEgressTranscode":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.applyDeviceSettingsPatch":[{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.getDeviceLiveContribution":[{name:`deviceId`,form:`single`,optional:!1}],"streamBroker.getDeviceSettingsContribution":[{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.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"streamParams.setProfile":[{name:`deviceId`,form:`single`,optional:!1}],"switch.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"switch.setState":[{name:`deviceId`,form:`single`,optional:!1}],"tamper.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"temperatureSensor.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"training.canaryResult":[{name:`deviceIds`,form:`array`,optional:!1}],"update.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"vacuumControl.getStatus":[{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.getStatus":[{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}],"vibration.getStatus":[{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.getStatus":[{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}],"weather.getStatus":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.addIceCandidate":[{name:`deviceId`,form:`single`,optional:!1}],"webrtcSession.applyDownlinkProbe":[{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}]}),_Q=`addonSettings.getDeviceSettings,addonSettings.updateDeviceSettings,audioAnalyzer.attachDevice,audioAnalyzer.classify,audioAnalyzer.detachDevice,deviceAdoption.getStatus,deviceAdoption.release,deviceAdoption.resync,deviceExport.applyDeviceSettingsPatch,deviceExport.getDeviceLiveContribution,deviceExport.getDeviceSettingsContribution,deviceManager.adoptionRelease,deviceManager.adoptionResync,deviceManager.applyInitialMeta,deviceManager.disable,deviceManager.enable,deviceManager.getBindings,deviceManager.getBindingsBatch,deviceManager.getChildren,deviceManager.getChildrenBatch,deviceManager.getConfigSchema,deviceManager.getDevice,deviceManager.getDeviceAggregate,deviceManager.getDeviceLiveInfoAggregate,deviceManager.getDeviceSettingsAggregate,deviceManager.getDeviceStatusAggregate,deviceManager.getDeviceStatusAggregateBatch,deviceManager.getLinkedDevices,deviceManager.getLinkedDevicesBatch,deviceManager.getSettingsSchema,deviceManager.getStreamProfileMap,deviceManager.getStreamSources,deviceManager.getWireableFields,deviceManager.getWrapperActivation,deviceManager.listAll,deviceManager.loadConfig,deviceManager.loadMeta,deviceManager.loadRuntimeState,deviceManager.persistConfig,deviceManager.probeStreams,deviceManager.registerDevice,deviceManager.remove,deviceManager.removeDevice,deviceManager.runDeviceAction,deviceManager.setChildLayout,deviceManager.setDisabled,deviceManager.setDisplay,deviceManager.setIntegrationId,deviceManager.setLinkDeviceId,deviceManager.setLocation,deviceManager.setMetadata,deviceManager.setName,deviceManager.setPrimaryChildEntityId,deviceManager.setRole,deviceManager.setStreamProfileMap,deviceManager.setType,deviceManager.setWrapperActive,deviceManager.testField,deviceManager.updateConfig,deviceManager.updateDeviceField,deviceManager.updateDeviceFieldsBatch,deviceState.claimFields,deviceState.getCapSlice,deviceState.getNativeCapSlice,deviceState.getSnapshot,deviceState.patchOwnedFields,deviceState.releaseClaim,deviceState.setCapSlice,faceGallery.getFaceByTrack,faceGallery.listRecentFaces,networkQuality.getDeviceStats,networkQuality.reportClientStats,notificationRules.getAlarmSensors,notificationRules.setDeviceMuted,osdManager.clearSlotBinding,osdManager.copyDeviceConfiguration,osdManager.getDeviceOsd,osdManager.getSourceCatalog,osdManager.previewSlot,osdManager.renderDevice,osdManager.setSlotBinding,osdManager.setSlotCameraEnabled,pipelineExecutor.clearModelBoundDeviceOverrides,pipelineExecutor.runPipeline,pipelineExecutor.runPipelineBatch,pipelineOrchestrator.applyDeviceSettingsPatch,pipelineOrchestrator.assignAudio,pipelineOrchestrator.assignPipeline,pipelineOrchestrator.getAudioAssignment,pipelineOrchestrator.getCameraMetrics,pipelineOrchestrator.getCameraSettings,pipelineOrchestrator.getCameraStatus,pipelineOrchestrator.getCameraStatuses,pipelineOrchestrator.getCameraStepOverrides,pipelineOrchestrator.getCameraSwitches,pipelineOrchestrator.getDeviceLiveContribution,pipelineOrchestrator.getDeviceSettingsContribution,pipelineOrchestrator.getPipelineAssignment,pipelineOrchestrator.getPipelineDevicePin,pipelineOrchestrator.requestOccupancyLook,pipelineOrchestrator.resolvePipeline,pipelineOrchestrator.setCameraPipelineForAgent,pipelineOrchestrator.setCameraSensors,pipelineOrchestrator.setCameraStepOverride,pipelineOrchestrator.setCameraStepSettings,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.applyDeviceSettingsPatch,recordingArchive.deleteFootprint,recordingArchive.getAvailabilityBatch,recordingArchive.getDaysWithRecordingsBatch,recordingArchive.getDeviceConfig,recordingArchive.getDeviceLiveContribution,recordingArchive.getDeviceSettingsContribution,recordingArchive.getStatus,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.applyDeviceSettingsPatch,streamBroker.assignProfile,streamBroker.forgetDeviceHardware,streamBroker.getDeviceAudioMute,streamBroker.getDeviceLiveContribution,streamBroker.getDeviceSettingsContribution,streamBroker.getStreamWithCodec,streamBroker.produceEventMedia,streamBroker.publishCameraStream,streamBroker.renderPreBufferClip,streamBroker.reportStreamSignal,streamBroker.restartProfile,streamBroker.retractCameraStream,streamBroker.setDeviceAudioMute,streamBroker.unassignProfile,training.canaryResult`.split(`,`),vQ=Object.freeze({broker:`broker`,"calendar-source":`calendar`,"device-export":`device-export`,llm:`ai`,"mesh-network":`mesh`,"mqtt-broker":`broker`,"network-access":`ingress`,"smtp-provider":`email`}),yQ=[`broker`,`calendar-source`,`device-export`,`llm`,`mesh-network`,`mqtt-broker`,`network-access`,`smtp-provider`];function bQ(e){let t=[];for(let[n,r]of Object.entries(vQ))r===e&&t.push(n);return t}var xQ={"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 SQ(e){return xQ[e]??CQ}var CQ={durability:`session`,volatileFields:[]};function wQ(e){return SQ(e).durability===`restored`}var TQ=`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(`.`),EQ=[{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 DQ(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),listInstallations:e=>n(`addons`,`listInstallations`,`query`,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),getEncryption:e=>n(`backup`,`getEncryption`,`query`,e),setupEncryption:e=>n(`backup`,`setupEncryption`,`mutation`,e),disableEncryption:e=>n(`backup`,`disableEncryption`,`mutation`,e),checkBackupKey:e=>n(`backup`,`checkBackupKey`,`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)},calendars:{listCalendars:e=>n(`calendars`,`listCalendars`,`query`,e),listEvents:e=>n(`calendars`,`listEvents`,`query`,e),getPreferences:e=>n(`calendars`,`getPreferences`,`query`,e),setCalendarPreference:e=>n(`calendars`,`setCalendarPreference`,`mutation`,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),getBlockSettings:e=>n(`coreBlocks`,`getBlockSettings`,`query`,e),updateBlockSettings:e=>n(`coreBlocks`,`updateBlockSettings`,`mutation`,e),getTypeDefs:e=>n(`coreBlocks`,`getTypeDefs`,`query`,e),createComposition:e=>n(`coreBlocks`,`createComposition`,`mutation`,e),updateComposition:e=>n(`coreBlocks`,`updateComposition`,`mutation`,e),getComposition:e=>n(`coreBlocks`,`getComposition`,`query`,e),listCompositions:e=>n(`coreBlocks`,`listCompositions`,`query`,e),getCustomization:e=>n(`coreBlocks`,`getCustomization`,`query`,e),listComposableCaps:e=>n(`coreBlocks`,`listComposableCaps`,`query`,e),validateComposition:e=>n(`coreBlocks`,`validateComposition`,`mutation`,e)},decoder:{getInfo:e=>n(`decoder`,`getInfo`,`query`,e),reprobeHwaccel:e=>n(`decoder`,`reprobeHwaccel`,`mutation`,e)},deviceAdoption:{listCandidateFilters:e=>n(`deviceAdoption`,`listCandidateFilters`,`query`,e),listCandidates:e=>n(`deviceAdoption`,`listCandidates`,`query`,e),getCandidate:e=>n(`deviceAdoption`,`getCandidate`,`query`,e),refresh:e=>n(`deviceAdoption`,`refresh`,`mutation`,e),adopt:e=>n(`deviceAdoption`,`adopt`,`mutation`,e),release:e=>n(`deviceAdoption`,`release`,`mutation`,e),resync:e=>n(`deviceAdoption`,`resync`,`mutation`,e)},deviceExport:{getStatus:e=>n(`deviceExport`,`getStatus`,`query`,e),listSupportedDeviceKinds:e=>n(`deviceExport`,`listSupportedDeviceKinds`,`query`,e),listExposedDevices:e=>n(`deviceExport`,`listExposedDevices`,`query`,e),exposeDevice:e=>n(`deviceExport`,`exposeDevice`,`mutation`,e),unexposeDevice:e=>n(`deviceExport`,`unexposeDevice`,`mutation`,e)},deviceManager:{allocateDeviceId:e=>n(`deviceManager`,`allocateDeviceId`,`mutation`,e),migrateDevice:e=>n(`deviceManager`,`migrateDevice`,`mutation`,e),registerDevice:e=>n(`deviceManager`,`registerDevice`,`mutation`,e),removeDevice:e=>n(`deviceManager`,`removeDevice`,`mutation`,e),persistConfig:e=>n(`deviceManager`,`persistConfig`,`mutation`,e),getRoleDisplayDefaults:e=>n(`deviceManager`,`getRoleDisplayDefaults`,`query`,e),setRoleDisplayDefaults:e=>n(`deviceManager`,`setRoleDisplayDefaults`,`mutation`,e),listLocations:e=>n(`deviceManager`,`listLocations`,`query`,e),addLocation:e=>n(`deviceManager`,`addLocation`,`mutation`,e),removeLocation:e=>n(`deviceManager`,`removeLocation`,`mutation`,e),renameLocation:e=>n(`deviceManager`,`renameLocation`,`mutation`,e),listLocationIcons:e=>n(`deviceManager`,`listLocationIcons`,`query`,e),setLocationIcon:e=>n(`deviceManager`,`setLocationIcon`,`mutation`,e),listLocationDescriptions:e=>n(`deviceManager`,`listLocationDescriptions`,`query`,e),setLocationDescription:e=>n(`deviceManager`,`setLocationDescription`,`mutation`,e),listSiteZones:e=>n(`deviceManager`,`listSiteZones`,`query`,e),setSiteZone:e=>n(`deviceManager`,`setSiteZone`,`mutation`,e),removeSiteZone:e=>n(`deviceManager`,`removeSiteZone`,`mutation`,e),renameSiteZone:e=>n(`deviceManager`,`renameSiteZone`,`mutation`,e),setLocationZone:e=>n(`deviceManager`,`setLocationZone`,`mutation`,e),listPersistedByAddon:e=>n(`deviceManager`,`listPersistedByAddon`,`query`,e),listAll:e=>n(`deviceManager`,`listAll`,`query`,e),getChildren:e=>n(`deviceManager`,`getChildren`,`query`,e),getChildrenBatch:e=>n(`deviceManager`,`getChildrenBatch`,`query`,e),getLinkedDevicesBatch:e=>n(`deviceManager`,`getLinkedDevicesBatch`,`query`,e),removeByIntegration:e=>n(`deviceManager`,`removeByIntegration`,`mutation`,e),getBindingsBatch:e=>n(`deviceManager`,`getBindingsBatch`,`query`,e),getAllBindings:e=>n(`deviceManager`,`getAllBindings`,`query`,e),listDeviceIdsByCaps:e=>n(`deviceManager`,`listDeviceIdsByCaps`,`query`,e),listWrappersForCap:e=>n(`deviceManager`,`listWrappersForCap`,`query`,e),listBindableCapsForDeviceType:e=>n(`deviceManager`,`listBindableCapsForDeviceType`,`query`,e),discoverDevices:e=>n(`deviceManager`,`discoverDevices`,`mutation`,e),adoptDevice:e=>n(`deviceManager`,`adoptDevice`,`mutation`,e),getCreationSchema:e=>n(`deviceManager`,`getCreationSchema`,`query`,e),createDevice:e=>n(`deviceManager`,`createDevice`,`mutation`,e),testCreationField:e=>n(`deviceManager`,`testCreationField`,`mutation`,e),adoptionListCandidateFilters:e=>n(`deviceManager`,`adoptionListCandidateFilters`,`query`,e),adoptionListCandidates:e=>n(`deviceManager`,`adoptionListCandidates`,`query`,e),adoptionRefresh:e=>n(`deviceManager`,`adoptionRefresh`,`mutation`,e),adoptionAdopt:e=>n(`deviceManager`,`adoptionAdopt`,`mutation`,e),adoptionRelease:e=>n(`deviceManager`,`adoptionRelease`,`mutation`,e),adoptionStartJob:e=>n(`deviceManager`,`adoptionStartJob`,`mutation`,e),adoptionListJobs:e=>n(`deviceManager`,`adoptionListJobs`,`query`,e),adoptionCancelJob:e=>n(`deviceManager`,`adoptionCancelJob`,`mutation`,e),adoptionResync:e=>n(`deviceManager`,`adoptionResync`,`mutation`,e),discoveryProviders:e=>n(`deviceManager`,`discoveryProviders`,`query`,e),discoverAllProviders:e=>n(`deviceManager`,`discoverAllProviders`,`mutation`,e),discoverProvider:e=>n(`deviceManager`,`discoverProvider`,`mutation`,e),providerCreationType:e=>n(`deviceManager`,`providerCreationType`,`query`,e),providerDiscoveryParamsSchema:e=>n(`deviceManager`,`providerDiscoveryParamsSchema`,`query`,e),getDeviceStatusAggregateBatch:e=>n(`deviceManager`,`getDeviceStatusAggregateBatch`,`query`,e)},deviceProvider:{start:e=>n(`deviceProvider`,`start`,`mutation`,e),stop:e=>n(`deviceProvider`,`stop`,`mutation`,e),getStatus:e=>n(`deviceProvider`,`getStatus`,`query`,e),getDevices:e=>n(`deviceProvider`,`getDevices`,`query`,e),reloadDevice:e=>n(`deviceProvider`,`reloadDevice`,`mutation`,e),supportsDiscovery:e=>n(`deviceProvider`,`supportsDiscovery`,`query`,e),discoverDevices:e=>n(`deviceProvider`,`discoverDevices`,`mutation`,e),getDiscoveryParamsSchema:e=>n(`deviceProvider`,`getDiscoveryParamsSchema`,`query`,e),getManualCreationType:e=>n(`deviceProvider`,`getManualCreationType`,`query`,e),adoptDiscoveredDevice:e=>n(`deviceProvider`,`adoptDiscoveredDevice`,`mutation`,e),supportsManualCreation:e=>n(`deviceProvider`,`supportsManualCreation`,`query`,e),getChildCreationSchema:e=>n(`deviceProvider`,`getChildCreationSchema`,`query`,e),createDevice:e=>n(`deviceProvider`,`createDevice`,`mutation`,e),testCreationField:e=>n(`deviceProvider`,`testCreationField`,`mutation`,e)},deviceState:{getAllSnapshots:e=>n(`deviceState`,`getAllSnapshots`,`query`,e),listClaims:e=>n(`deviceState`,`listClaims`,`query`,e)},faceGallery:{listIdentities:e=>n(`faceGallery`,`listIdentities`,`query`,e),createIdentity:e=>n(`faceGallery`,`createIdentity`,`mutation`,e),renameIdentity:e=>n(`faceGallery`,`renameIdentity`,`mutation`,e),deleteIdentity:e=>n(`faceGallery`,`deleteIdentity`,`mutation`,e),listIdentitySamples:e=>n(`faceGallery`,`listIdentitySamples`,`query`,e),auditIdentitySamples:e=>n(`faceGallery`,`auditIdentitySamples`,`query`,e),removeSample:e=>n(`faceGallery`,`removeSample`,`mutation`,e),getFaceMedia:e=>n(`faceGallery`,`getFaceMedia`,`query`,e),assignFace:e=>n(`faceGallery`,`assignFace`,`mutation`,e),unassignFace:e=>n(`faceGallery`,`unassignFace`,`mutation`,e),deleteFace:e=>n(`faceGallery`,`deleteFace`,`mutation`,e),assignFaces:e=>n(`faceGallery`,`assignFaces`,`mutation`,e),unassignFaces:e=>n(`faceGallery`,`unassignFaces`,`mutation`,e),suggestFaceClusters:e=>n(`faceGallery`,`suggestFaceClusters`,`query`,e)},integrations:{list:e=>n(`integrations`,`list`,`query`,e),get:e=>n(`integrations`,`get`,`query`,e),getByAddonId:e=>n(`integrations`,`getByAddonId`,`query`,e),create:e=>n(`integrations`,`create`,`mutation`,e),update:e=>n(`integrations`,`update`,`mutation`,e),delete:e=>n(`integrations`,`delete`,`mutation`,e),getSettings:e=>n(`integrations`,`getSettings`,`query`,e),setSettings:e=>n(`integrations`,`setSettings`,`mutation`,e),getAvailableTypes:e=>n(`integrations`,`getAvailableTypes`,`query`,e),testConnection:e=>n(`integrations`,`testConnection`,`mutation`,e)},keychainAdmin:{status:e=>n(`keychainAdmin`,`status`,`query`,e),listSecrets:e=>n(`keychainAdmin`,`listSecrets`,`query`,e),listAudit:e=>n(`keychainAdmin`,`listAudit`,`query`,e),reveal:e=>n(`keychainAdmin`,`reveal`,`mutation`,e),setSystemSecret:e=>n(`keychainAdmin`,`setSystemSecret`,`mutation`,e),deleteOrphans:e=>n(`keychainAdmin`,`deleteOrphans`,`mutation`,e),rotateMasterKey:e=>n(`keychainAdmin`,`rotateMasterKey`,`mutation`,e),purgeRetiredKeys:e=>n(`keychainAdmin`,`purgeRetiredKeys`,`mutation`,e),downloadRecoveryKey:e=>n(`keychainAdmin`,`downloadRecoveryKey`,`mutation`,e),resetKeychain:e=>n(`keychainAdmin`,`resetKeychain`,`mutation`,e),resetReport:e=>n(`keychainAdmin`,`resetReport`,`query`,e),acknowledgeReset:e=>n(`keychainAdmin`,`acknowledgeReset`,`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),getAddresses:e=>n(`localNetwork`,`getAddresses`,`query`,e),addCustomAddress:e=>n(`localNetwork`,`addCustomAddress`,`mutation`,e),removeCustomAddress:e=>n(`localNetwork`,`removeCustomAddress`,`mutation`,e),setAddressRole:e=>n(`localNetwork`,`setAddressRole`,`mutation`,e),getHubAddresses:e=>n(`localNetwork`,`getHubAddresses`,`query`,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),getTarget:e=>n(`notificationOutput`,`getTarget`,`query`,e),discoverTargets:e=>n(`notificationOutput`,`discoverTargets`,`query`,e),probeTargetConfig:e=>n(`notificationOutput`,`probeTargetConfig`,`mutation`,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),listSequences:e=>n(`notificationRules`,`listSequences`,`query`,e),getSequence:e=>n(`notificationRules`,`getSequence`,`query`,e),createSequence:e=>n(`notificationRules`,`createSequence`,`mutation`,e),updateSequence:e=>n(`notificationRules`,`updateSequence`,`mutation`,e),deleteSequence:e=>n(`notificationRules`,`deleteSequence`,`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),createAlarmProfile:e=>n(`notificationRules`,`createAlarmProfile`,`mutation`,e),renameAlarmProfile:e=>n(`notificationRules`,`renameAlarmProfile`,`mutation`,e),deleteAlarmProfile:e=>n(`notificationRules`,`deleteAlarmProfile`,`mutation`,e),activateAlarmProfile:e=>n(`notificationRules`,`activateAlarmProfile`,`mutation`,e),getAlarmSensors:e=>n(`notificationRules`,`getAlarmSensors`,`query`,e)},oidcConnections:{connectionFormSchema:e=>n(`oidcConnections`,`connectionFormSchema`,`query`,e),listConnections:e=>n(`oidcConnections`,`listConnections`,`query`,e),createConnection:e=>n(`oidcConnections`,`createConnection`,`mutation`,e),updateConnection:e=>n(`oidcConnections`,`updateConnection`,`mutation`,e),deleteConnection:e=>n(`oidcConnections`,`deleteConnection`,`mutation`,e)},osdManager:{getConditionSupport:e=>n(`osdManager`,`getConditionSupport`,`query`,e),copyDeviceConfiguration:e=>n(`osdManager`,`copyDeviceConfiguration`,`mutation`,e),listTemplates:e=>n(`osdManager`,`listTemplates`,`query`,e),upsertTemplate:e=>n(`osdManager`,`upsertTemplate`,`mutation`,e),deleteTemplate:e=>n(`osdManager`,`deleteTemplate`,`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),clearModelBoundDeviceOverrides:e=>n(`pipelineExecutor`,`clearModelBoundDeviceOverrides`,`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),getCapabilities:e=>n(`pipelineExecutor`,`getCapabilities`,`query`,e),getAddonModels:e=>n(`pipelineExecutor`,`getAddonModels`,`query`,e),downloadModel:e=>n(`pipelineExecutor`,`downloadModel`,`mutation`,e),deleteModel:e=>n(`pipelineExecutor`,`deleteModel`,`mutation`,e),cacheFrameInPool:e=>n(`pipelineExecutor`,`cacheFrameInPool`,`mutation`,e),inferCached:e=>n(`pipelineExecutor`,`inferCached`,`mutation`,e),uncacheFrame:e=>n(`pipelineExecutor`,`uncacheFrame`,`mutation`,e),getEffectiveTuning:e=>n(`pipelineExecutor`,`getEffectiveTuning`,`query`,e),listLoadedEngines:e=>n(`pipelineExecutor`,`listLoadedEngines`,`query`,e),spinEngine:e=>n(`pipelineExecutor`,`spinEngine`,`mutation`,e),killEngine:e=>n(`pipelineExecutor`,`killEngine`,`mutation`,e),listReferenceImages:e=>n(`pipelineExecutor`,`listReferenceImages`,`query`,e),getReferenceImage:e=>n(`pipelineExecutor`,`getReferenceImage`,`query`,e),getReferenceAudioFiles:e=>n(`pipelineExecutor`,`getReferenceAudioFiles`,`query`,e),getReferenceAudio:e=>n(`pipelineExecutor`,`getReferenceAudio`,`query`,e),getAudioCapabilities:e=>n(`pipelineExecutor`,`getAudioCapabilities`,`query`,e),runAudioTest:e=>n(`pipelineExecutor`,`runAudioTest`,`mutation`,e),getDetectionConfigSchema:e=>n(`pipelineExecutor`,`getDetectionConfigSchema`,`query`,e)},pipelineOrchestrator:{requestOccupancyLook:e=>n(`pipelineOrchestrator`,`requestOccupancyLook`,`mutation`,e),pauseForStorageMigration:e=>n(`pipelineOrchestrator`,`pauseForStorageMigration`,`mutation`,e),resumeForStorageMigration:e=>n(`pipelineOrchestrator`,`resumeForStorageMigration`,`mutation`,e),rebalance:e=>n(`pipelineOrchestrator`,`rebalance`,`mutation`,e),getPipelineAssignments:e=>n(`pipelineOrchestrator`,`getPipelineAssignments`,`query`,e),getAgentLoad:e=>n(`pipelineOrchestrator`,`getAgentLoad`,`query`,e),getClusterModelChoice:e=>n(`pipelineOrchestrator`,`getClusterModelChoice`,`query`,e),getGlobalMetrics:e=>n(`pipelineOrchestrator`,`getGlobalMetrics`,`query`,e),getCapabilityBindings:e=>n(`pipelineOrchestrator`,`getCapabilityBindings`,`query`,e),setCapabilityBinding:e=>n(`pipelineOrchestrator`,`setCapabilityBinding`,`mutation`,e),getIngestOwner:e=>n(`pipelineOrchestrator`,`getIngestOwner`,`query`,e),getAudioNodeLoad:e=>n(`pipelineOrchestrator`,`getAudioNodeLoad`,`query`,e),getAudioAssignments:e=>n(`pipelineOrchestrator`,`getAudioAssignments`,`query`,e),getAgentSettings:e=>n(`pipelineOrchestrator`,`getAgentSettings`,`query`,e),listAgentSettings:e=>n(`pipelineOrchestrator`,`listAgentSettings`,`query`,e),removeAgentSettings:e=>n(`pipelineOrchestrator`,`removeAgentSettings`,`mutation`,e),setAgentMaxCameras:e=>n(`pipelineOrchestrator`,`setAgentMaxCameras`,`mutation`,e),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),planAutoTune:e=>n(`pipelineOrchestrator`,`planAutoTune`,`query`,e),applyAutoTune:e=>n(`pipelineOrchestrator`,`applyAutoTune`,`mutation`,e),setLoadBalancingShares:e=>n(`pipelineOrchestrator`,`setLoadBalancingShares`,`mutation`,e),getPlacementStats:e=>n(`pipelineOrchestrator`,`getPlacementStats`,`query`,e),suggestShares:e=>n(`pipelineOrchestrator`,`suggestShares`,`query`,e),getEffectiveShares:e=>n(`pipelineOrchestrator`,`getEffectiveShares`,`query`,e),setShareSource:e=>n(`pipelineOrchestrator`,`setShareSource`,`mutation`,e),getNodeBenchmarkPreflight:e=>n(`pipelineOrchestrator`,`getNodeBenchmarkPreflight`,`query`,e),startNodeBenchmark:e=>n(`pipelineOrchestrator`,`startNodeBenchmark`,`mutation`,e),getNodeBenchmarkStatus:e=>n(`pipelineOrchestrator`,`getNodeBenchmarkStatus`,`query`,e),abortNodeBenchmark:e=>n(`pipelineOrchestrator`,`abortNodeBenchmark`,`mutation`,e),getNodeBenchmarkCandidates:e=>n(`pipelineOrchestrator`,`getNodeBenchmarkCandidates`,`query`,e),listNodeBenchmarkResults:e=>n(`pipelineOrchestrator`,`listNodeBenchmarkResults`,`query`,e),deleteNodeBenchmarkResult:e=>n(`pipelineOrchestrator`,`deleteNodeBenchmarkResult`,`mutation`,e),getCameraStatuses:e=>n(`pipelineOrchestrator`,`getCameraStatuses`,`query`,e),setCameraSensors:e=>n(`pipelineOrchestrator`,`setCameraSensors`,`mutation`,e),reconcileFromDisk:e=>n(`pipelineOrchestrator`,`reconcileFromDisk`,`mutation`,e),getReconcileFromDiskStatus:e=>n(`pipelineOrchestrator`,`getReconcileFromDiskStatus`,`query`,e)},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),startNodeBench:e=>n(`pipelineRunner`,`startNodeBench`,`mutation`,e),getNodeBenchStatus:e=>n(`pipelineRunner`,`getNodeBenchStatus`,`query`,e),abortNodeBench:e=>n(`pipelineRunner`,`abortNodeBench`,`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),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)},training:{listBaseModels:e=>n(`training`,`listBaseModels`,`query`,e),planJob:e=>n(`training`,`planJob`,`query`,e),startJob:e=>n(`training`,`startJob`,`mutation`,e),startJobBatch:e=>n(`training`,`startJobBatch`,`mutation`,e),listJobs:e=>n(`training`,`listJobs`,`query`,e),getJob:e=>n(`training`,`getJob`,`query`,e),cancelJob:e=>n(`training`,`cancelJob`,`mutation`,e),getJobResult:e=>n(`training`,`getJobResult`,`query`,e),registerResult:e=>n(`training`,`registerResult`,`mutation`,e),canaryResult:e=>n(`training`,`canaryResult`,`mutation`,e),rollbackCanary:e=>n(`training`,`rollbackCanary`,`mutation`,e),discardResult:e=>n(`training`,`discardResult`,`mutation`,e)},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),revokeApiKey:e=>n(`userManagement`,`revokeApiKey`,`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),listExternalIdentities:e=>n(`userManagement`,`listExternalIdentities`,`query`,e),findUserByExternalIdentity:e=>n(`userManagement`,`findUserByExternalIdentity`,`query`,e),unlinkExternalIdentity:e=>n(`userManagement`,`unlinkExternalIdentity`,`mutation`,e),listOauthSessions:e=>n(`userManagement`,`listOauthSessions`,`query`,e),revokeOauthSession:e=>n(`userManagement`,`revokeOauthSession`,`mutation`,e)}}}var OQ=`2026-09-11T00:00:00.000Z`,kQ=Date.parse(OQ),AQ={PCMU:20*Math.log10(4),PCMA:20*Math.log10(8)};function jQ(e,t){return t+AQ[e]}function MQ(e){return!Number.isFinite(e)||e<=0?`unknown`:e>=kQ?`itu`:`pre-itu`}var NQ=`audio-`;function PQ(e){return e.startsWith(NQ)?e.slice(6):e}function FQ(e){return e.startsWith(NQ)?e:`${NQ}${e}`}var IQ=-96,LQ=0,RQ=3,zQ=Math.round(jQ(`PCMU`,-55)),BQ=1,VQ=100,HQ=1,UQ=300,WQ=2,GQ=5,KQ=1,qQ=20,JQ=1,YQ=60,XQ={hitPercent:60,samplingSeconds:10};function ZQ(e){return e??XQ}function QQ(e){return e===void 0?null:e.labels!==void 0&&e.labels.length>0?`label`:e.dbThreshold===void 0?null:`level`}function $Q(e){return e===void 0?!1:e.dbThreshold===void 0&&(e.labels===void 0||e.labels.length===0)}function e$(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,Math.round(e))):t}function t$(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n$(e,t){let n=ZQ(e),r=t$(t,`labels`)?t.labels:n.labels,i=t$(t,`dbThreshold`)?t.dbThreshold:n.dbThreshold,a=r!==void 0&&r.length>0,o=t.mode??(t$(t,`labels`)&&a?`label`:t$(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`?zQ:void 0):void 0;return{...s===void 0?{}:{labels:[...s]},...c===void 0?{}:{dbThreshold:e$(c,-96,0)},hitPercent:e$(t.hitPercent??n.hitPercent,1,100),samplingSeconds:e$(t.samplingSeconds??n.samplingSeconds,1,300),...(()=>{let e=t$(t,`confirmHits`)?t.confirmHits:n.confirmHits,r=t$(t,`confirmWindowSec`)?t.confirmWindowSec:n.confirmWindowSec;return{...e===void 0?{}:{confirmHits:e$(e,1,20)},...r===void 0?{}:{confirmWindowSec:e$(r,1,60)}}})()}}function r$(e,t){let n=e?.audioKinds??[],r=n.length>0?n.map(e=>{let t=PQ(e.kind);return{value:t,label:e.label,iconId:FQ(t),unknown:!1}}):VT.map(e=>({value:e.id,label:e.name,iconId:FQ(e.id),unknown:!1})),i=new Set(r.map(e=>e.value)),a=[];for(let e of t??[]){let t=PQ(e);i.has(t)||a.includes(t)||(a.push(t),r.push({value:t,label:t,iconId:FQ(t),unknown:!0}))}return{choices:r,unknownLabels:a}}function i$(e,t){let n=PQ(t);return(e??[]).some(e=>PQ(e)===n)}function a$(e,t){let n=PQ(t),r=e??[];if(i$(r,n)){let e=r.filter(e=>PQ(e)!==n);return e.length>0?e:void 0}return[...r,n]}var o$=new Set([`classes`,`classesExclude`]),s$=new Set([`sensorKinds`]),c$=new Set([`occupancy`]);function l$(e){return{value:e.kind,label:e.label}}function u$(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(l$(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 d$(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,[l$(r)]),t.push(e)):i.push(l$(r))}return t.flatMap(e=>{let t=n.get(e);return t===void 0?[]:[{key:e,fallbackLabel:e,options:t}]})}function f$(e,t){if(!t)return null;if(o$.has(e)){let e=u$(t.videoClasses);return t.audioKinds.length>0&&e.push({key:`audio`,fallbackLabel:`Audio`,options:t.audioKinds.map(l$)}),e.length>0?{groups:e}:null}if(c$.has(e)){let e=t.videoClasses.filter(e=>e.parentKind===null).map(l$);return e.length>0?{groups:[{key:`macro`,fallbackLabel:`Classes`,options:e}]}:null}if(s$.has(e)){let e=d$(t.labels);return e.length>0?{groups:e}:null}return null}var p$=`audio`;function m$(e){let t=f$(`classes`,e);if(t===null)return null;let n=t.groups.filter(e=>e.key!==p$);return n.length>0?{groups:n}:null}function h$(e){return e.trim().toLowerCase().startsWith(`${p$}-`)}function g$(e){let t=new Set;for(let n of e.groups)for(let e of n.options)t.add(e.value);return t}var _$=[`devices`,`classes`],v$=new Set(_$);function y$(e){return v$.has(e)}function b$(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 x$=[[/&nbsp;/g,` `],[/&amp;/g,`&`],[/&lt;/g,`<`],[/&gt;/g,`>`],[/&quot;/g,`"`],[/&#39;/g,`'`]];function S$(e){let t=e.replace(/<\s*br\s*\/?\s*>/gi,`
353
353
  `).replace(/<\s*\/\s*(p|div|li|h[1-6])\s*>/gi,`
354
354
  `).replace(/<[^>]+>/g,``);for(let[e,n]of x$)t=t.replace(e,n);return t.replace(/\n{3,}/g,`
355
355