@camstack/addon-admin-ui 0.1.47 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host--mtKe2Ne.js +1 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-1rzf3QZV.js +1 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-CSJxMxg6.js +6 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-CPJ7iclX.js +1 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__konva__loadShare__.js-B7XYY0cV.js +15 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-C2cB5JUo.js +1 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-CXx5u_N6.js +9 -0
- package/dist/assets/_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.js-B2sDsXg0.js +19 -0
- package/dist/assets/browser-BHo8W_uH.js +8 -0
- package/dist/assets/dist-CGRDjIOZ.js +1 -0
- package/dist/assets/dist-mzJ_Pmak.js +1 -0
- package/dist/assets/dist-q2poCTnb.js +75 -0
- package/dist/assets/hostInit-BPPNDtfC.js +1 -0
- package/dist/assets/index-BhBNvK07.js +82 -0
- package/dist/assets/index-D2K_AdnO.css +2 -0
- package/dist/{mf-entry-bootstrap-0.js → assets/mf-entry-bootstrap-0-3e14934b.js} +7 -5
- package/dist/assets/remoteEntry-Cb-DJ8UX.js +1 -0
- package/dist/assets/rolldown-runtime-Cyuzqnbw.js +1 -0
- package/dist/assets/schemas-CuE8EXQ7.js +64 -0
- package/dist/assets/src-BE2rTAMO.js +1 -0
- package/dist/assets/src-CrhOk7JL.js +1 -0
- package/dist/assets/virtualExposes-SIMIW5lI.js +1 -0
- package/dist/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-3el-ChDf.js +5 -0
- package/dist/assets/virtual_mf-exposes___mfe_internal__admin_ui_host__remoteEntry-_hash_-DnnXQRkG.js +1 -0
- package/dist/assets/vite-preload-helper-zJ_50EbN.js +1 -0
- package/dist/index.html +6 -9
- package/dist/server/addon.js +19793 -16322
- package/dist/sw.js +1 -1
- package/package.json +10 -9
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-CawbgE5L.js +0 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-GKALXIcl.js +0 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs-DIkg6-MH.js +0 -6
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs_commonjs-proxy-WD2WouMQ.js +0 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-JVZxVBTk.js +0 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-fDAP1KhM.js +0 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs-g85Oidc0.js +0 -15
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs_commonjs-proxy-Bqeq2Zwj.js +0 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-hk6goaRc.js +0 -9
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-CKOygvIQ.js +0 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-C_6K4VBY.js +0 -9
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs_commonjs-proxy-DrLZNXOX.js +0 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-DGvrhOC3.js +0 -9
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-DG9hE2tk.js +0 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-ByazpYAv.js +0 -25
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-CxaW4xr1.js +0 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs-BLBZm4ju.js +0 -35
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs_commonjs-proxy-LyTotJxo.js +0 -1
- package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-C3ppGtyE.js +0 -1
- package/dist/assets/browser-BXdiCFWD.js +0 -8
- package/dist/assets/devices-DmCyuEuQ.js +0 -1
- package/dist/assets/hostInit-BhyqZ3AI.js +0 -1
- package/dist/assets/index-BH5Ezf7x.js +0 -1
- package/dist/assets/index-BPRNeJ5M.js +0 -126
- package/dist/assets/index-BViRW9IB.js +0 -1
- package/dist/assets/index-BpGkKz46.js +0 -1
- package/dist/assets/index-C2d2NdfQ.css +0 -1
- package/dist/assets/index-C9MS3ovr.js +0 -1
- package/dist/assets/index-CAZNi1Jm.js +0 -1
- package/dist/assets/index-CDGj60rb.js +0 -190
- package/dist/assets/index-DBG7Fygw.js +0 -1
- package/dist/assets/index-DeFTFjpg.js +0 -1514
- package/dist/assets/index-DuP0eN9F.js +0 -1
- package/dist/assets/index-na_oszC9.js +0 -1
- package/dist/assets/method-access-map-BCPBTC0g.js +0 -1
- package/dist/assets/preload-helper-BlTxHScW.js +0 -1
- package/dist/assets/remoteEntry-0I-ik-5b.js +0 -1
- package/dist/assets/schemas-DSjJ1TGP.js +0 -64
- package/dist/assets/virtualExposes-_ivNhQLP.js +0 -1
- package/dist/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-ChhI9HQF.js +0 -8
- package/dist/server/addon.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as a,a as p,n as t,_ as u,s as e,r as I,l as k,b as g,c as S,d as T,u as b,e as x,f as ht,p as lc,g as U,h as _e,i as F,t as Fe,j as pc,k as ho,m as mc,q as uc,Z as vt,v as vo,w as yo,x as Ft,y as So,z as fo,A as bo,B as Io,C as gc}from"./schemas-DSjJ1TGP.js";const hc=S(["singleton","device","widget"]),wa=a({capName:e(),kind:hc,deviceId:t().optional(),reachable:g(),latencyMs:t(),error:e().optional()}),vc=a({addonId:e(),caps:p(wa).readonly(),widgets:p(wa).readonly()}),yc=a({nodeId:e(),addons:p(vc).readonly()}),Iv=a({ok:g(),degraded:g(),checkedAt:e(),nodes:p(yc).readonly(),summary:a({total:t(),reachable:t(),unreachable:t()})}),Sc=["onnx","coreml","openvino","tflite","pt"],fc=[{id:"overview",label:"Overview",icon:"layout-dashboard",order:-10},{id:"general",label:"General",icon:"settings",order:0},{id:"image",label:"Image",icon:"image",order:5},{id:"light",label:"Light",icon:"lightbulb",order:7},{id:"motion",label:"Motion",icon:"activity",order:10},{id:"audio",label:"Audio",icon:"mic",order:12},{id:"alarms",label:"Alarms",icon:"bell-ring",order:13},{id:"snapshot",label:"Snapshot",icon:"camera",order:15},{id:"osd",label:"OSD",icon:"type",order:18},{id:"stream-broker",label:"Stream Broker",icon:"radio",order:20},{id:"streaming",label:"Streaming",icon:"video",order:35},{id:"ptz",label:"PTZ",icon:"move",order:40},{id:"consumables",label:"Consumables",icon:"recycle",order:44},{id:"pipeline",label:"Detection Pipeline",icon:"cpu",order:39},{id:"zones",label:"Detection",icon:"shapes",order:38},{id:"live-stats",label:"Live Stats",icon:"activity",order:39},{id:"recording",label:"Recording",icon:"circle-dot",order:40},{id:"engine",label:"Inference Engine",icon:"zap",order:41},{id:"scheduler",label:"Scheduler",icon:"list-checks",order:42},{id:"decoder",label:"Decoder",icon:"film",order:43},{id:"notifications",label:"Notifications",icon:"bell",order:50},{id:"network",label:"Network",icon:"globe",order:60},{id:"storage",label:"Storage",icon:"hard-drive",order:70},{id:"advanced",label:"Advanced",icon:"wrench",order:100}],kv=Object.fromEntries(fc.map(i=>[i.id,i]));function bc(i){return i.type==="separator"||i.type==="info"||i.type==="qr-code"||i.type==="button"||i.type==="object-array"||i.type==="widget"||i.type==="addon-action-button"||i.type==="device-action-button"}function Ca(i,o){return{...i.tabs?{tabs:[...i.tabs]}:{},sections:i.sections.map(n=>({...n,fields:n.fields.map(d=>yt(d,o))}))}}function yt(i,o){if(bc(i))return i;if(i.type==="group"){const v=i.fields.map(A=>yt(A,o));return{...i,fields:v}}if(i.type==="sub-tabs"){const v=i.tabs.map(A=>({...A,fields:A.fields.map(C=>yt(C,o))}));return{...i,tabs:v}}const n=i.key,d=Object.prototype.hasOwnProperty.call(o,n)?o[n]:void 0,l=i.default;if(i.multiple){const v=Array.isArray(d)?d:d!=null?[d]:[],w=i.multiple.itemDefault!==void 0?i.multiple.itemDefault:l!==void 0?l:Ic(i)==="string"?"":null,A=Math.max(i.multiple.min,v.length),C=[];for(let P=0;P<A;P++)C.push(P<v.length?v[P]:w);return{...i,value:C}}const h=d!==void 0?d:l!==void 0?l:null;if(i.type==="password")return{...i,value:""};const y=i.type==="textarea"&&i.isJson&&h!==null&&typeof h=="object"?JSON.stringify(h,null,2):h;return{...i,value:y}}function Ic(i){switch(i.type){case"text":case"textarea":case"password":case"color":case"probe":case"timezone":case"datetime":return"string";case"number":case"slider":return"number";case"boolean":return"boolean";default:return"other"}}const L=S(["high","mid","low"]),Aa=["high","mid","low"],Ht=S(["pull-rtsp","pull-rtmp","pull-http","pull-rfc4571","push-annexb","derived"]),ie=a({width:t().int().positive(),height:t().int().positive()}),St=a({camStreamId:e().min(1),deviceId:t().int().nonnegative(),kind:Ht,url:e().optional(),codec:e().optional(),resolution:ie.optional(),fps:t().positive().optional(),label:e().optional(),deviceFeatures:p(e()).optional(),autoEligible:g().optional(),metadata:I(e(),b()).optional()}),Pe=S(["unassigned","idle","connecting","streaming","error"]),ft=a({deviceId:t().int().nonnegative(),profile:L,brokerId:e(),sourceCamStreamId:e().nullable(),status:Pe,resolution:ie.optional(),codec:e().optional(),preBufferSec:t().nonnegative().optional(),errorMessage:e().optional()});function wv(i,o){return`${i}/${o}`}function Cv(i,o){return`${i}/${o}`}function Av(i){const o=i.indexOf("/");if(o<=0)return null;const n=i.slice(0,o),d=i.slice(o+1);if(!/^\d+$/.test(n))return null;const l=L.safeParse(d);return l.success?{deviceId:Number(n),profile:l.data}:null}function Nv(i,o){const n=[...i].filter(h=>o===void 0||h.deviceId===o).sort((h,y)=>Aa.indexOf(h.profile)-Aa.indexOf(y.profile)),d=new Set,l=[];for(const h of n){const y=h.sourceCamStreamId;y!==null&&(d.has(y)||(d.add(y),l.push(h)))}return l}const kc=a({id:e(),label:e(),protocol:S(["rtsp","rtmp","annexb","http-mjpeg","webrtc","custom"]),url:e().optional(),resolution:a({width:t(),height:t()}).readonly().optional(),fps:t().optional(),bitrate:t().optional(),codec:e().optional(),profileHint:L.optional()}),Pv=a({type:e(),url:e(),videoCodec:e().optional(),audioCodec:e().optional(),metadata:I(e(),b()).readonly().optional()}),wc=a({type:S(["video","audio"]),data:T(Uint8Array),pts:t(),dts:t(),keyframe:g(),codec:e()}),Na=a({data:T(Uint8Array),width:t(),height:t(),format:S(["jpeg","rgb","bgr","yuv420","gray"]),timestamp:t()}),bt=a({shmId:e(),slot:t().int().nonnegative(),seq:t().int().nonnegative(),width:t().int().positive(),height:t().int().positive(),format:S(["jpeg","rgb","bgr","yuv420","gray"]),pts:t(),byteLength:t().int().nonnegative(),nodeId:e(),slotCount:t().int().positive()}),Cc=S(["rgb","bgr","yuv420","gray"]),Ac=a({brokerId:e(),format:Cc,maxFps:t().positive().optional(),tag:e().optional()}),Nc=a({subscriptionId:e(),maxFps:t().nonnegative()}),Pc=a({data:T(Uint8Array),sampleRate:t().int().positive(),channels:t().int().positive(),timestamp:t()}),Mc=a({brokerId:e(),tag:e().optional()}),Dc=a({subscriptionId:e()}),xc=S(["idle","connecting","streaming","error","stopped"]),Tc=a({status:xc,inputFps:t(),decodeFps:t(),encodedSubscribers:t(),decodedSubscribers:t(),uptimeMs:t(),bitrateKbps:t(),idrIntervalMs:t(),codec:e().optional(),totalBytes:t(),packetCount:t(),rtspClients:t(),pipeClients:t(),preBufferSec:t(),preBufferMs:t(),preBufferPackets:t(),decoderNodeId:e().nullable(),audio:a({codec:e(),sampleRate:t(),channels:t(),supported:g()}).nullable().optional()}),Ec=a({profile:L,brokerId:e(),url:e(),mutedUrl:e(),enabled:g(),codec:e().optional(),resolution:ie.optional()}),Rc=t().int().min(0).max(6),Pa=/^([01]\d|2[0-3]):[0-5]\d$/,Bc=U("kind",[a({kind:k("always")}),a({kind:k("timeOfDay"),start:e().regex(Pa),end:e().regex(Pa),days:p(Rc).optional()})]),qc=S(["continuous","onMotion","onAudioThreshold"]),Oc=a({schedule:Bc,mode:qc,preBufferSec:t().min(0).default(0),postBufferSec:t().min(0).default(0),resetTimeoutOnNewEvent:g().default(!0),thresholdDbfs:t().optional()}),Lc=a({maxAgeDays:t().min(0).optional(),maxSizeGb:t().min(0).optional()}),Ve=a({enabled:g(),profiles:p(L).optional(),segmentSeconds:t().int().positive().optional(),rules:p(Oc).optional(),retention:Lc.optional()}),It=e().regex(/^[a-z][a-zA-Z0-9-]*$/),O=a({id:e().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),type:e(),displayName:e().min(1),providerId:e().min(1),config:I(e(),b()),isDefault:g().default(!1),isSystem:g().default(!1),createdAt:t(),updatedAt:t()}),W=x([It,e().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),zc=a({id:e().regex(/^[a-z][a-zA-Z0-9-]*$/,{message:"id must start with a lowercase letter and contain only letters, digits, or hyphens"}),displayName:e().min(1,{message:"displayName must not be empty"}),description:e().optional(),cardinality:S(["single","multi"]),defaultsTo:e().optional()}),Uc=a({inputFps:t(),outputFps:t(),avgDecodeTimeMs:t(),droppedFrames:t()}),Ma=a({codec:e(),maxFps:t().default(0),outputFormat:S(["jpeg","rgb","bgr","yuv420","gray"]).default("jpeg"),scale:t().default(1),width:t().optional(),height:t().optional(),deviceId:t().int().nonnegative().optional(),tag:e().optional(),frameSink:S(["callback","shm"]).default("callback")}),_c=a({codec:S(["h264","h265","copy"]),profile:S(["baseline","main","high"]).optional(),width:t().int().positive().optional(),height:t().int().positive().optional(),fps:t().positive().optional(),bitrateKbps:t().int().positive().optional(),gopFrames:t().int().positive().optional(),bf:t().int().min(0).optional(),preset:S(["ultrafast","superfast","veryfast","faster","fast","medium"]).optional(),tune:S(["zerolatency","film","animation"]).optional()}),Fc=x([k("passthrough"),a({codec:S(["opus","aac","pcmu","pcma","copy"]),bitrateKbps:t().int().positive().optional(),sampleRateHz:t().int().positive().optional(),channels:x([k(1),k(2)]).optional()})]),Hc=a({video:_c,audio:Fc,inputArgs:p(e()).optional(),outputArgs:p(e()).optional()});function Mv(i){const o=i.codec?.toLowerCase().replace(/[.\s-]/g,""),d={codec:o==="h265"||o==="hevc"?"h265":"h264",...i.resolution?.width!==void 0?{width:i.resolution.width}:{},...i.resolution?.height!==void 0?{height:i.resolution.height}:{},...i.fps!==void 0?{fps:i.fps}:{}};if(!(d.width===void 0&&d.height===void 0&&d.fps===void 0))return{video:d,audio:"passthrough"}}function $c(i){return i instanceof Error?i.message:typeof i=="string"?i:String(i)}const Wc=[{id:"speech",name:"Speech",icon:"🗣️"},{id:"scream",name:"Scream / Shout",icon:"😱"},{id:"crying",name:"Crying / Baby",icon:"😢"},{id:"laughter",name:"Laughter",icon:"😂"},{id:"music",name:"Music",icon:"🎵"},{id:"dog",name:"Dog",icon:"🐕"},{id:"cat",name:"Cat",icon:"🐈"},{id:"bird",name:"Bird",icon:"🐦"},{id:"animal",name:"Animal (other)",icon:"🐾"},{id:"alarm",name:"Alarm / Siren",icon:"🚨"},{id:"doorbell",name:"Doorbell / Knock",icon:"🔔"},{id:"glass_breaking",name:"Glass Breaking",icon:"💥"},{id:"gunshot",name:"Gunshot / Explosion",icon:"💣"},{id:"vehicle",name:"Vehicle",icon:"🚗"},{id:"siren",name:"Emergency Siren",icon:"🚑"},{id:"fire",name:"Fire / Smoke",icon:"🔥"},{id:"water",name:"Water",icon:"💧"},{id:"wind",name:"Wind / Weather",icon:"🌬️"},{id:"door",name:"Door",icon:"🚪"},{id:"footsteps",name:"Footsteps",icon:"👣"},{id:"crowd",name:"Crowd / Chatter",icon:"👥"},{id:"telephone",name:"Telephone",icon:"📞"},{id:"engine",name:"Engine / Motor",icon:"⚙️"},{id:"tools",name:"Tools / Construction",icon:"🔨"},{id:"silence",name:"Silence",icon:"🤫"}],Vc={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},Kc={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},$t=new Map;for(const[i,o]of Object.entries(Vc.mapping))$t.set(i.toLowerCase(),o);for(const[i,o]of Object.entries(Kc.mapping))$t.set(i.toLowerCase(),o);function Dv(i){return $t.get(i.toLowerCase())??null}function xv(){return Wc.map(i=>i.id)}var f=(i=>(i.Camera="camera",i.Hub="hub",i.Light="light",i.Siren="siren",i.Switch="switch",i.Sensor="sensor",i.Thermostat="thermostat",i.Button="button",i.EventEmitter="event-emitter",i.Update="update",i.Generic="generic",i.Notifier="notifier",i.Script="script",i.Automation="automation",i.Lock="lock",i.Cover="cover",i.Valve="valve",i.Humidifier="humidifier",i.WaterHeater="water-heater",i.Fan="fan",i.MediaPlayer="media-player",i.AlarmPanel="alarm-panel",i.Control="control",i.Presence="presence",i.Weather="weather",i.Vacuum="vacuum",i.LawnMower="lawn-mower",i.Container="container",i.Image="image",i))(f||{}),ko=(i=>(i.BatteryOperated="battery-operated",i.Rebootable="rebootable",i.Resyncable="resyncable",i.NativeSnapshot="native-snapshot",i.DoorbellButton="doorbell-button",i.TwoWayAudio="two-way-audio",i.PanTiltZoom="pan-tilt-zoom",i.PtzAutotrack="ptz-autotrack",i.MotionTrigger="motion-trigger",i.LightColorRgb="light-color-rgb",i.LightColorHsv="light-color-hsv",i.LightColorMired="light-color-mired",i.ClimateDualSetpoint="climate-dual-setpoint",i.ClimateHumidity="climate-humidity",i.ClimateFanMode="climate-fan-mode",i.ClimatePreset="climate-preset",i.CoverPositionable="cover-positionable",i.CoverTilt="cover-tilt",i.ValvePositionable="valve-positionable",i.FanSpeed="fan-speed",i.FanPreset="fan-preset",i.FanDirection="fan-direction",i.FanOscillating="fan-oscillating",i.LockPinRequired="lock-pin-required",i.LockOpen="lock-open",i.MediaPlayerSeek="media-player-seek",i.MediaPlayerVolume="media-player-volume",i.MediaPlayerMute="media-player-mute",i.MediaPlayerShuffle="media-player-shuffle",i.MediaPlayerRepeat="media-player-repeat",i.MediaPlayerSelectSource="media-player-select-source",i.MediaPlayerPlayMedia="media-player-play-media",i.MediaPlayerNext="media-player-next",i.MediaPlayerPrevious="media-player-previous",i.MediaPlayerStop="media-player-stop",i.AlarmPinRequired="alarm-pin-required",i.PresenceGps="presence-gps",i.NotifierImage="notifier-image",i.NotifierPriority="notifier-priority",i.NotifierData="notifier-data",i.NotifierActions="notifier-actions",i.NotifierRecipients="notifier-recipients",i.ScriptVariables="script-variables",i.AutomationSkipCondition="automation-skip-condition",i))(ko||{}),jc=(i=>(i.ChargingDC="charging-dc",i.ChargingSolar="charging-solar",i.NotCharging="not-charging",i))(jc||{}),V=(i=>(i.Siren="siren",i.Floodlight="floodlight",i.Spotlight="spotlight",i.PirSensor="pir-sensor",i.Chime="chime",i.Autotrack="autotrack",i.Nightvision="nightvision",i.PrivacyMask="privacy-mask",i.Doorbell="doorbell",i.BinaryHelper="binary-helper",i.MotionSensor="motion-sensor",i.ContactSensor="contact-sensor",i.LeakSensor="leak-sensor",i.SmokeSensor="smoke-sensor",i.COSensor="co-sensor",i.GasSensor="gas-sensor",i.TamperSensor="tamper-sensor",i.VibrationSensor="vibration-sensor",i.ConnectivitySensor="connectivity-sensor",i.SoundSensor="sound-sensor",i.BinarySensor="binary-sensor",i.TemperatureSensor="temperature-sensor",i.HumiditySensor="humidity-sensor",i.AmbientLightSensor="ambient-light-sensor",i.PressureSensor="pressure-sensor",i.PowerSensor="power-sensor",i.EnergySensor="energy-sensor",i.VoltageSensor="voltage-sensor",i.CurrentSensor="current-sensor",i.AirQualitySensor="air-quality-sensor",i.BatterySensor="battery-sensor",i.NumericSensor="numeric-sensor",i.EnumSensor="enum-sensor",i.DateTimeSensor="datetime-sensor",i.GenericSensor="generic-sensor",i.NumericControl="numeric-control",i.SelectControl="select-control",i.TextControl="text-control",i.DateTimeControl="datetime-control",i.MobilePushNotifier="mobile-push-notifier",i.MessagingNotifier="messaging-notifier",i.EmailNotifier="email-notifier",i.GenericNotifier="generic-notifier",i))(V||{});const j={Siren:V.Siren,Floodlight:V.Floodlight,Spotlight:V.Spotlight,PirSensor:V.PirSensor,Chime:V.Chime,Autotrack:V.Autotrack,Nightvision:V.Nightvision,PrivacyMask:V.PrivacyMask},Tv={[j.Siren]:"Siren",[j.Floodlight]:"Floodlight",[j.Spotlight]:"Spotlight",[j.PirSensor]:"PIR",[j.Chime]:"Chime",[j.Autotrack]:"Autotracking",[j.Nightvision]:"Night Vision",[j.PrivacyMask]:"Privacy Mask"};function Ev(i,o,n){const d=`${i}:${o}`;return typeof n=="number"?`${d}:${n}`:d}function Gc(i,o){return!i||i.length===0?!1:i.includes(o.when.hasFeature)}const Zc={id:"battery",label:"Battery-operated camera",when:{hasFeature:ko.BatteryOperated},defaults:{audioMode:"disabled",detectionMode:"on-motion"},settings:{"snapshot.minRefreshIntervalSec":3600,"streamBroker.preBufferEnabled":!1}},Qc=[Zc];function Rv(i){for(const o of Qc)if(Gc(i,o))return o;return null}const Ke=a({online:g(),lastChangedAt:t()}),Wt={name:"device-status",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onStatusChanged:{data:a({deviceId:t(),status:Ke})}},status:{schema:Ke,kind:"push"},runtimeState:Ke},je=a({flags:I(e(),b()),deviceType:e().nullable(),model:e().nullable(),channelCount:t().nullable(),lastProbedAt:t(),lastFetchedAt:t()}),Vt={name:"feature-probe",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onProbeChanged:{data:a({deviceId:t(),status:je})}},status:{schema:je,kind:"push"},runtimeState:je},Da=a({co2Ppm:t().min(0).optional(),vocPpb:t().min(0).optional(),pm25:t().min(0).optional(),pm10:t().min(0).optional(),aqi:t().optional(),lastFetchedAt:t(),unit:e().optional(),precision:t().int().min(0).max(10).optional()}),wo={name:"air-quality-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:Da,kind:"push"},runtimeState:Da},Yc=a({id:e(),title:e(),description:e().optional(),style:S(["card","accordion"]).optional(),defaultCollapsed:g().optional(),columns:x([k(1),k(2),k(3),k(4)]).optional(),tab:e().optional(),location:S(["settings","top-tab"]).optional(),order:t().optional(),fields:p(ho())}),Jc=a({id:e(),label:e(),icon:e(),order:t().optional()}),Xc=a({tabs:p(Jc).optional(),sections:p(Yc)}),xa=Xc.nullable(),er={getDeviceSettingsContribution:{input:a({deviceId:t()}),output:xa,kind:"query",auth:"protected"},getDeviceLiveContribution:{input:a({deviceId:t()}),output:xa,kind:"query",auth:"protected"},applyDeviceSettingsPatch:{input:a({deviceId:t(),patch:I(e(),b())}),output:a({success:k(!0)}),kind:"mutation",auth:"admin"}},tr={getStatus:{input:a({deviceId:t()}),output:b().nullable(),kind:"query",auth:"protected"}};function Bv(i){let o=i.methods;return i.exposesDeviceSettings&&(o={...er,...o}),i.status&&(o={...tr,...o}),o}function r(i,o,n){return{input:i,output:o,kind:n?.kind??"query",auth:n?.auth??"protected",...n?.access!==void 0?{access:n.access}:{},timeoutMs:n?.timeoutMs}}function Y(i){return{data:i}}function qv(i){return i?.deviceConfig!==void 0}const ar=S(["disarmed","armed_home","armed_away","armed_night","armed_vacation","armed_custom_bypass","arming","disarming","pending","triggered"]),Co=S(["home","away","night","vacation","custom_bypass"]),Ta=a({state:ar,availableModes:p(Co),requiresCode:g(),lastChangedAt:t()}),Ao={name:"alarm-panel",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.AlarmPanel],methods:{arm:r(a({deviceId:t().int().nonnegative(),mode:Co,code:e().min(1).optional()}),u(),{kind:"mutation",auth:"admin"}),disarm:r(a({deviceId:t().int().nonnegative(),code:e().min(1).optional()}),u(),{kind:"mutation",auth:"admin"}),trigger:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"})},status:{schema:Ta,kind:"push"},runtimeState:Ta},Ea=a({lux:t().min(0),lastFetchedAt:t(),unit:e().optional(),precision:t().int().min(0).max(10).optional()}),No={name:"ambient-light-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:Ea,kind:"push"},runtimeState:Ea},nr=a({className:e(),hits:t().int().nonnegative(),avgScore:t().min(0).max(1),peakScore:t().min(0).max(1)}),Ra=a({ts:t().int(),windowSec:t().int().positive(),level:a({rms:t(),dbfs:t()}),peakDbfs:t(),avgDbfs:t(),current:a({className:e(),score:t().min(0).max(1),timestamp:t().int()}).nullable(),byClass:p(nr).readonly()}),or=a({ts:t().int(),dbfs:t().nullable(),peakDbfs:t(),avgDbfs:t(),topClass:e().nullable(),topScore:t().min(0).max(1).nullable()}),ir=a({points:p(or).readonly(),effectiveSampleEveryMs:t().int().positive(),windowMsActual:t().int().nonnegative()}),Po={name:"audio-metrics",scope:"device",mode:"singleton",deviceTypes:[f.Camera],methods:{getCurrentSnapshot:r(a({deviceId:t()}),Ra.nullable()),getHistory:r(a({deviceId:t(),windowSec:t().int().positive().optional(),sampleEveryMs:t().int().positive().optional()}),ir)},runtimeState:Ra},Ba=a({enabled:g(),isRunning:g(),lastTriggeredAt:t(),lastError:e().nullable(),lastChangedAt:t()}),Mo={name:"automation-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Automation],methods:{enable:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),disable:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),trigger:r(a({deviceId:t().int().nonnegative(),skipCondition:g().optional()}),u(),{kind:"mutation",auth:"admin"})},status:{schema:Ba,kind:"push"},runtimeState:Ba},Ge=a({percentage:t().min(0).max(100),charging:S(["dc","solar","none"]),sleeping:g(),lastUpdated:t(),binary:g().optional()}),Do={name:"battery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera,f.Sensor,f.Button,f.Switch],methods:{wakeForStream:r(a({deviceId:t(),timeoutMs:t().int().min(500).max(3e4).default(8e3)}),a({awoke:g(),durationMs:t()}),{kind:"mutation"})},events:{onStatusChanged:{data:a({deviceId:t(),status:Ge})}},status:{schema:Ge,kind:"push"},runtimeState:Ge},qa=a({on:g(),lastChangedAt:t()}),xo={name:"binary",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:qa,kind:"push"},runtimeState:qa},Oa=a({percentage:t().min(0).max(100),lastChangedAt:t()}),To={name:"brightness",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Light],methods:{setBrightness:r(a({deviceId:t().int().nonnegative(),percentage:t().min(0).max(100)}),u(),{kind:"mutation",auth:"admin"})},events:{onBrightnessChanged:{data:a({deviceId:t(),percentage:t().min(0).max(100),lastChangedAt:t()})}},status:{schema:Oa,kind:"command-driven"},runtimeState:Oa},Kt=S(["webrtc","hls","mjpeg","rtsp"]),sr=a({streamId:e(),format:Kt,url:e().nullable(),active:g()}),cr={name:"streaming-engine",scope:"system",mode:"singleton",internal:!0,methods:{registerStream:r(a({streamId:e(),sourceUrl:e(),codec:e().optional()}),u(),{kind:"mutation"}),unregisterStream:r(a({streamId:e()}),u(),{kind:"mutation"}),getStreamUrl:r(a({streamId:e(),format:Kt}),e().nullable()),listStreams:r(u(),p(sr))}},kt=a({brokerId:e(),url:e(),mutedUrl:e(),enabled:g(),codec:e().optional(),resolution:a({width:t().int().positive(),height:t().int().positive()}).optional()}),rr=a({sessionId:e(),remoteAddr:e(),playing:g(),muted:g(),connectedAt:t(),lastRtpAt:t(),bytesSent:t()}),dr=a({tag:e(),subscribedAt:t(),maxFps:t(),framesDelivered:t(),framesDropped:t()}),lr=a({tag:e(),subscribedAt:t(),chunksDelivered:t()}),pr=S(["alexa","homekit","webrtc-browser","webrtc-mobile","webrtc-whep","rtsp-listen","derived-broker","recording","pipeline","snapshot","warmup","unknown"]),wt=a({kind:pr,label:e().optional(),media:S(["audio","video","both"]).optional(),targetCodec:e().optional(),transport:S(["passthrough","repacketize","transcode"]).optional(),remoteAddr:e().optional(),userAgent:e().optional(),userId:e().optional(),sessionId:e().optional(),extra:I(e(),e()).optional()}).readonly(),mr=a({id:e(),channel:S(["annexb","rtp"]),attribution:wt,subscribedAt:t(),packetsDelivered:t()}),ur=a({rtsp:p(rr).readonly(),decoded:p(dr).readonly(),audio:p(lr).readonly(),encoded:p(mr).readonly(),pipeClients:t(),encodedSubscribers:t()}),Ov=S(["reconnecting","sleeping","offline","disabled","waking"]),gr=S(["h264","h265","copy"]),hr=S(["aac","opus","pcmu","copy","none"]),vr=a({deviceId:t().int().nonnegative(),video:gr,audio:hr.optional(),profile:L.optional(),targetResolution:a({width:t().int().positive(),height:t().int().positive()}).optional(),outputArgs:p(e()).optional(),audioEgress:g().optional(),tag:e().optional()}),yr=a({url:e(),videoCodec:S(["H264","H265"]),audioCodec:e(),resolution:a({width:t().int().positive(),height:t().int().positive()}),transcoded:g(),encoder:e(),pipelineKey:e()}),Sr={name:"stream-broker",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{publishCameraStream:r(a({deviceId:t().int().nonnegative(),camStreamId:e().min(1),kind:Ht,url:e().optional(),codec:e().optional(),resolution:ie.optional(),fps:t().positive().optional(),label:e().optional(),deviceFeatures:p(e()).optional(),autoEligible:g().optional(),metadata:I(e(),b()).optional(),sourceCamStreamId:e().min(1).optional(),encodeProfile:Hc.optional()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),retractCameraStream:r(a({deviceId:t().int().nonnegative(),camStreamId:e().min(1)}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),assignProfile:r(a({deviceId:t().int().nonnegative(),profile:L,camStreamId:e().min(1)}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),unassignProfile:r(a({deviceId:t().int().nonnegative(),profile:L}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),listAllCameraStreams:r(u(),p(St).readonly()),listAllProfileSlots:r(u(),p(ft).readonly()),getBrokerStats:r(a({brokerId:e()}),Tc),listClients:r(a({brokerId:e()}),ur),killClient:r(a({brokerId:e(),channel:S(["rtsp","decoded","audio"]),handle:e()}),a({killed:g()}),{kind:"mutation",auth:"admin"}),restartProfile:r(a({deviceId:t().int().nonnegative(),profile:L}),a({success:g()}),{kind:"mutation",auth:"admin"}),getStreamUrl:r(a({streamId:e(),format:Kt}),a({url:e()})),getStreamWithCodec:r(vr,yr,{kind:"mutation",auth:"admin"}),releaseStreamWithCodec:r(a({pipelineKey:e()}),a({released:g(),refcount:t().int().nonnegative()}),{kind:"mutation",auth:"admin"}),subscribeAudioChunks:r(Mc,Dc,{kind:"mutation"}),pullAudioChunks:r(a({subscriptionId:e(),maxCount:t().int().positive().default(8)}),p(Pc).readonly()),unsubscribeAudioChunks:r(a({subscriptionId:e()}),a({released:g()}),{kind:"mutation"}),subscribeFrames:r(Ac,Nc,{kind:"mutation"}),pullFrameHandles:r(a({subscriptionId:e(),maxCount:t().int().positive().default(4)}),p(bt).readonly()),unsubscribeFrames:r(a({subscriptionId:e()}),a({released:g()}),{kind:"mutation"}),setPreBufferDuration:r(a({brokerId:e(),seconds:t().min(0).max(30)}),u(),{kind:"mutation",auth:"admin"}),getPreBufferInfo:r(a({brokerId:e()}),a({configuredSec:t(),bufferedMs:t(),packetCount:t()})),getRtspPort:r(u(),t()),getAllRtspEntries:r(a({hostname:e().optional()}),p(kt).readonly()),getRtspEntry:r(a({brokerId:e(),hostname:e().optional()}),kt.nullable()),regenerateRtspToken:r(a({brokerId:e()}),e().nullable(),{kind:"mutation",auth:"admin"}),setRtspEnabled:r(a({brokerId:e(),enabled:g()}),u(),{kind:"mutation",auth:"admin"}),isRtspEnabled:r(a({brokerId:e()}),g())},events:{onCamStreamDemand:Y(a({deviceId:t().int().nonnegative(),camStreamId:e(),profile:L})),onCamStreamIdle:Y(a({deviceId:t().int().nonnegative(),camStreamId:e()})),onRequestStreamSourceRefresh:Y(a({deviceId:t().int().nonnegative(),camStreamId:e(),brokerId:e()}))}},fr=["h264","h265","hevc","av1","mjpeg","vp8","vp9"],La=S(fr),br=a({acceptCodecs:p(La).readonly().optional(),minHeight:t().int().positive().optional(),minWidth:t().int().positive().optional(),excludeDerived:g().optional(),requireSiblingCodec:p(La).readonly().optional()}).readonly(),Ir=a({preferredProviders:p(e()).readonly().optional(),resolutionPreference:S(["highest","lowest"]).optional()}).readonly(),kr=a({camStreamId:e(),codec:e().optional(),resolution:ie.optional(),reason:e()}),Eo={name:"camera-streams",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[f.Camera],methods:{getCameraStreams:r(a({deviceId:t().int().nonnegative()}),p(St).readonly()),getBrokerStreams:r(a({deviceId:t().int().nonnegative()}),p(ft).readonly()),getRtspEntries:r(a({deviceId:t().int().nonnegative(),hostname:e().optional()}),p(kt).readonly()),getProfileRtspEntries:r(a({deviceId:t().int().nonnegative(),hostname:e().optional()}),p(Ec).readonly()),pickStream:r(a({deviceId:t().int().nonnegative(),requirements:br,preferences:Ir.optional()}),kr.nullable())},events:{onCamStreamsChanged:Y(a({deviceId:t().int().nonnegative(),camStreams:p(St).readonly()})),onProfileSlotsChanged:Y(a({deviceId:t().int().nonnegative(),profileSlots:p(ft).readonly()}))},runtimeState:a({online:g(),slotStatuses:a({high:Pe.optional(),mid:Pe.optional(),low:Pe.optional()}),slotErrors:a({high:e().optional(),mid:e().optional(),low:e().optional()}),lastChangedAt:t()})},za=a({detected:g(),lastChangedAt:t()}),Ro={name:"carbon-monoxide",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:za,kind:"push"},runtimeState:za},Ct=S(["off","heat","cool","auto","heat_cool","fan_only","dry"]),Ua=a({mode:Ct,availableModes:p(Ct),fanMode:e(),availableFanModes:p(e()),preset:e(),availablePresets:p(e()),target:t().nullable(),targetHigh:t().nullable(),targetLow:t().nullable(),targetHumidity:t().min(0).max(100).nullable(),currentTemp:t().nullable(),currentHumidity:t().min(0).max(100).nullable(),lastFetchedAt:t()}),Bo={name:"climate-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Thermostat],methods:{setMode:r(a({deviceId:t().int().nonnegative(),mode:Ct}),u(),{kind:"mutation",auth:"admin"}),setFanMode:r(a({deviceId:t().int().nonnegative(),fanMode:e().min(1)}),u(),{kind:"mutation",auth:"admin"}),setPreset:r(a({deviceId:t().int().nonnegative(),preset:e().min(1)}),u(),{kind:"mutation",auth:"admin"}),setTarget:r(a({deviceId:t().int().nonnegative(),target:t()}),u(),{kind:"mutation",auth:"admin"}),setTargetRange:r(a({deviceId:t().int().nonnegative(),targetLow:t(),targetHigh:t()}),u(),{kind:"mutation",auth:"admin"}),setTargetHumidity:r(a({deviceId:t().int().nonnegative(),targetHumidity:t().min(0).max(100)}),u(),{kind:"mutation",auth:"admin"})},status:{schema:Ua,kind:"push"},runtimeState:Ua},jt=a({r:t().int().min(0).max(255),g:t().int().min(0).max(255),b:t().int().min(0).max(255)}),Gt=a({h:t().min(0).max(360),s:t().min(0).max(100),v:t().min(0).max(100)}),wr=U("mode",[a({mode:k("rgb"),rgb:jt}),a({mode:k("hsv"),hsv:Gt}),a({mode:k("mired"),mireds:t().int().min(50).max(1e3)})]),_a=a({mode:S(["rgb","hsv","mired"]),rgb:jt.optional(),hsv:Gt.optional(),mireds:t().int().optional(),lastChangedAt:t()}),qo={name:"color",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Light],methods:{setColor:r(a({deviceId:t().int().nonnegative(),color:wr}),u(),{kind:"mutation",auth:"admin"})},events:{onColorChanged:{data:a({deviceId:t(),mode:S(["rgb","hsv","mired"]),rgb:jt.optional(),hsv:Gt.optional(),mireds:t().int().optional(),lastChangedAt:t()})}},status:{schema:_a,kind:"command-driven"},runtimeState:_a},Fa=a({connected:g(),lastChangedAt:t()}),Oo={name:"connectivity",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:Fa,kind:"push"},runtimeState:Fa},Cr=a({key:e().min(1),label:e().min(1),level:t().min(0).max(100).nullable(),status:S(["ok","replace"]).nullable(),lastResetAt:t().nullable(),resettable:g()}),Ha=a({items:p(Cr),lastChangedAt:t()}),Lo={name:"consumables",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera,f.Hub,f.Light,f.Siren,f.Switch,f.Sensor,f.Thermostat,f.Button,f.EventEmitter,f.Update,f.Generic,f.Notifier,f.Script,f.Automation,f.Lock,f.Cover,f.Valve,f.Humidifier,f.WaterHeater,f.Fan,f.MediaPlayer,f.AlarmPanel,f.Control,f.Presence,f.Weather,f.Vacuum,f.LawnMower,f.Container,f.Image],deviceConfig:{ui:{kind:"widget",widgetId:"host/consumables-panel",tab:"consumables",topTab:!0,label:"Consumables",order:5}},methods:{reset:r(a({deviceId:t().int().nonnegative(),key:e().min(1)}),u(),{kind:"mutation",auth:"admin"})},status:{schema:Ha,kind:"push"},runtimeState:Ha.extend({lastFetchedAt:t()})},$a=a({entryOpen:g(),lastChangedAt:t()}),zo={name:"contact",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:$a,kind:"push"},runtimeState:$a},Ar=S(["numeric","select","text","datetime"]),Wa=a({kind:Ar,value:x([t(),e()]),options:p(e()),lastChangedAt:t(),unit:e().optional(),min:t().optional(),max:t().optional(),step:t().optional(),precision:t().int().min(0).max(10).optional(),format:S(["date","time","datetime"]).optional()}),Nr=U("kind",[a({kind:k("numeric"),value:t()}),a({kind:k("select"),value:e().min(1)}),a({kind:k("text"),value:e()}),a({kind:k("datetime"),value:e().min(1)})]),Uo={name:"control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Control],methods:{setValue:r(a({deviceId:t().int().nonnegative(),control:Nr}),u(),{kind:"mutation",auth:"admin"})},status:{schema:Wa,kind:"push"},runtimeState:Wa},Pr=S(["open","opening","closing","closed","stopped"]),Va=a({state:Pr,position:t().min(0).max(100).nullable(),tiltPosition:t().min(0).max(100).nullable(),lastChangedAt:t()}),_o={name:"cover",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Cover],methods:{open:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),close:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),stop:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),setPosition:r(a({deviceId:t().int().nonnegative(),position:t().min(0).max(100)}),u(),{kind:"mutation",auth:"admin"}),setTiltPosition:r(a({deviceId:t().int().nonnegative(),tiltPosition:t().min(0).max(100)}),u(),{kind:"mutation",auth:"admin"})},status:{schema:Va,kind:"push"},runtimeState:Va},se=a({id:e(),system:e(),uniqueId:e().optional(),raw:I(e(),b()).optional()});function Mr(i){return{id:i.stableId,system:i.addonId}}function Dr(i,o){const n={...i};for(const[d,l]of Object.entries(o))if(l!==void 0){if(d==="raw"&&typeof l=="object"&&l!==null){n.raw={...i.raw??{},...l};continue}n[d]=l}return n}function Lv(i){if(i==null)return;const o=i.trim();if(o==="")return;const n=o.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":o}const Fo="sourceInfo";function xr(i){if(!i)return null;const o=i[Fo];if(!o)return null;const n=se.safeParse(o);return n.success?n.data:null}const Tr=S(["online","sleeping","offline","unknown"]),ne=_e(()=>a({childNativeId:e(),name:e(),type:S(f),status:Tr,metadata:a({model:e().optional(),serialNumber:e().optional(),uid:e().optional(),rtspChannel:t().int().nonnegative().optional(),isBattery:g().optional(),isDoorbell:g().optional(),isMultifocal:g().optional(),externalLocation:e().optional(),manufacturer:e().optional(),integration:e().optional()}).default({}),alreadyAdopted:g(),adoptedDeviceId:t().int().nonnegative().nullable(),capabilities:p(e()).readonly().optional(),features:p(e()).readonly().optional(),sourceInfo:se.optional(),children:p(ne).readonly().optional()})),Ka=a({discovered:p(ne),lastDiscoveryAt:t().int().nonnegative().nullable(),lastError:e().nullable()}),Ho={name:"device-discovery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Hub],status:{schema:Ka,kind:"poll"},runtimeState:Ka.extend({lastFetchedAt:t().int().nonnegative()}),methods:{listDiscovered:r(a({deviceId:t().int().nonnegative()}),p(ne).readonly()),refreshDiscovery:r(a({deviceId:t().int().nonnegative()}),p(ne).readonly(),{kind:"mutation",auth:"admin"}),adoptDevice:r(a({deviceId:t().int().nonnegative(),childNativeId:e(),name:e().optional()}),a({deviceId:t().int().nonnegative(),stableId:e()}),{kind:"mutation",auth:"admin"}),releaseDevice:r(a({deviceId:t().int().nonnegative(),childDeviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"})}},ja=a({lastPressedAt:t().nullable(),pressCountSinceStart:t()}),Er=a({deviceId:t(),timestamp:t()}),$o={name:"doorbell",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Button],methods:{},events:{onPressed:{data:Er}},status:{schema:ja,kind:"push"},runtimeState:ja},Rr=S(["date","time","datetime"]),Ga=a({value:e(),format:Rr.optional(),lastFetchedAt:t()}),Wo={name:"enum-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:Ga,kind:"push"},runtimeState:Ga},Vo=a({deviceId:t(),eventType:e(),data:I(e(),b()).nullable(),timestamp:t(),seq:t()}),Za=a({eventTypes:p(e()),lastEvent:Vo.nullable(),eventCountSinceStart:t()}),Ko={name:"event-emitter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.EventEmitter],methods:{},events:{onEvent:{data:Vo}},status:{schema:Za,kind:"push"},runtimeState:Za},jo=S(["forward","reverse"]),Qa=a({percentage:t().min(0).max(100).nullable(),percentageStep:t().positive().optional(),preset:e(),availablePresets:p(e()),direction:jo.nullable(),oscillating:g().nullable(),lastChangedAt:t()}),Go={name:"fan-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Fan],methods:{setPercentage:r(a({deviceId:t().int().nonnegative(),percentage:t().min(0).max(100)}),u(),{kind:"mutation",auth:"admin"}),setPreset:r(a({deviceId:t().int().nonnegative(),preset:e().min(1)}),u(),{kind:"mutation",auth:"admin"}),setDirection:r(a({deviceId:t().int().nonnegative(),direction:jo}),u(),{kind:"mutation",auth:"admin"}),setOscillating:r(a({deviceId:t().int().nonnegative(),oscillating:g()}),u(),{kind:"mutation",auth:"admin"})},status:{schema:Qa,kind:"push"},runtimeState:Qa},Ya=a({flooded:g(),lastChangedAt:t()}),Zo={name:"flood",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:Ya,kind:"push"},runtimeState:Ya},Ja=a({detected:g(),lastChangedAt:t()}),Qo={name:"gas",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:Ja,kind:"push"},runtimeState:Ja},Xa=a({on:g(),currentHumidity:t().min(0).max(100).nullable(),targetHumidity:t().min(0).max(100).nullable(),mode:e().nullable(),availableModes:p(e()),action:e().nullable(),minHumidity:t().nullable(),maxHumidity:t().nullable(),lastChangedAt:t()}),Yo={name:"humidifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Humidifier],methods:{setOn:r(a({deviceId:t().int().nonnegative(),on:g()}),u(),{kind:"mutation",auth:"admin"}),setTargetHumidity:r(a({deviceId:t().int().nonnegative(),humidity:t().min(0).max(100)}),u(),{kind:"mutation",auth:"admin"}),setMode:r(a({deviceId:t().int().nonnegative(),mode:e().min(1)}),u(),{kind:"mutation",auth:"admin"})},status:{schema:Xa,kind:"push"},runtimeState:Xa},en=a({percent:t().min(0).max(100),lastFetchedAt:t(),unit:e().optional(),precision:t().int().min(0).max(10).optional()}),Jo={name:"humidity-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor,f.Thermostat],methods:{},status:{schema:en,kind:"push"},runtimeState:en},tn=a({url:e().nullable(),lastUpdated:t().nullable()}),Xo={name:"image",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Image],methods:{},status:{schema:tn,kind:"push"},runtimeState:tn},Br=S(["idle","mowing","paused","docked","error"]),an=a({activity:Br,batteryLevel:t().min(0).max(100).nullable(),lastChangedAt:t()}),ei={name:"lawn-mower-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.LawnMower],methods:{startMowing:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),pause:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),dock:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"})},status:{schema:an,kind:"push"},runtimeState:an},qr=S(["locked","unlocked","locking","unlocking","jammed"]),nn=a({state:qr,lastChangedAt:t()}),ti={name:"lock-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Lock],methods:{lock:r(a({deviceId:t().int().nonnegative(),code:e().min(1).optional()}),u(),{kind:"mutation",auth:"admin"}),unlock:r(a({deviceId:t().int().nonnegative(),code:e().min(1).optional()}),u(),{kind:"mutation",auth:"admin"}),open:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"})},status:{schema:nn,kind:"push"},runtimeState:nn},Or=S(["off","on","idle","playing","paused","buffering","standby"]),ai=S(["off","all","one"]),Lr=a({type:e(),title:e(),artist:e().optional(),album:e().optional(),imageUrl:e().optional()}),on=a({state:Or,volumeLevel:t().min(0).max(100).nullable(),isMuted:g().nullable(),source:e(),availableSources:p(e()),currentMedia:Lr.nullable(),positionMs:t().int().nonnegative().nullable(),durationMs:t().int().nonnegative().nullable(),shuffle:g().nullable(),repeat:ai.nullable(),lastChangedAt:t()}),ni={name:"media-player",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.MediaPlayer],methods:{play:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),pause:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),stop:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),next:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),previous:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),seek:r(a({deviceId:t().int().nonnegative(),positionMs:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),setVolume:r(a({deviceId:t().int().nonnegative(),volumeLevel:t().min(0).max(100)}),u(),{kind:"mutation",auth:"admin"}),setMute:r(a({deviceId:t().int().nonnegative(),muted:g()}),u(),{kind:"mutation",auth:"admin"}),setShuffle:r(a({deviceId:t().int().nonnegative(),shuffle:g()}),u(),{kind:"mutation",auth:"admin"}),setRepeat:r(a({deviceId:t().int().nonnegative(),repeat:ai}),u(),{kind:"mutation",auth:"admin"}),selectSource:r(a({deviceId:t().int().nonnegative(),source:e().min(1)}),u(),{kind:"mutation",auth:"admin"}),playMedia:r(a({deviceId:t().int().nonnegative(),mediaId:e().min(1),mediaType:e().min(1)}),u(),{kind:"mutation",auth:"admin"})},status:{schema:on,kind:"push"},runtimeState:on},zr=S(["jpeg","rgb","bgr","yuv420","gray"]),Me=a({data:F(),format:zr,width:t(),height:t(),timestamp:t()}),ce=a({x:t(),y:t(),w:t(),h:t()}),Ur=a({class:e(),originalClass:e(),score:t(),bbox:ce}),sn=a({data:T(Uint8Array),sampleRate:t(),channels:t(),timestamp:t(),deviceId:t().optional()}),_r=a({rms:t(),dbfs:t()}),At=a({className:e(),originalClass:e().optional(),score:t()}),qe=a({bbox:ce,pixelCount:t(),intensity:t()}),Fr=a({detected:g(),regionCount:t(),regions:p(qe).readonly(),rawRegions:p(qe).readonly(),frameWidth:t(),frameHeight:t(),analysisMs:t()}),Hr={name:"motion-detection",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,exposesDeviceSettings:!0,methods:{analyze:r(a({deviceId:t(),frame:Me}),Fr,{kind:"mutation"}),removeCamera:r(a({deviceId:t()}),u(),{kind:"mutation"}),reset:r(u(),u(),{kind:"mutation"})},events:{onMotion:{data:a({deviceId:t(),detected:g(),regionCount:t()})}}},zv=a({activeCameras:t(),throttledCameras:t(),avgInferenceTimeMs:t(),queueDepth:t()}),Zt=a({detectionMode:S(["disabled","always-on","on-motion"]),configuredFps:t(),actualFps:t(),queueDepth:t(),avgInferenceTimeMs:t(),droppedFrames:t(),phase:S(["idle","watching","active"])}),$r=Zt.extend({deviceId:t()}),Nt=S(["onnx","coreml","openvino","tflite","pt"]),ye=S(["detector","cropper","classifier","refiner","audio-classifier"]),R=a({runtime:S(["node","python"]),backend:e(),format:Nt,device:e().optional()}),Wr=a({id:e(),label:e(),description:e().optional()}),Vr=a({engine:R,devices:p(Wr).readonly(),defaultDevice:e()}),Pt=_e(()=>a({addonId:e(),addonName:e(),slot:ye,inputClasses:p(e()).readonly(),outputClasses:p(e()).readonly(),enabled:g(),modelId:e(),children:p(Pt).readonly(),engine:R.optional(),group:e().optional(),settings:I(e(),b()).optional()})),Oe=_e(()=>a({addonId:e(),enabled:g(),modelId:e(),children:p(Oe).readonly(),settings:I(e(),b()).optional()})),Ze=a({id:e(),name:e(),createdAt:e(),updatedAt:e(),engine:R,steps:p(Oe).readonly()}),Kr=a({id:e(),name:e(),formats:I(e(),a({downloaded:g(),sizeMB:t()}))}),jr=F(),Gr=a({id:e(),name:e(),slot:ye,inputClasses:p(e()).readonly(),outputClasses:p(e()).readonly(),childSlots:p(ye).readonly(),models:p(Kr).readonly(),defaultModelId:e(),defaultModelIdByFormat:I(e(),e()).optional(),enabledByDefault:g().optional(),defaultConfidence:t(),group:e().optional(),configSchema:p(jr).readonly().optional()}),Zr=a({id:ye,label:e(),priority:t(),parentSlot:ye.nullable(),addons:p(Gr).readonly()}),Qr=a({availableEngines:p(Vr).readonly(),selectedEngine:R,slots:p(Zr).readonly()}),Yr=a({detections:p(Ur).readonly(),inferenceMs:t(),modelId:e()}),oe=_e(()=>a({addonId:e(),modelId:e(),enabled:g().default(!0),children:p(oe).optional(),settings:I(e(),b()).optional()})),Jr=a({filename:e(),stepIds:p(e()).readonly().optional()}),Xr=a({base64:e(),filename:e()}),ed=a({filename:e(),sizeKb:t()}),td=a({base64:e()}),ad=a({id:e(),name:e(),description:e(),available:g(),rawLabels:p(e()).readonly().optional()}),nd=a({activeBackend:e(),availableBackends:p(ad).readonly(),sampleRate:t(),chunkDurationMs:t()}),od=a({filePath:e(),sizeMB:t(),durationMs:t()}),id=a({success:g(),error:e().optional(),frame:F().optional()}),sd=F(),cd=F(),rd=F(),dd=F(),ld=F(),cn=F(),pd={name:"pipeline-executor",scope:"system",mode:"singleton",methods:{getAvailableEngines:r(u(),p(R)),getSelectedEngine:r(u(),R),getDefaultSteps:r(R,p(Pt)),reprobeEngine:r(u(),R,{kind:"mutation",auth:"admin"}),getVideoPipelineSteps:r(u(),I(e(),a({modelId:e(),settings:I(e(),b()).readonly()}))),setVideoPipelineSteps:r(a({steps:I(e(),a({modelId:e(),settings:I(e(),b()).readonly()}))}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),getSchema:r(u(),Qr),getGlobalSteps:r(u(),p(Pt).readonly().nullable()),getGlobalPipelineConfig:r(u(),sd),getOrchestratorConfigSchema:r(u(),cd),listTemplates:r(u(),p(Ze).readonly()),saveTemplate:r(a({name:e(),steps:p(Oe).readonly(),engine:R}),Ze,{kind:"mutation"}),updateTemplate:r(a({id:e(),name:e().optional(),steps:p(Oe).readonly().optional()}),Ze,{kind:"mutation"}),deleteTemplate:r(a({id:e()}),u(),{kind:"mutation"}),getCapabilities:r(u(),dd),getAddonModels:r(a({addonId:e()}),ld),downloadModel:r(a({addonId:e(),modelId:e(),format:Nt}),od,{kind:"mutation"}),deleteModel:r(a({addonId:e(),modelId:e(),format:Nt}),a({success:k(!0)}),{kind:"mutation"}),detect:r(a({addonId:e(),frame:Me,config:I(e(),b()).optional()}),Yr),runPipeline:r(a({engine:R.optional(),steps:p(oe).min(1),frame:Me.optional(),imageBase64:e().optional(),image:T(Uint8Array).optional(),referenceImage:e().optional(),deviceId:t().optional(),sessionId:e().optional()}),cn,{kind:"mutation"}),runPipelineBatch:r(a({engine:R.optional(),steps:p(oe).min(1),frames:p(Me).min(1).max(255),deviceId:t().optional(),sessionId:e().optional()}),a({results:p(cn).readonly()}),{kind:"mutation"}),cacheFrameInPool:r(a({data:T(Uint8Array),width:t().int().positive(),height:t().int().positive(),format:S(["rgb","bgr","gray"])}),a({frameId:t(),width:t(),height:t()}),{kind:"mutation"}),inferCached:r(a({stepId:e(),frameId:t().int()}),I(e(),b()),{kind:"mutation"}),uncacheFrame:r(a({frameId:t().int()}),u(),{kind:"mutation"}),getEffectiveTuning:r(u(),a({batchMode:e(),windowMs:t(),maxBatchSize:t(),concurrency:t()})),listLoadedEngines:r(u(),p(a({engineKey:e(),engine:R,modelsLoaded:p(e()).readonly(),inUseByCameras:p(t()).readonly(),kind:S(["runtime","warm-override"]),poolPid:t().nullable(),idleMs:t().nullable(),idleTtlMs:t().nullable()})).readonly()),spinEngine:r(a({engine:R}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),killEngine:r(a({engine:R,force:g().optional()}),a({success:g(),reason:e().optional()}),{kind:"mutation",auth:"admin"}),listReferenceImages:r(u(),p(Jr).readonly()),getReferenceImage:r(a({filename:e()}),Xr.nullable()),getReferenceAudioFiles:r(u(),p(ed).readonly()),getReferenceAudio:r(a({filename:e()}),td.nullable()),getAudioCapabilities:r(u(),nd),runAudioTest:r(a({addonId:e(),modelId:e(),filename:e().optional(),settings:I(e(),b()).optional()}),id,{kind:"mutation"}),getDetectionConfigSchema:r(u(),rd)}},md=S(["polygon","tripwire"]),ud=a({x:t(),y:t()}),ue=a({id:e(),name:e(),kind:md.default("polygon"),polygon:p(ud).readonly(),color:e().default("#3b82f6")}),oi={name:"zones",scope:"device",mode:"singleton",deviceTypes:[f.Camera],methods:{listZones:r(a({deviceId:t()}),p(ue).readonly()),addZone:r(a({deviceId:t(),zone:ue}),u(),{kind:"mutation",auth:"admin"}),removeZone:r(a({deviceId:t(),zoneId:e()}),u(),{kind:"mutation",auth:"admin"}),updateZone:r(a({deviceId:t(),zone:ue}),u(),{kind:"mutation",auth:"admin"})},runtimeState:a({zones:p(ue).readonly()})},X={min:0,max:6e4,default:3e4,step:500},Z={min:1,max:30,default:4,step:1},Q={min:1,max:30,default:10,step:1},Qt=S(["onboard","analyzer"]),gd=p(Qt),hd=a({deviceId:t(),detected:g(),source:Qt.default("analyzer"),regions:p(qe).readonly().optional()}),vd=a({deviceId:t(),detectionMode:S(["disabled","always-on","on-motion"]).default("on-motion"),audioMode:S(["disabled","always-on","on-motion"]).default("always-on"),motionCooldownMs:t().min(X.min).default(X.default),motionFps:t().min(Z.min).max(Z.max).default(Z.default),detectionFps:t().min(Q.min).max(Q.max).default(Q.default),motionStreamId:e(),detectionStreamId:e(),motionSources:gd.default(["analyzer"]),pipelineEnabled:g().default(!0),engine:R.optional(),steps:p(oe).readonly().optional(),audio:a({engine:R,modelId:e(),enabled:g()}).nullable().optional(),zones:p(ue).readonly().default([]),onboardMotionDrivesAnalyzer:g().default(!0)}),Uv=[{key:"motionSources",type:"multiselect",label:"Motion Sources",default:["analyzer"],options:[{value:"analyzer",label:"Frame-diff Analyzer (motion addon)"},{value:"onboard",label:"Camera Onboard Sensor"}]},{key:"motionFps",type:"slider",label:"Motion FPS (analyzer)",min:Z.min,max:Z.max,step:Z.step,default:Z.default,showValue:!0,unit:"fps",showWhen:{field:"motionSources",includes:"analyzer"}},{key:"detectionFps",type:"slider",label:"Detection FPS",min:Q.min,max:Q.max,step:Q.step,default:Q.default,showValue:!0,unit:"fps"},{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:X.min,max:X.max,step:X.step,default:X.default,showValue:!0,unit:"s",displayScale:1e3},{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"}}],ii=a({nodeId:e(),attachedCameras:t(),activeCameras:t(),avgInferenceFps:t(),avgInferenceTimeMs:t(),queueDepthTotal:t(),hardware:a({hasGpu:g(),inferenceBackend:e().optional(),cpuCores:t().optional()})}),yd=a({nodeId:e(),activeCameras:t(),throttledCameras:t(),avgInferenceTimeMs:t(),queueDepth:t()}),Sd={name:"pipeline-runner",scope:"system",mode:"singleton",methods:{attachCamera:r(vd,a({success:k(!0)}),{kind:"mutation"}),detachCamera:r(a({deviceId:t()}),a({success:k(!0)}),{kind:"mutation"}),reportMotion:r(hd,a({success:k(!0)}),{kind:"mutation"}),getLocalLoad:r(u(),ii),getLocalMetrics:r(u(),yd),getCameraMetrics:r(a({deviceId:t()}),Zt.nullable()),getAllCameraMetrics:r(u(),p($r).readonly()),getLocalCameras:r(u(),p(t()).readonly())}},rn=a({detected:g(),lastDetectedAt:t().nullable(),autoClearAfterMs:t().nullable()}),fd=a({deviceId:t(),detected:g(),timestamp:t(),source:Qt,regions:p(qe).readonly().optional()}),si={name:"motion",scope:"device",mode:"singleton",deviceTypes:[f.Camera,f.Sensor],methods:{isDetected:r(a({deviceId:t()}),g())},events:{onMotionChanged:{data:fd}},status:{schema:rn,kind:"push"},runtimeState:rn},ci=a({enabled:g(),lastChangedAt:t()}),bd=ci.extend({lastFetchedAt:t()}),ri={name:"motion-trigger",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Light,f.Siren,f.Switch],methods:{setMotionTrigger:r(a({deviceId:t().int().nonnegative(),enabled:g()}),u(),{kind:"mutation",auth:"admin"})},events:{onMotionTriggerChanged:{data:a({deviceId:t(),enabled:g(),lastChangedAt:t()})}},status:{schema:ci,kind:"command-driven"},runtimeState:bd},di=a({x:t(),y:t()}),li=a({kind:k("rect"),x:t(),y:t(),width:t(),height:t()}),pi=a({kind:k("polygon"),points:p(di)}),mi=a({kind:k("grid"),gridWidth:t(),gridHeight:t(),cells:p(g())}),Id=a({kind:k("line"),points:p(di)}),_v=U("kind",[li,pi,mi,Id]),ui=S(["rect","polygon","grid","line"]),kd=a({min:t(),max:t()}),wd=a({width:t(),height:t()}),gi=a({id:t(),enabled:g(),shape:mi}),dn=a({enabled:g(),sensitivity:t(),regions:p(gi),lastFetchedAt:t()}),Cd=a({maxRegions:t(),supportedShapes:p(ui),grid:wd,sensitivity:a({min:t(),max:t(),step:t()})}),Ad=a({enabled:g().optional(),sensitivity:t().optional(),regions:p(gi).optional()}),hi={name:"motion-zones",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/motion-zones-grid",tab:"motion",label:"Motion Zones"}},methods:{getOptions:r(a({deviceId:t()}),Cd),setZone:r(a({deviceId:t(),patch:Ad}),u(),{kind:"mutation",auth:"admin"})},status:{schema:dn,kind:"poll"},runtimeState:dn},Mt=S(["person","vehicle","animal","face","package","other"]),vi=a({class:Mt,timestamp:t(),confidence:t().min(0).max(1).optional()}),yi=a({lastByClass:lc(Mt,vi.nullable()),supportedClasses:p(Mt).readonly(),enabled:g()}),Nd=yi.extend({lastFetchedAt:t()}),Si={name:"native-object-detection",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera],methods:{setEnabled:r(a({deviceId:t(),enabled:g()}),u(),{kind:"mutation",auth:"admin"})},events:{onDetected:{data:a({deviceId:t(),detection:vi})}},status:{schema:yi,kind:"push"},runtimeState:Nd},Pd=S(["min","low","normal","high"]),Md=a({id:e().min(1),title:e().min(1),uri:mc().optional(),destructive:g().optional()}),Dd=a({image:g(),priority:g(),data:g(),actions:g(),recipients:g()}),ln=a({lastSentAt:t(),lastError:e().nullable(),queueDepth:t().int().nonnegative(),supports:Dd}),xd=a({deviceId:t().int().nonnegative(),title:e().optional(),body:e().min(1),image:e().optional(),priority:Pd.optional(),channel:e().optional(),recipients:p(e()).optional(),actions:p(Md).optional(),data:I(e(),b()).optional()}),Td=a({notificationId:e(),acceptedAt:t()}),fi={name:"notifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Notifier],methods:{send:r(xd,Td,{kind:"mutation",auth:"admin"}),cancel:r(a({deviceId:t().int().nonnegative(),notificationId:e().min(1)}),u(),{kind:"mutation",auth:"admin"})},events:{onSent:{data:a({deviceId:t(),notificationId:e(),success:g(),error:e().nullable(),acceptedAt:t()})}},status:{schema:ln,kind:"command-driven"},runtimeState:ln},pn=a({value:t(),unit:e().optional(),precision:t().int().min(0).max(10).optional(),lastFetchedAt:t()}),bi={name:"numeric-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:pn,kind:"push"},runtimeState:pn},mn=a({watts:t().optional(),kwhTotal:t().optional(),volts:t().optional(),amps:t().optional(),va:t().optional(),powerFactor:t().min(0).max(1).optional(),lastFetchedAt:t(),unit:e().optional(),precision:t().int().min(0).max(10).optional()}),Ii={name:"power-meter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:mn,kind:"push"},runtimeState:mn},Ed=a({latitude:t().min(-90).max(90),longitude:t().min(-180).max(180),accuracyMeters:t().nonnegative()}),un=a({state:e(),location:e().nullable(),gps:Ed.nullable(),batteryPercent:t().min(0).max(100).nullable(),lastChangedAt:t()}),ki={name:"presence",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Presence],methods:{},status:{schema:un,kind:"push"},runtimeState:un},gn=a({hpa:t(),lastFetchedAt:t(),unit:e().optional(),precision:t().int().min(0).max(10).optional()}),wi={name:"pressure-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:gn,kind:"push"},runtimeState:gn},Rd=U("kind",[li,pi]),Ci=a({id:t(),enabled:g(),shape:Rd}),hn=a({enabled:g(),regions:p(Ci),lastFetchedAt:t()}),Bd=a({maxRegions:t(),supportedShapes:p(ui),polygonVertices:kd.optional()}),qd=a({enabled:g().optional(),regions:p(Ci).optional()}),Ai={name:"privacy-mask",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/privacy-mask-grid",tab:"image",label:"Privacy Mask"}},methods:{getOptions:r(a({deviceId:t()}),Bd),setMask:r(a({deviceId:t(),patch:qd}),u(),{kind:"mutation",auth:"admin"})},status:{schema:hn,kind:"poll"},runtimeState:hn},Od=e().describe("Vendor target string (people/vehicle/pet); empty = camera default"),Dt=a({targetType:Od,stopDelaySeconds:t().int().min(0).max(300),disappearDelaySeconds:t().int().min(0).max(300)}),Ld=a({value:e(),label:e()}),De=a({enabled:g(),lastChangedAt:t(),currentSettings:Dt.nullable(),supportedTargetTypes:p(Ld)}),zd=De.extend({lastFetchedAt:t()}),Ni={name:"ptz-autotrack",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-autotrack",tab:"ptz",topTab:!0,label:"Auto-Tracking",order:5}},methods:{getStatus:r(a({deviceId:t()}),De),setEnabled:r(a({deviceId:t(),enabled:g()}),u(),{kind:"mutation"}),getSettings:r(a({deviceId:t()}),Dt.nullable()),setSettings:r(a({deviceId:t(),settings:Dt.partial()}),u(),{kind:"mutation"})},events:{onStatusChanged:{data:a({deviceId:t(),status:De})}},status:{schema:De,kind:"command-driven"},runtimeState:zd},vn=a({isRunning:g(),lastRunAt:t(),lastRunSuccess:g().nullable(),lastError:e().nullable(),lastChangedAt:t()}),Pi={name:"script-runner",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Script],methods:{run:r(a({deviceId:t().int().nonnegative(),variables:I(e(),b()).optional()}),u(),{kind:"mutation",auth:"admin"}),stop:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"})},status:{schema:vn,kind:"push"},runtimeState:vn},yn=a({detected:g(),lastChangedAt:t()}),Mi={name:"smoke",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:yn,kind:"push"},runtimeState:yn},Ud=S(["main","sub","ext"]),Qe=a({width:t(),height:t(),codec:S(["h264","h265"]),framerate:t(),bitrate:t(),bitrateMode:S(["vbr","cbr"]).optional(),encoderProfile:S(["high","main","baseline"]).optional(),gop:t().optional(),audio:g().optional()}),Sn=a({main:Qe.optional(),sub:Qe.optional(),ext:Qe.optional(),lastFetchedAt:t()}),Ye=a({resolutions:p(a({width:t(),height:t()})),codecs:p(S(["h264","h265"])),framerates:p(t()),bitrates:p(t()),bitrateRange:Fe([t(),t()]).optional(),supportsBitrateMode:g(),supportsEncoderProfile:g(),supportsGop:g(),gop:a({min:t(),max:t(),step:t()}).optional()}),_d=a({main:Ye.optional(),sub:Ye.optional(),ext:Ye.optional()}),Fd=a({width:t().optional(),height:t().optional(),codec:S(["h264","h265"]).optional(),framerate:t().optional(),bitrate:t().optional(),bitrateMode:S(["vbr","cbr"]).optional(),encoderProfile:S(["high","main","baseline"]).optional(),gop:t().optional(),audio:g().optional()}),Di={name:"stream-params",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"stream-params",tab:"streaming"}},methods:{getOptions:r(a({deviceId:t()}),_d),setProfile:r(a({deviceId:t(),profile:Ud,patch:Fd}),u(),{kind:"mutation",auth:"admin"}),getConfigSchema:r(a({deviceId:t()}),b().nullable())},status:{schema:Sn,kind:"poll"},runtimeState:Sn},fn=a({on:g(),lastChangedAt:t()}),xi={name:"switch",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Switch,f.Siren,f.Light],methods:{setState:r(a({deviceId:t(),on:g()}),u(),{kind:"mutation",auth:"admin"})},events:{onStateChanged:{data:a({deviceId:t(),on:g(),lastChangedAt:t()})}},status:{schema:fn,kind:"command-driven"},runtimeState:fn,settings:{bindings:[{kind:"scalar",statusPath:"on",method:"setState",valueArg:"on",field:{label:"On",kind:"boolean"}}]}},bn=a({tampered:g(),lastChangedAt:t()}),Ti={name:"tamper",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:bn,kind:"push"},runtimeState:bn},In=a({celsius:t(),lastFetchedAt:t(),unit:e().optional(),precision:t().int().min(0).max(10).optional()}),Ei={name:"temperature-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor,f.Thermostat],methods:{},status:{schema:In,kind:"push"},runtimeState:In},kn=a({currentVersion:e().nullable(),availableVersion:e().nullable(),updatable:g(),state:e().nullable(),inProgress:g()}),Ri={name:"update",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Update],methods:{installUpdate:r(u(),u(),{kind:"mutation",auth:"admin"})},status:{schema:kn,kind:"poll"},runtimeState:kn},Hd=S(["idle","cleaning","paused","returning","docked","error"]),Ie=a({level:t().min(0).max(100).nullable(),status:S(["ok","low","full"]).nullable()}),wn=a({state:Hd,batteryLevel:t().min(0).max(100).nullable(),fanSpeed:e().nullable(),availableFanSpeeds:p(e()),cleanWater:Ie.nullable(),dirtyWater:Ie.nullable(),detergent:Ie.nullable(),dustBin:Ie.nullable(),lastChangedAt:t()}),Bi={name:"vacuum-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Vacuum],methods:{start:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),pause:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),stop:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),returnToBase:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),locate:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),setFanSpeed:r(a({deviceId:t().int().nonnegative(),speed:e().min(1)}),u(),{kind:"mutation",auth:"admin"})},status:{schema:wn,kind:"push"},runtimeState:wn},$d=S(["open","opening","closing","closed","stopped"]),Cn=a({state:$d,position:t().min(0).max(100).nullable(),lastChangedAt:t()}),qi={name:"valve",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Valve],methods:{open:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),close:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),stop:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"}),setPosition:r(a({deviceId:t().int().nonnegative(),position:t().min(0).max(100)}),u(),{kind:"mutation",auth:"admin"})},status:{schema:Cn,kind:"push"},runtimeState:Cn},An=a({detected:g(),lastChangedAt:t()}),Oi={name:"vibration",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Sensor],methods:{},status:{schema:An,kind:"push"},runtimeState:An},Nn=a({currentTemp:t().nullable(),targetTemp:t().nullable(),operationMode:e().nullable(),availableModes:p(e()),away:g().nullable(),minTemp:t().nullable(),maxTemp:t().nullable(),lastChangedAt:t()}),Li={name:"water-heater",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.WaterHeater],methods:{setTargetTemp:r(a({deviceId:t().int().nonnegative(),temp:t().finite()}),u(),{kind:"mutation",auth:"admin"}),setOperationMode:r(a({deviceId:t().int().nonnegative(),mode:e().min(1)}),u(),{kind:"mutation",auth:"admin"}),setAway:r(a({deviceId:t().int().nonnegative(),on:g()}),u(),{kind:"mutation",auth:"admin"})},status:{schema:Nn,kind:"push"},runtimeState:Nn},Pn=a({condition:e().nullable(),temperature:t().nullable(),temperatureUnit:e().nullable(),humidity:t().min(0).max(100).nullable(),pressure:t().nullable(),pressureUnit:e().nullable(),windSpeed:t().nullable(),windSpeedUnit:e().nullable(),windBearing:t().nullable(),lastFetchedAt:t()}),zi={name:"weather",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Weather],methods:{},status:{schema:Pn,kind:"push"},runtimeState:Pn},xt=a({totalObjects:t().int().nonnegative(),byClass:I(e(),t().int().nonnegative())}),Wd=xt.extend({zoneId:e(),zoneName:e(),trackIds:p(e()).readonly()}),Mn=a({ts:t().int(),frameWidth:t().int().nonnegative(),frameHeight:t().int().nonnegative(),zones:p(Wd).readonly(),frame:xt,unzoned:xt}),Vd=S(["minute","5min","hour"]),Je=a({from:t().int(),to:t().int(),resolution:Vd}),Xe=a({ts:t().int(),count:t().int().nonnegative()}),Ui={name:"zone-analytics",scope:"device",mode:"singleton",deviceTypes:[f.Camera],methods:{getCurrentSnapshot:r(a({deviceId:t()}),Mn.nullable()),getZoneHistory:r(a({deviceId:t(),zoneId:e(),className:e().optional()}).extend(Je.shape),p(Xe).readonly()),getCameraHistory:r(a({deviceId:t(),className:e().optional()}).extend(Je.shape),p(Xe).readonly()),getUnzonedHistory:r(a({deviceId:t(),className:e().optional()}).extend(Je.shape),p(Xe).readonly())},runtimeState:Mn},Kd=S(["include","exclude"]),ge=a({id:e(),name:e().optional(),zoneIds:p(e()).min(1).readonly(),mode:Kd,classFilter:p(e()).readonly().optional(),overlapThreshold:t().min(0).max(1).optional(),bboxInclusionPct:t().min(0).max(100).optional(),preferMask:g().optional(),enabled:g().default(!0)}),Fv=p(ge).readonly(),Dn=S(["motion","detection"]),_i={name:"zone-rules",scope:"device",mode:"singleton",deviceTypes:[f.Camera],methods:{listRules:r(a({deviceId:t(),stage:Dn}),p(ge).readonly()),setRules:r(a({deviceId:t(),stage:Dn,rules:p(ge).readonly()}),u(),{kind:"mutation",auth:"admin"})},runtimeState:a({motion:p(ge).readonly(),detection:p(ge).readonly()})},jd=a({connected:g(),deviceCount:t(),error:e().optional()}),Hv=a({externalId:e(),name:e(),type:e(),metadata:I(e(),b()).optional()}),Le=a({stableId:e(),type:S(f),suggestedName:e(),prefilledConfig:I(e(),b()),sourceInfo:se.optional()}),ze=a({id:t(),stableId:e(),addonId:e(),type:e(),name:e(),parentDeviceId:t().nullable(),online:g(),features:p(e()),config:I(e(),b()),sourceInfo:se.optional()}),Tt=a({status:S(["ok","error"]),labels:p(e()).optional(),error:e().optional()}),Gd=b(),Fi={name:"device-provider",scope:"system",mode:"collection",methods:{start:r(u(),u(),{kind:"mutation"}),stop:r(u(),u(),{kind:"mutation"}),getStatus:r(u(),jd),getDevices:r(u(),p(a({id:e(),name:e(),type:e()}))),supportsDiscovery:r(a({}),g()),discoverDevices:r(a({}),p(Le),{kind:"mutation",auth:"admin"}),adoptDiscoveredDevice:r(a({candidate:Le}),ze,{kind:"mutation",auth:"admin"}),supportsManualCreation:r(a({}),g()),getChildCreationSchema:r(a({type:S(f)}),Gd),createDevice:r(a({type:S(f),config:I(e(),b())}),ze,{kind:"mutation",auth:"admin"}),testCreationField:r(a({type:S(f),key:e(),value:b(),formValues:I(e(),b()).optional()}),Tt,{kind:"mutation",auth:"admin"})}},Zd=a({id:e(),label:e(),icon:e(),order:t().optional()}),Qd=a({id:e(),title:e(),description:e().optional(),style:S(["card","accordion"]).optional(),defaultCollapsed:g().optional(),columns:x([k(1),k(2),k(3),k(4)]).optional(),tab:e().optional(),location:S(["settings","top-tab"]).optional(),order:t().optional(),fields:p(ho())}),ee=a({tabs:p(Zd).optional(),sections:p(Qd)}),xn=I(e(),b()),Tn=a({success:k(!0)}),Yd={name:"addon-settings",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{getGlobalSettings:r(a({addonId:e(),nodeId:e().optional(),overlay:I(e(),b()).optional(),cap:e().optional()}),ee.nullable()),updateGlobalSettings:r(a({addonId:e(),nodeId:e().optional(),patch:xn}),Tn,{kind:"mutation",auth:"admin"}),getDeviceSettings:r(a({addonId:e(),deviceId:t(),nodeId:e().optional()}),ee.nullable()),updateDeviceSettings:r(a({addonId:e(),deviceId:t(),nodeId:e().optional(),patch:xn}),Tn,{kind:"mutation",auth:"admin"})}},Jd=S(["info","success","warning","error"]),Xd=S(["active","in-progress","completed","failed","dismissed"]),el=a({type:e(),id:e()}),et=a({id:e(),category:e(),severity:Jd,title:e(),message:e(),status:Xd,progress:t().optional(),read:g(),createdAt:t(),updatedAt:t(),source:el.optional(),metadata:I(e(),b()).optional()}),tl={name:"alerts",scope:"system",mode:"singleton",methods:{emit:r(et,u(),{kind:"mutation"}),update:r(a({alertId:e(),patch:et.partial()}),u(),{kind:"mutation"}),list:r(a({unreadOnly:g().optional(),limit:t().optional()}).optional(),p(et).readonly()),getUnreadCount:r(u(),t()),markRead:r(a({alertId:e()}),u(),{kind:"mutation"}),markAllRead:r(u(),u(),{kind:"mutation"}),dismiss:r(a({alertId:e()}),u(),{kind:"mutation"})}},al=U("shouldSaveDiskSpace",[a({providerId:e().min(1),displayName:e().min(1),configSchema:b(),shouldSaveDiskSpace:k(!0),minFreePercent:t().min(0).max(100)}),a({providerId:e().min(1),displayName:e().min(1),configSchema:b(),shouldSaveDiskSpace:k(!1),minFreePercent:k(null)})]),nl={name:"storage",scope:"system",mode:"singleton",methods:{resolve:r(a({location:W,relativePath:e()}),e()),write:r(a({location:W,relativePath:e(),data:T(Uint8Array)}),u(),{kind:"mutation"}),read:r(a({location:W,relativePath:e()}),T(Uint8Array)),exists:r(a({location:W,relativePath:e()}),g()),list:r(a({location:W,prefix:e().optional()}),p(e()).readonly()),delete:r(a({location:W,relativePath:e()}),u(),{kind:"mutation"}),getAvailableSpace:r(a({location:W}),t().nullable()),beginUpload:r(a({location:W,relativePath:e(),sizeBytes:t().optional()}),a({uploadId:e()}),{kind:"mutation"}),writeChunk:r(a({uploadId:e(),offset:t(),data:T(Uint8Array)}),u(),{kind:"mutation"}),finalizeUpload:r(a({uploadId:e()}),u(),{kind:"mutation"}),abortUpload:r(a({uploadId:e()}),u(),{kind:"mutation"}),beginDownload:r(a({location:W,relativePath:e()}),a({downloadId:e(),sizeBytes:t()}),{kind:"mutation"}),readChunk:r(a({downloadId:e(),offset:t(),length:t()}),T(Uint8Array)),endDownload:r(a({downloadId:e()}),u(),{kind:"mutation"}),listLocations:r(a({type:It.optional()}),p(O).readonly()),getDefaultLocation:r(a({type:It}),O.nullable()),listLocationDeclarations:r(u(),p(zc).readonly()),upsertLocation:r(O.omit({createdAt:!0,updatedAt:!0}),O,{kind:"mutation",auth:"admin"}),deleteLocation:r(a({id:e()}),u(),{kind:"mutation",auth:"admin"}),testLocation:r(a({id:e()}),a({ok:g(),error:e().optional()}),{auth:"admin"}),listProviders:r(u(),p(al).readonly()),testConfig:r(a({providerId:e(),config:I(e(),b())}),a({ok:g(),error:e().optional()}),{auth:"admin"})}},ol=U("shouldSaveDiskSpace",[a({providerId:e().min(1),displayName:e().min(1),configSchema:b(),shouldSaveDiskSpace:k(!0),minFreePercent:t().min(0).max(100)}),a({providerId:e().min(1),displayName:e().min(1),configSchema:b(),shouldSaveDiskSpace:k(!1),minFreePercent:k(null)})]),il=a({ok:g(),error:e().optional()}),sl=a({location:O,relativePath:e(),sizeBytes:t().optional()}),cl=a({uploadId:e()}),rl=a({uploadId:e(),offset:t(),data:T(Uint8Array)}),dl=a({uploadId:e()}),ll=a({uploadId:e()}),pl=a({location:O,relativePath:e()}),ml=a({downloadId:e(),sizeBytes:t()}),ul=a({downloadId:e(),offset:t(),length:t()}),gl=a({downloadId:e()}),hl={name:"storage-provider",scope:"system",mode:"collection",internal:!0,methods:{getProviderInfo:r(u(),ol),testLocation:r(a({config:I(e(),b())}),il,{auth:"admin"}),resolve:r(a({location:O,relativePath:e()}),e()),write:r(a({location:O,relativePath:e(),data:T(Uint8Array)}),u(),{kind:"mutation"}),read:r(a({location:O,relativePath:e()}),T(Uint8Array)),exists:r(a({location:O,relativePath:e()}),g()),list:r(a({location:O,prefix:e().optional()}),p(e()).readonly()),delete:r(a({location:O,relativePath:e()}),u(),{kind:"mutation"}),getAvailableSpace:r(a({location:O}),t().nullable()),beginUpload:r(sl,cl,{kind:"mutation"}),writeChunk:r(rl,u(),{kind:"mutation"}),finalizeUpload:r(dl,u(),{kind:"mutation"}),abortUpload:r(ll,u(),{kind:"mutation"}),beginDownload:r(pl,ml,{kind:"mutation"}),readChunk:r(ul,T(Uint8Array)),endDownload:r(gl,u(),{kind:"mutation"})}},vl=a({bytes:t().int().nonnegative()}),yl=a({reclaimedBytes:t().int().nonnegative(),exhausted:g()}),Sl={name:"storage-evictable",scope:"system",mode:"collection",internal:!0,methods:{getEvictableUsage:r(a({locationId:e()}),vl),evict:r(a({locationId:e(),targetBytes:t().int().positive()}),yl,{kind:"mutation"})}},fl=a({subId:e(),displayName:e(),description:e().optional(),kind:e(),triggerSupported:g(),restoreSupported:g()}),bl=fl.extend({id:e(),addonId:e(),enabled:g(),retentionCount:t(),label:e().optional(),lastSuccessAt:t().optional(),lastSuccessSizeBytes:t().optional(),cron:e().optional(),nextRunAt:t().optional(),lastRunAt:t().optional()}),Il=a({id:e(),filename:e(),createdAt:t(),sizeBytes:t(),label:e().optional(),locations:p(e()).readonly()}),En=a({id:e(),destinationId:e().optional(),label:e().optional(),createdAt:t(),sizeBytes:t(),locations:p(e()).optional()}),kl=a({path:e(),kind:S(["file","dir","symlink"]),sizeBytes:t(),mtime:t()}),wl=a({archiveVersion:k(1),createdAt:t(),dataDir:e(),locations:p(e()),entries:p(kl),totalBytes:t(),totalFiles:t()}),Cl=a({name:e(),sizeBytes:t(),fileCount:t(),present:g()}),Al={name:"backup",scope:"system",mode:"singleton",methods:{listDestinations:r(u(),p(bl).readonly(),{auth:"admin"}),trigger:r(a({destinations:p(e()).optional(),locations:p(e()).optional(),label:e().optional()}).optional(),p(En).readonly(),{kind:"mutation",auth:"admin"}),list:r(u(),p(En).readonly(),{auth:"admin"}),listLocations:r(u(),p(Cl).readonly(),{auth:"admin"}),getEntries:r(a({destinationId:e(),backupId:e()}),wl.nullable(),{auth:"admin"}),restore:r(a({destinationId:e(),backupId:e(),locations:p(e()).optional()}),u(),{kind:"mutation",auth:"admin"}),delete:r(a({destinationId:e(),backupId:e()}),u(),{kind:"mutation",auth:"admin"}),listArchives:r(a({destinationId:e()}),p(Il).readonly(),{auth:"admin"}),upsertDestinationPolicy:r(a({locationId:e(),enabled:g(),retentionCount:t().int().min(1).max(1e3),label:e().optional(),cron:e().optional()}),u(),{kind:"mutation",auth:"admin"}),previewSchedule:r(a({cron:e(),count:t().int().min(1).max(20).optional()}),a({ok:g(),error:e().optional(),nextRuns:p(t()).readonly()}))}},tt=a({where:I(e(),b()).optional(),whereIn:I(e(),p(b())).optional(),whereBetween:I(e(),Fe([b(),b()])).optional(),orderBy:a({field:e(),direction:S(["asc","desc"])}).optional(),limit:t().optional(),offset:t().optional()}),Rn=a({id:e(),data:I(e(),b())}),Nl=a({name:e(),type:S(["TEXT","INTEGER","REAL","JSON","BOOLEAN"]),primaryKey:g().optional(),notNull:g().optional(),unique:g().optional()}),Pl=a({name:e(),columns:p(e()).readonly(),unique:g().optional()}),Ml={name:"settings-store",scope:"system",mode:"singleton",methods:{get:r(a({namespace:e().optional(),collection:e(),key:e()}),b()),set:r(a({namespace:e().optional(),collection:e(),key:e(),value:b()}),u(),{kind:"mutation"}),query:r(a({namespace:e().optional(),collection:e(),filter:tt.optional()}),p(Rn).readonly()),insert:r(a({namespace:e().optional(),collection:e(),record:Rn}),u(),{kind:"mutation"}),update:r(a({namespace:e().optional(),collection:e(),id:e(),data:I(e(),b())}),u(),{kind:"mutation"}),delete:r(a({namespace:e().optional(),collection:e(),key:e()}),u(),{kind:"mutation"}),count:r(a({namespace:e().optional(),collection:e(),filter:tt.optional()}),t()),histogram:r(a({namespace:e().optional(),collection:e(),field:e(),bucketSize:t().int().positive(),origin:t().int(),filter:tt.optional()}),p(a({bucket:t().int(),count:t().int()})).readonly()),isEmpty:r(a({namespace:e().optional(),collection:e()}),g()),declareCollection:r(a({namespace:e().optional(),collection:e(),columns:p(Nl).readonly(),indexes:p(Pl).readonly().optional()}),u(),{kind:"mutation"})}},Hi=S(["debug","info","warn","error"]),Bn=a({timestamp:ht(),level:Hi,scope:p(e()),message:e(),meta:I(e(),b()).optional(),tags:I(e(),e()).optional()}),Dl={name:"log-destination",scope:"system",mode:"collection",internal:!0,methods:{write:r(Bn,u(),{kind:"mutation"}),query:r(a({scope:p(e()).optional(),level:Hi.optional(),since:ht().optional(),until:ht().optional(),limit:t().optional(),tags:I(e(),e()).optional()}),p(Bn).readonly())}},xl=a({staticDir:e()}),Tl=a({version:e()}),El={name:"admin-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:r(u(),xl),getVersion:r(u(),Tl)}},ke=S(["view","create","delete"]),$i=x([k("*"),p(e())]),Wi=I(e(),x([k("*"),p(e())])),Rl=S(["device","system"]),z=U("type",[a({type:k("category"),target:Rl,access:p(ke).min(1)}),a({type:k("capability"),target:e(),access:p(ke).min(1)}),a({type:k("addon"),target:e(),access:p(ke).min(1)}),a({type:k("device"),targets:p(e()).min(1),access:p(ke).min(1)})]),$v=a({id:e(),username:e(),passwordHash:e(),isAdmin:g().default(!1),allowedProviders:$i,allowedDevices:Wi,scopes:p(z).default([]),createdAt:t(),updatedAt:t()}),Wv=a({id:e(),label:e(),isAdmin:g().default(!1),allowedProviders:$i,allowedDevices:Wi,tokenHash:e(),tokenPrefix:e(),createdAt:t(),lastUsedAt:t().optional()}),Vv=a({id:e(),userId:e(),name:e(),tokenHash:e(),tokenPrefix:e(),scopes:p(z),expiresAt:t().nullish(),lastUsedAt:t().nullish(),createdAt:t()}),qn=a({userId:e(),username:e(),isAdmin:g(),provider:e(),email:e().optional(),displayName:e().optional(),hubUrl:e().optional(),scopes:p(z).optional(),redirectUri:e().optional(),integrationId:e().optional(),jti:e().optional(),sessionId:e().optional()}),Bl={name:"sso-bridge",scope:"system",mode:"singleton",internal:!0,methods:{signBridgeToken:r(a({claims:qn,ttlSec:t().int().positive().optional()}),a({token:e()})),verifyBridgeToken:r(a({token:e()}),qn.nullable())}},ql=a({integrationId:e(),displayName:e(),requestedScopes:p(z),allowedRedirectPrefixes:p(e()).min(1),hubUrl:e().optional()}),Ol={name:"oauth-integration",scope:"system",mode:"collection",internal:!0,methods:{getDescriptor:r(u(),ql)}},Ll=a({credentialId:e(),label:e(),createdAt:t(),lastUsedAt:t().nullable(),transports:p(e()).default([])}),zl={name:"user-passkeys",scope:"system",mode:"collection",internal:!0,methods:{beginRegistration:r(a({userId:e(),username:e()}),a({optionsJSON:I(e(),b())}),{kind:"mutation",auth:"admin",access:"create"}),finishRegistration:r(a({userId:e(),response:I(e(),b()),label:e()}),a({success:k(!0),credentialId:e()}),{kind:"mutation",auth:"admin",access:"create"}),beginAuthentication:r(a({userId:e().optional()}),a({optionsJSON:I(e(),b())}),{kind:"mutation",access:"view"}),finishAuthentication:r(a({userId:e(),response:I(e(),b())}),a({verified:g()}),{kind:"mutation",access:"view"}),listPasskeys:r(a({userId:e()}),p(Ll),{auth:"admin"}),removePasskey:r(a({userId:e(),credentialId:e()}),a({success:k(!0)}),{kind:"mutation",auth:"admin",access:"delete"})}},te=pc(),Ul=a({to:x([te,p(te).min(1)]),cc:p(te).optional(),bcc:p(te).optional(),from:e().optional(),replyTo:e().optional(),subject:e(),text:e(),html:e().optional()}),_l=a({messageId:e(),accepted:p(te).default([]),rejected:p(te).default([])}),On=a({ready:g(),host:e(),error:e().optional(),lastVerifiedAt:t().optional()}),Fl={name:"smtp-provider",scope:"system",mode:"collection",internal:!0,providerKind:"email",methods:{sendEmail:r(Ul,_l,{kind:"mutation",auth:"admin",access:"create"}),verify:r(u(),On,{kind:"mutation",auth:"admin",access:"view"}),getStatus:r(u(),On,{auth:"admin"})}},Hl=a({id:e(),label:e(),isDefault:g().optional()}),$l=a({search:e().optional(),area:e().optional(),manufacturer:e().optional(),adoptedOnly:g().optional(),unadoptedOnly:g().optional()}),Vi=a({integrationId:e(),page:t().int().positive().default(1),pageSize:t().int().positive().max(2e4).default(50),filter:e().optional(),filterText:$l.optional()}),Ki=a({candidates:p(ne).readonly(),totalCount:t().int().nonnegative(),page:t().int().positive(),pageSize:t().int().positive()}),Wl=a({integrationId:e(),childNativeId:e()}),Et=a({lastDiscoveryAt:t().int().nonnegative().nullable(),candidateCount:t().int().nonnegative(),adoptedCount:t().int().nonnegative(),lastError:e().nullable()}),Vl=a({name:e().min(1).optional(),hiddenChildIds:p(e()).optional()}),ji=a({integrationId:e(),childNativeIds:p(e()).min(1),filter:e().optional(),importLocations:g().optional(),perCandidate:I(e(),Vl).optional()}),Gi=a({adopted:p(a({childNativeId:e(),parentDeviceId:t().int().nonnegative(),accessoryDeviceIds:p(t().int().nonnegative()).readonly()})).readonly()}),Zi=a({integrationId:e(),camDeviceId:t().int().nonnegative()}),Kl=a({camDeviceId:t().int().nonnegative()}),jl=a({changed:g(),rebuiltChildren:t().int().nonnegative()}),Gl={name:"device-adoption",scope:"system",mode:"singleton",status:{schema:Et,kind:"poll"},methods:{listCandidateFilters:r(a({integrationId:e()}),a({filters:p(Hl)}),{auth:"admin"}),listCandidates:r(Vi,Ki,{auth:"admin"}),getCandidate:r(Wl,ne.nullable(),{auth:"admin"}),refresh:r(a({integrationId:e()}),Et,{kind:"mutation",auth:"admin"}),adopt:r(ji,Gi,{kind:"mutation",auth:"admin"}),release:r(Zi,u(),{kind:"mutation",auth:"admin"}),resync:r(Kl,jl,{kind:"mutation",auth:"admin"})}},Zl=S(["connected","disconnected","connecting","auth-failed","unreachable","error"]),Ln=a({id:e(),addonId:e(),name:e(),kind:e(),status:Zl,info:I(e(),b()),lastCheckedAt:t().nullable(),error:e().nullable()}),zn=a({brokerCount:t().int().nonnegative(),connectedCount:t().int().nonnegative()}),Ql=a({addonId:e(),kinds:p(a({kind:e(),label:e()}))}),Yl=a({kind:e().optional()}),we=a({id:e()}),Jl=a({kind:e().min(1),name:e().min(1),settings:I(e(),b())}),Xl=a({id:e()}),ep=a({id:e()}),tp=U("ok",[a({ok:k(!0),latencyMs:t().nonnegative()}),a({ok:k(!1),error:e()})]),xe=I(e(),b()),ap=a({kind:e()}),np=a({kind:e(),settings:xe}),op=U("ok",[a({ok:k(!0),latencyMs:t().nonnegative().optional()}).strict(),a({ok:k(!1),error:e()})]),ip=b().nullable(),sp=a({brokerId:e(),target:I(e(),b()),payload:b().optional()}),cp=a({brokerId:e(),filter:I(e(),b())}),rp=a({subscriptionId:e()}),dp=a({brokerId:e(),subscriptionId:e()}),lp=a({brokerId:e(),key:e()}),pp={name:"broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:zn,kind:"poll"},methods:{list:r(Yl,p(Ln)),get:r(we,Ln.nullable()),listProviders:r(u(),p(Ql),{auth:"admin"}),add:r(Jl,Xl,{kind:"mutation",auth:"admin"}),remove:r(ep,u(),{kind:"mutation",auth:"admin"}),testConnection:r(we,tp,{kind:"mutation",auth:"admin"}),getSettings:r(we,xe.nullable(),{auth:"admin"}),setSettings:r(a({id:e(),settings:xe}),u(),{kind:"mutation",auth:"admin"}),getBrokerConfig:r(we,xe.nullable(),{auth:"admin"}),getSettingsSchema:r(ap,ip,{auth:"admin"}),testSettings:r(np,op,{kind:"mutation",auth:"admin"}),publish:r(sp,b(),{kind:"mutation",auth:"admin"}),subscribe:r(cp,rp,{kind:"mutation",auth:"admin"}),unsubscribe:r(dp,u(),{kind:"mutation",auth:"admin"}),getState:r(lp,b().nullable()),getStatus:r(u(),zn)}},mp=S(["external","embedded"]),up=S(["connected","disconnected","auth-failed","unreachable","tls-error"]),gp=a({id:e(),name:e(),url:e(),kind:mp,status:up,latencyMs:t().nullable(),error:e().optional(),connectedClients:t().int().nonnegative().optional(),lastCheckedAt:t().optional()}),hp=a({url:e(),username:e().optional(),password:e().optional(),clientIdPrefix:e().optional()}),vp=a({name:e().min(1),url:e().regex(/^(mqtt|mqtts|ws|wss):\/\//,"URL must start with mqtt(s):// or ws(s)://"),username:e().optional(),password:e().optional(),clientIdPrefix:e().optional()}),yp=a({id:e()}),Ce=a({id:e()}),Sp=U("ok",[a({ok:k(!0),latencyMs:t()}),a({ok:k(!1),error:e()})]),fp=a({port:t().int().min(1).max(65535).default(1883),allowAnonymous:g().default(!1),username:e().optional(),password:e().optional()}),bp=a({id:e(),url:e()}),Un=a({brokerCount:t(),embeddedRunning:g()}),Ip={name:"mqtt-broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:Un,kind:"poll"},methods:{listBrokers:r(u(),p(gp)),getBrokerConfig:r(Ce,hp),addBroker:r(vp,yp,{kind:"mutation"}),removeBroker:r(Ce,u(),{kind:"mutation"}),testConnection:r(Ce,Sp,{kind:"mutation"}),startEmbeddedBroker:r(fp,bp,{kind:"mutation"}),stopEmbeddedBroker:r(Ce,u(),{kind:"mutation"}),getStatus:r(u(),Un)}},kp=S(["unlinked","linked","error"]),wp=a({label:e(),value:e(),secret:g().optional()}),Cp=a({qr:e().optional(),fields:p(wp).readonly().optional(),note:e().optional()}),_n=a({linkState:kp,exposedDeviceCount:t(),error:e().optional(),setup:Cp.optional()}),Ap=e(),Np=a({deviceId:e(),exposedAs:e().optional(),capabilities:p(e()).optional()}),Pp=a({deviceId:e(),capabilities:p(e()).optional()}),Mp=a({deviceId:e()}),Dp={name:"device-export",scope:"system",mode:"collection",providerKind:"device-export",status:{schema:_n,kind:"poll"},exposesDeviceSettings:!0,methods:{getStatus:r(u(),_n),listSupportedDeviceKinds:r(u(),p(Ap)),listExposedDevices:r(u(),p(Np)),exposeDevice:r(Pp,u(),{kind:"mutation"}),unexposeDevice:r(Mp,u(),{kind:"mutation"})}},xp=a({id:e(),label:e(),icon:e(),path:e(),remoteName:e(),bundle:e()}),Tp=a({addonId:e(),page:xp,bundleUrl:e()}),Ep={name:"addon-pages",scope:"system",mode:"singleton",methods:{listPages:r(u(),p(Tp).readonly())}},Rp=a({id:e(),label:e(),icon:e(),path:e(),remoteName:e(),bundle:e()}),Bp={name:"addon-pages-source",scope:"system",mode:"collection",internal:!0,methods:{listPages:r(u(),p(Rp).readonly())}},qp=S(["device-tab","dashboard","integration-detail"]),Fn=S(["xs","sm","md","lg","xl"]),Op=a({remoteName:e(),exposedModule:e(),componentKey:e().optional()}),Qi=a({tab:e(),subTab:e().optional(),label:e(),order:t().optional(),kind:k("remote"),remote:Op,stableId:e(),description:e().optional(),icon:e().optional(),bundle:e(),hosts:p(qp).readonly(),requires:a({deviceContext:g().default(!1),integrationContext:g().default(!1)}),defaultSize:Fn.default("md"),allowedSizes:p(Fn).readonly().default(["sm","md","lg"]),defaultColumns:t().int().min(1).max(12).default(6),defaultRows:t().int().min(1).max(12).default(1)}),Lp={name:"addon-widgets-source",scope:"system",mode:"collection",internal:!0,methods:{listWidgets:r(u(),p(Qi).readonly())}},zp=Qi.extend({addonId:e(),bundleUrl:e()}),Up={name:"addon-widgets",scope:"system",mode:"singleton",methods:{listWidgets:r(u(),p(zp).readonly())}},_p=a({method:S(["GET","POST","PUT","DELETE","PATCH"]),path:e(),access:S(["public","authenticated","admin"]).optional(),description:e().optional()}),Fp=a({method:e(),path:e(),params:I(e(),e()),query:I(e(),e()),body:b(),headers:I(e(),e()),user:a({id:e(),username:e(),isAdmin:g()}).optional(),scopedToken:b().optional()}),Hp=a({status:t().int(),headers:I(e(),e()),redirectUrl:e().nullable(),body:b().optional(),contentType:e().optional()}),$p={name:"addon-routes",scope:"system",mode:"collection",internal:!0,methods:{getRoutes:r(u(),p(_p)),invoke:r(Fp,Hp,{kind:"mutation"})}},Kv=[{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)"}],jv={hwaccel:"auto",probedBestHwaccel:""},Wp=a({sessionId:e(),slotCount:t().int(),slotByteLength:t().int(),segmentBytes:t().int(),budgetMb:t().int(),framesWritten:t().int(),getFrameHits:t().int(),getFrameMisses:t().int()}),Vp={name:"decoder",scope:"system",mode:"singleton",methods:{supportsCodec:r(a({codec:e()}),g()),getInfo:r(u(),a({id:e(),name:e(),isPullMode:g().optional(),priority:t().optional()})),createSession:r(Ma,a({sessionId:e(),nodeId:e()})),destroySession:r(a({sessionId:e()}),u()),pushPacket:r(a({sessionId:e(),packet:wc}),u()),openStream:r(a({sessionId:e(),url:e()}),u()),pullFrames:r(a({sessionId:e(),maxCount:t().default(1)}),p(Na)),pullHandles:r(a({sessionId:e(),maxCount:t().default(1)}),p(bt)),getFrame:r(a({handle:bt}),Na.nullable()),getShmStats:r(a({sessionId:e()}),Wp.nullable()),updateConfig:r(a({sessionId:e(),config:Ma.partial()}),u()),getStats:r(a({sessionId:e()}),Uc),listActiveSessions:r(u(),p(a({sessionId:e(),codec:e(),outputFormat:e(),createdAtMs:t()})).readonly()),reprobeHwaccel:r(u(),a({backend:e()}),{kind:"mutation",auth:"admin"})}},Kp=a({streamId:e(),label:e().optional(),codec:e(),type:S(["video","audio"]),sourceUrl:e()}),jp=a({streamId:e(),format:e(),value:e()}),Gp={name:"restreamer",scope:"system",mode:"collection",internal:!0,methods:{registerDevice:r(a({deviceId:t(),streams:p(Kp).readonly()}),u(),{kind:"mutation"}),unregisterDevice:r(a({deviceId:t()}),u(),{kind:"mutation"}),getExposedResources:r(a({deviceId:t()}),p(jp).readonly())}},Yi=a({viewportWidth:t().int().positive().optional(),viewportHeight:t().int().positive().optional(),devicePixelRatio:t().positive().optional(),downlinkMbps:t().nonnegative().optional(),prefersTier:e().optional()}).partial(),Zp={name:"webrtc",scope:"system",mode:"collection",internal:!0,methods:{handleOffer:r(a({streamId:e(),sdpOffer:e()}),e(),{kind:"mutation"}),supportsStream:r(a({streamId:e()}),g()),registerStream:r(a({streamId:e(),codec:e()}),u(),{kind:"mutation"}),unregisterStream:r(a({streamId:e()}),u(),{kind:"mutation"}),createSession:r(a({streamId:e(),hints:Yi.optional()}),a({sessionId:e(),sdpOffer:e()}),{kind:"mutation"}),handleAnswer:r(a({sessionId:e(),sdpAnswer:e()}),u(),{kind:"mutation"}),closeSession:r(a({sessionId:e()}),u(),{kind:"mutation"}),hasAdaptiveBitrate:r(a({streamId:e()}),g())}},Te=U("kind",[a({kind:k("adaptive")}),a({kind:k("profile"),profile:L}),a({kind:k("cam-stream"),camStreamId:e().min(1)})]),Qp=a({id:e(),label:e(),target:Te,codec:e().nullable(),resolution:a({width:t(),height:t()}).nullable(),status:S(["idle","connecting","streaming","error","stopped"]).nullable(),inputFps:t().nullable(),decodeFps:t().nullable(),bitrateKbps:t().nullable()}),Yp={name:"webrtc-session",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,preferredProvider:"stream-broker",deviceTypes:[f.Camera],methods:{listStreams:r(a({deviceId:t().int().nonnegative()}),p(Qp)),createSession:r(a({deviceId:t().int().nonnegative(),target:Te,hints:Yi.optional(),relayOnly:g().optional(),consumerAttribution:wt.optional()}),a({sessionId:e(),sdpOffer:e()}),{kind:"mutation"}),handleOffer:r(a({deviceId:t().int().nonnegative(),target:Te.optional(),sdpOffer:e(),sessionId:e().optional(),relayOnly:g().optional(),nonTrickle:g().optional(),disableTurn:g().optional(),disableIpv6:g().optional(),consumerAttribution:wt.optional()}),a({sessionId:e(),sdpAnswer:e()}),{kind:"mutation"}),handleAnswer:r(a({deviceId:t().int().nonnegative(),sessionId:e(),sdpAnswer:e()}),u(),{kind:"mutation"}),addIceCandidate:r(a({deviceId:t().int().nonnegative(),sessionId:e(),candidate:e(),sdpMid:e().nullable().optional(),sdpMLineIndex:t().int().nullable().optional()}),u(),{kind:"mutation"}),getIceCandidates:r(a({deviceId:t().int().nonnegative(),sessionId:e()}),a({candidates:p(a({candidate:e(),sdpMid:e().nullable(),sdpMLineIndex:t().int().nullable()})),done:g()}),{kind:"query"}),closeSession:r(a({deviceId:t().int().nonnegative(),sessionId:e()}),u(),{kind:"mutation"}),hasAdaptiveBitrate:r(a({deviceId:t().int().nonnegative(),profile:L}),g()),getSessionState:r(a({deviceId:t().int().nonnegative(),sessionId:e()}),a({pendingRenegotiation:a({target:Te,epoch:t()}).nullable()}))}},Ee=a({engine:R,steps:p(oe).readonly(),audio:a({engine:R,modelId:e(),enabled:g(),settings:I(e(),b()).readonly().optional()}).nullable().optional()}),at=a({id:e(),name:e(),description:e().optional(),config:Ee,createdAt:e(),updatedAt:e()}),Ji=a({enabled:g(),modelId:e(),settings:I(e(),b()).readonly()}),Hn=a({addonDefaults:I(e(),Ji).readonly()}),Xi=a({steps:p(oe).readonly(),audio:a({modelId:e(),enabled:g()}).nullable()}),Rt=a({enabled:g().optional(),modelId:e().optional(),settings:I(e(),b()).readonly().optional()}),Jp=a({pinnedAgentNodeId:e().optional(),stepToggles:I(e(),g()).optional(),stepOverridesByAgent:I(e(),I(e(),Rt)).optional(),pipelineByAgent:I(e(),Xi).optional()}),$n=a({deviceId:t(),agentNodeId:e(),pinned:g(),reason:S(["manual","capacity","hardware-affinity","failover","rebalance"]),assignedAt:t()}),Wn=a({deviceId:t(),decoderNodeId:e(),pinned:g(),reason:S(["manual","co-located","capacity","hardware-affinity"])}),Xp=a({nodeId:e(),online:g(),load:ii,score:t()}),em=a({totalAgents:t(),onlineAgents:t(),totalCameras:t(),attachedCameras:t(),activeCameras:t(),avgInferenceTimeMs:t(),queueDepth:t()}),tm=I(e(),e()),am={name:"pipeline-orchestrator",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{assignPipeline:r(a({deviceId:t(),agentNodeId:e()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),unassignPipeline:r(a({deviceId:t()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),rebalance:r(u(),a({migrated:t()}),{kind:"mutation",auth:"admin"}),getPipelineAssignments:r(u(),p($n).readonly()),getPipelineAssignment:r(a({deviceId:t()}),$n.nullable()),getAgentLoad:r(u(),p(Xp).readonly()),getGlobalMetrics:r(u(),em),getCameraMetrics:r(a({deviceId:t()}),Zt.nullable()),getCapabilityBindings:r(a({nodeId:e()}),tm),setCapabilityBinding:r(a({nodeId:e(),capName:e(),addonId:e()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),assignDecoder:r(a({deviceId:t(),nodeId:e()}),u(),{kind:"mutation",auth:"admin"}),unassignDecoder:r(a({deviceId:t()}),u(),{kind:"mutation",auth:"admin"}),getDecoderAssignments:r(u(),p(Wn).readonly()),assignAudio:r(a({deviceId:t(),nodeId:e()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),unassignAudio:r(a({deviceId:t()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),getAudioAssignment:r(a({deviceId:t()}),a({nodeId:e(),pinned:g(),assignedAt:t()}).nullable()),getAudioNodeLoad:r(u(),p(a({nodeId:e(),deviceCount:t()}))),getAudioAssignments:r(u(),p(a({deviceId:t(),nodeId:e(),pinned:g(),assignedAt:t()}))),getDecoderAssignment:r(a({deviceId:t(),pipelineNodeId:e().optional()}),Wn),getAgentSettings:r(a({agentNodeId:e()}),Hn.nullable()),listAgentSettings:r(u(),p(a({nodeId:e(),settings:Hn})).readonly()),setAgentAddonDefaults:r(a({agentNodeId:e(),defaults:I(e(),Ji)}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),removeAgentSettings:r(a({agentNodeId:e()}),a({success:g(),removed:g()}),{kind:"mutation",auth:"admin"}),getCameraSettings:r(a({deviceId:t()}),Jp.nullable()),setCameraStepToggle:r(a({deviceId:t(),addonId:e(),enabled:g().nullable()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),getCameraStepOverrides:r(a({deviceId:t()}),I(e(),I(e(),Rt)).nullable()),setCameraStepOverride:r(a({deviceId:t(),agentNodeId:e(),addonId:e(),patch:Rt.nullable()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),setCameraPipelineForAgent:r(a({deviceId:t(),agentNodeId:e(),pipeline:Xi.nullable()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),resolvePipeline:r(a({deviceId:t(),agentNodeId:e().optional()}),Ee),listTemplates:r(u(),p(at).readonly()),saveTemplate:r(a({name:e(),description:e().optional(),config:Ee}),at,{kind:"mutation",auth:"admin"}),updateTemplate:r(a({id:e(),name:e().optional(),description:e().optional(),config:Ee.optional()}),at,{kind:"mutation",auth:"admin"}),deleteTemplate:r(a({id:e()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"})}},nm=a({level:_r,classification:a({labels:p(At).readonly(),inferenceMs:t()}).optional(),timestamp:t()}),om=a({minConfidence:t().min(0).max(1).default(.3),allowedClasses:p(e()).default([])}),im=a({labels:p(At).readonly(),rawLabels:p(At).readonly().optional(),inferenceMs:t()}),Gv=[{value:"auto",label:"Auto (platform default)"},{value:"apple-soundanalysis",label:"Apple SoundAnalysis (macOS 12+)"},{value:"yamnet-onnx",label:"YAMNet ONNX (cross-platform)"}],Zv={audioBackend:"auto",probedBestAudioBackend:"",selectedAudioModel:""},sm={name:"audio-analyzer",scope:"system",mode:"singleton",methods:{analyseChunk:r(a({chunk:sn,settings:om}),nm.nullable(),{kind:"mutation"}),classify:r(sn,im,{timeoutMs:3e4}),isReady:r(u(),g()),dispose:r(u(),u(),{kind:"mutation"}),reprobeAudioEngine:r(u(),a({backend:e()}),{kind:"mutation",auth:"admin"})}},cm={name:"audio-analysis",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[f.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:r(a({deviceId:t()}),F())},events:{onAudioLevel:Y(a({deviceId:t(),rms:t(),dbfs:t()}))}},He=S(["f32le","s16le"]),rm=a({codec:e(),canDecode:g(),canEncode:g(),label:e().optional()}),dm=a({codec:e(),sourceSampleRate:t().int().positive(),sourceChannels:t().int().positive(),extraData:T(Uint8Array).optional(),targetSampleRate:t().int().positive(),targetChannels:t().int().positive(),targetFormat:He.optional(),idleMs:t().int().positive().optional(),tag:e().optional()}),lm=a({codec:e(),sourceSampleRate:t().int().positive(),sourceChannels:t().int().positive(),sourceFormat:He.optional(),targetSampleRate:t().int().positive(),targetChannels:t().int().positive(),bitrateKbps:t().int().positive().optional(),idleMs:t().int().positive().optional(),tag:e().optional()}),pm=a({data:T(Uint8Array),sampleRate:t().int().positive(),channels:t().int().positive(),format:He,pts:t()}),Vn=a({data:T(Uint8Array),codec:e(),pts:t(),frameComplete:g()}),mm=a({sessionId:e(),kind:S(["decode","encode"]),codec:e(),sourceSampleRate:t(),sourceChannels:t(),targetSampleRate:t(),targetChannels:t(),format:He,tag:e().optional(),createdAtMs:t(),lastActivityMs:t(),framesIn:t(),framesOut:t()}),um={name:"audio-codec",scope:"system",mode:"singleton",methods:{listSupportedCodecs:r(u(),p(rm).readonly()),canHandle:r(a({codec:e(),kind:S(["decode","encode"])}),g()),createDecodeSession:r(dm,a({sessionId:e(),nodeId:e()}),{kind:"mutation"}),createEncodeSession:r(lm,a({sessionId:e(),nodeId:e()}),{kind:"mutation"}),closeSession:r(a({sessionId:e(),nodeId:e().optional()}),u(),{kind:"mutation"}),pushEncodedFrame:r(a({sessionId:e(),nodeId:e().optional(),data:T(Uint8Array),pts:t().optional()}),u(),{kind:"mutation"}),pullPcm:r(a({sessionId:e(),nodeId:e().optional(),maxCount:t().int().positive().default(8)}),p(pm)),pushPcm:r(a({sessionId:e(),nodeId:e().optional(),data:T(Uint8Array),pts:t().optional()}),u(),{kind:"mutation"}),pullEncoded:r(a({sessionId:e(),nodeId:e().optional(),maxCount:t().int().positive().default(8)}),p(Vn)),flushEncode:r(a({sessionId:e(),nodeId:e().optional()}),p(Vn),{kind:"mutation"}),listActiveSessions:r(u(),p(mm).readonly())}},Kn=a({embedding:p(t()),inferenceMs:t()}),gm=a({modelId:e(),embeddingDim:t(),ready:g()}),hm={name:"embedding-encoder",scope:"system",mode:"collection",internal:!0,methods:{encode:r(a({crop:T(Uint8Array),width:t(),height:t()}),Kn),encodeText:r(a({text:e()}),Kn),getInfo:r(u(),gm)}},Yt=a({childKey:e(),section:e(),order:t().optional(),collapsed:g().optional()}),Jt=a({id:e(),source:a({sourceKey:e(),cap:e(),fieldPath:e()}),target:a({cap:e(),fieldPath:e(),itemKey:e().optional()}),transform:U("kind",[a({kind:k("identity")}),a({kind:k("enum-map"),mapping:I(e(),x([e(),t(),g()])),fallback:x([e(),t(),g()]).optional()}),a({kind:k("linear"),scale:t(),offset:t(),clamp:Fe([t(),t()]).readonly().optional()})]).optional()}),nt=a({id:t(),stableId:e(),addonId:e(),type:S(f),name:e(),location:e().nullable(),disabled:g(),parentDeviceId:t().nullable(),role:e().nullable().optional(),online:g(),probed:g().optional(),features:p(e()),isCamera:g(),config:I(e(),b()),metadata:I(e(),b()).nullable().optional(),sourceInfo:se.optional(),integrationId:e().optional(),linkDeviceId:t().nullable().optional(),primaryChildEntityId:e().nullable().optional(),childLayout:p(Yt).readonly().optional(),deviceLinks:p(Jt).readonly().optional()}),vm=a({key:e(),value:b(),description:e().optional()}),ym=a({id:t(),stableId:e(),type:e(),name:e(),location:e().nullable(),disabled:g(),parentDeviceId:t().nullable(),role:e().nullable().optional()}),Sm=a({id:t(),stableId:e(),addonId:e(),type:e(),name:e(),location:e().nullable(),disabled:g(),parentDeviceId:t().nullable(),metadata:I(e(),b()).nullable().optional(),sourceInfo:se.optional(),integrationId:e().optional(),linkDeviceId:t().nullable().optional(),primaryChildEntityId:e().nullable().optional(),childLayout:p(Yt).readonly().optional(),deviceLinks:p(Jt).readonly().optional(),role:e().nullable().optional()}),fm=b().nullable(),bm=a({streamId:e(),width:t().optional(),height:t().optional(),codec:e().optional(),fps:t().optional(),bitrateKbps:t().optional()}),Im=a({addonId:e(),stableId:e(),id:t(),type:e(),name:e(),location:e().nullable().optional(),disabled:g().optional(),parentDeviceId:t().nullable(),role:e().nullable().optional(),features:p(e()).optional(),config:I(e(),b())}),km=a({deviceId:t()}),wm=a({deviceId:t(),data:I(e(),b())}),Cm={name:"device-manager",scope:"system",mode:"singleton",methods:{allocateDeviceId:r(a({addonId:e(),stableId:e()}),a({id:t()}),{kind:"mutation"}),registerDevice:r(Im,u(),{kind:"mutation"}),removeDevice:r(km,u(),{kind:"mutation"}),persistConfig:r(wm,u(),{kind:"mutation"}),loadConfig:r(a({deviceId:t()}),I(e(),b())),loadRuntimeState:r(a({deviceId:t()}),I(e(),b())),loadMeta:r(a({deviceId:t()}),Sm.nullable()),setName:r(a({deviceId:t(),name:e()}),u(),{kind:"mutation",auth:"admin"}),setLocation:r(a({deviceId:t(),location:e().nullable()}),u(),{kind:"mutation",auth:"admin"}),setType:r(a({deviceId:t(),type:S(f)}),u(),{kind:"mutation",auth:"admin"}),setIntegrationId:r(a({deviceId:t(),integrationId:e()}),u(),{kind:"mutation",auth:"admin"}),setLinkDeviceId:r(a({deviceId:t(),linkDeviceId:t().nullable()}),u(),{kind:"mutation",auth:"admin"}),setPrimaryChildEntityId:r(a({deviceId:t(),primaryChildEntityId:e().nullable()}),u(),{kind:"mutation",auth:"admin"}),setChildLayout:r(a({deviceId:t(),childLayout:p(Yt).readonly()}),u(),{kind:"mutation",auth:"admin"}),setDeviceLinks:r(a({deviceId:t(),deviceLinks:p(Jt).readonly()}),u(),{kind:"mutation",auth:"admin"}),getWireableFields:r(a({deviceId:t()}),a({caps:p(a({cap:e(),fields:p(a({path:e(),kind:S(["string","number","boolean","enum"]),enumValues:p(e()).optional()})).readonly()})).readonly()}),{kind:"query"}),setRole:r(a({deviceId:t(),role:e().nullable()}),u(),{kind:"mutation",auth:"admin"}),applyInitialMeta:r(a({deviceId:t(),name:e().optional(),location:e().nullable().optional(),type:S(f).optional(),integrationId:e().optional(),linkDeviceId:t().nullable().optional(),role:e().nullable().optional()}),u(),{kind:"mutation",auth:"admin"}),setMetadata:r(a({deviceId:t(),patch:I(e(),b())}),u(),{kind:"mutation",auth:"admin"}),listLocations:r(u(),p(e())),addLocation:r(a({name:e()}),u(),{kind:"mutation",auth:"admin"}),removeLocation:r(a({name:e(),cascade:g().optional()}),u(),{kind:"mutation",auth:"admin"}),setDisabled:r(a({deviceId:t(),disabled:g()}),u(),{kind:"mutation",auth:"admin"}),listPersistedByAddon:r(a({addonId:e()}),p(ym)),listAll:r(a({addonId:e().optional()}),p(nt)),getDevice:r(a({deviceId:t()}),nt.nullable()),getChildren:r(a({parentDeviceId:t()}),p(nt)),getStreamSources:r(a({deviceId:t()}),p(kc)),getConfigSchema:r(a({deviceId:t()}),p(vm)),getSettingsSchema:r(a({deviceId:t()}),fm),updateConfig:r(a({deviceId:t(),values:I(e(),b())}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),enable:r(a({deviceId:t()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),disable:r(a({deviceId:t()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),remove:r(a({deviceId:t()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),removeByIntegration:r(a({integrationId:e()}),a({removed:t()}),{kind:"mutation",auth:"admin"}),getStreamProfileMap:r(a({deviceId:t()}),I(e(),e().nullable())),setStreamProfileMap:r(a({deviceId:t(),profileMap:I(e(),e().nullable())}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),probeStreams:r(a({deviceId:t()}),p(bm),{kind:"mutation",auth:"admin"}),getBindings:r(a({deviceId:t()}),a({deviceId:t(),entries:p(a({capName:e(),kind:S(["native","wrapped"]),providerAddonId:e(),providerNodeId:e(),nativeAddonId:e()}))})),getAllBindings:r(a({}),p(a({deviceId:t(),entries:p(a({capName:e(),kind:S(["native","wrapped"]),providerAddonId:e(),providerNodeId:e(),nativeAddonId:e()}))}))),setWrapperActive:r(a({deviceId:t(),capName:e(),wrapperAddonId:e(),active:g()}),u(),{kind:"mutation",auth:"admin"}),listWrappersForCap:r(a({capName:e()}),p(e())),listBindableCapsForDeviceType:r(a({deviceType:e()}),p(a({capName:e(),wrappers:p(e())}))),getDeviceSettingsAggregate:r(a({deviceId:t()}),ee.nullable()),getDeviceLiveInfoAggregate:r(a({deviceId:t()}),ee.nullable()),getDeviceAggregate:r(a({deviceId:t()}),a({settings:ee.nullable(),live:ee.nullable()})),runDeviceAction:r(a({deviceId:t().int().nonnegative(),action:e().min(1),input:b()}),b(),{kind:"mutation"}),updateDeviceField:r(a({deviceId:t(),writerCapName:e(),writerAddonId:e(),key:e(),value:b()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),updateDeviceFieldsBatch:r(a({deviceId:t(),changes:p(a({writerCapName:e(),writerAddonId:e(),key:e(),value:b()}))}),a({success:k(!0),failures:p(a({writerCapName:e(),writerAddonId:e(),error:e()}))}),{kind:"mutation",auth:"admin"}),discoverDevices:r(a({addonId:e()}),p(Le),{kind:"mutation",auth:"admin"}),adoptDevice:r(a({addonId:e(),candidate:Le,integrationId:e().optional()}),ze,{kind:"mutation",auth:"admin"}),getCreationSchema:r(a({addonId:e(),type:S(f)}),b().nullable()),createDevice:r(a({addonId:e(),type:S(f),config:I(e(),b()),integrationId:e().optional()}),ze,{kind:"mutation",auth:"admin"}),testCreationField:r(a({addonId:e(),type:S(f),key:e(),value:b(),formValues:I(e(),b()).optional()}),Tt,{kind:"mutation",auth:"admin"}),adoptionListCandidates:r(Vi.extend({addonId:e()}),Ki,{auth:"admin"}),adoptionRefresh:r(a({addonId:e(),integrationId:e()}),Et,{kind:"mutation",auth:"admin"}),adoptionAdopt:r(ji.extend({addonId:e()}),Gi,{kind:"mutation",auth:"admin"}),adoptionRelease:r(Zi.extend({addonId:e()}),u(),{kind:"mutation",auth:"admin"}),testField:r(a({deviceId:t(),key:e(),value:b()}),Tt,{kind:"mutation",auth:"admin"}),getDeviceStatusAggregate:r(a({deviceId:t(),caps:p(e()).readonly().optional()}),I(e(),b().nullable()))}},Am={name:"device-state",scope:"system",mode:"singleton",methods:{getSnapshot:r(a({deviceId:t()}),I(e(),I(e(),b()))),getCapSlice:r(a({deviceId:t(),capName:e()}),I(e(),b()).nullable()),getAllSnapshots:r(a({}),I(e(),I(e(),I(e(),b())))),setCapSlice:r(a({deviceId:t(),capName:e(),slice:I(e(),b())}),u(),{kind:"mutation"})},events:{onChanged:Y(a({deviceId:t(),capName:e(),slice:I(e(),b())}))}},ot=a({userId:e(),username:e(),email:e().optional(),displayName:e().optional(),isAdmin:g().default(!1)}),Nm={name:"auth-provider",scope:"system",mode:"collection",internal:!0,methods:{validateCredentials:r(a({username:e(),password:e()}),ot.nullable(),{kind:"mutation"}),getLoginUrl:r(a({state:e()}),e()),handleCallback:r(I(e(),e()),ot,{kind:"mutation"}),validateToken:r(a({token:e()}),ot.nullable())}},Ue=a({url:e(),hostname:e(),port:t(),protocol:S(["http","https"])}),Pm=a({connected:g(),endpoint:Ue.nullable(),error:e().optional()}),Mm=Ue.extend({id:e(),label:e(),mode:e().optional(),sourcePort:t().optional()}),Dm={name:"network-access",scope:"system",mode:"collection",providerKind:"ingress",methods:{start:r(u(),Ue,{kind:"mutation"}),stop:r(u(),u(),{kind:"mutation"}),getEndpoint:r(u(),Ue.nullable()),getStatus:r(u(),Pm),listEndpoints:r(u(),p(Mm).readonly())}},xm=a({urls:x([e(),p(e())]),username:e().optional(),credential:e().optional()}),Tm={name:"turn-provider",scope:"system",mode:"collection",methods:{getTurnServers:r(u(),p(xm).readonly())}},es=a({base64:e(),contentType:e()}),Em=a({lastCapturedAt:t().nullable(),cacheAgeMs:t().nullable(),lastBytes:t().nullable(),lastStreamId:e().nullable()}),Rm={name:"snapshot",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[f.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:r(a({deviceId:t(),streamId:e().optional(),force:g().optional()}),es.nullable()),invalidateCache:r(a({deviceId:t()}),u(),{kind:"mutation",auth:"admin"})},status:{schema:Em,kind:"poll"}},Bm={name:"snapshot-provider",scope:"system",mode:"collection",methods:{supportsDevice:r(a({deviceId:t()}),g()),getSnapshot:r(a({deviceId:t(),streamId:e().optional()}),es.nullable())}},qm=a({title:e(),body:e(),imageUrl:e().optional(),deviceId:t().optional(),eventId:e().optional(),priority:S(["low","normal","high","critical"]).default("normal"),metadata:I(e(),b()).optional()}),Om={name:"notification-output",scope:"system",mode:"collection",methods:{send:r(qm,u(),{kind:"mutation"}),sendTest:r(u(),a({success:g(),error:e().optional()}),{kind:"mutation"})}},Lm=a({deviceIds:p(t()).readonly().optional(),classNames:p(e()).readonly().optional(),zoneIds:p(e()).readonly().optional(),minConfidence:t().optional(),source:S(["pipeline","onboard","any"]).optional(),schedule:a({days:p(t()).readonly(),startHour:t(),endHour:t()}).optional(),cooldownSeconds:t().optional(),minDwellSeconds:t().optional(),eventTypeTokens:p(e()).readonly().optional()}),zm=a({title:e(),body:e(),imageMode:S(["crop","annotated","full","none"])}),jn=a({id:e(),name:e(),enabled:g(),eventTypes:p(e()).readonly(),conditions:Lm,outputs:p(e()).readonly(),template:zm.optional(),priority:S(["low","normal","high","critical"])}),Um=a({ruleId:e(),eventId:e(),timestamp:t(),wouldFire:g(),reason:e().optional()}),_m=a({id:e(),ruleId:e(),ruleName:e(),eventId:e(),timestamp:t(),outputs:p(e()).readonly(),success:g(),error:e().optional(),deviceId:t().optional()}),Fm=a({ruleId:e().optional(),deviceId:t().optional(),from:t().optional(),to:t().optional(),limit:t().optional()}),Hm={name:"advanced-notifier",scope:"system",mode:"singleton",internal:!0,methods:{getRules:r(u(),a({rules:p(jn).readonly()})),upsertRule:r(a({rule:jn}),a({success:k(!0)}),{kind:"mutation"}),deleteRule:r(a({ruleId:e()}),a({success:k(!0)}),{kind:"mutation"}),testRule:r(a({ruleId:e(),lookbackMinutes:t()}),a({results:p(Um).readonly()}),{kind:"mutation"}),getHistory:r(a({filter:Fm.optional()}),a({entries:p(_m).readonly()}))}},$m={name:"detection-pipeline",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[f.Camera],exposesDeviceSettings:!0,methods:{}},Wm={name:"camera-pipeline-config",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[f.Camera],exposesDeviceSettings:!0,methods:{}},Xt=S(["new","entered","left","moving","idle"]),Vm=S(["motion","object","audio"]),ts=a({x:t(),y:t(),timestamp:t(),bbox:ce}),Km=a({timestamp:t(),position:ts,mediaKey:e()}),it=a({trackId:e(),deviceId:t(),className:e(),label:e().optional(),firstSeen:t(),lastSeen:t(),positions:p(ts).readonly(),snapshots:p(Km).readonly(),zonesVisited:p(e()).readonly(),totalDistance:t(),state:Xt,active:g()}),ea={id:e(),deviceId:t(),timestamp:t()},jm=a({...ea,kind:k("motion"),regionCount:t(),regions:p(a({bbox:ce,pixelCount:t(),intensity:t()})).readonly().optional(),frameWidth:t().optional(),frameHeight:t().optional(),mediaUrl:e().optional()}),Gm=a({...ea,kind:k("object"),trackId:e().optional(),className:e(),label:e().optional(),confidence:t().optional(),bbox:ce.optional(),zones:p(e()).readonly().optional(),state:Xt.optional(),mediaKey:e().optional(),mediaUrl:e().optional()}),Zm=a({...ea,kind:k("audio"),rms:t(),dbfs:t(),classification:a({className:e(),originalClass:e().optional(),score:t()}).optional(),mediaUrl:e().optional()}),Gn=a({key:e(),kind:S(["crop","thumbnail","snapshot"]),base64:e(),sizeBytes:t(),timestamp:t()}),Qm=1e3,Ym=5e3,Bt=a({deviceId:t(),since:t().optional(),until:t().optional(),limit:t().int().min(1).max(Ym).default(Qm),projection:S(["full","slim"]).optional()}),Jm=Bt.extend({classFilter:e().optional()}),Xm=a({trackId:e(),className:e(),confidence:t(),bbox:ce,zones:p(e()).readonly(),state:Xt}),eu={name:"pipeline-analytics",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[f.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:r(a({deviceId:t()}),p(it).readonly()),getTrack:r(a({deviceId:t(),trackId:e()}),it.nullable()),listTracks:r(a({deviceId:t(),since:t().optional(),until:t().optional(),limit:t().optional()}),p(it).readonly()),clearTracks:r(a({deviceId:t()}),u(),{kind:"mutation",auth:"admin"}),getMotionEvents:r(Bt,p(jm).readonly()),getObjectEvents:r(Jm,p(Gm).readonly()),getAudioEvents:r(Bt,p(Zm).readonly()),getEventDensity:r(a({deviceId:t(),since:t(),until:t(),bucketMs:t().int().positive()}),p(a({bucketStart:t(),motion:t().int(),object:t().int(),audio:t().int()})).readonly()),pruneEventsBefore:r(a({deviceId:t(),cutoffMs:t()}),a({motion:t().int(),object:t().int(),audio:t().int()}),{kind:"mutation",auth:"admin"}),getEventMedia:r(a({eventId:e()}),p(Gn).readonly()),getTrackMedia:r(a({trackId:e()}),p(Gn).readonly())},events:{onFrameTracked:{data:a({deviceId:t(),timestamp:t(),frameWidth:t(),frameHeight:t(),detections:p(Xm).readonly()})},onTrackStarted:{data:a({deviceId:t(),trackId:e(),className:e()})},onTrackEnded:{data:a({deviceId:t(),trackId:e(),className:e(),durationMs:t()})},onDetectionEvent:{data:a({deviceId:t(),kind:Vm,eventId:e(),timestamp:t()})}}},tu=a({total:t(),user:t(),system:t(),irq:t(),nice:t(),loadAvg:Fe([t(),t(),t()]),cores:t()}),au=a({percent:t(),totalBytes:t(),usedBytes:t(),availableBytes:t(),swapUsedBytes:t(),swapTotalBytes:t()}),nu=a({readBytes:t(),writeBytes:t(),readOps:t(),writeOps:t(),timestampMs:t()}),ou=a({rxBytes:t(),txBytes:t(),rxPackets:t(),txPackets:t(),rxErrors:t(),txErrors:t(),timestampMs:t()}),as=a({utilization:t(),model:e(),memoryUsedBytes:t(),memoryTotalBytes:t(),temperature:t().nullable()}),iu=a({openFds:t(),threadCount:t(),activeHandles:t(),activeRequests:t()}),Zn=a({avg10:t(),avg60:t(),avg300:t()}),st=a({some:Zn,full:Zn.nullable()}),Qn=a({cpu:tu,memory:au,gpu:as.nullable(),network:ou,disk:nu,pressure:a({cpu:st.nullable(),memory:st.nullable(),io:st.nullable()}),process:iu,cpuTemperature:t().nullable(),timestampMs:t()}),su=a({path:e(),totalBytes:t(),usedBytes:t(),availableBytes:t(),percent:t()}),Yn=a({pid:t(),cpu:t(),memory:t()}),cu=a({addonId:e(),nodeId:e(),role:S(["hub","worker"]),pid:t(),state:S(["starting","running","stopping","stopped","crashed"]),uptimeSec:t()}),ru=a({pid:t(),ppid:t(),pgid:t(),classification:S(["root","managed","system","ghost"]),addonId:e().nullable(),nodeId:e().nullable(),command:e(),cpuPercent:t(),memoryRssBytes:t(),uptimeSec:t(),orphaned:g()}),du=a({pid:t(),force:g().optional()}),lu=a({success:g(),reason:e().optional(),signal:S(["SIGTERM","SIGKILL"]).optional()}),pu=a({cpuPercent:t(),memoryPercent:t(),memoryUsedMB:t(),memoryTotalMB:t(),diskPercent:t().optional(),temperature:t().optional(),gpuPercent:t().optional(),gpuMemoryPercent:t().optional()}),mu={name:"metrics-provider",scope:"system",mode:"singleton",methods:{collectSnapshot:r(u(),Qn),getCached:r(u(),Qn.nullable()),getCurrent:r(u(),pu),getDiskSpace:r(a({dirPath:e()}),su),getGpuInfo:r(u(),as.nullable()),getCpuTemperature:r(u(),t().nullable()),getProcessStats:r(a({pids:p(t())}),p(Yn)),listAddonInstances:r(u(),p(cu).readonly()),getAddonStats:r(a({addonId:e()}),Yn.nullable()),listNodeProcesses:r(u(),p(ru).readonly()),killProcess:r(du,lu,{kind:"mutation",auth:"admin"})}},uu=a({id:e(),name:e()}),ns=a({pan:t(),tilt:t(),zoom:t()}),Jn=a({pan:t().optional(),tilt:t().optional(),zoom:t().optional(),speed:t().optional()}),gu=ns.extend({autofocus:g()}),hu=a({hasPan:g(),hasTilt:g(),hasZoom:g(),supportsPresets:g(),maxPresets:t().optional(),hasAutofocus:g()}),vu={name:"ptz",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-panel",tab:"ptz",topTab:!0,label:"PTZ",order:0}},methods:{move:r(Jn.extend({deviceId:t()}),u(),{kind:"mutation"}),continuousMove:r(Jn.extend({deviceId:t()}),u(),{kind:"mutation"}),stop:r(a({deviceId:t()}),u(),{kind:"mutation"}),getPresets:r(a({deviceId:t()}),p(uu)),goToPreset:r(a({deviceId:t(),presetId:e()}),u(),{kind:"mutation"}),savePreset:r(a({deviceId:t(),presetId:e(),name:e()}),u(),{kind:"mutation",auth:"admin"}),deletePreset:r(a({deviceId:t(),presetId:e()}),u(),{kind:"mutation",auth:"admin"}),getOptions:r(a({deviceId:t()}),hu),goHome:r(a({deviceId:t()}),u(),{kind:"mutation"}),getPosition:r(a({deviceId:t()}),ns),setAutofocus:r(a({deviceId:t(),enabled:g()}),u(),{kind:"mutation"})},status:{schema:gu,kind:"command-driven"}},yu=a({id:e(),type:e(),timestamp:t(),label:e().optional(),thumbnailUrl:e().optional(),clipUrl:e().optional(),metadata:I(e(),b()).optional()}),Su={name:"events",scope:"device",mode:"singleton",deviceTypes:[f.Camera],methods:{getEvents:r(a({deviceId:t(),from:t().optional(),to:t().optional(),limit:t().optional()}),p(yu)),getEventThumbnail:r(a({deviceId:t(),eventId:e()}),a({base64:e(),contentType:e()}).nullable()),getEventClipUrl:r(a({deviceId:t(),eventId:e()}),e().nullable())}},Xn=a({deviceId:t(),enabled:g(),activeMode:S(["off","continuous"]),nodeId:e(),storageBytes:t()}),fu=a({profile:e(),startMs:t(),endMs:t()}),bu=a({deviceId:t(),ranges:p(fu)}),Iu=a({deviceId:t(),localMasterPath:e().nullable(),playbackUrl:e().nullable(),playbackEndpoints:p(e())}),ku=a({deviceId:t(),usedBytes:t()}),wu=a({locationId:e().nullable(),usedBytes:t(),availableBytes:t().nullable(),totalBytes:t().nullable()}),Cu=a({nodeId:e(),totalUsedBytes:t(),devices:p(ku),locations:p(wu)}),Au={name:"recording",scope:"system",mode:"singleton",exposesDeviceSettings:!0,status:{schema:Xn,kind:"command-driven"},methods:{getAvailability:r(a({deviceId:t(),fromMs:t(),toMs:t()}),bu,{kind:"query",auth:"admin"}),getPlaybackManifest:r(a({deviceId:t(),fromMs:t(),toMs:t()}),Iu,{kind:"query",auth:"admin"}),getStorageUsage:r(a({}),Cu,{kind:"query",auth:"admin"}),getDeviceConfig:r(a({deviceId:t()}),Ve,{kind:"query",auth:"admin"}),setDeviceConfig:r(a({deviceId:t(),config:Ve}),Ve,{kind:"mutation",auth:"admin"}),rescanStorage:r(a({deviceId:t()}),Xn,{kind:"mutation",auth:"admin"}),pruneFootage:r(a({deviceId:t()}),a({floorMs:t().nullable(),deletedBuckets:t().int(),reclaimedBytes:t().int()}),{kind:"mutation",auth:"admin"})}},Nu=a({id:e(),label:e(),protocol:S(["rtsp","rtmp","annexb","http-mjpeg","webrtc","custom"]),url:e().optional(),resolution:a({width:t(),height:t()}).optional(),fps:t().optional(),bitrate:t().optional(),codec:e().optional(),profileHint:L.optional(),sdp:e().optional()}),Pu=a({key:e(),value:b()}),Mu=a({source:e(),data:I(e(),b())}),Du={name:"device-ops",scope:"device",deviceNative:!0,mode:"singleton",methods:{getStreamSources:r(a({deviceId:t()}),p(Nu)),getConfigEntries:r(a({deviceId:t()}),p(Pu)),setConfig:r(a({deviceId:t(),values:I(e(),b())}),u(),{kind:"mutation"}),runAction:r(a({deviceId:t(),action:e().min(1),input:b()}),b(),{kind:"mutation"}),removeDevice:r(a({deviceId:t()}),u(),{kind:"mutation"}),getSettingsSchema:r(a({deviceId:t()}),b().nullable()),getRawState:r(a({deviceId:t()}),Mu.nullable(),{auth:"protected"})}},xu=a({host:e(),port:t().int().positive().optional(),onvifPort:t().int().positive().optional(),rtspPort:t().int().positive().optional(),https:g().optional(),username:e().optional(),password:e().optional(),onvifProfile:e().optional()}),Tu=a({host:e(),port:t().int().positive().nullable(),onvifPort:t().int().positive().nullable(),rtspPort:t().int().positive().nullable(),https:g().nullable(),hasUsername:g(),hasPassword:g(),onvifProfile:e().nullable()}),Eu={name:"camera-credentials",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera],methods:{getCredentials:r(a({deviceId:t()}),xu.nullable(),{kind:"query",auth:"admin"})},status:{schema:Tu,kind:"command-driven"}},Ru={name:"reboot",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera,f.Sensor,f.Switch],methods:{reboot:r(a({deviceId:t().int().nonnegative()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"})}},Bu={name:"button",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Button],methods:{press:r(a({deviceId:t().int().nonnegative()}),u(),{kind:"mutation",auth:"admin"})}},qu=S(["text","timestamp","watermark"]),qt=S(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","custom"]),Ou=a({id:e(),kind:qu,enabled:g(),text:e().optional(),position:qt.optional(),availablePositions:p(qt).readonly(),readOnly:g().optional()}),eo=a({overlays:p(Ou).readonly()}),Lu=a({enabled:g().optional(),text:e().optional(),position:qt.optional()}).partial(),zu={name:"osd",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera],methods:{setOverlay:r(a({deviceId:t(),overlayId:e(),patch:Lu}),u(),{kind:"mutation",auth:"admin"})},events:{onStatusChanged:{data:a({deviceId:t(),status:eo})}},status:{schema:eo,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:i=>`${String(i.id)} enabled`,kind:"boolean"},text:{label:i=>`${String(i.id)} text`,kind:"text",when:i=>i.kind!=="timestamp"&&!i.readOnly},position:{label:i=>`${String(i.id)} position`,kind:"select",options:i=>i.availablePositions??[],when:i=>Array.isArray(i.availablePositions)&&i.availablePositions.length>0}}}]}},Uu=a({childDeviceIds:p(t()).readonly(),hiddenChildIds:p(t()).readonly()}),_u={name:"accessories",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera,f.Hub,f.Switch,f.Light,f.Sensor,f.Thermostat,f.Cover,f.Lock,f.Fan,f.MediaPlayer,f.AlarmPanel,f.Generic],methods:{setChildHidden:r(a({deviceId:t().int().nonnegative(),childDeviceId:t().int().nonnegative(),hidden:g()}),u(),{kind:"mutation",auth:"admin"})},events:{onAccessoriesChanged:{data:a({deviceId:t(),childDeviceIds:p(t()).readonly(),hiddenChildIds:p(t()).readonly()})},onChildVisibilityChanged:{data:a({deviceId:t(),childDeviceId:t(),hidden:g()})}},status:{schema:Uu,kind:"command-driven"}},Fu=a({codecs:p(e()),sampleRate:t(),duplex:S(["half","full"]),maxBacklogMs:t()}),to=a({talking:g(),lastSessionAt:t().nullable(),ability:Fu.nullable()}),Hu=S(["opus","s16le","g711ulaw","g711alaw"]),$u={name:"intercom",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera],methods:{startSession:r(a({deviceId:t()}),a({sessionId:e(),sdpOffer:e()}),{kind:"mutation",auth:"admin"}),handleAnswer:r(a({deviceId:t(),sessionId:e(),sdpAnswer:e()}),u(),{kind:"mutation",auth:"admin"}),stopSession:r(a({deviceId:t(),sessionId:e()}),u(),{kind:"mutation",auth:"admin"}),startTalkSession:r(a({deviceId:t()}),a({sessionId:e()}),{kind:"mutation",auth:"admin"}),pushTalkAudio:r(a({deviceId:t(),audioBase64:e(),codec:Hu.optional(),sampleRate:t().int().positive().optional(),channels:t().int().positive().optional(),sequenceNumber:t().int()}),a({accepted:g()}),{kind:"mutation",auth:"admin"}),endTalkSession:r(a({deviceId:t()}),u(),{kind:"mutation",auth:"admin"})},events:{onStatusChanged:{data:a({deviceId:t(),status:to})}},status:{schema:to,kind:"command-driven"}},Wu=a({camStreamId:e().min(1),kind:Ht,url:e().optional(),codec:e().optional(),resolution:ie.optional(),fps:t().positive().optional(),label:e().optional(),deviceFeatures:p(e()).optional(),autoEligible:g().optional(),metadata:I(e(),b()).optional()}),Vu={name:"stream-catalog",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[f.Camera],methods:{getCatalog:r(a({deviceId:t().int().nonnegative()}),p(Wu).readonly())}},Ku=S(Sc),ju=S(["videotoolbox","cuda","nvdec","vaapi","qsv","d3d11va","dxva2","amf","vdpau","drm","coreml","tensorrt","openvino","directml","webgpu","none"]).nullable().optional(),Gu=a({preferred:p(e()).readonly()}),Ot=S(["h264_videotoolbox","hevc_videotoolbox","h264_vaapi","hevc_vaapi","h264_nvenc","hevc_nvenc","h264_qsv","hevc_qsv","h264_amf","hevc_amf","libx264","libx265"]),Zu=a({encoder:Ot,codec:S(["H264","H265"]),family:S(["videotoolbox","vaapi","nvenc","qsv","amf","software"]),available:g(),reason:e().optional()}),ao=a({encoders:p(Zu).readonly(),defaultH264:Ot,defaultH265:Ot,probedAt:t()}),no=a({methods:p(e()).readonly(),probedAt:t()}),Qu=S(["darwin","linux","win32"]),Yu=S(["arm64","x64"]),Ju=a({type:S(["nvidia","amd","intel","apple"]),name:e(),memoryMB:t().optional()}),Xu=a({type:S(["apple-ane","intel-npu"])}),os=a({platform:Qu,arch:Yu,cpuModel:e(),cpuCores:t(),totalRAM_MB:t(),availableRAM_MB:t(),gpu:Ju.nullable(),npu:Xu.nullable()}),oo=a({runtime:S(["node","python"]),backend:e(),format:S(["onnx","coreml","openvino"]),score:t(),reason:e(),available:g()}),eg=a({hardware:os,scores:p(oo).readonly(),bestScore:oo,pythonPath:e().nullable()}),tg=a({modelId:e(),name:e(),minRAM_MB:t(),accuracyScore:t(),formats:p(e()).readonly()}),ag=a({modelId:e(),runtime:S(["node","python"]),backend:e(),format:Ku,reason:e()}),ng={name:"platform-probe",scope:"system",mode:"singleton",methods:{getCapabilities:r(u(),eg),getHardware:r(u(),os),resolveInferenceConfig:r(a({requirements:p(tg).readonly()}),ag),resolveHwAccel:r(a({prefer:ju,nodeId:e().optional()}),Gu),getHardwareEncoders:r(u(),ao),refreshHardwareEncoders:r(u(),ao,{kind:"mutation",auth:"admin"}),getHardwareDecodeAccels:r(u(),no),refreshHardwareDecodeAccels:r(u(),no,{kind:"mutation",auth:"admin"})}},og=S(["lan","wifi","docker","vpn","loopback","other"]),is=a({name:e(),family:S(["IPv4","IPv6"]),address:e(),cidr:e(),netmask:e(),internal:g(),mac:e(),kind:og,preferred:g(),plausible:g(),plausibleReason:e()}),ig=a({interfaces:p(is).readonly(),probedAt:t()}),sg=is.nullable(),cg=a({label:e(),baseUrl:e(),kind:S(["lan-ipv4","lan-ipv6","public","loopback"]),interfaceKind:S(["lan","wifi","docker","vpn","other","loopback","public"]),plausible:g(),plausibleReason:e(),priority:t()}),rg=a({endpoints:p(cg).readonly()}),ct=a({addresses:p(e()).readonly()}),dg={name:"local-network",scope:"system",mode:"singleton",methods:{list:r(u(),ig),getPreferred:r(u(),sg),getConnectionEndpoints:r(a({port:t().int().min(1).max(65535),includeLoopback:g().optional(),ipv4Only:g().optional(),scheme:S(["http","https"]).optional()}),rg),getAllowedAddresses:r(u(),ct),setAllowedAddresses:r(ct,a({success:k(!0)}),{kind:"mutation"}),resetAllowlistToBestMatch:r(u(),ct,{kind:"mutation"})}},lg=a({id:e(),label:e(),scope:S(["mesh","public"]),url:e(),hostname:e(),port:t(),protocol:S(["http","https"])}),pg=a({id:e(),hostname:e(),magicDns:e(),addresses:p(e()).readonly(),os:e().optional(),online:g(),lastSeenMs:t(),isSelf:g(),connection:S(["direct","relay","idle"]),relay:e().nullable(),lastHandshakeMs:t(),rxBytes:t(),txBytes:t(),tags:p(e()).readonly(),exitNodeOption:g(),advertisedRoutes:p(e()).readonly(),userLogin:e().nullable(),keyExpiry:t().nullable()}),mg=a({joined:g(),meshIp:e(),magicDnsHostname:e(),peerCount:t(),endpoints:p(lg).readonly(),error:e().optional(),tenantName:e(),magicDnsSuffix:e(),userLogin:e().nullable(),controlPlaneUrl:e(),keyExpiry:t().nullable(),daemonSocket:e().optional(),daemonCliPath:e().optional()}),ug={name:"mesh-network",scope:"system",mode:"collection",providerKind:"mesh",methods:{getStatus:r(u(),mg),join:r(a({authKey:e().min(8),hostname:e().optional()}),a({joined:k(!0)}),{kind:"mutation"}),startLogin:r(a({hostname:e().optional()}),a({loginUrl:e()}),{kind:"mutation"}),leave:r(u(),a({left:k(!0)}),{kind:"mutation"}),logout:r(u(),a({loggedOut:k(!0)}),{kind:"mutation"}),listPeers:r(u(),a({peers:p(pg).readonly()})),testConnection:r(a({authKey:e().optional()}),a({ok:g(),tenant:e().optional(),daemonVersion:e().optional(),error:e().optional()}),{kind:"mutation"})}},rt=a({id:e(),username:e(),isAdmin:g().default(!1),allowedProviders:x([p(e()),k("*")]),allowedDevices:I(e(),x([p(e()),k("*")])),scopes:p(z).default([]),totpEnabled:g().default(!1),createdAt:t(),updatedAt:t()}),gg=a({username:e(),password:e().min(6),isAdmin:g().default(!1),allowedProviders:x([p(e()),k("*")]).optional(),allowedDevices:I(e(),x([p(e()),k("*")])).optional(),scopes:p(z).optional()}),hg=a({id:e(),isAdmin:g().optional(),allowedProviders:x([p(e()),k("*")]).optional(),allowedDevices:I(e(),x([p(e()),k("*")])).optional(),scopes:p(z).optional()}),Lt=a({id:e(),label:e(),isAdmin:g().default(!1),allowedProviders:x([p(e()),k("*")]).optional(),allowedDevices:I(e(),x([p(e()),k("*")])).optional(),tokenPrefix:e(),createdAt:t(),lastUsedAt:t().optional()}),vg=a({label:e(),isAdmin:g().default(!1),allowedProviders:x([p(e()),k("*")]).optional(),allowedDevices:I(e(),x([p(e()),k("*")])).optional()}),yg=a({token:e(),record:Lt}),zt=a({id:e(),userId:e(),name:e(),tokenPrefix:e(),scopes:p(z),expiresAt:t().nullish(),lastUsedAt:t().nullish(),createdAt:t()}),Sg=a({userId:e(),name:e(),scopes:p(z),expiresAt:t().optional()}),fg=a({token:e(),record:zt}),bg=a({id:e(),userId:e(),username:e(),integrationId:e(),scopes:p(z),createdAt:t(),lastUsedAt:t(),revokedAt:t().nullable()}),Ig=a({secret:e(),otpauthUrl:e()}),kg=a({enabled:g(),confirmedAt:t().nullable()}),wg={name:"user-management",scope:"system",mode:"singleton",methods:{listUsers:r(u(),p(rt),{auth:"admin"}),createUser:r(gg,rt,{kind:"mutation",auth:"admin",access:"create"}),updateUser:r(hg,a({success:k(!0)}),{kind:"mutation",auth:"admin",access:"create"}),deleteUser:r(a({id:e()}),a({success:k(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),resetPassword:r(a({id:e(),newPassword:e().min(6)}),a({success:k(!0)}),{kind:"mutation",auth:"admin",access:"create"}),setUserScopes:r(a({userId:e(),scopes:p(z)}),a({success:k(!0)}),{kind:"mutation",auth:"admin",access:"create"}),validateCredentials:r(a({username:e(),password:e()}),rt.extend({passwordHash:e()}).nullable(),{kind:"mutation",access:"view"}),listApiKeys:r(u(),p(Lt),{auth:"admin"}),createApiKey:r(vg,yg,{kind:"mutation",auth:"admin",access:"create"}),revokeApiKey:r(a({id:e()}),a({success:k(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateApiKey:r(a({token:e()}),Lt.nullable(),{kind:"mutation",access:"view"}),createScopedToken:r(Sg,fg,{kind:"mutation",auth:"admin",access:"create"}),revokeScopedToken:r(a({id:e()}),a({success:k(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateScopedToken:r(a({token:e()}),zt.nullable(),{access:"view"}),listScopedTokens:r(a({userId:e()}),p(zt),{auth:"admin"}),setupTotp:r(a({userId:e()}),Ig,{kind:"mutation",auth:"admin",access:"create"}),confirmTotp:r(a({userId:e(),code:e()}),a({success:k(!0)}),{kind:"mutation",auth:"admin",access:"create"}),disableTotp:r(a({userId:e()}),a({success:k(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getTotpStatus:r(a({userId:e()}),kg,{auth:"admin"}),verifyTotp:r(a({userId:e(),code:e()}),a({valid:g()}),{kind:"mutation",access:"view"}),oauthIssueCode:r(a({integrationId:e(),userId:e(),username:e(),scopes:p(z),redirectUri:e(),hubUrl:e()}),a({code:e()}),{kind:"mutation",access:"create"}),oauthExchangeCode:r(a({code:e(),redirectUri:e()}),a({accessToken:e(),refreshToken:e(),expiresIn:t()}).nullable(),{kind:"mutation",access:"view"}),oauthRefresh:r(a({refreshToken:e()}),a({accessToken:e(),refreshToken:e(),expiresIn:t()}).nullable(),{kind:"mutation",access:"view"}),oauthVerifyAccessToken:r(a({token:e()}),a({userId:e(),username:e(),scopes:p(z)}).nullable(),{access:"view"}),listOauthSessions:r(u(),p(bg),{auth:"admin"}),revokeOauthSession:r(a({id:e()}),a({success:g()}),{kind:"mutation",auth:"admin",access:"delete"})}},io=a({streaming:g(),notifications:g(),objectDetection:g(),remoteAccess:g(),agentCluster:g(),smartHome:g(),recordings:g(),backup:g(),repl:g()}),Cg=a({status:k("ok"),uptime:t()}),Ag=a({name:e(),address:e(),family:e(),internal:g()}),Ng={name:"system",scope:"system",mode:"singleton",methods:{info:r(u(),io),health:r(u(),Cg),featureFlags:r(u(),io),networkAddresses:r(u(),p(Ag).readonly()),getRetentionConfig:r(u(),b().nullable(),{auth:"admin"}),setRetentionConfig:r(I(e(),b()),uc(),{kind:"mutation",auth:"admin"}),forceRetentionCleanup:r(u(),u(),{kind:"mutation",auth:"admin"})}},Pg=a({nominalBitrateKbps:t(),observedBitrateKbps:t(),peakBitrateKbps:t(),packetLossPercent:t(),lastUpdated:t()}),Mg=a({rttMs:t(),jitterMs:t(),estimatedBandwidthKbps:t(),packetLossPercent:t().min(0).max(100),lastUpdated:t()}),so=a({deviceId:t(),streams:I(e(),Pg),client:Mg.optional()}),Dg={name:"network-quality",scope:"system",mode:"singleton",methods:{getDeviceStats:r(a({deviceId:t()}),so.nullable()),getAllStats:r(u(),p(so).readonly()),reportClientStats:r(a({deviceId:t(),rttMs:t().min(0).max(6e4),jitterMs:t().min(0).max(1e4),estimatedBandwidthKbps:t().min(0).max(1e6),packetLossPercent:t().min(0).max(100)}),u(),{kind:"mutation"})}},xg=a({title:e(),message:e(),severity:S(["info","warning","critical"]),duration:t().optional(),action:a({label:e(),url:e()}).optional()}),Tg={name:"toast",scope:"system",mode:"singleton",methods:{onToast:r(u(),xg,{kind:"subscription"})}},Eg=a({addonId:e(),capabilities:p(e()).readonly(),status:e()}),Rg=a({pid:t(),name:e(),state:e(),cpuPercent:t(),memoryRss:t(),uptimeSeconds:t(),services:p(Eg).readonly(),groupId:e().optional()}),Bg=a({id:e(),status:e(),cpuPercent:t(),memoryRss:t()}),qg=a({category:e(),total:t(),healthy:t(),addons:p(Bg).readonly()}),Og=a({id:e(),name:e(),hostname:e(),platform:e(),arch:e(),cpuModel:e().nullable(),cpuCores:t(),memoryMB:t(),engines:p(e()).readonly(),isHub:g(),isOnline:g(),cpuPercent:t(),memoryPercent:t(),uptime:t(),lastSeen:e(),localIps:p(e()).readonly(),addons:p(a({id:e(),capabilities:p(e()).readonly(),status:e()})).readonly(),processes:p(Rg).readonly(),categories:p(qg).readonly()}),Lg=a({callerAddonId:e(),providerAddonId:e(),capName:e(),callsPerMin:t(),lastCallAtMs:t()}),zg=a({nodeId:e(),name:e(),version:e(),status:e(),synced:g()}),Ug=a({hubVersion:e(),nodes:p(zg)}),dt=a({nodeId:e(),addonId:e()}),_g=a({id:e(),status:e(),version:e().optional(),packageName:e().optional()}),me=a({success:g()}),Fg=a({success:g(),reason:e().optional()}),Hg=a({restarted:p(e()).readonly(),failed:p(e()).readonly()}),$g=a({nodeId:e(),name:e()}),Wg={name:"nodes",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{topology:r(u(),p(Og).readonly(),{auth:"admin"}),deployAddon:r(dt,me,{kind:"mutation",auth:"admin"}),undeployAddon:r(dt,me,{kind:"mutation",auth:"admin"}),restartAddon:r(dt,me,{kind:"mutation",auth:"admin"}),restartProcess:r(a({nodeId:e(),processName:e()}),Fg,{kind:"mutation",auth:"admin"}),restartNode:r(a({nodeId:e()}),Hg,{kind:"mutation",auth:"admin"}),shutdownNode:r(a({nodeId:e()}),me,{kind:"mutation",auth:"admin"}),renameNode:r(a({nodeId:e(),name:e().min(1).max(64)}),$g,{kind:"mutation",auth:"admin"}),clusterAddonStatus:r(u(),I(e(),Ug),{auth:"admin"}),getCapUsageGraph:r(a({windowSeconds:t().int().positive().max(300).default(60)}),p(Lg).readonly(),{auth:"admin"}),getNodeAddons:r(a({nodeId:e()}),p(_g).readonly(),{auth:"admin"}),setProcessLogLevel:r(a({nodeId:e(),level:e()}),me,{kind:"mutation",auth:"admin"}),executeQuery:r(a({nodeId:e(),addonId:e(),queryName:e(),params:I(e(),b()).optional()}),b(),{kind:"mutation",auth:"admin"})}},co=a({id:e(),addonId:e(),name:e(),enabled:g(),info:I(e(),b()).readonly(),createdAt:t(),updatedAt:t(),processState:e()}),lt=a({id:e(),addonId:e(),name:e(),enabled:g(),info:I(e(),b()).readonly(),createdAt:t(),updatedAt:t()}),Vg=a({addonId:e(),name:e(),description:e(),iconUrl:e().nullable(),color:e(),instanceMode:e(),discoveryMode:e(),kind:S(["device-adoption","device-provider"]),brokerKind:e().nullable(),supportsLocationImport:g(),existingInstances:p(a({id:e(),name:e()})),canAdd:g()}),Kg=a({success:g(),error:e().optional()}),jg=a({addonId:e(),name:e(),enabled:g().optional(),info:I(e(),b()).optional(),settings:I(e(),b()).optional(),skipRestart:g().optional()}),Gg=a({id:e(),name:e().optional(),enabled:g().optional(),info:I(e(),b()).optional()}),Zg=a({success:g(),deletedId:e()}),Qg={name:"integrations",scope:"system",mode:"singleton",methods:{list:r(u(),p(co)),get:r(a({id:e()}),co),getByAddonId:r(a({addonId:e()}),lt.nullable()),create:r(jg,lt,{kind:"mutation",auth:"admin"}),update:r(Gg,lt,{kind:"mutation",auth:"admin"}),delete:r(a({id:e()}),Zg,{kind:"mutation",auth:"admin"}),getSettings:r(a({id:e()}),I(e(),b()),{auth:"admin"}),setSettings:r(a({id:e(),settings:I(e(),b())}),a({success:g()}),{kind:"mutation",auth:"admin"}),getAvailableTypes:r(u(),p(Vg),{auth:"admin"}),testConnection:r(a({addonId:e(),settings:I(e(),b())}),Kg,{kind:"mutation",auth:"admin"})}},ro=S(["debug","info","warn","error"]),Ut=S(["off","latest","beta"]),ss=S(["off","latest","beta","inherit"]),Yg=a({id:e(),name:e().optional(),version:e().optional(),description:e().optional(),icon:e().optional(),color:e().optional(),capabilities:p(b()).readonly().optional(),packageName:e(),packageVersion:e(),packageDisplayName:e().optional(),bundle:a({displayName:e(),description:e().optional(),icon:e().optional()}).optional(),protected:g().optional(),removable:g().optional()}),Jg=a({pid:t().optional(),mode:e(),state:e()}),Xg=a({phase:S(["pending","healthy","failed"]),retryCount:t(),firstFailureAt:t().nullable(),lastAttemptAt:t().nullable(),lastError:a({message:e(),stack:e().optional()}).nullable(),nextRetryAt:t().nullable(),alertEmitted:g(),retrying:g(),inGracePeriod:g()}),eh=a({manifest:Yg,declaration:b().optional(),source:e(),installSource:e().optional(),process:Jg.optional(),hasBackup:g().optional(),health:Xg.nullable().optional()}),th=a({name:e(),version:e(),dir:e(),installSource:e().optional()}),ah=a({name:e(),currentVersion:e(),latestVersion:e(),category:S(["addon","core"]),requiresRestart:g(),isSystem:g()}),nh=a({version:e(),publishedAt:e(),deprecated:e().optional(),distTags:p(e()).readonly()}),oh=a({name:e(),version:e(),description:e(),keywords:p(e()).readonly(),publishedAt:e(),author:e(),installed:g(),installedVersion:e().optional()}),ih=a({channel:Ut,intervalSeconds:t()}),sh=ss,ch=b(),lo=b(),rh=b(),dh=a({packageName:e(),fromVersion:e(),toVersion:e(),restartingAt:t()}),lh=S(["queued","updating","done","done-pending-restart","failed"]),ph=a({name:e(),isSystem:g(),fromVersion:e(),toVersion:e(),status:lh,error:e().optional(),startedAtMs:t().optional(),completedAtMs:t().optional()}),mh=S(["regular","system","restarting","finalizing"]),po=a({id:e(),nodeId:e(),startedAtMs:t(),completedAtMs:t().optional(),total:t(),completed:t(),failed:t(),current:e().nullable(),phase:mh,cancelled:g(),items:p(ph).readonly()}),uh=a({packageName:e(),currentVersion:e(),latestVersion:e().nullable(),hasUpdate:g(),description:e().optional()}),gh=a({timestamp:e(),level:e(),message:e(),scope:e().optional()}),hh=b(),vh=a({addonId:e().min(1),action:e().min(1),input:b()}),yh={name:"addons",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{list:r(u(),p(eh).readonly()),getLogs:r(a({addonId:e(),limit:t().min(1).max(500).default(100),level:ro.optional()}),p(hh)),listPackages:r(u(),p(th).readonly()),installPackage:r(a({packageName:e(),version:e().optional()}),lo,{kind:"mutation",auth:"admin"}),installFromWorkspace:r(a({packageName:e()}),lo,{kind:"mutation",auth:"admin"}),isWorkspaceAvailable:r(u(),g()),listWorkspacePackages:r(u(),p(b()).readonly()),uninstallPackage:r(a({packageName:e()}),b(),{kind:"mutation",auth:"admin"}),reloadPackages:r(u(),rh,{kind:"mutation",auth:"admin"}),searchAvailable:r(a({query:e().optional()}),p(oh)),listUpdates:r(a({nodeId:e().optional()}),p(ah).readonly(),{auth:"admin"}),updatePackage:r(a({name:e().min(1),version:e().optional(),nodeId:e().optional()}),b(),{kind:"mutation",auth:"admin"}),rollbackPackage:r(a({name:e().min(1)}),a({rolledBackTo:e().nullable()}),{kind:"mutation",auth:"admin"}),forceRefresh:r(a({nodeId:e().optional()}),b(),{kind:"mutation",auth:"admin"}),restartServer:r(a({confirm:k(!0)}),b(),{kind:"mutation",auth:"admin"}),getLastRestart:r(u(),a({kind:S(["framework-update","manual","system","framework-bulk-update"]),packageName:e().optional(),fromVersion:e().optional(),toVersion:e().optional(),requestedBy:e().optional(),requestedAt:t()}).nullable(),{auth:"admin"}),listFrameworkPackages:r(u(),p(uh).readonly(),{auth:"admin"}),listCapabilityProviders:r(a({capName:e().min(1)}),p(a({addonId:e(),mode:S(["singleton","collection"]),isActive:g()})).readonly()),setCapabilityProviderEnabled:r(a({capName:e().min(1),addonId:e().min(1),enabled:g()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),updateFrameworkPackage:r(a({packageName:e().min(1),version:e().optional(),deferRestart:g().optional()}),dh,{kind:"mutation",auth:"admin"}),startBulkUpdate:r(a({nodeId:e(),items:p(a({name:e(),version:e(),isSystem:g()})).readonly()}),a({id:e()}),{kind:"mutation",auth:"admin"}),getBulkUpdateState:r(a({id:e()}),po.nullable(),{auth:"admin"}),cancelBulkUpdate:r(a({id:e()}),a({cancelled:g()}),{kind:"mutation",auth:"admin"}),listActiveBulkUpdates:r(a({nodeId:e().optional()}),p(po).readonly(),{auth:"admin"}),getVersions:r(a({name:e()}),p(nh).readonly()),restartAddon:r(a({addonId:e()}),ch,{kind:"mutation",auth:"admin"}),retryLoad:r(a({packageName:e()}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),getAutoUpdateSettings:r(u(),ih,{auth:"admin"}),setAutoUpdateSettings:r(a({channel:Ut,intervalSeconds:t().min(300).max(86400).optional()}),b(),{kind:"mutation",auth:"admin"}),getAddonAutoUpdate:r(a({addonId:e()}),sh,{auth:"admin"}),setAddonAutoUpdate:r(a({addonId:e(),channel:ss}),b(),{kind:"mutation",auth:"admin"}),applyAutoUpdateToAll:r(a({channel:Ut}),a({success:k(!0)}),{kind:"mutation",auth:"admin"}),custom:r(vh,b(),{kind:"mutation"}),onAddonLogs:r(a({addonId:e(),level:ro.optional()}),gh,{kind:"subscription"})}},Sh=["decoder","motion-detection","pipeline-executor","audio-analyzer","pipeline-analytics","notification-output"],Qv=[...Sh,"pipeline-orchestrator","pipeline-runner"];class Yv{disposers=[];disposed=!1;onError;constructor(o={}){this.onError=o.onError??((n,d)=>{console.error(`[DisposerChain] disposer #${d} threw`,n)})}add(o){if(this.disposed){try{const n=o();n&&typeof n.then=="function"&&n.catch(d=>this.onError(d,-1))}catch(n){this.onError(n,-1)}return()=>{}}return this.disposers.push(o),()=>{const n=this.disposers.indexOf(o);n>=0&&this.disposers.splice(n,1)}}get isDisposed(){return this.disposed}get size(){return this.disposers.length}async dispose(){if(this.disposed)return;this.disposed=!0;const o=this.disposers.slice().reverse();this.disposers=[];for(let n=0;n<o.length;n++){const d=o[n];try{const l=d();l&&typeof l.then=="function"&&await l}catch(l){this.onError(l,o.length-1-n)}}}}const fh="hub-only";function $e(i){return{placement:i.execution?.placement??fh,group:i.execution?.group}}function Jv(i){const o=$e(i).placement;return o==="any-node"||o==="agent-only"}function Xv(i){return $e(i).placement==="agent-only"}function ey(i){return $e(i).group}function ty(i,o){return i.execution?.group??o}function ay(i){return $e(i).placement}var Re=(i=>(i.SystemBoot="system.boot",i.SystemAddonsReady="system.addons-ready",i.SystemRestarting="system.restarting",i.SystemRestartCompleted="system.restart-completed",i.SystemReadyState="system.ready-state",i.AddonStarted="addon.started",i.AddonStopped="addon.stopped",i.AddonRestarted="addon.restarted",i.AddonUpdated="addon.updated",i.AddonInstalled="addon.installed",i.AddonUninstalled="addon.uninstalled",i.AddonCrashed="addon.crashed",i.AddonError="addon.error",i.AddonPageReady="addon.page-ready",i.AddonWidgetReady="addon.widget-ready",i.AddonLoadFailed="addon.load-failed",i.AddonLoadRecovered="addon.load-recovered",i.AddonRetryScheduled="addon.retry-scheduled",i.AddonRetryAttempting="addon.retry-attempting",i.DeviceRegistered="device.registered",i.DeviceUnregistered="device.unregistered",i.DeviceEnabled="device.enabled",i.DeviceDisabled="device.disabled",i.DeviceSettingsUpdated="device.settings-updated",i.DeviceBindingsChanged="device.bindings-changed",i.DeviceMetaChanged="device.meta-changed",i.DeviceSourceInfoChanged="device.source-info-changed",i.DeviceStreamsRegistered="device.streams-registered",i.DeviceProvisioned="device.provisioned",i.DeviceReady="device.ready",i.IntegrationEnabled="integration.enabled",i.IntegrationDisabled="integration.disabled",i.IntegrationDeleted="integration.deleted",i.BrokerStatusChanged="broker.status-changed",i.BrokerMessage="broker.message",i.ProviderStarted="provider.started",i.ProviderStopped="provider.stopped",i.ProcessCrashed="process.crashed",i.ProcessRestartScheduled="process.restart_scheduled",i.ProcessRestarted="process.restarted",i.RecordingStarted="recording.started",i.RecordingStopped="recording.stopped",i.RecordingError="recording.error",i.RecordingHealthDegraded="recording.health.degraded",i.RecordingStorageCritical="recording.storage.critical",i.RecordingSegmentWritten="recording.segment.written",i.RecordingPolicyFallback="recording.policy.fallback",i.RecordingRetentionCompleted="recording.retention.completed",i.DetectionEvent="detection.event",i.SessionTrackNew="session.track.new",i.SessionTrackExpired="session.track.expired",i.BenchmarkProgress="benchmark.progress",i.PlatformProbePhase="platform-probe.phase",i.PipelineProgress="pipeline.progress",i.PipelineTrace="pipeline.trace",i.PipelineInferenceResult="pipeline.inference-result",i.PipelineCameraAssigned="pipeline.camera-assigned",i.PipelineCameraUnassigned="pipeline.camera-unassigned",i.PipelineCameraUpdated="pipeline.camera-updated",i.PipelineRunnerLoadSnapshot="pipeline.runner-load-snapshot",i.PipelineCameraMetricsSnapshot="pipeline.camera-metrics-snapshot",i.StreamBrokerMetricsSnapshot="stream-broker.metrics-snapshot",i.StreamBrokerOnCamStreamDemand="stream-broker.onCamStreamDemand",i.StreamBrokerOnCamStreamIdle="stream-broker.onCamStreamIdle",i.StreamBrokerOnRequestStreamSourceRefresh="stream-broker.onRequestStreamSourceRefresh",i.StreamParamsChanged="stream-params.changed",i.DeviceStateChanged="device.state-changed",i.BatteryOnStatusChanged="battery.onStatusChanged",i.BatteryOnWakeStarted="battery.onWakeStarted",i.DoorbellOnPressed="doorbell.onPressed",i.EventEmitted="event-emitter.event",i.PipelineEngineMetricsSnapshot="pipeline.engine-metrics-snapshot",i.ClusterTopologySnapshot="cluster.topology-snapshot",i.MetricsNodeResourcesSnapshot="metrics.node-resources-snapshot",i.MetricsNodeProcessesSnapshot="metrics.node-processes-snapshot",i.CapabilityBindingChanged="capability.binding-changed",i.ModelDownloadProgress="model.download.progress",i.AgentRegistered="agent.registered",i.AgentUnregistered="agent.unregistered",i.AgentOnline="agent.online",i.AgentOffline="agent.offline",i.WorkerOnline="worker.online",i.WorkerOffline="worker.offline",i.AgentTaskDispatched="agent.task.dispatched",i.AgentTaskAssigned="agent.task.assigned",i.AgentTrpcConnected="agent.trpc.connected",i.AgentWsConnected="agent.ws.connected",i.AgentWsDisconnected="agent.ws.disconnected",i.AgentBackupActivated="agent.backup.activated",i.OrchestrationSettingsUpdated="orchestration.settings-updated",i.PipelineAgentHwaccelChanged="pipeline.agent-hwaccel-changed",i.MotionAnalysis="detection.motion-analysis",i.MotionZonesRaw="detection.motion-zones-raw",i.MotionOnMotionChanged="motion.on-motion-changed",i.DetectionResult="detection.result",i.DetectionRaw="detection.raw",i.DetectionCameraNative="detection.camera-native",i.PipelineAudioInferenceResult="pipeline.audio-inference-result",i.DetectionPhaseTransition="detection.phase-transition",i.ProviderMotion="provider.motion",i.ProviderDetection="provider.detection",i.EnrichmentEmbeddingStored="enrichment.embedding.stored",i.EnrichmentSceneStateChanged="enrichment.scene.state-changed",i.EnrichmentActivitySummary="enrichment.activity.summary",i.PipelineAnalyticsTrackStarted="pipeline-analytics.track-started",i.PipelineAnalyticsTrackEnded="pipeline-analytics.track-ended",i.PipelineAnalyticsDetectionEvent="pipeline-analytics.detection-event",i.PipelineAnalyticsFrameTracked="pipeline-analytics.frame-tracked",i.FrigateLiveEvent="frigate.live-event",i.CameraStreamsProfileSlotsChanged="camera-streams.onProfileSlotsChanged",i.StreamOnline="stream.online",i.StreamOffline="stream.offline",i.NetworkTunnelStarted="network.tunnel.started",i.NetworkTunnelStopped="network.tunnel.stopped",i.LocalNetworkChanged="network.local.changed",i.MeshNetworkChanged="network.mesh.changed",i.BackupCompleted="backup.completed",i.BackupRestored="backup.restored",i.NotificationDispatched="notification.dispatched",i.NotificationFailed="notification.failed",i.DeviceUpdated="device.updated",i.DeviceOnline="device.online",i.DeviceOffline="device.offline",i.DeviceAwake="device.awake",i.DeviceSleeping="device.sleeping",i.RetentionCleanup="retention.cleanup",i.AddonsBulkUpdateProgress="addons.bulk-update-progress",i))(Re||{});function ny(i,o){return i.category===o}function ta(i,o,n){return{id:typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2),timestamp:new Date,source:o,category:i,data:n}}function bh(i,o){const n=o.ts??Date.now();i.emit(ta("system.ready-state",{type:"capability",id:o.capName,nodeId:o.sourceNodeId},{capName:o.capName,scope:o.scope,state:o.state,generation:o.generation,sourceNodeId:o.sourceNodeId,ts:n}))}function mo(i){const o=async()=>{const h=(await i.read())[i.key];if(h===void 0)return i.fallback;const y=i.schema.safeParse(h);return y.success?y.data:(i.onParseError?.(i.key,y.error),i.fallback)},n=async l=>{const h=i.schema.parse(l);await i.write({[i.key]:h})};return{get:o,set:n,update:async l=>{await n(l(await o()))}}}class Ih{_ctx=null;_config;_readinessGeneration=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2,14);_registeredCapNames=[];defaults;constructor(o){this.defaults=o,this._config={...o}}get autoEmitReadiness(){return!0}get ctx(){if(!this._ctx)throw new Error(`${this.constructor.name}: ctx accessed before initialize()`);return this._ctx}get ctxIfReady(){return this._ctx}get config(){return this._config}async initialize(o){this._ctx=o,await this.resolveConfig();const n=await this.onInitialize();this.emitLifecycle(Re.AddonStarted);const d=kh(n),l=d&&"providers"in d&&d.providers?d.providers:[];return this._registeredCapNames=l.map(h=>h.capability.name),d}postBrokerStart(){this.autoEmitReadiness&&this._registeredCapNames.length>0&&this.emitReadinessForProviders("ready")}async onHubReachable(){}async shutdown(){this.emitLifecycle(Re.AddonStopped),this.autoEmitReadiness&&this.emitReadinessForProviders("down"),await this.onShutdown();for(const o of this._subscriptions)o();this._subscriptions=[],this._ctx=null}async onShutdown(){}async onConfigChanged(){}field(o){return o}schema(o){return o}globalSettingsSchema(o){return null}deviceSettingsSchema(){return null}async getGlobalSettings(o,n){const d=this.globalSettingsSchema(n);if(!d)return{sections:[]};const l=await this._ctx?.settings?.readAddonStore()??{};return Ca(d,o?{...l,...o}:l)}async updateGlobalSettings(o){await this._ctx?.settings?.writeAddonStore(o),await this.resolveConfig(),await this.onConfigChanged(),this.emitLifecycle(Re.AddonUpdated,{level:"global"}),this.maybeAutoRestart(o,this.globalSettingsSchema())}maybeAutoRestart(o,n){if(!n)return;const d=new Set;for(const m of n.sections)for(const v of m.fields)v.type==="separator"||v.type==="info"||v.requiresRestart&&d.add(v.key);if(d.size===0||!Object.keys(o).some(m=>d.has(m)))return;const h=this._ctx;if(!h)return;const y=h.id;setImmediate(()=>{h.api.addons?.restartAddon?.mutate({addonId:y}).then(()=>{h.logger.info("addon auto-restart triggered by restart-required setting change",{meta:{changedFields:Object.keys(o).filter(v=>d.has(v))}})}).catch(v=>{h.logger.error("addon auto-restart failed",{meta:{error:v instanceof Error?v.message:String(v)}})})})}async getDeviceSettings(o){const n=this.deviceSettingsSchema();if(!n)return{sections:[]};const d=await this._ctx?.settings?.readDeviceStore(o)??{};return Ca(n,d)}async updateDeviceSettings(o,n){await this._ctx?.settings?.writeDeviceStore(o,n)}_subscriptions=[];watchCapability(o,n){const d=Array.isArray(o)?o:[o],l=new Set(d);this.subscribe({category:"system.ready-state"},h=>{const y=h.data;if(typeof y.capName!="string"||!l.has(y.capName)||y.scope?.type!=="node")return;const m=y.scope.nodeId;if(typeof m!="string"||m.length===0)return;const v=y.capName;y.state==="down"?n.onDown?.(m,v):y.state==="ready"&&n.onReady?.(m,v)})}subscribe(o,n){const d=this.ctx.eventBus.subscribe(o,n);this._subscriptions.push(d)}emitLifecycle(o,n){try{const d=this._ctx;if(!d)return;d.eventBus.emit({id:`${d.id}-${Date.now()}`,timestamp:new Date,source:{type:"addon",id:d.id,nodeId:d.kernel.localNodeId??"hub"},category:o,data:{addonId:d.id,...n??{}}})}catch{}}emitReadinessForProviders(o){const n=this._ctx;if(!n||this._registeredCapNames.length===0)return;const d=n.kernel?.localNodeId??"hub",l=d.includes("/")?d.split("/")[0]:d;for(const h of this._registeredCapNames)try{bh(n.eventBus,{capName:h,scope:{type:"node",nodeId:l},state:o,generation:this._readinessGeneration,sourceNodeId:l})}catch{}}async resolveModelsDir(){return this.ctx.api.storage.resolve.query({location:"models",relativePath:""}).catch(()=>"camstack-data/models")}get capabilities(){return this.ctx.capabilities??null}async resolveConfig(){const o=await this.readAddonStoreWithRetry(),n={...this.defaults};for(const d of Object.keys(this.defaults)){const l=o[d];if(l!=null){const h=typeof this.defaults[d];typeof l===h&&(n[d]=l)}}this._config=n}state(o,n,d){return mo({key:o,schema:n,fallback:d,read:()=>this.readAddonStoreWithRetry(),write:async l=>{await this._ctx?.settings?.writeAddonStore(l)},onParseError:(l,h)=>this._ctx?.logger?.warn?.(`durable-state: stored "${l}" failed validation — using fallback`,{meta:{addonId:this._ctx?.id,key:l,error:String(h)}})})}deviceState(o,n,d,l){return mo({key:n,schema:d,fallback:l,read:async()=>await this._ctx?.settings?.readDeviceStore(o)??{},write:async h=>{await this._ctx?.settings?.writeDeviceStore(o,h)},onParseError:(h,y)=>this._ctx?.logger?.warn?.(`durable-state: stored device ${o} "${h}" failed validation — using fallback`,{meta:{addonId:this._ctx?.id,deviceId:o,key:h,error:String(y)}})})}async readAddonStoreWithRetry(){const o=this._ctx?.settings;if(!o)return{};const n=[150,350,600,900];let d;for(let l=0;l<=n.length;l++)try{return await o.readAddonStore()??{}}catch(h){d=h;const y=h instanceof Error?h.message:String(h);if(!(y.includes("SqliteSettingsBackend not initialized")||y.includes("provider not available")))throw h;if(l===n.length)break;await new Promise(v=>setTimeout(v,n[l]))}return this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults",{meta:{error:d instanceof Error?d.message:String(d)}}),{}}}function kh(i){if(i!=null)return Array.isArray(i)?{providers:i}:i}function oy(i,o){return{id:i,getRoutes:()=>o,invoke:async n=>{const d=wh(o,n.method,n.path);if(!d)return{status:404,headers:{},redirectUrl:null,body:{error:`No route matches ${n.method} ${n.path}`}};const l={status:200,headers:{},redirectUrl:null},h=Ah(l),y={params:{...n.params,...d.params},query:n.query,body:n.body,headers:n.headers,...n.user?{user:n.user}:{},...n.scopedToken!==void 0?{scopedToken:n.scopedToken}:{}};return await d.route.handler(y,h),l}}}function wh(i,o,n){const d=o.toUpperCase();for(const l of i){if(l.method!==d)continue;const h=Ch(l.path,n);if(h!==null)return{route:l,params:h}}return null}function Ch(i,o){const n=i.split("/").filter(Boolean),d=o.split("/").filter(Boolean);if(n.length!==d.length)return null;const l={};for(let h=0;h<n.length;h++){const y=n[h],m=d[h];if(y.startsWith(":"))l[y.slice(1)]=m;else if(y!==m)return null}return l}function Ah(i){const o={status(n){return i.status=n,o},code(n){return i.status=n,o},send(n){i.body=n},redirect(n){i.redirectUrl=n,i.status===200&&(i.status=302)},header(n,d){return i.headers[n.toLowerCase()]=d,o},type(n){return i.contentType=n,o}};return o}const J={offsetHours:1,startMonth:3,startWeekIndex:5,startWeekday:"Sunday",startHour:2,endMonth:10,endWeekIndex:5,endWeekday:"Sunday",endHour:3},Ae={offsetHours:1,startMonth:3,startWeekIndex:2,startWeekday:"Sunday",startHour:2,endMonth:11,endWeekIndex:1,endWeekday:"Sunday",endHour:2},Nh={offsetHours:1,startMonth:10,startWeekIndex:1,startWeekday:"Sunday",startHour:2,endMonth:4,endWeekIndex:1,endWeekday:"Sunday",endHour:3},Ph=[{id:"UTC",label:"UTC (UTC+0)",region:"Universal",stdOffsetMinutes:0,dst:null},{id:"Europe/London",label:"Europe/London (UTC+0 / BST)",region:"Europe",stdOffsetMinutes:0,dst:J},{id:"Europe/Rome",label:"Europe/Rome (UTC+1 / CEST)",region:"Europe",stdOffsetMinutes:60,dst:J},{id:"Europe/Paris",label:"Europe/Paris (UTC+1 / CEST)",region:"Europe",stdOffsetMinutes:60,dst:J},{id:"Europe/Berlin",label:"Europe/Berlin (UTC+1 / CEST)",region:"Europe",stdOffsetMinutes:60,dst:J},{id:"Europe/Madrid",label:"Europe/Madrid (UTC+1 / CEST)",region:"Europe",stdOffsetMinutes:60,dst:J},{id:"Europe/Amsterdam",label:"Europe/Amsterdam (UTC+1 / CEST)",region:"Europe",stdOffsetMinutes:60,dst:J},{id:"Europe/Istanbul",label:"Europe/Istanbul (UTC+3)",region:"Europe",stdOffsetMinutes:180,dst:null},{id:"America/New_York",label:"America/New York (UTC−5 / EDT)",region:"Americas",stdOffsetMinutes:-300,dst:Ae},{id:"America/Chicago",label:"America/Chicago (UTC−6 / CDT)",region:"Americas",stdOffsetMinutes:-360,dst:Ae},{id:"America/Denver",label:"America/Denver (UTC−7 / MDT)",region:"Americas",stdOffsetMinutes:-420,dst:Ae},{id:"America/Los_Angeles",label:"America/Los Angeles (UTC−8 / PDT)",region:"Americas",stdOffsetMinutes:-480,dst:Ae},{id:"America/Sao_Paulo",label:"America/Sao Paulo (UTC−3)",region:"Americas",stdOffsetMinutes:-180,dst:null},{id:"Asia/Dubai",label:"Asia/Dubai (UTC+4)",region:"Asia",stdOffsetMinutes:240,dst:null},{id:"Asia/Kolkata",label:"Asia/Kolkata (UTC+5:30)",region:"Asia",stdOffsetMinutes:330,dst:null},{id:"Asia/Singapore",label:"Asia/Singapore (UTC+8)",region:"Asia",stdOffsetMinutes:480,dst:null},{id:"Asia/Shanghai",label:"Asia/Shanghai (UTC+8)",region:"Asia",stdOffsetMinutes:480,dst:null},{id:"Asia/Tokyo",label:"Asia/Tokyo (UTC+9)",region:"Asia",stdOffsetMinutes:540,dst:null},{id:"Australia/Sydney",label:"Australia/Sydney (UTC+10 / AEDT)",region:"Oceania",stdOffsetMinutes:600,dst:Nh}];function iy(i){return Ph.find(o=>o.id===i)}class Mh extends Error{capName;scope;waitedMs;constructor(o,n,d){super(`Timed out waiting for ${o} (${ae(n)}) to become ready after ${d}ms`),this.name="ReadinessTimeoutError",this.capName=o,this.scope=n,this.waitedMs=d}}function pt(i,o){return`${i}|${ae(o)}`}function ae(i){switch(i.type){case"global":return"global";case"node":return`node:${i.nodeId}`;case"device":return`device:${i.deviceId}`}}function mt(i,o){return i.type!==o.type?!1:i.type==="global"||o.type==="global"?!0:i.type==="node"&&o.type==="node"?i.nodeId===o.nodeId:i.type==="device"&&o.type==="device"?i.deviceId===o.deviceId:!1}class sy{bus;sourceNodeId;logger;now;generation;snapshot=new Map;subscriptions=new Set;unsubscribeBus;unsubscribeAgentOffline;constructor(o){if(this.bus=o.eventBus,this.sourceNodeId=o.sourceNodeId,this.logger=o.logger,this.now=o.now??(()=>Date.now()),this.generation=o.generation??Dh(),this.unsubscribeBus=this.bus.subscribe({category:"system.ready-state"},n=>this.ingest(n.data)),this.unsubscribeAgentOffline=this.bus.subscribe({category:"agent.offline"},n=>this.synthesizeDownForNode(n.data.agentId)),typeof this.bus.getRecent=="function")try{const n=this.bus.getRecent({category:"system.ready-state"});for(const d of n)this.ingest(d.data)}catch{}}close(){this.unsubscribeBus(),this.unsubscribeAgentOffline(),this.subscriptions.clear()}get(o,n){return this.snapshot.get(pt(o,n))??null}getSnapshotForTransport(){return Array.from(this.snapshot.values())}hydrate(o){const n=this.now();for(const d of o){const l=pt(d.capName,d.scope);if(this.snapshot.has(l))continue;const h={capName:d.capName,scope:d.scope,state:d.state,generation:d.generation,epoch:1,lastChange:n,sourceNodeId:d.sourceNodeId};this.snapshot.set(l,h),this.logger&&this.logger.debug(`readiness: ${d.capName} (${ae(d.scope)}) → ${d.state} (hydrated, gen=${d.generation.slice(0,6)})`);const y={capName:d.capName,scope:d.scope,state:d.state,epoch:1,generation:d.generation,sourceNodeId:"hydrated",ts:n,durationInPrevState:0};for(const m of this.subscriptions)if(m.capName===d.capName&&mt(m.scope,d.scope))try{m.handler(y)}catch(v){this.logger?.warn(`readiness hydrate handler threw for ${d.capName}: ${v.message??String(v)}`)}}}getAll(){return new Map(this.snapshot)}emitReady(o,n){this.emitTransition(o,n,"ready")}emitStarting(o,n){this.emitTransition(o,n,"starting")}emitDown(o,n){this.emitTransition(o,n,"down")}awaitReady(o,n,d={}){const l=d.timeoutMs??Number.POSITIVE_INFINITY,h=this.now();return this.get(o,n)?.state==="ready"?Promise.resolve():d.signal?.aborted?Promise.reject(d.signal.reason??new Error("aborted")):new Promise((m,v)=>{let w=!1;const A=this.onReadyState(o,n,q=>{q.state==="ready"&&(w||(w=!0,D(),m()))}),P=!Number.isFinite(l)?null:setTimeout(()=>{w||(w=!0,D(),v(new Mh(o,n,this.now()-h)))},l),B=setInterval(()=>{w||this.logger?.warn(`readiness: still awaiting ${o} (${ae(n)}) after ${this.now()-h}ms`)},3e4);typeof B.unref=="function"&&B.unref();const M=()=>{w||(w=!0,D(),v(d.signal?.reason??new Error("aborted")))};d.signal?.addEventListener("abort",M,{once:!0});function D(){A(),P!==null&&clearTimeout(P),clearInterval(B),d.signal?.removeEventListener("abort",M)}})}onReadyState(o,n,d){const l={capName:o,scope:n,handler:d};this.subscriptions.add(l);const h=this.get(o,n);return h!==null&&queueMicrotask(()=>{this.subscriptions.has(l)&&d({capName:o,scope:n,state:h.state,epoch:h.epoch,generation:h.generation,sourceNodeId:this.sourceNodeId,ts:h.lastChange,durationInPrevState:0})}),()=>{this.subscriptions.delete(l)}}emitTransition(o,n,d){const l=this.now();this.bus.emit(ta("system.ready-state",{type:"capability",id:o,nodeId:this.sourceNodeId},{capName:o,scope:n,state:d,generation:this.generation,sourceNodeId:this.sourceNodeId,ts:l}))}ingest(o){if(typeof o?.capName!="string"||o.state!=="ready"&&o.state!=="starting"&&o.state!=="down"||typeof o.generation!="string"||o.scope?.type!=="global"&&o.scope?.type!=="node"&&o.scope?.type!=="device")return;const n=pt(o.capName,o.scope),d=this.snapshot.get(n)??null,l=this.now();let h;if(d===null?h=o.state==="ready"?1:0:d.generation!==o.generation&&o.state==="ready"?h=d.epoch+1:h=d.epoch,d!==null&&d.generation===o.generation&&d.state===o.state)return;const y=d===null?0:Math.max(0,l-d.lastChange),m={capName:o.capName,scope:o.scope,state:o.state,generation:o.generation,epoch:h,lastChange:l,sourceNodeId:o.sourceNodeId};this.snapshot.set(n,m);const v={capName:o.capName,scope:o.scope,state:o.state,epoch:h,generation:o.generation,sourceNodeId:o.sourceNodeId,ts:o.ts,durationInPrevState:y};this.logger&&this.logger.debug(`readiness: ${o.capName} (${ae(o.scope)}) → ${o.state} epoch=${h} gen=${o.generation.slice(0,6)} (prev ${y}ms)`);for(const w of this.subscriptions)if(w.capName===o.capName&&mt(w.scope,o.scope))try{w.handler(v)}catch(A){this.logger?.warn(`readiness handler threw for ${o.capName}: ${A.message??String(A)}`)}}synthesizeDownForNode(o){const n=this.now();for(const[d,l]of this.snapshot){if(l.state==="down"||!(l.scope.type==="node"&&l.scope.nodeId===o||l.scope.type==="device"&&l.sourceNodeId===o))continue;const y=Math.max(0,n-l.lastChange),m={...l,state:"down",lastChange:n};this.snapshot.set(d,m);const v={capName:l.capName,scope:l.scope,state:"down",epoch:l.epoch,generation:l.generation,sourceNodeId:this.sourceNodeId,ts:n,durationInPrevState:y};this.logger&&this.logger.debug(`readiness: ${l.capName} (${ae(l.scope)}) → down (synthesized from agent.offline ${o})`);for(const w of this.subscriptions)if(w.capName===l.capName&&mt(w.scope,l.scope))try{w.handler(v)}catch(A){this.logger?.warn(`readiness handler threw during agent.offline demux for ${l.capName}: ${A.message??String(A)}`)}}}}function Dh(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2,14)}function cy(i,o){for(const{capName:n,scope:d}of o)i.emitDown(n,d)}const ry="x-camstack-dataplane-secret",xh={high:"High",mid:"Mid",low:"Low"};function dy(i){return xh[i]??i.charAt(0).toUpperCase()+i.slice(1)}function Th(i){return(i.width??0)*(i.height??0)}function Eh(i){if(i.length===0)return[];const o=i.map((d,l)=>({s:d,i:l,px:Th(d.metadata??{})})).sort((d,l)=>l.px-d.px),n=Array.from({length:i.length});for(let d=0;d<o.length;d++){const{s:l,i:h}=o[d];let y;d===0?y="high":d===o.length-1?y="low":y="mid",n[h]={...l,quality:y}}return n}function ly(i){const o=i.height??0,n=i.width??0;return o>=1080||n>=1920?"high":o>=480||n>=640?"mid":"low"}function py(i){const o=i.protocols.find(l=>l.type==="rtsp"&&l.url)??i.protocols.find(l=>l.url),n=o?.type,d=n==="rtsp"?"rtsp":n==="http"||n==="flv"?"http-mjpeg":"custom";return{id:i.id,label:i.label??i.id,protocol:d,url:o?.url,profileHint:i.quality}}function _(i){return typeof i=="string"}function Rh(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Bh(i){return _(i)&&i.trim()?{url:i}:Rh(i)&&_(i.url)&&i.url.trim()?{url:i.url,label:_(i.label)?i.label:void 0}:null}function my(i){const o=_(i.snapshot_url)?i.snapshot_url:void 0;if(Array.isArray(i.streams)){const y=[];for(const m of i.streams){const v=Bh(m);v&&y.push(v)}return{streams:y,snapshot_url:o}}const n=[],d=_(i.main_stream_url)?i.main_stream_url:void 0;d&&n.push({url:d,label:_(i.main_stream_name)?i.main_stream_name:void 0});const l=_(i.sub_stream_url)?i.sub_stream_url:void 0;l&&n.push({url:l,label:_(i.sub_stream_name)?i.sub_stream_name:void 0});const h=_(i.third_stream_url)?i.third_stream_url:void 0;return h&&n.push({url:h,label:_(i.third_stream_name)?i.third_stream_name:void 0}),{streams:n,snapshot_url:o}}function uy(i){if(i.length===0)return{};const o=Eh(i),n={},d=o.find(m=>m.quality==="high"),l=o.find(m=>m.quality==="mid"),h=o.find(m=>m.quality==="low");d&&(n.high=d.id),l&&(n.mid=l.id),h&&(n.low=h.id);const y=d??l??h??o[0];return y&&(n.high||(n.high=y.id),n.mid||(n.mid=y.id),n.low||(n.low=y.id)),n}const gy={streaming:!0,notifications:!0,objectDetection:!1,remoteAccess:!0,agentCluster:!1,smartHome:!0,recordings:!0,backup:!0,repl:!0},hy=["face","plate"],vy=["face","plate","clip","custom"];function yy(i,o,n,d={}){if(i.length===0)return null;const l=`${n}/`,h=v=>({brokerId:v.brokerId,profileId:v.brokerId.startsWith(l)?v.brokerId.slice(l.length):v.brokerId,url:v.url,mutedUrl:v.mutedUrl,enabled:v.enabled,...v.codec!==void 0?{codec:v.codec}:{},...v.resolution!==void 0?{resolution:v.resolution}:{}});if(o!=="auto"){const v=i.find(w=>w.enabled&&w.url.length>0&&(w.profile===o||w.brokerId===`${l}${o}`));if(v)return h(v)}const y=i.filter(v=>v.enabled&&v.url.length>0);if(y.length===0)return null;const m=d.targetResolution;if(m){const v=y.filter(w=>w.resolution!==void 0);if(v.length>0){const w=qh(v,m);if(w)return h(w)}}return h(y[0])}function qh(i,o){const n=o.width*o.height;let d,l;for(const h of i){if(h.resolution===void 0)continue;const y=h.resolution.width*h.resolution.height;y>=n?(!d||y<d.pixels)&&(d={entry:h,pixels:y}):(!l||y>l.pixels)&&(l={entry:h,pixels:y})}return d?.entry??l?.entry}const Sy={cleanupIntervalMs:3600*1e3,detectionEventsDays:30,audioLevelsDays:7,snapshotsDays:14};var Oh=(i=>(i.Addon="addon",i.Core="core",i.Device="device",i.Provider="provider",i.System="system",i))(Oh||{});const Lh="camstack/camstack-models",fy=`https://huggingface.co/${Lh}/resolve/main`,by={"features.streaming":!0,"features.notifications":!0,"features.objectDetection":!1,"features.remoteAccess":!0,"features.agentCluster":!1,"features.smartHome":!0,"features.recordings":!0,"features.backup":!0,"features.repl":!0,"retention.detectionEventsDays":30,"retention.audioLevelsDays":7,"logging.level":"info","logging.retentionDays":30,"eventBus.ringBufferSize":1e4,"storage.provider":"sqlite-storage","storage.locations":{data:"camstack-data/data",media:"camstack-data/media",recordings:"camstack-data/recordings",cache:"/tmp/camstack-cache",logs:"camstack-data/logs",models:"camstack-data/models"},providers:[],"ffmpeg.binaryPath":"ffmpeg","ffmpeg.hwAccel":"auto","ffmpeg.threadCount":0,"auth.tokenExpiry":"24h"};function cs(i){return JSON.parse(i)}function zh(i){return i===null||typeof i!="object"||Array.isArray(i)?null:{...i}}function Iy(i){return Array.isArray(i)?i:[]}function ky(i,o=""){return typeof i=="string"?i:o}function wy(i,o=0){return typeof i=="number"?i:o}function Cy(i,o=!1){return typeof i=="boolean"?i:o}function Ay(i){try{return zh(cs(i))}catch{return null}}function Ny(i){try{const o=cs(i);return Array.isArray(o)?o:null}catch{return null}}function Py(i,o){return`https://huggingface.co/${i}/resolve/main/${o}`}function My(i,o){if(i.length!==o.length)return 0;let n=0,d=0,l=0;for(let y=0;y<i.length;y++)n+=i[y]*o[y],d+=i[y]*i[y],l+=o[y]*o[y];const h=Math.sqrt(d)*Math.sqrt(l);return h===0?0:n/h}class Dy{constructor(o,n){this.elementId=o,this.getBackend=typeof n=="function"?n:()=>n}cache={};listeners=new Set;loaded=!1;getBackend;async ensureLoaded(){if(this.loaded)return;const o=this.getBackend();if(!o)throw new Error(`ElementConfigStore(${this.elementId}): settings backend not available`);const n=await o.query({collection:"config",filter:{where:{id:this.elementId},limit:1}});n.length>0&&(this.cache=n[0].data??{}),this.loaded=!0}getAll(){return{...this.cache}}get(o){const n=o.split(".");let d=this.cache;for(const l of n){if(d===null||typeof d!="object"||Array.isArray(d))return;d=Reflect.get(d,l)}return d}async set(o,n){await this.ensureLoaded(),Uh(this.cache,o,n),await this.persist(),this.notifyListeners()}async setAll(o){await this.ensureLoaded(),this.cache={...o},await this.persist(),this.notifyListeners()}onChange(o){return this.listeners.add(o),()=>{this.listeners.delete(o)}}async load(){await this.ensureLoaded()}async loadDefaults(o){await this.ensureLoaded(),Object.keys(this.cache).length===0&&(this.cache={...o},await this.persist())}async persist(){const o=this.getBackend();if(!o)throw new Error(`ElementConfigStore(${this.elementId}): settings backend not available — cannot persist config`);await o.set({collection:"config",key:this.elementId,value:this.cache})}notifyListeners(){const o=this.getAll();for(const n of this.listeners)try{n(o)}catch{}}}function Uh(i,o,n){const d=o.split(".");let l=i;for(let h=0;h<d.length-1;h++){const y=d[h],m=l[y];if(m===null||typeof m!="object"||Array.isArray(m)){const v={};l[y]=v,l=v}else l=m}l[d[d.length-1]]=n}const rs={cpu:"onnx",coreml:"onnx",cuda:"onnx",tensorrt:"onnx","onnx-py":"onnx",pytorch:"pt",openvino:"openvino"},_h={onnx:"onnx",coreml:"coreml",openvino:"openvino",tflite:"tflite",pytorch:"pt"},Fh={coreml:"coreml_inference.py",pytorch:"pytorch_inference.py",openvino:"openvino_inference.py"};function Hh(i,o){return i==="node"?"onnx":{coreml:"coreml",openvino:"openvino",pytorch:"pytorch","onnx-py":"onnx",cpu:"onnx"}[o]??o}function xy(i,o){return i==="node"?rs[o]??"onnx":{coreml:"coreml",openvino:"openvino",pytorch:"pt","onnx-py":"onnx",cpu:"onnx"}[o]??"onnx"}function Ty(i,o){return!i||i==="auto"?"auto":Hh(i,o??"cpu")}function Ey(i){return rs[i]??"onnx"}function Ry(i){return _h[i]}function By(i){return Fh[i]}function qy(i){return i==="coreml"||i==="pytorch"||i==="openvino"}async function Oy(i,o){const n=performance.now();try{return{output:o!==void 0?await $h(i(),o):await i(),durationMs:uo(performance.now()-n),ok:!0}}catch(d){return{output:void 0,durationMs:uo(performance.now()-n),ok:!1,error:$c(d)}}}function uo(i){return Math.round(i*100)/100}function $h(i,o){return new Promise((n,d)=>{const l=setTimeout(()=>d(new Error(`Inference timeout after ${o}ms`)),o);i.then(h=>{clearTimeout(l),n(h)}).catch(h=>{clearTimeout(l),d(h)})})}const Ly=[{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"}],zy=[{id:"person",name:"Person"},{id:"vehicle",name:"Vehicle"},{id:"animal",name:"Animal"}],Uy={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"},preserveOriginal:!1},_y={camera:{type:"camera",label:"Camera",icon:"camera"}};class he{schema;data;persistFn;constructor(o,n,d){this.schema=o,this.data=n,this.persistFn=d}static fromSchema(o,n,d={},l){const h=o.safeParse(d);if(h.success)return new he(o,h.data,n);const y=new Set;for(const A of h.error.issues){const C=A.path[0];typeof C=="string"&&y.add(C)}const m={...d};for(const A of y)delete m[A];const v=o.safeParse(m);if(l?.({droppedKeys:[...y],issues:h.error.issues}),v.success)return n(v.data).catch(()=>{}),new he(o,v.data,n);const w=o.parse({});return new he(o,w,n)}get values(){return this.data}get(o){return this.data[o]}async set(o,n){const d=this.schema.parse({...this.data,[o]:n});this.data=d,await this.persistFn(this.data)}async setAll(o){const n=this.schema.parse({...this.data,...o});this.data=n,await this.persistFn(this.data)}async deleteKey(o){const{[o]:n,...d}=this.data,l=this.schema.parse(d);this.data=l,await this.persistFn(this.data)}entries(){const o=this.schema.shape;return Object.entries(o).map(([n,d])=>({key:n,schema:d,value:this.data[n],description:d.description}))}}class aa{writer;pendingWrites=new Set;slices;schemas=new Map;listeners=new Set;capListeners=new Map;constructor(o,n){this.writer=n,this.slices=new Map;for(const[d,l]of Object.entries(o))l&&typeof l=="object"&&!Array.isArray(l)&&this.slices.set(d,{...l})}static fromInitial(o,n){return new aa(o,n)}installCapSchema(o,n){const d=this.schemas.get(o);if(d){if(d!==n)throw new Error(`[DeviceRuntimeState] capability "${o}" registered a different runtime-state schema; each cap must declare ONE shape across every provider`);return}this.schemas.set(o,n);const l=this.slices.get(o);if(l){const h=n.safeParse(l);h.success?this.slices.set(o,h.data):this.slices.delete(o)}}getCapState(o){const n=this.slices.get(o);if(n)return Object.freeze({...n})}getCapField(o,n){return this.slices.get(o)?.[n]}setCapState(o,n){this.applyCapWrite(o,n,!1)}patchCapState(o,n){this.applyCapWrite(o,n,!0)}applyCapWrite(o,n,d){const l=this.schemas.get(o);if(!l)throw new Error(`[DeviceRuntimeState] no schema registered for cap "${o}" — did the device register it via ctx.registerNativeCap before writing?`);const h=this.slices.get(o)??{},y=d?{...h,...n}:{...n},m=l.parse(y);if(Wh(h,m))return;this.slices.set(o,m),this.fireListeners([o]);const v=this.writer(o,{...m}).catch(()=>{});this.pendingWrites.add(v),v.finally(()=>{this.pendingWrites.delete(v)})}fireListeners(o){const n=this.snapshot();for(const d of this.listeners)try{d(o,n)}catch{}for(const d of o){const l=this.capListeners.get(d);if(!l)continue;const h=this.getCapState(d);for(const y of l)try{y(h)}catch{}}}subscribe(o){return this.listeners.add(o),()=>{this.listeners.delete(o)}}subscribeCap(o,n){let d=this.capListeners.get(o);d||(d=new Set,this.capListeners.set(o,d));const l=h=>{n(h)};return d.add(l),()=>{const h=this.capListeners.get(o);h&&(h.delete(l),h.size===0&&this.capListeners.delete(o))}}snapshot(){const o={};for(const[n,d]of this.slices)o[n]=Object.freeze({...d});return Object.freeze(o)}async flush(){if(this.pendingWrites.size===0)return;const o=[...this.pendingWrites];await Promise.allSettled(o)}}function Wh(i,o){const n=Object.keys(i),d=Object.keys(o);if(n.length!==d.length)return!1;for(const l of n)if(i[l]!==o[l])return!1;return!0}const ut="lastFetchedAt";function Fy(i){const{runtimeState:o,cap:n,ownDeviceId:d,refresh:l,staleMs:h,empty:y}=i,m=async()=>{const A=o.getCapState(n.name),C=typeof A?.[ut]=="number"?A[ut]:0;(!A||Date.now()-C>h)&&await l()},v=()=>{const A=o.getCapState(n.name);if(!A)return y();const{[ut]:C,...P}=A;return P};return{ensureFresh:m,getStatus:async({deviceId:A})=>{if(A!==d)throw new Error(`${n.name}: deviceId mismatch, expected ${d}, got ${A}`);return await m(),v()}}}const Vh={airQualitySensor:wo,alarmPanel:Ao,ambientLightSensor:No,audioMetrics:Po,automationControl:Mo,battery:Do,binary:xo,brightness:To,cameraStreams:Eo,carbonMonoxide:Ro,climateControl:Bo,color:qo,connectivity:Oo,consumables:Lo,contact:zo,control:Uo,cover:_o,deviceDiscovery:Ho,deviceStatus:Wt,doorbell:$o,enumSensor:Wo,eventEmitter:Ko,fanControl:Go,featureProbe:Vt,flood:Zo,gas:Qo,humidifier:Yo,humiditySensor:Jo,image:Xo,lawnMowerControl:ei,lockControl:ti,mediaPlayer:ni,motion:si,motionTrigger:ri,motionZones:hi,nativeObjectDetection:Si,notifier:fi,numericSensor:bi,powerMeter:Ii,presence:ki,pressureSensor:wi,privacyMask:Ai,ptzAutotrack:Ni,scriptRunner:Pi,smoke:Mi,streamParams:Di,switch:xi,tamper:Ti,temperatureSensor:Ei,update:Ri,vacuumControl:Bi,valve:qi,vibration:Oi,waterHeater:Li,weather:zi,zoneAnalytics:Ui,zoneRules:_i,zones:oi};class Hy{id;stableId;type;name;parentDeviceId;role;get online(){return this.runtimeState.getCapState("device-status")?.online??!1}set online(o){this.markOnline(o)}get state(){if(!this._stateProxyCache){const o={},n={get:(d,l)=>{const h=l;if(h in o)return o[h];const y=Vh[h];if(!y)return;const m=this.sliceProxy(y);return o[h]=m,m}};this._stateProxyCache=new Proxy(o,n)}return this._stateProxyCache}_stateProxyCache;config;runtimeState;ctx;location;disabled;_sourceInfoCache=null;constructor(o,n,d){if(this.ctx=o,this.id=o.id,this.stableId=o.stableId,this.type=d.type,!o.deviceMeta)throw new Error(`BaseDevice constructor: ctx.deviceMeta is required (id=${o.id} stableId=${o.stableId})`);this.name=o.deviceMeta.name,this.location=o.deviceMeta.location,this.disabled=o.deviceMeta.disabled,this.role=d.role,this.parentDeviceId=o.parentDeviceId;const l=o.persistedConfig??{};this.config=he.fromSchema(n,A=>o.persistConfig(A),l,({droppedKeys:A,issues:C})=>{o.logger.warn("Device config recovery: dropping invalid persisted fields",{tags:{deviceId:o.id,stableId:o.stableId},meta:{droppedKeys:[...A],firstIssue:C[0]?.message??null}})});let h=null;const y=async(A,C)=>{h||(h=o.fetchDevice(o.id)),await(await h).deviceState.setCapSlice({capName:A,slice:C})},m=o.initialRuntimeState??{};this.runtimeState=aa.fromInitial(m,y),o.bindRuntimeState?.(this.runtimeState),o.registerNativeCap?.(Wt,{});const v={online:!0,lastChangedAt:Date.now()};this.runtimeState.setCapState("device-status",v),o.registerNativeCap?.(Vt,{});const w={flags:{},deviceType:null,model:null,channelCount:null,lastProbedAt:0,lastFetchedAt:0};this.runtimeState.setCapState("feature-probe",w)}deviceActions=new Map;registerDeviceAction(o,n,d){this.deviceActions.set(o,{spec:n,handler:d})}async runDeviceAction(o,n){const d=this.deviceActions.get(o);if(!d)throw new Error(`unknown device action "${o}" on device ${this.id}`);const l=d.spec.input.parse(n);return d.handler(l)}async removeDevice(){}markOnline(o){if(this.online===o)return;const n={online:o,lastChangedAt:Date.now()};this.runtimeState.setCapState("device-status",n)}get sourceInfo(){if(this._sourceInfoCache)return this._sourceInfoCache;const n=xr(this.ctx.deviceMeta.metadata)??Mr({stableId:this.stableId,addonId:this.ctx.deviceMeta.addonId});return this._sourceInfoCache=Object.freeze({...n}),this._sourceInfoCache}get sourceId(){return this.sourceInfo.id}async updateSourceInfo(o){const n=Dr(this.sourceInfo,o);this._sourceInfoCache=Object.freeze({...n});const l=this.ctx.api?.deviceManager?.setMetadata;if(l)try{await l.mutate({deviceId:this.id,patch:{[Fo]:n}})}catch{}this.ctx.eventBus.emit(ta("device.source-info-changed",{type:"device",id:this.stableId},{deviceId:this.id,sourceInfo:n}))}async refreshFeatures(){const n=this.ctx.api?.deviceManager?.registerDevice;if(n)try{await n.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(o){return this.runtimeState.getCapState(o.name)??null}setCapSlice(o,n){this.runtimeState.setCapState(o.name,n)}sliceProxy(o){const n={},d={get:(l,h)=>this.runtimeState.getCapState(o.name)?.[h],set:(l,h,y)=>(this.runtimeState.patchCapState(o.name,{[h]:y}),!0),has:(l,h)=>{const y=this.runtimeState.getCapState(o.name);return y?h in y:!1},ownKeys:()=>{const l=this.runtimeState.getCapState(o.name);return l?Object.keys(l):[]},getOwnPropertyDescriptor:(l,h)=>{const y=this.runtimeState.getCapState(o.name);if(!(!y||!(h in y)))return{configurable:!0,enumerable:!0,value:y[h]}}};return new Proxy(n,d)}getSettingsUISchema(){return{sections:[]}}async applySettingsPatch(o){await this.config.setAll(o)}async onProbe(){}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}}function Kh(i,o){const n={};for(const d of i.config.entries())n[d.key]=d.value;return{id:i.id,stableId:i.stableId,addonId:o,type:String(i.type),name:i.name,parentDeviceId:i.parentDeviceId,online:i.online,features:[...i.features],config:n,sourceInfo:i.sourceInfo}}class $y extends Ih{async onInitialize(){return this.ctx.logger.info(`${this.providerName} Provider initialized`),[{capability:Fi,provider:this}]}async onShutdown(){const o=await this.ctx.kernel.devices?.getAll()??[];for(const n of o)try{await this.ctx.kernel.devices?.decommission(n.id)}catch(d){this.ctx.logger.warn(`${this.providerName}: decommission failed`,{tags:{deviceId:n.id,stableId:n.stableId},meta:{error:d instanceof Error?d.message:String(d)}})}this.ctx.logger.info(`${this.providerName} Provider shut down`,{meta:{decommissionedCount:o.length}})}async start(){}async stop(){}async getStatus(){return{connected:!0,deviceCount:(await this.ctx.kernel.devices?.getAll()??[]).length}}async getDevices(){return(await this.ctx.kernel.devices?.getAll()??[]).map(n=>({id:n.stableId,name:n.name,type:String(n.type)}))}async supportsDiscovery(){return!1}async discoverDevices(){return[]}async adoptDiscoveredDevice(o){throw new Error(`${this.providerName} provider does not support discovery-based adoption`)}async supportsManualCreation(){return!0}async getChildCreationSchema(o){return this.onGetCreationSchema(o.type)}async createDevice(o){const n=await this.onCreateDevice(o.type,o.config),d=this.deviceClasses[n.meta.type];if(!d)throw new Error(`${this.providerName} provider: no device class registered for type "${n.meta.type}" — add it to the deviceClasses map`);const l=this.generateStableId(n.meta.type,n.config),h=await this.ctx.kernel.devices.create(l,d,n.config,null,n.meta);if(n.onAfterCreate)try{await n.onAfterCreate(h)}catch(y){this.ctx.logger.warn("createDevice: onAfterCreate hook threw — device is already registered",{tags:{deviceId:h.id,stableId:l},meta:{error:y instanceof Error?y.message:String(y)}})}return this.toSummary(h)}generateStableId(o,n){return`${this.addonId}-${Date.now()}`}async testCreationField(o){return{status:"ok",labels:["probe not implemented"]}}async restoreDevices(o){await this.onRestoreDevices(o),o.length>0&&this.ctx.logger.info(`Restored ${o.length} ${this.providerName} device(s)`)}async onRestoreDevices(o){const n=new Set;for(const l of o){if(l.parentDeviceId!==null)continue;const h=this.deviceClasses[l.type];if(!h){this.ctx.logger.warn("No device class registered for restored type — skipping",{tags:{stableId:l.stableId},meta:{type:l.type}});continue}try{await this.ctx.kernel.devices.create(l.stableId,h,{}),n.add(l.id)}catch(y){this.ctx.logger.warn("Failed to restore device",{tags:{stableId:l.stableId},meta:{type:l.type,error:y instanceof Error?y.message:String(y)}})}}const d=o.filter(l=>l.parentDeviceId!==null);for(const l of d){const h=this.deviceClasses[l.type];if(h&&l.parentDeviceId!==null&&n.has(l.parentDeviceId))try{await this.ctx.kernel.devices.create(l.stableId,h,{},l.parentDeviceId),n.add(l.id)}catch(y){this.ctx.logger.warn("Failed to restore hub-adopted child",{tags:{stableId:l.stableId,parentDeviceId:l.parentDeviceId},meta:{type:l.type,error:y instanceof Error?y.message:String(y)}})}}}toSummary(o){return Kh(o,this.addonId)}}function ve(i){return i.def}function Wy(i,o="Configuration",n="main"){const d=i.map(l=>jh(l.key,l.schema,l.description));return{sections:[{id:n,title:o,fields:d}]}}function jh(i,o,n){const d=Be(o),l=Jh(o),h=n??ds(i),y={key:i,label:h,description:n,default:l};return d instanceof bo?Gh(i,y):d instanceof fo?Zh(d,y):d instanceof Io?{...y,type:"boolean"}:d instanceof So?Yh(d,y):d instanceof gc||d instanceof vt?{...y,type:"textarea",rows:6,isJson:!0}:{...y,type:"text"}}function Gh(i,o){const n=i.toLowerCase();return n.includes("password")||n.includes("secret")||n.includes("token")||n.includes("apikey")||n.includes("api_key")?{...o,type:"password",showToggle:!0}:{...o,type:"text"}}function Zh(i,o){const n=i,d=n.minValue,l=n.maxValue,h=d!=null&&isFinite(d)?d:void 0,y=l!=null&&isFinite(l)?l:void 0,m=Qh(i);return{...o,type:"number",...h!==void 0?{min:h}:{},...y!==void 0?{max:y}:{},...m!==void 0?{step:m}:{}}}function Qh(i){const n=ve(i).checks??[];for(const d of n)if(d._zod?.def?.check==="multiple_of"&&d._zod.def.value!==void 0)return d._zod.def.value}function Yh(i,o){const n=i.options.map(l=>String(l));return{...o,type:"select",options:n.map(l=>({label:ds(l),value:l}))}}function Be(i){return i instanceof Ft||i instanceof yo||i instanceof vo?Be(ve(i).innerType):i}function Jh(i){if(i instanceof Ft)return ve(i).defaultValue}function ds(i){return i.replace(/([A-Z])/g," $1").replace(/[_-]/g," ").replace(/^\w/,o=>o.toUpperCase()).trim()}function ls(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}function Vy(i,o){const n=o.split(".");let d=i;for(const l of n){if(!ls(d))return;d=d[l]}return d}function Xh(i,o,n){const d=o.indexOf(".");if(d===-1)return{...i,[o]:n};const l=o.slice(0,d),h=o.slice(d+1),y=i[l],m=ls(y)?y:{};return{...i,[l]:Xh(m,h,n)}}function Ky(i,o){if(!o||o.kind==="identity")return i;if(o.kind==="enum-map"){const n=String(i);return Object.prototype.hasOwnProperty.call(o.mapping,n)?o.mapping[n]:o.fallback??null}if(o.kind==="linear"){if(typeof i!="number"||Number.isNaN(i))return null;let n=i*o.scale+o.offset;if(o.clamp){const d=o.clamp[0],l=o.clamp[1];n=Math.min(l,Math.max(d,n))}return n}return i}function _t(i){let o=i;for(;o instanceof vo||o instanceof yo||o instanceof Ft;)o=o.unwrap();return o}function ev(i){const o=_t(i);return o instanceof So?{kind:"enum",enumValues:o.options}:o instanceof fo?{kind:"number"}:o instanceof bo?{kind:"string"}:o instanceof Io?{kind:"boolean"}:null}function tv(i,o=""){const n=_t(i);if(!(n instanceof vt))return[];const d=[],l=n.shape;for(const[h,y]of Object.entries(l)){const m=o?`${o}.${h}`:h,v=_t(y);if(v instanceof vt){d.push(...tv(v,m));continue}const w=ev(y);w&&d.push({path:m,kind:w.kind,...w.enumValues?{enumValues:w.enumValues}:{}})}return d}const av="device.state-changed";function ps(i){const o=new Map,n=new Map;let d=null;const l=(m,v)=>`${m}:${v}`,h=()=>{d||i.live?.onEvent&&(d=i.live.onEvent.subscribe({category:av},{onData:m=>{const v=m.data;if(!v||typeof v.deviceId!="number"||typeof v.capName!="string")return;const w=l(v.deviceId,v.capName);o.set(w,v.slice);const A=n.get(w);if(A)for(const C of A)try{C(v.slice)}catch{}}}))},y=()=>{d&&(n.size>0||(d.unsubscribe(),d=null))};return{read(m,v){return o.get(l(m,v))},async refresh(m,v){const w=await i.deviceState.getCapSlice.query({deviceId:m,capName:v}),A=l(m,v);o.set(A,w??void 0);const C=n.get(A);if(C)for(const P of C)try{P(w??void 0)}catch{}},watch(m,v,w){const A=l(m,v);let C=n.get(A);return C||(C=new Set,n.set(A,C)),C.add(w),h(),()=>{C.delete(w),C.size===0&&n.delete(A),y()}},async write(m,v,w){await i.deviceState.setCapSlice.mutate({deviceId:m,capName:v,slice:w})}}}function nv(i,o,n){const d=(l,h)=>`${l}:${h}`;return{read(l,h){return i.get(l)?.get(h)},async refresh(){},watch(l,h,y){const m=d(l,h);let v=o.get(m);return v||(v=new Set,o.set(m,v)),v.add(y),()=>{v.delete(y),v.size===0&&o.delete(m)}},async write(l,h,y){if(!n)throw new Error("createMirrorSource: write requires an api reference — pass it as the third argument when constructing the source");await n.deviceState.setCapSlice.mutate({deviceId:l,capName:h,slice:y})}}}function N(i,o,n){const d=ov(i)?i:ps(i);return{get value(){return d.read(o,n)},refresh(){return d.refresh(o,n)},subscribe(l){const h=d.watch(o,n,y=>{try{l(y)}catch{}});try{l(d.read(o,n))}catch{}return d.read(o,n)===void 0&&d.refresh(o,n).catch(()=>{}),h},async set(l){await d.write(o,n,l)},async patch(l){const y={...d.read(o,n)??{},...l};await d.write(o,n,y)}}}function ov(i){return typeof i.read=="function"&&typeof i.watch=="function"}function iv(i,o,n){const d=i,l=n?.stateSource??ps(i);function h(c,H){const $=typeof c=="object"&&c!==null?c:{};return H!==void 0?{...$,deviceId:o.deviceId,nodeId:H}:{...$,deviceId:o.deviceId}}function y(c,H,$,G,le){const be=d[c]?.[H];if(!be)throw new Error(`DeviceProxy: api has no '${c}.${H}'`);const pe=be;return $==="mutation"?pe.mutate(G):$==="subscription"?pe.subscribe(G,le):pe.query(G)}function m(c,H,$,G,le,be){const pe=o.entries.find(dc=>dc.capName===c);return y(H,$,G,h(le,pe?.providerNodeId),be)}function v(c,H,$,G,le){return y(c,H,$,h(G,void 0),le)}const w={setChildHidden:c=>m("accessories","accessories","setChildHidden","mutation",c),getStatus:c=>m("accessories","accessories","getStatus","query",c)},A={getStatus:c=>m("air-quality-sensor","airQualitySensor","getStatus","query",c)},C={arm:c=>m("alarm-panel","alarmPanel","arm","mutation",c),disarm:c=>m("alarm-panel","alarmPanel","disarm","mutation",c),trigger:c=>m("alarm-panel","alarmPanel","trigger","mutation",c),getStatus:c=>m("alarm-panel","alarmPanel","getStatus","query",c)},P={getStatus:c=>m("ambient-light-sensor","ambientLightSensor","getStatus","query",c)},E={resolveDeviceSettings:c=>m("audio-analysis","audioAnalysis","resolveDeviceSettings","query",c),getDeviceSettingsContribution:c=>m("audio-analysis","audioAnalysis","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("audio-analysis","audioAnalysis","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("audio-analysis","audioAnalysis","applyDeviceSettingsPatch","mutation",c)},B={getCurrentSnapshot:c=>m("audio-metrics","audioMetrics","getCurrentSnapshot","query",c),getHistory:c=>m("audio-metrics","audioMetrics","getHistory","query",c)},M={enable:c=>m("automation-control","automationControl","enable","mutation",c),disable:c=>m("automation-control","automationControl","disable","mutation",c),trigger:c=>m("automation-control","automationControl","trigger","mutation",c),getStatus:c=>m("automation-control","automationControl","getStatus","query",c)},D={wakeForStream:c=>m("battery","battery","wakeForStream","mutation",c),getStatus:c=>m("battery","battery","getStatus","query",c)},q={getStatus:c=>m("binary","binary","getStatus","query",c)},na={setBrightness:c=>m("brightness","brightness","setBrightness","mutation",c),getStatus:c=>m("brightness","brightness","getStatus","query",c)},oa={press:c=>m("button","button","press","mutation",c)},ia={getCredentials:c=>m("camera-credentials","cameraCredentials","getCredentials","query",c),getStatus:c=>m("camera-credentials","cameraCredentials","getStatus","query",c)},sa={getCameraStreams:c=>m("camera-streams","cameraStreams","getCameraStreams","query",c),getBrokerStreams:c=>m("camera-streams","cameraStreams","getBrokerStreams","query",c),getRtspEntries:c=>m("camera-streams","cameraStreams","getRtspEntries","query",c),getProfileRtspEntries:c=>m("camera-streams","cameraStreams","getProfileRtspEntries","query",c),pickStream:c=>m("camera-streams","cameraStreams","pickStream","query",c)},ca={getStatus:c=>m("carbon-monoxide","carbonMonoxide","getStatus","query",c)},ra={setMode:c=>m("climate-control","climateControl","setMode","mutation",c),setFanMode:c=>m("climate-control","climateControl","setFanMode","mutation",c),setPreset:c=>m("climate-control","climateControl","setPreset","mutation",c),setTarget:c=>m("climate-control","climateControl","setTarget","mutation",c),setTargetRange:c=>m("climate-control","climateControl","setTargetRange","mutation",c),setTargetHumidity:c=>m("climate-control","climateControl","setTargetHumidity","mutation",c),getStatus:c=>m("climate-control","climateControl","getStatus","query",c)},da={setColor:c=>m("color","color","setColor","mutation",c),getStatus:c=>m("color","color","getStatus","query",c)},la={getStatus:c=>m("connectivity","connectivity","getStatus","query",c)},pa={reset:c=>m("consumables","consumables","reset","mutation",c),getStatus:c=>m("consumables","consumables","getStatus","query",c)},ma={getStatus:c=>m("contact","contact","getStatus","query",c)},ua={setValue:c=>m("control","control","setValue","mutation",c),getStatus:c=>m("control","control","getStatus","query",c)},ga={open:c=>m("cover","cover","open","mutation",c),close:c=>m("cover","cover","close","mutation",c),stop:c=>m("cover","cover","stop","mutation",c),setPosition:c=>m("cover","cover","setPosition","mutation",c),setTiltPosition:c=>m("cover","cover","setTiltPosition","mutation",c),getStatus:c=>m("cover","cover","getStatus","query",c)},ha={getDeviceSettingsContribution:c=>m("detection-pipeline","detectionPipeline","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("detection-pipeline","detectionPipeline","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("detection-pipeline","detectionPipeline","applyDeviceSettingsPatch","mutation",c)},va={listDiscovered:c=>m("device-discovery","deviceDiscovery","listDiscovered","query",c),refreshDiscovery:c=>m("device-discovery","deviceDiscovery","refreshDiscovery","mutation",c),adoptDevice:c=>m("device-discovery","deviceDiscovery","adoptDevice","mutation",c),releaseDevice:c=>m("device-discovery","deviceDiscovery","releaseDevice","mutation",c),getStatus:c=>m("device-discovery","deviceDiscovery","getStatus","query",c)},ya={getStreamSources:c=>m("device-ops","deviceOps","getStreamSources","query",c),getConfigEntries:c=>m("device-ops","deviceOps","getConfigEntries","query",c),setConfig:c=>m("device-ops","deviceOps","setConfig","mutation",c),runAction:c=>m("device-ops","deviceOps","runAction","mutation",c),removeDevice:c=>m("device-ops","deviceOps","removeDevice","mutation",c),getSettingsSchema:c=>m("device-ops","deviceOps","getSettingsSchema","query",c),getRawState:c=>m("device-ops","deviceOps","getRawState","query",c)},Sa={getStatus:c=>m("device-status","deviceStatus","getStatus","query",c)},fa={getStatus:c=>m("doorbell","doorbell","getStatus","query",c)},ba={getStatus:c=>m("enum-sensor","enumSensor","getStatus","query",c)},Ia={getStatus:c=>m("event-emitter","eventEmitter","getStatus","query",c)},ka={getEvents:c=>m("events","events","getEvents","query",c),getEventThumbnail:c=>m("events","events","getEventThumbnail","query",c),getEventClipUrl:c=>m("events","events","getEventClipUrl","query",c)},s={setPercentage:c=>m("fan-control","fanControl","setPercentage","mutation",c),setPreset:c=>m("fan-control","fanControl","setPreset","mutation",c),setDirection:c=>m("fan-control","fanControl","setDirection","mutation",c),setOscillating:c=>m("fan-control","fanControl","setOscillating","mutation",c),getStatus:c=>m("fan-control","fanControl","getStatus","query",c)},K={getStatus:c=>m("feature-probe","featureProbe","getStatus","query",c)},Se={getStatus:c=>m("flood","flood","getStatus","query",c)},re={getStatus:c=>m("gas","gas","getStatus","query",c)},We={setOn:c=>m("humidifier","humidifier","setOn","mutation",c),setTargetHumidity:c=>m("humidifier","humidifier","setTargetHumidity","mutation",c),setMode:c=>m("humidifier","humidifier","setMode","mutation",c),getStatus:c=>m("humidifier","humidifier","getStatus","query",c)},fe={getStatus:c=>m("humidity-sensor","humiditySensor","getStatus","query",c)},de={getStatus:c=>m("image","image","getStatus","query",c)},ms={startSession:c=>m("intercom","intercom","startSession","mutation",c),handleAnswer:c=>m("intercom","intercom","handleAnswer","mutation",c),stopSession:c=>m("intercom","intercom","stopSession","mutation",c),startTalkSession:c=>m("intercom","intercom","startTalkSession","mutation",c),pushTalkAudio:c=>m("intercom","intercom","pushTalkAudio","mutation",c),endTalkSession:c=>m("intercom","intercom","endTalkSession","mutation",c),getStatus:c=>m("intercom","intercom","getStatus","query",c)},us={startMowing:c=>m("lawn-mower-control","lawnMowerControl","startMowing","mutation",c),pause:c=>m("lawn-mower-control","lawnMowerControl","pause","mutation",c),dock:c=>m("lawn-mower-control","lawnMowerControl","dock","mutation",c),getStatus:c=>m("lawn-mower-control","lawnMowerControl","getStatus","query",c)},gs={lock:c=>m("lock-control","lockControl","lock","mutation",c),unlock:c=>m("lock-control","lockControl","unlock","mutation",c),open:c=>m("lock-control","lockControl","open","mutation",c),getStatus:c=>m("lock-control","lockControl","getStatus","query",c)},hs={play:c=>m("media-player","mediaPlayer","play","mutation",c),pause:c=>m("media-player","mediaPlayer","pause","mutation",c),stop:c=>m("media-player","mediaPlayer","stop","mutation",c),next:c=>m("media-player","mediaPlayer","next","mutation",c),previous:c=>m("media-player","mediaPlayer","previous","mutation",c),seek:c=>m("media-player","mediaPlayer","seek","mutation",c),setVolume:c=>m("media-player","mediaPlayer","setVolume","mutation",c),setMute:c=>m("media-player","mediaPlayer","setMute","mutation",c),setShuffle:c=>m("media-player","mediaPlayer","setShuffle","mutation",c),setRepeat:c=>m("media-player","mediaPlayer","setRepeat","mutation",c),selectSource:c=>m("media-player","mediaPlayer","selectSource","mutation",c),playMedia:c=>m("media-player","mediaPlayer","playMedia","mutation",c),getStatus:c=>m("media-player","mediaPlayer","getStatus","query",c)},vs={isDetected:c=>m("motion","motion","isDetected","query",c),getStatus:c=>m("motion","motion","getStatus","query",c)},ys={analyze:c=>m("motion-detection","motionDetection","analyze","mutation",c),removeCamera:c=>m("motion-detection","motionDetection","removeCamera","mutation",c),reset:c=>m("motion-detection","motionDetection","reset","mutation",c),getDeviceSettingsContribution:c=>m("motion-detection","motionDetection","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("motion-detection","motionDetection","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("motion-detection","motionDetection","applyDeviceSettingsPatch","mutation",c)},Ss={setMotionTrigger:c=>m("motion-trigger","motionTrigger","setMotionTrigger","mutation",c),getStatus:c=>m("motion-trigger","motionTrigger","getStatus","query",c)},fs={getOptions:c=>m("motion-zones","motionZones","getOptions","query",c),setZone:c=>m("motion-zones","motionZones","setZone","mutation",c),getStatus:c=>m("motion-zones","motionZones","getStatus","query",c)},bs={setEnabled:c=>m("native-object-detection","nativeObjectDetection","setEnabled","mutation",c),getStatus:c=>m("native-object-detection","nativeObjectDetection","getStatus","query",c)},Is={send:c=>m("notifier","notifier","send","mutation",c),cancel:c=>m("notifier","notifier","cancel","mutation",c),getStatus:c=>m("notifier","notifier","getStatus","query",c)},ks={getStatus:c=>m("numeric-sensor","numericSensor","getStatus","query",c)},ws={setOverlay:c=>m("osd","osd","setOverlay","mutation",c),getStatus:c=>m("osd","osd","getStatus","query",c)},Cs={getActiveTracks:c=>m("pipeline-analytics","pipelineAnalytics","getActiveTracks","query",c),getTrack:c=>m("pipeline-analytics","pipelineAnalytics","getTrack","query",c),listTracks:c=>m("pipeline-analytics","pipelineAnalytics","listTracks","query",c),clearTracks:c=>m("pipeline-analytics","pipelineAnalytics","clearTracks","mutation",c),getMotionEvents:c=>m("pipeline-analytics","pipelineAnalytics","getMotionEvents","query",c),getObjectEvents:c=>m("pipeline-analytics","pipelineAnalytics","getObjectEvents","query",c),getAudioEvents:c=>m("pipeline-analytics","pipelineAnalytics","getAudioEvents","query",c),getEventDensity:c=>m("pipeline-analytics","pipelineAnalytics","getEventDensity","query",c),pruneEventsBefore:c=>m("pipeline-analytics","pipelineAnalytics","pruneEventsBefore","mutation",c),getEventMedia:c=>m("pipeline-analytics","pipelineAnalytics","getEventMedia","query",c),getTrackMedia:c=>m("pipeline-analytics","pipelineAnalytics","getTrackMedia","query",c),getDeviceSettingsContribution:c=>m("pipeline-analytics","pipelineAnalytics","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("pipeline-analytics","pipelineAnalytics","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("pipeline-analytics","pipelineAnalytics","applyDeviceSettingsPatch","mutation",c)},As={getStatus:c=>m("power-meter","powerMeter","getStatus","query",c)},Ns={getStatus:c=>m("presence","presence","getStatus","query",c)},Ps={getStatus:c=>m("pressure-sensor","pressureSensor","getStatus","query",c)},Ms={getOptions:c=>m("privacy-mask","privacyMask","getOptions","query",c),setMask:c=>m("privacy-mask","privacyMask","setMask","mutation",c),getStatus:c=>m("privacy-mask","privacyMask","getStatus","query",c)},Ds={move:c=>m("ptz","ptz","move","mutation",c),continuousMove:c=>m("ptz","ptz","continuousMove","mutation",c),stop:c=>m("ptz","ptz","stop","mutation",c),getPresets:c=>m("ptz","ptz","getPresets","query",c),goToPreset:c=>m("ptz","ptz","goToPreset","mutation",c),savePreset:c=>m("ptz","ptz","savePreset","mutation",c),deletePreset:c=>m("ptz","ptz","deletePreset","mutation",c),getOptions:c=>m("ptz","ptz","getOptions","query",c),goHome:c=>m("ptz","ptz","goHome","mutation",c),getPosition:c=>m("ptz","ptz","getPosition","query",c),setAutofocus:c=>m("ptz","ptz","setAutofocus","mutation",c),getStatus:c=>m("ptz","ptz","getStatus","query",c)},xs={getStatus:c=>m("ptz-autotrack","ptzAutotrack","getStatus","query",c),setEnabled:c=>m("ptz-autotrack","ptzAutotrack","setEnabled","mutation",c),getSettings:c=>m("ptz-autotrack","ptzAutotrack","getSettings","query",c),setSettings:c=>m("ptz-autotrack","ptzAutotrack","setSettings","mutation",c)},Ts={reboot:c=>m("reboot","reboot","reboot","mutation",c)},Es={run:c=>m("script-runner","scriptRunner","run","mutation",c),stop:c=>m("script-runner","scriptRunner","stop","mutation",c),getStatus:c=>m("script-runner","scriptRunner","getStatus","query",c)},Rs={getStatus:c=>m("smoke","smoke","getStatus","query",c)},Bs={getSnapshot:c=>m("snapshot","snapshot","getSnapshot","query",c),invalidateCache:c=>m("snapshot","snapshot","invalidateCache","mutation",c),getStatus:c=>m("snapshot","snapshot","getStatus","query",c),getDeviceSettingsContribution:c=>m("snapshot","snapshot","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("snapshot","snapshot","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("snapshot","snapshot","applyDeviceSettingsPatch","mutation",c)},qs={getCatalog:c=>m("stream-catalog","streamCatalog","getCatalog","query",c)},Os={getOptions:c=>m("stream-params","streamParams","getOptions","query",c),setProfile:c=>m("stream-params","streamParams","setProfile","mutation",c),getConfigSchema:c=>m("stream-params","streamParams","getConfigSchema","query",c),getStatus:c=>m("stream-params","streamParams","getStatus","query",c)},Ls={setState:c=>m("switch","switch","setState","mutation",c),getStatus:c=>m("switch","switch","getStatus","query",c)},zs={getStatus:c=>m("tamper","tamper","getStatus","query",c)},Us={getStatus:c=>m("temperature-sensor","temperatureSensor","getStatus","query",c)},_s={installUpdate:c=>m("update","update","installUpdate","mutation",c),getStatus:c=>m("update","update","getStatus","query",c)},Fs={start:c=>m("vacuum-control","vacuumControl","start","mutation",c),pause:c=>m("vacuum-control","vacuumControl","pause","mutation",c),stop:c=>m("vacuum-control","vacuumControl","stop","mutation",c),returnToBase:c=>m("vacuum-control","vacuumControl","returnToBase","mutation",c),locate:c=>m("vacuum-control","vacuumControl","locate","mutation",c),setFanSpeed:c=>m("vacuum-control","vacuumControl","setFanSpeed","mutation",c),getStatus:c=>m("vacuum-control","vacuumControl","getStatus","query",c)},Hs={open:c=>m("valve","valve","open","mutation",c),close:c=>m("valve","valve","close","mutation",c),stop:c=>m("valve","valve","stop","mutation",c),setPosition:c=>m("valve","valve","setPosition","mutation",c),getStatus:c=>m("valve","valve","getStatus","query",c)},$s={getStatus:c=>m("vibration","vibration","getStatus","query",c)},Ws={setTargetTemp:c=>m("water-heater","waterHeater","setTargetTemp","mutation",c),setOperationMode:c=>m("water-heater","waterHeater","setOperationMode","mutation",c),setAway:c=>m("water-heater","waterHeater","setAway","mutation",c),getStatus:c=>m("water-heater","waterHeater","getStatus","query",c)},Vs={getStatus:c=>m("weather","weather","getStatus","query",c)},Ks={listStreams:c=>m("webrtc-session","webrtcSession","listStreams","query",c),createSession:c=>m("webrtc-session","webrtcSession","createSession","mutation",c),handleOffer:c=>m("webrtc-session","webrtcSession","handleOffer","mutation",c),handleAnswer:c=>m("webrtc-session","webrtcSession","handleAnswer","mutation",c),addIceCandidate:c=>m("webrtc-session","webrtcSession","addIceCandidate","mutation",c),getIceCandidates:c=>m("webrtc-session","webrtcSession","getIceCandidates","query",c),closeSession:c=>m("webrtc-session","webrtcSession","closeSession","mutation",c),hasAdaptiveBitrate:c=>m("webrtc-session","webrtcSession","hasAdaptiveBitrate","query",c),getSessionState:c=>m("webrtc-session","webrtcSession","getSessionState","query",c)},js={getCurrentSnapshot:c=>m("zone-analytics","zoneAnalytics","getCurrentSnapshot","query",c),getZoneHistory:c=>m("zone-analytics","zoneAnalytics","getZoneHistory","query",c),getCameraHistory:c=>m("zone-analytics","zoneAnalytics","getCameraHistory","query",c),getUnzonedHistory:c=>m("zone-analytics","zoneAnalytics","getUnzonedHistory","query",c)},Gs={listRules:c=>m("zone-rules","zoneRules","listRules","query",c),setRules:c=>m("zone-rules","zoneRules","setRules","mutation",c)},Zs={listZones:c=>m("zones","zones","listZones","query",c),addZone:c=>m("zones","zones","addZone","mutation",c),removeZone:c=>m("zones","zones","removeZone","mutation",c),updateZone:c=>m("zones","zones","updateZone","mutation",c)},Qs={getDeviceSettings:c=>v("addonSettings","getDeviceSettings","query",c),updateDeviceSettings:c=>v("addonSettings","updateDeviceSettings","mutation",c)},Ys={getDeviceSettingsContribution:c=>v("cameraPipelineConfig","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>v("cameraPipelineConfig","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>v("cameraPipelineConfig","applyDeviceSettingsPatch","mutation",c)},Js={getStatus:c=>v("deviceAdoption","getStatus","query",c)},Xs={getDeviceSettingsContribution:c=>v("deviceExport","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>v("deviceExport","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>v("deviceExport","applyDeviceSettingsPatch","mutation",c)},ec={loadConfig:c=>v("deviceManager","loadConfig","query",c),loadRuntimeState:c=>v("deviceManager","loadRuntimeState","query",c),loadMeta:c=>v("deviceManager","loadMeta","query",c),setName:c=>v("deviceManager","setName","mutation",c),setLocation:c=>v("deviceManager","setLocation","mutation",c),setType:c=>v("deviceManager","setType","mutation",c),setIntegrationId:c=>v("deviceManager","setIntegrationId","mutation",c),setLinkDeviceId:c=>v("deviceManager","setLinkDeviceId","mutation",c),setPrimaryChildEntityId:c=>v("deviceManager","setPrimaryChildEntityId","mutation",c),setChildLayout:c=>v("deviceManager","setChildLayout","mutation",c),setDeviceLinks:c=>v("deviceManager","setDeviceLinks","mutation",c),getWireableFields:c=>v("deviceManager","getWireableFields","query",c),setRole:c=>v("deviceManager","setRole","mutation",c),applyInitialMeta:c=>v("deviceManager","applyInitialMeta","mutation",c),setMetadata:c=>v("deviceManager","setMetadata","mutation",c),setDisabled:c=>v("deviceManager","setDisabled","mutation",c),getDevice:c=>v("deviceManager","getDevice","query",c),getStreamSources:c=>v("deviceManager","getStreamSources","query",c),getConfigSchema:c=>v("deviceManager","getConfigSchema","query",c),getSettingsSchema:c=>v("deviceManager","getSettingsSchema","query",c),updateConfig:c=>v("deviceManager","updateConfig","mutation",c),enable:c=>v("deviceManager","enable","mutation",c),disable:c=>v("deviceManager","disable","mutation",c),remove:c=>v("deviceManager","remove","mutation",c),getStreamProfileMap:c=>v("deviceManager","getStreamProfileMap","query",c),setStreamProfileMap:c=>v("deviceManager","setStreamProfileMap","mutation",c),probeStreams:c=>v("deviceManager","probeStreams","mutation",c),getBindings:c=>v("deviceManager","getBindings","query",c),getAllBindings:c=>v("deviceManager","getAllBindings","query",c),setWrapperActive:c=>v("deviceManager","setWrapperActive","mutation",c),getDeviceSettingsAggregate:c=>v("deviceManager","getDeviceSettingsAggregate","query",c),getDeviceLiveInfoAggregate:c=>v("deviceManager","getDeviceLiveInfoAggregate","query",c),getDeviceAggregate:c=>v("deviceManager","getDeviceAggregate","query",c),runDeviceAction:c=>v("deviceManager","runDeviceAction","mutation",c),updateDeviceField:c=>v("deviceManager","updateDeviceField","mutation",c),updateDeviceFieldsBatch:c=>v("deviceManager","updateDeviceFieldsBatch","mutation",c),testField:c=>v("deviceManager","testField","mutation",c),getDeviceStatusAggregate:c=>v("deviceManager","getDeviceStatusAggregate","query",c)},tc={getSnapshot:c=>v("deviceState","getSnapshot","query",c),getCapSlice:c=>v("deviceState","getCapSlice","query",c),setCapSlice:c=>v("deviceState","setCapSlice","mutation",c)},ac={getDeviceStats:c=>v("networkQuality","getDeviceStats","query",c),reportClientStats:c=>v("networkQuality","reportClientStats","mutation",c)},nc={runPipeline:c=>v("pipelineExecutor","runPipeline","mutation",c),runPipelineBatch:c=>v("pipelineExecutor","runPipelineBatch","mutation",c)},oc={assignPipeline:c=>v("pipelineOrchestrator","assignPipeline","mutation",c),unassignPipeline:c=>v("pipelineOrchestrator","unassignPipeline","mutation",c),getPipelineAssignment:c=>v("pipelineOrchestrator","getPipelineAssignment","query",c),getCameraMetrics:c=>v("pipelineOrchestrator","getCameraMetrics","query",c),assignDecoder:c=>v("pipelineOrchestrator","assignDecoder","mutation",c),unassignDecoder:c=>v("pipelineOrchestrator","unassignDecoder","mutation",c),assignAudio:c=>v("pipelineOrchestrator","assignAudio","mutation",c),unassignAudio:c=>v("pipelineOrchestrator","unassignAudio","mutation",c),getAudioAssignment:c=>v("pipelineOrchestrator","getAudioAssignment","query",c),getAudioAssignments:c=>v("pipelineOrchestrator","getAudioAssignments","query",c),getDecoderAssignment:c=>v("pipelineOrchestrator","getDecoderAssignment","query",c),getCameraSettings:c=>v("pipelineOrchestrator","getCameraSettings","query",c),setCameraStepToggle:c=>v("pipelineOrchestrator","setCameraStepToggle","mutation",c),getCameraStepOverrides:c=>v("pipelineOrchestrator","getCameraStepOverrides","query",c),setCameraStepOverride:c=>v("pipelineOrchestrator","setCameraStepOverride","mutation",c),setCameraPipelineForAgent:c=>v("pipelineOrchestrator","setCameraPipelineForAgent","mutation",c),resolvePipeline:c=>v("pipelineOrchestrator","resolvePipeline","query",c),getDeviceSettingsContribution:c=>v("pipelineOrchestrator","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>v("pipelineOrchestrator","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>v("pipelineOrchestrator","applyDeviceSettingsPatch","mutation",c)},ic={detachCamera:c=>v("pipelineRunner","detachCamera","mutation",c),getCameraMetrics:c=>v("pipelineRunner","getCameraMetrics","query",c)},sc={getAvailability:c=>v("recording","getAvailability","query",c),getPlaybackManifest:c=>v("recording","getPlaybackManifest","query",c),getDeviceConfig:c=>v("recording","getDeviceConfig","query",c),setDeviceConfig:c=>v("recording","setDeviceConfig","mutation",c),rescanStorage:c=>v("recording","rescanStorage","mutation",c),pruneFootage:c=>v("recording","pruneFootage","mutation",c),getStatus:c=>v("recording","getStatus","query",c),getDeviceSettingsContribution:c=>v("recording","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>v("recording","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>v("recording","applyDeviceSettingsPatch","mutation",c)},cc={supportsDevice:c=>v("snapshotProvider","supportsDevice","query",c),getSnapshot:c=>v("snapshotProvider","getSnapshot","query",c)},rc={publishCameraStream:c=>v("streamBroker","publishCameraStream","mutation",c),retractCameraStream:c=>v("streamBroker","retractCameraStream","mutation",c),assignProfile:c=>v("streamBroker","assignProfile","mutation",c),unassignProfile:c=>v("streamBroker","unassignProfile","mutation",c),restartProfile:c=>v("streamBroker","restartProfile","mutation",c),getDeviceSettingsContribution:c=>v("streamBroker","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>v("streamBroker","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>v("streamBroker","applyDeviceSettingsPatch","mutation",c)};return{deviceId:o.deviceId,binding:o,state:{airQualitySensor:N(l,o.deviceId,"air-quality-sensor"),alarmPanel:N(l,o.deviceId,"alarm-panel"),ambientLightSensor:N(l,o.deviceId,"ambient-light-sensor"),audioMetrics:N(l,o.deviceId,"audio-metrics"),automationControl:N(l,o.deviceId,"automation-control"),battery:N(l,o.deviceId,"battery"),binary:N(l,o.deviceId,"binary"),brightness:N(l,o.deviceId,"brightness"),cameraStreams:N(l,o.deviceId,"camera-streams"),carbonMonoxide:N(l,o.deviceId,"carbon-monoxide"),climateControl:N(l,o.deviceId,"climate-control"),color:N(l,o.deviceId,"color"),connectivity:N(l,o.deviceId,"connectivity"),consumables:N(l,o.deviceId,"consumables"),contact:N(l,o.deviceId,"contact"),control:N(l,o.deviceId,"control"),cover:N(l,o.deviceId,"cover"),deviceDiscovery:N(l,o.deviceId,"device-discovery"),deviceStatus:N(l,o.deviceId,"device-status"),doorbell:N(l,o.deviceId,"doorbell"),enumSensor:N(l,o.deviceId,"enum-sensor"),eventEmitter:N(l,o.deviceId,"event-emitter"),fanControl:N(l,o.deviceId,"fan-control"),featureProbe:N(l,o.deviceId,"feature-probe"),flood:N(l,o.deviceId,"flood"),gas:N(l,o.deviceId,"gas"),humidifier:N(l,o.deviceId,"humidifier"),humiditySensor:N(l,o.deviceId,"humidity-sensor"),image:N(l,o.deviceId,"image"),lawnMowerControl:N(l,o.deviceId,"lawn-mower-control"),lockControl:N(l,o.deviceId,"lock-control"),mediaPlayer:N(l,o.deviceId,"media-player"),motion:N(l,o.deviceId,"motion"),motionTrigger:N(l,o.deviceId,"motion-trigger"),motionZones:N(l,o.deviceId,"motion-zones"),nativeObjectDetection:N(l,o.deviceId,"native-object-detection"),notifier:N(l,o.deviceId,"notifier"),numericSensor:N(l,o.deviceId,"numeric-sensor"),powerMeter:N(l,o.deviceId,"power-meter"),presence:N(l,o.deviceId,"presence"),pressureSensor:N(l,o.deviceId,"pressure-sensor"),privacyMask:N(l,o.deviceId,"privacy-mask"),ptzAutotrack:N(l,o.deviceId,"ptz-autotrack"),scriptRunner:N(l,o.deviceId,"script-runner"),smoke:N(l,o.deviceId,"smoke"),streamParams:N(l,o.deviceId,"stream-params"),switch:N(l,o.deviceId,"switch"),tamper:N(l,o.deviceId,"tamper"),temperatureSensor:N(l,o.deviceId,"temperature-sensor"),update:N(l,o.deviceId,"update"),vacuumControl:N(l,o.deviceId,"vacuum-control"),valve:N(l,o.deviceId,"valve"),vibration:N(l,o.deviceId,"vibration"),waterHeater:N(l,o.deviceId,"water-heater"),weather:N(l,o.deviceId,"weather"),zoneAnalytics:N(l,o.deviceId,"zone-analytics"),zoneRules:N(l,o.deviceId,"zone-rules"),zones:N(l,o.deviceId,"zones")},accessories:w,airQualitySensor:A,alarmPanel:C,ambientLightSensor:P,audioAnalysis:E,audioMetrics:B,automationControl:M,battery:D,binary:q,brightness:na,button:oa,cameraCredentials:ia,cameraStreams:sa,carbonMonoxide:ca,climateControl:ra,color:da,connectivity:la,consumables:pa,contact:ma,control:ua,cover:ga,detectionPipeline:ha,deviceDiscovery:va,deviceOps:ya,deviceStatus:Sa,doorbell:fa,enumSensor:ba,eventEmitter:Ia,events:ka,fanControl:s,featureProbe:K,flood:Se,gas:re,humidifier:We,humiditySensor:fe,image:de,intercom:ms,lawnMowerControl:us,lockControl:gs,mediaPlayer:hs,motion:vs,motionDetection:ys,motionTrigger:Ss,motionZones:fs,nativeObjectDetection:bs,notifier:Is,numericSensor:ks,osd:ws,pipelineAnalytics:Cs,powerMeter:As,presence:Ns,pressureSensor:Ps,privacyMask:Ms,ptz:Ds,ptzAutotrack:xs,reboot:Ts,scriptRunner:Es,smoke:Rs,snapshot:Bs,streamCatalog:qs,streamParams:Os,switch:Ls,tamper:zs,temperatureSensor:Us,update:_s,vacuumControl:Fs,valve:Hs,vibration:$s,waterHeater:Ws,weather:Vs,webrtcSession:Ks,zoneAnalytics:js,zoneRules:Gs,zones:Zs,addonSettings:Qs,cameraPipelineConfig:Ys,deviceAdoption:Js,deviceExport:Xs,deviceManager:ec,deviceState:tc,networkQuality:ac,pipelineExecutor:nc,pipelineOrchestrator:oc,pipelineRunner:ic,recording:sc,snapshotProvider:cc,streamBroker:rc}}function jy(i,o,n,d,l){if(n.length===0||o.length===0)return{passed:i,excluded:[]};const h=n.filter(P=>P.enabled!==!1),y=h.filter(P=>P.mode==="include"),m=h.filter(P=>P.mode==="exclude"),v=y.length>0,w=new Map(o.map(P=>[P.id,P])),A=[],C=[];for(const P of i){const E=d(P),B=l?.(P),M=y.some(q=>go(q,E,B,w)),D=m.some(q=>go(q,E,B,w));v?M&&!D?A.push(P):C.push(P):D?C.push(P):A.push(P)}return{passed:A,excluded:C}}function go(i,o,n,d){if(i.classFilter&&i.classFilter.length>0&&n!==void 0&&!i.classFilter.includes(n))return!1;for(const l of i.zoneIds){const h=d.get(l);if(h&&sv(o,h.polygon))return!0}return!1}function sv(i,o){if(o.length<3)return!1;let n=!1;const{x:d,y:l}=i;for(let h=0,y=o.length-1;h<o.length;y=h++){const m=o[h],v=o[y];m.y>l!=v.y>l&&d<(v.x-m.x)*(l-m.y)/(v.y-m.y||Number.EPSILON)+m.x&&(n=!n)}return n}function Gy(i){const o=i;function n(s,K,Se,re,We){const fe=o[s]?.[K];if(!fe)throw new Error(`SystemProxy: api has no '${s}.${K}'`);const de=fe;return Se==="mutation"?de.mutate(re):Se==="subscription"?de.subscribe(re,We):de.query(re)}return{addonPages:{listPages:s=>n("addonPages","listPages","query",s)},addons:{list:s=>n("addons","list","query",s),getLogs:s=>n("addons","getLogs","query",s),listPackages:s=>n("addons","listPackages","query",s),installPackage:s=>n("addons","installPackage","mutation",s),installFromWorkspace:s=>n("addons","installFromWorkspace","mutation",s),isWorkspaceAvailable:s=>n("addons","isWorkspaceAvailable","query",s),listWorkspacePackages:s=>n("addons","listWorkspacePackages","query",s),uninstallPackage:s=>n("addons","uninstallPackage","mutation",s),reloadPackages:s=>n("addons","reloadPackages","mutation",s),searchAvailable:s=>n("addons","searchAvailable","query",s),listUpdates:s=>n("addons","listUpdates","query",s),updatePackage:s=>n("addons","updatePackage","mutation",s),rollbackPackage:s=>n("addons","rollbackPackage","mutation",s),forceRefresh:s=>n("addons","forceRefresh","mutation",s),restartServer:s=>n("addons","restartServer","mutation",s),getLastRestart:s=>n("addons","getLastRestart","query",s),listFrameworkPackages:s=>n("addons","listFrameworkPackages","query",s),listCapabilityProviders:s=>n("addons","listCapabilityProviders","query",s),setCapabilityProviderEnabled:s=>n("addons","setCapabilityProviderEnabled","mutation",s),updateFrameworkPackage:s=>n("addons","updateFrameworkPackage","mutation",s),startBulkUpdate:s=>n("addons","startBulkUpdate","mutation",s),getBulkUpdateState:s=>n("addons","getBulkUpdateState","query",s),cancelBulkUpdate:s=>n("addons","cancelBulkUpdate","mutation",s),listActiveBulkUpdates:s=>n("addons","listActiveBulkUpdates","query",s),getVersions:s=>n("addons","getVersions","query",s),restartAddon:s=>n("addons","restartAddon","mutation",s),retryLoad:s=>n("addons","retryLoad","mutation",s),getAutoUpdateSettings:s=>n("addons","getAutoUpdateSettings","query",s),setAutoUpdateSettings:s=>n("addons","setAutoUpdateSettings","mutation",s),getAddonAutoUpdate:s=>n("addons","getAddonAutoUpdate","query",s),setAddonAutoUpdate:s=>n("addons","setAddonAutoUpdate","mutation",s),applyAutoUpdateToAll:s=>n("addons","applyAutoUpdateToAll","mutation",s),custom:s=>n("addons","custom","mutation",s),onAddonLogs:(s,K)=>n("addons","onAddonLogs","subscription",s,K)},addonSettings:{getGlobalSettings:s=>n("addonSettings","getGlobalSettings","query",s),updateGlobalSettings:s=>n("addonSettings","updateGlobalSettings","mutation",s)},addonWidgets:{listWidgets:s=>n("addonWidgets","listWidgets","query",s)},alerts:{emit:s=>n("alerts","emit","mutation",s),update:s=>n("alerts","update","mutation",s),list:s=>n("alerts","list","query",s),getUnreadCount:s=>n("alerts","getUnreadCount","query",s),markRead:s=>n("alerts","markRead","mutation",s),markAllRead:s=>n("alerts","markAllRead","mutation",s),dismiss:s=>n("alerts","dismiss","mutation",s)},audioAnalyzer:{analyseChunk:s=>n("audioAnalyzer","analyseChunk","mutation",s),classify:s=>n("audioAnalyzer","classify","query",s),isReady:s=>n("audioAnalyzer","isReady","query",s),dispose:s=>n("audioAnalyzer","dispose","mutation",s),reprobeAudioEngine:s=>n("audioAnalyzer","reprobeAudioEngine","mutation",s)},audioCodec:{listSupportedCodecs:s=>n("audioCodec","listSupportedCodecs","query",s),canHandle:s=>n("audioCodec","canHandle","query",s),createDecodeSession:s=>n("audioCodec","createDecodeSession","mutation",s),createEncodeSession:s=>n("audioCodec","createEncodeSession","mutation",s),closeSession:s=>n("audioCodec","closeSession","mutation",s),pushEncodedFrame:s=>n("audioCodec","pushEncodedFrame","mutation",s),pullPcm:s=>n("audioCodec","pullPcm","query",s),pushPcm:s=>n("audioCodec","pushPcm","mutation",s),pullEncoded:s=>n("audioCodec","pullEncoded","query",s),flushEncode:s=>n("audioCodec","flushEncode","mutation",s),listActiveSessions:s=>n("audioCodec","listActiveSessions","query",s)},backup:{listDestinations:s=>n("backup","listDestinations","query",s),trigger:s=>n("backup","trigger","mutation",s),list:s=>n("backup","list","query",s),listLocations:s=>n("backup","listLocations","query",s),getEntries:s=>n("backup","getEntries","query",s),restore:s=>n("backup","restore","mutation",s),delete:s=>n("backup","delete","mutation",s),listArchives:s=>n("backup","listArchives","query",s),upsertDestinationPolicy:s=>n("backup","upsertDestinationPolicy","mutation",s),previewSchedule:s=>n("backup","previewSchedule","query",s)},broker:{list:s=>n("broker","list","query",s),get:s=>n("broker","get","query",s),listProviders:s=>n("broker","listProviders","query",s),add:s=>n("broker","add","mutation",s),remove:s=>n("broker","remove","mutation",s),testConnection:s=>n("broker","testConnection","mutation",s),getSettings:s=>n("broker","getSettings","query",s),setSettings:s=>n("broker","setSettings","mutation",s),getBrokerConfig:s=>n("broker","getBrokerConfig","query",s),getSettingsSchema:s=>n("broker","getSettingsSchema","query",s),testSettings:s=>n("broker","testSettings","mutation",s),publish:s=>n("broker","publish","mutation",s),subscribe:s=>n("broker","subscribe","mutation",s),unsubscribe:s=>n("broker","unsubscribe","mutation",s),getState:s=>n("broker","getState","query",s),getStatus:s=>n("broker","getStatus","query",s)},decoder:{supportsCodec:s=>n("decoder","supportsCodec","query",s),getInfo:s=>n("decoder","getInfo","query",s),createSession:s=>n("decoder","createSession","query",s),destroySession:s=>n("decoder","destroySession","query",s),pushPacket:s=>n("decoder","pushPacket","query",s),openStream:s=>n("decoder","openStream","query",s),pullFrames:s=>n("decoder","pullFrames","query",s),pullHandles:s=>n("decoder","pullHandles","query",s),getFrame:s=>n("decoder","getFrame","query",s),getShmStats:s=>n("decoder","getShmStats","query",s),updateConfig:s=>n("decoder","updateConfig","query",s),getStats:s=>n("decoder","getStats","query",s),listActiveSessions:s=>n("decoder","listActiveSessions","query",s),reprobeHwaccel:s=>n("decoder","reprobeHwaccel","mutation",s)},deviceAdoption:{listCandidateFilters:s=>n("deviceAdoption","listCandidateFilters","query",s),listCandidates:s=>n("deviceAdoption","listCandidates","query",s),getCandidate:s=>n("deviceAdoption","getCandidate","query",s),refresh:s=>n("deviceAdoption","refresh","mutation",s),adopt:s=>n("deviceAdoption","adopt","mutation",s),release:s=>n("deviceAdoption","release","mutation",s),resync:s=>n("deviceAdoption","resync","mutation",s)},deviceExport:{getStatus:s=>n("deviceExport","getStatus","query",s),listSupportedDeviceKinds:s=>n("deviceExport","listSupportedDeviceKinds","query",s),listExposedDevices:s=>n("deviceExport","listExposedDevices","query",s),exposeDevice:s=>n("deviceExport","exposeDevice","mutation",s),unexposeDevice:s=>n("deviceExport","unexposeDevice","mutation",s)},deviceManager:{allocateDeviceId:s=>n("deviceManager","allocateDeviceId","mutation",s),registerDevice:s=>n("deviceManager","registerDevice","mutation",s),removeDevice:s=>n("deviceManager","removeDevice","mutation",s),persistConfig:s=>n("deviceManager","persistConfig","mutation",s),listLocations:s=>n("deviceManager","listLocations","query",s),addLocation:s=>n("deviceManager","addLocation","mutation",s),removeLocation:s=>n("deviceManager","removeLocation","mutation",s),listPersistedByAddon:s=>n("deviceManager","listPersistedByAddon","query",s),listAll:s=>n("deviceManager","listAll","query",s),getChildren:s=>n("deviceManager","getChildren","query",s),removeByIntegration:s=>n("deviceManager","removeByIntegration","mutation",s),listWrappersForCap:s=>n("deviceManager","listWrappersForCap","query",s),listBindableCapsForDeviceType:s=>n("deviceManager","listBindableCapsForDeviceType","query",s),discoverDevices:s=>n("deviceManager","discoverDevices","mutation",s),adoptDevice:s=>n("deviceManager","adoptDevice","mutation",s),getCreationSchema:s=>n("deviceManager","getCreationSchema","query",s),createDevice:s=>n("deviceManager","createDevice","mutation",s),testCreationField:s=>n("deviceManager","testCreationField","mutation",s),adoptionListCandidates:s=>n("deviceManager","adoptionListCandidates","query",s),adoptionRefresh:s=>n("deviceManager","adoptionRefresh","mutation",s),adoptionAdopt:s=>n("deviceManager","adoptionAdopt","mutation",s),adoptionRelease:s=>n("deviceManager","adoptionRelease","mutation",s)},deviceProvider:{start:s=>n("deviceProvider","start","mutation",s),stop:s=>n("deviceProvider","stop","mutation",s),getStatus:s=>n("deviceProvider","getStatus","query",s),getDevices:s=>n("deviceProvider","getDevices","query",s),supportsDiscovery:s=>n("deviceProvider","supportsDiscovery","query",s),discoverDevices:s=>n("deviceProvider","discoverDevices","mutation",s),adoptDiscoveredDevice:s=>n("deviceProvider","adoptDiscoveredDevice","mutation",s),supportsManualCreation:s=>n("deviceProvider","supportsManualCreation","query",s),getChildCreationSchema:s=>n("deviceProvider","getChildCreationSchema","query",s),createDevice:s=>n("deviceProvider","createDevice","mutation",s),testCreationField:s=>n("deviceProvider","testCreationField","mutation",s)},deviceState:{getAllSnapshots:s=>n("deviceState","getAllSnapshots","query",s)},integrations:{list:s=>n("integrations","list","query",s),get:s=>n("integrations","get","query",s),getByAddonId:s=>n("integrations","getByAddonId","query",s),create:s=>n("integrations","create","mutation",s),update:s=>n("integrations","update","mutation",s),delete:s=>n("integrations","delete","mutation",s),getSettings:s=>n("integrations","getSettings","query",s),setSettings:s=>n("integrations","setSettings","mutation",s),getAvailableTypes:s=>n("integrations","getAvailableTypes","query",s),testConnection:s=>n("integrations","testConnection","mutation",s)},localNetwork:{list:s=>n("localNetwork","list","query",s),getPreferred:s=>n("localNetwork","getPreferred","query",s),getConnectionEndpoints:s=>n("localNetwork","getConnectionEndpoints","query",s),getAllowedAddresses:s=>n("localNetwork","getAllowedAddresses","query",s),setAllowedAddresses:s=>n("localNetwork","setAllowedAddresses","mutation",s),resetAllowlistToBestMatch:s=>n("localNetwork","resetAllowlistToBestMatch","mutation",s)},meshNetwork:{getStatus:s=>n("meshNetwork","getStatus","query",s),join:s=>n("meshNetwork","join","mutation",s),startLogin:s=>n("meshNetwork","startLogin","mutation",s),leave:s=>n("meshNetwork","leave","mutation",s),logout:s=>n("meshNetwork","logout","mutation",s),listPeers:s=>n("meshNetwork","listPeers","query",s),testConnection:s=>n("meshNetwork","testConnection","mutation",s)},metricsProvider:{collectSnapshot:s=>n("metricsProvider","collectSnapshot","query",s),getCached:s=>n("metricsProvider","getCached","query",s),getCurrent:s=>n("metricsProvider","getCurrent","query",s),getDiskSpace:s=>n("metricsProvider","getDiskSpace","query",s),getGpuInfo:s=>n("metricsProvider","getGpuInfo","query",s),getCpuTemperature:s=>n("metricsProvider","getCpuTemperature","query",s),getProcessStats:s=>n("metricsProvider","getProcessStats","query",s),listAddonInstances:s=>n("metricsProvider","listAddonInstances","query",s),getAddonStats:s=>n("metricsProvider","getAddonStats","query",s),listNodeProcesses:s=>n("metricsProvider","listNodeProcesses","query",s),killProcess:s=>n("metricsProvider","killProcess","mutation",s)},mqttBroker:{listBrokers:s=>n("mqttBroker","listBrokers","query",s),getBrokerConfig:s=>n("mqttBroker","getBrokerConfig","query",s),addBroker:s=>n("mqttBroker","addBroker","mutation",s),removeBroker:s=>n("mqttBroker","removeBroker","mutation",s),testConnection:s=>n("mqttBroker","testConnection","mutation",s),startEmbeddedBroker:s=>n("mqttBroker","startEmbeddedBroker","mutation",s),stopEmbeddedBroker:s=>n("mqttBroker","stopEmbeddedBroker","mutation",s),getStatus:s=>n("mqttBroker","getStatus","query",s)},networkAccess:{start:s=>n("networkAccess","start","mutation",s),stop:s=>n("networkAccess","stop","mutation",s),getEndpoint:s=>n("networkAccess","getEndpoint","query",s),getStatus:s=>n("networkAccess","getStatus","query",s),listEndpoints:s=>n("networkAccess","listEndpoints","query",s)},networkQuality:{getAllStats:s=>n("networkQuality","getAllStats","query",s)},nodes:{topology:s=>n("nodes","topology","query",s),deployAddon:s=>n("nodes","deployAddon","mutation",s),undeployAddon:s=>n("nodes","undeployAddon","mutation",s),restartAddon:s=>n("nodes","restartAddon","mutation",s),restartProcess:s=>n("nodes","restartProcess","mutation",s),restartNode:s=>n("nodes","restartNode","mutation",s),shutdownNode:s=>n("nodes","shutdownNode","mutation",s),renameNode:s=>n("nodes","renameNode","mutation",s),clusterAddonStatus:s=>n("nodes","clusterAddonStatus","query",s),getCapUsageGraph:s=>n("nodes","getCapUsageGraph","query",s),getNodeAddons:s=>n("nodes","getNodeAddons","query",s),setProcessLogLevel:s=>n("nodes","setProcessLogLevel","mutation",s),executeQuery:s=>n("nodes","executeQuery","mutation",s)},notificationOutput:{send:s=>n("notificationOutput","send","mutation",s),sendTest:s=>n("notificationOutput","sendTest","mutation",s)},pipelineExecutor:{getAvailableEngines:s=>n("pipelineExecutor","getAvailableEngines","query",s),getSelectedEngine:s=>n("pipelineExecutor","getSelectedEngine","query",s),getDefaultSteps:s=>n("pipelineExecutor","getDefaultSteps","query",s),reprobeEngine:s=>n("pipelineExecutor","reprobeEngine","mutation",s),getVideoPipelineSteps:s=>n("pipelineExecutor","getVideoPipelineSteps","query",s),setVideoPipelineSteps:s=>n("pipelineExecutor","setVideoPipelineSteps","mutation",s),getSchema:s=>n("pipelineExecutor","getSchema","query",s),getGlobalSteps:s=>n("pipelineExecutor","getGlobalSteps","query",s),getGlobalPipelineConfig:s=>n("pipelineExecutor","getGlobalPipelineConfig","query",s),getOrchestratorConfigSchema:s=>n("pipelineExecutor","getOrchestratorConfigSchema","query",s),listTemplates:s=>n("pipelineExecutor","listTemplates","query",s),saveTemplate:s=>n("pipelineExecutor","saveTemplate","mutation",s),updateTemplate:s=>n("pipelineExecutor","updateTemplate","mutation",s),deleteTemplate:s=>n("pipelineExecutor","deleteTemplate","mutation",s),getCapabilities:s=>n("pipelineExecutor","getCapabilities","query",s),getAddonModels:s=>n("pipelineExecutor","getAddonModels","query",s),downloadModel:s=>n("pipelineExecutor","downloadModel","mutation",s),deleteModel:s=>n("pipelineExecutor","deleteModel","mutation",s),detect:s=>n("pipelineExecutor","detect","query",s),cacheFrameInPool:s=>n("pipelineExecutor","cacheFrameInPool","mutation",s),inferCached:s=>n("pipelineExecutor","inferCached","mutation",s),uncacheFrame:s=>n("pipelineExecutor","uncacheFrame","mutation",s),getEffectiveTuning:s=>n("pipelineExecutor","getEffectiveTuning","query",s),listLoadedEngines:s=>n("pipelineExecutor","listLoadedEngines","query",s),spinEngine:s=>n("pipelineExecutor","spinEngine","mutation",s),killEngine:s=>n("pipelineExecutor","killEngine","mutation",s),listReferenceImages:s=>n("pipelineExecutor","listReferenceImages","query",s),getReferenceImage:s=>n("pipelineExecutor","getReferenceImage","query",s),getReferenceAudioFiles:s=>n("pipelineExecutor","getReferenceAudioFiles","query",s),getReferenceAudio:s=>n("pipelineExecutor","getReferenceAudio","query",s),getAudioCapabilities:s=>n("pipelineExecutor","getAudioCapabilities","query",s),runAudioTest:s=>n("pipelineExecutor","runAudioTest","mutation",s),getDetectionConfigSchema:s=>n("pipelineExecutor","getDetectionConfigSchema","query",s)},pipelineOrchestrator:{rebalance:s=>n("pipelineOrchestrator","rebalance","mutation",s),getPipelineAssignments:s=>n("pipelineOrchestrator","getPipelineAssignments","query",s),getAgentLoad:s=>n("pipelineOrchestrator","getAgentLoad","query",s),getGlobalMetrics:s=>n("pipelineOrchestrator","getGlobalMetrics","query",s),getCapabilityBindings:s=>n("pipelineOrchestrator","getCapabilityBindings","query",s),setCapabilityBinding:s=>n("pipelineOrchestrator","setCapabilityBinding","mutation",s),getDecoderAssignments:s=>n("pipelineOrchestrator","getDecoderAssignments","query",s),getAudioNodeLoad:s=>n("pipelineOrchestrator","getAudioNodeLoad","query",s),getAgentSettings:s=>n("pipelineOrchestrator","getAgentSettings","query",s),listAgentSettings:s=>n("pipelineOrchestrator","listAgentSettings","query",s),setAgentAddonDefaults:s=>n("pipelineOrchestrator","setAgentAddonDefaults","mutation",s),removeAgentSettings:s=>n("pipelineOrchestrator","removeAgentSettings","mutation",s),listTemplates:s=>n("pipelineOrchestrator","listTemplates","query",s),saveTemplate:s=>n("pipelineOrchestrator","saveTemplate","mutation",s),updateTemplate:s=>n("pipelineOrchestrator","updateTemplate","mutation",s),deleteTemplate:s=>n("pipelineOrchestrator","deleteTemplate","mutation",s)},pipelineRunner:{attachCamera:s=>n("pipelineRunner","attachCamera","mutation",s),reportMotion:s=>n("pipelineRunner","reportMotion","mutation",s),getLocalLoad:s=>n("pipelineRunner","getLocalLoad","query",s),getLocalMetrics:s=>n("pipelineRunner","getLocalMetrics","query",s),getAllCameraMetrics:s=>n("pipelineRunner","getAllCameraMetrics","query",s),getLocalCameras:s=>n("pipelineRunner","getLocalCameras","query",s)},recording:{getStorageUsage:s=>n("recording","getStorageUsage","query",s)},settingsStore:{get:s=>n("settingsStore","get","query",s),set:s=>n("settingsStore","set","mutation",s),query:s=>n("settingsStore","query","query",s),insert:s=>n("settingsStore","insert","mutation",s),update:s=>n("settingsStore","update","mutation",s),delete:s=>n("settingsStore","delete","mutation",s),count:s=>n("settingsStore","count","query",s),histogram:s=>n("settingsStore","histogram","query",s),isEmpty:s=>n("settingsStore","isEmpty","query",s),declareCollection:s=>n("settingsStore","declareCollection","mutation",s)},storage:{resolve:s=>n("storage","resolve","query",s),write:s=>n("storage","write","mutation",s),read:s=>n("storage","read","query",s),exists:s=>n("storage","exists","query",s),list:s=>n("storage","list","query",s),delete:s=>n("storage","delete","mutation",s),getAvailableSpace:s=>n("storage","getAvailableSpace","query",s),beginUpload:s=>n("storage","beginUpload","mutation",s),writeChunk:s=>n("storage","writeChunk","mutation",s),finalizeUpload:s=>n("storage","finalizeUpload","mutation",s),abortUpload:s=>n("storage","abortUpload","mutation",s),beginDownload:s=>n("storage","beginDownload","mutation",s),readChunk:s=>n("storage","readChunk","query",s),endDownload:s=>n("storage","endDownload","mutation",s),listLocations:s=>n("storage","listLocations","query",s),getDefaultLocation:s=>n("storage","getDefaultLocation","query",s),listLocationDeclarations:s=>n("storage","listLocationDeclarations","query",s),upsertLocation:s=>n("storage","upsertLocation","mutation",s),deleteLocation:s=>n("storage","deleteLocation","mutation",s),testLocation:s=>n("storage","testLocation","query",s),listProviders:s=>n("storage","listProviders","query",s),testConfig:s=>n("storage","testConfig","query",s)},streamBroker:{listAllCameraStreams:s=>n("streamBroker","listAllCameraStreams","query",s),listAllProfileSlots:s=>n("streamBroker","listAllProfileSlots","query",s),getBrokerStats:s=>n("streamBroker","getBrokerStats","query",s),listClients:s=>n("streamBroker","listClients","query",s),killClient:s=>n("streamBroker","killClient","mutation",s),getStreamUrl:s=>n("streamBroker","getStreamUrl","query",s),getStreamWithCodec:s=>n("streamBroker","getStreamWithCodec","mutation",s),releaseStreamWithCodec:s=>n("streamBroker","releaseStreamWithCodec","mutation",s),subscribeAudioChunks:s=>n("streamBroker","subscribeAudioChunks","mutation",s),pullAudioChunks:s=>n("streamBroker","pullAudioChunks","query",s),unsubscribeAudioChunks:s=>n("streamBroker","unsubscribeAudioChunks","mutation",s),subscribeFrames:s=>n("streamBroker","subscribeFrames","mutation",s),pullFrameHandles:s=>n("streamBroker","pullFrameHandles","query",s),unsubscribeFrames:s=>n("streamBroker","unsubscribeFrames","mutation",s),setPreBufferDuration:s=>n("streamBroker","setPreBufferDuration","mutation",s),getPreBufferInfo:s=>n("streamBroker","getPreBufferInfo","query",s),getRtspPort:s=>n("streamBroker","getRtspPort","query",s),getAllRtspEntries:s=>n("streamBroker","getAllRtspEntries","query",s),getRtspEntry:s=>n("streamBroker","getRtspEntry","query",s),regenerateRtspToken:s=>n("streamBroker","regenerateRtspToken","mutation",s),setRtspEnabled:s=>n("streamBroker","setRtspEnabled","mutation",s),isRtspEnabled:s=>n("streamBroker","isRtspEnabled","query",s)},system:{info:s=>n("system","info","query",s),health:s=>n("system","health","query",s),featureFlags:s=>n("system","featureFlags","query",s),networkAddresses:s=>n("system","networkAddresses","query",s),getRetentionConfig:s=>n("system","getRetentionConfig","query",s),setRetentionConfig:s=>n("system","setRetentionConfig","mutation",s),forceRetentionCleanup:s=>n("system","forceRetentionCleanup","mutation",s)},toast:{onToast:(s,K)=>n("toast","onToast","subscription",s,K)},turnProvider:{getTurnServers:s=>n("turnProvider","getTurnServers","query",s)},userManagement:{listUsers:s=>n("userManagement","listUsers","query",s),createUser:s=>n("userManagement","createUser","mutation",s),updateUser:s=>n("userManagement","updateUser","mutation",s),deleteUser:s=>n("userManagement","deleteUser","mutation",s),resetPassword:s=>n("userManagement","resetPassword","mutation",s),setUserScopes:s=>n("userManagement","setUserScopes","mutation",s),validateCredentials:s=>n("userManagement","validateCredentials","mutation",s),listApiKeys:s=>n("userManagement","listApiKeys","query",s),createApiKey:s=>n("userManagement","createApiKey","mutation",s),revokeApiKey:s=>n("userManagement","revokeApiKey","mutation",s),validateApiKey:s=>n("userManagement","validateApiKey","mutation",s),createScopedToken:s=>n("userManagement","createScopedToken","mutation",s),revokeScopedToken:s=>n("userManagement","revokeScopedToken","mutation",s),validateScopedToken:s=>n("userManagement","validateScopedToken","query",s),listScopedTokens:s=>n("userManagement","listScopedTokens","query",s),setupTotp:s=>n("userManagement","setupTotp","mutation",s),confirmTotp:s=>n("userManagement","confirmTotp","mutation",s),disableTotp:s=>n("userManagement","disableTotp","mutation",s),getTotpStatus:s=>n("userManagement","getTotpStatus","query",s),verifyTotp:s=>n("userManagement","verifyTotp","mutation",s),oauthIssueCode:s=>n("userManagement","oauthIssueCode","mutation",s),oauthExchangeCode:s=>n("userManagement","oauthExchangeCode","mutation",s),oauthRefresh:s=>n("userManagement","oauthRefresh","mutation",s),oauthVerifyAccessToken:s=>n("userManagement","oauthVerifyAccessToken","query",s),listOauthSessions:s=>n("userManagement","listOauthSessions","query",s),revokeOauthSession:s=>n("userManagement","revokeOauthSession","mutation",s)}}}const cv="device.state-changed",rv="capability.binding-changed",dv="device.registered",lv="device.unregistered",pv="device.updated";class Zy{constructor(o){this.api=o,this.stateSource=nv(this.stateMirror,this.handleListeners,this.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;async init(o=15e3){if(!this.initialized){if(this.initPromise)return this.initPromise;this.initPromise=(async()=>{const n=(y,m)=>Number.isFinite(o)?new Promise((v,w)=>{const A=setTimeout(()=>w(new Error(`SystemMirror.init: '${m}' timed out after ${o}ms`)),o);y.then(C=>{clearTimeout(A),v(C)},C=>{clearTimeout(A),w(C)})}):y,[d,l,h]=await Promise.all([n(this.api.deviceManager.getAllBindings.query({}),"deviceManager.getAllBindings"),n(this.api.deviceState.getAllSnapshots.query({}),"deviceState.getAllSnapshots"),n(this.api.deviceManager.listAll.query({}),"deviceManager.listAll")]);for(const y of d)this.bindings.set(y.deviceId,y);for(const[y,m]of Object.entries(l)){const v=Number(y);if(!Number.isFinite(v))continue;const w=new Map;for(const[A,C]of Object.entries(m))w.set(A,C);this.stateMirror.set(v,w)}for(const y of h)this.devices.set(y.id,y);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(const o of this.bridges)try{o.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(o){const n=this.bindings.get(o);return n?iv(this.api,n,{stateSource:this.stateSource}):null}getDeviceByName(o){for(const n of this.devices.values())if(n.name===o)return this.getDeviceById(n.id);return null}getDeviceByStableId(o){for(const n of this.devices.values())if(n.stableId===o)return this.getDeviceById(n.id);return null}getDevicesByAddon(o){return this.query({addonId:o})}getDevicesByType(o){return this.query({type:o})}getDeviceInfo(o){return this.devices.get(o)??null}getAllDevices(){const o=[];for(const n of this.bindings.keys()){const d=this.getDeviceById(n);d&&o.push(d)}return o}filterByCap(o){return this.query({caps:o})}query(o={}){const n=[];for(const[d,l]of this.bindings){const h=this.devices.get(d);if(o.id!==void 0&&!Ne(d,o.id)||o.stableId!==void 0&&(!h||!Ne(h.stableId,o.stableId))||o.addonId!==void 0&&(!h||!Ne(h.addonId,o.addonId))||o.type!==void 0&&(!h||!Ne(h.type,o.type)))continue;if(o.caps!==void 0){const m=gt(o.caps),v=new Set(l.entries.map(w=>w.capName));if(!m.every(w=>v.has(w)))continue}if(o.anyCap!==void 0){const m=gt(o.anyCap),v=new Set(l.entries.map(w=>w.capName));if(!m.some(w=>v.has(w)))continue}if(o.name!==void 0&&(!h||!mv(h.name,o.name))||o.online!==void 0&&(!h||h.online!==o.online))continue;if(o.parentDeviceId!==void 0){if(!h)continue;const m=o.parentDeviceId;if((h.parentDeviceId??null)!==m)continue}if(o.feature!==void 0&&(!h||!gt(o.feature).every(v=>h.features.includes(v)))||o.isCamera!==void 0&&(!h||h.isCamera!==o.isCamera))continue;const y=this.getDeviceById(d);if(y){if(o.where&&h){if(!o.where(h,y))continue}else if(o.where&&!h)continue;n.push(y)}}return n}whereState(o,n){const d=[];for(const[l,h]of this.stateMirror){const y=h.get(o);if(!y||!n(y,l))continue;const m=this.getDeviceById(l);m&&d.push(m)}return d}mapState(o,n){const d=[];for(const[l,h]of this.stateMirror){const y=h.get(o);y&&d.push(n(y,l))}return d}findState(o,n){for(const[d,l]of this.stateMirror){const h=l.get(o);if(h&&n(h,d))return this.getDeviceById(d)}return null}countByCap(o){let n=0;for(const d of this.bindings.values())d.entries.some(l=>l.capName===o)&&n++;return n}countByState(o,n){let d=0;for(const[l,h]of this.stateMirror){const y=h.get(o);y&&n(y,l)&&d++}return d}listen(o){return this.globalStateListeners.add(o),()=>{this.globalStateListeners.delete(o)}}listenCap(o,n){let d=this.capListeners.get(o);return d||(d=new Set,this.capListeners.set(o,d)),d.add(n),()=>{d.delete(n),d.size===0&&this.capListeners.delete(o)}}listenDevice(o,n){let d=this.deviceListeners.get(o);return d||(d=new Set,this.deviceListeners.set(o,d)),d.add(n),()=>{d.delete(n),d.size===0&&this.deviceListeners.delete(o)}}onDeviceAdded(o){return this.addedListeners.add(o),()=>{this.addedListeners.delete(o)}}onDeviceRemoved(o){return this.removedListeners.add(o),()=>{this.removedListeners.delete(o)}}waitForState(o,n,d,l=3e4){return new Promise((h,y)=>{const v=(()=>{const C=this.stateMirror.get(o)?.get(n);return C&&d(C)?C:null})();if(v){h(v);return}let w=null;const A=this.listenDevice(o,(C,P,E)=>{P===n&&E&&d(E)&&(w&&clearTimeout(w),A(),h(E))});Number.isFinite(l)&&(w=setTimeout(()=>{A(),y(new Error(`waitForState timed out after ${l}ms (deviceId=${o}, capName=${n})`))},l))})}waitForDevice(o,n=3e4){return new Promise((d,l)=>{const h=this.getDeviceById(o);if(h){d(h);return}let y=null;const m=this.onDeviceAdded(v=>{if(v!==o)return;const w=this.getDeviceById(v);w&&(y&&clearTimeout(y),m(),d(w))});Number.isFinite(n)&&(y=setTimeout(()=>{m(),l(new Error(`waitForDevice timed out after ${n}ms (deviceId=${o})`))},n))})}async forEachCap(o,n){for(const d of this.filterByCap(o))await n(d)}async invokeCap(o,n,d,l={}){const h=this.filterByCap(o),y=Math.max(1,l.parallelism??h.length),m=[];for(let v=0;v<h.length;v+=y){const w=h.slice(v,v+y),A=await Promise.allSettled(w.map(async C=>{const P=C[o];if(!P||typeof P[n]!="function")throw new Error(`device '${C.deviceId}' does not expose '${o}.${n}'`);return await P[n](d)}));for(let C=0;C<A.length;C++){const P=w[C],E=A[C];E.status==="fulfilled"?m.push({deviceId:P.deviceId,ok:!0,result:E.value}):m.push({deviceId:P.deviceId,ok:!1,error:E.reason})}}return m}summary(){const o={},n={},d={};let l=0,h=0;for(const y of this.bindings.values())for(const m of y.entries)o[m.capName]=(o[m.capName]??0)+1;for(const y of this.devices.values())n[y.addonId]=(n[y.addonId]??0)+1,d[y.type]=(d[y.type]??0)+1,y.online?l++:h++;return{totalDevices:this.bindings.size,online:l,offline:h,byCap:o,byAddon:n,byType:d,statedDevices:this.stateMirror.size}}dump(o){const n=l=>{const h=this.devices.get(l)??null,y=this.bindings.get(l)??null,m={},v=this.stateMirror.get(l);if(v)for(const[w,A]of v)m[w]={...A};return{deviceId:l,info:h,binding:y?{...y,entries:y.entries.map(w=>({...w}))}:null,state:m}};if(o!==void 0)return n(o);const d=[];for(const l of this.bindings.keys())d.push(n(l));return d}getRawMirror(){return this.stateMirror}getSystemState(){const o=new Map;for(const[n,d]of this.stateMirror){const l=new Map;for(const[h,y]of d)l.set(h,{...y});o.set(n,l)}return o}subscribeBus(){if(!this.api.live?.onEvent)return;const o=this.api.live.onEvent;this.bridges.push(o.subscribe({category:cv},{onData:n=>{const d=n.data;!d||typeof d.deviceId!="number"||typeof d.capName!="string"||this.applyStateUpdate(d.deviceId,d.capName,d.slice)}})),this.bridges.push(o.subscribe({category:rv},{onData:n=>{const d=n.data,l=typeof d?.deviceId=="number"?d.deviceId:d?.source?.type==="device"&&typeof d.source.id=="number"?d.source.id:null;l!==null&&this.refreshBinding(l)}})),this.bridges.push(o.subscribe({category:dv},{onData:n=>{const d=n.data;typeof d?.deviceId=="number"&&this.refreshDeviceMetadata(d.deviceId,"added")}})),this.bridges.push(o.subscribe({category:lv},{onData:n=>{const d=n.data;typeof d?.deviceId=="number"&&this.applyDeviceRemoval(d.deviceId)}})),this.bridges.push(o.subscribe({category:pv},{onData:n=>{const d=n.data;typeof d?.deviceId=="number"&&this.refreshDeviceMetadata(d.deviceId,"updated")}}))}applyStateUpdate(o,n,d){let l=this.stateMirror.get(o);l||(l=new Map,this.stateMirror.set(o,l)),d===void 0?l.delete(n):l.set(n,d);const h=`${o}:${n}`,y=this.handleListeners.get(h);if(y)for(const w of y)try{w(d)}catch{}for(const w of this.globalStateListeners)try{w(o,n,d)}catch{}const m=this.capListeners.get(n);if(m)for(const w of m)try{w(o,d)}catch{}const v=this.deviceListeners.get(o);if(v)for(const w of v)try{w(o,n,d)}catch{}}applyDeviceRemoval(o){const n=this.devices.get(o)??null;this.bindings.delete(o),this.devices.delete(o),this.stateMirror.delete(o);for(const d of this.removedListeners)try{d(o,n)}catch{}}async refreshBinding(o){try{const d=(await this.api.deviceManager.getAllBindings.query({})).find(l=>l.deviceId===o);d?this.bindings.set(o,d):this.applyDeviceRemoval(o)}catch{}}async refreshDeviceMetadata(o,n){try{const l=(await this.api.deviceManager.listAll.query({})).find(y=>y.id===o);if(!l)return;const h=!this.devices.has(o);if(this.devices.set(o,l),n==="added"&&h){await this.refreshBinding(o);for(const y of this.addedListeners)try{y(o,l)}catch{}}}catch{}}}function Ne(i,o){return Array.isArray(o)?o.includes(i):i===o}function gt(i){return Array.isArray(i)?i:[i]}function mv(i,o){return typeof o=="string"?i===o:o instanceof RegExp?o.test(i):"exact"in o?i===o.exact:"contains"in o?i.toLowerCase().includes(o.contains.toLowerCase()):!1}function Qy(i){return i}function Yy(i,o,n){return{input:i,output:o,kind:n?.kind??"query",auth:n?.auth??"protected",scope:n?.scope??{kind:"system"}}}function Jy(i,o,n){return{input:i,output:o,kind:n?.kind??"query",auth:n?.auth??"protected",scope:{kind:"device",...n?.deviceTypes?{deviceTypes:n.deviceTypes}:{}}}}const uv=[{profile:"main",prefix:"streamMain",label:"Main stream"},{profile:"sub",prefix:"streamSub",label:"Sub stream"},{profile:"ext",prefix:"streamExt",label:"Third stream"}];function gv(i,o,n){const d=[];if(o.resolutions.length>0){const l=o.resolutions.map(y=>({value:`${String(y.width)}x${String(y.height)}`,label:`${String(y.width)}×${String(y.height)}`})),h=n?`${String(n.width)}x${String(n.height)}`:void 0;h&&!l.some(y=>y.value===h)&&l.unshift({value:h,label:`${h.replace("x","×")} (current)`}),d.push({type:"select",key:`${i.prefix}_resolution`,label:"Resolution",options:l,default:h??l[0]?.value??""})}if(o.codecs.length>0&&d.push({type:"select",key:`${i.prefix}_codec`,label:"Codec",options:o.codecs.map(l=>({value:l,label:l==="h264"?"H.264":"H.265"})),default:n?.codec??o.codecs[0]}),o.framerates.length>0){const l=o.framerates.map(y=>({value:String(y),label:`${String(y)} fps`})),h=n?.framerate;h!==void 0&&!o.framerates.includes(h)&&l.unshift({value:String(h),label:`${String(h)} fps (current)`}),d.push({type:"select",key:`${i.prefix}_framerate`,label:"Frame rate",options:l,default:h!==void 0?String(h):l[0]?.value??""})}if(o.bitrates.length>0){const l=o.bitrates.map(y=>({value:String(y),label:`${String(y)} kbps`})),h=n?.bitrate;h!==void 0&&!o.bitrates.includes(h)&&l.unshift({value:String(h),label:`${String(h)} kbps (current)`}),d.push({type:"select",key:`${i.prefix}_bitrate`,label:"Bitrate",options:l,default:h!==void 0?String(h):l[0]?.value??""})}else{const l=o.bitrateRange;d.push({type:"number",key:`${i.prefix}_bitrate`,label:"Bitrate",unit:"kbps",...l?{min:l[0],max:l[1]}:{},default:n?.bitrate??l?.[0]??0})}if(o.supportsBitrateMode&&d.push({type:"select",key:`${i.prefix}_bitrateMode`,label:"Bitrate mode",options:[{value:"vbr",label:"VBR (variable)"},{value:"cbr",label:"CBR (constant)"}],default:n?.bitrateMode??"vbr"}),o.supportsEncoderProfile&&d.push({type:"select",key:`${i.prefix}_encoderProfile`,label:"Encoder profile",options:[{value:"baseline",label:"Baseline"},{value:"main",label:"Main"},{value:"high",label:"High"}],default:n?.encoderProfile??"main"}),o.supportsGop){const l=o.gop;if(l){const h=[];for(let m=l.min;m<=l.max;m+=l.step)h.push({value:String(m),label:`${String(m)} s`});const y=n?.gop;y!==void 0&&!h.some(m=>m.value===String(y))&&h.unshift({value:String(y),label:`${String(y)} s (current)`}),d.push({type:"select",key:`${i.prefix}_gop`,label:"I-frame interval (GOP)",options:h,default:y!==void 0?String(y):h[0]?.value??""})}else d.push({type:"number",key:`${i.prefix}_gop`,label:"I-frame interval (GOP)",unit:"s",min:1,default:n?.gop??1})}return d.length===0?null:{id:`stream-${i.profile}`,tab:"streaming",title:i.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:d}}function Xy(i,o){const n=[];for(const d of uv){const l=i[d.profile];if(!l)continue;const h=gv(d,l,o?.[d.profile]);h&&n.push(h)}return n.length===0?null:{sections:n}}function eS(i,o){const n={};let d=!1;const l=`${o}_resolution`;if(l in i&&typeof i[l]=="string"){const[C,P]=i[l].split("x").map(Number);Number.isFinite(C)&&Number.isFinite(P)&&(n.width=C,n.height=P,d=!0)}const h=`${o}_codec`;h in i&&(i[h]==="h264"||i[h]==="h265")&&(n.codec=i[h],d=!0);const y=`${o}_framerate`;if(y in i){const C=Number(i[y]);Number.isFinite(C)&&(n.framerate=C,d=!0)}const m=`${o}_bitrate`;if(m in i){const C=Number(i[m]);Number.isFinite(C)&&(n.bitrate=C,d=!0)}const v=`${o}_bitrateMode`;v in i&&(i[v]==="vbr"||i[v]==="cbr")&&(n.bitrateMode=i[v],d=!0);const w=`${o}_encoderProfile`;w in i&&(i[w]==="high"||i[w]==="main"||i[w]==="baseline")&&(n.encoderProfile=i[w],d=!0);const A=`${o}_gop`;if(A in i){const C=Number(i[A]);Number.isFinite(C)&&(n.gop=C,d=!0)}return d?n:null}const tS={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",advancedNotifier:"advanced-notifier",airQualitySensor:"air-quality-sensor",alarmPanel:"alarm-panel",alerts:"alerts",ambientLightSensor:"ambient-light-sensor",audioAnalysis:"audio-analysis",audioAnalyzer:"audio-analyzer",audioCodec:"audio-codec",audioMetrics:"audio-metrics",authProvider:"auth-provider",automationControl:"automation-control",backup:"backup",battery:"battery",binary:"binary",brightness:"brightness",broker:"broker",button:"button",cameraCredentials:"camera-credentials",cameraPipelineConfig:"camera-pipeline-config",cameraStreams:"camera-streams",carbonMonoxide:"carbon-monoxide",climateControl:"climate-control",color:"color",connectivity:"connectivity",consumables:"consumables",contact:"contact",control:"control",cover:"cover",decoder:"decoder",detectionPipeline:"detection-pipeline",deviceAdoption:"device-adoption",deviceDiscovery:"device-discovery",deviceExport:"device-export",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",events:"events",fanControl:"fan-control",featureProbe:"feature-probe",flood:"flood",gas:"gas",humidifier:"humidifier",humiditySensor:"humidity-sensor",image:"image",integrations:"integrations",intercom:"intercom",lawnMowerControl:"lawn-mower-control",localNetwork:"local-network",lockControl:"lock-control",logDestination:"log-destination",mediaPlayer:"media-player",meshNetwork:"mesh-network",metricsProvider:"metrics-provider",motion:"motion",motionDetection:"motion-detection",motionTrigger:"motion-trigger",motionZones:"motion-zones",mqttBroker:"mqtt-broker",nativeObjectDetection:"native-object-detection",networkAccess:"network-access",networkQuality:"network-quality",nodes:"nodes",notificationOutput:"notification-output",notifier:"notifier",numericSensor:"numeric-sensor",oauthIntegration:"oauth-integration",osd:"osd",pipelineAnalytics:"pipeline-analytics",pipelineExecutor:"pipeline-executor",pipelineOrchestrator:"pipeline-orchestrator",pipelineRunner:"pipeline-runner",platformProbe:"platform-probe",powerMeter:"power-meter",presence:"presence",pressureSensor:"pressure-sensor",privacyMask:"privacy-mask",ptz:"ptz",ptzAutotrack:"ptz-autotrack",reboot:"reboot",recording:"recording",restreamer:"restreamer",scriptRunner:"script-runner",settingsStore:"settings-store",smoke:"smoke",smtpProvider:"smtp-provider",snapshot:"snapshot",snapshotProvider:"snapshot-provider",ssoBridge:"sso-bridge",storage:"storage",storageEvictable:"storage-evictable",storageProvider:"storage-provider",streamBroker:"stream-broker",streamCatalog:"stream-catalog",streamParams:"stream-params",streamingEngine:"streaming-engine",switch:"switch",system:"system",tamper:"tamper",temperatureSensor:"temperature-sensor",toast:"toast",turnProvider:"turn-provider",update:"update",userManagement:"user-management",userPasskeys:"user-passkeys",vacuumControl:"vacuum-control",valve:"valve",vibration:"vibration",waterHeater:"water-heater",weather:"weather",webrtc:"webrtc",webrtcSession:"webrtc-session",zoneAnalytics:"zone-analytics",zoneRules:"zone-rules",zones:"zones"},aS=[{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:"advancedNotifier",name:"advanced-notifier"},{key:"airQualitySensor",name:"air-quality-sensor"},{key:"alarmPanel",name:"alarm-panel"},{key:"alerts",name:"alerts"},{key:"ambientLightSensor",name:"ambient-light-sensor"},{key:"audioAnalysis",name:"audio-analysis"},{key:"audioAnalyzer",name:"audio-analyzer"},{key:"audioCodec",name:"audio-codec"},{key:"audioMetrics",name:"audio-metrics"},{key:"authProvider",name:"auth-provider"},{key:"automationControl",name:"automation-control"},{key:"backup",name:"backup"},{key:"battery",name:"battery"},{key:"binary",name:"binary"},{key:"brightness",name:"brightness"},{key:"broker",name:"broker"},{key:"button",name:"button"},{key:"cameraCredentials",name:"camera-credentials"},{key:"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:"connectivity",name:"connectivity"},{key:"consumables",name:"consumables"},{key:"contact",name:"contact"},{key:"control",name:"control"},{key:"cover",name:"cover"},{key:"decoder",name:"decoder"},{key:"detectionPipeline",name:"detection-pipeline"},{key:"deviceAdoption",name:"device-adoption"},{key:"deviceDiscovery",name:"device-discovery"},{key:"deviceExport",name:"device-export"},{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:"events",name:"events"},{key:"fanControl",name:"fan-control"},{key:"featureProbe",name:"feature-probe"},{key:"flood",name:"flood"},{key:"gas",name:"gas"},{key:"humidifier",name:"humidifier"},{key:"humiditySensor",name:"humidity-sensor"},{key:"image",name:"image"},{key:"integrations",name:"integrations"},{key:"intercom",name:"intercom"},{key:"lawnMowerControl",name:"lawn-mower-control"},{key:"localNetwork",name:"local-network"},{key:"lockControl",name:"lock-control"},{key:"logDestination",name:"log-destination"},{key:"mediaPlayer",name:"media-player"},{key:"meshNetwork",name:"mesh-network"},{key:"metricsProvider",name:"metrics-provider"},{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:"networkAccess",name:"network-access"},{key:"networkQuality",name:"network-quality"},{key:"nodes",name:"nodes"},{key:"notificationOutput",name:"notification-output"},{key:"notifier",name:"notifier"},{key:"numericSensor",name:"numeric-sensor"},{key:"oauthIntegration",name:"oauth-integration"},{key:"osd",name:"osd"},{key:"pipelineAnalytics",name:"pipeline-analytics"},{key:"pipelineExecutor",name:"pipeline-executor"},{key:"pipelineOrchestrator",name:"pipeline-orchestrator"},{key:"pipelineRunner",name:"pipeline-runner"},{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:"restreamer",name:"restreamer"},{key:"scriptRunner",name:"script-runner"},{key:"settingsStore",name:"settings-store"},{key:"smoke",name:"smoke"},{key:"smtpProvider",name:"smtp-provider"},{key:"snapshot",name:"snapshot"},{key:"snapshotProvider",name:"snapshot-provider"},{key:"ssoBridge",name:"sso-bridge"},{key:"storage",name:"storage"},{key:"storageEvictable",name:"storage-evictable"},{key:"storageProvider",name:"storage-provider"},{key:"streamBroker",name:"stream-broker"},{key:"streamCatalog",name:"stream-catalog"},{key:"streamParams",name:"stream-params"},{key:"streamingEngine",name:"streaming-engine"},{key:"switch",name:"switch"},{key:"system",name:"system"},{key:"tamper",name:"tamper"},{key:"temperatureSensor",name:"temperature-sensor"},{key:"toast",name:"toast"},{key:"turnProvider",name:"turn-provider"},{key:"update",name:"update"},{key:"userManagement",name:"user-management"},{key:"userPasskeys",name:"user-passkeys"},{key:"vacuumControl",name:"vacuum-control"},{key:"valve",name:"valve"},{key:"vibration",name:"vibration"},{key:"waterHeater",name:"water-heater"},{key:"weather",name:"weather"},{key:"webrtc",name:"webrtc"},{key:"webrtcSession",name:"webrtc-session"},{key:"zoneAnalytics",name:"zone-analytics"},{key:"zoneRules",name:"zone-rules"},{key:"zones",name:"zones"}],nS=[_u,Ep,Bp,$p,Yd,Up,Lp,yh,El,Hm,wo,Ao,tl,No,cm,sm,um,Po,Nm,Mo,Al,Do,xo,To,pp,Bu,Eu,Wm,Eo,Ro,Bo,qo,Oo,Lo,zo,Uo,_o,Vp,$m,Gl,Ho,Dp,Cm,Du,Fi,Am,Wt,$o,hm,Wo,Ko,Su,Go,Vt,Zo,Qo,Yo,Jo,Xo,Qg,$u,ei,dg,ti,Dl,ni,ug,mu,si,Hr,ri,hi,Ip,Si,Dm,Dg,Wg,Om,fi,bi,Ol,zu,eu,pd,am,Sd,ng,Ii,ki,wi,Ai,vu,Ni,Ru,Au,Gp,Pi,Ml,Mi,Fl,Rm,Bm,Bl,nl,Sl,hl,Sr,Vu,Di,cr,xi,Ng,Ti,Ei,Tg,Tm,Ri,wg,zl,Bi,qi,Oi,Li,zi,Zp,Yp,Ui,_i,oi],oS=["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","device-adoption","device-discovery","device-export","device-status","doorbell","enum-sensor","event-emitter","fan-control","feature-probe","flood","gas","humidifier","humidity-sensor","image","intercom","lawn-mower-control","lock-control","media-player","motion","motion-trigger","motion-zones","mqtt-broker","native-object-detection","notifier","numeric-sensor","osd","power-meter","presence","pressure-sensor","privacy-mask","ptz","ptz-autotrack","recording","script-runner","smoke","snapshot","stream-params","switch","tamper","temperature-sensor","update","vacuum-control","valve","vibration","water-heater","weather"],iS=Object.freeze({"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.cancelBulkUpdate":{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.getBulkUpdateState":{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.listActiveBulkUpdates":{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.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.startBulkUpdate":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.uninstallPackage":{capName:"addons",capScope:"system",addonId:null,access:"delete"},"addons.updateFrameworkPackage":{capName:"addons",capScope:"system",addonId:null,access:"create"},"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.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"},"advancedNotifier.deleteRule":{capName:"advanced-notifier",capScope:"system",addonId:null,access:"delete"},"advancedNotifier.getHistory":{capName:"advanced-notifier",capScope:"system",addonId:null,access:"view"},"advancedNotifier.getRules":{capName:"advanced-notifier",capScope:"system",addonId:null,access:"view"},"advancedNotifier.testRule":{capName:"advanced-notifier",capScope:"system",addonId:null,access:"create"},"advancedNotifier.upsertRule":{capName:"advanced-notifier",capScope:"system",addonId:null,access:"create"},"alarmPanel.arm":{capName:"alarm-panel",capScope:"device",addonId:null,access:"create"},"alarmPanel.disarm":{capName:"alarm-panel",capScope:"device",addonId:null,access:"create"},"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"},"audioAnalysis.resolveDeviceSettings":{capName:"audio-analysis",capScope:"device",addonId:null,access:"view"},"audioAnalyzer.analyseChunk":{capName:"audio-analyzer",capScope:"system",addonId:null,access:"create"},"audioAnalyzer.classify":{capName:"audio-analyzer",capScope:"system",addonId:null,access:"view"},"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.trigger":{capName:"automation-control",capScope:"device",addonId:null,access:"create"},"backup.delete":{capName:"backup",capScope:"system",addonId:null,access:"delete"},"backup.getEntries":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.list":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.listArchives":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.listDestinations":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.listLocations":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.previewSchedule":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.restore":{capName:"backup",capScope:"system",addonId:null,access:"create"},"backup.trigger":{capName:"backup",capScope:"system",addonId:null,access:"create"},"backup.upsertDestinationPolicy":{capName:"backup",capScope:"system",addonId:null,access:"create"},"battery.wakeForStream":{capName:"battery",capScope:"device",addonId:null,access:"create"},"brightness.setBrightness":{capName:"brightness",capScope:"device",addonId:null,access:"create"},"broker.add":{capName:"broker",capScope:"system",addonId:null,access:"create"},"broker.get":{capName:"broker",capScope:"system",addonId:null,access:"view"},"broker.getBrokerConfig":{capName:"broker",capScope:"system",addonId:null,access:"view"},"broker.getSettings":{capName:"broker",capScope:"system",addonId:null,access:"view"},"broker.getSettingsSchema":{capName:"broker",capScope:"system",addonId:null,access:"view"},"broker.getState":{capName:"broker",capScope:"system",addonId:null,access:"view"},"broker.getStatus":{capName:"broker",capScope:"system",addonId:null,access:"view"},"broker.list":{capName:"broker",capScope:"system",addonId:null,access:"view"},"broker.listProviders":{capName:"broker",capScope:"system",addonId:null,access:"view"},"broker.publish":{capName:"broker",capScope:"system",addonId:null,access:"create"},"broker.remove":{capName:"broker",capScope:"system",addonId:null,access:"delete"},"broker.setSettings":{capName:"broker",capScope:"system",addonId:null,access:"create"},"broker.subscribe":{capName:"broker",capScope:"system",addonId:null,access:"create"},"broker.testConnection":{capName:"broker",capScope:"system",addonId:null,access:"create"},"broker.testSettings":{capName:"broker",capScope:"system",addonId:null,access:"create"},"broker.unsubscribe":{capName:"broker",capScope:"system",addonId:null,access:"create"},"button.press":{capName:"button",capScope:"device",addonId:null,access:"create"},"cameraCredentials.getCredentials":{capName:"camera-credentials",capScope:"device",addonId:null,access:"view"},"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"},"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.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.setColor":{capName:"color",capScope:"device",addonId:null,access:"create"},"consumables.reset":{capName:"consumables",capScope:"device",addonId:null,access:"delete"},"control.setValue":{capName:"control",capScope:"device",addonId:null,access:"create"},"cover.close":{capName:"cover",capScope:"device",addonId:null,access:"create"},"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"},"decoder.createSession":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.destroySession":{capName:"decoder",capScope:"system",addonId:null,access:"delete"},"decoder.getFrame":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.getInfo":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.getShmStats":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.getStats":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.listActiveSessions":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.openStream":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.pullFrames":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.pullHandles":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.pushPacket":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.reprobeHwaccel":{capName:"decoder",capScope:"system",addonId:null,access:"create"},"decoder.supportsCodec":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.updateConfig":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"deviceAdoption.adopt":{capName:"device-adoption",capScope:"system",addonId:null,access:"create"},"deviceAdoption.getCandidate":{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.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.exposeDevice":{capName:"device-export",capScope:"system",addonId:null,access:"create"},"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"},"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.adoptionListCandidates":{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.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.discoverDevices":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"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.getChildren":{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.getSettingsSchema":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getStreamProfileMap":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getStreamSources":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getWireableFields":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.listAll":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.listBindableCapsForDeviceType":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.listLocations":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.listPersistedByAddon":{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.persistConfig":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.probeStreams":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"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.runDeviceAction":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.setChildLayout":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.setDeviceLinks":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.setDisabled":{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.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.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.getStatus":{capName:"device-provider",capScope:"system",addonId:null,access:"view"},"deviceProvider.start":{capName:"device-provider",capScope:"system",addonId:null,access:"create"},"deviceProvider.stop":{capName:"device-provider",capScope:"system",addonId:null,access:"create"},"deviceProvider.supportsDiscovery":{capName:"device-provider",capScope:"system",addonId:null,access:"view"},"deviceProvider.supportsManualCreation":{capName:"device-provider",capScope:"system",addonId:null,access:"view"},"deviceProvider.testCreationField":{capName:"device-provider",capScope:"system",addonId:null,access:"create"},"deviceState.getAllSnapshots":{capName:"device-state",capScope:"system",addonId:null,access:"view"},"deviceState.getCapSlice":{capName:"device-state",capScope:"system",addonId:null,access:"view"},"deviceState.getSnapshot":{capName:"device-state",capScope:"system",addonId:null,access:"view"},"deviceState.setCapSlice":{capName:"device-state",capScope:"system",addonId:null,access:"create"},"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"},"events.getEventClipUrl":{capName:"events",capScope:"device",addonId:null,access:"view"},"events.getEvents":{capName:"events",capScope:"device",addonId:null,access:"view"},"events.getEventThumbnail":{capName:"events",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"},"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"},"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.handleAnswer":{capName:"intercom",capScope:"device",addonId:null,access:"create"},"intercom.pushTalkAudio":{capName:"intercom",capScope:"device",addonId:null,access:"create"},"intercom.startSession":{capName:"intercom",capScope:"device",addonId:null,access:"create"},"intercom.startTalkSession":{capName:"intercom",capScope:"device",addonId:null,access:"create"},"intercom.stopSession":{capName:"intercom",capScope:"device",addonId:null,access:"create"},"lawnMowerControl.dock":{capName:"lawn-mower-control",capScope:"device",addonId:null,access:"create"},"lawnMowerControl.pause":{capName:"lawn-mower-control",capScope:"device",addonId:null,access:"create"},"lawnMowerControl.startMowing":{capName:"lawn-mower-control",capScope:"device",addonId:null,access:"create"},"localNetwork.getAllowedAddresses":{capName:"local-network",capScope:"system",addonId:null,access:"view"},"localNetwork.getConnectionEndpoints":{capName:"local-network",capScope:"system",addonId:null,access:"view"},"localNetwork.getPreferred":{capName:"local-network",capScope:"system",addonId:null,access:"view"},"localNetwork.list":{capName:"local-network",capScope:"system",addonId:null,access:"view"},"localNetwork.resetAllowlistToBestMatch":{capName:"local-network",capScope:"system",addonId:null,access:"delete"},"localNetwork.setAllowedAddresses":{capName:"local-network",capScope:"system",addonId:null,access:"create"},"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"},"logDestination.query":{capName:"log-destination",capScope:"system",addonId:null,access:"view"},"logDestination.write":{capName:"log-destination",capScope:"system",addonId:null,access:"create"},"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.getProcessStats":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"metricsProvider.killProcess":{capName:"metrics-provider",capScope:"system",addonId:null,access:"create"},"metricsProvider.listAddonInstances":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"metricsProvider.listNodeProcesses":{capName:"metrics-provider",capScope:"system",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.removeCamera":{capName:"motion-detection",capScope:"device",addonId:null,access:"delete"},"motionDetection.reset":{capName:"motion-detection",capScope:"device",addonId:null,access:"delete"},"motionTrigger.setMotionTrigger":{capName:"motion-trigger",capScope:"device",addonId:null,access:"create"},"motionZones.getOptions":{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.setEnabled":{capName:"native-object-detection",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"},"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.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.send":{capName:"notification-output",capScope:"system",addonId:null,access:"create"},"notificationOutput.sendTest":{capName:"notification-output",capScope:"system",addonId:null,access:"create"},"notifier.cancel":{capName:"notifier",capScope:"device",addonId:null,access:"create"},"notifier.send":{capName:"notifier",capScope:"device",addonId:null,access:"create"},"oauthIntegration.getDescriptor":{capName:"oauth-integration",capScope:"system",addonId:null,access:"view"},"osd.setOverlay":{capName:"osd",capScope:"device",addonId:null,access:"create"},"pipelineAnalytics.clearTracks":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"delete"},"pipelineAnalytics.getActiveTracks":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.getAudioEvents":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.getEventDensity":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.getEventMedia":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.getMotionEvents":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.getObjectEvents":{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.listTracks":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.pruneEventsBefore":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"create"},"pipelineExecutor.cacheFrameInPool":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.deleteModel":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"delete"},"pipelineExecutor.deleteTemplate":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"delete"},"pipelineExecutor.detect":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"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.getGlobalPipelineConfig":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getGlobalSteps":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getOrchestratorConfigSchema":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getReferenceAudio":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getReferenceAudioFiles":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getReferenceImage":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getSchema":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getSelectedEngine":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getVideoPipelineSteps":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.inferCached":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.killEngine":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.listLoadedEngines":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.listReferenceImages":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.listTemplates":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.reprobeEngine":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.runAudioTest":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.runPipeline":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.runPipelineBatch":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.saveTemplate":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.setVideoPipelineSteps":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.spinEngine":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.uncacheFrame":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.updateTemplate":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.assignAudio":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.assignDecoder":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.assignPipeline":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.deleteTemplate":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"delete"},"pipelineOrchestrator.getAgentLoad":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getAgentSettings":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getAudioAssignment":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getAudioAssignments":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getAudioNodeLoad":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getCameraMetrics":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getCameraSettings":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getCameraStepOverrides":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getCapabilityBindings":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getDecoderAssignment":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getDecoderAssignments":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getGlobalMetrics":{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.listAgentSettings":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.listTemplates":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.rebalance":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.removeAgentSettings":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"delete"},"pipelineOrchestrator.resolvePipeline":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.saveTemplate":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.setAgentAddonDefaults":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.setCameraPipelineForAgent":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.setCameraStepOverride":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.setCameraStepToggle":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.setCapabilityBinding":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.unassignAudio":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.unassignDecoder":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.unassignPipeline":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.updateTemplate":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineRunner.attachCamera":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"create"},"pipelineRunner.detachCamera":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"create"},"pipelineRunner.getAllCameraMetrics":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"view"},"pipelineRunner.getCameraMetrics":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"view"},"pipelineRunner.getLocalCameras":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"view"},"pipelineRunner.getLocalLoad":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"view"},"pipelineRunner.getLocalMetrics":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"view"},"pipelineRunner.reportMotion":{capName:"pipeline-runner",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.getHardwareDecodeAccels":{capName:"platform-probe",capScope:"system",addonId:null,access:"view"},"platformProbe.getHardwareEncoders":{capName:"platform-probe",capScope:"system",addonId:null,access:"view"},"platformProbe.refreshHardwareDecodeAccels":{capName:"platform-probe",capScope:"system",addonId:null,access:"create"},"platformProbe.refreshHardwareEncoders":{capName:"platform-probe",capScope:"system",addonId:null,access:"create"},"platformProbe.resolveHwAccel":{capName:"platform-probe",capScope:"system",addonId:null,access:"view"},"platformProbe.resolveInferenceConfig":{capName:"platform-probe",capScope:"system",addonId:null,access:"view"},"privacyMask.getOptions":{capName:"privacy-mask",capScope:"device",addonId:null,access:"view"},"privacyMask.setMask":{capName:"privacy-mask",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.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.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.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:"system",addonId:null,access:"view"},"recording.getDeviceConfig":{capName:"recording",capScope:"system",addonId:null,access:"view"},"recording.getPlaybackManifest":{capName:"recording",capScope:"system",addonId:null,access:"view"},"recording.getStorageUsage":{capName:"recording",capScope:"system",addonId:null,access:"view"},"recording.pruneFootage":{capName:"recording",capScope:"system",addonId:null,access:"create"},"recording.rescanStorage":{capName:"recording",capScope:"system",addonId:null,access:"create"},"recording.setDeviceConfig":{capName:"recording",capScope:"system",addonId:null,access:"create"},"restreamer.getExposedResources":{capName:"restreamer",capScope:"system",addonId:null,access:"view"},"restreamer.registerDevice":{capName:"restreamer",capScope:"system",addonId:null,access:"create"},"restreamer.unregisterDevice":{capName:"restreamer",capScope:"system",addonId:null,access:"delete"},"scriptRunner.run":{capName:"script-runner",capScope:"device",addonId:null,access:"create"},"scriptRunner.stop":{capName:"script-runner",capScope:"device",addonId:null,access:"create"},"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.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.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"},"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.getSnapshot":{capName:"snapshot",capScope:"device",addonId:null,access:"view"},"snapshot.invalidateCache":{capName:"snapshot",capScope:"device",addonId:null,access:"create"},"snapshotProvider.getSnapshot":{capName:"snapshot-provider",capScope:"system",addonId:null,access:"view"},"snapshotProvider.supportsDevice":{capName:"snapshot-provider",capScope:"system",addonId:null,access:"view"},"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.getDefaultLocation":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.list":{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"},"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.assignProfile":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.getAllRtspEntries":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.getBrokerStats":{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.publishCameraStream":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.pullAudioChunks":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.pullFrameHandles":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.regenerateRtspToken":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.releaseStreamWithCodec":{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.setPreBufferDuration":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.setRtspEnabled":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.subscribeAudioChunks":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.subscribeFrames":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.unassignProfile":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.unsubscribeAudioChunks":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.unsubscribeFrames":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamCatalog.getCatalog":{capName:"stream-catalog",capScope:"device",addonId:null,access:"view"},"streamingEngine.getStreamUrl":{capName:"streaming-engine",capScope:"system",addonId:null,access:"view"},"streamingEngine.listStreams":{capName:"streaming-engine",capScope:"system",addonId:null,access:"view"},"streamingEngine.registerStream":{capName:"streaming-engine",capScope:"system",addonId:null,access:"create"},"streamingEngine.unregisterStream":{capName:"streaming-engine",capScope:"system",addonId:null,access:"delete"},"streamParams.getConfigSchema":{capName:"stream-params",capScope:"device",addonId:null,access:"view"},"streamParams.getOptions":{capName:"stream-params",capScope:"device",addonId:null,access:"view"},"streamParams.setProfile":{capName:"stream-params",capScope:"device",addonId:null,access:"create"},"switch.setState":{capName:"switch",capScope:"device",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.getRetentionConfig":{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.setRetentionConfig":{capName:"system",capScope:"system",addonId:null,access:"create"},"toast.onToast":{capName:"toast",capScope:"system",addonId:null,access:"view"},"turnProvider.getTurnServers":{capName:"turn-provider",capScope:"system",addonId:null,access:"view"},"update.installUpdate":{capName:"update",capScope:"device",addonId:null,access:"create"},"userManagement.confirmTotp":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.createApiKey":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.createScopedToken":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.createUser":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.deleteUser":{capName:"user-management",capScope:"system",addonId:null,access:"delete"},"userManagement.disableTotp":{capName:"user-management",capScope:"system",addonId:null,access:"delete"},"userManagement.getTotpStatus":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.listApiKeys":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.listOauthSessions":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.listScopedTokens":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.listUsers":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.oauthExchangeCode":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.oauthIssueCode":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.oauthRefresh":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.oauthVerifyAccessToken":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.resetPassword":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.revokeApiKey":{capName:"user-management",capScope:"system",addonId:null,access:"delete"},"userManagement.revokeOauthSession":{capName:"user-management",capScope:"system",addonId:null,access:"delete"},"userManagement.revokeScopedToken":{capName:"user-management",capScope:"system",addonId:null,access:"delete"},"userManagement.setupTotp":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.setUserScopes":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.updateUser":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.validateApiKey":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.validateCredentials":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.validateScopedToken":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.verifyTotp":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userPasskeys.beginAuthentication":{capName:"user-passkeys",capScope:"system",addonId:null,access:"view"},"userPasskeys.beginRegistration":{capName:"user-passkeys",capScope:"system",addonId:null,access:"create"},"userPasskeys.finishAuthentication":{capName:"user-passkeys",capScope:"system",addonId:null,access:"view"},"userPasskeys.finishRegistration":{capName:"user-passkeys",capScope:"system",addonId:null,access:"create"},"userPasskeys.listPasskeys":{capName:"user-passkeys",capScope:"system",addonId:null,access:"view"},"userPasskeys.removePasskey":{capName:"user-passkeys",capScope:"system",addonId:null,access:"delete"},"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.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"},"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"},"webrtc.closeSession":{capName:"webrtc",capScope:"system",addonId:null,access:"create"},"webrtc.createSession":{capName:"webrtc",capScope:"system",addonId:null,access:"create"},"webrtc.handleAnswer":{capName:"webrtc",capScope:"system",addonId:null,access:"create"},"webrtc.handleOffer":{capName:"webrtc",capScope:"system",addonId:null,access:"create"},"webrtc.hasAdaptiveBitrate":{capName:"webrtc",capScope:"system",addonId:null,access:"view"},"webrtc.registerStream":{capName:"webrtc",capScope:"system",addonId:null,access:"create"},"webrtc.supportsStream":{capName:"webrtc",capScope:"system",addonId:null,access:"view"},"webrtc.unregisterStream":{capName:"webrtc",capScope:"system",addonId:null,access:"delete"},"webrtcSession.addIceCandidate":{capName:"webrtc-session",capScope:"device",addonId:null,access:"create"},"webrtcSession.closeSession":{capName:"webrtc-session",capScope:"device",addonId:null,access:"create"},"webrtcSession.createSession":{capName:"webrtc-session",capScope:"device",addonId:null,access:"create"},"webrtcSession.getIceCandidates":{capName:"webrtc-session",capScope:"device",addonId:null,access:"view"},"webrtcSession.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.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"}}),sS=["accessories","addon-pages","addon-pages-source","addon-routes","addon-settings","addon-widgets","addon-widgets-source","addons","admin-ui","advanced-notifier","alarm-panel","alerts","audio-analysis","audio-analyzer","audio-codec","audio-metrics","auth-provider","automation-control","backup","battery","brightness","broker","button","camera-credentials","camera-streams","climate-control","color","consumables","control","cover","decoder","device-adoption","device-discovery","device-export","device-manager","device-ops","device-provider","device-state","embedding-encoder","events","fan-control","humidifier","integrations","intercom","lawn-mower-control","local-network","lock-control","log-destination","media-player","mesh-network","metrics-provider","motion","motion-detection","motion-trigger","motion-zones","mqtt-broker","native-object-detection","network-access","network-quality","nodes","notification-output","notifier","oauth-integration","osd","pipeline-analytics","pipeline-executor","pipeline-orchestrator","pipeline-runner","platform-probe","privacy-mask","ptz","ptz-autotrack","reboot","recording","restreamer","script-runner","settings-store","smtp-provider","snapshot","snapshot-provider","sso-bridge","storage","storage-evictable","storage-provider","stream-broker","stream-catalog","stream-params","streaming-engine","switch","system","toast","turn-provider","update","user-management","user-passkeys","vacuum-control","valve","water-heater","webrtc","webrtc-session","zone-analytics","zone-rules","zones"],cS=["accessories","alarm-panel","audio-analysis","audio-metrics","automation-control","battery","brightness","button","camera-credentials","camera-streams","climate-control","color","consumables","control","cover","device-discovery","device-ops","events","fan-control","humidifier","intercom","lawn-mower-control","lock-control","media-player","motion","motion-detection","motion-trigger","motion-zones","native-object-detection","notifier","osd","pipeline-analytics","privacy-mask","ptz","ptz-autotrack","reboot","script-runner","snapshot","stream-catalog","stream-params","switch","update","vacuum-control","valve","water-heater","webrtc-session","zone-analytics","zone-rules","zones"],rS=["addon-pages","addon-pages-source","addon-routes","addon-settings","addon-widgets","addon-widgets-source","addons","admin-ui","advanced-notifier","alerts","audio-analyzer","audio-codec","auth-provider","backup","broker","decoder","device-adoption","device-export","device-manager","device-provider","device-state","embedding-encoder","integrations","local-network","log-destination","mesh-network","metrics-provider","mqtt-broker","network-access","network-quality","nodes","notification-output","oauth-integration","pipeline-executor","pipeline-orchestrator","pipeline-runner","platform-probe","recording","restreamer","settings-store","smtp-provider","snapshot-provider","sso-bridge","storage","storage-evictable","storage-provider","stream-broker","streaming-engine","system","toast","turn-provider","user-management","user-passkeys","webrtc"],dS=[{id:"camera-viewer",label:"Camera viewer",description:"Read-only over every device — live streams, recordings, motion events, battery state. Combine with `allowedDevices` to restrict to specific cameras.",rows:[{type:"category",target:"device",access:["view"]}]},{id:"camera-operator",label:"Camera operator",description:"Everything `camera-viewer` does plus PTZ control, intercom, snapshots and recording start/stop. Cannot delete devices or recordings.",rows:[{type:"category",target:"device",access:["view","create"]}]},{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:"events",access:["view"]},{type:"capability",target:"motion-detection",access:["view"]},{type:"capability",target:"audio-analysis",access:["view"]}]}],hv=Object.freeze({broker:"broker","device-export":"device-export","mesh-network":"mesh","mqtt-broker":"broker","network-access":"ingress","smtp-provider":"email"}),lS=["broker","device-export","mesh-network","mqtt-broker","network-access","smtp-provider"];function pS(i){const o=[];for(const[n,d]of Object.entries(hv))d===i&&o.push(n);return o}function vv(i,o){const n=i.length,d=o.length;if(n===0)return d;if(d===0)return n;const l=Array.from({length:d+1},(y,m)=>m),h=Array.from({length:d+1},()=>0);for(let y=1;y<=n;y++){h[0]=y;let m=l[0]??0;for(let v=1;v<=d;v++){const w=l[v]??0,A=h[v-1]??0,C=i.charCodeAt(y-1)===o.charCodeAt(v-1)?0:1;h[v]=Math.min(w+1,A+1,m+C),m=w}for(let v=0;v<=d;v++)l[v]=h[v]??0}return l[d]??0}function yv(i,o){const n=i.trim().toLowerCase(),d=o.trim().toLowerCase();return n===d?1:n.length===0||d.length===0?0:1-vv(n,d)/Math.max(n.length,d.length)}function mS(i,o,n=.8){let d=null,l=0;for(const h of o){const y=yv(i,h);y>=n&&y>l&&(d=h,l=y)}return d}const Sv=[/^user$/i,/^usr$/i,/^username$/i,/^password$/i,/^pwd$/i,/^pass$/i,/^passwd$/i,/^secret$/i,/^token$/i,/^auth$/i,/^auth[_-]?token$/i,/^bearer$/i,/^api[_-]?key$/i,/^access[_-]?token$/i,/^refresh[_-]?token$/i];function fv(i){return Sv.some(o=>o.test(i))}function uS(i){try{const o=new URL(i);let n=!1;(o.username||o.password)&&(o.username="",o.password="",n=!0);for(const d of[...o.searchParams.keys()])fv(d)&&(o.searchParams.set(d,"***"),n=!0);return n?o.toString():i}catch{return i}}class gS{constructor(o){this.capacity=o,this.items=Array.from({length:o})}items;head=0;tail=0;count=0;get size(){return this.count}push(o){this.items[this.tail]=o,this.tail=(this.tail+1)%this.capacity,this.count<this.capacity?this.count++:this.head=(this.head+1)%this.capacity}drain(o){const n=[],d=Math.min(o,this.count);for(let l=0;l<d;l++)n.push(this.items[this.head]),this.items[this.head]=void 0,this.head=(this.head+1)%this.capacity;return this.count-=d,n}}function hS(i,o,n){const d=o*n;if(d<=0||i.length===0)return new Array(Math.max(0,d)).fill(!1);const l=new Array(d).fill(!1);for(let h=0;h<n;h++)for(let y=0;y<o;y++){const m=(y+.5)/o,v=(h+.5)/n;for(const w of i)if(m>=w.x&&m<=w.x+w.w&&v>=w.y&&v<=w.y+w.h){l[h*o+y]=!0;break}}return l}function vS(i,o,n,d){if(o<=0||n<=0||d<=0)return[];const l=o*n,h=new Array(l).fill(!1),y=Math.min(i.length,l);for(let C=0;C<y;C++)h[C]=i[C]===!0;const m=[],v=[];for(let C=0;C<=n;C++){const P=[];if(C<n){let M=-1;for(let D=0;D<=o;D++){const q=D<o&&h[C*o+D]===!0;q&&M===-1?M=D:!q&&M!==-1&&(P.push({colStart:M,colEnd:D-1}),M=-1)}}const E=new Set,B=[];for(const M of v){const D=P.findIndex(q=>q.colStart===M.colStart&&q.colEnd===M.colEnd);D>=0?(B.push(M),E.add(D)):m.push({...M,rowEnd:C-1})}for(let M=0;M<P.length;M++)if(!E.has(M)){const D=P[M];B.push({colStart:D.colStart,colEnd:D.colEnd,rowStart:C})}v.length=0;for(const M of B)v.push(M)}if(m.length===0)return[];const w=m.slice().sort((C,P)=>{const E=(C.colEnd-C.colStart+1)*(C.rowEnd-C.rowStart+1);return(P.colEnd-P.colStart+1)*(P.rowEnd-P.rowStart+1)-E});return(d>0?w.slice(0,d):w).map(C=>({x:C.colStart/o,y:C.rowStart/n,w:(C.colEnd-C.colStart+1)/o,h:(C.rowEnd-C.rowStart+1)/n}))}function yS(i){return new Promise(o=>setTimeout(o,Math.max(0,i)))}function SS(i,o){return o.aborted?Promise.resolve():new Promise(n=>{const d=setTimeout(()=>{o.removeEventListener("abort",l),n()},Math.max(0,i)),l=()=>{clearTimeout(d),o.removeEventListener("abort",l),n()};o.addEventListener("abort",l,{once:!0})})}function fS(i,o,n){const d={};for(const l of Object.keys(n))d[l]=h=>i.addons.custom.mutate({addonId:o,action:l,input:h});return d}export{Tv as ACCESSORY_LABEL,nS as ALL_CAPABILITY_DEFINITIONS,Kc as APPLE_SA_TO_MACRO,Gv as AUDIO_BACKEND_CHOICES,Wc as AUDIO_MACRO_LABELS,Uu as AccessoriesStatusSchema,j as AccessoryKind,vp as AddBrokerInputSchema,sh as AddonAutoUpdateSchema,eh as AddonListItemSchema,Rp as AddonPageDeclarationSchema,Tp as AddonPageInfoSchema,ji as AdoptionAdoptInputSchema,Gi as AdoptionAdoptResultSchema,Hl as AdoptionFilterSchema,Wl as AdoptionGetCandidateInputSchema,Vi as AdoptionListCandidatesInputSchema,Ki as AdoptionListCandidatesOutputSchema,Zi as AdoptionReleaseInputSchema,Et as AdoptionStatusSchema,Xp as AgentLoadSummarySchema,Da as AirQualitySensorStatusSchema,Co as AlarmArmModeSchema,Ta as AlarmPanelStatusSchema,ar as AlarmStateSchema,et as AlertSchema,Jd as AlertSeveritySchema,el as AlertSourceSchema,Xd as AlertStatusSchema,Ea as AmbientLightSensorStatusSchema,Wv as ApiKeyRecordSchema,Lt as ApiKeySummarySchema,kl as ArchiveEntrySchema,wl as ArchiveManifestSchema,nm as AudioAnalysisResultSchema,om as AudioAnalysisSettingsSchema,sn as AudioChunkInputSchema,nr as AudioClassSummarySchema,At as AudioClassificationLabelSchema,im as AudioClassificationResultSchema,rm as AudioCodecInfoSchema,dm as AudioDecodeSessionConfigSchema,Fc as AudioEncodeSchema,lm as AudioEncodeSessionConfigSchema,Vn as AudioEncodedChunkSchema,Zm as AudioEventSchema,_r as AudioLevelSchema,or as AudioMetricsHistoryPointSchema,ir as AudioMetricsHistorySchema,Ra as AudioMetricsSnapshotSchema,pm as AudioPcmChunkSchema,ot as AuthResultSchema,ih as AutoUpdateSettingsSchema,Ba as AutomationControlStatusSchema,Vg as AvailableIntegrationTypeSchema,rs as BACKEND_TO_FORMAT,Zc as BATTERY_DEVICE_PROFILE,bl as BackupDestinationInfoSchema,En as BackupEntrySchema,Ih as BaseAddon,Hy as BaseDevice,$y as BaseDeviceProvider,Ge as BatteryStatusSchema,qa as BinaryStatusSchema,ce as BoundingBoxSchema,Oa as BrightnessStatusSchema,Jl as BrokerAddInputSchema,lr as BrokerAudioClientSchema,ur as BrokerClientsSchema,hp as BrokerConnectionDetailsSchema,wt as BrokerConsumerAttributionSchema,pr as BrokerConsumerKindSchema,dr as BrokerDecodedClientSchema,mr as BrokerEncodedClientSchema,lp as BrokerGetStateInputSchema,gp as BrokerInfoSchema,Ql as BrokerProviderInfoSchema,sp as BrokerPublishInputSchema,zn as BrokerRegistryStatusSchema,rr as BrokerRtspClientSchema,Tc as BrokerStatsSchema,Zl as BrokerStatusEnum,xc as BrokerStatusSchema,cp as BrokerSubscribeInputSchema,rp as BrokerSubscribeResultSchema,tp as BrokerTestConnectionResultSchema,dp as BrokerUnsubscribeInputSchema,Aa as CAM_PROFILE_ORDER,tS as CAPABILITY_NAMES,aS as CAPABILITY_ROUTER_KEYS,oS as CAP_NAMES_WITH_STATUS,hv as CAP_PROVIDER_KIND_MAP,Ly as COCO_80_LABELS,Uy as COCO_TO_MACRO,L as CamProfileSchema,Wu as CamStreamDescriptorSchema,Ht as CamStreamKindSchema,ie as CamStreamResolutionSchema,xu as CameraCredentialsSchema,Tu as CameraCredentialsStatusSchema,Zt as CameraMetricsSchema,$r as CameraMetricsWithDeviceIdSchema,St as CameraStreamSchema,$l as CandidateQueryFilterSchema,Rl as CapScopeSchema,tm as CapabilityBindingsSchema,za as CarbonMonoxideStatusSchema,jc as ChargingStatus,Mg as ClientNetworkStatsSchema,Ua as ClimateControlStatusSchema,zg as ClusterAddonNodeDeploymentSchema,Ug as ClusterAddonStatusEntrySchema,Nl as CollectionColumnSchema,Pl as CollectionIndexSchema,_a as ColorStatusSchema,vm as ConfigEntrySchema,Qd as ConfigSectionWithValuesSchema,Zd as ConfigTabDeclarationSchema,Fa as ConnectivityStatusSchema,Cr as ConsumableItemSchema,Ha as ConsumablesStatusSchema,$a as ContactStatusSchema,Ar as ControlKindSchema,Wa as ControlStatusSchema,Pr as CoverStateSchema,Va as CoverStatusSchema,vg as CreateApiKeyInputSchema,yg as CreateApiKeyResultSchema,jg as CreateIntegrationInputSchema,Sg as CreateScopedTokenInputSchema,fg as CreateScopedTokenResultSchema,gg as CreateUserInputSchema,vh as CustomActionInputSchema,ry as DATAPLANE_SECRET_HEADER,fh as DEFAULT_ADDON_PLACEMENT,Zv as DEFAULT_AUDIO_ANALYZER_CONFIG,jv as DEFAULT_DECODER_HWACCEL_CONFIG,gy as DEFAULT_FEATURES,Sy as DEFAULT_RETENTION,cS as DEVICE_CAP_NAMES,Qc as DEVICE_PROFILES,er as DEVICE_SETTINGS_CONTRIBUTION_METHODS,tr as DEVICE_STATUS_METHOD,_y as DEVICE_TYPE_INFO,Pc as DecodedAudioChunkSchema,Na as DecodedFrameSchema,Wn as DecoderAssignmentSchema,Ma as DecoderSessionConfigSchema,Uc as DecoderStatsSchema,Zg as DeleteIntegrationResultSchema,Yr as DetectorOutputSchema,he as DeviceConfig,Ka as DeviceDiscoveryStatusSchema,Pp as DeviceExportExposeInputSchema,_n as DeviceExportStatusSchema,Mp as DeviceExportUnexposeInputSchema,ko as DeviceFeature,nt as DeviceInfoSchema,so as DeviceNetworkStatsSchema,V as DeviceRole,aa as DeviceRuntimeState,Ke as DeviceStatusSchema,f as DeviceType,ne as DiscoveredChildDeviceSchema,Tr as DiscoveredChildStatusSchema,Hv as DiscoveredDeviceSchema,Yv as DisposerChain,Er as DoorbellPressEventSchema,ja as DoorbellStatusSchema,Dy as ElementConfigStore,gm as EmbeddingInfoSchema,Kn as EmbeddingResultSchema,Hc as EncodeProfileSchema,wc as EncodedPacketSchema,zp as EnrichedWidgetMetadataSchema,Rr as EnumSensorDateTimeFormatSchema,Ga as EnumSensorStatusSchema,Re as EventCategory,Za as EventEmitterStatusSchema,Vo as EventFireSchema,yu as EventItemSchema,Vm as EventKindSchema,Oh as EventSourceType,wp as ExportSetupFieldSchema,Cp as ExportSetupSchema,Np as ExposedDeviceSchema,jp as ExposedResourceSchema,Qa as FanControlStatusSchema,jo as FanDirectionSchema,io as FeatureManifestSchema,je as FeatureProbeStatusSchema,Ya as FloodStatusSchema,Cc as FrameHandleFormatSchema,bt as FrameHandleSchema,Me as FrameInputSchema,Ja as GasStatusSchema,vr as GetStreamWithCodecInputSchema,em as GlobalMetricsSchema,fy as HF_BASE_URL,Lh as HF_REPO,Kv as HWACCEL_OPTIONS,Cg as HealthStatusSchema,Xe as HistoryPointSchema,Vd as HistoryResolutionEnum,Xa as HumidifierStatusSchema,en as HumiditySensorStatusSchema,Ct as HvacModeSchema,tn as ImageStatusSchema,th as InstalledPackageSchema,lt as IntegrationLiteSchema,co as IntegrationWithStateSchema,Fu as IntercomAbilitySchema,to as IntercomStatusSchema,sS as KNOWN_CAP_NAMES,Br as LawnMowerActivitySchema,an as LawnMowerControlStatusSchema,Cl as LocationStatSchema,nn as LockControlStatusSchema,qr as LockStateSchema,Bn as LogEntrySchema,Hi as LogLevelSchema,gh as LogStreamEntrySchema,zy as MACRO_LABELS,iS as METHOD_ACCESS_MAP,Sc as MODEL_FORMATS,wd as MaskGridDimsSchema,mi as MaskGridShapeSchema,Id as MaskLineShapeSchema,di as MaskPointSchema,pi as MaskPolygonShapeSchema,kd as MaskPolygonVerticesSchema,li as MaskRectShapeSchema,ui as MaskShapeKindSchema,_v as MaskShapeSchema,Gn as MediaFileSchema,ai as MediaPlayerRepeatSchema,Or as MediaPlayerStateSchema,on as MediaPlayerStatusSchema,pg as MeshPeerSchema,mg as MeshStatusSchema,ke as MethodAccessSchema,Fr as MotionAnalysisResultSchema,jm as MotionEventSchema,fd as MotionOnMotionChangedDataSchema,qe as MotionRegionSchema,Qt as MotionSourceEnum,gd as MotionSourcesSchema,rn as MotionStatusSchema,bd as MotionTriggerRuntimeStateSchema,ci as MotionTriggerStatusSchema,Cd as MotionZoneOptionsSchema,Ad as MotionZonePatchSchema,gi as MotionZoneRegionSchema,dn as MotionZoneStatusSchema,Un as MqttBrokerStatusSchema,vi as NativeDetectionSchema,Mt as NativeObjectClassEnum,Nd as NativeObjectDetectionRuntimeStateSchema,yi as NativeObjectDetectionStatusSchema,Pm as NetworkAccessStatusSchema,Ag as NetworkAddressSchema,Ue as NetworkEndpointSchema,_m as NotificationHistoryEntrySchema,jn as NotificationRuleSchema,qm as NotificationSchema,ln as NotifierStatusSchema,pn as NumericSensorStatusSchema,ql as OauthIntegrationDescriptorSchema,Gm as ObjectEventSchema,zv as OrchestratorMetricsSchema,qu as OsdOverlayKindEnum,Lu as OsdOverlayPatchSchema,Ou as OsdOverlaySchema,qt as OsdPositionEnum,eo as OsdStatusSchema,Sh as PIPELINE_FLOW_CAPABILITY_NAMES,Qv as PIPELINE_OWNER_CAPABILITY_NAMES,lS as PROVIDER_KIND_CAP_NAMES,Fh as PYTHON_SCRIPT,ah as PackageUpdateSchema,nh as PackageVersionInfoSchema,Ll as PasskeySummarySchema,He as PcmSampleFormatSchema,xt as PerScopeBreakdownSchema,Ir as PickStreamPreferencesSchema,br as PickStreamRequirementsSchema,kr as PickedCamStreamSchema,$n as PipelineAssignmentSchema,Pt as PipelineDefaultStepSchema,R as PipelineEngineChoiceSchema,cn as PipelineRunResultBridge,oe as PipelineStepInputSchema,Ov as PlaceholderReasonSchema,ud as PolygonPointSchema,mn as PowerMeterStatusSchema,un as PresenceStatusSchema,gn as PressureSensorStatusSchema,Bd as PrivacyMaskOptionsSchema,qd as PrivacyMaskPatchSchema,Ci as PrivacyMaskRegionSchema,Rd as PrivacyMaskShapeSchema,hn as PrivacyMaskStatusSchema,Ec as ProfileRtspEntrySchema,ft as ProfileSlotSchema,Pe as ProfileSlotStatusSchema,jd as ProviderStatusSchema,zd as PtzAutotrackRuntimeStateSchema,Dt as PtzAutotrackSettingsSchema,De as PtzAutotrackStatusSchema,Ld as PtzAutotrackTargetOptionSchema,Jn as PtzMoveCommandSchema,ns as PtzPositionSchema,uu as PtzPresetSchema,gu as PtzStatusSchema,tt as QueryFilterSchema,vy as RECOGNITION_TYPES,by as RUNTIME_DEFAULTS,_h as RUNTIME_TO_FORMAT,Mu as RawStateResultSchema,sy as ReadinessRegistry,Mh as ReadinessTimeoutError,bu as RecordingAvailabilitySchema,Ve as RecordingConfigSchema,ku as RecordingDeviceUsageSchema,wu as RecordingLocationUsageSchema,Iu as RecordingManifestSchema,qc as RecordingModeSchema,fu as RecordingRangeSchema,Lc as RecordingRetentionSchema,Oc as RecordingRuleSchema,Bc as RecordingScheduleSchema,Xn as RecordingStatusSchema,Cu as RecordingStorageUsageSchema,Rc as RecordingWeekdaySchema,Kp as RegisteredStreamSchema,hd as ReportMotionInputSchema,gS as RingBuffer,yr as RtpSourceSchema,kt as RtspRestreamEntrySchema,vd as RunnerCameraConfigSchema,Uv as RunnerCameraDeviceUIFields,ii as RunnerLocalLoadSchema,yd as RunnerLocalMetricsSchema,dS as SCOPE_PRESETS,Fo as SOURCE_INFO_METADATA_KEY,uv as STREAM_PROFILE_META,xh as STREAM_QUALITY_LABELS,hy as SUB_DETECTION_TYPES,rS as SYSTEM_CAP_NAMES,Vv as ScopedTokenSchema,zt as ScopedTokenSummarySchema,vn as ScriptRunnerStatusSchema,oh as SearchResultSchema,Ul as SendEmailInputSchema,_l as SendEmailResultSchema,xn as SettingsPatchSchema,Rn as SettingsRecordSchema,ee as SettingsSchemaWithValuesSchema,Tn as SettingsUpdateResultSchema,Wp as ShmRingStatsSchema,yn as SmokeStatusSchema,On as SmtpStatusSchema,es as SnapshotImageSchema,se as SourceInfoSchema,Ur as SpatialDetectionSchema,qn as SsoBridgeClaimsSchema,fp as StartEmbeddedInputSchema,ll as StorageAbortUploadInputSchema,pl as StorageBeginDownloadInputSchema,ml as StorageBeginDownloadResultSchema,sl as StorageBeginUploadInputSchema,cl as StorageBeginUploadResultSchema,gl as StorageEndDownloadInputSchema,dl as StorageFinalizeUploadInputSchema,zc as StorageLocationDeclarationSchema,W as StorageLocationRefSchema,O as StorageLocationSchema,It as StorageLocationTypeSchema,ol as StorageProviderInfoSchema,ul as StorageReadChunkInputSchema,il as StorageTestLocationResultSchema,rl as StorageWriteChunkInputSchema,La as StreamCodecSchema,Kt as StreamFormatSchema,sr as StreamInfoSchema,Pg as StreamNetworkStatsSchema,_d as StreamParamsOptionsSchema,Sn as StreamParamsStatusSchema,Qe as StreamProfileConfigSchema,Ye as StreamProfileOptionsSchema,Fd as StreamProfilePatchSchema,Ud as StreamProfileSchema,kc as StreamSourceEntrySchema,Pv as StreamSourceSchema,Mc as SubscribeAudioChunksInputSchema,Dc as SubscribeAudioChunksResultSchema,Ac as SubscribeFramesInputSchema,Nc as SubscribeFramesResultSchema,fn as SwitchStatusSchema,pu as SystemMetricsSchema,Zy as SystemMirror,Ph as TIMEZONES,bn as TamperStatusSchema,Ie as TankStatusSchema,In as TemperatureSensorStatusSchema,Kg as TestConnectionResultSchema,xg as ToastSchema,z as TokenScopeSchema,Og as TopologyNodeSchema,Rg as TopologyProcessSchema,Eg as TopologyServiceSchema,it as TrackSchema,Xt as TrackStateSchema,Xm as TrackedDetectionSchema,xm as TurnServerSchema,Ln as UnifiedBrokerInfoSchema,Gg as UpdateIntegrationInputSchema,kn as UpdateStatusSchema,hg as UpdateUserInputSchema,$v as UserRecordSchema,rt as UserSummarySchema,wn as VacuumControlStatusSchema,Hd as VacuumStateSchema,$d as ValveStateSchema,Cn as ValveStatusSchema,An as VibrationStatusSchema,_c as VideoEncodeSchema,fc as WELL_KNOWN_TABS,kv as WELL_KNOWN_TAB_MAP,Nn as WaterHeaterStatusSchema,Pn as WeatherStatusSchema,Qp as WebrtcStreamChoiceSchema,Te as WebrtcStreamTargetSchema,qp as WidgetHostEnum,Qi as WidgetMetadataSchema,Op as WidgetRemoteSchema,Fn as WidgetSizeEnum,Vc as YAMNET_TO_MACRO,md as ZoneKindEnum,Kd as ZoneRuleModeEnum,ge as ZoneRuleSchema,Dn as ZoneRuleStageEnum,Fv as ZoneRulesArraySchema,ue as ZoneSchema,Wd as ZoneScopeBreakdownSchema,_u as accessoriesCapability,Ev as accessoryStableId,Ep as addonPagesCapability,Bp as addonPagesSourceCapability,$p as addonRoutesCapability,Yd as addonSettingsCapability,Up as addonWidgetsCapability,Lp as addonWidgetsSourceCapability,yh as addonsCapability,El as adminUiCapability,Hm as advancedNotifierCapability,wo as airQualitySensorCapability,Ao as alarmPanelCapability,tl as alertsCapability,No as ambientLightSensorCapability,Ky as applyTransform,Cy as asBoolean,Iy as asJsonArray,zh as asJsonObject,wy as asNumber,ky as asString,cm as audioAnalysisCapability,sm as audioAnalyzerCapability,um as audioCodecCapability,Po as audioMetricsCapability,Nm as authProviderCapability,uy as autoAssignProfiles,Mo as automationControlCapability,Al as backupCapability,Do as batteryCapability,mS as bestLocationMatch,xo as binaryCapability,fS as bindAddonActions,To as brightnessCapability,pp as brokerCapability,oy as buildAddonRouteProvider,Xy as buildStreamParamsConfigSchema,Bu as buttonCapability,Eu as cameraCredentialsCapability,Wm as cameraPipelineConfigCapability,Eo as cameraStreamsCapability,Ro as carbonMonoxideCapability,vS as cellsToRects,ly as classifyStream,Eh as classifyStreams,Bo as climateControlCapability,qo as colorCapability,Oo as connectivityCapability,Lo as consumablesCapability,zo as contactCapability,Uo as controlCapability,My as cosineSimilarity,_o as coverCapability,iv as createDeviceProxy,mo as createDurableState,ta as createEvent,ps as createLazyTrpcSource,nv as createMirrorSource,Fy as createRuntimeStateBridge,N as createSliceHandle,Gy as createSystemProxy,Yy as customAction,Vp as decoderCapability,Qy as defineCustomActions,$m as detectionPipelineCapability,Gl as deviceAdoptionCapability,Jy as deviceCustomAction,Ho as deviceDiscoveryCapability,Dp as deviceExportCapability,Cm as deviceManagerCapability,Gc as deviceMatchesProfile,Du as deviceOpsCapability,Fi as deviceProviderCapability,Am as deviceStateCapability,Wt as deviceStatusCapability,$o as doorbellCapability,hm as embeddingEncoderCapability,cy as emitDownForOwnedCaps,bh as emitReadiness,Mv as encodeProfileFromStreamShape,Wo as enumSensorCapability,tv as enumerateSchemaFields,$c as errMsg,jy as evaluateZoneRules,Y as event,Ko as eventEmitterCapability,Su as eventsCapability,Bv as expandCapMethods,xr as extractSourceInfoFromMetadata,Go as fanControlCapability,Vt as featureProbeCapability,iy as findTimezone,Zo as floodCapability,Ey as formatForBackend,Ry as formatForRuntime,Qo as gasCapability,xv as getAudioMacroClassIds,Vy as getByPath,pS as getCapsByProviderKind,Py as hfModelUrl,Yo as humidifierCapability,Jo as humiditySensorCapability,Ca as hydrateSchema,Xo as imageCapability,Qg as integrationsCapability,$u as intercomCapability,Xv as isAgentOnlyPlacement,Jv as isDeployableToAgent,qv as isDeviceConfigCap,ny as isEvent,ei as lawnMowerControlCapability,dg as localNetworkCapability,yv as locationSimilarity,ti as lockControlCapability,Dl as logDestinationCapability,wv as makeProfileBrokerId,Cv as makeSourceBrokerId,Dv as mapAudioLabelToMacro,uS as maskUrlCredentials,ni as mediaPlayerCapability,Dr as mergeSourceInfo,ug as meshNetworkCapability,r as method,mu as metricsProviderCapability,si as motionCapability,Hr as motionDetectionCapability,ri as motionTriggerCapability,hi as motionZonesCapability,Ip as mqttBrokerCapability,Si as nativeObjectDetectionCapability,Dm as networkAccessCapability,Dg as networkQualityCapability,Wg as nodesCapability,kh as normalizeAddonInitResult,Lv as normalizeUnit,Om as notificationOutputCapability,fi as notifierCapability,bi as numericSensorCapability,Ol as oauthIntegrationCapability,zu as osdCapability,my as parseCameraStreamConfig,Ny as parseJsonArray,Ay as parseJsonObject,cs as parseJsonUnknown,Av as parseProfileBrokerId,eS as parseStreamParamsFormPatch,yy as pickPreferredRtspEntry,eu as pipelineAnalyticsCapability,pd as pipelineExecutorCapability,am as pipelineOrchestratorCapability,Sd as pipelineRunnerCapability,ng as platformProbeCapability,Ii as powerMeterCapability,ki as presenceCapability,wi as pressureSensorCapability,Ai as privacyMaskCapability,Ni as ptzAutotrackCapability,vu as ptzCapability,By as pythonScriptForBackend,pt as readinessKey,Ru as rebootCapability,Au as recordingCapability,hS as rectsToCells,qy as requiresPython,$e as resolveAddonExecution,ey as resolveAddonGroup,ay as resolveAddonPlacement,Ty as resolveAddonRuntime,Hh as resolveDetectionRuntime,Rv as resolveDeviceProfile,xy as resolveModelFormat,ty as resolveRunnerId,Gp as restreamerCapability,Oy as runInferenceStep,ae as scopeKey,Pi as scriptRunnerCapability,Nv as selectAssignedProfileSlots,Xh as setByPath,Ml as settingsStoreCapability,yS as sleep,SS as sleepCancellable,Mi as smokeCapability,Fl as smtpProviderCapability,Rm as snapshotCapability,Bm as snapshotProviderCapability,Bl as ssoBridgeCapability,nl as storageCapability,Sl as storageEvictableCapability,hl as storageProviderCapability,Sr as streamBrokerCapability,Vu as streamCatalogCapability,Di as streamParamsCapability,Th as streamPixels,dy as streamQualityLabel,cr as streamingEngineCapability,xi as switchCapability,Mr as synthesizeSourceInfo,Ng as systemCapability,Ti as tamperCapability,Ei as temperatureSensorCapability,Kh as toDeviceSummary,py as toStreamSourceEntry,Tg as toastCapability,Tm as turnProviderCapability,Ri as updateCapability,wg as userManagementCapability,zl as userPasskeysCapability,Bi as vacuumControlCapability,qi as valveCapability,Oi as vibrationCapability,Li as waterHeaterCapability,zi as weatherCapability,Zp as webrtcCapability,Yi as webrtcClientHintsSchema,Yp as webrtcSessionCapability,vc as wiringAddonHealthSchema,Iv as wiringHealthSnapshotSchema,yc as wiringNodeHealthSchema,hc as wiringProbeKindSchema,wa as wiringProbeResultSchema,Wy as zodEntriesToConfigUI,Ui as zoneAnalyticsCapability,_i as zoneRulesCapability,oi as zonesCapability};
|